@tesouro/embedded-components-react 0.5.36 → 0.5.37

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 (48) hide show
  1. package/README.md +14 -14
  2. package/dist/index.d.ts +41 -3
  3. package/dist/index.js +5 -5
  4. package/dist/lib/BankAccountOnboardingWidget.d.ts +41 -3
  5. package/dist/lib/BankAccountOnboardingWidget.js +5 -5
  6. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index10.js +184 -109
  8. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index11.js +29 -174
  9. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index12.js +117 -67
  10. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index13.js +137 -44
  11. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index14.js +77 -107
  12. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index15.js +84 -87
  13. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index16.js +116 -88
  14. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js +99 -5
  15. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index18.js +100 -28
  16. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index19.js +5 -5
  17. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index20.js +26 -383
  18. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index21.js +19 -0
  19. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js +407 -0
  20. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index6.js +2 -10
  21. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index7.js +22 -6
  22. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index8.js +11 -182
  23. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index9.js +8 -29
  24. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js +12 -12
  25. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index10.js +27 -26
  26. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index11.js +34 -91
  27. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index12.js +96 -12
  28. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index13.js +14 -2
  29. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index14.js +0 -2
  30. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index15.js +4 -175
  31. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index16.js +180 -28
  32. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index17.js +31 -21
  33. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index18.js +21 -65
  34. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index19.js +60 -215
  35. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index20.js +230 -29
  36. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index21.js +32 -26
  37. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index22.js +26 -71
  38. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index23.js +71 -82
  39. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index24.js +87 -0
  40. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index3.js +38 -28
  41. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index4.js +2 -46
  42. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index5.js +48 -139
  43. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index6.js +138 -48
  44. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index7.js +47 -26
  45. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index8.js +32 -33
  46. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index9.js +31 -38
  47. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  48. package/package.json +1 -1
@@ -0,0 +1,407 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { Dialog as e, DialogContent as t, DialogTitle as n } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { useEmbedApi as r } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
7
+ import { useAcceptWidgetDisclosures as i } from "../../../shared/data-access/dist/lib/disclosures/useAcceptWidgetDisclosures.js";
8
+ import { useDisclosuresQuery as a } from "../../../shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js";
9
+ import { OnboardingSuppressionReason as o } from "../../../shared/data-access/dist/lib/onboardingSuppressionReason.js";
10
+ import { useOrganizationOnboardingSuppression as s } from "../../../shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js";
11
+ import "../../../shared/data-access/dist/index.js";
12
+ import { OnboardingShell as c } from "../../../shared/ui/dist/lib/OnboardingShell/OnboardingShell.js";
13
+ import "../../../shared/ui/dist/index.js";
14
+ import { useAnalyticsTrack as l } from "../../../shared/feature/dist/lib/analytics/hooks.js";
15
+ import { WidgetProvider as u } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
16
+ import { getStateOptions as d } from "../../../shared/util/dist/lib/usStates.js";
17
+ import { extractApiErrorMessage as ee } from "../../../shared/util/dist/lib/apiErrors.js";
18
+ import { useRefetchWidget as te, useWidgetConfig as f } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
19
+ import { getNaicsOptions as ne } from "../../../shared/feature/dist/lib/naicsCodeMap.js";
20
+ import "../../../shared/feature/dist/index.js";
21
+ import { identifierLast4 as p } from "./index7.js";
22
+ import { bankAccountOnboardingTestIds as m } from "./index11.js";
23
+ import { ADDITIONAL_OWNERS_LABELS_EN as h } from "../../ui/dist/index5.js";
24
+ import { interpolateBankName as g } from "../../ui/dist/index7.js";
25
+ import { ResultStep as re } from "../../ui/dist/index12.js";
26
+ import "../../ui/dist/index.js";
27
+ import { BusinessDetailsStep as ie } from "./index12.js";
28
+ import { PersonalDetailsStep as ae } from "./index14.js";
29
+ import { AdditionalOwnersStep as oe } from "./index16.js";
30
+ import { buildCreateApplicationBody as se, buildUpdateApplicationBody as _ } from "./index17.js";
31
+ import { buildOnboardingPrefill as ce } from "./index18.js";
32
+ import { OnboardingAnalyticsEvent as le, WIDGET_NAME as ue } from "./index19.js";
33
+ import { DEFAULT_LABELS as v } from "./index20.js";
34
+ import { withoutResumeOnlyOwnerFields as de, withoutStoredIdentifierMarkers as y } from "./index21.js";
35
+ import { ApplicationClientSecretProvider as b, useApplicationClientSecret as fe } from "../../data-access/dist/index2.js";
36
+ import { useCreateApplication as pe } from "../../data-access/dist/index4.js";
37
+ import { useUpdateApplication as me } from "../../data-access/dist/index6.js";
38
+ import { useSubmitApplication as he } from "../../data-access/dist/index7.js";
39
+ import { usePollApplicationCompletion as ge } from "../../data-access/dist/index8.js";
40
+ import { useResumableBankAccountApplication as x } from "../../data-access/dist/index10.js";
41
+ import { useStartedBankAccountApplication as _e } from "../../data-access/dist/index11.js";
42
+ import "../../data-access/dist/index.js";
43
+ import { useCallback as ve, useEffect as S, useMemo as C, useRef as ye, useState as w } from "react";
44
+ import { Fragment as be, jsx as T, jsxs as xe } from "react/jsx-runtime";
45
+ //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js
46
+ var E = "DRAFT", Se = [], Ce = {
47
+ companyLegalName: "",
48
+ companyDbaName: "",
49
+ businessAddress: "",
50
+ city: "",
51
+ state: "",
52
+ zipCode: "",
53
+ companyPhoneNumber: "",
54
+ companyStructure: "",
55
+ website: "",
56
+ taxId: "",
57
+ naicsCode: "",
58
+ isAuthorized: null,
59
+ isCheckboxChecked: !1
60
+ }, we = {
61
+ firstName: "",
62
+ lastName: "",
63
+ dateOfBirth: void 0,
64
+ ssn: "",
65
+ homeAddress: "",
66
+ city: "",
67
+ state: "",
68
+ zipCode: "",
69
+ mobilePhoneNumber: "",
70
+ workEmail: "",
71
+ ownsOver25Percent: null,
72
+ ownershipPercentage: null
73
+ };
74
+ function Te(e, t) {
75
+ if (e === 0) return {
76
+ title: t.businessReviewTitle,
77
+ subtitle: t.businessReviewSubtitle
78
+ };
79
+ if (e === 1) return {
80
+ title: t.personalReviewTitle,
81
+ subtitle: t.personalReviewSubtitle
82
+ };
83
+ let n = {
84
+ ...h,
85
+ ...t.additionalOwners
86
+ };
87
+ return {
88
+ title: n.heading,
89
+ subtitle: n.subheading
90
+ };
91
+ }
92
+ function D({ onEmbeddedOnboardingCompletedSuccessfully: r, onNavigateToDashboard: u, labels: h, initialBusinessDetails: ce, initialPersonalDetails: ue, initialAdditionalOwners: y, initialApplicationId: b = null, bankLogoSrc: x, disclosureLinks: _e, open: E, defaultOpen: D, onOpenChange: O, isFullScreenInline: k = !1 }) {
93
+ let A = l();
94
+ S(() => {
95
+ A(le.Mounted);
96
+ }, [A]);
97
+ let j = {
98
+ ...v,
99
+ ...h,
100
+ stepIndicator: {
101
+ ...v.stepIndicator,
102
+ ...h?.stepIndicator
103
+ },
104
+ businessDetails: h?.businessDetails ?? {},
105
+ personalDetails: h?.personalDetails ?? {},
106
+ additionalOwners: h?.additionalOwners ?? {},
107
+ result: {
108
+ ...v.result,
109
+ ...h?.result
110
+ }
111
+ }, M = f().initResponse, { termsHref: Ee, privacyHref: De, electronicCommunicationHref: Oe, patriotActHref: ke } = _e ?? {}, N = E === void 0, [Ae, je] = w(() => D ?? !1), Me = N ? Ae : E, Ne = D ?? !1, P = ve((e) => {
112
+ N && je(e), O?.(e);
113
+ }, [O, N]), Pe = ve(() => {
114
+ r();
115
+ }, [r]), Fe = te(), [F, I] = w(0), [Ie, Le] = w(() => ({
116
+ ...Ce,
117
+ ...ce
118
+ })), [L, Re] = w(() => ({
119
+ ...we,
120
+ ...ue
121
+ })), [ze, R] = w(() => y ?? []), [z, Be] = w(null), [B, Ve] = w(null), [V, He] = w(null), [H, Ue] = w(b), [We, U] = w(null), [W, Ge] = w(!1), [Ke, G] = w(null), qe = pe(), K = me(), Je = he(), Ye = ge(), { setClientSecret: Xe } = fe(), { data: Ze, refetch: Qe } = a(), { mutateAsync: $e } = i(), q = s(), J = ye(null);
122
+ S(() => () => J.current?.abort(), []);
123
+ let et = C(() => ne(j.businessDetails.naicsTitles), [j.businessDetails.naicsTitles]), tt = C(() => d(j.businessDetails.stateTitles), [j.businessDetails.stateTitles]), nt = C(() => d(j.personalDetails.stateTitles), [j.personalDetails.stateTitles]), rt = C(() => d(j.additionalOwners.stateTitles), [j.additionalOwners.stateTitles]), Y = W || Ke !== null, it = M?.status === "ACTIVE" || M?.status === "INACTIVE", at = M?.status === "INVITED", X = !!M && !Y && (it || at || q.isSuppressed), Z = X ? it ? o.UserAlreadyOnboarded : at ? o.UserInvitedToOrganization : q.reason : null;
124
+ if (S(() => {
125
+ !X || !Z || (A(le.Suppressed, { reason: Z }), console.info(`[onboarding] not shown: ${Z}`));
126
+ }, [
127
+ X,
128
+ Z,
129
+ A
130
+ ]), !M || !Y && (X || !q.isResolved)) return null;
131
+ let Q = z?.companyStructure === "SOLE_PROPRIETORSHIP", ot = [
132
+ j.stepIndicator.business,
133
+ j.stepIndicator.personal,
134
+ j.stepIndicator.ownership
135
+ ], st = F === 0 ? z : F === 1 ? B : F === 2 ? V : null, $ = qe.isPending || K.isPending || Je.isPending || W, ct = () => {
136
+ U(null), I((e) => e === 0 ? 0 : e - 1);
137
+ }, lt = () => {
138
+ P(!1);
139
+ }, ut = async (e) => {
140
+ Ge(!0), P(!0);
141
+ let t = new AbortController();
142
+ J.current = t;
143
+ let n = !1;
144
+ try {
145
+ let r = await Je.mutateAsync({ path: { id: e } });
146
+ if (t.signal.aborted) return;
147
+ if (!r.id) throw Error(j.submitFailedError);
148
+ if (n = !0, (await Ye(e, { signal: t.signal })).status === "complete") {
149
+ let e = Ze;
150
+ if (e === void 0 && (e = (await Qe()).data), t.signal.aborted) return;
151
+ if (e !== void 0) try {
152
+ await $e({ displayedVersion: e.version ?? null });
153
+ } catch {}
154
+ if (t.signal.aborted) return;
155
+ G("success"), Fe(), Pe();
156
+ } else G("pending");
157
+ } catch (e) {
158
+ if (e instanceof DOMException && e.name === "AbortError") return;
159
+ if (!n) throw e;
160
+ G("pending");
161
+ } finally {
162
+ J.current = null, Ge(!1);
163
+ }
164
+ }, dt = () => {
165
+ Le((e) => e.taxIdOnFileLast4 && e.taxId ? {
166
+ ...e,
167
+ taxId: "",
168
+ taxIdOnFileLast4: p(e.taxId),
169
+ taxIdOnFileStructure: e.companyStructure === "" ? void 0 : e.companyStructure
170
+ } : e);
171
+ }, ft = () => {
172
+ Re((e) => e.ssnOnFileLast4 && e.ssn ? {
173
+ ...e,
174
+ ssn: "",
175
+ ssnOnFileLast4: p(e.ssn)
176
+ } : e);
177
+ }, pt = () => {
178
+ R((e) => e.map((e) => e.ssnOnFileLast4 && e.ssn ? {
179
+ ...e,
180
+ ssn: "",
181
+ ssnOnFileLast4: p(e.ssn)
182
+ } : e));
183
+ }, mt = () => {
184
+ R((e) => e.map(de));
185
+ }, ht = async () => {
186
+ U(null);
187
+ try {
188
+ if (F === 0) {
189
+ if (!z) return;
190
+ let e = H;
191
+ if (e) await K.mutateAsync({
192
+ path: { id: e },
193
+ body: _({
194
+ businessDetails: z,
195
+ carryConsent: b !== null
196
+ })
197
+ });
198
+ else {
199
+ let t = await qe.mutateAsync({ body: se(z) });
200
+ e = t.id, Ue(e), t.clientSecret && Xe(t.clientSecret);
201
+ }
202
+ dt(), Q && mt(), I(1);
203
+ } else if (F === 1) {
204
+ if (!B || !z || !H) return;
205
+ await K.mutateAsync({
206
+ path: { id: H },
207
+ body: _({
208
+ businessDetails: z,
209
+ applicant: B,
210
+ carryConsent: b !== null
211
+ })
212
+ }), dt(), ft(), I(2);
213
+ } else if (F === 2) {
214
+ if (!V || !H) return;
215
+ await K.mutateAsync({
216
+ path: { id: H },
217
+ body: _({ businessOwners: V })
218
+ }), pt(), await ut(H);
219
+ }
220
+ } catch (e) {
221
+ let t = ee(e) ?? (e instanceof Error ? e.message : void 0) ?? j.genericRetryError;
222
+ U(t);
223
+ }
224
+ }, gt = Te(Math.min(F, 2), j), _t = M.bankName?.trim() || j.fallbackBankName, vt = g(j.shellFdicDisclaimer, _t);
225
+ if (Y) {
226
+ let r = z?.companyLegalName ?? "", i = M.bankName?.trim() || j.fallbackBankName, a = Ke ?? "pending", o = a === "success", s = {
227
+ ...v.result,
228
+ ...j.result
229
+ }, c = /* @__PURE__ */ T(re, {
230
+ testIds: {
231
+ processing: m.resultProcessing,
232
+ dashboardButton: m.resultDashboardButton
233
+ },
234
+ status: a,
235
+ isLoading: W,
236
+ loadingMessage: s.loadingMessage,
237
+ headingLine1: o ? s.successHeadingLine1 : s.pendingHeadingLine1,
238
+ headingLine2: `${r}!`,
239
+ body: o ? s.successBody : s.pendingBody,
240
+ followUpEmail: B?.workEmail ?? "",
241
+ emailBoxLead: s.pendingEmailBoxLead,
242
+ navigateToDashboardLabel: s.navigateToDashboard,
243
+ bankLogoSrc: x,
244
+ bankLogoAlt: g(s.bankLogoAlt, i),
245
+ fdicDisclaimer: g(s.fdicDisclaimer, i),
246
+ onNavigateToDashboard: u
247
+ });
248
+ return k ? /* @__PURE__ */ T("div", {
249
+ 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",
250
+ children: c
251
+ }) : /* @__PURE__ */ T(e, {
252
+ open: Me,
253
+ onOpenChange: P,
254
+ children: /* @__PURE__ */ xe(t, {
255
+ 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",
256
+ children: [/* @__PURE__ */ T(n, {
257
+ className: "ttw:sr-only",
258
+ children: j.modalTitle
259
+ }), c]
260
+ })
261
+ });
262
+ }
263
+ let yt = F === 2 ? j.submit : j.next, bt = st === null || $;
264
+ return /* @__PURE__ */ T(be, { children: /* @__PURE__ */ xe(c, {
265
+ open: Me,
266
+ defaultOpen: Ne,
267
+ onOpenChange: P,
268
+ isFullScreenInline: k,
269
+ title: gt.title,
270
+ subtitle: gt.subtitle,
271
+ stepLabels: ot,
272
+ activeStep: F,
273
+ disclaimerText: vt,
274
+ onBack: F === 0 ? lt : ct,
275
+ onCancel: F > 0 ? lt : void 0,
276
+ onNext: ht,
277
+ showDismissButton: !1,
278
+ isNextDisabled: bt,
279
+ isNextLoading: $,
280
+ nextLabel: yt,
281
+ nextIcon: null,
282
+ errorMessage: We,
283
+ labels: {
284
+ backButton: F === 0 ? j.cancel : j.back,
285
+ cancelButton: j.cancel
286
+ },
287
+ testIds: {
288
+ root: m.shell,
289
+ dismiss: m.shellDismiss,
290
+ back: m.shellBack,
291
+ cancel: m.shellCancel,
292
+ next: m.shellNext,
293
+ scrollRegion: {
294
+ root: m.shellScrollRegion,
295
+ fade: m.shellScrollFade,
296
+ hint: m.shellScrollHint
297
+ }
298
+ },
299
+ children: [
300
+ F === 0 ? /* @__PURE__ */ T(ie, {
301
+ value: Ie,
302
+ onValueChange: Le,
303
+ onSnapshotChange: Be,
304
+ naicsOptions: et,
305
+ stateOptions: tt,
306
+ isSubmitting: $,
307
+ labels: j.businessDetails,
308
+ bankName: _t,
309
+ termsHref: Ee,
310
+ privacyHref: De,
311
+ electronicCommunicationHref: Oe,
312
+ patriotActHref: ke
313
+ }, "business") : null,
314
+ F === 1 ? /* @__PURE__ */ T(ae, {
315
+ value: L,
316
+ onValueChange: Re,
317
+ onSnapshotChange: Ve,
318
+ stateOptions: nt,
319
+ isSubmitting: $,
320
+ labels: j.personalDetails
321
+ }, "personal") : null,
322
+ F === 2 ? /* @__PURE__ */ T(oe, {
323
+ owners: Q ? Se : ze,
324
+ onOwnersChange: R,
325
+ primaryOwnerName: `${L.firstName} ${L.lastName}`.trim(),
326
+ primaryOwnerPercentage: Q ? 100 : B?.ownsOver25Percent === !0 ? B.ownershipPercentage ?? 0 : 0,
327
+ stateOptions: rt,
328
+ onSnapshotChange: He,
329
+ isSubmitting: $,
330
+ labels: j.additionalOwners
331
+ }) : null
332
+ ]
333
+ }) });
334
+ }
335
+ function O({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework: s, errorFallback: c, onError: l, analytics: d, disclosuresAcceptance: ee, providerLabels: te, ...f }) {
336
+ return /* @__PURE__ */ T(u, {
337
+ baseUrl: e,
338
+ widgetToken: t,
339
+ organizationId: n,
340
+ configClient: r,
341
+ gatewayRouting: i,
342
+ linkComponent: a,
343
+ implementation: o,
344
+ uiFramework: s,
345
+ errorFallback: c,
346
+ onError: l,
347
+ analytics: d,
348
+ disclosuresAcceptance: ee,
349
+ providerLabels: te,
350
+ widgetName: ue,
351
+ children: /* @__PURE__ */ T(k, { ...f })
352
+ });
353
+ }
354
+ function k(e) {
355
+ let { initResponse: t } = f(), { client: n } = r(), i = t?.userId ?? null, [a, o] = w(i), [s, c] = w(0);
356
+ i !== a && (o(i), a !== null && i !== null && c((e) => e + 1));
357
+ let [l, u] = w(n);
358
+ return n !== l && (u(n), c((e) => e + 1)), /* @__PURE__ */ T(b, { children: /* @__PURE__ */ T(j, { ...e }, s) }, s);
359
+ }
360
+ var A = { canRender: !1 };
361
+ function j(e) {
362
+ let { setClientSecret: t } = fe(), { applicationId: n, clientSecret: r, isResolved: i } = x(), { application: a, isResolved: o, isUnavailable: s } = _e(n, r);
363
+ S(() => {
364
+ r && t(r);
365
+ }, [r, t]);
366
+ let [c, l] = w(null);
367
+ if (S(() => {
368
+ if (!(c?.canRender === !0 || !i || !o)) {
369
+ if (s) {
370
+ l(A);
371
+ return;
372
+ }
373
+ if (a !== null && a.status !== void 0 && a.status !== E) {
374
+ l(A);
375
+ return;
376
+ }
377
+ l({
378
+ canRender: !0,
379
+ applicationId: a === null ? null : n,
380
+ prefill: ce(a)
381
+ });
382
+ }
383
+ }, [
384
+ c,
385
+ i,
386
+ o,
387
+ s,
388
+ a,
389
+ n
390
+ ]), c === null || !c.canRender) return null;
391
+ let { applicationId: u, prefill: d } = c;
392
+ return /* @__PURE__ */ T(D, {
393
+ ...e,
394
+ initialApplicationId: u,
395
+ initialBusinessDetails: {
396
+ ...y(e.initialBusinessDetails),
397
+ ...d?.businessDetails
398
+ },
399
+ initialPersonalDetails: {
400
+ ...y(e.initialPersonalDetails),
401
+ ...d?.personalDetails
402
+ },
403
+ initialAdditionalOwners: d?.additionalOwners ?? e.initialAdditionalOwners?.map(de)
404
+ });
405
+ }
406
+ //#endregion
407
+ export { O as BankAccountOnboardingWidget, O as default };
@@ -1,14 +1,6 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index6.js
2
2
  function e(e) {
3
- let t = e.trim();
4
- if (t.length === 0) return !0;
5
- if (/\s/.test(t)) return !1;
6
- try {
7
- let e = new URL(t);
8
- return e.protocol === "http:" || e.protocol === "https:";
9
- } catch {
10
- return !1;
11
- }
3
+ return `•••••${e}`;
12
4
  }
13
5
  //#endregion
14
- export { e as isValidWebsiteUrl };
6
+ export { e as maskIdentifierLast4 };
@@ -1,10 +1,26 @@
1
+ import { maskIdentifierLast4 as e } from "./index6.js";
1
2
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index7.js
2
- function e(e = /* @__PURE__ */ new Date()) {
3
- let t = new Date(e.getTime());
4
- return t.setFullYear(t.getFullYear() - 18), t;
3
+ var t = /^\d{9}$/;
4
+ function n(e, n) {
5
+ return t.test(e) || e === "" && !!n;
5
6
  }
6
- function t(t, n = /* @__PURE__ */ new Date()) {
7
- return t.getTime() <= e(n).getTime();
7
+ function r(e, t) {
8
+ return e === "" && !!t;
9
+ }
10
+ var i = "SOLE_PROPRIETORSHIP";
11
+ function a(e) {
12
+ let { companyStructure: t, taxIdOnFileLast4: n, taxIdOnFileStructure: r } = e;
13
+ if (!(!n || !r)) return r === i == (t === i) ? n : void 0;
14
+ }
15
+ function o(t, n) {
16
+ return t ? {
17
+ required: !1,
18
+ placeholder: e(t),
19
+ helpText: n(t)
20
+ } : { required: !0 };
21
+ }
22
+ function s(e) {
23
+ return e.slice(-4);
8
24
  }
9
25
  //#endregion
10
- export { e as getMaxBirthDate, t as isAtLeastMinOwnerAge };
26
+ export { s as identifierLast4, n as isIdentifierEnteredOrStored, r as keepsStoredIdentifier, o as storedIdentifierFieldDisplay, a as usableStoredTaxIdLast4 };
@@ -1,185 +1,14 @@
1
- import { isValidWebsiteUrl as e } from "./index6.js";
2
- import { formatPhoneNumberInput as t } from "./index2.js";
3
- import { sanitizeZipCodeInput as n } from "./index3.js";
4
- import { sanitizeTaxIdInput as r } from "./index5.js";
5
- import { BUSINESS_DETAILS_LABELS_EN as i } from "../../ui/dist/index6.js";
6
- import { BUSINESS_DETAILS_PANEL_LABELS_EN as a } from "../../ui/dist/index17.js";
7
- import "../../ui/dist/index.js";
8
1
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index8.js
9
- function o(e) {
10
- return {
11
- ...i,
12
- ...e,
13
- companyStructureOptions: {
14
- ...i.companyStructureOptions,
15
- ...e?.companyStructureOptions
16
- },
17
- naicsTitles: {
18
- ...i.naicsTitles,
19
- ...e?.naicsTitles
20
- },
21
- stateTitles: {
22
- ...i.stateTitles,
23
- ...e?.stateTitles
24
- }
25
- };
26
- }
27
- function s(t) {
28
- return t.trim().length > 0 && !e(t);
29
- }
30
- function c(e) {
31
- let t = o(e);
32
- return {
33
- ...a,
34
- companyLegalName: t.companyLegalName,
35
- companyDbaName: t.companyDbaName,
36
- businessAddress: t.businessAddress,
37
- city: t.city,
38
- state: t.state,
39
- statePlaceholder: t.statePlaceholder,
40
- zipCode: t.zipCode,
41
- companyPhoneNumber: t.companyPhoneNumber,
42
- companyStructure: t.companyStructure,
43
- companyStructurePlaceholder: t.companyStructurePlaceholder,
44
- website: t.website,
45
- websiteInvalid: t.websiteInvalid,
46
- taxId: t.taxId,
47
- naicsCode: t.naicsCode,
48
- naicsCodePlaceholder: t.naicsCodePlaceholder
49
- };
50
- }
51
- function l(e, t) {
52
- let n = c(t.labels), r = o(t.labels), i = e.companyStructure && r.companyStructureOptions[e.companyStructure], a = t.stateOptions.find((t) => t.value === e.state)?.label ?? e.state, s = t.naicsOptions.find((t) => t.value === e.naicsCode)?.label ?? e.naicsCode;
53
- return [
54
- {
55
- label: n.companyLegalName,
56
- value: e.companyLegalName,
57
- testId: "business-details-summary-legal-name"
58
- },
59
- {
60
- label: n.companyDbaName,
61
- value: e.companyDbaName,
62
- testId: "business-details-summary-dba-name"
63
- },
64
- {
65
- label: n.businessAddress,
66
- value: e.businessAddress,
67
- testId: "business-details-summary-address"
68
- },
69
- {
70
- label: n.city,
71
- value: e.city,
72
- testId: "business-details-summary-city"
73
- },
74
- {
75
- label: n.state,
76
- value: a,
77
- testId: "business-details-summary-state"
78
- },
79
- {
80
- label: n.zipCode,
81
- value: e.zipCode,
82
- testId: "business-details-summary-zip-code"
83
- },
84
- {
85
- label: n.companyPhoneNumber,
86
- value: e.companyPhoneNumber,
87
- testId: "business-details-summary-phone"
88
- },
89
- {
90
- label: n.companyStructure,
91
- value: i ?? e.companyStructure,
92
- testId: "business-details-summary-structure"
93
- },
94
- {
95
- label: n.website,
96
- value: e.website,
97
- testId: "business-details-summary-website"
98
- },
99
- {
100
- label: n.taxId,
101
- value: e.taxId,
102
- testId: "business-details-summary-tax-id"
103
- },
104
- {
105
- label: n.naicsCode,
106
- value: s,
107
- testId: "business-details-summary-naics"
108
- }
109
- ];
110
- }
111
- function u(e, i, a) {
112
- let s = o(a.labels), c = [
113
- "CORPORATION_PUBLIC",
114
- "CORPORATION_PRIVATE",
115
- "CORPORATION_NOT_FOR_PROFIT",
116
- "LLC",
117
- "LLP",
118
- "PARTNERSHIP",
119
- "SOLE_PROPRIETORSHIP",
120
- "GOVERNMENT",
121
- "COOPERATIVE",
122
- "ASSOCIATION",
123
- "OTHER"
124
- ].map((e) => ({
125
- value: e,
126
- label: s.companyStructureOptions[e]
127
- })), l = (t) => (n) => i({
128
- ...e,
129
- [t]: n
130
- });
131
- return {
132
- companyLegalName: {
133
- value: e.companyLegalName,
134
- onValueChange: l("companyLegalName")
135
- },
136
- companyDbaName: {
137
- value: e.companyDbaName,
138
- onValueChange: l("companyDbaName")
139
- },
140
- businessAddress: {
141
- value: e.businessAddress,
142
- onValueChange: l("businessAddress")
143
- },
144
- city: {
145
- value: e.city,
146
- onValueChange: l("city")
147
- },
148
- state: {
149
- value: e.state,
150
- onValueChange: l("state"),
151
- options: a.stateOptions
152
- },
153
- zipCode: {
154
- value: e.zipCode,
155
- onValueChange: (e) => l("zipCode")(n(e))
156
- },
157
- companyPhoneNumber: {
158
- value: e.companyPhoneNumber,
159
- onValueChange: (e) => l("companyPhoneNumber")(t(e))
160
- },
161
- companyStructure: {
162
- value: e.companyStructure,
163
- onValueChange: (t) => i({
164
- ...e,
165
- companyStructure: t
166
- }),
167
- options: c
168
- },
169
- website: {
170
- value: e.website,
171
- onValueChange: l("website")
172
- },
173
- taxId: {
174
- value: e.taxId,
175
- onValueChange: (e) => l("taxId")(r(e))
176
- },
177
- naicsCode: {
178
- value: e.naicsCode,
179
- onValueChange: l("naicsCode"),
180
- options: a.naicsOptions
181
- }
182
- };
2
+ function e(e) {
3
+ let t = e.trim();
4
+ if (t.length === 0) return !0;
5
+ if (/\s/.test(t)) return !1;
6
+ try {
7
+ let e = new URL(t);
8
+ return e.protocol === "http:" || e.protocol === "https:";
9
+ } catch {
10
+ return !1;
11
+ }
183
12
  }
184
13
  //#endregion
185
- export { u as buildBusinessDetailsEditFields, c as buildBusinessDetailsPanelLabels, l as buildBusinessDetailsSummaryRows, s as isBusinessWebsiteInvalid, o as mergeBusinessDetailsLabels };
14
+ export { e as isValidWebsiteUrl };
@@ -1,31 +1,10 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index9.js
2
- var e = {
3
- shell: "onboarding-shell",
4
- shellDismiss: "onboarding-shell-dismiss",
5
- shellBack: "onboarding-shell-back",
6
- shellCancel: "onboarding-shell-cancel",
7
- shellNext: "onboarding-shell-next",
8
- shellScrollRegion: "onboarding-shell-scroll-region",
9
- shellScrollFade: "onboarding-shell-scroll-fade",
10
- shellScrollHint: "onboarding-shell-scroll-hint",
11
- shellOverlay: "onboarding-shell-overlay",
12
- businessDetailsPanel: "business-details-panel",
13
- businessDetailsEditButton: "business-details-edit-button",
14
- businessDetailsSummary: "business-details-summary",
15
- businessDetailsEditForm: "business-details-edit-form",
16
- businessDetailsNaicsCombobox: "business-details-naics-combobox",
17
- authorizationCheckbox: "bank-account-onboarding-authorization-checkbox",
18
- disclosureCheckbox: "bank-account-onboarding-disclosure-checkbox",
19
- aboutYouPanel: "about-you-panel",
20
- aboutYouEditButton: "about-you-edit-button",
21
- aboutYouSummary: "about-you-summary",
22
- aboutYouEditForm: "about-you-edit-form",
23
- aboutYouOwnsOver25Question: "about-you-owns-over-25-question",
24
- addOwnerButton: "bank-account-onboarding-add-owner-button",
25
- ownerDeleteOverlay: "additional-owner-delete-overlay",
26
- ownerDeleteContent: "additional-owner-delete-content",
27
- resultProcessing: "bank-account-onboarding-result-processing",
28
- resultDashboardButton: "bank-account-onboarding-result-dashboard-button"
29
- };
2
+ function e(e = /* @__PURE__ */ new Date()) {
3
+ let t = new Date(e.getTime());
4
+ return t.setFullYear(t.getFullYear() - 18), t;
5
+ }
6
+ function t(t, n = /* @__PURE__ */ new Date()) {
7
+ return t.getTime() <= e(n).getTime();
8
+ }
30
9
  //#endregion
31
- export { e as bankAccountOnboardingTestIds };
10
+ export { e as getMaxBirthDate, t as isAtLeastMinOwnerAge };