@tesouro/embedded-components-react 0.9.22 → 0.9.25

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 (98) hide show
  1. package/dist/index.css +82 -55
  2. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index.js +7 -7
  3. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index10.js +14 -8
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index11.js +59 -7
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index12.js +10 -65
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index13.js +9 -10
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index14.js +7 -8
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index15.js +9 -7
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index16.js +29 -11
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index17.js +24 -24
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index18.js +14 -22
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index19.js +155 -14
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index20.js +13 -157
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index21.js +18 -12
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index22.js +32 -15
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index23.js +99 -39
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index24.js +69 -85
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index25.js +3 -85
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index26.js +57 -4
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index27.js +114 -57
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index28.js +190 -111
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js +75 -187
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index3.js +35 -15
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index30.js +67 -75
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js +111 -69
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index32.js +461 -108
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index33.js +102 -452
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index34.js +12 -116
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index35.js +85 -12
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index36.js +67 -73
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index37.js +231 -73
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index38.js +38 -232
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index39.js +245 -38
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index4.js +169 -38
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index40.js +21 -252
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index41.js +534 -23
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index42.js +4 -542
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index43.js +43 -4
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index44.js +236 -39
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index45.js +3 -240
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index46.js +6 -3
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index47.js +63 -4
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index48.js +1 -65
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index5.js +82 -225
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index6.js +45 -83
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index7.js +4 -47
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index8.js +13 -4
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index9.js +8 -13
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index14.js +1 -1
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index15.js +1 -1
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index31.js +1 -1
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index33.js +1 -1
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index34.js +2 -2
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index36.js +5 -5
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index37.js +138 -155
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index48.js +1 -1
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index49.js +1 -1
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/ui/dist/index5.js +1 -1
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-upload/ui/dist/index3.js +2 -2
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index16.js +48 -43
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index17.js +219 -207
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index4.js +13 -13
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index6.js +5 -4
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/feature/dist/index7.js +6 -6
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index18.js +1 -5
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index2.js +1 -1
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index20.js +278 -322
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bills-list/ui/dist/index3.js +1 -1
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillPayWidget.js +1 -1
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/lib/BillPayWidget/BillsTab.js +1 -1
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/mocks/labels.js +1 -1
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index5.js +1 -1
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/pay-bill/ui/dist/index6.js +1 -1
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +18 -16
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index10.js +2 -41
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index11.js +4 -2
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +39 -9
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +2 -78
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index14.js +11 -0
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +78 -2
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +2 -4
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +25 -26
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +4 -2
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +28 -5
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +2 -34
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +7 -2
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +34 -0
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +2 -0
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index6.js +31 -15
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index7.js +1 -54
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index8.js +18 -2
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index9.js +52 -2
  93. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  94. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/theme/themeTokens.js +1 -1
  95. package/dist/packages/shared-ui-shadcn/dist/index.js +4696 -4681
  96. package/package.json +1 -1
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index49.js +0 -1
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +0 -29
@@ -1,195 +1,83 @@
1
- import { AWAITING_APPROVAL_LABEL_EN as e, AWAITING_APPROVAL_UNKNOWN_LABEL_EN as t, BILL_DETAIL_ACTIONS_LABELS_EN as n, PAYMENT_HISTORY_LABELS_EN as r, SCHEDULED_RELATIVE_DAY_LABELS_EN as i, SCHEDULED_STATUS_BADGE_LABEL_EN as a, SCHEDULED_SUMMARY_LABEL_EN as o, mergeBillDetailActionsLabels as s, mergePaymentHistoryMethodLabels as c } from "../../../util/dist/lib/billDetailLabels.js";
2
- import "../../../util/dist/index.js";
3
- import { APPROVAL_POLICY_RULE_COPY_EN as l } from "./index7.js";
4
- import { PAYABLE_AUDIT_HISTORY_LABELS_EN as u } from "./index27.js";
5
- import { SOURCE_DOCUMENT_PREVIEW_LABELS_EN as d } from "./index28.js";
6
- import { ACH_FIELD_GROUP_LABELS_EN as f } from "../../../../shared/counterpart-management/ui/dist/index2.js";
7
- import "../../../../shared/counterpart-management/ui/dist/index.js";
8
- import { BILL_REJECTED_BANNER_LABELS_EN as p } from "../../ui/dist/index39.js";
9
- import { DISCARD_CHANGES_DIALOG_LABELS_EN as m } from "../../ui/dist/index42.js";
10
- import { UNSAVED_BILL_DIALOG_LABELS_EN as h } from "../../ui/dist/index51.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { createSourceDocumentPreview as e } from "./index27.js";
6
+ import { SourceDocumentPanel as t } from "../../ui/dist/index49.js";
11
7
  import "../../ui/dist/index.js";
8
+ import { SOURCE_DOCUMENT_CONTAINER_LABELS_EN as n } from "./index28.js";
9
+ import { useAttachPayableFileMutation as r } from "../../data-access/dist/index5.js";
10
+ import "../../data-access/dist/index.js";
11
+ import { useEffect as i, useState as a } from "react";
12
+ import { jsx as o } from "react/jsx-runtime";
12
13
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index29.js
13
- var g = {
14
- unmappedValidationError: (e, t) => `${e}: ${t}`,
15
- unknownValidationField: "(unknown field)",
16
- requiredField: "This field is required.",
17
- saveFailed: "We could not save this bill. Try again.",
18
- discountTaxBlockedByLineItems: "Discount and Tax can't be saved on a bill with line items. Remove them, then save again.",
19
- vendorResolutionFailed: "We couldn't create this vendor automatically. Select or add a vendor before submitting.",
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
- implausibleInvoiceDate: "Enter an invoice date within the last 10 years, no more than 30 days from today.",
35
- implausibleDueDate: "Enter a due date within the last 10 years and next 5 years.",
36
- dueBeforeInvoiceDate: "Due date must be on or after the invoice date."
37
- }, _ = {
38
- paymentInstructionsValue: (e) => `Account ending in ${e}`,
39
- noMethod: "No payment method on file",
40
- paymentMethodLoading: "Loading payment method...",
41
- paymentMethodUnavailable: "We could not load payment methods. Try again.",
42
- searchFailed: "We could not load vendors. Try again.",
43
- vendorDetailsFailed: "We could not load this vendor. Try again.",
44
- pendingVendorDescription: "Will be created when submitted",
45
- pendingVendorIncompleteDescription: "Add the missing vendor details before submitting",
46
- bankAccountSaveFailed: "We could not save these payment instructions. Try again."
47
- }, v = {
48
- attachFailed: "We could not attach that file. Try again.",
49
- deleteFailed: "We could not remove that document. Try again.",
50
- noDocument: "No document attached to this bill.",
51
- pendingDeletionNotice: "This document will be removed when you save this bill.",
52
- preview: d
53
- }, y = {
54
- ...r,
55
- notProvided: "Not provided",
56
- paymentInstructionsValue: (e) => `Account ending in ${e}`,
57
- paymentInstructionsNotSet: "Not set",
58
- invoiceDateRow: "Invoice date",
59
- dueDateRow: "Due date",
60
- invoiceNumberRow: "Invoice number",
61
- glCodeMissing: "GL code not specified",
62
- glCodeUnavailable: "GL code unavailable",
63
- qtyPriceValue: (e, t) => `${e} x ${t}`,
64
- qtyOnlyValue: (e) => e,
65
- subtotalRow: "Subtotal",
66
- taxRow: "Tax",
67
- discountRow: "Discounts",
68
- totalRow: "Total",
69
- paidOnLabel: (e) => `Paid on ${e}`,
70
- paymentInstructionsSaveError: "Couldn't save payment instructions. Try again.",
71
- paymentInstructionsLinkError: "Payment instructions were saved to the vendor, but couldn't be added to this bill. Try again.",
72
- rejectedByOn: (e, t) => `Rejected by ${e} on ${t}`,
73
- rejectedOn: (e) => `Rejected on ${e}`,
74
- rejectionMessage: (e) => `"${e}"`
75
- }, b = {
76
- newTitle: "New bill",
77
- extractedTitle: (e) => `Bill from ${e}`,
78
- viewTitle: (e) => `Bill from ${e}`,
79
- readOnlyTitle: "Bill details",
80
- addedOn: (e) => `Added on ${e}`,
81
- unsavedChanges: h,
82
- discardChanges: m,
83
- scheduledRelativeDay: i,
84
- scheduledSummary: o,
85
- scheduledStatusBadge: a,
86
- awaitingApprovalNotice: e,
87
- awaitingApprovalUnknownNotice: t,
88
- actions: n,
89
- detail: y,
90
- history: u,
91
- approvalPolicyCopy: l,
92
- deleteDraft: {
93
- menuItem: "Delete draft",
94
- dialog: {
95
- title: "Delete this draft?",
96
- description: "The draft and anything entered on it are removed. This can't be undone.",
97
- confirmButton: "Delete draft"
98
- },
99
- error: "Couldn't delete this draft. Try again."
100
- },
101
- lineItemsGlCodeUnavailable: {
102
- loadError: "Couldn't load GL codes",
103
- noAccess: "You don't have access to GL codes",
104
- empty: "No GL codes set up yet"
105
- },
106
- rejectedBanner: p
107
- };
108
- function x(e) {
109
- return {
110
- ...b,
111
- ...e,
112
- actions: s(e?.actions),
113
- detail: {
114
- ...b.detail,
115
- ...e?.detail,
116
- paymentHistoryMethodLabels: c(e?.detail?.paymentHistoryMethodLabels)
117
- },
118
- history: {
119
- ...b.history,
120
- ...e?.history
121
- },
122
- lineItemsGlCodeUnavailable: {
123
- ...b.lineItemsGlCodeUnavailable,
124
- ...e?.lineItemsGlCodeUnavailable
125
- },
126
- unsavedChanges: {
127
- ...b.unsavedChanges,
128
- ...e?.unsavedChanges
129
- },
130
- discardChanges: {
131
- ...b.discardChanges,
132
- ...e?.discardChanges
133
- },
134
- rejectedBanner: {
135
- ...b.rejectedBanner,
136
- ...e?.rejectedBanner
137
- },
138
- approvalPolicyCopy: {
139
- ...b.approvalPolicyCopy,
140
- ...e?.approvalPolicyCopy
141
- },
142
- scheduledRelativeDay: {
143
- ...b.scheduledRelativeDay,
144
- ...e?.scheduledRelativeDay
145
- },
146
- deleteDraft: {
147
- ...b.deleteDraft,
148
- ...e?.deleteDraft,
149
- dialog: (() => {
150
- let t = {
151
- ...b.deleteDraft.dialog,
152
- ...e?.deleteDraft?.dialog
153
- };
154
- return delete t.reason, t;
155
- })()
14
+ function s(e) {
15
+ let [t, n] = a();
16
+ return i(() => {
17
+ if (!e) {
18
+ n(void 0);
19
+ return;
156
20
  }
157
- };
21
+ let t = URL.createObjectURL(e);
22
+ return n(t), () => URL.revokeObjectURL(t);
23
+ }, [e]), t;
158
24
  }
159
- var S = {
160
- createTitle: "New vendor details",
161
- editTitle: "Edit vendor",
162
- switchVendorFieldLabel: "Switch to a different vendor",
163
- vendorFieldLabel: "Vendor",
164
- newVendorBadge: "New vendor",
165
- unmatchedVendorHelper: "We couldn't match this vendor to your list. Search to choose an existing vendor, or finish adding a new one below.",
166
- resultsHeading: "Your vendors",
167
- addAsNewVendor: (e) => `Add "${e}" as a new vendor`,
168
- addAsNewVendorDescription: "Uses the details extracted from this bill",
169
- fieldsNeedAttention: (e) => `${e} ${e === 1 ? "field needs" : "fields need"} attention`,
170
- nameLabel: "Business name",
171
- cancel: "Cancel",
172
- save: "Save",
173
- cancelAriaLabel: "Cancel vendor",
174
- saveAriaLabel: "Save vendor",
175
- paymentInstructionsHeading: "Payment instructions",
176
- paymentInstructionsDescription: "How and where will the money be sent. This information is required to send a payment.",
177
- paymentInstructionsExtracted: "We read these from the bill. Check them before saving.",
178
- ach: f
179
- };
180
- function C(e) {
181
- return {
182
- ...S,
183
- ...e,
184
- ach: {
185
- ...S.ach,
186
- ...e?.ach,
187
- fieldMarkers: {
188
- ...S.ach.fieldMarkers,
189
- ...e?.ach?.fieldMarkers
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
+ ...n,
28
+ ...p,
29
+ preview: {
30
+ ...n.preview,
31
+ ...p?.preview
32
+ }
33
+ }, w = r(), T = s(m), E = !!(a && !v || m);
34
+ if (!E && (c || w.isPending)) return /* @__PURE__ */ o(t, {
35
+ mode: "loading",
36
+ fileName: l,
37
+ labels: p?.panel
38
+ });
39
+ if (!E && u) return /* @__PURE__ */ o("div", {
40
+ className: "ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4 ttw:text-sm ttw:text-muted-foreground",
41
+ children: C.noDocument
42
+ });
43
+ if (!E) return /* @__PURE__ */ o(t, {
44
+ mode: "upload",
45
+ labels: p?.panel,
46
+ uploadStatus: w.isPending || x ? "uploading" : "idle",
47
+ uploadErrorMessage: w.isError ? C.attachFailed : S ? C.deleteFailed : void 0,
48
+ noticeMessage: v && !S ? C.pendingDeletionNotice : void 0,
49
+ onFilesSelected: (e) => {
50
+ let [t] = e;
51
+ if (t) {
52
+ if (i) {
53
+ let e = () => w.mutate({
54
+ path: { payable_id: i },
55
+ file: t
56
+ });
57
+ if (v && b) {
58
+ b().then(e, () => void 0);
59
+ return;
60
+ }
61
+ e();
62
+ } else h?.(t);
190
63
  }
191
64
  }
192
- };
65
+ });
66
+ let D = a?.name ?? m?.name ?? "", O = e(a || {
67
+ name: D,
68
+ url: T ?? "",
69
+ mimetype: m?.type ?? ""
70
+ }, C.preview);
71
+ return /* @__PURE__ */ o(t, {
72
+ mode: "document",
73
+ labels: p?.panel,
74
+ fileName: D,
75
+ preview: O,
76
+ isDeleting: x,
77
+ deleteErrorMessage: S ? C.deleteFailed : void 0,
78
+ onDownload: a ? () => window.open(a.url, "_blank", "noopener,noreferrer") : void 0,
79
+ onDelete: u ? void 0 : a && i ? y : _ ? void 0 : g
80
+ });
193
81
  }
194
82
  //#endregion
195
- export { g as BILL_CREATE_MESSAGE_LABELS_EN, y as BILL_DETAIL_VIEW_LABELS_EN, b as BILL_DIALOG_COPY_EN, v as SOURCE_DOCUMENT_CONTAINER_LABELS_EN, S as VENDOR_INLINE_FORM_LABELS_EN, _ as VENDOR_SECTION_PROPS_LABELS_EN, x as mergeBillDialogCopy, C as mergeVendorInlineFormLabels };
83
+ export { c as SourceDocumentContainer, c as default };
@@ -1,17 +1,37 @@
1
- import { BanIcon as e, Trash2Icon as t } from "lucide-react";
2
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index3.js
3
- function n(n, r) {
4
- return {
5
- title: n.title,
6
- description: n.description,
7
- confirmButton: n.confirmButton,
8
- presentation: {
9
- alignment: "center",
10
- icon: r === "delete" ? t : e,
11
- tone: r === "confirm" ? "default" : "destructive",
12
- actionWidth: "equal"
13
- }
14
- };
15
- }
2
+ var e = {
3
+ possibleDuplicateTitle: ({ otherCount: e, vendorLabel: t, invoiceNumberLabel: n }) => {
4
+ let r = e === 1 ? "1 other" : `${e} others`, i = t ? ` from ${t}` : "";
5
+ return n ? `Possible duplicate. This bill and ${r}${i} have invoice number ${n}.` : `Possible duplicate. This bill and ${r}${i} look the same.`;
6
+ },
7
+ openRow: ({ vendorLabel: e, invoiceNumberLabel: t, addedOnLabel: n }) => `View bill — ${e}, invoice number ${t}, created ${n}`,
8
+ deleteBillButton: "Delete this bill",
9
+ deleteConfirmTitle: "Delete duplicate bill?",
10
+ deleteConfirmDescription: "You can't undo this action.",
11
+ deleteConfirmButton: "Delete duplicate bill",
12
+ deleteConfirmBackButton: "Cancel",
13
+ cancelBillButton: "Cancel this bill",
14
+ confirmBillButton: "Confirm duplicate",
15
+ cancelConfirmTitle: "Cancel duplicate bill?",
16
+ cancelConfirmDescription: "You can't undo this action.",
17
+ cancelConfirmButton: "Cancel this bill",
18
+ cancelConfirmBackButton: "Back",
19
+ confirmDuplicateTitle: "Confirm duplicate?",
20
+ confirmDuplicateDescription: "This bill is already cancelled. This records it as a duplicate.",
21
+ notDuplicateAction: "Not a duplicate",
22
+ notDuplicateConfirmTitle: "Mark as not a duplicate?",
23
+ notDuplicateConfirmDescription: "You can't undo this action.",
24
+ notDuplicateConfirmButton: "Not a duplicate",
25
+ notDuplicateConfirmBackButton: "Back",
26
+ currentBillBadge: "This bill",
27
+ showMoreRows: (e) => `Show ${e} more`,
28
+ deletedToast: "Duplicate deleted",
29
+ cancelledToast: "Duplicate cancelled",
30
+ confirmedToast: "Duplicate confirmed",
31
+ dismissedToast: "Marked as “not a duplicate”.",
32
+ removedToast: "Duplicate removed",
33
+ verdictFailedToast: "Couldn't update this duplicate. Try again.",
34
+ allResolvedToast: "All possible duplicates resolved"
35
+ };
16
36
  //#endregion
17
- export { n as duplicateRemovalPrompt };
37
+ export { e as DUPLICATE_BILLS_LABELS_EN };
@@ -1,83 +1,75 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { createSourceDocumentPreview as e } from "./index28.js";
6
- import { SourceDocumentPanel as t } from "../../ui/dist/index49.js";
7
- import "../../ui/dist/index.js";
8
- import { SOURCE_DOCUMENT_CONTAINER_LABELS_EN as n } from "./index29.js";
9
- import { useAttachPayableFileMutation as r } from "../../data-access/dist/index5.js";
10
- import "../../data-access/dist/index.js";
11
- import { useEffect as i, useState as a } from "react";
12
- import { jsx as o } from "react/jsx-runtime";
1
+ import { isStateValid as e } from "../../../../shared/util/dist/lib/usStates.js";
2
+ import "../../../../shared/util/dist/index.js";
3
+ import { emptyCounterpartFormValues as t, hasCounterpartFormErrors as n, validateCounterpartForm as r } from "../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
4
+ import "../../../../shared/counterpart-management/feature/dist/index.js";
13
5
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index30.js
6
+ function i(e) {
7
+ return e?.trim() ?? "";
8
+ }
9
+ function a(t) {
10
+ let n = i(t).toUpperCase();
11
+ return e(n) ? n : "";
12
+ }
13
+ function o(e) {
14
+ let t = i(e.bank_account?.account_holder_name), n = i(e.bank_account?.routing_number), r = i(e.bank_account?.account_number);
15
+ if (t || n || r) return {
16
+ accountHolderName: t || i(e.name),
17
+ routingNumber: n,
18
+ accountNumber: r
19
+ };
20
+ }
14
21
  function s(e) {
15
- let [t, n] = a();
16
- return i(() => {
17
- if (!e) {
18
- n(void 0);
19
- return;
22
+ if (!e) return;
23
+ let t = {
24
+ legalName: i(e.name),
25
+ email: i(e.email),
26
+ phone: i(e.phone),
27
+ address: {
28
+ line1: i(e.address?.line1),
29
+ line2: i(e.address?.line2),
30
+ city: i(e.address?.city),
31
+ state: a(e.address?.state),
32
+ postalCode: i(e.address?.postal_code)
33
+ },
34
+ bankAccount: o(e)
35
+ };
36
+ return t.legalName || t.email || t.phone || Object.values(t.address).some(Boolean) || t.bankAccount ? t : void 0;
37
+ }
38
+ function c(e) {
39
+ let a = s(e);
40
+ if (!a || i(e?.address?.country).toUpperCase() !== "US") return !1;
41
+ let o = t("organization", "vendor");
42
+ return !n(r({
43
+ ...o,
44
+ ...a,
45
+ bankAccount: {
46
+ accountHolderName: i(e?.bank_account?.account_holder_name),
47
+ routingNumber: i(e?.bank_account?.routing_number),
48
+ accountNumber: i(e?.bank_account?.account_number)
20
49
  }
21
- let t = URL.createObjectURL(e);
22
- return n(t), () => URL.revokeObjectURL(t);
23
- }, [e]), t;
50
+ }, void 0, "vendor"));
24
51
  }
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 = {
52
+ function l(e, t, n) {
53
+ let r = (e) => i(e) || void 0, { address: a } = e;
54
+ return {
27
55
  ...n,
28
- ...p,
29
- preview: {
30
- ...n.preview,
31
- ...p?.preview
32
- }
33
- }, w = r(), T = s(m), E = !!(a && !v || m);
34
- if (!E && (c || w.isPending)) return /* @__PURE__ */ o(t, {
35
- mode: "loading",
36
- fileName: l,
37
- labels: p?.panel
38
- });
39
- if (!E && u) return /* @__PURE__ */ o("div", {
40
- className: "ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4 ttw:text-sm ttw:text-muted-foreground",
41
- children: C.noDocument
42
- });
43
- if (!E) return /* @__PURE__ */ o(t, {
44
- mode: "upload",
45
- labels: p?.panel,
46
- uploadStatus: w.isPending || x ? "uploading" : "idle",
47
- uploadErrorMessage: w.isError ? C.attachFailed : S ? C.deleteFailed : void 0,
48
- noticeMessage: v && !S ? C.pendingDeletionNotice : void 0,
49
- onFilesSelected: (e) => {
50
- let [t] = e;
51
- if (t) {
52
- if (i) {
53
- let e = () => w.mutate({
54
- path: { payable_id: i },
55
- file: t
56
- });
57
- if (v && b) {
58
- b().then(e, () => void 0);
59
- return;
60
- }
61
- e();
62
- } else h?.(t);
63
- }
56
+ name: r(e.entityType === "individual" ? `${e.firstName} ${e.lastName}` : e.legalName),
57
+ email: r(e.email),
58
+ phone: r(e.phone),
59
+ address: {
60
+ ...n?.address,
61
+ line1: r(a.line1),
62
+ line2: r(a.line2),
63
+ city: r(a.city),
64
+ state: r(a.state),
65
+ postal_code: r(a.postalCode)
66
+ },
67
+ bank_account: {
68
+ account_holder_name: r(t.accountHolderName),
69
+ routing_number: r(t.routingNumber),
70
+ account_number: r(t.accountNumber)
64
71
  }
65
- });
66
- let D = a?.name ?? m?.name ?? "", O = e(a || {
67
- name: D,
68
- url: T ?? "",
69
- mimetype: m?.type ?? ""
70
- }, C.preview);
71
- return /* @__PURE__ */ o(t, {
72
- mode: "document",
73
- labels: p?.panel,
74
- fileName: D,
75
- preview: O,
76
- isDeleting: x,
77
- deleteErrorMessage: S ? C.deleteFailed : void 0,
78
- onDownload: a ? () => window.open(a.url, "_blank", "noopener,noreferrer") : void 0,
79
- onDelete: u ? void 0 : a && i ? y : _ ? void 0 : g
80
- });
72
+ };
81
73
  }
82
74
  //#endregion
83
- export { c as SourceDocumentContainer, c as default };
75
+ export { s as buildVendorPrefill, c as canAutoCreateVendor, l as toCounterpartRawData };
@@ -1,75 +1,117 @@
1
- import { isStateValid as e } from "../../../../shared/util/dist/lib/usStates.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { Button as e } from "../../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { getStateOptions as t } from "../../../../shared/util/dist/lib/usStates.js";
2
7
  import "../../../../shared/util/dist/index.js";
3
- import { emptyCounterpartFormValues as t, hasCounterpartFormErrors as n, validateCounterpartForm as r } from "../../../../shared/counterpart-management/feature/dist/lib/helpers.js";
8
+ import { AchFieldGroup as n } from "../../../../shared/counterpart-management/ui/dist/index5.js";
9
+ import { CounterpartFormFields as r, countErrors as i, useFocusFirstInvalidField as a } from "../../../../shared/counterpart-management/ui/dist/index10.js";
10
+ import "../../../../shared/counterpart-management/ui/dist/index.js";
11
+ import { VendorSearchCombobox as o } from "../../ui/dist/index24.js";
12
+ import "../../ui/dist/index.js";
13
+ import { mergeVendorInlineFormLabels as s } from "./index28.js";
4
14
  import "../../../../shared/counterpart-management/feature/dist/index.js";
15
+ import { useMemo as c } from "react";
16
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
5
17
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/bill-detail/feature/dist/index31.js
6
- function i(e) {
7
- return e?.trim() ?? "";
8
- }
9
- function a(t) {
10
- let n = i(t).toUpperCase();
11
- return e(n) ? n : "";
12
- }
13
- function o(e) {
14
- let t = i(e.bank_account?.account_holder_name), n = i(e.bank_account?.routing_number), r = i(e.bank_account?.account_number);
15
- if (t || n || r) return {
16
- accountHolderName: t || i(e.name),
17
- routingNumber: n,
18
- accountNumber: r
19
- };
20
- }
21
- function s(e) {
22
- if (!e) return;
23
- let t = {
24
- legalName: i(e.name),
25
- email: i(e.email),
26
- phone: i(e.phone),
27
- address: {
28
- line1: i(e.address?.line1),
29
- line2: i(e.address?.line2),
30
- city: i(e.address?.city),
31
- state: a(e.address?.state),
32
- postalCode: i(e.address?.postal_code)
33
- },
34
- bankAccount: o(e)
35
- };
36
- return t.legalName || t.email || t.phone || Object.values(t.address).some(Boolean) || t.bankAccount ? t : void 0;
37
- }
38
- function c(e) {
39
- let a = s(e);
40
- if (!a || i(e?.address?.country).toUpperCase() !== "US") return !1;
41
- let o = t("organization", "vendor");
42
- return !n(r({
43
- ...o,
44
- ...a,
45
- bankAccount: {
46
- accountHolderName: i(e?.bank_account?.account_holder_name),
47
- routingNumber: i(e?.bank_account?.routing_number),
48
- accountNumber: i(e?.bank_account?.account_number)
49
- }
50
- }, void 0, "vendor"));
51
- }
52
- function l(e, t, n) {
53
- let r = (e) => i(e) || void 0, { address: a } = e;
54
- return {
55
- ...n,
56
- name: r(e.entityType === "individual" ? `${e.firstName} ${e.lastName}` : e.legalName),
57
- email: r(e.email),
58
- phone: r(e.phone),
59
- address: {
60
- ...n?.address,
61
- line1: r(a.line1),
62
- line2: r(a.line2),
63
- city: r(a.city),
64
- state: r(a.state),
65
- postal_code: r(a.postalCode)
66
- },
67
- bank_account: {
68
- account_holder_name: r(t.accountHolderName),
69
- routing_number: r(t.routingNumber),
70
- account_number: r(t.accountNumber)
18
+ function d({ mode: d, values: f, errors: p, onChange: m, onAddressChange: h, onCancel: g, onSave: _, isSaving: v = !1, search: y, paymentInstructions: b, labels: x }) {
19
+ let S = c(() => s(x), [x]), C = c(() => t(), []), w = a(p ?? {}), T = i({
20
+ ...p,
21
+ form: void 0,
22
+ bankAccount: void 0
23
+ }) + i(b?.errors), E = y?.query.trim() ?? "", D = f.entityType === "individual" ? `${f.firstName} ${f.lastName}`.trim() : f.legalName, O = y && d === "create" ? /* @__PURE__ */ l(o, {
24
+ ...y,
25
+ onAddVendor: E && E !== D.trim() ? y.onAddVendor : void 0,
26
+ selectedLabel: D,
27
+ badge: S.newVendorBadge,
28
+ helperText: S.unmatchedVendorHelper,
29
+ resultsHeading: S.resultsHeading,
30
+ addVendorDescription: S.addAsNewVendorDescription,
31
+ labels: {
32
+ fieldLabel: S.vendorFieldLabel,
33
+ addVendorAction: S.addAsNewVendor(E)
71
34
  }
72
- };
35
+ }) : null;
36
+ return /* @__PURE__ */ u("div", {
37
+ ref: w,
38
+ className: "ttw:flex ttw:flex-col ttw:gap-4",
39
+ children: [O, /* @__PURE__ */ u("div", {
40
+ className: "ttw:flex ttw:flex-col ttw:gap-6 ttw:rounded-lg ttw:border ttw:border-primary ttw:bg-surface-subtle ttw:p-6 ttw:[&_[data-slot=input]]:bg-background ttw:[&_[data-slot=select-trigger]]:bg-background",
41
+ children: [
42
+ /* @__PURE__ */ u("div", {
43
+ className: "ttw:flex ttw:items-baseline ttw:justify-between ttw:gap-2",
44
+ children: [/* @__PURE__ */ l("p", {
45
+ className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
46
+ children: d === "edit" ? S.editTitle : S.createTitle
47
+ }), T > 0 ? /* @__PURE__ */ l("p", {
48
+ className: "ttw:text-sm ttw:text-destructive",
49
+ children: S.fieldsNeedAttention(T)
50
+ }) : null]
51
+ }),
52
+ y && d === "edit" ? /* @__PURE__ */ l(o, {
53
+ ...y,
54
+ labels: { fieldLabel: S.switchVendorFieldLabel }
55
+ }) : null,
56
+ /* @__PURE__ */ l(r, {
57
+ mode: d,
58
+ counterpartMode: "vendor",
59
+ values: f,
60
+ errors: p,
61
+ stateOptions: C,
62
+ onChange: m,
63
+ onAddressChange: h,
64
+ sections: {
65
+ entityType: !0,
66
+ profileHeading: !1,
67
+ addressHeading: !1,
68
+ title: !1,
69
+ taxId: !1,
70
+ address: !0,
71
+ bankAccount: !1
72
+ },
73
+ labels: { businessNameLabel: S.nameLabel }
74
+ }),
75
+ b ? /* @__PURE__ */ u("div", {
76
+ className: "ttw:flex ttw:flex-col ttw:gap-3",
77
+ children: [/* @__PURE__ */ u("div", {
78
+ className: "ttw:flex ttw:flex-col ttw:gap-1",
79
+ children: [/* @__PURE__ */ l("p", {
80
+ className: "ttw:text-sm ttw:font-semibold ttw:text-foreground",
81
+ children: S.paymentInstructionsHeading
82
+ }), /* @__PURE__ */ l("p", {
83
+ className: "ttw:text-sm ttw:text-muted-foreground",
84
+ children: b.isExtracted ? S.paymentInstructionsExtracted : S.paymentInstructionsDescription
85
+ })]
86
+ }), /* @__PURE__ */ l(n, {
87
+ idPrefix: "vendor-inline-ach",
88
+ values: b.values,
89
+ errors: b.errors,
90
+ onChange: b.onChange,
91
+ labels: S.ach
92
+ })]
93
+ }) : null,
94
+ /* @__PURE__ */ u("div", {
95
+ className: "ttw:flex ttw:justify-end ttw:gap-2",
96
+ children: [/* @__PURE__ */ l(e, {
97
+ type: "button",
98
+ variant: "outline",
99
+ onClick: g,
100
+ "aria-label": S.cancelAriaLabel,
101
+ disabled: v,
102
+ children: S.cancel
103
+ }), _ ? /* @__PURE__ */ l(e, {
104
+ type: "button",
105
+ onClick: _,
106
+ "aria-label": S.saveAriaLabel,
107
+ loading: v,
108
+ disabled: v,
109
+ children: S.save
110
+ }) : null]
111
+ })
112
+ ]
113
+ })]
114
+ });
73
115
  }
74
116
  //#endregion
75
- export { s as buildVendorPrefill, c as canAutoCreateVendor, l as toCounterpartRawData };
117
+ export { d as VendorInlineForm, d as default };