@mx-cartographer/experiences 9.1.0-alpha.bb1 → 9.1.1

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 (248) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/README.md +10 -10
  3. package/dist/Account-DR7Plrqy.mjs +119 -0
  4. package/dist/Account-DR7Plrqy.mjs.map +1 -0
  5. package/dist/AccountDetailsDrawer-C1hhmlmI.mjs +922 -0
  6. package/dist/AccountDetailsDrawer-C1hhmlmI.mjs.map +1 -0
  7. package/dist/AccountDetailsHeader-BliEZhz7.mjs +230 -0
  8. package/dist/AccountDetailsHeader-BliEZhz7.mjs.map +1 -0
  9. package/dist/AccountUtils-Cbh8r9cP.mjs +29 -0
  10. package/dist/AccountUtils-Cbh8r9cP.mjs.map +1 -0
  11. package/dist/Analytics-CkYXKvco.mjs +54 -0
  12. package/dist/Analytics-CkYXKvco.mjs.map +1 -0
  13. package/dist/Analytics-WeZYytR0.mjs +140 -0
  14. package/dist/Analytics-WeZYytR0.mjs.map +1 -0
  15. package/dist/ApiEndpoints-DXwIYNUV.mjs +50 -0
  16. package/dist/ApiEndpoints-DXwIYNUV.mjs.map +1 -0
  17. package/dist/BeatMaterialIcon-1KOfRZrA.mjs +27 -0
  18. package/dist/BeatMaterialIcon-1KOfRZrA.mjs.map +1 -0
  19. package/dist/BudgetUtil-Bg2AQJpQ.mjs +75 -0
  20. package/dist/BudgetUtil-Bg2AQJpQ.mjs.map +1 -0
  21. package/dist/Category-DEKZGLYe.mjs +302 -0
  22. package/dist/Category-DEKZGLYe.mjs.map +1 -0
  23. package/dist/CategorySelectorDrawer-NJsFsKP1.mjs +431 -0
  24. package/dist/CategorySelectorDrawer-NJsFsKP1.mjs.map +1 -0
  25. package/dist/Connect-BH0Pt6zc.mjs +43 -0
  26. package/dist/Connect-BH0Pt6zc.mjs.map +1 -0
  27. package/dist/ConnectCard-D7uxoH5Y.mjs +55 -0
  28. package/dist/ConnectCard-D7uxoH5Y.mjs.map +1 -0
  29. package/dist/ConnectDrawer-CW4LA3H3.mjs +58 -0
  30. package/dist/ConnectDrawer-CW4LA3H3.mjs.map +1 -0
  31. package/dist/ConnectionsDrawer-CZU9ku-k.mjs +54 -0
  32. package/dist/ConnectionsDrawer-CZU9ku-k.mjs.map +1 -0
  33. package/dist/CurrencyDialog-DumQCTPO.mjs +374 -0
  34. package/dist/CurrencyDialog-DumQCTPO.mjs.map +1 -0
  35. package/dist/CurrencyInput-DaGEQaLW.mjs +88 -0
  36. package/dist/CurrencyInput-DaGEQaLW.mjs.map +1 -0
  37. package/dist/CurrencyText-CCbE6MmF.mjs +21 -0
  38. package/dist/CurrencyText-CCbE6MmF.mjs.map +1 -0
  39. package/dist/DateFormats-HudZ3Bjs.mjs +65 -0
  40. package/dist/DateFormats-HudZ3Bjs.mjs.map +1 -0
  41. package/dist/DateUtil-CzBmbjmA.mjs +75 -0
  42. package/dist/DateUtil-CzBmbjmA.mjs.map +1 -0
  43. package/dist/DebtUtils-i4pI2Uoe.mjs +154 -0
  44. package/dist/DebtUtils-i4pI2Uoe.mjs.map +1 -0
  45. package/dist/Dialog-Bvd2n8hz.mjs +67 -0
  46. package/dist/Dialog-Bvd2n8hz.mjs.map +1 -0
  47. package/dist/Donut-SzzfZDHF.mjs +89 -0
  48. package/dist/Donut-SzzfZDHF.mjs.map +1 -0
  49. package/dist/Drawer-DsnW2o0v.mjs +175 -0
  50. package/dist/Drawer-DsnW2o0v.mjs.map +1 -0
  51. package/dist/EmbeddedCard-DH8vQ3qN.mjs +859 -0
  52. package/dist/EmbeddedCard-DH8vQ3qN.mjs.map +1 -0
  53. package/dist/EmptyState-CJUDc3kD.mjs +85 -0
  54. package/dist/EmptyState-CJUDc3kD.mjs.map +1 -0
  55. package/dist/Error-Dtw6yxkf.mjs +85 -0
  56. package/dist/Error-Dtw6yxkf.mjs.map +1 -0
  57. package/dist/ErrorBoundary-CsdOcnJ9.mjs +24 -0
  58. package/dist/ErrorBoundary-CsdOcnJ9.mjs.map +1 -0
  59. package/dist/ExportCsvAction-C9KWH3Az.mjs +25 -0
  60. package/dist/ExportCsvAction-C9KWH3Az.mjs.map +1 -0
  61. package/dist/GlobalAccountFilter-BhzR5Vb1.mjs +230 -0
  62. package/dist/GlobalAccountFilter-BhzR5Vb1.mjs.map +1 -0
  63. package/dist/GlobalCopyApi-wcnDUzMV.mjs +129 -0
  64. package/dist/GlobalCopyApi-wcnDUzMV.mjs.map +1 -0
  65. package/dist/GoalsUtil-C9EnLWvC.mjs +108 -0
  66. package/dist/GoalsUtil-C9EnLWvC.mjs.map +1 -0
  67. package/dist/HeaderCell-P8w6CmfO.mjs +7 -0
  68. package/dist/HeaderCell-P8w6CmfO.mjs.map +1 -0
  69. package/dist/Help-CkQTjORd.mjs +300 -0
  70. package/dist/Help-CkQTjORd.mjs.map +1 -0
  71. package/dist/Help-aERwhajy.mjs +3210 -0
  72. package/dist/Help-aERwhajy.mjs.map +1 -0
  73. package/dist/IconBacking-DgT8DCeh.mjs +40 -0
  74. package/dist/IconBacking-DgT8DCeh.mjs.map +1 -0
  75. package/dist/InformationTooltip-4su8bn1e.mjs +42 -0
  76. package/dist/InformationTooltip-4su8bn1e.mjs.map +1 -0
  77. package/dist/InvestmentUtil-BItV7uEs.mjs +135 -0
  78. package/dist/InvestmentUtil-BItV7uEs.mjs.map +1 -0
  79. package/dist/LineChart-CUfiH86G.mjs +613 -0
  80. package/dist/LineChart-CUfiH86G.mjs.map +1 -0
  81. package/dist/ListItemAction-BqUCLj_w.mjs +70 -0
  82. package/dist/ListItemAction-BqUCLj_w.mjs.map +1 -0
  83. package/dist/ListItemRow-kH1rn8Xu.mjs +68 -0
  84. package/dist/ListItemRow-kH1rn8Xu.mjs.map +1 -0
  85. package/dist/ListItemWrapper-DRse79Iu.mjs +44 -0
  86. package/dist/ListItemWrapper-DRse79Iu.mjs.map +1 -0
  87. package/dist/Loader-CxeBwuPG.mjs +22 -0
  88. package/dist/Loader-CxeBwuPG.mjs.map +1 -0
  89. package/dist/Localization-DnoVyBNK.mjs +39 -0
  90. package/dist/Localization-DnoVyBNK.mjs.map +1 -0
  91. package/dist/ManageIncome-Be9WHv-s.mjs +906 -0
  92. package/dist/ManageIncome-Be9WHv-s.mjs.map +1 -0
  93. package/dist/MicroWidgetContainer-B2NnKBgW.mjs +46 -0
  94. package/dist/MicroWidgetContainer-B2NnKBgW.mjs.map +1 -0
  95. package/dist/MiniWidgetContainer-Bmv_WeUd.mjs +67 -0
  96. package/dist/MiniWidgetContainer-Bmv_WeUd.mjs.map +1 -0
  97. package/dist/NetWorthUtils-Dj7CgAg2.mjs +96 -0
  98. package/dist/NetWorthUtils-Dj7CgAg2.mjs.map +1 -0
  99. package/dist/Notification-DTNYSd8P.mjs +8 -0
  100. package/dist/Notification-DTNYSd8P.mjs.map +1 -0
  101. package/dist/NotificationSettings-CW7okUrk.mjs +678 -0
  102. package/dist/NotificationSettings-CW7okUrk.mjs.map +1 -0
  103. package/dist/NotificationUtils-BRGFTePr.mjs +24 -0
  104. package/dist/NotificationUtils-BRGFTePr.mjs.map +1 -0
  105. package/dist/NumberFormatting--XMeeBfr.mjs +50 -0
  106. package/dist/NumberFormatting--XMeeBfr.mjs.map +1 -0
  107. package/dist/OriginalBalanceAction-YrvxBYAl.mjs +115 -0
  108. package/dist/OriginalBalanceAction-YrvxBYAl.mjs.map +1 -0
  109. package/dist/RecurringSettings-kRqAViNn.mjs +89 -0
  110. package/dist/RecurringSettings-kRqAViNn.mjs.map +1 -0
  111. package/dist/RecurringTransactionsUtil-CHWmqvW5.mjs +299 -0
  112. package/dist/RecurringTransactionsUtil-CHWmqvW5.mjs.map +1 -0
  113. package/dist/ResponsiveButton-CC9F_Ezk.mjs +46 -0
  114. package/dist/ResponsiveButton-CC9F_Ezk.mjs.map +1 -0
  115. package/dist/SearchBox-Cpgu_gdO.mjs +51 -0
  116. package/dist/SearchBox-Cpgu_gdO.mjs.map +1 -0
  117. package/dist/Select-CSpkK5cR.mjs +62 -0
  118. package/dist/Select-CSpkK5cR.mjs.map +1 -0
  119. package/dist/SelectionBox-B4xELRgp.mjs +49 -0
  120. package/dist/SelectionBox-B4xELRgp.mjs.map +1 -0
  121. package/dist/SingleSegmentDonut-7Uy6VEld.mjs +70 -0
  122. package/dist/SingleSegmentDonut-7Uy6VEld.mjs.map +1 -0
  123. package/dist/Sizes-DISGrlUg.mjs +7 -0
  124. package/dist/Sizes-DISGrlUg.mjs.map +1 -0
  125. package/dist/SkeletonLoader-BaNboJjD.mjs +39 -0
  126. package/dist/SkeletonLoader-BaNboJjD.mjs.map +1 -0
  127. package/dist/SpendingData-Fii_xATx.mjs +54 -0
  128. package/dist/SpendingData-Fii_xATx.mjs.map +1 -0
  129. package/dist/SpendingLegend-CxvNOg3c.mjs +204 -0
  130. package/dist/SpendingLegend-CxvNOg3c.mjs.map +1 -0
  131. package/dist/StatusBar-CPfSXe80.mjs +31 -0
  132. package/dist/StatusBar-CPfSXe80.mjs.map +1 -0
  133. package/dist/TabContentContainer-B0eYJP5p.mjs +49 -0
  134. package/dist/TabContentContainer-B0eYJP5p.mjs.map +1 -0
  135. package/dist/ToggleListItem-Dl1lXNwj.mjs +92 -0
  136. package/dist/ToggleListItem-Dl1lXNwj.mjs.map +1 -0
  137. package/dist/TransactionDetails-roZ5xLq8.mjs +1708 -0
  138. package/dist/TransactionDetails-roZ5xLq8.mjs.map +1 -0
  139. package/dist/TransactionUtils-BphBJBbU.mjs +235 -0
  140. package/dist/TransactionUtils-BphBJBbU.mjs.map +1 -0
  141. package/dist/TrendsUtil-D9z3kIj_.mjs +70 -0
  142. package/dist/TrendsUtil-D9z3kIj_.mjs.map +1 -0
  143. package/dist/UserStore-BjnNCO5a.mjs +3121 -0
  144. package/dist/UserStore-BjnNCO5a.mjs.map +1 -0
  145. package/dist/ViewMoreMicroCard-fnwE0hqd.mjs +1280 -0
  146. package/dist/ViewMoreMicroCard-fnwE0hqd.mjs.map +1 -0
  147. package/dist/WidgetContainer-DJnp6t6c.mjs +483 -0
  148. package/dist/WidgetContainer-DJnp6t6c.mjs.map +1 -0
  149. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsDrawer.d.ts +6 -0
  150. package/dist/accounts/index.d.ts +1 -0
  151. package/dist/accounts/index.es.js +784 -12
  152. package/dist/accounts/index.es.js.map +1 -0
  153. package/dist/analytics/index.es.js +140 -155
  154. package/dist/analytics/index.es.js.map +1 -0
  155. package/dist/budgets/index.es.js +1267 -1317
  156. package/dist/budgets/index.es.js.map +1 -0
  157. package/dist/cashflow/context/hooks.d.ts +7 -6
  158. package/dist/cashflow/index.es.js +944 -1076
  159. package/dist/cashflow/index.es.js.map +1 -0
  160. package/dist/categories/index.es.js +5 -4
  161. package/dist/categories/index.es.js.map +1 -0
  162. package/dist/common/components/DataRow.d.ts +1 -0
  163. package/dist/common/components/ListItemWrapper.d.ts +2 -1
  164. package/dist/common/constants/Analytics.d.ts +3 -0
  165. package/dist/common/index.es.js +310 -101
  166. package/dist/common/index.es.js.map +1 -0
  167. package/dist/core/index.es.js +105 -80
  168. package/dist/core/index.es.js.map +1 -0
  169. package/dist/core/stores/CashflowStore.d.ts +8 -7
  170. package/dist/core/stores/RecurringTransactionsStore.d.ts +53 -1
  171. package/dist/core/stores/TransactionStore.d.ts +1 -0
  172. package/dist/core/types/localization/RecurringCopy.d.ts +14 -1
  173. package/dist/core/types/localization/SpendingCopy.d.ts +1 -0
  174. package/dist/core/utils/AccountUtils.d.ts +8 -0
  175. package/dist/core/utils/DateUtil.d.ts +2 -0
  176. package/dist/core/utils/RecurringTransactionsUtil.d.ts +2 -1
  177. package/dist/dashboard/index.es.js +142 -185
  178. package/dist/dashboard/index.es.js.map +1 -0
  179. package/dist/debts/index.es.js +1273 -1384
  180. package/dist/debts/index.es.js.map +1 -0
  181. package/dist/finstrong/index.es.js +3473 -3367
  182. package/dist/finstrong/index.es.js.map +1 -0
  183. package/dist/goals/index.es.js +984 -1103
  184. package/dist/goals/index.es.js.map +1 -0
  185. package/dist/help/index.es.js +26 -3
  186. package/dist/help/index.es.js.map +1 -0
  187. package/dist/hooks-97sNJ_lf.mjs +78 -0
  188. package/dist/hooks-97sNJ_lf.mjs.map +1 -0
  189. package/dist/insights/components/insights/WeeklyNoSpendDays/BubbleWeek.d.ts +4 -1
  190. package/dist/insights/components/insights/WeeklyNoSpendDays/WeeklyNoSpendDays.d.ts +4 -2
  191. package/dist/insights/index.es.js +4871 -93
  192. package/dist/insights/index.es.js.map +1 -0
  193. package/dist/investments/index.es.js +1523 -1533
  194. package/dist/investments/index.es.js.map +1 -0
  195. package/dist/merchants/index.es.js +65 -75
  196. package/dist/merchants/index.es.js.map +1 -0
  197. package/dist/microinsights/index.es.js +826 -15
  198. package/dist/microinsights/index.es.js.map +1 -0
  199. package/dist/networth/index.es.js +504 -550
  200. package/dist/networth/index.es.js.map +1 -0
  201. package/dist/notifications/index.es.js +162 -169
  202. package/dist/notifications/index.es.js.map +1 -0
  203. package/dist/recurringtransactions/components/RecurringTransactionDetails.d.ts +3 -2
  204. package/dist/recurringtransactions/components/RecurringTransactionDetailsDrawer.d.ts +3 -0
  205. package/dist/recurringtransactions/components/RecurringTransactionList.d.ts +11 -0
  206. package/dist/recurringtransactions/components/UpcomingRecurrenceCard.d.ts +8 -0
  207. package/dist/recurringtransactions/components/actions/LinkTransactionDrawer.d.ts +10 -0
  208. package/dist/recurringtransactions/components/actions/MarkAsPaidDialog.d.ts +7 -0
  209. package/dist/recurringtransactions/components/actions/MarkAsUnpaidDialog.d.ts +7 -0
  210. package/dist/recurringtransactions/index.es.js +1012 -10
  211. package/dist/recurringtransactions/index.es.js.map +1 -0
  212. package/dist/settings/index.es.js +892 -13
  213. package/dist/settings/index.es.js.map +1 -0
  214. package/dist/spending/index.es.js +457 -400
  215. package/dist/spending/index.es.js.map +1 -0
  216. package/dist/transactions/components/shared/transactionlist/TransactionRow.d.ts +1 -0
  217. package/dist/transactions/index.es.js +604 -10
  218. package/dist/transactions/index.es.js.map +1 -0
  219. package/dist/trends/index.es.js +1408 -1268
  220. package/dist/trends/index.es.js.map +1 -0
  221. package/dist/useAccountDisplayName-BsiXA0qf.mjs +24 -0
  222. package/dist/useAccountDisplayName-BsiXA0qf.mjs.map +1 -0
  223. package/dist/useAriaLive-MkYebyUR.mjs +36 -0
  224. package/dist/useAriaLive-MkYebyUR.mjs.map +1 -0
  225. package/dist/useDimensions-CeDR9V8N.mjs +37 -0
  226. package/dist/useDimensions-CeDR9V8N.mjs.map +1 -0
  227. package/dist/useInsightsEnabled-D5Sdm0TJ.mjs +12 -0
  228. package/dist/useInsightsEnabled-D5Sdm0TJ.mjs.map +1 -0
  229. package/dist/useScreenSize-mWpmnh5w.mjs +37 -0
  230. package/dist/useScreenSize-mWpmnh5w.mjs.map +1 -0
  231. package/dist/useWidgetLoadTimer-B0tB-yzL.mjs +20 -0
  232. package/dist/useWidgetLoadTimer-B0tB-yzL.mjs.map +1 -0
  233. package/package.json +30 -30
  234. package/dist/Analytics-BKzTPees.mjs +0 -61
  235. package/dist/GlobalCopyApi-BeXzaDH9.mjs +0 -487
  236. package/dist/HeaderCell-EhCUSjvj.mjs +0 -10
  237. package/dist/Loader-BlVzRtUd.mjs +0 -73
  238. package/dist/MiniWidgetContainer-COwnjfy7.mjs +0 -110
  239. package/dist/OriginalBalanceAction-sbiqaxok.mjs +0 -110
  240. package/dist/SpendingLegend-D15ixlQ1.mjs +0 -222
  241. package/dist/accounts-DkyAiLpg.mjs +0 -15632
  242. package/dist/core-BexP5oiV.mjs +0 -4047
  243. package/dist/help-CctDYrAH.mjs +0 -2308
  244. package/dist/insights/components/insights/P2pCategorization/_tests_/P2pCategorizationMultipleTransaction.test.d.ts +0 -0
  245. package/dist/insights/components/insights/P2pCategorization/_tests_/P2pCategorizationSingleTransaction.test.d.ts +0 -0
  246. package/dist/microinsights-CRf3ChsJ.mjs +0 -1814
  247. package/dist/recurringtransactions-gbJ_NA8u.mjs +0 -1564
  248. package/dist/settings-ZMHe439l.mjs +0 -1526
@@ -0,0 +1,1708 @@
1
+ import { jsx as e, jsxs as m } from "react/jsx-runtime";
2
+ import c, { useMemo as ke } from "react";
3
+ import { observer as w } from "mobx-react-lite";
4
+ import Ue from "@mui/material/Alert";
5
+ import Y from "@mui/material/Box";
6
+ import Te from "@mui/material/Divider";
7
+ import be from "@mui/material/List";
8
+ import he from "@mui/material/Paper";
9
+ import We from "@mui/material/Snackbar";
10
+ import L from "@mui/material/Stack";
11
+ import { useTheme as H, alpha as xe } from "@mui/material/styles";
12
+ import { P as ee, Text as x, H2 as Ve, MerchantLogo as Ce, Toast as Ye, CategoryIcon as Oe, CategoryIconVariants as Ge, TextField as Le, Icon as ye } from "@mxenabled/mxui";
13
+ import { endOfMonth as Be } from "date-fns/endOfMonth";
14
+ import { getUnixTime as Ie } from "date-fns/getUnixTime";
15
+ import { isBefore as je } from "date-fns/isBefore";
16
+ import { startOfMonth as De } from "date-fns/startOfMonth";
17
+ import { b as I } from "./Localization-DnoVyBNK.mjs";
18
+ import { f as V } from "./NumberFormatting--XMeeBfr.mjs";
19
+ import { a as qe, i as Qe } from "./BudgetUtil-Bg2AQJpQ.mjs";
20
+ import me from "@mui/material/Button";
21
+ import Xe from "@mui/material/FormGroup";
22
+ import ue from "@mui/material/IconButton";
23
+ import $e from "@mui/material/TextField";
24
+ import { u as Ae } from "./useAriaLive-MkYebyUR.mjs";
25
+ import { b as Ze, T as Je, u as ne, O as f, c as et, d as tt, E as at, C as nt } from "./EmbeddedCard-DH8vQ3qN.mjs";
26
+ import { u as E, g as M, o as rt, c as ot, l as we, f as G, a as it, C as st } from "./hooks-97sNJ_lf.mjs";
27
+ import { A as j } from "./Analytics-WeZYytR0.mjs";
28
+ import lt from "@mui/material/ToggleButton";
29
+ import { ChevronRight as Ke, Icon as k, Delete as fe, Cancel as Se, Search as ct, Edit as dt, Flag as ut } from "@mxenabled/mx-icons";
30
+ import { fromUnixTime as ve } from "date-fns/fromUnixTime";
31
+ import q from "@mui/material/Avatar";
32
+ import U from "@mui/material/ListItem";
33
+ import Q from "@mui/material/ListItemAvatar";
34
+ import W from "@mui/material/ListItemText";
35
+ import { f as Me, D as Re } from "./DateFormats-HudZ3Bjs.mjs";
36
+ import { BarChart as mt } from "@mui/x-charts";
37
+ import { L as _t } from "./Loader-CxeBwuPG.mjs";
38
+ import X from "@mui/material/ListItemButton";
39
+ import Z from "@mui/material/ListItemIcon";
40
+ import { b as Fe } from "./CategorySelectorDrawer-NJsFsKP1.mjs";
41
+ import { D as ae } from "./Dialog-Bvd2n8hz.mjs";
42
+ import { D as _e } from "./Drawer-DsnW2o0v.mjs";
43
+ import { b as gt, C as pt, a as ht } from "./CurrencyDialog-DumQCTPO.mjs";
44
+ import Pe from "@mui/material/InputAdornment";
45
+ import yt from "@mui/material/Checkbox";
46
+ import { l as Tt } from "./DateUtil-CzBmbjmA.mjs";
47
+ import Ne from "@mui/material/Grid";
48
+ import { C as bt } from "./CurrencyInput-DaGEQaLW.mjs";
49
+ import Ct from "@mui/material/Switch";
50
+ var de = /* @__PURE__ */ ((t) => (t[t.Category = 0] = "Category", t[t.Date = 1] = "Date", t[t.Memo = 2] = "Memo", t[t.Tags = 3] = "Tags", t))(de || {}), ie = /* @__PURE__ */ ((t) => (t[t.MerchantBudget = 0] = "MerchantBudget", t[t.SplitTransaction = 1] = "SplitTransaction", t[t.HideTransaction = 2] = "HideTransaction", t[t.MerchantLogo = 3] = "MerchantLogo", t))(ie || {});
51
+ const ft = [
52
+ 0,
53
+ 1,
54
+ 2,
55
+ 3
56
+ /* Tags */
57
+ ], St = [
58
+ 1,
59
+ 2,
60
+ 3
61
+ /* MerchantLogo */
62
+ ], At = ({
63
+ startDate: t,
64
+ onViewHistory: n,
65
+ totalTransaction: l,
66
+ amount: a,
67
+ spentPercentage: r,
68
+ remainingAmount: o,
69
+ iconColor: i,
70
+ icon: _
71
+ }) => {
72
+ const { budgets: s } = E();
73
+ return /* @__PURE__ */ e(c.Fragment, { children: /* @__PURE__ */ m(
74
+ Y,
75
+ {
76
+ sx: {
77
+ bgcolor: "background.paper",
78
+ borderBottomColor: "divider",
79
+ borderBottomStyle: "solid",
80
+ borderBottomWidth: 1
81
+ },
82
+ children: [
83
+ /* @__PURE__ */ m(
84
+ L,
85
+ {
86
+ sx: {
87
+ alignItems: "center",
88
+ flexDirection: "row",
89
+ gap: 12,
90
+ justifyContent: "space-between",
91
+ pt: 16,
92
+ px: 24
93
+ },
94
+ children: [
95
+ /* @__PURE__ */ e(ee, { bold: !0, variant: "subtitle1", children: Tt(t) }),
96
+ n && /* @__PURE__ */ e(me, { endIcon: /* @__PURE__ */ e(Ke, {}), onClick: n, sx: { height: 28 }, children: /* @__PURE__ */ e(x, { bold: !0, variant: "body2", children: s.spending_history }) })
97
+ ]
98
+ }
99
+ ),
100
+ /* @__PURE__ */ e(
101
+ Ze,
102
+ {
103
+ amount: /* @__PURE__ */ m(L, { sx: { alignItems: "baseline", flexDirection: "row", gap: 4 }, children: [
104
+ /* @__PURE__ */ e(Ve, { children: V(l, "0,0.00") }),
105
+ /* @__PURE__ */ e(ee, { color: "text.secondary", variant: "body2", children: "/" }),
106
+ /* @__PURE__ */ e(ee, { color: "text.secondary", variant: "body2", children: V(a, "0,0.00") })
107
+ ] }),
108
+ completeColor: `${i}.main`,
109
+ icon: _,
110
+ label: s.spent_label,
111
+ leftLabel: I(s.percent_spent, r.toFixed()),
112
+ percentComplete: r,
113
+ rightLabel: I(
114
+ s.balance_left,
115
+ V(o, "0,0.00")
116
+ ),
117
+ sx: {
118
+ pb: 24,
119
+ pt: 16,
120
+ px: 24
121
+ }
122
+ }
123
+ )
124
+ ]
125
+ }
126
+ ) });
127
+ }, xt = ({
128
+ merchantBudget: t,
129
+ transaction: n,
130
+ onClose: l,
131
+ isOpen: a,
132
+ setCurrencyDialogAction: r,
133
+ renderingToast: o
134
+ }) => {
135
+ const { budgets: i, common: _ } = E(), { sortedTransactions: s } = M(), d = c.useMemo(() => s.reduce((h, D) => D.parent_guid ? h : h + D.amount, 0), [s]), { remainingAmount: u, spentPercentage: g, iconColor: p } = qe(
136
+ d,
137
+ t.amount ?? 0
138
+ );
139
+ return /* @__PURE__ */ m(
140
+ _e,
141
+ {
142
+ ariaLabelClose: _.close_aria,
143
+ footerStyles: {
144
+ px: 24,
145
+ py: 16
146
+ },
147
+ isOpen: a,
148
+ onClose: l,
149
+ onPrimaryAction: () => r(Ee.EDIT),
150
+ onSecondaryAction: () => {
151
+ r(Ee.DELETE);
152
+ },
153
+ primaryText: i.details_edit_button,
154
+ secondaryColor: "error",
155
+ secondaryText: i.details_delete_button,
156
+ sx: {
157
+ "& .list-wrapper": {
158
+ pr: 24
159
+ }
160
+ },
161
+ title: I(i.details_type_title, t.merchant_name),
162
+ children: [
163
+ /* @__PURE__ */ e(
164
+ At,
165
+ {
166
+ amount: t.amount,
167
+ icon: /* @__PURE__ */ e(
168
+ Ce,
169
+ {
170
+ categoryGuid: n.top_level_category_guid || "",
171
+ merchantGuid: n.merchant_guid || ""
172
+ }
173
+ ),
174
+ iconColor: p,
175
+ remainingAmount: u,
176
+ spentPercentage: g,
177
+ startDate: n.date,
178
+ totalTransaction: d
179
+ }
180
+ ),
181
+ /* @__PURE__ */ e(Je, {}),
182
+ o?.()
183
+ ]
184
+ }
185
+ );
186
+ }, Nt = w(xt);
187
+ var Ee = /* @__PURE__ */ ((t) => (t.CREATE = "create", t.EDIT = "edit", t.DELETE = "delete", t))(Ee || {});
188
+ const It = w(({ transaction: t }) => {
189
+ const [n, l] = c.useState(null), [a, r] = c.useState(""), [o, i] = c.useState(!1), _ = c.useRef(!1), [s, d] = c.useState(null), u = H(), {
190
+ addMerchantBudget: g,
191
+ updateMerchantBudget: p,
192
+ deleteMerchantBudget: h,
193
+ getMerchantBudgetByMerchantGuid: D,
194
+ alert: O,
195
+ setAlert: K
196
+ } = rt(), { setFilter: P } = M(), { accounts: y } = ot(), N = u.palette.mode === "dark" ? "grey.800" : "grey.100", { budgets: C, common: J } = E(), { announce: se, ariaLive: le } = Ae(), [te, B] = c.useState(!1), b = t?.merchant_guid ? D(t.merchant_guid) : void 0, F = () => {
197
+ d(n), l(null), r("");
198
+ }, re = () => {
199
+ b ? B(!0) : l(
200
+ "create"
201
+ /* CREATE */
202
+ );
203
+ }, z = {
204
+ create: {
205
+ content: I(
206
+ C.create_budget_content,
207
+ /* @__PURE__ */ e("strong", { children: t.description }),
208
+ `${V(t.amount, "0,0.00")}`
209
+ ),
210
+ title: C.dialog_create_budget_title,
211
+ primaryButtonText: C.dialog_primary_button_text,
212
+ errorAlertMessage: I(
213
+ C.alert_merchant_budget_not_created,
214
+ t.description
215
+ ),
216
+ errorRetryAction: () => l(
217
+ "create"
218
+ /* CREATE */
219
+ ),
220
+ successAlertMessage: I(
221
+ C.alert_budget_created,
222
+ t.description
223
+ ),
224
+ apiTrigger: async () => await g(t.merchant_guid, Number(a))
225
+ },
226
+ edit: {
227
+ content: I(
228
+ C.edit_budget_content,
229
+ /* @__PURE__ */ e("strong", { children: t.description })
230
+ ),
231
+ title: C.details_edit_title,
232
+ primaryButtonText: C.add_save_button,
233
+ errorAlertMessage: I(
234
+ C.error_alert_edit_merchant_budget,
235
+ t.description
236
+ ),
237
+ errorRetryAction: () => l(
238
+ "edit"
239
+ /* EDIT */
240
+ ),
241
+ successAlertMessage: I(
242
+ C.success_alert_edit_merchant_budget,
243
+ t.description
244
+ ),
245
+ apiTrigger: async () => await p({
246
+ ...b,
247
+ amount: Number(a)
248
+ })
249
+ },
250
+ delete: {
251
+ content: I(
252
+ C.delete_description,
253
+ /* @__PURE__ */ e("strong", { children: t.description })
254
+ ),
255
+ title: C.delete_title,
256
+ primaryButtonText: C.details_delete_button,
257
+ errorAlertMessage: I(
258
+ C.error_alert_delete_merchant_budget,
259
+ t.description
260
+ ),
261
+ errorRetryAction: () => l(
262
+ "delete"
263
+ /* DELETE */
264
+ ),
265
+ successAlertMessage: I(
266
+ C.success_alert_delete_merchant_budget,
267
+ t.description
268
+ ),
269
+ apiTrigger: async () => await h(b.guid)
270
+ }
271
+ }, A = async () => {
272
+ if (_.current) return;
273
+ _.current = !0;
274
+ const { apiTrigger: S, successAlertMessage: R, errorAlertMessage: T } = z[n], { isSuccess: v } = await S(), oe = v ? R : T;
275
+ F(), i(!v), K(oe), se(oe), v && n === "delete" && B(!1), _.current = !1;
276
+ };
277
+ c.useEffect(() => {
278
+ const S = {
279
+ start: De(new Date(t.date * 1e3)),
280
+ end: Be(new Date(t.date * 1e3))
281
+ };
282
+ te && P({
283
+ accounts: y.map((R) => R.guid),
284
+ custom: te ? (R) => R.merchant_guid === t.merchant_guid : (R) => R.guid === t.guid,
285
+ dateRange: S
286
+ });
287
+ }, [te, t, y]);
288
+ const $ = () => /* @__PURE__ */ e(
289
+ Ye,
290
+ {
291
+ actionText: C.autogenerate_budgets_error_primary_button,
292
+ autoHideDuration: 3500,
293
+ closeAriaLabel: J.close_aria,
294
+ handleClose: () => K(""),
295
+ message: O,
296
+ onActionClick: z[s]?.errorRetryAction,
297
+ open: !!O,
298
+ severity: o ? "error" : "success",
299
+ showAction: o,
300
+ showClose: !0
301
+ }
302
+ );
303
+ return /* @__PURE__ */ m(c.Fragment, { children: [
304
+ le,
305
+ /* @__PURE__ */ e(U, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ m(X, { onClick: re, children: [
306
+ /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(q, { sx: { bgcolor: N }, variant: "rounded", children: /* @__PURE__ */ e(k, { name: "bubble_chart", sx: { color: "text.primary" } }) }) }),
307
+ /* @__PURE__ */ e(
308
+ W,
309
+ {
310
+ primary: C.add_merchant_budget_primary_text,
311
+ secondary: /* @__PURE__ */ e(x, { bold: !0, sx: { color: "text.primary" }, variant: "body1", children: b ? `${V(b.amount, "0,0.00")} / ${J.month_text}` : C.add_merchant_budget_secondary_text }),
312
+ slotProps: { primary: { variant: "caption", fontSize: 11, fontWeight: "normal" } }
313
+ }
314
+ ),
315
+ /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(k, { name: "chevron_right", sx: { color: "text.primary" } }) })
316
+ ] }) }),
317
+ !!b && /* @__PURE__ */ e(
318
+ Nt,
319
+ {
320
+ isOpen: te,
321
+ merchantBudget: b,
322
+ onClose: () => B(!1),
323
+ renderingToast: () => O && $(),
324
+ setCurrencyDialogAction: (S) => {
325
+ S === "edit" && r(b?.amount.toString() || ""), l(S);
326
+ },
327
+ transaction: t
328
+ }
329
+ ),
330
+ n && /* @__PURE__ */ e(
331
+ gt,
332
+ {
333
+ closeAriaLabel: J.close_aria,
334
+ content: z[n].content,
335
+ handleInputChange: r,
336
+ handleModalClose: F,
337
+ handlePrimaryAction: A,
338
+ handleSecondaryAction: F,
339
+ inputLabel: n !== "delete" ? J.amount_text : "",
340
+ inputValue: a,
341
+ isOpen: !!n,
342
+ primaryText: z[n].primaryButtonText,
343
+ secondaryText: J.cancel_button,
344
+ title: z[n].title
345
+ }
346
+ ),
347
+ !!O && $()
348
+ ] });
349
+ }), Dt = ({ transaction: t }) => {
350
+ const { addOrUpdateTransactionRule: n, updateTransaction: l } = M(), { categories: a } = we(), { onEvent: r } = G(), { setShouldDisableDrawerScroll: o, updateManualTransaction: i } = ne(), { transactions: _ } = E(), s = H(), [d, u] = c.useState(!1), [g, p] = c.useState(""), h = async (y) => {
351
+ await l({ ...t, category_guid: g }), y && await n(g, t), p(""), r(j.TRANSACTION_DETAILS_CLICK_CATEGORY, {
352
+ transaction_guid: t.guid
353
+ });
354
+ }, D = (y) => {
355
+ if (t.is_manual && !t.guid) {
356
+ const N = a.find((C) => C.guid === y);
357
+ i({
358
+ ...t,
359
+ category: N?.name,
360
+ category_guid: y,
361
+ top_level_category_guid: N?.parent_guid || y
362
+ });
363
+ } else
364
+ p(y);
365
+ O();
366
+ }, O = () => {
367
+ u(!1), o(!1);
368
+ }, K = c.useMemo(
369
+ () => a.find((y) => y.guid === g),
370
+ [g]
371
+ ), P = s.palette.mode === "dark" ? "grey.800" : "grey.100";
372
+ return /* @__PURE__ */ m(U, { disableGutters: !0, disablePadding: !0, children: [
373
+ /* @__PURE__ */ m(
374
+ X,
375
+ {
376
+ onClick: () => {
377
+ r(f.ON_TRANSACTION_CATEGORY_CLICK), u(!0);
378
+ },
379
+ children: [
380
+ /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(q, { sx: { bgcolor: P }, variant: "rounded", children: /* @__PURE__ */ e(
381
+ Oe,
382
+ {
383
+ categoryGuid: t.top_level_category_guid,
384
+ size: 24,
385
+ sx: { color: "text.primary" },
386
+ variant: Ge.Transparent
387
+ }
388
+ ) }) }),
389
+ /* @__PURE__ */ e(
390
+ W,
391
+ {
392
+ primary: _.category_title,
393
+ secondary: /* @__PURE__ */ e(x, { bold: !0, sx: { color: "text.primary" }, variant: "body1", children: t.category ?? _.actions_select_a_category }),
394
+ slotProps: { primary: { variant: "caption", fontSize: 11, fontWeight: "normal" } }
395
+ }
396
+ ),
397
+ /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(k, { name: "chevron_right", sx: { color: "text.primary" } }) })
398
+ ]
399
+ }
400
+ ),
401
+ /* @__PURE__ */ e(
402
+ Fe,
403
+ {
404
+ initialSelected: t.category_guid,
405
+ onClose: O,
406
+ onSelect: D,
407
+ showDrawer: d,
408
+ title: _.actions_select_a_category
409
+ }
410
+ ),
411
+ /* @__PURE__ */ e(
412
+ ae,
413
+ {
414
+ copy: {
415
+ title: I(
416
+ _.actions_apply_to_all_transaction_types,
417
+ t.description
418
+ )
419
+ },
420
+ isOpen: !!g,
421
+ onClose: () => p(""),
422
+ onPrimaryAction: () => h(!0),
423
+ onSecondaryAction: () => h(!1),
424
+ primaryText: _.actions_apply_to_all,
425
+ secondaryText: _.actions_this_time_only,
426
+ children: /* @__PURE__ */ e(ee, { variant: "subtitle1", children: I(
427
+ _.actions_all_past_and_future,
428
+ t.description,
429
+ K?.name
430
+ ) })
431
+ }
432
+ )
433
+ ] });
434
+ }, vt = ({ transaction: t }) => {
435
+ const { onEvent: n } = G(), { updateTransaction: l } = M(), { updateManualTransaction: a } = ne(), { common: r, transactions: o } = E(), i = H(), [_, s] = c.useState(!1), [d, u] = c.useState(t.date), g = (D) => {
436
+ u(Ie(D));
437
+ }, p = async () => {
438
+ if (t.is_manual && !t.guid) {
439
+ a({ ...t, date: d }), s(!1);
440
+ return;
441
+ }
442
+ await l({ ...t, date: d }), n(j.TRANSACTION_DETAILS_CLICK_DATE, { transaction_guid: t.guid }), s(!1);
443
+ }, h = i.palette.mode === "dark" ? "grey.800" : "grey.100";
444
+ return /* @__PURE__ */ m(U, { className: "mx-txn-date-action", disableGutters: !0, disablePadding: !0, children: [
445
+ /* @__PURE__ */ m(
446
+ X,
447
+ {
448
+ onClick: () => {
449
+ n(f.ON_TRANSACTION_DATE_CLICK), s(!0);
450
+ },
451
+ children: [
452
+ /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(q, { sx: { bgcolor: h }, variant: "rounded", children: /* @__PURE__ */ e(k, { name: "calendar_month", sx: { color: "text.primary" } }) }) }),
453
+ /* @__PURE__ */ e(
454
+ W,
455
+ {
456
+ primary: o.date_title,
457
+ secondary: /* @__PURE__ */ e(x, { bold: !0, sx: { color: "text.primary" }, variant: "body1", children: Me(ve(t.date), Re.YEAR_MONTH_DAY) }),
458
+ slotProps: { primary: { variant: "caption", fontSize: 11, fontWeight: "normal" } }
459
+ }
460
+ ),
461
+ /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(k, { name: "chevron_right", sx: { color: "text.primary" } }) })
462
+ ]
463
+ }
464
+ ),
465
+ /* @__PURE__ */ e(
466
+ _e,
467
+ {
468
+ ariaLabelClose: r.close_aria,
469
+ isOpen: _,
470
+ onClose: () => s(!1),
471
+ onPrimaryAction: p,
472
+ primaryText: r.save_button,
473
+ secondaryText: r.cancel_button,
474
+ title: o.date_edit_title,
475
+ children: /* @__PURE__ */ e(L, { alignItems: "center", mt: 40, children: /* @__PURE__ */ e(
476
+ pt,
477
+ {
478
+ beginDate: ve(d),
479
+ copy: {
480
+ nextAria: o.date_next_aria,
481
+ prevAria: o.date_prev_aria,
482
+ today: r.date_range_picker.today
483
+ },
484
+ onDateSelected: g,
485
+ selectionType: ht.Single
486
+ }
487
+ ) })
488
+ }
489
+ )
490
+ ] });
491
+ }, Et = ({ transaction: t }) => {
492
+ const { onEvent: n } = G(), { removeTransaction: l } = M(), { setShouldDisableDrawerScroll: a } = ne(), { common: r, transactions: o } = E(), [i, _] = c.useState(!1), s = async () => {
493
+ await l(t.guid), n(f.ON_TRANSACTION_DELETE_DELETED);
494
+ };
495
+ return /* @__PURE__ */ m(Y, { className: "mx-txn-delete", children: [
496
+ t && /* @__PURE__ */ e(U, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ m(
497
+ X,
498
+ {
499
+ onClick: () => {
500
+ n(f.ON_TRANSACTION_DELETE_CLICK), a(!0), _(!0);
501
+ },
502
+ children: [
503
+ /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(q, { variant: "rounded", children: /* @__PURE__ */ e(fe, { color: "secondary", fontSize: "small" }) }) }),
504
+ /* @__PURE__ */ e(
505
+ W,
506
+ {
507
+ primary: o.manual_transaction_delete_title,
508
+ secondary: o.manual_transaction_delete_subtitle
509
+ }
510
+ ),
511
+ /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(fe, {}) })
512
+ ]
513
+ }
514
+ ) }),
515
+ /* @__PURE__ */ e(
516
+ ae,
517
+ {
518
+ copy: { title: o.manual_transaction_delete_title },
519
+ isOpen: i,
520
+ onClose: () => {
521
+ a(!1), _(!1);
522
+ },
523
+ onPrimaryAction: s,
524
+ onSecondaryAction: () => n(f.ON_TRANSACTION_DELETE_CANCEL),
525
+ primaryText: r.delete_button,
526
+ secondaryText: r.cancel_button,
527
+ children: /* @__PURE__ */ e(x, { variant: "subtitle1", children: o.manual_transaction_delete_description })
528
+ }
529
+ )
530
+ ] });
531
+ }, Ot = w(Et), Lt = ({ transaction: t }) => {
532
+ const { onEvent: n } = G(), { updateTransaction: l } = M(), { setShouldDisableDrawerScroll: a } = ne(), { common: r, transactions: o } = E(), i = H(), [_, s] = c.useState(!1), d = async () => {
533
+ await l({ ...t, merchant_guid: "" }), n(j.TRANSACTION_DETAILS_CLICK_DELETE_LOGO, {
534
+ transaction_guid: t.guid
535
+ });
536
+ }, u = i.palette.mode === "dark" ? "grey.800" : "grey.100";
537
+ return /* @__PURE__ */ e(c.Fragment, { children: t && /* @__PURE__ */ m(U, { className: "mx-txn-delete-logo", disableGutters: !0, disablePadding: !0, children: [
538
+ /* @__PURE__ */ m(
539
+ X,
540
+ {
541
+ onClick: () => {
542
+ n(f.ON_TRANSACTION_DELETE_LOGO_CLICK), s(!0);
543
+ },
544
+ children: [
545
+ /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(q, { sx: { bgcolor: u }, variant: "rounded", children: /* @__PURE__ */ e(k, { name: "delete", sx: { color: "text.primary" } }) }) }),
546
+ /* @__PURE__ */ e(W, { primary: o.merchant_logo_title, secondary: o.merchant_logo_desc }),
547
+ /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(k, { name: "chevron_right", sx: { color: "text.primary" } }) })
548
+ ]
549
+ }
550
+ ),
551
+ /* @__PURE__ */ m(
552
+ ae,
553
+ {
554
+ copy: { title: o.merchant_logo_modal_title },
555
+ isOpen: _,
556
+ onClose: () => {
557
+ a(!1), s(!1);
558
+ },
559
+ onPrimaryAction: d,
560
+ onSecondaryAction: () => n(f.ON_TRANSACTION_DELETE_LOGO_CANCEL),
561
+ primaryText: r.delete_button,
562
+ secondaryText: r.cancel_button,
563
+ title: o.merchant_logo_modal_title,
564
+ children: [
565
+ /* @__PURE__ */ e(x, { variant: "subtitle1", children: o.merchant_logo_modal_desc }),
566
+ /* @__PURE__ */ e(x, { bold: !0, variant: "subtitle1", children: ` ${o.merchant_logo_modal_desc_bold}` })
567
+ ]
568
+ }
569
+ )
570
+ ] }) });
571
+ }, wt = w(Lt), Mt = ({ transaction: t }) => {
572
+ const { onEvent: n } = G(), { setAlert: l, updateTransaction: a } = M(), { setShouldDisableDrawerScroll: r } = ne(), { common: o, transactions: i } = E(), _ = H(), [s, d] = c.useState(!1), u = t.is_hidden, g = async () => {
573
+ try {
574
+ await a({ ...t, is_hidden: !t.is_hidden }), n(
575
+ u ? f.ON_TRANSACTION_UNHIDDEN : f.ON_TRANSACTION_HIDDEN
576
+ ), l(u ? i.transaction_included : i.transaction_excluded);
577
+ } catch {
578
+ l(u ? i.transaction_not_included : i.transaction_not_excluded);
579
+ }
580
+ }, p = _.palette.mode === "dark" ? "grey.800" : "grey.100";
581
+ return /* @__PURE__ */ e(c.Fragment, { children: t && /* @__PURE__ */ m(U, { className: "mx-txn-hide-transaction", disableGutters: !0, disablePadding: !0, children: [
582
+ /* @__PURE__ */ m(
583
+ X,
584
+ {
585
+ "aria-checked": u,
586
+ "aria-labelledby": "hide-transaction-text",
587
+ onClick: () => {
588
+ n(
589
+ u ? f.ON_TRANSACTION_UNHIDE_CLICK : f.ON_TRANSACTION_HIDE_CLICK
590
+ ), n(
591
+ u ? "transaction_details_click_unhide_transaction" : "transaction_details_click_hide_transaction",
592
+ {
593
+ transaction_guid: t.guid
594
+ }
595
+ ), d(!0);
596
+ },
597
+ role: "switch",
598
+ children: [
599
+ /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(q, { sx: { bgcolor: p }, variant: "rounded", children: u ? /* @__PURE__ */ e(k, { name: "visibility_off", sx: { color: "text.primary" } }) : /* @__PURE__ */ e(k, { name: "visibility", sx: { color: "text.primary" } }) }) }),
600
+ /* @__PURE__ */ e(
601
+ W,
602
+ {
603
+ id: "hide-transaction-text",
604
+ primary: i.exclude_transaction,
605
+ secondary: i.excluding_transaction
606
+ }
607
+ ),
608
+ /* @__PURE__ */ e(Z, { "aria-hidden": "true", children: /* @__PURE__ */ e(
609
+ Ct,
610
+ {
611
+ checked: u,
612
+ slotProps: { input: { tabIndex: -1 } },
613
+ sx: { pointerEvents: "none" },
614
+ tabIndex: -1
615
+ }
616
+ ) })
617
+ ]
618
+ }
619
+ ),
620
+ /* @__PURE__ */ e(
621
+ ae,
622
+ {
623
+ copy: {
624
+ title: u ? i.include_transaction : i.exclude_transaction
625
+ },
626
+ isOpen: s,
627
+ onClose: () => {
628
+ r(!1), d(!1);
629
+ },
630
+ onPrimaryAction: g,
631
+ onSecondaryAction: () => n(
632
+ u ? f.ON_TRANSACTION_UNHIDE_CANCEL_CLICK : f.ON_TRANSACTION_HIDE_CANCEL_CLICK
633
+ ),
634
+ primaryText: u ? i.include : i.exclude,
635
+ secondaryText: o.cancel_button,
636
+ children: /* @__PURE__ */ e(x, { truncate: !1, variant: "subtitle1", children: u ? i.including_transaction : i.excluding_transaction })
637
+ }
638
+ )
639
+ ] }) });
640
+ }, Rt = w(Mt), He = ({ transaction: t }) => {
641
+ const { amount: n, description: l, isIncome: a, merchant_guid: r, payee: o, top_level_category_guid: i } = t;
642
+ return /* @__PURE__ */ m(L, { className: "mx-txn-amount-header", direction: "row", gap: 12, px: 16, py: 24, children: [
643
+ /* @__PURE__ */ e(
644
+ Ce,
645
+ {
646
+ categoryGuid: i || "",
647
+ merchantGuid: r || "",
648
+ size: 64
649
+ }
650
+ ),
651
+ /* @__PURE__ */ m(L, { overflow: "hidden'", children: [
652
+ /* @__PURE__ */ e(x, { bold: !0, mb: 4, truncate: !0, variant: "body1", children: l || o }),
653
+ /* @__PURE__ */ m(ee, { color: a ? "success.main" : "text.primary", truncate: !0, variant: "h1", children: [
654
+ a ? "+" : "",
655
+ V(n, "0,0.00")
656
+ ] })
657
+ ] })
658
+ ] });
659
+ }, kt = ({ transaction: t }) => {
660
+ const { onEvent: n } = G(), { updateTransaction: l } = M(), { updateManualTransaction: a } = ne(), { common: r, transactions: o } = E(), i = H(), [_, s] = c.useState(!1), [d, u] = c.useState("");
661
+ c.useEffect(() => {
662
+ _ && u(t.memo ? t.memo : "");
663
+ }, [_]);
664
+ const g = async () => {
665
+ if (t.is_manual && !t.guid) {
666
+ a({ ...t, memo: d }), s(!1);
667
+ return;
668
+ }
669
+ await l({ ...t, memo: d }), n(j.TRANSACTION_DETAILS_CLICK_MEMO, { transaction_guid: t.guid }), s(!1);
670
+ }, p = i.palette.mode === "dark" ? "grey.800" : "grey.100";
671
+ return /* @__PURE__ */ m(U, { className: "mx-txn-memo-action", disableGutters: !0, disablePadding: !0, children: [
672
+ /* @__PURE__ */ m(
673
+ X,
674
+ {
675
+ onClick: () => {
676
+ n(f.ON_TRANSACTION_MEMO_CLICK), s(!0);
677
+ },
678
+ children: [
679
+ /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(q, { sx: { bgcolor: p }, variant: "rounded", children: /* @__PURE__ */ e(k, { name: "article", sx: { color: "text.primary" } }) }) }),
680
+ /* @__PURE__ */ e(
681
+ W,
682
+ {
683
+ primary: o.memo_title,
684
+ secondary: /* @__PURE__ */ e(x, { bold: !0, sx: { color: "text.primary" }, variant: "body1", children: t.memo ? t.memo : o.memo_desc }),
685
+ slotProps: { primary: { variant: "caption", fontSize: 11, fontWeight: "normal" } }
686
+ }
687
+ ),
688
+ /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(k, { name: "chevron_right", sx: { color: "text.primary" } }) })
689
+ ]
690
+ }
691
+ ),
692
+ /* @__PURE__ */ m(
693
+ _e,
694
+ {
695
+ ariaLabelClose: r.close_aria,
696
+ isOpen: _,
697
+ onClose: () => s(!1),
698
+ onPrimaryAction: g,
699
+ title: o.memo_title,
700
+ children: [
701
+ /* @__PURE__ */ e(He, { transaction: t }),
702
+ /* @__PURE__ */ e(
703
+ $e,
704
+ {
705
+ "aria-label": o.memo_desc_aria,
706
+ focused: !0,
707
+ multiline: !0,
708
+ name: "memo",
709
+ onChange: (h) => u(h.target.value),
710
+ placeholder: o.memo_desc,
711
+ rows: 4,
712
+ sx: { mx: 16, width: "calc(100% - 32px)" },
713
+ value: d
714
+ }
715
+ )
716
+ ]
717
+ }
718
+ )
719
+ ] });
720
+ }, Pt = w(kt), Gt = ({
721
+ index: t,
722
+ onDeleteRow: n,
723
+ onCategoryChanged: l,
724
+ onUpdateAmount: a,
725
+ split: r
726
+ }) => {
727
+ const { onEvent: o } = G(), { transactions: i } = E(), [_, s] = c.useState(`${r.amount}`), [d, u] = c.useState(!1), g = t === 0, p = (h) => {
728
+ isNaN(Number(h)) || (s(h), a(t, Number(h)));
729
+ };
730
+ return /* @__PURE__ */ m(Y, { bgcolor: "background.paper", className: "mx-txn-split-manager-row", pb: 4, px: 8, children: [
731
+ /* @__PURE__ */ m(Ne, { alignItems: g ? "center" : "start", container: !0, children: [
732
+ /* @__PURE__ */ e(Ne, { size: 7, children: /* @__PURE__ */ m(L, { alignItems: "start", children: [
733
+ /* @__PURE__ */ e(
734
+ me,
735
+ {
736
+ endIcon: /* @__PURE__ */ e(Ke, {}),
737
+ onClick: () => u(!0),
738
+ startIcon: /* @__PURE__ */ e(Oe, { categoryGuid: r.top_level_category_guid }),
739
+ sx: { px: 12, py: 8 },
740
+ children: r.category
741
+ }
742
+ ),
743
+ /* @__PURE__ */ e(Y, { children: !r.category_guid && /* @__PURE__ */ m(L, { color: "error.main", direction: "row", gap: 8, p: 12, children: [
744
+ /* @__PURE__ */ e("span", { "aria-label": "error", role: "img", children: /* @__PURE__ */ e(Se, { sx: { fontSize: 15 } }) }),
745
+ /* @__PURE__ */ e(x, { variant: "body2", children: i.split_transaction_errors_select_category })
746
+ ] }) })
747
+ ] }) }),
748
+ /* @__PURE__ */ e(Ne, { size: 5, children: g ? /* @__PURE__ */ e("div", { className: "mx-txn-split-manager-row-top-container", children: /* @__PURE__ */ e(x, { children: V(r.amount, "0,0.00") }) }) : /* @__PURE__ */ m(L, { alignItems: "start", children: [
749
+ /* @__PURE__ */ m(L, { alignItems: "start", direction: "row", gap: 8, children: [
750
+ /* @__PURE__ */ e(
751
+ bt,
752
+ {
753
+ amount: _,
754
+ ariaLabel: i.split_transaction_edit_split_amount,
755
+ label: i.split_transaction_edit_split_amount,
756
+ minAmount: 0.01,
757
+ name: "split-amount-input",
758
+ setAmount: p,
759
+ sx: {
760
+ ".MuiOutlinedInput-input": { p: 12 }
761
+ },
762
+ type: "number"
763
+ }
764
+ ),
765
+ /* @__PURE__ */ e(
766
+ ue,
767
+ {
768
+ "aria-label": i.split_transaction_delete_split_btn,
769
+ color: "secondary",
770
+ onClick: () => {
771
+ o(f.ON_TRANSACTION_SPLIT_DELETE_CLICK), n(t);
772
+ },
773
+ sx: { w: 44, h: 44 },
774
+ children: /* @__PURE__ */ e(fe, {})
775
+ }
776
+ )
777
+ ] }),
778
+ !_ && /* @__PURE__ */ m(L, { color: "error.main", direction: "row", gap: 8, py: 12, children: [
779
+ /* @__PURE__ */ e("span", { "aria-label": "error", role: "img", children: /* @__PURE__ */ e(Se, { sx: { fontSize: 15 } }) }),
780
+ /* @__PURE__ */ e(x, { variant: "body2", children: i.split_transaction_errors_enter_an_amount })
781
+ ] })
782
+ ] }) })
783
+ ] }),
784
+ /* @__PURE__ */ e(
785
+ Fe,
786
+ {
787
+ initialSelected: r.category_guid,
788
+ onClose: () => u(!1),
789
+ onSelect: (h) => {
790
+ l(t, h), u(!1);
791
+ },
792
+ showDrawer: d,
793
+ title: i.actions_select_a_category
794
+ }
795
+ )
796
+ ] });
797
+ }, Bt = w(Gt), $t = ({
798
+ onAddSplit: t,
799
+ onCategoryChanged: n,
800
+ onDeleteSplit: l,
801
+ onUpdateAmount: a,
802
+ splits: r,
803
+ transaction: o
804
+ }) => {
805
+ const { transactions: i } = E(), { onEvent: _ } = G(), [s, d] = c.useState(""), { announce: u, ariaLive: g } = Ae();
806
+ return c.useEffect(() => {
807
+ if (r.length <= 1)
808
+ d(i.split_transaction_errors_min_splits), u(i.split_transaction_errors_min_splits);
809
+ else if (r[0].amount < 0) {
810
+ const p = I(
811
+ i.split_transaction_errors_totals_must_equal_amount,
812
+ V(o.amount, "0,0.00")
813
+ );
814
+ d(p), u(p);
815
+ } else
816
+ d(""), u("");
817
+ }, [r]), /* @__PURE__ */ m(Y, { className: "mx-txn-split-manager", children: [
818
+ g,
819
+ r.map((p, h) => /* @__PURE__ */ e(
820
+ Bt,
821
+ {
822
+ index: h,
823
+ onCategoryChanged: n,
824
+ onDeleteRow: l,
825
+ onUpdateAmount: a,
826
+ split: p
827
+ },
828
+ h
829
+ )),
830
+ s && /* @__PURE__ */ m(L, { bgcolor: "background.paper", color: "error.main", direction: "row", gap: 8, p: 16, children: [
831
+ /* @__PURE__ */ e("span", { "aria-label": "error", role: "img", children: /* @__PURE__ */ e(Se, { sx: { fontSize: 15 } }) }),
832
+ /* @__PURE__ */ e(x, { variant: "body2", children: s })
833
+ ] }),
834
+ /* @__PURE__ */ e(Y, { p: 16, children: /* @__PURE__ */ e(
835
+ me,
836
+ {
837
+ "aria-label": i.split_transaction_add_split_btn,
838
+ onClick: () => {
839
+ _(f.ON_TRANSACTION_SPLIT_ADD_CLICK), t();
840
+ },
841
+ children: i.split_transaction_add_split_btn
842
+ }
843
+ ) })
844
+ ] });
845
+ }, Kt = w($t), Ft = ({ transaction: t }) => {
846
+ const { onEvent: n } = G(), { announce: l, ariaLive: a } = Ae(), { splitTransaction: r, unSplitTransaction: o, transactionSplitting: i } = M(), { common: _, transactions: s } = E(), { setShouldDisableDrawerScroll: d } = ne(), { categories: u } = we(), g = H(), p = {
847
+ ...t,
848
+ amount: t.amount - 1,
849
+ guid: "",
850
+ has_been_split: !1,
851
+ parent_guid: t.guid
852
+ }, h = {
853
+ ...t,
854
+ amount: 1,
855
+ category_guid: void 0,
856
+ category: s.split_transaction_select_category_btn,
857
+ guid: "",
858
+ has_been_split: !1,
859
+ parent_guid: t.guid,
860
+ top_level_category_guid: void 0
861
+ }, [D, O] = c.useState(!1), [K, P] = c.useState(!1), [y, N] = c.useState([]), C = () => {
862
+ const A = [...y];
863
+ A.push({ ...h }), A[0].amount -= 1, N(A), l(
864
+ I(
865
+ s.split_transaction_add_split_announcement,
866
+ A.length
867
+ )
868
+ );
869
+ }, J = (A) => {
870
+ if (A > 0) {
871
+ const $ = y[A], S = [...y];
872
+ S.splice(A, 1), S[0].amount += $.amount, N(S), l(
873
+ I(s.split_transaction_delete_split_announcement, A + 1)
874
+ );
875
+ }
876
+ }, se = (A, $) => {
877
+ const S = [...y];
878
+ S[A].amount = $, S[0].amount = t.amount - S.reduce(
879
+ (R, T, v) => R + (v !== 0 ? T.amount : 0),
880
+ 0
881
+ ), N(S);
882
+ }, le = (A, $) => {
883
+ const S = [...y], R = u.find((T) => T.guid === $);
884
+ R && (S[A] = {
885
+ ...S[A],
886
+ category_guid: $,
887
+ category: R.name,
888
+ top_level_category_guid: R.parent_guid || $
889
+ }, N(S), l(
890
+ I(
891
+ s.split_transaction_select_category_announcement,
892
+ R.name,
893
+ A + 1
894
+ )
895
+ ));
896
+ }, te = () => {
897
+ if (t.parent_guid || t.has_been_split) {
898
+ P(!0);
899
+ return;
900
+ }
901
+ N([{ ...p }, { ...h }]), n(j.TRANSACTION_DETAILS_CLICK_SPLIT, {
902
+ transaction_guid: t.guid
903
+ }), O(!0);
904
+ }, B = async () => {
905
+ n(f.ON_TRANSACTION_SPLIT_SAVE_CLICK), await r({ ...t, has_been_split: !0 }, y), O(!1);
906
+ }, b = async () => {
907
+ i || (n(f.ON_TRANSACTION_SPLIT_CANCEL_CLICK), N([{ ...p }, { ...h }]), O(!1));
908
+ }, F = async () => {
909
+ n(j.TRANSACTION_DETAILS_CLICK_UNSPLIT, {
910
+ transaction_guid: t.guid
911
+ });
912
+ const A = t.parent_guid ?? t.guid;
913
+ await o(A);
914
+ }, re = c.useMemo(() => {
915
+ const A = y.some((S) => !S.category_guid), $ = y.some((S) => S.amount <= 0);
916
+ return A || $;
917
+ }, [y]), z = g.palette.mode === "dark" ? "grey.800" : "grey.100";
918
+ return /* @__PURE__ */ e(c.Fragment, { children: t && /* @__PURE__ */ m(U, { disableGutters: !0, disablePadding: !0, children: [
919
+ /* @__PURE__ */ m(X, { onClick: te, children: [
920
+ /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(q, { sx: { bgcolor: z }, variant: "rounded", children: /* @__PURE__ */ e(k, { name: "call_split", sx: { color: "text.primary" } }) }) }),
921
+ /* @__PURE__ */ e(
922
+ W,
923
+ {
924
+ primary: t.has_been_split || t.parent_guid ? s.split_transaction_unsplit_title : s.split_transaction_title,
925
+ secondary: t.has_been_split || t.parent_guid ? s.split_transaction_unsplit_subtitle : s.split_transaction_desc
926
+ }
927
+ ),
928
+ /* @__PURE__ */ e(Z, { children: t.has_been_split || t.parent_guid ? /* @__PURE__ */ e(k, { name: "delete" }) : /* @__PURE__ */ e(k, { name: "chevron_right", sx: { color: "text.primary" } }) })
929
+ ] }),
930
+ /* @__PURE__ */ m(
931
+ _e,
932
+ {
933
+ ariaLabelClose: _.close_aria,
934
+ isOpen: D,
935
+ isPrimaryDisabled: re || i,
936
+ onClose: b,
937
+ onPrimaryAction: B,
938
+ primaryText: _.save_button,
939
+ secondaryText: _.cancel_button,
940
+ title: s.split_transaction_title,
941
+ children: [
942
+ a,
943
+ /* @__PURE__ */ e(He, { transaction: t }),
944
+ /* @__PURE__ */ e(
945
+ Kt,
946
+ {
947
+ onAddSplit: C,
948
+ onCategoryChanged: le,
949
+ onDeleteSplit: J,
950
+ onUpdateAmount: se,
951
+ splits: y,
952
+ transaction: t
953
+ }
954
+ )
955
+ ]
956
+ }
957
+ ),
958
+ /* @__PURE__ */ e(
959
+ ae,
960
+ {
961
+ copy: { title: s.split_transaction_unsplit_title },
962
+ isOpen: K,
963
+ onClose: () => {
964
+ d(!1), P(!1);
965
+ },
966
+ onPrimaryAction: F,
967
+ onSecondaryAction: () => {
968
+ n(f.ON_TRANSACTION_UNSPLIT_CANCEL);
969
+ },
970
+ primaryText: _.delete_button,
971
+ secondaryText: _.cancel_button,
972
+ children: /* @__PURE__ */ e(ee, { variant: "subtitle1", children: I(
973
+ s.split_transaction_unsplit_description,
974
+ t.description
975
+ ) })
976
+ }
977
+ )
978
+ ] }) });
979
+ }, Ht = w(Ft), zt = () => {
980
+ const t = H(), { onEvent: n } = G(), { addTag: l } = M(), { transactions: a } = E(), [r, o] = c.useState(!1), [i, _] = c.useState(""), [s, d] = c.useState(""), u = c.useRef(null);
981
+ c.useEffect(() => {
982
+ r && u?.current?.focus();
983
+ }, [r]);
984
+ const g = () => {
985
+ n(
986
+ r ? f.ON_TRANSACTION_TAGS_TAG_ADD_CANCEL_CLICK : f.ON_TRANSACTION_TAGS_TAG_ADD_CLICK
987
+ ), r || _(""), o(!r);
988
+ }, p = async () => {
989
+ n(f.ON_TRANSACTION_TAGS_TAG_ADDED), await l(i), o(!1);
990
+ };
991
+ return c.useEffect(() => {
992
+ d(i.length > 40 ? a.tags_error_name_must_be_40_chars : "");
993
+ }, [i]), /* @__PURE__ */ m(Y, { className: "mx-txn-tag-manager-header", children: [
994
+ /* @__PURE__ */ m(
995
+ L,
996
+ {
997
+ alignItems: "center",
998
+ bgcolor: t.palette.background.default,
999
+ direction: "row",
1000
+ justifyContent: "space-between",
1001
+ px: 24,
1002
+ py: 16,
1003
+ children: [
1004
+ /* @__PURE__ */ e(x, { bold: !0, children: a.tags_your_tags }),
1005
+ /* @__PURE__ */ e(
1006
+ me,
1007
+ {
1008
+ "aria-expanded": r,
1009
+ "aria-label": a.tags_add_tag_btn_aria,
1010
+ onClick: g,
1011
+ children: a.tags_add_tag_btn
1012
+ }
1013
+ )
1014
+ ]
1015
+ }
1016
+ ),
1017
+ /* @__PURE__ */ m(
1018
+ ae,
1019
+ {
1020
+ copy: { title: a.tags_add_tag_btn },
1021
+ isOpen: r,
1022
+ onClose: () => o(!1),
1023
+ onPrimaryAction: p,
1024
+ onSecondaryAction: () => o(!1),
1025
+ children: [
1026
+ /* @__PURE__ */ e(
1027
+ Le,
1028
+ {
1029
+ "aria-label": a.tags_placeholder,
1030
+ name: "add-tag",
1031
+ onChange: (h) => _(h.target.value),
1032
+ placeholder: a.tags_placeholder,
1033
+ sx: { width: "100%" },
1034
+ value: i
1035
+ }
1036
+ ),
1037
+ /* @__PURE__ */ e(ee, { id: "add-tag-error", sx: { color: "error.main" }, variant: "subtitle2", children: s })
1038
+ ]
1039
+ }
1040
+ )
1041
+ ] });
1042
+ }, Ut = w(zt), Wt = ({ onSearchValueChanged: t, searchValue: n }) => {
1043
+ const { common: l, transactions: a } = E(), r = /* @__PURE__ */ e(
1044
+ ue,
1045
+ {
1046
+ "aria-label": a.tags_cancel_search || "Search",
1047
+ onClick: () => t(""),
1048
+ children: /* @__PURE__ */ e(Se, {})
1049
+ }
1050
+ );
1051
+ return /* @__PURE__ */ e(Y, { className: "mx-txn-tag-manager-search", px: 24, py: 16, children: /* @__PURE__ */ e(
1052
+ Le,
1053
+ {
1054
+ "aria-label": l.search_aria,
1055
+ name: "search",
1056
+ onChange: (o) => t(o.target.value),
1057
+ placeholder: l.search_placeholder,
1058
+ slotProps: {
1059
+ input: {
1060
+ startAdornment: /* @__PURE__ */ e(Pe, { position: "start", children: /* @__PURE__ */ e(ct, { color: "disabled" }) }),
1061
+ endAdornment: /* @__PURE__ */ e(Pe, { position: "end", sx: { padding: 0 }, children: n ? r : null })
1062
+ }
1063
+ },
1064
+ sx: { bgcolor: "background.paper", width: "100%" },
1065
+ value: n
1066
+ }
1067
+ ) });
1068
+ }, Vt = w(Wt), Yt = ({ onTagChecked: t, selectedTags: n, tag: l }) => {
1069
+ const { onEvent: a } = G(), { removeTag: r, updateTag: o } = M(), { common: i, transactions: _ } = E(), [s, d] = c.useState(!1), [u, g] = c.useState(!1), [p, h] = c.useState(""), [D, O] = c.useState(""), K = async () => {
1070
+ a(f.ON_TRANSACTION_TAGS_TAG_EDIT_SAVED), l && await o({ ...l, name: p }), d(!1);
1071
+ }, P = async () => {
1072
+ a(f.ON_TRANSACTION_TAGS_TAG_DELETED), await r(l.guid), g(!1);
1073
+ };
1074
+ c.useEffect(() => {
1075
+ O(p.length > 40 ? _.tags_error_name_must_be_40_chars : "");
1076
+ }, [p]);
1077
+ const y = () => {
1078
+ a(f.ON_TRANSACTION_TAGS_TAG_EDIT_CLICK), h(l.name), d(!0);
1079
+ }, N = () => {
1080
+ a(f.ON_TRANSACTION_TAGS_TAG_DELETE_CLICK), g(!0);
1081
+ };
1082
+ return /* @__PURE__ */ m(
1083
+ U,
1084
+ {
1085
+ className: "mx-txn-transaction-manager-row",
1086
+ disableGutters: !0,
1087
+ disablePadding: !0,
1088
+ secondaryAction: !l.is_default_tag && /* @__PURE__ */ m(L, { direction: "row", children: [
1089
+ /* @__PURE__ */ e(
1090
+ ue,
1091
+ {
1092
+ "aria-label": `Edit ${l.name} tag`,
1093
+ color: "secondary",
1094
+ onClick: y,
1095
+ children: /* @__PURE__ */ e(dt, { color: "secondary" })
1096
+ }
1097
+ ),
1098
+ /* @__PURE__ */ e(
1099
+ ue,
1100
+ {
1101
+ "aria-label": `Delete ${l.name} tag`,
1102
+ color: "secondary",
1103
+ onClick: N,
1104
+ children: /* @__PURE__ */ e(fe, { color: "secondary" })
1105
+ }
1106
+ )
1107
+ ] }),
1108
+ children: [
1109
+ /* @__PURE__ */ m(
1110
+ X,
1111
+ {
1112
+ "aria-checked": n.includes(l.guid),
1113
+ onClick: () => t(l.guid),
1114
+ role: "checkbox",
1115
+ children: [
1116
+ /* @__PURE__ */ e(Z, { sx: { ml: 0 }, children: /* @__PURE__ */ e(
1117
+ yt,
1118
+ {
1119
+ "aria-hidden": !0,
1120
+ checked: n.includes(l.guid),
1121
+ edge: "start",
1122
+ tabIndex: -1
1123
+ }
1124
+ ) }),
1125
+ /* @__PURE__ */ e(W, { children: l.name })
1126
+ ]
1127
+ }
1128
+ ),
1129
+ /* @__PURE__ */ m(
1130
+ ae,
1131
+ {
1132
+ copy: { title: "Update tag name" },
1133
+ isOpen: s,
1134
+ onClose: () => d(!1),
1135
+ onPrimaryAction: K,
1136
+ onSecondaryAction: () => d(!1),
1137
+ children: [
1138
+ /* @__PURE__ */ e(
1139
+ Le,
1140
+ {
1141
+ "aria-describedby": D ? "update-tag-error" : void 0,
1142
+ "aria-label": _.tags_update_the_tag_name,
1143
+ name: "update-tag",
1144
+ onChange: (C) => h(C.target.value),
1145
+ placeholder: "Tag name",
1146
+ sx: { width: "100%" },
1147
+ value: p
1148
+ }
1149
+ ),
1150
+ /* @__PURE__ */ e(ee, { id: "update-tag-error", sx: { color: "error.main" }, variant: "subtitle2", children: D })
1151
+ ]
1152
+ }
1153
+ ),
1154
+ /* @__PURE__ */ e(
1155
+ ae,
1156
+ {
1157
+ copy: { title: _.tags_delete_title },
1158
+ isOpen: u,
1159
+ onClose: () => g(!1),
1160
+ onPrimaryAction: P,
1161
+ onSecondaryAction: () => a(f.ON_TRANSACTION_TAGS_TAG_DELETE_CANCEL_CLICK),
1162
+ primaryText: i.delete_button,
1163
+ secondaryText: i.cancel_button,
1164
+ children: /* @__PURE__ */ e(x, { truncate: !1, children: _.tags_deleting_this_tag_will_remove_it })
1165
+ }
1166
+ )
1167
+ ]
1168
+ }
1169
+ );
1170
+ }, jt = w(Yt), qt = ({ selectedTags: t, onTagChecked: n }) => {
1171
+ const { tags: l } = M(), [a, r] = c.useState(""), o = l.filter(
1172
+ (i) => i.name.toLowerCase().includes(a.toLowerCase())
1173
+ );
1174
+ return /* @__PURE__ */ m("div", { className: "mx-txn-tag-manager", children: [
1175
+ /* @__PURE__ */ e(
1176
+ Vt,
1177
+ {
1178
+ onSearchValueChanged: (i) => r(i),
1179
+ searchValue: a
1180
+ }
1181
+ ),
1182
+ /* @__PURE__ */ e(Ut, {}),
1183
+ /* @__PURE__ */ e(he, { sx: { boxShadow: "none" }, children: /* @__PURE__ */ e(be, { children: o.map((i) => /* @__PURE__ */ m(c.Fragment, { children: [
1184
+ /* @__PURE__ */ e(jt, { onTagChecked: n, selectedTags: t, tag: i }),
1185
+ /* @__PURE__ */ e(Te, { sx: { ml: 24 } })
1186
+ ] }, i.guid)) }) })
1187
+ ] });
1188
+ }, Qt = w(qt), Xt = ({ transaction: t }) => {
1189
+ const { onEvent: n } = G(), { tags: l, updateTaggings: a, updateTransaction: r } = M(), { common: o, transactions: i } = E(), { updateManualTransaction: _ } = ne(), s = H(), [d, u] = c.useState(!1), [g, p] = c.useState(t.tags);
1190
+ c.useEffect(() => {
1191
+ p(t.tags);
1192
+ }, [d, t]);
1193
+ const h = (P) => {
1194
+ const y = [...g], N = g.indexOf(P);
1195
+ N >= 0 ? y.splice(N, 1) : y.push(P), p(y);
1196
+ }, D = async () => {
1197
+ if (t.is_manual && !t.guid) {
1198
+ _({ ...t, tags: g }), u(!1);
1199
+ return;
1200
+ }
1201
+ await a(g, t.guid), await r({ ...t, tags: g }), n(j.TRANSACTION_DETAILS_CLICK_TAGS, { transaction_guid: t.guid }), u(!1);
1202
+ }, O = c.useMemo(
1203
+ () => t.tags.map(
1204
+ (P, y, N) => `${l.find((C) => C.guid === P)?.name}${y < N.length - 1 ? " / " : ""}`
1205
+ ),
1206
+ [l, t]
1207
+ ), K = s.palette.mode === "dark" ? "grey.800" : "grey.100";
1208
+ return /* @__PURE__ */ m(U, { disableGutters: !0, disablePadding: !0, children: [
1209
+ /* @__PURE__ */ m(
1210
+ X,
1211
+ {
1212
+ onClick: () => {
1213
+ n(f.ON_TRANSACTION_TAGS_CLICK), u(!0);
1214
+ },
1215
+ children: [
1216
+ /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(q, { sx: { bgcolor: K }, variant: "rounded", children: /* @__PURE__ */ e(k, { name: "local_offer", sx: { color: "text.primary" } }) }) }),
1217
+ /* @__PURE__ */ e(
1218
+ W,
1219
+ {
1220
+ primary: i.tags_title,
1221
+ secondary: /* @__PURE__ */ e(x, { bold: !0, sx: { color: "text.primary" }, variant: "body1", children: t.tags?.length > 0 ? O : i.tags_desc }),
1222
+ slotProps: { primary: { variant: "caption", fontSize: 11, fontWeight: "normal" } }
1223
+ }
1224
+ ),
1225
+ /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ e(k, { name: "chevron_right", sx: { color: "text.primary" } }) })
1226
+ ]
1227
+ }
1228
+ ),
1229
+ /* @__PURE__ */ e(
1230
+ _e,
1231
+ {
1232
+ ariaLabelClose: o.close_aria,
1233
+ isOpen: d,
1234
+ onClose: () => u(!1),
1235
+ onPrimaryAction: D,
1236
+ primaryText: o.save_button,
1237
+ secondaryText: o.cancel_button,
1238
+ title: i.tags_title,
1239
+ children: /* @__PURE__ */ e(Qt, { onTagChecked: h, selectedTags: g })
1240
+ }
1241
+ )
1242
+ ] });
1243
+ }, Zt = w(Xt), Jt = ({ transaction: t, viewOnly: n = !1 }) => {
1244
+ const { updateTransaction: l } = M(), { common: a, transactions: r } = E(), { onEvent: o } = G(), { announce: i, ariaLive: _ } = Ae(), [s, d] = c.useState(!1), [u, g] = c.useState(""), p = c.useRef(null);
1245
+ c.useEffect(() => {
1246
+ s && (g(t.description), p?.current?.focus());
1247
+ }, [s]);
1248
+ const h = () => {
1249
+ d(!0), o(f.ON_TRANSACTION_DESCRIPTION_EDIT_CLICK), setTimeout(() => document.getElementById("transaction-description-input")?.focus(), 0);
1250
+ }, D = async () => {
1251
+ o(j.TRANSACTION_DETAILS_CLICK_DESCRIPTION, {
1252
+ transaction_guid: t.guid
1253
+ }), await l({ ...t, description: u }), d(!1), i(`${r.payee_title}: ${u}`), setTimeout(() => document.getElementById("transaction-description-edit-button")?.focus(), 0);
1254
+ };
1255
+ return /* @__PURE__ */ m(Y, { className: "mx-txn-transaction-description", children: [
1256
+ _,
1257
+ s ? /* @__PURE__ */ m(Xe, { row: !0, children: [
1258
+ /* @__PURE__ */ e(
1259
+ $e,
1260
+ {
1261
+ "aria-label": r.payee_title,
1262
+ id: "transaction-description-input",
1263
+ label: r.payee_title,
1264
+ name: r.payee_title,
1265
+ onChange: (O) => g(O.target.value),
1266
+ ref: p,
1267
+ slotProps: { htmlInput: { maxLength: 140 } },
1268
+ sx: {
1269
+ backgroundColor: "background.paper",
1270
+ ".MuiOutlinedInput-root": { borderTopRightRadius: 0, borderBottomRightRadius: 0 },
1271
+ ".MuiOutlinedInput-input": { p: 11 },
1272
+ width: 250
1273
+ },
1274
+ value: u
1275
+ }
1276
+ ),
1277
+ /* @__PURE__ */ e(
1278
+ me,
1279
+ {
1280
+ disabled: !u,
1281
+ onClick: D,
1282
+ sx: {
1283
+ borderTopLeftRadius: 0,
1284
+ borderBottomLeftRadius: 0
1285
+ },
1286
+ variant: "outlined",
1287
+ children: a.save_button
1288
+ }
1289
+ )
1290
+ ] }) : /* @__PURE__ */ m(L, { alignItems: "center", direction: "row", gap: 4, sx: { minHeight: 44 }, children: [
1291
+ /* @__PURE__ */ e(x, { bold: !0, children: t.description }),
1292
+ !n && /* @__PURE__ */ e(
1293
+ ue,
1294
+ {
1295
+ "aria-label": r.payee_edit,
1296
+ id: "transaction-description-edit-button",
1297
+ onClick: h,
1298
+ sx: { color: "action.active" },
1299
+ children: /* @__PURE__ */ e(ye, { name: "create", size: 22 })
1300
+ }
1301
+ )
1302
+ ] })
1303
+ ] });
1304
+ }, ea = w(Jt), ta = ({ transaction: t }) => {
1305
+ const { updateTransaction: n } = M(), { transactions: l } = E(), { onEvent: a } = G(), r = H(), o = r.palette.mode === "dark", i = async () => {
1306
+ a(j.TRANSACTION_DETAILS_CLICK_FLAG, { transaction_guid: t.guid }), await n({ ...t, is_flagged: !t.is_flagged });
1307
+ };
1308
+ return /* @__PURE__ */ e("div", { className: "mx-txn-transaction-flag", children: /* @__PURE__ */ e(
1309
+ lt,
1310
+ {
1311
+ "aria-label": l.flag_btn_aria,
1312
+ "aria-pressed": t.is_flagged,
1313
+ color: o ? "primary" : "warning",
1314
+ onClick: i,
1315
+ selected: t.is_flagged,
1316
+ sx: {
1317
+ borderRadius: 6,
1318
+ color: o ? "common.white" : "secondary.main",
1319
+ "&.Mui-selected": {
1320
+ color: o ? "primary.main" : "common.white",
1321
+ backgroundColor: o ? xe(r.palette.primary.main, 0.25) : "warning.dark",
1322
+ ":hover": {
1323
+ color: o ? "primary.main" : "common.white",
1324
+ backgroundColor: o ? xe(r.palette.primary.main, 0.2) : "warning.main"
1325
+ }
1326
+ },
1327
+ ":hover": {
1328
+ color: o ? "common.white" : "warning.contrastText",
1329
+ backgroundColor: o ? xe(r.palette.primary.main, 0.2) : "warning.light"
1330
+ }
1331
+ },
1332
+ value: "flagged",
1333
+ children: /* @__PURE__ */ e(ut, { color: "inherit" })
1334
+ }
1335
+ ) });
1336
+ }, aa = w(ta), pe = (t, n, l, a = !0, r = "inset") => a ? /* @__PURE__ */ m(c.Fragment, { children: [
1337
+ /* @__PURE__ */ m(U, { disableGutters: !0, disablePadding: !0, children: [
1338
+ /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e(q, { sx: { bgcolor: "neutral.light" }, variant: "rounded", children: t }) }),
1339
+ /* @__PURE__ */ e(
1340
+ W,
1341
+ {
1342
+ primary: n,
1343
+ secondary: l,
1344
+ slotProps: { primary: { variant: "caption", fontSize: 11, fontWeight: "normal" } }
1345
+ }
1346
+ )
1347
+ ] }),
1348
+ /* @__PURE__ */ e(Te, { variant: r })
1349
+ ] }) : null, na = ({ transaction: t }) => {
1350
+ const { transactions: n } = E(), { tags: l } = M(), a = c.useMemo(() => {
1351
+ const r = new Map(l.map((o) => [o.guid, o.name]));
1352
+ return t.tags.map((o) => r.get(o)).filter(Boolean).join(" / ");
1353
+ }, [l, t.tags]);
1354
+ return /* @__PURE__ */ m(be, { sx: { "& .MuiListItem-root": { px: 24, py: 12 } }, children: [
1355
+ pe(
1356
+ /* @__PURE__ */ e(
1357
+ Oe,
1358
+ {
1359
+ categoryGuid: t.top_level_category_guid,
1360
+ size: 24,
1361
+ sx: { color: "text.primary" },
1362
+ variant: Ge.Transparent
1363
+ }
1364
+ ),
1365
+ n.category_title,
1366
+ /* @__PURE__ */ e(x, { bold: !0, variant: "body1", children: t.category ?? n.actions_select_a_category })
1367
+ ),
1368
+ pe(
1369
+ /* @__PURE__ */ e(ye, { name: "calendar_month", sx: { color: "text.primary" } }),
1370
+ n.date_title,
1371
+ /* @__PURE__ */ e(x, { bold: !0, variant: "body1", children: Me(ve(t.date), Re.YEAR_MONTH_DAY) })
1372
+ ),
1373
+ pe(
1374
+ /* @__PURE__ */ e(ye, { name: "article", sx: { color: "text.primary" } }),
1375
+ n.memo_title,
1376
+ /* @__PURE__ */ e(x, { bold: !0, variant: "body1", children: t.memo ?? n.memo_desc }),
1377
+ !!t.memo,
1378
+ t.tags?.length > 0 ? "inset" : "fullWidth"
1379
+ ),
1380
+ pe(
1381
+ /* @__PURE__ */ e(ye, { name: "local_offer", sx: { color: "text.primary" } }),
1382
+ n.tags_title,
1383
+ /* @__PURE__ */ e(x, { bold: !0, variant: "body1", children: t.tags?.length ? a : n.tags_desc }),
1384
+ !!t.tags?.length,
1385
+ "fullWidth"
1386
+ )
1387
+ ] });
1388
+ }, ra = w(na), oa = ({
1389
+ data: t,
1390
+ color: n,
1391
+ width: l = 85,
1392
+ height: a = 65
1393
+ }) => {
1394
+ const r = H(), o = {
1395
+ series: [
1396
+ {
1397
+ data: t.map(({ value: s }) => s),
1398
+ type: "bar"
1399
+ }
1400
+ ],
1401
+ xAxis: [
1402
+ {
1403
+ data: t.map(({ label: s }) => s),
1404
+ scaleType: "band",
1405
+ categoryGapRatio: 0.3
1406
+ }
1407
+ ]
1408
+ }, i = t.map(
1409
+ (s, d) => d === t.length - 1 ? n(r) : `${n(r)}80`
1410
+ ), _ = (s, d) => {
1411
+ if (s <= 0 || d <= 0) return "";
1412
+ const u = Math.min(6, s / 2, d / 2);
1413
+ return `M${u},0 L${s - u},0 Q${s},0 ${s},${u} L${s},${d} L0,${d} L0,${u} Q0,0 ${u},0 Z`;
1414
+ };
1415
+ return /* @__PURE__ */ e(
1416
+ L,
1417
+ {
1418
+ sx: {
1419
+ width: l,
1420
+ height: a
1421
+ },
1422
+ children: /* @__PURE__ */ e(
1423
+ mt,
1424
+ {
1425
+ axisHighlight: {
1426
+ x: "none",
1427
+ y: "none"
1428
+ },
1429
+ height: a,
1430
+ margin: {
1431
+ bottom: -10,
1432
+ left: 0,
1433
+ right: 0,
1434
+ top: 10
1435
+ },
1436
+ series: o.series,
1437
+ slots: {
1438
+ bar: ({ ownerState: s, ...d }) => {
1439
+ const { ariaLabel: u } = t[s.dataIndex];
1440
+ return /* @__PURE__ */ e("g", { "aria-label": u, children: /* @__PURE__ */ e(
1441
+ "path",
1442
+ {
1443
+ d: _(d.width, d.height),
1444
+ fill: i[s.dataIndex],
1445
+ transform: `translate(${d.x}, ${d.y})`
1446
+ }
1447
+ ) });
1448
+ },
1449
+ axisTickLabel: ({ text: s, ...d }) => {
1450
+ const u = t[t.length - 1]?.label;
1451
+ return /* @__PURE__ */ e(
1452
+ "text",
1453
+ {
1454
+ ...d,
1455
+ style: {
1456
+ ...d.style,
1457
+ fontSize: 6.75,
1458
+ lineHeight: "9px",
1459
+ fontWeight: u === s ? "bold" : 400
1460
+ },
1461
+ children: s
1462
+ }
1463
+ );
1464
+ }
1465
+ },
1466
+ sx: {
1467
+ "& .MuiChartsAxis-bottom .MuiChartsAxis-tickContainer:first-of-type .MuiChartsAxis-tick": {
1468
+ display: "none"
1469
+ }
1470
+ },
1471
+ width: l,
1472
+ xAxis: o.xAxis,
1473
+ yAxis: [{ width: 0, position: "none" }]
1474
+ }
1475
+ )
1476
+ }
1477
+ );
1478
+ }, ia = {
1479
+ BILL_AMOUNT_NOT_STANDARD: "BillAmountNotStandard"
1480
+ }, sa = (t, n) => {
1481
+ if (n)
1482
+ switch (n.template) {
1483
+ case ia.BILL_AMOUNT_NOT_STANDARD: {
1484
+ const l = n.data_series ? et(n.data_series) : [], a = tt(l, n.payload?.merchant_name);
1485
+ return {
1486
+ instanceSlot: /* @__PURE__ */ e(
1487
+ oa,
1488
+ {
1489
+ color: (r) => r.palette.categories.billsUtilities,
1490
+ data: a.slice(-3)
1491
+ }
1492
+ ),
1493
+ dataSeries: l,
1494
+ chartData: a,
1495
+ callToAction: t.view_history
1496
+ };
1497
+ }
1498
+ default:
1499
+ return null;
1500
+ }
1501
+ return null;
1502
+ }, la = ({
1503
+ bottomActions: t = St,
1504
+ canFlagTransaction: n = !0,
1505
+ topActions: l = ft,
1506
+ transaction: a
1507
+ }) => {
1508
+ const { onEvent: r } = G(), { isCopyLoaded: o } = it(), { userFeatures: i } = st(), { accounts: _, common: s, insights_feed: d } = E(), { detailedCategories: u } = we(), {
1509
+ alert: g,
1510
+ associatedBeats: p,
1511
+ detailedTransactions: h,
1512
+ cachedStartDate: D,
1513
+ loadEmbeddedInstanceTransactions: O,
1514
+ setAlert: K
1515
+ } = M(), [P, y] = c.useState(!1), [N, C] = c.useState(!1), [J, se] = c.useState(!1), le = H(), te = a?.number && a.number.length > 4, B = c.useMemo(() => p.find((T) => T.associated_transaction_guid === a.guid), [p, a]), b = sa(s, B), [F, re] = c.useState(
1516
+ b ? b.dataSeries.length - 1 : 0
1517
+ );
1518
+ c.useEffect(
1519
+ () => r(j.TRANSACTION_DETAILS_VIEW, { transaction_guid: a.guid }),
1520
+ []
1521
+ ), c.useEffect(() => {
1522
+ if (!b || b.dataSeries.length === 0) return;
1523
+ const { date: T } = b.dataSeries[F], v = De(T);
1524
+ je(v, D) && (C(!0), O(v).finally(() => {
1525
+ C(!1);
1526
+ }));
1527
+ }, [F, b, D]);
1528
+ const z = t.includes(ie.MerchantBudget) && !a?.merchant_guid ? t.filter((T) => T !== ie.MerchantBudget) : t, A = ke(() => {
1529
+ if (b) {
1530
+ const T = u.find(
1531
+ (ze) => ze.guid === a.top_level_category_guid
1532
+ ), v = B?.payload?.average_amount ?? 0, oe = a.amount;
1533
+ let ge = d.general.increased_text;
1534
+ oe - v < 0 && (ge = d.general.decreased_text);
1535
+ const ce = v === 0 ? 0 : Math.round(Math.abs(oe - v) / v * 100);
1536
+ return { category: T, percentageAmount: ce, changetype: ge };
1537
+ }
1538
+ return null;
1539
+ }, [b, u]), $ = ke(() => {
1540
+ if (!b?.dataSeries?.length)
1541
+ return [];
1542
+ const { guid: T, date: v } = b.dataSeries[F], oe = De(v), ge = Be(v);
1543
+ return h.filter((ce) => ce.date >= Ie(oe) && ce.date <= Ie(ge) && ce.guid === T);
1544
+ }, [F, b, h, N]);
1545
+ if (!o)
1546
+ return /* @__PURE__ */ e(_t, {});
1547
+ const S = Qe(i, "MX_TXN_DETAILS_VIEW_ONLY"), R = le.palette.mode === "dark" ? "grey.800" : "grey.100";
1548
+ return /* @__PURE__ */ m(Y, { className: "mx-txn-transaction-details", width: "100%", children: [
1549
+ a && /* @__PURE__ */ m(L, { children: [
1550
+ /* @__PURE__ */ m(L, { gap: 12, p: 24, children: [
1551
+ /* @__PURE__ */ e(he, { elevation: 2, sx: { width: 64 }, children: /* @__PURE__ */ e(
1552
+ Ce,
1553
+ {
1554
+ categoryGuid: a.top_level_category_guid || "",
1555
+ merchantGuid: a.merchant_guid || "",
1556
+ size: 64
1557
+ }
1558
+ ) }),
1559
+ /* @__PURE__ */ e(ea, { transaction: a, viewOnly: S }),
1560
+ /* @__PURE__ */ m(L, { direction: "row", justifyContent: "space-between", sx: { minHeight: 44 }, children: [
1561
+ /* @__PURE__ */ m(ee, { color: a.isIncome ? "success.main" : "text.primary", variant: "h1", children: [
1562
+ a.isIncome ? "+" : "",
1563
+ V(a.amount, "0,0.00")
1564
+ ] }),
1565
+ !S && n && /* @__PURE__ */ e(aa, { transaction: a })
1566
+ ] }),
1567
+ b?.instanceSlot && /* @__PURE__ */ e(
1568
+ at,
1569
+ {
1570
+ callToAction: b.callToAction,
1571
+ description: I(
1572
+ d.general.embedded_description,
1573
+ A.changetype,
1574
+ /* @__PURE__ */ e("strong", { children: A.percentageAmount })
1575
+ ),
1576
+ instanceSlot: b.instanceSlot,
1577
+ onCtaClick: () => {
1578
+ y(!0);
1579
+ },
1580
+ title: B.html_micro_title
1581
+ }
1582
+ ),
1583
+ /* @__PURE__ */ m(L, { sx: { bgcolor: R, borderRadius: "4px", gap: 4, p: 8 }, children: [
1584
+ /* @__PURE__ */ e(x, { bold: !0, children: `${a.account}
1585
+ ${te ? a.number : "•".repeat(4).concat(a.number ?? "")}` }),
1586
+ /* @__PURE__ */ e(x, { bold: !0, truncate: !0, variant: "tiny", children: a.feed_description })
1587
+ ] })
1588
+ ] }),
1589
+ /* @__PURE__ */ e(he, { square: !0, sx: { boxShadow: "none" }, children: S ? /* @__PURE__ */ e(ra, { transaction: a }) : /* @__PURE__ */ e(be, { children: l.map((T, v) => /* @__PURE__ */ m(c.Fragment, { children: [
1590
+ T === de.Category && /* @__PURE__ */ e(Dt, { transaction: a }),
1591
+ T === de.Date && /* @__PURE__ */ e(vt, { transaction: a }),
1592
+ T === de.Memo && /* @__PURE__ */ e(Pt, { transaction: a }),
1593
+ T === de.Tags && /* @__PURE__ */ e(Zt, { transaction: a }),
1594
+ /* @__PURE__ */ e(
1595
+ Te,
1596
+ {
1597
+ component: "li",
1598
+ variant: v < l.length - 1 ? "inset" : "fullWidth"
1599
+ }
1600
+ )
1601
+ ] }, T)) }) }),
1602
+ !S && z.length > 0 && /* @__PURE__ */ m(c.Fragment, { children: [
1603
+ /* @__PURE__ */ e(x, { bold: !0, mb: 8, ml: 26, mt: 16, variant: "body1", children: _.actions }),
1604
+ /* @__PURE__ */ e(he, { square: !0, sx: { boxShadow: "none" }, children: /* @__PURE__ */ m(be, { children: [
1605
+ z.map((T, v) => /* @__PURE__ */ m(c.Fragment, { children: [
1606
+ T === ie.MerchantBudget && /* @__PURE__ */ e(It, { transaction: a }),
1607
+ T === ie.SplitTransaction && /* @__PURE__ */ e(Ht, { transaction: a }),
1608
+ T === ie.HideTransaction && /* @__PURE__ */ e(Rt, { transaction: a }),
1609
+ T === ie.MerchantLogo && /* @__PURE__ */ e(wt, { transaction: a }),
1610
+ /* @__PURE__ */ e(
1611
+ Te,
1612
+ {
1613
+ component: "li",
1614
+ variant: v < z.length - 1 ? "inset" : "fullWidth"
1615
+ }
1616
+ )
1617
+ ] }, T)),
1618
+ a.is_manual && !a.parent_guid && !a.has_been_split && /* @__PURE__ */ e(Ot, { transaction: a })
1619
+ ] }) })
1620
+ ] })
1621
+ ] }),
1622
+ B && b && /* @__PURE__ */ e(
1623
+ nt,
1624
+ {
1625
+ ariaLabel: Me(
1626
+ b?.dataSeries[F]?.date,
1627
+ Re.MONTH
1628
+ ),
1629
+ barChartProps: {
1630
+ amounts: {
1631
+ average: B.payload.average_amount,
1632
+ formattedAverage: V(B.payload.average_amount, "0,0")
1633
+ },
1634
+ color: A.category?.color || "",
1635
+ data: b.chartData,
1636
+ margin: { bottom: 10, left: 24, right: 24, top: 20 },
1637
+ monthlyAmountLabel: d.general.monthly_amount,
1638
+ onBarClick: (T) => {
1639
+ re(T);
1640
+ },
1641
+ trendAmountLabel: d.general.trend,
1642
+ legendPosition: "top"
1643
+ },
1644
+ beat: {
1645
+ heading: B.html_title,
1646
+ subHeading: {
1647
+ category_guid: a.category_guid ?? "",
1648
+ merchant_guid: a.merchant_guid ?? "",
1649
+ description: a.description ?? ""
1650
+ }
1651
+ },
1652
+ data: b.chartData,
1653
+ defaultSelectedIndex: F,
1654
+ icon: /* @__PURE__ */ e(
1655
+ Ce,
1656
+ {
1657
+ alt: a.description ?? "",
1658
+ categoryGuid: a.category_guid ?? "",
1659
+ merchantGuid: a.merchant_guid ?? "",
1660
+ size: 16
1661
+ }
1662
+ ),
1663
+ isOpen: P,
1664
+ onClose: () => {
1665
+ y(!1), re(b.dataSeries.length - 1);
1666
+ },
1667
+ onTabChange: (T) => {
1668
+ re(T);
1669
+ },
1670
+ tipSection: J ? void 0 : {
1671
+ message: I(
1672
+ d.general.tip_section_message,
1673
+ /* @__PURE__ */ e("strong", { children: d.general.tip_section_title }),
1674
+ /* @__PURE__ */ e("strong", { children: B.primary_transaction?.description })
1675
+ ),
1676
+ onDismiss: () => se(!0)
1677
+ },
1678
+ title: d.general.transaction_history_title,
1679
+ transactionListProps: {
1680
+ showLoader: N,
1681
+ showInsights: !0,
1682
+ transaction: $
1683
+ }
1684
+ }
1685
+ ),
1686
+ /* @__PURE__ */ e(
1687
+ We,
1688
+ {
1689
+ anchorOrigin: { vertical: "bottom", horizontal: "right" },
1690
+ autoHideDuration: 3500,
1691
+ onClose: () => K(""),
1692
+ open: !!g,
1693
+ children: /* @__PURE__ */ e(Ue, { closeText: "", onClose: () => K(""), severity: "success", variant: "filled", children: g })
1694
+ }
1695
+ )
1696
+ ] });
1697
+ }, rn = w(la);
1698
+ export {
1699
+ ie as B,
1700
+ Dt as C,
1701
+ vt as D,
1702
+ Pt as M,
1703
+ rn as T,
1704
+ Zt as a,
1705
+ de as b,
1706
+ At as c
1707
+ };
1708
+ //# sourceMappingURL=TransactionDetails-roZ5xLq8.mjs.map