@tesouro/embedded-components-react 0.7.32 → 0.7.35

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 (43) hide show
  1. package/README.md +10 -8
  2. package/dist/index.d.ts +45 -31
  3. package/dist/index.js +5 -5
  4. package/dist/lib/CounterpartsWidget.d.ts +14 -0
  5. package/dist/lib/CounterpartsWidgetPublic.d.ts +14 -0
  6. package/dist/lib/CustomersWidget.d.ts +14 -0
  7. package/dist/lib/{MarketingWidget.d.ts → OfferWidget.d.ts} +31 -31
  8. package/dist/lib/OfferWidget.js +6 -0
  9. package/dist/lib/ReceivablesWidget.d.ts +14 -0
  10. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsActions.js +107 -91
  11. package/dist/libs/tesouro-embedded-components-react/offer-widget/feature/dist/index.js +5 -0
  12. package/dist/libs/tesouro-embedded-components-react/{marketing-widget/feature/dist/lib/MarketingWidget/MarketingWidget.js → offer-widget/feature/dist/lib/OfferWidget/OfferWidget.js} +11 -11
  13. package/dist/libs/tesouro-embedded-components-react/{marketing-widget/feature/dist/lib/MarketingWidget → offer-widget/feature/dist/lib/OfferWidget}/labels.js +2 -2
  14. package/dist/libs/tesouro-embedded-components-react/{marketing-widget/feature/dist/lib/MarketingWidget/marketingApplicationView.js → offer-widget/feature/dist/lib/OfferWidget/offerApplicationView.js} +2 -2
  15. package/dist/libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/analytics/events.js +8 -0
  16. package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/feature/dist/lib/testIds.js +2 -2
  17. package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/feature/dist/mocks/labels.js +2 -2
  18. package/dist/libs/tesouro-embedded-components-react/{marketing-widget/feature/dist/mocks/marketing.js → offer-widget/feature/dist/mocks/offer.js} +3 -3
  19. package/dist/libs/tesouro-embedded-components-react/offer-widget/feature/dist/scenarios.js +2 -0
  20. package/dist/libs/tesouro-embedded-components-react/offer-widget/ui/dist/index.js +5 -0
  21. package/dist/libs/tesouro-embedded-components-react/offer-widget/ui/dist/index2.js +10 -0
  22. package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index3.js +2 -2
  23. package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index4.js +2 -2
  24. package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index5.js +2 -2
  25. package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index6.js +2 -2
  26. package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index7.js +5 -5
  27. package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index8.js +3 -3
  28. package/dist/libs/tesouro-embedded-components-react/{marketing-widget → offer-widget}/ui/dist/index9.js +6 -6
  29. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/labels.js +11 -1
  30. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/subEntityForms.js +36 -38
  31. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useAddressForm.js +43 -41
  32. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useDeleteController.js +40 -34
  33. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  34. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/mocks/widgetSuite.js +2 -2
  35. package/dist/scenarios/index.d.ts +2 -2
  36. package/dist/scenarios/index.js +3 -3
  37. package/package.json +1 -1
  38. package/dist/lib/MarketingWidget.js +0 -6
  39. package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/index.js +0 -5
  40. package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/lib/analytics/events.js +0 -8
  41. package/dist/libs/tesouro-embedded-components-react/marketing-widget/feature/dist/scenarios.js +0 -2
  42. package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index.js +0 -5
  43. package/dist/libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index2.js +0 -10
@@ -2,115 +2,131 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { addressResponseToFormValues as e, bankAccountToAchFormValues as t, counterpartToFormValues as n } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
6
- import { useAddressForm as r } from "../../../../../shared/counterpart-management/feature/dist/lib/useAddressForm.js";
7
- import { useCounterpartForm as i } from "../../../../../shared/counterpart-management/feature/dist/lib/useCounterpartForm.js";
8
- import { useDeleteController as a } from "../../../../../shared/counterpart-management/feature/dist/lib/useDeleteController.js";
9
- import { useBankAccountForm as o } from "../../../../../shared/counterpart-management/feature/dist/lib/subEntityForms.js";
5
+ import { toast as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import "../../../../../shared/ui/dist/index.js";
7
+ import { addressResponseToFormValues as t, bankAccountToAchFormValues as n, counterpartToFormValues as r } from "../../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
8
+ import { useAddressForm as i } from "../../../../../shared/counterpart-management/feature/dist/lib/useAddressForm.js";
9
+ import { useCounterpartForm as a } from "../../../../../shared/counterpart-management/feature/dist/lib/useCounterpartForm.js";
10
+ import { useDeleteController as o } from "../../../../../shared/counterpart-management/feature/dist/lib/useDeleteController.js";
11
+ import { useBankAccountForm as s } from "../../../../../shared/counterpart-management/feature/dist/lib/subEntityForms.js";
10
12
  import "../../../../../shared/counterpart-management/feature/dist/index.js";
11
- import { useRebaseOnRefresh as s } from "./useRebaseOnRefresh.js";
12
- import { useCallback as c, useMemo as l } from "react";
13
+ import { useRebaseOnRefresh as c } from "./useRebaseOnRefresh.js";
14
+ import { useCallback as l, useMemo as u } from "react";
13
15
  //#region ../../libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/lib/CounterpartsWidget/useCounterpartDetailsActions.js
14
- var u = {
16
+ var d = {
15
17
  line1: "",
16
18
  line2: "",
17
19
  city: "",
18
20
  state: "",
19
21
  postalCode: ""
20
22
  };
21
- function d(e, t) {
23
+ function f(e, t) {
22
24
  return e.line1 === t.line1 && e.line2 === t.line2 && e.city === t.city && e.state === t.state && e.postalCode === t.postalCode;
23
25
  }
24
- function f({ counterpartType: f, selectedId: p, setSelectedId: m, view: h, setView: g, details: _, messages: v }) {
25
- let y = f === "customer", b = i({
26
- view: h,
27
- setView: g,
28
- selectedId: p,
29
- setSelectedId: m,
30
- messages: v,
31
- counterpartType: f,
32
- counterpart: _.counterpart,
33
- primaryAddress: y && h === "edit" ? void 0 : _.primaryAddress,
34
- includeBankAccount: h === "create"
35
- }), x = o({
36
- items: _.bankAccounts,
37
- selectedId: p,
38
- messages: v
39
- }), S = r({
40
- selectedId: p,
41
- primaryAddress: _.primaryAddress,
42
- messages: v
43
- }), C = a({
44
- selectedId: p,
45
- setSelectedId: m,
46
- detailsView: _.detailsView,
47
- messages: v
48
- }), w = l(() => {
49
- if (!_.counterpart) return;
50
- let e = n(_.counterpart, _.primaryAddress);
51
- return y ? {
26
+ function p(e) {
27
+ return e.entityType === "organization" ? e.legalName.trim() : [e.firstName.trim(), e.lastName.trim()].filter(Boolean).join(" ");
28
+ }
29
+ function m({ counterpartType: m, selectedId: h, setSelectedId: g, view: _, setView: v, details: y, messages: b }) {
30
+ let x = m === "customer", S = a({
31
+ view: _,
32
+ setView: v,
33
+ selectedId: h,
34
+ setSelectedId: g,
35
+ messages: b,
36
+ counterpartType: m,
37
+ counterpart: y.counterpart,
38
+ primaryAddress: x && _ === "edit" ? void 0 : y.primaryAddress,
39
+ includeBankAccount: _ === "create"
40
+ }), C = s({
41
+ items: y.bankAccounts,
42
+ selectedId: h,
43
+ messages: b
44
+ }), w = i({
45
+ selectedId: h,
46
+ primaryAddress: y.primaryAddress,
47
+ messages: b
48
+ }), T = o({
49
+ selectedId: h,
50
+ setSelectedId: g,
51
+ detailsView: y.detailsView,
52
+ messages: b
53
+ }), E = u(() => {
54
+ if (!y.counterpart) return;
55
+ let e = r(y.counterpart, y.primaryAddress);
56
+ return x ? {
52
57
  ...e,
53
- address: u
58
+ address: d
54
59
  } : e;
55
60
  }, [
56
- _.counterpart,
57
- _.primaryAddress,
58
- y
59
- ]), T = l(() => _.primaryAddress ? e(_.primaryAddress) : u, [_.primaryAddress]), E = l(() => {
60
- if (x.form.sheet.mode !== "edit") return;
61
- let e = _.bankAccounts?.find((e) => e.id === x.form.sheet.id);
62
- return e ? t(e) : void 0;
61
+ y.counterpart,
62
+ y.primaryAddress,
63
+ x
64
+ ]), D = u(() => y.primaryAddress ? t(y.primaryAddress) : d, [y.primaryAddress]), O = u(() => {
65
+ if (C.form.sheet.mode !== "edit") return;
66
+ let e = y.bankAccounts?.find((e) => e.id === C.form.sheet.id);
67
+ return e ? n(e) : void 0;
63
68
  }, [
64
- x.form.sheet.id,
65
- x.form.sheet.mode,
66
- _.bankAccounts
69
+ C.form.sheet.id,
70
+ C.form.sheet.mode,
71
+ y.bankAccounts
67
72
  ]);
68
- s({
69
- open: h === "edit",
70
- seed: w,
71
- setValues: b.setValues
72
- }), s({
73
- open: S.open,
74
- seed: T,
75
- setValues: S.setValues
76
- }), s({
77
- open: x.form.sheet.open,
73
+ c({
74
+ open: _ === "edit",
78
75
  seed: E,
79
- setValues: x.form.setValues
80
- }), x.form.sheet.open && x.form.sheet.mode === "edit" && _.bankAccounts !== void 0 && !_.isBankAccountsFetching && !E && x.form.close();
81
- let D = l(() => {
82
- if (!w) return !1;
83
- let e = b.values;
84
- return e.legalName !== w.legalName || e.firstName !== w.firstName || e.lastName !== w.lastName || e.email !== w.email || e.phone !== w.phone || e.taxId !== w.taxId || e.remindersEnabled !== w.remindersEnabled || !y && !d(e.address, w.address);
76
+ setValues: S.setValues
77
+ }), c({
78
+ open: w.open,
79
+ seed: D,
80
+ setValues: w.setValues
81
+ }), c({
82
+ open: C.form.sheet.open,
83
+ seed: O,
84
+ setValues: C.form.setValues
85
+ }), C.form.sheet.open && C.form.sheet.mode === "edit" && y.bankAccounts !== void 0 && !y.isBankAccountsFetching && !O && C.form.close();
86
+ let k = u(() => {
87
+ if (!E) return !1;
88
+ let e = S.values;
89
+ return e.legalName !== E.legalName || e.firstName !== E.firstName || e.lastName !== E.lastName || e.email !== E.email || e.phone !== E.phone || e.taxId !== E.taxId || e.remindersEnabled !== E.remindersEnabled || !x && !f(e.address, E.address);
90
+ }, [
91
+ E,
92
+ S.values,
93
+ x
94
+ ]), A = u(() => !f(w.values, D), [w.values, D]), { close: j } = w, { openEdit: M, setValues: N, submit: P, values: F } = S, I = l(async () => {
95
+ let t = _ === "edit" ? b.updateSucceeded : b.createSucceeded, n = p(F), r = await P();
96
+ return r.ok && e.success(t.replace("{name}", () => n)), r;
85
97
  }, [
86
- w,
87
- b.values,
88
- y
89
- ]), O = l(() => !d(S.values, T), [S.values, T]), { close: k } = S, { openEdit: A, setValues: j } = b;
98
+ _,
99
+ b,
100
+ F,
101
+ P
102
+ ]), L = l(() => {
103
+ if (!x) {
104
+ j(), M();
105
+ return;
106
+ }
107
+ M(), N((e) => ({
108
+ ...e,
109
+ address: d
110
+ }));
111
+ }, [
112
+ j,
113
+ M,
114
+ N,
115
+ x
116
+ ]);
90
117
  return {
91
- form: b,
92
- bank: x,
93
- address: S,
94
- del: C,
95
- isEditDirty: D,
96
- isAddressDirty: O,
97
- closeAddress: k,
98
- handleEditProfile: c(() => {
99
- if (!y) {
100
- k(), A();
101
- return;
102
- }
103
- A(), j((e) => ({
104
- ...e,
105
- address: u
106
- }));
107
- }, [
108
- k,
109
- A,
110
- j,
111
- y
112
- ])
118
+ form: {
119
+ ...S,
120
+ submit: I
121
+ },
122
+ bank: C,
123
+ address: w,
124
+ del: T,
125
+ isEditDirty: k,
126
+ isAddressDirty: A,
127
+ closeAddress: j,
128
+ handleEditProfile: L
113
129
  };
114
130
  }
115
131
  //#endregion
116
- export { f as useCounterpartDetailsActions };
132
+ export { m as useCounterpartDetailsActions };
@@ -0,0 +1,5 @@
1
+ import { OFFER_WIDGET_STATUS_LABELS_EN as e } from "./lib/OfferWidget/labels.js";
2
+ import { OFFER_WIDGET_LABELS_EN as t } from "../../ui/dist/index2.js";
3
+ import { OfferBenefitIcon as n } from "../../ui/dist/index3.js";
4
+ import { OfferWidget as r } from "./lib/OfferWidget/OfferWidget.js";
5
+ export { t as OFFER_WIDGET_LABELS_EN, e as OFFER_WIDGET_STATUS_LABELS_EN, n as OfferBenefitIcon, r as OfferWidget };
@@ -9,17 +9,17 @@ import { WidgetProvider as n } from "../../../../../shared/feature/dist/lib/Widg
9
9
  import { useWidgetConfig as r, useWidgetInitStaleForToken as i } from "../../../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
10
10
  import { deniedNoticeExpiresAt as a, selectBankAccountApplication as o } from "../../../../../shared/feature/dist/lib/application/bankAccountApplication.js";
11
11
  import "../../../../../shared/feature/dist/index.js";
12
- import { MARKETING_WIDGET_STATUS_LABELS_EN as s } from "./labels.js";
13
- import { MarketingWidgetAnalyticsEvent as c, WIDGET_NAME as l } from "../analytics/events.js";
14
- import { marketingWidgetTestIds as u } from "../testIds.js";
15
- import { MarketingApplicationView as d, marketingApplicationViewFor as f } from "./marketingApplicationView.js";
16
- import { MARKETING_WIDGET_LABELS_EN as p } from "../../../../ui/dist/index2.js";
17
- import { MarketingBenefitIcon as m, MarketingWidgetStatusTone as h } from "../../../../ui/dist/index3.js";
18
- import { MarketingWidget as g } from "../../../../ui/dist/index9.js";
12
+ import { OFFER_WIDGET_STATUS_LABELS_EN as s } from "./labels.js";
13
+ import { OfferWidgetAnalyticsEvent as c, WIDGET_NAME as l } from "../analytics/events.js";
14
+ import { offerWidgetTestIds as u } from "../testIds.js";
15
+ import { OfferApplicationView as d, offerApplicationViewFor as f } from "./offerApplicationView.js";
16
+ import { OFFER_WIDGET_LABELS_EN as p } from "../../../../ui/dist/index2.js";
17
+ import { OfferBenefitIcon as m, OfferWidgetStatusTone as h } from "../../../../ui/dist/index3.js";
18
+ import { OfferWidget as g } from "../../../../ui/dist/index9.js";
19
19
  import "../../../../ui/dist/index.js";
20
20
  import { useCallback as _, useEffect as v, useMemo as y, useReducer as b, useState as x } from "react";
21
21
  import { jsx as S } from "react/jsx-runtime";
22
- //#region ../../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/lib/MarketingWidget/MarketingWidget.js
22
+ //#region ../../libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/OfferWidget/OfferWidget.js
23
23
  var C = 2 ** 31 - 1, w = /* @__PURE__ */ new Set([
24
24
  "ACTIVE",
25
25
  "INACTIVE",
@@ -120,8 +120,8 @@ function A({ content: n, onPrimaryCtaClick: s, labels: l, statusLabels: p }) {
120
120
  howItWorksSteps: n.howItWorksSteps,
121
121
  fromDayOneHeader: n.fromDayOneHeader,
122
122
  benefits: n.benefits,
123
- onOpenMarketingModal: W,
124
- onCloseMarketingModal: G,
123
+ onOpenOfferModal: W,
124
+ onCloseOfferModal: G,
125
125
  onPrimaryCtaClick: K,
126
126
  statusMessage: V,
127
127
  labels: H,
@@ -157,4 +157,4 @@ function j({ baseUrl: e, widgetToken: t, organizationId: r, configClient: i, gat
157
157
  });
158
158
  }
159
159
  //#endregion
160
- export { p as MARKETING_WIDGET_LABELS_EN, s as MARKETING_WIDGET_STATUS_LABELS_EN, m as MarketingBenefitIcon, j as MarketingWidget };
160
+ export { p as OFFER_WIDGET_LABELS_EN, s as OFFER_WIDGET_STATUS_LABELS_EN, m as OfferBenefitIcon, j as OfferWidget };
@@ -1,4 +1,4 @@
1
- //#region ../../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/lib/MarketingWidget/labels.js
1
+ //#region ../../libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/OfferWidget/labels.js
2
2
  function e(e) {
3
3
  return e.charAt(0).toUpperCase() + e.slice(1);
4
4
  }
@@ -34,4 +34,4 @@ var n = {
34
34
  }
35
35
  };
36
36
  //#endregion
37
- export { r as MARKETING_WIDGET_STATUS_LABELS_EN };
37
+ export { r as OFFER_WIDGET_STATUS_LABELS_EN };
@@ -1,6 +1,6 @@
1
1
  import { deniedNoticeExpiresAt as e } from "../../../../../shared/feature/dist/lib/application/bankAccountApplication.js";
2
2
  import "../../../../../shared/feature/dist/index.js";
3
- //#region ../../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/lib/MarketingWidget/marketingApplicationView.js
3
+ //#region ../../libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/OfferWidget/offerApplicationView.js
4
4
  var t = {
5
5
  Offer: "offer",
6
6
  Resume: "resume",
@@ -28,4 +28,4 @@ function n(n, r = Date.now()) {
28
28
  }
29
29
  }
30
30
  //#endregion
31
- export { t as MarketingApplicationView, n as marketingApplicationViewFor };
31
+ export { t as OfferApplicationView, n as offerApplicationViewFor };
@@ -0,0 +1,8 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/analytics/events.js
2
+ var e = {
3
+ Mounted: "marketing.mounted",
4
+ OpenModal: "marketing.open_modal",
5
+ PrimaryCta: "marketing.primary_cta"
6
+ }, t = "marketing";
7
+ //#endregion
8
+ export { e as OfferWidgetAnalyticsEvent, t as WIDGET_NAME };
@@ -1,4 +1,4 @@
1
- //#region ../../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/lib/testIds.js
1
+ //#region ../../libs/tesouro-embedded-components-react/offer-widget/feature/dist/lib/testIds.js
2
2
  var e = {
3
3
  root: "marketing-widget",
4
4
  learnMoreButton: "marketing-widget-learn-more-button",
@@ -8,4 +8,4 @@ var e = {
8
8
  primaryCtaButton: "marketing-widget-primary-cta-button"
9
9
  };
10
10
  //#endregion
11
- export { e as marketingWidgetTestIds };
11
+ export { e as offerWidgetTestIds };
@@ -1,4 +1,4 @@
1
- //#region ../../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/mocks/labels.js
1
+ //#region ../../libs/tesouro-embedded-components-react/offer-widget/feature/dist/mocks/labels.js
2
2
  var e = { scenarios: {
3
3
  default: {
4
4
  label: "Available",
@@ -26,4 +26,4 @@ var e = { scenarios: {
26
26
  }
27
27
  } };
28
28
  //#endregion
29
- export { e as MARKETING_LABELS };
29
+ export { e as OFFER_LABELS };
@@ -1,7 +1,7 @@
1
1
  import { A_COMPLETE_BANK_ACCOUNT_APPLICATION as e } from "../../../../shared/data-access-mocks/dist/lib/fixtures.js";
2
2
  import { PROXY as t, initRoute as n, readRoute as r } from "../../../../shared/data-access-mocks/dist/mocks/scenarios/scenario.js";
3
- import { MARKETING_LABELS as i } from "./labels.js";
4
- //#region ../../libs/tesouro-embedded-components-react/marketing-widget/feature/dist/mocks/marketing.js
3
+ import { OFFER_LABELS as i } from "./labels.js";
4
+ //#region ../../libs/tesouro-embedded-components-react/offer-widget/feature/dist/mocks/offer.js
5
5
  var a = {
6
6
  status: "NOT_FOUND",
7
7
  organizationId: null,
@@ -31,4 +31,4 @@ var a = {
31
31
  u("existing-customer", {})
32
32
  ];
33
33
  //#endregion
34
- export { d as marketingScenarios };
34
+ export { d as offerScenarios };
@@ -0,0 +1,2 @@
1
+ import { offerScenarios as e } from "./mocks/offer.js";
2
+ export { e as offerScenarios };
@@ -0,0 +1,5 @@
1
+ import { OFFER_WIDGET_LABELS_EN as e } from "./index2.js";
2
+ import { OfferBenefitIcon as t, OfferWidgetStatusTone as n } from "./index3.js";
3
+ import "./index7.js";
4
+ import { OfferWidget as r } from "./index9.js";
5
+ export { e as OFFER_WIDGET_LABELS_EN, t as OfferBenefitIcon, r as OfferWidget, n as OfferWidgetStatusTone };
@@ -0,0 +1,10 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/offer-widget/ui/dist/index2.js
2
+ var e = {
3
+ applyNow: "Apply now",
4
+ learnMore: "Learn more",
5
+ primaryCta: "Start application",
6
+ primaryCtaSubtext: "takes about 5 minutes",
7
+ dismissModalAriaLabel: "Close offer modal"
8
+ };
9
+ //#endregion
10
+ export { e as OFFER_WIDGET_LABELS_EN };
@@ -1,4 +1,4 @@
1
- //#region ../../libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index3.js
1
+ //#region ../../libs/tesouro-embedded-components-react/offer-widget/ui/dist/index3.js
2
2
  var e = {
3
3
  Sync: "sync",
4
4
  Users: "users",
@@ -11,4 +11,4 @@ var e = {
11
11
  Danger: "danger"
12
12
  };
13
13
  //#endregion
14
- export { e as MarketingBenefitIcon, t as MarketingWidgetStatusTone };
14
+ export { e as OfferBenefitIcon, t as OfferWidgetStatusTone };
@@ -1,6 +1,6 @@
1
- import { MarketingBenefitIcon as e } from "./index3.js";
1
+ import { OfferBenefitIcon as e } from "./index3.js";
2
2
  import { CreditCard as t, DollarSign as n, FileText as r, RefreshCw as i, Users as a } from "lucide-react";
3
- //#region ../../libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index4.js
3
+ //#region ../../libs/tesouro-embedded-components-react/offer-widget/ui/dist/index4.js
4
4
  var o = {
5
5
  [e.Sync]: i,
6
6
  [e.Users]: a,
@@ -1,6 +1,6 @@
1
1
  import { BENEFIT_ICON_COMPONENTS as e } from "./index4.js";
2
2
  import { jsx as t, jsxs as n } from "react/jsx-runtime";
3
- //#region ../../libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index5.js
3
+ //#region ../../libs/tesouro-embedded-components-react/offer-widget/ui/dist/index5.js
4
4
  function r({ text: r, icon: i }) {
5
5
  let a = e[i];
6
6
  return /* @__PURE__ */ n("div", {
@@ -15,4 +15,4 @@ function r({ text: r, icon: i }) {
15
15
  });
16
16
  }
17
17
  //#endregion
18
- export { r as MarketingBenefitItem };
18
+ export { r as OfferBenefitItem };
@@ -1,5 +1,5 @@
1
1
  import { jsx as e, jsxs as t } from "react/jsx-runtime";
2
- //#region ../../libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index6.js
2
+ //#region ../../libs/tesouro-embedded-components-react/offer-widget/ui/dist/index6.js
3
3
  function n({ header: n, steps: r }) {
4
4
  return r.length === 0 ? null : /* @__PURE__ */ t("div", {
5
5
  className: "ttw:mb-6",
@@ -37,4 +37,4 @@ function n({ header: n, steps: r }) {
37
37
  });
38
38
  }
39
39
  //#endregion
40
- export { n as MarketingWidgetHowItWorks };
40
+ export { n as OfferWidgetHowItWorks };
@@ -1,10 +1,10 @@
1
1
  import { Button as e, Dialog as t, DialogClose as n, DialogContent as r, DialogTitle as i } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { MARKETING_WIDGET_LABELS_EN as a } from "./index2.js";
3
- import { MarketingBenefitItem as o } from "./index5.js";
4
- import { MarketingWidgetHowItWorks as s } from "./index6.js";
2
+ import { OFFER_WIDGET_LABELS_EN as a } from "./index2.js";
3
+ import { OfferBenefitItem as o } from "./index5.js";
4
+ import { OfferWidgetHowItWorks as s } from "./index6.js";
5
5
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
6
6
  import { ArrowRight as u, X as d } from "lucide-react";
7
- //#region ../../libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index7.js
7
+ //#region ../../libs/tesouro-embedded-components-react/offer-widget/ui/dist/index7.js
8
8
  function f({ open: f, vspLogo: p, providedByCaption: m, primaryModalHeader: h, howItWorksHeader: g, howItWorksSteps: _, fromDayOneHeader: v, benefits: y, onClose: b, onPrimaryCtaClick: x, labels: S, testIds: C }) {
9
9
  let w = {
10
10
  ...a,
@@ -95,4 +95,4 @@ function f({ open: f, vspLogo: p, providedByCaption: m, primaryModalHeader: h, h
95
95
  });
96
96
  }
97
97
  //#endregion
98
- export { f as MarketingWidgetModal };
98
+ export { f as OfferWidgetModal };
@@ -1,7 +1,7 @@
1
1
  import { Badge as e, cn as t } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { MarketingWidgetStatusTone as n } from "./index3.js";
2
+ import { OfferWidgetStatusTone as n } from "./index3.js";
3
3
  import { jsx as r, jsxs as i } from "react/jsx-runtime";
4
- //#region ../../libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index8.js
4
+ //#region ../../libs/tesouro-embedded-components-react/offer-widget/ui/dist/index8.js
5
5
  var a = {
6
6
  [n.Brand]: "ttw:border-transparent ttw:bg-primary/10 ttw:text-primary",
7
7
  [n.Warning]: "ttw:border-amber-100 ttw:bg-amber-100 ttw:text-amber-700",
@@ -33,4 +33,4 @@ function o({ statusMessage: n, testId: o }) {
33
33
  });
34
34
  }
35
35
  //#endregion
36
- export { o as MarketingWidgetStatus };
36
+ export { o as OfferWidgetStatus };
@@ -1,10 +1,10 @@
1
1
  import { Button as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
2
- import { MARKETING_WIDGET_LABELS_EN as t } from "./index2.js";
3
- import { MarketingWidgetModal as n } from "./index7.js";
4
- import { MarketingWidgetStatus as r } from "./index8.js";
2
+ import { OFFER_WIDGET_LABELS_EN as t } from "./index2.js";
3
+ import { OfferWidgetModal as n } from "./index7.js";
4
+ import { OfferWidgetStatus as r } from "./index8.js";
5
5
  import { Fragment as i, jsx as a, jsxs as o } from "react/jsx-runtime";
6
- //#region ../../libs/tesouro-embedded-components-react/marketing-widget/ui/dist/index9.js
7
- function s({ open: s, vspLogo: c, bankingText: l, primaryCaption: u, secondaryCaption: d, providedByCaption: f, primaryModalHeader: p, howItWorksHeader: m, howItWorksSteps: h, fromDayOneHeader: g, benefits: _, onOpenMarketingModal: v, onCloseMarketingModal: y, onPrimaryCtaClick: b, statusMessage: x, labels: S, testIds: C }) {
6
+ //#region ../../libs/tesouro-embedded-components-react/offer-widget/ui/dist/index9.js
7
+ function s({ open: s, vspLogo: c, bankingText: l, primaryCaption: u, secondaryCaption: d, providedByCaption: f, primaryModalHeader: p, howItWorksHeader: m, howItWorksSteps: h, fromDayOneHeader: g, benefits: _, onOpenOfferModal: v, onCloseOfferModal: y, onPrimaryCtaClick: b, statusMessage: x, labels: S, testIds: C }) {
8
8
  let w = {
9
9
  ...t,
10
10
  ...S
@@ -74,4 +74,4 @@ function s({ open: s, vspLogo: c, bankingText: l, primaryCaption: u, secondaryCa
74
74
  })] });
75
75
  }
76
76
  //#endregion
77
- export { s as MarketingWidget };
77
+ export { s as OfferWidget };
@@ -20,7 +20,17 @@ var e = {
20
20
  deleteTitle: "Delete {name}?",
21
21
  deleteBankAccountTitle: "Delete bank account “{account}”?",
22
22
  deleteCounterpartMessage: "This record and its contacts, bank accounts, and tax ID will be permanently removed. You can't undo this action.",
23
- deleteBankAccountMessage: "This removes these payment instructions from the vendor. The vendor will not be deleted. You can't undo this action."
23
+ deleteBankAccountMessage: "This removes these payment instructions from the vendor. The vendor will not be deleted. You can't undo this action.",
24
+ createSucceeded: "{name} has been added to the list.",
25
+ updateSucceeded: "{name} has been updated.",
26
+ addressAdded: "Address has been added.",
27
+ addressUpdated: "Address has been updated.",
28
+ bankAccountAdded: "Bank Account has been added.",
29
+ bankAccountUpdated: "Bank account information has been updated.",
30
+ counterpartDeleted: "Counterpart has been deleted.",
31
+ bankAccountDeleted: "Bank Account has been deleted.",
32
+ deleteCounterpartFailed: "Failed to delete Counterpart.",
33
+ deleteBankAccountFailed: "Failed to delete Bank Account."
24
34
  };
25
35
  //#endregion
26
36
  export { e as COUNTERPART_MESSAGE_LABELS_EN };
@@ -2,48 +2,46 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { bankAccountToAchFormValues as e, counterpartFormBankAccountToCreatePayload as t, counterpartFormBankAccountToUpdatePayload as n, emptyAchFormValues as r, hasAchFormErrors as i, resolveCounterpartBankAccountWrite as a, validateAchFormValues as o } from "./helpers.js";
6
- import { useCreateCounterpartBankAccountMutation as s, useUpdateCounterpartBankAccountMutation as c } from "../../../data-access/dist/index5.js";
5
+ import { toast as e } from "../../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import "../../../../ui/dist/index.js";
7
+ import { bankAccountToAchFormValues as t, counterpartFormBankAccountToCreatePayload as n, counterpartFormBankAccountToUpdatePayload as r, emptyAchFormValues as i, hasAchFormErrors as a, resolveCounterpartBankAccountWrite as o, validateAchFormValues as s } from "./helpers.js";
8
+ import { useCreateCounterpartBankAccountMutation as c, useUpdateCounterpartBankAccountMutation as l } from "../../../data-access/dist/index5.js";
7
9
  import "../../../data-access/dist/index.js";
8
- import { useSubEntityForm as l } from "./useSubEntityForm.js";
10
+ import { useSubEntityForm as u } from "./useSubEntityForm.js";
9
11
  //#region ../../libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/subEntityForms.js
10
- function u({ items: u, selectedId: d, messages: f }) {
11
- let p = s(), m = c(), h = l({
12
- items: u,
13
- empty: r,
14
- toFormValues: e,
15
- validate: (e) => o(e, f),
16
- hasErrors: (e) => i(e),
17
- genericError: f.genericError,
18
- onSubmit: async ({ mode: e, id: r, values: i }) => {
19
- if (!d) return;
20
- let o = a(u, e === "edit" ? r : void 0);
21
- if (o.kind === "update") {
22
- await m.mutateAsync({
23
- path: {
24
- counterpart_id: d,
25
- bank_account_id: o.bankAccountId
26
- },
27
- body: n(i, { includeAchDefaults: o.includeAchDefaults })
28
- });
29
- return;
30
- }
31
- await p.mutateAsync({
32
- path: { counterpart_id: d },
33
- body: t(i, { isDefaultForCurrency: o.isDefaultForCurrency })
34
- });
12
+ function d({ items: d, selectedId: f, messages: p }) {
13
+ let m = c(), h = l(), g = u({
14
+ items: d,
15
+ empty: i,
16
+ toFormValues: t,
17
+ validate: (e) => s(e, p),
18
+ hasErrors: (e) => a(e),
19
+ genericError: p.genericError,
20
+ onSubmit: async ({ mode: t, id: i, values: a }) => {
21
+ if (!f) return;
22
+ let s = o(d, t === "edit" ? i : void 0);
23
+ s.kind === "update" ? await h.mutateAsync({
24
+ path: {
25
+ counterpart_id: f,
26
+ bank_account_id: s.bankAccountId
27
+ },
28
+ body: r(a, { includeAchDefaults: s.includeAchDefaults })
29
+ }) : await m.mutateAsync({
30
+ path: { counterpart_id: f },
31
+ body: n(a, { isDefaultForCurrency: s.isDefaultForCurrency })
32
+ }), e.success(t === "edit" && i ? p.bankAccountUpdated : p.bankAccountAdded);
35
33
  }
36
- }), g = h.sheet.mode === "edit" ? u?.find((e) => e.id === h.sheet.id) : void 0, _ = g ? {
37
- accountHolderName: !h.values.accountHolderName.trim(),
38
- routingNumber: !h.values.routingNumber.trim(),
39
- accountNumber: !h.values.accountNumber.trim()
40
- } : void 0, v = g ? e(g) : r(), y = Object.keys(v).some((e) => h.values[e] !== v[e]);
34
+ }), _ = g.sheet.mode === "edit" ? d?.find((e) => e.id === g.sheet.id) : void 0, v = _ ? {
35
+ accountHolderName: !g.values.accountHolderName.trim(),
36
+ routingNumber: !g.values.routingNumber.trim(),
37
+ accountNumber: !g.values.accountNumber.trim()
38
+ } : void 0, y = _ ? t(_) : i(), b = Object.keys(y).some((e) => g.values[e] !== y[e]);
41
39
  return {
42
- form: h,
43
- inProgress: p.isPending || m.isPending,
44
- highlightedFields: _,
45
- isDirty: y
40
+ form: g,
41
+ inProgress: m.isPending || h.isPending,
42
+ highlightedFields: v,
43
+ isDirty: b
46
44
  };
47
45
  }
48
46
  //#endregion
49
- export { u as useBankAccountForm };
47
+ export { d as useBankAccountForm };