PageSourceSearch

https://exchange.billgo.com/assets/Registration-l1HK_56S.js

js billgo.com collected 2026-09-25 19:45:55 UTC 23,787 bytes, 122 lines download raw bytes

1(function(){try{var g=typeof globalThis!=="undefined"?globalThis:typeof global!=="undefined"?global:typeof window!=="undefined"?window:typeof self!=="undefined"?self:{};g["__faroBundleId_Exchange-UI"]="2cb13e351f962f9865a92bac3916343eb2dbeef8"}catch(l){}})();import{o as e}from"./rolldown-runtime-CMxvf4Kt.js";import{a as t,j as n,s as r}from"./apollo-Cf1nTsKG.js";import{B as i,D as a,Dt as o,Nt as s,_ as c,c as l,ht as u,i as d,mt as f,pt as p,x as m,z as h}from"./mui-material-CffuPoxK.js";import{i as g}from"./datadog-DALb5k1r.js";import{c as _,d as v,f as y,g as b,p as x,v as S}from"./okta-Dq7VNm9A.js";import{a as C}from"./misc-react-ChPEm5rr.js";import{An as ee,Hn as te,Wn as ne}from"./mui-icons-Bi_So2ZS.js";import{g as re,n as ie}from"./V2Enrollment-nALwbrsh.js";import{$n as ae,Bn as oe,Br as se,Cr as ce,Ct as w,Di as le,Ei as T,En as E,Fn as ue,G as D,Gn as de,Ir as O,Kt as fe,Lr as pe,Oi as me,On as k,Ot as he,Pr as ge,Rn as _e,Rr as ve,Si as A,Ti as ye,U as be,Vr as j,Yt as xe,ar as M,cn as N,er as Se,jt as Ce,kn as we,li as Te,nr as Ee,qt as De,vt as P,wi as F,wt as I,xt as Oe,zr as L}from"./SharedUI-X0VowGnd.js";import{c as R,d as ke,n as z,o as B,t as V}from"./forms-CjrQTMj4.js";import{g as Ae,s as je}from"./Shell-2vYIDmjU.js";import{i as Me}from"./Tour-Dg6CSIc4.js";var H=e(n()),U=(0,H.createContext)(null);function W(e,t){let n=(0,H.use)(U);if(!n)throw Error(`useRegistration must be used within a RegistrationContext`);let{setBackPath:r,hideBusinessName:i}=n;return(0,H.useEffect)(()=>{r(e),i(t)},[e,r,t,i]),n}var G=C(),Ne=B().shape({code:R().label(`Invite Code`).required().length(8),recaptcha:R().required(`Please complete the reCAPTCHA above`)});function Pe(){let[e]=S(),t={code:e.get(`inviteCode`)||``,recaptcha:``,email:e.get(`email`)||``},[n,{error:i}]=r(Fe),a=b(),o=(0,H.useRef)(null),{setLead:s}=W(null,!0);return(0,G.jsx)(z,{initialValues:t,onSubmit:(e,{setFieldError:r,setFieldValue:i})=>n({variables:e}).then(n=>{n.data?.leadByInviteCode?(s(n.data.leadByInviteCode,e.code,t.email),a(`../welcome`)):(r(`code`,n.error?.message),i(`recaptcha`,``,!1),o.current?.reset())}).catch(),validationSchema:Ne,children:(0,G.jsxs)(c,{spacing:3,p:{xs:0,sm:3},component:V,display:`flex`,fontSize:`1.125`,children:[(0,G.jsx)(w,{fontSize:`1.25rem`,fontWeight:`fontWeightMedium`,children:`Enter Your Invite Code`}),(0,G.jsx)(M,{name:`code`,label:`Invite Code`,required:!0}),(0,G.jsx)(re,{name:`recaptcha`,ref:o}),(0,G.jsx)(D,{children:`Continue`}),i&&(0,G.jsx)(P,{message:`Error validating invite code.`,variant:`user`}),(0,G.jsxs)(w,{children:[`Already Have an Account?`,` `,(0,G.jsx)(h,{href:`/login`,underline:`hover`,children:`Sign In`})]}),(0,G.jsx)(he,{})]})})}var Fe=T`
2  query getLeadByInviteCode($code: String!, $recaptcha: String!) {
3    leadByInviteCode(inviteCode: $code, reCaptchaToken: $recaptcha) {
4      businessName
5      businessAddress {
6        line1
7        line2
8        city
9        state
10        zipCode
11      }
12      remittanceAddress {
13        line1
14        line2
15        city
16        state
17        zipCode
18      }
19      userEmail
20      userFirstName
21      userLastName
22      phoneNumber
23    }
24  }
25`,Ie=B().shape({firstName:R().trim().required().label(`First Name`),lastName:R().trim().required().label(`Last Name`),legalName:R().trim().required().label(`Company Name`).matches(ce,`Company name contains invalid characters. Only letters, numbers, spaces, and the following characters are allowed: ., ' & -`)});function Le(){let{firstName:e,lastName:t,legalName:n,setBasicInfo:r}=W(null,!0),i=b(),a={legalName:n||``,firstName:e||``,lastName:t||``};return(0,G.jsx)(z,{initialValues:a,onSubmit:({firstName:e,lastName:t,legalName:n})=>{r(e,t,n),i(`../billing-addresses`)},validationSchema:Ie,children:(0,G.jsxs)(c,{spacing:3,p:{xs:0,sm:3},component:V,alignItems:`center`,children:[(0,G.jsx)(I,{size:`5rem`,iconSize:`2.5rem`,children:(0,G.jsx)(E,{})}),(0,G.jsx)(w,{fontSize:`2rem`,fontWeight:`fontWeightMedium`,children:`Welcome!`}),(0,G.jsxs)(w,{children:[`Let's finish setting up `,(0,G.jsx)(w,{component:`span`,fontWeight:`fontWeightMedium`,children:n}),`, so you can start receiving electronic payments`]}),(0,G.jsx)(M,{name:`firstName`,label:`First Name`,required:!0}),(0,G.jsx)(M,{name:`lastName`,label:`Last Name`,required:!0}
25),(0,G.jsx)(M,{name:`legalName`,label:`Business Name`,required:!0}),(0,G.jsx)(D,{fullWidth:!0,children:`Continue`})]})})}var K={inviteCode:``,legalName:``,firstName:``,lastName:``,email:``,businessAddressOptions:[]};function Re({children:e}){let[t,n]=(0,H.useState)(ze),r=(0,H.useCallback)((e,t,r)=>{let i=J([q(e.remittanceAddress)]);n({inviteCode:t,legalName:e.businessName,firstName:e.userFirstName,lastName:e.businessName===e.userLastName?void 0:e.userLastName,email:r||e.userEmail,remittanceAddresses:[q(e.remittanceAddress)],businessAddress:i[0],businessAddressOptions:i})},[]),i=(0,H.useCallback)((e,t,r)=>{n(n=>({...n,firstName:e,lastName:t,legalName:r}))},[]),a=(0,H.useCallback)((e,r)=>{let i=[...t.remittanceAddresses||[]];r?i.splice(e,1,r):i.splice(e,1);let a=J(i);n(e=>({...e,remittanceAddresses:i,businessAddress:a[0],businessAddressOptions:a}))},[t.remittanceAddresses]),o=(0,H.useCallback)(e=>{let r=[...t.remittanceAddresses||[],e],i=J(r);n(e=>({...e,remittanceAddresses:r,businessAddress:i[0],businessAddressOptions:i}))},[t.remittanceAddresses]),s=(0,H.useCallback)(e=>{n(t=>({...t,email:e}))},[]),c=(0,H.useCallback)(e=>{n(t=>({...t,businessAddress:e}))},[]),l=(0,H.useCallback)(e=>{n(t=>({...t,backPath:e}))},[]),u=(0,H.useCallback)(e=>{n(t=>({...t,shouldHideBusinessName:e}))},[]),d=(0,H.useCallback)(()=>{n(K)},[]),f=(0,H.useMemo)(()=>{let{inviteCode:e,legalName:n,businessAddress:f,remittanceAddresses:p}=t;return{validRegistration:!!e&&!!n&&!!f&&!!p,...t,setLead:r,setBasicInfo:i,addBillingAddress:o,replaceBillingAddress:a,setEmail:s,setBusinessAddress:c,setBackPath:l,hideBusinessName:u,clear:d}},[t,r,i,o,a,s,c,l,u,d]);return(0,H.useEffect)(()=>{localStorage.setItem(`registration`,JSON.stringify(t)),g.setGlobalContextProperty(`inviteCode`,t.inviteCode)},[t]),(0,G.jsx)(U,{value:f,children:e})}function ze(){let e=localStorage.getItem(`registration`);return e?JSON.parse(e):K}function q(e){return{line1:e.line1,line2:e.line2,city:e.city,state:e.state,zipCode:e.zipCode}}var J=e=>e.filter(e=>!se(e));function Be({to:e}){return(0,G.jsx)(f,{startIcon:(0,G.jsx)(de,{}),sx:{color:`text.primary`,bgcolor:`transparent`,fontSize:`1rem`,fontWeight:`normal`,"&:hover":{backgroundColor:`initial`,color:`inherit`,textDecoration:`none`}},to:e,component:_})}function Ve(){let e=(0,H.use)(U);if(!e)throw Error(`useRegistrationShell must be used within a RegistrationContext`);return{backPath:e.backPath,shouldHideBusinessName:e.shouldHideBusinessName,legalName:e.legalName}}function He({children:e}){let{backPath:t,legalName:n,shouldHideBusinessName:r}=Ve();return(0,G.jsxs)(c,{bgcolor:`lightNaturals.marble`,minHeight:`100vh`,children:[(0,G.jsx)(o,{sx:{bgcolor:({palette:e})=>te(e.primary.main,.25)},children:(0,G.jsxs)(l,{children:[(0,G.jsx)(ae,{sx:{color:`inherit`,fontSize:`2.5rem`,pr:`0.75rem`}}),(0,G.jsx)(Oe,{})]})}),(0,G.jsx)(Ue,{}),(0,G.jsxs)(c,{flexGrow:1,gap:3,pt:10,alignItems:`center`,maxWidth:`100%`,children:[!r&&(0,G.jsx)(w,{fontSize:`1.25rem`,fontWeight:`fontWeightMedium`,children:n}),(0,G.jsxs)(xe,{width:`40rem`,textAlign:`center`,p:e=>({xs:e.spacing(5),sm:e.spacing(8,10,11)}),maxWidth:`100%`,children:[t&&(0,G.jsx)(u,{display:`flex`,my:-4,ml:{xs:-6,sm:-8},children:(0,G.jsx)(Be,{to:t})}),e]})]}),(0,G.jsx)(be,{sx:{pr:17,pb:7.25}})]})}var Ue=ee(`div`)(({theme:e})=>e.mixins.toolbar);function Y(){return(0,G.jsx)(Ae,{children:(0,G.jsx)(Me,{children:(0,G.jsx)(Re,{children:(0,G.jsx)(He,{children:(0,G.jsx)(v,{})})})})})}function X({icon:e,label:t}){return(0,G.jsxs)(u,{display:`grid`,gridTemplateColumns:`.5fr 1fr .5fr`,gridTemplateAreas:`'. icon .' 'label label label'`,gap:1,py:2,children:[(0,G.jsx)(I,{size:`5rem`,iconSize:`2.5rem`,sx:{gridArea:`icon`,justifySelf:`center`},children:e}),(0,G.jsx)(w,{pt:1,gridArea:`label`,fontSize:`1.5rem`,fontWeight:`fontWeightMedium`,children:t})]})}function Z({children:e,onClick:t,disabled:n,sx:r}){return(0,G.jsx)(f,{variant:`outlined`,onClick:t,disabled:n,sx:{...r,borderRadius:1,color:`text.primary`,borderColor:`greyUtility.c`,"&:hover":({palette:e})=>({backgroundColor:ne(e.greyUtility.c,1-e.action.hoverOpacity),borderColor:`greyUtility.c`}),"&:disabled":{color:`text.secondary`,backgroundColor:`lightNaturals.pearl`,borderColor:`greyUtility.d`}},disableRipple:!0,children:e})}function Q({onClose:e,address:t,index:n}){let{addBillingAddress:r,replaceBillingAddress:i}=W(`../registration/welcome`);return(0,G.jsx)(z,{initialValues:{line1:t?.line1??``,line2:t?.line2??``,city:t?.city??``,state:t?.state??``,zipCode:t?.zipCode??``},onSubmit:t=>{n||n==0?i(n,t):r(t),e()},validationSchema:O,children:(0,G.jsxs)(c,{spacing:3,width:`100%`,component:V,children:[(0,G.jsx)(N,{}),(0,G.jsx)(D,{children:`Add Address`}),(0,G.jsx)(f,{variant:`text`,onClick:e,sx:{alignSelf:`center`,"&:hover":{background:`none`,textDecoration:`underline`}},children:`Cancel`})]})})}function We({index:e,address:t,isDuplicate:n,isInvalid:r,disabled:i,setAddressBeingEdited:a}){let{replaceBillingAddress:o}=W(`../registration/welcome`),[s,l]=(0,H.useState)(!1),{line1:d,line2:f,city:m,state:h,zipCode:g}=t,_=`${d}, ${f?f+`, `:``} ${m}, ${h} ${g}`;return(0,G.jsxs)(G.Fragment,{children:[s&&(0,G.jsx)(Q,{onClose:()=>{a(!1),l(!1)},address:t,index:e}),!s&&(0,G.jsxs)(p,{fullWidth:!0,sx:{height:`4rem`},children:[(0,G.jsx)(Z,{onClick:()=>{a(!0),l(!0)},disabled:i,sx:{justifyContent:`flex-start`,textAlign:`left`},children:(0,G.jsxs)(c,{minWidth:0,children:[(0,G.jsxs)(w,{color:`greyText.7`,fontSize:`.75rem`,children:[`Billing Address `,!!e&&`#${e+1}`,n&&(0,G.jsxs)(u,{component:`span`,color:`error.light`,children:[` `,`Address already exists`]}),r&&(0,G.jsxs)(u,{component:`span`,color:`error.light`,children:[` `,`Invalid Address`]})]}),(0,G.jsx)(w,{sx:De,children:_})]})}),!i&&(0,G.jsx)(Z,{onClick:()=>{o(e)},sx:{maxWidth:`4rem`},children:(0,G.jsx)(_e,{fontSize:`medium`})})]})]})}function Ge(){let{remittanceAddresses:e}=W(`../registration/welcome`),[t,n]=(0,H.useState)(!1),[r,i]=(0,H.useState)(!1),a=b(),o=t||r,s=pe(e||[]),l=ve(e||[]),u=!!s.length,d=!!l.length,p=u||d||!e?.length;return(0,G.jsxs)(c,{spacing:3,p:{xs:0,sm:3},alignItems:`center`,children:[(0,G.jsx)(X,{icon:(0,G.jsx)(E,{}),label:`Where do your customers currently send their payments?`}),e?.map((e,t)=>
25(0,G.jsx)(We,{index:t,address:e,isDuplicate:s.includes(t),isInvalid:l.includes(t),disabled:o,setAddressBeingEdited:i},t)),!o&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(f,{variant:`outlined`,onClick:()=>{n(!0)},fullWidth:!0,sx:{height:`4rem`,borderRadius:1,border:`1px dashed`,justifyContent:`left`,"&:hover":{textDecoration:`none`,borderStyle:`solid`}},children:[(0,G.jsx)(Ee,{sx:{fontSize:`2rem`,mr:`1.5rem`}}),`Add Another Billing Address`]}),(0,G.jsx)(f,{onClick:()=>{a(`../physical-address`)},disabled:p,fullWidth:!0,children:`Continue`}),u&&(0,G.jsx)(P,{message:`Remove duplicate addresses`,variant:`user`}),(0,G.jsx)(w,{color:`greyText.6`,children:`You can always add more addresses later`})]}),t&&(0,G.jsx)(Q,{onClose:()=>{n(!1)}})]})}function Ke({toggleToEntryView:e}){return(0,G.jsx)(f,{variant:`text`,onClick:e,sx:{"&:hover":{background:`none`,textDecoration:`underline`}},children:`Enter a different physical address`})}function qe({handleContinue:e,toggleToEntryView:t}){let{businessAddress:n}=W(`../registration/billing-addresses`);return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(w,{pb:3,fontWeight:`fontWeightMedium`,children:L(n)}),(0,G.jsx)(f,{onClick:e,fullWidth:!0,children:`Yes`}),(0,G.jsx)(Ke,{toggleToEntryView:t})]})}function Je({handleContinue:e}){let{remittanceAddresses:t,addBillingAddress:n,setBusinessAddress:r}=W(`../registration/billing-addresses`),{error:i}=ye(),[a,o]=(0,H.useState)(``);return(0,G.jsx)(z,{initialValues:{line1:``,line2:``,city:``,state:``,zipCode:``},onSubmit:o=>{if(!a.includes(`PO`))t?.map(e=>j(e)).includes(j(o))||n(o),r(o),e();else return i(`Cannot Validate Address: `+a),Promise.reject(Error(`Not a valid address`))},validationSchema:O,children:(0,G.jsxs)(c,{spacing:3,width:`100%`,component:V,children:[(0,G.jsx)(N,{handleSetError:e=>{o(e)}}),(0,G.jsx)(D,{children:`Continue`})]})})}function Ye({handleContinue:e,toggleToEntryView:t}){let{businessAddress:n,businessAddressOptions:r,setBusinessAddress:i}=W(`../registration/billing-addresses`),o=e=>r.filter(t=>e==L(t))[0];return(0,G.jsxs)(c,{spacing:3,width:`100%`,textAlign:`left`,children:[(0,G.jsx)(d,{label:`Physical Address`,value:L(n),onChange:e=>i(o(e.target.value)),fullWidth:!0,select:!0,children:r.map((e,t)=>(0,G.jsx)(a,{value:L(e),sx:{wordBreak:`keep-all`,whiteSpace:`break-spaces`},children:L(e)},t))}),(0,G.jsx)(f,{onClick:e,children:`Continue`}),(0,G.jsx)(Ke,{toggleToEntryView:t})]})}function Xe(){let{legalName:e,businessAddress:t,businessAddressOptions:n}=W(`../registration/billing-addresses`),r=b(),[i,a]=(0,H.useState)(Ze(n)),o=i==`SINGLE`?`Is this ${e}'s physical address?`:`What is ${e}'s physical address?`,s=()=>{r(`../email`)},l=()=>{a(`ENTRY`)};return(0,G.jsxs)(c,{gap:1,alignItems:`center`,children:[(0,G.jsx)(X,{icon:(0,G.jsx)(we,{}),label:o}),i==`ENTRY`&&(0,G.jsx)(Je,{handleContinue:s}),i==`SINGLE`&&t&&(0,G.jsx)(qe,{handleContinue:s,toggleToEntryView:l}),i==`MULTIPLE`&&t&&(0,G.jsx)(Ye,{handleContinue:s,toggleToEntryView:l})]})}var Ze=e=>{switch(e.length){case 0:return`ENTRY`;case 1:return`SINGLE`;default:return`MULTIPLE`}},Qe=B().shape({email:R().email().required().matches(/^(?!.*billgo\.com)/i,`Registering a billgo.com email is not supported at this time. If needed, these users can be added after registration`).label(`Email`),confirmEmail:R().oneOf([ke(`email`),``],`Emails must match`).required(`Required`)});function $e(){let{inviteCode:e,email:t,businessAddress:n,firstName:i,lastName:a,legalName:o,remittanceAddresses:s,setEmail:l}=W(`../registration/physical-address`),[u,{error:d}]=F(et,`createSupplier`),[f]=r(tt,{notifyOnNetworkStatusChange:!0}),p=b(),m=async({email:t})=>{l(t);let n=await f({variables:{email:t,code:e}});n.data?.userExists===!1&&await h(t),n.data?.userExists===!0&&p(`../existing-user`)},h=async t=>{await u({variables:{inviteCode:e,email:t,firstName:i,lastName:a,legalName:o,billingAddresses:s,physicalAddress:n}},`Error registering`)&&p(`../confirm-email`)};return(0,G.jsx)(z,{initialValues:{email:t||``,confirmEmail:``},onSubmit:m,validationSchema:Qe,children:(0,G.jsxs)(c,{spacing:3,p:{xs:0,sm:3},component:V,alignItems:`center`,children:[(0,G.jsx)(X,{icon:(0,G.jsx)(k,{}),label:`Let's save your info`}),(0,G.jsx)(M,{name:`email`,label:`Email`,required:!0}),(0,G.jsx)(M,{name:`confirmEmail`,label:`Confirm Email`,onCopy:e=>{e.preventDefault()},onPaste:e=>{e.preventDefault()},required:!0}),d&&(0,G.jsx)(P,{message:`Error creating your account.`}),(0,G.jsx)(D,{fullWidth:!0,children:`Continue`}),(0,G.jsxs)(w,{fontSize:`small`,color:`text.secondary`,children:[`By clicking Continue, you agree to`,` BillGO's `,(0,G.jsx)(me,{}),`.`]})]})})}var et=T`
26  mutation createNewSupplier(
27    $inviteCode: String!
28    $email: String!
29    $firstName: String!
30    $lastName: String!
31    $legalName: String!
32    $billingAddresses: [AddressInput]!
33    $physicalAddress: AddressInput!
34  ) {
35    createSupplier(
36      inviteCode: $inviteCode
37      userEmail: $email
38      userFirstName: $firstName
39      userLastName: $lastName
40      businessName: $legalName
41      businessAddresses: $billingAddresses
42      physicalAddress: $physicalAddress
43    ) {
44      message
45      status
46      supplier {
47        id
48      }
49    }
50  }
51`,tt=T`
52  query checkForExistingEmail($email: String!, $code: String!) {
53    userExists(email: $email, inviteCode: $code)
54  }
55`;function nt(){let{email:e}=W(null,!0);return(0,G.jsxs)(c,{alignItems:`center`,spacing:2,children:[(0,G.jsx)(X,{icon:(0,G.jsx)(ue,{}),label:`You’re almost done.`}),(0,G.jsxs)(c,{children:[`We sent an email to `,(0,G.jsx)(`br`,{}),(0,G.jsx)(`strong`,{children:e}),(0,G.jsx)(`br`,{})]}),(0,G.jsx)(w,{children:`Please check your email to complete your registration, including setting up your password and other security options.`}),(0,G.jsx)(w,{children:`If you don't see the email, check your spam folder.`})]})}function rt(){let e=b();return W(`../registration/email`),(0,G.jsxs)(c,{spacing:3,children:[(0,G.jsx)(X,{icon:(0,G.jsx)(k,{}),label:`It looks like you already have a profile with BillGO Exchange`}),(0,G.jsx)(w,{children:`Login to finish setting up your new business account.`}),(0,G.jsx)(f,{onClick:()=>e(`/existing-user`),children:`Login`}),(0,G.jsx)(f,{onClick:()=>e(`../email`),variant:`text`,sx:{"&:hover":{background:`none`,textDecoration:`underline`}},children:`Create a new user profile for this business account`})]})}function it(){return(0,G.jsx)(x,{children:(0,G.jsxs)(y,{element:(0,G.jsx)(Y,{}),children:[(0,G.jsx)(y,{path:`invite-code`,element:(0,G.jsx)(Pe,{})}),(0,G.jsx)(y,{path:`welcome`,element:(0,G.jsx)(Le,{})}),(0,G.jsx)(y,{path:`billing-addresses`,element:(0,G.jsx)(Ge,{})}),(0,G.jsx)(y,{path:`physical-address`,element:(0,G.jsx)(Xe,{})}),(0,G.jsx)(y,{path:`email`,element:(0,G.jsx)($e,{})}),(0,G.jsx)(y,{path:`confirm-email`,element:(0,G.jsx)(nt,{})}),(0,G.jsx)(y,{path:`existing-user`,element:(0,G.jsx)(rt,{})}),(0,G.jsx)(y,{path:`finish`,element:(0,G.jsx)(ie,{})}),(0,G.jsx)(y,{path:`*`,element:(0,G.jsx)(at,{})})]})})}var at=()=>(W(null,!0),(0,G.jsx)(je,{}));function ot({completeRegistration:e,onCancel:t}){let{id:n}=A(),[r,{error:i}]=F(st,`createBankAccount`),a=i&&!i.includes(`validation failed`)?`Error connecting your bank account.`:void 0,o={supplierId:n,accountType:`CHECKING`,bankName:``,routingNumber:``,accountNumber:``,failedValidation:!1,override:!1};return(0,G.jsxs)(c,{alignItems:`center`,spacing:2,pt:3,children:[(0,G.jsx)(w,{children:`Finally,`}),(0,G.jsx)(w,{fontSize:`1.5rem`,fontWeight:`fontWeightMedium`,width:`70%`,children:`Connect Your Bank Account to Receive Deposits`}),(0,G.jsx)(z,{initialValues:o,onSubmit:async(t,n)=>{let{failedValidation:i,...a}=t;await r({variables:a},`Error saving bank info`)?await e(`ACH`):n.resetForm({values:t})},validationSchema:ge,children:(0,G.jsxs)(c,{spacing:3,component:V,children:[(0,G.jsx)(fe,{error:i}),(0,G.jsx)(D,{children:`Connect Bank Account`}),a&&(0,G.jsx)(P,{message:a,context:i})]})}),(0,G.jsx)(Ce,{onClick:t})]})}var st=T`
56  mutation addBankInfo(
57    $supplierId: ID!
58    $accountType: BankAccountType!
59    $bankName: String!
60    $routingNumber: String!
61    $accountNumber: String!
62    $override: Boolean
63  ) {
64    createBankAccount(
65      input: {
66        supplierId: $supplierId
67        accountType: $accountType
68        bankName: $bankName
69        routingNumber: $routingNumber
70        accountNumber: $accountNumber
71      }
72      overrideValidation: $override
73    ) {
74      message
75      status
76    }
77  }
78`;function $({action:e,header:t,subHeader:n,icon:r,description:i,disabled:a,busy:o,gridArea:l}){return(0,G.jsxs)(f,{component:c,onClick:e,variant:`outlined`,color:`primary`,flex:1,textAlign:`center`,disabled:a,gridArea:l,sx:{p:4,border:`1px solid`,borderRadius:`.25rem`,width:`100%`},children:[r,(0,G.jsxs)(c,{flexGrow:1,pt:4,pb:7,alignItems:`center`,color:a?`text.disabled`:`text.primary`,children:[(0,G.jsx)(w,{fontWeight:`fontWeightMedium`,fontSize:`1.5rem`,children:t}),(0,G.jsx)(w,{pb:7,children:i}),n]}),(0,G.jsx)(c,{color:a?`action.disabled`:`primary.contrastText`,bgcolor:a?`action.disabledBackgroun
78d`:`primary.main`,alignItems:`center`,width:`100%`,borderRadius:`100px`,py:1,children:o?(0,G.jsx)(s,{color:`inherit`,size:`1.75em`}):`Select`})]})}var ct=`"ach vcard"`,lt=`
79  "vcard"
80  "ach"
81`,ut=`1fr`,dt=`1fr 1fr`;function ft(){let{clear:e}=W(null),n=b(),{id:r,registrationStatus:i,refresh:a}=A(),{data:o,loading:s,error:l}=t(gt,{variables:{id:r},skip:!r}),[u,d]=(0,H.useState)(),[f,p]=(0,H.useState)(!1),{update:h,settings:{paymentPreference:g},error:_}=Te(),[v,{error:y}]=F(ht,`submitRegistration`),x=o?.supplier?.program,S=mt(x);return(0,H.useEffect)(()=>{g&&i!==`REGISTRATION_IN_PROGRESS`&&n(`/`)},[n,g,i]),(0,G.jsxs)(c,{spacing:3,alignItems:`center`,children:[!u&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(w,{children:`You are almost done!`}),(0,G.jsx)(w,{fontSize:`1.5rem`,fontWeight:`fontWeightMedium`,width:`70%`,children:`How do you want to receive your payments?`}),(0,G.jsxs)(c,{display:`grid`,direction:{xs:null,md:`row`},justifyContent:`center`,spacing:2,gap:2,gridTemplateAreas:{xs:lt,md:ct},gridTemplateColumns:{xs:ut,md:dt},children:[(0,G.jsx)($,{gridArea:`ach`,icon:(0,G.jsx)(Se,{sx:{fontSize:`3rem`}}),header:`Bank Deposit`,subHeader:(0,G.jsxs)(G.Fragment,{children:[s&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(m,{width:100}),(0,G.jsx)(m,{width:100})]}),!s&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(w,{fontSize:`1.5rem`,fontWeight:`fontWeightMedium`,children:pt(x)}),(0,G.jsx)(`span`,{children:`Processing Fee`}),S&&(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`br`,{}),(0,G.jsx)(`span`,{children:S})]})]})]}),action:()=>{d(`ACH`)},description:`Once a day`,disabled:s||f}),(0,G.jsx)($,{gridArea:`vcard`,icon:(0,G.jsx)(oe,{sx:{fontSize:`3rem`}}),header:`Credit Card`,subHeader:`Fee determined by your payment processor`,action:async()=>{p(!0),await C(`VC`)},description:`For each payment`,disabled:s||f,busy:f})]}),(0,G.jsx)(w,{color:`greyText.6`,children:`You can always change this later`})]}),u===`ACH`&&(0,G.jsx)(ot,{completeRegistration:C,onCancel:()=>d(void 0)}),_&&(0,G.jsx)(P,{message:`Error updating your payment preference.`,context:_}),y&&(0,G.jsx)(P,{message:`Error submitting your registration.`,context:y}),l&&(0,G.jsx)(P,{message:`Error while gathering bank fee information, displaying default fee.`,context:l})]});async function C(t){if(!await h(`paymentPreference`,t,!0)){p(!1);return}if(!await v({variables:{supplierId:r}},`Error submitting registration`)){p(!1);return}e(),a()}}var pt=e=>{let t=``;if(e){let{percentFee:n,fixedFee:r}=e,i=!n&&!r;(i||n)&&(t=t+parseFloat((n*100).toFixed(5))+`%`),(i||n&&r)&&(t+=` + `),(i||r)&&(t=t+`$`+r.toFixed(2))}else t=`1.99%`;return t},mt=e=>{if(e?.maxFeePerPayment&&e.maxFeePerPayment!==0)return`$${e.maxFeePerPayment.toFixed(2)} maximum`},ht=T`
82  mutation submitRegistration($supplierId: ID!) {
83    submitRegistration(supplierId: $supplierId) {
84      message
85      status
86    }
87  }
88`,gt=T`
89  query getSupplier($id: String!) {
90    supplier(id: $id) {
91      id
92      program {
93        name
94        paymentMethods
95        fixedFee
96        percentFee
97        maxFeePerPayment
98      }
99    }
100  }
101`;function _t(){let e=b(),{refreshAccessToken:t,roles:n}=le(),{inviteCode:r,legalName:a,businessAddress:o,remittanceAddresses:s,validRegistration:c,clear:l}=W(null),[u,{error:d}]=F(vt,`createSupplierWithExistingUser`),f=!!n.length&&!c;return(0,H.useEffect)(()=>{let n=()=>{e(`/`)};f?n():(async()=>{await u({variables:{inviteCode:r,legalName:a,billingAddresses:s,physicalAddress:o}},`Error registering`)&&(l(),await t?.(),n())})()},[]),(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(X,{icon:(0,G.jsx)(E,{}),label:`Associating existing user to new supplier`}),!d&&(0,G.jsx)(i,{}),d&&(0,G.jsx)(P,{message:`Error associating user to new supplier`,context:d})]})}var vt=T`
102  mutation createSupplierWithExistingUser(
103    $inviteCode: String!
104    $legalName: String!
105    $billingAddresses: [AddressInput]!
106    $physicalAddress: AddressInput!
107  ) {
108    createSupplierWithExistingUser(
109      inviteCode: $inviteCode
110      businessName: $legalName
111      businessAddresses: $billingAddresses
112      physicalAddress: $physicalAddress
113    ) {
114      message
115      status
116      supplier {
117        id
118      }
119    }
120  }
121`,yt=it;export{Y as i,_t as n,ft as r,yt as t};
122//# sourceMappingURL=Registration-l1HK_56S.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.