@tesouro/embedded-components-react 0.11.8 → 0.11.10

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.
Files changed (61) hide show
  1. package/dist/core.d.ts +7 -0
  2. package/dist/index.css +12 -49
  3. package/dist/index.d.ts +7 -0
  4. package/dist/lib/WidgetProvider.d.ts +7 -0
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index3.js +8 -6
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index4.js +99 -94
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +3 -4
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index14.js +1 -1
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index15.js +1 -1
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index31.js +1 -1
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index33.js +1 -1
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index34.js +2 -2
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index36.js +2 -1
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index37.js +110 -100
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index48.js +1 -1
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index49.js +1 -1
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index5.js +1 -1
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/ui/dist/index4.js +45 -40
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +259 -210
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +190 -165
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index8.js +7 -1
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +1 -1
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index2.js +1 -1
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +151 -143
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index3.js +1 -1
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillPayWidget.js +1 -1
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index5.js +1 -1
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index6.js +1 -1
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +19 -17
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index10.js +13 -2
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index11.js +52 -2
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +2 -40
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +3 -2
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index14.js +39 -9
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +2 -77
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +10 -0
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +77 -2
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +2 -3
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +25 -26
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +3 -2
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +28 -5
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +2 -33
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +6 -2
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +33 -0
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +2 -0
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index6.js +9 -30
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index8.js +29 -11
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index9.js +1 -53
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/util/dist/index.js +2 -1
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/util/dist/lib/groupCollapse.js +22 -0
  51. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +48 -45
  52. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +119 -116
  53. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/useTokenRefreshRef.js +8 -0
  54. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  55. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/client.js +11 -8
  56. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/expectedApiNotFound.js +2 -1
  57. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/interceptor.js +1 -1
  58. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/widgetTokenManager.js +65 -53
  59. package/dist/packages/shared-ui-shadcn/dist/index.js +1637 -1507
  60. package/package.json +1 -1
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +0 -28
@@ -1,53 +1 @@
1
- import { Button as e, DropdownMenu as t, DropdownMenuContent as n, DropdownMenuGroup as r, DropdownMenuItem as i, DropdownMenuLabel as a, DropdownMenuSeparator as o, DropdownMenuTrigger as s } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { groupBySectionHeading as c } from "./index8.js";
3
- import { Fragment as l, useId as u } from "react";
4
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
5
- import { MoreHorizontalIcon as p, MoreVerticalIcon as m } from "lucide-react";
6
- // ../../libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index9.js
7
- function h({ actions: h, triggerLabel: g, placement: _ = "row", testId: v }) {
8
- let y = u();
9
- if (!h.length) return null;
10
- let b = _ === "header", x = _ === "header" || _ === "table", S = b ? p : m, C = c(h);
11
- return /* @__PURE__ */ f(t, { children: [/* @__PURE__ */ d(s, {
12
- asChild: !0,
13
- children: /* @__PURE__ */ d(e, {
14
- type: "button",
15
- variant: x ? "ghost" : "outline",
16
- size: "icon",
17
- "aria-label": g,
18
- "data-testid": v,
19
- onPointerDown: (e) => e.stopPropagation(),
20
- onClick: (e) => e.stopPropagation(),
21
- children: /* @__PURE__ */ d(S, { className: "ttw:size-4" })
22
- })
23
- }), /* @__PURE__ */ d(n, {
24
- align: "end",
25
- onPointerDown: (e) => e.stopPropagation(),
26
- onClick: (e) => e.stopPropagation(),
27
- children: C.map((e, t) => {
28
- let n = e.items.map((e) => {
29
- let t = e.icon;
30
- return /* @__PURE__ */ f(i, {
31
- disabled: e.disabled,
32
- onClick: e.onSelect,
33
- children: [t ? /* @__PURE__ */ d(t, { className: "ttw:size-4" }) : null, e.label]
34
- }, e.id);
35
- });
36
- if (!e.heading) return /* @__PURE__ */ d(l, { children: n }, e.items[0]?.id);
37
- let s = `${y}-${t}`;
38
- return /* @__PURE__ */ f(l, { children: [
39
- t > 0 ? /* @__PURE__ */ d(o, {}) : null,
40
- /* @__PURE__ */ d(a, {
41
- id: s,
42
- className: "ttw:py-1 ttw:text-xs ttw:font-medium ttw:text-muted-foreground",
43
- children: e.heading
44
- }),
45
- /* @__PURE__ */ d(r, {
46
- "aria-labelledby": s,
47
- children: n
48
- })
49
- ] }, e.items[0]?.id);
50
- })
51
- })] });
52
- }
53
- export { h as BillOverflowMenu, h as default };
1
+ import "./index8.js";
@@ -14,4 +14,5 @@ import { resolveLineItemAmountMinorUnits as T } from "./lib/resolveLineItemAmoun
14
14
  import { resolveLineItemQuantity as E } from "./lib/resolveLineItemQuantity.js";
15
15
  import { resolveVendor as D, resolveVendorName as O } from "./lib/resolveVendor.js";
16
16
  import { BILL_PAY_WIDGET_NAME as k } from "./lib/widgetName.js";
17
- export { e as AWAITING_APPROVAL_LABEL_EN, t as AWAITING_APPROVAL_UNKNOWN_LABEL_EN, n as BILL_DETAIL_ACTIONS_LABELS_EN, k as BILL_PAY_WIDGET_NAME, u as DuplicateVerdict, r as PAYMENT_HISTORY_LABELS_EN, i as SCHEDULED_RELATIVE_DAY_LABELS_EN, a as SCHEDULED_STATUS_BADGE_LABEL_EN, o as SCHEDULED_SUMMARY_LABEL_EN, g as compareByArrival, p as countSuspectedPayableDuplicateGroups, _ as duplicateVerdictMatches, d as formatBillMoney, f as formatScheduledDateLabel, v as groupSuspectedDuplicates, m as hasSuspectedPayableDuplicate, b as isEditablePayableStatus, x as isLiveScheduledPaymentRecord, S as maskAccountNumber, s as mergeBillDetailActionsLabels, c as mergeDecisionDialogCopy, l as mergePaymentHistoryMethodLabels, C as payableRemoval, w as resolveAmountDueMinorUnits, y as resolveDuplicateOriginalId, T as resolveLineItemAmountMinorUnits, E as resolveLineItemQuantity, D as resolveVendor, O as resolveVendorName, h as suspectedPayableDuplicates };
17
+ import { buildGroupCollapse as A } from "./lib/groupCollapse.js";
18
+ export { e as AWAITING_APPROVAL_LABEL_EN, t as AWAITING_APPROVAL_UNKNOWN_LABEL_EN, n as BILL_DETAIL_ACTIONS_LABELS_EN, k as BILL_PAY_WIDGET_NAME, u as DuplicateVerdict, r as PAYMENT_HISTORY_LABELS_EN, i as SCHEDULED_RELATIVE_DAY_LABELS_EN, a as SCHEDULED_STATUS_BADGE_LABEL_EN, o as SCHEDULED_SUMMARY_LABEL_EN, A as buildGroupCollapse, g as compareByArrival, p as countSuspectedPayableDuplicateGroups, _ as duplicateVerdictMatches, d as formatBillMoney, f as formatScheduledDateLabel, v as groupSuspectedDuplicates, m as hasSuspectedPayableDuplicate, b as isEditablePayableStatus, x as isLiveScheduledPaymentRecord, S as maskAccountNumber, s as mergeBillDetailActionsLabels, c as mergeDecisionDialogCopy, l as mergePaymentHistoryMethodLabels, C as payableRemoval, w as resolveAmountDueMinorUnits, y as resolveDuplicateOriginalId, T as resolveLineItemAmountMinorUnits, E as resolveLineItemQuantity, D as resolveVendor, O as resolveVendorName, h as suspectedPayableDuplicates };
@@ -0,0 +1,22 @@
1
+ // ../../libs/tesouro-embedded-components-react/bill-pay-widget/util/dist/lib/groupCollapse.js
2
+ var e = [
3
+ "paid",
4
+ "scheduled",
5
+ "ready_to_pay",
6
+ "pending_approval",
7
+ "draft"
8
+ ];
9
+ function t({ statuses: t, statusLabels: n, labels: r }) {
10
+ if (t.length <= 5) return;
11
+ let i = t.slice(4), a = [...new Set(i.map((e) => e ?? "unknown"))], o = (t) => {
12
+ let n = e.indexOf(t);
13
+ return n === -1 ? e.length : n;
14
+ }, s = [...a].sort((e, t) => o(e) - o(t));
15
+ return {
16
+ visibleCount: 4,
17
+ showMoreLabel: r.showMore(i.length),
18
+ summary: r.statusSummary(s.map((e) => n[e] ?? n.unknown ?? e)),
19
+ showLessLabel: r.showLess
20
+ };
21
+ }
22
+ export { e as GROUP_SUMMARY_STATUS_ORDER, t as buildGroupCollapse };
@@ -3,55 +3,58 @@
3
3
  "use client";
4
4
  "use client";
5
5
  import { createClientSecretInstaller as e } from "../../../../data-access/dist/lib/scopedClientSecret.js";
6
- import { registerQueryClient as t, unregisterQueryClient as ee } from "../../../../data-access/dist/lib/clientRegistry.js";
7
- import { createEmbeddedClient as te } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
8
- import { EmbedApiProvider as n } from "../../../../data-access/dist/lib/EmbedApiContext.js";
6
+ import { registerQueryClient as t, unregisterQueryClient as n } from "../../../../data-access/dist/lib/clientRegistry.js";
7
+ import { createEmbeddedClient as r } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
8
+ import { EmbedApiProvider as i } from "../../../../data-access/dist/lib/EmbedApiContext.js";
9
9
  import "../../../../data-access/dist/index.js";
10
- import { resolveUIFramework as r } from "../../../../ui/dist/lib/UIContext/UIContext.js";
11
- import { UIProvider as ne } from "../../../../ui/dist/lib/UIContext/UIProvider.js";
12
- import { useDesignSystemEnsurer as re } from "../../../../ui/dist/lib/UIContext/uiRendererRegistry.js";
10
+ import { resolveUIFramework as a } from "../../../../ui/dist/lib/UIContext/UIContext.js";
11
+ import { UIProvider as ee } from "../../../../ui/dist/lib/UIContext/UIProvider.js";
12
+ import { useDesignSystemEnsurer as te } from "../../../../ui/dist/lib/UIContext/uiRendererRegistry.js";
13
13
  import "../../../../ui/dist/index.js";
14
- import { getGlobalSnapshot as i, subscribeToGlobal as ie } from "./globalStore.js";
15
- import { configureEmbeddedClient as ae } from "../analytics/client.js";
16
- import { generateCorrelationId as oe } from "../analytics/ids.js";
17
- import { WidgetContext as a } from "./WidgetContext.js";
18
- import { resolveOrgId as o, useAuthEpoch as s } from "./utils.js";
19
- import { useWidgetFetch as se } from "./useWidgetFetch.js";
20
- import { deriveOrganizationStatus as ce } from "./deriveOrganizationStatus.js";
21
- import { deriveWidgetInitState as le, useWidgetInitPublisher as ue } from "./useWidgetInitPublisher.js";
22
- import { useEffect as c, useMemo as l, useRef as u, useState as d, useSyncExternalStore as f } from "react";
23
- import { jsx as p } from "react/jsx-runtime";
24
- import { QueryClient as m, QueryClientProvider as de } from "@tanstack/react-query";
14
+ import { getGlobalSnapshot as o, subscribeToGlobal as ne } from "./globalStore.js";
15
+ import { configureEmbeddedClient as re } from "../analytics/client.js";
16
+ import { generateCorrelationId as ie } from "../analytics/ids.js";
17
+ import { WidgetContext as s } from "./WidgetContext.js";
18
+ import { resolveOrgId as c, useAuthEpoch as l } from "./utils.js";
19
+ import { useWidgetFetch as ae } from "./useWidgetFetch.js";
20
+ import { deriveOrganizationStatus as oe } from "./deriveOrganizationStatus.js";
21
+ import { deriveWidgetInitState as se, useWidgetInitPublisher as ce } from "./useWidgetInitPublisher.js";
22
+ import { useTokenRefreshRef as le } from "./useTokenRefreshRef.js";
23
+ import { useEffect as u, useMemo as d, useRef as f, useState as p, useSyncExternalStore as ue } from "react";
24
+ import { jsx as m } from "react/jsx-runtime";
25
+ import { QueryClient as de, QueryClientProvider as fe } from "@tanstack/react-query";
25
26
  // ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js
26
27
  function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configClient: y, gatewayRouting: b, linkComponent: x, uiFramework: S, analytics: C, unstable_initResponseOverride: w, disclosuresAcceptance: T, providerLabels: E }) {
27
- let D = f(ie, i, i), O = g ?? D.baseUrl, k = _ === void 0 ? D.widgetToken : _, A = v === void 0 ? D.organizationId : v, j = y ?? D.configClient, M = b ?? D.gatewayRouting, N = x ?? D.linkComponent, P = S ?? D.uiFramework, F = C !== !1, [I] = d(oe), L = u({
28
+ let D = ue(ne, o, o), O = g ?? D.baseUrl, k = _ === void 0 ? D.widgetToken : _, A = v === void 0 ? D.organizationId : v, j = y ?? D.configClient, M = b ?? D.gatewayRouting, N = x ?? D.linkComponent, P = S ?? D.uiFramework, F = C !== !1, [I] = p(ie), L = f({
28
29
  enabled: F,
29
30
  organizationId: A,
30
31
  rootCorrelationId: I
31
- }), [R] = d(() => new m({ defaultOptions: {
32
+ }), [R] = p(() => new de({ defaultOptions: {
32
33
  queries: {
33
34
  retry: !1,
34
35
  refetchOnWindowFocus: !1
35
36
  },
36
37
  mutations: { retry: !1 }
37
38
  } }));
38
- c(() => (t(R), () => ee(R)), [R]);
39
- let z = u(k);
39
+ u(() => (t(R), () => n(R)), [R]);
40
+ let z = f(k);
40
41
  z.current = k;
41
- let B = u(null), V = l(() => e(B), []), fe = s(k), H = l(() => {
42
- let e = ae(te(O), {
42
+ let B = le(), V = f(null), pe = d(() => e(V), []), me = l(k), H = d(() => {
43
+ let e = re(r(O), {
43
44
  tokenRef: z,
44
45
  analyticsContextRef: L,
45
- clientSecretRef: B,
46
- gatewayRouting: M
46
+ clientSecretRef: V,
47
+ gatewayRouting: M,
48
+ refreshTokenRef: B
47
49
  });
48
50
  return j ? j(e) : e;
49
51
  }, [
50
52
  O,
51
53
  j,
52
- M
54
+ M,
55
+ B
53
56
  ]);
54
- c(() => {
57
+ u(() => {
55
58
  if (!F || !("window" in globalThis)) return;
56
59
  let e = !1;
57
60
  return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled: t }) => {
@@ -60,11 +63,11 @@ function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configC
60
63
  e = !0;
61
64
  };
62
65
  }, [F]);
63
- let U = re(r(P));
64
- c(() => {
66
+ let U = te(a(P));
67
+ u(() => {
65
68
  U && U().catch(() => {});
66
69
  }, [U]);
67
- let { result: pe, loading: W, error: G, initStaleForToken: me, initReplacementPending: K, refetch: q } = se(w ? null : H, k, L), J = k ? w ?? pe ?? void 0 : void 0, Y = !w && me, X = o(A, Y ? void 0 : J?.organizationId), he = ce({
70
+ let { result: he, loading: W, error: G, initStaleForToken: K, initReplacementPending: ge, refetch: q } = ae(w ? null : H, k, L), J = k ? w ?? he ?? void 0 : void 0, Y = !w && K, X = c(A, Y ? void 0 : J?.organizationId), _e = oe({
68
71
  organizationId: X,
69
72
  cascadeOrgId: A,
70
73
  ownsFetch: !0,
@@ -73,8 +76,8 @@ function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configC
73
76
  loading: W,
74
77
  error: G,
75
78
  hasResult: !!J,
76
- initReplacementPending: K
77
- }), ge = l(() => le({
79
+ initReplacementPending: ge
80
+ }), ve = d(() => se({
78
81
  hasToken: !!k,
79
82
  loading: W,
80
83
  error: G,
@@ -87,8 +90,8 @@ function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configC
87
90
  J,
88
91
  Y
89
92
  ]);
90
- ue(ge, k);
91
- let Z = l(() => ({
93
+ ce(ve, k);
94
+ let Z = d(() => ({
92
95
  enabled: F,
93
96
  organizationId: X,
94
97
  rootCorrelationId: I
@@ -98,7 +101,7 @@ function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configC
98
101
  I
99
102
  ]);
100
103
  L.current = Z;
101
- let Q = l(() => ({
104
+ let Q = d(() => ({
102
105
  baseUrl: g,
103
106
  widgetToken: _,
104
107
  organizationId: v,
@@ -114,7 +117,7 @@ function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configC
114
117
  b,
115
118
  x,
116
119
  S
117
- ]), $ = l(() => ({
120
+ ]), $ = d(() => ({
118
121
  baseUrl: O,
119
122
  widgetToken: k,
120
123
  organizationId: X,
@@ -132,7 +135,7 @@ function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configC
132
135
  N,
133
136
  P,
134
137
  J
135
- ]), _e = l(() => ({
138
+ ]), ye = d(() => ({
136
139
  resolved: $,
137
140
  own: Q,
138
141
  refetch: q,
@@ -155,18 +158,18 @@ function h({ children: h, baseUrl: g, widgetToken: _, organizationId: v, configC
155
158
  T,
156
159
  E
157
160
  ]);
158
- return /* @__PURE__ */ p(de, {
161
+ return /* @__PURE__ */ m(fe, {
159
162
  client: R,
160
- children: /* @__PURE__ */ p(n, {
163
+ children: /* @__PURE__ */ m(i, {
161
164
  client: H,
162
165
  organizationId: X,
163
166
  widgetToken: k,
164
- installClientSecret: V,
165
- authEpoch: fe,
166
- organizationStatus: he,
167
- children: /* @__PURE__ */ p(a.Provider, {
168
- value: _e,
169
- children: /* @__PURE__ */ p(ne, {
167
+ installClientSecret: pe,
168
+ authEpoch: me,
169
+ organizationStatus: _e,
170
+ children: /* @__PURE__ */ m(s.Provider, {
171
+ value: ye,
172
+ children: /* @__PURE__ */ m(ee, {
170
173
  linkComponent: N,
171
174
  uiFramework: P,
172
175
  children: h
@@ -24,94 +24,97 @@ import { noop as le, resolveOrgId as ue, useAuthEpoch as de } from "./utils.js";
24
24
  import { useWidgetFetch as fe } from "./useWidgetFetch.js";
25
25
  import { deriveOrganizationStatus as pe } from "./deriveOrganizationStatus.js";
26
26
  import { deriveWidgetInitState as me, useWidgetInitPublisher as he } from "./useWidgetInitPublisher.js";
27
+ import { useTokenRefreshRef as ge } from "./useTokenRefreshRef.js";
27
28
  import { useAnalyticsTrack as u } from "../analytics/hooks.js";
28
- import { resolveProviderLabels as ge } from "./labels.js";
29
- import { WidgetErrorBoundary as _e } from "./WidgetErrorBoundary.js";
30
- import { DISCLOSURES_REQUIRED_TEST_ID as d, hasRenderableAcceptanceSurface as f, resolveDisclosuresBlockedReason as p, shouldGateOnDisclosuresAcceptance as ve } from "./isDisclosuresAcceptanceRequired.js";
31
- import { useContext as ye, useEffect as m, useMemo as h, useRef as g, useState as _, useSyncExternalStore as be } from "react";
29
+ import { resolveProviderLabels as _e } from "./labels.js";
30
+ import { WidgetErrorBoundary as ve } from "./WidgetErrorBoundary.js";
31
+ import { DISCLOSURES_REQUIRED_TEST_ID as d, hasRenderableAcceptanceSurface as f, resolveDisclosuresBlockedReason as p, shouldGateOnDisclosuresAcceptance as ye } from "./isDisclosuresAcceptanceRequired.js";
32
+ import { useContext as be, useEffect as m, useMemo as h, useRef as g, useState as _, useSyncExternalStore as xe } from "react";
32
33
  import { jsx as v } from "react/jsx-runtime";
33
- import { QueryClient as xe, QueryClientProvider as Se } from "@tanstack/react-query";
34
+ import { QueryClient as Se, QueryClientProvider as Ce } from "@tanstack/react-query";
34
35
  // ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js
35
- function y({ children: re, baseUrl: s, widgetToken: c, organizationId: u, configClient: d, gatewayRouting: f, linkComponent: p, uiFramework: y, errorFallback: we, onError: Te, analytics: b, disclosuresAcceptance: Ee, providerLabels: De, widgetName: x }) {
36
+ function y({ children: re, baseUrl: s, widgetToken: c, organizationId: u, configClient: d, gatewayRouting: f, linkComponent: p, uiFramework: y, errorFallback: Te, onError: Ee, analytics: b, disclosuresAcceptance: De, providerLabels: Oe, widgetName: x }) {
36
37
  e();
37
- let S = ye(l), Oe = be(oe, ae, ae), C = S?.resolved ?? Oe, ke = S?.refetch ?? le, Ae = S?.loading ?? !1, je = S?.error ?? null, w = s ?? C.baseUrl, T = c === void 0 ? C.widgetToken : c, Me = S ? S.cascadeOrgId : Oe.organizationId, E = u === void 0 ? Me : u, D = d ?? C.configClient, O = f ?? C.gatewayRouting, k = p ?? C.linkComponent, A = y ?? C.uiFramework, j = Ee ?? S?.disclosuresAcceptance, M = De ?? S?.providerLabels, Ne = h(() => ge(M), [M]), N = S === null, P = N ? b !== !1 : S.analytics.enabled, [Pe] = _(ce), F = N ? Pe : S.analytics.rootCorrelationId, [Fe] = _(ce), I = x === void 0 ? S?.analytics.widgetName : x, L = x === void 0 ? S?.analytics.widgetInstanceId : Fe, R = g({
38
- enabled: P,
39
- organizationId: E,
40
- rootCorrelationId: F,
41
- widgetName: I,
42
- widgetInstanceId: L
43
- }), Ie = g(!1);
38
+ let S = be(l), C = xe(oe, ae, ae), w = S?.resolved ?? C, ke = S?.refetch ?? le, Ae = S?.loading ?? !1, je = S?.error ?? null, T = s ?? w.baseUrl, E = c === void 0 ? w.widgetToken : c, Me = S ? S.cascadeOrgId : C.organizationId, D = u === void 0 ? Me : u, O = d ?? w.configClient, k = f ?? w.gatewayRouting, A = p ?? w.linkComponent, j = y ?? w.uiFramework, M = De ?? S?.disclosuresAcceptance, N = Oe ?? S?.providerLabels, P = h(() => _e(N), [N]), F = S === null, I = F ? b !== !1 : S.analytics.enabled, [Ne] = _(ce), L = F ? Ne : S.analytics.rootCorrelationId, [Pe] = _(ce), R = x === void 0 ? S?.analytics.widgetName : x, z = x === void 0 ? S?.analytics.widgetInstanceId : Pe, B = g({
39
+ enabled: I,
40
+ organizationId: D,
41
+ rootCorrelationId: L,
42
+ widgetName: R,
43
+ widgetInstanceId: z
44
+ }), Fe = g(!1);
44
45
  m(() => {
45
- N || b === void 0 || Ie.current || (Ie.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."));
46
- }, [b, N]), m(() => {
47
- if (!N || !P || !("window" in globalThis)) return;
46
+ F || b === void 0 || Fe.current || (Fe.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."));
47
+ }, [b, F]), m(() => {
48
+ if (!F || !I || !("window" in globalThis)) return;
48
49
  let e = !1;
49
50
  return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled: t }) => {
50
51
  e || t();
51
52
  }), () => {
52
53
  e = !0;
53
54
  };
54
- }, [N, P]);
55
- let z = ne(ee(A));
55
+ }, [F, I]);
56
+ let V = ne(ee(j));
56
57
  m(() => {
57
- z && z().catch(() => {});
58
- }, [z]);
59
- let B = S === null || s !== void 0 || c !== void 0 || u !== void 0 || d != null || f !== void 0 || x !== void 0, V = g(T);
60
- V.current = T;
61
- let H = g(null), Le = h(() => t(H), []), Re = o(), ze = de(T), U = h(() => {
62
- if (!B) return null;
63
- let e = se(i(w), {
64
- tokenRef: V,
65
- analyticsContextRef: R,
66
- clientSecretRef: H,
67
- gatewayRouting: O
58
+ V && V().catch(() => {});
59
+ }, [V]);
60
+ let Ie = S === null || s !== void 0 || c !== void 0 || u !== void 0 || d != null || f !== void 0 || x !== void 0, Le = g(E);
61
+ Le.current = E;
62
+ let Re = ge(), ze = g(null), Be = h(() => t(ze), []), Ve = o(), He = de(E), H = h(() => {
63
+ if (!Ie) return null;
64
+ let e = se(i(T), {
65
+ tokenRef: Le,
66
+ analyticsContextRef: B,
67
+ clientSecretRef: ze,
68
+ gatewayRouting: k,
69
+ refreshTokenRef: Re
68
70
  });
69
- return D ? D(e) : e;
71
+ return O ? O(e) : e;
70
72
  }, [
71
- B,
72
- w,
73
- D,
74
- O
75
- ]), W = S === null || s !== void 0 || c !== void 0, Be = W ? ze : Re.authEpoch, { result: G, loading: K, error: q, clearedForAuthChange: Ve, initStaleForToken: J, initReplacementPending: He, refetch: Ue } = fe(W ? U : null, W ? T : void 0, R), We = W ? Ue : ke, Ge = W ? K : Ae, Ke = W ? q : je, qe = S?.resolved.initResponse, Je = !W || !Ve && !q && !G && !!T && !K, Y = Je ? qe : G ?? void 0, X = Je ? W || (S?.initResponseStaleForToken ?? !1) : J, Ye = S === null, Xe = h(() => Ye ? me({
76
- hasToken: !!T,
77
- loading: K,
78
- error: q,
79
- initResponse: G ?? void 0,
80
- initStaleForToken: J
81
- }) : null, [
82
- Ye,
73
+ Ie,
83
74
  T,
84
- K,
85
- q,
75
+ O,
76
+ k,
77
+ Re
78
+ ]), U = S === null || s !== void 0 || c !== void 0, Ue = U ? He : Ve.authEpoch, { result: W, loading: G, error: K, clearedForAuthChange: We, initStaleForToken: q, initReplacementPending: Ge, refetch: Ke } = fe(U ? H : null, U ? E : void 0, B), qe = U ? Ke : ke, Je = U ? G : Ae, Ye = U ? K : je, Xe = S?.resolved.initResponse, J = !U || !We && !K && !W && !!E && !G, Y = J ? Xe : W ?? void 0, X = J ? U || (S?.initResponseStaleForToken ?? !1) : q, Ze = S === null, Qe = h(() => Ze ? me({
79
+ hasToken: !!E,
80
+ loading: G,
81
+ error: K,
82
+ initResponse: W ?? void 0,
83
+ initStaleForToken: q
84
+ }) : null, [
85
+ Ze,
86
+ E,
86
87
  G,
87
- J
88
+ K,
89
+ W,
90
+ q
88
91
  ]);
89
- he(Xe, T);
90
- let Z = ue(E, X ? void 0 : Y?.organizationId), Ze = pe({
92
+ he(Qe, E);
93
+ let Z = ue(D, X ? void 0 : Y?.organizationId), $e = pe({
91
94
  organizationId: Z,
92
- cascadeOrgId: E,
93
- ownsFetch: W,
94
- parentStatus: Re.organizationStatus,
95
- hasToken: !!T,
96
- loading: K,
97
- error: q,
98
- hasResult: !!G,
99
- initReplacementPending: He
95
+ cascadeOrgId: D,
96
+ ownsFetch: U,
97
+ parentStatus: Ve.organizationStatus,
98
+ hasToken: !!E,
99
+ loading: G,
100
+ error: K,
101
+ hasResult: !!W,
102
+ initReplacementPending: Ge
100
103
  }), Q = h(() => ({
101
- enabled: P,
104
+ enabled: I,
102
105
  organizationId: Z,
103
- rootCorrelationId: F,
104
- widgetName: I,
105
- widgetInstanceId: L
106
+ rootCorrelationId: L,
107
+ widgetName: R,
108
+ widgetInstanceId: z
106
109
  }), [
107
- P,
108
- Z,
109
- F,
110
110
  I,
111
- L
111
+ Z,
112
+ L,
113
+ R,
114
+ z
112
115
  ]);
113
- R.current = Q;
114
- let [$] = _(() => S === null ? new xe({ defaultOptions: {
116
+ B.current = Q;
117
+ let [$] = _(() => S === null ? new Se({ defaultOptions: {
115
118
  queries: {
116
119
  retry: !1,
117
120
  refetchOnWindowFocus: !1
@@ -123,7 +126,7 @@ function y({ children: re, baseUrl: s, widgetToken: c, organizationId: u, config
123
126
  let e = $;
124
127
  return n(e), () => r(e);
125
128
  }, [$]);
126
- let Qe = h(() => ({
129
+ let et = h(() => ({
127
130
  baseUrl: s,
128
131
  widgetToken: c,
129
132
  organizationId: u,
@@ -139,78 +142,78 @@ function y({ children: re, baseUrl: s, widgetToken: c, organizationId: u, config
139
142
  f,
140
143
  p,
141
144
  y
142
- ]), $e = h(() => ({
143
- baseUrl: w,
144
- widgetToken: T,
145
+ ]), tt = h(() => ({
146
+ baseUrl: T,
147
+ widgetToken: E,
145
148
  organizationId: Z,
146
- configClient: D,
147
- gatewayRouting: O,
148
- linkComponent: k,
149
- uiFramework: A,
149
+ configClient: O,
150
+ gatewayRouting: k,
151
+ linkComponent: A,
152
+ uiFramework: j,
150
153
  initResponse: Y
151
154
  }), [
152
- w,
153
155
  T,
156
+ E,
154
157
  Z,
155
- D,
156
158
  O,
157
159
  k,
158
160
  A,
161
+ j,
159
162
  Y
160
- ]), et = h(() => ({
161
- resolved: $e,
162
- own: Qe,
163
- refetch: We,
164
- loading: Ge,
165
- error: Ke,
163
+ ]), nt = h(() => ({
164
+ resolved: tt,
165
+ own: et,
166
+ refetch: qe,
167
+ loading: Je,
168
+ error: Ye,
166
169
  analytics: Q,
167
- cascadeOrgId: E,
170
+ cascadeOrgId: D,
168
171
  initResponseStaleForToken: X,
169
- disclosuresAcceptance: j,
170
- providerLabels: M
172
+ disclosuresAcceptance: M,
173
+ providerLabels: N
171
174
  }), [
172
- $e,
173
- Qe,
174
- We,
175
- Ge,
176
- Ke,
175
+ tt,
176
+ et,
177
+ qe,
178
+ Je,
179
+ Ye,
177
180
  Q,
178
- E,
181
+ D,
179
182
  X,
180
- j,
181
- M
182
- ]), tt = /* @__PURE__ */ v(l.Provider, {
183
- value: et,
183
+ M,
184
+ N
185
+ ]), rt = /* @__PURE__ */ v(l.Provider, {
186
+ value: nt,
184
187
  children: /* @__PURE__ */ v(te, {
185
- linkComponent: k,
186
- uiFramework: A,
187
- children: /* @__PURE__ */ v(ie, { children: /* @__PURE__ */ v(_e, {
188
- resetKeys: [T],
189
- errorFallback: we,
190
- onError: Te,
191
- labels: Ne,
192
- children: ve(Y, x) ? /* @__PURE__ */ v(Ce, {
193
- disclosuresAcceptance: j,
188
+ linkComponent: A,
189
+ uiFramework: j,
190
+ children: /* @__PURE__ */ v(ie, { children: /* @__PURE__ */ v(ve, {
191
+ resetKeys: [E],
192
+ errorFallback: Te,
193
+ onError: Ee,
194
+ labels: P,
195
+ children: ye(Y, x) ? /* @__PURE__ */ v(we, {
196
+ disclosuresAcceptance: M,
194
197
  initStaleForToken: X,
195
- labels: Ne
198
+ labels: P
196
199
  }) : re
197
200
  }) })
198
201
  })
199
- }), nt = U ? /* @__PURE__ */ v(a, {
200
- client: U,
202
+ }), it = H ? /* @__PURE__ */ v(a, {
203
+ client: H,
201
204
  organizationId: Z,
202
- widgetToken: T,
203
- installClientSecret: Le,
204
- authEpoch: Be,
205
- organizationStatus: Ze,
206
- children: tt
207
- }) : tt;
208
- return $ ? /* @__PURE__ */ v(Se, {
205
+ widgetToken: E,
206
+ installClientSecret: Be,
207
+ authEpoch: Ue,
208
+ organizationStatus: $e,
209
+ children: rt
210
+ }) : rt;
211
+ return $ ? /* @__PURE__ */ v(Ce, {
209
212
  client: $,
210
- children: nt
211
- }) : nt;
213
+ children: it
214
+ }) : it;
212
215
  }
213
- function Ce({ disclosuresAcceptance: e, initStaleForToken: t, labels: n }) {
216
+ function we({ disclosuresAcceptance: e, initStaleForToken: t, labels: n }) {
214
217
  let r = re("error-state") ?? s, i = u(), a = f(e), o = p({
215
218
  initStaleForToken: t,
216
219
  hasAcceptanceSurface: a
@@ -0,0 +1,8 @@
1
+ import { WidgetTokenRefreshContext as e } from "./WidgetTokenRefreshContext.js";
2
+ import { useContext as t, useRef as n } from "react";
3
+ // ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/useTokenRefreshRef.js
4
+ function r() {
5
+ let r = t(e), i = n(null);
6
+ return i.current = r ? (e) => void r.reportRejectedToken(e) : null, i;
7
+ }
8
+ export { r as useTokenRefreshRef };
@@ -1,5 +1,5 @@
1
1
  // ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js
2
- var e = "@tesouro/embedded-components-react", t = "0.11.8", n = "31849eca1f0bf1bc0350bbacd1c8d07dce0ca943", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.11.10", n = "f57670c8612e26f60cc01a9f70379f59a80e9b92", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n
@@ -1,12 +1,15 @@
1
1
  import { attachTransportInterceptors as e } from "../../../../data-access/dist/lib/transportInterceptors.js";
2
2
  import "../../../../data-access/dist/index.js";
3
- import { attachAnalyticsInterceptors as t } from "./interceptor.js";
3
+ import { attachAnalyticsInterceptors as t, tokenCarriedBy as n } from "./interceptor.js";
4
4
  // ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/client.js
5
- function n(n, { tokenRef: r, analyticsContextRef: i, clientSecretRef: a, gatewayRouting: o }) {
6
- return e(n, {
7
- tokenRef: r,
8
- clientSecretRef: a,
9
- gatewayRouting: o
10
- }), t(n, i), n;
5
+ function r(r, { tokenRef: i, analyticsContextRef: a, clientSecretRef: o, gatewayRouting: s, refreshTokenRef: c }) {
6
+ return e(r, {
7
+ tokenRef: i,
8
+ clientSecretRef: o,
9
+ gatewayRouting: s
10
+ }), c && r.interceptors.error.use((e, t, r) => {
11
+ let a = n(r);
12
+ return t?.status === 401 && a && a === i.current && c.current?.(a), e;
13
+ }), t(r, a), r;
11
14
  }
12
- export { n as configureEmbeddedClient };
15
+ export { r as configureEmbeddedClient };
@@ -3,7 +3,8 @@ var e = /* @__PURE__ */ new Set([
3
3
  "GET /identity/v1/user-data/{key}",
4
4
  "GET /embedded-banking/v1/credit-cards/{cardId}",
5
5
  "GET /embedded-banking/v1/debit-cards/{cardId}",
6
- "GET /finops/v1/payables/{payable_id}/suggestions"
6
+ "GET /finops/v1/payables/{payable_id}/suggestions",
7
+ "GET /identity/v1/financial_institution"
7
8
  ]);
8
9
  function t(t, n, r) {
9
10
  return t === 404 && n !== void 0 && r !== void 0 && e.has(`${n.toUpperCase()} ${r}`);
@@ -66,4 +66,4 @@ function p() {
66
66
  function m(e) {
67
67
  return e === void 0 ? void 0 : Math.round(p() - e);
68
68
  }
69
- export { l as attachAnalyticsInterceptors };
69
+ export { l as attachAnalyticsInterceptors, d as tokenCarriedBy };