@tesouro/embedded-components-react 0.7.15 → 0.7.17
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.css +6 -12
- package/dist/index.d.ts +31 -14
- package/dist/lib/AcceptDisclosuresWidget.d.ts +7 -0
- package/dist/lib/BankAccountOnboardingWidget.d.ts +4 -2
- package/dist/lib/LinkedAccountsWidget.d.ts +20 -12
- package/dist/lib/WidgetSuite.d.ts +24 -14
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js +97 -97
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/ui/dist/lib/AcceptDisclosuresWidget/labels.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js +441 -433
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/labels.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/forms.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/labels.js +11 -1
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/summary.js +22 -0
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js +182 -162
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/mocks/linkedAccounts.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index10.js +36 -86
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index11.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index12.js +17 -23
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index14.js +6 -6
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index15.js +14 -17
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index16.js +3 -6
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index5.js +168 -35
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index6.js +70 -83
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index7.js +11 -112
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index8.js +6 -12
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/ui/dist/index9.js +82 -7
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
|
@@ -70,6 +70,7 @@ var n = {
|
|
|
70
70
|
modalTitle: "Bank account onboarding",
|
|
71
71
|
submitFailedError: "Unable to submit application. Please try again.",
|
|
72
72
|
genericRetryError: "Please try again.",
|
|
73
|
+
deleteFailedError: "Unable to delete application. Please try again.",
|
|
73
74
|
saveDraftNothingValidError: "Fix the highlighted fields before saving, or discard your changes.",
|
|
74
75
|
fallbackBankName: "Member Bank",
|
|
75
76
|
shellFdicDisclaimer: "Products and services are offered by {bankName}, N.A., Member FDIC.",
|
package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/forms.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/forms.js
|
|
2
2
|
var e = {
|
|
3
|
+
accountHolderType: "",
|
|
3
4
|
nickname: "",
|
|
4
5
|
accountNumber: "",
|
|
5
6
|
routingNumber: "",
|
|
@@ -20,7 +21,7 @@ function n(e) {
|
|
|
20
21
|
return r % 10 == 0;
|
|
21
22
|
}
|
|
22
23
|
function r(e) {
|
|
23
|
-
return e.type !== "" && e.nickname.trim() !== "" && e.accountNumber.trim() !== "" && n(e.routingNumber);
|
|
24
|
+
return e.accountHolderType !== "" && e.type !== "" && e.nickname.trim() !== "" && e.accountNumber.trim() !== "" && n(e.routingNumber);
|
|
24
25
|
}
|
|
25
26
|
var i = {
|
|
26
27
|
nickname: "",
|
|
@@ -4,7 +4,17 @@ var e = {
|
|
|
4
4
|
accountLabel: "Account #:",
|
|
5
5
|
pendingStatus: "in process.",
|
|
6
6
|
editSuccessToast: "Bank account nickname updated successfully",
|
|
7
|
-
unlinkSuccessToast: "External account unlinked successfully"
|
|
7
|
+
unlinkSuccessToast: "External account unlinked successfully",
|
|
8
|
+
personalCheckingType: "personal checking",
|
|
9
|
+
personalSavingsType: "personal savings",
|
|
10
|
+
businessCheckingType: "business checking",
|
|
11
|
+
businessSavingsType: "business savings",
|
|
12
|
+
summaryDescription: "We sent two small deposits to your {type} account ending in {last4}.",
|
|
13
|
+
summaryAccountAddedDescription: "Your {type} account ending in {last4} was added. Someone with permission to send verification deposits can start verification from Transfers.",
|
|
14
|
+
summaryCheckBankTitle: "Check your bank account ending in {last4}",
|
|
15
|
+
summaryCheckBankDescription: "Look for two small deposits on your statement.",
|
|
16
|
+
summaryVerifyTitle: "Verify the amounts",
|
|
17
|
+
summaryVerifyDescription: "Return to Transfers and enter both amounts to start making transfers."
|
|
8
18
|
};
|
|
9
19
|
//#endregion
|
|
10
20
|
export { e as DEFAULT_FEATURE_LABELS };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/summary.js
|
|
2
|
+
function e(e) {
|
|
3
|
+
return e === "business" ? "BUSINESS" : "INDIVIDUAL";
|
|
4
|
+
}
|
|
5
|
+
function t(e) {
|
|
6
|
+
return e === "BUSINESS" ? "business" : "personal";
|
|
7
|
+
}
|
|
8
|
+
function n(e, t, n) {
|
|
9
|
+
let r = t === "SAVINGS";
|
|
10
|
+
return e === "business" ? r ? n.businessSavingsType : n.businessCheckingType : r ? n.personalSavingsType : n.personalCheckingType;
|
|
11
|
+
}
|
|
12
|
+
function r(e, t) {
|
|
13
|
+
return e.split(/\{(\w+)\}/).map((e, n) => n % 2 == 0 ? {
|
|
14
|
+
text: e,
|
|
15
|
+
emphasized: !1
|
|
16
|
+
} : t[e] ?? {
|
|
17
|
+
text: `{${e}}`,
|
|
18
|
+
emphasized: !1
|
|
19
|
+
}).filter((e) => e.text !== "");
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
22
|
+
export { t as fromApiAccountHolderType, e as toApiAccountHolderType, n as toSummaryTypeLabel, r as toTextParts };
|
|
@@ -3,12 +3,11 @@
|
|
|
3
3
|
"use client";
|
|
4
4
|
"use client";
|
|
5
5
|
import { toast as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
|
-
import {
|
|
7
|
-
import { TESOURO_NEW_EXTERNAL_BANK_ACCOUNT_LINKED_SUCCESS_EVENT as n, emitWidgetDomEvent as r } from "../../../../shared/util/dist/lib/widgetDomEvents.js";
|
|
6
|
+
import { TESOURO_NEW_EXTERNAL_BANK_ACCOUNT_LINKED_SUCCESS_EVENT as t, emitWidgetDomEvent as n } from "../../../../shared/util/dist/lib/widgetDomEvents.js";
|
|
8
7
|
import { extractApiErrorMessage as ee } from "../../../../shared/util/dist/lib/apiErrors.js";
|
|
9
8
|
import { OrganizationStatus as te, isOrganizationOnItsWay as ne } from "../../../../shared/data-access/dist/lib/organizationStatus.js";
|
|
10
9
|
import { useEmbedApi as re } from "../../../../shared/data-access/dist/lib/EmbedApiContext.js";
|
|
11
|
-
import { Scope as
|
|
10
|
+
import { Scope as r } from "../../../../shared/data-access/dist/lib/scopes.js";
|
|
12
11
|
import { useAllOrganizationRolesQuery as ie } from "../../../../shared/data-access/dist/lib/role/useAllOrganizationRolesQuery.js";
|
|
13
12
|
import { useAllOrganizationUsersQuery as ae } from "../../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
|
|
14
13
|
import "../../../../shared/data-access/dist/index.js";
|
|
@@ -19,30 +18,31 @@ import "../../../../shared/feature/dist/index.js";
|
|
|
19
18
|
import { filterRolesForOrganization as ue } from "../../../../../shared/util-validation/dist/index6.js";
|
|
20
19
|
import { filterUsersForOrganization as de } from "../../../../../shared/util-validation/dist/index7.js";
|
|
21
20
|
import { DEFAULT_FEATURE_LABELS as fe } from "./labels.js";
|
|
22
|
-
import { LinkedAccountsWidgetAnalyticsEvent as
|
|
23
|
-
import { EMPTY_CONNECT_FORM as
|
|
21
|
+
import { LinkedAccountsWidgetAnalyticsEvent as i } from "./analytics/events.js";
|
|
22
|
+
import { EMPTY_CONNECT_FORM as pe, EMPTY_EDIT_FORM as me, EMPTY_VERIFY_FORM as he, isConnectStep1Valid as ge, isRoutingNumberValid as _e, isVerifyAmountInRange as ve, isVerifyFormValid as ye, parseVerifyAmountToMinorUnits as a, sanitizeRoutingNumberInput as be, toEditForm as xe, toUpdateBody as Se } from "./forms.js";
|
|
24
23
|
import { getLinkedAccountsPermissions as Ce } from "./permissions.js";
|
|
25
24
|
import { toAccountRows as we } from "./rows.js";
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
25
|
+
import { fromApiAccountHolderType as Te, toApiAccountHolderType as Ee, toSummaryTypeLabel as De, toTextParts as o } from "./summary.js";
|
|
26
|
+
import { useConnectExternalBankAccountMutation as Oe } from "../../../data-access/dist/index3.js";
|
|
27
|
+
import { useExternalBankAccountsQuery as ke } from "../../../data-access/dist/index4.js";
|
|
28
|
+
import { useGrantExternalBankAccountAccessMutation as Ae } from "../../../data-access/dist/index5.js";
|
|
29
|
+
import { useLinkExternalBankAccountMutation as je } from "../../../data-access/dist/index6.js";
|
|
30
|
+
import { useUnlinkExternalBankAccountMutation as Me } from "../../../data-access/dist/index9.js";
|
|
31
|
+
import { useUpdateExternalBankAccountMutation as Ne } from "../../../data-access/dist/index10.js";
|
|
32
|
+
import { useValidateExternalBankAccountMutation as Pe } from "../../../data-access/dist/index11.js";
|
|
33
33
|
import "../../../data-access/dist/index.js";
|
|
34
|
-
import { useAdminEligibleUserIds as
|
|
35
|
-
import { toAccessRows as
|
|
36
|
-
import { DEFAULT_LABELS as
|
|
34
|
+
import { useAdminEligibleUserIds as Fe } from "./useAdminEligibleUserIds.js";
|
|
35
|
+
import { toAccessRows as Ie, toOrganizationRoleOptions as Le, toTeamMembers as Re } from "./teamMembers.js";
|
|
36
|
+
import { DEFAULT_LABELS as ze } from "../../../ui/dist/index15.js";
|
|
37
37
|
import "../../../ui/dist/index.js";
|
|
38
|
-
import { useCallback as
|
|
38
|
+
import { useCallback as Be, useEffect as Ve, useMemo as s, useState as c } from "react";
|
|
39
39
|
//#region ../../libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/useLinkedAccountsWidget.js
|
|
40
|
-
function
|
|
40
|
+
function He(e) {
|
|
41
41
|
let t = e;
|
|
42
42
|
return typeof e == "object" && !!e && "verificationStatus" in e && t.verificationStatus === "VERIFIED";
|
|
43
43
|
}
|
|
44
44
|
var l = "tesouro.linkedAccounts.locallySentMicroDepositAccountIds.v1";
|
|
45
|
-
function
|
|
45
|
+
function Ue() {
|
|
46
46
|
if (typeof window > "u") return /* @__PURE__ */ new Set();
|
|
47
47
|
try {
|
|
48
48
|
let e = window.sessionStorage.getItem(l), t = e ? JSON.parse(e) : [];
|
|
@@ -63,42 +63,42 @@ function f(e, t) {
|
|
|
63
63
|
let n = new Set(e).add(t);
|
|
64
64
|
return d(n), n;
|
|
65
65
|
}
|
|
66
|
-
var
|
|
67
|
-
function p({ labels:
|
|
66
|
+
var We = r.ExternalBankAccountWriteOrg;
|
|
67
|
+
function p({ labels: r, featureLabels: l }) {
|
|
68
68
|
let u = {
|
|
69
|
-
...
|
|
70
|
-
...
|
|
69
|
+
...ze,
|
|
70
|
+
...r
|
|
71
71
|
}, d = {
|
|
72
72
|
...fe,
|
|
73
73
|
...l
|
|
74
|
-
}, p = oe(), { organizationId: m, widgetToken:
|
|
75
|
-
|
|
76
|
-
p(
|
|
74
|
+
}, p = oe(), { organizationId: m, widgetToken: Ge, initResponse: h } = se(), Ke = le(), { organizationStatus: qe } = re(), Je = ne(qe), Ye = !!ce(), g = !!(m && Ge), Xe = g || !!Ge && qe === te.Rotating, _ = s(() => Ce(h?.scopes), [h?.scopes]), v = Xe && _.canRead && !!h, [y, b] = c(), [x, Ze] = c(!1), [S, C] = c(1), [w, Qe] = c([]), [T, $e] = c(), [et, E] = c(), [D, tt] = c(Ue), [nt, O] = c(!1), [rt, it] = c(!1), [at, k] = c(!1), [ot, A] = c(!1), [j, M] = c(), [N, P] = c(pe), [F, I] = c(me), [L, R] = c(he);
|
|
75
|
+
Ve(() => {
|
|
76
|
+
p(i.Mounted);
|
|
77
77
|
}, [p]);
|
|
78
|
-
let z =
|
|
78
|
+
let z = ke({
|
|
79
79
|
limit: 100,
|
|
80
|
-
enabled:
|
|
81
|
-
}), B =
|
|
80
|
+
enabled: v
|
|
81
|
+
}), B = Oe(), V = Ae(), H = Ne(), U = Me(), W = je(), G = Pe(), K = x && S >= 2, q = ae({ enabled: K }), J = ie({ enabled: K }), { userIds: st, isResolving: ct, isError: lt } = Fe({
|
|
82
82
|
enabled: K,
|
|
83
|
-
permissionKey:
|
|
83
|
+
permissionKey: We,
|
|
84
84
|
organizationId: m
|
|
85
85
|
}), Y = s(() => {
|
|
86
86
|
let e = J.data?.data ?? [], t = m ? ue(e, {
|
|
87
87
|
organizationId: m,
|
|
88
|
-
organizationTypes:
|
|
88
|
+
organizationTypes: h?.organizationTypes ?? []
|
|
89
89
|
}) : e, n = de(q.data?.data ?? [], m);
|
|
90
|
-
return
|
|
90
|
+
return Re(n, Le(t), st);
|
|
91
91
|
}, [
|
|
92
|
-
|
|
92
|
+
st,
|
|
93
93
|
J.data?.data,
|
|
94
94
|
q.data?.data,
|
|
95
95
|
m,
|
|
96
|
-
|
|
97
|
-
]),
|
|
96
|
+
h?.organizationTypes
|
|
97
|
+
]), ut = q.isLoading || q.isFetchingNextPage || !!q.hasNextPage || J.isResolving || ct, dt = !ut && !q.isError && !lt, X = v ? z.data?.data ?? [] : [], Z = s(() => X.map((e) => e.verificationStatus === "UNVERIFIED" && D.has(e.id) ? {
|
|
98
98
|
...e,
|
|
99
99
|
verificationStatus: "VERIFICATION_SENT"
|
|
100
|
-
} : e), [X,
|
|
101
|
-
B.reset(), V.reset(), W.reset(),
|
|
100
|
+
} : e), [X, D]), ft = [.../* @__PURE__ */ new Set([...Y.filter((e) => e.locked).map((e) => e.id), ...w])], pt = Be((e) => {
|
|
101
|
+
B.reset(), V.reset(), W.reset(), P({
|
|
102
102
|
...e,
|
|
103
103
|
routingNumber: be(e.routingNumber)
|
|
104
104
|
});
|
|
@@ -106,122 +106,142 @@ function p({ labels: i, featureLabels: l }) {
|
|
|
106
106
|
B,
|
|
107
107
|
V,
|
|
108
108
|
W
|
|
109
|
-
]),
|
|
110
|
-
|
|
111
|
-
},
|
|
112
|
-
if (!
|
|
113
|
-
|
|
109
|
+
]), mt = () => {
|
|
110
|
+
C(3), n(t);
|
|
111
|
+
}, ht = (e) => {
|
|
112
|
+
if (!_.canMicroDeposit) {
|
|
113
|
+
mt();
|
|
114
114
|
return;
|
|
115
115
|
}
|
|
116
|
-
|
|
117
|
-
|
|
116
|
+
E("connect"), W.mutate({ path: { id: e } }, { onSuccess: () => {
|
|
117
|
+
E(void 0), tt((t) => f(t, e)), p(i.AccountLinked, { accountId: e }), mt();
|
|
118
118
|
} });
|
|
119
|
-
},
|
|
119
|
+
}, Q = (e) => {
|
|
120
120
|
V.mutate({
|
|
121
121
|
path: { id: e },
|
|
122
|
-
body: { userIds:
|
|
123
|
-
}, { onSuccess: () =>
|
|
124
|
-
},
|
|
125
|
-
if (
|
|
126
|
-
if (
|
|
127
|
-
if (!
|
|
128
|
-
|
|
122
|
+
body: { userIds: ft }
|
|
123
|
+
}, { onSuccess: () => ht(e) });
|
|
124
|
+
}, gt = () => {
|
|
125
|
+
if (g && _.canWrite) {
|
|
126
|
+
if (S === 1) {
|
|
127
|
+
if (!ge(N)) return;
|
|
128
|
+
C(2);
|
|
129
129
|
return;
|
|
130
130
|
}
|
|
131
|
-
if (
|
|
132
|
-
if (
|
|
133
|
-
|
|
131
|
+
if (S === 2 && dt) {
|
|
132
|
+
if (T) {
|
|
133
|
+
Q(T.id);
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
136
136
|
B.mutate({ body: {
|
|
137
|
-
nickname:
|
|
138
|
-
accountNumber:
|
|
139
|
-
routingNumber:
|
|
140
|
-
nameOnAccount:
|
|
141
|
-
type:
|
|
137
|
+
nickname: N.nickname.trim(),
|
|
138
|
+
accountNumber: N.accountNumber.trim(),
|
|
139
|
+
routingNumber: N.routingNumber.trim(),
|
|
140
|
+
nameOnAccount: N.nickname.trim(),
|
|
141
|
+
type: N.type,
|
|
142
|
+
accountHolderType: Ee(N.accountHolderType)
|
|
142
143
|
} }, { onSuccess: (e) => {
|
|
143
|
-
p(
|
|
144
|
+
p(i.AccountConnected, { accountId: e?.id }), $e(e), e?.id && Q(e.id);
|
|
144
145
|
} });
|
|
145
146
|
}
|
|
146
147
|
}
|
|
147
|
-
},
|
|
148
|
-
|
|
149
|
-
},
|
|
150
|
-
Y.find((t) => t.id === e)?.locked ||
|
|
151
|
-
}, _t = (e) => {
|
|
152
|
-
(!e || y) && (!e || b.canWrite) && (e && (E(1), et(o), O([]), A(void 0), j(void 0), B.reset(), V.reset(), W.reset()), Ge(e));
|
|
153
|
-
}, vt = (e) => {
|
|
154
|
-
if (!y || !b.canWrite) return;
|
|
155
|
-
let t = X.find((t) => t.id === e);
|
|
156
|
-
C(e), nt(xe(t)), M(!0);
|
|
148
|
+
}, _t = () => {
|
|
149
|
+
S === 2 && C(1);
|
|
150
|
+
}, vt = (e, t) => {
|
|
151
|
+
Y.find((t) => t.id === e)?.locked || Qe((n) => t ? [.../* @__PURE__ */ new Set([...n, e])] : n.filter((t) => t !== e));
|
|
157
152
|
}, yt = (e) => {
|
|
158
|
-
(!e ||
|
|
159
|
-
}, bt = () => {
|
|
160
|
-
if (!
|
|
161
|
-
let t = X.find((
|
|
153
|
+
(!e || g) && (!e || _.canWrite) && (e && (C(1), P(pe), Qe([]), $e(void 0), E(void 0), B.reset(), V.reset(), W.reset()), Ze(e));
|
|
154
|
+
}, bt = (e) => {
|
|
155
|
+
if (!g || !_.canWrite) return;
|
|
156
|
+
let t = X.find((t) => t.id === e);
|
|
157
|
+
b(e), I(xe(t)), O(!0);
|
|
158
|
+
}, xt = (e) => {
|
|
159
|
+
(!e || g) && (!e || _.canWrite) && O(e);
|
|
160
|
+
}, St = () => {
|
|
161
|
+
if (!g || !_.canWrite || !y) return;
|
|
162
|
+
let t = X.find((e) => e.id === y), n = Se(F, t);
|
|
162
163
|
Object.keys(n).length !== 0 && H.mutate({
|
|
163
|
-
path: { id:
|
|
164
|
+
path: { id: y },
|
|
164
165
|
body: n
|
|
165
166
|
}, { onSuccess: () => {
|
|
166
|
-
p(
|
|
167
|
+
p(i.AccountUpdated, { accountId: y }), e.success(d.editSuccessToast), O(!1);
|
|
167
168
|
} });
|
|
168
|
-
}, xt = (e) => {
|
|
169
|
-
y && b.canWrite && (C(e), rt(me), P(!1), N(!1), Ze(!0));
|
|
170
|
-
}, St = (e) => {
|
|
171
|
-
(!e || y) && (!e || b.canWrite) && (e || (P(!1), N(!1)), Ze(e));
|
|
172
169
|
}, Ct = (e) => {
|
|
173
|
-
|
|
174
|
-
}, wt = () => {
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
170
|
+
g && _.canWrite && (b(e), R(he), A(!1), k(!1), it(!0));
|
|
171
|
+
}, wt = (e) => {
|
|
172
|
+
(!e || g) && (!e || _.canWrite) && (e || (A(!1), k(!1)), it(e));
|
|
173
|
+
}, Tt = (e) => {
|
|
174
|
+
G.reset(), A(!1), R(e);
|
|
175
|
+
}, Et = () => {
|
|
176
|
+
if (!g || !_.canWrite || !y || !ye(L)) return;
|
|
177
|
+
let e = a(L.firstAmount), t = a(L.secondAmount);
|
|
178
|
+
e !== null && t !== null && (A(!1), G.mutate({
|
|
179
|
+
path: { id: y },
|
|
179
180
|
body: {
|
|
180
181
|
firstAmount: e,
|
|
181
182
|
secondAmount: t
|
|
182
183
|
}
|
|
183
184
|
}, { onSuccess: (e) => {
|
|
184
|
-
if (!
|
|
185
|
-
|
|
185
|
+
if (!He(e)) {
|
|
186
|
+
A(!0);
|
|
186
187
|
return;
|
|
187
188
|
}
|
|
188
|
-
p(
|
|
189
|
+
p(i.AccountVerified, { accountId: y }), n("tesouro-new-external-bank-account-linked-success"), k(!0);
|
|
189
190
|
} }));
|
|
190
|
-
}, Tt = (e) => {
|
|
191
|
-
y && b.canMicroDeposit && (j("row"), W.mutate({ path: { id: e } }, { onSuccess: () => {
|
|
192
|
-
j(void 0), Je((t) => f(t, e)), p(a.AccountLinked, { accountId: e });
|
|
193
|
-
} }));
|
|
194
|
-
}, Et = (e) => {
|
|
195
|
-
y && b.canWrite && I(e);
|
|
196
191
|
}, Dt = (e) => {
|
|
197
|
-
e
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
192
|
+
g && _.canMicroDeposit && (E("row"), W.mutate({ path: { id: e } }, { onSuccess: () => {
|
|
193
|
+
E(void 0), tt((t) => f(t, e)), p(i.AccountLinked, { accountId: e });
|
|
194
|
+
} }));
|
|
195
|
+
}, Ot = (e) => {
|
|
196
|
+
g && _.canWrite && M(e);
|
|
197
|
+
}, kt = (e) => {
|
|
198
|
+
e || M(void 0);
|
|
199
|
+
}, At = () => {
|
|
200
|
+
if (!g || !_.canWrite || !j) return;
|
|
201
|
+
let t = j;
|
|
201
202
|
U.mutate({ path: { id: t } }, { onSuccess: () => {
|
|
202
|
-
p(
|
|
203
|
+
p(i.AccountUnlinked, { accountId: t }), e.success(d.unlinkSuccessToast), M(void 0);
|
|
203
204
|
} });
|
|
204
|
-
},
|
|
205
|
-
selectedUserIds:
|
|
206
|
-
disabled:
|
|
205
|
+
}, jt = B.isPending || V.isPending || H.isPending || G.isPending || U.isPending || W.isPending, Mt = _.canWrite, Nt = !g || jt, $ = W.isError && et === "connect", Pt = Ie(Y, {
|
|
206
|
+
selectedUserIds: w,
|
|
207
|
+
disabled: Nt || !Mt,
|
|
207
208
|
fallbackTooltip: u.teamMemberAccessTooltip,
|
|
208
|
-
onUserToggle:
|
|
209
|
-
}),
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
209
|
+
onUserToggle: vt
|
|
210
|
+
}), Ft = Y.filter((e) => e.locked).length + w.length, It = T ? ((e) => {
|
|
211
|
+
let t = e.accountNumber.slice(-4), n = {
|
|
212
|
+
type: {
|
|
213
|
+
text: De(e.accountHolderType ? Te(e.accountHolderType) : N.accountHolderType, e.type ?? N.type, d),
|
|
214
|
+
emphasized: !1
|
|
215
|
+
},
|
|
216
|
+
last4: {
|
|
217
|
+
text: t,
|
|
218
|
+
emphasized: !0
|
|
219
|
+
}
|
|
220
|
+
};
|
|
221
|
+
return D.has(e.id) ? {
|
|
222
|
+
variant: "deposits-sent",
|
|
223
|
+
description: o(d.summaryDescription, n),
|
|
224
|
+
nextSteps: [{
|
|
225
|
+
key: "check-bank",
|
|
226
|
+
title: d.summaryCheckBankTitle.replaceAll("{last4}", t),
|
|
227
|
+
description: o(d.summaryCheckBankDescription, n)
|
|
228
|
+
}, {
|
|
229
|
+
key: "verify",
|
|
230
|
+
title: d.summaryVerifyTitle,
|
|
231
|
+
description: o(d.summaryVerifyDescription, n)
|
|
232
|
+
}]
|
|
233
|
+
} : {
|
|
234
|
+
variant: "account-added",
|
|
235
|
+
description: o(d.summaryAccountAddedDescription, n),
|
|
236
|
+
nextSteps: []
|
|
237
|
+
};
|
|
238
|
+
})(T) : void 0, Lt = we(Z, d, _, {
|
|
219
239
|
labels: u,
|
|
220
|
-
onEditSelect:
|
|
221
|
-
onVerifySelect:
|
|
222
|
-
onLinkSelect:
|
|
223
|
-
onUnlinkSelect:
|
|
224
|
-
}),
|
|
240
|
+
onEditSelect: bt,
|
|
241
|
+
onVerifySelect: Ct,
|
|
242
|
+
onLinkSelect: Dt,
|
|
243
|
+
onUnlinkSelect: Ot
|
|
244
|
+
}), Rt = s(() => {
|
|
225
245
|
if (!B.isError && !V.isError && !$) return;
|
|
226
246
|
let e = B.error ?? V.error ?? ($ ? W.error : void 0);
|
|
227
247
|
return ee(e) ?? u.actionErrorTitle;
|
|
@@ -235,51 +255,51 @@ function p({ labels: i, featureLabels: l }) {
|
|
|
235
255
|
u.actionErrorTitle
|
|
236
256
|
]);
|
|
237
257
|
return {
|
|
238
|
-
rows:
|
|
239
|
-
isLoading: !
|
|
240
|
-
isError:
|
|
241
|
-
isConnectOpen:
|
|
242
|
-
isEditOpen:
|
|
243
|
-
isVerifyOpen:
|
|
244
|
-
isVerifySuccess:
|
|
245
|
-
verifyAccountName: Z.find((e) => e.id ===
|
|
246
|
-
verifyAccountNumber: Z.find((e) => e.id ===
|
|
247
|
-
isUnlinkOpen: !!
|
|
248
|
-
unlinkAccountNumber: Z.find((e) => e.id ===
|
|
249
|
-
connectStep:
|
|
250
|
-
accessRows:
|
|
251
|
-
accessGrantedCount:
|
|
252
|
-
connectSummary:
|
|
253
|
-
isTeamMembersLoading:
|
|
254
|
-
isTeamMembersError: q.isError ||
|
|
255
|
-
isConnectNextDisabled:
|
|
256
|
-
isConnectRoutingNumberInvalid:
|
|
257
|
-
connectErrorMessage:
|
|
258
|
-
isVerifyFirstAmountInvalid:
|
|
259
|
-
isVerifySecondAmountInvalid:
|
|
260
|
-
isVerifySubmitDisabled: !
|
|
261
|
-
isActionDisabled:
|
|
262
|
-
canConnect:
|
|
263
|
-
isSubmitting:
|
|
264
|
-
isActionError: W.isError || U.isError || B.isError || V.isError || H.isError || G.isError ||
|
|
258
|
+
rows: Lt,
|
|
259
|
+
isLoading: !Ye && (Je && !z.data || Ke && !h || v && z.isLoading),
|
|
260
|
+
isError: Ye || v && z.isError,
|
|
261
|
+
isConnectOpen: x,
|
|
262
|
+
isEditOpen: nt,
|
|
263
|
+
isVerifyOpen: rt,
|
|
264
|
+
isVerifySuccess: at,
|
|
265
|
+
verifyAccountName: Z.find((e) => e.id === y)?.nickname,
|
|
266
|
+
verifyAccountNumber: Z.find((e) => e.id === y)?.accountNumber,
|
|
267
|
+
isUnlinkOpen: !!j,
|
|
268
|
+
unlinkAccountNumber: Z.find((e) => e.id === j)?.accountNumber,
|
|
269
|
+
connectStep: S,
|
|
270
|
+
accessRows: Pt,
|
|
271
|
+
accessGrantedCount: Ft,
|
|
272
|
+
connectSummary: It,
|
|
273
|
+
isTeamMembersLoading: ut,
|
|
274
|
+
isTeamMembersError: q.isError || lt,
|
|
275
|
+
isConnectNextDisabled: S === 1 ? !ge(N) : S === 2 && !dt,
|
|
276
|
+
isConnectRoutingNumberInvalid: N.routingNumber.trim() !== "" && !_e(N.routingNumber),
|
|
277
|
+
connectErrorMessage: Rt,
|
|
278
|
+
isVerifyFirstAmountInvalid: L.firstAmount.trim() !== "" && !ve(L.firstAmount),
|
|
279
|
+
isVerifySecondAmountInvalid: L.secondAmount.trim() !== "" && !ve(L.secondAmount),
|
|
280
|
+
isVerifySubmitDisabled: !ye(L),
|
|
281
|
+
isActionDisabled: Nt,
|
|
282
|
+
canConnect: Mt,
|
|
283
|
+
isSubmitting: jt,
|
|
284
|
+
isActionError: W.isError || U.isError || B.isError || V.isError || H.isError || G.isError || ot,
|
|
265
285
|
isConnectError: B.isError || V.isError || $,
|
|
266
286
|
isEditError: H.isError,
|
|
267
|
-
isVerifyError: G.isError ||
|
|
268
|
-
connectForm:
|
|
269
|
-
editForm:
|
|
270
|
-
verifyForm:
|
|
271
|
-
onConnectOpenChange:
|
|
272
|
-
onEditOpenChange:
|
|
273
|
-
onVerifyOpenChange:
|
|
274
|
-
onUnlinkOpenChange:
|
|
275
|
-
onConnectFormChange:
|
|
276
|
-
onEditFormChange:
|
|
277
|
-
onVerifyFormChange:
|
|
278
|
-
onConnectNext:
|
|
279
|
-
onConnectBack:
|
|
280
|
-
onEditSubmit:
|
|
281
|
-
onVerifySubmit:
|
|
282
|
-
onUnlinkConfirm:
|
|
287
|
+
isVerifyError: G.isError || ot,
|
|
288
|
+
connectForm: N,
|
|
289
|
+
editForm: F,
|
|
290
|
+
verifyForm: L,
|
|
291
|
+
onConnectOpenChange: yt,
|
|
292
|
+
onEditOpenChange: xt,
|
|
293
|
+
onVerifyOpenChange: wt,
|
|
294
|
+
onUnlinkOpenChange: kt,
|
|
295
|
+
onConnectFormChange: pt,
|
|
296
|
+
onEditFormChange: I,
|
|
297
|
+
onVerifyFormChange: Tt,
|
|
298
|
+
onConnectNext: gt,
|
|
299
|
+
onConnectBack: _t,
|
|
300
|
+
onEditSubmit: St,
|
|
301
|
+
onVerifySubmit: Et,
|
|
302
|
+
onUnlinkConfirm: At
|
|
283
303
|
};
|
|
284
304
|
}
|
|
285
305
|
//#endregion
|
|
@@ -82,6 +82,7 @@ var y = [e.ExternalBankAccountReadOrg], b = [...y, e.ExternalBankAccountWriteOrg
|
|
|
82
82
|
accountNumber: C(a(i.accountNumber, "0000")),
|
|
83
83
|
routingNumber: a(i.routingNumber, "123456780"),
|
|
84
84
|
type: i.type === "SAVINGS" ? "SAVINGS" : "CHECKING",
|
|
85
|
+
accountHolderType: i.accountHolderType === "BUSINESS" ? "BUSINESS" : "INDIVIDUAL",
|
|
85
86
|
verificationStatus: "UNVERIFIED"
|
|
86
87
|
};
|
|
87
88
|
return n.push(o), f(o, 201);
|