pizzip
Version:
Create, read and edit .zip files synchronously with Javascript
2 lines • 80.5 kB
JavaScript
/*! For license information please see pizzip.min.js.LICENSE.txt */
(()=>{var t={60:(t,e,r)=>{"use strict";var n=r(279);function i(t){this.data=t,this.length=this.data.length,this.index=0,this.zero=0}i.prototype=new n,i.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},t.exports=i},63:(t,e,r)=>{"use strict";var n=r(210),i=r(320);function a(t,e){this.data=t,e||(this.data=i.string2binary(this.data)),this.length=this.data.length,this.index=0,this.zero=0}a.prototype=new n,a.prototype.byteAt=function(t){return this.data.charCodeAt(this.zero+t)},a.prototype.lastIndexOfSignature=function(t){return this.data.lastIndexOf(t)-this.zero},a.prototype.readData=function(t){this.checkOffset(t);var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},t.exports=a},67:t=>{"use strict";t.exports=function(t,e){return"number"==typeof t?Buffer.alloc(t):Buffer.from(t,e)},t.exports.test=function(t){return Buffer.isBuffer(t)}},80:(t,e,r)=>{"use strict";var n=r(63),i=r(320),a=r(955),s=r(822),o=r(182);function d(t,e){this.options=t,this.loadOptions=e}d.prototype={isEncrypted:function(){return!(1&~this.bitFlag)},useUTF8:function(){return!(2048&~this.bitFlag)},prepareCompressedContent:function(t,e,r){return function(){var n=t.index;t.setIndex(e);var i=t.readData(r);return t.setIndex(n),i}},prepareContent:function(t,e,r,n,a){return function(){var t=i.transformTo(n.uncompressInputType,this.getCompressedContent()),e=n.uncompress(t);if(e.length!==a)throw new Error("Bug : uncompressed data size mismatch");return e}},readLocalPart:function(t){t.skip(22),this.fileNameLength=t.readInt(2);var e=t.readInt(2);if(this.fileName=t.readData(this.fileNameLength),t.skip(e),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize == -1 || uncompressedSize == -1)");var r=i.findCompression(this.compressionMethod);if(null===r)throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");if(this.decompressed=new a,this.decompressed.compressedSize=this.compressedSize,this.decompressed.uncompressedSize=this.uncompressedSize,this.decompressed.crc32=this.crc32,this.decompressed.compressionMethod=this.compressionMethod,this.decompressed.getCompressedContent=this.prepareCompressedContent(t,t.index,this.compressedSize,r),this.decompressed.getContent=this.prepareContent(t,t.index,this.compressedSize,r,this.uncompressedSize),this.loadOptions.checkCRC32&&(this.decompressed=i.transformTo("string",this.decompressed.getContent()),s.crc32(this.decompressed)!==this.crc32))throw new Error("Corrupted zip : CRC32 mismatch")},readCentralPart:function(t){if(this.versionMadeBy=t.readInt(2),this.versionNeeded=t.readInt(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4),this.fileNameLength=t.readInt(2),this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");this.fileName=t.readData(this.fileNameLength),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===t&&(this.dosPermissions=63&this.externalFileAttributes),3===t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var t=new n(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(t){var e,r,n,i=t.index;for(this.extraFields=this.extraFields||{};t.index<i+this.extraFieldsLength;)e=t.readInt(2),r=t.readInt(2),n=t.readString(r),this.extraFields[e]={id:e,length:r,value:n}},handleUTF8:function(){var t=o.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=s.utf8decode(this.fileName),this.fileCommentStr=s.utf8decode(this.fileComment);else{var e=this.findExtraFieldUnicodePath();if(null!==e)this.fileNameStr=e;else{var r=i.transformTo(t,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(r)}var n=this.findExtraFieldUnicodeComment();if(null!==n)this.fileCommentStr=n;else{var a=i.transformTo(t,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(a)}}},findExtraFieldUnicodePath:function(){var t=this.extraFields[28789];if(t){var e=new n(t.value);return 1!==e.readInt(1)||s.crc32(this.fileName)!==e.readInt(4)?null:s.utf8decode(e.readString(t.length-5))}return null},findExtraFieldUnicodeComment:function(){var t=this.extraFields[25461];if(t){var e=new n(t.value);return 1!==e.readInt(1)||s.crc32(this.fileComment)!==e.readInt(4)?null:s.utf8decode(e.readString(t.length-5))}return null}},t.exports=d},135:(t,e,r)=>{"use strict";var n=r(320);function i(t){this.data=new Uint8Array(t),this.index=0}i.prototype={append:function(t){0!==t.length&&(t=n.transformTo("uint8array",t),this.data.set(t,this.index),this.index+=t.length)},finalize:function(){return this.data}},t.exports=i},182:(t,e)=>{"use strict";if(e.base64=!0,e.array=!0,e.string=!0,e.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,e.nodebuffer="undefined"!=typeof Buffer,e.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)e.blob=!1;else{var r=new ArrayBuffer(0);try{e.blob=0===new Blob([r],{type:"application/zip"}).size}catch(t){try{var n=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder);n.append(r),e.blob=0===n.getBlob("application/zip").size}catch(t){e.blob=!1}}}},195:(t,e)=>{"use strict";e.LOCAL_FILE_HEADER="PK",e.CENTRAL_FILE_HEADER="PK",e.CENTRAL_DIRECTORY_END="PK",e.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",e.ZIP64_CENTRAL_DIRECTORY_END="PK",e.DATA_DESCRIPTOR="PK\b"},210:(t,e,r)=>{"use strict";var n=r(320);function i(){this.data=null,this.length=0,this.index=0,this.zero=0}i.prototype={checkOffset:function(t){this.checkIndex(this.index+t)},checkIndex:function(t){if(this.length<this.zero+t||t<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+t+"). Corrupted zip ?")},setIndex:function(t){this.checkIndex(t),this.index=t},skip:function(t){this.setIndex(this.index+t)},byteAt:function(){},readInt:function(t){var e,r=0;for(this.checkOffset(t),e=this.index+t-1;e>=this.index;e--)r=(r<<8)+this.byteAt(e);return this.index+=t,r},readString:function(t){return n.transformTo("string",this.readData(t))},readData:function(){},lastIndexOfSignature:function(){},readDate:function(){var t=this.readInt(4);return new Date(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1)}},t.exports=i},279:(t,e,r)=>{"use strict";var n=r(511);function i(t){t&&(this.data=t,this.length=this.data.length,this.index=0,this.zero=0)}i.prototype=new n,i.prototype.readData=function(t){if(this.checkOffset(t),0===t)return new Uint8Array(0);var e=this.data.subarray(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},t.exports=i},280:(t,e,r)=>{"use strict";var n=r(63),i=r(60),a=r(279),s=r(511),o=r(320),d=r(195),h=r(80),l=r(182);function f(t,e){this.files=[],this.loadOptions=e,t&&this.load(t)}f.prototype={checkSignature:function(t){var e=this.reader.readString(4);if(e!==t)throw new Error("Corrupted zip or bug : unexpected signature ("+o.pretty(e)+", expected "+o.pretty(t)+")")},isSignature:function(t,e){var r=this.reader.index;this.reader.setIndex(t);var n=this.reader.readString(4)===e;return this.reader.setIndex(r),n},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 t=this.reader.readData(this.zipCommentLength),e=l.uint8array?"uint8array":"array",r=o.transformTo(e,t);this.zipComment=this.loadOptions.decodeFileName(r)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.versionMadeBy=this.reader.readString(2),this.versionNeeded=this.reader.readInt(2),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 t,e,r,n=this.zip64EndOfCentralSize-44;0<n;)t=this.reader.readInt(2),e=this.reader.readInt(4),r=this.reader.readString(e),this.zip64ExtensibleData[t]={id:t,length:e,value:r}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),this.disksCount>1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t<this.files.length;t++)e=this.files[t],this.reader.setIndex(e.localHeaderOffset),this.checkSignature(d.LOCAL_FILE_HEADER),e.readLocalPart(this.reader),e.handleUTF8(),e.processAttributes()},readCentralDir:function(){var t;for(this.reader.setIndex(this.centralDirOffset);this.reader.readString(4)===d.CENTRAL_FILE_HEADER;)(t=new h({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(t);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var t=this.reader.lastIndexOfSignature(d.CENTRAL_DIRECTORY_END);if(t<0)throw this.isSignature(0,d.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 ?");this.reader.setIndex(t);var e=t;if(this.checkSignature(d.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===o.MAX_VALUE_16BITS||this.diskWithCentralDirStart===o.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===o.MAX_VALUE_16BITS||this.centralDirRecords===o.MAX_VALUE_16BITS||this.centralDirSize===o.MAX_VALUE_32BITS||this.centralDirOffset===o.MAX_VALUE_32BITS){if(this.zip64=!0,(t=this.reader.lastIndexOfSignature(d.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip : can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(t),this.checkSignature(d.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,d.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(d.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(d.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var r=this.centralDirOffset+this.centralDirSize;this.zip64&&(r+=20,r+=12+this.zip64EndOfCentralSize);var n=e-r;if(n>0)this.isSignature(e,d.CENTRAL_FILE_HEADER)||(this.reader.zero=n);else if(n<0)throw new Error("Corrupted zip: missing "+Math.abs(n)+" bytes.")},prepareReader:function(t){var e=o.getTypeOf(t);if(o.checkSupport(e),"string"!==e||l.uint8array)if("nodebuffer"===e)this.reader=new i(t);else if(l.uint8array)this.reader=new a(o.transformTo("uint8array",t));else{if(!l.array)throw new Error("Unexpected error: unsupported type '"+e+"'");this.reader=new s(o.transformTo("array",t))}else this.reader=new n(t,this.loadOptions.optimizedBinaryString)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=f},284:(t,e,r)=>{"use strict";var n=r(320);e.string2binary=function(t){return n.string2binary(t)},e.string2Uint8Array=function(t){return n.transformTo("uint8array",t)},e.uint8Array2String=function(t){return n.transformTo("string",t)},e.string2Blob=function(t){var e=n.transformTo("arraybuffer",t);return n.arrayBuffer2Blob(e)},e.arrayBuffer2Blob=function(t){return n.arrayBuffer2Blob(t)},e.transformTo=function(t,e){return n.transformTo(t,e)},e.getTypeOf=function(t){return n.getTypeOf(t)},e.checkSupport=function(t){return n.checkSupport(t)},e.MAX_VALUE_16BITS=n.MAX_VALUE_16BITS,e.MAX_VALUE_32BITS=n.MAX_VALUE_32BITS,e.pretty=function(t){return n.pretty(t)},e.findCompression=function(t){return n.findCompression(t)},e.isRegExp=function(t){return n.isRegExp(t)}},320:(t,e,r)=>{"use strict";function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}var i=r(182),a=r(538),s=r(67);function o(t){return t}function d(t,e){for(var r=0;r<t.length;++r)e[r]=255&t.charCodeAt(r);return e}function h(t){var r=65536,n=[],i=t.length,a=e.getTypeOf(t),o=0,d=!0;try{switch(a){case"uint8array":String.fromCharCode.apply(null,new Uint8Array(0));break;case"nodebuffer":String.fromCharCode.apply(null,s(0))}}catch(t){d=!1}if(!d){for(var h="",l=0;l<t.length;l++)h+=String.fromCharCode(t[l]);return h}for(;o<i&&r>1;)try{"array"===a||"nodebuffer"===a?n.push(String.fromCharCode.apply(null,t.slice(o,Math.min(o+r,i)))):n.push(String.fromCharCode.apply(null,t.subarray(o,Math.min(o+r,i)))),o+=r}catch(t){r=Math.floor(r/2)}return n.join("")}function l(t,e){for(var r=0;r<t.length;r++)e[r]=t[r];return e}e.string2binary=function(t){for(var e="",r=0;r<t.length;r++)e+=String.fromCharCode(255&t.charCodeAt(r));return e},e.arrayBuffer2Blob=function(t,r){e.checkSupport("blob"),r=r||"application/zip";try{return new Blob([t],{type:r})}catch(e){try{var n=new(window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder);return n.append(t),n.getBlob(r)}catch(t){throw new Error("Bug : can't construct the Blob.")}}},e.applyFromCharCode=h;var f={};f.string={string:o,array:function(t){return d(t,new Array(t.length))},arraybuffer:function(t){return f.string.uint8array(t).buffer},uint8array:function(t){return d(t,new Uint8Array(t.length))},nodebuffer:function(t){return d(t,s(t.length))}},f.array={string:h,array:o,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return s(t)}},f.arraybuffer={string:function(t){return h(new Uint8Array(t))},array:function(t){return l(new Uint8Array(t),new Array(t.byteLength))},arraybuffer:o,uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return s(new Uint8Array(t))}},f.uint8array={string:h,array:function(t){return l(t,new Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:o,nodebuffer:function(t){return s(t)}},f.nodebuffer={string:h,array:function(t){return l(t,new Array(t.length))},arraybuffer:function(t){return f.nodebuffer.uint8array(t).buffer},uint8array:function(t){return l(t,new Uint8Array(t.length))},nodebuffer:o},e.transformTo=function(t,r){if(r||(r=""),!t)return r;e.checkSupport(t);var n=e.getTypeOf(r);return f[n][t](r)},e.getTypeOf=function(t){if(null!=t){if("string"==typeof t)return"string";var e=Object.prototype.toString.call(t);if("[object Array]"===e)return"array";if(i.nodebuffer&&s.test(t))return"nodebuffer";if(i.uint8array&&"[object Uint8Array]"===e)return"uint8array";if(i.arraybuffer&&"[object ArrayBuffer]"===e)return"arraybuffer";if("[object Promise]"===e)throw new Error("Cannot read data from a promise, you probably are running new PizZip(data) with a promise");if("object"===n(t)&&"function"==typeof t.file)throw new Error("Cannot read data from a pizzip instance, you probably are running new PizZip(zip) with a zipinstance");if("[object Date]"===e)throw new Error("Cannot read data from a Date, you probably are running new PizZip(data) with a date");if("object"===n(t)&&null==t.crc32)throw new Error("Unsupported data given to new PizZip(data) (object given)")}},e.checkSupport=function(t){if(!i[t.toLowerCase()])throw new Error(t+" is not supported by this browser")},e.MAX_VALUE_16BITS=65535,e.MAX_VALUE_32BITS=-1,e.pretty=function(t){var e,r,n="";for(r=0;r<(t||"").length;r++)n+="\\x"+((e=t.charCodeAt(r))<16?"0":"")+e.toString(16).toUpperCase();return n},e.findCompression=function(t){for(var e in a)if(a.hasOwnProperty(e)&&a[e].magic===t)return a[e];return null},e.isRegExp=function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},e.extend=function(){var t,e,r={};for(t=0;t<arguments.length;t++)for(e in arguments[t])arguments[t].hasOwnProperty(e)&&void 0===r[e]&&(r[e]=arguments[t][e]);return r}},474:(t,e)=>{"use strict";var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.encode=function(t){for(var e,n,i,a,s,o,d,h="",l=0;l<t.length;)a=(e=t.charCodeAt(l++))>>2,s=(3&e)<<4|(n=t.charCodeAt(l++))>>4,o=(15&n)<<2|(i=t.charCodeAt(l++))>>6,d=63&i,isNaN(n)?o=d=64:isNaN(i)&&(d=64),h=h+r.charAt(a)+r.charAt(s)+r.charAt(o)+r.charAt(d);return h},e.decode=function(t){var e,n,i,a,s,o,d="",h=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");h<t.length;)e=r.indexOf(t.charAt(h++))<<2|(a=r.indexOf(t.charAt(h++)))>>4,n=(15&a)<<4|(s=r.indexOf(t.charAt(h++)))>>2,i=(3&s)<<6|(o=r.indexOf(t.charAt(h++))),d+=String.fromCharCode(e),64!==s&&(d+=String.fromCharCode(n)),64!==o&&(d+=String.fromCharCode(i));return d}},501:(t,e,r)=>{"use strict";var n=r(474);function i(t,e){if(!(this instanceof i))return new i(t,e);this.files={},this.comment=null,this.root="",t&&this.load(t,e),this.clone=function(){var t=this,e=new i;return Object.keys(this.files).forEach((function(r){e.file(r,t.files[r].asUint8Array())})),e},this.shallowClone=function(){var t=new i;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t}}i.prototype=r(822),i.prototype.load=r(537),i.support=r(182),i.defaults=r(671),i.utils=r(284),i.base64={encode:function(t){return n.encode(t)},decode:function(t){return n.decode(t)}},i.compressions=r(538),t.exports=i,t.exports.default=i},511:(t,e,r)=>{"use strict";var n=r(210);function i(t){if(t){this.data=t,this.length=this.data.length,this.index=0,this.zero=0;for(var e=0;e<this.data.length;e++)t[e]&=t[e]}}i.prototype=new n,i.prototype.byteAt=function(t){return this.data[this.zero+t]},i.prototype.lastIndexOfSignature=function(t){for(var e=t.charCodeAt(0),r=t.charCodeAt(1),n=t.charCodeAt(2),i=t.charCodeAt(3),a=this.length-4;a>=0;--a)if(this.data[a]===e&&this.data[a+1]===r&&this.data[a+2]===n&&this.data[a+3]===i)return a-this.zero;return-1},i.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},t.exports=i},537:(t,e,r)=>{"use strict";var n=r(474),i=r(890),a=r(320),s=r(280);t.exports=function(t,e){var r,o;(e=a.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:i.utf8decode})).base64&&(t=n.decode(t));var d=new s(t,e),h=d.files;for(r=0;r<h.length;r++)o=h[r],this.file(o.fileNameStr,o.decompressed,{binary:!0,optimizedBinaryString:!0,date:o.date,dir:o.dir,comment:o.fileCommentStr.length?o.fileCommentStr:null,unixPermissions:o.unixPermissions,dosPermissions:o.dosPermissions,createFolders:e.createFolders});return d.zipComment.length&&(this.comment=d.zipComment),this}},538:(t,e,r)=>{"use strict";e.STORE={magic:"\0\0",compress:function(t){return t},uncompress:function(t){return t},compressInputType:null,uncompressInputType:null},e.DEFLATE=r(899)},671:(t,e)=>{"use strict";e.base64=!1,e.binary=!1,e.dir=!1,e.createFolders=!1,e.date=null,e.compression=null,e.compressionOptions=null,e.comment=null,e.unixPermissions=null,e.dosPermissions=null},822:(t,e,r)=>{"use strict";function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}var i=r(182),a=r(320),s=r(870),o=r(195),d=r(671),h=r(474),l=r(538),f=r(955),u=r(67),c=r(890),_=r(871),p=r(135);function m(t){if(t._data instanceof f&&(t._data=t._data.getContent(),t.options.binary=!0,t.options.base64=!1,"uint8array"===a.getTypeOf(t._data))){var e=t._data;t._data=new Uint8Array(e.length),0!==e.length&&t._data.set(e,0)}return t._data}function g(t){var e=m(t);return"string"===a.getTypeOf(e)?!t.options.binary&&i.nodebuffer?u(e,"utf-8"):t.asBinary():e}var w={load:function(){throw new Error("Load method is not defined. Is the file pizzip-load.js included ?")},filter:function(t){var e,r,n,i,s=[];for(e in this.files)this.files.hasOwnProperty(e)&&(i=new y((n=this.files[e]).name,n._data,a.extend(n.options)),r=e.slice(this.root.length,e.length),e.slice(0,this.root.length)===this.root&&t(r,i)&&s.push(i));return s},file:function(t,e,r){if(1===arguments.length){if(a.isRegExp(t)){var n=t;return this.filter((function(t,e){return!e.dir&&n.test(t)}))}return this.filter((function(e,r){return!r.dir&&e===t}))[0]||null}return t=this.root+t,x.call(this,t,e,r),this},folder:function(t){if(!t)return this;if(a.isRegExp(t))return this.filter((function(e,r){return r.dir&&t.test(e)}));var e=this.root+t,r=z.call(this,e),n=this.shallowClone();return n.root=r.name,n},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!==t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var r=this.filter((function(e,r){return r.name.slice(0,t.length)===t})),n=0;n<r.length;n++)delete this.files[r[n].name];return this},generate:function(t){t=a.extend(t||{},{base64:!0,compression:"STORE",compressionOptions:null,type:"base64",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:c.utf8encode}),a.checkSupport(t.type),"darwin"!==t.platform&&"freebsd"!==t.platform&&"linux"!==t.platform&&"sunos"!==t.platform||(t.platform="UNIX"),"win32"===t.platform&&(t.platform="DOS");var e,r,i=[],s=a.transformTo("string",t.encodeFileName(t.comment||this.comment||"")),d=0,f=0,u=[];for(var m in t.fileOrder instanceof Array&&(u=t.fileOrder),this.files)-1===u.indexOf(m)&&u.push(m);"function"==typeof t.fileOrder&&(u=t.fileOrder(this.files));var g,w,b=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return n(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0,a=function(){};return{s:a,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,o=!0,d=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return o=t.done,t},e:function(t){d=!0,s=t},f:function(){try{o||null==r.return||r.return()}finally{if(d)throw s}}}}(u);try{for(b.s();!(g=b.n()).done;){var y=g.value;if(this.files.hasOwnProperty(y)){var x=this.files[y],k=x.options.compression||t.compression.toUpperCase(),z=l[k];if(!z)throw new Error(k+" is not a valid compression method !");var C=x.options.compressionOptions||t.compressionOptions||{},S=A.call(this,x,z,C),O=E.call(this,y,x,S,d,t.platform,t.encodeFileName);d+=O.fileRecord.length+S.compressedSize,f+=O.dirRecord.length,i.push(O)}}}catch(t){b.e(t)}finally{b.f()}w=o.CENTRAL_DIRECTORY_END+"\0\0\0\0"+v(i.length,2)+v(i.length,2)+v(f,4)+v(d,4)+v(s.length,2)+s;var I=t.type.toLowerCase();for(e="uint8array"===I||"arraybuffer"===I||"blob"===I||"nodebuffer"===I?new p(d+f+w.length):new _(d+f+w.length),r=0;r<i.length;r++)e.append(i[r].fileRecord),e.append(i[r].compressedObject.compressedContent);for(r=0;r<i.length;r++)e.append(i[r].dirRecord);e.append(w);var T=e.finalize();switch(t.type.toLowerCase()){case"uint8array":case"arraybuffer":case"nodebuffer":return a.transformTo(t.type.toLowerCase(),T);case"blob":return a.arrayBuffer2Blob(a.transformTo("arraybuffer",T),t.mimeType);case"base64":return t.base64?h.encode(T):T;default:return T}},crc32:function(t,e){return s(t,e)},utf8encode:function(t){return a.transformTo("string",c.utf8encode(t))},utf8decode:function(t){return c.utf8decode(t)}};function b(t){var e=m(this);return null==e?"":(this.options.base64&&(e=h.decode(e)),e=t&&this.options.binary?w.utf8decode(e):a.transformTo("string",e),t||this.options.binary||(e=a.transformTo("string",w.utf8encode(e))),e)}function y(t,e,r){this.name=t,this.dir=r.dir,this.date=r.date,this.comment=r.comment,this.unixPermissions=r.unixPermissions,this.dosPermissions=r.dosPermissions,this._data=e,this.options=r,this._initialMetadata={dir:r.dir,date:r.date}}function v(t,e){var r,n="";for(r=0;r<e;r++)n+=String.fromCharCode(255&t),t>>>=8;return n}function x(t,e,r){var n,i=a.getTypeOf(e);if("string"==typeof(r=function(t){return!0!==(t=t||{}).base64||null!==t.binary&&void 0!==t.binary||(t.binary=!0),(t=a.extend(t,d)).date=t.date||new Date,null!==t.compression&&(t.compression=t.compression.toUpperCase()),t}(r)).unixPermissions&&(r.unixPermissions=parseInt(r.unixPermissions,8)),r.unixPermissions&&16384&r.unixPermissions&&(r.dir=!0),r.dosPermissions&&16&r.dosPermissions&&(r.dir=!0),r.dir&&(t=k(t)),r.createFolders&&(n=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return e>0?t.substring(0,e):""}(t))&&z.call(this,n,!0),r.dir||null==e)r.base64=!1,r.binary=!1,e=null,i=null;else if("string"===i)r.binary&&!r.base64&&!0!==r.optimizedBinaryString&&(e=a.string2binary(e));else{if(r.base64=!1,r.binary=!0,!(i||e instanceof f))throw new Error("The data of '"+t+"' is in an unsupported format !");"arraybuffer"===i&&(e=a.transformTo("uint8array",e))}var s=new y(t,e,r);return this.files[t]=s,s}function k(t){return"/"!==t.slice(-1)&&(t+="/"),t}function z(t,e){return e=void 0!==e&&e,t=k(t),this.files[t]||x.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]}function A(t,e,r){var n,i=new f;return t._data instanceof f?(i.uncompressedSize=t._data.uncompressedSize,i.crc32=t._data.crc32,0===i.uncompressedSize||t.dir?(e=l.STORE,i.compressedContent="",i.crc32=0):t._data.compressionMethod===e.magic?i.compressedContent=t._data.getCompressedContent():(n=t._data.getContent(),i.compressedContent=e.compress(a.transformTo(e.compressInputType,n),r))):((n=g(t))&&0!==n.length&&!t.dir||(e=l.STORE,n=""),i.uncompressedSize=n.length,i.crc32=s(n),i.compressedContent=e.compress(a.transformTo(e.compressInputType,n),r)),i.compressedSize=i.compressedContent.length,i.compressionMethod=e.magic,i}function E(t,e,r,n,i,d){var h,l,f,u,_=d!==c.utf8encode,p=a.transformTo("string",d(e.name)),m=a.transformTo("string",c.utf8encode(e.name)),g=e.comment||"",w=a.transformTo("string",d(g)),b=a.transformTo("string",c.utf8encode(g)),y=m.length!==e.name.length,x=b.length!==g.length,k=e.options,z="",A="",E="";f=e._initialMetadata.dir!==e.dir?e.dir:k.dir,u=e._initialMetadata.date!==e.date?e.date:k.date;var C,S,O=0,I=0;f&&(O|=16),"UNIX"===i?(I=798,O|=(S=C=e.unixPermissions,C||(S=f?16893:33204),(65535&S)<<16)):(I=20,O|=63&(e.dosPermissions||0)),h=u.getHours(),h<<=6,h|=u.getMinutes(),h<<=5,h|=u.getSeconds()/2,l=u.getFullYear()-1980,l<<=4,l|=u.getMonth()+1,l<<=5,l|=u.getDate(),y&&(A=v(1,1)+v(s(p),4)+m,z+="up"+v(A.length,2)+A),x&&(E=v(1,1)+v(this.crc32(w),4)+b,z+="uc"+v(E.length,2)+E);var T="";return T+="\n\0",T+=_||!y&&!x?"\0\0":"\0\b",T+=r.compressionMethod,T+=v(h,2),T+=v(l,2),T+=v(r.crc32,4),T+=v(r.compressedSize,4),T+=v(r.uncompressedSize,4),T+=v(p.length,2),T+=v(z.length,2),{fileRecord:o.LOCAL_FILE_HEADER+T+p+z,dirRecord:o.CENTRAL_FILE_HEADER+v(I,2)+T+v(w.length,2)+"\0\0\0\0"+v(O,4)+v(n,4)+p+z+w,compressedObject:r}}y.prototype={asText:function(){return b.call(this,!0)},asBinary:function(){return b.call(this,!1)},asNodeBuffer:function(){var t=g(this);return a.transformTo("nodebuffer",t)},asUint8Array:function(){var t=g(this);return a.transformTo("uint8array",t)},asArrayBuffer:function(){return this.asUint8Array().buffer}},t.exports=w},851:function(t,e){!function(t){"use strict";function e(t){for(var e=t.length;--e>=0;)t[e]=0}var r=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),n=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),i=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),a=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=new Array(576);e(s);var o=new Array(60);e(o);var d=new Array(512);e(d);var h=new Array(256);e(h);var l=new Array(29);e(l);var f,u,c,_=new Array(30);function p(t,e,r,n,i){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=t&&t.length}function m(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}e(_);var g=function(t){return t<256?d[t]:d[256+(t>>>7)]},w=function(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255},b=function(t,e,r){t.bi_valid>16-r?(t.bi_buf|=e<<t.bi_valid&65535,w(t,t.bi_buf),t.bi_buf=e>>16-t.bi_valid,t.bi_valid+=r-16):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)},y=function(t,e,r){b(t,r[2*e],r[2*e+1])},v=function(t,e){var r=0;do{r|=1&t,t>>>=1,r<<=1}while(--e>0);return r>>>1},x=function(t,e,r){var n,i,a=new Array(16),s=0;for(n=1;n<=15;n++)s=s+r[n-1]<<1,a[n]=s;for(i=0;i<=e;i++){var o=t[2*i+1];0!==o&&(t[2*i]=v(a[o]++,o))}},k=function(t){var e;for(e=0;e<286;e++)t.dyn_ltree[2*e]=0;for(e=0;e<30;e++)t.dyn_dtree[2*e]=0;for(e=0;e<19;e++)t.bl_tree[2*e]=0;t.dyn_ltree[512]=1,t.opt_len=t.static_len=0,t.sym_next=t.matches=0},z=function(t){t.bi_valid>8?w(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0},A=function(t,e,r,n){var i=2*e,a=2*r;return t[i]<t[a]||t[i]===t[a]&&n[e]<=n[r]},E=function(t,e,r){for(var n=t.heap[r],i=r<<1;i<=t.heap_len&&(i<t.heap_len&&A(e,t.heap[i+1],t.heap[i],t.depth)&&i++,!A(e,n,t.heap[i],t.depth));)t.heap[r]=t.heap[i],r=i,i<<=1;t.heap[r]=n},C=function(t,e,i){var a,s,o,d,f=0;if(0!==t.sym_next)do{a=255&t.pending_buf[t.sym_buf+f++],a+=(255&t.pending_buf[t.sym_buf+f++])<<8,s=t.pending_buf[t.sym_buf+f++],0===a?y(t,s,e):(o=h[s],y(t,o+256+1,e),0!==(d=r[o])&&(s-=l[o],b(t,s,d)),a--,o=g(a),y(t,o,i),0!==(d=n[o])&&(a-=_[o],b(t,a,d)))}while(f<t.sym_next);y(t,256,e)},S=function(t,e){var r,n,i,a=e.dyn_tree,s=e.stat_desc.static_tree,o=e.stat_desc.has_stree,d=e.stat_desc.elems,h=-1;for(t.heap_len=0,t.heap_max=573,r=0;r<d;r++)0!==a[2*r]?(t.heap[++t.heap_len]=h=r,t.depth[r]=0):a[2*r+1]=0;for(;t.heap_len<2;)a[2*(i=t.heap[++t.heap_len]=h<2?++h:0)]=1,t.depth[i]=0,t.opt_len--,o&&(t.static_len-=s[2*i+1]);for(e.max_code=h,r=t.heap_len>>1;r>=1;r--)E(t,a,r);i=d;do{r=t.heap[1],t.heap[1]=t.heap[t.heap_len--],E(t,a,1),n=t.heap[1],t.heap[--t.heap_max]=r,t.heap[--t.heap_max]=n,a[2*i]=a[2*r]+a[2*n],t.depth[i]=(t.depth[r]>=t.depth[n]?t.depth[r]:t.depth[n])+1,a[2*r+1]=a[2*n+1]=i,t.heap[1]=i++,E(t,a,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var r,n,i,a,s,o,d=e.dyn_tree,h=e.max_code,l=e.stat_desc.static_tree,f=e.stat_desc.has_stree,u=e.stat_desc.extra_bits,c=e.stat_desc.extra_base,_=e.stat_desc.max_length,p=0;for(a=0;a<=15;a++)t.bl_count[a]=0;for(d[2*t.heap[t.heap_max]+1]=0,r=t.heap_max+1;r<573;r++)(a=d[2*d[2*(n=t.heap[r])+1]+1]+1)>_&&(a=_,p++),d[2*n+1]=a,n>h||(t.bl_count[a]++,s=0,n>=c&&(s=u[n-c]),o=d[2*n],t.opt_len+=o*(a+s),f&&(t.static_len+=o*(l[2*n+1]+s)));if(0!==p){do{for(a=_-1;0===t.bl_count[a];)a--;t.bl_count[a]--,t.bl_count[a+1]+=2,t.bl_count[_]--,p-=2}while(p>0);for(a=_;0!==a;a--)for(n=t.bl_count[a];0!==n;)(i=t.heap[--r])>h||(d[2*i+1]!==a&&(t.opt_len+=(a-d[2*i+1])*d[2*i],d[2*i+1]=a),n--)}}(t,e),x(a,h,t.bl_count)},O=function(t,e,r){var n,i,a=-1,s=e[1],o=0,d=7,h=4;for(0===s&&(d=138,h=3),e[2*(r+1)+1]=65535,n=0;n<=r;n++)i=s,s=e[2*(n+1)+1],++o<d&&i===s||(o<h?t.bl_tree[2*i]+=o:0!==i?(i!==a&&t.bl_tree[2*i]++,t.bl_tree[32]++):o<=10?t.bl_tree[34]++:t.bl_tree[36]++,o=0,a=i,0===s?(d=138,h=3):i===s?(d=6,h=3):(d=7,h=4))},I=function(t,e,r){var n,i,a=-1,s=e[1],o=0,d=7,h=4;for(0===s&&(d=138,h=3),n=0;n<=r;n++)if(i=s,s=e[2*(n+1)+1],!(++o<d&&i===s)){if(o<h)do{y(t,i,t.bl_tree)}while(0!=--o);else 0!==i?(i!==a&&(y(t,i,t.bl_tree),o--),y(t,16,t.bl_tree),b(t,o-3,2)):o<=10?(y(t,17,t.bl_tree),b(t,o-3,3)):(y(t,18,t.bl_tree),b(t,o-11,7));o=0,a=i,0===s?(d=138,h=3):i===s?(d=6,h=3):(d=7,h=4)}},T=!1,R=function(t,e,r,n){b(t,0+(n?1:0),3),z(t),w(t,r),w(t,~r),r&&t.pending_buf.set(t.window.subarray(e,e+r),t.pending),t.pending+=r},D=function(t){T||(function(){var t,e,a,m,g,w=new Array(16);for(a=0,m=0;m<28;m++)for(l[m]=a,t=0;t<1<<r[m];t++)h[a++]=m;for(h[a-1]=m,g=0,m=0;m<16;m++)for(_[m]=g,t=0;t<1<<n[m];t++)d[g++]=m;for(g>>=7;m<30;m++)for(_[m]=g<<7,t=0;t<1<<n[m]-7;t++)d[256+g++]=m;for(e=0;e<=15;e++)w[e]=0;for(t=0;t<=143;)s[2*t+1]=8,t++,w[8]++;for(;t<=255;)s[2*t+1]=9,t++,w[9]++;for(;t<=279;)s[2*t+1]=7,t++,w[7]++;for(;t<=287;)s[2*t+1]=8,t++,w[8]++;for(x(s,287,w),t=0;t<30;t++)o[2*t+1]=5,o[2*t]=v(t,5);f=new p(s,r,257,286,15),u=new p(o,n,0,30,15),c=new p(new Array(0),i,0,19,7)}(),T=!0),t.l_desc=new m(t.dyn_ltree,f),t.d_desc=new m(t.dyn_dtree,u),t.bl_desc=new m(t.bl_tree,c),t.bi_buf=0,t.bi_valid=0,k(t)},U=R,B=function(t,e,r,n){var i,d,h=0;t.level>0?(2===t.strm.data_type&&(t.strm.data_type=function(t){var e,r=4093624447;for(e=0;e<=31;e++,r>>>=1)if(1&r&&0!==t.dyn_ltree[2*e])return 0;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return 1;for(e=32;e<256;e++)if(0!==t.dyn_ltree[2*e])return 1;return 0}(t)),S(t,t.l_desc),S(t,t.d_desc),h=function(t){var e;for(O(t,t.dyn_ltree,t.l_desc.max_code),O(t,t.dyn_dtree,t.d_desc.max_code),S(t,t.bl_desc),e=18;e>=3&&0===t.bl_tree[2*a[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),i=t.opt_len+3+7>>>3,(d=t.static_len+3+7>>>3)<=i&&(i=d)):i=d=r+5,r+4<=i&&-1!==e?R(t,e,r,n):4===t.strategy||d===i?(b(t,2+(n?1:0),3),C(t,s,o)):(b(t,4+(n?1:0),3),function(t,e,r,n){var i;for(b(t,e-257,5),b(t,r-1,5),b(t,n-4,4),i=0;i<n;i++)b(t,t.bl_tree[2*a[i]+1],3);I(t,t.dyn_ltree,e-1),I(t,t.dyn_dtree,r-1)}(t,t.l_desc.max_code+1,t.d_desc.max_code+1,h+1),C(t,t.dyn_ltree,t.dyn_dtree)),k(t),n&&z(t)},L=function(t,e,r){return t.pending_buf[t.sym_buf+t.sym_next++]=e,t.pending_buf[t.sym_buf+t.sym_next++]=e>>8,t.pending_buf[t.sym_buf+t.sym_next++]=r,0===e?t.dyn_ltree[2*r]++:(t.matches++,e--,t.dyn_ltree[2*(h[r]+256+1)]++,t.dyn_dtree[2*g(e)]++),t.sym_next===t.sym_end},Z=function(t){b(t,2,3),y(t,256,s),function(t){16===t.bi_valid?(w(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)},N=function(t,e,r,n){for(var i=65535&t,a=t>>>16&65535,s=0;0!==r;){r-=s=r>2e3?2e3:r;do{a=a+(i=i+e[n++]|0)|0}while(--s);i%=65521,a%=65521}return i|a<<16},F=new Uint32Array(function(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[r]=t}return e}()),M=function(t,e,r,n){var i=F,a=n+r;t^=-1;for(var s=n;s<a;s++)t=t>>>8^i[255&(t^e[s])];return~t},P={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},j={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8},H=D,X=U,Y=B,K=L,V=Z,W=j.Z_NO_FLUSH,G=j.Z_PARTIAL_FLUSH,q=j.Z_FULL_FLUSH,J=j.Z_FINISH,Q=j.Z_BLOCK,$=j.Z_OK,tt=j.Z_STREAM_END,et=j.Z_STREAM_ERROR,rt=j.Z_DATA_ERROR,nt=j.Z_BUF_ERROR,it=j.Z_DEFAULT_COMPRESSION,at=j.Z_FILTERED,st=j.Z_HUFFMAN_ONLY,ot=j.Z_RLE,dt=j.Z_FIXED,ht=j.Z_UNKNOWN,lt=j.Z_DEFLATED,ft=258,ut=262,ct=42,_t=113,pt=666,mt=function(t,e){return t.msg=P[e],e},gt=function(t){return 2*t-(t>4?9:0)},wt=function(t){for(var e=t.length;--e>=0;)t[e]=0},bt=function(t){var e,r,n,i=t.w_size;n=e=t.hash_size;do{r=t.head[--n],t.head[n]=r>=i?r-i:0}while(--e);n=e=i;do{r=t.prev[--n],t.prev[n]=r>=i?r-i:0}while(--e)},yt=function(t,e,r){return(e<<t.hash_shift^r)&t.hash_mask},vt=function(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(t.output.set(e.pending_buf.subarray(e.pending_out,e.pending_out+r),t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,0===e.pending&&(e.pending_out=0))},xt=function(t,e){Y(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,vt(t.strm)},kt=function(t,e){t.pending_buf[t.pending++]=e},zt=function(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e},At=function(t,e,r,n){var i=t.avail_in;return i>n&&(i=n),0===i?0:(t.avail_in-=i,e.set(t.input.subarray(t.next_in,t.next_in+i),r),1===t.state.wrap?t.adler=N(t.adler,e,i,r):2===t.state.wrap&&(t.adler=M(t.adler,e,i,r)),t.next_in+=i,t.total_in+=i,i)},Et=function(t,e){var r,n,i=t.max_chain_length,a=t.strstart,s=t.prev_length,o=t.nice_match,d=t.strstart>t.w_size-ut?t.strstart-(t.w_size-ut):0,h=t.window,l=t.w_mask,f=t.prev,u=t.strstart+ft,c=h[a+s-1],_=h[a+s];t.prev_length>=t.good_match&&(i>>=2),o>t.lookahead&&(o=t.lookahead);do{if(h[(r=e)+s]===_&&h[r+s-1]===c&&h[r]===h[a]&&h[++r]===h[a+1]){a+=2,r++;do{}while(h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&h[++a]===h[++r]&&a<u);if(n=ft-(u-a),a=u-ft,n>s){if(t.match_start=e,s=n,n>=o)break;c=h[a+s-1],_=h[a+s]}}}while((e=f[e&l])>d&&0!=--i);return s<=t.lookahead?s:t.lookahead},Ct=function(t){var e,r,n,i=t.w_size;do{if(r=t.window_size-t.lookahead-t.strstart,t.strstart>=i+(i-ut)&&(t.window.set(t.window.subarray(i,i+i-r),0),t.match_start-=i,t.strstart-=i,t.block_start-=i,t.insert>t.strstart&&(t.insert=t.strstart),bt(t),r+=i),0===t.strm.avail_in)break;if(e=At(t.strm,t.window,t.strstart+t.lookahead,r),t.lookahead+=e,t.lookahead+t.insert>=3)for(n=t.strstart-t.insert,t.ins_h=t.window[n],t.ins_h=yt(t,t.ins_h,t.window[n+1]);t.insert&&(t.ins_h=yt(t,t.ins_h,t.window[n+3-1]),t.prev[n&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=n,n++,t.insert--,!(t.lookahead+t.insert<3)););}while(t.lookahead<ut&&0!==t.strm.avail_in)},St=function(t,e){var r,n,i,a=t.pending_buf_size-5>t.w_size?t.w_size:t.pending_buf_size-5,s=0,o=t.strm.avail_in;do{if(r=65535,i=t.bi_valid+42>>3,t.strm.avail_out<i)break;if(i=t.strm.avail_out-i,r>(n=t.strstart-t.block_start)+t.strm.avail_in&&(r=n+t.strm.avail_in),r>i&&(r=i),r<a&&(0===r&&e!==J||e===W||r!==n+t.strm.avail_in))break;s=e===J&&r===n+t.strm.avail_in?1:0,X(t,0,0,s),t.pending_buf[t.pending-4]=r,t.pending_buf[t.pending-3]=r>>8,t.pending_buf[t.pending-2]=~r,t.pending_buf[t.pending-1]=~r>>8,vt(t.strm),n&&(n>r&&(n=r),t.strm.output.set(t.window.subarray(t.block_start,t.block_start+n),t.strm.next_out),t.strm.next_out+=n,t.strm.avail_out-=n,t.strm.total_out+=n,t.block_start+=n,r-=n),r&&(At(t.strm,t.strm.output,t.strm.next_out,r),t.strm.next_out+=r,t.strm.avail_out-=r,t.strm.total_out+=r)}while(0===s);return(o-=t.strm.avail_in)&&(o>=t.w_size?(t.matches=2,t.window.set(t.strm.input.subarray(t.strm.next_in-t.w_size,t.strm.next_in),0),t.strstart=t.w_size,t.insert=t.strstart):(t.window_size-t.strstart<=o&&(t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,t.insert>t.strstart&&(t.insert=t.strstart)),t.window.set(t.strm.input.subarray(t.strm.next_in-o,t.strm.next_in),t.strstart),t.strstart+=o,t.insert+=o>t.w_size-t.insert?t.w_size-t.insert:o),t.block_start=t.strstart),t.high_water<t.strstart&&(t.high_water=t.strstart),s?4:e!==W&&e!==J&&0===t.strm.avail_in&&t.strstart===t.block_start?2:(i=t.window_size-t.strstart,t.strm.avail_in>i&&t.block_start>=t.w_size&&(t.block_start-=t.w_size,t.strstart-=t.w_size,t.window.set(t.window.subarray(t.w_size,t.w_size+t.strstart),0),t.matches<2&&t.matches++,i+=t.w_size,t.insert>t.strstart&&(t.insert=t.strstart)),i>t.strm.avail_in&&(i=t.strm.avail_in),i&&(At(t.strm,t.window,t.strstart,i),t.strstart+=i,t.insert+=i>t.w_size-t.insert?t.w_size-t.insert:i),t.high_water<t.strstart&&(t.high_water=t.strstart),i=t.bi_valid+42>>3,a=(i=t.pending_buf_size-i>65535?65535:t.pending_buf_size-i)>t.w_size?t.w_size:i,((n=t.strstart-t.block_start)>=a||(n||e===J)&&e!==W&&0===t.strm.avail_in&&n<=i)&&(r=n>i?i:n,s=e===J&&0===t.strm.avail_in&&r===n?1:0,X(t,t.block_start,r,s),t.block_start+=r,vt(t.strm)),s?3:1)},Ot=function(t,e){for(var r,n;;){if(t.lookahead<ut){if(Ct(t),t.lookahead<ut&&e===W)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=yt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&&t.strstart-r<=t.w_size-ut&&(t.match_length=Et(t,r)),t.match_length>=3)if(n=K(t,t.strstart-t.match_start,t.match_length-3),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=3){t.match_length--;do{t.strstart++,t.ins_h=yt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart}while(0!=--t.match_length);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=yt(t,t.ins_h,t.window[t.strstart+1]);else n=K(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(xt(t,!1),0===t.strm.avail_out))return 1}return t.insert=t.strstart<2?t.strstart:2,e===J?(xt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(xt(t,!1),0===t.strm.avail_out)?1:2},It=function(t,e){for(var r,n,i;;){if(t.lookahead<ut){if(Ct(t),t.lookahead<ut&&e===W)return 1;if(0===t.lookahead)break}if(r=0,t.lookahead>=3&&(t.ins_h=yt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=2,0!==r&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-ut&&(t.match_length=Et(t,r),t.match_length<=5&&(t.strategy===at||3===t.match_length&&t.strstart-t.match_start>4096)&&(t.match_length=2)),t.prev_length>=3&&t.match_length<=t.prev_length){i=t.strstart+t.lookahead-3,n=K(t,t.strstart-1-t.prev_match,t.prev_length-3),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=i&&(t.ins_h=yt(t,t.ins_h,t.window[t.strstart+3-1]),r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart)}while(0!=--t.prev_length);if(t.match_available=0,t.match_length=2,t.strstart++,n&&(xt(t,!1),0===t.strm.avail_out))return 1}else if(t.match_available){if((n=K(t,0,t.window[t.strstart-1]))&&xt(t,!1),t.strstart++,t.lookahead--,0===t.strm.avail_out)return 1}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=K(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<2?t.strstart:2,e===J?(xt(t,!0),0===t.strm.avail_out?3:4):t.sym_next&&(xt(t,!1),0===t.strm.avail_out)?1:2};function Tt(t,e,r,n,i){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=i}var Rt=[new Tt(0,0,0,0,St),new Tt(4,4,8,4,Ot),new Tt(4,5,16,8,Ot),new Tt(4,6,32,32,Ot),new Tt(4,4,16,16,It),new Tt(8,16,32,32,It),new Tt(8,16,128,128,It),new Tt(8,32,128,256,It),new Tt(32,128,258,1024,It),new Tt(32,258,258,4096,It)];function Dt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=lt,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),wt(this.dyn_ltree),wt(this.dyn_dtree),wt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),wt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),wt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}var Ut=function(t){if(!t)return 1;var e=t.state;return!e||e.strm!==t||e.status!==ct&&57!==e.status&&69!==e.status&&73!==e.status&&91!==e.status&&103!==e.status&&e.status!==_t&&e.status!==pt?1:0},Bt=function(t){if(Ut(t))return mt(t,et);t.total_in=t.total_out=0,t.data_type=ht;var e=t.state;return e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=2===e.wrap?57:e.wrap?ct:_t,t.adler=2===e.wrap?0:1,e.last_flush=-2,H(e),$},Lt=function(t){var e,r=Bt(t);return r===$&&((e=t.state).window_size=2*e.w_size,wt(e.head),e.max_lazy_match=Rt[e.level].max_lazy,e.good_match=Rt[e.level].good_length,e.nice_match=Rt[e.level].nice_length,e.max_chain_length=Rt[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0),r},Zt=function(t,e,r,n,i,a){if(!t)return et;var s=1;if(e===it&&(e=6),n<0?(s=0,n=-n):n>15&&(s=2,n-=16),i<1||i>9||r!==lt||n<8||n>15||e<0||e>9||a<0||a>dt||8===n&&1!==s)return mt(t,et);8===n&&(n=9);var o=new Dt;return t.state=o,o.strm=t,o.status=ct,o.wrap=s,o.gzhead=null,o.w_bits=n,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=i+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<i+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=3*(o.lit_bufsize-1),o.level=e,o.strategy=a,o.method=r,Lt(t)},Nt=Zt,Ft=function(t,e){return Ut(t)||2!==t.state.wrap?et:(t.state.gzhead=e,$)},Mt=function(t,e){if(Ut(t)||e>Q||e<0)return t?mt(t,et):et;var r=t.state;if(!t.output||0!==t.avail_in&&!t.input||r.status===pt&&e!==J)return mt(t,0===t.avail_out?nt:et);var n=r.last_flush;if(r.last_flush=e,0!==r.pending){if(vt(t),0===t.avail_out)return r.last_flush=-1,$}else if(0===t.avail_in&>(e)<=gt(n)&&e!==J)return mt(t,nt);if(r.status===pt&&0!==t.avail_in)return mt(t,nt);if(r.status===ct&&0===r.wrap&&(r.status=_t),r.status===ct){var i=lt+(r.w_bits-8<<4)<<8;if(i|=(r.strategy>=st||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(i|=32),zt(r,i+=31-i%31),0!==r.strstart&&(zt(r,t.adler>>>16),zt(r,65535&t.adler)),t.adler=1,r.status=_t,vt(t),0!==r.pending)return r.last_flush=-1,$}if(57===r.status)if(t.adler=0,kt(r,31),kt(r,139),kt(r,8),r.gzhead)kt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),kt(r,255&r.gzhead.time),kt(r,r.gzhead.time>>8&255),kt(r,r.gzhead.time>>16&255),kt(r,r.gzhead.time>>24&255),kt(r,9===r.level?2:r.strategy>=st||r.level<2?4:0),kt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(kt(r,255&r.gzhead.extra.length),kt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=M(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69;else if(kt(r,0),kt(r,0),kt(r,0),kt(r,0),kt(r,0),kt(r,9===r.level?2:r.strategy>=st||r.level<2?4:0),kt(r,3),r.status=_t,vt(t),0!==r.pending)return r.last_flush=-1,$;if(69===r.status){if(r.gzhead.extra){for(var a=r.pending,s=(65535&r.gzhead.extra.length)-r.gzindex;r.pending+s>r.pending_buf_size;){var o=r.pending_buf_size-r.pending;if(r.pending_buf.set(r.gzhead.extra.subarray(r.gzindex,r.gzindex+o),r.pending),r.pending=r.pending_buf_size,r.gzhead.hcrc&&r.pending>a&&(t.adler=M(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex+=o,vt(t),0!==r.pending)return r.last_flush=-1,$;a=0,s-=o}var d=new Uint8Array(r.gzhead.extra);r.pending_buf.set(d.subarray(r.gzindex,r.gzindex+s),r.pending),r.pending+=s,r.gzhead.hcrc&&r.pending>a&&(t.adler=M(t.adler,r.pending_buf,r.pending-a,a)),r.gzindex=0}r.status=73}if(73===r.status){if(r.gzhead.name){var h,l=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>l&&(t.adler=M(t.adler,r.pending_buf,r.pending-l,l)),vt(t),0!==r.pending)return r.last_flush=-1,$;l=0}h=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,kt(r,h)}while(0!==h);r.gzhead.hcrc&&r.pending>l&&(t.adler=M(t.adler,r.pending_buf,r.pending-l,l)),r.gzindex=0}r.status=91}if(91===r.status){if(r.gzhead.comment){var f,u=r.pending;do{if(r.pending===r.pending_buf_size){if(r.gzhead.hcrc&&r.pending>u&&(t.adler=M(t.adler,r.pending_buf,r.pending-u,u)),vt(t),0!==r.pending)return r.last_flush=-1,$;u=0}f=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,kt(r,f)}while(0!==f);r.gzhead.hcrc&&r.pending>u&&(t.adler=M(t.adler,r.pending_buf,r.pending-u,u))}r.status=103}if(103===r.status){if(r.gzhead.hcrc){if(r.pending+2>r.pending_buf_size&&(vt(t),0!==r.pending))return r.last_flush=-1,$;kt(r,255&t.adler),kt(r,t.adler>>8&255),t.adler=0}if(r.status=_t,vt(t),0!==r.pending)return r.last_flush=-1,$}if(0!==t.avail_in||0!==r.lookahead||e!==W&&r.status!==pt){var c=0===r.level?St(r,e):r.strategy===st?function(t,e){for(var r;;){if(0===t.lookahead&&(Ct(t),0===t.lookahead)){if(e===W)return 1;break}if(t.match_