@tesouro/embedded-components-react 0.7.53 → 0.7.57
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 +13 -3
- package/dist/experimental/RemoteCheckCapture.d.ts +1 -32
- package/dist/experimental/index.d.ts +1 -32
- package/dist/index.css +12 -0
- package/dist/index.d.ts +58 -47
- package/dist/index.js +47 -46
- package/dist/lib/AcceptDisclosuresWidget.d.ts +1 -32
- package/dist/lib/BalancesWidget.d.ts +0 -31
- package/dist/lib/BankAccountOnboardingWidget.d.ts +1 -32
- package/dist/lib/BankAccountsWidget.d.ts +1 -32
- package/dist/lib/BankingComplianceBannerWidget.d.ts +643 -0
- package/dist/lib/BankingComplianceBannerWidget.js +5 -0
- package/dist/lib/BillPayWidget.d.ts +0 -31
- package/dist/lib/CardDetailsWidget.d.ts +1 -32
- package/dist/lib/CounterpartsWidget.d.ts +0 -31
- package/dist/lib/CounterpartsWidgetPublic.d.ts +0 -31
- package/dist/lib/CreditCardsWidget.d.ts +0 -31
- package/dist/lib/CustomersWidget.d.ts +1 -33
- package/dist/lib/DebitCardsWidget.d.ts +0 -31
- package/dist/lib/ExpenseManagementWidget.d.ts +0 -31
- package/dist/lib/InsightsWidget.d.ts +0 -31
- package/dist/lib/LinkedAccountsWidget.d.ts +1 -32
- package/dist/lib/OfferWidget.d.ts +1 -32
- package/dist/lib/ProductsWidget.d.ts +1 -32
- package/dist/lib/ReceivablesWidget.d.ts +1 -32
- package/dist/lib/SettingsWidget.d.ts +0 -31
- package/dist/lib/TransfersWidget.d.ts +0 -31
- package/dist/lib/WidgetProvider.d.ts +2 -33
- package/dist/lib/WidgetProvider.js +9 -10
- package/dist/lib/WidgetProviderPublic.d.ts +0 -31
- package/dist/lib/WidgetSuite.d.ts +1 -32
- package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js +395 -396
- package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/lib/BankAccountsWidget/BankAccountsWidget.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/banking-compliance-banner-widget/data-access/dist/index.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/banking-compliance-banner-widget/data-access/dist/index2.js +7 -0
- package/dist/libs/tesouro-embedded-components-react/banking-compliance-banner-widget/data-access/dist/index3.js +42 -0
- package/dist/libs/tesouro-embedded-components-react/banking-compliance-banner-widget/feature/dist/index.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/banking-compliance-banner-widget/feature/dist/lib/BankingComplianceBannerWidget/BankingComplianceBannerWidget.js +52 -0
- package/dist/libs/tesouro-embedded-components-react/banking-compliance-banner-widget/feature/dist/lib/BankingComplianceBannerWidget/isFdicBacked.js +8 -0
- package/dist/libs/tesouro-embedded-components-react/banking-compliance-banner-widget/feature/dist/lib/analytics/events.js +4 -0
- package/dist/libs/tesouro-embedded-components-react/banking-compliance-banner-widget/feature/dist/lib/testIds.js +10 -0
- package/dist/libs/tesouro-embedded-components-react/banking-compliance-banner-widget/ui/dist/index.js +3 -0
- package/dist/libs/tesouro-embedded-components-react/banking-compliance-banner-widget/ui/dist/index2.js +40 -0
- package/dist/libs/tesouro-embedded-components-react/banking-compliance-banner-widget/ui/dist/index3.js +10 -0
- package/dist/libs/tesouro-embedded-components-react/banking-compliance-banner-widget/ui/dist/index4.js +60 -0
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +16 -18
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/feature/dist/index8.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index20.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillPayWidget.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/feature/dist/index14.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/lib/CardDetailsWidget.js +83 -84
- package/dist/libs/tesouro-embedded-components-react/cards-widget/create-card/feature/dist/index8.js +15 -16
- package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/lib/CardsWidget.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/CounterpartsWidget.js +9 -10
- package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/ReceivablesWidget.js +25 -26
- package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/lib/LinkedAccountsWidget.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/OfferWidget/OfferWidget.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/lib/ProductsWidget/ProductsWidget.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/remote-check-capture/feature/dist/lib/RemoteCheckCaptureWidget/RemoteCheckCaptureWidget.js +9 -10
- package/dist/libs/tesouro-embedded-components-react/settings-widget/chart-of-accounts/feature/dist/index8.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/settings-widget/help/feature/dist/index3.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/settings-widget/invoice-settings/feature/dist/index10.js +9 -10
- package/dist/libs/tesouro-embedded-components-react/settings-widget/profile/feature/dist/index4.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/settings-widget/team/feature/dist/index17.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/shared/bank-disclosures/feature/dist/lib/BankDisclosuresWidget/BankDisclosuresWidget.js +8 -9
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/index.js +16 -17
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +45 -49
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +91 -95
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/hooks.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/index.js +0 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/isDisclosuresAcceptanceRequired.js +2 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
- package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/lib/WidgetSuite/WidgetSuite.js +120 -121
- package/package.json +1 -1
- package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/types.js +0 -8
|
@@ -30,85 +30,85 @@ import { useContext as ye, useEffect as p, useMemo as m, useRef as h, useState a
|
|
|
30
30
|
import { jsx as _ } from "react/jsx-runtime";
|
|
31
31
|
import { QueryClient as xe, QueryClientProvider as Se } from "@tanstack/react-query";
|
|
32
32
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js
|
|
33
|
-
function v({ children: ne, baseUrl: s, widgetToken: c, organizationId: l, configClient: u, gatewayRouting: d, linkComponent: f, uiFramework: v,
|
|
34
|
-
let
|
|
35
|
-
enabled:
|
|
36
|
-
organizationId:
|
|
37
|
-
rootCorrelationId:
|
|
38
|
-
widgetName:
|
|
39
|
-
widgetInstanceId:
|
|
40
|
-
}),
|
|
33
|
+
function v({ children: ne, baseUrl: s, widgetToken: c, organizationId: l, configClient: u, gatewayRouting: d, linkComponent: f, uiFramework: v, errorFallback: we, onError: Te, analytics: y, disclosuresAcceptance: Ee, providerLabels: De, widgetName: b }) {
|
|
34
|
+
let x = ye(ce), Oe = be(ae, ie, ie), S = x?.resolved ?? Oe, ke = x?.refetch ?? le, Ae = x?.loading ?? !1, je = x?.error ?? null, C = s ?? S.baseUrl, w = c === void 0 ? S.widgetToken : c, Me = x ? x.cascadeOrgId : Oe.organizationId, T = l === void 0 ? Me : l, E = u ?? S.configClient, D = d ?? S.gatewayRouting, O = f ?? S.linkComponent, k = v ?? S.uiFramework, A = Ee ?? x?.disclosuresAcceptance, j = De ?? x?.providerLabels, M = m(() => ge(j), [j]), N = x === null, P = N ? y !== !1 : x.analytics.enabled, [Ne] = g(se), F = N ? Ne : x.analytics.rootCorrelationId, [Pe] = g(se), I = b === void 0 ? x?.analytics.widgetName : b, L = b === void 0 ? x?.analytics.widgetInstanceId : Pe, R = h({
|
|
35
|
+
enabled: P,
|
|
36
|
+
organizationId: T,
|
|
37
|
+
rootCorrelationId: F,
|
|
38
|
+
widgetName: I,
|
|
39
|
+
widgetInstanceId: L
|
|
40
|
+
}), z = h(!1);
|
|
41
41
|
p(() => {
|
|
42
|
-
|
|
43
|
-
}, [
|
|
44
|
-
if (!
|
|
42
|
+
N || y === void 0 || z.current || (z.current = !0, console.warn("[tesouro-embedded] `analytics` on a nested WidgetProvider is ignored in v1. Set it on the outermost RootWidgetProvider or standalone WidgetProvider instead."));
|
|
43
|
+
}, [y, N]), p(() => {
|
|
44
|
+
if (!N || !P || !("window" in globalThis)) return;
|
|
45
45
|
let e = !1;
|
|
46
46
|
return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled: t }) => {
|
|
47
47
|
e || t();
|
|
48
48
|
}), () => {
|
|
49
49
|
e = !0;
|
|
50
50
|
};
|
|
51
|
-
}, [
|
|
52
|
-
let
|
|
51
|
+
}, [N, P]);
|
|
52
|
+
let B = te(o(k));
|
|
53
53
|
p(() => {
|
|
54
|
-
|
|
55
|
-
}, [
|
|
56
|
-
let
|
|
57
|
-
|
|
58
|
-
let
|
|
59
|
-
if (!
|
|
60
|
-
let e = oe(r(
|
|
61
|
-
tokenRef:
|
|
62
|
-
analyticsContextRef:
|
|
63
|
-
clientSecretRef:
|
|
64
|
-
gatewayRouting:
|
|
54
|
+
B && B().catch(() => {});
|
|
55
|
+
}, [B]);
|
|
56
|
+
let V = x === null || s !== void 0 || c !== void 0 || l !== void 0 || u != null || d !== void 0 || b !== void 0, Fe = h(w);
|
|
57
|
+
Fe.current = w;
|
|
58
|
+
let Ie = h(null), Le = m(() => e(Ie), []), Re = a(), ze = de(w), H = m(() => {
|
|
59
|
+
if (!V) return null;
|
|
60
|
+
let e = oe(r(C), {
|
|
61
|
+
tokenRef: Fe,
|
|
62
|
+
analyticsContextRef: R,
|
|
63
|
+
clientSecretRef: Ie,
|
|
64
|
+
gatewayRouting: D
|
|
65
65
|
});
|
|
66
|
-
return
|
|
66
|
+
return E ? E(e) : e;
|
|
67
67
|
}, [
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
]), U =
|
|
73
|
-
hasToken: !!
|
|
68
|
+
V,
|
|
69
|
+
C,
|
|
70
|
+
E,
|
|
71
|
+
D
|
|
72
|
+
]), U = x === null || s !== void 0 || c !== void 0, Be = U ? ze : Re.authEpoch, { result: W, loading: G, error: K, clearedForAuthChange: Ve, initStaleForToken: q, initReplacementPending: He, refetch: Ue } = fe(U ? H : null, U ? w : void 0, R), We = U ? Ue : ke, Ge = U ? G : Ae, Ke = U ? K : je, qe = x?.resolved.initResponse, Je = !U || !Ve && !K && !W && !!w && !G, J = Je ? qe : W ?? void 0, Y = Je ? U || (x?.initResponseStaleForToken ?? !1) : q, Ye = x === null, Xe = m(() => Ye ? me({
|
|
73
|
+
hasToken: !!w,
|
|
74
74
|
loading: G,
|
|
75
75
|
error: K,
|
|
76
76
|
initResponse: W ?? void 0,
|
|
77
77
|
initStaleForToken: q
|
|
78
78
|
}) : null, [
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
Ye,
|
|
80
|
+
w,
|
|
81
81
|
G,
|
|
82
82
|
K,
|
|
83
83
|
W,
|
|
84
84
|
q
|
|
85
85
|
]);
|
|
86
|
-
he(
|
|
87
|
-
let X = ue(
|
|
86
|
+
he(Xe, w);
|
|
87
|
+
let X = ue(T, Y ? void 0 : J?.organizationId), Ze = pe({
|
|
88
88
|
organizationId: X,
|
|
89
|
-
cascadeOrgId:
|
|
89
|
+
cascadeOrgId: T,
|
|
90
90
|
ownsFetch: U,
|
|
91
|
-
parentStatus:
|
|
92
|
-
hasToken: !!
|
|
91
|
+
parentStatus: Re.organizationStatus,
|
|
92
|
+
hasToken: !!w,
|
|
93
93
|
loading: G,
|
|
94
94
|
error: K,
|
|
95
95
|
hasResult: !!W,
|
|
96
|
-
initReplacementPending:
|
|
96
|
+
initReplacementPending: He
|
|
97
97
|
}), Z = m(() => ({
|
|
98
|
-
enabled:
|
|
98
|
+
enabled: P,
|
|
99
99
|
organizationId: X,
|
|
100
|
-
rootCorrelationId:
|
|
101
|
-
widgetName:
|
|
102
|
-
widgetInstanceId:
|
|
100
|
+
rootCorrelationId: F,
|
|
101
|
+
widgetName: I,
|
|
102
|
+
widgetInstanceId: L
|
|
103
103
|
}), [
|
|
104
|
-
|
|
104
|
+
P,
|
|
105
105
|
X,
|
|
106
|
+
F,
|
|
106
107
|
I,
|
|
107
|
-
L
|
|
108
|
-
R
|
|
108
|
+
L
|
|
109
109
|
]);
|
|
110
|
-
|
|
111
|
-
let [Q] = g(() =>
|
|
110
|
+
R.current = Z;
|
|
111
|
+
let [Q] = g(() => x === null ? new xe({ defaultOptions: {
|
|
112
112
|
queries: {
|
|
113
113
|
retry: !1,
|
|
114
114
|
refetchOnWindowFocus: !1
|
|
@@ -120,15 +120,14 @@ function v({ children: ne, baseUrl: s, widgetToken: c, organizationId: l, config
|
|
|
120
120
|
let e = Q;
|
|
121
121
|
return t(e), () => n(e);
|
|
122
122
|
}, [Q]);
|
|
123
|
-
let
|
|
123
|
+
let Qe = m(() => ({
|
|
124
124
|
baseUrl: s,
|
|
125
125
|
widgetToken: c,
|
|
126
126
|
organizationId: l,
|
|
127
127
|
configClient: u,
|
|
128
128
|
gatewayRouting: d,
|
|
129
129
|
linkComponent: f,
|
|
130
|
-
uiFramework: v
|
|
131
|
-
implementation: y
|
|
130
|
+
uiFramework: v
|
|
132
131
|
}), [
|
|
133
132
|
s,
|
|
134
133
|
c,
|
|
@@ -136,76 +135,73 @@ function v({ children: ne, baseUrl: s, widgetToken: c, organizationId: l, config
|
|
|
136
135
|
u,
|
|
137
136
|
d,
|
|
138
137
|
f,
|
|
139
|
-
v
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
widgetToken: T,
|
|
138
|
+
v
|
|
139
|
+
]), $e = m(() => ({
|
|
140
|
+
baseUrl: C,
|
|
141
|
+
widgetToken: w,
|
|
144
142
|
organizationId: X,
|
|
145
|
-
configClient:
|
|
146
|
-
gatewayRouting:
|
|
147
|
-
linkComponent:
|
|
148
|
-
uiFramework:
|
|
149
|
-
implementation: j,
|
|
143
|
+
configClient: E,
|
|
144
|
+
gatewayRouting: D,
|
|
145
|
+
linkComponent: O,
|
|
146
|
+
uiFramework: k,
|
|
150
147
|
initResponse: J
|
|
151
148
|
}), [
|
|
149
|
+
C,
|
|
152
150
|
w,
|
|
153
|
-
T,
|
|
154
151
|
X,
|
|
152
|
+
E,
|
|
155
153
|
D,
|
|
156
154
|
O,
|
|
157
155
|
k,
|
|
158
|
-
A,
|
|
159
|
-
j,
|
|
160
156
|
J
|
|
161
|
-
]),
|
|
162
|
-
resolved:
|
|
163
|
-
own:
|
|
164
|
-
refetch:
|
|
165
|
-
loading:
|
|
166
|
-
error:
|
|
157
|
+
]), et = m(() => ({
|
|
158
|
+
resolved: $e,
|
|
159
|
+
own: Qe,
|
|
160
|
+
refetch: We,
|
|
161
|
+
loading: Ge,
|
|
162
|
+
error: Ke,
|
|
167
163
|
analytics: Z,
|
|
168
|
-
cascadeOrgId:
|
|
164
|
+
cascadeOrgId: T,
|
|
169
165
|
initResponseStaleForToken: Y,
|
|
170
|
-
disclosuresAcceptance:
|
|
171
|
-
providerLabels:
|
|
166
|
+
disclosuresAcceptance: A,
|
|
167
|
+
providerLabels: j
|
|
172
168
|
}), [
|
|
173
|
-
|
|
174
|
-
|
|
169
|
+
$e,
|
|
170
|
+
Qe,
|
|
171
|
+
We,
|
|
172
|
+
Ge,
|
|
175
173
|
Ke,
|
|
176
|
-
qe,
|
|
177
|
-
Je,
|
|
178
174
|
Z,
|
|
179
|
-
|
|
175
|
+
T,
|
|
180
176
|
Y,
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
]),
|
|
184
|
-
value:
|
|
177
|
+
A,
|
|
178
|
+
j
|
|
179
|
+
]), tt = /* @__PURE__ */ _(ce.Provider, {
|
|
180
|
+
value: et,
|
|
185
181
|
children: /* @__PURE__ */ _(ee, {
|
|
186
|
-
linkComponent:
|
|
187
|
-
uiFramework:
|
|
182
|
+
linkComponent: O,
|
|
183
|
+
uiFramework: k,
|
|
188
184
|
children: /* @__PURE__ */ _(re, { children: /* @__PURE__ */ _(_e, {
|
|
189
|
-
resetKeys: [
|
|
185
|
+
resetKeys: [w],
|
|
190
186
|
errorFallback: we,
|
|
191
187
|
onError: Te,
|
|
192
|
-
labels:
|
|
193
|
-
children: ve(J,
|
|
194
|
-
disclosuresAcceptance:
|
|
188
|
+
labels: M,
|
|
189
|
+
children: ve(J, b) ? /* @__PURE__ */ _(Ce, {
|
|
190
|
+
disclosuresAcceptance: A,
|
|
195
191
|
initStaleForToken: Y,
|
|
196
|
-
labels:
|
|
192
|
+
labels: M
|
|
197
193
|
}) : ne
|
|
198
194
|
}) })
|
|
199
195
|
})
|
|
200
196
|
}), $ = H ? /* @__PURE__ */ _(i, {
|
|
201
197
|
client: H,
|
|
202
198
|
organizationId: X,
|
|
203
|
-
widgetToken:
|
|
204
|
-
installClientSecret:
|
|
205
|
-
authEpoch:
|
|
206
|
-
organizationStatus:
|
|
207
|
-
children:
|
|
208
|
-
}) :
|
|
199
|
+
widgetToken: w,
|
|
200
|
+
installClientSecret: Le,
|
|
201
|
+
authEpoch: Be,
|
|
202
|
+
organizationStatus: Ze,
|
|
203
|
+
children: tt
|
|
204
|
+
}) : tt;
|
|
209
205
|
return Q ? /* @__PURE__ */ _(Se, {
|
|
210
206
|
client: Q,
|
|
211
207
|
children: $
|
|
@@ -3,7 +3,8 @@ var e = "widget-disclosures-required", t = /* @__PURE__ */ new Set([
|
|
|
3
3
|
"accept_disclosures",
|
|
4
4
|
"onboarding",
|
|
5
5
|
"marketing",
|
|
6
|
-
"widget_suite"
|
|
6
|
+
"widget_suite",
|
|
7
|
+
"banking_compliance_banner"
|
|
7
8
|
]);
|
|
8
9
|
function n(e) {
|
|
9
10
|
return e?.disclosuresRequired === "REQUIRED" && e?.disclosuresAccepted === !1;
|
package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
|
|
2
|
-
var e = "@tesouro/embedded-components-react", t = "0.7.
|
|
2
|
+
var e = "@tesouro/embedded-components-react", t = "0.7.57", n = "5b361b9ab8a83f9f9e3afc8fed9495610a25615a", r = Object.freeze({
|
|
3
3
|
library_name: e,
|
|
4
4
|
library_version: t,
|
|
5
5
|
library_sha: n
|
|
@@ -16,175 +16,174 @@ import { useOrganizationApplicationStatus as d } from "../../../../../shared/dat
|
|
|
16
16
|
import "../../../../../shared/data-access/dist/index.js";
|
|
17
17
|
import { ErrorState as f } from "../../../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
|
|
18
18
|
import "../../../../../shared/ui/dist/index.js";
|
|
19
|
-
import { useAnalyticsTrack as
|
|
20
|
-
import { WidgetProvider as
|
|
21
|
-
import { useRefetchWidget as
|
|
22
|
-
import { deniedNoticeExpiresAt as
|
|
19
|
+
import { useAnalyticsTrack as ee } from "../../../../../shared/feature/dist/lib/analytics/hooks.js";
|
|
20
|
+
import { WidgetProvider as p } from "../../../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
|
|
21
|
+
import { useRefetchWidget as m, useWidgetConfig as te, useWidgetError as h, useWidgetInitStaleForToken as g, useWidgetLoading as _ } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
|
|
22
|
+
import { deniedNoticeExpiresAt as ne, selectBankAccountApplication as re } from "../../../../../shared/feature/dist/lib/application/bankAccountApplication.js";
|
|
23
23
|
import "../../../../../shared/feature/dist/index.js";
|
|
24
|
-
import { WIDGET_SUITE_SECTIONS as
|
|
25
|
-
import { WIDGET_NAME as
|
|
26
|
-
import { needsDisclosureAcceptance as
|
|
27
|
-
import { AcceptDisclosuresWidget as
|
|
24
|
+
import { WIDGET_SUITE_SECTIONS as ie } from "./sections/index.js";
|
|
25
|
+
import { WIDGET_NAME as v, WidgetSuiteAnalyticsEvent as y } from "../analytics/events.js";
|
|
26
|
+
import { needsDisclosureAcceptance as b } from "./disclosureGate.js";
|
|
27
|
+
import { AcceptDisclosuresWidget as ae } from "../../../../../accept-disclosures-widget/feature/dist/lib/AcceptDisclosuresWidget/AcceptDisclosuresWidget.js";
|
|
28
28
|
import "../../../../../accept-disclosures-widget/feature/dist/index.js";
|
|
29
|
-
import { OnboardingApplicationView as
|
|
30
|
-
import { BankAccountOnboardingWidget as
|
|
29
|
+
import { OnboardingApplicationView as x, onboardingApplicationViewFor as S } from "../../../../../bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/applicationStatusView.js";
|
|
30
|
+
import { BankAccountOnboardingWidget as oe } from "../../../../../bank-account-onboarding-widget/feature/dist/lib/BankAccountOnboardingWidget/BankAccountOnboardingWidget.js";
|
|
31
31
|
import "../../../../../bank-account-onboarding-widget/feature/dist/index.js";
|
|
32
|
-
import { useCallback as
|
|
33
|
-
import { Fragment as
|
|
32
|
+
import { useCallback as C, useEffect as w, useMemo as se, useReducer as T, useRef as E, useState as D } from "react";
|
|
33
|
+
import { Fragment as ce, jsx as O, jsxs as le } from "react/jsx-runtime";
|
|
34
34
|
//#region ../../libs/tesouro-embedded-components-react/widget-suite/feature/dist/lib/WidgetSuite/WidgetSuite.js
|
|
35
|
-
var
|
|
35
|
+
var k = {
|
|
36
36
|
initFailed: "widget-suite-init-failed",
|
|
37
37
|
disclosuresRefreshFailed: "widget-suite-disclosures-refresh-failed",
|
|
38
38
|
applicationUnavailable: "widget-suite-application-unavailable"
|
|
39
|
-
},
|
|
40
|
-
function
|
|
41
|
-
let { availableSections: c, activeSection:
|
|
42
|
-
|
|
43
|
-
let
|
|
44
|
-
|
|
45
|
-
if (
|
|
46
|
-
let e =
|
|
39
|
+
}, A = 2 ** 31 - 1;
|
|
40
|
+
function j({ showSectionTitle: n = !0, onboardingDisclosureLinks: r, onApplicantLatchChange: a, onResultScreenHeldChange: s }) {
|
|
41
|
+
let { availableSections: c, activeSection: ee, labels: p, navigate: v } = o(), { initResponse: y } = te(), j = h(), M = g(), N = _(), P = m(), F = u(), I = d(), L = se(() => re(I.applications), [I.applications]), R = E(null);
|
|
42
|
+
I.isResolved && (R.current = { application: L });
|
|
43
|
+
let z = I.isResolved ? L : R.current?.application ?? null, [ue, de] = T((e) => e + 1, 0), B = ne(z);
|
|
44
|
+
w(() => {
|
|
45
|
+
if (B === null) return;
|
|
46
|
+
let e = B - Date.now();
|
|
47
47
|
if (e < 0) return;
|
|
48
|
-
let t = setTimeout(
|
|
48
|
+
let t = setTimeout(de, Math.min(e + 1, A));
|
|
49
49
|
return () => clearTimeout(t);
|
|
50
|
-
}, [
|
|
51
|
-
let
|
|
52
|
-
|
|
53
|
-
a(
|
|
54
|
-
}, [
|
|
55
|
-
let [
|
|
56
|
-
|
|
57
|
-
s(
|
|
58
|
-
}, [
|
|
59
|
-
let
|
|
60
|
-
|
|
61
|
-
!
|
|
62
|
-
}, [
|
|
63
|
-
|
|
64
|
-
}, [
|
|
65
|
-
Z ? Q.current || (Q.current = !0, De(!0),
|
|
66
|
-
}, [Z,
|
|
67
|
-
let $ = () => /* @__PURE__ */
|
|
50
|
+
}, [B, ue]);
|
|
51
|
+
let V = S(z), [H, fe] = D(!1), [U, pe] = D(!1), me = F.isResolved || U, he = C((e) => v(e), [v]), [W, ge] = D(!1), _e = C(() => ge(!0), []), [G, ve] = D(!1), ye = G || H;
|
|
52
|
+
w(() => {
|
|
53
|
+
a(ye);
|
|
54
|
+
}, [ye, a]);
|
|
55
|
+
let [be, xe] = D(!1), Se = H && !be;
|
|
56
|
+
w(() => {
|
|
57
|
+
s(Se);
|
|
58
|
+
}, [Se, s]);
|
|
59
|
+
let K = b(y), q = p.disclosure, J = p.onboardingGate, Y = y?.status === "INVITED", X = y?.status === "ACTIVE" || y?.status === "INACTIVE", Ce = !!(y && M), we = Ce && (Y || X), Te = !y && !j || we && !j, Z = !!y && !Te && !Ce && !Y && !X && me && F.reason === l.OrganizationApplicationComplete && !G, Q = E(!1), [Ee, De] = D(!1);
|
|
60
|
+
w(() => {
|
|
61
|
+
!K && W && ge(!1);
|
|
62
|
+
}, [W, K]), w(() => {
|
|
63
|
+
F.isResolved && !U && pe(!0);
|
|
64
|
+
}, [F.isResolved, U]), w(() => {
|
|
65
|
+
Z ? Q.current || (Q.current = !0, De(!0), P()) : (Q.current = !1, De(!1));
|
|
66
|
+
}, [Z, P]);
|
|
67
|
+
let $ = () => /* @__PURE__ */ O(e, {
|
|
68
68
|
isLoading: !0,
|
|
69
69
|
sections: [],
|
|
70
70
|
selectedSectionId: "",
|
|
71
|
-
onSectionChange:
|
|
72
|
-
labels:
|
|
71
|
+
onSectionChange: he,
|
|
72
|
+
labels: p.shell
|
|
73
73
|
});
|
|
74
74
|
if (Te) return $();
|
|
75
|
-
if ((!
|
|
76
|
-
title:
|
|
77
|
-
description:
|
|
78
|
-
retryLabel:
|
|
79
|
-
onRetry:
|
|
80
|
-
testId:
|
|
75
|
+
if ((!y || we) && j) return /* @__PURE__ */ O(f, {
|
|
76
|
+
title: q.initFailedState.title,
|
|
77
|
+
description: q.initFailedState.body,
|
|
78
|
+
retryLabel: q.initFailedState.retryButton,
|
|
79
|
+
onRetry: P,
|
|
80
|
+
testId: k.initFailed
|
|
81
81
|
});
|
|
82
|
-
let Oe = () =>
|
|
83
|
-
title:
|
|
84
|
-
description:
|
|
85
|
-
retryLabel:
|
|
86
|
-
onRetry:
|
|
87
|
-
testId:
|
|
88
|
-
}) : /* @__PURE__ */
|
|
89
|
-
if (
|
|
90
|
-
if (
|
|
91
|
-
} else return
|
|
92
|
-
title:
|
|
93
|
-
description:
|
|
94
|
-
retryLabel:
|
|
95
|
-
onRetry:
|
|
96
|
-
testId:
|
|
97
|
-
}) : $() : !
|
|
98
|
-
title:
|
|
99
|
-
description:
|
|
100
|
-
retryLabel:
|
|
101
|
-
onRetry:
|
|
102
|
-
testId:
|
|
103
|
-
}) : /* @__PURE__ */
|
|
82
|
+
let Oe = () => W && j ? /* @__PURE__ */ O(f, {
|
|
83
|
+
title: q.refreshFailedState.title,
|
|
84
|
+
description: q.refreshFailedState.body,
|
|
85
|
+
retryLabel: q.refreshFailedState.retryButton,
|
|
86
|
+
onRetry: P,
|
|
87
|
+
testId: k.disclosuresRefreshFailed
|
|
88
|
+
}) : /* @__PURE__ */ O(ae, { onAccepted: _e });
|
|
89
|
+
if (Y || X) {
|
|
90
|
+
if (K) return Oe();
|
|
91
|
+
} else return me ? Z ? j || Ee && !N ? /* @__PURE__ */ O(f, {
|
|
92
|
+
title: q.initFailedState.title,
|
|
93
|
+
description: q.initFailedState.body,
|
|
94
|
+
retryLabel: q.initFailedState.retryButton,
|
|
95
|
+
onRetry: P,
|
|
96
|
+
testId: k.initFailed
|
|
97
|
+
}) : $() : !I.isResolved && V !== x.Form && !H ? $() : (V === x.Hidden || V === x.Form && F.isSuppressed) && z?.status !== "COMPLETE" && !H && !G ? /* @__PURE__ */ O(f, {
|
|
98
|
+
title: J.applicationUnavailableState.title,
|
|
99
|
+
description: J.applicationUnavailableState.body,
|
|
100
|
+
retryLabel: J.applicationUnavailableState.retryButton,
|
|
101
|
+
onRetry: F.refetch,
|
|
102
|
+
testId: k.applicationUnavailable
|
|
103
|
+
}) : /* @__PURE__ */ O(oe, {
|
|
104
104
|
isFullScreenInline: !0,
|
|
105
105
|
showApplicationStatusRefresh: !0,
|
|
106
|
-
onResultPhaseChange:
|
|
107
|
-
onEmbeddedOnboardingCompletedSuccessfully: () =>
|
|
106
|
+
onResultPhaseChange: fe,
|
|
107
|
+
onEmbeddedOnboardingCompletedSuccessfully: () => ve(!0),
|
|
108
108
|
onNavigateToDashboard: () => {
|
|
109
|
-
|
|
109
|
+
xe(!0), c.includes(i.Dashboard) && v(i.Dashboard), P();
|
|
110
110
|
},
|
|
111
111
|
disclosureLinks: r,
|
|
112
|
-
...
|
|
112
|
+
...p.onboarding
|
|
113
113
|
}) : $();
|
|
114
|
-
let ke =
|
|
115
|
-
let { Content: r, placesOwnTitle: a } =
|
|
114
|
+
let ke = y?.bankName?.trim(), Ae = ke ? p.sectionTitle.bankTagline.replaceAll("{bankName}", ke) : void 0, je = c.map((e) => {
|
|
115
|
+
let { Content: r, placesOwnTitle: a } = ie[e], o = p.menu[e], s = e === i.Accounts ? void 0 : Ae, c = (e) => /* @__PURE__ */ O(t, {
|
|
116
116
|
title: o,
|
|
117
117
|
bankTagline: s,
|
|
118
118
|
children: e
|
|
119
|
-
}), l = /* @__PURE__ */
|
|
120
|
-
return n && (l = a ? /* @__PURE__ */
|
|
119
|
+
}), l = /* @__PURE__ */ O(r, {});
|
|
120
|
+
return n && (l = a ? /* @__PURE__ */ O(r, { renderTitle: c }) : /* @__PURE__ */ le(ce, { children: [c(), /* @__PURE__ */ O(r, {})] })), {
|
|
121
121
|
id: e,
|
|
122
122
|
label: o,
|
|
123
123
|
content: l
|
|
124
124
|
};
|
|
125
125
|
});
|
|
126
|
-
return /* @__PURE__ */
|
|
126
|
+
return /* @__PURE__ */ O(e, {
|
|
127
127
|
sections: je,
|
|
128
|
-
selectedSectionId:
|
|
129
|
-
onSectionChange:
|
|
130
|
-
labels:
|
|
128
|
+
selectedSectionId: ee ?? "",
|
|
129
|
+
onSectionChange: he,
|
|
130
|
+
labels: p.shell
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
-
function
|
|
134
|
-
let f =
|
|
135
|
-
|
|
136
|
-
f(
|
|
133
|
+
function M({ sections: e = r, section: t, defaultSection: i, onSectionChange: o, labels: l, cardArtSrc: u, ...d }) {
|
|
134
|
+
let f = ee();
|
|
135
|
+
w(() => {
|
|
136
|
+
f(y.Mounted);
|
|
137
137
|
}, [f]);
|
|
138
|
-
let { initResponse:
|
|
139
|
-
|
|
140
|
-
let [
|
|
141
|
-
|
|
142
|
-
let
|
|
143
|
-
|
|
144
|
-
let
|
|
145
|
-
|
|
146
|
-
let [
|
|
147
|
-
|
|
148
|
-
}, [
|
|
149
|
-
|
|
150
|
-
let
|
|
151
|
-
let t =
|
|
152
|
-
return !!t && (!t.anyOfScopes || c(
|
|
138
|
+
let { initResponse: p } = te(), m = p?.scopes, { client: h, widgetToken: g } = s(), _ = p?.userId ?? null, [ne, re] = D(_), [v, b] = D(0);
|
|
139
|
+
_ !== ne && (re(_), ne !== null && b((e) => e + 1));
|
|
140
|
+
let [ae, x] = D(h);
|
|
141
|
+
h !== ae && (x(h), b((e) => e + 1));
|
|
142
|
+
let S = !!g, [oe, C] = D(S);
|
|
143
|
+
S !== oe && (C(S), b((e) => e + 1));
|
|
144
|
+
let T = p?.organizationId ?? null, [E, ce] = D(T);
|
|
145
|
+
T !== E && (ce(T), E !== null && b((e) => e + 1));
|
|
146
|
+
let [le, k] = D(!1), [A, M] = D(!1), [N, P] = D(null), F = () => {
|
|
147
|
+
k(!1), b((e) => e + 1);
|
|
148
|
+
}, [I, L] = D(g);
|
|
149
|
+
g !== I && (L(g), le && _ === null && T === null && S === !!I && (A ? P(v) : F())), N !== null && !A && (P(null), N === v && _ === null && T === null && F());
|
|
150
|
+
let R = se(() => n(l), [l]), z = e.filter((e) => {
|
|
151
|
+
let t = ie[e];
|
|
152
|
+
return !!t && (!t.anyOfScopes || c(m, t.anyOfScopes));
|
|
153
153
|
});
|
|
154
|
-
return /* @__PURE__ */
|
|
154
|
+
return /* @__PURE__ */ O(a, {
|
|
155
155
|
sections: e,
|
|
156
|
-
availableSections:
|
|
157
|
-
grantedScopes:
|
|
158
|
-
labels:
|
|
156
|
+
availableSections: z,
|
|
157
|
+
grantedScopes: m,
|
|
158
|
+
labels: R,
|
|
159
159
|
section: t,
|
|
160
160
|
defaultSection: i,
|
|
161
161
|
onSectionChange: o,
|
|
162
162
|
cardArtSrc: u,
|
|
163
|
-
children: /* @__PURE__ */
|
|
164
|
-
onApplicantLatchChange:
|
|
165
|
-
onResultScreenHeldChange:
|
|
163
|
+
children: /* @__PURE__ */ O(j, {
|
|
164
|
+
onApplicantLatchChange: k,
|
|
165
|
+
onResultScreenHeldChange: M,
|
|
166
166
|
...d
|
|
167
|
-
},
|
|
167
|
+
}, v)
|
|
168
168
|
});
|
|
169
169
|
}
|
|
170
|
-
function
|
|
171
|
-
return /* @__PURE__ */
|
|
172
|
-
widgetName:
|
|
170
|
+
function N({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, uiFramework: o, errorFallback: s, onError: c, analytics: l, disclosuresAcceptance: u, providerLabels: d, ...f }) {
|
|
171
|
+
return /* @__PURE__ */ O(p, {
|
|
172
|
+
widgetName: v,
|
|
173
173
|
baseUrl: e,
|
|
174
174
|
widgetToken: t,
|
|
175
175
|
organizationId: n,
|
|
176
176
|
configClient: r,
|
|
177
177
|
gatewayRouting: i,
|
|
178
178
|
linkComponent: a,
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
children: /* @__PURE__ */ k(N, { ...p })
|
|
179
|
+
uiFramework: o,
|
|
180
|
+
errorFallback: s,
|
|
181
|
+
onError: c,
|
|
182
|
+
analytics: l,
|
|
183
|
+
disclosuresAcceptance: u,
|
|
184
|
+
providerLabels: d,
|
|
185
|
+
children: /* @__PURE__ */ O(M, { ...f })
|
|
187
186
|
});
|
|
188
187
|
}
|
|
189
188
|
//#endregion
|
|
190
|
-
export {
|
|
189
|
+
export { k as WIDGET_SUITE_TEST_IDS, N as WidgetSuite, N as default };
|
package/package.json
CHANGED