@tesouro/embedded-components-react 0.5.141 → 0.5.144

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 (168) 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 +11 -11
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +1 -1
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +1 -1
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +2 -2
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +2 -2
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +9 -24
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +21 -37
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +21 -14
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +41 -8
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +16 -4
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +8 -98
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +4 -83
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +98 -3
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +78 -135
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +4 -45
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +139 -109
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +44 -186
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +108 -72
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +188 -29
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +71 -83
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +27 -406
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +88 -12
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +403 -77
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +13 -80
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +77 -221
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +78 -41
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +212 -234
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +44 -21
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +234 -557
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +23 -4
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +581 -40
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +4 -251
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +45 -3
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +261 -2
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +3 -46
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +4 -1
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +44 -6
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +1 -13
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +6 -127
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +13 -3
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +126 -3
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +3 -127
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +3 -8
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +124 -7
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +8 -46
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +8 -21
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +51 -20
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +20 -28
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +19 -83
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +28 -47
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +76 -252
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +48 -33
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +249 -142
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index85.js +27 -206
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index86.js +160 -4
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index87.js +217 -5
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index88.js +3 -112
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index89.js +7 -1
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index90.js +104 -18
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index91.js +1 -0
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index92.js +27 -0
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +48 -48
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index100.js +12 -2
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index101.js +102 -27
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index102.js +2 -128
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index103.js +31 -2
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index104.js +125 -30
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index105.js +2 -10
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index106.js +29 -177
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index107.js +10 -2
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index108.js +178 -11
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index109.js +2 -108
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index110.js +14 -2
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index111.js +106 -8
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index112.js +2 -52
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index113.js +10 -2
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index114.js +52 -0
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index115.js +2 -0
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +26 -16
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +14 -19
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +16 -11
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +19 -14
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +14 -2
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +16 -2
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +2 -30
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +4 -2
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +26 -28
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +1 -0
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +28 -31
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +1 -19
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +27 -117
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index29.js +19 -2
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +123 -2
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +2 -16
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index32.js +4 -2
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index33.js +14 -2
  99. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +2 -22
  100. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index35.js +4 -2
  101. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +20 -99
  102. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +2 -79
  103. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +97 -273
  104. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +79 -2
  105. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +273 -18
  106. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +2 -56
  107. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index42.js +21 -2
  108. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +52 -14
  109. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +2 -50
  110. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +18 -2
  111. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +47 -32
  112. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +2 -374
  113. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +35 -2
  114. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +369 -18
  115. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +2 -96
  116. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +23 -2
  117. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +93 -29
  118. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +1 -51
  119. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index54.js +31 -1
  120. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +49 -53
  121. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +2 -13
  122. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +53 -194
  123. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +13 -2
  124. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +195 -2
  125. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +2 -41
  126. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +4 -2
  127. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +37 -15
  128. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +2 -88
  129. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +19 -2
  130. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +78 -308
  131. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +2 -9
  132. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +311 -27
  133. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index68.js +9 -2
  134. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index69.js +33 -2
  135. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index70.js +1 -0
  136. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +2 -8
  137. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index72.js +1 -39
  138. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +8 -2
  139. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +37 -2
  140. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +2 -36
  141. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +4 -2
  142. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +34 -37
  143. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +2 -12
  144. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +37 -199
  145. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index80.js +12 -3
  146. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +199 -15
  147. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +2 -402
  148. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +13 -6
  149. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +413 -6
  150. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +8 -91
  151. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +9 -0
  152. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +93 -2
  153. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index89.js +2 -28
  154. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +118 -87
  155. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +28 -2
  156. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index92.js +92 -5
  157. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index93.js +2 -30
  158. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index94.js +7 -2
  159. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index95.js +28 -5
  160. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index96.js +2 -34
  161. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index97.js +7 -2
  162. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index98.js +32 -10
  163. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index99.js +1 -105
  164. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  165. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/relativeCalendarDay.js +12 -0
  166. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  167. package/package.json +1 -1
  168. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +0 -125
@@ -2,576 +2,253 @@
2
2
  "use client";
3
3
  "use client";
4
4
  "use client";
5
- import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
- import { hasAnyScope as t } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
7
- import { Scope as n } from "../../../shared/data-access/dist/lib/scopes.js";
8
- import { useAllLedgerAccountsQuery as r } from "../../../shared/data-access/dist/lib/reference-data/useLedgerAccountsQuery.js";
9
- import "../../../shared/data-access/dist/index.js";
10
- import "../../../shared/ui/dist/index.js";
11
- import { formatCalendarDate as ee } from "../../../shared/util/dist/lib/formatCalendarDate.js";
12
- import { buildPayableAuditHistory as te, hasUnattributedAuditRows as ne } from "../../../shared/util/dist/lib/auditHistory/buildPayableAuditHistory.js";
13
- import { useWidgetConfig as re } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
14
- import { useOrganizationUserNames as ie } from "../../../shared/feature/dist/lib/user/useOrganizationUserNames.js";
15
- import "../../../shared/feature/dist/index.js";
16
- import { usePayableApprovalRequestsQuery as ae } from "../../data-access/dist/index8.js";
17
- import { usePayableHistoryQuery as oe } from "../../data-access/dist/index9.js";
18
- import { useAllPayableLineItemsQuery as se } from "../../data-access/dist/index10.js";
19
- import { useUpdatePayableMutation as ce } from "../../data-access/dist/index13.js";
20
- import { usePayableQuery as le } from "../../data-access/dist/index17.js";
21
- import "../../data-access/dist/index.js";
22
- import { hasUnpaidBalance as ue } from "./index7.js";
23
- import { resolveVendor as de } from "./index8.js";
24
- import { BillCreateScreen as fe } from "../../ui/dist/index57.js";
25
- import { BillDecisionDialog as i } from "../../ui/dist/index63.js";
26
- import { DiscardChangesDialog as pe } from "../../ui/dist/index67.js";
27
- import { BillDuplicateNotice as me } from "../../ui/dist/index72.js";
28
- import { BillRejectedBanner as he } from "../../ui/dist/index75.js";
29
- import { ExtractionNotice as ge } from "../../ui/dist/index93.js";
30
- import { MarkAsPaidDialog as _e } from "../../ui/dist/index102.js";
31
- import { UnsavedBillDialog as ve } from "../../ui/dist/index112.js";
32
- import "../../ui/dist/index.js";
33
- import { usePayableDuplicateReview as ye } from "./index13.js";
34
- import "./index14.js";
35
- import { isEditablePayableStatus as be } from "./index19.js";
36
- import { canOverrideApprovalPolicy as xe, canReadCounterpartBankAccounts as Se } from "./index20.js";
37
- import { resolveAmountDueMinorUnits as Ce } from "./index21.js";
38
- import { usePayableAchInstructions as we } from "../../../shared/counterpart-management/feature/dist/lib/usePayableAchInstructions.js";
39
- import "../../../shared/counterpart-management/feature/dist/index.js";
40
- import { PayBillFlow as Te } from "./index27.js";
41
- import "./index28.js";
42
- import { useMarkAsPaidFlow as Ee } from "./index17.js";
43
- import "./index18.js";
44
- import { BILL_CREATE_MESSAGE_LABELS_EN as De, mergeBillCreateScreenCopy as Oe } from "./index48.js";
45
- import { useBillCreateController as ke } from "./index56.js";
46
- import { useBillForm as Ae } from "./index58.js";
47
- import { buildPaymentHistory as je } from "./index3.js";
48
- import { currentApprovalRound as Me } from "./index4.js";
49
- import { usePayableApprovalRoundStart as Ne } from "./index32.js";
50
- import { useApprovalPolicyCardView as Pe } from "./index33.js";
51
- import { resolveBillRejectionNotice as Fe } from "./index34.js";
52
- import { useCurrentApprovalRequestId as Ie } from "./index35.js";
53
- import { usePayableDetailActions as Le } from "./index36.js";
54
- import { useScheduledPayment as Re } from "./index37.js";
55
- import { useDraftDelete as ze } from "./index38.js";
56
- import { buildBillDetailView as Be } from "./index43.js";
57
- import { resolveEditorDismissal as Ve } from "./index44.js";
58
- import { SourceDocumentContainer as He } from "./index49.js";
59
- import { useVendorSectionProps as Ue } from "./index52.js";
60
- import { billCreateTestIds as a } from "./index59.js";
61
- import { cloneElement as We, isValidElement as Ge, useCallback as o, useEffect as Ke, useMemo as s, useRef as qe, useState as c } from "react";
62
- import { Fragment as Je, jsx as l, jsxs as Ye } from "react/jsx-runtime";
63
- import { Trash2Icon as Xe } from "lucide-react";
5
+ import { BILL_CREATE_MESSAGE_LABELS_EN as e } from "./index50.js";
6
+ import { calculateTotal as t, displayLineAmount as n, normalizeMoneyOnBlur as r, parseMoneyToMinorUnits as i, parseQuantity as a } from "./index56.js";
7
+ import { validateBillTotals as o } from "./index57.js";
8
+ import { emptyLineItem as s, mapPayableToBillForm as c } from "./index59.js";
9
+ import { useCallback as l, useEffect as u, useMemo as d, useRef as f, useState as p } from "react";
64
10
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js
65
- function Ze(e) {
66
- let t = [...new Set(e)];
67
- return t.length > 0 ? t : void 0;
11
+ var m = /^[0-9.,-]+$/;
12
+ function h(e) {
13
+ let t = e.trim().replace(/^\$\s*/, "");
14
+ return t ? m.test(t) ? t : null : "";
68
15
  }
69
- function Qe({ open: Qe, onOpenChange: u, payableId: d, initialCounterpartId: $e, readOnly: f = !1, copy: et, onCollapse: p, onEdit: tt, poweredByBankName: nt }) {
70
- let m = s(() => Oe(et), [et]), rt = d ? void 0 : $e, [it, at] = c(rt), [ot, st] = c(!!rt), [ct, lt] = c(!1), [h, g] = c(!1), [ut, _] = c(), v = o((e) => {
71
- _(() => e);
72
- }, []), [dt, ft] = c(), y = d ?? dt, b = le(y, { pollWhileOcrProcessing: !0 }), x = se(y), { initResponse: S } = re(), pt = !!S, mt = t(S?.scopes, [n.AccountingConfigReadOrg]), C = r({ enabled: mt }), w = b.data, T = !y || !!w, E = !f && T && !!y && w?.status !== "draft", ht = !f && !!w && !be(w?.status), D = f || ht, O = Ae({
73
- payable: w,
74
- lineItems: x.lineItems
75
- }), k = w?.counterpart_id;
76
- Ke(() => {
77
- ot || k && (at(k), st(!0));
78
- }, [ot, k]);
79
- let gt = o((e) => {
80
- st(!0), at(e);
81
- }, []), A = Re({
82
- payableId: y,
83
- scheduledPaymentDate: w?.scheduled_payment_date,
84
- enabled: f || E
85
- }), j = Se(S?.scopes), _t = t(S?.scopes, [n.PayableWriteOrg]), vt = t(S?.scopes, [n.CounterpartWriteOrg]) && _t, M = vt && ue(w?.status) && !A.hasScheduledPayment && !A.isResolving, yt = M && j, bt = M || vt && w?.status === "rejected", xt = !f && T && (!y || w?.status === "draft") && !A.hasScheduledPayment && !A.isResolving, N = Ue({
86
- payableId: y,
87
- counterpartId: f ? k : it,
88
- payableCounterpartId: k,
89
- isVendorKnown: f ? !!w : T,
90
- onCounterpartChange: gt,
91
- requiredError: O.errors?.vendor,
92
- payableCounterpartBankAccountId: w?.counterpart_bank_account_id ?? void 0,
93
- extractedVendor: w?.counterpart_raw_data ?? void 0,
94
- readOnly: f,
95
- canEditVendor: !f || yt,
96
- canEditPaymentInstructions: !f || M,
97
- canAddPaymentInstructions: !f || bt,
98
- confirmDiscard: v
99
- }), P = N.activePayToOperation === "missingInstructions" ? xt || bt : N.activePayToOperation === "existingInstructions" ? xt || M : N.activePayToOperation === "vendor" && f ? yt : !1, St = !!(y && ot) && !it, F = b.refetch, Ct = o(async () => {
100
- let { data: e } = await F();
101
- return e?.status ?? void 0;
102
- }, [F]), I = ce(), [L, wt] = c(!1), R = qe(void 0), z = o(async () => {
103
- if (R.current) return R.current;
104
- let t = (async () => {
105
- if (P) {
106
- wt(!0);
107
- try {
108
- let t;
109
- try {
110
- t = await N.prepareVendorForSave({ closeOnSuccess: !1 });
111
- } catch {
112
- e.error(m.detail.paymentInstructionsSaveError);
113
- return;
114
- }
115
- if (!t.ok) return;
116
- if (!y) {
117
- N.finalizePayToSave();
118
- return;
119
- }
120
- let n = t.counterpartId && t.counterpartId !== w?.counterpart_id ? t.counterpartId : void 0, r = t.counterpartBankAccountId && t.counterpartBankAccountId !== w?.counterpart_bank_account_id ? t.counterpartBankAccountId : void 0;
121
- if (n || r) {
122
- let t = {
123
- path: { payable_id: y },
124
- body: {
125
- ...n ? { counterpart_id: n } : {},
126
- ...r ? { counterpart_bank_account_id: r } : {}
127
- }
128
- };
129
- try {
130
- await I.mutateAsync(t);
131
- } catch {
132
- try {
133
- await I.mutateAsync(t);
134
- } catch {
135
- e.error(m.detail.paymentInstructionsLinkError);
136
- return;
137
- }
138
- }
139
- N.finalizePayToSave();
140
- return;
141
- }
142
- N.finalizePayToSave(), await F();
143
- } finally {
144
- wt(!1);
145
- }
16
+ var g = [
17
+ "quantity",
18
+ "price",
19
+ "amount"
20
+ ];
21
+ function _(e) {
22
+ let t = e.trim(), n = /[.,]$/.test(t) ? t.slice(0, -1) : t;
23
+ return t && !n ? null : n;
24
+ }
25
+ function v(e, t, n) {
26
+ if (t === void 0) return;
27
+ let r = _(t);
28
+ if (r !== null) return o(e === "discount" ? r : "", e === "tax" ? r : "", e === "total" ? r : void 0, n)?.[e];
29
+ }
30
+ function y(e, t) {
31
+ let n = {}, r = {
32
+ price: null,
33
+ amount: null
34
+ };
35
+ for (let a of ["price", "amount"]) {
36
+ let o = _(e[a]);
37
+ o !== null && (r[a] = i(o), o && r[a] === null && (n[a] = t.unreadableMoney));
38
+ }
39
+ let o = _(e.quantity);
40
+ if (o !== null) {
41
+ let e = r.price !== null || r.amount !== null;
42
+ a(o) === null && (o || e) && (n.quantity = t.unusableQuantity);
43
+ }
44
+ return n;
45
+ }
46
+ function b(e, t, r) {
47
+ return i(t) === null ? r : n(e, t);
48
+ }
49
+ function x({ payable: n, lineItems: i, labels: a = e } = {}) {
50
+ let o = d(() => c({
51
+ payable: n ?? {},
52
+ lineItems: i ?? []
53
+ }), [n, i]), [m, _] = p(o.values), [x, S] = p(o.lineItems), [C, w] = p(o.discount), [T, E] = p(o.tax), [D, O] = p(o.total || void 0), [ee, k] = p(), A = f(void 0), te = l((e) => {
54
+ k((t) => {
55
+ let n = typeof e == "function" ? e(t) : e;
56
+ return n?.form !== A.current && (A.current = void 0), n;
57
+ });
58
+ }, []), ne = l((e) => {
59
+ A.current = e, k((t) => ({
60
+ ...t,
61
+ form: e
62
+ }));
63
+ }, []), j = l(() => {
64
+ k((e) => {
65
+ if (!e?.form || e.form !== A.current) return e;
66
+ A.current = void 0;
67
+ let t = { ...e };
68
+ return delete t.form, Object.keys(t).length ? t : void 0;
69
+ });
70
+ }, []), [re, M] = p(), [N, P] = p(), [F, I] = p(!1), [L, R] = p(!1), [z, B] = p(!1);
71
+ u(() => {
72
+ F || _(o.values);
73
+ }, [o]), u(() => {
74
+ L || S(o.lineItems);
75
+ }, [o]), u(() => {
76
+ z || (w(o.discount), E(o.tax), O(o.total || void 0));
77
+ }, [o]);
78
+ let ie = l((e) => {
79
+ _((t) => ({
80
+ ...t,
81
+ ...e
82
+ })), I(!0), k((t) => {
83
+ if (!t) return t;
84
+ let n = { ...t };
85
+ for (let t of Object.keys(e)) delete n[t];
86
+ return Object.keys(n).length ? n : void 0;
87
+ }), j();
88
+ }, [j]), V = l((e, t) => {
89
+ M((n) => {
90
+ if (!n?.[e] && !t) return n;
91
+ let r = {
92
+ ...n,
93
+ [e]: t
94
+ };
95
+ return t || delete r[e], Object.keys(r).length ? r : void 0;
96
+ });
97
+ }, []), H = l((e, t) => {
98
+ V(e, v(e, t, a));
99
+ }, [a, V]), U = l(() => {
100
+ O(void 0), H("total", void 0), j();
101
+ }, [H, j]), W = l((e, t = []) => {
102
+ let n = y(e, a);
103
+ P((r) => {
104
+ let i = r?.[e.id], a = { ...i };
105
+ for (let e of [
106
+ "price",
107
+ "amount",
108
+ "quantity"
109
+ ]) n[e] ? a[e] = n[e] : delete a[e];
110
+ t.includes("description") && delete a.description;
111
+ let o = Object.keys(a).length > 0;
112
+ if (!i && !o) return r;
113
+ let s = { ...r };
114
+ return o ? s[e.id] = a : delete s[e.id], Object.keys(s).length ? s : void 0;
115
+ });
116
+ }, [a]), G = l((e, t, n) => {
117
+ P((r) => ({
118
+ ...r,
119
+ [e]: {
120
+ ...r?.[e],
121
+ [t]: n
146
122
  }
147
- })();
148
- R.current = t;
149
- try {
150
- await t;
151
- } finally {
152
- R.current = void 0;
153
- }
154
- }, [
155
- P,
156
- m.detail.paymentInstructionsLinkError,
157
- m.detail.paymentInstructionsSaveError,
158
- I,
159
- w?.counterpart_bank_account_id,
160
- w?.counterpart_id,
161
- y,
162
- F,
163
- N
164
- ]), B = s(() => P ? N.mode === "creating" && Ge(N.newVendorForm) ? {
165
- ...N,
166
- newVendorForm: We(N.newVendorForm, {
167
- onSave: z,
168
- isSaving: L
169
- })
170
- } : N.mode === "resolved" && N.paymentInstructions ? {
171
- ...N,
172
- paymentInstructions: {
173
- ...N.paymentInstructions,
174
- onSave: z,
175
- isSaving: L
176
- }
177
- } : N : N, [
178
- P,
179
- L,
180
- z,
181
- N
182
- ]);
183
- Ke(() => {
184
- f && N.isEditingPayTo && !P && N.discardPayToEdits();
123
+ }));
124
+ }, []), K = l((e, t, n = []) => {
125
+ let r = x.find((t) => t.id === e);
126
+ if (!r) return;
127
+ let i = t(r);
128
+ S(x.map((t) => t.id === e ? i : t)), W(i, n), R(!0), U();
185
129
  }, [
186
- P,
187
- f,
188
- N.discardPayToEdits,
189
- N.isEditingPayTo
190
- ]);
191
- let Tt = s(() => E ? { draftSaved: De.submittedSaved } : void 0, [E]), V = ke({
192
- payableId: d,
193
- form: O,
194
- labels: Tt,
195
- counterpartId: it,
196
- isVendorPending: N.mode === "creating" || N.isPendingVendor,
197
- clearCounterpart: St,
198
- prepareVendorForSave: N.prepareVendorForSave,
199
- onPayableCreated: ft,
200
- onSaved: ft,
201
- onDraftSaved: () => u(!1),
202
- onFinalized: () => u(!1),
203
- readSavedStatus: E ? Ct : void 0
204
- }), Et = !!(V.isSavingDraft || V.isFinalizing || N.isVendorSavePending), H = f ? y : void 0, U = Ie({
205
- payableId: H,
206
- status: w?.status
207
- }), Dt = qe(null), Ot = de(w), W = we({
208
- counterpartId: f ? k : void 0,
209
- currency: w?.currency,
210
- currentBankAccountId: f ? w?.counterpart_bank_account_id ?? void 0 : void 0,
211
- enabled: j && f
212
- }), kt = Ee({
213
- payableId: H,
214
- amountDueMinorUnits: Ce(w) ?? 0,
215
- amountToPayMinorUnits: w?.amount_to_pay ?? void 0,
216
- currencyCode: w?.currency ?? void 0,
217
- dueDate: w?.due_date,
218
- hasScheduledPayment: A.hasScheduledPayment,
219
- labels: m.markAsPaid
220
- }), G = Pe({
221
- payableId: H,
222
- approvalPolicyId: w?.approval_policy_id,
223
- enabled: f,
224
- copy: m.approvalPolicyCopy
225
- }), At = xe({
226
- status: w?.status,
227
- scopes: S?.scopes,
228
- arePendingApproversUnknown: G.isLoading,
229
- hasApprovalPolicy: !!w?.approval_policy_id,
230
- hasWaitingRequest: U.hasWaitingRequest
231
- }), jt = !!U.id, Mt = U.isLoading || G.isLoading, Nt = s(() => Ze(G.pendingApprovers.flatMap((e) => e.names)), [G.pendingApprovers]), Pt = f || E ? y : void 0, Ft = f ? tt : void 0, K = o((e) => {
232
- let t = () => {
233
- N.discardPayToEdits(), e?.();
234
- };
235
- N.hasUnsavedVendorChanges ? v(t) : t();
236
- }, [v, N]), { actions: It, decisionDialog: Lt, isActionPending: Rt } = Le({
237
- payableId: Pt,
238
- status: w?.status,
239
- currentApprovalRequestId: U.id,
240
- arePendingApproversUnknown: G.isLoading,
241
- hasScheduledPayment: A.hasScheduledPayment,
242
- scheduledPaymentIntentId: A.scheduledPaymentIntentId,
243
- isScheduledPaymentUnknown: A.isResolving,
244
- isPayabilityUnknown: W.isLoading,
245
- hasApprovalPolicy: !!w?.approval_policy_id,
246
- hasWaitingRequest: U.hasWaitingRequest,
247
- pendingApprovers: G.pendingApprovers,
248
- labels: m.actions,
249
- isMarkAsPaidPending: kt.isPending,
250
- onMarkAsPaidSelect: kt.open,
251
- onPayBillSelect: () => K(() => Dt.current?.open()),
252
- onEditSelect: Ft,
253
- onActionSucceeded: (e) => {
254
- if (e === "reopen") {
255
- Ft?.();
130
+ U,
131
+ x,
132
+ W
133
+ ]), q = l((e, t) => {
134
+ let n = { ...t };
135
+ for (let r of g) {
136
+ let i = t[r];
137
+ if (i === void 0) continue;
138
+ let o = h(i);
139
+ if (o === null) {
140
+ G(e, r, a.numbersOnly);
256
141
  return;
257
142
  }
258
- E && u(!1);
143
+ n[r] = o;
259
144
  }
260
- }), zt = ze({
261
- payableId: y,
262
- status: w?.status,
263
- enabled: !f,
264
- labels: m.deleteDraft,
265
- onDeleted: () => u(!1)
266
- }), Bt = Et || Rt, Vt = w?.ocr_status === "processing", Ht = b.isLoading || x.isResolving || Vt, Ut = b.isLoading || x.isResolving || C.isResolving || W.isLoading, Wt = b.isError || x.isError || C.isError, Gt = s(() => [...zt.menuItems, ...E || f && !Ut && !Wt ? It.menu.map((e) => ({
267
- id: e.id,
268
- label: e.label,
269
- onSelect: e.onSelect,
270
- disabled: e.disabled,
271
- icon: e.icon,
272
- sectionHeading: e.sectionHeading
273
- })) : []], [
274
- It.menu,
275
- zt.menuItems,
276
- E,
277
- f,
278
- Ut,
279
- Wt
280
- ]), q = s(() => (C.data?.data ?? []).map((e) => ({
281
- value: e.id,
282
- label: [e.nominal_code, e.name].filter(Boolean).join(" — ")
283
- })), [C.data]), J;
284
- pt && (mt ? C.isError ? J = m.lineItemsGlCodeUnavailable.loadError : !C.isResolving && q.length === 0 && (J = m.lineItemsGlCodeUnavailable.empty) : J = m.lineItemsGlCodeUnavailable.noAccess);
285
- let Kt = !pt || !!J || C.isResolving, qt = mt && !C.isResolving && !C.isError, Y = oe(H), Jt = w?.status === "rejected" || !f && E, Yt = t(S?.scopes, [n.ApprovalRequestReadOrg]), Xt = Jt && Yt, Zt = t(S?.scopes, [n.UserReadOrg]), { userNames: X, isError: Qt, isResolving: $t } = ie({ enabled: (f || Jt) && Zt }), en = s(() => te(Y.data?.data ?? [], X, m.history), [
286
- Y.data,
287
- X,
288
- m.history
289
- ]), tn = Zt && Qt && ne(Y.data?.data ?? [], en, X), nn = Ne({
290
- payableId: y,
291
- enabled: Xt
292
- }), rn = ae(y, { enabled: Xt }), an = s(() => Me(rn.data?.data, nn.roundStartedAt), [rn.data, nn.roundStartedAt]), Z = s(() => Fe({
293
- payableStatus: w?.status,
294
- approvalRequests: an,
295
- userNames: X,
296
- payableUpdatedAt: w?.updated_at,
297
- labels: m.detail
298
- }), [
299
- w?.status,
300
- w?.updated_at,
301
- an,
302
- X,
303
- m.detail
304
- ]), on = s(() => je({
305
- records: A.paymentRecords,
306
- events: Y.data?.data ?? [],
307
- currencyCode: w?.currency,
308
- labels: m.detail
309
- }), [
310
- A.paymentRecords,
311
- Y.data,
312
- w?.currency,
313
- m.detail
314
- ]), sn = s(() => {
315
- if (!f || !w) return;
316
- let e = Be({
317
- payable: w,
318
- lineItems: x.lineItems,
319
- glCodeOptions: q,
320
- glCodeRosterAvailable: qt,
321
- history: en,
322
- paymentHistory: on,
323
- approvalPolicy: G.view,
324
- labels: m.detail,
325
- hasScheduledPayment: A.hasScheduledPayment,
326
- rejection: Z,
327
- payableAchInstructions: W.achInstructions,
328
- payableAchInstructionsReadable: j && !W.isError
329
- });
330
- return N.mode === "resolved" && N.summary ? {
331
- ...e,
332
- payTo: N.summary
333
- } : e;
145
+ K(e, (e) => {
146
+ let t = {
147
+ ...e,
148
+ ...n
149
+ };
150
+ return "amount" in n ? t : {
151
+ ...t,
152
+ amount: b(t.quantity, t.price, t.amount)
153
+ };
154
+ }, Object.keys(n));
334
155
  }, [
335
- A.hasScheduledPayment,
336
- G.view,
337
- j,
338
- m.detail,
339
- q,
340
- qt,
341
- en,
342
- x.lineItems,
343
- w,
344
- W.achInstructions,
345
- W.isError,
346
- on,
347
- f,
348
- Z,
349
- N.mode,
350
- N.summary
351
- ]), cn = w?.source_of_payable_data === "ocr", Q = Ot?.name, ln = f ? Q ? m.viewTitle(Q) : m.readOnlyTitle : Q && (cn || E) ? m.extractedTitle(Q) : m.newTitle, un = f && w?.created_at ? m.addedOn(ee(w.created_at.slice(0, 10))) : void 0, dn = o(() => {
352
- if (f && N.isEditingPayTo) {
353
- K(() => u(!1));
156
+ K,
157
+ a,
158
+ G
159
+ ]), J = l((e, t) => {
160
+ S((n) => n.map((n) => n.id === e ? {
161
+ ...n,
162
+ [t]: r(n[t])
163
+ } : n));
164
+ }, []), Y = l((e, t) => {
165
+ K(e, (e) => {
166
+ let n = Number.parseFloat(e.quantity), r = String(Math.max(1, (Number.isFinite(n) ? n : 0) + t));
167
+ return {
168
+ ...e,
169
+ quantity: r,
170
+ amount: b(r, e.price, e.amount)
171
+ };
172
+ });
173
+ }, [K]), X = l((e) => {
174
+ P((t) => {
175
+ if (!t?.[e]) return t;
176
+ let n = { ...t };
177
+ return delete n[e], Object.keys(n).length ? n : void 0;
178
+ });
179
+ }, []), Z = l((e) => {
180
+ X(e), S((t) => t.length <= 1 ? t : t.filter((t) => t.id !== e)), R(!0), U();
181
+ }, [X, U]), ae = l(() => {
182
+ S((e) => [...e, s()]), R(!0), U();
183
+ }, [U]), Q = l((e, t, n) => {
184
+ let r = h(t);
185
+ if (r === null) {
186
+ V(e, a.numbersOnly);
354
187
  return;
355
188
  }
356
- let e = O.isDirty || N.hasUnsavedVendorChanges || !!V.stagedFile || V.isFileDeletionPending;
357
- switch (Ve({
358
- isUnsavedPromptOpen: h,
359
- isLocked: D,
360
- isDirty: e
361
- })) {
362
- case "dismiss-prompt":
363
- g(!1);
364
- return;
365
- case "prompt":
366
- g(!0);
367
- return;
368
- default: u(!1);
369
- }
189
+ n(r), B(!0), U(), H(e, r);
370
190
  }, [
371
- V.isFileDeletionPending,
372
- V.stagedFile,
373
- O.isDirty,
374
- D,
375
- h,
376
- K,
377
- u,
378
- f,
379
- N.hasUnsavedVendorChanges,
380
- N.isEditingPayTo
381
- ]), fn = o(() => {
382
- if (N.isEditingPayTo) {
383
- K(p);
191
+ U,
192
+ a,
193
+ H,
194
+ V
195
+ ]), oe = l((e) => Q("discount", e, w), [Q]), se = l((e) => Q("tax", e, E), [Q]), $ = l(() => w((e) => r(e)), []), ce = l(() => E((e) => r(e)), []), le = l((e) => {
196
+ let t = h(e);
197
+ if (t === null) {
198
+ V("total", a.numbersOnly);
384
199
  return;
385
200
  }
386
- p?.();
201
+ O(t), B(!0), H("total", t), j();
387
202
  }, [
388
- K,
389
- p,
390
- N.isEditingPayTo
391
- ]), pn = o(() => {
392
- g(!1), u(!1);
393
- }, [u]), mn = Ht || N.mode === "creating", hn = o(async () => {
394
- if (mn) return;
395
- let e = await V.saveDraft();
396
- g(!1), e && u(!1);
397
- }, [
398
- V,
399
- mn,
400
- u
401
- ]), $ = ye({
402
- payable: w,
403
- onRemoved: () => u(!1),
404
- canManage: _t
405
- }), gn = o((e) => {
406
- if (!(Bt || $.isBusy)) return e ? u(!0) : dn();
407
- }, [
408
- $.isBusy,
409
- Bt,
410
- dn,
411
- u
412
- ]), _n = $.isPossibleDuplicate, vn = !f && cn && !ct, yn = !f && !!Z, bn = yn || _n || vn ? /* @__PURE__ */ Ye(Je, { children: [
413
- yn && Z ? /* @__PURE__ */ l(he, {
414
- ...Z,
415
- labels: m.rejectedBanner
416
- }) : null,
417
- _n ? /* @__PURE__ */ l(me, {
418
- onNotADuplicate: $.onNotADuplicate,
419
- onRemoveBill: $.onRemoveBill,
420
- isActionDisabled: $.isBusy,
421
- labels: $.removeBillLabel ? { removeBillButton: $.removeBillLabel } : void 0,
422
- testId: a.duplicateNotice
423
- }) : null,
424
- vn ? /* @__PURE__ */ l(ge, { onDismiss: () => lt(!0) }) : null
425
- ] }) : void 0;
426
- return /* @__PURE__ */ Ye(Je, { children: [
427
- /* @__PURE__ */ l(fe, {
428
- open: Qe,
429
- onOpenChange: gn,
430
- title: ln,
431
- subtitle: un,
432
- notice: bn,
433
- vendor: {
434
- ...B,
435
- testId: a.vendorSection
436
- },
437
- values: O.values,
438
- errors: O.errors,
439
- onChange: O.onChange,
440
- lineItems: {
441
- items: O.lineItemRows,
442
- glCodeOptions: q,
443
- glCodeDisabled: Kt,
444
- glCodeUnavailableMessage: J,
445
- discount: O.discount,
446
- onDiscountChange: O.onDiscountChange,
447
- onDiscountBlur: O.onDiscountBlur,
448
- tax: O.tax,
449
- onTaxChange: O.onTaxChange,
450
- onTaxBlur: O.onTaxBlur,
451
- total: O.total,
452
- onTotalChange: O.onTotalChange,
453
- onTotalBlur: O.onTotalBlur,
454
- onAddLineItem: O.onAddLineItem,
455
- errors: O.lineItemErrors,
456
- totalsErrors: O.totalsErrors,
457
- testId: a.lineItems
458
- },
459
- documentPanel: /* @__PURE__ */ l(He, {
460
- payableId: y,
461
- readOnly: D,
462
- isDocumentPending: !!y && !w?.file && (b.isLoading || w?.ocr_status === "processing"),
463
- file: w?.file ? {
464
- id: w.file.id,
465
- name: w.file.name,
466
- url: w.file.url,
467
- mimetype: w.file.mimetype
468
- } : void 0,
469
- staging: {
470
- stagedFile: V.stagedFile,
471
- onFileStaged: V.stageFile,
472
- onClearStagedFile: V.clearStagedFile,
473
- isSaving: Et
474
- },
475
- deletion: {
476
- isPending: V.isFileDeletionPending,
477
- onRequest: V.requestFileDeletion,
478
- onDetachNow: V.detachFileNow,
479
- isDeleting: V.isDeletingFile,
480
- hasFailed: V.hasFileDeletionFailed
481
- }
482
- }),
483
- menuItems: Gt,
484
- readOnly: D,
485
- detail: f ? {
486
- view: sn,
487
- actions: It,
488
- scheduledSummary: A.hasScheduledPayment && A.scheduledDateLabel ? m.scheduledSummary(A.scheduledDateLabel) : void 0,
489
- scheduledStatusLabel: A.hasScheduledPayment && A.scheduledDateLabel ? m.scheduledStatusBadge(A.scheduledDateLabel) : void 0,
490
- showApprovalOverrideNotice: !Mt && At,
491
- awaitingApprovalNotice: !Mt && !jt && !At && w?.status === "approve_in_progress" && w?.approval_policy_id ? Nt ? m.awaitingApprovalNotice(Nt) : m.awaitingApprovalUnknownNotice : void 0,
492
- payTo: {
493
- onEdit: B.mode === "resolved" ? B.onEdit : void 0,
494
- paymentInstructions: B.paymentInstructions,
495
- editForm: B.mode === "creating" ? B.newVendorForm : void 0
496
- },
497
- hideMissingPaymentInstructions: w?.status === "paid" || w?.status === "canceled",
498
- isLoading: Ut,
499
- isError: Wt,
500
- paymentHistoryError: A.isError || Y.isError,
501
- paymentHistoryLoading: A.isResolving || Y.isLoading,
502
- historyError: Y.isError,
503
- historyLoading: Y.isLoading || $t,
504
- historyNamesError: tn
505
- } : void 0,
506
- isLineItemsLoading: Ht,
507
- isSaving: Bt || L,
508
- isSavingDraft: V.isSavingDraft,
509
- isSubmitting: V.isFinalizing,
510
- onCancel: dn,
511
- onCollapse: f ? fn : void 0,
512
- onSaveDraft: V.saveDraft,
513
- onFinalize: V.finalize,
514
- scrollToErrorToken: V.scrollToErrorToken,
515
- showSubmit: !D && T,
516
- testId: a.dialog
517
- }),
518
- /* @__PURE__ */ l(ve, {
519
- open: h,
520
- onSaveDraft: hn,
521
- onDiscard: pn,
522
- onCancel: () => g(!1),
523
- isSaving: V.isSavingDraft,
524
- isSaveDraftDisabled: mn,
525
- labels: m.unsavedChanges,
526
- testId: a.unsavedDialog,
527
- saveDraftTestId: a.unsavedSaveDraft,
528
- discardTestId: a.unsavedDiscard,
529
- closeTestId: a.unsavedClose
530
- }),
531
- /* @__PURE__ */ l(pe, {
532
- open: !!ut,
533
- onDiscard: () => {
534
- let e = ut;
535
- _(void 0), e?.();
536
- },
537
- onKeepEditing: () => _(void 0),
538
- labels: m.discardChanges,
539
- testId: a.discardDialog,
540
- discardTestId: a.discardConfirm
541
- }),
542
- /* @__PURE__ */ l(i, {
543
- ...Lt,
544
- labels: { cancelButton: m.actions.decisionDialog.cancelButton },
545
- testId: a.decisionDialog,
546
- confirmTestId: a.decisionConfirm,
547
- reasonTestId: a.decisionReason
548
- }),
549
- /* @__PURE__ */ l(i, {
550
- ...zt.dialog,
551
- labels: { cancelButton: m.actions.decisionDialog.cancelButton },
552
- testId: a.deleteDraftDialog,
553
- confirmTestId: a.deleteDraftConfirm
554
- }),
555
- /* @__PURE__ */ l(i, {
556
- open: $.removeConfirmation.open,
557
- copy: $.removeConfirmation.copy,
558
- onConfirm: $.removeConfirmation.onConfirm,
559
- onCancel: $.removeConfirmation.onCancel,
560
- isPending: $.removeConfirmation.isPending,
561
- confirmIcon: /* @__PURE__ */ l(Xe, {}),
562
- labels: { cancelButton: $.removeConfirmation.cancelButtonLabel },
563
- testId: a.duplicateRemoveDialog,
564
- confirmTestId: a.duplicateRemoveConfirm
565
- }),
566
- /* @__PURE__ */ l(_e, { ...kt.dialogProps }),
567
- f && w ? /* @__PURE__ */ l(Te, {
568
- ref: Dt,
569
- payable: w,
570
- onMissingAchInstructions: vt ? N.openPaymentInstructions : void 0,
571
- poweredByBankName: nt,
572
- labels: m.payBill
573
- }) : null
574
- ] });
203
+ j,
204
+ a,
205
+ H,
206
+ V
207
+ ]), ue = l(() => {
208
+ O((e) => e === void 0 ? e : r(e));
209
+ }, []), de = d(() => x.map((e) => ({
210
+ ...e,
211
+ onChange: (t) => q(e.id, t),
212
+ onBlur: (t) => J(e.id, t),
213
+ onQuantityStep: (t) => Y(e.id, t),
214
+ onRemove: () => Z(e.id)
215
+ })), [
216
+ J,
217
+ x,
218
+ q,
219
+ Z,
220
+ Y
221
+ ]), fe = d(() => t(x, T, C), [
222
+ x,
223
+ T,
224
+ C
225
+ ]);
226
+ return {
227
+ values: m,
228
+ errors: ee,
229
+ setErrors: te,
230
+ setSaveFailureMessage: ne,
231
+ lineItemErrors: N,
232
+ setLineItemErrors: P,
233
+ totalsErrors: re,
234
+ setTotalsErrors: M,
235
+ onChange: ie,
236
+ lineItems: x,
237
+ lineItemRows: de,
238
+ discount: C,
239
+ onDiscountChange: oe,
240
+ onDiscountBlur: $,
241
+ tax: T,
242
+ onTaxChange: se,
243
+ onTaxBlur: ce,
244
+ total: D ?? fe,
245
+ totalOverride: D,
246
+ onTotalChange: le,
247
+ onTotalBlur: ue,
248
+ onAddLineItem: ae,
249
+ isTotalsDirty: z,
250
+ isDirty: F || L || z
251
+ };
575
252
  }
576
253
  //#endregion
577
- export { Qe as BillCreateDialog, Qe as default };
254
+ export { x as useBillForm };