var Moov;(()=>{"use strict";var e,t,o={},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var r=n[e]={exports:{}};return o[e](r,r.exports,i),r.exports}i.m=o,i.d=(e,t)=>{for(var o in t)i.o(t,o)&&!i.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},i.f={},i.e=e=>Promise.all(Object.keys(i.f).reduce(((t,o)=>(i.f[o](e,t),t)),[])),i.u=e=>e+".moov.js",i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),e={},t="Moov:",i.l=(o,n,r,a)=>{if(e[o])e[o].push(n);else{var s,c;if(void 0!==r)for(var d=document.getElementsByTagName("script"),u=0;u<d.length;u++){var l=d[u];if(l.getAttribute("src")==o||l.getAttribute("data-webpack")==t+r){s=l;break}}s||(c=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,i.nc&&s.setAttribute("nonce",i.nc),s.setAttribute("data-webpack",t+r),s.src=o),e[o]=[n];var p=(t,n)=>{s.onerror=s.onload=null,clearTimeout(h);var i=e[o];if(delete e[o],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach((e=>e(n))),t)return t(n)},h=setTimeout(p.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=p.bind(null,s.onerror),s.onload=p.bind(null,s.onload),c&&document.head.appendChild(s)}},i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;i.g.importScripts&&(e=i.g.location+"");var t=i.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var o=t.getElementsByTagName("script");o.length&&(e=o[o.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),i.p=e})(),(()=>{var e={179:0};i.f.j=(t,o)=>{var n=i.o(e,t)?e[t]:void 0;if(0!==n)if(n)o.push(n[2]);else{var r=new Promise(((o,i)=>n=e[t]=[o,i]));o.push(n[2]=r);var a=i.p+i.u(t),s=new Error;i.l(a,(o=>{if(i.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var r=o&&("load"===o.type?"missing":o.type),a=o&&o.target&&o.target.src;s.message="Loading chunk "+t+" failed.\n("+r+": "+a+")",s.name="ChunkLoadError",s.type=r,s.request=a,n[1](s)}}),"chunk-"+t,t)}};var t=(t,o)=>{var n,r,[a,s,c]=o,d=0;if(a.some((t=>0!==e[t]))){for(n in s)i.o(s,n)&&(i.m[n]=s[n]);c&&c(i)}for(t&&t(o);d<a.length;d++)r=a[d],i.o(e,r)&&e[r]&&e[r][0](),e[r]=0},o=self.webpackChunkMoov=self.webpackChunkMoov||[];o.forEach(t.bind(null,0)),o.push=t.bind(null,o.push.bind(o))})();var r={};(()=>{function e(e){return Promise.reject({error:e})}i.d(r,{default:()=>Se});const t="Please provide an accountID",o="Please provide an accountID or a foreignID",n="Please provide an account",a="Please provide a representative",s="Please provide a representativeID",c="Please provide a firstName and lastName for the representative",d="Please provide an address",u="Please provide amounts.",l="Please provide a bank account id.",p="Please provide a payment method id.",h="Please provide a capability id.",v="Please provide a capabilities list as an array of string.",m="Please initialize Moov.js with a valid Moov access token.",f="Please provide an email address.",w="Please provide an avatarID.",b="Please provide a bank account number.",y="Please provide a routingNumber.",g="Please provide a holderType.",D="Please provide a holderName.",I="Please provide a bankAccountType of 'checking' or 'savings'.",k="Routing number must be 9 digits.",P="Please provide a walletID.",E="Please provide a transactionID.",O="Please provide a bankAccount, plaidToken, or mxAuthorizationCode.",T="Please provide a file object.",M="Please provide an account underwriting object.",S="Please provide a file purpose.",$="Please provide a file id.";function L(o){return{link:({accountID:n,bankAccount:i,plaidToken:r,mxAuthorizationCode:a})=>{let s={};if(!n)return e(t);if(!i&&!r&&!a)return e(O);if(i){if(!i.accountNumber)return e(b);if(!i.routingNumber)return e(y);if(9!==i.routingNumber.length)return e(k);if(!i.holderName)return e(D);if(!i.holderType)return e(g);if(!i.bankAccountType||!["checking","savings"].includes(i.bankAccountType))return e(I);s={account:i}}else r?s={plaid:{token:r}}:a&&(s={mx:{authorizationCode:a}});return o(`/accounts/${n}/bank-accounts`,{method:"POST",body:s})},list:({accountID:n})=>n?o(`/accounts/${n}/bank-accounts`,{method:"GET"}):e(t),get:({accountID:n,bankAccountID:i})=>n?i?o(`/accounts/${n}/bank-accounts/${i}`,{method:"GET"}):e(l):e(t),delete:({accountID:n,bankAccountID:i})=>n?i?o(`/accounts/${n}/bank-accounts/${i}`,{method:"DELETE"}):e(l):e(t),startMicroDepositVerification:({accountID:n,bankAccountID:i})=>n?i?o(`/accounts/${n}/bank-accounts/${i}/micro-deposits`,{method:"POST"}):e(l):e(t),completeMicroDepositVerification:({accountID:n,bankAccountID:i,amounts:r})=>n?i?r?o(`/accounts/${n}/bank-accounts/${i}/micro-deposits`,{method:"PUT",body:{amounts:r}}):e(u):e(l):e(t)}}function j(o){return{get:({accountID:n,representativeID:i})=>n?i?o(`/accounts/${n}/representatives/${i}`,{method:"GET"}):e(s):e(t),list:({accountID:n})=>n?o(`/accounts/${n}/representatives`,{method:"GET"}):e(t),create:({accountID:n,representative:i})=>n?i?i.name.firstName&&i.name.lastName?o(`/accounts/${n}/representatives`,{method:"POST",body:i}):e(c):e(a):e(t),update:({accountID:n,representative:i})=>n?i?i.representativeID?i.name.firstName&&i.name.lastName?o(`/accounts/${n}/representatives/${i.representativeID}`,{method:"PUT",body:i}):e(c):e(s):e(a):e(t),delete:({accountID:n,representativeID:i})=>n?i?o(`/accounts/${n}/representatives/${i}`,{method:"DELETE"}):e(s):e(t)}}function C(o){return{get:({accountID:n,paymentMethodID:i})=>n?i?o(`/accounts/${n}/payment-methods/${i}`,{method:"GET"}):e(p):e(t),list:({accountID:n})=>n?o(`/accounts/${n}/payment-methods`,{method:"GET"}):e(t)}}function A(o){return{get:({accountID:n,capabilityID:i})=>n?i?o(`/accounts/${n}/capabilities/${i}`,{method:"GET"}):e(h):e(t),list:({accountID:n})=>n?o(`/accounts/${n}/capabilities`,{method:"GET"}):e(t),request:({accountID:n,capabilities:i})=>n?i&&Array.isArray(i)?o(`/accounts/${n}/capabilities`,{method:"POST",body:{capabilities:i}}):e(v):e(t),unrequest:({accountID:n,capabilityID:i})=>n?i?o(`/accounts/${n}/capabilities/${i}`,{method:"DELETE"}):e(h):e(t)}}const R={count:50,skip:0};function J(o){return{get:({accountID:n,walletID:i})=>n?i?o(`/accounts/${n}/wallets/${i}`):e(P):e(t),list:({accountID:n})=>n?o(`/accounts/${n}/wallets`):e(t),getTransaction:({accountID:n,walletID:i,transactionID:r})=>n?i?r?o(`/accounts/${n}/wallets/${i}/transactions/${r}`):e(E):e(P):e(t),listTransactions:({accountID:n,walletID:i,filter:r})=>{if(!n)return e(t);if(!i)return e(P);r=r||R;const a=new URLSearchParams(r);return o(`/accounts/${n}/wallets/${i}/transactions?${a.toString()}`)}}}function x(o){return{upload:({accountID:n,file:i,filePurpose:r})=>{if(!n)return e(t);if(!i)return e(T);if(!r)return e(S);const a=new FormData;return a.append("file",i),a.append("filePurpose",r),o(`/accounts/${n}/files`,{method:"POST",file:!0,body:a})},list:({accountID:n})=>n?o(`/accounts/${n}/files`,{method:"GET"}):e(t),get:({accountID:n,fileID:i})=>n?i?o(`/accounts/${n}/files/${i}`,{method:"GET"}):e($):e(t)}}function N(o){return{get:({accountID:n})=>n?o(`/accounts/${n}/underwriting`,{method:"GET"}):e(t),update:({accountID:n,underwriting:i})=>n?i?o(`/accounts/${n}/underwriting`,{method:"PUT",body:i}):e(M):e(t)}}const z=o=>({create:({accountID:n,applePaySessionConfig:i})=>n?i?o(`/accounts/${n}/apple-pay/sessions`,{method:"POST",body:Object.assign(Object.assign({},i),{domain:location.host})}):e("Please provide an applePaySessionConfig."):e(t)}),U=o=>({create:({accountID:n,applePayToken:i})=>n?i?o(`/accounts/${n}/apple-pay/tokens`,{method:"POST",body:i}):e("Please provide an applePayToken."):e(t)});var _=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(o[n[i]]=e[n[i]])}return o};function q(i){function r(){return i("/tos-token")}function a(o){let r,a;if(!o)return e(n);try{({accountID:r}=o),a=_(o,["accountID"])}catch(t){return e(n)}return r?i(`/accounts/${r}`,{method:"PATCH",body:a}):e(t)}return{create:t=>t?i("/accounts",{method:"POST",body:t,headers:[["x-wait-for","connection"]]}):e(n),get:({accountID:t,foreignID:n})=>t||n?i(t?`/accounts/${t}`:`/accounts?foreignID=${n}`):e(o),update:o=>o?o.accountID?i(`/accounts/${o.accountID}`,{method:"PUT",body:o}):e(t):e(n),patch:a,getTermsOfServiceToken:r,acceptTermsOfService:({accountID:o})=>o?r().then((e=>e.error?e.error:a({accountID:o,termsOfService:Object.assign({},e)}))):e(t),bankAccounts:Object.assign({},L(i)),wallets:Object.assign({},J(i)),representatives:Object.assign({},j(i)),paymentMethods:Object.assign({},C(i)),capabilities:Object.assign({},A(i)),files:Object.assign({},x(i)),underwriting:Object.assign({},N(i)),applePay:{tokens:Object.assign({},U(i)),sessions:Object.assign({},z(i))}}}const G=["prod","staging","local","mock"];function F(){let e="prod";try{e=window.location.hostname.includes("moov-staging.io")?"staging":"prod"}catch(e){}try{const t=localStorage.getItem("moovEnv")||e;e=G.includes(t)?t:e}catch(e){}return e}const V=F(),B=(e=>{let t="https://951e6386-a35f-48ea-b5fe-504b039564d6.mock.pstmn.io";switch(e){case"staging":t="https://api.moov-staging.io";break;case"local":t="http://local.moov.io/api";break;default:t="https://api.moov.io"}return t})(V),H=e=>{if(e.response)try{return JSON.parse(e.response).error}catch(e){return"API request error"}return"API request error"},K=e=>(t,o={})=>((e,t)=>((e,t={})=>{const o=new XMLHttpRequest,n=t.method||"GET";return new Promise((function(i,r){o.onreadystatechange=function(){4===o.readyState&&(o.status>=200&&o.status<300?i(o.response):r({statusCode:o.status,error:H(o)}))},o.open(n,e,!0),"mock"!==V&&(o.withCredentials=!0),t.headers&&t.headers.length>0&&t.headers.forEach((e=>{o.setRequestHeader(...e)})),t.file?o.send(t.body):t.body?(o.setRequestHeader("Content-Type","application/json"),o.send(JSON.stringify(t.body))):o.send()}))})(B+e,t).then((e=>{try{return JSON.parse(e)}catch(t){return e}})))(t,Object.assign(Object.assign({},o),{headers:[...o.headers?o.headers:[],["Authorization","Bearer "+e]]})),X={success:!1},Q=e=>({lookupByRoutingNumber:(t,o=!1)=>9!==(null==t?void 0:t.length)?Promise.reject({error:"Routing number must be 9 digits"}):e(`/institutions/ach/search?routingNumber=${t}`).then((e=>((e,t)=>{var o,n;return(null===(o=e.achParticipants)||void 0===o?void 0:o.length)>0&&!t?{success:!0,result:e.achParticipants}:1===(null===(n=e.achParticipants)||void 0===n?void 0:n.length)?{success:!0,result:e.achParticipants[0]}:X})(e,o)))}),W=e=>({ping:()=>e("/ping").then((e=>({success:e.ok})))});var Y=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(o[n[i]]=e[n[i]])}return o};function Z(t){return{lookup:({email:o})=>o?t(`/enrichment/profile?email=${o}`):e(f),avatar:({avatarID:o})=>o?t(`/avatars/${o}`):e(w),listIndustries:()=>t("/industries"),lookupAddress:o=>{var{search:n}=o,i=Y(o,["search"]);if(!n)return e(d);const r=Object.entries(Object.assign({search:n},i)),a=new URLSearchParams(r);return t(`/enrichment/address?${a}`)}}}let ee=null;const te=/^https:\/\/cdn\.plaid\.com\/link\/v2\/stable\/link-initialize\.js?(\?.*)?$/,oe=()=>(null!==ee||(ee=((e,t,o="Script",n)=>new Promise(((i,r)=>{if("undefined"==typeof window)return void i(null);const a=n();if(a)i(a);else try{let a=((e,t)=>{const o=document.querySelectorAll(`script[src^="${e}"]`);for(let e=0;e<o.length;e++){const n=o[e];if(t.test(n.src))return n}return null})(e,t);if(a)return console.warn(`${o} already loaded`),void i(n());a=(e=>{const t=document.createElement("script");t.src=e;const o=document.head||document.body;if(!o)throw new Error("Expected document.body not to be null. A <body> element is required for injecting scripts.");return o.appendChild(t),t})(e),a.addEventListener("load",(()=>{const e=n();e?i(e):r(new Error(`${o} not available`))})),a.addEventListener("error",(()=>{r(new Error(`Failed to load ${o}`))}))}catch(e){r(e)}})))("https://cdn.plaid.com/link/v2/stable/link-initialize.js",te,"Plaid Link",(()=>window.Plaid))),ee);var ne=function(e,t){var o={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(o[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(o[n[i]]=e[n[i]])}return o};const ie=e=>{function t(t){var{token:o,accountID:n,env:i="production",onSuccess:r,onEvent:a,onExit:s,onLoad:c,product:d=["auth"]}=t,u=ne(t,["token","accountID","env","onSuccess","onEvent","onExit","onLoad","product"]);if(!n)throw new Error("accountID is required");let l=!1;return new Promise(((t,p)=>{const h=window.Plaid.create(Object.assign({token:o,onLoad:function(){t(h),l=!0,c&&c()},onSuccess:function(t,o){(function({accountID:t,public_token:o}){return e(`/accounts/${t}/bank-accounts`,{method:"POST",body:{plaidLink:{publicToken:o}}})})({public_token:t,accountID:n}).then((e=>r&&r(e))).catch((e=>{a&&a("ERROR",e)}))},onExit:function(e,t){s&&s(e,t),null!=e&&console.error("Plaid error:",e)},onEvent:function(e,t){l||"ERROR"!==e||(p(t),l=!0),a&&a(e,t)},product:d,env:i},u))}))}return{reinitialize:async function(e){var{receivedRedirectUri:o}=e,n=ne(e,["receivedRedirectUri"]);const i=localStorage.getItem("moovPlaidToken");let r,a;if(!i)throw new Error("No token found");try{const e=JSON.parse(i);r=e.accountID,a=e.token}catch(e){throw new Error("Could not parse token data")}try{await oe()}catch(e){throw new Error("Error loading Plaid Link SDK")}const s=window?window.location.href:"",c=await t(Object.assign(Object.assign({receivedRedirectUri:o||s},n),{accountID:r,token:a}));return c.open(),c},initialize:async function(o){var{token:n,elementID:i,accountID:r,redirectURL:a}=o,s=ne(o,["token","elementID","accountID","redirectURL"]);if(!r)throw new Error("accountID is required");try{await oe()}catch(e){throw new Error("Error loading Plaid Link SDK")}n||(n=await function({accountID:t,redirectURL:o}){return e(`/accounts/${t}/plaidtoken`,{method:"POST",body:{redirectURL:o}}).then((e=>e.linkToken))}({accountID:r,redirectURL:a})),localStorage.setItem("moovPlaidToken",JSON.stringify({token:n,accountID:r}));const c=await t(Object.assign(Object.assign({},s),{token:n,accountID:r}));if(i){const e=document.getElementById(i);e?e.addEventListener("click",(function(){c.open()})):console.error(`Element with id="${i}"" not found.`)}return c}}};var re,ae=new Uint8Array(16);function se(){if(!re&&!(re="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return re(ae)}const ce=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var de=[],ue=0;ue<256;++ue)de.push((ue+256).toString(16).substr(1));const le=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=(de[e[t+0]]+de[e[t+1]]+de[e[t+2]]+de[e[t+3]]+"-"+de[e[t+4]]+de[e[t+5]]+"-"+de[e[t+6]]+de[e[t+7]]+"-"+de[e[t+8]]+de[e[t+9]]+"-"+de[e[t+10]]+de[e[t+11]]+de[e[t+12]]+de[e[t+13]]+de[e[t+14]]+de[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&ce.test(e)}(o))throw TypeError("Stringified UUID is invalid");return o},pe=function(e,t,o){var n=(e=e||{}).random||(e.rng||se)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){o=o||0;for(var i=0;i<16;++i)t[o+i]=n[i];return t}return le(n)},he=function(e,t,o="_drop"){t.forEach((t=>{Object.defineProperty(e.prototype,`_${t}`,{writable:!0,value:void 0}),Object.defineProperty(e.prototype,t,{get:function(){return this[`_${t}`]},set:function(e){this[`_${t}`]=e,this[o]&&this[o].render({[t]:e})}})}))},ve=e=>e.replace(/-./g,(e=>e[1].toUpperCase()));class me extends HTMLElement{constructor(){super(),this.handleMoovDropsInitialized=()=>{this.id||(this.id=`moov-card-link-${pe()}`),this.imperativeRef||(this.imperativeRef={current:null});const e={};me.componentProps.forEach((t=>{t in this&&(e[t]=this[t])}));const t=window.drops.cardLink(e,this.id);this._drop=t},this.handleMoovJsLoaded=()=>{document.removeEventListener("moov.moovJSLoaded",this.handleMoovJSLoaded),window.Moov&&!window.drops&&window.Moov("fake-token").drops().then(this.handleMoovDropsInitialized)}}connectedCallback(){window.drops&&this.handleMoovDropsInitialized(),window.Moov&&!window.drops&&this.handleMoovJsLoaded(),window.Moov||window.drops||document.addEventListener("moov.moovJSLoaded",this.handleMoovJsLoaded)}attributeChangedCallback(e,t,o){if(t===o)return;let n=ve(e);"account-id"===e&&(n="accountID"),"merchant-account-id"===e&&(n="merchantAccountID"),n in this&&(this[n]=o)}submit(){var e,t;null===(t=null===(e=this.imperativeRef.current)||void 0===e?void 0:e.submit)||void 0===t||t.call(e)}validate(){var e,t;null===(t=null===(e=this.imperativeRef.current)||void 0===e?void 0:e.validate)||void 0===t||t.call(e)}fetchValidity(){var e,t;return null===(t=null===(e=this.imperativeRef.current)||void 0===e?void 0:e.fetchValidity)||void 0===t?void 0:t.call(e)}clear(){var e,t;null===(t=null===(e=this.imperativeRef.current)||void 0===e?void 0:e.clear)||void 0===t||t.call(e)}}me.observedAttributes=["oauth-token","account-id","validation-event","merchant-account-id"],me.componentProps=["oauthToken","accountID","validationEvent","inputStyle","onEnterKeyPress","onError","onValidated","onSuccess","imperativeRef","holderName","allowedCardBrands","billingAddress","merchantAccountID","cardOnFile"],he(me,me.componentProps);const fe=me;class we extends HTMLElement{constructor(){super(),this.handleMoovDropsInitialized=()=>{this.id||(this.id=`moov-file-upload-${pe()}`);const e={};we.componentProps.forEach((t=>{t in this&&(e[t]=this[t])}));const t=window.drops.fileUpload(e,this.id);this._drop=t},this.handleMoovJsLoaded=()=>{document.removeEventListener("moov.moovJSLoaded",this.handleMoovJSLoaded),window.Moov&&!window.drops&&window.Moov("fake-token").drops().then(this.handleMoovDropsInitialized)}}connectedCallback(){window.drops&&this.handleMoovDropsInitialized(),window.Moov&&!window.drops&&this.handleMoovJsLoaded(),window.Moov||window.drops||document.addEventListener("moov.moovJSLoaded",this.handleMoovJsLoaded)}attributeToProperty(e){return"account-id"===e?"accountID":"facilitator-account-id"===e?"facilitatorAccountID":ve(e)}attributeChangedCallback(e,t,o){if(t===o)return;const n=this.attributeToProperty(e);n in this&&(this[n]=o)}}we.observedAttributes=["token","account-id"],we.componentProps=["token","accountID","open","onCancel","onError","onSuccess"],he(we,we.componentProps);const be=we;class ye extends HTMLElement{constructor(){super(),this.handleMoovDropsInitialized=()=>{this.id||(this.id=`moov-issued-card-${pe()}`),this.imperativeRef||(this.imperativeRef={current:null});const e={};ye.componentProps.forEach((t=>{t in this&&(e[t]=this[t])}));const t=window.drops.issuedCard(e,this.id);this._drop=t},this.handleMoovJsLoaded=()=>{document.removeEventListener("moov.moovJSLoaded",this.handleMoovJSLoaded),window.Moov&&!window.drops&&window.Moov("fake-token").drops().then(this.handleMoovDropsInitialized)}}connectedCallback(){window.drops&&this.handleMoovDropsInitialized(),window.Moov&&!window.drops&&this.handleMoovJsLoaded(),window.Moov||window.drops||document.addEventListener("moov.moovJSLoaded",this.handleMoovJsLoaded)}attributeChangedCallback(e,t,o){if(t===o)return;let n=ve(e);"account-id"===e&&(n="accountID"),"issued-card-id"===e&&(n="issuedCardID"),n in this&&(this[n]=o)}}ye.observedAttributes=["oauth-token","account-id","issued-card-id","background"],ye.componentProps=["oauthToken","accountID","issuedCardID","background"],he(ye,ye.componentProps);const ge=ye;class De extends HTMLElement{constructor(){super(),this.handleMoovDropsInitialized=()=>{this.id||(this.id=`moov-onboarding-${pe()}`);const e={};De.componentProps.forEach((t=>{t in this&&(e[t]=this[t])}));const t=window.drops.onboarding(e,this.id);this._drop=t},this.handleMoovJsLoaded=()=>{document.removeEventListener("moov.moovJSLoaded",this.handleMoovJSLoaded),window.Moov&&!window.drops&&window.Moov("fake-token").drops().then(this.handleMoovDropsInitialized)}}connectedCallback(){window.drops&&this.handleMoovDropsInitialized(),window.Moov&&!window.drops&&this.handleMoovJsLoaded(),window.Moov||window.drops||document.addEventListener("moov.moovJSLoaded",this.handleMoovJsLoaded)}attributeToProperty(e){return"account-id"===e?"accountID":"facilitator-account-id"===e?"facilitatorAccountID":ve(e)}attributeChangedCallback(e,t,o){if(t===o)return;const n=this.attributeToProperty(e);n in this&&(this[n]=o)}}De.observedAttributes=["facilitator-account-id","token","account-id"],De.componentProps=["accountData","capabilities","facilitatorAccountID","onCancel","onError","onResourceCreated","onPlaidRedirect","open","token","mode","plaid","accountID","paymentMethodTypes","microDeposits","allowedCardBrands"],he(De,De.componentProps);const Ie=De;class ke extends HTMLElement{constructor(){super(),this.handleMoovDropsInitialized=()=>{this.id||(this.id=`moov-payment-methods-${pe()}`);const e={};ke.componentProps.forEach((t=>{t in this&&(e[t]=this[t])}));const t=window.drops.paymentMethods(e,this.id);this._drop=t},this.handleMoovJsLoaded=()=>{document.removeEventListener("moov.moovJSLoaded",this.handleMoovJSLoaded),window.Moov&&!window.drops&&window.Moov("fake-token").drops().then(this.handleMoovDropsInitialized)}}connectedCallback(){window.drops&&this.handleMoovDropsInitialized(),window.Moov&&!window.drops&&this.handleMoovJsLoaded(),window.Moov||window.drops||document.addEventListener("moov.moovJSLoaded",this.handleMoovJsLoaded)}attributeToProperty(e){return"account-id"===e?"accountID":"facilitator-account-id"===e?"facilitatorAccountID":ve(e)}attributeChangedCallback(e,t,o){if(t===o)return;const n=this.attributeToProperty(e);n in this&&(this[n]=o)}}ke.observedAttributes=["facilitator-account-id","token","account-id"],ke.componentProps=["accountData","facilitatorAccountID","onCancel","onError","onResourceCreated","onPlaidRedirect","open","token","plaid","accountID","paymentMethodTypes","microDeposits","allowedCardBrands"],he(ke,ke.componentProps);const Pe=ke,Ee=e=>async function(){return await i.e(210).then(i.bind(i,210)),sessionStorage.setItem("moov-js-token",e),window.drops};class Oe{constructor(e,t){this.moovEnv="prod",this.facilitatorID="",this.sessionID="",this.fraudClientID="",this.moovAccessToken=e,this.authedFetch=t}async load(){try{this.moovEnv=F(),this.decodeAccessToken(),await this.getFraudClientID(),await this.loadSDK()}catch(e){console.warn("Failed to load enhanced fraud protection:",e)}}decodeAccessToken(){const e=function(e){try{var t=e.split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),o=decodeURIComponent(atob(t).split("").map((function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)})).join(""));return JSON.parse(o)}catch(e){throw new Error(m)}}(this.moovAccessToken);this.facilitatorID=e.caid,this.sessionID=e.sid}async getFraudClientID(){const e=await this.authedFetch(`/tbd/${this.facilitatorID}/tbd`);return(await e.json()).clientID}async loadSDK(){const e="prod"===this.moovEnv?"https://a.moov.io":"https://a.sandbox.moov.io",t=document.createElement("script");t.type="text/javascript",t.async=!0,t.src=`${e}/assets/loader.min.js`,t.onload=()=>{try{window._Sardine.createContext({clientId:this.fraudClientID,sessionKey:this.sessionID,flow:location.pathname,environment:"prod"===this.moovEnv?"production":"sandbox",parentElement:document.body})}catch(e){console.warn("Failed to initialize enhanced fraud protection:",e)}},document.body.insertBefore(document.body.childNodes[0],t)}}window&&window.customElements&&(window.customElements.get("moov-card-link")||(window.customElements.define("moov-card-link",fe),window.customElements.define("moov-file-upload",be),window.customElements.define("moov-issued-card",ge),window.customElements.define("moov-onboarding",Ie),window.customElements.define("moov-payment-methods",Pe)));const Te=new CustomEvent("moov.moovJSLoaded");setTimeout((()=>document.dispatchEvent(Te)),0);const Me=(e,t)=>{if(!("fake-token"===(o=e)||(n=o)&&/^[\w-]+\.[\w-]+\.[\w-]+$/.test(n)))throw new Error(m);var o,n;t=t||{};const i=K(e);return t.enhancedFraudDetection&&"undefined"!=typeof window&&new Oe(e,i).load(),{ping:W(i).ping,enrichment:Object.assign({},Z(i)),institutions:Object.assign({},Q(i)),accounts:Object.assign({},q(i)),setToken:e=>Me(e),plaid:Object.assign({},ie(i)),drops:Ee(e),version:"v0.2.106"}},Se=Me})(),Moov=r.default})();