UNPKG

inkjet

Version:

JPEG-image decoding, encoding & EXIF reading library for browser and node.js

1 lines 229 kB
!function(e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).inkjet=e()}(function(){var define,module,exports;return function n(i,a,o){function s(t,e){if(!a[t]){if(!i[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(u)return u(t,!0);throw(r=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",r}r=a[t]={exports:{}},i[t][0].call(r.exports,function(e){return s(i[t][1][e]||e)},r,r.exports,n,i,a,o)}return a[t].exports}for(var u="function"==typeof require&&require,e=0;e<o.length;e++)s(o[e]);return s}({1:[function(S,k,e){(function(t){"use strict";var e=S("object-assign");function a(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}function o(e){return t.Buffer&&"function"==typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var l=S("util/"),n=Object.prototype.hasOwnProperty,c=Array.prototype.slice,r="foo"===function(){}.name;function s(e){return Object.prototype.toString.call(e)}function u(e){if(!o(e)&&"function"==typeof t.ArrayBuffer){if("function"==typeof ArrayBuffer.isView)return ArrayBuffer.isView(e);if(e)return e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer)}}var f=k.exports=m,i=/\s*function\s+([^\(\s]*)\s*/;function d(e){if(l.isFunction(e)){if(r)return e.name;e=e.toString().match(i);return e&&e[1]}}function h(e,t){return"string"!=typeof e||e.length<t?e:e.slice(0,t)}function p(e){if(r||!l.isFunction(e))return l.inspect(e);e=d(e);return"[Function"+(e?": "+e:"")+"]"}function g(e,t,r,n,i){throw new f.AssertionError({message:r,actual:e,expected:t,operator:n,stackStartFunction:i})}function m(e,t){e||g(e,!0,t,"==",f.ok)}function b(e,t,r,n){if(e===t)return!0;if(o(e)&&o(t))return 0===a(e,t);if(l.isDate(e)&&l.isDate(t))return e.getTime()===t.getTime();if(l.isRegExp(e)&&l.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(u(e)&&u(t)&&s(e)===s(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===a(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(o(e)!==o(t))return!1;var i=(n=n||{actual:[],expected:[]}).actual.indexOf(e);return-1!==i&&i===n.expected.indexOf(t)||(n.actual.push(e),n.expected.push(t),function(e,t,r,n){if(null==e||null==t)return!1;if(l.isPrimitive(e)||l.isPrimitive(t))return e===t;if(r&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var i=y(e),a=y(t);if(i&&!a||!i&&a)return!1;if(i)return e=c.call(e),t=c.call(t),b(e,t,r);var o,s,u=w(e),f=w(t);if(u.length!==f.length)return!1;for(u.sort(),f.sort(),s=u.length-1;0<=s;s--)if(u[s]!==f[s])return!1;for(s=u.length-1;0<=s;s--)if(o=u[s],!b(e[o],t[o],r,n))return!1;return!0}(e,t,r,n))}return r?e===t:e==t}function y(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function v(e,t){if(e&&t){if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return 1}catch(e){}if(!Error.isPrototypeOf(t))return!0===t.call({},e)}}function _(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&g(i,r,"Missing expected exception"+n);var a="string"==typeof n,t=!e&&i&&!r;if((!e&&l.isError(i)&&a&&v(i,r)||t)&&g(i,r,"Got unwanted exception"+n),e&&i&&r&&!v(i,r)||!e&&i)throw i}f.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=h(p((t=this).actual),128)+" "+t.operator+" "+h(p(t.expected),128),this.generatedMessage=!0);var t=e.stackStartFunction||g;Error.captureStackTrace?Error.captureStackTrace(this,t):(e=new Error).stack&&(e=e.stack,t=d(t),0<=(t=e.indexOf("\n"+t))&&(t=e.indexOf("\n",t+1),e=e.substring(t+1)),this.stack=e)},l.inherits(f.AssertionError,Error),f.fail=g,f.ok=m,f.equal=function(e,t,r){e!=t&&g(e,t,r,"==",f.equal)},f.notEqual=function(e,t,r){e==t&&g(e,t,r,"!=",f.notEqual)},f.deepEqual=function(e,t,r){b(e,t,!1)||g(e,t,r,"deepEqual",f.deepEqual)},f.deepStrictEqual=function(e,t,r){b(e,t,!0)||g(e,t,r,"deepStrictEqual",f.deepStrictEqual)},f.notDeepEqual=function(e,t,r){b(e,t,!1)&&g(e,t,r,"notDeepEqual",f.notDeepEqual)},f.notDeepStrictEqual=function e(t,r,n){b(t,r,!0)&&g(t,r,n,"notDeepStrictEqual",e)},f.strictEqual=function(e,t,r){e!==t&&g(e,t,r,"===",f.strictEqual)},f.notStrictEqual=function(e,t,r){e===t&&g(e,t,r,"!==",f.notStrictEqual)},f.throws=function(e,t,r){_(!0,e,t,r)},f.doesNotThrow=function(e,t,r){_(!1,e,t,r)},f.ifError=function(e){if(e)throw e},f.strict=e(function e(t,r){t||g(t,!0,r,"==",e)},f,{equal:f.strictEqual,deepEqual:f.deepStrictEqual,notEqual:f.notStrictEqual,notDeepEqual:f.notDeepStrictEqual}),f.strict.strict=f.strict;var w=Object.keys||function(e){var t,r=[];for(t in e)n.call(e,t)&&r.push(t);return r}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"object-assign":17,"util/":4}],2:[function(e,t,r){"function"==typeof Object.create?t.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(e,t){e.super_=t;function r(){}r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},{}],3:[function(e,t,r){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],4:[function(A,e,I){(function(n,i){var s=/%[sdj%]/g;I.format=function(e){if(!b(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(u(arguments[r]));return t.join(" ")}for(var r=1,n=arguments,i=n.length,a=String(e).replace(s,function(e){if("%%"===e)return"%";if(i<=r)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),o=n[r];r<i;o=n[++r])g(o)||!_(o)?a+=" "+o:a+=" "+u(o);return a},I.deprecate=function(e,t){if(y(i.process))return function(){return I.deprecate(e,t).apply(this,arguments)};if(!0===n.noDeprecation)return e;var r=!1;return function(){if(!r){if(n.throwDeprecation)throw new Error(t);n.traceDeprecation?console.trace(t):console.error(t),r=!0}return e.apply(this,arguments)}};var e,a={};function u(e,t){var r={seen:[],stylize:f};return 3<=arguments.length&&(r.depth=arguments[2]),4<=arguments.length&&(r.colors=arguments[3]),p(t)?r.showHidden=t:t&&I._extend(r,t),y(r.showHidden)&&(r.showHidden=!1),y(r.depth)&&(r.depth=2),y(r.colors)&&(r.colors=!1),y(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=o),l(r,e,r.depth)}function o(e,t){t=u.styles[t];return t?"["+u.colors[t][0]+"m"+e+"["+u.colors[t][1]+"m":e}function f(e,t){return e}function l(t,r,n){if(t.customInspect&&r&&k(r.inspect)&&r.inspect!==I.inspect&&(!r.constructor||r.constructor.prototype!==r)){var e=r.inspect(n,t);return b(e)||(e=l(t,e,n)),e}var i=function(e,t){if(y(t))return e.stylize("undefined","undefined");if(b(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(m(t))return e.stylize(""+t,"number");if(p(t))return e.stylize(""+t,"boolean");if(g(t))return e.stylize("null","null")}(t,r);if(i)return i;var a,e=Object.keys(r),o=(a={},e.forEach(function(e,t){a[e]=!0}),a);if(t.showHidden&&(e=Object.getOwnPropertyNames(r)),S(r)&&(0<=e.indexOf("message")||0<=e.indexOf("description")))return c(r);if(0===e.length){if(k(r)){var s=r.name?": "+r.name:"";return t.stylize("[Function"+s+"]","special")}if(v(r))return t.stylize(RegExp.prototype.toString.call(r),"regexp");if(w(r))return t.stylize(Date.prototype.toString.call(r),"date");if(S(r))return c(r)}var i="",u=!1,s=["{","}"];return h(r)&&(u=!0,s=["[","]"]),k(r)&&(i=" [Function"+(r.name?": "+r.name:"")+"]"),v(r)&&(i=" "+RegExp.prototype.toString.call(r)),w(r)&&(i=" "+Date.prototype.toUTCString.call(r)),S(r)&&(i=" "+c(r)),0!==e.length||u&&0!=r.length?n<0?v(r)?t.stylize(RegExp.prototype.toString.call(r),"regexp"):t.stylize("[Object]","special"):(t.seen.push(r),e=u?function(t,r,n,i,e){for(var a=[],o=0,s=r.length;o<s;++o)x(r,String(o))?a.push(d(t,r,n,i,String(o),!0)):a.push("");return e.forEach(function(e){e.match(/^\d+$/)||a.push(d(t,r,n,i,e,!0))}),a}(t,r,n,o,e):e.map(function(e){return d(t,r,n,o,e,u)}),t.seen.pop(),function(e,t,r){if(60<e.reduce(function(e,t){return 0<=t.indexOf("\n")&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0))return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(e,i,s)):s[0]+i+s[1]}function c(e){return"["+Error.prototype.toString.call(e)+"]"}function d(e,t,r,n,i,a){var o,s,t=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]};if(t.get?s=t.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):t.set&&(s=e.stylize("[Setter]","special")),x(n,i)||(o="["+i+"]"),s||(e.seen.indexOf(t.value)<0?-1<(s=g(r)?l(e,t.value,null):l(e,t.value,r-1)).indexOf("\n")&&(s=a?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),y(o)){if(a&&i.match(/^\d+$/))return s;o=(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),e.stylize(o,"string"))}return o+": "+s}function h(e){return Array.isArray(e)}function p(e){return"boolean"==typeof e}function g(e){return null===e}function m(e){return"number"==typeof e}function b(e){return"string"==typeof e}function y(e){return void 0===e}function v(e){return _(e)&&"[object RegExp]"===t(e)}function _(e){return"object"==typeof e&&null!==e}function w(e){return _(e)&&"[object Date]"===t(e)}function S(e){return _(e)&&("[object Error]"===t(e)||e instanceof Error)}function k(e){return"function"==typeof e}function t(e){return Object.prototype.toString.call(e)}function r(e){return e<10?"0"+e.toString(10):e.toString(10)}I.debuglog=function(t){var r;return y(e)&&(e=n.env.NODE_DEBUG||""),t=t.toUpperCase(),a[t]||(new RegExp("\\b"+t+"\\b","i").test(e)?(r=n.pid,a[t]=function(){var e=I.format.apply(I,arguments);console.error("%s %d: %s",t,r,e)}):a[t]=function(){}),a[t]},(I.inspect=u).colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},I.isArray=h,I.isBoolean=p,I.isNull=g,I.isNullOrUndefined=function(e){return null==e},I.isNumber=m,I.isString=b,I.isSymbol=function(e){return"symbol"==typeof e},I.isUndefined=y,I.isRegExp=v,I.isObject=_,I.isDate=w,I.isError=S,I.isFunction=k,I.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},I.isBuffer=A("./support/isBuffer");var E=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function x(e,t){return Object.prototype.hasOwnProperty.call(e,t)}I.log=function(){var e,t;console.log("%s - %s",(e=new Date,t=[r(e.getHours()),r(e.getMinutes()),r(e.getSeconds())].join(":"),[e.getDate(),E[e.getMonth()],t].join(" ")),I.format.apply(I,arguments))},I.inherits=A("inherits"),I._extend=function(e,t){if(!t||!_(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}}).call(this,A("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":3,_process:30,inherits:2}],5:[function(e,t,r){"use strict";r.byteLength=function(e){var t=l(e),e=t[0],t=t[1];return 3*(e+t)/4-t},r.toByteArray=function(e){var t,r,n=l(e),i=n[0],n=n[1],a=new f(function(e,t){return 3*(e+t)/4-t}(i,n)),o=0,s=0<n?i-4:i;for(r=0;r<s;r+=4)t=u[e.charCodeAt(r)]<<18|u[e.charCodeAt(r+1)]<<12|u[e.charCodeAt(r+2)]<<6|u[e.charCodeAt(r+3)],a[o++]=t>>16&255,a[o++]=t>>8&255,a[o++]=255&t;2===n&&(t=u[e.charCodeAt(r)]<<2|u[e.charCodeAt(r+1)]>>4,a[o++]=255&t);1===n&&(t=u[e.charCodeAt(r)]<<10|u[e.charCodeAt(r+1)]<<4|u[e.charCodeAt(r+2)]>>2,a[o++]=t>>8&255,a[o++]=255&t);return a},r.fromByteArray=function(e){for(var t,r=e.length,n=r%3,i=[],a=0,o=r-n;a<o;a+=16383)i.push(function(e,t,r){for(var n,i=[],a=t;a<r;a+=3)n=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),i.push(function(e){return s[e>>18&63]+s[e>>12&63]+s[e>>6&63]+s[63&e]}(n));return i.join("")}(e,a,o<a+16383?o:a+16383));1==n?(t=e[r-1],i.push(s[t>>2]+s[t<<4&63]+"==")):2==n&&(t=(e[r-2]<<8)+e[r-1],i.push(s[t>>10]+s[t>>4&63]+s[t<<2&63]+"="));return i.join("")};for(var s=[],u=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,a=n.length;i<a;++i)s[i]=n[i],u[n.charCodeAt(i)]=i;function l(e){var t=e.length;if(0<t%4)throw new Error("Invalid string. Length must be a multiple of 4");e=e.indexOf("=");return-1===e&&(e=t),[e,e===t?0:4-e%4]}u["-".charCodeAt(0)]=62,u["_".charCodeAt(0)]=63},{}],6:[function(e,t,r){},{}],7:[function(n,e,d){(function(f,l){"use strict";var e,c=n("assert"),a=n("pako/lib/zlib/zstream"),o=n("pako/lib/zlib/deflate.js"),s=n("pako/lib/zlib/inflate.js"),t=n("pako/lib/zlib/constants");for(e in t)d[e]=t[e];d.NONE=0,d.DEFLATE=1,d.INFLATE=2,d.GZIP=3,d.GUNZIP=4,d.DEFLATERAW=5,d.INFLATERAW=6,d.UNZIP=7;function r(e){if("number"!=typeof e||e<d.DEFLATE||e>d.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}r.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,c(this.init_done,"close before init"),c(this.mode<=d.UNZIP),this.mode===d.DEFLATE||this.mode===d.GZIP||this.mode===d.DEFLATERAW?o.deflateEnd(this.strm):this.mode!==d.INFLATE&&this.mode!==d.GUNZIP&&this.mode!==d.INFLATERAW&&this.mode!==d.UNZIP||s.inflateEnd(this.strm),this.mode=d.NONE,this.dictionary=null)},r.prototype.write=function(e,t,r,n,i,a,o){return this._write(!0,e,t,r,n,i,a,o)},r.prototype.writeSync=function(e,t,r,n,i,a,o){return this._write(!1,e,t,r,n,i,a,o)},r.prototype._write=function(e,t,r,n,i,a,o,s){if(c.equal(arguments.length,8),c(this.init_done,"write before init"),c(this.mode!==d.NONE,"already finalized"),c.equal(!1,this.write_in_progress,"write already in progress"),c.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,c.equal(!1,void 0===t,"must provide flush value"),this.write_in_progress=!0,t!==d.Z_NO_FLUSH&&t!==d.Z_PARTIAL_FLUSH&&t!==d.Z_SYNC_FLUSH&&t!==d.Z_FULL_FLUSH&&t!==d.Z_FINISH&&t!==d.Z_BLOCK)throw new Error("Invalid flush value");if(null==r&&(r=l.alloc(0),n=i=0),this.strm.avail_in=i,this.strm.input=r,this.strm.next_in=n,this.strm.avail_out=s,this.strm.output=a,this.strm.next_out=o,this.flush=t,!e)return this._process(),this._checkError()?this._afterSync():void 0;var u=this;return f.nextTick(function(){u._process(),u._after()}),this},r.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},r.prototype._process=function(){var e=null;switch(this.mode){case d.DEFLATE:case d.GZIP:case d.DEFLATERAW:this.err=o.deflate(this.strm,this.flush);break;case d.UNZIP:switch(0<this.strm.avail_in&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=d.INFLATE;break}if(e++,(this.gzip_id_bytes_read=1)===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=d.GUNZIP):this.mode=d.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case d.INFLATE:case d.GUNZIP:case d.INFLATERAW:for(this.err=s.inflate(this.strm,this.flush),this.err===d.Z_NEED_DICT&&this.dictionary&&(this.err=s.inflateSetDictionary(this.strm,this.dictionary),this.err===d.Z_OK?this.err=s.inflate(this.strm,this.flush):this.err===d.Z_DATA_ERROR&&(this.err=d.Z_NEED_DICT));0<this.strm.avail_in&&this.mode===d.GUNZIP&&this.err===d.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=s.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},r.prototype._checkError=function(){switch(this.err){case d.Z_OK:case d.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===d.Z_FINISH)return this._error("unexpected end of file"),!1;break;case d.Z_STREAM_END:break;case d.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},r.prototype._after=function(){var e,t;this._checkError()&&(e=this.strm.avail_out,t=this.strm.avail_in,this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close())},r.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},r.prototype.init=function(e,t,r,n,i){c(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),c(8<=e&&e<=15,"invalid windowBits"),c(-1<=t&&t<=9,"invalid compression level"),c(1<=r&&r<=9,"invalid memlevel"),c(n===d.Z_FILTERED||n===d.Z_HUFFMAN_ONLY||n===d.Z_RLE||n===d.Z_FIXED||n===d.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(t,e,r,n,i),this._setDictionary()},r.prototype.params=function(){throw new Error("deflateParams Not supported")},r.prototype.reset=function(){this._reset(),this._setDictionary()},r.prototype._init=function(e,t,r,n,i){switch(this.level=e,this.windowBits=t,this.memLevel=r,this.strategy=n,this.flush=d.Z_NO_FLUSH,this.err=d.Z_OK,this.mode!==d.GZIP&&this.mode!==d.GUNZIP||(this.windowBits+=16),this.mode===d.UNZIP&&(this.windowBits+=32),this.mode!==d.DEFLATERAW&&this.mode!==d.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new a,this.mode){case d.DEFLATE:case d.GZIP:case d.DEFLATERAW:this.err=o.deflateInit2(this.strm,this.level,d.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case d.INFLATE:case d.GUNZIP:case d.INFLATERAW:case d.UNZIP:this.err=s.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==d.Z_OK&&this._error("Init error"),this.dictionary=i,this.write_in_progress=!1,this.init_done=!0},r.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=d.Z_OK,this.mode){case d.DEFLATE:case d.DEFLATERAW:this.err=o.deflateSetDictionary(this.strm,this.dictionary)}this.err!==d.Z_OK&&this._error("Failed to set dictionary")}},r.prototype._reset=function(){switch(this.err=d.Z_OK,this.mode){case d.DEFLATE:case d.DEFLATERAW:case d.GZIP:this.err=o.deflateReset(this.strm);break;case d.INFLATE:case d.INFLATERAW:case d.GUNZIP:this.err=s.inflateReset(this.strm)}this.err!==d.Z_OK&&this._error("Failed to reset stream")},d.Zlib=r}).call(this,n("_process"),n("buffer").Buffer)},{_process:30,assert:1,buffer:9,"pako/lib/zlib/constants":20,"pako/lib/zlib/deflate.js":22,"pako/lib/zlib/inflate.js":24,"pako/lib/zlib/zstream":28}],8:[function(T,e,j){(function(i){"use strict";var g=T("buffer").Buffer,a=T("stream").Transform,o=T("./binding"),e=T("util"),m=T("assert").ok,b=T("buffer").kMaxLength,y="Cannot create final Buffer. It would be larger than 0x"+b.toString(16)+" bytes";o.Z_MIN_WINDOWBITS=8,o.Z_MAX_WINDOWBITS=15,o.Z_DEFAULT_WINDOWBITS=15,o.Z_MIN_CHUNK=64,o.Z_MAX_CHUNK=1/0,o.Z_DEFAULT_CHUNK=16384,o.Z_MIN_MEMLEVEL=1,o.Z_MAX_MEMLEVEL=9,o.Z_DEFAULT_MEMLEVEL=8,o.Z_MIN_LEVEL=-1,o.Z_MAX_LEVEL=9,o.Z_DEFAULT_LEVEL=o.Z_DEFAULT_COMPRESSION;for(var t=Object.keys(o),r=0;r<t.length;r++){var n=t[r];n.match(/^Z/)&&Object.defineProperty(j,n,{enumerable:!0,value:o[n],writable:!1})}for(var s={Z_OK:o.Z_OK,Z_STREAM_END:o.Z_STREAM_END,Z_NEED_DICT:o.Z_NEED_DICT,Z_ERRNO:o.Z_ERRNO,Z_STREAM_ERROR:o.Z_STREAM_ERROR,Z_DATA_ERROR:o.Z_DATA_ERROR,Z_MEM_ERROR:o.Z_MEM_ERROR,Z_BUF_ERROR:o.Z_BUF_ERROR,Z_VERSION_ERROR:o.Z_VERSION_ERROR},u=Object.keys(s),f=0;f<u.length;f++){var l=u[f];s[s[l]]=l}function c(r,e,n){var i=[],a=0;function t(){for(var e;null!==(e=r.read());)i.push(e),a+=e.length;r.once("readable",t)}function o(){var e,t=null;b<=a?t=new RangeError(y):e=g.concat(i,a),i=[],r.close(),n(t,e)}r.on("error",function(e){r.removeListener("end",o),r.removeListener("readable",t),n(e)}),r.on("end",o),r.end(e),t()}function d(e,t){if("string"==typeof t&&(t=g.from(t)),!g.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function h(e){if(!(this instanceof h))return new h(e);x.call(this,e,o.DEFLATE)}function p(e){if(!(this instanceof p))return new p(e);x.call(this,e,o.INFLATE)}function v(e){if(!(this instanceof v))return new v(e);x.call(this,e,o.GZIP)}function _(e){if(!(this instanceof _))return new _(e);x.call(this,e,o.GUNZIP)}function w(e){if(!(this instanceof w))return new w(e);x.call(this,e,o.DEFLATERAW)}function S(e){if(!(this instanceof S))return new S(e);x.call(this,e,o.INFLATERAW)}function k(e){if(!(this instanceof k))return new k(e);x.call(this,e,o.UNZIP)}function E(e){return e===o.Z_NO_FLUSH||e===o.Z_PARTIAL_FLUSH||e===o.Z_SYNC_FLUSH||e===o.Z_FULL_FLUSH||e===o.Z_FINISH||e===o.Z_BLOCK}function x(e,t){var r=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||j.Z_DEFAULT_CHUNK,a.call(this,e),e.flush&&!E(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!E(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||o.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:o.Z_FINISH,e.chunkSize&&(e.chunkSize<j.Z_MIN_CHUNK||e.chunkSize>j.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBits<j.Z_MIN_WINDOWBITS||e.windowBits>j.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.level<j.Z_MIN_LEVEL||e.level>j.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevel<j.Z_MIN_MEMLEVEL||e.memLevel>j.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=j.Z_FILTERED&&e.strategy!=j.Z_HUFFMAN_ONLY&&e.strategy!=j.Z_RLE&&e.strategy!=j.Z_FIXED&&e.strategy!=j.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!g.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new o.Zlib(t);var n=this;this._hadError=!1,this._handle.onerror=function(e,t){A(n),n._hadError=!0;e=new Error(e);e.errno=t,e.code=j.codes[t],n.emit("error",e)};var i=j.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(i=e.level);t=j.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(t=e.strategy),this._handle.init(e.windowBits||j.Z_DEFAULT_WINDOWBITS,i,e.memLevel||j.Z_DEFAULT_MEMLEVEL,t,e.dictionary),this._buffer=g.allocUnsafe(this._chunkSize),this._offset=0,this._level=i,this._strategy=t,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!r._handle},configurable:!0,enumerable:!0})}function A(e,t){t&&i.nextTick(t),e._handle&&(e._handle.close(),e._handle=null)}function I(e){e.emit("close")}Object.defineProperty(j,"codes",{enumerable:!0,value:Object.freeze(s),writable:!1}),j.Deflate=h,j.Inflate=p,j.Gzip=v,j.Gunzip=_,j.DeflateRaw=w,j.InflateRaw=S,j.Unzip=k,j.createDeflate=function(e){return new h(e)},j.createInflate=function(e){return new p(e)},j.createDeflateRaw=function(e){return new w(e)},j.createInflateRaw=function(e){return new S(e)},j.createGzip=function(e){return new v(e)},j.createGunzip=function(e){return new _(e)},j.createUnzip=function(e){return new k(e)},j.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),c(new h(t),e,r)},j.deflateSync=function(e,t){return d(new h(t),e)},j.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),c(new v(t),e,r)},j.gzipSync=function(e,t){return d(new v(t),e)},j.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),c(new w(t),e,r)},j.deflateRawSync=function(e,t){return d(new w(t),e)},j.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),c(new k(t),e,r)},j.unzipSync=function(e,t){return d(new k(t),e)},j.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),c(new p(t),e,r)},j.inflateSync=function(e,t){return d(new p(t),e)},j.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),c(new _(t),e,r)},j.gunzipSync=function(e,t){return d(new _(t),e)},j.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),c(new S(t),e,r)},j.inflateRawSync=function(e,t){return d(new S(t),e)},e.inherits(x,a),x.prototype.params=function(e,t,r){if(e<j.Z_MIN_LEVEL||e>j.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=j.Z_FILTERED&&t!=j.Z_HUFFMAN_ONLY&&t!=j.Z_RLE&&t!=j.Z_FIXED&&t!=j.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);var n;this._level!==e||this._strategy!==t?(n=this).flush(o.Z_SYNC_FLUSH,function(){m(n._handle,"zlib binding closed"),n._handle.params(e,t),n._hadError||(n._level=e,n._strategy=t,r&&r())}):i.nextTick(r)},x.prototype.reset=function(){return m(this._handle,"zlib binding closed"),this._handle.reset()},x.prototype._flush=function(e){this._transform(g.alloc(0),"",e)},x.prototype.flush=function(e,t){var r=this,n=this._writableState;"function"!=typeof e&&(void 0!==e||t)||(t=e,e=o.Z_FULL_FLUSH),n.ended?t&&i.nextTick(t):n.ending?t&&this.once("end",t):n.needDrain?t&&this.once("drain",function(){return r.flush(e,t)}):(this._flushFlag=e,this.write(g.alloc(0),"",t))},x.prototype.close=function(e){A(this,e),i.nextTick(I,this)},x.prototype._transform=function(e,t,r){var n,i=this._writableState,a=(i.ending||i.ended)&&(!e||i.length===e.length);return null===e||g.isBuffer(e)?this._handle?(a?n=this._finishFlushFlag:(n=this._flushFlag,e.length>=i.length&&(this._flushFlag=this._opts.flush||o.Z_NO_FLUSH)),void this._processChunk(e,n,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},x.prototype._processChunk=function(i,a,o){var s=i&&i.length,u=this._chunkSize-this._offset,f=0,l=this,c="function"==typeof o;if(!c){var t,d=[],h=0;this.on("error",function(e){t=e}),m(this._handle,"zlib binding closed");do{var e=this._handle.writeSync(a,i,f,s,this._buffer,this._offset,u)}while(!this._hadError&&p(e[0],e[1]));if(this._hadError)throw t;if(b<=h)throw A(this),new RangeError(y);var r=g.concat(d,h);return A(this),r}m(this._handle,"zlib binding closed");r=this._handle.write(a,i,f,s,this._buffer,this._offset,u);function p(e,t){if(this&&(this.buffer=null,this.callback=null),!l._hadError){var r,n=u-t;if(m(0<=n,"have should not go down"),0<n&&(r=l._buffer.slice(l._offset,l._offset+n),l._offset+=n,c?l.push(r):(d.push(r),h+=r.length)),(0===t||l._offset>=l._chunkSize)&&(u=l._chunkSize,l._offset=0,l._buffer=g.allocUnsafe(l._chunkSize)),0===t){if(f+=s-e,s=e,!c)return!0;e=l._handle.write(a,i,f,s,l._buffer,l._offset,l._chunkSize);return e.callback=p,void(e.buffer=i)}if(!c)return!1;o()}}r.buffer=i,r.callback=p},e.inherits(h,x),e.inherits(p,x),e.inherits(v,x),e.inherits(_,x),e.inherits(w,x),e.inherits(S,x),e.inherits(k,x)}).call(this,T("_process"))},{"./binding":7,_process:30,assert:1,buffer:9,stream:45,util:51}],9:[function(e,t,C){(function(c){"use strict";var s=e("base64-js"),a=e("ieee754");C.Buffer=c,C.SlowBuffer=function(e){+e!=e&&(e=0);return c.alloc(+e)},C.INSPECT_MAX_BYTES=50;var t=2147483647;function i(e){if(t<e)throw new RangeError('The value "'+e+'" is invalid for option "size"');e=new Uint8Array(e);return e.__proto__=c.prototype,e}function c(e,t,r){if("number"!=typeof e)return n(e,t,r);if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}function n(e,t,r){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!c.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|d(e,t),n=i(r),t=n.write(e,t);t!==r&&(n=n.slice(0,t));return n}(e,t);if(ArrayBuffer.isView(e))return f(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(j(e,ArrayBuffer)||e&&j(e.buffer,ArrayBuffer))return function(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');r=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r);return r.__proto__=c.prototype,r}(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return c.from(n,t,r);n=function(e){if(c.isBuffer(e)){var t=0|l(e.length),r=i(t);return 0===r.length?r:(e.copy(r,0,0,t),r)}if(void 0!==e.length)return"number"!=typeof e.length||O(e.length)?i(0):f(e);if("Buffer"===e.type&&Array.isArray(e.data))return f(e.data)}(e);if(n)return n;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return c.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function o(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return o(e),i(e<0?0:0|l(e))}function f(e){for(var t=e.length<0?0:0|l(e.length),r=i(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function l(e){if(t<=e)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+t.toString(16)+" bytes");return 0|e}function d(e,t){if(c.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||j(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=2<arguments.length&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return A(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return I(e).length;default:if(i)return n?-1:A(e).length;t=(""+t).toLowerCase(),i=!0}}function r(e,t,r){var n,i,a,o=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e=e||"utf8";;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0);(!r||r<0||n<r)&&(r=n);for(var i="",a=t;a<r;++a)i+=function(e){return e<16?"0"+e.toString(16):e.toString(16)}(e[a]);return i}(this,t,r);case"utf8":case"utf-8":return y(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}(this,t,r);case"base64":return n=this,a=r,0===(i=t)&&a===n.length?s.fromByteArray(n):s.fromByteArray(n.slice(i,a));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}(this,t,r);default:if(o)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function h(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function p(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),O(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=c.from(t,n)),c.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?(i?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(e,t,r):g(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,i){var a=1,o=e.length,s=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o/=a=2,s/=2,r/=2}function u(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i)for(var f=-1,l=r;l<o;l++)if(u(e,l)===u(t,-1===f?0:l-f)){if(-1===f&&(f=l),l-f+1===s)return f*a}else-1!==f&&(l-=l-f),f=-1;else for(o<r+s&&(r=o-s),l=r;0<=l;l--){for(var c=!0,d=0;d<s;d++)if(u(e,l+d)!==u(t,d)){c=!1;break}if(c)return l}return-1}function m(e,t,r,n){return T(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function b(e,t,r,n){return T(function(e,t){for(var r,n,i=[],a=0;a<e.length&&!((t-=2)<0);++a)n=e.charCodeAt(a),r=n>>8,n=n%256,i.push(n),i.push(r);return i}(t,e.length-r),e,r,n)}function y(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var a,o,s,u,f=e[i],l=null,c=239<f?4:223<f?3:191<f?2:1;if(i+c<=r)switch(c){case 1:f<128&&(l=f);break;case 2:128==(192&(a=e[i+1]))&&127<(u=(31&f)<<6|63&a)&&(l=u);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&2047<(u=(15&f)<<12|(63&a)<<6|63&o)&&(u<55296||57343<u)&&(l=u);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&65535<(u=(15&f)<<18|(63&a)<<12|(63&o)<<6|63&s)&&u<1114112&&(l=u)}null===l?(l=65533,c=1):65535<l&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),i+=c}return function(e){var t=e.length;if(t<=v)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=v));return r}(n)}C.kMaxLength=t,(c.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),c.poolSize=8192,c.from=n,c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,c.alloc=function(e,t,r){return t=t,r=r,o(e=e),!(e<=0)&&void 0!==t?"string"==typeof r?i(e).fill(t,r):i(e).fill(t):i(e)},c.allocUnsafe=u,c.allocUnsafeSlow=u,c.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==c.prototype},c.compare=function(e,t){if(j(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),j(t,Uint8Array)&&(t=c.from(t,t.offset,t.byteLength)),!c.isBuffer(e)||!c.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},c.isEncoding=function(e){switch(String(e).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}},c.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return c.alloc(0);if(void 0===t)for(i=t=0;i<e.length;++i)t+=e[i].length;for(var r=c.allocUnsafe(t),n=0,i=0;i<e.length;++i){var a=e[i];if(j(a,Uint8Array)&&(a=c.from(a)),!c.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,n),n+=a.length}return r},c.byteLength=d,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)h(this,t,t+1);return this},c.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)h(this,t,t+3),h(this,t+1,t+2);return this},c.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)h(this,t,t+7),h(this,t+1,t+6),h(this,t+2,t+5),h(this,t+3,t+4);return this},c.prototype.toLocaleString=c.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?y(this,0,e):r.apply(this,arguments)},c.prototype.equals=function(e){if(!c.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===c.compare(this,e)},c.prototype.inspect=function(){var e="",t=C.INSPECT_MAX_BYTES,e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim();return this.length>t&&(e+=" ... "),"<Buffer "+e+">"},c.prototype.compare=function(e,t,r,n,i){if(j(e,Uint8Array)&&(e=c.from(e,e.offset,e.byteLength)),!c.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(i<=n&&r<=t)return 0;if(i<=n)return-1;if(r<=t)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),u=this.slice(n,i),f=e.slice(t,r),l=0;l<s;++l)if(u[l]!==f[l]){a=u[l],o=f[l];break}return a<o?-1:o<a?1:0},c.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},c.prototype.indexOf=function(e,t,r){return p(this,e,t,r,!0)},c.prototype.lastIndexOf=function(e,t,r){return p(this,e,t,r,!1)},c.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||i<r)&&(r=i),0<e.length&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var a,o,s,u=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var i=e.length-r;(!n||i<(n=Number(n)))&&(n=i),(i=t.length)/2<n&&(n=i/2);for(var a=0;a<n;++a){var o=parseInt(t.substr(2*a,2),16);if(O(o))return a;e[r+a]=o}return a}(this,e,t,r);case"utf8":case"utf-8":return o=t,s=r,T(A(e,(a=this).length-o),a,o,s);case"ascii":return m(this,e,t,r);case"latin1":case"binary":return m(this,e,t,r);case"base64":return a=this,o=t,s=r,T(I(e),a,o,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return b(this,e,t,r);default:if(u)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),u=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var v=4096;function _(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(r<e+t)throw new RangeError("Trying to access beyond buffer length")}function w(e,t,r,n,i,a){if(!c.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(i<t||t<a)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function S(e,t,r,n){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function k(e,t,r,n,i){return t=+t,r>>>=0,i||S(e,0,r,4),a.write(e,t,r,n,23,4),r+4}function E(e,t,r,n,i){return t=+t,r>>>=0,i||S(e,0,r,8),a.write(e,t,r,n,52,8),r+8}c.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):r<e&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):r<t&&(t=r),t<e&&(t=e);t=this.subarray(e,t);return t.__proto__=c.prototype,t},c.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||_(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n},c.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||_(e,t,this.length);for(var n=this[e+--t],i=1;0<t&&(i*=256);)n+=this[e+--t]*i;return n},c.prototype.readUInt8=function(e,t){return e>>>=0,t||_(e,1,this.length),this[e]},c.prototype.readUInt16LE=function(e,t){return e>>>=0,t||_(e,2,this.length),this[e]|this[e+1]<<8},c.prototype.readUInt16BE=function(e,t){return e>>>=0,t||_(e,2,this.length),this[e]<<8|this[e+1]},c.prototype.readUInt32LE=function(e,t){return e>>>=0,t||_(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},c.prototype.readUInt32BE=function(e,t){return e>>>=0,t||_(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},c.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||_(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return(i*=128)<=n&&(n-=Math.pow(2,8*t)),n},c.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||_(e,t,this.length);for(var n=t,i=1,a=this[e+--n];0<n&&(i*=256);)a+=this[e+--n]*i;return(i*=128)<=a&&(a-=Math.pow(2,8*t)),a},c.prototype.readInt8=function(e,t){return e>>>=0,t||_(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},c.prototype.readInt16LE=function(e,t){e>>>=0,t||_(e,2,this.length);e=this[e]|this[e+1]<<8;return 32768&e?4294901760|e:e},c.prototype.readInt16BE=function(e,t){e>>>=0,t||_(e,2,this.length);e=this[e+1]|this[e]<<8;return 32768&e?4294901760|e:e},c.prototype.readInt32LE=function(e,t){return e>>>=0,t||_(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},c.prototype.readInt32BE=function(e,t){return e>>>=0,t||_(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},c.prototype.readFloatLE=function(e,t){return e>>>=0,t||_(e,4,this.length),a.read(this,e,!0,23,4)},c.prototype.readFloatBE=function(e,t){return e>>>=0,t||_(e,4,this.length),a.read(this,e,!1,23,4)},c.prototype.readDoubleLE=function(e,t){return e>>>=0,t||_(e,8,this.length),a.read(this,e,!0,52,8)},c.prototype.readDoubleBE=function(e,t){return e>>>=0,t||_(e,8,this.length),a.read(this,e,!1,52,8)},c.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||w(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a<r&&(i*=256);)this[t+a]=e/i&255;return t+r},c.prototype.writeUIntBE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||w(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;0<=--i&&(a*=256);)this[t+i]=e/a&255;return t+r},c.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,1,255,0),this[t]=255&e,t+1},c.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},c.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeIntLE=function(e,t,r,n){e=+e,t>>>=0,n||w(this,e,t,r,(n=Math.pow(2,8*r-1))-1,-n);var i=0,a=1,o=0;for(this[t]=255&e;++i<r&&(a*=256);)e<0&&0===o&&0!==this[t+i-1]&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+r},c.prototype.writeIntBE=function(e,t,r,n){e=+e,t>>>=0,n||w(this,e,t,r,(n=Math.pow(2,8*r-1))-1,-n);var i=r-1,a=1,o=0;for(this[t+i]=255&e;0<=--i&&(a*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/a>>0)-o&255;return t+r},c.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},c.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},c.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},c.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},c.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||w(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},c.prototype.writeFloatLE=function(e,t,r){return k(this,e,t,!0,r)},c.prototype.writeFloatBE=function(e,t,r){return k(this,e,t,!1,r)},c.prototype.writeDoubleLE=function(e,t,r){return E(this,e,t,!0,r)},c.prototype.writeDoubleBE=function(e,t,r){return E(this,e,t,!1,r)},c.prototype.copy=function(e,t,r,n){if(!c.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r=r||0,n||0===n||(n=this.length),t>=e.length&&(t=e.length),t=t||0,0<n&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var a=i-1;0<=a;--a)e[a+t]=this[a+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return i},c.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var i;1===e.length&&(i=e.charCodeAt(0),("utf8"===n&&i<128||"latin1"===n)&&(e=i))}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var a;if(t>>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(e=e||0))for(a=t;a<r;++a)this[a]=e;else{var o=c.isBuffer(e)?e:c.from(e,n),s=o.length;if(0===s)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<r-t;++a)this[a+t]=o[a%s]}return this};var x=/[^+/0-9A-Za-z-_]/g;function A(e,t){var r;t=t||1/0;for(var n=e.length,i=null,a=[],o=0;o<n;++o){if(55295<(r=e.charCodeAt(o))&&r<57344){if(!i){if(56319<r){-1<(t-=3)&&a.push(239,191,189);continue}if(o+1===n){-1<(t-=3)&&a.push(239,191,189);continue}i=r;continue}if(r<56320){-1<(t-=3)&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&-1<(t-=3)&&a.push(239,191,189);if(i=null,r<128){if(--t<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=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((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function I(e){return s.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(x,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function T(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function j(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function O(e){return e!=e}}).call(this,e("buffer").Buffer)},{"base64-js":5,buffer:9,ieee754:12}],10:[function(e,t,r){(function(e){function t(e){return Object.prototype.toString.call(e)}r.isArray=function(e){return Array.isArray?Array.isArray(e):"[object Array]"===t(e)},r.isBoolean=function(e){return"boolean"==typeof e},r.isNull=function(e){return null===e},r.isNullOrUndefined=function(e){return null==e},r.isNumber=function(e){return"number"==typeof e},r.isString=function(e){return"string"==typeof e},r.isSymbol=function(e){return"symbol"==typeof e},r.isUndefined=function(e){return void 0===e},r.isRegExp=function(e){return"[object RegExp]"===t(e)},r.isObject=function(e){return"object"==typeof e&&null!==e},r.isDate=function(e){return"[object Date]"===t(e)},r.isError=function(e){return"[object Error]"===t(e)||e instanceof Error},r.isFunction=function(e){return"function"==typeof e},r.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},r.isBuffer=e.isBuffer}).call(this,{isBuffer:e("../../is-buffer/index.js")})},{"../../is-buffer/index.js":15}],11:[function(e,t,r){var s=Object.create||function(e){function t(){}return t.prototype=e,new t},o=Object.keys||function(e){var t,r=[];for(t in e)Object.prototype.hasOwnProperty.call(e,t)&&r.push(t);return t},n=Function.prototype.bind||function(e){var t=this;return function(){return t.apply(e,arguments)}};function i(){this._events&&Object.prototype.hasOwnProperty.call(this,"_events")||(this._events=s(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0}((t.exports=i).EventEmitter=i).prototype._events=void 0,i.prototype._maxListeners=void 0;var a,u=10;try{var f={};Object.defineProperty&&Object.defineProperty(f,"x",{value:0}),a=0===f.x}catch(e){a=!1}function l(e){return void 0===e._maxListeners?i.defaultMaxListeners:e._maxListeners}function c(e,t,r,n){var i,a;if("function"!=typeof r)throw new TypeError('"listener" argument must be a function');return(i=e._events)?(i.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),i=e._events),a=i[t]):(i=e._events=s(null),e._eventsCount=0),a?("function"==typeof a?a=i[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),a.warned||(n=l(e))&&0<n&&a.length>n&&(a.warned=!0,(n=new Error("Possible EventEmitter memory leak detected. "+a.length+' "'+String(t)+'" listeners added. Use emitter.setMaxListeners() to increase limit.')).name="MaxListenersExceededWarning",n.emitter=e,n.type=t,n.count=a.length,"object"==typeof console&&console.warn&&console.warn("%s: %s",n.name