@tesouro/embedded-components-react 0.9.27 → 0.9.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (17) hide show
  1. package/dist/index.css +26 -11
  2. package/dist/index.d.ts +23 -3
  3. package/dist/lib/BankAccountOnboardingWidget.d.ts +23 -3
  4. package/dist/lib/WidgetSuite.d.ts +23 -3
  5. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js +366 -350
  6. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/labels.js +4 -3
  7. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/testIds.js +2 -1
  8. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js +3 -1
  9. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index33.js +8 -0
  10. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index34.js +46 -0
  11. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  12. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShell.js +62 -51
  13. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShellScrollRegion.js +25 -45
  14. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShellStepper.js +38 -48
  15. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/labels.js +1 -2
  16. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/useScrollHintContainer.js +10 -11
  17. package/package.json +1 -1
@@ -14,48 +14,49 @@ import { useOrganizationOnboardingSuppression as l } from "../../../../../shared
14
14
  import { useOrganizationApplicationStatus as u } from "../../../../../shared/data-access/dist/lib/useOrganizationApplicationStatus.js";
15
15
  import "../../../../../shared/data-access/dist/index.js";
16
16
  import { EmbeddedToaster as ee } from "../../../../../shared/ui/dist/lib/EmbeddedToaster.js";
17
- import { OnboardingShell as te } from "../../../../../shared/ui/dist/lib/OnboardingShell/OnboardingShell.js";
17
+ import { OnboardingShell as d } from "../../../../../shared/ui/dist/lib/OnboardingShell/OnboardingShell.js";
18
18
  import "../../../../../shared/ui/dist/index.js";
19
- import { useAnalyticsTrack as d } from "../../../../../shared/feature/dist/lib/analytics/hooks.js";
20
- import { WidgetProvider as ne } from "../../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
21
- import { useRefetchWidget as re, useWidgetConfig as ie, useWidgetInitStaleForToken as ae, useWidgetLoading as oe } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
22
- import { getNaicsOptions as se } from "../../../../../shared/feature/dist/lib/naicsCodeMap.js";
23
- import { deniedNoticeExpiresAt as ce, selectBankAccountApplication as le } from "../../../../../shared/feature/dist/lib/application/bankAccountApplication.js";
19
+ import { useAnalyticsTrack as f } from "../../../../../shared/feature/dist/lib/analytics/hooks.js";
20
+ import { WidgetProvider as te } from "../../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
21
+ import { useRefetchWidget as ne, useWidgetConfig as re, useWidgetInitStaleForToken as ie, useWidgetLoading as ae } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
22
+ import { getNaicsOptions as oe } from "../../../../../shared/feature/dist/lib/naicsCodeMap.js";
23
+ import { deniedNoticeExpiresAt as se, selectBankAccountApplication as ce } from "../../../../../shared/feature/dist/lib/application/bankAccountApplication.js";
24
24
  import "../../../../../shared/feature/dist/index.js";
25
- import { interpolateBankName as ue } from "../../../../ui/dist/index11.js";
26
- import { ApplicationStatusCard as de } from "../../../../ui/dist/index14.js";
27
- import { ResultStep as fe } from "../../../../ui/dist/index18.js";
28
- import { DeleteApplicationDialog as pe } from "../../../../ui/dist/index32.js";
25
+ import { interpolateBankName as le } from "../../../../ui/dist/index11.js";
26
+ import { ApplicationStatusCard as ue } from "../../../../ui/dist/index14.js";
27
+ import { ResultStep as de } from "../../../../ui/dist/index18.js";
28
+ import { DeleteApplicationDialog as fe } from "../../../../ui/dist/index32.js";
29
+ import { ApplicationDeletedScreen as pe } from "../../../../ui/dist/index34.js";
29
30
  import "../../../../ui/dist/index.js";
30
- import { DEFAULT_LABELS as f } from "./labels.js";
31
+ import { DEFAULT_LABELS as p } from "./labels.js";
31
32
  import { OnboardingApplicationView as me, applicationStatusNoticeFor as he, hiddenViewReason as ge, isNoticeView as _e, mergeApplicationStatusLabels as ve, onboardingApplicationViewFor as ye } from "./applicationStatusView.js";
32
33
  import { identifierLast4 as be, isIdentifierEnteredOrStored as xe } from "./fieldInput/storedIdentifier.js";
33
34
  import { isConsentGiven as Se } from "./stepSchemas.js";
34
- import { bankAccountOnboardingTestIds as p } from "./testIds.js";
35
+ import { bankAccountOnboardingTestIds as m } from "./testIds.js";
35
36
  import { BusinessDetailsStep as Ce } from "./BusinessDetailsStep.js";
36
37
  import { PersonalDetailsStep as we } from "./PersonalDetailsStep.js";
37
38
  import { ReviewStep as Te } from "./ReviewStep.js";
38
39
  import { TermsStep as Ee } from "./TermsStep.js";
39
- import { valuesKey as m } from "./valuesKey.js";
40
+ import { valuesKey as h } from "./valuesKey.js";
40
41
  import { AdditionalOwnersStep as De } from "./AdditionalOwnersStep.js";
41
- import { buildCreateApplicationBody as Oe, buildUpdateApplicationBody as h } from "./apiMapping.js";
42
- import { buildOnboardingPrefill as ke } from "./buildOnboardingPrefill.js";
42
+ import { buildCreateApplicationBody as Oe, buildUpdateApplicationBody as ke } from "./apiMapping.js";
43
+ import { buildOnboardingPrefill as g } from "./buildOnboardingPrefill.js";
43
44
  import { acceptDraftedValues as Ae, asCreateBody as je, buildDraftApplicationBody as Me, withApplicantWorkEmail as Ne } from "./draftApplicationMapping.js";
44
- import { OnboardingAnalyticsEvent as Pe, WIDGET_NAME as g } from "../analytics/events.js";
45
- import { withoutResumeOnlyOwnerFields as Fe, withoutStoredIdentifierMarkers as Ie } from "./hostInitialValues.js";
46
- import { ApplicationClientSecretProvider as Le, useApplicationClientSecret as Re } from "../../../../data-access/dist/index3.js";
47
- import { useCreateApplication as ze } from "../../../../data-access/dist/index5.js";
48
- import { useUpdateApplication as Be } from "../../../../data-access/dist/index6.js";
49
- import { useSubmitApplication as Ve } from "../../../../data-access/dist/index7.js";
50
- import { useDeleteApplication as He } from "../../../../data-access/dist/index8.js";
51
- import { usePollApplicationCompletion as Ue } from "../../../../data-access/dist/index9.js";
52
- import { useResumableBankAccountApplication as We } from "../../../../data-access/dist/index11.js";
53
- import { useStartedBankAccountApplication as Ge } from "../../../../data-access/dist/index12.js";
45
+ import { OnboardingAnalyticsEvent as Pe, WIDGET_NAME as Fe } from "../analytics/events.js";
46
+ import { withoutResumeOnlyOwnerFields as Ie, withoutStoredIdentifierMarkers as Le } from "./hostInitialValues.js";
47
+ import { ApplicationClientSecretProvider as Re, useApplicationClientSecret as ze } from "../../../../data-access/dist/index3.js";
48
+ import { useCreateApplication as Be } from "../../../../data-access/dist/index5.js";
49
+ import { useUpdateApplication as Ve } from "../../../../data-access/dist/index6.js";
50
+ import { useSubmitApplication as He } from "../../../../data-access/dist/index7.js";
51
+ import { useDeleteApplication as Ue } from "../../../../data-access/dist/index8.js";
52
+ import { usePollApplicationCompletion as We } from "../../../../data-access/dist/index9.js";
53
+ import { useResumableBankAccountApplication as Ge } from "../../../../data-access/dist/index11.js";
54
+ import { useStartedBankAccountApplication as Ke } from "../../../../data-access/dist/index12.js";
54
55
  import "../../../../data-access/dist/index.js";
55
- import { useCallback as Ke, useEffect as _, useMemo as v, useReducer as qe, useRef as y, useState as b } from "react";
56
- import { Fragment as Je, jsx as x, jsxs as Ye } from "react/jsx-runtime";
56
+ import { useCallback as _, useEffect as v, useMemo as y, useReducer as qe, useRef as b, useState as x } from "react";
57
+ import { Fragment as Je, jsx as S, jsxs as Ye } from "react/jsx-runtime";
57
58
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js
58
- var Xe = 2 ** 31 - 1, Ze = "DRAFT", Qe = [], S = (e) => xe(e, void 0);
59
+ var Xe = 2 ** 31 - 1, Ze = "DRAFT", Qe = [], C = (e) => xe(e, void 0);
59
60
  function $e(e) {
60
61
  return {
61
62
  ...e,
@@ -107,20 +108,20 @@ var rt = {
107
108
  workEmail: "",
108
109
  ownsOver25Percent: null,
109
110
  ownershipPercentage: null
110
- }, C = {
111
+ }, w = {
111
112
  personal: 0,
112
113
  business: 1,
113
114
  review: 2,
114
115
  terms: 3
115
116
  };
116
117
  function at(e, t) {
117
- return e === C.personal ? {
118
+ return e === w.personal ? {
118
119
  title: t.personalReviewTitle,
119
120
  subtitle: t.personalReviewSubtitle
120
- } : e === C.business ? {
121
+ } : e === w.business ? {
121
122
  title: t.businessReviewTitle,
122
123
  subtitle: t.businessReviewSubtitle
123
- } : e === C.review ? {
124
+ } : e === w.review ? {
124
125
  title: t.reviewTitle,
125
126
  subtitle: t.reviewSubtitle
126
127
  } : {
@@ -128,25 +129,25 @@ function at(e, t) {
128
129
  subtitle: t.termsSubtitle
129
130
  };
130
131
  }
131
- function ot({ onEmbeddedOnboardingCompletedSuccessfully: ne, onNavigateToDashboard: xe, onSuppressed: ke, labels: g, initialBusinessDetails: Ie, initialPersonalDetails: Le, initialAdditionalOwners: We, initialApplicationId: Ge = null, initialBoundAuthEpoch: Ze, onEditableDraftChange: ot, onApplicationDeleted: st, onNoticeReplacedByForm: ct, bankLogoSrc: lt, disclosureLinks: ut, showApplicationStatusRefresh: dt = !1, onResultPhaseChange: ft }) {
132
- let w = d(), { authEpoch: pt } = i();
133
- _(() => {
134
- w(Pe.Mounted);
135
- }, [w]);
136
- let T = {
137
- ...f,
132
+ function ot({ onEmbeddedOnboardingCompletedSuccessfully: te, onNavigateToDashboard: pe, onSuppressed: xe, labels: g, initialBusinessDetails: Fe, initialPersonalDetails: Le, initialAdditionalOwners: Re, initialApplicationId: Ge = null, initialBoundAuthEpoch: Ke, onEditableDraftChange: Ze, onApplicationDeleted: ot, onNoticeReplacedByForm: T, focusFormOnMount: st = !1, bankLogoSrc: ct, disclosureLinks: lt, showApplicationStatusRefresh: ut = !1, onResultPhaseChange: dt }) {
133
+ let E = f(), { authEpoch: ft } = i();
134
+ v(() => {
135
+ E(Pe.Mounted);
136
+ }, [E]);
137
+ let D = {
138
+ ...p,
138
139
  ...g,
139
- deleteFailedError: g?.deleteFailedError ?? f.deleteFailedError,
140
+ deleteFailedError: g?.deleteFailedError ?? p.deleteFailedError,
140
141
  stepIndicator: {
141
- ...f.stepIndicator,
142
+ ...p.stepIndicator,
142
143
  ...g?.stepIndicator
143
144
  },
144
145
  nextToStep: {
145
- ...f.nextToStep,
146
+ ...p.nextToStep,
146
147
  ...g?.nextToStep
147
148
  },
148
149
  backToStepAriaLabel: {
149
- ...f.backToStepAriaLabel,
150
+ ...p.backToStepAriaLabel,
150
151
  ...g?.backToStepAriaLabel
151
152
  },
152
153
  businessDetails: g?.businessDetails ?? {},
@@ -154,337 +155,335 @@ function ot({ onEmbeddedOnboardingCompletedSuccessfully: ne, onNavigateToDashboa
154
155
  additionalOwners: g?.additionalOwners ?? {},
155
156
  applicationReview: g?.applicationReview ?? {},
156
157
  result: {
157
- ...f.result,
158
+ ...p.result,
158
159
  ...g?.result
159
160
  },
160
161
  deleteApplicationDialog: g?.deleteApplicationDialog ?? {},
162
+ applicationDeleted: g?.applicationDeleted ?? {},
161
163
  applicationStatus: ve(g?.applicationStatus)
162
- }, E = ie().initResponse, { termsHref: mt, privacyHref: ht, electronicCommunicationHref: gt, patriotActHref: _t } = ut ?? {}, vt = Ke(() => {
163
- ne();
164
- }, [ne]), yt = re(), [D, O] = b(C.personal), [k, A] = b(() => ({
164
+ }, O = re().initResponse, { termsHref: pt, privacyHref: mt, electronicCommunicationHref: ht, patriotActHref: gt } = lt ?? {}, _t = _(() => {
165
+ te();
166
+ }, [te]), vt = ne(), [k, yt] = x(w.personal), [A, bt] = x(() => ({
165
167
  ...rt,
166
- ...Ie
167
- })), [j, bt] = b(() => ({
168
+ ...Fe
169
+ })), [j, xt] = x(() => ({
168
170
  ...it,
169
171
  ...Le
170
- })), [M, N] = b(() => We ?? []), [P, xt] = b(() => ({
171
- business: k,
172
+ })), [M, N] = x(() => Re ?? []), [P, St] = x(() => ({
173
+ business: A,
172
174
  personal: j,
173
175
  owners: M
174
- })), [St, Ct] = b(null);
175
- _(() => {
176
- if (!St) return;
176
+ })), [Ct, wt] = x(null);
177
+ v(() => {
178
+ if (!Ct) return;
177
179
  let e = {
178
- business: k,
180
+ business: A,
179
181
  personal: j,
180
182
  owners: M
181
183
  };
182
- xt((t) => St.next(e, t)), Ct(null);
184
+ St((t) => Ct.next(e, t)), wt(null);
183
185
  }, [
184
- St,
185
- k,
186
+ Ct,
187
+ A,
186
188
  j,
187
189
  M
188
190
  ]);
189
- let wt = (e, { ownersCleared: t = !1 } = {}) => Ct({ next: (n, r) => ({
191
+ let Tt = (e, { ownersCleared: t = !1 } = {}) => wt({ next: (n, r) => ({
190
192
  business: e.includes("business") ? n.business : r.business,
191
193
  personal: e.includes("personal") ? n.personal : r.personal,
192
194
  owners: t ? Qe : e.includes("owners") ? n.owners : r.owners
193
- }) }), [F, Tt] = b(null), [Et, Dt] = b(0), [Ot, kt] = b(!1), [I, At] = b(null), [L, jt] = b(null), [Mt, Nt] = b(null), [R, Pt] = b(Ge), [Ft, It] = b({}), Lt = (e) => It((t) => ({
195
+ }) }), [F, Et] = x(null), [Dt, Ot] = x(0), [kt, At] = x(!1), [I, jt] = x(null), [L, Mt] = x(null), [Nt, Pt] = x(null), [R, Ft] = x(Ge), [It, Lt] = x({}), Rt = (e) => Lt((t) => ({
194
196
  ...t,
195
- ...e.taxId && S(e.taxId) && e.taxIdStructure ? {
197
+ ...e.taxId && C(e.taxId) && e.taxIdStructure ? {
196
198
  taxId: e.taxId,
197
199
  taxIdStructure: e.taxIdStructure
198
200
  } : {},
199
- ...e.ssn && S(e.ssn) ? { ssn: e.ssn } : {}
200
- })), Rt = (e) => {
201
- let { taxId: t, taxIdStructure: n } = Ft, r = t !== void 0 && n !== void 0 && e.companyStructure !== k.companyStructure && e.companyStructure !== "" && e.companyStructure === "SOLE_PROPRIETORSHIP" != (n === "SOLE_PROPRIETORSHIP");
202
- A(r ? {
201
+ ...e.ssn && C(e.ssn) ? { ssn: e.ssn } : {}
202
+ })), zt = (e) => {
203
+ let { taxId: t, taxIdStructure: n } = It, r = t !== void 0 && n !== void 0 && e.companyStructure !== A.companyStructure && e.companyStructure !== "" && e.companyStructure === "SOLE_PROPRIETORSHIP" != (n === "SOLE_PROPRIETORSHIP");
204
+ bt(r ? {
203
205
  ...e,
204
206
  taxId: e.taxId === t ? "" : e.taxId,
205
207
  taxIdOnFileLast4: be(t),
206
208
  taxIdOnFileStructure: n
207
209
  } : e);
208
- }, [zt, Bt] = b(Ze ?? pt), [Vt, z] = b(null), [Ht, Ut] = b(null), [Wt, Gt] = b(0), Kt = y(null);
209
- _(() => {
210
- if (Wt === 0) return;
211
- let e = Kt.current;
210
+ }, [Bt, Vt] = x(Ke ?? ft), [Ht, z] = x(null), [Ut, Wt] = x(null), [Gt, Kt] = x(0), qt = b(null);
211
+ v(() => {
212
+ if (Gt === 0) return;
213
+ let e = qt.current;
212
214
  (e?.querySelector("[aria-invalid=\"true\"]") ?? e?.querySelector("[data-needs-attention]"))?.focus();
213
- }, [Wt]);
214
- let [qt, Jt] = b(!1), [Yt, Xt] = b(!1), [Zt, Qt] = b(!1), [$t, en] = b(null), tn = ze(), B = Be(), nn = Ve(), rn = He(), an = Ue(), { setClientSecret: on } = Re(), { data: sn, refetch: cn } = s(), { mutateAsync: ln } = o(), un = l(), V = u(), dn = ae(), [fn, pn] = qe((e) => e + 1, 0), mn = v(() => le(V.applications), [V.applications]), hn = y(null);
215
- V.isResolved && (hn.current = { application: mn });
216
- let H = V.isResolved ? mn : hn.current?.application ?? null, gn = ce(H), U = ye(H), _n = V.isResolved || hn.current !== null && U === me.Form;
217
- _(() => {
218
- if (gn === null) return;
219
- let e = gn - Date.now();
215
+ }, [Gt]);
216
+ let [Jt, Yt] = x(!1), [Xt, Zt] = x(!1), [Qt, $t] = x(!1), [en, tn] = x(null), nn = Be(), B = Ve(), rn = He(), an = Ue(), on = We(), { setClientSecret: sn } = ze(), { data: cn, refetch: ln } = s(), { mutateAsync: un } = o(), dn = l(), V = u(), fn = ie(), [pn, mn] = qe((e) => e + 1, 0), hn = y(() => ce(V.applications), [V.applications]), gn = b(null);
217
+ V.isResolved && (gn.current = { application: hn });
218
+ let H = V.isResolved ? hn : gn.current?.application ?? null, _n = se(H), U = ye(H), vn = V.isResolved || gn.current !== null && U === me.Form;
219
+ v(() => {
220
+ if (_n === null) return;
221
+ let e = _n - Date.now();
220
222
  if (e < 0) return;
221
- let t = setTimeout(pn, Math.min(e + 1, Xe));
223
+ let t = setTimeout(mn, Math.min(e + 1, Xe));
222
224
  return () => clearTimeout(t);
223
- }, [gn, fn]);
224
- let vn = y(null);
225
- _(() => () => vn.current?.abort(), []);
226
- let yn = v(() => se(T.businessDetails.naicsTitles), [T.businessDetails.naicsTitles]), bn = v(() => r(T.businessDetails.stateTitles), [T.businessDetails.stateTitles]), xn = v(() => r(T.personalDetails.stateTitles), [T.personalDetails.stateTitles]), Sn = v(() => r(T.additionalOwners.stateTitles), [T.additionalOwners.stateTitles]), W = Zt || $t !== null, Cn = y(ft);
227
- Cn.current = ft, _(() => {
228
- if (W) return Cn.current?.(!0), () => Cn.current?.(!1);
225
+ }, [_n, pn]);
226
+ let yn = b(null);
227
+ v(() => () => yn.current?.abort(), []);
228
+ let bn = y(() => oe(D.businessDetails.naicsTitles), [D.businessDetails.naicsTitles]), xn = y(() => r(D.businessDetails.stateTitles), [D.businessDetails.stateTitles]), Sn = y(() => r(D.personalDetails.stateTitles), [D.personalDetails.stateTitles]), Cn = y(() => r(D.additionalOwners.stateTitles), [D.additionalOwners.stateTitles]), W = Qt || en !== null, wn = b(dt);
229
+ wn.current = dt, v(() => {
230
+ if (W) return wn.current?.(!0), () => wn.current?.(!1);
229
231
  }, [W]);
230
- let wn = E?.status === "ACTIVE" || E?.status === "INACTIVE", Tn = E?.status === "INVITED", En = wn || Tn, G = un.isResolved && _n, Dn = E && !W && !En && G && _e(U) ? U : null, On = !!E && !W && Dn === null && (En || G && (un.isSuppressed || U === me.Hidden)), K = On ? wn ? c.UserAlreadyOnboarded : Tn ? c.UserInvitedToOrganization : U === me.Hidden ? ge(H) : un.reason ?? ge(H) : null, kn = !!E && G && !W, [An, jn] = b(!1), Mn = An && On && !En && K !== c.OrganizationApplicationDenialExpired, q = Dn ?? (Mn ? "unavailable" : null);
231
- kn && An !== (q !== null) && jn(q !== null);
232
- let J = Mn && K === c.OrganizationApplicationComplete, Nn = oe(), [Y, Pn] = b("idle"), [Fn, In] = b(!1);
233
- kn && J !== Fn && (In(J), J && Pn("requested")), Y === "requested" && Nn && Pn("inFlight"), Y === "inFlight" && !Nn && Pn("idle");
234
- let Ln = J && Y !== "idle", Rn = y(ke);
235
- Rn.current = ke;
236
- let zn = On && q === null;
237
- _(() => {
238
- zn && K && (w(Pe.Suppressed, { reason: K }), console.info(`[onboarding] not shown: ${K}`), Rn.current?.(K));
232
+ let Tn = O?.status === "ACTIVE" || O?.status === "INACTIVE", En = O?.status === "INVITED", Dn = Tn || En, G = dn.isResolved && vn, On = O && !W && !Dn && G && _e(U) ? U : null, kn = !!O && !W && On === null && (Dn || G && (dn.isSuppressed || U === me.Hidden)), K = kn ? Tn ? c.UserAlreadyOnboarded : En ? c.UserInvitedToOrganization : U === me.Hidden ? ge(H) : dn.reason ?? ge(H) : null, An = !!O && G && !W, [jn, Mn] = x(!1), Nn = jn && kn && !Dn && K !== c.OrganizationApplicationDenialExpired, q = On ?? (Nn ? "unavailable" : null);
233
+ An && jn !== (q !== null) && Mn(q !== null);
234
+ let J = Nn && K === c.OrganizationApplicationComplete, Pn = ae(), [Y, Fn] = x("idle"), [In, Ln] = x(!1);
235
+ An && J !== In && (Ln(J), J && Fn("requested")), Y === "requested" && Pn && Fn("inFlight"), Y === "inFlight" && !Pn && Fn("idle");
236
+ let Rn = J && Y !== "idle", zn = b(xe);
237
+ zn.current = xe;
238
+ let Bn = kn && q === null;
239
+ v(() => {
240
+ Bn && K && (E(Pe.Suppressed, { reason: K }), console.info(`[onboarding] not shown: ${K}`), zn.current?.(K));
239
241
  }, [
240
- zn,
242
+ Bn,
241
243
  K,
242
- w
244
+ E
243
245
  ]);
244
- let Bn = dn ? null : Dn;
245
- _(() => {
246
- Bn && w(Pe.ApplicationStatusShown, { view: Bn });
247
- }, [Bn, w]);
248
- let Vn = y(q), Hn = y(ct);
249
- Hn.current = ct;
250
- let Un = y(yt);
251
- Un.current = yt, _(() => {
246
+ let Vn = fn ? null : On;
247
+ v(() => {
248
+ Vn && E(Pe.ApplicationStatusShown, { view: Vn });
249
+ }, [Vn, E]);
250
+ let Hn = b(q), Un = b(T);
251
+ Un.current = T;
252
+ let Wn = b(vt);
253
+ Wn.current = vt, v(() => {
252
254
  if (!G || W) return;
253
- let e = Vn.current !== null;
254
- Vn.current = q, e && q === null && U === me.Form && Hn.current?.();
255
+ let e = Hn.current !== null;
256
+ Hn.current = q, e && q === null && U === me.Form && Un.current?.();
255
257
  }, [
256
258
  U,
257
259
  W,
258
260
  G,
259
261
  q
260
- ]), _(() => {
261
- Y === "requested" && Un.current();
262
- }, [Y]), _(() => {
263
- ot?.(W || R === null ? null : {
262
+ ]), v(() => {
263
+ Y === "requested" && Wn.current();
264
+ }, [Y]), v(() => {
265
+ Ze?.(W || R === null ? null : {
264
266
  applicationId: R,
265
- authEpoch: zt
267
+ authEpoch: Bt
266
268
  });
267
269
  }, [
268
- ot,
270
+ Ze,
269
271
  W,
270
272
  R,
271
- zt
273
+ Bt
272
274
  ]);
273
- let Wn = y(pt);
274
- if (Wn.current = pt, !E) return null;
275
+ let Gn = b(ft);
276
+ if (Gn.current = ft, !O) return null;
275
277
  if (!W) {
276
- if (On && !q || Ln || !G) return null;
278
+ if (kn && !q || Rn || !G) return null;
277
279
  if (q) {
278
- if (dn) return null;
279
- let t = he(q, H, E.bankName?.trim() || T.fallbackBankName, T.applicationStatus), n = /* @__PURE__ */ x(de, {
280
+ if (fn) return null;
281
+ let t = he(q, H, O.bankName?.trim() || D.fallbackBankName, D.applicationStatus), n = /* @__PURE__ */ S(ue, {
280
282
  ...t,
281
283
  className: "ttw:max-w-2xl",
282
284
  testIds: {
283
- root: p.statusCard,
284
- chip: p.statusCardChip
285
+ root: m.statusCard,
286
+ chip: m.statusCardChip
285
287
  },
286
- action: dt ? /* @__PURE__ */ x(e, {
288
+ action: ut ? /* @__PURE__ */ S(e, {
287
289
  variant: "outline",
288
- onClick: J ? () => Pn("requested") : un.refetch,
289
- "data-testid": p.statusCardCheckAgain,
290
- children: T.applicationStatus.checkAgain
290
+ onClick: J ? () => Fn("requested") : dn.refetch,
291
+ "data-testid": m.statusCardCheckAgain,
292
+ children: D.applicationStatus.checkAgain
291
293
  }) : void 0
292
294
  });
293
- return /* @__PURE__ */ x("div", {
294
- className: "ttw:grid ttw:h-full ttw:w-full ttw:place-items-center ttw:overflow-auto ttw:bg-background ttw:p-6",
295
+ return /* @__PURE__ */ S("div", {
296
+ className: "ttw:grid ttw:w-full ttw:place-items-center ttw:overflow-auto ttw:bg-background ttw:p-6",
295
297
  children: n
296
298
  });
297
299
  }
298
300
  }
299
- let X = k.companyStructure === "SOLE_PROPRIETORSHIP", Gn = [
300
- T.stepIndicator.personal,
301
- T.stepIndicator.business,
302
- T.stepIndicator.review,
303
- T.stepIndicator.terms
304
- ], Kn = L !== null && I !== null && Mt !== null, qn = D === C.personal ? L !== null : D === C.business ? I !== null && Mt !== null : D === C.review ? Kn : Kn && Se(k), Z = tn.isPending || B.isPending || nn.isPending || rn.isPending || Zt, Jn = () => {
305
- A((e) => e.isAuthorized === null && !e.isCheckboxChecked ? e : {
301
+ let X = A.companyStructure === "SOLE_PROPRIETORSHIP", Kn = [
302
+ D.stepIndicator.personal,
303
+ D.stepIndicator.business,
304
+ D.stepIndicator.review,
305
+ D.stepIndicator.terms
306
+ ], qn = L !== null && I !== null && Nt !== null, Jn = k === w.personal ? L !== null : k === w.business ? I !== null && Nt !== null : k === w.review ? qn : qn && Se(A), Z = nn.isPending || B.isPending || rn.isPending || an.isPending || Qt, Yn = () => {
307
+ bt((e) => e.isAuthorized === null && !e.isCheckboxChecked ? e : {
306
308
  ...e,
307
309
  isAuthorized: null,
308
310
  isCheckboxChecked: !1
309
311
  });
310
- }, Yn = () => {
311
- z(null), Jn(), O(C.personal);
312
312
  }, Xn = () => {
313
- z(null), Jn(), O(C.business);
313
+ z(null), Yn(), yt(w.personal);
314
314
  }, Zn = () => {
315
- z(null), D === C.review && Jn(), F && N(tt(M, F)), O((e) => e === C.personal ? e : e - 1);
315
+ z(null), Yn(), yt(w.business);
316
+ }, Qn = () => {
317
+ z(null), k === w.review && Yn(), F && N(tt(M, F)), yt((e) => e === w.personal ? e : e - 1);
316
318
  }, Q = {
317
- business: m(k) !== m(P.business),
318
- personal: m(j) !== m(P.personal),
319
- owners: m(nt(k.companyStructure === "SOLE_PROPRIETORSHIP" ? Qe : tt(M, F))) !== m(nt(P.owners))
320
- }, Qn = async (e) => {
321
- Qt(!0);
319
+ business: h(A) !== h(P.business),
320
+ personal: h(j) !== h(P.personal),
321
+ owners: h(nt(A.companyStructure === "SOLE_PROPRIETORSHIP" ? Qe : tt(M, F))) !== h(nt(P.owners))
322
+ }, $n = async (e) => {
323
+ $t(!0);
322
324
  let t = new AbortController();
323
- vn.current = t;
325
+ yn.current = t;
324
326
  let n = !1;
325
327
  try {
326
- let r = await nn.mutateAsync({ path: { id: e } });
328
+ let r = await rn.mutateAsync({ path: { id: e } });
327
329
  if (t.signal.aborted) return;
328
- if (!r.id) throw Error(T.submitFailedError);
329
- if (n = !0, (await an(e, { signal: t.signal })).status === "complete") {
330
- let e = sn;
331
- if (e === void 0 && (e = (await cn()).data), t.signal.aborted) return;
330
+ if (!r.id) throw Error(D.submitFailedError);
331
+ if (n = !0, (await on(e, { signal: t.signal })).status === "complete") {
332
+ let e = cn;
333
+ if (e === void 0 && (e = (await ln()).data), t.signal.aborted) return;
332
334
  if (e !== void 0) try {
333
- await ln({ displayedVersion: a(e)?.disclosureId ?? null });
335
+ await un({ displayedVersion: a(e)?.disclosureId ?? null });
334
336
  } catch {}
335
337
  if (t.signal.aborted) return;
336
- en("success"), yt(), vt();
337
- } else en("pending");
338
+ tn("success"), vt(), _t();
339
+ } else tn("pending");
338
340
  } catch (e) {
339
341
  if (e instanceof DOMException && e.name === "AbortError") return;
340
342
  if (!n) throw e;
341
- en("pending");
343
+ tn("pending");
342
344
  } finally {
343
- vn.current = null, Qt(!1);
345
+ yn.current = null, $t(!1);
344
346
  }
345
- }, $n = ({ evenWithoutMarker: e = !1 } = {}) => {
346
- A((t) => (t.taxIdOnFileLast4 || e) && S(t.taxId) ? $e(t) : t);
347
347
  }, er = ({ evenWithoutMarker: e = !1 } = {}) => {
348
- bt((t) => (t.ssnOnFileLast4 || e) && S(t.ssn) ? et(t) : t);
348
+ bt((t) => (t.taxIdOnFileLast4 || e) && C(t.taxId) ? $e(t) : t);
349
349
  }, tr = ({ evenWithoutMarker: e = !1 } = {}) => {
350
- N((t) => t.map((t) => (t.ssnOnFileLast4 || e && t.id) && S(t.ssn) ? et(t) : t));
351
- }, nr = () => {
352
- N((e) => e.map(Fe));
353
- }, rr = async (e) => {
354
- let t = Wn.current, n = await tn.mutateAsync({ body: Ne(e, j) });
355
- return Pt(n.id), Bt(t), n.clientSecret && on(n.id, n.clientSecret), n.id;
356
- }, ir = async () => {
357
- if (D === C.personal) {
350
+ xt((t) => (t.ssnOnFileLast4 || e) && C(t.ssn) ? et(t) : t);
351
+ }, nr = ({ evenWithoutMarker: e = !1 } = {}) => {
352
+ N((t) => t.map((t) => (t.ssnOnFileLast4 || e && t.id) && C(t.ssn) ? et(t) : t));
353
+ }, rr = () => {
354
+ N((e) => e.map(Ie));
355
+ }, ir = async (e) => {
356
+ let t = Gn.current, n = await nn.mutateAsync({ body: Ne(e, j) });
357
+ return Ft(n.id), Vt(t), n.clientSecret && sn(n.id, n.clientSecret), n.id;
358
+ }, ar = async () => {
359
+ if (k === w.personal) {
358
360
  if (!L) return null;
359
361
  let e = P.business.companyStructure === "SOLE_PROPRIETORSHIP", t = R;
360
362
  return t ? await B.mutateAsync({
361
363
  path: { id: t },
362
- body: h({
364
+ body: ke({
363
365
  applicant: L,
364
366
  isSoleProprietor: e
365
367
  })
366
- }) : t = await rr(Oe({
368
+ }) : t = await ir(Oe({
367
369
  applicant: L,
368
370
  isSoleProprietor: e
369
- })), Lt({ ssn: L.ssn }), er(), wt(["personal"]), t;
371
+ })), Rt({ ssn: L.ssn }), tr(), Tt(["personal"]), t;
370
372
  }
371
- if (D === C.business) {
372
- if (!L || !I || !Mt) return null;
373
+ if (k === w.business) {
374
+ if (!L || !I || !Nt) return null;
373
375
  let e = {
374
376
  businessDetails: I,
375
377
  applicant: L,
376
- businessOwners: Mt
378
+ businessOwners: Nt
377
379
  }, t = R;
378
380
  return t ? await B.mutateAsync({
379
381
  path: { id: t },
380
- body: h(e)
381
- }) : t = await rr(h(e)), Lt({
382
+ body: ke(e)
383
+ }) : t = await ir(ke(e)), Rt({
382
384
  taxId: I.taxId,
383
385
  taxIdStructure: I.companyStructure,
384
386
  ssn: L.ssn
385
- }), $n(), er(), X ? nr() : tr(), wt([
387
+ }), er(), tr(), X ? rr() : nr(), Tt([
386
388
  "business",
387
389
  "personal",
388
390
  "owners"
389
391
  ], { ownersCleared: X }), t;
390
392
  }
391
- return D === C.review ? Kn ? R : null : !R || !Se(k) ? null : (await B.mutateAsync({
393
+ return k === w.review ? qn ? R : null : !R || !Se(A) ? null : (await B.mutateAsync({
392
394
  path: { id: R },
393
- body: h({ consent: {
395
+ body: ke({ consent: {
394
396
  isLegallyAuthorized: !0,
395
397
  hasAcceptedDisclosures: !0
396
398
  } })
397
- }), wt(["business"]), R);
398
- }, ar = async () => {
399
- if (z(null), !qn) {
400
- Ut(D), Gt((e) => e + 1);
399
+ }), Tt(["business"]), R);
400
+ }, or = async () => {
401
+ if (z(null), !Jn) {
402
+ Wt(k), Kt((e) => e + 1);
401
403
  return;
402
404
  }
403
405
  let e;
404
406
  try {
405
- e = await ir();
407
+ e = await ar();
406
408
  } catch {
407
- z(T.genericRetryError);
409
+ z(D.genericRetryError);
408
410
  return;
409
411
  }
410
412
  if (e !== null) {
411
- if (Ut(null), D === C.terms) try {
412
- await Qn(e);
413
+ if (Wt(null), k === w.terms) try {
414
+ await $n(e);
413
415
  } catch {
414
- z(T.submitFailedError);
416
+ z(D.submitFailedError);
415
417
  }
416
- else O(D + 1);
418
+ else yt(k + 1);
417
419
  }
418
- }, or = async () => {
419
- z(null), Jt(!0);
420
+ }, sr = async () => {
421
+ z(null), Yt(!0);
420
422
  try {
421
- if (await ir() === null) return;
422
- er({ evenWithoutMarker: !0 }), D >= C.business && ($n({ evenWithoutMarker: !0 }), tr({ evenWithoutMarker: !0 })), n.success(T.applicationSavedToast);
423
+ if (await ar() === null) return;
424
+ tr({ evenWithoutMarker: !0 }), k >= w.business && (er({ evenWithoutMarker: !0 }), nr({ evenWithoutMarker: !0 })), n.success(D.applicationSavedToast);
423
425
  } catch {
424
- n.error(T.genericRetryError);
426
+ n.error(D.genericRetryError);
425
427
  } finally {
426
- Jt(!1);
428
+ Yt(!1);
427
429
  }
428
- }, sr = async () => {
430
+ }, cr = async () => {
429
431
  let e = tt(M, F), t = Me({
430
- businessDetails: k,
432
+ businessDetails: A,
431
433
  applicant: j,
432
434
  businessOwners: e,
433
435
  savedBusinessDetails: P.business,
434
436
  savedOwners: P.owners,
435
437
  dirty: Q
436
438
  }), r = Q;
437
- kt(!0);
439
+ At(!0);
438
440
  try {
439
441
  if (!t) {
440
- n.error(T.saveDraftNothingValidError);
442
+ n.error(D.saveDraftNothingValidError);
441
443
  return;
442
444
  }
443
445
  R ? await B.mutateAsync({
444
446
  path: { id: R },
445
447
  body: t
446
- }) : await rr(je(t)), F && N(e), n.success(T.applicationSavedToast);
448
+ }) : await ir(je(t)), F && N(e), n.success(D.applicationSavedToast);
447
449
  let i = t;
448
- Lt({
450
+ Rt({
449
451
  taxId: i.businessDetails?.taxId?.value,
450
- taxIdStructure: k.companyStructure,
452
+ taxIdStructure: A.companyStructure,
451
453
  ssn: i.applicant?.personalIdentificationNumber?.value
452
- }), i.businessDetails?.taxId !== void 0 && $n({ evenWithoutMarker: !0 }), i.applicant?.personalIdentificationNumber !== void 0 && er({ evenWithoutMarker: !0 }), Array.isArray(i.businessOwners) && tr({ evenWithoutMarker: !0 }), i.businessOwners === null && e.length > 0 && nr();
454
+ }), i.businessDetails?.taxId !== void 0 && er({ evenWithoutMarker: !0 }), i.applicant?.personalIdentificationNumber !== void 0 && tr({ evenWithoutMarker: !0 }), Array.isArray(i.businessOwners) && nr({ evenWithoutMarker: !0 }), i.businessOwners === null && e.length > 0 && rr();
453
455
  let a = Array.isArray(i.businessOwners) ? "list" : i.businessOwners === null ? "cleared" : "none";
454
- Ct({ next: (e, t) => Ae({
456
+ wt({ next: (e, t) => Ae({
455
457
  current: e,
456
458
  saved: t,
457
459
  dirty: r,
458
460
  ownersWrite: a
459
- }) }), Tt(null), Dt((e) => e + 1);
461
+ }) }), Et(null), Ot((e) => e + 1);
460
462
  } catch {
461
- n.error(T.genericRetryError);
463
+ n.error(D.genericRetryError);
462
464
  } finally {
463
- kt(!1);
465
+ At(!1);
464
466
  }
465
- }, cr = async () => {
466
- if (R !== null) {
467
- try {
468
- await rn.mutateAsync({ path: { id: R } });
469
- } catch {
470
- n.error(T.deleteFailedError);
471
- return;
472
- }
473
- n.success(T.applicationDeletedToast);
467
+ }, lr = async () => {
468
+ if (R !== null) try {
469
+ await an.mutateAsync({ path: { id: R } });
470
+ } catch {
471
+ n.error(D.deleteFailedError);
472
+ return;
474
473
  }
475
- Xt(!1), st?.();
476
- }, lr = at(D, T), ur = E.bankName?.trim() || T.fallbackBankName, dr = ue(T.shellFdicDisclaimer, ur);
474
+ Zt(!1), ot?.();
475
+ }, ur = at(k, D), dr = O.bankName?.trim() || D.fallbackBankName, fr = le(D.shellFdicDisclaimer, dr);
477
476
  if (W) {
478
- let e = I?.companyLegalName ?? "", t = E.bankName?.trim() || T.fallbackBankName, n = $t ?? "pending", r = n === "success", i = {
479
- ...f.result,
480
- ...T.result
481
- }, a = /* @__PURE__ */ x(fe, {
477
+ let e = I?.companyLegalName ?? "", t = O.bankName?.trim() || D.fallbackBankName, n = en ?? "pending", r = n === "success", i = {
478
+ ...p.result,
479
+ ...D.result
480
+ }, a = /* @__PURE__ */ S(de, {
482
481
  testIds: {
483
- processing: p.resultProcessing,
484
- dashboardButton: p.resultDashboardButton
482
+ processing: m.resultProcessing,
483
+ dashboardButton: m.resultDashboardButton
485
484
  },
486
485
  status: n,
487
- isLoading: Zt,
486
+ isLoading: Qt,
488
487
  loadingMessage: i.loadingMessage,
489
488
  headingLine1: r ? i.successHeadingLine1 : i.pendingHeadingLine1,
490
489
  headingLine2: `${e}!`,
@@ -492,152 +491,155 @@ function ot({ onEmbeddedOnboardingCompletedSuccessfully: ne, onNavigateToDashboa
492
491
  followUpEmail: L?.workEmail ?? "",
493
492
  emailBoxLead: i.pendingEmailBoxLead,
494
493
  navigateToDashboardLabel: i.navigateToDashboard,
495
- bankLogoSrc: lt,
496
- bankLogoAlt: ue(i.bankLogoAlt, t),
497
- fdicDisclaimer: ue(i.fdicDisclaimer, t),
498
- onNavigateToDashboard: xe
494
+ bankLogoSrc: ct,
495
+ bankLogoAlt: le(i.bankLogoAlt, t),
496
+ fdicDisclaimer: le(i.fdicDisclaimer, t),
497
+ onNavigateToDashboard: pe
499
498
  });
500
- return /* @__PURE__ */ x("div", {
501
- className: "ttw:grid ttw:h-full ttw:w-full ttw:grid-rows-[1fr] ttw:place-items-center ttw:gap-0 ttw:overflow-auto ttw:bg-background",
499
+ return /* @__PURE__ */ S("div", {
500
+ className: "ttw:grid ttw:w-full ttw:place-items-center ttw:gap-0 ttw:overflow-auto ttw:bg-background",
502
501
  children: a
503
502
  });
504
503
  }
505
- let fr = D === C.personal ? T.nextToStep.business : D === C.business ? T.nextToStep.review : D === C.review ? T.nextToStep.terms : T.submit, pr = D === C.business ? T.backToStepAriaLabel.personal : D === C.review ? T.backToStepAriaLabel.business : D === C.terms ? T.backToStepAriaLabel.review : void 0, mr = Z, $ = Ht === D, hr = Q.business || Q.personal || Q.owners, gr = qn ? or : sr, _r = Z || Ot || !qn && !hr, vr = `${j.firstName} ${j.lastName}`.trim(), yr = X ? 100 : L?.ownsOver25Percent === !0 ? L.ownershipPercentage ?? 0 : 0, br = X ? Qe : M, xr = Ht === C.business && D === C.business && br.some((e) => !e.reviewed) ? T.ownersNeedReviewError : null;
504
+ let pr = k === w.personal ? D.nextToStep.business : k === w.business ? D.nextToStep.review : k === w.review ? D.nextToStep.terms : D.submit, mr = k === w.business ? D.backToStepAriaLabel.personal : k === w.review ? D.backToStepAriaLabel.business : k === w.terms ? D.backToStepAriaLabel.review : void 0, hr = Z, $ = Ut === k, gr = Q.business || Q.personal || Q.owners, _r = Jn ? sr : cr, vr = Z || kt || !Jn && !gr, yr = `${j.firstName} ${j.lastName}`.trim(), br = X ? 100 : L?.ownsOver25Percent === !0 ? L.ownershipPercentage ?? 0 : 0, xr = X ? Qe : M, Sr = Ut === w.business && k === w.business && xr.some((e) => !e.reviewed) ? D.ownersNeedReviewError : null;
506
505
  return /* @__PURE__ */ Ye(Je, { children: [
507
- /* @__PURE__ */ x(te, {
508
- title: lr.title,
509
- subtitle: lr.subtitle,
510
- stepLabels: Gn,
511
- activeStep: D,
512
- disclaimerText: dr,
513
- onBack: Zn,
514
- showBackButton: D !== C.personal,
515
- backAriaLabel: pr,
516
- onNext: ar,
517
- onSaveAndClose: gr,
518
- onDelete: () => Xt(!0),
519
- isNextDisabled: mr,
520
- isNextLoading: Z && !qt,
521
- isSaveAndCloseDisabled: _r,
522
- isSaveAndCloseLoading: qt || Ot,
523
- nextLabel: fr,
506
+ /* @__PURE__ */ S(d, {
507
+ title: ur.title,
508
+ subtitle: ur.subtitle,
509
+ focusTitleOnMount: st,
510
+ stepLabels: Kn,
511
+ activeStep: k,
512
+ disclaimerText: fr,
513
+ onBack: Qn,
514
+ showBackButton: k !== w.personal,
515
+ backAriaLabel: mr,
516
+ onNext: or,
517
+ onSaveAndClose: _r,
518
+ onDelete: () => Zt(!0),
519
+ isNextDisabled: hr,
520
+ isNextLoading: Z && !Jt,
521
+ isSaveAndCloseDisabled: vr,
522
+ isSaveAndCloseLoading: Jt || kt,
523
+ nextLabel: pr,
524
524
  nextIcon: null,
525
- nextTone: D === C.terms ? "success" : "primary",
526
- isTitleVisuallyHidden: D === C.terms,
527
- errorMessage: Vt,
525
+ nextTone: k === w.terms ? "success" : "primary",
526
+ isTitleVisuallyHidden: k === w.terms,
527
+ errorMessage: Ht,
528
528
  labels: {
529
- backButton: T.back,
530
- saveAndCloseButton: T.saveAndClose,
531
- deleteButton: T.deleteApplication
529
+ backButton: D.back,
530
+ saveAndCloseButton: D.saveAndClose,
531
+ deleteButton: D.deleteApplication
532
532
  },
533
533
  testIds: {
534
- root: p.shell,
535
- back: p.shellBack,
536
- saveAndClose: p.shellSaveAndClose,
537
- delete: p.shellDelete,
538
- next: p.shellNext,
534
+ root: m.shell,
535
+ back: m.shellBack,
536
+ saveAndClose: m.shellSaveAndClose,
537
+ delete: m.shellDelete,
538
+ next: m.shellNext,
539
539
  scrollRegion: {
540
- root: p.shellScrollRegion,
541
- fade: p.shellScrollFade,
542
- hint: p.shellScrollHint
540
+ root: m.shellScrollRegion,
541
+ fade: m.shellScrollFade
543
542
  }
544
543
  },
545
544
  children: /* @__PURE__ */ Ye("div", {
546
- ref: Kt,
545
+ ref: qt,
547
546
  className: "ttw:contents",
548
547
  children: [
549
- D === C.personal ? /* @__PURE__ */ x("div", {
548
+ k === w.personal ? /* @__PURE__ */ S("div", {
550
549
  className: "ttw:max-w-2xl",
551
- children: /* @__PURE__ */ x(we, {
550
+ children: /* @__PURE__ */ S(we, {
552
551
  value: j,
553
- onValueChange: bt,
554
- onSnapshotChange: jt,
555
- stateOptions: xn,
552
+ onValueChange: xt,
553
+ onSnapshotChange: Mt,
554
+ stateOptions: Sn,
556
555
  isSubmitting: Z,
557
556
  showAllErrors: $,
558
- labels: T.personalDetails
557
+ labels: D.personalDetails
559
558
  }, "personal")
560
559
  }) : null,
561
- D === C.business ? /* @__PURE__ */ Ye("div", {
560
+ k === w.business ? /* @__PURE__ */ Ye("div", {
562
561
  className: "ttw:flex ttw:max-w-2xl ttw:flex-col ttw:gap-10",
563
562
  children: [
564
- /* @__PURE__ */ x(Ce, {
565
- value: k,
566
- onValueChange: Rt,
567
- onSnapshotChange: At,
568
- naicsOptions: yn,
569
- stateOptions: bn,
563
+ /* @__PURE__ */ S(Ce, {
564
+ value: A,
565
+ onValueChange: zt,
566
+ onSnapshotChange: jt,
567
+ naicsOptions: bn,
568
+ stateOptions: xn,
570
569
  isSubmitting: Z,
571
570
  showAllErrors: $,
572
- labels: T.businessDetails
571
+ labels: D.businessDetails
573
572
  }, "business"),
574
- /* @__PURE__ */ x(t, {}),
575
- /* @__PURE__ */ x(De, {
576
- owners: br,
573
+ /* @__PURE__ */ S(t, {}),
574
+ /* @__PURE__ */ S(De, {
575
+ owners: xr,
577
576
  onOwnersChange: N,
578
- primaryOwnerName: vr,
579
- primaryOwnerPercentage: yr,
580
- stateOptions: Sn,
581
- onSnapshotChange: Nt,
582
- onPendingOwnerChange: Tt,
577
+ primaryOwnerName: yr,
578
+ primaryOwnerPercentage: br,
579
+ stateOptions: Cn,
580
+ onSnapshotChange: Pt,
581
+ onPendingOwnerChange: Et,
583
582
  isSubmitting: Z,
584
583
  showAllErrors: $,
585
- revealErrorsAttempt: Wt,
586
- reviewError: xr,
587
- labels: T.additionalOwners
588
- }, `${Et}-${X}`)
584
+ revealErrorsAttempt: Gt,
585
+ reviewError: Sr,
586
+ labels: D.additionalOwners
587
+ }, `${Dt}-${X}`)
589
588
  ]
590
589
  }) : null,
591
- D === C.review ? /* @__PURE__ */ x(Te, {
592
- personalDetails: j,
593
- businessDetails: k,
594
- additionalOwners: br,
595
- primaryOwnerName: vr,
596
- primaryOwnerPercentage: yr,
597
- personalStateOptions: xn,
598
- businessStateOptions: bn,
599
- naicsOptions: yn,
600
- onEditPersonal: Yn,
601
- onEditBusiness: Xn,
602
- ownersEditAriaLabel: T.reviewOwnersEditAriaLabel,
603
- isSubmitting: Z,
604
- labels: T
590
+ k === w.review ? /* @__PURE__ */ S("div", {
591
+ className: "ttw:max-w-2xl",
592
+ children: /* @__PURE__ */ S(Te, {
593
+ personalDetails: j,
594
+ businessDetails: A,
595
+ additionalOwners: xr,
596
+ primaryOwnerName: yr,
597
+ primaryOwnerPercentage: br,
598
+ personalStateOptions: Sn,
599
+ businessStateOptions: xn,
600
+ naicsOptions: bn,
601
+ onEditPersonal: Xn,
602
+ onEditBusiness: Zn,
603
+ ownersEditAriaLabel: D.reviewOwnersEditAriaLabel,
604
+ isSubmitting: Z,
605
+ labels: D
606
+ })
605
607
  }) : null,
606
- D === C.terms ? /* @__PURE__ */ x(Ee, {
607
- value: k,
608
- onValueChange: A,
608
+ k === w.terms ? /* @__PURE__ */ S(Ee, {
609
+ value: A,
610
+ onValueChange: bt,
609
611
  isSubmitting: Z,
610
612
  showAllErrors: $,
611
- labels: T.businessDetails,
612
- bankName: ur,
613
- termsHref: mt,
614
- privacyHref: ht,
615
- electronicCommunicationHref: gt,
616
- patriotActHref: _t
613
+ labels: D.businessDetails,
614
+ bankName: dr,
615
+ termsHref: pt,
616
+ privacyHref: mt,
617
+ electronicCommunicationHref: ht,
618
+ patriotActHref: gt
617
619
  }) : null
618
620
  ]
619
621
  })
620
622
  }),
621
- /* @__PURE__ */ x(pe, {
622
- open: Yt,
623
- onConfirm: cr,
624
- onCancel: () => Xt(!1),
625
- isDeleting: rn.isPending,
623
+ /* @__PURE__ */ S(fe, {
624
+ open: Xt,
625
+ onConfirm: lr,
626
+ onCancel: () => Zt(!1),
627
+ isDeleting: an.isPending,
626
628
  labels: {
627
- descriptionEmphasis: T.saveAndClose,
628
- ...T.deleteApplicationDialog
629
+ descriptionEmphasis: D.saveAndClose,
630
+ ...D.deleteApplicationDialog
629
631
  },
630
632
  testIds: {
631
- root: p.deleteDialog,
632
- confirm: p.deleteDialogConfirm,
633
- cancel: p.deleteDialogCancel
633
+ root: m.deleteDialog,
634
+ confirm: m.deleteDialogConfirm,
635
+ cancel: m.deleteDialogCancel
634
636
  }
635
637
  }),
636
- /* @__PURE__ */ x(ee, {})
638
+ /* @__PURE__ */ S(ee, {})
637
639
  ] });
638
640
  }
639
- function st({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, uiFramework: o, errorFallback: s, onError: c, analytics: l, disclosuresAcceptance: u, providerLabels: ee, ...te }) {
640
- return /* @__PURE__ */ x(ne, {
641
+ function T({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, uiFramework: o, errorFallback: s, onError: c, analytics: l, disclosuresAcceptance: u, providerLabels: ee, ...d }) {
642
+ return /* @__PURE__ */ S(te, {
641
643
  baseUrl: e,
642
644
  widgetToken: t,
643
645
  organizationId: n,
@@ -650,47 +652,61 @@ function st({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, ga
650
652
  analytics: l,
651
653
  disclosuresAcceptance: u,
652
654
  providerLabels: ee,
653
- widgetName: g,
654
- children: /* @__PURE__ */ x(ct, { ...te })
655
+ widgetName: Fe,
656
+ children: /* @__PURE__ */ S(st, { ...d })
655
657
  });
656
658
  }
657
- function ct(e) {
658
- let { initResponse: t } = ie(), { client: n } = i(), r = t?.userId ?? null, [a, o] = b(r), [s, c] = b(0);
659
+ function st(e) {
660
+ let { initResponse: t } = re(), { client: n } = i(), r = t?.userId ?? null, [a, o] = x(r), [s, c] = x(0);
659
661
  r !== a && (o(r), a !== null && r !== null && c((e) => e + 1));
660
- let [l, u] = b(n);
661
- return n !== l && (u(n), c((e) => e + 1)), /* @__PURE__ */ x(lt, { ...e }, s);
662
+ let [l, u] = x(n);
663
+ return n !== l && (u(n), c((e) => e + 1)), /* @__PURE__ */ S(ct, { ...e }, s);
662
664
  }
663
- function lt(e) {
664
- let { authEpoch: t } = i(), { ownApplicationIds: n } = We(), [r, a] = b(null), [o, s] = b(0), c = Ke(() => {
665
- a(null), s((e) => e + 1);
666
- }, []), l = Ke(() => {
665
+ function ct(e) {
666
+ let { authEpoch: t } = i(), { ownApplicationIds: n } = Ge(), [r, a] = x(null), [o, s] = x(0), [c, l] = x(!1), [u, ee] = x(null), d = _(() => {
667
667
  a(null), s((e) => e + 1);
668
- }, []);
669
- return r !== null && t !== r.authEpoch && n !== null && !n.includes(r.applicationId) && (a(null), s((e) => e + 1)), /* @__PURE__ */ x(Le, { children: /* @__PURE__ */ x(dt, {
668
+ }, []), f = _(() => {
669
+ a(null), l(!0);
670
+ }, []), te = _(() => {
671
+ l(!1), ee(o + 1), s(o + 1);
672
+ }, [o]);
673
+ return r !== null && t !== r.authEpoch && n !== null && !n.includes(r.applicationId) && (a(null), s((e) => e + 1)), c ? /* @__PURE__ */ S("div", {
674
+ className: "ttw:grid ttw:w-full ttw:place-items-center ttw:overflow-auto ttw:bg-background ttw:p-6",
675
+ children: /* @__PURE__ */ S(pe, {
676
+ className: "ttw:max-w-2xl",
677
+ onStartNewApplication: te,
678
+ labels: e.labels?.applicationDeleted,
679
+ testIds: {
680
+ root: m.applicationDeletedScreen,
681
+ startNewApplication: m.applicationDeletedStartNew
682
+ }
683
+ })
684
+ }) : /* @__PURE__ */ S(Re, { children: /* @__PURE__ */ S(ut, {
670
685
  ...e,
671
686
  onEditableDraftChange: a,
672
- onApplicationDeleted: l,
673
- onNoticeReplacedByForm: c
687
+ onApplicationDeleted: f,
688
+ onNoticeReplacedByForm: d,
689
+ focusFormOnMount: u === o
674
690
  }, o) }, o);
675
691
  }
676
- var ut = { canRender: !1 };
677
- function dt(e) {
678
- let { authEpoch: t } = i(), { applicationId: n, clientSecret: r, isResolved: a } = We(), { application: o, isResolved: s, isUnavailable: c } = Ge(n, r), [l, u] = b(null);
679
- if (_(() => {
692
+ var lt = { canRender: !1 };
693
+ function ut(e) {
694
+ let { authEpoch: t } = i(), { applicationId: n, clientSecret: r, isResolved: a } = Ge(), { application: o, isResolved: s, isUnavailable: c } = Ke(n, r), [l, u] = x(null);
695
+ if (v(() => {
680
696
  if (l?.canRender !== !0 && a && s) {
681
697
  if (c) {
682
- u(ut);
698
+ u(lt);
683
699
  return;
684
700
  }
685
701
  if (o !== null && o.status !== void 0 && o.status !== Ze) {
686
- u(ut);
702
+ u(lt);
687
703
  return;
688
704
  }
689
705
  u({
690
706
  canRender: !0,
691
707
  applicationId: o === null ? null : n,
692
708
  authEpoch: t,
693
- prefill: ke(o)
709
+ prefill: g(o)
694
710
  });
695
711
  }
696
712
  }, [
@@ -702,21 +718,21 @@ function dt(e) {
702
718
  o,
703
719
  n
704
720
  ]), l === null || !l.canRender) return null;
705
- let { applicationId: ee, authEpoch: te, prefill: d } = l;
706
- return /* @__PURE__ */ x(ot, {
721
+ let { applicationId: ee, authEpoch: d, prefill: f } = l;
722
+ return /* @__PURE__ */ S(ot, {
707
723
  ...e,
708
724
  initialApplicationId: ee,
709
- initialBoundAuthEpoch: te,
725
+ initialBoundAuthEpoch: d,
710
726
  initialBusinessDetails: {
711
- ...Ie(e.initialBusinessDetails),
712
- ...d?.businessDetails
727
+ ...Le(e.initialBusinessDetails),
728
+ ...f?.businessDetails
713
729
  },
714
730
  initialPersonalDetails: {
715
- ...Ie(e.initialPersonalDetails),
716
- ...d?.personalDetails
731
+ ...Le(e.initialPersonalDetails),
732
+ ...f?.personalDetails
717
733
  },
718
- initialAdditionalOwners: d?.additionalOwners ?? e.initialAdditionalOwners?.map(Fe)
734
+ initialAdditionalOwners: f?.additionalOwners ?? e.initialAdditionalOwners?.map(Ie)
719
735
  });
720
736
  }
721
737
  //#endregion
722
- export { st as BankAccountOnboardingWidget, st as default, c as OnboardingSuppressionReason };
738
+ export { T as BankAccountOnboardingWidget, T as default, c as OnboardingSuppressionReason };