@tesouro/embedded-components-react 0.5.171 → 0.5.172

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 (30) hide show
  1. package/dist/index.d.ts +18 -0
  2. package/dist/index.js +1 -1
  3. package/dist/lib/BankAccountOnboardingWidget.d.ts +18 -0
  4. package/dist/lib/BankAccountOnboardingWidget.js +1 -1
  5. package/dist/lib/WidgetSuite.d.ts +18 -0
  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 +82 -184
  8. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index11.js +189 -29
  9. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index12.js +34 -127
  10. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index13.js +83 -175
  11. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index14.js +173 -84
  12. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index15.js +62 -92
  13. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index16.js +86 -115
  14. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js +5 -97
  15. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index18.js +105 -87
  16. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index19.js +99 -5
  17. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index20.js +94 -28
  18. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index21.js +182 -16
  19. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js +5 -423
  20. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index23.js +34 -0
  21. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index24.js +19 -0
  22. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index25.js +580 -0
  23. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js +3 -1
  24. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index25.js +10 -0
  25. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index26.js +59 -0
  26. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  27. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShell.js +62 -49
  28. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/labels.js +1 -0
  29. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index16.js +1 -1
  30. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1762,6 +1762,17 @@ interface ResultLabels {
1762
1762
  }
1763
1763
  declare const RESULT_LABELS_EN: ResultLabels;
1764
1764
 
1765
+ interface UnsavedApplicationDialogLabels {
1766
+ title: string;
1767
+ description: string;
1768
+ /** Saves the work in progress as a draft, then closes onboarding. */
1769
+ saveDraftButton: string;
1770
+ /** Closes onboarding and throws the unsaved edits away. */
1771
+ discardButton: string;
1772
+ /** Screen-reader name for the corner close control; returns to the form. */
1773
+ closeButton: string;
1774
+ }
1775
+
1765
1776
  interface BankAccountOnboardingWidgetLabels {
1766
1777
  stepIndicator: {
1767
1778
  business: string;
@@ -1773,10 +1784,15 @@ interface BankAccountOnboardingWidgetLabels {
1773
1784
  personalDetails: Partial<PersonalDetailsLabels>;
1774
1785
  additionalOwners: Partial<AdditionalOwnersLabels>;
1775
1786
  result: ResultLabels;
1787
+ /** The prompt shown when closing with unsaved changes. */
1788
+ unsavedApplicationDialog: Partial<UnsavedApplicationDialogLabels>;
1776
1789
  back: string;
1777
1790
  cancel: string;
1778
1791
  next: string;
1779
1792
  submit: string;
1793
+ saveAndClose: string;
1794
+ /** Shown after "Save and close" or the close prompt's "Save changes" writes the application. */
1795
+ applicationSavedToast: string;
1780
1796
  businessReviewTitle: string;
1781
1797
  businessReviewSubtitle: string;
1782
1798
  personalReviewTitle: string;
@@ -1787,6 +1803,8 @@ interface BankAccountOnboardingWidgetLabels {
1787
1803
  submitFailedError: string;
1788
1804
  /** Fallback when an API error has no extractable message. */
1789
1805
  genericRetryError: string;
1806
+ /** Shown when the close prompt's "Save changes" has nothing valid to write. */
1807
+ saveDraftNothingValidError: string;
1790
1808
  /** Used when init has no bank name for disclaimers / result branding. */
1791
1809
  fallbackBankName: string;
1792
1810
  /**
package/dist/index.js CHANGED
@@ -41,7 +41,7 @@ import { ADDITIONAL_OWNERS_LABELS_EN as Z } from "./libs/tesouro-embedded-compon
41
41
  import { BUSINESS_DETAILS_LABELS_EN as Q } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index7.js";
42
42
  import { PERSONAL_DETAILS_LABELS_EN as $ } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index8.js";
43
43
  import { RESULT_LABELS_EN as ee } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index13.js";
44
- import { BankAccountOnboardingWidget as te } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js";
44
+ import { BankAccountOnboardingWidget as te } from "./libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index25.js";
45
45
  import { WidgetSuite as ne } from "./libs/tesouro-embedded-components-react/widget-suite/feature/dist/index16.js";
46
46
  import "./lib/WidgetSuite.js";
47
47
  import "./lib/AcceptDisclosuresWidget.js";
@@ -915,6 +915,17 @@ interface ResultLabels {
915
915
  }
916
916
  declare const RESULT_LABELS_EN: ResultLabels;
917
917
 
918
+ interface UnsavedApplicationDialogLabels {
919
+ title: string;
920
+ description: string;
921
+ /** Saves the work in progress as a draft, then closes onboarding. */
922
+ saveDraftButton: string;
923
+ /** Closes onboarding and throws the unsaved edits away. */
924
+ discardButton: string;
925
+ /** Screen-reader name for the corner close control; returns to the form. */
926
+ closeButton: string;
927
+ }
928
+
918
929
  interface BankAccountOnboardingWidgetLabels {
919
930
  stepIndicator: {
920
931
  business: string;
@@ -926,10 +937,15 @@ interface BankAccountOnboardingWidgetLabels {
926
937
  personalDetails: Partial<PersonalDetailsLabels>;
927
938
  additionalOwners: Partial<AdditionalOwnersLabels>;
928
939
  result: ResultLabels;
940
+ /** The prompt shown when closing with unsaved changes. */
941
+ unsavedApplicationDialog: Partial<UnsavedApplicationDialogLabels>;
929
942
  back: string;
930
943
  cancel: string;
931
944
  next: string;
932
945
  submit: string;
946
+ saveAndClose: string;
947
+ /** Shown after "Save and close" or the close prompt's "Save changes" writes the application. */
948
+ applicationSavedToast: string;
933
949
  businessReviewTitle: string;
934
950
  businessReviewSubtitle: string;
935
951
  personalReviewTitle: string;
@@ -940,6 +956,8 @@ interface BankAccountOnboardingWidgetLabels {
940
956
  submitFailedError: string;
941
957
  /** Fallback when an API error has no extractable message. */
942
958
  genericRetryError: string;
959
+ /** Shown when the close prompt's "Save changes" has nothing valid to write. */
960
+ saveDraftNothingValidError: string;
943
961
  /** Used when init has no bank name for disclaimers / result branding. */
944
962
  fallbackBankName: string;
945
963
  /**
@@ -3,6 +3,6 @@ import { BUSINESS_DETAILS_LABELS_EN as t } from "../libs/tesouro-embedded-compon
3
3
  import { PERSONAL_DETAILS_LABELS_EN as n } from "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index8.js";
4
4
  import { RESULT_LABELS_EN as r } from "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index13.js";
5
5
  import "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js";
6
- import { BankAccountOnboardingWidget as i } from "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js";
6
+ import { BankAccountOnboardingWidget as i } from "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index25.js";
7
7
  import "../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index.js";
8
8
  export { e as ADDITIONAL_OWNERS_LABELS_EN, t as BUSINESS_DETAILS_LABELS_EN, i as BankAccountOnboardingWidget, n as PERSONAL_DETAILS_LABELS_EN, r as RESULT_LABELS_EN };
@@ -965,6 +965,17 @@ interface ResultLabels {
965
965
  fdicDisclaimer: string;
966
966
  }
967
967
 
968
+ interface UnsavedApplicationDialogLabels {
969
+ title: string;
970
+ description: string;
971
+ /** Saves the work in progress as a draft, then closes onboarding. */
972
+ saveDraftButton: string;
973
+ /** Closes onboarding and throws the unsaved edits away. */
974
+ discardButton: string;
975
+ /** Screen-reader name for the corner close control; returns to the form. */
976
+ closeButton: string;
977
+ }
978
+
968
979
  interface BankAccountOnboardingWidgetLabels {
969
980
  stepIndicator: {
970
981
  business: string;
@@ -976,10 +987,15 @@ interface BankAccountOnboardingWidgetLabels {
976
987
  personalDetails: Partial<PersonalDetailsLabels>;
977
988
  additionalOwners: Partial<AdditionalOwnersLabels>;
978
989
  result: ResultLabels;
990
+ /** The prompt shown when closing with unsaved changes. */
991
+ unsavedApplicationDialog: Partial<UnsavedApplicationDialogLabels>;
979
992
  back: string;
980
993
  cancel: string;
981
994
  next: string;
982
995
  submit: string;
996
+ saveAndClose: string;
997
+ /** Shown after "Save and close" or the close prompt's "Save changes" writes the application. */
998
+ applicationSavedToast: string;
983
999
  businessReviewTitle: string;
984
1000
  businessReviewSubtitle: string;
985
1001
  personalReviewTitle: string;
@@ -990,6 +1006,8 @@ interface BankAccountOnboardingWidgetLabels {
990
1006
  submitFailedError: string;
991
1007
  /** Fallback when an API error has no extractable message. */
992
1008
  genericRetryError: string;
1009
+ /** Shown when the close prompt's "Save changes" has nothing valid to write. */
1010
+ saveDraftNothingValidError: string;
993
1011
  /** Used when init has no bank name for disclaimers / result branding. */
994
1012
  fallbackBankName: string;
995
1013
  /**
@@ -1,2 +1,2 @@
1
- import { BankAccountOnboardingWidget as e } from "./index22.js";
1
+ import { BankAccountOnboardingWidget as e } from "./index25.js";
2
2
  export { e as BankAccountOnboardingWidget };
@@ -1,191 +1,89 @@
1
- import { maskIdentifierLast4 as e } from "./index6.js";
2
- import { storedIdentifierFieldDisplay as t, usableStoredTaxIdLast4 as n } from "./index7.js";
3
- import { isValidWebsiteUrl as r } from "./index8.js";
4
- import { formatPhoneNumberInput as i } from "./index2.js";
5
- import { sanitizeZipCodeInput as a } from "./index3.js";
6
- import { sanitizeTaxIdInput as o } from "./index5.js";
7
- import { BUSINESS_DETAILS_LABELS_EN as s } from "../../ui/dist/index7.js";
8
- import { BUSINESS_DETAILS_PANEL_LABELS_EN as c } from "../../ui/dist/index18.js";
9
- import "../../ui/dist/index.js";
1
+ import { isIdentifierEnteredOrStored as e, usableStoredTaxIdLast4 as t } from "./index7.js";
2
+ import { isValidWebsiteUrl as n } from "./index8.js";
3
+ import { isAtLeastMinOwnerAge as r } from "./index9.js";
4
+ import { z as i } from "zod";
10
5
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index10.js
11
- function l(e) {
12
- return {
13
- ...s,
14
- ...e,
15
- companyStructureOptions: {
16
- ...s.companyStructureOptions,
17
- ...e?.companyStructureOptions
18
- },
19
- naicsTitles: {
20
- ...s.naicsTitles,
21
- ...e?.naicsTitles
22
- },
23
- stateTitles: {
24
- ...s.stateTitles,
25
- ...e?.stateTitles
26
- }
27
- };
28
- }
29
- function u(e) {
30
- return e.trim().length > 0 && !r(e);
31
- }
32
- function d(e) {
33
- let t = l(e);
34
- return {
35
- ...c,
36
- companyLegalName: t.companyLegalName,
37
- companyDbaName: t.companyDbaName,
38
- businessAddress: t.businessAddress,
39
- city: t.city,
40
- state: t.state,
41
- statePlaceholder: t.statePlaceholder,
42
- zipCode: t.zipCode,
43
- companyPhoneNumber: t.companyPhoneNumber,
44
- companyStructure: t.companyStructure,
45
- companyStructurePlaceholder: t.companyStructurePlaceholder,
46
- website: t.website,
47
- websiteInvalid: t.websiteInvalid,
48
- taxId: t.taxId,
49
- naicsCode: t.naicsCode,
50
- naicsCodePlaceholder: t.naicsCodePlaceholder
51
- };
6
+ function a(e) {
7
+ return i.object({
8
+ companyLegalName: i.string().min(1),
9
+ companyDbaName: i.string(),
10
+ businessAddress: i.string().min(1),
11
+ city: i.string().min(1),
12
+ state: i.string().min(2),
13
+ zipCode: i.string().min(5),
14
+ companyPhoneNumber: i.string().refine((e) => e.replace(/\D/g, "").length === 10, { message: e.companyPhoneNumberInvalid }),
15
+ companyStructure: s,
16
+ website: i.string().refine((e) => !e || n(e), { message: e.websiteInvalid }),
17
+ taxId: i.string(),
18
+ taxIdOnFileLast4: i.string().optional(),
19
+ taxIdOnFileStructure: s.optional(),
20
+ naicsCode: i.string().min(1)
21
+ });
52
22
  }
53
- function f(t, r) {
54
- let i = d(r.labels), a = l(r.labels), o = n(t), s = t.companyStructure && a.companyStructureOptions[t.companyStructure], c = r.stateOptions.find((e) => e.value === t.state)?.label ?? t.state, u = r.naicsOptions.find((e) => e.value === t.naicsCode)?.label ?? t.naicsCode;
55
- return [
56
- {
57
- label: i.companyLegalName,
58
- value: t.companyLegalName,
59
- testId: "business-details-summary-legal-name"
60
- },
61
- {
62
- label: i.companyDbaName,
63
- value: t.companyDbaName,
64
- testId: "business-details-summary-dba-name"
65
- },
66
- {
67
- label: i.businessAddress,
68
- value: t.businessAddress,
69
- testId: "business-details-summary-address"
70
- },
71
- {
72
- label: i.city,
73
- value: t.city,
74
- testId: "business-details-summary-city"
75
- },
76
- {
77
- label: i.state,
78
- value: c,
79
- testId: "business-details-summary-state"
80
- },
81
- {
82
- label: i.zipCode,
83
- value: t.zipCode,
84
- testId: "business-details-summary-zip-code"
85
- },
86
- {
87
- label: i.companyPhoneNumber,
88
- value: t.companyPhoneNumber,
89
- testId: "business-details-summary-phone"
90
- },
91
- {
92
- label: i.companyStructure,
93
- value: s ?? t.companyStructure,
94
- testId: "business-details-summary-structure"
95
- },
96
- {
97
- label: i.website,
98
- value: t.website,
99
- testId: "business-details-summary-website"
100
- },
101
- {
102
- label: i.taxId,
103
- value: t.taxId ? t.taxId : o ? e(o) : "",
104
- testId: "business-details-summary-tax-id"
105
- },
106
- {
107
- label: i.naicsCode,
108
- value: u,
109
- testId: "business-details-summary-naics"
110
- }
111
- ];
23
+ var o = (n) => e(n.taxId, t(n)), s = i.enum([
24
+ "CORPORATION_PUBLIC",
25
+ "CORPORATION_PRIVATE",
26
+ "CORPORATION_NOT_FOR_PROFIT",
27
+ "LLC",
28
+ "LLP",
29
+ "PARTNERSHIP",
30
+ "SOLE_PROPRIETORSHIP",
31
+ "GOVERNMENT",
32
+ "COOPERATIVE",
33
+ "ASSOCIATION",
34
+ "OTHER"
35
+ ]);
36
+ function c(e) {
37
+ return a(e).extend({
38
+ isAuthorized: i.literal(!0),
39
+ isCheckboxChecked: i.literal(!0)
40
+ }).refine(o, {
41
+ message: e.taxIdInvalid,
42
+ path: ["taxId"]
43
+ });
112
44
  }
113
- function p(e, r) {
114
- let i = l(r);
115
- return t(n(e), i.taxIdOnFileTemplate);
45
+ function l(t) {
46
+ return i.object({
47
+ firstName: i.string().min(1),
48
+ lastName: i.string().min(1),
49
+ dateOfBirth: i.date().refine(r, { message: t.dateOfBirthMinAgeError }),
50
+ ssn: i.string(),
51
+ ssnOnFileLast4: i.string().optional(),
52
+ homeAddress: i.string().min(1),
53
+ city: i.string().min(1),
54
+ state: i.string().min(2),
55
+ zipCode: i.string().min(5),
56
+ mobilePhoneNumber: i.string().refine((e) => e.replace(/\D/g, "").length === 10, { message: t.mobilePhoneNumberInvalid }),
57
+ workEmail: i.email(),
58
+ ownsOver25Percent: i.boolean(),
59
+ ownershipPercentage: i.number().min(0).max(100).nullable()
60
+ }).refine((t) => e(t.ssn, t.ssnOnFileLast4), {
61
+ message: t.ssnInvalid,
62
+ path: ["ssn"]
63
+ }).refine((e) => e.ownsOver25Percent === !1 || e.ownershipPercentage !== null && e.ownershipPercentage >= 25 && e.ownershipPercentage <= 100, {
64
+ message: t.ownershipPercentageRangeError,
65
+ path: ["ownershipPercentage"]
66
+ });
116
67
  }
117
- function m(e, t, n) {
118
- let r = l(n.labels), s = [
119
- "CORPORATION_PUBLIC",
120
- "CORPORATION_PRIVATE",
121
- "CORPORATION_NOT_FOR_PROFIT",
122
- "LLC",
123
- "LLP",
124
- "PARTNERSHIP",
125
- "SOLE_PROPRIETORSHIP",
126
- "GOVERNMENT",
127
- "COOPERATIVE",
128
- "ASSOCIATION",
129
- "OTHER"
130
- ].map((e) => ({
131
- value: e,
132
- label: r.companyStructureOptions[e]
133
- })), c = (n) => (r) => t({
134
- ...e,
135
- [n]: r
68
+ function u(t) {
69
+ return i.object({
70
+ id: i.string().optional(),
71
+ firstName: i.string().min(1),
72
+ lastName: i.string().min(1),
73
+ dateOfBirth: i.date().refine(r, { message: t.dateOfBirthMinAgeError }),
74
+ ssn: i.string(),
75
+ ssnOnFileLast4: i.string().optional(),
76
+ homeAddress: i.string().min(1),
77
+ city: i.string().min(1),
78
+ state: i.string().min(2),
79
+ zipCode: i.string().min(5),
80
+ mobilePhoneNumber: i.string().refine((e) => e.replace(/\D/g, "").length === 10, { message: t.mobilePhoneNumberInvalid }),
81
+ ownsOver25Percent: i.literal(!0),
82
+ ownershipPercentage: i.number().min(25).max(100)
83
+ }).refine((t) => e(t.ssn, t.ssnOnFileLast4), {
84
+ message: t.ssnInvalid,
85
+ path: ["ssn"]
136
86
  });
137
- return {
138
- companyLegalName: {
139
- value: e.companyLegalName,
140
- onValueChange: c("companyLegalName")
141
- },
142
- companyDbaName: {
143
- value: e.companyDbaName,
144
- onValueChange: c("companyDbaName")
145
- },
146
- businessAddress: {
147
- value: e.businessAddress,
148
- onValueChange: c("businessAddress")
149
- },
150
- city: {
151
- value: e.city,
152
- onValueChange: c("city")
153
- },
154
- state: {
155
- value: e.state,
156
- onValueChange: c("state"),
157
- options: n.stateOptions
158
- },
159
- zipCode: {
160
- value: e.zipCode,
161
- onValueChange: (e) => c("zipCode")(a(e))
162
- },
163
- companyPhoneNumber: {
164
- value: e.companyPhoneNumber,
165
- onValueChange: (e) => c("companyPhoneNumber")(i(e))
166
- },
167
- companyStructure: {
168
- value: e.companyStructure,
169
- onValueChange: (n) => t({
170
- ...e,
171
- companyStructure: n
172
- }),
173
- options: s
174
- },
175
- website: {
176
- value: e.website,
177
- onValueChange: c("website")
178
- },
179
- taxId: {
180
- value: e.taxId,
181
- onValueChange: (e) => c("taxId")(o(e))
182
- },
183
- naicsCode: {
184
- value: e.naicsCode,
185
- onValueChange: c("naicsCode"),
186
- options: n.naicsOptions
187
- }
188
- };
189
87
  }
190
88
  //#endregion
191
- export { m as buildBusinessDetailsEditFields, d as buildBusinessDetailsPanelLabels, f as buildBusinessDetailsSummaryRows, p as buildTaxIdFieldDisplay, u as isBusinessWebsiteInvalid, l as mergeBusinessDetailsLabels };
89
+ export { u as buildAdditionalOwnerSchema, a as buildBusinessDetailsPanelFieldsSchema, c as buildBusinessDetailsSchema, l as buildPersonalDetailsSchema, o as isTaxIdSatisfied };
@@ -1,31 +1,191 @@
1
+ import { maskIdentifierLast4 as e } from "./index6.js";
2
+ import { storedIdentifierFieldDisplay as t, usableStoredTaxIdLast4 as n } from "./index7.js";
3
+ import { isValidWebsiteUrl as r } from "./index8.js";
4
+ import { formatPhoneNumberInput as i } from "./index2.js";
5
+ import { sanitizeZipCodeInput as a } from "./index3.js";
6
+ import { sanitizeTaxIdInput as o } from "./index5.js";
7
+ import { BUSINESS_DETAILS_LABELS_EN as s } from "../../ui/dist/index7.js";
8
+ import { BUSINESS_DETAILS_PANEL_LABELS_EN as c } from "../../ui/dist/index18.js";
9
+ import "../../ui/dist/index.js";
1
10
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index11.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
- };
11
+ function l(e) {
12
+ return {
13
+ ...s,
14
+ ...e,
15
+ companyStructureOptions: {
16
+ ...s.companyStructureOptions,
17
+ ...e?.companyStructureOptions
18
+ },
19
+ naicsTitles: {
20
+ ...s.naicsTitles,
21
+ ...e?.naicsTitles
22
+ },
23
+ stateTitles: {
24
+ ...s.stateTitles,
25
+ ...e?.stateTitles
26
+ }
27
+ };
28
+ }
29
+ function u(e) {
30
+ return e.trim().length > 0 && !r(e);
31
+ }
32
+ function d(e) {
33
+ let t = l(e);
34
+ return {
35
+ ...c,
36
+ companyLegalName: t.companyLegalName,
37
+ companyDbaName: t.companyDbaName,
38
+ businessAddress: t.businessAddress,
39
+ city: t.city,
40
+ state: t.state,
41
+ statePlaceholder: t.statePlaceholder,
42
+ zipCode: t.zipCode,
43
+ companyPhoneNumber: t.companyPhoneNumber,
44
+ companyStructure: t.companyStructure,
45
+ companyStructurePlaceholder: t.companyStructurePlaceholder,
46
+ website: t.website,
47
+ websiteInvalid: t.websiteInvalid,
48
+ taxId: t.taxId,
49
+ naicsCode: t.naicsCode,
50
+ naicsCodePlaceholder: t.naicsCodePlaceholder
51
+ };
52
+ }
53
+ function f(t, r) {
54
+ let i = d(r.labels), a = l(r.labels), o = n(t), s = t.companyStructure && a.companyStructureOptions[t.companyStructure], c = r.stateOptions.find((e) => e.value === t.state)?.label ?? t.state, u = r.naicsOptions.find((e) => e.value === t.naicsCode)?.label ?? t.naicsCode;
55
+ return [
56
+ {
57
+ label: i.companyLegalName,
58
+ value: t.companyLegalName,
59
+ testId: "business-details-summary-legal-name"
60
+ },
61
+ {
62
+ label: i.companyDbaName,
63
+ value: t.companyDbaName,
64
+ testId: "business-details-summary-dba-name"
65
+ },
66
+ {
67
+ label: i.businessAddress,
68
+ value: t.businessAddress,
69
+ testId: "business-details-summary-address"
70
+ },
71
+ {
72
+ label: i.city,
73
+ value: t.city,
74
+ testId: "business-details-summary-city"
75
+ },
76
+ {
77
+ label: i.state,
78
+ value: c,
79
+ testId: "business-details-summary-state"
80
+ },
81
+ {
82
+ label: i.zipCode,
83
+ value: t.zipCode,
84
+ testId: "business-details-summary-zip-code"
85
+ },
86
+ {
87
+ label: i.companyPhoneNumber,
88
+ value: t.companyPhoneNumber,
89
+ testId: "business-details-summary-phone"
90
+ },
91
+ {
92
+ label: i.companyStructure,
93
+ value: s ?? t.companyStructure,
94
+ testId: "business-details-summary-structure"
95
+ },
96
+ {
97
+ label: i.website,
98
+ value: t.website,
99
+ testId: "business-details-summary-website"
100
+ },
101
+ {
102
+ label: i.taxId,
103
+ value: t.taxId ? t.taxId : o ? e(o) : "",
104
+ testId: "business-details-summary-tax-id"
105
+ },
106
+ {
107
+ label: i.naicsCode,
108
+ value: u,
109
+ testId: "business-details-summary-naics"
110
+ }
111
+ ];
112
+ }
113
+ function p(e, r) {
114
+ let i = l(r);
115
+ return t(n(e), i.taxIdOnFileTemplate);
116
+ }
117
+ function m(e, t, n) {
118
+ let r = l(n.labels), s = [
119
+ "CORPORATION_PUBLIC",
120
+ "CORPORATION_PRIVATE",
121
+ "CORPORATION_NOT_FOR_PROFIT",
122
+ "LLC",
123
+ "LLP",
124
+ "PARTNERSHIP",
125
+ "SOLE_PROPRIETORSHIP",
126
+ "GOVERNMENT",
127
+ "COOPERATIVE",
128
+ "ASSOCIATION",
129
+ "OTHER"
130
+ ].map((e) => ({
131
+ value: e,
132
+ label: r.companyStructureOptions[e]
133
+ })), c = (n) => (r) => t({
134
+ ...e,
135
+ [n]: r
136
+ });
137
+ return {
138
+ companyLegalName: {
139
+ value: e.companyLegalName,
140
+ onValueChange: c("companyLegalName")
141
+ },
142
+ companyDbaName: {
143
+ value: e.companyDbaName,
144
+ onValueChange: c("companyDbaName")
145
+ },
146
+ businessAddress: {
147
+ value: e.businessAddress,
148
+ onValueChange: c("businessAddress")
149
+ },
150
+ city: {
151
+ value: e.city,
152
+ onValueChange: c("city")
153
+ },
154
+ state: {
155
+ value: e.state,
156
+ onValueChange: c("state"),
157
+ options: n.stateOptions
158
+ },
159
+ zipCode: {
160
+ value: e.zipCode,
161
+ onValueChange: (e) => c("zipCode")(a(e))
162
+ },
163
+ companyPhoneNumber: {
164
+ value: e.companyPhoneNumber,
165
+ onValueChange: (e) => c("companyPhoneNumber")(i(e))
166
+ },
167
+ companyStructure: {
168
+ value: e.companyStructure,
169
+ onValueChange: (n) => t({
170
+ ...e,
171
+ companyStructure: n
172
+ }),
173
+ options: s
174
+ },
175
+ website: {
176
+ value: e.website,
177
+ onValueChange: c("website")
178
+ },
179
+ taxId: {
180
+ value: e.taxId,
181
+ onValueChange: (e) => c("taxId")(o(e))
182
+ },
183
+ naicsCode: {
184
+ value: e.naicsCode,
185
+ onValueChange: c("naicsCode"),
186
+ options: n.naicsOptions
187
+ }
188
+ };
189
+ }
30
190
  //#endregion
31
- export { e as bankAccountOnboardingTestIds };
191
+ export { m as buildBusinessDetailsEditFields, d as buildBusinessDetailsPanelLabels, f as buildBusinessDetailsSummaryRows, p as buildTaxIdFieldDisplay, u as isBusinessWebsiteInvalid, l as mergeBusinessDetailsLabels };