@tesouro/embedded-components-react 0.4.27 → 0.4.29

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 (94) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/lib/BillPayWidget.js +1 -1
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +2 -2
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index16.js +15 -82
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index17.js +87 -25
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index18.js +36 -0
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +12 -12
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +5 -70
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +64 -37
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +38 -110
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +104 -73
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +87 -7
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +7 -21
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +17 -22
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +23 -63
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +66 -2
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +2 -77
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +78 -3
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +4 -5
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +5 -4
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +3 -32
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +30 -39
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +37 -166
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +164 -39
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +48 -1
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +1 -50
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +45 -11
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +13 -8
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +8 -14
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +7 -59
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +64 -8
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +8 -24
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +18 -136
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +139 -16
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +24 -4
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +4 -41
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +39 -88
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +79 -85
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +96 -3
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +3 -49
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +47 -119
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +135 -33
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +33 -186
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +186 -75
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +75 -21
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +22 -232
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +223 -210
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +14 -25
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +202 -103
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +121 -13
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +12 -47
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +47 -31
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +27 -198
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +198 -30
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +30 -234
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +240 -19
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +19 -425
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +433 -4
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +25 -24
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +4 -38
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +35 -218
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +224 -3
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +3 -4
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +2 -44
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +46 -1
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +1 -8
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +6 -10
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +10 -110
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +112 -3
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +21 -57
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +3 -127
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +124 -8
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +8 -7
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +8 -46
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +43 -18
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +20 -28
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +27 -82
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +83 -47
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +47 -250
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +239 -101
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +58 -5
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +107 -202
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +209 -3
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +4 -8
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +6 -113
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +115 -1
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +0 -24
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +25 -0
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +5 -4
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +1 -1
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +3 -1
  92. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  93. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  94. package/package.json +1 -1
@@ -1,4 +1,433 @@
1
- import "./index45.js";
2
- import "./index54.js";
3
- import "./index56.js";
4
- import "./index58.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
6
+ import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
7
+ import { useAllLedgerAccountsQuery as ee } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
8
+ import { useAllOrganizationUsersQuery as te } from "../../../shared/data-access/dist/lib/user/useAllOrganizationUsersQuery.js";
9
+ import "../../../shared/data-access/dist/index.js";
10
+ import { formatCalendarDate as ne } from "../../../shared/util/dist/lib/formatCalendarDate.js";
11
+ import { useWidgetConfig as re } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
12
+ import "../../../shared/feature/dist/index.js";
13
+ import { usePayableApprovalRequestsQuery as ie } from "../../data-access/dist/index8.js";
14
+ import { usePayableHistoryQuery as ae } from "../../data-access/dist/index9.js";
15
+ import { useAllPayableLineItemsQuery as oe } from "../../data-access/dist/index10.js";
16
+ import { usePayableQuery as se } from "../../data-access/dist/index17.js";
17
+ import "../../data-access/dist/index.js";
18
+ import { hasUnpaidBalance as ce } from "./index8.js";
19
+ import { resolveVendor as le } from "./index9.js";
20
+ import { BillCreateScreen as ue } from "../../ui/dist/index50.js";
21
+ import { BillDecisionDialog as n } from "../../ui/dist/index56.js";
22
+ import { BillDuplicateNotice as de } from "../../ui/dist/index66.js";
23
+ import { BillRejectedBanner as fe } from "../../ui/dist/index69.js";
24
+ import { ExtractionNotice as pe } from "../../ui/dist/index87.js";
25
+ import { MarkAsPaidDialog as me } from "../../ui/dist/index96.js";
26
+ import { UnsavedBillDialog as he } from "../../ui/dist/index106.js";
27
+ import "../../ui/dist/index.js";
28
+ import { usePayableDuplicateReview as ge } from "./index14.js";
29
+ import "./index15.js";
30
+ import { canOverrideApprovalPolicy as _e, canReadCounterpartBankAccounts as ve } from "./index20.js";
31
+ import { resolveAmountDueMinorUnits as ye } from "./index21.js";
32
+ import { usePayableAchInstructions as be } from "../../../shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js";
33
+ import "../../../shared/counterpart-management/feature/dist/index.js";
34
+ import { PayBillFlow as xe } from "./index27.js";
35
+ import "./index28.js";
36
+ import { useMarkAsPaidFlow as Se } from "./index18.js";
37
+ import "./index19.js";
38
+ import { BILL_CREATE_MESSAGE_LABELS_EN as Ce, mergeBillCreateScreenCopy as we } from "./index46.js";
39
+ import { useBillCreateController as Te } from "./index55.js";
40
+ import { useBillForm as Ee } from "./index57.js";
41
+ import { buildPaymentHistory as De } from "./index3.js";
42
+ import { currentApprovalRound as Oe } from "./index4.js";
43
+ import { useIsApprovalPolicyAssignmentSettled as ke } from "./index5.js";
44
+ import { usePayableApprovalRoundStart as Ae } from "./index32.js";
45
+ import { useApprovalPolicyCardView as je } from "./index33.js";
46
+ import { resolveBillRejectionNotice as Me } from "./index34.js";
47
+ import { useCurrentApprovalRequestId as Ne } from "./index35.js";
48
+ import { usePayableDetailActions as Pe } from "./index36.js";
49
+ import { useScheduledPayment as Fe } from "./index37.js";
50
+ import { isEditablePayableStatus as Ie } from "./index38.js";
51
+ import { useDraftDelete as Le } from "./index39.js";
52
+ import { buildBillDetailView as Re } from "./index41.js";
53
+ import { resolveEditorDismissal as ze } from "./index42.js";
54
+ import { buildBillHistory as Be } from "./index43.js";
55
+ import { SourceDocumentContainer as Ve } from "./index47.js";
56
+ import { useVendorSectionProps as He } from "./index50.js";
57
+ import { usePaymentInstructionsForm as Ue } from "./index51.js";
58
+ import { billCreateTestIds as r } from "./index58.js";
59
+ import { useCallback as i, useEffect as We, useMemo as a, useRef as Ge, useState as o } from "react";
60
+ import { Fragment as Ke, jsx as s, jsxs as qe } from "react/jsx-runtime";
61
+ import { Trash2Icon as Je } from "lucide-react";
62
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js
63
+ function c({ open: c, onOpenChange: l, payableId: Ye, readOnly: u = !1, copy: Xe, onCollapse: Ze, poweredByBankName: Qe }) {
64
+ let d = a(() => we(Xe), [Xe]), [f, $e] = o(), [p, et] = o(!1), [tt, nt] = o(!1), [m, h] = o(!1), [rt, it] = o(), g = Ye ?? rt, _ = se(g, {
65
+ pollWhileOcrProcessing: !0,
66
+ pollWhilePolicyAssignmentUnsettled: !0
67
+ }), v = oe(g), { initResponse: y } = re(), at = !!y, b = e(y?.scopes, [t.AccountingConfigReadOrg]), x = ee({ enabled: b }), S = _.data, C = !g || !!S, w = !u && C && !!g && S?.status !== "draft", ot = !u && !!S && !Ie(S?.status), T = u || ot, E = Ee({
68
+ payable: S,
69
+ lineItems: v.lineItems
70
+ }), D = S?.counterpart_id;
71
+ We(() => {
72
+ p || D && ($e(D), et(!0));
73
+ }, [p, D]);
74
+ let st = i((e) => {
75
+ et(!0), $e(e);
76
+ }, []), O = He({
77
+ payableId: u ? void 0 : g,
78
+ counterpartId: u ? void 0 : f,
79
+ payableCounterpartId: D,
80
+ isVendorKnown: !u && C,
81
+ onCounterpartChange: st,
82
+ requiredError: E.errors?.vendor,
83
+ payableCounterpartBankAccountId: S?.counterpart_bank_account_id ?? void 0,
84
+ extractedVendor: S?.counterpart_raw_data ?? void 0
85
+ }), ct = !!(g && p) && !f, lt = _.refetch, ut = i(async () => {
86
+ let { data: e } = await lt();
87
+ return e?.status ?? void 0;
88
+ }, [lt]), dt = a(() => w ? { draftSaved: Ce.submittedSaved } : void 0, [w]), k = Te({
89
+ payableId: Ye,
90
+ form: E,
91
+ labels: dt,
92
+ counterpartId: f,
93
+ clearCounterpart: ct,
94
+ prepareVendorForSave: O.savePaymentInstructions,
95
+ onPayableCreated: it,
96
+ onSaved: it,
97
+ onDraftSaved: () => l(!1),
98
+ onFinalized: () => l(!1),
99
+ readSavedStatus: w ? ut : void 0
100
+ }), A = !!(k.isSavingDraft || k.isFinalizing), j = u ? g : void 0, M = Ne({
101
+ payableId: j,
102
+ status: S?.status
103
+ }), ft = Ge(null), N = Fe({
104
+ payableId: g,
105
+ scheduledPaymentDate: S?.scheduled_payment_date,
106
+ enabled: u || w
107
+ }), pt = le(S), P = ve(y?.scopes), F = be({
108
+ counterpartId: u ? D : void 0,
109
+ currency: S?.currency,
110
+ currentBankAccountId: u ? S?.counterpart_bank_account_id ?? void 0 : void 0,
111
+ enabled: P && u
112
+ }), I = Ue({
113
+ payableId: j,
114
+ counterpartId: u ? D : void 0,
115
+ currentBankAccountId: S?.counterpart_bank_account_id ?? void 0,
116
+ canReadCounterpartBankAccounts: P,
117
+ saveErrorMessage: d.detail.paymentInstructionsSaveError,
118
+ linkErrorMessage: d.detail.paymentInstructionsLinkError
119
+ }), mt = e(y?.scopes, [t.PayableWriteOrg]), L = e(y?.scopes, [t.CounterpartWriteOrg]) && mt, ht = L && ce(S?.status) && !N.hasScheduledPayment && !N.isResolving, R = Se({
120
+ payableId: j,
121
+ amountDueMinorUnits: ye(S) ?? 0,
122
+ amountToPayMinorUnits: S?.amount_to_pay ?? void 0,
123
+ currencyCode: S?.currency ?? void 0,
124
+ dueDate: S?.due_date,
125
+ hasScheduledPayment: N.hasScheduledPayment,
126
+ labels: d.markAsPaid
127
+ }), z = je({
128
+ payableId: j,
129
+ approvalPolicyId: S?.approval_policy_id,
130
+ enabled: u,
131
+ copy: d.approvalPolicyCopy
132
+ }), gt = !ke(S), _t = _e({
133
+ status: S?.status,
134
+ scopes: y?.scopes,
135
+ arePendingApproversUnknown: z.isLoading || gt,
136
+ hasApprovalPolicy: !!S?.approval_policy_id,
137
+ hasWaitingRequest: M.hasWaitingRequest
138
+ }), { actions: B, decisionDialog: vt, isActionPending: yt } = Pe({
139
+ payableId: u || w ? g : void 0,
140
+ status: S?.status,
141
+ currentApprovalRequestId: M.id,
142
+ arePendingApproversUnknown: z.isLoading || gt,
143
+ hasScheduledPayment: N.hasScheduledPayment,
144
+ scheduledPaymentIntentId: N.scheduledPaymentIntentId,
145
+ isScheduledPaymentUnknown: N.isResolving,
146
+ isPayabilityUnknown: F.isLoading,
147
+ hasApprovalPolicy: !!S?.approval_policy_id,
148
+ hasWaitingRequest: M.hasWaitingRequest,
149
+ pendingApprovers: z.pendingApprovers,
150
+ labels: d.actions,
151
+ isMarkAsPaidPending: R.isPending,
152
+ onMarkAsPaidSelect: R.open,
153
+ onPayBillSelect: () => ft.current?.open(),
154
+ onActionSucceeded: w ? () => l(!1) : void 0
155
+ }), V = Le({
156
+ payableId: g,
157
+ status: S?.status,
158
+ enabled: !u,
159
+ labels: d.deleteDraft,
160
+ onDeleted: () => l(!1)
161
+ }), H = A || yt, U = _.isLoading || v.isResolving || x.isResolving || F.isLoading, W = _.isError || v.isError || x.isError, bt = a(() => [...V.menuItems, ...w || u && !U && !W ? B.menu.map((e) => ({
162
+ id: e.id,
163
+ label: e.label,
164
+ onSelect: e.onSelect,
165
+ disabled: e.disabled,
166
+ icon: e.icon,
167
+ sectionHeading: e.sectionHeading
168
+ })) : []], [
169
+ B.menu,
170
+ V.menuItems,
171
+ w,
172
+ u,
173
+ U,
174
+ W
175
+ ]), G = a(() => (x.data?.data ?? []).map((e) => ({
176
+ value: e.id,
177
+ label: [e.nominal_code, e.name].filter(Boolean).join(" — ")
178
+ })), [x.data]), K;
179
+ at && (b ? x.isError ? K = d.lineItemsGlCodeUnavailable.loadError : !x.isResolving && G.length === 0 && (K = d.lineItemsGlCodeUnavailable.empty) : K = d.lineItemsGlCodeUnavailable.noAccess);
180
+ let xt = !at || !!K || x.isResolving, St = b && !x.isResolving && !x.isError, q = ae(j), Ct = S?.status === "rejected" || !u && w, wt = e(y?.scopes, [t.ApprovalRequestReadOrg]), Tt = Ct && wt, Et = e(y?.scopes, [t.UserReadOrg]), J = te({ enabled: (u || Ct) && Et }), Dt = a(() => Be(q.data?.data ?? [], J.data?.data ?? [], d.history), [
181
+ q.data,
182
+ J.data,
183
+ d.history
184
+ ]), Ot = Ae({
185
+ payableId: g,
186
+ enabled: Tt
187
+ }), kt = ie(g, { enabled: Tt }), At = a(() => Oe(kt.data?.data, Ot.roundStartedAt), [kt.data, Ot.roundStartedAt]), Y = a(() => Me({
188
+ payableStatus: S?.status,
189
+ approvalRequests: At,
190
+ users: J.data?.data ?? [],
191
+ payableUpdatedAt: S?.updated_at,
192
+ labels: d.detail
193
+ }), [
194
+ S?.status,
195
+ S?.updated_at,
196
+ At,
197
+ J.data,
198
+ d.detail
199
+ ]), jt = a(() => De({
200
+ records: N.paymentRecords,
201
+ events: q.data?.data ?? [],
202
+ currencyCode: S?.currency,
203
+ labels: d.detail
204
+ }), [
205
+ N.paymentRecords,
206
+ q.data,
207
+ S?.currency,
208
+ d.detail
209
+ ]), Mt = a(() => u && S ? Re({
210
+ payable: S,
211
+ lineItems: v.lineItems,
212
+ glCodeOptions: G,
213
+ glCodeRosterAvailable: St,
214
+ history: Dt,
215
+ paymentHistory: jt,
216
+ approvalPolicy: z.view,
217
+ labels: d.detail,
218
+ hasScheduledPayment: N.hasScheduledPayment,
219
+ rejection: Y,
220
+ payableAchInstructions: F.achInstructions,
221
+ payableAchInstructionsReadable: P && !F.isError
222
+ }) : void 0, [
223
+ N.hasScheduledPayment,
224
+ z.view,
225
+ P,
226
+ d.detail,
227
+ G,
228
+ St,
229
+ Dt,
230
+ v.lineItems,
231
+ S,
232
+ F.achInstructions,
233
+ F.isError,
234
+ jt,
235
+ u,
236
+ Y
237
+ ]), Nt = S?.source_of_payable_data === "ocr", X = pt?.name, Pt = u ? X ? d.viewTitle(X) : d.readOnlyTitle : X && (Nt || w) ? d.extractedTitle(X) : d.newTitle, Ft = u && S?.created_at ? d.addedOn(ne(S.created_at.slice(0, 10))) : void 0, Z = i(() => {
238
+ let e = E.isDirty || O.hasUnsavedVendorChanges || !!k.stagedFile || k.isFileDeletionPending;
239
+ switch (ze({
240
+ isUnsavedPromptOpen: m,
241
+ isLocked: T,
242
+ isDirty: e
243
+ })) {
244
+ case "dismiss-prompt":
245
+ h(!1);
246
+ return;
247
+ case "prompt":
248
+ h(!0);
249
+ return;
250
+ default: l(!1);
251
+ }
252
+ }, [
253
+ k.isFileDeletionPending,
254
+ k.stagedFile,
255
+ E.isDirty,
256
+ T,
257
+ m,
258
+ l,
259
+ O.hasUnsavedVendorChanges
260
+ ]), It = i(() => {
261
+ h(!1), l(!1);
262
+ }, [l]), Q = v.isResolving || O.mode === "creating", Lt = i(async () => {
263
+ if (Q) return;
264
+ let e = await k.saveDraft();
265
+ h(!1), e && l(!1);
266
+ }, [
267
+ k,
268
+ Q,
269
+ l
270
+ ]), $ = ge({
271
+ payable: S,
272
+ onRemoved: () => l(!1),
273
+ canManage: mt
274
+ }), Rt = i((e) => {
275
+ if (!(H || $.isBusy)) return e ? l(!0) : Z();
276
+ }, [
277
+ $.isBusy,
278
+ H,
279
+ Z,
280
+ l
281
+ ]), zt = $.isPossibleDuplicate, Bt = !u && Nt && !tt, Vt = !u && !!Y, Ht = Vt || zt || Bt ? /* @__PURE__ */ qe(Ke, { children: [
282
+ Vt && Y ? /* @__PURE__ */ s(fe, {
283
+ ...Y,
284
+ labels: d.rejectedBanner
285
+ }) : null,
286
+ zt ? /* @__PURE__ */ s(de, {
287
+ onNotADuplicate: $.onNotADuplicate,
288
+ onRemoveBill: $.onRemoveBill,
289
+ isActionDisabled: $.isBusy,
290
+ labels: $.removeBillLabel ? { removeBillButton: $.removeBillLabel } : void 0,
291
+ testId: r.duplicateNotice
292
+ }) : null,
293
+ Bt ? /* @__PURE__ */ s(pe, { onDismiss: () => nt(!0) }) : null
294
+ ] }) : void 0;
295
+ return /* @__PURE__ */ qe(Ke, { children: [
296
+ /* @__PURE__ */ s(ue, {
297
+ open: c,
298
+ onOpenChange: Rt,
299
+ title: Pt,
300
+ subtitle: Ft,
301
+ notice: Ht,
302
+ vendor: {
303
+ ...O,
304
+ testId: r.vendorSection
305
+ },
306
+ values: E.values,
307
+ errors: E.errors,
308
+ onChange: E.onChange,
309
+ lineItems: {
310
+ items: E.lineItemRows,
311
+ glCodeOptions: G,
312
+ glCodeDisabled: xt,
313
+ glCodeUnavailableMessage: K,
314
+ discount: E.discount,
315
+ onDiscountChange: E.onDiscountChange,
316
+ tax: E.tax,
317
+ onTaxChange: E.onTaxChange,
318
+ total: E.total,
319
+ onTotalChange: E.onTotalChange,
320
+ onAddLineItem: E.onAddLineItem,
321
+ errors: E.lineItemErrors,
322
+ totalsErrors: E.totalsErrors,
323
+ testId: r.lineItems
324
+ },
325
+ documentPanel: /* @__PURE__ */ s(Ve, {
326
+ payableId: g,
327
+ readOnly: T,
328
+ isDocumentPending: !!g && !S?.file && (_.isLoading || S?.ocr_status === "processing"),
329
+ file: S?.file ? {
330
+ id: S.file.id,
331
+ name: S.file.name,
332
+ url: S.file.url,
333
+ mimetype: S.file.mimetype
334
+ } : void 0,
335
+ staging: {
336
+ stagedFile: k.stagedFile,
337
+ onFileStaged: k.stageFile,
338
+ onClearStagedFile: k.clearStagedFile,
339
+ isSaving: A
340
+ },
341
+ deletion: {
342
+ isPending: k.isFileDeletionPending,
343
+ onRequest: k.requestFileDeletion,
344
+ onDetachNow: k.detachFileNow,
345
+ isDeleting: k.isDeletingFile,
346
+ hasFailed: k.hasFileDeletionFailed
347
+ }
348
+ }),
349
+ menuItems: bt,
350
+ readOnly: T,
351
+ detail: u ? {
352
+ view: Mt,
353
+ actions: B,
354
+ scheduledSummary: N.hasScheduledPayment && N.scheduledDateLabel ? d.scheduledSummary(N.scheduledDateLabel) : void 0,
355
+ showApprovalOverrideNotice: _t && !!S?.approval_policy_id,
356
+ onEditPaymentInstructions: D && ht ? I.open : void 0,
357
+ paymentInstructionsForm: D && (ht || L && S?.status === "rejected") ? {
358
+ isOpen: I.isOpen,
359
+ values: I.values,
360
+ errors: I.errors,
361
+ isSaving: I.isSaving,
362
+ onOpen: I.open,
363
+ onCancel: I.close,
364
+ onChange: I.onChange,
365
+ onSave: I.save
366
+ } : void 0,
367
+ hideMissingPaymentInstructions: S?.status === "paid" || S?.status === "canceled",
368
+ isLoading: U,
369
+ isError: W,
370
+ paymentHistoryError: N.isError || q.isError,
371
+ paymentHistoryLoading: N.isResolving || q.isLoading
372
+ } : void 0,
373
+ isLineItemsLoading: v.isResolving,
374
+ isSaving: H,
375
+ isSavingDraft: k.isSavingDraft,
376
+ isSubmitting: k.isFinalizing,
377
+ onCancel: Z,
378
+ onCollapse: u ? Ze : void 0,
379
+ onSaveDraft: k.saveDraft,
380
+ onFinalize: k.finalize,
381
+ scrollToErrorToken: k.scrollToErrorToken,
382
+ showSubmit: !T && C,
383
+ testId: r.dialog
384
+ }),
385
+ /* @__PURE__ */ s(he, {
386
+ open: m,
387
+ onSaveDraft: Lt,
388
+ onDiscard: It,
389
+ onCancel: () => h(!1),
390
+ isSaving: k.isSavingDraft,
391
+ isSaveDraftDisabled: Q,
392
+ labels: d.unsavedChanges,
393
+ testId: r.unsavedDialog,
394
+ saveDraftTestId: r.unsavedSaveDraft,
395
+ discardTestId: r.unsavedDiscard,
396
+ closeTestId: r.unsavedClose
397
+ }),
398
+ /* @__PURE__ */ s(n, {
399
+ ...vt,
400
+ labels: { cancelButton: d.actions.decisionDialog.cancelButton },
401
+ testId: r.decisionDialog,
402
+ confirmTestId: r.decisionConfirm,
403
+ reasonTestId: r.decisionReason
404
+ }),
405
+ /* @__PURE__ */ s(n, {
406
+ ...V.dialog,
407
+ labels: { cancelButton: d.actions.decisionDialog.cancelButton },
408
+ testId: r.deleteDraftDialog,
409
+ confirmTestId: r.deleteDraftConfirm
410
+ }),
411
+ /* @__PURE__ */ s(n, {
412
+ open: $.removeConfirmation.open,
413
+ copy: $.removeConfirmation.copy,
414
+ onConfirm: $.removeConfirmation.onConfirm,
415
+ onCancel: $.removeConfirmation.onCancel,
416
+ isPending: $.removeConfirmation.isPending,
417
+ confirmIcon: /* @__PURE__ */ s(Je, {}),
418
+ labels: { cancelButton: $.removeConfirmation.cancelButtonLabel },
419
+ testId: r.duplicateRemoveDialog,
420
+ confirmTestId: r.duplicateRemoveConfirm
421
+ }),
422
+ /* @__PURE__ */ s(me, { ...R.dialogProps }),
423
+ u && S ? /* @__PURE__ */ s(xe, {
424
+ ref: ft,
425
+ payable: S,
426
+ onMissingAchInstructions: L ? I.open : void 0,
427
+ poweredByBankName: Qe,
428
+ labels: d.payBill
429
+ }) : null
430
+ ] });
431
+ }
432
+ //#endregion
433
+ export { c as BillCreateDialog, c as default };
@@ -1,26 +1,27 @@
1
- import { suspectedPayableDuplicates as e } from "../../data-access/dist/index7.js";
2
- import "../../data-access/dist/index.js";
3
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js
4
- function t(t) {
5
- let n = new Map(t.map((e) => [e.id, e])), r = /* @__PURE__ */ new Map(), i = (e) => {
6
- let t = r.get(e);
7
- if (t === void 0 || t === e) return e;
8
- let n = i(t);
9
- return r.set(e, n), n;
10
- }, a = (e, t) => {
11
- let n = i(e), a = i(t);
12
- n !== a && r.set(n, a);
13
- };
14
- t.forEach((t) => {
15
- r.set(t.id, r.get(t.id) ?? t.id), e(t).forEach((e) => {
16
- n.has(e.matched_payable_id) && a(t.id, e.matched_payable_id);
17
- });
18
- });
19
- let o = /* @__PURE__ */ new Map();
20
- return t.forEach((e) => {
21
- let t = i(e.id);
22
- o.set(t, [...o.get(t) ?? [], e]);
23
- }), [...o.values()].map((e) => ({ members: [...e].sort((e, t) => (e.created_at ?? "").localeCompare(t.created_at ?? "")) }));
24
- }
2
+ var e = {
3
+ selectRow: ({ vendorLabel: e, invoiceNumberLabel: t, addedOnLabel: n }) => `Select bill — ${e}, invoice ${t}, added ${n}`,
4
+ openRow: ({ vendorLabel: e, invoiceNumberLabel: t, addedOnLabel: n }) => `View bill — ${e}, invoice ${t}, added ${n}`,
5
+ reviewGroup: ({ vendorLabel: e, count: t }) => `${e} — ${t} possible duplicate bills`,
6
+ selectGroup: ({ vendorLabel: e }) => `Select every bill from ${e}`,
7
+ deleteBillButton: "Remove this bill",
8
+ deleteConfirmTitle: "Remove duplicate bill?",
9
+ deleteConfirmDescription: "You can't undo this action.",
10
+ deleteConfirmButton: "Remove duplicate bill",
11
+ deleteConfirmBackButton: "Cancel",
12
+ cancelBillButton: "Cancel this bill",
13
+ confirmBillButton: "Confirm duplicate",
14
+ cancelConfirmTitle: "Cancel duplicate bill?",
15
+ cancelConfirmDescription: "You can't undo this action.",
16
+ cancelConfirmButton: "Cancel this bill",
17
+ cancelConfirmBackButton: "Back",
18
+ deletedToast: "Duplicate removed",
19
+ cancelledToast: "Duplicate cancelled",
20
+ confirmedToast: "Duplicate confirmed",
21
+ dismissedToast: "Marked as “not a duplicate”.",
22
+ removedToast: "Duplicate removed",
23
+ verdictFailedToast: "Couldn't update this duplicate. Try again.",
24
+ allResolvedToast: "All possible duplicates resolved"
25
+ };
25
26
  //#endregion
26
- export { t as groupSuspectedDuplicates };
27
+ export { e as DUPLICATE_BILLS_LABELS_EN };
@@ -1,38 +1,4 @@
1
- import { BILL_DETAILS_SHEET_LABELS_EN as e } from "../../ui/dist/index61.js";
2
- import "../../ui/dist/index.js";
3
- import { MARK_AS_PAID_FLOW_LABELS_EN as t } from "./index15.js";
4
- import "./index18.js";
5
- import { APPROVAL_POLICY_RULE_COPY_EN as n } from "./index28.js";
6
- import { BILL_DETAIL_ACTIONS_LABELS_EN as r, PAYMENT_HISTORY_LABELS_EN as i, SCHEDULED_SUMMARY_LABEL_EN as a } from "./index43.js";
7
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js
8
- var o = {
9
- subtitle: "Accounts payable",
10
- vendorRow: "Vendor",
11
- bankAccountRow: "ACH bank account",
12
- bankAccountValue: (e) => `Account ending in ${e}`,
13
- ...i,
14
- invoiceNumberRow: "Number",
15
- issueDateRow: "Issue date",
16
- dueDateRow: "Due date",
17
- poNumberRow: "PO number",
18
- notProvided: "Not provided",
19
- glCodeMissing: "GL code not specified",
20
- quantityValue: (e, t) => `${e} x ${t}`,
21
- subtotalRow: "Subtotal",
22
- discountsRow: "Discounts",
23
- taxRow: "Tax",
24
- totalRow: "Total",
25
- actionError: r.actionError,
26
- actionSuccess: r.actionSuccess,
27
- scheduledSummary: a,
28
- paidOnLabel: (e) => `Paid on ${e}`,
29
- rejectedByOn: (e, t) => `Rejected by ${e} on ${t}`,
30
- rejectedOn: (e) => `Rejected on ${e}`,
31
- rejectionMessage: (e) => `"${e}"`,
32
- sheet: e,
33
- decisionDialog: r.decisionDialog,
34
- approvalPolicyCopy: n,
35
- markAsPaid: t
36
- };
37
- //#endregion
38
- export { o as BILL_DETAILS_LABELS_EN };
1
+ import "./index46.js";
2
+ import "./index55.js";
3
+ import "./index57.js";
4
+ import "./index59.js";