wealthica-sdk-js
Version:
Official Wealthica JS SDK for the Browser & NodeJS
1 lines • 869 kB
JavaScript
(()=>{var __webpack_modules__={31732(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,i=(n=r(86425))&&"object"==typeof n&&"default"in n?n.default:n,o=function(){return(o=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},a=function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function a(t){try{u(n.next(t))}catch(t){o(t)}}function s(t){try{u(n.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(a,s)}u((n=n.apply(t,e||[])).next())})},s=function(t,e){var r,n,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=(i=a.trys).length>0&&i[i.length-1])&&(6===s[0]||2===s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}},u=function(t){return t instanceof Date?t.getTime():"number"==typeof t||null==t?t:Number(t)},f=function(t,e,r){return r>=t&&r<=e},c=function(t){return!!t&&("object"==typeof t||"function"==typeof t)&&"function"==typeof t.then},h={Accept:"application/json","Content-Type":"application/json"},l={timeout:0},d=null,p="CLIENT_ERROR",b="SERVER_ERROR",v="TIMEOUT_ERROR",y="CONNECTION_ERROR",g="NETWORK_ERROR",m="UNKNOWN_ERROR",w="CANCEL_ERROR",_=["ECONNABORTED"],S=["ENOTFOUND","ECONNREFUSED","ECONNRESET"],E=["ERR_BAD_REQUEST","ERR_BAD_RESPONSE"],M=function(t){return f(200,299,t)},x=function(t){return"Network Error"===t.message?g:i.isCancel(t)?w:t.code?E.includes(t.code)?A(t.response.status):_.includes(t.code)?v:S.includes(t.code)?y:m:A(t.response?t.response.status:null)},A=function(t){return t?M(t)?d:function(t){return f(400,499,t)}(t)?p:function(t){return f(500,599,t)}(t)?b:m:m},R=function(t){var e,r=o(o({},h),t.headers||{});if(t.axiosInstance)e=t.axiosInstance;else{var n=o(o({},t),{headers:void 0}),f=o(o({},l),n);e=i.create(f)}var d=[],p=[],b=[],v=[],y=[],g=function(t,n){return r[t]=n,e},m=function(t){return function(e,r,n){return void 0===r&&(r={}),void 0===n&&(n={}),_(o(o({},n),{url:e,params:r,method:t}))}},w=function(t){return function(e,r,n){return void 0===n&&(n={}),_(o(o({},n),{url:e,method:t,data:r}))}},_=function(t){return a(void 0,void 0,void 0,function(){var n,i,f,h;return s(this,function(l){switch(l.label){case 0:if(t.headers=o(o({},r),t.headers),p.length>0&&p.forEach(function(e){return e(t)}),!(b.length>0))return[3,6];n=0,l.label=1;case 1:return n<b.length?(i=b[n](t),c(i)?[4,i]:[3,3]):[3,6];case 2:return l.sent(),[3,5];case 3:return[4,i(t)];case 4:l.sent(),l.label=5;case 5:return n++,[3,1];case 6:return f=u(new Date),h=function(t){return a(void 0,void 0,void 0,function(){var e;return s(this,function(r){switch(r.label){case 0:return[4,E(f,t)];case 1:return e=r.sent(),[2,S(e)]}})})},[2,e.request(t).then(h).catch(h)]}})})},S=function(t){return d.forEach(function(e){try{e(t)}catch(t){}}),t},E=function(t,e){return a(void 0,void 0,void 0,function(){var r,n,o,a,f,h,l,d,p,b,g,m,w,_,S,E,R;return s(this,function(s){switch(s.label){case 0:if(r=u(new Date),n=r-t,o=e instanceof Error||i.isCancel(e),a=e,f=e,h=o?f.response:a,l=h&&h.status||null,d=o?x(e):A(l),p=o?f:null,b=M(l),g=e.config||null,m=h&&h.headers||null,w=null!==(R=h&&h.data)&&void 0!==R?R:null,_={duration:n,problem:d,originalError:p,ok:b,status:l,headers:m,config:g,data:w},v.length>0&&v.forEach(function(t){return t(_)}),!(y.length>0))return[3,6];S=0,s.label=1;case 1:return S<y.length?(E=y[S](_),c(E)?[4,E]:[3,3]):[3,6];case 2:return s.sent(),[3,5];case 3:return[4,E(_)];case 4:s.sent(),s.label=5;case 5:return S++,[3,1];case 6:return[2,_]}})})};return{axiosInstance:e,monitors:d,addMonitor:function(t){d.push(t)},requestTransforms:p,asyncRequestTransforms:b,responseTransforms:v,asyncResponseTransforms:y,addRequestTransform:function(t){return p.push(t)},addAsyncRequestTransform:function(t){return b.push(t)},addResponseTransform:function(t){return v.push(t)},addAsyncResponseTransform:function(t){return y.push(t)},setHeader:g,setHeaders:function(t){return Object.keys(t).forEach(function(e){return g(e,t[e])}),e},deleteHeader:function(t){return delete r[t],e},headers:r,setBaseURL:function(t){return e.defaults.baseURL=t,e},getBaseURL:function(){return e.defaults.baseURL},any:_,get:m("get"),delete:m("delete"),head:m("head"),post:w("post"),put:w("put"),patch:w("patch"),link:m("link"),unlink:m("unlink")}},k=i.isCancel,O=i.CancelToken,T={DEFAULT_HEADERS:h,NONE:d,CLIENT_ERROR:p,SERVER_ERROR:b,TIMEOUT_ERROR:v,CONNECTION_ERROR:y,NETWORK_ERROR:g,UNKNOWN_ERROR:m,create:R,isCancel:k,CancelToken:O};e.DEFAULT_HEADERS=h,e.NONE=d,e.CLIENT_ERROR=p,e.SERVER_ERROR=b,e.TIMEOUT_ERROR=v,e.CONNECTION_ERROR=y,e.NETWORK_ERROR=g,e.UNKNOWN_ERROR=m,e.CANCEL_ERROR=w,e.getProblemFromError=x,e.getProblemFromStatus=A,e.create=R,e.isCancel=k,e.CancelToken=O,e.default=T},87568(t,e,r){var n=e;n.bignum=r(39404),n.define=r(47363).define,n.base=r(9673),n.constants=r(22153),n.decoders=r(22853),n.encoders=r(24669)},47363(t,e,r){var n=r(87568),i=r(56698);function o(t,e){this.name=t,this.body=e,this.decoders={},this.encoders={}}e.define=function(t,e){return new o(t,e)},o.prototype._createNamed=function(t){var e;try{e=r(68961).runInThisContext("(function "+this.name+"(entity) {\n this._initNamed(entity);\n})")}catch(t){e=function(t){this._initNamed(t)}}return i(e,t),e.prototype._initNamed=function(e){t.call(this,e)},new e(this)},o.prototype._getDecoder=function(t){return t=t||"der",this.decoders.hasOwnProperty(t)||(this.decoders[t]=this._createNamed(n.decoders[t])),this.decoders[t]},o.prototype.decode=function(t,e,r){return this._getDecoder(e).decode(t,r)},o.prototype._getEncoder=function(t){return t=t||"der",this.encoders.hasOwnProperty(t)||(this.encoders[t]=this._createNamed(n.encoders[t])),this.encoders[t]},o.prototype.encode=function(t,e,r){return this._getEncoder(e).encode(t,r)}},47227(t,e,r){var n=r(56698),i=r(9673).Reporter,o=r(48287).Buffer;function a(t,e){i.call(this,e),o.isBuffer(t)?(this.base=t,this.offset=0,this.length=t.length):this.error("Input not Buffer")}function s(t,e){if(Array.isArray(t))this.length=0,this.value=t.map(function(t){return t instanceof s||(t=new s(t,e)),this.length+=t.length,t},this);else if("number"==typeof t){if(!(0<=t&&t<=255))return e.error("non-byte EncoderBuffer value");this.value=t,this.length=1}else if("string"==typeof t)this.value=t,this.length=o.byteLength(t);else{if(!o.isBuffer(t))return e.error("Unsupported type: "+typeof t);this.value=t,this.length=t.length}}n(a,i),e.t=a,a.prototype.save=function(){return{offset:this.offset,reporter:i.prototype.save.call(this)}},a.prototype.restore=function(t){var e=new a(this.base);return e.offset=t.offset,e.length=this.offset,this.offset=t.offset,i.prototype.restore.call(this,t.reporter),e},a.prototype.isEmpty=function(){return this.offset===this.length},a.prototype.readUInt8=function(t){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(t||"DecoderBuffer overrun")},a.prototype.skip=function(t,e){if(!(this.offset+t<=this.length))return this.error(e||"DecoderBuffer overrun");var r=new a(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+t,this.offset+=t,r},a.prototype.raw=function(t){return this.base.slice(t?t.offset:this.offset,this.length)},e.d=s,s.prototype.join=function(t,e){return t||(t=new o(this.length)),e||(e=0),0===this.length||(Array.isArray(this.value)?this.value.forEach(function(r){r.join(t,e),e+=r.length}):("number"==typeof this.value?t[e]=this.value:"string"==typeof this.value?t.write(this.value,e):o.isBuffer(this.value)&&this.value.copy(t,e),e+=this.length)),t}},9673(t,e,r){var n=e;n.Reporter=r(89220).a,n.DecoderBuffer=r(47227).t,n.EncoderBuffer=r(47227).d,n.Node=r(90993)},90993(t,e,r){var n=r(9673).Reporter,i=r(9673).EncoderBuffer,o=r(9673).DecoderBuffer,a=r(43349),s=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],u=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(s);function f(t,e){var r={};this._baseState=r,r.enc=t,r.parent=e||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}t.exports=f;var c=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];f.prototype.clone=function(){var t=this._baseState,e={};c.forEach(function(r){e[r]=t[r]});var r=new this.constructor(e.parent);return r._baseState=e,r},f.prototype._wrap=function(){var t=this._baseState;u.forEach(function(e){this[e]=function(){var r=new this.constructor(this);return t.children.push(r),r[e].apply(r,arguments)}},this)},f.prototype._init=function(t){var e=this._baseState;a(null===e.parent),t.call(this),e.children=e.children.filter(function(t){return t._baseState.parent===this},this),a.equal(e.children.length,1,"Root node can have only one child")},f.prototype._useArgs=function(t){var e=this._baseState,r=t.filter(function(t){return t instanceof this.constructor},this);t=t.filter(function(t){return!(t instanceof this.constructor)},this),0!==r.length&&(a(null===e.children),e.children=r,r.forEach(function(t){t._baseState.parent=this},this)),0!==t.length&&(a(null===e.args),e.args=t,e.reverseArgs=t.map(function(t){if("object"!=typeof t||t.constructor!==Object)return t;var e={};return Object.keys(t).forEach(function(r){r==(0|r)&&(r|=0);var n=t[r];e[n]=r}),e}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(t){f.prototype[t]=function(){var e=this._baseState;throw new Error(t+" not implemented for encoding: "+e.enc)}}),s.forEach(function(t){f.prototype[t]=function(){var e=this._baseState,r=Array.prototype.slice.call(arguments);return a(null===e.tag),e.tag=t,this._useArgs(r),this}}),f.prototype.use=function(t){a(t);var e=this._baseState;return a(null===e.use),e.use=t,this},f.prototype.optional=function(){return this._baseState.optional=!0,this},f.prototype.def=function(t){var e=this._baseState;return a(null===e.default),e.default=t,e.optional=!0,this},f.prototype.explicit=function(t){var e=this._baseState;return a(null===e.explicit&&null===e.implicit),e.explicit=t,this},f.prototype.implicit=function(t){var e=this._baseState;return a(null===e.explicit&&null===e.implicit),e.implicit=t,this},f.prototype.obj=function(){var t=this._baseState,e=Array.prototype.slice.call(arguments);return t.obj=!0,0!==e.length&&this._useArgs(e),this},f.prototype.key=function(t){var e=this._baseState;return a(null===e.key),e.key=t,this},f.prototype.any=function(){return this._baseState.any=!0,this},f.prototype.choice=function(t){var e=this._baseState;return a(null===e.choice),e.choice=t,this._useArgs(Object.keys(t).map(function(e){return t[e]})),this},f.prototype.contains=function(t){var e=this._baseState;return a(null===e.use),e.contains=t,this},f.prototype._decode=function(t,e){var r=this._baseState;if(null===r.parent)return t.wrapResult(r.children[0]._decode(t,e));var n,i=r.default,a=!0,s=null;if(null!==r.key&&(s=t.enterKey(r.key)),r.optional){var u=null;if(null!==r.explicit?u=r.explicit:null!==r.implicit?u=r.implicit:null!==r.tag&&(u=r.tag),null!==u||r.any){if(a=this._peekTag(t,u,r.any),t.isError(a))return a}else{var f=t.save();try{null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e),a=!0}catch(t){a=!1}t.restore(f)}}if(r.obj&&a&&(n=t.enterObject()),a){if(null!==r.explicit){var c=this._decodeTag(t,r.explicit);if(t.isError(c))return c;t=c}var h=t.offset;if(null===r.use&&null===r.choice){if(r.any)f=t.save();var l=this._decodeTag(t,null!==r.implicit?r.implicit:r.tag,r.any);if(t.isError(l))return l;r.any?i=t.raw(f):t=l}if(e&&e.track&&null!==r.tag&&e.track(t.path(),h,t.length,"tagged"),e&&e.track&&null!==r.tag&&e.track(t.path(),t.offset,t.length,"content"),r.any||(i=null===r.choice?this._decodeGeneric(r.tag,t,e):this._decodeChoice(t,e)),t.isError(i))return i;if(r.any||null!==r.choice||null===r.children||r.children.forEach(function(r){r._decode(t,e)}),r.contains&&("octstr"===r.tag||"bitstr"===r.tag)){var d=new o(i);i=this._getUse(r.contains,t._reporterState.obj)._decode(d,e)}}return r.obj&&a&&(i=t.leaveObject(n)),null===r.key||null===i&&!0!==a?null!==s&&t.exitKey(s):t.leaveKey(s,r.key,i),i},f.prototype._decodeGeneric=function(t,e,r){var n=this._baseState;return"seq"===t||"set"===t?null:"seqof"===t||"setof"===t?this._decodeList(e,t,n.args[0],r):/str$/.test(t)?this._decodeStr(e,t,r):"objid"===t&&n.args?this._decodeObjid(e,n.args[0],n.args[1],r):"objid"===t?this._decodeObjid(e,null,null,r):"gentime"===t||"utctime"===t?this._decodeTime(e,t,r):"null_"===t?this._decodeNull(e,r):"bool"===t?this._decodeBool(e,r):"objDesc"===t?this._decodeStr(e,t,r):"int"===t||"enum"===t?this._decodeInt(e,n.args&&n.args[0],r):null!==n.use?this._getUse(n.use,e._reporterState.obj)._decode(e,r):e.error("unknown tag: "+t)},f.prototype._getUse=function(t,e){var r=this._baseState;return r.useDecoder=this._use(t,e),a(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},f.prototype._decodeChoice=function(t,e){var r=this._baseState,n=null,i=!1;return Object.keys(r.choice).some(function(o){var a=t.save(),s=r.choice[o];try{var u=s._decode(t,e);if(t.isError(u))return!1;n={type:o,value:u},i=!0}catch(e){return t.restore(a),!1}return!0},this),i?n:t.error("Choice not matched")},f.prototype._createEncoderBuffer=function(t){return new i(t,this.reporter)},f.prototype._encode=function(t,e,r){var n=this._baseState;if(null===n.default||n.default!==t){var i=this._encodeValue(t,e,r);if(void 0!==i&&!this._skipDefault(i,e,r))return i}},f.prototype._encodeValue=function(t,e,r){var i=this._baseState;if(null===i.parent)return i.children[0]._encode(t,e||new n);var o=null;if(this.reporter=e,i.optional&&void 0===t){if(null===i.default)return;t=i.default}var a=null,s=!1;if(i.any)o=this._createEncoderBuffer(t);else if(i.choice)o=this._encodeChoice(t,e);else if(i.contains)a=this._getUse(i.contains,r)._encode(t,e),s=!0;else if(i.children)a=i.children.map(function(r){if("null_"===r._baseState.tag)return r._encode(null,e,t);if(null===r._baseState.key)return e.error("Child should have a key");var n=e.enterKey(r._baseState.key);if("object"!=typeof t)return e.error("Child expected, but input is not object");var i=r._encode(t[r._baseState.key],e,t);return e.leaveKey(n),i},this).filter(function(t){return t}),a=this._createEncoderBuffer(a);else if("seqof"===i.tag||"setof"===i.tag){if(!i.args||1!==i.args.length)return e.error("Too many args for : "+i.tag);if(!Array.isArray(t))return e.error("seqof/setof, but data is not Array");var u=this.clone();u._baseState.implicit=null,a=this._createEncoderBuffer(t.map(function(r){var n=this._baseState;return this._getUse(n.args[0],t)._encode(r,e)},u))}else null!==i.use?o=this._getUse(i.use,r)._encode(t,e):(a=this._encodePrimitive(i.tag,t),s=!0);if(!i.any&&null===i.choice){var f=null!==i.implicit?i.implicit:i.tag,c=null===i.implicit?"universal":"context";null===f?null===i.use&&e.error("Tag could be omitted only for .use()"):null===i.use&&(o=this._encodeComposite(f,s,c,a))}return null!==i.explicit&&(o=this._encodeComposite(i.explicit,!1,"context",o)),o},f.prototype._encodeChoice=function(t,e){var r=this._baseState,n=r.choice[t.type];return n||a(!1,t.type+" not found in "+JSON.stringify(Object.keys(r.choice))),n._encode(t.value,e)},f.prototype._encodePrimitive=function(t,e){var r=this._baseState;if(/str$/.test(t))return this._encodeStr(e,t);if("objid"===t&&r.args)return this._encodeObjid(e,r.reverseArgs[0],r.args[1]);if("objid"===t)return this._encodeObjid(e,null,null);if("gentime"===t||"utctime"===t)return this._encodeTime(e,t);if("null_"===t)return this._encodeNull();if("int"===t||"enum"===t)return this._encodeInt(e,r.args&&r.reverseArgs[0]);if("bool"===t)return this._encodeBool(e);if("objDesc"===t)return this._encodeStr(e,t);throw new Error("Unsupported tag: "+t)},f.prototype._isNumstr=function(t){return/^[0-9 ]*$/.test(t)},f.prototype._isPrintstr=function(t){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(t)}},89220(t,e,r){var n=r(56698);function i(t){this._reporterState={obj:null,path:[],options:t||{},errors:[]}}function o(t,e){this.path=t,this.rethrow(e)}e.a=i,i.prototype.isError=function(t){return t instanceof o},i.prototype.save=function(){var t=this._reporterState;return{obj:t.obj,pathLen:t.path.length}},i.prototype.restore=function(t){var e=this._reporterState;e.obj=t.obj,e.path=e.path.slice(0,t.pathLen)},i.prototype.enterKey=function(t){return this._reporterState.path.push(t)},i.prototype.exitKey=function(t){var e=this._reporterState;e.path=e.path.slice(0,t-1)},i.prototype.leaveKey=function(t,e,r){var n=this._reporterState;this.exitKey(t),null!==n.obj&&(n.obj[e]=r)},i.prototype.path=function(){return this._reporterState.path.join("/")},i.prototype.enterObject=function(){var t=this._reporterState,e=t.obj;return t.obj={},e},i.prototype.leaveObject=function(t){var e=this._reporterState,r=e.obj;return e.obj=t,r},i.prototype.error=function(t){var e,r=this._reporterState,n=t instanceof o;if(e=n?t:new o(r.path.map(function(t){return"["+JSON.stringify(t)+"]"}).join(""),t.message||t,t.stack),!r.options.partial)throw e;return n||r.errors.push(e),e},i.prototype.wrapResult=function(t){var e=this._reporterState;return e.options.partial?{result:this.isError(t)?null:t,errors:e.errors}:t},n(o,Error),o.prototype.rethrow=function(t){if(this.message=t+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(t){this.stack=t.stack}return this}},74598(t,e,r){var n=r(22153);e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=n._reverse(e.tagClass),e.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},e.tagByName=n._reverse(e.tag)},22153(t,e,r){var n=e;n._reverse=function(t){var e={};return Object.keys(t).forEach(function(r){(0|r)==r&&(r|=0);var n=t[r];e[n]=r}),e},n.der=r(74598)},39629(t,e,r){var n=r(56698),i=r(87568),o=i.base,a=i.bignum,s=i.constants.der;function u(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new f,this.tree._init(t.body)}function f(t){o.Node.call(this,"der",t)}function c(t,e){var r=t.readUInt8(e);if(t.isError(r))return r;var n=s.tagClass[r>>6],i=!(32&r);if(31&~r)r&=31;else{var o=r;for(r=0;!(128&~o);){if(o=t.readUInt8(e),t.isError(o))return o;r<<=7,r|=127&o}}return{cls:n,primitive:i,tag:r,tagStr:s.tag[r]}}function h(t,e,r){var n=t.readUInt8(r);if(t.isError(n))return n;if(!e&&128===n)return null;if(!(128&n))return n;var i=127&n;if(i>4)return t.error("length octect is too long");n=0;for(var o=0;o<i;o++){n<<=8;var a=t.readUInt8(r);if(t.isError(a))return a;n|=a}return n}t.exports=u,u.prototype.decode=function(t,e){return t instanceof o.DecoderBuffer||(t=new o.DecoderBuffer(t,e)),this.tree._decode(t,e)},n(f,o.Node),f.prototype._peekTag=function(t,e,r){if(t.isEmpty())return!1;var n=t.save(),i=c(t,'Failed to peek tag: "'+e+'"');return t.isError(i)?i:(t.restore(n),i.tag===e||i.tagStr===e||i.tagStr+"of"===e||r)},f.prototype._decodeTag=function(t,e,r){var n=c(t,'Failed to decode tag of "'+e+'"');if(t.isError(n))return n;var i=h(t,n.primitive,'Failed to get length of "'+e+'"');if(t.isError(i))return i;if(!r&&n.tag!==e&&n.tagStr!==e&&n.tagStr+"of"!==e)return t.error('Failed to match tag: "'+e+'"');if(n.primitive||null!==i)return t.skip(i,'Failed to match body of: "'+e+'"');var o=t.save(),a=this._skipUntilEnd(t,'Failed to skip indefinite length body: "'+this.tag+'"');return t.isError(a)?a:(i=t.offset-o.offset,t.restore(o),t.skip(i,'Failed to match body of: "'+e+'"'))},f.prototype._skipUntilEnd=function(t,e){for(;;){var r=c(t,e);if(t.isError(r))return r;var n,i=h(t,r.primitive,e);if(t.isError(i))return i;if(n=r.primitive||null!==i?t.skip(i):this._skipUntilEnd(t,e),t.isError(n))return n;if("end"===r.tagStr)break}},f.prototype._decodeList=function(t,e,r,n){for(var i=[];!t.isEmpty();){var o=this._peekTag(t,"end");if(t.isError(o))return o;var a=r.decode(t,"der",n);if(t.isError(a)&&o)break;i.push(a)}return i},f.prototype._decodeStr=function(t,e){if("bitstr"===e){var r=t.readUInt8();return t.isError(r)?r:{unused:r,data:t.raw()}}if("bmpstr"===e){var n=t.raw();if(n.length%2==1)return t.error("Decoding of string type: bmpstr length mismatch");for(var i="",o=0;o<n.length/2;o++)i+=String.fromCharCode(n.readUInt16BE(2*o));return i}if("numstr"===e){var a=t.raw().toString("ascii");return this._isNumstr(a)?a:t.error("Decoding of string type: numstr unsupported characters")}if("octstr"===e)return t.raw();if("objDesc"===e)return t.raw();if("printstr"===e){var s=t.raw().toString("ascii");return this._isPrintstr(s)?s:t.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(e)?t.raw().toString():t.error("Decoding of string type: "+e+" unsupported")},f.prototype._decodeObjid=function(t,e,r){for(var n,i=[],o=0;!t.isEmpty();){var a=t.readUInt8();o<<=7,o|=127&a,128&a||(i.push(o),o=0)}128&a&&i.push(o);var s=i[0]/40|0,u=i[0]%40;if(n=r?i:[s,u].concat(i.slice(1)),e){var f=e[n.join(" ")];void 0===f&&(f=e[n.join(".")]),void 0!==f&&(n=f)}return n},f.prototype._decodeTime=function(t,e){var r=t.raw().toString();if("gentime"===e)var n=0|r.slice(0,4),i=0|r.slice(4,6),o=0|r.slice(6,8),a=0|r.slice(8,10),s=0|r.slice(10,12),u=0|r.slice(12,14);else{if("utctime"!==e)return t.error("Decoding "+e+" time is not supported yet");n=0|r.slice(0,2),i=0|r.slice(2,4),o=0|r.slice(4,6),a=0|r.slice(6,8),s=0|r.slice(8,10),u=0|r.slice(10,12);n=n<70?2e3+n:1900+n}return Date.UTC(n,i-1,o,a,s,u,0)},f.prototype._decodeNull=function(t){return null},f.prototype._decodeBool=function(t){var e=t.readUInt8();return t.isError(e)?e:0!==e},f.prototype._decodeInt=function(t,e){var r=t.raw(),n=new a(r);return e&&(n=e[n.toString(10)]||n),n},f.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getDecoder("der").tree}},22853(t,e,r){var n=e;n.der=r(39629),n.pem=r(58903)},58903(t,e,r){var n=r(56698),i=r(48287).Buffer,o=r(39629);function a(t){o.call(this,t),this.enc="pem"}n(a,o),t.exports=a,a.prototype.decode=function(t,e){for(var r=t.toString().split(/[\r\n]+/g),n=e.label.toUpperCase(),a=/^-----(BEGIN|END) ([^-]+)-----$/,s=-1,u=-1,f=0;f<r.length;f++){var c=r[f].match(a);if(null!==c&&c[2]===n){if(-1!==s){if("END"!==c[1])break;u=f;break}if("BEGIN"!==c[1])break;s=f}}if(-1===s||-1===u)throw new Error("PEM section not found for: "+n);var h=r.slice(s+1,u).join("");h.replace(/[^a-z0-9\+\/=]+/gi,"");var l=new i(h,"base64");return o.prototype.decode.call(this,l,e)}},70082(t,e,r){var n=r(56698),i=r(48287).Buffer,o=r(87568),a=o.base,s=o.constants.der;function u(t){this.enc="der",this.name=t.name,this.entity=t,this.tree=new f,this.tree._init(t.body)}function f(t){a.Node.call(this,"der",t)}function c(t){return t<10?"0"+t:t}t.exports=u,u.prototype.encode=function(t,e){return this.tree._encode(t,e).join()},n(f,a.Node),f.prototype._encodeComposite=function(t,e,r,n){var o,a=function(t,e,r,n){var i;"seqof"===t?t="seq":"setof"===t&&(t="set");if(s.tagByName.hasOwnProperty(t))i=s.tagByName[t];else{if("number"!=typeof t||(0|t)!==t)return n.error("Unknown tag: "+t);i=t}if(i>=31)return n.error("Multi-octet tag encoding unsupported");e||(i|=32);return i|=s.tagClassByName[r||"universal"]<<6,i}(t,e,r,this.reporter);if(n.length<128)return(o=new i(2))[0]=a,o[1]=n.length,this._createEncoderBuffer([o,n]);for(var u=1,f=n.length;f>=256;f>>=8)u++;(o=new i(2+u))[0]=a,o[1]=128|u;f=1+u;for(var c=n.length;c>0;f--,c>>=8)o[f]=255&c;return this._createEncoderBuffer([o,n])},f.prototype._encodeStr=function(t,e){if("bitstr"===e)return this._createEncoderBuffer([0|t.unused,t.data]);if("bmpstr"===e){for(var r=new i(2*t.length),n=0;n<t.length;n++)r.writeUInt16BE(t.charCodeAt(n),2*n);return this._createEncoderBuffer(r)}return"numstr"===e?this._isNumstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===e?this._isPrintstr(t)?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(e)||"objDesc"===e?this._createEncoderBuffer(t):this.reporter.error("Encoding of string type: "+e+" unsupported")},f.prototype._encodeObjid=function(t,e,r){if("string"==typeof t){if(!e)return this.reporter.error("string objid given, but no values map found");if(!e.hasOwnProperty(t))return this.reporter.error("objid not found in values map");t=e[t].split(/[\s\.]+/g);for(var n=0;n<t.length;n++)t[n]|=0}else if(Array.isArray(t)){t=t.slice();for(n=0;n<t.length;n++)t[n]|=0}if(!Array.isArray(t))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(t));if(!r){if(t[1]>=40)return this.reporter.error("Second objid identifier OOB");t.splice(0,2,40*t[0]+t[1])}var o=0;for(n=0;n<t.length;n++){var a=t[n];for(o++;a>=128;a>>=7)o++}var s=new i(o),u=s.length-1;for(n=t.length-1;n>=0;n--){a=t[n];for(s[u--]=127&a;(a>>=7)>0;)s[u--]=128|127&a}return this._createEncoderBuffer(s)},f.prototype._encodeTime=function(t,e){var r,n=new Date(t);return"gentime"===e?r=[c(n.getFullYear()),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):"utctime"===e?r=[c(n.getFullYear()%100),c(n.getUTCMonth()+1),c(n.getUTCDate()),c(n.getUTCHours()),c(n.getUTCMinutes()),c(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(r,"octstr")},f.prototype._encodeNull=function(){return this._createEncoderBuffer("")},f.prototype._encodeInt=function(t,e){if("string"==typeof t){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(t))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(t));t=e[t]}if("number"!=typeof t&&!i.isBuffer(t)){var r=t.toArray();!t.sign&&128&r[0]&&r.unshift(0),t=new i(r)}if(i.isBuffer(t)){var n=t.length;0===t.length&&n++;var o=new i(n);return t.copy(o),0===t.length&&(o[0]=0),this._createEncoderBuffer(o)}if(t<128)return this._createEncoderBuffer(t);if(t<256)return this._createEncoderBuffer([0,t]);n=1;for(var a=t;a>=256;a>>=8)n++;for(a=(o=new Array(n)).length-1;a>=0;a--)o[a]=255&t,t>>=8;return 128&o[0]&&o.unshift(0),this._createEncoderBuffer(new i(o))},f.prototype._encodeBool=function(t){return this._createEncoderBuffer(t?255:0)},f.prototype._use=function(t,e){return"function"==typeof t&&(t=t(e)),t._getEncoder("der").tree},f.prototype._skipDefault=function(t,e,r){var n,i=this._baseState;if(null===i.default)return!1;var o=t.join();if(void 0===i.defaultBuffer&&(i.defaultBuffer=this._encodeValue(i.default,e,r).join()),o.length!==i.defaultBuffer.length)return!1;for(n=0;n<o.length;n++)if(o[n]!==i.defaultBuffer[n])return!1;return!0}},24669(t,e,r){var n=e;n.der=r(70082),n.pem=r(90735)},90735(t,e,r){var n=r(56698),i=r(70082);function o(t){i.call(this,t),this.enc="pem"}n(o,i),t.exports=o,o.prototype.encode=function(t,e){for(var r=i.prototype.encode.call(this,t).toString("base64"),n=["-----BEGIN "+e.label+"-----"],o=0;o<r.length;o+=64)n.push(r.slice(o,o+64));return n.push("-----END "+e.label+"-----"),n.join("\n")}},73049(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,i,a){var s=n&&n.prototype instanceof f?n:f,c=Object.create(s.prototype);return o(c,"_invoke",function(r,n,i){var o,a,s,f=0,c=i||[],h=!1,l={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return o=e,a=0,s=t,l.n=r,u}};function d(r,n){for(a=r,s=n,e=0;!h&&f&&!i&&e<c.length;e++){var i,o=c[e],d=l.p,p=o[2];r>3?(i=p===n)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=t):o[0]<=d&&((i=r<2&&d<o[1])?(a=0,l.v=n,l.n=o[1]):d<p&&(i=r<3||o[0]>n||n>p)&&(o[4]=r,o[5]=n,l.n=p,a=0))}if(i||r>1)return u;throw h=!0,n}return function(i,c,p){if(f>1)throw TypeError("Generator is already running");for(h&&1===c&&d(c,p),a=c,s=p;(e=a<2?t:s)||!h;){o||(a?a<3?(a>1&&(l.n=-1),d(a,s)):l.n=s:l.v=s);try{if(f=2,o){if(a||(i="next"),e=o[i]){if(!(e=e.call(o,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=o.return)&&e.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=t}else if((e=(h=l.n<0)?s:r.call(n,l))!==u)break}catch(e){o=t,a=1,s=e}finally{f=1}}return{value:e,done:h}}}(r,i,a),!0),c}var u={};function f(){}function c(){}function h(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(o(e={},n,function(){return this}),e),d=h.prototype=f.prototype=Object.create(l);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,o(t,a,"GeneratorFunction")),t.prototype=Object.create(d),t}return c.prototype=h,o(d,"constructor",h),o(h,"constructor",c),c.displayName="GeneratorFunction",o(h,a,"GeneratorFunction"),o(d),o(d,a,"Generator"),o(d,n,function(){return this}),o(d,"toString",function(){return"[object Generator]"}),(i=function(){return{w:s,m:p}})()}function o(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}o=function(t,e,r,n){function a(e,r){o(t,e,function(t){return this._invoke(e,r,t)})}e?i?i(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(a("next",0),a("throw",1),a("return",2))},o(t,e,r,n)}function a(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function s(t){return function(){var e=this,r=arguments;return new Promise(function(n,i){var o=t.apply(e,r);function s(t){a(o,n,i,s,u,"next",t)}function u(t){a(o,n,i,s,u,"throw",t)}s(void 0)})}}function u(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function f(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?u(Object(r),!0).forEach(function(e){c(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function c(t,e,r){return(e=l(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function h(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,l(n.key),n)}}function l(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==n(e)?e:e+""}var d=r(31732).create,p=r(44040),b=r(3832),v=b.API_URL,y=b.CONNECT_URL,g=r(31951),m=r(65948),w=m.isBrowser,_=m.isNode,S=m.isReactNative,E=m.appendWealthicaIframe,M=m.appendWealthicaForm,x="_onConnection",A="_onError",R="_onEvent",k=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.config=f({},e),this.config.baseURL=this.config.baseURL||v,this.config.connectURL=this.config.connectURL||y;var r=this.config,n=r.clientId,i=r.secret;if(this.isBrowser=w(),this.isNode=_(),this.isReactNative=S(),this.isClient=this.isBrowser||this.isReactNative,!n||"string"!=typeof n)throw new Error("Please provide a valid Wealthica clientId.");if(!(this.isClient||i&&"string"==typeof i))throw new Error("Please provide a valid Wealthica secret.");if(this.isClient){var o=e.auth||{};this.config.authEndpoint=this.config.authEndpoint||"/wealthica/auth",this.config.auth={params:o.params||{},headers:o.headers||{}},this.authApi=d({headers:this.config.auth.headers})}this._token={},this._onWidgetMessage=this._onMessage.bind(this),this._widgetOpened=!1,this._widgetActive=!1,this._features=null}return e=t,r=[{key:"_init",value:function(){var t=this.config,e=t.loginName,r=t.baseURL;this.api=d({baseURL:r});var n=g(this,["providers","teams"]);return Object.assign(this,n),e?this.login(e):this}},{key:"login",value:function(e){if(!(this.isClient||e&&"string"==typeof e))throw new Error("Please provide a valid loginName.");var r=this.config.baseURL,n=new t(f(f({},this.config),{},{loginName:null}));n._init(),n.userApi=d({baseURL:r}),n.userApi.addAsyncRequestTransform(function(){var t=s(i().m(function t(e){var r;return i().w(function(t){for(;;)switch(t.n){case 0:return r="Bearer ",t.n=1,n.getToken();case 1:return e.headers.Authorization=r.concat.call(r,t.v),t.a(2,e)}},t)}));return function(e){return t.apply(this,arguments)}}());var o=g(n,["institutions","history","transactions","positions"]);return Object.assign(n,o),n.config.loginName=e,n}},{key:"getToken",value:(c=s(i().m(function t(){var e,r,n,o,a=arguments;return i().w(function(t){for(;;)switch(t.n){case 0:if(e=a.length>0&&void 0!==a[0]?a[0]:{},r=(new Date).valueOf(),n=this._token.payload,o=this._token.token,n&&!(r>1e3*(n.exp-(e.minimumLifetime||10)))){t.n=2;break}return t.n=1,this.fetchToken();case 1:o=t.v;case 2:return t.a(2,o)}},t,this)})),function(){return c.apply(this,arguments)})},{key:"fetchToken",value:(u=s(i().m(function t(){var e,r,n,o;return i().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,this.isClient?this._fetchTokenClient():this._fetchTokenNode();case 1:if((e=t.v).ok||e.token){t.n=2;break}throw e.originalError;case 2:return r=e.data||e,n=r.token,o=p.decode(n),this._token={token:n,payload:o},t.a(2,this._token.token)}},t,this)})),function(){return u.apply(this,arguments)})},{key:"_fetchTokenNode",value:function(){var t=this.config,e=t.clientId,r=t.secret,n=t.loginName;return this.api.post("/auth/token",{clientId:e,secret:r},{headers:{loginName:n}})}},{key:"_fetchTokenClient",value:function(){var t=this.config,e=t.auth,r=t.authEndpoint,i=t.authorizer,o=e.params;return"function"==typeof i?new Promise(function(t,e){i(function(r,i){r?e(r):i&&"object"===n(i)&&i.token?t(i):e(new Error('Invalid authorizer result. Expecting `{ token: "the token" }`.'))})}):this.authApi.post(r,o)}},{key:"getTeam",value:function(){return this.teams.info()}},{key:"getConnectData",value:(a=s(i().m(function t(){var e,r,n,o,a,s,u,f,c,h,l,d,p,b,v,y,g,m,w,_,S,E,M,x,A,R,k=arguments;return i().w(function(t){for(;;)switch(t.p=t.n){case 0:if(r=(e=k.length>0&&void 0!==k[0]?k[0]:{}).provider,n=e.institutionId,o=e.connectionRoute,a=e.state,s=e.origin,u=void 0===s?this.isBrowser?window.location.origin:void 0:s,f=e.lang,c=e.redirectURI,h=void 0===c?this.config.redirectURI:c,l=e.providers,d=e.disabledProviders,p=e.providerGroups,b=void 0===p?["core"]:p,v=e.theme,y=e.providersPerLine,g=e.features,m=e.webhookURI,w=this.config,_=w.clientId,S=w.connectURL,!m){t.n=4;break}if(t.p=1,"https:"===new URL(m).protocol){t.n=2;break}throw new Error("Webhook URI must use HTTPS protocol");case 2:t.n=4;break;case 3:throw t.p=3,R=t.v,new Error("Invalid webhook URI: ".concat(R.message));case 4:return t.n=5,this.getToken({minimumLifetime:600});case 5:return E=t.v,M={client_id:_,redirect_uri:h,state:a,lang:f||"en",origin:u,providers:!r&&Array.isArray(l)&&l.length?l.join(","):void 0,disabled_providers:d&&Array.isArray(d)&&d.length?d.join(","):void 0,provider_groups:b.join(","),theme:["light","dark"].includes(v)?v:"light",providers_per_line:y&&["1","2"].includes(y.toString())?y.toString():"2",features:g,webhook_uri:m},Object.keys(M).forEach(function(t){return[void 0,null,""].includes(M[t])&&delete M[t]}),x=new URLSearchParams(M).toString(),A=r?"".concat(S,"/connect/").concat(r):"".concat(S,"/connect"),n&&"verify-mfa"===o?A="".concat(S,"/verify-mfa/").concat(n):n&&(A="".concat(S,"/reconnect/").concat(n)),t.a(2,{url:"".concat(A,"?").concat(x),token:E})}},t,this,[[1,3]])})),function(){return a.apply(this,arguments)})},{key:"connect",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this._connect(t),this}},{key:"reconnect",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t||"string"!=typeof t)throw new Error("Please provide a valid institutionId.");return this._connect(f({institutionId:t},e)),this}},{key:"verifyMfa",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t||"string"!=typeof t)throw new Error("Please provide a valid institutionId.");return this._connect(f({institutionId:t,connectionRoute:"verify-mfa"},e)),this}},{key:"onConnection",value:function(t){if("function"!=typeof t)throw new Error("Callback must be a function.");return this[x]=t.bind(this),this}},{key:"onError",value:function(t){if("function"!=typeof t)throw new Error("Callback must be a function.");return this[A]=t.bind(this),this}},{key:"onEvent",value:function(t){if("function"!=typeof t)throw new Error("Callback must be a function.");return this[R]=t.bind(this),this}},{key:"_connect",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.isBrowser)throw new Error("Only supported in Browser.");s(i().m(function r(){var n,o,a,s,u,f,c,h,l,d,p,b,v,y,g,m,w;return i().w(function(r){for(;;)switch(r.p=r.n){case 0:return r.p=0,t._widgetOpened=!0,n=e.provider,o=e.providers,a=e.disabledProviders,s=e.providerGroups,u=e.institutionId,f=e.connectionRoute,c=e.lang,h=e.theme,l=e.providersPerLine,d=e.features,p=e.connectionType,b=e.origin,v=e.webhookURI,t._features=d,r.n=1,t.getConnectData({provider:n,providers:o,disabledProviders:a,providerGroups:s,institutionId:u,connectionRoute:f,lang:c,theme:h,providersPerLine:l,features:d,origin:b,webhookURI:v});case 1:y=r.v,g=y.url,m=y.token,t.iframe=E(),"GET"===p?t.widget=window.open("".concat(g,"&token=").concat(m),t.iframe.name):(t.widget=window.open("",t.iframe.name),t.form=M({url:g,token:m,iframe:t.iframe}),t.form.submit()),t.widget.focus(),t._widgetActive=!0,t._addListeners(),t._addWatchers(),r.n=3;break;case 2:r.p=2,w=r.v,t._closeWidgetWithError(500,w.message||"Connection refused");case 3:return r.a(2)}},r,null,[[0,2]])}))()}},{key:"_onMessage",value:function(t){var e=t.origin,r=t.data,n=r;try{n=JSON.parse(r)}catch(t){}if(n.wealthica){if(e!==this.config.connectURL&&!/\.wealthica\.com$/.test(new URL(e).hostname))throw new Error("Calling Wealthica from unauthorized origin ".concat(e));switch(n.event){case"success":this._triggerCallback(x,{institution:n.institution,provider:n.provider});break;case"error":this._triggerCallback(A,{error:n.error});break;case"close":this._closeWidgetWithError(400,"Connection closed");break;default:this._triggerCallback(R,n)}}}},{key:"_addWatchers",value:function(){var t=this,e=this._features&&this._features.split(",").map(function(t){return t.trim()}).includes("quick_retry"),r=setTimeout(function(){t._closeWidgetWithError(400,"Connection timeout")},60*(e?30:10)*1e3),n=setInterval(function(){t._widgetActive?t.widget.closed&&t._closeWidgetWithError(400,"Connection closed"):(t._removeListeners(),clearInterval(n),clearTimeout(r),t._closeWidget())},1e3)}},{key:"_closeWidgetWithError",value:function(t,e){this._closeWidget(),this._triggerCallback(A,{error:{error_type:t,message:e}})}},{key:"_closeWidget",value:function(){this._widgetActive=!1,this.widget&&!this.widget.closed&&this.widget.close(),this.iframe&&this.iframe.remove(),this.form&&this.form.remove()}},{key:"_triggerCallback",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if([x,A].includes(t)){this._widgetActive=!1;var r=null;this._widgetOpened&&(this._widgetOpened=!1,t===x&&(r={provider:e.provider}),this[t]&&this[t](e.institution||e.error,r))}else t===R&&this[t]&&this[t](e.event,e.data)}},{key:"_addListeners",value:function(){window.addEventListener("message",this._onWidgetMessage,!1)}},{key:"_removeListeners",value:function(){window.removeEventListener("message",this._onWidgetMessage,!1)}}],r&&h(e.prototype,r),o&&h(e,o),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,r,o,a,u,c}();t.exports=k},3832(t){var e="https://api.wealthica.com",r="".concat(e,"/").concat("v1");t.exports={BASE_API_URL:e,CONNECT_URL:"https://connect.wealthica.com",API_VERSION:"v1",API_URL:r}},44497(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,o(n.key),n)}}function o(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==n(e)?e:e+""}r(84315),r(7452);var a=r(73049),s=function(){return t=function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t)},e=[{key:"init",value:function(){return new a(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{})._init()}}],e&&i(t.prototype,e),r&&i(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r}();t.exports=new s},33043(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,i,a){var s=n&&n.prototype instanceof f?n:f,c=Object.create(s.prototype);return o(c,"_invoke",function(r,n,i){var o,a,s,f=0,c=i||[],h=!1,l={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return o=e,a=0,s=t,l.n=r,u}};function d(r,n){for(a=r,s=n,e=0;!h&&f&&!i&&e<c.length;e++){var i,o=c[e],d=l.p,p=o[2];r>3?(i=p===n)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=t):o[0]<=d&&((i=r<2&&d<o[1])?(a=0,l.v=n,l.n=o[1]):d<p&&(i=r<3||o[0]>n||n>p)&&(o[4]=r,o[5]=n,l.n=p,a=0))}if(i||r>1)return u;throw h=!0,n}return function(i,c,p){if(f>1)throw TypeError("Generator is already running");for(h&&1===c&&d(c,p),a=c,s=p;(e=a<2?t:s)||!h;){o||(a?a<3?(a>1&&(l.n=-1),d(a,s)):l.n=s:l.v=s);try{if(f=2,o){if(a||(i="next"),e=o[i]){if(!(e=e.call(o,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=o.return)&&e.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=t}else if((e=(h=l.n<0)?s:r.call(n,l))!==u)break}catch(e){o=t,a=1,s=e}finally{f=1}}return{value:e,done:h}}}(r,i,a),!0),c}var u={};function f(){}function c(){}function h(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(o(e={},n,function(){return this}),e),d=h.prototype=f.prototype=Object.create(l);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,o(t,a,"GeneratorFunction")),t.prototype=Object.create(d),t}return c.prototype=h,o(d,"constructor",h),o(h,"constructor",c),c.displayName="GeneratorFunction",o(h,a,"GeneratorFunction"),o(d),o(d,a,"Generator"),o(d,n,function(){return this}),o(d,"toString",function(){return"[object Generator]"}),(i=function(){return{w:s,m:p}})()}function o(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}o=function(t,e,r,n){function a(e,r){o(t,e,function(t){return this._invoke(e,r,t)})}e?i?i(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(a("next",0),a("throw",1),a("return",2))},o(t,e,r,n)}function a(t,e,r,n,i,o,a){try{var s=t[o](a),u=s.value}catch(t){return void r(t)}s.done?e(u):Promise.resolve(u).then(n,i)}function s(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u(n.key),n)}}function u(t){var e=function(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==n(e)?e:e+""}var f=r(65948).getQueryString,c=function(){return t=function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.api=e.userApi},e=[{key:"getList",value:(n=i().m(function t(){var e,r,n,o=arguments;return i().w(function(t){for(;;)switch(t.n){case 0:return e="/history",(r=f(o.length>0&&void 0!==o[0]?o[0]:{}))&&(e="".concat(e,"?").concat(r)),t.n=1,this.api.get(e);case 1:if((n=t.v).ok){t.n=2;break}throw n.originalError;case 2:return t.a(2,n.data)}},t,this)}),o=function(){var t=this,e=arguments;return new Promise(function(r,i){var o=n.apply(t,e);function s(t){a(o,r,i,s,u,"next",t)}function u(t){a(o,r,i,s,u,"throw",t)}s(void 0)})},function(){return o.apply(this,arguments)})}],e&&s(t.prototype,e),r&&s(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,e,r,n,o}();t.exports=c},31951(t,e,r){var n={institutions:r(14228),history:r(33043),providers:r(44153),teams:r(90517),transactions:r(15158),positions:r(12011)};t.exports=function(t,e){return e.reduce(function(e,r){return e[r]=new n[r](t),e},{})}},14228(t,e,r){function n(t){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,i,a){var s=n&&n.prototype instanceof f?n:f,c=Object.create(s.prototype);return o(c,"_invoke",function(r,n,i){var o,a,s,f=0,c=i||[],h=!1,l={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return o=e,a=0,s=t,l.n=r,u}};function d(r,n){for(a=r,s=n,e=0;!h&&f&&!i&&e<c.length;e++){var i,o=c[e],d=l.p,p=o[2];r>3?(i=p===n)&&(s=o[(a=o[4])?5:(a=3,3)],o[4]=o[5]=t):o[0]<=d&&((i=r<2&&d<o[1])?(a=0,l.v=n,l.n=o[1]):d<p&&(i=r<3||o[0]>n||n>p)&&(o[4]=r,o[5]=n,l.n=p,a=0))}if(i||r>1)return u;throw h=!0,n}return function(i,c,p){if(f>1)throw TypeError("Generator is already running");for(h&&1===c&&d(c,p),a=c,s=p;(e=a<2?t:s)||!h;){o||(a?a<3?(a>1&&(l.n=-1),d(a,s)):l.n=s:l.v=s);try{if(f=2,o){if(a||(i="next"),e=o[i]){if(!(e=e.call(o,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=o.return)&&e.call(o),a<2&&(s=TypeError("The iterator does not provide a '"+i+"' method"),a=1);o=t}else if((e=(h=l.n<0)?s:r.call(n,l))!==u)break}catch(e){o=t,a=1,s=e}finally{f=1}}return{value:e,done:h}}}(r,i,a),!0),c}var u={};function f(){}function c(){}function h(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(o(e={},n,function(){return this}),e),d=h.prototype=f.prototype=Object.create(l);function p(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,h):(t.__proto__=h,o(t,a,"GeneratorFunction")),t.prototype=Object.create(d),t}return c.prototype=h,o(d,"constructor",h),o(h,"constructor",c),c.displayName="GeneratorFunction",o(h,a,"GeneratorFunction"),o(d),o(d,a,"Generator"),o(d,n,function(){return this}),o(d,"toString",function(){return"[object Generator]"}),(i=function(){return{w:s,m:p}})()}function o(t,e,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}o=function(t,e,r,n){function a(e,r){o(t,e,function(t){return this._invoke(e,r,t)})}e?i?i(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(a("next",0),a("thr