diff --git a/lib/index.css b/lib/index.css new file mode 100644 index 0000000000000000000000000000000000000000..c5510297ce71b096d0c120c27a85d82fecdcb25e --- /dev/null +++ b/lib/index.css @@ -0,0 +1 @@ +.vue-office-docx{height:100%;overflow-y:auto}.vue-office-docx .docx-wrapper>section.docx{margin-bottom:5px}@media screen and (max-width: 800px){.vue-office-docx .docx-wrapper{padding:10px}.vue-office-docx .docx-wrapper>section.docx{padding:10px!important;width:100%!important}} diff --git a/lib/index.js b/lib/index.js new file mode 100644 index 0000000000000000000000000000000000000000..c767ad145b3d9636465032a891cc34a2c21d5abe --- /dev/null +++ b/lib/index.js @@ -0,0 +1,33 @@ +(function(dt,ft){typeof exports=="object"&&typeof module!="undefined"?module.exports=ft(require("vue-demi"),require("vue")):typeof define=="function"&&define.amd?define(["vue-demi","vue"],ft):(dt=typeof globalThis!="undefined"?globalThis:dt||self,dt["vue-office-docx"]=ft(dt.VueDemi,dt.Vue))})(this,function(dt,ft){"use strict";var gn=Object.defineProperty,bn=Object.defineProperties;var vn=Object.getOwnPropertyDescriptors;var Re=Object.getOwnPropertySymbols;var kn=Object.prototype.hasOwnProperty,yn=Object.prototype.propertyIsEnumerable;var Me=(dt,ft,vt)=>ft in dt?gn(dt,ft,{enumerable:!0,configurable:!0,writable:!0,value:vt}):dt[ft]=vt,_t=(dt,ft)=>{for(var vt in ft||(ft={}))kn.call(ft,vt)&&Me(dt,vt,ft[vt]);if(Re)for(var vt of Re(ft))yn.call(ft,vt)&&Me(dt,vt,ft[vt]);return dt},Wt=(dt,ft)=>bn(dt,vn(ft));var wt=(dt,ft,vt)=>new Promise((Jt,Bt)=>{var Ht=ot=>{try{It(vt.next(ot))}catch(Ot){Bt(Ot)}},Qt=ot=>{try{It(vt.throw(ot))}catch(Ot){Bt(Ot)}},It=ot=>ot.done?Jt(ot.value):Promise.resolve(ot.value).then(Ht,Qt);It((vt=vt.apply(dt,ft)).next())});typeof window.setImmediate=="undefined"&&(window.setImmediate=function(i,...e){setTimeout(()=>i(e))});var vt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function Jt(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function Bt(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Ht={exports:{}};/*! + + JSZip v3.10.1 - A JavaScript class for generating and reading zip files + + + (c) 2009-2016 Stuart Knightley + 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(i,e){(function(t){i.exports=t()})(function(){return function t(r,n,a){function l(b,y){if(!n[b]){if(!r[b]){var _=typeof Bt=="function"&&Bt;if(!y&&_)return _(b,!0);if(o)return o(b,!0);var w=new Error("Cannot find module '"+b+"'");throw w.code="MODULE_NOT_FOUND",w}var d=n[b]={exports:{}};r[b][0].call(d.exports,function(k){var h=r[b][1][k];return l(h||k)},d,d.exports,t,r,n,a)}return n[b].exports}for(var o=typeof Bt=="function"&&Bt,u=0;u>2,d=(3&b)<<4|y>>4,k=1>6:64,h=2>4,y=(15&w)<<4|(d=o.indexOf(u.charAt(h++)))>>2,_=(3&d)<<6|(k=o.indexOf(u.charAt(h++))),v[m++]=b,d!==64&&(v[m++]=y),k!==64&&(v[m++]=_);return v}},{"./support":30,"./utils":32}],2:[function(t,r,n){var a=t("./external"),l=t("./stream/DataWorker"),o=t("./stream/Crc32Probe"),u=t("./stream/DataLengthProbe");function b(y,_,w,d,k){this.compressedSize=y,this.uncompressedSize=_,this.crc32=w,this.compression=d,this.compressedContent=k}b.prototype={getContentWorker:function(){var y=new l(a.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new u("data_length")),_=this;return y.on("end",function(){if(this.streamInfo.data_length!==_.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),y},getCompressedWorker:function(){return new l(a.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},b.createWorkerFrom=function(y,_,w){return y.pipe(new o).pipe(new u("uncompressedSize")).pipe(_.compressWorker(w)).pipe(new u("compressedSize")).withStreamInfo("compression",_)},r.exports=b},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,r,n){var a=t("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(){return new a("STORE compression")},uncompressWorker:function(){return new a("STORE decompression")}},n.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,r,n){var a=t("./utils"),l=function(){for(var o,u=[],b=0;b<256;b++){o=b;for(var y=0;y<8;y++)o=1&o?3988292384^o>>>1:o>>>1;u[b]=o}return u}();r.exports=function(o,u){return o!==void 0&&o.length?a.getTypeOf(o)!=="string"?function(b,y,_,w){var d=l,k=w+_;b^=-1;for(var h=w;h>>8^d[255&(b^y[h])];return-1^b}(0|u,o,o.length,0):function(b,y,_,w){var d=l,k=w+_;b^=-1;for(var h=w;h>>8^d[255&(b^y.charCodeAt(h))];return-1^b}(0|u,o,o.length,0):0}},{"./utils":32}],5:[function(t,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(t,r,n){var a=null;a=typeof Promise!="undefined"?Promise:t("lie"),r.exports={Promise:a}},{lie:37}],7:[function(t,r,n){var a=typeof Uint8Array!="undefined"&&typeof Uint16Array!="undefined"&&typeof Uint32Array!="undefined",l=t("pako"),o=t("./utils"),u=t("./stream/GenericWorker"),b=a?"uint8array":"array";function y(_,w){u.call(this,"FlateWorker/"+_),this._pako=null,this._pakoAction=_,this._pakoOptions=w,this.meta={}}n.magic="\b\0",o.inherits(y,u),y.prototype.processChunk=function(_){this.meta=_.meta,this._pako===null&&this._createPako(),this._pako.push(o.transformTo(b,_.data),!1)},y.prototype.flush=function(){u.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},y.prototype.cleanUp=function(){u.prototype.cleanUp.call(this),this._pako=null},y.prototype._createPako=function(){this._pako=new l[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var _=this;this._pako.onData=function(w){_.push({data:w,meta:_.meta})}},n.compressWorker=function(_){return new y("Deflate",_)},n.uncompressWorker=function(){return new y("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,r,n){function a(d,k){var h,m="";for(h=0;h>>=8;return m}function l(d,k,h,m,f,v){var C,A,E=d.file,D=d.compression,I=v!==b.utf8encode,W=o.transformTo("string",v(E.name)),T=o.transformTo("string",b.utf8encode(E.name)),X=E.comment,Q=o.transformTo("string",v(X)),S=o.transformTo("string",b.utf8encode(X)),O=T.length!==E.name.length,c=S.length!==X.length,L="",et="",$="",rt=E.dir,H=E.date,tt={crc32:0,compressedSize:0,uncompressedSize:0};k&&!h||(tt.crc32=d.crc32,tt.compressedSize=d.compressedSize,tt.uncompressedSize=d.uncompressedSize);var R=0;k&&(R|=8),I||!O&&!c||(R|=2048);var B=0,J=0;rt&&(B|=16),f==="UNIX"?(J=798,B|=function(G,mt){var yt=G;return G||(yt=mt?16893:33204),(65535&yt)<<16}(E.unixPermissions,rt)):(J=20,B|=function(G){return 63&(G||0)}(E.dosPermissions)),C=H.getUTCHours(),C<<=6,C|=H.getUTCMinutes(),C<<=5,C|=H.getUTCSeconds()/2,A=H.getUTCFullYear()-1980,A<<=4,A|=H.getUTCMonth()+1,A<<=5,A|=H.getUTCDate(),O&&(et=a(1,1)+a(y(W),4)+T,L+="up"+a(et.length,2)+et),c&&($=a(1,1)+a(y(Q),4)+S,L+="uc"+a($.length,2)+$);var q="";return q+=` +\0`,q+=a(R,2),q+=D.magic,q+=a(C,2),q+=a(A,2),q+=a(tt.crc32,4),q+=a(tt.compressedSize,4),q+=a(tt.uncompressedSize,4),q+=a(W.length,2),q+=a(L.length,2),{fileRecord:_.LOCAL_FILE_HEADER+q+W+L,dirRecord:_.CENTRAL_FILE_HEADER+a(J,2)+q+a(Q.length,2)+"\0\0\0\0"+a(B,4)+a(m,4)+W+L+Q}}var o=t("../utils"),u=t("../stream/GenericWorker"),b=t("../utf8"),y=t("../crc32"),_=t("../signature");function w(d,k,h,m){u.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=k,this.zipPlatform=h,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(w,u),w.prototype.push=function(d){var k=d.meta.percent||0,h=this.entriesCount,m=this._sources.length;this.accumulate?this.contentBuffer.push(d):(this.bytesWritten+=d.data.length,u.prototype.push.call(this,{data:d.data,meta:{currentFile:this.currentFile,percent:h?(k+100*(h-m-1))/h:100}}))},w.prototype.openedSource=function(d){this.currentSourceOffset=this.bytesWritten,this.currentFile=d.file.name;var k=this.streamFiles&&!d.file.dir;if(k){var h=l(d,k,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:h.fileRecord,meta:{percent:0}})}else this.accumulate=!0},w.prototype.closedSource=function(d){this.accumulate=!1;var k=this.streamFiles&&!d.file.dir,h=l(d,k,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(h.dirRecord),k)this.push({data:function(m){return _.DATA_DESCRIPTOR+a(m.crc32,4)+a(m.compressedSize,4)+a(m.uncompressedSize,4)}(d),meta:{percent:100}});else for(this.push({data:h.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},w.prototype.flush=function(){for(var d=this.bytesWritten,k=0;k=this.index;u--)b=(b<<8)+this.byteAt(u);return this.index+=o,b},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=l},{"../utils":32}],19:[function(t,r,n){var a=t("./Uint8ArrayReader");function l(o){a.call(this,o)}t("../utils").inherits(l,a),l.prototype.readData=function(o){this.checkOffset(o);var u=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,u},r.exports=l},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,r,n){var a=t("./DataReader");function l(o){a.call(this,o)}t("../utils").inherits(l,a),l.prototype.byteAt=function(o){return this.data.charCodeAt(this.zero+o)},l.prototype.lastIndexOfSignature=function(o){return this.data.lastIndexOf(o)-this.zero},l.prototype.readAndCheckSignature=function(o){return o===this.readData(4)},l.prototype.readData=function(o){this.checkOffset(o);var u=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,u},r.exports=l},{"../utils":32,"./DataReader":18}],21:[function(t,r,n){var a=t("./ArrayReader");function l(o){a.call(this,o)}t("../utils").inherits(l,a),l.prototype.readData=function(o){if(this.checkOffset(o),o===0)return new Uint8Array(0);var u=this.data.subarray(this.zero+this.index,this.zero+this.index+o);return this.index+=o,u},r.exports=l},{"../utils":32,"./ArrayReader":17}],22:[function(t,r,n){var a=t("../utils"),l=t("../support"),o=t("./ArrayReader"),u=t("./StringReader"),b=t("./NodeBufferReader"),y=t("./Uint8ArrayReader");r.exports=function(_){var w=a.getTypeOf(_);return a.checkSupport(w),w!=="string"||l.uint8array?w==="nodebuffer"?new b(_):l.uint8array?new y(a.transformTo("uint8array",_)):new o(a.transformTo("array",_)):new u(_)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,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(t,r,n){var a=t("./GenericWorker"),l=t("../utils");function o(u){a.call(this,"ConvertWorker to "+u),this.destType=u}l.inherits(o,a),o.prototype.processChunk=function(u){this.push({data:l.transformTo(this.destType,u.data),meta:u.meta})},r.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(t,r,n){var a=t("./GenericWorker"),l=t("../crc32");function o(){a.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(o,a),o.prototype.processChunk=function(u){this.streamInfo.crc32=l(u.data,this.streamInfo.crc32||0),this.push(u)},r.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,r,n){var a=t("../utils"),l=t("./GenericWorker");function o(u){l.call(this,"DataLengthProbe for "+u),this.propName=u,this.withStreamInfo(u,0)}a.inherits(o,l),o.prototype.processChunk=function(u){if(u){var b=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=b+u.data.length}l.prototype.processChunk.call(this,u)},r.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(t,r,n){var a=t("../utils"),l=t("./GenericWorker");function o(u){l.call(this,"DataWorker");var b=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,u.then(function(y){b.dataIsReady=!0,b.data=y,b.max=y&&y.length||0,b.type=a.getTypeOf(y),b.isPaused||b._tickAndRepeat()},function(y){b.error(y)})}a.inherits(o,l),o.prototype.cleanUp=function(){l.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!l.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 u=null,b=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":u=this.data.substring(this.index,b);break;case"uint8array":u=this.data.subarray(this.index,b);break;case"array":case"nodebuffer":u=this.data.slice(this.index,b)}return this.index=b,this.push({data:u,meta:{percent:this.max?this.index/this.max*100:0}})},r.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(t,r,n){function a(l){this.name=l||"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(l){this.emit("data",l)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(l){this.emit("error",l)}return!0},error:function(l){return!this.isFinished&&(this.isPaused?this.generatedError=l:(this.isFinished=!0,this.emit("error",l),this.previous&&this.previous.error(l),this.cleanUp()),!0)},on:function(l,o){return this._listeners[l].push(o),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(l,o){if(this._listeners[l])for(var u=0;u "+l:l}},r.exports=a},{}],29:[function(t,r,n){var a=t("../utils"),l=t("./ConvertWorker"),o=t("./GenericWorker"),u=t("../base64"),b=t("../support"),y=t("../external"),_=null;if(b.nodestream)try{_=t("../nodejs/NodejsStreamOutputAdapter")}catch(k){}function w(k,h){return new y.Promise(function(m,f){var v=[],C=k._internalType,A=k._outputType,E=k._mimeType;k.on("data",function(D,I){v.push(D),h&&h(I)}).on("error",function(D){v=[],f(D)}).on("end",function(){try{var D=function(I,W,T){switch(I){case"blob":return a.newBlob(a.transformTo("arraybuffer",W),T);case"base64":return u.encode(W);default:return a.transformTo(I,W)}}(A,function(I,W){var T,X=0,Q=null,S=0;for(T=0;T>>6:(m<65536?h[C++]=224|m>>>12:(h[C++]=240|m>>>18,h[C++]=128|m>>>12&63),h[C++]=128|m>>>6&63),h[C++]=128|63&m);return h}(d)},n.utf8decode=function(d){return l.nodebuffer?a.transformTo("nodebuffer",d).toString("utf-8"):function(k){var h,m,f,v,C=k.length,A=new Array(2*C);for(h=m=0;h>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(l.uint8array?"uint8array":"array",d))},a.inherits(_,u),_.prototype.processChunk=function(d){var k=a.transformTo(l.uint8array?"uint8array":"array",d.data);if(this.leftOver&&this.leftOver.length){if(l.uint8array){var h=k;(k=new Uint8Array(h.length+this.leftOver.length)).set(this.leftOver,0),k.set(h,this.leftOver.length)}else k=this.leftOver.concat(k);this.leftOver=null}var m=function(v,C){var A;for((C=C||v.length)>v.length&&(C=v.length),A=C-1;0<=A&&(192&v[A])==128;)A--;return A<0||A===0?C:A+b[v[A]]>C?A:C}(k),f=k;m!==k.length&&(l.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})},_.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=_,a.inherits(w,u),w.prototype.processChunk=function(d){this.push({data:n.utf8encode(d.data),meta:d.meta})},n.Utf8EncodeWorker=w},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,r,n){var a=t("./support"),l=t("./base64"),o=t("./nodejsUtils"),u=t("./external");function b(h){return h}function y(h,m){for(var f=0;f>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===l.MAX_VALUE_32BITS&&(this.uncompressedSize=d.readInt(8)),this.compressedSize===l.MAX_VALUE_32BITS&&(this.compressedSize=d.readInt(8)),this.localHeaderOffset===l.MAX_VALUE_32BITS&&(this.localHeaderOffset=d.readInt(8)),this.diskNumberStart===l.MAX_VALUE_32BITS&&(this.diskNumberStart=d.readInt(4))}},readExtraFields:function(d){var k,h,m,f=d.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});d.index+4>>6:(d<65536?w[m++]=224|d>>>12:(w[m++]=240|d>>>18,w[m++]=128|d>>>12&63),w[m++]=128|d>>>6&63),w[m++]=128|63&d);return w},n.buf2binstring=function(_){return y(_,_.length)},n.binstring2buf=function(_){for(var w=new a.Buf8(_.length),d=0,k=w.length;d>10&1023,v[k++]=56320|1023&h)}return y(v,k)},n.utf8border=function(_,w){var d;for((w=w||_.length)>_.length&&(w=_.length),d=w-1;0<=d&&(192&_[d])==128;)d--;return d<0||d===0?w:d+u[_[d]]>w?d:w}},{"./common":41}],43:[function(t,r,n){r.exports=function(a,l,o,u){for(var b=65535&a|0,y=a>>>16&65535|0,_=0;o!==0;){for(o-=_=2e3>>1:l>>>1;o[u]=l}return o}();r.exports=function(l,o,u,b){var y=a,_=b+u;l^=-1;for(var w=b;w<_;w++)l=l>>>8^y[255&(l^o[w])];return-1^l}},{}],46:[function(t,r,n){var a,l=t("../utils/common"),o=t("./trees"),u=t("./adler32"),b=t("./crc32"),y=t("./messages"),_=0,w=4,d=0,k=-2,h=-1,m=4,f=2,v=8,C=9,A=286,E=30,D=19,I=2*A+1,W=15,T=3,X=258,Q=X+T+1,S=42,O=113,c=1,L=2,et=3,$=4;function rt(s,F){return s.msg=y[F],F}function H(s){return(s<<1)-(4s.avail_out&&(M=s.avail_out),M!==0&&(l.arraySet(s.output,F.pending_buf,F.pending_out,M,s.next_out),s.next_out+=M,F.pending_out+=M,s.total_out+=M,s.avail_out-=M,F.pending-=M,F.pending===0&&(F.pending_out=0))}function B(s,F){o._tr_flush_block(s,0<=s.block_start?s.block_start:-1,s.strstart-s.block_start,F),s.block_start=s.strstart,R(s.strm)}function J(s,F){s.pending_buf[s.pending++]=F}function q(s,F){s.pending_buf[s.pending++]=F>>>8&255,s.pending_buf[s.pending++]=255&F}function G(s,F){var M,g,p=s.max_chain_length,x=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,V=s.prev,Y=s.strstart+X,lt=Z[x+j-1],st=Z[x+j];s.prev_length>=s.good_match&&(p>>=2),U>s.lookahead&&(U=s.lookahead);do if(Z[(M=F)+j]===st&&Z[M+j-1]===lt&&Z[M]===Z[x]&&Z[++M]===Z[x+1]){x+=2,M++;do;while(Z[++x]===Z[++M]&&Z[++x]===Z[++M]&&Z[++x]===Z[++M]&&Z[++x]===Z[++M]&&Z[++x]===Z[++M]&&Z[++x]===Z[++M]&&Z[++x]===Z[++M]&&Z[++x]===Z[++M]&&xN&&--p!=0);return j<=s.lookahead?j:s.lookahead}function mt(s){var F,M,g,p,x,j,U,N,Z,K,V=s.w_size;do{if(p=s.window_size-s.lookahead-s.strstart,s.strstart>=V+(V-Q)){for(l.arraySet(s.window,s.window,V,V,0),s.match_start-=V,s.strstart-=V,s.block_start-=V,F=M=s.hash_size;g=s.head[--F],s.head[F]=V<=g?g-V:0,--M;);for(F=M=V;g=s.prev[--F],s.prev[F]=V<=g?g-V:0,--M;);p+=V}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=T)for(x=s.strstart-s.insert,s.ins_h=s.window[x],s.ins_h=(s.ins_h<=T&&(s.ins_h=(s.ins_h<=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<=T&&(s.ins_h=(s.ins_h<=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.pending_buf_size-5&&(M=s.pending_buf_size-5);;){if(s.lookahead<=1){if(mt(s),s.lookahead===0&&F===_)return c;if(s.lookahead===0)break}s.strstart+=s.lookahead,s.lookahead=0;var g=s.block_start+M;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,F===w?(B(s,!0),s.strm.avail_out===0?et:$):(s.strstart>s.block_start&&(B(s,!1),s.strm.avail_out),c)}),new it(4,4,8,4,yt),new it(4,5,16,8,yt),new it(4,6,32,32,yt),new it(4,4,16,16,at),new it(8,16,32,32,at),new it(8,16,128,128,at),new it(8,32,128,256,at),new it(32,128,258,1024,at),new it(32,258,258,4096,at)],n.deflateInit=function(s,F){return xt(s,F,v,15,8,0)},n.deflateInit2=xt,n.deflateReset=Pt,n.deflateResetKeep=gt,n.deflateSetHeader=function(s,F){return s&&s.state?s.state.wrap!==2?k:(s.state.gzhead=F,d):k},n.deflate=function(s,F){var M,g,p,x;if(!s||!s.state||5>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=b(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=O);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=O,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=b(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=b(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=b(s.adler,g.pending_buf,g.pending-p,p)),R(s),p=g.pending,g.pending===g.pending_buf_size)){x=1;break}x=g.gzindexp&&(s.adler=b(s.adler,g.pending_buf,g.pending-p,p)),x===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=b(s.adler,g.pending_buf,g.pending-p,p)),R(s),p=g.pending,g.pending===g.pending_buf_size)){x=1;break}x=g.gzindexp&&(s.adler=b(s.adler,g.pending_buf,g.pending-p,p)),x===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=O)):g.status=O),g.pending!==0){if(R(s),s.avail_out===0)return g.last_flush=-1,d}else if(s.avail_in===0&&H(F)<=H(M)&&F!==w)return rt(s,-5);if(g.status===666&&s.avail_in!==0)return rt(s,-5);if(s.avail_in!==0||g.lookahead!==0||F!==_&&g.status!==666){var U=g.strategy===2?function(N,Z){for(var K;;){if(N.lookahead===0&&(mt(N),N.lookahead===0)){if(Z===_)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===w?(B(N,!0),N.strm.avail_out===0?et:$):N.last_lit&&(B(N,!1),N.strm.avail_out===0)?c:L}(g,F):g.strategy===3?function(N,Z){for(var K,V,Y,lt,st=N.window;;){if(N.lookahead<=X){if(mt(N),N.lookahead<=X&&Z===_)return c;if(N.lookahead===0)break}if(N.match_length=0,N.lookahead>=T&&0N.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===w?(B(N,!0),N.strm.avail_out===0?et:$):N.last_lit&&(B(N,!1),N.strm.avail_out===0)?c:L}(g,F):a[g.level].func(g,F);if(U!==et&&U!==$||(g.status=666),U===c||U===et)return s.avail_out===0&&(g.last_flush=-1),d;if(U===L&&(F===1?o._tr_align(g):F!==5&&(o._tr_stored_block(g,0,0,!1),F===3&&(tt(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 F!==w?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=M.w_size&&(x===0&&(tt(M.head),M.strstart=0,M.block_start=0,M.insert=0),Z=new l.Buf8(M.w_size),l.arraySet(Z,F,K-M.w_size,M.w_size,0),F=Z,K=M.w_size),j=s.avail_in,U=s.next_in,N=s.input,s.avail_in=K,s.next_in=0,s.input=F,mt(M);M.lookahead>=T;){for(g=M.strstart,p=M.lookahead-(T-1);M.ins_h=(M.ins_h<>>=T=W>>>24,C-=T,(T=W>>>16&255)===0)L[y++]=65535&W;else{if(!(16&T)){if(!(64&T)){W=A[(65535&W)+(v&(1<>>=T,C-=T),C<15&&(v+=c[u++]<>>=T=W>>>24,C-=T,!(16&(T=W>>>16&255))){if(!(64&T)){W=E[(65535&W)+(v&(1<>>=T,C-=T,(T=y-_)>3,v&=(1<<(C-=X<<3))-1,a.next_in=u,a.next_out=y,a.avail_in=u>>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 C(S){var O;return S&&S.state?(O=S.state,S.total_in=S.total_out=O.total=0,S.msg="",O.wrap&&(S.adler=1&O.wrap),O.mode=k,O.last=0,O.havedict=0,O.dmax=32768,O.head=null,O.hold=0,O.bits=0,O.lencode=O.lendyn=new a.Buf32(h),O.distcode=O.distdyn=new a.Buf32(m),O.sane=1,O.back=-1,w):d}function A(S){var O;return S&&S.state?((O=S.state).wsize=0,O.whave=0,O.wnext=0,C(S)):d}function E(S,O){var c,L;return S&&S.state?(L=S.state,O<0?(c=0,O=-O):(c=1+(O>>4),O<48&&(O&=15)),O&&(O<8||15=$.wsize?(a.arraySet($.window,O,c-$.wsize,$.wsize,0),$.wnext=0,$.whave=$.wsize):(L<(et=$.wsize-$.wnext)&&(et=L),a.arraySet($.window,O,c-L,et,$.wnext),(L-=et)?(a.arraySet($.window,O,c-L,L,0),$.wnext=L,$.whave=$.wsize):($.wnext+=et,$.wnext===$.wsize&&($.wnext=0),$.whave<$.wsize&&($.whave+=et))),0}n.inflateReset=A,n.inflateReset2=E,n.inflateResetKeep=C,n.inflateInit=function(S){return D(S,15)},n.inflateInit2=D,n.inflate=function(S,O){var c,L,et,$,rt,H,tt,R,B,J,q,G,mt,yt,at,it,kt,gt,Pt,xt,s,F,M,g,p=0,x=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),rt=S.next_out,et=S.output,tt=S.avail_out,$=S.next_in,L=S.input,H=S.avail_in,R=c.hold,B=c.bits,J=H,q=tt,F=w;t:for(;;)switch(c.mode){case k:if(c.wrap===0){c.mode=13;break}for(;B<16;){if(H===0)break t;H--,R+=L[$++]<>>8&255,c.check=o(c.check,x,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<>8&1),512&c.flags&&(x[0]=255&R,x[1]=R>>>8&255,c.check=o(c.check,x,2,0)),B=R=0,c.mode=3;case 3:for(;B<32;){if(H===0)break t;H--,R+=L[$++]<>>8&255,x[2]=R>>>16&255,x[3]=R>>>24&255,c.check=o(c.check,x,4,0)),B=R=0,c.mode=4;case 4:for(;B<16;){if(H===0)break t;H--,R+=L[$++]<>8),512&c.flags&&(x[0]=255&R,x[1]=R>>>8&255,c.check=o(c.check,x,2,0)),B=R=0,c.mode=5;case 5:if(1024&c.flags){for(;B<16;){if(H===0)break t;H--,R+=L[$++]<>>8&255,c.check=o(c.check,x,2,0)),B=R=0}else c.head&&(c.head.extra=null);c.mode=6;case 6:if(1024&c.flags&&(H<(G=c.length)&&(G=H),G&&(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,L,$,G,s)),512&c.flags&&(c.check=o(c.check,L,G,$)),H-=G,$+=G,c.length-=G),c.length))break t;c.length=0,c.mode=7;case 7:if(2048&c.flags){if(H===0)break t;for(G=0;s=L[$+G++],c.head&&s&&c.length<65536&&(c.head.name+=String.fromCharCode(s)),s&&G>9&1,c.head.done=!0),S.adler=c.check=0,c.mode=12;break;case 10:for(;B<32;){if(H===0)break t;H--,R+=L[$++]<>>=7&B,B-=7&B,c.mode=27;break}for(;B<3;){if(H===0)break t;H--,R+=L[$++]<>>=1)){case 0:c.mode=14;break;case 1:if(X(c),c.mode=20,O!==6)break;R>>>=2,B-=2;break t;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(H===0)break t;H--,R+=L[$++]<>>16^65535)){S.msg="invalid stored block lengths",c.mode=30;break}if(c.length=65535&R,B=R=0,c.mode=15,O===6)break t;case 15:c.mode=16;case 16:if(G=c.length){if(H>>=5,B-=5,c.ndist=1+(31&R),R>>>=5,B-=5,c.ncode=4+(15&R),R>>>=4,B-=4,286>>=3,B-=3}for(;c.have<19;)c.lens[j[c.have++]]=0;if(c.lencode=c.lendyn,c.lenbits=7,M={bits:c.lenbits},F=b(0,c.lens,0,19,c.lencode,0,c.work,M),c.lenbits=M.bits,F){S.msg="invalid code lengths set",c.mode=30;break}c.have=0,c.mode=19;case 19:for(;c.have>>16&255,kt=65535&p,!((at=p>>>24)<=B);){if(H===0)break t;H--,R+=L[$++]<>>=at,B-=at,c.lens[c.have++]=kt;else{if(kt===16){for(g=at+2;B>>=at,B-=at,c.have===0){S.msg="invalid bit length repeat",c.mode=30;break}s=c.lens[c.have-1],G=3+(3&R),R>>>=2,B-=2}else if(kt===17){for(g=at+3;B>>=at)),R>>>=3,B-=3}else{for(g=at+7;B>>=at)),R>>>=7,B-=7}if(c.have+G>c.nlen+c.ndist){S.msg="invalid bit length repeat",c.mode=30;break}for(;G--;)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,M={bits:c.lenbits},F=b(y,c.lens,0,c.nlen,c.lencode,0,c.work,M),c.lenbits=M.bits,F){S.msg="invalid literal/lengths set",c.mode=30;break}if(c.distbits=6,c.distcode=c.distdyn,M={bits:c.distbits},F=b(_,c.lens,c.nlen,c.ndist,c.distcode,0,c.work,M),c.distbits=M.bits,F){S.msg="invalid distances set",c.mode=30;break}if(c.mode=20,O===6)break t;case 20:c.mode=21;case 21:if(6<=H&&258<=tt){S.next_out=rt,S.avail_out=tt,S.next_in=$,S.avail_in=H,c.hold=R,c.bits=B,u(S,q),rt=S.next_out,et=S.output,tt=S.avail_out,$=S.next_in,L=S.input,H=S.avail_in,R=c.hold,B=c.bits,c.mode===12&&(c.back=-1);break}for(c.back=0;it=(p=c.lencode[R&(1<>>16&255,kt=65535&p,!((at=p>>>24)<=B);){if(H===0)break t;H--,R+=L[$++]<>gt)])>>>16&255,kt=65535&p,!(gt+(at=p>>>24)<=B);){if(H===0)break t;H--,R+=L[$++]<>>=gt,B-=gt,c.back+=gt}if(R>>>=at,B-=at,c.back+=at,c.length=kt,it===0){c.mode=26;break}if(32&it){c.back=-1,c.mode=12;break}if(64&it){S.msg="invalid literal/length code",c.mode=30;break}c.extra=15&it,c.mode=22;case 22:if(c.extra){for(g=c.extra;B>>=c.extra,B-=c.extra,c.back+=c.extra}c.was=c.length,c.mode=23;case 23:for(;it=(p=c.distcode[R&(1<>>16&255,kt=65535&p,!((at=p>>>24)<=B);){if(H===0)break t;H--,R+=L[$++]<>gt)])>>>16&255,kt=65535&p,!(gt+(at=p>>>24)<=B);){if(H===0)break t;H--,R+=L[$++]<>>=gt,B-=gt,c.back+=gt}if(R>>>=at,B-=at,c.back+=at,64&it){S.msg="invalid distance code",c.mode=30;break}c.offset=kt,c.extra=15&it,c.mode=24;case 24:if(c.extra){for(g=c.extra;B>>=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(tt===0)break t;if(G=q-tt,c.offset>G){if((G=c.offset-G)>c.whave&&c.sane){S.msg="invalid distance too far back",c.mode=30;break}mt=G>c.wnext?(G-=c.wnext,c.wsize-G):c.wnext-G,G>c.length&&(G=c.length),yt=c.window}else yt=et,mt=rt-c.offset,G=c.length;for(ttI?(T=mt[yt+m[O]],B[J+m[O]]):(T=96,0),v=1<>rt)+(C-=v)]=W<<24|T<<16|X|0,C!==0;);for(v=1<>=1;if(v!==0?(R&=v-1,R+=v):R=0,O++,--q[S]==0){if(S===L)break;S=_[w+m[O]]}if(et>>7)]}function J(p,x){p.pending_buf[p.pending++]=255&x,p.pending_buf[p.pending++]=x>>>8&255}function q(p,x,j){p.bi_valid>f-j?(p.bi_buf|=x<>f-p.bi_valid,p.bi_valid+=j-f):(p.bi_buf|=x<>>=1,j<<=1,0<--x;);return j>>>1}function yt(p,x,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<=x;N++){var V=p[2*N+1];V!==0&&(p[2*N]=mt(Z[V]++,V))}}function at(p){var x;for(x=0;x>1;1<=j;j--)gt(p,Z,j);for(N=Y;j=p.heap[1],p.heap[1]=p.heap[p.heap_len--],gt(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++,gt(p,Z,1),2<=p.heap_len;);p.heap[--p.heap_max]=p.heap[1],function(st,Ct){var jt,Et,Ut,bt,Kt,ie,At=Ct.dyn_tree,Be=Ct.max_code,fn=Ct.stat_desc.static_tree,pn=Ct.stat_desc.has_stree,mn=Ct.stat_desc.extra_bits,ze=Ct.stat_desc.extra_base,$t=Ct.stat_desc.max_length,Yt=0;for(bt=0;bt<=m;bt++)st.bl_count[bt]=0;for(At[2*st.heap[st.heap_max]+1]=0,jt=st.heap_max+1;jt>=7;N>>=1)if(1<&&V.dyn_ltree[2*Y]!==0)return l;if(V.dyn_ltree[18]!==0||V.dyn_ltree[20]!==0||V.dyn_ltree[26]!==0)return o;for(Y=32;Y<_;Y++)if(V.dyn_ltree[2*Y]!==0)return o;return l}(p)),xt(p,p.l_desc),xt(p,p.d_desc),K=function(V){var Y;for(s(V,V.dyn_ltree,V.l_desc.max_code),s(V,V.dyn_dtree,V.d_desc.max_code),xt(V,V.bl_desc),Y=k-1;3<=Y&&V.bl_tree[2*X[Y]+1]===0;Y--);return V.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&&x!==-1?g(p,x,j,U):p.strategy===4||Z===N?(q(p,2+(U?1:0),3),Pt(p,Q,S)):(q(p,4+(U?1:0),3),function(V,Y,lt,st){var Ct;for(q(V,Y-257,5),q(V,lt-1,5),q(V,st-4,4),Ct=0;Ct>>8&255,p.pending_buf[p.d_buf+2*p.last_lit+1]=255&x,p.pending_buf[p.l_buf+p.last_lit]=255&j,p.last_lit++,x===0?p.dyn_ltree[2*j]++:(p.matches++,x--,p.dyn_ltree[2*(c[j]+_+1)]++,p.dyn_dtree[2*B(x)]++),p.last_lit===p.lit_bufsize-1},n._tr_align=function(p){q(p,2,3),G(p,C,Q),function(x){x.bi_valid===16?(J(x,x.bi_buf),x.bi_buf=0,x.bi_valid=0):8<=x.bi_valid&&(x.pending_buf[x.pending++]=255&x.bi_buf,x.bi_buf>>=8,x.bi_valid-=8)}(p)}},{"../utils/common":41}],53:[function(t,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(t,r,n){(function(a){(function(l,o){if(!l.setImmediate){var u,b,y,_,w=1,d={},k=!1,h=l.document,m=Object.getPrototypeOf&&Object.getPrototypeOf(l);m=m&&m.setTimeout?m:l,u={}.toString.call(l.process)==="[object process]"?function(A){process.nextTick(function(){v(A)})}:function(){if(l.postMessage&&!l.importScripts){var A=!0,E=l.onmessage;return l.onmessage=function(){A=!1},l.postMessage("","*"),l.onmessage=E,A}}()?(_="setImmediate$"+Math.random()+"$",l.addEventListener?l.addEventListener("message",C,!1):l.attachEvent("onmessage",C),function(A){l.postMessage(_+A,"*")}):l.MessageChannel?((y=new MessageChannel).port1.onmessage=function(A){v(A.data)},function(A){y.port2.postMessage(A)}):h&&"onreadystatechange"in h.createElement("script")?(b=h.documentElement,function(A){var E=h.createElement("script");E.onreadystatechange=function(){v(A),E.onreadystatechange=null,b.removeChild(E),E=null},b.appendChild(E)}):function(A){setTimeout(v,0,A)},m.setImmediate=function(A){typeof A!="function"&&(A=new Function(""+A));for(var E=new Array(arguments.length-1),D=0;D({id:e.attr(t,"Id"),type:e.attr(t,"Type"),target:e.attr(t,"Target"),targetMode:e.attr(t,"TargetMode")}))}const oe={wordml:"http://schemas.openxmlformats.org/wordprocessingml/2006/main",drawingml:"http://schemas.openxmlformats.org/drawingml/2006/main",picture:"http://schemas.openxmlformats.org/drawingml/2006/picture",compatibility:"http://schemas.openxmlformats.org/markup-compatibility/2006",math:"http://schemas.openxmlformats.org/officeDocument/2006/math"},pt={Dxa:{mul:.05,unit:"pt"},Emu:{mul:1/12700,unit:"pt"},FontSize:{mul:.5,unit:"pt"},Border:{mul:.125,unit:"pt"},Point:{mul:1,unit:"pt"},Percent:{mul:.02,unit:"%"},LineHeight:{mul:1/240,unit:""},VmlEmu:{mul:1/12700,unit:""}};function le(i,e=pt.Dxa){return i==null||/.+(p[xt]|[%])$/.test(i)?i:`${(parseInt(i)*e.mul).toFixed(2)}${e.unit}`}function Te(i,e=!1){switch(i){case"1":return!0;case"0":return!1;case"on":return!0;case"off":return!1;case"true":return!0;case"false":return!1;default:return e}}function ce(i,e,t){if(i.namespaceURI!=oe.wordml)return!1;switch(i.localName){case"color":e.color=t.attr(i,"val");break;case"sz":e.fontSize=t.lengthAttr(i,"val",pt.FontSize);break;default:return!1}return!0}function Ie(i,e=!1){e&&(i=i.replace(/<[?].*[?]>/,"")),i=Fe(i);const t=new DOMParser().parseFromString(i,"application/xml"),r=Oe(t);if(r)throw new Error(r);return t}function Oe(i){var e;return(e=i.getElementsByTagName("parsererror")[0])==null?void 0:e.textContent}function Fe(i){return i.charCodeAt(0)===65279?i.substring(1):i}function De(i){return new XMLSerializer().serializeToString(i)}class he{elements(e,t=null){const r=[];for(let n=0,a=e.childNodes.length;nUe(t,e))}function Ue(i,e){let t={name:e.attr(i,"name"),embedFontRefs:[]};for(let r of e.elements(i))switch(r.localName){case"family":t.family=e.attr(r,"val");break;case"altName":t.altName=e.attr(r,"val");break;case"embedRegular":case"embedBold":case"embedItalic":case"embedBoldItalic":t.embedFontRefs.push($e(r,e));break}return t}function $e(i,e){return{id:e.attr(i,"id"),key:e.attr(i,"fontKey"),type:Le[i.localName]}}class We extends St{parseXml(e){this.fonts=je(e,this._package.xmlParser)}}function He(i){return i==null?void 0:i.replace(/[ .]+/g,"-").replace(/[&]+/g,"and").toLowerCase()}function Zt(i){let e=i.lastIndexOf("/")+1,t=e==0?"":i.substring(0,e),r=e==0?i:i.substring(e);return[t,r]}function te(i,e){try{const t="http://docx/";return new URL(i,t+e).toString().substring(t.length)}catch(t){return`${e}${i}`}}function Nt(i,e){return i.reduce((t,r)=>(t[e(r)]=r,t),{})}function Ze(i){return new Promise((e,t)=>{const r=new FileReader;r.onloadend=()=>e(r.result),r.onerror=()=>t(),r.readAsDataURL(i)})}function ee(i){return i&&typeof i=="object"&&!Array.isArray(i)}function Ve(i){return typeof i=="string"||i instanceof String}function Vt(i,...e){var r;if(!e.length)return i;const t=e.shift();if(ee(i)&&ee(t))for(const n in t)if(ee(t[n])){const a=(r=i[n])!=null?r:i[n]={};Vt(a,t[n])}else i[n]=t[n];return Vt(i,...e)}function Ft(i){return Array.isArray(i)?i:[i]}class re{constructor(e,t){this._zip=e,this.options=t,this.xmlParser=new he}get(e){var r;const t=Xe(e);return(r=this._zip.files[t])!=null?r:this._zip.files[t.replace(/\//g,"\\")]}update(e,t){this._zip.file(e,t)}static load(e,t){return wt(this,null,function*(){const r=yield It.loadAsync(e);return new re(r,t)})}save(e="blob"){return this._zip.generateAsync({type:e})}load(e,t="string"){var r,n;return(n=(r=this.get(e))==null?void 0:r.async(t))!=null?n:Promise.resolve(null)}loadRelationships(e=null){return wt(this,null,function*(){let t="_rels/.rels";if(e!=null){const[n,a]=Zt(e);t=`${n}_rels/${a}.rels`}const r=yield this.load(t);return r?Ot(this.parseXmlDocument(r).firstElementChild,this.xmlParser):null})}parseXmlDocument(e){return Ie(e,this.options.trimXmlDeclaration)}}function Xe(i){return i.startsWith("/")?i.substr(1):i}class Ge extends St{constructor(e,t,r){super(e,t),this._documentParser=r}parseXml(e){this.body=this._documentParser.parseDocumentFile(e)}}function Xt(i,e){return{type:e.attr(i,"val"),color:e.attr(i,"color"),size:e.lengthAttr(i,"sz",pt.Border),offset:e.lengthAttr(i,"space",pt.Point),frame:e.boolAttr(i,"frame"),shadow:e.boolAttr(i,"shadow")}}function qe(i,e){var t={};for(let r of e.elements(i))switch(r.localName){case"left":t.left=Xt(r,e);break;case"top":t.top=Xt(r,e);break;case"right":t.right=Xt(r,e);break;case"bottom":t.bottom=Xt(r,e);break}return t}var ue;(function(i){i.Continuous="continuous",i.NextPage="nextPage",i.NextColumn="nextColumn",i.EvenPage="evenPage",i.OddPage="oddPage"})(ue||(ue={}));function de(i,e=P){var r,n;var t={};for(let a of e.elements(i))switch(a.localName){case"pgSz":t.pageSize={width:e.lengthAttr(a,"w"),height:e.lengthAttr(a,"h"),orientation:e.attr(a,"orient")};break;case"type":t.type=e.attr(a,"val");break;case"pgMar":t.pageMargins={left:e.lengthAttr(a,"left"),right:e.lengthAttr(a,"right"),top:e.lengthAttr(a,"top"),bottom:e.lengthAttr(a,"bottom"),header:e.lengthAttr(a,"header"),footer:e.lengthAttr(a,"footer"),gutter:e.lengthAttr(a,"gutter")};break;case"cols":t.columns=Ke(a,e);break;case"headerReference":((r=t.headerRefs)!=null?r:t.headerRefs=[]).push(fe(a,e));break;case"footerReference":((n=t.footerRefs)!=null?n:t.footerRefs=[]).push(fe(a,e));break;case"titlePg":t.titlePage=e.boolAttr(a,"val",!0);break;case"pgBorders":t.pageBorders=qe(a,e);break;case"pgNumType":t.pageNumber=Ye(a,e);break}return t}function Ke(i,e){return{numberOfColumns:e.intAttr(i,"num"),space:e.lengthAttr(i,"space"),separator:e.boolAttr(i,"sep"),equalWidth:e.boolAttr(i,"equalWidth",!0),columns:e.elements(i,"col").map(t=>({width:e.lengthAttr(t,"w"),space:e.lengthAttr(t,"space")}))}}function Ye(i,e){return{chapSep:e.attr(i,"chapSep"),chapStyle:e.attr(i,"chapStyle"),format:e.attr(i,"fmt"),start:e.intAttr(i,"start")}}function fe(i,e){return{id:e.attr(i,"id"),type:e.attr(i,"type")}}function Je(i,e){return{before:e.lengthAttr(i,"before"),after:e.lengthAttr(i,"after"),line:e.intAttr(i,"line"),lineRule:e.attr(i,"lineRule")}}function ne(i,e){let t={};for(let r of e.elements(i))Qe(r,t,e);return t}function Qe(i,e,t){return!!ce(i,e,t)}function pe(i,e){let t={};for(let r of e.elements(i))me(r,t,e);return t}function me(i,e,t){if(i.namespaceURI!=oe.wordml)return!1;if(ce(i,e,t))return!0;switch(i.localName){case"tabs":e.tabs=tr(i,t);break;case"sectPr":e.sectionProps=de(i,t);break;case"numPr":e.numbering=er(i,t);break;case"spacing":return e.lineSpacing=Je(i,t),!1;case"textAlignment":return e.textAlignment=t.attr(i,"val"),!1;case"keepLines":e.keepLines=t.boolAttr(i,"val",!0);break;case"keepNext":e.keepNext=t.boolAttr(i,"val",!0);break;case"pageBreakBefore":e.pageBreakBefore=t.boolAttr(i,"val",!0);break;case"outlineLvl":e.outlineLevel=t.intAttr(i,"val");break;case"pStyle":e.styleName=t.attr(i,"val");break;case"rPr":e.runProps=ne(i,t);break;default:return!1}return!0}function tr(i,e){return e.elements(i,"tab").map(t=>({position:e.lengthAttr(t,"pos"),leader:e.attr(t,"leader"),style:e.attr(t,"val")}))}function er(i,e){var t={};for(let r of e.elements(i))switch(r.localName){case"numId":t.id=e.attr(r,"val");break;case"ilvl":t.level=e.intAttr(r,"val");break}return t}function rr(i,e){let t={numberings:[],abstractNumberings:[],bulletPictures:[]};for(let r of e.elements(i))switch(r.localName){case"num":t.numberings.push(nr(r,e));break;case"abstractNum":t.abstractNumberings.push(ar(r,e));break;case"numPicBullet":t.bulletPictures.push(ir(r,e));break}return t}function nr(i,e){let t={id:e.attr(i,"numId"),overrides:[]};for(let r of e.elements(i))switch(r.localName){case"abstractNumId":t.abstractId=e.attr(r,"val");break;case"lvlOverride":t.overrides.push(sr(r,e));break}return t}function ar(i,e){let t={id:e.attr(i,"abstractNumId"),levels:[]};for(let r of e.elements(i))switch(r.localName){case"name":t.name=e.attr(r,"val");break;case"multiLevelType":t.multiLevelType=e.attr(r,"val");break;case"numStyleLink":t.numberingStyleLink=e.attr(r,"val");break;case"styleLink":t.styleLink=e.attr(r,"val");break;case"lvl":t.levels.push(ge(r,e));break}return t}function ge(i,e){let t={level:e.intAttr(i,"ilvl")};for(let r of e.elements(i))switch(r.localName){case"start":t.start=e.attr(r,"val");break;case"lvlRestart":t.restart=e.intAttr(r,"val");break;case"numFmt":t.format=e.attr(r,"val");break;case"lvlText":t.text=e.attr(r,"val");break;case"lvlJc":t.justification=e.attr(r,"val");break;case"lvlPicBulletId":t.bulletPictureId=e.attr(r,"val");break;case"pStyle":t.paragraphStyle=e.attr(r,"val");break;case"pPr":t.paragraphProps=pe(r,e);break;case"rPr":t.runProps=ne(r,e);break}return t}function sr(i,e){let t={level:e.intAttr(i,"ilvl")};for(let r of e.elements(i))switch(r.localName){case"startOverride":t.start=e.intAttr(r,"val");break;case"lvl":t.numberingLevel=ge(r,e);break}return t}function ir(i,e){var t=e.element(i,"pict"),r=t&&e.element(t,"shape"),n=r&&e.element(r,"imagedata");return n?{id:e.attr(i,"numPicBulletId"),referenceId:e.attr(n,"id"),style:e.attr(r,"style")}:null}class or extends St{constructor(e,t,r){super(e,t),this._documentParser=r}parseXml(e){Object.assign(this,rr(e,this._package.xmlParser)),this.domNumberings=this._documentParser.parseNumberingFile(e)}}class lr extends St{constructor(e,t,r){super(e,t),this._documentParser=r}parseXml(e){this.styles=this._documentParser.parseStylesFile(e)}}var z;(function(i){i.Document="document",i.Paragraph="paragraph",i.Run="run",i.Break="break",i.NoBreakHyphen="noBreakHyphen",i.Table="table",i.Row="row",i.Cell="cell",i.Hyperlink="hyperlink",i.SmartTag="smartTag",i.Drawing="drawing",i.Image="image",i.Text="text",i.Tab="tab",i.Symbol="symbol",i.BookmarkStart="bookmarkStart",i.BookmarkEnd="bookmarkEnd",i.Footer="footer",i.Header="header",i.FootnoteReference="footnoteReference",i.EndnoteReference="endnoteReference",i.Footnote="footnote",i.Endnote="endnote",i.SimpleField="simpleField",i.ComplexField="complexField",i.Instruction="instruction",i.VmlPicture="vmlPicture",i.MmlMath="mmlMath",i.MmlMathParagraph="mmlMathParagraph",i.MmlFraction="mmlFraction",i.MmlFunction="mmlFunction",i.MmlFunctionName="mmlFunctionName",i.MmlNumerator="mmlNumerator",i.MmlDenominator="mmlDenominator",i.MmlRadical="mmlRadical",i.MmlBase="mmlBase",i.MmlDegree="mmlDegree",i.MmlSuperscript="mmlSuperscript",i.MmlSubscript="mmlSubscript",i.MmlPreSubSuper="mmlPreSubSuper",i.MmlSubArgument="mmlSubArgument",i.MmlSuperArgument="mmlSuperArgument",i.MmlNary="mmlNary",i.MmlDelimiter="mmlDelimiter",i.MmlRun="mmlRun",i.MmlEquationArray="mmlEquationArray",i.MmlLimit="mmlLimit",i.MmlLimitLower="mmlLimitLower",i.MmlMatrix="mmlMatrix",i.MmlMatrixRow="mmlMatrixRow",i.MmlBox="mmlBox",i.MmlBar="mmlBar",i.MmlGroupChar="mmlGroupChar",i.VmlElement="vmlElement",i.Inserted="inserted",i.Deleted="deleted",i.DeletedText="deletedText",i.Comment="comment",i.CommentReference="commentReference",i.CommentRangeStart="commentRangeStart",i.CommentRangeEnd="commentRangeEnd"})(z||(z={}));class zt{constructor(){this.children=[],this.cssStyle={}}}class cr extends zt{constructor(){super(...arguments),this.type=z.Header}}class hr extends zt{constructor(){super(...arguments),this.type=z.Footer}}class be extends St{constructor(e,t,r){super(e,t),this._documentParser=r}parseXml(e){this.rootElement=this.createRootElement(),this.rootElement.children=this._documentParser.parseBodyElements(e)}}class ur extends be{createRootElement(){return new cr}}class dr extends be{createRootElement(){return new hr}}function fr(i,e){const t={};for(let r of e.elements(i))switch(r.localName){case"Template":t.template=r.textContent;break;case"Pages":t.pages=Dt(r.textContent);break;case"Words":t.words=Dt(r.textContent);break;case"Characters":t.characters=Dt(r.textContent);break;case"Application":t.application=r.textContent;break;case"Lines":t.lines=Dt(r.textContent);break;case"Paragraphs":t.paragraphs=Dt(r.textContent);break;case"Company":t.company=r.textContent;break;case"AppVersion":t.appVersion=r.textContent;break}return t}function Dt(i){if(typeof i!="undefined")return parseInt(i)}class pr extends St{parseXml(e){this.props=fr(e,this._package.xmlParser)}}function mr(i,e){const t={};for(let r of e.elements(i))switch(r.localName){case"title":t.title=r.textContent;break;case"description":t.description=r.textContent;break;case"subject":t.subject=r.textContent;break;case"creator":t.creator=r.textContent;break;case"keywords":t.keywords=r.textContent;break;case"language":t.language=r.textContent;break;case"lastModifiedBy":t.lastModifiedBy=r.textContent;break;case"revision":r.textContent&&(t.revision=parseInt(r.textContent));break}return t}class gr extends St{parseXml(e){this.props=mr(e,this._package.xmlParser)}}class br{}function vr(i,e){var t=new br,r=e.element(i,"themeElements");for(let n of e.elements(r))switch(n.localName){case"clrScheme":t.colorScheme=kr(n,e);break;case"fontScheme":t.fontScheme=yr(n,e);break}return t}function kr(i,e){var t={name:e.attr(i,"name"),colors:{}};for(let a of e.elements(i)){var r=e.element(a,"srgbClr"),n=e.element(a,"sysClr");r?t.colors[a.localName]=e.attr(r,"val"):n&&(t.colors[a.localName]=e.attr(n,"lastClr"))}return t}function yr(i,e){var t={name:e.attr(i,"name")};for(let r of e.elements(i))switch(r.localName){case"majorFont":t.majorFont=ve(r,e);break;case"minorFont":t.minorFont=ve(r,e);break}return t}function ve(i,e){return{latinTypeface:e.elementAttr(i,"latin","typeface"),eaTypeface:e.elementAttr(i,"ea","typeface"),csTypeface:e.elementAttr(i,"cs","typeface")}}class _r extends St{constructor(e,t){super(e,t)}parseXml(e){this.theme=vr(e,this._package.xmlParser)}}class ke{}class wr extends ke{constructor(){super(...arguments),this.type=z.Footnote}}class Sr extends ke{constructor(){super(...arguments),this.type=z.Endnote}}class ye extends St{constructor(e,t,r){super(e,t),this._documentParser=r}}class Cr extends ye{constructor(e,t,r){super(e,t,r)}parseXml(e){this.notes=this._documentParser.parseNotes(e,"footnote",wr)}}class xr extends ye{constructor(e,t,r){super(e,t,r)}parseXml(e){this.notes=this._documentParser.parseNotes(e,"endnote",Sr)}}function Pr(i,e){var t={};for(let r of e.elements(i))switch(r.localName){case"defaultTabStop":t.defaultTabStop=e.lengthAttr(r,"val");break;case"footnotePr":t.footnoteProps=_e(r,e);break;case"endnotePr":t.endnoteProps=_e(r,e);break;case"autoHyphenation":t.autoHyphenation=e.boolAttr(r,"val");break}return t}function _e(i,e){var t={defaultNoteIds:[]};for(let r of e.elements(i))switch(r.localName){case"numFmt":t.nummeringFormat=e.attr(r,"val");break;case"footnote":case"endnote":t.defaultNoteIds.push(e.attr(r,"id"));break}return t}class Er extends St{constructor(e,t){super(e,t)}parseXml(e){this.settings=Pr(e,this._package.xmlParser)}}function Ar(i,e){return e.elements(i,"property").map(t=>{const r=t.firstChild;return{formatId:e.attr(t,"fmtid"),name:e.attr(t,"name"),type:r.nodeName,value:r.textContent}})}class Nr extends St{parseXml(e){this.props=Ar(e,this._package.xmlParser)}}class Br extends St{constructor(e,t,r){super(e,t),this._documentParser=r}parseXml(e){this.comments=this._documentParser.parseComments(e),this.commentMap=Nt(this.comments,t=>t.id)}}class zr extends St{constructor(e,t){super(e,t),this.comments=[]}parseXml(e){const t=this._package.xmlParser;for(let r of t.elements(e,"commentEx"))this.comments.push({paraId:t.attr(r,"paraId"),paraIdParent:t.attr(r,"paraIdParent"),done:t.boolAttr(r,"done")});this.commentMap=Nt(this.comments,r=>r.paraId)}}const Rr=[{type:ot.OfficeDocument,target:"word/document.xml"},{type:ot.ExtendedProperties,target:"docProps/app.xml"},{type:ot.CoreProperties,target:"docProps/core.xml"},{type:ot.CustomProperties,target:"docProps/custom.xml"}];class ae{constructor(){this.parts=[],this.partsMap={}}static load(e,t,r){return wt(this,null,function*(){var n=new ae;return n._options=r,n._parser=t,n._package=yield re.load(e,r),n.rels=yield n._package.loadRelationships(),yield Promise.all(Rr.map(a=>{var o;const l=(o=n.rels.find(u=>u.type===a.type))!=null?o:a;return n.loadRelationshipPart(l.target,l.type)})),n})}save(e="blob"){return this._package.save(e)}loadRelationshipPart(e,t){return wt(this,null,function*(){var n;if(this.partsMap[e])return this.partsMap[e];if(!this._package.get(e))return null;let r=null;switch(t){case ot.OfficeDocument:this.documentPart=r=new Ge(this._package,e,this._parser);break;case ot.FontTable:this.fontTablePart=r=new We(this._package,e);break;case ot.Numbering:this.numberingPart=r=new or(this._package,e,this._parser);break;case ot.Styles:this.stylesPart=r=new lr(this._package,e,this._parser);break;case ot.Theme:this.themePart=r=new _r(this._package,e);break;case ot.Footnotes:this.footnotesPart=r=new Cr(this._package,e,this._parser);break;case ot.Endnotes:this.endnotesPart=r=new xr(this._package,e,this._parser);break;case ot.Footer:r=new dr(this._package,e,this._parser);break;case ot.Header:r=new ur(this._package,e,this._parser);break;case ot.CoreProperties:this.corePropsPart=r=new gr(this._package,e);break;case ot.ExtendedProperties:this.extendedPropsPart=r=new pr(this._package,e);break;case ot.CustomProperties:r=new Nr(this._package,e);break;case ot.Settings:this.settingsPart=r=new Er(this._package,e);break;case ot.Comments:this.commentsPart=r=new Br(this._package,e,this._parser);break;case ot.CommentsExtended:this.commentsExtendedPart=r=new zr(this._package,e);break}if(r==null)return Promise.resolve(null);if(this.partsMap[e]=r,this.parts.push(r),yield r.load(),((n=r.rels)==null?void 0:n.length)>0){const[a]=Zt(r.path);yield Promise.all(r.rels.map(l=>this.loadRelationshipPart(te(l.target,a),l.type)))}return r})}loadDocumentImage(e,t){return wt(this,null,function*(){const r=yield this.loadResource(t!=null?t:this.documentPart,e,"blob");return this.blobToURL(r)})}loadNumberingImage(e){return wt(this,null,function*(){const t=yield this.loadResource(this.numberingPart,e,"blob");return this.blobToURL(t)})}loadFont(e,t){return wt(this,null,function*(){const r=yield this.loadResource(this.fontTablePart,e,"uint8array");return r&&this.blobToURL(new Blob([Mr(r,t)]))})}blobToURL(e){return e?this._options.useBase64URL?Ze(e):URL.createObjectURL(e):null}findPartByRelId(e,t=null){var a;var r=((a=t.rels)!=null?a:this.rels).find(l=>l.id==e);const n=t?Zt(t.path)[0]:"";return r?this.partsMap[te(r.target,n)]:null}getPathById(e,t){const r=e.rels.find(a=>a.id==t),[n]=Zt(e.path);return r?te(r.target,n):null}loadResource(e,t,r){const n=this.getPathById(e,t);return n?this._package.load(n,r):Promise.resolve(null)}}function Mr(i,e){const r=e.replace(/{|}|-/g,""),n=new Array(16);for(let a=0;a<16;a++)n[16-a-1]=parseInt(r.substr(a*2,2),16);for(let a=0;a<32;a++)i[a]=i[a]^n[a%16];return i}function Tr(i,e){return{type:z.BookmarkStart,id:e.attr(i,"id"),name:e.attr(i,"name"),colFirst:e.intAttr(i,"colFirst"),colLast:e.intAttr(i,"colLast")}}function Ir(i,e){return{type:z.BookmarkEnd,id:e.attr(i,"id")}}class Or extends zt{constructor(){super(...arguments),this.type=z.VmlElement,this.attrs={}}}function we(i,e){var t=new Or;switch(i.localName){case"rect":t.tagName="rect",Object.assign(t.attrs,{width:"100%",height:"100%"});break;case"oval":t.tagName="ellipse",Object.assign(t.attrs,{cx:"50%",cy:"50%",rx:"50%",ry:"50%"});break;case"line":t.tagName="line";break;case"shape":t.tagName="g";break;case"textbox":t.tagName="foreignObject",Object.assign(t.attrs,{width:"100%",height:"100%"});break;default:return null}for(const r of P.attrs(i))switch(r.localName){case"style":t.cssStyleText=r.value;break;case"fillcolor":t.attrs.fill=r.value;break;case"from":const[n,a]=Se(r.value);Object.assign(t.attrs,{x1:n,y1:a});break;case"to":const[l,o]=Se(r.value);Object.assign(t.attrs,{x2:l,y2:o});break}for(const r of P.elements(i))switch(r.localName){case"stroke":Object.assign(t.attrs,Fr(r));break;case"fill":Object.assign(t.attrs,Dr());break;case"imagedata":t.tagName="image",Object.assign(t.attrs,{width:"100%",height:"100%"}),t.imageHref={id:P.attr(r,"id"),title:P.attr(r,"title")};break;case"txbxContent":t.children.push(...e.parseBodyElements(r));break;default:const n=we(r,e);n&&t.children.push(n);break}return t}function Fr(i){var e;return{stroke:P.attr(i,"color"),"stroke-width":(e=P.lengthAttr(i,"weight",pt.Emu))!=null?e:"1px"}}function Dr(i){return{}}function Se(i){return i.split(",")}class Lr extends zt{constructor(){super(...arguments),this.type=z.Comment}}class jr extends zt{constructor(e){super(),this.id=e,this.type=z.CommentReference}}class Ur extends zt{constructor(e){super(),this.id=e,this.type=z.CommentRangeStart}}class $r extends zt{constructor(e){super(),this.id=e,this.type=z.CommentRangeEnd}}var Gt={shd:"inherit",color:"black",borderColor:"black",highlight:"transparent"};const Wr=[],Ce={oMath:z.MmlMath,oMathPara:z.MmlMathParagraph,f:z.MmlFraction,func:z.MmlFunction,fName:z.MmlFunctionName,num:z.MmlNumerator,den:z.MmlDenominator,rad:z.MmlRadical,deg:z.MmlDegree,e:z.MmlBase,sSup:z.MmlSuperscript,sSub:z.MmlSubscript,sPre:z.MmlPreSubSuper,sup:z.MmlSuperArgument,sub:z.MmlSubArgument,d:z.MmlDelimiter,nary:z.MmlNary,eqArr:z.MmlEquationArray,lim:z.MmlLimit,limLow:z.MmlLimitLower,m:z.MmlMatrix,mr:z.MmlMatrixRow,box:z.MmlBox,bar:z.MmlBar,groupChr:z.MmlGroupChar};class Hr{constructor(e){this.options=_t({ignoreWidth:!1,debug:!1},e)}parseNotes(e,t,r){var n=[];for(let a of P.elements(e,t)){const l=new r;l.id=P.attr(a,"id"),l.noteType=P.attr(a,"type"),l.children=this.parseBodyElements(a),n.push(l)}return n}parseComments(e){var t=[];for(let r of P.elements(e,"comment")){const n=new Lr;n.id=P.attr(r,"id"),n.author=P.attr(r,"author"),n.initials=P.attr(r,"initials"),n.date=P.attr(r,"date"),n.children=this.parseBodyElements(r),t.push(n)}return t}parseDocumentFile(e){var t=P.element(e,"body"),r=P.element(e,"background"),n=P.element(t,"sectPr");return{type:z.Document,children:this.parseBodyElements(t),props:n?de(n,P):{},cssStyle:r?this.parseBackground(r):{}}}parseBackground(e){var t={},r=ut.colorAttr(e,"color");return r&&(t["background-color"]=r),t}parseBodyElements(e){var t=[];for(let r of P.elements(e))switch(r.localName){case"p":t.push(this.parseParagraph(r));break;case"tbl":t.push(this.parseTable(r));break;case"sdt":t.push(...this.parseSdt(r,n=>this.parseBodyElements(n)));break}return t}parseStylesFile(e){var t=[];return ut.foreach(e,r=>{switch(r.localName){case"style":t.push(this.parseStyle(r));break;case"docDefaults":t.push(this.parseDefaultStyles(r));break}}),t}parseDefaultStyles(e){var t={id:null,name:null,target:null,basedOn:null,styles:[]};return ut.foreach(e,r=>{switch(r.localName){case"rPrDefault":var n=P.element(r,"rPr");n&&t.styles.push({target:"span",values:this.parseDefaultProperties(n,{})});break;case"pPrDefault":var a=P.element(r,"pPr");a&&t.styles.push({target:"p",values:this.parseDefaultProperties(a,{})});break}}),t}parseStyle(e){var t={id:P.attr(e,"styleId"),isDefault:P.boolAttr(e,"default"),name:null,target:null,basedOn:null,styles:[],linked:null};switch(P.attr(e,"type")){case"paragraph":t.target="p";break;case"table":t.target="table";break;case"character":t.target="span";break}return ut.foreach(e,r=>{switch(r.localName){case"basedOn":t.basedOn=P.attr(r,"val");break;case"name":t.name=P.attr(r,"val");break;case"link":t.linked=P.attr(r,"val");break;case"next":t.next=P.attr(r,"val");break;case"aliases":t.aliases=P.attr(r,"val").split(",");break;case"pPr":t.styles.push({target:"p",values:this.parseDefaultProperties(r,{})}),t.paragraphProps=pe(r,P);break;case"rPr":t.styles.push({target:"span",values:this.parseDefaultProperties(r,{})}),t.runProps=ne(r,P);break;case"tblPr":case"tcPr":t.styles.push({target:"td",values:this.parseDefaultProperties(r,{})});break;case"tblStylePr":for(let n of this.parseTableStyle(r))t.styles.push(n);break;case"rsid":case"qFormat":case"hidden":case"semiHidden":case"unhideWhenUsed":case"autoRedefine":case"uiPriority":break;default:this.options.debug&&console.warn(`DOCX: Unknown style element: ${r.localName}`)}}),t}parseTableStyle(e){var t=[],r=P.attr(e,"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[]}return ut.foreach(e,l=>{switch(l.localName){case"pPr":t.push({target:`${n} p`,mod:a,values:this.parseDefaultProperties(l,{})});break;case"rPr":t.push({target:`${n} span`,mod:a,values:this.parseDefaultProperties(l,{})});break;case"tblPr":case"tcPr":t.push({target:n,mod:a,values:this.parseDefaultProperties(l,{})});break}}),t}parseNumberingFile(e){var t=[],r={},n=[];return ut.foreach(e,a=>{switch(a.localName){case"abstractNum":this.parseAbstractNumbering(a,n).forEach(u=>t.push(u));break;case"numPicBullet":n.push(this.parseNumberingPicBullet(a));break;case"num":var l=P.attr(a,"numId"),o=P.elementAttr(a,"abstractNumId","val");r[o]=l;break}}),t.forEach(a=>a.id=r[a.id]),t}parseNumberingPicBullet(e){var t=P.element(e,"pict"),r=t&&P.element(t,"shape"),n=r&&P.element(r,"imagedata");return n?{id:P.intAttr(e,"numPicBulletId"),src:P.attr(n,"id"),style:P.attr(r,"style")}:null}parseAbstractNumbering(e,t){var r=[],n=P.attr(e,"abstractNumId");return ut.foreach(e,a=>{switch(a.localName){case"lvl":r.push(this.parseNumberingLevel(n,a,t));break}}),r}parseNumberingLevel(e,t,r){var n={id:e,level:P.intAttr(t,"ilvl"),start:1,pStyleName:void 0,pStyle:{},rStyle:{},suff:"tab"};return ut.foreach(t,a=>{switch(a.localName){case"start":n.start=P.intAttr(a,"val");break;case"pPr":this.parseDefaultProperties(a,n.pStyle);break;case"rPr":this.parseDefaultProperties(a,n.rStyle);break;case"lvlPicBulletId":var l=P.intAttr(a,"val");n.bullet=r.find(o=>(o==null?void 0:o.id)==l);break;case"lvlText":n.levelText=P.attr(a,"val");break;case"pStyle":n.pStyleName=P.attr(a,"val");break;case"numFmt":n.format=P.attr(a,"val");break;case"suff":n.suff=P.attr(a,"val");break}}),n}parseSdt(e,t){const r=P.element(e,"sdtContent");return r?t(r):[]}parseInserted(e,t){var r,n;return{type:z.Inserted,children:(n=(r=t(e))==null?void 0:r.children)!=null?n:[]}}parseDeleted(e,t){var r,n;return{type:z.Deleted,children:(n=(r=t(e))==null?void 0:r.children)!=null?n:[]}}parseParagraph(e){var t={type:z.Paragraph,children:[]};for(let r of P.elements(e))switch(r.localName){case"pPr":this.parseParagraphProperties(r,t);break;case"r":t.children.push(this.parseRun(r,t));break;case"hyperlink":t.children.push(this.parseHyperlink(r,t));break;case"smartTag":t.children.push(this.parseSmartTag(r,t));break;case"bookmarkStart":t.children.push(Tr(r,P));break;case"bookmarkEnd":t.children.push(Ir(r,P));break;case"commentRangeStart":t.children.push(new Ur(P.attr(r,"id")));break;case"commentRangeEnd":t.children.push(new $r(P.attr(r,"id")));break;case"oMath":case"oMathPara":t.children.push(this.parseMathElement(r));break;case"sdt":t.children.push(...this.parseSdt(r,n=>this.parseParagraph(n).children));break;case"ins":t.children.push(this.parseInserted(r,n=>this.parseParagraph(n)));break;case"del":t.children.push(this.parseDeleted(r,n=>this.parseParagraph(n)));break}return t}parseParagraphProperties(e,t){this.parseDefaultProperties(e,t.cssStyle={},null,r=>{if(me(r,t,P))return!0;switch(r.localName){case"pStyle":t.styleName=P.attr(r,"val");break;case"cnfStyle":t.className=ct.classNameOfCnfStyle(r);break;case"framePr":this.parseFrame(r,t);break;case"rPr":break;default:return!1}return!0})}parseFrame(e,t){var r=P.attr(e,"dropCap");r=="drop"&&(t.cssStyle.float="left")}parseHyperlink(e,t){var r={type:z.Hyperlink,parent:t,children:[]},n=P.attr(e,"anchor"),a=P.attr(e,"id");return n&&(r.href="#"+n),a&&(r.id=a),ut.foreach(e,l=>{switch(l.localName){case"r":r.children.push(this.parseRun(l,r));break}}),r}parseSmartTag(e,t){var r={type:z.SmartTag,parent:t,children:[]},n=P.attr(e,"uri"),a=P.attr(e,"element");return n&&(r.uri=n),a&&(r.element=a),ut.foreach(e,l=>{switch(l.localName){case"r":r.children.push(this.parseRun(l,r));break}}),r}parseRun(e,t){var r={type:z.Run,parent:t,children:[]};return ut.foreach(e,n=>{switch(n=this.checkAlternateContent(n),n.localName){case"t":r.children.push({type:z.Text,text:n.textContent});break;case"delText":r.children.push({type:z.DeletedText,text:n.textContent});break;case"commentReference":r.children.push(new jr(P.attr(n,"id")));break;case"fldSimple":r.children.push({type:z.SimpleField,instruction:P.attr(n,"instr"),lock:P.boolAttr(n,"lock",!1),dirty:P.boolAttr(n,"dirty",!1)});break;case"instrText":r.fieldRun=!0,r.children.push({type:z.Instruction,text:n.textContent});break;case"fldChar":r.fieldRun=!0,r.children.push({type:z.ComplexField,charType:P.attr(n,"fldCharType"),lock:P.boolAttr(n,"lock",!1),dirty:P.boolAttr(n,"dirty",!1)});break;case"noBreakHyphen":r.children.push({type:z.NoBreakHyphen});break;case"br":r.children.push({type:z.Break,break:P.attr(n,"type")||"textWrapping"});break;case"lastRenderedPageBreak":r.children.push({type:z.Break,break:"lastRenderedPageBreak"});break;case"sym":r.children.push({type:z.Symbol,font:P.attr(n,"font"),char:P.attr(n,"char")});break;case"tab":r.children.push({type:z.Tab});break;case"footnoteReference":r.children.push({type:z.FootnoteReference,id:P.attr(n,"id")});break;case"endnoteReference":r.children.push({type:z.EndnoteReference,id:P.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}}),r}parseMathElement(e){const t=`${e.localName}Pr`,r={type:Ce[e.localName],children:[]};for(const a of P.elements(e))if(Ce[a.localName])r.children.push(this.parseMathElement(a));else if(a.localName=="r"){var n=this.parseRun(a);n.type=z.MmlRun,r.children.push(n)}else a.localName==t&&(r.props=this.parseMathProperies(a));return r}parseMathProperies(e){const t={};for(const r of P.elements(e))switch(r.localName){case"chr":t.char=P.attr(r,"val");break;case"vertJc":t.verticalJustification=P.attr(r,"val");break;case"pos":t.position=P.attr(r,"val");break;case"degHide":t.hideDegree=P.boolAttr(r,"val");break;case"begChr":t.beginChar=P.attr(r,"val");break;case"endChr":t.endChar=P.attr(r,"val");break}return t}parseRunProperties(e,t){this.parseDefaultProperties(e,t.cssStyle={},null,r=>{switch(r.localName){case"rStyle":t.styleName=P.attr(r,"val");break;case"vertAlign":t.verticalAlign=ct.valueOfVertAlign(r,!0);break;default:return!1}return!0})}parseVmlPicture(e){const t={type:z.VmlPicture,children:[]};for(const r of P.elements(e)){const n=we(r,this);n&&t.children.push(n)}return t}checkAlternateContent(e){var a;if(e.localName!="AlternateContent")return e;var t=P.element(e,"Choice");if(t){var r=P.attr(t,"Requires"),n=e.lookupNamespaceURI(r);if(Wr.includes(n))return t.firstElementChild}return(a=P.element(e,"Fallback"))==null?void 0:a.firstElementChild}parseDrawing(e){for(var t of P.elements(e))switch(t.localName){case"inline":case"anchor":return this.parseDrawingWrapper(t)}}parseDrawingWrapper(e){var w;var t={type:z.Drawing,children:[],cssStyle:{}},r=e.localName=="anchor";let n=null,a=P.boolAttr(e,"simplePos");P.boolAttr(e,"behindDoc");let l={relative:"page",align:"left",offset:"0"},o={relative:"page",align:"top",offset:"0"};for(var u of P.elements(e))switch(u.localName){case"simplePos":a&&(l.offset=P.lengthAttr(u,"x",pt.Emu),o.offset=P.lengthAttr(u,"y",pt.Emu));break;case"extent":t.cssStyle.width=P.lengthAttr(u,"cx",pt.Emu),t.cssStyle.height=P.lengthAttr(u,"cy",pt.Emu);break;case"positionH":case"positionV":if(!a){let d=u.localName=="positionH"?l:o;var b=P.element(u,"align"),y=P.element(u,"posOffset");d.relative=(w=P.attr(u,"relativeFrom"))!=null?w:d.relative,b&&(d.align=b.textContent),y&&(d.offset=ut.sizeValue(y,pt.Emu))}break;case"wrapTopAndBottom":n="wrapTopAndBottom";break;case"wrapNone":n="wrapNone";break;case"graphic":var _=this.parseGraphic(u);_&&t.children.push(_);break}return n=="wrapTopAndBottom"?(t.cssStyle.display="block",l.align&&(t.cssStyle["text-align"]=l.align,t.cssStyle.width="100%")):n=="wrapNone"?(t.cssStyle.display="block",t.cssStyle.position="relative",t.cssStyle.width="0px",t.cssStyle.height="0px",l.offset&&(t.cssStyle.left=l.offset),o.offset&&(t.cssStyle.top=o.offset)):r&&(l.align=="left"||l.align=="right")&&(t.cssStyle.float=l.align),t}parseGraphic(e){var t=P.element(e,"graphicData");for(let r of P.elements(t))switch(r.localName){case"pic":return this.parsePicture(r)}return null}parsePicture(e){var t={type:z.Image,src:"",cssStyle:{}},r=P.element(e,"blipFill"),n=P.element(r,"blip");t.src=P.attr(n,"embed");var a=P.element(e,"spPr"),l=P.element(a,"xfrm");t.cssStyle.position="relative";for(var o of P.elements(l))switch(o.localName){case"ext":t.cssStyle.width=P.lengthAttr(o,"cx",pt.Emu),t.cssStyle.height=P.lengthAttr(o,"cy",pt.Emu);break;case"off":t.cssStyle.left=P.lengthAttr(o,"x",pt.Emu),t.cssStyle.top=P.lengthAttr(o,"y",pt.Emu);break}return t}parseTable(e){var t={type:z.Table,children:[]};return ut.foreach(e,r=>{switch(r.localName){case"tr":t.children.push(this.parseTableRow(r));break;case"tblGrid":t.columns=this.parseTableColumns(r);break;case"tblPr":this.parseTableProperties(r,t);break}}),t}parseTableColumns(e){var t=[];return ut.foreach(e,r=>{switch(r.localName){case"gridCol":t.push({width:P.lengthAttr(r,"w")});break}}),t}parseTableProperties(e,t){switch(t.cssStyle={},t.cellStyle={},this.parseDefaultProperties(e,t.cssStyle,t.cellStyle,r=>{switch(r.localName){case"tblStyle":t.styleName=P.attr(r,"val");break;case"tblLook":t.className=ct.classNameOftblLook(r);break;case"tblpPr":this.parseTablePosition(r,t);break;case"tblStyleColBandSize":t.colBandSize=P.intAttr(r,"val");break;case"tblStyleRowBandSize":t.rowBandSize=P.intAttr(r,"val");break;default:return!1}return!0}),t.cssStyle["text-align"]){case"center":delete t.cssStyle["text-align"],t.cssStyle["margin-left"]="auto",t.cssStyle["margin-right"]="auto";break;case"right":delete t.cssStyle["text-align"],t.cssStyle["margin-left"]="auto";break}}parseTablePosition(e,t){var r=P.lengthAttr(e,"topFromText"),n=P.lengthAttr(e,"bottomFromText"),a=P.lengthAttr(e,"rightFromText"),l=P.lengthAttr(e,"leftFromText");t.cssStyle.float="left",t.cssStyle["margin-bottom"]=ct.addSize(t.cssStyle["margin-bottom"],n),t.cssStyle["margin-left"]=ct.addSize(t.cssStyle["margin-left"],l),t.cssStyle["margin-right"]=ct.addSize(t.cssStyle["margin-right"],a),t.cssStyle["margin-top"]=ct.addSize(t.cssStyle["margin-top"],r)}parseTableRow(e){var t={type:z.Row,children:[]};return ut.foreach(e,r=>{switch(r.localName){case"tc":t.children.push(this.parseTableCell(r));break;case"trPr":this.parseTableRowProperties(r,t);break}}),t}parseTableRowProperties(e,t){t.cssStyle=this.parseDefaultProperties(e,{},null,r=>{switch(r.localName){case"cnfStyle":t.className=ct.classNameOfCnfStyle(r);break;case"tblHeader":t.isHeader=P.boolAttr(r,"val");break;default:return!1}return!0})}parseTableCell(e){var t={type:z.Cell,children:[]};return ut.foreach(e,r=>{switch(r.localName){case"tbl":t.children.push(this.parseTable(r));break;case"p":t.children.push(this.parseParagraph(r));break;case"tcPr":this.parseTableCellProperties(r,t);break}}),t}parseTableCellProperties(e,t){t.cssStyle=this.parseDefaultProperties(e,{},null,r=>{var n;switch(r.localName){case"gridSpan":t.span=P.intAttr(r,"val",null);break;case"vMerge":t.verticalMerge=(n=P.attr(r,"val"))!=null?n:"continue";break;case"cnfStyle":t.className=ct.classNameOfCnfStyle(r);break;default:return!1}return!0})}parseDefaultProperties(e,t=null,r=null,n=null){return t=t||{},ut.foreach(e,a=>{if(!(n!=null&&n(a)))switch(a.localName){case"jc":t["text-align"]=ct.valueOfJc(a);break;case"textAlignment":t["vertical-align"]=ct.valueOfTextAlignment(a);break;case"color":t.color=ut.colorAttr(a,"val",null,Gt.color);break;case"sz":t["font-size"]=t["min-height"]=P.lengthAttr(a,"val",pt.FontSize);break;case"shd":t["background-color"]=ut.colorAttr(a,"fill",null,Gt.shd);break;case"highlight":t["background-color"]=ut.colorAttr(a,"val",null,Gt.highlight);break;case"vertAlign":break;case"position":t.verticalAlign=P.lengthAttr(a,"val",pt.FontSize);break;case"tcW":if(this.options.ignoreWidth)break;case"tblW":t.width=ct.valueOfSize(a,"w");break;case"trHeight":this.parseTrHeight(a,t);break;case"strike":t["text-decoration"]=P.boolAttr(a,"val",!0)?"line-through":"none";break;case"b":t["font-weight"]=P.boolAttr(a,"val",!0)?"bold":"normal";break;case"i":t["font-style"]=P.boolAttr(a,"val",!0)?"italic":"normal";break;case"caps":t["text-transform"]=P.boolAttr(a,"val",!0)?"uppercase":"none";break;case"smallCaps":t["font-variant"]=P.boolAttr(a,"val",!0)?"small-caps":"none";break;case"u":this.parseUnderline(a,t);break;case"ind":case"tblInd":this.parseIndentation(a,t);break;case"rFonts":this.parseFont(a,t);break;case"tblBorders":this.parseBorderProperties(a,r||t);break;case"tblCellSpacing":t["border-spacing"]=ct.valueOfMargin(a),t["border-collapse"]="separate";break;case"pBdr":this.parseBorderProperties(a,t);break;case"bdr":t.border=ct.valueOfBorder(a);break;case"tcBorders":this.parseBorderProperties(a,t);break;case"vanish":P.boolAttr(a,"val",!0)&&(t.display="none");break;case"kern":break;case"noWrap":break;case"tblCellMar":case"tcMar":this.parseMarginProperties(a,r||t);break;case"tblLayout":t["table-layout"]=ct.valueOfTblLayout(a);break;case"vAlign":t["vertical-align"]=ct.valueOfTextAlignment(a);break;case"spacing":e.localName=="pPr"&&this.parseSpacing(a,t);break;case"wordWrap":P.boolAttr(a,"val")&&(t["overflow-wrap"]="break-word");break;case"suppressAutoHyphens":t.hyphens=P.boolAttr(a,"val",!0)?"none":"auto";break;case"lang":t.$lang=P.attr(a,"val");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: ${e.localName}.${a.localName}`);break}}),t}parseUnderline(e,t){var r=P.attr(e,"val");if(r!=null){switch(r){case"dash":case"dashDotDotHeavy":case"dashDotHeavy":case"dashedHeavy":case"dashLong":case"dashLongHeavy":case"dotDash":case"dotDotDash":t["text-decoration"]="underline dashed";break;case"dotted":case"dottedHeavy":t["text-decoration"]="underline dotted";break;case"double":t["text-decoration"]="underline double";break;case"single":case"thick":t["text-decoration"]="underline";break;case"wave":case"wavyDouble":case"wavyHeavy":t["text-decoration"]="underline wavy";break;case"words":t["text-decoration"]="underline";break;case"none":t["text-decoration"]="none";break}var n=ut.colorAttr(e,"color");n&&(t["text-decoration-color"]=n)}}parseFont(e,t){var r=P.attr(e,"ascii"),n=ct.themeValue(e,"asciiTheme"),a=[r,n].filter(l=>l).join(", ");a.length>0&&(t["font-family"]=a)}parseIndentation(e,t){var r=P.lengthAttr(e,"firstLine"),n=P.lengthAttr(e,"hanging"),a=P.lengthAttr(e,"left"),l=P.lengthAttr(e,"start"),o=P.lengthAttr(e,"right"),u=P.lengthAttr(e,"end");r&&(t["text-indent"]=r),n&&(t["text-indent"]=`-${n}`),(a||l)&&(t["margin-left"]=a||l),(o||u)&&(t["margin-right"]=o||u)}parseSpacing(e,t){var r=P.lengthAttr(e,"before"),n=P.lengthAttr(e,"after"),a=P.intAttr(e,"line",null),l=P.attr(e,"lineRule");if(r&&(t["margin-top"]=r),n&&(t["margin-bottom"]=n),a!==null)switch(l){case"auto":t["line-height"]=`${(a/240).toFixed(2)}`;break;case"atLeast":t["line-height"]=`calc(100% + ${a/20}pt)`;break;default:t["line-height"]=t["min-height"]=`${a/20}pt`;break}}parseMarginProperties(e,t){ut.foreach(e,r=>{switch(r.localName){case"left":t["padding-left"]=ct.valueOfMargin(r);break;case"right":t["padding-right"]=ct.valueOfMargin(r);break;case"top":t["padding-top"]=ct.valueOfMargin(r);break;case"bottom":t["padding-bottom"]=ct.valueOfMargin(r);break}})}parseTrHeight(e,t){switch(P.attr(e,"hRule")){case"exact":t.height=P.lengthAttr(e,"val");break;case"atLeast":default:t.height=P.lengthAttr(e,"val");break}}parseBorderProperties(e,t){ut.foreach(e,r=>{switch(r.localName){case"start":case"left":t["border-left"]=ct.valueOfBorder(r);break;case"end":case"right":t["border-right"]=ct.valueOfBorder(r);break;case"top":t["border-top"]=ct.valueOfBorder(r);break;case"bottom":t["border-bottom"]=ct.valueOfBorder(r);break}})}}const Zr=["black","blue","cyan","darkBlue","darkCyan","darkGray","darkGreen","darkMagenta","darkRed","darkYellow","green","lightGray","magenta","none","red","white","yellow"];class ut{static foreach(e,t){for(var r=0;rt[a]=="1").join(" ")}static valueOfJc(e){var t=P.attr(e,"val");switch(t){case"start":case"left":return"left";case"center":return"center";case"end":case"right":return"right";case"both":return"justify"}return t}static valueOfVertAlign(e,t=!1){var r=P.attr(e,"val");switch(r){case"subscript":return"sub";case"superscript":return t?"sup":"super"}return t?null:r}static valueOfTextAlignment(e){var t=P.attr(e,"val");switch(t){case"auto":case"baseline":return"baseline";case"top":return"top";case"center":return"middle";case"bottom":return"bottom"}return t}static addSize(e,t){return e==null?t:t==null?e:`calc(${e} + ${t})`}static classNameOftblLook(e){const t=P.hexAttr(e,"val",0);let r="";return(P.boolAttr(e,"firstRow")||t&32)&&(r+=" first-row"),(P.boolAttr(e,"lastRow")||t&64)&&(r+=" last-row"),(P.boolAttr(e,"firstColumn")||t&128)&&(r+=" first-col"),(P.boolAttr(e,"lastColumn")||t&256)&&(r+=" last-col"),(P.boolAttr(e,"noHBand")||t&512)&&(r+=" no-hband"),(P.boolAttr(e,"noVBand")||t&1024)&&(r+=" no-vband"),r.trim()}}const xe={pos:0,leader:"none",style:"left"},Vr=50;function Xr(i=document.body){const e=document.createElement("div");e.style.width="100pt",i.appendChild(e);const t=100/e.offsetWidth;return i.removeChild(e),t}function Gr(i,e,t,r=72/96){const n=i.closest("p"),a=i.getBoundingClientRect(),l=n.getBoundingClientRect(),o=getComputedStyle(n),u=(e==null?void 0:e.length)>0?e.map(v=>({pos:Pe(v.position),leader:v.leader,style:v.style})).sort((v,C)=>v.pos-C.pos):[xe],b=u[u.length-1],y=l.width*r,_=Pe(t);let w=b.pos+_;if(wv.style!="clear"&&v.pos>h);if(m==null)return;let f=1;if(m.style=="right"||m.style=="center"){const v=Array.from(n.querySelectorAll(`.${i.className}`)),C=v.indexOf(i)+1,A=document.createRange();A.setStart(i,1),Co.id)),e.endnotesPart&&(this.endnoteMap=Nt(e.endnotesPart.notes,o=>o.id)),e.settingsPart&&(this.defaultTabSize=(l=e.settingsPart.settings)==null?void 0:l.defaultTabStop),!n.ignoreFonts&&e.fontTablePart&&this.renderFontTable(e.fontTablePart,r);var a=this.renderSections(e.documentPart.body);this.options.inWrapper?t.appendChild(this.renderWrapper(a)):se(t,a),this.commentHighlight&&n.renderComments&&CSS.highlights.set(`${this.className}-comments`,this.commentHighlight),this.refreshTabStops(),this.postRenderTasks.forEach(o=>o())}renderTheme(e,t){var o,u;const r={},n=(o=e.theme)==null?void 0:o.fontScheme;n&&(n.majorFont&&(r["--docx-majorHAnsi-font"]=n.majorFont.latinTypeface),n.minorFont&&(r["--docx-minorHAnsi-font"]=n.minorFont.latinTypeface));const a=(u=e.theme)==null?void 0:u.colorScheme;if(a)for(let[b,y]of Object.entries(a.colors))r[`--docx-${b}-color`]=`#${y}`;const l=this.styleToString(`.${this.className}`,r);t.appendChild(Mt(l))}renderFontTable(e,t){for(let r of e.fonts)for(let n of r.embedFontRefs)this.tasks.push(this.document.loadFont(n.id,n.key).then(a=>{const l={"font-family":r.name,src:`url(${a})`};(n.type=="bold"||n.type=="boldItalic")&&(l["font-weight"]="bold"),(n.type=="italic"||n.type=="boldItalic")&&(l["font-style"]="italic"),Lt(t,`docxjs ${r.name} font`);const o=this.styleToString("@font-face",l);t.appendChild(Mt(o)),this.refreshTabStops()}))}processStyleName(e){return e?`${this.className}_${He(e)}`:this.className}processStyles(e){const t=Nt(e.filter(n=>n.id!=null),n=>n.id);for(const n of e.filter(a=>a.basedOn)){var r=t[n.basedOn];if(r){n.paragraphProps=Vt(n.paragraphProps,r.paragraphProps),n.runProps=Vt(n.runProps,r.runProps);for(const a of r.styles){const l=n.styles.find(o=>o.target==a.target);l?this.copyStyleProperties(a.values,l.values):n.styles.push(Wt(_t({},a),{values:_t({},a.values)}))}}else this.options.debug&&console.warn(`Can't find base style ${n.basedOn}`)}for(let n of e)n.cssName=this.processStyleName(n.id);return t}prodessNumberings(e){var t;for(let r of e.filter(n=>n.pStyleName)){const n=this.findStyle(r.pStyleName);(t=n==null?void 0:n.paragraphProps)!=null&&t.numbering&&(n.paragraphProps.numbering.level=r.level)}}processElement(e){if(e.children)for(var t of e.children)t.parent=e,t.type==z.Table?this.processTable(t):this.processElement(t)}processTable(e){for(var t of e.children)for(var r of t.children)r.cssStyle=this.copyStyleProperties(e.cellStyle,r.cssStyle,["border-left","border-right","border-top","border-bottom","padding-left","padding-right","padding-top","padding-bottom"]),this.processElement(r)}copyStyleProperties(e,t,r=null){if(!e)return t;t==null&&(t={}),r==null&&(r=Object.getOwnPropertyNames(e));for(var n of r)e.hasOwnProperty(n)&&!t.hasOwnProperty(n)&&(t[n]=e[n]);return t}createPageElement(e,t){var r=this.createElement("section",{className:e});return t&&(t.pageMargins&&(r.style.paddingLeft=t.pageMargins.left,r.style.paddingRight=t.pageMargins.right,r.style.paddingTop=t.pageMargins.top,r.style.paddingBottom=t.pageMargins.bottom),t.pageSize&&(this.options.ignoreWidth||(r.style.width=t.pageSize.width),this.options.ignoreHeight||(r.style.minHeight=t.pageSize.height))),r}createSectionContent(e){var t=this.createElement("article");return e.columns&&e.columns.numberOfColumns&&(t.style.columnCount=`${e.columns.numberOfColumns}`,t.style.columnGap=e.columns.space,e.columns.separator&&(t.style.columnRule="1px solid black")),t}renderSections(e){const t=[];this.processElement(e);const r=this.splitBySection(e.children,e.props),n=this.groupByPageBreaks(r);let a=null;for(let o=0,u=n.length;oy.type=="first"):null)!=null?u:r%2==1?e.find(y=>y.type=="even"):null)!=null?b:e.find(y=>y.type=="default"),o=l&&this.document.findPartByRelId(l.id,this.document.documentPart);if(o){this.currentPart=o,this.usedHederFooterParts.includes(o.path)||(this.processElement(o.rootElement),this.usedHederFooterParts.push(o.path));const[y]=this.renderElements([o.rootElement],a);t!=null&&t.pageMargins&&(o.rootElement.type===z.Header?(y.style.marginTop=`calc(${t.pageMargins.header} - ${t.pageMargins.top})`,y.style.minHeight=`calc(${t.pageMargins.top} - ${t.pageMargins.header})`):o.rootElement.type===z.Footer&&(y.style.marginBottom=`calc(${t.pageMargins.footer} - ${t.pageMargins.bottom})`,y.style.minHeight=`calc(${t.pageMargins.bottom} - ${t.pageMargins.footer})`)),this.currentPart=null}}}isPageBreakElement(e){return e.type!=z.Break?!1:e.break=="lastRenderedPageBreak"?!this.options.ignoreLastRenderedPageBreak:e.break=="page"}isPageBreakSection(e,t){var r,n,a,l,o,u;return!e||!t?!1:((r=e.pageSize)==null?void 0:r.orientation)!=((n=t.pageSize)==null?void 0:n.orientation)||((a=e.pageSize)==null?void 0:a.width)!=((l=t.pageSize)==null?void 0:l.width)||((o=e.pageSize)==null?void 0:o.height)!=((u=t.pageSize)==null?void 0:u.height)}splitBySection(e,t){var _;var r={sectProps:null,elements:[],pageBreak:!1},n=[r];for(let w of e){if(w.type==z.Paragraph){const d=this.findStyle(w.styleName);(_=d==null?void 0:d.paragraphProps)!=null&&_.pageBreakBefore&&(r.sectProps=a,r.pageBreak=!0,r={sectProps:null,elements:[],pageBreak:!1},n.push(r))}if(r.elements.push(w),w.type==z.Paragraph){const d=w;var a=d.sectionProps,l=-1,o=-1;if(this.options.breakPages&&d.children&&(l=d.children.findIndex(k=>{var h,m;return o=(m=(h=k.children)==null?void 0:h.findIndex(this.isPageBreakElement.bind(this)))!=null?m:-1,o!=-1})),(a||l!=-1)&&(r.sectProps=a,r.pageBreak=l!=-1,r={sectProps:null,elements:[],pageBreak:!1},n.push(r)),l!=-1){let k=d.children[l],h=o=0;w--)n[w].sectProps==null?n[w].sectProps=y!=null?y:t:y=n[w].sectProps;return n}groupByPageBreaks(e){let t=[],r;const n=[t];for(let a of e)t.push(a),(this.options.ignoreLastRenderedPageBreak||a.pageBreak||this.isPageBreakSection(r,a.sectProps))&&n.push(t=[]),r=a.sectProps;return n.filter(a=>a.length>0)}renderWrapper(e){return this.createElement("div",{className:`${this.className}-wrapper`},e)}renderDefaultStyle(){var e=this.className,t=` +.${e}-wrapper { background: gray; padding: 30px; padding-bottom: 0px; display: flex; flex-flow: column; align-items: center; } +.${e}-wrapper>section.${e} { background: white; box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); margin-bottom: 30px; } +.${e} { color: black; hyphens: auto; text-underline-position: from-font; } +section.${e} { box-sizing: border-box; display: flex; flex-flow: column nowrap; position: relative; overflow: hidden; } +section.${e}>article { margin-bottom: auto; z-index: 1; } +section.${e}>footer { z-index: 1; } +.${e} table { border-collapse: collapse; } +.${e} table td, .${e} table th { vertical-align: top; } +.${e} p { margin: 0pt; min-height: 1em; } +.${e} span { white-space: pre-wrap; overflow-wrap: break-word; } +.${e} a { color: inherit; text-decoration: inherit; } +.${e} svg { fill: transparent; } +`;return this.options.renderComments&&(t+=` +.${e}-comment-ref { cursor: default; } +.${e}-comment-popover { display: none; z-index: 1000; padding: 0.5rem; background: white; position: absolute; box-shadow: 0 0 0.25rem rgba(0, 0, 0, 0.25); width: 30ch; } +.${e}-comment-ref:hover~.${e}-comment-popover { display: block; } +.${e}-comment-author,.${e}-comment-date { font-size: 0.875rem; color: #888; } +`),Mt(t)}renderNumbering(e,t){var r="",n=[];for(var a of e){var l=`p.${this.numberingClass(a.id,a.level)}`,o="none";if(a.bullet){let u=`--${this.className}-${a.bullet.src}`.toLowerCase();r+=this.styleToString(`${l}:before`,{content:"' '",display:"inline-block",background:`var(${u})`},a.bullet.style),this.tasks.push(this.document.loadNumberingImage(a.bullet.src).then(b=>{var y=`${this.rootSelector} { ${u}: url(${b}) }`;t.appendChild(Mt(y))}))}else if(a.levelText){let u=this.numberingCounter(a.id,a.level);const b=u+" "+(a.start-1);a.level>0&&(r+=this.styleToString(`p.${this.numberingClass(a.id,a.level-1)}`,{"counter-reset":b})),n.push(b),r+=this.styleToString(`${l}:before`,_t({content:this.levelTextToContent(a.levelText,a.suff,a.id,this.numFormatToCssValue(a.format)),"counter-increment":u},a.rStyle))}else o=this.numFormatToCssValue(a.format);r+=this.styleToString(l,_t({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(" ")})),Mt(r)}renderStyles(e){var u;var t="";const r=this.styleMap,n=Nt(e.filter(b=>b.isDefault),b=>b.target);for(const b of e){var a=b.styles;if(b.linked){var l=b.linked&&r[b.linked];l?a=a.concat(l.styles):this.options.debug&&console.warn(`Can't find linked style ${b.linked}`)}for(const y of a){var o=`${(u=b.target)!=null?u:""}.${b.cssName}`;b.target!=y.target&&(o+=` ${y.target}`),n[b.target]==b&&(o=`.${this.className} ${b.target}, `+o),t+=this.styleToString(o,y.values)}}return Mt(t)}renderNotes(e,t,r){var n=e.map(l=>t[l]).filter(l=>l);if(n.length>0){var a=this.createElement("ol",null,this.renderElements(n));r.appendChild(a)}}renderElement(e){switch(e.type){case z.Paragraph:return this.renderParagraph(e);case z.BookmarkStart:return this.renderBookmarkStart(e);case z.BookmarkEnd:return null;case z.Run:return this.renderRun(e);case z.Table:return this.renderTable(e);case z.Row:return this.renderTableRow(e);case z.Cell:return this.renderTableCell(e);case z.Hyperlink:return this.renderHyperlink(e);case z.SmartTag:return this.renderSmartTag(e);case z.Drawing:return this.renderDrawing(e);case z.Image:return this.renderImage(e);case z.Text:return this.renderText(e);case z.Text:return this.renderText(e);case z.DeletedText:return this.renderDeletedText(e);case z.Tab:return this.renderTab(e);case z.Symbol:return this.renderSymbol(e);case z.Break:return this.renderBreak(e);case z.Footer:return this.renderContainer(e,"footer");case z.Header:return this.renderContainer(e,"header");case z.Footnote:case z.Endnote:return this.renderContainer(e,"li");case z.FootnoteReference:return this.renderFootnoteReference(e);case z.EndnoteReference:return this.renderEndnoteReference(e);case z.NoBreakHyphen:return this.createElement("wbr");case z.VmlPicture:return this.renderVmlPicture(e);case z.VmlElement:return this.renderVmlElement(e);case z.MmlMath:return this.renderContainerNS(e,nt.mathML,"math",{xmlns:nt.mathML});case z.MmlMathParagraph:return this.renderContainer(e,"span");case z.MmlFraction:return this.renderContainerNS(e,nt.mathML,"mfrac");case z.MmlBase:return this.renderContainerNS(e,nt.mathML,e.parent.type==z.MmlMatrixRow?"mtd":"mrow");case z.MmlNumerator:case z.MmlDenominator:case z.MmlFunction:case z.MmlLimit:case z.MmlBox:return this.renderContainerNS(e,nt.mathML,"mrow");case z.MmlGroupChar:return this.renderMmlGroupChar(e);case z.MmlLimitLower:return this.renderContainerNS(e,nt.mathML,"munder");case z.MmlMatrix:return this.renderContainerNS(e,nt.mathML,"mtable");case z.MmlMatrixRow:return this.renderContainerNS(e,nt.mathML,"mtr");case z.MmlRadical:return this.renderMmlRadical(e);case z.MmlSuperscript:return this.renderContainerNS(e,nt.mathML,"msup");case z.MmlSubscript:return this.renderContainerNS(e,nt.mathML,"msub");case z.MmlDegree:case z.MmlSuperArgument:case z.MmlSubArgument:return this.renderContainerNS(e,nt.mathML,"mn");case z.MmlFunctionName:return this.renderContainerNS(e,nt.mathML,"ms");case z.MmlDelimiter:return this.renderMmlDelimiter(e);case z.MmlRun:return this.renderMmlRun(e);case z.MmlNary:return this.renderMmlNary(e);case z.MmlPreSubSuper:return this.renderMmlPreSubSuper(e);case z.MmlBar:return this.renderMmlBar(e);case z.MmlEquationArray:return this.renderMllList(e);case z.Inserted:return this.renderInserted(e);case z.Deleted:return this.renderDeleted(e);case z.CommentRangeStart:return this.renderCommentRangeStart(e);case z.CommentRangeEnd:return this.renderCommentRangeEnd(e);case z.CommentReference:return this.renderCommentReference(e)}return null}renderChildren(e,t){return this.renderElements(e.children,t)}renderElements(e,t){if(e==null)return null;var r=e.flatMap(n=>this.renderElement(n)).filter(n=>n!=null);return t&&se(t,r),r}renderContainer(e,t,r){return this.createElement(t,r,this.renderChildren(e))}renderContainerNS(e,t,r,n){return ht(t,r,n,this.renderChildren(e))}renderParagraph(e){var a,l,o,u;var t=this.createElement("p");const r=this.findStyle(e.styleName);(l=e.tabs)!=null||(e.tabs=(a=r==null?void 0:r.paragraphProps)==null?void 0:a.tabs),this.renderClass(e,t),this.renderChildren(e,t),this.renderStyleValues(e.cssStyle,t),this.renderCommonProperties(t.style,e);const n=(u=e.numbering)!=null?u:(o=r==null?void 0:r.paragraphProps)==null?void 0:o.numbering;return n&&t.classList.add(this.numberingClass(n.id,n.level)),t}renderRunProperties(e,t){this.renderCommonProperties(e,t)}renderCommonProperties(e,t){t!=null&&(t.color&&(e.color=t.color),t.fontSize&&(e["font-size"]=t.fontSize))}renderHyperlink(e){var t=this.createElement("a");if(this.renderChildren(e,t),this.renderStyleValues(e.cssStyle,t),e.href)t.href=e.href;else if(e.id){const r=this.document.documentPart.rels.find(n=>n.id==e.id&&n.targetMode==="External");t.href=r==null?void 0:r.target}return t}renderSmartTag(e){var t=this.createElement("span");return this.renderChildren(e,t),t}renderCommentRangeStart(e){var n;if(!this.options.renderComments)return null;const t=new Range;(n=this.commentHighlight)==null||n.add(t);const r=this.htmlDocument.createComment(`start of comment #${e.id}`);return this.later(()=>t.setStart(r,0)),this.commentMap[e.id]=t,r}renderCommentRangeEnd(e){if(!this.options.renderComments)return null;const t=this.commentMap[e.id],r=this.htmlDocument.createComment(`end of comment #${e.id}`);return this.later(()=>t==null?void 0:t.setEnd(r,0)),r}renderCommentReference(e){var l;if(!this.options.renderComments)return null;var t=(l=this.document.commentsPart)==null?void 0:l.commentMap[e.id];if(!t)return null;const r=new DocumentFragment,n=Rt("span",{className:`${this.className}-comment-ref`},["💬"]),a=Rt("div",{className:`${this.className}-comment-popover`});return this.renderCommentContent(t,a),r.appendChild(this.htmlDocument.createComment(`comment #${t.id} by ${t.author} on ${t.date}`)),r.appendChild(n),r.appendChild(a),r}renderCommentContent(e,t){t.appendChild(Rt("div",{className:`${this.className}-comment-author`},[e.author])),t.appendChild(Rt("div",{className:`${this.className}-comment-date`},[new Date(e.date).toLocaleString()])),this.renderChildren(e,t)}renderDrawing(e){var t=this.createElement("div");return t.style.display="inline-block",t.style.position="relative",t.style.textIndent="0px",this.renderChildren(e,t),this.renderStyleValues(e.cssStyle,t),t}renderImage(e){let t=this.createElement("img");return this.renderStyleValues(e.cssStyle,t),this.document&&this.tasks.push(this.document.loadDocumentImage(e.src,this.currentPart).then(r=>{t.src=r})),t}renderText(e){return this.htmlDocument.createTextNode(e.text)}renderDeletedText(e){return this.options.renderEndnotes?this.htmlDocument.createTextNode(e.text):null}renderBreak(e){return e.break=="textWrapping"?this.createElement("br"):null}renderInserted(e){return this.options.renderChanges?this.renderContainer(e,"ins"):this.renderChildren(e)}renderDeleted(e){return this.options.renderChanges?this.renderContainer(e,"del"):null}renderSymbol(e){var t=this.createElement("span");return t.style.fontFamily=e.font,t.innerHTML=`&#x${e.char};`,t}renderFootnoteReference(e){var t=this.createElement("sup");return this.currentFootnoteIds.push(e.id),t.textContent=`${this.currentFootnoteIds.length}`,t}renderEndnoteReference(e){var t=this.createElement("sup");return this.currentEndnoteIds.push(e.id),t.textContent=`${this.currentEndnoteIds.length}`,t}renderTab(e){var n;var t=this.createElement("span");if(t.innerHTML=" ",this.options.experimental){t.className=this.tabStopClass();var r=(n=Kr(e,z.Paragraph))==null?void 0:n.tabs;this.currentTabs.push({stops:r,span:t})}return t}renderBookmarkStart(e){var t=this.createElement("span");return t.id=e.name,t}renderRun(e){if(e.fieldRun)return null;const t=this.createElement("span");if(e.id&&(t.id=e.id),this.renderClass(e,t),this.renderStyleValues(e.cssStyle,t),e.verticalAlign){const r=this.createElement(e.verticalAlign);this.renderChildren(e,r),t.appendChild(r)}else this.renderChildren(e,t);return t}renderTable(e){let t=this.createElement("table");return this.tableCellPositions.push(this.currentCellPosition),this.tableVerticalMerges.push(this.currentVerticalMerge),this.currentVerticalMerge={},this.currentCellPosition={col:0,row:0},e.columns&&t.appendChild(this.renderTableColumns(e.columns)),this.renderClass(e,t),this.renderChildren(e,t),this.renderStyleValues(e.cssStyle,t),this.currentVerticalMerge=this.tableVerticalMerges.pop(),this.currentCellPosition=this.tableCellPositions.pop(),t}renderTableColumns(e){let t=this.createElement("colgroup");for(let r of e){let n=this.createElement("col");r.width&&(n.style.width=r.width),t.appendChild(n)}return t}renderTableRow(e){let t=this.createElement("tr");return this.currentCellPosition.col=0,this.renderClass(e,t),this.renderChildren(e,t),this.renderStyleValues(e.cssStyle,t),this.currentCellPosition.row++,t}renderTableCell(e){let t=this.createElement("td");const r=this.currentCellPosition.col;return e.verticalMerge?e.verticalMerge=="restart"?(this.currentVerticalMerge[r]=t,t.rowSpan=1):this.currentVerticalMerge[r]&&(this.currentVerticalMerge[r].rowSpan+=1,t.style.display="none"):this.currentVerticalMerge[r]=null,this.renderClass(e,t),this.renderChildren(e,t),this.renderStyleValues(e.cssStyle,t),e.span&&(t.colSpan=e.span),this.currentCellPosition.col+=t.colSpan,t}renderVmlPicture(e){var t=Rt("div");return this.renderChildren(e,t),t}renderVmlElement(e){var n,a;var t=Ee("svg");t.setAttribute("style",e.cssStyleText);const r=this.renderVmlChildElement(e);return(n=e.imageHref)!=null&&n.id&&this.tasks.push((a=this.document)==null?void 0:a.loadDocumentImage(e.imageHref.id,this.currentPart).then(l=>r.setAttribute("href",l))),t.appendChild(r),requestAnimationFrame(()=>{const l=t.firstElementChild.getBBox();t.setAttribute("width",`${Math.ceil(l.x+l.width)}`),t.setAttribute("height",`${Math.ceil(l.y+l.height)}`)}),t}renderVmlChildElement(e){const t=Ee(e.tagName);Object.entries(e.attrs).forEach(([r,n])=>t.setAttribute(r,n));for(let r of e.children)r.type==z.VmlElement?t.appendChild(this.renderVmlChildElement(r)):t.appendChild(...Ft(this.renderElement(r)));return t}renderMmlRadical(e){var n;const t=e.children.find(a=>a.type==z.MmlBase);if((n=e.props)!=null&&n.hideDegree)return ht(nt.mathML,"msqrt",null,this.renderElements([t]));const r=e.children.find(a=>a.type==z.MmlDegree);return ht(nt.mathML,"mroot",null,this.renderElements([t,r]))}renderMmlDelimiter(e){var r,n;const t=[];return t.push(ht(nt.mathML,"mo",null,[(r=e.props.beginChar)!=null?r:"("])),t.push(...this.renderElements(e.children)),t.push(ht(nt.mathML,"mo",null,[(n=e.props.endChar)!=null?n:")"])),ht(nt.mathML,"mrow",null,t)}renderMmlNary(e){var b,y;const t=[],r=Nt(e.children,_=>_.type),n=r[z.MmlSuperArgument],a=r[z.MmlSubArgument],l=n?ht(nt.mathML,"mo",null,Ft(this.renderElement(n))):null,o=a?ht(nt.mathML,"mo",null,Ft(this.renderElement(a))):null,u=ht(nt.mathML,"mo",null,[(y=(b=e.props)==null?void 0:b.char)!=null?y:"∫"]);return l||o?t.push(ht(nt.mathML,"munderover",null,[u,o,l])):l?t.push(ht(nt.mathML,"mover",null,[u,l])):o?t.push(ht(nt.mathML,"munder",null,[u,o])):t.push(u),t.push(...this.renderElements(r[z.MmlBase].children)),ht(nt.mathML,"mrow",null,t)}renderMmlPreSubSuper(e){const t=[],r=Nt(e.children,b=>b.type),n=r[z.MmlSuperArgument],a=r[z.MmlSubArgument],l=n?ht(nt.mathML,"mo",null,Ft(this.renderElement(n))):null,o=a?ht(nt.mathML,"mo",null,Ft(this.renderElement(a))):null,u=ht(nt.mathML,"mo",null);return t.push(ht(nt.mathML,"msubsup",null,[u,o,l])),t.push(...this.renderElements(r[z.MmlBase].children)),ht(nt.mathML,"mrow",null,t)}renderMmlGroupChar(e){const t=e.props.verticalJustification==="bot"?"mover":"munder",r=this.renderContainerNS(e,nt.mathML,t);return e.props.char&&r.appendChild(ht(nt.mathML,"mo",null,[e.props.char])),r}renderMmlBar(e){const t=this.renderContainerNS(e,nt.mathML,"mrow");switch(e.props.position){case"top":t.style.textDecoration="overline";break;case"bottom":t.style.textDecoration="underline";break}return t}renderMmlRun(e){const t=ht(nt.mathML,"ms");return this.renderClass(e,t),this.renderStyleValues(e.cssStyle,t),this.renderChildren(e,t),t}renderMllList(e){const t=ht(nt.mathML,"mtable");this.renderClass(e,t),this.renderStyleValues(e.cssStyle,t),this.renderChildren(e);for(let r of this.renderChildren(e))t.appendChild(ht(nt.mathML,"mtr",null,[ht(nt.mathML,"mtd",null,[r])]));return t}renderStyleValues(e,t){for(let r in e)r.startsWith("$")?t.setAttribute(r.slice(1),e[r]):t.style[r]=e[r]}renderClass(e,t){e.className&&(t.className=e.className),e.styleName&&t.classList.add(this.processStyleName(e.styleName))}findStyle(e){var t;return e&&((t=this.styleMap)==null?void 0:t[e])}numberingClass(e,t){return`${this.className}-num-${e}-${t}`}tabStopClass(){return`${this.className}-tab-stop`}styleToString(e,t,r=null){let n=`${e} {\r +`;for(const a in t)a.startsWith("$")||(n+=` ${a}: ${t[a]};\r +`);return r&&(n+=r),n+`}\r +`}numberingCounter(e,t){return`${this.className}-num-${e}-${t}`}levelTextToContent(e,t,r,n){var o;const a={tab:"\\9",space:"\\a0"};var l=e.replace(/%\d*/g,u=>{let b=parseInt(u.substring(1),10)-1;return`"counter(${this.numberingCounter(r,b)}, ${n})"`});return`"${l}${(o=a[t])!=null?o:""}"`}numFormatToCssValue(e){var r;var t={none:"none",bullet:"disc",decimal:"decimal",lowerLetter:"lower-alpha",upperLetter:"upper-alpha",lowerRoman:"lower-roman",upperRoman:"upper-roman",decimalZero:"decimal-leading-zero",aiueo:"katakana",aiueoFullWidth:"katakana",chineseCounting:"simp-chinese-informal",chineseCountingThousand:"simp-chinese-informal",chineseLegalSimplified:"simp-chinese-formal",chosung:"hangul-consonant",ideographDigital:"cjk-ideographic",ideographTraditional:"cjk-heavenly-stem",ideographLegalTraditional:"trad-chinese-formal",ideographZodiac:"cjk-earthly-branch",iroha:"katakana-iroha",irohaFullWidth:"katakana-iroha",japaneseCounting:"japanese-informal",japaneseDigitalTenThousand:"cjk-decimal",japaneseLegal:"japanese-formal",thaiNumbers:"thai",koreanCounting:"korean-hangul-formal",koreanDigital:"korean-hangul-formal",koreanDigital2:"korean-hanja-informal",hebrew1:"hebrew",hebrew2:"hebrew",hindiNumbers:"devanagari",ganada:"hangul",taiwaneseCounting:"cjk-ideographic",taiwaneseCountingThousand:"cjk-ideographic",taiwaneseDigital:"cjk-decimal"};return(r=t[e])!=null?r:e}refreshTabStops(){this.options.experimental&&(clearTimeout(this.tabsTimeout),this.tabsTimeout=setTimeout(()=>{const e=Xr();for(let t of this.currentTabs)Gr(t.span,t.stops,this.defaultTabSize,e)},500))}later(e){this.postRenderTasks.push(e)}}function Rt(i,e,t){return ht(void 0,i,e,t)}function Ee(i,e,t){return ht(nt.svg,i,e,t)}function ht(i,e,t,r){var n=i?document.createElementNS(i,e):document.createElement(e);return Object.assign(n,t),r&&se(n,r),n}function Ae(i){i.innerHTML=""}function se(i,e){e.forEach(t=>i.appendChild(Ve(t)?document.createTextNode(t):t))}function Mt(i){return Rt("style",{innerHTML:i})}function Lt(i,e){i.appendChild(document.createComment(e))}function Kr(i,e){for(var t=i.parent;t!=null&&t.type!=e;)t=t.parent;return t}const Ne={ignoreHeight:!1,ignoreWidth:!1,ignoreFonts:!1,breakPages:!0,debug:!1,experimental:!1,className:"docx",inWrapper:!0,trimXmlDeclaration:!0,ignoreLastRenderedPageBreak:!0,renderHeaders:!0,renderFooters:!0,renderFootnotes:!0,renderEndnotes:!0,useBase64URL:!1,renderChanges:!1,renderComments:!1};function Yr(i,e){const t=_t(_t({},Ne),e);return ae.load(i,new Hr(t),t)}function Jr(i,e,t,r){return wt(this,null,function*(){const n=_t(_t({},Ne),r),a=new qr(window.document);return a.render(i,e,t,n),Promise.allSettled(a.tasks)})}function Qr(i,e,t,r){return wt(this,null,function*(){const n=yield Yr(i,r);return yield Jr(n,e,t,r),n})}const tn={ignoreLastRenderedPageBreak:!1};function en(i,e={}){return typeof i=="string"?rn(i,e):Promise.resolve(i)}function rn(i,e){return fetch(i,e).then(t=>t.status!==200?Promise.reject(t):t)}function nn(i){return wt(this,null,function*(){let e;return i instanceof Blob?e=i:i instanceof Response?e=yield i.blob():i instanceof ArrayBuffer&&(e=new Blob([i])),e})}function an(i,e,t={}){if(!i)return e.innerHTML="",Promise.resolve();let r;return i instanceof Blob?r=i:i instanceof Response?r=i.blob():i instanceof ArrayBuffer&&(r=new Blob([i])),Qr(r,e,e,_t(_t({},tn),t))}const Tt={getData:en,render:an,getBlob:nn};function sn(i,e){return wt(this,null,function*(){e&&(e instanceof ArrayBuffer&&(e=new Blob([e])),on(i,URL.createObjectURL(e)))})}function on(i,e){let t=document.createElement("a");t.download=i,t.style.display="none",t.href=e,document.body.appendChild(t),t.click(),document.body.removeChild(t)}const _n="",ln=(i,e)=>{const t=i.__vccOpts||i;for(const[r,n]of e)t[r]=n;return t},cn=dt.defineComponent({name:"VueOfficeDocx",props:{src:[String,ArrayBuffer,Blob],requestOptions:{type:Object,default:()=>({})},options:{type:Object,default:()=>({})}},emits:["rendered","error"],setup(i,{emit:e}){const t=dt.ref(null);let r=null;function n(){let l=t.value;Tt.getData(i.src,i.requestOptions).then(o=>wt(this,null,function*(){r=yield Tt.getBlob(o),Tt.render(r,l,i.options).then(()=>{e("rendered")}).catch(u=>{Tt.render("",l,i.options),e("error",u)})})).catch(o=>{Tt.render("",l,i.options),e("error",o)})}dt.onMounted(()=>{i.src&&n()}),dt.watch(()=>i.src,()=>{i.src?n():Tt.render("",t.value,i.options).then(()=>{e("rendered")})});function a(l){sn(l||`vue-office-docx-${new Date().getTime()}.docx`,r)}return{rootRef:t,save:a}}}),hn={class:"vue-office-docx"},un={class:"vue-office-docx-main",ref:"rootRef"};function dn(i,e,t,r,n,a){return ft.openBlock(),ft.createElementBlock("div",hn,[ft.createElementVNode("div",un,null,512)])}const qt=ln(cn,[["render",dn]]);return qt.install=function(i){i.component(qt.name,qt)},qt});