@grapecity/activereports
Version:
ActiveReportsJS
12 lines (11 loc) • 108 kB
JavaScript
/*!
* @grapecity/activereports 5.2.2
* Description: ActiveReportsJS
* https://www.npmjs.com/package/@grapecity/activereports
* Copyright ©️ Respective Holders. All rights reserved.
* Licensed under the Commercial license
*/
(function(ct,gt){typeof exports=="object"&&typeof module<"u"?gt(exports):typeof define=="function"&&define.amd?define(["exports"],gt):(ct=typeof globalThis<"u"?globalThis:ct||self,gt((ct.GC=ct.GC||{},ct.GC.ActiveReports=ct.GC.ActiveReports||{},ct.GC.ActiveReports.TabularDataExport={})))})(this,function(ct){"use strict";function gt(L){return L&&L.__esModule&&Object.prototype.hasOwnProperty.call(L,"default")?L.default:L}var kt={exports:{}},Wt=kt.exports,Rt;function Mt(){return Rt||(Rt=1,function(L,j){(function(f,E){L.exports=E()})(Wt,function(){return function f(E,m,o){var s=window,r="application/octet-stream",a=o||r,_=E,y=!m&&!o&&_,g=document.createElement("a"),w=function(A){return String(A)},i=s.Blob||s.MozBlob||s.WebKitBlob||w,d=m||"download",n,h;if(i=i.call?i.bind(s):Blob,String(this)==="true"&&(_=[_,a],a=_[0],_=_[1]),y&&y.length<2048&&(d=y.split("/").pop().split("?")[0],g.href=y,g.href.indexOf(y)!==-1)){var u=new XMLHttpRequest;return u.open("GET",y,!0),u.responseType="blob",u.onload=function(A){f(A.target.response,d,r)},setTimeout(function(){u.send()},0),u}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(_))if(_.length>1024*1024*1.999&&i!==w)_=x(_),a=_.type||r;else return navigator.msSaveBlob?navigator.msSaveBlob(x(_),d):B(_);else if(/([\x80-\xff])/.test(_)){var p=0,v=new Uint8Array(_.length),S=v.length;for(p;p<S;++p)v[p]=_.charCodeAt(p);_=new i([v],{type:a})}n=_ instanceof i?_:new i([_],{type:a});function x(A){var F=A.split(/[:;,]/),R=F[1],H=F[2]=="base64"?atob:decodeURIComponent,X=H(F.pop()),b=X.length,O=0,e=new Uint8Array(b);for(O;O<b;++O)e[O]=X.charCodeAt(O);return new i([e],{type:R})}function B(A,F){if("download"in g)return g.href=A,g.setAttribute("download",d),g.className="download-js-link",g.innerHTML="downloading...",g.style.display="none",document.body.appendChild(g),setTimeout(function(){g.click(),document.body.removeChild(g),F===!0&&setTimeout(function(){s.URL.revokeObjectURL(g.href)},250)},66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(A)&&(A="data:"+A.replace(/^data:([\w\/\-\+]+)/,r)),window.open(A)||confirm(`Displaying New Document
Use Save As... to download, then click back to return to this page.`)&&(location.href=A),!0;var R=document.createElement("iframe");document.body.appendChild(R),!F&&/^data:/.test(A)&&(A="data:"+A.replace(/^data:([\w\/\-\+]+)/,r)),R.src=A,setTimeout(function(){document.body.removeChild(R)},333)}if(navigator.msSaveBlob)return navigator.msSaveBlob(n,d);if(s.URL)B(s.URL.createObjectURL(n),!0);else{if(typeof n=="string"||n.constructor===w)try{return B("data:"+a+";base64,"+s.btoa(n))}catch{return B("data:"+a+","+encodeURIComponent(n))}h=new FileReader,h.onload=function(A){B(this.result)},h.readAsDataURL(n)}return!0}})}(kt)),kt.exports}var Ht=Mt();const Ot=gt(Ht);function Bt(L){return Array.prototype.concat(...L)}const bt=L=>L[L.length-1],xt=L=>L!=null?L.replace(/\\n/g,`
`).replace(/\\r/g,"\r").replace(/\\t/g," "):L;function Nt(L,j="untitled"){if(typeof L=="string"){const f=new Blob(["\uFEFF"+L],{type:"text/csv"});Ot(f,j+".csv","text/csv")}else Ot(L,j+".zip","application/zip")}function Gt(){if(window&&window.arjsViewer&&typeof window.arjsViewer.registerExport=="function"){const L={formatKey:"tabular-data",friendlyName:"Tabular data",settingsDescriptors:[{name:"colSeparator",type:"string",label:"Columns Separator",category:"csv"},{name:"rowSeparator",type:"string",label:"Rows Separator",category:"csv"},{name:"quotationSymbol",type:"string",label:"Quotation Symbol",category:"csv"},{name:"tableSeparator",type:"string",label:"Tables Separator",category:"csv"},{name:"outputType",type:"enum",label:"Output Type",enumValues:{plain:"Plain text",zip:"ZIP"},category:"csv"},{name:"filename",type:"string",label:"File Name"}],defaultSettings:{filename:"ActiveReports",colSeparator:",",rowSeparator:"\\n",quotationSymbol:'"',tableSeparator:"===============",outputType:"plain"},invoke:async(j,f,E,m)=>{const{filename:o,...s}=f,r={csvSettings:{colSeparator:xt(s.colSeparator),rowSeparator:xt(s.rowSeparator),quotationSymbol:xt(s.quotationSymbol),tableSeparator:xt(s.tableSeparator),outputType:s.outputType},filename:s.filename,format:"csv"},a=await Ft(j._renderer,r,E,m);return{data:a.data,download:_=>a.download(_||o)}}};window.arjsViewer.registerExport(L)}}function St(L){throw new Error('Could not dynamically require "'+L+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var zt={exports:{}};var Dt;function Vt(){return Dt||(Dt=1,function(L,j){(function(f){L.exports=f()})(function(){return function f(E,m,o){function s(_,y){if(!m[_]){if(!E[_]){var g=typeof St=="function"&&St;if(!y&&g)return g(_,!0);if(r)return r(_,!0);var w=new Error("Cannot find module '"+_+"'");throw w.code="MODULE_NOT_FOUND",w}var i=m[_]={exports:{}};E[_][0].call(i.exports,function(d){var n=E[_][1][d];return s(n||d)},i,i.exports,f,E,m,o)}return m[_].exports}for(var r=typeof St=="function"&&St,a=0;a<o.length;a++)s(o[a]);return s}({1:[function(f,E,m){var o=f("./utils"),s=f("./support"),r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";m.encode=function(a){for(var _,y,g,w,i,d,n,h=[],u=0,p=a.length,v=p,S=o.getTypeOf(a)!=="string";u<a.length;)v=p-u,g=S?(_=a[u++],y=u<p?a[u++]:0,u<p?a[u++]:0):(_=a.charCodeAt(u++),y=u<p?a.charCodeAt(u++):0,u<p?a.charCodeAt(u++):0),w=_>>2,i=(3&_)<<4|y>>4,d=1<v?(15&y)<<2|g>>6:64,n=2<v?63&g:64,h.push(r.charAt(w)+r.charAt(i)+r.charAt(d)+r.charAt(n));return h.join("")},m.decode=function(a){var _,y,g,w,i,d,n=0,h=0,u="data:";if(a.substr(0,u.length)===u)throw new Error("Invalid base64 input, it looks like a data url.");var p,v=3*(a=a.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(a.charAt(a.length-1)===r.charAt(64)&&v--,a.charAt(a.length-2)===r.charAt(64)&&v--,v%1!=0)throw new Error("Invalid base64 input, bad content length.");for(p=s.uint8array?new Uint8Array(0|v):new Array(0|v);n<a.length;)_=r.indexOf(a.charAt(n++))<<2|(w=r.indexOf(a.charAt(n++)))>>4,y=(15&w)<<4|(i=r.indexOf(a.charAt(n++)))>>2,g=(3&i)<<6|(d=r.indexOf(a.charAt(n++))),p[h++]=_,i!==64&&(p[h++]=y),d!==64&&(p[h++]=g);return p}},{"./support":30,"./utils":32}],2:[function(f,E,m){var o=f("./external"),s=f("./stream/DataWorker"),r=f("./stream/Crc32Probe"),a=f("./stream/DataLengthProbe");function _(y,g,w,i,d){this.compressedSize=y,this.uncompressedSize=g,this.crc32=w,this.compression=i,this.compressedContent=d}_.prototype={getContentWorker:function(){var y=new s(o.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),g=this;return y.on("end",function(){if(this.streamInfo.data_length!==g.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),y},getCompressedWorker:function(){return new s(o.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},_.createWorkerFrom=function(y,g,w){return y.pipe(new r).pipe(new a("uncompressedSize")).pipe(g.compressWorker(w)).pipe(new a("compressedSize")).withStreamInfo("compression",g)},E.exports=_},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(f,E,m){var o=f("./stream/GenericWorker");m.STORE={magic:"\0\0",compressWorker:function(){return new o("STORE compression")},uncompressWorker:function(){return new o("STORE decompression")}},m.DEFLATE=f("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(f,E,m){var o=f("./utils"),s=function(){for(var r,a=[],_=0;_<256;_++){r=_;for(var y=0;y<8;y++)r=1&r?3988292384^r>>>1:r>>>1;a[_]=r}return a}();E.exports=function(r,a){return r!==void 0&&r.length?o.getTypeOf(r)!=="string"?function(_,y,g,w){var i=s,d=w+g;_^=-1;for(var n=w;n<d;n++)_=_>>>8^i[255&(_^y[n])];return-1^_}(0|a,r,r.length,0):function(_,y,g,w){var i=s,d=w+g;_^=-1;for(var n=w;n<d;n++)_=_>>>8^i[255&(_^y.charCodeAt(n))];return-1^_}(0|a,r,r.length,0):0}},{"./utils":32}],5:[function(f,E,m){m.base64=!1,m.binary=!1,m.dir=!1,m.createFolders=!0,m.date=null,m.compression=null,m.compressionOptions=null,m.comment=null,m.unixPermissions=null,m.dosPermissions=null},{}],6:[function(f,E,m){var o=null;o=typeof Promise<"u"?Promise:f("lie"),E.exports={Promise:o}},{lie:37}],7:[function(f,E,m){var o=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",s=f("pako"),r=f("./utils"),a=f("./stream/GenericWorker"),_=o?"uint8array":"array";function y(g,w){a.call(this,"FlateWorker/"+g),this._pako=null,this._pakoAction=g,this._pakoOptions=w,this.meta={}}m.magic="\b\0",r.inherits(y,a),y.prototype.processChunk=function(g){this.meta=g.meta,this._pako===null&&this._createPako(),this._pako.push(r.transformTo(_,g.data),!1)},y.prototype.flush=function(){a.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},y.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},y.prototype._createPako=function(){this._pako=new s[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var g=this;this._pako.onData=function(w){g.push({data:w,meta:g.meta})}},m.compressWorker=function(g){return new y("Deflate",g)},m.uncompressWorker=function(){return new y("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(f,E,m){function o(i,d){var n,h="";for(n=0;n<d;n++)h+=String.fromCharCode(255&i),i>>>=8;return h}function s(i,d,n,h,u,p){var v,S,x=i.file,B=i.compression,A=p!==_.utf8encode,F=r.transformTo("string",p(x.name)),R=r.transformTo("string",_.utf8encode(x.name)),H=x.comment,X=r.transformTo("string",p(H)),b=r.transformTo("string",_.utf8encode(H)),O=R.length!==x.name.length,e=b.length!==H.length,D="",Q="",Z="",tt=x.dir,W=x.date,J={crc32:0,compressedSize:0,uncompressedSize:0};d&&!n||(J.crc32=i.crc32,J.compressedSize=i.compressedSize,J.uncompressedSize=i.uncompressedSize);var I=0;d&&(I|=8),A||!O&&!e||(I|=2048);var z=0,$=0;tt&&(z|=16),u==="UNIX"?($=798,z|=function(V,at){var lt=V;return V||(lt=at?16893:33204),(65535<)<<16}(x.unixPermissions,tt)):($=20,z|=function(V){return 63&(V||0)}(x.dosPermissions)),v=W.getUTCHours(),v<<=6,v|=W.getUTCMinutes(),v<<=5,v|=W.getUTCSeconds()/2,S=W.getUTCFullYear()-1980,S<<=4,S|=W.getUTCMonth()+1,S<<=5,S|=W.getUTCDate(),O&&(Q=o(1,1)+o(y(F),4)+R,D+="up"+o(Q.length,2)+Q),e&&(Z=o(1,1)+o(y(X),4)+b,D+="uc"+o(Z.length,2)+Z);var q="";return q+=`
\0`,q+=o(I,2),q+=B.magic,q+=o(v,2),q+=o(S,2),q+=o(J.crc32,4),q+=o(J.compressedSize,4),q+=o(J.uncompressedSize,4),q+=o(F.length,2),q+=o(D.length,2),{fileRecord:g.LOCAL_FILE_HEADER+q+F+D,dirRecord:g.CENTRAL_FILE_HEADER+o($,2)+q+o(X.length,2)+"\0\0\0\0"+o(z,4)+o(h,4)+F+D+X}}var r=f("../utils"),a=f("../stream/GenericWorker"),_=f("../utf8"),y=f("../crc32"),g=f("../signature");function w(i,d,n,h){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=d,this.zipPlatform=n,this.encodeFileName=h,this.streamFiles=i,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}r.inherits(w,a),w.prototype.push=function(i){var d=i.meta.percent||0,n=this.entriesCount,h=this._sources.length;this.accumulate?this.contentBuffer.push(i):(this.bytesWritten+=i.data.length,a.prototype.push.call(this,{data:i.data,meta:{currentFile:this.currentFile,percent:n?(d+100*(n-h-1))/n:100}}))},w.prototype.openedSource=function(i){this.currentSourceOffset=this.bytesWritten,this.currentFile=i.file.name;var d=this.streamFiles&&!i.file.dir;if(d){var n=s(i,d,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},w.prototype.closedSource=function(i){this.accumulate=!1;var d=this.streamFiles&&!i.file.dir,n=s(i,d,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),d)this.push({data:function(h){return g.DATA_DESCRIPTOR+o(h.crc32,4)+o(h.compressedSize,4)+o(h.uncompressedSize,4)}(i),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},w.prototype.flush=function(){for(var i=this.bytesWritten,d=0;d<this.dirRecords.length;d++)this.push({data:this.dirRecords[d],meta:{percent:100}});var n=this.bytesWritten-i,h=function(u,p,v,S,x){var B=r.transformTo("string",x(S));return g.CENTRAL_DIRECTORY_END+"\0\0\0\0"+o(u,2)+o(u,2)+o(p,4)+o(v,4)+o(B.length,2)+B}(this.dirRecords.length,n,i,this.zipComment,this.encodeFileName);this.push({data:h,meta:{percent:100}})},w.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},w.prototype.registerPrevious=function(i){this._sources.push(i);var d=this;return i.on("data",function(n){d.processChunk(n)}),i.on("end",function(){d.closedSource(d.previous.streamInfo),d._sources.length?d.prepareNextSource():d.end()}),i.on("error",function(n){d.error(n)}),this},w.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},w.prototype.error=function(i){var d=this._sources;if(!a.prototype.error.call(this,i))return!1;for(var n=0;n<d.length;n++)try{d[n].error(i)}catch{}return!0},w.prototype.lock=function(){a.prototype.lock.call(this);for(var i=this._sources,d=0;d<i.length;d++)i[d].lock()},E.exports=w},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(f,E,m){var o=f("../compressions"),s=f("./ZipFileWorker");m.generateWorker=function(r,a,_){var y=new s(a.streamFiles,_,a.platform,a.encodeFileName),g=0;try{r.forEach(function(w,i){g++;var d=function(p,v){var S=p||v,x=o[S];if(!x)throw new Error(S+" is not a valid compression method !");return x}(i.options.compression,a.compression),n=i.options.compressionOptions||a.compressionOptions||{},h=i.dir,u=i.date;i._compressWorker(d,n).withStreamInfo("file",{name:w,dir:h,date:u,comment:i.comment||"",unixPermissions:i.unixPermissions,dosPermissions:i.dosPermissions}).pipe(y)}),y.entriesCount=g}catch(w){y.error(w)}return y}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(f,E,m){function o(){if(!(this instanceof o))return new o;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var s=new o;for(var r in this)typeof this[r]!="function"&&(s[r]=this[r]);return s}}(o.prototype=f("./object")).loadAsync=f("./load"),o.support=f("./support"),o.defaults=f("./defaults"),o.version="3.10.1",o.loadAsync=function(s,r){return new o().loadAsync(s,r)},o.external=f("./external"),E.exports=o},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(f,E,m){var o=f("./utils"),s=f("./external"),r=f("./utf8"),a=f("./zipEntries"),_=f("./stream/Crc32Probe"),y=f("./nodejsUtils");function g(w){return new s.Promise(function(i,d){var n=w.decompressed.getContentWorker().pipe(new _);n.on("error",function(h){d(h)}).on("end",function(){n.streamInfo.crc32!==w.decompressed.crc32?d(new Error("Corrupted zip : CRC32 mismatch")):i()}).resume()})}E.exports=function(w,i){var d=this;return i=o.extend(i||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:r.utf8decode}),y.isNode&&y.isStream(w)?s.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):o.prepareContent("the loaded zip file",w,!0,i.optimizedBinaryString,i.base64).then(function(n){var h=new a(i);return h.load(n),h}).then(function(n){var h=[s.Promise.resolve(n)],u=n.files;if(i.checkCRC32)for(var p=0;p<u.length;p++)h.push(g(u[p]));return s.Promise.all(h)}).then(function(n){for(var h=n.shift(),u=h.files,p=0;p<u.length;p++){var v=u[p],S=v.fileNameStr,x=o.resolve(v.fileNameStr);d.file(x,v.decompressed,{binary:!0,optimizedBinaryString:!0,date:v.date,dir:v.dir,comment:v.fileCommentStr.length?v.fileCommentStr:null,unixPermissions:v.unixPermissions,dosPermissions:v.dosPermissions,createFolders:i.createFolders}),v.dir||(d.file(x).unsafeOriginalName=S)}return h.zipComment.length&&(d.comment=h.zipComment),d})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(f,E,m){var o=f("../utils"),s=f("../stream/GenericWorker");function r(a,_){s.call(this,"Nodejs stream input adapter for "+a),this._upstreamEnded=!1,this._bindStream(_)}o.inherits(r,s),r.prototype._bindStream=function(a){var _=this;(this._stream=a).pause(),a.on("data",function(y){_.push({data:y,meta:{percent:0}})}).on("error",function(y){_.isPaused?this.generatedError=y:_.error(y)}).on("end",function(){_.isPaused?_._upstreamEnded=!0:_.end()})},r.prototype.pause=function(){return!!s.prototype.pause.call(this)&&(this._stream.pause(),!0)},r.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},E.exports=r},{"../stream/GenericWorker":28,"../utils":32}],13:[function(f,E,m){var o=f("readable-stream").Readable;function s(r,a,_){o.call(this,a),this._helper=r;var y=this;r.on("data",function(g,w){y.push(g)||y._helper.pause(),_&&_(w)}).on("error",function(g){y.emit("error",g)}).on("end",function(){y.push(null)})}f("../utils").inherits(s,o),s.prototype._read=function(){this._helper.resume()},E.exports=s},{"../utils":32,"readable-stream":16}],14:[function(f,E,m){E.exports={isNode:typeof Buffer<"u",newBufferFrom:function(o,s){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(o,s);if(typeof o=="number")throw new Error('The "data" argument must not be a number');return new Buffer(o,s)},allocBuffer:function(o){if(Buffer.alloc)return Buffer.alloc(o);var s=new Buffer(o);return s.fill(0),s},isBuffer:function(o){return Buffer.isBuffer(o)},isStream:function(o){return o&&typeof o.on=="function"&&typeof o.pause=="function"&&typeof o.resume=="function"}}},{}],15:[function(f,E,m){function o(x,B,A){var F,R=r.getTypeOf(B),H=r.extend(A||{},y);H.date=H.date||new Date,H.compression!==null&&(H.compression=H.compression.toUpperCase()),typeof H.unixPermissions=="string"&&(H.unixPermissions=parseInt(H.unixPermissions,8)),H.unixPermissions&&16384&H.unixPermissions&&(H.dir=!0),H.dosPermissions&&16&H.dosPermissions&&(H.dir=!0),H.dir&&(x=u(x)),H.createFolders&&(F=h(x))&&p.call(this,F,!0);var X=R==="string"&&H.binary===!1&&H.base64===!1;A&&A.binary!==void 0||(H.binary=!X),(B instanceof g&&B.uncompressedSize===0||H.dir||!B||B.length===0)&&(H.base64=!1,H.binary=!0,B="",H.compression="STORE",R="string");var b=null;b=B instanceof g||B instanceof a?B:d.isNode&&d.isStream(B)?new n(x,B):r.prepareContent(x,B,H.binary,H.optimizedBinaryString,H.base64);var O=new w(x,b,H);this.files[x]=O}var s=f("./utf8"),r=f("./utils"),a=f("./stream/GenericWorker"),_=f("./stream/StreamHelper"),y=f("./defaults"),g=f("./compressedObject"),w=f("./zipObject"),i=f("./generate"),d=f("./nodejsUtils"),n=f("./nodejs/NodejsStreamInputAdapter"),h=function(x){x.slice(-1)==="/"&&(x=x.substring(0,x.length-1));var B=x.lastIndexOf("/");return 0<B?x.substring(0,B):""},u=function(x){return x.slice(-1)!=="/"&&(x+="/"),x},p=function(x,B){return B=B!==void 0?B:y.createFolders,x=u(x),this.files[x]||o.call(this,x,null,{dir:!0,createFolders:B}),this.files[x]};function v(x){return Object.prototype.toString.call(x)==="[object RegExp]"}var S={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(x){var B,A,F;for(B in this.files)F=this.files[B],(A=B.slice(this.root.length,B.length))&&B.slice(0,this.root.length)===this.root&&x(A,F)},filter:function(x){var B=[];return this.forEach(function(A,F){x(A,F)&&B.push(F)}),B},file:function(x,B,A){if(arguments.length!==1)return x=this.root+x,o.call(this,x,B,A),this;if(v(x)){var F=x;return this.filter(function(H,X){return!X.dir&&F.test(H)})}var R=this.files[this.root+x];return R&&!R.dir?R:null},folder:function(x){if(!x)return this;if(v(x))return this.filter(function(R,H){return H.dir&&x.test(R)});var B=this.root+x,A=p.call(this,B),F=this.clone();return F.root=A.name,F},remove:function(x){x=this.root+x;var B=this.files[x];if(B||(x.slice(-1)!=="/"&&(x+="/"),B=this.files[x]),B&&!B.dir)delete this.files[x];else for(var A=this.filter(function(R,H){return H.name.slice(0,x.length)===x}),F=0;F<A.length;F++)delete this.files[A[F].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(x){var B,A={};try{if((A=r.extend(x||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:s.utf8encode})).type=A.type.toLowerCase(),A.compression=A.compression.toUpperCase(),A.type==="binarystring"&&(A.type="string"),!A.type)throw new Error("No output type specified.");r.checkSupport(A.type),A.platform!=="darwin"&&A.platform!=="freebsd"&&A.platform!=="linux"&&A.platform!=="sunos"||(A.platform="UNIX"),A.platform==="win32"&&(A.platform="DOS");var F=A.comment||this.comment||"";B=i.generateWorker(this,A,F)}catch(R){(B=new a("error")).error(R)}return new _(B,A.type||"string",A.mimeType)},generateAsync:function(x,B){return this.generateInternalStream(x).accumulate(B)},generateNodeStream:function(x,B){return(x=x||{}).type||(x.type="nodebuffer"),this.generateInternalStream(x).toNodejsStream(B)}};E.exports=S},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(f,E,m){E.exports=f("stream")},{stream:void 0}],17:[function(f,E,m){var o=f("./DataReader");function s(r){o.call(this,r);for(var a=0;a<this.data.length;a++)r[a]=255&r[a]}f("../utils").inherits(s,o),s.prototype.byteAt=function(r){return this.data[this.zero+r]},s.prototype.lastIndexOfSignature=function(r){for(var a=r.charCodeAt(0),_=r.charCodeAt(1),y=r.charCodeAt(2),g=r.charCodeAt(3),w=this.length-4;0<=w;--w)if(this.data[w]===a&&this.data[w+1]===_&&this.data[w+2]===y&&this.data[w+3]===g)return w-this.zero;return-1},s.prototype.readAndCheckSignature=function(r){var a=r.charCodeAt(0),_=r.charCodeAt(1),y=r.charCodeAt(2),g=r.charCodeAt(3),w=this.readData(4);return a===w[0]&&_===w[1]&&y===w[2]&&g===w[3]},s.prototype.readData=function(r){if(this.checkOffset(r),r===0)return[];var a=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,a},E.exports=s},{"../utils":32,"./DataReader":18}],18:[function(f,E,m){var o=f("../utils");function s(r){this.data=r,this.length=r.length,this.index=0,this.zero=0}s.prototype={checkOffset:function(r){this.checkIndex(this.index+r)},checkIndex:function(r){if(this.length<this.zero+r||r<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+r+"). Corrupted zip ?")},setIndex:function(r){this.checkIndex(r),this.index=r},skip:function(r){this.setIndex(this.index+r)},byteAt:function(){},readInt:function(r){var a,_=0;for(this.checkOffset(r),a=this.index+r-1;a>=this.index;a--)_=(_<<8)+this.byteAt(a);return this.index+=r,_},readString:function(r){return o.transformTo("string",this.readData(r))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var r=this.readInt(4);return new Date(Date.UTC(1980+(r>>25&127),(r>>21&15)-1,r>>16&31,r>>11&31,r>>5&63,(31&r)<<1))}},E.exports=s},{"../utils":32}],19:[function(f,E,m){var o=f("./Uint8ArrayReader");function s(r){o.call(this,r)}f("../utils").inherits(s,o),s.prototype.readData=function(r){this.checkOffset(r);var a=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,a},E.exports=s},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(f,E,m){var o=f("./DataReader");function s(r){o.call(this,r)}f("../utils").inherits(s,o),s.prototype.byteAt=function(r){return this.data.charCodeAt(this.zero+r)},s.prototype.lastIndexOfSignature=function(r){return this.data.lastIndexOf(r)-this.zero},s.prototype.readAndCheckSignature=function(r){return r===this.readData(4)},s.prototype.readData=function(r){this.checkOffset(r);var a=this.data.slice(this.zero+this.index,this.zero+this.index+r);return this.index+=r,a},E.exports=s},{"../utils":32,"./DataReader":18}],21:[function(f,E,m){var o=f("./ArrayReader");function s(r){o.call(this,r)}f("../utils").inherits(s,o),s.prototype.readData=function(r){if(this.checkOffset(r),r===0)return new Uint8Array(0);var a=this.data.subarray(this.zero+this.index,this.zero+this.index+r);return this.index+=r,a},E.exports=s},{"../utils":32,"./ArrayReader":17}],22:[function(f,E,m){var o=f("../utils"),s=f("../support"),r=f("./ArrayReader"),a=f("./StringReader"),_=f("./NodeBufferReader"),y=f("./Uint8ArrayReader");E.exports=function(g){var w=o.getTypeOf(g);return o.checkSupport(w),w!=="string"||s.uint8array?w==="nodebuffer"?new _(g):s.uint8array?new y(o.transformTo("uint8array",g)):new r(o.transformTo("array",g)):new a(g)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(f,E,m){m.LOCAL_FILE_HEADER="PK",m.CENTRAL_FILE_HEADER="PK",m.CENTRAL_DIRECTORY_END="PK",m.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",m.ZIP64_CENTRAL_DIRECTORY_END="PK",m.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(f,E,m){var o=f("./GenericWorker"),s=f("../utils");function r(a){o.call(this,"ConvertWorker to "+a),this.destType=a}s.inherits(r,o),r.prototype.processChunk=function(a){this.push({data:s.transformTo(this.destType,a.data),meta:a.meta})},E.exports=r},{"../utils":32,"./GenericWorker":28}],25:[function(f,E,m){var o=f("./GenericWorker"),s=f("../crc32");function r(){o.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}f("../utils").inherits(r,o),r.prototype.processChunk=function(a){this.streamInfo.crc32=s(a.data,this.streamInfo.crc32||0),this.push(a)},E.exports=r},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(f,E,m){var o=f("../utils"),s=f("./GenericWorker");function r(a){s.call(this,"DataLengthProbe for "+a),this.propName=a,this.withStreamInfo(a,0)}o.inherits(r,s),r.prototype.processChunk=function(a){if(a){var _=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=_+a.data.length}s.prototype.processChunk.call(this,a)},E.exports=r},{"../utils":32,"./GenericWorker":28}],27:[function(f,E,m){var o=f("../utils"),s=f("./GenericWorker");function r(a){s.call(this,"DataWorker");var _=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,a.then(function(y){_.dataIsReady=!0,_.data=y,_.max=y&&y.length||0,_.type=o.getTypeOf(y),_.isPaused||_._tickAndRepeat()},function(y){_.error(y)})}o.inherits(r,s),r.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this.data=null},r.prototype.resume=function(){return!!s.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,o.delay(this._tickAndRepeat,[],this)),!0)},r.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(o.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},r.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var a=null,_=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":a=this.data.substring(this.index,_);break;case"uint8array":a=this.data.subarray(this.index,_);break;case"array":case"nodebuffer":a=this.data.slice(this.index,_)}return this.index=_,this.push({data:a,meta:{percent:this.max?this.index/this.max*100:0}})},E.exports=r},{"../utils":32,"./GenericWorker":28}],28:[function(f,E,m){function o(s){this.name=s||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}o.prototype={push:function(s){this.emit("data",s)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(s){this.emit("error",s)}return!0},error:function(s){return!this.isFinished&&(this.isPaused?this.generatedError=s:(this.isFinished=!0,this.emit("error",s),this.previous&&this.previous.error(s),this.cleanUp()),!0)},on:function(s,r){return this._listeners[s].push(r),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(s,r){if(this._listeners[s])for(var a=0;a<this._listeners[s].length;a++)this._listeners[s][a].call(this,r)},pipe:function(s){return s.registerPrevious(this)},registerPrevious:function(s){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=s.streamInfo,this.mergeStreamInfo(),this.previous=s;var r=this;return s.on("data",function(a){r.processChunk(a)}),s.on("end",function(){r.end()}),s.on("error",function(a){r.error(a)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var s=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),s=!0),this.previous&&this.previous.resume(),!s},flush:function(){},processChunk:function(s){this.push(s)},withStreamInfo:function(s,r){return this.extraStreamInfo[s]=r,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var s in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,s)&&(this.streamInfo[s]=this.extraStreamInfo[s])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var s="Worker "+this.name;return this.previous?this.previous+" -> "+s:s}},E.exports=o},{}],29:[function(f,E,m){var o=f("../utils"),s=f("./ConvertWorker"),r=f("./GenericWorker"),a=f("../base64"),_=f("../support"),y=f("../external"),g=null;if(_.nodestream)try{g=f("../nodejs/NodejsStreamOutputAdapter")}catch{}function w(d,n){return new y.Promise(function(h,u){var p=[],v=d._internalType,S=d._outputType,x=d._mimeType;d.on("data",function(B,A){p.push(B),n&&n(A)}).on("error",function(B){p=[],u(B)}).on("end",function(){try{var B=function(A,F,R){switch(A){case"blob":return o.newBlob(o.transformTo("arraybuffer",F),R);case"base64":return a.encode(F);default:return o.transformTo(A,F)}}(S,function(A,F){var R,H=0,X=null,b=0;for(R=0;R<F.length;R++)b+=F[R].length;switch(A){case"string":return F.join("");case"array":return Array.prototype.concat.apply([],F);case"uint8array":for(X=new Uint8Array(b),R=0;R<F.length;R++)X.set(F[R],H),H+=F[R].length;return X;case"nodebuffer":return Buffer.concat(F);default:throw new Error("concat : unsupported type '"+A+"'")}}(v,p),x);h(B)}catch(A){u(A)}p=[]}).resume()})}function i(d,n,h){var u=n;switch(n){case"blob":case"arraybuffer":u="uint8array";break;case"base64":u="string"}try{this._internalType=u,this._outputType=n,this._mimeType=h,o.checkSupport(u),this._worker=d.pipe(new s(u)),d.lock()}catch(p){this._worker=new r("error"),this._worker.error(p)}}i.prototype={accumulate:function(d){return w(this,d)},on:function(d,n){var h=this;return d==="data"?this._worker.on(d,function(u){n.call(h,u.data,u.meta)}):this._worker.on(d,function(){o.delay(n,arguments,h)}),this},resume:function(){return o.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(d){if(o.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new g(this,{objectMode:this._outputType!=="nodebuffer"},d)}},E.exports=i},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(f,E,m){if(m.base64=!0,m.array=!0,m.string=!0,m.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",m.nodebuffer=typeof Buffer<"u",m.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")m.blob=!1;else{var o=new ArrayBuffer(0);try{m.blob=new Blob([o],{type:"application/zip"}).size===0}catch{try{var s=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);s.append(o),m.blob=s.getBlob("application/zip").size===0}catch{m.blob=!1}}}try{m.nodestream=!!f("readable-stream").Readable}catch{m.nodestream=!1}},{"readable-stream":16}],31:[function(f,E,m){for(var o=f("./utils"),s=f("./support"),r=f("./nodejsUtils"),a=f("./stream/GenericWorker"),_=new Array(256),y=0;y<256;y++)_[y]=252<=y?6:248<=y?5:240<=y?4:224<=y?3:192<=y?2:1;_[254]=_[254]=1;function g(){a.call(this,"utf-8 decode"),this.leftOver=null}function w(){a.call(this,"utf-8 encode")}m.utf8encode=function(i){return s.nodebuffer?r.newBufferFrom(i,"utf-8"):function(d){var n,h,u,p,v,S=d.length,x=0;for(p=0;p<S;p++)(64512&(h=d.charCodeAt(p)))==55296&&p+1<S&&(64512&(u=d.charCodeAt(p+1)))==56320&&(h=65536+(h-55296<<10)+(u-56320),p++),x+=h<128?1:h<2048?2:h<65536?3:4;for(n=s.uint8array?new Uint8Array(x):new Array(x),p=v=0;v<x;p++)(64512&(h=d.charCodeAt(p)))==55296&&p+1<S&&(64512&(u=d.charCodeAt(p+1)))==56320&&(h=65536+(h-55296<<10)+(u-56320),p++),h<128?n[v++]=h:(h<2048?n[v++]=192|h>>>6:(h<65536?n[v++]=224|h>>>12:(n[v++]=240|h>>>18,n[v++]=128|h>>>12&63),n[v++]=128|h>>>6&63),n[v++]=128|63&h);return n}(i)},m.utf8decode=function(i){return s.nodebuffer?o.transformTo("nodebuffer",i).toString("utf-8"):function(d){var n,h,u,p,v=d.length,S=new Array(2*v);for(n=h=0;n<v;)if((u=d[n++])<128)S[h++]=u;else if(4<(p=_[u]))S[h++]=65533,n+=p-1;else{for(u&=p===2?31:p===3?15:7;1<p&&n<v;)u=u<<6|63&d[n++],p--;1<p?S[h++]=65533:u<65536?S[h++]=u:(u-=65536,S[h++]=55296|u>>10&1023,S[h++]=56320|1023&u)}return S.length!==h&&(S.subarray?S=S.subarray(0,h):S.length=h),o.applyFromCharCode(S)}(i=o.transformTo(s.uint8array?"uint8array":"array",i))},o.inherits(g,a),g.prototype.processChunk=function(i){var d=o.transformTo(s.uint8array?"uint8array":"array",i.data);if(this.leftOver&&this.leftOver.length){if(s.uint8array){var n=d;(d=new Uint8Array(n.length+this.leftOver.length)).set(this.leftOver,0),d.set(n,this.leftOver.length)}else d=this.leftOver.concat(d);this.leftOver=null}var h=function(p,v){var S;for((v=v||p.length)>p.length&&(v=p.length),S=v-1;0<=S&&(192&p[S])==128;)S--;return S<0||S===0?v:S+_[p[S]]>v?S:v}(d),u=d;h!==d.length&&(s.uint8array?(u=d.subarray(0,h),this.leftOver=d.subarray(h,d.length)):(u=d.slice(0,h),this.leftOver=d.slice(h,d.length))),this.push({data:m.utf8decode(u),meta:i.meta})},g.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:m.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},m.Utf8DecodeWorker=g,o.inherits(w,a),w.prototype.processChunk=function(i){this.push({data:m.utf8encode(i.data),meta:i.meta})},m.Utf8EncodeWorker=w},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(f,E,m){var o=f("./support"),s=f("./base64"),r=f("./nodejsUtils"),a=f("./external");function _(n){return n}function y(n,h){for(var u=0;u<n.length;++u)h[u]=255&n.charCodeAt(u);return h}f("setimmediate"),m.newBlob=function(n,h){m.checkSupport("blob");try{return new Blob([n],{type:h})}catch{try{var u=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return u.append(n),u.getBlob(h)}catch{throw new Error("Bug : can't construct the Blob.")}}};var g={stringifyByChunk:function(n,h,u){var p=[],v=0,S=n.length;if(S<=u)return String.fromCharCode.apply(null,n);for(;v<S;)h==="array"||h==="nodebuffer"?p.push(String.fromCharCode.apply(null,n.slice(v,Math.min(v+u,S)))):p.push(String.fromCharCode.apply(null,n.subarray(v,Math.min(v+u,S)))),v+=u;return p.join("")},stringifyByChar:function(n){for(var h="",u=0;u<n.length;u++)h+=String.fromCharCode(n[u]);return h},applyCanBeUsed:{uint8array:function(){try{return o.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}}(),nodebuffer:function(){try{return o.nodebuffer&&String.fromCharCode.apply(null,r.allocBuffer(1)).length===1}catch{return!1}}()}};function w(n){var h=65536,u=m.getTypeOf(n),p=!0;if(u==="uint8array"?p=g.applyCanBeUsed.uint8array:u==="nodebuffer"&&(p=g.applyCanBeUsed.nodebuffer),p)for(;1<h;)try{return g.stringifyByChunk(n,u,h)}catch{h=Math.floor(h/2)}return g.stringifyByChar(n)}function i(n,h){for(var u=0;u<n.length;u++)h[u]=n[u];return h}m.applyFromCharCode=w;var d={};d.string={string:_,array:function(n){return y(n,new Array(n.length))},arraybuffer:function(n){return d.string.uint8array(n).buffer},uint8array:function(n){return y(n,new Uint8Array(n.length))},nodebuffer:function(n){return y(n,r.allocBuffer(n.length))}},d.array={string:w,array:_,arraybuffer:function(n){return new Uint8Array(n).buffer},uint8array:function(n){return new Uint8Array(n)},nodebuffer:function(n){return r.newBufferFrom(n)}},d.arraybuffer={string:function(n){return w(new Uint8Array(n))},array:function(n){return i(new Uint8Array(n),new Array(n.byteLength))},arraybuffer:_,uint8array:function(n){return new Uint8Array(n)},nodebuffer:function(n){return r.newBufferFrom(new Uint8Array(n))}},d.uint8array={string:w,array:function(n){return i(n,new Array(n.length))},arraybuffer:function(n){return n.buffer},uint8array:_,nodebuffer:function(n){return r.newBufferFrom(n)}},d.nodebuffer={string:w,array:function(n){return i(n,new Array(n.length))},arraybuffer:function(n){return d.nodebuffer.uint8array(n).buffer},uint8array:function(n){return i(n,new Uint8Array(n.length))},nodebuffer:_},m.transformTo=function(n,h){if(h=h||"",!n)return h;m.checkSupport(n);var u=m.getTypeOf(h);return d[u][n](h)},m.resolve=function(n){for(var h=n.split("/"),u=[],p=0;p<h.length;p++){var v=h[p];v==="."||v===""&&p!==0&&p!==h.length-1||(v===".."?u.pop():u.push(v))}return u.join("/")},m.getTypeOf=function(n){return typeof n=="string"?"string":Object.prototype.toString.call(n)==="[object Array]"?"array":o.nodebuffer&&r.isBuffer(n)?"nodebuffer":o.uint8array&&n instanceof Uint8Array?"uint8array":o.arraybuffer&&n instanceof ArrayBuffer?"arraybuffer":void 0},m.checkSupport=function(n){if(!o[n.toLowerCase()])throw new Error(n+" is not supported by this platform")},m.MAX_VALUE_16BITS=65535,m.MAX_VALUE_32BITS=-1,m.pretty=function(n){var h,u,p="";for(u=0;u<(n||"").length;u++)p+="\\x"+((h=n.charCodeAt(u))<16?"0":"")+h.toString(16).toUpperCase();return p},m.delay=function(n,h,u){setImmediate(function(){n.apply(u||null,h||[])})},m.inherits=function(n,h){function u(){}u.prototype=h.prototype,n.prototype=new u},m.extend=function(){var n,h,u={};for(n=0;n<arguments.length;n++)for(h in arguments[n])Object.prototype.hasOwnProperty.call(arguments[n],h)&&u[h]===void 0&&(u[h]=arguments[n][h]);return u},m.prepareContent=function(n,h,u,p,v){return a.Promise.resolve(h).then(function(S){return o.blob&&(S instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(S))!==-1)&&typeof FileReader<"u"?new a.Promise(function(x,B){var A=new FileReader;A.onload=function(F){x(F.target.result)},A.onerror=function(F){B(F.target.error)},A.readAsArrayBuffer(S)}):S}).then(function(S){var x=m.getTypeOf(S);return x?(x==="arraybuffer"?S=m.transformTo("uint8array",S):x==="string"&&(v?S=s.decode(S):u&&p!==!0&&(S=function(B){return y(B,o.uint8array?new Uint8Array(B.length):new Array(B.length))}(S))),S):a.Promise.reject(new Error("Can't read the data of '"+n+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(f,E,m){var o=f("./reader/readerFor"),s=f("./utils"),r=f("./signature"),a=f("./zipEntry"),_=f("./support");function y(g){this.files=[],this.loadOptions=g}y.prototype={checkSignature:function(g){if(!this.reader.readAndCheckSignature(g)){this.reader.index-=4;var w=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+s.pretty(w)+", expected "+s.pretty(g)+")")}},isSignature:function(g,w){var i=this.reader.index;this.reader.setIndex(g);var d=this.reader.readString(4)===w;return this.reader.setIndex(i),d},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var g=this.reader.readData(this.zipCommentLength),w=_.uint8array?"uint8array":"array",i=s.transformTo(w,g);this.zipComment=this.loadOptions.decodeFileName(i)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var g,w,i,d=this.zip64EndOfCentralSize-44;0<d;)g=this.reader.readInt(2),w=this.reader.readInt(4),i=this.reader.readData(w),this.zip64ExtensibleData[g]={id:g,length:w,value:i}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var g,w;for(g=0;g<this.files.length;g++)w=this.files[g],this.reader.setIndex(w.localHeaderOffset),this.checkSignature(r.LOCAL_FILE_HEADER),w.readLocalPart(this.reader),w.handleUTF8(),w.processAttributes()},readCentralDir:function(){var g;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(r.CENTRAL_FILE_HEADER);)(g=new a({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(g);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var g=this.reader.lastIndexOfSignature(r.CENTRAL_DIRECTORY_END);if(g<0)throw this.isSignature(0,r.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(g);var w=g;if(this.checkSignature(r.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===s.MAX_VALUE_16BITS||this.diskWithCentralDirStart===s.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===s.MAX_VALUE_16BITS||this.centralDirRecords===s.MAX_VALUE_16BITS||this.centralDirSize===s.MAX_VALUE_32BITS||this.centralDirOffset===s.MAX_VALUE_32BITS){if(this.zip64=!0,(g=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(g),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,r.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var i=this.centralDirOffset+this.centralDirSize;this.zip64&&(i+=20,i+=12+this.zip64EndOfCentralSize);var d=w-i;if(0<d)this.isSignature(w,r.CENTRAL_FILE_HEADER)||(this.reader.zero=d);else if(d<0)throw new Error("Corrupted zip: missing "+Math.abs(d)+" bytes.")},prepareReader:function(g){this.reader=o(g)},load:function(g){this.prepareReader(g),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},E.exports=y},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(f,E,m){var o=f("./reader/readerFor"),s=f("./utils"),r=f("./compressedObject"),a=f("./crc32"),_=f("./utf8"),y=f("./compressions"),g=f("./support");function w(i,d){this.options=i,this.loadOptions=d}w.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(i){var d,n;if(i.skip(22),this.fileNameLength=i.readInt(2),n=i.readInt(2),this.fileName=i.readData(this.fileNameLength),i.skip(n),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((d=function(h){for(var u in y)if(Object.prototype.hasOwnProperty.call(y,u)&&y[u].magic===h)return y[u];return null}(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+s.pretty(this.compressionMethod)+" unknown (inner file : "+s.transformTo("string",this.fileName)+")");this.decompressed=new r(this.compressedSize,this.uncompressedSize,this.crc32,d,i.readData(this.compressedSize))},readCentralPart:function(i){this.versionMadeBy=i.readInt(2),i.skip(2),this.bitFlag=i.readInt(2),this.compressionMethod=i.readString(2),this.date=i.readDate(),this.crc32=i.readInt(4),this.compressedSize=i.readInt(4),this.uncompressedSize=i.readInt(4);var d=i.readInt(2);if(this.extraFieldsLength=i.readInt(2),this.fileCommentLength=i.readInt(2),this.diskNumberStart=i.readInt(2),this.internalFileAttributes=i.readInt(2),this.externalFileAttributes=i.readInt(4),this.localHeaderOffset=i.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");i.skip(d),this.readExtraFields(i),this.parseZIP64ExtraField(i),this.fileComment=i.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var i=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),i==0&&(this.dosPermissions=63&this.externalFileAttributes),i==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var i=o(this.extraFields[1].value);this.uncompressedSize===s.MAX_VALUE_32BITS&&(this.uncompressedSize=i.readInt(8)),this.compressedSize===s.MAX_VALUE_32BITS&&(this.compressedSize=i.readInt(8)),this.localHeaderOffset===s.MAX_VALUE_32BITS&&(this.localHeaderOffset=i.readInt(8)),this.diskNumberStart===s.MAX_VALUE_32BITS&&(this.diskNumberStart=i.readInt(4))}},readExtraFields:function(i){var d,n,h,u=i.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});i.index+4<u;)d=i.readInt(2),n=i.readInt(2),h=i.readData(n),this.extraFields[d]={id:d,length:n,value:h};i.setIndex(u)},handleUTF8:function(){var i=g.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=_.utf8decode(this.fileName),this.fileCommentStr=_.utf8decode(this.fileComment);else{var d=this.findExtraFieldUnicodePath();if(d!==null)this.fileNameStr=d;else{var n=s.transformTo(i,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var h=this.findExtraFieldUnicodeComment();if(h!==null)this.fileCommentStr=h;else{var u=s.transformTo(i,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(u)}}},findExtraFieldUnicodePath:function(){var i=this.extraFields[28789];if(i){var d=o(i.value);return d.readInt(1)!==1||a(this.fileName)!==d.readInt(4)?null:_.utf8decode(d.readData(i.length-5))}return null},findExtraFieldUnicodeComment:function(){var i=this.extraFields[25461];if(i){var d=o(i.value);return d.readInt(1)!==1||a(this.fileComment)!==d.readInt(4)?null:_.utf8decode(d.readData(i.length-5))}return null}},E.exports=w},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(f,E,m){function o(d,n,h){this.name=d,this.dir=h.dir,this.date=h.date,this.comment=h.comment,this.unixPermissions=h.unixPermissions,this.dosPermissions=h.dosPermissions,this._data=n,this._dataBinary=h.binary,this.options={compression:h.compression,compressionOptions:h.compressionOptions}}var s=f("./stream/StreamHelper"),r=f("./stream/DataWorker"),a=f("./utf8"),_=f("./compressedObject"),y=f("./stream/GenericWorker");o.prototype={internalStream:function(d){var n=null,h="string";try{if(!d)throw new Error("No output type specified.");var u=(h=d.toLowerCase())==="string"||h==="text";h!=="binarystring"&&h!=="text"||(h="string"),n=this._decompressWorker();var p=!this._dataBinary;p&&!u&&(n=n.pipe(new a.Utf8EncodeWorker)),!p&&u&&(n=n.pipe(new a.Utf8DecodeWorker))}catch(v){(n=new y("error")).error(v)}return new s(n,h,"")},async:function(d,n){return this.internalStream(d).accumulate(n)},nodeStream:function(d,n){return this.internalStream(d||"nodebuffer").toNodejsStream(n)},_compressWorker:function(d,n){if(this._data instanceof _&&this._data.compression.magic===d.magic)return this._data.getCompressedWorker();var h=this._decompressWorker();return this._dataBinary||(h=h.pipe(new a.Utf8EncodeWorker)),_.createWorkerFrom(h,d,n)},_decompressWorker:function(){return this._data instanceof _?this._data.getContentWorker():this._data instanceof y?this._data:new r(this._data)}};for