@tesouro/embedded-components-react 0.5.45 → 0.5.47

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 (79) hide show
  1. package/README.md +7 -5
  2. package/dist/index.d.ts +54 -24
  3. package/dist/index.js +1 -1
  4. package/dist/lib/BankAccountOnboardingWidget.d.ts +15 -1
  5. package/dist/lib/BillPayWidget.d.ts +16 -1
  6. package/dist/lib/BillPayWidget.js +1 -1
  7. package/dist/lib/SettingsWidget.d.ts +1 -0
  8. package/dist/lib/WidgetSuite.d.ts +1 -0
  9. package/dist/lib/monite-sdk.d.ts +2 -0
  10. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/data-access/dist/index10.js +12 -8
  11. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index22.js +233 -211
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +8 -8
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +3 -3
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +7 -49
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +46 -36
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +34 -184
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +163 -75
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +75 -21
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +22 -93
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +88 -317
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +322 -12
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +12 -59
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +57 -50
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +52 -208
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +215 -35
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +35 -234
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +240 -21
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +21 -532
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +536 -4
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +4 -42
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +38 -230
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +234 -3
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +3 -4
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +2 -44
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +46 -1
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +1 -8
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +6 -11
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +11 -127
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +129 -3
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +3 -127
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +124 -8
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +8 -7
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +8 -46
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +44 -18
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +20 -28
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +27 -82
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +83 -47
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +47 -250
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +241 -122
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +126 -206
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +219 -3
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +4 -8
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +5 -113
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +100 -1
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +0 -24
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +27 -0
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +28 -28
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +1 -1
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +2 -2
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +1 -0
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +163 -151
  62. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index6.js +77 -77
  63. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ExpenseApprovalsPage.js +17 -10
  64. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/labels.js +2 -1
  65. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index9.js +1 -1
  66. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index382.js +10 -4
  67. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index394.js +1 -1
  68. package/dist/libs/tesouro-embedded-components-react/monite-sdk/dist/index616.js +23 -23
  69. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index3.js +1 -0
  70. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index6.js +13 -4
  71. package/dist/libs/tesouro-embedded-components-react/settings-widget/help/ui/shadcn/dist/index3.js +27 -29
  72. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/ApprovalPoliciesSettings.js +29 -28
  73. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/ui/dist/index11.js +13 -13
  74. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/index.js +4 -4
  75. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  76. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/user/useOrganizationUserNames.js +13 -1
  77. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/auditHistory/buildPayableAuditHistory.js +137 -0
  78. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  79. package/package.json +1 -1
@@ -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 };
@@ -1,80 +1,168 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { useAttachPayableFileMutation as e } from "../../data-access/dist/index13.js";
6
- import "../../data-access/dist/index.js";
7
- import { SourceDocumentPanel as t } from "../../ui/dist/index109.js";
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";
8
6
  import "../../ui/dist/index.js";
9
- import { createSourceDocumentPreview as n } from "./index47.js";
10
- import { SOURCE_DOCUMENT_CONTAINER_LABELS_EN as r } from "./index48.js";
11
- import { useEffect as i, useState as a } from "react";
12
- import { jsx as o } from "react/jsx-runtime";
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 { PAYABLE_AUDIT_HISTORY_LABELS_EN as _ } from "./index47.js";
13
+ import { SOURCE_DOCUMENT_PREVIEW_LABELS_EN as v } from "./index48.js";
13
14
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js
14
- function s(e) {
15
- let [t, n] = a();
16
- return i(() => {
17
- if (!e) {
18
- n(void 0);
19
- return;
15
+ var y = {
16
+ unmappedValidationError: (e, t) => `${e}: ${t}`,
17
+ unknownValidationField: "(unknown field)",
18
+ requiredField: "This field is required.",
19
+ saveFailed: "We could not save this bill. Try again.",
20
+ discountTaxBlockedByLineItems: "Discount and Tax can't be saved on a bill with line items. Remove them, then save again.",
21
+ finalizeFailed: "We could not submit this bill. Try again.",
22
+ draftSaved: "Bill saved as a draft.",
23
+ submittedSaved: "Bill updated.",
24
+ submittedDemoted: "Bill updated. It moved back to Drafts because some required details are missing.",
25
+ billFinalized: "Bill submitted for approval.",
26
+ numbersOnly: "Enter numbers only.",
27
+ unreadableMoney: "Enter a valid amount.",
28
+ unusableQuantity: "Enter a quantity greater than 0.",
29
+ lineItemsNeedAttention: "Check the highlighted line items before saving.",
30
+ unreadableDiscount: "Enter a valid discount amount.",
31
+ unreadableTax: "Enter a valid tax amount.",
32
+ unreadableTotal: "Enter a valid total amount.",
33
+ totalNotGreaterThanZero: "Total amount must be greater than $0.",
34
+ poNumberTooLong: "PO number must be 255 characters or fewer."
35
+ }, b = {
36
+ paymentInstructionsValue: (e) => `Account ending in ${e}`,
37
+ noMethod: "No payment method on file",
38
+ paymentMethodLoading: "Loading payment method...",
39
+ paymentMethodUnavailable: "We could not load payment methods. Try again.",
40
+ searchFailed: "We could not load vendors. Try again.",
41
+ vendorDetailsFailed: "We could not load this vendor. Try again."
42
+ }, x = {
43
+ attachFailed: "We could not attach that file. Try again.",
44
+ deleteFailed: "We could not remove that document. Try again.",
45
+ noDocument: "No document attached to this bill.",
46
+ pendingDeletionNotice: "This document will be removed when you save this bill.",
47
+ preview: v
48
+ }, S = {
49
+ ...f,
50
+ historyDateTime: (e, t) => `${e}, ${t}`,
51
+ historyWithMeta: (e, t) => `${e} · ${t}`,
52
+ notProvided: "Not provided",
53
+ paymentInstructionsValue: (e) => `Account ending in ${e}`,
54
+ paymentInstructionsNotSet: "Not set",
55
+ invoiceDateRow: "Invoice date",
56
+ dueDateRow: "Due date",
57
+ invoiceNumberRow: "Invoice number",
58
+ glCodeMissing: "GL code not specified",
59
+ glCodeUnavailable: "GL code unavailable",
60
+ qtyPriceValue: (e, t) => `${e} x ${t}`,
61
+ qtyOnlyValue: (e) => e,
62
+ subtotalRow: "Subtotal",
63
+ taxRow: "Tax",
64
+ discountRow: "Discounts",
65
+ totalRow: "Total",
66
+ paidOnLabel: (e) => `Paid on ${e}`,
67
+ paymentInstructionsSaveError: "Couldn't save payment instructions. Try again.",
68
+ paymentInstructionsLinkError: "Payment instructions were saved to the vendor, but couldn't be added to this bill. Try again.",
69
+ rejectedByOn: (e, t) => `Rejected by ${e} on ${t}`,
70
+ rejectedOn: (e) => `Rejected on ${e}`,
71
+ rejectionMessage: (e) => `"${e}"`
72
+ }, C = {
73
+ newTitle: "New bill",
74
+ extractedTitle: (e) => `Bill from ${e}`,
75
+ viewTitle: (e) => `Bill from ${e}`,
76
+ readOnlyTitle: "Bill details",
77
+ addedOn: (e) => `Added on ${e}`,
78
+ unsavedChanges: r,
79
+ discardChanges: t,
80
+ scheduledSummary: m,
81
+ scheduledStatusBadge: p,
82
+ awaitingApprovalNotice: l,
83
+ awaitingApprovalUnknownNotice: u,
84
+ actions: d,
85
+ detail: S,
86
+ history: _,
87
+ payBill: i,
88
+ markAsPaid: o,
89
+ approvalPolicyCopy: c,
90
+ deleteDraft: {
91
+ menuItem: "Delete draft",
92
+ dialog: {
93
+ title: "Delete this draft?",
94
+ description: "The draft and anything entered on it are removed. This can't be undone.",
95
+ confirmButton: "Delete draft"
96
+ },
97
+ error: "Couldn't delete this draft. Try again."
98
+ },
99
+ lineItemsGlCodeUnavailable: {
100
+ loadError: "Couldn't load GL codes",
101
+ noAccess: "You don't have access to GL codes",
102
+ empty: "No GL codes set up yet"
103
+ },
104
+ rejectedBanner: n
105
+ };
106
+ function w(e) {
107
+ return {
108
+ ...C,
109
+ ...e,
110
+ actions: h(e?.actions),
111
+ detail: {
112
+ ...C.detail,
113
+ ...e?.detail,
114
+ paymentHistoryMethodLabels: g(e?.detail?.paymentHistoryMethodLabels)
115
+ },
116
+ history: {
117
+ ...C.history,
118
+ ...e?.history
119
+ },
120
+ payBill: a(e?.payBill),
121
+ markAsPaid: s(e?.markAsPaid),
122
+ lineItemsGlCodeUnavailable: {
123
+ ...C.lineItemsGlCodeUnavailable,
124
+ ...e?.lineItemsGlCodeUnavailable
125
+ },
126
+ unsavedChanges: {
127
+ ...C.unsavedChanges,
128
+ ...e?.unsavedChanges
129
+ },
130
+ discardChanges: {
131
+ ...C.discardChanges,
132
+ ...e?.discardChanges
133
+ },
134
+ rejectedBanner: {
135
+ ...C.rejectedBanner,
136
+ ...e?.rejectedBanner
137
+ },
138
+ approvalPolicyCopy: {
139
+ ...C.approvalPolicyCopy,
140
+ ...e?.approvalPolicyCopy
141
+ },
142
+ deleteDraft: {
143
+ ...C.deleteDraft,
144
+ ...e?.deleteDraft,
145
+ dialog: (() => {
146
+ let t = {
147
+ ...C.deleteDraft.dialog,
148
+ ...e?.deleteDraft?.dialog
149
+ };
150
+ return delete t.reason, t;
151
+ })()
20
152
  }
21
- let t = URL.createObjectURL(e);
22
- return n(t), () => URL.revokeObjectURL(t);
23
- }, [e]), t;
24
- }
25
- function c({ payableId: i, file: a, isDocumentPending: c, pendingFileName: l, readOnly: u, staging: d, deletion: f, labels: p }) {
26
- let { stagedFile: m, onFileStaged: h, onClearStagedFile: g, isSaving: _ } = d ?? {}, { isPending: v, onRequest: y, onDetachNow: b, isDeleting: x, hasFailed: S } = f ?? {}, C = {
27
- ...r,
28
- ...p,
29
- preview: {
30
- ...r.preview,
31
- ...p?.preview
32
- }
33
- }, w = e(), T = s(m), E = !!(a && !v || m);
34
- if (!E && (c || w.isPending)) return /* @__PURE__ */ o(t, {
35
- mode: "loading",
36
- fileName: l
37
- });
38
- if (!E && u) return /* @__PURE__ */ o("div", {
39
- className: "ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4 ttw:text-sm ttw:text-muted-foreground",
40
- children: C.noDocument
41
- });
42
- if (!E) return /* @__PURE__ */ o(t, {
43
- mode: "upload",
44
- uploadStatus: w.isPending || x ? "uploading" : "idle",
45
- uploadErrorMessage: w.isError ? C.attachFailed : S ? C.deleteFailed : void 0,
46
- noticeMessage: v && !S ? C.pendingDeletionNotice : void 0,
47
- onFilesSelected: (e) => {
48
- let [t] = e;
49
- if (t) {
50
- if (i) {
51
- let e = () => w.mutate({
52
- path: { payable_id: i },
53
- file: t
54
- });
55
- if (v && b) {
56
- b().then(e, () => void 0);
57
- return;
58
- }
59
- e();
60
- } else h?.(t);
61
- }
62
- }
63
- });
64
- let D = a?.name ?? m?.name ?? "", O = n(a || {
65
- name: D,
66
- url: T ?? "",
67
- mimetype: m?.type ?? ""
68
- }, C.preview);
69
- return /* @__PURE__ */ o(t, {
70
- mode: "document",
71
- fileName: D,
72
- preview: O,
73
- isDeleting: x,
74
- deleteErrorMessage: S ? C.deleteFailed : void 0,
75
- onDownload: a ? () => window.open(a.url, "_blank", "noopener,noreferrer") : void 0,
76
- onDelete: u ? void 0 : a && i ? y : _ ? void 0 : g
77
- });
153
+ };
78
154
  }
155
+ var T = {
156
+ createTitle: "New vendor",
157
+ editTitle: "Edit vendor",
158
+ switchVendorFieldLabel: "Switch to a different vendor",
159
+ nameLabel: "Name",
160
+ addPaymentInstructions: "Add payment instructions",
161
+ cancelPaymentInstructions: "Cancel",
162
+ ach: e,
163
+ addAddress: "Add address (optional)",
164
+ cancel: "Cancel",
165
+ cancelAriaLabel: "Cancel vendor"
166
+ };
79
167
  //#endregion
80
- export { c as SourceDocumentContainer, c as default };
168
+ export { y as BILL_CREATE_MESSAGE_LABELS_EN, C as BILL_CREATE_SCREEN_LABELS_EN, S as BILL_DETAIL_VIEW_LABELS_EN, x as SOURCE_DOCUMENT_CONTAINER_LABELS_EN, T as VENDOR_INLINE_FORM_LABELS_EN, b as VENDOR_SECTION_PROPS_LABELS_EN, w as mergeBillCreateScreenCopy };