varsnap 1.8.4 → 1.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +0,0 @@
1
- /*
2
- * Varsnap.js v1.8.4
3
- */
4
- !function(e){!function(t){"object"==typeof e&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).varsnap=t()}(function(){function L(r,n){return function(){for(var t=new Array(arguments.length),e=0;e<t.length;e++)t[e]=arguments[e];return r.apply(n,t)}}I=function(t,R){!function(t){!function(){"use strict";function c(t){if(2147483647<t)throw new RangeError('The value "'+t+'" is invalid for option "size"');t=new Uint8Array(t);return t.__proto__=h.prototype,t}function h(t,e,r){if("number"!=typeof t)return n(t,e,r);if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return i(t)}function n(t,e,r){if("string"==typeof t){var n=t,o=e;if(h.isEncoding(o="string"==typeof o&&""!==o?o:"utf8"))return(n=(s=c(i=0|d(n,o))).write(n,o))!==i?s.slice(0,n):s;throw new TypeError("Unknown encoding: "+o)}if(ArrayBuffer.isView(t))return l(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(T(t,ArrayBuffer)||t&&T(t.buffer,ArrayBuffer)){var i=t,n=e,s=r;if(n<0||i.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(i.byteLength<n+(s||0))throw new RangeError('"length" is outside of buffer bounds');return(i=void 0===n&&void 0===s?new Uint8Array(i):void 0===s?new Uint8Array(i,n):new Uint8Array(i,n,s)).__proto__=h.prototype,i}if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');o=t.valueOf&&t.valueOf();if(null!=o&&o!==t)return h.from(o,e,r);var a,u,f=h.isBuffer(a=t)?(0!==(u=c(f=0|p(a.length))).length&&a.copy(u,0,0,f),u):void 0!==a.length?"number"!=typeof a.length||S(a.length)?c(0):l(a):"Buffer"===a.type&&Array.isArray(a.data)?l(a.data):void 0;if(f)return f;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return h.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function o(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function i(t){return o(t),c(t<0?0:0|p(t))}function l(t){for(var e=t.length<0?0:0|p(t.length),r=c(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function p(t){if(2147483647<=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function d(t,e){if(h.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||T(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=2<arguments.length&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return b(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return E(t).length;default:if(o)return n?-1:b(t).length;e=(""+e).toLowerCase(),o=!0}}function r(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function s(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),(r=(r=S(r=+r)?o?0:t.length-1:r)<0?t.length+r:r)>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=h.from(e,n)),h.isBuffer(e))return 0===e.length?-1:a(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?(o?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(t,e,r):a(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function a(t,e,r,n,o){var i=1,s=t.length,a=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/=i=2,a/=2,r/=2}function u(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(o)for(var f=-1,c=r;c<s;c++)if(u(t,c)===u(e,-1===f?0:c-f)){if(c-(f=-1===f?c:f)+1===a)return f*i}else-1!==f&&(c-=c-f),f=-1;else for(c=r=s<r+a?s-a:r;0<=c;c--){for(var h=!0,l=0;l<a;l++)if(u(t,c+l)!==u(e,l)){h=!1;break}if(h)return c}return-1}function v(t,e,r,n){return A(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function _(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,s,a,u,f=t[o],c=null,h=239<f?4:223<f?3:191<f?2:1;if(o+h<=r)switch(h){case 1:f<128&&(c=f);break;case 2:128==(192&(i=t[o+1]))&&127<(u=(31&f)<<6|63&i)&&(c=u);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&2047<(u=(15&f)<<12|(63&i)<<6|63&s)&&(u<55296||57343<u)&&(c=u);break;case 4:i=t[o+1],s=t[o+2],a=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&65535<(u=(15&f)<<18|(63&i)<<12|(63&s)<<6|63&a)&&u<1114112&&(c=u)}null===c?(c=65533,h=1):65535<c&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),o+=h}var l=n,p=l.length;if(p<=y)return String.fromCharCode.apply(String,l);for(var d="",g=0;g<p;)d+=String.fromCharCode.apply(String,l.slice(g,g+=y));return d}R.Buffer=h,R.INSPECT_MAX_BYTES=50,(h.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){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(h.prototype,"parent",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.buffer}}),Object.defineProperty(h.prototype,"offset",{enumerable:!0,get:function(){if(h.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&h[Symbol.species]===h&&Object.defineProperty(h,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),h.poolSize=8192,h.from=n,h.prototype.__proto__=Uint8Array.prototype,h.__proto__=Uint8Array,h.alloc=function(t,e,r){return e=e,r=r,o(t=t),!(t<=0)&&void 0!==e?"string"==typeof r?c(t).fill(e,r):c(t).fill(e):c(t)},h.allocUnsafe=i,h.allocUnsafeSlow=i,h.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==h.prototype},h.compare=function(t,e){if(T(t,Uint8Array)&&(t=h.from(t,t.offset,t.byteLength)),T(e,Uint8Array)&&(e=h.from(e,e.offset,e.byteLength)),!h.isBuffer(t)||!h.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];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(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return h.alloc(0);if(void 0===e)for(o=e=0;o<t.length;++o)e+=t[o].length;for(var r=h.allocUnsafe(e),n=0,o=0;o<t.length;++o){var i=t[o];if(T(i,Uint8Array)&&(i=h.from(i)),!h.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,n),n+=i.length}return r},h.byteLength=d,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)r(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)r(this,e,e+3),r(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)r(this,e,e+7),r(this,e+1,e+6),r(this,e+2,e+5),r(this,e+3,e+4);return this},h.prototype.toLocaleString=h.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?_(this,0,t):function(t,e,r){var n,o=!1;if((e=void 0===e||e<0?0:e)>this.length)return"";if((r=void 0===r||r>this.length?this.length:r)<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t=t||"utf8";;)switch(t){case"hex":var i,s=this,a=e,u=r,f=s.length;(!u||u<0||f<u)&&(u=f);for(var c="",h=a=!a||a<0?0:a;h<u;++h)c+=(i=s[h])<16?"0"+i.toString(16):i.toString(16);return c;case"utf8":case"utf-8":return _(this,e,r);case"ascii":var l=this,f=e,p=r,d="";p=Math.min(l.length,p);for(var g=f;g<p;++g)d+=String.fromCharCode(127&l[g]);return d;case"latin1":case"binary":var y=this,a=e,m=r,v="";m=Math.min(y.length,m);for(var w=a;w<m;++w)v+=String.fromCharCode(y[w]);return v;case"base64":return b=this,n=r,0===(E=e)&&n===b.length?Q.fromByteArray(b):Q.fromByteArray(b.slice(E,n));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":for(var b=e,E=r,A=this.slice(b,E),T="",S=0;S<A.length;S+=2)T+=String.fromCharCode(A[S]+256*A[S+1]);return T;default:if(o)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),o=!0}}.apply(this,arguments)},h.prototype.equals=function(t){if(h.isBuffer(t))return this===t||0===h.compare(this,t);throw new TypeError("Argument must be a Buffer")},h.prototype.inspect=function(){var t="",e=R.INSPECT_MAX_BYTES,t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim();return this.length>e&&(t+=" ... "),"<Buffer "+t+">"},h.prototype.compare=function(t,e,r,n,o){if(T(t,Uint8Array)&&(t=h.from(t,t.offset,t.byteLength)),!h.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),(e=void 0===e?0:e)<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(o<=n&&r<=e)return 0;if(o<=n)return-1;if(r<=e)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(i,s),u=this.slice(n,o),f=t.slice(e,r),c=0;c<a;++c)if(u[c]!==f[c]){i=u[c],s=f[c];break}return i<s?-1:s<i?1:0},h.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},h.prototype.indexOf=function(t,e,r){return s(this,t,e,r,!0)},h.prototype.lastIndexOf=function(t,e,r){return s(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 o=this.length-e;if((void 0===r||o<r)&&(r=o),0<t.length&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var i,s,a,u,f,c=!1;;)switch(n){case"hex":var h=this,l=t,p=e,d=r,g=(p=Number(p)||0,h.length-p);(!d||(d=Number(d))>g)&&(d=g),(g=l.length)/2<d&&(d=g/2);for(var y=0;y<d;++y){var m=parseInt(l.substr(2*y,2),16);if(S(m))return y;h[p+y]=m}return y;case"utf8":case"utf-8":return g=e,f=r,A(b(t,(u=this).length-g),u,g,f);case"ascii":return v(this,t,e,r);case"latin1":case"binary":return v(this,t,e,r);case"base64":return u=this,f=e,a=r,A(E(t),u,f,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a=e,s=r,A(function(t,e){for(var r,n,o=[],i=0;i<t.length&&!((e-=2)<0);++i)n=(r=t.charCodeAt(i))>>8,o.push(r%256),o.push(n);return o}(t,(i=this).length-a),i,a,s);default:if(c)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),c=!0}},h.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var y=4096;function u(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(r<t+e)throw new RangeError("Trying to access beyond buffer length")}function f(t,e,r,n,o,i){if(!h.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(o<e||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function g(t,e,r,n){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function m(t,e,r,n,o){return e=+e,r>>>=0,o||g(t,0,r,4),O.write(t,e,r,n,23,4),r+4}function w(t,e,r,n,o){return e=+e,r>>>=0,o||g(t,0,r,8),O.write(t,e,r,n,52,8),r+8}h.prototype.slice=function(t,e){var r=this.length,r=((t=~~t)<0?(t+=r)<0&&(t=0):r<t&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):r<e&&(e=r),e<t&&(e=t),this.subarray(t,e));return r.__proto__=h.prototype,r},h.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||u(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},h.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||u(t,e,this.length);for(var n=this[t+--e],o=1;0<e&&(o*=256);)n+=this[t+--e]*o;return n},h.prototype.readUInt8=function(t,e){return t>>>=0,e||u(t,1,this.length),this[t]},h.prototype.readUInt16LE=function(t,e){return t>>>=0,e||u(t,2,this.length),this[t]|this[t+1]<<8},h.prototype.readUInt16BE=function(t,e){return t>>>=0,e||u(t,2,this.length),this[t]<<8|this[t+1]},h.prototype.readUInt32LE=function(t,e){return t>>>=0,e||u(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 t>>>=0,e||u(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||u(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},h.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||u(t,e,this.length);for(var n=e,o=1,i=this[t+--n];0<n&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},h.prototype.readInt8=function(t,e){return t>>>=0,e||u(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},h.prototype.readInt16LE=function(t,e){t>>>=0,e||u(t,2,this.length);e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},h.prototype.readInt16BE=function(t,e){t>>>=0,e||u(t,2,this.length);e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},h.prototype.readInt32LE=function(t,e){return t>>>=0,e||u(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 t>>>=0,e||u(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 t>>>=0,e||u(t,4,this.length),O.read(this,t,!0,23,4)},h.prototype.readFloatBE=function(t,e){return t>>>=0,e||u(t,4,this.length),O.read(this,t,!1,23,4)},h.prototype.readDoubleLE=function(t,e){return t>>>=0,e||u(t,8,this.length),O.read(this,t,!0,52,8)},h.prototype.readDoubleBE=function(t,e){return t>>>=0,e||u(t,8,this.length),O.read(this,t,!1,52,8)},h.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||f(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},h.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||f(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;0<=--o&&(i*=256);)this[e+o]=t/i&255;return e+r},h.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||f(this,t,e,1,255,0),this[e]=255&t,e+1},h.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||f(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},h.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||f(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},h.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||f(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},h.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||f(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},h.prototype.writeIntLE=function(t,e,r,n){t=+t,e>>>=0,n||f(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var o=0,i=1,s=0;for(this[e]=255&t;++o<r&&(i*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/i>>0)-s&255;return e+r},h.prototype.writeIntBE=function(t,e,r,n){t=+t,e>>>=0,n||f(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var o=r-1,i=1,s=0;for(this[e+o]=255&t;0<=--o&&(i*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/i>>0)-s&255;return e+r},h.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||f(this,t,e,1,127,-128),this[e]=255&(t=t<0?255+t+1:t),e+1},h.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||f(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},h.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||f(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},h.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||f(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},h.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||f(this,t,e,4,2147483647,-2147483648),this[e]=(t=t<0?4294967295+t+1:t)>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},h.prototype.writeFloatLE=function(t,e,r){return m(this,t,e,!0,r)},h.prototype.writeFloatBE=function(t,e,r){return m(this,t,e,!1,r)},h.prototype.writeDoubleLE=function(t,e,r){return w(this,t,e,!0,r)},h.prototype.writeDoubleBE=function(t,e,r){return w(this,t,e,!1,r)},h.prototype.copy=function(t,e,r,n){if(!h.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r=r||0,n||0===n||(n=this.length),e>=t.length&&(e=t.length),(n=0<n&&n<r?r:n)===r)return 0;if(0===t.length||0===this.length)return 0;if((e=e||0)<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);var o=(n=t.length-e<n-r?t.length-e+r:n)-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var i=o-1;0<=i;--i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return o},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),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);var o;1===t.length&&(o=t.charCodeAt(0),("utf8"===n&&o<128||"latin1"===n)&&(t=o))}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");var i;if(!(r<=e))if(e>>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(t=t||0))for(i=e;i<r;++i)this[i]=t;else{var s=h.isBuffer(t)?t:h.from(t,n),a=s.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=s[i%a]}return this};var e=/[^+/0-9A-Za-z-_]/g;function b(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],s=0;s<n;++s){if(55295<(r=t.charCodeAt(s))&&r<57344){if(!o){if(56319<r){-1<(e-=3)&&i.push(239,191,189);continue}if(s+1===n){-1<(e-=3)&&i.push(239,191,189);continue}o=r;continue}if(r<56320){-1<(e-=3)&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&-1<(e-=3)&&i.push(239,191,189);if(o=null,r<128){if(--e<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.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;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function E(t){return Q.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(e,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function A(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function T(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function S(t){return t!=t}}.call(this)}.call(this,D({}).Buffer)};var I,e,r,D=function(t){return e||I(e={exports:{},parent:t},e.exports),e.exports},n=Object.prototype.toString,M=(r=Object.create(null),function(t){t=n.call(t);return r[t]||(r[t]=t.slice(8,-1).toLowerCase())});function t(e){return e=e.toLowerCase(),function(t){return M(t)===e}}function i(t){return Array.isArray(t)}function o(t){return void 0===t}var F=t("ArrayBuffer");function z(t){return null!==t&&"object"==typeof t}function s(t){return"object"===M(t)&&(null===(t=Object.getPrototypeOf(t))||t===Object.prototype)}var a=t("Date"),u=t("File"),q=t("Blob"),V=t("FileList");function J(t){return"[object Function]"===n.call(t)}var f=t("URLSearchParams");function c(t,e){if(null!=t)if(i(t="object"!=typeof t?[t]:t))for(var r=0,n=t.length;r<n;r++)e.call(null,t[r],r,t);else for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.call(null,t[o],o,t)}h="undefined"!=typeof Uint8Array&&Object.getPrototypeOf(Uint8Array);var h,l={isArray:i,isArrayBuffer:F,isBuffer:function(t){return null!==t&&!o(t)&&null!==t.constructor&&!o(t.constructor)&&"function"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)},isFormData:function(t){return t&&("function"==typeof FormData&&t instanceof FormData||"[object FormData]"===n.call(t)||J(t.toString)&&"[object FormData]"===t.toString())},isArrayBufferView:function(t){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&F(t.buffer)},isString:function(t){return"string"==typeof t},isNumber:function(t){return"number"==typeof t},isObject:z,isPlainObject:s,isUndefined:o,isDate:a,isFile:u,isBlob:q,isStream:function(t){return z(t)&&J(t.pipe)},isURLSearchParams:f,isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&"undefined"!=typeof window&&"undefined"!=typeof document},forEach:c,merge:function r(){var n={};function t(t,e){s(n[e])&&s(t)?n[e]=r(n[e],t):s(t)?n[e]=r({},t):i(t)?n[e]=t.slice():n[e]=t}for(var e=0,o=arguments.length;e<o;e++)c(arguments[e],t);return n},extend:function(r,t,n){return c(t,function(t,e){r[e]=n&&"function"==typeof t?L(t,n):t}),r},trim:function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")},inherits:function(t,e,r,n){t.prototype=Object.create(e.prototype,n),t.prototype.constructor=t,r&&Object.assign(t.prototype,r)},toFlatObject:function(t,e,r){var n,o,i,s={};e=e||{};do{for(o=(n=Object.getOwnPropertyNames(t)).length;0<o--;)s[i=n[o]]||(e[i]=t[i],s[i]=!0)}while((t=Object.getPrototypeOf(t))&&(!r||r(t,e))&&t!==Object.prototype);return e},endsWith:function(t,e,r){t=String(t),(void 0===r||r>t.length)&&(r=t.length),r-=e.length;t=t.indexOf(e,r);return-1!==t&&t===r},toArray:function(t){if(!t)return null;var e=t.length;if(o(e))return null;for(var r=new Array(e);0<e--;)r[e]=t[e];return r},isTypedArray:function(t){return h&&t instanceof h},isFileList:V};function W(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var H=function(t,e,r){var n;return!e||(r=r?r(e):l.isURLSearchParams(e)?e.toString():(n=[],l.forEach(e,function(t,e){null!=t&&(l.isArray(t)?e+="[]":t=[t],l.forEach(t,function(t){l.isDate(t)?t=t.toISOString():l.isObject(t)&&(t=JSON.stringify(t)),n.push(W(e)+"="+W(t))}))}),n.join("&")))&&(-1!==(e=t.indexOf("#"))&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+r),t},X={};function p(){this.handlers=[]}p.prototype.use=function(t,e,r){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1},p.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},p.prototype.forEach=function(e){l.forEach(this.handlers,function(t){null!==t&&e(t)})};function Y(r,n){l.forEach(r,function(t,e){e!==n&&e.toUpperCase()===n.toUpperCase()&&(r[n]=t,delete r[e])})}var X=p,d={};function g(t,e,r,n,o){Error.call(this),this.message=t,this.name="AxiosError",e&&(this.code=e),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}l.inherits(g,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}}});var $=g.prototype,G={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED"].forEach(function(t){G[t]={value:t}}),Object.defineProperties(g,G),Object.defineProperty($,"isAxiosError",{value:!0}),g.from=function(t,e,r,n,o,i){var s=Object.create($);return l.toFlatObject(t,s,function(t){return t!==Error.prototype}),g.call(s,t.message,e,r,n,o),s.name=t.name,i&&Object.assign(s,i),s};for(var d=g,K={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Q={toByteArray:function(t){for(var e,r=function(t){var e=t.length;if(0<e%4)throw new Error("Invalid string. Length must be a multiple of 4");t=t.indexOf("=");return[t=-1===t?e:t,t===e?0:4-t%4]}(t),n=r[0],r=r[1],o=new Z(3*(n+r)/4-r),i=0,s=0<r?n-4:n,a=0;a<s;a+=4)e=m[t.charCodeAt(a)]<<18|m[t.charCodeAt(a+1)]<<12|m[t.charCodeAt(a+2)]<<6|m[t.charCodeAt(a+3)],o[i++]=e>>16&255,o[i++]=e>>8&255,o[i++]=255&e;return 2===r&&(e=m[t.charCodeAt(a)]<<2|m[t.charCodeAt(a+1)]>>4,o[i++]=255&e),1===r&&(e=m[t.charCodeAt(a)]<<10|m[t.charCodeAt(a+1)]<<4|m[t.charCodeAt(a+2)]>>2,o[i++]=e>>8&255,o[i++]=255&e),o},fromByteArray:function(t){for(var e,r=t.length,n=r%3,o=[],i=0,s=r-n;i<s;i+=16383)o.push(function(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(255&t[i+2]),o.push(y[(n=n)>>18&63]+y[n>>12&63]+y[n>>6&63]+y[63&n]);return o.join("")}(t,i,s<i+16383?s:i+16383));return 1==n?(e=t[r-1],o.push(y[e>>2]+y[e<<4&63]+"==")):2==n&&(e=(t[r-2]<<8)+t[r-1],o.push(y[e>>10]+y[e>>4&63]+y[e<<2&63]+"=")),o.join("")}},y=[],m=[],Z="undefined"!=typeof Uint8Array?Uint8Array:Array,tt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",v=0,et=tt.length;v<et;++v)y[v]=tt[v],m[tt.charCodeAt(v)]=v;m["-".charCodeAt(0)]=62,m["_".charCodeAt(0)]=63;var rt,nt,w,O={read:function(t,e,r,n,o){var i,s,a=8*o-n-1,u=(1<<a)-1,f=u>>1,c=-7,h=r?o-1:0,l=r?-1:1,o=t[e+h];for(h+=l,i=o&(1<<-c)-1,o>>=-c,c+=a;0<c;i=256*i+t[e+h],h+=l,c-=8);for(s=i&(1<<-c)-1,i>>=-c,c+=n;0<c;s=256*s+t[e+h],h+=l,c-=8);if(0===i)i=1-f;else{if(i===u)return s?NaN:1/0*(o?-1:1);s+=Math.pow(2,n),i-=f}return(o?-1:1)*s*Math.pow(2,i-n)},write:function(t,e,r,n,o,i){var s,a,u=8*i-o-1,f=(1<<u)-1,c=f>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:i-1,p=n?1:-1,i=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(n=Math.pow(2,-s))<1&&(s--,n*=2),2<=(e+=1<=s+c?h/n:h*Math.pow(2,1-c))*n&&(s++,n/=2),f<=s+c?(a=0,s=f):1<=s+c?(a=(e*n-1)*Math.pow(2,o),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,o),s=0));8<=o;t[r+l]=255&a,l+=p,a/=256,o-=8);for(s=s<<o|a,u+=o;0<u;t[r+l]=255&s,l+=p,s/=256,u-=8);t[r+l-p]|=128*i}},ot={},it=(!function(r){!function(){"use strict";ot=function(t,i){i=i||new FormData;var e=[];function s(t){return null===t?"":l.isDate(t)?t.toISOString():l.isArrayBuffer(t)||l.isTypedArray(t)?"function"==typeof Blob?new Blob([t]):r.from(t):t}return function n(t,o){if(l.isPlainObject(t)||l.isArray(t)){if(-1!==e.indexOf(t))throw Error("Circular reference detected in "+o);e.push(t),l.forEach(t,function(t,e){if(!l.isUndefined(t)){var r=o?o+"."+e:e;if(t&&!o&&"object"==typeof t)if(l.endsWith(e,"{}"))t=JSON.stringify(t);else if(l.endsWith(e,"[]")&&(e=l.toArray(t)))return void e.forEach(function(t){l.isUndefined(t)||i.append(r,s(t))});n(t,r)}}),e.pop()}else i.append(o,s(t))}(t),i}}.call(this)}.call(this,D({}).Buffer),l.isStandardBrowserEnv()?{write:function(t,e,r,n,o,i){var s=[];s.push(t+"="+encodeURIComponent(e)),l.isNumber(r)&&s.push("expires="+new Date(r).toGMTString()),l.isString(n)&&s.push("path="+n),l.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read:function(t){t=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}}),st=function(t,e){return t&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)?(t=t,(r=e)?t.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):t):e;var r},at=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"],ut=l.isStandardBrowserEnv()?(nt=/(msie|trident)/i.test(navigator.userAgent),w=document.createElement("a"),rt=ft(window.location.href),function(t){t=l.isString(t)?ft(t):t;return t.protocol===rt.protocol&&t.host===rt.host}):function(){return!0},b={};function ft(t){return nt&&(w.setAttribute("href",t),t=w.href),w.setAttribute("href",t),{href:w.href,protocol:w.protocol?w.protocol.replace(/:$/,""):"",host:w.host,search:w.search?w.search.replace(/^\?/,""):"",hash:w.hash?w.hash.replace(/^#/,""):"",hostname:w.hostname,port:w.port,pathname:"/"===w.pathname.charAt(0)?w.pathname:"/"+w.pathname}}function ct(t){d.call(this,null==t?"canceled":t,d.ERR_CANCELED),this.name="CanceledError"}l.inherits(ct,d,{__CANCEL__:!0});function ht(h){return new Promise(function(s,a){var t,r=h.data,n=h.headers,u=h.responseType;function f(){h.cancelToken&&h.cancelToken.unsubscribe(t),h.signal&&h.signal.removeEventListener("abort",t)}l.isFormData(r)&&l.isStandardBrowserEnv()&&delete n["Content-Type"];var c=new XMLHttpRequest,e=(h.auth&&(e=h.auth.username||"",i=h.auth.password?unescape(encodeURIComponent(h.auth.password)):"",n.Authorization="Basic "+btoa(e+":"+i)),st(h.baseURL,h.url));function o(){var t,e,r,n,o,i;c&&(r="getAllResponseHeaders"in c?(r=c.getAllResponseHeaders(),i={},r&&l.forEach(r.split("\n"),function(t){o=t.indexOf(":"),n=l.trim(t.substr(0,o)).toLowerCase(),o=l.trim(t.substr(o+1)),!n||i[n]&&0<=at.indexOf(n)||(i[n]="set-cookie"===n?(i[n]||[]).concat([o]):i[n]?i[n]+", "+o:o)}),i):null,t={data:u&&"text"!==u&&"json"!==u?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:h,request:c},e=t.config.validateStatus,t.status&&e&&!e(t.status)?(e=new d("Request failed with status code "+t.status,[d.ERR_BAD_REQUEST,d.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t),a(e)):s(t),f(),c=null)}c.open(h.method.toUpperCase(),H(e,h.params,h.paramsSerializer),!0),c.timeout=h.timeout,"onloadend"in c?c.onloadend=o:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(o)},c.onabort=function(){c&&(a(new d("Request aborted",d.ECONNABORTED,h,c)),c=null)},c.onerror=function(){a(new d("Network Error",d.ERR_NETWORK,h,c,c)),c=null},c.ontimeout=function(){var t=h.timeout?"timeout of "+h.timeout+"ms exceeded":"timeout exceeded",e=h.transitional||K;h.timeoutErrorMessage&&(t=h.timeoutErrorMessage),a(new d(t,e.clarifyTimeoutError?d.ETIMEDOUT:d.ECONNABORTED,h,c)),c=null},l.isStandardBrowserEnv()&&(i=(h.withCredentials||ut(e))&&h.xsrfCookieName?it.read(h.xsrfCookieName):void 0)&&(n[h.xsrfHeaderName]=i),"setRequestHeader"in c&&l.forEach(n,function(t,e){void 0===r&&"content-type"===e.toLowerCase()?delete n[e]:c.setRequestHeader(e,t)}),l.isUndefined(h.withCredentials)||(c.withCredentials=!!h.withCredentials),u&&"json"!==u&&(c.responseType=h.responseType),"function"==typeof h.onDownloadProgress&&c.addEventListener("progress",h.onDownloadProgress),"function"==typeof h.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",h.onUploadProgress),(h.cancelToken||h.signal)&&(t=function(t){c&&(a(!t||t.type?new b:t),c.abort(),c=null)},h.cancelToken&&h.cancelToken.subscribe(t),h.signal&&(h.signal.aborted?t():h.signal.addEventListener("abort",t)));var i,r=r||null,e=(i=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e))&&i[1]||"";e&&-1===["http","https","file"].indexOf(e)?a(new d("Unsupported protocol "+e+":",d.ERR_BAD_REQUEST,h)):c.send(r)})}var E,A,b=ct,u=a={};function lt(){throw new Error("setTimeout has not been defined")}function pt(){throw new Error("clearTimeout has not been defined")}function dt(e){if(E===setTimeout)return setTimeout(e,0);if((E===lt||!E)&&setTimeout)return(E=setTimeout)(e,0);try{return E(e,0)}catch(t){try{return E.call(null,e,0)}catch(t){return E.call(this,e,0)}}}try{E="function"==typeof setTimeout?setTimeout:lt}catch(t){E=lt}try{A="function"==typeof clearTimeout?clearTimeout:pt}catch(t){A=pt}var T,S=[],_=!1,R=-1;function gt(){_&&T&&(_=!1,T.length?S=T.concat(S):R=-1,S.length&&yt())}function yt(){if(!_){var t=dt(gt);_=!0;for(var e=S.length;e;){for(T=S,S=[];++R<e;)T&&T[R].run();R=-1,e=S.length}T=null,_=!1,function(e){if(A===clearTimeout)return clearTimeout(e);if((A===pt||!A)&&clearTimeout)return(A=clearTimeout)(e);try{A(e)}catch(t){try{return A.call(null,e)}catch(t){return A.call(this,e)}}}(t)}}function mt(t,e){this.fun=t,this.array=e}function C(){}u.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];S.push(new mt(t,e)),1!==S.length||_||dt(yt)},mt.prototype.run=function(){this.fun.apply(null,this.array)},u.title="browser",u.browser=!0,u.env={},u.argv=[],u.version="",u.versions={},u.on=C,u.addListener=C,u.once=C,u.off=C,u.removeListener=C,u.removeAllListeners=C,u.emit=C,u.prependListener=C,u.prependOnceListener=C,u.listeners=function(t){return[]},u.binding=function(t){throw new Error("process.binding is not supported")},u.cwd=function(){return"/"},u.chdir=function(t){throw new Error("process.chdir is not supported")},u.umask=function(){return 0};var B={},vt=(!function(r){!function(){"use strict";var e={"Content-Type":"application/x-www-form-urlencoded"};function s(t,e){!l.isUndefined(t)&&l.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}var t,n={transitional:K,adapter:t="undefined"!=typeof XMLHttpRequest||void 0!==r&&"[object process]"===Object.prototype.toString.call(r)?ht:t,transformRequest:[function(t,e){if(Y(e,"Accept"),Y(e,"Content-Type"),!(l.isFormData(t)||l.isArrayBuffer(t)||l.isBuffer(t)||l.isStream(t)||l.isFile(t)||l.isBlob(t))){if(l.isArrayBufferView(t))return t.buffer;if(l.isURLSearchParams(t))return s(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString();var r,n=l.isObject(t),o=e&&e["Content-Type"];if((i=l.isFileList(t))||n&&"multipart/form-data"===o)return r=this.env&&this.env.FormData,ot(i?{"files[]":t}:t,r&&new r);if(n||"application/json"===o){s(e,"application/json");var i=t;if(l.isString(i))try{return(0,JSON.parse)(i),l.trim(i)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(i)}}return t}],transformResponse:[function(t){var e=this.transitional||n.transitional,r=e&&e.silentJSONParsing,e=e&&e.forcedJSONParsing,r=!r&&"json"===this.responseType;if(r||e&&l.isString(t)&&t.length)try{return JSON.parse(t)}catch(t){if(r){if("SyntaxError"===t.name)throw d.from(t,d.ERR_BAD_RESPONSE,this,null,this.response);throw t}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:null},validateStatus:function(t){return 200<=t&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};l.forEach(["delete","get","head"],function(t){n.headers[t]={}}),l.forEach(["post","put","patch"],function(t){n.headers[t]=l.merge(e)}),B=n}.call(this)}.call(this,a),function(e,r,t){var n=this||B;return l.forEach(t,function(t){e=t.call(n,e,r)}),e}),wt=function(t){return!(!t||!t.__CANCEL__)};function bt(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new b}function Et(e){return bt(e),e.headers=e.headers||{},e.data=vt.call(e,e.data,e.headers,e.transformRequest),e.headers=l.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),l.forEach(["delete","get","head","post","put","patch","common"],function(t){delete e.headers[t]}),(e.adapter||B.adapter)(e).then(function(t){return bt(e),t.data=vt.call(e,t.data,t.headers,e.transformResponse),t},function(t){return wt(t)||(bt(e),t&&t.response&&(t.response.data=vt.call(e,t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)})}function U(e,r){r=r||{};var n={};function o(t,e){return l.isPlainObject(t)&&l.isPlainObject(e)?l.merge(t,e):l.isPlainObject(e)?l.merge({},e):l.isArray(e)?e.slice():e}function i(t){return l.isUndefined(r[t])?l.isUndefined(e[t])?void 0:o(void 0,e[t]):o(e[t],r[t])}function t(t){if(!l.isUndefined(r[t]))return o(void 0,r[t])}function s(t){return l.isUndefined(r[t])?l.isUndefined(e[t])?void 0:o(void 0,e[t]):o(void 0,r[t])}function a(t){return t in r?o(e[t],r[t]):t in e?o(void 0,e[t]):void 0}var u={url:t,method:t,data:t,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a};return l.forEach(Object.keys(e).concat(Object.keys(r)),function(t){var e=u[t]||i,r=e(t);l.isUndefined(r)&&e!==a||(n[t]=r)}),n}var At,Tt={},St=(["object","boolean","number","function","string","symbol"].forEach(function(e,r){Tt[e]=function(t){return typeof t===e||"a"+(r<1?"n ":" ")+e}}),{}),k=(Tt.transitional=function(n,o,r){function i(t,e){return"[Axios v0.27.2] Transitional option '"+t+"'"+e+(r?". "+r:"")}return function(t,e,r){if(!1===n)throw new d(i(e," has been removed"+(o?" in "+o:"")),d.ERR_DEPRECATED);return o&&!St[e]&&(St[e]=!0,console.warn(i(e," has been deprecated since v"+o+" and will be removed in the near future"))),!n||n(t,e,r)}},{}),x=(At={assertOptions:function(t,e,r){if("object"!=typeof t)throw new d("options must be an object",d.ERR_BAD_OPTION_VALUE);for(var n=Object.keys(t),o=n.length;0<o--;){var i=n[o],s=e[i];if(s){var a=t[i],s=void 0===a||s(a,i,t);if(!0!==s)throw new d("option "+i+" must be "+s,d.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new d("Unknown option "+i,d.ERR_BAD_OPTION)}},validators:Tt}).validators;function j(t){this.defaults=t,this.interceptors={request:new X,response:new X}}function N(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");this.promise=new Promise(function(t){e=t});var e,n=this;this.promise.then(function(t){if(n._listeners){for(var e=n._listeners.length,r=0;r<e;r++)n._listeners[r](t);n._listeners=null}}),this.promise.then=function(t){var e,t=new Promise(function(t){n.subscribe(t),e=t}).then(t);return t.cancel=function(){n.unsubscribe(e)},t},t(function(t){n.reason||(n.reason=new b(t),e(n.reason))})}j.prototype.request=function(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},(e=U(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=e.transitional,r=(void 0!==t&&At.assertOptions(t,{silentJSONParsing:x.transitional(x.boolean),forcedJSONParsing:x.transitional(x.boolean),clarifyTimeoutError:x.transitional(x.boolean)},!1),[]),n=!0;this.interceptors.request.forEach(function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(n=n&&t.synchronous,r.unshift(t.fulfilled,t.rejected))});var o,i=[];if(this.interceptors.response.forEach(function(t){i.push(t.fulfilled,t.rejected)}),n){for(var s=e;r.length;){var a=r.shift(),u=r.shift();try{s=a(s)}catch(t){u(t);break}}try{o=Et(s)}catch(t){return Promise.reject(t)}for(;i.length;)o=o.then(i.shift(),i.shift())}else{var f=[Et,void 0];for(Array.prototype.unshift.apply(f,r),f=f.concat(i),o=Promise.resolve(e);f.length;)o=o.then(f.shift(),f.shift())}return o},j.prototype.getUri=function(t){t=U(this.defaults,t);var e=st(t.baseURL,t.url);return H(e,t.params,t.paramsSerializer)},l.forEach(["delete","get","head","options"],function(r){j.prototype[r]=function(t,e){return this.request(U(e||{},{method:r,url:t,data:(e||{}).data}))}}),l.forEach(["post","put","patch"],function(o){function t(n){return function(t,e,r){return this.request(U(r||{},{method:o,headers:n?{"Content-Type":"multipart/form-data"}:{},url:t,data:e}))}}j.prototype[o]=t(),j.prototype[o+"Form"]=t(!0)}),k=j,N.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},N.prototype.subscribe=function(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]},N.prototype.unsubscribe=function(t){this._listeners&&-1!==(t=this._listeners.indexOf(t))&&this._listeners.splice(t,1)},N.source=function(){var e;return{token:new N(function(t){e=t}),cancel:e}};var q=N,f=function e(r){var t=new k(r),n=L(k.prototype.request,t);return l.extend(n,k.prototype,t),l.extend(n,t),n.create=function(t){return e(U(r,t))},n}(B),_t=(f.Axios=k,f.CanceledError=b,f.CancelToken=q,f.isCancel=wt,f.VERSION="0.27.2",f.toFormData=ot,f.AxiosError=d,f.Cancel=f.CanceledError,f.all=function(t){return Promise.all(t)},f.spread=function(e){return function(t){return e.apply(null,t)}},f.isAxiosError=function(t){return l.isObject(t)&&!0===t.isAxiosError},f.default=f),Rt={},P={};return function(m){!function(){"use strict";function f(t,e){var r,n,o,i,s="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(s)return o=!(n=!0),{s:function(){s=s.call(t)},n:function(){var t=s.next();return n=t.done,t},e:function(t){o=!0,r=t},f:function(){try{n||null==s.return||s.return()}finally{if(o)throw r}}};if(Array.isArray(t)||(s=c(t))||e&&t&&"number"==typeof t.length)return s&&(t=s),i=0,{s:e=function(){},n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:e};throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(t,e){var r;if(t)return"string"==typeof t?h(t,e):"Map"===(r="Object"===(r=Object.prototype.toString.call(t).slice(8,-1))&&t.constructor?t.constructor.name:r)||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?h(t,e):void 0}function h(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function t(t,e,r){e&&o(t.prototype,e),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1})}Object.defineProperty(P,"__esModule",{value:!0}),P.varsnap=P.clientName=P.version=void 0,P.version="1.8.4",P.clientName="javascript."+P.version;var r={varsnap:!0,env:"development",branch:"",producerToken:"",consumerToken:"",logger:console},s=[],a=[],l=(t(g,null,[{key:"getConfig",value:function(t,e){return(t=t&&t[e])?t.toString().toLowerCase():""}},{key:"setConfig",value:function(t,e,r){return"varsnap"===e&&(t[e]=r="string"==typeof r?"true"===r:r),"env"!==e&&"producerToken"!==e&&"consumerToken"!==e&&"branch"!==e||(t[e]=r),"logger"===e&&(t[e]=r),t}},{key:"getSignature",value:function(t,e){var r="",r=""!==e&&void 0!==e?e:(r=(r=t.toString().split("{")[0]).replace(/^\s+|\s+$/g,"")).replace(/,\s+/g,",");return"javascript."+P.version+"."+r}},{key:"ajax",value:function(t,e){t={method:"POST",url:t,headers:{"Content-Type":"application/x-www-form-urlencoded"},data:new URLSearchParams(e).toString(),responseType:"json"};return g.isNode()&&t.headers&&(t.headers["User-Agent"]="varsnap.js"),(0,_t.default)(t).then(function(t){return t.data}).catch(function(t){return t})}},{key:"debug",value:function(t,e){t.logger&&t.logger.debug(e)}},{key:"log",value:function(t,e){t.logger&&t.logger.log(e)}},{key:"error",value:function(t,e){t.logger&&t.logger.error(e)}},{key:"resetProducers",value:function(){s=[]}},{key:"resetConsumers",value:function(){a=[]}},{key:"getProducers",value:function(){return s}},{key:"getConsumers",value:function(){return a}},{key:"limitString",value:function(t){t=String(t);return t.length<=30?t:t.substring(0,30-"...".length)+"..."}},{key:"isNode",value:function(){return"object"===(void 0===m?"undefined":e(m))&&"undefined"==typeof window}},{key:"getBranch",value:function(t){var e=g.getConfig(t,"branch");return e?new Promise(function(t){return t(e)}):g.isNode()?new Promise(function(r){(0,Rt.exec)("git rev-parse --abbrev-ref HEAD",function(t,e){return r(e.trim())})}):new Promise(function(t){return t("")})}}]),g),p=(t(i,[{key:"isEnabled",value:function(){return!!this.config.varsnap&&"production"===l.getConfig(this.config,"env")&&!!l.getConfig(this.config,"producerToken")}},{key:"produce",value:function(e,t){var r=this;return this.isEnabled()?(l.debug(this.config,"Sending call to Varsnap"),Promise.resolve(t).then(function(t){t={producer_token:l.getConfig(r.config,"producerToken"),signature:r.signature,inputs:i.serialize(e),prod_outputs:i.serialize(t)};return l.ajax("https://www.varsnap.com/api/snap/produce/",t).then(function(){return!0}).catch(function(t){if(t.response){if(429===t.response.status)return l.error(r.config,"Cannot produce to Varsnap; Signature at rate limit"),!0;404===t.response.status?l.error(r.config,"Cannot produce to Varsnap; check your producer token"):l.error(r.config,t.response.statusText)}return!1})})):new Promise(function(t){return t(!1)})}}],[{key:"serialize",value:function(t){return JSON.stringify(t)}},{key:"serialize_formatted",value:function(t){return JSON.stringify(t,null,2)}}]),i),u=(t(d,[{key:"isEnabled",value:function(){return!!this.config.varsnap&&"development"===l.getConfig(this.config,"env")&&!!l.getConfig(this.config,"consumerToken")}},{key:"consume",value:function(a){var o,u=this;return this.isEnabled()?(o={consumer_token:l.getConfig(this.config,"consumerToken"),signature:this.signature},l.ajax("https://www.varsnap.com/api/snap/consume/",o).then(function(t){var e=t;if(!e||"ok"!==e.status)return[new Promise(function(t){return l.error(u.config,"Received error from Varsnap: "+e.status),t(!1)})];0===e.results.length&&l.log(u.config,"No snaps found for signature: "+o.signature);var r,s=[],n=f(e.results);try{for(n.s();!(r=n.n()).done;)!function(){var t,n=r.value,o=d.deserialize(n.inputs),i=d.deserialize(n.prod_outputs),e=void 0;try{e=u.targetFunc.apply(u,function(t){if(Array.isArray(t))return h(t)}(t=o)||function(){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}()||c(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())}catch(t){e=t}e=Promise.resolve(e).then(function(e){var r=p.serialize(i)===p.serialize(e);return u.reportCentral(a,n,i,e,r).then(function(t){u.reportLog(n.id,o,i,e,r,t)}),r});s.push(e)}()}catch(t){n.e(t)}finally{n.f()}return s}).then(function(t){return Promise.all(t).then(function(t){return t.every(function(t){return t})})}).catch(function(t){return l.error(u.config,"Cannot contact Varsnap: "+t),!1})):new Promise(function(t){return l.error(u.config,"Varsnap not enabled for testing"),t(!1)})}},{key:"reportCentral",value:function(t,e,r,n,o){var i=this,t={trial_group_id:t.trial_group_id,consumer_token:l.getConfig(this.config,"consumerToken"),snap_id:e.id,test_outputs:p.serialize(n),matches:o.toString(),snap_outputs_formatted:p.serialize_formatted(r),test_outputs_formatted:p.serialize_formatted(n)};return l.ajax("https://www.varsnap.com/api/trial/produce/",t).then(function(t){return!(!t||"ok"!==t.status)&&t.trial_url}).catch(function(t){return l.error(i.config,"Cannot upload test results to Varsnap: "+t),!1})}},{key:"reportLog",value:function(t,e,r,n,o,i){o||(l.log(this.config,""),l.log(this.config,"Testing with Varsnap uuid: "+t),l.log(this.config,"Signature: "+this.signature),l.log(this.config,"Function input args: "+l.limitString(e)),l.log(this.config,"Production function outputs: "+l.limitString(r)),l.log(this.config,"Your function outputs: "+l.limitString(n)),l.log(this.config,"Matching outputs: "+o),t="Cannot upload trial",i&&(t=String(i)),l.log(this.config,"Trial URL: "+t))}},{key:"reportTrialGroup",value:function(t){l.log(this.config,"Trial Group: "+t.trial_group_url)}}],[{key:"deserialize",value:function(t){if(""!==t)return JSON.parse(t)}}]),d);function d(t,e,r){n(this,d),this.targetFunc=t,this.signature=e,this.config=r}function i(t,e,r){n(this,i),this.targetFunc=t,this.signature=e,this.config=r}function g(){n(this,g)}function y(o,t){function e(){for(var t,e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];try{t=o.apply(void 0,r)}catch(t){throw i.produce(r,t),t}return i.produce(r,t),t}var t=l.getSignature(o,t=void 0===t?"":t),i=new p(o,t,y._config),r=new u(o,t,y._config);return e.producer=i,e.consumer=r,e.signature=t,s.push(i),a.push(r),e}(P.varsnap=y)._config=r,y.updateConfig=function(t){for(var e=y._config,r=0,n=Object.keys(y._config);r<n.length;r++){var o=n[r];Object.prototype.hasOwnProperty.call(t,o)&&(e=l.setConfig(e,o,t[o]))}y._config=e},y.reset=function(){l.resetConsumers(),l.resetProducers()},y.version=P.version,y.runTests=function(){var e,i=l.getConsumers();return 0===i.length?Promise.resolve(!0):(e=i[0].config,l.getBranch(e).then(function(t){return{branch:t,consumer_token:l.getConfig(e,"consumerToken"),client:P.clientName}}).then(function(t){return l.ajax("https://www.varsnap.com/api/trial_group/",t)}).then(function(t){return t}).catch(function(t){t=t&&t.response&&t.response.data?t.response.data.error:t.toString();return l.error(e,"Cannot generate a new Trial Group: "+t),{status:"not ok",project_id:"",trial_group_id:"",trial_group_url:""}}).then(function(t){var e,r=[],n=f(i);try{for(n.s();!(e=n.n()).done;){var o=e.value.consume(t);r.push(o)}}catch(t){n.e(t)}finally{n.f()}return 0<i.length&&i[0].reportTrialGroup(t),Promise.all(r)}).then(function(t){return t.every(function(t){return t})}))}}.call(this)}.call(this,a),P.varsnap})}("undefined"==typeof Varsnap?Varsnap={}:Varsnap);