@tesouro/embedded-components-react 0.11.179 → 0.11.181

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 (108) hide show
  1. package/dist/index.css +22 -0
  2. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index.js +24 -23
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index10.js +16 -18
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index11.js +3 -3
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index12.js +5 -7
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index13.js +2 -2
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index14.js +4 -3
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index15.js +13 -27
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index16.js +34 -19
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index17.js +23 -16
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index18.js +26 -12
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index19.js +12 -57
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index2.js +34 -85
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index20.js +48 -29
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index21.js +36 -20
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index22.js +20 -18
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index23.js +14 -37
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index24.js +31 -14
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index25.js +26 -2
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index26.js +2 -0
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index3.js +90 -20
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index4.js +30 -8
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index5.js +8 -74
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index6.js +60 -19
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index7.js +6 -5
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index8.js +12 -17
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/data-access/dist/index9.js +20 -12
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index.js +7 -7
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index10.js +17 -36
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index11.js +42 -54
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index12.js +89 -6
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index13.js +5 -21
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js +15 -92
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index15.js +103 -10
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index16.js +10 -9
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index17.js +8 -7
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index18.js +7 -9
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index19.js +11 -29
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index20.js +24 -24
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index21.js +22 -14
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js +14 -137
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index23.js +139 -13
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +12 -18
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +15 -32
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js +39 -108
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +96 -80
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index28.js +94 -3
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js +4 -57
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index30.js +56 -116
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +114 -197
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +194 -75
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +75 -67
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index34.js +69 -111
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +108 -459
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +450 -102
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +117 -9
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index38.js +8 -85
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +73 -67
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index4.js +1 -1
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +71 -246
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +251 -40
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +38 -237
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js +244 -21
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +21 -529
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +530 -4
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +4 -44
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +41 -242
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +245 -3
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index49.js +3 -5
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index50.js +4 -63
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index51.js +64 -1
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index52.js +1 -0
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index9.js +6 -18
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index3.js +7 -3
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index.js +4 -4
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index10.js +14 -17
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index11.js +82 -13
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index12.js +47 -83
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index13.js +261 -47
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index14.js +23 -251
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index15.js +450 -25
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +286 -442
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +4 -300
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index18.js +5 -4
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index19.js +37 -4
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index20.js +1 -38
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index5.js +11 -11
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index7.js +88 -7
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index8.js +17 -89
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index9.js +18 -18
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index10.js +4 -4
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +0 -1
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +263 -262
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/invalidatePayableQueries/approvalDecisionQueries.js +22 -19
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/invalidatePayableQueries/invalidatePayableQueries.js +20 -20
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/lib/queryKeys.js +32 -21
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +2 -2
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/mocks/labels.js +1 -1
  99. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/index.js +4 -4
  100. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +42 -42
  101. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +237 -215
  102. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +151 -135
  103. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  104. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/index.js +7 -5
  105. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/AttentionStrip/AttentionStrip.js +29 -0
  106. package/dist/libs/tesouro-embedded-components-react/shared/ui/dist/lib/AttentionStrip/AttentionViewBar.js +33 -0
  107. package/package.json +1 -1
  108. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index21.js +0 -1
@@ -1,5 +1,96 @@
1
+ import { formatCalendarDate as e } from "../../../../shared/util/dist/lib/formatCalendarDate.js";
2
+ import "../../../../shared/util/dist/index.js";
3
+ import { formatBillMoney as t } from "../../../util/dist/lib/formatBillMoney.js";
4
+ import { resolveAmountDueMinorUnits as n } from "../../../util/dist/lib/resolveAmountDue.js";
5
+ import { resolveBillDueDate as r } from "../../../util/dist/lib/resolveBillDueDate.js";
6
+ import { resolveLineItemAmountMinorUnits as i } from "../../../util/dist/lib/resolveLineItemAmount.js";
7
+ import { resolveLineItemQuantity as a } from "../../../util/dist/lib/resolveLineItemQuantity.js";
8
+ import { resolveVendor as o } from "../../../util/dist/lib/resolveVendor.js";
9
+ import "../../../util/dist/index.js";
10
+ import { derivePayableStatus as s } from "../../../../shared/document-status/util/dist/lib/derivePayableStatus.js";
11
+ import { getPaidAtLabel as c, resolveInvoiceTotalMinorUnits as l } from "./index27.js";
1
12
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index28.js
2
- function e({ isUnsavedPromptOpen: e, isLocked: t, isDirty: n }) {
3
- return e ? "dismiss-prompt" : !t && n ? "prompt" : "close";
13
+ function u({ payable: u, lineItems: d, glCodeOptions: f, glCodeRosterAvailable: p = !0, history: m, paymentHistory: h, approvalPolicy: g, labels: _, dueDateLabels: v, today: y, hasScheduledPayment: b, rejection: x, payableAchInstructions: S, payableAchInstructionsReadable: C = !1 }) {
14
+ let w = u.currency, T = s({
15
+ apiStatus: u.status,
16
+ dueDate: u.due_date,
17
+ scheduledPaymentDate: u.scheduled_payment_date,
18
+ hasScheduledPayment: b
19
+ }), E = o(u), D = C ? S : void 0, O = D?.account_number, k = !!(D?.account_holder_name && D.routing_number && D.account_number), A = e(u.issued_at) || _.notProvided, j = e(u.due_date) || _.notProvided, M = r({
20
+ status: u.status,
21
+ dueDate: u.due_date,
22
+ today: y,
23
+ isScheduled: T.status === "scheduled",
24
+ labels: v,
25
+ emptyLabel: _.notProvided
26
+ }), N = new Map(f.map((e) => [e.value, e.label])), P = [
27
+ {
28
+ label: _.subtotalRow,
29
+ minorUnits: u.subtotal
30
+ },
31
+ {
32
+ label: _.discountRow,
33
+ minorUnits: u.discount
34
+ },
35
+ {
36
+ label: _.taxRow,
37
+ minorUnits: u.tax_amount
38
+ }
39
+ ].map((e) => ({
40
+ label: e.label,
41
+ value: t(e.minorUnits, w)
42
+ })).filter((e) => !!e.value), F = t(l(u), w);
43
+ F && P.push({
44
+ label: _.totalRow,
45
+ value: F,
46
+ emphasis: !0
47
+ });
48
+ let I = c(u);
49
+ return {
50
+ amountDue: t(n(u), w) ?? "",
51
+ amountPaid: I ? t(u.amount_paid, w) : void 0,
52
+ paidOnLabel: I ? _.paidOnLabel(I) : void 0,
53
+ invoiceDateLabel: A,
54
+ dueDateLabel: M.label,
55
+ dueDateOverdueLabel: M.overdueLabel,
56
+ dueDateAccessibleLabel: M.accessibleLabel,
57
+ status: T.status,
58
+ statusTone: T.tone,
59
+ payTo: {
60
+ name: E?.name || _.notProvided,
61
+ email: E?.email ?? "",
62
+ methodLabel: k ? _.paymentInstructionsValue(O?.slice(-4) ?? "") : _.paymentInstructionsNotSet,
63
+ hasPaymentInstructions: k
64
+ },
65
+ invoiceFields: [
66
+ {
67
+ label: _.invoiceDateRow,
68
+ value: A
69
+ },
70
+ {
71
+ label: _.dueDateRow,
72
+ value: j
73
+ },
74
+ {
75
+ label: _.invoiceNumberRow,
76
+ value: u.document_id || _.notProvided
77
+ }
78
+ ],
79
+ lineItems: d.map((e) => {
80
+ let n = t(e.unit_price, w), r = String(a(e));
81
+ return {
82
+ id: e.id,
83
+ description: e.name ?? e.description ?? "",
84
+ glCodeLabel: e.ledger_account_id ? N.get(e.ledger_account_id) ?? (p ? _.glCodeMissing : _.glCodeUnavailable) : _.glCodeMissing,
85
+ qtyPriceLabel: n ? _.qtyPriceValue(r, n) : _.qtyOnlyValue(r),
86
+ amount: t(i(e), w) ?? ""
87
+ };
88
+ }),
89
+ amountRows: P,
90
+ approvalPolicy: g,
91
+ paymentHistory: h,
92
+ history: m,
93
+ rejection: x
94
+ };
4
95
  }
5
- export { e as resolveEditorDismissal };
96
+ export { u as buildBillDetailView };
@@ -1,58 +1,5 @@
1
- import { formatCalendarDate as e } from "../../../../shared/util/dist/lib/formatCalendarDate.js";
2
- import "../../../../shared/util/dist/index.js";
3
- import { formatBillMoney as t } from "../../../util/dist/lib/formatBillMoney.js";
4
- import "../../../util/dist/index.js";
5
1
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js
6
- var n = {
7
- dateLabel: (e) => new Date(e).toLocaleDateString("en-US", {
8
- month: "short",
9
- day: "numeric",
10
- year: "numeric"
11
- }),
12
- timeLabel: (e) => new Date(e).toLocaleTimeString(void 0, {
13
- hour: "numeric",
14
- minute: "2-digit",
15
- timeZoneName: "short"
16
- }),
17
- byActor: (e, t) => `${e} by ${t}`,
18
- formatAmount: (e) => t(e) ?? "",
19
- billCreated: "Bill created",
20
- createdManually: "Data entered manually",
21
- createdFromUpload: "File uploaded and scanned automatically",
22
- billCreatedByEmail: "Bill created by email",
23
- sentFrom: (e) => `Sent from ${e}`,
24
- billDetailsUpdated: "Bill details updated",
25
- filledInFromFile: "Filled in from the attached file",
26
- submittedForReview: "Finalized and submitted for review",
27
- approvalRequested: "Approval requested",
28
- approved: "Approved",
29
- approvedAutomatically: "Auto-approved",
30
- rejected: "Rejected",
31
- policyOverrideApproved: "Policy override: Approved",
32
- policyOverrideRejected: "Policy override: Rejected",
33
- quotedReason: (e) => `"${e}"`,
34
- cancelled: "Cancelled",
35
- reopened: "Re-opened",
36
- paymentReleased: "Payment released",
37
- paid: (e) => `Paid ${e}`,
38
- paymentReverted: "Payment reverted",
39
- calendarDateLabel: (t) => e(t),
40
- paymentScheduled: "Payment scheduled",
41
- scheduledFor: (e) => `Scheduled for ${e}`,
42
- scheduledPaymentCancelled: "Scheduled payment cancelled",
43
- cancelledAsBillChanged: "The bill was changed",
44
- cancelledAsBillDeleted: "The bill was deleted",
45
- paymentFailed: "Payment failed",
46
- billMarkedAsFullyPaid: "Bill marked as fully paid",
47
- billMarkedAsPartiallyPaid: "Bill marked as partially paid",
48
- draftDeleted: "Draft deleted",
49
- fileAttached: "File attached",
50
- fileRemoved: "File removed",
51
- creditNoteLinked: "Credit note linked",
52
- creditNoteUnlinked: "Credit note unlinked",
53
- lineItemsUpdated: "Line items updated",
54
- lineItemAdded: "Line item added",
55
- lineItemUpdated: "Line item updated",
56
- lineItemRemoved: "Line item removed"
57
- };
58
- export { n as PAYABLE_AUDIT_HISTORY_LABELS_EN };
2
+ function e({ isUnsavedPromptOpen: e, isLocked: t, isDirty: n }) {
3
+ return e ? "dismiss-prompt" : !t && n ? "prompt" : "close";
4
+ }
5
+ export { e as resolveEditorDismissal };
@@ -1,118 +1,58 @@
1
- import { resolvePdfWorkerSrc as e } from "../../../../shared/util/dist/lib/pdfWorkerSrc.js";
1
+ import { formatCalendarDate as e } from "../../../../shared/util/dist/lib/formatCalendarDate.js";
2
2
  import "../../../../shared/util/dist/index.js";
3
- import { useEffect as t, useRef as n, useState as r } from "react";
4
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
- import "react-pdf/dist/Page/TextLayer.css";
3
+ import { formatBillMoney as t } from "../../../util/dist/lib/formatBillMoney.js";
4
+ import "../../../util/dist/index.js";
6
5
  // ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index30.js
7
- var o = {
8
- previewUnavailable: "Preview not available for this file type.",
9
- openFile: "Open file"
10
- }, s = 720, c = 280, l = 1.3;
11
- function u(e) {
12
- return (e.trim().split(/\s+/)[0] ?? "").split("#")[0] ?? e;
13
- }
14
- function d({ url: e, labels: t }) {
15
- return /* @__PURE__ */ a("div", {
16
- className: "ttw:flex ttw:h-full ttw:w-full ttw:flex-col ttw:items-center ttw:justify-center ttw:gap-2 ttw:p-4 ttw:text-center",
17
- children: [/* @__PURE__ */ i("p", {
18
- className: "ttw:text-sm ttw:text-muted-foreground",
19
- children: t.previewUnavailable
20
- }), /* @__PURE__ */ i("a", {
21
- href: e,
22
- target: "_blank",
23
- rel: "noreferrer",
24
- className: "ttw:text-sm ttw:font-medium ttw:text-primary ttw:underline ttw:underline-offset-2",
25
- children: t.openFile
26
- })]
27
- });
28
- }
29
- function f({ url: a, labels: o }) {
30
- let f = n(null), p = n(/* @__PURE__ */ new Map()), [m, h] = r(0), [g, _] = r(s), [v, y] = r(null), [b, x] = r(!1), [S, C] = r(() => /* @__PURE__ */ new Set([1]));
31
- if (t(() => {
32
- let t = !0;
33
- return import("react-pdf").then(({ Document: n, Page: r, pdfjs: i }) => {
34
- t && (i.GlobalWorkerOptions.workerSrc = e(i.version), y({
35
- Document: n,
36
- Page: r
37
- }));
38
- }).catch(() => {
39
- t && x(!0);
40
- }), () => {
41
- t = !1;
42
- };
43
- }, []), t(() => {
44
- if (!v) return;
45
- let e = f.current;
46
- if (!e) return;
47
- let t = () => {
48
- let t = e.clientWidth;
49
- t && _(Math.max(c, Math.min(t, s)));
50
- };
51
- if (t(), typeof ResizeObserver > "u") return;
52
- let n = new ResizeObserver(t);
53
- return n.observe(e), () => n.disconnect();
54
- }, [v]), t(() => {
55
- C(/* @__PURE__ */ new Set([1]));
56
- }, [a]), t(() => {
57
- let e = f.current;
58
- if (!e || !m || typeof IntersectionObserver > "u") return;
59
- let t = new IntersectionObserver((e) => {
60
- let t = e.filter((e) => e.isIntersecting).map((e) => Number(e.target.getAttribute("data-page-number"))).filter((e) => e >= 1);
61
- t.length && C((e) => {
62
- let n = new Set(e);
63
- return t.forEach((e) => n.add(e)), n.size === e.size ? e : n;
64
- });
65
- }, {
66
- root: e,
67
- rootMargin: "600px 0px"
68
- });
69
- return p.current.forEach((e) => t.observe(e)), () => t.disconnect();
70
- }, [m, g]), b) return /* @__PURE__ */ i(d, {
71
- url: a,
72
- labels: o
73
- });
74
- if (!v) return null;
75
- let { Document: w, Page: T } = v;
76
- return /* @__PURE__ */ i("div", {
77
- ref: f,
78
- className: "ttw:flex ttw:h-full ttw:w-full ttw:justify-center ttw:overflow-auto ttw:bg-white",
79
- children: /* @__PURE__ */ i(w, {
80
- suspense: !1,
81
- file: u(a),
82
- onLoadSuccess: ({ numPages: e }) => h(e),
83
- children: Array.from({ length: m }, (e, t) => {
84
- let n = t + 1;
85
- return /* @__PURE__ */ i("div", {
86
- ref: (e) => {
87
- e ? p.current.set(n, e) : p.current.delete(n);
88
- },
89
- "data-page-number": n,
90
- style: { minHeight: S.has(n) ? void 0 : Math.round(g * l) },
91
- children: S.has(n) ? /* @__PURE__ */ i(T, {
92
- pageNumber: n,
93
- width: g,
94
- renderAnnotationLayer: !1
95
- }) : null
96
- }, n);
97
- })
98
- })
99
- });
100
- }
101
- function p(e, t = {}) {
102
- let n = {
103
- ...o,
104
- ...t
105
- };
106
- return e.mimetype === "application/pdf" ? /* @__PURE__ */ i(f, {
107
- url: e.url,
108
- labels: n
109
- }) : e.mimetype.startsWith("image/") ? /* @__PURE__ */ i("img", {
110
- src: e.url,
111
- alt: e.name,
112
- className: "ttw:max-h-full ttw:max-w-full ttw:object-contain"
113
- }) : /* @__PURE__ */ i(d, {
114
- url: e.url,
115
- labels: n
116
- });
117
- }
118
- export { o as SOURCE_DOCUMENT_PREVIEW_LABELS_EN, p as createSourceDocumentPreview };
6
+ var n = {
7
+ dateLabel: (e) => new Date(e).toLocaleDateString("en-US", {
8
+ month: "short",
9
+ day: "numeric",
10
+ year: "numeric"
11
+ }),
12
+ timeLabel: (e) => new Date(e).toLocaleTimeString(void 0, {
13
+ hour: "numeric",
14
+ minute: "2-digit",
15
+ timeZoneName: "short"
16
+ }),
17
+ byActor: (e, t) => `${e} by ${t}`,
18
+ formatAmount: (e) => t(e) ?? "",
19
+ billCreated: "Bill created",
20
+ createdManually: "Data entered manually",
21
+ createdFromUpload: "File uploaded and scanned automatically",
22
+ billCreatedByEmail: "Bill created by email",
23
+ sentFrom: (e) => `Sent from ${e}`,
24
+ billDetailsUpdated: "Bill details updated",
25
+ filledInFromFile: "Filled in from the attached file",
26
+ submittedForReview: "Finalized and submitted for review",
27
+ approvalRequested: "Approval requested",
28
+ approved: "Approved",
29
+ approvedAutomatically: "Auto-approved",
30
+ rejected: "Rejected",
31
+ policyOverrideApproved: "Policy override: Approved",
32
+ policyOverrideRejected: "Policy override: Rejected",
33
+ quotedReason: (e) => `"${e}"`,
34
+ cancelled: "Cancelled",
35
+ reopened: "Re-opened",
36
+ paymentReleased: "Payment released",
37
+ paid: (e) => `Paid ${e}`,
38
+ paymentReverted: "Payment reverted",
39
+ calendarDateLabel: (t) => e(t),
40
+ paymentScheduled: "Payment scheduled",
41
+ scheduledFor: (e) => `Scheduled for ${e}`,
42
+ scheduledPaymentCancelled: "Scheduled payment cancelled",
43
+ cancelledAsBillChanged: "The bill was changed",
44
+ cancelledAsBillDeleted: "The bill was deleted",
45
+ paymentFailed: "Payment failed",
46
+ billMarkedAsFullyPaid: "Bill marked as fully paid",
47
+ billMarkedAsPartiallyPaid: "Bill marked as partially paid",
48
+ draftDeleted: "Draft deleted",
49
+ fileAttached: "File attached",
50
+ fileRemoved: "File removed",
51
+ creditNoteLinked: "Credit note linked",
52
+ creditNoteUnlinked: "Credit note unlinked",
53
+ lineItemsUpdated: "Line items updated",
54
+ lineItemAdded: "Line item added",
55
+ lineItemUpdated: "Line item updated",
56
+ lineItemRemoved: "Line item removed"
57
+ };
58
+ export { n as PAYABLE_AUDIT_HISTORY_LABELS_EN };