@tesouro/embedded-components-react 0.5.77 → 0.5.80

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.
@@ -43,181 +43,181 @@ import { usePayableDetailActions as ve } from "./index36.js";
43
43
  import { useScheduledPayment as ye } from "./index37.js";
44
44
  import { BILL_DETAILS_LABELS_EN as m } from "./index62.js";
45
45
  import { useMemo as h, useRef as be } from "react";
46
- import { Fragment as xe, jsx as g, jsxs as _ } from "react/jsx-runtime";
46
+ import { Fragment as xe, jsx as g, jsxs as Se } from "react/jsx-runtime";
47
47
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js
48
- function v({ open: v, onOpenChange: y, payableId: b, onClose: x, onExpand: S, onEdit: C, testId: w, labels: T, poweredByBankName: E }) {
49
- let D = h(() => ({
48
+ function _({ open: _, onOpenChange: v, payableId: y, onClose: b, onExpand: x, onEdit: S, testId: C, labels: w, poweredByBankName: T }) {
49
+ let E = h(() => ({
50
50
  ...m,
51
- ...T,
51
+ ...w,
52
52
  sheet: {
53
53
  ...m.sheet,
54
- ...T?.sheet,
54
+ ...w?.sheet,
55
55
  statusBadge: {
56
56
  ...m.sheet.statusBadge,
57
- ...T?.sheet?.statusBadge
57
+ ...w?.sheet?.statusBadge
58
58
  },
59
59
  approvalPolicy: {
60
60
  ...m.sheet.approvalPolicy,
61
- ...T?.sheet?.approvalPolicy
61
+ ...w?.sheet?.approvalPolicy
62
62
  },
63
63
  dueDate: {
64
64
  ...m.sheet.dueDate,
65
- ...T?.sheet?.dueDate
65
+ ...w?.sheet?.dueDate
66
66
  },
67
67
  auditHistory: {
68
68
  ...m.sheet.auditHistory,
69
- ...T?.sheet?.auditHistory
69
+ ...w?.sheet?.auditHistory
70
70
  }
71
71
  },
72
- decisionDialog: ue(m.decisionDialog, T?.decisionDialog),
72
+ decisionDialog: ue(m.decisionDialog, w?.decisionDialog),
73
73
  approvalPolicyCopy: {
74
74
  ...m.approvalPolicyCopy,
75
- ...T?.approvalPolicyCopy
75
+ ...w?.approvalPolicyCopy
76
76
  },
77
77
  history: {
78
78
  ...m.history,
79
- ...T?.history
79
+ ...w?.history
80
80
  },
81
- markAsPaid: ce(T?.markAsPaid),
81
+ markAsPaid: ce(w?.markAsPaid),
82
82
  actionSuccess: {
83
83
  ...m.actionSuccess,
84
- ...T?.actionSuccess
84
+ ...w?.actionSuccess
85
85
  },
86
- paymentHistoryMethodLabels: de(T?.paymentHistoryMethodLabels)
87
- }), [T]), O = s(b), k = o(b), A = ee(), { initResponse: j } = n(), M = O.data, N = be(null), P = _e({
88
- payableId: b,
89
- status: M?.status
90
- }), Se = M?.status === "rejected", Ce = e(j?.scopes, [t.ApprovalRequestReadOrg]), F = Se && Ce, I = me({
91
- payableId: b,
92
- enabled: F
93
- }), L = i(b, { enabled: F }), R = e(j?.scopes, [t.UserReadOrg]), { userNames: z, isError: we, isResolving: Te } = r({ enabled: R }), B = h(() => pe(L.data?.data, I.roundStartedAt), [L.data, I.roundStartedAt]), V = h(() => ge({
94
- payableStatus: M?.status,
95
- approvalRequests: B,
96
- userNames: z,
97
- payableUpdatedAt: M?.updated_at,
98
- labels: D
86
+ paymentHistoryMethodLabels: de(w?.paymentHistoryMethodLabels)
87
+ }), [w]), D = s(y), O = o(y), k = ee(), { initResponse: A } = n(), j = D.data, M = be(null), N = _e({
88
+ payableId: y,
89
+ status: j?.status
90
+ }), Ce = j?.status === "rejected", we = e(A?.scopes, [t.ApprovalRequestReadOrg]), P = Ce && we, F = me({
91
+ payableId: y,
92
+ enabled: P
93
+ }), I = i(y, { enabled: P }), L = e(A?.scopes, [t.UserReadOrg]), { userNames: R, isError: Te, isResolving: Ee } = r({ enabled: L }), z = h(() => pe(I.data?.data, F.roundStartedAt), [I.data, F.roundStartedAt]), B = h(() => ge({
94
+ payableStatus: j?.status,
95
+ approvalRequests: z,
96
+ userNames: R,
97
+ payableUpdatedAt: j?.updated_at,
98
+ labels: E
99
99
  }), [
100
- M?.status,
101
- M?.updated_at,
102
- B,
100
+ j?.status,
101
+ j?.updated_at,
103
102
  z,
104
- D
105
- ]), H = he({
106
- payableId: b,
107
- approvalPolicyId: M?.approval_policy_id,
108
- copy: D.approvalPolicyCopy
109
- }), U = p({
110
- status: M?.status,
111
- scopes: j?.scopes,
112
- arePendingApproversUnknown: H.isLoading,
113
- hasApprovalPolicy: !!M?.approval_policy_id,
114
- hasWaitingRequest: P.hasWaitingRequest
115
- }), Ee = !!P.id, W = P.isLoading || H.isLoading, G = h(() => H.pendingApprovers.length ? H.pendingApprovers.flatMap((e) => e.names) : void 0, [H.pendingApprovers]), K = ye({
116
- payableId: b,
117
- scheduledPaymentDate: M?.scheduled_payment_date
118
- }), q = re(j?.scopes), J = ae({
119
- counterpartId: M?.counterpart_id,
120
- currency: M?.currency,
121
- currentBankAccountId: M?.counterpart_bank_account_id,
103
+ R,
104
+ E
105
+ ]), V = he({
106
+ payableId: y,
107
+ approvalPolicyId: j?.approval_policy_id,
108
+ copy: E.approvalPolicyCopy
109
+ }), H = p({
110
+ status: j?.status,
111
+ scopes: A?.scopes,
112
+ arePendingApproversUnknown: V.isLoading,
113
+ hasApprovalPolicy: !!j?.approval_policy_id,
114
+ hasWaitingRequest: N.hasWaitingRequest
115
+ }), U = !!N.id, W = N.isLoading || V.isLoading, G = h(() => V.pendingApprovers.length ? V.pendingApprovers.flatMap((e) => e.names) : void 0, [V.pendingApprovers]), K = ye({
116
+ payableId: y,
117
+ scheduledPaymentDate: j?.scheduled_payment_date
118
+ }), q = re(A?.scopes), J = ae({
119
+ counterpartId: j?.counterpart_id,
120
+ currency: j?.currency,
121
+ currentBankAccountId: j?.counterpart_bank_account_id,
122
122
  enabled: q
123
123
  }), Y = le({
124
- payableId: b,
125
- amountDueMinorUnits: ie(M) ?? 0,
126
- amountToPayMinorUnits: M?.amount_to_pay ?? void 0,
127
- currencyCode: M?.currency ?? void 0,
128
- dueDate: M?.due_date,
124
+ payableId: y,
125
+ amountDueMinorUnits: ie(j) ?? 0,
126
+ amountToPayMinorUnits: j?.amount_to_pay ?? void 0,
127
+ currencyCode: j?.currency ?? void 0,
128
+ dueDate: j?.due_date,
129
129
  hasScheduledPayment: K.hasScheduledPayment,
130
- testId: w,
131
- labels: D.markAsPaid
130
+ testId: C,
131
+ labels: E.markAsPaid
132
132
  }), { actions: De, decisionDialog: Oe } = ve({
133
- payableId: M ? b : void 0,
134
- status: M?.status,
135
- currentApprovalRequestId: P.id,
133
+ payableId: j ? y : void 0,
134
+ status: j?.status,
135
+ currentApprovalRequestId: N.id,
136
136
  hasScheduledPayment: K.hasScheduledPayment,
137
137
  scheduledPaymentIntentId: K.scheduledPaymentIntentId,
138
138
  isScheduledPaymentUnknown: K.isResolving,
139
139
  isPayabilityUnknown: J.isLoading,
140
- hasApprovalPolicy: !!M?.approval_policy_id,
141
- hasWaitingRequest: P.hasWaitingRequest,
142
- pendingApprovers: H.pendingApprovers,
143
- arePendingApproversUnknown: H.isLoading,
140
+ hasApprovalPolicy: !!j?.approval_policy_id,
141
+ hasWaitingRequest: N.hasWaitingRequest,
142
+ pendingApprovers: V.pendingApprovers,
143
+ arePendingApproversUnknown: V.isLoading,
144
144
  labels: {
145
- edit: D.sheet.editButton,
146
- payBill: D.sheet.payButton,
147
- markAsPaid: D.sheet.markAsPaidButton,
148
- reject: D.sheet.rejectButton,
149
- approve: D.sheet.approveButton,
150
- cancel: D.sheet.cancelButton,
151
- cancelScheduledPayment: D.sheet.cancelScheduledPaymentButton,
152
- reopen: D.sheet.reopenButton,
153
- forceApprove: D.sheet.forceApproveButton,
154
- forceReject: D.sheet.forceRejectButton,
155
- policyOverridesHeading: D.sheet.policyOverridesGroup,
156
- decisionDialog: D.decisionDialog,
157
- actionError: D.actionError,
158
- actionSuccess: D.actionSuccess
145
+ edit: E.sheet.editButton,
146
+ payBill: E.sheet.payButton,
147
+ markAsPaid: E.sheet.markAsPaidButton,
148
+ reject: E.sheet.rejectButton,
149
+ approve: E.sheet.approveButton,
150
+ cancel: E.sheet.cancelButton,
151
+ cancelScheduledPayment: E.sheet.cancelScheduledPaymentButton,
152
+ reopen: E.sheet.reopenButton,
153
+ forceApprove: E.sheet.forceApproveButton,
154
+ forceReject: E.sheet.forceRejectButton,
155
+ policyOverridesHeading: E.sheet.policyOverridesGroup,
156
+ decisionDialog: E.decisionDialog,
157
+ actionError: E.actionError,
158
+ actionSuccess: E.actionSuccess
159
159
  },
160
160
  isMarkAsPaidPending: Y.isPending,
161
161
  onMarkAsPaidSelect: Y.open,
162
- onPayBillSelect: () => N.current?.open(),
163
- onEditSelect: C,
162
+ onPayBillSelect: () => M.current?.open(),
163
+ onEditSelect: S,
164
164
  onActionSucceeded: (e) => {
165
- e === "reopen" && C?.();
165
+ e === "reopen" && S?.();
166
166
  }
167
- }), ke = K.hasScheduledPayment && K.scheduledDateLabel ? D.scheduledSummary(K.scheduledDateLabel) : void 0, X = f({
168
- payable: M,
169
- canManage: e(j?.scopes, [t.PayableWriteOrg])
167
+ }), ke = K.hasScheduledPayment && K.scheduledDateLabel ? E.scheduledSummary(K.scheduledDateLabel) : void 0, X = f({
168
+ payable: j,
169
+ canManage: e(A?.scopes, [t.PayableWriteOrg])
170
170
  }), Z = X.isPossibleDuplicate ? /* @__PURE__ */ g(u, {
171
171
  onNotADuplicate: X.onNotADuplicate,
172
172
  isActionDisabled: X.isBusy
173
- }) : void 0, Q = a(b), $ = h(() => te(Q.data?.data ?? [], z, D.history), [
173
+ }) : void 0, Q = a(y), $ = h(() => te(Q.data?.data ?? [], R, E.history), [
174
174
  Q.data,
175
- z,
176
- D.history
177
- ]), Ae = R && we && ne(Q.data?.data ?? [], $, z), je = h(() => fe({
175
+ R,
176
+ E.history
177
+ ]), Ae = L && Te && ne(Q.data?.data ?? [], $, R), je = h(() => fe({
178
178
  records: K.paymentRecords,
179
179
  events: Q.data?.data ?? [],
180
- currencyCode: M?.currency,
181
- labels: D
180
+ currencyCode: j?.currency,
181
+ labels: E
182
182
  }), [
183
183
  K.paymentRecords,
184
184
  Q.data,
185
- M?.currency,
186
- D
187
- ]), Me = h(() => M ? se({
188
- payable: M,
189
- lineItems: k.lineItems,
190
- ledgerAccounts: A.data?.data ?? [],
191
- labels: D,
185
+ j?.currency,
186
+ E
187
+ ]), Me = h(() => j ? se({
188
+ payable: j,
189
+ lineItems: O.lineItems,
190
+ ledgerAccounts: k.data?.data ?? [],
191
+ labels: E,
192
192
  hasScheduledPayment: K.hasScheduledPayment,
193
- rejection: V,
193
+ rejection: B,
194
194
  achInstructions: J.achInstructions,
195
195
  achInstructionsReadable: q && !J.isLoading && !J.isError
196
196
  }) : void 0, [
197
- M,
198
- k.lineItems,
199
- A.data,
200
- D,
197
+ j,
198
+ O.lineItems,
199
+ k.data,
200
+ E,
201
201
  K.hasScheduledPayment,
202
- V,
202
+ B,
203
203
  J.achInstructions,
204
204
  J.isError,
205
205
  J.isLoading,
206
206
  q
207
- ]), Ne = O.isLoading || k.isResolving || A.isResolving || J.isLoading, Pe = O.isError || k.isError || A.isError;
208
- return /* @__PURE__ */ _(xe, { children: [
207
+ ]), Ne = D.isLoading || O.isResolving || k.isResolving || J.isLoading, Pe = D.isError || O.isError || k.isError;
208
+ return /* @__PURE__ */ Se(xe, { children: [
209
209
  /* @__PURE__ */ g(l, {
210
- open: v,
211
- onOpenChange: y,
210
+ open: _,
211
+ onOpenChange: v,
212
212
  details: Me,
213
213
  actions: De,
214
- approvalPolicy: H.view,
215
- showApprovalOverrideNotice: !W && U,
216
- awaitingApprovalNotice: !W && !Ee && !U && M?.status === "approve_in_progress" && M?.approval_policy_id ? G ? D.awaitingApprovalNotice(G) : D.awaitingApprovalUnknownNotice : void 0,
214
+ approvalPolicy: V.view,
215
+ showApprovalOverrideNotice: !W && H && !U,
216
+ awaitingApprovalNotice: !W && !U && !H && j?.status === "approve_in_progress" && j?.approval_policy_id ? G ? E.awaitingApprovalNotice(G) : E.awaitingApprovalUnknownNotice : void 0,
217
217
  scheduledSummary: ke,
218
218
  auditHistory: $,
219
219
  auditHistoryError: Q.isError,
220
- auditHistoryLoading: Q.isLoading || Te,
220
+ auditHistoryLoading: Q.isLoading || Ee,
221
221
  auditHistoryNamesError: Ae,
222
222
  paymentHistory: je,
223
223
  paymentHistoryError: K.isError || Q.isError,
@@ -225,27 +225,27 @@ function v({ open: v, onOpenChange: y, payableId: b, onClose: x, onExpand: S, on
225
225
  isLoading: Ne,
226
226
  isError: Pe,
227
227
  notice: Z,
228
- onClose: x,
229
- onExpand: S,
230
- testId: w,
231
- labels: D.sheet
228
+ onClose: b,
229
+ onExpand: x,
230
+ testId: C,
231
+ labels: E.sheet
232
232
  }),
233
233
  /* @__PURE__ */ g(c, {
234
234
  ...Oe,
235
- labels: { cancelButton: D.decisionDialog.cancelButton },
236
- testId: w ? `${w}-decision-dialog` : void 0,
237
- confirmTestId: w ? `${w}-decision-confirm` : void 0,
238
- reasonTestId: w ? `${w}-decision-reason` : void 0,
239
- reasonFieldId: w ? `${w}-decision-reason-field` : void 0
235
+ labels: { cancelButton: E.decisionDialog.cancelButton },
236
+ testId: C ? `${C}-decision-dialog` : void 0,
237
+ confirmTestId: C ? `${C}-decision-confirm` : void 0,
238
+ reasonTestId: C ? `${C}-decision-reason` : void 0,
239
+ reasonFieldId: C ? `${C}-decision-reason-field` : void 0
240
240
  }),
241
241
  /* @__PURE__ */ g(d, { ...Y.dialogProps }),
242
- M ? /* @__PURE__ */ g(oe, {
243
- ref: N,
244
- payable: M,
245
- onMissingAchInstructions: S,
246
- poweredByBankName: E
242
+ j ? /* @__PURE__ */ g(oe, {
243
+ ref: M,
244
+ payable: j,
245
+ onMissingAchInstructions: x,
246
+ poweredByBankName: T
247
247
  }) : null
248
248
  ] });
249
249
  }
250
250
  //#endregion
251
- export { v as BillDetailsContainer, v as default };
251
+ export { _ as BillDetailsContainer, _ as default };
@@ -29,7 +29,7 @@ function s(e) {
29
29
  function c(n) {
30
30
  return [{
31
31
  if: {
32
- run_concurrently: !1,
32
+ run_concurrently: !0,
33
33
  all: n.map(s)
34
34
  },
35
35
  then: [e],
@@ -118,7 +118,7 @@ function p(e) {
118
118
  groups: [],
119
119
  isSupported: !1
120
120
  };
121
- let i = n.run_concurrently !== !0, a = f(t) && i, o = [];
121
+ let i = r.length <= 1 || n.run_concurrently === !0, a = f(t) && i, o = [];
122
122
  for (let e of r) {
123
123
  let t = d(e);
124
124
  a &&= t.isSupported, o.push(t.refs);
@@ -23,7 +23,10 @@ function l() {
23
23
  return {
24
24
  isSuppressed: u !== null,
25
25
  reason: u,
26
- isResolved: !s || l.isSuccess || l.isError
26
+ isResolved: !s || l.isSuccess || l.isError,
27
+ refetch: () => {
28
+ l.refetch();
29
+ }
27
30
  };
28
31
  }
29
32
  //#endregion
@@ -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.5.77", n = "ef79ed3538b1b89bb7f32cfee375b94ecde6faea", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.5.80", n = "0caa57d3631ccf0c24aceae5eb7dc5eb1ea3bca1", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
@@ -8,94 +8,135 @@ import "../../ui/dist/index.js";
8
8
  import { resolveWidgetSuiteLabels as n } from "./index4.js";
9
9
  import { WIDGET_SUITE_DEFAULT_SECTIONS as r, WidgetSuiteSectionId as i } from "./index5.js";
10
10
  import { WidgetSuiteProvider as a, useWidgetSuiteProvider as o } from "./index6.js";
11
- import { hasAnyScope as s } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
11
+ import { useEmbedApi as s } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
12
+ import { hasAnyScope as c } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
13
+ import { OnboardingSuppressionReason as l } from "../../../shared/data-access/dist/lib/onboardingSuppressionReason.js";
14
+ import { useOrganizationOnboardingSuppression as u } from "../../../shared/data-access/dist/lib/useOrganizationOnboardingSuppression.js";
12
15
  import "../../../shared/data-access/dist/index.js";
13
- import { ErrorState as c } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
16
+ import { ErrorState as d } from "../../../shared/ui/dist/lib/ErrorState/ErrorState.js";
14
17
  import "../../../shared/ui/dist/index.js";
15
- import { useAnalyticsTrack as l } from "../../../shared/feature/dist/lib/analytics/hooks.js";
16
- import { WidgetProvider as u } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
17
- import { useRefetchWidget as d, useWidgetConfig as f, useWidgetError as p, useWidgetInitStaleForToken as m } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
18
+ import { useAnalyticsTrack as f } from "../../../shared/feature/dist/lib/analytics/hooks.js";
19
+ import { WidgetProvider as p } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
20
+ import { useRefetchWidget as m, useWidgetConfig as h, useWidgetError as g, useWidgetInitStaleForToken as _, useWidgetLoading as v } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
18
21
  import "../../../shared/feature/dist/index.js";
19
- import { WIDGET_SUITE_SECTIONS as h } from "./index15.js";
20
- import { WIDGET_NAME as g, WidgetSuiteAnalyticsEvent as _ } from "./index2.js";
21
- import { needsDisclosureAcceptance as v } from "./index3.js";
22
- import { AcceptDisclosuresWidget as y } from "../../../accept-disclosures-widget/feature/dist/index5.js";
22
+ import { WIDGET_SUITE_SECTIONS as y } from "./index15.js";
23
+ import { WIDGET_NAME as b, WidgetSuiteAnalyticsEvent as x } from "./index2.js";
24
+ import { needsDisclosureAcceptance as S } from "./index3.js";
25
+ import { AcceptDisclosuresWidget as C } from "../../../accept-disclosures-widget/feature/dist/index5.js";
23
26
  import "../../../accept-disclosures-widget/feature/dist/index.js";
24
- import { useCallback as b, useEffect as x, useMemo as S, useState as C } from "react";
25
- import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
27
+ import { BankAccountOnboardingWidget as w } from "../../../bank-account-onboarding-widget/feature/dist/index22.js";
28
+ import "../../../bank-account-onboarding-widget/feature/dist/index.js";
29
+ import { useCallback as T, useEffect as E, useMemo as D, useRef as O, useState as k } from "react";
30
+ import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
26
31
  //#region ../../libs/tesouro-embedded-components-react/widget-suite/feature/dist/index16.js
27
- var D = {
32
+ var N = {
28
33
  initFailed: "widget-suite-init-failed",
29
- disclosuresRefreshFailed: "widget-suite-disclosures-refresh-failed"
34
+ disclosuresRefreshFailed: "widget-suite-disclosures-refresh-failed",
35
+ applicationInFlight: "widget-suite-application-in-flight"
30
36
  };
31
- function O({ showSectionTitle: n = !0 }) {
32
- let { availableSections: r, activeSection: a, labels: s, navigate: l } = o(), { initResponse: u } = f(), g = p(), _ = m(), S = d(), O = b((e) => l(e), [l]), [k, A] = C(!1), j = b(() => A(!0), []), M = v(u), N = s.disclosure;
33
- x(() => {
34
- !M && k && A(!1);
35
- }, [k, M]);
36
- let P = !!(u && _);
37
- if (!u && !g || P && !g) return /* @__PURE__ */ T(e, {
37
+ function P({ showSectionTitle: n = !0, onboardingDisclosureLinks: r }) {
38
+ let { availableSections: a, activeSection: s, labels: c, navigate: f } = o(), { initResponse: p } = h(), b = g(), x = _(), D = v(), P = m(), F = u(), [I, L] = k(!1), R = F.isResolved || I, z = T((e) => f(e), [f]), [B, V] = k(!1), ee = T(() => V(!0), []), [te, ne] = k(!1), H = S(p), U = c.disclosure, W = c.onboardingGate, G = p?.status === "INVITED", K = p?.status === "ACTIVE" || p?.status === "INACTIVE", q = !!(p && x), J = q && (G || K), Y = !p && !b || J && !b, X = !!p && !Y && !q && !G && !K && R && F.reason === l.OrganizationApplicationComplete && !te, Z = O(!1), [re, Q] = k(!1);
39
+ E(() => {
40
+ !H && B && V(!1);
41
+ }, [B, H]), E(() => {
42
+ F.isResolved && !I && L(!0);
43
+ }, [F.isResolved, I]), E(() => {
44
+ X ? Z.current || (Z.current = !0, Q(!0), P()) : (Z.current = !1, Q(!1));
45
+ }, [X, P]);
46
+ let $ = () => /* @__PURE__ */ j(e, {
38
47
  isLoading: !0,
39
48
  sections: [],
40
49
  selectedSectionId: "",
41
- onSectionChange: O,
42
- labels: s.shell
50
+ onSectionChange: z,
51
+ labels: c.shell
43
52
  });
44
- if ((!u || P) && g) return /* @__PURE__ */ T(c, {
45
- title: N.initFailedState.title,
46
- description: N.initFailedState.body,
47
- retryLabel: N.initFailedState.retryButton,
48
- onRetry: S,
49
- testId: D.initFailed
53
+ if (Y) return $();
54
+ if ((!p || J) && b) return /* @__PURE__ */ j(d, {
55
+ title: U.initFailedState.title,
56
+ description: U.initFailedState.body,
57
+ retryLabel: U.initFailedState.retryButton,
58
+ onRetry: P,
59
+ testId: N.initFailed
50
60
  });
51
- if (M) return k && g ? /* @__PURE__ */ T(c, {
52
- title: N.refreshFailedState.title,
53
- description: N.refreshFailedState.body,
54
- retryLabel: N.refreshFailedState.retryButton,
55
- onRetry: S,
56
- testId: D.disclosuresRefreshFailed
57
- }) : /* @__PURE__ */ T(y, { onAccepted: j });
58
- let F = u?.bankName?.trim(), I = F ? s.sectionTitle.bankTagline.replaceAll("{bankName}", F) : void 0, L = r.map((e) => {
59
- let { Content: r } = h[e], a = s.menu[e], o = e === i.Accounts ? void 0 : I;
61
+ let ie = () => B && b ? /* @__PURE__ */ j(d, {
62
+ title: U.refreshFailedState.title,
63
+ description: U.refreshFailedState.body,
64
+ retryLabel: U.refreshFailedState.retryButton,
65
+ onRetry: P,
66
+ testId: N.disclosuresRefreshFailed
67
+ }) : /* @__PURE__ */ j(C, { onAccepted: ee });
68
+ if (G || K) {
69
+ if (H) return ie();
70
+ } else return R ? F.reason === l.OrganizationApplicationStartedByOther ? /* @__PURE__ */ j(d, {
71
+ title: W.applicationInFlightState.title,
72
+ description: W.applicationInFlightState.body,
73
+ retryLabel: W.applicationInFlightState.retryButton,
74
+ onRetry: F.refetch,
75
+ testId: N.applicationInFlight
76
+ }) : X ? b || re && !D ? /* @__PURE__ */ j(d, {
77
+ title: U.initFailedState.title,
78
+ description: U.initFailedState.body,
79
+ retryLabel: U.initFailedState.retryButton,
80
+ onRetry: P,
81
+ testId: N.initFailed
82
+ }) : $() : /* @__PURE__ */ j(w, {
83
+ isFullScreenInline: !0,
84
+ onEmbeddedOnboardingCompletedSuccessfully: () => ne(!0),
85
+ onNavigateToDashboard: () => {
86
+ a.includes(i.Dashboard) && f(i.Dashboard), P();
87
+ },
88
+ disclosureLinks: r,
89
+ ...c.onboarding
90
+ }) : $();
91
+ let ae = p?.bankName?.trim(), oe = ae ? c.sectionTitle.bankTagline.replaceAll("{bankName}", ae) : void 0, se = a.map((e) => {
92
+ let { Content: r } = y[e], a = c.menu[e], o = e === i.Accounts ? void 0 : oe;
60
93
  return {
61
94
  id: e,
62
95
  label: a,
63
- content: n ? /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(t, {
96
+ content: n ? /* @__PURE__ */ M(A, { children: [/* @__PURE__ */ j(t, {
64
97
  title: a,
65
98
  bankTagline: o
66
- }), /* @__PURE__ */ T(r, {})] }) : /* @__PURE__ */ T(r, {})
99
+ }), /* @__PURE__ */ j(r, {})] }) : /* @__PURE__ */ j(r, {})
67
100
  };
68
101
  });
69
- return /* @__PURE__ */ T(e, {
70
- sections: L,
71
- selectedSectionId: a ?? "",
72
- onSectionChange: O,
73
- labels: s.shell
102
+ return /* @__PURE__ */ j(e, {
103
+ sections: se,
104
+ selectedSectionId: s ?? "",
105
+ onSectionChange: z,
106
+ labels: c.shell
74
107
  });
75
108
  }
76
- function k({ sections: e = r, section: t, defaultSection: i, onSectionChange: o, labels: c, ...u }) {
77
- let d = l();
78
- x(() => {
79
- d(_.Mounted);
109
+ function F({ sections: e = r, section: t, defaultSection: i, onSectionChange: o, labels: l, ...u }) {
110
+ let d = f();
111
+ E(() => {
112
+ d(x.Mounted);
80
113
  }, [d]);
81
- let { initResponse: p } = f(), m = p?.scopes, g = S(() => n(c), [c]), v = e.filter((e) => {
82
- let t = h[e];
83
- return !!t && (!t.anyOfScopes || s(m, t.anyOfScopes));
114
+ let { initResponse: p } = h(), m = p?.scopes, { client: g, widgetToken: _ } = s(), v = p?.userId ?? null, [b, S] = k(v), [C, w] = k(0);
115
+ v !== b && (S(v), b !== null && w((e) => e + 1));
116
+ let [T, O] = k(g);
117
+ g !== T && (O(g), w((e) => e + 1));
118
+ let A = !!_, [M, N] = k(A);
119
+ A !== M && (N(A), w((e) => e + 1));
120
+ let F = p?.organizationId ?? null, [I, L] = k(F);
121
+ F !== I && (L(F), I !== null && w((e) => e + 1));
122
+ let R = D(() => n(l), [l]), z = e.filter((e) => {
123
+ let t = y[e];
124
+ return !!t && (!t.anyOfScopes || c(m, t.anyOfScopes));
84
125
  });
85
- return /* @__PURE__ */ T(a, {
126
+ return /* @__PURE__ */ j(a, {
86
127
  sections: e,
87
- availableSections: v,
128
+ availableSections: z,
88
129
  grantedScopes: m,
89
- labels: g,
130
+ labels: R,
90
131
  section: t,
91
132
  defaultSection: i,
92
133
  onSectionChange: o,
93
- children: /* @__PURE__ */ T(O, { ...u })
134
+ children: /* @__PURE__ */ j(P, { ...u }, C)
94
135
  });
95
136
  }
96
- function A({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework: s, errorFallback: c, onError: l, analytics: d, disclosuresAcceptance: f, providerLabels: p, ...m }) {
97
- return /* @__PURE__ */ T(u, {
98
- widgetName: g,
137
+ function I({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: a, implementation: o, uiFramework: s, errorFallback: c, onError: l, analytics: u, disclosuresAcceptance: d, providerLabels: f, ...m }) {
138
+ return /* @__PURE__ */ j(p, {
139
+ widgetName: b,
99
140
  baseUrl: e,
100
141
  widgetToken: t,
101
142
  organizationId: n,
@@ -106,11 +147,11 @@ function A({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gat
106
147
  uiFramework: s,
107
148
  errorFallback: c,
108
149
  onError: l,
109
- analytics: d,
110
- disclosuresAcceptance: f,
111
- providerLabels: p,
112
- children: /* @__PURE__ */ T(k, { ...m })
150
+ analytics: u,
151
+ disclosuresAcceptance: d,
152
+ providerLabels: f,
153
+ children: /* @__PURE__ */ j(F, { ...m })
113
154
  });
114
155
  }
115
156
  //#endregion
116
- export { D as WIDGET_SUITE_TEST_IDS, A as WidgetSuite, A as default };
157
+ export { N as WIDGET_SUITE_TEST_IDS, I as WidgetSuite, I as default };
@@ -26,6 +26,11 @@ var t = {
26
26
  retryButton: "Try again"
27
27
  }
28
28
  },
29
+ onboardingGate: { applicationInFlightState: {
30
+ title: "Application in progress",
31
+ body: "Your organization's account application is already being set up by a teammate. Contact your organization admin for details.",
32
+ retryButton: "Check again"
33
+ } },
29
34
  sections: {
30
35
  dashboard: {},
31
36
  cards: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tesouro/embedded-components-react",
3
- "version": "0.5.77",
3
+ "version": "0.5.80",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "packageDepSync": {