@tesouro/embedded-components-react 0.4.21 → 0.4.22

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 (179) 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 +12 -12
  4. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index10.js +64 -37
  5. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index11.js +38 -110
  6. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index12.js +104 -73
  7. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index13.js +87 -7
  8. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index14.js +7 -21
  9. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index15.js +17 -22
  10. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index16.js +23 -63
  11. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index17.js +66 -2
  12. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index18.js +2 -77
  13. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index19.js +74 -3
  14. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index20.js +4 -5
  15. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index21.js +5 -4
  16. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index22.js +3 -32
  17. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index23.js +30 -39
  18. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index24.js +37 -166
  19. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index25.js +164 -39
  20. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index26.js +48 -1
  21. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index27.js +1 -50
  22. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index28.js +47 -4
  23. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index29.js +1 -1
  24. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index32.js +7 -7
  25. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index33.js +8 -24
  26. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js +18 -125
  27. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js +135 -16
  28. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js +24 -4
  29. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js +4 -41
  30. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js +39 -87
  31. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index39.js +79 -84
  32. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index4.js +5 -25
  33. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index40.js +95 -48
  34. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index41.js +47 -119
  35. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index42.js +119 -33
  36. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index43.js +33 -177
  37. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index44.js +186 -75
  38. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index45.js +75 -21
  39. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index46.js +22 -232
  40. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index47.js +223 -210
  41. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index48.js +202 -103
  42. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index49.js +121 -13
  43. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index5.js +25 -24
  44. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index50.js +12 -47
  45. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index51.js +47 -31
  46. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index52.js +27 -198
  47. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index53.js +198 -30
  48. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index54.js +30 -234
  49. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index55.js +240 -19
  50. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index56.js +19 -385
  51. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index57.js +416 -4
  52. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index58.js +4 -35
  53. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index59.js +35 -189
  54. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index6.js +21 -57
  55. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index60.js +214 -3
  56. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index61.js +3 -4
  57. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index62.js +2 -44
  58. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index63.js +46 -1
  59. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index64.js +1 -8
  60. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index65.js +6 -10
  61. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index66.js +10 -110
  62. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index67.js +112 -3
  63. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index68.js +3 -127
  64. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index69.js +124 -8
  65. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index7.js +58 -5
  66. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index70.js +8 -7
  67. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index71.js +8 -46
  68. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index72.js +43 -18
  69. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index73.js +20 -28
  70. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index74.js +27 -82
  71. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index75.js +83 -47
  72. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index76.js +47 -250
  73. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index77.js +239 -101
  74. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index78.js +107 -202
  75. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index79.js +209 -3
  76. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index8.js +5 -4
  77. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index80.js +4 -8
  78. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index81.js +6 -113
  79. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index82.js +115 -1
  80. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index83.js +0 -24
  81. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index84.js +25 -0
  82. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index9.js +5 -70
  83. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index.js +44 -40
  84. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index100.js +170 -2
  85. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index101.js +2 -10
  86. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index102.js +12 -50
  87. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index103.js +108 -2
  88. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index104.js +2 -0
  89. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index105.js +10 -0
  90. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index106.js +52 -0
  91. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index107.js +2 -0
  92. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index16.js +21 -12
  93. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index17.js +10 -9
  94. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index18.js +11 -16
  95. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index19.js +18 -2
  96. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index20.js +2 -4
  97. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index21.js +2 -28
  98. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index22.js +30 -2
  99. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index23.js +2 -32
  100. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index24.js +32 -1
  101. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index25.js +1 -29
  102. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index26.js +26 -19
  103. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index27.js +20 -152
  104. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index28.js +154 -2
  105. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index29.js +1 -64
  106. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index30.js +61 -253
  107. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index31.js +258 -1
  108. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index32.js +2 -9
  109. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index33.js +7 -47
  110. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index34.js +49 -2
  111. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index35.js +2 -18
  112. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index36.js +15 -47
  113. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index37.js +50 -2
  114. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index38.js +2 -23
  115. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index39.js +21 -338
  116. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index40.js +340 -2
  117. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index41.js +2 -11
  118. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index42.js +9 -94
  119. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index43.js +96 -2
  120. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index44.js +1 -12
  121. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index45.js +11 -57
  122. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index46.js +58 -1
  123. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index47.js +1 -54
  124. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index48.js +52 -10
  125. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index49.js +10 -179
  126. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index50.js +181 -1
  127. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index51.js +2 -4
  128. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index52.js +2 -39
  129. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index53.js +41 -2
  130. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index54.js +2 -7
  131. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index55.js +5 -90
  132. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index56.js +92 -2
  133. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index57.js +2 -4
  134. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index58.js +2 -14
  135. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index59.js +16 -2
  136. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index60.js +1 -88
  137. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index61.js +86 -298
  138. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index62.js +299 -9
  139. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index63.js +13 -1
  140. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index64.js +1 -8
  141. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index65.js +6 -37
  142. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index66.js +39 -2
  143. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index67.js +2 -39
  144. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index68.js +2 -10
  145. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index69.js +30 -195
  146. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index70.js +0 -1
  147. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index71.js +36 -14
  148. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index72.js +10 -345
  149. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index73.js +199 -8
  150. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index74.js +3 -9
  151. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index75.js +15 -91
  152. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index76.js +347 -0
  153. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index77.js +10 -2
  154. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index78.js +7 -123
  155. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index79.js +91 -26
  156. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index81.js +1 -1
  157. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index82.js +123 -5
  158. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index83.js +26 -28
  159. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index84.js +94 -2
  160. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index85.js +2 -7
  161. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index86.js +5 -32
  162. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index87.js +30 -2
  163. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index88.js +2 -12
  164. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index89.js +5 -104
  165. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index90.js +34 -2
  166. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index91.js +2 -17
  167. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index92.js +10 -123
  168. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index93.js +105 -1
  169. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index94.js +2 -18
  170. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index95.js +13 -6
  171. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index96.js +74 -119
  172. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index97.js +1 -1
  173. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index98.js +15 -11
  174. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index99.js +8 -106
  175. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  176. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/formatRejectionDate.js +11 -0
  177. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index8.js +1 -1
  178. package/package.json +1 -1
  179. package/dist/libs/tesouro-embedded-components-react/bill-pay-widget/ui/dist/index80.js +0 -94
@@ -2,135 +2,28 @@
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 "../../../shared/ui/dist/index.js";
7
- import { useWidgetConfig as t } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
5
+ import { hasAnyScope as e } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
6
+ import { useCurrentUserQuery as t } from "../../../shared/data-access/dist/lib/useCurrentUserQuery.js";
7
+ import { Scope as n } from "../../../shared/data-access/dist/lib/scopes.js";
8
+ import "../../../shared/data-access/dist/index.js";
9
+ import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
8
10
  import "../../../shared/feature/dist/index.js";
9
- import { useApprovePayableApprovalRequestMutation as n, useRejectPayableApprovalRequestMutation as r } from "../../data-access/dist/index8.js";
10
- import { useCancelPayableMutation as i, useCancelScheduledPaymentMutation as a, useForceApprovePayableMutation as o, useForceRejectPayableMutation as s, useReopenPayableMutation as c } from "../../data-access/dist/index13.js";
11
+ import { usePayableApprovalRequestsQuery as i } from "../../data-access/dist/index8.js";
11
12
  import "../../data-access/dist/index.js";
12
- import { getBillDetailActions as l } from "./index18.js";
13
- import { useState as u } from "react";
14
- import { HandIcon as d } from "lucide-react";
13
+ import { currentApprovalRound as a } from "./index4.js";
14
+ import { usePayableApprovalRoundStart as o } from "./index31.js";
15
15
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index34.js
16
- function f({ payableId: d, status: f, currentApprovalRequestId: m, hasWaitingRequest: _, arePendingApproversUnknown: v, hasScheduledPayment: y, scheduledPaymentIntentId: b, isScheduledPaymentUnknown: x, labels: S, isMarkAsPaidPending: C, pendingApprovers: w, onPayBillSelect: T, onMarkAsPaidSelect: E, onActionSucceeded: D }) {
17
- let { initResponse: O } = t(), k = r(), A = n(), j = i(), M = a(), N = c(), P = o(), F = s(), I = C || k.isPending || A.isPending || j.isPending || M.isPending || N.isPending || P.isPending || F.isPending, [L, R] = u(), z = L && (L.id !== "cancelScheduledPayment" || L.scheduledPaymentIntentId === b) ? L : void 0, B = d && f ? l({
18
- status: f,
19
- scopes: O?.scopes,
20
- canDecideApprovalRequest: !!m,
21
- hasWaitingRequest: _,
22
- arePendingApproversUnknown: v,
23
- hasScheduledPayment: y || x,
24
- scheduledPaymentIntentId: b,
25
- labels: S
26
- }) : [], V = (t) => ({
27
- onError: () => e.error(S.actionError),
28
- onSuccess: () => {
29
- e.success(S.actionSuccess[t]), D?.();
30
- }
31
- }), H = {
32
- reject: {
33
- isPending: k.isPending,
34
- run: (e) => m && k.mutate({
35
- path: { approval_request_id: m },
36
- body: e ? { reject_reason: e } : void 0
37
- }, V("reject"))
38
- },
39
- approve: {
40
- isPending: A.isPending,
41
- run: () => m && A.mutate({ path: { approval_request_id: m } }, V("approve"))
42
- },
43
- cancel: {
44
- isPending: j.isPending,
45
- run: () => d && j.mutate({ path: { payable_id: d } }, V("cancel"))
46
- },
47
- cancelScheduledPayment: {
48
- isPending: M.isPending,
49
- run: () => {
50
- let e = z?.scheduledPaymentIntentId;
51
- !d || !e || M.mutate({
52
- path: { payment_intent_id: e },
53
- payableId: d
54
- }, V("cancelScheduledPayment"));
55
- }
56
- },
57
- reopen: {
58
- isPending: N.isPending,
59
- run: () => d && N.mutate({ path: { payable_id: d } }, V("reopen"))
60
- },
61
- forceApprove: {
62
- isPending: P.isPending,
63
- run: () => d && P.mutate({ path: { payable_id: d } }, V("forceApprove"))
64
- },
65
- forceReject: {
66
- isPending: F.isPending,
67
- run: () => d && F.mutate({ path: { payable_id: d } }, V("forceReject"))
68
- }
69
- }, U = B.map((e) => ({
70
- ...e,
71
- disabled: I,
72
- loading: e.id === "markAsPaid" ? C : H[e.id]?.isPending ?? !1,
73
- onSelect: () => {
74
- if (!(I || !d)) {
75
- if (e.id === "payBill") {
76
- T();
77
- return;
78
- }
79
- if (e.id === "markAsPaid") {
80
- E();
81
- return;
82
- }
83
- if (h(e.id)) {
84
- R({
85
- id: e.id,
86
- scheduledPaymentIntentId: b
87
- });
88
- return;
89
- }
90
- H[e.id]?.run();
91
- }
92
- }
93
- }));
16
+ function s({ payableId: s, status: c }) {
17
+ let { initResponse: l } = r(), u = e(l?.scopes, [n.ApprovalRequestReadOrg]), d = c === "approve_in_progress" && u, f = i(s, { enabled: d }), p = t({ enabled: d }), { roundStartedAt: m } = o({
18
+ payableId: s,
19
+ enabled: d
20
+ }), h = p.data?.id, g = d ? a(f.data?.data, m) : [], _ = (e) => e.caller_is_policy_approver ?? !!(h && e.user_ids.includes(h)), v = g.some(_), y = g.filter((e) => e.status === "waiting");
94
21
  return {
95
- isActionPending: I,
96
- actions: {
97
- row: U.filter((e) => e.surface === "row"),
98
- menu: U.filter((e) => e.surface === "menu")
99
- },
100
- decisionDialog: {
101
- open: !!z,
102
- copy: z ? {
103
- ...S.decisionDialog[z.id],
104
- presentation: g(z.id) ? p : void 0,
105
- pendingApprovers: g(z.id) ? w ?? [] : void 0
106
- } : void 0,
107
- isPending: z ? H[z.id]?.isPending ?? !1 : !1,
108
- onCancel: () => {
109
- I || R(void 0);
110
- },
111
- onConfirm: (e) => {
112
- !z || I || (H[z.id]?.run(e), R(void 0));
113
- }
114
- }
22
+ id: y.filter(_).find((e) => !(h && (e.approved_by ?? []).includes(h)))?.id,
23
+ isPolicyApprover: v,
24
+ hasWaitingRequest: y.length > 0,
25
+ isLoading: f.isLoading || p.isLoading
115
26
  };
116
27
  }
117
- var p = {
118
- alignment: "center",
119
- icon: d,
120
- tone: "destructive",
121
- actionWidth: "equal"
122
- }, m = [
123
- "reject",
124
- "cancel",
125
- "cancelScheduledPayment",
126
- "forceApprove",
127
- "forceReject"
128
- ];
129
- function h(e) {
130
- return m.includes(e);
131
- }
132
- function g(e) {
133
- return e === "forceApprove" || e === "forceReject";
134
- }
135
28
  //#endregion
136
- export { f as usePayableDetailActions };
29
+ export { s as useCurrentApprovalRequestId };
@@ -2,26 +2,145 @@
2
2
  "use client";
3
3
  "use client";
4
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 { formatCalendarDate as n } from "../../../shared/util/dist/lib/formatCalendarDate.js";
9
- import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
5
+ import { toast as e } from "../../../../../packages/shared-ui-shadcn/dist/index.js";
6
+ import "../../../shared/ui/dist/index.js";
7
+ import { useWidgetConfig as t } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
10
8
  import "../../../shared/feature/dist/index.js";
11
- import { isLiveScheduledPaymentRecord as i } from "../../data-access/dist/index3.js";
12
- import { usePayablePaymentRecordsQuery as a } from "../../data-access/dist/index11.js";
9
+ import { useApprovePayableApprovalRequestMutation as n, useRejectPayableApprovalRequestMutation as r } from "../../data-access/dist/index8.js";
10
+ import { useCancelPayableMutation as i, useCancelScheduledPaymentMutation as a, useForceApprovePayableMutation as o, useForceRejectPayableMutation as s, useReopenPayableMutation as c } from "../../data-access/dist/index13.js";
13
11
  import "../../data-access/dist/index.js";
12
+ import { getBillDetailActions as l } from "./index19.js";
13
+ import { useState as u } from "react";
14
+ import { BanIcon as d, HandIcon as f } from "lucide-react";
14
15
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index35.js
15
- function o({ payableId: o, scheduledPaymentDate: s, enabled: c = !0 }) {
16
- let { initResponse: l } = r(), u = e(l?.scopes, [t.PaymentRecordReadOrg]), d = a(c ? o : void 0, { enabled: c && u }), f = d.paymentRecords.find(i), p = !!f || !!s, m = f?.planned_payment_date ?? (p ? s : void 0);
16
+ function p({ payableId: d, status: f, currentApprovalRequestId: p, hasWaitingRequest: m, arePendingApproversUnknown: h, hasScheduledPayment: _, scheduledPaymentIntentId: b, isScheduledPaymentUnknown: x, labels: S, isMarkAsPaidPending: C, pendingApprovers: w, onPayBillSelect: T, onMarkAsPaidSelect: E, onActionSucceeded: D }) {
17
+ let { initResponse: O } = t(), k = r(), A = n(), j = i(), M = a(), N = c(), P = o(), F = s(), I = C || k.isPending || A.isPending || j.isPending || M.isPending || N.isPending || P.isPending || F.isPending, [L, R] = u(), z = L && (L.id !== "cancelScheduledPayment" || L.scheduledPaymentIntentId === b) ? L : void 0, B = d && f ? l({
18
+ status: f,
19
+ scopes: O?.scopes,
20
+ canDecideApprovalRequest: !!p,
21
+ hasWaitingRequest: m,
22
+ arePendingApproversUnknown: h,
23
+ hasScheduledPayment: _ || x,
24
+ scheduledPaymentIntentId: b,
25
+ labels: S
26
+ }) : [], V = (t) => ({
27
+ onError: () => e.error(S.actionError),
28
+ onSuccess: () => {
29
+ e.success(S.actionSuccess[t]), D?.();
30
+ }
31
+ }), H = {
32
+ reject: {
33
+ isPending: k.isPending,
34
+ run: (e) => p && k.mutate({
35
+ path: { approval_request_id: p },
36
+ body: e ? { reject_reason: e } : void 0
37
+ }, V("reject"))
38
+ },
39
+ approve: {
40
+ isPending: A.isPending,
41
+ run: () => p && A.mutate({ path: { approval_request_id: p } }, V("approve"))
42
+ },
43
+ cancel: {
44
+ isPending: j.isPending,
45
+ run: () => d && j.mutate({ path: { payable_id: d } }, V("cancel"))
46
+ },
47
+ cancelScheduledPayment: {
48
+ isPending: M.isPending,
49
+ run: () => {
50
+ let e = z?.scheduledPaymentIntentId;
51
+ !d || !e || M.mutate({
52
+ path: { payment_intent_id: e },
53
+ payableId: d
54
+ }, V("cancelScheduledPayment"));
55
+ }
56
+ },
57
+ reopen: {
58
+ isPending: N.isPending,
59
+ run: () => d && N.mutate({ path: { payable_id: d } }, V("reopen"))
60
+ },
61
+ forceApprove: {
62
+ isPending: P.isPending,
63
+ run: () => d && P.mutate({ path: { payable_id: d } }, V("forceApprove"))
64
+ },
65
+ forceReject: {
66
+ isPending: F.isPending,
67
+ run: () => d && F.mutate({ path: { payable_id: d } }, V("forceReject"))
68
+ }
69
+ }, U = B.map((e) => ({
70
+ ...e,
71
+ disabled: I,
72
+ loading: e.id === "markAsPaid" ? C : H[e.id]?.isPending ?? !1,
73
+ onSelect: () => {
74
+ if (!(I || !d)) {
75
+ if (e.id === "payBill") {
76
+ T();
77
+ return;
78
+ }
79
+ if (e.id === "markAsPaid") {
80
+ E();
81
+ return;
82
+ }
83
+ if (v(e.id)) {
84
+ R({
85
+ id: e.id,
86
+ scheduledPaymentIntentId: b
87
+ });
88
+ return;
89
+ }
90
+ H[e.id]?.run();
91
+ }
92
+ }
93
+ }));
17
94
  return {
18
- hasScheduledPayment: p,
19
- paymentRecords: d.paymentRecords,
20
- isError: d.isError,
21
- isResolving: d.isResolving,
22
- scheduledDateLabel: m ? n(m) : void 0,
23
- scheduledPaymentIntentId: f?.payment_intent_id ?? void 0
95
+ isActionPending: I,
96
+ actions: {
97
+ row: U.filter((e) => e.surface === "row"),
98
+ menu: U.filter((e) => e.surface === "menu")
99
+ },
100
+ decisionDialog: {
101
+ open: !!z,
102
+ copy: z ? {
103
+ ...S.decisionDialog[z.id],
104
+ presentation: g(z.id),
105
+ pendingApprovers: y(z.id) ? w ?? [] : void 0
106
+ } : void 0,
107
+ isPending: z ? H[z.id]?.isPending ?? !1 : !1,
108
+ onCancel: () => {
109
+ I || R(void 0);
110
+ },
111
+ onConfirm: (e) => {
112
+ !z || I || (H[z.id]?.run(e), R(void 0));
113
+ }
114
+ }
24
115
  };
25
116
  }
117
+ var m = {
118
+ alignment: "center",
119
+ icon: f,
120
+ tone: "destructive",
121
+ actionWidth: "equal"
122
+ }, h = {
123
+ alignment: "center",
124
+ icon: d,
125
+ tone: "destructive",
126
+ actionWidth: "equal"
127
+ };
128
+ function g(e) {
129
+ if (y(e)) return m;
130
+ if (e === "reject") return h;
131
+ }
132
+ var _ = [
133
+ "reject",
134
+ "cancel",
135
+ "cancelScheduledPayment",
136
+ "forceApprove",
137
+ "forceReject"
138
+ ];
139
+ function v(e) {
140
+ return _.includes(e);
141
+ }
142
+ function y(e) {
143
+ return e === "forceApprove" || e === "forceReject";
144
+ }
26
145
  //#endregion
27
- export { o as useScheduledPayment };
146
+ export { p as usePayableDetailActions };
@@ -1,7 +1,27 @@
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 { formatCalendarDate as n } from "../../../shared/util/dist/lib/formatCalendarDate.js";
9
+ import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
10
+ import "../../../shared/feature/dist/index.js";
11
+ import { isLiveScheduledPaymentRecord as i } from "../../data-access/dist/index3.js";
12
+ import { usePayablePaymentRecordsQuery as a } from "../../data-access/dist/index11.js";
13
+ import "../../data-access/dist/index.js";
1
14
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index36.js
2
- var e = /* @__PURE__ */ new Set(["draft", "new"]);
3
- function t(t) {
4
- return !!(t && e.has(t));
15
+ function o({ payableId: o, scheduledPaymentDate: s, enabled: c = !0 }) {
16
+ let { initResponse: l } = r(), u = e(l?.scopes, [t.PaymentRecordReadOrg]), d = a(c ? o : void 0, { enabled: c && u }), f = d.paymentRecords.find(i), p = !!f || !!s, m = f?.planned_payment_date ?? (p ? s : void 0);
17
+ return {
18
+ hasScheduledPayment: p,
19
+ paymentRecords: d.paymentRecords,
20
+ isError: d.isError,
21
+ isResolving: d.isResolving,
22
+ scheduledDateLabel: m ? n(m) : void 0,
23
+ scheduledPaymentIntentId: f?.payment_intent_id ?? void 0
24
+ };
5
25
  }
6
26
  //#endregion
7
- export { t as isEditablePayableStatus };
27
+ export { o as useScheduledPayment };
@@ -1,44 +1,7 @@
1
- "use client";
2
- "use client";
3
- "use client";
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 "../../../shared/data-access/dist/index.js";
9
- import "../../../shared/ui/dist/index.js";
10
- import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
11
- import "../../../shared/feature/dist/index.js";
12
- import { useDeletePayableMutation as i } from "../../data-access/dist/index13.js";
13
- import "../../data-access/dist/index.js";
14
- import { useState as a } from "react";
15
1
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index37.js
16
- function o({ payableId: o, status: s, enabled: c = !0, labels: l, onDeleted: u }) {
17
- let { initResponse: d } = r(), f = i(), [p, m] = a(!1), h = t(d?.scopes, [n.PayableWriteOrg]), g = !!(c && o && s === "draft" && h), _ = g ? [{
18
- id: "deleteDraft",
19
- label: l.menuItem,
20
- destructive: !0,
21
- onSelect: () => m(!0)
22
- }] : [], v = p && g;
23
- return {
24
- menuItems: _,
25
- dialog: {
26
- open: v,
27
- copy: v ? l.dialog : void 0,
28
- isPending: f.isPending,
29
- onCancel: () => {
30
- f.isPending || m(!1);
31
- },
32
- onConfirm: () => {
33
- !g || !o || f.isPending || f.mutate({ path: { payable_id: o } }, {
34
- onError: () => e.error(l.error),
35
- onSuccess: () => {
36
- m(!1), u();
37
- }
38
- });
39
- }
40
- }
41
- };
2
+ var e = /* @__PURE__ */ new Set(["draft", "new"]);
3
+ function t(t) {
4
+ return !!(t && e.has(t));
42
5
  }
43
6
  //#endregion
44
- export { o as useDraftDelete };
7
+ export { t as isEditablePayableStatus };
@@ -1,92 +1,44 @@
1
- import { formatCalendarDate as e } from "../../../shared/util/dist/lib/formatCalendarDate.js";
2
- import { derivePayableStatus as t } from "./index6.js";
3
- import { resolveVendor as n, resolveVendorName as r } from "./index7.js";
4
- import { formatBillMoney as i } from "./index2.js";
1
+ "use client";
2
+ "use client";
3
+ "use client";
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 "../../../shared/data-access/dist/index.js";
9
+ import "../../../shared/ui/dist/index.js";
10
+ import { useWidgetConfig as r } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
11
+ import "../../../shared/feature/dist/index.js";
12
+ import { useDeletePayableMutation as i } from "../../data-access/dist/index13.js";
13
+ import "../../data-access/dist/index.js";
14
+ import { useState as a } from "react";
5
15
  //#region ../../libs/tesouro-embedded-components-react/bill-pay-widget/feature/dist/index38.js
6
- function a({ payable: a, lineItems: s, ledgerAccounts: c, labels: l, hasScheduledPayment: u, now: d }) {
7
- let f = a.currency, p = (e) => i(e, f), m = t({
8
- apiStatus: a.status,
9
- dueDate: a.due_date,
10
- scheduledPaymentDate: a.scheduled_payment_date,
11
- hasScheduledPayment: u,
12
- now: d
13
- }), h = n(a), g = r(a), _ = e(a.issued_at) || l.notProvided, v = e(a.due_date) || l.notProvided, y = [{
14
- label: l.vendorRow,
15
- value: g || l.notProvided,
16
- secondaryValue: h?.email ?? void 0
17
- }], b = h?.bank_account?.account_number;
18
- b && y.push({
19
- label: l.bankAccountRow,
20
- value: l.bankAccountValue(b.slice(-4))
21
- });
22
- let x = [
23
- {
24
- label: l.invoiceNumberRow,
25
- value: a.document_id || l.notProvided
26
- },
27
- {
28
- label: l.issueDateRow,
29
- value: _
30
- },
31
- {
32
- label: l.dueDateRow,
33
- value: v
34
- },
35
- {
36
- label: l.poNumberRow,
37
- value: l.notProvided
38
- }
39
- ], S = new Map(c.map((e) => [e.id, [e.nominal_code, e.name].filter(Boolean).join(" — ")])), C = s.map((e) => {
40
- let t = p(e.unit_price);
41
- return {
42
- id: e.id,
43
- description: e.name ?? e.description ?? "",
44
- glCodeLabel: (e.ledger_account_id ? S.get(e.ledger_account_id) : void 0) || l.glCodeMissing,
45
- quantityLabel: e.quantity != null && t ? l.quantityValue(String(e.quantity), t) : "",
46
- amountLabel: p(e.subtotal) ?? ""
47
- };
48
- }), w = [
49
- {
50
- label: l.subtotalRow,
51
- value: a.subtotal
52
- },
53
- {
54
- label: l.discountsRow,
55
- value: a.discount
56
- },
57
- {
58
- label: l.taxRow,
59
- value: a.tax_amount
60
- }
61
- ].map(({ label: e, value: t }) => ({
62
- label: e,
63
- value: p(t)
64
- })).filter((e) => !!e.value), T = p(a.total_amount);
65
- T && w.push({
66
- label: l.totalRow,
67
- value: T,
68
- emphasis: !0
69
- });
70
- let E = o(a);
16
+ function o({ payableId: o, status: s, enabled: c = !0, labels: l, onDeleted: u }) {
17
+ let { initResponse: d } = r(), f = i(), [p, m] = a(!1), h = t(d?.scopes, [n.PayableWriteOrg]), g = !!(c && o && s === "draft" && h), _ = g ? [{
18
+ id: "deleteDraft",
19
+ label: l.menuItem,
20
+ destructive: !0,
21
+ onSelect: () => m(!0)
22
+ }] : [], v = p && g;
71
23
  return {
72
- title: g,
73
- subtitle: l.subtitle,
74
- status: m.status,
75
- statusTone: m.tone,
76
- amountDueLabel: p(a.amount_due) ?? p(a.total_amount) ?? "",
77
- amountPaidLabel: E ? p(a.amount_paid) : void 0,
78
- paidOnLabel: E ? l.paidOnLabel(E) : void 0,
79
- invoiceDateLabel: _,
80
- dueDateLabel: v,
81
- dueDateTone: m.isOverdue ? "danger" : "default",
82
- payToItems: y,
83
- invoiceItems: x,
84
- lineItems: C,
85
- totals: w
24
+ menuItems: _,
25
+ dialog: {
26
+ open: v,
27
+ copy: v ? l.dialog : void 0,
28
+ isPending: f.isPending,
29
+ onCancel: () => {
30
+ f.isPending || m(!1);
31
+ },
32
+ onConfirm: () => {
33
+ !g || !o || f.isPending || f.mutate({ path: { payable_id: o } }, {
34
+ onError: () => e.error(l.error),
35
+ onSuccess: () => {
36
+ m(!1), u();
37
+ }
38
+ });
39
+ }
40
+ }
86
41
  };
87
42
  }
88
- function o(t) {
89
- return t.status === "paid" && t.paid_at ? e(t.paid_at.slice(0, 10)) : void 0;
90
- }
91
43
  //#endregion
92
- export { o as getPaidAtLabel, a as mapPayableToBillDetails };
44
+ export { o as useDraftDelete };