pizzip
Version:
Create, read and edit .zip files synchronously with Javascript
8 lines • 101 kB
JavaScript
window.PizZip=function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=22)}([function(t,e,r){"use strict";var n=r(2),i=r(4),a=r(6);function s(t){return t}function o(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,s=e.getTypeOf(t),o=0,h=!0;try{switch(s){case"uint8array":String.fromCharCode.apply(null,new Uint8Array(0));break;case"nodebuffer":String.fromCharCode.apply(null,a(0))}}catch(t){h=!1}if(!h){for(var f="",u=0;u<t.length;u++)f+=String.fromCharCode(t[u]);return f}for(;o<i&&r>1;)try{"array"===s||"nodebuffer"===s?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 f(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 u={};u.string={string:s,array:function(t){return o(t,new Array(t.length))},arraybuffer:function(t){return u.string.uint8array(t).buffer},uint8array:function(t){return o(t,new Uint8Array(t.length))},nodebuffer:function(t){return o(t,a(t.length))}},u.array={string:h,array:s,arraybuffer:function(t){return new Uint8Array(t).buffer},uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return a(t)}},u.arraybuffer={string:function(t){return h(new Uint8Array(t))},array:function(t){return f(new Uint8Array(t),new Array(t.byteLength))},arraybuffer:s,uint8array:function(t){return new Uint8Array(t)},nodebuffer:function(t){return a(new Uint8Array(t))}},u.uint8array={string:h,array:function(t){return f(t,new Array(t.length))},arraybuffer:function(t){return t.buffer},uint8array:s,nodebuffer:function(t){return a(t)}},u.nodebuffer={string:h,array:function(t){return f(t,new Array(t.length))},arraybuffer:function(t){return u.nodebuffer.uint8array(t).buffer},uint8array:function(t){return f(t,new Uint8Array(t.length))},nodebuffer:s},e.transformTo=function(t,r){if(r||(r=""),!t)return r;e.checkSupport(t);var n=e.getTypeOf(r);return u[n][t](r)},e.getTypeOf=function(t){return"string"==typeof t?"string":"[object Array]"===Object.prototype.toString.call(t)?"array":n.nodebuffer&&a.test(t)?"nodebuffer":n.uint8array&&t instanceof Uint8Array?"uint8array":n.arraybuffer&&t instanceof ArrayBuffer?"arraybuffer":void 0},e.checkSupport=function(t){if(!n[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 i)if(i.hasOwnProperty(e)&&i[e].magic===t)return i[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}},function(t,e,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function i(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var n in r)i(r,n)&&(t[n]=r[n])}}return t},e.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var a={arraySet:function(t,e,r,n,i){if(e.subarray&&t.subarray)t.set(e.subarray(r,r+n),i);else for(var a=0;a<n;a++)t[i+a]=e[r+a]},flattenChunks:function(t){var e,r,n,i,a,s;for(n=0,e=0,r=t.length;e<r;e++)n+=t[e].length;for(s=new Uint8Array(n),i=0,e=0,r=t.length;e<r;e++)a=t[e],s.set(a,i),i+=a.length;return s}},s={arraySet:function(t,e,r,n,i){for(var a=0;a<n;a++)t[i+a]=e[r+a]},flattenChunks:function(t){return[].concat.apply([],t)}};e.setTyped=function(t){t?(e.Buf8=Uint8Array,e.Buf16=Uint16Array,e.Buf32=Int32Array,e.assign(e,a)):(e.Buf8=Array,e.Buf16=Array,e.Buf32=Array,e.assign(e,s))},e.setTyped(n)},function(t,e,r){"use strict";(function(t){if(e.base64=!0,e.array=!0,e.string=!0,e.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,e.nodebuffer=void 0!==t,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}}}}).call(this,r(8).Buffer)},function(t,e,r){"use strict";var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.encode=function(t){for(var e,r,i,a,s,o,h,f="",u=0;u<t.length;)a=(e=t.charCodeAt(u++))>>2,s=(3&e)<<4|(r=t.charCodeAt(u++))>>4,o=(15&r)<<2|(i=t.charCodeAt(u++))>>6,h=63&i,isNaN(r)?o=h=64:isNaN(i)&&(h=64),f=f+n.charAt(a)+n.charAt(s)+n.charAt(o)+n.charAt(h);return f},e.decode=function(t){var e,r,i,a,s,o,h="",f=0;for(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"");f<t.length;)e=n.indexOf(t.charAt(f++))<<2|(a=n.indexOf(t.charAt(f++)))>>4,r=(15&a)<<4|(s=n.indexOf(t.charAt(f++)))>>2,i=(3&s)<<6|(o=n.indexOf(t.charAt(f++))),h+=String.fromCharCode(e),64!==s&&(h+=String.fromCharCode(r)),64!==o&&(h+=String.fromCharCode(i));return h}},function(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(27)},function(t,e,r){"use strict";t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},function(t,e,r){"use strict";(function(e){t.exports=function(t,r){return new e(t,r)},t.exports.test=function(t){return e.isBuffer(t)}}).call(this,r(8).Buffer)},function(t,e,r){"use strict";var n=r(2),i=r(0),a=r(37),s=r(14),o=r(15),h=r(3),f=r(4),u=r(16),l=r(6),d=r(17),c=r(38),p=r(39);function _(t){if(t._data instanceof u&&(t._data=t._data.getContent(),t.options.binary=!0,t.options.base64=!1,"uint8array"===i.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=_(t);return"string"===i.getTypeOf(e)?!t.options.binary&&n.nodebuffer?l(e,"utf-8"):t.asBinary():e}var m={load:function(){throw new Error("Load method is not defined. Is the file pizzip-load.js included ?")},filter:function(t){var e,r,n,a,s=[];for(e in this.files)this.files.hasOwnProperty(e)&&(a=new b((n=this.files[e]).name,n._data,i.extend(n.options)),r=e.slice(this.root.length,e.length),e.slice(0,this.root.length)===this.root&&t(r,a)&&s.push(a));return s},file:function(t,e,r){if(1===arguments.length){if(i.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,v.call(this,t,e,r),this},folder:function(t){if(!t)return this;if(i.isRegExp(t))return this.filter(function(e,r){return r.dir&&t.test(e)});var e=this.root+t,r=x.call(this,e),n=this.clone();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=i.extend(t||{},{base64:!0,compression:"STORE",compressionOptions:null,type:"base64",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:d.utf8encode}),i.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,n=[],a=i.transformTo("string",t.encodeFileName(t.comment||this.comment||"")),o=0,u=0;for(var l in this.files)if(this.files.hasOwnProperty(l)){var _=this.files[l],g=_.options.compression||t.compression.toUpperCase(),m=f[g];if(!m)throw new Error(g+" is not a valid compression method !");var w=_.options.compressionOptions||t.compressionOptions||{},b=E.call(this,_,m,w),v=A.call(this,l,_,b,o,t.platform,t.encodeFileName);o+=v.fileRecord.length+b.compressedSize,u+=v.dirRecord.length,n.push(v)}var k;k=s.CENTRAL_DIRECTORY_END+"\0\0\0\0"+y(n.length,2)+y(n.length,2)+y(u,4)+y(o,4)+y(a.length,2)+a;var x=t.type.toLowerCase();for(e="uint8array"===x||"arraybuffer"===x||"blob"===x||"nodebuffer"===x?new p(o+u+k.length):new c(o+u+k.length),r=0;r<n.length;r++)e.append(n[r].fileRecord),e.append(n[r].compressedObject.compressedContent);for(r=0;r<n.length;r++)e.append(n[r].dirRecord);e.append(k);var S=e.finalize();switch(t.type.toLowerCase()){case"uint8array":case"arraybuffer":case"nodebuffer":return i.transformTo(t.type.toLowerCase(),S);case"blob":return i.arrayBuffer2Blob(i.transformTo("arraybuffer",S),t.mimeType);case"base64":return t.base64?h.encode(S):S;default:return S}},crc32:function(t,e){return a(t,e)},utf8encode:function(t){return i.transformTo("string",d.utf8encode(t))},utf8decode:function(t){return d.utf8decode(t)}};function w(t){var e=_(this);return null==e?"":(this.options.base64&&(e=h.decode(e)),e=t&&this.options.binary?m.utf8decode(e):i.transformTo("string",e),t||this.options.binary||(e=i.transformTo("string",m.utf8encode(e))),e)}function b(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 y(t,e){var r,n="";for(r=0;r<e;r++)n+=String.fromCharCode(255&t),t>>>=8;return n}function v(t,e,r){var n,a=i.getTypeOf(e);if("string"==typeof(r=function(t){return!0!==(t=t||{}).base64||null!==t.binary&&void 0!==t.binary||(t.binary=!0),(t=i.extend(t,o)).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))&&x.call(this,n,!0),r.dir||null==e)r.base64=!1,r.binary=!1,e=null,a=null;else if("string"===a)r.binary&&!r.base64&&!0!==r.optimizedBinaryString&&(e=i.string2binary(e));else{if(r.base64=!1,r.binary=!0,!(a||e instanceof u))throw new Error("The data of '"+t+"' is in an unsupported format !");"arraybuffer"===a&&(e=i.transformTo("uint8array",e))}var s=new b(t,e,r);return this.files[t]=s,s}function k(t){return"/"!==t.slice(-1)&&(t+="/"),t}function x(t,e){return e=void 0!==e&&e,t=k(t),this.files[t]||v.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]}function E(t,e,r){var n,s=new u;return t._data instanceof u?(s.uncompressedSize=t._data.uncompressedSize,s.crc32=t._data.crc32,0===s.uncompressedSize||t.dir?(e=f.STORE,s.compressedContent="",s.crc32=0):t._data.compressionMethod===e.magic?s.compressedContent=t._data.getCompressedContent():(n=t._data.getContent(),s.compressedContent=e.compress(i.transformTo(e.compressInputType,n),r))):((n=g(t))&&0!==n.length&&!t.dir||(e=f.STORE,n=""),s.uncompressedSize=n.length,s.crc32=a(n),s.compressedContent=e.compress(i.transformTo(e.compressInputType,n),r)),s.compressedSize=s.compressedContent.length,s.compressionMethod=e.magic,s}function A(t,e,r,n,o,h){var f,u,l,c,p=h!==d.utf8encode,_=i.transformTo("string",h(e.name)),g=i.transformTo("string",d.utf8encode(e.name)),m=e.comment||"",w=i.transformTo("string",h(m)),b=i.transformTo("string",d.utf8encode(m)),v=g.length!==e.name.length,k=b.length!==m.length,x=e.options,E="",A="",S="";l=e._initialMetadata.dir!==e.dir?e.dir:x.dir,c=e._initialMetadata.date!==e.date?e.date:x.date;var C,z,B,T=0,R=0;l&&(T|=16),"UNIX"===o?(R=798,T|=(C=e.unixPermissions,z=l,B=C,C||(B=z?16893:33204),(65535&B)<<16)):(R=20,T|=63&(e.dosPermissions||0)),f=c.getHours(),f<<=6,f|=c.getMinutes(),f<<=5,f|=c.getSeconds()/2,u=c.getFullYear()-1980,u<<=4,u|=c.getMonth()+1,u<<=5,u|=c.getDate(),v&&(A=y(1,1)+y(a(_),4)+g,E+="up"+y(A.length,2)+A),k&&(S=y(1,1)+y(this.crc32(w),4)+b,E+="uc"+y(S.length,2)+S);var I="";return I+="\n\0",I+=p||!v&&!k?"\0\0":"\0\b",I+=r.compressionMethod,I+=y(f,2),I+=y(u,2),I+=y(r.crc32,4),I+=y(r.compressedSize,4),I+=y(r.uncompressedSize,4),I+=y(_.length,2),I+=y(E.length,2),{fileRecord:s.LOCAL_FILE_HEADER+I+_+E,dirRecord:s.CENTRAL_FILE_HEADER+y(R,2)+I+y(w.length,2)+"\0\0\0\0"+y(T,4)+y(n,4)+_+E+w,compressedObject:r}}b.prototype={asText:function(){return w.call(this,!0)},asBinary:function(){return w.call(this,!1)},asNodeBuffer:function(){var t=g(this);return i.transformTo("nodebuffer",t)},asUint8Array:function(){var t=g(this);return i.transformTo("uint8array",t)},asArrayBuffer:function(){return this.asUint8Array().buffer}},t.exports=m},function(t,e,r){"use strict";(function(t){
/*!
* The buffer module from node.js, for the browser.
*
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
* @license MIT
*/
var n=r(24),i=r(25),a=r(26);function s(){return h.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function o(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return h.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=h.prototype:(null===t&&(t=new h(e)),t.length=e),t}function h(t,e,r){if(!(h.TYPED_ARRAY_SUPPORT||this instanceof h))return new h(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return l(this,t)}return f(this,t,e,r)}function f(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);h.TYPED_ARRAY_SUPPORT?(t=e).__proto__=h.prototype:t=d(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!h.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|p(e,r),i=(t=o(t,n)).write(e,r);i!==n&&(t=t.slice(0,i));return t}(t,e,r):function(t,e){if(h.isBuffer(e)){var r=0|c(e.length);return 0===(t=o(t,r)).length?t:(e.copy(t,0,0,r),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?o(t,0):d(t,e);if("Buffer"===e.type&&a(e.data))return d(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function l(t,e){if(u(e),t=o(t,e<0?0:0|c(e)),!h.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function d(t,e){var r=e.length<0?0:0|c(e.length);t=o(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function c(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function p(t,e){if(h.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Z(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Y(t).length;default:if(n)return Z(t).length;e=(""+e).toLowerCase(),n=!0}}function _(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return T(this,e,r);case"utf8":case"utf-8":return S(this,e,r);case"ascii":return z(this,e,r);case"latin1":case"binary":return B(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return R(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function g(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=h.from(e,n)),h.isBuffer(e))return 0===e.length?-1:w(t,e,r,n,i);if("number"==typeof e)return e&=255,h.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):w(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(t,e,r,n,i){var a,s=1,o=t.length,h=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,o/=2,h/=2,r/=2}function f(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var u=-1;for(a=r;a<o;a++)if(f(t,a)===f(e,-1===u?0:a-u)){if(-1===u&&(u=a),a-u+1===h)return u*s}else-1!==u&&(a-=a-u),u=-1}else for(r+h>o&&(r=o-h),a=r;a>=0;a--){for(var l=!0,d=0;d<h;d++)if(f(t,a+d)!==f(e,d)){l=!1;break}if(l)return a}return-1}function b(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a=e.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var s=0;s<n;++s){var o=parseInt(e.substr(2*s,2),16);if(isNaN(o))return s;t[r+s]=o}return s}function y(t,e,r,n){return j(Z(e,t.length-r),t,r,n)}function v(t,e,r,n){return j(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function k(t,e,r,n){return v(t,e,r,n)}function x(t,e,r,n){return j(Y(e),t,r,n)}function E(t,e,r,n){return j(function(t,e){for(var r,n,i,a=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function A(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function S(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var a,s,o,h,f=t[i],u=null,l=f>239?4:f>223?3:f>191?2:1;if(i+l<=r)switch(l){case 1:f<128&&(u=f);break;case 2:128==(192&(a=t[i+1]))&&(h=(31&f)<<6|63&a)>127&&(u=h);break;case 3:a=t[i+1],s=t[i+2],128==(192&a)&&128==(192&s)&&(h=(15&f)<<12|(63&a)<<6|63&s)>2047&&(h<55296||h>57343)&&(u=h);break;case 4:a=t[i+1],s=t[i+2],o=t[i+3],128==(192&a)&&128==(192&s)&&128==(192&o)&&(h=(15&f)<<18|(63&a)<<12|(63&s)<<6|63&o)>65535&&h<1114112&&(u=h)}null===u?(u=65533,l=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=l}return function(t){var e=t.length;if(e<=C)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=C));return r}(n)}e.Buffer=h,e.SlowBuffer=function(t){+t!=t&&(t=0);return h.alloc(+t)},e.INSPECT_MAX_BYTES=50,h.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),h.poolSize=8192,h._augment=function(t){return t.__proto__=h.prototype,t},h.from=function(t,e,r){return f(null,t,e,r)},h.TYPED_ARRAY_SUPPORT&&(h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0})),h.alloc=function(t,e,r){return function(t,e,r,n){return u(e),e<=0?o(t,e):void 0!==r?"string"==typeof n?o(t,e).fill(r,n):o(t,e).fill(r):o(t,e)}(null,t,e,r)},h.allocUnsafe=function(t){return l(null,t)},h.allocUnsafeSlow=function(t){return l(null,t)},h.isBuffer=function(t){return!(null==t||!t._isBuffer)},h.compare=function(t,e){if(!h.isBuffer(t)||!h.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,i=0,a=Math.min(r,n);i<a;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},h.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},h.concat=function(t,e){if(!a(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return h.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=h.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var s=t[r];if(!h.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i),i+=s.length}return n},h.byteLength=p,h.prototype._isBuffer=!0,h.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)g(this,e,e+1);return this},h.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)g(this,e,e+3),g(this,e+1,e+2);return this},h.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)g(this,e,e+7),g(this,e+1,e+6),g(this,e+2,e+5),g(this,e+3,e+4);return this},h.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?S(this,0,t):_.apply(this,arguments)},h.prototype.equals=function(t){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===h.compare(this,t)},h.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},h.prototype.compare=function(t,e,r,n,i){if(!h.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var a=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),o=Math.min(a,s),f=this.slice(n,i),u=t.slice(e,r),l=0;l<o;++l)if(f[l]!==u[l]){a=f[l],s=u[l];break}return a<s?-1:s<a?1:0},h.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},h.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},h.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},h.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return y(this,t,e,r);case"ascii":return v(this,t,e,r);case"latin1":case"binary":return k(this,t,e,r);case"base64":return x(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function z(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function B(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function T(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=e;a<r;++a)i+=F(t[a]);return i}function R(t,e,r){for(var n=t.slice(e,r),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function I(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function O(t,e,r,n,i,a){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<a)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function D(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,a=Math.min(t.length-r,2);i<a;++i)t[r+i]=(e&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function U(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,a=Math.min(t.length-r,4);i<a;++i)t[r+i]=e>>>8*(n?i:3-i)&255}function P(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function L(t,e,r,n,a){return a||P(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function N(t,e,r,n,a){return a||P(t,0,r,8),i.write(t,e,r,n,52,8),r+8}h.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),h.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=h.prototype;else{var i=e-t;r=new h(i,void 0);for(var a=0;a<i;++a)r[a]=this[a+t]}return r},h.prototype.readUIntLE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return n},h.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},h.prototype.readUInt8=function(t,e){return e||I(t,1,this.length),this[t]},h.prototype.readUInt16LE=function(t,e){return e||I(t,2,this.length),this[t]|this[t+1]<<8},h.prototype.readUInt16BE=function(t,e){return e||I(t,2,this.length),this[t]<<8|this[t+1]},h.prototype.readUInt32LE=function(t,e){return e||I(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},h.prototype.readUInt32BE=function(t,e){return e||I(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},h.prototype.readIntLE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var n=this[t],i=1,a=0;++a<e&&(i*=256);)n+=this[t+a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},h.prototype.readIntBE=function(t,e,r){t|=0,e|=0,r||I(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*e)),a},h.prototype.readInt8=function(t,e){return e||I(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},h.prototype.readInt16LE=function(t,e){e||I(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt16BE=function(t,e){e||I(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},h.prototype.readInt32LE=function(t,e){return e||I(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},h.prototype.readInt32BE=function(t,e){return e||I(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},h.prototype.readFloatLE=function(t,e){return e||I(t,4,this.length),i.read(this,t,!0,23,4)},h.prototype.readFloatBE=function(t,e){return e||I(t,4,this.length),i.read(this,t,!1,23,4)},h.prototype.readDoubleLE=function(t,e){return e||I(t,8,this.length),i.read(this,t,!0,52,8)},h.prototype.readDoubleBE=function(t,e){return e||I(t,8,this.length),i.read(this,t,!1,52,8)},h.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||O(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[e]=255&t;++a<r&&(i*=256);)this[e+a]=t/i&255;return e+r},h.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||O(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},h.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,1,255,0),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},h.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):D(this,t,e,!0),e+2},h.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,65535,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):D(this,t,e,!1),e+2},h.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):U(this,t,e,!0),e+4},h.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,4294967295,0),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):U(this,t,e,!1),e+4},h.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var a=0,s=1,o=0;for(this[e]=255&t;++a<r&&(s*=256);)t<0&&0===o&&0!==this[e+a-1]&&(o=1),this[e+a]=(t/s>>0)-o&255;return e+r},h.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);O(this,t,e,r,i-1,-i)}var a=r-1,s=1,o=0;for(this[e+a]=255&t;--a>=0&&(s*=256);)t<0&&0===o&&0!==this[e+a+1]&&(o=1),this[e+a]=(t/s>>0)-o&255;return e+r},h.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,1,127,-128),h.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},h.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):D(this,t,e,!0),e+2},h.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,2,32767,-32768),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):D(this,t,e,!1),e+2},h.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,2147483647,-2147483648),h.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):U(this,t,e,!0),e+4},h.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||O(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),h.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):U(this,t,e,!1),e+4},h.prototype.writeFloatLE=function(t,e,r){return L(this,t,e,!0,r)},h.prototype.writeFloatBE=function(t,e,r){return L(this,t,e,!1,r)},h.prototype.writeDoubleLE=function(t,e,r){return N(this,t,e,!0,r)},h.prototype.writeDoubleBE=function(t,e,r){return N(this,t,e,!1,r)},h.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i,a=n-r;if(this===t&&r<e&&e<n)for(i=a-1;i>=0;--i)t[i+e]=this[i+r];else if(a<1e3||!h.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+a),e);return a},h.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!h.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var a;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(a=e;a<r;++a)this[a]=t;else{var s=h.isBuffer(t)?t:Z(new h(t,n).toString()),o=s.length;for(a=0;a<r-e;++a)this[a+e]=s[a%o]}return this};var M=/[^+\/0-9A-Za-z-_]/g;function F(t){return t<16?"0"+t.toString(16):t.toString(16)}function Z(t,e){var r;e=e||1/0;for(var n=t.length,i=null,a=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function Y(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(M,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function j(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(23))},function(t,e,r){"use strict";t.exports=function(t,e,r,n){for(var i=65535&t|0,a=t>>>16&65535|0,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|0}},function(t,e,r){"use strict";var n=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}();t.exports=function(t,e,r,i){var a=n,s=i+r;t^=-1;for(var o=i;o<s;o++)t=t>>>8^a[255&(t^e[o])];return-1^t}},function(t,e,r){"use strict";var n=r(1),i=!0,a=!0;try{String.fromCharCode.apply(null,[0])}catch(t){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){a=!1}for(var s=new n.Buf8(256),o=0;o<256;o++)s[o]=o>=252?6:o>=248?5:o>=240?4:o>=224?3:o>=192?2:1;function h(t,e){if(e<65534&&(t.subarray&&a||!t.subarray&&i))return String.fromCharCode.apply(null,n.shrinkBuf(t,e));for(var r="",s=0;s<e;s++)r+=String.fromCharCode(t[s]);return r}s[254]=s[254]=1,e.string2buf=function(t){var e,r,i,a,s,o=t.length,h=0;for(a=0;a<o;a++)55296==(64512&(r=t.charCodeAt(a)))&&a+1<o&&56320==(64512&(i=t.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(i-56320),a++),h+=r<128?1:r<2048?2:r<65536?3:4;for(e=new n.Buf8(h),s=0,a=0;s<h;a++)55296==(64512&(r=t.charCodeAt(a)))&&a+1<o&&56320==(64512&(i=t.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(i-56320),a++),r<128?e[s++]=r:r<2048?(e[s++]=192|r>>>6,e[s++]=128|63&r):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|63&r):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|63&r);return e},e.buf2binstring=function(t){return h(t,t.length)},e.binstring2buf=function(t){for(var e=new n.Buf8(t.length),r=0,i=e.length;r<i;r++)e[r]=t.charCodeAt(r);return e},e.buf2string=function(t,e){var r,n,i,a,o=e||t.length,f=new Array(2*o);for(n=0,r=0;r<o;)if((i=t[r++])<128)f[n++]=i;else if((a=s[i])>4)f[n++]=65533,r+=a-1;else{for(i&=2===a?31:3===a?15:7;a>1&&r<o;)i=i<<6|63&t[r++],a--;a>1?f[n++]=65533:i<65536?f[n++]=i:(i-=65536,f[n++]=55296|i>>10&1023,f[n++]=56320|1023&i)}return h(f,n)},e.utf8border=function(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;r>=0&&128==(192&t[r]);)r--;return r<0?e:0===r?e:r+s[t[r]]>e?r:e}},function(t,e,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}},function(t,e,r){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(t,e,r){"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"},function(t,e,r){"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},function(t,e,r){"use strict";function n(){this.compressedSize=0,this.uncompressedSize=0,this.crc32=0,this.compressionMethod=null,this.compressedContent=null}n.prototype={getContent:function(){return null},getCompressedContent:function(){return null}},t.exports=n},function(t,e,r){"use strict";for(var n=r(0),i=r(2),a=r(6),s=new Array(256),o=0;o<256;o++)s[o]=o>=252?6:o>=248?5:o>=240?4:o>=224?3:o>=192?2:1;function h(t,e){var r;for((e=e||t.length)>t.length&&(e=t.length),r=e-1;r>=0&&128==(192&t[r]);)r--;return r<0?e:0===r?e:r+s[t[r]]>e?r:e}function f(t){var e,r,i,a,o=t.length,h=new Array(2*o);for(r=0,e=0;e<o;)if((i=t[e++])<128)h[r++]=i;else if((a=s[i])>4)h[r++]=65533,e+=a-1;else{for(i&=2===a?31:3===a?15:7;a>1&&e<o;)i=i<<6|63&t[e++],a--;a>1?h[r++]=65533:i<65536?h[r++]=i:(i-=65536,h[r++]=55296|i>>10&1023,h[r++]=56320|1023&i)}return h.length!==r&&(h.subarray?h=h.subarray(0,r):h.length=r),n.applyFromCharCode(h)}s[254]=s[254]=1,e.utf8encode=function(t){return i.nodebuffer?a(t,"utf-8"):function(t){var e,r,n,a,s,o=0,h=t.length;for(a=0;a<h;a++)55296==(64512&(r=t.charCodeAt(a)))&&a+1<h&&56320==(64512&(n=t.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(n-56320),a++),o+=r<128?1:r<2048?2:r<65536?3:4;for(e=i.uint8array?new Uint8Array(o):new Array(o),s=0,a=0;s<o;a++)55296==(64512&(r=t.charCodeAt(a)))&&a+1<h&&56320==(64512&(n=t.charCodeAt(a+1)))&&(r=65536+(r-55296<<10)+(n-56320),a++),r<128?e[s++]=r:r<2048?(e[s++]=192|r>>>6,e[s++]=128|63&r):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|63&r):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|63&r);return e}(t)},e.utf8decode=function(t){if(i.nodebuffer)return n.transformTo("nodebuffer",t).toString("utf-8");for(var e=[],r=(t=n.transformTo(i.uint8array?"uint8array":"array",t)).length,a=0;a<r;){var s=h(t,Math.min(a+65536,r));i.uint8array?e.push(f(t.subarray(a,s))):e.push(f(t.slice(a,s))),a=s}return e.join("")}},function(t,e,r){"use strict";var n=r(19),i=r(0);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},function(t,e,r){"use strict";var n=r(0);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},function(t,e,r){"use strict";var n=r(21);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},function(t,e,r){"use strict";var n=r(19);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},function(t,e,r){"use strict";var n=r(3);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=new i;for(var e in this)"function"!=typeof this[e]&&(t[e]=this[e]);return t}}i.prototype=r(7),i.prototype.load=r(40),i.support=r(2),i.defaults=r(15),i.utils=r(44),i.base64={encode:function(t){return n.encode(t)},decode:function(t){return n.decode(t)}},i.compressions=r(4),t.exports=i},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){"use strict";e.byteLength=function(t){var e=f(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){for(var e,r=f(t),n=r[0],s=r[1],o=new a(function(t,e,r){return 3*(e+r)/4-r}(0,n,s)),h=0,u=s>0?n-4:n,l=0;l<u;l+=4)e=i[t.charCodeAt(l)]<<18|i[t.charCodeAt(l+1)]<<12|i[t.charCodeAt(l+2)]<<6|i[t.charCodeAt(l+3)],o[h++]=e>>16&255,o[h++]=e>>8&255,o[h++]=255&e;2===s&&(e=i[t.charCodeAt(l)]<<2|i[t.charCodeAt(l+1)]>>4,o[h++]=255&e);1===s&&(e=i[t.charCodeAt(l)]<<10|i[t.charCodeAt(l+1)]<<4|i[t.charCodeAt(l+2)]>>2,o[h++]=e>>8&255,o[h++]=255&e);return o},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,a=[],s=0,o=r-i;s<o;s+=16383)a.push(u(t,s,s+16383>o?o:s+16383));1===i?(e=t[r-1],a.push(n[e>>2]+n[e<<4&63]+"==")):2===i&&(e=(t[r-2]<<8)+t[r-1],a.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return a.join("")};for(var n=[],i=[],a="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,h=s.length;o<h;++o)n[o]=s[o],i[s.charCodeAt(o)]=o;function f(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function u(t,e,r){for(var i,a,s=[],o=e;o<r;o+=3)i=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(255&t[o+2]),s.push(n[(a=i)>>18&63]+n[a>>12&63]+n[a>>6&63]+n[63&a]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,n,i){var a,s,o=8*i-n-1,h=(1<<o)-1,f=h>>1,u=-7,l=r?i-1:0,d=r?-1:1,c=t[e+l];for(l+=d,a=c&(1<<-u)-1,c>>=-u,u+=o;u>0;a=256*a+t[e+l],l+=d,u-=8);for(s=a&(1<<-u)-1,a>>=-u,u+=n;u>0;s=256*s+t[e+l],l+=d,u-=8);if(0===a)a=1-f;else{if(a===h)return s?NaN:1/0*(c?-1:1);s+=Math.pow(2,n),a-=f}return(c?-1:1)*s*Math.pow(2,a-n)},e.write=function(t,e,r,n,i,a){var s,o,h,f=8*a-i-1,u=(1<<f)-1,l=u>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,c=n?0:a-1,p=n?1:-1,_=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-s))<1&&(s--,h*=2),(e+=s+l>=1?d/h:d*Math.pow(2,1-l))*h>=2&&(s++,h/=2),s+l>=u?(o=0,s=u):s+l>=1?(o=(e*h-1)*Math.pow(2,i),s+=l):(o=e*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;t[r+c]=255&o,c+=p,o/=256,i-=8);for(s=s<<i|o,f+=i;f>0;t[r+c]=255&s,c+=p,s/=256,f-=8);t[r+c-p]|=128*_}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){"use strict";var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=r(28);e.uncompressInputType=n?"uint8array":"array",e.compressInputType=n?"uint8array":"array",e.magic="\b\0",e.compress=function(t,e){return i.deflateRaw(t,{level:e.level||-1})},e.uncompress=function(t){return i.inflateRaw(t)}},function(t,e,r){"use strict";var n={};(0,r(1).assign)(n,r(29),r(32),r(13)),t.exports=n},function(t,e,r){"use strict";var n=r(30),i=r(1),a=r(11),s=r(5),o=r(12),h=Object.prototype.toString,f=0,u=-1,l=0,d=8;function c(t){if(!(this instanceof c))return new c(t);this.options=i.assign({level:u,method:d,chunkSize:16384,windowBits:15,memLevel:8,strategy:l,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new o,this.strm.avail_out=0;var r=n.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==f)throw new Error(s[r]);if(e.header&&n.deflateSetHeader(this.strm,e.header),e.dictionary){var p;if(p="string"==typeof e.dictionary?a.string2buf(e.dictionary):"[object ArrayBuffer]"===h.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(r=n.deflateSetDictionary(this.strm,p))!==f)throw new Error(s[r]);this._dict_set=!0}}function p(t,e){var r=new c(e);if(r.push(t,!0),r.err)throw r.msg||s[r.err];return r.result}c.prototype.push=function(t,e){var r,s,o=this.strm,u=this.options.chunkSize;if(this.ended)return!1;s=e===~~e?e:!0===e?4:0,"string"==typeof t?o.input=a.string2buf(t):"[object ArrayBuffer]"===h.call(t)?o.input=new Uint8Array(t):o.input=t,o.next_in=0,o.avail_in=o.input.length;do{if(0===o.avail_out&&(o.output=new i.Buf8(u),o.next_out=0,o.avail_out=u),1!==(r=n.deflate(o,s))&&r!==f)return this.onEnd(r),this.ended=!0,!1;0!==o.avail_out&&(0!==o.avail_in||4!==s&&2!==s)||("string"===this.options.to?this.onData(a.buf2binstring(i.shrinkBuf(o.output,o.next_out))):this.onData(i.shrinkBuf(o.output,o.next_out)))}while((o.avail_in>0||0===o.avail_out)&&1!==r);return 4===s?(r=n.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===f):2!==s||(this.onEnd(f),o.avail_out=0,!0)},c.prototype.onData=function(t){this.chunks.push(t)},c.prototype.onEnd=function(t){t===f&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Deflate=c,e.deflate=p,e.deflateRaw=function(t,e){return(e=e||{}).raw=!0,p(t,e)},e.gzip=function(t,e){return(e=e||{}).gzip=!0,p(t,e)}},function(t,e,r){"use strict";var n,i=r(1),a=r(31),s=r(9),o=r(10),h=r(5),f=0,u=1,l=3,d=4,c=5,p=0,_=1,g=-2,m=-3,w=-5,b=-1,y=1,v=2,k=3,x=4,E=0,A=2,S=8,C=9,z=15,B=8,T=286,R=30,I=19,O=2*T+1,D=15,U=3,P=258,L=P+U+1,N=32,M=42,F=69,Z=73,Y=91,j=103,H=113,X=666,K=1,V=2,W=3,G=4,q=3;function J(t,e){return t.msg=h[e],e}function Q(t){return(t<<1)-(t>4?9:0)}function $(t){for(var e=t.length;--e>=0;)t[e]=0}function tt(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),0!==r&&(i.arraySet(t.output,e.pending_buf,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))}function et(t,e){a._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,tt(t.strm)}function rt(t,e){t.pending_buf[t.pending++]=e}function nt(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function it(t,e){var r,n,i=t.max_chain_length,a=t.strstart,s=t.prev_length,o=t.nice_match,h=t.strstart>t.w_size-L?t.strstart-(t.w_size-L):0,f=t.window,u=t.w_mask,l=t.prev,d=t.strstart+P,c=f[a+s-1],p=f[a+s];t.prev_length>=t.good_match&&(i>>=2),o>t.lookahead&&(o=t.lookahead);do{if(f[(r=e)+s]===p&&f[r+s-1]===c&&f[r]===f[a]&&f[++r]===f[a+1]){a+=2,r++;do{}while(f[++a]===f[++r]&&f[++a]===f[++r]&&f[++a]===f[++r]&&f[++a]===f[++r]&&f[++a]===f[++r]&&f[++a]===f[++r]&&f[++a]===f[++r]&&f[++a]===f[++r]&&a<d);if(n=P-(d-a),a=d-P,n>s){if(t.match_start=e,s=n,n>=o)break;c=f[a+s-1],p=f[a+s]}}}while((e=l[e&u])>h&&0!=--i);return s<=t.lookahead?s:t.lookahead}function at(t){var e,r,n,a,h,f,u,l,d,c,p=t.w_size;do{if(a=t.window_size-t.lookahead-t.strstart,t.strstart>=p+(p-L)){i.arraySet(t.window,t.window,p,p,0),t.match_start-=p,t.strstart-=p,t.block_start-=p,e=r=t.hash_size;do{n=t.head[--e],t.head[e]=n>=p?n-p:0}while(--r);e=r=p;do{n=t.prev[--e],t.prev[e]=n>=p?n-p:0}while(--r);a+=p}if(0===t.strm.avail_in)break;if(f=t.strm,u=t.window,l=t.strstart+t.lookahead,d=a,c=void 0,(c=f.avail_in)>d&&(c=d),r=0===c?0:(f.avail_in-=c,i.arraySet(u,f.input,f.next_in,c,l),1===f.state.wrap?f.adler=s(f.adler,u,c,l):2===f.state.wrap&&(f.adler=o(f.adler,u,c,l)),f.next_in+=c,f.total_in+=c,c),t.lookahead+=r,t.lookahead+t.insert>=U)for(h=t.strstart-t.insert,t.ins_h=t.window[h],t.ins_h=(t.ins_h<<t.hash_shift^t.window[h+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[h+U-1])&t.hash_mask,t.prev[h&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=h,h++,t.insert--,!(t.lookahead+t.insert<U)););}while(t.lookahead<L&&0!==t.strm.avail_in)}function st(t,e){for(var r,n;;){if(t.lookahead<L){if(at(t),t.lookahead<L&&e===f)return K;if(0===t.lookahead)break}if(r=0,t.lookahead>=U&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+U-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),0!==r&