@tesouro/embedded-components-react 0.4.15 → 0.4.16

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 (120) hide show
  1. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +5 -4
  2. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index14.js +47 -21
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index15.js +20 -77
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index16.js +75 -24
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index17.js +36 -0
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +1 -1
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +2 -2
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +2 -2
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +64 -48
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +10 -2
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +1 -1
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +141 -118
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +93 -93
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +83 -67
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +235 -218
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +1 -1
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +5 -5
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +9 -6
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +1 -1
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +1 -1
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +17 -17
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +1 -1
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +1 -1
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +2 -2
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +1 -1
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +39 -39
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index100.js +2 -10
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index101.js +8 -50
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index102.js +52 -2
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index103.js +2 -0
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +26 -49
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +19 -306
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +154 -2
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +2 -9
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index29.js +60 -45
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +251 -1
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +2 -18
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index32.js +7 -48
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index33.js +49 -2
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +2 -23
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index35.js +15 -337
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +50 -2
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +2 -16
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +21 -118
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +340 -2
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +2 -12
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +10 -97
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index42.js +99 -2
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +1 -12
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +11 -57
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +58 -1
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +1 -54
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +52 -10
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +10 -179
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +181 -1
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +2 -4
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +2 -39
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +41 -2
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +2 -7
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index54.js +5 -90
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +92 -2
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +2 -4
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +2 -14
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +16 -2
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +1 -87
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +83 -291
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +292 -9
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +13 -1
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +1 -8
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +6 -37
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +39 -2
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +2 -39
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +36 -9
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index68.js +10 -199
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index69.js +201 -3
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index70.js +3 -17
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +15 -345
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index72.js +345 -8
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +6 -4
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +6 -91
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +93 -0
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +2 -127
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +124 -25
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +26 -87
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index80.js +89 -2
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +2 -7
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +5 -28
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +30 -2
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +2 -7
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +5 -32
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +34 -2
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +2 -12
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +10 -104
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index89.js +105 -1
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +2 -17
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +15 -123
  99. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index92.js +125 -2
  100. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index93.js +2 -18
  101. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index94.js +14 -6
  102. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index95.js +7 -167
  103. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index96.js +170 -2
  104. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index97.js +2 -14
  105. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index98.js +11 -105
  106. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index99.js +108 -2
  107. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index4.js +8 -8
  108. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +4 -4
  109. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index.js +5 -5
  110. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +19 -19
  111. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +39 -33
  112. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/subEntityForms.js +15 -15
  113. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useAddressForm.js +9 -9
  114. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js +7 -7
  115. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +37 -37
  116. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartSelector.js +15 -15
  117. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js +7 -7
  118. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  119. package/package.json +1 -1
  120. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +0 -2
@@ -2,77 +2,83 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { Button as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { getStateOptions as t } from "../../../shared/util/dist/lib/usStates.js";
7
- import { AchFieldGroup as n } from "../../../shared/counterpart-management/ui/dist/index5.js";
8
- import { CounterpartFormFields as r, useFocusFirstInvalidField as i } from "../../../shared/counterpart-management/ui/dist/index9.js";
9
- import { COUNTERPART_MESSAGE_LABELS_EN as a } from "../../../shared/counterpart-management/feature/dist/lib/labels.js";
10
- import { useCounterpartForm as o } from "../../../shared/counterpart-management/feature/dist/lib/useCounterpartForm.js";
5
+ import { AlertDialog as e, AlertDialogContent as t, AlertDialogDescription as n, AlertDialogFooter as r, AlertDialogHeader as i, AlertDialogTitle as a, Button as o } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { getStateOptions as s } from "../../../shared/util/dist/lib/usStates.js";
7
+ import { AchFieldGroup as ee } from "../../../shared/counterpart-management/ui/dist/index5.js";
8
+ import { CounterpartFormFields as c, useFocusFirstInvalidField as l } from "../../../shared/counterpart-management/ui/dist/index9.js";
9
+ import { COUNTERPART_MESSAGE_LABELS_EN as u } from "../../../shared/counterpart-management/feature/dist/lib/labels.js";
10
+ import { useCounterpartForm as d } from "../../../shared/counterpart-management/feature/dist/lib/useCounterpartForm.js";
11
11
  import "../../../shared/counterpart-management/feature/dist/index.js";
12
- import { VENDOR_INLINE_FORM_LABELS_EN as s } from "./index43.js";
13
- import { useCallback as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
14
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
15
- import { Landmark as g, Plus as _, X as v } from "lucide-react";
12
+ import { VENDOR_INLINE_FORM_LABELS_EN as f } from "./index43.js";
13
+ import { useCallback as p, useEffect as m, useMemo as h, useRef as g, useState as _ } from "react";
14
+ import { Fragment as te, jsx as v, jsxs as y } from "react/jsx-runtime";
15
+ import { Landmark as b, Plus as ne, X as x } from "lucide-react";
16
16
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js
17
- function y({ mode: y, counterpart: b, primaryAddress: x, bankAccounts: S, isBankAccountsLoading: C, isBankAccountsError: w, initialName: T, initialValues: E, onSaved: D, onCancel: O, onDirtyChange: k, labels: A }) {
18
- let j = {
19
- ...s,
20
- ...A
21
- }, [M, N] = f("none"), [P, F] = f(b?.id), [I, L] = f(!1), [R, z] = f(!1);
22
- l(() => {
23
- k?.(R);
24
- }, [R, k]);
25
- let B = u(() => t(), []), V = d(M), H = d(!1), U = o({
26
- view: M,
27
- setView: N,
28
- selectedId: P,
29
- setSelectedId: F,
30
- messages: a,
17
+ function S({ mode: S, counterpart: C, primaryAddress: w, bankAccounts: T, isBankAccountsLoading: E, isBankAccountsError: D, initialName: O, initialValues: k, onSaved: A, onCancel: j, onDirtyChange: M, labels: N }) {
18
+ let P = {
19
+ ...f,
20
+ ...N
21
+ }, [F, I] = _("none"), [L, R] = _(C?.id), [z, B] = _(!1), [V, H] = _(!1), [U, W] = _(!1);
22
+ m(() => {
23
+ M?.(V);
24
+ }, [V, M]);
25
+ let G = h(() => s(), []), K = g(F), q = g(!1), J = d({
26
+ view: F,
27
+ setView: I,
28
+ selectedId: L,
29
+ setSelectedId: R,
30
+ messages: u,
31
31
  counterpartType: "vendor",
32
- counterpart: b,
33
- primaryAddress: x,
34
- bankAccounts: S,
35
- isBankAccountsLoading: C,
36
- isBankAccountsError: w
37
- }), { openCreate: W, openEdit: G, setValues: K, expandAddress: q } = U, J = i(U.errors);
38
- l(() => {
39
- y === "edit" ? G() : W();
32
+ counterpart: C,
33
+ primaryAddress: w,
34
+ bankAccounts: T,
35
+ isBankAccountsLoading: E,
36
+ isBankAccountsError: D
37
+ }), { openCreate: Y, openEdit: X, setValues: Z, expandAddress: Q } = J, re = l(J.errors);
38
+ m(() => {
39
+ S === "edit" ? X() : Y();
40
40
  }, [
41
- y,
42
- W,
43
- G
44
- ]), l(() => {
45
- V.current !== "none" && M === "none" && P && D(P), V.current = M;
41
+ S,
42
+ Y,
43
+ X
44
+ ]), m(() => {
45
+ K.current !== "none" && F === "none" && L && A(L), K.current = F;
46
46
  }, [
47
- M,
48
- P,
49
- D
50
- ]), l(() => {
51
- y !== "create" || H.current || (H.current = !0, K((e) => ({
47
+ F,
48
+ L,
49
+ A
50
+ ]), m(() => {
51
+ S !== "create" || q.current || (q.current = !0, Z((e) => ({
52
52
  ...e,
53
53
  entityType: "organization",
54
- legalName: T?.trim() || E?.legalName || e.legalName,
55
- email: E?.email || e.email,
56
- phone: E?.phone || e.phone,
57
- address: E?.address ?? e.address
58
- })), E?.address && Object.values(E.address).some(Boolean) && q());
54
+ legalName: O?.trim() || k?.legalName || e.legalName,
55
+ email: k?.email || e.email,
56
+ phone: k?.phone || e.phone,
57
+ address: k?.address ?? e.address
58
+ })), k?.address && Object.values(k.address).some(Boolean) && Q());
59
59
  }, [
60
- y,
61
- T,
62
- E,
63
- K,
64
- q
65
- ]), l(() => {
66
- y === "edit" && (U.values.bankAccount.routingNumber || U.values.bankAccount.accountNumber) && L(!0);
60
+ S,
61
+ O,
62
+ k,
63
+ Z,
64
+ Q
65
+ ]), m(() => {
66
+ S === "edit" && (J.values.bankAccount.routingNumber || J.values.bankAccount.accountNumber) && B(!0);
67
67
  }, [
68
- y,
69
- U.values.bankAccount.accountNumber,
70
- U.values.bankAccount.routingNumber
71
- ]), l(() => {
72
- U.sectionsToExpand.bankAccount && L(!0);
73
- }, [U.sectionsToExpand.bankAccount]);
74
- let Y = c((e) => {
75
- z(!0), K((t) => e.entityType === "individual" && t.entityType !== "individual" ? {
68
+ S,
69
+ J.values.bankAccount.accountNumber,
70
+ J.values.bankAccount.routingNumber
71
+ ]), m(() => {
72
+ J.sectionsToExpand.bankAccount && B(!0);
73
+ }, [J.sectionsToExpand.bankAccount]);
74
+ let $ = p(() => {
75
+ if (V) {
76
+ W(!0);
77
+ return;
78
+ }
79
+ j();
80
+ }, [V, j]), ie = p((e) => {
81
+ H(!0), Z((t) => e.entityType === "individual" && t.entityType !== "individual" ? {
76
82
  ...t,
77
83
  ...e,
78
84
  firstName: t.firstName || t.legalName,
@@ -85,34 +91,34 @@ function y({ mode: y, counterpart: b, primaryAddress: x, bankAccounts: S, isBank
85
91
  ...t,
86
92
  ...e
87
93
  });
88
- }, [K]);
89
- return /* @__PURE__ */ h("div", {
90
- ref: J,
94
+ }, [Z]);
95
+ return /* @__PURE__ */ y("div", {
96
+ ref: re,
91
97
  className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4",
92
98
  children: [
93
- /* @__PURE__ */ h("div", {
99
+ /* @__PURE__ */ y("div", {
94
100
  className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-2",
95
- children: [/* @__PURE__ */ m("p", {
101
+ children: [/* @__PURE__ */ v("p", {
96
102
  className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
97
- children: y === "edit" ? j.editTitle : j.createTitle
98
- }), /* @__PURE__ */ m(e, {
103
+ children: S === "edit" ? P.editTitle : P.createTitle
104
+ }), /* @__PURE__ */ v(o, {
99
105
  type: "button",
100
106
  variant: "ghost",
101
107
  size: "icon",
102
- "aria-label": j.close,
103
- onClick: O,
104
- children: /* @__PURE__ */ m(v, { className: "ttw:size-4" })
108
+ "aria-label": P.close,
109
+ onClick: $,
110
+ children: /* @__PURE__ */ v(x, { className: "ttw:size-4" })
105
111
  })]
106
112
  }),
107
- /* @__PURE__ */ m(r, {
108
- mode: y,
113
+ /* @__PURE__ */ v(c, {
114
+ mode: S,
109
115
  counterpartMode: "vendor",
110
- values: U.values,
111
- errors: U.errors,
112
- stateOptions: B,
113
- onChange: Y,
116
+ values: J.values,
117
+ errors: J.errors,
118
+ stateOptions: G,
119
+ onChange: ie,
114
120
  onAddressChange: (e) => {
115
- z(!0), K((t) => ({
121
+ H(!0), Z((t) => ({
116
122
  ...t,
117
123
  address: {
118
124
  ...t.address,
@@ -128,45 +134,45 @@ function y({ mode: y, counterpart: b, primaryAddress: x, bankAccounts: S, isBank
128
134
  address: "collapsible",
129
135
  bankAccount: !1
130
136
  },
131
- sectionsToExpand: U.sectionsToExpand,
132
- onAddressExpand: U.expandAddress,
133
- labels: { businessNameLabel: j.nameLabel }
137
+ sectionsToExpand: J.sectionsToExpand,
138
+ onAddressExpand: J.expandAddress,
139
+ labels: { businessNameLabel: P.nameLabel }
134
140
  }),
135
- /* @__PURE__ */ h("div", {
141
+ /* @__PURE__ */ y("div", {
136
142
  className: "ttw:flex ttw:flex-col ttw:gap-1",
137
- children: [/* @__PURE__ */ m("p", {
143
+ children: [/* @__PURE__ */ v("p", {
138
144
  className: "ttw:text-sm ttw:font-semibold ttw:text-foreground",
139
- children: j.paymentMethodsHeading
140
- }), /* @__PURE__ */ m("p", {
145
+ children: P.paymentMethodsHeading
146
+ }), /* @__PURE__ */ v("p", {
141
147
  className: "ttw:text-sm ttw:text-muted-foreground",
142
- children: j.paymentMethodsDescription
148
+ children: P.paymentMethodsDescription
143
149
  })]
144
150
  }),
145
- /* @__PURE__ */ h("div", {
151
+ /* @__PURE__ */ y("div", {
146
152
  className: "ttw:flex ttw:gap-3 ttw:rounded-lg ttw:border ttw:border-border ttw:p-3",
147
- children: [/* @__PURE__ */ m("span", {
153
+ children: [/* @__PURE__ */ v("span", {
148
154
  className: "ttw:flex ttw:size-8 ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-md ttw:bg-primary",
149
- children: /* @__PURE__ */ m(g, {
155
+ children: /* @__PURE__ */ v(b, {
150
156
  "aria-hidden": !0,
151
157
  className: "ttw:size-4 ttw:text-white"
152
158
  })
153
- }), /* @__PURE__ */ h("div", {
159
+ }), /* @__PURE__ */ y("div", {
154
160
  className: "ttw:flex ttw:flex-1 ttw:flex-col ttw:gap-3",
155
- children: [/* @__PURE__ */ h("div", {
161
+ children: [/* @__PURE__ */ y("div", {
156
162
  className: "ttw:flex ttw:flex-col ttw:gap-0.5",
157
- children: [/* @__PURE__ */ m("p", {
163
+ children: [/* @__PURE__ */ v("p", {
158
164
  className: "ttw:text-sm ttw:font-medium ttw:text-foreground",
159
- children: j.achTitle
160
- }), /* @__PURE__ */ m("p", {
165
+ children: P.achTitle
166
+ }), /* @__PURE__ */ v("p", {
161
167
  className: "ttw:text-sm ttw:text-muted-foreground",
162
- children: j.achDescription
168
+ children: P.achDescription
163
169
  })]
164
- }), I ? /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(n, {
170
+ }), z ? /* @__PURE__ */ y(te, { children: [/* @__PURE__ */ v(ee, {
165
171
  idPrefix: "vendor-inline-ach",
166
- values: U.values.bankAccount,
167
- errors: U.errors?.bankAccount,
172
+ values: J.values.bankAccount,
173
+ errors: J.errors?.bankAccount,
168
174
  onChange: (e) => {
169
- z(!0), K((t) => ({
175
+ H(!0), Z((t) => ({
170
176
  ...t,
171
177
  bankAccount: {
172
178
  ...t.bankAccount,
@@ -175,39 +181,56 @@ function y({ mode: y, counterpart: b, primaryAddress: x, bankAccounts: S, isBank
175
181
  }));
176
182
  },
177
183
  labels: {
178
- accountHolderName: j.accountHolderNameLabel,
179
- routingNumber: j.routingNumberLabel,
180
- accountNumber: j.accountNumberLabel
184
+ accountHolderName: P.accountHolderNameLabel,
185
+ routingNumber: P.routingNumberLabel,
186
+ accountNumber: P.accountNumberLabel
181
187
  }
182
- }), /* @__PURE__ */ m("p", {
188
+ }), /* @__PURE__ */ v("p", {
183
189
  className: "ttw:text-sm ttw:text-muted-foreground",
184
- children: j.achHelp
185
- })] }) : /* @__PURE__ */ h(e, {
190
+ children: P.achHelp
191
+ })] }) : /* @__PURE__ */ y(o, {
186
192
  type: "button",
187
193
  variant: "link",
188
194
  className: "ttw:w-fit ttw:px-0",
189
- onClick: () => L(!0),
190
- children: [/* @__PURE__ */ m(_, { className: "ttw:size-4" }), j.addBankAccount]
195
+ onClick: () => B(!0),
196
+ children: [/* @__PURE__ */ v(ne, { className: "ttw:size-4" }), P.addBankAccount]
191
197
  })]
192
198
  })]
193
199
  }),
194
- /* @__PURE__ */ h("div", {
200
+ /* @__PURE__ */ y("div", {
195
201
  className: "ttw:flex ttw:justify-end ttw:gap-2",
196
- children: [/* @__PURE__ */ m(e, {
202
+ children: [/* @__PURE__ */ v(o, {
197
203
  type: "button",
198
204
  variant: "outline",
199
- onClick: O,
200
- children: j.cancel
201
- }), /* @__PURE__ */ m(e, {
205
+ onClick: $,
206
+ children: P.cancel
207
+ }), /* @__PURE__ */ v(o, {
202
208
  type: "button",
203
- onClick: U.submit,
204
- loading: U.isSubmitting,
205
- disabled: U.isSubmitting,
206
- children: j.save
209
+ onClick: J.submit,
210
+ loading: J.isSubmitting,
211
+ disabled: J.isSubmitting,
212
+ children: P.save
207
213
  })]
214
+ }),
215
+ /* @__PURE__ */ v(e, {
216
+ open: U,
217
+ onOpenChange: W,
218
+ children: /* @__PURE__ */ y(t, { children: [/* @__PURE__ */ y(i, { children: [/* @__PURE__ */ v(a, { children: P.discardConfirmTitle }), /* @__PURE__ */ v(n, { children: P.discardConfirmDescription })] }), /* @__PURE__ */ y(r, { children: [/* @__PURE__ */ v(o, {
219
+ type: "button",
220
+ variant: "outline",
221
+ onClick: () => W(!1),
222
+ children: P.keepEditingAction
223
+ }), /* @__PURE__ */ v(o, {
224
+ type: "button",
225
+ variant: "destructive",
226
+ onClick: () => {
227
+ W(!1), j();
228
+ },
229
+ children: P.discardChangesAction
230
+ })] })] })
208
231
  })
209
232
  ]
210
233
  });
211
234
  }
212
235
  //#endregion
213
- export { y as VendorInlineForm, y as default };
236
+ export { S as VendorInlineForm, S as default };
@@ -2,92 +2,92 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { usePayableSuggestionsQuery as e } from "../../data-access/dist/index16.js";
5
+ import { useCounterpartsQuery as e } from "../../../shared/counterpart-management/data-access/dist/index3.js";
6
+ import { useCreateCounterpartBankAccountMutation as t, useUpdateCounterpartBankAccountMutation as n } from "../../../shared/counterpart-management/data-access/dist/index5.js";
7
+ import { usePayableSuggestionsQuery as r } from "../../data-access/dist/index17.js";
6
8
  import "../../data-access/dist/index.js";
7
- import { maskAccountNumber as t } from "./index21.js";
8
- import { counterpartFormBankAccountToCreatePayload as n, counterpartFormBankAccountToUpdatePayload as ee, getAchInstructions as r, getCounterpartEmail as i, getCounterpartName as a, getPayableAchInstructions as o, hasAchFormValues as s, resolveCounterpartBankAccountWrite as c, validateAchFormValues as te } from "../../../shared/counterpart-management/feature/dist/lib/helpers.js";
9
- import { useCounterpartsQuery as ne } from "../../../shared/counterpart-management/data-access/dist/index3.js";
10
- import { useCreateCounterpartBankAccountMutation as re, useUpdateCounterpartBankAccountMutation as ie } from "../../../shared/counterpart-management/data-access/dist/index5.js";
9
+ import { maskAccountNumber as ee } from "./index21.js";
10
+ import { counterpartFormBankAccountToCreatePayload as i, counterpartFormBankAccountToUpdatePayload as te, getAchInstructions as ne, getCounterpartEmail as a, getCounterpartName as o, getPayableAchInstructions as s, hasAchFormValues as c, resolveCounterpartBankAccountWrite as re, validateAchFormValues as ie } from "../../../shared/counterpart-management/feature/dist/lib/helpers.js";
11
11
  import { useCounterpartDetails as ae } from "../../../shared/counterpart-management/feature/dist/lib/useCounterpartDetails.js";
12
12
  import "../../../shared/counterpart-management/feature/dist/index.js";
13
13
  import { VENDOR_SECTION_PROPS_LABELS_EN as oe } from "./index43.js";
14
14
  import { buildVendorPrefill as se } from "./index45.js";
15
15
  import { VendorInlineForm as ce } from "./index46.js";
16
16
  import { useCallback as l, useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
17
- import { jsx as le } from "react/jsx-runtime";
17
+ import { jsx as m } from "react/jsx-runtime";
18
18
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js
19
- var m = 10, ue = 300, h = {
19
+ var h = 10, le = 300, g = {
20
20
  accountHolderName: "",
21
21
  routingNumber: "",
22
22
  accountNumber: ""
23
23
  };
24
- function g({ payableId: g, counterpartId: _, payableCounterpartId: v, payableCounterpartBankAccountId: y, onCounterpartChange: b, requiredError: de, extractedVendor: x, labels: fe }) {
25
- let S = {
24
+ function _({ payableId: _, counterpartId: v, payableCounterpartId: y, payableCounterpartBankAccountId: b, onCounterpartChange: x, requiredError: S, extractedVendor: C, labels: ue }) {
25
+ let w = {
26
26
  ...oe,
27
- ...fe
28
- }, [C, w] = p(""), [T, E] = p(""), [D, O] = p(), [pe, k] = p(!1), [A, j] = p(h), M = f(A);
29
- M.current = A;
30
- let [N, P] = p(!1), F = s(A) || N, [I, L] = p(), [R, z] = p(), B = f(_), [V, me] = p(!1), H = l(() => {
31
- k(!1), j(h), L(void 0), z(void 0);
27
+ ...ue
28
+ }, [T, E] = p(""), [D, de] = p(""), [O, k] = p(), [fe, A] = p(!1), [j, M] = p(g), N = f(j);
29
+ N.current = j;
30
+ let [pe, P] = p(!1), F = c(j) || pe, [I, L] = p(), [R, z] = p(), B = f(v), [V, me] = p(!1), H = l(() => {
31
+ A(!1), M(g), L(void 0), z(void 0);
32
32
  }, []), U = l((e) => {
33
- me(!0), b(e);
34
- }, [b]), W = e(g, { enabled: !!g && !_ && !v }).data?.suggested_counterpart?.id;
33
+ me(!0), x(e);
34
+ }, [x]), W = r(_, { enabled: !!_ && !v && !y }).data?.suggested_counterpart?.id;
35
35
  u(() => {
36
- !V && !_ && !v && W && U(W);
36
+ !V && !v && !y && W && U(W);
37
37
  }, [
38
- _,
39
38
  v,
39
+ y,
40
40
  V,
41
41
  W,
42
42
  U
43
43
  ]), u(() => {
44
- B.current !== _ && (B.current = _, H());
45
- }, [_, H]), u(() => {
44
+ B.current !== v && (B.current = v, H());
45
+ }, [v, H]), u(() => {
46
46
  let e = setTimeout(() => {
47
- E(C.trim());
48
- }, ue);
47
+ de(T.trim());
48
+ }, le);
49
49
  return () => clearTimeout(e);
50
- }, [C]);
51
- let G = ne({
50
+ }, [T]);
51
+ let G = e({
52
52
  sort: "counterpart_name",
53
53
  order: "asc",
54
- limit: m,
55
- counterpart_name__icontains: T || void 0,
54
+ limit: h,
55
+ counterpart_name__icontains: D || void 0,
56
56
  is_vendor: !0,
57
- enabled: !!T
58
- }), K = ae({ selectedId: _ }), q = re(), J = ie(), Y = d(() => {
57
+ enabled: !!D
58
+ }), K = ae({ selectedId: v }), q = t(), J = n(), Y = d(() => {
59
59
  let e = K.counterpart;
60
60
  if (!e) return;
61
61
  if (K.isBankAccountsLoading) return {
62
- name: a(e),
63
- email: i(e),
64
- methodLabel: S.paymentMethodLoading,
62
+ name: o(e),
63
+ email: a(e),
64
+ methodLabel: w.paymentMethodLoading,
65
65
  fields: []
66
66
  };
67
67
  if (K.isBankAccountsError) return {
68
- name: a(e),
69
- email: i(e),
70
- methodLabel: S.paymentMethodUnavailable,
68
+ name: o(e),
69
+ email: a(e),
70
+ methodLabel: w.paymentMethodUnavailable,
71
71
  fields: []
72
72
  };
73
- let n = o(K.bankAccounts);
73
+ let t = s(K.bankAccounts);
74
74
  return {
75
- name: a(e),
76
- email: i(e),
77
- methodLabel: n ? S.achMethod : S.noMethod,
78
- fields: n ? [
75
+ name: o(e),
76
+ email: a(e),
77
+ methodLabel: t ? w.achMethod : w.noMethod,
78
+ fields: t ? [
79
79
  {
80
- label: S.accountHolder,
81
- value: n.account_holder_name ?? ""
80
+ label: w.accountHolder,
81
+ value: t.account_holder_name ?? ""
82
82
  },
83
83
  {
84
- label: S.routingNumber,
85
- value: n.routing_number ?? ""
84
+ label: w.routingNumber,
85
+ value: t.routing_number ?? ""
86
86
  },
87
87
  {
88
- label: S.accountNumber,
89
- value: n.account_number ?? "",
90
- maskedValue: n.account_number ? t(n.account_number) : ""
88
+ label: w.accountNumber,
89
+ value: t.account_number ?? "",
90
+ maskedValue: t.account_number ? ee(t.account_number) : ""
91
91
  }
92
92
  ] : []
93
93
  };
@@ -96,43 +96,43 @@ function g({ payableId: g, counterpartId: _, payableCounterpartId: v, payableCou
96
96
  K.counterpart,
97
97
  K.isBankAccountsError,
98
98
  K.isBankAccountsLoading,
99
- S
100
- ]), X = d(() => r(K.bankAccounts), [K.bankAccounts]), Z = d(() => o(K.bankAccounts)?.id, [K.bankAccounts]), Q = l(async () => {
101
- let e = M.current;
102
- if (!_) return { ok: !0 };
103
- if (!s(e)) return y && _ === v ? {
99
+ w
100
+ ]), X = d(() => ne(K.bankAccounts), [K.bankAccounts]), Z = d(() => s(K.bankAccounts)?.id, [K.bankAccounts]), Q = l(async () => {
101
+ let e = N.current;
102
+ if (!v) return { ok: !0 };
103
+ if (!c(e)) return b && v === y ? {
104
104
  ok: !0,
105
- counterpartBankAccountId: y
105
+ counterpartBankAccountId: b
106
106
  } : K.isBankAccountsLoading || K.isBankAccountsFetching || K.isBankAccountsError ? { ok: !1 } : {
107
107
  ok: !0,
108
108
  counterpartBankAccountId: Z
109
109
  };
110
110
  if (K.isBankAccountsLoading || K.isBankAccountsFetching || K.isBankAccountsError) return { ok: !1 };
111
- let t = te(e);
112
- if (Object.keys(t).length > 0) return L(t), k(!0), { ok: !1 };
111
+ let t = ie(e);
112
+ if (Object.keys(t).length > 0) return L(t), A(!0), { ok: !1 };
113
113
  L(void 0);
114
- let r = c(K.bankAccounts, R ?? X?.id);
115
- if (r.kind === "update") return await J.mutateAsync({
114
+ let n = re(K.bankAccounts, R ?? X?.id);
115
+ if (n.kind === "update") return await J.mutateAsync({
116
116
  path: {
117
- counterpart_id: _,
118
- bank_account_id: r.bankAccountId
117
+ counterpart_id: v,
118
+ bank_account_id: n.bankAccountId
119
119
  },
120
- body: ee(e, { includeAchDefaults: r.includeAchDefaults })
121
- }), z(r.bankAccountId), {
120
+ body: te(e, { includeAchDefaults: n.includeAchDefaults })
121
+ }), z(n.bankAccountId), {
122
122
  ok: !0,
123
- counterpartBankAccountId: r.bankAccountId
123
+ counterpartBankAccountId: n.bankAccountId
124
124
  };
125
- let i = await q.mutateAsync({
126
- path: { counterpart_id: _ },
127
- body: n(e, { isDefaultForCurrency: r.isDefaultForCurrency })
125
+ let r = await q.mutateAsync({
126
+ path: { counterpart_id: v },
127
+ body: i(e, { isDefaultForCurrency: n.isDefaultForCurrency })
128
128
  });
129
- return z(i?.id), {
129
+ return z(r?.id), {
130
130
  ok: !0,
131
- counterpartBankAccountId: i?.id
131
+ counterpartBankAccountId: r?.id
132
132
  };
133
133
  }, [
134
134
  X,
135
- _,
135
+ v,
136
136
  q,
137
137
  K.bankAccounts,
138
138
  K.isBankAccountsError,
@@ -140,29 +140,29 @@ function g({ payableId: g, counterpartId: _, payableCounterpartId: v, payableCou
140
140
  K.isBankAccountsLoading,
141
141
  R,
142
142
  Z,
143
+ b,
143
144
  y,
144
- v,
145
145
  J
146
146
  ]), he = d(() => (G.data?.data ?? []).map((e) => ({
147
- name: a(e),
148
- email: i(e),
147
+ name: o(e),
148
+ email: a(e),
149
149
  onSelect: () => U(e.id)
150
- })), [G.data, U]), ge = d(() => se(x), [x]), $ = l(() => {
151
- O(void 0), P(!1);
150
+ })), [G.data, U]), ge = d(() => se(C), [C]), $ = l(() => {
151
+ k(void 0), P(!1);
152
152
  }, []), _e = l((e) => {
153
- O(void 0), P(!1), U(e);
153
+ k(void 0), P(!1), U(e);
154
154
  }, [U]);
155
- if (D) return {
155
+ if (O) return {
156
156
  mode: "creating",
157
- newVendorForm: /* @__PURE__ */ le(ce, {
158
- mode: D,
159
- counterpart: D === "edit" ? K.counterpart : void 0,
160
- primaryAddress: D === "edit" ? K.primaryAddress : void 0,
161
- bankAccounts: D === "edit" ? K.bankAccounts : void 0,
162
- isBankAccountsLoading: D === "edit" ? K.isBankAccountsLoading : void 0,
163
- isBankAccountsError: D === "edit" ? K.isBankAccountsError : void 0,
164
- initialName: D === "create" ? C : void 0,
165
- initialValues: D === "create" ? ge : void 0,
157
+ newVendorForm: /* @__PURE__ */ m(ce, {
158
+ mode: O,
159
+ counterpart: O === "edit" ? K.counterpart : void 0,
160
+ primaryAddress: O === "edit" ? K.primaryAddress : void 0,
161
+ bankAccounts: O === "edit" ? K.bankAccounts : void 0,
162
+ isBankAccountsLoading: O === "edit" ? K.isBankAccountsLoading : void 0,
163
+ isBankAccountsError: O === "edit" ? K.isBankAccountsError : void 0,
164
+ initialName: O === "create" ? T : void 0,
165
+ initialValues: O === "create" ? ge : void 0,
166
166
  onSaved: _e,
167
167
  onCancel: $,
168
168
  onDirtyChange: P
@@ -175,21 +175,21 @@ function g({ payableId: g, counterpartId: _, payableCounterpartId: v, payableCou
175
175
  return {
176
176
  mode: "resolved",
177
177
  summary: Y,
178
- onEdit: e ? void 0 : () => O("edit"),
178
+ onEdit: e ? void 0 : () => k("edit"),
179
179
  onClear: () => U(void 0),
180
180
  paymentInstructions: e ? void 0 : {
181
- isOpen: pe,
182
- values: A,
181
+ isOpen: fe,
182
+ values: j,
183
183
  errors: I,
184
184
  onOpen: () => {
185
- k(!0), X && (j({
185
+ A(!0), X && (M({
186
186
  accountHolderName: X.account_holder_name ?? "",
187
187
  routingNumber: X.routing_number ?? "",
188
188
  accountNumber: X.account_number ?? ""
189
189
  }), z(X.id));
190
190
  },
191
191
  onChange: (e) => {
192
- j((t) => ({
192
+ M((t) => ({
193
193
  ...t,
194
194
  ...e
195
195
  })), L(void 0);
@@ -201,12 +201,12 @@ function g({ payableId: g, counterpartId: _, payableCounterpartId: v, payableCou
201
201
  }
202
202
  return {
203
203
  mode: "selecting",
204
- error: G.isError ? S.searchFailed : K.isError ? S.vendorDetailsFailed : de,
204
+ error: G.isError ? w.searchFailed : K.isError ? w.vendorDetailsFailed : S,
205
205
  search: {
206
- query: C,
207
- onQueryChange: w,
206
+ query: T,
207
+ onQueryChange: E,
208
208
  isLoading: G.isLoading,
209
- onAddVendor: () => O("create"),
209
+ onAddVendor: () => k("create"),
210
210
  results: he
211
211
  },
212
212
  savePaymentInstructions: Q,
@@ -214,4 +214,4 @@ function g({ payableId: g, counterpartId: _, payableCounterpartId: v, payableCou
214
214
  };
215
215
  }
216
216
  //#endregion
217
- export { g as useVendorSectionProps };
217
+ export { _ as useVendorSectionProps };