pa_encoder 0.1.0 → 0.2.0
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 +191 -0
- package/dist/browser/index.js +17 -0
- package/dist/cli.js +144 -0
- package/dist/index.js +402 -160
- package/dist/ui/encoder.html +469 -0
- package/dist/ui/encoder.js +368 -0
- package/dist/ui/preview.html +20 -0
- package/dist/ui/preview.js +322 -0
- package/package.json +5 -3
package/README.md
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
# pa_encoder
|
|
2
|
+
|
|
3
|
+
pa_encoder는 브라우저에서 실행되는 canvas 기반 스케치/애니메이션을 **프레임 이미지(PNG)로 추출**하는 인코더입니다.
|
|
4
|
+
|
|
5
|
+
Live(실시간) 캡처와 Frame(결정적/정밀) 캡처를 모두 지원하며, **DOM에 `<canvas>`가 존재하는 모든 웹 프로젝트**에서 사용할 수 있습니다.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
pa_encoder is an encoder that **extracts browser-based canvas sketches and animations into image frames (PNG)**.
|
|
10
|
+
|
|
11
|
+
It supports both **Live (realtime) capture** and **Frame (deterministic) capture**, and can be used with **any web project that renders to a DOM `<canvas>`**.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
### 핵심 개념
|
|
16
|
+
|
|
17
|
+
- **Live mode (realtime)**
|
|
18
|
+
실제 브라우저 렌더 루프를 그대로 기록합니다. 마우스/키보드 등 **실시간 인터랙션**이 결과에 반영됩니다.
|
|
19
|
+
성능 저하나 프레임 드랍도 “있는 그대로” 기록됩니다.
|
|
20
|
+
|
|
21
|
+
- **Frame mode (deterministic)**
|
|
22
|
+
가상 시간(virtual time)을 사용해 `fps`와 `frames`에 맞춰 **프레임을 정확히 step**합니다.
|
|
23
|
+
`Date.now`, `performance.now`, `requestAnimationFrame`, timer를 훅하여 `deltaTime` 기반 애니메이션을 **정밀하게 재현**합니다.
|
|
24
|
+
동일한 설정/초기 상태에서 **항상 동일한 결과**를 목표로 합니다.
|
|
25
|
+
|
|
26
|
+
### 설치
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install pa_encoder
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
또는
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pnpm add pa_encoder
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 빠른 시작
|
|
39
|
+
|
|
40
|
+
프로젝트 루트에서 실행:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
npx pa_encoder
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
기본 가정:
|
|
47
|
+
|
|
48
|
+
- dev 서버: http://localhost:5173
|
|
49
|
+
- entry 파일: /src/main.js
|
|
50
|
+
|
|
51
|
+
브라우저가 열리며 encoder UI가 표시됩니다.
|
|
52
|
+
|
|
53
|
+
### CLI 옵션
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
npx pa_encoder --url <dev_server_url> --entry <entry_path> --port <ui_port>
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
예시:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
npx pa_encoder --url http://localhost:3000 --entry /src/sketch.js
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### UI 사용 방법
|
|
66
|
+
|
|
67
|
+
1. **Entry**에 스케치 엔트리 파일 경로를 입력합니다(예: `/src/main.js`).
|
|
68
|
+
2. **Mode**를 선택합니다.
|
|
69
|
+
- Live: 실시간 인터랙션 포함 캡처
|
|
70
|
+
- Frame: fps/frames 기반 정밀 캡처
|
|
71
|
+
3. **Canvas**에서 캡처할 캔버스를 선택합니다(기본: auto).
|
|
72
|
+
4. **Start**로 시작, **Stop**으로 종료합니다.
|
|
73
|
+
|
|
74
|
+
#### 키보드 인터랙션과 단축키 동작
|
|
75
|
+
|
|
76
|
+
- 녹화 **시작 전(Idle)** 에는 UI 단축키가 동작합니다.
|
|
77
|
+
- `H`: UI 숨김
|
|
78
|
+
- `P`: Passthrough 토글
|
|
79
|
+
- `C`: Compact 토글
|
|
80
|
+
- `D`: Dock 위치 변경
|
|
81
|
+
- `Space`: Start
|
|
82
|
+
- 녹화 **진행 중(Running)** 에는 UI가 키보드를 가로채지 않습니다.
|
|
83
|
+
즉, 키 입력이 스케치(캔버스) 쪽으로 들어가도록 설계되어 있습니다.
|
|
84
|
+
필요 시 `Focus Sketch` 버튼을 누른 뒤 캔버스를 한 번 클릭하면 포커스가 확실해집니다(브라우저 정책에 따라 자동 포커스가 제한될 수 있음).
|
|
85
|
+
|
|
86
|
+
### Exporter
|
|
87
|
+
|
|
88
|
+
- **ZIP (download)**: 프레임 PNG를 ZIP으로 묶어 다운로드
|
|
89
|
+
- **FS (directory)**: File System Access API로 디렉토리에 저장
|
|
90
|
+
- **Best (auto)**: 환경에 맞춰 ZIP 또는 FS 자동 선택
|
|
91
|
+
|
|
92
|
+
### 지원 범위 / 제한 사항
|
|
93
|
+
|
|
94
|
+
- DOM에 붙어 있는 `<canvas>`만 캡처합니다.
|
|
95
|
+
- WebGL FBO/render target 텍스처를 “직접 선택”해 인코딩하는 기능은 없습니다.
|
|
96
|
+
오프스크린 결과를 화면 canvas로 출력하면 캡처 가능합니다.
|
|
97
|
+
- OffscreenCanvas + Worker 렌더링은 Live에서는 동작할 수 있으나, Frame에서 결정성을 보장하지 않습니다.
|
|
98
|
+
- cross-origin 이미지/비디오 등을 CORS 설정 없이 텍스처로 사용하면 canvas가 tainted 되어 `toBlob()` 캡처가 실패할 수 있습니다.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
### Core Ideas
|
|
103
|
+
|
|
104
|
+
- **Live mode (realtime)**
|
|
105
|
+
Records the canvas as it is rendered in real time, including **mouse/keyboard interaction**.
|
|
106
|
+
Performance drops and frame skips are captured as-is.
|
|
107
|
+
|
|
108
|
+
- **Frame mode (deterministic)**
|
|
109
|
+
Uses virtual time and advances frames in fixed steps according to `fps` and `frames`.
|
|
110
|
+
Hooks `Date.now`, `performance.now`, `requestAnimationFrame`, and timers to reproduce **deltaTime-based animation** precisely.
|
|
111
|
+
With the same code/settings/initial state, it aims to produce **reproducible output**.
|
|
112
|
+
|
|
113
|
+
### Installation
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
npm install pa_encoder
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Or:
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
pnpm add pa_encoder
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Quick Start
|
|
126
|
+
|
|
127
|
+
Run from your project root:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
npx pa_encoder
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Default assumptions:
|
|
134
|
+
|
|
135
|
+
- dev server: http://localhost:5173
|
|
136
|
+
- entry file: /src/main.js
|
|
137
|
+
|
|
138
|
+
The encoder UI opens in your browser.
|
|
139
|
+
|
|
140
|
+
### CLI Options
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
npx pa_encoder --url <dev_server_url> --entry <entry_path> --port <ui_port>
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Example:
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
npx pa_encoder --url http://localhost:3000 --entry /src/sketch.js
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### UI Usage
|
|
153
|
+
|
|
154
|
+
1. Set **Entry** (e.g. `/src/main.js`).
|
|
155
|
+
2. Choose **Mode**:
|
|
156
|
+
- Live: realtime capture with interaction
|
|
157
|
+
- Frame: deterministic capture by fps/frames
|
|
158
|
+
3. Select **Canvas** (default: auto).
|
|
159
|
+
4. Click **Start** to begin and **Stop** to finish.
|
|
160
|
+
|
|
161
|
+
#### Keyboard interaction vs hotkeys
|
|
162
|
+
|
|
163
|
+
- When **Idle (not recording)**, UI hotkeys work:
|
|
164
|
+
- `H`: hide UI
|
|
165
|
+
- `P`: toggle passthrough
|
|
166
|
+
- `C`: toggle compact
|
|
167
|
+
- `D`: change dock position
|
|
168
|
+
- `Space`: start
|
|
169
|
+
- When **Running (recording)**, the UI does not consume keyboard events.
|
|
170
|
+
This is intended to keep keyboard input going to the sketch/canvas.
|
|
171
|
+
If focus is not acquired automatically (browser-dependent), click `Focus Sketch` and then click the canvas once.
|
|
172
|
+
|
|
173
|
+
### Exporters
|
|
174
|
+
|
|
175
|
+
- **ZIP (download)**: bundles PNG frames into a ZIP file
|
|
176
|
+
- **FS (directory)**: writes files via the File System Access API
|
|
177
|
+
- **Best (auto)**: chooses ZIP or FS depending on the environment
|
|
178
|
+
|
|
179
|
+
### Notes and Limitations
|
|
180
|
+
|
|
181
|
+
- Only DOM-attached `<canvas>` elements can be captured.
|
|
182
|
+
- Direct selection/encoding of WebGL FBO/render-target textures is not supported.
|
|
183
|
+
If the result is drawn to a visible canvas, it can be captured.
|
|
184
|
+
- OffscreenCanvas + Worker rendering may work in Live mode, but deterministic behavior is not guaranteed in Frame mode.
|
|
185
|
+
- Cross-origin media without proper CORS headers can taint the canvas and make `toBlob()` fail.
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## License
|
|
190
|
+
|
|
191
|
+
MIT
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
var Lt=Object.create;var It=Object.defineProperty;var Mt=Object.getOwnPropertyDescriptor;var Ut=Object.getOwnPropertyNames;var Pt=Object.getPrototypeOf,jt=Object.prototype.hasOwnProperty;var _t=(f=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(f,{get:(C,b)=>(typeof require<"u"?require:C)[b]}):f)(function(f){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+f+'" is not supported')});var Wt=(f,C)=>()=>(C||f((C={exports:{}}).exports,C),C.exports);var Zt=(f,C,b,o)=>{if(C&&typeof C=="object"||typeof C=="function")for(let u of Ut(C))!jt.call(f,u)&&u!==b&&It(f,u,{get:()=>C[u],enumerable:!(o=Mt(C,u))||o.enumerable});return f};var Ht=(f,C,b)=>(b=f!=null?Lt(Pt(f)):{},Zt(C||!f||!f.__esModule?It(b,"default",{value:f,enumerable:!0}):b,f));var Bt=Wt((Ot,At)=>{(function(f){typeof Ot=="object"&&typeof At<"u"?At.exports=f():typeof define=="function"&&define.amd?define([],f):(typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this).JSZip=f()})(function(){return(function f(C,b,o){function u(g,v){if(!b[g]){if(!C[g]){var p=typeof _t=="function"&&_t;if(!v&&p)return p(g,!0);if(r)return r(g,!0);var w=new Error("Cannot find module '"+g+"'");throw w.code="MODULE_NOT_FOUND",w}var i=b[g]={exports:{}};C[g][0].call(i.exports,function(d){var n=C[g][1][d];return u(n||d)},i,i.exports,f,C,b,o)}return b[g].exports}for(var r=typeof _t=="function"&&_t,a=0;a<o.length;a++)u(o[a]);return u})({1:[function(f,C,b){"use strict";var o=f("./utils"),u=f("./support"),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";b.encode=function(a){for(var g,v,p,w,i,d,n,h=[],s=0,_=a.length,y=_,S=o.getTypeOf(a)!=="string";s<a.length;)y=_-s,p=S?(g=a[s++],v=s<_?a[s++]:0,s<_?a[s++]:0):(g=a.charCodeAt(s++),v=s<_?a.charCodeAt(s++):0,s<_?a.charCodeAt(s++):0),w=g>>2,i=(3&g)<<4|v>>4,d=1<y?(15&v)<<2|p>>6:64,n=2<y?63&p:64,h.push(r.charAt(w)+r.charAt(i)+r.charAt(d)+r.charAt(n));return h.join("")},b.decode=function(a){var g,v,p,w,i,d,n=0,h=0,s="data:";if(a.substr(0,s.length)===s)throw new Error("Invalid base64 input, it looks like a data url.");var _,y=3*(a=a.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(a.charAt(a.length-1)===r.charAt(64)&&y--,a.charAt(a.length-2)===r.charAt(64)&&y--,y%1!=0)throw new Error("Invalid base64 input, bad content length.");for(_=u.uint8array?new Uint8Array(0|y):new Array(0|y);n<a.length;)g=r.indexOf(a.charAt(n++))<<2|(w=r.indexOf(a.charAt(n++)))>>4,v=(15&w)<<4|(i=r.indexOf(a.charAt(n++)))>>2,p=(3&i)<<6|(d=r.indexOf(a.charAt(n++))),_[h++]=g,i!==64&&(_[h++]=v),d!==64&&(_[h++]=p);return _}},{"./support":30,"./utils":32}],2:[function(f,C,b){"use strict";var o=f("./external"),u=f("./stream/DataWorker"),r=f("./stream/Crc32Probe"),a=f("./stream/DataLengthProbe");function g(v,p,w,i,d){this.compressedSize=v,this.uncompressedSize=p,this.crc32=w,this.compression=i,this.compressedContent=d}g.prototype={getContentWorker:function(){var v=new u(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),p=this;return v.on("end",function(){if(this.streamInfo.data_length!==p.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),v},getCompressedWorker:function(){return new u(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},g.createWorkerFrom=function(v,p,w){return v.pipe(new r).pipe(new a("uncompressedSize")).pipe(p.compressWorker(w)).pipe(new a("compressedSize")).withStreamInfo("compression",p)},C.exports=g},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(f,C,b){"use strict";var o=f("./stream/GenericWorker");b.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},b.DEFLATE=f("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(f,C,b){"use strict";var o=f("./utils"),u=(function(){for(var r,a=[],g=0;g<256;g++){r=g;for(var v=0;v<8;v++)r=1&r?3988292384^r>>>1:r>>>1;a[g]=r}return a})();C.exports=function(r,a){return r!==void 0&&r.length?o.getTypeOf(r)!=="string"?(function(g,v,p,w){var i=u,d=w+p;g^=-1;for(var n=w;n<d;n++)g=g>>>8^i[255&(g^v[n])];return-1^g})(0|a,r,r.length,0):(function(g,v,p,w){var i=u,d=w+p;g^=-1;for(var n=w;n<d;n++)g=g>>>8^i[255&(g^v.charCodeAt(n))];return-1^g})(0|a,r,r.length,0):0}},{"./utils":32}],5:[function(f,C,b){"use strict";b.base64=!1,b.binary=!1,b.dir=!1,b.createFolders=!0,b.date=null,b.compression=null,b.compressionOptions=null,b.comment=null,b.unixPermissions=null,b.dosPermissions=null},{}],6:[function(f,C,b){"use strict";var o=null;o=typeof Promise<"u"?Promise:f("lie"),C.exports={Promise:o}},{lie:37}],7:[function(f,C,b){"use strict";var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",u=f("pako"),r=f("./utils"),a=f("./stream/GenericWorker"),g=o?"uint8array":"array";function v(p,w){a.call(this,"FlateWorker/"+p),this._pako=null,this._pakoAction=p,this._pakoOptions=w,this.meta={}}b.magic="\b\0",r.inherits(v,a),v.prototype.processChunk=function(p){this.meta=p.meta,this._pako===null&&this._createPako(),this._pako.push(r.transformTo(g,p.data),!1)},v.prototype.flush=function(){a.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},v.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},v.prototype._createPako=function(){this._pako=new u[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var p=this;this._pako.onData=function(w){p.push({data:w,meta:p.meta})}},b.compressWorker=function(p){return new v("Deflate",p)},b.uncompressWorker=function(){return new v("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(f,C,b){"use strict";function o(i,d){var n,h="";for(n=0;n<d;n++)h+=String.fromCharCode(255&i),i>>>=8;return h}function u(i,d,n,h,s,_){var y,S,x=i.file,D=i.compression,F=_!==g.utf8encode,U=r.transformTo("string",_(x.name)),B=r.transformTo("string",g.utf8encode(x.name)),j=x.comment,K=r.transformTo("string",_(j)),c=r.transformTo("string",g.utf8encode(j)),E=B.length!==x.name.length,e=c.length!==j.length,I="",q="",N="",X=x.dir,P=x.date,$={crc32:0,compressedSize:0,uncompressedSize:0};d&&!n||($.crc32=i.crc32,$.compressedSize=i.compressedSize,$.uncompressedSize=i.uncompressedSize);var T=0;d&&(T|=8),F||!E&&!e||(T|=2048);var z=0,J=0;X&&(z|=16),s==="UNIX"?(J=798,z|=(function(H,nt){var ot=H;return H||(ot=nt?16893:33204),(65535&ot)<<16})(x.unixPermissions,X)):(J=20,z|=(function(H){return 63&(H||0)})(x.dosPermissions)),y=P.getUTCHours(),y<<=6,y|=P.getUTCMinutes(),y<<=5,y|=P.getUTCSeconds()/2,S=P.getUTCFullYear()-1980,S<<=4,S|=P.getUTCMonth()+1,S<<=5,S|=P.getUTCDate(),E&&(q=o(1,1)+o(v(U),4)+B,I+="up"+o(q.length,2)+q),e&&(N=o(1,1)+o(v(K),4)+c,I+="uc"+o(N.length,2)+N);var G="";return G+=`
|
|
2
|
+
\0`,G+=o(T,2),G+=D.magic,G+=o(y,2),G+=o(S,2),G+=o($.crc32,4),G+=o($.compressedSize,4),G+=o($.uncompressedSize,4),G+=o(U.length,2),G+=o(I.length,2),{fileRecord:p.LOCAL_FILE_HEADER+G+U+I,dirRecord:p.CENTRAL_FILE_HEADER+o(J,2)+G+o(K.length,2)+"\0\0\0\0"+o(z,4)+o(h,4)+U+I+K}}var r=f("../utils"),a=f("../stream/GenericWorker"),g=f("../utf8"),v=f("../crc32"),p=f("../signature");function w(i,d,n,h){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=d,this.zipPlatform=n,this.encodeFileName=h,this.streamFiles=i,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(w,a),w.prototype.push=function(i){var d=i.meta.percent||0,n=this.entriesCount,h=this._sources.length;this.accumulate?this.contentBuffer.push(i):(this.bytesWritten+=i.data.length,a.prototype.push.call(this,{data:i.data,meta:{currentFile:this.currentFile,percent:n?(d+100*(n-h-1))/n:100}}))},w.prototype.openedSource=function(i){this.currentSourceOffset=this.bytesWritten,this.currentFile=i.file.name;var d=this.streamFiles&&!i.file.dir;if(d){var n=u(i,d,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},w.prototype.closedSource=function(i){this.accumulate=!1;var d=this.streamFiles&&!i.file.dir,n=u(i,d,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),d)this.push({data:(function(h){return p.DATA_DESCRIPTOR+o(h.crc32,4)+o(h.compressedSize,4)+o(h.uncompressedSize,4)})(i),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},w.prototype.flush=function(){for(var i=this.bytesWritten,d=0;d<this.dirRecords.length;d++)this.push({data:this.dirRecords[d],meta:{percent:100}});var n=this.bytesWritten-i,h=(function(s,_,y,S,x){var D=r.transformTo("string",x(S));return p.CENTRAL_DIRECTORY_END+"\0\0\0\0"+o(s,2)+o(s,2)+o(_,4)+o(y,4)+o(D.length,2)+D})(this.dirRecords.length,n,i,this.zipComment,this.encodeFileName);this.push({data:h,meta:{percent:100}})},w.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},w.prototype.registerPrevious=function(i){this._sources.push(i);var d=this;return i.on("data",function(n){d.processChunk(n)}),i.on("end",function(){d.closedSource(d.previous.streamInfo),d._sources.length?d.prepareNextSource():d.end()}),i.on("error",function(n){d.error(n)}),this},w.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},w.prototype.error=function(i){var d=this._sources;if(!a.prototype.error.call(this,i))return!1;for(var n=0;n<d.length;n++)try{d[n].error(i)}catch{}return!0},w.prototype.lock=function(){a.prototype.lock.call(this);for(var i=this._sources,d=0;d<i.length;d++)i[d].lock()},C.exports=w},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(f,C,b){"use strict";var o=f("../compressions"),u=f("./ZipFileWorker");b.generateWorker=function(r,a,g){var v=new u(a.streamFiles,g,a.platform,a.encodeFileName),p=0;try{r.forEach(function(w,i){p++;var d=(function(_,y){var S=_||y,x=o[S];if(!x)throw new Error(S+" is not a valid compression method !");return x})(i.options.compression,a.compression),n=i.options.compressionOptions||a.compressionOptions||{},h=i.dir,s=i.date;i._compressWorker(d,n).withStreamInfo("file",{name:w,dir:h,date:s,comment:i.comment||"",unixPermissions:i.unixPermissions,dosPermissions:i.dosPermissions}).pipe(v)}),v.entriesCount=p}catch(w){v.error(w)}return v}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(f,C,b){"use strict";function o(){if(!(this instanceof o))return new o;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var u=new o;for(var r in this)typeof this[r]!="function"&&(u[r]=this[r]);return u}}(o.prototype=f("./object")).loadAsync=f("./load"),o.support=f("./support"),o.defaults=f("./defaults"),o.version="3.10.1",o.loadAsync=function(u,r){return new o().loadAsync(u,r)},o.external=f("./external"),C.exports=o},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(f,C,b){"use strict";var o=f("./utils"),u=f("./external"),r=f("./utf8"),a=f("./zipEntries"),g=f("./stream/Crc32Probe"),v=f("./nodejsUtils");function p(w){return new u.Promise(function(i,d){var n=w.decompressed.getContentWorker().pipe(new g);n.on("error",function(h){d(h)}).on("end",function(){n.streamInfo.crc32!==w.decompressed.crc32?d(new Error("Corrupted zip : CRC32 mismatch")):i()}).resume()})}C.exports=function(w,i){var d=this;return i=o.extend(i||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:r.utf8decode}),v.isNode&&v.isStream(w)?u.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):o.prepareContent("the loaded zip file",w,!0,i.optimizedBinaryString,i.base64).then(function(n){var h=new a(i);return h.load(n),h}).then(function(n){var h=[u.Promise.resolve(n)],s=n.files;if(i.checkCRC32)for(var _=0;_<s.length;_++)h.push(p(s[_]));return u.Promise.all(h)}).then(function(n){for(var h=n.shift(),s=h.files,_=0;_<s.length;_++){var y=s[_],S=y.fileNameStr,x=o.resolve(y.fileNameStr);d.file(x,y.decompressed,{binary:!0,optimizedBinaryString:!0,date:y.date,dir:y.dir,comment:y.fileCommentStr.length?y.fileCommentStr:null,unixPermissions:y.unixPermissions,dosPermissions:y.dosPermissions,createFolders:i.createFolders}),y.dir||(d.file(x).unsafeOriginalName=S)}return h.zipComment.length&&(d.comment=h.zipComment),d})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(f,C,b){"use strict";var o=f("../utils"),u=f("../stream/GenericWorker");function r(a,g){u.call(this,"Nodejs stream input adapter for "+a),this._upstreamEnded=!1,this._bindStream(g)}o.inherits(r,u),r.prototype._bindStream=function(a){var g=this;(this._stream=a).pause(),a.on("data",function(v){g.push({data:v,meta:{percent:0}})}).on("error",function(v){g.isPaused?this.generatedError=v:g.error(v)}).on("end",function(){g.isPaused?g._upstreamEnded=!0:g.end()})},r.prototype.pause=function(){return!!u.prototype.pause.call(this)&&(this._stream.pause(),!0)},r.prototype.resume=function(){return!!u.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},C.exports=r},{"../stream/GenericWorker":28,"../utils":32}],13:[function(f,C,b){"use strict";var o=f("readable-stream").Readable;function u(r,a,g){o.call(this,a),this._helper=r;var v=this;r.on("data",function(p,w){v.push(p)||v._helper.pause(),g&&g(w)}).on("error",function(p){v.emit("error",p)}).on("end",function(){v.push(null)})}f("../utils").inherits(u,o),u.prototype._read=function(){this._helper.resume()},C.exports=u},{"../utils":32,"readable-stream":16}],14:[function(f,C,b){"use strict";C.exports={isNode:typeof Buffer<"u",newBufferFrom:function(o,u){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(o,u);if(typeof o=="number")throw new Error('The "data" argument must not be a number');return new Buffer(o,u)},allocBuffer:function(o){if(Buffer.alloc)return Buffer.alloc(o);var u=new Buffer(o);return u.fill(0),u},isBuffer:function(o){return Buffer.isBuffer(o)},isStream:function(o){return o&&typeof o.on=="function"&&typeof o.pause=="function"&&typeof o.resume=="function"}}},{}],15:[function(f,C,b){"use strict";function o(x,D,F){var U,B=r.getTypeOf(D),j=r.extend(F||{},v);j.date=j.date||new Date,j.compression!==null&&(j.compression=j.compression.toUpperCase()),typeof j.unixPermissions=="string"&&(j.unixPermissions=parseInt(j.unixPermissions,8)),j.unixPermissions&&16384&j.unixPermissions&&(j.dir=!0),j.dosPermissions&&16&j.dosPermissions&&(j.dir=!0),j.dir&&(x=s(x)),j.createFolders&&(U=h(x))&&_.call(this,U,!0);var K=B==="string"&&j.binary===!1&&j.base64===!1;F&&F.binary!==void 0||(j.binary=!K),(D instanceof p&&D.uncompressedSize===0||j.dir||!D||D.length===0)&&(j.base64=!1,j.binary=!0,D="",j.compression="STORE",B="string");var c=null;c=D instanceof p||D instanceof a?D:d.isNode&&d.isStream(D)?new n(x,D):r.prepareContent(x,D,j.binary,j.optimizedBinaryString,j.base64);var E=new w(x,c,j);this.files[x]=E}var u=f("./utf8"),r=f("./utils"),a=f("./stream/GenericWorker"),g=f("./stream/StreamHelper"),v=f("./defaults"),p=f("./compressedObject"),w=f("./zipObject"),i=f("./generate"),d=f("./nodejsUtils"),n=f("./nodejs/NodejsStreamInputAdapter"),h=function(x){x.slice(-1)==="/"&&(x=x.substring(0,x.length-1));var D=x.lastIndexOf("/");return 0<D?x.substring(0,D):""},s=function(x){return x.slice(-1)!=="/"&&(x+="/"),x},_=function(x,D){return D=D!==void 0?D:v.createFolders,x=s(x),this.files[x]||o.call(this,x,null,{dir:!0,createFolders:D}),this.files[x]};function y(x){return Object.prototype.toString.call(x)==="[object RegExp]"}var S={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(x){var D,F,U;for(D in this.files)U=this.files[D],(F=D.slice(this.root.length,D.length))&&D.slice(0,this.root.length)===this.root&&x(F,U)},filter:function(x){var D=[];return this.forEach(function(F,U){x(F,U)&&D.push(U)}),D},file:function(x,D,F){if(arguments.length!==1)return x=this.root+x,o.call(this,x,D,F),this;if(y(x)){var U=x;return this.filter(function(j,K){return!K.dir&&U.test(j)})}var B=this.files[this.root+x];return B&&!B.dir?B:null},folder:function(x){if(!x)return this;if(y(x))return this.filter(function(B,j){return j.dir&&x.test(B)});var D=this.root+x,F=_.call(this,D),U=this.clone();return U.root=F.name,U},remove:function(x){x=this.root+x;var D=this.files[x];if(D||(x.slice(-1)!=="/"&&(x+="/"),D=this.files[x]),D&&!D.dir)delete this.files[x];else for(var F=this.filter(function(B,j){return j.name.slice(0,x.length)===x}),U=0;U<F.length;U++)delete this.files[F[U].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(x){var D,F={};try{if((F=r.extend(x||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:u.utf8encode})).type=F.type.toLowerCase(),F.compression=F.compression.toUpperCase(),F.type==="binarystring"&&(F.type="string"),!F.type)throw new Error("No output type specified.");r.checkSupport(F.type),F.platform!=="darwin"&&F.platform!=="freebsd"&&F.platform!=="linux"&&F.platform!=="sunos"||(F.platform="UNIX"),F.platform==="win32"&&(F.platform="DOS");var U=F.comment||this.comment||"";D=i.generateWorker(this,F,U)}catch(B){(D=new a("error")).error(B)}return new g(D,F.type||"string",F.mimeType)},generateAsync:function(x,D){return this.generateInternalStream(x).accumulate(D)},generateNodeStream:function(x,D){return(x=x||{}).type||(x.type="nodebuffer"),this.generateInternalStream(x).toNodejsStream(D)}};C.exports=S},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(f,C,b){"use strict";C.exports=f("stream")},{stream:void 0}],17:[function(f,C,b){"use strict";var o=f("./DataReader");function u(r){o.call(this,r);for(var a=0;a<this.data.length;a++)r[a]=255&r[a]}f("../utils").inherits(u,o),u.prototype.byteAt=function(r){return this.data[this.zero+r]},u.prototype.lastIndexOfSignature=function(r){for(var a=r.charCodeAt(0),g=r.charCodeAt(1),v=r.charCodeAt(2),p=r.charCodeAt(3),w=this.length-4;0<=w;--w)if(this.data[w]===a&&this.data[w+1]===g&&this.data[w+2]===v&&this.data[w+3]===p)return w-this.zero;return-1},u.prototype.readAndCheckSignature=function(r){var a=r.charCodeAt(0),g=r.charCodeAt(1),v=r.charCodeAt(2),p=r.charCodeAt(3),w=this.readData(4);return a===w[0]&&g===w[1]&&v===w[2]&&p===w[3]},u.prototype.readData=function(r){if(this.checkOffset(r),r===0)return[];var a=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,a},C.exports=u},{"../utils":32,"./DataReader":18}],18:[function(f,C,b){"use strict";var o=f("../utils");function u(r){this.data=r,this.length=r.length,this.index=0,this.zero=0}u.prototype={checkOffset:function(r){this.checkIndex(this.index+r)},checkIndex:function(r){if(this.length<this.zero+r||r<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+r+"). Corrupted zip ?")},setIndex:function(r){this.checkIndex(r),this.index=r},skip:function(r){this.setIndex(this.index+r)},byteAt:function(){},readInt:function(r){var a,g=0;for(this.checkOffset(r),a=this.index+r-1;a>=this.index;a--)g=(g<<8)+this.byteAt(a);return this.index+=r,g},readString:function(r){return o.transformTo("string",this.readData(r))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var r=this.readInt(4);return new Date(Date.UTC(1980+(r>>25&127),(r>>21&15)-1,r>>16&31,r>>11&31,r>>5&63,(31&r)<<1))}},C.exports=u},{"../utils":32}],19:[function(f,C,b){"use strict";var o=f("./Uint8ArrayReader");function u(r){o.call(this,r)}f("../utils").inherits(u,o),u.prototype.readData=function(r){this.checkOffset(r);var a=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,a},C.exports=u},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(f,C,b){"use strict";var o=f("./DataReader");function u(r){o.call(this,r)}f("../utils").inherits(u,o),u.prototype.byteAt=function(r){return this.data.charCodeAt(this.zero+r)},u.prototype.lastIndexOfSignature=function(r){return this.data.lastIndexOf(r)-this.zero},u.prototype.readAndCheckSignature=function(r){return r===this.readData(4)},u.prototype.readData=function(r){this.checkOffset(r);var a=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,a},C.exports=u},{"../utils":32,"./DataReader":18}],21:[function(f,C,b){"use strict";var o=f("./ArrayReader");function u(r){o.call(this,r)}f("../utils").inherits(u,o),u.prototype.readData=function(r){if(this.checkOffset(r),r===0)return new Uint8Array(0);var a=this.data.subarray(this.zero+this.index,this.zero+this.index+r);return this.index+=r,a},C.exports=u},{"../utils":32,"./ArrayReader":17}],22:[function(f,C,b){"use strict";var o=f("../utils"),u=f("../support"),r=f("./ArrayReader"),a=f("./StringReader"),g=f("./NodeBufferReader"),v=f("./Uint8ArrayReader");C.exports=function(p){var w=o.getTypeOf(p);return o.checkSupport(w),w!=="string"||u.uint8array?w==="nodebuffer"?new g(p):u.uint8array?new v(o.transformTo("uint8array",p)):new r(o.transformTo("array",p)):new a(p)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(f,C,b){"use strict";b.LOCAL_FILE_HEADER="PK",b.CENTRAL_FILE_HEADER="PK",b.CENTRAL_DIRECTORY_END="PK",b.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",b.ZIP64_CENTRAL_DIRECTORY_END="PK",b.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(f,C,b){"use strict";var o=f("./GenericWorker"),u=f("../utils");function r(a){o.call(this,"ConvertWorker to "+a),this.destType=a}u.inherits(r,o),r.prototype.processChunk=function(a){this.push({data:u.transformTo(this.destType,a.data),meta:a.meta})},C.exports=r},{"../utils":32,"./GenericWorker":28}],25:[function(f,C,b){"use strict";var o=f("./GenericWorker"),u=f("../crc32");function r(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}f("../utils").inherits(r,o),r.prototype.processChunk=function(a){this.streamInfo.crc32=u(a.data,this.streamInfo.crc32||0),this.push(a)},C.exports=r},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(f,C,b){"use strict";var o=f("../utils"),u=f("./GenericWorker");function r(a){u.call(this,"DataLengthProbe for "+a),this.propName=a,this.withStreamInfo(a,0)}o.inherits(r,u),r.prototype.processChunk=function(a){if(a){var g=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=g+a.data.length}u.prototype.processChunk.call(this,a)},C.exports=r},{"../utils":32,"./GenericWorker":28}],27:[function(f,C,b){"use strict";var o=f("../utils"),u=f("./GenericWorker");function r(a){u.call(this,"DataWorker");var g=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,a.then(function(v){g.dataIsReady=!0,g.data=v,g.max=v&&v.length||0,g.type=o.getTypeOf(v),g.isPaused||g._tickAndRepeat()},function(v){g.error(v)})}o.inherits(r,u),r.prototype.cleanUp=function(){u.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!u.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var a=null,g=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":a=this.data.substring(this.index,g);break;case"uint8array":a=this.data.subarray(this.index,g);break;case"array":case"nodebuffer":a=this.data.slice(this.index,g)}return this.index=g,this.push({data:a,meta:{percent:this.max?this.index/this.max*100:0}})},C.exports=r},{"../utils":32,"./GenericWorker":28}],28:[function(f,C,b){"use strict";function o(u){this.name=u||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(u){this.emit("data",u)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(u){this.emit("error",u)}return!0},error:function(u){return!this.isFinished&&(this.isPaused?this.generatedError=u:(this.isFinished=!0,this.emit("error",u),this.previous&&this.previous.error(u),this.cleanUp()),!0)},on:function(u,r){return this._listeners[u].push(r),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(u,r){if(this._listeners[u])for(var a=0;a<this._listeners[u].length;a++)this._listeners[u][a].call(this,r)},pipe:function(u){return u.registerPrevious(this)},registerPrevious:function(u){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=u.streamInfo,this.mergeStreamInfo(),this.previous=u;var r=this;return u.on("data",function(a){r.processChunk(a)}),u.on("end",function(){r.end()}),u.on("error",function(a){r.error(a)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var u=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),u=!0),this.previous&&this.previous.resume(),!u},flush:function(){},processChunk:function(u){this.push(u)},withStreamInfo:function(u,r){return this.extraStreamInfo[u]=r,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var u in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,u)&&(this.streamInfo[u]=this.extraStreamInfo[u])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var u="Worker "+this.name;return this.previous?this.previous+" -> "+u:u}},C.exports=o},{}],29:[function(f,C,b){"use strict";var o=f("../utils"),u=f("./ConvertWorker"),r=f("./GenericWorker"),a=f("../base64"),g=f("../support"),v=f("../external"),p=null;if(g.nodestream)try{p=f("../nodejs/NodejsStreamOutputAdapter")}catch{}function w(d,n){return new v.Promise(function(h,s){var _=[],y=d._internalType,S=d._outputType,x=d._mimeType;d.on("data",function(D,F){_.push(D),n&&n(F)}).on("error",function(D){_=[],s(D)}).on("end",function(){try{var D=(function(F,U,B){switch(F){case"blob":return o.newBlob(o.transformTo("arraybuffer",U),B);case"base64":return a.encode(U);default:return o.transformTo(F,U)}})(S,(function(F,U){var B,j=0,K=null,c=0;for(B=0;B<U.length;B++)c+=U[B].length;switch(F){case"string":return U.join("");case"array":return Array.prototype.concat.apply([],U);case"uint8array":for(K=new Uint8Array(c),B=0;B<U.length;B++)K.set(U[B],j),j+=U[B].length;return K;case"nodebuffer":return Buffer.concat(U);default:throw new Error("concat : unsupported type '"+F+"'")}})(y,_),x);h(D)}catch(F){s(F)}_=[]}).resume()})}function i(d,n,h){var s=n;switch(n){case"blob":case"arraybuffer":s="uint8array";break;case"base64":s="string"}try{this._internalType=s,this._outputType=n,this._mimeType=h,o.checkSupport(s),this._worker=d.pipe(new u(s)),d.lock()}catch(_){this._worker=new r("error"),this._worker.error(_)}}i.prototype={accumulate:function(d){return w(this,d)},on:function(d,n){var h=this;return d==="data"?this._worker.on(d,function(s){n.call(h,s.data,s.meta)}):this._worker.on(d,function(){o.delay(n,arguments,h)}),this},resume:function(){return o.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(d){if(o.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new p(this,{objectMode:this._outputType!=="nodebuffer"},d)}},C.exports=i},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(f,C,b){"use strict";if(b.base64=!0,b.array=!0,b.string=!0,b.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",b.nodebuffer=typeof Buffer<"u",b.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")b.blob=!1;else{var o=new ArrayBuffer(0);try{b.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var u=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);u.append(o),b.blob=u.getBlob("application/zip").size===0}catch{b.blob=!1}}}try{b.nodestream=!!f("readable-stream").Readable}catch{b.nodestream=!1}},{"readable-stream":16}],31:[function(f,C,b){"use strict";for(var o=f("./utils"),u=f("./support"),r=f("./nodejsUtils"),a=f("./stream/GenericWorker"),g=new Array(256),v=0;v<256;v++)g[v]=252<=v?6:248<=v?5:240<=v?4:224<=v?3:192<=v?2:1;g[254]=g[254]=1;function p(){a.call(this,"utf-8 decode"),this.leftOver=null}function w(){a.call(this,"utf-8 encode")}b.utf8encode=function(i){return u.nodebuffer?r.newBufferFrom(i,"utf-8"):(function(d){var n,h,s,_,y,S=d.length,x=0;for(_=0;_<S;_++)(64512&(h=d.charCodeAt(_)))==55296&&_+1<S&&(64512&(s=d.charCodeAt(_+1)))==56320&&(h=65536+(h-55296<<10)+(s-56320),_++),x+=h<128?1:h<2048?2:h<65536?3:4;for(n=u.uint8array?new Uint8Array(x):new Array(x),_=y=0;y<x;_++)(64512&(h=d.charCodeAt(_)))==55296&&_+1<S&&(64512&(s=d.charCodeAt(_+1)))==56320&&(h=65536+(h-55296<<10)+(s-56320),_++),h<128?n[y++]=h:(h<2048?n[y++]=192|h>>>6:(h<65536?n[y++]=224|h>>>12:(n[y++]=240|h>>>18,n[y++]=128|h>>>12&63),n[y++]=128|h>>>6&63),n[y++]=128|63&h);return n})(i)},b.utf8decode=function(i){return u.nodebuffer?o.transformTo("nodebuffer",i).toString("utf-8"):(function(d){var n,h,s,_,y=d.length,S=new Array(2*y);for(n=h=0;n<y;)if((s=d[n++])<128)S[h++]=s;else if(4<(_=g[s]))S[h++]=65533,n+=_-1;else{for(s&=_===2?31:_===3?15:7;1<_&&n<y;)s=s<<6|63&d[n++],_--;1<_?S[h++]=65533:s<65536?S[h++]=s:(s-=65536,S[h++]=55296|s>>10&1023,S[h++]=56320|1023&s)}return S.length!==h&&(S.subarray?S=S.subarray(0,h):S.length=h),o.applyFromCharCode(S)})(i=o.transformTo(u.uint8array?"uint8array":"array",i))},o.inherits(p,a),p.prototype.processChunk=function(i){var d=o.transformTo(u.uint8array?"uint8array":"array",i.data);if(this.leftOver&&this.leftOver.length){if(u.uint8array){var n=d;(d=new Uint8Array(n.length+this.leftOver.length)).set(this.leftOver,0),d.set(n,this.leftOver.length)}else d=this.leftOver.concat(d);this.leftOver=null}var h=(function(_,y){var S;for((y=y||_.length)>_.length&&(y=_.length),S=y-1;0<=S&&(192&_[S])==128;)S--;return S<0||S===0?y:S+g[_[S]]>y?S:y})(d),s=d;h!==d.length&&(u.uint8array?(s=d.subarray(0,h),this.leftOver=d.subarray(h,d.length)):(s=d.slice(0,h),this.leftOver=d.slice(h,d.length))),this.push({data:b.utf8decode(s),meta:i.meta})},p.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:b.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},b.Utf8DecodeWorker=p,o.inherits(w,a),w.prototype.processChunk=function(i){this.push({data:b.utf8encode(i.data),meta:i.meta})},b.Utf8EncodeWorker=w},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(f,C,b){"use strict";var o=f("./support"),u=f("./base64"),r=f("./nodejsUtils"),a=f("./external");function g(n){return n}function v(n,h){for(var s=0;s<n.length;++s)h[s]=255&n.charCodeAt(s);return h}f("setimmediate"),b.newBlob=function(n,h){b.checkSupport("blob");try{return new Blob([n],{type:h})}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return s.append(n),s.getBlob(h)}catch{throw new Error("Bug : can't construct the Blob.")}}};var p={stringifyByChunk:function(n,h,s){var _=[],y=0,S=n.length;if(S<=s)return String.fromCharCode.apply(null,n);for(;y<S;)h==="array"||h==="nodebuffer"?_.push(String.fromCharCode.apply(null,n.slice(y,Math.min(y+s,S)))):_.push(String.fromCharCode.apply(null,n.subarray(y,Math.min(y+s,S)))),y+=s;return _.join("")},stringifyByChar:function(n){for(var h="",s=0;s<n.length;s++)h+=String.fromCharCode(n[s]);return h},applyCanBeUsed:{uint8array:(function(){try{return o.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return o.nodebuffer&&String.fromCharCode.apply(null,r.allocBuffer(1)).length===1}catch{return!1}})()}};function w(n){var h=65536,s=b.getTypeOf(n),_=!0;if(s==="uint8array"?_=p.applyCanBeUsed.uint8array:s==="nodebuffer"&&(_=p.applyCanBeUsed.nodebuffer),_)for(;1<h;)try{return p.stringifyByChunk(n,s,h)}catch{h=Math.floor(h/2)}return p.stringifyByChar(n)}function i(n,h){for(var s=0;s<n.length;s++)h[s]=n[s];return h}b.applyFromCharCode=w;var d={};d.string={string:g,array:function(n){return v(n,new Array(n.length))},arraybuffer:function(n){return d.string.uint8array(n).buffer},uint8array:function(n){return v(n,new Uint8Array(n.length))},nodebuffer:function(n){return v(n,r.allocBuffer(n.length))}},d.array={string:w,array:g,arraybuffer:function(n){return new Uint8Array(n).buffer},uint8array:function(n){return new Uint8Array(n)},nodebuffer:function(n){return r.newBufferFrom(n)}},d.arraybuffer={string:function(n){return w(new Uint8Array(n))},array:function(n){return i(new Uint8Array(n),new Array(n.byteLength))},arraybuffer:g,uint8array:function(n){return new Uint8Array(n)},nodebuffer:function(n){return r.newBufferFrom(new Uint8Array(n))}},d.uint8array={string:w,array:function(n){return i(n,new Array(n.length))},arraybuffer:function(n){return n.buffer},uint8array:g,nodebuffer:function(n){return r.newBufferFrom(n)}},d.nodebuffer={string:w,array:function(n){return i(n,new Array(n.length))},arraybuffer:function(n){return d.nodebuffer.uint8array(n).buffer},uint8array:function(n){return i(n,new Uint8Array(n.length))},nodebuffer:g},b.transformTo=function(n,h){if(h=h||"",!n)return h;b.checkSupport(n);var s=b.getTypeOf(h);return d[s][n](h)},b.resolve=function(n){for(var h=n.split("/"),s=[],_=0;_<h.length;_++){var y=h[_];y==="."||y===""&&_!==0&&_!==h.length-1||(y===".."?s.pop():s.push(y))}return s.join("/")},b.getTypeOf=function(n){return typeof n=="string"?"string":Object.prototype.toString.call(n)==="[object Array]"?"array":o.nodebuffer&&r.isBuffer(n)?"nodebuffer":o.uint8array&&n instanceof Uint8Array?"uint8array":o.arraybuffer&&n instanceof ArrayBuffer?"arraybuffer":void 0},b.checkSupport=function(n){if(!o[n.toLowerCase()])throw new Error(n+" is not supported by this platform")},b.MAX_VALUE_16BITS=65535,b.MAX_VALUE_32BITS=-1,b.pretty=function(n){var h,s,_="";for(s=0;s<(n||"").length;s++)_+="\\x"+((h=n.charCodeAt(s))<16?"0":"")+h.toString(16).toUpperCase();return _},b.delay=function(n,h,s){setImmediate(function(){n.apply(s||null,h||[])})},b.inherits=function(n,h){function s(){}s.prototype=h.prototype,n.prototype=new s},b.extend=function(){var n,h,s={};for(n=0;n<arguments.length;n++)for(h in arguments[n])Object.prototype.hasOwnProperty.call(arguments[n],h)&&s[h]===void 0&&(s[h]=arguments[n][h]);return s},b.prepareContent=function(n,h,s,_,y){return a.Promise.resolve(h).then(function(S){return o.blob&&(S instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(S))!==-1)&&typeof FileReader<"u"?new a.Promise(function(x,D){var F=new FileReader;F.onload=function(U){x(U.target.result)},F.onerror=function(U){D(U.target.error)},F.readAsArrayBuffer(S)}):S}).then(function(S){var x=b.getTypeOf(S);return x?(x==="arraybuffer"?S=b.transformTo("uint8array",S):x==="string"&&(y?S=u.decode(S):s&&_!==!0&&(S=(function(D){return v(D,o.uint8array?new Uint8Array(D.length):new Array(D.length))})(S))),S):a.Promise.reject(new Error("Can't read the data of '"+n+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(f,C,b){"use strict";var o=f("./reader/readerFor"),u=f("./utils"),r=f("./signature"),a=f("./zipEntry"),g=f("./support");function v(p){this.files=[],this.loadOptions=p}v.prototype={checkSignature:function(p){if(!this.reader.readAndCheckSignature(p)){this.reader.index-=4;var w=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+u.pretty(w)+", expected "+u.pretty(p)+")")}},isSignature:function(p,w){var i=this.reader.index;this.reader.setIndex(p);var d=this.reader.readString(4)===w;return this.reader.setIndex(i),d},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var p=this.reader.readData(this.zipCommentLength),w=g.uint8array?"uint8array":"array",i=u.transformTo(w,p);this.zipComment=this.loadOptions.decodeFileName(i)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var p,w,i,d=this.zip64EndOfCentralSize-44;0<d;)p=this.reader.readInt(2),w=this.reader.readInt(4),i=this.reader.readData(w),this.zip64ExtensibleData[p]={id:p,length:w,value:i}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var p,w;for(p=0;p<this.files.length;p++)w=this.files[p],this.reader.setIndex(w.localHeaderOffset),this.checkSignature(r.LOCAL_FILE_HEADER),w.readLocalPart(this.reader),w.handleUTF8(),w.processAttributes()},readCentralDir:function(){var p;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(r.CENTRAL_FILE_HEADER);)(p=new a({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(p);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var p=this.reader.lastIndexOfSignature(r.CENTRAL_DIRECTORY_END);if(p<0)throw this.isSignature(0,r.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(p);var w=p;if(this.checkSignature(r.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===u.MAX_VALUE_16BITS||this.diskWithCentralDirStart===u.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===u.MAX_VALUE_16BITS||this.centralDirRecords===u.MAX_VALUE_16BITS||this.centralDirSize===u.MAX_VALUE_32BITS||this.centralDirOffset===u.MAX_VALUE_32BITS){if(this.zip64=!0,(p=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(p),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,r.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var i=this.centralDirOffset+this.centralDirSize;this.zip64&&(i+=20,i+=12+this.zip64EndOfCentralSize);var d=w-i;if(0<d)this.isSignature(w,r.CENTRAL_FILE_HEADER)||(this.reader.zero=d);else if(d<0)throw new Error("Corrupted zip: missing "+Math.abs(d)+" bytes.")},prepareReader:function(p){this.reader=o(p)},load:function(p){this.prepareReader(p),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},C.exports=v},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(f,C,b){"use strict";var o=f("./reader/readerFor"),u=f("./utils"),r=f("./compressedObject"),a=f("./crc32"),g=f("./utf8"),v=f("./compressions"),p=f("./support");function w(i,d){this.options=i,this.loadOptions=d}w.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(i){var d,n;if(i.skip(22),this.fileNameLength=i.readInt(2),n=i.readInt(2),this.fileName=i.readData(this.fileNameLength),i.skip(n),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((d=(function(h){for(var s in v)if(Object.prototype.hasOwnProperty.call(v,s)&&v[s].magic===h)return v[s];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+u.pretty(this.compressionMethod)+" unknown (inner file : "+u.transformTo("string",this.fileName)+")");this.decompressed=new r(this.compressedSize,this.uncompressedSize,this.crc32,d,i.readData(this.compressedSize))},readCentralPart:function(i){this.versionMadeBy=i.readInt(2),i.skip(2),this.bitFlag=i.readInt(2),this.compressionMethod=i.readString(2),this.date=i.readDate(),this.crc32=i.readInt(4),this.compressedSize=i.readInt(4),this.uncompressedSize=i.readInt(4);var d=i.readInt(2);if(this.extraFieldsLength=i.readInt(2),this.fileCommentLength=i.readInt(2),this.diskNumberStart=i.readInt(2),this.internalFileAttributes=i.readInt(2),this.externalFileAttributes=i.readInt(4),this.localHeaderOffset=i.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");i.skip(d),this.readExtraFields(i),this.parseZIP64ExtraField(i),this.fileComment=i.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var i=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),i==0&&(this.dosPermissions=63&this.externalFileAttributes),i==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var i=o(this.extraFields[1].value);this.uncompressedSize===u.MAX_VALUE_32BITS&&(this.uncompressedSize=i.readInt(8)),this.compressedSize===u.MAX_VALUE_32BITS&&(this.compressedSize=i.readInt(8)),this.localHeaderOffset===u.MAX_VALUE_32BITS&&(this.localHeaderOffset=i.readInt(8)),this.diskNumberStart===u.MAX_VALUE_32BITS&&(this.diskNumberStart=i.readInt(4))}},readExtraFields:function(i){var d,n,h,s=i.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});i.index+4<s;)d=i.readInt(2),n=i.readInt(2),h=i.readData(n),this.extraFields[d]={id:d,length:n,value:h};i.setIndex(s)},handleUTF8:function(){var i=p.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=g.utf8decode(this.fileName),this.fileCommentStr=g.utf8decode(this.fileComment);else{var d=this.findExtraFieldUnicodePath();if(d!==null)this.fileNameStr=d;else{var n=u.transformTo(i,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var h=this.findExtraFieldUnicodeComment();if(h!==null)this.fileCommentStr=h;else{var s=u.transformTo(i,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(s)}}},findExtraFieldUnicodePath:function(){var i=this.extraFields[28789];if(i){var d=o(i.value);return d.readInt(1)!==1||a(this.fileName)!==d.readInt(4)?null:g.utf8decode(d.readData(i.length-5))}return null},findExtraFieldUnicodeComment:function(){var i=this.extraFields[25461];if(i){var d=o(i.value);return d.readInt(1)!==1||a(this.fileComment)!==d.readInt(4)?null:g.utf8decode(d.readData(i.length-5))}return null}},C.exports=w},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(f,C,b){"use strict";function o(d,n,h){this.name=d,this.dir=h.dir,this.date=h.date,this.comment=h.comment,this.unixPermissions=h.unixPermissions,this.dosPermissions=h.dosPermissions,this._data=n,this._dataBinary=h.binary,this.options={compression:h.compression,compressionOptions:h.compressionOptions}}var u=f("./stream/StreamHelper"),r=f("./stream/DataWorker"),a=f("./utf8"),g=f("./compressedObject"),v=f("./stream/GenericWorker");o.prototype={internalStream:function(d){var n=null,h="string";try{if(!d)throw new Error("No output type specified.");var s=(h=d.toLowerCase())==="string"||h==="text";h!=="binarystring"&&h!=="text"||(h="string"),n=this._decompressWorker();var _=!this._dataBinary;_&&!s&&(n=n.pipe(new a.Utf8EncodeWorker)),!_&&s&&(n=n.pipe(new a.Utf8DecodeWorker))}catch(y){(n=new v("error")).error(y)}return new u(n,h,"")},async:function(d,n){return this.internalStream(d).accumulate(n)},nodeStream:function(d,n){return this.internalStream(d||"nodebuffer").toNodejsStream(n)},_compressWorker:function(d,n){if(this._data instanceof g&&this._data.compression.magic===d.magic)return this._data.getCompressedWorker();var h=this._decompressWorker();return this._dataBinary||(h=h.pipe(new a.Utf8EncodeWorker)),g.createWorkerFrom(h,d,n)},_decompressWorker:function(){return this._data instanceof g?this._data.getContentWorker():this._data instanceof v?this._data:new r(this._data)}};for(var p=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],w=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},i=0;i<p.length;i++)o.prototype[p[i]]=w;C.exports=o},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(f,C,b){(function(o){"use strict";var u,r,a=o.MutationObserver||o.WebKitMutationObserver;if(a){var g=0,v=new a(d),p=o.document.createTextNode("");v.observe(p,{characterData:!0}),u=function(){p.data=g=++g%2}}else if(o.setImmediate||o.MessageChannel===void 0)u="document"in o&&"onreadystatechange"in o.document.createElement("script")?function(){var n=o.document.createElement("script");n.onreadystatechange=function(){d(),n.onreadystatechange=null,n.parentNode.removeChild(n),n=null},o.document.documentElement.appendChild(n)}:function(){setTimeout(d,0)};else{var w=new o.MessageChannel;w.port1.onmessage=d,u=function(){w.port2.postMessage(0)}}var i=[];function d(){var n,h;r=!0;for(var s=i.length;s;){for(h=i,i=[],n=-1;++n<s;)h[n]();s=i.length}r=!1}C.exports=function(n){i.push(n)!==1||r||u()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(f,C,b){"use strict";var o=f("immediate");function u(){}var r={},a=["REJECTED"],g=["FULFILLED"],v=["PENDING"];function p(s){if(typeof s!="function")throw new TypeError("resolver must be a function");this.state=v,this.queue=[],this.outcome=void 0,s!==u&&n(this,s)}function w(s,_,y){this.promise=s,typeof _=="function"&&(this.onFulfilled=_,this.callFulfilled=this.otherCallFulfilled),typeof y=="function"&&(this.onRejected=y,this.callRejected=this.otherCallRejected)}function i(s,_,y){o(function(){var S;try{S=_(y)}catch(x){return r.reject(s,x)}S===s?r.reject(s,new TypeError("Cannot resolve promise with itself")):r.resolve(s,S)})}function d(s){var _=s&&s.then;if(s&&(typeof s=="object"||typeof s=="function")&&typeof _=="function")return function(){_.apply(s,arguments)}}function n(s,_){var y=!1;function S(F){y||(y=!0,r.reject(s,F))}function x(F){y||(y=!0,r.resolve(s,F))}var D=h(function(){_(x,S)});D.status==="error"&&S(D.value)}function h(s,_){var y={};try{y.value=s(_),y.status="success"}catch(S){y.status="error",y.value=S}return y}(C.exports=p).prototype.finally=function(s){if(typeof s!="function")return this;var _=this.constructor;return this.then(function(y){return _.resolve(s()).then(function(){return y})},function(y){return _.resolve(s()).then(function(){throw y})})},p.prototype.catch=function(s){return this.then(null,s)},p.prototype.then=function(s,_){if(typeof s!="function"&&this.state===g||typeof _!="function"&&this.state===a)return this;var y=new this.constructor(u);return this.state!==v?i(y,this.state===g?s:_,this.outcome):this.queue.push(new w(y,s,_)),y},w.prototype.callFulfilled=function(s){r.resolve(this.promise,s)},w.prototype.otherCallFulfilled=function(s){i(this.promise,this.onFulfilled,s)},w.prototype.callRejected=function(s){r.reject(this.promise,s)},w.prototype.otherCallRejected=function(s){i(this.promise,this.onRejected,s)},r.resolve=function(s,_){var y=h(d,_);if(y.status==="error")return r.reject(s,y.value);var S=y.value;if(S)n(s,S);else{s.state=g,s.outcome=_;for(var x=-1,D=s.queue.length;++x<D;)s.queue[x].callFulfilled(_)}return s},r.reject=function(s,_){s.state=a,s.outcome=_;for(var y=-1,S=s.queue.length;++y<S;)s.queue[y].callRejected(_);return s},p.resolve=function(s){return s instanceof this?s:r.resolve(new this(u),s)},p.reject=function(s){var _=new this(u);return r.reject(_,s)},p.all=function(s){var _=this;if(Object.prototype.toString.call(s)!=="[object Array]")return this.reject(new TypeError("must be an array"));var y=s.length,S=!1;if(!y)return this.resolve([]);for(var x=new Array(y),D=0,F=-1,U=new this(u);++F<y;)B(s[F],F);return U;function B(j,K){_.resolve(j).then(function(c){x[K]=c,++D!==y||S||(S=!0,r.resolve(U,x))},function(c){S||(S=!0,r.reject(U,c))})}},p.race=function(s){var _=this;if(Object.prototype.toString.call(s)!=="[object Array]")return this.reject(new TypeError("must be an array"));var y=s.length,S=!1;if(!y)return this.resolve([]);for(var x=-1,D=new this(u);++x<y;)F=s[x],_.resolve(F).then(function(U){S||(S=!0,r.resolve(D,U))},function(U){S||(S=!0,r.reject(D,U))});var F;return D}},{immediate:36}],38:[function(f,C,b){"use strict";var o={};(0,f("./lib/utils/common").assign)(o,f("./lib/deflate"),f("./lib/inflate"),f("./lib/zlib/constants")),C.exports=o},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(f,C,b){"use strict";var o=f("./zlib/deflate"),u=f("./utils/common"),r=f("./utils/strings"),a=f("./zlib/messages"),g=f("./zlib/zstream"),v=Object.prototype.toString,p=0,w=-1,i=0,d=8;function n(s){if(!(this instanceof n))return new n(s);this.options=u.assign({level:w,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:i,to:""},s||{});var _=this.options;_.raw&&0<_.windowBits?_.windowBits=-_.windowBits:_.gzip&&0<_.windowBits&&_.windowBits<16&&(_.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new g,this.strm.avail_out=0;var y=o.deflateInit2(this.strm,_.level,_.method,_.windowBits,_.memLevel,_.strategy);if(y!==p)throw new Error(a[y]);if(_.header&&o.deflateSetHeader(this.strm,_.header),_.dictionary){var S;if(S=typeof _.dictionary=="string"?r.string2buf(_.dictionary):v.call(_.dictionary)==="[object ArrayBuffer]"?new Uint8Array(_.dictionary):_.dictionary,(y=o.deflateSetDictionary(this.strm,S))!==p)throw new Error(a[y]);this._dict_set=!0}}function h(s,_){var y=new n(_);if(y.push(s,!0),y.err)throw y.msg||a[y.err];return y.result}n.prototype.push=function(s,_){var y,S,x=this.strm,D=this.options.chunkSize;if(this.ended)return!1;S=_===~~_?_:_===!0?4:0,typeof s=="string"?x.input=r.string2buf(s):v.call(s)==="[object ArrayBuffer]"?x.input=new Uint8Array(s):x.input=s,x.next_in=0,x.avail_in=x.input.length;do{if(x.avail_out===0&&(x.output=new u.Buf8(D),x.next_out=0,x.avail_out=D),(y=o.deflate(x,S))!==1&&y!==p)return this.onEnd(y),!(this.ended=!0);x.avail_out!==0&&(x.avail_in!==0||S!==4&&S!==2)||(this.options.to==="string"?this.onData(r.buf2binstring(u.shrinkBuf(x.output,x.next_out))):this.onData(u.shrinkBuf(x.output,x.next_out)))}while((0<x.avail_in||x.avail_out===0)&&y!==1);return S===4?(y=o.deflateEnd(this.strm),this.onEnd(y),this.ended=!0,y===p):S!==2||(this.onEnd(p),!(x.avail_out=0))},n.prototype.onData=function(s){this.chunks.push(s)},n.prototype.onEnd=function(s){s===p&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=u.flattenChunks(this.chunks)),this.chunks=[],this.err=s,this.msg=this.strm.msg},b.Deflate=n,b.deflate=h,b.deflateRaw=function(s,_){return(_=_||{}).raw=!0,h(s,_)},b.gzip=function(s,_){return(_=_||{}).gzip=!0,h(s,_)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(f,C,b){"use strict";var o=f("./zlib/inflate"),u=f("./utils/common"),r=f("./utils/strings"),a=f("./zlib/constants"),g=f("./zlib/messages"),v=f("./zlib/zstream"),p=f("./zlib/gzheader"),w=Object.prototype.toString;function i(n){if(!(this instanceof i))return new i(n);this.options=u.assign({chunkSize:16384,windowBits:0,to:""},n||{});var h=this.options;h.raw&&0<=h.windowBits&&h.windowBits<16&&(h.windowBits=-h.windowBits,h.windowBits===0&&(h.windowBits=-15)),!(0<=h.windowBits&&h.windowBits<16)||n&&n.windowBits||(h.windowBits+=32),15<h.windowBits&&h.windowBits<48&&(15&h.windowBits)==0&&(h.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new v,this.strm.avail_out=0;var s=o.inflateInit2(this.strm,h.windowBits);if(s!==a.Z_OK)throw new Error(g[s]);this.header=new p,o.inflateGetHeader(this.strm,this.header)}function d(n,h){var s=new i(h);if(s.push(n,!0),s.err)throw s.msg||g[s.err];return s.result}i.prototype.push=function(n,h){var s,_,y,S,x,D,F=this.strm,U=this.options.chunkSize,B=this.options.dictionary,j=!1;if(this.ended)return!1;_=h===~~h?h:h===!0?a.Z_FINISH:a.Z_NO_FLUSH,typeof n=="string"?F.input=r.binstring2buf(n):w.call(n)==="[object ArrayBuffer]"?F.input=new Uint8Array(n):F.input=n,F.next_in=0,F.avail_in=F.input.length;do{if(F.avail_out===0&&(F.output=new u.Buf8(U),F.next_out=0,F.avail_out=U),(s=o.inflate(F,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&B&&(D=typeof B=="string"?r.string2buf(B):w.call(B)==="[object ArrayBuffer]"?new Uint8Array(B):B,s=o.inflateSetDictionary(this.strm,D)),s===a.Z_BUF_ERROR&&j===!0&&(s=a.Z_OK,j=!1),s!==a.Z_STREAM_END&&s!==a.Z_OK)return this.onEnd(s),!(this.ended=!0);F.next_out&&(F.avail_out!==0&&s!==a.Z_STREAM_END&&(F.avail_in!==0||_!==a.Z_FINISH&&_!==a.Z_SYNC_FLUSH)||(this.options.to==="string"?(y=r.utf8border(F.output,F.next_out),S=F.next_out-y,x=r.buf2string(F.output,y),F.next_out=S,F.avail_out=U-S,S&&u.arraySet(F.output,F.output,y,S,0),this.onData(x)):this.onData(u.shrinkBuf(F.output,F.next_out)))),F.avail_in===0&&F.avail_out===0&&(j=!0)}while((0<F.avail_in||F.avail_out===0)&&s!==a.Z_STREAM_END);return s===a.Z_STREAM_END&&(_=a.Z_FINISH),_===a.Z_FINISH?(s=o.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===a.Z_OK):_!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),!(F.avail_out=0))},i.prototype.onData=function(n){this.chunks.push(n)},i.prototype.onEnd=function(n){n===a.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=u.flattenChunks(this.chunks)),this.chunks=[],this.err=n,this.msg=this.strm.msg},b.Inflate=i,b.inflate=d,b.inflateRaw=function(n,h){return(h=h||{}).raw=!0,d(n,h)},b.ungzip=d},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(f,C,b){"use strict";var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";b.assign=function(a){for(var g=Array.prototype.slice.call(arguments,1);g.length;){var v=g.shift();if(v){if(typeof v!="object")throw new TypeError(v+"must be non-object");for(var p in v)v.hasOwnProperty(p)&&(a[p]=v[p])}}return a},b.shrinkBuf=function(a,g){return a.length===g?a:a.subarray?a.subarray(0,g):(a.length=g,a)};var u={arraySet:function(a,g,v,p,w){if(g.subarray&&a.subarray)a.set(g.subarray(v,v+p),w);else for(var i=0;i<p;i++)a[w+i]=g[v+i]},flattenChunks:function(a){var g,v,p,w,i,d;for(g=p=0,v=a.length;g<v;g++)p+=a[g].length;for(d=new Uint8Array(p),g=w=0,v=a.length;g<v;g++)i=a[g],d.set(i,w),w+=i.length;return d}},r={arraySet:function(a,g,v,p,w){for(var i=0;i<p;i++)a[w+i]=g[v+i]},flattenChunks:function(a){return[].concat.apply([],a)}};b.setTyped=function(a){a?(b.Buf8=Uint8Array,b.Buf16=Uint16Array,b.Buf32=Int32Array,b.assign(b,u)):(b.Buf8=Array,b.Buf16=Array,b.Buf32=Array,b.assign(b,r))},b.setTyped(o)},{}],42:[function(f,C,b){"use strict";var o=f("./common"),u=!0,r=!0;try{String.fromCharCode.apply(null,[0])}catch{u=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{r=!1}for(var a=new o.Buf8(256),g=0;g<256;g++)a[g]=252<=g?6:248<=g?5:240<=g?4:224<=g?3:192<=g?2:1;function v(p,w){if(w<65537&&(p.subarray&&r||!p.subarray&&u))return String.fromCharCode.apply(null,o.shrinkBuf(p,w));for(var i="",d=0;d<w;d++)i+=String.fromCharCode(p[d]);return i}a[254]=a[254]=1,b.string2buf=function(p){var w,i,d,n,h,s=p.length,_=0;for(n=0;n<s;n++)(64512&(i=p.charCodeAt(n)))==55296&&n+1<s&&(64512&(d=p.charCodeAt(n+1)))==56320&&(i=65536+(i-55296<<10)+(d-56320),n++),_+=i<128?1:i<2048?2:i<65536?3:4;for(w=new o.Buf8(_),n=h=0;h<_;n++)(64512&(i=p.charCodeAt(n)))==55296&&n+1<s&&(64512&(d=p.charCodeAt(n+1)))==56320&&(i=65536+(i-55296<<10)+(d-56320),n++),i<128?w[h++]=i:(i<2048?w[h++]=192|i>>>6:(i<65536?w[h++]=224|i>>>12:(w[h++]=240|i>>>18,w[h++]=128|i>>>12&63),w[h++]=128|i>>>6&63),w[h++]=128|63&i);return w},b.buf2binstring=function(p){return v(p,p.length)},b.binstring2buf=function(p){for(var w=new o.Buf8(p.length),i=0,d=w.length;i<d;i++)w[i]=p.charCodeAt(i);return w},b.buf2string=function(p,w){var i,d,n,h,s=w||p.length,_=new Array(2*s);for(i=d=0;i<s;)if((n=p[i++])<128)_[d++]=n;else if(4<(h=a[n]))_[d++]=65533,i+=h-1;else{for(n&=h===2?31:h===3?15:7;1<h&&i<s;)n=n<<6|63&p[i++],h--;1<h?_[d++]=65533:n<65536?_[d++]=n:(n-=65536,_[d++]=55296|n>>10&1023,_[d++]=56320|1023&n)}return v(_,d)},b.utf8border=function(p,w){var i;for((w=w||p.length)>p.length&&(w=p.length),i=w-1;0<=i&&(192&p[i])==128;)i--;return i<0||i===0?w:i+a[p[i]]>w?i:w}},{"./common":41}],43:[function(f,C,b){"use strict";C.exports=function(o,u,r,a){for(var g=65535&o|0,v=o>>>16&65535|0,p=0;r!==0;){for(r-=p=2e3<r?2e3:r;v=v+(g=g+u[a++]|0)|0,--p;);g%=65521,v%=65521}return g|v<<16|0}},{}],44:[function(f,C,b){"use strict";C.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(f,C,b){"use strict";var o=(function(){for(var u,r=[],a=0;a<256;a++){u=a;for(var g=0;g<8;g++)u=1&u?3988292384^u>>>1:u>>>1;r[a]=u}return r})();C.exports=function(u,r,a,g){var v=o,p=g+a;u^=-1;for(var w=g;w<p;w++)u=u>>>8^v[255&(u^r[w])];return-1^u}},{}],46:[function(f,C,b){"use strict";var o,u=f("../utils/common"),r=f("./trees"),a=f("./adler32"),g=f("./crc32"),v=f("./messages"),p=0,w=4,i=0,d=-2,n=-1,h=4,s=2,_=8,y=9,S=286,x=30,D=19,F=2*S+1,U=15,B=3,j=258,K=j+B+1,c=42,E=113,e=1,I=2,q=3,N=4;function X(t,R){return t.msg=v[R],R}function P(t){return(t<<1)-(4<t?9:0)}function $(t){for(var R=t.length;0<=--R;)t[R]=0}function T(t){var R=t.state,O=R.pending;O>t.avail_out&&(O=t.avail_out),O!==0&&(u.arraySet(t.output,R.pending_buf,R.pending_out,O,t.next_out),t.next_out+=O,R.pending_out+=O,t.total_out+=O,t.avail_out-=O,R.pending-=O,R.pending===0&&(R.pending_out=0))}function z(t,R){r._tr_flush_block(t,0<=t.block_start?t.block_start:-1,t.strstart-t.block_start,R),t.block_start=t.strstart,T(t.strm)}function J(t,R){t.pending_buf[t.pending++]=R}function G(t,R){t.pending_buf[t.pending++]=R>>>8&255,t.pending_buf[t.pending++]=255&R}function H(t,R){var O,m,l=t.max_chain_length,k=t.strstart,L=t.prev_length,M=t.nice_match,A=t.strstart>t.w_size-K?t.strstart-(t.w_size-K):0,W=t.window,V=t.w_mask,Z=t.prev,Y=t.strstart+j,rt=W[k+L-1],tt=W[k+L];t.prev_length>=t.good_match&&(l>>=2),M>t.lookahead&&(M=t.lookahead);do if(W[(O=R)+L]===tt&&W[O+L-1]===rt&&W[O]===W[k]&&W[++O]===W[k+1]){k+=2,O++;do;while(W[++k]===W[++O]&&W[++k]===W[++O]&&W[++k]===W[++O]&&W[++k]===W[++O]&&W[++k]===W[++O]&&W[++k]===W[++O]&&W[++k]===W[++O]&&W[++k]===W[++O]&&k<Y);if(m=j-(Y-k),k=Y-j,L<m){if(t.match_start=R,M<=(L=m))break;rt=W[k+L-1],tt=W[k+L]}}while((R=Z[R&V])>A&&--l!=0);return L<=t.lookahead?L:t.lookahead}function nt(t){var R,O,m,l,k,L,M,A,W,V,Z=t.w_size;do{if(l=t.window_size-t.lookahead-t.strstart,t.strstart>=Z+(Z-K)){for(u.arraySet(t.window,t.window,Z,Z,0),t.match_start-=Z,t.strstart-=Z,t.block_start-=Z,R=O=t.hash_size;m=t.head[--R],t.head[R]=Z<=m?m-Z:0,--O;);for(R=O=Z;m=t.prev[--R],t.prev[R]=Z<=m?m-Z:0,--O;);l+=Z}if(t.strm.avail_in===0)break;if(L=t.strm,M=t.window,A=t.strstart+t.lookahead,W=l,V=void 0,V=L.avail_in,W<V&&(V=W),O=V===0?0:(L.avail_in-=V,u.arraySet(M,L.input,L.next_in,V,A),L.state.wrap===1?L.adler=a(L.adler,M,V,A):L.state.wrap===2&&(L.adler=g(L.adler,M,V,A)),L.next_in+=V,L.total_in+=V,V),t.lookahead+=O,t.lookahead+t.insert>=B)for(k=t.strstart-t.insert,t.ins_h=t.window[k],t.ins_h=(t.ins_h<<t.hash_shift^t.window[k+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[k+B-1])&t.hash_mask,t.prev[k&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=k,k++,t.insert--,!(t.lookahead+t.insert<B)););}while(t.lookahead<K&&t.strm.avail_in!==0)}function ot(t,R){for(var O,m;;){if(t.lookahead<K){if(nt(t),t.lookahead<K&&R===p)return e;if(t.lookahead===0)break}if(O=0,t.lookahead>=B&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+B-1])&t.hash_mask,O=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),O!==0&&t.strstart-O<=t.w_size-K&&(t.match_length=H(t,O)),t.match_length>=B)if(m=r._tr_tally(t,t.strstart-t.match_start,t.match_length-B),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=B){for(t.match_length--;t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+B-1])&t.hash_mask,O=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart,--t.match_length!=0;);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else m=r._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(m&&(z(t,!1),t.strm.avail_out===0))return e}return t.insert=t.strstart<B-1?t.strstart:B-1,R===w?(z(t,!0),t.strm.avail_out===0?q:N):t.last_lit&&(z(t,!1),t.strm.avail_out===0)?e:I}function Q(t,R){for(var O,m,l;;){if(t.lookahead<K){if(nt(t),t.lookahead<K&&R===p)return e;if(t.lookahead===0)break}if(O=0,t.lookahead>=B&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+B-1])&t.hash_mask,O=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=B-1,O!==0&&t.prev_length<t.max_lazy_match&&t.strstart-O<=t.w_size-K&&(t.match_length=H(t,O),t.match_length<=5&&(t.strategy===1||t.match_length===B&&4096<t.strstart-t.match_start)&&(t.match_length=B-1)),t.prev_length>=B&&t.match_length<=t.prev_length){for(l=t.strstart+t.lookahead-B,m=r._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-B),t.lookahead-=t.prev_length-1,t.prev_length-=2;++t.strstart<=l&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+B-1])&t.hash_mask,O=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),--t.prev_length!=0;);if(t.match_available=0,t.match_length=B-1,t.strstart++,m&&(z(t,!1),t.strm.avail_out===0))return e}else if(t.match_available){if((m=r._tr_tally(t,0,t.window[t.strstart-1]))&&z(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return e}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(m=r._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<B-1?t.strstart:B-1,R===w?(z(t,!0),t.strm.avail_out===0?q:N):t.last_lit&&(z(t,!1),t.strm.avail_out===0)?e:I}function et(t,R,O,m,l){this.good_length=t,this.max_lazy=R,this.nice_length=O,this.max_chain=m,this.func=l}function st(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=_,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new u.Buf16(2*F),this.dyn_dtree=new u.Buf16(2*(2*x+1)),this.bl_tree=new u.Buf16(2*(2*D+1)),$(this.dyn_ltree),$(this.dyn_dtree),$(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new u.Buf16(U+1),this.heap=new u.Buf16(2*S+1),$(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new u.Buf16(2*S+1),$(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function it(t){var R;return t&&t.state?(t.total_in=t.total_out=0,t.data_type=s,(R=t.state).pending=0,R.pending_out=0,R.wrap<0&&(R.wrap=-R.wrap),R.status=R.wrap?c:E,t.adler=R.wrap===2?0:1,R.last_flush=p,r._tr_init(R),i):X(t,d)}function ct(t){var R=it(t);return R===i&&(function(O){O.window_size=2*O.w_size,$(O.head),O.max_lazy_match=o[O.level].max_lazy,O.good_match=o[O.level].good_length,O.nice_match=o[O.level].nice_length,O.max_chain_length=o[O.level].max_chain,O.strstart=0,O.block_start=0,O.lookahead=0,O.insert=0,O.match_length=O.prev_length=B-1,O.match_available=0,O.ins_h=0})(t.state),R}function lt(t,R,O,m,l,k){if(!t)return d;var L=1;if(R===n&&(R=6),m<0?(L=0,m=-m):15<m&&(L=2,m-=16),l<1||y<l||O!==_||m<8||15<m||R<0||9<R||k<0||h<k)return X(t,d);m===8&&(m=9);var M=new st;return(t.state=M).strm=t,M.wrap=L,M.gzhead=null,M.w_bits=m,M.w_size=1<<M.w_bits,M.w_mask=M.w_size-1,M.hash_bits=l+7,M.hash_size=1<<M.hash_bits,M.hash_mask=M.hash_size-1,M.hash_shift=~~((M.hash_bits+B-1)/B),M.window=new u.Buf8(2*M.w_size),M.head=new u.Buf16(M.hash_size),M.prev=new u.Buf16(M.w_size),M.lit_bufsize=1<<l+6,M.pending_buf_size=4*M.lit_bufsize,M.pending_buf=new u.Buf8(M.pending_buf_size),M.d_buf=1*M.lit_bufsize,M.l_buf=3*M.lit_bufsize,M.level=R,M.strategy=k,M.method=O,ct(t)}o=[new et(0,0,0,0,function(t,R){var O=65535;for(O>t.pending_buf_size-5&&(O=t.pending_buf_size-5);;){if(t.lookahead<=1){if(nt(t),t.lookahead===0&&R===p)return e;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var m=t.block_start+O;if((t.strstart===0||t.strstart>=m)&&(t.lookahead=t.strstart-m,t.strstart=m,z(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-K&&(z(t,!1),t.strm.avail_out===0))return e}return t.insert=0,R===w?(z(t,!0),t.strm.avail_out===0?q:N):(t.strstart>t.block_start&&(z(t,!1),t.strm.avail_out),e)}),new et(4,4,8,4,ot),new et(4,5,16,8,ot),new et(4,6,32,32,ot),new et(4,4,16,16,Q),new et(8,16,32,32,Q),new et(8,16,128,128,Q),new et(8,32,128,256,Q),new et(32,128,258,1024,Q),new et(32,258,258,4096,Q)],b.deflateInit=function(t,R){return lt(t,R,_,15,8,0)},b.deflateInit2=lt,b.deflateReset=ct,b.deflateResetKeep=it,b.deflateSetHeader=function(t,R){return t&&t.state?t.state.wrap!==2?d:(t.state.gzhead=R,i):d},b.deflate=function(t,R){var O,m,l,k;if(!t||!t.state||5<R||R<0)return t?X(t,d):d;if(m=t.state,!t.output||!t.input&&t.avail_in!==0||m.status===666&&R!==w)return X(t,t.avail_out===0?-5:d);if(m.strm=t,O=m.last_flush,m.last_flush=R,m.status===c)if(m.wrap===2)t.adler=0,J(m,31),J(m,139),J(m,8),m.gzhead?(J(m,(m.gzhead.text?1:0)+(m.gzhead.hcrc?2:0)+(m.gzhead.extra?4:0)+(m.gzhead.name?8:0)+(m.gzhead.comment?16:0)),J(m,255&m.gzhead.time),J(m,m.gzhead.time>>8&255),J(m,m.gzhead.time>>16&255),J(m,m.gzhead.time>>24&255),J(m,m.level===9?2:2<=m.strategy||m.level<2?4:0),J(m,255&m.gzhead.os),m.gzhead.extra&&m.gzhead.extra.length&&(J(m,255&m.gzhead.extra.length),J(m,m.gzhead.extra.length>>8&255)),m.gzhead.hcrc&&(t.adler=g(t.adler,m.pending_buf,m.pending,0)),m.gzindex=0,m.status=69):(J(m,0),J(m,0),J(m,0),J(m,0),J(m,0),J(m,m.level===9?2:2<=m.strategy||m.level<2?4:0),J(m,3),m.status=E);else{var L=_+(m.w_bits-8<<4)<<8;L|=(2<=m.strategy||m.level<2?0:m.level<6?1:m.level===6?2:3)<<6,m.strstart!==0&&(L|=32),L+=31-L%31,m.status=E,G(m,L),m.strstart!==0&&(G(m,t.adler>>>16),G(m,65535&t.adler)),t.adler=1}if(m.status===69)if(m.gzhead.extra){for(l=m.pending;m.gzindex<(65535&m.gzhead.extra.length)&&(m.pending!==m.pending_buf_size||(m.gzhead.hcrc&&m.pending>l&&(t.adler=g(t.adler,m.pending_buf,m.pending-l,l)),T(t),l=m.pending,m.pending!==m.pending_buf_size));)J(m,255&m.gzhead.extra[m.gzindex]),m.gzindex++;m.gzhead.hcrc&&m.pending>l&&(t.adler=g(t.adler,m.pending_buf,m.pending-l,l)),m.gzindex===m.gzhead.extra.length&&(m.gzindex=0,m.status=73)}else m.status=73;if(m.status===73)if(m.gzhead.name){l=m.pending;do{if(m.pending===m.pending_buf_size&&(m.gzhead.hcrc&&m.pending>l&&(t.adler=g(t.adler,m.pending_buf,m.pending-l,l)),T(t),l=m.pending,m.pending===m.pending_buf_size)){k=1;break}k=m.gzindex<m.gzhead.name.length?255&m.gzhead.name.charCodeAt(m.gzindex++):0,J(m,k)}while(k!==0);m.gzhead.hcrc&&m.pending>l&&(t.adler=g(t.adler,m.pending_buf,m.pending-l,l)),k===0&&(m.gzindex=0,m.status=91)}else m.status=91;if(m.status===91)if(m.gzhead.comment){l=m.pending;do{if(m.pending===m.pending_buf_size&&(m.gzhead.hcrc&&m.pending>l&&(t.adler=g(t.adler,m.pending_buf,m.pending-l,l)),T(t),l=m.pending,m.pending===m.pending_buf_size)){k=1;break}k=m.gzindex<m.gzhead.comment.length?255&m.gzhead.comment.charCodeAt(m.gzindex++):0,J(m,k)}while(k!==0);m.gzhead.hcrc&&m.pending>l&&(t.adler=g(t.adler,m.pending_buf,m.pending-l,l)),k===0&&(m.status=103)}else m.status=103;if(m.status===103&&(m.gzhead.hcrc?(m.pending+2>m.pending_buf_size&&T(t),m.pending+2<=m.pending_buf_size&&(J(m,255&t.adler),J(m,t.adler>>8&255),t.adler=0,m.status=E)):m.status=E),m.pending!==0){if(T(t),t.avail_out===0)return m.last_flush=-1,i}else if(t.avail_in===0&&P(R)<=P(O)&&R!==w)return X(t,-5);if(m.status===666&&t.avail_in!==0)return X(t,-5);if(t.avail_in!==0||m.lookahead!==0||R!==p&&m.status!==666){var M=m.strategy===2?(function(A,W){for(var V;;){if(A.lookahead===0&&(nt(A),A.lookahead===0)){if(W===p)return e;break}if(A.match_length=0,V=r._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++,V&&(z(A,!1),A.strm.avail_out===0))return e}return A.insert=0,W===w?(z(A,!0),A.strm.avail_out===0?q:N):A.last_lit&&(z(A,!1),A.strm.avail_out===0)?e:I})(m,R):m.strategy===3?(function(A,W){for(var V,Z,Y,rt,tt=A.window;;){if(A.lookahead<=j){if(nt(A),A.lookahead<=j&&W===p)return e;if(A.lookahead===0)break}if(A.match_length=0,A.lookahead>=B&&0<A.strstart&&(Z=tt[Y=A.strstart-1])===tt[++Y]&&Z===tt[++Y]&&Z===tt[++Y]){rt=A.strstart+j;do;while(Z===tt[++Y]&&Z===tt[++Y]&&Z===tt[++Y]&&Z===tt[++Y]&&Z===tt[++Y]&&Z===tt[++Y]&&Z===tt[++Y]&&Z===tt[++Y]&&Y<rt);A.match_length=j-(rt-Y),A.match_length>A.lookahead&&(A.match_length=A.lookahead)}if(A.match_length>=B?(V=r._tr_tally(A,1,A.match_length-B),A.lookahead-=A.match_length,A.strstart+=A.match_length,A.match_length=0):(V=r._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++),V&&(z(A,!1),A.strm.avail_out===0))return e}return A.insert=0,W===w?(z(A,!0),A.strm.avail_out===0?q:N):A.last_lit&&(z(A,!1),A.strm.avail_out===0)?e:I})(m,R):o[m.level].func(m,R);if(M!==q&&M!==N||(m.status=666),M===e||M===q)return t.avail_out===0&&(m.last_flush=-1),i;if(M===I&&(R===1?r._tr_align(m):R!==5&&(r._tr_stored_block(m,0,0,!1),R===3&&($(m.head),m.lookahead===0&&(m.strstart=0,m.block_start=0,m.insert=0))),T(t),t.avail_out===0))return m.last_flush=-1,i}return R!==w?i:m.wrap<=0?1:(m.wrap===2?(J(m,255&t.adler),J(m,t.adler>>8&255),J(m,t.adler>>16&255),J(m,t.adler>>24&255),J(m,255&t.total_in),J(m,t.total_in>>8&255),J(m,t.total_in>>16&255),J(m,t.total_in>>24&255)):(G(m,t.adler>>>16),G(m,65535&t.adler)),T(t),0<m.wrap&&(m.wrap=-m.wrap),m.pending!==0?i:1)},b.deflateEnd=function(t){var R;return t&&t.state?(R=t.state.status)!==c&&R!==69&&R!==73&&R!==91&&R!==103&&R!==E&&R!==666?X(t,d):(t.state=null,R===E?X(t,-3):i):d},b.deflateSetDictionary=function(t,R){var O,m,l,k,L,M,A,W,V=R.length;if(!t||!t.state||(k=(O=t.state).wrap)===2||k===1&&O.status!==c||O.lookahead)return d;for(k===1&&(t.adler=a(t.adler,R,V,0)),O.wrap=0,V>=O.w_size&&(k===0&&($(O.head),O.strstart=0,O.block_start=0,O.insert=0),W=new u.Buf8(O.w_size),u.arraySet(W,R,V-O.w_size,O.w_size,0),R=W,V=O.w_size),L=t.avail_in,M=t.next_in,A=t.input,t.avail_in=V,t.next_in=0,t.input=R,nt(O);O.lookahead>=B;){for(m=O.strstart,l=O.lookahead-(B-1);O.ins_h=(O.ins_h<<O.hash_shift^O.window[m+B-1])&O.hash_mask,O.prev[m&O.w_mask]=O.head[O.ins_h],O.head[O.ins_h]=m,m++,--l;);O.strstart=m,O.lookahead=B-1,nt(O)}return O.strstart+=O.lookahead,O.block_start=O.strstart,O.insert=O.lookahead,O.lookahead=0,O.match_length=O.prev_length=B-1,O.match_available=0,t.next_in=M,t.input=A,t.avail_in=L,O.wrap=k,i},b.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(f,C,b){"use strict";C.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(f,C,b){"use strict";C.exports=function(o,u){var r,a,g,v,p,w,i,d,n,h,s,_,y,S,x,D,F,U,B,j,K,c,E,e,I;r=o.state,a=o.next_in,e=o.input,g=a+(o.avail_in-5),v=o.next_out,I=o.output,p=v-(u-o.avail_out),w=v+(o.avail_out-257),i=r.dmax,d=r.wsize,n=r.whave,h=r.wnext,s=r.window,_=r.hold,y=r.bits,S=r.lencode,x=r.distcode,D=(1<<r.lenbits)-1,F=(1<<r.distbits)-1;t:do{y<15&&(_+=e[a++]<<y,y+=8,_+=e[a++]<<y,y+=8),U=S[_&D];e:for(;;){if(_>>>=B=U>>>24,y-=B,(B=U>>>16&255)===0)I[v++]=65535&U;else{if(!(16&B)){if((64&B)==0){U=S[(65535&U)+(_&(1<<B)-1)];continue e}if(32&B){r.mode=12;break t}o.msg="invalid literal/length code",r.mode=30;break t}j=65535&U,(B&=15)&&(y<B&&(_+=e[a++]<<y,y+=8),j+=_&(1<<B)-1,_>>>=B,y-=B),y<15&&(_+=e[a++]<<y,y+=8,_+=e[a++]<<y,y+=8),U=x[_&F];r:for(;;){if(_>>>=B=U>>>24,y-=B,!(16&(B=U>>>16&255))){if((64&B)==0){U=x[(65535&U)+(_&(1<<B)-1)];continue r}o.msg="invalid distance code",r.mode=30;break t}if(K=65535&U,y<(B&=15)&&(_+=e[a++]<<y,(y+=8)<B&&(_+=e[a++]<<y,y+=8)),i<(K+=_&(1<<B)-1)){o.msg="invalid distance too far back",r.mode=30;break t}if(_>>>=B,y-=B,(B=v-p)<K){if(n<(B=K-B)&&r.sane){o.msg="invalid distance too far back",r.mode=30;break t}if(E=s,(c=0)===h){if(c+=d-B,B<j){for(j-=B;I[v++]=s[c++],--B;);c=v-K,E=I}}else if(h<B){if(c+=d+h-B,(B-=h)<j){for(j-=B;I[v++]=s[c++],--B;);if(c=0,h<j){for(j-=B=h;I[v++]=s[c++],--B;);c=v-K,E=I}}}else if(c+=h-B,B<j){for(j-=B;I[v++]=s[c++],--B;);c=v-K,E=I}for(;2<j;)I[v++]=E[c++],I[v++]=E[c++],I[v++]=E[c++],j-=3;j&&(I[v++]=E[c++],1<j&&(I[v++]=E[c++]))}else{for(c=v-K;I[v++]=I[c++],I[v++]=I[c++],I[v++]=I[c++],2<(j-=3););j&&(I[v++]=I[c++],1<j&&(I[v++]=I[c++]))}break}}break}}while(a<g&&v<w);a-=j=y>>3,_&=(1<<(y-=j<<3))-1,o.next_in=a,o.next_out=v,o.avail_in=a<g?g-a+5:5-(a-g),o.avail_out=v<w?w-v+257:257-(v-w),r.hold=_,r.bits=y}},{}],49:[function(f,C,b){"use strict";var o=f("../utils/common"),u=f("./adler32"),r=f("./crc32"),a=f("./inffast"),g=f("./inftrees"),v=1,p=2,w=0,i=-2,d=1,n=852,h=592;function s(c){return(c>>>24&255)+(c>>>8&65280)+((65280&c)<<8)+((255&c)<<24)}function _(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new o.Buf16(320),this.work=new o.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function y(c){var E;return c&&c.state?(E=c.state,c.total_in=c.total_out=E.total=0,c.msg="",E.wrap&&(c.adler=1&E.wrap),E.mode=d,E.last=0,E.havedict=0,E.dmax=32768,E.head=null,E.hold=0,E.bits=0,E.lencode=E.lendyn=new o.Buf32(n),E.distcode=E.distdyn=new o.Buf32(h),E.sane=1,E.back=-1,w):i}function S(c){var E;return c&&c.state?((E=c.state).wsize=0,E.whave=0,E.wnext=0,y(c)):i}function x(c,E){var e,I;return c&&c.state?(I=c.state,E<0?(e=0,E=-E):(e=1+(E>>4),E<48&&(E&=15)),E&&(E<8||15<E)?i:(I.window!==null&&I.wbits!==E&&(I.window=null),I.wrap=e,I.wbits=E,S(c))):i}function D(c,E){var e,I;return c?(I=new _,(c.state=I).window=null,(e=x(c,E))!==w&&(c.state=null),e):i}var F,U,B=!0;function j(c){if(B){var E;for(F=new o.Buf32(512),U=new o.Buf32(32),E=0;E<144;)c.lens[E++]=8;for(;E<256;)c.lens[E++]=9;for(;E<280;)c.lens[E++]=7;for(;E<288;)c.lens[E++]=8;for(g(v,c.lens,0,288,F,0,c.work,{bits:9}),E=0;E<32;)c.lens[E++]=5;g(p,c.lens,0,32,U,0,c.work,{bits:5}),B=!1}c.lencode=F,c.lenbits=9,c.distcode=U,c.distbits=5}function K(c,E,e,I){var q,N=c.state;return N.window===null&&(N.wsize=1<<N.wbits,N.wnext=0,N.whave=0,N.window=new o.Buf8(N.wsize)),I>=N.wsize?(o.arraySet(N.window,E,e-N.wsize,N.wsize,0),N.wnext=0,N.whave=N.wsize):(I<(q=N.wsize-N.wnext)&&(q=I),o.arraySet(N.window,E,e-I,q,N.wnext),(I-=q)?(o.arraySet(N.window,E,e-I,I,0),N.wnext=I,N.whave=N.wsize):(N.wnext+=q,N.wnext===N.wsize&&(N.wnext=0),N.whave<N.wsize&&(N.whave+=q))),0}b.inflateReset=S,b.inflateReset2=x,b.inflateResetKeep=y,b.inflateInit=function(c){return D(c,15)},b.inflateInit2=D,b.inflate=function(c,E){var e,I,q,N,X,P,$,T,z,J,G,H,nt,ot,Q,et,st,it,ct,lt,t,R,O,m,l=0,k=new o.Buf8(4),L=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!c||!c.state||!c.output||!c.input&&c.avail_in!==0)return i;(e=c.state).mode===12&&(e.mode=13),X=c.next_out,q=c.output,$=c.avail_out,N=c.next_in,I=c.input,P=c.avail_in,T=e.hold,z=e.bits,J=P,G=$,R=w;t:for(;;)switch(e.mode){case d:if(e.wrap===0){e.mode=13;break}for(;z<16;){if(P===0)break t;P--,T+=I[N++]<<z,z+=8}if(2&e.wrap&&T===35615){k[e.check=0]=255&T,k[1]=T>>>8&255,e.check=r(e.check,k,2,0),z=T=0,e.mode=2;break}if(e.flags=0,e.head&&(e.head.done=!1),!(1&e.wrap)||(((255&T)<<8)+(T>>8))%31){c.msg="incorrect header check",e.mode=30;break}if((15&T)!=8){c.msg="unknown compression method",e.mode=30;break}if(z-=4,t=8+(15&(T>>>=4)),e.wbits===0)e.wbits=t;else if(t>e.wbits){c.msg="invalid window size",e.mode=30;break}e.dmax=1<<t,c.adler=e.check=1,e.mode=512&T?10:12,z=T=0;break;case 2:for(;z<16;){if(P===0)break t;P--,T+=I[N++]<<z,z+=8}if(e.flags=T,(255&e.flags)!=8){c.msg="unknown compression method",e.mode=30;break}if(57344&e.flags){c.msg="unknown header flags set",e.mode=30;break}e.head&&(e.head.text=T>>8&1),512&e.flags&&(k[0]=255&T,k[1]=T>>>8&255,e.check=r(e.check,k,2,0)),z=T=0,e.mode=3;case 3:for(;z<32;){if(P===0)break t;P--,T+=I[N++]<<z,z+=8}e.head&&(e.head.time=T),512&e.flags&&(k[0]=255&T,k[1]=T>>>8&255,k[2]=T>>>16&255,k[3]=T>>>24&255,e.check=r(e.check,k,4,0)),z=T=0,e.mode=4;case 4:for(;z<16;){if(P===0)break t;P--,T+=I[N++]<<z,z+=8}e.head&&(e.head.xflags=255&T,e.head.os=T>>8),512&e.flags&&(k[0]=255&T,k[1]=T>>>8&255,e.check=r(e.check,k,2,0)),z=T=0,e.mode=5;case 5:if(1024&e.flags){for(;z<16;){if(P===0)break t;P--,T+=I[N++]<<z,z+=8}e.length=T,e.head&&(e.head.extra_len=T),512&e.flags&&(k[0]=255&T,k[1]=T>>>8&255,e.check=r(e.check,k,2,0)),z=T=0}else e.head&&(e.head.extra=null);e.mode=6;case 6:if(1024&e.flags&&(P<(H=e.length)&&(H=P),H&&(e.head&&(t=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Array(e.head.extra_len)),o.arraySet(e.head.extra,I,N,H,t)),512&e.flags&&(e.check=r(e.check,I,H,N)),P-=H,N+=H,e.length-=H),e.length))break t;e.length=0,e.mode=7;case 7:if(2048&e.flags){if(P===0)break t;for(H=0;t=I[N+H++],e.head&&t&&e.length<65536&&(e.head.name+=String.fromCharCode(t)),t&&H<P;);if(512&e.flags&&(e.check=r(e.check,I,H,N)),P-=H,N+=H,t)break t}else e.head&&(e.head.name=null);e.length=0,e.mode=8;case 8:if(4096&e.flags){if(P===0)break t;for(H=0;t=I[N+H++],e.head&&t&&e.length<65536&&(e.head.comment+=String.fromCharCode(t)),t&&H<P;);if(512&e.flags&&(e.check=r(e.check,I,H,N)),P-=H,N+=H,t)break t}else e.head&&(e.head.comment=null);e.mode=9;case 9:if(512&e.flags){for(;z<16;){if(P===0)break t;P--,T+=I[N++]<<z,z+=8}if(T!==(65535&e.check)){c.msg="header crc mismatch",e.mode=30;break}z=T=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),c.adler=e.check=0,e.mode=12;break;case 10:for(;z<32;){if(P===0)break t;P--,T+=I[N++]<<z,z+=8}c.adler=e.check=s(T),z=T=0,e.mode=11;case 11:if(e.havedict===0)return c.next_out=X,c.avail_out=$,c.next_in=N,c.avail_in=P,e.hold=T,e.bits=z,2;c.adler=e.check=1,e.mode=12;case 12:if(E===5||E===6)break t;case 13:if(e.last){T>>>=7&z,z-=7&z,e.mode=27;break}for(;z<3;){if(P===0)break t;P--,T+=I[N++]<<z,z+=8}switch(e.last=1&T,z-=1,3&(T>>>=1)){case 0:e.mode=14;break;case 1:if(j(e),e.mode=20,E!==6)break;T>>>=2,z-=2;break t;case 2:e.mode=17;break;case 3:c.msg="invalid block type",e.mode=30}T>>>=2,z-=2;break;case 14:for(T>>>=7&z,z-=7&z;z<32;){if(P===0)break t;P--,T+=I[N++]<<z,z+=8}if((65535&T)!=(T>>>16^65535)){c.msg="invalid stored block lengths",e.mode=30;break}if(e.length=65535&T,z=T=0,e.mode=15,E===6)break t;case 15:e.mode=16;case 16:if(H=e.length){if(P<H&&(H=P),$<H&&(H=$),H===0)break t;o.arraySet(q,I,N,H,X),P-=H,N+=H,$-=H,X+=H,e.length-=H;break}e.mode=12;break;case 17:for(;z<14;){if(P===0)break t;P--,T+=I[N++]<<z,z+=8}if(e.nlen=257+(31&T),T>>>=5,z-=5,e.ndist=1+(31&T),T>>>=5,z-=5,e.ncode=4+(15&T),T>>>=4,z-=4,286<e.nlen||30<e.ndist){c.msg="too many length or distance symbols",e.mode=30;break}e.have=0,e.mode=18;case 18:for(;e.have<e.ncode;){for(;z<3;){if(P===0)break t;P--,T+=I[N++]<<z,z+=8}e.lens[L[e.have++]]=7&T,T>>>=3,z-=3}for(;e.have<19;)e.lens[L[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,O={bits:e.lenbits},R=g(0,e.lens,0,19,e.lencode,0,e.work,O),e.lenbits=O.bits,R){c.msg="invalid code lengths set",e.mode=30;break}e.have=0,e.mode=19;case 19:for(;e.have<e.nlen+e.ndist;){for(;et=(l=e.lencode[T&(1<<e.lenbits)-1])>>>16&255,st=65535&l,!((Q=l>>>24)<=z);){if(P===0)break t;P--,T+=I[N++]<<z,z+=8}if(st<16)T>>>=Q,z-=Q,e.lens[e.have++]=st;else{if(st===16){for(m=Q+2;z<m;){if(P===0)break t;P--,T+=I[N++]<<z,z+=8}if(T>>>=Q,z-=Q,e.have===0){c.msg="invalid bit length repeat",e.mode=30;break}t=e.lens[e.have-1],H=3+(3&T),T>>>=2,z-=2}else if(st===17){for(m=Q+3;z<m;){if(P===0)break t;P--,T+=I[N++]<<z,z+=8}z-=Q,t=0,H=3+(7&(T>>>=Q)),T>>>=3,z-=3}else{for(m=Q+7;z<m;){if(P===0)break t;P--,T+=I[N++]<<z,z+=8}z-=Q,t=0,H=11+(127&(T>>>=Q)),T>>>=7,z-=7}if(e.have+H>e.nlen+e.ndist){c.msg="invalid bit length repeat",e.mode=30;break}for(;H--;)e.lens[e.have++]=t}}if(e.mode===30)break;if(e.lens[256]===0){c.msg="invalid code -- missing end-of-block",e.mode=30;break}if(e.lenbits=9,O={bits:e.lenbits},R=g(v,e.lens,0,e.nlen,e.lencode,0,e.work,O),e.lenbits=O.bits,R){c.msg="invalid literal/lengths set",e.mode=30;break}if(e.distbits=6,e.distcode=e.distdyn,O={bits:e.distbits},R=g(p,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,O),e.distbits=O.bits,R){c.msg="invalid distances set",e.mode=30;break}if(e.mode=20,E===6)break t;case 20:e.mode=21;case 21:if(6<=P&&258<=$){c.next_out=X,c.avail_out=$,c.next_in=N,c.avail_in=P,e.hold=T,e.bits=z,a(c,G),X=c.next_out,q=c.output,$=c.avail_out,N=c.next_in,I=c.input,P=c.avail_in,T=e.hold,z=e.bits,e.mode===12&&(e.back=-1);break}for(e.back=0;et=(l=e.lencode[T&(1<<e.lenbits)-1])>>>16&255,st=65535&l,!((Q=l>>>24)<=z);){if(P===0)break t;P--,T+=I[N++]<<z,z+=8}if(et&&(240&et)==0){for(it=Q,ct=et,lt=st;et=(l=e.lencode[lt+((T&(1<<it+ct)-1)>>it)])>>>16&255,st=65535&l,!(it+(Q=l>>>24)<=z);){if(P===0)break t;P--,T+=I[N++]<<z,z+=8}T>>>=it,z-=it,e.back+=it}if(T>>>=Q,z-=Q,e.back+=Q,e.length=st,et===0){e.mode=26;break}if(32&et){e.back=-1,e.mode=12;break}if(64&et){c.msg="invalid literal/length code",e.mode=30;break}e.extra=15&et,e.mode=22;case 22:if(e.extra){for(m=e.extra;z<m;){if(P===0)break t;P--,T+=I[N++]<<z,z+=8}e.length+=T&(1<<e.extra)-1,T>>>=e.extra,z-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=23;case 23:for(;et=(l=e.distcode[T&(1<<e.distbits)-1])>>>16&255,st=65535&l,!((Q=l>>>24)<=z);){if(P===0)break t;P--,T+=I[N++]<<z,z+=8}if((240&et)==0){for(it=Q,ct=et,lt=st;et=(l=e.distcode[lt+((T&(1<<it+ct)-1)>>it)])>>>16&255,st=65535&l,!(it+(Q=l>>>24)<=z);){if(P===0)break t;P--,T+=I[N++]<<z,z+=8}T>>>=it,z-=it,e.back+=it}if(T>>>=Q,z-=Q,e.back+=Q,64&et){c.msg="invalid distance code",e.mode=30;break}e.offset=st,e.extra=15&et,e.mode=24;case 24:if(e.extra){for(m=e.extra;z<m;){if(P===0)break t;P--,T+=I[N++]<<z,z+=8}e.offset+=T&(1<<e.extra)-1,T>>>=e.extra,z-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){c.msg="invalid distance too far back",e.mode=30;break}e.mode=25;case 25:if($===0)break t;if(H=G-$,e.offset>H){if((H=e.offset-H)>e.whave&&e.sane){c.msg="invalid distance too far back",e.mode=30;break}nt=H>e.wnext?(H-=e.wnext,e.wsize-H):e.wnext-H,H>e.length&&(H=e.length),ot=e.window}else ot=q,nt=X-e.offset,H=e.length;for($<H&&(H=$),$-=H,e.length-=H;q[X++]=ot[nt++],--H;);e.length===0&&(e.mode=21);break;case 26:if($===0)break t;q[X++]=e.length,$--,e.mode=21;break;case 27:if(e.wrap){for(;z<32;){if(P===0)break t;P--,T|=I[N++]<<z,z+=8}if(G-=$,c.total_out+=G,e.total+=G,G&&(c.adler=e.check=e.flags?r(e.check,q,G,X-G):u(e.check,q,G,X-G)),G=$,(e.flags?T:s(T))!==e.check){c.msg="incorrect data check",e.mode=30;break}z=T=0}e.mode=28;case 28:if(e.wrap&&e.flags){for(;z<32;){if(P===0)break t;P--,T+=I[N++]<<z,z+=8}if(T!==(4294967295&e.total)){c.msg="incorrect length check",e.mode=30;break}z=T=0}e.mode=29;case 29:R=1;break t;case 30:R=-3;break t;case 31:return-4;default:return i}return c.next_out=X,c.avail_out=$,c.next_in=N,c.avail_in=P,e.hold=T,e.bits=z,(e.wsize||G!==c.avail_out&&e.mode<30&&(e.mode<27||E!==4))&&K(c,c.output,c.next_out,G-c.avail_out)?(e.mode=31,-4):(J-=c.avail_in,G-=c.avail_out,c.total_in+=J,c.total_out+=G,e.total+=G,e.wrap&&G&&(c.adler=e.check=e.flags?r(e.check,q,G,c.next_out-G):u(e.check,q,G,c.next_out-G)),c.data_type=e.bits+(e.last?64:0)+(e.mode===12?128:0)+(e.mode===20||e.mode===15?256:0),(J==0&&G===0||E===4)&&R===w&&(R=-5),R)},b.inflateEnd=function(c){if(!c||!c.state)return i;var E=c.state;return E.window&&(E.window=null),c.state=null,w},b.inflateGetHeader=function(c,E){var e;return c&&c.state?(2&(e=c.state).wrap)==0?i:((e.head=E).done=!1,w):i},b.inflateSetDictionary=function(c,E){var e,I=E.length;return c&&c.state?(e=c.state).wrap!==0&&e.mode!==11?i:e.mode===11&&u(1,E,I,0)!==e.check?-3:K(c,E,I,I)?(e.mode=31,-4):(e.havedict=1,w):i},b.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(f,C,b){"use strict";var o=f("../utils/common"),u=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],r=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],g=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];C.exports=function(v,p,w,i,d,n,h,s){var _,y,S,x,D,F,U,B,j,K=s.bits,c=0,E=0,e=0,I=0,q=0,N=0,X=0,P=0,$=0,T=0,z=null,J=0,G=new o.Buf16(16),H=new o.Buf16(16),nt=null,ot=0;for(c=0;c<=15;c++)G[c]=0;for(E=0;E<i;E++)G[p[w+E]]++;for(q=K,I=15;1<=I&&G[I]===0;I--);if(I<q&&(q=I),I===0)return d[n++]=20971520,d[n++]=20971520,s.bits=1,0;for(e=1;e<I&&G[e]===0;e++);for(q<e&&(q=e),c=P=1;c<=15;c++)if(P<<=1,(P-=G[c])<0)return-1;if(0<P&&(v===0||I!==1))return-1;for(H[1]=0,c=1;c<15;c++)H[c+1]=H[c]+G[c];for(E=0;E<i;E++)p[w+E]!==0&&(h[H[p[w+E]]++]=E);if(F=v===0?(z=nt=h,19):v===1?(z=u,J-=257,nt=r,ot-=257,256):(z=a,nt=g,-1),c=e,D=n,X=E=T=0,S=-1,x=($=1<<(N=q))-1,v===1&&852<$||v===2&&592<$)return 1;for(;;){for(U=c-X,j=h[E]<F?(B=0,h[E]):h[E]>F?(B=nt[ot+h[E]],z[J+h[E]]):(B=96,0),_=1<<c-X,e=y=1<<N;d[D+(T>>X)+(y-=_)]=U<<24|B<<16|j|0,y!==0;);for(_=1<<c-1;T&_;)_>>=1;if(_!==0?(T&=_-1,T+=_):T=0,E++,--G[c]==0){if(c===I)break;c=p[w+h[E]]}if(q<c&&(T&x)!==S){for(X===0&&(X=q),D+=e,P=1<<(N=c-X);N+X<I&&!((P-=G[N+X])<=0);)N++,P<<=1;if($+=1<<N,v===1&&852<$||v===2&&592<$)return 1;d[S=T&x]=q<<24|N<<16|D-n|0}}return T!==0&&(d[D+T]=c-X<<24|64<<16|0),s.bits=q,0}},{"../utils/common":41}],51:[function(f,C,b){"use strict";C.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(f,C,b){"use strict";var o=f("../utils/common"),u=0,r=1;function a(l){for(var k=l.length;0<=--k;)l[k]=0}var g=0,v=29,p=256,w=p+1+v,i=30,d=19,n=2*w+1,h=15,s=16,_=7,y=256,S=16,x=17,D=18,F=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],U=[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],B=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],j=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],K=new Array(2*(w+2));a(K);var c=new Array(2*i);a(c);var E=new Array(512);a(E);var e=new Array(256);a(e);var I=new Array(v);a(I);var q,N,X,P=new Array(i);function $(l,k,L,M,A){this.static_tree=l,this.extra_bits=k,this.extra_base=L,this.elems=M,this.max_length=A,this.has_stree=l&&l.length}function T(l,k){this.dyn_tree=l,this.max_code=0,this.stat_desc=k}function z(l){return l<256?E[l]:E[256+(l>>>7)]}function J(l,k){l.pending_buf[l.pending++]=255&k,l.pending_buf[l.pending++]=k>>>8&255}function G(l,k,L){l.bi_valid>s-L?(l.bi_buf|=k<<l.bi_valid&65535,J(l,l.bi_buf),l.bi_buf=k>>s-l.bi_valid,l.bi_valid+=L-s):(l.bi_buf|=k<<l.bi_valid&65535,l.bi_valid+=L)}function H(l,k,L){G(l,L[2*k],L[2*k+1])}function nt(l,k){for(var L=0;L|=1&l,l>>>=1,L<<=1,0<--k;);return L>>>1}function ot(l,k,L){var M,A,W=new Array(h+1),V=0;for(M=1;M<=h;M++)W[M]=V=V+L[M-1]<<1;for(A=0;A<=k;A++){var Z=l[2*A+1];Z!==0&&(l[2*A]=nt(W[Z]++,Z))}}function Q(l){var k;for(k=0;k<w;k++)l.dyn_ltree[2*k]=0;for(k=0;k<i;k++)l.dyn_dtree[2*k]=0;for(k=0;k<d;k++)l.bl_tree[2*k]=0;l.dyn_ltree[2*y]=1,l.opt_len=l.static_len=0,l.last_lit=l.matches=0}function et(l){8<l.bi_valid?J(l,l.bi_buf):0<l.bi_valid&&(l.pending_buf[l.pending++]=l.bi_buf),l.bi_buf=0,l.bi_valid=0}function st(l,k,L,M){var A=2*k,W=2*L;return l[A]<l[W]||l[A]===l[W]&&M[k]<=M[L]}function it(l,k,L){for(var M=l.heap[L],A=L<<1;A<=l.heap_len&&(A<l.heap_len&&st(k,l.heap[A+1],l.heap[A],l.depth)&&A++,!st(k,M,l.heap[A],l.depth));)l.heap[L]=l.heap[A],L=A,A<<=1;l.heap[L]=M}function ct(l,k,L){var M,A,W,V,Z=0;if(l.last_lit!==0)for(;M=l.pending_buf[l.d_buf+2*Z]<<8|l.pending_buf[l.d_buf+2*Z+1],A=l.pending_buf[l.l_buf+Z],Z++,M===0?H(l,A,k):(H(l,(W=e[A])+p+1,k),(V=F[W])!==0&&G(l,A-=I[W],V),H(l,W=z(--M),L),(V=U[W])!==0&&G(l,M-=P[W],V)),Z<l.last_lit;);H(l,y,k)}function lt(l,k){var L,M,A,W=k.dyn_tree,V=k.stat_desc.static_tree,Z=k.stat_desc.has_stree,Y=k.stat_desc.elems,rt=-1;for(l.heap_len=0,l.heap_max=n,L=0;L<Y;L++)W[2*L]!==0?(l.heap[++l.heap_len]=rt=L,l.depth[L]=0):W[2*L+1]=0;for(;l.heap_len<2;)W[2*(A=l.heap[++l.heap_len]=rt<2?++rt:0)]=1,l.depth[A]=0,l.opt_len--,Z&&(l.static_len-=V[2*A+1]);for(k.max_code=rt,L=l.heap_len>>1;1<=L;L--)it(l,W,L);for(A=Y;L=l.heap[1],l.heap[1]=l.heap[l.heap_len--],it(l,W,1),M=l.heap[1],l.heap[--l.heap_max]=L,l.heap[--l.heap_max]=M,W[2*A]=W[2*L]+W[2*M],l.depth[A]=(l.depth[L]>=l.depth[M]?l.depth[L]:l.depth[M])+1,W[2*L+1]=W[2*M+1]=A,l.heap[1]=A++,it(l,W,1),2<=l.heap_len;);l.heap[--l.heap_max]=l.heap[1],(function(tt,ut){var dt,ht,pt,at,wt,xt,ft=ut.dyn_tree,Ct=ut.max_code,Rt=ut.stat_desc.static_tree,Dt=ut.stat_desc.has_stree,Nt=ut.stat_desc.extra_bits,zt=ut.stat_desc.extra_base,mt=ut.stat_desc.max_length,vt=0;for(at=0;at<=h;at++)tt.bl_count[at]=0;for(ft[2*tt.heap[tt.heap_max]+1]=0,dt=tt.heap_max+1;dt<n;dt++)mt<(at=ft[2*ft[2*(ht=tt.heap[dt])+1]+1]+1)&&(at=mt,vt++),ft[2*ht+1]=at,Ct<ht||(tt.bl_count[at]++,wt=0,zt<=ht&&(wt=Nt[ht-zt]),xt=ft[2*ht],tt.opt_len+=xt*(at+wt),Dt&&(tt.static_len+=xt*(Rt[2*ht+1]+wt)));if(vt!==0){do{for(at=mt-1;tt.bl_count[at]===0;)at--;tt.bl_count[at]--,tt.bl_count[at+1]+=2,tt.bl_count[mt]--,vt-=2}while(0<vt);for(at=mt;at!==0;at--)for(ht=tt.bl_count[at];ht!==0;)Ct<(pt=tt.heap[--dt])||(ft[2*pt+1]!==at&&(tt.opt_len+=(at-ft[2*pt+1])*ft[2*pt],ft[2*pt+1]=at),ht--)}})(l,k),ot(W,rt,l.bl_count)}function t(l,k,L){var M,A,W=-1,V=k[1],Z=0,Y=7,rt=4;for(V===0&&(Y=138,rt=3),k[2*(L+1)+1]=65535,M=0;M<=L;M++)A=V,V=k[2*(M+1)+1],++Z<Y&&A===V||(Z<rt?l.bl_tree[2*A]+=Z:A!==0?(A!==W&&l.bl_tree[2*A]++,l.bl_tree[2*S]++):Z<=10?l.bl_tree[2*x]++:l.bl_tree[2*D]++,W=A,rt=(Z=0)===V?(Y=138,3):A===V?(Y=6,3):(Y=7,4))}function R(l,k,L){var M,A,W=-1,V=k[1],Z=0,Y=7,rt=4;for(V===0&&(Y=138,rt=3),M=0;M<=L;M++)if(A=V,V=k[2*(M+1)+1],!(++Z<Y&&A===V)){if(Z<rt)for(;H(l,A,l.bl_tree),--Z!=0;);else A!==0?(A!==W&&(H(l,A,l.bl_tree),Z--),H(l,S,l.bl_tree),G(l,Z-3,2)):Z<=10?(H(l,x,l.bl_tree),G(l,Z-3,3)):(H(l,D,l.bl_tree),G(l,Z-11,7));W=A,rt=(Z=0)===V?(Y=138,3):A===V?(Y=6,3):(Y=7,4)}}a(P);var O=!1;function m(l,k,L,M){G(l,(g<<1)+(M?1:0),3),(function(A,W,V,Z){et(A),Z&&(J(A,V),J(A,~V)),o.arraySet(A.pending_buf,A.window,W,V,A.pending),A.pending+=V})(l,k,L,!0)}b._tr_init=function(l){O||((function(){var k,L,M,A,W,V=new Array(h+1);for(A=M=0;A<v-1;A++)for(I[A]=M,k=0;k<1<<F[A];k++)e[M++]=A;for(e[M-1]=A,A=W=0;A<16;A++)for(P[A]=W,k=0;k<1<<U[A];k++)E[W++]=A;for(W>>=7;A<i;A++)for(P[A]=W<<7,k=0;k<1<<U[A]-7;k++)E[256+W++]=A;for(L=0;L<=h;L++)V[L]=0;for(k=0;k<=143;)K[2*k+1]=8,k++,V[8]++;for(;k<=255;)K[2*k+1]=9,k++,V[9]++;for(;k<=279;)K[2*k+1]=7,k++,V[7]++;for(;k<=287;)K[2*k+1]=8,k++,V[8]++;for(ot(K,w+1,V),k=0;k<i;k++)c[2*k+1]=5,c[2*k]=nt(k,5);q=new $(K,F,p+1,w,h),N=new $(c,U,0,i,h),X=new $(new Array(0),B,0,d,_)})(),O=!0),l.l_desc=new T(l.dyn_ltree,q),l.d_desc=new T(l.dyn_dtree,N),l.bl_desc=new T(l.bl_tree,X),l.bi_buf=0,l.bi_valid=0,Q(l)},b._tr_stored_block=m,b._tr_flush_block=function(l,k,L,M){var A,W,V=0;0<l.level?(l.strm.data_type===2&&(l.strm.data_type=(function(Z){var Y,rt=4093624447;for(Y=0;Y<=31;Y++,rt>>>=1)if(1&rt&&Z.dyn_ltree[2*Y]!==0)return u;if(Z.dyn_ltree[18]!==0||Z.dyn_ltree[20]!==0||Z.dyn_ltree[26]!==0)return r;for(Y=32;Y<p;Y++)if(Z.dyn_ltree[2*Y]!==0)return r;return u})(l)),lt(l,l.l_desc),lt(l,l.d_desc),V=(function(Z){var Y;for(t(Z,Z.dyn_ltree,Z.l_desc.max_code),t(Z,Z.dyn_dtree,Z.d_desc.max_code),lt(Z,Z.bl_desc),Y=d-1;3<=Y&&Z.bl_tree[2*j[Y]+1]===0;Y--);return Z.opt_len+=3*(Y+1)+5+5+4,Y})(l),A=l.opt_len+3+7>>>3,(W=l.static_len+3+7>>>3)<=A&&(A=W)):A=W=L+5,L+4<=A&&k!==-1?m(l,k,L,M):l.strategy===4||W===A?(G(l,2+(M?1:0),3),ct(l,K,c)):(G(l,4+(M?1:0),3),(function(Z,Y,rt,tt){var ut;for(G(Z,Y-257,5),G(Z,rt-1,5),G(Z,tt-4,4),ut=0;ut<tt;ut++)G(Z,Z.bl_tree[2*j[ut]+1],3);R(Z,Z.dyn_ltree,Y-1),R(Z,Z.dyn_dtree,rt-1)})(l,l.l_desc.max_code+1,l.d_desc.max_code+1,V+1),ct(l,l.dyn_ltree,l.dyn_dtree)),Q(l),M&&et(l)},b._tr_tally=function(l,k,L){return l.pending_buf[l.d_buf+2*l.last_lit]=k>>>8&255,l.pending_buf[l.d_buf+2*l.last_lit+1]=255&k,l.pending_buf[l.l_buf+l.last_lit]=255&L,l.last_lit++,k===0?l.dyn_ltree[2*L]++:(l.matches++,k--,l.dyn_ltree[2*(e[L]+p+1)]++,l.dyn_dtree[2*z(k)]++),l.last_lit===l.lit_bufsize-1},b._tr_align=function(l){G(l,2,3),H(l,y,K),(function(k){k.bi_valid===16?(J(k,k.bi_buf),k.bi_buf=0,k.bi_valid=0):8<=k.bi_valid&&(k.pending_buf[k.pending++]=255&k.bi_buf,k.bi_buf>>=8,k.bi_valid-=8)})(l)}},{"../utils/common":41}],53:[function(f,C,b){"use strict";C.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(f,C,b){(function(o){(function(u,r){"use strict";if(!u.setImmediate){var a,g,v,p,w=1,i={},d=!1,n=u.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(u);h=h&&h.setTimeout?h:u,a={}.toString.call(u.process)==="[object process]"?function(S){process.nextTick(function(){_(S)})}:(function(){if(u.postMessage&&!u.importScripts){var S=!0,x=u.onmessage;return u.onmessage=function(){S=!1},u.postMessage("","*"),u.onmessage=x,S}})()?(p="setImmediate$"+Math.random()+"$",u.addEventListener?u.addEventListener("message",y,!1):u.attachEvent("onmessage",y),function(S){u.postMessage(p+S,"*")}):u.MessageChannel?((v=new MessageChannel).port1.onmessage=function(S){_(S.data)},function(S){v.port2.postMessage(S)}):n&&"onreadystatechange"in n.createElement("script")?(g=n.documentElement,function(S){var x=n.createElement("script");x.onreadystatechange=function(){_(S),x.onreadystatechange=null,g.removeChild(x),x=null},g.appendChild(x)}):function(S){setTimeout(_,0,S)},h.setImmediate=function(S){typeof S!="function"&&(S=new Function(""+S));for(var x=new Array(arguments.length-1),D=0;D<x.length;D++)x[D]=arguments[D+1];var F={callback:S,args:x};return i[w]=F,a(w),w++},h.clearImmediate=s}function s(S){delete i[S]}function _(S){if(d)setTimeout(_,0,S);else{var x=i[S];if(x){d=!0;try{(function(D){var F=D.callback,U=D.args;switch(U.length){case 0:F();break;case 1:F(U[0]);break;case 2:F(U[0],U[1]);break;case 3:F(U[0],U[1],U[2]);break;default:F.apply(r,U)}})(x)}finally{s(S),d=!1}}}}function y(S){S.source===u&&typeof S.data=="string"&&S.data.indexOf(p)===0&&_(+S.data.slice(p.length))}})(typeof self>"u"?o===void 0?this:o:self)}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})});async function qt({canvas:f,exporter:C,fps:b=30,concurrency:o=2,maxQueue:u=8,policy:r="drop",onProgress:a,signal:g}={}){if(!(f instanceof HTMLCanvasElement))throw new TypeError("canvas must be an HTMLCanvasElement");if(!C||typeof C.write!="function"||typeof C.finalize!="function")throw new TypeError("exporter must have write() and finalize()");if(!Number.isFinite(b)||b<=0)throw new TypeError("fps must be positive");if(!Number.isInteger(o)||o<1)throw new TypeError("concurrency must be >= 1");if(!Number.isInteger(u)||u<0)throw new TypeError("maxQueue must be >= 0");if(r!=="drop"&&r!=="block")throw new TypeError('policy must be "drop" or "block"');let v=new Worker(new URL("./worker.js",import.meta.url),{type:"module"});await new Promise((c,E)=>{let e=I=>{I.data?.type==="ready"?(v.removeEventListener("message",e),c()):I.data?.type==="error"&&(v.removeEventListener("message",e),E(new Error(I.data.message||"Worker error")))};v.addEventListener("message",e),v.addEventListener("error",E)});let p={captured:0,encoded:0,written:0,dropped:0,queueMax:0,inFlightMax:0,lastBitmapMs:0,bitmapMsAvg:0,lastEncodeMs:0,encodeMsAvg:0,lastWriteMs:0,writeMsAvg:0},w=!1,i=null,d=0,n=[],h=[],s=new Map;function _(){if(g?.aborted)throw g.reason??new DOMException("Aborted","AbortError")}function y(){let c=h.shift();c&&c()}async function S(c){if(r==="drop")return n.length>=u?(p.dropped++,typeof c.bitmap.close=="function"&&c.bitmap.close(),a?.({...p}),!1):(n.push(c),p.queueMax=Math.max(p.queueMax,n.length),!0);for(;n.length>=u;)if(await new Promise(E=>h.push(E)),_(),w)return!1;return n.push(c),p.queueMax=Math.max(p.queueMax,n.length),!0}function x(){for(;!w&&d<o&&n.length>0;){let c=n.shift();y(),d++,p.inFlightMax=Math.max(p.inFlightMax,d);let{seq:E,bitmap:e,w:I,h:q}=c,N=new Promise((X,P)=>s.set(E,{resolve:X,reject:P}));v.postMessage({type:"encode",frameIndex:E,bitmap:e,width:I,height:q},[e]),N.catch(()=>{})}}v.addEventListener("message",async c=>{let E=c.data;if(!(!E||typeof E!="object"))if(E.type==="frame"){let{frameIndex:e,blob:I,encodeMs:q}=E;p.encoded++,typeof q=="number"&&(p.lastEncodeMs=q,p.encodeMsAvg=p.encodeMsAvg?p.encodeMsAvg*.9+q*.1:q);try{let N=performance.now();await C.write(e,I);let X=performance.now();p.written++;let P=X-N;p.lastWriteMs=P,p.writeMsAvg=p.writeMsAvg?p.writeMsAvg*.9+P*.1:P;let $=s.get(e);$&&$.resolve()}catch(N){let X=s.get(e);X&&X.reject(N)}finally{s.delete(e),d--,x(),a?.({...p})}}else E.type==="error"&&console.error("Worker error:",E.message)});let D=1e3/b,F=0,U=null,B=0;function j(c){if(w)return;try{_()}catch{K().catch(()=>{});return}U==null&&(U=c);let E=c-U;for(U=c,F+=E;F>=D;){F-=D;let e=performance.now();createImageBitmap(f).then(async I=>{let N=performance.now()-e;if(p.lastBitmapMs=N,p.bitmapMsAvg=p.bitmapMsAvg?p.bitmapMsAvg*.9+N*.1:N,w){typeof I.close=="function"&&I.close();return}p.captured++,await S({seq:B++,bitmap:I,w:f.width,h:f.height})&&x(),a?.({...p})}).catch(I=>console.error("createImageBitmap failed:",I))}i=requestAnimationFrame(j)}i=requestAnimationFrame(j);async function K(){if(!w){for(w=!0,i!=null&&cancelAnimationFrame(i);h.length;)y();for(let c of n.splice(0,n.length))typeof c.bitmap.close=="function"&&c.bitmap.close();for(;d>0||s.size>0;)await new Promise(c=>setTimeout(c,25));await C.finalize(),v.terminate()}}return{stop:K,stats:p}}function Et({fps:f=60,hookDateNow:C=!0,hookPerformanceNow:b=!0,hookTimers:o=!0,maxTimerCallbacksPerStep:u=1e4}={}){if(!Number.isFinite(f)||f<=0)throw new TypeError("installVirtualTime: fps must be a positive number");let r=1e3/f,a={requestAnimationFrame:window.requestAnimationFrame?.bind(window),cancelAnimationFrame:window.cancelAnimationFrame?.bind(window),setTimeout:window.setTimeout?.bind(window),clearTimeout:window.clearTimeout?.bind(window),setInterval:window.setInterval?.bind(window),clearInterval:window.clearInterval?.bind(window),dateNow:Date.now.bind(Date),perfNow:performance.now.bind(performance)};if(typeof a.requestAnimationFrame!="function")throw new Error("installVirtualTime: requestAnimationFrame not available");if(typeof a.cancelAnimationFrame!="function")throw new Error("installVirtualTime: cancelAnimationFrame not available");let g=!0,v=0,p=1,w=new Map,i=[];function d(c){if(!g||typeof c!="function")return a.requestAnimationFrame(c);let E=p++;return w.set(E,c),i.push(E),E}function n(c){if(!g)return a.cancelAnimationFrame(c);w.delete(c)}let h=1,s=new Map;function _(c){let E=Number(c);return!Number.isFinite(E)||E<0?0:E}function y(c,E,...e){if(!g)return a.setTimeout(c,E,...e);if(typeof c!="function")return a.setTimeout(c,E,...e);let I=h++,q=_(E);return s.set(I,{type:"timeout",dueMs:v+q,intervalMs:0,fn:()=>c(...e)}),I}function S(c){if(!g)return a.clearTimeout(c);s.delete(c)}function x(c,E,...e){if(!g)return a.setInterval(c,E,...e);if(typeof c!="function")return a.setInterval(c,E,...e);let I=h++,q=_(E);return s.set(I,{type:"interval",dueMs:v+q,intervalMs:q,fn:()=>c(...e)}),I}function D(c){if(!g)return a.clearInterval(c);s.delete(c)}if(window.requestAnimationFrame=d,window.cancelAnimationFrame=n,o){if(typeof a.setTimeout!="function"||typeof a.clearTimeout!="function")throw new Error("installVirtualTime: setTimeout/clearTimeout not available");if(typeof a.setInterval!="function"||typeof a.clearInterval!="function")throw new Error("installVirtualTime: setInterval/clearInterval not available");window.setTimeout=y,window.clearTimeout=S,window.setInterval=x,window.clearInterval=D}C&&(Date.now=function(){return g?v:a.dateNow()}),b&&(performance.now=function(){return g?v:a.perfNow()});function F(){let c=0;for(;;){if(c>u)throw new Error(`VirtualTime: too many timer callbacks in a single step (>${u}).`);let E=1/0;for(let I of s.values())I.dueMs<E&&(E=I.dueMs);if(!(E<=v))break;let e=[];for(let[I,q]of s.entries())q.dueMs<=v&&e.push([I,q]);e.sort((I,q)=>I[1].dueMs-q[1].dueMs||I[0]-q[0]);for(let[I,q]of e)if(s.has(I))if(c++,q.fn(),q.type==="timeout")s.delete(I);else{let N=q.intervalMs,X=q.dueMs+N;X<=v&&(X=v),q.dueMs=X,s.set(I,q)}}}function U(){let c=i.splice(0,i.length);for(let E of c){let e=w.get(E);e&&(w.delete(E),e(v))}}function B(c=1){if(!g)throw new Error("VirtualTime: not running");if(!Number.isInteger(c)||c<1)throw new TypeError("VirtualTime.step: frames must be an integer >= 1");for(let E=0;E<c;E++)v+=r,o&&F(),U()}function j(){g=!1}function K(){window.requestAnimationFrame=a.requestAnimationFrame,window.cancelAnimationFrame=a.cancelAnimationFrame,o&&(window.setTimeout=a.setTimeout,window.clearTimeout=a.clearTimeout,window.setInterval=a.setInterval,window.clearInterval=a.clearInterval),C&&(Date.now=a.dateNow),b&&(performance.now=a.perfNow),g=!1,w.clear(),i.length=0,s.clear()}return{step:B,restore:K,stopVirtualTime:j,get nowMs(){return v},get dtMs(){return r}}}function bt({doc:f,selector:C,includeShadow:b=!0,maxIframeDepth:o=8,_depth:u=0}={}){if(!f||u>o)return null;try{let a=f.querySelector(C);if(a)return{el:a,doc:f}}catch{}if(b){let a=[];try{a=f.querySelectorAll("*")}catch{a=[]}for(let g of a){let v=g.shadowRoot;if(v)try{let p=v.querySelector(C);if(p)return{el:p,doc:f}}catch{}}}let r=[];try{r=f.querySelectorAll("iframe")}catch{r=[]}for(let a of r){let g=null;try{g=a.contentDocument}catch{g=null}if(!g)continue;let v=bt({doc:g,selector:C,includeShadow:b,maxIframeDepth:o,_depth:u+1});if(v)return v}return null}function gt(f="snapshot"){let C={tag:f,href:(()=>{try{return location.href}catch{return"(no location)"}})(),readyState:(()=>{try{return document.readyState}catch{return"(no document)"}})(),canvasCount:(()=>{try{return document.querySelectorAll("canvas").length}catch{return-1}})(),iframeCount:(()=>{try{return document.querySelectorAll("iframe").length}catch{return-1}})()};console.warn("[pa_encoder]",C)}function Gt({selector:f="canvas",timeoutMs:C=15e3,pollMs:b=50,includeShadow:o=!0}={}){let u=bt({doc:document,selector:f,includeShadow:o});return u?.el?Promise.resolve(u):new Promise((r,a)=>{let g=performance.now(),v=!1,p=null,w=n=>{if(!v){v=!0;try{n?.disconnect()}catch{}p&&clearInterval(p)}},i=n=>{let h=bt({doc:document,selector:f,includeShadow:o});if(h?.el){w(n),r(h);return}performance.now()-g>C&&(w(n),gt("waitForCanvasLiveDeep timeout"),a(new Error(`Timed out waiting for canvas selector: ${f}`)))},d=new MutationObserver(()=>i(d));d.observe(document.documentElement,{childList:!0,subtree:!0}),p=setInterval(()=>i(d),b)})}function Tt(f){let C=f?.el;if(C instanceof HTMLCanvasElement)return C;throw new Error("Found element is not a canvas")}async function yt({vt:f,selector:C="canvas",canvasWaitFrames:b=240,includeShadow:o=!0}={}){let u=()=>{let r=bt({doc:document,selector:C,includeShadow:o});if(!r?.el)throw new Error("No canvas found on the page");return Tt(r)};try{return u()}catch(r){console.warn("[pa_encoder] resolveCanvas failed:",r?.message??r)}for(let r=0;r<b;r++){f.step(1);try{return u()}catch(a){console.warn("[pa_encoder] resolveCanvas failed:",a?.message??a)}}throw new Error("No canvas found on the page")}async function Vt({fps:f=60,canvasSelector:C="canvas",preWaitTimeoutMs:b=15e3,includeShadow:o=!0,canvasWaitFrames:u=240,hookDateNow:r=!0,hookPerformanceNow:a=!0,hookTimers:g=!0,frameCount:v=60,onFrame:p=null}={}){gt("virtualTimeCapture start");let w=await Gt({selector:C||"canvas",timeoutMs:b,includeShadow:o});Tt(w);let i=Et({fps:f,hookDateNow:r,hookPerformanceNow:a,hookTimers:g});try{let d=await yt({vt:i,selector:C||"canvas",canvasWaitFrames:u,includeShadow:o});for(let n=0;n<v;n++)i.step(1),(!(d instanceof HTMLCanvasElement)||!d.isConnected)&&(d=await yt({vt:i,selector:C||"canvas",canvasWaitFrames:30,includeShadow:o})),typeof p=="function"&&await p(d,n);return{ok:!0}}finally{i.restore(),gt("virtualTimeCapture end")}}async function Kt({fps:f=60,start:C=null,canvasSelector:b="canvas",includeShadow:o=!0,canvasWaitFrames:u=600,hookDateNow:r=!0,hookPerformanceNow:a=!0,hookTimers:g=!0,frameCount:v=60,onFrame:p=null}={}){gt("virtualTimeCaptureFromStart begin");let w=Et({fps:f,hookDateNow:r,hookPerformanceNow:a,hookTimers:g});try{typeof C=="function"&&await C();let i=await yt({vt:w,selector:b||"canvas",canvasWaitFrames:u,includeShadow:o});for(let d=0;d<v;d++)w.step(1),(!(i instanceof HTMLCanvasElement)||!i.isConnected)&&(i=await yt({vt:w,selector:b||"canvas",canvasWaitFrames:30,includeShadow:o})),typeof p=="function"&&await p(i,d);return{ok:!0}}finally{w.restore(),gt("virtualTimeCaptureFromStart end")}}async function St({dirNameHint:f="frames",filename:C=b=>`frame_${String(b).padStart(6,"0")}.png`}={}){if(!("showDirectoryPicker"in window))throw new Error("File System Access API is not supported in this browser.");let b=await window.showDirectoryPicker({id:f});return{async write(o,u){let r=C(o),g=await(await b.getFileHandle(r,{create:!0})).createWritable();await g.write(u),await g.close()},async finalize(){}}}var Ft=Ht(Bt(),1);function Yt(f,C){let b=URL.createObjectURL(C),o=document.createElement("a");o.href=b,o.download=f,document.body.appendChild(o),o.click(),o.remove(),setTimeout(()=>URL.revokeObjectURL(b),1e3)}async function kt({zipName:f="frames.zip",filename:C=o=>`frame_${String(o).padStart(6,"0")}.png`,compressionLevel:b=6}={}){let o=new Ft.default,u=0;return{async write(r,a){let g=C(r),v=await a.arrayBuffer();o.file(g,v),u++},async finalize(){let r=await o.generateAsync({type:"blob",compression:"DEFLATE",compressionOptions:{level:b}});return Yt(f,r),{files:u}}}}async function Xt({prefer:f="fs",fs:C,zip:b}={}){let o=typeof window<"u"&&window.isSecureContext===!0&&"showDirectoryPicker"in window;return f==="fs"&&o?await St(C):f==="zip"?await kt(b):await kt(b)}export{Xt as createBestExporter,St as createFsExporter,kt as createZipExporter,qt as startLiveCapture,Vt as virtualTimeCapture,Kt as virtualTimeCaptureFromStart};
|
|
3
|
+
/*! Bundled license information:
|
|
4
|
+
|
|
5
|
+
jszip/dist/jszip.min.js:
|
|
6
|
+
(*!
|
|
7
|
+
|
|
8
|
+
JSZip v3.10.1 - A JavaScript class for generating and reading zip files
|
|
9
|
+
<http://stuartk.com/jszip>
|
|
10
|
+
|
|
11
|
+
(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
|
|
12
|
+
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
|
|
13
|
+
|
|
14
|
+
JSZip uses the library pako released under the MIT license :
|
|
15
|
+
https://github.com/nodeca/pako/blob/main/LICENSE
|
|
16
|
+
*)
|
|
17
|
+
*/
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import http from "node:http";
|
|
3
|
+
import { readFileSync } from "node:fs";
|
|
4
|
+
import path from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { request as httpRequest } from "node:http";
|
|
7
|
+
import { request as httpsRequest } from "node:https";
|
|
8
|
+
import { spawn } from "node:child_process";
|
|
9
|
+
|
|
10
|
+
function parseArgs(argv) {
|
|
11
|
+
const out = {};
|
|
12
|
+
for (let i = 0; i < argv.length; i++) {
|
|
13
|
+
const a = argv[i];
|
|
14
|
+
if (!a.startsWith("--")) continue;
|
|
15
|
+
const k = a.slice(2);
|
|
16
|
+
const v = argv[i + 1] && !argv[i + 1].startsWith("--") ? argv[++i] : "true";
|
|
17
|
+
out[k] = v;
|
|
18
|
+
}
|
|
19
|
+
return out;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function openBrowser(url) {
|
|
23
|
+
const plat = process.platform;
|
|
24
|
+
const cmd =
|
|
25
|
+
plat === "darwin" ? "open" : plat === "win32" ? "cmd" : "xdg-open";
|
|
26
|
+
const args = plat === "win32" ? ["/c", "start", "", url] : [url];
|
|
27
|
+
spawn(cmd, args, { stdio: "ignore", detached: true }).unref();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function proxyRequest(target, req, res) {
|
|
31
|
+
const u = new URL(target);
|
|
32
|
+
const isHttps = u.protocol === "https:";
|
|
33
|
+
const libReq = isHttps ? httpsRequest : httpRequest;
|
|
34
|
+
|
|
35
|
+
const opts = {
|
|
36
|
+
protocol: u.protocol,
|
|
37
|
+
hostname: u.hostname,
|
|
38
|
+
port: u.port || (isHttps ? 443 : 80),
|
|
39
|
+
method: req.method,
|
|
40
|
+
path: req.url,
|
|
41
|
+
headers: { ...req.headers, host: u.host },
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
const p = libReq(opts, (pr) => {
|
|
45
|
+
res.writeHead(pr.statusCode || 500, pr.headers);
|
|
46
|
+
pr.pipe(res);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
p.on("error", (e) => {
|
|
50
|
+
res.statusCode = 502;
|
|
51
|
+
res.setHeader("Content-Type", "text/plain; charset=utf-8");
|
|
52
|
+
res.end(`Proxy error: ${e.message}`);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
req.pipe(p);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const args = parseArgs(process.argv.slice(2));
|
|
59
|
+
const target = args.url || "http://localhost:5173";
|
|
60
|
+
const entry = args.entry || "/src/main.js";
|
|
61
|
+
const port = Number(args.port || "8787");
|
|
62
|
+
|
|
63
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
64
|
+
const __dirname = path.dirname(__filename);
|
|
65
|
+
|
|
66
|
+
const uiDir = path.join(__dirname, "ui");
|
|
67
|
+
|
|
68
|
+
const encoderHtmlPath = path.join(uiDir, "encoder.html");
|
|
69
|
+
const encoderJsPath = path.join(uiDir, "encoder.js");
|
|
70
|
+
const previewHtmlPath = path.join(uiDir, "preview.html");
|
|
71
|
+
const previewJsPath = path.join(uiDir, "preview.js");
|
|
72
|
+
|
|
73
|
+
const libWorkerPath = path.join(__dirname, "worker.js");
|
|
74
|
+
const libBrowserIndexPath = path.join(__dirname, "browser", "index.js");
|
|
75
|
+
|
|
76
|
+
const server = http.createServer((req, res) => {
|
|
77
|
+
const full = req.url || "/";
|
|
78
|
+
const urlObj = new URL(full, "http://localhost");
|
|
79
|
+
const pathname = urlObj.pathname;
|
|
80
|
+
|
|
81
|
+
if (pathname === "/favicon.ico") {
|
|
82
|
+
res.statusCode = 204;
|
|
83
|
+
res.end();
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (pathname === "/__pa_encoder__/encoder") {
|
|
88
|
+
const html = readFileSync(encoderHtmlPath, "utf-8");
|
|
89
|
+
res.setHeader("Content-Type", "text/html; charset=utf-8");
|
|
90
|
+
res.end(html);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (pathname === "/__pa_encoder__/ui/encoder.js") {
|
|
95
|
+
const js = readFileSync(encoderJsPath, "utf-8");
|
|
96
|
+
res.setHeader("Content-Type", "application/javascript; charset=utf-8");
|
|
97
|
+
res.end(js);
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
if (pathname === "/__pa_encoder__/ui/preview.html") {
|
|
102
|
+
const html = readFileSync(previewHtmlPath, "utf-8");
|
|
103
|
+
res.setHeader("Content-Type", "text/html; charset=utf-8");
|
|
104
|
+
res.end(html);
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (pathname === "/__pa_encoder__/ui/preview.js") {
|
|
109
|
+
const js = readFileSync(previewJsPath, "utf-8");
|
|
110
|
+
res.setHeader("Content-Type", "application/javascript; charset=utf-8");
|
|
111
|
+
res.end(js);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
// Browser UI에서 import할 라이브러리 엔트리
|
|
116
|
+
if (pathname === "/__pa_encoder__/lib/index.js") {
|
|
117
|
+
const lib = readFileSync(libBrowserIndexPath, "utf-8");
|
|
118
|
+
res.setHeader("Content-Type", "application/javascript; charset=utf-8");
|
|
119
|
+
res.end(lib);
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// lib/index.js가 import.meta.url 기준 ./worker.js를 로드할 수 있도록
|
|
124
|
+
if (pathname === "/__pa_encoder__/lib/worker.js") {
|
|
125
|
+
const w = readFileSync(libWorkerPath, "utf-8");
|
|
126
|
+
res.setHeader("Content-Type", "application/javascript; charset=utf-8");
|
|
127
|
+
res.end(w);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
proxyRequest(target, req, res);
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
server.listen(port, () => {
|
|
135
|
+
const uiUrl =
|
|
136
|
+
`http://localhost:${port}/__pa_encoder__/encoder` +
|
|
137
|
+
`?entry=${encodeURIComponent(entry)}`;
|
|
138
|
+
|
|
139
|
+
console.log(`[pa_encoder] target: ${target}`);
|
|
140
|
+
console.log(`[pa_encoder] entry : ${entry}`);
|
|
141
|
+
console.log(`[pa_encoder] ui : ${uiUrl}`);
|
|
142
|
+
|
|
143
|
+
openBrowser(uiUrl);
|
|
144
|
+
});
|