@tesouro/embedded-components-react 0.5.0 → 0.5.1

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 (55) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/lib/BillPayWidget.js +1 -1
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +10 -9
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +14 -88
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +8 -96
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +91 -3
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +96 -48
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +3 -137
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +49 -35
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +129 -180
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +32 -74
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +186 -21
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +70 -226
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +22 -219
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +221 -109
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +220 -13
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +119 -46
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +13 -32
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +43 -198
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +29 -32
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +186 -222
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +37 -19
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +229 -420
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +21 -4
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +429 -34
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +4 -224
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +38 -3
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +222 -2
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +3 -46
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +4 -1
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +44 -6
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +1 -12
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +6 -110
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +12 -3
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +109 -124
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +3 -11
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +124 -7
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +8 -45
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +8 -21
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +45 -28
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +20 -83
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +28 -47
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +76 -243
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +48 -113
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +239 -196
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +115 -4
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +207 -5
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +3 -114
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +8 -1
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +106 -16
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +1 -0
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +25 -0
  53. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  54. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  55. package/package.json +1 -1
@@ -1,38 +1,52 @@
1
- import { jsx as e, jsxs as t } from "react/jsx-runtime";
1
+ import { derivePayableStatus as e } from "./index8.js";
2
+ import { BILL_STATUS_BADGE_LABELS_EN as t } from "../../ui/dist/index17.js";
3
+ import "../../ui/dist/index.js";
2
4
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js
3
- var n = {
4
- previewUnavailable: "Preview not available for this file type.",
5
- openFile: "Open file"
6
- };
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"
13
- });
14
- if (r.mimetype.startsWith("image/")) return /* @__PURE__ */ e("img", {
15
- src: r.url,
16
- alt: r.name,
17
- className: "ttw:max-h-full ttw:max-w-full ttw:object-contain"
18
- });
19
- let a = {
20
- ...n,
21
- ...i
22
- };
23
- return /* @__PURE__ */ t("div", {
24
- 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",
25
- children: [/* @__PURE__ */ e("p", {
26
- className: "ttw:text-sm ttw:text-muted-foreground",
27
- children: a.previewUnavailable
28
- }), /* @__PURE__ */ e("a", {
29
- href: r.url,
30
- target: "_blank",
31
- rel: "noreferrer",
32
- className: "ttw:text-sm ttw:font-medium ttw:text-primary ttw:underline ttw:underline-offset-2",
33
- children: a.openFile
34
- })]
35
- });
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);
36
50
  }
37
51
  //#endregion
38
- export { n as SOURCE_DOCUMENT_PREVIEW_LABELS_EN, r as createSourceDocumentPreview };
52
+ export { i as buildBillHistory };
@@ -1,191 +1,140 @@
1
- import { BILL_REJECTED_BANNER_LABELS_EN as e } from "../../ui/dist/index68.js";
2
- import { UNSAVED_BILL_DIALOG_LABELS_EN as t } from "../../ui/dist/index105.js";
3
- import "../../ui/dist/index.js";
4
- import { PAY_BILL_FLOW_LABELS_EN as n, mergePayBillFlowLabels as r } from "./index25.js";
5
- import { MARK_AS_PAID_FLOW_LABELS_EN as i, mergeMarkAsPaidFlowLabels as a } from "./index16.js";
6
- import "./index19.js";
7
- import { APPROVAL_POLICY_RULE_COPY_EN as o } from "./index29.js";
8
- import { BILL_DETAIL_ACTIONS_LABELS_EN as s, PAYMENT_HISTORY_LABELS_EN as c, SCHEDULED_SUMMARY_LABEL_EN as l, mergeBillDetailActionsLabels as u, mergePaymentHistoryMethodLabels as d } from "./index44.js";
9
- import { SOURCE_DOCUMENT_PREVIEW_LABELS_EN as f } from "./index45.js";
10
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js
11
- var p = {
12
- unmappedValidationError: (e, t) => `${e}: ${t}`,
13
- unknownValidationField: "(unknown field)",
14
- requiredField: "This field is required.",
15
- saveFailed: "We could not save this bill. Try again.",
16
- discountTaxBlockedByLineItems: "Discount and Tax can't be saved on a bill with line items. Remove them, then save again.",
17
- finalizeFailed: "We could not submit this bill. Try again.",
18
- draftSaved: "Bill saved as a draft.",
19
- submittedSaved: "Bill updated.",
20
- submittedDemoted: "Bill updated. It moved back to Drafts because some required details are missing.",
21
- billFinalized: "Bill submitted for approval.",
22
- numbersOnly: "Enter numbers only.",
23
- unreadableMoney: "Enter a valid amount.",
24
- unusableQuantity: "Enter a quantity greater than 0.",
25
- lineItemsNeedAttention: "Check the highlighted line items before saving.",
26
- unreadableDiscount: "Enter a valid discount amount.",
27
- unreadableTax: "Enter a valid tax amount.",
28
- unreadableTotal: "Enter a valid total amount."
29
- }, m = {
30
- achMethod: "via ACH bank transfer",
31
- noMethod: "No payment method on file",
32
- accountHolder: "Account holder",
33
- routingNumber: "Routing number",
34
- accountNumber: "Account number",
35
- paymentMethodLoading: "Loading payment method...",
36
- paymentMethodUnavailable: "We could not load payment methods. Try again.",
37
- searchFailed: "We could not load vendors. Try again.",
38
- vendorDetailsFailed: "We could not load this vendor. Try again."
39
- }, h = {
40
- attachFailed: "We could not attach that file. Try again.",
41
- deleteFailed: "We could not remove that document. Try again.",
42
- noDocument: "No document attached to this bill.",
43
- pendingDeletionNotice: "This document will be removed when you save this bill.",
44
- preview: f
45
- }, g = {
46
- ...c,
47
- notProvided: "Not provided",
48
- paymentInstructionsValue: (e) => `Account ending in ${e}`,
49
- paymentInstructionsNotSet: "Not set",
50
- accountHolderFieldLabel: "Account holder",
51
- routingNumberFieldLabel: "Routing number",
52
- accountNumberFieldLabel: "Account number",
53
- invoiceDateRow: "Invoice date",
54
- dueDateRow: "Due date",
55
- invoiceNumberRow: "Invoice number",
56
- glCodeMissing: "GL code not specified",
57
- glCodeUnavailable: "GL code unavailable",
58
- qtyPriceValue: (e, t) => `${e} x ${t}`,
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
- }, _ = {
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
- }, v = {
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: t,
100
- scheduledSummary: l,
101
- actions: s,
102
- detail: g,
103
- history: _,
104
- payBill: n,
105
- markAsPaid: i,
106
- approvalPolicyCopy: o,
107
- deleteDraft: {
108
- menuItem: "Delete draft",
109
- dialog: {
110
- title: "Delete this draft?",
111
- description: "The draft and anything entered on it are removed. This can't be undone.",
112
- confirmButton: "Delete draft"
2
+ var e = {
3
+ payBill: "Pay bill",
4
+ markAsPaid: "Mark as paid",
5
+ reject: "Reject",
6
+ approve: "Approve",
7
+ cancel: "Cancel bill",
8
+ cancelScheduledPayment: "Cancel scheduled payment",
9
+ reopen: "Reopen bill",
10
+ forceApprove: "Approve",
11
+ forceReject: "Reject",
12
+ policyOverridesHeading: "Policy overrides",
13
+ decisionDialog: {
14
+ reject: {
15
+ title: "Reject this bill?",
16
+ description: "The bill goes back as rejected and nobody else is asked to approve it.",
17
+ confirmButton: "Reject bill",
18
+ reason: {
19
+ label: "Reason",
20
+ placeholder: "Tell the submitter what needs to change",
21
+ optionalHint: "Optional"
22
+ }
113
23
  },
114
- error: "Couldn't delete this draft. Try again."
115
- },
116
- lineItemsGlCodeUnavailable: {
117
- loadError: "Couldn't load GL codes",
118
- noAccess: "You don't have access to GL codes",
119
- empty: "No GL codes set up yet"
120
- },
121
- rejectedBanner: e
122
- };
123
- function y(e) {
124
- return {
125
- ...v,
126
- ...e,
127
- actions: u(e?.actions),
128
- detail: {
129
- ...v.detail,
130
- ...e?.detail,
131
- paymentHistoryMethodLabels: d(e?.detail?.paymentHistoryMethodLabels)
24
+ cancel: {
25
+ title: "Cancel this bill?",
26
+ description: "Cancelling is permanent. The bill can't be reopened, edited, or paid afterwards.",
27
+ confirmButton: "Cancel bill"
132
28
  },
133
- history: {
134
- ...v.history,
135
- ...e?.history
29
+ cancelScheduledPayment: {
30
+ title: "Cancel this scheduled payment?",
31
+ description: "The payment will not be sent. The bill stays ready to pay, so you can schedule it again for another date.",
32
+ confirmButton: "Cancel payment"
136
33
  },
137
- payBill: r(e?.payBill),
138
- markAsPaid: a(e?.markAsPaid),
139
- lineItemsGlCodeUnavailable: {
140
- ...v.lineItemsGlCodeUnavailable,
141
- ...e?.lineItemsGlCodeUnavailable
34
+ forceApprove: {
35
+ title: "Override approval policy?",
36
+ description: "The below people haven't approved this bill yet. Approving now will bypass their required review. This will be recorded in the audit history and can't be undone.",
37
+ confirmButton: "Override and approve",
38
+ noApprovalPolicy: {
39
+ title: "Approve this bill?",
40
+ description: "This bill has no approval policy applied. Approving now will be recorded in the audit history and can't be undone.",
41
+ confirmButton: "Approve bill"
42
+ }
142
43
  },
143
- unsavedChanges: {
144
- ...v.unsavedChanges,
145
- ...e?.unsavedChanges
44
+ forceReject: {
45
+ title: "Override approval policy?",
46
+ description: "The below people haven't approved this bill yet. Rejecting now will bypass their required review. This will be recorded in the audit history and can't be undone.",
47
+ confirmButton: "Override and reject",
48
+ noApprovalPolicy: {
49
+ title: "Reject this bill?",
50
+ description: "This bill has no approval policy applied. Rejecting now will be recorded in the audit history and can't be undone.",
51
+ confirmButton: "Reject bill"
52
+ }
146
53
  },
147
- rejectedBanner: {
148
- ...v.rejectedBanner,
149
- ...e?.rejectedBanner
150
- },
151
- approvalPolicyCopy: {
152
- ...v.approvalPolicyCopy,
153
- ...e?.approvalPolicyCopy
154
- },
155
- deleteDraft: {
156
- ...v.deleteDraft,
157
- ...e?.deleteDraft,
158
- dialog: (() => {
159
- let t = {
160
- ...v.deleteDraft.dialog,
161
- ...e?.deleteDraft?.dialog
162
- };
163
- return delete t.reason, t;
164
- })()
54
+ cancelButton: "Cancel"
55
+ },
56
+ actionError: "Couldn't update this bill. Try again.",
57
+ actionSuccess: {
58
+ approve: "Bill approved.",
59
+ reject: "Bill rejected.",
60
+ markAsPaid: "Bill marked as paid.",
61
+ cancel: "Bill canceled.",
62
+ cancelScheduledPayment: "Scheduled payment canceled.",
63
+ reopen: "Bill reopened.",
64
+ forceApprove: "Bill approved, overriding the approval policy.",
65
+ forceReject: "Bill rejected, overriding the approval policy.",
66
+ forceApproveNoApprovalPolicy: "Bill approved.",
67
+ forceRejectNoApprovalPolicy: "Bill rejected."
68
+ }
69
+ }, t = (e) => `Payment scheduled for ${e}`, n = [
70
+ "reject",
71
+ "cancel",
72
+ "cancelScheduledPayment",
73
+ "forceApprove",
74
+ "forceReject"
75
+ ];
76
+ function r(e, t) {
77
+ let n = e.reason ? {
78
+ ...e.reason,
79
+ ...t?.reason
80
+ } : void 0, r = e.noApprovalPolicy ? {
81
+ ...e.noApprovalPolicy,
82
+ ...t?.noApprovalPolicy
83
+ } : void 0, i = {
84
+ ...e,
85
+ ...t,
86
+ reason: n,
87
+ noApprovalPolicy: r
88
+ };
89
+ return n || delete i.reason, r || delete i.noApprovalPolicy, i;
90
+ }
91
+ function i(e, t) {
92
+ let i = {
93
+ ...e,
94
+ ...t
95
+ };
96
+ for (let a of n) i[a] = r(e[a], t?.[a]);
97
+ return i;
98
+ }
99
+ function a(t) {
100
+ let n = e;
101
+ return {
102
+ ...n,
103
+ ...t,
104
+ decisionDialog: i(n.decisionDialog, t?.decisionDialog),
105
+ actionSuccess: {
106
+ ...n.actionSuccess,
107
+ ...t?.actionSuccess
165
108
  }
166
109
  };
167
110
  }
168
- var b = {
169
- createTitle: "New vendor",
170
- editTitle: "Edit vendor",
171
- close: "Close the vendor form",
172
- nameLabel: "Name",
173
- addAddress: "Add address (optional)",
174
- paymentMethodsHeading: "Accepted payment methods",
175
- paymentMethodsDescription: "How and where will the money be sent. Don't have these yet? No problem. You can save this vendor and add their payment details later — you just won't be able to send payments until you do.",
176
- achTitle: "ACH bank transfer",
177
- achDescription: "Fast, direct deposit to the vendor's bank. Arrives in 1–3 business days.",
178
- addBankAccount: "Add bank account",
179
- accountHolderNameLabel: "Account holder name",
180
- routingNumberLabel: "Routing number",
181
- accountNumberLabel: "Account number",
182
- achHelp: "Ask your vendor for this — it's usually on their invoice, W-9, or a payment instructions email they send you.",
183
- cancel: "Cancel",
184
- save: "Save vendor",
185
- discardConfirmTitle: "Discard unsaved changes?",
186
- discardConfirmDescription: "You've made changes to this vendor that haven't been saved. If you leave now, they'll be lost.",
187
- keepEditingAction: "Keep editing",
188
- discardChangesAction: "Discard changes"
111
+ var o = {
112
+ paymentHistorySentLabel: "Payment sent",
113
+ paymentHistoryScheduledLabel: "Payment scheduled",
114
+ paymentHistoryCanceledLabel: "Payment canceled",
115
+ paymentHistoryOtherLabel: "Payment",
116
+ paymentHistoryMethodSuffix: (e, t) => `${e} via ${t}`,
117
+ paymentHistoryOverpaidLabel: (e) => `+${e} overpaid`,
118
+ paymentHistoryMarkedPaidExternalLabel: "Marked as paid manually",
119
+ paymentHistoryMarkedPaidLabel: "Marked as paid",
120
+ paymentHistoryPartiallyPaidExternalLabel: "Partial payment marked manually",
121
+ paymentHistoryPartiallyPaidLabel: "Partial payment",
122
+ paymentHistoryRevertedLabel: "Payment reverted",
123
+ paymentHistoryMethodLabels: {
124
+ ach: "ACH",
125
+ us_ach: "ACH",
126
+ wire: "Wire",
127
+ check: "Check",
128
+ paper_check: "Check",
129
+ bank_account: "Bank transfer",
130
+ card: "Card"
131
+ }
189
132
  };
133
+ function s(e) {
134
+ return {
135
+ ...o.paymentHistoryMethodLabels,
136
+ ...e
137
+ };
138
+ }
190
139
  //#endregion
191
- export { p as BILL_CREATE_MESSAGE_LABELS_EN, v as BILL_CREATE_SCREEN_LABELS_EN, g as BILL_DETAIL_VIEW_LABELS_EN, _ as BILL_HISTORY_LABELS_EN, h as SOURCE_DOCUMENT_CONTAINER_LABELS_EN, b as VENDOR_INLINE_FORM_LABELS_EN, m as VENDOR_SECTION_PROPS_LABELS_EN, y as mergeBillCreateScreenCopy };
140
+ export { e as BILL_DETAIL_ACTIONS_LABELS_EN, o as PAYMENT_HISTORY_LABELS_EN, t as SCHEDULED_SUMMARY_LABEL_EN, a as mergeBillDetailActionsLabels, i as mergeDecisionDialogCopy, s as mergePaymentHistoryMethodLabels };
@@ -1,80 +1,38 @@
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/index103.js";
8
- import "../../ui/dist/index.js";
9
- import { createSourceDocumentPreview as n } from "./index45.js";
10
- import { SOURCE_DOCUMENT_CONTAINER_LABELS_EN as r } from "./index46.js";
11
- import { useEffect as i, useState as a } from "react";
12
- import { jsx as o } from "react/jsx-runtime";
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/index47.js
14
- function s(e) {
15
- let [t, n] = a();
16
- return i(() => {
17
- if (!e) {
18
- n(void 0);
19
- return;
20
- }
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
3
+ var n = {
4
+ previewUnavailable: "Preview not available for this file type.",
5
+ openFile: "Open file"
6
+ };
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"
41
13
  });
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
- }
14
+ if (r.mimetype.startsWith("image/")) return /* @__PURE__ */ e("img", {
15
+ src: r.url,
16
+ alt: r.name,
17
+ className: "ttw:max-h-full ttw:max-w-full ttw:object-contain"
63
18
  });
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
19
+ let a = {
20
+ ...n,
21
+ ...i
22
+ };
23
+ return /* @__PURE__ */ t("div", {
24
+ 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",
25
+ children: [/* @__PURE__ */ e("p", {
26
+ className: "ttw:text-sm ttw:text-muted-foreground",
27
+ children: a.previewUnavailable
28
+ }), /* @__PURE__ */ e("a", {
29
+ href: r.url,
30
+ target: "_blank",
31
+ rel: "noreferrer",
32
+ className: "ttw:text-sm ttw:font-medium ttw:text-primary ttw:underline ttw:underline-offset-2",
33
+ children: a.openFile
34
+ })]
77
35
  });
78
36
  }
79
37
  //#endregion
80
- export { c as SourceDocumentContainer, c as default };
38
+ export { n as SOURCE_DOCUMENT_PREVIEW_LABELS_EN, r as createSourceDocumentPreview };