@ysgroup/ui 0.1.41 → 0.1.43

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.
@@ -0,0 +1,42 @@
1
+ /* 本文件由 scripts/bundle-docx-preview.mjs 生成,不要手改。
2
+ * docx-preview 0.4.1(Apache-2.0,https://github.com/VolodymyrBaydalka/docxjs)
3
+ * + jszip 3.10.2(MIT,https://github.com/Stuk/jszip;jszip 为 MIT/GPLv3 双许可,此处按 MIT 使用)
4
+ * 打成纯 ESM,供 YsDocViewer 按需动态导入。 */
5
+ var Xe=Object.create;var Ce=Object.defineProperty;var qe=Object.getOwnPropertyDescriptor;var Ke=Object.getOwnPropertyNames;var Ye=Object.getPrototypeOf,Je=Object.prototype.hasOwnProperty;var At=(a=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(a,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):a)(function(a){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+a+'" is not supported')});var Qe=(a,e)=>()=>(e||a((e={exports:{}}).exports,e),e.exports);var tr=(a,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ke(e))!Je.call(a,n)&&n!==t&&Ce(a,n,{get:()=>e[n],enumerable:!(r=qe(e,n))||r.enumerable});return a};var er=(a,e,t)=>(t=a!=null?Xe(Ye(a)):{},tr(e||!a||!a.__esModule?Ce(t,"default",{value:a,enumerable:!0}):t,a));var Ae=Qe((xe,Ut)=>{/*!
6
+
7
+ JSZip v3.10.2 - A JavaScript class for generating and reading zip files
8
+ <http://stuartk.com/jszip>
9
+
10
+ (c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
11
+ Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
12
+
13
+ JSZip uses the library pako released under the MIT license :
14
+ https://github.com/nodeca/pako/blob/main/LICENSE
15
+ */(function(a){typeof xe=="object"&&typeof Ut<"u"?Ut.exports=a():typeof define=="function"&&define.amd?define([],a):(typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this).JSZip=a()})(function(){return(function a(e,t,r){function n(d,f){if(!t[d]){if(!e[d]){var v=typeof At=="function"&&At;if(!f&&v)return v(d,!0);if(s)return s(d,!0);var y=new Error("Cannot find module '"+d+"'");throw y.code="MODULE_NOT_FOUND",y}var c=t[d]={exports:{}};e[d][0].call(c.exports,function(g){var h=e[d][1][g];return n(h||g)},c,c.exports,a,e,t,r)}return t[d].exports}for(var s=typeof At=="function"&&At,o=0;o<r.length;o++)n(r[o]);return n})({1:[function(a,e,t){"use strict";var r=a("./utils"),n=a("./support"),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";t.encode=function(o){for(var d,f,v,y,c,g,h,m=[],u=0,k=o.length,S=k,x=r.getTypeOf(o)!=="string";u<o.length;)S=k-u,v=x?(d=o[u++],f=u<k?o[u++]:0,u<k?o[u++]:0):(d=o.charCodeAt(u++),f=u<k?o.charCodeAt(u++):0,u<k?o.charCodeAt(u++):0),y=d>>2,c=(3&d)<<4|f>>4,g=1<S?(15&f)<<2|v>>6:64,h=2<S?63&v:64,m.push(s.charAt(y)+s.charAt(c)+s.charAt(g)+s.charAt(h));return m.join("")},t.decode=function(o){var d,f,v,y,c,g,h=0,m=0,u="data:";if(o.substr(0,u.length)===u)throw new Error("Invalid base64 input, it looks like a data url.");var k,S=3*(o=o.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(o.charAt(o.length-1)===s.charAt(64)&&S--,o.charAt(o.length-2)===s.charAt(64)&&S--,S%1!=0)throw new Error("Invalid base64 input, bad content length.");for(k=n.uint8array?new Uint8Array(0|S):new Array(0|S);h<o.length;)d=s.indexOf(o.charAt(h++))<<2|(y=s.indexOf(o.charAt(h++)))>>4,f=(15&y)<<4|(c=s.indexOf(o.charAt(h++)))>>2,v=(3&c)<<6|(g=s.indexOf(o.charAt(h++))),k[m++]=d,c!==64&&(k[m++]=f),g!==64&&(k[m++]=v);return k}},{"./support":30,"./utils":32}],2:[function(a,e,t){"use strict";var r=a("./external"),n=a("./stream/DataWorker"),s=a("./stream/Crc32Probe"),o=a("./stream/DataLengthProbe");function d(f,v,y,c,g){this.compressedSize=f,this.uncompressedSize=v,this.crc32=y,this.compression=c,this.compressedContent=g}d.prototype={getContentWorker:function(){var f=new n(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),v=this;return f.on("end",function(){if(this.streamInfo.data_length!==v.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),f},getCompressedWorker:function(){return new n(r.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},d.createWorkerFrom=function(f,v,y){return f.pipe(new s).pipe(new o("uncompressedSize")).pipe(v.compressWorker(y)).pipe(new o("compressedSize")).withStreamInfo("compression",v)},e.exports=d},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(a,e,t){"use strict";var r=a("./stream/GenericWorker");t.STORE={magic:"\0\0",compressWorker:function(){return new r("STORE compression")},uncompressWorker:function(){return new r("STORE decompression")}},t.DEFLATE=a("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(a,e,t){"use strict";var r=a("./utils"),n=(function(){for(var s,o=[],d=0;d<256;d++){s=d;for(var f=0;f<8;f++)s=1&s?3988292384^s>>>1:s>>>1;o[d]=s}return o})();e.exports=function(s,o){return s!==void 0&&s.length?r.getTypeOf(s)!=="string"?(function(d,f,v,y){var c=n,g=y+v;d^=-1;for(var h=y;h<g;h++)d=d>>>8^c[255&(d^f[h])];return-1^d})(0|o,s,s.length,0):(function(d,f,v,y){var c=n,g=y+v;d^=-1;for(var h=y;h<g;h++)d=d>>>8^c[255&(d^f.charCodeAt(h))];return-1^d})(0|o,s,s.length,0):0}},{"./utils":32}],5:[function(a,e,t){"use strict";t.base64=!1,t.binary=!1,t.dir=!1,t.createFolders=!0,t.date=null,t.compression=null,t.compressionOptions=null,t.comment=null,t.unixPermissions=null,t.dosPermissions=null},{}],6:[function(a,e,t){"use strict";var r=null;r=typeof Promise<"u"?Promise:a("lie"),e.exports={Promise:r}},{lie:37}],7:[function(a,e,t){"use strict";var r=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",n=a("pako"),s=a("./utils"),o=a("./stream/GenericWorker"),d=r?"uint8array":"array";function f(v,y){o.call(this,"FlateWorker/"+v),this._pako=null,this._pakoAction=v,this._pakoOptions=y,this.meta={}}t.magic="\b\0",s.inherits(f,o),f.prototype.processChunk=function(v){this.meta=v.meta,this._pako===null&&this._createPako(),this._pako.push(s.transformTo(d,v.data),!1)},f.prototype.flush=function(){o.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},f.prototype.cleanUp=function(){o.prototype.cleanUp.call(this),this._pako=null},f.prototype._createPako=function(){this._pako=new n[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var v=this;this._pako.onData=function(y){v.push({data:y,meta:v.meta})}},t.compressWorker=function(v){return new f("Deflate",v)},t.uncompressWorker=function(){return new f("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(a,e,t){"use strict";function r(c,g){var h,m="";for(h=0;h<g;h++)m+=String.fromCharCode(255&c),c>>>=8;return m}function n(c,g,h,m,u,k){var S,x,A=c.file,O=c.compression,R=k!==d.utf8encode,j=s.transformTo("string",k(A.name)),z=s.transformTo("string",d.utf8encode(A.name)),Z=A.comment,Y=s.transformTo("string",k(Z)),_=s.transformTo("string",d.utf8encode(Z)),T=z.length!==A.name.length,l=_.length!==Z.length,F="",Q="",U="",tt=A.dir,$=A.date,J={crc32:0,compressedSize:0,uncompressedSize:0};g&&!h||(J.crc32=c.crc32,J.compressedSize=c.compressedSize,J.uncompressedSize=c.uncompressedSize);var M=0;g&&(M|=8),R||!T&&!l||(M|=2048);var E=0,K=0;tt&&(E|=16),u==="UNIX"?(K=798,E|=(function(V,ot){var ft=V;return V||(ft=ot?16893:33204),(65535&ft)<<16})(A.unixPermissions,tt)):(K=20,E|=(function(V){return 63&(V||0)})(A.dosPermissions)),S=$.getUTCHours(),S<<=6,S|=$.getUTCMinutes(),S<<=5,S|=$.getUTCSeconds()/2,x=$.getUTCFullYear()-1980,x<<=4,x|=$.getUTCMonth()+1,x<<=5,x|=$.getUTCDate(),T&&(Q=r(1,1)+r(f(j),4)+z,F+="up"+r(Q.length,2)+Q),l&&(U=r(1,1)+r(f(Y),4)+_,F+="uc"+r(U.length,2)+U);var G="";return G+=`
16
+ \0`,G+=r(M,2),G+=O.magic,G+=r(S,2),G+=r(x,2),G+=r(J.crc32,4),G+=r(J.compressedSize,4),G+=r(J.uncompressedSize,4),G+=r(j.length,2),G+=r(F.length,2),{fileRecord:v.LOCAL_FILE_HEADER+G+j+F,dirRecord:v.CENTRAL_FILE_HEADER+r(K,2)+G+r(Y.length,2)+"\0\0\0\0"+r(E,4)+r(m,4)+j+F+Y}}var s=a("../utils"),o=a("../stream/GenericWorker"),d=a("../utf8"),f=a("../crc32"),v=a("../signature");function y(c,g,h,m){o.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=g,this.zipPlatform=h,this.encodeFileName=m,this.streamFiles=c,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}s.inherits(y,o),y.prototype.push=function(c){var g=c.meta.percent||0,h=this.entriesCount,m=this._sources.length;this.accumulate?this.contentBuffer.push(c):(this.bytesWritten+=c.data.length,o.prototype.push.call(this,{data:c.data,meta:{currentFile:this.currentFile,percent:h?(g+100*(h-m-1))/h:100}}))},y.prototype.openedSource=function(c){this.currentSourceOffset=this.bytesWritten,this.currentFile=c.file.name;var g=this.streamFiles&&!c.file.dir;if(g){var h=n(c,g,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:h.fileRecord,meta:{percent:0}})}else this.accumulate=!0},y.prototype.closedSource=function(c){this.accumulate=!1;var g=this.streamFiles&&!c.file.dir,h=n(c,g,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(h.dirRecord),g)this.push({data:(function(m){return v.DATA_DESCRIPTOR+r(m.crc32,4)+r(m.compressedSize,4)+r(m.uncompressedSize,4)})(c),meta:{percent:100}});else for(this.push({data:h.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},y.prototype.flush=function(){for(var c=this.bytesWritten,g=0;g<this.dirRecords.length;g++)this.push({data:this.dirRecords[g],meta:{percent:100}});var h=this.bytesWritten-c,m=(function(u,k,S,x,A){var O=s.transformTo("string",A(x));return v.CENTRAL_DIRECTORY_END+"\0\0\0\0"+r(u,2)+r(u,2)+r(k,4)+r(S,4)+r(O.length,2)+O})(this.dirRecords.length,h,c,this.zipComment,this.encodeFileName);this.push({data:m,meta:{percent:100}})},y.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},y.prototype.registerPrevious=function(c){this._sources.push(c);var g=this;return c.on("data",function(h){g.processChunk(h)}),c.on("end",function(){g.closedSource(g.previous.streamInfo),g._sources.length?g.prepareNextSource():g.end()}),c.on("error",function(h){g.error(h)}),this},y.prototype.resume=function(){return!!o.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},y.prototype.error=function(c){var g=this._sources;if(!o.prototype.error.call(this,c))return!1;for(var h=0;h<g.length;h++)try{g[h].error(c)}catch{}return!0},y.prototype.lock=function(){o.prototype.lock.call(this);for(var c=this._sources,g=0;g<c.length;g++)c[g].lock()},e.exports=y},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(a,e,t){"use strict";var r=a("../compressions"),n=a("./ZipFileWorker");t.generateWorker=function(s,o,d){var f=new n(o.streamFiles,d,o.platform,o.encodeFileName),v=0;try{s.forEach(function(y,c){v++;var g=(function(k,S){var x=k||S,A=r[x];if(!A)throw new Error(x+" is not a valid compression method !");return A})(c.options.compression,o.compression),h=c.options.compressionOptions||o.compressionOptions||{},m=c.dir,u=c.date;c._compressWorker(g,h).withStreamInfo("file",{name:y,dir:m,date:u,comment:c.comment||"",unixPermissions:c.unixPermissions,dosPermissions:c.dosPermissions}).pipe(f)}),f.entriesCount=v}catch(y){f.error(y)}return f}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(a,e,t){"use strict";function r(){if(!(this instanceof r))return new r;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var n=new r;for(var s in this)typeof this[s]!="function"&&(n[s]=this[s]);return n}}(r.prototype=a("./object")).loadAsync=a("./load"),r.support=a("./support"),r.defaults=a("./defaults"),r.version="3.10.2",r.loadAsync=function(n,s){return new r().loadAsync(n,s)},r.external=a("./external"),e.exports=r},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(a,e,t){"use strict";var r=a("./utils"),n=a("./external"),s=a("./utf8"),o=a("./zipEntries"),d=a("./stream/Crc32Probe"),f=a("./nodejsUtils");function v(y){return new n.Promise(function(c,g){var h=y.decompressed.getContentWorker().pipe(new d);h.on("error",function(m){g(m)}).on("end",function(){h.streamInfo.crc32!==y.decompressed.crc32?g(new Error("Corrupted zip : CRC32 mismatch")):c()}).resume()})}e.exports=function(y,c){var g=this;return c=r.extend(c||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:s.utf8decode}),f.isNode&&f.isStream(y)?n.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):r.prepareContent("the loaded zip file",y,!0,c.optimizedBinaryString,c.base64).then(function(h){var m=new o(c);return m.load(h),m}).then(function(h){var m=[n.Promise.resolve(h)],u=h.files;if(c.checkCRC32)for(var k=0;k<u.length;k++)m.push(v(u[k]));return n.Promise.all(m)}).then(function(h){for(var m=h.shift(),u=m.files,k=0;k<u.length;k++){var S=u[k],x=S.fileNameStr,A=r.resolve(S.fileNameStr);g.file(A,S.decompressed,{binary:!0,optimizedBinaryString:!0,date:S.date,dir:S.dir,comment:S.fileCommentStr.length?S.fileCommentStr:null,unixPermissions:S.unixPermissions,dosPermissions:S.dosPermissions,createFolders:c.createFolders}),S.dir||(g.file(A).unsafeOriginalName=x)}return m.zipComment.length&&(g.comment=m.zipComment),g})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(a,e,t){"use strict";var r=a("../utils"),n=a("../stream/GenericWorker");function s(o,d){n.call(this,"Nodejs stream input adapter for "+o),this._upstreamEnded=!1,this._bindStream(d)}r.inherits(s,n),s.prototype._bindStream=function(o){var d=this;(this._stream=o).pause(),o.on("data",function(f){d.push({data:f,meta:{percent:0}})}).on("error",function(f){d.isPaused?this.generatedError=f:d.error(f)}).on("end",function(){d.isPaused?d._upstreamEnded=!0:d.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)},e.exports=s},{"../stream/GenericWorker":28,"../utils":32}],13:[function(a,e,t){"use strict";var r=a("readable-stream").Readable;function n(s,o,d){r.call(this,o),this._helper=s;var f=this;s.on("data",function(v,y){f.push(v)||f._helper.pause(),d&&d(y)}).on("error",function(v){f.emit("error",v)}).on("end",function(){f.push(null)})}a("../utils").inherits(n,r),n.prototype._read=function(){this._helper.resume()},e.exports=n},{"../utils":32,"readable-stream":16}],14:[function(a,e,t){"use strict";e.exports={isNode:typeof Buffer<"u",newBufferFrom:function(r,n){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(r,n);if(typeof r=="number")throw new Error('The "data" argument must not be a number');return new Buffer(r,n)},allocBuffer:function(r){if(Buffer.alloc)return Buffer.alloc(r);var n=new Buffer(r);return n.fill(0),n},isBuffer:function(r){return Buffer.isBuffer(r)},isStream:function(r){return r&&typeof r.on=="function"&&typeof r.pause=="function"&&typeof r.resume=="function"}}},{}],15:[function(a,e,t){"use strict";function r(A,O,R){var j,z=s.getTypeOf(O),Z=s.extend(R||{},f);Z.date=Z.date||new Date,Z.compression!==null&&(Z.compression=Z.compression.toUpperCase()),typeof Z.unixPermissions=="string"&&(Z.unixPermissions=parseInt(Z.unixPermissions,8)),Z.unixPermissions&&16384&Z.unixPermissions&&(Z.dir=!0),Z.dosPermissions&&16&Z.dosPermissions&&(Z.dir=!0),Z.dir&&(A=u(A)),Z.createFolders&&(j=m(A))&&k.call(this,j,!0);var Y=z==="string"&&Z.binary===!1&&Z.base64===!1;R&&R.binary!==void 0||(Z.binary=!Y),(O instanceof v&&O.uncompressedSize===0||Z.dir||!O||O.length===0)&&(Z.base64=!1,Z.binary=!0,O="",Z.compression="STORE",z="string");var _=null;_=O instanceof v||O instanceof o?O:g.isNode&&g.isStream(O)?new h(A,O):s.prepareContent(A,O,Z.binary,Z.optimizedBinaryString,Z.base64);var T=new y(A,_,Z);this.files[A]=T}var n=a("./utf8"),s=a("./utils"),o=a("./stream/GenericWorker"),d=a("./stream/StreamHelper"),f=a("./defaults"),v=a("./compressedObject"),y=a("./zipObject"),c=a("./generate"),g=a("./nodejsUtils"),h=a("./nodejs/NodejsStreamInputAdapter"),m=function(A){A.slice(-1)==="/"&&(A=A.substring(0,A.length-1));var O=A.lastIndexOf("/");return 0<O?A.substring(0,O):""},u=function(A){return A.slice(-1)!=="/"&&(A+="/"),A},k=function(A,O){return O=O!==void 0?O:f.createFolders,A=u(A),this.files[A]||r.call(this,A,null,{dir:!0,createFolders:O}),this.files[A]};function S(A){return Object.prototype.toString.call(A)==="[object RegExp]"}var x={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(A){var O,R,j;for(O in this.files)j=this.files[O],(R=O.slice(this.root.length,O.length))&&O.slice(0,this.root.length)===this.root&&A(R,j)},filter:function(A){var O=[];return this.forEach(function(R,j){A(R,j)&&O.push(j)}),O},file:function(A,O,R){if(arguments.length!==1)return A=this.root+A,r.call(this,A,O,R),this;if(S(A)){var j=A;return this.filter(function(Z,Y){return!Y.dir&&j.test(Z)})}var z=this.files[this.root+A];return z&&!z.dir?z:null},folder:function(A){if(!A)return this;if(S(A))return this.filter(function(z,Z){return Z.dir&&A.test(z)});var O=this.root+A,R=k.call(this,O),j=this.clone();return j.root=R.name,j},remove:function(A){A=this.root+A;var O=this.files[A];if(O||(A.slice(-1)!=="/"&&(A+="/"),O=this.files[A]),O&&!O.dir)delete this.files[A];else for(var R=this.filter(function(z,Z){return Z.name.slice(0,A.length)===A}),j=0;j<R.length;j++)delete this.files[R[j].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(A){var O,R={};try{if((R=s.extend(A||{},{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(),R.type==="binarystring"&&(R.type="string"),!R.type)throw new Error("No output type specified.");s.checkSupport(R.type),R.platform!=="darwin"&&R.platform!=="freebsd"&&R.platform!=="linux"&&R.platform!=="sunos"||(R.platform="UNIX"),R.platform==="win32"&&(R.platform="DOS");var j=R.comment||this.comment||"";O=c.generateWorker(this,R,j)}catch(z){(O=new o("error")).error(z)}return new d(O,R.type||"string",R.mimeType)},generateAsync:function(A,O){return this.generateInternalStream(A).accumulate(O)},generateNodeStream:function(A,O){return(A=A||{}).type||(A.type="nodebuffer"),this.generateInternalStream(A).toNodejsStream(O)}};e.exports=x},{"./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(a,e,t){"use strict";e.exports=a("stream")},{stream:void 0}],17:[function(a,e,t){"use strict";var r=a("./DataReader");function n(s){r.call(this,s);for(var o=0;o<this.data.length;o++)s[o]=255&s[o]}a("../utils").inherits(n,r),n.prototype.byteAt=function(s){return this.data[this.zero+s]},n.prototype.lastIndexOfSignature=function(s){for(var o=s.charCodeAt(0),d=s.charCodeAt(1),f=s.charCodeAt(2),v=s.charCodeAt(3),y=this.length-4;0<=y;--y)if(this.data[y]===o&&this.data[y+1]===d&&this.data[y+2]===f&&this.data[y+3]===v)return y-this.zero;return-1},n.prototype.readAndCheckSignature=function(s){var o=s.charCodeAt(0),d=s.charCodeAt(1),f=s.charCodeAt(2),v=s.charCodeAt(3),y=this.readData(4);return o===y[0]&&d===y[1]&&f===y[2]&&v===y[3]},n.prototype.readData=function(s){if(this.checkOffset(s),s===0)return[];var o=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,o},e.exports=n},{"../utils":32,"./DataReader":18}],18:[function(a,e,t){"use strict";var r=a("../utils");function n(s){this.data=s,this.length=s.length,this.index=0,this.zero=0}n.prototype={checkOffset:function(s){this.checkIndex(this.index+s)},checkIndex:function(s){if(this.length<this.zero+s||s<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+s+"). Corrupted zip ?")},setIndex:function(s){this.checkIndex(s),this.index=s},skip:function(s){this.setIndex(this.index+s)},byteAt:function(){},readInt:function(s){var o,d=0;for(this.checkOffset(s),o=this.index+s-1;o>=this.index;o--)d=(d<<8)+this.byteAt(o);return this.index+=s,d},readString:function(s){return r.transformTo("string",this.readData(s))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var s=this.readInt(4);return new Date(Date.UTC(1980+(s>>25&127),(s>>21&15)-1,s>>16&31,s>>11&31,s>>5&63,(31&s)<<1))}},e.exports=n},{"../utils":32}],19:[function(a,e,t){"use strict";var r=a("./Uint8ArrayReader");function n(s){r.call(this,s)}a("../utils").inherits(n,r),n.prototype.readData=function(s){this.checkOffset(s);var o=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,o},e.exports=n},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(a,e,t){"use strict";var r=a("./DataReader");function n(s){r.call(this,s)}a("../utils").inherits(n,r),n.prototype.byteAt=function(s){return this.data.charCodeAt(this.zero+s)},n.prototype.lastIndexOfSignature=function(s){return this.data.lastIndexOf(s)-this.zero},n.prototype.readAndCheckSignature=function(s){return s===this.readData(4)},n.prototype.readData=function(s){this.checkOffset(s);var o=this.data.slice(this.zero+this.index,this.zero+this.index+s);return this.index+=s,o},e.exports=n},{"../utils":32,"./DataReader":18}],21:[function(a,e,t){"use strict";var r=a("./ArrayReader");function n(s){r.call(this,s)}a("../utils").inherits(n,r),n.prototype.readData=function(s){if(this.checkOffset(s),s===0)return new Uint8Array(0);var o=this.data.subarray(this.zero+this.index,this.zero+this.index+s);return this.index+=s,o},e.exports=n},{"../utils":32,"./ArrayReader":17}],22:[function(a,e,t){"use strict";var r=a("../utils"),n=a("../support"),s=a("./ArrayReader"),o=a("./StringReader"),d=a("./NodeBufferReader"),f=a("./Uint8ArrayReader");e.exports=function(v){var y=r.getTypeOf(v);return r.checkSupport(y),y!=="string"||n.uint8array?y==="nodebuffer"?new d(v):n.uint8array?new f(r.transformTo("uint8array",v)):new s(r.transformTo("array",v)):new o(v)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(a,e,t){"use strict";t.LOCAL_FILE_HEADER="PK",t.CENTRAL_FILE_HEADER="PK",t.CENTRAL_DIRECTORY_END="PK",t.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",t.ZIP64_CENTRAL_DIRECTORY_END="PK",t.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(a,e,t){"use strict";var r=a("./GenericWorker"),n=a("../utils");function s(o){r.call(this,"ConvertWorker to "+o),this.destType=o}n.inherits(s,r),s.prototype.processChunk=function(o){this.push({data:n.transformTo(this.destType,o.data),meta:o.meta})},e.exports=s},{"../utils":32,"./GenericWorker":28}],25:[function(a,e,t){"use strict";var r=a("./GenericWorker"),n=a("../crc32");function s(){r.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}a("../utils").inherits(s,r),s.prototype.processChunk=function(o){this.streamInfo.crc32=n(o.data,this.streamInfo.crc32||0),this.push(o)},e.exports=s},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(a,e,t){"use strict";var r=a("../utils"),n=a("./GenericWorker");function s(o){n.call(this,"DataLengthProbe for "+o),this.propName=o,this.withStreamInfo(o,0)}r.inherits(s,n),s.prototype.processChunk=function(o){if(o){var d=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=d+o.data.length}n.prototype.processChunk.call(this,o)},e.exports=s},{"../utils":32,"./GenericWorker":28}],27:[function(a,e,t){"use strict";var r=a("../utils"),n=a("./GenericWorker");function s(o){n.call(this,"DataWorker");var d=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,o.then(function(f){d.dataIsReady=!0,d.data=f,d.max=f&&f.length||0,d.type=r.getTypeOf(f),d.isPaused||d._tickAndRepeat()},function(f){d.error(f)})}r.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,r.delay(this._tickAndRepeat,[],this)),!0)},s.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},s.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var o=null,d=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":o=this.data.substring(this.index,d);break;case"uint8array":o=this.data.subarray(this.index,d);break;case"array":case"nodebuffer":o=this.data.slice(this.index,d)}return this.index=d,this.push({data:o,meta:{percent:this.max?this.index/this.max*100:0}})},e.exports=s},{"../utils":32,"./GenericWorker":28}],28:[function(a,e,t){"use strict";function r(n){this.name=n||"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}r.prototype={push:function(n){this.emit("data",n)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(n){this.emit("error",n)}return!0},error:function(n){return!this.isFinished&&(this.isPaused?this.generatedError=n:(this.isFinished=!0,this.emit("error",n),this.previous&&this.previous.error(n),this.cleanUp()),!0)},on:function(n,s){return this._listeners[n].push(s),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(n,s){if(this._listeners[n])for(var o=0;o<this._listeners[n].length;o++)this._listeners[n][o].call(this,s)},pipe:function(n){return n.registerPrevious(this)},registerPrevious:function(n){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=n.streamInfo,this.mergeStreamInfo(),this.previous=n;var s=this;return n.on("data",function(o){s.processChunk(o)}),n.on("end",function(){s.end()}),n.on("error",function(o){s.error(o)}),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 n=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),n=!0),this.previous&&this.previous.resume(),!n},flush:function(){},processChunk:function(n){this.push(n)},withStreamInfo:function(n,s){return this.extraStreamInfo[n]=s,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var n in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,n)&&(this.streamInfo[n]=this.extraStreamInfo[n])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var n="Worker "+this.name;return this.previous?this.previous+" -> "+n:n}},e.exports=r},{}],29:[function(a,e,t){"use strict";var r=a("../utils"),n=a("./ConvertWorker"),s=a("./GenericWorker"),o=a("../base64"),d=a("../support"),f=a("../external"),v=null;if(d.nodestream)try{v=a("../nodejs/NodejsStreamOutputAdapter")}catch{}function y(g,h){return new f.Promise(function(m,u){var k=[],S=g._internalType,x=g._outputType,A=g._mimeType;g.on("data",function(O,R){k.push(O),h&&h(R)}).on("error",function(O){k=[],u(O)}).on("end",function(){try{var O=(function(R,j,z){switch(R){case"blob":return r.newBlob(r.transformTo("arraybuffer",j),z);case"base64":return o.encode(j);default:return r.transformTo(R,j)}})(x,(function(R,j){var z,Z=0,Y=null,_=0;for(z=0;z<j.length;z++)_+=j[z].length;switch(R){case"string":return j.join("");case"array":return Array.prototype.concat.apply([],j);case"uint8array":for(Y=new Uint8Array(_),z=0;z<j.length;z++)Y.set(j[z],Z),Z+=j[z].length;return Y;case"nodebuffer":return Buffer.concat(j);default:throw new Error("concat : unsupported type '"+R+"'")}})(S,k),A);m(O)}catch(R){u(R)}k=[]}).resume()})}function c(g,h,m){var u=h;switch(h){case"blob":case"arraybuffer":u="uint8array";break;case"base64":u="string"}try{this._internalType=u,this._outputType=h,this._mimeType=m,r.checkSupport(u),this._worker=g.pipe(new n(u)),g.lock()}catch(k){this._worker=new s("error"),this._worker.error(k)}}c.prototype={accumulate:function(g){return y(this,g)},on:function(g,h){var m=this;return g==="data"?this._worker.on(g,function(u){h.call(m,u.data,u.meta)}):this._worker.on(g,function(){r.delay(h,arguments,m)}),this},resume:function(){return r.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(g){if(r.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new v(this,{objectMode:this._outputType!=="nodebuffer"},g)}},e.exports=c},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(a,e,t){"use strict";if(t.base64=!0,t.array=!0,t.string=!0,t.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",t.nodebuffer=typeof Buffer<"u",t.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")t.blob=!1;else{var r=new ArrayBuffer(0);try{t.blob=new Blob([r],{type:"application/zip"}).size===0}catch{try{var n=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);n.append(r),t.blob=n.getBlob("application/zip").size===0}catch{t.blob=!1}}}try{t.nodestream=!!a("readable-stream").Readable}catch{t.nodestream=!1}},{"readable-stream":16}],31:[function(a,e,t){"use strict";for(var r=a("./utils"),n=a("./support"),s=a("./nodejsUtils"),o=a("./stream/GenericWorker"),d=new Array(256),f=0;f<256;f++)d[f]=252<=f?6:248<=f?5:240<=f?4:224<=f?3:192<=f?2:1;d[254]=d[254]=1;function v(){o.call(this,"utf-8 decode"),this.leftOver=null}function y(){o.call(this,"utf-8 encode")}t.utf8encode=function(c){return n.nodebuffer?s.newBufferFrom(c,"utf-8"):(function(g){var h,m,u,k,S,x=g.length,A=0;for(k=0;k<x;k++)(64512&(m=g.charCodeAt(k)))==55296&&k+1<x&&(64512&(u=g.charCodeAt(k+1)))==56320&&(m=65536+(m-55296<<10)+(u-56320),k++),A+=m<128?1:m<2048?2:m<65536?3:4;for(h=n.uint8array?new Uint8Array(A):new Array(A),k=S=0;S<A;k++)(64512&(m=g.charCodeAt(k)))==55296&&k+1<x&&(64512&(u=g.charCodeAt(k+1)))==56320&&(m=65536+(m-55296<<10)+(u-56320),k++),m<128?h[S++]=m:(m<2048?h[S++]=192|m>>>6:(m<65536?h[S++]=224|m>>>12:(h[S++]=240|m>>>18,h[S++]=128|m>>>12&63),h[S++]=128|m>>>6&63),h[S++]=128|63&m);return h})(c)},t.utf8decode=function(c){return n.nodebuffer?r.transformTo("nodebuffer",c).toString("utf-8"):(function(g){var h,m,u,k,S=g.length,x=new Array(2*S);for(h=m=0;h<S;)if((u=g[h++])<128)x[m++]=u;else if(4<(k=d[u]))x[m++]=65533,h+=k-1;else{for(u&=k===2?31:k===3?15:7;1<k&&h<S;)u=u<<6|63&g[h++],k--;1<k?x[m++]=65533:u<65536?x[m++]=u:(u-=65536,x[m++]=55296|u>>10&1023,x[m++]=56320|1023&u)}return x.length!==m&&(x.subarray?x=x.subarray(0,m):x.length=m),r.applyFromCharCode(x)})(c=r.transformTo(n.uint8array?"uint8array":"array",c))},r.inherits(v,o),v.prototype.processChunk=function(c){var g=r.transformTo(n.uint8array?"uint8array":"array",c.data);if(this.leftOver&&this.leftOver.length){if(n.uint8array){var h=g;(g=new Uint8Array(h.length+this.leftOver.length)).set(this.leftOver,0),g.set(h,this.leftOver.length)}else g=this.leftOver.concat(g);this.leftOver=null}var m=(function(k,S){var x;for((S=S||k.length)>k.length&&(S=k.length),x=S-1;0<=x&&(192&k[x])==128;)x--;return x<0||x===0?S:x+d[k[x]]>S?x:S})(g),u=g;m!==g.length&&(n.uint8array?(u=g.subarray(0,m),this.leftOver=g.subarray(m,g.length)):(u=g.slice(0,m),this.leftOver=g.slice(m,g.length))),this.push({data:t.utf8decode(u),meta:c.meta})},v.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:t.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},t.Utf8DecodeWorker=v,r.inherits(y,o),y.prototype.processChunk=function(c){this.push({data:t.utf8encode(c.data),meta:c.meta})},t.Utf8EncodeWorker=y},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(a,e,t){"use strict";var r=a("./support"),n=a("./base64"),s=a("./nodejsUtils"),o=a("./external");function d(h){return h}function f(h,m){for(var u=0;u<h.length;++u)m[u]=255&h.charCodeAt(u);return m}a("setimmediate"),t.newBlob=function(h,m){t.checkSupport("blob");try{return new Blob([h],{type:m})}catch{try{var u=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return u.append(h),u.getBlob(m)}catch{throw new Error("Bug : can't construct the Blob.")}}};var v={stringifyByChunk:function(h,m,u){var k=[],S=0,x=h.length;if(x<=u)return String.fromCharCode.apply(null,h);for(;S<x;)m==="array"||m==="nodebuffer"?k.push(String.fromCharCode.apply(null,h.slice(S,Math.min(S+u,x)))):k.push(String.fromCharCode.apply(null,h.subarray(S,Math.min(S+u,x)))),S+=u;return k.join("")},stringifyByChar:function(h){for(var m="",u=0;u<h.length;u++)m+=String.fromCharCode(h[u]);return m},applyCanBeUsed:{uint8array:(function(){try{return r.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return r.nodebuffer&&String.fromCharCode.apply(null,s.allocBuffer(1)).length===1}catch{return!1}})()}};function y(h){var m=65536,u=t.getTypeOf(h),k=!0;if(u==="uint8array"?k=v.applyCanBeUsed.uint8array:u==="nodebuffer"&&(k=v.applyCanBeUsed.nodebuffer),k)for(;1<m;)try{return v.stringifyByChunk(h,u,m)}catch{m=Math.floor(m/2)}return v.stringifyByChar(h)}function c(h,m){for(var u=0;u<h.length;u++)m[u]=h[u];return m}t.applyFromCharCode=y;var g={};g.string={string:d,array:function(h){return f(h,new Array(h.length))},arraybuffer:function(h){return g.string.uint8array(h).buffer},uint8array:function(h){return f(h,new Uint8Array(h.length))},nodebuffer:function(h){return f(h,s.allocBuffer(h.length))}},g.array={string:y,array:d,arraybuffer:function(h){return new Uint8Array(h).buffer},uint8array:function(h){return new Uint8Array(h)},nodebuffer:function(h){return s.newBufferFrom(h)}},g.arraybuffer={string:function(h){return y(new Uint8Array(h))},array:function(h){return c(new Uint8Array(h),new Array(h.byteLength))},arraybuffer:d,uint8array:function(h){return new Uint8Array(h)},nodebuffer:function(h){return s.newBufferFrom(new Uint8Array(h))}},g.uint8array={string:y,array:function(h){return c(h,new Array(h.length))},arraybuffer:function(h){return h.buffer},uint8array:d,nodebuffer:function(h){return s.newBufferFrom(h)}},g.nodebuffer={string:y,array:function(h){return c(h,new Array(h.length))},arraybuffer:function(h){return g.nodebuffer.uint8array(h).buffer},uint8array:function(h){return c(h,new Uint8Array(h.length))},nodebuffer:d},t.transformTo=function(h,m){if(m=m||"",!h)return m;t.checkSupport(h);var u=t.getTypeOf(m);return g[u][h](m)},t.resolve=function(h){for(var m=h.split("/"),u=[],k=0;k<m.length;k++){var S=m[k];S==="."||S===""&&k!==0&&k!==m.length-1||(S===".."?u.pop():u.push(S))}return u.join("/")},t.getTypeOf=function(h){if(typeof h=="string")return"string";var m=Object.prototype.toString.call(h);return m==="[object Array]"?"array":r.nodebuffer&&s.isBuffer(h)?"nodebuffer":r.uint8array&&m==="[object Uint8Array]"?"uint8array":r.arraybuffer&&m==="[object ArrayBuffer]"?"arraybuffer":void 0},t.checkSupport=function(h){if(!r[h.toLowerCase()])throw new Error(h+" is not supported by this platform")},t.MAX_VALUE_16BITS=65535,t.MAX_VALUE_32BITS=-1,t.pretty=function(h){var m,u,k="";for(u=0;u<(h||"").length;u++)k+="\\x"+((m=h.charCodeAt(u))<16?"0":"")+m.toString(16).toUpperCase();return k},t.delay=function(h,m,u){setImmediate(function(){h.apply(u||null,m||[])})},t.inherits=function(h,m){function u(){}u.prototype=m.prototype,h.prototype=new u},t.extend=function(){var h,m,u={};for(h=0;h<arguments.length;h++)for(m in arguments[h])Object.prototype.hasOwnProperty.call(arguments[h],m)&&u[m]===void 0&&(u[m]=arguments[h][m]);return u},t.prepareContent=function(h,m,u,k,S){return o.Promise.resolve(m).then(function(x){return r.blob&&(x instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(x))!==-1)?Blob.prototype.arrayBuffer!==void 0?x.arrayBuffer():typeof FileReader<"u"?new o.Promise(function(A,O){var R=new FileReader;R.onload=function(j){A(j.target.result)},R.onerror=function(j){O(j.target.error)},R.readAsArrayBuffer(x)}):o.Promise.reject(new Error(h+" is a Blob, but we have no way of reading it.")):x}).then(function(x){var A=t.getTypeOf(x);return A?(A==="arraybuffer"?x=t.transformTo("uint8array",x):A==="string"&&(S?x=n.decode(x):u&&k!==!0&&(x=(function(O){return f(O,r.uint8array?new Uint8Array(O.length):new Array(O.length))})(x))),x):o.Promise.reject(new Error("Can't read the data of '"+h+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(a,e,t){"use strict";var r=a("./reader/readerFor"),n=a("./utils"),s=a("./signature"),o=a("./zipEntry"),d=a("./support");function f(v){this.files=[],this.loadOptions=v}f.prototype={checkSignature:function(v){if(!this.reader.readAndCheckSignature(v)){this.reader.index-=4;var y=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+n.pretty(y)+", expected "+n.pretty(v)+")")}},isSignature:function(v,y){var c=this.reader.index;this.reader.setIndex(v);var g=this.reader.readString(4)===y;return this.reader.setIndex(c),g},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 v=this.reader.readData(this.zipCommentLength),y=d.uint8array?"uint8array":"array",c=n.transformTo(y,v);this.zipComment=this.loadOptions.decodeFileName(c)},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 v,y,c,g=this.zip64EndOfCentralSize-44;0<g;)v=this.reader.readInt(2),y=this.reader.readInt(4),c=this.reader.readData(y),this.zip64ExtensibleData[v]={id:v,length:y,value:c}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var v,y;for(v=0;v<this.files.length;v++)y=this.files[v],this.reader.setIndex(y.localHeaderOffset),this.checkSignature(s.LOCAL_FILE_HEADER),y.readLocalPart(this.reader),y.handleUTF8(),y.processAttributes()},readCentralDir:function(){var v;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(s.CENTRAL_FILE_HEADER);)(v=new o({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(v);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var v=this.reader.lastIndexOfSignature(s.CENTRAL_DIRECTORY_END);if(v<0)throw this.isSignature(0,s.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(v);var y=v;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,(v=this.reader.lastIndexOfSignature(s.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(v),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 new 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 c=this.centralDirOffset+this.centralDirSize;this.zip64&&(c+=20,c+=12+this.zip64EndOfCentralSize);var g=y-c;if(0<g)this.isSignature(y,s.CENTRAL_FILE_HEADER)||(this.reader.zero=g);else if(g<0)throw new Error("Corrupted zip: missing "+Math.abs(g)+" bytes.")},prepareReader:function(v){this.reader=r(v)},load:function(v){this.prepareReader(v),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},e.exports=f},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(a,e,t){"use strict";var r=a("./reader/readerFor"),n=a("./utils"),s=a("./compressedObject"),o=a("./crc32"),d=a("./utf8"),f=a("./compressions"),v=a("./support");function y(c,g){this.options=c,this.loadOptions=g}y.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(c){var g,h;if(c.skip(22),this.fileNameLength=c.readInt(2),h=c.readInt(2),this.fileName=c.readData(this.fileNameLength),c.skip(h),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((g=(function(m){for(var u in f)if(Object.prototype.hasOwnProperty.call(f,u)&&f[u].magic===m)return f[u];return null})(this.compressionMethod))===null)throw new 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,g,c.readData(this.compressedSize))},readCentralPart:function(c){this.versionMadeBy=c.readInt(2),c.skip(2),this.bitFlag=c.readInt(2),this.compressionMethod=c.readString(2),this.date=c.readDate(),this.crc32=c.readInt(4),this.compressedSize=c.readInt(4),this.uncompressedSize=c.readInt(4);var g=c.readInt(2);if(this.extraFieldsLength=c.readInt(2),this.fileCommentLength=c.readInt(2),this.diskNumberStart=c.readInt(2),this.internalFileAttributes=c.readInt(2),this.externalFileAttributes=c.readInt(4),this.localHeaderOffset=c.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");c.skip(g),this.readExtraFields(c),this.parseZIP64ExtraField(c),this.fileComment=c.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var c=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),c==0&&(this.dosPermissions=63&this.externalFileAttributes),c==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var c=r(this.extraFields[1].value);this.uncompressedSize===n.MAX_VALUE_32BITS&&(this.uncompressedSize=c.readInt(8)),this.compressedSize===n.MAX_VALUE_32BITS&&(this.compressedSize=c.readInt(8)),this.localHeaderOffset===n.MAX_VALUE_32BITS&&(this.localHeaderOffset=c.readInt(8)),this.diskNumberStart===n.MAX_VALUE_32BITS&&(this.diskNumberStart=c.readInt(4))}},readExtraFields:function(c){var g,h,m,u=c.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});c.index+4<u;)g=c.readInt(2),h=c.readInt(2),m=c.readData(h),this.extraFields[g]={id:g,length:h,value:m};c.setIndex(u)},handleUTF8:function(){var c=v.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=d.utf8decode(this.fileName),this.fileCommentStr=d.utf8decode(this.fileComment);else{var g=this.findExtraFieldUnicodePath();if(g!==null)this.fileNameStr=g;else{var h=n.transformTo(c,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(h)}var m=this.findExtraFieldUnicodeComment();if(m!==null)this.fileCommentStr=m;else{var u=n.transformTo(c,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(u)}}},findExtraFieldUnicodePath:function(){var c=this.extraFields[28789];if(c){var g=r(c.value);return g.readInt(1)!==1||o(this.fileName)!==g.readInt(4)?null:d.utf8decode(g.readData(c.length-5))}return null},findExtraFieldUnicodeComment:function(){var c=this.extraFields[25461];if(c){var g=r(c.value);return g.readInt(1)!==1||o(this.fileComment)!==g.readInt(4)?null:d.utf8decode(g.readData(c.length-5))}return null}},e.exports=y},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(a,e,t){"use strict";function r(g,h,m){this.name=g,this.dir=m.dir,this.date=m.date,this.comment=m.comment,this.unixPermissions=m.unixPermissions,this.dosPermissions=m.dosPermissions,this._data=h,this._dataBinary=m.binary,this.options={compression:m.compression,compressionOptions:m.compressionOptions}}var n=a("./stream/StreamHelper"),s=a("./stream/DataWorker"),o=a("./utf8"),d=a("./compressedObject"),f=a("./stream/GenericWorker");r.prototype={internalStream:function(g){var h=null,m="string";try{if(!g)throw new Error("No output type specified.");var u=(m=g.toLowerCase())==="string"||m==="text";m!=="binarystring"&&m!=="text"||(m="string"),h=this._decompressWorker();var k=!this._dataBinary;k&&!u&&(h=h.pipe(new o.Utf8EncodeWorker)),!k&&u&&(h=h.pipe(new o.Utf8DecodeWorker))}catch(S){(h=new f("error")).error(S)}return new n(h,m,"")},async:function(g,h){return this.internalStream(g).accumulate(h)},nodeStream:function(g,h){return this.internalStream(g||"nodebuffer").toNodejsStream(h)},_compressWorker:function(g,h){if(this._data instanceof d&&this._data.compression.magic===g.magic)return this._data.getCompressedWorker();var m=this._decompressWorker();return this._dataBinary||(m=m.pipe(new o.Utf8EncodeWorker)),d.createWorkerFrom(m,g,h)},_decompressWorker:function(){return this._data instanceof d?this._data.getContentWorker():this._data instanceof f?this._data:new s(this._data)}};for(var v=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],y=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},c=0;c<v.length;c++)r.prototype[v[c]]=y;e.exports=r},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(a,e,t){(function(r){"use strict";var n,s,o=r.MutationObserver||r.WebKitMutationObserver;if(o){var d=0,f=new o(g),v=r.document.createTextNode("");f.observe(v,{characterData:!0}),n=function(){v.data=d=++d%2}}else if(r.setImmediate||r.MessageChannel===void 0)n="document"in r&&"onreadystatechange"in r.document.createElement("script")?function(){var h=r.document.createElement("script");h.onreadystatechange=function(){g(),h.onreadystatechange=null,h.parentNode.removeChild(h),h=null},r.document.documentElement.appendChild(h)}:function(){setTimeout(g,0)};else{var y=new r.MessageChannel;y.port1.onmessage=g,n=function(){y.port2.postMessage(0)}}var c=[];function g(){var h,m;s=!0;for(var u=c.length;u;){for(m=c,c=[],h=-1;++h<u;)m[h]();u=c.length}s=!1}e.exports=function(h){c.push(h)!==1||s||n()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(a,e,t){"use strict";var r=a("immediate");function n(){}var s={},o=["REJECTED"],d=["FULFILLED"],f=["PENDING"];function v(u){if(typeof u!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,u!==n&&h(this,u)}function y(u,k,S){this.promise=u,typeof k=="function"&&(this.onFulfilled=k,this.callFulfilled=this.otherCallFulfilled),typeof S=="function"&&(this.onRejected=S,this.callRejected=this.otherCallRejected)}function c(u,k,S){r(function(){var x;try{x=k(S)}catch(A){return s.reject(u,A)}x===u?s.reject(u,new TypeError("Cannot resolve promise with itself")):s.resolve(u,x)})}function g(u){var k=u&&u.then;if(u&&(typeof u=="object"||typeof u=="function")&&typeof k=="function")return function(){k.apply(u,arguments)}}function h(u,k){var S=!1;function x(R){S||(S=!0,s.reject(u,R))}function A(R){S||(S=!0,s.resolve(u,R))}var O=m(function(){k(A,x)});O.status==="error"&&x(O.value)}function m(u,k){var S={};try{S.value=u(k),S.status="success"}catch(x){S.status="error",S.value=x}return S}(e.exports=v).prototype.finally=function(u){if(typeof u!="function")return this;var k=this.constructor;return this.then(function(S){return k.resolve(u()).then(function(){return S})},function(S){return k.resolve(u()).then(function(){throw S})})},v.prototype.catch=function(u){return this.then(null,u)},v.prototype.then=function(u,k){if(typeof u!="function"&&this.state===d||typeof k!="function"&&this.state===o)return this;var S=new this.constructor(n);return this.state!==f?c(S,this.state===d?u:k,this.outcome):this.queue.push(new y(S,u,k)),S},y.prototype.callFulfilled=function(u){s.resolve(this.promise,u)},y.prototype.otherCallFulfilled=function(u){c(this.promise,this.onFulfilled,u)},y.prototype.callRejected=function(u){s.reject(this.promise,u)},y.prototype.otherCallRejected=function(u){c(this.promise,this.onRejected,u)},s.resolve=function(u,k){var S=m(g,k);if(S.status==="error")return s.reject(u,S.value);var x=S.value;if(x)h(u,x);else{u.state=d,u.outcome=k;for(var A=-1,O=u.queue.length;++A<O;)u.queue[A].callFulfilled(k)}return u},s.reject=function(u,k){u.state=o,u.outcome=k;for(var S=-1,x=u.queue.length;++S<x;)u.queue[S].callRejected(k);return u},v.resolve=function(u){return u instanceof this?u:s.resolve(new this(n),u)},v.reject=function(u){var k=new this(n);return s.reject(k,u)},v.all=function(u){var k=this;if(Object.prototype.toString.call(u)!=="[object Array]")return this.reject(new TypeError("must be an array"));var S=u.length,x=!1;if(!S)return this.resolve([]);for(var A=new Array(S),O=0,R=-1,j=new this(n);++R<S;)z(u[R],R);return j;function z(Z,Y){k.resolve(Z).then(function(_){A[Y]=_,++O!==S||x||(x=!0,s.resolve(j,A))},function(_){x||(x=!0,s.reject(j,_))})}},v.race=function(u){var k=this;if(Object.prototype.toString.call(u)!=="[object Array]")return this.reject(new TypeError("must be an array"));var S=u.length,x=!1;if(!S)return this.resolve([]);for(var A=-1,O=new this(n);++A<S;)R=u[A],k.resolve(R).then(function(j){x||(x=!0,s.resolve(O,j))},function(j){x||(x=!0,s.reject(O,j))});var R;return O}},{immediate:36}],38:[function(a,e,t){"use strict";var r={};(0,a("./lib/utils/common").assign)(r,a("./lib/deflate"),a("./lib/inflate"),a("./lib/zlib/constants")),e.exports=r},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(a,e,t){"use strict";var r=a("./zlib/deflate"),n=a("./utils/common"),s=a("./utils/strings"),o=a("./zlib/messages"),d=a("./zlib/zstream"),f=Object.prototype.toString,v=0,y=-1,c=0,g=8;function h(u){if(!(this instanceof h))return new h(u);this.options=n.assign({level:y,method:g,chunkSize:16384,windowBits:15,memLevel:8,strategy:c,to:""},u||{});var k=this.options;k.raw&&0<k.windowBits?k.windowBits=-k.windowBits:k.gzip&&0<k.windowBits&&k.windowBits<16&&(k.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var S=r.deflateInit2(this.strm,k.level,k.method,k.windowBits,k.memLevel,k.strategy);if(S!==v)throw new Error(o[S]);if(k.header&&r.deflateSetHeader(this.strm,k.header),k.dictionary){var x;if(x=typeof k.dictionary=="string"?s.string2buf(k.dictionary):f.call(k.dictionary)==="[object ArrayBuffer]"?new Uint8Array(k.dictionary):k.dictionary,(S=r.deflateSetDictionary(this.strm,x))!==v)throw new Error(o[S]);this._dict_set=!0}}function m(u,k){var S=new h(k);if(S.push(u,!0),S.err)throw S.msg||o[S.err];return S.result}h.prototype.push=function(u,k){var S,x,A=this.strm,O=this.options.chunkSize;if(this.ended)return!1;x=k===~~k?k:k===!0?4:0,typeof u=="string"?A.input=s.string2buf(u):f.call(u)==="[object ArrayBuffer]"?A.input=new Uint8Array(u):A.input=u,A.next_in=0,A.avail_in=A.input.length;do{if(A.avail_out===0&&(A.output=new n.Buf8(O),A.next_out=0,A.avail_out=O),(S=r.deflate(A,x))!==1&&S!==v)return this.onEnd(S),!(this.ended=!0);A.avail_out!==0&&(A.avail_in!==0||x!==4&&x!==2)||(this.options.to==="string"?this.onData(s.buf2binstring(n.shrinkBuf(A.output,A.next_out))):this.onData(n.shrinkBuf(A.output,A.next_out)))}while((0<A.avail_in||A.avail_out===0)&&S!==1);return x===4?(S=r.deflateEnd(this.strm),this.onEnd(S),this.ended=!0,S===v):x!==2||(this.onEnd(v),!(A.avail_out=0))},h.prototype.onData=function(u){this.chunks.push(u)},h.prototype.onEnd=function(u){u===v&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=u,this.msg=this.strm.msg},t.Deflate=h,t.deflate=m,t.deflateRaw=function(u,k){return(k=k||{}).raw=!0,m(u,k)},t.gzip=function(u,k){return(k=k||{}).gzip=!0,m(u,k)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(a,e,t){"use strict";var r=a("./zlib/inflate"),n=a("./utils/common"),s=a("./utils/strings"),o=a("./zlib/constants"),d=a("./zlib/messages"),f=a("./zlib/zstream"),v=a("./zlib/gzheader"),y=Object.prototype.toString;function c(h){if(!(this instanceof c))return new c(h);this.options=n.assign({chunkSize:16384,windowBits:0,to:""},h||{});var m=this.options;m.raw&&0<=m.windowBits&&m.windowBits<16&&(m.windowBits=-m.windowBits,m.windowBits===0&&(m.windowBits=-15)),!(0<=m.windowBits&&m.windowBits<16)||h&&h.windowBits||(m.windowBits+=32),15<m.windowBits&&m.windowBits<48&&(15&m.windowBits)==0&&(m.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new f,this.strm.avail_out=0;var u=r.inflateInit2(this.strm,m.windowBits);if(u!==o.Z_OK)throw new Error(d[u]);this.header=new v,r.inflateGetHeader(this.strm,this.header)}function g(h,m){var u=new c(m);if(u.push(h,!0),u.err)throw u.msg||d[u.err];return u.result}c.prototype.push=function(h,m){var u,k,S,x,A,O,R=this.strm,j=this.options.chunkSize,z=this.options.dictionary,Z=!1;if(this.ended)return!1;k=m===~~m?m:m===!0?o.Z_FINISH:o.Z_NO_FLUSH,typeof h=="string"?R.input=s.binstring2buf(h):y.call(h)==="[object ArrayBuffer]"?R.input=new Uint8Array(h):R.input=h,R.next_in=0,R.avail_in=R.input.length;do{if(R.avail_out===0&&(R.output=new n.Buf8(j),R.next_out=0,R.avail_out=j),(u=r.inflate(R,o.Z_NO_FLUSH))===o.Z_NEED_DICT&&z&&(O=typeof z=="string"?s.string2buf(z):y.call(z)==="[object ArrayBuffer]"?new Uint8Array(z):z,u=r.inflateSetDictionary(this.strm,O)),u===o.Z_BUF_ERROR&&Z===!0&&(u=o.Z_OK,Z=!1),u!==o.Z_STREAM_END&&u!==o.Z_OK)return this.onEnd(u),!(this.ended=!0);R.next_out&&(R.avail_out!==0&&u!==o.Z_STREAM_END&&(R.avail_in!==0||k!==o.Z_FINISH&&k!==o.Z_SYNC_FLUSH)||(this.options.to==="string"?(S=s.utf8border(R.output,R.next_out),x=R.next_out-S,A=s.buf2string(R.output,S),R.next_out=x,R.avail_out=j-x,x&&n.arraySet(R.output,R.output,S,x,0),this.onData(A)):this.onData(n.shrinkBuf(R.output,R.next_out)))),R.avail_in===0&&R.avail_out===0&&(Z=!0)}while((0<R.avail_in||R.avail_out===0)&&u!==o.Z_STREAM_END);return u===o.Z_STREAM_END&&(k=o.Z_FINISH),k===o.Z_FINISH?(u=r.inflateEnd(this.strm),this.onEnd(u),this.ended=!0,u===o.Z_OK):k!==o.Z_SYNC_FLUSH||(this.onEnd(o.Z_OK),!(R.avail_out=0))},c.prototype.onData=function(h){this.chunks.push(h)},c.prototype.onEnd=function(h){h===o.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=n.flattenChunks(this.chunks)),this.chunks=[],this.err=h,this.msg=this.strm.msg},t.Inflate=c,t.inflate=g,t.inflateRaw=function(h,m){return(m=m||{}).raw=!0,g(h,m)},t.ungzip=g},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(a,e,t){"use strict";var r=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";t.assign=function(o){for(var d=Array.prototype.slice.call(arguments,1);d.length;){var f=d.shift();if(f){if(typeof f!="object")throw new TypeError(f+"must be non-object");for(var v in f)f.hasOwnProperty(v)&&(o[v]=f[v])}}return o},t.shrinkBuf=function(o,d){return o.length===d?o:o.subarray?o.subarray(0,d):(o.length=d,o)};var n={arraySet:function(o,d,f,v,y){if(d.subarray&&o.subarray)o.set(d.subarray(f,f+v),y);else for(var c=0;c<v;c++)o[y+c]=d[f+c]},flattenChunks:function(o){var d,f,v,y,c,g;for(d=v=0,f=o.length;d<f;d++)v+=o[d].length;for(g=new Uint8Array(v),d=y=0,f=o.length;d<f;d++)c=o[d],g.set(c,y),y+=c.length;return g}},s={arraySet:function(o,d,f,v,y){for(var c=0;c<v;c++)o[y+c]=d[f+c]},flattenChunks:function(o){return[].concat.apply([],o)}};t.setTyped=function(o){o?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,n)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,s))},t.setTyped(r)},{}],42:[function(a,e,t){"use strict";var r=a("./common"),n=!0,s=!0;try{String.fromCharCode.apply(null,[0])}catch{n=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{s=!1}for(var o=new r.Buf8(256),d=0;d<256;d++)o[d]=252<=d?6:248<=d?5:240<=d?4:224<=d?3:192<=d?2:1;function f(v,y){if(y<65537&&(v.subarray&&s||!v.subarray&&n))return String.fromCharCode.apply(null,r.shrinkBuf(v,y));for(var c="",g=0;g<y;g++)c+=String.fromCharCode(v[g]);return c}o[254]=o[254]=1,t.string2buf=function(v){var y,c,g,h,m,u=v.length,k=0;for(h=0;h<u;h++)(64512&(c=v.charCodeAt(h)))==55296&&h+1<u&&(64512&(g=v.charCodeAt(h+1)))==56320&&(c=65536+(c-55296<<10)+(g-56320),h++),k+=c<128?1:c<2048?2:c<65536?3:4;for(y=new r.Buf8(k),h=m=0;m<k;h++)(64512&(c=v.charCodeAt(h)))==55296&&h+1<u&&(64512&(g=v.charCodeAt(h+1)))==56320&&(c=65536+(c-55296<<10)+(g-56320),h++),c<128?y[m++]=c:(c<2048?y[m++]=192|c>>>6:(c<65536?y[m++]=224|c>>>12:(y[m++]=240|c>>>18,y[m++]=128|c>>>12&63),y[m++]=128|c>>>6&63),y[m++]=128|63&c);return y},t.buf2binstring=function(v){return f(v,v.length)},t.binstring2buf=function(v){for(var y=new r.Buf8(v.length),c=0,g=y.length;c<g;c++)y[c]=v.charCodeAt(c);return y},t.buf2string=function(v,y){var c,g,h,m,u=y||v.length,k=new Array(2*u);for(c=g=0;c<u;)if((h=v[c++])<128)k[g++]=h;else if(4<(m=o[h]))k[g++]=65533,c+=m-1;else{for(h&=m===2?31:m===3?15:7;1<m&&c<u;)h=h<<6|63&v[c++],m--;1<m?k[g++]=65533:h<65536?k[g++]=h:(h-=65536,k[g++]=55296|h>>10&1023,k[g++]=56320|1023&h)}return f(k,g)},t.utf8border=function(v,y){var c;for((y=y||v.length)>v.length&&(y=v.length),c=y-1;0<=c&&(192&v[c])==128;)c--;return c<0||c===0?y:c+o[v[c]]>y?c:y}},{"./common":41}],43:[function(a,e,t){"use strict";e.exports=function(r,n,s,o){for(var d=65535&r|0,f=r>>>16&65535|0,v=0;s!==0;){for(s-=v=2e3<s?2e3:s;f=f+(d=d+n[o++]|0)|0,--v;);d%=65521,f%=65521}return d|f<<16|0}},{}],44:[function(a,e,t){"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(a,e,t){"use strict";var r=(function(){for(var n,s=[],o=0;o<256;o++){n=o;for(var d=0;d<8;d++)n=1&n?3988292384^n>>>1:n>>>1;s[o]=n}return s})();e.exports=function(n,s,o,d){var f=r,v=d+o;n^=-1;for(var y=d;y<v;y++)n=n>>>8^f[255&(n^s[y])];return-1^n}},{}],46:[function(a,e,t){"use strict";var r,n=a("../utils/common"),s=a("./trees"),o=a("./adler32"),d=a("./crc32"),f=a("./messages"),v=0,y=4,c=0,g=-2,h=-1,m=4,u=2,k=8,S=9,x=286,A=30,O=19,R=2*x+1,j=15,z=3,Z=258,Y=Z+z+1,_=42,T=113,l=1,F=2,Q=3,U=4;function tt(i,I){return i.msg=f[I],I}function $(i){return(i<<1)-(4<i?9:0)}function J(i){for(var I=i.length;0<=--I;)i[I]=0}function M(i){var I=i.state,B=I.pending;B>i.avail_out&&(B=i.avail_out),B!==0&&(n.arraySet(i.output,I.pending_buf,I.pending_out,B,i.next_out),i.next_out+=B,I.pending_out+=B,i.total_out+=B,i.avail_out-=B,I.pending-=B,I.pending===0&&(I.pending_out=0))}function E(i,I){s._tr_flush_block(i,0<=i.block_start?i.block_start:-1,i.strstart-i.block_start,I),i.block_start=i.strstart,M(i.strm)}function K(i,I){i.pending_buf[i.pending++]=I}function G(i,I){i.pending_buf[i.pending++]=I>>>8&255,i.pending_buf[i.pending++]=255&I}function V(i,I){var B,b,p=i.max_chain_length,C=i.strstart,L=i.prev_length,D=i.nice_match,P=i.strstart>i.w_size-Y?i.strstart-(i.w_size-Y):0,H=i.window,X=i.w_mask,W=i.prev,q=i.strstart+Z,it=H[C+L-1],rt=H[C+L];i.prev_length>=i.good_match&&(p>>=2),D>i.lookahead&&(D=i.lookahead);do if(H[(B=I)+L]===rt&&H[B+L-1]===it&&H[B]===H[C]&&H[++B]===H[C+1]){C+=2,B++;do;while(H[++C]===H[++B]&&H[++C]===H[++B]&&H[++C]===H[++B]&&H[++C]===H[++B]&&H[++C]===H[++B]&&H[++C]===H[++B]&&H[++C]===H[++B]&&H[++C]===H[++B]&&C<q);if(b=Z-(q-C),C=q-Z,L<b){if(i.match_start=I,D<=(L=b))break;it=H[C+L-1],rt=H[C+L]}}while((I=W[I&X])>P&&--p!=0);return L<=i.lookahead?L:i.lookahead}function ot(i){var I,B,b,p,C,L,D,P,H,X,W=i.w_size;do{if(p=i.window_size-i.lookahead-i.strstart,i.strstart>=W+(W-Y)){for(n.arraySet(i.window,i.window,W,W,0),i.match_start-=W,i.strstart-=W,i.block_start-=W,I=B=i.hash_size;b=i.head[--I],i.head[I]=W<=b?b-W:0,--B;);for(I=B=W;b=i.prev[--I],i.prev[I]=W<=b?b-W:0,--B;);p+=W}if(i.strm.avail_in===0)break;if(L=i.strm,D=i.window,P=i.strstart+i.lookahead,H=p,X=void 0,X=L.avail_in,H<X&&(X=H),B=X===0?0:(L.avail_in-=X,n.arraySet(D,L.input,L.next_in,X,P),L.state.wrap===1?L.adler=o(L.adler,D,X,P):L.state.wrap===2&&(L.adler=d(L.adler,D,X,P)),L.next_in+=X,L.total_in+=X,X),i.lookahead+=B,i.lookahead+i.insert>=z)for(C=i.strstart-i.insert,i.ins_h=i.window[C],i.ins_h=(i.ins_h<<i.hash_shift^i.window[C+1])&i.hash_mask;i.insert&&(i.ins_h=(i.ins_h<<i.hash_shift^i.window[C+z-1])&i.hash_mask,i.prev[C&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=C,C++,i.insert--,!(i.lookahead+i.insert<z)););}while(i.lookahead<Y&&i.strm.avail_in!==0)}function ft(i,I){for(var B,b;;){if(i.lookahead<Y){if(ot(i),i.lookahead<Y&&I===v)return l;if(i.lookahead===0)break}if(B=0,i.lookahead>=z&&(i.ins_h=(i.ins_h<<i.hash_shift^i.window[i.strstart+z-1])&i.hash_mask,B=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart),B!==0&&i.strstart-B<=i.w_size-Y&&(i.match_length=V(i,B)),i.match_length>=z)if(b=s._tr_tally(i,i.strstart-i.match_start,i.match_length-z),i.lookahead-=i.match_length,i.match_length<=i.max_lazy_match&&i.lookahead>=z){for(i.match_length--;i.strstart++,i.ins_h=(i.ins_h<<i.hash_shift^i.window[i.strstart+z-1])&i.hash_mask,B=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart,--i.match_length!=0;);i.strstart++}else i.strstart+=i.match_length,i.match_length=0,i.ins_h=i.window[i.strstart],i.ins_h=(i.ins_h<<i.hash_shift^i.window[i.strstart+1])&i.hash_mask;else b=s._tr_tally(i,0,i.window[i.strstart]),i.lookahead--,i.strstart++;if(b&&(E(i,!1),i.strm.avail_out===0))return l}return i.insert=i.strstart<z-1?i.strstart:z-1,I===y?(E(i,!0),i.strm.avail_out===0?Q:U):i.last_lit&&(E(i,!1),i.strm.avail_out===0)?l:F}function et(i,I){for(var B,b,p;;){if(i.lookahead<Y){if(ot(i),i.lookahead<Y&&I===v)return l;if(i.lookahead===0)break}if(B=0,i.lookahead>=z&&(i.ins_h=(i.ins_h<<i.hash_shift^i.window[i.strstart+z-1])&i.hash_mask,B=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart),i.prev_length=i.match_length,i.prev_match=i.match_start,i.match_length=z-1,B!==0&&i.prev_length<i.max_lazy_match&&i.strstart-B<=i.w_size-Y&&(i.match_length=V(i,B),i.match_length<=5&&(i.strategy===1||i.match_length===z&&4096<i.strstart-i.match_start)&&(i.match_length=z-1)),i.prev_length>=z&&i.match_length<=i.prev_length){for(p=i.strstart+i.lookahead-z,b=s._tr_tally(i,i.strstart-1-i.prev_match,i.prev_length-z),i.lookahead-=i.prev_length-1,i.prev_length-=2;++i.strstart<=p&&(i.ins_h=(i.ins_h<<i.hash_shift^i.window[i.strstart+z-1])&i.hash_mask,B=i.prev[i.strstart&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=i.strstart),--i.prev_length!=0;);if(i.match_available=0,i.match_length=z-1,i.strstart++,b&&(E(i,!1),i.strm.avail_out===0))return l}else if(i.match_available){if((b=s._tr_tally(i,0,i.window[i.strstart-1]))&&E(i,!1),i.strstart++,i.lookahead--,i.strm.avail_out===0)return l}else i.match_available=1,i.strstart++,i.lookahead--}return i.match_available&&(b=s._tr_tally(i,0,i.window[i.strstart-1]),i.match_available=0),i.insert=i.strstart<z-1?i.strstart:z-1,I===y?(E(i,!0),i.strm.avail_out===0?Q:U):i.last_lit&&(E(i,!1),i.strm.avail_out===0)?l:F}function nt(i,I,B,b,p){this.good_length=i,this.max_lazy=I,this.nice_length=B,this.max_chain=b,this.func=p}function dt(){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=k,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(2*R),this.dyn_dtree=new n.Buf16(2*(2*A+1)),this.bl_tree=new n.Buf16(2*(2*O+1)),J(this.dyn_ltree),J(this.dyn_dtree),J(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new n.Buf16(j+1),this.heap=new n.Buf16(2*x+1),J(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new n.Buf16(2*x+1),J(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 lt(i){var I;return i&&i.state?(i.total_in=i.total_out=0,i.data_type=u,(I=i.state).pending=0,I.pending_out=0,I.wrap<0&&(I.wrap=-I.wrap),I.status=I.wrap?_:T,i.adler=I.wrap===2?0:1,I.last_flush=v,s._tr_init(I),c):tt(i,g)}function bt(i){var I=lt(i);return I===c&&(function(B){B.window_size=2*B.w_size,J(B.head),B.max_lazy_match=r[B.level].max_lazy,B.good_match=r[B.level].good_length,B.nice_match=r[B.level].nice_length,B.max_chain_length=r[B.level].max_chain,B.strstart=0,B.block_start=0,B.lookahead=0,B.insert=0,B.match_length=B.prev_length=z-1,B.match_available=0,B.ins_h=0})(i.state),I}function gt(i,I,B,b,p,C){if(!i)return g;var L=1;if(I===h&&(I=6),b<0?(L=0,b=-b):15<b&&(L=2,b-=16),p<1||S<p||B!==k||b<8||15<b||I<0||9<I||C<0||m<C)return tt(i,g);b===8&&(b=9);var D=new dt;return(i.state=D).strm=i,D.wrap=L,D.gzhead=null,D.w_bits=b,D.w_size=1<<D.w_bits,D.w_mask=D.w_size-1,D.hash_bits=p+7,D.hash_size=1<<D.hash_bits,D.hash_mask=D.hash_size-1,D.hash_shift=~~((D.hash_bits+z-1)/z),D.window=new n.Buf8(2*D.w_size),D.head=new n.Buf16(D.hash_size),D.prev=new n.Buf16(D.w_size),D.lit_bufsize=1<<p+6,D.pending_buf_size=4*D.lit_bufsize,D.pending_buf=new n.Buf8(D.pending_buf_size),D.d_buf=1*D.lit_bufsize,D.l_buf=3*D.lit_bufsize,D.level=I,D.strategy=C,D.method=B,bt(i)}r=[new nt(0,0,0,0,function(i,I){var B=65535;for(B>i.pending_buf_size-5&&(B=i.pending_buf_size-5);;){if(i.lookahead<=1){if(ot(i),i.lookahead===0&&I===v)return l;if(i.lookahead===0)break}i.strstart+=i.lookahead,i.lookahead=0;var b=i.block_start+B;if((i.strstart===0||i.strstart>=b)&&(i.lookahead=i.strstart-b,i.strstart=b,E(i,!1),i.strm.avail_out===0)||i.strstart-i.block_start>=i.w_size-Y&&(E(i,!1),i.strm.avail_out===0))return l}return i.insert=0,I===y?(E(i,!0),i.strm.avail_out===0?Q:U):(i.strstart>i.block_start&&(E(i,!1),i.strm.avail_out),l)}),new nt(4,4,8,4,ft),new nt(4,5,16,8,ft),new nt(4,6,32,32,ft),new nt(4,4,16,16,et),new nt(8,16,32,32,et),new nt(8,16,128,128,et),new nt(8,32,128,256,et),new nt(32,128,258,1024,et),new nt(32,258,258,4096,et)],t.deflateInit=function(i,I){return gt(i,I,k,15,8,0)},t.deflateInit2=gt,t.deflateReset=bt,t.deflateResetKeep=lt,t.deflateSetHeader=function(i,I){return i&&i.state?i.state.wrap!==2?g:(i.state.gzhead=I,c):g},t.deflate=function(i,I){var B,b,p,C;if(!i||!i.state||5<I||I<0)return i?tt(i,g):g;if(b=i.state,!i.output||!i.input&&i.avail_in!==0||b.status===666&&I!==y)return tt(i,i.avail_out===0?-5:g);if(b.strm=i,B=b.last_flush,b.last_flush=I,b.status===_)if(b.wrap===2)i.adler=0,K(b,31),K(b,139),K(b,8),b.gzhead?(K(b,(b.gzhead.text?1:0)+(b.gzhead.hcrc?2:0)+(b.gzhead.extra?4:0)+(b.gzhead.name?8:0)+(b.gzhead.comment?16:0)),K(b,255&b.gzhead.time),K(b,b.gzhead.time>>8&255),K(b,b.gzhead.time>>16&255),K(b,b.gzhead.time>>24&255),K(b,b.level===9?2:2<=b.strategy||b.level<2?4:0),K(b,255&b.gzhead.os),b.gzhead.extra&&b.gzhead.extra.length&&(K(b,255&b.gzhead.extra.length),K(b,b.gzhead.extra.length>>8&255)),b.gzhead.hcrc&&(i.adler=d(i.adler,b.pending_buf,b.pending,0)),b.gzindex=0,b.status=69):(K(b,0),K(b,0),K(b,0),K(b,0),K(b,0),K(b,b.level===9?2:2<=b.strategy||b.level<2?4:0),K(b,3),b.status=T);else{var L=k+(b.w_bits-8<<4)<<8;L|=(2<=b.strategy||b.level<2?0:b.level<6?1:b.level===6?2:3)<<6,b.strstart!==0&&(L|=32),L+=31-L%31,b.status=T,G(b,L),b.strstart!==0&&(G(b,i.adler>>>16),G(b,65535&i.adler)),i.adler=1}if(b.status===69)if(b.gzhead.extra){for(p=b.pending;b.gzindex<(65535&b.gzhead.extra.length)&&(b.pending!==b.pending_buf_size||(b.gzhead.hcrc&&b.pending>p&&(i.adler=d(i.adler,b.pending_buf,b.pending-p,p)),M(i),p=b.pending,b.pending!==b.pending_buf_size));)K(b,255&b.gzhead.extra[b.gzindex]),b.gzindex++;b.gzhead.hcrc&&b.pending>p&&(i.adler=d(i.adler,b.pending_buf,b.pending-p,p)),b.gzindex===b.gzhead.extra.length&&(b.gzindex=0,b.status=73)}else b.status=73;if(b.status===73)if(b.gzhead.name){p=b.pending;do{if(b.pending===b.pending_buf_size&&(b.gzhead.hcrc&&b.pending>p&&(i.adler=d(i.adler,b.pending_buf,b.pending-p,p)),M(i),p=b.pending,b.pending===b.pending_buf_size)){C=1;break}C=b.gzindex<b.gzhead.name.length?255&b.gzhead.name.charCodeAt(b.gzindex++):0,K(b,C)}while(C!==0);b.gzhead.hcrc&&b.pending>p&&(i.adler=d(i.adler,b.pending_buf,b.pending-p,p)),C===0&&(b.gzindex=0,b.status=91)}else b.status=91;if(b.status===91)if(b.gzhead.comment){p=b.pending;do{if(b.pending===b.pending_buf_size&&(b.gzhead.hcrc&&b.pending>p&&(i.adler=d(i.adler,b.pending_buf,b.pending-p,p)),M(i),p=b.pending,b.pending===b.pending_buf_size)){C=1;break}C=b.gzindex<b.gzhead.comment.length?255&b.gzhead.comment.charCodeAt(b.gzindex++):0,K(b,C)}while(C!==0);b.gzhead.hcrc&&b.pending>p&&(i.adler=d(i.adler,b.pending_buf,b.pending-p,p)),C===0&&(b.status=103)}else b.status=103;if(b.status===103&&(b.gzhead.hcrc?(b.pending+2>b.pending_buf_size&&M(i),b.pending+2<=b.pending_buf_size&&(K(b,255&i.adler),K(b,i.adler>>8&255),i.adler=0,b.status=T)):b.status=T),b.pending!==0){if(M(i),i.avail_out===0)return b.last_flush=-1,c}else if(i.avail_in===0&&$(I)<=$(B)&&I!==y)return tt(i,-5);if(b.status===666&&i.avail_in!==0)return tt(i,-5);if(i.avail_in!==0||b.lookahead!==0||I!==v&&b.status!==666){var D=b.strategy===2?(function(P,H){for(var X;;){if(P.lookahead===0&&(ot(P),P.lookahead===0)){if(H===v)return l;break}if(P.match_length=0,X=s._tr_tally(P,0,P.window[P.strstart]),P.lookahead--,P.strstart++,X&&(E(P,!1),P.strm.avail_out===0))return l}return P.insert=0,H===y?(E(P,!0),P.strm.avail_out===0?Q:U):P.last_lit&&(E(P,!1),P.strm.avail_out===0)?l:F})(b,I):b.strategy===3?(function(P,H){for(var X,W,q,it,rt=P.window;;){if(P.lookahead<=Z){if(ot(P),P.lookahead<=Z&&H===v)return l;if(P.lookahead===0)break}if(P.match_length=0,P.lookahead>=z&&0<P.strstart&&(W=rt[q=P.strstart-1])===rt[++q]&&W===rt[++q]&&W===rt[++q]){it=P.strstart+Z;do;while(W===rt[++q]&&W===rt[++q]&&W===rt[++q]&&W===rt[++q]&&W===rt[++q]&&W===rt[++q]&&W===rt[++q]&&W===rt[++q]&&q<it);P.match_length=Z-(it-q),P.match_length>P.lookahead&&(P.match_length=P.lookahead)}if(P.match_length>=z?(X=s._tr_tally(P,1,P.match_length-z),P.lookahead-=P.match_length,P.strstart+=P.match_length,P.match_length=0):(X=s._tr_tally(P,0,P.window[P.strstart]),P.lookahead--,P.strstart++),X&&(E(P,!1),P.strm.avail_out===0))return l}return P.insert=0,H===y?(E(P,!0),P.strm.avail_out===0?Q:U):P.last_lit&&(E(P,!1),P.strm.avail_out===0)?l:F})(b,I):r[b.level].func(b,I);if(D!==Q&&D!==U||(b.status=666),D===l||D===Q)return i.avail_out===0&&(b.last_flush=-1),c;if(D===F&&(I===1?s._tr_align(b):I!==5&&(s._tr_stored_block(b,0,0,!1),I===3&&(J(b.head),b.lookahead===0&&(b.strstart=0,b.block_start=0,b.insert=0))),M(i),i.avail_out===0))return b.last_flush=-1,c}return I!==y?c:b.wrap<=0?1:(b.wrap===2?(K(b,255&i.adler),K(b,i.adler>>8&255),K(b,i.adler>>16&255),K(b,i.adler>>24&255),K(b,255&i.total_in),K(b,i.total_in>>8&255),K(b,i.total_in>>16&255),K(b,i.total_in>>24&255)):(G(b,i.adler>>>16),G(b,65535&i.adler)),M(i),0<b.wrap&&(b.wrap=-b.wrap),b.pending!==0?c:1)},t.deflateEnd=function(i){var I;return i&&i.state?(I=i.state.status)!==_&&I!==69&&I!==73&&I!==91&&I!==103&&I!==T&&I!==666?tt(i,g):(i.state=null,I===T?tt(i,-3):c):g},t.deflateSetDictionary=function(i,I){var B,b,p,C,L,D,P,H,X=I.length;if(!i||!i.state||(C=(B=i.state).wrap)===2||C===1&&B.status!==_||B.lookahead)return g;for(C===1&&(i.adler=o(i.adler,I,X,0)),B.wrap=0,X>=B.w_size&&(C===0&&(J(B.head),B.strstart=0,B.block_start=0,B.insert=0),H=new n.Buf8(B.w_size),n.arraySet(H,I,X-B.w_size,B.w_size,0),I=H,X=B.w_size),L=i.avail_in,D=i.next_in,P=i.input,i.avail_in=X,i.next_in=0,i.input=I,ot(B);B.lookahead>=z;){for(b=B.strstart,p=B.lookahead-(z-1);B.ins_h=(B.ins_h<<B.hash_shift^B.window[b+z-1])&B.hash_mask,B.prev[b&B.w_mask]=B.head[B.ins_h],B.head[B.ins_h]=b,b++,--p;);B.strstart=b,B.lookahead=z-1,ot(B)}return B.strstart+=B.lookahead,B.block_start=B.strstart,B.insert=B.lookahead,B.lookahead=0,B.match_length=B.prev_length=z-1,B.match_available=0,i.next_in=D,i.input=P,i.avail_in=L,B.wrap=C,c},t.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(a,e,t){"use strict";e.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(a,e,t){"use strict";e.exports=function(r,n){var s,o,d,f,v,y,c,g,h,m,u,k,S,x,A,O,R,j,z,Z,Y,_,T,l,F;s=r.state,o=r.next_in,l=r.input,d=o+(r.avail_in-5),f=r.next_out,F=r.output,v=f-(n-r.avail_out),y=f+(r.avail_out-257),c=s.dmax,g=s.wsize,h=s.whave,m=s.wnext,u=s.window,k=s.hold,S=s.bits,x=s.lencode,A=s.distcode,O=(1<<s.lenbits)-1,R=(1<<s.distbits)-1;t:do{S<15&&(k+=l[o++]<<S,S+=8,k+=l[o++]<<S,S+=8),j=x[k&O];e:for(;;){if(k>>>=z=j>>>24,S-=z,(z=j>>>16&255)===0)F[f++]=65535&j;else{if(!(16&z)){if((64&z)==0){j=x[(65535&j)+(k&(1<<z)-1)];continue e}if(32&z){s.mode=12;break t}r.msg="invalid literal/length code",s.mode=30;break t}Z=65535&j,(z&=15)&&(S<z&&(k+=l[o++]<<S,S+=8),Z+=k&(1<<z)-1,k>>>=z,S-=z),S<15&&(k+=l[o++]<<S,S+=8,k+=l[o++]<<S,S+=8),j=A[k&R];r:for(;;){if(k>>>=z=j>>>24,S-=z,!(16&(z=j>>>16&255))){if((64&z)==0){j=A[(65535&j)+(k&(1<<z)-1)];continue r}r.msg="invalid distance code",s.mode=30;break t}if(Y=65535&j,S<(z&=15)&&(k+=l[o++]<<S,(S+=8)<z&&(k+=l[o++]<<S,S+=8)),c<(Y+=k&(1<<z)-1)){r.msg="invalid distance too far back",s.mode=30;break t}if(k>>>=z,S-=z,(z=f-v)<Y){if(h<(z=Y-z)&&s.sane){r.msg="invalid distance too far back",s.mode=30;break t}if(T=u,(_=0)===m){if(_+=g-z,z<Z){for(Z-=z;F[f++]=u[_++],--z;);_=f-Y,T=F}}else if(m<z){if(_+=g+m-z,(z-=m)<Z){for(Z-=z;F[f++]=u[_++],--z;);if(_=0,m<Z){for(Z-=z=m;F[f++]=u[_++],--z;);_=f-Y,T=F}}}else if(_+=m-z,z<Z){for(Z-=z;F[f++]=u[_++],--z;);_=f-Y,T=F}for(;2<Z;)F[f++]=T[_++],F[f++]=T[_++],F[f++]=T[_++],Z-=3;Z&&(F[f++]=T[_++],1<Z&&(F[f++]=T[_++]))}else{for(_=f-Y;F[f++]=F[_++],F[f++]=F[_++],F[f++]=F[_++],2<(Z-=3););Z&&(F[f++]=F[_++],1<Z&&(F[f++]=F[_++]))}break}}break}}while(o<d&&f<y);o-=Z=S>>3,k&=(1<<(S-=Z<<3))-1,r.next_in=o,r.next_out=f,r.avail_in=o<d?d-o+5:5-(o-d),r.avail_out=f<y?y-f+257:257-(f-y),s.hold=k,s.bits=S}},{}],49:[function(a,e,t){"use strict";var r=a("../utils/common"),n=a("./adler32"),s=a("./crc32"),o=a("./inffast"),d=a("./inftrees"),f=1,v=2,y=0,c=-2,g=1,h=852,m=592;function u(_){return(_>>>24&255)+(_>>>8&65280)+((65280&_)<<8)+((255&_)<<24)}function k(){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 r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function S(_){var T;return _&&_.state?(T=_.state,_.total_in=_.total_out=T.total=0,_.msg="",T.wrap&&(_.adler=1&T.wrap),T.mode=g,T.last=0,T.havedict=0,T.dmax=32768,T.head=null,T.hold=0,T.bits=0,T.lencode=T.lendyn=new r.Buf32(h),T.distcode=T.distdyn=new r.Buf32(m),T.sane=1,T.back=-1,y):c}function x(_){var T;return _&&_.state?((T=_.state).wsize=0,T.whave=0,T.wnext=0,S(_)):c}function A(_,T){var l,F;return _&&_.state?(F=_.state,T<0?(l=0,T=-T):(l=1+(T>>4),T<48&&(T&=15)),T&&(T<8||15<T)?c:(F.window!==null&&F.wbits!==T&&(F.window=null),F.wrap=l,F.wbits=T,x(_))):c}function O(_,T){var l,F;return _?(F=new k,(_.state=F).window=null,(l=A(_,T))!==y&&(_.state=null),l):c}var R,j,z=!0;function Z(_){if(z){var T;for(R=new r.Buf32(512),j=new r.Buf32(32),T=0;T<144;)_.lens[T++]=8;for(;T<256;)_.lens[T++]=9;for(;T<280;)_.lens[T++]=7;for(;T<288;)_.lens[T++]=8;for(d(f,_.lens,0,288,R,0,_.work,{bits:9}),T=0;T<32;)_.lens[T++]=5;d(v,_.lens,0,32,j,0,_.work,{bits:5}),z=!1}_.lencode=R,_.lenbits=9,_.distcode=j,_.distbits=5}function Y(_,T,l,F){var Q,U=_.state;return U.window===null&&(U.wsize=1<<U.wbits,U.wnext=0,U.whave=0,U.window=new r.Buf8(U.wsize)),F>=U.wsize?(r.arraySet(U.window,T,l-U.wsize,U.wsize,0),U.wnext=0,U.whave=U.wsize):(F<(Q=U.wsize-U.wnext)&&(Q=F),r.arraySet(U.window,T,l-F,Q,U.wnext),(F-=Q)?(r.arraySet(U.window,T,l-F,F,0),U.wnext=F,U.whave=U.wsize):(U.wnext+=Q,U.wnext===U.wsize&&(U.wnext=0),U.whave<U.wsize&&(U.whave+=Q))),0}t.inflateReset=x,t.inflateReset2=A,t.inflateResetKeep=S,t.inflateInit=function(_){return O(_,15)},t.inflateInit2=O,t.inflate=function(_,T){var l,F,Q,U,tt,$,J,M,E,K,G,V,ot,ft,et,nt,dt,lt,bt,gt,i,I,B,b,p=0,C=new r.Buf8(4),L=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!_||!_.state||!_.output||!_.input&&_.avail_in!==0)return c;(l=_.state).mode===12&&(l.mode=13),tt=_.next_out,Q=_.output,J=_.avail_out,U=_.next_in,F=_.input,$=_.avail_in,M=l.hold,E=l.bits,K=$,G=J,I=y;t:for(;;)switch(l.mode){case g:if(l.wrap===0){l.mode=13;break}for(;E<16;){if($===0)break t;$--,M+=F[U++]<<E,E+=8}if(2&l.wrap&&M===35615){C[l.check=0]=255&M,C[1]=M>>>8&255,l.check=s(l.check,C,2,0),E=M=0,l.mode=2;break}if(l.flags=0,l.head&&(l.head.done=!1),!(1&l.wrap)||(((255&M)<<8)+(M>>8))%31){_.msg="incorrect header check",l.mode=30;break}if((15&M)!=8){_.msg="unknown compression method",l.mode=30;break}if(E-=4,i=8+(15&(M>>>=4)),l.wbits===0)l.wbits=i;else if(i>l.wbits){_.msg="invalid window size",l.mode=30;break}l.dmax=1<<i,_.adler=l.check=1,l.mode=512&M?10:12,E=M=0;break;case 2:for(;E<16;){if($===0)break t;$--,M+=F[U++]<<E,E+=8}if(l.flags=M,(255&l.flags)!=8){_.msg="unknown compression method",l.mode=30;break}if(57344&l.flags){_.msg="unknown header flags set",l.mode=30;break}l.head&&(l.head.text=M>>8&1),512&l.flags&&(C[0]=255&M,C[1]=M>>>8&255,l.check=s(l.check,C,2,0)),E=M=0,l.mode=3;case 3:for(;E<32;){if($===0)break t;$--,M+=F[U++]<<E,E+=8}l.head&&(l.head.time=M),512&l.flags&&(C[0]=255&M,C[1]=M>>>8&255,C[2]=M>>>16&255,C[3]=M>>>24&255,l.check=s(l.check,C,4,0)),E=M=0,l.mode=4;case 4:for(;E<16;){if($===0)break t;$--,M+=F[U++]<<E,E+=8}l.head&&(l.head.xflags=255&M,l.head.os=M>>8),512&l.flags&&(C[0]=255&M,C[1]=M>>>8&255,l.check=s(l.check,C,2,0)),E=M=0,l.mode=5;case 5:if(1024&l.flags){for(;E<16;){if($===0)break t;$--,M+=F[U++]<<E,E+=8}l.length=M,l.head&&(l.head.extra_len=M),512&l.flags&&(C[0]=255&M,C[1]=M>>>8&255,l.check=s(l.check,C,2,0)),E=M=0}else l.head&&(l.head.extra=null);l.mode=6;case 6:if(1024&l.flags&&($<(V=l.length)&&(V=$),V&&(l.head&&(i=l.head.extra_len-l.length,l.head.extra||(l.head.extra=new Array(l.head.extra_len)),r.arraySet(l.head.extra,F,U,V,i)),512&l.flags&&(l.check=s(l.check,F,V,U)),$-=V,U+=V,l.length-=V),l.length))break t;l.length=0,l.mode=7;case 7:if(2048&l.flags){if($===0)break t;for(V=0;i=F[U+V++],l.head&&i&&l.length<65536&&(l.head.name+=String.fromCharCode(i)),i&&V<$;);if(512&l.flags&&(l.check=s(l.check,F,V,U)),$-=V,U+=V,i)break t}else l.head&&(l.head.name=null);l.length=0,l.mode=8;case 8:if(4096&l.flags){if($===0)break t;for(V=0;i=F[U+V++],l.head&&i&&l.length<65536&&(l.head.comment+=String.fromCharCode(i)),i&&V<$;);if(512&l.flags&&(l.check=s(l.check,F,V,U)),$-=V,U+=V,i)break t}else l.head&&(l.head.comment=null);l.mode=9;case 9:if(512&l.flags){for(;E<16;){if($===0)break t;$--,M+=F[U++]<<E,E+=8}if(M!==(65535&l.check)){_.msg="header crc mismatch",l.mode=30;break}E=M=0}l.head&&(l.head.hcrc=l.flags>>9&1,l.head.done=!0),_.adler=l.check=0,l.mode=12;break;case 10:for(;E<32;){if($===0)break t;$--,M+=F[U++]<<E,E+=8}_.adler=l.check=u(M),E=M=0,l.mode=11;case 11:if(l.havedict===0)return _.next_out=tt,_.avail_out=J,_.next_in=U,_.avail_in=$,l.hold=M,l.bits=E,2;_.adler=l.check=1,l.mode=12;case 12:if(T===5||T===6)break t;case 13:if(l.last){M>>>=7&E,E-=7&E,l.mode=27;break}for(;E<3;){if($===0)break t;$--,M+=F[U++]<<E,E+=8}switch(l.last=1&M,E-=1,3&(M>>>=1)){case 0:l.mode=14;break;case 1:if(Z(l),l.mode=20,T!==6)break;M>>>=2,E-=2;break t;case 2:l.mode=17;break;case 3:_.msg="invalid block type",l.mode=30}M>>>=2,E-=2;break;case 14:for(M>>>=7&E,E-=7&E;E<32;){if($===0)break t;$--,M+=F[U++]<<E,E+=8}if((65535&M)!=(M>>>16^65535)){_.msg="invalid stored block lengths",l.mode=30;break}if(l.length=65535&M,E=M=0,l.mode=15,T===6)break t;case 15:l.mode=16;case 16:if(V=l.length){if($<V&&(V=$),J<V&&(V=J),V===0)break t;r.arraySet(Q,F,U,V,tt),$-=V,U+=V,J-=V,tt+=V,l.length-=V;break}l.mode=12;break;case 17:for(;E<14;){if($===0)break t;$--,M+=F[U++]<<E,E+=8}if(l.nlen=257+(31&M),M>>>=5,E-=5,l.ndist=1+(31&M),M>>>=5,E-=5,l.ncode=4+(15&M),M>>>=4,E-=4,286<l.nlen||30<l.ndist){_.msg="too many length or distance symbols",l.mode=30;break}l.have=0,l.mode=18;case 18:for(;l.have<l.ncode;){for(;E<3;){if($===0)break t;$--,M+=F[U++]<<E,E+=8}l.lens[L[l.have++]]=7&M,M>>>=3,E-=3}for(;l.have<19;)l.lens[L[l.have++]]=0;if(l.lencode=l.lendyn,l.lenbits=7,B={bits:l.lenbits},I=d(0,l.lens,0,19,l.lencode,0,l.work,B),l.lenbits=B.bits,I){_.msg="invalid code lengths set",l.mode=30;break}l.have=0,l.mode=19;case 19:for(;l.have<l.nlen+l.ndist;){for(;nt=(p=l.lencode[M&(1<<l.lenbits)-1])>>>16&255,dt=65535&p,!((et=p>>>24)<=E);){if($===0)break t;$--,M+=F[U++]<<E,E+=8}if(dt<16)M>>>=et,E-=et,l.lens[l.have++]=dt;else{if(dt===16){for(b=et+2;E<b;){if($===0)break t;$--,M+=F[U++]<<E,E+=8}if(M>>>=et,E-=et,l.have===0){_.msg="invalid bit length repeat",l.mode=30;break}i=l.lens[l.have-1],V=3+(3&M),M>>>=2,E-=2}else if(dt===17){for(b=et+3;E<b;){if($===0)break t;$--,M+=F[U++]<<E,E+=8}E-=et,i=0,V=3+(7&(M>>>=et)),M>>>=3,E-=3}else{for(b=et+7;E<b;){if($===0)break t;$--,M+=F[U++]<<E,E+=8}E-=et,i=0,V=11+(127&(M>>>=et)),M>>>=7,E-=7}if(l.have+V>l.nlen+l.ndist){_.msg="invalid bit length repeat",l.mode=30;break}for(;V--;)l.lens[l.have++]=i}}if(l.mode===30)break;if(l.lens[256]===0){_.msg="invalid code -- missing end-of-block",l.mode=30;break}if(l.lenbits=9,B={bits:l.lenbits},I=d(f,l.lens,0,l.nlen,l.lencode,0,l.work,B),l.lenbits=B.bits,I){_.msg="invalid literal/lengths set",l.mode=30;break}if(l.distbits=6,l.distcode=l.distdyn,B={bits:l.distbits},I=d(v,l.lens,l.nlen,l.ndist,l.distcode,0,l.work,B),l.distbits=B.bits,I){_.msg="invalid distances set",l.mode=30;break}if(l.mode=20,T===6)break t;case 20:l.mode=21;case 21:if(6<=$&&258<=J){_.next_out=tt,_.avail_out=J,_.next_in=U,_.avail_in=$,l.hold=M,l.bits=E,o(_,G),tt=_.next_out,Q=_.output,J=_.avail_out,U=_.next_in,F=_.input,$=_.avail_in,M=l.hold,E=l.bits,l.mode===12&&(l.back=-1);break}for(l.back=0;nt=(p=l.lencode[M&(1<<l.lenbits)-1])>>>16&255,dt=65535&p,!((et=p>>>24)<=E);){if($===0)break t;$--,M+=F[U++]<<E,E+=8}if(nt&&(240&nt)==0){for(lt=et,bt=nt,gt=dt;nt=(p=l.lencode[gt+((M&(1<<lt+bt)-1)>>lt)])>>>16&255,dt=65535&p,!(lt+(et=p>>>24)<=E);){if($===0)break t;$--,M+=F[U++]<<E,E+=8}M>>>=lt,E-=lt,l.back+=lt}if(M>>>=et,E-=et,l.back+=et,l.length=dt,nt===0){l.mode=26;break}if(32&nt){l.back=-1,l.mode=12;break}if(64&nt){_.msg="invalid literal/length code",l.mode=30;break}l.extra=15&nt,l.mode=22;case 22:if(l.extra){for(b=l.extra;E<b;){if($===0)break t;$--,M+=F[U++]<<E,E+=8}l.length+=M&(1<<l.extra)-1,M>>>=l.extra,E-=l.extra,l.back+=l.extra}l.was=l.length,l.mode=23;case 23:for(;nt=(p=l.distcode[M&(1<<l.distbits)-1])>>>16&255,dt=65535&p,!((et=p>>>24)<=E);){if($===0)break t;$--,M+=F[U++]<<E,E+=8}if((240&nt)==0){for(lt=et,bt=nt,gt=dt;nt=(p=l.distcode[gt+((M&(1<<lt+bt)-1)>>lt)])>>>16&255,dt=65535&p,!(lt+(et=p>>>24)<=E);){if($===0)break t;$--,M+=F[U++]<<E,E+=8}M>>>=lt,E-=lt,l.back+=lt}if(M>>>=et,E-=et,l.back+=et,64&nt){_.msg="invalid distance code",l.mode=30;break}l.offset=dt,l.extra=15&nt,l.mode=24;case 24:if(l.extra){for(b=l.extra;E<b;){if($===0)break t;$--,M+=F[U++]<<E,E+=8}l.offset+=M&(1<<l.extra)-1,M>>>=l.extra,E-=l.extra,l.back+=l.extra}if(l.offset>l.dmax){_.msg="invalid distance too far back",l.mode=30;break}l.mode=25;case 25:if(J===0)break t;if(V=G-J,l.offset>V){if((V=l.offset-V)>l.whave&&l.sane){_.msg="invalid distance too far back",l.mode=30;break}ot=V>l.wnext?(V-=l.wnext,l.wsize-V):l.wnext-V,V>l.length&&(V=l.length),ft=l.window}else ft=Q,ot=tt-l.offset,V=l.length;for(J<V&&(V=J),J-=V,l.length-=V;Q[tt++]=ft[ot++],--V;);l.length===0&&(l.mode=21);break;case 26:if(J===0)break t;Q[tt++]=l.length,J--,l.mode=21;break;case 27:if(l.wrap){for(;E<32;){if($===0)break t;$--,M|=F[U++]<<E,E+=8}if(G-=J,_.total_out+=G,l.total+=G,G&&(_.adler=l.check=l.flags?s(l.check,Q,G,tt-G):n(l.check,Q,G,tt-G)),G=J,(l.flags?M:u(M))!==l.check){_.msg="incorrect data check",l.mode=30;break}E=M=0}l.mode=28;case 28:if(l.wrap&&l.flags){for(;E<32;){if($===0)break t;$--,M+=F[U++]<<E,E+=8}if(M!==(4294967295&l.total)){_.msg="incorrect length check",l.mode=30;break}E=M=0}l.mode=29;case 29:I=1;break t;case 30:I=-3;break t;case 31:return-4;case 32:default:return c}return _.next_out=tt,_.avail_out=J,_.next_in=U,_.avail_in=$,l.hold=M,l.bits=E,(l.wsize||G!==_.avail_out&&l.mode<30&&(l.mode<27||T!==4))&&Y(_,_.output,_.next_out,G-_.avail_out)?(l.mode=31,-4):(K-=_.avail_in,G-=_.avail_out,_.total_in+=K,_.total_out+=G,l.total+=G,l.wrap&&G&&(_.adler=l.check=l.flags?s(l.check,Q,G,_.next_out-G):n(l.check,Q,G,_.next_out-G)),_.data_type=l.bits+(l.last?64:0)+(l.mode===12?128:0)+(l.mode===20||l.mode===15?256:0),(K==0&&G===0||T===4)&&I===y&&(I=-5),I)},t.inflateEnd=function(_){if(!_||!_.state)return c;var T=_.state;return T.window&&(T.window=null),_.state=null,y},t.inflateGetHeader=function(_,T){var l;return _&&_.state?(2&(l=_.state).wrap)==0?c:((l.head=T).done=!1,y):c},t.inflateSetDictionary=function(_,T){var l,F=T.length;return _&&_.state?(l=_.state).wrap!==0&&l.mode!==11?c:l.mode===11&&n(1,T,F,0)!==l.check?-3:Y(_,T,F,F)?(l.mode=31,-4):(l.havedict=1,y):c},t.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(a,e,t){"use strict";var r=a("../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],o=[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],d=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(f,v,y,c,g,h,m,u){var k,S,x,A,O,R,j,z,Z,Y=u.bits,_=0,T=0,l=0,F=0,Q=0,U=0,tt=0,$=0,J=0,M=0,E=null,K=0,G=new r.Buf16(16),V=new r.Buf16(16),ot=null,ft=0;for(_=0;_<=15;_++)G[_]=0;for(T=0;T<c;T++)G[v[y+T]]++;for(Q=Y,F=15;1<=F&&G[F]===0;F--);if(F<Q&&(Q=F),F===0)return g[h++]=20971520,g[h++]=20971520,u.bits=1,0;for(l=1;l<F&&G[l]===0;l++);for(Q<l&&(Q=l),_=$=1;_<=15;_++)if($<<=1,($-=G[_])<0)return-1;if(0<$&&(f===0||F!==1))return-1;for(V[1]=0,_=1;_<15;_++)V[_+1]=V[_]+G[_];for(T=0;T<c;T++)v[y+T]!==0&&(m[V[v[y+T]]++]=T);if(R=f===0?(E=ot=m,19):f===1?(E=n,K-=257,ot=s,ft-=257,256):(E=o,ot=d,-1),_=l,O=h,tt=T=M=0,x=-1,A=(J=1<<(U=Q))-1,f===1&&852<J||f===2&&592<J)return 1;for(;;){for(j=_-tt,Z=m[T]<R?(z=0,m[T]):m[T]>R?(z=ot[ft+m[T]],E[K+m[T]]):(z=96,0),k=1<<_-tt,l=S=1<<U;g[O+(M>>tt)+(S-=k)]=j<<24|z<<16|Z|0,S!==0;);for(k=1<<_-1;M&k;)k>>=1;if(k!==0?(M&=k-1,M+=k):M=0,T++,--G[_]==0){if(_===F)break;_=v[y+m[T]]}if(Q<_&&(M&A)!==x){for(tt===0&&(tt=Q),O+=l,$=1<<(U=_-tt);U+tt<F&&!(($-=G[U+tt])<=0);)U++,$<<=1;if(J+=1<<U,f===1&&852<J||f===2&&592<J)return 1;g[x=M&A]=Q<<24|U<<16|O-h|0}}return M!==0&&(g[O+M]=_-tt<<24|64<<16|0),u.bits=Q,0}},{"../utils/common":41}],51:[function(a,e,t){"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(a,e,t){"use strict";var r=a("../utils/common"),n=0,s=1;function o(p){for(var C=p.length;0<=--C;)p[C]=0}var d=0,f=29,v=256,y=v+1+f,c=30,g=19,h=2*y+1,m=15,u=16,k=7,S=256,x=16,A=17,O=18,R=[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],j=[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],z=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Z=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Y=new Array(2*(y+2));o(Y);var _=new Array(2*c);o(_);var T=new Array(512);o(T);var l=new Array(256);o(l);var F=new Array(f);o(F);var Q,U,tt,$=new Array(c);function J(p,C,L,D,P){this.static_tree=p,this.extra_bits=C,this.extra_base=L,this.elems=D,this.max_length=P,this.has_stree=p&&p.length}function M(p,C){this.dyn_tree=p,this.max_code=0,this.stat_desc=C}function E(p){return p<256?T[p]:T[256+(p>>>7)]}function K(p,C){p.pending_buf[p.pending++]=255&C,p.pending_buf[p.pending++]=C>>>8&255}function G(p,C,L){p.bi_valid>u-L?(p.bi_buf|=C<<p.bi_valid&65535,K(p,p.bi_buf),p.bi_buf=C>>u-p.bi_valid,p.bi_valid+=L-u):(p.bi_buf|=C<<p.bi_valid&65535,p.bi_valid+=L)}function V(p,C,L){G(p,L[2*C],L[2*C+1])}function ot(p,C){for(var L=0;L|=1&p,p>>>=1,L<<=1,0<--C;);return L>>>1}function ft(p,C,L){var D,P,H=new Array(m+1),X=0;for(D=1;D<=m;D++)H[D]=X=X+L[D-1]<<1;for(P=0;P<=C;P++){var W=p[2*P+1];W!==0&&(p[2*P]=ot(H[W]++,W))}}function et(p){var C;for(C=0;C<y;C++)p.dyn_ltree[2*C]=0;for(C=0;C<c;C++)p.dyn_dtree[2*C]=0;for(C=0;C<g;C++)p.bl_tree[2*C]=0;p.dyn_ltree[2*S]=1,p.opt_len=p.static_len=0,p.last_lit=p.matches=0}function nt(p){8<p.bi_valid?K(p,p.bi_buf):0<p.bi_valid&&(p.pending_buf[p.pending++]=p.bi_buf),p.bi_buf=0,p.bi_valid=0}function dt(p,C,L,D){var P=2*C,H=2*L;return p[P]<p[H]||p[P]===p[H]&&D[C]<=D[L]}function lt(p,C,L){for(var D=p.heap[L],P=L<<1;P<=p.heap_len&&(P<p.heap_len&&dt(C,p.heap[P+1],p.heap[P],p.depth)&&P++,!dt(C,D,p.heap[P],p.depth));)p.heap[L]=p.heap[P],L=P,P<<=1;p.heap[L]=D}function bt(p,C,L){var D,P,H,X,W=0;if(p.last_lit!==0)for(;D=p.pending_buf[p.d_buf+2*W]<<8|p.pending_buf[p.d_buf+2*W+1],P=p.pending_buf[p.l_buf+W],W++,D===0?V(p,P,C):(V(p,(H=l[P])+v+1,C),(X=R[H])!==0&&G(p,P-=F[H],X),V(p,H=E(--D),L),(X=j[H])!==0&&G(p,D-=$[H],X)),W<p.last_lit;);V(p,S,C)}function gt(p,C){var L,D,P,H=C.dyn_tree,X=C.stat_desc.static_tree,W=C.stat_desc.has_stree,q=C.stat_desc.elems,it=-1;for(p.heap_len=0,p.heap_max=h,L=0;L<q;L++)H[2*L]!==0?(p.heap[++p.heap_len]=it=L,p.depth[L]=0):H[2*L+1]=0;for(;p.heap_len<2;)H[2*(P=p.heap[++p.heap_len]=it<2?++it:0)]=1,p.depth[P]=0,p.opt_len--,W&&(p.static_len-=X[2*P+1]);for(C.max_code=it,L=p.heap_len>>1;1<=L;L--)lt(p,H,L);for(P=q;L=p.heap[1],p.heap[1]=p.heap[p.heap_len--],lt(p,H,1),D=p.heap[1],p.heap[--p.heap_max]=L,p.heap[--p.heap_max]=D,H[2*P]=H[2*L]+H[2*D],p.depth[P]=(p.depth[L]>=p.depth[D]?p.depth[L]:p.depth[D])+1,H[2*L+1]=H[2*D+1]=P,p.heap[1]=P++,lt(p,H,1),2<=p.heap_len;);p.heap[--p.heap_max]=p.heap[1],(function(rt,mt){var St,vt,Ct,ct,Mt,jt,kt=mt.dyn_tree,we=mt.max_code,Ze=mt.stat_desc.static_tree,Ve=mt.stat_desc.has_stree,Ge=mt.stat_desc.extra_bits,Se=mt.stat_desc.extra_base,xt=mt.stat_desc.max_length,Bt=0;for(ct=0;ct<=m;ct++)rt.bl_count[ct]=0;for(kt[2*rt.heap[rt.heap_max]+1]=0,St=rt.heap_max+1;St<h;St++)xt<(ct=kt[2*kt[2*(vt=rt.heap[St])+1]+1]+1)&&(ct=xt,Bt++),kt[2*vt+1]=ct,we<vt||(rt.bl_count[ct]++,Mt=0,Se<=vt&&(Mt=Ge[vt-Se]),jt=kt[2*vt],rt.opt_len+=jt*(ct+Mt),Ve&&(rt.static_len+=jt*(Ze[2*vt+1]+Mt)));if(Bt!==0){do{for(ct=xt-1;rt.bl_count[ct]===0;)ct--;rt.bl_count[ct]--,rt.bl_count[ct+1]+=2,rt.bl_count[xt]--,Bt-=2}while(0<Bt);for(ct=xt;ct!==0;ct--)for(vt=rt.bl_count[ct];vt!==0;)we<(Ct=rt.heap[--St])||(kt[2*Ct+1]!==ct&&(rt.opt_len+=(ct-kt[2*Ct+1])*kt[2*Ct],kt[2*Ct+1]=ct),vt--)}})(p,C),ft(H,it,p.bl_count)}function i(p,C,L){var D,P,H=-1,X=C[1],W=0,q=7,it=4;for(X===0&&(q=138,it=3),C[2*(L+1)+1]=65535,D=0;D<=L;D++)P=X,X=C[2*(D+1)+1],++W<q&&P===X||(W<it?p.bl_tree[2*P]+=W:P!==0?(P!==H&&p.bl_tree[2*P]++,p.bl_tree[2*x]++):W<=10?p.bl_tree[2*A]++:p.bl_tree[2*O]++,H=P,it=(W=0)===X?(q=138,3):P===X?(q=6,3):(q=7,4))}function I(p,C,L){var D,P,H=-1,X=C[1],W=0,q=7,it=4;for(X===0&&(q=138,it=3),D=0;D<=L;D++)if(P=X,X=C[2*(D+1)+1],!(++W<q&&P===X)){if(W<it)for(;V(p,P,p.bl_tree),--W!=0;);else P!==0?(P!==H&&(V(p,P,p.bl_tree),W--),V(p,x,p.bl_tree),G(p,W-3,2)):W<=10?(V(p,A,p.bl_tree),G(p,W-3,3)):(V(p,O,p.bl_tree),G(p,W-11,7));H=P,it=(W=0)===X?(q=138,3):P===X?(q=6,3):(q=7,4)}}o($);var B=!1;function b(p,C,L,D){G(p,(d<<1)+(D?1:0),3),(function(P,H,X,W){nt(P),W&&(K(P,X),K(P,~X)),r.arraySet(P.pending_buf,P.window,H,X,P.pending),P.pending+=X})(p,C,L,!0)}t._tr_init=function(p){B||((function(){var C,L,D,P,H,X=new Array(m+1);for(P=D=0;P<f-1;P++)for(F[P]=D,C=0;C<1<<R[P];C++)l[D++]=P;for(l[D-1]=P,P=H=0;P<16;P++)for($[P]=H,C=0;C<1<<j[P];C++)T[H++]=P;for(H>>=7;P<c;P++)for($[P]=H<<7,C=0;C<1<<j[P]-7;C++)T[256+H++]=P;for(L=0;L<=m;L++)X[L]=0;for(C=0;C<=143;)Y[2*C+1]=8,C++,X[8]++;for(;C<=255;)Y[2*C+1]=9,C++,X[9]++;for(;C<=279;)Y[2*C+1]=7,C++,X[7]++;for(;C<=287;)Y[2*C+1]=8,C++,X[8]++;for(ft(Y,y+1,X),C=0;C<c;C++)_[2*C+1]=5,_[2*C]=ot(C,5);Q=new J(Y,R,v+1,y,m),U=new J(_,j,0,c,m),tt=new J(new Array(0),z,0,g,k)})(),B=!0),p.l_desc=new M(p.dyn_ltree,Q),p.d_desc=new M(p.dyn_dtree,U),p.bl_desc=new M(p.bl_tree,tt),p.bi_buf=0,p.bi_valid=0,et(p)},t._tr_stored_block=b,t._tr_flush_block=function(p,C,L,D){var P,H,X=0;0<p.level?(p.strm.data_type===2&&(p.strm.data_type=(function(W){var q,it=4093624447;for(q=0;q<=31;q++,it>>>=1)if(1&it&&W.dyn_ltree[2*q]!==0)return n;if(W.dyn_ltree[18]!==0||W.dyn_ltree[20]!==0||W.dyn_ltree[26]!==0)return s;for(q=32;q<v;q++)if(W.dyn_ltree[2*q]!==0)return s;return n})(p)),gt(p,p.l_desc),gt(p,p.d_desc),X=(function(W){var q;for(i(W,W.dyn_ltree,W.l_desc.max_code),i(W,W.dyn_dtree,W.d_desc.max_code),gt(W,W.bl_desc),q=g-1;3<=q&&W.bl_tree[2*Z[q]+1]===0;q--);return W.opt_len+=3*(q+1)+5+5+4,q})(p),P=p.opt_len+3+7>>>3,(H=p.static_len+3+7>>>3)<=P&&(P=H)):P=H=L+5,L+4<=P&&C!==-1?b(p,C,L,D):p.strategy===4||H===P?(G(p,2+(D?1:0),3),bt(p,Y,_)):(G(p,4+(D?1:0),3),(function(W,q,it,rt){var mt;for(G(W,q-257,5),G(W,it-1,5),G(W,rt-4,4),mt=0;mt<rt;mt++)G(W,W.bl_tree[2*Z[mt]+1],3);I(W,W.dyn_ltree,q-1),I(W,W.dyn_dtree,it-1)})(p,p.l_desc.max_code+1,p.d_desc.max_code+1,X+1),bt(p,p.dyn_ltree,p.dyn_dtree)),et(p),D&&nt(p)},t._tr_tally=function(p,C,L){return p.pending_buf[p.d_buf+2*p.last_lit]=C>>>8&255,p.pending_buf[p.d_buf+2*p.last_lit+1]=255&C,p.pending_buf[p.l_buf+p.last_lit]=255&L,p.last_lit++,C===0?p.dyn_ltree[2*L]++:(p.matches++,C--,p.dyn_ltree[2*(l[L]+v+1)]++,p.dyn_dtree[2*E(C)]++),p.last_lit===p.lit_bufsize-1},t._tr_align=function(p){G(p,2,3),V(p,S,Y),(function(C){C.bi_valid===16?(K(C,C.bi_buf),C.bi_buf=0,C.bi_valid=0):8<=C.bi_valid&&(C.pending_buf[C.pending++]=255&C.bi_buf,C.bi_buf>>=8,C.bi_valid-=8)})(p)}},{"../utils/common":41}],53:[function(a,e,t){"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(a,e,t){(function(r){(function(n,s){"use strict";if(!n.setImmediate){var o,d,f,v,y=1,c={},g=!1,h=n.document,m=Object.getPrototypeOf&&Object.getPrototypeOf(n);m=m&&m.setTimeout?m:n,o={}.toString.call(n.process)==="[object process]"?function(x){process.nextTick(function(){k(x)})}:(function(){if(n.postMessage&&!n.importScripts){var x=!0,A=n.onmessage;return n.onmessage=function(){x=!1},n.postMessage("","*"),n.onmessage=A,x}})()?(v="setImmediate$"+Math.random()+"$",n.addEventListener?n.addEventListener("message",S,!1):n.attachEvent("onmessage",S),function(x){n.postMessage(v+x,"*")}):n.MessageChannel?((f=new MessageChannel).port1.onmessage=function(x){k(x.data)},function(x){f.port2.postMessage(x)}):h&&"onreadystatechange"in h.createElement("script")?(d=h.documentElement,function(x){var A=h.createElement("script");A.onreadystatechange=function(){k(x),A.onreadystatechange=null,d.removeChild(A),A=null},d.appendChild(A)}):function(x){setTimeout(k,0,x)},m.setImmediate=function(x){typeof x!="function"&&(x=new Function(""+x));for(var A=new Array(arguments.length-1),O=0;O<A.length;O++)A[O]=arguments[O+1];var R={callback:x,args:A};return c[y]=R,o(y),y++},m.clearImmediate=u}function u(x){delete c[x]}function k(x){if(g)setTimeout(k,0,x);else{var A=c[x];if(A){g=!0;try{(function(O){var R=O.callback,j=O.args;switch(j.length){case 0:R();break;case 1:R(j[0]);break;case 2:R(j[0],j[1]);break;case 3:R(j[0],j[1],j[2]);break;default:R.apply(s,j)}})(A)}finally{u(x),g=!1}}}}function S(x){x.source===n&&typeof x.data=="string"&&x.data.indexOf(v)===0&&k(+x.data.slice(v.length))}})(typeof self>"u"?r===void 0?this:r:self)}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})});var Ie=er(Ae(),1);/*
17
+ * @license
18
+ * docx-preview <https://github.com/VolodymyrBaydalka/docxjs>
19
+ * Released under Apache License 2.0 <https://github.com/VolodymyrBaydalka/docxjs/blob/master/LICENSE>
20
+ * Copyright Volodymyr Baydalka
21
+ */var ht;(function(a){a.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"})(ht||(ht={}));function rr(a,e){return e.elements(a).map(t=>({id:e.attr(t,"Id"),type:e.attr(t,"Type"),target:e.attr(t,"Target"),targetMode:e.attr(t,"TargetMode")}))}function nr(a){return a?.replace(/[ .]+/g,"-").replace(/[&]+/g,"and").toLowerCase()}function Wt(a){return/^[^"'].*\s.*[^"']$/.test(a)?`'${a}'`:a}function Rt(a){let e=a.lastIndexOf("/")+1,t=e==0?"":a.substring(0,e),r=e==0?a:a.substring(e);return[t,r]}function $t(a,e){try{let t="http://docx/";return new URL(a,t+e).toString().substring(t.length)}catch{return`${e}${a}`}}function _t(a,e){return a.reduce((t,r)=>(t[e(r)]=r,t),{})}function ar(a){return new Promise((e,t)=>{let r=new FileReader;r.onloadend=()=>e(r.result),r.onerror=()=>t(),r.readAsDataURL(a)})}function Ht(a){return a&&typeof a=="object"&&!Array.isArray(a)}function Zt(a){return typeof a=="string"||a instanceof String}function It(a,...e){if(!e.length)return a;let t=e.shift();if(Ht(a)&&Ht(t))for(let r in t)if(Ht(t[r])){let n=a[r]??(a[r]={});It(n,t[r])}else a[r]=t[r];return It(a,...e)}function Pt(a){return Array.isArray(a)?a:[a]}function sr(a,e,t){return e>a?e:t<a?t:a}var Oe={wordml:"http://schemas.openxmlformats.org/wordprocessingml/2006/main"},ut={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 Fe(a,e=ut.Dxa){if(a==null||/.+(p[xt]|[%])$/.test(a))return a;var t=parseInt(a)*e.mul;return e.min&&e.max&&(t=sr(t,e.min,e.max)),`${t.toFixed(2)}${e.unit}`}function ir(a,e=!1){switch(a){case"1":return!0;case"0":return!1;case"on":return!0;case"off":return!1;case"true":return!0;case"false":return!1;default:return e}}function Le(a,e,t){if(a.namespaceURI!=Oe.wordml)return!1;switch(a.localName){case"color":e.color=t.attr(a,"val");break;case"sz":e.fontSize=t.lengthAttr(a,"val",ut.FontSize);break;default:return!1}return!0}function or(a,e=!1){e&&(a=a.replace(/<[?].*[?]>/,"")),a=cr(a);let t=new DOMParser().parseFromString(a,"application/xml"),r=lr(t);if(r)throw new Error(r);return t}function lr(a){return a.getElementsByTagName("parsererror")[0]?.textContent}function cr(a){return a.charCodeAt(0)===65279?a.substring(1):a}function hr(a){return new XMLSerializer().serializeToString(a)}var Ot=class{elements(e,t=null){let r=[];for(let n=0,s=e.childNodes.length;n<s;n++){let o=e.childNodes.item(n);o.nodeType==Node.ELEMENT_NODE&&(t==null||o.localName==t)&&r.push(o)}return r}element(e,t){for(let r=0,n=e.childNodes.length;r<n;r++){let s=e.childNodes.item(r);if(s.nodeType==1&&s.localName==t)return s}return null}elementAttr(e,t,r){var n=this.element(e,t);return n?this.attr(n,r):void 0}attrs(e){return Array.from(e.attributes)}attr(e,t){for(let r=0,n=e.attributes.length;r<n;r++){let s=e.attributes.item(r);if(s.localName==t)return s.value}return null}intAttr(e,t,r=null){var n=this.attr(e,t);return n?parseInt(n):r}hexAttr(e,t,r=null){var n=this.attr(e,t);return n?parseInt(n,16):r}floatAttr(e,t,r=null){var n=this.attr(e,t);return n?parseFloat(n):r}boolAttr(e,t,r=null){return ir(this.attr(e,t),r)}lengthAttr(e,t,r=ut.Dxa){return Fe(this.attr(e,t),r)}},w=new Ot,pt=class{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(){this._package.update(this.path,hr(this._xmlDocument))}parseXml(e){}},ur={embedRegular:"regular",embedBold:"bold",embedItalic:"italic",embedBoldItalic:"boldItalic"};function dr(a,e){return e.elements(a).map(t=>fr(t,e))}function fr(a,e){let t={name:e.attr(a,"name"),embedFontRefs:[]};for(let r of e.elements(a))switch(r.localName){case"family":t.family=e.attr(r,"val");break;case"altName":t.altName=e.attr(r,"val");break;case"embedRegular":case"embedBold":case"embedItalic":case"embedBoldItalic":t.embedFontRefs.push(pr(r,e));break}return t}function pr(a,e){return{id:e.attr(a,"id"),key:e.attr(a,"fontKey"),type:ur[a.localName]}}var Vt=class extends pt{parseXml(e){this.fonts=dr(e,this._package.xmlParser)}};function mr(a,e){return e.elements(a).map(t=>({extension:e.attr(t,"Extension"),partName:e.attr(t,"PartName"),contentType:e.attr(t,"ContentType")}))}var Gt=class a{constructor(e,t){this._zip=e,this.options=t,this.xmlParser=new Ot}get(e){let t=gr(e);return this._zip.files[t]??this._zip.files[t.replace(/\//g,"\\")]}update(e,t){this._zip.file(e,t)}static async load(e,t){let r=await Ie.default.loadAsync(e);return new a(r,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){let t="_rels/.rels";if(e!=null){let[n,s]=Rt(e);t=`${n}_rels/${s}.rels`}let r=await this.load(t);return r?rr(this.parseXmlDocument(r).firstElementChild,this.xmlParser):null}async loadContentTypes(){let e=await this.load("[Content_Types].xml");return e?mr(this.parseXmlDocument(e).firstElementChild,this.xmlParser):[]}parseXmlDocument(e){return or(e,this.options.trimXmlDeclaration)}};function gr(a){return a.startsWith("/")?a.substr(1):a}var Xt=class extends pt{constructor(e,t,r){super(e,t),this._documentParser=r}parseXml(e){this.body=this._documentParser.parseDocumentFile(e)}};function zt(a,e){return{type:e.attr(a,"val"),color:e.attr(a,"color"),size:e.lengthAttr(a,"sz",ut.Border),offset:e.lengthAttr(a,"space",ut.Point),frame:e.boolAttr(a,"frame"),shadow:e.boolAttr(a,"shadow")}}function br(a,e){var t={};for(let r of e.elements(a))switch(r.localName){case"left":t.left=zt(r,e);break;case"top":t.top=zt(r,e);break;case"right":t.right=zt(r,e);break;case"bottom":t.bottom=zt(r,e);break}return t}var Pe;(function(a){a.Continuous="continuous",a.NextPage="nextPage",a.NextColumn="nextColumn",a.EvenPage="evenPage",a.OddPage="oddPage"})(Pe||(Pe={}));function De(a,e=w){var t={};for(let r of e.elements(a))switch(r.localName){case"pgSz":t.pageSize={width:e.lengthAttr(r,"w"),height:e.lengthAttr(r,"h"),orientation:e.attr(r,"orient")};break;case"type":t.type=e.attr(r,"val");break;case"pgMar":t.pageMargins={left:e.lengthAttr(r,"left"),right:e.lengthAttr(r,"right"),top:e.lengthAttr(r,"top"),bottom:e.lengthAttr(r,"bottom"),header:e.lengthAttr(r,"header"),footer:e.lengthAttr(r,"footer"),gutter:e.lengthAttr(r,"gutter")};break;case"cols":t.columns=vr(r,e);break;case"headerReference":(t.headerRefs??(t.headerRefs=[])).push(Ee(r,e));break;case"footerReference":(t.footerRefs??(t.footerRefs=[])).push(Ee(r,e));break;case"titlePg":t.titlePage=e.boolAttr(r,"val",!0);break;case"pgBorders":t.pageBorders=br(r,e);break;case"pgNumType":t.pageNumber=kr(r,e);break}return t}function vr(a,e){return{numberOfColumns:e.intAttr(a,"num"),space:e.lengthAttr(a,"space"),separator:e.boolAttr(a,"sep"),equalWidth:e.boolAttr(a,"equalWidth",!0),columns:e.elements(a,"col").map(t=>({width:e.lengthAttr(t,"w"),space:e.lengthAttr(t,"space")}))}}function kr(a,e){return{chapSep:e.attr(a,"chapSep"),chapStyle:e.attr(a,"chapStyle"),format:e.attr(a,"fmt"),start:e.intAttr(a,"start")}}function Ee(a,e){return{id:e.attr(a,"id"),type:e.attr(a,"type")}}function yr(a,e){return{before:e.lengthAttr(a,"before"),after:e.lengthAttr(a,"after"),line:e.intAttr(a,"line"),lineRule:e.attr(a,"lineRule")}}function _e(a,e){let t={};for(let r of e.elements(a))_r(r,t,e);return t}function _r(a,e,t){return!!Le(a,e,t)}function je(a,e){let t={};for(let r of e.elements(a))Ue(r,t,e);return t}function Ue(a,e,t){if(a.namespaceURI!=Oe.wordml)return!1;if(Le(a,e,t))return!0;switch(a.localName){case"tabs":e.tabs=wr(a,t);break;case"sectPr":e.sectionProps=De(a,t);break;case"numPr":e.numbering=Sr(a,t);break;case"spacing":return e.lineSpacing=yr(a,t),!1;case"textAlignment":return e.textAlignment=t.attr(a,"val"),!1;case"keepLines":e.keepLines=t.boolAttr(a,"val",!0);break;case"keepNext":e.keepNext=t.boolAttr(a,"val",!0);break;case"pageBreakBefore":e.pageBreakBefore=t.boolAttr(a,"val",!0);break;case"outlineLvl":e.outlineLevel=t.intAttr(a,"val");break;case"pStyle":e.styleName=t.attr(a,"val");break;case"rPr":e.runProps=_e(a,t);break;default:return!1}return!0}function wr(a,e){return e.elements(a,"tab").map(t=>({position:e.lengthAttr(t,"pos"),leader:e.attr(t,"leader"),style:e.attr(t,"val")}))}function Sr(a,e){var t={};for(let r of e.elements(a))switch(r.localName){case"numId":t.id=e.attr(r,"val");break;case"ilvl":t.level=e.intAttr(r,"val");break}return t}function Cr(a,e){let t={numberings:[],abstractNumberings:[],bulletPictures:[]};for(let r of e.elements(a))switch(r.localName){case"num":t.numberings.push(xr(r,e));break;case"abstractNum":t.abstractNumberings.push(Ar(r,e));break;case"numPicBullet":t.bulletPictures.push(Er(r,e));break}return t}function xr(a,e){let t={id:e.attr(a,"numId"),overrides:[]};for(let r of e.elements(a))switch(r.localName){case"abstractNumId":t.abstractId=e.attr(r,"val");break;case"lvlOverride":t.overrides.push(Pr(r,e));break}return t}function Ar(a,e){let t={id:e.attr(a,"abstractNumId"),levels:[]};for(let r of e.elements(a))switch(r.localName){case"name":t.name=e.attr(r,"val");break;case"multiLevelType":t.multiLevelType=e.attr(r,"val");break;case"numStyleLink":t.numberingStyleLink=e.attr(r,"val");break;case"styleLink":t.styleLink=e.attr(r,"val");break;case"lvl":t.levels.push($e(r,e));break}return t}function $e(a,e){let t={level:e.intAttr(a,"ilvl")};for(let r of e.elements(a))switch(r.localName){case"start":t.start=e.attr(r,"val");break;case"lvlRestart":t.restart=e.intAttr(r,"val");break;case"numFmt":t.format=e.attr(r,"val");break;case"lvlText":t.text=e.attr(r,"val");break;case"lvlJc":t.justification=e.attr(r,"val");break;case"lvlPicBulletId":t.bulletPictureId=e.attr(r,"val");break;case"pStyle":t.paragraphStyle=e.attr(r,"val");break;case"pPr":t.paragraphProps=je(r,e);break;case"rPr":t.runProps=_e(r,e);break}return t}function Pr(a,e){let t={level:e.intAttr(a,"ilvl")};for(let r of e.elements(a))switch(r.localName){case"startOverride":t.start=e.intAttr(r,"val");break;case"lvl":t.numberingLevel=$e(r,e);break}return t}function Er(a,e){var t=e.element(a,"pict"),r=t&&e.element(t,"shape"),n=r&&e.element(r,"imagedata");return n?{id:e.attr(a,"numPicBulletId"),referenceId:e.attr(n,"id"),style:e.attr(r,"style")}:null}var qt=class extends pt{constructor(e,t,r){super(e,t),this._documentParser=r}parseXml(e){Object.assign(this,Cr(e,this._package.xmlParser)),this.domNumberings=this._documentParser.parseNumberingFile(e)}},Kt=class extends pt{constructor(e,t,r){super(e,t),this._documentParser=r}parseXml(e){this.styles=this._documentParser.parseStylesFile(e)}},N;(function(a){a.Document="document",a.Paragraph="paragraph",a.Run="run",a.Break="break",a.NoBreakHyphen="noBreakHyphen",a.Table="table",a.Row="row",a.Cell="cell",a.Hyperlink="hyperlink",a.SmartTag="smartTag",a.Drawing="drawing",a.Image="image",a.Text="text",a.Tab="tab",a.Symbol="symbol",a.BookmarkStart="bookmarkStart",a.BookmarkEnd="bookmarkEnd",a.Footer="footer",a.Header="header",a.FootnoteReference="footnoteReference",a.EndnoteReference="endnoteReference",a.Footnote="footnote",a.Endnote="endnote",a.SimpleField="simpleField",a.ComplexField="complexField",a.Instruction="instruction",a.VmlPicture="vmlPicture",a.MmlMath="mmlMath",a.MmlMathParagraph="mmlMathParagraph",a.MmlFraction="mmlFraction",a.MmlFunction="mmlFunction",a.MmlFunctionName="mmlFunctionName",a.MmlNumerator="mmlNumerator",a.MmlDenominator="mmlDenominator",a.MmlRadical="mmlRadical",a.MmlBase="mmlBase",a.MmlDegree="mmlDegree",a.MmlSuperscript="mmlSuperscript",a.MmlSubscript="mmlSubscript",a.MmlPreSubSuper="mmlPreSubSuper",a.MmlSubArgument="mmlSubArgument",a.MmlSuperArgument="mmlSuperArgument",a.MmlNary="mmlNary",a.MmlDelimiter="mmlDelimiter",a.MmlRun="mmlRun",a.MmlEquationArray="mmlEquationArray",a.MmlLimit="mmlLimit",a.MmlLimitLower="mmlLimitLower",a.MmlMatrix="mmlMatrix",a.MmlMatrixRow="mmlMatrixRow",a.MmlBox="mmlBox",a.MmlBar="mmlBar",a.MmlGroupChar="mmlGroupChar",a.VmlElement="vmlElement",a.Inserted="inserted",a.Deleted="deleted",a.DeletedText="deletedText",a.Comment="comment",a.CommentReference="commentReference",a.CommentRangeStart="commentRangeStart",a.CommentRangeEnd="commentRangeEnd",a.AltChunk="altChunk"})(N||(N={}));var yt=class{constructor(){this.children=[],this.cssStyle={}}},Yt=class extends yt{constructor(){super(...arguments),this.type=N.Header}},Jt=class extends yt{constructor(){super(...arguments),this.type=N.Footer}},Ft=class extends pt{constructor(e,t,r){super(e,t),this._documentParser=r}parseXml(e){this.rootElement=this.createRootElement(),this.rootElement.children=this._documentParser.parseBodyElements(e)}},Qt=class extends Ft{createRootElement(){return new Yt}},te=class extends Ft{createRootElement(){return new Jt}};function Nr(a,e){let t={};for(let r of e.elements(a))switch(r.localName){case"Template":t.template=r.textContent;break;case"Pages":t.pages=Et(r.textContent);break;case"Words":t.words=Et(r.textContent);break;case"Characters":t.characters=Et(r.textContent);break;case"Application":t.application=r.textContent;break;case"Lines":t.lines=Et(r.textContent);break;case"Paragraphs":t.paragraphs=Et(r.textContent);break;case"Company":t.company=r.textContent;break;case"AppVersion":t.appVersion=r.textContent;break}return t}function Et(a){if(!(typeof a>"u"))return parseInt(a)}var ee=class extends pt{parseXml(e){this.props=Nr(e,this._package.xmlParser)}};function Mr(a,e){let t={};for(let r of e.elements(a))switch(r.localName){case"title":t.title=r.textContent;break;case"description":t.description=r.textContent;break;case"subject":t.subject=r.textContent;break;case"creator":t.creator=r.textContent;break;case"keywords":t.keywords=r.textContent;break;case"language":t.language=r.textContent;break;case"lastModifiedBy":t.lastModifiedBy=r.textContent;break;case"revision":r.textContent&&(t.revision=parseInt(r.textContent));break}return t}var re=class extends pt{parseXml(e){this.props=Mr(e,this._package.xmlParser)}},ne=class{};function Br(a,e){var t=new ne,r=e.element(a,"themeElements");for(let n of e.elements(r))switch(n.localName){case"clrScheme":t.colorScheme=zr(n,e);break;case"fontScheme":t.fontScheme=Rr(n,e);break}return t}function zr(a,e){var t={name:e.attr(a,"name"),colors:{}};for(let s of e.elements(a)){var r=e.element(s,"srgbClr"),n=e.element(s,"sysClr");r?t.colors[s.localName]=e.attr(r,"val"):n&&(t.colors[s.localName]=e.attr(n,"lastClr"))}return t}function Rr(a,e){var t={name:e.attr(a,"name")};for(let r of e.elements(a))switch(r.localName){case"majorFont":t.majorFont=Ne(r,e);break;case"minorFont":t.minorFont=Ne(r,e);break}return t}function Ne(a,e){return{latinTypeface:e.elementAttr(a,"latin","typeface"),eaTypeface:e.elementAttr(a,"ea","typeface"),csTypeface:e.elementAttr(a,"cs","typeface")}}var ae=class extends pt{constructor(e,t){super(e,t)}parseXml(e){this.theme=Br(e,this._package.xmlParser)}},Lt=class{},se=class extends Lt{constructor(){super(...arguments),this.type=N.Footnote}},ie=class extends Lt{constructor(){super(...arguments),this.type=N.Endnote}},Dt=class extends pt{constructor(e,t,r){super(e,t),this._documentParser=r}},oe=class extends Dt{constructor(e,t,r){super(e,t,r)}parseXml(e){this.notes=this._documentParser.parseNotes(e,"footnote",se)}},le=class extends Dt{constructor(e,t,r){super(e,t,r)}parseXml(e){this.notes=this._documentParser.parseNotes(e,"endnote",ie)}};function Tr(a,e){var t={};for(let r of e.elements(a))switch(r.localName){case"defaultTabStop":t.defaultTabStop=e.lengthAttr(r,"val");break;case"footnotePr":t.footnoteProps=Me(r,e);break;case"endnotePr":t.endnoteProps=Me(r,e);break;case"autoHyphenation":t.autoHyphenation=e.boolAttr(r,"val");break;case"evenAndOddHeaders":t.evenAndOddHeaders=e.boolAttr(r,"val",!0);break}return t}function Me(a,e){var t={defaultNoteIds:[]};for(let r of e.elements(a))switch(r.localName){case"numFmt":t.nummeringFormat=e.attr(r,"val");break;case"footnote":case"endnote":t.defaultNoteIds.push(e.attr(r,"id"));break}return t}var ce=class extends pt{constructor(e,t){super(e,t)}parseXml(e){this.settings=Tr(e,this._package.xmlParser)}};function Ir(a,e){return e.elements(a,"property").map(t=>{let r=t.firstChild;return{formatId:e.attr(t,"fmtid"),name:e.attr(t,"name"),type:r.nodeName,value:r.textContent}})}var he=class extends pt{parseXml(e){this.props=Ir(e,this._package.xmlParser)}},ue=class extends pt{constructor(e,t,r){super(e,t),this._documentParser=r}parseXml(e){this.comments=this._documentParser.parseComments(e),this.commentMap=_t(this.comments,t=>t.id)}},de=class extends pt{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=_t(this.comments,r=>r.paraId)}},Or=[{type:ht.OfficeDocument,target:"word/document.xml"},{type:ht.ExtendedProperties,target:"docProps/app.xml"},{type:ht.CoreProperties,target:"docProps/core.xml"},{type:ht.CustomProperties,target:"docProps/custom.xml"}],fe=class a{constructor(){this.parts=[],this.partsMap={},this.contentTypes=[]}static async load(e,t,r){var n=new a;return n._options=r,n._parser=t,n._package=await Gt.load(e,r),n.rels=await n._package.loadRelationships(),n.contentTypes=await n._package.loadContentTypes(),await Promise.all(Or.map(s=>{let o=n.rels.find(d=>d.type===s.type)??s;return n.loadRelationshipPart(o.target,o.type)})),n}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 ht.OfficeDocument:this.documentPart=r=new Xt(this._package,e,this._parser);break;case ht.FontTable:this.fontTablePart=r=new Vt(this._package,e);break;case ht.Numbering:this.numberingPart=r=new qt(this._package,e,this._parser);break;case ht.Styles:this.stylesPart=r=new Kt(this._package,e,this._parser);break;case ht.Theme:this.themePart=r=new ae(this._package,e);break;case ht.Footnotes:this.footnotesPart=r=new oe(this._package,e,this._parser);break;case ht.Endnotes:this.endnotesPart=r=new le(this._package,e,this._parser);break;case ht.Footer:r=new te(this._package,e,this._parser);break;case ht.Header:r=new Qt(this._package,e,this._parser);break;case ht.CoreProperties:this.corePropsPart=r=new re(this._package,e);break;case ht.ExtendedProperties:this.extendedPropsPart=r=new ee(this._package,e);break;case ht.CustomProperties:r=new he(this._package,e);break;case ht.Settings:this.settingsPart=r=new ce(this._package,e);break;case ht.Comments:this.commentsPart=r=new ue(this._package,e,this._parser);break;case ht.CommentsExtended:this.commentsExtendedPart=r=new de(this._package,e);break}if(r==null)return Promise.resolve(null);if(this.partsMap[e]=r,this.parts.push(r),await r.load(),r.rels?.length>0){let[n]=Rt(r.path);await Promise.all(r.rels.map(s=>this.loadRelationshipPart($t(s.target,n),s.type)))}return r}async loadDocumentImage(e,t){let r=this.getPathById(t??this.documentPart,e);return r?this.blobToURL(await this._package.load(r,"blob"),r):null}async loadNumberingImage(e){let t=this.getPathById(this.numberingPart,e);return t?this.blobToURL(await this._package.load(t,"blob"),t):null}async loadFont(e,t){let r=this.getPathById(this.fontTablePart,e);if(!r)return null;let n=await this._package.load(r,"uint8array");return n&&this.blobToURL(new Blob([Fr(n,t)]),r)}async loadAltChunk(e,t){let r=this.getPathById(t??this.documentPart,e);return r?this._package.load(r,"string"):Promise.resolve(null)}blobToURL(e,t){if(!e)return null;if(t){let r=this.contentTypes.find(n=>n.partName===t||n.extension&&t.endsWith(`.${n.extension}`));e=r?new Blob([e],{type:r.contentType}):e}return this._options.useBase64URL?ar(e):URL.createObjectURL(e)}findPartByRelId(e,t=null){var r=(t.rels??this.rels).find(s=>s.id==e);let n=t?Rt(t.path)[0]:"";return r?this.partsMap[$t(r.target,n)]:null}getPathById(e,t){let r=e.rels.find(s=>s.id==t),[n]=Rt(e.path);return r?$t(r.target,n):null}};function Fr(a,e){let r=e.replace(/{|}|-/g,""),n=new Array(16);for(let s=0;s<16;s++)n[16-s-1]=parseInt(r.substring(s*2,s*2+2),16);for(let s=0;s<32;s++)a[s]=a[s]^n[s%16];return a}function Lr(a,e){return{type:N.BookmarkStart,id:e.attr(a,"id"),name:e.attr(a,"name"),colFirst:e.intAttr(a,"colFirst"),colLast:e.intAttr(a,"colLast")}}function Dr(a,e){return{type:N.BookmarkEnd,id:e.attr(a,"id")}}var pe=class extends yt{constructor(){super(...arguments),this.type=N.VmlElement,this.attrs={}}};function He(a,e){var t=new pe;switch(a.localName){case"rect":t.tagName="rect",Object.assign(t.attrs,{width:"100%",height:"100%"});break;case"oval":t.tagName="ellipse",Object.assign(t.attrs,{cx:"50%",cy:"50%",rx:"50%",ry:"50%"});break;case"line":t.tagName="line";break;case"shape":t.tagName="g";break;case"textbox":t.tagName="foreignObject",Object.assign(t.attrs,{width:"100%",height:"100%"});break;default:return null}for(let r of w.attrs(a))switch(r.localName){case"style":t.cssStyleText=r.value;break;case"fillcolor":t.attrs.fill=r.value;break;case"from":let[n,s]=Be(r.value);Object.assign(t.attrs,{x1:n,y1:s});break;case"to":let[o,d]=Be(r.value);Object.assign(t.attrs,{x2:o,y2:d});break}for(let r of w.elements(a))switch(r.localName){case"stroke":Object.assign(t.attrs,jr(r));break;case"fill":Object.assign(t.attrs,Ur());break;case"imagedata":t.tagName="image",Object.assign(t.attrs,{width:"100%",height:"100%"}),t.imageHref={id:w.attr(r,"id"),title:w.attr(r,"title")};break;case"txbxContent":t.children.push(...e.parseBodyElements(r));break;default:let n=He(r,e);n&&t.children.push(n);break}return t}function jr(a){return{stroke:w.attr(a,"color"),"stroke-width":w.lengthAttr(a,"weight",ut.Emu)??"1px"}}function Ur(a){return{}}function Be(a){return a.split(",")}var me=class extends yt{constructor(){super(...arguments),this.type=N.Comment}},ge=class extends yt{constructor(e){super(),this.id=e,this.type=N.CommentReference}},be=class extends yt{constructor(e){super(),this.id=e,this.type=N.CommentRangeStart}},ve=class extends yt{constructor(e){super(),this.id=e,this.type=N.CommentRangeEnd}},Tt={shd:"inherit",color:"black",borderColor:"black",highlight:"transparent"},$r=[],ze={oMath:N.MmlMath,oMathPara:N.MmlMathParagraph,f:N.MmlFraction,func:N.MmlFunction,fName:N.MmlFunctionName,num:N.MmlNumerator,den:N.MmlDenominator,rad:N.MmlRadical,deg:N.MmlDegree,e:N.MmlBase,sSup:N.MmlSuperscript,sSub:N.MmlSubscript,sPre:N.MmlPreSubSuper,sup:N.MmlSuperArgument,sub:N.MmlSubArgument,d:N.MmlDelimiter,nary:N.MmlNary,eqArr:N.MmlEquationArray,lim:N.MmlLimit,limLow:N.MmlLimitLower,m:N.MmlMatrix,mr:N.MmlMatrixRow,box:N.MmlBox,bar:N.MmlBar,groupChr:N.MmlGroupChar},ke=class{constructor(e){this.options={ignoreWidth:!1,debug:!1,...e}}parseNotes(e,t,r){var n=[];for(let s of w.elements(e,t)){let o=new r;o.id=w.attr(s,"id"),o.noteType=w.attr(s,"type"),o.children=this.parseBodyElements(s),n.push(o)}return n}parseComments(e){var t=[];for(let r of w.elements(e,"comment")){let n=new me;n.id=w.attr(r,"id"),n.author=w.attr(r,"author"),n.initials=w.attr(r,"initials"),n.date=w.attr(r,"date"),n.children=this.parseBodyElements(r),t.push(n)}return t}parseDocumentFile(e){var t=w.element(e,"body"),r=w.element(e,"background"),n=w.element(t,"sectPr");return{type:N.Document,children:this.parseBodyElements(t),props:n?De(n,w):{},cssStyle:r?this.parseBackground(r):{}}}parseBackground(e){var t={},r=wt.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,n=>this.parseBodyElements(n)));break}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));break}return t}parseDefaultStyles(e){var t={id:null,name:null,target:null,basedOn:null,styles:[]};for(let s of w.elements(e))switch(s.localName){case"rPrDefault":var r=w.element(s,"rPr");r&&t.styles.push({target:"span",values:this.parseDefaultProperties(r,{})});break;case"pPrDefault":var n=w.element(s,"pPr");n&&t.styles.push({target:"p",values:this.parseDefaultProperties(n,{})});break}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";break}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=je(r,w);break;case"rPr":t.styles.push({target:"span",values:this.parseDefaultProperties(r,{})}),t.runProps=_e(r,w);break;case"tblPr":case"tcPr":t.styles.push({target:"td",values:this.parseDefaultProperties(r,{})});break;case"tblStylePr":for(let n of this.parseTableStyle(r))t.styles.push(n);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"),n="",s="";switch(r){case"firstRow":s=".first-row",n="tr.first-row td";break;case"lastRow":s=".last-row",n="tr.last-row td";break;case"firstCol":s=".first-col",n="td.first-col";break;case"lastCol":s=".last-col",n="td.last-col";break;case"band1Vert":s=":not(.no-vband)",n="td.odd-col";break;case"band2Vert":s=":not(.no-vband)",n="td.even-col";break;case"band1Horz":s=":not(.no-hband)",n="tr.odd-row";break;case"band2Horz":s=":not(.no-hband)",n="tr.even-row";break;default:return[]}for(let o of w.elements(e))switch(o.localName){case"pPr":t.push({target:`${n} p`,mod:s,values:this.parseDefaultProperties(o,{})});break;case"rPr":t.push({target:`${n} span`,mod:s,values:this.parseDefaultProperties(o,{})});break;case"tblPr":case"tcPr":t.push({target:n,mod:s,values:this.parseDefaultProperties(o,{})});break}return t}parseNumberingFile(e){let t=[],r=[],n=[];for(let s of w.elements(e))switch(s.localName){case"abstractNum":t.push(...this.parseAbstractNumbering(s,n));break;case"numPicBullet":n.push(this.parseNumberingPicBullet(s));break;case"num":r.push({numId:w.attr(s,"numId"),abstractNumId:w.elementAttr(s,"abstractNumId","val")});break}return r.flatMap(s=>t.filter(o=>s.abstractNumId==o.id).map(o=>({...o,id:s.numId})))}parseNumberingPicBullet(e){var t=w.element(e,"pict"),r=t&&w.element(t,"shape"),n=r&&w.element(r,"imagedata");return n?{id:w.intAttr(e,"numPicBulletId"),src:w.attr(n,"id"),style:w.attr(r,"style")}:null}parseAbstractNumbering(e,t){var r=[],n=w.attr(e,"abstractNumId");for(let s of w.elements(e))switch(s.localName){case"lvl":r.push(this.parseNumberingLevel(n,s,t));break}return r}parseNumberingLevel(e,t,r){var n={id:e,level:w.intAttr(t,"ilvl"),start:1,pStyleName:void 0,pStyle:{},rStyle:{},suff:"tab"};for(let o of w.elements(t))switch(o.localName){case"start":n.start=w.intAttr(o,"val");break;case"pPr":this.parseDefaultProperties(o,n.pStyle);break;case"rPr":this.parseDefaultProperties(o,n.rStyle);break;case"lvlPicBulletId":var s=w.intAttr(o,"val");n.bullet=r.find(d=>d?.id==s);break;case"lvlText":n.levelText=w.attr(o,"val");break;case"pStyle":n.pStyleName=w.attr(o,"val");break;case"numFmt":n.format=w.attr(o,"val");break;case"suff":n.suff=w.attr(o,"val");break}return n}parseSdt(e,t){let r=w.element(e,"sdtContent");return r?t(r):[]}parseChange(e,t,r){return{type:e,children:r(t)?.children??[],id:w.attr(t,"id"),author:w.attr(t,"author"),date:w.attr(t,"date")}}parseAltChunk(e){return{type:N.AltChunk,children:[],id:w.attr(e,"id")}}parseParagraph(e){var t={type:N.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(Lr(r,w));break;case"bookmarkEnd":t.children.push(Dr(r,w));break;case"commentRangeStart":t.children.push(new be(w.attr(r,"id")));break;case"commentRangeEnd":t.children.push(new ve(w.attr(r,"id")));break;case"oMath":case"oMathPara":t.children.push(this.parseMathElement(r));break;case"sdt":t.children.push(...this.parseSdt(r,n=>this.parseParagraph(n).children));break;case"ins":t.children.push(this.parseChange(N.Inserted,r,n=>this.parseParagraph(n)));break;case"del":t.children.push(this.parseChange(N.Deleted,r,n=>this.parseParagraph(n)));break}return t}parseParagraphProperties(e,t){this.parseDefaultProperties(e,t.cssStyle={},null,r=>{if(Ue(r,t,w))return!0;switch(r.localName){case"pStyle":t.styleName=w.attr(r,"val");break;case"cnfStyle":t.className=st.classNameOfCnfStyle(r);break;case"framePr":this.parseFrame(r,t);break;case"rPr":break;default:return!1}return!0})}parseFrame(e,t){var r=w.attr(e,"dropCap");r=="drop"&&(t.cssStyle.float="left")}parseHyperlink(e,t){var r={type:N.Hyperlink,parent:t,children:[]};r.anchor=w.attr(e,"anchor"),r.id=w.attr(e,"id");for(let n of w.elements(e))switch(n.localName){case"r":r.children.push(this.parseRun(n,r));break}return r}parseSmartTag(e,t){var r={type:N.SmartTag,parent:t,children:[]},n=w.attr(e,"uri"),s=w.attr(e,"element");n&&(r.uri=n),s&&(r.element=s);for(let o of w.elements(e))switch(o.localName){case"r":r.children.push(this.parseRun(o,r));break;case"smartTag":r.children.push(this.parseSmartTag(o,r));break}return r}parseRun(e,t){var r={type:N.Run,parent:t,children:[]};for(let n of w.elements(e))switch(n=this.checkAlternateContent(n),n?.localName){case"t":r.children.push({type:N.Text,text:n.textContent});break;case"delText":r.children.push({type:N.DeletedText,text:n.textContent});break;case"commentReference":r.children.push(new ge(w.attr(n,"id")));break;case"fldSimple":r.children.push({type:N.SimpleField,instruction:w.attr(n,"instr"),lock:w.boolAttr(n,"lock",!1),dirty:w.boolAttr(n,"dirty",!1)});break;case"instrText":r.fieldRun=!0,r.children.push({type:N.Instruction,text:n.textContent});break;case"fldChar":r.fieldRun=!0,r.children.push({type:N.ComplexField,charType:w.attr(n,"fldCharType"),lock:w.boolAttr(n,"lock",!1),dirty:w.boolAttr(n,"dirty",!1)});break;case"noBreakHyphen":r.children.push({type:N.NoBreakHyphen});break;case"br":r.children.push({type:N.Break,break:w.attr(n,"type")||"textWrapping"});break;case"lastRenderedPageBreak":r.children.push({type:N.Break,break:"lastRenderedPageBreak"});break;case"sym":r.children.push({type:N.Symbol,font:Wt(w.attr(n,"font")),char:w.hexAttr(n,"char")});break;case"tab":r.children.push({type:N.Tab});break;case"footnoteReference":r.children.push({type:N.FootnoteReference,id:w.attr(n,"id")});break;case"endnoteReference":r.children.push({type:N.EndnoteReference,id:w.attr(n,"id")});break;case"drawing":let s=this.parseDrawing(n);s&&r.children.push(s);break;case"pict":r.children.push(this.parseVmlPicture(n));break;case"rPr":this.parseRunProperties(n,r);break}return r}parseMathElement(e){let t=`${e.localName}Pr`,r={type:ze[e.localName],children:[]};for(let s of w.elements(e))if(ze[s.localName])r.children.push(this.parseMathElement(s));else if(s.localName=="r"){var n=this.parseRun(s);n.type=N.MmlRun,r.children.push(n)}else s.localName==t&&(r.props=this.parseMathProperies(s));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");break}return t}parseRunProperties(e,t){this.parseDefaultProperties(e,t.cssStyle={},null,r=>{switch(r.localName){case"rStyle":t.styleName=w.attr(r,"val");break;case"vertAlign":t.verticalAlign=st.valueOfVertAlign(r,!0);break;default:return!1}return!0})}parseVmlPicture(e){let t={type:N.VmlPicture,children:[]};for(let r of w.elements(e)){let n=He(r,this);n&&t.children.push(n)}return t}checkAlternateContent(e){if(e.localName!="AlternateContent")return e;var t=w.element(e,"Choice");if(t){var r=w.attr(t,"Requires"),n=e.lookupNamespaceURI(r);if($r.includes(n))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:N.Drawing,children:[],cssStyle:{}},r=e.localName=="anchor";let n=null,s=w.boolAttr(e,"simplePos");w.boolAttr(e,"behindDoc");let o={relative:"page",align:"left",offset:"0"},d={relative:"page",align:"top",offset:"0"};for(var f of w.elements(e))switch(f.localName){case"simplePos":s&&(o.offset=w.lengthAttr(f,"x",ut.Emu),d.offset=w.lengthAttr(f,"y",ut.Emu));break;case"extent":t.cssStyle.width=w.lengthAttr(f,"cx",ut.Emu),t.cssStyle.height=w.lengthAttr(f,"cy",ut.Emu);break;case"positionH":case"positionV":if(!s){let g=f.localName=="positionH"?o:d;var v=w.element(f,"align"),y=w.element(f,"posOffset");g.relative=w.attr(f,"relativeFrom")??g.relative,v&&(g.align=v.textContent),y&&(g.offset=Fe(y.textContent,ut.Emu))}break;case"wrapTopAndBottom":n="wrapTopAndBottom";break;case"wrapNone":n="wrapNone";break;case"graphic":var c=this.parseGraphic(f);c&&t.children.push(c);break}return n=="wrapTopAndBottom"?(t.cssStyle.display="block",o.align&&(t.cssStyle["text-align"]=o.align,t.cssStyle.width="100%")):n=="wrapNone"?(t.cssStyle.display="block",t.cssStyle.position="relative",t.cssStyle.width="0px",t.cssStyle.height="0px",o.offset&&(t.cssStyle.left=o.offset),d.offset&&(t.cssStyle.top=d.offset)):r&&(o.align=="left"||o.align=="right")&&(t.cssStyle.float=o.align),t}parseGraphic(e){var t=w.element(e,"graphicData");for(let r of w.elements(t))switch(r.localName){case"pic":return this.parsePicture(r)}return null}parsePicture(e){var t={type:N.Image,src:"",cssStyle:{}},r=w.element(e,"blipFill"),n=w.element(r,"blip"),s=w.element(r,"srcRect");t.src=w.attr(n,"embed"),s&&(t.srcRect=[w.intAttr(s,"l",0)/1e5,w.intAttr(s,"t",0)/1e5,w.intAttr(s,"r",0)/1e5,w.intAttr(s,"b",0)/1e5]);var o=w.element(e,"spPr"),d=w.element(o,"xfrm");if(t.cssStyle.position="relative",d){t.rotation=w.intAttr(d,"rot",0)/6e4;for(var f of w.elements(d))switch(f.localName){case"ext":t.cssStyle.width=w.lengthAttr(f,"cx",ut.Emu),t.cssStyle.height=w.lengthAttr(f,"cy",ut.Emu);break;case"off":t.cssStyle.left=w.lengthAttr(f,"x",ut.Emu),t.cssStyle.top=w.lengthAttr(f,"y",ut.Emu);break}}return t}parseTable(e){var t={type:N.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);break}return t}parseTableColumns(e){var t=[];for(let r of w.elements(e))switch(r.localName){case"gridCol":t.push({width:w.lengthAttr(r,"w")});break}return t}parseTableProperties(e,t){switch(t.cssStyle={},t.cellStyle={},this.parseDefaultProperties(e,t.cssStyle,t.cellStyle,r=>{switch(r.localName){case"tblStyle":t.styleName=w.attr(r,"val");break;case"tblLook":t.className=st.classNameOftblLook(r);break;case"tblpPr":this.parseTablePosition(r,t);break;case"tblStyleColBandSize":t.colBandSize=w.intAttr(r,"val");break;case"tblStyleRowBandSize":t.rowBandSize=w.intAttr(r,"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";break}}parseTablePosition(e,t){var r=w.lengthAttr(e,"topFromText"),n=w.lengthAttr(e,"bottomFromText"),s=w.lengthAttr(e,"rightFromText"),o=w.lengthAttr(e,"leftFromText");t.cssStyle.float="left",t.cssStyle["margin-bottom"]=st.addSize(t.cssStyle["margin-bottom"],n),t.cssStyle["margin-left"]=st.addSize(t.cssStyle["margin-left"],o),t.cssStyle["margin-right"]=st.addSize(t.cssStyle["margin-right"],s),t.cssStyle["margin-top"]=st.addSize(t.cssStyle["margin-top"],r)}parseTableRow(e){var t={type:N.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);break}return t}parseTableRowProperties(e,t){t.cssStyle=this.parseDefaultProperties(e,{},null,r=>{switch(r.localName){case"cnfStyle":t.className=st.classNameOfCnfStyle(r);break;case"tblHeader":t.isHeader=w.boolAttr(r,"val");break;case"gridBefore":t.gridBefore=w.intAttr(r,"val");break;case"gridAfter":t.gridAfter=w.intAttr(r,"val");break;default:return!1}return!0})}parseTableCell(e){var t={type:N.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);break}return t}parseTableCellProperties(e,t){t.cssStyle=this.parseDefaultProperties(e,{},null,r=>{switch(r.localName){case"gridSpan":t.span=w.intAttr(r,"val",null);break;case"vMerge":t.verticalMerge=w.attr(r,"val")??"continue";break;case"cnfStyle":t.className=st.classNameOfCnfStyle(r);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 n of w.elements(e))if(n.localName==="textDirection"){let s=w.attr(n,"val"),o=r[s]||{writingMode:"horizontal-tb"};t.cssStyle["writing-mode"]=o.writingMode,t.cssStyle.transform=o.transform}}parseDefaultProperties(e,t=null,r=null,n=null){t=t||{};for(let s of w.elements(e))if(!n?.(s))switch(s.localName){case"jc":t["text-align"]=st.valueOfJc(s);break;case"textAlignment":t["vertical-align"]=st.valueOfTextAlignment(s);break;case"color":t.color=wt.colorAttr(s,"val",null,Tt.color);break;case"sz":t["font-size"]=t["min-height"]=w.lengthAttr(s,"val",ut.FontSize);break;case"shd":t["background-color"]=wt.colorAttr(s,"fill",null,Tt.shd);break;case"highlight":t["background-color"]=wt.colorAttr(s,"val",null,Tt.highlight);break;case"vertAlign":break;case"position":t.verticalAlign=w.lengthAttr(s,"val",ut.FontSize);break;case"tcW":if(this.options.ignoreWidth)break;case"tblW":t.width=st.valueOfSize(s,"w");break;case"trHeight":this.parseTrHeight(s,t);break;case"strike":t["text-decoration"]=w.boolAttr(s,"val",!0)?"line-through":"none";break;case"b":t["font-weight"]=w.boolAttr(s,"val",!0)?"bold":"normal";break;case"i":t["font-style"]=w.boolAttr(s,"val",!0)?"italic":"normal";break;case"caps":t["text-transform"]=w.boolAttr(s,"val",!0)?"uppercase":"none";break;case"smallCaps":t["font-variant"]=w.boolAttr(s,"val",!0)?"small-caps":"none";break;case"u":this.parseUnderline(s,t);break;case"ind":case"tblInd":this.parseIndentation(s,t);break;case"rFonts":this.parseFont(s,t);break;case"tblBorders":this.parseBorderProperties(s,r||t);break;case"tblCellSpacing":t["border-spacing"]=st.valueOfMargin(s),t["border-collapse"]="separate";break;case"pBdr":this.parseBorderProperties(s,t);break;case"bdr":t.border=st.valueOfBorder(s);break;case"tcBorders":this.parseBorderProperties(s,t);break;case"vanish":w.boolAttr(s,"val",!0)&&(t.display="none");break;case"kern":break;case"noWrap":break;case"tblCellMar":case"tcMar":this.parseMarginProperties(s,r||t);break;case"tblLayout":t["table-layout"]=st.valueOfTblLayout(s);break;case"vAlign":t["vertical-align"]=st.valueOfTextAlignment(s);break;case"spacing":e.localName=="pPr"&&this.parseSpacing(s,t);break;case"wordWrap":w.boolAttr(s,"val")&&(t["overflow-wrap"]="break-word");break;case"suppressAutoHyphens":t.hyphens=w.boolAttr(s,"val",!0)?"none":"auto";break;case"lang":t.$lang=w.attr(s,"val");break;case"rtl":case"bidi":w.boolAttr(s,"val",!0)&&(t.direction="rtl");break;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"noProof":break;default:this.options.debug&&console.warn(`DOCX: Unknown document element: ${e.localName}.${s.localName}`);break}return t}parseUnderline(e,t){var r=w.attr(e,"val");if(r!=null){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":t["text-decoration"]="underline";break;case"wave":case"wavyDouble":case"wavyHeavy":t["text-decoration"]="underline wavy";break;case"words":t["text-decoration"]="underline";break;case"none":t["text-decoration"]="none";break}var n=wt.colorAttr(e,"color");n&&(t["text-decoration-color"]=n)}}parseFont(e,t){var r=w.attr(e,"ascii"),n=st.themeValue(e,"asciiTheme"),s=w.attr(e,"eastAsia"),o=[r,n,s].filter(d=>d).map(d=>Wt(d));o.length>0&&(t["font-family"]=[...new Set(o)].join(", "))}parseIndentation(e,t){var r=w.lengthAttr(e,"firstLine"),n=w.lengthAttr(e,"hanging"),s=w.lengthAttr(e,"left"),o=w.lengthAttr(e,"start"),d=w.lengthAttr(e,"right"),f=w.lengthAttr(e,"end");r&&(t["text-indent"]=r),n&&(t["text-indent"]=`-${n}`),(s||o)&&(t["margin-inline-start"]=s||o),(d||f)&&(t["margin-inline-end"]=d||f)}parseSpacing(e,t){var r=w.lengthAttr(e,"before"),n=w.lengthAttr(e,"after"),s=w.intAttr(e,"line",null),o=w.attr(e,"lineRule");if(r&&(t["margin-top"]=r),n&&(t["margin-bottom"]=n),s!==null)switch(o){case"auto":t["line-height"]=`${(s/240).toFixed(2)}`;break;case"atLeast":t["line-height"]=`calc(100% + ${s/20}pt)`;break;default:t["line-height"]=t["min-height"]=`${s/20}pt`;break}}parseMarginProperties(e,t){for(let r of w.elements(e))switch(r.localName){case"left":t["padding-left"]=st.valueOfMargin(r);break;case"right":t["padding-right"]=st.valueOfMargin(r);break;case"top":t["padding-top"]=st.valueOfMargin(r);break;case"bottom":t["padding-bottom"]=st.valueOfMargin(r);break}}parseTrHeight(e,t){switch(w.attr(e,"hRule")){case"exact":t.height=w.lengthAttr(e,"val");break;case"atLeast":default:t.height=w.lengthAttr(e,"val");break}}parseBorderProperties(e,t){for(let r of w.elements(e))switch(r.localName){case"start":case"left":t["border-left"]=st.valueOfBorder(r);break;case"end":case"right":t["border-right"]=st.valueOfBorder(r);break;case"top":t["border-top"]=st.valueOfBorder(r);break;case"bottom":t["border-bottom"]=st.valueOfBorder(r);break}}},Hr=["black","blue","cyan","darkBlue","darkCyan","darkGray","darkGreen","darkMagenta","darkRed","darkYellow","green","lightGray","magenta","none","red","white","yellow"],wt=class{static colorAttr(e,t,r=null,n="black"){var s=w.attr(e,t);if(s)return s=="auto"?n:Hr.includes(s)?s:`#${s}`;var o=w.attr(e,"themeColor");return o?`var(--docx-${o}-color)`:r}},st=class a{static themeValue(e,t){var r=w.attr(e,t);return r?`var(--docx-${r}-font)`:null}static valueOfSize(e,t){var r=ut.Dxa;switch(w.attr(e,"type")){case"dxa":break;case"pct":r=ut.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=a.parseBorderType(w.attr(e,"val"));if(t=="none")return"none";var r=wt.colorAttr(e,"color"),n=w.lengthAttr(e,"sz",ut.Border);return`${n} ${t} ${r=="auto"?Tt.borderColor:r}`}static parseBorderType(e){switch(e){case"single":return"solid";case"dashDotStroked":return"solid";case"dashed":return"dashed";case"dashSmallGap":return"dashed";case"dotDash":return"dotted";case"dotDotDash":return"dotted";case"dotted":return"dotted";case"double":return"double";case"doubleWave":return"double";case"inset":return"inset";case"nil":return"none";case"none":return"none";case"outset":return"outset";case"thick":return"solid";case"thickThinLargeGap":return"solid";case"thickThinMediumGap":return"solid";case"thickThinSmallGap":return"solid";case"thinThickLargeGap":return"solid";case"thinThickMediumGap":return"solid";case"thinThickSmallGap":return"solid";case"thinThickThinLargeGap":return"solid";case"thinThickThinMediumGap":return"solid";case"thinThickThinSmallGap":return"solid";case"threeDEmboss":return"solid";case"threeDEngrave":return"solid";case"triple":return"double";case"wave":return"solid"}return"solid"}static valueOfTblLayout(e){var t=w.attr(e,"val");return t=="fixed"?"fixed":"auto"}static classNameOfCnfStyle(e){let t=w.attr(e,"val"),r=["first-row","last-row","first-col","last-col","odd-col","even-col","odd-row","even-row","ne-cell","nw-cell","se-cell","sw-cell"];if(t)return r.filter((s,o)=>t[o]=="1").join(" ");let n=["firstRow","lastRow","firstColumn","lastColumn","oddVBand","evenVBand","oddHBand","evenHBand","firstRowLastColumn","firstRowFirstColumn","lastRowLastColumn","lastRowFirstColumn"];return r.filter((s,o)=>w.boolAttr(e,n[o])).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 e==null?t:t==null?e:`calc(${e} + ${t})`}static classNameOftblLook(e){let t=w.hexAttr(e,"val",0),r="";return(w.boolAttr(e,"firstRow")||t&32)&&(r+=" first-row"),(w.boolAttr(e,"lastRow")||t&64)&&(r+=" last-row"),(w.boolAttr(e,"firstColumn")||t&128)&&(r+=" first-col"),(w.boolAttr(e,"lastColumn")||t&256)&&(r+=" last-col"),(w.boolAttr(e,"noHBand")||t&512)&&(r+=" no-hband"),(w.boolAttr(e,"noVBand")||t&1024)&&(r+=" no-vband"),r.trim()}},Re={pos:0,leader:"none",style:"left"},Wr=50;function Zr(a=document.body){let e=document.createElement("div");e.style.width="100pt",a.appendChild(e);let t=100/e.offsetWidth;return a.removeChild(e),t}function Vr(a,e,t,r=72/96){let n=a.closest("p"),s=a.getBoundingClientRect(),o=n.getBoundingClientRect(),d=getComputedStyle(n),f=e?.length>0?e.map(x=>({pos:Te(x.position),leader:x.leader,style:x.style})).sort((x,A)=>x.pos-A.pos):[Re],v=f[f.length-1],y=o.width*r,c=Te(t),g=v.pos+c;if(g<y)for(;g<y&&f.length<Wr;g+=c)f.push({...Re,pos:g});let h=parseFloat(d.marginLeft),m=o.left+h,u=(s.left-m)*r,k=f.find(x=>x.style!="clear"&&x.pos>u);if(k==null)return;let S=1;if(k.style=="right"||k.style=="center"){let x=Array.from(n.querySelectorAll(`.${a.className}`)),A=x.indexOf(a)+1,O=document.createRange();O.setStart(a,1),A<x.length?O.setEndBefore(x[A]):O.setEndAfter(n);let R=k.style=="center"?.5:1,j=O.getBoundingClientRect(),z=j.left+R*j.width-(o.left-h);S=k.pos-z*r}else S=k.pos-u;switch(a.innerHTML="&nbsp;",a.style.textDecoration="inherit",a.style.wordSpacing=`${S.toFixed(0)}pt`,k.leader){case"dot":case"middleDot":a.style.textDecoration="underline",a.style.textDecorationStyle="dotted";break;case"hyphen":case"heavy":case"underscore":a.style.textDecoration="underline";break}}function Te(a){return parseFloat(a)}var at;(function(a){a.html="http://www.w3.org/1999/xhtml",a.svg="http://www.w3.org/2000/svg",a.mathML="http://www.w3.org/1998/Math/MathML"})(at||(at={}));function Nt(a){if(Zt(a))return document.createTextNode(a);if(a instanceof Node)return a;let{ns:e,tagName:t,className:r,style:n,children:s,...o}=a;if(t==="#fragment"){let f=document.createDocumentFragment();return s&&s.forEach(v=>f.appendChild(Nt(v))),f}if(t==="#comment")return document.createComment(s?s[0]:"");let d=e?document.createElementNS(e,t):document.createElement(t);if(r&&d.setAttribute("class",r),n&&(Zt(n)?d.setAttribute("style",n):Object.assign(d.style,n)),o)for(let[f,v]of Object.entries(o))v!==void 0&&(d[f]=v);return s&&s.forEach(f=>d.appendChild(Nt(f))),d}function Gr(...a){return a.filter(Boolean).join(" ")}var ye=class{constructor(){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=[],this.h=Nt}async render(e,t){this.document=e,this.options=t,this.className=t.className,this.rootSelector=t.inWrapper?`.${this.className}-wrapper`:":root",this.h=t.h??Nt,this.styleMap=null,this.tasks=[],this.options.renderComments&&globalThis.Highlight&&(this.commentHighlight=new Highlight);let r=[...this.renderDefaultStyle()];e.themePart&&r.push(...this.renderTheme(e.themePart)),e.stylesPart!=null&&(this.styleMap=this.processStyles(e.stylesPart.styles),r.push(...this.renderStyles(e.stylesPart.styles))),e.numberingPart&&(this.prodessNumberings(e.numberingPart.domNumberings),r.push(...await this.renderNumbering(e.numberingPart.domNumberings))),e.footnotesPart&&(this.footnoteMap=_t(e.footnotesPart.notes,s=>s.id)),e.endnotesPart&&(this.endnoteMap=_t(e.endnotesPart.notes,s=>s.id)),e.settingsPart&&(this.defaultTabSize=e.settingsPart.settings?.defaultTabStop),!t.ignoreFonts&&e.fontTablePart&&r.push(...await this.renderFontTable(e.fontTablePart));var n=this.renderSections(e.documentPart.body);return this.options.inWrapper?r.push(this.renderWrapper(n)):r.push(...n),this.commentHighlight&&t.renderComments&&CSS.highlights.set(`${this.className}-comments`,this.commentHighlight),this.postRenderTasks.forEach(s=>s()),await Promise.allSettled(this.tasks),this.refreshTabStops(),r}renderTheme(e){let t={},r=e.theme?.fontScheme;r&&(r.majorFont&&(t["--docx-majorHAnsi-font"]=r.majorFont.latinTypeface),r.minorFont&&(t["--docx-minorHAnsi-font"]=r.minorFont.latinTypeface));let n=e.theme?.colorScheme;if(n)for(let[o,d]of Object.entries(n.colors))t[`--docx-${o}-color`]=`#${d}`;let s=this.styleToString(`.${this.className}`,t);return[this.h({tagName:"#comment",children:["docxjs document theme values"]}),this.h({tagName:"style",children:[s]})]}async renderFontTable(e){let t=[];for(let r of e.fonts)for(let n of r.embedFontRefs)try{let s=await this.document.loadFont(n.id,n.key),o={"font-family":Wt(r.name),src:`url(${s})`};(n.type=="bold"||n.type=="boldItalic")&&(o["font-weight"]="bold"),(n.type=="italic"||n.type=="boldItalic")&&(o["font-style"]="italic"),t.push(this.h({tagName:"#comment",children:[`docxjs ${r.name} font`]})),t.push(this.h({tagName:"style",children:[this.styleToString("@font-face",o)]}))}catch{this.options.debug&&console.warn(`Can't load font with id ${n.id} and key ${n.key}`)}return t}processStyleName(e){return e?`${this.className}_${nr(e)}`:this.className}processStyles(e){let t=_t(e.filter(n=>n.id!=null),n=>n.id);for(let n of e.filter(s=>s.basedOn)){var r=t[n.basedOn];if(r){n.paragraphProps=It(n.paragraphProps,r.paragraphProps),n.runProps=It(n.runProps,r.runProps);for(let s of r.styles){let o=n.styles.find(d=>d.target==s.target);o?this.copyStyleProperties(s.values,o.values):n.styles.push({...s,values:{...s.values}})}}else this.options.debug&&console.warn(`Can't find base style ${n.basedOn}`)}for(let n of e)n.cssName=this.processStyleName(n.id);return t}prodessNumberings(e){for(let t of e.filter(r=>r.pStyleName)){let r=this.findStyle(t.pStyleName);r?.paragraphProps?.numbering&&(r.paragraphProps.numbering.level=t.level)}}processElement(e){if(e.children)for(var t of e.children)t.parent=e,t.type==N.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;t==null&&(t={}),r==null&&(r=Object.getOwnPropertyNames(e));for(var n of r)e.hasOwnProperty(n)&&!t.hasOwnProperty(n)&&(t[n]=e[n]);return t}createPageElement(e,t,r){let n={...r};return t&&(t.pageMargins&&(n.paddingLeft=t.pageMargins.left,n.paddingRight=t.pageMargins.right,n.paddingTop=t.pageMargins.top,n.paddingBottom=t.pageMargins.bottom),t.pageSize&&(this.options.ignoreWidth||(n.width=t.pageSize.width),this.options.ignoreHeight||(n.minHeight=t.pageSize.height))),this.h({tagName:"section",className:e,style:n})}createSectionContent(e){let t={};return e.columns&&e.columns.numberOfColumns&&(t.columnCount=`${e.columns.numberOfColumns}`,t.columnGap=e.columns.space,e.columns.separator&&(t.columnRule="1px solid black")),this.h({tagName:"article",style:t})}renderSections(e){let t=[];this.processElement(e);let r=this.splitBySection(e.children,e.props),n=this.groupByPageBreaks(r),s=null;for(let d=0,f=n.length;d<f;d++){this.currentFootnoteIds=[];let y=n[d][0].sectProps,c=this.createPageElement(this.className,y,e.cssStyle);this.options.renderHeaders&&this.renderHeaderFooter(y.headerRefs,y,t.length,s!=y,c);for(let g of n[d]){var o=this.createSectionContent(g.sectProps);this.renderElements(g.elements,o),c.appendChild(o),y=g.sectProps}if(this.options.renderFootnotes){let g=this.renderNotes(this.currentFootnoteIds,this.footnoteMap);g&&c.appendChild(g)}if(this.options.renderEndnotes&&d==f-1){let g=this.renderNotes(this.currentEndnoteIds,this.endnoteMap);g&&c.appendChild(g)}this.options.renderFooters&&this.renderHeaderFooter(y.footerRefs,y,t.length,s!=y,c),t.push(c),s=y}return t}renderHeaderFooter(e,t,r,n,s){if(!e)return;let o=this.document.settingsPart?.settings?.evenAndOddHeaders??!1;var d=(t.titlePage&&n?e.find(v=>v.type=="first"):null)??(r%2==1&&o?e.find(v=>v.type=="even"):null)??e.find(v=>v.type=="default"),f=d&&this.document.findPartByRelId(d.id,this.document.documentPart);if(f){this.currentPart=f,this.usedHederFooterParts.includes(f.path)||(this.processElement(f.rootElement),this.usedHederFooterParts.push(f.path));let[v]=this.renderElements([f.rootElement],s);t?.pageMargins&&(f.rootElement.type===N.Header?(v.style.marginTop=`calc(${t.pageMargins.header} - ${t.pageMargins.top})`,v.style.minHeight=`calc(${t.pageMargins.top} - ${t.pageMargins.header})`):f.rootElement.type===N.Footer&&(v.style.marginBottom=`calc(${t.pageMargins.footer} - ${t.pageMargins.bottom})`,v.style.minHeight=`calc(${t.pageMargins.bottom} - ${t.pageMargins.footer})`)),this.currentPart=null}}isPageBreakElement(e){return e.type!=N.Break?!1:e.break=="lastRenderedPageBreak"?!this.options.ignoreLastRenderedPageBreak:e.break=="page"}isPageBreakSection(e,t){return!e||!t?!1: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},n=[r];for(let c of e){if(c.type==N.Paragraph){let g=c,h=this.findStyle(g.styleName);(g.pageBreakBefore||h?.paragraphProps?.pageBreakBefore)&&(r.sectProps=s,r.pageBreak=!0,r={sectProps:null,elements:[],pageBreak:!1},n.push(r))}if(r.elements.push(c),c.type==N.Paragraph){let g=c;var s=g.sectionProps,o=-1,d=-1;if(this.options.breakPages&&g.children&&(o=g.children.findIndex(h=>(d=h.children?.findIndex(this.isPageBreakElement.bind(this))??-1,d!=-1))),(s||o!=-1)&&(r.sectProps=s,r.pageBreak=o!=-1,r={sectProps:null,elements:[],pageBreak:!1},n.push(r)),o!=-1){let h=g.children[o],m=d<h.children.length-1;if(o<g.children.length-1||m){var f=c.children,v={...c,children:f.slice(o)};if(c.children=f.slice(0,o),r.elements.push(v),m){let u=h.children,k={...h,children:u.slice(0,d)};c.children.push(k),h.children=u.slice(d)}}}}}let y=null;for(let c=n.length-1;c>=0;c--)n[c].sectProps==null?n[c].sectProps=y??t:y=n[c].sectProps;return n}groupByPageBreaks(e){let t=[],r,n=[t];for(let s of e)t.push(s),(this.options.ignoreLastRenderedPageBreak||s.pageBreak||this.isPageBreakSection(r,s.sectProps))&&n.push(t=[]),r=s.sectProps;return n.filter(s=>s.length>0)}renderWrapper(e){return this.h({tagName:"div",className:`${this.className}-wrapper`,children:e})}renderDefaultStyle(){var e=this.className,t=`
22
+ .${e}-wrapper { background: gray; padding: 30px; padding-bottom: 0px; display: flex; flex-flow: column; align-items: center; }
23
+ .${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}
24
+ .${e} { color: black; hyphens: auto; text-underline-position: from-font; }
25
+ section.${e} { box-sizing: border-box; display: flex; flex-flow: column nowrap; position: relative; overflow: hidden; }
26
+ section.${e}>article { margin-bottom: auto; z-index: 1; }
27
+ section.${e}>footer { z-index: 1; }
28
+ .${e} table { border-collapse: collapse; }
29
+ .${e} table td, .${e} table th { vertical-align: top; }
30
+ .${e} p { margin: 0pt; min-height: 1em; }
31
+ .${e} span { white-space: pre-wrap; overflow-wrap: break-word; }
32
+ .${e} a { color: inherit; text-decoration: inherit; }
33
+ .${e} svg { fill: transparent; }
34
+ `;return this.options.renderComments&&(r+=`
35
+ .${e}-comment-ref { cursor: default; }
36
+ .${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; }
37
+ .${e}-comment-ref:hover~.${e}-comment-popover { display: block; }
38
+ .${e}-comment-author,.${e}-comment-date { font-size: 0.875rem; color: #888; }
39
+ `),[this.h({tagName:"#comment",children:["docxjs library predefined styles"]}),this.h({tagName:"style",children:[r]})]}async renderNumbering(e){var t="",r=[];for(var n of e){var s=`p.${this.numberingClass(n.id,n.level)}`,o="none";if(n.bullet){let d=`--${this.className}-${n.bullet.src}`.toLowerCase();t+=this.styleToString(`${s}:before`,{content:"' '",display:"inline-block",background:`var(${d})`},n.bullet.style);try{let f=await this.document.loadNumberingImage(n.bullet.src);t+=`${this.rootSelector} { ${d}: url(${f}) }`}catch{this.options.debug&&console.warn(`Can't load numbering image with src ${n.bullet.src}`)}}else if(n.levelText){let d=this.numberingCounter(n.id,n.level),f=d+" "+(n.start-1);n.level>0&&(t+=this.styleToString(`p.${this.numberingClass(n.id,n.level-1)}`,{"counter-set":f})),r.push(f),t+=this.styleToString(`${s}:before`,{content:this.levelTextToContent(n.levelText,n.suff,n.id,this.numFormatToCssValue(n.format)),"counter-increment":d,...n.rStyle})}else o=this.numFormatToCssValue(n.format);t+=this.styleToString(s,{display:"list-item","list-style-position":"inside","list-style-type":o,...n.pStyle})}return r.length>0&&(t+=this.styleToString(this.rootSelector,{"counter-reset":r.join(" ")})),[this.h({tagName:"#comment",children:["docxjs document numbering styles"]}),this.h({tagName:"style",children:[t]})]}renderStyles(e){var t="";let r=this.styleMap,n=_t(e.filter(f=>f.isDefault),f=>f.target);for(let f of e){var s=f.styles;if(f.linked){var o=f.linked&&r[f.linked];o?s=s.concat(o.styles):this.options.debug&&console.warn(`Can't find linked style ${f.linked}`)}for(let v of s){var d=`${f.target??""}.${f.cssName}`;f.target!=v.target&&(d+=` ${v.target}`),n[f.target]==f&&(d=`.${this.className} ${f.target}, `+d),t+=this.styleToString(d,v.values)}}return[this.h({tagName:"#comment",children:["docxjs document styles"]}),this.h({tagName:"style",children:[t]})]}renderNotes(e,t){var r=e.map(n=>t[n]).filter(n=>n);if(r.length>0)return this.h({tagName:"ol",children:this.renderElements(r)})}renderElement(e){switch(e.type){case N.Paragraph:return this.renderParagraph(e);case N.BookmarkStart:return this.renderBookmarkStart(e);case N.BookmarkEnd:return null;case N.Run:return this.renderRun(e);case N.Table:return this.renderTable(e);case N.Row:return this.renderTableRow(e);case N.Cell:return this.renderTableCell(e);case N.Hyperlink:return this.renderHyperlink(e);case N.SmartTag:return this.renderSmartTag(e);case N.Drawing:return this.renderDrawing(e);case N.Image:return this.renderImage(e);case N.Text:return this.renderText(e);case N.Text:return this.renderText(e);case N.DeletedText:return this.renderDeletedText(e);case N.Tab:return this.renderTab(e);case N.Symbol:return this.renderSymbol(e);case N.Break:return this.renderBreak(e);case N.Footer:return this.renderContainer(e,"footer");case N.Header:return this.renderContainer(e,"header");case N.Footnote:case N.Endnote:return this.renderContainer(e,"li");case N.FootnoteReference:return this.renderFootnoteReference(e);case N.EndnoteReference:return this.renderEndnoteReference(e);case N.NoBreakHyphen:return this.h({tagName:"wbr"});case N.VmlPicture:return this.renderVmlPicture(e);case N.VmlElement:return this.renderVmlElement(e);case N.MmlMath:return this.renderContainerNS(e,at.mathML,"math",{xmlns:at.mathML});case N.MmlMathParagraph:return this.renderContainer(e,"span");case N.MmlFraction:return this.renderContainerNS(e,at.mathML,"mfrac");case N.MmlBase:return this.renderContainerNS(e,at.mathML,e.parent.type==N.MmlMatrixRow?"mtd":"mrow");case N.MmlNumerator:case N.MmlDenominator:case N.MmlFunction:case N.MmlLimit:case N.MmlBox:return this.renderContainerNS(e,at.mathML,"mrow");case N.MmlGroupChar:return this.renderMmlGroupChar(e);case N.MmlLimitLower:return this.renderContainerNS(e,at.mathML,"munder");case N.MmlMatrix:return this.renderContainerNS(e,at.mathML,"mtable");case N.MmlMatrixRow:return this.renderContainerNS(e,at.mathML,"mtr");case N.MmlRadical:return this.renderMmlRadical(e);case N.MmlSuperscript:return this.renderContainerNS(e,at.mathML,"msup");case N.MmlSubscript:return this.renderContainerNS(e,at.mathML,"msub");case N.MmlDegree:case N.MmlSuperArgument:case N.MmlSubArgument:return this.renderContainerNS(e,at.mathML,"mn");case N.MmlFunctionName:return this.renderContainerNS(e,at.mathML,"ms");case N.MmlDelimiter:return this.renderMmlDelimiter(e);case N.MmlRun:return this.renderMmlRun(e);case N.MmlNary:return this.renderMmlNary(e);case N.MmlPreSubSuper:return this.renderMmlPreSubSuper(e);case N.MmlBar:return this.renderMmlBar(e);case N.MmlEquationArray:return this.renderMllList(e);case N.Inserted:return this.renderInserted(e);case N.Deleted:return this.renderDeleted(e);case N.CommentRangeStart:return this.renderCommentRangeStart(e);case N.CommentRangeEnd:return this.renderCommentRangeEnd(e);case N.CommentReference:return this.renderCommentReference(e);case N.AltChunk:return this.renderAltChunk(e)}return null}renderElements(e,t){if(e==null)return null;var r=e.flatMap(n=>this.renderElement(n)).filter(n=>n!=null);return t&&r.forEach(n=>t.appendChild(Zt(n)?document.createTextNode(n):n)),r}renderContainer(e,t,r){return this.h({tagName:t,children:this.renderElements(e.children),...r})}renderContainerNS(e,t,r,n){return this.h({ns:t,tagName:r,children:this.renderElements(e.children),...n})}renderParagraph(e){var t=this.toHTML(e,at.html,"p");let r=this.findStyle(e.styleName);e.tabs??(e.tabs=r?.paragraphProps?.tabs);let n=e.numbering??r?.paragraphProps?.numbering;return n&&t.classList.add(this.numberingClass(n.id,n.level)),t}renderHyperlink(e){let t=this.toH(e,at.html,"a");if(t.href="",e.id){let r=this.document.documentPart.rels.find(n=>n.id==e.id&&n.targetMode==="External");t.href=r?.target??t.href}return e.anchor&&(t.href+=`#${e.anchor}`),this.h(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.h({tagName:"#comment",children:[`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.h({tagName:"#comment",children:[`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=this.h({tagName:"span",className:`${this.className}-comment-ref`,children:["\u{1F4AC}"]}),n=this.h({tagName:"div",className:`${this.className}-comment-popover`,children:[this.h({tagName:"div",className:`${this.className}-comment-author`,children:[t.author]}),this.h({tagName:"div",className:`${this.className}-comment-date`,children:[new Date(t.date).toLocaleString()]}),...this.renderElements(t.children)]});return this.h({tagName:"#fragment",children:[this.h({tagName:"#comment",children:[`comment #${t.id} by ${t.author} on ${t.date}`]}),r,n]})}renderAltChunk(e){if(!this.options.renderAltChunks)return null;var t=this.h({tagName:"iframe"});return this.tasks.push(this.document.loadAltChunk(e.id,this.currentPart).then(r=>{t.srcdoc=r})),t}renderDrawing(e){var t=this.toHTML(e,at.html,"div");return t.style.display="inline-block",t.style.position="relative",t.style.textIndent="0px",t}renderImage(e){let t=this.toHTML(e,at.html,"img",[]),r=e.cssStyle?.transform;if(e.srcRect&&e.srcRect.some(f=>f!=0)){var[n,s,o,d]=e.srcRect;r=`scale(${1/(1-n-o)}, ${1/(1-s-d)})`,t.style["clip-path"]=`rect(${(100*s).toFixed(2)}% ${(100*(1-o)).toFixed(2)}% ${(100*(1-d)).toFixed(2)}% ${(100*n).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(f=>{t.src=f})),t}renderText(e){return this.h(e.text)}renderDeletedText(e){return this.options.renderChanges?this.renderText(e):null}renderBreak(e){return e.break=="textWrapping"?this.h({tagName:"br"}):null}renderInserted(e){return this.options.renderChanges?this.renderChange(e,"ins"):this.renderElements(e.children)}renderDeleted(e){return this.options.renderChanges?this.renderChange(e,"del"):null}renderChange(e,t){return this.renderContainer(e,t,{dateTime:e.date})}renderSymbol(e){return this.h({tagName:"span",children:[String.fromCharCode(e.char)],style:{fontFamily:e.font}})}renderFootnoteReference(e){return this.currentFootnoteIds.push(e.id),this.h({tagName:"sup",children:[`${this.currentFootnoteIds.length}`]})}renderEndnoteReference(e){return this.currentEndnoteIds.push(e.id),this.h({tagName:"sup",children:[`${this.currentEndnoteIds.length}`]})}renderTab(e){var t=this.h({tagName:"span",children:["\u2003"]});if(this.options.experimental){t.className=this.tabStopClass();var r=Xr(e,N.Paragraph)?.tabs;this.currentTabs.push({stops:r,span:t})}return t}renderBookmarkStart(e){return this.h({tagName:"span",id:e.name})}renderRun(e){if(e.fieldRun)return null;let t=this.renderElements(e.children);e.verticalAlign&&(t=[this.h({tagName:e.verticalAlign,children:this.renderElements(e.children)})]);let r=this.toHTML(e,at.html,"span",t);return e.id&&(r.id=e.id),r}renderTable(e){this.tableCellPositions.push(this.currentCellPosition),this.tableVerticalMerges.push(this.currentVerticalMerge),this.currentVerticalMerge={},this.currentCellPosition={col:0,row:0};let t=[];return e.columns&&t.push(this.renderTableColumns(e.columns)),t.push(...this.renderElements(e.children)),this.currentVerticalMerge=this.tableVerticalMerges.pop(),this.currentCellPosition=this.tableCellPositions.pop(),this.toHTML(e,at.html,"table",t)}renderTableColumns(e){let t=e.map(r=>this.h({tagName:"col",style:{width:r.width}}));return this.h({tagName:"colgroup",children:t})}renderTableRow(e){this.currentCellPosition.col=0;let t=[];return e.gridBefore&&t.push(this.renderTableCellPlaceholder(e.gridBefore)),t.push(...this.renderElements(e.children)),e.gridAfter&&t.push(this.renderTableCellPlaceholder(e.gridAfter)),this.currentCellPosition.row++,this.toHTML(e,at.html,"tr",t)}renderTableCellPlaceholder(e){return this.h({tagName:"td",colSpan:e,style:{border:"none"}})}renderTableCell(e){let t=this.toHTML(e,at.html,"td"),r=this.currentCellPosition.col;return e.verticalMerge?e.verticalMerge=="restart"?(this.currentVerticalMerge[r]=t,t.rowSpan=1):this.currentVerticalMerge[r]&&(this.currentVerticalMerge[r].rowSpan+=1,t.style.display="none"):this.currentVerticalMerge[r]=null,e.span&&(t.colSpan=e.span),this.currentCellPosition.col+=t.colSpan,t}renderVmlPicture(e){return this.renderContainer(e,"div")}renderVmlElement(e){var t=this.h({ns:at.svg,tagName:"svg",style:e.cssStyleText});let r=this.renderVmlChildElement(e);return e.imageHref?.id&&this.tasks.push(this.document?.loadDocumentImage(e.imageHref.id,this.currentPart).then(n=>r.setAttribute("href",n))),t.appendChild(r),requestAnimationFrame(()=>{let n=t.firstElementChild.getBBox();t.setAttribute("width",`${Math.ceil(n.x+n.width)}`),t.setAttribute("height",`${Math.ceil(n.y+n.height)}`)}),t}renderVmlChildElement(e){let t=this.createSvgElement(e.tagName);Object.entries(e.attrs).forEach(([r,n])=>t.setAttribute(r,n));for(let r of e.children)r.type==N.VmlElement?t.appendChild(this.renderVmlChildElement(r)):t.appendChild(...Pt(this.renderElement(r)));return t}renderMmlRadical(e){let t=e.children.find(n=>n.type==N.MmlBase);if(e.props?.hideDegree)return this.createMathMLElement("msqrt",null,this.renderElements([t]));let r=e.children.find(n=>n.type==N.MmlDegree);return this.createMathMLElement("mroot",null,this.renderElements([t,r]))}renderMmlDelimiter(e){let t=[];return t.push(this.createMathMLElement("mo",null,[e.props.beginChar??"("])),t.push(...this.renderElements(e.children)),t.push(this.createMathMLElement("mo",null,[e.props.endChar??")"])),this.createMathMLElement("mrow",null,t)}renderMmlNary(e){let t=[],r=_t(e.children,v=>v.type),n=r[N.MmlSuperArgument],s=r[N.MmlSubArgument],o=n?this.createMathMLElement("mo",null,Pt(this.renderElement(n))):null,d=s?this.createMathMLElement("mo",null,Pt(this.renderElement(s))):null,f=this.createMathMLElement("mo",null,[e.props?.char??"\u222B"]);return o||d?t.push(this.createMathMLElement("munderover",null,[f,d,o])):o?t.push(this.createMathMLElement("mover",null,[f,o])):d?t.push(this.createMathMLElement("munder",null,[f,d])):t.push(f),t.push(...this.renderElements(r[N.MmlBase].children)),this.createMathMLElement("mrow",null,t)}renderMmlPreSubSuper(e){let t=[],r=_t(e.children,v=>v.type),n=r[N.MmlSuperArgument],s=r[N.MmlSubArgument],o=n?this.createMathMLElement("mo",null,Pt(this.renderElement(n))):null,d=s?this.createMathMLElement("mo",null,Pt(this.renderElement(s))):null,f=this.createMathMLElement("mo",null);return t.push(this.createMathMLElement("msubsup",null,[f,d,o])),t.push(...this.renderElements(r[N.MmlBase].children)),this.createMathMLElement("mrow",null,t)}renderMmlGroupChar(e){let t=e.props.verticalJustification==="bot"?"mover":"munder",r=this.renderContainerNS(e,at.mathML,t);return e.props.char&&r.appendChild(this.createMathMLElement("mo",null,[e.props.char])),r}renderMmlBar(e){let t={};switch(e.props.position){case"top":t.textDecoration="overline";break;case"bottom":t.textDecoration="underline";break}return this.renderContainerNS(e,at.mathML,"mrow",{style:t})}renderMmlRun(e){return this.toHTML(e,at.mathML,"ms")}renderMllList(e){let t=this.renderElements(e.children).map(r=>this.createMathMLElement("mtr",null,[this.createMathMLElement("mtd",null,[r])]));return this.toHTML(e,at.mathML,"mtable",t)}toH(e,t,r,n=null){let{$lang:s,...o}=e.cssStyle??{},d=Gr(e.className,e.styleName&&this.processStyleName(e.styleName));return{ns:t,tagName:r,className:d,lang:s,style:o,children:n??this.renderElements(e.children)}}toHTML(e,t,r,n=null){return this.h(this.toH(e,t,r,n))}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 n=`${e} {\r
40
+ `;for(let s in t)s.startsWith("$")||(n+=` ${s}: ${t[s]};\r
41
+ `);return r&&(n+=r),n+`}\r
42
+ `}numberingCounter(e,t){return`${this.className}-num-${e}-${t}`}levelTextToContent(e,t,r,n){let s={tab:"\\9",space:"\\a0"};var o=e.replace(/%\d*/g,d=>{let f=parseInt(d.substring(1),10)-1;return`"counter(${this.numberingCounter(r,f)}, ${n})"`});return`"${o}${s[t]??""}"`}numFormatToCssValue(e){var t={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"};return t[e]??e}refreshTabStops(){this.options.experimental&&setTimeout(()=>{let e=Zr();for(let t of this.currentTabs)Vr(t.span,t.stops,this.defaultTabSize,e)},500)}createElementNS(e,t,r,n){return this.h({ns:e,tagName:t,children:n,...r})}createElement(e,t,r){return this.createElementNS(at.html,e,t,r)}createMathMLElement(e,t,r){return this.createElementNS(at.mathML,e,t,r)}createSvgElement(e,t,r){return this.createElementNS(at.svg,e,t,r)}later(e){this.postRenderTasks.push(e)}};function Xr(a,e){for(var t=a.parent;t!=null&&t.type!=e;)t=t.parent;return t}var We={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,h:Nt};function qr(a,e){let t={...We,...e};return fe.load(a,new ke(t),t)}async function Kr(a,e){let t={...We,...e};return await new ye().render(a,t)}async function Qr(a,e,t,r){let n=await qr(a,r),s=await Kr(n,r);t??(t=e),t.innerHTML="",e.innerHTML="";for(let o of s)(o.nodeName==="STYLE"?t:e).appendChild(o);return n}export{We as defaultOptions,qr as parseAsync,Qr as renderAsync,Kr as renderDocument};