@tesouro/embedded-components-react 0.2.254 → 0.2.255

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 (138) hide show
  1. package/dist/core.js +1 -1
  2. package/dist/index.css +15 -0
  3. package/dist/index.js +2 -2
  4. package/dist/lib/BillPayWidget.d.ts +151 -151
  5. package/dist/lib/BillPayWidget.js +1 -1
  6. package/dist/lib/InsightsWidget.js +1 -1
  7. package/dist/libs/tesouro-embedded-components-react/accept-disclosures-widget/feature/dist/index4.js +1 -1
  8. package/dist/libs/tesouro-embedded-components-react/balances-widget/feature/dist/index3.js +4 -4
  9. package/dist/libs/tesouro-embedded-components-react/bank-account-onboarding-widget/feature/dist/index17.js +2 -2
  10. package/dist/libs/tesouro-embedded-components-react/bank-accounts-widget/feature/dist/index7.js +1 -1
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index.js +10 -0
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index10.js +40 -0
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index11.js +36 -0
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index3.js +28 -0
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index4.js +22 -0
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index5.js +7 -0
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index6.js +75 -0
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index7.js +166 -0
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index8.js +17 -0
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/data-access/dist/index9.js +30 -0
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index.js +15 -1
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +9 -0
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +99 -0
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +4 -0
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +4 -0
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +43 -0
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +1 -0
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +50 -0
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +8 -0
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +7 -0
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +93 -0
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js +42 -2
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +3 -0
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +8 -0
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +9 -0
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +85 -0
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +3 -0
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +8 -0
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +112 -0
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +1 -0
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +25 -0
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index3.js +51 -35
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index4.js +235 -1
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +106 -7
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +35 -88
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +122 -1
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +36 -22
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +74 -0
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +15 -8
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index10.js +24 -3
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index11.js +1 -0
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index12.js +12 -0
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index13.js +83 -3
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index14.js +1 -0
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index15.js +18 -0
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +205 -4
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +1 -0
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +10 -0
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +89 -4
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +1 -0
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +10 -0
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +131 -4
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +1 -0
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +10 -0
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +45 -5
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +17 -1
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +149 -7
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index3.js +73 -4
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index33.js +14 -0
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +24 -2
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index35.js +1 -0
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +24 -1
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +145 -6
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +10 -0
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +8 -0
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +93 -4
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +1 -0
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +7 -0
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +30 -2
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +1 -0
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +13 -0
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +88 -5
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index7.js +62 -5
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index9.js +7 -0
  85. package/dist/libs/tesouro-embedded-components-react/cards-widget/feature/dist/index4.js +2 -2
  86. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index4.js +13 -13
  87. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index7.js +58 -58
  88. package/dist/libs/tesouro-embedded-components-react/counterparts-widget/feature/dist/index8.js +19 -19
  89. package/dist/libs/tesouro-embedded-components-react/gl-code-table-widget/feature/dist/index7.js +1 -1
  90. package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index.js +2 -2
  91. package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index10.js +13 -62
  92. package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index11.js +66 -0
  93. package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index7.js +11 -109
  94. package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index8.js +113 -21
  95. package/dist/libs/tesouro-embedded-components-react/insights-widget/feature/dist/index9.js +21 -15
  96. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index7.js +1 -1
  97. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +2 -2
  98. package/dist/libs/tesouro-embedded-components-react/linked-accounts-widget/feature/dist/index8.js +3 -3
  99. package/dist/libs/tesouro-embedded-components-react/profile-widget/feature/dist/index4.js +1 -1
  100. package/dist/libs/tesouro-embedded-components-react/shared/approval-policy/feature/dist/lib/policyViewModel.js +1 -1
  101. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/index.js +15 -15
  102. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/helpers.js +9 -9
  103. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useAddressForm.js +1 -1
  104. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useCounterpartForm.js +32 -29
  105. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/feature/dist/lib/useSubEntityForm.js +1 -1
  106. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index.js +7 -7
  107. package/dist/libs/tesouro-embedded-components-react/shared/counterpart-management/ui/dist/index8.js +232 -220
  108. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/index.js +19 -19
  109. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/@tanstack/react-query.gen.js +171 -138
  110. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/client/index.js +1 -0
  111. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/core/bodySerializer.gen.js +9 -2
  112. package/dist/libs/tesouro-embedded-components-react/shared/data-access/dist/lib/rest/sdk.gen.js +404 -293
  113. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/WidgetProvider/WidgetTokenRefreshProvider.js +1 -1
  114. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  115. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/index.js +1 -1
  116. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/MeasureUnitsManagerContainer.js +1 -1
  117. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/lib/useProductForm.js +1 -1
  118. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/{index3.js → lib/amountOutputToMajorUnits.js} +1 -1
  119. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/{index14.js → lib/apiErrors.js} +1 -1
  120. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/{index2.js → lib/coerceAmountValueToMinorUnits.js} +1 -1
  121. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/formatCalendarDate.js +13 -0
  122. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/{index4.js → lib/formatMoneyExact.js} +1 -1
  123. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/{index5.js → lib/formatPhoneDisplay.js} +1 -1
  124. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/{index6.js → lib/getInitials.js} +1 -1
  125. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/{index7.js → lib/normalizeAmountOutputCurrencyCode.js} +1 -1
  126. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/{index8.js → lib/parseAmountOutputMajorUnits.js} +1 -1
  127. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/{index9.js → lib/parseDecimalAmountToMinorUnits.js} +2 -2
  128. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/{index10.js → lib/sumAmountOutputsMajorUnits.js} +3 -3
  129. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/{index11.js → lib/usStates.js} +1 -1
  130. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/{index13.js → lib/widgetDomEvents.js} +1 -1
  131. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/{index12.js → lib/widgetTokenManager.js} +1 -1
  132. package/dist/libs/tesouro-embedded-components-react/tags-widget/feature/dist/index8.js +1 -1
  133. package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index11.js +1 -1
  134. package/dist/libs/tesouro-embedded-components-react/team-widget/feature/dist/index4.js +1 -1
  135. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index4.js +4 -4
  136. package/dist/libs/tesouro-embedded-components-react/transfers-widget/feature/dist/index5.js +1 -1
  137. package/dist/packages/shared-ui-shadcn/dist/index.js +3593 -3582
  138. package/package.json +1 -1
@@ -1,4 +1,44 @@
1
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index2.js
2
- var e = { Mounted: "bill_pay_widget.mounted" }, t = "bill_pay_widget";
2
+ var e = {
3
+ unmappedValidationError: (e, t) => `${e}: ${t}`,
4
+ unknownValidationField: "(unknown field)",
5
+ requiredField: "This field is required.",
6
+ saveFailed: "We could not save this bill. Try again.",
7
+ finalizeFailed: "We could not submit this bill. Try again.",
8
+ draftSaved: "Bill saved as a draft.",
9
+ billFinalized: "Bill submitted for approval."
10
+ }, t = {
11
+ achMethod: "via ACH bank transfer",
12
+ noMethod: "No payment method on file",
13
+ accountHolder: "Account holder",
14
+ routingNumber: "Routing number",
15
+ accountNumber: "Account number",
16
+ searchFailed: "We could not load vendors. Try again.",
17
+ vendorDetailsFailed: "We could not load this vendor. Try again."
18
+ }, n = {
19
+ attachFailed: "We could not attach that file. Try again.",
20
+ saveBeforeAttaching: "Save this bill before attaching a document."
21
+ }, r = {
22
+ newTitle: "Add bill",
23
+ extractedTitle: (e) => `Bill from ${e}`,
24
+ discardConfirm: "Discard your changes to this bill?"
25
+ }, i = {
26
+ createTitle: "New vendor",
27
+ editTitle: "Edit vendor",
28
+ close: "Close the vendor form",
29
+ nameLabel: "Name",
30
+ addAddress: "Add address (optional)",
31
+ paymentMethodsHeading: "Accepted payment methods",
32
+ 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.",
33
+ achTitle: "ACH bank transfer",
34
+ achDescription: "Fast, direct deposit to the vendor's bank. Arrives in 1–3 business days.",
35
+ addBankAccount: "Add bank account",
36
+ accountHolderNameLabel: "Account holder name",
37
+ routingNumberLabel: "Routing number",
38
+ accountNumberLabel: "Account number",
39
+ achHelp: "Ask your vendor for this — it's usually on their invoice, W-9, or a payment instructions email they send you.",
40
+ cancel: "Cancel",
41
+ save: "Save vendor"
42
+ };
3
43
  //#endregion
4
- export { e as BillPayWidgetAnalyticsEvent, t as WIDGET_NAME };
44
+ export { e as BILL_CREATE_MESSAGE_LABELS_EN, r as BILL_CREATE_SCREEN_LABELS_EN, n as SOURCE_DOCUMENT_CONTAINER_LABELS_EN, i as VENDOR_INLINE_FORM_LABELS_EN, t as VENDOR_SECTION_PROPS_LABELS_EN };
@@ -0,0 +1,3 @@
1
+ import "./index17.js";
2
+ import "./index18.js";
3
+ import "./index19.js";
@@ -0,0 +1,8 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js
2
+ var e = (e) => [
3
+ "bill-pay",
4
+ "upload-queue",
5
+ e ?? ""
6
+ ];
7
+ //#endregion
8
+ export { e as billPayUploadQueueKey };
@@ -0,0 +1,9 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js
2
+ var e = {
3
+ uploadingSummary: (e) => `Uploading and scanning ${e} ${e === 1 ? "file" : "files"}`,
4
+ completeSummary: (e) => `${e} ${e === 1 ? "upload" : "uploads"} complete`,
5
+ readyCaption: (e) => `${e} new ${e === 1 ? "bill" : "bills"} ready`,
6
+ failedCaption: (e) => `${e} failed to upload`
7
+ };
8
+ //#endregion
9
+ export { e as BILL_UPLOAD_QUEUE_LABELS_EN };
@@ -0,0 +1,85 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { useEmbedApi as e } from "../../../shared/data-access/dist/lib/EmbedApiContext.js";
6
+ import { useUploadPayableFromFileMutation as t } from "../../data-access/dist/index7.js";
7
+ import { usePayableOcrQueries as n } from "../../data-access/dist/index9.js";
8
+ import "../../data-access/dist/index.js";
9
+ import { billPayUploadQueueKey as r } from "./index21.js";
10
+ import { BILL_UPLOAD_QUEUE_LABELS_EN as i } from "./index22.js";
11
+ import { useCallback as a, useEffect as o, useMemo as s, useState as c } from "react";
12
+ import { useQuery as l, useQueryClient as u } from "@tanstack/react-query";
13
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js
14
+ function d({ onOpenBill: d, labels: f } = {}) {
15
+ let p = {
16
+ ...i,
17
+ ...f
18
+ }, { organizationId: m } = e(), h = u(), g = s(() => r(m), [m]), _ = t(), [v, y] = c(!1), { data: b = [] } = l({
19
+ queryKey: g,
20
+ queryFn: () => h.getQueryData(g) ?? [],
21
+ staleTime: Infinity,
22
+ gcTime: Infinity,
23
+ initialData: []
24
+ }), x = a((e, t) => {
25
+ h.setQueryData(g, (n) => (n ?? []).map((n) => n.localId === e ? {
26
+ ...n,
27
+ ...t
28
+ } : n));
29
+ }, [h, g]), S = a((e) => {
30
+ y(!1);
31
+ for (let t of e) {
32
+ let e = crypto.randomUUID();
33
+ h.setQueryData(g, (n) => [...n ?? [], {
34
+ localId: e,
35
+ fileName: t.name,
36
+ status: "uploading"
37
+ }]), _.mutateAsync({ file: t }).then((t) => x(e, { payableId: t?.id })).catch(() => x(e, { status: "failed" }));
38
+ }
39
+ }, [
40
+ x,
41
+ h,
42
+ g,
43
+ _
44
+ ]), C = n({ payableIds: b.filter((e) => e.status === "uploading" && e.payableId).map((e) => e.payableId) });
45
+ o(() => {
46
+ for (let { payableId: e, ocrStatus: t, isError: n } of C) {
47
+ let r = b.find((t) => t.payableId === e && t.status === "uploading");
48
+ r && (t === "success" ? x(r.localId, { status: "ready" }) : (n || t === "error" || t === "canceled") && x(r.localId, { status: "failed" }));
49
+ }
50
+ }, [
51
+ b,
52
+ C,
53
+ x
54
+ ]);
55
+ let w = b.filter((e) => e.status === "uploading"), T = b.filter((e) => e.status === "ready"), E = b.filter((e) => e.status === "failed"), D = (e) => ({
56
+ id: e.localId,
57
+ fileName: e.fileName,
58
+ status: e.status,
59
+ onOpen: e.status === "ready" && e.payableId && d ? () => d(e.payableId) : void 0
60
+ }), O = w.length ? [{
61
+ id: "in-progress",
62
+ items: b.map(D)
63
+ }] : [...T.length ? [{
64
+ id: "ready",
65
+ caption: p.readyCaption(T.length),
66
+ items: T.map(D)
67
+ }] : [], ...E.length ? [{
68
+ id: "failed",
69
+ caption: p.failedCaption(E.length),
70
+ items: E.map(D)
71
+ }] : []], k = w.length ? p.uploadingSummary(b.length) : T.length ? p.completeSummary(T.length) : p.failedCaption(E.length), A = a(() => {
72
+ h.setQueryData(g, []);
73
+ }, [h, g]);
74
+ return {
75
+ enqueue: S,
76
+ sections: O,
77
+ summaryLabel: k,
78
+ collapsed: v,
79
+ onToggleCollapsed: a(() => y((e) => !e), []),
80
+ onClose: A,
81
+ isVisible: b.length > 0
82
+ };
83
+ }
84
+ //#endregion
85
+ export { d as useBillUploadQueue };
@@ -0,0 +1,3 @@
1
+ import "./index21.js";
2
+ import "./index22.js";
3
+ import "./index23.js";
@@ -0,0 +1,8 @@
1
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js
2
+ var e = {
3
+ bills: "Bills",
4
+ vendors: "Vendors",
5
+ settings: "Settings"
6
+ };
7
+ //#endregion
8
+ export { e as DEFAULT_TABS_LABELS };
@@ -0,0 +1,112 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
6
+ import { Scope as t } from "../../../shared/data-access/dist/lib/scopes.js";
7
+ import "../../../shared/data-access/dist/index.js";
8
+ import { EmbeddedToaster as n } from "../../../shared/ui/dist/lib/EmbeddedToaster.js";
9
+ import "../../../shared/ui/dist/index.js";
10
+ import { useAnalyticsTrack as r } from "../../../shared/feature/dist/lib/analytics/hooks.js";
11
+ import { WidgetProvider as i } from "../../../shared/feature/dist/lib/WidgetProvider/WidgetProvider.js";
12
+ import { useWidgetConfig as a } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
13
+ import "../../../shared/feature/dist/index.js";
14
+ import { BillPayWidgetUi as o } from "../../ui/dist/index31.js";
15
+ import { BillUploadStatusTray as s } from "../../ui/dist/index41.js";
16
+ import "../../ui/dist/index.js";
17
+ import { billsTabTestIds as c } from "./index18.js";
18
+ import { BillsTab as l } from "./index19.js";
19
+ import "./index20.js";
20
+ import { useBillUploadQueue as u } from "./index23.js";
21
+ import "./index24.js";
22
+ import { BillPayWidgetAnalyticsEvent as d, WIDGET_NAME as f } from "./index13.js";
23
+ import { DEFAULT_TABS_LABELS as p } from "./index25.js";
24
+ import { ApprovalPoliciesSettings as m } from "../../../shared/approval-policy/feature/dist/lib/ApprovalPoliciesSettings.js";
25
+ import "../../../shared/approval-policy/feature/dist/index.js";
26
+ import { CounterpartsWidget as h } from "../../../counterparts-widget/feature/dist/index8.js";
27
+ import "../../../counterparts-widget/feature/dist/index.js";
28
+ import { useCallback as g, useEffect as _, useState as v } from "react";
29
+ import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
30
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js
31
+ var S = {
32
+ Bills: "bills",
33
+ Vendors: "vendors",
34
+ Settings: "settings"
35
+ }, C = [
36
+ S.Bills,
37
+ S.Vendors,
38
+ S.Settings
39
+ ];
40
+ function w({ labels: i, tabsLabels: f, approvalPolicyLabels: w, approvalPolicyComponentLabels: T, vendorLabels: E }) {
41
+ let D = r();
42
+ _(() => {
43
+ D(d.Mounted);
44
+ }, [D]);
45
+ let O = {
46
+ ...p,
47
+ ...f
48
+ }, { initResponse: k } = a(), A = e(k?.scopes, [t.ApprovalPolicyWriteOrg]), j = !k || A, [M, N] = v(S.Bills), [P, F] = v(), I = g((e) => {
49
+ N(S.Bills), F(e);
50
+ }, []), L = u({ onOpenBill: I }), R = [{
51
+ id: S.Bills,
52
+ label: O.bills,
53
+ content: /* @__PURE__ */ b(l, {
54
+ onEnqueueFiles: L.enqueue,
55
+ openPayableId: P,
56
+ onOpenPayableHandled: () => F(void 0)
57
+ })
58
+ }, {
59
+ id: S.Vendors,
60
+ label: O.vendors,
61
+ content: /* @__PURE__ */ b(h, {
62
+ ...E,
63
+ counterpartType: "vendor",
64
+ showTitle: !1,
65
+ onViewAllDocuments: () => N(S.Bills)
66
+ })
67
+ }];
68
+ j && R.push({
69
+ id: S.Settings,
70
+ label: O.settings,
71
+ content: /* @__PURE__ */ b(m, {
72
+ labels: w,
73
+ componentLabels: T
74
+ })
75
+ });
76
+ let z = R.some((e) => e.id === M) ? M : C.find((e) => R.some((t) => t.id === e)) ?? R[0]?.id ?? "";
77
+ return /* @__PURE__ */ x(y, { children: [
78
+ /* @__PURE__ */ b(n, {}),
79
+ /* @__PURE__ */ b(o, {
80
+ labels: i,
81
+ tabs: R,
82
+ selectedTabId: z,
83
+ onTabChange: N
84
+ }),
85
+ L.isVisible ? /* @__PURE__ */ b(s, {
86
+ sections: L.sections,
87
+ summaryLabel: L.summaryLabel,
88
+ collapsed: L.collapsed,
89
+ onToggleCollapsed: L.onToggleCollapsed,
90
+ onClose: L.onClose,
91
+ testId: c.uploadTray
92
+ }) : null
93
+ ] });
94
+ }
95
+ function T({ baseUrl: e, widgetToken: t, organizationId: n, configClient: r, linkComponent: a, implementation: o, uiFramework: s, errorFallback: c, onError: l, analytics: u, ...d }) {
96
+ return /* @__PURE__ */ b(i, {
97
+ widgetName: f,
98
+ baseUrl: e,
99
+ widgetToken: t,
100
+ organizationId: n,
101
+ configClient: r,
102
+ linkComponent: a,
103
+ implementation: o,
104
+ uiFramework: s,
105
+ errorFallback: c,
106
+ onError: l,
107
+ analytics: u,
108
+ children: /* @__PURE__ */ b(w, { ...d })
109
+ });
110
+ }
111
+ //#endregion
112
+ export { T as BillPayWidgetNative, T as default };
@@ -0,0 +1,25 @@
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { Implementation as e } from "../../../shared/feature/dist/lib/WidgetProvider/types.js";
6
+ import { useWidgetConfig as t } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
7
+ import "../../../shared/feature/dist/index.js";
8
+ import { BillPayWidgetMonite as n } from "./index14.js";
9
+ import "./index15.js";
10
+ import { BillPayWidgetNative as r } from "./index26.js";
11
+ import "./index27.js";
12
+ import { jsx as i } from "react/jsx-runtime";
13
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js
14
+ function a({ implementation: a, ...o }) {
15
+ let s = t().implementation, c = a ?? s ?? e.Monite;
16
+ return c === e.Native ? /* @__PURE__ */ i(r, {
17
+ implementation: c,
18
+ ...o
19
+ }) : /* @__PURE__ */ i(n, {
20
+ implementation: c,
21
+ ...o
22
+ });
23
+ }
24
+ //#endregion
25
+ export { a as BillPayWidget, a as default };
@@ -2,42 +2,58 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { useAnalyticsTrack as e } from "../../../shared/feature/dist/lib/analytics/hooks.js";
6
- import "../../../shared/feature/dist/index.js";
7
- import { BillPayWidgetAnalyticsEvent as t, WIDGET_NAME as n } from "./index2.js";
8
- import { Payables as r } from "../../../monite-sdk/dist/index431.js";
9
- import "../../../monite-sdk/dist/index.js";
10
- import { MoniteRegionProvider as i } from "../../../shared/monite-wrapper/feature/dist/lib/MoniteRegionProvider.js";
11
- import "../../../shared/monite-wrapper/feature/dist/index.js";
12
- import { useEffect as a } from "react";
13
- import { jsx as o } from "react/jsx-runtime";
5
+ import { SOURCE_DOCUMENT_CONTAINER_LABELS_EN as e } from "./index2.js";
6
+ import { useAttachPayableFileMutation as t, useDeletePayableFileMutation as n } from "../../data-access/dist/index7.js";
7
+ import "../../data-access/dist/index.js";
8
+ import { SourceDocumentPanel as r } from "../../ui/dist/index48.js";
9
+ import "../../ui/dist/index.js";
10
+ import { jsx as i } from "react/jsx-runtime";
14
11
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index3.js
15
- var s = (e) => e;
16
- function c(n) {
17
- let i = e();
18
- return a(() => {
19
- i(t.Mounted);
20
- }, [i]), /* @__PURE__ */ o(r, { ...n });
21
- }
22
- function l({ baseUrl: e, widgetToken: t, organizationId: r, configClient: a, linkComponent: l, implementation: u, uiFramework: d, errorFallback: f, onError: p, finopsThemeColors: m, analytics: h, pageTitleComponent: g = s, ..._ }) {
23
- return /* @__PURE__ */ o(i, {
24
- widgetName: n,
25
- baseUrl: e,
26
- widgetToken: t,
27
- organizationId: r,
28
- configClient: a,
29
- linkComponent: l,
30
- implementation: u,
31
- uiFramework: d,
32
- errorFallback: f,
33
- onError: p,
34
- finopsThemeColors: m,
35
- analytics: h,
36
- children: /* @__PURE__ */ o(c, {
37
- ..._,
38
- pageTitleComponent: g
39
- })
12
+ function a({ payableId: a, file: o, isDocumentPending: s, pendingFileName: c, labels: l }) {
13
+ let u = {
14
+ ...e,
15
+ ...l
16
+ }, d = t(), f = n();
17
+ if (!o && (s || d.isPending)) return /* @__PURE__ */ i(r, {
18
+ mode: "loading",
19
+ fileName: c
20
+ });
21
+ if (!o && !a) return /* @__PURE__ */ i("div", {
22
+ className: "ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4 ttw:text-sm ttw:text-muted-foreground",
23
+ children: u.saveBeforeAttaching
24
+ });
25
+ if (!o) return /* @__PURE__ */ i(r, {
26
+ mode: "upload",
27
+ uploadStatus: d.isPending ? "uploading" : "idle",
28
+ uploadErrorMessage: d.isError ? u.attachFailed : void 0,
29
+ onFilesSelected: (e) => {
30
+ let [t] = e;
31
+ !t || !a || d.mutate({
32
+ path: { payable_id: a },
33
+ file: t
34
+ });
35
+ }
36
+ });
37
+ let p = o.mimetype === "application/pdf" ? /* @__PURE__ */ i("iframe", {
38
+ src: `${o.url}#toolbar=0&navpanes=0`,
39
+ title: o.name,
40
+ referrerPolicy: "no-referrer",
41
+ className: "ttw:h-full ttw:w-full ttw:border-0"
42
+ }) : /* @__PURE__ */ i("img", {
43
+ src: o.url,
44
+ alt: o.name,
45
+ className: "ttw:max-h-full ttw:max-w-full ttw:object-contain"
46
+ });
47
+ return /* @__PURE__ */ i(r, {
48
+ mode: "document",
49
+ fileName: o.name,
50
+ preview: p,
51
+ onDownload: () => window.open(o.url, "_blank", "noopener,noreferrer"),
52
+ onDelete: a ? () => f.mutate({
53
+ path: { file_id: o.id },
54
+ payableId: a
55
+ }) : void 0
40
56
  });
41
57
  }
42
58
  //#endregion
43
- export { l as BillPayWidgetMonite, l as default };
59
+ export { a as SourceDocumentContainer, a as default };
@@ -1 +1,235 @@
1
- import "./index3.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
4
+ "use client";
5
+ import { Button as e, Input as t, Label as n } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import { getStateOptions as r } from "../../../shared/util/dist/lib/usStates.js";
7
+ import { VENDOR_INLINE_FORM_LABELS_EN as i } from "./index2.js";
8
+ import { COUNTERPART_MESSAGE_LABELS_EN as a } from "../../../shared/counterpart-management/feature/dist/lib/labels.js";
9
+ import { AddressFieldGroup as o } from "../../../shared/counterpart-management/ui/dist/index5.js";
10
+ import { CounterpartFormFields as s } from "../../../shared/counterpart-management/ui/dist/index8.js";
11
+ import "../../../shared/counterpart-management/ui/dist/index.js";
12
+ import { useCounterpartForm as c } from "../../../shared/counterpart-management/feature/dist/lib/useCounterpartForm.js";
13
+ import "../../../shared/counterpart-management/feature/dist/index.js";
14
+ import { useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
15
+ import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
16
+ import { Landmark as g, Plus as _, X as v } from "lucide-react";
17
+ //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index4.js
18
+ function y({ mode: y, counterpart: b, primaryAddress: x, initialName: S, onSaved: C, onCancel: w, labels: T }) {
19
+ let E = {
20
+ ...i,
21
+ ...T
22
+ }, [D, O] = f("none"), [k, A] = f(b?.id), [j, M] = f(!1), [N, P] = f(!1), F = u(() => r(), []), I = d(D), L = d(!1), R = c({
23
+ view: D,
24
+ setView: O,
25
+ selectedId: k,
26
+ setSelectedId: A,
27
+ messages: a,
28
+ counterpartType: "vendor",
29
+ counterpart: b,
30
+ primaryAddress: x,
31
+ requireAddress: !1
32
+ }), { openCreate: z, openEdit: B, setValues: V } = R;
33
+ return l(() => {
34
+ y === "edit" ? B() : z();
35
+ }, [
36
+ y,
37
+ z,
38
+ B
39
+ ]), l(() => {
40
+ I.current !== "none" && D === "none" && k && C(k), I.current = D;
41
+ }, [
42
+ D,
43
+ k,
44
+ C
45
+ ]), l(() => {
46
+ y !== "create" || L.current || (L.current = !0, V((e) => ({
47
+ ...e,
48
+ entityType: "organization",
49
+ legalName: S?.trim() || e.legalName
50
+ })));
51
+ }, [
52
+ y,
53
+ S,
54
+ V
55
+ ]), l(() => {
56
+ y === "edit" && x && M(!0);
57
+ }, [y, x]), /* @__PURE__ */ h("div", {
58
+ className: "ttw:flex ttw:flex-col ttw:gap-4 ttw:rounded-lg ttw:border ttw:border-border ttw:bg-card ttw:p-4",
59
+ children: [
60
+ /* @__PURE__ */ h("div", {
61
+ className: "ttw:flex ttw:items-start ttw:justify-between ttw:gap-2",
62
+ children: [/* @__PURE__ */ m("p", {
63
+ className: "ttw:text-base ttw:font-semibold ttw:text-foreground",
64
+ children: y === "edit" ? E.editTitle : E.createTitle
65
+ }), /* @__PURE__ */ m(e, {
66
+ type: "button",
67
+ variant: "ghost",
68
+ size: "icon",
69
+ "aria-label": E.close,
70
+ onClick: w,
71
+ children: /* @__PURE__ */ m(v, { className: "ttw:size-4" })
72
+ })]
73
+ }),
74
+ /* @__PURE__ */ m(s, {
75
+ mode: y,
76
+ counterpartMode: "vendor",
77
+ values: R.values,
78
+ errors: R.errors,
79
+ stateOptions: F,
80
+ onChange: (e) => V((t) => ({
81
+ ...t,
82
+ ...e
83
+ })),
84
+ onAddressChange: (e) => V((t) => ({
85
+ ...t,
86
+ address: {
87
+ ...t.address,
88
+ ...e
89
+ }
90
+ })),
91
+ sections: {
92
+ entityType: !1,
93
+ profileHeading: !1,
94
+ taxId: !1,
95
+ address: !1,
96
+ bankAccount: !1
97
+ },
98
+ labels: { businessNameLabel: E.nameLabel }
99
+ }),
100
+ j ? /* @__PURE__ */ m(o, {
101
+ idPrefix: "vendor-inline-address",
102
+ values: R.values.address,
103
+ errors: R.errors?.address,
104
+ stateOptions: F,
105
+ onChange: (e) => V((t) => ({
106
+ ...t,
107
+ address: {
108
+ ...t.address,
109
+ ...e
110
+ }
111
+ }))
112
+ }) : /* @__PURE__ */ h("button", {
113
+ type: "button",
114
+ onClick: () => M(!0),
115
+ className: "ttw:flex ttw:w-fit ttw:items-center ttw:gap-1 ttw:text-sm ttw:font-medium ttw:text-primary ttw:hover:underline",
116
+ children: [/* @__PURE__ */ m(_, { className: "ttw:size-4" }), E.addAddress]
117
+ }),
118
+ /* @__PURE__ */ h("div", {
119
+ className: "ttw:flex ttw:flex-col ttw:gap-1",
120
+ children: [/* @__PURE__ */ m("p", {
121
+ className: "ttw:text-sm ttw:font-semibold ttw:text-foreground",
122
+ children: E.paymentMethodsHeading
123
+ }), /* @__PURE__ */ m("p", {
124
+ className: "ttw:text-sm ttw:text-muted-foreground",
125
+ children: E.paymentMethodsDescription
126
+ })]
127
+ }),
128
+ /* @__PURE__ */ h("div", {
129
+ className: "ttw:flex ttw:gap-3 ttw:rounded-lg ttw:border ttw:border-border ttw:p-3",
130
+ children: [/* @__PURE__ */ m("span", {
131
+ className: "ttw:flex ttw:size-8 ttw:shrink-0 ttw:items-center ttw:justify-center ttw:rounded-md ttw:bg-primary",
132
+ children: /* @__PURE__ */ m(g, {
133
+ "aria-hidden": !0,
134
+ className: "ttw:size-4 ttw:text-white"
135
+ })
136
+ }), /* @__PURE__ */ h("div", {
137
+ className: "ttw:flex ttw:flex-1 ttw:flex-col ttw:gap-3",
138
+ children: [/* @__PURE__ */ h("div", {
139
+ className: "ttw:flex ttw:flex-col ttw:gap-0.5",
140
+ children: [/* @__PURE__ */ m("p", {
141
+ className: "ttw:text-sm ttw:font-medium ttw:text-foreground",
142
+ children: E.achTitle
143
+ }), /* @__PURE__ */ m("p", {
144
+ className: "ttw:text-sm ttw:text-muted-foreground",
145
+ children: E.achDescription
146
+ })]
147
+ }), N ? /* @__PURE__ */ h(p, { children: [
148
+ /* @__PURE__ */ h("div", {
149
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
150
+ children: [/* @__PURE__ */ m(n, {
151
+ htmlFor: "vendor-inline-account-holder",
152
+ children: E.accountHolderNameLabel
153
+ }), /* @__PURE__ */ m(t, {
154
+ id: "vendor-inline-account-holder",
155
+ value: R.values.bankAccount.accountHolderName,
156
+ "aria-invalid": !!R.errors?.bankAccount?.accountHolderName,
157
+ onChange: (e) => V((t) => ({
158
+ ...t,
159
+ bankAccount: {
160
+ ...t.bankAccount,
161
+ accountHolderName: e.target.value
162
+ }
163
+ }))
164
+ })]
165
+ }),
166
+ /* @__PURE__ */ h("div", {
167
+ className: "ttw:grid ttw:grid-cols-2 ttw:gap-4",
168
+ children: [/* @__PURE__ */ h("div", {
169
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
170
+ children: [/* @__PURE__ */ m(n, {
171
+ htmlFor: "vendor-inline-routing",
172
+ children: E.routingNumberLabel
173
+ }), /* @__PURE__ */ m(t, {
174
+ id: "vendor-inline-routing",
175
+ value: R.values.bankAccount.routingNumber,
176
+ "aria-invalid": !!R.errors?.bankAccount?.routingNumber,
177
+ onChange: (e) => V((t) => ({
178
+ ...t,
179
+ bankAccount: {
180
+ ...t.bankAccount,
181
+ routingNumber: e.target.value
182
+ }
183
+ }))
184
+ })]
185
+ }), /* @__PURE__ */ h("div", {
186
+ className: "ttw:flex ttw:flex-col ttw:gap-1.5",
187
+ children: [/* @__PURE__ */ m(n, {
188
+ htmlFor: "vendor-inline-account-number",
189
+ children: E.accountNumberLabel
190
+ }), /* @__PURE__ */ m(t, {
191
+ id: "vendor-inline-account-number",
192
+ value: R.values.bankAccount.accountNumber,
193
+ "aria-invalid": !!R.errors?.bankAccount?.accountNumber,
194
+ onChange: (e) => V((t) => ({
195
+ ...t,
196
+ bankAccount: {
197
+ ...t.bankAccount,
198
+ accountNumber: e.target.value
199
+ }
200
+ }))
201
+ })]
202
+ })]
203
+ }),
204
+ /* @__PURE__ */ m("p", {
205
+ className: "ttw:text-sm ttw:text-muted-foreground",
206
+ children: E.achHelp
207
+ })
208
+ ] }) : /* @__PURE__ */ h("button", {
209
+ type: "button",
210
+ onClick: () => P(!0),
211
+ className: "ttw:flex ttw:w-fit ttw:items-center ttw:gap-1 ttw:text-sm ttw:font-medium ttw:text-primary ttw:hover:underline",
212
+ children: [/* @__PURE__ */ m(_, { className: "ttw:size-4" }), E.addBankAccount]
213
+ })]
214
+ })]
215
+ }),
216
+ /* @__PURE__ */ h("div", {
217
+ className: "ttw:flex ttw:justify-end ttw:gap-2",
218
+ children: [/* @__PURE__ */ m(e, {
219
+ type: "button",
220
+ variant: "outline",
221
+ onClick: w,
222
+ children: E.cancel
223
+ }), /* @__PURE__ */ m(e, {
224
+ type: "button",
225
+ onClick: R.submit,
226
+ loading: R.isSubmitting,
227
+ disabled: R.isSubmitDisabled,
228
+ children: E.save
229
+ })]
230
+ })
231
+ ]
232
+ });
233
+ }
234
+ //#endregion
235
+ export { y as VendorInlineForm, y as default };