@tesouro/embedded-components-react 0.5.46 → 0.5.48

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 (58) hide show
  1. package/dist/index.css +56 -0
  2. package/dist/index.js +1 -1
  3. package/dist/lib/BillPayWidget.js +1 -1
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +8 -8
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +3 -3
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +7 -49
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +46 -36
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +34 -184
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +163 -75
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +75 -21
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +22 -93
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +88 -317
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +322 -12
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +12 -64
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +57 -50
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +52 -214
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +215 -35
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +35 -234
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +240 -21
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +21 -532
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +536 -4
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +4 -42
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +38 -230
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +234 -3
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +3 -4
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +2 -44
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +46 -1
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +1 -8
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +6 -11
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +11 -127
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +129 -3
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +3 -127
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +124 -8
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +8 -7
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +8 -47
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +44 -18
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +20 -28
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +27 -82
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +83 -47
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +47 -250
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +241 -122
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +125 -211
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +219 -3
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +4 -7
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +5 -98
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +100 -1
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +0 -26
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +27 -0
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +28 -28
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index3.js +12 -8
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +1 -0
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +242 -210
  53. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/index.js +4 -4
  54. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  55. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/user/useOrganizationUserNames.js +13 -1
  56. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/auditHistory/buildPayableAuditHistory.js +137 -0
  57. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  58. package/package.json +1 -1
package/dist/index.css CHANGED
@@ -2460,6 +2460,12 @@
2460
2460
  .ttw\:bg-background {
2461
2461
  background-color: var(--ttw-background);
2462
2462
  }
2463
+ .ttw\:bg-background\/85 {
2464
+ background-color: var(--ttw-background);
2465
+ @supports (color: color-mix(in lab, red, red)) {
2466
+ background-color: color-mix(in oklab, var(--ttw-background) 85%, transparent);
2467
+ }
2468
+ }
2463
2469
  .ttw\:bg-black {
2464
2470
  background-color: var(--ttw-color-black);
2465
2471
  }
@@ -3794,6 +3800,11 @@
3794
3800
  --tw-blur: blur(var(--ttw-blur-md));
3795
3801
  filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
3796
3802
  }
3803
+ .ttw\:backdrop-blur-\[1px\] {
3804
+ --tw-backdrop-blur: blur(1px);
3805
+ -webkit-backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
3806
+ backdrop-filter: var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);
3807
+ }
3797
3808
  .ttw\:transition {
3798
3809
  transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to, opacity, box-shadow, transform, translate, scale, rotate, filter, -webkit-backdrop-filter, backdrop-filter, display, content-visibility, overlay, pointer-events;
3799
3810
  transition-timing-function: var(--tw-ease, var(--ttw-default-transition-timing-function));
@@ -6908,6 +6919,42 @@
6908
6919
  syntax: "*";
6909
6920
  inherits: false;
6910
6921
  }
6922
+ @property --tw-backdrop-blur {
6923
+ syntax: "*";
6924
+ inherits: false;
6925
+ }
6926
+ @property --tw-backdrop-brightness {
6927
+ syntax: "*";
6928
+ inherits: false;
6929
+ }
6930
+ @property --tw-backdrop-contrast {
6931
+ syntax: "*";
6932
+ inherits: false;
6933
+ }
6934
+ @property --tw-backdrop-grayscale {
6935
+ syntax: "*";
6936
+ inherits: false;
6937
+ }
6938
+ @property --tw-backdrop-hue-rotate {
6939
+ syntax: "*";
6940
+ inherits: false;
6941
+ }
6942
+ @property --tw-backdrop-invert {
6943
+ syntax: "*";
6944
+ inherits: false;
6945
+ }
6946
+ @property --tw-backdrop-opacity {
6947
+ syntax: "*";
6948
+ inherits: false;
6949
+ }
6950
+ @property --tw-backdrop-saturate {
6951
+ syntax: "*";
6952
+ inherits: false;
6953
+ }
6954
+ @property --tw-backdrop-sepia {
6955
+ syntax: "*";
6956
+ inherits: false;
6957
+ }
6911
6958
  @property --tw-duration {
6912
6959
  syntax: "*";
6913
6960
  inherits: false;
@@ -7025,6 +7072,15 @@
7025
7072
  --tw-drop-shadow-color: initial;
7026
7073
  --tw-drop-shadow-alpha: 100%;
7027
7074
  --tw-drop-shadow-size: initial;
7075
+ --tw-backdrop-blur: initial;
7076
+ --tw-backdrop-brightness: initial;
7077
+ --tw-backdrop-contrast: initial;
7078
+ --tw-backdrop-grayscale: initial;
7079
+ --tw-backdrop-hue-rotate: initial;
7080
+ --tw-backdrop-invert: initial;
7081
+ --tw-backdrop-opacity: initial;
7082
+ --tw-backdrop-saturate: initial;
7083
+ --tw-backdrop-sepia: initial;
7028
7084
  --tw-duration: initial;
7029
7085
  --tw-ease: initial;
7030
7086
  --tw-content: "";
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import { RefreshingRootWidgetProvider as _ } from "./libs/tesouro-embedded-compo
14
14
  import { useDisclosuresAcceptanceSurface as v, useOwnWidgetConfig as y, useRefetchWidget as b, useWidgetConfig as x, useWidgetError as S, useWidgetInitStaleForToken as C, useWidgetLoading as w } from "./libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/hooks.js";
15
15
  import { BankAccountsWidget as T } from "./libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index8.js";
16
16
  import { CounterpartsWidget as E } from "./libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js";
17
- import { BillPayWidget as D } from "./libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js";
17
+ import { BillPayWidget as D } from "./libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js";
18
18
  import { CardDetailsWidget as O } from "./libs/tesouro-embedded-components-react/card-details-widget/feature/dist/index13.js";
19
19
  import { CreditCardsWidget as k } from "./libs/tesouro-embedded-components-react/cards-widget/feature/dist/index10.js";
20
20
  import { DebitCardsWidget as A } from "./libs/tesouro-embedded-components-react/cards-widget/feature/dist/index11.js";
@@ -1,3 +1,3 @@
1
- import { BillPayWidget as e } from "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js";
1
+ import { BillPayWidget as e } from "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js";
2
2
  import "../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js";
3
3
  export { e as BillPayWidget };
@@ -11,22 +11,22 @@ import "./index27.js";
11
11
  import "./index28.js";
12
12
  import "./index39.js";
13
13
  import "./index42.js";
14
- import "./index48.js";
15
- import "./index56.js";
16
- import "./index58.js";
17
- import "./index60.js";
14
+ import "./index49.js";
15
+ import "./index57.js";
16
+ import "./index59.js";
18
17
  import "./index61.js";
19
18
  import "./index62.js";
20
19
  import "./index63.js";
21
20
  import "./index64.js";
22
- import "./index68.js";
21
+ import "./index65.js";
23
22
  import "./index69.js";
24
23
  import "./index70.js";
25
24
  import "./index71.js";
26
25
  import "./index72.js";
27
- import "./index75.js";
28
- import "./index81.js";
26
+ import "./index73.js";
27
+ import "./index76.js";
29
28
  import "./index82.js";
30
29
  import "./index83.js";
31
- import { BillPayWidget as e } from "./index87.js";
30
+ import "./index84.js";
31
+ import { BillPayWidget as e } from "./index88.js";
32
32
  export { e as BillPayWidget };
@@ -1,11 +1,11 @@
1
1
  import { formatRejectionDate as e } from "../../../shared/util/dist/lib/formatRejectionDate.js";
2
2
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js
3
- function t({ payableStatus: t, approvalRequests: n, users: r, payableUpdatedAt: i, labels: a, now: o }) {
3
+ function t({ payableStatus: t, approvalRequests: n, userNames: r, payableUpdatedAt: i, labels: a, now: o }) {
4
4
  let s = n.find((e) => e.status === "rejected");
5
5
  if (!s) return t !== "rejected" || !i ? void 0 : { actorLabel: a.rejectedOn(e(i, o)) };
6
- let c = new Map(r.map((e) => [e.id, e.name])), l = s.rejected_by ? c.get(s.rejected_by) : void 0, u = e(s.updated_at, o);
6
+ let c = s.rejected_by ? r.get(s.rejected_by) : void 0, l = e(s.updated_at, o);
7
7
  return {
8
- actorLabel: l ? a.rejectedByOn(l, u) : a.rejectedOn(u),
8
+ actorLabel: c ? a.rejectedByOn(c, l) : a.rejectedOn(l),
9
9
  message: s.reject_reason ? a.rejectionMessage(s.reject_reason) : void 0
10
10
  };
11
11
  }
@@ -1,52 +1,10 @@
1
- import { derivePayableStatus as e } from "./index7.js";
2
- import { BILL_STATUS_BADGE_LABELS_EN as t } from "../../ui/dist/index18.js";
3
- import "../../ui/dist/index.js";
4
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js
5
- var n = /* @__PURE__ */ new Set([
6
- "credit_note_linked",
7
- "credit_note_unlinked",
8
- "line_item_added",
9
- "line_item_updated",
10
- "line_item_removed",
11
- "deleted"
12
- ]);
13
- function r(n, r, i) {
14
- switch (n) {
15
- case "payable_created": return r?.source_of_payable_data === "ocr" ? i.billUploaded : i.billAdded;
16
- case "payable_updated": return i.billUpdated;
17
- case "file_attached": return i.attachmentAdded;
18
- case "submitted_for_approval": return i.submittedForApproval;
19
- case "approval_requested": return i.approvalRequested;
20
- case "approval_action": {
21
- let e = r?.action, t = r?.reject_reason;
22
- return e === "approve" ? i.approved : e === "reject" ? typeof t == "string" && t ? i.rejectedWithReason(t) : i.rejected : void 0;
23
- }
24
- case "auto_approved": return i.autoApproved;
25
- case "reopened": return i.reopened;
26
- case "marked_as_paid": return i.markedAsPaid;
27
- case "marked_as_partially_paid": return i.markedAsPartiallyPaid;
28
- case "payment_reverted": return i.paymentReverted;
29
- case "status_changed": {
30
- let n = r?.new_status;
31
- if (typeof n != "string") return;
32
- let a = e({ apiStatus: n }).status;
33
- return i.statusChanged(t[a] ?? t.unknown);
34
- }
35
- default: return;
36
- }
37
- }
38
- function i(e, t, i) {
39
- let a = new Map(t.map((e) => [e.id, e.name]));
40
- return e.filter((e) => !n.has(e.event_type)).map((e) => {
41
- let t = r(e.event_type, e.event_data, i);
42
- if (!t) return;
43
- let n = e.entity_user_id ? a.get(e.entity_user_id) : void 0;
44
- return {
45
- id: e.id,
46
- dateLabel: i.dateLabel(e.timestamp),
47
- description: n ? i.byActor(t, n) : t
48
- };
49
- }).filter((e) => !!e);
2
+ function e(e, t) {
3
+ return e.map((e) => ({
4
+ id: e.id,
5
+ dateLabel: t.historyDateTime(e.dateLabel, e.timeLabel),
6
+ description: e.meta ? t.historyWithMeta(e.title, e.meta) : e.title
7
+ }));
50
8
  }
51
9
  //#endregion
52
- export { i as buildBillHistory };
10
+ export { e as toBillDetailBodyHistory };
@@ -1,39 +1,49 @@
1
- import { jsx as e, jsxs as t } from "react/jsx-runtime";
1
+ import { formatBillMoney as e } from "./index2.js";
2
2
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js
3
- var n = {
4
- previewUnavailable: "Preview not available for this file type.",
5
- openFile: "Open file"
3
+ var t = {
4
+ dateLabel: (e) => new Date(e).toLocaleDateString("en-US", {
5
+ month: "short",
6
+ day: "numeric",
7
+ year: "numeric"
8
+ }),
9
+ timeLabel: (e) => new Date(e).toLocaleTimeString(void 0, {
10
+ hour: "numeric",
11
+ minute: "2-digit",
12
+ timeZoneName: "short"
13
+ }),
14
+ byActor: (e, t) => `${e} by ${t}`,
15
+ formatAmount: (t) => e(t) ?? "",
16
+ billCreated: "Bill created",
17
+ createdManually: "Data entered manually",
18
+ createdFromUpload: "File uploaded and scanned automatically",
19
+ createdFromEmail: "File emailed and scanned automatically",
20
+ billDetailsUpdated: "Bill details updated",
21
+ submittedForReview: "Finalized and submitted for review",
22
+ approvalRequested: "Approval requested",
23
+ approved: "Approved",
24
+ approvedCount: (e, t) => `Approved (${e} of ${t})`,
25
+ approvedAutomatically: "Approved automatically",
26
+ rejected: "Rejected",
27
+ policyOverrideApproved: "Policy override: Approved",
28
+ policyOverrideRejected: "Policy override: Rejected",
29
+ actorWithReason: (e, t) => `${e}: "${t}"`,
30
+ quotedReason: (e) => `"${e}"`,
31
+ cancelled: "Cancelled",
32
+ reopened: "Re-opened for edit",
33
+ paymentReleased: "Payment released",
34
+ paid: (e) => `Paid ${e}`,
35
+ paymentReverted: "Payment reverted",
36
+ billMarkedAsFullyPaid: "Bill marked as fully paid",
37
+ billMarkedAsPartiallyPaid: "Bill marked as partially paid",
38
+ draftDeleted: "Draft deleted",
39
+ fileAttached: "File attached",
40
+ fileRemoved: "File removed",
41
+ creditNoteLinked: "Credit note linked",
42
+ creditNoteUnlinked: "Credit note unlinked",
43
+ lineItemsUpdated: "Line items updated",
44
+ lineItemAdded: "Line item added",
45
+ lineItemUpdated: "Line item updated",
46
+ lineItemRemoved: "Line item removed"
6
47
  };
7
- function r(r, i = {}) {
8
- if (r.mimetype === "application/pdf") return /* @__PURE__ */ e("iframe", {
9
- src: `${r.url}#toolbar=0&navpanes=0`,
10
- title: r.name,
11
- referrerPolicy: "no-referrer",
12
- className: "ttw:h-full ttw:w-full ttw:border-0 ttw:bg-white",
13
- style: { colorScheme: "light" }
14
- });
15
- if (r.mimetype.startsWith("image/")) return /* @__PURE__ */ e("img", {
16
- src: r.url,
17
- alt: r.name,
18
- className: "ttw:max-h-full ttw:max-w-full ttw:object-contain"
19
- });
20
- let a = {
21
- ...n,
22
- ...i
23
- };
24
- return /* @__PURE__ */ t("div", {
25
- 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",
26
- children: [/* @__PURE__ */ e("p", {
27
- className: "ttw:text-sm ttw:text-muted-foreground",
28
- children: a.previewUnavailable
29
- }), /* @__PURE__ */ e("a", {
30
- href: r.url,
31
- target: "_blank",
32
- rel: "noreferrer",
33
- className: "ttw:text-sm ttw:font-medium ttw:text-primary ttw:underline ttw:underline-offset-2",
34
- children: a.openFile
35
- })]
36
- });
37
- }
38
48
  //#endregion
39
- export { n as SOURCE_DOCUMENT_PREVIEW_LABELS_EN, r as createSourceDocumentPreview };
49
+ export { t as PAYABLE_AUDIT_HISTORY_LABELS_EN };
@@ -1,189 +1,39 @@
1
- import { ACH_FIELD_GROUP_LABELS_EN as e } from "../../../shared/counterpart-management/ui/dist/index2.js";
2
- import "../../../shared/counterpart-management/ui/dist/index.js";
3
- import { DISCARD_CHANGES_DIALOG_LABELS_EN as t } from "../../ui/dist/index66.js";
4
- import { BILL_REJECTED_BANNER_LABELS_EN as n } from "../../ui/dist/index74.js";
5
- import { UNSAVED_BILL_DIALOG_LABELS_EN as r } from "../../ui/dist/index111.js";
6
- import "../../ui/dist/index.js";
7
- import { PAY_BILL_FLOW_LABELS_EN as i, mergePayBillFlowLabels as a } from "./index25.js";
8
- import { MARK_AS_PAID_FLOW_LABELS_EN as o, mergeMarkAsPaidFlowLabels as s } from "./index15.js";
9
- import "./index18.js";
10
- import { APPROVAL_POLICY_RULE_COPY_EN as c } from "./index29.js";
11
- import { AWAITING_APPROVAL_LABEL_EN as l, AWAITING_APPROVAL_UNKNOWN_LABEL_EN as u, BILL_DETAIL_ACTIONS_LABELS_EN as d, PAYMENT_HISTORY_LABELS_EN as f, SCHEDULED_STATUS_BADGE_LABEL_EN as p, SCHEDULED_SUMMARY_LABEL_EN as m, mergeBillDetailActionsLabels as h, mergePaymentHistoryMethodLabels as g } from "./index46.js";
12
- import { SOURCE_DOCUMENT_PREVIEW_LABELS_EN as _ } from "./index47.js";
1
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
13
2
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js
14
- var v = {
15
- unmappedValidationError: (e, t) => `${e}: ${t}`,
16
- unknownValidationField: "(unknown field)",
17
- requiredField: "This field is required.",
18
- saveFailed: "We could not save this bill. Try again.",
19
- discountTaxBlockedByLineItems: "Discount and Tax can't be saved on a bill with line items. Remove them, then save again.",
20
- finalizeFailed: "We could not submit this bill. Try again.",
21
- draftSaved: "Bill saved as a draft.",
22
- submittedSaved: "Bill updated.",
23
- submittedDemoted: "Bill updated. It moved back to Drafts because some required details are missing.",
24
- billFinalized: "Bill submitted for approval.",
25
- numbersOnly: "Enter numbers only.",
26
- unreadableMoney: "Enter a valid amount.",
27
- unusableQuantity: "Enter a quantity greater than 0.",
28
- lineItemsNeedAttention: "Check the highlighted line items before saving.",
29
- unreadableDiscount: "Enter a valid discount amount.",
30
- unreadableTax: "Enter a valid tax amount.",
31
- unreadableTotal: "Enter a valid total amount.",
32
- totalNotGreaterThanZero: "Total amount must be greater than $0.",
33
- poNumberTooLong: "PO number must be 255 characters or fewer."
34
- }, y = {
35
- paymentInstructionsValue: (e) => `Account ending in ${e}`,
36
- noMethod: "No payment method on file",
37
- paymentMethodLoading: "Loading payment method...",
38
- paymentMethodUnavailable: "We could not load payment methods. Try again.",
39
- searchFailed: "We could not load vendors. Try again.",
40
- vendorDetailsFailed: "We could not load this vendor. Try again."
41
- }, b = {
42
- attachFailed: "We could not attach that file. Try again.",
43
- deleteFailed: "We could not remove that document. Try again.",
44
- noDocument: "No document attached to this bill.",
45
- pendingDeletionNotice: "This document will be removed when you save this bill.",
46
- preview: _
47
- }, x = {
48
- ...f,
49
- notProvided: "Not provided",
50
- paymentInstructionsValue: (e) => `Account ending in ${e}`,
51
- paymentInstructionsNotSet: "Not set",
52
- invoiceDateRow: "Invoice date",
53
- dueDateRow: "Due date",
54
- invoiceNumberRow: "Invoice number",
55
- glCodeMissing: "GL code not specified",
56
- glCodeUnavailable: "GL code unavailable",
57
- qtyPriceValue: (e, t) => `${e} x ${t}`,
58
- qtyOnlyValue: (e) => e,
59
- subtotalRow: "Subtotal",
60
- taxRow: "Tax",
61
- discountRow: "Discounts",
62
- totalRow: "Total",
63
- paidOnLabel: (e) => `Paid on ${e}`,
64
- paymentInstructionsSaveError: "Couldn't save payment instructions. Try again.",
65
- paymentInstructionsLinkError: "Payment instructions were saved to the vendor, but couldn't be added to this bill. Try again.",
66
- rejectedByOn: (e, t) => `Rejected by ${e} on ${t}`,
67
- rejectedOn: (e) => `Rejected on ${e}`,
68
- rejectionMessage: (e) => `"${e}"`
69
- }, S = {
70
- dateLabel: (e) => new Date(e).toLocaleString("en-US", {
71
- month: "short",
72
- day: "numeric",
73
- year: "numeric",
74
- hour: "numeric",
75
- minute: "2-digit"
76
- }),
77
- byActor: (e, t) => `${e} by ${t}`,
78
- billAdded: "Bill added",
79
- billUploaded: "Bill uploaded",
80
- billUpdated: "Bill updated",
81
- attachmentAdded: "Attachment added",
82
- submittedForApproval: "Submitted for approval",
83
- approvalRequested: "Approval requested",
84
- approved: "Approved",
85
- autoApproved: "Approved automatically",
86
- rejected: "Rejected",
87
- rejectedWithReason: (e) => `Rejected: ${e}`,
88
- reopened: "Reopened",
89
- markedAsPaid: "Marked as paid",
90
- markedAsPartiallyPaid: "Marked as partially paid",
91
- paymentReverted: "Payment reverted",
92
- statusChanged: (e) => `Status changed to ${e}`
93
- }, C = {
94
- newTitle: "New bill",
95
- extractedTitle: (e) => `Bill from ${e}`,
96
- viewTitle: (e) => `Bill from ${e}`,
97
- readOnlyTitle: "Bill details",
98
- addedOn: (e) => `Added on ${e}`,
99
- unsavedChanges: r,
100
- discardChanges: t,
101
- scheduledSummary: m,
102
- scheduledStatusBadge: p,
103
- awaitingApprovalNotice: l,
104
- awaitingApprovalUnknownNotice: u,
105
- actions: d,
106
- detail: x,
107
- history: S,
108
- payBill: i,
109
- markAsPaid: o,
110
- approvalPolicyCopy: c,
111
- deleteDraft: {
112
- menuItem: "Delete draft",
113
- dialog: {
114
- title: "Delete this draft?",
115
- description: "The draft and anything entered on it are removed. This can't be undone.",
116
- confirmButton: "Delete draft"
117
- },
118
- error: "Couldn't delete this draft. Try again."
119
- },
120
- lineItemsGlCodeUnavailable: {
121
- loadError: "Couldn't load GL codes",
122
- noAccess: "You don't have access to GL codes",
123
- empty: "No GL codes set up yet"
124
- },
125
- rejectedBanner: n
3
+ var n = {
4
+ previewUnavailable: "Preview not available for this file type.",
5
+ openFile: "Open file"
126
6
  };
127
- function w(e) {
128
- return {
129
- ...C,
130
- ...e,
131
- actions: h(e?.actions),
132
- detail: {
133
- ...C.detail,
134
- ...e?.detail,
135
- paymentHistoryMethodLabels: g(e?.detail?.paymentHistoryMethodLabels)
136
- },
137
- history: {
138
- ...C.history,
139
- ...e?.history
140
- },
141
- payBill: a(e?.payBill),
142
- markAsPaid: s(e?.markAsPaid),
143
- lineItemsGlCodeUnavailable: {
144
- ...C.lineItemsGlCodeUnavailable,
145
- ...e?.lineItemsGlCodeUnavailable
146
- },
147
- unsavedChanges: {
148
- ...C.unsavedChanges,
149
- ...e?.unsavedChanges
150
- },
151
- discardChanges: {
152
- ...C.discardChanges,
153
- ...e?.discardChanges
154
- },
155
- rejectedBanner: {
156
- ...C.rejectedBanner,
157
- ...e?.rejectedBanner
158
- },
159
- approvalPolicyCopy: {
160
- ...C.approvalPolicyCopy,
161
- ...e?.approvalPolicyCopy
162
- },
163
- deleteDraft: {
164
- ...C.deleteDraft,
165
- ...e?.deleteDraft,
166
- dialog: (() => {
167
- let t = {
168
- ...C.deleteDraft.dialog,
169
- ...e?.deleteDraft?.dialog
170
- };
171
- return delete t.reason, t;
172
- })()
173
- }
7
+ function r(r, i = {}) {
8
+ if (r.mimetype === "application/pdf") return /* @__PURE__ */ e("iframe", {
9
+ src: `${r.url}#toolbar=0&navpanes=0`,
10
+ title: r.name,
11
+ referrerPolicy: "no-referrer",
12
+ className: "ttw:h-full ttw:w-full ttw:border-0 ttw:bg-white",
13
+ style: { colorScheme: "light" }
14
+ });
15
+ if (r.mimetype.startsWith("image/")) return /* @__PURE__ */ e("img", {
16
+ src: r.url,
17
+ alt: r.name,
18
+ className: "ttw:max-h-full ttw:max-w-full ttw:object-contain"
19
+ });
20
+ let a = {
21
+ ...n,
22
+ ...i
174
23
  };
24
+ return /* @__PURE__ */ t("div", {
25
+ 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",
26
+ children: [/* @__PURE__ */ e("p", {
27
+ className: "ttw:text-sm ttw:text-muted-foreground",
28
+ children: a.previewUnavailable
29
+ }), /* @__PURE__ */ e("a", {
30
+ href: r.url,
31
+ target: "_blank",
32
+ rel: "noreferrer",
33
+ className: "ttw:text-sm ttw:font-medium ttw:text-primary ttw:underline ttw:underline-offset-2",
34
+ children: a.openFile
35
+ })]
36
+ });
175
37
  }
176
- var T = {
177
- createTitle: "New vendor",
178
- editTitle: "Edit vendor",
179
- switchVendorFieldLabel: "Switch to a different vendor",
180
- nameLabel: "Name",
181
- addPaymentInstructions: "Add payment instructions",
182
- cancelPaymentInstructions: "Cancel",
183
- ach: e,
184
- addAddress: "Add address (optional)",
185
- cancel: "Cancel",
186
- cancelAriaLabel: "Cancel vendor"
187
- };
188
38
  //#endregion
189
- export { v as BILL_CREATE_MESSAGE_LABELS_EN, C as BILL_CREATE_SCREEN_LABELS_EN, x as BILL_DETAIL_VIEW_LABELS_EN, S as BILL_HISTORY_LABELS_EN, b as SOURCE_DOCUMENT_CONTAINER_LABELS_EN, T as VENDOR_INLINE_FORM_LABELS_EN, y as VENDOR_SECTION_PROPS_LABELS_EN, w as mergeBillCreateScreenCopy };
39
+ export { n as SOURCE_DOCUMENT_PREVIEW_LABELS_EN, r as createSourceDocumentPreview };