plugin-ai-chat-file-preview 1.0.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 ADDED
@@ -0,0 +1,44 @@
1
+ # plugin-ai-chat-file-preview
2
+
3
+ Enhances the NocoBase AI Employee chat interface by providing a seamless, in-browser popup preview for uploaded file attachments.
4
+
5
+ ## Features
6
+
7
+ - **Instant File Preview**: Click on any document, image, or spreadsheet attachment in the AI chat window to open a rich modal preview instantly, without navigating away or opening a new tab.
8
+ - **Smart Client-side Caching**: Leverages IndexedDB to cache files locally as soon as they are fetched or uploaded, dramatically improving load times and reducing server bandwidth for subsequent previews.
9
+ - **Multi-format Support**:
10
+ - **PDF**: Native browser iframe rendering
11
+ - **Images**: PNG, JPG, GIF, WebP, SVG, BMP
12
+ - **Text**: TXT, CSV, HTML, JSON, XML, YAML, MD
13
+ - **Documents**: Word (.docx) via `docx-preview`
14
+ - **Spreadsheets**: Excel (.xlsx, .xls) via `xlsx`
15
+ - **Zero Configuration**: 100% plug-and-play. Hooks directly into the existing NocoBase AI chat system using non-intrusive DOM event interception and global React Providers.
16
+ - **Graceful Fallback**: Automatically provides a secure download link containing the proper Bearer Token for un-previewable formats.
17
+
18
+ ## Installation
19
+
20
+ You can install this plugin in your NocoBase project via the Plugin Manager:
21
+
22
+ ```bash
23
+ yarn pm add plugin-ai-chat-file-preview
24
+ yarn pm enable plugin-ai-chat-file-preview
25
+ ```
26
+
27
+ *(If utilizing the `.tgz` package directly offline, place it in the application or upload it via UI)*
28
+
29
+ ## Technical Details
30
+
31
+ - **No Core Modifications**: This plugin relies on catching global DOM click events targeted at `.ant-attachments-file-card` components rendered by `@ant-design/x`, avoiding any necessity to modify the core `@nocobase/plugin-ai`.
32
+ - **Session Continuity**: Hooks into the Axios instance to track NocoBase's `sessionId`, ensuring that files are grouped naturally and their Blob caches are completely cleared when a conversation is destroyed.
33
+
34
+ ## Usage
35
+
36
+ Simply enable the plugin. Once activated:
37
+ 1. Open the **AI Chat** panel on any page.
38
+ 2. Drag and drop, or select a file to upload.
39
+ 3. Once the file appears as a chip in the chat, click it!
40
+ 4. The file will pop up in a gorgeous, centered overlay window.
41
+
42
+ ## License
43
+
44
+ Apache-2.0
package/client.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './dist/client';
2
+ export { default } from './dist/client';
package/client.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/client');
@@ -0,0 +1,30 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ (self.webpackChunkplugin_ai_chat_file_preview=self.webpackChunkplugin_ai_chat_file_preview||[]).push([["395"],{164:function(e,t,r){e.exports=(function e(t,r,a){function n(i,o){if(!r[i]){if(!t[i]){if(s)return s(i,!0);var l=Error("Cannot find module '"+i+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[i]={exports:{}};t[i][0].call(c.exports,function(e){return n(t[i][1][e]||e)},c,c.exports,e,t,r,a)}return r[i].exports}for(var s=void 0,i=0;i<a.length;i++)n(a[i]);return n})({1:[function(e,t,r){"use strict";var a=e("./utils"),n=e("./support"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";r.encode=function(e){for(var t,r,n,i,o,l,c,h=[],u=0,d=e.length,f=d,p="string"!==a.getTypeOf(e);u<e.length;)f=d-u,n=p?(t=e[u++],r=u<d?e[u++]:0,u<d?e[u++]:0):(t=e.charCodeAt(u++),r=u<d?e.charCodeAt(u++):0,u<d?e.charCodeAt(u++):0),i=t>>2,o=(3&t)<<4|r>>4,l=1<f?(15&r)<<2|n>>6:64,c=2<f?63&n:64,h.push(s.charAt(i)+s.charAt(o)+s.charAt(l)+s.charAt(c));return h.join("")},r.decode=function(e){var t,r,a,i,o,l,c=0,h=0,u="data:";if(e.substr(0,u.length)===u)throw Error("Invalid base64 input, it looks like a data url.");var d,f=3*(e=e.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(e.charAt(e.length-1)===s.charAt(64)&&f--,e.charAt(e.length-2)===s.charAt(64)&&f--,f%1!=0)throw Error("Invalid base64 input, bad content length.");for(d=n.uint8array?new Uint8Array(0|f):Array(0|f);c<e.length;)t=s.indexOf(e.charAt(c++))<<2|(i=s.indexOf(e.charAt(c++)))>>4,r=(15&i)<<4|(o=s.indexOf(e.charAt(c++)))>>2,a=(3&o)<<6|(l=s.indexOf(e.charAt(c++))),d[h++]=t,64!==o&&(d[h++]=r),64!==l&&(d[h++]=a);return d}},{"./support":30,"./utils":32}],2:[function(e,t,r){"use strict";var a=e("./external"),n=e("./stream/DataWorker"),s=e("./stream/Crc32Probe"),i=e("./stream/DataLengthProbe");function o(e,t,r,a,n){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=a,this.compressedContent=n}o.prototype={getContentWorker:function(){var e=new n(a.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new i("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new n(a.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(e,t,r){return e.pipe(new s).pipe(new i("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new i("compressedSize")).withStreamInfo("compression",t)},t.exports=o},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,r){"use strict";var a=e("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new a("STORE compression")},uncompressWorker:function(){return new a("STORE decompression")}},r.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,r){"use strict";var a=e("./utils"),n=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var a=0;a<8;a++)e=1&e?0xedb88320^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==a.getTypeOf(e)?function(e,t,r,a){var s=0+r;e^=-1;for(var i=0;i<s;i++)e=e>>>8^n[255&(e^t[i])];return -1^e}(0|t,e,e.length,0):function(e,t,r,a){var s=0+r;e^=-1;for(var i=0;i<s;i++)e=e>>>8^n[255&(e^t.charCodeAt(i))];return -1^e}(0|t,e,e.length,0):0}},{"./utils":32}],5:[function(e,t,r){"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(e,t,r){"use strict";var a=null;t.exports={Promise:"undefined"!=typeof Promise?Promise:e("lie")}},{lie:37}],7:[function(e,t,r){"use strict";var a="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,n=e("pako"),s=e("./utils"),i=e("./stream/GenericWorker"),o=a?"uint8array":"array";function l(e,t){i.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}r.magic="\b\0",s.inherits(l,i),l.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(s.transformTo(o,e.data),!1)},l.prototype.flush=function(){i.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new n[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},r.compressWorker=function(e){return new l("Deflate",e)},r.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,r){"use strict";function a(e,t){var r,a="";for(r=0;r<t;r++)a+=String.fromCharCode(255&e),e>>>=8;return a}function n(e,t,r,n,i,h){var u,d,f,p,m=e.file,g=e.compression,b=h!==o.utf8encode,y=s.transformTo("string",h(m.name)),v=s.transformTo("string",o.utf8encode(m.name)),k=m.comment,_=s.transformTo("string",h(k)),w=s.transformTo("string",o.utf8encode(k)),S=v.length!==m.name.length,x=w.length!==k.length,C="",E="",A="",P=m.dir,N=m.date,T={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(T.crc32=e.crc32,T.compressedSize=e.compressedSize,T.uncompressedSize=e.uncompressedSize);var z=0;t&&(z|=8),!b&&(S||x)&&(z|=2048);var B=0,R=0;P&&(B|=16),"UNIX"===i?(R=798,B|=(u=m.unixPermissions,d=u,u||(d=P?16893:33204),(65535&d)<<16)):(R=20,B|=63&(m.dosPermissions||0)),f=(N.getUTCHours()<<6|N.getUTCMinutes())<<5|N.getUTCSeconds()/2,p=(N.getUTCFullYear()-1980<<4|N.getUTCMonth()+1)<<5|N.getUTCDate(),S&&(E=a(1,1)+a(l(y),4)+v,C+="up"+a(E.length,2)+E),x&&(A=a(1,1)+a(l(_),4)+w,C+="uc"+a(A.length,2)+A);var M="";return M+="\n\0",M+=a(z,2),M+=g.magic,M+=a(f,2),M+=a(p,2),M+=a(T.crc32,4),M+=a(T.compressedSize,4),M+=a(T.uncompressedSize,4),M+=a(y.length,2),M+=a(C.length,2),{fileRecord:c.LOCAL_FILE_HEADER+M+y+C,dirRecord:c.CENTRAL_FILE_HEADER+a(R,2)+M+a(_.length,2)+"\0\0\0\0"+a(B,4)+a(n,4)+y+C+_}}var s=e("../utils"),i=e("../stream/GenericWorker"),o=e("../utf8"),l=e("../crc32"),c=e("../signature");function h(e,t,r,a){i.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=a,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(h,i),h.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,a=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,i.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-a-1))/r:100}}))},h.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=n(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},h.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=n(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:c.DATA_DESCRIPTOR+a(e.crc32,4)+a(e.compressedSize,4)+a(e.uncompressedSize,4),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},h.prototype.flush=function(){for(var e,t,r,n,i=this.bytesWritten,o=0;o<this.dirRecords.length;o++)this.push({data:this.dirRecords[o],meta:{percent:100}});var l=this.bytesWritten-i,h=(e=this.dirRecords.length,t=this.zipComment,r=this.encodeFileName,n=s.transformTo("string",r(t)),c.CENTRAL_DIRECTORY_END+"\0\0\0\0"+a(e,2)+a(e,2)+a(l,4)+a(i,4)+a(n.length,2)+n);this.push({data:h,meta:{percent:100}})},h.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},h.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",function(e){t.processChunk(e)}),e.on("end",function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()}),e.on("error",function(e){t.error(e)}),this},h.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},h.prototype.error=function(e){var t=this._sources;if(!i.prototype.error.call(this,e))return!1;for(var r=0;r<t.length;r++)try{t[r].error(e)}catch(e){}return!0},h.prototype.lock=function(){i.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},t.exports=h},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,r){"use strict";var a=e("../compressions"),n=e("./ZipFileWorker");r.generateWorker=function(e,t,r){var s=new n(t.streamFiles,r,t.platform,t.encodeFileName),i=0;try{e.forEach(function(e,r){i++;var n=function(e,t){var r=e||t,n=a[r];if(!n)throw Error(r+" is not a valid compression method !");return n}(r.options.compression,t.compression),o=r.options.compressionOptions||t.compressionOptions||{},l=r.dir,c=r.date;r._compressWorker(n,o).withStreamInfo("file",{name:e,dir:l,date:c,comment:r.comment||"",unixPermissions:r.unixPermissions,dosPermissions:r.dosPermissions}).pipe(s)}),s.entriesCount=i}catch(e){s.error(e)}return s}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,r){"use strict";function a(){if(!(this instanceof a))return new a;if(arguments.length)throw 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 e=new a;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}(a.prototype=e("./object")).loadAsync=e("./load"),a.support=e("./support"),a.defaults=e("./defaults"),a.version="3.10.1",a.loadAsync=function(e,t){return(new a).loadAsync(e,t)},a.external=e("./external"),t.exports=a},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t,r){"use strict";var a=e("./utils"),n=e("./external"),s=e("./utf8"),i=e("./zipEntries"),o=e("./stream/Crc32Probe"),l=e("./nodejsUtils");t.exports=function(e,t){var r=this;return t=a.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:s.utf8decode}),l.isNode&&l.isStream(e)?n.Promise.reject(Error("JSZip can't accept a stream when loading a zip file.")):a.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then(function(e){var r=new i(t);return r.load(e),r}).then(function(e){var r=[n.Promise.resolve(e)],a=e.files;if(t.checkCRC32)for(var s=0;s<a.length;s++)r.push(function(e){return new n.Promise(function(t,r){var a=e.decompressed.getContentWorker().pipe(new o);a.on("error",function(e){r(e)}).on("end",function(){a.streamInfo.crc32!==e.decompressed.crc32?r(Error("Corrupted zip : CRC32 mismatch")):t()}).resume()})}(a[s]));return n.Promise.all(r)}).then(function(e){for(var n=e.shift(),s=n.files,i=0;i<s.length;i++){var o=s[i],l=o.fileNameStr,c=a.resolve(o.fileNameStr);r.file(c,o.decompressed,{binary:!0,optimizedBinaryString:!0,date:o.date,dir:o.dir,comment:o.fileCommentStr.length?o.fileCommentStr:null,unixPermissions:o.unixPermissions,dosPermissions:o.dosPermissions,createFolders:t.createFolders}),o.dir||(r.file(c).unsafeOriginalName=l)}return n.zipComment.length&&(r.comment=n.zipComment),r})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t,r){"use strict";var a=e("../utils"),n=e("../stream/GenericWorker");function s(e,t){n.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}a.inherits(s,n),s.prototype._bindStream=function(e){var t=this;(this._stream=e).pause(),e.on("data",function(e){t.push({data:e,meta:{percent:0}})}).on("error",function(e){t.isPaused?this.generatedError=e:t.error(e)}).on("end",function(){t.isPaused?t._upstreamEnded=!0:t.end()})},s.prototype.pause=function(){return!!n.prototype.pause.call(this)&&(this._stream.pause(),!0)},s.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=s},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t,r){"use strict";var a=e("readable-stream").Readable;function n(e,t,r){a.call(this,t),this._helper=e;var n=this;e.on("data",function(e,t){n.push(e)||n._helper.pause(),r&&r(t)}).on("error",function(e){n.emit("error",e)}).on("end",function(){n.push(null)})}e("../utils").inherits(n,a),n.prototype._read=function(){this._helper.resume()},t.exports=n},{"../utils":32,"readable-stream":16}],14:[function(e,t,r){"use strict";t.exports={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if("number"==typeof e)throw Error('The "data" argument must not be a number');return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}}},{}],15:[function(e,t,r){"use strict";function a(e,t,r){var a,n=s.getTypeOf(t),o=s.extend(r||{},l);o.date=o.date||new Date,null!==o.compression&&(o.compression=o.compression.toUpperCase()),"string"==typeof o.unixPermissions&&(o.unixPermissions=parseInt(o.unixPermissions,8)),o.unixPermissions&&16384&o.unixPermissions&&(o.dir=!0),o.dosPermissions&&16&o.dosPermissions&&(o.dir=!0),o.dir&&(e=m(e)),o.createFolders&&(a=p(e))&&g.call(this,a,!0);var u="string"===n&&!1===o.binary&&!1===o.base64;r&&void 0!==r.binary||(o.binary=!u),(t instanceof c&&0===t.uncompressedSize||o.dir||!t||0===t.length)&&(o.base64=!1,o.binary=!0,t="",o.compression="STORE",n="string");var b=null;b=t instanceof c||t instanceof i?t:d.isNode&&d.isStream(t)?new f(e,t):s.prepareContent(e,t,o.binary,o.optimizedBinaryString,o.base64);var y=new h(e,b,o);this.files[e]=y}var n=e("./utf8"),s=e("./utils"),i=e("./stream/GenericWorker"),o=e("./stream/StreamHelper"),l=e("./defaults"),c=e("./compressedObject"),h=e("./zipObject"),u=e("./generate"),d=e("./nodejsUtils"),f=e("./nodejs/NodejsStreamInputAdapter"),p=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return 0<t?e.substring(0,t):""},m=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},g=function(e,t){return t=void 0!==t?t:l.createFolders,e=m(e),this.files[e]||a.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function b(e){return"[object RegExp]"===Object.prototype.toString.call(e)}t.exports={load:function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,r,a;for(t in this.files)a=this.files[t],(r=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(r,a)},filter:function(e){var t=[];return this.forEach(function(r,a){e(r,a)&&t.push(a)}),t},file:function(e,t,r){if(1!=arguments.length)return e=this.root+e,a.call(this,e,t,r),this;if(b(e)){var n=e;return this.filter(function(e,t){return!t.dir&&n.test(e)})}var s=this.files[this.root+e];return s&&!s.dir?s:null},folder:function(e){if(!e)return this;if(b(e))return this.filter(function(t,r){return r.dir&&e.test(t)});var t=this.root+e,r=g.call(this,t),a=this.clone();return a.root=r.name,a},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var r=this.filter(function(t,r){return r.name.slice(0,e.length)===e}),a=0;a<r.length;a++)delete this.files[r[a].name];return this},generate:function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,r={};try{if((r=s.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:n.utf8encode})).type=r.type.toLowerCase(),r.compression=r.compression.toUpperCase(),"binarystring"===r.type&&(r.type="string"),!r.type)throw Error("No output type specified.");s.checkSupport(r.type),"darwin"!==r.platform&&"freebsd"!==r.platform&&"linux"!==r.platform&&"sunos"!==r.platform||(r.platform="UNIX"),"win32"===r.platform&&(r.platform="DOS");var a=r.comment||this.comment||"";t=u.generateWorker(this,r,a)}catch(e){(t=new i("error")).error(e)}return new o(t,r.type||"string",r.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}}},{"./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(e,t,r){"use strict";t.exports=e("stream")},{stream:void 0}],17:[function(e,t,r){"use strict";var a=e("./DataReader");function n(e){a.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}e("../utils").inherits(n,a),n.prototype.byteAt=function(e){return this.data[this.zero+e]},n.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),r=e.charCodeAt(1),a=e.charCodeAt(2),n=e.charCodeAt(3),s=this.length-4;0<=s;--s)if(this.data[s]===t&&this.data[s+1]===r&&this.data[s+2]===a&&this.data[s+3]===n)return s-this.zero;return -1},n.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),r=e.charCodeAt(1),a=e.charCodeAt(2),n=e.charCodeAt(3),s=this.readData(4);return t===s[0]&&r===s[1]&&a===s[2]&&n===s[3]},n.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=n},{"../utils":32,"./DataReader":18}],18:[function(e,t,r){"use strict";var a=e("../utils");function n(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}n.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(){},readInt:function(e){var t,r=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return a.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=n},{"../utils":32}],19:[function(e,t,r){"use strict";var a=e("./Uint8ArrayReader");function n(e){a.call(this,e)}e("../utils").inherits(n,a),n.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=n},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,r){"use strict";var a=e("./DataReader");function n(e){a.call(this,e)}e("../utils").inherits(n,a),n.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},n.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},n.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},n.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=n},{"../utils":32,"./DataReader":18}],21:[function(e,t,r){"use strict";var a=e("./ArrayReader");function n(e){a.call(this,e)}e("../utils").inherits(n,a),n.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=n},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,r){"use strict";var a=e("../utils"),n=e("../support"),s=e("./ArrayReader"),i=e("./StringReader"),o=e("./NodeBufferReader"),l=e("./Uint8ArrayReader");t.exports=function(e){var t=a.getTypeOf(e);return a.checkSupport(t),"string"!==t||n.uint8array?"nodebuffer"===t?new o(e):n.uint8array?new l(a.transformTo("uint8array",e)):new s(a.transformTo("array",e)):new i(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,r){"use strict";r.LOCAL_FILE_HEADER="PK\x03\x04",r.CENTRAL_FILE_HEADER="PK\x01\x02",r.CENTRAL_DIRECTORY_END="PK\x05\x06",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x06\x07",r.ZIP64_CENTRAL_DIRECTORY_END="PK\x06\x06",r.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(e,t,r){"use strict";var a=e("./GenericWorker"),n=e("../utils");function s(e){a.call(this,"ConvertWorker to "+e),this.destType=e}n.inherits(s,a),s.prototype.processChunk=function(e){this.push({data:n.transformTo(this.destType,e.data),meta:e.meta})},t.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,r){"use strict";var a=e("./GenericWorker"),n=e("../crc32");function s(){a.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(s,a),s.prototype.processChunk=function(e){this.streamInfo.crc32=n(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,r){"use strict";var a=e("../utils"),n=e("./GenericWorker");function s(e){n.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}a.inherits(s,n),s.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}n.prototype.processChunk.call(this,e)},t.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,r){"use strict";var a=e("../utils"),n=e("./GenericWorker");function s(e){n.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=a.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}a.inherits(s,n),s.prototype.cleanUp=function(){n.prototype.cleanUp.call(this),this.data=null},s.prototype.resume=function(){return!!n.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,a.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(a.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,r){"use strict";function a(e){this.name=e||"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}a.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r<this._listeners[e].length;r++)this._listeners[e][r].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",function(e){t.processChunk(e)}),e.on("end",function(){t.end()}),e.on("error",function(e){t.error(e)}),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 e=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}},t.exports=a},{}],29:[function(e,t,r){"use strict";var a=e("../utils"),n=e("./ConvertWorker"),s=e("./GenericWorker"),i=e("../base64"),o=e("../support"),l=e("../external"),c=null;if(o.nodestream)try{c=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function h(e,t,r){var i=t;switch(t){case"blob":case"arraybuffer":i="uint8array";break;case"base64":i="string"}try{this._internalType=i,this._outputType=t,this._mimeType=r,a.checkSupport(i),this._worker=e.pipe(new n(i)),e.lock()}catch(e){this._worker=new s("error"),this._worker.error(e)}}h.prototype={accumulate:function(e){var t;return t=this,new l.Promise(function(r,n){var s=[],o=t._internalType,l=t._outputType,c=t._mimeType;t.on("data",function(t,r){s.push(t),e&&e(r)}).on("error",function(e){s=[],n(e)}).on("end",function(){try{var e=function(e,t,r){switch(e){case"blob":return a.newBlob(a.transformTo("arraybuffer",t),r);case"base64":return i.encode(t);default:return a.transformTo(e,t)}}(l,function(e,t){var r,a=0,n=null,s=0;for(r=0;r<t.length;r++)s+=t[r].length;switch(e){case"string":return t.join("");case"array":return Array.prototype.concat.apply([],t);case"uint8array":for(n=new Uint8Array(s),r=0;r<t.length;r++)n.set(t[r],a),a+=t[r].length;return n;case"nodebuffer":return Buffer.concat(t);default:throw Error("concat : unsupported type '"+e+"'")}}(o,s),c);r(e)}catch(e){n(e)}s=[]}).resume()})},on:function(e,t){var r=this;return"data"===e?this._worker.on(e,function(e){t.call(r,e.data,e.meta)}):this._worker.on(e,function(){a.delay(t,arguments,r)}),this},resume:function(){return a.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(a.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw Error(this._outputType+" is not supported by this method");return new c(this,{objectMode:"nodebuffer"!==this._outputType},e)}},t.exports=h},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,t,r){"use strict";if(r.base64=!0,r.array=!0,r.string=!0,r.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,r.nodebuffer="undefined"!=typeof Buffer,r.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)r.blob=!1;else{var a=new ArrayBuffer(0);try{r.blob=0===new Blob([a],{type:"application/zip"}).size}catch(e){try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);n.append(a),r.blob=0===n.getBlob("application/zip").size}catch(e){r.blob=!1}}}try{r.nodestream=!!e("readable-stream").Readable}catch(e){r.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,r){"use strict";for(var a=e("./utils"),n=e("./support"),s=e("./nodejsUtils"),i=e("./stream/GenericWorker"),o=Array(256),l=0;l<256;l++)o[l]=252<=l?6:248<=l?5:240<=l?4:224<=l?3:192<=l?2:1;function c(){i.call(this,"utf-8 decode"),this.leftOver=null}function h(){i.call(this,"utf-8 encode")}o[254]=o[254]=1,r.utf8encode=function(e){return n.nodebuffer?s.newBufferFrom(e,"utf-8"):function(e){var t,r,a,s,i,o=e.length,l=0;for(s=0;s<o;s++)55296==(64512&(r=e.charCodeAt(s)))&&s+1<o&&56320==(64512&(a=e.charCodeAt(s+1)))&&(r=65536+(r-55296<<10)+(a-56320),s++),l+=r<128?1:r<2048?2:r<65536?3:4;for(t=n.uint8array?new Uint8Array(l):Array(l),s=i=0;i<l;s++)55296==(64512&(r=e.charCodeAt(s)))&&s+1<o&&56320==(64512&(a=e.charCodeAt(s+1)))&&(r=65536+(r-55296<<10)+(a-56320),s++),r<128?t[i++]=r:(r<2048?t[i++]=192|r>>>6:(r<65536?t[i++]=224|r>>>12:(t[i++]=240|r>>>18,t[i++]=128|r>>>12&63),t[i++]=128|r>>>6&63),t[i++]=128|63&r);return t}(e)},r.utf8decode=function(e){return n.nodebuffer?a.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,r,n,s,i=e.length,l=Array(2*i);for(t=r=0;t<i;)if((n=e[t++])<128)l[r++]=n;else if(4<(s=o[n]))l[r++]=65533,t+=s-1;else{for(n&=2===s?31:3===s?15:7;1<s&&t<i;)n=n<<6|63&e[t++],s--;1<s?l[r++]=65533:n<65536?l[r++]=n:(n-=65536,l[r++]=55296|n>>10&1023,l[r++]=56320|1023&n)}return l.length!==r&&(l.subarray?l=l.subarray(0,r):l.length=r),a.applyFromCharCode(l)}(e=a.transformTo(n.uint8array?"uint8array":"array",e))},a.inherits(c,i),c.prototype.processChunk=function(e){var t=a.transformTo(n.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(n.uint8array){var s=t;(t=new Uint8Array(s.length+this.leftOver.length)).set(this.leftOver,0),t.set(s,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var i=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0||0===r?t:r+o[e[r]]>t?r:t}(t),l=t;i!==t.length&&(n.uint8array?(l=t.subarray(0,i),this.leftOver=t.subarray(i,t.length)):(l=t.slice(0,i),this.leftOver=t.slice(i,t.length))),this.push({data:r.utf8decode(l),meta:e.meta})},c.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=c,a.inherits(h,i),h.prototype.processChunk=function(e){this.push({data:r.utf8encode(e.data),meta:e.meta})},r.Utf8EncodeWorker=h},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,r){"use strict";var a=e("./support"),n=e("./base64"),s=e("./nodejsUtils"),i=e("./external");function o(e){return e}function l(e,t){for(var r=0;r<e.length;++r)t[r]=255&e.charCodeAt(r);return t}e("setimmediate"),r.newBlob=function(e,t){r.checkSupport("blob");try{return new Blob([e],{type:t})}catch(r){try{var a=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return a.append(e),a.getBlob(t)}catch(e){throw Error("Bug : can't construct the Blob.")}}};var c={stringifyByChunk:function(e,t,r){var a=[],n=0,s=e.length;if(s<=r)return String.fromCharCode.apply(null,e);for(;n<s;)"array"===t||"nodebuffer"===t?a.push(String.fromCharCode.apply(null,e.slice(n,Math.min(n+r,s)))):a.push(String.fromCharCode.apply(null,e.subarray(n,Math.min(n+r,s)))),n+=r;return a.join("")},stringifyByChar:function(e){for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},applyCanBeUsed:{uint8array:function(){try{return a.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return a.nodebuffer&&1===String.fromCharCode.apply(null,s.allocBuffer(1)).length}catch(e){return!1}}()}};function h(e){var t=65536,a=r.getTypeOf(e),n=!0;if("uint8array"===a?n=c.applyCanBeUsed.uint8array:"nodebuffer"===a&&(n=c.applyCanBeUsed.nodebuffer),n)for(;1<t;)try{return c.stringifyByChunk(e,a,t)}catch(e){t=Math.floor(t/2)}return c.stringifyByChar(e)}function u(e,t){for(var r=0;r<e.length;r++)t[r]=e[r];return t}r.applyFromCharCode=h;var d={};d.string={string:o,array:function(e){return l(e,Array(e.length))},arraybuffer:function(e){return d.string.uint8array(e).buffer},uint8array:function(e){return l(e,new Uint8Array(e.length))},nodebuffer:function(e){return l(e,s.allocBuffer(e.length))}},d.array={string:h,array:o,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return s.newBufferFrom(e)}},d.arraybuffer={string:function(e){return h(new Uint8Array(e))},array:function(e){return u(new Uint8Array(e),Array(e.byteLength))},arraybuffer:o,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return s.newBufferFrom(new Uint8Array(e))}},d.uint8array={string:h,array:function(e){return u(e,Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:o,nodebuffer:function(e){return s.newBufferFrom(e)}},d.nodebuffer={string:h,array:function(e){return u(e,Array(e.length))},arraybuffer:function(e){return d.nodebuffer.uint8array(e).buffer},uint8array:function(e){return u(e,new Uint8Array(e.length))},nodebuffer:o},r.transformTo=function(e,t){return(t=t||"",e)?(r.checkSupport(e),d[r.getTypeOf(t)][e](t)):t},r.resolve=function(e){for(var t=e.split("/"),r=[],a=0;a<t.length;a++){var n=t[a];"."===n||""===n&&0!==a&&a!==t.length-1||(".."===n?r.pop():r.push(n))}return r.join("/")},r.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":a.nodebuffer&&s.isBuffer(e)?"nodebuffer":a.uint8array&&e instanceof Uint8Array?"uint8array":a.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},r.checkSupport=function(e){if(!a[e.toLowerCase()])throw Error(e+" is not supported by this platform")},r.MAX_VALUE_16BITS=65535,r.MAX_VALUE_32BITS=-1,r.pretty=function(e){var t,r,a="";for(r=0;r<(e||"").length;r++)a+="\\x"+((t=e.charCodeAt(r))<16?"0":"")+t.toString(16).toUpperCase();return a},r.delay=function(e,t,r){setImmediate(function(){e.apply(r||null,t||[])})},r.inherits=function(e,t){function r(){}r.prototype=t.prototype,e.prototype=new r},r.extend=function(){var e,t,r={};for(e=0;e<arguments.length;e++)for(t in arguments[e])Object.prototype.hasOwnProperty.call(arguments[e],t)&&void 0===r[t]&&(r[t]=arguments[e][t]);return r},r.prepareContent=function(e,t,s,o,c){return i.Promise.resolve(t).then(function(e){return a.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(e)))&&"undefined"!=typeof FileReader?new i.Promise(function(t,r){var a=new FileReader;a.onload=function(e){t(e.target.result)},a.onerror=function(e){r(e.target.error)},a.readAsArrayBuffer(e)}):e}).then(function(t){var h,u=r.getTypeOf(t);return u?("arraybuffer"===u?t=r.transformTo("uint8array",t):"string"===u&&(c?t=n.decode(t):s&&!0!==o&&(t=l(h=t,a.uint8array?new Uint8Array(h.length):Array(h.length)))),t):i.Promise.reject(Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(e,t,r){"use strict";var a=e("./reader/readerFor"),n=e("./utils"),s=e("./signature"),i=e("./zipEntry"),o=e("./support");function l(e){this.files=[],this.loadOptions=e}l.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw Error("Corrupted zip or bug: unexpected signature ("+n.pretty(t)+", expected "+n.pretty(e)+")")}},isSignature:function(e,t){var r=this.reader.index;this.reader.setIndex(e);var a=this.reader.readString(4)===t;return this.reader.setIndex(r),a},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 e=this.reader.readData(this.zipCommentLength),t=o.uint8array?"uint8array":"array",r=n.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(r)},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 e,t,r,a=this.zip64EndOfCentralSize-44;0<a;)e=this.reader.readInt(2),t=this.reader.readInt(4),r=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:r}},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 Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER);)(e=new i({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(e<0)throw this.isSignature(0,s.LOCAL_FILE_HEADER)?Error("Corrupted zip: can't find end of central directory"):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(e);var t=e;if(this.checkSignature(s.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===n.MAX_VALUE_16BITS||this.diskWithCentralDirStart===n.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===n.MAX_VALUE_16BITS||this.centralDirRecords===n.MAX_VALUE_16BITS||this.centralDirSize===n.MAX_VALUE_32BITS||this.centralDirOffset===n.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,s.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(s.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var r=this.centralDirOffset+this.centralDirSize;this.zip64&&(r+=20,r+=12+this.zip64EndOfCentralSize);var a=t-r;if(0<a)this.isSignature(t,s.CENTRAL_FILE_HEADER)||(this.reader.zero=a);else if(a<0)throw Error("Corrupted zip: missing "+Math.abs(a)+" bytes.")},prepareReader:function(e){this.reader=a(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=l},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(e,t,r){"use strict";var a=e("./reader/readerFor"),n=e("./utils"),s=e("./compressedObject"),i=e("./crc32"),o=e("./utf8"),l=e("./compressions"),c=e("./support");function h(e,t){this.options=e,this.loadOptions=t}h.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,r;if(e.skip(22),this.fileNameLength=e.readInt(2),r=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(r),-1===this.compressedSize||-1===this.uncompressedSize)throw Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in l)if(Object.prototype.hasOwnProperty.call(l,t)&&l[t].magic===e)return l[t];return null}(this.compressionMethod)))throw Error("Corrupted zip : compression "+n.pretty(this.compressionMethod)+" unknown (inner file : "+n.transformTo("string",this.fileName)+")");this.decompressed=new s(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=a(this.extraFields[1].value);this.uncompressedSize===n.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===n.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===n.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===n.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,r,a,n=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4<n;)t=e.readInt(2),r=e.readInt(2),a=e.readData(r),this.extraFields[t]={id:t,length:r,value:a};e.setIndex(n)},handleUTF8:function(){var e=c.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=o.utf8decode(this.fileName),this.fileCommentStr=o.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var r=n.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var a=this.findExtraFieldUnicodeComment();if(null!==a)this.fileCommentStr=a;else{var s=n.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(s)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=a(e.value);return 1!==t.readInt(1)||i(this.fileName)!==t.readInt(4)?null:o.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=a(e.value);return 1!==t.readInt(1)||i(this.fileComment)!==t.readInt(4)?null:o.utf8decode(t.readData(e.length-5))}return null}},t.exports=h},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t,r){"use strict";function a(e,t,r){this.name=e,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=t,this._dataBinary=r.binary,this.options={compression:r.compression,compressionOptions:r.compressionOptions}}var n=e("./stream/StreamHelper"),s=e("./stream/DataWorker"),i=e("./utf8"),o=e("./compressedObject"),l=e("./stream/GenericWorker");a.prototype={internalStream:function(e){var t=null,r="string";try{if(!e)throw Error("No output type specified.");var a="string"===(r=e.toLowerCase())||"text"===r;"binarystring"!==r&&"text"!==r||(r="string"),t=this._decompressWorker();var s=!this._dataBinary;s&&!a&&(t=t.pipe(new i.Utf8EncodeWorker)),!s&&a&&(t=t.pipe(new i.Utf8DecodeWorker))}catch(e){(t=new l("error")).error(e)}return new n(t,r,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof o&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var r=this._decompressWorker();return this._dataBinary||(r=r.pipe(new i.Utf8EncodeWorker)),o.createWorkerFrom(r,e,t)},_decompressWorker:function(){return this._data instanceof o?this._data.getContentWorker():this._data instanceof l?this._data:new s(this._data)}};for(var c=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],h=function(){throw Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},u=0;u<c.length;u++)a.prototype[c[u]]=h;t.exports=a},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,t,a){(function(e){"use strict";var r,a,n=e.MutationObserver||e.WebKitMutationObserver;if(n){var s=0,i=new n(h),o=e.document.createTextNode("");i.observe(o,{characterData:!0}),r=function(){o.data=s=++s%2}}else if(e.setImmediate||void 0===e.MessageChannel)r="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){h(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(h,0)};else{var l=new e.MessageChannel;l.port1.onmessage=h,r=function(){l.port2.postMessage(0)}}var c=[];function h(){var e,t;a=!0;for(var r=c.length;r;){for(t=c,c=[],e=-1;++e<r;)t[e]();r=c.length}a=!1}t.exports=function(e){1!==c.push(e)||a||r()}}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(e,t,r){"use strict";var a=e("immediate");function n(){}var s={},i=["REJECTED"],o=["FULFILLED"],l=["PENDING"];function c(e){if("function"!=typeof e)throw TypeError("resolver must be a function");this.state=l,this.queue=[],this.outcome=void 0,e!==n&&f(this,e)}function h(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function u(e,t,r){a(function(){var a;try{a=t(r)}catch(t){return s.reject(e,t)}a===e?s.reject(e,TypeError("Cannot resolve promise with itself")):s.resolve(e,a)})}function d(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function f(e,t){var r=!1;function a(t){r||(r=!0,s.reject(e,t))}function n(t){r||(r=!0,s.resolve(e,t))}var i=p(function(){t(n,a)});"error"===i.status&&a(i.value)}function p(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}(t.exports=c).prototype.finally=function(e){if("function"!=typeof e)return this;var t=this.constructor;return this.then(function(r){return t.resolve(e()).then(function(){return r})},function(r){return t.resolve(e()).then(function(){throw r})})},c.prototype.catch=function(e){return this.then(null,e)},c.prototype.then=function(e,t){if("function"!=typeof e&&this.state===o||"function"!=typeof t&&this.state===i)return this;var r=new this.constructor(n);return this.state!==l?u(r,this.state===o?e:t,this.outcome):this.queue.push(new h(r,e,t)),r},h.prototype.callFulfilled=function(e){s.resolve(this.promise,e)},h.prototype.otherCallFulfilled=function(e){u(this.promise,this.onFulfilled,e)},h.prototype.callRejected=function(e){s.reject(this.promise,e)},h.prototype.otherCallRejected=function(e){u(this.promise,this.onRejected,e)},s.resolve=function(e,t){var r=p(d,t);if("error"===r.status)return s.reject(e,r.value);var a=r.value;if(a)f(e,a);else{e.state=o,e.outcome=t;for(var n=-1,i=e.queue.length;++n<i;)e.queue[n].callFulfilled(t)}return e},s.reject=function(e,t){e.state=i,e.outcome=t;for(var r=-1,a=e.queue.length;++r<a;)e.queue[r].callRejected(t);return e},c.resolve=function(e){return e instanceof this?e:s.resolve(new this(n),e)},c.reject=function(e){var t=new this(n);return s.reject(t,e)},c.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(TypeError("must be an array"));var r=e.length,a=!1;if(!r)return this.resolve([]);for(var i=Array(r),o=0,l=-1,c=new this(n);++l<r;)!function(e,n){t.resolve(e).then(function(e){i[n]=e,++o!==r||a||(a=!0,s.resolve(c,i))},function(e){a||(a=!0,s.reject(c,e))})}(e[l],l);return c},c.race=function(e){if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(TypeError("must be an array"));var t,r=e.length,a=!1;if(!r)return this.resolve([]);for(var i=-1,o=new this(n);++i<r;)t=e[i],this.resolve(t).then(function(e){a||(a=!0,s.resolve(o,e))},function(e){a||(a=!0,s.reject(o,e))});return o}},{immediate:36}],38:[function(e,t,r){"use strict";var a={};(0,e("./lib/utils/common").assign)(a,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=a},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,r){"use strict";var a=e("./zlib/deflate"),n=e("./utils/common"),s=e("./utils/strings"),i=e("./zlib/messages"),o=e("./zlib/zstream"),l=Object.prototype.toString;function c(e){if(!(this instanceof c))return new c(e);this.options=n.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t,r=this.options;r.raw&&0<r.windowBits?r.windowBits=-r.windowBits:r.gzip&&0<r.windowBits&&r.windowBits<16&&(r.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var h=a.deflateInit2(this.strm,r.level,r.method,r.windowBits,r.memLevel,r.strategy);if(0!==h)throw Error(i[h]);if(r.header&&a.deflateSetHeader(this.strm,r.header),r.dictionary){if(t="string"==typeof r.dictionary?s.string2buf(r.dictionary):"[object ArrayBuffer]"===l.call(r.dictionary)?new Uint8Array(r.dictionary):r.dictionary,0!==(h=a.deflateSetDictionary(this.strm,t)))throw Error(i[h]);this._dict_set=!0}}function h(e,t){var r=new c(t);if(r.push(e,!0),r.err)throw r.msg||i[r.err];return r.result}c.prototype.push=function(e,t){var r,i,o=this.strm,c=this.options.chunkSize;if(this.ended)return!1;i=t===~~t?t:4*(!0===t),"string"==typeof e?o.input=s.string2buf(e):"[object ArrayBuffer]"===l.call(e)?o.input=new Uint8Array(e):o.input=e,o.next_in=0,o.avail_in=o.input.length;do{if(0===o.avail_out&&(o.output=new n.Buf8(c),o.next_out=0,o.avail_out=c),1!==(r=a.deflate(o,i))&&0!==r)return this.onEnd(r),this.ended=!0,!1;0!==o.avail_out&&(0!==o.avail_in||4!==i&&2!==i)||("string"===this.options.to?this.onData(s.buf2binstring(n.shrinkBuf(o.output,o.next_out))):this.onData(n.shrinkBuf(o.output,o.next_out)))}while((0<o.avail_in||0===o.avail_out)&&1!==r);return 4===i?(r=a.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,0===r):2!==i||(this.onEnd(0),o.avail_out=0,!0)},c.prototype.onData=function(e){this.chunks.push(e)},c.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Deflate=c,r.deflate=h,r.deflateRaw=function(e,t){return(t=t||{}).raw=!0,h(e,t)},r.gzip=function(e,t){return(t=t||{}).gzip=!0,h(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,r){"use strict";var a=e("./zlib/inflate"),n=e("./utils/common"),s=e("./utils/strings"),i=e("./zlib/constants"),o=e("./zlib/messages"),l=e("./zlib/zstream"),c=e("./zlib/gzheader"),h=Object.prototype.toString;function u(e){if(!(this instanceof u))return new u(e);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new l,this.strm.avail_out=0;var r=a.inflateInit2(this.strm,t.windowBits);if(r!==i.Z_OK)throw Error(o[r]);this.header=new c,a.inflateGetHeader(this.strm,this.header)}function d(e,t){var r=new u(t);if(r.push(e,!0),r.err)throw r.msg||o[r.err];return r.result}u.prototype.push=function(e,t){var r,o,l,c,u,d,f=this.strm,p=this.options.chunkSize,m=this.options.dictionary,g=!1;if(this.ended)return!1;o=t===~~t?t:!0===t?i.Z_FINISH:i.Z_NO_FLUSH,"string"==typeof e?f.input=s.binstring2buf(e):"[object ArrayBuffer]"===h.call(e)?f.input=new Uint8Array(e):f.input=e,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new n.Buf8(p),f.next_out=0,f.avail_out=p),(r=a.inflate(f,i.Z_NO_FLUSH))===i.Z_NEED_DICT&&m&&(d="string"==typeof m?s.string2buf(m):"[object ArrayBuffer]"===h.call(m)?new Uint8Array(m):m,r=a.inflateSetDictionary(this.strm,d)),r===i.Z_BUF_ERROR&&!0===g&&(r=i.Z_OK,g=!1),r!==i.Z_STREAM_END&&r!==i.Z_OK)return this.onEnd(r),this.ended=!0,!1;f.next_out&&(0!==f.avail_out&&r!==i.Z_STREAM_END&&(0!==f.avail_in||o!==i.Z_FINISH&&o!==i.Z_SYNC_FLUSH)||("string"===this.options.to?(l=s.utf8border(f.output,f.next_out),c=f.next_out-l,u=s.buf2string(f.output,l),f.next_out=c,f.avail_out=p-c,c&&n.arraySet(f.output,f.output,l,c,0),this.onData(u)):this.onData(n.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(g=!0)}while((0<f.avail_in||0===f.avail_out)&&r!==i.Z_STREAM_END);return r===i.Z_STREAM_END&&(o=i.Z_FINISH),o===i.Z_FINISH?(r=a.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===i.Z_OK):o!==i.Z_SYNC_FLUSH||(this.onEnd(i.Z_OK),f.avail_out=0,!0)},u.prototype.onData=function(e){this.chunks.push(e)},u.prototype.onEnd=function(e){e===i.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},r.Inflate=u,r.inflate=d,r.inflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},r.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(e,t,r){"use strict";var a="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;r.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw TypeError(r+"must be non-object");for(var a in r)r.hasOwnProperty(a)&&(e[a]=r[a])}}return e},r.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var n={arraySet:function(e,t,r,a,n){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+a),n);else for(var s=0;s<a;s++)e[n+s]=t[r+s]},flattenChunks:function(e){var t,r,a,n,s,i;for(t=a=0,r=e.length;t<r;t++)a+=e[t].length;for(i=new Uint8Array(a),t=n=0,r=e.length;t<r;t++)s=e[t],i.set(s,n),n+=s.length;return i}},s={arraySet:function(e,t,r,a,n){for(var s=0;s<a;s++)e[n+s]=t[r+s]},flattenChunks:function(e){return[].concat.apply([],e)}};r.setTyped=function(e){e?(r.Buf8=Uint8Array,r.Buf16=Uint16Array,r.Buf32=Int32Array,r.assign(r,n)):(r.Buf8=Array,r.Buf16=Array,r.Buf32=Array,r.assign(r,s))},r.setTyped(a)},{}],42:[function(e,t,r){"use strict";var a=e("./common"),n=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch(e){n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){s=!1}for(var i=new a.Buf8(256),o=0;o<256;o++)i[o]=252<=o?6:248<=o?5:240<=o?4:224<=o?3:192<=o?2:1;function l(e,t){if(t<65537&&(e.subarray&&s||!e.subarray&&n))return String.fromCharCode.apply(null,a.shrinkBuf(e,t));for(var r="",i=0;i<t;i++)r+=String.fromCharCode(e[i]);return r}i[254]=i[254]=1,r.string2buf=function(e){var t,r,n,s,i,o=e.length,l=0;for(s=0;s<o;s++)55296==(64512&(r=e.charCodeAt(s)))&&s+1<o&&56320==(64512&(n=e.charCodeAt(s+1)))&&(r=65536+(r-55296<<10)+(n-56320),s++),l+=r<128?1:r<2048?2:r<65536?3:4;for(t=new a.Buf8(l),s=i=0;i<l;s++)55296==(64512&(r=e.charCodeAt(s)))&&s+1<o&&56320==(64512&(n=e.charCodeAt(s+1)))&&(r=65536+(r-55296<<10)+(n-56320),s++),r<128?t[i++]=r:(r<2048?t[i++]=192|r>>>6:(r<65536?t[i++]=224|r>>>12:(t[i++]=240|r>>>18,t[i++]=128|r>>>12&63),t[i++]=128|r>>>6&63),t[i++]=128|63&r);return t},r.buf2binstring=function(e){return l(e,e.length)},r.binstring2buf=function(e){for(var t=new a.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t},r.buf2string=function(e,t){var r,a,n,s,o=t||e.length,c=Array(2*o);for(r=a=0;r<o;)if((n=e[r++])<128)c[a++]=n;else if(4<(s=i[n]))c[a++]=65533,r+=s-1;else{for(n&=2===s?31:3===s?15:7;1<s&&r<o;)n=n<<6|63&e[r++],s--;1<s?c[a++]=65533:n<65536?c[a++]=n:(n-=65536,c[a++]=55296|n>>10&1023,c[a++]=56320|1023&n)}return l(c,a)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0||0===r?t:r+i[e[r]]>t?r:t}},{"./common":41}],43:[function(e,t,r){"use strict";t.exports=function(e,t,r,a){for(var n=65535&e|0,s=e>>>16&65535|0,i=0;0!==r;){for(r-=i=2e3<r?2e3:r;s=s+(n=n+t[a++]|0)|0,--i;);n%=65521,s%=65521}return n|s<<16|0}},{}],44:[function(e,t,r){"use strict";t.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(e,t,r){"use strict";var a=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var a=0;a<8;a++)e=1&e?0xedb88320^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,n){var s=n+r;e^=-1;for(var i=n;i<s;i++)e=e>>>8^a[255&(e^t[i])];return -1^e}},{}],46:[function(e,t,r){"use strict";var a,n=e("../utils/common"),s=e("./trees"),i=e("./adler32"),o=e("./crc32"),l=e("./messages");function c(e,t){return e.msg=l[t],t}function h(e){return(e<<1)-9*(4<e)}function u(e){for(var t=e.length;0<=--t;)e[t]=0}function d(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(n.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function f(e,t){s._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,d(e.strm)}function p(e,t){e.pending_buf[e.pending++]=t}function m(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function g(e,t){var r,a,n=e.max_chain_length,s=e.strstart,i=e.prev_length,o=e.nice_match,l=e.strstart>e.w_size-262?e.strstart-(e.w_size-262):0,c=e.window,h=e.w_mask,u=e.prev,d=e.strstart+258,f=c[s+i-1],p=c[s+i];e.prev_length>=e.good_match&&(n>>=2),o>e.lookahead&&(o=e.lookahead);do if(c[(r=t)+i]===p&&c[r+i-1]===f&&c[r]===c[s]&&c[++r]===c[s+1]){s+=2,r++;do;while(c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&c[++s]===c[++r]&&s<d);if(a=258-(d-s),s=d-258,i<a){if(e.match_start=t,o<=(i=a))break;f=c[s+i-1],p=c[s+i]}}while((t=u[t&h])>l&&0!=--n);return i<=e.lookahead?i:e.lookahead}function b(e){var t,r,a,s,l,c,h,u,d,f,p=e.w_size;do{if(s=e.window_size-e.lookahead-e.strstart,e.strstart>=p+(p-262)){for(n.arraySet(e.window,e.window,p,p,0),e.match_start-=p,e.strstart-=p,e.block_start-=p,t=r=e.hash_size;a=e.head[--t],e.head[t]=p<=a?a-p:0,--r;);for(t=r=p;a=e.prev[--t],e.prev[t]=p<=a?a-p:0,--r;);s+=p}if(0===e.strm.avail_in)break;if(c=e.strm,h=e.window,u=e.strstart+e.lookahead,f=void 0,(d=s)<(f=c.avail_in)&&(f=d),r=0===f?0:(c.avail_in-=f,n.arraySet(h,c.input,c.next_in,f,u),1===c.state.wrap?c.adler=i(c.adler,h,f,u):2===c.state.wrap&&(c.adler=o(c.adler,h,f,u)),c.next_in+=f,c.total_in+=f,f),e.lookahead+=r,e.lookahead+e.insert>=3)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[l+3-1])&e.hash_mask,e.prev[l&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=l,l++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<262&&0!==e.strm.avail_in)}function y(e,t){for(var r,a;;){if(e.lookahead<262){if(b(e),e.lookahead<262&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-262&&(e.match_length=g(e,r)),e.match_length>=3)if(a=s._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else a=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(a&&(f(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(f(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(f(e,!1),0===e.strm.avail_out)?1:2}function v(e,t){for(var r,a,n;;){if(e.lookahead<262){if(b(e),e.lookahead<262&&0===t)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-262&&(e.match_length=g(e,r),e.match_length<=5&&(1===e.strategy||3===e.match_length&&4096<e.strstart-e.match_start)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){for(n=e.strstart+e.lookahead-3,a=s._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=n&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!=--e.prev_length;);if(e.match_available=0,e.match_length=2,e.strstart++,a&&(f(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((a=s._tr_tally(e,0,e.window[e.strstart-1]))&&f(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(a=s._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(f(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(f(e,!1),0===e.strm.avail_out)?1:2}function k(e,t,r,a,n){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=a,this.func=n}function _(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new n.Buf16(1146),this.dyn_dtree=new n.Buf16(122),this.bl_tree=new n.Buf16(78),u(this.dyn_ltree),u(this.dyn_dtree),u(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new n.Buf16(16),this.heap=new n.Buf16(573),u(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(573),u(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 w(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:113,e.adler=+(2!==t.wrap),t.last_flush=0,s._tr_init(t),0):c(e,-2)}function S(e){var t,r=w(e);return 0===r&&((t=e.state).window_size=2*t.w_size,u(t.head),t.max_lazy_match=a[t.level].max_lazy,t.good_match=a[t.level].good_length,t.nice_match=a[t.level].nice_length,t.max_chain_length=a[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),r}function x(e,t,r,a,s,i){if(!e)return -2;var o=1;if(-1===t&&(t=6),a<0?(o=0,a=-a):15<a&&(o=2,a-=16),s<1||9<s||8!==r||a<8||15<a||t<0||9<t||i<0||4<i)return c(e,-2);8===a&&(a=9);var l=new _;return(e.state=l).strm=e,l.wrap=o,l.gzhead=null,l.w_bits=a,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=s+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+3-1)/3),l.window=new n.Buf8(2*l.w_size),l.head=new n.Buf16(l.hash_size),l.prev=new n.Buf16(l.w_size),l.lit_bufsize=1<<s+6,l.pending_buf_size=4*l.lit_bufsize,l.pending_buf=new n.Buf8(l.pending_buf_size),l.d_buf=+l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=t,l.strategy=i,l.method=r,S(e)}a=[new k(0,0,0,0,function(e,t){var r=65535;for(65535>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(b(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var a=e.block_start+r;if((0===e.strstart||e.strstart>=a)&&(e.lookahead=e.strstart-a,e.strstart=a,f(e,!1),0===e.strm.avail_out)||e.strstart-e.block_start>=e.w_size-262&&(f(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(f(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(f(e,!1),e.strm.avail_out),1)}),new k(4,4,8,4,y),new k(4,5,16,8,y),new k(4,6,32,32,y),new k(4,4,16,16,v),new k(8,16,32,32,v),new k(8,16,128,128,v),new k(8,32,128,256,v),new k(32,128,258,1024,v),new k(32,258,258,4096,v)],r.deflateInit=function(e,t){return x(e,t,8,15,8,0)},r.deflateInit2=x,r.deflateReset=S,r.deflateResetKeep=w,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?-2:(e.state.gzhead=t,0):-2},r.deflate=function(e,t){var r,n,i,l;if(!e||!e.state||5<t||t<0)return e?c(e,-2):-2;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||666===n.status&&4!==t)return c(e,0===e.avail_out?-5:-2);if(n.strm=e,r=n.last_flush,n.last_flush=t,42===n.status)if(2===n.wrap)e.adler=0,p(n,31),p(n,139),p(n,8),n.gzhead?(p(n,+!!n.gzhead.text+2*!!n.gzhead.hcrc+4*!!n.gzhead.extra+8*!!n.gzhead.name+16*!!n.gzhead.comment),p(n,255&n.gzhead.time),p(n,n.gzhead.time>>8&255),p(n,n.gzhead.time>>16&255),p(n,n.gzhead.time>>24&255),p(n,9===n.level?2:4*(2<=n.strategy||n.level<2)),p(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(p(n,255&n.gzhead.extra.length),p(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=o(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=69):(p(n,0),p(n,0),p(n,0),p(n,0),p(n,0),p(n,9===n.level?2:4*(2<=n.strategy||n.level<2)),p(n,3),n.status=113);else{var g=8+(n.w_bits-8<<4)<<8;g|=(2<=n.strategy||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(g|=32),g+=31-g%31,n.status=113,m(n,g),0!==n.strstart&&(m(n,e.adler>>>16),m(n,65535&e.adler)),e.adler=1}if(69===n.status)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=o(e.adler,n.pending_buf,n.pending-i,i)),d(e),i=n.pending,n.pending!==n.pending_buf_size));)p(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=o(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=73)}else n.status=73;if(73===n.status)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=o(e.adler,n.pending_buf,n.pending-i,i)),d(e),i=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindex<n.gzhead.name.length?255&n.gzhead.name.charCodeAt(n.gzindex++):0,p(n,l)}while(0!==l);n.gzhead.hcrc&&n.pending>i&&(e.adler=o(e.adler,n.pending_buf,n.pending-i,i)),0===l&&(n.gzindex=0,n.status=91)}else n.status=91;if(91===n.status)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=o(e.adler,n.pending_buf,n.pending-i,i)),d(e),i=n.pending,n.pending===n.pending_buf_size)){l=1;break}l=n.gzindex<n.gzhead.comment.length?255&n.gzhead.comment.charCodeAt(n.gzindex++):0,p(n,l)}while(0!==l);n.gzhead.hcrc&&n.pending>i&&(e.adler=o(e.adler,n.pending_buf,n.pending-i,i)),0===l&&(n.status=103)}else n.status=103;if(103===n.status&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&d(e),n.pending+2<=n.pending_buf_size&&(p(n,255&e.adler),p(n,e.adler>>8&255),e.adler=0,n.status=113)):n.status=113),0!==n.pending){if(d(e),0===e.avail_out)return n.last_flush=-1,0}else if(0===e.avail_in&&h(t)<=h(r)&&4!==t)return c(e,-5);if(666===n.status&&0!==e.avail_in)return c(e,-5);if(0!==e.avail_in||0!==n.lookahead||0!==t&&666!==n.status){var y=2===n.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(b(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(f(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(f(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(f(e,!1),0===e.strm.avail_out)?1:2}(n,t):3===n.strategy?function(e,t){for(var r,a,n,i,o=e.window;;){if(e.lookahead<=258){if(b(e),e.lookahead<=258&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&0<e.strstart&&(a=o[n=e.strstart-1])===o[++n]&&a===o[++n]&&a===o[++n]){i=e.strstart+258;do;while(a===o[++n]&&a===o[++n]&&a===o[++n]&&a===o[++n]&&a===o[++n]&&a===o[++n]&&a===o[++n]&&a===o[++n]&&n<i);e.match_length=258-(i-n),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=s._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=s._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(f(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(f(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(f(e,!1),0===e.strm.avail_out)?1:2}(n,t):a[n.level].func(n,t);if(3!==y&&4!==y||(n.status=666),1===y||3===y)return 0===e.avail_out&&(n.last_flush=-1),0;if(2===y&&(1===t?s._tr_align(n):5!==t&&(s._tr_stored_block(n,0,0,!1),3===t&&(u(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),d(e),0===e.avail_out))return n.last_flush=-1,0}return 4!==t?0:n.wrap<=0?1:(2===n.wrap?(p(n,255&e.adler),p(n,e.adler>>8&255),p(n,e.adler>>16&255),p(n,e.adler>>24&255),p(n,255&e.total_in),p(n,e.total_in>>8&255),p(n,e.total_in>>16&255),p(n,e.total_in>>24&255)):(m(n,e.adler>>>16),m(n,65535&e.adler)),d(e),0<n.wrap&&(n.wrap=-n.wrap),+(0===n.pending))},r.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&103!==t&&113!==t&&666!==t?c(e,-2):(e.state=null,113===t?c(e,-3):0):-2},r.deflateSetDictionary=function(e,t){var r,a,s,o,l,c,h,d,f=t.length;if(!e||!e.state||2===(o=(r=e.state).wrap)||1===o&&42!==r.status||r.lookahead)return -2;for(1===o&&(e.adler=i(e.adler,t,f,0)),r.wrap=0,f>=r.w_size&&(0===o&&(u(r.head),r.strstart=0,r.block_start=0,r.insert=0),d=new n.Buf8(r.w_size),n.arraySet(d,t,f-r.w_size,r.w_size,0),t=d,f=r.w_size),l=e.avail_in,c=e.next_in,h=e.input,e.avail_in=f,e.next_in=0,e.input=t,b(r);r.lookahead>=3;){for(a=r.strstart,s=r.lookahead-2;r.ins_h=(r.ins_h<<r.hash_shift^r.window[a+3-1])&r.hash_mask,r.prev[a&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=a,a++,--s;);r.strstart=a,r.lookahead=2,b(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=c,e.input=h,e.avail_in=l,r.wrap=o,0},r.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t,r){"use strict";t.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(e,t,r){"use strict";t.exports=function(e,t){var r,a,n,s,i,o,l,c,h,u,d,f,p,m,g,b,y,v,k,_,w,S,x,C,E;r=e.state,a=e.next_in,C=e.input,n=a+(e.avail_in-5),s=e.next_out,E=e.output,i=s-(t-e.avail_out),o=s+(e.avail_out-257),l=r.dmax,c=r.wsize,h=r.whave,u=r.wnext,d=r.window,f=r.hold,p=r.bits,m=r.lencode,g=r.distcode,b=(1<<r.lenbits)-1,y=(1<<r.distbits)-1;e:do for(p<15&&(f+=C[a++]<<p,p+=8,f+=C[a++]<<p,p+=8),v=m[f&b];;){if(f>>>=k=v>>>24,p-=k,0==(k=v>>>16&255))E[s++]=65535&v;else{if(!(16&k)){if(0==(64&k)){v=m[(65535&v)+(f&(1<<k)-1)];continue}if(32&k){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}for(_=65535&v,(k&=15)&&(p<k&&(f+=C[a++]<<p,p+=8),_+=f&(1<<k)-1,f>>>=k,p-=k),p<15&&(f+=C[a++]<<p,p+=8,f+=C[a++]<<p,p+=8),v=g[f&y];;){if(f>>>=k=v>>>24,p-=k,!(16&(k=v>>>16&255))){if(0==(64&k)){v=g[(65535&v)+(f&(1<<k)-1)];continue}e.msg="invalid distance code",r.mode=30;break e}if(w=65535&v,p<(k&=15)&&(f+=C[a++]<<p,(p+=8)<k&&(f+=C[a++]<<p,p+=8)),l<(w+=f&(1<<k)-1)){e.msg="invalid distance too far back",r.mode=30;break e}if(f>>>=k,p-=k,(k=s-i)<w){if(h<(k=w-k)&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(x=d,(S=0)===u){if(S+=c-k,k<_){for(_-=k;E[s++]=d[S++],--k;);S=s-w,x=E}}else if(u<k){if(S+=c+u-k,(k-=u)<_){for(_-=k;E[s++]=d[S++],--k;);if(S=0,u<_){for(_-=k=u;E[s++]=d[S++],--k;);S=s-w,x=E}}}else if(S+=u-k,k<_){for(_-=k;E[s++]=d[S++],--k;);S=s-w,x=E}for(;2<_;)E[s++]=x[S++],E[s++]=x[S++],E[s++]=x[S++],_-=3;_&&(E[s++]=x[S++],1<_&&(E[s++]=x[S++]))}else{for(S=s-w;E[s++]=E[S++],E[s++]=E[S++],E[s++]=E[S++],2<(_-=3););_&&(E[s++]=E[S++],1<_&&(E[s++]=E[S++]))}break}}break}while(a<n&&s<o);a-=_=p>>3,f&=(1<<(p-=_<<3))-1,e.next_in=a,e.next_out=s,e.avail_in=a<n?n-a+5:5-(a-n),e.avail_out=s<o?o-s+257:257-(s-o),r.hold=f,r.bits=p}},{}],49:[function(e,t,r){"use strict";var a=e("../utils/common"),n=e("./adler32"),s=e("./crc32"),i=e("./inffast"),o=e("./inftrees");function l(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new a.Buf16(320),this.work=new a.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function h(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new a.Buf32(852),t.distcode=t.distdyn=new a.Buf32(592),t.sane=1,t.back=-1,0):-2}function u(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,h(e)):-2}function d(e,t){var r,a;return e&&e.state?(a=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?-2:(null!==a.window&&a.wbits!==t&&(a.window=null),a.wrap=r,a.wbits=t,u(e))):-2}function f(e,t){var r;return e?((e.state=new c).window=null,0!==(r=d(e,t))&&(e.state=null),r):-2}var p,m,g=!0;function b(e,t,r,n){var s,i=e.state;return null===i.window&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new a.Buf8(i.wsize)),n>=i.wsize?(a.arraySet(i.window,t,r-i.wsize,i.wsize,0),i.wnext=0,i.whave=i.wsize):(n<(s=i.wsize-i.wnext)&&(s=n),a.arraySet(i.window,t,r-n,s,i.wnext),(n-=s)?(a.arraySet(i.window,t,r-n,n,0),i.wnext=n,i.whave=i.wsize):(i.wnext+=s,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=s))),0}r.inflateReset=u,r.inflateReset2=d,r.inflateResetKeep=h,r.inflateInit=function(e){return f(e,15)},r.inflateInit2=f,r.inflate=function(e,t){var r,c,h,u,d,f,y,v,k,_,w,S,x,C,E,A,P,N,T,z,B,R,M,D,I=0,O=new a.Buf8(4),F=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return -2;12===(r=e.state).mode&&(r.mode=13),d=e.next_out,h=e.output,y=e.avail_out,u=e.next_in,c=e.input,f=e.avail_in,v=r.hold,k=r.bits,_=f,w=y,R=0;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;k<16;){if(0===f)break e;f--,v+=c[u++]<<k,k+=8}if(2&r.wrap&&35615===v){O[r.check=0]=255&v,O[1]=v>>>8&255,r.check=s(r.check,O,2,0),k=v=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&v)<<8)+(v>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&v)){e.msg="unknown compression method",r.mode=30;break}if(k-=4,B=8+(15&(v>>>=4)),0===r.wbits)r.wbits=B;else if(B>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<B,e.adler=r.check=1,r.mode=512&v?10:12,k=v=0;break;case 2:for(;k<16;){if(0===f)break e;f--,v+=c[u++]<<k,k+=8}if(r.flags=v,8!=(255&r.flags)){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=v>>8&1),512&r.flags&&(O[0]=255&v,O[1]=v>>>8&255,r.check=s(r.check,O,2,0)),k=v=0,r.mode=3;case 3:for(;k<32;){if(0===f)break e;f--,v+=c[u++]<<k,k+=8}r.head&&(r.head.time=v),512&r.flags&&(O[0]=255&v,O[1]=v>>>8&255,O[2]=v>>>16&255,O[3]=v>>>24&255,r.check=s(r.check,O,4,0)),k=v=0,r.mode=4;case 4:for(;k<16;){if(0===f)break e;f--,v+=c[u++]<<k,k+=8}r.head&&(r.head.xflags=255&v,r.head.os=v>>8),512&r.flags&&(O[0]=255&v,O[1]=v>>>8&255,r.check=s(r.check,O,2,0)),k=v=0,r.mode=5;case 5:if(1024&r.flags){for(;k<16;){if(0===f)break e;f--,v+=c[u++]<<k,k+=8}r.length=v,r.head&&(r.head.extra_len=v),512&r.flags&&(O[0]=255&v,O[1]=v>>>8&255,r.check=s(r.check,O,2,0)),k=v=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(f<(S=r.length)&&(S=f),S&&(r.head&&(B=r.head.extra_len-r.length,r.head.extra||(r.head.extra=Array(r.head.extra_len)),a.arraySet(r.head.extra,c,u,S,B)),512&r.flags&&(r.check=s(r.check,c,S,u)),f-=S,u+=S,r.length-=S),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===f)break e;for(S=0;B=c[u+S++],r.head&&B&&r.length<65536&&(r.head.name+=String.fromCharCode(B)),B&&S<f;);if(512&r.flags&&(r.check=s(r.check,c,S,u)),f-=S,u+=S,B)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===f)break e;for(S=0;B=c[u+S++],r.head&&B&&r.length<65536&&(r.head.comment+=String.fromCharCode(B)),B&&S<f;);if(512&r.flags&&(r.check=s(r.check,c,S,u)),f-=S,u+=S,B)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;k<16;){if(0===f)break e;f--,v+=c[u++]<<k,k+=8}if(v!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}k=v=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;k<32;){if(0===f)break e;f--,v+=c[u++]<<k,k+=8}e.adler=r.check=l(v),k=v=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=d,e.avail_out=y,e.next_in=u,e.avail_in=f,r.hold=v,r.bits=k,2;e.adler=r.check=1,r.mode=12;case 12:if(5===t||6===t)break e;case 13:if(r.last){v>>>=7&k,k-=7&k,r.mode=27;break}for(;k<3;){if(0===f)break e;f--,v+=c[u++]<<k,k+=8}switch(r.last=1&v,k-=1,3&(v>>>=1)){case 0:r.mode=14;break;case 1:if(function(e){if(g){var t;for(p=new a.Buf32(512),m=new a.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(o(1,e.lens,0,288,p,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;o(2,e.lens,0,32,m,0,e.work,{bits:5}),g=!1}e.lencode=p,e.lenbits=9,e.distcode=m,e.distbits=5}(r),r.mode=20,6!==t)break;v>>>=2,k-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}v>>>=2,k-=2;break;case 14:for(v>>>=7&k,k-=7&k;k<32;){if(0===f)break e;f--,v+=c[u++]<<k,k+=8}if((65535&v)!=(v>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&v,k=v=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(S=r.length){if(f<S&&(S=f),y<S&&(S=y),0===S)break e;a.arraySet(h,c,u,S,d),f-=S,u+=S,y-=S,d+=S,r.length-=S;break}r.mode=12;break;case 17:for(;k<14;){if(0===f)break e;f--,v+=c[u++]<<k,k+=8}if(r.nlen=257+(31&v),k-=5,r.ndist=1+(31&(v>>>=5)),k-=5,r.ncode=4+(15&(v>>>=5)),v>>>=4,k-=4,286<r.nlen||30<r.ndist){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;k<3;){if(0===f)break e;f--,v+=c[u++]<<k,k+=8}r.lens[F[r.have++]]=7&v,v>>>=3,k-=3}for(;r.have<19;)r.lens[F[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,M={bits:r.lenbits},R=o(0,r.lens,0,19,r.lencode,0,r.work,M),r.lenbits=M.bits,R){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;A=(I=r.lencode[v&(1<<r.lenbits)-1])>>>16&255,P=65535&I,!((E=I>>>24)<=k);){if(0===f)break e;f--,v+=c[u++]<<k,k+=8}if(P<16)v>>>=E,k-=E,r.lens[r.have++]=P;else{if(16===P){for(D=E+2;k<D;){if(0===f)break e;f--,v+=c[u++]<<k,k+=8}if(v>>>=E,k-=E,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}B=r.lens[r.have-1],S=3+(3&v),v>>>=2,k-=2}else if(17===P){for(D=E+3;k<D;){if(0===f)break e;f--,v+=c[u++]<<k,k+=8}k-=E,B=0,S=3+(7&(v>>>=E)),v>>>=3,k-=3}else{for(D=E+7;k<D;){if(0===f)break e;f--,v+=c[u++]<<k,k+=8}k-=E,B=0,S=11+(127&(v>>>=E)),v>>>=7,k-=7}if(r.have+S>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;S--;)r.lens[r.have++]=B}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,M={bits:r.lenbits},R=o(1,r.lens,0,r.nlen,r.lencode,0,r.work,M),r.lenbits=M.bits,R){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,M={bits:r.distbits},R=o(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,M),r.distbits=M.bits,R){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=f&&258<=y){e.next_out=d,e.avail_out=y,e.next_in=u,e.avail_in=f,r.hold=v,r.bits=k,i(e,w),d=e.next_out,h=e.output,y=e.avail_out,u=e.next_in,c=e.input,f=e.avail_in,v=r.hold,k=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;A=(I=r.lencode[v&(1<<r.lenbits)-1])>>>16&255,P=65535&I,!((E=I>>>24)<=k);){if(0===f)break e;f--,v+=c[u++]<<k,k+=8}if(A&&0==(240&A)){for(N=E,T=A,z=P;A=(I=r.lencode[z+((v&(1<<N+T)-1)>>N)])>>>16&255,P=65535&I,!(N+(E=I>>>24)<=k);){if(0===f)break e;f--,v+=c[u++]<<k,k+=8}v>>>=N,k-=N,r.back+=N}if(v>>>=E,k-=E,r.back+=E,r.length=P,0===A){r.mode=26;break}if(32&A){r.back=-1,r.mode=12;break}if(64&A){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&A,r.mode=22;case 22:if(r.extra){for(D=r.extra;k<D;){if(0===f)break e;f--,v+=c[u++]<<k,k+=8}r.length+=v&(1<<r.extra)-1,v>>>=r.extra,k-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;A=(I=r.distcode[v&(1<<r.distbits)-1])>>>16&255,P=65535&I,!((E=I>>>24)<=k);){if(0===f)break e;f--,v+=c[u++]<<k,k+=8}if(0==(240&A)){for(N=E,T=A,z=P;A=(I=r.distcode[z+((v&(1<<N+T)-1)>>N)])>>>16&255,P=65535&I,!(N+(E=I>>>24)<=k);){if(0===f)break e;f--,v+=c[u++]<<k,k+=8}v>>>=N,k-=N,r.back+=N}if(v>>>=E,k-=E,r.back+=E,64&A){e.msg="invalid distance code",r.mode=30;break}r.offset=P,r.extra=15&A,r.mode=24;case 24:if(r.extra){for(D=r.extra;k<D;){if(0===f)break e;f--,v+=c[u++]<<k,k+=8}r.offset+=v&(1<<r.extra)-1,v>>>=r.extra,k-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===y)break e;if(S=w-y,r.offset>S){if((S=r.offset-S)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}x=S>r.wnext?(S-=r.wnext,r.wsize-S):r.wnext-S,S>r.length&&(S=r.length),C=r.window}else C=h,x=d-r.offset,S=r.length;for(y<S&&(S=y),y-=S,r.length-=S;h[d++]=C[x++],--S;);0===r.length&&(r.mode=21);break;case 26:if(0===y)break e;h[d++]=r.length,y--,r.mode=21;break;case 27:if(r.wrap){for(;k<32;){if(0===f)break e;f--,v|=c[u++]<<k,k+=8}if(w-=y,e.total_out+=w,r.total+=w,w&&(e.adler=r.check=r.flags?s(r.check,h,w,d-w):n(r.check,h,w,d-w)),w=y,(r.flags?v:l(v))!==r.check){e.msg="incorrect data check",r.mode=30;break}k=v=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;k<32;){if(0===f)break e;f--,v+=c[u++]<<k,k+=8}if(v!==(0xffffffff&r.total)){e.msg="incorrect length check",r.mode=30;break}k=v=0}r.mode=29;case 29:R=1;break e;case 30:R=-3;break e;case 31:return -4;default:return -2}return e.next_out=d,e.avail_out=y,e.next_in=u,e.avail_in=f,r.hold=v,r.bits=k,(r.wsize||w!==e.avail_out&&r.mode<30&&(r.mode<27||4!==t))&&b(e,e.output,e.next_out,w-e.avail_out)?(r.mode=31,-4):(_-=e.avail_in,w-=e.avail_out,e.total_in+=_,e.total_out+=w,r.total+=w,r.wrap&&w&&(e.adler=r.check=r.flags?s(r.check,h,w,e.next_out-w):n(r.check,h,w,e.next_out-w)),e.data_type=r.bits+64*!!r.last+128*(12===r.mode)+256*(20===r.mode||15===r.mode),(0==_&&0===w||4===t)&&0===R&&(R=-5),R)},r.inflateEnd=function(e){if(!e||!e.state)return -2;var t=e.state;return t.window&&(t.window=null),e.state=null,0},r.inflateGetHeader=function(e,t){var r;return e&&e.state?0==(2&(r=e.state).wrap)?-2:((r.head=t).done=!1,0):-2},r.inflateSetDictionary=function(e,t){var r,a=t.length;return e&&e.state?0!==(r=e.state).wrap&&11!==r.mode?-2:11===r.mode&&n(1,t,a,0)!==r.check?-3:b(e,t,a,a)?(r.mode=31,-4):(r.havedict=1,0):-2},r.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t,r){"use strict";var a=e("../utils/common"),n=[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],s=[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],i=[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],o=[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];t.exports=function(e,t,r,l,c,h,u,d){var f,p,m,g,b,y,v,k,_,w=d.bits,S=0,x=0,C=0,E=0,A=0,P=0,N=0,T=0,z=0,B=0,R=null,M=0,D=new a.Buf16(16),I=new a.Buf16(16),O=null,F=0;for(S=0;S<=15;S++)D[S]=0;for(x=0;x<l;x++)D[t[r+x]]++;for(A=w,E=15;1<=E&&0===D[E];E--);if(E<A&&(A=E),0===E)return c[h++]=0x1400000,c[h++]=0x1400000,d.bits=1,0;for(C=1;C<E&&0===D[C];C++);for(A<C&&(A=C),S=T=1;S<=15;S++)if(T<<=1,(T-=D[S])<0)return -1;if(0<T&&(0===e||1!==E))return -1;for(I[1]=0,S=1;S<15;S++)I[S+1]=I[S]+D[S];for(x=0;x<l;x++)0!==t[r+x]&&(u[I[t[r+x]]++]=x);if(y=0===e?(R=O=u,19):1===e?(R=n,M-=257,O=s,F-=257,256):(R=i,O=o,-1),S=C,b=h,N=x=B=0,m=-1,g=(z=1<<(P=A))-1,1===e&&852<z||2===e&&592<z)return 1;for(;;){for(v=S-N,_=u[x]<y?(k=0,u[x]):u[x]>y?(k=O[F+u[x]],R[M+u[x]]):(k=96,0),f=1<<S-N,C=p=1<<P;c[b+(B>>N)+(p-=f)]=v<<24|k<<16|_|0,0!==p;);for(f=1<<S-1;B&f;)f>>=1;if(0!==f?(B&=f-1,B+=f):B=0,x++,0==--D[S]){if(S===E)break;S=t[r+u[x]]}if(A<S&&(B&g)!==m){for(0===N&&(N=A),b+=C,T=1<<(P=S-N);P+N<E&&!((T-=D[P+N])<=0);)P++,T<<=1;if(z+=1<<P,1===e&&852<z||2===e&&592<z)return 1;c[m=B&g]=A<<24|P<<16|b-h|0}}return 0!==B&&(c[b+B]=S-N<<24|4194304),d.bits=A,0}},{"../utils/common":41}],51:[function(e,t,r){"use strict";t.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(e,t,r){"use strict";var a=e("../utils/common");function n(e){for(var t=e.length;0<=--t;)e[t]=0}var s=[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],i=[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],o=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],l=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],c=Array(576);n(c);var h=Array(60);n(h);var u=Array(512);n(u);var d=Array(256);n(d);var f=Array(29);n(f);var p,m,g,b=Array(30);function y(e,t,r,a,n){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=a,this.max_length=n,this.has_stree=e&&e.length}function v(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function k(e){return e<256?u[e]:u[256+(e>>>7)]}function _(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function w(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,_(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function S(e,t,r){w(e,r[2*t],r[2*t+1])}function x(e,t){for(var r=0;r|=1&e,e>>>=1,r<<=1,0<--t;);return r>>>1}function C(e,t,r){var a,n,s=Array(16),i=0;for(a=1;a<=15;a++)s[a]=i=i+r[a-1]<<1;for(n=0;n<=t;n++){var o=e[2*n+1];0!==o&&(e[2*n]=x(s[o]++,o))}}function E(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function A(e){8<e.bi_valid?_(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function P(e,t,r,a){var n=2*t,s=2*r;return e[n]<e[s]||e[n]===e[s]&&a[t]<=a[r]}function N(e,t,r){for(var a=e.heap[r],n=r<<1;n<=e.heap_len&&(n<e.heap_len&&P(t,e.heap[n+1],e.heap[n],e.depth)&&n++,!P(t,a,e.heap[n],e.depth));)e.heap[r]=e.heap[n],r=n,n<<=1;e.heap[r]=a}function T(e,t,r){var a,n,o,l,c=0;if(0!==e.last_lit)for(;a=e.pending_buf[e.d_buf+2*c]<<8|e.pending_buf[e.d_buf+2*c+1],n=e.pending_buf[e.l_buf+c],c++,0===a?S(e,n,t):(S(e,(o=d[n])+256+1,t),0!==(l=s[o])&&w(e,n-=f[o],l),S(e,o=k(--a),r),0!==(l=i[o])&&w(e,a-=b[o],l)),c<e.last_lit;);S(e,256,t)}function z(e,t){var r,a,n,s=t.dyn_tree,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,l=t.stat_desc.elems,c=-1;for(e.heap_len=0,e.heap_max=573,r=0;r<l;r++)0!==s[2*r]?(e.heap[++e.heap_len]=c=r,e.depth[r]=0):s[2*r+1]=0;for(;e.heap_len<2;)s[2*(n=e.heap[++e.heap_len]=c<2?++c:0)]=1,e.depth[n]=0,e.opt_len--,o&&(e.static_len-=i[2*n+1]);for(t.max_code=c,r=e.heap_len>>1;1<=r;r--)N(e,s,r);for(n=l;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],N(e,s,1),a=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=a,s[2*n]=s[2*r]+s[2*a],e.depth[n]=(e.depth[r]>=e.depth[a]?e.depth[r]:e.depth[a])+1,s[2*r+1]=s[2*a+1]=n,e.heap[1]=n++,N(e,s,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,a,n,s,i,o,l=t.dyn_tree,c=t.max_code,h=t.stat_desc.static_tree,u=t.stat_desc.has_stree,d=t.stat_desc.extra_bits,f=t.stat_desc.extra_base,p=t.stat_desc.max_length,m=0;for(s=0;s<=15;s++)e.bl_count[s]=0;for(l[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)p<(s=l[2*l[2*(a=e.heap[r])+1]+1]+1)&&(s=p,m++),l[2*a+1]=s,c<a||(e.bl_count[s]++,i=0,f<=a&&(i=d[a-f]),o=l[2*a],e.opt_len+=o*(s+i),u&&(e.static_len+=o*(h[2*a+1]+i)));if(0!==m){do{for(s=p-1;0===e.bl_count[s];)s--;e.bl_count[s]--,e.bl_count[s+1]+=2,e.bl_count[p]--,m-=2}while(0<m);for(s=p;0!==s;s--)for(a=e.bl_count[s];0!==a;)c<(n=e.heap[--r])||(l[2*n+1]!==s&&(e.opt_len+=(s-l[2*n+1])*l[2*n],l[2*n+1]=s),a--)}}(e,t),C(s,c,e.bl_count)}function B(e,t,r){var a,n,s=-1,i=t[1],o=0,l=7,c=4;for(0===i&&(l=138,c=3),t[2*(r+1)+1]=65535,a=0;a<=r;a++)n=i,i=t[2*(a+1)+1],++o<l&&n===i||(o<c?e.bl_tree[2*n]+=o:0!==n?(n!==s&&e.bl_tree[2*n]++,e.bl_tree[32]++):o<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=n,c=(o=0)===i?(l=138,3):n===i?(l=6,3):(l=7,4))}function R(e,t,r){var a,n,s=-1,i=t[1],o=0,l=7,c=4;for(0===i&&(l=138,c=3),a=0;a<=r;a++)if(n=i,i=t[2*(a+1)+1],!(++o<l&&n===i)){if(o<c)for(;S(e,n,e.bl_tree),0!=--o;);else 0!==n?(n!==s&&(S(e,n,e.bl_tree),o--),S(e,16,e.bl_tree),w(e,o-3,2)):o<=10?(S(e,17,e.bl_tree),w(e,o-3,3)):(S(e,18,e.bl_tree),w(e,o-11,7));s=n,c=(o=0)===i?(l=138,3):n===i?(l=6,3):(l=7,4)}}n(b);var M=!1;function D(e,t,r,n){w(e,0+ +!!n,3),A(e),_(e,r),_(e,~r),a.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}r._tr_init=function(e){M||(function(){var e,t,r,a,n,l=Array(16);for(a=r=0;a<28;a++)for(f[a]=r,e=0;e<1<<s[a];e++)d[r++]=a;for(d[r-1]=a,a=n=0;a<16;a++)for(b[a]=n,e=0;e<1<<i[a];e++)u[n++]=a;for(n>>=7;a<30;a++)for(b[a]=n<<7,e=0;e<1<<i[a]-7;e++)u[256+n++]=a;for(t=0;t<=15;t++)l[t]=0;for(e=0;e<=143;)c[2*e+1]=8,e++,l[8]++;for(;e<=255;)c[2*e+1]=9,e++,l[9]++;for(;e<=279;)c[2*e+1]=7,e++,l[7]++;for(;e<=287;)c[2*e+1]=8,e++,l[8]++;for(C(c,287,l),e=0;e<30;e++)h[2*e+1]=5,h[2*e]=x(e,5);p=new y(c,s,257,286,15),m=new y(h,i,0,30,15),g=new y([],o,0,19,7)}(),M=!0),e.l_desc=new v(e.dyn_ltree,p),e.d_desc=new v(e.dyn_dtree,m),e.bl_desc=new v(e.bl_tree,g),e.bi_buf=0,e.bi_valid=0,E(e)},r._tr_stored_block=D,r._tr_flush_block=function(e,t,r,a){var n,s,i=0;0<e.level?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=0xf3ffc07f;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),z(e,e.l_desc),z(e,e.d_desc),i=function(e){var t;for(B(e,e.dyn_ltree,e.l_desc.max_code),B(e,e.dyn_dtree,e.d_desc.max_code),z(e,e.bl_desc),t=18;3<=t&&0===e.bl_tree[2*l[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),n=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=n&&(n=s)):n=s=r+5,r+4<=n&&-1!==t?D(e,t,r,a):4===e.strategy||s===n?(w(e,2+ +!!a,3),T(e,c,h)):(w(e,4+ +!!a,3),function(e,t,r,a){var n;for(w(e,t-257,5),w(e,r-1,5),w(e,a-4,4),n=0;n<a;n++)w(e,e.bl_tree[2*l[n]+1],3);R(e,e.dyn_ltree,t-1),R(e,e.dyn_dtree,r-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,i+1),T(e,e.dyn_ltree,e.dyn_dtree)),E(e),a&&A(e)},r._tr_tally=function(e,t,r){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(d[r]+256+1)]++,e.dyn_dtree[2*k(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){w(e,2,3),S(e,256,c),16===e.bi_valid?(_(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}},{"../utils/common":41}],53:[function(e,t,r){"use strict";t.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(e,t,a){(function(e){!function(e,t){"use strict";if(!e.setImmediate){var r,a,n,s,i=1,o={},l=!1,c=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,r="[object process]"===({}).toString.call(e.process)?function(e){process.nextTick(function(){d(e)})}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((n=new MessageChannel).port1.onmessage=function(e){d(e.data)},function(e){n.port2.postMessage(e)}):c&&"onreadystatechange"in c.createElement("script")?(a=c.documentElement,function(e){var t=c.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,a.removeChild(t),t=null},a.appendChild(t)}):function(e){setTimeout(d,0,e)}:(s="setImmediate$"+Math.random()+"$",e.addEventListener?e.addEventListener("message",f,!1):e.attachEvent("onmessage",f),function(t){e.postMessage(s+t,"*")}),h.setImmediate=function(e){"function"!=typeof e&&(e=Function(""+e));for(var t=Array(arguments.length-1),a=0;a<t.length;a++)t[a]=arguments[a+1];var n={callback:e,args:t};return o[i]=n,r(i),i++},h.clearImmediate=u}function u(e){delete o[e]}function d(e){if(l)setTimeout(d,0,e);else{var r=o[e];if(r){l=!0;try{var a=r.callback,n=r.args;switch(n.length){case 0:a();break;case 1:a(n[0]);break;case 2:a(n[0],n[1]);break;case 3:a(n[0],n[1],n[2]);break;default:a.apply(t,n)}}finally{u(e),l=!1}}}}function f(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&d(+t.data.slice(s.length))}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,void 0!==r.g?r.g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10)},835:function(e,t,r){"use strict";r.r(t),r.d(t,{defaultOptions:function(){return eA},parseAsync:function(){return eP},renderAsync:function(){return eT},renderDocument:function(){return eN}});var a,n,s,i,o,l,c=r(164);function h(e){return/^[^"'].*\s.*[^"']$/.test(e)?`'${e}'`:e}function u(e){let t=e.lastIndexOf("/")+1;return[0==t?"":e.substring(0,t),0==t?e:e.substring(t)]}function d(e,t){try{let r="http://docx/";return new URL(e,r+t).toString().substring(r.length)}catch{return`${t}${e}`}}function f(e,t){return e.reduce((e,r)=>(e[t(r)]=r,e),{})}function p(e){return e&&"object"==typeof e&&!Array.isArray(e)}function m(e,...t){if(!t.length)return e;let r=t.shift();if(p(e)&&p(r))for(let t in r)p(r[t])?m(e[t]??(e[t]={}),r[t]):e[t]=r[t];return m(e,...t)}function g(e){return Array.isArray(e)?e:[e]}(a=i||(i={})).OfficeDocument="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument",a.FontTable="http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable",a.Image="http://schemas.openxmlformats.org/officeDocument/2006/relationships/image",a.Numbering="http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering",a.Styles="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles",a.StylesWithEffects="http://schemas.microsoft.com/office/2007/relationships/stylesWithEffects",a.Theme="http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme",a.Settings="http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings",a.WebSettings="http://schemas.openxmlformats.org/officeDocument/2006/relationships/webSettings",a.Hyperlink="http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink",a.Footnotes="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes",a.Endnotes="http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes",a.Footer="http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer",a.Header="http://schemas.openxmlformats.org/officeDocument/2006/relationships/header",a.ExtendedProperties="http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties",a.CoreProperties="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties",a.CustomProperties="http://schemas.openxmlformats.org/package/2006/relationships/metadata/custom-properties",a.Comments="http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments",a.CommentsExtended="http://schemas.microsoft.com/office/2011/relationships/commentsExtended",a.AltChunk="http://schemas.openxmlformats.org/officeDocument/2006/relationships/aFChunk";let b="http://schemas.openxmlformats.org/wordprocessingml/2006/main",y={Dxa:{mul:.05,unit:"pt"},Emu:{mul:1/12700,unit:"pt"},FontSize:{mul:.5,unit:"pt"},Border:{mul:.125,unit:"pt",min:.25,max:12},Point:{mul:1,unit:"pt"},Percent:{mul:.02,unit:"%"}};function v(e,t=y.Dxa){if(null==e||/.+(p[xt]|[%])$/.test(e))return e;var r,a,n,s=parseInt(e)*t.mul;return t.min&&t.max&&(r=s,a=t.min,n=t.max,s=a>r?a:n<r?n:r),`${s.toFixed(2)}${t.unit}`}function k(e,t,r){if(e.namespaceURI!=b)return!1;switch(e.localName){case"color":t.color=r.attr(e,"val");break;case"sz":t.fontSize=r.lengthAttr(e,"val",y.FontSize);break;default:return!1}return!0}class _{elements(e,t=null){let r=[];for(let a=0,n=e.childNodes.length;a<n;a++){let n=e.childNodes.item(a);n.nodeType==Node.ELEMENT_NODE&&(null==t||n.localName==t)&&r.push(n)}return r}element(e,t){for(let r=0,a=e.childNodes.length;r<a;r++){let a=e.childNodes.item(r);if(1==a.nodeType&&a.localName==t)return a}return null}elementAttr(e,t,r){var a=this.element(e,t);return a?this.attr(a,r):void 0}attrs(e){return Array.from(e.attributes)}attr(e,t){for(let r=0,a=e.attributes.length;r<a;r++){let a=e.attributes.item(r);if(a.localName==t)return a.value}return null}intAttr(e,t,r=null){var a=this.attr(e,t);return a?parseInt(a):r}hexAttr(e,t,r=null){var a=this.attr(e,t);return a?parseInt(a,16):r}floatAttr(e,t,r=null){var a=this.attr(e,t);return a?parseFloat(a):r}boolAttr(e,t,r=null){return function(e,t=!1){switch(e){case"1":case"on":case"true":return!0;case"0":case"off":case"false":return!1;default:return t}}(this.attr(e,t),r)}lengthAttr(e,t,r=y.Dxa){return v(this.attr(e,t),r)}}let w=new _;class S{constructor(e,t){this._package=e,this.path=t}async load(){this.rels=await this._package.loadRelationships(this.path);let e=await this._package.load(this.path),t=this._package.parseXmlDocument(e);this._package.options.keepOrigin&&(this._xmlDocument=t),this.parseXml(t.firstElementChild)}save(){var e;this._package.update(this.path,(e=this._xmlDocument,new XMLSerializer().serializeToString(e)))}parseXml(e){}}let x={embedRegular:"regular",embedBold:"bold",embedItalic:"italic",embedBoldItalic:"boldItalic"};class C extends S{parseXml(e){var t;this.fonts=(t=this._package.xmlParser).elements(e).map(e=>(function(e,t){let r={name:t.attr(e,"name"),embedFontRefs:[]};for(let s of t.elements(e))switch(s.localName){case"family":r.family=t.attr(s,"val");break;case"altName":r.altName=t.attr(s,"val");break;case"embedRegular":case"embedBold":case"embedItalic":case"embedBoldItalic":var a,n;r.embedFontRefs.push((a=s,{id:(n=t).attr(a,"id"),key:n.attr(a,"fontKey"),type:x[a.localName]}))}return r})(e,t))}}class E{constructor(e,t){this._zip=e,this.options=t,this.xmlParser=new _}get(e){var t;let r=(t=e).startsWith("/")?t.substr(1):t;return this._zip.files[r]??this._zip.files[r.replace(/\//g,"\\")]}update(e,t){this._zip.file(e,t)}static async load(e,t){return new E(await c.loadAsync(e),t)}save(e="blob"){return this._zip.generateAsync({type:e})}load(e,t="string"){return this.get(e)?.async(t)??Promise.resolve(null)}async loadRelationships(e=null){var t,r;let a="_rels/.rels";if(null!=e){let[t,r]=u(e);a=`${t}_rels/${r}.rels`}let n=await this.load(a);return n?(t=this.parseXmlDocument(n).firstElementChild,(r=this.xmlParser).elements(t).map(e=>({id:r.attr(e,"Id"),type:r.attr(e,"Type"),target:r.attr(e,"Target"),targetMode:r.attr(e,"TargetMode")}))):null}parseXmlDocument(e){return function(e,t=!1){var r,a;t&&(e=e.replace(/<[?].*[?]>/,"")),e=65279===(r=e).charCodeAt(0)?r.substring(1):r;let n=new DOMParser().parseFromString(e,"application/xml"),s=(a=n,a.getElementsByTagName("parsererror")[0]?.textContent);if(s)throw Error(s);return n}(e,this.options.trimXmlDeclaration)}}class A extends S{constructor(e,t,r){super(e,t),this._documentParser=r}parseXml(e){this.body=this._documentParser.parseDocumentFile(e)}}function P(e,t){return{type:t.attr(e,"val"),color:t.attr(e,"color"),size:t.lengthAttr(e,"sz",y.Border),offset:t.lengthAttr(e,"space",y.Point),frame:t.boolAttr(e,"frame"),shadow:t.boolAttr(e,"shadow")}}function N(e,t=w){var r,a,n={};for(let s of t.elements(e))switch(s.localName){case"pgSz":n.pageSize={width:t.lengthAttr(s,"w"),height:t.lengthAttr(s,"h"),orientation:t.attr(s,"orient")};break;case"type":n.type=t.attr(s,"val");break;case"pgMar":n.pageMargins={left:t.lengthAttr(s,"left"),right:t.lengthAttr(s,"right"),top:t.lengthAttr(s,"top"),bottom:t.lengthAttr(s,"bottom"),header:t.lengthAttr(s,"header"),footer:t.lengthAttr(s,"footer"),gutter:t.lengthAttr(s,"gutter")};break;case"cols":n.columns=function(e,t){return{numberOfColumns:t.intAttr(e,"num"),space:t.lengthAttr(e,"space"),separator:t.boolAttr(e,"sep"),equalWidth:t.boolAttr(e,"equalWidth",!0),columns:t.elements(e,"col").map(e=>({width:t.lengthAttr(e,"w"),space:t.lengthAttr(e,"space")}))}}(s,t);break;case"headerReference":(n.headerRefs??(n.headerRefs=[])).push(T(s,t));break;case"footerReference":(n.footerRefs??(n.footerRefs=[])).push(T(s,t));break;case"titlePg":n.titlePage=t.boolAttr(s,"val",!0);break;case"pgBorders":n.pageBorders=function(e,t){var r={};for(let a of t.elements(e))switch(a.localName){case"left":r.left=P(a,t);break;case"top":r.top=P(a,t);break;case"right":r.right=P(a,t);break;case"bottom":r.bottom=P(a,t)}return r}(s,t);break;case"pgNumType":r=s,n.pageNumber={chapSep:(a=t).attr(r,"chapSep"),chapStyle:a.attr(r,"chapStyle"),format:a.attr(r,"fmt"),start:a.intAttr(r,"start")}}return n}function T(e,t){return{id:t.attr(e,"id"),type:t.attr(e,"type")}}function z(e,t){let r={};for(let a of t.elements(e))k(a,r,t);return r}function B(e,t){let r={};for(let a of t.elements(e))R(a,r,t);return r}function R(e,t,r){if(e.namespaceURI!=b)return!1;if(k(e,t,r))return!0;switch(e.localName){case"tabs":var a,n;a=e,t.tabs=(n=r).elements(a,"tab").map(e=>({position:n.lengthAttr(e,"pos"),leader:n.attr(e,"leader"),style:n.attr(e,"val")}));break;case"sectPr":t.sectionProps=N(e,r);break;case"numPr":t.numbering=function(e,t){var r={};for(let a of t.elements(e))switch(a.localName){case"numId":r.id=t.attr(a,"val");break;case"ilvl":r.level=t.intAttr(a,"val")}return r}(e,r);break;case"spacing":return t.lineSpacing={before:r.lengthAttr(e,"before"),after:r.lengthAttr(e,"after"),line:r.intAttr(e,"line"),lineRule:r.attr(e,"lineRule")},!1;case"textAlignment":return t.textAlignment=r.attr(e,"val"),!1;case"keepLines":t.keepLines=r.boolAttr(e,"val",!0);break;case"keepNext":t.keepNext=r.boolAttr(e,"val",!0);break;case"pageBreakBefore":t.pageBreakBefore=r.boolAttr(e,"val",!0);break;case"outlineLvl":t.outlineLevel=r.intAttr(e,"val");break;case"pStyle":t.styleName=r.attr(e,"val");break;case"rPr":t.runProps=z(e,r);break;default:return!1}return!0}function M(e,t){let r={level:t.intAttr(e,"ilvl")};for(let a of t.elements(e))switch(a.localName){case"start":r.start=t.attr(a,"val");break;case"lvlRestart":r.restart=t.intAttr(a,"val");break;case"numFmt":r.format=t.attr(a,"val");break;case"lvlText":r.text=t.attr(a,"val");break;case"lvlJc":r.justification=t.attr(a,"val");break;case"lvlPicBulletId":r.bulletPictureId=t.attr(a,"val");break;case"pStyle":r.paragraphStyle=t.attr(a,"val");break;case"pPr":r.paragraphProps=B(a,t);break;case"rPr":r.runProps=z(a,t)}return r}(n=o||(o={})).Continuous="continuous",n.NextPage="nextPage",n.NextColumn="nextColumn",n.EvenPage="evenPage",n.OddPage="oddPage";class D extends S{constructor(e,t,r){super(e,t),this._documentParser=r}parseXml(e){Object.assign(this,function(e,t){let r={numberings:[],abstractNumberings:[],bulletPictures:[]};for(let a of t.elements(e))switch(a.localName){case"num":r.numberings.push(function(e,t){let r={id:t.attr(e,"numId"),overrides:[]};for(let a of t.elements(e))switch(a.localName){case"abstractNumId":r.abstractId=t.attr(a,"val");break;case"lvlOverride":r.overrides.push(function(e,t){let r={level:t.intAttr(e,"ilvl")};for(let a of t.elements(e))switch(a.localName){case"startOverride":r.start=t.intAttr(a,"val");break;case"lvl":r.numberingLevel=M(a,t)}return r}(a,t))}return r}(a,t));break;case"abstractNum":r.abstractNumberings.push(function(e,t){let r={id:t.attr(e,"abstractNumId"),levels:[]};for(let a of t.elements(e))switch(a.localName){case"name":r.name=t.attr(a,"val");break;case"multiLevelType":r.multiLevelType=t.attr(a,"val");break;case"numStyleLink":r.numberingStyleLink=t.attr(a,"val");break;case"styleLink":r.styleLink=t.attr(a,"val");break;case"lvl":r.levels.push(M(a,t))}return r}(a,t));break;case"numPicBullet":r.bulletPictures.push(function(e,t){var r=t.element(e,"pict"),a=r&&t.element(r,"shape"),n=a&&t.element(a,"imagedata");return n?{id:t.attr(e,"numPicBulletId"),referenceId:t.attr(n,"id"),style:t.attr(a,"style")}:null}(a,t))}return r}(e,this._package.xmlParser)),this.domNumberings=this._documentParser.parseNumberingFile(e)}}class I extends S{constructor(e,t,r){super(e,t),this._documentParser=r}parseXml(e){this.styles=this._documentParser.parseStylesFile(e)}}(s=l||(l={})).Document="document",s.Paragraph="paragraph",s.Run="run",s.Break="break",s.NoBreakHyphen="noBreakHyphen",s.Table="table",s.Row="row",s.Cell="cell",s.Hyperlink="hyperlink",s.SmartTag="smartTag",s.Drawing="drawing",s.Image="image",s.Text="text",s.Tab="tab",s.Symbol="symbol",s.BookmarkStart="bookmarkStart",s.BookmarkEnd="bookmarkEnd",s.Footer="footer",s.Header="header",s.FootnoteReference="footnoteReference",s.EndnoteReference="endnoteReference",s.Footnote="footnote",s.Endnote="endnote",s.SimpleField="simpleField",s.ComplexField="complexField",s.Instruction="instruction",s.VmlPicture="vmlPicture",s.MmlMath="mmlMath",s.MmlMathParagraph="mmlMathParagraph",s.MmlFraction="mmlFraction",s.MmlFunction="mmlFunction",s.MmlFunctionName="mmlFunctionName",s.MmlNumerator="mmlNumerator",s.MmlDenominator="mmlDenominator",s.MmlRadical="mmlRadical",s.MmlBase="mmlBase",s.MmlDegree="mmlDegree",s.MmlSuperscript="mmlSuperscript",s.MmlSubscript="mmlSubscript",s.MmlPreSubSuper="mmlPreSubSuper",s.MmlSubArgument="mmlSubArgument",s.MmlSuperArgument="mmlSuperArgument",s.MmlNary="mmlNary",s.MmlDelimiter="mmlDelimiter",s.MmlRun="mmlRun",s.MmlEquationArray="mmlEquationArray",s.MmlLimit="mmlLimit",s.MmlLimitLower="mmlLimitLower",s.MmlMatrix="mmlMatrix",s.MmlMatrixRow="mmlMatrixRow",s.MmlBox="mmlBox",s.MmlBar="mmlBar",s.MmlGroupChar="mmlGroupChar",s.VmlElement="vmlElement",s.Inserted="inserted",s.Deleted="deleted",s.DeletedText="deletedText",s.Comment="comment",s.CommentReference="commentReference",s.CommentRangeStart="commentRangeStart",s.CommentRangeEnd="commentRangeEnd",s.AltChunk="altChunk";class O{constructor(){this.children=[],this.cssStyle={}}}class F extends O{constructor(){super(...arguments),this.type=l.Header}}class L extends O{constructor(){super(...arguments),this.type=l.Footer}}class j extends S{constructor(e,t,r){super(e,t),this._documentParser=r}parseXml(e){this.rootElement=this.createRootElement(),this.rootElement.children=this._documentParser.parseBodyElements(e)}}class U extends j{createRootElement(){return new F}}class $ extends j{createRootElement(){return new L}}function W(e){if(void 0!==e)return parseInt(e)}class H extends S{parseXml(e){this.props=function(e,t){let r={};for(let a of t.elements(e))switch(a.localName){case"Template":r.template=a.textContent;break;case"Pages":r.pages=W(a.textContent);break;case"Words":r.words=W(a.textContent);break;case"Characters":r.characters=W(a.textContent);break;case"Application":r.application=a.textContent;break;case"Lines":r.lines=W(a.textContent);break;case"Paragraphs":r.paragraphs=W(a.textContent);break;case"Company":r.company=a.textContent;break;case"AppVersion":r.appVersion=a.textContent}return r}(e,this._package.xmlParser)}}class Z extends S{parseXml(e){this.props=function(e,t){let r={};for(let a of t.elements(e))switch(a.localName){case"title":r.title=a.textContent;break;case"description":r.description=a.textContent;break;case"subject":r.subject=a.textContent;break;case"creator":r.creator=a.textContent;break;case"keywords":r.keywords=a.textContent;break;case"language":r.language=a.textContent;break;case"lastModifiedBy":r.lastModifiedBy=a.textContent;break;case"revision":a.textContent&&(r.revision=parseInt(a.textContent))}return r}(e,this._package.xmlParser)}}class V{}function G(e,t){return{latinTypeface:t.elementAttr(e,"latin","typeface"),eaTypeface:t.elementAttr(e,"ea","typeface"),csTypeface:t.elementAttr(e,"cs","typeface")}}class X extends S{constructor(e,t){super(e,t)}parseXml(e){this.theme=function(e,t){var r=new V,a=t.element(e,"themeElements");for(let e of t.elements(a))switch(e.localName){case"clrScheme":r.colorScheme=function(e,t){var r={name:t.attr(e,"name"),colors:{}};for(let s of t.elements(e)){var a=t.element(s,"srgbClr"),n=t.element(s,"sysClr");a?r.colors[s.localName]=t.attr(a,"val"):n&&(r.colors[s.localName]=t.attr(n,"lastClr"))}return r}(e,t);break;case"fontScheme":r.fontScheme=function(e,t){var r={name:t.attr(e,"name")};for(let a of t.elements(e))switch(a.localName){case"majorFont":r.majorFont=G(a,t);break;case"minorFont":r.minorFont=G(a,t)}return r}(e,t)}return r}(e,this._package.xmlParser)}}class K{}class Y extends K{constructor(){super(...arguments),this.type=l.Footnote}}class q extends K{constructor(){super(...arguments),this.type=l.Endnote}}class J extends S{constructor(e,t,r){super(e,t),this._documentParser=r}}class Q extends J{constructor(e,t,r){super(e,t,r)}parseXml(e){this.notes=this._documentParser.parseNotes(e,"footnote",Y)}}class ee extends J{constructor(e,t,r){super(e,t,r)}parseXml(e){this.notes=this._documentParser.parseNotes(e,"endnote",q)}}function et(e,t){var r={defaultNoteIds:[]};for(let a of t.elements(e))switch(a.localName){case"numFmt":r.nummeringFormat=t.attr(a,"val");break;case"footnote":case"endnote":r.defaultNoteIds.push(t.attr(a,"id"))}return r}class er extends S{constructor(e,t){super(e,t)}parseXml(e){this.settings=function(e,t){var r={};for(let a of t.elements(e))switch(a.localName){case"defaultTabStop":r.defaultTabStop=t.lengthAttr(a,"val");break;case"footnotePr":r.footnoteProps=et(a,t);break;case"endnotePr":r.endnoteProps=et(a,t);break;case"autoHyphenation":r.autoHyphenation=t.boolAttr(a,"val")}return r}(e,this._package.xmlParser)}}class ea extends S{parseXml(e){var t;this.props=(t=this._package.xmlParser).elements(e,"property").map(e=>{let r=e.firstChild;return{formatId:t.attr(e,"fmtid"),name:t.attr(e,"name"),type:r.nodeName,value:r.textContent}})}}class en extends S{constructor(e,t,r){super(e,t),this._documentParser=r}parseXml(e){this.comments=this._documentParser.parseComments(e),this.commentMap=f(this.comments,e=>e.id)}}class es extends S{constructor(e,t){super(e,t),this.comments=[]}parseXml(e){let t=this._package.xmlParser;for(let r of t.elements(e,"commentEx"))this.comments.push({paraId:t.attr(r,"paraId"),paraIdParent:t.attr(r,"paraIdParent"),done:t.boolAttr(r,"done")});this.commentMap=f(this.comments,e=>e.paraId)}}let ei=[{type:i.OfficeDocument,target:"word/document.xml"},{type:i.ExtendedProperties,target:"docProps/app.xml"},{type:i.CoreProperties,target:"docProps/core.xml"},{type:i.CustomProperties,target:"docProps/custom.xml"}];class eo{constructor(){this.parts=[],this.partsMap={}}static async load(e,t,r){var a=new eo;return a._options=r,a._parser=t,a._package=await E.load(e,r),a.rels=await a._package.loadRelationships(),await Promise.all(ei.map(e=>{let t=a.rels.find(t=>t.type===e.type)??e;return a.loadRelationshipPart(t.target,t.type)})),a}save(e="blob"){return this._package.save(e)}async loadRelationshipPart(e,t){if(this.partsMap[e])return this.partsMap[e];if(!this._package.get(e))return null;let r=null;switch(t){case i.OfficeDocument:this.documentPart=r=new A(this._package,e,this._parser);break;case i.FontTable:this.fontTablePart=r=new C(this._package,e);break;case i.Numbering:this.numberingPart=r=new D(this._package,e,this._parser);break;case i.Styles:this.stylesPart=r=new I(this._package,e,this._parser);break;case i.Theme:this.themePart=r=new X(this._package,e);break;case i.Footnotes:this.footnotesPart=r=new Q(this._package,e,this._parser);break;case i.Endnotes:this.endnotesPart=r=new ee(this._package,e,this._parser);break;case i.Footer:r=new $(this._package,e,this._parser);break;case i.Header:r=new U(this._package,e,this._parser);break;case i.CoreProperties:this.corePropsPart=r=new Z(this._package,e);break;case i.ExtendedProperties:this.extendedPropsPart=r=new H(this._package,e);break;case i.CustomProperties:r=new ea(this._package,e);break;case i.Settings:this.settingsPart=r=new er(this._package,e);break;case i.Comments:this.commentsPart=r=new en(this._package,e,this._parser);break;case i.CommentsExtended:this.commentsExtendedPart=r=new es(this._package,e)}if(null==r)return Promise.resolve(null);if(this.partsMap[e]=r,this.parts.push(r),await r.load(),r.rels?.length>0){let[e]=u(r.path);await Promise.all(r.rels.map(t=>this.loadRelationshipPart(d(t.target,e),t.type)))}return r}async loadDocumentImage(e,t){let r=await this.loadResource(t??this.documentPart,e,"blob");return this.blobToURL(r)}async loadNumberingImage(e){let t=await this.loadResource(this.numberingPart,e,"blob");return this.blobToURL(t)}async loadFont(e,t){let r=await this.loadResource(this.fontTablePart,e,"uint8array");return r?this.blobToURL(new Blob([function(e,t){let r=t.replace(/{|}|-/g,""),a=Array(16);for(let e=0;e<16;e++)a[16-e-1]=parseInt(r.substring(2*e,2*e+2),16);for(let t=0;t<32;t++)e[t]=e[t]^a[t%16];return e}(r,t)])):r}async loadAltChunk(e,t){return await this.loadResource(t??this.documentPart,e,"string")}blobToURL(e){if(!e)return null;if(this._options.useBase64URL)return new Promise((t,r)=>{let a=new FileReader;a.onloadend=()=>t(a.result),a.onerror=()=>r(),a.readAsDataURL(e)});return URL.createObjectURL(e)}findPartByRelId(e,t=null){var r=(t.rels??this.rels).find(t=>t.id==e);let a=t?u(t.path)[0]:"";return r?this.partsMap[d(r.target,a)]:null}getPathById(e,t){let r=e.rels.find(e=>e.id==t),[a]=u(e.path);return r?d(r.target,a):null}loadResource(e,t,r){let a=this.getPathById(e,t);return a?this._package.load(a,r):Promise.resolve(null)}}class el extends O{constructor(){super(...arguments),this.type=l.VmlElement,this.attrs={}}}function ec(e){return e.split(",")}class eh extends O{constructor(){super(...arguments),this.type=l.Comment}}class eu extends O{constructor(e){super(),this.id=e,this.type=l.CommentReference}}class ed extends O{constructor(e){super(),this.id=e,this.type=l.CommentRangeStart}}class ef extends O{constructor(e){super(),this.id=e,this.type=l.CommentRangeEnd}}var ep={shd:"inherit",color:"black",borderColor:"black",highlight:"transparent"};let em=[],eg={oMath:l.MmlMath,oMathPara:l.MmlMathParagraph,f:l.MmlFraction,func:l.MmlFunction,fName:l.MmlFunctionName,num:l.MmlNumerator,den:l.MmlDenominator,rad:l.MmlRadical,deg:l.MmlDegree,e:l.MmlBase,sSup:l.MmlSuperscript,sSub:l.MmlSubscript,sPre:l.MmlPreSubSuper,sup:l.MmlSuperArgument,sub:l.MmlSubArgument,d:l.MmlDelimiter,nary:l.MmlNary,eqArr:l.MmlEquationArray,lim:l.MmlLimit,limLow:l.MmlLimitLower,m:l.MmlMatrix,mr:l.MmlMatrixRow,box:l.MmlBox,bar:l.MmlBar,groupChr:l.MmlGroupChar};class eb{constructor(e){this.options={ignoreWidth:!1,debug:!1,...e}}parseNotes(e,t,r){var a=[];for(let n of w.elements(e,t)){let e=new r;e.id=w.attr(n,"id"),e.noteType=w.attr(n,"type"),e.children=this.parseBodyElements(n),a.push(e)}return a}parseComments(e){var t=[];for(let r of w.elements(e,"comment")){let e=new eh;e.id=w.attr(r,"id"),e.author=w.attr(r,"author"),e.initials=w.attr(r,"initials"),e.date=w.attr(r,"date"),e.children=this.parseBodyElements(r),t.push(e)}return t}parseDocumentFile(e){var t=w.element(e,"body"),r=w.element(e,"background"),a=w.element(t,"sectPr");return{type:l.Document,children:this.parseBodyElements(t),props:a?N(a,w):{},cssStyle:r?this.parseBackground(r):{}}}parseBackground(e){var t={},r=ev.colorAttr(e,"color");return r&&(t["background-color"]=r),t}parseBodyElements(e){var t=[];for(let r of w.elements(e))switch(r.localName){case"p":t.push(this.parseParagraph(r));break;case"altChunk":t.push(this.parseAltChunk(r));break;case"tbl":t.push(this.parseTable(r));break;case"sdt":t.push(...this.parseSdt(r,e=>this.parseBodyElements(e)))}return t}parseStylesFile(e){var t=[];for(let r of w.elements(e))switch(r.localName){case"style":t.push(this.parseStyle(r));break;case"docDefaults":t.push(this.parseDefaultStyles(r))}return t}parseDefaultStyles(e){var t={id:null,name:null,target:null,basedOn:null,styles:[]};for(let n of w.elements(e))switch(n.localName){case"rPrDefault":var r=w.element(n,"rPr");r&&t.styles.push({target:"span",values:this.parseDefaultProperties(r,{})});break;case"pPrDefault":var a=w.element(n,"pPr");a&&t.styles.push({target:"p",values:this.parseDefaultProperties(a,{})})}return t}parseStyle(e){var t={id:w.attr(e,"styleId"),isDefault:w.boolAttr(e,"default"),name:null,target:null,basedOn:null,styles:[],linked:null};switch(w.attr(e,"type")){case"paragraph":t.target="p";break;case"table":t.target="table";break;case"character":t.target="span"}for(let r of w.elements(e))switch(r.localName){case"basedOn":t.basedOn=w.attr(r,"val");break;case"name":t.name=w.attr(r,"val");break;case"link":t.linked=w.attr(r,"val");break;case"next":t.next=w.attr(r,"val");break;case"aliases":t.aliases=w.attr(r,"val").split(",");break;case"pPr":t.styles.push({target:"p",values:this.parseDefaultProperties(r,{})}),t.paragraphProps=B(r,w);break;case"rPr":t.styles.push({target:"span",values:this.parseDefaultProperties(r,{})}),t.runProps=z(r,w);break;case"tblPr":case"tcPr":t.styles.push({target:"td",values:this.parseDefaultProperties(r,{})});break;case"tblStylePr":for(let e of this.parseTableStyle(r))t.styles.push(e);break;case"rsid":case"qFormat":case"hidden":case"semiHidden":case"unhideWhenUsed":case"autoRedefine":case"uiPriority":break;default:this.options.debug&&console.warn(`DOCX: Unknown style element: ${r.localName}`)}return t}parseTableStyle(e){var t=[],r=w.attr(e,"type"),a="",n="";switch(r){case"firstRow":n=".first-row",a="tr.first-row td";break;case"lastRow":n=".last-row",a="tr.last-row td";break;case"firstCol":n=".first-col",a="td.first-col";break;case"lastCol":n=".last-col",a="td.last-col";break;case"band1Vert":n=":not(.no-vband)",a="td.odd-col";break;case"band2Vert":n=":not(.no-vband)",a="td.even-col";break;case"band1Horz":n=":not(.no-hband)",a="tr.odd-row";break;case"band2Horz":n=":not(.no-hband)",a="tr.even-row";break;default:return[]}for(let r of w.elements(e))switch(r.localName){case"pPr":t.push({target:`${a} p`,mod:n,values:this.parseDefaultProperties(r,{})});break;case"rPr":t.push({target:`${a} span`,mod:n,values:this.parseDefaultProperties(r,{})});break;case"tblPr":case"tcPr":t.push({target:a,mod:n,values:this.parseDefaultProperties(r,{})})}return t}parseNumberingFile(e){var t=[],r={},a=[];for(let s of w.elements(e))switch(s.localName){case"abstractNum":this.parseAbstractNumbering(s,a).forEach(e=>t.push(e));break;case"numPicBullet":a.push(this.parseNumberingPicBullet(s));break;case"num":var n=w.attr(s,"numId");r[w.elementAttr(s,"abstractNumId","val")]=n}return t.forEach(e=>e.id=r[e.id]),t}parseNumberingPicBullet(e){var t=w.element(e,"pict"),r=t&&w.element(t,"shape"),a=r&&w.element(r,"imagedata");return a?{id:w.intAttr(e,"numPicBulletId"),src:w.attr(a,"id"),style:w.attr(r,"style")}:null}parseAbstractNumbering(e,t){var r=[],a=w.attr(e,"abstractNumId");for(let n of w.elements(e))"lvl"===n.localName&&r.push(this.parseNumberingLevel(a,n,t));return r}parseNumberingLevel(e,t,r){var a={id:e,level:w.intAttr(t,"ilvl"),start:1,pStyleName:void 0,pStyle:{},rStyle:{},suff:"tab"};for(let e of w.elements(t))switch(e.localName){case"start":a.start=w.intAttr(e,"val");break;case"pPr":this.parseDefaultProperties(e,a.pStyle);break;case"rPr":this.parseDefaultProperties(e,a.rStyle);break;case"lvlPicBulletId":var n=w.intAttr(e,"val");a.bullet=r.find(e=>e?.id==n);break;case"lvlText":a.levelText=w.attr(e,"val");break;case"pStyle":a.pStyleName=w.attr(e,"val");break;case"numFmt":a.format=w.attr(e,"val");break;case"suff":a.suff=w.attr(e,"val")}return a}parseSdt(e,t){let r=w.element(e,"sdtContent");return r?t(r):[]}parseInserted(e,t){return{type:l.Inserted,children:t(e)?.children??[]}}parseDeleted(e,t){return{type:l.Deleted,children:t(e)?.children??[]}}parseAltChunk(e){return{type:l.AltChunk,children:[],id:w.attr(e,"id")}}parseParagraph(e){var t={type:l.Paragraph,children:[]};for(let r of w.elements(e))switch(r.localName){case"pPr":this.parseParagraphProperties(r,t);break;case"r":t.children.push(this.parseRun(r,t));break;case"hyperlink":t.children.push(this.parseHyperlink(r,t));break;case"smartTag":t.children.push(this.parseSmartTag(r,t));break;case"bookmarkStart":t.children.push({type:l.BookmarkStart,id:w.attr(r,"id"),name:w.attr(r,"name"),colFirst:w.intAttr(r,"colFirst"),colLast:w.intAttr(r,"colLast")});break;case"bookmarkEnd":t.children.push({type:l.BookmarkEnd,id:w.attr(r,"id")});break;case"commentRangeStart":t.children.push(new ed(w.attr(r,"id")));break;case"commentRangeEnd":t.children.push(new ef(w.attr(r,"id")));break;case"oMath":case"oMathPara":t.children.push(this.parseMathElement(r));break;case"sdt":t.children.push(...this.parseSdt(r,e=>this.parseParagraph(e).children));break;case"ins":t.children.push(this.parseInserted(r,e=>this.parseParagraph(e)));break;case"del":t.children.push(this.parseDeleted(r,e=>this.parseParagraph(e)))}return t}parseParagraphProperties(e,t){this.parseDefaultProperties(e,t.cssStyle={},null,e=>{if(R(e,t,w))return!0;switch(e.localName){case"pStyle":t.styleName=w.attr(e,"val");break;case"cnfStyle":t.className=ek.classNameOfCnfStyle(e);break;case"framePr":this.parseFrame(e,t);break;case"rPr":break;default:return!1}return!0})}parseFrame(e,t){"drop"==w.attr(e,"dropCap")&&(t.cssStyle.float="left")}parseHyperlink(e,t){var r={type:l.Hyperlink,parent:t,children:[]};for(let t of(r.anchor=w.attr(e,"anchor"),r.id=w.attr(e,"id"),w.elements(e)))"r"===t.localName&&r.children.push(this.parseRun(t,r));return r}parseSmartTag(e,t){var r={type:l.SmartTag,parent:t,children:[]},a=w.attr(e,"uri"),n=w.attr(e,"element");for(let t of(a&&(r.uri=a),n&&(r.element=n),w.elements(e)))"r"===t.localName&&r.children.push(this.parseRun(t,r));return r}parseRun(e,t){var r={type:l.Run,parent:t,children:[]};for(let t of w.elements(e))switch((t=this.checkAlternateContent(t)).localName){case"t":r.children.push({type:l.Text,text:t.textContent});break;case"delText":r.children.push({type:l.DeletedText,text:t.textContent});break;case"commentReference":r.children.push(new eu(w.attr(t,"id")));break;case"fldSimple":r.children.push({type:l.SimpleField,instruction:w.attr(t,"instr"),lock:w.boolAttr(t,"lock",!1),dirty:w.boolAttr(t,"dirty",!1)});break;case"instrText":r.fieldRun=!0,r.children.push({type:l.Instruction,text:t.textContent});break;case"fldChar":r.fieldRun=!0,r.children.push({type:l.ComplexField,charType:w.attr(t,"fldCharType"),lock:w.boolAttr(t,"lock",!1),dirty:w.boolAttr(t,"dirty",!1)});break;case"noBreakHyphen":r.children.push({type:l.NoBreakHyphen});break;case"br":r.children.push({type:l.Break,break:w.attr(t,"type")||"textWrapping"});break;case"lastRenderedPageBreak":r.children.push({type:l.Break,break:"lastRenderedPageBreak"});break;case"sym":r.children.push({type:l.Symbol,font:h(w.attr(t,"font")),char:w.attr(t,"char")});break;case"tab":r.children.push({type:l.Tab});break;case"footnoteReference":r.children.push({type:l.FootnoteReference,id:w.attr(t,"id")});break;case"endnoteReference":r.children.push({type:l.EndnoteReference,id:w.attr(t,"id")});break;case"drawing":let e=this.parseDrawing(t);e&&(r.children=[e]);break;case"pict":r.children.push(this.parseVmlPicture(t));break;case"rPr":this.parseRunProperties(t,r)}return r}parseMathElement(e){let t=`${e.localName}Pr`,r={type:eg[e.localName],children:[]};for(let n of w.elements(e))if(eg[n.localName])r.children.push(this.parseMathElement(n));else if("r"==n.localName){var a=this.parseRun(n);a.type=l.MmlRun,r.children.push(a)}else n.localName==t&&(r.props=this.parseMathProperies(n));return r}parseMathProperies(e){let t={};for(let r of w.elements(e))switch(r.localName){case"chr":t.char=w.attr(r,"val");break;case"vertJc":t.verticalJustification=w.attr(r,"val");break;case"pos":t.position=w.attr(r,"val");break;case"degHide":t.hideDegree=w.boolAttr(r,"val");break;case"begChr":t.beginChar=w.attr(r,"val");break;case"endChr":t.endChar=w.attr(r,"val")}return t}parseRunProperties(e,t){this.parseDefaultProperties(e,t.cssStyle={},null,e=>{switch(e.localName){case"rStyle":t.styleName=w.attr(e,"val");break;case"vertAlign":t.verticalAlign=ek.valueOfVertAlign(e,!0);break;default:return!1}return!0})}parseVmlPicture(e){let t={type:l.VmlPicture,children:[]};for(let r of w.elements(e)){let e=function e(t,r){var a,n=new el;switch(t.localName){case"rect":n.tagName="rect",Object.assign(n.attrs,{width:"100%",height:"100%"});break;case"oval":n.tagName="ellipse",Object.assign(n.attrs,{cx:"50%",cy:"50%",rx:"50%",ry:"50%"});break;case"line":n.tagName="line";break;case"shape":n.tagName="g";break;case"textbox":n.tagName="foreignObject",Object.assign(n.attrs,{width:"100%",height:"100%"});break;default:return null}for(let e of w.attrs(t))switch(e.localName){case"style":n.cssStyleText=e.value;break;case"fillcolor":n.attrs.fill=e.value;break;case"from":let[t,r]=ec(e.value);Object.assign(n.attrs,{x1:t,y1:r});break;case"to":let[a,s]=ec(e.value);Object.assign(n.attrs,{x2:a,y2:s})}for(let i of w.elements(t))switch(i.localName){case"stroke":Object.assign(n.attrs,(a=i,{stroke:w.attr(a,"color"),"stroke-width":w.lengthAttr(a,"weight",y.Emu)??"1px"}));break;case"fill":var s=void 0;Object.assign(n.attrs,{});break;case"imagedata":n.tagName="image",Object.assign(n.attrs,{width:"100%",height:"100%"}),n.imageHref={id:w.attr(i,"id"),title:w.attr(i,"title")};break;case"txbxContent":n.children.push(...r.parseBodyElements(i));break;default:let t=e(i,r);t&&n.children.push(t)}return n}(r,this);e&&t.children.push(e)}return t}checkAlternateContent(e){if("AlternateContent"!=e.localName)return e;var t=w.element(e,"Choice");if(t){var r=w.attr(t,"Requires"),a=e.lookupNamespaceURI(r);if(em.includes(a))return t.firstElementChild}return w.element(e,"Fallback")?.firstElementChild}parseDrawing(e){for(var t of w.elements(e))switch(t.localName){case"inline":case"anchor":return this.parseDrawingWrapper(t)}}parseDrawingWrapper(e){var t={type:l.Drawing,children:[],cssStyle:{}},r="anchor"==e.localName;let a=null,n=w.boolAttr(e,"simplePos");w.boolAttr(e,"behindDoc");let s={relative:"page",align:"left",offset:"0"},i={relative:"page",align:"top",offset:"0"};for(var o of w.elements(e))switch(o.localName){case"simplePos":n&&(s.offset=w.lengthAttr(o,"x",y.Emu),i.offset=w.lengthAttr(o,"y",y.Emu));break;case"extent":t.cssStyle.width=w.lengthAttr(o,"cx",y.Emu),t.cssStyle.height=w.lengthAttr(o,"cy",y.Emu);break;case"positionH":case"positionV":if(!n){let e="positionH"==o.localName?s:i;var c=w.element(o,"align"),h=w.element(o,"posOffset");e.relative=w.attr(o,"relativeFrom")??e.relative,c&&(e.align=c.textContent),h&&(e.offset=v(h.textContent,y.Emu))}break;case"wrapTopAndBottom":a="wrapTopAndBottom";break;case"wrapNone":a="wrapNone";break;case"graphic":var u=this.parseGraphic(o);u&&t.children.push(u)}return"wrapTopAndBottom"==a?(t.cssStyle.display="block",s.align&&(t.cssStyle["text-align"]=s.align,t.cssStyle.width="100%")):"wrapNone"==a?(t.cssStyle.display="block",t.cssStyle.position="relative",t.cssStyle.width="0px",t.cssStyle.height="0px",s.offset&&(t.cssStyle.left=s.offset),i.offset&&(t.cssStyle.top=i.offset)):r&&("left"==s.align||"right"==s.align)&&(t.cssStyle.float=s.align),t}parseGraphic(e){var t=w.element(e,"graphicData");for(let e of w.elements(t))if("pic"===e.localName)return this.parsePicture(e);return null}parsePicture(e){var t={type:l.Image,src:"",cssStyle:{}},r=w.element(e,"blipFill"),a=w.element(r,"blip"),n=w.element(r,"srcRect");t.src=w.attr(a,"embed"),n&&(t.srcRect=[w.intAttr(n,"l",0)/1e5,w.intAttr(n,"t",0)/1e5,w.intAttr(n,"r",0)/1e5,w.intAttr(n,"b",0)/1e5]);var s=w.element(e,"spPr"),i=w.element(s,"xfrm");if(t.cssStyle.position="relative",i)for(var o of(t.rotation=w.intAttr(i,"rot",0)/6e4,w.elements(i)))switch(o.localName){case"ext":t.cssStyle.width=w.lengthAttr(o,"cx",y.Emu),t.cssStyle.height=w.lengthAttr(o,"cy",y.Emu);break;case"off":t.cssStyle.left=w.lengthAttr(o,"x",y.Emu),t.cssStyle.top=w.lengthAttr(o,"y",y.Emu)}return t}parseTable(e){var t={type:l.Table,children:[]};for(let r of w.elements(e))switch(r.localName){case"tr":t.children.push(this.parseTableRow(r));break;case"tblGrid":t.columns=this.parseTableColumns(r);break;case"tblPr":this.parseTableProperties(r,t)}return t}parseTableColumns(e){var t=[];for(let r of w.elements(e))"gridCol"===r.localName&&t.push({width:w.lengthAttr(r,"w")});return t}parseTableProperties(e,t){switch(t.cssStyle={},t.cellStyle={},this.parseDefaultProperties(e,t.cssStyle,t.cellStyle,e=>{switch(e.localName){case"tblStyle":t.styleName=w.attr(e,"val");break;case"tblLook":t.className=ek.classNameOftblLook(e);break;case"tblpPr":this.parseTablePosition(e,t);break;case"tblStyleColBandSize":t.colBandSize=w.intAttr(e,"val");break;case"tblStyleRowBandSize":t.rowBandSize=w.intAttr(e,"val");break;case"hidden":t.cssStyle.display="none";break;default:return!1}return!0}),t.cssStyle["text-align"]){case"center":delete t.cssStyle["text-align"],t.cssStyle["margin-left"]="auto",t.cssStyle["margin-right"]="auto";break;case"right":delete t.cssStyle["text-align"],t.cssStyle["margin-left"]="auto"}}parseTablePosition(e,t){var r=w.lengthAttr(e,"topFromText"),a=w.lengthAttr(e,"bottomFromText"),n=w.lengthAttr(e,"rightFromText"),s=w.lengthAttr(e,"leftFromText");t.cssStyle.float="left",t.cssStyle["margin-bottom"]=ek.addSize(t.cssStyle["margin-bottom"],a),t.cssStyle["margin-left"]=ek.addSize(t.cssStyle["margin-left"],s),t.cssStyle["margin-right"]=ek.addSize(t.cssStyle["margin-right"],n),t.cssStyle["margin-top"]=ek.addSize(t.cssStyle["margin-top"],r)}parseTableRow(e){var t={type:l.Row,children:[]};for(let r of w.elements(e))switch(r.localName){case"tc":t.children.push(this.parseTableCell(r));break;case"trPr":case"tblPrEx":this.parseTableRowProperties(r,t)}return t}parseTableRowProperties(e,t){t.cssStyle=this.parseDefaultProperties(e,{},null,e=>{switch(e.localName){case"cnfStyle":t.className=ek.classNameOfCnfStyle(e);break;case"tblHeader":t.isHeader=w.boolAttr(e,"val");break;case"gridBefore":t.gridBefore=w.intAttr(e,"val");break;case"gridAfter":t.gridAfter=w.intAttr(e,"val");break;default:return!1}return!0})}parseTableCell(e){var t={type:l.Cell,children:[]};for(let r of w.elements(e))switch(r.localName){case"tbl":t.children.push(this.parseTable(r));break;case"p":t.children.push(this.parseParagraph(r));break;case"tcPr":this.parseTableCellProperties(r,t)}return t}parseTableCellProperties(e,t){t.cssStyle=this.parseDefaultProperties(e,{},null,e=>{switch(e.localName){case"gridSpan":t.span=w.intAttr(e,"val",null);break;case"vMerge":t.verticalMerge=w.attr(e,"val")??"continue";break;case"cnfStyle":t.className=ek.classNameOfCnfStyle(e);break;default:return!1}return!0}),this.parseTableCellVerticalText(e,t)}parseTableCellVerticalText(e,t){let r={btLr:{writingMode:"vertical-rl",transform:"rotate(180deg)"},lrTb:{writingMode:"vertical-lr",transform:"none"},tbRl:{writingMode:"vertical-rl",transform:"none"}};for(let a of w.elements(e))if("textDirection"===a.localName){let e=r[w.attr(a,"val")]||{writingMode:"horizontal-tb"};t.cssStyle["writing-mode"]=e.writingMode,t.cssStyle.transform=e.transform}}parseDefaultProperties(e,t=null,r=null,a=null){for(let n of(t=t||{},w.elements(e)))if(!a?.(n))switch(n.localName){case"jc":t["text-align"]=ek.valueOfJc(n);break;case"textAlignment":t["vertical-align"]=ek.valueOfTextAlignment(n);break;case"color":t.color=ev.colorAttr(n,"val",null,ep.color);break;case"sz":t["font-size"]=t["min-height"]=w.lengthAttr(n,"val",y.FontSize);break;case"shd":t["background-color"]=ev.colorAttr(n,"fill",null,ep.shd);break;case"highlight":t["background-color"]=ev.colorAttr(n,"val",null,ep.highlight);break;case"vertAlign":break;case"position":t.verticalAlign=w.lengthAttr(n,"val",y.FontSize);break;case"tcW":if(this.options.ignoreWidth)break;case"tblW":t.width=ek.valueOfSize(n,"w");break;case"trHeight":this.parseTrHeight(n,t);break;case"strike":t["text-decoration"]=w.boolAttr(n,"val",!0)?"line-through":"none";break;case"b":t["font-weight"]=w.boolAttr(n,"val",!0)?"bold":"normal";break;case"i":t["font-style"]=w.boolAttr(n,"val",!0)?"italic":"normal";break;case"caps":t["text-transform"]=w.boolAttr(n,"val",!0)?"uppercase":"none";break;case"smallCaps":t["font-variant"]=w.boolAttr(n,"val",!0)?"small-caps":"none";break;case"u":this.parseUnderline(n,t);break;case"ind":case"tblInd":this.parseIndentation(n,t);break;case"rFonts":this.parseFont(n,t);break;case"tblBorders":this.parseBorderProperties(n,r||t);break;case"tblCellSpacing":t["border-spacing"]=ek.valueOfMargin(n),t["border-collapse"]="separate";break;case"pBdr":case"tcBorders":this.parseBorderProperties(n,t);break;case"bdr":t.border=ek.valueOfBorder(n);break;case"vanish":w.boolAttr(n,"val",!0)&&(t.display="none");break;case"kern":case"noWrap":case"bCs":case"iCs":case"szCs":case"tabs":case"outlineLvl":case"contextualSpacing":case"tblStyleColBandSize":case"tblStyleRowBandSize":case"webHidden":case"pageBreakBefore":case"suppressLineNumbers":case"keepLines":case"keepNext":case"widowControl":case"bidi":case"rtl":case"noProof":break;case"tblCellMar":case"tcMar":this.parseMarginProperties(n,r||t);break;case"tblLayout":t["table-layout"]=ek.valueOfTblLayout(n);break;case"vAlign":t["vertical-align"]=ek.valueOfTextAlignment(n);break;case"spacing":"pPr"==e.localName&&this.parseSpacing(n,t);break;case"wordWrap":w.boolAttr(n,"val")&&(t["overflow-wrap"]="break-word");break;case"suppressAutoHyphens":t.hyphens=w.boolAttr(n,"val",!0)?"none":"auto";break;case"lang":t.$lang=w.attr(n,"val");break;case"rtl":case"bidi":w.boolAttr(n,"val",!0)&&(t.direction="rtl");break;default:this.options.debug&&console.warn(`DOCX: Unknown document element: ${e.localName}.${n.localName}`)}return t}parseUnderline(e,t){var r=w.attr(e,"val");if(null!=r){switch(r){case"dash":case"dashDotDotHeavy":case"dashDotHeavy":case"dashedHeavy":case"dashLong":case"dashLongHeavy":case"dotDash":case"dotDotDash":t["text-decoration"]="underline dashed";break;case"dotted":case"dottedHeavy":t["text-decoration"]="underline dotted";break;case"double":t["text-decoration"]="underline double";break;case"single":case"thick":case"words":t["text-decoration"]="underline";break;case"wave":case"wavyDouble":case"wavyHeavy":t["text-decoration"]="underline wavy";break;case"none":t["text-decoration"]="none"}var a=ev.colorAttr(e,"color");a&&(t["text-decoration-color"]=a)}}parseFont(e,t){var r=[w.attr(e,"ascii"),ek.themeValue(e,"asciiTheme"),w.attr(e,"eastAsia")].filter(e=>e).map(e=>h(e));r.length>0&&(t["font-family"]=[...new Set(r)].join(", "))}parseIndentation(e,t){var r=w.lengthAttr(e,"firstLine"),a=w.lengthAttr(e,"hanging"),n=w.lengthAttr(e,"left"),s=w.lengthAttr(e,"start"),i=w.lengthAttr(e,"right"),o=w.lengthAttr(e,"end");r&&(t["text-indent"]=r),a&&(t["text-indent"]=`-${a}`),(n||s)&&(t["margin-inline-start"]=n||s),(i||o)&&(t["margin-inline-end"]=i||o)}parseSpacing(e,t){var r=w.lengthAttr(e,"before"),a=w.lengthAttr(e,"after"),n=w.intAttr(e,"line",null),s=w.attr(e,"lineRule");if(r&&(t["margin-top"]=r),a&&(t["margin-bottom"]=a),null!==n)switch(s){case"auto":t["line-height"]=`${(n/240).toFixed(2)}`;break;case"atLeast":t["line-height"]=`calc(100% + ${n/20}pt)`;break;default:t["line-height"]=t["min-height"]=`${n/20}pt`}}parseMarginProperties(e,t){for(let r of w.elements(e))switch(r.localName){case"left":t["padding-left"]=ek.valueOfMargin(r);break;case"right":t["padding-right"]=ek.valueOfMargin(r);break;case"top":t["padding-top"]=ek.valueOfMargin(r);break;case"bottom":t["padding-bottom"]=ek.valueOfMargin(r)}}parseTrHeight(e,t){w.attr(e,"hRule"),t.height=w.lengthAttr(e,"val")}parseBorderProperties(e,t){for(let r of w.elements(e))switch(r.localName){case"start":case"left":t["border-left"]=ek.valueOfBorder(r);break;case"end":case"right":t["border-right"]=ek.valueOfBorder(r);break;case"top":t["border-top"]=ek.valueOfBorder(r);break;case"bottom":t["border-bottom"]=ek.valueOfBorder(r)}}}let ey=["black","blue","cyan","darkBlue","darkCyan","darkGray","darkGreen","darkMagenta","darkRed","darkYellow","green","lightGray","magenta","none","red","white","yellow"];class ev{static colorAttr(e,t,r=null,a="black"){var n=w.attr(e,t);if(n)return"auto"==n?a:ey.includes(n)?n:`#${n}`;var s=w.attr(e,"themeColor");return s?`var(--docx-${s}-color)`:r}}class ek{static themeValue(e,t){var r=w.attr(e,t);return r?`var(--docx-${r}-font)`:null}static valueOfSize(e,t){var r=y.Dxa;switch(w.attr(e,"type")){case"dxa":break;case"pct":r=y.Percent;break;case"auto":return"auto"}return w.lengthAttr(e,t,r)}static valueOfMargin(e){return w.lengthAttr(e,"w")}static valueOfBorder(e){var t=ek.parseBorderType(w.attr(e,"val"));if("none"==t)return"none";var r=ev.colorAttr(e,"color"),a=w.lengthAttr(e,"sz",y.Border);return`${a} ${t} ${"auto"==r?ep.borderColor:r}`}static parseBorderType(e){switch(e){case"single":case"dashDotStroked":case"thick":case"thickThinLargeGap":case"thickThinMediumGap":case"thickThinSmallGap":case"thinThickLargeGap":case"thinThickMediumGap":case"thinThickSmallGap":case"thinThickThinLargeGap":case"thinThickThinMediumGap":case"thinThickThinSmallGap":case"threeDEmboss":case"threeDEngrave":case"wave":break;case"dashed":case"dashSmallGap":return"dashed";case"dotDash":case"dotDotDash":case"dotted":return"dotted";case"double":case"doubleWave":case"triple":return"double";case"inset":return"inset";case"nil":case"none":return"none";case"outset":return"outset"}return"solid"}static valueOfTblLayout(e){return"fixed"==w.attr(e,"val")?"fixed":"auto"}static classNameOfCnfStyle(e){let t=w.attr(e,"val");return["first-row","last-row","first-col","last-col","odd-col","even-col","odd-row","even-row","ne-cell","nw-cell","se-cell","sw-cell"].filter((e,r)=>"1"==t[r]).join(" ")}static valueOfJc(e){var t=w.attr(e,"val");switch(t){case"start":case"left":return"left";case"center":return"center";case"end":case"right":return"right";case"both":return"justify"}return t}static valueOfVertAlign(e,t=!1){var r=w.attr(e,"val");switch(r){case"subscript":return"sub";case"superscript":return t?"sup":"super"}return t?null:r}static valueOfTextAlignment(e){var t=w.attr(e,"val");switch(t){case"auto":case"baseline":return"baseline";case"top":return"top";case"center":return"middle";case"bottom":return"bottom"}return t}static addSize(e,t){return null==e?t:null==t?e:`calc(${e} + ${t})`}static classNameOftblLook(e){let t=w.hexAttr(e,"val",0),r="";return(w.boolAttr(e,"firstRow")||32&t)&&(r+=" first-row"),(w.boolAttr(e,"lastRow")||64&t)&&(r+=" last-row"),(w.boolAttr(e,"firstColumn")||128&t)&&(r+=" first-col"),(w.boolAttr(e,"lastColumn")||256&t)&&(r+=" last-col"),(w.boolAttr(e,"noHBand")||512&t)&&(r+=" no-hband"),(w.boolAttr(e,"noVBand")||1024&t)&&(r+=" no-vband"),r.trim()}}let e_={pos:0,leader:"none",style:"left"};function ew(e){return parseFloat(e)}let eS={svg:"http://www.w3.org/2000/svg",mathML:"http://www.w3.org/1998/Math/MathML"};class ex{constructor(e){this.htmlDocument=e,this.className="docx",this.styleMap={},this.currentPart=null,this.tableVerticalMerges=[],this.currentVerticalMerge=null,this.tableCellPositions=[],this.currentCellPosition=null,this.footnoteMap={},this.endnoteMap={},this.currentEndnoteIds=[],this.usedHederFooterParts=[],this.currentTabs=[],this.commentMap={},this.tasks=[],this.postRenderTasks=[]}async render(e,t,r=null,a){this.document=e,this.options=a,this.className=a.className,this.rootSelector=a.inWrapper?`.${this.className}-wrapper`:":root",this.styleMap=null,this.tasks=[],this.options.renderComments&&globalThis.Highlight&&(this.commentHighlight=new Highlight),eC(r=r||t),eC(t),r.appendChild(this.createComment("docxjs library predefined styles")),r.appendChild(this.renderDefaultStyle()),e.themePart&&(r.appendChild(this.createComment("docxjs document theme values")),this.renderTheme(e.themePart,r)),null!=e.stylesPart&&(this.styleMap=this.processStyles(e.stylesPart.styles),r.appendChild(this.createComment("docxjs document styles")),r.appendChild(this.renderStyles(e.stylesPart.styles))),e.numberingPart&&(this.prodessNumberings(e.numberingPart.domNumberings),r.appendChild(this.createComment("docxjs document numbering styles")),r.appendChild(this.renderNumbering(e.numberingPart.domNumberings,r))),e.footnotesPart&&(this.footnoteMap=f(e.footnotesPart.notes,e=>e.id)),e.endnotesPart&&(this.endnoteMap=f(e.endnotesPart.notes,e=>e.id)),e.settingsPart&&(this.defaultTabSize=e.settingsPart.settings?.defaultTabStop),!a.ignoreFonts&&e.fontTablePart&&this.renderFontTable(e.fontTablePart,r);var n=this.renderSections(e.documentPart.body);this.options.inWrapper?t.appendChild(this.renderWrapper(n)):eE(t,n),this.commentHighlight&&a.renderComments&&CSS.highlights.set(`${this.className}-comments`,this.commentHighlight),this.postRenderTasks.forEach(e=>e()),await Promise.allSettled(this.tasks),this.refreshTabStops()}renderTheme(e,t){let r={},a=e.theme?.fontScheme;a&&(a.majorFont&&(r["--docx-majorHAnsi-font"]=a.majorFont.latinTypeface),a.minorFont&&(r["--docx-minorHAnsi-font"]=a.minorFont.latinTypeface));let n=e.theme?.colorScheme;if(n)for(let[e,t]of Object.entries(n.colors))r[`--docx-${e}-color`]=`#${t}`;let s=this.styleToString(`.${this.className}`,r);t.appendChild(this.createStyleElement(s))}renderFontTable(e,t){for(let r of e.fonts)for(let e of r.embedFontRefs)this.tasks.push(this.document.loadFont(e.id,e.key).then(a=>{let n={"font-family":h(r.name),src:`url(${a})`};("bold"==e.type||"boldItalic"==e.type)&&(n["font-weight"]="bold"),("italic"==e.type||"boldItalic"==e.type)&&(n["font-style"]="italic");let s=this.styleToString("@font-face",n);t.appendChild(this.createComment(`docxjs ${r.name} font`)),t.appendChild(this.createStyleElement(s))}))}processStyleName(e){return e?`${this.className}_${e?.replace(/[ .]+/g,"-").replace(/[&]+/g,"and").toLowerCase()}`:this.className}processStyles(e){let t=f(e.filter(e=>null!=e.id),e=>e.id);for(let a of e.filter(e=>e.basedOn)){var r=t[a.basedOn];if(r)for(let e of(a.paragraphProps=m(a.paragraphProps,r.paragraphProps),a.runProps=m(a.runProps,r.runProps),r.styles)){let t=a.styles.find(t=>t.target==e.target);t?this.copyStyleProperties(e.values,t.values):a.styles.push({...e,values:{...e.values}})}else this.options.debug&&console.warn(`Can't find base style ${a.basedOn}`)}for(let t of e)t.cssName=this.processStyleName(t.id);return t}prodessNumberings(e){for(let t of e.filter(e=>e.pStyleName)){let e=this.findStyle(t.pStyleName);e?.paragraphProps?.numbering&&(e.paragraphProps.numbering.level=t.level)}}processElement(e){if(e.children)for(var t of e.children)t.parent=e,t.type==l.Table?this.processTable(t):this.processElement(t)}processTable(e){for(var t of e.children)for(var r of t.children)r.cssStyle=this.copyStyleProperties(e.cellStyle,r.cssStyle,["border-left","border-right","border-top","border-bottom","padding-left","padding-right","padding-top","padding-bottom"]),this.processElement(r)}copyStyleProperties(e,t,r=null){if(!e)return t;for(var a of(null==t&&(t={}),null==r&&(r=Object.getOwnPropertyNames(e)),r))e.hasOwnProperty(a)&&!t.hasOwnProperty(a)&&(t[a]=e[a]);return t}createPageElement(e,t){var r=this.createElement("section",{className:e});return t&&(t.pageMargins&&(r.style.paddingLeft=t.pageMargins.left,r.style.paddingRight=t.pageMargins.right,r.style.paddingTop=t.pageMargins.top,r.style.paddingBottom=t.pageMargins.bottom),t.pageSize&&(this.options.ignoreWidth||(r.style.width=t.pageSize.width),this.options.ignoreHeight||(r.style.minHeight=t.pageSize.height))),r}createSectionContent(e){var t=this.createElement("article");return e.columns&&e.columns.numberOfColumns&&(t.style.columnCount=`${e.columns.numberOfColumns}`,t.style.columnGap=e.columns.space,e.columns.separator&&(t.style.columnRule="1px solid black")),t}renderSections(e){let t=[];this.processElement(e);let r=this.splitBySection(e.children,e.props),a=this.groupByPageBreaks(r),n=null;for(let r=0,i=a.length;r<i;r++){this.currentFootnoteIds=[];let o=a[r][0].sectProps,l=this.createPageElement(this.className,o);for(let i of(this.renderStyleValues(e.cssStyle,l),this.options.renderHeaders&&this.renderHeaderFooter(o.headerRefs,o,t.length,n!=o,l),a[r])){var s=this.createSectionContent(i.sectProps);this.renderElements(i.elements,s),l.appendChild(s),o=i.sectProps}this.options.renderFootnotes&&this.renderNotes(this.currentFootnoteIds,this.footnoteMap,l),this.options.renderEndnotes&&r==i-1&&this.renderNotes(this.currentEndnoteIds,this.endnoteMap,l),this.options.renderFooters&&this.renderHeaderFooter(o.footerRefs,o,t.length,n!=o,l),t.push(l),n=o}return t}renderHeaderFooter(e,t,r,a,n){if(e){var s=(t.titlePage&&a?e.find(e=>"first"==e.type):null)??(r%2==1?e.find(e=>"even"==e.type):null)??e.find(e=>"default"==e.type),i=s&&this.document.findPartByRelId(s.id,this.document.documentPart);if(i){this.currentPart=i,this.usedHederFooterParts.includes(i.path)||(this.processElement(i.rootElement),this.usedHederFooterParts.push(i.path));let[e]=this.renderElements([i.rootElement],n);t?.pageMargins&&(i.rootElement.type===l.Header?(e.style.marginTop=`calc(${t.pageMargins.header} - ${t.pageMargins.top})`,e.style.minHeight=`calc(${t.pageMargins.top} - ${t.pageMargins.header})`):i.rootElement.type===l.Footer&&(e.style.marginBottom=`calc(${t.pageMargins.footer} - ${t.pageMargins.bottom})`,e.style.minHeight=`calc(${t.pageMargins.bottom} - ${t.pageMargins.footer})`)),this.currentPart=null}}}isPageBreakElement(e){return e.type==l.Break&&("lastRenderedPageBreak"==e.break?!this.options.ignoreLastRenderedPageBreak:"page"==e.break)}isPageBreakSection(e,t){return!!e&&!!t&&(e.pageSize?.orientation!=t.pageSize?.orientation||e.pageSize?.width!=t.pageSize?.width||e.pageSize?.height!=t.pageSize?.height)}splitBySection(e,t){var r={sectProps:null,elements:[],pageBreak:!1},a=[r];for(let t of e){if(t.type==l.Paragraph){let e=this.findStyle(t.styleName);e?.paragraphProps?.pageBreakBefore&&(r.sectProps=n,r.pageBreak=!0,r={sectProps:null,elements:[],pageBreak:!1},a.push(r))}if(r.elements.push(t),t.type==l.Paragraph){var n=t.sectionProps,s=-1,i=-1;if(this.options.breakPages&&t.children&&(s=t.children.findIndex(e=>-1!=(i=e.children?.findIndex(this.isPageBreakElement.bind(this))??-1))),(n||-1!=s)&&(r.sectProps=n,r.pageBreak=-1!=s,r={sectProps:null,elements:[],pageBreak:!1},a.push(r)),-1!=s){let e=t.children[s],a=i<e.children.length-1;if(s<t.children.length-1||a){var o=t.children,c={...t,children:o.slice(s)};if(t.children=o.slice(0,s),r.elements.push(c),a){let r=e.children,a={...e,children:r.slice(0,i)};t.children.push(a),e.children=r.slice(i)}}}}}let h=null;for(let e=a.length-1;e>=0;e--)null==a[e].sectProps?a[e].sectProps=h??t:h=a[e].sectProps;return a}groupByPageBreaks(e){let t,r=[],a=[r];for(let n of e)r.push(n),(this.options.ignoreLastRenderedPageBreak||n.pageBreak||this.isPageBreakSection(t,n.sectProps))&&a.push(r=[]),t=n.sectProps;return a.filter(e=>e.length>0)}renderWrapper(e){return this.createElement("div",{className:`${this.className}-wrapper`},e)}renderDefaultStyle(){var e=this.className,t=`
11
+ .${e}-wrapper { background: gray; padding: 30px; padding-bottom: 0px; display: flex; flex-flow: column; align-items: center; }
12
+ .${e}-wrapper>section.${e} { background: white; box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); margin-bottom: 30px; }`;this.options.hideWrapperOnPrint&&(t=`@media not print { ${t} }`);var r=`${t}
13
+ .${e} { color: black; hyphens: auto; text-underline-position: from-font; }
14
+ section.${e} { box-sizing: border-box; display: flex; flex-flow: column nowrap; position: relative; overflow: hidden; }
15
+ section.${e}>article { margin-bottom: auto; z-index: 1; }
16
+ section.${e}>footer { z-index: 1; }
17
+ .${e} table { border-collapse: collapse; }
18
+ .${e} table td, .${e} table th { vertical-align: top; }
19
+ .${e} p { margin: 0pt; min-height: 1em; }
20
+ .${e} span { white-space: pre-wrap; overflow-wrap: break-word; }
21
+ .${e} a { color: inherit; text-decoration: inherit; }
22
+ .${e} svg { fill: transparent; }
23
+ `;return this.options.renderComments&&(r+=`
24
+ .${e}-comment-ref { cursor: default; }
25
+ .${e}-comment-popover { display: none; z-index: 1000; padding: 0.5rem; background: white; position: absolute; box-shadow: 0 0 0.25rem rgba(0, 0, 0, 0.25); width: 30ch; }
26
+ .${e}-comment-ref:hover~.${e}-comment-popover { display: block; }
27
+ .${e}-comment-author,.${e}-comment-date { font-size: 0.875rem; color: #888; }
28
+ `),this.createStyleElement(r)}renderNumbering(e,t){var r="",a=[];for(var n of e){var s=`p.${this.numberingClass(n.id,n.level)}`,i="none";if(n.bullet){let e=`--${this.className}-${n.bullet.src}`.toLowerCase();r+=this.styleToString(`${s}:before`,{content:"' '",display:"inline-block",background:`var(${e})`},n.bullet.style),this.tasks.push(this.document.loadNumberingImage(n.bullet.src).then(r=>{var a=`${this.rootSelector} { ${e}: url(${r}) }`;t.appendChild(this.createStyleElement(a))}))}else if(n.levelText){let e=this.numberingCounter(n.id,n.level),t=e+" "+(n.start-1);n.level>0&&(r+=this.styleToString(`p.${this.numberingClass(n.id,n.level-1)}`,{"counter-set":t})),a.push(t),r+=this.styleToString(`${s}:before`,{content:this.levelTextToContent(n.levelText,n.suff,n.id,this.numFormatToCssValue(n.format)),"counter-increment":e,...n.rStyle})}else i=this.numFormatToCssValue(n.format);r+=this.styleToString(s,{display:"list-item","list-style-position":"inside","list-style-type":i,...n.pStyle})}return a.length>0&&(r+=this.styleToString(this.rootSelector,{"counter-reset":a.join(" ")})),this.createStyleElement(r)}renderStyles(e){var t="";let r=this.styleMap,a=f(e.filter(e=>e.isDefault),e=>e.target);for(let o of e){var n=o.styles;if(o.linked){var s=o.linked&&r[o.linked];s?n=n.concat(s.styles):this.options.debug&&console.warn(`Can't find linked style ${o.linked}`)}for(let e of n){var i=`${o.target??""}.${o.cssName}`;o.target!=e.target&&(i+=` ${e.target}`),a[o.target]==o&&(i=`.${this.className} ${o.target}, `+i),t+=this.styleToString(i,e.values)}}return this.createStyleElement(t)}renderNotes(e,t,r){var a=e.map(e=>t[e]).filter(e=>e);if(a.length>0){var n=this.createElement("ol",null,this.renderElements(a));r.appendChild(n)}}renderElement(e){switch(e.type){case l.Paragraph:return this.renderParagraph(e);case l.BookmarkStart:return this.renderBookmarkStart(e);case l.BookmarkEnd:break;case l.Run:return this.renderRun(e);case l.Table:return this.renderTable(e);case l.Row:return this.renderTableRow(e);case l.Cell:return this.renderTableCell(e);case l.Hyperlink:return this.renderHyperlink(e);case l.SmartTag:return this.renderSmartTag(e);case l.Drawing:return this.renderDrawing(e);case l.Image:return this.renderImage(e);case l.Text:case l.Text:return this.renderText(e);case l.DeletedText:return this.renderDeletedText(e);case l.Tab:return this.renderTab(e);case l.Symbol:return this.renderSymbol(e);case l.Break:return this.renderBreak(e);case l.Footer:return this.renderContainer(e,"footer");case l.Header:return this.renderContainer(e,"header");case l.Footnote:case l.Endnote:return this.renderContainer(e,"li");case l.FootnoteReference:return this.renderFootnoteReference(e);case l.EndnoteReference:return this.renderEndnoteReference(e);case l.NoBreakHyphen:return this.createElement("wbr");case l.VmlPicture:return this.renderVmlPicture(e);case l.VmlElement:return this.renderVmlElement(e);case l.MmlMath:return this.renderContainerNS(e,eS.mathML,"math",{xmlns:eS.mathML});case l.MmlMathParagraph:return this.renderContainer(e,"span");case l.MmlFraction:return this.renderContainerNS(e,eS.mathML,"mfrac");case l.MmlBase:return this.renderContainerNS(e,eS.mathML,e.parent.type==l.MmlMatrixRow?"mtd":"mrow");case l.MmlNumerator:case l.MmlDenominator:case l.MmlFunction:case l.MmlLimit:case l.MmlBox:return this.renderContainerNS(e,eS.mathML,"mrow");case l.MmlGroupChar:return this.renderMmlGroupChar(e);case l.MmlLimitLower:return this.renderContainerNS(e,eS.mathML,"munder");case l.MmlMatrix:return this.renderContainerNS(e,eS.mathML,"mtable");case l.MmlMatrixRow:return this.renderContainerNS(e,eS.mathML,"mtr");case l.MmlRadical:return this.renderMmlRadical(e);case l.MmlSuperscript:return this.renderContainerNS(e,eS.mathML,"msup");case l.MmlSubscript:return this.renderContainerNS(e,eS.mathML,"msub");case l.MmlDegree:case l.MmlSuperArgument:case l.MmlSubArgument:return this.renderContainerNS(e,eS.mathML,"mn");case l.MmlFunctionName:return this.renderContainerNS(e,eS.mathML,"ms");case l.MmlDelimiter:return this.renderMmlDelimiter(e);case l.MmlRun:return this.renderMmlRun(e);case l.MmlNary:return this.renderMmlNary(e);case l.MmlPreSubSuper:return this.renderMmlPreSubSuper(e);case l.MmlBar:return this.renderMmlBar(e);case l.MmlEquationArray:return this.renderMllList(e);case l.Inserted:return this.renderInserted(e);case l.Deleted:return this.renderDeleted(e);case l.CommentRangeStart:return this.renderCommentRangeStart(e);case l.CommentRangeEnd:return this.renderCommentRangeEnd(e);case l.CommentReference:return this.renderCommentReference(e);case l.AltChunk:return this.renderAltChunk(e)}return null}renderElements(e,t){if(null==e)return null;var r=e.flatMap(e=>this.renderElement(e)).filter(e=>null!=e);return t&&eE(t,r),r}renderContainer(e,t,r){return this.createElement(t,r,this.renderElements(e.children))}renderContainerNS(e,t,r,a){return this.createElementNS(t,r,a,this.renderElements(e.children))}renderParagraph(e){var t=this.renderContainer(e,"p");let r=this.findStyle(e.styleName);e.tabs??(e.tabs=r?.paragraphProps?.tabs),this.renderClass(e,t),this.renderStyleValues(e.cssStyle,t),this.renderCommonProperties(t.style,e);let a=e.numbering??r?.paragraphProps?.numbering;return a&&t.classList.add(this.numberingClass(a.id,a.level)),t}renderRunProperties(e,t){this.renderCommonProperties(e,t)}renderCommonProperties(e,t){null!=t&&(t.color&&(e.color=t.color),t.fontSize&&(e["font-size"]=t.fontSize))}renderHyperlink(e){var t=this.renderContainer(e,"a");this.renderStyleValues(e.cssStyle,t);let r="";if(e.id){let t=this.document.documentPart.rels.find(t=>t.id==e.id&&"External"===t.targetMode);r=t?.target??r}return e.anchor&&(r+=`#${e.anchor}`),t.href=r,t}renderSmartTag(e){return this.renderContainer(e,"span")}renderCommentRangeStart(e){if(!this.options.renderComments)return null;let t=new Range;this.commentHighlight?.add(t);let r=this.createComment(`start of comment #${e.id}`);return this.later(()=>t.setStart(r,0)),this.commentMap[e.id]=t,r}renderCommentRangeEnd(e){if(!this.options.renderComments)return null;let t=this.commentMap[e.id],r=this.createComment(`end of comment #${e.id}`);return this.later(()=>t?.setEnd(r,0)),r}renderCommentReference(e){if(!this.options.renderComments)return null;var t=this.document.commentsPart?.commentMap[e.id];if(!t)return null;let r=new DocumentFragment,a=this.createElement("span",{className:`${this.className}-comment-ref`},["\uD83D\uDCAC"]),n=this.createElement("div",{className:`${this.className}-comment-popover`});return this.renderCommentContent(t,n),r.appendChild(this.createComment(`comment #${t.id} by ${t.author} on ${t.date}`)),r.appendChild(a),r.appendChild(n),r}renderAltChunk(e){if(!this.options.renderAltChunks)return null;var t=this.createElement("iframe");return this.tasks.push(this.document.loadAltChunk(e.id,this.currentPart).then(e=>{t.srcdoc=e})),t}renderCommentContent(e,t){t.appendChild(this.createElement("div",{className:`${this.className}-comment-author`},[e.author])),t.appendChild(this.createElement("div",{className:`${this.className}-comment-date`},[new Date(e.date).toLocaleString()])),this.renderElements(e.children,t)}renderDrawing(e){var t=this.renderContainer(e,"div");return t.style.display="inline-block",t.style.position="relative",t.style.textIndent="0px",this.renderStyleValues(e.cssStyle,t),t}renderImage(e){let t=this.createElement("img"),r=e.cssStyle?.transform;if(this.renderStyleValues(e.cssStyle,t),e.srcRect&&e.srcRect.some(e=>0!=e)){var[a,n,s,i]=e.srcRect;r=`scale(${1/(1-a-s)}, ${1/(1-n-i)})`,t.style["clip-path"]=`rect(${(100*n).toFixed(2)}% ${(100*(1-s)).toFixed(2)}% ${(100*(1-i)).toFixed(2)}% ${(100*a).toFixed(2)}%)`}return e.rotation&&(r=`rotate(${e.rotation}deg) ${r??""}`),t.style.transform=r?.trim(),this.document&&this.tasks.push(this.document.loadDocumentImage(e.src,this.currentPart).then(e=>{t.src=e})),t}renderText(e){return this.htmlDocument.createTextNode(e.text)}renderDeletedText(e){return this.options.renderChanges?this.renderText(e):null}renderBreak(e){return"textWrapping"==e.break?this.createElement("br"):null}renderInserted(e){return this.options.renderChanges?this.renderContainer(e,"ins"):this.renderElements(e.children)}renderDeleted(e){return this.options.renderChanges?this.renderContainer(e,"del"):null}renderSymbol(e){var t=this.createElement("span");return t.style.fontFamily=e.font,t.innerHTML=`&#x${e.char};`,t}renderFootnoteReference(e){var t=this.createElement("sup");return this.currentFootnoteIds.push(e.id),t.textContent=`${this.currentFootnoteIds.length}`,t}renderEndnoteReference(e){var t=this.createElement("sup");return this.currentEndnoteIds.push(e.id),t.textContent=`${this.currentEndnoteIds.length}`,t}renderTab(e){var t=this.createElement("span");if(t.innerHTML="&emsp;",this.options.experimental){t.className=this.tabStopClass();var r=function(e,t){for(var r=e.parent;null!=r&&r.type!=t;)r=r.parent;return r}(e,l.Paragraph)?.tabs;this.currentTabs.push({stops:r,span:t})}return t}renderBookmarkStart(e){return this.createElement("span",{id:e.name})}renderRun(e){if(e.fieldRun)return null;let t=this.createElement("span");if(e.id&&(t.id=e.id),this.renderClass(e,t),this.renderStyleValues(e.cssStyle,t),e.verticalAlign){let r=this.createElement(e.verticalAlign);this.renderElements(e.children,r),t.appendChild(r)}else this.renderElements(e.children,t);return t}renderTable(e){let t=this.createElement("table");return this.tableCellPositions.push(this.currentCellPosition),this.tableVerticalMerges.push(this.currentVerticalMerge),this.currentVerticalMerge={},this.currentCellPosition={col:0,row:0},e.columns&&t.appendChild(this.renderTableColumns(e.columns)),this.renderClass(e,t),this.renderElements(e.children,t),this.renderStyleValues(e.cssStyle,t),this.currentVerticalMerge=this.tableVerticalMerges.pop(),this.currentCellPosition=this.tableCellPositions.pop(),t}renderTableColumns(e){let t=this.createElement("colgroup");for(let r of e){let e=this.createElement("col");r.width&&(e.style.width=r.width),t.appendChild(e)}return t}renderTableRow(e){let t=this.createElement("tr");return this.currentCellPosition.col=0,e.gridBefore&&t.appendChild(this.renderTableCellPlaceholder(e.gridBefore)),this.renderClass(e,t),this.renderElements(e.children,t),this.renderStyleValues(e.cssStyle,t),e.gridAfter&&t.appendChild(this.renderTableCellPlaceholder(e.gridAfter)),this.currentCellPosition.row++,t}renderTableCellPlaceholder(e){let t=this.createElement("td",{colSpan:e});return t.style.border="none",t}renderTableCell(e){let t=this.renderContainer(e,"td"),r=this.currentCellPosition.col;return e.verticalMerge?"restart"==e.verticalMerge?(this.currentVerticalMerge[r]=t,t.rowSpan=1):this.currentVerticalMerge[r]&&(this.currentVerticalMerge[r].rowSpan+=1,t.style.display="none"):this.currentVerticalMerge[r]=null,this.renderClass(e,t),this.renderStyleValues(e.cssStyle,t),e.span&&(t.colSpan=e.span),this.currentCellPosition.col+=t.colSpan,t}renderVmlPicture(e){return this.renderContainer(e,"div")}renderVmlElement(e){var t=this.createSvgElement("svg");t.setAttribute("style",e.cssStyleText);let r=this.renderVmlChildElement(e);return e.imageHref?.id&&this.tasks.push(this.document?.loadDocumentImage(e.imageHref.id,this.currentPart).then(e=>r.setAttribute("href",e))),t.appendChild(r),requestAnimationFrame(()=>{let e=t.firstElementChild.getBBox();t.setAttribute("width",`${Math.ceil(e.x+e.width)}`),t.setAttribute("height",`${Math.ceil(e.y+e.height)}`)}),t}renderVmlChildElement(e){let t=this.createSvgElement(e.tagName);for(let r of(Object.entries(e.attrs).forEach(([e,r])=>t.setAttribute(e,r)),e.children))r.type==l.VmlElement?t.appendChild(this.renderVmlChildElement(r)):t.appendChild(...g(this.renderElement(r)));return t}renderMmlRadical(e){let t=e.children.find(e=>e.type==l.MmlBase);if(e.props?.hideDegree)return this.createElementNS(eS.mathML,"msqrt",null,this.renderElements([t]));let r=e.children.find(e=>e.type==l.MmlDegree);return this.createElementNS(eS.mathML,"mroot",null,this.renderElements([t,r]))}renderMmlDelimiter(e){let t=[];return t.push(this.createElementNS(eS.mathML,"mo",null,[e.props.beginChar??"("])),t.push(...this.renderElements(e.children)),t.push(this.createElementNS(eS.mathML,"mo",null,[e.props.endChar??")"])),this.createElementNS(eS.mathML,"mrow",null,t)}renderMmlNary(e){let t=[],r=f(e.children,e=>e.type),a=r[l.MmlSuperArgument],n=r[l.MmlSubArgument],s=a?this.createElementNS(eS.mathML,"mo",null,g(this.renderElement(a))):null,i=n?this.createElementNS(eS.mathML,"mo",null,g(this.renderElement(n))):null,o=this.createElementNS(eS.mathML,"mo",null,[e.props?.char??"∫"]);return s||i?t.push(this.createElementNS(eS.mathML,"munderover",null,[o,i,s])):s?t.push(this.createElementNS(eS.mathML,"mover",null,[o,s])):i?t.push(this.createElementNS(eS.mathML,"munder",null,[o,i])):t.push(o),t.push(...this.renderElements(r[l.MmlBase].children)),this.createElementNS(eS.mathML,"mrow",null,t)}renderMmlPreSubSuper(e){let t=[],r=f(e.children,e=>e.type),a=r[l.MmlSuperArgument],n=r[l.MmlSubArgument],s=a?this.createElementNS(eS.mathML,"mo",null,g(this.renderElement(a))):null,i=n?this.createElementNS(eS.mathML,"mo",null,g(this.renderElement(n))):null,o=this.createElementNS(eS.mathML,"mo",null);return t.push(this.createElementNS(eS.mathML,"msubsup",null,[o,i,s])),t.push(...this.renderElements(r[l.MmlBase].children)),this.createElementNS(eS.mathML,"mrow",null,t)}renderMmlGroupChar(e){let t="bot"===e.props.verticalJustification?"mover":"munder",r=this.renderContainerNS(e,eS.mathML,t);return e.props.char&&r.appendChild(this.createElementNS(eS.mathML,"mo",null,[e.props.char])),r}renderMmlBar(e){let t=this.renderContainerNS(e,eS.mathML,"mrow");switch(e.props.position){case"top":t.style.textDecoration="overline";break;case"bottom":t.style.textDecoration="underline"}return t}renderMmlRun(e){let t=this.createElementNS(eS.mathML,"ms",null,this.renderElements(e.children));return this.renderClass(e,t),this.renderStyleValues(e.cssStyle,t),t}renderMllList(e){let t=this.createElementNS(eS.mathML,"mtable");for(let r of(this.renderClass(e,t),this.renderStyleValues(e.cssStyle,t),this.renderElements(e.children)))t.appendChild(this.createElementNS(eS.mathML,"mtr",null,[this.createElementNS(eS.mathML,"mtd",null,[r])]));return t}renderStyleValues(e,t){for(let r in e)r.startsWith("$")?t.setAttribute(r.slice(1),e[r]):t.style[r]=e[r]}renderClass(e,t){e.className&&(t.className=e.className),e.styleName&&t.classList.add(this.processStyleName(e.styleName))}findStyle(e){return e&&this.styleMap?.[e]}numberingClass(e,t){return`${this.className}-num-${e}-${t}`}tabStopClass(){return`${this.className}-tab-stop`}styleToString(e,t,r=null){let a=`${e} {\r
29
+ `;for(let e in t)e.startsWith("$")||(a+=` ${e}: ${t[e]};\r
30
+ `);return r&&(a+=r),a+"}\r\n"}numberingCounter(e,t){return`${this.className}-num-${e}-${t}`}levelTextToContent(e,t,r,a){var n=e.replace(/%\d*/g,e=>{let t=parseInt(e.substring(1),10)-1;return`"counter(${this.numberingCounter(r,t)}, ${a})"`});return`"${n}${({tab:"\\9",space:"\\a0"})[t]??""}"`}numFormatToCssValue(e){return({none:"none",bullet:"disc",decimal:"decimal",lowerLetter:"lower-alpha",upperLetter:"upper-alpha",lowerRoman:"lower-roman",upperRoman:"upper-roman",decimalZero:"decimal-leading-zero",aiueo:"katakana",aiueoFullWidth:"katakana",chineseCounting:"simp-chinese-informal",chineseCountingThousand:"simp-chinese-informal",chineseLegalSimplified:"simp-chinese-formal",chosung:"hangul-consonant",ideographDigital:"cjk-ideographic",ideographTraditional:"cjk-heavenly-stem",ideographLegalTraditional:"trad-chinese-formal",ideographZodiac:"cjk-earthly-branch",iroha:"katakana-iroha",irohaFullWidth:"katakana-iroha",japaneseCounting:"japanese-informal",japaneseDigitalTenThousand:"cjk-decimal",japaneseLegal:"japanese-formal",thaiNumbers:"thai",koreanCounting:"korean-hangul-formal",koreanDigital:"korean-hangul-formal",koreanDigital2:"korean-hanja-informal",hebrew1:"hebrew",hebrew2:"hebrew",hindiNumbers:"devanagari",ganada:"hangul",taiwaneseCounting:"cjk-ideographic",taiwaneseCountingThousand:"cjk-ideographic",taiwaneseDigital:"cjk-decimal"})[e]??e}refreshTabStops(){this.options.experimental&&setTimeout(()=>{let e=function(e=document.body){let t=document.createElement("div");t.style.width="100pt",e.appendChild(t);let r=100/t.offsetWidth;return e.removeChild(t),r}();for(let t of this.currentTabs)!function(e,t,r,a=.75){let n=e.closest("p"),s=e.getBoundingClientRect(),i=n.getBoundingClientRect(),o=getComputedStyle(n),l=t?.length>0?t.map(e=>({pos:ew(e.position),leader:e.leader,style:e.style})).sort((e,t)=>e.pos-t.pos):[e_],c=l[l.length-1],h=i.width*a,u=ew(r),d=c.pos+u;if(d<h)for(;d<h&&l.length<50;d+=u)l.push({...e_,pos:d});let f=parseFloat(o.marginLeft),p=i.left+f,m=(s.left-p)*a,g=l.find(e=>"clear"!=e.style&&e.pos>m);if(null==g)return;let b=1;if("right"==g.style||"center"==g.style){let t=Array.from(n.querySelectorAll(`.${e.className}`)),r=t.indexOf(e)+1,s=document.createRange();s.setStart(e,1),r<t.length?s.setEndBefore(t[r]):s.setEndAfter(n);let o="center"==g.style?.5:1,l=s.getBoundingClientRect(),c=l.left+o*l.width-(i.left-f);b=g.pos-c*a}else b=g.pos-m;switch(e.innerHTML="&nbsp;",e.style.textDecoration="inherit",e.style.wordSpacing=`${b.toFixed(0)}pt`,g.leader){case"dot":case"middleDot":e.style.textDecoration="underline",e.style.textDecorationStyle="dotted";break;case"hyphen":case"heavy":case"underscore":e.style.textDecoration="underline"}}(t.span,t.stops,this.defaultTabSize,e)},500)}createElementNS(e,t,r,a){var n=e?this.htmlDocument.createElementNS(e,t):this.htmlDocument.createElement(t);return Object.assign(n,r),a&&eE(n,a),n}createElement(e,t,r){return this.createElementNS(void 0,e,t,r)}createSvgElement(e,t,r){return this.createElementNS(eS.svg,e,t,r)}createStyleElement(e){return this.createElement("style",{innerHTML:e})}createComment(e){return this.htmlDocument.createComment(e)}later(e){this.postRenderTasks.push(e)}}function eC(e){e.innerHTML=""}function eE(e,t){t.forEach(t=>e.appendChild("string"==typeof t||t instanceof String?document.createTextNode(t):t))}let eA={ignoreHeight:!1,ignoreWidth:!1,ignoreFonts:!1,breakPages:!0,debug:!1,experimental:!1,className:"docx",inWrapper:!0,hideWrapperOnPrint:!1,trimXmlDeclaration:!0,ignoreLastRenderedPageBreak:!0,renderHeaders:!0,renderFooters:!0,renderFootnotes:!0,renderEndnotes:!0,useBase64URL:!1,renderChanges:!1,renderComments:!1,renderAltChunks:!0};function eP(e,t){let r={...eA,...t};return eo.load(e,new eb(r),r)}async function eN(e,t,r,a){let n={...eA,...a},s=new ex(window.document);return await s.render(e,t,r,n)}async function eT(e,t,r,a){let n=await eP(e,a);return await eN(n,t,r,a),n}}}]);