@tesouro/embedded-components-react 0.3.53 → 0.3.57

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 (38) hide show
  1. package/README.md +0 -20
  2. package/dist/index.d.ts +2 -22
  3. package/dist/index.js +44 -48
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +1 -1
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +65 -3
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +4 -5
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +5 -4
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +3 -32
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +30 -37
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +37 -158
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +165 -28
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +48 -1
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +1 -50
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +47 -4
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +4 -13
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +13 -14
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +7 -57
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +54 -16
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +24 -60
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +1 -1
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +2 -2
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +6 -6
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +98 -98
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +51 -53
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +1 -1
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +131 -140
  28. package/dist/libs/tesouro-embedded-components-react/create-card-widget/feature/dist/index.js +4 -4
  29. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index22.js +1 -1
  30. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index98.js +47 -29
  31. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/data-access/dist/index5.js +6 -6
  32. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +6 -5
  33. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +2 -3
  34. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js +18 -0
  35. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  36. package/package.json +1 -1
  37. package/dist/lib/CreateCardWidget.d.ts +0 -823
  38. package/dist/lib/CreateCardWidget.js +0 -5
@@ -24,16 +24,16 @@ import { UnsavedBillDialog as fe } from "../../ui/dist/index97.js";
24
24
  import "../../ui/dist/index.js";
25
25
  import { usePayableDuplicateReview as pe } from "./index10.js";
26
26
  import "./index11.js";
27
- import { resolveAmountDueMinorUnits as me } from "./index16.js";
28
- import { PayBillFlow as he } from "./index22.js";
29
- import "./index23.js";
27
+ import { resolveAmountDueMinorUnits as me } from "./index17.js";
28
+ import { PayBillFlow as he } from "./index23.js";
29
+ import "./index24.js";
30
30
  import { useMarkAsPaidFlow as ge } from "./index14.js";
31
31
  import "./index15.js";
32
32
  import { BILL_CREATE_MESSAGE_LABELS_EN as _e, mergeBillCreateScreenCopy as ve } from "./index40.js";
33
33
  import { useBillCreateController as ye } from "./index49.js";
34
34
  import { useBillForm as be } from "./index51.js";
35
- import { useApprovalPolicyCardView as xe } from "./index28.js";
36
- import { useCurrentApprovalRequestId as Se } from "./index29.js";
35
+ import { useApprovalPolicyCardView as xe } from "./index29.js";
36
+ import { useCurrentApprovalRequestId as Se } from "./index30.js";
37
37
  import { usePayableDetailActions as Ce } from "./index31.js";
38
38
  import { useScheduledPayment as we } from "./index32.js";
39
39
  import { isEditablePayableStatus as Te } from "./index33.js";
@@ -48,55 +48,52 @@ import { useCallback as i, useEffect as Me, useMemo as a, useRef as Ne, useState
48
48
  import { Fragment as Pe, jsx as s, jsxs as Fe } from "react/jsx-runtime";
49
49
  import { Trash2Icon as Ie } from "lucide-react";
50
50
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js
51
- function Le(e) {
52
- return !!(e?.bank_account?.account_holder_name && e.bank_account.routing_number && e.bank_account.account_number);
53
- }
54
- function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f, onCollapse: Re, poweredByBankName: ze }) {
55
- let p = a(() => ve(f), [f]), [m, h] = o(), [g, _] = o(!1), [Be, Ve] = o(!1), [He, v] = o(!1), [Ue, y] = o(), b = u ?? Ue, x = oe(b, { pollWhileOcrProcessing: !0 }), S = ae(b), { initResponse: C } = re(), w = !!C, T = e(C?.scopes, [t.AccountingConfigReadOrg]), E = ee({ enabled: T }), D = x.data, O = !b || !!D, k = !d && O && !!b && D?.status !== "draft", We = !d && !!D && !Te(D?.status), A = d || We, j = be({
51
+ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f, onCollapse: Le, poweredByBankName: Re }) {
52
+ let p = a(() => ve(f), [f]), [m, h] = o(), [g, _] = o(!1), [ze, Be] = o(!1), [Ve, v] = o(!1), [He, y] = o(), b = u ?? He, x = oe(b, { pollWhileOcrProcessing: !0 }), S = ae(b), { initResponse: C } = re(), w = !!C, T = e(C?.scopes, [t.AccountingConfigReadOrg]), E = ee({ enabled: T }), D = x.data, O = !b || !!D, k = !d && O && !!b && D?.status !== "draft", Ue = !d && !!D && !Te(D?.status), A = d || Ue, j = be({
56
53
  payable: D,
57
54
  lineItems: S.lineItems
58
55
  }), M = D?.counterpart_id;
59
56
  Me(() => {
60
57
  g || M && (h(M), _(!0));
61
58
  }, [g, M]);
62
- let Ge = i((e) => {
59
+ let We = i((e) => {
63
60
  _(!0), h(e);
64
61
  }, []), N = Ae({
65
62
  payableId: d ? void 0 : b,
66
63
  counterpartId: d ? void 0 : m,
67
64
  payableCounterpartId: M,
68
- onCounterpartChange: Ge,
65
+ onCounterpartChange: We,
69
66
  requiredError: j.errors?.vendor,
70
67
  payableCounterpartBankAccountId: D?.counterpart_bank_account_id ?? void 0,
71
68
  extractedVendor: D?.counterpart_raw_data ?? void 0
72
- }), Ke = !!(b && g) && !m, qe = a(() => k ? { saveDraftButton: p.submittedSaveButton } : void 0, [p.submittedSaveButton, k]), Je = a(() => k ? { draftSaved: _e.submittedSaved } : void 0, [k]), P = x.refetch, Ye = i(async () => {
69
+ }), Ge = !!(b && g) && !m, Ke = a(() => k ? { saveDraftButton: p.submittedSaveButton } : void 0, [p.submittedSaveButton, k]), qe = a(() => k ? { draftSaved: _e.submittedSaved } : void 0, [k]), P = x.refetch, Je = i(async () => {
73
70
  let { data: e } = await P();
74
71
  return e?.status ?? void 0;
75
72
  }, [P]), F = ye({
76
73
  payableId: u,
77
74
  form: j,
78
- labels: Je,
75
+ labels: qe,
79
76
  counterpartId: m,
80
- clearCounterpart: Ke,
77
+ clearCounterpart: Ge,
81
78
  prepareVendorForSave: N.savePaymentInstructions,
82
79
  onPayableCreated: y,
83
80
  onSaved: y,
84
81
  onDraftSaved: () => l(!1),
85
82
  onFinalized: () => l(!1),
86
- readSavedStatus: k ? Ye : void 0
83
+ readSavedStatus: k ? Je : void 0
87
84
  }), I = !!(F.isSavingDraft || F.isFinalizing), L = d ? b : void 0, R = Se({
88
85
  payableId: L,
89
86
  status: D?.status
90
- }), Xe = Ne(null), z = we({
87
+ }), Ye = Ne(null), z = we({
91
88
  payableId: b,
92
89
  scheduledPaymentDate: D?.scheduled_payment_date,
93
90
  enabled: d || k
94
- }), Ze = se(D), B = je({
91
+ }), Xe = se(D), B = je({
95
92
  payableId: L,
96
93
  counterpartId: d ? M : void 0,
97
94
  saveErrorMessage: p.detail.paymentInstructionsSaveError,
98
95
  linkErrorMessage: p.detail.paymentInstructionsLinkError
99
- }), Qe = e(C?.scopes, [t.PayableWriteOrg]), $e = e(C?.scopes, [t.CounterpartWriteOrg]) && Qe, V = ge({
96
+ }), Ze = e(C?.scopes, [t.PayableWriteOrg]), Qe = e(C?.scopes, [t.CounterpartWriteOrg]) && Ze, V = ge({
100
97
  payableId: L,
101
98
  amountDueMinorUnits: me(D) ?? 0,
102
99
  amountToPayMinorUnits: D?.amount_to_pay ?? void 0,
@@ -109,7 +106,7 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
109
106
  approvalPolicyId: D?.approval_policy_id,
110
107
  enabled: d,
111
108
  copy: p.approvalPolicyCopy
112
- }), { actions: U, decisionDialog: et, isActionPending: tt } = Ce({
109
+ }), { actions: U, decisionDialog: $e, isActionPending: et } = Ce({
113
110
  payableId: d || k ? b : void 0,
114
111
  status: D?.status,
115
112
  currentApprovalRequestId: R.id,
@@ -123,7 +120,7 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
123
120
  labels: p.actions,
124
121
  isMarkAsPaidPending: V.isPending,
125
122
  onMarkAsPaidSelect: V.open,
126
- onPayBillSelect: () => Le(Ze) || !$e ? Xe.current?.open() : B.open(),
123
+ onPayBillSelect: () => Ye.current?.open(),
127
124
  onActionSucceeded: k ? () => l(!1) : void 0
128
125
  }), W = Ee({
129
126
  payableId: b,
@@ -131,7 +128,7 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
131
128
  enabled: !d,
132
129
  labels: p.deleteDraft,
133
130
  onDeleted: () => l(!1)
134
- }), G = I || tt, nt = a(() => [...W.menuItems, ...k ? U.menu.map((e) => ({
131
+ }), G = I || et, tt = a(() => [...W.menuItems, ...k ? U.menu.map((e) => ({
135
132
  id: e.id,
136
133
  label: e.label,
137
134
  onSelect: e.onSelect,
@@ -145,16 +142,16 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
145
142
  label: [e.nominal_code, e.name].filter(Boolean).join(" — ")
146
143
  })), [E.data]), q;
147
144
  w && (T ? E.isError ? q = p.lineItemsGlCodeUnavailable.loadError : !E.isResolving && K.length === 0 && (q = p.lineItemsGlCodeUnavailable.empty) : q = p.lineItemsGlCodeUnavailable.noAccess);
148
- let rt = !w || !!q || E.isResolving, it = T && !E.isResolving && !E.isError, at = ie(L), ot = e(C?.scopes, [t.UserReadOrg]), J = te({ enabled: d && ot }), st = a(() => Oe(at.data?.data ?? [], J.data?.data ?? [], p.history), [
149
- at.data,
150
- J.data,
145
+ let nt = !w || !!q || E.isResolving, rt = T && !E.isResolving && !E.isError, it = ie(L), at = e(C?.scopes, [t.UserReadOrg]), ot = te({ enabled: d && at }), J = a(() => Oe(it.data?.data ?? [], ot.data?.data ?? [], p.history), [
146
+ it.data,
147
+ ot.data,
151
148
  p.history
152
- ]), ct = a(() => d && D ? De({
149
+ ]), st = a(() => d && D ? De({
153
150
  payable: D,
154
151
  lineItems: S.lineItems,
155
152
  glCodeOptions: K,
156
- glCodeRosterAvailable: it,
157
- history: st,
153
+ glCodeRosterAvailable: rt,
154
+ history: J,
158
155
  approvalPolicy: H.view,
159
156
  labels: p.detail,
160
157
  hasScheduledPayment: z.hasScheduledPayment
@@ -163,12 +160,12 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
163
160
  H.view,
164
161
  p.detail,
165
162
  K,
166
- it,
167
- st,
163
+ rt,
164
+ J,
168
165
  S.lineItems,
169
166
  D,
170
167
  d
171
- ]), lt = D?.source_of_payable_data === "ocr", Y = Ze?.name, ut = d ? Y ? p.viewTitle(Y) : p.readOnlyTitle : Y && (lt || k) ? p.extractedTitle(Y) : p.newTitle, dt = d && D?.created_at ? p.addedOn(ne(D.created_at.slice(0, 10))) : void 0, X = i(() => {
168
+ ]), ct = D?.source_of_payable_data === "ocr", Y = Xe?.name, lt = d ? Y ? p.viewTitle(Y) : p.readOnlyTitle : Y && (ct || k) ? p.extractedTitle(Y) : p.newTitle, ut = d && D?.created_at ? p.addedOn(ne(D.created_at.slice(0, 10))) : void 0, X = i(() => {
172
169
  let e = j.isDirty || N.hasUnsavedVendorChanges || !!F.stagedFile || F.isFileDeletionPending;
173
170
  if (!A && e) {
174
171
  v(!0);
@@ -182,9 +179,9 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
182
179
  A,
183
180
  l,
184
181
  N.hasUnsavedVendorChanges
185
- ]), ft = i(() => {
182
+ ]), dt = i(() => {
186
183
  v(!1), l(!1);
187
- }, [l]), Z = S.isResolving || N.mode === "creating", pt = i(async () => {
184
+ }, [l]), Z = S.isResolving || N.mode === "creating", ft = i(async () => {
188
185
  if (Z) return;
189
186
  let e = await F.saveDraft();
190
187
  v(!1), e && l(!1);
@@ -195,28 +192,28 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
195
192
  ]), Q = pe({
196
193
  payable: D,
197
194
  onRemoved: () => l(!1),
198
- canManage: Qe
199
- }), mt = i((e) => {
195
+ canManage: Ze
196
+ }), pt = i((e) => {
200
197
  if (!(G || Q.isBusy)) return e ? l(!0) : X();
201
198
  }, [
202
199
  Q.isBusy,
203
200
  G,
204
201
  X,
205
202
  l
206
- ]), ht = Q.isPossibleDuplicate, $ = !d && lt && !Be, gt = ht || $ ? /* @__PURE__ */ Fe(Pe, { children: [ht ? /* @__PURE__ */ s(le, {
203
+ ]), mt = Q.isPossibleDuplicate, $ = !d && ct && !ze, ht = mt || $ ? /* @__PURE__ */ Fe(Pe, { children: [mt ? /* @__PURE__ */ s(le, {
207
204
  onNotADuplicate: Q.onNotADuplicate,
208
205
  onRemoveBill: Q.onRemoveBill,
209
206
  isActionDisabled: Q.isBusy,
210
207
  labels: Q.removeBillLabel ? { removeBillButton: Q.removeBillLabel } : void 0,
211
208
  testId: r.duplicateNotice
212
- }) : null, $ ? /* @__PURE__ */ s(ue, { onDismiss: () => Ve(!0) }) : null] }) : void 0;
209
+ }) : null, $ ? /* @__PURE__ */ s(ue, { onDismiss: () => Be(!0) }) : null] }) : void 0;
213
210
  return /* @__PURE__ */ Fe(Pe, { children: [
214
211
  /* @__PURE__ */ s(ce, {
215
212
  open: c,
216
- onOpenChange: mt,
217
- title: ut,
218
- subtitle: dt,
219
- notice: gt,
213
+ onOpenChange: pt,
214
+ title: lt,
215
+ subtitle: ut,
216
+ notice: ht,
220
217
  vendor: {
221
218
  ...N,
222
219
  testId: r.vendorSection
@@ -227,7 +224,7 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
227
224
  lineItems: {
228
225
  items: j.lineItemRows,
229
226
  glCodeOptions: K,
230
- glCodeDisabled: rt,
227
+ glCodeDisabled: nt,
231
228
  glCodeUnavailableMessage: q,
232
229
  discount: j.discount,
233
230
  onDiscountChange: j.onDiscountChange,
@@ -263,13 +260,13 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
263
260
  hasFailed: F.hasFileDeletionFailed
264
261
  }
265
262
  }),
266
- menuItems: nt,
263
+ menuItems: tt,
267
264
  readOnly: A,
268
265
  detail: d ? {
269
- view: ct,
266
+ view: st,
270
267
  actions: U,
271
268
  scheduledSummary: z.hasScheduledPayment && z.scheduledDateLabel ? p.scheduledSummary(z.scheduledDateLabel) : void 0,
272
- paymentInstructionsForm: M && $e ? {
269
+ paymentInstructionsForm: M && Qe ? {
273
270
  isOpen: B.isOpen,
274
271
  values: B.values,
275
272
  errors: B.errors,
@@ -287,17 +284,17 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
287
284
  isSavingDraft: F.isSavingDraft,
288
285
  isFinalizing: F.isFinalizing,
289
286
  onCancel: X,
290
- onCollapse: d ? Re : void 0,
287
+ onCollapse: d ? Le : void 0,
291
288
  onSaveDraft: F.saveDraft,
292
289
  onFinalize: F.finalize,
293
290
  showFinalize: !k && O,
294
- labels: qe,
291
+ labels: Ke,
295
292
  testId: r.dialog
296
293
  }),
297
294
  /* @__PURE__ */ s(fe, {
298
- open: He,
299
- onSaveDraft: pt,
300
- onDiscard: ft,
295
+ open: Ve,
296
+ onSaveDraft: ft,
297
+ onDiscard: dt,
301
298
  onCancel: () => v(!1),
302
299
  isSaving: F.isSavingDraft,
303
300
  isSaveDraftDisabled: Z,
@@ -307,7 +304,7 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
307
304
  discardTestId: r.unsavedDiscard
308
305
  }),
309
306
  /* @__PURE__ */ s(n, {
310
- ...et,
307
+ ...$e,
311
308
  labels: { cancelButton: p.actions.decisionDialog.cancelButton },
312
309
  testId: r.decisionDialog,
313
310
  confirmTestId: r.decisionConfirm,
@@ -332,9 +329,10 @@ function c({ open: c, onOpenChange: l, payableId: u, readOnly: d = !1, copy: f,
332
329
  }),
333
330
  /* @__PURE__ */ s(de, { ...V.dialogProps }),
334
331
  d && D ? /* @__PURE__ */ s(he, {
335
- ref: Xe,
332
+ ref: Ye,
336
333
  payable: D,
337
- poweredByBankName: ze,
334
+ onMissingAchInstructions: Qe ? B.open : void 0,
335
+ poweredByBankName: Re,
338
336
  labels: p.payBill
339
337
  }) : null
340
338
  ] });
@@ -2,7 +2,7 @@ import { BILL_DETAILS_SHEET_LABELS_EN as e } from "../../ui/dist/index55.js";
2
2
  import "../../ui/dist/index.js";
3
3
  import { MARK_AS_PAID_FLOW_LABELS_EN as t } from "./index12.js";
4
4
  import "./index15.js";
5
- import { APPROVAL_POLICY_RULE_COPY_EN as n } from "./index24.js";
5
+ import { APPROVAL_POLICY_RULE_COPY_EN as n } from "./index25.js";
6
6
  import { BILL_DETAIL_ACTIONS_LABELS_EN as r, SCHEDULED_SUMMARY_LABEL_EN as i } from "./index38.js";
7
7
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js
8
8
  var a = {
@@ -11,169 +11,160 @@ import "../../../shared/feature/dist/index.js";
11
11
  import { useAllPayableLineItemsQuery as i } from "../../data-access/dist/index9.js";
12
12
  import { usePayableQuery as a } from "../../data-access/dist/index15.js";
13
13
  import "../../data-access/dist/index.js";
14
- import { resolveVendor as o } from "./index5.js";
15
- import { BillDecisionDialog as s } from "../../ui/dist/index50.js";
16
- import { BillDetailsSheet as c } from "../../ui/dist/index56.js";
17
- import { BillDuplicateNotice as l } from "../../ui/dist/index60.js";
18
- import { MarkAsPaidDialog as u } from "../../ui/dist/index87.js";
14
+ import { BillDecisionDialog as o } from "../../ui/dist/index50.js";
15
+ import { BillDetailsSheet as s } from "../../ui/dist/index56.js";
16
+ import { BillDuplicateNotice as c } from "../../ui/dist/index60.js";
17
+ import { MarkAsPaidDialog as l } from "../../ui/dist/index87.js";
19
18
  import "../../ui/dist/index.js";
20
- import { usePayableDuplicateReview as d } from "./index10.js";
19
+ import { usePayableDuplicateReview as u } from "./index10.js";
21
20
  import "./index11.js";
22
- import { resolveAmountDueMinorUnits as f } from "./index16.js";
23
- import { PayBillFlow as p } from "./index22.js";
24
- import "./index23.js";
25
- import { mergeMarkAsPaidFlowLabels as m } from "./index12.js";
26
- import { useMarkAsPaidFlow as h } from "./index14.js";
21
+ import { resolveAmountDueMinorUnits as d } from "./index17.js";
22
+ import { PayBillFlow as f } from "./index23.js";
23
+ import "./index24.js";
24
+ import { mergeMarkAsPaidFlowLabels as p } from "./index12.js";
25
+ import { useMarkAsPaidFlow as m } from "./index14.js";
27
26
  import "./index15.js";
28
- import { mergeDecisionDialogCopy as g } from "./index38.js";
29
- import { useApprovalPolicyCardView as _ } from "./index28.js";
30
- import { useCurrentApprovalRequestId as v } from "./index29.js";
31
- import { usePayableDetailActions as y } from "./index31.js";
32
- import { useScheduledPayment as b } from "./index32.js";
33
- import { BILL_DETAILS_LABELS_EN as x } from "./index55.js";
34
- import { mapPayableToBillDetails as S } from "./index56.js";
35
- import { useMemo as C, useRef as w } from "react";
36
- import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
27
+ import { mergeDecisionDialogCopy as h } from "./index38.js";
28
+ import { useApprovalPolicyCardView as g } from "./index29.js";
29
+ import { useCurrentApprovalRequestId as _ } from "./index30.js";
30
+ import { usePayableDetailActions as v } from "./index31.js";
31
+ import { useScheduledPayment as y } from "./index32.js";
32
+ import { BILL_DETAILS_LABELS_EN as b } from "./index55.js";
33
+ import { mapPayableToBillDetails as x } from "./index56.js";
34
+ import { useMemo as S, useRef as C } from "react";
35
+ import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
37
36
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js
38
- function O(e) {
39
- return !!(e?.bank_account?.account_holder_name && e.bank_account.routing_number && e.bank_account.account_number);
40
- }
41
- function k({ open: k, onOpenChange: A, payableId: j, onClose: M, onExpand: N, testId: P, labels: F, poweredByBankName: I }) {
42
- let L = C(() => ({
43
- ...x,
44
- ...F,
37
+ function D({ open: D, onOpenChange: O, payableId: k, onClose: A, onExpand: j, testId: M, labels: N, poweredByBankName: P }) {
38
+ let F = S(() => ({
39
+ ...b,
40
+ ...N,
45
41
  sheet: {
46
- ...x.sheet,
47
- ...F?.sheet,
42
+ ...b.sheet,
43
+ ...N?.sheet,
48
44
  statusBadge: {
49
- ...x.sheet.statusBadge,
50
- ...F?.sheet?.statusBadge
45
+ ...b.sheet.statusBadge,
46
+ ...N?.sheet?.statusBadge
51
47
  },
52
48
  approvalPolicy: {
53
- ...x.sheet.approvalPolicy,
54
- ...F?.sheet?.approvalPolicy
49
+ ...b.sheet.approvalPolicy,
50
+ ...N?.sheet?.approvalPolicy
55
51
  },
56
52
  dueDate: {
57
- ...x.sheet.dueDate,
58
- ...F?.sheet?.dueDate
53
+ ...b.sheet.dueDate,
54
+ ...N?.sheet?.dueDate
59
55
  }
60
56
  },
61
- decisionDialog: g(x.decisionDialog, F?.decisionDialog),
57
+ decisionDialog: h(b.decisionDialog, N?.decisionDialog),
62
58
  approvalPolicyCopy: {
63
- ...x.approvalPolicyCopy,
64
- ...F?.approvalPolicyCopy
59
+ ...b.approvalPolicyCopy,
60
+ ...N?.approvalPolicyCopy
65
61
  },
66
- markAsPaid: m(F?.markAsPaid),
62
+ markAsPaid: p(N?.markAsPaid),
67
63
  actionSuccess: {
68
- ...x.actionSuccess,
69
- ...F?.actionSuccess
64
+ ...b.actionSuccess,
65
+ ...N?.actionSuccess
70
66
  }
71
- }), [F]), R = a(j), z = i(j), B = n(), V = R.data, H = w(null), U = v({
72
- payableId: j,
73
- status: V?.status
74
- }), W = _({
75
- payableId: j,
76
- approvalPolicyId: V?.approval_policy_id,
77
- copy: L.approvalPolicyCopy
78
- }), G = b({
79
- payableId: j,
80
- scheduledPaymentDate: V?.scheduled_payment_date
81
- }), K = h({
82
- payableId: j,
83
- amountDueMinorUnits: f(V) ?? 0,
84
- amountToPayMinorUnits: V?.amount_to_pay ?? void 0,
85
- currencyCode: V?.currency ?? void 0,
86
- dueDate: V?.due_date,
87
- hasScheduledPayment: G.hasScheduledPayment,
88
- testId: P,
89
- labels: L.markAsPaid
90
- }), { actions: q, decisionDialog: J } = y({
91
- payableId: V ? j : void 0,
92
- status: V?.status,
93
- currentApprovalRequestId: U.id,
94
- isPolicyApprover: U.isPolicyApprover,
95
- hasWaitingRequest: U.hasWaitingRequest,
96
- hasScheduledPayment: G.hasScheduledPayment,
97
- scheduledPaymentIntentId: G.scheduledPaymentIntentId,
98
- isScheduledPaymentUnknown: G.isResolving,
99
- pendingApprovers: W.pendingApprovers,
100
- arePendingApproversUnknown: W.isLoading,
67
+ }), [N]), I = a(k), L = i(k), R = n(), z = I.data, B = C(null), V = _({
68
+ payableId: k,
69
+ status: z?.status
70
+ }), H = g({
71
+ payableId: k,
72
+ approvalPolicyId: z?.approval_policy_id,
73
+ copy: F.approvalPolicyCopy
74
+ }), U = y({
75
+ payableId: k,
76
+ scheduledPaymentDate: z?.scheduled_payment_date
77
+ }), W = m({
78
+ payableId: k,
79
+ amountDueMinorUnits: d(z) ?? 0,
80
+ amountToPayMinorUnits: z?.amount_to_pay ?? void 0,
81
+ currencyCode: z?.currency ?? void 0,
82
+ dueDate: z?.due_date,
83
+ hasScheduledPayment: U.hasScheduledPayment,
84
+ testId: M,
85
+ labels: F.markAsPaid
86
+ }), { actions: G, decisionDialog: K } = v({
87
+ payableId: z ? k : void 0,
88
+ status: z?.status,
89
+ currentApprovalRequestId: V.id,
90
+ isPolicyApprover: V.isPolicyApprover,
91
+ hasWaitingRequest: V.hasWaitingRequest,
92
+ hasScheduledPayment: U.hasScheduledPayment,
93
+ scheduledPaymentIntentId: U.scheduledPaymentIntentId,
94
+ isScheduledPaymentUnknown: U.isResolving,
95
+ pendingApprovers: H.pendingApprovers,
96
+ arePendingApproversUnknown: H.isLoading,
101
97
  labels: {
102
- payBill: L.sheet.payButton,
103
- markAsPaid: L.sheet.markAsPaidButton,
104
- reject: L.sheet.rejectButton,
105
- approve: L.sheet.approveButton,
106
- cancel: L.sheet.cancelButton,
107
- cancelScheduledPayment: L.sheet.cancelScheduledPaymentButton,
108
- reopen: L.sheet.reopenButton,
109
- forceApprove: L.sheet.forceApproveButton,
110
- forceReject: L.sheet.forceRejectButton,
111
- policyOverridesHeading: L.sheet.policyOverridesGroup,
112
- decisionDialog: L.decisionDialog,
113
- actionError: L.actionError,
114
- actionSuccess: L.actionSuccess
98
+ payBill: F.sheet.payButton,
99
+ markAsPaid: F.sheet.markAsPaidButton,
100
+ reject: F.sheet.rejectButton,
101
+ approve: F.sheet.approveButton,
102
+ cancel: F.sheet.cancelButton,
103
+ cancelScheduledPayment: F.sheet.cancelScheduledPaymentButton,
104
+ reopen: F.sheet.reopenButton,
105
+ forceApprove: F.sheet.forceApproveButton,
106
+ forceReject: F.sheet.forceRejectButton,
107
+ policyOverridesHeading: F.sheet.policyOverridesGroup,
108
+ decisionDialog: F.decisionDialog,
109
+ actionError: F.actionError,
110
+ actionSuccess: F.actionSuccess
115
111
  },
116
- isMarkAsPaidPending: K.isPending,
117
- onMarkAsPaidSelect: K.open,
118
- onPayBillSelect: () => {
119
- if (!O(o(V)) && N) {
120
- N();
121
- return;
122
- }
123
- H.current?.open();
124
- }
125
- }), Y = G.hasScheduledPayment && G.scheduledDateLabel ? /* @__PURE__ */ E("p", {
112
+ isMarkAsPaidPending: W.isPending,
113
+ onMarkAsPaidSelect: W.open,
114
+ onPayBillSelect: () => B.current?.open()
115
+ }), q = U.hasScheduledPayment && U.scheduledDateLabel ? /* @__PURE__ */ T("p", {
126
116
  className: "ttw:text-sm ttw:text-muted-foreground",
127
- children: L.scheduledSummary(G.scheduledDateLabel)
128
- }) : void 0, { initResponse: X } = r(), Z = d({
129
- payable: V,
130
- canManage: e(X?.scopes, [t.PayableWriteOrg])
131
- }), Q = Z.isPossibleDuplicate ? /* @__PURE__ */ E(l, {
132
- onNotADuplicate: Z.onNotADuplicate,
133
- isActionDisabled: Z.isBusy
134
- }) : void 0, $ = Q || Y ? /* @__PURE__ */ D(T, { children: [Q, Y] }) : void 0, ee = C(() => V ? S({
135
- payable: V,
136
- lineItems: z.lineItems,
137
- ledgerAccounts: B.data?.data ?? [],
138
- labels: L,
139
- hasScheduledPayment: G.hasScheduledPayment
117
+ children: F.scheduledSummary(U.scheduledDateLabel)
118
+ }) : void 0, { initResponse: J } = r(), Y = u({
119
+ payable: z,
120
+ canManage: e(J?.scopes, [t.PayableWriteOrg])
121
+ }), X = Y.isPossibleDuplicate ? /* @__PURE__ */ T(c, {
122
+ onNotADuplicate: Y.onNotADuplicate,
123
+ isActionDisabled: Y.isBusy
124
+ }) : void 0, Z = X || q ? /* @__PURE__ */ E(w, { children: [X, q] }) : void 0, Q = S(() => z ? x({
125
+ payable: z,
126
+ lineItems: L.lineItems,
127
+ ledgerAccounts: R.data?.data ?? [],
128
+ labels: F,
129
+ hasScheduledPayment: U.hasScheduledPayment
140
130
  }) : void 0, [
141
- V,
142
- z.lineItems,
143
- B.data,
144
- L,
145
- G.hasScheduledPayment
146
- ]), te = R.isLoading || z.isResolving || B.isResolving, ne = R.isError || z.isError || B.isError;
147
- return /* @__PURE__ */ D(T, { children: [
148
- /* @__PURE__ */ E(c, {
149
- open: k,
150
- onOpenChange: A,
151
- details: ee,
152
- actions: q,
153
- approvalPolicy: W.view,
154
- isLoading: te,
155
- isError: ne,
156
- notice: $,
157
- onClose: M,
158
- onExpand: N,
159
- testId: P,
160
- labels: L.sheet
131
+ z,
132
+ L.lineItems,
133
+ R.data,
134
+ F,
135
+ U.hasScheduledPayment
136
+ ]), $ = I.isLoading || L.isResolving || R.isResolving, ee = I.isError || L.isError || R.isError;
137
+ return /* @__PURE__ */ E(w, { children: [
138
+ /* @__PURE__ */ T(s, {
139
+ open: D,
140
+ onOpenChange: O,
141
+ details: Q,
142
+ actions: G,
143
+ approvalPolicy: H.view,
144
+ isLoading: $,
145
+ isError: ee,
146
+ notice: Z,
147
+ onClose: A,
148
+ onExpand: j,
149
+ testId: M,
150
+ labels: F.sheet
161
151
  }),
162
- /* @__PURE__ */ E(s, {
163
- ...J,
164
- labels: { cancelButton: L.decisionDialog.cancelButton },
165
- testId: P ? `${P}-decision-dialog` : void 0,
166
- confirmTestId: P ? `${P}-decision-confirm` : void 0,
167
- reasonTestId: P ? `${P}-decision-reason` : void 0,
168
- reasonFieldId: P ? `${P}-decision-reason-field` : void 0
152
+ /* @__PURE__ */ T(o, {
153
+ ...K,
154
+ labels: { cancelButton: F.decisionDialog.cancelButton },
155
+ testId: M ? `${M}-decision-dialog` : void 0,
156
+ confirmTestId: M ? `${M}-decision-confirm` : void 0,
157
+ reasonTestId: M ? `${M}-decision-reason` : void 0,
158
+ reasonFieldId: M ? `${M}-decision-reason-field` : void 0
169
159
  }),
170
- /* @__PURE__ */ E(u, { ...K.dialogProps }),
171
- V ? /* @__PURE__ */ E(p, {
172
- ref: H,
173
- payable: V,
174
- poweredByBankName: I
160
+ /* @__PURE__ */ T(l, { ...W.dialogProps }),
161
+ z ? /* @__PURE__ */ T(f, {
162
+ ref: B,
163
+ payable: z,
164
+ onMissingAchInstructions: j,
165
+ poweredByBankName: P
175
166
  }) : null
176
167
  ] });
177
168
  }
178
169
  //#endregion
179
- export { k as BillDetailsContainer, k as default };
170
+ export { D as BillDetailsContainer, D as default };
@@ -1,4 +1,4 @@
1
- import { CardFormatValue as e } from "./index3.js";
2
- import { CREATE_CARD_FEATURE_LABELS_EN as t, resolveCreateCardFeatureLabels as n } from "./index5.js";
3
- import { CreateCardWidget as r } from "./index8.js";
4
- export { t as CREATE_CARD_FEATURE_LABELS_EN, e as CardFormatValue, r as CreateCardWidget, n as resolveCreateCardFeatureLabels };
1
+ import "./index3.js";
2
+ import "./index5.js";
3
+ import { CreateCardWidget as e } from "./index8.js";
4
+ export { e as CreateCardWidget };