@tesouro/embedded-components-react 0.7.56 → 0.7.57
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.
- package/README.md +0 -3
- package/dist/experimental/RemoteCheckCapture.d.ts +1 -32
- package/dist/experimental/index.d.ts +1 -32
- package/dist/index.d.ts +12 -44
- package/dist/index.js +47 -48
- package/dist/lib/AcceptDisclosuresWidget.d.ts +1 -32
- package/dist/lib/BalancesWidget.d.ts +0 -31
- package/dist/lib/BankAccountOnboardingWidget.d.ts +1 -32
- package/dist/lib/BankAccountsWidget.d.ts +1 -32
- package/dist/lib/BankingComplianceBannerWidget.d.ts +0 -31
- package/dist/lib/BillPayWidget.d.ts +0 -31
- package/dist/lib/CardDetailsWidget.d.ts +1 -32
- package/dist/lib/CounterpartsWidget.d.ts +0 -31
- package/dist/lib/CounterpartsWidgetPublic.d.ts +0 -31
- package/dist/lib/CreditCardsWidget.d.ts +0 -31
- package/dist/lib/CustomersWidget.d.ts +1 -33
- package/dist/lib/DebitCardsWidget.d.ts +0 -31
- package/dist/lib/ExpenseManagementWidget.d.ts +0 -31
- package/dist/lib/InsightsWidget.d.ts +0 -31
- package/dist/lib/LinkedAccountsWidget.d.ts +1 -32
- package/dist/lib/OfferWidget.d.ts +1 -32
- package/dist/lib/ProductsWidget.d.ts +1 -32
- package/dist/lib/ReceivablesWidget.d.ts +1 -32
- package/dist/lib/SettingsWidget.d.ts +0 -31
- package/dist/lib/TransfersWidget.d.ts +0 -31
- package/dist/lib/WidgetProvider.d.ts +2 -33
- package/dist/lib/WidgetProvider.js +9 -10
- package/dist/lib/WidgetProviderPublic.d.ts +0 -31
- package/dist/lib/WidgetSuite.d.ts +1 -32
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js +395 -396
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/BankAccountsWidget/BankAccountsWidget.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +16 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index8.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index20.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillPayWidget.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index14.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/CardDetailsWidget.js +83 -84
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index8.js +15 -16
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/CardsWidget.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +9 -10
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +25 -26
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/LinkedAccountsWidget.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/OfferWidget/OfferWidget.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/ProductsWidget.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/RemoteCheckCaptureWidget.js +9 -10
- package/dist/libs/tesouro-embedded-components-react/settings-widget/chart-of-accounts/feature/dist/index8.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/settings-widget/help/feature/dist/index3.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index10.js +9 -10
- package/dist/libs/tesouro-embedded-components-react/settings-widget/profile/feature/dist/index4.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index17.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/shared/bank-disclosures/feature/dist/lib/BankDisclosuresWidget/BankDisclosuresWidget.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/index.js +16 -17
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +45 -49
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +91 -95
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/hooks.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/index.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/lib/WidgetSuite/WidgetSuite.js +120 -121
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/types.js +0 -8
|
@@ -10,69 +10,69 @@ import { useAcceptWidgetDisclosures as l } from "../../../../../shared/data-acce
|
|
|
10
10
|
import { useDisclosuresQuery as u } from "../../../../../shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js";
|
|
11
11
|
import { OnboardingSuppressionReason as d } from "../../../../../shared/data-access/dist/lib/onboardingSuppressionReason.js";
|
|
12
12
|
import { useOrganizationOnboardingSuppression as ee } from "../../../../../shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js";
|
|
13
|
-
import { useOrganizationApplicationStatus as
|
|
13
|
+
import { useOrganizationApplicationStatus as te } from "../../../../../shared/data-access/dist/lib/useOrganizationApplicationStatus.js";
|
|
14
14
|
import "../../../../../shared/data-access/dist/index.js";
|
|
15
|
-
import { EmbeddedToaster as
|
|
16
|
-
import { OnboardingShell as
|
|
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";
|
|
17
17
|
import "../../../../../shared/ui/dist/index.js";
|
|
18
|
-
import { useAnalyticsTrack as
|
|
19
|
-
import { WidgetProvider as
|
|
20
|
-
import { useRefetchWidget as
|
|
21
|
-
import { getNaicsOptions as
|
|
22
|
-
import { deniedNoticeExpiresAt as
|
|
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";
|
|
23
23
|
import "../../../../../shared/feature/dist/index.js";
|
|
24
|
-
import { ADDITIONAL_OWNERS_LABELS_EN as
|
|
25
|
-
import { interpolateBankName as
|
|
26
|
-
import { ApplicationStatusCard as
|
|
27
|
-
import { ResultStep as
|
|
28
|
-
import { UnsavedApplicationDialog as
|
|
29
|
-
import { DeleteApplicationDialog as
|
|
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";
|
|
30
30
|
import "../../../../ui/dist/index.js";
|
|
31
|
-
import { DEFAULT_LABELS as
|
|
32
|
-
import { OnboardingApplicationView as
|
|
33
|
-
import { identifierLast4 as
|
|
34
|
-
import { bankAccountOnboardingTestIds as
|
|
35
|
-
import { BusinessDetailsStep as
|
|
36
|
-
import { PersonalDetailsStep as
|
|
37
|
-
import { valuesKey as
|
|
38
|
-
import { AdditionalOwnersStep as
|
|
39
|
-
import { buildCreateApplicationBody as
|
|
40
|
-
import { buildOnboardingPrefill as
|
|
41
|
-
import { acceptDraftedValues as
|
|
42
|
-
import { OnboardingAnalyticsEvent as
|
|
43
|
-
import { withoutResumeOnlyOwnerFields as
|
|
44
|
-
import { ApplicationClientSecretProvider as
|
|
45
|
-
import { useCreateApplication as
|
|
46
|
-
import { useUpdateApplication as
|
|
47
|
-
import { useSubmitApplication as
|
|
48
|
-
import { useDeleteApplication as
|
|
49
|
-
import { usePollApplicationCompletion as
|
|
50
|
-
import { useResumableBankAccountApplication as
|
|
51
|
-
import { useStartedBankAccountApplication as
|
|
31
|
+
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";
|
|
52
52
|
import "../../../../data-access/dist/index.js";
|
|
53
|
-
import { useCallback as
|
|
54
|
-
import { Fragment as
|
|
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";
|
|
55
55
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js
|
|
56
|
-
var
|
|
57
|
-
function
|
|
56
|
+
var et = 2 ** 31 - 1, tt = "DRAFT", nt = [], x = (e) => p(e, void 0);
|
|
57
|
+
function rt(e) {
|
|
58
58
|
return {
|
|
59
59
|
...e,
|
|
60
60
|
taxId: "",
|
|
61
|
-
taxIdOnFileLast4:
|
|
61
|
+
taxIdOnFileLast4: Te(e.taxId),
|
|
62
62
|
taxIdOnFileStructure: e.companyStructure === "" ? void 0 : e.companyStructure
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function it(e) {
|
|
66
66
|
return {
|
|
67
67
|
...e,
|
|
68
68
|
ssn: "",
|
|
69
|
-
ssnOnFileLast4:
|
|
69
|
+
ssnOnFileLast4: Te(e.ssn)
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function at(e, t) {
|
|
73
73
|
return t ? e.map((e, n) => n === t.index ? t.owner : e) : e;
|
|
74
74
|
}
|
|
75
|
-
var
|
|
75
|
+
var ot = {
|
|
76
76
|
companyLegalName: "",
|
|
77
77
|
companyDbaName: "",
|
|
78
78
|
businessAddress: "",
|
|
@@ -86,7 +86,7 @@ var at = {
|
|
|
86
86
|
naicsCode: "",
|
|
87
87
|
isAuthorized: null,
|
|
88
88
|
isCheckboxChecked: !1
|
|
89
|
-
},
|
|
89
|
+
}, st = {
|
|
90
90
|
firstName: "",
|
|
91
91
|
lastName: "",
|
|
92
92
|
dateOfBirth: void 0,
|
|
@@ -100,7 +100,7 @@ var at = {
|
|
|
100
100
|
ownsOver25Percent: null,
|
|
101
101
|
ownershipPercentage: null
|
|
102
102
|
};
|
|
103
|
-
function
|
|
103
|
+
function ct(e, t) {
|
|
104
104
|
if (e === 0) return {
|
|
105
105
|
title: t.businessReviewTitle,
|
|
106
106
|
subtitle: t.businessReviewSubtitle
|
|
@@ -110,7 +110,7 @@ function st(e, t) {
|
|
|
110
110
|
subtitle: t.personalReviewSubtitle
|
|
111
111
|
};
|
|
112
112
|
let n = {
|
|
113
|
-
...
|
|
113
|
+
...pe,
|
|
114
114
|
...t.additionalOwners
|
|
115
115
|
};
|
|
116
116
|
return {
|
|
@@ -118,62 +118,62 @@ function st(e, t) {
|
|
|
118
118
|
subtitle: n.subheading
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
let
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}, [
|
|
126
|
-
let
|
|
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 = {
|
|
127
|
+
...f,
|
|
127
128
|
...p,
|
|
128
|
-
|
|
129
|
-
deleteFailedError: m?.deleteFailedError ?? p.deleteFailedError,
|
|
129
|
+
deleteFailedError: p?.deleteFailedError ?? f.deleteFailedError,
|
|
130
130
|
stepIndicator: {
|
|
131
|
-
...
|
|
132
|
-
...
|
|
131
|
+
...f.stepIndicator,
|
|
132
|
+
...p?.stepIndicator
|
|
133
133
|
},
|
|
134
|
-
businessDetails:
|
|
135
|
-
personalDetails:
|
|
136
|
-
additionalOwners:
|
|
134
|
+
businessDetails: p?.businessDetails ?? {},
|
|
135
|
+
personalDetails: p?.personalDetails ?? {},
|
|
136
|
+
additionalOwners: p?.additionalOwners ?? {},
|
|
137
137
|
result: {
|
|
138
|
-
...
|
|
139
|
-
...
|
|
138
|
+
...f.result,
|
|
139
|
+
...p?.result
|
|
140
140
|
},
|
|
141
|
-
unsavedApplicationDialog:
|
|
142
|
-
deleteApplicationDialog:
|
|
143
|
-
applicationStatus:
|
|
144
|
-
},
|
|
145
|
-
|
|
146
|
-
}, [
|
|
147
|
-
|
|
148
|
-
}, [
|
|
149
|
-
...at,
|
|
150
|
-
...Ae
|
|
151
|
-
})), [j, kt] = b(() => ({
|
|
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(() => ({
|
|
152
149
|
...ot,
|
|
153
|
-
...
|
|
154
|
-
})), [
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
150
|
+
...je
|
|
151
|
+
})), [A, At] = y(() => ({
|
|
152
|
+
...st,
|
|
153
|
+
...Re
|
|
154
|
+
})), [j, M] = y(() => Be ?? []), [N, jt] = y(() => ({
|
|
155
|
+
business: k,
|
|
156
|
+
personal: A,
|
|
157
|
+
owners: j
|
|
158
|
+
})), [Mt, Nt] = y(null);
|
|
159
|
+
g(() => {
|
|
160
|
+
if (!Mt) return;
|
|
161
161
|
let e = {
|
|
162
|
-
business:
|
|
163
|
-
personal:
|
|
164
|
-
owners:
|
|
162
|
+
business: k,
|
|
163
|
+
personal: A,
|
|
164
|
+
owners: j
|
|
165
165
|
};
|
|
166
|
-
|
|
166
|
+
jt((t) => Mt.next(e, t)), Nt(null);
|
|
167
167
|
}, [
|
|
168
|
-
|
|
168
|
+
Mt,
|
|
169
|
+
k,
|
|
169
170
|
A,
|
|
170
|
-
j
|
|
171
|
-
M
|
|
171
|
+
j
|
|
172
172
|
]);
|
|
173
|
-
let
|
|
173
|
+
let Pt = (e, { owners: t = "none" } = {}) => Nt({ next: (n, r) => ({
|
|
174
174
|
business: e.includes("business") ? n.business : r.business,
|
|
175
175
|
personal: e.includes("personal") ? n.personal : r.personal,
|
|
176
|
-
owners: t === "cleared" ?
|
|
176
|
+
owners: t === "cleared" ? nt : t === "restored" ? Me({
|
|
177
177
|
current: n,
|
|
178
178
|
saved: r,
|
|
179
179
|
dirty: {
|
|
@@ -183,476 +183,475 @@ function ct({ onEmbeddedOnboardingCompletedSuccessfully: ie, onNavigateToDashboa
|
|
|
183
183
|
},
|
|
184
184
|
ownersWrite: "list"
|
|
185
185
|
}).owners : e.includes("owners") ? n.owners : r.owners
|
|
186
|
-
}) }), [
|
|
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) => ({
|
|
187
187
|
...t,
|
|
188
|
-
...e.taxId &&
|
|
188
|
+
...e.taxId && x(e.taxId) && e.taxIdStructure ? {
|
|
189
189
|
taxId: e.taxId,
|
|
190
190
|
taxIdStructure: e.taxIdStructure
|
|
191
191
|
} : {},
|
|
192
|
-
...e.ssn &&
|
|
193
|
-
})),
|
|
194
|
-
let { taxId: t, taxIdStructure: n } =
|
|
195
|
-
|
|
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 ? {
|
|
196
196
|
...e,
|
|
197
197
|
taxId: e.taxId === t ? "" : e.taxId,
|
|
198
|
-
taxIdOnFileLast4:
|
|
198
|
+
taxIdOnFileLast4: Te(t),
|
|
199
199
|
taxIdOnFileStructure: n
|
|
200
200
|
} : e);
|
|
201
|
-
}, [
|
|
202
|
-
!
|
|
203
|
-
let [
|
|
204
|
-
|
|
205
|
-
let
|
|
206
|
-
|
|
207
|
-
if (
|
|
208
|
-
let 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();
|
|
209
209
|
if (e < 0) return;
|
|
210
|
-
let t = setTimeout(
|
|
210
|
+
let t = setTimeout(Sn, Math.min(e + 1, et));
|
|
211
211
|
return () => clearTimeout(t);
|
|
212
|
-
}, [
|
|
213
|
-
let
|
|
214
|
-
|
|
215
|
-
let
|
|
216
|
-
|
|
217
|
-
if (
|
|
218
|
-
}, [
|
|
219
|
-
let
|
|
220
|
-
|
|
221
|
-
let
|
|
222
|
-
|
|
223
|
-
let
|
|
224
|
-
|
|
225
|
-
|
|
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}`));
|
|
226
226
|
}, [
|
|
227
|
+
G,
|
|
227
228
|
K,
|
|
228
|
-
|
|
229
|
-
w
|
|
229
|
+
C
|
|
230
230
|
]);
|
|
231
|
-
let
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
}, [
|
|
235
|
-
let
|
|
236
|
-
|
|
237
|
-
let
|
|
238
|
-
|
|
239
|
-
if (!
|
|
240
|
-
let e =
|
|
241
|
-
|
|
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?.();
|
|
242
242
|
}, [
|
|
243
|
+
H,
|
|
243
244
|
U,
|
|
244
245
|
W,
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
authEpoch: Qt
|
|
246
|
+
q
|
|
247
|
+
]), g(() => {
|
|
248
|
+
Y === "requested" && Yn.current();
|
|
249
|
+
}, [Y]), g(() => {
|
|
250
|
+
Ye?.(U || I === null ? null : {
|
|
251
|
+
applicationId: I,
|
|
252
|
+
authEpoch: $t
|
|
253
253
|
});
|
|
254
254
|
}, [
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
255
|
+
Ye,
|
|
256
|
+
U,
|
|
257
|
+
I,
|
|
258
|
+
$t
|
|
259
259
|
]);
|
|
260
|
-
let
|
|
261
|
-
if (
|
|
262
|
-
if (!
|
|
263
|
-
if (
|
|
264
|
-
if (
|
|
265
|
-
if (
|
|
266
|
-
let a =
|
|
260
|
+
let Xn = v(_t);
|
|
261
|
+
if (Xn.current = _t, !T) return null;
|
|
262
|
+
if (!U) {
|
|
263
|
+
if (G && !q || Gn || !W) return null;
|
|
264
|
+
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
267
|
...a,
|
|
268
|
-
className: i("ttw:max-w-2xl", !
|
|
268
|
+
className: i("ttw:max-w-2xl", !S && "ttw:pr-12"),
|
|
269
269
|
testIds: {
|
|
270
|
-
root:
|
|
271
|
-
chip:
|
|
270
|
+
root: m.statusCard,
|
|
271
|
+
chip: m.statusCardChip
|
|
272
272
|
},
|
|
273
|
-
action:
|
|
273
|
+
action: ht ? /* @__PURE__ */ b(e, {
|
|
274
274
|
variant: "outline",
|
|
275
|
-
onClick:
|
|
276
|
-
"data-testid":
|
|
277
|
-
children:
|
|
275
|
+
onClick: J ? () => Hn("requested") : yn.refetch,
|
|
276
|
+
"data-testid": m.statusCardCheckAgain,
|
|
277
|
+
children: w.applicationStatus.checkAgain
|
|
278
278
|
}) : void 0
|
|
279
279
|
});
|
|
280
|
-
return
|
|
280
|
+
return S ? /* @__PURE__ */ b("div", {
|
|
281
281
|
className: "ttw:grid ttw:h-full ttw:w-full ttw:place-items-center ttw:overflow-auto ttw:bg-background ttw:p-6",
|
|
282
282
|
children: o
|
|
283
|
-
}) : /* @__PURE__ */
|
|
284
|
-
open:
|
|
285
|
-
onOpenChange:
|
|
286
|
-
children: /* @__PURE__ */
|
|
283
|
+
}) : /* @__PURE__ */ b(t, {
|
|
284
|
+
open: E,
|
|
285
|
+
onOpenChange: D,
|
|
286
|
+
children: /* @__PURE__ */ $e(n, {
|
|
287
287
|
showCloseButton: !0,
|
|
288
|
-
closeButtonTestId:
|
|
289
|
-
labels: { close:
|
|
288
|
+
closeButtonTestId: m.statusCardClose,
|
|
289
|
+
labels: { close: w.applicationStatus.close },
|
|
290
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__ */
|
|
291
|
+
children: [/* @__PURE__ */ b(r, {
|
|
292
292
|
className: "ttw:sr-only",
|
|
293
|
-
children:
|
|
293
|
+
children: w.modalTitle
|
|
294
294
|
}), o]
|
|
295
295
|
})
|
|
296
296
|
});
|
|
297
297
|
}
|
|
298
298
|
}
|
|
299
|
-
let
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
],
|
|
304
|
-
|
|
305
|
-
},
|
|
306
|
-
business:
|
|
307
|
-
personal:
|
|
308
|
-
owners:
|
|
309
|
-
}, er =
|
|
310
|
-
business: (e) =>
|
|
311
|
-
personal: (e) =>
|
|
312
|
-
owners: (e) => e.map((e) => e.id &&
|
|
313
|
-
}, tr = () =>
|
|
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);
|
|
305
|
+
}, 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
314
|
business: $.business(e.business),
|
|
315
315
|
personal: $.personal(e.personal),
|
|
316
316
|
owners: $.owners(e.owners)
|
|
317
317
|
})), nr = () => {
|
|
318
|
-
|
|
318
|
+
Z || (er ? Bt(!0) : (kt($.business), At($.personal), M($.owners), tr(), D(!1)));
|
|
319
319
|
}, rr = (e) => {
|
|
320
|
-
e ?
|
|
320
|
+
e ? D(!0) : nr();
|
|
321
321
|
}, ir = nr, ar = async (e) => {
|
|
322
|
-
|
|
322
|
+
cn(!0), D(!0);
|
|
323
323
|
let t = new AbortController();
|
|
324
|
-
|
|
324
|
+
Dn.current = t;
|
|
325
325
|
let n = !1;
|
|
326
326
|
try {
|
|
327
|
-
let r = await
|
|
327
|
+
let r = await fn.mutateAsync({ path: { id: e } });
|
|
328
328
|
if (t.signal.aborted) return;
|
|
329
|
-
if (!r.id) throw Error(
|
|
330
|
-
if (n = !0, (await
|
|
331
|
-
let e =
|
|
332
|
-
if (e === void 0 && (e = (await
|
|
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;
|
|
333
333
|
if (e !== void 0) try {
|
|
334
|
-
await
|
|
334
|
+
await vn({ displayedVersion: c(e)?.disclosureId ?? null });
|
|
335
335
|
} catch {}
|
|
336
336
|
if (t.signal.aborted) return;
|
|
337
|
-
|
|
338
|
-
} else
|
|
337
|
+
un("success"), Dt(), Et();
|
|
338
|
+
} else un("pending");
|
|
339
339
|
} catch (e) {
|
|
340
340
|
if (e instanceof DOMException && e.name === "AbortError") return;
|
|
341
341
|
if (!n) throw e;
|
|
342
|
-
|
|
342
|
+
un("pending");
|
|
343
343
|
} finally {
|
|
344
|
-
|
|
344
|
+
Dn.current = null, cn(!1);
|
|
345
345
|
}
|
|
346
346
|
}, or = ({ evenWithoutMarker: e = !1 } = {}) => {
|
|
347
|
-
|
|
347
|
+
kt((t) => (t.taxIdOnFileLast4 || e) && x(t.taxId) ? rt(t) : t);
|
|
348
348
|
}, sr = ({ evenWithoutMarker: e = !1 } = {}) => {
|
|
349
|
-
|
|
349
|
+
At((t) => (t.ssnOnFileLast4 || e) && x(t.ssn) ? it(t) : t);
|
|
350
350
|
}, cr = ({ evenWithoutMarker: e = !1 } = {}) => {
|
|
351
|
-
|
|
351
|
+
M((t) => t.map((t) => (t.ssnOnFileLast4 || e && t.id) && x(t.ssn) ? it(t) : t));
|
|
352
352
|
}, lr = () => {
|
|
353
|
-
|
|
353
|
+
M((e) => e.map(ze));
|
|
354
354
|
}, ur = async (e) => {
|
|
355
|
-
let t =
|
|
356
|
-
return
|
|
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
357
|
}, dr = async () => {
|
|
358
|
-
let e =
|
|
359
|
-
if (
|
|
360
|
-
if (!
|
|
361
|
-
let e =
|
|
362
|
-
return e ? await
|
|
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
363
|
path: { id: e },
|
|
364
364
|
body: {
|
|
365
|
-
...
|
|
366
|
-
businessDetails:
|
|
367
|
-
carryConsent: !
|
|
365
|
+
...Ae({
|
|
366
|
+
businessDetails: P,
|
|
367
|
+
carryConsent: !Jt
|
|
368
368
|
}),
|
|
369
369
|
...t
|
|
370
370
|
}
|
|
371
|
-
}) : (e = await ur(
|
|
372
|
-
taxId:
|
|
373
|
-
taxIdStructure:
|
|
374
|
-
}), or(),
|
|
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;
|
|
375
375
|
}
|
|
376
|
-
return
|
|
377
|
-
path: { id:
|
|
376
|
+
return O === 1 ? !F || !P || !I ? null : (await z.mutateAsync({
|
|
377
|
+
path: { id: I },
|
|
378
378
|
body: {
|
|
379
|
-
...
|
|
380
|
-
businessDetails:
|
|
381
|
-
applicant:
|
|
382
|
-
carryConsent: !
|
|
379
|
+
...Ae({
|
|
380
|
+
businessDetails: P,
|
|
381
|
+
applicant: F,
|
|
382
|
+
carryConsent: !Jt
|
|
383
383
|
}),
|
|
384
384
|
...t
|
|
385
385
|
}
|
|
386
|
-
}),
|
|
387
|
-
taxId:
|
|
388
|
-
taxIdStructure:
|
|
389
|
-
ssn:
|
|
390
|
-
}), or(), sr(),
|
|
391
|
-
path: { id:
|
|
392
|
-
body:
|
|
393
|
-
}), cr(),
|
|
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
394
|
}, fr = async () => {
|
|
395
|
-
|
|
395
|
+
R(null);
|
|
396
396
|
let e;
|
|
397
397
|
try {
|
|
398
398
|
e = await dr();
|
|
399
399
|
} catch {
|
|
400
|
-
|
|
400
|
+
R(w.genericRetryError);
|
|
401
401
|
return;
|
|
402
402
|
}
|
|
403
403
|
if (e !== null) {
|
|
404
|
-
if (
|
|
404
|
+
if (O === 2) try {
|
|
405
405
|
await ar(e);
|
|
406
406
|
} catch {
|
|
407
|
-
|
|
407
|
+
R(w.submitFailedError);
|
|
408
408
|
}
|
|
409
|
-
else
|
|
409
|
+
else Ot(O + 1);
|
|
410
410
|
}
|
|
411
411
|
}, pr = async () => {
|
|
412
|
-
|
|
412
|
+
R(null), rn(!0);
|
|
413
413
|
try {
|
|
414
414
|
if (await dr() === null) return;
|
|
415
|
-
or({ evenWithoutMarker: !0 }),
|
|
415
|
+
or({ evenWithoutMarker: !0 }), O >= 1 && sr({ evenWithoutMarker: !0 }), O === 2 && cr({ evenWithoutMarker: !0 }), a.success(w.applicationSavedToast), D(!1);
|
|
416
416
|
} catch {
|
|
417
|
-
a.error(
|
|
417
|
+
a.error(w.genericRetryError);
|
|
418
418
|
} finally {
|
|
419
|
-
|
|
419
|
+
rn(!1);
|
|
420
420
|
}
|
|
421
421
|
}, mr = async () => {
|
|
422
|
-
let e =
|
|
423
|
-
businessDetails:
|
|
424
|
-
applicant:
|
|
422
|
+
let e = at(j, Ft), t = Pe({
|
|
423
|
+
businessDetails: k,
|
|
424
|
+
applicant: A,
|
|
425
425
|
businessOwners: e,
|
|
426
|
-
savedBusinessDetails:
|
|
427
|
-
savedOwners:
|
|
428
|
-
dirty:
|
|
429
|
-
}), n =
|
|
430
|
-
|
|
426
|
+
savedBusinessDetails: N.business,
|
|
427
|
+
savedOwners: N.owners,
|
|
428
|
+
dirty: Q
|
|
429
|
+
}), n = Q;
|
|
430
|
+
Ht(!0);
|
|
431
431
|
try {
|
|
432
432
|
if (!t) {
|
|
433
|
-
a.error(
|
|
433
|
+
a.error(w.saveDraftNothingValidError);
|
|
434
434
|
return;
|
|
435
435
|
}
|
|
436
|
-
let r = !
|
|
437
|
-
|
|
438
|
-
path: { id:
|
|
436
|
+
let r = !I;
|
|
437
|
+
I ? await z.mutateAsync({
|
|
438
|
+
path: { id: I },
|
|
439
439
|
body: t
|
|
440
|
-
}) : await ur(
|
|
440
|
+
}) : await ur(Ne(t)), Ft && M(e), a.success(w.applicationSavedToast);
|
|
441
441
|
let i = t;
|
|
442
|
-
r && i.applicant?.isLegallyAuthorized && i.applicant?.hasAcceptedDisclosures &&
|
|
442
|
+
r && i.applicant?.isLegallyAuthorized && i.applicant?.hasAcceptedDisclosures && Yt(!0), Zt({
|
|
443
443
|
taxId: i.businessDetails?.taxId?.value,
|
|
444
|
-
taxIdStructure:
|
|
444
|
+
taxIdStructure: k.companyStructure,
|
|
445
445
|
ssn: i.applicant?.personalIdentificationNumber?.value
|
|
446
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
447
|
let o = Array.isArray(i.businessOwners) ? "list" : i.businessOwners === null ? "cleared" : "none";
|
|
448
|
-
|
|
448
|
+
Nt({ next: (e, t) => Me({
|
|
449
449
|
current: e,
|
|
450
450
|
saved: t,
|
|
451
451
|
dirty: n,
|
|
452
452
|
ownersWrite: o
|
|
453
|
-
}) }),
|
|
453
|
+
}) }), It(null), Rt((e) => e + 1), Bt(!1), D(!1);
|
|
454
454
|
} catch {
|
|
455
|
-
a.error(
|
|
455
|
+
a.error(w.genericRetryError);
|
|
456
456
|
} finally {
|
|
457
|
-
|
|
457
|
+
Ht(!1);
|
|
458
458
|
}
|
|
459
459
|
}, hr = () => {
|
|
460
|
-
|
|
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
461
|
}, gr = async () => {
|
|
462
|
-
if (
|
|
462
|
+
if (I !== null) {
|
|
463
463
|
try {
|
|
464
|
-
await
|
|
464
|
+
await pn.mutateAsync({ path: { id: I } });
|
|
465
465
|
} catch {
|
|
466
|
-
a.error(
|
|
466
|
+
a.error(w.deleteFailedError);
|
|
467
467
|
return;
|
|
468
468
|
}
|
|
469
|
-
a.success(
|
|
469
|
+
a.success(w.applicationDeletedToast);
|
|
470
470
|
}
|
|
471
|
-
|
|
472
|
-
}, _r =
|
|
473
|
-
if (
|
|
474
|
-
let e =
|
|
475
|
-
...
|
|
476
|
-
...
|
|
477
|
-
}, c = /* @__PURE__ */
|
|
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 = {
|
|
475
|
+
...f.result,
|
|
476
|
+
...w.result
|
|
477
|
+
}, c = /* @__PURE__ */ b(ge, {
|
|
478
478
|
testIds: {
|
|
479
|
-
processing:
|
|
480
|
-
dashboardButton:
|
|
479
|
+
processing: m.resultProcessing,
|
|
480
|
+
dashboardButton: m.resultDashboardButton
|
|
481
481
|
},
|
|
482
482
|
status: a,
|
|
483
|
-
isLoading:
|
|
483
|
+
isLoading: sn,
|
|
484
484
|
loadingMessage: s.loadingMessage,
|
|
485
485
|
headingLine1: o ? s.successHeadingLine1 : s.pendingHeadingLine1,
|
|
486
486
|
headingLine2: `${e}!`,
|
|
487
487
|
body: o ? s.successBody : s.pendingBody,
|
|
488
|
-
followUpEmail:
|
|
488
|
+
followUpEmail: F?.workEmail ?? "",
|
|
489
489
|
emailBoxLead: s.pendingEmailBoxLead,
|
|
490
490
|
navigateToDashboardLabel: s.navigateToDashboard,
|
|
491
|
-
bankLogoSrc:
|
|
492
|
-
bankLogoAlt:
|
|
493
|
-
fdicDisclaimer:
|
|
494
|
-
onNavigateToDashboard:
|
|
491
|
+
bankLogoSrc: ut,
|
|
492
|
+
bankLogoAlt: me(s.bankLogoAlt, i),
|
|
493
|
+
fdicDisclaimer: me(s.fdicDisclaimer, i),
|
|
494
|
+
onNavigateToDashboard: pe
|
|
495
495
|
});
|
|
496
|
-
return
|
|
496
|
+
return S ? /* @__PURE__ */ b("div", {
|
|
497
497
|
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
498
|
children: c
|
|
499
|
-
}) : /* @__PURE__ */
|
|
500
|
-
open:
|
|
501
|
-
onOpenChange:
|
|
502
|
-
children: /* @__PURE__ */
|
|
499
|
+
}) : /* @__PURE__ */ b(t, {
|
|
500
|
+
open: E,
|
|
501
|
+
onOpenChange: D,
|
|
502
|
+
children: /* @__PURE__ */ $e(n, {
|
|
503
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__ */
|
|
504
|
+
children: [/* @__PURE__ */ b(r, {
|
|
505
505
|
className: "ttw:sr-only",
|
|
506
|
-
children:
|
|
506
|
+
children: w.modalTitle
|
|
507
507
|
}), c]
|
|
508
508
|
})
|
|
509
509
|
});
|
|
510
510
|
}
|
|
511
|
-
let br =
|
|
512
|
-
return /* @__PURE__ */ Qe
|
|
513
|
-
/* @__PURE__ */
|
|
514
|
-
open:
|
|
515
|
-
defaultOpen:
|
|
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
516
|
onOpenChange: rr,
|
|
517
|
-
isFullScreenInline:
|
|
517
|
+
isFullScreenInline: S,
|
|
518
518
|
title: _r.title,
|
|
519
519
|
subtitle: _r.subtitle,
|
|
520
|
-
stepLabels:
|
|
521
|
-
activeStep:
|
|
520
|
+
stepLabels: Zn,
|
|
521
|
+
activeStep: O,
|
|
522
522
|
disclaimerText: yr,
|
|
523
|
-
onBack:
|
|
524
|
-
onCancel:
|
|
523
|
+
onBack: O === 0 ? ir : $n,
|
|
524
|
+
onCancel: O > 0 ? ir : void 0,
|
|
525
525
|
onNext: fr,
|
|
526
526
|
onSaveAndClose: pr,
|
|
527
|
-
onDelete: () =>
|
|
527
|
+
onDelete: () => on(!0),
|
|
528
528
|
showDismissButton: !1,
|
|
529
529
|
isNextDisabled: xr,
|
|
530
|
-
isNextLoading:
|
|
530
|
+
isNextLoading: Z && !nn,
|
|
531
531
|
isSaveAndCloseDisabled: xr,
|
|
532
|
-
isSaveAndCloseLoading:
|
|
532
|
+
isSaveAndCloseLoading: nn,
|
|
533
533
|
nextLabel: br,
|
|
534
534
|
nextIcon: null,
|
|
535
|
-
errorMessage:
|
|
535
|
+
errorMessage: tn,
|
|
536
536
|
labels: {
|
|
537
|
-
backButton:
|
|
538
|
-
cancelButton:
|
|
539
|
-
saveAndCloseButton:
|
|
540
|
-
deleteButton:
|
|
537
|
+
backButton: O === 0 ? w.cancel : w.back,
|
|
538
|
+
cancelButton: w.cancel,
|
|
539
|
+
saveAndCloseButton: w.saveAndClose,
|
|
540
|
+
deleteButton: w.deleteApplication
|
|
541
541
|
},
|
|
542
542
|
testIds: {
|
|
543
|
-
root:
|
|
544
|
-
dismiss:
|
|
545
|
-
back:
|
|
546
|
-
cancel:
|
|
547
|
-
saveAndClose:
|
|
548
|
-
delete:
|
|
549
|
-
next:
|
|
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,
|
|
550
550
|
scrollRegion: {
|
|
551
|
-
root:
|
|
552
|
-
fade:
|
|
553
|
-
hint:
|
|
551
|
+
root: m.shellScrollRegion,
|
|
552
|
+
fade: m.shellScrollFade,
|
|
553
|
+
hint: m.shellScrollHint
|
|
554
554
|
}
|
|
555
555
|
},
|
|
556
556
|
children: [
|
|
557
|
-
|
|
558
|
-
value:
|
|
559
|
-
onValueChange:
|
|
560
|
-
onSnapshotChange: Ht,
|
|
561
|
-
naicsOptions: Dn,
|
|
562
|
-
stateOptions: On,
|
|
563
|
-
isSubmitting: Q,
|
|
564
|
-
labels: T.businessDetails,
|
|
565
|
-
bankName: vr,
|
|
566
|
-
termsHref: _t,
|
|
567
|
-
privacyHref: vt,
|
|
568
|
-
electronicCommunicationHref: yt,
|
|
569
|
-
patriotActHref: bt
|
|
570
|
-
}, "business") : null,
|
|
571
|
-
k === 1 ? /* @__PURE__ */ x(Ee, {
|
|
572
|
-
value: j,
|
|
573
|
-
onValueChange: kt,
|
|
557
|
+
O === 0 ? /* @__PURE__ */ b(Ee, {
|
|
558
|
+
value: k,
|
|
559
|
+
onValueChange: Qt,
|
|
574
560
|
onSnapshotChange: Ut,
|
|
561
|
+
naicsOptions: On,
|
|
575
562
|
stateOptions: kn,
|
|
576
|
-
isSubmitting:
|
|
577
|
-
labels:
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
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,
|
|
584
575
|
stateOptions: An,
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
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
590
|
]
|
|
591
591
|
}),
|
|
592
|
-
/* @__PURE__ */
|
|
593
|
-
open:
|
|
592
|
+
/* @__PURE__ */ b(_e, {
|
|
593
|
+
open: zt,
|
|
594
594
|
onSaveDraft: mr,
|
|
595
595
|
onDiscard: hr,
|
|
596
|
-
onCancel: () =>
|
|
597
|
-
isSaving:
|
|
598
|
-
labels:
|
|
596
|
+
onCancel: () => Bt(!1),
|
|
597
|
+
isSaving: Vt,
|
|
598
|
+
labels: w.unsavedApplicationDialog,
|
|
599
599
|
testIds: {
|
|
600
|
-
root:
|
|
601
|
-
saveDraft:
|
|
602
|
-
discard:
|
|
603
|
-
close:
|
|
600
|
+
root: m.unsavedDialog,
|
|
601
|
+
saveDraft: m.unsavedDialogSaveDraft,
|
|
602
|
+
discard: m.unsavedDialogDiscard,
|
|
603
|
+
close: m.unsavedDialogClose
|
|
604
604
|
}
|
|
605
605
|
}),
|
|
606
|
-
/* @__PURE__ */
|
|
607
|
-
open:
|
|
606
|
+
/* @__PURE__ */ b(ve, {
|
|
607
|
+
open: an,
|
|
608
608
|
onConfirm: gr,
|
|
609
|
-
onCancel: () =>
|
|
610
|
-
isDeleting:
|
|
609
|
+
onCancel: () => on(!1),
|
|
610
|
+
isDeleting: pn.isPending,
|
|
611
611
|
labels: {
|
|
612
|
-
descriptionEmphasis:
|
|
613
|
-
...
|
|
612
|
+
descriptionEmphasis: w.saveAndClose,
|
|
613
|
+
...w.deleteApplicationDialog
|
|
614
614
|
},
|
|
615
615
|
testIds: {
|
|
616
|
-
root:
|
|
617
|
-
confirm:
|
|
618
|
-
cancel:
|
|
616
|
+
root: m.deleteDialog,
|
|
617
|
+
confirm: m.deleteDialogConfirm,
|
|
618
|
+
cancel: m.deleteDialogCancel
|
|
619
619
|
}
|
|
620
620
|
}),
|
|
621
|
-
/* @__PURE__ */
|
|
621
|
+
/* @__PURE__ */ b(ne, {})
|
|
622
622
|
] });
|
|
623
623
|
}
|
|
624
|
-
function
|
|
625
|
-
return /* @__PURE__ */
|
|
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, {
|
|
626
626
|
baseUrl: e,
|
|
627
627
|
widgetToken: t,
|
|
628
628
|
organizationId: n,
|
|
629
629
|
configClient: r,
|
|
630
630
|
gatewayRouting: i,
|
|
631
631
|
linkComponent: a,
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
children: /* @__PURE__ */ x(ut, { ...f })
|
|
632
|
+
uiFramework: o,
|
|
633
|
+
errorFallback: s,
|
|
634
|
+
onError: c,
|
|
635
|
+
analytics: l,
|
|
636
|
+
disclosuresAcceptance: u,
|
|
637
|
+
providerLabels: d,
|
|
638
|
+
widgetName: Re,
|
|
639
|
+
children: /* @__PURE__ */ b(dt, { ...ee })
|
|
641
640
|
});
|
|
642
641
|
}
|
|
643
|
-
function
|
|
644
|
-
let { initResponse: t } =
|
|
642
|
+
function dt(e) {
|
|
643
|
+
let { initResponse: t } = se(), { client: n } = s(), r = t?.userId ?? null, [i, a] = y(r), [o, c] = y(0);
|
|
645
644
|
r !== i && (a(r), i !== null && r !== null && c((e) => e + 1));
|
|
646
|
-
let [l, u] =
|
|
647
|
-
return n !== l && (u(n), c((e) => e + 1)), /* @__PURE__ */
|
|
645
|
+
let [l, u] = y(n);
|
|
646
|
+
return n !== l && (u(n), c((e) => e + 1)), /* @__PURE__ */ b(ft, { ...e }, o);
|
|
648
647
|
}
|
|
649
|
-
function
|
|
650
|
-
let { authEpoch: t } = s(), { ownApplicationIds: n } =
|
|
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(() => {
|
|
651
650
|
i(null), o((e) => e + 1);
|
|
652
|
-
}, []), d =
|
|
651
|
+
}, []), d = Xe(() => {
|
|
653
652
|
i(null), l(!0), o((e) => e + 1);
|
|
654
653
|
}, []);
|
|
655
|
-
return r !== null && t !== r.authEpoch && n !== null && !n.includes(r.applicationId) && (i(null), o((e) => e + 1)), /* @__PURE__ */
|
|
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, {
|
|
656
655
|
...e,
|
|
657
656
|
defaultOpen: !c && e.defaultOpen,
|
|
658
657
|
onEditableDraftChange: i,
|
|
@@ -660,24 +659,24 @@ function dt(e) {
|
|
|
660
659
|
onNoticeReplacedByForm: u
|
|
661
660
|
}, a) }, a);
|
|
662
661
|
}
|
|
663
|
-
var
|
|
664
|
-
function
|
|
665
|
-
let { authEpoch: t } = s(), { applicationId: n, clientSecret: r, isResolved: i } =
|
|
666
|
-
if (
|
|
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(() => {
|
|
667
666
|
if (l?.canRender !== !0 && i && o) {
|
|
668
667
|
if (c) {
|
|
669
|
-
u(
|
|
668
|
+
u(pt);
|
|
670
669
|
return;
|
|
671
670
|
}
|
|
672
|
-
if (a !== null && a.status !== void 0 && a.status !==
|
|
673
|
-
u(
|
|
671
|
+
if (a !== null && a.status !== void 0 && a.status !== tt) {
|
|
672
|
+
u(pt);
|
|
674
673
|
return;
|
|
675
674
|
}
|
|
676
675
|
u({
|
|
677
676
|
canRender: !0,
|
|
678
677
|
applicationId: a === null ? null : n,
|
|
679
678
|
authEpoch: t,
|
|
680
|
-
prefill:
|
|
679
|
+
prefill: je(a)
|
|
681
680
|
});
|
|
682
681
|
}
|
|
683
682
|
}, [
|
|
@@ -689,21 +688,21 @@ function pt(e) {
|
|
|
689
688
|
a,
|
|
690
689
|
n
|
|
691
690
|
]), l === null || !l.canRender) return null;
|
|
692
|
-
let { applicationId: d, authEpoch: ee, prefill:
|
|
693
|
-
return /* @__PURE__ */
|
|
691
|
+
let { applicationId: d, authEpoch: ee, prefill: te } = l;
|
|
692
|
+
return /* @__PURE__ */ b(lt, {
|
|
694
693
|
...e,
|
|
695
694
|
initialApplicationId: d,
|
|
696
695
|
initialBoundAuthEpoch: ee,
|
|
697
696
|
initialBusinessDetails: {
|
|
698
|
-
...
|
|
699
|
-
...
|
|
697
|
+
...Be(e.initialBusinessDetails),
|
|
698
|
+
...te?.businessDetails
|
|
700
699
|
},
|
|
701
700
|
initialPersonalDetails: {
|
|
702
|
-
...
|
|
703
|
-
...
|
|
701
|
+
...Be(e.initialPersonalDetails),
|
|
702
|
+
...te?.personalDetails
|
|
704
703
|
},
|
|
705
|
-
initialAdditionalOwners:
|
|
704
|
+
initialAdditionalOwners: te?.additionalOwners ?? e.initialAdditionalOwners?.map(ze)
|
|
706
705
|
});
|
|
707
706
|
}
|
|
708
707
|
//#endregion
|
|
709
|
-
export {
|
|
708
|
+
export { ut as BankAccountOnboardingWidget, ut as default };
|