/*! For license information please see download-dialog.js.LICENSE.txt */ (()=>{var e={1:e=>{"use strict";e.exports=function(e){var t=e[1],r=e[3];if(!r)return t;if("function"==typeof btoa){var n=btoa(unescape(encodeURIComponent(JSON.stringify(r)))),i="sourceMappingURL=data:application/json;charset=utf-8;base64,".concat(n),a="/*# ".concat(i," */");return[t].concat([a]).join("\n")}return[t].join("\n")}},51:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},60:function(e,t,r){var n,i;void 0===(i="function"==typeof(n=function(){"use strict";function t(e,t,r){var n=new XMLHttpRequest;n.open("GET",e),n.responseType="blob",n.onload=function(){o(n.response,t,r)},n.onerror=function(){console.error("could not download file")},n.send()}function n(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch(e){}return 200<=t.status&&299>=t.status}function i(e){try{e.dispatchEvent(new MouseEvent("click"))}catch(r){var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a="object"==typeof window&&window.window===window?window:"object"==typeof self&&self.self===self?self:"object"==typeof r.g&&r.g.global===r.g?r.g:void 0,s=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),o=a.saveAs||("object"!=typeof window||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!s?function(e,r,s){var o=a.URL||a.webkitURL,l=document.createElement("a");r=r||e.name||"download",l.download=r,l.rel="noopener","string"==typeof e?(l.href=e,l.origin===location.origin?i(l):n(l.href)?t(e,r,s):i(l,l.target="_blank")):(l.href=o.createObjectURL(e),setTimeout(function(){o.revokeObjectURL(l.href)},4e4),setTimeout(function(){i(l)},0))}:"msSaveOrOpenBlob"in navigator?function(e,r,a){if(r=r||e.name||"download","string"!=typeof e)navigator.msSaveOrOpenBlob(function(e,t){return void 0===t?t={autoBom:!1}:"object"!=typeof t&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\ufeff",e],{type:e.type}):e}(e,a),r);else if(n(e))t(e,r,a);else{var s=document.createElement("a");s.href=e,s.target="_blank",setTimeout(function(){i(s)})}}:function(e,r,n,i){if((i=i||open("","_blank"))&&(i.document.title=i.document.body.innerText="downloading..."),"string"==typeof e)return t(e,r,n);var o="application/octet-stream"===e.type,l=/constructor/i.test(a.HTMLElement)||a.safari,d=/CriOS\/[\d]+/.test(navigator.userAgent);if((d||o&&l||s)&&"undefined"!=typeof FileReader){var c=new FileReader;c.onloadend=function(){var e=c.result;e=d?e:e.replace(/^data:[^;]*;/,"data:attachment/file;"),i?i.location.href=e:location=e,i=null},c.readAsDataURL(e)}else{var h=a.URL||a.webkitURL,u=h.createObjectURL(e);i?i.location=u:location.href=u,i=null,setTimeout(function(){h.revokeObjectURL(u)},4e4)}});a.saveAs=o.saveAs=o,e.exports=o})?n.apply(t,[]):n)||(e.exports=i)},128:e=>{"use strict";var t={};e.exports=function(e,r){var n=function(e){if(void 0===t[e]){var r=document.querySelector(e);if(window.HTMLIFrameElement&&r instanceof window.HTMLIFrameElement)try{r=r.contentDocument.head}catch(e){r=null}t[e]=r}return t[e]}(e);if(!n)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");n.appendChild(r)}},461:(e,t,r)=>{e.exports=function e(t,r,n){function i(s,o){if(!r[s]){if(!t[s]){if(a)return a(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var d=r[s]={exports:{}};t[s][0].call(d.exports,function(e){return i(t[s][1][e]||e)},d,d.exports,e,t,r,n)}return r[s].exports}for(var a=void 0,s=0;s>2,o=(3&t)<<4|r>>4,l=1>6:64,d=2>4,r=(15&s)<<4|(o=a.indexOf(e.charAt(d++)))>>2,n=(3&o)<<6|(l=a.indexOf(e.charAt(d++))),u[c++]=t,64!==o&&(u[c++]=r),64!==l&&(u[c++]=n);return u}},{"./support":30,"./utils":32}],2:[function(e,t,r){"use strict";var n=e("./external"),i=e("./stream/DataWorker"),a=e("./stream/Crc32Probe"),s=e("./stream/DataLengthProbe");function o(e,t,r,n,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=r,this.compression=n,this.compressedContent=i}o.prototype={getContentWorker:function(){var e=new i(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new s("data_length")),t=this;return e.on("end",function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),e},getCompressedWorker:function(){return new i(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},o.createWorkerFrom=function(e,t,r){return e.pipe(new a).pipe(new s("uncompressedSize")).pipe(t.compressWorker(r)).pipe(new s("compressedSize")).withStreamInfo("compression",t)},t.exports=o},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,r){"use strict";var n=e("./stream/GenericWorker");r.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},r.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,r){"use strict";var n=e("./utils"),i=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==n.getTypeOf(e)?function(e,t,r){var n=i,a=0+r;e^=-1;for(var s=0;s>>8^n[255&(e^t[s])];return-1^e}(0|t,e,e.length):function(e,t,r){var n=i,a=0+r;e^=-1;for(var s=0;s>>8^n[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length):0}},{"./utils":32}],5:[function(e,t,r){"use strict";r.base64=!1,r.binary=!1,r.dir=!1,r.createFolders=!0,r.date=null,r.compression=null,r.compressionOptions=null,r.comment=null,r.unixPermissions=null,r.dosPermissions=null},{}],6:[function(e,t,r){"use strict";var n;n="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:n}},{lie:37}],7:[function(e,t,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=e("pako"),a=e("./utils"),s=e("./stream/GenericWorker"),o=n?"uint8array":"array";function l(e,t){s.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}r.magic="\b\0",a.inherits(l,s),l.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(a.transformTo(o,e.data),!1)},l.prototype.flush=function(){s.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},l.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this._pako=null},l.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},r.compressWorker=function(e){return new l("Deflate",e)},r.uncompressWorker=function(){return new l("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,r){"use strict";function n(e,t){var r,n="";for(r=0;r>>=8;return n}function i(e,t,r,i,s,c){var h,u,f=e.file,p=e.compression,m=c!==o.utf8encode,g=a.transformTo("string",c(f.name)),_=a.transformTo("string",o.utf8encode(f.name)),b=f.comment,v=a.transformTo("string",c(b)),w=a.transformTo("string",o.utf8encode(b)),A=_.length!==f.name.length,y=w.length!==b.length,k="",x="",C="",S=f.dir,z=f.date,E={crc32:0,compressedSize:0,uncompressedSize:0};t&&!r||(E.crc32=e.crc32,E.compressedSize=e.compressedSize,E.uncompressedSize=e.uncompressedSize);var I=0;t&&(I|=8),m||!A&&!y||(I|=2048);var B=0,O=0;S&&(B|=16),"UNIX"===s?(O=798,B|=function(e,t){var r=e;return e||(r=t?16893:33204),(65535&r)<<16}(f.unixPermissions,S)):(O=20,B|=function(e){return 63&(e||0)}(f.dosPermissions)),h=z.getUTCHours(),h<<=6,h|=z.getUTCMinutes(),h<<=5,h|=z.getUTCSeconds()/2,u=z.getUTCFullYear()-1980,u<<=4,u|=z.getUTCMonth()+1,u<<=5,u|=z.getUTCDate(),A&&(x=n(1,1)+n(l(g),4)+_,k+="up"+n(x.length,2)+x),y&&(C=n(1,1)+n(l(v),4)+w,k+="uc"+n(C.length,2)+C);var R="";return R+="\n\0",R+=n(I,2),R+=p.magic,R+=n(h,2),R+=n(u,2),R+=n(E.crc32,4),R+=n(E.compressedSize,4),R+=n(E.uncompressedSize,4),R+=n(g.length,2),R+=n(k.length,2),{fileRecord:d.LOCAL_FILE_HEADER+R+g+k,dirRecord:d.CENTRAL_FILE_HEADER+n(O,2)+R+n(v.length,2)+"\0\0\0\0"+n(B,4)+n(i,4)+g+k+v}}var a=e("../utils"),s=e("../stream/GenericWorker"),o=e("../utf8"),l=e("../crc32"),d=e("../signature");function c(e,t,r,n){s.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=r,this.encodeFileName=n,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}a.inherits(c,s),c.prototype.push=function(e){var t=e.meta.percent||0,r=this.entriesCount,n=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,s.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:r?(t+100*(r-n-1))/r:100}}))},c.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var r=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:r.fileRecord,meta:{percent:0}})}else this.accumulate=!0},c.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,r=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(r.dirRecord),t)this.push({data:function(e){return d.DATA_DESCRIPTOR+n(e.crc32,4)+n(e.compressedSize,4)+n(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:r.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},c.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t=this.index;t--)r=(r<<8)+this.byteAt(t);return this.index+=e,r},readString:function(e){return n.transformTo("string",this.readData(e))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,r){"use strict";var n=e("./Uint8ArrayReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,r){"use strict";var n=e("./DataReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,r){"use strict";var n=e("./ArrayReader");function i(e){n.call(this,e)}e("../utils").inherits(i,n),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,r){"use strict";var n=e("../utils"),i=e("../support"),a=e("./ArrayReader"),s=e("./StringReader"),o=e("./NodeBufferReader"),l=e("./Uint8ArrayReader");t.exports=function(e){var t=n.getTypeOf(e);return n.checkSupport(t),"string"!==t||i.uint8array?"nodebuffer"===t?new o(e):i.uint8array?new l(n.transformTo("uint8array",e)):new a(n.transformTo("array",e)):new s(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,r){"use strict";r.LOCAL_FILE_HEADER="PK",r.CENTRAL_FILE_HEADER="PK",r.CENTRAL_DIRECTORY_END="PK",r.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",r.ZIP64_CENTRAL_DIRECTORY_END="PK",r.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t,r){"use strict";var n=e("./GenericWorker"),i=e("../utils");function a(e){n.call(this,"ConvertWorker to "+e),this.destType=e}i.inherits(a,n),a.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=a},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,r){"use strict";var n=e("./GenericWorker"),i=e("../crc32");function a(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(a,n),a.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=a},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,r){"use strict";var n=e("../utils"),i=e("./GenericWorker");function a(e){i.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}n.inherits(a,i),a.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=a},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,r){"use strict";var n=e("../utils"),i=e("./GenericWorker");function a(e){i.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then(function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=n.getTypeOf(e),t.isPaused||t._tickAndRepeat()},function(e){t.error(e)})}n.inherits(a,i),a.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},a.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},a.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},a.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=a},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,r){"use strict";function n(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var r=0;r "+e:e}},t.exports=n},{}],29:[function(e,t,r){"use strict";var n=e("../utils"),i=e("./ConvertWorker"),a=e("./GenericWorker"),s=e("../base64"),o=e("../support"),l=e("../external"),d=null;if(o.nodestream)try{d=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function c(e,t,r){var s=t;switch(t){case"blob":case"arraybuffer":s="uint8array";break;case"base64":s="string"}try{this._internalType=s,this._outputType=t,this._mimeType=r,n.checkSupport(s),this._worker=e.pipe(new i(s)),e.lock()}catch(e){this._worker=new a("error"),this._worker.error(e)}}c.prototype={accumulate:function(e){return function(e,t){return new l.Promise(function(r,i){var a=[],o=e._internalType,l=e._outputType,d=e._mimeType;e.on("data",function(e,r){a.push(e),t&&t(r)}).on("error",function(e){a=[],i(e)}).on("end",function(){try{var e=function(e,t,r){switch(e){case"blob":return n.newBlob(n.transformTo("arraybuffer",t),r);case"base64":return s.encode(t);default:return n.transformTo(e,t)}}(l,function(e,t){var r,n=0,i=null,a=0;for(r=0;r>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t}(e)},r.utf8decode=function(e){return i.nodebuffer?n.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,r,i,a,s=e.length,l=new Array(2*s);for(t=r=0;t>10&1023,l[r++]=56320|1023&i)}return l.length!==r&&(l.subarray?l=l.subarray(0,r):l.length=r),n.applyFromCharCode(l)}(e=n.transformTo(i.uint8array?"uint8array":"array",e))},n.inherits(d,s),d.prototype.processChunk=function(e){var t=n.transformTo(i.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var a=t;(t=new Uint8Array(a.length+this.leftOver.length)).set(this.leftOver,0),t.set(a,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var s=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0||0===r?t:r+o[e[r]]>t?r:t}(t),l=t;s!==t.length&&(i.uint8array?(l=t.subarray(0,s),this.leftOver=t.subarray(s,t.length)):(l=t.slice(0,s),this.leftOver=t.slice(s,t.length))),this.push({data:r.utf8decode(l),meta:e.meta})},d.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:r.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},r.Utf8DecodeWorker=d,n.inherits(c,s),c.prototype.processChunk=function(e){this.push({data:r.utf8encode(e.data),meta:e.meta})},r.Utf8EncodeWorker=c},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,r){"use strict";var n=e("./support"),i=e("./base64"),a=e("./nodejsUtils"),s=e("./external");function o(e){return e}function l(e,t){for(var r=0;r>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var e=n(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(e){var t,r,n,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4>>6:(r<65536?t[s++]=224|r>>>12:(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63),t[s++]=128|r>>>6&63),t[s++]=128|63&r);return t},r.buf2binstring=function(e){return l(e,e.length)},r.binstring2buf=function(e){for(var t=new n.Buf8(e.length),r=0,i=t.length;r>10&1023,d[n++]=56320|1023&i)}return l(d,n)},r.utf8border=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;0<=r&&128==(192&e[r]);)r--;return r<0||0===r?t:r+s[e[r]]>t?r:t}},{"./common":41}],43:[function(e,t,r){"use strict";t.exports=function(e,t,r,n){for(var i=65535&e,a=e>>>16&65535,s=0;0!==r;){for(r-=s=2e3>>1:e>>>1;t[r]=e}return t}();t.exports=function(e,t,r,i){var a=n,s=i+r;e^=-1;for(var o=i;o>>8^a[255&(e^t[o])];return-1^e}},{}],46:[function(e,t,r){"use strict";var n,i=e("../utils/common"),a=e("./trees"),s=e("./adler32"),o=e("./crc32"),l=e("./messages"),d=-2,c=258,h=262,u=113;function f(e,t){return e.msg=l[t],t}function p(e){return(e<<1)-(4e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function _(e,t){a._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,g(e.strm)}function b(e,t){e.pending_buf[e.pending++]=t}function v(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function w(e,t){var r,n,i=e.max_chain_length,a=e.strstart,s=e.prev_length,o=e.nice_match,l=e.strstart>e.w_size-h?e.strstart-(e.w_size-h):0,d=e.window,u=e.w_mask,f=e.prev,p=e.strstart+c,m=d[a+s-1],g=d[a+s];e.prev_length>=e.good_match&&(i>>=2),o>e.lookahead&&(o=e.lookahead);do{if(d[(r=t)+s]===g&&d[r+s-1]===m&&d[r]===d[a]&&d[++r]===d[a+1]){a+=2,r++;do{}while(d[++a]===d[++r]&&d[++a]===d[++r]&&d[++a]===d[++r]&&d[++a]===d[++r]&&d[++a]===d[++r]&&d[++a]===d[++r]&&d[++a]===d[++r]&&d[++a]===d[++r]&&al&&0!=--i);return s<=e.lookahead?s:e.lookahead}function A(e){var t,r,n,a,l,d,c,u,f,p,m=e.w_size;do{if(a=e.window_size-e.lookahead-e.strstart,e.strstart>=m+(m-h)){for(i.arraySet(e.window,e.window,m,m,0),e.match_start-=m,e.strstart-=m,e.block_start-=m,t=r=e.hash_size;n=e.head[--t],e.head[t]=m<=n?n-m:0,--r;);for(t=r=m;n=e.prev[--t],e.prev[t]=m<=n?n-m:0,--r;);a+=m}if(0===e.strm.avail_in)break;if(d=e.strm,c=e.window,u=e.strstart+e.lookahead,p=void 0,(f=a)<(p=d.avail_in)&&(p=f),r=0===p?0:(d.avail_in-=p,i.arraySet(c,d.input,d.next_in,p,u),1===d.state.wrap?d.adler=s(d.adler,c,p,u):2===d.state.wrap&&(d.adler=o(d.adler,c,p,u)),d.next_in+=p,d.total_in+=p,p),e.lookahead+=r,e.lookahead+e.insert>=3)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<=3)if(n=a._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<=3&&(e.ins_h=(e.ins_h<=3&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-3,n=a._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(A(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,_(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-h&&(_(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(_(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(_(e,!1),e.strm.avail_out),1)}),new x(4,4,8,4,y),new x(4,5,16,8,y),new x(4,6,32,32,y),new x(4,4,16,16,k),new x(8,16,32,32,k),new x(8,16,128,128,k),new x(8,32,128,256,k),new x(32,128,258,1024,k),new x(32,258,258,4096,k)],r.deflateInit=function(e,t){return E(e,t,8,15,8,0)},r.deflateInit2=E,r.deflateReset=z,r.deflateResetKeep=S,r.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?d:(e.state.gzhead=t,0):d},r.deflate=function(e,t){var r,i,s,l;if(!e||!e.state||5>8&255),b(i,i.gzhead.time>>16&255),b(i,i.gzhead.time>>24&255),b(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),b(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(b(i,255&i.gzhead.extra.length),b(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=o(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(b(i,0),b(i,0),b(i,0),b(i,0),b(i,0),b(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),b(i,3),i.status=u);else{var h=8+(i.w_bits-8<<4)<<8;h|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(h|=32),h+=31-h%31,i.status=u,v(i,h),0!==i.strstart&&(v(i,e.adler>>>16),v(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(s=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>s&&(e.adler=o(e.adler,i.pending_buf,i.pending-s,s)),g(e),s=i.pending,i.pending!==i.pending_buf_size));)b(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>s&&(e.adler=o(e.adler,i.pending_buf,i.pending-s,s)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=o(e.adler,i.pending_buf,i.pending-s,s)),g(e),s=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindexs&&(e.adler=o(e.adler,i.pending_buf,i.pending-s,s)),0===l&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=o(e.adler,i.pending_buf,i.pending-s,s)),g(e),s=i.pending,i.pending===i.pending_buf_size)){l=1;break}l=i.gzindexs&&(e.adler=o(e.adler,i.pending_buf,i.pending-s,s)),0===l&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&g(e),i.pending+2<=i.pending_buf_size&&(b(i,255&e.adler),b(i,e.adler>>8&255),e.adler=0,i.status=u)):i.status=u),0!==i.pending){if(g(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&p(t)<=p(r)&&4!==t)return f(e,-5);if(666===i.status&&0!==e.avail_in)return f(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&666!==i.status){var w=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(A(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(_(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(_(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(_(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var r,n,i,s,o=e.window;;){if(e.lookahead<=c){if(A(e),e.lookahead<=c&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&0e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=a._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=a._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(_(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(_(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(_(e,!1),0===e.strm.avail_out)?1:2}(i,t):n[i.level].func(i,t);if(3!==w&&4!==w||(i.status=666),1===w||3===w)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===w&&(1===t?a._tr_align(i):5!==t&&(a._tr_stored_block(i,0,0,!1),3===t&&(m(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),g(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(b(i,255&e.adler),b(i,e.adler>>8&255),b(i,e.adler>>16&255),b(i,e.adler>>24&255),b(i,255&e.total_in),b(i,e.total_in>>8&255),b(i,e.total_in>>16&255),b(i,e.total_in>>24&255)):(v(i,e.adler>>>16),v(i,65535&e.adler)),g(e),0=r.w_size&&(0===o&&(m(r.head),r.strstart=0,r.block_start=0,r.insert=0),u=new i.Buf8(r.w_size),i.arraySet(u,t,f-r.w_size,r.w_size,0),t=u,f=r.w_size),l=e.avail_in,c=e.next_in,h=e.input,e.avail_in=f,e.next_in=0,e.input=t,A(r);r.lookahead>=3;){for(n=r.strstart,a=r.lookahead-2;r.ins_h=(r.ins_h<>>=w=v>>>24,p-=w,0==(w=v>>>16&255))S[a++]=65535&v;else{if(!(16&w)){if(!(64&w)){v=m[(65535&v)+(f&(1<>>=w,p-=w),p<15&&(f+=C[n++]<>>=w=v>>>24,p-=w,!(16&(w=v>>>16&255))){if(!(64&w)){v=g[(65535&v)+(f&(1<>>=w,p-=w,(w=a-s)>3,f&=(1<<(p-=A<<3))-1,e.next_in=n,e.next_out=a,e.avail_in=n>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function c(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function h(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(852),t.distcode=t.distdyn=new n.Buf32(592),t.sane=1,t.back=-1,0):l}function u(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,h(e)):l}function f(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15=s.wsize?(n.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(i<(a=s.wsize-s.wnext)&&(a=i),n.arraySet(s.window,t,r-i,a,s.wnext),(i-=a)?(n.arraySet(s.window,t,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=a,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=a(r.check,U,2,0),_=g=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&g)<<8)+(g>>8))%31){e.msg="incorrect header check",r.mode=30;break}if(8!=(15&g)){e.msg="unknown compression method",r.mode=30;break}if(_-=4,O=8+(15&(g>>>=4)),0===r.wbits)r.wbits=O;else if(O>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<>8&1),512&r.flags&&(U[0]=255&g,U[1]=g>>>8&255,r.check=a(r.check,U,2,0)),_=g=0,r.mode=3;case 3:for(;_<32;){if(0===p)break e;p--,g+=c[u++]<<_,_+=8}r.head&&(r.head.time=g),512&r.flags&&(U[0]=255&g,U[1]=g>>>8&255,U[2]=g>>>16&255,U[3]=g>>>24&255,r.check=a(r.check,U,4,0)),_=g=0,r.mode=4;case 4:for(;_<16;){if(0===p)break e;p--,g+=c[u++]<<_,_+=8}r.head&&(r.head.xflags=255&g,r.head.os=g>>8),512&r.flags&&(U[0]=255&g,U[1]=g>>>8&255,r.check=a(r.check,U,2,0)),_=g=0,r.mode=5;case 5:if(1024&r.flags){for(;_<16;){if(0===p)break e;p--,g+=c[u++]<<_,_+=8}r.length=g,r.head&&(r.head.extra_len=g),512&r.flags&&(U[0]=255&g,U[1]=g>>>8&255,r.check=a(r.check,U,2,0)),_=g=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(p<(y=r.length)&&(y=p),y&&(r.head&&(O=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,c,u,y,O)),512&r.flags&&(r.check=a(r.check,c,y,u)),p-=y,u+=y,r.length-=y),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===p)break e;for(y=0;O=c[u+y++],r.head&&O&&r.length<65536&&(r.head.name+=String.fromCharCode(O)),O&&y>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;_<32;){if(0===p)break e;p--,g+=c[u++]<<_,_+=8}e.adler=r.check=d(g),_=g=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=f,e.avail_out=m,e.next_in=u,e.avail_in=p,r.hold=g,r.bits=_,2;e.adler=r.check=1,r.mode=12;case 12:if(5===t||6===t)break e;case 13:if(r.last){g>>>=7&_,_-=7&_,r.mode=27;break}for(;_<3;){if(0===p)break e;p--,g+=c[u++]<<_,_+=8}switch(r.last=1&g,_-=1,3&(g>>>=1)){case 0:r.mode=14;break;case 1:if(b(r),r.mode=20,6!==t)break;g>>>=2,_-=2;break e;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}g>>>=2,_-=2;break;case 14:for(g>>>=7&_,_-=7&_;_<32;){if(0===p)break e;p--,g+=c[u++]<<_,_+=8}if((65535&g)!=(g>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&g,_=g=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(y=r.length){if(p>>=5,_-=5,r.ndist=1+(31&g),g>>>=5,_-=5,r.ncode=4+(15&g),g>>>=4,_-=4,286>>=3,_-=3}for(;r.have<19;)r.lens[j[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,T={bits:r.lenbits},R=o(0,r.lens,0,19,r.lencode,0,r.work,T),r.lenbits=T.bits,R){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,z=65535&F,!((C=F>>>24)<=_);){if(0===p)break e;p--,g+=c[u++]<<_,_+=8}if(z<16)g>>>=C,_-=C,r.lens[r.have++]=z;else{if(16===z){for(D=C+2;_>>=C,_-=C,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}O=r.lens[r.have-1],y=3+(3&g),g>>>=2,_-=2}else if(17===z){for(D=C+3;_>>=C)),g>>>=3,_-=3}else{for(D=C+7;_>>=C)),g>>>=7,_-=7}if(r.have+y>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;y--;)r.lens[r.have++]=O}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,T={bits:r.lenbits},R=o(1,r.lens,0,r.nlen,r.lencode,0,r.work,T),r.lenbits=T.bits,R){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,T={bits:r.distbits},R=o(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,T),r.distbits=T.bits,R){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(6<=p&&258<=m){e.next_out=f,e.avail_out=m,e.next_in=u,e.avail_in=p,r.hold=g,r.bits=_,s(e,A),f=e.next_out,h=e.output,m=e.avail_out,u=e.next_in,c=e.input,p=e.avail_in,g=r.hold,_=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;S=(F=r.lencode[g&(1<>>16&255,z=65535&F,!((C=F>>>24)<=_);){if(0===p)break e;p--,g+=c[u++]<<_,_+=8}if(S&&!(240&S)){for(E=C,I=S,B=z;S=(F=r.lencode[B+((g&(1<>E)])>>>16&255,z=65535&F,!(E+(C=F>>>24)<=_);){if(0===p)break e;p--,g+=c[u++]<<_,_+=8}g>>>=E,_-=E,r.back+=E}if(g>>>=C,_-=C,r.back+=C,r.length=z,0===S){r.mode=26;break}if(32&S){r.back=-1,r.mode=12;break}if(64&S){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&S,r.mode=22;case 22:if(r.extra){for(D=r.extra;_>>=r.extra,_-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;S=(F=r.distcode[g&(1<>>16&255,z=65535&F,!((C=F>>>24)<=_);){if(0===p)break e;p--,g+=c[u++]<<_,_+=8}if(!(240&S)){for(E=C,I=S,B=z;S=(F=r.distcode[B+((g&(1<>E)])>>>16&255,z=65535&F,!(E+(C=F>>>24)<=_);){if(0===p)break e;p--,g+=c[u++]<<_,_+=8}g>>>=E,_-=E,r.back+=E}if(g>>>=C,_-=C,r.back+=C,64&S){e.msg="invalid distance code",r.mode=30;break}r.offset=z,r.extra=15&S,r.mode=24;case 24:if(r.extra){for(D=r.extra;_>>=r.extra,_-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===m)break e;if(y=A-m,r.offset>y){if((y=r.offset-y)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}k=y>r.wnext?(y-=r.wnext,r.wsize-y):r.wnext-y,y>r.length&&(y=r.length),x=r.window}else x=h,k=f-r.offset,y=r.length;for(mb?(w=j[N+h[x]],T[D+h[x]]):(w=96,0),f=1<>I)+(p-=f)]=v<<24|w<<16|A,0!==p;);for(f=1<>=1;if(0!==f?(R&=f-1,R+=f):R=0,x++,0==--F[k]){if(k===S)break;k=t[r+h[x]]}if(z>>7)]}function C(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function S(e,t,r){e.bi_valid>16-r?(e.bi_buf|=t<>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<>>=1,r<<=1,0<--t;);return r>>>1}function I(e,t,r){var n,i,a=new Array(16),s=0;for(n=1;n<=l;n++)a[n]=s=s+r[n-1]<<1;for(i=0;i<=t;i++){var o=e[2*i+1];0!==o&&(e[2*i]=E(a[o]++,o))}}function B(e){var t;for(t=0;t>1;1<=r;r--)T(e,a,r);for(i=d;r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],T(e,a,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,a[2*i]=a[2*r]+a[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,a[2*r+1]=a[2*n+1]=i,e.heap[1]=i++,T(e,a,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,a,s,o,d=t.dyn_tree,c=t.max_code,h=t.stat_desc.static_tree,u=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,p=t.stat_desc.extra_base,m=t.stat_desc.max_length,g=0;for(a=0;a<=l;a++)e.bl_count[a]=0;for(d[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)m<(a=d[2*d[2*(n=e.heap[r])+1]+1]+1)&&(a=m,g++),d[2*n+1]=a,c>=7;n>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t>>3,(s=e.static_len+3+7>>>3)<=i&&(i=s)):i=s=r+5,r+4<=i&&-1!==t?L(e,t,r,n):4===e.strategy||s===i?(S(e,2+(n?1:0),3),D(e,f,p)):(S(e,4+(n?1:0),3),function(e,t,r,n){var i;for(S(e,t-257,5),S(e,r-1,5),S(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(g[r]+a+1)]++,e.dyn_dtree[2*x(t)]++),e.last_lit===e.lit_bufsize-1},r._tr_align=function(e){S(e,2,3),z(e,256,f),function(e){16===e.bi_valid?(C(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,r){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,n){(function(e){!function(e){"use strict";if(!e.setImmediate){var t,r,n,i,a=1,s={},o=!1,l=e.document,d=Object.getPrototypeOf&&Object.getPrototypeOf(e);d=d&&d.setTimeout?d:e,t="[object process]"==={}.toString.call(e.process)?function(e){process.nextTick(function(){h(e)})}:function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?(i="setImmediate$"+Math.random()+"$",e.addEventListener?e.addEventListener("message",u,!1):e.attachEvent("onmessage",u),function(t){e.postMessage(i+t,"*")}):e.MessageChannel?((n=new MessageChannel).port1.onmessage=function(e){h(e.data)},function(e){n.port2.postMessage(e)}):l&&"onreadystatechange"in l.createElement("script")?(r=l.documentElement,function(e){var t=l.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):function(e){setTimeout(h,0,e)},d.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var r=new Array(arguments.length-1),n=0;n{"use strict";var t=[];function r(e){for(var r=-1,n=0;n{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},740:e=>{"use strict";e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(r){!function(e,t,r){var n="";r.supports&&(n+="@supports (".concat(r.supports,") {")),r.media&&(n+="@media ".concat(r.media," {"));var i=void 0!==r.layer;i&&(n+="@layer".concat(r.layer.length>0?" ".concat(r.layer):""," {")),n+=r.css,i&&(n+="}"),r.media&&(n+="}"),r.supports&&(n+="}");var a=r.sourceMap;a&&"undefined"!=typeof btoa&&(n+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),t.styleTagTransform(n,e,t.options)}(t,e,r)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},855:(e,t,r)=>{"use strict";e.exports=function(e){var t=r.nc;t&&e.setAttribute("nonce",t)}},935:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var r="",n=void 0!==t[5];return t[4]&&(r+="@supports (".concat(t[4],") {")),t[2]&&(r+="@media ".concat(t[2]," {")),n&&(r+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),r+=e(t),n&&(r+="}"),t[2]&&(r+="}"),t[4]&&(r+="}"),r}).join("")},t.i=function(e,r,n,i,a){"string"==typeof e&&(e=[[null,e,void 0]]);var s={};if(n)for(var o=0;o0?" ".concat(c[5]):""," {").concat(c[1],"}")),c[5]=a),r&&(c[2]?(c[1]="@media ".concat(c[2]," {").concat(c[1],"}"),c[2]=r):c[2]=r),i&&(c[4]?(c[1]="@supports (".concat(c[4],") {").concat(c[1],"}"),c[4]=i):c[4]="".concat(i)),t.push(c))}},t}},940:(e,t,r)=>{"use strict";r.d(t,{A:()=>o});var n=r(1),i=r.n(n),a=r(935),s=r.n(a)()(i());s.push([e.id,'#conversejs .dark-background-full{display:block;position:fixed;z-index:10000;left:0;top:0;width:100vw;height:100%;background-color:#000;background-color:rgba(0,0,0,.4)}#conversejs .loading-screen{background-color:#fefefe;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);width:450px;height:100px;display:table}#conversejs .loading-screen-text{height:100%;display:table-cell;vertical-align:middle;text-align:center}#conversejs .download-table{background-color:#fefefe;margin:5% auto;padding:20px;border:1px solid #888;width:80%;height:83%;text-align:center}#conversejs .download-checkbox-column{max-width:5px;word-wrap:break-word}#conversejs .download-timestamp-column{max-width:30px;word-wrap:break-word}#conversejs .download-author-column{max-width:60px;word-wrap:break-word}#conversejs .download-link-column{max-width:125px;word-wrap:break-word}#conversejs .chat-image{max-width:90%;max-height:90%}#conversejs .download-filename-column{max-width:80px}#conversejs .download-table-head th{padding-top:12px;padding-bottom:12px;background-color:#4caf50;color:#fff;word-wrap:break-word;max-width:150px;text-align:center}#conversejs .download-table-body{font-family:"Trebuchet MS",Arial,Helvetica,sans-serif;border-collapse:collapse;width:100%}#conversejs .download-table-body td,#conversejs .download-table-body th{border:1px solid #ddd;padding:8px}#conversejs .download-table-body tr:nth-child(even){background-color:#f2f2f2}#conversejs .download-table-body tr:hover{background-color:#ddd}#conversejs .download-files-button{padding-top:6px;padding-bottom:12px;background-color:#4caf50;color:#fff;word-wrap:break-word;text-align:center;width:100%;height:30px;margin-top:10px}#conversejs .download-attachements-header{font-size:130%;margin-top:10px;margin-bottom:10px}#conversejs .download-file-input{width:80%;float:left}#conversejs .zipfile-name-input{margin-top:10px;width:96%;margin-bottom:10px}#conversejs .scrollbar-div{height:84%}#conversejs .attachements-content{margin-top:5px;border-top:thin solid #000;border-bottom:thin solid #000;padding-bottom:7px;overflow-y:scroll;height:83%;overflow-x:hidden}#conversejs .attachement-download-error-msg{color:red;text-align:center;background-color:#ffb6c1;padding:5px;margin-top:5px}#conversejs .attachement-header{height:12%}#conversejs .close-thik{color:#777;font:14px/100% arial,sans-serif;float:right;right:5px;text-decoration:none;text-shadow:0 1px 0 #fff;top:5px}#conversejs .close-thik:after{content:"✖"}',"",{version:3,sources:["webpack://./src/download_dialog.scss"],names:[],mappings:"AAAA,kCACI,aACI,CAAA,cACA,CAAA,aACA,CAAA,MACA,CAAA,KACA,CAAA,WACA,CAAA,WACA,CAAA,qBAEA,CAAA,+BACA,CAAA,4BAGJ,wBACI,CAAA,cACA,CAAA,OACA,CAAA,QACA,CAAA,+BACA,CAAA,WACA,CAAA,YACA,CAAA,aACA,CAAA,iCAGJ,WACI,CAAA,kBACA,CAAA,qBACA,CAAA,iBACA,CAAA,4BAGJ,wBACI,CAAA,cACA,CAAA,YACA,CAAA,qBACA,CAAA,SACA,CAAA,UACA,CAAA,iBACA,CAAA,sCAGJ,aACI,CAAA,oBACA,CAAA,uCAGJ,cACI,CAAA,oBACA,CAAA,oCAGJ,cACI,CAAA,oBACA,CAAA,kCAGJ,eACI,CAAA,oBACA,CAAA,wBAGJ,aACI,CAAA,cACA,CAAA,sCAGJ,cACI,CAAA,oCAGJ,gBACI,CAAA,mBACA,CAAA,wBACA,CAAA,UACA,CAAA,oBACA,CAAA,eACA,CAAA,iBACA,CAAA,iCAGJ,qDACI,CAAA,wBACA,CAAA,UACA,CAAA,wEAGJ,qBAEI,CAAA,WACA,CAAA,oDAGJ,wBAAA,CAAA,0CAEA,qBAAA,CAAA,mCAEA,eACI,CAAA,mBACA,CAAA,wBACA,CAAA,UACA,CAAA,oBACA,CAAA,iBACA,CAAA,UACA,CAAA,WACA,CAAA,eACA,CAAA,0CAGJ,cACI,CAAA,eACA,CAAA,kBACA,CAAA,iCAGJ,SACI,CAAA,UACA,CAAA,gCAGJ,eACI,CAAA,SACA,CAAA,kBACA,CAAA,2BAGJ,UACI,CAAA,kCAGJ,cACI,CAAA,0BACA,CAAA,6BACA,CAAA,kBACA,CAAA,iBACA,CAAA,UACA,CAAA,iBACA,CAAA,4CAGJ,SACI,CAAA,iBACA,CAAA,wBACA,CAAA,WACA,CAAA,cACA,CAAA,gCAGJ,UACI,CAAA,wBAGJ,UACI,CAAA,+BACA,CAAA,WACA,CAAA,SACA,CAAA,oBACA,CAAA,wBACA,CAAA,OACA,CAAA,8BAEJ,WACI",sourcesContent:["#conversejs {\n .dark-background-full {\n display: block; /* Hidden by default */\n position: fixed; /* Stay in place */\n z-index: 10000; /* Sit on top */\n left: 0;\n top: 0;\n width: 100vw; /* Full width */\n height: 100%; /* Full height */\n /*overflow: auto;*/ /* Enable scroll if needed */\n background-color: rgb(0,0,0); /* Fallback color */\n background-color: rgba(0,0,0,0.4); /* Black w/ opacity */\n }\n\n .loading-screen {\n background-color: #fefefe;\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 450px;\n height: 100px;\n display: table;\n }\n\n .loading-screen-text {\n height: 100%;\n display: table-cell;\n vertical-align: middle;\n text-align: center;\n }\n\n .download-table {\n background-color: #fefefe;\n margin: 5% auto; /* 15% from the top and centered */\n padding: 20px;\n border: 1px solid #888;\n width: 80%; /* Could be more or less, depending on screen size */\n height: 83%;\n text-align: center;\n }\n\n .download-checkbox-column {\n max-width: 5px;\n word-wrap: break-word;\n }\n\n .download-timestamp-column {\n max-width: 30px;\n word-wrap: break-word;\n }\n\n .download-author-column {\n max-width: 60px;\n word-wrap: break-word;\n }\n\n .download-link-column {\n max-width: 125px;\n word-wrap: break-word;\n }\n\n .chat-image {\n max-width: 90%;\n max-height: 90%;\n }\n\n .download-filename-column {\n max-width: 80px;\n }\n\n .download-table-head th {\n padding-top: 12px;\n padding-bottom: 12px;\n background-color: #4CAF50;\n color: white;\n word-wrap: break-word;\n max-width: 150px;\n text-align: center;\n }\n\n .download-table-body {\n font-family: \"Trebuchet MS\", Arial, Helvetica, sans-serif;\n border-collapse: collapse;\n width: 100%;\n }\n\n .download-table-body td,\n .download-table-body th {\n border: 1px solid #ddd;\n padding: 8px;\n }\n\n .download-table-body tr:nth-child(even){background-color: #f2f2f2;}\n\n .download-table-body tr:hover {background-color: #ddd;}\n\n .download-files-button {\n padding-top: 6px;\n padding-bottom: 12px;\n background-color: #4CAF50;\n color: white;\n word-wrap: break-word;\n text-align: center;\n width: 100%;\n height: 30px;\n margin-top: 10px;\n }\n\n .download-attachements-header {\n font-size: 130%;\n margin-top: 10px;\n margin-bottom: 10px;\n }\n\n .download-file-input {\n width: 80%;\n float: left;\n }\n\n .zipfile-name-input {\n margin-top: 10px;\n width: 96%;\n margin-bottom: 10px;\n }\n\n .scrollbar-div {\n height: 84%;\n }\n\n .attachements-content {\n margin-top: 5px;\n border-top: thin solid black;\n border-bottom: thin solid black;\n padding-bottom: 7px;\n overflow-y: scroll;\n height: 83%;\n overflow-x: hidden;\n }\n\n .attachement-download-error-msg {\n color: red;\n text-align: center;\n background-color: lightpink;\n padding: 5px;\n margin-top: 5px;\n }\n\n .attachement-header {\n height: 12%;\n }\n\n .close-thik {\n color: #777;\n font: 14px/100% arial, sans-serif;\n float: right;\n right: 5px;\n text-decoration: none;\n text-shadow: 0 1px 0 #fff;\n top: 5px;\n }\n .close-thik:after {\n content: '✖'; /* UTF-8 symbol */\n }\n}\n"],sourceRoot:""}]);const o=s}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var a=t[n]={id:n,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.nc=void 0,(()=>{"use strict";var e=r(461),t=r.n(e),n=r(60),i=r(591),a=r.n(i),s=r(740),o=r.n(s),l=r(128),d=r.n(l),c=r(855),h=r.n(c),u=r(51),f=r.n(u),p=r(656),m=r.n(p),g=r(940),_={};_.styleTagTransform=m(),_.setAttributes=h(),_.insert=d().bind(null,"head"),_.domAPI=o(),_.insertStyleElement=f(),a()(g.A,_),g.A&&g.A.locals&&g.A.locals;const b=new RegExp("^https?:\\/\\/[a-z\\d-:\\.]+(?:\\/([-a-z\\d%_\\.~+]*))*(\\.[a-z\\d]+)$","i"),v="YYYYMMDD_HHmm";let w,A,y,k;const x={toggle_download_dialog(e){var t;e.preventDefault(),e.stopPropagation(),function(e){const t=[];if(e.model.messages.forEach(e=>{const r=e?.get("message")?.match(b),n=r?.[0];if(n){const i=w(e.get("time")).format(v);t.push({author:e.get("from"),link:n,time:w(e.get("time")).subtract((new Date).getTimezoneOffset(),"m"),timestamp:i,filename:i+"_"+r[1],type:r[2],checked:!0})}}),t.length>0){const r=e.model.attributes.name??e.model.id;A.zipfileName="conversejs_"+w(Date.now()).format(v)+"_"+r,A.downloadables=t,A.inProgress=!1,A.hidden=!1}else alert(y("There are no files to download."))}((t=e.currentTarget).closest("converse-chat.chatbox")||t.closest("converse-muc.chatbox"))},initialize(){const{html:e}=C.env,{_converse:r}=this,{api:i}=r;A=document.createElement("converse-download-view"),w=C.env.dayjs,k=C.env.u,y=r.__,i.listen.on("getToolbarButtons",(t,r)=>{const n=y("Start Download-Dialog");return r.push(e` `),r}),i.listen.on("initialized",()=>document.body.querySelector("#conversejs").insertAdjacentElement("beforeend",A));class a extends r.exports.CustomElement{static get properties(){return{zipfileName:{type:String},downloadables:{type:Array},inProgress:{type:Boolean},hidden:{type:Boolean}}}constructor(){super(),this.zipfileName="",this.downloadables=[],this.inProgress=!1,this.hidden=!0}render(){if(!this.hidden)return e`
${this.inProgress?a.render_loading_screen():this.render_download_table()}
`}render_download_table(){return e`

${y("Attachements from the Chat")}
.zip
${this.downloadables.map(e=>a.render_downloadTableRow(e))}
${y("Timestamp")} ${y("User")} ${y("File")} ${y("Filename")}
`}static render_loading_screen(){return e`

${y("Download in Progress...")}

`}static render_image(t){return e` Image not found: ${t.filename}${t.type} `}static render_audio(t){return e` `}static render_video(t){return e` `}static render_other(t){return e` ${t.filename}${t.type} `}static render_file(e){return k.isImageURL(e.link)&&k.shouldRenderMediaFromURL(e.link,"image")?a.render_image(e):k.isAudioURL(e.link)&&k.shouldRenderMediaFromURL(e.link,"audio")?a.render_audio(e):k.isVideoURL(e.link)&&k.shouldRenderMediaFromURL(e.link,"video")?a.render_video(e):a.render_other(e)}static render_downloadTableRow(t){return e` ${t.timestamp} ${t.author} ${a.render_file(t)} ${t.type} `}downloadAllFiles(){const e=this.downloadables.filter(e=>e.checked);if(0===e.length)return void alert(y("No files for Download selected."));this.inProgress=!0;const r=new(t());Promise.all(e.map(e=>fetch(e.link))).then(t=>{const i=new Map;t.forEach((t,n)=>{let a=e[n].filename;const s=i.get(a)??0;i.set(a,s+1),s>0&&(a+="("+(s+1)+")"),t.ok?r.file(a+e[n].type,t.blob(),{binary:!0,date:new Date(e[n].time)}):r.file(a+y("_ERROR.txt"),y("The file ")+e[n].link+y(" could not be downloaded.")+"\n")}),r.generateAsync({type:"blob"}).then(e=>{(0,n.saveAs)(e,this.zipfileName+".zip"),this.hidden=!0})})}}window.customElements.define("converse-download-view",a)}},C=window.converse;void 0===C?window.addEventListener("converse-loaded",()=>C.plugins.add("download-dialog",x)):C.plugins.add("download-dialog",x)})()})(); //# sourceMappingURL=download-dialog.js.map