-
Notifications
You must be signed in to change notification settings - Fork 21
/
uphold-sdk-javascript.js
1 lines (1 loc) · 47.9 KB
/
uphold-sdk-javascript.js
1
module.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=72)}([function(t,e,r){var n=r(21),o=r(55)((function(t,e,r){n(t,e,r)}));t.exports=o},function(t,e,r){var n=r(3);t.exports=function(t,e){for(var r=t.length;r--;)if(n(t[r][0],e))return r;return-1}},function(t,e){t.exports=function(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}},function(t,e){t.exports=function(t,e){return t===e||t!=t&&e!=e}},function(t,e,r){var n=r(28);t.exports=function(t,e,r){"__proto__"==e&&n?n(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}},function(t,e,r){var n=r(69);t.exports=function(t,e,r){var o=null==t?void 0:n(t,e);return void 0===o?r:o}},function(t,e,r){var n=r(4),o=r(3);t.exports=function(t,e,r){(void 0!==r&&!o(t[e],r)||void 0===r&&!(e in t))&&n(t,e,r)}},function(t,e,r){var n=r(35),o="object"==typeof self&&self&&self.Object===Object&&self,i=n||o||Function("return this")();t.exports=i},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){var n=r(42)(Object.getPrototypeOf,Object);t.exports=n},function(t,e,r){var n=r(11),o=r(2);t.exports=function(t){if(!o(t))return!1;var e=n(t);return"[object Function]"==e||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e}},function(t,e){var r=Object.prototype.toString;t.exports=function(t){return r.call(t)}},function(t,e){t.exports=function(t){return null!=t&&"object"==typeof t}},function(t,e){t.exports=function(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}},function(t,e){t.exports=function(t){var e=[];if(null!=t)for(var r in Object(t))e.push(r);return e}},function(t,e,r){"use strict";(function(t){r.d(e,"b",(function(){return o})),r.d(e,"c",(function(){return i})),r.d(e,"a",(function(){return s})),r.d(e,"e",(function(){return u})),r.d(e,"d",(function(){return a}));var n=r(18);function o(t){return{authorization:"Bearer "+t}}function i(t){const e=Object.keys(t);if(e.length)return e.map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&")}function s(e,r){return{authorization:"Basic "+new t(`${e}:${r}`).toString("base64")}}function u(t){return"/"!==t[0]?t:t.slice(1)}function a(t,e,r,o){return new RegExp(/^http(s?):\/\//).test(t)?t:(t=u(t),o&&(t=`${t}?${Object(n.stringify)(o)}`),r?`${e}/${r}/${t}`:`${e}/${t}`)}}).call(this,r(63).Buffer)},function(t,e){var r=Object.hasOwnProperty,n=Object.getPrototypeOf,o=Error.captureStackTrace;function i(t,e){if(t&&"object"==typeof t?(e=t,t=void 0):this.message=t,e)for(var i in e)this[i]=e[i];r.call(this,"name")||(this.name=r.call(n(this),"name")?this.name:this.constructor.name),o&&!("stack"in this)&&o(this,this.constructor)}t.exports=i,i.prototype=Object.create(Error.prototype,{constructor:{value:i,configurable:!0,writable:!0}}),i.prototype.name="StandardError"},function(t,e,r){var n=r(62);t.exports=function(t,e){return!!(null==t?0:t.length)&&n(t,e,0)>-1}},function(t,e,r){"use strict";e.decode=e.parse=r(67),e.encode=e.stringify=r(68)},function(t,e,r){var n,o,i;o=[e],void 0===(i="function"==typeof(n=function(t){t.format=function(t){t.length=null==t.length?"*":t.length;var e=t.first,r=t.last||t.first+t.limit-1;return r-e<0?t.unit+" */"+t.length:t.unit+" "+e+"-"+r+"/"+t.length},t.parse=function(t){var e;return"string"!=typeof t?null:(e=t.match(/^(\w+) (\d+)-(\d+)\/(\d+|\*)/))?{unit:e[1],first:+e[2],last:+e[3],length:"*"===e[4]?null:+e[4]}:(e=t.match(/^(\w+) \*\/(\d+|\*)/))?{unit:e[1],first:null,last:null,length:"*"===e[2]?null:+e[2]}:null}})?n.apply(e,o):n)||(t.exports=i)},function(t,e,r){"use strict";const n=r(70),o=/\s?<!doctype html>|(<html\b[^>]*>|<body\b[^>]*>|<x-[^>]+>)+/i,i=new RegExp(n.map(t=>`<${t}\\b[^>]*>`).join("|"),"i");t.exports=t=>o.test(t)||i.test(t)},function(t,e,r){var n=r(22),o=r(6),i=r(30),s=r(32),u=r(2),a=r(14),c=r(13);t.exports=function t(e,r,f,h,l){e!==r&&i(r,(function(i,a){if(l||(l=new n),u(i))s(e,r,a,f,t,h,l);else{var p=h?h(c(e,a),i,a+"",e,r,l):void 0;void 0===p&&(p=i),o(e,a,p)}}),a)}},function(t,e,r){var n=r(23),o=r(24),i=r(25),s=r(26),u=r(27);function a(t){var e=-1,r=null==t?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}a.prototype.clear=n,a.prototype.delete=o,a.prototype.get=i,a.prototype.has=s,a.prototype.set=u,t.exports=a},function(t,e){t.exports=function(){this.__data__=[],this.size=0}},function(t,e,r){var n=r(1),o=Array.prototype.splice;t.exports=function(t){var e=this.__data__,r=n(e,t);return!(r<0)&&(r==e.length-1?e.pop():o.call(e,r,1),--this.size,!0)}},function(t,e,r){var n=r(1);t.exports=function(t){var e=this.__data__,r=n(e,t);return r<0?void 0:e[r][1]}},function(t,e,r){var n=r(1);t.exports=function(t){return n(this.__data__,t)>-1}},function(t,e,r){var n=r(1);t.exports=function(t,e){var r=this.__data__,o=n(r,t);return o<0?(++this.size,r.push([t,e])):r[o][1]=e,this}},function(t,e,r){var n=r(29),o=function(){try{var t=n(Object,"defineProperty");return t({},"",{}),t}catch(t){}}();t.exports=o},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,r){var n=r(31)();t.exports=n},function(t,e){t.exports=function(t){return function(e,r,n){for(var o=-1,i=Object(e),s=n(e),u=s.length;u--;){var a=s[t?u:++o];if(!1===r(i[a],a,i))break}return e}}},function(t,e,r){var n=r(6),o=r(33),i=r(36),s=r(39),u=r(40),a=r(44),c=r(45),f=r(46),h=r(49),l=r(10),p=r(2),d=r(50),g=r(51),y=r(13),m=r(52);t.exports=function(t,e,r,v,b,w,_){var P=y(t,r),R=y(e,r),E=_.get(R);if(E)n(t,r,E);else{var A=w?w(P,R,r+"",t,e,_):void 0,x=void 0===A;if(x){var T=c(R),k=!T&&h(R),O=!T&&!k&&g(R);A=R,T||k||O?c(P)?A=P:f(P)?A=s(P):k?(x=!1,A=o(R,!0)):O?(x=!1,A=i(R,!0)):A=[]:d(R)||a(R)?(A=P,a(P)?A=m(P):p(P)&&!l(P)||(A=u(R))):x=!1}x&&(_.set(R,A),b(A,R,v,w,_),_.delete(R)),n(t,r,A)}}},function(t,e,r){(function(t){var n=r(7),o=e&&!e.nodeType&&e,i=o&&"object"==typeof t&&t&&!t.nodeType&&t,s=i&&i.exports===o?n.Buffer:void 0,u=s?s.allocUnsafe:void 0;t.exports=function(t,e){if(e)return t.slice();var r=t.length,n=u?u(r):new t.constructor(r);return t.copy(n),n}}).call(this,r(34)(t))},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){(function(e){var r="object"==typeof e&&e&&e.Object===Object&&e;t.exports=r}).call(this,r(8))},function(t,e,r){var n=r(37);t.exports=function(t,e){var r=e?n(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}},function(t,e,r){var n=r(38);t.exports=function(t){var e=new t.constructor(t.byteLength);return new n(e).set(new n(t)),e}},function(t,e,r){var n=r(7).Uint8Array;t.exports=n},function(t,e){t.exports=function(t,e){var r=-1,n=t.length;for(e||(e=Array(n));++r<n;)e[r]=t[r];return e}},function(t,e,r){var n=r(41),o=r(9),i=r(43);t.exports=function(t){return"function"!=typeof t.constructor||i(t)?{}:n(o(t))}},function(t,e,r){var n=r(2),o=Object.create,i=function(){function t(){}return function(e){if(!n(e))return{};if(o)return o(e);t.prototype=e;var r=new t;return t.prototype=void 0,r}}();t.exports=i},function(t,e){t.exports=function(t,e){return function(r){return t(e(r))}}},function(t,e){t.exports=function(){return!1}},function(t,e){t.exports=function(){return!1}},function(t,e){var r=Array.isArray;t.exports=r},function(t,e,r){var n=r(47),o=r(12);t.exports=function(t){return o(t)&&n(t)}},function(t,e,r){var n=r(10),o=r(48);t.exports=function(t){return null!=t&&o(t.length)&&!n(t)}},function(t,e){t.exports=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}},function(t,e){t.exports=function(){return!1}},function(t,e,r){var n=r(11),o=r(9),i=r(12),s=Function.prototype,u=Object.prototype,a=s.toString,c=u.hasOwnProperty,f=a.call(Object);t.exports=function(t){if(!i(t)||"[object Object]"!=n(t))return!1;var e=o(t);if(null===e)return!0;var r=c.call(e,"constructor")&&e.constructor;return"function"==typeof r&&r instanceof r&&a.call(r)==f}},function(t,e){t.exports=function(){return!1}},function(t,e,r){var n=r(53),o=r(14);t.exports=function(t){return n(t,o(t))}},function(t,e,r){var n=r(54),o=r(4);t.exports=function(t,e,r,i){var s=!r;r||(r={});for(var u=-1,a=e.length;++u<a;){var c=e[u],f=i?i(r[c],t[c],c,r,t):void 0;void 0===f&&(f=t[c]),s?o(r,c,f):n(r,c,f)}return r}},function(t,e,r){var n=r(4),o=r(3),i=Object.prototype.hasOwnProperty;t.exports=function(t,e,r){var s=t[e];i.call(t,e)&&o(s,r)&&(void 0!==r||e in t)||n(t,e,r)}},function(t,e,r){var n=r(56),o=r(61);t.exports=function(t){return n((function(e,r){var n=-1,i=r.length,s=i>1?r[i-1]:void 0,u=i>2?r[2]:void 0;for(s=t.length>3&&"function"==typeof s?(i--,s):void 0,u&&o(r[0],r[1],u)&&(s=i<3?void 0:s,i=1),e=Object(e);++n<i;){var a=r[n];a&&t(e,a,n,s)}return e}))}},function(t,e,r){var n=r(57),o=r(58),i=r(60);t.exports=function(t,e){return i(o(t,e,n),t+"")}},function(t,e){t.exports=function(t){return t}},function(t,e,r){var n=r(59),o=Math.max;t.exports=function(t,e,r){return e=o(void 0===e?t.length-1:e,0),function(){for(var i=arguments,s=-1,u=o(i.length-e,0),a=Array(u);++s<u;)a[s]=i[e+s];s=-1;for(var c=Array(e+1);++s<e;)c[s]=i[s];return c[e]=r(a),n(t,this,c)}}},function(t,e){t.exports=function(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}},function(t,e){t.exports=function(t){return t}},function(t,e){t.exports=function(){return!1}},function(t,e){t.exports=function(t,e,r){for(var n=r-1,o=t.length;++n<o;)if(t[n]===e)return n;return-1}},function(t,e,r){"use strict";(function(t){var n=r(64),o=r(65),i=r(66);function s(){return a.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function u(t,e){if(s()<e)throw new RangeError("Invalid typed array length");return a.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=a.prototype:(null===t&&(t=new a(e)),t.length=e),t}function a(t,e,r){if(!(a.TYPED_ARRAY_SUPPORT||this instanceof a))return new a(t,e,r);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return h(this,t)}return c(this,t,e,r)}function c(t,e,r,n){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,r,n){if(e.byteLength,r<0||e.byteLength<r)throw new RangeError("'offset' is out of bounds");if(e.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");e=void 0===r&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,r):new Uint8Array(e,r,n);a.TYPED_ARRAY_SUPPORT?(t=e).__proto__=a.prototype:t=l(t,e);return t}(t,e,r,n):"string"==typeof e?function(t,e,r){"string"==typeof r&&""!==r||(r="utf8");if(!a.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|d(e,r),o=(t=u(t,n)).write(e,r);o!==n&&(t=t.slice(0,o));return t}(t,e,r):function(t,e){if(a.isBuffer(e)){var r=0|p(e.length);return 0===(t=u(t,r)).length||e.copy(t,0,0,r),t}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(n=e.length)!=n?u(t,0):l(t,e);if("Buffer"===e.type&&i(e.data))return l(t,e.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function f(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function h(t,e){if(f(e),t=u(t,e<0?0:0|p(e)),!a.TYPED_ARRAY_SUPPORT)for(var r=0;r<e;++r)t[r]=0;return t}function l(t,e){var r=e.length<0?0:0|p(e.length);t=u(t,r);for(var n=0;n<r;n+=1)t[n]=255&e[n];return t}function p(t){if(t>=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(t,e){if(a.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return L(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return D(t).length;default:if(n)return L(t).length;e=(""+e).toLowerCase(),n=!0}}function g(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return O(this,e,r);case"utf8":case"utf-8":return x(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return k(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=o?0:t.length-1),r<0&&(r=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=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,o);if("number"==typeof e)return e&=255,a.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){var i,s=1,u=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=2,u/=2,a/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var f=-1;for(i=r;i<u;i++)if(c(t,i)===c(e,-1===f?0:i-f)){if(-1===f&&(f=i),i-f+1===a)return f*s}else-1!==f&&(i-=i-f),f=-1}else for(r+a>u&&(r=u-a),i=r;i>=0;i--){for(var h=!0,l=0;l<a;l++)if(c(t,i+l)!==c(e,l)){h=!1;break}if(h)return i}return-1}function b(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;if(i%2!=0)throw new TypeError("Invalid hex string");n>i/2&&(n=i/2);for(var s=0;s<n;++s){var u=parseInt(e.substr(2*s,2),16);if(isNaN(u))return s;t[r+s]=u}return s}function w(t,e,r,n){return $(L(e,t.length-r),t,r,n)}function _(t,e,r,n){return $(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function P(t,e,r,n){return _(t,e,r,n)}function R(t,e,r,n){return $(D(e),t,r,n)}function E(t,e,r,n){return $(function(t,e){for(var r,n,o,i=[],s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function A(t,e,r){return 0===e&&r===t.length?n.fromByteArray(t):n.fromByteArray(t.slice(e,r))}function x(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,s,u,a,c=t[o],f=null,h=c>239?4:c>223?3:c>191?2:1;if(o+h<=r)switch(h){case 1:c<128&&(f=c);break;case 2:128==(192&(i=t[o+1]))&&(a=(31&c)<<6|63&i)>127&&(f=a);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(a=(15&c)<<12|(63&i)<<6|63&s)>2047&&(a<55296||a>57343)&&(f=a);break;case 4:i=t[o+1],s=t[o+2],u=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&u)&&(a=(15&c)<<18|(63&i)<<12|(63&s)<<6|63&u)>65535&&a<1114112&&(f=a)}null===f?(f=65533,h=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),o+=h}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=4096));return r}(n)}e.Buffer=a,e.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)},e.INSPECT_MAX_BYTES=50,a.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"==typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(t){return!1}}(),e.kMaxLength=s(),a.poolSize=8192,a._augment=function(t){return t.__proto__=a.prototype,t},a.from=function(t,e,r){return c(null,t,e,r)},a.TYPED_ARRAY_SUPPORT&&(a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0})),a.alloc=function(t,e,r){return function(t,e,r,n){return f(e),e<=0?u(t,e):void 0!==r?"string"==typeof n?u(t,e).fill(r,n):u(t,e).fill(r):u(t,e)}(null,t,e,r)},a.allocUnsafe=function(t){return h(null,t)},a.allocUnsafeSlow=function(t){return h(null,t)},a.isBuffer=function(t){return!(null==t||!t._isBuffer)},a.compare=function(t,e){if(!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError("Arguments must be Buffers");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},a.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}},a.concat=function(t,e){if(!i(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=a.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var s=t[r];if(!a.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,o),o+=s.length}return n},a.byteLength=d,a.prototype._isBuffer=!0,a.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)y(this,e,e+1);return this},a.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)y(this,e,e+3),y(this,e+1,e+2);return this},a.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)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},a.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?x(this,0,t):g.apply(this,arguments)},a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,r).match(/.{2}/g).join(" "),this.length>r&&(t+=" ... ")),"<Buffer "+t+">"},a.prototype.compare=function(t,e,r,n,o){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),u=Math.min(i,s),c=this.slice(n,o),f=t.slice(e,r),h=0;h<u;++h)if(c[h]!==f[h]){i=c[h],s=f[h];break}return i<s?-1:s<i?1:0},a.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},a.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},a.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||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return b(this,t,e,r);case"utf8":case"utf-8":return w(this,t,e,r);case"ascii":return _(this,t,e,r);case"latin1":case"binary":return P(this,t,e,r);case"base64":return R(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function T(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function k(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function O(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=N(t[i]);return o}function j(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function U(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function C(t,e,r,n,o,i){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function S(t,e,r,n){e<0&&(e=65535+e+1);for(var o=0,i=Math.min(t.length-r,2);o<i;++o)t[r+o]=(e&255<<8*(n?o:1-o))>>>8*(n?o:1-o)}function B(t,e,r,n){e<0&&(e=4294967295+e+1);for(var o=0,i=Math.min(t.length-r,4);o<i;++o)t[r+o]=e>>>8*(n?o:3-o)&255}function I(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Y(t,e,r,n,i){return i||I(t,0,r,4),o.write(t,e,r,n,23,4),r+4}function q(t,e,r,n,i){return i||I(t,0,r,8),o.write(t,e,r,n,52,8),r+8}a.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),(e=void 0===e?n:~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),e<t&&(e=t),a.TYPED_ARRAY_SUPPORT)(r=this.subarray(t,e)).__proto__=a.prototype;else{var o=e-t;r=new a(o,void 0);for(var i=0;i<o;++i)r[i]=this[i+t]}return r},a.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},a.prototype.readUIntBE=function(t,e,r){t|=0,e|=0,r||U(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},a.prototype.readUInt8=function(t,e){return e||U(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return e||U(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return e||U(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return e||U(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return e||U(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.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},a.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];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},a.prototype.readInt8=function(t,e){return e||U(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){e||U(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){e||U(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return e||U(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return e||U(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return e||U(t,4,this.length),o.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return e||U(t,4,this.length),o.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return e||U(t,8,this.length),o.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return e||U(t,8,this.length),o.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||C(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},a.prototype.writeUIntBE=function(t,e,r,n){(t=+t,e|=0,r|=0,n)||C(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,255,0),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):S(this,t,e,!0),e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,65535,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):S(this,t,e,!1),e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):B(this,t,e,!0),e+4},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,4294967295,0),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=0,s=1,u=0;for(this[e]=255&t;++i<r&&(s*=256);)t<0&&0===u&&0!==this[e+i-1]&&(u=1),this[e+i]=(t/s>>0)-u&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var o=Math.pow(2,8*r-1);C(this,t,e,r,o-1,-o)}var i=r-1,s=1,u=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===u&&0!==this[e+i+1]&&(u=1),this[e+i]=(t/s>>0)-u&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,1,127,-128),a.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):S(this,t,e,!0),e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,2,32767,-32768),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):S(this,t,e,!1),e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),a.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):B(this,t,e,!0),e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||C(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),a.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):B(this,t,e,!1),e+4},a.prototype.writeFloatLE=function(t,e,r){return Y(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return Y(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return q(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return q(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o,i=n-r;if(this===t&&r<e&&e<n)for(o=i-1;o>=0;--o)t[o+e]=this[o+r];else if(i<1e3||!a.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,r+i),e);return i},a.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===t.length){var o=t.charCodeAt(0);o<256&&(t=o)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var s=a.isBuffer(t)?t:L(new a(t,n).toString()),u=s.length;for(i=0;i<r-e;++i)this[i+e]=s[i%u]}return this};var M=/[^+\/0-9A-Za-z-_]/g;function N(t){return t<16?"0"+t.toString(16):t.toString(16)}function L(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<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 D(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(M,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function $(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}}).call(this,r(8))},function(t,e,r){"use strict";e.byteLength=function(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n},e.toByteArray=function(t){var e,r,n=c(t),s=n[0],u=n[1],a=new i(function(t,e,r){return 3*(e+r)/4-r}(0,s,u)),f=0,h=u>0?s-4:s;for(r=0;r<h;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],a[f++]=e>>16&255,a[f++]=e>>8&255,a[f++]=255&e;2===u&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,a[f++]=255&e);1===u&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,a[f++]=e>>8&255,a[f++]=255&e);return a},e.fromByteArray=function(t){for(var e,r=t.length,o=r%3,i=[],s=0,u=r-o;s<u;s+=16383)i.push(f(t,s,s+16383>u?u:s+16383));1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"="));return i.join("")};for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,a=s.length;u<a;++u)n[u]=s[u],o[s.charCodeAt(u)]=u;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t,e,r){for(var o,i,s=[],u=e;u<r;u+=3)o=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),s.push(n[(i=o)>>18&63]+n[i>>12&63]+n[i>>6&63]+n[63&i]);return s.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,n,o){var i,s,u=8*o-n-1,a=(1<<u)-1,c=a>>1,f=-7,h=r?o-1:0,l=r?-1:1,p=t[e+h];for(h+=l,i=p&(1<<-f)-1,p>>=-f,f+=u;f>0;i=256*i+t[e+h],h+=l,f-=8);for(s=i&(1<<-f)-1,i>>=-f,f+=n;f>0;s=256*s+t[e+h],h+=l,f-=8);if(0===i)i=1-c;else{if(i===a)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),i-=c}return(p?-1:1)*s*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var s,u,a,c=8*i-o-1,f=(1<<c)-1,h=f>>1,l=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-s))<1&&(s--,a*=2),(e+=s+h>=1?l/a:l*Math.pow(2,1-h))*a>=2&&(s++,a/=2),s+h>=f?(u=0,s=f):s+h>=1?(u=(e*a-1)*Math.pow(2,o),s+=h):(u=e*Math.pow(2,h-1)*Math.pow(2,o),s=0));o>=8;t[r+p]=255&u,p+=d,u/=256,o-=8);for(s=s<<o|u,c+=o;c>0;t[r+p]=255&s,p+=d,s/=256,c-=8);t[r+p-d]|=128*g}},function(t,e){var r={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==r.call(t)}},function(t,e,r){"use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}t.exports=function(t,e,r,i){e=e||"&",r=r||"=";var s={};if("string"!=typeof t||0===t.length)return s;var u=/\+/g;t=t.split(e);var a=1e3;i&&"number"==typeof i.maxKeys&&(a=i.maxKeys);var c=t.length;a>0&&c>a&&(c=a);for(var f=0;f<c;++f){var h,l,p,d,g=t[f].replace(u,"%20"),y=g.indexOf(r);y>=0?(h=g.substr(0,y),l=g.substr(y+1)):(h=g,l=""),p=decodeURIComponent(h),d=decodeURIComponent(l),n(s,p)?o(s[p])?s[p].push(d):s[p]=[s[p],d]:s[p]=d}return s};var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},function(t,e,r){"use strict";var n=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}};t.exports=function(t,e,r,u){return e=e||"&",r=r||"=",null===t&&(t=void 0),"object"==typeof t?i(s(t),(function(s){var u=encodeURIComponent(n(s))+r;return o(t[s])?i(t[s],(function(t){return u+encodeURIComponent(n(t))})).join(e):u+encodeURIComponent(n(t[s]))})).join(e):u?encodeURIComponent(n(u))+r+encodeURIComponent(n(t)):""};var o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};function i(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n<t.length;n++)r.push(e(t[n],n));return r}var s=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,r){"use strict";t.exports=r(71)},function(t){t.exports=JSON.parse('["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"]')},function(t,e,r){"use strict";r.r(e),r.d(e,"AuthorizationRequiredError",(function(){return M})),r.d(e,"BaseError",(function(){return q})),r.d(e,"ForbiddenError",(function(){return N})),r.d(e,"InternalServerError",(function(){return L})),r.d(e,"InvalidScopeError",(function(){return D})),r.d(e,"NotFoundError",(function(){return $})),r.d(e,"OTPRequiredError",(function(){return K})),r.d(e,"RateLimitError",(function(){return H})),r.d(e,"UnauthorizedError",(function(){return J})),r.d(e,"UnavailableError",(function(){return G})),r.d(e,"UnknownError",(function(){return V})),r.d(e,"ValidationFailedError",(function(){return X})),r.d(e,"OAuthClient",(function(){return tt})),r.d(e,"Client",(function(){return et})),r.d(e,"Paginator",(function(){return ot})),r.d(e,"createError",(function(){return Z})),r.d(e,"buildBearerAuthorizationHeader",(function(){return W.b})),r.d(e,"buildBody",(function(){return W.c})),r.d(e,"buildBasicAuthorizationHeader",(function(){return W.a})),r.d(e,"normalizeURI",(function(){return W.e})),r.d(e,"buildUrl",(function(){return W.d})),r.d(e,"CookieStorage",(function(){return at})),r.d(e,"FetchClient",(function(){return ht})),r.d(e,"default",(function(){return lt}));var n={};function o(t,e){return this.api("/me/accounts/"+t,e)}function i(t){return this.api("/me/accounts",t)}r.r(n),r.d(n,"getAccount",(function(){return o})),r.d(n,"getAccounts",(function(){return i})),r.d(n,"createCard",(function(){return a})),r.d(n,"getCard",(function(){return c})),r.d(n,"getCards",(function(){return f})),r.d(n,"updateCard",(function(){return h})),r.d(n,"createCardAddress",(function(){return l})),r.d(n,"getCardAddresses",(function(){return p})),r.d(n,"cancelCardTransaction",(function(){return d})),r.d(n,"commitCardTransaction",(function(){return g})),r.d(n,"createCardTransaction",(function(){return y})),r.d(n,"getCardTransactions",(function(){return m})),r.d(n,"resendCardTransaction",(function(){return v})),r.d(n,"createContact",(function(){return b})),r.d(n,"getContact",(function(){return w})),r.d(n,"getContacts",(function(){return _})),r.d(n,"updateContact",(function(){return P})),r.d(n,"createDocument",(function(){return R})),r.d(n,"getDocuments",(function(){return E})),r.d(n,"getPhones",(function(){return A})),r.d(n,"getReserveTransactions",(function(){return x})),r.d(n,"getReserveTransaction",(function(){return T})),r.d(n,"getReserveStatistics",(function(){return k})),r.d(n,"getReserveLedger",(function(){return O})),r.d(n,"getTicker",(function(){return j})),r.d(n,"getTransaction",(function(){return U})),r.d(n,"getTransactions",(function(){return C})),r.d(n,"getMe",(function(){return S})),r.d(n,"updateMe",(function(){return B}));var s=r(0),u=r.n(s);function a(t,e,r){return this.api("/me/cards",u()({body:{currency:t,label:e},method:"post"},r))}function c(t,e){return this.api("/me/cards/"+t,e)}function f(t,e,r){return this.paginate("/me/cards",t,e,r)}function h(t,e,r){return this.api("/me/cards/"+t,u()({body:{label:e},method:"patch"},r))}function l(t,e,r){return this.api(`/me/cards/${t}/addresses`,u()({body:{network:e},method:"post"},r))}function p(t,e){return this.api(`/me/cards/${t}/addresses`,e)}function d(t,e,r){return this.api(`/me/cards/${t}/transactions/${e}/cancel`,Object.assign({method:"post"},r))}function g(t,e,{message:r,securityCode:n},o,i){return i=u()({body:{message:r,securityCode:n},method:"post"},i),o&&(i.headers=Object.assign({"otp-token":o},i.headers)),this.api(`/me/cards/${t}/transactions/${e}/commit`,i)}function y(t,{amount:e,currency:r,destination:n,message:o,origin:i,securityCode:s},a,c,f){return f=u()({body:{denomination:{amount:e,currency:r},destination:n,message:o,origin:i,securityCode:s},method:"post"},f),a&&(f.queryParams=Object.assign({commit:!0},f.queryParams)),c&&(f.headers=Object.assign({"otp-token":c},f.headers)),this.api(`/me/cards/${t}/transactions`,f)}function m(t,e,r,n){return this.paginate(`/me/cards/${t}/transactions`,e,r,n)}function v(t,e,r){return this.api(`/me/cards/${t}/transactions/${e}/resend`,Object.assign({method:"post"},r))}function b({addresses:t,company:e,emails:r,firstName:n,lastName:o},i){return this.api("/me/contacts",u()({body:{addresses:t,company:e,emails:r,firstName:n,lastName:o},method:"post"},i))}function w(t,e){return this.api("/me/contacts/"+t,e)}function _(t){return this.api("/me/contacts",t)}function P(t,{addresses:e,company:r,emails:n,firstName:o,lastName:i},s){return this.api("/me/contacts/"+t,u()({body:{addresses:e,company:r,emails:n,firstName:o,lastName:i},method:"patch"},s))}function R(t,e,r){return this.api("/me/documents",u()({body:{type:t,value:e},method:"post"},r))}function E(t){return this.api("/me/documents",t)}function A(t){return this.api("/me/phones",t)}function x(t,e,r){return this.paginate("/reserve/transactions",t,e,r)}function T(t,e){return this.api("/reserve/transactions/"+t,e)}function k(t){return this.api("/reserve/statistics",Object.assign({authenticate:!1},t))}function O(t,e,r){return this.paginate("/reserve/ledger",t,e,r)}function j(t,e){return this.api("/ticker"+(t?"/"+t:""),Object.assign({authenticate:!1},e))}function U(t,e){return this.api("/me/transactions/"+t,e)}function C(t,e,r){return this.paginate("/me/transactions",t,e,r)}function S(t){return this.api("/me",t)}function B({address:t,birthdate:e,country:r,firstName:n,identity:o,lastName:i,password:s,settings:a,state:c,username:f},h,l){return l=u()({body:{address:t,birthdate:e,country:r,firstName:n,identity:o,lastName:i,password:s,settings:a,state:c,username:f},method:"patch"},l),h&&(l.headers=Object.assign({"otp-token":h},l.headers)),this.api("/me",l)}var I=r(16),Y=r.n(I);class q extends Y.a{}class M extends q{constructor(){super("authorization_required",...arguments)}}class N extends q{static hasError({status:t}={}){return 403===t}constructor(){super("forbidden",...arguments)}}class L extends q{static hasError({status:t}={}){return 500===t}constructor(){super("internal_server",...arguments)}}class D extends q{static hasError({body:t,status:e}={}){return!!(e&&t&&t.error)&&(400===e&&"invalid_scope"===t.error)}constructor(){super("invalid_scope",...arguments)}}class $ extends q{static hasError({status:t}={}){return 404===t}constructor(){super("not_found",...arguments)}}var z=r(17),F=r.n(z);class K extends q{static hasError({headers:t}={}){return!(!t||!t["otp-token"])&&F()(["OPTIONAL","REQUIRED"],t["otp-token"].toUpperCase())}constructor(){super("otp_required",...arguments)}}class H extends q{static hasError({status:t}={}){return 429===t}constructor(t){const e=Object.assign({},t);if(t.headers){["limit","remaining","reset"].forEach(r=>{const n="rate-limit-"+r;t.headers[n]&&(e[r]=t.headers[n])})}super("rate_limit",e)}getRateLimitData(){return{limit:this.limit,remaining:this.remaining,reset:this.reset}}}class J extends q{static hasError({body:t,status:e}={}){return!!(e&&t&&t.error)&&(400===e&&("invalid_request"===t.error||"invalid_grant"===t.error)||401===e&&"invalid_token"===t.error)}constructor(){super("unauthorized",...arguments)}}class G extends q{static hasError({status:t}={}){return t<=0}constructor(){super("unavailable",...arguments)}}class V extends q{static hasError(){return!0}constructor(){super("unknown",...arguments)}}class X extends q{static hasError({body:t}={}){return t&&"validation_failed"===t.code}constructor(){super("validation_failed",...arguments)}}var Q=[M,N,L,D,$,K,H,J,G,X,V];function Z(t,e){for(const r of Q)if(r.hasError&&r.hasError(t))return new r(Object.assign({},t,{response:e}))}var W=r(15);class tt{constructor({baseUrl:t,clientId:e,clientSecret:r}){this.clientId=e,this.clientSecret=r,this.headers={"content-type":"application/x-www-form-urlencoded"},this.requestUrl=Object(W.d)("/oauth2/token",t),this.revokeUrl=Object(W.d)("/oauth2/revoke",t)}buildAccessTokenRequestByAuthorizationCodeGrant(t){return{body:this._generateRequestBody({code:t,grant_type:"authorization_code"}),headers:this.headers,url:this.requestUrl}}buildRefreshTokenRequest(t){return{body:this._generateRequestBody({grant_type:"refresh_token",refresh_token:t}),headers:this.headers,url:this.requestUrl}}buildRevokeTokenRequest(t){return{body:Object(W.c)({token:t}),headers:Object.assign({},Object(W.b)(t),this.headers),url:this.revokeUrl}}_generateRequestBody(t){return Object(W.c)(Object.assign({client_id:this.clientId,client_secret:this.clientSecret},t))}}class et{constructor(){this.defaultHeaders={}}}var rt=r(19),nt=r.n(rt);class ot{constructor(t,e,r,n){this.itemsPerPage=r,this.options=n,this.sdk=t,this.uri=e}getNextPage(t){return this.hasNextPage()?this.getPage(this.currentPage+1,t):Promise.resolve()}getPage(t=1,e){return this.sdk.api(this.uri,u()({headers:{range:`items=${(t-1)*this.itemsPerPage}-${t*this.itemsPerPage-1}`}},this.options,e,{raw:!0})).then(({body:t,headers:e})=>{const{first:r,length:n}=nt.a.parse(e["content-range"]);return this.currentPage=n?r/this.itemsPerPage+1:null,this.headers=e,this.items=t,this.itemsCount=n,this.pagesCount=Math.ceil(n/this.itemsPerPage),this})}getPreviousPage(t){return this.hasPreviousPage()?this.getPage(this.currentPage-1,t):Promise.resolve()}hasNextPage(){return!!this.currentPage&&this.currentPage<this.pagesCount}hasPreviousPage(){return!!this.currentPage&&this.currentPage>1}}var it=r(5),st=r.n(it);class ut{constructor(t){if(!t)throw new Error("Missing options");if(!t.clientId)throw new Error("Missing 'clientId' option");if(!t.clientSecret)throw new Error("Missing 'clientSecret' option");this.options=Object.assign({},{accessTokenKey:"uphold.access_token",baseUrl:"https://api.uphold.com",itemsPerPage:10,otpTokenStatus:"uphold.otp_token_status",refreshTokenKey:"uphold.refresh_token",scope:"uphold.scope",version:"v0"},t),this.refreshRequestPromise=null,this.tokenRequestPromise=null,this.oauthClient=new tt(this.options)}api(t,e={}){const{authenticate:r=!0,headers:n={},method:o="get",queryParams:i,raw:s,version:u=this.options.version}=e;let{body:a}=e;const c=Object(W.d)(t,this.options.baseUrl,u,i);let f;return a&&("object"==typeof a&&(a=JSON.stringify(a)),n["content-type"]="application/json"),f=r&&!n.authorization?this.getToken().then(t=>this.client.request(c,o,a,Object.assign({},Object(W.b)(t.access_token),n),e)):this.client.request(c,o,a,n,e),f.then(t=>s?t:t.body).catch(this._refreshToken(c,o,a,n,e))}authorize(t){const e=this.oauthClient.buildAccessTokenRequestByAuthorizationCodeGrant(t);return this.tokenRequestPromise=this._authenticationRequest(e),this.tokenRequestPromise}getToken(){return this.storage.getItem(this.options.accessTokenKey).then(t=>t?this.storage.getItem(this.options.refreshTokenKey).then(e=>({access_token:t,refresh_token:e})).catch(()=>({access_token:t})):(this.tokenRequestPromise=null,Promise.reject())).catch(()=>this.tokenRequestPromise?this.tokenRequestPromise:Promise.reject(new M))}logout(){return this._revokeToken().catch(t=>{if(!(t instanceof J))return Promise.reject(t)}).then(()=>this.removeToken())}paginate(t,e=1,r=this.options.itemsPerPage,n){return new ot(this,t,r,n).getPage(e)}removeToken(){return Promise.all([this.storage.removeItem(this.options.accessTokenKey),this.storage.removeItem(this.options.refreshTokenKey)])}setToken(t,e={}){return this.storage.setItem(this.options.accessTokenKey,t.access_token).then(()=>{this.storage.setItem(this.options.scope,st()(t,"scope","")),this.storage.setItem(this.options.otpTokenStatus,st()(e,"otp-token","")),t.refresh_token&&this.storage.setItem(this.options.refreshTokenKey,t.refresh_token)}).then(()=>t)}_authenticationRequest({body:t,headers:e,url:r}){return this.client.request(r,"post",t,e).then(({body:t,headers:e})=>this.setToken(t,e))}_refreshToken(t,e,r,n,o){return i=>i&&i.body&&"invalid_token"===i.body.error?(this.refreshRequestPromise||(this.refreshRequestPromise=this._requestRefreshToken(i)),this.refreshRequestPromise.then(i=>this.client.request(t,e,r,Object.assign({},Object(W.b)(i.access_token),n),o).then(t=>t.body))):Promise.reject(i)}_requestRefreshToken(t){return this.storage.getItem(this.options.refreshTokenKey).catch(()=>Promise.reject(t)).then(t=>{const e=this.oauthClient.buildRefreshTokenRequest(t);return this._authenticationRequest(e).then(t=>(this.refreshRequestPromise=null,t))})}_revokeToken(){return this.getToken().then(t=>{const{body:e,headers:r,url:n}=this.oauthClient.buildRevokeTokenRequest(t.access_token);return this.client.request(n,"post",e,r)})}}for(const t in n)ut.prototype[t]=n[t];class at{constructor(t="_token"){this.cache={},this.storageName=t}getItem(t){if(this.cache[t])return Promise.resolve(this.cache[t]);const e=this._getCookie();return e[t]?(this.cache[t]=e[t],Promise.resolve(e[t])):Promise.reject()}removeItem(t){const e=this._getCookie();return e[t]?(delete this.cache[t],delete e[t],this._setCookie(e),Promise.resolve()):Promise.resolve()}setItem(t,e){const r=this._getCookie();return delete this.cache[t],r[t]=e,this._setCookie(r),Promise.resolve()}_getCookie(){const t=new RegExp(`(?:^|; )${encodeURIComponent(this.storageName)}=([^;]*)`).exec(document.cookie);return t?JSON.parse(decodeURIComponent(t[1])):{}}_setCookie(t){document.cookie=`${this.storageName}=${encodeURIComponent(JSON.stringify(t))};path=/`}}var ct=r(20),ft=r.n(ct);class ht extends et{request(t,e="get",r,n={},o={}){const i=Object.assign({},o,{body:r,cache:"no-cache",credentials:"omit",headers:new Headers(Object.assign({},this.defaultHeaders,n)),method:e.toUpperCase(),mode:"cors"});return fetch(t,i).then(t=>t.ok?t.text().then(this._parseText).then(e=>this._formatResponse(t,e)):Promise.reject(t)).catch(t=>t.json?t.text().then(this._parseText).then(e=>Promise.reject(Z(this._formatResponse(t,e),t))):Promise.reject(Z(this._formatResponse({error:t,status:-1}),t)))}_formatResponse(t,e=null){return{body:e,headers:this._parseHeaders(t.headers),status:t.status,url:t.url}}_parseHeaders(t){const e={};return t?(t.forEach((t,r)=>{e[r]=t}),e):e}_parseText(t){if(!t||ft()(t))return{};try{return JSON.parse(t)}catch(e){return t}}}var lt=class extends ut{constructor(){super(...arguments),this.client=new ht,this.storage=new at(this.options.storageName)}}}]);