@tesouro/embedded-components-react 0.5.182 → 0.5.183

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 (23) hide show
  1. package/dist/index.css +6 -0
  2. package/dist/index.d.ts +30 -1
  3. package/dist/lib/BankAccountOnboardingWidget.d.ts +30 -1
  4. package/dist/lib/WidgetSuite.d.ts +30 -1
  5. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index.js +5 -4
  6. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index10.js +3 -32
  7. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index11.js +24 -33
  8. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index12.js +44 -0
  9. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index8.js +13 -36
  10. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index9.js +43 -3
  11. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index12.js +4 -0
  12. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index23.js +3 -0
  13. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index25.js +339 -301
  14. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js +3 -1
  15. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index27.js +11 -0
  16. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index28.js +64 -0
  17. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +34 -34
  18. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +188 -181
  19. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +162 -154
  20. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShell.js +67 -55
  22. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/labels.js +1 -0
  23. package/package.json +1 -1
@@ -22,33 +22,35 @@ import "../../../shared/feature/dist/index.js";
22
22
  import { identifierLast4 as ae, isIdentifierEnteredOrStored as oe } from "./index7.js";
23
23
  import { bankAccountOnboardingTestIds as p } from "./index12.js";
24
24
  import { ADDITIONAL_OWNERS_LABELS_EN as m } from "../../ui/dist/index5.js";
25
- import { interpolateBankName as h } from "../../ui/dist/index7.js";
26
- import { ResultStep as se } from "../../ui/dist/index12.js";
27
- import { UnsavedApplicationDialog as ce } from "../../ui/dist/index26.js";
25
+ import { interpolateBankName as se } from "../../ui/dist/index7.js";
26
+ import { ResultStep as ce } from "../../ui/dist/index12.js";
27
+ import { UnsavedApplicationDialog as le } from "../../ui/dist/index26.js";
28
+ import { DeleteApplicationDialog as ue } from "../../ui/dist/index28.js";
28
29
  import "../../ui/dist/index.js";
29
- import { BusinessDetailsStep as le } from "./index13.js";
30
- import { PersonalDetailsStep as ue } from "./index15.js";
31
- import { valuesKey as g } from "./index17.js";
32
- import { AdditionalOwnersStep as de } from "./index18.js";
33
- import { buildCreateApplicationBody as fe, buildUpdateApplicationBody as pe } from "./index19.js";
34
- import { buildOnboardingPrefill as me } from "./index20.js";
35
- import { acceptDraftedValues as he, asCreateBody as ge, buildDraftApplicationBody as _e, draftOwners as ve } from "./index21.js";
36
- import { OnboardingAnalyticsEvent as ye, WIDGET_NAME as be } from "./index22.js";
37
- import { DEFAULT_LABELS as _ } from "./index23.js";
38
- import { withoutResumeOnlyOwnerFields as xe, withoutStoredIdentifierMarkers as Se } from "./index24.js";
39
- import { ApplicationClientSecretProvider as Ce, useApplicationClientSecret as we } from "../../data-access/dist/index3.js";
40
- import { useCreateApplication as Te } from "../../data-access/dist/index5.js";
41
- import { useUpdateApplication as Ee } from "../../data-access/dist/index6.js";
42
- import { useSubmitApplication as De } from "../../data-access/dist/index7.js";
43
- import { usePollApplicationCompletion as Oe } from "../../data-access/dist/index8.js";
44
- import { useResumableBankAccountApplication as ke } from "../../data-access/dist/index10.js";
45
- import { useStartedBankAccountApplication as Ae } from "../../data-access/dist/index11.js";
30
+ import { BusinessDetailsStep as de } from "./index13.js";
31
+ import { PersonalDetailsStep as fe } from "./index15.js";
32
+ import { valuesKey as h } from "./index17.js";
33
+ import { AdditionalOwnersStep as pe } from "./index18.js";
34
+ import { buildCreateApplicationBody as me, buildUpdateApplicationBody as he } from "./index19.js";
35
+ import { buildOnboardingPrefill as ge } from "./index20.js";
36
+ import { acceptDraftedValues as _e, asCreateBody as ve, buildDraftApplicationBody as ye, draftOwners as be } from "./index21.js";
37
+ import { OnboardingAnalyticsEvent as xe, WIDGET_NAME as Se } from "./index22.js";
38
+ import { DEFAULT_LABELS as g } from "./index23.js";
39
+ import { withoutResumeOnlyOwnerFields as Ce, withoutStoredIdentifierMarkers as we } from "./index24.js";
40
+ import { ApplicationClientSecretProvider as Te, useApplicationClientSecret as Ee } from "../../data-access/dist/index3.js";
41
+ import { useCreateApplication as De } from "../../data-access/dist/index5.js";
42
+ import { useUpdateApplication as Oe } from "../../data-access/dist/index6.js";
43
+ import { useSubmitApplication as ke } from "../../data-access/dist/index7.js";
44
+ import { useDeleteApplication as Ae } from "../../data-access/dist/index8.js";
45
+ import { usePollApplicationCompletion as je } from "../../data-access/dist/index9.js";
46
+ import { useResumableBankAccountApplication as Me } from "../../data-access/dist/index11.js";
47
+ import { useStartedBankAccountApplication as Ne } from "../../data-access/dist/index12.js";
46
48
  import "../../data-access/dist/index.js";
47
- import { useCallback as je, useEffect as v, useMemo as y, useRef as Me, useState as b } from "react";
48
- import { Fragment as Ne, jsx as x, jsxs as Pe } from "react/jsx-runtime";
49
+ import { useCallback as Pe, useEffect as _, useMemo as v, useRef as Fe, useState as y } from "react";
50
+ import { Fragment as Ie, jsx as b, jsxs as Le } from "react/jsx-runtime";
49
51
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index25.js
50
- var Fe = "DRAFT", S = [], C = (e) => oe(e, void 0);
51
- function Ie(e) {
52
+ var Re = "DRAFT", ze = [], x = (e) => oe(e, void 0);
53
+ function Be(e) {
52
54
  return {
53
55
  ...e,
54
56
  taxId: "",
@@ -56,17 +58,17 @@ function Ie(e) {
56
58
  taxIdOnFileStructure: e.companyStructure === "" ? void 0 : e.companyStructure
57
59
  };
58
60
  }
59
- function w(e) {
61
+ function S(e) {
60
62
  return {
61
63
  ...e,
62
64
  ssn: "",
63
65
  ssnOnFileLast4: ae(e.ssn)
64
66
  };
65
67
  }
66
- function Le(e, t) {
68
+ function Ve(e, t) {
67
69
  return t ? t.index === null ? [...e, t.owner] : e.map((e, n) => n === t.index ? t.owner : e) : e;
68
70
  }
69
- var Re = {
71
+ var He = {
70
72
  companyLegalName: "",
71
73
  companyDbaName: "",
72
74
  businessAddress: "",
@@ -80,7 +82,7 @@ var Re = {
80
82
  naicsCode: "",
81
83
  isAuthorized: null,
82
84
  isCheckboxChecked: !1
83
- }, ze = {
85
+ }, Ue = {
84
86
  firstName: "",
85
87
  lastName: "",
86
88
  dateOfBirth: void 0,
@@ -94,7 +96,7 @@ var Re = {
94
96
  ownsOver25Percent: null,
95
97
  ownershipPercentage: null
96
98
  };
97
- function Be(e, t) {
99
+ function We(e, t) {
98
100
  if (e === 0) return {
99
101
  title: t.businessReviewTitle,
100
102
  subtitle: t.businessReviewSubtitle
@@ -112,59 +114,60 @@ function Be(e, t) {
112
114
  subtitle: n.subheading
113
115
  };
114
116
  }
115
- function Ve({ onEmbeddedOnboardingCompletedSuccessfully: d, onNavigateToDashboard: oe, labels: m, initialBusinessDetails: me, initialPersonalDetails: be, initialAdditionalOwners: Se, initialApplicationId: Ce = null, initialBoundAuthEpoch: ke, onEditableDraftChange: Ae, bankLogoSrc: Fe, disclosureLinks: Ve, open: T, defaultOpen: He, onOpenChange: Ue, isFullScreenInline: E = !1 }) {
116
- let D = ee(), { authEpoch: We } = i();
117
- v(() => {
118
- D(ye.Mounted);
119
- }, [D]);
120
- let O = {
121
- ..._,
117
+ function Ge({ onEmbeddedOnboardingCompletedSuccessfully: d, onNavigateToDashboard: oe, labels: m, initialBusinessDetails: ge, initialPersonalDetails: Se, initialAdditionalOwners: we, initialApplicationId: Te = null, initialBoundAuthEpoch: Me, onEditableDraftChange: Ne, onApplicationDeleted: Re, bankLogoSrc: Ge, disclosureLinks: Ke, open: qe, defaultOpen: Je, onOpenChange: C, isFullScreenInline: w = !1 }) {
118
+ let T = ee(), { authEpoch: Ye } = i();
119
+ _(() => {
120
+ T(xe.Mounted);
121
+ }, [T]);
122
+ let E = {
123
+ ...g,
122
124
  ...m,
123
125
  stepIndicator: {
124
- ..._.stepIndicator,
126
+ ...g.stepIndicator,
125
127
  ...m?.stepIndicator
126
128
  },
127
129
  businessDetails: m?.businessDetails ?? {},
128
130
  personalDetails: m?.personalDetails ?? {},
129
131
  additionalOwners: m?.additionalOwners ?? {},
130
132
  result: {
131
- ..._.result,
133
+ ...g.result,
132
134
  ...m?.result
133
135
  },
134
- unsavedApplicationDialog: m?.unsavedApplicationDialog ?? {}
135
- }, k = re().initResponse, { termsHref: Ge, privacyHref: Ke, electronicCommunicationHref: qe, patriotActHref: Je } = Ve ?? {}, Ye = T === void 0, [Xe, Ze] = b(() => He ?? !1), Qe = Ye ? Xe : T, $e = He ?? !1, A = je((e) => {
136
- Ye && Ze(e), Ue?.(e);
137
- }, [Ue, Ye]), et = je(() => {
136
+ unsavedApplicationDialog: m?.unsavedApplicationDialog ?? {},
137
+ deleteApplicationDialog: m?.deleteApplicationDialog ?? {}
138
+ }, D = re().initResponse, { termsHref: Xe, privacyHref: Ze, electronicCommunicationHref: Qe, patriotActHref: $e } = Ke ?? {}, et = qe === void 0, [tt, nt] = y(() => Je ?? !1), rt = et ? tt : qe, it = Je ?? !1, O = Pe((e) => {
139
+ et && nt(e), C?.(e);
140
+ }, [C, et]), at = Pe(() => {
138
141
  d();
139
- }, [d]), tt = ne(), [j, nt] = b(0), [M, N] = b(() => ({
140
- ...Re,
141
- ...me
142
- })), [P, F] = b(() => ({
143
- ...ze,
144
- ...be
145
- })), [I, L] = b(() => Se ?? []), [R, rt] = b(() => ({
146
- business: M,
147
- personal: P,
148
- owners: I
149
- })), [it, at] = b(null);
150
- v(() => {
151
- if (!it) return;
142
+ }, [d]), ot = ne(), [k, st] = y(0), [A, j] = y(() => ({
143
+ ...He,
144
+ ...ge
145
+ })), [M, N] = y(() => ({
146
+ ...Ue,
147
+ ...Se
148
+ })), [P, F] = y(() => we ?? []), [I, ct] = y(() => ({
149
+ business: A,
150
+ personal: M,
151
+ owners: P
152
+ })), [lt, ut] = y(null);
153
+ _(() => {
154
+ if (!lt) return;
152
155
  let e = {
153
- business: M,
154
- personal: P,
155
- owners: I
156
+ business: A,
157
+ personal: M,
158
+ owners: P
156
159
  };
157
- rt((t) => it.next(e, t)), at(null);
160
+ ct((t) => lt.next(e, t)), ut(null);
158
161
  }, [
159
- it,
162
+ lt,
163
+ A,
160
164
  M,
161
- P,
162
- I
165
+ P
163
166
  ]);
164
- let ot = (e, { owners: t = "none" } = {}) => at({ next: (n, r) => ({
167
+ let dt = (e, { owners: t = "none" } = {}) => ut({ next: (n, r) => ({
165
168
  business: e.includes("business") ? n.business : r.business,
166
169
  personal: e.includes("personal") ? n.personal : r.personal,
167
- owners: t === "cleared" ? S : t === "restored" ? he({
170
+ owners: t === "cleared" ? ze : t === "restored" ? _e({
168
171
  current: n,
169
172
  saved: r,
170
173
  dirty: {
@@ -174,264 +177,279 @@ function Ve({ onEmbeddedOnboardingCompletedSuccessfully: d, onNavigateToDashboar
174
177
  },
175
178
  ownersWrite: "list"
176
179
  }).owners : e.includes("owners") ? n.owners : r.owners
177
- }) }), [st, ct] = b(null), [lt, ut] = b(0), [dt, z] = b(!1), [ft, pt] = b(!1), [B, mt] = b(null), [V, ht] = b(null), [gt, _t] = b(null), [H, vt] = b(Ce), [yt, bt] = b(!1), [U, xt] = b({}), St = (e) => xt((t) => ({
180
+ }) }), [ft, pt] = y(null), [mt, ht] = y(0), [gt, L] = y(!1), [_t, vt] = y(!1), [R, yt] = y(null), [z, bt] = y(null), [xt, St] = y(null), [B, Ct] = y(Te), [wt, Tt] = y(!1), [V, Et] = y({}), Dt = (e) => Et((t) => ({
178
181
  ...t,
179
- ...e.taxId && C(e.taxId) && e.taxIdStructure ? {
182
+ ...e.taxId && x(e.taxId) && e.taxIdStructure ? {
180
183
  taxId: e.taxId,
181
184
  taxIdStructure: e.taxIdStructure
182
185
  } : {},
183
- ...e.ssn && C(e.ssn) ? { ssn: e.ssn } : {}
184
- })), Ct = (e) => {
185
- let { taxId: t, taxIdStructure: n } = U, r = t !== void 0 && n !== void 0 && e.companyStructure !== M.companyStructure && e.companyStructure !== "" && e.companyStructure === "SOLE_PROPRIETORSHIP" != (n === "SOLE_PROPRIETORSHIP");
186
- N(r ? {
186
+ ...e.ssn && x(e.ssn) ? { ssn: e.ssn } : {}
187
+ })), Ot = (e) => {
188
+ let { taxId: t, taxIdStructure: n } = V, r = t !== void 0 && n !== void 0 && e.companyStructure !== A.companyStructure && e.companyStructure !== "" && e.companyStructure === "SOLE_PROPRIETORSHIP" != (n === "SOLE_PROPRIETORSHIP");
189
+ j(r ? {
187
190
  ...e,
188
191
  taxId: e.taxId === t ? "" : e.taxId,
189
192
  taxIdOnFileLast4: ae(t),
190
193
  taxIdOnFileStructure: n
191
194
  } : e);
192
- }, [wt, Tt] = b(ke ?? We), [Et, W] = b(null), [Dt, Ot] = b(!1), [kt, At] = b(!1), [jt, Mt] = b(null), Nt = Te(), G = Ee(), Pt = De(), Ft = Oe(), { setClientSecret: It } = we(), { data: Lt, refetch: Rt } = o(), { mutateAsync: zt } = a(), Bt = c(), Vt = Me(null);
193
- v(() => () => Vt.current?.abort(), []);
194
- let Ht = y(() => ie(O.businessDetails.naicsTitles), [O.businessDetails.naicsTitles]), Ut = y(() => f(O.businessDetails.stateTitles), [O.businessDetails.stateTitles]), Wt = y(() => f(O.personalDetails.stateTitles), [O.personalDetails.stateTitles]), Gt = y(() => f(O.additionalOwners.stateTitles), [O.additionalOwners.stateTitles]), K = kt || jt !== null, Kt = k?.status === "ACTIVE" || k?.status === "INACTIVE", qt = k?.status === "INVITED", q = !!k && !K && (Kt || qt || Bt.isSuppressed), J = q ? Kt ? s.UserAlreadyOnboarded : qt ? s.UserInvitedToOrganization : Bt.reason : null;
195
- v(() => {
196
- q && J && (D(ye.Suppressed, { reason: J }), console.info(`[onboarding] not shown: ${J}`));
195
+ }, [kt, At] = y(Me ?? Ye), [jt, H] = y(null), [Mt, Nt] = y(!1), [Pt, U] = y(!1);
196
+ !w && !rt && Pt && U(!1);
197
+ let [Ft, It] = y(!1), [Lt, Rt] = y(null), zt = De(), W = Oe(), Bt = ke(), Vt = Ae(), Ht = je(), { setClientSecret: Ut } = Ee(), { data: Wt, refetch: Gt } = o(), { mutateAsync: Kt } = a(), qt = c(), Jt = Fe(null);
198
+ _(() => () => Jt.current?.abort(), []);
199
+ let Yt = v(() => ie(E.businessDetails.naicsTitles), [E.businessDetails.naicsTitles]), Xt = v(() => f(E.businessDetails.stateTitles), [E.businessDetails.stateTitles]), Zt = v(() => f(E.personalDetails.stateTitles), [E.personalDetails.stateTitles]), Qt = v(() => f(E.additionalOwners.stateTitles), [E.additionalOwners.stateTitles]), G = Ft || Lt !== null, $t = D?.status === "ACTIVE" || D?.status === "INACTIVE", en = D?.status === "INVITED", K = !!D && !G && ($t || en || qt.isSuppressed), q = K ? $t ? s.UserAlreadyOnboarded : en ? s.UserInvitedToOrganization : qt.reason : null;
200
+ _(() => {
201
+ K && q && (T(xe.Suppressed, { reason: q }), console.info(`[onboarding] not shown: ${q}`));
197
202
  }, [
203
+ K,
198
204
  q,
199
- J,
200
- D
201
- ]), v(() => {
202
- Ae?.(K || H === null ? null : {
203
- applicationId: H,
204
- authEpoch: wt
205
+ T
206
+ ]), _(() => {
207
+ Ne?.(G || B === null ? null : {
208
+ applicationId: B,
209
+ authEpoch: kt
205
210
  });
206
211
  }, [
207
- Ae,
208
- K,
209
- H,
210
- wt
212
+ Ne,
213
+ G,
214
+ B,
215
+ kt
211
216
  ]);
212
- let Jt = Me(We);
213
- if (Jt.current = We, !k || !K && (q || !Bt.isResolved)) return null;
214
- let Y = B?.companyStructure === "SOLE_PROPRIETORSHIP", Yt = [
215
- O.stepIndicator.business,
216
- O.stepIndicator.personal,
217
- O.stepIndicator.ownership
218
- ], Xt = j === 0 ? B : j === 1 ? V : j === 2 ? gt : null, X = Nt.isPending || G.isPending || Pt.isPending || kt, Zt = () => {
219
- W(null), nt((e) => e === 0 ? 0 : e - 1);
220
- }, Z = {
221
- business: g(M) !== g(R.business),
222
- personal: g(P) !== g(R.personal),
223
- owners: g(M.companyStructure === "SOLE_PROPRIETORSHIP" ? S : Le(I, st)) !== g(R.owners)
224
- }, Qt = Z.business || Z.personal || Z.owners, Q = {
225
- business: (e) => U.taxId && e.taxId === U.taxId ? Ie(e) : e,
226
- personal: (e) => U.ssn && e.ssn === U.ssn ? w(e) : e,
227
- owners: (e) => e.map((e) => e.id && C(e.ssn) ? w(e) : e)
228
- }, $t = () => rt((e) => ({
229
- business: Q.business(e.business),
230
- personal: Q.personal(e.personal),
231
- owners: Q.owners(e.owners)
232
- })), en = () => {
233
- X || (Qt ? z(!0) : (N(Q.business), F(Q.personal), L(Q.owners), $t(), A(!1)));
234
- }, tn = (e) => {
235
- e ? A(!0) : en();
236
- }, nn = en, rn = async (e) => {
237
- At(!0), A(!0);
217
+ let tn = Fe(Ye);
218
+ if (tn.current = Ye, !D || !G && (K || !qt.isResolved)) return null;
219
+ let J = R?.companyStructure === "SOLE_PROPRIETORSHIP", nn = [
220
+ E.stepIndicator.business,
221
+ E.stepIndicator.personal,
222
+ E.stepIndicator.ownership
223
+ ], rn = k === 0 ? R : k === 1 ? z : k === 2 ? xt : null, Y = zt.isPending || W.isPending || Bt.isPending || Vt.isPending || Ft, an = () => {
224
+ H(null), st((e) => e === 0 ? 0 : e - 1);
225
+ }, X = {
226
+ business: h(A) !== h(I.business),
227
+ personal: h(M) !== h(I.personal),
228
+ owners: h(A.companyStructure === "SOLE_PROPRIETORSHIP" ? ze : Ve(P, ft)) !== h(I.owners)
229
+ }, on = X.business || X.personal || X.owners, Z = {
230
+ business: (e) => V.taxId && e.taxId === V.taxId ? Be(e) : e,
231
+ personal: (e) => V.ssn && e.ssn === V.ssn ? S(e) : e,
232
+ owners: (e) => e.map((e) => e.id && x(e.ssn) ? S(e) : e)
233
+ }, sn = () => ct((e) => ({
234
+ business: Z.business(e.business),
235
+ personal: Z.personal(e.personal),
236
+ owners: Z.owners(e.owners)
237
+ })), cn = () => {
238
+ Y || (on ? L(!0) : (j(Z.business), N(Z.personal), F(Z.owners), sn(), O(!1)));
239
+ }, ln = (e) => {
240
+ e ? O(!0) : cn();
241
+ }, un = cn, dn = async (e) => {
242
+ It(!0), O(!0);
238
243
  let t = new AbortController();
239
- Vt.current = t;
244
+ Jt.current = t;
240
245
  let n = !1;
241
246
  try {
242
- let r = await Pt.mutateAsync({ path: { id: e } });
247
+ let r = await Bt.mutateAsync({ path: { id: e } });
243
248
  if (t.signal.aborted) return;
244
- if (!r.id) throw Error(O.submitFailedError);
245
- if (n = !0, (await Ft(e, { signal: t.signal })).status === "complete") {
246
- let e = Lt;
247
- if (e === void 0 && (e = (await Rt()).data), t.signal.aborted) return;
249
+ if (!r.id) throw Error(E.submitFailedError);
250
+ if (n = !0, (await Ht(e, { signal: t.signal })).status === "complete") {
251
+ let e = Wt;
252
+ if (e === void 0 && (e = (await Gt()).data), t.signal.aborted) return;
248
253
  if (e !== void 0) try {
249
- await zt({ displayedVersion: e.version ?? null });
254
+ await Kt({ displayedVersion: e.version ?? null });
250
255
  } catch {}
251
256
  if (t.signal.aborted) return;
252
- Mt("success"), tt(), et();
253
- } else Mt("pending");
257
+ Rt("success"), ot(), at();
258
+ } else Rt("pending");
254
259
  } catch (e) {
255
260
  if (e instanceof DOMException && e.name === "AbortError") return;
256
261
  if (!n) throw e;
257
- Mt("pending");
262
+ Rt("pending");
258
263
  } finally {
259
- Vt.current = null, At(!1);
264
+ Jt.current = null, It(!1);
260
265
  }
261
- }, $ = ({ evenWithoutMarker: e = !1 } = {}) => {
262
- N((t) => (t.taxIdOnFileLast4 || e) && C(t.taxId) ? Ie(t) : t);
263
- }, an = ({ evenWithoutMarker: e = !1 } = {}) => {
264
- F((t) => (t.ssnOnFileLast4 || e) && C(t.ssn) ? w(t) : t);
265
- }, on = ({ evenWithoutMarker: e = !1 } = {}) => {
266
- L((t) => t.map((t) => (t.ssnOnFileLast4 || e && t.id) && C(t.ssn) ? w(t) : t));
267
- }, sn = () => {
268
- L((e) => e.map(xe));
269
- }, cn = async (e) => {
270
- let t = Jt.current, n = await Nt.mutateAsync({ body: e });
271
- return vt(n.id), Tt(t), n.clientSecret && It(n.id, n.clientSecret), n.id;
272
- }, ln = async () => {
273
- let e = R.business.companyStructure === "SOLE_PROPRIETORSHIP" && !Y ? ve(I) : [], t = e.length > 0 ? { businessOwners: e } : {};
274
- if (j === 0) {
275
- if (!B) return null;
276
- let e = H;
277
- return e ? await G.mutateAsync({
266
+ }, Q = ({ evenWithoutMarker: e = !1 } = {}) => {
267
+ j((t) => (t.taxIdOnFileLast4 || e) && x(t.taxId) ? Be(t) : t);
268
+ }, fn = ({ evenWithoutMarker: e = !1 } = {}) => {
269
+ N((t) => (t.ssnOnFileLast4 || e) && x(t.ssn) ? S(t) : t);
270
+ }, pn = ({ evenWithoutMarker: e = !1 } = {}) => {
271
+ F((t) => t.map((t) => (t.ssnOnFileLast4 || e && t.id) && x(t.ssn) ? S(t) : t));
272
+ }, mn = () => {
273
+ F((e) => e.map(Ce));
274
+ }, hn = async (e) => {
275
+ let t = tn.current, n = await zt.mutateAsync({ body: e });
276
+ return Ct(n.id), At(t), n.clientSecret && Ut(n.id, n.clientSecret), n.id;
277
+ }, gn = async () => {
278
+ let e = I.business.companyStructure === "SOLE_PROPRIETORSHIP" && !J ? be(P) : [], t = e.length > 0 ? { businessOwners: e } : {};
279
+ if (k === 0) {
280
+ if (!R) return null;
281
+ let e = B;
282
+ return e ? await W.mutateAsync({
278
283
  path: { id: e },
279
284
  body: {
280
- ...pe({
281
- businessDetails: B,
282
- carryConsent: !yt
285
+ ...he({
286
+ businessDetails: R,
287
+ carryConsent: !wt
283
288
  }),
284
289
  ...t
285
290
  }
286
- }) : (e = await cn(fe(B)), bt(!0)), St({
287
- taxId: B.taxId,
288
- taxIdStructure: B.companyStructure
289
- }), $(), Y && sn(), ot(["business"], { owners: Y ? "cleared" : t.businessOwners ? "restored" : "none" }), e;
291
+ }) : (e = await hn(me(R)), Tt(!0)), Dt({
292
+ taxId: R.taxId,
293
+ taxIdStructure: R.companyStructure
294
+ }), Q(), J && mn(), dt(["business"], { owners: J ? "cleared" : t.businessOwners ? "restored" : "none" }), e;
290
295
  }
291
- return j === 1 ? !V || !B || !H ? null : (await G.mutateAsync({
292
- path: { id: H },
296
+ return k === 1 ? !z || !R || !B ? null : (await W.mutateAsync({
297
+ path: { id: B },
293
298
  body: {
294
- ...pe({
295
- businessDetails: B,
296
- applicant: V,
297
- carryConsent: !yt
299
+ ...he({
300
+ businessDetails: R,
301
+ applicant: z,
302
+ carryConsent: !wt
298
303
  }),
299
304
  ...t
300
305
  }
301
- }), St({
302
- taxId: B.taxId,
303
- taxIdStructure: B.companyStructure,
304
- ssn: V.ssn
305
- }), $(), an(), ot(["business", "personal"], { owners: Y ? "cleared" : t.businessOwners ? "restored" : "none" }), H) : j === 2 ? !gt || !H ? null : (await G.mutateAsync({
306
- path: { id: H },
307
- body: pe({ businessOwners: gt })
308
- }), on(), ot(["owners"]), H) : null;
309
- }, un = (e) => te(e) ?? (e instanceof Error ? e.message : void 0) ?? O.genericRetryError, dn = async () => {
310
- W(null);
306
+ }), Dt({
307
+ taxId: R.taxId,
308
+ taxIdStructure: R.companyStructure,
309
+ ssn: z.ssn
310
+ }), Q(), fn(), dt(["business", "personal"], { owners: J ? "cleared" : t.businessOwners ? "restored" : "none" }), B) : k === 2 ? !xt || !B ? null : (await W.mutateAsync({
311
+ path: { id: B },
312
+ body: he({ businessOwners: xt })
313
+ }), pn(), dt(["owners"]), B) : null;
314
+ }, $ = (e) => te(e) ?? (e instanceof Error ? e.message : void 0) ?? E.genericRetryError, _n = async () => {
315
+ H(null);
311
316
  try {
312
- let e = await ln();
317
+ let e = await gn();
313
318
  if (e === null) return;
314
- j === 2 ? await rn(e) : nt(j + 1);
319
+ k === 2 ? await dn(e) : st(k + 1);
315
320
  } catch (e) {
316
- W(un(e));
321
+ H($(e));
317
322
  }
318
- }, fn = async () => {
319
- W(null), Ot(!0);
323
+ }, vn = async () => {
324
+ H(null), Nt(!0);
320
325
  try {
321
- if (await ln() === null) return;
322
- $({ evenWithoutMarker: !0 }), j >= 1 && an({ evenWithoutMarker: !0 }), j === 2 && on({ evenWithoutMarker: !0 }), r.success(O.applicationSavedToast), A(!1);
326
+ if (await gn() === null) return;
327
+ Q({ evenWithoutMarker: !0 }), k >= 1 && fn({ evenWithoutMarker: !0 }), k === 2 && pn({ evenWithoutMarker: !0 }), r.success(E.applicationSavedToast), O(!1);
323
328
  } catch (e) {
324
- r.error(un(e));
329
+ r.error($(e));
325
330
  } finally {
326
- Ot(!1);
331
+ Nt(!1);
327
332
  }
328
- }, pn = async () => {
329
- let e = Le(I, st), t = _e({
330
- businessDetails: M,
331
- applicant: P,
333
+ }, yn = async () => {
334
+ let e = Ve(P, ft), t = ye({
335
+ businessDetails: A,
336
+ applicant: M,
332
337
  businessOwners: e,
333
- savedBusinessDetails: R.business,
334
- savedOwners: R.owners,
335
- dirty: Z
336
- }), n = Z;
337
- pt(!0);
338
+ savedBusinessDetails: I.business,
339
+ savedOwners: I.owners,
340
+ dirty: X
341
+ }), n = X;
342
+ vt(!0);
338
343
  try {
339
344
  if (!t) {
340
- r.error(O.saveDraftNothingValidError);
345
+ r.error(E.saveDraftNothingValidError);
341
346
  return;
342
347
  }
343
- let i = !H;
344
- H ? await G.mutateAsync({
345
- path: { id: H },
348
+ let i = !B;
349
+ B ? await W.mutateAsync({
350
+ path: { id: B },
346
351
  body: t
347
- }) : await cn(ge(t)), st && L(e), r.success(O.applicationSavedToast);
352
+ }) : await hn(ve(t)), ft && F(e), r.success(E.applicationSavedToast);
348
353
  let a = t;
349
- i && a.applicant?.isLegallyAuthorized && a.applicant?.hasAcceptedDisclosures && bt(!0), St({
354
+ i && a.applicant?.isLegallyAuthorized && a.applicant?.hasAcceptedDisclosures && Tt(!0), Dt({
350
355
  taxId: a.businessDetails?.taxId?.value,
351
- taxIdStructure: M.companyStructure,
356
+ taxIdStructure: A.companyStructure,
352
357
  ssn: a.applicant?.personalIdentificationNumber?.value
353
- }), a.businessDetails?.taxId !== void 0 && $({ evenWithoutMarker: !0 }), a.applicant?.personalIdentificationNumber !== void 0 && an({ evenWithoutMarker: !0 }), Array.isArray(a.businessOwners) && on({ evenWithoutMarker: !0 }), a.businessOwners === null && e.length > 0 && sn();
358
+ }), a.businessDetails?.taxId !== void 0 && Q({ evenWithoutMarker: !0 }), a.applicant?.personalIdentificationNumber !== void 0 && fn({ evenWithoutMarker: !0 }), Array.isArray(a.businessOwners) && pn({ evenWithoutMarker: !0 }), a.businessOwners === null && e.length > 0 && mn();
354
359
  let o = Array.isArray(a.businessOwners) ? "list" : a.businessOwners === null ? "cleared" : "none";
355
- at({ next: (e, t) => he({
360
+ ut({ next: (e, t) => _e({
356
361
  current: e,
357
362
  saved: t,
358
363
  dirty: n,
359
364
  ownersWrite: o
360
- }) }), ct(null), ut((e) => e + 1), z(!1), A(!1);
365
+ }) }), pt(null), ht((e) => e + 1), L(!1), O(!1);
361
366
  } catch (e) {
362
- r.error(un(e));
367
+ r.error($(e));
363
368
  } finally {
364
- pt(!1);
369
+ vt(!1);
365
370
  }
366
- }, mn = () => {
367
- N(Q.business(R.business)), F(Q.personal(R.personal)), L(Q.owners(R.owners)), $t(), ct(null), ut((e) => e + 1), W(null), z(!1), A(!1);
368
- }, hn = Be(Math.min(j, 2), O), gn = k.bankName?.trim() || O.fallbackBankName, _n = h(O.shellFdicDisclaimer, gn);
369
- if (K) {
370
- let r = B?.companyLegalName ?? "", i = k.bankName?.trim() || O.fallbackBankName, a = jt ?? "pending", o = a === "success", s = {
371
- ..._.result,
372
- ...O.result
373
- }, c = /* @__PURE__ */ x(se, {
371
+ }, bn = () => {
372
+ j(Z.business(I.business)), N(Z.personal(I.personal)), F(Z.owners(I.owners)), sn(), pt(null), ht((e) => e + 1), H(null), L(!1), O(!1);
373
+ }, xn = async () => {
374
+ if (B !== null) {
375
+ try {
376
+ await Vt.mutateAsync({ path: { id: B } });
377
+ } catch (e) {
378
+ r.error($(e));
379
+ return;
380
+ }
381
+ r.success(E.applicationDeletedToast);
382
+ }
383
+ U(!1), O(!1), Re?.();
384
+ }, Sn = We(Math.min(k, 2), E), Cn = D.bankName?.trim() || E.fallbackBankName, wn = se(E.shellFdicDisclaimer, Cn);
385
+ if (G) {
386
+ let r = R?.companyLegalName ?? "", i = D.bankName?.trim() || E.fallbackBankName, a = Lt ?? "pending", o = a === "success", s = {
387
+ ...g.result,
388
+ ...E.result
389
+ }, c = /* @__PURE__ */ b(ce, {
374
390
  testIds: {
375
391
  processing: p.resultProcessing,
376
392
  dashboardButton: p.resultDashboardButton
377
393
  },
378
394
  status: a,
379
- isLoading: kt,
395
+ isLoading: Ft,
380
396
  loadingMessage: s.loadingMessage,
381
397
  headingLine1: o ? s.successHeadingLine1 : s.pendingHeadingLine1,
382
398
  headingLine2: `${r}!`,
383
399
  body: o ? s.successBody : s.pendingBody,
384
- followUpEmail: V?.workEmail ?? "",
400
+ followUpEmail: z?.workEmail ?? "",
385
401
  emailBoxLead: s.pendingEmailBoxLead,
386
402
  navigateToDashboardLabel: s.navigateToDashboard,
387
- bankLogoSrc: Fe,
388
- bankLogoAlt: h(s.bankLogoAlt, i),
389
- fdicDisclaimer: h(s.fdicDisclaimer, i),
403
+ bankLogoSrc: Ge,
404
+ bankLogoAlt: se(s.bankLogoAlt, i),
405
+ fdicDisclaimer: se(s.fdicDisclaimer, i),
390
406
  onNavigateToDashboard: oe
391
407
  });
392
- return E ? /* @__PURE__ */ x("div", {
408
+ return w ? /* @__PURE__ */ b("div", {
393
409
  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",
394
410
  children: c
395
- }) : /* @__PURE__ */ x(e, {
396
- open: Qe,
397
- onOpenChange: A,
398
- children: /* @__PURE__ */ Pe(t, {
411
+ }) : /* @__PURE__ */ b(e, {
412
+ open: rt,
413
+ onOpenChange: O,
414
+ children: /* @__PURE__ */ Le(t, {
399
415
  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",
400
- children: [/* @__PURE__ */ x(n, {
416
+ children: [/* @__PURE__ */ b(n, {
401
417
  className: "ttw:sr-only",
402
- children: O.modalTitle
418
+ children: E.modalTitle
403
419
  }), c]
404
420
  })
405
421
  });
406
422
  }
407
- let vn = j === 2 ? O.submit : O.next, yn = Xt === null || X;
408
- return /* @__PURE__ */ Pe(Ne, { children: [
409
- /* @__PURE__ */ Pe(u, {
410
- open: Qe,
411
- defaultOpen: $e,
412
- onOpenChange: tn,
413
- isFullScreenInline: E,
414
- title: hn.title,
415
- subtitle: hn.subtitle,
416
- stepLabels: Yt,
417
- activeStep: j,
418
- disclaimerText: _n,
419
- onBack: j === 0 ? nn : Zt,
420
- onCancel: j > 0 ? nn : void 0,
421
- onNext: dn,
422
- onSaveAndClose: fn,
423
+ let Tn = k === 2 ? E.submit : E.next, En = rn === null || Y;
424
+ return /* @__PURE__ */ Le(Ie, { children: [
425
+ /* @__PURE__ */ Le(u, {
426
+ open: rt,
427
+ defaultOpen: it,
428
+ onOpenChange: ln,
429
+ isFullScreenInline: w,
430
+ title: Sn.title,
431
+ subtitle: Sn.subtitle,
432
+ stepLabels: nn,
433
+ activeStep: k,
434
+ disclaimerText: wn,
435
+ onBack: k === 0 ? un : an,
436
+ onCancel: k > 0 ? un : void 0,
437
+ onNext: _n,
438
+ onSaveAndClose: vn,
439
+ onDelete: () => U(!0),
423
440
  showDismissButton: !1,
424
- isNextDisabled: yn,
425
- isNextLoading: X && !Dt,
426
- isSaveAndCloseDisabled: yn,
427
- isSaveAndCloseLoading: Dt,
428
- nextLabel: vn,
441
+ isNextDisabled: En,
442
+ isNextLoading: Y && !Mt,
443
+ isSaveAndCloseDisabled: En,
444
+ isSaveAndCloseLoading: Mt,
445
+ nextLabel: Tn,
429
446
  nextIcon: null,
430
- errorMessage: Et,
447
+ errorMessage: jt,
431
448
  labels: {
432
- backButton: j === 0 ? O.cancel : O.back,
433
- cancelButton: O.cancel,
434
- saveAndCloseButton: O.saveAndClose
449
+ backButton: k === 0 ? E.cancel : E.back,
450
+ cancelButton: E.cancel,
451
+ saveAndCloseButton: E.saveAndClose,
452
+ deleteButton: E.deleteApplication
435
453
  },
436
454
  testIds: {
437
455
  root: p.shell,
@@ -439,6 +457,7 @@ function Ve({ onEmbeddedOnboardingCompletedSuccessfully: d, onNavigateToDashboar
439
457
  back: p.shellBack,
440
458
  cancel: p.shellCancel,
441
459
  saveAndClose: p.shellSaveAndClose,
460
+ delete: p.shellDelete,
442
461
  next: p.shellNext,
443
462
  scrollRegion: {
444
463
  root: p.shellScrollRegion,
@@ -447,48 +466,48 @@ function Ve({ onEmbeddedOnboardingCompletedSuccessfully: d, onNavigateToDashboar
447
466
  }
448
467
  },
449
468
  children: [
450
- j === 0 ? /* @__PURE__ */ x(le, {
451
- value: M,
452
- onValueChange: Ct,
453
- onSnapshotChange: mt,
454
- naicsOptions: Ht,
455
- stateOptions: Ut,
456
- isSubmitting: X,
457
- labels: O.businessDetails,
458
- bankName: gn,
459
- termsHref: Ge,
460
- privacyHref: Ke,
461
- electronicCommunicationHref: qe,
462
- patriotActHref: Je
469
+ k === 0 ? /* @__PURE__ */ b(de, {
470
+ value: A,
471
+ onValueChange: Ot,
472
+ onSnapshotChange: yt,
473
+ naicsOptions: Yt,
474
+ stateOptions: Xt,
475
+ isSubmitting: Y,
476
+ labels: E.businessDetails,
477
+ bankName: Cn,
478
+ termsHref: Xe,
479
+ privacyHref: Ze,
480
+ electronicCommunicationHref: Qe,
481
+ patriotActHref: $e
463
482
  }, "business") : null,
464
- j === 1 ? /* @__PURE__ */ x(ue, {
465
- value: P,
466
- onValueChange: F,
467
- onSnapshotChange: ht,
468
- stateOptions: Wt,
469
- isSubmitting: X,
470
- labels: O.personalDetails
483
+ k === 1 ? /* @__PURE__ */ b(fe, {
484
+ value: M,
485
+ onValueChange: N,
486
+ onSnapshotChange: bt,
487
+ stateOptions: Zt,
488
+ isSubmitting: Y,
489
+ labels: E.personalDetails
471
490
  }, "personal") : null,
472
- j === 2 ? /* @__PURE__ */ x(de, {
473
- owners: Y ? S : I,
474
- onOwnersChange: L,
475
- primaryOwnerName: `${P.firstName} ${P.lastName}`.trim(),
476
- primaryOwnerPercentage: Y ? 100 : V?.ownsOver25Percent === !0 ? V.ownershipPercentage ?? 0 : 0,
477
- stateOptions: Gt,
478
- onSnapshotChange: _t,
479
- onPendingOwnerChange: ct,
480
- isSubmitting: X,
481
- labels: O.additionalOwners
482
- }, lt) : null
491
+ k === 2 ? /* @__PURE__ */ b(pe, {
492
+ owners: J ? ze : P,
493
+ onOwnersChange: F,
494
+ primaryOwnerName: `${M.firstName} ${M.lastName}`.trim(),
495
+ primaryOwnerPercentage: J ? 100 : z?.ownsOver25Percent === !0 ? z.ownershipPercentage ?? 0 : 0,
496
+ stateOptions: Qt,
497
+ onSnapshotChange: St,
498
+ onPendingOwnerChange: pt,
499
+ isSubmitting: Y,
500
+ labels: E.additionalOwners
501
+ }, mt) : null
483
502
  ]
484
503
  }),
485
- /* @__PURE__ */ x(ce, {
486
- open: dt,
487
- onSaveDraft: pn,
488
- onDiscard: mn,
489
- onCancel: () => z(!1),
490
- isSaving: ft,
491
- labels: O.unsavedApplicationDialog,
504
+ /* @__PURE__ */ b(le, {
505
+ open: gt,
506
+ onSaveDraft: yn,
507
+ onDiscard: bn,
508
+ onCancel: () => L(!1),
509
+ isSaving: _t,
510
+ labels: E.unsavedApplicationDialog,
492
511
  testIds: {
493
512
  root: p.unsavedDialog,
494
513
  saveDraft: p.unsavedDialogSaveDraft,
@@ -496,11 +515,26 @@ function Ve({ onEmbeddedOnboardingCompletedSuccessfully: d, onNavigateToDashboar
496
515
  close: p.unsavedDialogClose
497
516
  }
498
517
  }),
499
- /* @__PURE__ */ x(l, {})
518
+ /* @__PURE__ */ b(ue, {
519
+ open: Pt,
520
+ onConfirm: xn,
521
+ onCancel: () => U(!1),
522
+ isDeleting: Vt.isPending,
523
+ labels: {
524
+ descriptionEmphasis: E.saveAndClose,
525
+ ...E.deleteApplicationDialog
526
+ },
527
+ testIds: {
528
+ root: p.deleteDialog,
529
+ confirm: p.deleteDialogConfirm,
530
+ cancel: p.deleteDialogCancel
531
+ }
532
+ }),
533
+ /* @__PURE__ */ b(l, {})
500
534
  ] });
501
535
  }
502
- function T({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework: s, errorFallback: c, onError: l, analytics: u, disclosuresAcceptance: ee, providerLabels: f, ...te }) {
503
- return /* @__PURE__ */ x(d, {
536
+ function Ke({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework: s, errorFallback: c, onError: l, analytics: u, disclosuresAcceptance: ee, providerLabels: f, ...te }) {
537
+ return /* @__PURE__ */ b(d, {
504
538
  baseUrl: e,
505
539
  widgetToken: t,
506
540
  organizationId: n,
@@ -514,41 +548,45 @@ function T({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gat
514
548
  analytics: u,
515
549
  disclosuresAcceptance: ee,
516
550
  providerLabels: f,
517
- widgetName: be,
518
- children: /* @__PURE__ */ x(He, { ...te })
551
+ widgetName: Se,
552
+ children: /* @__PURE__ */ b(qe, { ...te })
519
553
  });
520
554
  }
521
- function He(e) {
522
- let { initResponse: t } = re(), { client: n } = i(), r = t?.userId ?? null, [a, o] = b(r), [s, c] = b(0);
555
+ function qe(e) {
556
+ let { initResponse: t } = re(), { client: n } = i(), r = t?.userId ?? null, [a, o] = y(r), [s, c] = y(0);
523
557
  r !== a && (o(r), a !== null && r !== null && c((e) => e + 1));
524
- let [l, u] = b(n);
525
- return n !== l && (u(n), c((e) => e + 1)), /* @__PURE__ */ x(Ue, { ...e }, s);
558
+ let [l, u] = y(n);
559
+ return n !== l && (u(n), c((e) => e + 1)), /* @__PURE__ */ b(Je, { ...e }, s);
526
560
  }
527
- function Ue(e) {
528
- let { authEpoch: t } = i(), { ownApplicationIds: n } = ke(), [r, a] = b(null), [o, s] = b(0);
529
- return r !== null && t !== r.authEpoch && n !== null && !n.includes(r.applicationId) && (a(null), s((e) => e + 1)), /* @__PURE__ */ x(Ce, { children: /* @__PURE__ */ x(D, {
561
+ function Je(e) {
562
+ let { authEpoch: t } = i(), { ownApplicationIds: n } = Me(), [r, a] = y(null), [o, s] = y(0), [c, l] = y(!1), u = Pe(() => {
563
+ a(null), l(!0), s((e) => e + 1);
564
+ }, []);
565
+ return r !== null && t !== r.authEpoch && n !== null && !n.includes(r.applicationId) && (a(null), s((e) => e + 1)), /* @__PURE__ */ b(Te, { children: /* @__PURE__ */ b(w, {
530
566
  ...e,
531
- onEditableDraftChange: a
567
+ defaultOpen: !c && e.defaultOpen,
568
+ onEditableDraftChange: a,
569
+ onApplicationDeleted: u
532
570
  }, o) }, o);
533
571
  }
534
- var E = { canRender: !1 };
535
- function D(e) {
536
- let { authEpoch: t } = i(), { applicationId: n, clientSecret: r, isResolved: a } = ke(), { application: o, isResolved: s, isUnavailable: c } = Ae(n, r), [l, u] = b(null);
537
- if (v(() => {
572
+ var C = { canRender: !1 };
573
+ function w(e) {
574
+ let { authEpoch: t } = i(), { applicationId: n, clientSecret: r, isResolved: a } = Me(), { application: o, isResolved: s, isUnavailable: c } = Ne(n, r), [l, u] = y(null);
575
+ if (_(() => {
538
576
  if (l?.canRender !== !0 && a && s) {
539
577
  if (c) {
540
- u(E);
578
+ u(C);
541
579
  return;
542
580
  }
543
- if (o !== null && o.status !== void 0 && o.status !== Fe) {
544
- u(E);
581
+ if (o !== null && o.status !== void 0 && o.status !== Re) {
582
+ u(C);
545
583
  return;
546
584
  }
547
585
  u({
548
586
  canRender: !0,
549
587
  applicationId: o === null ? null : n,
550
588
  authEpoch: t,
551
- prefill: me(o)
589
+ prefill: ge(o)
552
590
  });
553
591
  }
554
592
  }, [
@@ -561,20 +599,20 @@ function D(e) {
561
599
  n
562
600
  ]), l === null || !l.canRender) return null;
563
601
  let { applicationId: ee, authEpoch: d, prefill: f } = l;
564
- return /* @__PURE__ */ x(Ve, {
602
+ return /* @__PURE__ */ b(Ge, {
565
603
  ...e,
566
604
  initialApplicationId: ee,
567
605
  initialBoundAuthEpoch: d,
568
606
  initialBusinessDetails: {
569
- ...Se(e.initialBusinessDetails),
607
+ ...we(e.initialBusinessDetails),
570
608
  ...f?.businessDetails
571
609
  },
572
610
  initialPersonalDetails: {
573
- ...Se(e.initialPersonalDetails),
611
+ ...we(e.initialPersonalDetails),
574
612
  ...f?.personalDetails
575
613
  },
576
- initialAdditionalOwners: f?.additionalOwners ?? e.initialAdditionalOwners?.map(xe)
614
+ initialAdditionalOwners: f?.additionalOwners ?? e.initialAdditionalOwners?.map(Ce)
577
615
  });
578
616
  }
579
617
  //#endregion
580
- export { T as BankAccountOnboardingWidget, T as default };
618
+ export { Ke as BankAccountOnboardingWidget, Ke as default };