From 1d01c81d7d49f5020a73b7e2a34017278ac1636c Mon Sep 17 00:00:00 2001
From: Pedro Gomes
Date: Fri, 21 Feb 2020 18:31:39 +0000
Subject: [PATCH] Release 2.4.0
---
CHANGELOG.md | 10 ++++++++++
dist/browser/uphold-sdk-javascript.js | 2 +-
dist/core/errors/otp-required.js | 4 +++-
dist/core/sdk.js | 16 +++++++++++++---
dist/core/utils/request-helper.js | 2 +-
package.json | 2 +-
6 files changed, 29 insertions(+), 7 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d2e7c21..1cbb4d3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,15 @@
# Changelog
+## [v2.4.0](https://github.com/uphold/uphold-sdk-javascript/releases/tag/v2.4.0) (2020-02-21)
+- Add scope and otp header to storage [\#30](https://github.com/uphold/uphold-sdk-javascript/pull/30) ([asoraiamartins](https://github.com/asoraiamartins))
+- Update favicon and logo on `README` [\#27](https://github.com/uphold/uphold-sdk-javascript/pull/27) ([7patricia](https://github.com/7patricia))
+- Fixing dependency vulnerabilities [\#26](https://github.com/uphold/uphold-sdk-javascript/pull/26) ([ryanml](https://github.com/ryanml))
+- Update `babel-plugin-istanbul` to version 5.1.4 [\#24](https://github.com/uphold/uphold-sdk-javascript/pull/24) ([SandroMachado](https://github.com/SandroMachado))
+- bump lodash.merge [\#25](https://github.com/uphold/uphold-sdk-javascript/pull/25) ([evq](https://github.com/evq))
+- Update ESLint to version 6.0.1 [\#23](https://github.com/uphold/uphold-sdk-javascript/pull/23) ([SandroMachado](https://github.com/SandroMachado))
+- Bump `Request` to version 2.88.0 [\#21](https://github.com/uphold/uphold-sdk-javascript/pull/21) ([SandroMachado](https://github.com/SandroMachado))
+- Update travis node versions [\#22](https://github.com/uphold/uphold-sdk-javascript/pull/22) ([SandroMachado](https://github.com/SandroMachado))
+
## [v2.3.0](https://github.com/uphold/uphold-sdk-javascript/releases/tag/v2.3.0) (2018-05-22)
- Add origin to create card transaction [\#17](https://github.com/uphold/uphold-sdk-javascript/pull/17) ([pgom](https://github.com/pgom))
diff --git a/dist/browser/uphold-sdk-javascript.js b/dist/browser/uphold-sdk-javascript.js
index a4760bd..b9e13ca 100644
--- a/dist/browser/uphold-sdk-javascript.js
+++ b/dist/browser/uphold-sdk-javascript.js
@@ -1 +1 @@
-module.exports=function(l){function n(e){if(u[e])return u[e].exports;var t=u[e]={i:e,l:!1,exports:{}};return l[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}var u={};return n.m=l,n.c=u,n.i=function(l){return l},n.d=function(l,u,e){n.o(l,u)||Object.defineProperty(l,u,{configurable:!1,enumerable:!0,get:e})},n.n=function(l){var u=l&&l.__esModule?function(){return l.default}:function(){return l};return n.d(u,"a",u),u},n.o=function(l,n){return Object.prototype.hasOwnProperty.call(l,n)},n.p="",n(n.s=10)}([function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.BaseError=void 0;var o=u(51),i=function(l){return l&&l.__esModule?l:{default:l}}(o);n.BaseError=function(l){function n(){return e(this,n),t(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return r(n,l),n}(i.default)},function(l,n,u){(function(l,u){function e(l,n){return l.set(n[0],n[1]),l}function t(l,n){return l.add(n),l}function r(l,n,u){switch(u.length){case 0:return l.call(n);case 1:return l.call(n,u[0]);case 2:return l.call(n,u[0],u[1]);case 3:return l.call(n,u[0],u[1],u[2])}return l.apply(n,u)}function o(l,n){for(var u=-1,e=l?l.length:0;++u-1}function P(l,n){var u=this.__data__,e=z(u,l);return e<0?u.push([l,n]):u[e][1]=n,this}function A(l){var n=-1,u=l?l.length:0;for(this.clear();++n-1&&l%1==0&&l-1&&l%1==0&&l<=Dl}function Sl(l){var n=typeof l;return!!l&&("object"==n||"function"==n)}function Rl(l){return!!l&&"object"==typeof l}function Ml(l){if(!Rl(l)||Un.call(l)!=Wl||f(l))return!1;var n=Dn(l);if(null===n)return!0;var u=In.call(n,"constructor")&&n.constructor;return"function"==typeof u&&u instanceof u&&Mn.call(u)==Bn}function Il(l){return sl(l,Ul(l))}function Bl(l){return Al(l)?N(l):Q(l)}function Ul(l){return Al(l)?N(l,!0):X(l)}function ql(){return[]}function Ll(){return!1}var Nl=200,Fl="__lodash_hash_undefined__",Dl=9007199254740991,zl="[object Arguments]",Hl="[object Boolean]",Kl="[object Date]",Jl="[object Function]",Vl="[object GeneratorFunction]",Gl="[object Map]",$l="[object Number]",Wl="[object Object]",Ql="[object RegExp]",Xl="[object Set]",Yl="[object String]",Zl="[object Symbol]",ln="[object WeakMap]",nn="[object ArrayBuffer]",un="[object DataView]",en="[object Float32Array]",tn="[object Float64Array]",rn="[object Int8Array]",on="[object Int16Array]",an="[object Int32Array]",cn="[object Uint8Array]",sn="[object Uint8ClampedArray]",fn="[object Uint16Array]",dn="[object Uint32Array]",pn=/[\\^$.*+?()[\]{}|]/g,hn=/\w*$/,yn=/^\[object .+?Constructor\]$/,bn=/^(?:0|[1-9]\d*)$/,vn={};vn[en]=vn[tn]=vn[rn]=vn[on]=vn[an]=vn[cn]=vn[sn]=vn[fn]=vn[dn]=!0,vn[zl]=vn["[object Array]"]=vn[nn]=vn[Hl]=vn[un]=vn[Kl]=vn["[object Error]"]=vn[Jl]=vn[Gl]=vn[$l]=vn[Wl]=vn[Ql]=vn[Xl]=vn[Yl]=vn[ln]=!1;var gn={};gn[zl]=gn["[object Array]"]=gn[nn]=gn[un]=gn[Hl]=gn[Kl]=gn[en]=gn[tn]=gn[rn]=gn[on]=gn[an]=gn[Gl]=gn[$l]=gn[Wl]=gn[Ql]=gn[Xl]=gn[Yl]=gn[Zl]=gn[cn]=gn[sn]=gn[fn]=gn[dn]=!0,gn["[object Error]"]=gn[Jl]=gn[ln]=!1;var _n="object"==typeof l&&l&&l.Object===Object&&l,mn="object"==typeof self&&self&&self.Object===Object&&self,wn=_n||mn||Function("return this")(),On="object"==typeof n&&n&&!n.nodeType&&n,jn=On&&"object"==typeof u&&u&&!u.nodeType&&u,kn=jn&&jn.exports===On,En=kn&&_n.process,Pn=function(){try{return En&&En.binding("util")}catch(l){}}(),An=Pn&&Pn.isTypedArray,xn=Array.prototype,Cn=Function.prototype,Tn=Object.prototype,Sn=wn["__core-js_shared__"],Rn=function(){var l=/[^.]+$/.exec(Sn&&Sn.keys&&Sn.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""}(),Mn=Cn.toString,In=Tn.hasOwnProperty,Bn=Mn.call(Object),Un=Tn.toString,qn=RegExp("^"+Mn.call(In).replace(pn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ln=kn?wn.Buffer:void 0,Nn=wn.Symbol,Fn=wn.Uint8Array,Dn=p(Object.getPrototypeOf,Object),zn=Object.create,Hn=Tn.propertyIsEnumerable,Kn=xn.splice,Jn=Object.getOwnPropertySymbols,Vn=Ln?Ln.isBuffer:void 0,Gn=p(Object.keys,Object),$n=Math.max,Wn=hl(wn,"DataView"),Qn=hl(wn,"Map"),Xn=hl(wn,"Promise"),Yn=hl(wn,"Set"),Zn=hl(wn,"WeakMap"),lu=hl(Object,"create"),nu=kl(Wn),uu=kl(Qn),eu=kl(Xn),tu=kl(Yn),ru=kl(Zn),ou=Nn?Nn.prototype:void 0,iu=ou?ou.valueOf:void 0;y.prototype.clear=b,y.prototype.delete=v,y.prototype.get=g,y.prototype.has=_,y.prototype.set=m,w.prototype.clear=O,w.prototype.delete=j,w.prototype.get=k,w.prototype.has=E,w.prototype.set=P,A.prototype.clear=x,A.prototype.delete=C,A.prototype.get=T,A.prototype.has=S,A.prototype.set=R,M.prototype.clear=I,M.prototype.delete=B,M.prototype.get=U,M.prototype.has=q,M.prototype.set=L;var au=Jn?p(Jn,Object):ql,cu=G;(Wn&&cu(new Wn(new ArrayBuffer(1)))!=un||Qn&&cu(new Qn)!=Gl||Xn&&"[object Promise]"!=cu(Xn.resolve())||Yn&&cu(new Yn)!=Xl||Zn&&cu(new Zn)!=ln)&&(cu=function(l){var n=Un.call(l),u=n==Wl?l.constructor:void 0,e=u?kl(u):void 0;if(e)switch(e){case nu:return un;case uu:return Gl;case eu:return"[object Promise]";case tu:return Xl;case ru:return ln}return n});var su=Array.isArray,fu=Vn||Ll,du=An?function(l){return function(n){return l(n)}}(An):W,pu=function(l){return ll(function(n,u){var e=-1,t=u.length,r=t>1?u[t-1]:void 0,o=t>2?u[2]:void 0;for(r=l.length>3&&"function"==typeof r?(t--,r):void 0,o&&_l(u[0],u[1],o)&&(r=t<3?void 0:r,t=1),n=Object(n);++e=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122?u+=n.charAt(e):r<128?u+=t[r]:r<2048?u+=t[192|r>>6]+t[128|63&r]:r<55296||r>=57344?u+=t[224|r>>12]+t[128|r>>6&63]+t[128|63&r]:(e+=1,r=65536+((1023&r)<<10|1023&n.charCodeAt(e)),u+=t[240|r>>18]+t[128|r>>12&63]+t[128|r>>6&63]+t[128|63&r])}return u},n.compact=function(l,u){if("object"!=typeof l||null===l)return l;var e=u||[],t=e.indexOf(l);if(-1!==t)return e[t];if(e.push(l),Array.isArray(l)){for(var r=[],o=0;o0&&void 0!==arguments[0]?arguments[0]:"_token";e(this,l),this.cache={},this.storageName=n}return t(l,[{key:"getItem",value:function(l){if(this.cache[l])return Promise.resolve(this.cache[l]);var n=this._getCookie();return n[l]?(this.cache[l]=n[l],Promise.resolve(n[l])):Promise.reject()}},{key:"removeItem",value:function(l){var n=this._getCookie();return n[l]?(delete this.cache[l],delete n[l],this._setCookie(n),Promise.resolve()):Promise.resolve()}},{key:"setItem",value:function(l,n){var u=this._getCookie();return delete this.cache[l],u[l]=n,this._setCookie(u),Promise.resolve()}},{key:"_getCookie",value:function(){var l=new RegExp("(?:^|; )"+encodeURIComponent(this.storageName)+"=([^;]*)").exec(document.cookie);return l?JSON.parse(decodeURIComponent(l[1])):{}}},{key:"_setCookie",value:function(l){document.cookie=this.storageName+"="+encodeURIComponent(JSON.stringify(l))+";path=/"}}]),l}();n.default=r},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0});var o=Object.assign||function(l){for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:"get",u=arguments[2],e=this,t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i=o({},r,{body:u,cache:"no-cache",credentials:"omit",headers:new Headers(o({},this.defaultHeaders,t)),method:n.toUpperCase(),mode:"cors"});return fetch(l,i).then(function(l){return l.ok?l.text().then(e._parseText).then(function(n){return e._formatResponse(l,n)}):Promise.reject(l)}).catch(function(l){return l.json?l.text().then(e._parseText).then(function(n){return Promise.reject((0,a.createError)(e._formatResponse(l,n),l))}):Promise.reject((0,a.createError)(e._formatResponse({error:l,status:-1}),l))})}},{key:"_formatResponse",value:function(l){return{body:arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,headers:this._parseHeaders(l.headers),status:l.status,url:l.url}}},{key:"_parseHeaders",value:function(l){var n={};return l?(l.forEach(function(l,u){n[u]=l}),n):n}},{key:"_parseText",value:function(l){if(!l||(0,s.default)(l))return{};try{return JSON.parse(l)}catch(n){return l}}}]),n}(a.Client);n.default=f},function(l,n,u){"use strict";function e(l,n){return this.api("/me/accounts/"+l,n)}function t(l){return this.api("/me/accounts",l)}Object.defineProperty(n,"__esModule",{value:!0}),n.getAccount=e,n.getAccounts=t},function(l,n,u){"use strict";function e(l,n,u){return this.api("/me/cards/"+l+"/addresses",(0,o.default)({body:{network:n},method:"post"},u))}function t(l,n){return this.api("/me/cards/"+l+"/addresses",n)}Object.defineProperty(n,"__esModule",{value:!0}),n.createCardAddress=e,n.getCardAddresses=t;var r=u(1),o=function(l){return l&&l.__esModule?l:{default:l}}(r)},function(l,n,u){"use strict";function e(l,n,u){return this.api("/me/cards/"+l+"/transactions/"+n+"/cancel",a({method:"post"},u))}function t(l,n,u,e,t){var r=u.message,o=u.securityCode;return t=(0,s.default)({body:{message:r,securityCode:o},method:"post"},t),e&&(t.headers=a({"otp-token":e},t.headers)),this.api("/me/cards/"+l+"/transactions/"+n+"/commit",t)}function r(l,n,u,e,t){var r=n.amount,o=n.currency,i=n.destination,c=n.origin,f=n.message,d=n.securityCode;return t=(0,s.default)({body:{denomination:{amount:r,currency:o},destination:i,message:f,origin:c,securityCode:d},method:"post"},t),u&&(t.queryParams=a({commit:!0},t.queryParams)),e&&(t.headers=a({"otp-token":e},t.headers)),this.api("/me/cards/"+l+"/transactions",t)}function o(l,n,u,e){return this.paginate("/me/cards/"+l+"/transactions",n,u,e)}function i(l,n,u){return this.api("/me/cards/"+l+"/transactions/"+n+"/resend",a({method:"post"},u))}Object.defineProperty(n,"__esModule",{value:!0});var a=Object.assign||function(l){for(var n=1;n0&&void 0!==arguments[0]?arguments[0]:{}).status}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.InternalServerError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{}).status}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.InvalidScopeError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{},n=l.body,u=l.status;return!!(u&&n&&n.error)&&(400===u&&"invalid_scope"===n.error)}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.NotFoundError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{}).status}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.OTPRequiredError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{},n=l.headers;return!(!n||!n["otp-token"])&&"REQUIRED"===n["otp-token"].toUpperCase()}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.RateLimitError=void 0;var o=Object.assign||function(l){for(var n=1;n0&&void 0!==arguments[0]?arguments[0]:{}).status}}]),i(n,[{key:"getRateLimitData",value:function(){return{limit:this.limit,remaining:this.remaining,reset:this.reset}}}]),n}(a.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.UnauthorizedError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{},n=l.body,u=l.status;return!!(u&&n&&n.error)&&(400===u&&("invalid_request"===n.error||"invalid_grant"===n.error)||401===u&&"invalid_token"===n.error)}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.UnavailableError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{}).status<=0}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.UnknownError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{},n=l.body;return n&&"validation_failed"===n.code}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(l){return typeof l}:function(l){return l&&"function"==typeof Symbol&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},r=Object.assign||function(l){for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:{},e=u.authenticate,o=void 0===e||e,i=u.headers,a=void 0===i?{}:i,c=u.method,s=void 0===c?"get":c,d=u.queryParams,p=u.raw,h=u.version,y=void 0===h?this.options.version:h,b=u.body,v=(0,f.buildUrl)(l,this.options.baseUrl,y,d),g=void 0;return b&&("object"===(void 0===b?"undefined":t(b))&&(b=JSON.stringify(b)),a["content-type"]="application/json"),g=o&&!a.authorization?this.getToken().then(function(l){return n.client.request(v,s,b,r({},(0,f.buildBearerAuthorizationHeader)(l.access_token),a),u)}):this.client.request(v,s,b,a,u),g.then(function(l){return p?l:l.body}).catch(this._refreshToken(v,s,b,a,u))}},{key:"authorize",value:function(l){var n=this.oauthClient.buildAccessTokenRequestByAuthorizationCodeGrant(l);return this.tokenRequestPromise=this._authenticationRequest(n),this.tokenRequestPromise}},{key:"getToken",value:function(){var l=this;return this.storage.getItem(this.options.accessTokenKey).then(function(n){return n?l.storage.getItem(l.options.refreshTokenKey).then(function(l){return{access_token:n,refresh_token:l}}).catch(function(){return{access_token:n}}):(l.tokenRequestPromise=null,Promise.reject())}).catch(function(){return l.tokenRequestPromise?l.tokenRequestPromise:Promise.reject(new c.AuthorizationRequiredError)})}},{key:"logout",value:function(){var l=this;return this._revokeToken().catch(function(l){if(!(l instanceof c.UnauthorizedError))return Promise.reject(l)}).then(function(){return l.removeToken()})}},{key:"paginate",value:function(l){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.options.itemsPerPage,e=arguments[3];return new s.Paginator(this,l,u,e).getPage(n)}},{key:"removeToken",value:function(){return Promise.all([this.storage.removeItem(this.options.accessTokenKey),this.storage.removeItem(this.options.refreshTokenKey)])}},{key:"setToken",value:function(l){var n=this;return this.storage.setItem(this.options.accessTokenKey,l.access_token).then(function(){if(l.refresh_token)return n.storage.setItem(n.options.refreshTokenKey,l.refresh_token)}).then(function(){return l})}},{key:"_authenticationRequest",value:function(l){var n=this,u=l.body,e=l.headers,t=l.url;return this.client.request(t,"post",u,e).then(function(l){var u=l.body;return n.setToken(u)})}},{key:"_refreshToken",value:function(l,n,u,e,t){var o=this;return function(i){return i&&i.body&&"invalid_token"===i.body.error?(o.refreshRequestPromise||(o.refreshRequestPromise=o._requestRefreshToken(i)),o.refreshRequestPromise.then(function(i){return o.client.request(l,n,u,r({},(0,f.buildBearerAuthorizationHeader)(i.access_token),e),t).then(function(l){return l.body})})):Promise.reject(i)}}},{key:"_requestRefreshToken",value:function(l){var n=this;return this.storage.getItem(this.options.refreshTokenKey).catch(function(){return Promise.reject(l)}).then(function(l){var u=n.oauthClient.buildRefreshTokenRequest(l);return n._authenticationRequest(u).then(function(l){return n.refreshRequestPromise=null,l})})}},{key:"_revokeToken",value:function(){var l=this;return this.getToken().then(function(n){var u=l.oauthClient.buildRevokeTokenRequest(n.access_token),e=u.body,t=u.headers,r=u.url;return l.client.request(r,"post",e,t)})}}]),l}();n.default=d;for(var p in a)d.prototype[p]=a[p]},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var t=u(47),r=function l(){e(this,l),this.defaultHeaders={"user-agent":t.name+"/"+t.version}};n.default=r},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var t=Object.assign||function(l){for(var n=1;n0&&void 0!==arguments[0]?arguments[0]:1,u=arguments[1];return this.sdk.api(this.uri,(0,c.default)({headers:{range:"items="+(n-1)*this.itemsPerPage+"-"+(n*this.itemsPerPage-1)}},this.options,u,{raw:!0})).then(function(n){var u=n.body,e=n.headers,t=i.default.parse(e["content-range"]),r=t.first,o=t.length;return l.currentPage=o?r/l.itemsPerPage+1:null,l.headers=e,l.items=u,l.itemsCount=o,l.pagesCount=Math.ceil(o/l.itemsPerPage),l})}},{key:"getPreviousPage",value:function(l){return this.hasPreviousPage()?this.getPage(this.currentPage-1,l):Promise.resolve()}},{key:"hasNextPage",value:function(){return!!this.currentPage&&this.currentPage1}}]),l}();n.default=s},function(l,n,u){"use strict";function e(l,n){for(var u=o.default,e=Array.isArray(u),r=0,u=e?u:u[Symbol.iterator]();;){var i;if(e){if(r>=u.length)break;i=u[r++]}else{if(r=u.next(),r.done)break;i=r.value}var a=i;if(a.hasError&&a.hasError(l))return new a(t({},l,{response:n}))}}Object.defineProperty(n,"__esModule",{value:!0});var t=Object.assign||function(l){for(var n=1;n0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===l[n-2]?2:"="===l[n-1]?1:0}function t(l){return 3*l.length/4-e(l)}function r(l){var n,u,t,r,o,i,a=l.length;o=e(l),i=new f(3*a/4-o),t=o>0?a-4:a;var c=0;for(n=0,u=0;n>16&255,i[c++]=r>>8&255,i[c++]=255&r;return 2===o?(r=s[l.charCodeAt(n)]<<2|s[l.charCodeAt(n+1)]>>4,i[c++]=255&r):1===o&&(r=s[l.charCodeAt(n)]<<10|s[l.charCodeAt(n+1)]<<4|s[l.charCodeAt(n+2)]>>2,i[c++]=r>>8&255,i[c++]=255&r),i}function o(l){return c[l>>18&63]+c[l>>12&63]+c[l>>6&63]+c[63&l]}function i(l,n,u){for(var e,t=[],r=n;ra?a:o+16383));return 1===e?(n=l[u-1],t+=c[n>>2],t+=c[n<<4&63],t+="=="):2===e&&(n=(l[u-2]<<8)+l[u-1],t+=c[n>>10],t+=c[n>>4&63],t+=c[n<<2&63],t+="="),r.push(t),r.join("")}n.byteLength=t,n.toByteArray=r,n.fromByteArray=a;for(var c=[],s=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p=0,h=d.length;p|(]*>|]*>|]+>)+/i,r=new RegExp(e.map(function(l){return"<"+l+"\\b[^>]*>"}).join("|"),"i");l.exports=function(l){return!!t.test(l)||r.test(l)}},function(l,n){l.exports=["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","keygen","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(l,n,u){l.exports=u(45)},function(l,n){l.exports={name:"@uphold/uphold-sdk-javascript",version:"2.3.0",description:"Uphold SDK for JavasScript",keywords:["api","javascript","sdk","uphold"],license:"MIT",author:"Uphold Inc.",main:"dist/node/index.js",repository:"git@github.com:uphold/uphold-sdk-javascript.git",scripts:{build:"rm -rf dist && yarn build:node && yarn build:browser","build:browser":"yarn && webpack --progress","build:node":"babel src/node -d dist/node && babel src/core -d dist/core",changelog:"github-changelog-generator --owner uphold --repo uphold-sdk-javascript --future-release=v$npm_package_version > CHANGELOG.md",cover:"yarn test -- --coverage",docs:"yarn docs:build && yarn docs:prepare && yarn docs:publish","docs:build":"gitbook install && cd docs && ../node_modules/.bin/gitbook build && cp -R images/* _book/gitbook/images","docs:prepare":"cd docs/_book && git init && git checkout -b gh-pages && git add . && git commit -m 'Update documentation'","docs:publish":"cd docs/_book && git push git@github.com:uphold/uphold-sdk-javascript gh-pages --force && cd .. && rm -rf _book",lint:"eslint --cache src test",release:"npm version $1 -m 'Release %s'",tdd:"yarn test -- --watch",test:"jest --config jest.json",version:"yarn build && yarn changelog && git add -f dist CHANGELOG.md"},browser:"dist/browser/uphold-sdk-javascript.js",dependencies:{"base64-js":"1.2.0","content-range":"1.1.0","lodash.merge":"4.6.0",qs:"6.4.0",request:"2.86.0","request-promise":"4.2.0","standard-error":"1.1.0","text-encoding":"0.6.4"},devDependencies:{"@uphold/github-changelog-generator":"0.4.1","babel-cli":"6.24.1","babel-core":"6.24.1","babel-eslint":"7.2.3","babel-loader":"7.0.0","babel-plugin-istanbul":"4.1.3","babel-plugin-transform-object-rest-spread":"6.23.0","babel-polyfill":"6.23.0","babel-preset-es2015":"6.24.1","babel-preset-es2015-node":"4.0.2",eslint:"3.19.0","eslint-config-seegno":"9.0.0","eslint-plugin-babel":"4.1.1","fetch-mock":"5.10.0","gitbook-cli":"2.3.0","html-tags":"1.1.1","is-html":"1.1.0","isomorphic-fetch":"2.2.1",jest:"19.0.2","json-loader":"0.5.4",nock:"9.0.13","pre-commit":"1.2.2",webpack:"2.5.0"},engines:{node:">=4"},"pre-commit":["lint"]}},function(l,n,u){"use strict";var e=u(50),t=u(49),r=u(7);l.exports={formats:r,parse:t,stringify:e}},function(l,n,u){"use strict";var e=u(8),t=Object.prototype.hasOwnProperty,r={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:e.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},o=function(l,n){for(var u={},e=l.split(n.delimiter,n.parameterLimit===1/0?void 0:n.parameterLimit),r=0;r=0&&u.parseArrays&&o<=u.arrayLimit?(e=[],e[o]=i(l,n,u)):e[r]=i(l,n,u)}return e},a=function(l,n,u){if(l){var e=u.allowDots?l.replace(/\.([^.[]+)/g,"[$1]"):l,r=/(\[[^[\]]*])/,o=/(\[[^[\]]*])/g,a=r.exec(e),c=a?e.slice(0,a.index):e,s=[];if(c){if(!u.plainObjects&&t.call(Object.prototype,c)&&!u.allowPrototypes)return;s.push(c)}for(var f=0;null!==(a=o.exec(e))&&f57343)t.push(r);else if(56320<=r&&r<=57343)t.push(65533);else if(55296<=r&&r<=56319)if(e===u-1)t.push(65533);else{var o=n.charCodeAt(e+1);if(56320<=o&&o<=57343){var i=1023&r,a=1023&o;t.push(65536+(i<<10)+a),e+=1}else t.push(65533)}e+=1}return t}function i(l){for(var n="",u=0;u>10),56320+(1023&e)))}return n}function a(l){return 0<=l&&l<=127}function c(l){this.tokens=[].slice.call(l),this.tokens.reverse()}function s(l,n){if(l)throw TypeError("Decoder error");return n||65533}function f(l){throw TypeError("The code point "+l+" could not be encoded.")}function d(){}function p(){}function h(l){return l=String(l).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(Q,l)?Q[l]:null}function y(l,n){return n?n[l]||null:null}function b(l,n){var u=n.indexOf(l);return-1===u?null:u}function v(l){if(!("encoding-indexes"in n))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return n["encoding-indexes"][l]}function g(l){if(l>39419&&l<189e3||l>1237575)return null;if(7457===l)return 59335;var n,u=0,e=0,t=v("gb18030-ranges");for(n=0;n>6*u)+t];u>0;){var o=n>>6*(u-1);r.push(128|63&o),u-=1}return r}}function P(l,n){var u=n.fatal;this.handler=function(n,e){if(e===G)return $;if(a(e))return e;var t=l[e-128];return null===t?s(u):t}}function A(l,n){n.fatal;this.handler=function(n,u){if(u===G)return $;if(V(u))return u;var e=b(u,l);return null===e&&f(u),e+128}}function x(l){var n=l.fatal,u=0,t=0,r=0;this.handler=function(l,o){if(o===G&&0===u&&0===t&&0===r)return $;o!==G||0===u&&0===t&&0===r||(u=0,t=0,r=0,s(n));var i;if(0!==r){i=null,e(o,48,57)&&(i=g(10*(126*(10*(u-129)+t-48)+r-129)+o-48));var c=[t,r,o];return u=0,t=0,r=0,null===i?(l.prepend(c),s(n)):i}if(0!==t)return e(o,129,254)?(r=o,null):(l.prepend([t,o]),u=0,t=0,s(n));if(0!==u){if(e(o,48,57))return t=o,null;var f=u,d=null;u=0;var p=o<127?64:65;return(e(o,64,126)||e(o,128,254))&&(d=190*(f-129)+(o-p)),i=null===d?null:y(d,v("gb18030")),null===i&&a(o)&&l.prepend(o),null===i?s(n):i}return a(o)?o:128===o?8364:e(o,129,254)?(u=o,null):s(n)}}function C(l,n){l.fatal;this.handler=function(l,u){if(u===G)return $;if(V(u))return u;if(58853===u)return f(u);if(n&&8364===u)return 128;var e=b(u,v("gb18030"));if(null!==e){var t=J(e/190)+129,r=e%190;return[t,r+(r<63?64:65)]}if(n)return f(u);e=_(u);var o=J(e/10/126/10);e-=10*o*126*10;var i=J(e/10/126);e-=10*i*126;var a=J(e/10);return[o+129,i+48,a+129,e-10*a+48]}}function T(l){var n=l.fatal,u=0;this.handler=function(l,t){if(t===G&&0!==u)return u=0,s(n);if(t===G&&0===u)return $;if(0!==u){var r=u,o=null;u=0;var i=t<127?64:98;switch((e(t,64,126)||e(t,161,254))&&(o=157*(r-129)+(t-i)),o){case 1133:return[202,772];case 1135:return[202,780];case 1164:return[234,772];case 1166:return[234,780]}var c=null===o?null:y(o,v("big5"));return null===c&&a(t)&&l.prepend(t),null===c?s(n):c}return a(t)?t:e(t,129,254)?(u=t,null):s(n)}}function S(l){l.fatal;this.handler=function(l,n){if(n===G)return $;if(V(n))return n;var u=w(n);if(null===u)return f(n);var e=J(u/157)+129;if(e<161)return f(n);var t=u%157;return[e,t+(t<63?64:98)]}}function R(l){var n=l.fatal,u=!1,t=0;this.handler=function(l,r){if(r===G&&0!==t)return t=0,s(n);if(r===G&&0===t)return $;if(142===t&&e(r,161,223))return t=0,65216+r;if(143===t&&e(r,161,254))return u=!0,t=r,null;if(0!==t){var o=t;t=0;var i=null;return e(o,161,254)&&e(r,161,254)&&(i=y(94*(o-161)+(r-161),v(u?"jis0212":"jis0208"))),u=!1,e(r,161,254)||l.prepend(r),null===i?s(n):i}return a(r)?r:142===r||143===r||e(r,161,254)?(t=r,null):s(n)}}function M(l){l.fatal;this.handler=function(l,n){if(n===G)return $;if(V(n))return n;if(165===n)return 92;if(8254===n)return 126;if(e(n,65377,65439))return[142,n-65377+161];8722===n&&(n=65293);var u=b(n,v("jis0208"));return null===u?f(n):[J(u/94)+161,u%94+161]}}function I(l){var n=l.fatal,u={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},t=u.ASCII,r=u.ASCII,o=0,i=!1;this.handler=function(l,a){switch(t){default:case u.ASCII:return 27===a?(t=u.EscapeStart,null):e(a,0,127)&&14!==a&&15!==a&&27!==a?(i=!1,a):a===G?$:(i=!1,s(n));case u.Roman:return 27===a?(t=u.EscapeStart,null):92===a?(i=!1,165):126===a?(i=!1,8254):e(a,0,127)&&14!==a&&15!==a&&27!==a&&92!==a&&126!==a?(i=!1,a):a===G?$:(i=!1,s(n));case u.Katakana:return 27===a?(t=u.EscapeStart,null):e(a,33,95)?(i=!1,65344+a):a===G?$:(i=!1,s(n));case u.LeadByte:return 27===a?(t=u.EscapeStart,null):e(a,33,126)?(i=!1,o=a,t=u.TrailByte,null):a===G?$:(i=!1,s(n));case u.TrailByte:if(27===a)return t=u.EscapeStart,s(n);if(e(a,33,126)){t=u.LeadByte;var c=94*(o-33)+a-33,f=y(c,v("jis0208"));return null===f?s(n):f}return a===G?(t=u.LeadByte,l.prepend(a),s(n)):(t=u.LeadByte,s(n));case u.EscapeStart:return 36===a||40===a?(o=a,t=u.Escape,null):(l.prepend(a),i=!1,t=r,s(n));case u.Escape:var d=o;o=0;var p=null;if(40===d&&66===a&&(p=u.ASCII),40===d&&74===a&&(p=u.Roman),40===d&&73===a&&(p=u.Katakana),36!==d||64!==a&&66!==a||(p=u.LeadByte),null!==p){t=t=p;var h=i;return i=!0,h?s(n):null}return l.prepend([d,a]),i=!1,t=r,s(n)}}}function B(l){var n=(l.fatal,{ASCII:0,Roman:1,jis0208:2}),u=n.ASCII;this.handler=function(l,e){if(e===G&&u!==n.ASCII)return l.prepend(e),u=n.ASCII,[27,40,66];if(e===G&&u===n.ASCII)return $;if(!(u!==n.ASCII&&u!==n.Roman||14!==e&&15!==e&&27!==e))return f(65533);if(u===n.ASCII&&V(e))return e;if(u===n.Roman&&(V(e)&&92!==e&&126!==e||165==e||8254==e)){if(V(e))return e;if(165===e)return 92;if(8254===e)return 126}if(V(e)&&u!==n.ASCII)return l.prepend(e),u=n.ASCII,[27,40,66];if((165===e||8254===e)&&u!==n.Roman)return l.prepend(e),u=n.Roman,[27,40,74];8722===e&&(e=65293);var t=b(e,v("jis0208"));return null===t?f(e):u!==n.jis0208?(l.prepend(e),u=n.jis0208,[27,36,66]):[J(t/94)+33,t%94+33]}}function U(l){var n=l.fatal,u=0;this.handler=function(l,t){if(t===G&&0!==u)return u=0,s(n);if(t===G&&0===u)return $;if(0!==u){var r=u,o=null;u=0;var i=t<127?64:65,c=r<160?129:193;if((e(t,64,126)||e(t,128,252))&&(o=188*(r-c)+t-i),e(o,8836,10715))return 48508+o;var f=null===o?null:y(o,v("jis0208"));return null===f&&a(t)&&l.prepend(t),null===f?s(n):f}return a(t)||128===t?t:e(t,161,223)?65216+t:e(t,129,159)||e(t,224,252)?(u=t,null):s(n)}}function q(l){l.fatal;this.handler=function(l,n){if(n===G)return $;if(V(n)||128===n)return n;if(165===n)return 92;if(8254===n)return 126;if(e(n,65377,65439))return n-65377+161;8722===n&&(n=65293);var u=m(n);if(null===u)return f(n);var t=J(u/188),r=t<31?129:193,o=u%188;return[t+r,o+(o<63?64:65)]}}function L(l){var n=l.fatal,u=0;this.handler=function(l,t){if(t===G&&0!==u)return u=0,s(n);if(t===G&&0===u)return $;if(0!==u){var r=u,o=null;u=0,e(t,65,254)&&(o=190*(r-129)+(t-65));var i=null===o?null:y(o,v("euc-kr"));return null===o&&a(t)&&l.prepend(t),null===i?s(n):i}return a(t)?t:e(t,129,254)?(u=t,null):s(n)}}function N(l){l.fatal;this.handler=function(l,n){if(n===G)return $;if(V(n))return n;var u=b(n,v("euc-kr"));return null===u?f(n):[J(u/190)+129,u%190+65]}}function F(l,n){var u=l>>8,e=255&l;return n?[u,e]:[e,u]}function D(l,n){var u=n.fatal,t=null,r=null;this.handler=function(n,o){if(o===G&&(null!==t||null!==r))return s(u);if(o===G&&null===t&&null===r)return $;if(null===t)return t=o,null;var i;if(i=l?(t<<8)+o:(o<<8)+t,t=null,null!==r){var a=r;return r=null,e(i,56320,57343)?65536+1024*(a-55296)+(i-56320):(n.prepend(F(i,l)),s(u))}return e(i,55296,56319)?(r=i,null):e(i,56320,57343)?s(u):i}}function z(l,n){n.fatal;this.handler=function(n,u){if(u===G)return $;if(e(u,0,65535))return F(u,l);var t=F(55296+(u-65536>>10),l),r=F(56320+(u-65536&1023),l);return t.concat(r)}}function H(l){l.fatal;this.handler=function(l,n){return n===G?$:a(n)?n:63360+n-128}}function K(l){l.fatal;this.handler=function(l,n){return n===G?$:V(n)?n:e(n,63360,63487)?n-63360+128:f(n)}}void 0!==l&&l.exports&&!n["encoding-indexes"]&&(n["encoding-indexes"]=u(53)["encoding-indexes"]);var J=Math.floor,V=a,G=-1;c.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():G},prepend:function(l){if(Array.isArray(l))for(var n=l;n.length;)this.tokens.push(n.pop());else this.tokens.push(l)},push:function(l){if(Array.isArray(l))for(var n=l;n.length;)this.tokens.unshift(n.shift());else this.tokens.unshift(l)}};var $=-1;d.prototype={handler:function(l,n){}},p.prototype={handler:function(l,n){}};var W=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"UTF-8"}],heading:"The Encoding"},{encodings:[{labels:["866","cp866","csibm866","ibm866"],name:"IBM866"},{labels:["csisolatin2","iso-8859-2","iso-ir-101","iso8859-2","iso88592","iso_8859-2","iso_8859-2:1987","l2","latin2"],name:"ISO-8859-2"},{labels:["csisolatin3","iso-8859-3","iso-ir-109","iso8859-3","iso88593","iso_8859-3","iso_8859-3:1988","l3","latin3"],name:"ISO-8859-3"},{labels:["csisolatin4","iso-8859-4","iso-ir-110","iso8859-4","iso88594","iso_8859-4","iso_8859-4:1988","l4","latin4"],name:"ISO-8859-4"},{labels:["csisolatincyrillic","cyrillic","iso-8859-5","iso-ir-144","iso8859-5","iso88595","iso_8859-5","iso_8859-5:1988"],name:"ISO-8859-5"},{labels:["arabic","asmo-708","csiso88596e","csiso88596i","csisolatinarabic","ecma-114","iso-8859-6","iso-8859-6-e","iso-8859-6-i","iso-ir-127","iso8859-6","iso88596","iso_8859-6","iso_8859-6:1987"],name:"ISO-8859-6"},{labels:["csisolatingreek","ecma-118","elot_928","greek","greek8","iso-8859-7","iso-ir-126","iso8859-7","iso88597","iso_8859-7","iso_8859-7:1987","sun_eu_greek"],name:"ISO-8859-7"},{labels:["csiso88598e","csisolatinhebrew","hebrew","iso-8859-8","iso-8859-8-e","iso-ir-138","iso8859-8","iso88598","iso_8859-8","iso_8859-8:1988","visual"],name:"ISO-8859-8"},{labels:["csiso88598i","iso-8859-8-i","logical"],name:"ISO-8859-8-I"},{labels:["csisolatin6","iso-8859-10","iso-ir-157","iso8859-10","iso885910","l6","latin6"],name:"ISO-8859-10"},{labels:["iso-8859-13","iso8859-13","iso885913"],name:"ISO-8859-13"},{labels:["iso-8859-14","iso8859-14","iso885914"],name:"ISO-8859-14"},{labels:["csisolatin9","iso-8859-15","iso8859-15","iso885915","iso_8859-15","l9"],name:"ISO-8859-15"},{labels:["iso-8859-16"],name:"ISO-8859-16"},{labels:["cskoi8r","koi","koi8","koi8-r","koi8_r"],name:"KOI8-R"},{labels:["koi8-ru","koi8-u"],name:"KOI8-U"},{labels:["csmacintosh","mac","macintosh","x-mac-roman"],name:"macintosh"},{labels:["dos-874","iso-8859-11","iso8859-11","iso885911","tis-620","windows-874"],name:"windows-874"},{labels:["cp1250","windows-1250","x-cp1250"],name:"windows-1250"},{labels:["cp1251","windows-1251","x-cp1251"],name:"windows-1251"},{labels:["ansi_x3.4-1968","ascii","cp1252","cp819","csisolatin1","ibm819","iso-8859-1","iso-ir-100","iso8859-1","iso88591","iso_8859-1","iso_8859-1:1987","l1","latin1","us-ascii","windows-1252","x-cp1252"],name:"windows-1252"},{labels:["cp1253","windows-1253","x-cp1253"],name:"windows-1253"},{labels:["cp1254","csisolatin5","iso-8859-9","iso-ir-148","iso8859-9","iso88599","iso_8859-9","iso_8859-9:1989","l5","latin5","windows-1254","x-cp1254"],name:"windows-1254"},{labels:["cp1255","windows-1255","x-cp1255"],name:"windows-1255"},{labels:["cp1256","windows-1256","x-cp1256"],name:"windows-1256"},{labels:["cp1257","windows-1257","x-cp1257"],name:"windows-1257"},{labels:["cp1258","windows-1258","x-cp1258"],name:"windows-1258"},{labels:["x-mac-cyrillic","x-mac-ukrainian"],name:"x-mac-cyrillic"}],heading:"Legacy single-byte encodings"},{encodings:[{labels:["chinese","csgb2312","csiso58gb231280","gb2312","gb_2312","gb_2312-80","gbk","iso-ir-58","x-gbk"],name:"GBK"},{labels:["gb18030"],name:"gb18030"}],heading:"Legacy multi-byte Chinese (simplified) encodings"},{encodings:[{labels:["big5","big5-hkscs","cn-big5","csbig5","x-x-big5"],name:"Big5"}],heading:"Legacy multi-byte Chinese (traditional) encodings"},{encodings:[{labels:["cseucpkdfmtjapanese","euc-jp","x-euc-jp"],name:"EUC-JP"},{labels:["csiso2022jp","iso-2022-jp"],name:"ISO-2022-JP"},{labels:["csshiftjis","ms932","ms_kanji","shift-jis","shift_jis","sjis","windows-31j","x-sjis"],name:"Shift_JIS"}],heading:"Legacy multi-byte Japanese encodings"},{encodings:[{labels:["cseuckr","csksc56011987","euc-kr","iso-ir-149","korean","ks_c_5601-1987","ks_c_5601-1989","ksc5601","ksc_5601","windows-949"],name:"EUC-KR"}],heading:"Legacy multi-byte Korean encodings"},{encodings:[{labels:["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr"],name:"replacement"},{labels:["utf-16be"],name:"UTF-16BE"},{labels:["utf-16","utf-16le"],name:"UTF-16LE"},{labels:["x-user-defined"],name:"x-user-defined"}],heading:"Legacy miscellaneous encodings"}],Q={};W.forEach(function(l){l.encodings.forEach(function(l){l.labels.forEach(function(n){Q[n]=l})})});var X,Y,Z={},ll={},nl="utf-8";Object.defineProperty&&(Object.defineProperty(O.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(O.prototype,"fatal",{get:function(){return"fatal"===this._error_mode}}),Object.defineProperty(O.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}})),O.prototype.decode=function(l,n){function u(l){return!t(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)||this._ignoreBOM||this._BOMseen||(l.length>0&&65279===l[0]?(this._BOMseen=!0,l.shift()):l.length>0&&(this._BOMseen=!0)),i(l)}var e;e="object"==typeof l&&l instanceof ArrayBuffer?new Uint8Array(l):"object"==typeof l&&"buffer"in l&&l.buffer instanceof ArrayBuffer?new Uint8Array(l.buffer,l.byteOffset,l.byteLength):new Uint8Array(0),n=r(n),this._do_not_flush||(this._decoder=ll[this._encoding.name]({fatal:"fatal"===this._error_mode}),this._BOMseen=!1),this._do_not_flush=Boolean(n.stream);for(var o,a=new c(e),s=[];;){var f=a.read();if(f===G)break;if((o=this._decoder.handler(a,f))===$)break;null!==o&&(Array.isArray(o)?s.push.apply(s,o):s.push(o))}if(!this._do_not_flush){do{if((o=this._decoder.handler(a,a.read()))===$)break;null!==o&&(Array.isArray(o)?s.push.apply(s,o):s.push(o))}while(!a.endOfStream());this._decoder=null}return u.call(this,s)},Object.defineProperty&&Object.defineProperty(j.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),j.prototype.encode=function(l,n){l=void 0===l?"":String(l),n=r(n),this._do_not_flush||(this._encoder=Z[this._encoding.name]({fatal:"fatal"===this._fatal})),this._do_not_flush=Boolean(n.stream);for(var u,e=new c(o(l)),t=[];;){var i=e.read();if(i===G)break;if((u=this._encoder.handler(e,i))===$)break;Array.isArray(u)?t.push.apply(t,u):t.push(u)}if(!this._do_not_flush){for(;;){if((u=this._encoder.handler(e,e.read()))===$)break;Array.isArray(u)?t.push.apply(t,u):t.push(u)}this._encoder=null}return new Uint8Array(t)},Z["UTF-8"]=function(l){return new E(l)},ll["UTF-8"]=function(l){return new k(l)},function(){"encoding-indexes"in n&&W.forEach(function(l){"Legacy single-byte encodings"===l.heading&&l.encodings.forEach(function(l){var n=l.name,u=v(n.toLowerCase());ll[n]=function(l){return new P(u,l)},Z[n]=function(l){return new A(u,l)}})})}(),ll.GBK=function(l){return new x(l)},Z.GBK=function(l){return new C(l,!0)},Z.gb18030=function(l){return new C(l)},ll.gb18030=function(l){return new x(l)},Z.Big5=function(l){return new S(l)},ll.Big5=function(l){return new T(l)},Z["EUC-JP"]=function(l){return new M(l)},ll["EUC-JP"]=function(l){return new R(l)},Z["ISO-2022-JP"]=function(l){return new B(l)},ll["ISO-2022-JP"]=function(l){return new I(l)},Z.Shift_JIS=function(l){return new q(l)},ll.Shift_JIS=function(l){return new U(l)},Z["EUC-KR"]=function(l){return new N(l)},ll["EUC-KR"]=function(l){return new L(l)},Z["UTF-16BE"]=function(l){return new z(!0,l)},ll["UTF-16BE"]=function(l){return new D(!0,l)},Z["UTF-16LE"]=function(l){return new z(!1,l)},ll["UTF-16LE"]=function(l){return new D(!1,l)},Z["x-user-defined"]=function(l){return new K(l)},ll["x-user-defined"]=function(l){return new H(l)},n.TextEncoder||(n.TextEncoder=j),n.TextDecoder||(n.TextDecoder=O),void 0!==l&&l.exports&&(l.exports={TextEncoder:n.TextEncoder,TextDecoder:n.TextDecoder,EncodingIndexes:n["encoding-indexes"]})}(this||{})},function(l,n){var u;u=function(){return this}();try{u=u||Function("return this")()||(0,eval)("this")}catch(l){"object"==typeof window&&(u=window)}l.exports=u},function(l,n){l.exports=function(l){return l.webpackPolyfill||(l.deprecate=function(){},l.paths=[],l.children||(l.children=[]),Object.defineProperty(l,"loaded",{enumerable:!0,get:function(){return l.l}}),Object.defineProperty(l,"id",{enumerable:!0,get:function(){return l.i}}),l.webpackPolyfill=1),l}}]);
\ No newline at end of file
+module.exports=function(l){function n(e){if(u[e])return u[e].exports;var t=u[e]={i:e,l:!1,exports:{}};return l[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}var u={};return n.m=l,n.c=u,n.i=function(l){return l},n.d=function(l,u,e){n.o(l,u)||Object.defineProperty(l,u,{configurable:!1,enumerable:!0,get:e})},n.n=function(l){var u=l&&l.__esModule?function(){return l.default}:function(){return l};return n.d(u,"a",u),u},n.o=function(l,n){return Object.prototype.hasOwnProperty.call(l,n)},n.p="",n(n.s=13)}([function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.BaseError=void 0;var o=u(54),i=function(l){return l&&l.__esModule?l:{default:l}}(o);n.BaseError=function(l){function n(){return e(this,n),t(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return r(n,l),n}(i.default)},function(l,n,u){(function(l,u){function e(l,n,u){switch(u.length){case 0:return l.call(n);case 1:return l.call(n,u[0]);case 2:return l.call(n,u[0],u[1]);case 3:return l.call(n,u[0],u[1],u[2])}return l.apply(n,u)}function t(l,n){for(var u=-1,e=Array(l);++u-1}function _(l,n){var u=this.__data__,e=I(u,l);return e<0?(++this.size,u.push([l,n])):u[e][1]=n,this}function g(l){var n=-1,u=null==l?0:l.length;for(this.clear();++n-1&&l%1==0&&l-1&&l%1==0&&l<=El}function hl(l){var n=typeof l;return null!=l&&("object"==n||"function"==n)}function dl(l){return null!=l&&"object"==typeof l}function vl(l){if(!dl(l)||B(l)!=Rl)return!1;var n=an(l);if(null===n)return!0;var u=Ql.call(n,"constructor")&&n.constructor;return"function"==typeof u&&u instanceof u&&Yl.call(u)==nn}function yl(l){return J(l,_l(l))}function _l(l){return cl(l)?S(l,!0):q(l)}function gl(l){return function(){return l}}function bl(l){return l}function ml(){return!1}var wl=200,jl="__lodash_hash_undefined__",Ol=800,kl=16,El=9007199254740991,xl="[object Arguments]",Pl="[object AsyncFunction]",Al="[object Function]",Cl="[object GeneratorFunction]",Sl="[object Null]",Rl="[object Object]",Tl="[object Proxy]",Il="[object Undefined]",Ml=/[\\^$.*+?()[\]{}|]/g,Bl=/^\[object .+?Constructor\]$/,Ul=/^(?:0|[1-9]\d*)$/,zl={};zl["[object Float32Array]"]=zl["[object Float64Array]"]=zl["[object Int8Array]"]=zl["[object Int16Array]"]=zl["[object Int32Array]"]=zl["[object Uint8Array]"]=zl["[object Uint8ClampedArray]"]=zl["[object Uint16Array]"]=zl["[object Uint32Array]"]=!0,zl[xl]=zl["[object Array]"]=zl["[object ArrayBuffer]"]=zl["[object Boolean]"]=zl["[object DataView]"]=zl["[object Date]"]=zl["[object Error]"]=zl[Al]=zl["[object Map]"]=zl["[object Number]"]=zl[Rl]=zl["[object RegExp]"]=zl["[object Set]"]=zl["[object String]"]=zl["[object WeakMap]"]=!1;var Ll="object"==typeof l&&l&&l.Object===Object&&l,ql="object"==typeof self&&self&&self.Object===Object&&self,Nl=Ll||ql||Function("return this")(),Fl="object"==typeof n&&n&&!n.nodeType&&n,Dl=Fl&&"object"==typeof u&&u&&!u.nodeType&&u,Wl=Dl&&Dl.exports===Fl,$l=Wl&&Ll.process,Kl=function(){try{var l=Dl&&Dl.require&&Dl.require("util").types;return l||$l&&$l.binding&&$l.binding("util")}catch(l){}}(),Hl=Kl&&Kl.isTypedArray,Jl=Array.prototype,Vl=Function.prototype,Gl=Object.prototype,Zl=Nl["__core-js_shared__"],Yl=Vl.toString,Ql=Gl.hasOwnProperty,Xl=function(){var l=/[^.]+$/.exec(Zl&&Zl.keys&&Zl.keys.IE_PROTO||"");return l?"Symbol(src)_1."+l:""}(),ln=Gl.toString,nn=Yl.call(Object),un=RegExp("^"+Yl.call(Ql).replace(Ml,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),en=Wl?Nl.Buffer:void 0,tn=Nl.Symbol,rn=Nl.Uint8Array,on=en?en.allocUnsafe:void 0,an=function(l,n){return function(u){return l(n(u))}}(Object.getPrototypeOf,Object),cn=Object.create,fn=Gl.propertyIsEnumerable,sn=Jl.splice,pn=tn?tn.toStringTag:void 0,hn=function(){try{var l=G(Object,"defineProperty");return l({},"",{}),l}catch(l){}}(),dn=en?en.isBuffer:void 0,vn=Math.max,yn=Date.now,_n=G(Nl,"Map"),gn=G(Object,"create"),bn=function(){function l(){}return function(n){if(!hl(n))return{};if(cn)return cn(n);l.prototype=n;var u=new l;return l.prototype=void 0,u}}();o.prototype.clear=i,o.prototype.delete=a,o.prototype.get=c,o.prototype.has=f,o.prototype.set=s,p.prototype.clear=h,p.prototype.delete=d,p.prototype.get=v,p.prototype.has=y,p.prototype.set=_,g.prototype.clear=b,g.prototype.delete=m,g.prototype.get=w,g.prototype.has=j,g.prototype.set=O,k.prototype.clear=E,k.prototype.delete=x,k.prototype.get=P,k.prototype.has=A,k.prototype.set=C;var mn=function(l){return function(n,u,e){for(var t=-1,r=Object(n),o=e(n),i=o.length;i--;){var a=o[l?i:++t];if(!1===u(r[a],a,r))break}return n}}(),wn=hn?function(l,n){return hn(l,"toString",{configurable:!0,enumerable:!1,value:gl(n),writable:!0})}:bl,jn=function(l){var n=0,u=0;return function(){var e=yn(),t=kl-(e-u);if(u=e,t>0){if(++n>=Ol)return arguments[0]}else n=0;return l.apply(void 0,arguments)}}(wn),On=U(function(){return arguments}())?U:function(l){return dl(l)&&Ql.call(l,"callee")&&!fn.call(l,"callee")},kn=Array.isArray,En=dn||ml,xn=Hl?function(l){return function(n){return l(n)}}(Hl):L,Pn=function(l){return D(function(n,u){var e=-1,t=u.length,r=t>1?u[t-1]:void 0,o=t>2?u[2]:void 0;for(r=l.length>3&&"function"==typeof r?(t--,r):void 0,o&&X(u[0],u[1],o)&&(r=t<3?void 0:r,t=1),n=Object(n);++e-1}function p(l,n,u){for(var e=-1,t=null==l?0:l.length;++e-1;);return u}function z(l,n){for(var u=l.length;u--&&j(n,l[u],0)>-1;);return u}function L(l,n){for(var u=l.length,e=0;u--;)l[u]===n&&++e;return e}function q(l){return"\\"+Eu[l]}function N(l,n){return null==l?ul:l[n]}function F(l){return yu.test(l)}function D(l){return _u.test(l)}function W(l){for(var n,u=[];!(n=l.next()).done;)u.push(n.value);return u}function $(l){var n=-1,u=Array(l.size);return l.forEach(function(l,e){u[++n]=[e,l]}),u}function K(l,n){return function(u){return l(n(u))}}function H(l,n){for(var u=-1,e=l.length,t=0,r=[];++u>>1,zl=[["ary",wl],["bind",dl],["bindKey",vl],["curry",_l],["curryRight",gl],["flip",Ol],["partial",bl],["partialRight",ml],["rearg",jl]],Ll="[object Arguments]",ql="[object Array]",Nl="[object AsyncFunction]",Fl="[object Boolean]",Dl="[object Date]",Wl="[object DOMException]",$l="[object Error]",Kl="[object Function]",Hl="[object GeneratorFunction]",Jl="[object Map]",Vl="[object Number]",Gl="[object Null]",Zl="[object Object]",Yl="[object Proxy]",Ql="[object RegExp]",Xl="[object Set]",ln="[object String]",nn="[object Symbol]",un="[object Undefined]",en="[object WeakMap]",tn="[object WeakSet]",rn="[object ArrayBuffer]",on="[object DataView]",an="[object Float32Array]",cn="[object Float64Array]",fn="[object Int8Array]",sn="[object Int16Array]",pn="[object Int32Array]",hn="[object Uint8Array]",dn="[object Uint8ClampedArray]",vn="[object Uint16Array]",yn="[object Uint32Array]",_n=/\b__p \+= '';/g,gn=/\b(__p \+=) '' \+/g,bn=/(__e\(.*?\)|\b__t\)) \+\n'';/g,mn=/&(?:amp|lt|gt|quot|#39);/g,wn=/[&<>"']/g,jn=RegExp(mn.source),On=RegExp(wn.source),kn=/<%-([\s\S]+?)%>/g,En=/<%([\s\S]+?)%>/g,xn=/<%=([\s\S]+?)%>/g,Pn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,An=/^\w*$/,Cn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Sn=/[\\^$.*+?()[\]{}|]/g,Rn=RegExp(Sn.source),Tn=/^\s+|\s+$/g,In=/^\s+/,Mn=/\s+$/,Bn=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Un=/\{\n\/\* \[wrapped with (.+)\] \*/,zn=/,? & /,Ln=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,qn=/\\(\\)?/g,Nn=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Fn=/\w*$/,Dn=/^[-+]0x[0-9a-f]+$/i,Wn=/^0b[01]+$/i,$n=/^\[object .+?Constructor\]$/,Kn=/^0o[0-7]+$/i,Hn=/^(?:0|[1-9]\d*)$/,Jn=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Vn=/($^)/,Gn=/['\n\r\u2028\u2029\\]/g,Zn="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Yn="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Qn="["+Yn+"]",Xn="["+Zn+"]",lu="[a-z\\xdf-\\xf6\\xf8-\\xff]",nu="[^\\ud800-\\udfff"+Yn+"\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",uu="\\ud83c[\\udffb-\\udfff]",eu="(?:\\ud83c[\\udde6-\\uddff]){2}",tu="[\\ud800-\\udbff][\\udc00-\\udfff]",ru="[A-Z\\xc0-\\xd6\\xd8-\\xde]",ou="(?:"+lu+"|"+nu+")",iu="(?:[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff]|\\ud83c[\\udffb-\\udfff])?",au="(?:\\u200d(?:"+["[^\\ud800-\\udfff]",eu,tu].join("|")+")[\\ufe0e\\ufe0f]?"+iu+")*",cu="[\\ufe0e\\ufe0f]?"+iu+au,fu="(?:"+["[\\u2700-\\u27bf]",eu,tu].join("|")+")"+cu,su="(?:"+["[^\\ud800-\\udfff]"+Xn+"?",Xn,eu,tu,"[\\ud800-\\udfff]"].join("|")+")",pu=RegExp("['’]","g"),hu=RegExp(Xn,"g"),du=RegExp(uu+"(?="+uu+")|"+su+cu,"g"),vu=RegExp([ru+"?"+lu+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[Qn,ru,"$"].join("|")+")","(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[Qn,ru+ou,"$"].join("|")+")",ru+"?"+ou+"+(?:['’](?:d|ll|m|re|s|t|ve))?",ru+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",fu].join("|"),"g"),yu=RegExp("[\\u200d\\ud800-\\udfff"+Zn+"\\ufe0e\\ufe0f]"),_u=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,gu=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],bu=-1,mu={};mu[an]=mu[cn]=mu[fn]=mu[sn]=mu[pn]=mu[hn]=mu[dn]=mu[vn]=mu[yn]=!0,mu[Ll]=mu[ql]=mu[rn]=mu[Fl]=mu[on]=mu[Dl]=mu[$l]=mu[Kl]=mu[Jl]=mu[Vl]=mu[Zl]=mu[Ql]=mu[Xl]=mu[ln]=mu[en]=!1;var wu={};wu[Ll]=wu[ql]=wu[rn]=wu[on]=wu[Fl]=wu[Dl]=wu[an]=wu[cn]=wu[fn]=wu[sn]=wu[pn]=wu[Jl]=wu[Vl]=wu[Zl]=wu[Ql]=wu[Xl]=wu[ln]=wu[nn]=wu[hn]=wu[dn]=wu[vn]=wu[yn]=!0,wu[$l]=wu[Kl]=wu[en]=!1;var ju={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},Ou={"&":"&","<":"<",">":">",'"':""","'":"'"},ku={"&":"&","<":"<",">":">",""":'"',"'":"'"},Eu={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},xu=parseFloat,Pu=parseInt,Au="object"==typeof l&&l&&l.Object===Object&&l,Cu="object"==typeof self&&self&&self.Object===Object&&self,Su=Au||Cu||Function("return this")(),Ru="object"==typeof n&&n&&!n.nodeType&&n,Tu=Ru&&"object"==typeof e&&e&&!e.nodeType&&e,Iu=Tu&&Tu.exports===Ru,Mu=Iu&&Au.process,Bu=function(){try{var l=Tu&&Tu.require&&Tu.require("util").types;return l||Mu&&Mu.binding&&Mu.binding("util")}catch(l){}}(),Uu=Bu&&Bu.isArrayBuffer,zu=Bu&&Bu.isDate,Lu=Bu&&Bu.isMap,qu=Bu&&Bu.isRegExp,Nu=Bu&&Bu.isSet,Fu=Bu&&Bu.isTypedArray,Du=x("length"),Wu=P(ju),$u=P(Ou),Ku=P(ku),Hu=function l(n){function u(l){if(na(l)&&!hp(l)&&!(l instanceof g)){if(l instanceof t)return l;if(hf.call(l,"__wrapped__"))return Yr(l)}return new t(l)}function e(){}function t(l,n){this.__wrapped__=l,this.__actions__=[],this.__chain__=!!n,this.__index__=0,this.__values__=ul}function g(l){this.__wrapped__=l,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=Ml,this.__views__=[]}function P(){var l=new g(this.__wrapped__);return l.__actions__=Tt(this.__actions__),l.__dir__=this.__dir__,l.__filtered__=this.__filtered__,l.__iteratees__=Tt(this.__iteratees__),l.__takeCount__=this.__takeCount__,l.__views__=Tt(this.__views__),l}function G(){if(this.__filtered__){var l=new g(this);l.__dir__=-1,l.__filtered__=!0}else l=this.clone(),l.__dir__*=-1;return l}function X(){var l=this.__wrapped__.value(),n=this.__dir__,u=hp(l),e=n<0,t=u?l.length:0,r=wr(0,t,this.__views__),o=r.start,i=r.end,a=i-o,c=e?i:o-1,f=this.__iteratees__,s=f.length,p=0,h=Wf(a,this.__takeCount__);if(!u||!e&&t==a&&h==a)return vt(l,this.__actions__);var d=[];l:for(;a--&&p-1}function ru(l,n){var u=this.__data__,e=Ju(u,l);return e<0?(++this.size,u.push([l,n])):u[e][1]=n,this}function ou(l){var n=-1,u=null==l?0:l.length;for(this.clear();++n=n?l:n)),l}function le(l,n,u,e,t,r){var o,a=n&cl,c=n&fl,f=n&sl;if(u&&(o=t?u(l,e,t,r):u(l)),o!==ul)return o;if(!la(l))return l;var s=hp(l);if(s){if(o=kr(l),!a)return Tt(l,o)}else{var p=Os(l),h=p==Kl||p==Hl;if(vp(l))return jt(l,a);if(p==Zl||p==Ll||h&&!t){if(o=c||h?{}:Er(l),!a)return c?Bt(l,Zu(o,l)):Mt(l,Gu(o,l))}else{if(!wu[p])return t?l:{};o=xr(l,p,a)}}r||(r=new _u);var d=r.get(l);if(d)return d;r.set(l,o),bp(l)?l.forEach(function(e){o.add(le(e,n,u,e,l,r))}):_p(l)&&l.forEach(function(e,t){o.set(t,le(e,n,u,t,l,r))});var v=f?c?hr:pr:c?za:Ua,y=s?ul:v(l);return i(y||l,function(e,t){y&&(t=e,e=l[t]),Du(o,t,le(e,n,u,t,l,r))}),o}function ne(l){var n=Ua(l);return function(u){return ue(u,l,n)}}function ue(l,n,u){var e=u.length;if(null==l)return!e;for(l=ef(l);e--;){var t=u[e],r=n[t],o=l[t];if(o===ul&&!(t in l)||!r(o))return!1}return!0}function ee(l,n,u){if("function"!=typeof l)throw new of(rl);return xs(function(){l.apply(ul,u)},n)}function te(l,n,u,e){var t=-1,r=s,o=!0,i=l.length,a=[],c=n.length;if(!i)return a;u&&(n=h(n,I(u))),e?(r=p,o=!1):n.length>=el&&(r=B,o=!1,n=new du(n));l:for(;++tt?0:t+u),e=e===ul||e>t?t:ga(e),e<0&&(e+=t),e=u>e?0:ba(e);u0&&u(i)?n>1?ce(i,n-1,u,e,t):d(t,i):e||(t[t.length]=i)}return t}function fe(l,n){return l&&hs(l,n,Ua)}function se(l,n){return l&&ds(l,n,Ua)}function pe(l,n){return f(n,function(n){return Yi(l[n])})}function he(l,n){n=mt(n,l);for(var u=0,e=n.length;null!=l&&un}function _e(l,n){return null!=l&&hf.call(l,n)}function ge(l,n){return null!=l&&n in ef(l)}function be(l,n,u){return l>=Wf(n,u)&&l=120&&f.length>=120)?new du(o&&f):ul}f=l[0];var d=-1,v=i[0];l:for(;++d-1;)i!==l&&Pf.call(i,a,1),Pf.call(l,a,1);return l}function Ge(l,n){for(var u=l?n.length:0,e=u-1;u--;){var t=n[u];if(u==e||t!==r){var r=t;Cr(t)?Pf.call(l,t,1):pt(l,t)}}return l}function Ze(l,n){return l+Uf(Hf()*(n-l+1))}function Ye(l,n,u,e){for(var t=-1,r=Df(Bf((n-l)/(u||1)),0),o=Qc(r);r--;)o[e?r:++t]=l,l+=u;return o}function Qe(l,n){var u="";if(!l||n<1||n>Rl)return u;do{n%2&&(u+=l),(n=Uf(n/2))&&(l+=l)}while(n);return u}function Xe(l,n){return Ps(Fr(l,n,xc),l+"")}function lt(l){return Ru(Ga(l))}function nt(l,n){var u=Ga(l);return Jr(u,Xu(n,0,u.length))}function ut(l,n,u,e){if(!la(l))return l;n=mt(n,l);for(var t=-1,r=n.length,o=r-1,i=l;null!=i&&++tt?0:t+n),u=u>t?t:u,u<0&&(u+=t),t=n>u?0:u-n>>>0,n>>>=0;for(var r=Qc(t);++e>>1,o=l[r];null!==o&&!pa(o)&&(u?o<=n:o=el){var c=n?null:bs(l);if(c)return J(c);o=!1,t=B,a=new du}else a=n?[]:i;l:for(;++e=e?l:tt(l,n,u)}function jt(l,n){if(n)return l.slice();var u=l.length,e=Of?Of(u):new l.constructor(u);return l.copy(e),e}function Ot(l){var n=new l.constructor(l.byteLength);return new jf(n).set(new jf(l)),n}function kt(l,n){var u=n?Ot(l.buffer):l.buffer;return new l.constructor(u,l.byteOffset,l.byteLength)}function Et(l){var n=new l.constructor(l.source,Fn.exec(l));return n.lastIndex=l.lastIndex,n}function xt(l){return as?ef(as.call(l)):{}}function Pt(l,n){var u=n?Ot(l.buffer):l.buffer;return new l.constructor(u,l.byteOffset,l.length)}function At(l,n){if(l!==n){var u=l!==ul,e=null===l,t=l===l,r=pa(l),o=n!==ul,i=null===n,a=n===n,c=pa(n);if(!i&&!c&&!r&&l>n||r&&o&&a&&!i&&!c||e&&o&&a||!u&&a||!t)return 1;if(!e&&!r&&!c&&l=i)return a;return a*("desc"==u[e]?-1:1)}}return l.index-n.index}function St(l,n,u,e){for(var t=-1,r=l.length,o=u.length,i=-1,a=n.length,c=Df(r-o,0),f=Qc(a+c),s=!e;++i1?u[t-1]:ul,o=t>2?u[2]:ul;for(r=l.length>3&&"function"==typeof r?(t--,r):ul,o&&Sr(u[0],u[1],o)&&(r=t<3?ul:r,t=1),n=ef(n);++e-1?t[r?n[o]:o]:ul}}function Ht(l){return sr(function(n){var u=n.length,e=u,r=t.prototype.thru;for(l&&n.reverse();e--;){var o=n[e];if("function"!=typeof o)throw new of(rl);if(r&&!i&&"wrapper"==dr(o))var i=new t([],!0)}for(e=i?e:u;++e1&&g.reverse(),s&&a<_&&(g.length=a),this&&this!==Su&&this instanceof f&&(k=y||Wt(k)),k.apply(O,g)}var s=n&wl,p=n&dl,h=n&vl,d=n&(_l|gl),v=n&Ol,y=h?ul:Wt(l);return f}function Vt(l,n){return function(u,e){return we(u,l,n(e),{})}}function Gt(l,n){return function(u,e){var t;if(u===ul&&e===ul)return n;if(u!==ul&&(t=u),e!==ul){if(t===ul)return e;"string"==typeof u||"string"==typeof e?(u=ft(u),e=ft(e)):(u=ct(u),e=ct(e)),t=l(u,e)}return t}}function Zt(l){return sr(function(n){return n=h(n,I(yr())),Xe(function(u){var e=this;return l(n,function(l){return r(l,e,u)})})})}function Yt(l,n){n=n===ul?" ":ft(n);var u=n.length;if(u<2)return u?Qe(n,l):n;var e=Qe(n,Bf(l/Y(n)));return F(n)?wt(Q(e),0,l).join(""):e.slice(0,l)}function Qt(l,n,u,e){function t(){for(var n=-1,a=arguments.length,c=-1,f=e.length,s=Qc(f+a),p=this&&this!==Su&&this instanceof t?i:l;++ci))return!1;var c=r.get(l);if(c&&r.get(n))return c==n;var f=-1,s=!0,p=u&hl?new du:ul;for(r.set(l,n),r.set(n,l);++f1?"& ":"")+n[e],n=n.join(u>2?", ":" "),l.replace(Bn,"{\n/* [wrapped with "+n+"] */\n")}function Ar(l){return hp(l)||pp(l)||!!(Af&&l&&l[Af])}function Cr(l,n){var u=typeof l;return!!(n=null==n?Rl:n)&&("number"==u||"symbol"!=u&&Hn.test(l))&&l>-1&&l%1==0&&l0){if(++n>=xl)return arguments[0]}else n=0;return l.apply(ul,arguments)}}function Jr(l,n){var u=-1,e=l.length,t=e-1;for(n=n===ul?e:n;++u=this.__values__.length;return{done:l,value:l?ul:this.__values__[this.__index__++]}}function Qo(){return this}function Xo(l){for(var n,u=this;u instanceof e;){var t=Yr(u);t.__index__=0,t.__values__=ul,n?r.__wrapped__=t:n=t;var r=t;u=u.__wrapped__}return r.__wrapped__=l,n}function li(){var l=this.__wrapped__;if(l instanceof g){var n=l;return this.__actions__.length&&(n=new g(this)),n=n.reverse(),n.__actions__.push({func:Vo,args:[ko],thisArg:ul}),new t(n,this.__chain__)}return this.thru(ko)}function ni(){return vt(this.__wrapped__,this.__actions__)}function ui(l,n,u){var e=hp(l)?c:re;return u&&Sr(l,n,u)&&(n=ul),e(l,yr(n,3))}function ei(l,n){return(hp(l)?f:ae)(l,yr(n,3))}function ti(l,n){return ce(fi(l,n),1)}function ri(l,n){return ce(fi(l,n),Sl)}function oi(l,n,u){return u=u===ul?1:ga(u),ce(fi(l,n),u)}function ii(l,n){return(hp(l)?i:ss)(l,yr(n,3))}function ai(l,n){return(hp(l)?a:ps)(l,yr(n,3))}function ci(l,n,u,e){l=Di(l)?l:Ga(l),u=u&&!e?ga(u):0;var t=l.length;return u<0&&(u=Df(t+u,0)),sa(l)?u<=t&&l.indexOf(n,u)>-1:!!t&&j(l,n,u)>-1}function fi(l,n){return(hp(l)?h:Le)(l,yr(n,3))}function si(l,n,u,e){return null==l?[]:(hp(n)||(n=null==n?[]:[n]),u=e?ul:u,hp(u)||(u=null==u?[]:[u]),$e(l,n,u))}function pi(l,n,u){var e=hp(l)?v:A,t=arguments.length<3;return e(l,yr(n,4),u,t,ss)}function hi(l,n,u){var e=hp(l)?y:A,t=arguments.length<3;return e(l,yr(n,4),u,t,ps)}function di(l,n){return(hp(l)?f:ae)(l,Ai(yr(n,3)))}function vi(l){return(hp(l)?Ru:lt)(l)}function yi(l,n,u){return n=(u?Sr(l,n,u):n===ul)?1:ga(n),(hp(l)?Tu:nt)(l,n)}function _i(l){return(hp(l)?Mu:et)(l)}function gi(l){if(null==l)return 0;if(Di(l))return sa(l)?Y(l):l.length;var n=Os(l);return n==Jl||n==Xl?l.size:Be(l).length}function bi(l,n,u){var e=hp(l)?_:rt;return u&&Sr(l,n,u)&&(n=ul),e(l,yr(n,3))}function mi(l,n){if("function"!=typeof n)throw new of(rl);return l=ga(l),function(){if(--l<1)return n.apply(this,arguments)}}function wi(l,n,u){return n=u?ul:n,n=l&&null==n?l.length:n,tr(l,wl,ul,ul,ul,ul,n)}function ji(l,n){var u;if("function"!=typeof n)throw new of(rl);return l=ga(l),function(){return--l>0&&(u=n.apply(this,arguments)),l<=1&&(n=ul),u}}function Oi(l,n,u){n=u?ul:n;var e=tr(l,_l,ul,ul,ul,ul,ul,n);return e.placeholder=Oi.placeholder,e}function ki(l,n,u){n=u?ul:n;var e=tr(l,gl,ul,ul,ul,ul,ul,n);return e.placeholder=ki.placeholder,e}function Ei(l,n,u){function e(n){var u=p,e=h;return p=h=ul,g=n,v=l.apply(e,u)}function t(l){return g=l,y=xs(i,n),b?e(l):v}function r(l){var u=l-_,e=l-g,t=n-u;return m?Wf(t,d-e):t}function o(l){var u=l-_,e=l-g;return _===ul||u>=n||u<0||m&&e>=d}function i(){var l=np();if(o(l))return a(l);y=xs(i,r(l))}function a(l){return y=ul,w&&p?e(l):(p=h=ul,v)}function c(){y!==ul&&gs(y),g=0,p=_=h=y=ul}function f(){return y===ul?v:a(np())}function s(){var l=np(),u=o(l);if(p=arguments,h=this,_=l,u){if(y===ul)return t(_);if(m)return gs(y),y=xs(i,n),e(_)}return y===ul&&(y=xs(i,n)),v}var p,h,d,v,y,_,g=0,b=!1,m=!1,w=!0;if("function"!=typeof l)throw new of(rl);return n=ma(n)||0,la(u)&&(b=!!u.leading,m="maxWait"in u,d=m?Df(ma(u.maxWait)||0,n):d,w="trailing"in u?!!u.trailing:w),s.cancel=c,s.flush=f,s}function xi(l){return tr(l,Ol)}function Pi(l,n){if("function"!=typeof l||null!=n&&"function"!=typeof n)throw new of(rl);var u=function(){var e=arguments,t=n?n.apply(this,e):e[0],r=u.cache;if(r.has(t))return r.get(t);var o=l.apply(this,e);return u.cache=r.set(t,o)||r,o};return u.cache=new(Pi.Cache||ou),u}function Ai(l){if("function"!=typeof l)throw new of(rl);return function(){var n=arguments;switch(n.length){case 0:return!l.call(this);case 1:return!l.call(this,n[0]);case 2:return!l.call(this,n[0],n[1]);case 3:return!l.call(this,n[0],n[1],n[2])}return!l.apply(this,n)}}function Ci(l){return ji(2,l)}function Si(l,n){if("function"!=typeof l)throw new of(rl);return n=n===ul?n:ga(n),Xe(l,n)}function Ri(l,n){if("function"!=typeof l)throw new of(rl);return n=null==n?0:Df(ga(n),0),Xe(function(u){var e=u[n],t=wt(u,0,n);return e&&d(t,e),r(l,this,t)})}function Ti(l,n,u){var e=!0,t=!0;if("function"!=typeof l)throw new of(rl);return la(u)&&(e="leading"in u?!!u.leading:e,t="trailing"in u?!!u.trailing:t),Ei(l,n,{leading:e,maxWait:n,trailing:t})}function Ii(l){return wi(l,1)}function Mi(l,n){return ip(bt(n),l)}function Bi(){if(!arguments.length)return[];var l=arguments[0];return hp(l)?l:[l]}function Ui(l){return le(l,sl)}function zi(l,n){return n="function"==typeof n?n:ul,le(l,sl,n)}function Li(l){return le(l,cl|sl)}function qi(l,n){return n="function"==typeof n?n:ul,le(l,cl|sl,n)}function Ni(l,n){return null==n||ue(l,n,Ua(n))}function Fi(l,n){return l===n||l!==l&&n!==n}function Di(l){return null!=l&&Xi(l.length)&&!Yi(l)}function Wi(l){return na(l)&&Di(l)}function $i(l){return!0===l||!1===l||na(l)&&ve(l)==Fl}function Ki(l){return na(l)&&1===l.nodeType&&!ca(l)}function Hi(l){if(null==l)return!0;if(Di(l)&&(hp(l)||"string"==typeof l||"function"==typeof l.splice||vp(l)||mp(l)||pp(l)))return!l.length;var n=Os(l);if(n==Jl||n==Xl)return!l.size;if(Br(l))return!Be(l).length;for(var u in l)if(hf.call(l,u))return!1;return!0}function Ji(l,n){return xe(l,n)}function Vi(l,n,u){u="function"==typeof u?u:ul;var e=u?u(l,n):ul;return e===ul?xe(l,n,ul,u):!!e}function Gi(l){if(!na(l))return!1;var n=ve(l);return n==$l||n==Wl||"string"==typeof l.message&&"string"==typeof l.name&&!ca(l)}function Zi(l){return"number"==typeof l&&qf(l)}function Yi(l){if(!la(l))return!1;var n=ve(l);return n==Kl||n==Hl||n==Nl||n==Yl}function Qi(l){return"number"==typeof l&&l==ga(l)}function Xi(l){return"number"==typeof l&&l>-1&&l%1==0&&l<=Rl}function la(l){var n=typeof l;return null!=l&&("object"==n||"function"==n)}function na(l){return null!=l&&"object"==typeof l}function ua(l,n){return l===n||Ce(l,n,gr(n))}function ea(l,n,u){return u="function"==typeof u?u:ul,Ce(l,n,gr(n),u)}function ta(l){return aa(l)&&l!=+l}function ra(l){if(ks(l))throw new lf(tl);return Se(l)}function oa(l){return null===l}function ia(l){return null==l}function aa(l){return"number"==typeof l||na(l)&&ve(l)==Vl}function ca(l){if(!na(l)||ve(l)!=Zl)return!1;var n=kf(l);if(null===n)return!0;var u=hf.call(n,"constructor")&&n.constructor;return"function"==typeof u&&u instanceof u&&pf.call(u)==_f}function fa(l){return Qi(l)&&l>=-Rl&&l<=Rl}function sa(l){return"string"==typeof l||!hp(l)&&na(l)&&ve(l)==ln}function pa(l){return"symbol"==typeof l||na(l)&&ve(l)==nn}function ha(l){return l===ul}function da(l){return na(l)&&Os(l)==en}function va(l){return na(l)&&ve(l)==tn}function ya(l){if(!l)return[];if(Di(l))return sa(l)?Q(l):Tt(l);if(Cf&&l[Cf])return W(l[Cf]());var n=Os(l);return(n==Jl?$:n==Xl?J:Ga)(l)}function _a(l){if(!l)return 0===l?l:0;if((l=ma(l))===Sl||l===-Sl){return(l<0?-1:1)*Tl}return l===l?l:0}function ga(l){var n=_a(l),u=n%1;return n===n?u?n-u:n:0}function ba(l){return l?Xu(ga(l),0,Ml):0}function ma(l){if("number"==typeof l)return l;if(pa(l))return Il;if(la(l)){var n="function"==typeof l.valueOf?l.valueOf():l;l=la(n)?n+"":n}if("string"!=typeof l)return 0===l?l:+l;l=l.replace(Tn,"");var u=Wn.test(l);return u||Kn.test(l)?Pu(l.slice(2),u?2:8):Dn.test(l)?Il:+l}function wa(l){return It(l,za(l))}function ja(l){return l?Xu(ga(l),-Rl,Rl):0===l?l:0}function Oa(l){return null==l?"":ft(l)}function ka(l,n){var u=fs(l);return null==n?u:Gu(u,n)}function Ea(l,n){return m(l,yr(n,3),fe)}function xa(l,n){return m(l,yr(n,3),se)}function Pa(l,n){return null==l?l:hs(l,yr(n,3),za)}function Aa(l,n){return null==l?l:ds(l,yr(n,3),za)}function Ca(l,n){return l&&fe(l,yr(n,3))}function Sa(l,n){return l&&se(l,yr(n,3))}function Ra(l){return null==l?[]:pe(l,Ua(l))}function Ta(l){return null==l?[]:pe(l,za(l))}function Ia(l,n,u){var e=null==l?ul:he(l,n);return e===ul?u:e}function Ma(l,n){return null!=l&&Or(l,n,_e)}function Ba(l,n){return null!=l&&Or(l,n,ge)}function Ua(l){return Di(l)?Cu(l):Be(l)}function za(l){return Di(l)?Cu(l,!0):Ue(l)}function La(l,n){var u={};return n=yr(n,3),fe(l,function(l,e,t){Yu(u,n(l,e,t),l)}),u}function qa(l,n){var u={};return n=yr(n,3),fe(l,function(l,e,t){Yu(u,e,n(l,e,t))}),u}function Na(l,n){return Fa(l,Ai(yr(n)))}function Fa(l,n){if(null==l)return{};var u=h(hr(l),function(l){return[l]});return n=yr(n),He(l,u,function(l,u){return n(l,u[0])})}function Da(l,n,u){n=mt(n,l);var e=-1,t=n.length;for(t||(t=1,l=ul);++en){var e=l;l=n,n=e}if(u||l%1||n%1){var t=Hf();return Wf(l+t*(n-l+xu("1e-"+((t+"").length-1))),n)}return Ze(l,n)}function lc(l){return Hp(Oa(l).toLowerCase())}function nc(l){return(l=Oa(l))&&l.replace(Jn,Wu).replace(hu,"")}function uc(l,n,u){l=Oa(l),n=ft(n);var e=l.length;u=u===ul?e:Xu(ga(u),0,e);var t=u;return(u-=n.length)>=0&&l.slice(u,t)==n}function ec(l){return l=Oa(l),l&&On.test(l)?l.replace(wn,$u):l}function tc(l){return l=Oa(l),l&&Rn.test(l)?l.replace(Sn,"\\$&"):l}function rc(l,n,u){l=Oa(l),n=ga(n);var e=n?Y(l):0;if(!n||e>=n)return l;var t=(n-e)/2;return Yt(Uf(t),u)+l+Yt(Bf(t),u)}function oc(l,n,u){l=Oa(l),n=ga(n);var e=n?Y(l):0;return n&&e>>0)?(l=Oa(l),l&&("string"==typeof n||null!=n&&!gp(n))&&!(n=ft(n))&&F(l)?wt(Q(l),0,u):l.split(n,u)):[]}function pc(l,n,u){return l=Oa(l),u=null==u?0:Xu(ga(u),0,l.length),n=ft(n),l.slice(u,u+n.length)==n}function hc(l,n,e){var t=u.templateSettings;e&&Sr(l,n,e)&&(n=ul),l=Oa(l),n=Ep({},n,t,rr);var r,o,i=Ep({},n.imports,t.imports,rr),a=Ua(i),c=M(i,a),f=0,s=n.interpolate||Vn,p="__p += '",h=tf((n.escape||Vn).source+"|"+s.source+"|"+(s===xn?Nn:Vn).source+"|"+(n.evaluate||Vn).source+"|$","g"),d="//# sourceURL="+(hf.call(n,"sourceURL")?(n.sourceURL+"").replace(/[\r\n]/g," "):"lodash.templateSources["+ ++bu+"]")+"\n";l.replace(h,function(n,u,e,t,i,a){return e||(e=t),p+=l.slice(f,a).replace(Gn,q),u&&(r=!0,p+="' +\n__e("+u+") +\n'"),i&&(o=!0,p+="';\n"+i+";\n__p += '"),e&&(p+="' +\n((__t = ("+e+")) == null ? '' : __t) +\n'"),f=a+n.length,n}),p+="';\n";var v=hf.call(n,"variable")&&n.variable;v||(p="with (obj) {\n"+p+"\n}\n"),p=(o?p.replace(_n,""):p).replace(gn,"$1").replace(bn,"$1;"),p="function("+(v||"obj")+") {\n"+(v?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(r?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var y=Jp(function(){return nf(a,d+"return "+p).apply(ul,c)});if(y.source=p,Gi(y))throw y;return y}function dc(l){return Oa(l).toLowerCase()}function vc(l){return Oa(l).toUpperCase()}function yc(l,n,u){if((l=Oa(l))&&(u||n===ul))return l.replace(Tn,"");if(!l||!(n=ft(n)))return l;var e=Q(l),t=Q(n);return wt(e,U(e,t),z(e,t)+1).join("")}function _c(l,n,u){if((l=Oa(l))&&(u||n===ul))return l.replace(Mn,"");if(!l||!(n=ft(n)))return l;var e=Q(l);return wt(e,0,z(e,Q(n))+1).join("")}function gc(l,n,u){if((l=Oa(l))&&(u||n===ul))return l.replace(In,"");if(!l||!(n=ft(n)))return l;var e=Q(l);return wt(e,U(e,Q(n))).join("")}function bc(l,n){var u=kl,e=El;if(la(n)){var t="separator"in n?n.separator:t;u="length"in n?ga(n.length):u,e="omission"in n?ft(n.omission):e}l=Oa(l);var r=l.length;if(F(l)){var o=Q(l);r=o.length}if(u>=r)return l;var i=u-Y(e);if(i<1)return e;var a=o?wt(o,0,i).join(""):l.slice(0,i);if(t===ul)return a+e;if(o&&(i+=a.length-i),gp(t)){if(l.slice(i).search(t)){var c,f=a;for(t.global||(t=tf(t.source,Oa(Fn.exec(t))+"g")),t.lastIndex=0;c=t.exec(f);)var s=c.index;a=a.slice(0,s===ul?i:s)}}else if(l.indexOf(ft(t),i)!=i){var p=a.lastIndexOf(t);p>-1&&(a=a.slice(0,p))}return a+e}function mc(l){return l=Oa(l),l&&jn.test(l)?l.replace(mn,Ku):l}function wc(l,n,u){return l=Oa(l),n=u?ul:n,n===ul?D(l)?nl(l):b(l):l.match(n)||[]}function jc(l){var n=null==l?0:l.length,u=yr();return l=n?h(l,function(l){if("function"!=typeof l[1])throw new of(rl);return[u(l[0]),l[1]]}):[],Xe(function(u){for(var e=-1;++eRl)return[];var u=Ml,e=Wf(l,Ml);n=yr(n),l-=Ml;for(var t=R(e,n);++u1?l[n-1]:ul;return u="function"==typeof u?(l.pop(),u):ul,Wo(l,u)}),Hs=sr(function(l){var n=l.length,u=n?l[0]:0,e=this.__wrapped__,r=function(n){return Qu(n,l)};return!(n>1||this.__actions__.length)&&e instanceof g&&Cr(u)?(e=e.slice(u,+u+(n?1:0)),e.__actions__.push({func:Vo,args:[r],thisArg:ul}),new t(e,this.__chain__).thru(function(l){return n&&!l.length&&l.push(ul),l})):this.thru(r)}),Js=Ut(function(l,n,u){hf.call(l,u)?++l[u]:Yu(l,u,1)}),Vs=Kt(oo),Gs=Kt(io),Zs=Ut(function(l,n,u){hf.call(l,u)?l[u].push(n):Yu(l,u,[n])}),Ys=Xe(function(l,n,u){var e=-1,t="function"==typeof n,o=Di(l)?Qc(l.length):[];return ss(l,function(l){o[++e]=t?r(n,l,u):je(l,n,u)}),o}),Qs=Ut(function(l,n,u){Yu(l,u,n)}),Xs=Ut(function(l,n,u){l[u?0:1].push(n)},function(){return[[],[]]}),lp=Xe(function(l,n){if(null==l)return[];var u=n.length;return u>1&&Sr(l,n[0],n[1])?n=[]:u>2&&Sr(n[0],n[1],n[2])&&(n=[n[0]]),$e(l,ce(n,1),[])}),np=If||function(){return Su.Date.now()},up=Xe(function(l,n,u){var e=dl;if(u.length){var t=H(u,vr(up));e|=bl}return tr(l,e,n,u,t)}),ep=Xe(function(l,n,u){var e=dl|vl;if(u.length){var t=H(u,vr(ep));e|=bl}return tr(n,e,l,u,t)}),tp=Xe(function(l,n){return ee(l,1,n)}),rp=Xe(function(l,n,u){return ee(l,ma(n)||0,u)});Pi.Cache=ou;var op=_s(function(l,n){n=1==n.length&&hp(n[0])?h(n[0],I(yr())):h(ce(n,1),I(yr()));var u=n.length;return Xe(function(e){for(var t=-1,o=Wf(e.length,u);++t=n}),pp=Oe(function(){return arguments}())?Oe:function(l){return na(l)&&hf.call(l,"callee")&&!xf.call(l,"callee")},hp=Qc.isArray,dp=Uu?I(Uu):ke,vp=Lf||zc,yp=zu?I(zu):Ee,_p=Lu?I(Lu):Ae,gp=qu?I(qu):Re,bp=Nu?I(Nu):Te,mp=Fu?I(Fu):Ie,wp=lr(ze),jp=lr(function(l,n){return l<=n}),Op=zt(function(l,n){if(Br(n)||Di(n))return void It(n,Ua(n),l);for(var u in n)hf.call(n,u)&&Du(l,u,n[u])}),kp=zt(function(l,n){It(n,za(n),l)}),Ep=zt(function(l,n,u,e){It(n,za(n),l,e)}),xp=zt(function(l,n,u,e){It(n,Ua(n),l,e)}),Pp=sr(Qu),Ap=Xe(function(l,n){l=ef(l);var u=-1,e=n.length,t=e>2?n[2]:ul;for(t&&Sr(n[0],n[1],t)&&(e=1);++u1),n}),It(l,hr(l),u),e&&(u=le(u,cl|fl|sl,ir));for(var t=n.length;t--;)pt(u,n[t]);return u}),Up=sr(function(l,n){return null==l?{}:Ke(l,n)}),zp=er(Ua),Lp=er(za),qp=Dt(function(l,n,u){return n=n.toLowerCase(),l+(u?lc(n):n)}),Np=Dt(function(l,n,u){return l+(u?"-":"")+n.toLowerCase()}),Fp=Dt(function(l,n,u){return l+(u?" ":"")+n.toLowerCase()}),Dp=Ft("toLowerCase"),Wp=Dt(function(l,n,u){return l+(u?"_":"")+n.toLowerCase()}),$p=Dt(function(l,n,u){return l+(u?" ":"")+Hp(n)}),Kp=Dt(function(l,n,u){return l+(u?" ":"")+n.toUpperCase()}),Hp=Ft("toUpperCase"),Jp=Xe(function(l,n){try{return r(l,ul,n)}catch(l){return Gi(l)?l:new lf(l)}}),Vp=sr(function(l,n){return i(n,function(n){n=Vr(n),Yu(l,n,up(l[n],l))}),l}),Gp=Ht(),Zp=Ht(!0),Yp=Xe(function(l,n){return function(u){return je(u,l,n)}}),Qp=Xe(function(l,n){return function(u){return je(l,u,n)}}),Xp=Zt(h),lh=Zt(c),nh=Zt(_),uh=Xt(),eh=Xt(!0),th=Gt(function(l,n){return l+n},0),rh=ur("ceil"),oh=Gt(function(l,n){return l/n},1),ih=ur("floor"),ah=Gt(function(l,n){return l*n},1),ch=ur("round"),fh=Gt(function(l,n){return l-n},0);return u.after=mi,u.ary=wi,u.assign=Op,u.assignIn=kp,u.assignInWith=Ep,u.assignWith=xp,u.at=Pp,u.before=ji,u.bind=up,u.bindAll=Vp,u.bindKey=ep,u.castArray=Bi,u.chain=Ho,u.chunk=Qr,u.compact=Xr,u.concat=lo,u.cond=jc,u.conforms=Oc,u.constant=kc,u.countBy=Js,u.create=ka,u.curry=Oi,u.curryRight=ki,u.debounce=Ei,u.defaults=Ap,u.defaultsDeep=Cp,u.defer=tp,u.delay=rp,u.difference=Cs,u.differenceBy=Ss,u.differenceWith=Rs,u.drop=no,u.dropRight=uo,u.dropRightWhile=eo,u.dropWhile=to,u.fill=ro,u.filter=ei,u.flatMap=ti,u.flatMapDeep=ri,u.flatMapDepth=oi,u.flatten=ao,u.flattenDeep=co,u.flattenDepth=fo,u.flip=xi,u.flow=Gp,u.flowRight=Zp,u.fromPairs=so,u.functions=Ra,u.functionsIn=Ta,u.groupBy=Zs,u.initial=vo,u.intersection=Ts,u.intersectionBy=Is,u.intersectionWith=Ms,u.invert=Sp,u.invertBy=Rp,u.invokeMap=Ys,u.iteratee=Pc,u.keyBy=Qs,u.keys=Ua,u.keysIn=za,u.map=fi,u.mapKeys=La,u.mapValues=qa,u.matches=Ac,u.matchesProperty=Cc,u.memoize=Pi,u.merge=Ip,u.mergeWith=Mp,u.method=Yp,u.methodOf=Qp,u.mixin=Sc,u.negate=Ai,u.nthArg=Ic,u.omit=Bp,u.omitBy=Na,u.once=Ci,u.orderBy=si,u.over=Xp,u.overArgs=op,u.overEvery=lh,u.overSome=nh,u.partial=ip,u.partialRight=ap,u.partition=Xs,u.pick=Up,u.pickBy=Fa,u.property=Mc,u.propertyOf=Bc,u.pull=Bs,u.pullAll=mo,u.pullAllBy=wo,u.pullAllWith=jo,u.pullAt=Us,u.range=uh,u.rangeRight=eh,u.rearg=cp,u.reject=di,u.remove=Oo,u.rest=Si,u.reverse=ko,u.sampleSize=yi,u.set=Wa,u.setWith=$a,u.shuffle=_i,u.slice=Eo,u.sortBy=lp,u.sortedUniq=To,u.sortedUniqBy=Io,u.split=sc,u.spread=Ri,u.tail=Mo,u.take=Bo,u.takeRight=Uo,u.takeRightWhile=zo,u.takeWhile=Lo,u.tap=Jo,u.throttle=Ti,u.thru=Vo,u.toArray=ya,u.toPairs=zp,u.toPairsIn=Lp,u.toPath=Dc,u.toPlainObject=wa,u.transform=Ka,u.unary=Ii,u.union=zs,u.unionBy=Ls,u.unionWith=qs,u.uniq=qo,u.uniqBy=No,u.uniqWith=Fo,u.unset=Ha,u.unzip=Do,u.unzipWith=Wo,u.update=Ja,u.updateWith=Va,u.values=Ga,u.valuesIn=Za,u.without=Ns,u.words=wc,u.wrap=Mi,u.xor=Fs,u.xorBy=Ds,u.xorWith=Ws,u.zip=$s,u.zipObject=$o,u.zipObjectDeep=Ko,u.zipWith=Ks,u.entries=zp,u.entriesIn=Lp,u.extend=kp,u.extendWith=Ep,Sc(u,u),u.add=th,u.attempt=Jp,u.camelCase=qp,u.capitalize=lc,u.ceil=rh,u.clamp=Ya,u.clone=Ui,u.cloneDeep=Li,u.cloneDeepWith=qi,u.cloneWith=zi,u.conformsTo=Ni,u.deburr=nc,u.defaultTo=Ec,u.divide=oh,u.endsWith=uc,u.eq=Fi,u.escape=ec,u.escapeRegExp=tc,u.every=ui,u.find=Vs,u.findIndex=oo,u.findKey=Ea,u.findLast=Gs,u.findLastIndex=io,u.findLastKey=xa,u.floor=ih,u.forEach=ii,u.forEachRight=ai,u.forIn=Pa,u.forInRight=Aa,u.forOwn=Ca,u.forOwnRight=Sa,u.get=Ia,u.gt=fp,u.gte=sp,u.has=Ma,u.hasIn=Ba,u.head=po,u.identity=xc,u.includes=ci,u.indexOf=ho,u.inRange=Qa,u.invoke=Tp,u.isArguments=pp,u.isArray=hp,u.isArrayBuffer=dp,u.isArrayLike=Di,u.isArrayLikeObject=Wi,u.isBoolean=$i,u.isBuffer=vp,u.isDate=yp,u.isElement=Ki,u.isEmpty=Hi,u.isEqual=Ji,u.isEqualWith=Vi,u.isError=Gi,u.isFinite=Zi,u.isFunction=Yi,u.isInteger=Qi,u.isLength=Xi,u.isMap=_p,u.isMatch=ua,u.isMatchWith=ea,u.isNaN=ta,u.isNative=ra,u.isNil=ia,u.isNull=oa,u.isNumber=aa,u.isObject=la,u.isObjectLike=na,u.isPlainObject=ca,u.isRegExp=gp,u.isSafeInteger=fa,u.isSet=bp,u.isString=sa,u.isSymbol=pa,u.isTypedArray=mp,u.isUndefined=ha,u.isWeakMap=da,u.isWeakSet=va,u.join=yo,u.kebabCase=Np,u.last=_o,u.lastIndexOf=go,u.lowerCase=Fp,u.lowerFirst=Dp,u.lt=wp,u.lte=jp,u.max=$c,u.maxBy=Kc,u.mean=Hc,u.meanBy=Jc,u.min=Vc,u.minBy=Gc,u.stubArray=Uc,u.stubFalse=zc,u.stubObject=Lc,u.stubString=qc,u.stubTrue=Nc,u.multiply=ah,u.nth=bo,u.noConflict=Rc,u.noop=Tc,u.now=np,u.pad=rc,u.padEnd=oc,u.padStart=ic,u.parseInt=ac,u.random=Xa,u.reduce=pi,u.reduceRight=hi,u.repeat=cc,u.replace=fc,u.result=Da,u.round=ch,u.runInContext=l,u.sample=vi,u.size=gi,u.snakeCase=Wp,u.some=bi,u.sortedIndex=xo,u.sortedIndexBy=Po,u.sortedIndexOf=Ao,u.sortedLastIndex=Co,u.sortedLastIndexBy=So,u.sortedLastIndexOf=Ro,u.startCase=$p,u.startsWith=pc,u.subtract=fh,u.sum=Zc,u.sumBy=Yc,u.template=hc,u.times=Fc,u.toFinite=_a,u.toInteger=ga,u.toLength=ba,u.toLower=dc,u.toNumber=ma,u.toSafeInteger=ja,u.toString=Oa,u.toUpper=vc,u.trim=yc,u.trimEnd=_c,u.trimStart=gc,u.truncate=bc,u.unescape=mc,u.uniqueId=Wc,u.upperCase=Kp,u.upperFirst=Hp,u.each=ii,u.eachRight=ai,u.first=po,Sc(u,function(){var l={};return fe(u,function(n,e){hf.call(u.prototype,e)||(l[e]=n)}),l}(),{chain:!1}),u.VERSION="4.17.15",i(["bind","bindKey","curry","curryRight","partial","partialRight"],function(l){u[l].placeholder=u}),i(["drop","take"],function(l,n){g.prototype[l]=function(u){u=u===ul?1:Df(ga(u),0);var e=this.__filtered__&&!n?new g(this):this.clone();return e.__filtered__?e.__takeCount__=Wf(u,e.__takeCount__):e.__views__.push({size:Wf(u,Ml),type:l+(e.__dir__<0?"Right":"")}),e},g.prototype[l+"Right"]=function(n){return this.reverse()[l](n).reverse()}}),i(["filter","map","takeWhile"],function(l,n){var u=n+1,e=u==Al||3==u;g.prototype[l]=function(l){var n=this.clone();return n.__iteratees__.push({iteratee:yr(l,3),type:u}),n.__filtered__=n.__filtered__||e,n}}),i(["head","last"],function(l,n){var u="take"+(n?"Right":"");g.prototype[l]=function(){return this[u](1).value()[0]}}),i(["initial","tail"],function(l,n){var u="drop"+(n?"":"Right");g.prototype[l]=function(){return this.__filtered__?new g(this):this[u](1)}}),g.prototype.compact=function(){return this.filter(xc)},g.prototype.find=function(l){return this.filter(l).head()},g.prototype.findLast=function(l){return this.reverse().find(l)},g.prototype.invokeMap=Xe(function(l,n){return"function"==typeof l?new g(this):this.map(function(u){return je(u,l,n)})}),g.prototype.reject=function(l){return this.filter(Ai(yr(l)))},g.prototype.slice=function(l,n){l=ga(l);var u=this;return u.__filtered__&&(l>0||n<0)?new g(u):(l<0?u=u.takeRight(-l):l&&(u=u.drop(l)),n!==ul&&(n=ga(n),u=n<0?u.dropRight(-n):u.take(n-l)),u)},g.prototype.takeRightWhile=function(l){return this.reverse().takeWhile(l).reverse()},g.prototype.toArray=function(){return this.take(Ml)},fe(g.prototype,function(l,n){var e=/^(?:filter|find|map|reject)|While$/.test(n),r=/^(?:head|last)$/.test(n),o=u[r?"take"+("last"==n?"Right":""):n],i=r||/^find/.test(n);o&&(u.prototype[n]=function(){var n=this.__wrapped__,a=r?[1]:arguments,c=n instanceof g,f=a[0],s=c||hp(n),p=function(l){var n=o.apply(u,d([l],a));return r&&h?n[0]:n};s&&e&&"function"==typeof f&&1!=f.length&&(c=s=!1);var h=this.__chain__,v=!!this.__actions__.length,y=i&&!h,_=c&&!v;if(!i&&s){n=_?n:new g(this);var b=l.apply(n,a);return b.__actions__.push({func:Vo,args:[p],thisArg:ul}),new t(b,h)}return y&&_?l.apply(this,a):(b=this.thru(p),y?r?b.value()[0]:b.value():b)})}),i(["pop","push","shift","sort","splice","unshift"],function(l){var n=af[l],e=/^(?:push|sort|unshift)$/.test(l)?"tap":"thru",t=/^(?:pop|shift)$/.test(l);u.prototype[l]=function(){var l=arguments;if(t&&!this.__chain__){var u=this.value();return n.apply(hp(u)?u:[],l)}return this[e](function(u){return n.apply(hp(u)?u:[],l)})}}),fe(g.prototype,function(l,n){var e=u[n];if(e){var t=e.name+"";hf.call(ns,t)||(ns[t]=[]),ns[t].push({name:n,func:e})}}),ns[Jt(ul,vl).name]=[{name:"wrapper",func:ul}],g.prototype.clone=P,g.prototype.reverse=G,g.prototype.value=X,u.prototype.at=Hs,u.prototype.chain=Go,u.prototype.commit=Zo,u.prototype.next=Yo,u.prototype.plant=Xo,u.prototype.reverse=li,u.prototype.toJSON=u.prototype.valueOf=u.prototype.value=ni,u.prototype.first=u.prototype.head,Cf&&(u.prototype[Cf]=Qo),u}();Su._=Hu,(t=function(){return Hu}.call(n,u,n,e))!==ul&&(e.exports=t)}).call(this)}).call(n,u(10),u(11)(l))},function(l,n,u){"use strict";var e=String.prototype.replace,t=/%20/g;l.exports={default:"RFC3986",formatters:{RFC1738:function(l){return e.call(l,t,"+")},RFC3986:function(l){return l}},RFC1738:"RFC1738",RFC3986:"RFC3986"}},function(l,n,u){"use strict";var e=Object.prototype.hasOwnProperty,t=function(){for(var l=[],n=0;n<256;++n)l.push("%"+((n<16?"0":"")+n.toString(16)).toUpperCase());return l}();n.arrayToObject=function(l,n){for(var u=n&&n.plainObjects?Object.create(null):{},e=0;e=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122?u+=n.charAt(e):r<128?u+=t[r]:r<2048?u+=t[192|r>>6]+t[128|63&r]:r<55296||r>=57344?u+=t[224|r>>12]+t[128|r>>6&63]+t[128|63&r]:(e+=1,r=65536+((1023&r)<<10|1023&n.charCodeAt(e)),u+=t[240|r>>18]+t[128|r>>12&63]+t[128|r>>6&63]+t[128|63&r])}return u},n.compact=function(l,u){if("object"!=typeof l||null===l)return l;var e=u||[],t=e.indexOf(l);if(-1!==t)return e[t];if(e.push(l),Array.isArray(l)){for(var r=[],o=0;o0&&void 0!==arguments[0]?arguments[0]:"_token";e(this,l),this.cache={},this.storageName=n}return t(l,[{key:"getItem",value:function(l){if(this.cache[l])return Promise.resolve(this.cache[l]);var n=this._getCookie();return n[l]?(this.cache[l]=n[l],Promise.resolve(n[l])):Promise.reject()}},{key:"removeItem",value:function(l){var n=this._getCookie();return n[l]?(delete this.cache[l],delete n[l],this._setCookie(n),Promise.resolve()):Promise.resolve()}},{key:"setItem",value:function(l,n){var u=this._getCookie();return delete this.cache[l],u[l]=n,this._setCookie(u),Promise.resolve()}},{key:"_getCookie",value:function(){var l=new RegExp("(?:^|; )"+encodeURIComponent(this.storageName)+"=([^;]*)").exec(document.cookie);return l?JSON.parse(decodeURIComponent(l[1])):{}}},{key:"_setCookie",value:function(l){document.cookie=this.storageName+"="+encodeURIComponent(JSON.stringify(l))+";path=/"}}]),l}();n.default=r},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0});var o=Object.assign||function(l){for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:"get",u=arguments[2],e=this,t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{},i=o({},r,{body:u,cache:"no-cache",credentials:"omit",headers:new Headers(o({},this.defaultHeaders,t)),method:n.toUpperCase(),mode:"cors"});return fetch(l,i).then(function(l){return l.ok?l.text().then(e._parseText).then(function(n){return e._formatResponse(l,n)}):Promise.reject(l)}).catch(function(l){return l.json?l.text().then(e._parseText).then(function(n){return Promise.reject((0,a.createError)(e._formatResponse(l,n),l))}):Promise.reject((0,a.createError)(e._formatResponse({error:l,status:-1}),l))})}},{key:"_formatResponse",value:function(l){return{body:arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,headers:this._parseHeaders(l.headers),status:l.status,url:l.url}}},{key:"_parseHeaders",value:function(l){var n={};return l?(l.forEach(function(l,u){n[u]=l}),n):n}},{key:"_parseText",value:function(l){if(!l||(0,f.default)(l))return{};try{return JSON.parse(l)}catch(n){return l}}}]),n}(a.Client);n.default=s},function(l,n,u){"use strict";function e(l,n){return this.api("/me/accounts/"+l,n)}function t(l){return this.api("/me/accounts",l)}Object.defineProperty(n,"__esModule",{value:!0}),n.getAccount=e,n.getAccounts=t},function(l,n,u){"use strict";function e(l,n,u){return this.api("/me/cards/"+l+"/addresses",(0,o.default)({body:{network:n},method:"post"},u))}function t(l,n){return this.api("/me/cards/"+l+"/addresses",n)}Object.defineProperty(n,"__esModule",{value:!0}),n.createCardAddress=e,n.getCardAddresses=t;var r=u(1),o=function(l){return l&&l.__esModule?l:{default:l}}(r)},function(l,n,u){"use strict";function e(l,n,u){return this.api("/me/cards/"+l+"/transactions/"+n+"/cancel",a({method:"post"},u))}function t(l,n,u,e,t){var r=u.message,o=u.securityCode;return t=(0,f.default)({body:{message:r,securityCode:o},method:"post"},t),e&&(t.headers=a({"otp-token":e},t.headers)),this.api("/me/cards/"+l+"/transactions/"+n+"/commit",t)}function r(l,n,u,e,t){var r=n.amount,o=n.currency,i=n.destination,c=n.origin,s=n.message,p=n.securityCode;return t=(0,f.default)({body:{denomination:{amount:r,currency:o},destination:i,message:s,origin:c,securityCode:p},method:"post"},t),u&&(t.queryParams=a({commit:!0},t.queryParams)),e&&(t.headers=a({"otp-token":e},t.headers)),this.api("/me/cards/"+l+"/transactions",t)}function o(l,n,u,e){return this.paginate("/me/cards/"+l+"/transactions",n,u,e)}function i(l,n,u){return this.api("/me/cards/"+l+"/transactions/"+n+"/resend",a({method:"post"},u))}Object.defineProperty(n,"__esModule",{value:!0});var a=Object.assign||function(l){for(var n=1;n0&&void 0!==arguments[0]?arguments[0]:{}).status}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.InternalServerError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{}).status}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.InvalidScopeError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{},n=l.body,u=l.status;return!!(u&&n&&n.error)&&(400===u&&"invalid_scope"===n.error)}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.NotFoundError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{}).status}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.OTPRequiredError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{},n=l.headers;return!(!n||!n["otp-token"])&&(0,a.includes)(["OPTIONAL","REQUIRED"],n["otp-token"].toUpperCase())}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.RateLimitError=void 0;var o=Object.assign||function(l){for(var n=1;n0&&void 0!==arguments[0]?arguments[0]:{}).status}}]),i(n,[{key:"getRateLimitData",value:function(){return{limit:this.limit,remaining:this.remaining,reset:this.reset}}}]),n}(a.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.UnauthorizedError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{},n=l.body,u=l.status;return!!(u&&n&&n.error)&&(400===u&&("invalid_request"===n.error||"invalid_grant"===n.error)||401===u&&"invalid_token"===n.error)}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.UnavailableError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{}).status<=0}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}function t(l,n){if(!l)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!n||"object"!=typeof n&&"function"!=typeof n?l:n}function r(l,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function, not "+typeof n);l.prototype=Object.create(n&&n.prototype,{constructor:{value:l,enumerable:!1,writable:!0,configurable:!0}}),n&&(Object.setPrototypeOf?Object.setPrototypeOf(l,n):l.__proto__=n)}Object.defineProperty(n,"__esModule",{value:!0}),n.UnknownError=void 0;var o=function(){function l(l,n){for(var u=0;u0&&void 0!==arguments[0]?arguments[0]:{},n=l.body;return n&&"validation_failed"===n.code}}]),n}(i.BaseError)},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(l){return typeof l}:function(l){return l&&"function"==typeof Symbol&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l},r=Object.assign||function(l){for(var n=1;n1&&void 0!==arguments[1]?arguments[1]:{},e=u.authenticate,o=void 0===e||e,i=u.headers,a=void 0===i?{}:i,c=u.method,f=void 0===c?"get":c,p=u.queryParams,h=u.raw,d=u.version,v=void 0===d?this.options.version:d,y=u.body,_=(0,s.buildUrl)(l,this.options.baseUrl,v,p),g=void 0;return y&&("object"===(void 0===y?"undefined":t(y))&&(y=JSON.stringify(y)),a["content-type"]="application/json"),g=o&&!a.authorization?this.getToken().then(function(l){return n.client.request(_,f,y,r({},(0,s.buildBearerAuthorizationHeader)(l.access_token),a),u)}):this.client.request(_,f,y,a,u),g.then(function(l){return h?l:l.body}).catch(this._refreshToken(_,f,y,a,u))}},{key:"authorize",value:function(l){var n=this.oauthClient.buildAccessTokenRequestByAuthorizationCodeGrant(l);return this.tokenRequestPromise=this._authenticationRequest(n),this.tokenRequestPromise}},{key:"getToken",value:function(){var l=this;return this.storage.getItem(this.options.accessTokenKey).then(function(n){return n?l.storage.getItem(l.options.refreshTokenKey).then(function(l){return{access_token:n,refresh_token:l}}).catch(function(){return{access_token:n}}):(l.tokenRequestPromise=null,Promise.reject())}).catch(function(){return l.tokenRequestPromise?l.tokenRequestPromise:Promise.reject(new c.AuthorizationRequiredError)})}},{key:"logout",value:function(){var l=this;return this._revokeToken().catch(function(l){if(!(l instanceof c.UnauthorizedError))return Promise.reject(l)}).then(function(){return l.removeToken()})}},{key:"paginate",value:function(l){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:this.options.itemsPerPage,e=arguments[3];return new f.Paginator(this,l,u,e).getPage(n)}},{key:"removeToken",value:function(){return Promise.all([this.storage.removeItem(this.options.accessTokenKey),this.storage.removeItem(this.options.refreshTokenKey)])}},{key:"setToken",value:function(l){var n=this,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.storage.setItem(this.options.accessTokenKey,l.access_token).then(function(){n.storage.setItem(n.options.scope,(0,p.get)(l,"scope","")),n.storage.setItem(n.options.otpTokenStatus,(0,p.get)(u,"otp-token","")),l.refresh_token&&n.storage.setItem(n.options.refreshTokenKey,l.refresh_token)}).then(function(){return l})}},{key:"_authenticationRequest",value:function(l){var n=this,u=l.body,e=l.headers,t=l.url;return this.client.request(t,"post",u,e).then(function(l){var u=l.body,e=l.headers;return n.setToken(u,e)})}},{key:"_refreshToken",value:function(l,n,u,e,t){var o=this;return function(i){return i&&i.body&&"invalid_token"===i.body.error?(o.refreshRequestPromise||(o.refreshRequestPromise=o._requestRefreshToken(i)),o.refreshRequestPromise.then(function(i){return o.client.request(l,n,u,r({},(0,s.buildBearerAuthorizationHeader)(i.access_token),e),t).then(function(l){return l.body})})):Promise.reject(i)}}},{key:"_requestRefreshToken",value:function(l){var n=this;return this.storage.getItem(this.options.refreshTokenKey).catch(function(){return Promise.reject(l)}).then(function(l){var u=n.oauthClient.buildRefreshTokenRequest(l);return n._authenticationRequest(u).then(function(l){return n.refreshRequestPromise=null,l})})}},{key:"_revokeToken",value:function(){var l=this;return this.getToken().then(function(n){var u=l.oauthClient.buildRevokeTokenRequest(n.access_token),e=u.body,t=u.headers,r=u.url;return l.client.request(r,"post",e,t)})}}]),l}();n.default=h;for(var d in a)h.prototype[d]=a[d]},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var t=u(50),r=function l(){e(this,l),this.defaultHeaders={"user-agent":t.name+"/"+t.version}};n.default=r},function(l,n,u){"use strict";function e(l,n){if(!(l instanceof n))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(n,"__esModule",{value:!0});var t=Object.assign||function(l){for(var n=1;n0&&void 0!==arguments[0]?arguments[0]:1,u=arguments[1];return this.sdk.api(this.uri,(0,c.default)({headers:{range:"items="+(n-1)*this.itemsPerPage+"-"+(n*this.itemsPerPage-1)}},this.options,u,{raw:!0})).then(function(n){var u=n.body,e=n.headers,t=i.default.parse(e["content-range"]),r=t.first,o=t.length;return l.currentPage=o?r/l.itemsPerPage+1:null,l.headers=e,l.items=u,l.itemsCount=o,l.pagesCount=Math.ceil(o/l.itemsPerPage),l})}},{key:"getPreviousPage",value:function(l){return this.hasPreviousPage()?this.getPage(this.currentPage-1,l):Promise.resolve()}},{key:"hasNextPage",value:function(){return!!this.currentPage&&this.currentPage1}}]),l}();n.default=f},function(l,n,u){"use strict";function e(l,n){for(var u=o.default,e=Array.isArray(u),r=0,u=e?u:u[Symbol.iterator]();;){var i;if(e){if(r>=u.length)break;i=u[r++]}else{if(r=u.next(),r.done)break;i=r.value}var a=i;if(a.hasError&&a.hasError(l))return new a(t({},l,{response:n}))}}Object.defineProperty(n,"__esModule",{value:!0});var t=Object.assign||function(l){for(var n=1;n0)throw new Error("Invalid string. Length must be a multiple of 4");return"="===l[n-2]?2:"="===l[n-1]?1:0}function t(l){return 3*l.length/4-e(l)}function r(l){var n,u,t,r,o,i,a=l.length;o=e(l),i=new s(3*a/4-o),t=o>0?a-4:a;var c=0;for(n=0,u=0;n>16&255,i[c++]=r>>8&255,i[c++]=255&r;return 2===o?(r=f[l.charCodeAt(n)]<<2|f[l.charCodeAt(n+1)]>>4,i[c++]=255&r):1===o&&(r=f[l.charCodeAt(n)]<<10|f[l.charCodeAt(n+1)]<<4|f[l.charCodeAt(n+2)]>>2,i[c++]=r>>8&255,i[c++]=255&r),i}function o(l){return c[l>>18&63]+c[l>>12&63]+c[l>>6&63]+c[63&l]}function i(l,n,u){for(var e,t=[],r=n;ra?a:o+16383));return 1===e?(n=l[u-1],t+=c[n>>2],t+=c[n<<4&63],t+="=="):2===e&&(n=(l[u-2]<<8)+l[u-1],t+=c[n>>10],t+=c[n>>4&63],t+=c[n<<2&63],t+="="),r.push(t),r.join("")}n.byteLength=t,n.toByteArray=r,n.fromByteArray=a;for(var c=[],f=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,d=p.length;h|(]*>|]*>|]+>)+/i,r=new RegExp(e.map(function(l){return"<"+l+"\\b[^>]*>"}).join("|"),"i");l.exports=function(l){return!!t.test(l)||r.test(l)}},function(l,n){l.exports=["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","keygen","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(l,n,u){l.exports=u(48)},function(l,n){l.exports={name:"@uphold/uphold-sdk-javascript",version:"2.4.0",description:"Uphold SDK for JavasScript",keywords:["api","javascript","sdk","uphold"],license:"MIT",author:"Uphold Inc.",main:"dist/node/index.js",repository:"git@github.com:uphold/uphold-sdk-javascript.git",scripts:{build:"rm -rf dist && yarn build:node && yarn build:browser","build:browser":"yarn && webpack --progress","build:node":"babel src/node -d dist/node && babel src/core -d dist/core",changelog:"github-changelog-generator --owner uphold --repo uphold-sdk-javascript --future-release=v$npm_package_version > CHANGELOG.md",cover:"yarn test -- --coverage",docs:"yarn docs:build && yarn docs:prepare && yarn docs:publish","docs:build":"gitbook install && cd docs && ../node_modules/.bin/gitbook build && cp -R images/* _book/gitbook/images","docs:prepare":"cd docs/_book && git init && git checkout -b gh-pages && git add . && git commit -m 'Update documentation'","docs:publish":"cd docs/_book && git push git@github.com:uphold/uphold-sdk-javascript gh-pages --force && cd .. && rm -rf _book",lint:"eslint --cache src test",release:"npm version $1 -m 'Release %s'",tdd:"yarn test -- --watch",test:"jest --config jest.json",version:"yarn build && yarn changelog && git add -f dist CHANGELOG.md"},browser:"dist/browser/uphold-sdk-javascript.js",dependencies:{"base64-js":"1.2.0","content-range":"1.1.0","lodash.merge":"4.6.2",qs:"6.4.0",request:"2.88.0","request-promise":"4.2.0","standard-error":"1.1.0","text-encoding":"0.6.4"},devDependencies:{"@uphold/github-changelog-generator":"^0.8.1","babel-cli":"6.24.1","babel-core":"6.24.1","babel-eslint":"7.2.3","babel-loader":"7.0.0","babel-plugin-istanbul":"5.1.4","babel-plugin-transform-object-rest-spread":"6.23.0","babel-polyfill":"6.23.0","babel-preset-es2015":"6.24.1","babel-preset-es2015-node":"4.0.2",eslint:"6.0.1","eslint-config-seegno":"9.0.0","eslint-plugin-babel":"4.1.1","fetch-mock":"5.10.0","gitbook-cli":"^2.3.2","html-tags":"1.1.1","is-html":"1.1.0","isomorphic-fetch":"2.2.1",jest:"19.0.2","json-loader":"0.5.4",nock:"9.0.13","pre-commit":"1.2.2",webpack:"2.5.0"},resolutions:{braces:"^2.3.2",hoek:"^4.2.0",lodash:"^4.17.12",ssri:"^5.2.2","tunnel-agent":"^0.6.0"},engines:{node:">=4"},"pre-commit":["lint"]}},function(l,n,u){"use strict";var e=u(53),t=u(52),r=u(8);l.exports={formats:r,parse:t,stringify:e}},function(l,n,u){"use strict";var e=u(9),t=Object.prototype.hasOwnProperty,r={allowDots:!1,allowPrototypes:!1,arrayLimit:20,decoder:e.decode,delimiter:"&",depth:5,parameterLimit:1e3,plainObjects:!1,strictNullHandling:!1},o=function(l,n){for(var u={},e=l.split(n.delimiter,n.parameterLimit===1/0?void 0:n.parameterLimit),r=0;r=0&&u.parseArrays&&o<=u.arrayLimit?(e=[],e[o]=i(l,n,u)):e[r]=i(l,n,u)}return e},a=function(l,n,u){if(l){var e=u.allowDots?l.replace(/\.([^.[]+)/g,"[$1]"):l,r=/(\[[^[\]]*])/,o=/(\[[^[\]]*])/g,a=r.exec(e),c=a?e.slice(0,a.index):e,f=[];if(c){if(!u.plainObjects&&t.call(Object.prototype,c)&&!u.allowPrototypes)return;f.push(c)}for(var s=0;null!==(a=o.exec(e))&&s57343)t.push(r);else if(56320<=r&&r<=57343)t.push(65533);else if(55296<=r&&r<=56319)if(e===u-1)t.push(65533);else{var o=n.charCodeAt(e+1);if(56320<=o&&o<=57343){var i=1023&r,a=1023&o;t.push(65536+(i<<10)+a),e+=1}else t.push(65533)}e+=1}return t}function i(l){for(var n="",u=0;u>10),56320+(1023&e)))}return n}function a(l){return 0<=l&&l<=127}function c(l){this.tokens=[].slice.call(l),this.tokens.reverse()}function f(l,n){if(l)throw TypeError("Decoder error");return n||65533}function s(l){throw TypeError("The code point "+l+" could not be encoded.")}function p(){}function h(){}function d(l){return l=String(l).trim().toLowerCase(),Object.prototype.hasOwnProperty.call(Z,l)?Z[l]:null}function v(l,n){return n?n[l]||null:null}function y(l,n){var u=n.indexOf(l);return-1===u?null:u}function _(l){if(!("encoding-indexes"in n))throw Error("Indexes missing. Did you forget to include encoding-indexes.js first?");return n["encoding-indexes"][l]}function g(l){if(l>39419&&l<189e3||l>1237575)return null;if(7457===l)return 59335;var n,u=0,e=0,t=_("gb18030-ranges");for(n=0;n>6*u)+t];u>0;){var o=n>>6*(u-1);r.push(128|63&o),u-=1}return r}}function x(l,n){var u=n.fatal;this.handler=function(n,e){if(e===J)return V;if(a(e))return e;var t=l[e-128];return null===t?f(u):t}}function P(l,n){n.fatal;this.handler=function(n,u){if(u===J)return V;if(H(u))return u;var e=y(u,l);return null===e&&s(u),e+128}}function A(l){var n=l.fatal,u=0,t=0,r=0;this.handler=function(l,o){if(o===J&&0===u&&0===t&&0===r)return V;o!==J||0===u&&0===t&&0===r||(u=0,t=0,r=0,f(n));var i;if(0!==r){i=null,e(o,48,57)&&(i=g(10*(126*(10*(u-129)+t-48)+r-129)+o-48));var c=[t,r,o];return u=0,t=0,r=0,null===i?(l.prepend(c),f(n)):i}if(0!==t)return e(o,129,254)?(r=o,null):(l.prepend([t,o]),u=0,t=0,f(n));if(0!==u){if(e(o,48,57))return t=o,null;var s=u,p=null;u=0;var h=o<127?64:65;return(e(o,64,126)||e(o,128,254))&&(p=190*(s-129)+(o-h)),i=null===p?null:v(p,_("gb18030")),null===i&&a(o)&&l.prepend(o),null===i?f(n):i}return a(o)?o:128===o?8364:e(o,129,254)?(u=o,null):f(n)}}function C(l,n){l.fatal;this.handler=function(l,u){if(u===J)return V;if(H(u))return u;if(58853===u)return s(u);if(n&&8364===u)return 128;var e=y(u,_("gb18030"));if(null!==e){var t=K(e/190)+129,r=e%190;return[t,r+(r<63?64:65)]}if(n)return s(u);e=b(u);var o=K(e/10/126/10);e-=10*o*126*10;var i=K(e/10/126);e-=10*i*126;var a=K(e/10);return[o+129,i+48,a+129,e-10*a+48]}}function S(l){var n=l.fatal,u=0;this.handler=function(l,t){if(t===J&&0!==u)return u=0,f(n);if(t===J&&0===u)return V;if(0!==u){var r=u,o=null;u=0;var i=t<127?64:98;switch((e(t,64,126)||e(t,161,254))&&(o=157*(r-129)+(t-i)),o){case 1133:return[202,772];case 1135:return[202,780];case 1164:return[234,772];case 1166:return[234,780]}var c=null===o?null:v(o,_("big5"));return null===c&&a(t)&&l.prepend(t),null===c?f(n):c}return a(t)?t:e(t,129,254)?(u=t,null):f(n)}}function R(l){l.fatal;this.handler=function(l,n){if(n===J)return V;if(H(n))return n;var u=w(n);if(null===u)return s(n);var e=K(u/157)+129;if(e<161)return s(n);var t=u%157;return[e,t+(t<63?64:98)]}}function T(l){var n=l.fatal,u=!1,t=0;this.handler=function(l,r){if(r===J&&0!==t)return t=0,f(n);if(r===J&&0===t)return V;if(142===t&&e(r,161,223))return t=0,65216+r;if(143===t&&e(r,161,254))return u=!0,t=r,null;if(0!==t){var o=t;t=0;var i=null;return e(o,161,254)&&e(r,161,254)&&(i=v(94*(o-161)+(r-161),_(u?"jis0212":"jis0208"))),u=!1,e(r,161,254)||l.prepend(r),null===i?f(n):i}return a(r)?r:142===r||143===r||e(r,161,254)?(t=r,null):f(n)}}function I(l){l.fatal;this.handler=function(l,n){if(n===J)return V;if(H(n))return n;if(165===n)return 92;if(8254===n)return 126;if(e(n,65377,65439))return[142,n-65377+161];8722===n&&(n=65293);var u=y(n,_("jis0208"));return null===u?s(n):[K(u/94)+161,u%94+161]}}function M(l){var n=l.fatal,u={ASCII:0,Roman:1,Katakana:2,LeadByte:3,TrailByte:4,EscapeStart:5,Escape:6},t=u.ASCII,r=u.ASCII,o=0,i=!1;this.handler=function(l,a){switch(t){default:case u.ASCII:return 27===a?(t=u.EscapeStart,null):e(a,0,127)&&14!==a&&15!==a&&27!==a?(i=!1,a):a===J?V:(i=!1,f(n));case u.Roman:return 27===a?(t=u.EscapeStart,null):92===a?(i=!1,165):126===a?(i=!1,8254):e(a,0,127)&&14!==a&&15!==a&&27!==a&&92!==a&&126!==a?(i=!1,a):a===J?V:(i=!1,f(n));case u.Katakana:return 27===a?(t=u.EscapeStart,null):e(a,33,95)?(i=!1,65344+a):a===J?V:(i=!1,f(n));case u.LeadByte:return 27===a?(t=u.EscapeStart,null):e(a,33,126)?(i=!1,o=a,t=u.TrailByte,null):a===J?V:(i=!1,f(n));case u.TrailByte:if(27===a)return t=u.EscapeStart,f(n);if(e(a,33,126)){t=u.LeadByte;var c=94*(o-33)+a-33,s=v(c,_("jis0208"));return null===s?f(n):s}return a===J?(t=u.LeadByte,l.prepend(a),f(n)):(t=u.LeadByte,f(n));case u.EscapeStart:return 36===a||40===a?(o=a,t=u.Escape,null):(l.prepend(a),i=!1,t=r,f(n));case u.Escape:var p=o;o=0;var h=null;if(40===p&&66===a&&(h=u.ASCII),40===p&&74===a&&(h=u.Roman),40===p&&73===a&&(h=u.Katakana),36!==p||64!==a&&66!==a||(h=u.LeadByte),null!==h){t=t=h;var d=i;return i=!0,d?f(n):null}return l.prepend([p,a]),i=!1,t=r,f(n)}}}function B(l){var n=(l.fatal,{ASCII:0,Roman:1,jis0208:2}),u=n.ASCII;this.handler=function(l,e){if(e===J&&u!==n.ASCII)return l.prepend(e),u=n.ASCII,[27,40,66];if(e===J&&u===n.ASCII)return V;if(!(u!==n.ASCII&&u!==n.Roman||14!==e&&15!==e&&27!==e))return s(65533);if(u===n.ASCII&&H(e))return e;if(u===n.Roman&&(H(e)&&92!==e&&126!==e||165==e||8254==e)){if(H(e))return e;if(165===e)return 92;if(8254===e)return 126}if(H(e)&&u!==n.ASCII)return l.prepend(e),u=n.ASCII,[27,40,66];if((165===e||8254===e)&&u!==n.Roman)return l.prepend(e),u=n.Roman,[27,40,74];8722===e&&(e=65293);var t=y(e,_("jis0208"));return null===t?s(e):u!==n.jis0208?(l.prepend(e),u=n.jis0208,[27,36,66]):[K(t/94)+33,t%94+33]}}function U(l){var n=l.fatal,u=0;this.handler=function(l,t){if(t===J&&0!==u)return u=0,f(n);if(t===J&&0===u)return V;if(0!==u){var r=u,o=null;u=0;var i=t<127?64:65,c=r<160?129:193;if((e(t,64,126)||e(t,128,252))&&(o=188*(r-c)+t-i),e(o,8836,10715))return 48508+o;var s=null===o?null:v(o,_("jis0208"));return null===s&&a(t)&&l.prepend(t),null===s?f(n):s}return a(t)||128===t?t:e(t,161,223)?65216+t:e(t,129,159)||e(t,224,252)?(u=t,null):f(n)}}function z(l){l.fatal;this.handler=function(l,n){if(n===J)return V;if(H(n)||128===n)return n;if(165===n)return 92;if(8254===n)return 126;if(e(n,65377,65439))return n-65377+161;8722===n&&(n=65293);var u=m(n);if(null===u)return s(n);var t=K(u/188),r=t<31?129:193,o=u%188;return[t+r,o+(o<63?64:65)]}}function L(l){var n=l.fatal,u=0;this.handler=function(l,t){if(t===J&&0!==u)return u=0,f(n);if(t===J&&0===u)return V;if(0!==u){var r=u,o=null;u=0,e(t,65,254)&&(o=190*(r-129)+(t-65));var i=null===o?null:v(o,_("euc-kr"));return null===o&&a(t)&&l.prepend(t),null===i?f(n):i}return a(t)?t:e(t,129,254)?(u=t,null):f(n)}}function q(l){l.fatal;this.handler=function(l,n){if(n===J)return V;if(H(n))return n;var u=y(n,_("euc-kr"));return null===u?s(n):[K(u/190)+129,u%190+65]}}function N(l,n){var u=l>>8,e=255&l;return n?[u,e]:[e,u]}function F(l,n){var u=n.fatal,t=null,r=null;this.handler=function(n,o){if(o===J&&(null!==t||null!==r))return f(u);if(o===J&&null===t&&null===r)return V;if(null===t)return t=o,null;var i;if(i=l?(t<<8)+o:(o<<8)+t,t=null,null!==r){var a=r;return r=null,e(i,56320,57343)?65536+1024*(a-55296)+(i-56320):(n.prepend(N(i,l)),f(u))}return e(i,55296,56319)?(r=i,null):e(i,56320,57343)?f(u):i}}function D(l,n){n.fatal;this.handler=function(n,u){if(u===J)return V;if(e(u,0,65535))return N(u,l);var t=N(55296+(u-65536>>10),l),r=N(56320+(u-65536&1023),l);return t.concat(r)}}function W(l){l.fatal;this.handler=function(l,n){return n===J?V:a(n)?n:63360+n-128}}function $(l){l.fatal;this.handler=function(l,n){return n===J?V:H(n)?n:e(n,63360,63487)?n-63360+128:s(n)}}void 0!==l&&l.exports&&!n["encoding-indexes"]&&(n["encoding-indexes"]=u(56)["encoding-indexes"]);var K=Math.floor,H=a,J=-1;c.prototype={endOfStream:function(){return!this.tokens.length},read:function(){return this.tokens.length?this.tokens.pop():J},prepend:function(l){if(Array.isArray(l))for(var n=l;n.length;)this.tokens.push(n.pop());else this.tokens.push(l)},push:function(l){if(Array.isArray(l))for(var n=l;n.length;)this.tokens.unshift(n.shift());else this.tokens.unshift(l)}};var V=-1;p.prototype={handler:function(l,n){}},h.prototype={handler:function(l,n){}};var G=[{encodings:[{labels:["unicode-1-1-utf-8","utf-8","utf8"],name:"UTF-8"}],heading:"The Encoding"},{encodings:[{labels:["866","cp866","csibm866","ibm866"],name:"IBM866"},{labels:["csisolatin2","iso-8859-2","iso-ir-101","iso8859-2","iso88592","iso_8859-2","iso_8859-2:1987","l2","latin2"],name:"ISO-8859-2"},{labels:["csisolatin3","iso-8859-3","iso-ir-109","iso8859-3","iso88593","iso_8859-3","iso_8859-3:1988","l3","latin3"],name:"ISO-8859-3"},{labels:["csisolatin4","iso-8859-4","iso-ir-110","iso8859-4","iso88594","iso_8859-4","iso_8859-4:1988","l4","latin4"],name:"ISO-8859-4"},{labels:["csisolatincyrillic","cyrillic","iso-8859-5","iso-ir-144","iso8859-5","iso88595","iso_8859-5","iso_8859-5:1988"],name:"ISO-8859-5"},{labels:["arabic","asmo-708","csiso88596e","csiso88596i","csisolatinarabic","ecma-114","iso-8859-6","iso-8859-6-e","iso-8859-6-i","iso-ir-127","iso8859-6","iso88596","iso_8859-6","iso_8859-6:1987"],name:"ISO-8859-6"},{labels:["csisolatingreek","ecma-118","elot_928","greek","greek8","iso-8859-7","iso-ir-126","iso8859-7","iso88597","iso_8859-7","iso_8859-7:1987","sun_eu_greek"],name:"ISO-8859-7"},{labels:["csiso88598e","csisolatinhebrew","hebrew","iso-8859-8","iso-8859-8-e","iso-ir-138","iso8859-8","iso88598","iso_8859-8","iso_8859-8:1988","visual"],name:"ISO-8859-8"},{labels:["csiso88598i","iso-8859-8-i","logical"],name:"ISO-8859-8-I"},{labels:["csisolatin6","iso-8859-10","iso-ir-157","iso8859-10","iso885910","l6","latin6"],name:"ISO-8859-10"},{labels:["iso-8859-13","iso8859-13","iso885913"],name:"ISO-8859-13"},{labels:["iso-8859-14","iso8859-14","iso885914"],name:"ISO-8859-14"},{labels:["csisolatin9","iso-8859-15","iso8859-15","iso885915","iso_8859-15","l9"],name:"ISO-8859-15"},{labels:["iso-8859-16"],name:"ISO-8859-16"},{labels:["cskoi8r","koi","koi8","koi8-r","koi8_r"],name:"KOI8-R"},{labels:["koi8-ru","koi8-u"],name:"KOI8-U"},{labels:["csmacintosh","mac","macintosh","x-mac-roman"],name:"macintosh"},{labels:["dos-874","iso-8859-11","iso8859-11","iso885911","tis-620","windows-874"],name:"windows-874"},{labels:["cp1250","windows-1250","x-cp1250"],name:"windows-1250"},{labels:["cp1251","windows-1251","x-cp1251"],name:"windows-1251"},{labels:["ansi_x3.4-1968","ascii","cp1252","cp819","csisolatin1","ibm819","iso-8859-1","iso-ir-100","iso8859-1","iso88591","iso_8859-1","iso_8859-1:1987","l1","latin1","us-ascii","windows-1252","x-cp1252"],name:"windows-1252"},{labels:["cp1253","windows-1253","x-cp1253"],name:"windows-1253"},{labels:["cp1254","csisolatin5","iso-8859-9","iso-ir-148","iso8859-9","iso88599","iso_8859-9","iso_8859-9:1989","l5","latin5","windows-1254","x-cp1254"],name:"windows-1254"},{labels:["cp1255","windows-1255","x-cp1255"],name:"windows-1255"},{labels:["cp1256","windows-1256","x-cp1256"],name:"windows-1256"},{labels:["cp1257","windows-1257","x-cp1257"],name:"windows-1257"},{labels:["cp1258","windows-1258","x-cp1258"],name:"windows-1258"},{labels:["x-mac-cyrillic","x-mac-ukrainian"],name:"x-mac-cyrillic"}],heading:"Legacy single-byte encodings"},{encodings:[{labels:["chinese","csgb2312","csiso58gb231280","gb2312","gb_2312","gb_2312-80","gbk","iso-ir-58","x-gbk"],name:"GBK"},{labels:["gb18030"],name:"gb18030"}],heading:"Legacy multi-byte Chinese (simplified) encodings"},{encodings:[{labels:["big5","big5-hkscs","cn-big5","csbig5","x-x-big5"],name:"Big5"}],heading:"Legacy multi-byte Chinese (traditional) encodings"},{encodings:[{labels:["cseucpkdfmtjapanese","euc-jp","x-euc-jp"],name:"EUC-JP"},{labels:["csiso2022jp","iso-2022-jp"],name:"ISO-2022-JP"},{labels:["csshiftjis","ms932","ms_kanji","shift-jis","shift_jis","sjis","windows-31j","x-sjis"],name:"Shift_JIS"}],heading:"Legacy multi-byte Japanese encodings"},{encodings:[{labels:["cseuckr","csksc56011987","euc-kr","iso-ir-149","korean","ks_c_5601-1987","ks_c_5601-1989","ksc5601","ksc_5601","windows-949"],name:"EUC-KR"}],heading:"Legacy multi-byte Korean encodings"},{encodings:[{labels:["csiso2022kr","hz-gb-2312","iso-2022-cn","iso-2022-cn-ext","iso-2022-kr"],name:"replacement"},{labels:["utf-16be"],name:"UTF-16BE"},{labels:["utf-16","utf-16le"],name:"UTF-16LE"},{labels:["x-user-defined"],name:"x-user-defined"}],heading:"Legacy miscellaneous encodings"}],Z={};G.forEach(function(l){l.encodings.forEach(function(l){l.labels.forEach(function(n){Z[n]=l})})});var Y,Q,X={},ll={},nl="utf-8";Object.defineProperty&&(Object.defineProperty(j.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),Object.defineProperty(j.prototype,"fatal",{get:function(){return"fatal"===this._error_mode}}),Object.defineProperty(j.prototype,"ignoreBOM",{get:function(){return this._ignoreBOM}})),j.prototype.decode=function(l,n){function u(l){return!t(["UTF-8","UTF-16LE","UTF-16BE"],this._encoding.name)||this._ignoreBOM||this._BOMseen||(l.length>0&&65279===l[0]?(this._BOMseen=!0,l.shift()):l.length>0&&(this._BOMseen=!0)),i(l)}var e;e="object"==typeof l&&l instanceof ArrayBuffer?new Uint8Array(l):"object"==typeof l&&"buffer"in l&&l.buffer instanceof ArrayBuffer?new Uint8Array(l.buffer,l.byteOffset,l.byteLength):new Uint8Array(0),n=r(n),this._do_not_flush||(this._decoder=ll[this._encoding.name]({fatal:"fatal"===this._error_mode}),this._BOMseen=!1),this._do_not_flush=Boolean(n.stream);for(var o,a=new c(e),f=[];;){var s=a.read();if(s===J)break;if((o=this._decoder.handler(a,s))===V)break;null!==o&&(Array.isArray(o)?f.push.apply(f,o):f.push(o))}if(!this._do_not_flush){do{if((o=this._decoder.handler(a,a.read()))===V)break;null!==o&&(Array.isArray(o)?f.push.apply(f,o):f.push(o))}while(!a.endOfStream());this._decoder=null}return u.call(this,f)},Object.defineProperty&&Object.defineProperty(O.prototype,"encoding",{get:function(){return this._encoding.name.toLowerCase()}}),O.prototype.encode=function(l,n){l=void 0===l?"":String(l),n=r(n),this._do_not_flush||(this._encoder=X[this._encoding.name]({fatal:"fatal"===this._fatal})),this._do_not_flush=Boolean(n.stream);for(var u,e=new c(o(l)),t=[];;){var i=e.read();if(i===J)break;if((u=this._encoder.handler(e,i))===V)break;Array.isArray(u)?t.push.apply(t,u):t.push(u)}if(!this._do_not_flush){for(;;){if((u=this._encoder.handler(e,e.read()))===V)break;Array.isArray(u)?t.push.apply(t,u):t.push(u)}this._encoder=null}return new Uint8Array(t)},X["UTF-8"]=function(l){return new E(l)},ll["UTF-8"]=function(l){return new k(l)},function(){"encoding-indexes"in n&&G.forEach(function(l){"Legacy single-byte encodings"===l.heading&&l.encodings.forEach(function(l){var n=l.name,u=_(n.toLowerCase());ll[n]=function(l){return new x(u,l)},X[n]=function(l){return new P(u,l)}})})}(),ll.GBK=function(l){return new A(l)},X.GBK=function(l){return new C(l,!0)},X.gb18030=function(l){return new C(l)},ll.gb18030=function(l){return new A(l)},X.Big5=function(l){return new R(l)},ll.Big5=function(l){return new S(l)},X["EUC-JP"]=function(l){return new I(l)},ll["EUC-JP"]=function(l){return new T(l)},X["ISO-2022-JP"]=function(l){return new B(l)},ll["ISO-2022-JP"]=function(l){return new M(l)},X.Shift_JIS=function(l){return new z(l)},ll.Shift_JIS=function(l){return new U(l)},X["EUC-KR"]=function(l){return new q(l)},ll["EUC-KR"]=function(l){return new L(l)},X["UTF-16BE"]=function(l){return new D(!0,l)},ll["UTF-16BE"]=function(l){return new F(!0,l)},X["UTF-16LE"]=function(l){return new D(!1,l)},ll["UTF-16LE"]=function(l){return new F(!1,l)},X["x-user-defined"]=function(l){return new $(l)},ll["x-user-defined"]=function(l){return new W(l)},n.TextEncoder||(n.TextEncoder=O),n.TextDecoder||(n.TextDecoder=j),void 0!==l&&l.exports&&(l.exports={TextEncoder:n.TextEncoder,TextDecoder:n.TextDecoder,EncodingIndexes:n["encoding-indexes"]})}(this||{})}]);
\ No newline at end of file
diff --git a/dist/core/errors/otp-required.js b/dist/core/errors/otp-required.js
index 919841f..0366e6e 100644
--- a/dist/core/errors/otp-required.js
+++ b/dist/core/errors/otp-required.js
@@ -7,6 +7,8 @@ exports.OTPRequiredError = undefined;
var _base = require('./base');
+var _lodash = require('lodash');
+
class OTPRequiredError extends _base.BaseError {
static hasError() {
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -17,7 +19,7 @@ class OTPRequiredError extends _base.BaseError {
return false;
}
- return headers['otp-token'].toUpperCase() === 'REQUIRED';
+ return (0, _lodash.includes)(['OPTIONAL', 'REQUIRED'], headers['otp-token'].toUpperCase());
}
constructor() {
diff --git a/dist/core/sdk.js b/dist/core/sdk.js
index 981baf1..2de4bef 100644
--- a/dist/core/sdk.js
+++ b/dist/core/sdk.js
@@ -16,6 +16,8 @@ var _services = require('./services');
var _utils = require('./utils');
+var _lodash = require('lodash');
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
class SDK {
@@ -36,7 +38,9 @@ class SDK {
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'
};
@@ -142,9 +146,14 @@ class SDK {
}
setToken(token) {
+ let headers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
+
return this.storage.setItem(this.options.accessTokenKey, token.access_token).then(() => {
+ this.storage.setItem(this.options.scope, (0, _lodash.get)(token, 'scope', ''));
+ this.storage.setItem(this.options.otpTokenStatus, (0, _lodash.get)(headers, 'otp-token', ''));
+
if (token.refresh_token) {
- return this.storage.setItem(this.options.refreshTokenKey, token.refresh_token);
+ this.storage.setItem(this.options.refreshTokenKey, token.refresh_token);
}
}).then(() => token);
}
@@ -155,8 +164,9 @@ class SDK {
url = _ref.url;
return this.client.request(url, 'post', body, headers).then((_ref2) => {
- let body = _ref2.body;
- return this.setToken(body);
+ let body = _ref2.body,
+ headers = _ref2.headers;
+ return this.setToken(body, headers);
});
}
diff --git a/dist/core/utils/request-helper.js b/dist/core/utils/request-helper.js
index 451398d..f943c62 100644
--- a/dist/core/utils/request-helper.js
+++ b/dist/core/utils/request-helper.js
@@ -47,7 +47,7 @@ function normalizeURI(uri) {
function buildUrl(uri, baseUrl, version, queryParams) {
// Check if the `uri` is actually an url.
- if (new RegExp(/^http(s?)\:\/\//).test(uri)) {
+ if (new RegExp(/^http(s?):\/\//).test(uri)) {
return uri;
}
diff --git a/package.json b/package.json
index e0358b0..589856a 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "@uphold/uphold-sdk-javascript",
- "version": "2.3.0",
+ "version": "2.4.0",
"description": "Uphold SDK for JavasScript",
"keywords": [
"api",