@tesouro/embedded-components-react 0.11.260 → 0.11.264

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.
@@ -47,20 +47,20 @@ import { OnboardingAnalyticsEvent as Ne, WIDGET_NAME as Pe } from "../analytics/
47
47
  import { ApplicationClientSecretProvider as Fe, useApplicationClientSecret as Ie } from "../../../../data-access/dist/index3.js";
48
48
  import { useCreateApplication as Le } from "../../../../data-access/dist/index5.js";
49
49
  import { useUpdateApplication as Re } from "../../../../data-access/dist/index6.js";
50
- import { useSubmitApplication as ze } from "../../../../data-access/dist/index7.js";
51
- import { useDeleteApplication as Be } from "../../../../data-access/dist/index8.js";
52
- import { usePollApplicationCompletion as Ve } from "../../../../data-access/dist/index9.js";
53
- import { useResumableBankAccountApplication as He } from "../../../../data-access/dist/index11.js";
54
- import { useStartedBankAccountApplication as Ue } from "../../../../data-access/dist/index12.js";
50
+ import { isKycDeviceDataSessionMismatch as ze, useSubmitApplication as Be } from "../../../../data-access/dist/index7.js";
51
+ import { useDeleteApplication as Ve } from "../../../../data-access/dist/index8.js";
52
+ import { usePollApplicationCompletion as He } from "../../../../data-access/dist/index9.js";
53
+ import { useResumableBankAccountApplication as Ue } from "../../../../data-access/dist/index11.js";
54
+ import { useStartedBankAccountApplication as We } from "../../../../data-access/dist/index12.js";
55
55
  import "../../../../data-access/dist/index.js";
56
- import { DeviceProfilingGate as We, DeviceProfilingProvider as Ge } from "../deviceProfiling/DeviceProfiling.js";
56
+ import { DeviceProfilingGate as Ge, DeviceProfilingProvider as Ke, useDeviceRequestFields as qe } from "../deviceProfiling/DeviceProfiling.js";
57
57
  import "../deviceProfiling/index.js";
58
- import { withoutResumeOnlyOwnerFields as Ke, withoutStoredIdentifierMarkers as qe } from "./hostInitialValues.js";
59
- import { useCallback as v, useEffect as y, useMemo as Je, useReducer as Ye, useRef as b, useState as x } from "react";
60
- import { Fragment as Xe, jsx as S, jsxs as C } from "react/jsx-runtime";
58
+ import { withoutResumeOnlyOwnerFields as Je, withoutStoredIdentifierMarkers as Ye } from "./hostInitialValues.js";
59
+ import { useCallback as v, useEffect as y, useMemo as b, useReducer as Xe, useRef as x, useState as S } from "react";
60
+ import { Fragment as Ze, jsx as C, jsxs as Qe } from "react/jsx-runtime";
61
61
  // ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js
62
- var Ze = 2 ** 31 - 1, Qe = "DRAFT", $e = [], et = "ttw:grid ttw:w-full ttw:place-items-center ttw:overflow-auto ttw:bg-background ttw:p-6", w = (e) => be(e, void 0);
63
- function tt(e) {
62
+ var $e = 2 ** 31 - 1, et = "DRAFT", tt = [], nt = "ttw:grid ttw:w-full ttw:place-items-center ttw:overflow-auto ttw:bg-background ttw:p-6", w = (e) => be(e, void 0);
63
+ function rt(e) {
64
64
  return {
65
65
  ...e,
66
66
  taxId: "",
@@ -68,23 +68,23 @@ function tt(e) {
68
68
  taxIdOnFileStructure: e.companyStructure === "" ? void 0 : e.companyStructure
69
69
  };
70
70
  }
71
- function nt(e) {
71
+ function it(e) {
72
72
  return {
73
73
  ...e,
74
74
  ssn: "",
75
75
  ssnOnFileLast4: ye(e.ssn)
76
76
  };
77
77
  }
78
- function rt(e, t) {
78
+ function at(e, t) {
79
79
  return t ? t.index === null ? [...e, {
80
80
  ...t.owner,
81
81
  reviewed: !1
82
82
  }] : e.map((e, n) => n === t.index ? t.owner : e) : e;
83
83
  }
84
- function it(e) {
84
+ function ot(e) {
85
85
  return e.map(({ reviewed: e, ...t }) => t);
86
86
  }
87
- var at = {
87
+ var st = {
88
88
  companyLegalName: "",
89
89
  companyDbaName: "",
90
90
  businessAddress: "",
@@ -98,7 +98,7 @@ var at = {
98
98
  naicsCode: "",
99
99
  isAuthorized: null,
100
100
  isCheckboxChecked: !1
101
- }, ot = {
101
+ }, ct = {
102
102
  firstName: "",
103
103
  lastName: "",
104
104
  dateOfBirth: void 0,
@@ -117,7 +117,7 @@ var at = {
117
117
  review: 2,
118
118
  terms: 3
119
119
  };
120
- function st(e, t) {
120
+ function lt(e, t) {
121
121
  return e === T.personal ? {
122
122
  title: t.personalReviewTitle,
123
123
  subtitle: t.personalReviewSubtitle
@@ -132,13 +132,13 @@ function st(e, t) {
132
132
  subtitle: t.termsSubtitle
133
133
  };
134
134
  }
135
- function ct({ callback: e }) {
135
+ function ut({ callback: e }) {
136
136
  return y(() => {
137
137
  e?.();
138
138
  }, [e]), null;
139
139
  }
140
- function lt({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboard: fe, onSuppressed: be, labels: _, initialBusinessDetails: Pe, initialPersonalDetails: Fe, initialAdditionalOwners: He, initialApplicationId: Ue = null, initialWrittenSections: Ge, initialBoundAuthEpoch: qe, onEditableDraftChange: Qe, onApplicationDeleted: lt, onNoticeReplacedByForm: ut, focusFormOnMount: E = !1, onFocusFormOnMountDone: dt, bankLogoSrc: ft, disclosureLinks: pt, showApplicationStatusRefresh: mt = !1, onResultPhaseChange: ht }) {
141
- let D = f(), { authEpoch: gt } = i();
140
+ function dt({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboard: fe, onSuppressed: be, labels: _, initialBusinessDetails: Pe, initialPersonalDetails: Fe, initialAdditionalOwners: Ue, initialApplicationId: We = null, initialWrittenSections: Ke, initialBoundAuthEpoch: Ye, onEditableDraftChange: et, onApplicationDeleted: dt, onNoticeReplacedByForm: ft, focusFormOnMount: E = !1, onFocusFormOnMountDone: pt, bankLogoSrc: mt, disclosureLinks: ht, showApplicationStatusRefresh: gt = !1, onResultPhaseChange: _t }) {
141
+ let D = f(), { authEpoch: vt } = i();
142
142
  y(() => {
143
143
  D(Ne.Mounted);
144
144
  }, [D]);
@@ -172,130 +172,130 @@ function lt({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboar
172
172
  ...m.deviceProfiling,
173
173
  ..._?.deviceProfiling
174
174
  }
175
- }, k = ne().initResponse, { termsHref: _t, privacyHref: vt, electronicCommunicationHref: yt, patriotActHref: bt } = pt ?? {}, xt = v(() => {
175
+ }, k = ne().initResponse, { termsHref: yt, privacyHref: bt, electronicCommunicationHref: xt, patriotActHref: St } = ht ?? {}, Ct = v(() => {
176
176
  p();
177
- }, [p]), St = te(), [A, j] = x(T.personal), [M, Ct] = x(() => ({
178
- ...at,
177
+ }, [p]), wt = te(), [A, j] = S(T.personal), [M, Tt] = S(() => ({
178
+ ...st,
179
179
  ...Pe
180
- })), [N, wt] = x(() => ({
181
- ...ot,
180
+ })), [N, Et] = S(() => ({
181
+ ...ct,
182
182
  ...Fe
183
- })), [P, F] = x(() => He ?? []), [I, Tt] = x(() => ({
183
+ })), [P, F] = S(() => Ue ?? []), [I, Dt] = S(() => ({
184
184
  business: M,
185
185
  personal: N,
186
186
  owners: P
187
- })), [Et, Dt] = x(null);
187
+ })), [Ot, kt] = S(null);
188
188
  y(() => {
189
- if (!Et) return;
189
+ if (!Ot) return;
190
190
  let e = {
191
191
  business: M,
192
192
  personal: N,
193
193
  owners: P
194
194
  };
195
- Tt((t) => Et.next(e, t)), Dt(null);
195
+ Dt((t) => Ot.next(e, t)), kt(null);
196
196
  }, [
197
- Et,
197
+ Ot,
198
198
  M,
199
199
  N,
200
200
  P
201
201
  ]);
202
- let Ot = (e, { ownersCleared: t = !1 } = {}) => Dt({ next: (n, r) => ({
202
+ let At = (e, { ownersCleared: t = !1 } = {}) => kt({ next: (n, r) => ({
203
203
  business: e.includes("business") ? n.business : r.business,
204
204
  personal: e.includes("personal") ? n.personal : r.personal,
205
- owners: t ? $e : e.includes("owners") ? n.owners : r.owners
206
- }) }), [L, kt] = x(null), [At, jt] = x(0), [Mt, Nt] = x(null), [Pt, Ft] = x(!1), [R, It] = x(null), [z, Lt] = x(null), [Rt, zt] = x(null), [B, Bt] = x(Ue), [Vt, Ht] = x(() => Ge ?? {
205
+ owners: t ? tt : e.includes("owners") ? n.owners : r.owners
206
+ }) }), [L, jt] = S(null), [Mt, Nt] = S(0), [Pt, Ft] = S(null), [It, Lt] = S(!1), [R, Rt] = S(null), [z, zt] = S(null), [Bt, Vt] = S(null), [B, Ht] = S(We), [Ut, Wt] = S(() => Ke ?? {
207
207
  business: !1,
208
208
  owners: !1
209
- }), [Ut, Wt] = x({}), Gt = (e) => Wt((t) => ({
209
+ }), [Gt, Kt] = S({}), qt = (e) => Kt((t) => ({
210
210
  ...t,
211
211
  ...e.taxId && w(e.taxId) && e.taxIdStructure ? {
212
212
  taxId: e.taxId,
213
213
  taxIdStructure: e.taxIdStructure
214
214
  } : {},
215
215
  ...e.ssn && w(e.ssn) ? { ssn: e.ssn } : {}
216
- })), Kt = (e) => {
217
- let { taxId: t, taxIdStructure: n } = Ut, r = t !== void 0 && n !== void 0 && e.companyStructure !== M.companyStructure && e.companyStructure !== "" && e.companyStructure === "SOLE_PROPRIETORSHIP" != (n === "SOLE_PROPRIETORSHIP");
218
- Ct(r ? {
216
+ })), Jt = (e) => {
217
+ let { taxId: t, taxIdStructure: n } = Gt, r = t !== void 0 && n !== void 0 && e.companyStructure !== M.companyStructure && e.companyStructure !== "" && e.companyStructure === "SOLE_PROPRIETORSHIP" != (n === "SOLE_PROPRIETORSHIP");
218
+ Tt(r ? {
219
219
  ...e,
220
220
  taxId: e.taxId === t ? "" : e.taxId,
221
221
  taxIdOnFileLast4: ye(t),
222
222
  taxIdOnFileStructure: n
223
223
  } : e);
224
- }, [qt, Jt] = x(qe ?? gt), [Yt, V] = x(null), [Xt, Zt] = x(null), [Qt, $t] = x(0), en = b(null);
224
+ }, [Yt, Xt] = S(Ye ?? vt), [Zt, V] = S(null), [Qt, $t] = S(null), [en, tn] = S(0), nn = x(null);
225
225
  y(() => {
226
- if (Qt === 0) return;
227
- let e = en.current, t = (t) => {
226
+ if (en === 0) return;
227
+ let e = nn.current, t = (t) => {
228
228
  let n = Array.from(e?.querySelectorAll(t) ?? []);
229
229
  return n.find((e) => e.getClientRects().length > 0) ?? (t === "[aria-invalid=\"true\"]" ? n[0] : n.at(-1));
230
230
  };
231
231
  (t("[aria-invalid=\"true\"]") ?? t("[data-needs-attention]"))?.focus();
232
- }, [Qt]);
233
- let [tn, nn] = x(!1), [rn, an] = x(!1), [on, sn] = x(!1), [cn, ln] = x(null), un = Le(), H = Re(), dn = ze(), fn = Be(), pn = Ve(), { setClientSecret: mn } = Ie(), { data: hn, refetch: gn } = s(), { mutateAsync: _n } = o(), vn = l(), U = u(), yn = re(), [bn, xn] = Ye((e) => e + 1, 0), Sn = Je(() => se(U.applications), [U.applications]), Cn = b(null);
234
- U.isResolved && (Cn.current = { application: Sn });
235
- let W = U.isResolved ? Sn : Cn.current?.application ?? null, wn = oe(W), G = ve(W), Tn = U.isResolved || Cn.current !== null && G === pe.Form;
232
+ }, [en]);
233
+ let [rn, an] = S(!1), [on, sn] = S(!1), [cn, ln] = S(!1), [un, dn] = S(null), fn = Le(), H = Re(), pn = Be(), mn = qe(), hn = Ve(), gn = He(), { setClientSecret: _n } = Ie(), { data: vn, refetch: yn } = s(), { mutateAsync: bn } = o(), xn = l(), U = u(), Sn = re(), [Cn, wn] = Xe((e) => e + 1, 0), Tn = b(() => se(U.applications), [U.applications]), En = x(null);
234
+ U.isResolved && (En.current = { application: Tn });
235
+ let W = U.isResolved ? Tn : En.current?.application ?? null, Dn = oe(W), G = ve(W), On = U.isResolved || En.current !== null && G === pe.Form;
236
236
  y(() => {
237
- if (wn === null) return;
238
- let e = wn - Date.now();
237
+ if (Dn === null) return;
238
+ let e = Dn - Date.now();
239
239
  if (e < 0) return;
240
- let t = setTimeout(xn, Math.min(e + 1, Ze));
240
+ let t = setTimeout(wn, Math.min(e + 1, $e));
241
241
  return () => clearTimeout(t);
242
- }, [wn, bn]);
243
- let En = b(null);
244
- y(() => () => En.current?.abort(), []);
245
- let Dn = Je(() => ae(O.businessDetails.naicsTitles), [O.businessDetails.naicsTitles]), On = Je(() => r(O.businessDetails.stateTitles), [O.businessDetails.stateTitles]), kn = Je(() => r(O.personalDetails.stateTitles), [O.personalDetails.stateTitles]), An = Je(() => r(O.additionalOwners.stateTitles), [O.additionalOwners.stateTitles]), K = on || cn !== null, jn = b(ht);
246
- jn.current = ht, y(() => {
247
- if (K) return jn.current?.(!0), () => jn.current?.(!1);
242
+ }, [Dn, Cn]);
243
+ let kn = x(null);
244
+ y(() => () => kn.current?.abort(), []);
245
+ let An = b(() => ae(O.businessDetails.naicsTitles), [O.businessDetails.naicsTitles]), jn = b(() => r(O.businessDetails.stateTitles), [O.businessDetails.stateTitles]), Mn = b(() => r(O.personalDetails.stateTitles), [O.personalDetails.stateTitles]), Nn = b(() => r(O.additionalOwners.stateTitles), [O.additionalOwners.stateTitles]), K = cn || un !== null, Pn = x(_t);
246
+ Pn.current = _t, y(() => {
247
+ if (K) return Pn.current?.(!0), () => Pn.current?.(!1);
248
248
  }, [K]);
249
- let Mn = k?.status === "ACTIVE" || k?.status === "INACTIVE", Nn = k?.status === "INVITED", Pn = Mn || Nn, q = vn.isResolved && Tn, Fn = k && !K && !Pn && q && ge(G) ? G : null, In = !!k && !K && Fn === null && (Pn || q && (vn.isSuppressed || G === pe.Hidden)), J = In ? Mn ? c.UserAlreadyOnboarded : Nn ? c.UserInvitedToOrganization : G === pe.Hidden ? he(W) : vn.reason ?? he(W) : null, Ln = !!k && q && !K, [Rn, zn] = x(!1), Bn = Rn && In && !Pn && J !== c.OrganizationApplicationDenialExpired, Y = Fn ?? (Bn ? "unavailable" : null);
250
- Ln && Rn !== (Y !== null) && zn(Y !== null);
251
- let Vn = Bn && J === c.OrganizationApplicationComplete, Hn = ie(), [Un, Wn] = x("idle"), [Gn, Kn] = x(!1);
252
- Ln && Vn !== Gn && (Kn(Vn), Vn && Wn("requested")), Un === "requested" && Hn && Wn("inFlight"), Un === "inFlight" && !Hn && Wn("idle");
253
- let qn = Vn && Un !== "idle", Jn = b(be);
254
- Jn.current = be;
255
- let Yn = In && Y === null;
249
+ let Fn = k?.status === "ACTIVE" || k?.status === "INACTIVE", In = k?.status === "INVITED", Ln = Fn || In, q = xn.isResolved && On, Rn = k && !K && !Ln && q && ge(G) ? G : null, zn = !!k && !K && Rn === null && (Ln || q && (xn.isSuppressed || G === pe.Hidden)), J = zn ? Fn ? c.UserAlreadyOnboarded : In ? c.UserInvitedToOrganization : G === pe.Hidden ? he(W) : xn.reason ?? he(W) : null, Bn = !!k && q && !K, [Vn, Hn] = S(!1), Un = Vn && zn && !Ln && J !== c.OrganizationApplicationDenialExpired, Y = Rn ?? (Un ? "unavailable" : null);
250
+ Bn && Vn !== (Y !== null) && Hn(Y !== null);
251
+ let Wn = Un && J === c.OrganizationApplicationComplete, Gn = ie(), [Kn, qn] = S("idle"), [Jn, Yn] = S(!1);
252
+ Bn && Wn !== Jn && (Yn(Wn), Wn && qn("requested")), Kn === "requested" && Gn && qn("inFlight"), Kn === "inFlight" && !Gn && qn("idle");
253
+ let Xn = Wn && Kn !== "idle", Zn = x(be);
254
+ Zn.current = be;
255
+ let Qn = zn && Y === null;
256
256
  y(() => {
257
- Yn && J && (D(Ne.Suppressed, { reason: J }), console.info(`[onboarding] not shown: ${J}`), Jn.current?.(J));
257
+ Qn && J && (D(Ne.Suppressed, { reason: J }), console.info(`[onboarding] not shown: ${J}`), Zn.current?.(J));
258
258
  }, [
259
- Yn,
259
+ Qn,
260
260
  J,
261
261
  D
262
262
  ]);
263
- let Xn = yn ? null : Fn;
263
+ let $n = Sn ? null : Rn;
264
264
  y(() => {
265
- Xn && D(Ne.ApplicationStatusShown, { view: Xn });
266
- }, [Xn, D]);
267
- let Zn = b(Y), Qn = b(ut);
268
- Qn.current = ut;
269
- let $n = b(St);
270
- $n.current = St, y(() => {
265
+ $n && D(Ne.ApplicationStatusShown, { view: $n });
266
+ }, [$n, D]);
267
+ let er = x(Y), tr = x(ft);
268
+ tr.current = ft;
269
+ let nr = x(wt);
270
+ nr.current = wt, y(() => {
271
271
  if (!q || K) return;
272
- let e = Zn.current !== null;
273
- Zn.current = Y, e && Y === null && G === pe.Form && Qn.current?.();
272
+ let e = er.current !== null;
273
+ er.current = Y, e && Y === null && G === pe.Form && tr.current?.();
274
274
  }, [
275
275
  G,
276
276
  K,
277
277
  q,
278
278
  Y
279
279
  ]), y(() => {
280
- Un === "requested" && $n.current();
281
- }, [Un]), y(() => {
282
- Qe?.(K || B === null ? null : {
280
+ Kn === "requested" && nr.current();
281
+ }, [Kn]), y(() => {
282
+ et?.(K || B === null ? null : {
283
283
  applicationId: B,
284
- authEpoch: qt
284
+ authEpoch: Yt
285
285
  });
286
286
  }, [
287
- Qe,
287
+ et,
288
288
  K,
289
289
  B,
290
- qt
290
+ Yt
291
291
  ]);
292
- let er = b(gt);
293
- if (er.current = gt, !k) return null;
292
+ let rr = x(vt);
293
+ if (rr.current = vt, !k) return null;
294
294
  if (!K) {
295
- if (In && !Y || qn || !q) return null;
295
+ if (zn && !Y || Xn || !q) return null;
296
296
  if (Y) {
297
- if (yn) return null;
298
- let e = me(Y, W, k.bankName?.trim() || O.fallbackBankName, O.applicationStatus), n = /* @__PURE__ */ S(le, {
297
+ if (Sn) return null;
298
+ let e = me(Y, W, k.bankName?.trim() || O.fallbackBankName, O.applicationStatus), n = /* @__PURE__ */ C(le, {
299
299
  ...e,
300
300
  className: "ttw:max-w-2xl",
301
301
  focusTitleOnMount: E,
@@ -303,83 +303,87 @@ function lt({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboar
303
303
  root: h.statusCard,
304
304
  chip: h.statusCardChip
305
305
  },
306
- action: mt ? /* @__PURE__ */ S(t, {
306
+ action: gt ? /* @__PURE__ */ C(t, {
307
307
  variant: "outline",
308
- onClick: Vn ? () => Wn("requested") : vn.refetch,
308
+ onClick: Wn ? () => qn("requested") : xn.refetch,
309
309
  "data-testid": h.statusCardCheckAgain,
310
310
  children: O.applicationStatus.checkAgain
311
311
  }) : void 0
312
312
  });
313
- return /* @__PURE__ */ C("div", {
314
- className: et,
315
- children: [n, E ? /* @__PURE__ */ S(ct, { callback: dt }) : null]
313
+ return /* @__PURE__ */ Qe("div", {
314
+ className: nt,
315
+ children: [n, E ? /* @__PURE__ */ C(ut, { callback: pt }) : null]
316
316
  });
317
317
  }
318
318
  }
319
- let X = M.companyStructure === "SOLE_PROPRIETORSHIP", tr = M.companyStructure !== "" && !X, nr = tr ? Rt : $e, Z = z && {
319
+ let X = M.companyStructure === "SOLE_PROPRIETORSHIP", ir = M.companyStructure !== "" && !X, ar = ir ? Bt : tt, Z = z && {
320
320
  ...z,
321
321
  ownsOver25Percent: N.ownsOver25Percent,
322
322
  ownershipPercentage: N.ownershipPercentage
323
- }, rr = [
323
+ }, or = [
324
324
  O.stepIndicator.personal,
325
325
  O.stepIndicator.business,
326
326
  O.stepIndicator.review,
327
327
  O.stepIndicator.terms
328
- ], ir = z !== null && R !== null && nr !== null, ar = A === T.personal ? z !== null : A === T.business ? R !== null && nr !== null : A === T.review ? ir : ir && xe(M), Q = un.isPending || H.isPending || dn.isPending || fn.isPending || on, or = () => {
329
- Ct((e) => e.isAuthorized === null && !e.isCheckboxChecked ? e : {
328
+ ], sr = z !== null && R !== null && ar !== null, cr = A === T.personal ? z !== null : A === T.business ? R !== null && ar !== null : A === T.review ? sr : sr && xe(M), Q = fn.isPending || H.isPending || pn.isPending || hn.isPending || cn, lr = () => {
329
+ Tt((e) => e.isAuthorized === null && !e.isCheckboxChecked ? e : {
330
330
  ...e,
331
331
  isAuthorized: null,
332
332
  isCheckboxChecked: !1
333
333
  });
334
- }, sr = () => {
335
- V(null), or(), j(T.personal);
336
- }, cr = () => {
337
- V(null), or(), j(T.business);
338
- }, lr = () => {
339
- V(null), A === T.review && or(), L && F(rt(P, L)), j((e) => e === T.personal ? e : e - 1);
340
- }, ur = (e) => {
341
- e < T.personal || e >= A || (V(null), e <= T.business && or(), L && F(rt(P, L)), j(e));
334
+ }, ur = () => {
335
+ V(null), lr(), j(T.personal);
336
+ }, dr = () => {
337
+ V(null), lr(), j(T.business);
338
+ }, fr = () => {
339
+ V(null), A === T.review && lr(), L && F(at(P, L)), j((e) => e === T.personal ? e : e - 1);
340
+ }, pr = (e) => {
341
+ e < T.personal || e >= A || (V(null), e <= T.business && lr(), L && F(at(P, L)), j(e));
342
342
  }, $ = {
343
343
  business: g(M) !== g(I.business),
344
344
  personal: g(N) !== g(I.personal),
345
- owners: g(it(M.companyStructure === "SOLE_PROPRIETORSHIP" ? $e : rt(P, L))) !== g(it(I.owners))
346
- }, dr = $.business || $.personal || $.owners, fr = async (e) => {
347
- sn(!0);
345
+ owners: g(ot(M.companyStructure === "SOLE_PROPRIETORSHIP" ? tt : at(P, L))) !== g(ot(I.owners))
346
+ }, mr = $.business || $.personal || $.owners, hr = async (e) => {
347
+ ln(!0);
348
348
  let t = new AbortController();
349
- En.current = t;
350
- let n = !1;
349
+ kn.current = t;
350
+ let n = !1, r = null;
351
351
  try {
352
- let r = await dn.mutateAsync({ path: { id: e } });
352
+ if (r = await mn.next(), t.signal.aborted) return;
353
+ let i = await pn.mutateAsync({
354
+ path: { id: e },
355
+ ...r ? { body: { kycDeviceData: r } } : {}
356
+ });
353
357
  if (t.signal.aborted) return;
354
- if (!r.id) throw Error(O.submitFailedError);
355
- if (n = !0, (await pn(e, { signal: t.signal })).status === "complete") {
356
- let e = hn;
357
- if (e === void 0 && (e = (await gn()).data), t.signal.aborted) return;
358
+ if (!i.id) throw Error(O.submitFailedError);
359
+ if (n = !0, (await gn(e, { signal: t.signal })).status === "complete") {
360
+ let e = vn;
361
+ if (e === void 0 && (e = (await yn()).data), t.signal.aborted) return;
358
362
  if (e !== void 0) try {
359
- await _n({ displayedVersion: a(e)?.disclosureId ?? null });
363
+ await bn({ displayedVersion: a(e)?.disclosureId ?? null });
360
364
  } catch {}
361
365
  if (t.signal.aborted) return;
362
- ln("success"), St(), xt();
363
- } else ln("pending");
366
+ dn("success"), wt(), Ct();
367
+ } else dn("pending");
364
368
  } catch (e) {
365
369
  if (e instanceof DOMException && e.name === "AbortError") return;
366
- if (!n) throw e;
367
- ln("pending");
370
+ if (!n) throw r && ze(e) && mn.refused(r), e;
371
+ dn("pending");
368
372
  } finally {
369
- En.current = null, sn(!1);
373
+ kn.current = null, ln(!1);
370
374
  }
371
- }, pr = ({ evenWithoutMarker: e = !1 } = {}) => {
372
- Ct((t) => (t.taxIdOnFileLast4 || e) && w(t.taxId) ? tt(t) : t);
373
- }, mr = ({ evenWithoutMarker: e = !1 } = {}) => {
374
- wt((t) => (t.ssnOnFileLast4 || e) && w(t.ssn) ? nt(t) : t);
375
- }, hr = ({ evenWithoutMarker: e = !1 } = {}) => {
376
- F((t) => t.map((t) => (t.ssnOnFileLast4 || e && t.id) && w(t.ssn) ? nt(t) : t));
377
- }, gr = () => {
378
- F((e) => e.map(Ke));
379
- }, _r = async (e) => {
380
- let t = er.current, n = await un.mutateAsync({ body: Me(e, N) });
381
- return Bt(n.id), Jt(t), n.clientSecret && mn(n.id, n.clientSecret), n.id;
382
- }, vr = async () => {
375
+ }, gr = ({ evenWithoutMarker: e = !1 } = {}) => {
376
+ Tt((t) => (t.taxIdOnFileLast4 || e) && w(t.taxId) ? rt(t) : t);
377
+ }, _r = ({ evenWithoutMarker: e = !1 } = {}) => {
378
+ Et((t) => (t.ssnOnFileLast4 || e) && w(t.ssn) ? it(t) : t);
379
+ }, vr = ({ evenWithoutMarker: e = !1 } = {}) => {
380
+ F((t) => t.map((t) => (t.ssnOnFileLast4 || e && t.id) && w(t.ssn) ? it(t) : t));
381
+ }, yr = () => {
382
+ F((e) => e.map(Je));
383
+ }, br = async (e) => {
384
+ let t = rr.current, n = await fn.mutateAsync({ body: Me(e, N) });
385
+ return Ht(n.id), Xt(t), n.clientSecret && _n(n.id, n.clientSecret), n.id;
386
+ }, xr = async () => {
383
387
  if (A === T.personal) {
384
388
  if (!Z) return null;
385
389
  let e = I.business.companyStructure === "SOLE_PROPRIETORSHIP", t = B;
@@ -389,76 +393,76 @@ function lt({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboar
389
393
  applicant: Z,
390
394
  isSoleProprietor: e
391
395
  })
392
- }) : t = await _r(De({
396
+ }) : t = await br(De({
393
397
  applicant: Z,
394
398
  isSoleProprietor: e
395
- })), Gt({ ssn: Z.ssn }), mr(), Ot(["personal"]), t;
399
+ })), qt({ ssn: Z.ssn }), _r(), At(["personal"]), t;
396
400
  }
397
401
  if (A === T.business) {
398
- if (!Z || !R || !nr) return null;
402
+ if (!Z || !R || !ar) return null;
399
403
  let e = {
400
404
  businessDetails: R,
401
405
  applicant: Z,
402
- businessOwners: nr
406
+ businessOwners: ar
403
407
  }, t = B;
404
408
  return t ? await H.mutateAsync({
405
409
  path: { id: t },
406
410
  body: Oe(e)
407
- }) : t = await _r(Oe(e)), Gt({
411
+ }) : t = await br(Oe(e)), qt({
408
412
  taxId: R.taxId,
409
413
  taxIdStructure: R.companyStructure,
410
414
  ssn: Z.ssn
411
- }), pr(), mr(), X ? gr() : hr(), Ot([
415
+ }), gr(), _r(), X ? yr() : vr(), At([
412
416
  "business",
413
417
  "personal",
414
418
  "owners"
415
- ], { ownersCleared: X }), Ht({
419
+ ], { ownersCleared: X }), Wt({
416
420
  business: !0,
417
421
  owners: !0
418
422
  }), t;
419
423
  }
420
- return A === T.review ? ir ? B : null : !B || !xe(M) ? null : (await H.mutateAsync({
424
+ return A === T.review ? sr ? B : null : !B || !xe(M) ? null : (await H.mutateAsync({
421
425
  path: { id: B },
422
426
  body: Oe({ consent: {
423
427
  isLegallyAuthorized: !0,
424
428
  hasAcceptedDisclosures: !0
425
429
  } })
426
- }), Ot(["business"]), B);
427
- }, yr = async () => {
428
- if (V(null), !ar) {
429
- Zt(A), $t((e) => e + 1);
430
+ }), At(["business"]), B);
431
+ }, Sr = async () => {
432
+ if (V(null), !cr) {
433
+ $t(A), tn((e) => e + 1);
430
434
  return;
431
435
  }
432
436
  let e;
433
437
  try {
434
- e = await vr();
438
+ e = await xr();
435
439
  } catch {
436
440
  V(O.genericRetryError);
437
441
  return;
438
442
  }
439
443
  if (e !== null) {
440
- if (Zt(null), A === T.terms) try {
441
- await fr(e);
444
+ if ($t(null), A === T.terms) try {
445
+ await hr(e);
442
446
  } catch {
443
447
  V(O.submitFailedError);
444
448
  }
445
449
  else j(A + 1);
446
450
  }
447
- }, br = async () => {
448
- V(null), nn(!0);
451
+ }, Cr = async () => {
452
+ V(null), an(!0);
449
453
  try {
450
- if (await vr() === null) return;
451
- mr({ evenWithoutMarker: !0 }), A >= T.business && (pr({ evenWithoutMarker: !0 }), hr({ evenWithoutMarker: !0 })), e.success(O.applicationSavedToast);
454
+ if (await xr() === null) return;
455
+ _r({ evenWithoutMarker: !0 }), A >= T.business && (gr({ evenWithoutMarker: !0 }), vr({ evenWithoutMarker: !0 })), e.success(O.applicationSavedToast);
452
456
  } catch {
453
457
  e.error(O.genericRetryError);
454
458
  } finally {
455
- nn(!1);
459
+ an(!1);
456
460
  }
457
- }, xr = async () => {
458
- let t = rt(P, L), n = {
461
+ }, wr = async () => {
462
+ let t = at(P, L), n = {
459
463
  ...$,
460
- business: $.business || B !== null && !Vt.business,
461
- owners: $.owners || B !== null && !Vt.owners
464
+ business: $.business || B !== null && !Ut.business,
465
+ owners: $.owners || B !== null && !Ut.owners
462
466
  }, r = je({
463
467
  businessDetails: M,
464
468
  applicant: N,
@@ -467,10 +471,10 @@ function lt({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboar
467
471
  savedOwners: I.owners,
468
472
  dirty: n
469
473
  });
470
- Ft(!0);
474
+ Lt(!0);
471
475
  try {
472
476
  if (!r) {
473
- if (!dr) {
477
+ if (!mr) {
474
478
  e.success(O.applicationSavedToast);
475
479
  return;
476
480
  }
@@ -480,42 +484,42 @@ function lt({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboar
480
484
  B ? await H.mutateAsync({
481
485
  path: { id: B },
482
486
  body: r
483
- }) : await _r(Ae(r)), L && F(t), e.success(O.applicationSavedToast);
487
+ }) : await br(Ae(r)), L && F(t), e.success(O.applicationSavedToast);
484
488
  let i = r;
485
- Gt({
489
+ qt({
486
490
  taxId: i.businessDetails?.taxId?.value,
487
491
  taxIdStructure: M.companyStructure,
488
492
  ssn: i.applicant?.personalIdentificationNumber?.value
489
- }), i.businessDetails?.taxId !== void 0 && pr({ evenWithoutMarker: !0 }), i.applicant?.personalIdentificationNumber !== void 0 && mr({ evenWithoutMarker: !0 }), Array.isArray(i.businessOwners) && hr({ evenWithoutMarker: !0 }), i.businessOwners === null && t.length > 0 && gr(), Ht((e) => ({
493
+ }), i.businessDetails?.taxId !== void 0 && gr({ evenWithoutMarker: !0 }), i.applicant?.personalIdentificationNumber !== void 0 && _r({ evenWithoutMarker: !0 }), Array.isArray(i.businessOwners) && vr({ evenWithoutMarker: !0 }), i.businessOwners === null && t.length > 0 && yr(), Wt((e) => ({
490
494
  business: e.business || i.businessDetails !== void 0,
491
495
  owners: e.owners || i.businessOwners !== void 0
492
496
  }));
493
497
  let a = Array.isArray(i.businessOwners) ? "list" : i.businessOwners === null ? "cleared" : "none";
494
- Dt({ next: (e, t) => ke({
498
+ kt({ next: (e, t) => ke({
495
499
  current: e,
496
500
  saved: t,
497
501
  dirty: n,
498
502
  ownersWrite: a
499
- }) }), kt(null), jt((e) => e + 1);
503
+ }) }), jt(null), Nt((e) => e + 1);
500
504
  } catch {
501
505
  e.error(O.genericRetryError);
502
506
  } finally {
503
- Ft(!1);
507
+ Lt(!1);
504
508
  }
505
- }, Sr = async () => {
509
+ }, Tr = async () => {
506
510
  if (B !== null) try {
507
- await fn.mutateAsync({ path: { id: B } });
511
+ await hn.mutateAsync({ path: { id: B } });
508
512
  } catch {
509
513
  e.error(O.deleteFailedError);
510
514
  return;
511
515
  }
512
- an(!1), lt?.();
513
- }, Cr = st(A, O), wr = k.bankName?.trim() || O.fallbackBankName, Tr = ce(O.shellFdicDisclaimer, wr);
516
+ sn(!1), dt?.();
517
+ }, Er = lt(A, O), Dr = k.bankName?.trim() || O.fallbackBankName, Or = ce(O.shellFdicDisclaimer, Dr);
514
518
  if (K) {
515
- let e = R?.companyLegalName ?? "", t = k.bankName?.trim() || O.fallbackBankName, n = cn ?? "pending", r = n === "success", i = {
519
+ let e = R?.companyLegalName ?? "", t = k.bankName?.trim() || O.fallbackBankName, n = un ?? "pending", r = n === "success", i = {
516
520
  ...m.result,
517
521
  ...O.result
518
- }, a = /* @__PURE__ */ S(ue, {
522
+ }, a = /* @__PURE__ */ C(ue, {
519
523
  testIds: {
520
524
  processing: h.resultProcessing,
521
525
  success: h.resultSuccess,
@@ -523,7 +527,7 @@ function lt({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboar
523
527
  dashboardButton: h.resultDashboardButton
524
528
  },
525
529
  status: n,
526
- isLoading: on,
530
+ isLoading: cn,
527
531
  loadingMessage: i.loadingMessage,
528
532
  headingLine1: r ? i.successHeadingLine1 : i.pendingHeadingLine1,
529
533
  headingLine2: `${e}!`,
@@ -531,48 +535,48 @@ function lt({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboar
531
535
  followUpEmail: z?.workEmail ?? "",
532
536
  emailBoxLead: i.pendingEmailBoxLead,
533
537
  navigateToDashboardLabel: i.navigateToDashboard,
534
- bankLogoSrc: ft,
538
+ bankLogoSrc: mt,
535
539
  bankLogoAlt: ce(i.bankLogoAlt, t),
536
540
  fdicDisclaimer: ce(i.fdicDisclaimer, t),
537
541
  onNavigateToDashboard: fe
538
542
  });
539
- return /* @__PURE__ */ S("div", {
543
+ return /* @__PURE__ */ C("div", {
540
544
  className: "ttw:grid ttw:w-full ttw:place-items-center ttw:gap-0 ttw:overflow-auto ttw:bg-background",
541
545
  children: a
542
546
  });
543
547
  }
544
- let Er = A === T.personal ? O.nextToStep.business : A === T.business ? O.nextToStep.review : A === T.review ? O.nextToStep.terms : O.submit, Dr = A === T.business ? O.backToStepAriaLabel.personal : A === T.review ? O.backToStepAriaLabel.business : A === T.terms ? O.backToStepAriaLabel.review : void 0, Or = Q, kr = Xt === A, Ar = ar ? br : xr, jr = Q || Pt || !ar && !dr && B === null, Mr = `${N.firstName} ${N.lastName}`.trim(), Nr = X ? 100 : N.ownsOver25Percent === !0 ? N.ownershipPercentage ?? 0 : 0, Pr = M.companyDbaName.trim() || M.companyLegalName.trim(), Fr = X ? $e : P, Ir = Xt === T.business && A === T.business && Fr.some((e) => !e.reviewed) ? O.ownersNeedReviewError : null;
545
- return /* @__PURE__ */ C(We, {
548
+ let kr = A === T.personal ? O.nextToStep.business : A === T.business ? O.nextToStep.review : A === T.review ? O.nextToStep.terms : O.submit, Ar = A === T.business ? O.backToStepAriaLabel.personal : A === T.review ? O.backToStepAriaLabel.business : A === T.terms ? O.backToStepAriaLabel.review : void 0, jr = Q, Mr = Qt === A, Nr = cr ? Cr : wr, Pr = Q || It || !cr && !mr && B === null, Fr = `${N.firstName} ${N.lastName}`.trim(), Ir = X ? 100 : N.ownsOver25Percent === !0 ? N.ownershipPercentage ?? 0 : 0, Lr = M.companyDbaName.trim() || M.companyLegalName.trim(), Rr = X ? tt : P, zr = Qt === T.business && A === T.business && Rr.some((e) => !e.reviewed) ? O.ownersNeedReviewError : null;
549
+ return /* @__PURE__ */ Qe(Ge, {
546
550
  labels: O.deviceProfiling,
547
- className: et,
551
+ className: nt,
548
552
  testIds: {
549
553
  loading: h.deviceProfilingLoading,
550
554
  blocked: h.deviceProfilingBlocked
551
555
  },
552
556
  children: [
553
- /* @__PURE__ */ S(ee, {
554
- title: Cr.title,
555
- subtitle: Cr.subtitle,
557
+ /* @__PURE__ */ C(ee, {
558
+ title: Er.title,
559
+ subtitle: Er.subtitle,
556
560
  focusTitleOnMount: E,
557
- stepLabels: rr,
561
+ stepLabels: or,
558
562
  activeStep: A,
559
- onStepClick: ur,
560
- disclaimerText: Tr,
561
- onBack: lr,
563
+ onStepClick: pr,
564
+ disclaimerText: Or,
565
+ onBack: fr,
562
566
  showBackButton: A !== T.personal,
563
- backAriaLabel: Dr,
564
- onNext: yr,
565
- onSaveAndClose: Ar,
566
- onDelete: () => an(!0),
567
- isNextDisabled: Or,
568
- isNextLoading: Q && !tn,
569
- isSaveAndCloseDisabled: jr,
570
- isSaveAndCloseLoading: tn || Pt,
571
- nextLabel: Er,
567
+ backAriaLabel: Ar,
568
+ onNext: Sr,
569
+ onSaveAndClose: Nr,
570
+ onDelete: () => sn(!0),
571
+ isNextDisabled: jr,
572
+ isNextLoading: Q && !rn,
573
+ isSaveAndCloseDisabled: Pr,
574
+ isSaveAndCloseLoading: rn || It,
575
+ nextLabel: kr,
572
576
  nextIcon: null,
573
577
  nextTone: A === T.terms ? "success" : "primary",
574
578
  isTitleVisuallyHidden: A === T.terms,
575
- errorMessage: Yt,
579
+ errorMessage: Zt,
576
580
  labels: {
577
581
  backButton: O.back,
578
582
  saveAndCloseButton: O.saveAndClose,
@@ -590,94 +594,94 @@ function lt({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboar
590
594
  fade: h.shellScrollFade
591
595
  }
592
596
  },
593
- children: /* @__PURE__ */ C("div", {
594
- ref: en,
597
+ children: /* @__PURE__ */ Qe("div", {
598
+ ref: nn,
595
599
  className: "ttw:contents",
596
600
  children: [
597
- A === T.personal ? /* @__PURE__ */ S("div", { children: /* @__PURE__ */ S(Ce, {
601
+ A === T.personal ? /* @__PURE__ */ C("div", { children: /* @__PURE__ */ C(Ce, {
598
602
  value: N,
599
- onValueChange: wt,
600
- onSnapshotChange: Lt,
601
- stateOptions: kn,
603
+ onValueChange: Et,
604
+ onSnapshotChange: zt,
605
+ stateOptions: Mn,
602
606
  isSubmitting: Q,
603
- showAllErrors: kr,
607
+ showAllErrors: Mr,
604
608
  labels: O.personalDetails
605
609
  }, "personal") }) : null,
606
- A === T.business ? /* @__PURE__ */ C("div", {
610
+ A === T.business ? /* @__PURE__ */ Qe("div", {
607
611
  className: "ttw:flex ttw:flex-col ttw:gap-10",
608
- children: [/* @__PURE__ */ S(Se, {
612
+ children: [/* @__PURE__ */ C(Se, {
609
613
  value: M,
610
- onValueChange: Kt,
611
- onSnapshotChange: It,
612
- naicsOptions: Dn,
613
- stateOptions: On,
614
+ onValueChange: Jt,
615
+ onSnapshotChange: Rt,
616
+ naicsOptions: An,
617
+ stateOptions: jn,
614
618
  isSubmitting: Q,
615
- showAllErrors: kr,
619
+ showAllErrors: Mr,
616
620
  labels: O.businessDetails
617
- }, "business"), tr ? /* @__PURE__ */ C(Xe, { children: [/* @__PURE__ */ S(n, {}), /* @__PURE__ */ S(Ee, {
618
- owners: Fr,
621
+ }, "business"), ir ? /* @__PURE__ */ Qe(Ze, { children: [/* @__PURE__ */ C(n, {}), /* @__PURE__ */ C(Ee, {
622
+ owners: Rr,
619
623
  onOwnersChange: F,
620
- primaryOwnerName: Mr,
624
+ primaryOwnerName: Fr,
621
625
  applicantOwnership: {
622
626
  ownsOver25Percent: N.ownsOver25Percent,
623
627
  ownershipPercentage: N.ownershipPercentage
624
628
  },
625
- onApplicantOwnershipChange: (e) => wt((t) => ({
629
+ onApplicantOwnershipChange: (e) => Et((t) => ({
626
630
  ...t,
627
631
  ...e
628
632
  })),
629
- applicantOwnershipBaseline: Mt,
630
- onApplicantOwnershipBaselineChange: Nt,
631
- businessName: Pr,
633
+ applicantOwnershipBaseline: Pt,
634
+ onApplicantOwnershipBaselineChange: Ft,
635
+ businessName: Lr,
632
636
  applicantPersonalDetails: N,
633
- onEditPersonalDetails: sr,
634
- stateOptions: An,
635
- onSnapshotChange: zt,
636
- onPendingOwnerChange: kt,
637
+ onEditPersonalDetails: ur,
638
+ stateOptions: Nn,
639
+ onSnapshotChange: Vt,
640
+ onPendingOwnerChange: jt,
637
641
  isSubmitting: Q,
638
- showAllErrors: kr,
639
- revealErrorsAttempt: Qt,
640
- reviewError: Ir,
642
+ showAllErrors: Mr,
643
+ revealErrorsAttempt: en,
644
+ reviewError: zr,
641
645
  labels: O.additionalOwners
642
- }, At)] }) : null]
646
+ }, Mt)] }) : null]
643
647
  }) : null,
644
- A === T.review ? /* @__PURE__ */ S("div", { children: /* @__PURE__ */ S(we, {
648
+ A === T.review ? /* @__PURE__ */ C("div", { children: /* @__PURE__ */ C(we, {
645
649
  personalDetails: N,
646
650
  businessDetails: M,
647
- additionalOwners: Fr,
648
- primaryOwnerName: Mr,
649
- primaryOwnerPercentage: Nr,
651
+ additionalOwners: Rr,
652
+ primaryOwnerName: Fr,
653
+ primaryOwnerPercentage: Ir,
650
654
  isSoleProprietor: X,
651
- personalStateOptions: kn,
652
- businessStateOptions: On,
653
- naicsOptions: Dn,
654
- onEditPersonal: sr,
655
- onEditBusiness: cr,
655
+ personalStateOptions: Mn,
656
+ businessStateOptions: jn,
657
+ naicsOptions: An,
658
+ onEditPersonal: ur,
659
+ onEditBusiness: dr,
656
660
  ownersEditAriaLabel: O.reviewOwnersEditAriaLabel,
657
661
  isSubmitting: Q,
658
662
  labels: O
659
663
  }) }) : null,
660
- A === T.terms ? /* @__PURE__ */ S(Te, {
664
+ A === T.terms ? /* @__PURE__ */ C(Te, {
661
665
  value: M,
662
- onValueChange: Ct,
666
+ onValueChange: Tt,
663
667
  isSubmitting: Q,
664
- showAllErrors: kr,
668
+ showAllErrors: Mr,
665
669
  labels: O.businessDetails,
666
- bankName: wr,
667
- termsHref: _t,
668
- privacyHref: vt,
669
- electronicCommunicationHref: yt,
670
- patriotActHref: bt
670
+ bankName: Dr,
671
+ termsHref: yt,
672
+ privacyHref: bt,
673
+ electronicCommunicationHref: xt,
674
+ patriotActHref: St
671
675
  }) : null
672
676
  ]
673
677
  })
674
678
  }),
675
- E ? /* @__PURE__ */ S(ct, { callback: dt }) : null,
676
- /* @__PURE__ */ S(de, {
677
- open: rn,
678
- onConfirm: Sr,
679
- onCancel: () => an(!1),
680
- isDeleting: fn.isPending,
679
+ E ? /* @__PURE__ */ C(ut, { callback: pt }) : null,
680
+ /* @__PURE__ */ C(de, {
681
+ open: on,
682
+ onConfirm: Tr,
683
+ onCancel: () => sn(!1),
684
+ isDeleting: hn.isPending,
681
685
  labels: {
682
686
  descriptionEmphasis: O.saveAndClose,
683
687
  ...O.deleteApplicationDialog
@@ -688,12 +692,12 @@ function lt({ onEmbeddedOnboardingCompletedSuccessfully: p, onNavigateToDashboar
688
692
  cancel: h.deleteDialogCancel
689
693
  }
690
694
  }),
691
- /* @__PURE__ */ S(d, {})
695
+ /* @__PURE__ */ C(d, {})
692
696
  ]
693
697
  });
694
698
  }
695
- 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 }) {
696
- return /* @__PURE__ */ S(p, {
699
+ function ft({ 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 }) {
700
+ return /* @__PURE__ */ C(p, {
697
701
  baseUrl: e,
698
702
  widgetToken: t,
699
703
  organizationId: n,
@@ -707,17 +711,17 @@ function ut({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, ga
707
711
  disclosuresAcceptance: u,
708
712
  providerLabels: d,
709
713
  widgetName: Pe,
710
- children: /* @__PURE__ */ S(Ge, { children: /* @__PURE__ */ S(E, { ...ee }) })
714
+ children: /* @__PURE__ */ C(Ke, { children: /* @__PURE__ */ C(E, { ...ee }) })
711
715
  });
712
716
  }
713
717
  function E(e) {
714
- let { initResponse: t } = ne(), { client: n } = i(), r = t?.userId ?? null, [a, o] = x(r), [s, c] = x(0);
718
+ let { initResponse: t } = ne(), { client: n } = i(), r = t?.userId ?? null, [a, o] = S(r), [s, c] = S(0);
715
719
  r !== a && (o(r), a !== null && r !== null && c((e) => e + 1));
716
- let [l, u] = x(n);
717
- return n !== l && (u(n), c((e) => e + 1)), /* @__PURE__ */ S(dt, { ...e }, s);
720
+ let [l, u] = S(n);
721
+ return n !== l && (u(n), c((e) => e + 1)), /* @__PURE__ */ C(pt, { ...e }, s);
718
722
  }
719
- function dt(e) {
720
- let { authEpoch: t } = i(), { ownApplicationIds: n } = He(), [r, a] = x(null), [o, s] = x(0), [c, l] = x(null), [u, d] = x(null), [ee, f] = x(null), p = v(() => {
723
+ function pt(e) {
724
+ let { authEpoch: t } = i(), { ownApplicationIds: n } = Ue(), [r, a] = S(null), [o, s] = S(0), [c, l] = S(null), [u, d] = S(null), [ee, f] = S(null), p = v(() => {
721
725
  f(null);
722
726
  }, []), te = v(() => {
723
727
  a(null), s((e) => e + 1);
@@ -726,16 +730,16 @@ function dt(e) {
726
730
  }, [t, r]), re = v(() => {
727
731
  l(null), d(null), f(o + 1), s(o + 1);
728
732
  }, [o]);
729
- return r !== null && t !== r.authEpoch && n !== null && !n.includes(r.applicationId) && (a(null), s((e) => e + 1)), c !== null && t !== c && n !== null && n.some((e) => e !== u) && (l(null), d(null), f(o + 1), s(o + 1)), c === null ? /* @__PURE__ */ S(Fe, { children: /* @__PURE__ */ S(pt, {
733
+ return r !== null && t !== r.authEpoch && n !== null && !n.includes(r.applicationId) && (a(null), s((e) => e + 1)), c !== null && t !== c && n !== null && n.some((e) => e !== u) && (l(null), d(null), f(o + 1), s(o + 1)), c === null ? /* @__PURE__ */ C(Fe, { children: /* @__PURE__ */ C(ht, {
730
734
  ...e,
731
735
  onEditableDraftChange: a,
732
736
  onApplicationDeleted: ne,
733
737
  onNoticeReplacedByForm: te,
734
738
  focusFormOnMount: ee === o,
735
739
  onFocusFormOnMountDone: p
736
- }, o) }, o) : /* @__PURE__ */ S("div", {
737
- className: et,
738
- children: /* @__PURE__ */ S(fe, {
740
+ }, o) }, o) : /* @__PURE__ */ C("div", {
741
+ className: nt,
742
+ children: /* @__PURE__ */ C(fe, {
739
743
  className: "ttw:max-w-2xl",
740
744
  onStartNewApplication: re,
741
745
  labels: e.labels?.applicationDeleted,
@@ -746,11 +750,11 @@ function dt(e) {
746
750
  })
747
751
  });
748
752
  }
749
- var ft = { canRender: !1 };
750
- function pt(e) {
751
- let { authEpoch: t } = i(), { applicationId: n, clientSecret: r, isResolved: a } = He(), { application: o, isResolved: s, isUnavailable: c } = Ue(n, r), [l, u] = x(null);
753
+ var mt = { canRender: !1 };
754
+ function ht(e) {
755
+ let { authEpoch: t } = i(), { applicationId: n, clientSecret: r, isResolved: a } = Ue(), { application: o, isResolved: s, isUnavailable: c } = We(n, r), [l, u] = S(null);
752
756
  if (y(() => {
753
- l?.canRender !== !0 && a && s && (c || o !== null && o.status !== void 0 && o.status !== Qe ? u(ft) : u({
757
+ l?.canRender !== !0 && a && s && (c || o !== null && o.status !== void 0 && o.status !== et ? u(mt) : u({
754
758
  canRender: !0,
755
759
  applicationId: o === null ? null : n,
756
760
  authEpoch: t,
@@ -765,8 +769,8 @@ function pt(e) {
765
769
  o,
766
770
  n
767
771
  ]), l === null || !l.canRender) return null;
768
- let { applicationId: d, authEpoch: ee, prefill: f } = l, p = qe(e.initialBusinessDetails);
769
- return /* @__PURE__ */ S(lt, {
772
+ let { applicationId: d, authEpoch: ee, prefill: f } = l, p = Ye(e.initialBusinessDetails);
773
+ return /* @__PURE__ */ C(dt, {
770
774
  ...e,
771
775
  initialApplicationId: d,
772
776
  initialBoundAuthEpoch: ee,
@@ -779,10 +783,10 @@ function pt(e) {
779
783
  ...f?.businessDetails
780
784
  },
781
785
  initialPersonalDetails: {
782
- ...qe(e.initialPersonalDetails),
786
+ ...Ye(e.initialPersonalDetails),
783
787
  ...f?.personalDetails
784
788
  },
785
- initialAdditionalOwners: f?.additionalOwners ?? e.initialAdditionalOwners?.map(Ke)
789
+ initialAdditionalOwners: f?.additionalOwners ?? e.initialAdditionalOwners?.map(Je)
786
790
  });
787
791
  }
788
- export { ut as BankAccountOnboardingWidget, ut as default, c as OnboardingSuppressionReason };
792
+ export { ft as BankAccountOnboardingWidget, ft as default, c as OnboardingSuppressionReason };