@commercetools/sdk-middleware-http
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -1,5 +0,10 @@ | ||
<a name="1.1.0"></a> | ||
# 1.1.0 (2016-12-23) | ||
<a name="1.1.1"></a> | ||
## 1.1.1 (2017-01-26) | ||
### Bug Fixes | ||
* **middleware-http:** allow call without parameters ([0d4ca26](https://github.com/commercetools/nodejs/commit/0d4ca26)) | ||
### Features | ||
@@ -6,0 +11,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.CommercetoolsSdkMiddlewareHttp=r():t.CommercetoolsSdkMiddlewareHttp=r()}(this,function(){return function(t){function r(n){if(e[n])return e[n].exports;var o=e[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}var e={};return r.m=t,r.c=e,r.p="",r(0)}([function(t,r,e){"use strict";function n(t){if(t&&t.__esModule)return t;var r={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e]);return r.default=t,r}function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(r,"__esModule",{value:!0}),r.errors=r.getErrorByCode=r.createHttpMiddleware=void 0;var i=e(2);Object.defineProperty(r,"createHttpMiddleware",{enumerable:!0,get:function(){return o(i).default}});var s=e(1);Object.defineProperty(r,"getErrorByCode",{enumerable:!0,get:function(){return o(s).default}});var a=n(s);r.errors=a},function(t,r){"use strict";function e(t,r){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.status=this.statusCode=this.code=t,this.message=r,Object.assign(this,e),this.name=this.constructor.name,this.constructor.prototype.__proto__=Error.prototype,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}function n(){for(var t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];e.call.apply(e,[this,0].concat(r))}function o(){for(var t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];e.call.apply(e,[this].concat(r))}function i(){for(var t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];e.call.apply(e,[this,400].concat(r))}function s(){for(var t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];e.call.apply(e,[this,401].concat(r))}function a(){for(var t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];e.call.apply(e,[this,403].concat(r))}function u(){for(var t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];e.call.apply(e,[this,404].concat(r))}function f(){for(var t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];e.call.apply(e,[this,409].concat(r))}function h(){for(var t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];e.call.apply(e,[this,500].concat(r))}function c(){for(var t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];e.call.apply(e,[this,503].concat(r))}function l(t){switch(t){case 0:return n;case 400:return i;case 401:return s;case 403:return a;case 404:return u;case 409:return f;case 500:return h;case 503:return c;default:return}}Object.defineProperty(r,"__esModule",{value:!0}),r.NetworkError=n,r.HttpError=o,r.BadRequest=i,r.Unauthorized=s,r.Forbidden=a,r.NotFound=u,r.ConcurrentModification=f,r.InternalServerError=h,r.ServiceUnavailable=c,r.default=l},function(t,r,e){(function(t){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,r){var e={};for(var n in t)r.indexOf(n)<0&&Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function i(r){var e=r.host,n=void 0===e?l:e;return function(r){return function(e,o){var i=n+e.uri,u="string"==typeof e.body?e.body:JSON.stringify(e.body);fetch(i,a({method:e.method,headers:a({"Content-Type":"application/json"},e.headers,u?{"Content-Length":""+t.byteLength(u)}:{})},u?{body:u}:{})).then(function(t){return t.ok?void t.json().then(function(n){var i=a({},o,{body:n,statusCode:t.status});r(e,i)}):void t.text().then(function(n){var i=void 0;try{i=JSON.parse(n)}catch(t){}var u=s(a({statusCode:t.status,originalRequest:e,headers:(0,f.default)(t.headers)},i?{message:i.message,body:i}:{})),h=a({},o,{error:u,statusCode:t.status});r(e,h)})},function(t){var n=new h.NetworkError(t.message,{originalRequest:e});r(e,a({},o,{error:n,statusCode:0}))})}}}function s(t){var r=t.statusCode,e=t.message,n=o(t,["statusCode","message"]),i=e||"Unexpected non-JSON error response";404===r&&(i="URI not found: "+n.originalRequest.uri);var s=(0,c.default)(r);return s?new s(i,n):new h.HttpError(r,i,n)}Object.defineProperty(r,"__esModule",{value:!0});var a=Object.assign||function(t){for(var r=1;arguments.length>r;r++){var e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t};r.default=i,e(8);var u=e(3),f=n(u),h=e(1),c=n(h),l="https://api.sphere.io"}).call(r,e(5).Buffer)},function(t,r){"use strict";function e(t){if(t.raw)return t.raw();if(!t.forEach)return{};var r={};return t.forEach(function(t,e){r[e]=t}),r}Object.defineProperty(r,"__esModule",{value:!0}),r.default=e},function(t,r){"use strict";function e(t){var r=t.length;if(r%4>0)throw Error("Invalid string. Length must be a multiple of 4");return"="===t[r-2]?2:"="===t[r-1]?1:0}function n(t){return 3*t.length/4-e(t)}function o(t){var r,n,o,i,s,a,u=t.length;s=e(t),a=new h(3*u/4-s),o=s>0?u-4:u;var c=0;for(r=0,n=0;o>r;r+=4,n+=3)i=f[t.charCodeAt(r)]<<18|f[t.charCodeAt(r+1)]<<12|f[t.charCodeAt(r+2)]<<6|f[t.charCodeAt(r+3)],a[c++]=i>>16&255,a[c++]=i>>8&255,a[c++]=255&i;return 2===s?(i=f[t.charCodeAt(r)]<<2|f[t.charCodeAt(r+1)]>>4,a[c++]=255&i):1===s&&(i=f[t.charCodeAt(r)]<<10|f[t.charCodeAt(r+1)]<<4|f[t.charCodeAt(r+2)]>>2,a[c++]=i>>8&255,a[c++]=255&i),a}function i(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function s(t,r,e){for(var n,o=[],s=r;e>s;s+=3)n=(t[s]<<16)+(t[s+1]<<8)+t[s+2],o.push(i(n));return o.join("")}function a(t){for(var r,e=t.length,n=e%3,o="",i=[],a=16383,f=0,h=e-n;h>f;f+=a)i.push(s(t,f,f+a>h?h:f+a));return 1===n?(r=t[e-1],o+=u[r>>2],o+=u[r<<4&63],o+="=="):2===n&&(r=(t[e-2]<<8)+t[e-1],o+=u[r>>10],o+=u[r>>4&63],o+=u[r<<2&63],o+="="),i.push(o),i.join("")}r.byteLength=n,r.toByteArray=o,r.fromByteArray=a;for(var u=[],f=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,p=c.length;p>l;++l)u[l]=c[l],f[c.charCodeAt(l)]=l;f["-".charCodeAt(0)]=62,f["_".charCodeAt(0)]=63},function(t,r,e){(function(t){/*! | ||
!function(t,r){"object"==typeof exports&&"object"==typeof module?module.exports=r():"function"==typeof define&&define.amd?define([],r):"object"==typeof exports?exports.CommercetoolsSdkMiddlewareHttp=r():t.CommercetoolsSdkMiddlewareHttp=r()}(this,function(){return function(t){function r(n){if(e[n])return e[n].exports;var o=e[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}var e={};return r.m=t,r.c=e,r.p="",r(0)}([function(t,r,e){"use strict";function n(t){if(t&&t.__esModule)return t;var r={};if(null!=t)for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e]);return r.default=t,r}function o(t){return t&&t.__esModule?t:{default:t}}Object.defineProperty(r,"__esModule",{value:!0}),r.errors=r.getErrorByCode=r.createHttpMiddleware=void 0;var i=e(2);Object.defineProperty(r,"createHttpMiddleware",{enumerable:!0,get:function(){return o(i).default}});var s=e(1);Object.defineProperty(r,"getErrorByCode",{enumerable:!0,get:function(){return o(s).default}});var a=n(s);r.errors=a},function(t,r){"use strict";function e(t,r){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.status=this.statusCode=this.code=t,this.message=r,Object.assign(this,e),this.name=this.constructor.name,this.constructor.prototype.__proto__=Error.prototype,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}function n(){for(var t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];e.call.apply(e,[this,0].concat(r))}function o(){for(var t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];e.call.apply(e,[this].concat(r))}function i(){for(var t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];e.call.apply(e,[this,400].concat(r))}function s(){for(var t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];e.call.apply(e,[this,401].concat(r))}function a(){for(var t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];e.call.apply(e,[this,403].concat(r))}function u(){for(var t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];e.call.apply(e,[this,404].concat(r))}function f(){for(var t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];e.call.apply(e,[this,409].concat(r))}function h(){for(var t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];e.call.apply(e,[this,500].concat(r))}function c(){for(var t=arguments.length,r=Array(t),n=0;t>n;n++)r[n]=arguments[n];e.call.apply(e,[this,503].concat(r))}function l(t){switch(t){case 0:return n;case 400:return i;case 401:return s;case 403:return a;case 404:return u;case 409:return f;case 500:return h;case 503:return c;default:return}}Object.defineProperty(r,"__esModule",{value:!0}),r.NetworkError=n,r.HttpError=o,r.BadRequest=i,r.Unauthorized=s,r.Forbidden=a,r.NotFound=u,r.ConcurrentModification=f,r.InternalServerError=h,r.ServiceUnavailable=c,r.default=l},function(t,r,e){(function(t){"use strict";function n(t){return t&&t.__esModule?t:{default:t}}function o(t,r){var e={};for(var n in t)r.indexOf(n)<0&&Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function i(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=r.host,n=void 0===e?l:e;return function(r){return function(e,o){var i=n+e.uri,u="string"==typeof e.body?e.body:JSON.stringify(e.body);fetch(i,a({method:e.method,headers:a({"Content-Type":"application/json"},e.headers,u?{"Content-Length":""+t.byteLength(u)}:{})},u?{body:u}:{})).then(function(t){return t.ok?void t.json().then(function(n){var i=a({},o,{body:n,statusCode:t.status});r(e,i)}):void t.text().then(function(n){var i=void 0;try{i=JSON.parse(n)}catch(t){}var u=s(a({statusCode:t.status,originalRequest:e,headers:(0,f.default)(t.headers)},i?{message:i.message,body:i}:{})),h=a({},o,{error:u,statusCode:t.status});r(e,h)})},function(t){var n=new h.NetworkError(t.message,{originalRequest:e});r(e,a({},o,{error:n,statusCode:0}))})}}}function s(t){var r=t.statusCode,e=t.message,n=o(t,["statusCode","message"]),i=e||"Unexpected non-JSON error response";404===r&&(i="URI not found: "+n.originalRequest.uri);var s=(0,c.default)(r);return s?new s(i,n):new h.HttpError(r,i,n)}Object.defineProperty(r,"__esModule",{value:!0});var a=Object.assign||function(t){for(var r=1;arguments.length>r;r++){var e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t};r.default=i,e(8);var u=e(3),f=n(u),h=e(1),c=n(h),l="https://api.sphere.io"}).call(r,e(5).Buffer)},function(t,r){"use strict";function e(t){if(t.raw)return t.raw();if(!t.forEach)return{};var r={};return t.forEach(function(t,e){r[e]=t}),r}Object.defineProperty(r,"__esModule",{value:!0}),r.default=e},function(t,r){"use strict";function e(t){var r=t.length;if(r%4>0)throw Error("Invalid string. Length must be a multiple of 4");return"="===t[r-2]?2:"="===t[r-1]?1:0}function n(t){return 3*t.length/4-e(t)}function o(t){var r,n,o,i,s,a,u=t.length;s=e(t),a=new h(3*u/4-s),o=s>0?u-4:u;var c=0;for(r=0,n=0;o>r;r+=4,n+=3)i=f[t.charCodeAt(r)]<<18|f[t.charCodeAt(r+1)]<<12|f[t.charCodeAt(r+2)]<<6|f[t.charCodeAt(r+3)],a[c++]=i>>16&255,a[c++]=i>>8&255,a[c++]=255&i;return 2===s?(i=f[t.charCodeAt(r)]<<2|f[t.charCodeAt(r+1)]>>4,a[c++]=255&i):1===s&&(i=f[t.charCodeAt(r)]<<10|f[t.charCodeAt(r+1)]<<4|f[t.charCodeAt(r+2)]>>2,a[c++]=i>>8&255,a[c++]=255&i),a}function i(t){return u[t>>18&63]+u[t>>12&63]+u[t>>6&63]+u[63&t]}function s(t,r,e){for(var n,o=[],s=r;e>s;s+=3)n=(t[s]<<16)+(t[s+1]<<8)+t[s+2],o.push(i(n));return o.join("")}function a(t){for(var r,e=t.length,n=e%3,o="",i=[],a=16383,f=0,h=e-n;h>f;f+=a)i.push(s(t,f,f+a>h?h:f+a));return 1===n?(r=t[e-1],o+=u[r>>2],o+=u[r<<4&63],o+="=="):2===n&&(r=(t[e-2]<<8)+t[e-1],o+=u[r>>10],o+=u[r>>4&63],o+=u[r<<2&63],o+="="),i.push(o),i.join("")}r.byteLength=n,r.toByteArray=o,r.fromByteArray=a;for(var u=[],f=[],h="undefined"!=typeof Uint8Array?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=0,p=c.length;p>l;++l)u[l]=c[l],f[c.charCodeAt(l)]=l;f["-".charCodeAt(0)]=62,f["_".charCodeAt(0)]=63},function(t,r,e){(function(t){/*! | ||
* The buffer module from node.js, for the browser. | ||
@@ -7,2 +7,2 @@ * | ||
*/ | ||
"use strict";function n(){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}}function o(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(t,r){if(o()<r)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=s.prototype):(null===t&&(t=new s(r)),t.length=r),t}function s(t,r,e){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(t,r,e);if("number"==typeof t){if("string"==typeof r)throw Error("If encoding is specified then the first argument must be a string");return h(this,t)}return a(this,t,r,e)}function a(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?p(t,r,e,n):"string"==typeof r?c(t,r,e):y(t,r)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(0>t)throw new RangeError('"size" argument must not be negative')}function f(t,r,e,n){return u(r),r>0&&void 0!==e?"string"==typeof n?i(t,r).fill(e,n):i(t,r).fill(e):i(t,r)}function h(t,r){if(u(r),t=i(t,0>r?0:0|d(r)),!s.TYPED_ARRAY_SUPPORT)for(var e=0;r>e;++e)t[e]=0;return t}function c(t,r,e){if("string"==typeof e&&""!==e||(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|w(r,e);t=i(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function l(t,r){var e=0>r.length?0:0|d(r.length);t=i(t,e);for(var n=0;e>n;n+=1)t[n]=255&r[n];return t}function p(t,r,e,n){if(0>e||e>r.byteLength)throw new RangeError("'offset' is out of bounds");if(e+(n||0)>r.byteLength)throw new RangeError("'length' is out of bounds");return r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n),s.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=s.prototype):t=l(t,r),t}function y(t,r){if(s.isBuffer(r)){var e=0|d(r.length);return t=i(t,e),0===t.length?t:(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||Z(r.length)?i(t,0):l(t,r);if("Buffer"===r.type&&W(r.data))return l(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function d(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function g(t){return+t!=t&&(t=0),s.alloc(+t)}function w(t,r){if(s.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 J(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return X(t).length;default:if(n)return J(t).length;r=(""+r).toLowerCase(),n=!0}}function b(t,r,e){var n=!1;if((void 0===r||0>r)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),0>=e)return"";if(e>>>=0,r>>>=0,r>=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,r,e);case"utf8":case"utf-8":return S(this,r,e);case"ascii":return I(this,r,e);case"latin1":case"binary":return x(this,r,e);case"base64":return U(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function m(t,r,e,n,o){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:-2147483648>e&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),0>e&&(e=t.length+e),t.length>e){if(0>e){if(!o)return-1;e=0}}else{if(o)return-1;e=t.length-1}if("string"==typeof r&&(r=s.from(r,n)),s.isBuffer(r))return 0===r.length?-1:A(t,r,e,n,o);if("number"==typeof r)return r&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):A(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function A(t,r,e,n,o){function i(t,r){return 1===s?t[r]:t.readUInt16BE(r*s)}var s=1,a=t.length,u=r.length;if(void 0!==n&&(n=(n+"").toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(2>t.length||2>r.length)return-1;s=2,a/=2,u/=2,e/=2}var f;if(o){var h=-1;for(f=e;a>f;f++)if(i(t,f)===i(r,h===-1?0:f-h)){if(h===-1&&(h=f),f-h+1===u)return h*s}else h!==-1&&(f-=f-h),h=-1}else for(e+u>a&&(e=a-u),f=e;f>=0;f--){for(var c=!0,l=0;u>l;l++)if(i(t,f+l)!==i(r,l)){c=!1;break}if(c)return f}return-1}function E(t,r,e,n){e=+e||0;var o=t.length-e;n?(n=+n,n>o&&(n=o)):n=o;var i=r.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var s=0;n>s;++s){var a=parseInt(r.substr(2*s,2),16);if(isNaN(a))return s;t[e+s]=a}return s}function _(t,r,e,n){return K(J(r,t.length-e),t,e,n)}function R(t,r,e,n){return K(G(r),t,e,n)}function P(t,r,e,n){return R(t,r,e,n)}function B(t,r,e,n){return K(X(r),t,e,n)}function T(t,r,e,n){return K(V(r,t.length-e),t,e,n)}function U(t,r,e){return $.fromByteArray(0===r&&e===t.length?t:t.slice(r,e))}function S(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;e>o;){var i=t[o],s=null,a=i>239?4:i>223?3:i>191?2:1;if(e>=o+a){var u,f,h,c;switch(a){case 1:128>i&&(s=i);break;case 2:u=t[o+1],128===(192&u)&&(c=(31&i)<<6|63&u,c>127&&(s=c));break;case 3:u=t[o+1],f=t[o+2],128===(192&u)&&128===(192&f)&&(c=(15&i)<<12|(63&u)<<6|63&f,c>2047&&(55296>c||c>57343)&&(s=c));break;case 4:u=t[o+1],f=t[o+2],h=t[o+3],128===(192&u)&&128===(192&f)&&128===(192&h)&&(c=(15&i)<<18|(63&u)<<12|(63&f)<<6|63&h,c>65535&&1114112>c&&(s=c))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),o+=a}return O(n)}function O(t){var r=t.length;if(tt>=r)return String.fromCharCode.apply(String,t);for(var e="",n=0;r>n;)e+=String.fromCharCode.apply(String,t.slice(n,n+=tt));return e}function I(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;e>o;++o)n+=String.fromCharCode(127&t[o]);return n}function x(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;e>o;++o)n+=String.fromCharCode(t[o]);return n}function C(t,r,e){var n=t.length;r&&r>=0||(r=0),(!e||0>e||e>n)&&(e=n);for(var o="",i=r;e>i;++i)o+=z(t[i]);return o}function Y(t,r,e){for(var n=t.slice(r,e),o="",i=0;n.length>i;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function M(t,r,e){if(t%1!==0||0>t)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function D(t,r,e,n,o,i){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||i>r)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function L(t,r,e,n){0>r&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);i>o;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function j(t,r,e,n){0>r&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);i>o;++o)t[e+o]=r>>>8*(n?o:3-o)&255}function k(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(0>e)throw new RangeError("Index out of range")}function N(t,r,e,n,o){return o||k(t,r,e,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(t,r,e,n,23,4),e+4}function F(t,r,e,n,o){return o||k(t,r,e,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(t,r,e,n,52,8),e+8}function H(t){if(t=q(t).replace(rt,""),2>t.length)return"";for(;t.length%4!==0;)t+="=";return t}function q(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function z(t){return 16>t?"0"+t.toString(16):t.toString(16)}function J(t,r){r=r||1/0;for(var e,n=t.length,o=null,i=[],s=0;n>s;++s){if(e=t.charCodeAt(s),e>55295&&57344>e){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(56320>e){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,128>e){if((r-=1)<0)break;i.push(e)}else if(2048>e){if((r-=2)<0)break;i.push(e>>6|192,63&e|128)}else if(65536>e){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(e>=1114112)throw Error("Invalid code point");if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return i}function G(t){for(var r=[],e=0;t.length>e;++e)r.push(255&t.charCodeAt(e));return r}function V(t,r){for(var e,n,o,i=[],s=0;t.length>s&&(r-=2)>=0;++s)e=t.charCodeAt(s),n=e>>8,o=e%256,i.push(o),i.push(n);return i}function X(t){return $.toByteArray(H(t))}function K(t,r,e,n){for(var o=0;n>o&&(o+e<r.length&&o<t.length);++o)r[o+e]=t[o];return o}function Z(t){return t!==t}var $=e(4),Q=e(6),W=e(7);r.Buffer=s,r.SlowBuffer=g,r.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:n(),r.kMaxLength=o(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,r,e){return a(null,t,r,e)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(t,r,e){return f(null,t,r,e)},s.allocUnsafe=function(t){return h(null,t)},s.allocUnsafeSlow=function(t){return h(null,t)},s.isBuffer=function(t){return!(null==t||!t._isBuffer)},s.compare=function(t,r){if(!s.isBuffer(t)||!s.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,o=0,i=Math.min(e,n);i>o;++o)if(t[o]!==r[o]){e=t[o],n=r[o];break}return n>e?-1:e>n?1:0},s.isEncoding=function(t){switch((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}},s.concat=function(t,r){if(!W(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var e;if(void 0===r)for(r=0,e=0;t.length>e;++e)r+=t[e].length;var n=s.allocUnsafe(r),o=0;for(e=0;t.length>e;++e){var i=t[e];if(!s.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},s.byteLength=w,s.prototype._isBuffer=!0,s.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 r=0;t>r;r+=2)v(this,r,r+1);return this},s.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 r=0;t>r;r+=4)v(this,r,r+3),v(this,r+1,r+2);return this},s.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 r=0;t>r;r+=8)v(this,r,r+7),v(this,r+1,r+6),v(this,r+2,r+5),v(this,r+3,r+4);return this},s.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?S(this,0,t):b.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.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+">"},s.prototype.compare=function(t,r,e,n,o){if(!s.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),0>r||e>t.length||0>n||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(r>>>=0,e>>>=0,n>>>=0,o>>>=0,this===t)return 0;for(var i=o-n,a=e-r,u=Math.min(i,a),f=this.slice(n,o),h=t.slice(r,e),c=0;u>c;++c)if(f[c]!==h[c]){i=f[c],a=h[c];break}return a>i?-1:i>a?1:0},s.prototype.includes=function(t,r,e){return this.indexOf(t,r,e)!==-1},s.prototype.indexOf=function(t,r,e){return m(this,t,r,e,!0)},s.prototype.lastIndexOf=function(t,r,e){return m(this,t,r,e,!1)},s.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 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&&(0>e||0>r)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return E(this,t,r,e);case"utf8":case"utf-8":return _(this,t,r,e);case"ascii":return R(this,t,r,e);case"latin1":case"binary":return P(this,t,r,e);case"base64":return B(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,r,e);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;s.prototype.slice=function(t,r){var e=this.length;t=~~t,r=void 0===r?e:~~r,0>t?(t+=e,0>t&&(t=0)):t>e&&(t=e),0>r?(r+=e,0>r&&(r=0)):r>e&&(r=e),t>r&&(r=t);var n;if(s.TYPED_ARRAY_SUPPORT)n=this.subarray(t,r),n.__proto__=s.prototype;else{var o=r-t;n=new s(o,void 0);for(var i=0;o>i;++i)n[i]=this[i+t]}return n},s.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n},s.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t+--r],o=1;r>0&&(o*=256);)n+=this[t+--r]*o;return n},s.prototype.readUInt8=function(t,r){return r||M(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,r){return r||M(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,r){return r||M(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,r){return r||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,r){return r||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return o*=128,o>n||(n-=Math.pow(2,8*r)),n},s.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=r,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return o*=128,o>i||(i-=Math.pow(2,8*r)),i},s.prototype.readInt8=function(t,r){return r||M(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},s.prototype.readInt16LE=function(t,r){r||M(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},s.prototype.readInt16BE=function(t,r){r||M(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},s.prototype.readInt32LE=function(t,r){return r||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,r){return r||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,r){return r||M(t,4,this.length),Q.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,r){return r||M(t,4,this.length),Q.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,r){return r||M(t,8,this.length),Q.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,r){return r||M(t,8,this.length),Q.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,r,e,n){if(t=+t,r|=0,e|=0,!n){var o=Math.pow(2,8*e)-1;D(this,t,r,e,o,0)}var i=1,s=0;for(this[r]=255&t;++s<e&&(i*=256);)this[r+s]=t/i&255;return r+e},s.prototype.writeUIntBE=function(t,r,e,n){if(t=+t,r|=0,e|=0,!n){var o=Math.pow(2,8*e)-1;D(this,t,r,e,o,0)}var i=e-1,s=1;for(this[r+i]=255&t;--i>=0&&(s*=256);)this[r+i]=t/s&255;return r+e},s.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||D(this,t,r,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},s.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||D(this,t,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):L(this,t,r,!0),r+2},s.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||D(this,t,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):L(this,t,r,!1),r+2},s.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||D(this,t,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):j(this,t,r,!0),r+4},s.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||D(this,t,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):j(this,t,r,!1),r+4},s.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var o=Math.pow(2,8*e-1);D(this,t,r,e,o-1,-o)}var i=0,s=1,a=0;for(this[r]=255&t;++i<e&&(s*=256);)0>t&&0===a&&0!==this[r+i-1]&&(a=1),this[r+i]=(t/s>>0)-a&255;return r+e},s.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var o=Math.pow(2,8*e-1);D(this,t,r,e,o-1,-o)}var i=e-1,s=1,a=0;for(this[r+i]=255&t;--i>=0&&(s*=256);)0>t&&0===a&&0!==this[r+i+1]&&(a=1),this[r+i]=(t/s>>0)-a&255;return r+e},s.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||D(this,t,r,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[r]=255&t,r+1},s.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||D(this,t,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):L(this,t,r,!0),r+2},s.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||D(this,t,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):L(this,t,r,!1),r+2},s.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||D(this,t,r,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):j(this,t,r,!0),r+4},s.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||D(this,t,r,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):j(this,t,r,!1),r+4},s.prototype.writeFloatLE=function(t,r,e){return N(this,t,r,!0,e)},s.prototype.writeFloatBE=function(t,r,e){return N(this,t,r,!1,e)},s.prototype.writeDoubleLE=function(t,r,e){return F(this,t,r,!0,e)},s.prototype.writeDoubleBE=function(t,r,e){return F(this,t,r,!1,e)},s.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),t.length>r||(r=t.length),r||(r=0),n>0&&e>n&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(0>r)throw new RangeError("targetStart out of bounds");if(0>e||e>=this.length)throw new RangeError("sourceStart out of bounds");if(0>n)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),n-e>t.length-r&&(n=t.length-r+e);var o,i=n-e;if(this===t&&r>e&&n>r)for(o=i-1;o>=0;--o)t[o+r]=this[o+e];else if(1e3>i||!s.TYPED_ARRAY_SUPPORT)for(o=0;i>o;++o)t[o+r]=this[o+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+i),r);return i},s.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 o=t.charCodeAt(0);256>o&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(0>r||r>this.length||e>this.length)throw new RangeError("Out of range index");if(r>=e)return this;r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0);var i;if("number"==typeof t)for(i=r;e>i;++i)this[i]=t;else{var a=s.isBuffer(t)?t:J(""+new s(t,n)),u=a.length;for(i=0;e-r>i;++i)this[i+r]=a[i%u]}return this};var rt=/[^+\/0-9A-Za-z-_]/g}).call(r,function(){return this}())},function(t,r){r.read=function(t,r,e,n,o){var i,s,a=8*o-n-1,u=(1<<a)-1,f=u>>1,h=-7,c=e?o-1:0,l=e?-1:1,p=t[r+c];for(c+=l,i=p&(1<<-h)-1,p>>=-h,h+=a;h>0;i=256*i+t[r+c],c+=l,h-=8);for(s=i&(1<<-h)-1,i>>=-h,h+=n;h>0;s=256*s+t[r+c],c+=l,h-=8);if(0===i)i=1-f;else{if(i===u)return s?NaN:(p?-1:1)*(1/0);s+=Math.pow(2,n),i-=f}return(p?-1:1)*s*Math.pow(2,i-n)},r.write=function(t,r,e,n,o,i){var s,a,u,f=8*i-o-1,h=(1<<f)-1,c=h>>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,y=n?1:-1,d=0>r||0===r&&0>1/r?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,s=h):(s=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-s))<1&&(s--,u*=2),r+=1>s+c?l*Math.pow(2,1-c):l/u,2>r*u||(s++,u/=2),h>s+c?1>s+c?(a=r*Math.pow(2,c-1)*Math.pow(2,o),s=0):(a=(r*u-1)*Math.pow(2,o),s+=c):(a=0,s=h));o>=8;t[e+p]=255&a,p+=y,a/=256,o-=8);for(s=s<<o|a,f+=o;f>0;t[e+p]=255&s,p+=y,s/=256,f-=8);t[e+p-y]|=128*d}},function(t,r){var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},function(t,r,e){e(9),t.exports=self.fetch.bind(self)},function(t,r){!function(t){"use strict";function r(t){if("string"!=typeof t&&(t+=""),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function e(t){return"string"!=typeof t&&(t+=""),t}function n(t){var r={next:function(){var r=t.shift();return{done:void 0===r,value:r}}};return w.iterable&&(r[Symbol.iterator]=function(){return r}),r}function o(t){this.map={},t instanceof o?t.forEach(function(t,r){this.append(r,t)},this):t&&Object.getOwnPropertyNames(t).forEach(function(r){this.append(r,t[r])},this)}function i(t){return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function s(t){return new Promise(function(r,e){t.onload=function(){r(t.result)},t.onerror=function(){e(t.error)}})}function a(t){var r=new FileReader,e=s(r);return r.readAsArrayBuffer(t),e}function u(t){var r=new FileReader,e=s(r);return r.readAsText(t),e}function f(t){for(var r=new Uint8Array(t),e=Array(r.length),n=0;r.length>n;n++)e[n]=String.fromCharCode(r[n]);return e.join("")}function h(t){if(t.slice)return t.slice(0);var r=new Uint8Array(t.byteLength);return r.set(new Uint8Array(t)),r.buffer}function c(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t,t)if("string"==typeof t)this._bodyText=t;else if(w.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(w.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(w.searchParams&&URLSearchParams.prototype.isPrototypeOf(t))this._bodyText=""+t;else if(w.arrayBuffer&&w.blob&&v(t))this._bodyArrayBuffer=h(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!w.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(t)&&!m(t))throw Error("unsupported BodyInit type");this._bodyArrayBuffer=h(t)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):w.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},w.blob&&(this.blob=function(){var t=i(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?i(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(a)}),this.text=function(){var t=i(this);if(t)return t;if(this._bodyBlob)return u(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(f(this._bodyArrayBuffer));if(this._bodyFormData)throw Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},w.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}function l(t){var r=t.toUpperCase();return A.indexOf(r)>-1?r:t}function p(t,r){r=r||{};var e=r.body;if("string"==typeof t)this.url=t;else{if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,r.headers||(this.headers=new o(t.headers)),this.method=t.method,this.mode=t.mode,e||null==t._bodyInit||(e=t._bodyInit,t.bodyUsed=!0)}if(this.credentials=r.credentials||this.credentials||"omit",!r.headers&&this.headers||(this.headers=new o(r.headers)),this.method=l(r.method||this.method||"GET"),this.mode=r.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&e)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(e)}function y(t){var r=new FormData;return t.trim().split("&").forEach(function(t){if(t){var e=t.split("="),n=e.shift().replace(/\+/g," "),o=e.join("=").replace(/\+/g," ");r.append(decodeURIComponent(n),decodeURIComponent(o))}}),r}function d(t){var r=new o;return t.split("\r\n").forEach(function(t){var e=t.split(":"),n=e.shift().trim();if(n){var o=e.join(":").trim();r.append(n,o)}}),r}function g(t,r){r||(r={}),this.type="default",this.status="status"in r?r.status:200,this.ok=this.status>=200&&300>this.status,this.statusText="statusText"in r?r.statusText:"OK",this.headers=new o(r.headers),this.url=r.url||"",this._initBody(t)}if(!t.fetch){var w={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(w.arrayBuffer)var b=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],v=function(t){return t&&DataView.prototype.isPrototypeOf(t)},m=ArrayBuffer.isView||function(t){return t&&b.indexOf(Object.prototype.toString.call(t))>-1};o.prototype.append=function(t,n){t=r(t),n=e(n);var o=this.map[t];this.map[t]=o?o+","+n:n},o.prototype.delete=function(t){delete this.map[r(t)]},o.prototype.get=function(t){return t=r(t),this.has(t)?this.map[t]:null},o.prototype.has=function(t){return this.map.hasOwnProperty(r(t))},o.prototype.set=function(t,n){this.map[r(t)]=e(n)},o.prototype.forEach=function(t,r){for(var e in this.map)this.map.hasOwnProperty(e)&&t.call(r,this.map[e],e,this)},o.prototype.keys=function(){var t=[];return this.forEach(function(r,e){t.push(e)}),n(t)},o.prototype.values=function(){var t=[];return this.forEach(function(r){t.push(r)}),n(t)},o.prototype.entries=function(){var t=[];return this.forEach(function(r,e){t.push([e,r])}),n(t)},w.iterable&&(o.prototype[Symbol.iterator]=o.prototype.entries);var A=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];p.prototype.clone=function(){return new p(this,{body:this._bodyInit})},c.call(p.prototype),c.call(g.prototype),g.prototype.clone=function(){return new g(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new o(this.headers),url:this.url})},g.error=function(){var t=new g(null,{status:0,statusText:""});return t.type="error",t};var E=[301,302,303,307,308];g.redirect=function(t,r){if(E.indexOf(r)===-1)throw new RangeError("Invalid status code");return new g(null,{status:r,headers:{location:t}})},t.Headers=o,t.Request=p,t.Response=g,t.fetch=function(t,r){return new Promise(function(e,n){var o=new p(t,r),i=new XMLHttpRequest;i.onload=function(){var t={status:i.status,statusText:i.statusText,headers:d(i.getAllResponseHeaders()||"")};t.url="responseURL"in i?i.responseURL:t.headers.get("X-Request-URL");var r="response"in i?i.response:i.responseText;e(new g(r,t))},i.onerror=function(){n(new TypeError("Network request failed"))},i.ontimeout=function(){n(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&w.blob&&(i.responseType="blob"),o.headers.forEach(function(t,r){i.setRequestHeader(r,t)}),i.send(void 0===o._bodyInit?null:o._bodyInit)})},t.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)}])}); | ||
"use strict";function n(){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}}function o(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function i(t,r){if(o()<r)throw new RangeError("Invalid typed array length");return s.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(r),t.__proto__=s.prototype):(null===t&&(t=new s(r)),t.length=r),t}function s(t,r,e){if(!(s.TYPED_ARRAY_SUPPORT||this instanceof s))return new s(t,r,e);if("number"==typeof t){if("string"==typeof r)throw Error("If encoding is specified then the first argument must be a string");return h(this,t)}return a(this,t,r,e)}function a(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?p(t,r,e,n):"string"==typeof r?c(t,r,e):y(t,r)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(0>t)throw new RangeError('"size" argument must not be negative')}function f(t,r,e,n){return u(r),r>0&&void 0!==e?"string"==typeof n?i(t,r).fill(e,n):i(t,r).fill(e):i(t,r)}function h(t,r){if(u(r),t=i(t,0>r?0:0|d(r)),!s.TYPED_ARRAY_SUPPORT)for(var e=0;r>e;++e)t[e]=0;return t}function c(t,r,e){if("string"==typeof e&&""!==e||(e="utf8"),!s.isEncoding(e))throw new TypeError('"encoding" must be a valid string encoding');var n=0|w(r,e);t=i(t,n);var o=t.write(r,e);return o!==n&&(t=t.slice(0,o)),t}function l(t,r){var e=0>r.length?0:0|d(r.length);t=i(t,e);for(var n=0;e>n;n+=1)t[n]=255&r[n];return t}function p(t,r,e,n){if(0>e||e>r.byteLength)throw new RangeError("'offset' is out of bounds");if(e+(n||0)>r.byteLength)throw new RangeError("'length' is out of bounds");return r=void 0===e&&void 0===n?new Uint8Array(r):void 0===n?new Uint8Array(r,e):new Uint8Array(r,e,n),s.TYPED_ARRAY_SUPPORT?(t=r,t.__proto__=s.prototype):t=l(t,r),t}function y(t,r){if(s.isBuffer(r)){var e=0|d(r.length);return t=i(t,e),0===t.length?t:(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||Z(r.length)?i(t,0):l(t,r);if("Buffer"===r.type&&W(r.data))return l(t,r.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function d(t){if(t>=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function g(t){return+t!=t&&(t=0),s.alloc(+t)}function w(t,r){if(s.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 J(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*e;case"hex":return e>>>1;case"base64":return X(t).length;default:if(n)return J(t).length;r=(""+r).toLowerCase(),n=!0}}function b(t,r,e){var n=!1;if((void 0===r||0>r)&&(r=0),r>this.length)return"";if((void 0===e||e>this.length)&&(e=this.length),0>=e)return"";if(e>>>=0,r>>>=0,r>=e)return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,r,e);case"utf8":case"utf-8":return S(this,r,e);case"ascii":return I(this,r,e);case"latin1":case"binary":return x(this,r,e);case"base64":return U(this,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Y(this,r,e);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,r,e){var n=t[r];t[r]=t[e],t[e]=n}function m(t,r,e,n,o){if(0===t.length)return-1;if("string"==typeof e?(n=e,e=0):e>2147483647?e=2147483647:-2147483648>e&&(e=-2147483648),e=+e,isNaN(e)&&(e=o?0:t.length-1),0>e&&(e=t.length+e),t.length>e){if(0>e){if(!o)return-1;e=0}}else{if(o)return-1;e=t.length-1}if("string"==typeof r&&(r=s.from(r,n)),s.isBuffer(r))return 0===r.length?-1:A(t,r,e,n,o);if("number"==typeof r)return r&=255,s.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,r,e):Uint8Array.prototype.lastIndexOf.call(t,r,e):A(t,[r],e,n,o);throw new TypeError("val must be string, number or Buffer")}function A(t,r,e,n,o){function i(t,r){return 1===s?t[r]:t.readUInt16BE(r*s)}var s=1,a=t.length,u=r.length;if(void 0!==n&&(n=(n+"").toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(2>t.length||2>r.length)return-1;s=2,a/=2,u/=2,e/=2}var f;if(o){var h=-1;for(f=e;a>f;f++)if(i(t,f)===i(r,h===-1?0:f-h)){if(h===-1&&(h=f),f-h+1===u)return h*s}else h!==-1&&(f-=f-h),h=-1}else for(e+u>a&&(e=a-u),f=e;f>=0;f--){for(var c=!0,l=0;u>l;l++)if(i(t,f+l)!==i(r,l)){c=!1;break}if(c)return f}return-1}function E(t,r,e,n){e=+e||0;var o=t.length-e;n?(n=+n,n>o&&(n=o)):n=o;var i=r.length;if(i%2!==0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var s=0;n>s;++s){var a=parseInt(r.substr(2*s,2),16);if(isNaN(a))return s;t[e+s]=a}return s}function _(t,r,e,n){return K(J(r,t.length-e),t,e,n)}function R(t,r,e,n){return K(G(r),t,e,n)}function P(t,r,e,n){return R(t,r,e,n)}function B(t,r,e,n){return K(X(r),t,e,n)}function T(t,r,e,n){return K(V(r,t.length-e),t,e,n)}function U(t,r,e){return $.fromByteArray(0===r&&e===t.length?t:t.slice(r,e))}function S(t,r,e){e=Math.min(t.length,e);for(var n=[],o=r;e>o;){var i=t[o],s=null,a=i>239?4:i>223?3:i>191?2:1;if(e>=o+a){var u,f,h,c;switch(a){case 1:128>i&&(s=i);break;case 2:u=t[o+1],128===(192&u)&&(c=(31&i)<<6|63&u,c>127&&(s=c));break;case 3:u=t[o+1],f=t[o+2],128===(192&u)&&128===(192&f)&&(c=(15&i)<<12|(63&u)<<6|63&f,c>2047&&(55296>c||c>57343)&&(s=c));break;case 4:u=t[o+1],f=t[o+2],h=t[o+3],128===(192&u)&&128===(192&f)&&128===(192&h)&&(c=(15&i)<<18|(63&u)<<12|(63&f)<<6|63&h,c>65535&&1114112>c&&(s=c))}}null===s?(s=65533,a=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),o+=a}return O(n)}function O(t){var r=t.length;if(tt>=r)return String.fromCharCode.apply(String,t);for(var e="",n=0;r>n;)e+=String.fromCharCode.apply(String,t.slice(n,n+=tt));return e}function I(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;e>o;++o)n+=String.fromCharCode(127&t[o]);return n}function x(t,r,e){var n="";e=Math.min(t.length,e);for(var o=r;e>o;++o)n+=String.fromCharCode(t[o]);return n}function C(t,r,e){var n=t.length;r&&r>=0||(r=0),(!e||0>e||e>n)&&(e=n);for(var o="",i=r;e>i;++i)o+=z(t[i]);return o}function Y(t,r,e){for(var n=t.slice(r,e),o="",i=0;n.length>i;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function M(t,r,e){if(t%1!==0||0>t)throw new RangeError("offset is not uint");if(t+r>e)throw new RangeError("Trying to access beyond buffer length")}function D(t,r,e,n,o,i){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(r>o||i>r)throw new RangeError('"value" argument is out of bounds');if(e+n>t.length)throw new RangeError("Index out of range")}function L(t,r,e,n){0>r&&(r=65535+r+1);for(var o=0,i=Math.min(t.length-e,2);i>o;++o)t[e+o]=(r&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function j(t,r,e,n){0>r&&(r=4294967295+r+1);for(var o=0,i=Math.min(t.length-e,4);i>o;++o)t[e+o]=r>>>8*(n?o:3-o)&255}function k(t,r,e,n,o,i){if(e+n>t.length)throw new RangeError("Index out of range");if(0>e)throw new RangeError("Index out of range")}function N(t,r,e,n,o){return o||k(t,r,e,4,3.4028234663852886e38,-3.4028234663852886e38),Q.write(t,r,e,n,23,4),e+4}function F(t,r,e,n,o){return o||k(t,r,e,8,1.7976931348623157e308,-1.7976931348623157e308),Q.write(t,r,e,n,52,8),e+8}function H(t){if(t=q(t).replace(rt,""),2>t.length)return"";for(;t.length%4!==0;)t+="=";return t}function q(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function z(t){return 16>t?"0"+t.toString(16):t.toString(16)}function J(t,r){r=r||1/0;for(var e,n=t.length,o=null,i=[],s=0;n>s;++s){if(e=t.charCodeAt(s),e>55295&&57344>e){if(!o){if(e>56319){(r-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(r-=3)>-1&&i.push(239,191,189);continue}o=e;continue}if(56320>e){(r-=3)>-1&&i.push(239,191,189),o=e;continue}e=(o-55296<<10|e-56320)+65536}else o&&(r-=3)>-1&&i.push(239,191,189);if(o=null,128>e){if((r-=1)<0)break;i.push(e)}else if(2048>e){if((r-=2)<0)break;i.push(e>>6|192,63&e|128)}else if(65536>e){if((r-=3)<0)break;i.push(e>>12|224,e>>6&63|128,63&e|128)}else{if(e>=1114112)throw Error("Invalid code point");if((r-=4)<0)break;i.push(e>>18|240,e>>12&63|128,e>>6&63|128,63&e|128)}}return i}function G(t){for(var r=[],e=0;t.length>e;++e)r.push(255&t.charCodeAt(e));return r}function V(t,r){for(var e,n,o,i=[],s=0;t.length>s&&(r-=2)>=0;++s)e=t.charCodeAt(s),n=e>>8,o=e%256,i.push(o),i.push(n);return i}function X(t){return $.toByteArray(H(t))}function K(t,r,e,n){for(var o=0;n>o&&(o+e<r.length&&o<t.length);++o)r[o+e]=t[o];return o}function Z(t){return t!==t}var $=e(4),Q=e(6),W=e(7);r.Buffer=s,r.SlowBuffer=g,r.INSPECT_MAX_BYTES=50,s.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:n(),r.kMaxLength=o(),s.poolSize=8192,s._augment=function(t){return t.__proto__=s.prototype,t},s.from=function(t,r,e){return a(null,t,r,e)},s.TYPED_ARRAY_SUPPORT&&(s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0})),s.alloc=function(t,r,e){return f(null,t,r,e)},s.allocUnsafe=function(t){return h(null,t)},s.allocUnsafeSlow=function(t){return h(null,t)},s.isBuffer=function(t){return!(null==t||!t._isBuffer)},s.compare=function(t,r){if(!s.isBuffer(t)||!s.isBuffer(r))throw new TypeError("Arguments must be Buffers");if(t===r)return 0;for(var e=t.length,n=r.length,o=0,i=Math.min(e,n);i>o;++o)if(t[o]!==r[o]){e=t[o],n=r[o];break}return n>e?-1:e>n?1:0},s.isEncoding=function(t){switch((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}},s.concat=function(t,r){if(!W(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);var e;if(void 0===r)for(r=0,e=0;t.length>e;++e)r+=t[e].length;var n=s.allocUnsafe(r),o=0;for(e=0;t.length>e;++e){var i=t[e];if(!s.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},s.byteLength=w,s.prototype._isBuffer=!0,s.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 r=0;t>r;r+=2)v(this,r,r+1);return this},s.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 r=0;t>r;r+=4)v(this,r,r+3),v(this,r+1,r+2);return this},s.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 r=0;t>r;r+=8)v(this,r,r+7),v(this,r+1,r+6),v(this,r+2,r+5),v(this,r+3,r+4);return this},s.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?S(this,0,t):b.apply(this,arguments)},s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.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+">"},s.prototype.compare=function(t,r,e,n,o){if(!s.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),0>r||e>t.length||0>n||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(r>>>=0,e>>>=0,n>>>=0,o>>>=0,this===t)return 0;for(var i=o-n,a=e-r,u=Math.min(i,a),f=this.slice(n,o),h=t.slice(r,e),c=0;u>c;++c)if(f[c]!==h[c]){i=f[c],a=h[c];break}return a>i?-1:i>a?1:0},s.prototype.includes=function(t,r,e){return this.indexOf(t,r,e)!==-1},s.prototype.indexOf=function(t,r,e){return m(this,t,r,e,!0)},s.prototype.lastIndexOf=function(t,r,e){return m(this,t,r,e,!1)},s.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 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&&(0>e||0>r)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return E(this,t,r,e);case"utf8":case"utf-8":return _(this,t,r,e);case"ascii":return R(this,t,r,e);case"latin1":case"binary":return P(this,t,r,e);case"base64":return B(this,t,r,e);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,r,e);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var tt=4096;s.prototype.slice=function(t,r){var e=this.length;t=~~t,r=void 0===r?e:~~r,0>t?(t+=e,0>t&&(t=0)):t>e&&(t=e),0>r?(r+=e,0>r&&(r=0)):r>e&&(r=e),t>r&&(r=t);var n;if(s.TYPED_ARRAY_SUPPORT)n=this.subarray(t,r),n.__proto__=s.prototype;else{var o=r-t;n=new s(o,void 0);for(var i=0;o>i;++i)n[i]=this[i+t]}return n},s.prototype.readUIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return n},s.prototype.readUIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t+--r],o=1;r>0&&(o*=256);)n+=this[t+--r]*o;return n},s.prototype.readUInt8=function(t,r){return r||M(t,1,this.length),this[t]},s.prototype.readUInt16LE=function(t,r){return r||M(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUInt16BE=function(t,r){return r||M(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUInt32LE=function(t,r){return r||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUInt32BE=function(t,r){return r||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readIntLE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=this[t],o=1,i=0;++i<r&&(o*=256);)n+=this[t+i]*o;return o*=128,o>n||(n-=Math.pow(2,8*r)),n},s.prototype.readIntBE=function(t,r,e){t|=0,r|=0,e||M(t,r,this.length);for(var n=r,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return o*=128,o>i||(i-=Math.pow(2,8*r)),i},s.prototype.readInt8=function(t,r){return r||M(t,1,this.length),128&this[t]?(255-this[t]+1)*-1:this[t]},s.prototype.readInt16LE=function(t,r){r||M(t,2,this.length);var e=this[t]|this[t+1]<<8;return 32768&e?4294901760|e:e},s.prototype.readInt16BE=function(t,r){r||M(t,2,this.length);var e=this[t+1]|this[t]<<8;return 32768&e?4294901760|e:e},s.prototype.readInt32LE=function(t,r){return r||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,r){return r||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readFloatLE=function(t,r){return r||M(t,4,this.length),Q.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,r){return r||M(t,4,this.length),Q.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,r){return r||M(t,8,this.length),Q.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,r){return r||M(t,8,this.length),Q.read(this,t,!1,52,8)},s.prototype.writeUIntLE=function(t,r,e,n){if(t=+t,r|=0,e|=0,!n){var o=Math.pow(2,8*e)-1;D(this,t,r,e,o,0)}var i=1,s=0;for(this[r]=255&t;++s<e&&(i*=256);)this[r+s]=t/i&255;return r+e},s.prototype.writeUIntBE=function(t,r,e,n){if(t=+t,r|=0,e|=0,!n){var o=Math.pow(2,8*e)-1;D(this,t,r,e,o,0)}var i=e-1,s=1;for(this[r+i]=255&t;--i>=0&&(s*=256);)this[r+i]=t/s&255;return r+e},s.prototype.writeUInt8=function(t,r,e){return t=+t,r|=0,e||D(this,t,r,1,255,0),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[r]=255&t,r+1},s.prototype.writeUInt16LE=function(t,r,e){return t=+t,r|=0,e||D(this,t,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):L(this,t,r,!0),r+2},s.prototype.writeUInt16BE=function(t,r,e){return t=+t,r|=0,e||D(this,t,r,2,65535,0),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):L(this,t,r,!1),r+2},s.prototype.writeUInt32LE=function(t,r,e){return t=+t,r|=0,e||D(this,t,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r+3]=t>>>24,this[r+2]=t>>>16,this[r+1]=t>>>8,this[r]=255&t):j(this,t,r,!0),r+4},s.prototype.writeUInt32BE=function(t,r,e){return t=+t,r|=0,e||D(this,t,r,4,4294967295,0),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):j(this,t,r,!1),r+4},s.prototype.writeIntLE=function(t,r,e,n){if(t=+t,r|=0,!n){var o=Math.pow(2,8*e-1);D(this,t,r,e,o-1,-o)}var i=0,s=1,a=0;for(this[r]=255&t;++i<e&&(s*=256);)0>t&&0===a&&0!==this[r+i-1]&&(a=1),this[r+i]=(t/s>>0)-a&255;return r+e},s.prototype.writeIntBE=function(t,r,e,n){if(t=+t,r|=0,!n){var o=Math.pow(2,8*e-1);D(this,t,r,e,o-1,-o)}var i=e-1,s=1,a=0;for(this[r+i]=255&t;--i>=0&&(s*=256);)0>t&&0===a&&0!==this[r+i+1]&&(a=1),this[r+i]=(t/s>>0)-a&255;return r+e},s.prototype.writeInt8=function(t,r,e){return t=+t,r|=0,e||D(this,t,r,1,127,-128),s.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),0>t&&(t=255+t+1),this[r]=255&t,r+1},s.prototype.writeInt16LE=function(t,r,e){return t=+t,r|=0,e||D(this,t,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8):L(this,t,r,!0),r+2},s.prototype.writeInt16BE=function(t,r,e){return t=+t,r|=0,e||D(this,t,r,2,32767,-32768),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>8,this[r+1]=255&t):L(this,t,r,!1),r+2},s.prototype.writeInt32LE=function(t,r,e){return t=+t,r|=0,e||D(this,t,r,4,2147483647,-2147483648),s.TYPED_ARRAY_SUPPORT?(this[r]=255&t,this[r+1]=t>>>8,this[r+2]=t>>>16,this[r+3]=t>>>24):j(this,t,r,!0),r+4},s.prototype.writeInt32BE=function(t,r,e){return t=+t,r|=0,e||D(this,t,r,4,2147483647,-2147483648),0>t&&(t=4294967295+t+1),s.TYPED_ARRAY_SUPPORT?(this[r]=t>>>24,this[r+1]=t>>>16,this[r+2]=t>>>8,this[r+3]=255&t):j(this,t,r,!1),r+4},s.prototype.writeFloatLE=function(t,r,e){return N(this,t,r,!0,e)},s.prototype.writeFloatBE=function(t,r,e){return N(this,t,r,!1,e)},s.prototype.writeDoubleLE=function(t,r,e){return F(this,t,r,!0,e)},s.prototype.writeDoubleBE=function(t,r,e){return F(this,t,r,!1,e)},s.prototype.copy=function(t,r,e,n){if(e||(e=0),n||0===n||(n=this.length),t.length>r||(r=t.length),r||(r=0),n>0&&e>n&&(n=e),n===e)return 0;if(0===t.length||0===this.length)return 0;if(0>r)throw new RangeError("targetStart out of bounds");if(0>e||e>=this.length)throw new RangeError("sourceStart out of bounds");if(0>n)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),n-e>t.length-r&&(n=t.length-r+e);var o,i=n-e;if(this===t&&r>e&&n>r)for(o=i-1;o>=0;--o)t[o+r]=this[o+e];else if(1e3>i||!s.TYPED_ARRAY_SUPPORT)for(o=0;i>o;++o)t[o+r]=this[o+e];else Uint8Array.prototype.set.call(t,this.subarray(e,e+i),r);return i},s.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 o=t.charCodeAt(0);256>o&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(0>r||r>this.length||e>this.length)throw new RangeError("Out of range index");if(r>=e)return this;r>>>=0,e=void 0===e?this.length:e>>>0,t||(t=0);var i;if("number"==typeof t)for(i=r;e>i;++i)this[i]=t;else{var a=s.isBuffer(t)?t:J(""+new s(t,n)),u=a.length;for(i=0;e-r>i;++i)this[i+r]=a[i%u]}return this};var rt=/[^+\/0-9A-Za-z-_]/g}).call(r,function(){return this}())},function(t,r){r.read=function(t,r,e,n,o){var i,s,a=8*o-n-1,u=(1<<a)-1,f=u>>1,h=-7,c=e?o-1:0,l=e?-1:1,p=t[r+c];for(c+=l,i=p&(1<<-h)-1,p>>=-h,h+=a;h>0;i=256*i+t[r+c],c+=l,h-=8);for(s=i&(1<<-h)-1,i>>=-h,h+=n;h>0;s=256*s+t[r+c],c+=l,h-=8);if(0===i)i=1-f;else{if(i===u)return s?NaN:(p?-1:1)*(1/0);s+=Math.pow(2,n),i-=f}return(p?-1:1)*s*Math.pow(2,i-n)},r.write=function(t,r,e,n,o,i){var s,a,u,f=8*i-o-1,h=(1<<f)-1,c=h>>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,y=n?1:-1,d=0>r||0===r&&0>1/r?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(a=isNaN(r)?1:0,s=h):(s=Math.floor(Math.log(r)/Math.LN2),r*(u=Math.pow(2,-s))<1&&(s--,u*=2),r+=1>s+c?l*Math.pow(2,1-c):l/u,2>r*u||(s++,u/=2),h>s+c?1>s+c?(a=r*Math.pow(2,c-1)*Math.pow(2,o),s=0):(a=(r*u-1)*Math.pow(2,o),s+=c):(a=0,s=h));o>=8;t[e+p]=255&a,p+=y,a/=256,o-=8);for(s=s<<o|a,f+=o;f>0;t[e+p]=255&s,p+=y,s/=256,f-=8);t[e+p-y]|=128*d}},function(t,r){var e={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==e.call(t)}},function(t,r,e){e(9),t.exports=self.fetch.bind(self)},function(t,r){!function(t){"use strict";function r(t){if("string"!=typeof t&&(t+=""),/[^a-z0-9\-#$%&'*+.\^_`|~]/i.test(t))throw new TypeError("Invalid character in header field name");return t.toLowerCase()}function e(t){return"string"!=typeof t&&(t+=""),t}function n(t){var r={next:function(){var r=t.shift();return{done:void 0===r,value:r}}};return w.iterable&&(r[Symbol.iterator]=function(){return r}),r}function o(t){this.map={},t instanceof o?t.forEach(function(t,r){this.append(r,t)},this):t&&Object.getOwnPropertyNames(t).forEach(function(r){this.append(r,t[r])},this)}function i(t){return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function s(t){return new Promise(function(r,e){t.onload=function(){r(t.result)},t.onerror=function(){e(t.error)}})}function a(t){var r=new FileReader,e=s(r);return r.readAsArrayBuffer(t),e}function u(t){var r=new FileReader,e=s(r);return r.readAsText(t),e}function f(t){for(var r=new Uint8Array(t),e=Array(r.length),n=0;r.length>n;n++)e[n]=String.fromCharCode(r[n]);return e.join("")}function h(t){if(t.slice)return t.slice(0);var r=new Uint8Array(t.byteLength);return r.set(new Uint8Array(t)),r.buffer}function c(){return this.bodyUsed=!1,this._initBody=function(t){if(this._bodyInit=t,t)if("string"==typeof t)this._bodyText=t;else if(w.blob&&Blob.prototype.isPrototypeOf(t))this._bodyBlob=t;else if(w.formData&&FormData.prototype.isPrototypeOf(t))this._bodyFormData=t;else if(w.searchParams&&URLSearchParams.prototype.isPrototypeOf(t))this._bodyText=""+t;else if(w.arrayBuffer&&w.blob&&v(t))this._bodyArrayBuffer=h(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer]);else{if(!w.arrayBuffer||!ArrayBuffer.prototype.isPrototypeOf(t)&&!m(t))throw Error("unsupported BodyInit type");this._bodyArrayBuffer=h(t)}else this._bodyText="";this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):w.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},w.blob&&(this.blob=function(){var t=i(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?i(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(a)}),this.text=function(){var t=i(this);if(t)return t;if(this._bodyBlob)return u(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(f(this._bodyArrayBuffer));if(this._bodyFormData)throw Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},w.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}function l(t){var r=t.toUpperCase();return A.indexOf(r)>-1?r:t}function p(t,r){r=r||{};var e=r.body;if(t instanceof p){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,r.headers||(this.headers=new o(t.headers)),this.method=t.method,this.mode=t.mode,e||null==t._bodyInit||(e=t._bodyInit,t.bodyUsed=!0)}else this.url=t+"";if(this.credentials=r.credentials||this.credentials||"omit",!r.headers&&this.headers||(this.headers=new o(r.headers)),this.method=l(r.method||this.method||"GET"),this.mode=r.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&e)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(e)}function y(t){var r=new FormData;return t.trim().split("&").forEach(function(t){if(t){var e=t.split("="),n=e.shift().replace(/\+/g," "),o=e.join("=").replace(/\+/g," ");r.append(decodeURIComponent(n),decodeURIComponent(o))}}),r}function d(t){var r=new o;return t.split(/\r?\n/).forEach(function(t){var e=t.split(":"),n=e.shift().trim();if(n){var o=e.join(":").trim();r.append(n,o)}}),r}function g(t,r){r||(r={}),this.type="default",this.status="status"in r?r.status:200,this.ok=this.status>=200&&300>this.status,this.statusText="statusText"in r?r.statusText:"OK",this.headers=new o(r.headers),this.url=r.url||"",this._initBody(t)}if(!t.fetch){var w={searchParams:"URLSearchParams"in t,iterable:"Symbol"in t&&"iterator"in Symbol,blob:"FileReader"in t&&"Blob"in t&&function(){try{return new Blob,!0}catch(t){return!1}}(),formData:"FormData"in t,arrayBuffer:"ArrayBuffer"in t};if(w.arrayBuffer)var b=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],v=function(t){return t&&DataView.prototype.isPrototypeOf(t)},m=ArrayBuffer.isView||function(t){return t&&b.indexOf(Object.prototype.toString.call(t))>-1};o.prototype.append=function(t,n){t=r(t),n=e(n);var o=this.map[t];this.map[t]=o?o+","+n:n},o.prototype.delete=function(t){delete this.map[r(t)]},o.prototype.get=function(t){return t=r(t),this.has(t)?this.map[t]:null},o.prototype.has=function(t){return this.map.hasOwnProperty(r(t))},o.prototype.set=function(t,n){this.map[r(t)]=e(n)},o.prototype.forEach=function(t,r){for(var e in this.map)this.map.hasOwnProperty(e)&&t.call(r,this.map[e],e,this)},o.prototype.keys=function(){var t=[];return this.forEach(function(r,e){t.push(e)}),n(t)},o.prototype.values=function(){var t=[];return this.forEach(function(r){t.push(r)}),n(t)},o.prototype.entries=function(){var t=[];return this.forEach(function(r,e){t.push([e,r])}),n(t)},w.iterable&&(o.prototype[Symbol.iterator]=o.prototype.entries);var A=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];p.prototype.clone=function(){return new p(this,{body:this._bodyInit})},c.call(p.prototype),c.call(g.prototype),g.prototype.clone=function(){return new g(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new o(this.headers),url:this.url})},g.error=function(){var t=new g(null,{status:0,statusText:""});return t.type="error",t};var E=[301,302,303,307,308];g.redirect=function(t,r){if(E.indexOf(r)===-1)throw new RangeError("Invalid status code");return new g(null,{status:r,headers:{location:t}})},t.Headers=o,t.Request=p,t.Response=g,t.fetch=function(t,r){return new Promise(function(e,n){var o=new p(t,r),i=new XMLHttpRequest;i.onload=function(){var t={status:i.status,statusText:i.statusText,headers:d(i.getAllResponseHeaders()||"")};t.url="responseURL"in i?i.responseURL:t.headers.get("X-Request-URL");var r="response"in i?i.response:i.responseText;e(new g(r,t))},i.onerror=function(){n(new TypeError("Network request failed"))},i.ontimeout=function(){n(new TypeError("Network request failed"))},i.open(o.method,o.url,!0),"include"===o.credentials&&(i.withCredentials=!0),"responseType"in i&&w.blob&&(i.responseType="blob"),o.headers.forEach(function(t,r){i.setRequestHeader(r,t)}),i.send(void 0===o._bodyInit?null:o._bodyInit)})},t.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)}])}); |
@@ -30,7 +30,7 @@ 'use strict'; | ||
function createHttpMiddleware(options) { | ||
var _options$host = options.host, | ||
host = _options$host === undefined ? defaultApiHost : _options$host; | ||
function createHttpMiddleware() { | ||
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, | ||
_ref$host = _ref.host, | ||
host = _ref$host === undefined ? defaultApiHost : _ref$host; | ||
return function (next) { | ||
@@ -91,6 +91,6 @@ return function (request, response) { | ||
function createError(_ref) { | ||
var statusCode = _ref.statusCode, | ||
message = _ref.message, | ||
rest = _objectWithoutProperties(_ref, ['statusCode', 'message']); | ||
function createError(_ref2) { | ||
var statusCode = _ref2.statusCode, | ||
message = _ref2.message, | ||
rest = _objectWithoutProperties(_ref2, ['statusCode', 'message']); | ||
@@ -97,0 +97,0 @@ var errorMessage = message || 'Unexpected non-JSON error response'; |
@@ -7,3 +7,3 @@ { | ||
"name": "@commercetools/sdk-middleware-http", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Middleware for http requests, to use with @commercetools/sdk-client", | ||
@@ -10,0 +10,0 @@ "keywords": [ |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
125477
2645
3