2 lines
29 KiB
JavaScript
2 lines
29 KiB
JavaScript
/*! For license information please see LICENSES */
|
||
(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{238:function(t,r,e){"use strict";(function(t){var n=e(239),o=e(240),h=e(241);function f(){return l.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function c(t,r){if(f()<r)throw new RangeError("Invalid typed array length");return l.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r)).__proto__=l.prototype:(null===t&&(t=new l(r)),t.length=r),t}function l(t,r,e){if(!(l.TYPED_ARRAY_SUPPORT||this instanceof l))return new l(t,r,e);if("number"==typeof t){if("string"==typeof r)throw new Error("If encoding is specified then the first argument must be a string");return y(this,t)}return d(this,t,r,e)}function d(t,r,e,n){if("number"==typeof r)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&r instanceof ArrayBuffer?function(t,r,e,n){if(r.byteLength,e<0||r.byteLength<e)throw new RangeError("'offset' is out of bounds");if(r.byteLength<e+(n||0))throw new RangeError("'length' is out of bounds");r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n);l.TYPED_ARRAY_SUPPORT?(t=r).__proto__=l.prototype:t=E(t,r);return t}(t,r,e,n):"string"==typeof r?function(t,r,e){"string"==typeof e&&""!==e||(e="utf8");if(!l.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|m(r,e),o=(t=c(t,n)).write(r,e);o!==n&&(t=t.slice(0,o));return t}(t,r,e):function(t,r){if(l.isBuffer(r)){var e=0|v(r.length);return 0===(t=c(t,e)).length||r.copy(t,0,0,e),t}if(r){if("undefined"!=typeof ArrayBuffer&&r.buffer instanceof ArrayBuffer||"length"in r)return"number"!=typeof r.length||(n=r.length)!=n?c(t,0):E(t,r);if("Buffer"===r.type&&h(r.data))return E(t,r.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,r)}function w(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 y(t,r){if(w(r),t=c(t,r<0?0:0|v(r)),!l.TYPED_ARRAY_SUPPORT)for(var i=0;i<r;++i)t[i]=0;return t}function E(t,r){var e=r.length<0?0:0|v(r.length);t=c(t,e);for(var i=0;i<e;i+=1)t[i]=255&r[i];return t}function v(t){if(t>=f())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f().toString(16)+" bytes");return 0|t}function m(t,r){if(l.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 e=t.length;if(0===e)return 0;for(var n=!1;;)switch(r){case"ascii":case"latin1":case"binary":return e;case"utf8":case"utf-8":case void 0:return H(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return K(t).length;default:if(n)return H(t).length;r=(""+r).toLowerCase(),n=!0}}function A(t,r,e){var n=!1;if((void 0===r||r<0)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),e<=0)return"";if((e>>>=0)<=(r>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return k(this,r,e);case"utf8":case"utf-8":return x(this,r,e);case"ascii":return M(this,r,e);case"latin1":case"binary":return O(this,r,e);case"base64":return Y(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return D(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function I(b,t,r){var i=b[t];b[t]=b[r],b[r]=i}function U(t,r,e,n,o){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:e<-2147483648&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),e<0&&(e=t.length+e),e>=t.length){if(o)return-1;e=t.length-1}else if(e<0){if(!o)return-1;e=0}if("string"==typeof r&&(r=l.from(r,n)),l.isBuffer(r))return 0===r.length?-1:B(t,r,e,n,o);if("number"==typeof r)return r&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):B(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function B(t,r,e,n,o){var i,h=1,f=t.length,c=r.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||r.length<2)return-1;h=2,f/=2,c/=2,e/=2}function l(t,i){return 1===h?t[i]:t.readUInt16BE(i*h)}if(o){var d=-1;for(i=e;i<f;i++)if(l(t,i)===l(r,-1===d?0:i-d)){if(-1===d&&(d=i),i-d+1===c)return d*h}else-1!==d&&(i-=i-d),d=-1}else for(e+c>f&&(e=f-c),i=e;i>=0;i--){for(var w=!0,y=0;y<c;y++)if(l(t,i+y)!==l(r,y)){w=!1;break}if(w)return i}return-1}function P(t,r,e,n){e=Number(e)||0;var o=t.length-e;n?(n=Number(n))>o&&(n=o):n=o;var h=r.length;if(h%2!=0)throw new TypeError("Invalid hex string");n>h/2&&(n=h/2);for(var i=0;i<n;++i){var f=parseInt(r.substr(2*i,2),16);if(isNaN(f))return i;t[e+i]=f}return i}function R(t,r,e,n){return Z(H(r,t.length-e),t,e,n)}function _(t,r,e,n){return Z(function(t){for(var r=[],i=0;i<t.length;++i)r.push(255&t.charCodeAt(i));return r}(r),t,e,n)}function S(t,r,e,n){return _(t,r,e,n)}function T(t,r,e,n){return Z(K(r),t,e,n)}function L(t,r,e,n){return Z(function(t,r){for(var e,n,o,h=[],i=0;i<t.length&&!((r-=2)<0);++i)n=(e=t.charCodeAt(i))>>8,o=e%256,h.push(o),h.push(n);return h}(r,t.length-e),t,e,n)}function Y(t,r,e){return 0===r&&e===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(r,e))}function x(t,r,e){e=Math.min(t.length,e);for(var n=[],i=r;i<e;){var o,h,f,c,l=t[i],d=null,w=l>239?4:l>223?3:l>191?2:1;if(i+w<=e)switch(w){case 1:l<128&&(d=l);break;case 2:128==(192&(o=t[i+1]))&&(c=(31&l)<<6|63&o)>127&&(d=c);break;case 3:o=t[i+1],h=t[i+2],128==(192&o)&&128==(192&h)&&(c=(15&l)<<12|(63&o)<<6|63&h)>2047&&(c<55296||c>57343)&&(d=c);break;case 4:o=t[i+1],h=t[i+2],f=t[i+3],128==(192&o)&&128==(192&h)&&128==(192&f)&&(c=(15&l)<<18|(63&o)<<12|(63&h)<<6|63&f)>65535&&c<1114112&&(d=c)}null===d?(d=65533,w=1):d>65535&&(d-=65536,n.push(d>>>10&1023|55296),d=56320|1023&d),n.push(d),i+=w}return function(t){var r=t.length;if(r<=C)return String.fromCharCode.apply(String,t);var e="",i=0;for(;i<r;)e+=String.fromCharCode.apply(String,t.slice(i,i+=C));return e}(n)}r.Buffer=l,r.SlowBuffer=function(t){+t!=t&&(t=0);return l.alloc(+t)},r.INSPECT_MAX_BYTES=50,l.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}}(),r.kMaxLength=f(),l.poolSize=8192,l._augment=function(t){return t.__proto__=l.prototype,t},l.from=function(t,r,e){return d(null,t,r,e)},l.TYPED_ARRAY_SUPPORT&&(l.prototype.__proto__=Uint8Array.prototype,l.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&l[Symbol.species]===l&&Object.defineProperty(l,Symbol.species,{value:null,configurable:!0})),l.alloc=function(t,r,e){return function(t,r,e,n){return w(r),r<=0?c(t,r):void 0!==e?"string"==typeof n?c(t,r).fill(e,n):c(t,r).fill(e):c(t,r)}(null,t,r,e)},l.allocUnsafe=function(t){return y(null,t)},l.allocUnsafeSlow=function(t){return y(null,t)},l.isBuffer=function(b){return!(null==b||!b._isBuffer)},l.compare=function(a,b){if(!l.isBuffer(a)||!l.isBuffer(b))throw new TypeError("Arguments must be Buffers");if(a===b)return 0;for(var t=a.length,r=b.length,i=0,e=Math.min(t,r);i<e;++i)if(a[i]!==b[i]){t=a[i],r=b[i];break}return t<r?-1:r<t?1:0},l.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}},l.concat=function(t,r){if(!h(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return l.alloc(0);var i;if(void 0===r)for(r=0,i=0;i<t.length;++i)r+=t[i].length;var e=l.allocUnsafe(r),n=0;for(i=0;i<t.length;++i){var o=t[i];if(!l.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(e,n),n+=o.length}return e},l.byteLength=m,l.prototype._isBuffer=!0,l.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 i=0;i<t;i+=2)I(this,i,i+1);return this},l.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 i=0;i<t;i+=4)I(this,i,i+3),I(this,i+1,i+2);return this},l.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 i=0;i<t;i+=8)I(this,i,i+7),I(this,i+1,i+6),I(this,i+2,i+5),I(this,i+3,i+4);return this},l.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?x(this,0,t):A.apply(this,arguments)},l.prototype.equals=function(b){if(!l.isBuffer(b))throw new TypeError("Argument must be a Buffer");return this===b||0===l.compare(this,b)},l.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},l.prototype.compare=function(t,r,e,n,o){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===r&&(r=0),void 0===e&&(e=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),r<0||e>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&r>=e)return 0;if(n>=o)return-1;if(r>=e)return 1;if(this===t)return 0;for(var h=(o>>>=0)-(n>>>=0),f=(e>>>=0)-(r>>>=0),c=Math.min(h,f),d=this.slice(n,o),w=t.slice(r,e),i=0;i<c;++i)if(d[i]!==w[i]){h=d[i],f=w[i];break}return h<f?-1:f<h?1:0},l.prototype.includes=function(t,r,e){return-1!==this.indexOf(t,r,e)},l.prototype.indexOf=function(t,r,e){return U(this,t,r,e,!0)},l.prototype.lastIndexOf=function(t,r,e){return U(this,t,r,e,!1)},l.prototype.write=function(t,r,e,n){if(void 0===r)n="utf8",e=this.length,r=0;else if(void 0===e&&"string"==typeof r)n=r,e=this.length,r=0;else{if(!isFinite(r))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");r|=0,isFinite(e)?(e|=0,void 0===n&&(n="utf8")):(n=e,e=void 0)}var o=this.length-r;if((void 0===e||e>o)&&(e=o),t.length>0&&(e<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var h=!1;;)switch(n){case"hex":return P(this,t,r,e);case"utf8":case"utf-8":return R(this,t,r,e);case"ascii":return _(this,t,r,e);case"latin1":case"binary":return S(this,t,r,e);case"base64":return T(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,t,r,e);default:if(h)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),h=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var C=4096;function M(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(127&t[i]);return n}function O(t,r,e){var n="";e=Math.min(t.length,e);for(var i=r;i<e;++i)n+=String.fromCharCode(t[i]);return n}function k(t,r,e){var n=t.length;(!r||r<0)&&(r=0),(!e||e<0||e>n)&&(e=n);for(var o="",i=r;i<e;++i)o+=W(t[i]);return o}function D(t,r,e){for(var n=t.slice(r,e),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function N(t,r,e){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function j(t,r,e,n,o,h){if(!l.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||r<h)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function F(t,r,e,n){r<0&&(r=65535+r+1);for(var i=0,o=Math.min(t.length-e,2);i<o;++i)t[e+i]=(r&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function z(t,r,e,n){r<0&&(r=4294967295+r+1);for(var i=0,o=Math.min(t.length-e,4);i<o;++i)t[e+i]=r>>>8*(n?i:3-i)&255}function G(t,r,e,n,o,h){if(e+n>t.length)throw new RangeError("Index out of range");if(e<0)throw new RangeError("Index out of range")}function V(t,r,e,n,h){return h||G(t,0,e,4),o.write(t,r,e,n,23,4),e+4}function J(t,r,e,n,h){return h||G(t,0,e,8),o.write(t,r,e,n,52,8),e+8}l.prototype.slice=function(t,r){var e,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(r=void 0===r?n:~~r)<0?(r+=n)<0&&(r=0):r>n&&(r=n),r<t&&(r=t),l.TYPED_ARRAY_SUPPORT)(e=this.subarray(t,r)).__proto__=l.prototype;else{var o=r-t;e=new l(o,void 0);for(var i=0;i<o;++i)e[i]=this[i+t]}return e},l.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||N(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n},l.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||N(t,r,this.length);for(var n=this[t+--r],o=1;r>0&&(o*=256);)n+=this[t+--r]*o;return n},l.prototype.readUInt8=function(t,r){return r||N(t,1,this.length),this[t]},l.prototype.readUInt16LE=function(t,r){return r||N(t,2,this.length),this[t]|this[t+1]<<8},l.prototype.readUInt16BE=function(t,r){return r||N(t,2,this.length),this[t]<<8|this[t+1]},l.prototype.readUInt32LE=function(t,r){return r||N(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},l.prototype.readUInt32BE=function(t,r){return r||N(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},l.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||N(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*r)),n},l.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||N(t,r,this.length);for(var i=r,n=1,o=this[t+--i];i>0&&(n*=256);)o+=this[t+--i]*n;return o>=(n*=128)&&(o-=Math.pow(2,8*r)),o},l.prototype.readInt8=function(t,r){return r||N(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},l.prototype.readInt16LE=function(t,r){r||N(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},l.prototype.readInt16BE=function(t,r){r||N(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},l.prototype.readInt32LE=function(t,r){return r||N(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},l.prototype.readInt32BE=function(t,r){return r||N(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},l.prototype.readFloatLE=function(t,r){return r||N(t,4,this.length),o.read(this,t,!0,23,4)},l.prototype.readFloatBE=function(t,r){return r||N(t,4,this.length),o.read(this,t,!1,23,4)},l.prototype.readDoubleLE=function(t,r){return r||N(t,8,this.length),o.read(this,t,!0,52,8)},l.prototype.readDoubleBE=function(t,r){return r||N(t,8,this.length),o.read(this,t,!1,52,8)},l.prototype.writeUIntLE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||j(this,t,r,e,Math.pow(2,8*e)-1,0);var o=1,i=0;for(this[r]=255&t;++i<e&&(o*=256);)this[r+i]=t/o&255;return r+e},l.prototype.writeUIntBE=function(t,r,e,n){(t=+t,r|=0,e|=0,n)||j(this,t,r,e,Math.pow(2,8*e)-1,0);var i=e-1,o=1;for(this[r+i]=255&t;--i>=0&&(o*=256);)this[r+i]=t/o&255;return r+e},l.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,1,255,0),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},l.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):F(this,t,r,!0),r+2},l.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):F(this,t,r,!1),r+2},l.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):z(this,t,r,!0),r+4},l.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},l.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var o=Math.pow(2,8*e-1);j(this,t,r,e,o-1,-o)}var i=0,h=1,sub=0;for(this[r]=255&t;++i<e&&(h*=256);)t<0&&0===sub&&0!==this[r+i-1]&&(sub=1),this[r+i]=(t/h>>0)-sub&255;return r+e},l.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var o=Math.pow(2,8*e-1);j(this,t,r,e,o-1,-o)}var i=e-1,h=1,sub=0;for(this[r+i]=255&t;--i>=0&&(h*=256);)t<0&&0===sub&&0!==this[r+i+1]&&(sub=1),this[r+i]=(t/h>>0)-sub&255;return r+e},l.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[r]=255&t,r+1},l.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):F(this,t,r,!0),r+2},l.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):F(this,t,r,!1),r+2},l.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):z(this,t,r,!0),r+4},l.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||j(this,t,r,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):z(this,t,r,!1),r+4},l.prototype.writeFloatLE=function(t,r,e){return V(this,t,r,!0,e)},l.prototype.writeFloatBE=function(t,r,e){return V(this,t,r,!1,e)},l.prototype.writeDoubleLE=function(t,r,e){return J(this,t,r,!0,e)},l.prototype.writeDoubleBE=function(t,r,e){return J(this,t,r,!1,e)},l.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),r>=t.length&&(r=t.length),r||(r=0),n>0&&n<e&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(e<0||e>=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-r<n-e&&(n=t.length-r+e);var i,o=n-e;if(this===t&&e<r&&r<n)for(i=o-1;i>=0;--i)t[i+r]=this[i+e];else if(o<1e3||!l.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+r]=this[i+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+o),r);return o},l.prototype.fill=function(t,r,e,n){if("string"==typeof t){if("string"==typeof r?(n=r,r=0,e=this.length):"string"==typeof e&&(n=e,e=this.length),1===t.length){var code=t.charCodeAt(0);code<256&&(t=code)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(r<0||this.length<r||this.length<e)throw new RangeError("Out of range index");if(e<=r)return this;var i;if(r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0),"number"==typeof t)for(i=r;i<e;++i)this[i]=t;else{var o=l.isBuffer(t)?t:H(new l(t,n).toString()),h=o.length;for(i=0;i<e-r;++i)this[i+r]=o[i%h]}return this};var X=/[^+\/0-9A-Za-z-_]/g;function W(t){return t<16?"0"+t.toString(16):t.toString(16)}function H(t,r){var e;r=r||1/0;for(var n=t.length,o=null,h=[],i=0;i<n;++i){if((e=t.charCodeAt(i))>55295&&e<57344){if(!o){if(e>56319){(r-=3)>-1&&h.push(239,191,189);continue}if(i+1===n){(r-=3)>-1&&h.push(239,191,189);continue}o=e;continue}if(e<56320){(r-=3)>-1&&h.push(239,191,189),o=e;continue}e=65536+(o-55296<<10|e-56320)}else o&&(r-=3)>-1&&h.push(239,191,189);if(o=null,e<128){if((r-=1)<0)break;h.push(e)}else if(e<2048){if((r-=2)<0)break;h.push(e>>6|192,63&e|128)}else if(e<65536){if((r-=3)<0)break;h.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(!(e<1114112))throw new Error("Invalid code point");if((r-=4)<0)break;h.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return h}function K(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(X,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function Z(t,r,e,n){for(var i=0;i<n&&!(i+e>=r.length||i>=t.length);++i)r[i+e]=t[i];return i}}).call(this,e(41))},239:function(t,r,e){"use strict";r.byteLength=function(t){var r=c(t),e=r[0],n=r[1];return 3*(e+n)/4-n},r.toByteArray=function(t){var r,i,e=c(t),n=e[0],f=e[1],l=new h(function(t,r,e){return 3*(r+e)/4-e}(0,n,f)),d=0,w=f>0?n-4:n;for(i=0;i<w;i+=4)r=o[t.charCodeAt(i)]<<18|o[t.charCodeAt(i+1)]<<12|o[t.charCodeAt(i+2)]<<6|o[t.charCodeAt(i+3)],l[d++]=r>>16&255,l[d++]=r>>8&255,l[d++]=255&r;2===f&&(r=o[t.charCodeAt(i)]<<2|o[t.charCodeAt(i+1)]>>4,l[d++]=255&r);1===f&&(r=o[t.charCodeAt(i)]<<10|o[t.charCodeAt(i+1)]<<4|o[t.charCodeAt(i+2)]>>2,l[d++]=r>>8&255,l[d++]=255&r);return l},r.fromByteArray=function(t){for(var r,e=t.length,o=e%3,h=[],f=16383,i=0,c=e-o;i<c;i+=f)h.push(l(t,i,i+f>c?c:i+f));1===o?(r=t[e-1],h.push(n[r>>2]+n[r<<4&63]+"==")):2===o&&(r=(t[e-2]<<8)+t[e-1],h.push(n[r>>10]+n[r>>4&63]+n[r<<2&63]+"="));return h.join("")};for(var n=[],o=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,f=code.length;i<f;++i)n[i]=code[i],o[code.charCodeAt(i)]=i;function c(t){var r=t.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var e=t.indexOf("=");return-1===e&&(e=r),[e,e===r?0:4-e%4]}function l(t,r,e){for(var o,h,output=[],i=r;i<e;i+=3)o=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(255&t[i+2]),output.push(n[(h=o)>>18&63]+n[h>>12&63]+n[h>>6&63]+n[63&h]);return output.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},240:function(t,r){r.read=function(t,r,e,n,o){var h,f,c=8*o-n-1,l=(1<<c)-1,d=l>>1,w=-7,i=e?o-1:0,y=e?-1:1,s=t[r+i];for(i+=y,h=s&(1<<-w)-1,s>>=-w,w+=c;w>0;h=256*h+t[r+i],i+=y,w-=8);for(f=h&(1<<-w)-1,h>>=-w,w+=n;w>0;f=256*f+t[r+i],i+=y,w-=8);if(0===h)h=1-d;else{if(h===l)return f?NaN:1/0*(s?-1:1);f+=Math.pow(2,n),h-=d}return(s?-1:1)*f*Math.pow(2,h-n)},r.write=function(t,r,e,n,o,h){var f,c,l,d=8*h-o-1,w=(1<<d)-1,y=w>>1,rt=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,i=n?0:h-1,E=n?1:-1,s=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(c=isNaN(r)?1:0,f=w):(f=Math.floor(Math.log(r)/Math.LN2),r*(l=Math.pow(2,-f))<1&&(f--,l*=2),(r+=f+y>=1?rt/l:rt*Math.pow(2,1-y))*l>=2&&(f++,l/=2),f+y>=w?(c=0,f=w):f+y>=1?(c=(r*l-1)*Math.pow(2,o),f+=y):(c=r*Math.pow(2,y-1)*Math.pow(2,o),f=0));o>=8;t[e+i]=255&c,i+=E,c/=256,o-=8);for(f=f<<o|c,d+=o;d>0;t[e+i]=255&f,i+=E,f/=256,d-=8);t[e+i-E]|=128*s}},241:function(t,r){var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},242:function(t,r,e){"use strict";(function(t){Object.defineProperty(r,"__esModule",{value:!0});const e={validate:t=>"BM"===t.toString("ascii",0,2),calculate:t=>({height:Math.abs(t.readInt32LE(22)),width:t.readUInt32LE(18)})};function n(t,r){const e=t.readUInt8(r);return 0===e?256:e}function o(t,r){const e=6+16*r;return{height:n(t,e+1),width:n(t,e)}}const h={validate:t=>0===t.readUInt16LE(0)&&1===t.readUInt16LE(2),calculate(t){const r=t.readUInt16LE(4),e=o(t,0);if(1===r)return e;const n=[e];for(let e=1;e<r;e+=1)n.push(o(t,e));return{height:e.height,images:n,width:e.width}}},f={validate:t=>0===t.readUInt16LE(0)&&2===t.readUInt16LE(2),calculate:t=>h.calculate(t)},c={validate:t=>542327876===t.readUInt32LE(0),calculate:t=>({height:t.readUInt32LE(12),width:t.readUInt32LE(16)})},l=/^GIF8[79]a/,d={validate(t){const r=t.toString("ascii",0,6);return l.test(r)},calculate:t=>({height:t.readUInt16LE(8),width:t.readUInt16LE(6)})},w={ICON:32,"ICN#":32,"icm#":16,icm4:16,icm8:16,"ics#":16,ics4:16,ics8:16,is32:16,s8mk:16,icp4:16,icl4:32,icl8:32,il32:32,l8mk:32,icp5:32,ic11:32,ich4:48,ich8:48,ih32:48,h8mk:48,icp6:64,ic12:32,it32:128,t8mk:128,ic07:128,ic08:256,ic13:256,ic09:512,ic14:512,ic10:1024};function y(t,r){const e=r+4;return[t.toString("ascii",r,e),t.readUInt32BE(e)]}function E(t){const r=w[t];return{width:r,height:r,type:t}}const v={validate:t=>"icns"===t.toString("ascii",0,4),calculate(t){const r=t.length,e=t.readUInt32BE(4);let n=8,o=y(t,n),h=E(o[0]);if(n+=o[1],n===e)return h;const f={height:h.height,images:[h],width:h.width};for(;n<e&&n<r;)o=y(t,n),h=E(o[0]),n+=o[1],f.images.push(h);return f}},m={validate:t=>"ff4fff51"===t.toString("hex",0,4),calculate:t=>({height:t.readUInt32BE(12),width:t.readUInt32BE(8)})},A="66747970",I="6a703268",U="6a502020",B="72726571",P=t=>({height:t.readUInt32BE(4),width:t.readUInt32BE(8)}),R={validate(t){const r=t.toString("hex",4,8),e=t.readUInt32BE(0);if(r!==U||e<1)return!1;const n=e+4,o=t.readUInt32BE(e);return t.slice(n,n+o).toString("hex",0,4)===A},calculate(t){const r=t.readUInt32BE(0);let e=r+4+t.readUInt16BE(r+2);switch(t.toString("hex",e,e+4)){case B:return e=e+4+4+(t=>{const r=t.readUInt8(0);let e=1+2*r;return e=e+2+t.readUInt16BE(e)*(2+r),e+2+t.readUInt16BE(e)*(16+r)})(t.slice(e+4)),P(t.slice(e+8,e+24));case I:return P(t.slice(e+8,e+24));default:throw new TypeError("Unsupported header found: "+t.toString("ascii",e,e+4))}}};function _(t,r,e,n){e=e||0;return t["readUInt"+r+(n?"BE":"LE")].call(t,e)}function S(t){return"45786966"===t.toString("hex",2,6)}function T(t,r){return{height:t.readUInt16BE(r),width:t.readUInt16BE(r+2)}}function L(t,r){const e=t.slice(2,r),n=e.toString("hex",6,8),o="4d4d"===n;if(o||"4949"===n)return function(t,r){const e=_(t,16,14,r);for(let n=0;n<e;n++){const e=16+12*n,o=e+12;if(e>t.length)return;const h=t.slice(e,o);if(274===_(h,16,0,r)){if(3!==_(h,16,2,r))return;if(1!==_(h,32,4,r))return;return _(h,16,8,r)}}}(e,o)}function Y(t,r){if(r>t.length)throw new TypeError("Corrupt JPG, exceeded buffer limits");if(255!==t[r])throw new TypeError("Invalid JPG, marker table corrupted")}const x={validate:t=>"ffd8"===t.toString("hex",0,2),calculate(t){let r,e;for(t=t.slice(4);t.length;){const i=t.readUInt16BE(0);if(S(t)&&(r=L(t,i)),Y(t,i),e=t[i+1],192===e||193===e||194===e){const e=T(t,i+5);return r?{height:e.height,orientation:r,width:e.width}:e}t=t.slice(i+2)}throw new TypeError("Invalid JPG, no size found")}},C={validate:t=>"KTX 11"===t.toString("ascii",1,7),calculate:t=>({height:t.readUInt32LE(40),width:t.readUInt32LE(36)})},M="CgBI",O={validate(t){if("PNG\r\n\n"===t.toString("ascii",1,8)){let r=t.toString("ascii",12,16);if(r===M&&(r=t.toString("ascii",28,32)),"IHDR"!==r)throw new TypeError("Invalid PNG");return!0}return!1},calculate:t=>t.toString("ascii",12,16)===M?{height:t.readUInt32BE(36),width:t.readUInt32BE(32)}:{height:t.readUInt32BE(20),width:t.readUInt32BE(16)}},k={P1:"pbm/ascii",P2:"pgm/ascii",P3:"ppm/ascii",P4:"pbm",P5:"pgm",P6:"ppm",P7:"pam",PF:"pfm"},D=Object.keys(k),N={default:t=>{let r=[];for(;t.length>0;){const line=t.shift();if("#"!==line[0]){r=line.split(" ");break}}if(2===r.length)return{height:parseInt(r[1],10),width:parseInt(r[0],10)};throw new TypeError("Invalid PNM")},pam:t=>{const r={};for(;t.length>0;){const line=t.shift();if(line.length>16||line.charCodeAt(0)>128)continue;const[e,n]=line.split(" ");if(e&&n&&(r[e.toLowerCase()]=parseInt(n,10)),r.height&&r.width)break}if(r.height&&r.width)return{height:r.height,width:r.width};throw new TypeError("Invalid PAM")}},j=/<svg\s([^>"']|"[^"]*"|'[^']*')*>/,F={height:/\sheight=(['"])([^%]+?)\1/,root:j,viewbox:/\sviewBox=(['"])(.+?)\1/,width:/\swidth=(['"])([^%]+?)\1/},z=2.54,G={cm:96/z,em:16,ex:8,m:96/z*100,mm:96/z/10,pc:96/72/12,pt:96/72};function V(t){const r=/([0-9.]+)([a-z]*)/.exec(t);if(r)return Math.round(parseFloat(r[1])*(G[r[2]]||1))}function J(t){const r=t.split(" ");return{height:V(r[3]),width:V(r[2])}}const X={bmp:e,cur:f,dds:c,gif:d,icns:v,ico:h,j2c:m,jp2:R,jpg:x,ktx:C,png:O,pnm:{validate(t){const r=t.toString("ascii",0,2);return D.includes(r)},calculate(t){const r=t.toString("ascii",0,2),e=k[r],n=t.toString("ascii",3).split(/[\r\n]+/);return(N[e]||N.default)(n)}},psd:{validate:t=>"8BPS"===t.toString("ascii",0,4),calculate:t=>({height:t.readUInt32BE(14),width:t.readUInt32BE(18)})},svg:{validate(t){const r=String(t);return j.test(r)},calculate(t){const r=t.toString("utf8").match(F.root);if(r){const t=function(t){const r=t.match(F.width),e=t.match(F.height),n=t.match(F.viewbox);return{height:e&&V(e[2]),viewbox:n&&J(n[2]),width:r&&V(r[2])}}(r[0]);if(t.width&&t.height)return function(t){return{height:t.height,width:t.width}}(t);if(t.viewbox)return function(t,r){const e=r.width/r.height;return t.width?{height:Math.floor(t.width/e),width:t.width}:t.height?{height:t.height,width:Math.floor(t.height*e)}:{height:r.height,width:r.width}}(t,t.viewbox)}throw new TypeError("Invalid SVG")}},webp:{validate(t){const r="RIFF"===t.toString("ascii",0,4),e="WEBP"===t.toString("ascii",8,12),n="VP8"===t.toString("ascii",12,15);return r&&e&&n},calculate(t){const r=t.toString("ascii",12,16);if(t=t.slice(20,30),"VP8X"===r){const r=t[0],e=0==(1&r);if(0==(192&r)&&e)return function(t){return{height:1+t.readUIntLE(7,3),width:1+t.readUIntLE(4,3)}}(t);throw new TypeError("Invalid WebP")}if("VP8 "===r&&47!==t[0])return function(t){return{height:16383&t.readInt16LE(8),width:16383&t.readInt16LE(6)}}(t);const e=t.toString("hex",3,6);if("VP8L"===r&&"9d012a"!==e)return function(t){return{height:1+((15&t[4])<<10|t[3]<<2|(192&t[2])>>6),width:1+((63&t[2])<<8|t[1])}}(t);throw new TypeError("Invalid WebP")}}},W=Object.keys(X),H={56:"psd",66:"bmp",68:"dds",71:"gif",73:"tiff",77:"tiff",82:"webp",105:"icns",137:"png",255:"jpg"};function K(t,r){const e=function(t){const r=t[0];if(r in H){const e=H[r];if(X[e].validate(t))return e}return W.find((r=>X[r].validate(t)))}(t);if(e&&e in X){const n=X[e].calculate(t,r);if(void 0!==n)return n.type=e,n.mimeType=(t=>"svg"===t?"image/svg+xml":`image/${t}`)(e),n}throw new TypeError("unsupported file type: "+e+" (file: "+r+")")}const Z=Object.keys(X);r.default=function(input){if(t.isBuffer(input))return K(input);throw new Error("Input should be buffer!")},r.types=Z}).call(this,e(238).Buffer)}}]); |