@tesouro/embedded-components-react 0.5.36 → 0.5.38

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 (50) 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/bill-pay-widget/feature/dist/index54.js +20 -8
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +1 -0
  49. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  50. package/package.json +1 -1
@@ -1,176 +1,31 @@
1
- import { formatPhoneNumberInput as e } from "./index2.js";
2
- import { sanitizeZipCodeInput as t } from "./index3.js";
3
- import { PERSONAL_DETAILS_LABELS_EN as n } from "../../ui/dist/index7.js";
4
- import { ABOUT_YOU_PANEL_LABELS_EN as r } from "../../ui/dist/index21.js";
5
- import "../../ui/dist/index.js";
6
- import { formatSsnInput as i, maskSsn as a, sanitizeSsnDigits as o } from "./index4.js";
7
1
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index11.js
8
- function s(e) {
9
- return e ? e.toLocaleDateString("en-US", {
10
- month: "short",
11
- day: "numeric",
12
- year: "numeric"
13
- }) : "";
14
- }
15
- function c(e) {
16
- return {
17
- ...n,
18
- ...e
19
- };
20
- }
21
- function l(e) {
22
- let t = c(e);
23
- return {
24
- ...r,
25
- firstName: t.firstName,
26
- lastName: t.lastName,
27
- dateOfBirth: t.dateOfBirth,
28
- dateOfBirthPlaceholder: t.dateOfBirthPlaceholder,
29
- ssn: t.ssn,
30
- ssnShow: t.ssnShow,
31
- ssnHide: t.ssnHide,
32
- homeAddress: t.homeAddress,
33
- city: t.city,
34
- state: t.state,
35
- statePlaceholder: t.statePlaceholder,
36
- zipCode: t.zipCode,
37
- mobilePhoneNumber: t.mobilePhoneNumber,
38
- workEmail: t.workEmail,
39
- ownsOver25Question: t.ownsOver25Question,
40
- ownsOver25SummaryLabel: t.ownsOver25SummaryLabel,
41
- ownsOver25Yes: t.ownsOver25Yes,
42
- ownsOver25No: t.ownsOver25No,
43
- ownershipPercentage: t.ownershipPercentage,
44
- ownershipPercentagePlaceholder: t.ownershipPercentagePlaceholder
45
- };
46
- }
47
- function u(e, t) {
48
- let n = l(t.labels), r = t.stateOptions.find((t) => t.value === e.state)?.label ?? e.state;
49
- return [
50
- {
51
- label: n.firstName,
52
- value: e.firstName,
53
- testId: "about-you-summary-first-name"
54
- },
55
- {
56
- label: n.lastName,
57
- value: e.lastName,
58
- testId: "about-you-summary-last-name"
59
- },
60
- {
61
- label: n.dateOfBirth,
62
- value: s(e.dateOfBirth),
63
- testId: "about-you-summary-dob"
64
- },
65
- {
66
- label: n.ssn,
67
- value: a(e.ssn),
68
- testId: "about-you-summary-ssn",
69
- valueMonospace: !0
70
- },
71
- {
72
- label: n.homeAddress,
73
- value: e.homeAddress,
74
- testId: "about-you-summary-home-address"
75
- },
76
- {
77
- label: n.city,
78
- value: e.city,
79
- testId: "about-you-summary-city"
80
- },
81
- {
82
- label: n.state,
83
- value: r,
84
- testId: "about-you-summary-state"
85
- },
86
- {
87
- label: n.zipCode,
88
- value: e.zipCode,
89
- testId: "about-you-summary-zip-code"
90
- },
91
- {
92
- label: n.mobilePhoneNumber,
93
- value: e.mobilePhoneNumber,
94
- testId: "about-you-summary-mobile-phone"
95
- },
96
- {
97
- label: n.workEmail,
98
- value: e.workEmail,
99
- testId: "about-you-summary-email"
100
- },
101
- {
102
- label: n.ownershipPercentage,
103
- value: e.ownershipPercentage === null ? "" : `${e.ownershipPercentage}%`,
104
- testId: "about-you-summary-ownership-percentage"
105
- }
106
- ];
107
- }
108
- function d(n, r, i) {
109
- let a = (e) => (t) => r({
110
- ...n,
111
- [e]: t
112
- });
113
- return {
114
- firstName: {
115
- value: n.firstName,
116
- onValueChange: a("firstName")
117
- },
118
- lastName: {
119
- value: n.lastName,
120
- onValueChange: a("lastName")
121
- },
122
- dateOfBirth: {
123
- value: n.dateOfBirth,
124
- onValueChange: a("dateOfBirth")
125
- },
126
- ssn: {
127
- value: n.ssn,
128
- onValueChange: (e) => a("ssn")(o(e))
129
- },
130
- homeAddress: {
131
- value: n.homeAddress,
132
- onValueChange: a("homeAddress")
133
- },
134
- city: {
135
- value: n.city,
136
- onValueChange: a("city")
137
- },
138
- state: {
139
- value: n.state,
140
- onValueChange: a("state"),
141
- options: i.stateOptions
142
- },
143
- zipCode: {
144
- value: n.zipCode,
145
- onValueChange: (e) => a("zipCode")(t(e))
146
- },
147
- mobilePhoneNumber: {
148
- value: n.mobilePhoneNumber,
149
- onValueChange: (t) => a("mobilePhoneNumber")(e(t))
150
- },
151
- workEmail: {
152
- value: n.workEmail,
153
- onValueChange: a("workEmail")
154
- },
155
- ownsOver25Percent: {
156
- value: n.ownsOver25Percent === null ? "" : n.ownsOver25Percent ? "yes" : "no",
157
- onValueChange: (e) => r({
158
- ...n,
159
- ownsOver25Percent: e === "" ? null : e === "yes",
160
- ownershipPercentage: e === "yes" ? n.ownershipPercentage : null
161
- })
162
- },
163
- ownershipPercentage: {
164
- value: n.ownershipPercentage,
165
- onValueChange: a("ownershipPercentage")
166
- }
167
- };
168
- }
169
- function f(e) {
170
- return {
171
- masked: a(e),
172
- formatted: i(e)
173
- };
174
- }
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
+ };
175
30
  //#endregion
176
- export { d as buildAboutYouEditFields, l as buildAboutYouPanelLabels, u as buildAboutYouSummaryRows, f as buildSsnDisplayValues, c as mergePersonalDetailsLabels };
31
+ export { e as bankAccountOnboardingTestIds };
@@ -2,78 +2,128 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { bankAccountOnboardingTestIds as e } from "./index9.js";
6
- import { AboutYouPanel as t } from "../../ui/dist/index22.js";
5
+ import { isIdentifierEnteredOrStored as e, usableStoredTaxIdLast4 as t } from "./index7.js";
6
+ import { bankAccountOnboardingTestIds as n } from "./index11.js";
7
+ import { isValidWebsiteUrl as r } from "./index8.js";
8
+ import { BusinessDetailsPanel as i } from "../../ui/dist/index19.js";
9
+ import { BusinessDisclosuresSection as a } from "../../ui/dist/index24.js";
7
10
  import "../../ui/dist/index.js";
8
- import { getMaxBirthDate as n, isAtLeastMinOwnerAge as r } from "./index7.js";
9
- import { buildAboutYouEditFields as i, buildAboutYouPanelLabels as a, buildAboutYouSummaryRows as o, buildSsnDisplayValues as s, mergePersonalDetailsLabels as c } from "./index11.js";
10
- import { useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
11
- import { jsx as p } from "react/jsx-runtime";
12
- import { z as m } from "zod";
11
+ import { buildBusinessDetailsEditFields as o, buildBusinessDetailsPanelLabels as s, buildBusinessDetailsSummaryRows as c, buildTaxIdFieldDisplay as l, isBusinessWebsiteInvalid as u, mergeBusinessDetailsLabels as d } from "./index10.js";
12
+ import { useEffect as f, useMemo as p, useRef as m, useState as h } from "react";
13
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
14
+ import { z as v } from "zod";
13
15
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index12.js
14
- function h(e) {
15
- return m.object({
16
- firstName: m.string().min(1),
17
- lastName: m.string().min(1),
18
- dateOfBirth: m.date().refine(r, { message: e.dateOfBirthMinAgeError }),
19
- ssn: m.string().refine((e) => /^\d{9}$/.test(e), { message: e.ssnInvalid }),
20
- homeAddress: m.string().min(1),
21
- city: m.string().min(1),
22
- state: m.string().min(2),
23
- zipCode: m.string().min(5),
24
- mobilePhoneNumber: m.string().refine((e) => e.replace(/\D/g, "").length === 10, { message: e.mobilePhoneNumberInvalid }),
25
- workEmail: m.email(),
26
- ownsOver25Percent: m.boolean(),
27
- ownershipPercentage: m.number().min(0).max(100).nullable()
28
- }).refine((e) => e.ownsOver25Percent === !1 || e.ownershipPercentage !== null && e.ownershipPercentage >= 25 && e.ownershipPercentage <= 100, {
29
- message: e.ownershipPercentageRangeError,
30
- path: ["ownershipPercentage"]
16
+ function y(e) {
17
+ return v.object({
18
+ companyLegalName: v.string().min(1),
19
+ companyDbaName: v.string(),
20
+ businessAddress: v.string().min(1),
21
+ city: v.string().min(1),
22
+ state: v.string().min(2),
23
+ zipCode: v.string().min(5),
24
+ companyPhoneNumber: v.string().refine((e) => e.replace(/\D/g, "").length === 10, { message: e.companyPhoneNumberInvalid }),
25
+ companyStructure: x,
26
+ website: v.string().refine((e) => !e || r(e), { message: e.websiteInvalid }),
27
+ taxId: v.string(),
28
+ taxIdOnFileLast4: v.string().optional(),
29
+ taxIdOnFileStructure: x.optional(),
30
+ naicsCode: v.string().min(1)
31
31
  });
32
32
  }
33
- function g({ value: r, onValueChange: m, onSnapshotChange: g, stateOptions: _, isSubmitting: v, labels: y }) {
34
- let b = u(() => c(y), [y]), x = u(() => h(b), [b]).safeParse(r), S = x.success ? x.data : null, C = JSON.stringify({
35
- ...S,
36
- dateOfBirth: S?.dateOfBirth?.toISOString()
37
- }), w = d(g);
38
- w.current = g, l(() => {
39
- w.current(S);
40
- }, [C]);
41
- let [T, E] = f(() => S === null), [D, O] = f(!1);
42
- l(() => {
43
- S === null && E(!0);
44
- }, [C]);
45
- let k = u(() => ({
46
- stateOptions: _,
47
- labels: y
48
- }), [_, y]), A = u(() => a(y), [y]), j = u(() => o(r, k), [r, k]), M = u(() => i(r, m, k), [
49
- r,
50
- m,
51
- k
52
- ]), N = u(() => s(r.ssn), [r.ssn]), P = u(() => n(), []);
53
- return /* @__PURE__ */ p(t, {
54
- isEditing: T,
55
- onEditClick: () => E(!0),
56
- summaryRows: j,
57
- editFields: M,
58
- labels: A,
59
- isDisabled: v,
60
- ssnRevealed: D,
61
- ssnToggleAriaLabel: D ? A.ssnHide : A.ssnShow,
62
- onToggleSsnVisibility: () => O((e) => !e),
63
- showOwnershipPercentage: r.ownsOver25Percent === !0,
64
- maxBirthDate: P,
65
- ssnMaskedDisplay: N.masked,
66
- ssnFormattedDisplay: N.formatted,
67
- testIds: {
68
- root: e.aboutYouPanel,
69
- editButton: e.aboutYouEditButton,
70
- summary: { root: e.aboutYouSummary },
71
- editForm: {
72
- root: e.aboutYouEditForm,
73
- ownsOver25Question: e.aboutYouOwnsOver25Question
33
+ var b = (n) => e(n.taxId, t(n)), x = v.enum([
34
+ "CORPORATION_PUBLIC",
35
+ "CORPORATION_PRIVATE",
36
+ "CORPORATION_NOT_FOR_PROFIT",
37
+ "LLC",
38
+ "LLP",
39
+ "PARTNERSHIP",
40
+ "SOLE_PROPRIETORSHIP",
41
+ "GOVERNMENT",
42
+ "COOPERATIVE",
43
+ "ASSOCIATION",
44
+ "OTHER"
45
+ ]);
46
+ function S(e) {
47
+ return y(e).extend({
48
+ isAuthorized: v.literal(!0),
49
+ isCheckboxChecked: v.literal(!0)
50
+ }).refine(b, {
51
+ message: e.taxIdInvalid,
52
+ path: ["taxId"]
53
+ });
54
+ }
55
+ function C({ value: e, onValueChange: t, onSnapshotChange: r, naicsOptions: v, stateOptions: x, isSubmitting: C, labels: w, bankName: T, termsHref: E, privacyHref: D, electronicCommunicationHref: O, patriotActHref: k }) {
56
+ let A = p(() => d(w), [w]), j = p(() => ({
57
+ panelFields: y(A).refine(b, {
58
+ message: A.taxIdInvalid,
59
+ path: ["taxId"]
60
+ }),
61
+ full: S(A)
62
+ }), [A]), M = j.full.safeParse(e), N = M.success ? M.data : null, P = j.panelFields.safeParse(e).success, F = JSON.stringify(N), I = m(r);
63
+ I.current = r, f(() => {
64
+ I.current(N);
65
+ }, [F]);
66
+ let [L, R] = h(() => !P);
67
+ f(() => {
68
+ P || R(!0);
69
+ }, [P]);
70
+ let z = p(() => ({
71
+ stateOptions: x,
72
+ naicsOptions: v,
73
+ labels: w
74
+ }), [
75
+ x,
76
+ v,
77
+ w
78
+ ]), B = p(() => s(w), [w]), V = p(() => c(e, z), [e, z]), H = p(() => o(e, t, z), [
79
+ e,
80
+ t,
81
+ z
82
+ ]), U = u(e.website), W = p(() => l(e, w), [e, w]);
83
+ return /* @__PURE__ */ _("div", {
84
+ className: "ttw:flex ttw:flex-col ttw:gap-6",
85
+ children: [/* @__PURE__ */ g(i, {
86
+ isEditing: L,
87
+ onEditClick: () => R(!0),
88
+ summaryRows: V,
89
+ editFields: H,
90
+ labels: B,
91
+ isDisabled: C,
92
+ websiteInvalid: U,
93
+ taxIdRequired: W.required,
94
+ taxIdPlaceholder: W.placeholder,
95
+ taxIdHelpText: W.helpText,
96
+ testIds: {
97
+ root: n.businessDetailsPanel,
98
+ editButton: n.businessDetailsEditButton,
99
+ summary: { root: n.businessDetailsSummary },
100
+ editForm: {
101
+ root: n.businessDetailsEditForm,
102
+ naicsCombobox: n.businessDetailsNaicsCombobox
103
+ }
104
+ }
105
+ }), /* @__PURE__ */ g(a, {
106
+ value: {
107
+ isAuthorized: e.isAuthorized,
108
+ isCheckboxChecked: e.isCheckboxChecked
109
+ },
110
+ onChange: (n) => t({
111
+ ...e,
112
+ ...n
113
+ }),
114
+ isSubmitting: C,
115
+ labels: w,
116
+ bankName: T,
117
+ termsHref: E,
118
+ privacyHref: D,
119
+ electronicCommunicationHref: O,
120
+ patriotActHref: k,
121
+ testIds: {
122
+ authorizationCheckbox: n.authorizationCheckbox,
123
+ disclosureCheckbox: n.disclosureCheckbox
74
124
  }
75
- }
125
+ })]
76
126
  });
77
127
  }
78
128
  //#endregion
79
- export { g as PersonalDetailsStep };
129
+ export { C as BusinessDetailsStep };
@@ -1,87 +1,180 @@
1
- import { formatPhoneNumberInput as e } from "./index2.js";
2
- import { sanitizeZipCodeInput as t } from "./index3.js";
3
- import { getMaxBirthDate as n, isAtLeastMinOwnerAge as r } from "./index7.js";
4
- import { formatSsnInput as i, maskSsn as a, sanitizeSsnDigits as o } from "./index4.js";
1
+ import { maskIdentifierLast4 as e } from "./index6.js";
2
+ import { storedIdentifierFieldDisplay as t } from "./index7.js";
3
+ import { formatPhoneNumberInput as n } from "./index2.js";
4
+ import { sanitizeZipCodeInput as r } from "./index3.js";
5
+ import { PERSONAL_DETAILS_LABELS_EN as i } from "../../ui/dist/index8.js";
6
+ import { ABOUT_YOU_PANEL_LABELS_EN as a } from "../../ui/dist/index22.js";
7
+ import "../../ui/dist/index.js";
8
+ import { formatSsnInput as o, maskSsn as s, sanitizeSsnDigits as c } from "./index4.js";
5
9
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index13.js
6
- var s = {
7
- firstName: "",
8
- lastName: "",
9
- dateOfBirth: void 0,
10
- ssn: "",
11
- homeAddress: "",
12
- city: "",
13
- state: "",
14
- zipCode: "",
15
- mobilePhoneNumber: "",
16
- ownsOver25Percent: null,
17
- ownershipPercentage: null
18
- };
19
- function c(n) {
10
+ function l(e) {
11
+ return e ? e.toLocaleDateString("en-US", {
12
+ month: "short",
13
+ day: "numeric",
14
+ year: "numeric"
15
+ }) : "";
16
+ }
17
+ function u(e) {
20
18
  return {
21
- ...n,
22
- ssn: o(n.ssn),
23
- zipCode: t(n.zipCode),
24
- mobilePhoneNumber: e(n.mobilePhoneNumber),
25
- ownsOver25Percent: n.ownershipPercentage === null ? null : n.ownershipPercentage >= 25
19
+ ...i,
20
+ ...e
26
21
  };
27
22
  }
28
- function l(e) {
23
+ function d(e) {
24
+ let t = u(e);
29
25
  return {
30
- dateOfBirthInvalid: e.dateOfBirth !== void 0 && !r(e.dateOfBirth),
31
- ownershipPercentageInvalid: e.ownershipPercentage !== null && e.ownershipPercentage < 25,
32
- maxBirthDate: n(),
33
- ssnMaskedDisplay: a(e.ssn),
34
- ssnFormattedDisplay: i(e.ssn)
26
+ ...a,
27
+ firstName: t.firstName,
28
+ lastName: t.lastName,
29
+ dateOfBirth: t.dateOfBirth,
30
+ dateOfBirthPlaceholder: t.dateOfBirthPlaceholder,
31
+ ssn: t.ssn,
32
+ ssnShow: t.ssnShow,
33
+ ssnHide: t.ssnHide,
34
+ homeAddress: t.homeAddress,
35
+ city: t.city,
36
+ state: t.state,
37
+ statePlaceholder: t.statePlaceholder,
38
+ zipCode: t.zipCode,
39
+ mobilePhoneNumber: t.mobilePhoneNumber,
40
+ workEmail: t.workEmail,
41
+ ownsOver25Question: t.ownsOver25Question,
42
+ ownsOver25SummaryLabel: t.ownsOver25SummaryLabel,
43
+ ownsOver25Yes: t.ownsOver25Yes,
44
+ ownsOver25No: t.ownsOver25No,
45
+ ownershipPercentage: t.ownershipPercentage,
46
+ ownershipPercentagePlaceholder: t.ownershipPercentagePlaceholder
35
47
  };
36
48
  }
37
- function u(e, t, n) {
38
- let r = (n) => (r) => t(c({
49
+ function f(t, n) {
50
+ let r = d(n.labels), i = n.stateOptions.find((e) => e.value === t.state)?.label ?? t.state;
51
+ return [
52
+ {
53
+ label: r.firstName,
54
+ value: t.firstName,
55
+ testId: "about-you-summary-first-name"
56
+ },
57
+ {
58
+ label: r.lastName,
59
+ value: t.lastName,
60
+ testId: "about-you-summary-last-name"
61
+ },
62
+ {
63
+ label: r.dateOfBirth,
64
+ value: l(t.dateOfBirth),
65
+ testId: "about-you-summary-dob"
66
+ },
67
+ {
68
+ label: r.ssn,
69
+ value: t.ssn ? s(t.ssn) : t.ssnOnFileLast4 ? e(t.ssnOnFileLast4) : "",
70
+ testId: "about-you-summary-ssn",
71
+ valueMonospace: !0
72
+ },
73
+ {
74
+ label: r.homeAddress,
75
+ value: t.homeAddress,
76
+ testId: "about-you-summary-home-address"
77
+ },
78
+ {
79
+ label: r.city,
80
+ value: t.city,
81
+ testId: "about-you-summary-city"
82
+ },
83
+ {
84
+ label: r.state,
85
+ value: i,
86
+ testId: "about-you-summary-state"
87
+ },
88
+ {
89
+ label: r.zipCode,
90
+ value: t.zipCode,
91
+ testId: "about-you-summary-zip-code"
92
+ },
93
+ {
94
+ label: r.mobilePhoneNumber,
95
+ value: t.mobilePhoneNumber,
96
+ testId: "about-you-summary-mobile-phone"
97
+ },
98
+ {
99
+ label: r.workEmail,
100
+ value: t.workEmail,
101
+ testId: "about-you-summary-email"
102
+ },
103
+ {
104
+ label: r.ownershipPercentage,
105
+ value: t.ownershipPercentage === null ? "" : `${t.ownershipPercentage}%`,
106
+ testId: "about-you-summary-ownership-percentage"
107
+ }
108
+ ];
109
+ }
110
+ function p(e, t, i) {
111
+ let a = (n) => (r) => t({
39
112
  ...e,
40
113
  [n]: r
41
- }));
114
+ });
42
115
  return {
43
116
  firstName: {
44
117
  value: e.firstName,
45
- onValueChange: r("firstName")
118
+ onValueChange: a("firstName")
46
119
  },
47
120
  lastName: {
48
121
  value: e.lastName,
49
- onValueChange: r("lastName")
122
+ onValueChange: a("lastName")
50
123
  },
51
124
  dateOfBirth: {
52
125
  value: e.dateOfBirth,
53
- onValueChange: r("dateOfBirth")
126
+ onValueChange: a("dateOfBirth")
54
127
  },
55
128
  ssn: {
56
129
  value: e.ssn,
57
- onValueChange: (e) => r("ssn")(e)
130
+ onValueChange: (e) => a("ssn")(c(e))
58
131
  },
59
132
  homeAddress: {
60
133
  value: e.homeAddress,
61
- onValueChange: r("homeAddress")
134
+ onValueChange: a("homeAddress")
62
135
  },
63
136
  city: {
64
137
  value: e.city,
65
- onValueChange: r("city")
138
+ onValueChange: a("city")
66
139
  },
67
140
  state: {
68
141
  value: e.state,
69
- onValueChange: r("state"),
70
- options: n.stateOptions
142
+ onValueChange: a("state"),
143
+ options: i.stateOptions
71
144
  },
72
145
  zipCode: {
73
146
  value: e.zipCode,
74
- onValueChange: (e) => r("zipCode")(e)
147
+ onValueChange: (e) => a("zipCode")(r(e))
75
148
  },
76
149
  mobilePhoneNumber: {
77
150
  value: e.mobilePhoneNumber,
78
- onValueChange: (e) => r("mobilePhoneNumber")(e)
151
+ onValueChange: (e) => a("mobilePhoneNumber")(n(e))
152
+ },
153
+ workEmail: {
154
+ value: e.workEmail,
155
+ onValueChange: a("workEmail")
156
+ },
157
+ ownsOver25Percent: {
158
+ value: e.ownsOver25Percent === null ? "" : e.ownsOver25Percent ? "yes" : "no",
159
+ onValueChange: (n) => t({
160
+ ...e,
161
+ ownsOver25Percent: n === "" ? null : n === "yes",
162
+ ownershipPercentage: n === "yes" ? e.ownershipPercentage : null
163
+ })
79
164
  },
80
165
  ownershipPercentage: {
81
166
  value: e.ownershipPercentage,
82
- onValueChange: r("ownershipPercentage")
167
+ onValueChange: a("ownershipPercentage")
83
168
  }
84
169
  };
85
170
  }
171
+ function m(e, n, r) {
172
+ let i = u(r);
173
+ return {
174
+ masked: s(e),
175
+ formatted: o(e),
176
+ ...t(n, i.ssnOnFileTemplate)
177
+ };
178
+ }
86
179
  //#endregion
87
- export { s as EMPTY_ADDITIONAL_OWNER, l as buildAdditionalOwnerEditDisplay, u as buildAdditionalOwnerEditFields, c as normalizeAdditionalOwnerDraft };
180
+ export { p as buildAboutYouEditFields, d as buildAboutYouPanelLabels, f as buildAboutYouSummaryRows, m as buildSsnDisplayValues, u as mergePersonalDetailsLabels };