@tesouro/embedded-components-react 0.7.74 → 0.8.0

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