@tesouro/embedded-components-react 0.2.280 → 0.2.282

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 (112) hide show
  1. package/README.md +17 -14
  2. package/dist/experimental/WidgetSuite.d.ts +9 -1
  3. package/dist/experimental/index.d.ts +9 -1
  4. package/dist/index.css +20 -6
  5. package/dist/index.d.ts +46 -23
  6. package/dist/index.js +54 -53
  7. package/dist/lib/AcceptDisclosuresWidget.d.ts +9 -1
  8. package/dist/lib/BalancesWidget.d.ts +8 -0
  9. package/dist/lib/BankAccountOnboardingWidget.d.ts +9 -1
  10. package/dist/lib/BankAccountsWidget.d.ts +9 -1
  11. package/dist/lib/BillPayWidget.d.ts +8 -0
  12. package/dist/lib/BillPayWidget.js +1 -1
  13. package/dist/lib/CardDetailsWidget.d.ts +9 -1
  14. package/dist/lib/CardsWidget.d.ts +9 -1
  15. package/dist/lib/ChartOfAccountsWidget.d.ts +9 -1
  16. package/dist/lib/CounterpartsWidget.d.ts +9 -1
  17. package/dist/lib/CreateCardWidget.d.ts +9 -1
  18. package/dist/lib/ExpenseApprovalPoliciesWidget.d.ts +9 -1
  19. package/dist/lib/ExpenseManagementWidget.d.ts +9 -1
  20. package/dist/lib/ExpenseRequirementsWidget.d.ts +9 -1
  21. package/dist/lib/HelpWidget.d.ts +9 -1
  22. package/dist/lib/InsightsWidget.d.ts +8 -0
  23. package/dist/lib/InvoicingWidget.d.ts +9 -1
  24. package/dist/lib/LinkedAccountsWidget.d.ts +9 -1
  25. package/dist/lib/ProductsWidget.d.ts +9 -1
  26. package/dist/lib/ProfileWidget.d.ts +9 -1
  27. package/dist/lib/ReceiptMatchWidget.d.ts +9 -1
  28. package/dist/lib/ReceivablesWidget.d.ts +9 -1
  29. package/dist/lib/SettingsWidget.d.ts +9 -1
  30. package/dist/lib/TagsWidget.d.ts +9 -1
  31. package/dist/lib/TeamWidget.d.ts +9 -1
  32. package/dist/lib/TransfersWidget.d.ts +8 -0
  33. package/dist/lib/WidgetProvider.d.ts +25 -2
  34. package/dist/lib/WidgetProvider.js +8 -7
  35. package/dist/lib/WidgetProviderPublic.d.ts +8 -0
  36. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index4.js +3 -2
  37. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js +54 -53
  38. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js +3 -2
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +9 -5
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +42 -39
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +69 -54
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +21 -2
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +46 -40
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +81 -1
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +46 -47
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +3 -11
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +2 -8
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +5 -3
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +43 -5
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +1 -102
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +11 -3
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +9 -6
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +4 -5
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +127 -76
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +6 -6
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +7 -111
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +85 -1
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index3.js +16 -12
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +2 -24
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +8 -0
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +114 -0
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +1 -0
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +25 -0
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +50 -49
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +1 -1
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +25 -12
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +86 -69
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +2 -1
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +7 -7
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +17 -16
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +1 -0
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +1 -1
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +89 -124
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +2 -1
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +31 -26
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +1 -1
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +80 -77
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +20 -4
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +228 -6
  80. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js +3 -2
  81. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index8.js +3 -2
  82. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js +3 -2
  83. package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index7.js +30 -29
  84. package/dist/libs/tesouro-embedded-components-react/expense-approval-policies-widget/feature/dist/lib/ExpenseApprovalPoliciesWidgetFeature.js +2 -1
  85. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index3.js +3 -2
  86. package/dist/libs/tesouro-embedded-components-react/expense-receipt-match-widget/feature/dist/lib/ReceiptMatchWidget.js +7 -6
  87. package/dist/libs/tesouro-embedded-components-react/expense-requirements-widget/feature/dist/lib/ExpenseRequirementsWidget.js +2 -1
  88. package/dist/libs/tesouro-embedded-components-react/gl-code-table-widget/feature/dist/index8.js +5 -4
  89. package/dist/libs/tesouro-embedded-components-react/help-widget/feature/dist/index3.js +3 -2
  90. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +3 -2
  91. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index3.js +5 -4
  92. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +3 -2
  93. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index8.js +3 -2
  94. package/dist/libs/tesouro-embedded-components-react/profile-widget/feature/dist/index4.js +3 -2
  95. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +3 -2
  96. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +6 -6
  97. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js +53 -11
  98. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/index.js +5 -5
  99. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +69 -67
  100. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +158 -132
  101. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/hooks.js +7 -4
  102. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/isDisclosuresAcceptanceRequired.js +20 -0
  103. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/labels.js +6 -1
  104. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  105. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +9 -9
  106. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/ErrorState/ErrorState.js +19 -18
  107. package/dist/libs/tesouro-embedded-components-react/tags-widget/feature/dist/index11.js +3 -2
  108. package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index17.js +3 -2
  109. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index5.js +1 -1
  110. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index6.js +3 -2
  111. package/dist/packages/shared-ui-shadcn/dist/index.js +3445 -3413
  112. package/package.json +1 -1
@@ -3,88 +3,88 @@
3
3
  "use client";
4
4
  "use client";
5
5
  import { registerQueryClient as e, unregisterQueryClient as t } from "../../../../data-access/dist/lib/clientRegistry.js";
6
- import { createEmbeddedClient as n } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
7
- import { EmbedApiProvider as r } from "../../../../data-access/dist/lib/EmbedApiContext.js";
6
+ import { createEmbeddedClient as ee } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
7
+ import { EmbedApiProvider as n } from "../../../../data-access/dist/lib/EmbedApiContext.js";
8
8
  import "../../../../data-access/dist/index.js";
9
- import { getGlobalSnapshot as i, subscribeToGlobal as a } from "./globalStore.js";
10
- import { configureEmbeddedClient as ee } from "../analytics/client.js";
11
- import { generateCorrelationId as te } from "../analytics/ids.js";
9
+ import { getGlobalSnapshot as r, subscribeToGlobal as i } from "./globalStore.js";
10
+ import { configureEmbeddedClient as te } from "../analytics/client.js";
11
+ import { generateCorrelationId as a } from "../analytics/ids.js";
12
12
  import { WidgetContext as ne } from "./WidgetContext.js";
13
13
  import { resolveOrgId as re, useAuthEpoch as ie } from "./utils.js";
14
14
  import { useWidgetFetch as ae } from "./useWidgetFetch.js";
15
- import { deriveWidgetInitState as oe, useWidgetInitPublisher as o } from "./useWidgetInitPublisher.js";
16
- import { resolveUIFramework as se } from "../../../../ui/dist/lib/UIContext/UIContext.js";
15
+ import { deriveWidgetInitState as oe, useWidgetInitPublisher as se } from "./useWidgetInitPublisher.js";
16
+ import { resolveUIFramework as o } from "../../../../ui/dist/lib/UIContext/UIContext.js";
17
17
  import { UIProvider as s } from "../../../../ui/dist/lib/UIContext/UIProvider.js";
18
18
  import { useDesignSystemEnsurer as c } from "../../../../ui/dist/lib/UIContext/uiRendererRegistry.js";
19
19
  import "../../../../ui/dist/index.js";
20
- import { useEffect as l, useMemo as u, useRef as d, useState as f, useSyncExternalStore as ce } from "react";
21
- import { jsx as p } from "react/jsx-runtime";
22
- import { QueryClient as m, QueryClientProvider as h } from "@tanstack/react-query";
20
+ import { useEffect as l, useMemo as u, useRef as d, useState as f, useSyncExternalStore as p } from "react";
21
+ import { jsx as m } from "react/jsx-runtime";
22
+ import { QueryClient as h, QueryClientProvider as ce } from "@tanstack/react-query";
23
23
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js
24
- function g({ children: g, baseUrl: _, widgetToken: v, organizationId: y, configClient: b, gatewayRouting: x, linkComponent: S, uiFramework: C, implementation: w, analytics: T, unstable_initResponseOverride: E }) {
25
- let D = ce(a, i, i), O = _ ?? D.baseUrl, k = v === void 0 ? D.widgetToken : v, A = y === void 0 ? D.organizationId : y, j = b ?? D.configClient, M = x ?? D.gatewayRouting, N = S ?? D.linkComponent, P = C ?? D.uiFramework, F = w ?? D.implementation, I = T !== !1, [L] = f(te), R = d({
26
- enabled: I,
27
- organizationId: A,
28
- rootCorrelationId: L
29
- }), [z] = f(() => new m({ defaultOptions: {
24
+ function g({ children: g, baseUrl: _, widgetToken: v, organizationId: y, configClient: b, gatewayRouting: x, linkComponent: S, uiFramework: C, implementation: w, analytics: T, unstable_initResponseOverride: E, disclosuresAcceptance: D }) {
25
+ let O = p(i, r, r), k = _ ?? O.baseUrl, A = v === void 0 ? O.widgetToken : v, j = y === void 0 ? O.organizationId : y, M = b ?? O.configClient, N = x ?? O.gatewayRouting, P = S ?? O.linkComponent, F = C ?? O.uiFramework, I = w ?? O.implementation, L = T !== !1, [R] = f(a), z = d({
26
+ enabled: L,
27
+ organizationId: j,
28
+ rootCorrelationId: R
29
+ }), [B] = f(() => new h({ defaultOptions: {
30
30
  queries: {
31
31
  retry: !1,
32
32
  refetchOnWindowFocus: !1
33
33
  },
34
34
  mutations: { retry: !1 }
35
35
  } }));
36
- l(() => (e(z), () => t(z)), [z]);
37
- let B = d(k);
38
- B.current = k;
39
- let V = ie(k), H = u(() => {
40
- let e = ee(n(O), {
41
- tokenRef: B,
42
- analyticsContextRef: R,
43
- gatewayRouting: M
36
+ l(() => (e(B), () => t(B)), [B]);
37
+ let V = d(A);
38
+ V.current = A;
39
+ let H = ie(A), U = u(() => {
40
+ let e = te(ee(k), {
41
+ tokenRef: V,
42
+ analyticsContextRef: z,
43
+ gatewayRouting: N
44
44
  });
45
- return j ? j(e) : e;
45
+ return M ? M(e) : e;
46
46
  }, [
47
- O,
48
- j,
49
- M
47
+ k,
48
+ M,
49
+ N
50
50
  ]);
51
51
  l(() => {
52
- if (!I || !("window" in globalThis)) return;
52
+ if (!L || !("window" in globalThis)) return;
53
53
  let e = !1;
54
54
  return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled: t }) => {
55
55
  e || t();
56
56
  }), () => {
57
57
  e = !0;
58
58
  };
59
- }, [I]);
60
- let U = c(se(P));
59
+ }, [L]);
60
+ let W = c(o(F));
61
61
  l(() => {
62
- U && U().catch(() => {});
63
- }, [U]);
64
- let { result: W, loading: G, error: K, initStaleForToken: le, refetch: q } = ae(E ? null : H, k, R), J = k ? E ?? W ?? void 0 : void 0, Y = !E && le, X = re(A, Y ? void 0 : J?.organizationId), ue = u(() => oe({
65
- hasToken: !!k,
62
+ W && W().catch(() => {});
63
+ }, [W]);
64
+ let { result: le, loading: G, error: K, initStaleForToken: ue, refetch: q } = ae(E ? null : U, A, z), J = A ? E ?? le ?? void 0 : void 0, Y = !E && ue, X = re(j, Y ? void 0 : J?.organizationId), de = u(() => oe({
65
+ hasToken: !!A,
66
66
  loading: G,
67
67
  error: K,
68
68
  initResponse: J,
69
69
  initStaleForToken: Y
70
70
  }), [
71
- k,
71
+ A,
72
72
  G,
73
73
  K,
74
74
  J,
75
75
  Y
76
76
  ]);
77
- o(ue, k);
77
+ se(de, A);
78
78
  let Z = u(() => ({
79
- enabled: I,
79
+ enabled: L,
80
80
  organizationId: X,
81
- rootCorrelationId: L
81
+ rootCorrelationId: R
82
82
  }), [
83
- I,
83
+ L,
84
84
  X,
85
- L
85
+ R
86
86
  ]);
87
- R.current = Z;
87
+ z.current = Z;
88
88
  let Q = u(() => ({
89
89
  baseUrl: _,
90
90
  widgetToken: v,
@@ -104,34 +104,35 @@ function g({ children: g, baseUrl: _, widgetToken: v, organizationId: y, configC
104
104
  C,
105
105
  w
106
106
  ]), $ = u(() => ({
107
- baseUrl: O,
108
- widgetToken: k,
107
+ baseUrl: k,
108
+ widgetToken: A,
109
109
  organizationId: X,
110
- configClient: j,
111
- gatewayRouting: M,
112
- linkComponent: N,
113
- uiFramework: P,
114
- implementation: F,
110
+ configClient: M,
111
+ gatewayRouting: N,
112
+ linkComponent: P,
113
+ uiFramework: F,
114
+ implementation: I,
115
115
  initResponse: J
116
116
  }), [
117
- O,
118
117
  k,
118
+ A,
119
119
  X,
120
- j,
121
120
  M,
122
121
  N,
123
122
  P,
124
123
  F,
124
+ I,
125
125
  J
126
- ]), de = u(() => ({
126
+ ]), fe = u(() => ({
127
127
  resolved: $,
128
128
  own: Q,
129
129
  refetch: q,
130
130
  loading: G,
131
131
  error: K,
132
132
  analytics: Z,
133
- cascadeOrgId: A,
134
- initResponseStaleForToken: Y
133
+ cascadeOrgId: j,
134
+ initResponseStaleForToken: Y,
135
+ disclosuresAcceptance: D
135
136
  }), [
136
137
  $,
137
138
  Q,
@@ -139,21 +140,22 @@ function g({ children: g, baseUrl: _, widgetToken: v, organizationId: y, configC
139
140
  G,
140
141
  K,
141
142
  Z,
142
- A,
143
- Y
143
+ j,
144
+ Y,
145
+ D
144
146
  ]);
145
- return /* @__PURE__ */ p(h, {
146
- client: z,
147
- children: /* @__PURE__ */ p(r, {
148
- client: H,
147
+ return /* @__PURE__ */ m(ce, {
148
+ client: B,
149
+ children: /* @__PURE__ */ m(n, {
150
+ client: U,
149
151
  organizationId: X,
150
- widgetToken: k,
151
- authEpoch: V,
152
- children: /* @__PURE__ */ p(ne.Provider, {
153
- value: de,
154
- children: /* @__PURE__ */ p(s, {
155
- linkComponent: N,
156
- uiFramework: P,
152
+ widgetToken: A,
153
+ authEpoch: H,
154
+ children: /* @__PURE__ */ m(ne.Provider, {
155
+ value: fe,
156
+ children: /* @__PURE__ */ m(s, {
157
+ linkComponent: P,
158
+ uiFramework: F,
157
159
  children: g
158
160
  })
159
161
  })
@@ -2,185 +2,211 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { registerQueryClient as e, unregisterQueryClient as ee } from "../../../../data-access/dist/lib/clientRegistry.js";
6
- import { createEmbeddedClient as t } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
7
- import { EmbedApiProvider as te, useEmbedApi as ne } from "../../../../data-access/dist/lib/EmbedApiContext.js";
5
+ import { registerQueryClient as e, unregisterQueryClient as t } from "../../../../data-access/dist/lib/clientRegistry.js";
6
+ import { createEmbeddedClient as n } from "../../../../data-access/dist/lib/createEmbeddedClient.js";
7
+ import { EmbedApiProvider as r, useEmbedApi as ee } from "../../../../data-access/dist/lib/EmbedApiContext.js";
8
8
  import "../../../../data-access/dist/index.js";
9
- import { getGlobalSnapshot as n, subscribeToGlobal as re } from "./globalStore.js";
10
- import { configureEmbeddedClient as ie } from "../analytics/client.js";
11
- import { generateCorrelationId as r } from "../analytics/ids.js";
12
- import { WidgetContext as i } from "./WidgetContext.js";
13
- import { noop as ae, resolveOrgId as oe, useAuthEpoch as se } from "./utils.js";
14
- import { useWidgetFetch as ce } from "./useWidgetFetch.js";
15
- import { deriveWidgetInitState as le, useWidgetInitPublisher as ue } from "./useWidgetInitPublisher.js";
16
- import { resolveUIFramework as de } from "../../../../ui/dist/lib/UIContext/UIContext.js";
17
- import { UIProvider as fe } from "../../../../ui/dist/lib/UIContext/UIProvider.js";
18
- import { useDesignSystemEnsurer as pe } from "../../../../ui/dist/lib/UIContext/uiRendererRegistry.js";
19
- import { HostIsolationScope as me } from "../../../../ui/dist/lib/HostIsolationScope/HostIsolationScope.js";
9
+ import { getGlobalSnapshot as te, subscribeToGlobal as ne } from "./globalStore.js";
10
+ import { configureEmbeddedClient as re } from "../analytics/client.js";
11
+ import { generateCorrelationId as ie } from "../analytics/ids.js";
12
+ import { WidgetContext as ae } from "./WidgetContext.js";
13
+ import { noop as oe, resolveOrgId as se, useAuthEpoch as ce } from "./utils.js";
14
+ import { useWidgetFetch as le } from "./useWidgetFetch.js";
15
+ import { deriveWidgetInitState as ue, useWidgetInitPublisher as de } from "./useWidgetInitPublisher.js";
16
+ import { resolveUIFramework as fe } from "../../../../ui/dist/lib/UIContext/UIContext.js";
17
+ import { UIProvider as pe } from "../../../../ui/dist/lib/UIContext/UIProvider.js";
18
+ import { useDesignSystemEnsurer as me, useFrameworkRenderer as he } from "../../../../ui/dist/lib/UIContext/uiRendererRegistry.js";
19
+ import { HostIsolationScope as ge } from "../../../../ui/dist/lib/HostIsolationScope/HostIsolationScope.js";
20
+ import { ErrorState as i } from "../../../../ui/dist/lib/ErrorState/ErrorState.js";
20
21
  import "../../../../ui/dist/index.js";
21
- import { WidgetErrorBoundary as he } from "./WidgetErrorBoundary.js";
22
- import { useContext as ge, useEffect as a, useMemo as o, useRef as s, useState as c, useSyncExternalStore as _e } from "react";
23
- import { jsx as l } from "react/jsx-runtime";
24
- import { QueryClient as ve, QueryClientProvider as ye } from "@tanstack/react-query";
22
+ import { DEFAULT_LABELS as a } from "./labels.js";
23
+ import { WidgetErrorBoundary as _e } from "./WidgetErrorBoundary.js";
24
+ import { DISCLOSURES_REQUIRED_TEST_ID as o, isAuthenticatedDisclosuresReacceptance as s, shouldGateOnDisclosuresAcceptance as ve } from "./isDisclosuresAcceptanceRequired.js";
25
+ import { useContext as ye, useEffect as c, useMemo as l, useRef as u, useState as d, useSyncExternalStore as be } from "react";
26
+ import { jsx as f } from "react/jsx-runtime";
27
+ import { QueryClient as xe, QueryClientProvider as Se } from "@tanstack/react-query";
25
28
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js
26
- function u({ children: u, baseUrl: d, widgetToken: f, organizationId: p, configClient: m, gatewayRouting: h, linkComponent: g, uiFramework: _, implementation: v, errorFallback: be, onError: xe, analytics: y, widgetName: b }) {
27
- let x = ge(i), Se = _e(re, n, n), S = x?.resolved ?? Se, Ce = x?.refetch ?? ae, we = x?.loading ?? !1, Te = x?.error ?? null, C = d ?? S.baseUrl, w = f === void 0 ? S.widgetToken : f, Ee = x ? x.cascadeOrgId : Se.organizationId, T = p === void 0 ? Ee : p, E = m ?? S.configClient, D = h ?? S.gatewayRouting, O = g ?? S.linkComponent, k = _ ?? S.uiFramework, A = v ?? S.implementation, j = x === null, M = j ? y !== !1 : x.analytics.enabled, [De] = c(r), N = j ? De : x.analytics.rootCorrelationId, [Oe] = c(r), P = b === void 0 ? x?.analytics.widgetName : b, F = b === void 0 ? x?.analytics.widgetInstanceId : Oe, I = s({
29
+ function p({ children: he, baseUrl: i, widgetToken: a, organizationId: o, configClient: s, gatewayRouting: p, linkComponent: m, uiFramework: h, implementation: g, errorFallback: we, onError: Te, analytics: _, disclosuresAcceptance: Ee, widgetName: v }) {
30
+ let y = ye(ae), b = be(ne, te, te), x = y?.resolved ?? b, De = y?.refetch ?? oe, Oe = y?.loading ?? !1, ke = y?.error ?? null, S = i ?? x.baseUrl, C = a === void 0 ? x.widgetToken : a, Ae = y ? y.cascadeOrgId : b.organizationId, w = o === void 0 ? Ae : o, T = s ?? x.configClient, E = p ?? x.gatewayRouting, D = m ?? x.linkComponent, O = h ?? x.uiFramework, k = g ?? x.implementation, A = Ee ?? y?.disclosuresAcceptance, j = y === null, M = j ? _ !== !1 : y.analytics.enabled, [je] = d(ie), N = j ? je : y.analytics.rootCorrelationId, [Me] = d(ie), P = v === void 0 ? y?.analytics.widgetName : v, F = v === void 0 ? y?.analytics.widgetInstanceId : Me, I = u({
28
31
  enabled: M,
29
- organizationId: T,
32
+ organizationId: w,
30
33
  rootCorrelationId: N,
31
34
  widgetName: P,
32
35
  widgetInstanceId: F
33
- }), L = s(!1);
34
- a(() => {
35
- j || y === void 0 || L.current || (L.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."));
36
- }, [y, j]), a(() => {
36
+ }), Ne = u(!1);
37
+ c(() => {
38
+ j || _ === void 0 || Ne.current || (Ne.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."));
39
+ }, [_, j]), c(() => {
37
40
  if (!j || !M || !("window" in globalThis)) return;
38
41
  let e = !1;
39
- return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled: ee }) => {
40
- e || ee();
42
+ return import("../analytics/install.js").then(({ ensureAnalyticsAdapterInstalled: t }) => {
43
+ e || t();
41
44
  }), () => {
42
45
  e = !0;
43
46
  };
44
47
  }, [j, M]);
45
- let R = pe(de(k));
46
- a(() => {
47
- R && R().catch(() => {});
48
- }, [R]);
49
- let z = x === null || d !== void 0 || f !== void 0 || p !== void 0 || m != null || h !== void 0 || b !== void 0, B = s(w);
50
- B.current = w;
51
- let ke = ne(), Ae = se(w), V = o(() => {
52
- if (!z) return null;
53
- let e = ie(t(C), {
54
- tokenRef: B,
48
+ let L = me(fe(O));
49
+ c(() => {
50
+ L && L().catch(() => {});
51
+ }, [L]);
52
+ let R = y === null || i !== void 0 || a !== void 0 || o !== void 0 || s != null || p !== void 0 || v !== void 0, z = u(C);
53
+ z.current = C;
54
+ let Pe = ee(), Fe = ce(C), B = l(() => {
55
+ if (!R) return null;
56
+ let e = re(n(S), {
57
+ tokenRef: z,
55
58
  analyticsContextRef: I,
56
- gatewayRouting: D
59
+ gatewayRouting: E
57
60
  });
58
- return E ? E(e) : e;
61
+ return T ? T(e) : e;
59
62
  }, [
60
- z,
61
- C,
62
- E,
63
- D
64
- ]), H = x === null || d !== void 0 || f !== void 0, je = H ? Ae : ke.authEpoch, { result: U, loading: W, error: G, clearedForAuthChange: Me, initStaleForToken: K, refetch: Ne } = ce(H ? V : null, H ? w : void 0, I), Pe = H ? Ne : Ce, Fe = H ? W : we, Ie = H ? G : Te, Le = x?.resolved.initResponse, Re = !H || !Me && !G && !U && !!w && !W, q = Re ? Le : U ?? void 0, J = Re ? H || (x?.initResponseStaleForToken ?? !1) : K, Y = x === null, ze = o(() => Y ? le({
65
- hasToken: !!w,
66
- loading: W,
67
- error: G,
68
- initResponse: U ?? void 0,
69
- initStaleForToken: K
63
+ R,
64
+ S,
65
+ T,
66
+ E
67
+ ]), V = y === null || i !== void 0 || a !== void 0, Ie = V ? Fe : Pe.authEpoch, { result: H, loading: U, error: W, clearedForAuthChange: Le, initStaleForToken: G, refetch: Re } = le(V ? B : null, V ? C : void 0, I), K = V ? Re : De, q = V ? U : Oe, J = V ? W : ke, ze = y?.resolved.initResponse, Be = !V || !Le && !W && !H && !!C && !U, Y = Be ? ze : H ?? void 0, X = Be ? V || (y?.initResponseStaleForToken ?? !1) : G, Ve = y === null, He = l(() => Ve ? ue({
68
+ hasToken: !!C,
69
+ loading: U,
70
+ error: W,
71
+ initResponse: H ?? void 0,
72
+ initStaleForToken: G
70
73
  }) : null, [
71
- Y,
72
- w,
73
- W,
74
- G,
74
+ Ve,
75
+ C,
75
76
  U,
76
- K
77
+ W,
78
+ H,
79
+ G
77
80
  ]);
78
- ue(ze, w);
79
- let X = oe(T, J ? void 0 : q?.organizationId), Z = o(() => ({
81
+ de(He, C);
82
+ let Z = se(w, X ? void 0 : Y?.organizationId), Q = l(() => ({
80
83
  enabled: M,
81
- organizationId: X,
84
+ organizationId: Z,
82
85
  rootCorrelationId: N,
83
86
  widgetName: P,
84
87
  widgetInstanceId: F
85
88
  }), [
86
89
  M,
87
- X,
90
+ Z,
88
91
  N,
89
92
  P,
90
93
  F
91
94
  ]);
92
- I.current = Z;
93
- let [Q] = c(() => x === null ? new ve({ defaultOptions: {
95
+ I.current = Q;
96
+ let [$] = d(() => y === null ? new xe({ defaultOptions: {
94
97
  queries: {
95
98
  retry: !1,
96
99
  refetchOnWindowFocus: !1
97
100
  },
98
101
  mutations: { retry: !1 }
99
102
  } }) : null);
100
- a(() => {
101
- if (!Q) return;
102
- let t = Q;
103
- return e(t), () => ee(t);
104
- }, [Q]);
105
- let Be = o(() => ({
106
- baseUrl: d,
107
- widgetToken: f,
108
- organizationId: p,
109
- configClient: m,
110
- gatewayRouting: h,
111
- linkComponent: g,
112
- uiFramework: _,
113
- implementation: v
103
+ c(() => {
104
+ if (!$) return;
105
+ let n = $;
106
+ return e(n), () => t(n);
107
+ }, [$]);
108
+ let Ue = l(() => ({
109
+ baseUrl: i,
110
+ widgetToken: a,
111
+ organizationId: o,
112
+ configClient: s,
113
+ gatewayRouting: p,
114
+ linkComponent: m,
115
+ uiFramework: h,
116
+ implementation: g
114
117
  }), [
115
- d,
116
- f,
118
+ i,
119
+ a,
120
+ o,
121
+ s,
117
122
  p,
118
123
  m,
119
124
  h,
120
- g,
121
- _,
122
- v
123
- ]), Ve = o(() => ({
124
- baseUrl: C,
125
- widgetToken: w,
126
- organizationId: X,
127
- configClient: E,
128
- gatewayRouting: D,
129
- linkComponent: O,
130
- uiFramework: k,
131
- implementation: A,
132
- initResponse: q
125
+ g
126
+ ]), We = l(() => ({
127
+ baseUrl: S,
128
+ widgetToken: C,
129
+ organizationId: Z,
130
+ configClient: T,
131
+ gatewayRouting: E,
132
+ linkComponent: D,
133
+ uiFramework: O,
134
+ implementation: k,
135
+ initResponse: Y
133
136
  }), [
137
+ S,
134
138
  C,
135
- w,
136
- X,
139
+ Z,
140
+ T,
137
141
  E,
138
142
  D,
139
143
  O,
140
144
  k,
141
- A,
142
- q
143
- ]), He = o(() => ({
144
- resolved: Ve,
145
- own: Be,
146
- refetch: Pe,
147
- loading: Fe,
148
- error: Ie,
149
- analytics: Z,
150
- cascadeOrgId: T,
151
- initResponseStaleForToken: J
145
+ Y
146
+ ]), Ge = l(() => ({
147
+ resolved: We,
148
+ own: Ue,
149
+ refetch: K,
150
+ loading: q,
151
+ error: J,
152
+ analytics: Q,
153
+ cascadeOrgId: w,
154
+ initResponseStaleForToken: X,
155
+ disclosuresAcceptance: A
152
156
  }), [
153
- Ve,
154
- Be,
155
- Pe,
156
- Fe,
157
- Ie,
158
- Z,
159
- T,
160
- J
161
- ]), Ue = /* @__PURE__ */ l(i.Provider, {
162
- value: He,
163
- children: /* @__PURE__ */ l(fe, {
164
- linkComponent: O,
165
- uiFramework: k,
166
- children: /* @__PURE__ */ l(me, { children: /* @__PURE__ */ l(he, {
167
- resetKeys: [w],
168
- errorFallback: be,
169
- onError: xe,
170
- children: u
157
+ We,
158
+ Ue,
159
+ K,
160
+ q,
161
+ J,
162
+ Q,
163
+ w,
164
+ X,
165
+ A
166
+ ]), Ke = /* @__PURE__ */ f(ae.Provider, {
167
+ value: Ge,
168
+ children: /* @__PURE__ */ f(pe, {
169
+ linkComponent: D,
170
+ uiFramework: O,
171
+ children: /* @__PURE__ */ f(ge, { children: /* @__PURE__ */ f(_e, {
172
+ resetKeys: [C],
173
+ errorFallback: we,
174
+ onError: Te,
175
+ children: ve(Y, v) ? /* @__PURE__ */ f(Ce, {
176
+ init: Y,
177
+ disclosuresAcceptance: A,
178
+ initStaleForToken: X
179
+ }) : he
171
180
  }) })
172
181
  })
173
- }), $ = V ? /* @__PURE__ */ l(te, {
174
- client: V,
175
- organizationId: X,
176
- widgetToken: w,
177
- authEpoch: je,
178
- children: Ue
179
- }) : Ue;
180
- return Q ? /* @__PURE__ */ l(ye, {
181
- client: Q,
182
- children: $
183
- }) : $;
182
+ }), qe = B ? /* @__PURE__ */ f(r, {
183
+ client: B,
184
+ organizationId: Z,
185
+ widgetToken: C,
186
+ authEpoch: Ie,
187
+ children: Ke
188
+ }) : Ke;
189
+ return $ ? /* @__PURE__ */ f(Se, {
190
+ client: $,
191
+ children: qe
192
+ }) : qe;
193
+ }
194
+ function Ce({ init: e, disclosuresAcceptance: t, initStaleForToken: n }) {
195
+ let r = he("error-state") ?? i;
196
+ return n ? /* @__PURE__ */ f(r, {
197
+ title: a.disclosuresRefreshingTitle,
198
+ description: a.disclosuresRefreshingDescription,
199
+ testId: o,
200
+ className: "ttw:w-full ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:py-7 ttw:text-card-foreground ttw:shadow-sm"
201
+ }) : s(e) && t != null ? /* @__PURE__ */ f("div", {
202
+ "data-testid": o,
203
+ className: "ttw:w-full",
204
+ children: t
205
+ }) : /* @__PURE__ */ f(r, {
206
+ title: a.disclosuresRequiredTitle,
207
+ testId: o,
208
+ className: "ttw:w-full ttw:rounded-xl ttw:border ttw:border-border ttw:bg-card ttw:py-7 ttw:text-card-foreground ttw:shadow-sm"
209
+ });
184
210
  }
185
211
  //#endregion
186
- export { u as WidgetProvider, u as default };
212
+ export { p as WidgetProvider, p as default };
@@ -12,16 +12,19 @@ function s() {
12
12
  return i(n)?.own ?? null;
13
13
  }
14
14
  function c() {
15
- return i(n)?.initResponseStaleForToken ?? !1;
15
+ return i(n)?.disclosuresAcceptance;
16
16
  }
17
17
  function l() {
18
- return i(n)?.refetch ?? r;
18
+ return i(n)?.initResponseStaleForToken ?? !1;
19
19
  }
20
20
  function u() {
21
- return i(n)?.loading ?? !1;
21
+ return i(n)?.refetch ?? r;
22
22
  }
23
23
  function d() {
24
+ return i(n)?.loading ?? !1;
25
+ }
26
+ function f() {
24
27
  return i(n)?.error ?? null;
25
28
  }
26
29
  //#endregion
27
- export { s as useOwnWidgetConfig, l as useRefetchWidget, o as useWidgetConfig, d as useWidgetError, c as useWidgetInitStaleForToken, u as useWidgetLoading };
30
+ export { c as useDisclosuresAcceptanceSurface, s as useOwnWidgetConfig, u as useRefetchWidget, o as useWidgetConfig, f as useWidgetError, l as useWidgetInitStaleForToken, d as useWidgetLoading };
@@ -0,0 +1,20 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/isDisclosuresAcceptanceRequired.js
2
+ var e = "widget-disclosures-required", t = /* @__PURE__ */ new Set([
3
+ "accept_disclosures",
4
+ "onboarding",
5
+ "widget_suite"
6
+ ]);
7
+ function n(e) {
8
+ return e?.disclosuresRequired === "REQUIRED" && e?.disclosuresAccepted === !1;
9
+ }
10
+ function r(e) {
11
+ return e !== void 0 && t.has(e);
12
+ }
13
+ function i(e, t) {
14
+ return t !== void 0 && n(e) && !r(t);
15
+ }
16
+ function a(e) {
17
+ return n(e) && e?.status === "ACTIVE";
18
+ }
19
+ //#endregion
20
+ export { e as DISCLOSURES_REQUIRED_TEST_ID, a as isAuthenticatedDisclosuresReacceptance, n as isDisclosuresAcceptanceRequired, r as isDisclosuresGateExempt, i as shouldGateOnDisclosuresAcceptance };
@@ -1,4 +1,9 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/labels.js
2
- var e = { errorBoundaryFallback: "Something went wrong loading this widget." };
2
+ var e = {
3
+ errorBoundaryFallback: "Something went wrong loading this widget.",
4
+ disclosuresRequiredTitle: "Accept disclosures to continue",
5
+ disclosuresRefreshingTitle: "Updating your session",
6
+ disclosuresRefreshingDescription: "Please wait while we load the latest disclosures for this session."
7
+ };
3
8
  //#endregion
4
9
  export { e as DEFAULT_LABELS };
@@ -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.2.280", n = "ae40a14057aee11fe4101507cc328681e99bda36", r = Object.freeze({
2
+ var e = "@tesouro/embedded-components-react", t = "0.2.282", n = "14b9e18a8a97f8487169fcbc8d319c74a19e24dd", r = Object.freeze({
3
3
  library_name: e,
4
4
  library_version: t,
5
5
  library_sha: n