@tesouro/embedded-components-react 0.5.1 → 0.5.3
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/README.md +15 -2
- package/dist/index.d.ts +120 -100
- package/dist/index.js +6 -3
- package/dist/lib/BankAccountOnboardingWidget.d.ts +214 -246
- package/dist/lib/MarketingWidget.d.ts +684 -0
- package/dist/lib/MarketingWidget.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index.js +9 -8
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index16.js +0 -2
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index18.js +183 -205
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js +1 -4
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index2.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/{bank-account-onboarding-widget/ui/dist/index26.js → marketing-widget/feature/dist/index3.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index4.js +81 -0
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/{bank-account-onboarding-widget/ui/dist/index24.js → marketing-widget/ui/dist/index2.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/{bank-account-onboarding-widget/ui/dist/index25.js → marketing-widget/ui/dist/index3.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/{bank-account-onboarding-widget/ui/dist/index27.js → marketing-widget/ui/dist/index4.js} +36 -37
- package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index5.js +75 -0
- package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +24 -22
- package/dist/libs/tesouro-embedded-components-react/{bank-account-onboarding-widget/data-access/dist/index9.js → shared/data-access/dist/lib/onboardingSuppressionReason.js} +1 -1
- package/dist/libs/tesouro-embedded-components-react/{bank-account-onboarding-widget/data-access/dist/index10.js → shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js} +5 -6
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/isDisclosuresAcceptanceRequired.js +1 -0
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index28.js +0 -75
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OnboardingSuppressionReason as e } from "../../../shared/data-access/dist/lib/onboardingSuppressionReason.js";
|
|
2
|
+
import { useOrganizationOnboardingSuppression as t } from "../../../shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js";
|
|
3
|
+
import "../../../shared/data-access/dist/index.js";
|
|
4
|
+
import { ApplicationClientSecretProvider as n, useApplicationClientSecret as r } from "./index2.js";
|
|
2
5
|
import "./index3.js";
|
|
3
|
-
import { useCreateApplication as
|
|
4
|
-
import { useUpdateApplication as
|
|
5
|
-
import { useSubmitApplication as
|
|
6
|
-
import { usePollApplicationCompletion as
|
|
7
|
-
|
|
8
|
-
import { useOrganizationOnboardingSuppression as s } from "./index10.js";
|
|
9
|
-
export { e as ApplicationClientSecretProvider, o as OnboardingSuppressionReason, t as useApplicationClientSecret, n as useCreateApplication, s as useOrganizationOnboardingSuppression, a as usePollApplicationCompletion, i as useSubmitApplication, r as useUpdateApplication };
|
|
6
|
+
import { useCreateApplication as i } from "./index4.js";
|
|
7
|
+
import { useUpdateApplication as a } from "./index6.js";
|
|
8
|
+
import { useSubmitApplication as o } from "./index7.js";
|
|
9
|
+
import { usePollApplicationCompletion as s } from "./index8.js";
|
|
10
|
+
export { n as ApplicationClientSecretProvider, e as OnboardingSuppressionReason, r as useApplicationClientSecret, i as useCreateApplication, t as useOrganizationOnboardingSuppression, s as usePollApplicationCompletion, o as useSubmitApplication, a as useUpdateApplication };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index16.js
|
|
2
2
|
var e = {
|
|
3
3
|
Mounted: "onboarding.mounted",
|
|
4
|
-
OpenMarketing: "onboarding_widget_open_marketing_widget",
|
|
5
|
-
BeginOnboarding: "onboarding_widget_begin_onboarding",
|
|
6
4
|
Suppressed: "onboarding.suppressed"
|
|
7
5
|
}, t = "onboarding";
|
|
8
6
|
//#endregion
|
|
@@ -5,38 +5,37 @@
|
|
|
5
5
|
import { Dialog as e, DialogContent as t, DialogTitle as n } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
|
|
6
6
|
import { useAcceptWidgetDisclosures as r } from "../../../shared/data-access/dist/lib/disclosures/useAcceptWidgetDisclosures.js";
|
|
7
7
|
import { useDisclosuresQuery as i } from "../../../shared/data-access/dist/lib/disclosures/useDisclosuresQuery.js";
|
|
8
|
+
import { OnboardingSuppressionReason as a } from "../../../shared/data-access/dist/lib/onboardingSuppressionReason.js";
|
|
9
|
+
import { useOrganizationOnboardingSuppression as o } from "../../../shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js";
|
|
8
10
|
import "../../../shared/data-access/dist/index.js";
|
|
9
|
-
import { OnboardingShell as
|
|
11
|
+
import { OnboardingShell as s } from "../../../shared/ui/dist/lib/OnboardingShell/OnboardingShell.js";
|
|
10
12
|
import "../../../shared/ui/dist/index.js";
|
|
11
|
-
import { useAnalyticsTrack as
|
|
12
|
-
import { WidgetProvider as
|
|
13
|
-
import { getStateOptions as
|
|
14
|
-
import { extractApiErrorMessage as
|
|
15
|
-
import { useRefetchWidget as
|
|
16
|
-
import { getNaicsOptions as
|
|
13
|
+
import { useAnalyticsTrack as c } from "../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
14
|
+
import { WidgetProvider as l } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
15
|
+
import { getStateOptions as u } from "../../../shared/util/dist/lib/usStates.js";
|
|
16
|
+
import { extractApiErrorMessage as ee } from "../../../shared/util/dist/lib/apiErrors.js";
|
|
17
|
+
import { useRefetchWidget as te, useWidgetConfig as d } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
18
|
+
import { getNaicsOptions as f } from "../../../shared/feature/dist/lib/naicsCodeMap.js";
|
|
17
19
|
import "../../../shared/feature/dist/index.js";
|
|
18
|
-
import { bankAccountOnboardingTestIds as
|
|
19
|
-
import { ADDITIONAL_OWNERS_LABELS_EN as
|
|
20
|
+
import { bankAccountOnboardingTestIds as p } from "./index9.js";
|
|
21
|
+
import { ADDITIONAL_OWNERS_LABELS_EN as ne } from "../../ui/dist/index4.js";
|
|
20
22
|
import { interpolateBankName as m } from "../../ui/dist/index6.js";
|
|
21
|
-
import { ResultStep as
|
|
22
|
-
import { MarketingWidget as ne } from "../../ui/dist/index28.js";
|
|
23
|
+
import { ResultStep as re } from "../../ui/dist/index11.js";
|
|
23
24
|
import "../../ui/dist/index.js";
|
|
24
|
-
import { BusinessDetailsStep as
|
|
25
|
-
import { PersonalDetailsStep as
|
|
26
|
-
import { AdditionalOwnersStep as
|
|
27
|
-
import { buildCreateApplicationBody as
|
|
28
|
-
import { OnboardingAnalyticsEvent as
|
|
29
|
-
import { DEFAULT_LABELS as
|
|
30
|
-
import { ApplicationClientSecretProvider as
|
|
31
|
-
import { useCreateApplication as
|
|
32
|
-
import { useUpdateApplication as
|
|
33
|
-
import { useSubmitApplication as
|
|
34
|
-
import { usePollApplicationCompletion as
|
|
35
|
-
import { OnboardingSuppressionReason as v } from "../../data-access/dist/index9.js";
|
|
36
|
-
import { useOrganizationOnboardingSuppression as me } from "../../data-access/dist/index10.js";
|
|
25
|
+
import { BusinessDetailsStep as ie } from "./index10.js";
|
|
26
|
+
import { PersonalDetailsStep as ae } from "./index12.js";
|
|
27
|
+
import { AdditionalOwnersStep as oe } from "./index14.js";
|
|
28
|
+
import { buildCreateApplicationBody as se, buildUpdateApplicationBody as h } from "./index15.js";
|
|
29
|
+
import { OnboardingAnalyticsEvent as g, WIDGET_NAME as _ } from "./index16.js";
|
|
30
|
+
import { DEFAULT_LABELS as v } from "./index17.js";
|
|
31
|
+
import { ApplicationClientSecretProvider as y, useApplicationClientSecret as ce } from "../../data-access/dist/index2.js";
|
|
32
|
+
import { useCreateApplication as le } from "../../data-access/dist/index4.js";
|
|
33
|
+
import { useUpdateApplication as ue } from "../../data-access/dist/index6.js";
|
|
34
|
+
import { useSubmitApplication as de } from "../../data-access/dist/index7.js";
|
|
35
|
+
import { usePollApplicationCompletion as fe } from "../../data-access/dist/index8.js";
|
|
37
36
|
import "../../data-access/dist/index.js";
|
|
38
|
-
import { useCallback as
|
|
39
|
-
import { Fragment as
|
|
37
|
+
import { useCallback as pe, useEffect as b, useMemo as x, useRef as me, useState as S } from "react";
|
|
38
|
+
import { Fragment as he, jsx as C, jsxs as ge } from "react/jsx-runtime";
|
|
40
39
|
//#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index18.js
|
|
41
40
|
var _e = {
|
|
42
41
|
companyLegalName: "",
|
|
@@ -76,7 +75,7 @@ function ye(e, t) {
|
|
|
76
75
|
subtitle: t.personalReviewSubtitle
|
|
77
76
|
};
|
|
78
77
|
let n = {
|
|
79
|
-
...
|
|
78
|
+
...ne,
|
|
80
79
|
...t.additionalOwners
|
|
81
80
|
};
|
|
82
81
|
return {
|
|
@@ -84,239 +83,218 @@ function ye(e, t) {
|
|
|
84
83
|
subtitle: n.subheading
|
|
85
84
|
};
|
|
86
85
|
}
|
|
87
|
-
function
|
|
88
|
-
let
|
|
86
|
+
function w({ onEmbeddedOnboardingCompletedSuccessfully: l, onNavigateToDashboard: ne, labels: _, initialBusinessDetails: y, initialPersonalDetails: w, initialAdditionalOwners: T, bankLogoSrc: E, disclosureLinks: be, open: D, defaultOpen: O, onOpenChange: k }) {
|
|
87
|
+
let A = c();
|
|
89
88
|
b(() => {
|
|
90
|
-
|
|
91
|
-
}, [
|
|
92
|
-
let
|
|
89
|
+
A(g.Mounted);
|
|
90
|
+
}, [A]);
|
|
91
|
+
let j = {
|
|
92
|
+
...v,
|
|
93
93
|
..._,
|
|
94
|
-
...g,
|
|
95
94
|
stepIndicator: {
|
|
96
|
-
...
|
|
97
|
-
...
|
|
95
|
+
...v.stepIndicator,
|
|
96
|
+
..._?.stepIndicator
|
|
98
97
|
},
|
|
99
|
-
businessDetails:
|
|
100
|
-
personalDetails:
|
|
101
|
-
additionalOwners:
|
|
98
|
+
businessDetails: _?.businessDetails ?? {},
|
|
99
|
+
personalDetails: _?.personalDetails ?? {},
|
|
100
|
+
additionalOwners: _?.additionalOwners ?? {},
|
|
102
101
|
result: {
|
|
103
|
-
...
|
|
104
|
-
...
|
|
102
|
+
...v.result,
|
|
103
|
+
..._?.result
|
|
105
104
|
}
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
}, [
|
|
109
|
-
|
|
110
|
-
}, [
|
|
111
|
-
M(!1);
|
|
112
|
-
}, []), Be = y(() => {
|
|
113
|
-
O(h.BeginOnboarding), M(!1), N(!0);
|
|
114
|
-
}, [N, O]), Ve = y(() => {
|
|
115
|
-
Me(!1), s();
|
|
116
|
-
}, [s]), He = ee(), [P, F] = S(0), [Ue, We] = S(() => ({
|
|
105
|
+
}, M = d().initResponse, { termsHref: xe, privacyHref: Se, electronicCommunicationHref: Ce, patriotActHref: we } = be ?? {}, N = D === void 0, [Te, Ee] = S(() => O ?? !1), P = N ? Te : D, De = O ?? !1, F = pe((e) => {
|
|
106
|
+
N && Ee(e), k?.(e);
|
|
107
|
+
}, [k, N]), Oe = pe(() => {
|
|
108
|
+
l();
|
|
109
|
+
}, [l]), ke = te(), [I, L] = S(0), [Ae, je] = S(() => ({
|
|
117
110
|
..._e,
|
|
118
|
-
...
|
|
119
|
-
})), [
|
|
111
|
+
...y
|
|
112
|
+
})), [R, Me] = S(() => ({
|
|
120
113
|
...ve,
|
|
121
|
-
...
|
|
122
|
-
})), [
|
|
123
|
-
b(() => () =>
|
|
124
|
-
let
|
|
114
|
+
...w
|
|
115
|
+
})), [Ne, Pe] = S(() => T ?? []), [z, Fe] = S(null), [B, Ie] = S(null), [V, Le] = S(null), [H, Re] = S(null), [ze, U] = S(null), [W, Be] = S(!1), [Ve, G] = S(null), He = le(), K = ue(), Ue = de(), We = fe(), { setClientSecret: Ge } = ce(), { data: Ke, refetch: qe } = i(), { mutateAsync: Je } = r(), q = o(), J = me(null);
|
|
116
|
+
b(() => () => J.current?.abort(), []);
|
|
117
|
+
let Ye = x(() => f(j.businessDetails.naicsTitles), [j.businessDetails.naicsTitles]), Xe = x(() => u(j.businessDetails.stateTitles), [j.businessDetails.stateTitles]), Ze = x(() => u(j.personalDetails.stateTitles), [j.personalDetails.stateTitles]), Qe = x(() => u(j.additionalOwners.stateTitles), [j.additionalOwners.stateTitles]), Y = W || Ve !== null, $e = M?.status === "ACTIVE" || M?.status === "INACTIVE", et = M?.status === "INVITED", X = !!M && !Y && ($e || et || q.isSuppressed), Z = X ? $e ? a.UserAlreadyOnboarded : et ? a.UserInvitedToOrganization : q.reason : null;
|
|
125
118
|
if (b(() => {
|
|
126
|
-
!
|
|
119
|
+
!X || !Z || (A(g.Suppressed, { reason: Z }), console.info(`[onboarding] not shown: ${Z}`));
|
|
127
120
|
}, [
|
|
121
|
+
X,
|
|
128
122
|
Z,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
U(!0), N(!0);
|
|
123
|
+
A
|
|
124
|
+
]), !M || !Y && (X || !q.isResolved)) return null;
|
|
125
|
+
let tt = z?.companyStructure === "SOLE_PROPRIETORSHIP", nt = [
|
|
126
|
+
j.stepIndicator.business,
|
|
127
|
+
j.stepIndicator.personal,
|
|
128
|
+
j.stepIndicator.ownership
|
|
129
|
+
], rt = I === 0 ? z : I === 1 ? B : I === 2 ? V : null, Q = He.isPending || K.isPending || Ue.isPending || W, it = () => {
|
|
130
|
+
U(null), L((e) => e === 0 ? 0 : e - 1);
|
|
131
|
+
}, $ = () => {
|
|
132
|
+
F(!1);
|
|
133
|
+
}, at = async (e) => {
|
|
134
|
+
Be(!0), F(!0);
|
|
142
135
|
let t = new AbortController();
|
|
143
|
-
|
|
136
|
+
J.current = t;
|
|
144
137
|
let n = !1;
|
|
145
138
|
try {
|
|
146
|
-
let r = await
|
|
139
|
+
let r = await Ue.mutateAsync({ path: { id: e } });
|
|
147
140
|
if (t.signal.aborted) return;
|
|
148
|
-
if (!r.id) throw Error(
|
|
149
|
-
if (n = !0, (await
|
|
150
|
-
let e =
|
|
151
|
-
if (e === void 0 && (e = (await
|
|
141
|
+
if (!r.id) throw Error(j.submitFailedError);
|
|
142
|
+
if (n = !0, (await We(e, { signal: t.signal })).status === "complete") {
|
|
143
|
+
let e = Ke;
|
|
144
|
+
if (e === void 0 && (e = (await qe()).data), t.signal.aborted) return;
|
|
152
145
|
if (e !== void 0) try {
|
|
153
|
-
await
|
|
146
|
+
await Je({ displayedVersion: e.version ?? null });
|
|
154
147
|
} catch {}
|
|
155
148
|
if (t.signal.aborted) return;
|
|
156
|
-
G("success"),
|
|
149
|
+
G("success"), ke(), Oe();
|
|
157
150
|
} else G("pending");
|
|
158
151
|
} catch (e) {
|
|
159
152
|
if (e instanceof DOMException && e.name === "AbortError") return;
|
|
160
153
|
if (!n) throw e;
|
|
161
154
|
G("pending");
|
|
162
155
|
} finally {
|
|
163
|
-
|
|
156
|
+
J.current = null, Be(!1);
|
|
164
157
|
}
|
|
165
|
-
},
|
|
166
|
-
|
|
158
|
+
}, ot = async () => {
|
|
159
|
+
U(null);
|
|
167
160
|
try {
|
|
168
|
-
if (
|
|
169
|
-
if (!
|
|
170
|
-
let e =
|
|
161
|
+
if (I === 0) {
|
|
162
|
+
if (!z) return;
|
|
163
|
+
let e = H;
|
|
171
164
|
if (!e) {
|
|
172
|
-
let t = await
|
|
173
|
-
e = t.id,
|
|
165
|
+
let t = await He.mutateAsync({ body: se(z) });
|
|
166
|
+
e = t.id, Re(e), t.clientSecret && Ge(t.clientSecret);
|
|
174
167
|
}
|
|
175
|
-
|
|
176
|
-
} else if (
|
|
177
|
-
if (!
|
|
178
|
-
await
|
|
179
|
-
path: { id:
|
|
180
|
-
body:
|
|
181
|
-
businessDetails:
|
|
182
|
-
applicant:
|
|
168
|
+
L(1);
|
|
169
|
+
} else if (I === 1) {
|
|
170
|
+
if (!B || !z || !H) return;
|
|
171
|
+
await K.mutateAsync({
|
|
172
|
+
path: { id: H },
|
|
173
|
+
body: h({
|
|
174
|
+
businessDetails: z,
|
|
175
|
+
applicant: B
|
|
183
176
|
})
|
|
184
|
-
}),
|
|
185
|
-
} else if (
|
|
186
|
-
if (!
|
|
187
|
-
await
|
|
188
|
-
path: { id:
|
|
189
|
-
body:
|
|
190
|
-
}), await
|
|
177
|
+
}), L(2);
|
|
178
|
+
} else if (I === 2) {
|
|
179
|
+
if (!V || !H) return;
|
|
180
|
+
await K.mutateAsync({
|
|
181
|
+
path: { id: H },
|
|
182
|
+
body: h({ businessOwners: V })
|
|
183
|
+
}), await at(H);
|
|
191
184
|
}
|
|
192
185
|
} catch (e) {
|
|
193
|
-
let t =
|
|
194
|
-
|
|
186
|
+
let t = ee(e) ?? (e instanceof Error ? e.message : void 0) ?? j.genericRetryError;
|
|
187
|
+
U(t);
|
|
195
188
|
}
|
|
196
|
-
},
|
|
197
|
-
if (
|
|
198
|
-
let r =
|
|
199
|
-
...
|
|
200
|
-
...
|
|
189
|
+
}, st = ye(Math.min(I, 2), j), ct = M.bankName?.trim() || j.fallbackBankName, lt = m(j.shellFdicDisclaimer, ct);
|
|
190
|
+
if (Y) {
|
|
191
|
+
let r = z?.companyLegalName ?? "", i = M.bankName?.trim() || j.fallbackBankName, a = Ve ?? "pending", o = a === "success", s = {
|
|
192
|
+
...v.result,
|
|
193
|
+
...j.result
|
|
201
194
|
};
|
|
202
195
|
return /* @__PURE__ */ C(e, {
|
|
203
|
-
open:
|
|
204
|
-
onOpenChange:
|
|
205
|
-
children: /* @__PURE__ */
|
|
196
|
+
open: P,
|
|
197
|
+
onOpenChange: F,
|
|
198
|
+
children: /* @__PURE__ */ ge(t, {
|
|
206
199
|
className: "ttw:grid ttw:max-h-[95vh] ttw:w-[720px] ttw:max-w-[calc(100vw-2rem)] ttw:grid-rows-[1fr] ttw:gap-0 ttw:overflow-hidden ttw:rounded-2xl ttw:p-0",
|
|
207
200
|
children: [/* @__PURE__ */ C(n, {
|
|
208
201
|
className: "ttw:sr-only",
|
|
209
|
-
children:
|
|
210
|
-
}), /* @__PURE__ */ C(
|
|
202
|
+
children: j.modalTitle
|
|
203
|
+
}), /* @__PURE__ */ C(re, {
|
|
211
204
|
testIds: {
|
|
212
|
-
processing:
|
|
213
|
-
dashboardButton:
|
|
205
|
+
processing: p.resultProcessing,
|
|
206
|
+
dashboardButton: p.resultDashboardButton
|
|
214
207
|
},
|
|
215
208
|
status: a,
|
|
216
|
-
isLoading:
|
|
209
|
+
isLoading: W,
|
|
217
210
|
loadingMessage: s.loadingMessage,
|
|
218
211
|
headingLine1: o ? s.successHeadingLine1 : s.pendingHeadingLine1,
|
|
219
212
|
headingLine2: `${r}!`,
|
|
220
213
|
body: o ? s.successBody : s.pendingBody,
|
|
221
|
-
followUpEmail:
|
|
214
|
+
followUpEmail: B?.workEmail ?? "",
|
|
222
215
|
emailBoxLead: s.pendingEmailBoxLead,
|
|
223
216
|
navigateToDashboardLabel: s.navigateToDashboard,
|
|
224
|
-
bankLogoSrc:
|
|
217
|
+
bankLogoSrc: E,
|
|
225
218
|
bankLogoAlt: m(s.bankLogoAlt, i),
|
|
226
219
|
fdicDisclaimer: m(s.fdicDisclaimer, i),
|
|
227
|
-
onNavigateToDashboard:
|
|
220
|
+
onNavigateToDashboard: ne
|
|
228
221
|
})]
|
|
229
222
|
})
|
|
230
223
|
});
|
|
231
224
|
}
|
|
232
|
-
let
|
|
233
|
-
return /* @__PURE__ */
|
|
234
|
-
open:
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
onOpenMarketingModal: Re,
|
|
246
|
-
onCloseMarketingModal: ze,
|
|
247
|
-
onPrimaryCtaClick: Be
|
|
248
|
-
}) : null, /* @__PURE__ */ w(a, {
|
|
249
|
-
open: Ie,
|
|
250
|
-
defaultOpen: Le,
|
|
251
|
-
onOpenChange: N,
|
|
252
|
-
title: vt.title,
|
|
253
|
-
subtitle: vt.subtitle,
|
|
254
|
-
stepLabels: ft,
|
|
255
|
-
activeStep: P,
|
|
256
|
-
disclaimerText: bt,
|
|
257
|
-
onBack: P === 0 ? ht : mt,
|
|
258
|
-
onCancel: P > 0 ? ht : void 0,
|
|
259
|
-
onNext: _t,
|
|
225
|
+
let ut = I === 2 ? j.submit : j.next, dt = rt === null || Q;
|
|
226
|
+
return /* @__PURE__ */ C(he, { children: /* @__PURE__ */ ge(s, {
|
|
227
|
+
open: P,
|
|
228
|
+
defaultOpen: De,
|
|
229
|
+
onOpenChange: F,
|
|
230
|
+
title: st.title,
|
|
231
|
+
subtitle: st.subtitle,
|
|
232
|
+
stepLabels: nt,
|
|
233
|
+
activeStep: I,
|
|
234
|
+
disclaimerText: lt,
|
|
235
|
+
onBack: I === 0 ? $ : it,
|
|
236
|
+
onCancel: I > 0 ? $ : void 0,
|
|
237
|
+
onNext: ot,
|
|
260
238
|
showDismissButton: !1,
|
|
261
|
-
isNextDisabled:
|
|
262
|
-
isNextLoading:
|
|
263
|
-
nextLabel:
|
|
239
|
+
isNextDisabled: dt,
|
|
240
|
+
isNextLoading: Q,
|
|
241
|
+
nextLabel: ut,
|
|
264
242
|
nextIcon: null,
|
|
265
|
-
errorMessage:
|
|
243
|
+
errorMessage: ze,
|
|
266
244
|
labels: {
|
|
267
|
-
backButton:
|
|
268
|
-
cancelButton:
|
|
245
|
+
backButton: I === 0 ? j.cancel : j.back,
|
|
246
|
+
cancelButton: j.cancel
|
|
269
247
|
},
|
|
270
248
|
testIds: {
|
|
271
|
-
root:
|
|
272
|
-
dismiss:
|
|
273
|
-
back:
|
|
274
|
-
cancel:
|
|
275
|
-
next:
|
|
249
|
+
root: p.shell,
|
|
250
|
+
dismiss: p.shellDismiss,
|
|
251
|
+
back: p.shellBack,
|
|
252
|
+
cancel: p.shellCancel,
|
|
253
|
+
next: p.shellNext,
|
|
276
254
|
scrollRegion: {
|
|
277
|
-
root:
|
|
278
|
-
fade:
|
|
279
|
-
hint:
|
|
255
|
+
root: p.shellScrollRegion,
|
|
256
|
+
fade: p.shellScrollFade,
|
|
257
|
+
hint: p.shellScrollHint
|
|
280
258
|
}
|
|
281
259
|
},
|
|
282
260
|
children: [
|
|
283
|
-
|
|
284
|
-
value:
|
|
285
|
-
onValueChange:
|
|
286
|
-
onSnapshotChange:
|
|
287
|
-
naicsOptions:
|
|
288
|
-
stateOptions:
|
|
289
|
-
isSubmitting:
|
|
290
|
-
labels:
|
|
291
|
-
bankName:
|
|
292
|
-
termsHref:
|
|
293
|
-
privacyHref:
|
|
294
|
-
electronicCommunicationHref:
|
|
295
|
-
patriotActHref:
|
|
261
|
+
I === 0 ? /* @__PURE__ */ C(ie, {
|
|
262
|
+
value: Ae,
|
|
263
|
+
onValueChange: je,
|
|
264
|
+
onSnapshotChange: Fe,
|
|
265
|
+
naicsOptions: Ye,
|
|
266
|
+
stateOptions: Xe,
|
|
267
|
+
isSubmitting: Q,
|
|
268
|
+
labels: j.businessDetails,
|
|
269
|
+
bankName: ct,
|
|
270
|
+
termsHref: xe,
|
|
271
|
+
privacyHref: Se,
|
|
272
|
+
electronicCommunicationHref: Ce,
|
|
273
|
+
patriotActHref: we
|
|
296
274
|
}, "business") : null,
|
|
297
|
-
|
|
298
|
-
value:
|
|
299
|
-
onValueChange:
|
|
300
|
-
onSnapshotChange:
|
|
301
|
-
stateOptions:
|
|
302
|
-
isSubmitting:
|
|
303
|
-
labels:
|
|
275
|
+
I === 1 ? /* @__PURE__ */ C(ae, {
|
|
276
|
+
value: R,
|
|
277
|
+
onValueChange: Me,
|
|
278
|
+
onSnapshotChange: Ie,
|
|
279
|
+
stateOptions: Ze,
|
|
280
|
+
isSubmitting: Q,
|
|
281
|
+
labels: j.personalDetails
|
|
304
282
|
}, "personal") : null,
|
|
305
|
-
|
|
306
|
-
owners:
|
|
307
|
-
onOwnersChange:
|
|
308
|
-
primaryOwnerName: `${
|
|
309
|
-
primaryOwnerPercentage:
|
|
310
|
-
stateOptions:
|
|
311
|
-
onSnapshotChange:
|
|
312
|
-
isSubmitting:
|
|
313
|
-
labels:
|
|
283
|
+
I === 2 ? /* @__PURE__ */ C(oe, {
|
|
284
|
+
owners: Ne,
|
|
285
|
+
onOwnersChange: Pe,
|
|
286
|
+
primaryOwnerName: `${R.firstName} ${R.lastName}`.trim(),
|
|
287
|
+
primaryOwnerPercentage: tt ? 100 : B?.ownsOver25Percent === !0 ? B.ownershipPercentage ?? 0 : 0,
|
|
288
|
+
stateOptions: Qe,
|
|
289
|
+
onSnapshotChange: Le,
|
|
290
|
+
isSubmitting: Q,
|
|
291
|
+
labels: j.additionalOwners
|
|
314
292
|
}) : null
|
|
315
293
|
]
|
|
316
|
-
})
|
|
294
|
+
}) });
|
|
317
295
|
}
|
|
318
|
-
function T({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework:
|
|
319
|
-
return /* @__PURE__ */ C(
|
|
296
|
+
function T({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework: s, errorFallback: c, onError: u, analytics: ee, disclosuresAcceptance: te, providerLabels: d, ...f }) {
|
|
297
|
+
return /* @__PURE__ */ C(l, {
|
|
320
298
|
baseUrl: e,
|
|
321
299
|
widgetToken: t,
|
|
322
300
|
organizationId: n,
|
|
@@ -324,19 +302,19 @@ function T({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gat
|
|
|
324
302
|
gatewayRouting: i,
|
|
325
303
|
linkComponent: a,
|
|
326
304
|
implementation: o,
|
|
327
|
-
uiFramework:
|
|
328
|
-
errorFallback:
|
|
329
|
-
onError:
|
|
330
|
-
analytics:
|
|
331
|
-
disclosuresAcceptance:
|
|
332
|
-
providerLabels:
|
|
333
|
-
widgetName:
|
|
334
|
-
children: /* @__PURE__ */ C(
|
|
305
|
+
uiFramework: s,
|
|
306
|
+
errorFallback: c,
|
|
307
|
+
onError: u,
|
|
308
|
+
analytics: ee,
|
|
309
|
+
disclosuresAcceptance: te,
|
|
310
|
+
providerLabels: d,
|
|
311
|
+
widgetName: _,
|
|
312
|
+
children: /* @__PURE__ */ C(E, { ...f })
|
|
335
313
|
});
|
|
336
314
|
}
|
|
337
|
-
function
|
|
338
|
-
let { initResponse: t } =
|
|
339
|
-
return n !== r && (i(n), r !== null && n !== null && o((e) => e + 1)), /* @__PURE__ */ C(
|
|
315
|
+
function E(e) {
|
|
316
|
+
let { initResponse: t } = d(), n = t?.userId ?? null, [r, i] = S(n), [a, o] = S(0);
|
|
317
|
+
return n !== r && (i(n), r !== null && n !== null && o((e) => e + 1)), /* @__PURE__ */ C(y, { children: /* @__PURE__ */ C(w, { ...e }, a) }, a);
|
|
340
318
|
}
|
|
341
319
|
//#endregion
|
|
342
320
|
export { T as BankAccountOnboardingWidget, T as default };
|
package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/ui/dist/index.js
CHANGED
|
@@ -11,7 +11,4 @@ import { BusinessDetailsPanel as c } from "./index18.js";
|
|
|
11
11
|
import { ABOUT_YOU_PANEL_LABELS_EN as l } from "./index21.js";
|
|
12
12
|
import { AboutYouPanel as u } from "./index22.js";
|
|
13
13
|
import { BusinessDisclosuresSection as d } from "./index23.js";
|
|
14
|
-
|
|
15
|
-
import "./index27.js";
|
|
16
|
-
import { MarketingWidget as f } from "./index28.js";
|
|
17
|
-
export { l as ABOUT_YOU_PANEL_LABELS_EN, e as ADDITIONAL_OWNERS_LABELS_EN, u as AboutYouPanel, t as AdditionalOwnersForm, n as BUSINESS_DETAILS_LABELS_EN, s as BUSINESS_DETAILS_PANEL_LABELS_EN, c as BusinessDetailsPanel, d as BusinessDisclosuresSection, f as MarketingWidget, i as PERSONAL_DETAILS_LABELS_EN, o as RESULT_LABELS_EN, a as ResultStep, r as interpolateBankName };
|
|
14
|
+
export { l as ABOUT_YOU_PANEL_LABELS_EN, e as ADDITIONAL_OWNERS_LABELS_EN, u as AboutYouPanel, t as AdditionalOwnersForm, n as BUSINESS_DETAILS_LABELS_EN, s as BUSINESS_DETAILS_PANEL_LABELS_EN, c as BusinessDetailsPanel, d as BusinessDisclosuresSection, i as PERSONAL_DETAILS_LABELS_EN, o as RESULT_LABELS_EN, a as ResultStep, r as interpolateBankName };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index2.js
|
|
2
|
+
var e = {
|
|
3
|
+
Mounted: "marketing.mounted",
|
|
4
|
+
OpenModal: "marketing.open_modal",
|
|
5
|
+
PrimaryCta: "marketing.primary_cta"
|
|
6
|
+
}, t = "marketing";
|
|
7
|
+
//#endregion
|
|
8
|
+
export { e as MarketingWidgetAnalyticsEvent, t as WIDGET_NAME };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../libs/tesouro-embedded-components-react/
|
|
1
|
+
//#region ../../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index3.js
|
|
2
2
|
var e = {
|
|
3
3
|
root: "marketing-widget",
|
|
4
4
|
learnMoreButton: "marketing-widget-learn-more-button",
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
"use client";
|
|
3
|
+
"use client";
|
|
4
|
+
"use client";
|
|
5
|
+
import { useOrganizationOnboardingSuppression as e } from "../../../shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js";
|
|
6
|
+
import "../../../shared/data-access/dist/index.js";
|
|
7
|
+
import { useAnalyticsTrack as t } from "../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
8
|
+
import { WidgetProvider as n } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
9
|
+
import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
10
|
+
import "../../../shared/feature/dist/index.js";
|
|
11
|
+
import { MarketingWidgetAnalyticsEvent as i, WIDGET_NAME as a } from "./index2.js";
|
|
12
|
+
import { marketingWidgetTestIds as o } from "./index3.js";
|
|
13
|
+
import { MARKETING_WIDGET_LABELS_EN as s } from "../../ui/dist/index2.js";
|
|
14
|
+
import { MarketingWidget as c } from "../../ui/dist/index5.js";
|
|
15
|
+
import "../../ui/dist/index.js";
|
|
16
|
+
import { useCallback as l, useEffect as u, useState as d } from "react";
|
|
17
|
+
import { jsx as f } from "react/jsx-runtime";
|
|
18
|
+
//#region ../../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index4.js
|
|
19
|
+
var p = /* @__PURE__ */ new Set([
|
|
20
|
+
"ACTIVE",
|
|
21
|
+
"INACTIVE",
|
|
22
|
+
"INVITED"
|
|
23
|
+
]);
|
|
24
|
+
function m({ content: n, onPrimaryCtaClick: a, labels: s }) {
|
|
25
|
+
let m = t(), { initResponse: h } = r(), g = e(), [_, v] = d(!1);
|
|
26
|
+
u(() => {
|
|
27
|
+
m(i.Mounted);
|
|
28
|
+
}, [m]);
|
|
29
|
+
let y = l(() => {
|
|
30
|
+
m(i.OpenModal), v(!0);
|
|
31
|
+
}, [m]), b = l(() => {
|
|
32
|
+
v(!1);
|
|
33
|
+
}, []), x = l(() => {
|
|
34
|
+
m(i.PrimaryCta), v(!1), a();
|
|
35
|
+
}, [a, m]);
|
|
36
|
+
return !h?.status || p.has(h.status) || g.isSuppressed || !g.isResolved ? null : /* @__PURE__ */ f(c, {
|
|
37
|
+
open: _,
|
|
38
|
+
vspLogo: n.vspLogo,
|
|
39
|
+
bankingText: n.bankingText,
|
|
40
|
+
primaryCaption: n.primaryCaption,
|
|
41
|
+
secondaryCaption: n.secondaryCaption,
|
|
42
|
+
providedByCaption: n.providedByCaption,
|
|
43
|
+
modalPrimaryImg: n.modalPrimaryImg,
|
|
44
|
+
primaryModalHeader: n.primaryModalHeader,
|
|
45
|
+
benefits: n.benefits,
|
|
46
|
+
appearance: n.appearance,
|
|
47
|
+
onOpenMarketingModal: y,
|
|
48
|
+
onCloseMarketingModal: b,
|
|
49
|
+
onPrimaryCtaClick: x,
|
|
50
|
+
labels: s,
|
|
51
|
+
testIds: {
|
|
52
|
+
root: o.root,
|
|
53
|
+
learnMoreButton: o.learnMoreButton,
|
|
54
|
+
modal: {
|
|
55
|
+
root: o.modal,
|
|
56
|
+
primaryCtaButton: o.primaryCtaButton
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function h({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gatewayRouting: o, linkComponent: s, implementation: c, uiFramework: l, errorFallback: u, onError: d, analytics: p, disclosuresAcceptance: h, providerLabels: g, ..._ }) {
|
|
62
|
+
return /* @__PURE__ */ f(n, {
|
|
63
|
+
widgetName: a,
|
|
64
|
+
baseUrl: e,
|
|
65
|
+
widgetToken: t,
|
|
66
|
+
organizationId: r,
|
|
67
|
+
configClient: i,
|
|
68
|
+
gatewayRouting: o,
|
|
69
|
+
linkComponent: s,
|
|
70
|
+
implementation: c,
|
|
71
|
+
uiFramework: l,
|
|
72
|
+
errorFallback: u,
|
|
73
|
+
onError: d,
|
|
74
|
+
analytics: p,
|
|
75
|
+
disclosuresAcceptance: h,
|
|
76
|
+
providerLabels: g,
|
|
77
|
+
children: /* @__PURE__ */ f(m, { ..._ })
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
export { s as MARKETING_WIDGET_LABELS_EN, h as MarketingWidget };
|