@tesouro/embedded-components-react 0.5.228 → 0.5.231

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 (185) hide show
  1. package/README.md +22 -21
  2. package/dist/index.css +10 -0
  3. package/dist/index.d.ts +55 -21
  4. package/dist/index.js +3 -3
  5. package/dist/lib/ExpenseManagementWidget.d.ts +22 -21
  6. package/dist/lib/ExpenseManagementWidget.js +1 -1
  7. package/dist/lib/ReceivablesWidget.d.ts +34 -1
  8. package/dist/lib/ReceivablesWidget.js +1 -1
  9. package/dist/lib/UploadReceiptWidget.d.ts +2 -2
  10. package/dist/lib/UploadReceiptWidget.js +2 -2
  11. package/dist/lib/WidgetSuite.d.ts +17 -15
  12. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index.js +3 -0
  13. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/feature/dist/index2.js +5 -0
  14. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{feature/dist/index24.js → approval-policies/feature/dist/index3.js} +7 -7
  15. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{feature/dist/index25.js → approval-policies/feature/dist/index4.js} +1 -1
  16. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{feature/dist/index26.js → approval-policies/feature/dist/index5.js} +1 -1
  17. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{feature/dist/index27.js → approval-policies/feature/dist/index6.js} +53 -53
  18. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/approval-policies/ui/dist/index.js +8 -0
  19. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/types.js → approval-policies/ui/dist/index2.js} +1 -1
  20. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/labels.js → approval-policies/ui/dist/index3.js} +1 -1
  21. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/conditionLabel.js → approval-policies/ui/dist/index4.js} +1 -1
  22. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/EmptyApprovalRules.js → approval-policies/ui/dist/index5.js} +3 -3
  23. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ApprovalRuleCard.js → approval-policies/ui/dist/index6.js} +5 -5
  24. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ApprovalRuleForm.js → approval-policies/ui/dist/index7.js} +4 -4
  25. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ExpenseApprovalPoliciesWidget/lib/ExpenseApprovalsPage.js → approval-policies/ui/dist/index8.js} +7 -7
  26. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index.js +18 -19
  27. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/invalidation.js +2 -0
  28. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index20.js → lib/invalidateTransactionViews.js} +4 -4
  29. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index10.js → lib/queryKeys.js} +4 -4
  30. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index5.js → lib/useEntityUsersByIdsQuery.js} +6 -6
  31. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index8.js → lib/useExpenseHistoryQuery.js} +6 -6
  32. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index7.js → lib/useExpenseLedgerAccountsQuery.js} +3 -3
  33. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index17.js → lib/useExpenseReceiptsCountQuery.js} +5 -5
  34. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index16.js → lib/useExpenseTransactionIdsQuery.js} +2 -2
  35. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index15.js → lib/useExpenseTransactionsCountQuery.js} +5 -5
  36. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index19.js → lib/useGetApprovalRequestsQuery.js} +5 -5
  37. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index9.js → lib/useGetTransactionQuery.js} +5 -5
  38. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index3.js → lib/useGetTransactionsQuery.js} +5 -5
  39. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/lib/useHasDirectReportsQuery.js +34 -0
  40. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index4.js → lib/useOrganizationDepartmentsQuery.js} +6 -6
  41. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index6.js → lib/useOrganizationLocationsQuery.js} +6 -6
  42. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index11.js → lib/usePatchReceiptMutation.js} +7 -7
  43. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index14.js → lib/useTrackReceiptMatching.js} +7 -7
  44. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index21.js → lib/useTransactionReviewMutations.js} +6 -6
  45. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index18.js → lib/useTransactionValidationsQuery.js} +5 -5
  46. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/{index13.js → lib/useUploadReceiptMutation.js} +7 -7
  47. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index.js +10 -10
  48. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index10.js +77 -160
  49. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index11.js +356 -63
  50. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index12.js +36 -71
  51. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index13.js +130 -344
  52. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index14.js +223 -36
  53. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index15.js +192 -137
  54. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index16.js +11 -227
  55. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index17.js +81 -186
  56. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index18.js +37 -11
  57. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index19.js +309 -82
  58. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index2.js +30 -87
  59. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index20.js +1 -39
  60. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index3.js +3 -2
  61. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index5.js +23 -257
  62. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index6.js +18 -2
  63. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index7.js +160 -59
  64. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index8.js +62 -28
  65. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index9.js +28 -18
  66. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/data-access/dist/index.js +3 -0
  67. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{data-access → receipt-match/data-access}/dist/index2.js +5 -5
  68. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/data-access/dist/index3.js +40 -0
  69. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index.js +2 -0
  70. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index2.js +256 -0
  71. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index3.js +5 -0
  72. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/feature/dist/index4.js +65 -0
  73. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/receipt-match/ui/dist/index.js +8 -0
  74. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/labels.js → receipt-match/ui/dist/index2.js} +1 -1
  75. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/ReceiptInboxItem.js → receipt-match/ui/dist/index3.js} +3 -3
  76. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/ReceiptInboxStep.js → receipt-match/ui/dist/index4.js} +6 -6
  77. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/TransactionsMatchStep.js → receipt-match/ui/dist/index5.js} +27 -27
  78. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/MatchConfirmationStep.js → receipt-match/ui/dist/index6.js} +3 -3
  79. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/ReceiptMatchSidebar.js → receipt-match/ui/dist/index7.js} +6 -6
  80. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui/dist/lib/ReceiptMatchWidget/lib/ReceiptMatchLauncher.js → receipt-match/ui/dist/index8.js} +1 -1
  81. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/index.js +9 -28
  82. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/ExpenseStatusBadge.js +7 -12
  83. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/badgeTones.js +1 -7
  84. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesScreen/ExpensesScreen.js +61 -55
  85. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesScreen/labels.js +2 -1
  86. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpensesTransactionsTable/ExpensesTransactionsTable.js +42 -44
  87. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/FileViewer/FileViewer.js +6 -6
  88. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetails/TransactionDetails.js +137 -138
  89. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/TransactionDetailsActions/TransactionDetailsActions.js +82 -80
  90. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/{ui → util}/dist/lib/isPdf.js +1 -1
  91. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/util/dist/lib/widgetName.js +4 -0
  92. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index.js +1 -1
  93. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index11.js +1 -1
  94. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index5.js +32 -33
  95. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index6.js +34 -32
  96. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/data-access/dist/index7.js +1 -1
  97. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index.js +1 -1
  98. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index10.js +120 -52
  99. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index11.js +44 -100
  100. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index12.js +93 -337
  101. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index13.js +356 -211
  102. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index14.js +225 -157
  103. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index15.js +152 -21
  104. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index16.js +18 -221
  105. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index17.js +224 -56
  106. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index18.js +126 -231
  107. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index19.js +53 -298
  108. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index20.js +232 -43
  109. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index21.js +295 -118
  110. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index22.js +38 -145
  111. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index23.js +126 -46
  112. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index24.js +145 -117
  113. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index25.js +38 -91
  114. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index26.js +113 -107
  115. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index27.js +94 -27
  116. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index28.js +104 -619
  117. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index29.js +34 -41
  118. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index30.js +635 -34
  119. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index31.js +39 -77
  120. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index32.js +34 -117
  121. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index33.js +75 -318
  122. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index34.js +139 -0
  123. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index35.js +340 -0
  124. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index5.js +1 -1
  125. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index8.js +55 -468
  126. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/feature/dist/index9.js +443 -97
  127. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index.js +24 -21
  128. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index10.js +32 -2
  129. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index11.js +205 -84
  130. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index12.js +161 -3
  131. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index13.js +12 -20
  132. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index14.js +23 -40
  133. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index15.js +2 -17
  134. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index16.js +90 -68
  135. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index17.js +3 -20
  136. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index18.js +20 -12
  137. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index19.js +40 -30
  138. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index2.js +14 -7
  139. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index20.js +15 -301
  140. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index21.js +73 -1
  141. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index22.js +17 -45
  142. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index23.js +12 -68
  143. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index24.js +26 -490
  144. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index25.js +294 -95
  145. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index26.js +1 -0
  146. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index27.js +48 -2
  147. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index28.js +72 -4
  148. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index29.js +496 -1
  149. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index3.js +121 -27
  150. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index30.js +97 -91
  151. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index32.js +2 -236
  152. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index33.js +3 -2
  153. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index34.js +1 -249
  154. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index35.js +89 -82
  155. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index36.js +23 -54
  156. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index37.js +223 -340
  157. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index38.js +3 -0
  158. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index39.js +249 -0
  159. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index4.js +100 -216
  160. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index40.js +93 -0
  161. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index41.js +59 -0
  162. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index42.js +353 -0
  163. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index5.js +35 -29
  164. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index6.js +2 -216
  165. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index7.js +9 -159
  166. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index8.js +27 -14
  167. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index9.js +216 -23
  168. package/dist/libs/tesouro-embedded-components-react/settings-widget/feature/dist/index5.js +1 -1
  169. package/dist/libs/tesouro-embedded-components-react/shared/feature/dist/lib/analytics/build-info.js +1 -1
  170. package/dist/libs/tesouro-embedded-components-react/shared/product-catalog/feature/dist/index.js +12 -12
  171. package/dist/libs/tesouro-embedded-components-react/shared/util/dist/lib/formatTimestampDate.js +13 -0
  172. package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/feature/dist/index.js +4 -0
  173. package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/feature/dist/index2.js +91 -0
  174. package/dist/libs/tesouro-embedded-components-react/upload-receipt-widget/ui/dist/index.js +4 -0
  175. package/dist/libs/tesouro-embedded-components-react/{expense-management-widget/ui/dist/lib/UploadReceiptWidget/labels.js → upload-receipt-widget/ui/dist/index2.js} +1 -1
  176. package/dist/libs/tesouro-embedded-components-react/{expense-management-widget/ui/dist/lib/UploadReceiptWidget/UploadReceiptButton.js → upload-receipt-widget/ui/dist/index3.js} +3 -3
  177. package/dist/libs/tesouro-embedded-components-react/{expense-management-widget/ui/dist/lib/UploadReceiptWidget/UploadReceiptModal.js → upload-receipt-widget/ui/dist/index4.js} +3 -3
  178. package/dist/libs/tesouro-embedded-components-react/widget-suite/feature/dist/index11.js +1 -1
  179. package/package.json +1 -1
  180. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/data-access/dist/index12.js +0 -39
  181. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index21.js +0 -297
  182. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index22.js +0 -1
  183. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index23.js +0 -4
  184. package/dist/libs/tesouro-embedded-components-react/expense-management-widget/ui/dist/lib/ExpenseStatusBadge/labels.js +0 -13
  185. package/dist/libs/tesouro-embedded-components-react/invoicing-widget/ui/dist/index31.js +0 -28
@@ -1,67 +1,360 @@
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 { formatTimestampDate as t } from "../../../shared/util/dist/lib/formatTimestampDate.js";
7
+ import { formatMoneyExact as n } from "../../../shared/util/dist/lib/formatMoneyExact.js";
8
+ import { hasAnyScope as r } from "../../../shared/data-access/dist/lib/hasAnyScope.js";
9
+ import { Scope as i } from "../../../shared/data-access/dist/lib/scopes.js";
10
+ import "../../../shared/data-access/dist/index.js";
11
+ import "../../../shared/ui/dist/index.js";
12
+ import { useWidgetConfig as ee } from "../../../shared/feature/dist/lib/WidgetProvider/hooks.js";
13
+ import "../../../shared/feature/dist/index.js";
14
+ import { ApprovalPolicyObjectType as te } from "../../../shared/approval-policy/data-access/dist/lib/queryKeys.js";
15
+ import { useGetApprovalPoliciesQuery as ne } from "../../../shared/approval-policy/data-access/dist/lib/approvalPoliciesApi.js";
16
+ import "../../../shared/approval-policy/data-access/dist/index.js";
17
+ import { EXPENSE_STATUS_BADGE_LABELS_EN as re, resolveExpenseStatusBadge as ie, toExpenseDisplayStatus as ae } from "./index2.js";
18
+ import { TRANSACTION_DETAILS_FEATURE_LABELS_EN as oe } from "./index6.js";
19
+ import { TransactionDetails as se } from "../../ui/dist/lib/TransactionDetails/TransactionDetails.js";
20
+ import { DeleteReceiptDialog as ce } from "../../ui/dist/lib/TransactionDetails/DeleteReceiptDialog/DeleteReceiptDialog.js";
21
+ import "../../ui/dist/index.js";
22
+ import { useOrganizationDepartmentsQuery as le } from "../../data-access/dist/lib/useOrganizationDepartmentsQuery.js";
23
+ import { useEntityUsersByIdsQuery as ue } from "../../data-access/dist/lib/useEntityUsersByIdsQuery.js";
24
+ import { useOrganizationLocationsQuery as de } from "../../data-access/dist/lib/useOrganizationLocationsQuery.js";
25
+ import { useExpenseLedgerAccountsQuery as fe } from "../../data-access/dist/lib/useExpenseLedgerAccountsQuery.js";
26
+ import { useExpenseHistoryQuery as pe } from "../../data-access/dist/lib/useExpenseHistoryQuery.js";
27
+ import { useGetTransactionQuery as me } from "../../data-access/dist/lib/useGetTransactionQuery.js";
28
+ import { usePatchReceiptMutation as he } from "../../data-access/dist/lib/usePatchReceiptMutation.js";
29
+ import { useUploadReceiptMutation as ge } from "../../data-access/dist/lib/useUploadReceiptMutation.js";
30
+ import { useTransactionValidationsQuery as _e } from "../../data-access/dist/lib/useTransactionValidationsQuery.js";
31
+ import { useGetApprovalRequestsQuery as ve } from "../../data-access/dist/lib/useGetApprovalRequestsQuery.js";
32
+ import { useUpdateTransactionMutation as ye } from "../../data-access/dist/lib/useTransactionReviewMutations.js";
33
+ import "../../data-access/dist/index.js";
34
+ import { TransactionDetailsActionsFeature as be } from "./index10.js";
35
+ import { entityUserLabel as xe } from "./index4.js";
36
+ import { canApproveExpenses as Se, canWriteExpenses as Ce, isExpenseAdmin as we } from "./index5.js";
37
+ import { buildExpenseAuditHistory as Te } from "./index7.js";
38
+ import { EXPENSE_AUDIT_HISTORY_LABELS_EN as Ee } from "./index8.js";
39
+ import { ReceiptMatchWidget as De } from "../../receipt-match/feature/dist/index4.js";
40
+ import "../../receipt-match/feature/dist/index.js";
41
+ import { useMemo as Oe, useRef as ke, useState as a } from "react";
42
+ import { Fragment as Ae, jsx as o, jsxs as je } from "react/jsx-runtime";
1
43
  //#region ../../libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index11.js
2
- var e = {
3
- new: "New",
4
- approve_in_progress: "In review",
5
- approved: "Approved",
6
- rejected: "Rejected",
7
- canceled: "Canceled",
8
- deleted: "Deleted"
9
- }, t = {
10
- created: "Created",
11
- processing: "Processing",
12
- succeeded: "Succeeded",
13
- declined: "Declined",
14
- refunded: "Refunded",
15
- failed: "Failed"
16
- }, n = (e, t) => Object.hasOwn(e, t) ? e[t] : "Unknown";
17
- function r(e) {
18
- let t = new Date(e);
19
- return Number.isNaN(t.getTime()) ? e : t.toLocaleDateString("en-US", {
20
- month: "short",
21
- day: "numeric",
22
- year: "numeric"
23
- });
44
+ var Me = "—", Ne = /* @__PURE__ */ new Map(), s = "__none__";
45
+ function c(e) {
46
+ return e === s ? null : e;
24
47
  }
25
- function i(e) {
26
- let t = new Date(e);
27
- return Number.isNaN(t.getTime()) ? "" : t.toLocaleTimeString("en-US", {
28
- hour: "numeric",
29
- minute: "2-digit",
30
- timeZoneName: "short"
31
- });
48
+ function l(e) {
49
+ return !!(e && e !== "user");
50
+ }
51
+ function Pe(e) {
52
+ if (!e || typeof e != "object" || !("all" in e)) return {};
53
+ let t = e.all, n, r;
54
+ for (let e of t ?? []) {
55
+ if (!e || typeof e != "object" || !("operator" in e)) continue;
56
+ let t = e;
57
+ if (t.left_operand?.name !== "transaction.amount") continue;
58
+ let i = Number(t.right_operand);
59
+ Number.isFinite(i) && (t.operator === ">=" && (n = i), (t.operator === "<" || t.operator === "<=") && (r = i));
60
+ }
61
+ return {
62
+ greaterThanCents: n,
63
+ lessThanCents: r
64
+ };
65
+ }
66
+ function Fe(e) {
67
+ for (let t of e ?? []) {
68
+ let e = t.event_data;
69
+ if (!e || typeof e != "object") continue;
70
+ let n = e, r = [t.entity_user_first_name, t.entity_user_last_name].filter((e) => !!e?.trim()).join(" ") || void 0;
71
+ if (t.event_type === "approval_action") {
72
+ let e = n.approval_source === "policy" && !n.approval_request_id, t = n.approval_source;
73
+ return {
74
+ source: e ? "auto" : typeof t == "string" ? t : void 0,
75
+ approverName: r
76
+ };
77
+ }
78
+ if (t.event_type === "status_changed" && n.approval_source != null) {
79
+ let e = n.approval_source;
80
+ return {
81
+ source: typeof e == "string" ? e : void 0,
82
+ approverName: r
83
+ };
84
+ }
85
+ }
86
+ return {};
87
+ }
88
+ function Ie(e) {
89
+ return e && "required_approval_count" in e && typeof e.required_approval_count == "number" ? e.required_approval_count : 0;
90
+ }
91
+ function Le(e) {
92
+ for (let t of e ?? []) {
93
+ if (t.event_type !== "approval_action") continue;
94
+ let e = t.event_data;
95
+ if (!e || typeof e != "object" || !("approval_policy_name" in e)) continue;
96
+ let n = e.approval_policy_name;
97
+ if (typeof n == "string" && n) return n;
98
+ }
99
+ }
100
+ var Re = ".pdf,.png,.jpg,.jpeg,.gif,.svg";
101
+ function u(e, t, n) {
102
+ let r = e.find((e) => e.field === t);
103
+ return r != null && (r.amount_threshold == null || n >= r.amount_threshold);
104
+ }
105
+ function d({ open: d, onClose: ze, selectedTransactionId: Be, actionItemIds: Ve, cardholderByUserId: f, labels: He, detailsLabels: Ue, cardLabels: We, actionsLabels: Ge, statusBadgeLabels: Ke, fileViewerLabels: qe }) {
106
+ let p = {
107
+ ...oe,
108
+ ...He
109
+ }, [m, h] = a(0), [Je, Ye] = a(!1), [Xe, g] = a(null), [Ze, _] = a(null), [Qe, v] = a(null), [$e, y] = a(!1), [et, b] = a(null), tt = ke(null), x = Ve ?? [], nt = x.length > 1, S = x.length > 0 ? x[m] ?? "" : Be ?? "", { initResponse: rt } = ee(), it = rt?.userId ?? "", C = rt?.scopes, w = we(C), T = Ce(C), at = Se(C), ot = r(C, [i.ApprovalRequestUpdateOrg]), st = !T && !ot && !at, E = me({ transactionId: d ? S : void 0 }), D = E.data, O = D?.applied_policy_id || void 0, k = ne({
110
+ objectType: te.Transaction,
111
+ enabled: d && !!O
112
+ }).data?.data?.find((e) => e.id === O), A = ve({ transactionId: d ? S : void 0 }), j = A.latestRequest, M = _e({ enabled: d }), N = ye(), ct = ge(), P = he(), lt = le({ enabled: d && w }), ut = de({ enabled: d && w }), dt = fe({ enabled: d && w }), F = pe({
113
+ transactionId: d ? S : void 0,
114
+ enabled: d
115
+ }), I = ae(D?.expense_status), L = ie(I, !!D?.has_validation_errors, {
116
+ ...re,
117
+ ...Ke
118
+ }), R = D?.merchant_amount ?? 0, z = D?.description ?? "", B = Xe?.transactionId === S ? Xe.value : z, V = u(M.requiredFields, "description", R), H = u(M.requiredFields, "receipt_id", R), U = D?.receipt_file_url ?? "", ft = j?.caller_is_policy_approver ?? !1, pt = !!(it && j?.approved_by?.includes(it)), mt = ft && !pt, ht = at && !ft, gt = w || I === "new" || I === "rejected", _t = D?.payment_method, W = _t?.type === "card" ? _t.details : null, vt = W ? p.cardLabel(W.card_type === "debit" ? p.debitCard : p.creditCard, W.last4 ?? "") : Me, G = D?.entity_user_id ?? "", yt = Oe(() => G ? [G] : [], [G]), bt = ue({
119
+ ids: yt,
120
+ enabled: d && yt.length > 0
121
+ }).data?.data?.find((e) => e.id === G), xt = bt ? xe(bt) : f?.get(G) ?? Me, St = !!S && (E.isPending || A.isPending || M.isPending), Ct = () => {
122
+ if (nt && m < x.length - 1) {
123
+ h((e) => e + 1);
124
+ return;
125
+ }
126
+ K();
127
+ }, K = () => {
128
+ h(0), g(null), _(null), v(null), b(null), ze();
129
+ }, q = T && gt, J = Ze?.transactionId === S && Ze.value, Y = D?.receipt_id, wt = D?.ledger_account_id || s, X = D?.department_id || s, Tt = D?.location_id || s, Z = et?.transactionId === S ? et : {
130
+ transactionId: S,
131
+ glCategory: wt,
132
+ department: X,
133
+ location: Tt
134
+ }, Et = [{
135
+ value: s,
136
+ label: p.glCategoryUncategorized
137
+ }, ...(dt.data?.data ?? []).map((e) => ({
138
+ value: e.id,
139
+ label: e.name ?? ""
140
+ }))], Dt = [{
141
+ value: s,
142
+ label: p.accountingNone
143
+ }, ...(lt.data?.data ?? []).map((e) => ({
144
+ value: e.id,
145
+ label: e.name
146
+ }))], Ot = [{
147
+ value: s,
148
+ label: p.accountingNone
149
+ }, ...(ut.data?.data ?? []).map((e) => ({
150
+ value: e.id,
151
+ label: e.name
152
+ }))], kt = Oe(() => {
153
+ let e = (F.data?.data ?? []).map((e) => ({
154
+ id: e.id,
155
+ event_type: e.event_type,
156
+ event_data: e.event_data,
157
+ timestamp: e.timestamp,
158
+ entity_user_id: e.entity_user_id,
159
+ entity_user_first_name: e.entity_user_first_name,
160
+ entity_user_last_name: e.entity_user_last_name,
161
+ recorded_by: e.recorded_by
162
+ }));
163
+ return Te(e, f ?? Ne, Ee);
164
+ }, [F.data, f]), At = async (t) => {
165
+ try {
166
+ let e = await ct.mutateAsync({ body: { file: t } });
167
+ if (!e.id) throw Error("Receipt upload returned no id");
168
+ await P.mutateAsync({
169
+ path: { receipt_id: e.id },
170
+ body: { transaction_id: S }
171
+ }), _({
172
+ transactionId: S,
173
+ value: !1
174
+ });
175
+ } catch {
176
+ e.error(p.receiptUploadFailed);
177
+ }
178
+ }, jt = async () => {
179
+ if (Y) try {
180
+ await P.mutateAsync({
181
+ path: { receipt_id: Y },
182
+ body: { transaction_id: null },
183
+ previousTransactionId: S
184
+ });
185
+ } catch {
186
+ e.error(p.receiptDeleteFailed);
187
+ } finally {
188
+ y(!1);
189
+ }
190
+ }, Q = Pe(k?.trigger), Mt = Q.greaterThanCents == null ? void 0 : n(Q.greaterThanCents / 100, {
191
+ currencyCode: D?.merchant_currency,
192
+ includeSpaceAfterCurrencySymbol: !1
193
+ }), Nt = Q.lessThanCents == null ? void 0 : n(Q.lessThanCents / 100, {
194
+ currencyCode: D?.merchant_currency,
195
+ includeSpaceAfterCurrencySymbol: !1
196
+ }), Pt = I === "approved" || I === "rejected" ? F.data?.data : void 0, Ft = Le(Pt), $ = Fe(Pt), It = Ie(j), Lt = I === "approved" && ($.source ? $.source === "auto" : It === 0), Rt = I === "approved" && ($.source ? $.source !== "auto" : It > 0), zt = Ft ?? (Mt || Nt ? void 0 : k?.name);
197
+ return /* @__PURE__ */ je(Ae, { children: [
198
+ /* @__PURE__ */ o("input", {
199
+ ref: tt,
200
+ type: "file",
201
+ accept: Re,
202
+ className: "ttw:hidden",
203
+ "aria-hidden": !0,
204
+ tabIndex: -1,
205
+ onChange: (e) => {
206
+ let t = e.target.files?.[0];
207
+ e.target.value = "", t && At(t);
208
+ }
209
+ }),
210
+ /* @__PURE__ */ o(se, {
211
+ open: d,
212
+ onClose: K,
213
+ transactionId: S,
214
+ transactionDate: t(D?.started_at, { month: "long" }),
215
+ statusLabel: L.label,
216
+ statusTone: L.tone,
217
+ isRejected: I === "rejected",
218
+ isPendingReview: I === "approve_in_progress",
219
+ amount: n(Math.abs(R) / 100, {
220
+ currencyCode: D?.merchant_currency,
221
+ includeSpaceAfterCurrencySymbol: !1
222
+ }),
223
+ merchant: D?.merchant_name ?? "",
224
+ receiptUrl: U,
225
+ isLoading: St,
226
+ isError: E.isError,
227
+ isClosingDisabled: Je,
228
+ cardLabel: vt,
229
+ cardName: W ? p.travelCard : void 0,
230
+ cardholder: xt,
231
+ showCardholder: !!G,
232
+ showPhysicalPill: !!W,
233
+ isDescriptionRequired: V,
234
+ isReceiptRequired: H,
235
+ isReceiptAutoMatched: D?.source_of_data?.receipt_id === "automatched",
236
+ isReceiptActionDisabled: !q && !U,
237
+ receiptButtonLabel: U ? p.receiptAttached : J ? p.receiptSubmitWithout : q ? p.receiptAttach : p.receiptMissing,
238
+ receiptButtonIcon: U ? "receipt" : J ? "send" : "paperclip",
239
+ receiptButtonVariant: U ? "ghost" : "outline",
240
+ showNoReceiptWarning: H && !U && J,
241
+ onUploadClick: q && !U ? () => tt.current?.click() : void 0,
242
+ onFileDrop: q && !U ? (e) => void At(e) : void 0,
243
+ onOpenReceiptInbox: q && !U ? () => v(S) : void 0,
244
+ onSubmitWithoutReceipt: q && !U ? () => _({
245
+ transactionId: S,
246
+ value: !0
247
+ }) : void 0,
248
+ onDeleteReceiptClick: q && Y ? () => y(!0) : void 0,
249
+ isUploading: ct.isPending || P.isPending,
250
+ descriptionValue: B,
251
+ initialDescriptionValue: z,
252
+ onDescriptionChange: (e) => g({
253
+ transactionId: S,
254
+ value: e.target.value
255
+ }),
256
+ onSaveDescription: () => {
257
+ N.mutateAsync({
258
+ transactionId: S,
259
+ body: { description: B || null }
260
+ }).then(() => g(null)).catch(() => {
261
+ e.error(p.memoSaveFailed);
262
+ });
263
+ },
264
+ onCancelDescription: () => g(null),
265
+ isSavingDescription: N.isPending,
266
+ isMemoEditable: T && gt,
267
+ memoBadgeLabel: D?.source_of_data?.description === "generated" ? p.memoAiAssigned : void 0,
268
+ showApprovalCard: I !== "new",
269
+ isAutoApproved: Lt,
270
+ isManuallyApproved: Rt,
271
+ approverName: $.approverName,
272
+ rejectionReason: D?.reject_reason ?? void 0,
273
+ hasAppliedPolicy: !!O,
274
+ greaterThanValue: Mt,
275
+ lessThanValue: Nt,
276
+ ruleLabel: zt,
277
+ showAccountingCard: w,
278
+ glCategory: Z.glCategory,
279
+ initialGlCategory: wt,
280
+ glCategoryOptions: Et,
281
+ onGlCategoryChange: (e) => b({
282
+ ...Z,
283
+ glCategory: e
284
+ }),
285
+ department: Z.department,
286
+ initialDepartment: X,
287
+ departmentOptions: Dt,
288
+ onDepartmentChange: (e) => b({
289
+ ...Z,
290
+ department: e
291
+ }),
292
+ location: Z.location,
293
+ initialLocation: Tt,
294
+ locationOptions: Ot,
295
+ onLocationChange: (e) => b({
296
+ ...Z,
297
+ location: e
298
+ }),
299
+ onSaveAccounting: () => {
300
+ N.mutateAsync({
301
+ transactionId: S,
302
+ body: {
303
+ ledger_account_id: c(Z.glCategory),
304
+ department_id: c(Z.department),
305
+ location_id: c(Z.location)
306
+ }
307
+ }).then(() => b(null)).catch(() => {
308
+ e.error(p.accountingSaveFailed);
309
+ });
310
+ },
311
+ onCancelAccounting: () => b(null),
312
+ isSavingAccounting: N.isPending,
313
+ glCategoryHighlight: l(D?.source_of_data?.ledger_account_id),
314
+ departmentHighlight: l(D?.source_of_data?.department_id),
315
+ locationHighlight: l(D?.source_of_data?.location_id),
316
+ showAuditHistoryCard: !0,
317
+ auditHistoryRows: kt,
318
+ isLoadingAuditHistory: F.isPending,
319
+ isAuditHistoryError: F.isError,
320
+ labels: Ue,
321
+ cardLabels: We,
322
+ fileViewerLabels: qe,
323
+ children: D && !E.isError ? /* @__PURE__ */ o(be, {
324
+ transactionId: S,
325
+ status: I,
326
+ approvalRequestId: j?.id,
327
+ canUseApprovalRequestActions: mt,
328
+ canUseForceActions: ht,
329
+ canWrite: T,
330
+ hasOnlyViewPermission: st,
331
+ isDisabled: V && !z,
332
+ showNoReceiptField: H && !U && I !== "approved",
333
+ isBulkMode: nt,
334
+ currentItem: m + 1,
335
+ totalItems: x.length,
336
+ onCompleted: Ct,
337
+ onClose: K,
338
+ onPendingChange: Ye,
339
+ labels: Ge
340
+ }, S) : null
341
+ }),
342
+ Qe && /* @__PURE__ */ o(De, {
343
+ isOpen: !0,
344
+ targetTransactionId: Qe,
345
+ onClose: () => v(null),
346
+ onSingleTransactionUpdate: () => {
347
+ E.refetch();
348
+ }
349
+ }),
350
+ /* @__PURE__ */ o(ce, {
351
+ open: $e,
352
+ onOpenChange: y,
353
+ isRemoving: P.isPending,
354
+ onConfirm: () => void jt(),
355
+ onCancel: () => y(!1)
356
+ })
357
+ ] });
32
358
  }
33
- var a = {
34
- dateLabel: r,
35
- timeLabel: i,
36
- byActor: (e, t) => `${e} by ${t}`,
37
- statusLabel: (t) => n(e, t),
38
- paymentStatusLabel: (e) => n(t, e),
39
- expenseCreated: "Expense created",
40
- createdFromFeed: "Imported from the card feed",
41
- createdManually: "Data entered manually",
42
- expenseUpdated: "Expense details updated",
43
- statusUpdated: "Status updated",
44
- changedTo: (e) => `Changed to ${e}`,
45
- submittedForApproval: "Submitted for approval",
46
- submittedWithoutReceipt: "Submitted without a receipt",
47
- approvalRequested: "Approval requested",
48
- approved: "Approved",
49
- rejected: "Rejected",
50
- policyOverrideApproved: "Policy override: Approved",
51
- policyOverrideRejected: "Policy override: Rejected",
52
- approvedAutomatically: "Auto-approved",
53
- withReason: (e, t) => `${e}: "${t}"`,
54
- quotedReason: (e) => `"${e}"`,
55
- reopened: "Re-opened",
56
- cancelled: "Canceled",
57
- deleted: "Deleted",
58
- receiptMatched: "Receipt matched",
59
- matchedAutomatically: "Matched automatically",
60
- matchedManually: "Matched manually",
61
- receiptRemoved: "Receipt unlinked",
62
- categorizedAutomatically: "Categorized automatically",
63
- paymentStatusUpdated: "Payment status updated",
64
- changedFromTo: (e, t) => `Changed from ${e} to ${t}`
65
- };
66
359
  //#endregion
67
- export { a as EXPENSE_AUDIT_HISTORY_LABELS_EN };
360
+ export { d as TransactionDetailsFeature, d as default };
@@ -1,75 +1,40 @@
1
- "use client";
2
- "use client";
3
- "use client";
4
- "use client";
5
- import { TransactionDetailsActions as e } from "../../ui/dist/lib/TransactionDetailsActions/TransactionDetailsActions.js";
6
- import "../../ui/dist/index.js";
7
- import { useApproveApprovalRequestMutation as t, useApproveTransactionMutation as n, useRejectApprovalRequestMutation as r, useRejectTransactionMutation as i, useReopenTransactionMutation as a, useSubmitTransactionMutation as o } from "../../data-access/dist/index21.js";
8
- import "../../data-access/dist/index.js";
9
- import { useState as s } from "react";
10
- import { jsx as c } from "react/jsx-runtime";
1
+ import { formatTimestampDate as e } from "../../../shared/util/dist/lib/formatTimestampDate.js";
2
+ import { formatMoneyExact as t } from "../../../shared/util/dist/lib/formatMoneyExact.js";
3
+ import { EXPENSE_STATUS_BADGE_LABELS_EN as n, resolveExpenseStatusBadge as r, toExpenseDisplayStatus as i } from "./index2.js";
11
4
  //#region ../../libs/tesouro-embedded-components-react/expense-management-widget/feature/dist/index12.js
12
- function l({ transactionId: l, status: u, approvalRequestId: d, canUseApprovalRequestActions: f, canUseForceActions: p, canWrite: m, hasOnlyViewPermission: h, isDisabled: g, showNoReceiptField: _, isBulkMode: v, currentItem: y, totalItems: b, onCompleted: x, onClose: S, onPendingChange: C, labels: w }) {
13
- let [T, E] = s(!1), [D, O] = s(""), [k, A] = s(!1), j = n(), M = i(), N = t(), P = r(), F = o(), I = a(), L = j.isPending || M.isPending || N.isPending || P.isPending || F.isPending || I.isPending, R = async (e) => {
14
- A(!1), C?.(!0);
15
- try {
16
- await e(), x();
17
- } catch {
18
- A(!0);
19
- } finally {
20
- C?.(!1);
21
- }
22
- }, z = _ ? {
23
- bypass_receipt_validation: !0,
24
- no_receipt_reason: D
25
- } : void 0;
26
- return /* @__PURE__ */ c(e, {
27
- status: u,
28
- onApprove: () => R(() => f && d ? N.mutateAsync({
29
- transactionId: l,
30
- approvalRequestId: d
31
- }) : j.mutateAsync({ transactionId: l })),
32
- onReject: () => R(() => f && d ? P.mutateAsync({
33
- transactionId: l,
34
- approvalRequestId: d,
35
- rejectReason: D
36
- }) : M.mutateAsync({
37
- transactionId: l,
38
- rejectReason: D
39
- })),
40
- onSubmit: () => R(() => F.mutateAsync({
41
- transactionId: l,
42
- body: z
43
- })),
44
- onReopen: () => R(async () => {
45
- await I.mutateAsync({ transactionId: l }), await F.mutateAsync({
46
- transactionId: l,
47
- body: z
48
- });
49
- }),
50
- onClose: S,
51
- onToggleRejectMode: () => {
52
- E((e) => !e), O("");
53
- },
54
- isLoading: L,
55
- isRejectMode: T,
56
- reasonValue: D,
57
- onReasonChange: (e) => O(e.target.value),
58
- canApprove: f || p,
59
- canWrite: m,
60
- hasOnlyViewPermission: h,
61
- isSubmitDisabled: L || g || _ && !D,
62
- isConfirmRejectionDisabled: L || !D,
63
- showNoReceiptField: _,
64
- showNoReceiptRequiredMarker: _,
65
- showReviewNextLabels: v && y < b,
66
- isBulkMode: v,
67
- currentItem: y,
68
- totalItems: b,
69
- percentComplete: b > 0 ? Math.round(y / b * 100) : 0,
70
- hasActionError: k,
71
- labels: w
5
+ var a = "—", o = "Physical";
6
+ function s(e) {
7
+ return e.type === "refund" ? `Refund from ${e.merchant_name}` : e.type === "fee" ? `Fee from ${e.merchant_name}` : e.type === "cash_withdrawal" ? `Cash withdrawal from ${e.merchant_name}` : e.merchant_name;
8
+ }
9
+ function c(e) {
10
+ let n = t(Math.abs((e.merchant_amount ?? 0) / 100), {
11
+ currencyCode: e.merchant_currency,
12
+ includeSpaceAfterCurrencySymbol: !1
72
13
  });
14
+ return e.type === "refund" ? `+ ${n}` : n;
15
+ }
16
+ function l(e) {
17
+ return e ? e.type === "card" ? {
18
+ cardLabel: `••••${e.details.last4 ?? "••••"}`,
19
+ cardFormatLabel: o
20
+ } : e.type === "bank_account" ? { cardLabel: `••••${e.details.account_number?.slice(-4) ?? "••••"}` } : { cardLabel: a } : { cardLabel: a };
21
+ }
22
+ function u(t, o = {}) {
23
+ let { cardLabel: u, cardFormatLabel: d } = l(t.payment_method), f = r(i(t.expense_status), !!t.has_validation_errors, o.statusBadgeLabels ?? n), p = !!t.receipt_id, m = p && t.source_of_data?.receipt_id === "automatched";
24
+ return {
25
+ id: t.id,
26
+ dateLabel: e(t.started_at),
27
+ statusLabel: f.label,
28
+ statusTone: f.tone,
29
+ merchantLabel: s(t),
30
+ cardholderLabel: o.cardholderLabel ?? a,
31
+ cardLabel: u,
32
+ cardFormatLabel: d,
33
+ departmentLabel: o.departmentLabel ?? a,
34
+ amountLabel: c(t),
35
+ hasReceipt: p,
36
+ isReceiptHighlighted: m
37
+ };
73
38
  }
74
39
  //#endregion
75
- export { l as TransactionDetailsActionsFeature, l as default };
40
+ export { u as mapTransactionRow };