@tesouro/embedded-components-react 0.11.170 → 0.11.172

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/index.d.ts +6 -0
  2. package/dist/lib/ReceivablesWidget.d.ts +6 -0
  3. package/dist/lib/WidgetSuite.d.ts +6 -0
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js +75 -66
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +62 -53
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +44 -38
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +331 -326
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +10 -8
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +190 -187
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index14.js +12 -19
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index15.js +25 -23
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index33.js +4 -7
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index34.js +23 -24
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index5.js +5 -5
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +196 -187
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +6 -1
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index8.js +20 -17
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +11 -14
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +157 -161
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index5.js +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index6.js +1 -1
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +4 -8
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +5 -27
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +32 -2
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +2 -29
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/util/dist/index.js +7 -6
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/util/dist/lib/resolveBillDueDate.js +22 -0
  28. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/details.js +116 -98
  29. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/helpers.js +99 -92
  30. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/labels.js +7 -1
  31. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/lib/ReceivablesWidget/recurringSeries.js +15 -24
  32. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index60.js +59 -69
  33. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  34. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +7 -5
  35. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/DateDisclosure/DateDisclosure.js +28 -0
  36. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/DueDateText/DueDateText.js +19 -0
  37. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/index.js +28 -27
  38. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/dueDateDisplay.js +23 -0
  39. package/package.json +1 -1
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +0 -2
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +0 -6
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +0 -33
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +0 -2
@@ -16,33 +16,34 @@ import { hasSuspectedPayableDuplicate as s, suspectedPayableDuplicates as c } fr
16
16
  import { compareByArrival as l, duplicateVerdictMatches as u, resolveDuplicateOriginalId as d } from "../../../util/dist/lib/groupDuplicates.js";
17
17
  import { isEditablePayableStatus as f } from "../../../util/dist/lib/isEditablePayableStatus.js";
18
18
  import { payableRemoval as p } from "../../../util/dist/lib/payableRemoval.js";
19
+ import { resolveBillDueDate as m } from "../../../util/dist/lib/resolveBillDueDate.js";
19
20
  import { resolveVendorName as ee } from "../../../util/dist/lib/resolveVendor.js";
20
- import { buildGroupCollapse as m } from "../../../util/dist/lib/groupCollapse.js";
21
+ import { buildGroupCollapse as h } from "../../../util/dist/lib/groupCollapse.js";
21
22
  import "../../../util/dist/index.js";
22
23
  import { derivePayableStatus as te } from "../../../../shared/document-status/util/dist/lib/derivePayableStatus.js";
23
- import { useApplyDuplicateVerdictsMutation as h } from "../../../data-access/dist/lib/useApplyDuplicateVerdictsMutation.js";
24
+ import { useApplyDuplicateVerdictsMutation as g } from "../../../data-access/dist/lib/useApplyDuplicateVerdictsMutation.js";
24
25
  import "../../../data-access/dist/index.js";
25
- import { BillColumn as g } from "../../ui/dist/index19.js";
26
+ import { BillColumn as _ } from "../../ui/dist/index19.js";
26
27
  import "../../ui/dist/index.js";
27
- import { BillQueue as _, DEFAULT_BILL_QUEUE as ne, billQueueColumns as v, billQueueFilters as re, billQueueOffersAddPanel as ie, billSortColumnId as ae, billSortField as oe } from "./index5.js";
28
- import { duplicateRemovalPrompt as se } from "./index11.js";
29
- import { useBillsFilters as ce } from "./index14.js";
30
- import { BillVendorLookup as le, useBillVendorNames as ue } from "./index15.js";
31
- import { useFirstPayablesPagesQuery as de } from "../../data-access/dist/index2.js";
32
- import { usePayablesQuery as fe } from "../../data-access/dist/index4.js";
33
- import { usePayablesTotalCountQuery as pe } from "../../data-access/dist/index5.js";
28
+ import { BillQueue as v, DEFAULT_BILL_QUEUE as y, billQueueColumns as b, billQueueFilters as x, billQueueOffersAddPanel as ne, billSortColumnId as re, billSortField as ie } from "./index5.js";
29
+ import { duplicateRemovalPrompt as ae } from "./index11.js";
30
+ import { useBillsFilters as oe } from "./index14.js";
31
+ import { BillVendorLookup as se, useBillVendorNames as ce } from "./index15.js";
32
+ import { useFirstPayablesPagesQuery as le } from "../../data-access/dist/index2.js";
33
+ import { usePayablesQuery as ue } from "../../data-access/dist/index4.js";
34
+ import { usePayablesTotalCountQuery as de } from "../../data-access/dist/index5.js";
34
35
  import "../../data-access/dist/index.js";
35
- import { useCallback as y, useEffect as me, useMemo as b, useState as x } from "react";
36
- import { BanIcon as he, FileCheckIcon as ge, Trash2Icon as _e } from "lucide-react";
36
+ import { useCallback as S, useEffect as fe, useMemo as C, useState as w } from "react";
37
+ import { BanIcon as pe, FileCheckIcon as me, Trash2Icon as he } from "lucide-react";
37
38
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js
38
- var ve = 10, S = 100, ye = 3, be = [{
39
+ var ge = 10, T = 100, _e = 3, ve = [{
39
40
  id: "addedOnLabel",
40
41
  desc: !0
41
- }], C = {
42
+ }], E = {
42
43
  AllBills: "allBills",
43
44
  PossibleDuplicates: "possibleDuplicates"
44
45
  };
45
- function xe(e, t) {
46
+ function ye(e, t) {
46
47
  let n = new Map(e.map((e) => [e.id, e])), r = /* @__PURE__ */ new Map(), i = (e) => {
47
48
  r.has(e) || r.set(e, /* @__PURE__ */ new Set());
48
49
  }, a = (e, t) => {
@@ -65,11 +66,11 @@ function xe(e, t) {
65
66
  for (let t of r.get(e) ?? []) s.has(t) || (s.add(t), a.push(t));
66
67
  }
67
68
  if (i.length === 0) continue;
68
- let c = i.map((e) => n.get(e)).filter((e) => !!e).sort(l), u = d(c), [f] = c, p = ee(f), m = f?.document_id ?? "", te = u ?? f?.id ?? e, h = `duplicate-group:${p || m ? `${p}|${m}` : te}`;
69
+ let c = i.map((e) => n.get(e)).filter((e) => !!e).sort(l), u = d(c), [f] = c, p = ee(f), m = f?.document_id ?? "", h = u ?? f?.id ?? e, te = `duplicate-group:${p || m ? `${p}|${m}` : h}`;
69
70
  o.push({
70
71
  componentIds: i,
71
- baseKey: h,
72
- anchorId: te,
72
+ baseKey: te,
73
+ anchorId: h,
73
74
  group: {
74
75
  label: t.groupHeader({
75
76
  vendorLabel: p,
@@ -95,68 +96,68 @@ function xe(e, t) {
95
96
  }
96
97
  return f;
97
98
  }
98
- function Se({ enabled: c = !0, canPay: d, canReadVendors: m = !0, isVendorFilterPaused: le = !1, filterLabels: Se, onOpenBill: Ee, duplicateRowNote: De, attachmentLabel: Oe, duplicateGroupLabels: w, canManageDuplicates: ke = !1, duplicateView: T = C.AllBills, scheduledRelativeDayLabels: Ae }) {
99
- let je = i(), [E, Me] = x(ne), [Ne, Pe] = x(be), [D, Fe] = x(ve), [Ie, O] = x(), [Le, Re] = x(d);
100
- d !== void 0 && Le !== d && (Re(d), O(void 0));
101
- let k = d ?? Le, [ze, A] = x(0), [j, M] = x(""), [N, Be] = x(""), [P, F] = x(), [I, Ve] = x(), L = y(() => {
102
- O(void 0), A(0);
99
+ function be({ enabled: c = !0, canPay: d, canReadVendors: h = !0, isVendorFilterPaused: se = !1, filterLabels: be, onOpenBill: we, duplicateRowNote: Te, attachmentLabel: Ee, duplicateGroupLabels: D, canManageDuplicates: De = !1, duplicateView: O = E.AllBills, scheduledRelativeDayLabels: Oe, dueDateLabels: ke }) {
100
+ let k = i(), [A, Ae] = w(y), [je, Me] = w(ve), [j, Ne] = w(ge), [Pe, M] = w(), [Fe, Ie] = w(d);
101
+ d !== void 0 && Fe !== d && (Ie(d), M(void 0));
102
+ let Le = d ?? Fe, [Re, ze] = w(0), [N, Be] = w(""), [P, Ve] = w(""), [F, He] = w(), [I, Ue] = w(), L = S(() => {
103
+ M(void 0), ze(0);
103
104
  }, []);
104
- me(() => {
105
- if (j === N) return;
105
+ fe(() => {
106
+ if (N === P) return;
106
107
  let e = setTimeout(() => {
107
- Be(j), L();
108
+ Ve(N), L();
108
109
  }, 300);
109
110
  return () => clearTimeout(e);
110
111
  }, [
111
- j,
112
112
  N,
113
+ P,
113
114
  L
114
- ]), me(() => {
115
+ ]), fe(() => {
115
116
  L();
116
- }, [T, L]);
117
- let R = T === C.PossibleDuplicates, z = ce({
118
- offersStatusFilter: E === _.All && !R,
119
- offersVendorFilter: m,
120
- isVendorFilterPaused: le,
121
- labels: Se,
117
+ }, [O, L]);
118
+ let R = O === E.PossibleDuplicates, z = oe({
119
+ offersStatusFilter: A === v.All && !R,
120
+ offersVendorFilter: h,
121
+ isVendorFilterPaused: se,
122
+ labels: be,
122
123
  onFiltersChange: L
123
- }), { clearAll: He, filterByVendor: Ue } = z, We = Ne[0], Ge = oe(We?.id), Ke = Ge ? We?.desc ? "desc" : "asc" : void 0, B = R ? _.All : E, qe = b(() => {
124
- let e = re(B, k ?? !1);
124
+ }), { clearAll: We, filterByVendor: Ge } = z, Ke = je[0], qe = ie(Ke?.id), Je = qe ? Ke?.desc ? "desc" : "asc" : void 0, B = R ? v.All : A, Ye = C(() => {
125
+ let e = x(B, Le ?? !1);
125
126
  return {
126
127
  ...z.query,
127
128
  ...e,
128
- limit: R ? S : D,
129
- pagination_token: R ? void 0 : Ie,
129
+ limit: R ? T : j,
130
+ pagination_token: R ? void 0 : Pe,
130
131
  status__in: R ? void 0 : e.status__in ?? z.query.status__in,
131
132
  duplicate_match_status: R ? "suspected" : void 0,
132
- counterpart_name__icontains: N || void 0,
133
- sort: Ge,
134
- order: Ke
133
+ counterpart_name__icontains: P || void 0,
134
+ sort: qe,
135
+ order: Je
135
136
  };
136
137
  }, [
137
138
  z.query,
138
- D,
139
- Ie,
139
+ j,
140
+ Pe,
140
141
  R,
141
142
  B,
142
- k,
143
- N,
144
- Ge,
145
- Ke
146
- ]), { organizationId: Je } = r(), V = JSON.stringify([Je, qe]), H = fe({
147
- ...qe,
143
+ Le,
144
+ P,
145
+ qe,
146
+ Je
147
+ ]), { organizationId: Xe } = r(), V = JSON.stringify([Xe, Ye]), H = ue({
148
+ ...Ye,
148
149
  enabled: c && d !== void 0 && !R,
149
150
  pollWhileOcrProcessing: !0
150
- }), U = de({
151
- ...qe,
151
+ }), U = le({
152
+ ...Ye,
152
153
  enabled: c && R,
153
- maxPages: ye
154
+ maxPages: _e
154
155
  }), W = R ? {
155
156
  ...U,
156
157
  data: { data: U.payables },
157
158
  isLoading: U.isResolving,
158
159
  isFetching: U.isFetching || U.isResolving
159
- } : H, G = (W.data?.data ?? []).filter((e) => e.ocr_status !== "processing"), K = h(), q = y(async (t, n, r, i) => {
160
+ } : H, G = (W.data?.data ?? []).filter((e) => e.ocr_status !== "processing"), K = g(), q = S(async (t, n, r, i) => {
160
161
  let a = u(t, n, i);
161
162
  if (a.length) try {
162
163
  await K.mutateAsync({
@@ -169,54 +170,54 @@ function Se({ enabled: c = !0, canPay: d, canReadVendors: m = !0, isVendorFilter
169
170
  }))
170
171
  }), e.success(r);
171
172
  } catch {
172
- e.error(w.actionFailedToast);
173
+ e.error(D.actionFailedToast);
173
174
  }
174
- }, [K, w.actionFailedToast]), J = b(() => ({
175
+ }, [K, D.actionFailedToast]), J = C(() => ({
175
176
  delete: {
176
- action: w.deleteAction,
177
- title: w.deleteConfirmTitle,
178
- description: w.deleteConfirmDescription,
179
- confirmButton: w.deleteConfirmButton,
180
- backButton: w.cancelConfirmBackButton,
181
- toast: w.deletedToast
177
+ action: D.deleteAction,
178
+ title: D.deleteConfirmTitle,
179
+ description: D.deleteConfirmDescription,
180
+ confirmButton: D.deleteConfirmButton,
181
+ backButton: D.cancelConfirmBackButton,
182
+ toast: D.deletedToast
182
183
  },
183
184
  cancel: {
184
- action: w.cancelAction,
185
- title: w.cancelConfirmTitle,
186
- description: w.cancelConfirmDescription,
187
- confirmButton: w.cancelConfirmButton,
188
- backButton: w.cancelConfirmBackButton,
189
- toast: w.cancelledToast
185
+ action: D.cancelAction,
186
+ title: D.cancelConfirmTitle,
187
+ description: D.cancelConfirmDescription,
188
+ confirmButton: D.cancelConfirmButton,
189
+ backButton: D.cancelConfirmBackButton,
190
+ toast: D.cancelledToast
190
191
  },
191
192
  confirm: {
192
- action: w.confirmAction,
193
- title: w.confirmDuplicateTitle,
194
- description: w.confirmDuplicateDescription,
195
- confirmButton: w.confirmDuplicateButton,
196
- backButton: w.cancelConfirmBackButton,
197
- toast: w.confirmedToast
193
+ action: D.confirmAction,
194
+ title: D.confirmDuplicateTitle,
195
+ description: D.confirmDuplicateDescription,
196
+ confirmButton: D.confirmDuplicateButton,
197
+ backButton: D.cancelConfirmBackButton,
198
+ toast: D.confirmedToast
198
199
  }
199
- }), [w]), Ye = P?.removeBy ?? "cancel", Xe = y(async () => {
200
- P && (await q(P.payable, a.Remove, J[P.removeBy].toast), F(void 0));
200
+ }), [D]), Ze = F?.removeBy ?? "cancel", Qe = S(async () => {
201
+ F && (await q(F.payable, a.Remove, J[F.removeBy].toast), He(void 0));
201
202
  }, [
202
203
  q,
203
- P,
204
+ F,
204
205
  J
205
- ]), Ze = y(async () => {
206
- I && (await q(I.payable, a.Keep, w.dismissedToast, I.originalPayableId), Ve(void 0));
206
+ ]), $e = S(async () => {
207
+ I && (await q(I.payable, a.Keep, D.dismissedToast, I.originalPayableId), Ue(void 0));
207
208
  }, [
208
209
  q,
209
- w.dismissedToast,
210
+ D.dismissedToast,
210
211
  I
211
- ]), [Qe, $e] = x(V);
212
- me(() => {
213
- W.isFetching || $e(V);
212
+ ]), [et, tt] = w(V);
213
+ fe(() => {
214
+ W.isFetching || tt(V);
214
215
  }, [W.isFetching, V]);
215
- let et = W.data?.data.length, tt = et === 0, nt = pe({ enabled: c && tt }), rt = !tt || (nt.data?.count ?? 1) > 0, Y = b(() => T === C.PossibleDuplicates ? xe(G, w) : /* @__PURE__ */ new Map(), [
216
- T,
216
+ let nt = W.data?.data.length, rt = nt === 0, it = de({ enabled: c && rt }), at = !rt || (it.data?.count ?? 1) > 0, Y = C(() => O === E.PossibleDuplicates ? ye(G, D) : /* @__PURE__ */ new Map(), [
217
+ O,
217
218
  G,
218
- w
219
- ]), it = b(() => {
219
+ D
220
+ ]), ot = C(() => {
220
221
  if (Y.size === 0) return G;
221
222
  let e = /* @__PURE__ */ new Map();
222
223
  return G.forEach((t, n) => {
@@ -227,191 +228,199 @@ function Se({ enabled: c = !0, canPay: d, canReadVendors: m = !0, isVendorFilter
227
228
  index: n,
228
229
  order: e.get(Y.get(t.id)?.key ?? "") ?? n
229
230
  })).sort((e, t) => e.order - t.order || l(e.payable, t.payable) || e.index - t.index).map(({ payable: e }) => e);
230
- }, [G, Y]), { vendorNames: X, lookup: at } = ue({
231
+ }, [G, Y]), { vendorNames: X, lookup: st } = ce({
231
232
  payables: W.data?.data,
232
233
  enabled: c,
233
- canReadVendors: m,
234
- isPaused: le
235
- }), ot = y((e) => {
234
+ canReadVendors: h,
235
+ isPaused: se
236
+ }), ct = S((e) => {
236
237
  let t = e.title || (e.vendorCounterpartId ? X.get(e.vendorCounterpartId) ?? "" : "");
237
238
  return {
238
239
  key: e.key,
239
- label: t === e.title ? e.label : w.groupHeader({
240
+ label: t === e.title ? e.label : D.groupHeader({
240
241
  vendorLabel: t,
241
242
  invoiceNumberLabel: e.invoiceNumberLabel
242
243
  }),
243
244
  title: t,
244
245
  meta: e.meta
245
246
  };
246
- }, [X, w]), Z = b(() => Ce(it.map((e) => {
247
+ }, [X, D]), Z = C(() => xe(ot.map((e) => {
247
248
  let r = te({
248
249
  apiStatus: e.status,
249
250
  dueDate: e.due_date,
250
251
  scheduledPaymentDate: e.scheduled_payment_date
251
- }), i = e.amount_due ?? e.total_amount, a = e.status === "partially_paid" || e.status === "paid", c = (t) => t == null ? "" : n(t / 100, { currencyCode: e.currency ?? "USD" }), l = o(e.scheduled_payment_date, Ae, je), u = Y.get(e.id), d = s(e), m = ee(e) || (e.counterpart_id ? X.get(e.counterpart_id) ?? "" : ""), h = e.document_id ?? "", g = p(e.status), ne = u?.originalPayableId !== void 0 && u.originalPayableId === e.id, v = R && d && ke && u ? {
252
- triggerLabel: w.menuTrigger({
253
- vendorLabel: m,
254
- invoiceNumberLabel: h
252
+ }), i = e.amount_due ?? e.total_amount, a = e.status === "partially_paid" || e.status === "paid", c = (t) => t == null ? "" : n(t / 100, { currencyCode: e.currency ?? "USD" }), l = o(e.scheduled_payment_date, Oe, k), u = m({
253
+ status: e.status,
254
+ dueDate: e.due_date,
255
+ today: k,
256
+ isScheduled: r.status === "scheduled",
257
+ labels: ke
258
+ }), d = Y.get(e.id), h = s(e), g = ee(e) || (e.counterpart_id ? X.get(e.counterpart_id) ?? "" : ""), _ = e.document_id ?? "", y = p(e.status), b = d?.originalPayableId !== void 0 && d.originalPayableId === e.id, x = R && h && De && d ? {
259
+ triggerLabel: D.menuTrigger({
260
+ vendorLabel: g,
261
+ invoiceNumberLabel: _
255
262
  }),
256
263
  items: [{
257
264
  id: "not-duplicate",
258
- label: w.notDuplicateAction,
259
- icon: ge,
265
+ label: D.notDuplicateAction,
266
+ icon: me,
260
267
  disabled: K.isPending,
261
- onSelect: () => Ve({
268
+ onSelect: () => Ue({
262
269
  payable: e,
263
- originalPayableId: ne ? void 0 : u.originalPayableId
270
+ originalPayableId: b ? void 0 : d.originalPayableId
264
271
  })
265
- }, ...g ? [{
272
+ }, ...y ? [{
266
273
  id: "cancel-duplicate",
267
- label: J[g].action,
268
- icon: g === "delete" ? _e : he,
274
+ label: J[y].action,
275
+ icon: y === "delete" ? he : pe,
269
276
  disabled: K.isPending,
270
- onSelect: () => F({
277
+ onSelect: () => He({
271
278
  payable: e,
272
- removeBy: g
279
+ removeBy: y
273
280
  })
274
281
  }] : []]
275
282
  } : void 0;
276
283
  return {
277
284
  rowKey: e.id,
278
- vendorLabel: m,
279
- vendorLookup: m || !e.counterpart_id ? void 0 : Te(at),
280
- invoiceNumberLabel: h,
285
+ vendorLabel: g,
286
+ vendorLookup: g || !e.counterpart_id ? void 0 : Ce(st),
287
+ invoiceNumberLabel: _,
281
288
  issueDateLabel: t(e.issued_at),
282
- dueDateLabel: t(e.due_date),
283
- dueDateTone: r.isOverdue ? "danger" : "default",
289
+ dueDateLabel: u.label,
290
+ dueDateOverdueLabel: u.overdueLabel,
291
+ dueDateAccessibleLabel: u.accessibleLabel,
284
292
  scheduledDateLabel: l.label,
285
293
  scheduledDateExact: l.absoluteLabel,
286
- scheduledDateIsGap: B === _.Scheduled,
294
+ scheduledDateIsGap: B === v.Scheduled,
287
295
  paidDateLabel: t(e.paid_at?.slice(0, 10)),
288
296
  amountDueLabel: c(i),
289
297
  amountPaidLabel: a ? c(e.amount_paid) : "",
290
- amountPaidIsGap: B === _.Paid,
298
+ amountPaidIsGap: B === v.Paid,
291
299
  amountScheduledLabel: c(e.amount_to_pay ?? i),
292
300
  totalAmountLabel: c(e.total_amount),
293
- attachment: e.file_id ? { label: Oe } : void 0,
301
+ attachment: e.file_id ? { label: Ee } : void 0,
294
302
  status: r.status,
295
303
  statusTone: r.tone,
296
304
  addedOnLabel: t(e.created_at?.slice(0, 10)),
297
- ...u ? { group: ot(u) } : {},
298
- ...v ? { menu: v } : {},
299
- ...!R && !u && d ? {
305
+ ...d ? { group: ct(d) } : {},
306
+ ...x ? { menu: x } : {},
307
+ ...!R && !d && h ? {
300
308
  marker: "duplicate",
301
- rowNote: De
309
+ rowNote: Te
302
310
  } : {},
303
- onOpen: () => Ee(e.id, f(e.status))
311
+ onOpen: () => we(e.id, f(e.status))
304
312
  };
305
- }), w), [
306
- it,
313
+ }), D), [
314
+ ot,
307
315
  Y,
308
- w,
316
+ D,
309
317
  J,
310
318
  K.isPending,
311
- ke,
312
- R,
313
319
  De,
314
- Oe,
315
- Ae,
316
- je,
320
+ R,
321
+ Te,
317
322
  Ee,
323
+ Oe,
324
+ ke,
325
+ k,
326
+ we,
318
327
  B,
319
328
  X,
320
- at,
321
- ot
322
- ]), st = b(() => R ? we(Z, S) : [], [Z, R]), Q = Math.min(ze, Math.max(0, st.length - 1)), ct = R ? st[Q] ?? [] : Z, $ = y((e) => {
329
+ st,
330
+ ct
331
+ ]), lt = C(() => R ? Se(Z, T) : [], [Z, R]), Q = Math.min(Re, Math.max(0, lt.length - 1)), ut = R ? lt[Q] ?? [] : Z, $ = S((e) => {
323
332
  let t = e;
324
- Me(t), Pe((e) => {
333
+ Ae(t), Me((e) => {
325
334
  let n = e[0]?.id;
326
- return n ? v(t).some((e) => ae(e) === n) ? e : be : e;
335
+ return n ? b(t).some((e) => re(e) === n) ? e : ve : e;
327
336
  }), L();
328
- }, [L]), lt = y((e) => {
329
- $(_.All), M(""), Ue(e);
330
- }, [Ue, $]), ut = y(() => {
331
- M(""), Be(""), He(), L();
332
- }, [He, L]), dt = y((e) => {
333
- Pe((t) => typeof e == "function" ? e(t) : e), L();
334
- }, [L]), ft = y((e) => {
335
- Fe(e), L();
336
- }, [L]), pt = y(() => {
337
- R ? A(Q + 1) : O(H.data?.next_pagination_token ?? void 0);
337
+ }, [L]), dt = S((e) => {
338
+ $(v.All), Be(""), Ge(e);
339
+ }, [Ge, $]), ft = S(() => {
340
+ Be(""), Ve(""), We(), L();
341
+ }, [We, L]), pt = S((e) => {
342
+ Me((t) => typeof e == "function" ? e(t) : e), L();
343
+ }, [L]), mt = S((e) => {
344
+ Ne(e), L();
345
+ }, [L]), ht = S(() => {
346
+ R ? ze(Q + 1) : M(H.data?.next_pagination_token ?? void 0);
338
347
  }, [
339
348
  Q,
340
349
  R,
341
350
  H.data?.next_pagination_token
342
- ]), mt = y(() => {
343
- R ? A(Math.max(0, Q - 1)) : O(H.data?.prev_pagination_token ?? void 0);
351
+ ]), gt = S(() => {
352
+ R ? ze(Math.max(0, Q - 1)) : M(H.data?.prev_pagination_token ?? void 0);
344
353
  }, [
345
354
  Q,
346
355
  R,
347
356
  H.data?.prev_pagination_token
348
- ]), ht = y(() => {
357
+ ]), _t = S(() => {
349
358
  W.refetch();
350
359
  }, [W.refetch]);
351
360
  return {
352
- rows: ct,
353
- isLoading: W.isLoading || !R && k === void 0 || V !== Qe || tt && nt.isLoading || (et ?? 0) > 0 && ct.length === 0,
361
+ rows: ut,
362
+ isLoading: W.isLoading || !R && Le === void 0 || V !== et || rt && it.isLoading || (nt ?? 0) > 0 && ut.length === 0,
354
363
  isError: W.isError,
355
- onRetry: ht,
356
- selectedFilterTabId: E,
364
+ onRetry: _t,
365
+ selectedFilterTabId: A,
357
366
  onFilterTabChange: $,
358
- showVendorBills: lt,
359
- clearQueryConstraints: ut,
360
- searchValue: j,
361
- onSearchChange: M,
362
- hasAnyBills: rt,
363
- isSearchActive: N.length > 0 || z.isFilterActive,
367
+ showVendorBills: dt,
368
+ clearQueryConstraints: ft,
369
+ searchValue: N,
370
+ onSearchChange: Be,
371
+ hasAnyBills: at,
372
+ isSearchActive: P.length > 0 || z.isFilterActive,
364
373
  filterBarProps: z.filterBarProps,
365
374
  visibleColumns: R ? [
366
- g.AddedOn,
367
- g.DueDate,
368
- g.AmountDue,
369
- g.Status
370
- ] : v(E),
375
+ _.AddedOn,
376
+ _.DueDate,
377
+ _.AmountDue,
378
+ _.Status
379
+ ] : b(A),
371
380
  keepsColumnOrder: R,
372
381
  isSortable: !R,
373
- pageInfo: R ? w.pageInfo({
382
+ pageInfo: R ? D.pageInfo({
374
383
  billCount: Z.length,
375
384
  invoiceCount: new Set(Z.map((e) => e.group?.key ?? e.rowKey)).size
376
385
  }) : void 0,
377
- showAddPanelWhenEmpty: !R && ie(E),
378
- sorting: Ne,
379
- onSortingChange: dt,
380
- pageSize: R ? S : D,
381
- pageSizeOptions: R ? [S] : void 0,
382
- onPageSizeChange: ft,
383
- hasNextPage: R ? Q < st.length - 1 : !!H.data?.next_pagination_token,
386
+ showAddPanelWhenEmpty: !R && ne(A),
387
+ sorting: je,
388
+ onSortingChange: pt,
389
+ pageSize: R ? T : j,
390
+ pageSizeOptions: R ? [T] : void 0,
391
+ onPageSizeChange: mt,
392
+ hasNextPage: R ? Q < lt.length - 1 : !!H.data?.next_pagination_token,
384
393
  hasPrevPage: R ? Q > 0 : !!H.data?.prev_pagination_token,
385
- onNextPage: pt,
386
- onPrevPage: mt,
394
+ onNextPage: ht,
395
+ onPrevPage: gt,
387
396
  cancelConfirmation: {
388
- open: !!P,
389
- copy: se(J[Ye], Ye),
390
- onConfirm: () => void Xe(),
391
- onCancel: () => F(void 0),
397
+ open: !!F,
398
+ copy: ae(J[Ze], Ze),
399
+ onConfirm: () => void Qe(),
400
+ onCancel: () => He(void 0),
392
401
  isPending: K.isPending,
393
- cancelButtonLabel: J[Ye].backButton
402
+ cancelButtonLabel: J[Ze].backButton
394
403
  },
395
404
  keepConfirmation: {
396
405
  open: !!I,
397
406
  copy: {
398
- title: w.notDuplicateConfirmTitle,
399
- description: w.notDuplicateConfirmDescription,
400
- confirmButton: w.notDuplicateConfirmButton,
407
+ title: D.notDuplicateConfirmTitle,
408
+ description: D.notDuplicateConfirmDescription,
409
+ confirmButton: D.notDuplicateConfirmButton,
401
410
  presentation: {
402
411
  alignment: "center",
403
- icon: ge,
412
+ icon: me,
404
413
  actionWidth: "equal"
405
414
  }
406
415
  },
407
- onConfirm: () => void Ze(),
408
- onCancel: () => Ve(void 0),
416
+ onConfirm: () => void $e(),
417
+ onCancel: () => Ue(void 0),
409
418
  isPending: K.isPending,
410
- cancelButtonLabel: w.notDuplicateConfirmBackButton
419
+ cancelButtonLabel: D.notDuplicateConfirmBackButton
411
420
  }
412
421
  };
413
422
  }
414
- function Ce(e, t) {
423
+ function xe(e, t) {
415
424
  let n = /* @__PURE__ */ new Map();
416
425
  for (let t of e) {
417
426
  if (!t.group) continue;
@@ -420,7 +429,7 @@ function Ce(e, t) {
420
429
  }
421
430
  return e.map((e) => {
422
431
  if (!e.group) return e;
423
- let r = m({
432
+ let r = h({
424
433
  statuses: n.get(e.group.key) ?? [],
425
434
  statusLabels: t.statusLabels,
426
435
  labels: {
@@ -438,14 +447,14 @@ function Ce(e, t) {
438
447
  } : e;
439
448
  });
440
449
  }
441
- function we(e, t) {
450
+ function Se(e, t) {
442
451
  let n = [], r = [];
443
452
  return e.forEach((i, a) => {
444
453
  let o = i.group !== void 0 && i.group.key === e[a - 1]?.group?.key;
445
454
  r.length >= t && !o && (n.push(r), r = []), r.push(i);
446
455
  }), r.length && n.push(r), n;
447
456
  }
448
- function Te(e) {
449
- return e === le.Settled ? void 0 : e;
457
+ function Ce(e) {
458
+ return e === se.Settled ? void 0 : e;
450
459
  }
451
- export { C as BillDuplicateView, Se as useBillsTable };
460
+ export { E as BillDuplicateView, be as useBillsTable };
@@ -42,6 +42,10 @@ function g({ labels: g, onOpenBill: _, onEnterManually: v, onFilesSelected: y, m
42
42
  ...o.scheduledRelativeDay,
43
43
  ...g?.scheduledRelativeDay
44
44
  },
45
+ dueDate: {
46
+ ...o.dueDate,
47
+ ...g?.dueDate
48
+ },
45
49
  filters: {
46
50
  ...o.filters,
47
51
  ...g?.filters,
@@ -155,7 +159,8 @@ function g({ labels: g, onOpenBill: _, onEnterManually: v, onFilesSelected: y, m
155
159
  duplicateGroupLabels: P,
156
160
  canManageDuplicates: k,
157
161
  duplicateView: C,
158
- scheduledRelativeDayLabels: x.scheduledRelativeDay
162
+ scheduledRelativeDayLabels: x.scheduledRelativeDay,
163
+ dueDateLabels: x.dueDate
159
164
  }), z = l({ enabled: O }), B = C === s.PossibleDuplicates, _e = se(z, x), V = le({
160
165
  enabled: O,
161
166
  canPay: A