@tesouro/embedded-components-react 0.3.16 → 0.3.18
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.
- package/dist/index.d.ts +22 -1
- package/dist/index.js +10 -10
- package/dist/lib/AcceptDisclosuresWidget.d.ts +11 -1
- package/dist/lib/AcceptDisclosuresWidget.js +1 -1
- package/dist/lib/BalancesWidget.js +1 -1
- package/dist/lib/BankAccountOnboardingWidget.d.ts +21 -21
- package/dist/lib/BankAccountOnboardingWidget.js +1 -1
- package/dist/lib/CardsWidget.js +1 -1
- package/dist/lib/ExpenseApprovalPoliciesWidget.js +1 -1
- package/dist/lib/ExpenseManagementWidget.js +1 -1
- package/dist/lib/InsightsWidget.js +1 -1
- package/dist/lib/ReceiptMatchWidget.js +1 -1
- package/dist/lib/TransfersWidget.js +1 -1
- package/dist/lib/UploadReceiptWidget.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index4.js +10 -140
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index5.js +152 -0
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js +19 -19
- package/dist/libs/tesouro-embedded-components-react/balances-widget/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/balances-widget/feature/dist/index4.js +10 -11
- package/dist/libs/tesouro-embedded-components-react/balances-widget/feature/dist/index5.js +15 -64
- package/dist/libs/tesouro-embedded-components-react/balances-widget/feature/dist/index6.js +75 -0
- package/dist/libs/tesouro-embedded-components-react/balances-widget/ui/dist/lib/BalancesWidget/BalancesWidget.js +16 -16
- package/dist/libs/tesouro-embedded-components-react/balances-widget/ui/dist/lib/BalancesWidget/SingleBalance/SingleBalance.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index10.js +109 -169
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index11.js +170 -63
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index12.js +73 -81
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index13.js +77 -101
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index14.js +110 -83
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index15.js +91 -7
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index16.js +7 -28
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js +26 -320
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index18.js +341 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index9.js +29 -100
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index11.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index15.js +32 -32
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index16.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index18.js +14 -10
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index19.js +42 -42
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index2.js +80 -77
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index20.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index22.js +14 -10
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index23.js +16 -16
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index27.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index3.js +7 -6
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index5.js +23 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +28 -28
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/index.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/ui/dist/lib/CardDetailsPanel/CardDetailsHeader.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index.js +3 -3
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index3.js +4 -23
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index4.js +23 -24
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index5.js +24 -30
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index6.js +28 -55
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index7.js +54 -209
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index8.js +206 -81
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index9.js +95 -0
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardFaceSwatch.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +31 -30
- package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListRow.js +11 -10
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index10.js +1 -255
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index11.js +253 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index12.js +2 -71
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index13.js +73 -0
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index5.js +7 -218
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index6.js +219 -79
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index7.js +89 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index8.js +2 -47
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index9.js +49 -1
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ApprovalRuleCard.js +2 -2
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ApprovalRuleForm.js +32 -32
- package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ExpenseApprovalsPage.js +11 -8
- package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index10.js +12 -14
- package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index11.js +21 -62
- package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index12.js +73 -0
- package/dist/libs/tesouro-embedded-components-react/insights-widget/ui/dist/lib/InsightsWidget/InsightsWidget.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/insights-widget/ui/dist/lib/InsightsWidget/SingleInsight/SingleInsight.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index5.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/ApprovalPoliciesSettings.js +67 -46
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/testIds.js +26 -0
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/useApprovalPolicyRules.js +151 -135
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index11.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index14.js +17 -17
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index16.js +17 -15
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index18.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index20.js +16 -13
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index3.js +13 -13
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index5.js +11 -11
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index7.js +5 -5
- package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index9.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShell.js +21 -20
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShellOverlayPortal.js +10 -10
- package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/OnboardingShell/OnboardingShellScrollRegion.js +17 -17
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index5.js +18 -99
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index6.js +116 -19
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index7.js +28 -0
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/ReviewTransferStep.js +9 -9
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/TransferMoneyModal.js +13 -11
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransferMoneyModal/TransferResultStep.js +7 -7
- package/dist/libs/tesouro-embedded-components-react/transfers-widget/ui/dist/lib/TransfersWidget/TransfersWidget.js +19 -19
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index7.js +4 -4
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
- package/package.json +1 -1
|
@@ -1,87 +1,79 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { bankAccountOnboardingTestIds as e } from "./index9.js";
|
|
6
|
+
import { AboutYouPanel as t } from "../../ui/dist/index22.js";
|
|
7
|
+
import "../../ui/dist/index.js";
|
|
3
8
|
import { getMaxBirthDate as n, isAtLeastMinOwnerAge as r } from "./index7.js";
|
|
4
|
-
import {
|
|
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";
|
|
5
13
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index12.js
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
mobilePhoneNumber: e(n.mobilePhoneNumber),
|
|
25
|
-
ownsOver25Percent: n.ownershipPercentage === null ? null : n.ownershipPercentage >= 25
|
|
26
|
-
};
|
|
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"]
|
|
31
|
+
});
|
|
27
32
|
}
|
|
28
|
-
function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
options: n.stateOptions
|
|
71
|
-
},
|
|
72
|
-
zipCode: {
|
|
73
|
-
value: e.zipCode,
|
|
74
|
-
onValueChange: (e) => r("zipCode")(e)
|
|
75
|
-
},
|
|
76
|
-
mobilePhoneNumber: {
|
|
77
|
-
value: e.mobilePhoneNumber,
|
|
78
|
-
onValueChange: (e) => r("mobilePhoneNumber")(e)
|
|
79
|
-
},
|
|
80
|
-
ownershipPercentage: {
|
|
81
|
-
value: e.ownershipPercentage,
|
|
82
|
-
onValueChange: r("ownershipPercentage")
|
|
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
|
|
74
|
+
}
|
|
83
75
|
}
|
|
84
|
-
};
|
|
76
|
+
});
|
|
85
77
|
}
|
|
86
78
|
//#endregion
|
|
87
|
-
export {
|
|
79
|
+
export { g as PersonalDetailsStep };
|
|
@@ -1,111 +1,87 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { ADDITIONAL_OWNERS_LABELS_EN as e } from "../../ui/dist/index4.js";
|
|
6
|
-
import { AdditionalOwnersForm as t } from "../../ui/dist/index5.js";
|
|
7
|
-
import "../../ui/dist/index.js";
|
|
8
|
-
import { isAtLeastMinOwnerAge as n } from "./index7.js";
|
|
9
|
-
import { EMPTY_ADDITIONAL_OWNER as r, buildAdditionalOwnerEditDisplay as i, buildAdditionalOwnerEditFields as a, normalizeAdditionalOwnerDraft as o } from "./index12.js";
|
|
10
|
-
import { useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
11
|
-
import { jsx as d } from "react/jsx-runtime";
|
|
12
|
-
import { z as f } from "zod";
|
|
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";
|
|
13
5
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index13.js
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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) {
|
|
20
|
+
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
|
|
26
|
+
};
|
|
34
27
|
}
|
|
35
|
-
function
|
|
28
|
+
function l(e) {
|
|
36
29
|
return {
|
|
37
|
-
|
|
38
|
-
|
|
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)
|
|
39
35
|
};
|
|
40
36
|
}
|
|
41
|
-
function
|
|
42
|
-
let
|
|
37
|
+
function u(e, t, n) {
|
|
38
|
+
let r = (n) => (r) => t(c({
|
|
43
39
|
...e,
|
|
44
|
-
|
|
45
|
-
})
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}, G = (e) => {
|
|
59
|
-
let t = n[e];
|
|
60
|
-
k({
|
|
61
|
-
index: e,
|
|
62
|
-
displayName: `${t.firstName} ${t.lastName}`.trim()
|
|
63
|
-
});
|
|
64
|
-
}, K = () => {
|
|
65
|
-
O && (f(n.filter((e, t) => t !== O.index)), k(null));
|
|
66
|
-
}, q = () => {
|
|
67
|
-
k(null);
|
|
68
|
-
}, J = w ? {
|
|
69
|
-
fields: a(w, M, { stateOptions: v }),
|
|
70
|
-
display: i(w),
|
|
71
|
-
isExisting: E !== null,
|
|
72
|
-
isValid: z,
|
|
73
|
-
ssnRevealed: A,
|
|
74
|
-
ssnToggleAriaLabel: A ? S.ssnHide : S.ssnShow,
|
|
75
|
-
onToggleSsnVisibility: () => j((e) => !e),
|
|
76
|
-
onSubmit: () => {
|
|
77
|
-
if (!w) return;
|
|
78
|
-
let e = C.safeParse(w);
|
|
79
|
-
if (e.success) {
|
|
80
|
-
if (E === null) f([...n, e.data]);
|
|
81
|
-
else {
|
|
82
|
-
let t = [...n];
|
|
83
|
-
t[E] = e.data, f(t);
|
|
84
|
-
}
|
|
85
|
-
T(null), D(null), j(!1);
|
|
86
|
-
}
|
|
40
|
+
[n]: r
|
|
41
|
+
}));
|
|
42
|
+
return {
|
|
43
|
+
firstName: {
|
|
44
|
+
value: e.firstName,
|
|
45
|
+
onValueChange: r("firstName")
|
|
46
|
+
},
|
|
47
|
+
lastName: {
|
|
48
|
+
value: e.lastName,
|
|
49
|
+
onValueChange: r("lastName")
|
|
50
|
+
},
|
|
51
|
+
dateOfBirth: {
|
|
52
|
+
value: e.dateOfBirth,
|
|
53
|
+
onValueChange: r("dateOfBirth")
|
|
87
54
|
},
|
|
88
|
-
|
|
89
|
-
|
|
55
|
+
ssn: {
|
|
56
|
+
value: e.ssn,
|
|
57
|
+
onValueChange: (e) => r("ssn")(e)
|
|
58
|
+
},
|
|
59
|
+
homeAddress: {
|
|
60
|
+
value: e.homeAddress,
|
|
61
|
+
onValueChange: r("homeAddress")
|
|
62
|
+
},
|
|
63
|
+
city: {
|
|
64
|
+
value: e.city,
|
|
65
|
+
onValueChange: r("city")
|
|
66
|
+
},
|
|
67
|
+
state: {
|
|
68
|
+
value: e.state,
|
|
69
|
+
onValueChange: r("state"),
|
|
70
|
+
options: n.stateOptions
|
|
71
|
+
},
|
|
72
|
+
zipCode: {
|
|
73
|
+
value: e.zipCode,
|
|
74
|
+
onValueChange: (e) => r("zipCode")(e)
|
|
75
|
+
},
|
|
76
|
+
mobilePhoneNumber: {
|
|
77
|
+
value: e.mobilePhoneNumber,
|
|
78
|
+
onValueChange: (e) => r("mobilePhoneNumber")(e)
|
|
79
|
+
},
|
|
80
|
+
ownershipPercentage: {
|
|
81
|
+
value: e.ownershipPercentage,
|
|
82
|
+
onValueChange: r("ownershipPercentage")
|
|
90
83
|
}
|
|
91
|
-
}
|
|
92
|
-
return /* @__PURE__ */ d(t, {
|
|
93
|
-
ownerRows: n.map(g),
|
|
94
|
-
primaryOwnerName: h,
|
|
95
|
-
primaryOwnerShareDisplay: I,
|
|
96
|
-
showPrimaryOwner: L,
|
|
97
|
-
totalOwnershipError: P,
|
|
98
|
-
addOwnerDisabled: F,
|
|
99
|
-
onAddOwner: U,
|
|
100
|
-
onEditOwner: W,
|
|
101
|
-
onDeleteOwnerRequest: G,
|
|
102
|
-
deletingOwnerName: O?.displayName ?? null,
|
|
103
|
-
onDeleteOwnerConfirm: K,
|
|
104
|
-
onDeleteOwnerCancel: q,
|
|
105
|
-
editingOverlay: J,
|
|
106
|
-
isSubmitting: b,
|
|
107
|
-
labels: x
|
|
108
|
-
});
|
|
84
|
+
};
|
|
109
85
|
}
|
|
110
86
|
//#endregion
|
|
111
|
-
export {
|
|
87
|
+
export { s as EMPTY_ADDITIONAL_OWNER, l as buildAdditionalOwnerEditDisplay, u as buildAdditionalOwnerEditFields, c as normalizeAdditionalOwnerDraft };
|
|
@@ -1,93 +1,120 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { bankAccountOnboardingTestIds as e } from "./index9.js";
|
|
6
|
+
import { ADDITIONAL_OWNERS_LABELS_EN as t } from "../../ui/dist/index4.js";
|
|
7
|
+
import { AdditionalOwnersForm as n } from "../../ui/dist/index5.js";
|
|
8
|
+
import "../../ui/dist/index.js";
|
|
9
|
+
import { isAtLeastMinOwnerAge as r } from "./index7.js";
|
|
10
|
+
import { EMPTY_ADDITIONAL_OWNER as i, buildAdditionalOwnerEditDisplay as a, buildAdditionalOwnerEditFields as o, normalizeAdditionalOwnerDraft as s } from "./index13.js";
|
|
11
|
+
import { useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
12
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
13
|
+
import { z as p } from "zod";
|
|
1
14
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index14.js
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
15
|
+
function m(e) {
|
|
16
|
+
return p.object({
|
|
17
|
+
firstName: p.string().min(1),
|
|
18
|
+
lastName: p.string().min(1),
|
|
19
|
+
dateOfBirth: p.date().refine(r, { message: e.dateOfBirthMinAgeError }),
|
|
20
|
+
ssn: p.string().refine((e) => /^\d{9}$/.test(e), { message: e.ssnInvalid }),
|
|
21
|
+
homeAddress: p.string().min(1),
|
|
22
|
+
city: p.string().min(1),
|
|
23
|
+
state: p.string().min(2),
|
|
24
|
+
zipCode: p.string().min(5),
|
|
25
|
+
mobilePhoneNumber: p.string().refine((e) => e.replace(/\D/g, "").length === 10, { message: e.mobilePhoneNumberInvalid }),
|
|
26
|
+
ownsOver25Percent: p.literal(!0),
|
|
27
|
+
ownershipPercentage: p.number().min(25).max(100)
|
|
28
|
+
});
|
|
11
29
|
}
|
|
12
|
-
function
|
|
13
|
-
return
|
|
14
|
-
legalName: t.companyLegalName,
|
|
15
|
-
dbaName: t.companyDbaName.trim() || null,
|
|
16
|
-
address: n({
|
|
17
|
-
address1: t.businessAddress,
|
|
18
|
-
city: t.city,
|
|
19
|
-
state: t.state,
|
|
20
|
-
postalCode: t.zipCode
|
|
21
|
-
}),
|
|
22
|
-
phoneNumber: e(t.companyPhoneNumber),
|
|
23
|
-
businessStructureType: t.companyStructure,
|
|
24
|
-
website: t.website.trim() || null,
|
|
25
|
-
taxId: {
|
|
26
|
-
type: t.companyStructure === "SOLE_PROPRIETORSHIP" ? "SSN" : "EIN",
|
|
27
|
-
value: t.taxId
|
|
28
|
-
},
|
|
29
|
-
northAmericanIndustryClassificationSystemCode: t.naicsCode
|
|
30
|
-
};
|
|
30
|
+
function h(e) {
|
|
31
|
+
return e.ownershipPercentage !== null && e.ownershipPercentage >= 25 ? e.ownershipPercentage : 0;
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
-
return {
|
|
34
|
-
isLegallyAuthorized: e.isAuthorized,
|
|
35
|
-
hasAcceptedDisclosures: e.isCheckboxChecked
|
|
36
|
-
};
|
|
33
|
+
function g(e) {
|
|
34
|
+
return `${h(e)}%`;
|
|
37
35
|
}
|
|
38
|
-
|
|
39
|
-
function o(r, { isSoleProprietor: i = !1 } = {}) {
|
|
36
|
+
function _(e) {
|
|
40
37
|
return {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
birthDate: t(r.dateOfBirth),
|
|
44
|
-
personalIdentificationNumber: {
|
|
45
|
-
type: "SSN",
|
|
46
|
-
value: r.ssn
|
|
47
|
-
},
|
|
48
|
-
homeAddress: n({
|
|
49
|
-
address1: r.homeAddress,
|
|
50
|
-
city: r.city,
|
|
51
|
-
state: r.state,
|
|
52
|
-
postalCode: r.zipCode
|
|
53
|
-
}),
|
|
54
|
-
mobilePhoneNumber: e(r.mobilePhoneNumber),
|
|
55
|
-
workEmailAddress: r.workEmail,
|
|
56
|
-
ownershipPercentage: i ? a : r.ownsOver25Percent && r.ownershipPercentage !== null ? r.ownershipPercentage / 100 : 0
|
|
38
|
+
name: `${e.firstName} ${e.lastName}`.trim(),
|
|
39
|
+
shareDisplay: g(e)
|
|
57
40
|
};
|
|
58
41
|
}
|
|
59
|
-
function
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
42
|
+
function v({ owners: r, onOwnersChange: p, primaryOwnerName: g, primaryOwnerPercentage: v, stateOptions: y, onSnapshotChange: b, isSubmitting: x, labels: S }) {
|
|
43
|
+
let C = l(() => ({
|
|
44
|
+
...t,
|
|
45
|
+
...S
|
|
46
|
+
}), [S]), w = l(() => m(C), [C]), [T, E] = d(null), [D, O] = d(null), [k, A] = d(null), [j, M] = d(!1), N = (e) => {
|
|
47
|
+
E(s(e));
|
|
48
|
+
}, P = v + r.reduce((e, t) => e + h(t), 0), F = P > 100 ? C.totalOwnershipExceedsTemplate(P) : null, I = P > 75, L = `${v}%`, R = v >= 25, z = r.every((e) => w.safeParse(e).success), B = T !== null && w.safeParse(T).success, V = z && F === null && T === null && k === null ? r : null, H = JSON.stringify({ snapshot: V?.map((e) => ({
|
|
49
|
+
...e,
|
|
50
|
+
dateOfBirth: e.dateOfBirth?.toISOString()
|
|
51
|
+
})) }), U = u(b);
|
|
52
|
+
U.current = b, c(() => {
|
|
53
|
+
U.current(V);
|
|
54
|
+
}, [H]);
|
|
55
|
+
let W = () => {
|
|
56
|
+
O(null), M(!1), E({ ...i });
|
|
57
|
+
}, G = (e) => {
|
|
58
|
+
O(e), M(!1), E(s({ ...r[e] }));
|
|
59
|
+
}, K = (e) => {
|
|
60
|
+
let t = r[e];
|
|
61
|
+
A({
|
|
62
|
+
index: e,
|
|
63
|
+
displayName: `${t.firstName} ${t.lastName}`.trim()
|
|
64
|
+
});
|
|
65
|
+
}, q = () => {
|
|
66
|
+
k && (p(r.filter((e, t) => t !== k.index)), A(null));
|
|
67
|
+
}, J = () => {
|
|
68
|
+
A(null);
|
|
69
|
+
}, Y = T ? {
|
|
70
|
+
fields: o(T, N, { stateOptions: y }),
|
|
71
|
+
display: a(T),
|
|
72
|
+
isExisting: D !== null,
|
|
73
|
+
isValid: B,
|
|
74
|
+
ssnRevealed: j,
|
|
75
|
+
ssnToggleAriaLabel: j ? C.ssnHide : C.ssnShow,
|
|
76
|
+
onToggleSsnVisibility: () => M((e) => !e),
|
|
77
|
+
onSubmit: () => {
|
|
78
|
+
if (!T) return;
|
|
79
|
+
let e = w.safeParse(T);
|
|
80
|
+
if (e.success) {
|
|
81
|
+
if (D === null) p([...r, e.data]);
|
|
82
|
+
else {
|
|
83
|
+
let t = [...r];
|
|
84
|
+
t[D] = e.data, p(t);
|
|
85
|
+
}
|
|
86
|
+
E(null), O(null), M(!1);
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
onCancel: () => {
|
|
90
|
+
E(null), O(null), M(!1);
|
|
75
91
|
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
92
|
+
} : null;
|
|
93
|
+
return /* @__PURE__ */ f(n, {
|
|
94
|
+
ownerRows: r.map(_),
|
|
95
|
+
primaryOwnerName: g,
|
|
96
|
+
primaryOwnerShareDisplay: L,
|
|
97
|
+
showPrimaryOwner: R,
|
|
98
|
+
totalOwnershipError: F,
|
|
99
|
+
addOwnerDisabled: I,
|
|
100
|
+
onAddOwner: W,
|
|
101
|
+
onEditOwner: G,
|
|
102
|
+
onDeleteOwnerRequest: K,
|
|
103
|
+
deletingOwnerName: k?.displayName ?? null,
|
|
104
|
+
onDeleteOwnerConfirm: q,
|
|
105
|
+
onDeleteOwnerCancel: J,
|
|
106
|
+
editingOverlay: Y,
|
|
107
|
+
isSubmitting: x,
|
|
108
|
+
labels: S,
|
|
109
|
+
testIds: {
|
|
110
|
+
addOwnerButton: e.addOwnerButton,
|
|
111
|
+
overlay: { root: e.shellOverlay },
|
|
112
|
+
deleteOverlay: {
|
|
113
|
+
root: e.ownerDeleteOverlay,
|
|
114
|
+
content: e.ownerDeleteContent
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
});
|
|
91
118
|
}
|
|
92
119
|
//#endregion
|
|
93
|
-
export {
|
|
120
|
+
export { v as AdditionalOwnersStep, h as getAdditionalOwnerShare };
|
|
@@ -1,9 +1,93 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index15.js
|
|
2
|
-
var e = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
var e = (e) => e.replace(/\D/g, "").slice(0, 10), t = (e) => `${e.getFullYear().toString().padStart(4, "0")}-${(e.getMonth() + 1).toString().padStart(2, "0")}-${e.getDate().toString().padStart(2, "0")}`;
|
|
3
|
+
function n(e) {
|
|
4
|
+
return {
|
|
5
|
+
address1: e.address1,
|
|
6
|
+
city: e.city,
|
|
7
|
+
state: e.state,
|
|
8
|
+
postalCode: e.postalCode,
|
|
9
|
+
countryCode: "USA"
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function r(t) {
|
|
13
|
+
return {
|
|
14
|
+
legalName: t.companyLegalName,
|
|
15
|
+
dbaName: t.companyDbaName.trim() || null,
|
|
16
|
+
address: n({
|
|
17
|
+
address1: t.businessAddress,
|
|
18
|
+
city: t.city,
|
|
19
|
+
state: t.state,
|
|
20
|
+
postalCode: t.zipCode
|
|
21
|
+
}),
|
|
22
|
+
phoneNumber: e(t.companyPhoneNumber),
|
|
23
|
+
businessStructureType: t.companyStructure,
|
|
24
|
+
website: t.website.trim() || null,
|
|
25
|
+
taxId: {
|
|
26
|
+
type: t.companyStructure === "SOLE_PROPRIETORSHIP" ? "SSN" : "EIN",
|
|
27
|
+
value: t.taxId
|
|
28
|
+
},
|
|
29
|
+
northAmericanIndustryClassificationSystemCode: t.naicsCode
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function i(e) {
|
|
33
|
+
return {
|
|
34
|
+
isLegallyAuthorized: e.isAuthorized,
|
|
35
|
+
hasAcceptedDisclosures: e.isCheckboxChecked
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
var a = 1;
|
|
39
|
+
function o(r, { isSoleProprietor: i = !1 } = {}) {
|
|
40
|
+
return {
|
|
41
|
+
firstName: r.firstName,
|
|
42
|
+
lastName: r.lastName,
|
|
43
|
+
birthDate: t(r.dateOfBirth),
|
|
44
|
+
personalIdentificationNumber: {
|
|
45
|
+
type: "SSN",
|
|
46
|
+
value: r.ssn
|
|
47
|
+
},
|
|
48
|
+
homeAddress: n({
|
|
49
|
+
address1: r.homeAddress,
|
|
50
|
+
city: r.city,
|
|
51
|
+
state: r.state,
|
|
52
|
+
postalCode: r.zipCode
|
|
53
|
+
}),
|
|
54
|
+
mobilePhoneNumber: e(r.mobilePhoneNumber),
|
|
55
|
+
workEmailAddress: r.workEmail,
|
|
56
|
+
ownershipPercentage: i ? a : r.ownsOver25Percent && r.ownershipPercentage !== null ? r.ownershipPercentage / 100 : 0
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function s(r) {
|
|
60
|
+
return r.map((r) => ({
|
|
61
|
+
firstName: r.firstName,
|
|
62
|
+
lastName: r.lastName,
|
|
63
|
+
birthDate: r.dateOfBirth ? t(r.dateOfBirth) : void 0,
|
|
64
|
+
homeAddress: n({
|
|
65
|
+
address1: r.homeAddress,
|
|
66
|
+
city: r.city,
|
|
67
|
+
state: r.state,
|
|
68
|
+
postalCode: r.zipCode
|
|
69
|
+
}),
|
|
70
|
+
mobilePhoneNumber: e(r.mobilePhoneNumber),
|
|
71
|
+
ownershipPercentage: r.ownershipPercentage !== null && r.ownershipPercentage >= 25 ? r.ownershipPercentage / 100 : 0,
|
|
72
|
+
personalIdentificationNumber: {
|
|
73
|
+
type: "SSN",
|
|
74
|
+
value: r.ssn
|
|
75
|
+
}
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
function c(e) {
|
|
79
|
+
return {
|
|
80
|
+
businessDetails: r(e),
|
|
81
|
+
applicant: i(e)
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
function l(e) {
|
|
85
|
+
let t = e.businessDetails?.companyStructure === "SOLE_PROPRIETORSHIP";
|
|
86
|
+
return {
|
|
87
|
+
...e.businessDetails && { businessDetails: r(e.businessDetails) },
|
|
88
|
+
...e.applicant && { applicant: o(e.applicant, { isSoleProprietor: t }) },
|
|
89
|
+
...(t || e.businessOwners !== void 0) && { businessOwners: !t && e.businessOwners?.length ? s(e.businessOwners) : null }
|
|
90
|
+
};
|
|
91
|
+
}
|
|
8
92
|
//#endregion
|
|
9
|
-
export {
|
|
93
|
+
export { i as buildApplicantForCreate, o as buildApplicantForUpdate, r as buildBusinessDetails, s as buildBusinessOwners, c as buildCreateApplicationBody, l as buildUpdateApplicationBody };
|