<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>DOCX Renderer</title>
  <style>
    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }
    body {
      background: white;
      overflow: hidden;
    }
    #container {
      width: 100%;
      height: 100vh;
      display: flex;
      justify-content: center;
      align-items: flex-start;
      background: white;
    }
    #docx-container {
      background: white;
    }
    /* Override docx-preview default styles for clean rendering */
    .docx-wrapper {
      background: white !important;
      padding: 0 !important;
    }
    .docx-wrapper > section.docx {
      box-shadow: none !important;
      margin-bottom: 0 !important;
    }
  </style>
  <script type="module" crossorigin>(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))r(n);new MutationObserver(n=>{for(const a of n)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function e(n){const a={};return n.integrity&&(a.integrity=n.integrity),n.referrerPolicy&&(a.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?a.credentials="include":n.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(n){if(n.ep)return;n.ep=!0;const a=e(n);fetch(n.href,a)}})();var Re=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function xt(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}function ze(l){throw new Error('Could not dynamically require "'+l+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var it={exports:{}};/*!

JSZip v3.10.1 - A JavaScript class for generating and reading zip files
<http://stuartk.com/jszip>

(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.

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