@tesouro/embedded-components-react 0.5.3 → 0.5.4

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 (90) 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/feature/dist/index.js +13 -13
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +70 -5
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +37 -64
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +110 -38
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +73 -104
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +7 -87
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +21 -7
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +22 -17
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +63 -23
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +2 -66
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +81 -2
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +3 -78
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +5 -4
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +4 -5
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +32 -3
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +39 -30
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +166 -37
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +39 -164
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +1 -48
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +50 -1
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +11 -45
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index30.js +8 -13
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index31.js +14 -8
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +59 -7
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +8 -64
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +24 -8
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +139 -18
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +16 -139
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +4 -24
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +41 -4
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +14 -39
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +8 -16
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +91 -8
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +86 -80
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +3 -97
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +49 -3
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +135 -47
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +33 -135
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +186 -33
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +75 -186
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +21 -75
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +25 -14
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +232 -22
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +210 -223
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +103 -202
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +13 -121
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +47 -12
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +31 -47
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +198 -27
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +31 -198
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +234 -31
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +19 -240
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +24 -25
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +427 -19
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +4 -433
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +38 -4
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +220 -35
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +3 -224
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +4 -3
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +44 -2
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +1 -46
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +8 -1
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +10 -6
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +57 -21
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +110 -10
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +3 -112
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +127 -3
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +8 -124
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +7 -8
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +46 -8
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +18 -43
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +28 -20
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +82 -27
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +47 -83
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +5 -58
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +250 -47
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +101 -239
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +202 -107
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +3 -209
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +8 -4
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +113 -6
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +1 -115
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +24 -0
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +4 -5
  87. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  88. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  89. package/package.json +1 -1
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +0 -25
@@ -1,38 +1,223 @@
1
- import { BILL_DETAILS_SHEET_LABELS_EN as e } from "../../ui/dist/index61.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 { useWidgetConfig as n } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
11
+ import "../../../shared/feature/dist/index.js";
12
+ import { usePayableApprovalRequestsQuery as r } from "../../data-access/dist/index8.js";
13
+ import { usePayableHistoryQuery as i } from "../../data-access/dist/index9.js";
14
+ import { useAllPayableLineItemsQuery as a } from "../../data-access/dist/index10.js";
15
+ import { usePayableQuery as o } from "../../data-access/dist/index17.js";
16
+ import "../../data-access/dist/index.js";
17
+ import { BillDecisionDialog as s } from "../../ui/dist/index56.js";
18
+ import { BillDetailsSheet as c } from "../../ui/dist/index62.js";
19
+ import { BillDuplicateNotice as l } from "../../ui/dist/index66.js";
20
+ import { MarkAsPaidDialog as u } from "../../ui/dist/index96.js";
2
21
  import "../../ui/dist/index.js";
3
- import { MARK_AS_PAID_FLOW_LABELS_EN as t } from "./index16.js";
4
- import "./index19.js";
5
- import { APPROVAL_POLICY_RULE_COPY_EN as n } from "./index29.js";
6
- import { BILL_DETAIL_ACTIONS_LABELS_EN as r, PAYMENT_HISTORY_LABELS_EN as i, SCHEDULED_SUMMARY_LABEL_EN as a } from "./index46.js";
22
+ import { usePayableDuplicateReview as ne } from "./index13.js";
23
+ import "./index14.js";
24
+ import { canOverrideApprovalPolicy as re, canReadCounterpartBankAccounts as ie } from "./index19.js";
25
+ import { resolveAmountDueMinorUnits as ae } from "./index20.js";
26
+ import { usePayableAchInstructions as oe } from "../../../shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js";
27
+ import "../../../shared/counterpart-management/feature/dist/index.js";
28
+ import { PayBillFlow as d } from "./index26.js";
29
+ import "./index27.js";
30
+ import { mapPayableToBillDetails as f } from "./index41.js";
31
+ import { mergeMarkAsPaidFlowLabels as p } from "./index15.js";
32
+ import { useMarkAsPaidFlow as m } from "./index17.js";
33
+ import "./index18.js";
34
+ import { mergeDecisionDialogCopy as h, mergePaymentHistoryMethodLabels as g } from "./index45.js";
35
+ import { buildPaymentHistory as _ } from "./index3.js";
36
+ import { currentApprovalRound as se } from "./index4.js";
37
+ import { usePayableApprovalRoundStart as ce } from "./index31.js";
38
+ import { useApprovalPolicyCardView as le } from "./index32.js";
39
+ import { resolveBillRejectionNotice as ue } from "./index33.js";
40
+ import { useCurrentApprovalRequestId as de } from "./index34.js";
41
+ import { usePayableDetailActions as fe } from "./index35.js";
42
+ import { useScheduledPayment as pe } from "./index36.js";
43
+ import { BILL_DETAILS_LABELS_EN as v } from "./index62.js";
44
+ import { useMemo as y, useRef as me } from "react";
45
+ import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
7
46
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.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
- };
47
+ function C({ open: C, onOpenChange: w, payableId: T, onClose: E, onExpand: D, testId: O, labels: k, poweredByBankName: A }) {
48
+ let j = y(() => ({
49
+ ...v,
50
+ ...k,
51
+ sheet: {
52
+ ...v.sheet,
53
+ ...k?.sheet,
54
+ statusBadge: {
55
+ ...v.sheet.statusBadge,
56
+ ...k?.sheet?.statusBadge
57
+ },
58
+ approvalPolicy: {
59
+ ...v.sheet.approvalPolicy,
60
+ ...k?.sheet?.approvalPolicy
61
+ },
62
+ dueDate: {
63
+ ...v.sheet.dueDate,
64
+ ...k?.sheet?.dueDate
65
+ }
66
+ },
67
+ decisionDialog: h(v.decisionDialog, k?.decisionDialog),
68
+ approvalPolicyCopy: {
69
+ ...v.approvalPolicyCopy,
70
+ ...k?.approvalPolicyCopy
71
+ },
72
+ markAsPaid: p(k?.markAsPaid),
73
+ actionSuccess: {
74
+ ...v.actionSuccess,
75
+ ...k?.actionSuccess
76
+ },
77
+ paymentHistoryMethodLabels: g(k?.paymentHistoryMethodLabels)
78
+ }), [k]), M = o(T), N = a(T), P = ee(), { initResponse: F } = n(), I = M.data, L = me(null), R = de({
79
+ payableId: T,
80
+ status: I?.status
81
+ }), z = I?.status === "rejected", he = e(F?.scopes, [t.ApprovalRequestReadOrg]), B = z && he, V = ce({
82
+ payableId: T,
83
+ enabled: B
84
+ }), H = r(T, { enabled: B }), ge = e(F?.scopes, [t.UserReadOrg]), U = te({ enabled: z && ge }), W = y(() => se(H.data?.data, V.roundStartedAt), [H.data, V.roundStartedAt]), G = y(() => ue({
85
+ payableStatus: I?.status,
86
+ approvalRequests: W,
87
+ users: U.data?.data ?? [],
88
+ payableUpdatedAt: I?.updated_at,
89
+ labels: j
90
+ }), [
91
+ I?.status,
92
+ I?.updated_at,
93
+ W,
94
+ U.data,
95
+ j
96
+ ]), K = le({
97
+ payableId: T,
98
+ approvalPolicyId: I?.approval_policy_id,
99
+ copy: j.approvalPolicyCopy
100
+ }), _e = re({
101
+ status: I?.status,
102
+ scopes: F?.scopes,
103
+ arePendingApproversUnknown: K.isLoading,
104
+ hasApprovalPolicy: !!I?.approval_policy_id,
105
+ hasWaitingRequest: R.hasWaitingRequest
106
+ }), q = pe({
107
+ payableId: T,
108
+ scheduledPaymentDate: I?.scheduled_payment_date
109
+ }), ve = oe({
110
+ counterpartId: I?.counterpart_id,
111
+ currency: I?.currency,
112
+ enabled: ie(F?.scopes)
113
+ }), J = m({
114
+ payableId: T,
115
+ amountDueMinorUnits: ae(I) ?? 0,
116
+ amountToPayMinorUnits: I?.amount_to_pay ?? void 0,
117
+ currencyCode: I?.currency ?? void 0,
118
+ dueDate: I?.due_date,
119
+ hasScheduledPayment: q.hasScheduledPayment,
120
+ testId: O,
121
+ labels: j.markAsPaid
122
+ }), { actions: ye, decisionDialog: be } = fe({
123
+ payableId: I ? T : void 0,
124
+ status: I?.status,
125
+ currentApprovalRequestId: R.id,
126
+ hasScheduledPayment: q.hasScheduledPayment,
127
+ scheduledPaymentIntentId: q.scheduledPaymentIntentId,
128
+ isScheduledPaymentUnknown: q.isResolving,
129
+ isPayabilityUnknown: ve.isLoading,
130
+ hasApprovalPolicy: !!I?.approval_policy_id,
131
+ hasWaitingRequest: R.hasWaitingRequest,
132
+ pendingApprovers: K.pendingApprovers,
133
+ arePendingApproversUnknown: K.isLoading,
134
+ labels: {
135
+ payBill: j.sheet.payButton,
136
+ markAsPaid: j.sheet.markAsPaidButton,
137
+ reject: j.sheet.rejectButton,
138
+ approve: j.sheet.approveButton,
139
+ cancel: j.sheet.cancelButton,
140
+ cancelScheduledPayment: j.sheet.cancelScheduledPaymentButton,
141
+ reopen: j.sheet.reopenButton,
142
+ forceApprove: j.sheet.forceApproveButton,
143
+ forceReject: j.sheet.forceRejectButton,
144
+ policyOverridesHeading: j.sheet.policyOverridesGroup,
145
+ decisionDialog: j.decisionDialog,
146
+ actionError: j.actionError,
147
+ actionSuccess: j.actionSuccess
148
+ },
149
+ isMarkAsPaidPending: J.isPending,
150
+ onMarkAsPaidSelect: J.open,
151
+ onPayBillSelect: () => L.current?.open()
152
+ }), Y = q.hasScheduledPayment && q.scheduledDateLabel ? /* @__PURE__ */ x("p", {
153
+ className: "ttw:text-sm ttw:text-muted-foreground",
154
+ children: j.scheduledSummary(q.scheduledDateLabel)
155
+ }) : void 0, X = ne({
156
+ payable: I,
157
+ canManage: e(F?.scopes, [t.PayableWriteOrg])
158
+ }), Z = X.isPossibleDuplicate ? /* @__PURE__ */ x(l, {
159
+ onNotADuplicate: X.onNotADuplicate,
160
+ isActionDisabled: X.isBusy
161
+ }) : void 0, xe = Z || Y ? /* @__PURE__ */ S(b, { children: [Z, Y] }) : void 0, Q = i(T), Se = y(() => _({
162
+ records: q.paymentRecords,
163
+ events: Q.data?.data ?? [],
164
+ currencyCode: I?.currency,
165
+ labels: j
166
+ }), [
167
+ q.paymentRecords,
168
+ Q.data,
169
+ I?.currency,
170
+ j
171
+ ]), Ce = y(() => I ? f({
172
+ payable: I,
173
+ lineItems: N.lineItems,
174
+ ledgerAccounts: P.data?.data ?? [],
175
+ labels: j,
176
+ hasScheduledPayment: q.hasScheduledPayment,
177
+ rejection: G
178
+ }) : void 0, [
179
+ I,
180
+ N.lineItems,
181
+ P.data,
182
+ j,
183
+ q.hasScheduledPayment,
184
+ G
185
+ ]), we = M.isLoading || N.isResolving || P.isResolving, $ = M.isError || N.isError || P.isError;
186
+ return /* @__PURE__ */ S(b, { children: [
187
+ /* @__PURE__ */ x(c, {
188
+ open: C,
189
+ onOpenChange: w,
190
+ details: Ce,
191
+ actions: ye,
192
+ approvalPolicy: K.view,
193
+ showApprovalOverrideNotice: _e && !!I?.approval_policy_id,
194
+ paymentHistory: Se,
195
+ paymentHistoryError: q.isError || Q.isError,
196
+ paymentHistoryLoading: q.isResolving || Q.isLoading,
197
+ isLoading: we,
198
+ isError: $,
199
+ notice: xe,
200
+ onClose: E,
201
+ onExpand: D,
202
+ testId: O,
203
+ labels: j.sheet
204
+ }),
205
+ /* @__PURE__ */ x(s, {
206
+ ...be,
207
+ labels: { cancelButton: j.decisionDialog.cancelButton },
208
+ testId: O ? `${O}-decision-dialog` : void 0,
209
+ confirmTestId: O ? `${O}-decision-confirm` : void 0,
210
+ reasonTestId: O ? `${O}-decision-reason` : void 0,
211
+ reasonFieldId: O ? `${O}-decision-reason-field` : void 0
212
+ }),
213
+ /* @__PURE__ */ x(u, { ...J.dialogProps }),
214
+ I ? /* @__PURE__ */ x(d, {
215
+ ref: L,
216
+ payable: I,
217
+ onMissingAchInstructions: D,
218
+ poweredByBankName: A
219
+ }) : null
220
+ ] });
221
+ }
37
222
  //#endregion
38
- export { o as BILL_DETAILS_LABELS_EN };
223
+ export { C as BillDetailsContainer, C as default };
@@ -1,224 +1,3 @@
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 { useWidgetConfig as ne } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
11
- import "../../../shared/feature/dist/index.js";
12
- import { usePayableApprovalRequestsQuery as n } from "../../data-access/dist/index8.js";
13
- import { usePayableHistoryQuery as r } from "../../data-access/dist/index9.js";
14
- import { useAllPayableLineItemsQuery as i } from "../../data-access/dist/index10.js";
15
- import { usePayableQuery as a } from "../../data-access/dist/index17.js";
16
- import "../../data-access/dist/index.js";
17
- import { BillDecisionDialog as o } from "../../ui/dist/index56.js";
18
- import { BillDetailsSheet as s } from "../../ui/dist/index62.js";
19
- import { BillDuplicateNotice as c } from "../../ui/dist/index66.js";
20
- import { MarkAsPaidDialog as l } from "../../ui/dist/index96.js";
21
- import "../../ui/dist/index.js";
22
- import { usePayableDuplicateReview as u } from "./index14.js";
23
- import "./index15.js";
24
- import { canOverrideApprovalPolicy as d, canReadCounterpartBankAccounts as f } from "./index20.js";
25
- import { resolveAmountDueMinorUnits as p } from "./index21.js";
26
- import { usePayableAchInstructions as m } from "../../../shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js";
27
- import "../../../shared/counterpart-management/feature/dist/index.js";
28
- import { PayBillFlow as h } from "./index27.js";
29
- import "./index28.js";
30
- import { mapPayableToBillDetails as g } from "./index42.js";
31
- import { mergeMarkAsPaidFlowLabels as re } from "./index16.js";
32
- import { useMarkAsPaidFlow as ie } from "./index18.js";
33
- import "./index19.js";
34
- import { mergeDecisionDialogCopy as ae, mergePaymentHistoryMethodLabels as oe } from "./index46.js";
35
- import { buildPaymentHistory as se } from "./index3.js";
36
- import { currentApprovalRound as ce } from "./index4.js";
37
- import { useIsApprovalPolicyAssignmentSettled as le } from "./index5.js";
38
- import { usePayableApprovalRoundStart as ue } from "./index32.js";
39
- import { useApprovalPolicyCardView as de } from "./index33.js";
40
- import { resolveBillRejectionNotice as fe } from "./index34.js";
41
- import { useCurrentApprovalRequestId as pe } from "./index35.js";
42
- import { usePayableDetailActions as me } from "./index36.js";
43
- import { useScheduledPayment as he } from "./index37.js";
44
- import { BILL_DETAILS_LABELS_EN as _ } from "./index63.js";
45
- import { useMemo as v, useRef as ge } from "react";
46
- import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
47
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js
48
- function S({ open: S, onOpenChange: C, payableId: w, onClose: T, onExpand: E, testId: D, labels: O, poweredByBankName: k }) {
49
- let A = v(() => ({
50
- ..._,
51
- ...O,
52
- sheet: {
53
- ..._.sheet,
54
- ...O?.sheet,
55
- statusBadge: {
56
- ..._.sheet.statusBadge,
57
- ...O?.sheet?.statusBadge
58
- },
59
- approvalPolicy: {
60
- ..._.sheet.approvalPolicy,
61
- ...O?.sheet?.approvalPolicy
62
- },
63
- dueDate: {
64
- ..._.sheet.dueDate,
65
- ...O?.sheet?.dueDate
66
- }
67
- },
68
- decisionDialog: ae(_.decisionDialog, O?.decisionDialog),
69
- approvalPolicyCopy: {
70
- ..._.approvalPolicyCopy,
71
- ...O?.approvalPolicyCopy
72
- },
73
- markAsPaid: re(O?.markAsPaid),
74
- actionSuccess: {
75
- ..._.actionSuccess,
76
- ...O?.actionSuccess
77
- },
78
- paymentHistoryMethodLabels: oe(O?.paymentHistoryMethodLabels)
79
- }), [O]), j = a(w, { pollWhilePolicyAssignmentUnsettled: !0 }), M = i(w), N = ee(), { initResponse: P } = ne(), F = j.data, I = ge(null), L = pe({
80
- payableId: w,
81
- status: F?.status
82
- }), R = F?.status === "rejected", _e = e(P?.scopes, [t.ApprovalRequestReadOrg]), z = R && _e, B = ue({
83
- payableId: w,
84
- enabled: z
85
- }), V = n(w, { enabled: z }), ve = e(P?.scopes, [t.UserReadOrg]), H = te({ enabled: R && ve }), U = v(() => ce(V.data?.data, B.roundStartedAt), [V.data, B.roundStartedAt]), W = v(() => fe({
86
- payableStatus: F?.status,
87
- approvalRequests: U,
88
- users: H.data?.data ?? [],
89
- payableUpdatedAt: F?.updated_at,
90
- labels: A
91
- }), [
92
- F?.status,
93
- F?.updated_at,
94
- U,
95
- H.data,
96
- A
97
- ]), G = de({
98
- payableId: w,
99
- approvalPolicyId: F?.approval_policy_id,
100
- copy: A.approvalPolicyCopy
101
- }), K = !le(F), ye = d({
102
- status: F?.status,
103
- scopes: P?.scopes,
104
- arePendingApproversUnknown: G.isLoading || K,
105
- hasApprovalPolicy: !!F?.approval_policy_id,
106
- hasWaitingRequest: L.hasWaitingRequest
107
- }), q = he({
108
- payableId: w,
109
- scheduledPaymentDate: F?.scheduled_payment_date
110
- }), be = m({
111
- counterpartId: F?.counterpart_id,
112
- currency: F?.currency,
113
- enabled: f(P?.scopes)
114
- }), J = ie({
115
- payableId: w,
116
- amountDueMinorUnits: p(F) ?? 0,
117
- amountToPayMinorUnits: F?.amount_to_pay ?? void 0,
118
- currencyCode: F?.currency ?? void 0,
119
- dueDate: F?.due_date,
120
- hasScheduledPayment: q.hasScheduledPayment,
121
- testId: D,
122
- labels: A.markAsPaid
123
- }), { actions: xe, decisionDialog: Se } = me({
124
- payableId: F ? w : void 0,
125
- status: F?.status,
126
- currentApprovalRequestId: L.id,
127
- hasScheduledPayment: q.hasScheduledPayment,
128
- scheduledPaymentIntentId: q.scheduledPaymentIntentId,
129
- isScheduledPaymentUnknown: q.isResolving,
130
- isPayabilityUnknown: be.isLoading,
131
- hasApprovalPolicy: !!F?.approval_policy_id,
132
- hasWaitingRequest: L.hasWaitingRequest,
133
- pendingApprovers: G.pendingApprovers,
134
- arePendingApproversUnknown: G.isLoading || K,
135
- labels: {
136
- payBill: A.sheet.payButton,
137
- markAsPaid: A.sheet.markAsPaidButton,
138
- reject: A.sheet.rejectButton,
139
- approve: A.sheet.approveButton,
140
- cancel: A.sheet.cancelButton,
141
- cancelScheduledPayment: A.sheet.cancelScheduledPaymentButton,
142
- reopen: A.sheet.reopenButton,
143
- forceApprove: A.sheet.forceApproveButton,
144
- forceReject: A.sheet.forceRejectButton,
145
- policyOverridesHeading: A.sheet.policyOverridesGroup,
146
- decisionDialog: A.decisionDialog,
147
- actionError: A.actionError,
148
- actionSuccess: A.actionSuccess
149
- },
150
- isMarkAsPaidPending: J.isPending,
151
- onMarkAsPaidSelect: J.open,
152
- onPayBillSelect: () => I.current?.open()
153
- }), Y = q.hasScheduledPayment && q.scheduledDateLabel ? /* @__PURE__ */ b("p", {
154
- className: "ttw:text-sm ttw:text-muted-foreground",
155
- children: A.scheduledSummary(q.scheduledDateLabel)
156
- }) : void 0, X = u({
157
- payable: F,
158
- canManage: e(P?.scopes, [t.PayableWriteOrg])
159
- }), Z = X.isPossibleDuplicate ? /* @__PURE__ */ b(c, {
160
- onNotADuplicate: X.onNotADuplicate,
161
- isActionDisabled: X.isBusy
162
- }) : void 0, Ce = Z || Y ? /* @__PURE__ */ x(y, { children: [Z, Y] }) : void 0, Q = r(w), $ = v(() => se({
163
- records: q.paymentRecords,
164
- events: Q.data?.data ?? [],
165
- currencyCode: F?.currency,
166
- labels: A
167
- }), [
168
- q.paymentRecords,
169
- Q.data,
170
- F?.currency,
171
- A
172
- ]), we = v(() => F ? g({
173
- payable: F,
174
- lineItems: M.lineItems,
175
- ledgerAccounts: N.data?.data ?? [],
176
- labels: A,
177
- hasScheduledPayment: q.hasScheduledPayment,
178
- rejection: W
179
- }) : void 0, [
180
- F,
181
- M.lineItems,
182
- N.data,
183
- A,
184
- q.hasScheduledPayment,
185
- W
186
- ]), Te = j.isLoading || M.isResolving || N.isResolving, Ee = j.isError || M.isError || N.isError;
187
- return /* @__PURE__ */ x(y, { children: [
188
- /* @__PURE__ */ b(s, {
189
- open: S,
190
- onOpenChange: C,
191
- details: we,
192
- actions: xe,
193
- approvalPolicy: G.view,
194
- showApprovalOverrideNotice: ye && !!F?.approval_policy_id,
195
- paymentHistory: $,
196
- paymentHistoryError: q.isError || Q.isError,
197
- paymentHistoryLoading: q.isResolving || Q.isLoading,
198
- isLoading: Te,
199
- isError: Ee,
200
- notice: Ce,
201
- onClose: T,
202
- onExpand: E,
203
- testId: D,
204
- labels: A.sheet
205
- }),
206
- /* @__PURE__ */ b(o, {
207
- ...Se,
208
- labels: { cancelButton: A.decisionDialog.cancelButton },
209
- testId: D ? `${D}-decision-dialog` : void 0,
210
- confirmTestId: D ? `${D}-decision-confirm` : void 0,
211
- reasonTestId: D ? `${D}-decision-reason` : void 0,
212
- reasonFieldId: D ? `${D}-decision-reason-field` : void 0
213
- }),
214
- /* @__PURE__ */ b(l, { ...J.dialogProps }),
215
- F ? /* @__PURE__ */ b(h, {
216
- ref: I,
217
- payable: F,
218
- onMissingAchInstructions: E,
219
- poweredByBankName: k
220
- }) : null
221
- ] });
222
- }
223
- //#endregion
224
- export { S as BillDetailsContainer, S as default };
1
+ import "./index41.js";
2
+ import "./index62.js";
3
+ import "./index63.js";
@@ -1,3 +1,4 @@
1
- import "./index42.js";
2
- import "./index63.js";
3
- import "./index64.js";
1
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js
2
+ var e = { Mounted: "bill_pay_widget.mounted" }, t = "bill_pay_widget";
3
+ //#endregion
4
+ export { e as BillPayWidgetAnalyticsEvent, t as WIDGET_NAME };
@@ -1,4 +1,46 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
6
+ import "../../../shared/feature/dist/index.js";
7
+ import { BillPayWidgetAnalyticsEvent as t, WIDGET_NAME as n } from "./index65.js";
8
+ import { Payables as r } from "../../../monite-sdk/dist/index441.js";
9
+ import "../../../monite-sdk/dist/index.js";
10
+ import { MoniteRegionProvider as i } from "../../../shared/monite-wrapper/feature/dist/lib/MoniteRegionProvider.js";
11
+ import "../../../shared/monite-wrapper/feature/dist/index.js";
12
+ import { useEffect as a } from "react";
13
+ import { jsx as o } from "react/jsx-runtime";
1
14
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js
2
- var e = { Mounted: "bill_pay_widget.mounted" }, t = "bill_pay_widget";
15
+ var s = (e) => e;
16
+ function c(n) {
17
+ let i = e();
18
+ return a(() => {
19
+ i(t.Mounted);
20
+ }, [i]), /* @__PURE__ */ o(r, { ...n });
21
+ }
22
+ function l({ baseUrl: e, widgetToken: t, organizationId: r, configClient: a, gatewayRouting: l, linkComponent: u, implementation: d, uiFramework: f, errorFallback: p, onError: m, finopsThemeColors: h, analytics: g, disclosuresAcceptance: _, providerLabels: v, pageTitleComponent: y = s, ...b }) {
23
+ return /* @__PURE__ */ o(i, {
24
+ widgetName: n,
25
+ baseUrl: e,
26
+ widgetToken: t,
27
+ organizationId: r,
28
+ configClient: a,
29
+ gatewayRouting: l,
30
+ linkComponent: u,
31
+ implementation: d,
32
+ uiFramework: f,
33
+ errorFallback: p,
34
+ onError: m,
35
+ finopsThemeColors: h,
36
+ analytics: g,
37
+ disclosuresAcceptance: _,
38
+ providerLabels: v,
39
+ children: /* @__PURE__ */ o(c, {
40
+ ...b,
41
+ pageTitleComponent: y
42
+ })
43
+ });
44
+ }
3
45
  //#endregion
4
- export { e as BillPayWidgetAnalyticsEvent, t as WIDGET_NAME };
46
+ export { l as BillPayWidgetMonite, l as default };
@@ -1,46 +1 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
6
- import "../../../shared/feature/dist/index.js";
7
- import { BillPayWidgetAnalyticsEvent as t, WIDGET_NAME as n } from "./index66.js";
8
- import { Payables as r } from "../../../monite-sdk/dist/index441.js";
9
- import "../../../monite-sdk/dist/index.js";
10
- import { MoniteRegionProvider as i } from "../../../shared/monite-wrapper/feature/dist/lib/MoniteRegionProvider.js";
11
- import "../../../shared/monite-wrapper/feature/dist/index.js";
12
- import { useEffect as a } from "react";
13
- import { jsx as o } from "react/jsx-runtime";
14
- //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js
15
- var s = (e) => e;
16
- function c(n) {
17
- let i = e();
18
- return a(() => {
19
- i(t.Mounted);
20
- }, [i]), /* @__PURE__ */ o(r, { ...n });
21
- }
22
- function l({ baseUrl: e, widgetToken: t, organizationId: r, configClient: a, gatewayRouting: l, linkComponent: u, implementation: d, uiFramework: f, errorFallback: p, onError: m, finopsThemeColors: h, analytics: g, disclosuresAcceptance: _, providerLabels: v, pageTitleComponent: y = s, ...b }) {
23
- return /* @__PURE__ */ o(i, {
24
- widgetName: n,
25
- baseUrl: e,
26
- widgetToken: t,
27
- organizationId: r,
28
- configClient: a,
29
- gatewayRouting: l,
30
- linkComponent: u,
31
- implementation: d,
32
- uiFramework: f,
33
- errorFallback: p,
34
- onError: m,
35
- finopsThemeColors: h,
36
- analytics: g,
37
- disclosuresAcceptance: _,
38
- providerLabels: v,
39
- children: /* @__PURE__ */ o(c, {
40
- ...b,
41
- pageTitleComponent: y
42
- })
43
- });
44
- }
45
- //#endregion
46
- export { l as BillPayWidgetMonite, l as default };
1
+ import "./index66.js";
@@ -1 +1,8 @@
1
- import "./index67.js";
1
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js
2
+ var e = (e) => [
3
+ "bill-pay",
4
+ "upload-queue",
5
+ e ?? ""
6
+ ];
7
+ //#endregion
8
+ export { e as billPayUploadQueueKey };
@@ -1,8 +1,12 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js
2
- var e = (e) => [
3
- "bill-pay",
4
- "upload-queue",
5
- e ?? ""
6
- ];
2
+ var e = {
3
+ uploadingSummary: (e) => `Uploading and scanning ${e} ${e === 1 ? "file" : "files"}`,
4
+ completeSummary: (e) => `${e} ${e === 1 ? "upload" : "uploads"} complete`,
5
+ readyCaption: (e) => `${e} new ${e === 1 ? "bill" : "bills"} ready`,
6
+ duplicateCaption: (e) => `${e} possible ${e === 1 ? "duplicate" : "duplicates"}`,
7
+ failedCaption: (e) => `${e} failed to upload`,
8
+ tooManyFilesError: (e) => `You can only upload up to ${e} files at a time`,
9
+ remainingCapacityError: (e) => e === 0 ? "Wait for the current uploads to finish before adding more files" : `You can upload ${e} more ${e === 1 ? "file" : "files"} right now`
10
+ };
7
11
  //#endregion
8
- export { e as billPayUploadQueueKey };
12
+ export { e as BILL_UPLOAD_QUEUE_LABELS_EN };