@tesouro/embedded-components-react 0.2.267 → 0.2.270

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 (66) hide show
  1. package/README.md +15 -12
  2. package/dist/experimental/WidgetSuite.d.ts +25 -1
  3. package/dist/experimental/index.d.ts +25 -1
  4. package/dist/index.css +3 -0
  5. package/dist/index.d.ts +46 -22
  6. package/dist/lib/AcceptDisclosuresWidget.d.ts +25 -1
  7. package/dist/lib/BalancesWidget.d.ts +24 -0
  8. package/dist/lib/BankAccountOnboardingWidget.d.ts +25 -1
  9. package/dist/lib/BankAccountsWidget.d.ts +25 -1
  10. package/dist/lib/BillPayWidget.d.ts +24 -0
  11. package/dist/lib/CardDetailsWidget.d.ts +25 -1
  12. package/dist/lib/CardsWidget.d.ts +25 -1
  13. package/dist/lib/ChartOfAccountsWidget.d.ts +25 -1
  14. package/dist/lib/CounterpartsWidget.d.ts +25 -1
  15. package/dist/lib/CreateCardWidget.d.ts +25 -1
  16. package/dist/lib/ExpenseApprovalPoliciesWidget.d.ts +25 -1
  17. package/dist/lib/ExpenseManagementWidget.d.ts +25 -1
  18. package/dist/lib/ExpenseRequirementsWidget.d.ts +25 -1
  19. package/dist/lib/HelpWidget.d.ts +25 -1
  20. package/dist/lib/InsightsWidget.d.ts +24 -0
  21. package/dist/lib/InvoicingWidget.d.ts +25 -1
  22. package/dist/lib/LinkedAccountsWidget.d.ts +25 -1
  23. package/dist/lib/ProductsWidget.d.ts +25 -1
  24. package/dist/lib/ProfileWidget.d.ts +25 -1
  25. package/dist/lib/ReceiptMatchWidget.d.ts +25 -1
  26. package/dist/lib/ReceivablesWidget.d.ts +25 -1
  27. package/dist/lib/SettingsWidget.d.ts +25 -1
  28. package/dist/lib/TagsWidget.d.ts +25 -1
  29. package/dist/lib/TeamWidget.d.ts +25 -1
  30. package/dist/lib/TransfersWidget.d.ts +24 -0
  31. package/dist/lib/WidgetProvider.d.ts +25 -1
  32. package/dist/lib/WidgetProviderPublic.d.ts +24 -0
  33. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index4.js +9 -8
  34. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js +122 -121
  35. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js +9 -8
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +11 -10
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +9 -8
  38. package/dist/libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index6.js +9 -8
  39. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index7.js +1 -1
  40. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index8.js +9 -8
  41. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsList.js +1 -1
  42. package/dist/libs/tesouro-embedded-components-react/cards-widget/ui/dist/lib/CardsList/CardsListDetailsSheet.js +1 -1
  43. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js +9 -8
  44. package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index7.js +94 -93
  45. package/dist/libs/tesouro-embedded-components-react/expense-approval-policies-widget/feature/dist/lib/ExpenseApprovalPoliciesWidgetFeature.js +7 -6
  46. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index3.js +9 -8
  47. package/dist/libs/tesouro-embedded-components-react/expense-receipt-match-widget/feature/dist/lib/ReceiptMatchWidget.js +12 -11
  48. package/dist/libs/tesouro-embedded-components-react/expense-requirements-widget/feature/dist/lib/ExpenseRequirementsWidget.js +7 -6
  49. package/dist/libs/tesouro-embedded-components-react/gl-code-table-widget/feature/dist/index8.js +9 -8
  50. package/dist/libs/tesouro-embedded-components-react/help-widget/feature/dist/index3.js +9 -8
  51. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +9 -8
  52. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index3.js +10 -9
  53. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +9 -8
  54. package/dist/libs/tesouro-embedded-components-react/products-widget/feature/dist/index8.js +9 -8
  55. package/dist/libs/tesouro-embedded-components-react/profile-widget/feature/dist/index4.js +9 -8
  56. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +10 -9
  57. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +22 -21
  58. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/widgetGatewayHosts.js +14 -0
  59. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/RootWidgetProvider.js +76 -67
  60. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetProvider.js +107 -101
  61. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  62. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/client.js +12 -4
  63. package/dist/libs/tesouro-embedded-components-react/tags-widget/feature/dist/index11.js +9 -8
  64. package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index17.js +106 -105
  65. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index6.js +9 -8
  66. package/package.json +1 -1
@@ -477,6 +477,30 @@ interface WidgetConfigInput {
477
477
  * ```
478
478
  */
479
479
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
480
+ /**
481
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
482
+ *
483
+ * Any caller reaching the Tesouro API with a widget token must route data
484
+ * requests through the widget gateway: prefix the path with
485
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
486
+ * provider applies both automatically per request when the request origin is
487
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
488
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
489
+ * init round-trip) always pass through untouched.
490
+ *
491
+ * - `undefined` — decide from the request origin, as above. Inherits from
492
+ * the nearest ancestor or global store like every other config field.
493
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
494
+ * custom domain in front of the gateway).
495
+ * - `false` — never apply it. For hosts that route widget requests their own
496
+ * way, such as a same-origin BFF whose `configClient` retargets every
497
+ * request.
498
+ *
499
+ * Independent of {@link configClient}: a host that only adds a header keeps
500
+ * the built-in routing, and the built-in interceptor runs before any
501
+ * `configClient` interceptor.
502
+ */
503
+ gatewayRouting?: boolean;
480
504
  /**
481
505
  * Component the embedded widgets should render in place of plain `<a>` tags.
482
506
  *
@@ -653,7 +677,7 @@ type TagsWidgetProps = WidgetProviderProps & TagsWidgetOwnProps;
653
677
  * <TagsWidget baseUrl="https://api.tesouro.com" widgetToken="wt_..." organizationId="org_..." />
654
678
  * ```
655
679
  */
656
- declare function TagsWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: TagsWidgetProps): React.JSX.Element;
680
+ declare function TagsWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: TagsWidgetProps): React.JSX.Element;
657
681
 
658
682
  export { TagsWidget };
659
683
  export type { TagDeleteDialogLabels, TagFormSheetLabels, TagMessageLabels, TagsScreenLabels, TagsWidgetProps };
@@ -477,6 +477,30 @@ interface WidgetConfigInput {
477
477
  * ```
478
478
  */
479
479
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
480
+ /**
481
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
482
+ *
483
+ * Any caller reaching the Tesouro API with a widget token must route data
484
+ * requests through the widget gateway: prefix the path with
485
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
486
+ * provider applies both automatically per request when the request origin is
487
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
488
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
489
+ * init round-trip) always pass through untouched.
490
+ *
491
+ * - `undefined` — decide from the request origin, as above. Inherits from
492
+ * the nearest ancestor or global store like every other config field.
493
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
494
+ * custom domain in front of the gateway).
495
+ * - `false` — never apply it. For hosts that route widget requests their own
496
+ * way, such as a same-origin BFF whose `configClient` retargets every
497
+ * request.
498
+ *
499
+ * Independent of {@link configClient}: a host that only adds a header keeps
500
+ * the built-in routing, and the built-in interceptor runs before any
501
+ * `configClient` interceptor.
502
+ */
503
+ gatewayRouting?: boolean;
480
504
  /**
481
505
  * Component the embedded widgets should render in place of plain `<a>` tags.
482
506
  *
@@ -814,7 +838,7 @@ interface TeamWidgetProps extends WidgetProviderProps {
814
838
  */
815
839
  acceptInviteRedirectUri?: string;
816
840
  }
817
- declare function TeamWidget({ baseUrl, widgetToken, organizationId, configClient, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: TeamWidgetProps): React.JSX.Element;
841
+ declare function TeamWidget({ baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, implementation, uiFramework, errorFallback, onError, analytics, ...innerProps }: TeamWidgetProps): React.JSX.Element;
818
842
 
819
843
  export { TeamWidget };
820
844
  export type { FeatureLabels as TeamWidgetFeatureLabels, Labels as TeamWidgetLabels, TeamWidgetProps };
@@ -477,6 +477,30 @@ interface WidgetConfigInput {
477
477
  * ```
478
478
  */
479
479
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
480
+ /**
481
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
482
+ *
483
+ * Any caller reaching the Tesouro API with a widget token must route data
484
+ * requests through the widget gateway: prefix the path with
485
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
486
+ * provider applies both automatically per request when the request origin is
487
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
488
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
489
+ * init round-trip) always pass through untouched.
490
+ *
491
+ * - `undefined` — decide from the request origin, as above. Inherits from
492
+ * the nearest ancestor or global store like every other config field.
493
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
494
+ * custom domain in front of the gateway).
495
+ * - `false` — never apply it. For hosts that route widget requests their own
496
+ * way, such as a same-origin BFF whose `configClient` retargets every
497
+ * request.
498
+ *
499
+ * Independent of {@link configClient}: a host that only adds a header keeps
500
+ * the built-in routing, and the built-in interceptor runs before any
501
+ * `configClient` interceptor.
502
+ */
503
+ gatewayRouting?: boolean;
480
504
  /**
481
505
  * Component the embedded widgets should render in place of plain `<a>` tags.
482
506
  *
@@ -561,6 +561,30 @@ interface WidgetConfigInput {
561
561
  * ```
562
562
  */
563
563
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
564
+ /**
565
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
566
+ *
567
+ * Any caller reaching the Tesouro API with a widget token must route data
568
+ * requests through the widget gateway: prefix the path with
569
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
570
+ * provider applies both automatically per request when the request origin is
571
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
572
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
573
+ * init round-trip) always pass through untouched.
574
+ *
575
+ * - `undefined` — decide from the request origin, as above. Inherits from
576
+ * the nearest ancestor or global store like every other config field.
577
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
578
+ * custom domain in front of the gateway).
579
+ * - `false` — never apply it. For hosts that route widget requests their own
580
+ * way, such as a same-origin BFF whose `configClient` retargets every
581
+ * request.
582
+ *
583
+ * Independent of {@link configClient}: a host that only adds a header keeps
584
+ * the built-in routing, and the built-in interceptor runs before any
585
+ * `configClient` interceptor.
586
+ */
587
+ gatewayRouting?: boolean;
564
588
  /**
565
589
  * Component the embedded widgets should render in place of plain `<a>` tags.
566
590
  *
@@ -914,7 +938,7 @@ interface RootWidgetProviderProps extends WidgetProviderBaseProps {
914
938
  * @see {@link useWidgetConfig} to read the resolved config in descendants
915
939
  * @see {@link setGlobalWidgetConfig} to push config imperatively from outside React
916
940
  */
917
- declare function RootWidgetProvider({ children, baseUrl, widgetToken, organizationId, configClient, linkComponent, uiFramework, implementation, analytics, unstable_initResponseOverride, }: PropsWithChildren<RootWidgetProviderProps>): React.JSX.Element;
941
+ declare function RootWidgetProvider({ children, baseUrl, widgetToken, organizationId, configClient, gatewayRouting, linkComponent, uiFramework, implementation, analytics, unstable_initResponseOverride, }: PropsWithChildren<RootWidgetProviderProps>): React.JSX.Element;
918
942
 
919
943
  /**
920
944
  * Props for {@link WidgetProvider}.
@@ -476,6 +476,30 @@ interface WidgetConfigInput {
476
476
  * ```
477
477
  */
478
478
  configClient?: (client: EmbeddedClient) => EmbeddedClient;
479
+ /**
480
+ * Overrides the widget-gateway routing decision for the scoped HTTP client.
481
+ *
482
+ * Any caller reaching the Tesouro API with a widget token must route data
483
+ * requests through the widget gateway: prefix the path with
484
+ * `/api/widget-gateway/proxy` and carry the token as `X-Widget-Token`. The
485
+ * provider applies both automatically per request when the request origin is
486
+ * a known Tesouro API host (`WIDGET_GATEWAY_HOSTS`, derived from the
487
+ * generated `ClientOptions['baseUrl']`); `/api/widget-gateway/*` paths (the
488
+ * init round-trip) always pass through untouched.
489
+ *
490
+ * - `undefined` — decide from the request origin, as above. Inherits from
491
+ * the nearest ancestor or global store like every other config field.
492
+ * - `true` — always apply the rewrite, even for an unlisted base URL (e.g. a
493
+ * custom domain in front of the gateway).
494
+ * - `false` — never apply it. For hosts that route widget requests their own
495
+ * way, such as a same-origin BFF whose `configClient` retargets every
496
+ * request.
497
+ *
498
+ * Independent of {@link configClient}: a host that only adds a header keeps
499
+ * the built-in routing, and the built-in interceptor runs before any
500
+ * `configClient` interceptor.
501
+ */
502
+ gatewayRouting?: boolean;
479
503
  /**
480
504
  * Component the embedded widgets should render in place of plain `<a>` tags.
481
505
  *
@@ -113,20 +113,21 @@ function S({ invitationToken: e, userId: t, labelOverrides: n, content: i, label
113
113
  errorMessage: p
114
114
  });
115
115
  }
116
- function C({ baseUrl: e, widgetToken: n, organizationId: r, configClient: i, linkComponent: a, implementation: o, uiFramework: c, errorFallback: l, onError: u, analytics: d, ...f }) {
116
+ function C({ baseUrl: e, widgetToken: n, organizationId: r, configClient: i, gatewayRouting: a, linkComponent: o, implementation: c, uiFramework: l, errorFallback: u, onError: d, analytics: f, ...p }) {
117
117
  return /* @__PURE__ */ _(s, {
118
118
  widgetName: t,
119
119
  baseUrl: e,
120
120
  widgetToken: n,
121
121
  organizationId: r,
122
122
  configClient: i,
123
- linkComponent: a,
124
- implementation: o,
125
- uiFramework: c,
126
- errorFallback: l,
127
- onError: u,
128
- analytics: d,
129
- children: /* @__PURE__ */ _(x, { ...f })
123
+ gatewayRouting: a,
124
+ linkComponent: o,
125
+ implementation: c,
126
+ uiFramework: l,
127
+ errorFallback: u,
128
+ onError: d,
129
+ analytics: f,
130
+ children: /* @__PURE__ */ _(x, { ...p })
130
131
  });
131
132
  }
132
133
  //#endregion
@@ -9,32 +9,32 @@ import { useAnalyticsTrack as i } from "../../../shared/feature/dist/lib/analyti
9
9
  import { WidgetProvider as a } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
10
10
  import { getStateOptions as o } from "../../../shared/util/dist/lib/usStates.js";
11
11
  import { extractApiErrorMessage as s } from "../../../shared/util/dist/lib/apiErrors.js";
12
- import { useRefetchWidget as c, useWidgetConfig as l } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
13
- import { getNaicsOptions as u } from "../../../shared/feature/dist/lib/naicsCodeMap.js";
12
+ import { useRefetchWidget as ee, useWidgetConfig as c } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
13
+ import { getNaicsOptions as l } from "../../../shared/feature/dist/lib/naicsCodeMap.js";
14
14
  import "../../../shared/feature/dist/index.js";
15
- import { ADDITIONAL_OWNERS_LABELS_EN as d } from "../../ui/dist/index4.js";
16
- import { interpolateBankName as f } from "../../ui/dist/index6.js";
17
- import { ResultStep as ee } from "../../ui/dist/index11.js";
18
- import { MarketingWidget as te } from "../../ui/dist/index28.js";
15
+ import { ADDITIONAL_OWNERS_LABELS_EN as u } from "../../ui/dist/index4.js";
16
+ import { interpolateBankName as d } from "../../ui/dist/index6.js";
17
+ import { ResultStep as te } from "../../ui/dist/index11.js";
18
+ import { MarketingWidget as ne } from "../../ui/dist/index28.js";
19
19
  import "../../ui/dist/index.js";
20
- import { BusinessDetailsStep as ne } from "./index9.js";
21
- import { PersonalDetailsStep as re } from "./index11.js";
22
- import { AdditionalOwnersStep as ie } from "./index13.js";
23
- import { buildCreateApplicationBody as ae, buildUpdateApplicationBody as p } from "./index14.js";
24
- import { OnboardingAnalyticsEvent as m, WIDGET_NAME as h } from "./index15.js";
25
- import { DEFAULT_LABELS as g } from "./index16.js";
26
- import { ApplicationClientSecretProvider as oe, useApplicationClientSecret as se } from "../../data-access/dist/index2.js";
27
- import { useCreateApplication as ce } from "../../data-access/dist/index4.js";
28
- import { useUpdateApplication as le } from "../../data-access/dist/index6.js";
29
- import { useSubmitApplication as ue } from "../../data-access/dist/index7.js";
30
- import { usePollApplicationCompletion as de } from "../../data-access/dist/index8.js";
31
- import { OnboardingSuppressionReason as fe } from "../../data-access/dist/index9.js";
32
- import { useOrganizationOnboardingSuppression as pe } from "../../data-access/dist/index10.js";
20
+ import { BusinessDetailsStep as re } from "./index9.js";
21
+ import { PersonalDetailsStep as ie } from "./index11.js";
22
+ import { AdditionalOwnersStep as ae } from "./index13.js";
23
+ import { buildCreateApplicationBody as oe, buildUpdateApplicationBody as se } from "./index14.js";
24
+ import { OnboardingAnalyticsEvent as f, WIDGET_NAME as p } from "./index15.js";
25
+ import { DEFAULT_LABELS as m } from "./index16.js";
26
+ import { ApplicationClientSecretProvider as ce, useApplicationClientSecret as le } from "../../data-access/dist/index2.js";
27
+ import { useCreateApplication as ue } from "../../data-access/dist/index4.js";
28
+ import { useUpdateApplication as de } from "../../data-access/dist/index6.js";
29
+ import { useSubmitApplication as fe } from "../../data-access/dist/index7.js";
30
+ import { usePollApplicationCompletion as pe } from "../../data-access/dist/index8.js";
31
+ import { OnboardingSuppressionReason as h } from "../../data-access/dist/index9.js";
32
+ import { useOrganizationOnboardingSuppression as me } from "../../data-access/dist/index10.js";
33
33
  import "../../data-access/dist/index.js";
34
- import { useCallback as _, useEffect as v, useMemo as y, useRef as me, useState as b } from "react";
35
- import { Fragment as he, jsx as x, jsxs as S } from "react/jsx-runtime";
34
+ import { useCallback as g, useEffect as _, useMemo as v, useRef as he, useState as y } from "react";
35
+ import { Fragment as ge, jsx as b, jsxs as x } from "react/jsx-runtime";
36
36
  //#region ../../libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js
37
- var ge = {
37
+ var _e = {
38
38
  companyLegalName: "",
39
39
  companyDbaName: "",
40
40
  businessAddress: "",
@@ -48,7 +48,7 @@ var ge = {
48
48
  naicsCode: "",
49
49
  isAuthorized: null,
50
50
  isCheckboxChecked: !1
51
- }, _e = {
51
+ }, ve = {
52
52
  firstName: "",
53
53
  lastName: "",
54
54
  dateOfBirth: void 0,
@@ -62,7 +62,7 @@ var ge = {
62
62
  ownsOver25Percent: null,
63
63
  ownershipPercentage: null
64
64
  };
65
- function ve(e, t) {
65
+ function ye(e, t) {
66
66
  if (e === 0) return {
67
67
  title: t.businessReviewTitle,
68
68
  subtitle: t.businessReviewSubtitle
@@ -72,7 +72,7 @@ function ve(e, t) {
72
72
  subtitle: t.personalReviewSubtitle
73
73
  };
74
74
  let n = {
75
- ...d,
75
+ ...u,
76
76
  ...t.additionalOwners
77
77
  };
78
78
  return {
@@ -80,55 +80,55 @@ function ve(e, t) {
80
80
  subtitle: n.subheading
81
81
  };
82
82
  }
83
- function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboard: d, labels: h, initialBusinessDetails: oe, initialPersonalDetails: ye, initialAdditionalOwners: C, bankLogoSrc: be, disclosureLinks: xe, marketingContent: w = null, open: Se, defaultOpen: T, onOpenChange: Ce }) {
84
- let E = i();
85
- v(() => {
86
- E(m.Mounted);
87
- }, [E]);
88
- let D = {
89
- ...g,
90
- ...h,
83
+ function be({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboard: u, labels: p, initialBusinessDetails: ce, initialPersonalDetails: be, initialAdditionalOwners: S, bankLogoSrc: xe, disclosureLinks: Se, marketingContent: C = null, open: Ce, defaultOpen: we, onOpenChange: w }) {
84
+ let T = i();
85
+ _(() => {
86
+ T(f.Mounted);
87
+ }, [T]);
88
+ let E = {
89
+ ...m,
90
+ ...p,
91
91
  stepIndicator: {
92
- ...g.stepIndicator,
93
- ...h?.stepIndicator
92
+ ...m.stepIndicator,
93
+ ...p?.stepIndicator
94
94
  },
95
- businessDetails: h?.businessDetails ?? {},
96
- personalDetails: h?.personalDetails ?? {},
97
- additionalOwners: h?.additionalOwners ?? {},
95
+ businessDetails: p?.businessDetails ?? {},
96
+ personalDetails: p?.personalDetails ?? {},
97
+ additionalOwners: p?.additionalOwners ?? {},
98
98
  result: {
99
- ...g.result,
100
- ...h?.result
99
+ ...m.result,
100
+ ...p?.result
101
101
  }
102
- }, O = l().initResponse, { termsHref: we, privacyHref: Te, electronicCommunicationHref: Ee, patriotActHref: De } = xe ?? {}, Oe = w !== null, k = Se === void 0, [ke, A] = b(!1), [Ae, je] = b(!0), [Me, Ne] = b(() => T ?? !1), Pe = be ?? w?.bankLogoSrc ?? void 0, Fe = k ? Me : Se, Ie = T ?? !1, j = _((e) => {
103
- k && Ne(e), Ce?.(e);
104
- }, [Ce, k]), Le = _(() => {
105
- E(m.OpenMarketing), A(!0);
106
- }, [E]), Re = _(() => {
107
- A(!1);
108
- }, []), ze = _(() => {
109
- E(m.BeginOnboarding), A(!1), j(!0);
110
- }, [j, E]), Be = _(() => {
111
- je(!1), a();
112
- }, [a]), Ve = c(), [M, N] = b(0), [He, Ue] = b(() => ({
113
- ...ge,
114
- ...oe
115
- })), [P, We] = b(() => ({
102
+ }, D = c().initResponse, { termsHref: Te, privacyHref: Ee, electronicCommunicationHref: De, patriotActHref: Oe } = Se ?? {}, ke = C !== null, O = Ce === void 0, [Ae, k] = y(!1), [je, Me] = y(!0), [Ne, Pe] = y(() => we ?? !1), Fe = xe ?? C?.bankLogoSrc ?? void 0, A = O ? Ne : Ce, Ie = we ?? !1, j = g((e) => {
103
+ O && Pe(e), w?.(e);
104
+ }, [w, O]), Le = g(() => {
105
+ T(f.OpenMarketing), k(!0);
106
+ }, [T]), Re = g(() => {
107
+ k(!1);
108
+ }, []), ze = g(() => {
109
+ T(f.BeginOnboarding), k(!1), j(!0);
110
+ }, [j, T]), Be = g(() => {
111
+ Me(!1), a();
112
+ }, [a]), Ve = ee(), [M, N] = y(0), [He, Ue] = y(() => ({
116
113
  ..._e,
117
- ...ye
118
- })), [Ge, Ke] = b(() => C ?? []), [F, qe] = b(null), [I, Je] = b(null), [L, Ye] = b(null), [R, Xe] = b(null), [Ze, z] = b(null), [B, V] = b(!1), [H, U] = b(null), W = ce(), G = le(), K = ue(), Qe = de(), { setClientSecret: $e } = se(), q = pe(), J = me(null);
119
- v(() => () => J.current?.abort(), []);
120
- let et = y(() => u(D.businessDetails.naicsTitles), [D.businessDetails.naicsTitles]), tt = y(() => o(D.businessDetails.stateTitles), [D.businessDetails.stateTitles]), nt = y(() => o(D.personalDetails.stateTitles), [D.personalDetails.stateTitles]), rt = y(() => o(D.additionalOwners.stateTitles), [D.additionalOwners.stateTitles]), Y = B || H !== null, X = O?.status === "ACTIVE" || O?.status === "INACTIVE", it = O?.status === "INVITED", Z = !!O && !Y && (X || it || q.isSuppressed), Q = Z ? X ? fe.UserAlreadyOnboarded : it ? fe.UserInvitedToOrganization : q.reason : null;
121
- if (v(() => {
122
- !Z || !Q || (E(m.Suppressed, { reason: Q }), console.info(`[onboarding] not shown: ${Q}`));
114
+ ...ce
115
+ })), [P, We] = y(() => ({
116
+ ...ve,
117
+ ...be
118
+ })), [Ge, Ke] = y(() => S ?? []), [F, qe] = y(null), [I, Je] = y(null), [L, Ye] = y(null), [R, Xe] = y(null), [Ze, z] = y(null), [B, V] = y(!1), [H, U] = y(null), W = ue(), G = de(), K = fe(), Qe = pe(), { setClientSecret: $e } = le(), q = me(), J = he(null);
119
+ _(() => () => J.current?.abort(), []);
120
+ let et = v(() => l(E.businessDetails.naicsTitles), [E.businessDetails.naicsTitles]), tt = v(() => o(E.businessDetails.stateTitles), [E.businessDetails.stateTitles]), nt = v(() => o(E.personalDetails.stateTitles), [E.personalDetails.stateTitles]), rt = v(() => o(E.additionalOwners.stateTitles), [E.additionalOwners.stateTitles]), Y = B || H !== null, it = D?.status === "ACTIVE" || D?.status === "INACTIVE", X = D?.status === "INVITED", Z = !!D && !Y && (it || X || q.isSuppressed), Q = Z ? it ? h.UserAlreadyOnboarded : X ? h.UserInvitedToOrganization : q.reason : null;
121
+ if (_(() => {
122
+ !Z || !Q || (T(f.Suppressed, { reason: Q }), console.info(`[onboarding] not shown: ${Q}`));
123
123
  }, [
124
124
  Z,
125
125
  Q,
126
- E
127
- ]), !O || !Y && (Z || !q.isResolved)) return null;
126
+ T
127
+ ]), !D || !Y && (Z || !q.isResolved)) return null;
128
128
  let at = F?.companyStructure === "SOLE_PROPRIETORSHIP", ot = [
129
- D.stepIndicator.business,
130
- D.stepIndicator.personal,
131
- D.stepIndicator.ownership
129
+ E.stepIndicator.business,
130
+ E.stepIndicator.personal,
131
+ E.stepIndicator.ownership
132
132
  ], st = M === 0 ? F : M === 1 ? I : M === 2 ? L : null, $ = W.isPending || G.isPending || K.isPending || B, ct = () => {
133
133
  z(null), N((e) => e === 0 ? 0 : e - 1);
134
134
  }, lt = () => {
@@ -141,7 +141,7 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
141
141
  try {
142
142
  let r = await K.mutateAsync({ path: { id: e } });
143
143
  if (t.signal.aborted) return;
144
- if (!r.id) throw Error(D.submitFailedError);
144
+ if (!r.id) throw Error(E.submitFailedError);
145
145
  n = !0, (await Qe(e, { signal: t.signal })).status === "complete" ? (U("success"), Ve(), Be()) : U("pending");
146
146
  } catch (e) {
147
147
  if (e instanceof DOMException && e.name === "AbortError") return;
@@ -157,7 +157,7 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
157
157
  if (!F) return;
158
158
  let e = R;
159
159
  if (!e) {
160
- let t = await W.mutateAsync({ body: ae(F) });
160
+ let t = await W.mutateAsync({ body: oe(F) });
161
161
  e = t.id, Xe(e), t.clientSecret && $e(t.clientSecret);
162
162
  }
163
163
  N(1);
@@ -165,7 +165,7 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
165
165
  if (!I || !F || !R) return;
166
166
  await G.mutateAsync({
167
167
  path: { id: R },
168
- body: p({
168
+ body: se({
169
169
  businessDetails: F,
170
170
  applicant: I
171
171
  })
@@ -174,28 +174,28 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
174
174
  if (!L || !R) return;
175
175
  await G.mutateAsync({
176
176
  path: { id: R },
177
- body: p({ businessOwners: L })
177
+ body: se({ businessOwners: L })
178
178
  }), await ut(R);
179
179
  }
180
180
  } catch (e) {
181
- let t = s(e) ?? (e instanceof Error ? e.message : void 0) ?? D.genericRetryError;
181
+ let t = s(e) ?? (e instanceof Error ? e.message : void 0) ?? E.genericRetryError;
182
182
  z(t);
183
183
  }
184
- }, ft = ve(Math.min(M, 2), D), pt = O.bankName?.trim() || D.fallbackBankName, mt = f(D.shellFdicDisclaimer, pt);
184
+ }, ft = ye(Math.min(M, 2), E), pt = D.bankName?.trim() || E.fallbackBankName, mt = d(E.shellFdicDisclaimer, pt);
185
185
  if (Y) {
186
- let r = F?.companyLegalName ?? "", i = O.bankName?.trim() || D.fallbackBankName, a = H ?? "pending", o = a === "success", s = {
187
- ...g.result,
188
- ...D.result
186
+ let r = F?.companyLegalName ?? "", i = D.bankName?.trim() || E.fallbackBankName, a = H ?? "pending", o = a === "success", s = {
187
+ ...m.result,
188
+ ...E.result
189
189
  };
190
- return /* @__PURE__ */ x(e, {
191
- open: Fe,
190
+ return /* @__PURE__ */ b(e, {
191
+ open: A,
192
192
  onOpenChange: j,
193
- children: /* @__PURE__ */ S(t, {
193
+ children: /* @__PURE__ */ x(t, {
194
194
  className: "ttw:grid ttw:max-h-[95vh] ttw:w-[720px] ttw:max-w-[calc(100vw-2rem)] ttw:grid-rows-[1fr] ttw:gap-0 ttw:overflow-hidden ttw:rounded-2xl ttw:p-0",
195
- children: [/* @__PURE__ */ x(n, {
195
+ children: [/* @__PURE__ */ b(n, {
196
196
  className: "ttw:sr-only",
197
- children: D.modalTitle
198
- }), /* @__PURE__ */ x(ee, {
197
+ children: E.modalTitle
198
+ }), /* @__PURE__ */ b(te, {
199
199
  status: a,
200
200
  isLoading: B,
201
201
  loadingMessage: s.loadingMessage,
@@ -205,32 +205,32 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
205
205
  followUpEmail: I?.workEmail ?? "",
206
206
  emailBoxLead: s.pendingEmailBoxLead,
207
207
  navigateToDashboardLabel: s.navigateToDashboard,
208
- bankLogoSrc: Pe,
209
- bankLogoAlt: f(s.bankLogoAlt, i),
210
- fdicDisclaimer: f(s.fdicDisclaimer, i),
211
- onNavigateToDashboard: d
208
+ bankLogoSrc: Fe,
209
+ bankLogoAlt: d(s.bankLogoAlt, i),
210
+ fdicDisclaimer: d(s.fdicDisclaimer, i),
211
+ onNavigateToDashboard: u
212
212
  })]
213
213
  })
214
214
  });
215
215
  }
216
- let ht = M === 2 ? D.submit : D.next, gt = st === null || $;
217
- return /* @__PURE__ */ S(he, { children: [Oe && Ae && w ? /* @__PURE__ */ x(te, {
218
- open: ke,
216
+ let ht = M === 2 ? E.submit : E.next, gt = st === null || $;
217
+ return /* @__PURE__ */ x(ge, { children: [ke && je && C ? /* @__PURE__ */ b(ne, {
218
+ open: Ae,
219
219
  isVisible: !0,
220
- vspLogo: w.vspLogo,
221
- bankingText: w.bankingText,
222
- primaryCaption: w.primaryCaption,
223
- secondaryCaption: w.secondaryCaption,
224
- providedByCaption: w.providedByCaption,
225
- modalPrimaryImg: w.modalPrimaryImg,
226
- primaryModalHeader: w.primaryModalHeader,
227
- benefits: w.benefits,
228
- appearance: w.appearance,
220
+ vspLogo: C.vspLogo,
221
+ bankingText: C.bankingText,
222
+ primaryCaption: C.primaryCaption,
223
+ secondaryCaption: C.secondaryCaption,
224
+ providedByCaption: C.providedByCaption,
225
+ modalPrimaryImg: C.modalPrimaryImg,
226
+ primaryModalHeader: C.primaryModalHeader,
227
+ benefits: C.benefits,
228
+ appearance: C.appearance,
229
229
  onOpenMarketingModal: Le,
230
230
  onCloseMarketingModal: Re,
231
231
  onPrimaryCtaClick: ze
232
- }) : null, /* @__PURE__ */ S(r, {
233
- open: Fe,
232
+ }) : null, /* @__PURE__ */ x(r, {
233
+ open: A,
234
234
  defaultOpen: Ie,
235
235
  onOpenChange: j,
236
236
  title: ft.title,
@@ -248,33 +248,33 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
248
248
  nextIcon: null,
249
249
  errorMessage: Ze,
250
250
  labels: {
251
- backButton: M === 0 ? D.cancel : D.back,
252
- cancelButton: D.cancel
251
+ backButton: M === 0 ? E.cancel : E.back,
252
+ cancelButton: E.cancel
253
253
  },
254
254
  children: [
255
- M === 0 ? /* @__PURE__ */ x(ne, {
255
+ M === 0 ? /* @__PURE__ */ b(re, {
256
256
  value: He,
257
257
  onValueChange: Ue,
258
258
  onSnapshotChange: qe,
259
259
  naicsOptions: et,
260
260
  stateOptions: tt,
261
261
  isSubmitting: $,
262
- labels: D.businessDetails,
262
+ labels: E.businessDetails,
263
263
  bankName: pt,
264
- termsHref: we,
265
- privacyHref: Te,
266
- electronicCommunicationHref: Ee,
267
- patriotActHref: De
264
+ termsHref: Te,
265
+ privacyHref: Ee,
266
+ electronicCommunicationHref: De,
267
+ patriotActHref: Oe
268
268
  }, "business") : null,
269
- M === 1 ? /* @__PURE__ */ x(re, {
269
+ M === 1 ? /* @__PURE__ */ b(ie, {
270
270
  value: P,
271
271
  onValueChange: We,
272
272
  onSnapshotChange: Je,
273
273
  stateOptions: nt,
274
274
  isSubmitting: $,
275
- labels: D.personalDetails
275
+ labels: E.personalDetails
276
276
  }, "personal") : null,
277
- M === 2 ? /* @__PURE__ */ x(ie, {
277
+ M === 2 ? /* @__PURE__ */ b(ae, {
278
278
  owners: Ge,
279
279
  onOwnersChange: Ke,
280
280
  primaryOwnerName: `${P.firstName} ${P.lastName}`.trim(),
@@ -282,30 +282,31 @@ function ye({ onEmbeddedOnboardingCompletedSuccessfully: a, onNavigateToDashboar
282
282
  stateOptions: rt,
283
283
  onSnapshotChange: Ye,
284
284
  isSubmitting: $,
285
- labels: D.additionalOwners
285
+ labels: E.additionalOwners
286
286
  }) : null
287
287
  ]
288
288
  })] });
289
289
  }
290
- function C({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, linkComponent: i, implementation: o, uiFramework: s, errorFallback: c, onError: l, analytics: u, ...d }) {
291
- return /* @__PURE__ */ x(a, {
290
+ function S({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, gatewayRouting: i, linkComponent: o, implementation: s, uiFramework: ee, errorFallback: c, onError: l, analytics: u, ...d }) {
291
+ return /* @__PURE__ */ b(a, {
292
292
  baseUrl: e,
293
293
  widgetToken: t,
294
294
  organizationId: n,
295
295
  configClient: r,
296
- linkComponent: i,
297
- implementation: o,
298
- uiFramework: s,
296
+ gatewayRouting: i,
297
+ linkComponent: o,
298
+ implementation: s,
299
+ uiFramework: ee,
299
300
  errorFallback: c,
300
301
  onError: l,
301
302
  analytics: u,
302
- widgetName: h,
303
- children: /* @__PURE__ */ x(be, { ...d })
303
+ widgetName: p,
304
+ children: /* @__PURE__ */ b(xe, { ...d })
304
305
  });
305
306
  }
306
- function be(e) {
307
- let { initResponse: t } = l(), n = t?.userId ?? null, [r, i] = b(n), [a, o] = b(0);
308
- return n !== r && (i(n), r !== null && n !== null && o((e) => e + 1)), /* @__PURE__ */ x(oe, { children: /* @__PURE__ */ x(ye, { ...e }, a) }, a);
307
+ function xe(e) {
308
+ let { initResponse: t } = c(), n = t?.userId ?? null, [r, i] = y(n), [a, o] = y(0);
309
+ return n !== r && (i(n), r !== null && n !== null && o((e) => e + 1)), /* @__PURE__ */ b(ce, { children: /* @__PURE__ */ b(be, { ...e }, a) }, a);
309
310
  }
310
311
  //#endregion
311
- export { C as BankAccountOnboardingWidget, C as default };
312
+ export { S as BankAccountOnboardingWidget, S as default };
@@ -45,20 +45,21 @@ function l({ labels: t, accountDetailsLabels: n, featureLabels: l, isBankingTagl
45
45
  ...C
46
46
  })] });
47
47
  }
48
- function u({ baseUrl: e, widgetToken: r, organizationId: i, configClient: a, linkComponent: o, implementation: c, uiFramework: u, errorFallback: d, onError: f, analytics: p, ...m }) {
48
+ function u({ baseUrl: e, widgetToken: r, organizationId: i, configClient: a, gatewayRouting: o, linkComponent: c, implementation: u, uiFramework: d, errorFallback: f, onError: p, analytics: m, ...h }) {
49
49
  return /* @__PURE__ */ s(t, {
50
50
  widgetName: n,
51
51
  baseUrl: e,
52
52
  widgetToken: r,
53
53
  organizationId: i,
54
54
  configClient: a,
55
- linkComponent: o,
56
- implementation: c,
57
- uiFramework: u,
58
- errorFallback: d,
59
- onError: f,
60
- analytics: p,
61
- children: /* @__PURE__ */ s(l, { ...m })
55
+ gatewayRouting: o,
56
+ linkComponent: c,
57
+ implementation: u,
58
+ uiFramework: d,
59
+ errorFallback: f,
60
+ onError: p,
61
+ analytics: m,
62
+ children: /* @__PURE__ */ s(l, { ...h })
62
63
  });
63
64
  }
64
65
  //#endregion