@mx-cartographer/experiences 8.0.0-alpha.bb2 → 8.0.0-alpha.bb4

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 (222) hide show
  1. package/CHANGELOG.md +128 -1
  2. package/dist/{Account-Bxw0_4FU.mjs → Account-B4CDD-zq.mjs} +1 -1
  3. package/dist/AccountDetailsContent-adZTkM52.mjs +683 -0
  4. package/dist/AccountDetailsHeader-DRjFuyJT.mjs +87 -0
  5. package/dist/{AccountFields-C9FlatNb.mjs → AccountFields-Cl4KHoSj.mjs} +14 -12
  6. package/dist/AccountListItem-wgmlex-_.mjs +90 -0
  7. package/dist/{AccountStore-BgNOyMdp.mjs → AccountStore-HbVblv86.mjs} +19 -8
  8. package/dist/{Accounts-BRf_YeTf.mjs → Accounts-CRUehOiy.mjs} +1 -1
  9. package/dist/{BeatApi-DhJpgCLz.mjs → BeatApi-De2IaqH2.mjs} +1 -1
  10. package/dist/{BeatStore-IBnXd4YK.mjs → BeatStore-D_NYuBSz.mjs} +1 -1
  11. package/dist/{BudgetUtil-B2ZXyw-g.mjs → BudgetUtil-Jv8h9H9l.mjs} +33 -33
  12. package/dist/{CashflowStore-D9Dpuz7X.mjs → CashflowStore-CA190BPF.mjs} +18 -25
  13. package/dist/{Category-CevNQ03n.mjs → Category-Ccoew_sA.mjs} +2 -2
  14. package/dist/{CategorySelectorDrawer-DUe4lH5-.mjs → CategorySelectorDrawer-Dl006GKy.mjs} +43 -41
  15. package/dist/{CategoryStore-yHI0hWmK.mjs → CategoryStore-MUwRWH9e.mjs} +13 -11
  16. package/dist/{CategoryUtil-pZRIYOgN.mjs → CategoryUtil-DfVKKkRf.mjs} +4 -4
  17. package/dist/{ConnectDrawer-BQNs-hjk.mjs → ConnectDrawer-DVp54lUH.mjs} +49 -48
  18. package/dist/{ConnectionsDrawer-ByGQE7D5.mjs → ConnectionsDrawer-Dsc04-4Z.mjs} +3 -3
  19. package/dist/CurrencyInput-D1cjbdCI.mjs +85 -0
  20. package/dist/{CurrencyText-kyC1aseI.mjs → CurrencyText-Dr0EZ7bp.mjs} +1 -1
  21. package/dist/{DateUtil-BcuH7ErC.mjs → DateUtil-CDPZw_-m.mjs} +3 -3
  22. package/dist/{DebtsStore-C9bblOgW.mjs → DebtsStore-pL63fmdT.mjs} +3 -3
  23. package/dist/{Dialog-CWW597AF.mjs → Dialog-CDV0kKxj.mjs} +24 -24
  24. package/dist/{Donut-oaQFlbit.mjs → Donut-Dmy3JTWd.mjs} +12 -12
  25. package/dist/Drawer-BF40nbsH.mjs +163 -0
  26. package/dist/{EmptyState-DA_lfRBv.mjs → EmptyState-DoxNUae-.mjs} +24 -22
  27. package/dist/{ExportCsvAction-sX8Rg4Ov.mjs → ExportCsvAction-QhQK4_FU.mjs} +4 -4
  28. package/dist/{Fetch-87LIQbEA.mjs → Fetch-DecPFeGU.mjs} +24 -22
  29. package/dist/FinstrongStore-BGf36b0z.mjs +451 -0
  30. package/dist/{GoalStore-D-aB35SY.mjs → GoalStore-C1-w3Y1E.mjs} +7 -7
  31. package/dist/HeaderCell-P8w6CmfO.mjs +6 -0
  32. package/dist/{Help-B6dIcujh.mjs → Help-DBfsTkAi.mjs} +125 -146
  33. package/dist/{Help-DhcC-C05.mjs → Help-c-zHlDbv.mjs} +8 -8
  34. package/dist/{IconBacking-B9oC6uL2.mjs → IconBacking-DgT8DCeh.mjs} +11 -11
  35. package/dist/LineChart-C1PxNf7P.mjs +581 -0
  36. package/dist/{ListItemAction-DHa3KJPs.mjs → ListItemAction-BNCWQAN_.mjs} +10 -10
  37. package/dist/Loader-Ckqi9Rx6.mjs +21 -0
  38. package/dist/{ManageIncome-1s_q5W4X.mjs → ManageIncome-8EsStyIQ.mjs} +195 -192
  39. package/dist/{MerchantStore-DrFvsUyy.mjs → MerchantStore-WvZ4gnQe.mjs} +1 -1
  40. package/dist/MicroWidgetContainer-BGpNl5ZS.mjs +45 -0
  41. package/dist/MiniWidgetContainer-CKzf_Ira.mjs +56 -0
  42. package/dist/{NetWorthStore-DCsTZpuS.mjs → NetWorthStore-Bti6u-d9.mjs} +4 -4
  43. package/dist/{NotificationSettings-DqrkNMod.mjs → NotificationSettings-B74rQVYC.mjs} +276 -273
  44. package/dist/{NotificationStore-BxP_P2dA.mjs → NotificationStore-Ck2KdNmT.mjs} +10 -10
  45. package/dist/{NumberFormatting-Buh7u8Oi.mjs → NumberFormatting-DjTD0t3W.mjs} +9 -9
  46. package/dist/{OriginalBalanceAction-CWuVvRq9.mjs → OriginalBalanceAction-2Y_3U_mg.mjs} +10 -10
  47. package/dist/{RecurringSettings-A_rAGCTP.mjs → RecurringSettings-DAncu--R.mjs} +17 -17
  48. package/dist/{RecurringTransactions-DK8dWldr.mjs → RecurringTransactions-CxcSL1dY.mjs} +106 -105
  49. package/dist/{RecurringTransactionsStore-C4YOD7_D.mjs → RecurringTransactionsStore-CNFxyGB6.mjs} +80 -73
  50. package/dist/{ResponsiveButton-DZFp78fJ.mjs → ResponsiveButton-Cn6-R7ue.mjs} +10 -10
  51. package/dist/SearchBox-B7km148n.mjs +39 -0
  52. package/dist/{SettingsStore-BcgS_Ohv.mjs → SettingsStore-BASMQSIp.mjs} +3 -3
  53. package/dist/{SingleSegmentDonut-BgbLgwHi.mjs → SingleSegmentDonut-7Uy6VEld.mjs} +6 -6
  54. package/dist/SkeletonLoader-BaNboJjD.mjs +38 -0
  55. package/dist/{SpendingData-D5vsfYKo.mjs → SpendingData-DPQ96k3x.mjs} +19 -19
  56. package/dist/SpendingLegend-6FqtMcBV.mjs +193 -0
  57. package/dist/{StatusBar-BK_uYHAB.mjs → StatusBar-CPfSXe80.mjs} +6 -6
  58. package/dist/{TabContentContainer-j01JYR_7.mjs → TabContentContainer-CnMXkVqr.mjs} +8 -8
  59. package/dist/{ToggleListItem-r0Kx56wF.mjs → ToggleListItem-ciFTiqRS.mjs} +19 -14
  60. package/dist/TransactionApi-CjBoLleL.mjs +86 -0
  61. package/dist/TransactionDetails-Bn0qY5Hw.mjs +1336 -0
  62. package/dist/{TransactionStore-ai3uII_r.mjs → TransactionStore-DbwAutwC.mjs} +146 -165
  63. package/dist/TrendsStore-_mRaFUdf.mjs +182 -0
  64. package/dist/{User-BQUxBeZV.mjs → User-BklmOUSd.mjs} +107 -107
  65. package/dist/{ViewMoreMicroCard-SCn2wt4i.mjs → ViewMoreMicroCard-DAkyNRlD.mjs} +706 -729
  66. package/dist/{WidgetContainer-BHWANqT4.mjs → WidgetContainer-CDh9fjpR.mjs} +36 -36
  67. package/dist/accounts/components/AccountsListCompact.d.ts +10 -0
  68. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +4 -1
  69. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.d.ts +2 -1
  70. package/dist/accounts/index.es.js +228 -199
  71. package/dist/accounts/stores/AccountStore.d.ts +2 -0
  72. package/dist/analytics/index.es.js +27 -27
  73. package/dist/budgets/index.es.js +459 -462
  74. package/dist/cashflow/index.es.js +419 -428
  75. package/dist/categories/index.es.js +2 -2
  76. package/dist/categories/stores/CategoryStore.d.ts +1 -1
  77. package/dist/common/components/ErrorBoundary.d.ts +1 -1
  78. package/dist/common/components/Loader.d.ts +1 -2
  79. package/dist/common/components/Select.d.ts +4 -2
  80. package/dist/common/components/SkeletonLoader.d.ts +7 -0
  81. package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +1 -1
  82. package/dist/common/components/charts/LineChart.d.ts +12 -2
  83. package/dist/common/components/charts/index.d.ts +0 -3
  84. package/dist/common/components/charts/linechart/CustomLegend.d.ts +3 -1
  85. package/dist/common/components/charts/linechart/CustomMark.d.ts +5 -1
  86. package/dist/common/components/drawer/Drawer.d.ts +3 -0
  87. package/dist/common/components/drawer/Footer.d.ts +17 -0
  88. package/dist/common/components/index.d.ts +0 -1
  89. package/dist/common/hooks/index.d.ts +0 -1
  90. package/dist/common/hooks/useAriaLive.d.ts +1 -1
  91. package/dist/common/index.es.js +413 -674
  92. package/dist/common/stores/GlobalStore.d.ts +7 -1
  93. package/dist/common/stores/GlobalUiStore.d.ts +3 -2
  94. package/dist/common/types/Finstrong.d.ts +54 -0
  95. package/dist/common/types/Global.d.ts +1 -0
  96. package/dist/common/types/Widgets.d.ts +1 -0
  97. package/dist/common/types/index.d.ts +1 -1
  98. package/dist/common/types/localization/FinstrongCopy.d.ts +105 -2
  99. package/dist/common/types/localization/GoalsCopy.d.ts +1 -0
  100. package/dist/common/utils/Theme.d.ts +1 -3
  101. package/dist/dashboard/index.es.js +21 -21
  102. package/dist/debts/components/DebtsChart.d.ts +1 -2
  103. package/dist/debts/index.es.js +673 -665
  104. package/dist/exportTransactionsToCSV-BgV_wTLT.mjs +48 -0
  105. package/dist/finstrong/FinstrongWidget.d.ts +1 -1
  106. package/dist/finstrong/api/FinstrongApi.d.ts +5 -0
  107. package/dist/finstrong/components/ConnectMoreAccountsCard.d.ts +3 -1
  108. package/dist/finstrong/components/CreditScore/CreditScoreContent.d.ts +4 -0
  109. package/dist/finstrong/components/CreditScore/CreditScoreHeader.d.ts +4 -0
  110. package/dist/finstrong/components/FinancialStrengthGraph.d.ts +7 -1
  111. package/dist/finstrong/components/HaveManageableDebt/DebtPaymentTabContent.d.ts +3 -0
  112. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtComponent.d.ts +3 -0
  113. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtProgressBar.d.ts +4 -0
  114. package/dist/finstrong/components/HaveManageableDebt/IncomeTabContent.d.ts +3 -0
  115. package/dist/finstrong/components/KeyIndicatorsBorrowTab.d.ts +2 -2
  116. package/dist/finstrong/components/KeyIndicatorsDrawer.d.ts +4 -1
  117. package/dist/finstrong/components/KeyIndicatorsSaveTab.d.ts +2 -2
  118. package/dist/finstrong/components/KeyIndicatorsSpendTab.d.ts +2 -2
  119. package/dist/finstrong/components/KeyIndicatorsTabItem.d.ts +4 -3
  120. package/dist/finstrong/components/KeyIndicatorsTabItemDrawer.d.ts +10 -0
  121. package/dist/finstrong/components/KeyIndicatorsTabsWidget.d.ts +2 -2
  122. package/dist/finstrong/components/MaintainingEmergencySavings/EstimatedContributionCalculator.d.ts +6 -0
  123. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsContent.d.ts +4 -0
  124. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsSticky.d.ts +4 -0
  125. package/dist/finstrong/components/ProgressBar.d.ts +15 -0
  126. package/dist/finstrong/components/SaveEnoughToLiveOn/AvailableTabContent.d.ts +3 -0
  127. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnDrawerContent.d.ts +3 -0
  128. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnProgressBar.d.ts +4 -0
  129. package/dist/finstrong/components/SaveEnoughToLiveOn/SpendingTabContent.d.ts +3 -0
  130. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeComponent.d.ts +3 -0
  131. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeProgressBar.d.ts +4 -0
  132. package/dist/finstrong/components/StatusChip.d.ts +5 -0
  133. package/dist/finstrong/components/onboarding/Onboarding.d.ts +2 -0
  134. package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.d.ts +17 -0
  135. package/dist/finstrong/components/onboarding/OnboardingBirthday.d.ts +8 -0
  136. package/dist/finstrong/components/onboarding/OnboardingCreditScore.d.ts +8 -0
  137. package/dist/finstrong/components/onboarding/OnboardingStepsDrawer.d.ts +14 -0
  138. package/dist/finstrong/components/onboarding/OnboardingStepsHeader.d.ts +8 -0
  139. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeDrawerComponent.d.ts +4 -0
  140. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeStickyComponent.d.ts +4 -0
  141. package/dist/finstrong/components/shared/Accounts.d.ts +8 -0
  142. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +25 -0
  143. package/dist/finstrong/components/shared/DialScoreCard.d.ts +7 -1
  144. package/dist/finstrong/components/shared/DoubleBarChart.d.ts +28 -0
  145. package/dist/finstrong/components/shared/LineGraph.d.ts +7 -0
  146. package/dist/finstrong/components/shared/TotalCard.d.ts +8 -0
  147. package/dist/finstrong/components/shared/Transactions.d.ts +11 -0
  148. package/dist/finstrong/constants/index.d.ts +9 -0
  149. package/dist/finstrong/index.es.js +3175 -1067
  150. package/dist/finstrong/stores/FinstrongStore.d.ts +25 -2
  151. package/dist/finstrong/util/finstrongUtils.d.ts +58 -1
  152. package/dist/goals/index.es.js +580 -570
  153. package/dist/help/components/content/BottomImageContent.d.ts +1 -1
  154. package/dist/help/components/content/LeftImageContent.d.ts +1 -1
  155. package/dist/help/components/content/RightImageContent.d.ts +1 -1
  156. package/dist/help/components/content/TopImageContent.d.ts +1 -1
  157. package/dist/help/index.es.js +6 -6
  158. package/dist/{hooks-D6XlXHf4.mjs → hooks-C41HAxM5.mjs} +3 -3
  159. package/dist/insights/index.es.js +1 -1
  160. package/dist/investments/index.es.js +537 -536
  161. package/dist/merchants/index.es.js +9 -9
  162. package/dist/microinsights/beaticons/BeatIcon.d.ts +2 -9
  163. package/dist/microinsights/beaticons/BeatMerchantLogo.d.ts +3 -2
  164. package/dist/microinsights/beaticons/MonthlySpendComparisonIcon.d.ts +2 -1
  165. package/dist/microinsights/cards/{MicroInsightCard.d.ts → BaseCard.d.ts} +1 -8
  166. package/dist/microinsights/cards/{BeatCard.d.ts → InsightCard.d.ts} +2 -2
  167. package/dist/microinsights/cards/NoRelevantInsightsCard.d.ts +2 -5
  168. package/dist/microinsights/cards/ZeroStateCard.d.ts +2 -5
  169. package/dist/microinsights/carousel/BeatList.d.ts +10 -0
  170. package/dist/microinsights/carousel/CarouselControls.d.ts +1 -3
  171. package/dist/microinsights/carousel/CarouselHeader.d.ts +1 -2
  172. package/dist/microinsights/constants/App.d.ts +0 -1
  173. package/dist/microinsights/index.d.ts +3 -3
  174. package/dist/microinsights/index.es.js +7 -7
  175. package/dist/microinsights/interfaces.d.ts +0 -6
  176. package/dist/networth/components/NetWorthChange.d.ts +3 -1
  177. package/dist/networth/index.es.js +262 -254
  178. package/dist/notifications/index.es.js +90 -91
  179. package/dist/recurringtransactions/components/MicroWidgetContent.d.ts +3 -0
  180. package/dist/recurringtransactions/index.es.js +586 -562
  181. package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +1 -0
  182. package/dist/settings/index.es.js +371 -365
  183. package/dist/spending/index.es.js +267 -419
  184. package/dist/spending/utils/SpendingData.d.ts +2 -1
  185. package/dist/transactions/components/shared/TransactionDetails.d.ts +1 -0
  186. package/dist/transactions/components/shared/TransactionList.d.ts +1 -0
  187. package/dist/transactions/index.es.js +231 -226
  188. package/dist/transactions/stores/TransactionStore.d.ts +1 -1
  189. package/dist/transactions/stores/UiStore.d.ts +0 -2
  190. package/dist/trends/index.es.js +988 -612
  191. package/dist/{useAccountDisplayName-BUAApBIb.mjs → useAccountDisplayName-CcIp09Xc.mjs} +2 -2
  192. package/dist/{useCombineEvents-BUDIR1ba.mjs → useCombineEvents-kNzLTWCp.mjs} +3 -3
  193. package/dist/{useInsightsEnabled-DBpwEq10.mjs → useInsightsEnabled-CNjP5cfR.mjs} +1 -1
  194. package/dist/{useScreenSize-B6JyS_Lj.mjs → useScreenSize-B5afALev.mjs} +1 -1
  195. package/package.json +51 -56
  196. package/dist/AccountDetailsContent-CAM9y39M.mjs +0 -679
  197. package/dist/AccountDetailsHeader-JtSX6Uf9.mjs +0 -120
  198. package/dist/AccountListItem-JFMZROh7.mjs +0 -90
  199. package/dist/CurrencyInput-DUsQbkXb.mjs +0 -85
  200. package/dist/Drawer-kEE73B87.mjs +0 -113
  201. package/dist/FinstrongStore-F2c607dj.mjs +0 -101
  202. package/dist/HeaderCell-DjuifqHJ.mjs +0 -6
  203. package/dist/LineChart-D4GI7nVh.mjs +0 -541
  204. package/dist/Loader-DUaFpDGv.mjs +0 -24
  205. package/dist/MicroWidgetContainer-DpeqN9n3.mjs +0 -45
  206. package/dist/MiniWidgetContainer-D0gfmbaF.mjs +0 -56
  207. package/dist/SearchBox-B2_zLv8-.mjs +0 -42
  208. package/dist/TransactionApi-B3Tksf7L.mjs +0 -86
  209. package/dist/TransactionDetails-oP1eSuiS.mjs +0 -1334
  210. package/dist/TrendsStore-DCYbpXPO.mjs +0 -559
  211. package/dist/accounts/components/AccountsWidgetContent.d.ts +0 -3
  212. package/dist/common/components/barchart/Bar.d.ts +0 -25
  213. package/dist/common/components/barchart/BarChart.d.ts +0 -34
  214. package/dist/common/components/barchart/BarColumn.d.ts +0 -37
  215. package/dist/common/components/barchart/Legend.d.ts +0 -8
  216. package/dist/common/components/barchart/Util.d.ts +0 -42
  217. package/dist/common/components/barchart/index.d.ts +0 -1
  218. package/dist/common/hooks/usePrevious.d.ts +0 -2
  219. package/dist/exportTransactionsToCSV-7bVS7KXf.mjs +0 -47
  220. package/dist/finstrong/utils/Finstrong.d.ts +0 -6
  221. package/dist/transactions/components/shared/transactionlist/DateRow.d.ts +0 -7
  222. package/dist/useAriaLive-B3_pRUio.mjs +0 -35
@@ -1,1334 +0,0 @@
1
- import { jsxs as l, jsx as e } from "react/jsx-runtime";
2
- import _ from "react";
3
- import { observer as b } from "mobx-react-lite";
4
- import { useVirtualizer as ke } from "@tanstack/react-virtual";
5
- import w from "@mui/material/Box";
6
- import Z from "@mui/material/Divider";
7
- import J from "@mui/material/List";
8
- import { MerchantLogo as pe, Icon as S, Text as T, useTokens as ee, CategoryIcon as he, CategoryIconVariants as be, IconWeight as D, P as le, H1 as Ae, TextField as Te } from "@mxenabled/mxui";
9
- import B from "@mui/material/ListItemAvatar";
10
- import M from "@mui/material/ListItemText";
11
- import f from "@mui/material/Stack";
12
- import { T as Pe, L as Ge, O as h, C as Me, b as Ke, i as $e } from "./User-BQUxBeZV.mjs";
13
- import { G as Be, h as v, u as A, g as L, m as xe, b as Fe, p as He } from "./hooks-D6XlXHf4.mjs";
14
- import { f as te } from "./NumberFormatting-Buh7u8Oi.mjs";
15
- import { Receipt as ze, Delete as oe, ChevronRight as Ue, Cancel as ie, Search as Xe, Edit as Ve, Flag as We } from "@mxenabled/mx-icons";
16
- import { fromUnixTime as W } from "date-fns/fromUnixTime";
17
- import { isSameDay as Ne } from "date-fns/isSameDay";
18
- import { h as Ye } from "./DateUtil-BcuH7ErC.mjs";
19
- import { L as Ie } from "./Loader-DUaFpDGv.mjs";
20
- import { A as P } from "./WidgetContainer-BHWANqT4.mjs";
21
- import ne from "@mui/material/Paper";
22
- import ce from "@mui/material/Button";
23
- import je from "@mui/material/FormGroup";
24
- import Q from "@mui/material/IconButton";
25
- import De from "@mui/material/TextField";
26
- import qe from "@mui/material/ToggleButton";
27
- import ve from "@mui/material/styles/useTheme";
28
- import z from "@mui/material/Avatar";
29
- import F from "@mui/material/ListItem";
30
- import { a as V, f as Ee, D as Oe } from "./Dialog-CWW597AF.mjs";
31
- import U from "@mui/material/ListItemButton";
32
- import X from "@mui/material/ListItemIcon";
33
- import { a as we } from "./CategorySelectorDrawer-DUe4lH5-.mjs";
34
- import { b as se } from "./Localization-2MODESHW.mjs";
35
- import { getUnixTime as Ze } from "date-fns/getUnixTime";
36
- import { D as de } from "./Drawer-kEE73B87.mjs";
37
- import ye from "@mui/material/InputAdornment";
38
- import Je from "@mui/material/Checkbox";
39
- import ge from "@mui/material/Grid";
40
- import { C as Qe } from "./CurrencyInput-DUsQbkXb.mjs";
41
- import et from "@mui/material/Switch";
42
- var q = /* @__PURE__ */ ((t) => (t[t.Category = 0] = "Category", t[t.Date = 1] = "Date", t[t.Memo = 2] = "Memo", t[t.Tags = 3] = "Tags", t))(q || {}), re = /* @__PURE__ */ ((t) => (t[t.SplitTransaction = 0] = "SplitTransaction", t[t.HideTransaction = 1] = "HideTransaction", t[t.MerchantLogo = 2] = "MerchantLogo", t))(re || {});
43
- const tt = [
44
- 0,
45
- 1,
46
- 2,
47
- 3
48
- /* Tags */
49
- ], at = [
50
- 0,
51
- 1,
52
- 2
53
- /* MerchantLogo */
54
- ], G = () => {
55
- if (!_.useContext(Be))
56
- throw new Error("useTransactionsUiStore() must be used within the GlobalDataContext");
57
- return v().uiStore;
58
- };
59
- function nt() {
60
- return window.opener && window.opener.location ? window.opener.location.toString() : document.referrer;
61
- }
62
- function rt(t) {
63
- const r = nt().replace(/([^:]+:\/\/[^\/]+).*/, "$1"), a = window.parent || window.opener || !1;
64
- return a && a.postMessage && r ? (a.postMessage(t, r), !0) : !1;
65
- }
66
- function ot(t) {
67
- return rt({
68
- metadata: { beat_guid: t },
69
- mx: !0,
70
- type: "mx/moneyDashboard/insightOnTransaction"
71
- });
72
- }
73
- const it = ({ transaction: t, onClick: r }) => {
74
- const { associatedBeats: a } = v(), { expandedSplits: s } = G(), { transactions: o } = A(), { showInsights: n } = G(), c = t.transaction_type === Pe.CREDIT, d = _.useMemo(() => a.find((i) => i.associated_transaction_guid === t.guid), [a, t]);
75
- return (
76
- //TODO: implement common/components/ListItemRow.tsx
77
- /* @__PURE__ */ l(
78
- Ge,
79
- {
80
- clickEventName: h.ON_TRANSACTION_LIST_ITEM_CLICK,
81
- onClick: r ? () => r(t.guid) : void 0,
82
- children: [
83
- /* @__PURE__ */ e(B, { children: t.parent_guid && s.includes(t.parent_guid) ? /* @__PURE__ */ e(_.Fragment, {}) : /* @__PURE__ */ e(
84
- pe,
85
- {
86
- categoryGuid: t.top_level_category_guid || "",
87
- merchantGuid: t.merchant_guid || ""
88
- }
89
- ) }),
90
- /* @__PURE__ */ e(
91
- M,
92
- {
93
- disableTypography: !0,
94
- secondary: /* @__PURE__ */ l(f, { direction: "row", justifyContent: "space-between", children: [
95
- /* @__PURE__ */ l(f, { alignItems: "center", direction: "row", gap: 4, children: [
96
- t.is_flagged && /* @__PURE__ */ e(S, { fill: !0, name: "flag", size: 16, sx: { color: "warning.dark" } }),
97
- t.is_hidden && /* @__PURE__ */ e(S, { name: "visibility_off", size: 16 }),
98
- t.has_been_split && /* @__PURE__ */ e(S, { name: "call_split", size: 16 }),
99
- /* @__PURE__ */ e(T, { variant: "XSmall", children: t.has_been_split ? o.split_transaction_category_label : t.category })
100
- ] }),
101
- d && n && /* @__PURE__ */ e(
102
- T,
103
- {
104
- bold: !0,
105
- color: "action.active",
106
- onClick: (i) => {
107
- i.stopPropagation(), i.preventDefault(), ot(d.guid);
108
- },
109
- variant: "XSmall",
110
- children: d.short_title
111
- }
112
- )
113
- ] }),
114
- children: /* @__PURE__ */ l(f, { direction: "row", justifyContent: "space-between", sx: { gap: 8 }, children: [
115
- /* @__PURE__ */ l(T, { bold: !0, variant: "Body", children: [
116
- t.is_hidden && o.hide_trnx_cancel_hidden_note,
117
- t.payee || t.description || t.feed_description
118
- ] }),
119
- /* @__PURE__ */ l(
120
- T,
121
- {
122
- bold: !0,
123
- color: c ? "success.main" : "text.primary",
124
- sx: { flexShrink: 0 },
125
- variant: "Body",
126
- children: [
127
- c ? "+" : "",
128
- te(t.amount, "0,0.00")
129
- ]
130
- }
131
- )
132
- ] })
133
- }
134
- )
135
- ]
136
- }
137
- )
138
- );
139
- }, st = b(it), lt = ({
140
- bgcolor: t = "background.default",
141
- children: r
142
- }) => /* @__PURE__ */ e(w, { display: "inline-block", sx: { bgcolor: t, py: 4, width: "100%" }, children: /* @__PURE__ */ e(T, { bold: !0, sx: { pl: 24 }, variant: "XSmall", children: r }) }), ct = ({ showIcon: t = !0, showSubtitle: r = !0 }) => {
143
- const a = ee(), { transactions: s } = A();
144
- return /* @__PURE__ */ l(f, { alignItems: "center", gap: a.Spacing.Small, height: "auto", mt: a.Spacing.Large, children: [
145
- t && /* @__PURE__ */ e(ze, { color: "secondary", sx: { fontSize: 32 } }),
146
- /* @__PURE__ */ e(T, { bold: !0, color: "secondary", variant: "Small", children: s.zero_state_no_transactions }),
147
- r && /* @__PURE__ */ e(T, { color: "secondary", variant: "XSmall", children: s.zero_state_there_are_no_transactions })
148
- ] });
149
- }, dt = b(ct), Se = (t, r) => {
150
- const a = W(r[t].date), s = W(r[t - 1]?.date);
151
- return !Ne(a, s);
152
- }, _t = (t, r) => {
153
- const a = W(r[t].date), s = W(r[t + 1]?.date);
154
- return Ne(a, s);
155
- }, Ce = 65, fe = 34, ut = ({
156
- bgcolor: t,
157
- filter: r,
158
- height: a = "calc(100dvh - 36px)",
159
- loader: s = /* @__PURE__ */ e(Ie, { label: "Loading", size: 40 }),
160
- onClick: o,
161
- showInsights: n = !1,
162
- showLoader: c = !1,
163
- showHiddenTransactions: d = !1,
164
- width: i = "100%",
165
- zeroState: u = /* @__PURE__ */ e(dt, {})
166
- }) => {
167
- const { isLoading: m, sortedTransactions: g } = v(), p = _.useMemo(() => {
168
- const I = r ? g.filter(r) : g;
169
- return d ? I : I.filter((k) => !k.is_hidden);
170
- }, [g, d]), { clearExpandedSplits: x, setShowInsights: y, toggleSplit: N } = G(), { onEvent: C } = L(), R = (I) => {
171
- const k = p.find((Y) => Y.guid === I);
172
- if (k?.has_been_split) {
173
- N(k.guid);
174
- return;
175
- }
176
- C(P.ACCOUNT_DETAILS_CLICK_TRANSACTION, {
177
- account_guid: k?.account_guid,
178
- transaction_guid: I
179
- }), o?.(I);
180
- }, K = _.useRef(null), $ = ke({
181
- count: p.length,
182
- getScrollElement: () => K.current,
183
- estimateSize: (I) => Ce + (Se(I, p) ? fe : 0),
184
- overscan: 5
185
- });
186
- return _.useEffect(() => $.measure(), [p]), _.useEffect(() => y(n), [n]), _.useEffect(() => () => x(), []), /* @__PURE__ */ e(J, { sx: { width: i }, children: /* @__PURE__ */ e(w, { height: a, overflow: "auto", ref: K, width: i, children: /* @__PURE__ */ l(
187
- w,
188
- {
189
- height: (
190
- // set the height to auto when there are no transactions so the zero state isn't set to 0
191
- $.getVirtualItems().length === 0 ? "auto" : $.getTotalSize()
192
- ),
193
- position: "relative",
194
- width: "100%",
195
- children: [
196
- (m || c) && s,
197
- !m && !c && $.getVirtualItems().length === 0 && u,
198
- !m && !c && $.getVirtualItems().length > 0 && $.getVirtualItems().map((I) => {
199
- const k = p[I.index], Y = Se(I.index, p), _e = _t(I.index, p), ue = Ce + (Y ? fe : 0);
200
- return /* @__PURE__ */ l(
201
- w,
202
- {
203
- sx: {
204
- height: ue,
205
- position: "absolute",
206
- transform: `translateY(${I.start}px)`,
207
- width: "100%"
208
- },
209
- children: [
210
- Y && /* @__PURE__ */ e(lt, { bgcolor: t, children: Ye(k.date) }),
211
- /* @__PURE__ */ e(st, { onClick: R, transaction: k }),
212
- /* @__PURE__ */ e(Z, { sx: { ml: _e ? 24 : 0 } })
213
- ]
214
- },
215
- k.guid
216
- );
217
- })
218
- ]
219
- }
220
- ) }) });
221
- }, Ra = b(ut), mt = ({ transaction: t }) => {
222
- const { addOrUpdateTransactionRule: r, updateTransaction: a } = v(), { categories: s } = xe(), { onEvent: o } = L(), { setShouldDisableDrawerScroll: n, updateManualTransaction: c } = G(), { transactions: d } = A(), [i, u] = _.useState(!1), [m, g] = _.useState(""), p = async (C) => {
223
- await a({ ...t, category_guid: m }), C && await r(m, t), g(""), o(P.TRANSACTION_DETAILS_CLICK_CATEGORY, {
224
- transaction_guid: t.guid
225
- });
226
- }, x = (C) => {
227
- if (t.is_manual && !t.guid) {
228
- const R = s.find((K) => K.guid === C);
229
- c({
230
- ...t,
231
- category: R?.name,
232
- category_guid: C,
233
- top_level_category_guid: R?.parent_guid || C
234
- });
235
- } else
236
- g(C);
237
- y();
238
- }, y = () => {
239
- u(!1), n(!1);
240
- }, N = _.useMemo(
241
- () => s.find((C) => C.guid === m),
242
- [m]
243
- );
244
- return /* @__PURE__ */ l(_.Fragment, { children: [
245
- /* @__PURE__ */ e(F, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ l(
246
- U,
247
- {
248
- onClick: () => {
249
- o(h.ON_TRANSACTION_CATEGORY_CLICK), u(!0);
250
- },
251
- children: [
252
- /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(z, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ e(
253
- he,
254
- {
255
- categoryGuid: t.top_level_category_guid,
256
- size: 24,
257
- sx: { color: "text.primary" },
258
- variant: be.Transparent
259
- }
260
- ) }) }),
261
- /* @__PURE__ */ e(
262
- M,
263
- {
264
- primary: d.category_title,
265
- primaryTypographyProps: { variant: "XSmall" },
266
- secondary: /* @__PURE__ */ e(T, { bold: !0, variant: "Body", children: t.category ?? d.actions_select_a_category })
267
- }
268
- ),
269
- /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(S, { name: "chevron_right", weight: D.Dark }) })
270
- ]
271
- }
272
- ) }),
273
- /* @__PURE__ */ e(
274
- we,
275
- {
276
- initialSelected: t.category_guid,
277
- onClose: y,
278
- onSelect: x,
279
- showDrawer: i,
280
- title: d.actions_select_a_category
281
- }
282
- ),
283
- /* @__PURE__ */ e(
284
- V,
285
- {
286
- copy: {
287
- title: se(
288
- d.actions_apply_to_all_transaction_types,
289
- t.description
290
- )
291
- },
292
- isOpen: !!m,
293
- onClose: () => g(""),
294
- onPrimaryAction: () => p(!0),
295
- onSecondaryAction: () => p(!1),
296
- primaryText: d.actions_apply_to_all,
297
- secondaryText: d.actions_this_time_only,
298
- children: /* @__PURE__ */ e(le, { variant: "Paragraph", children: se(
299
- d.actions_all_past_and_future,
300
- t.description,
301
- N?.name
302
- ) })
303
- }
304
- )
305
- ] });
306
- }, gt = ({ transaction: t }) => {
307
- const r = ee(), { onEvent: a } = L(), { updateTransaction: s } = v(), { updateManualTransaction: o } = G(), { common: n, transactions: c } = A(), [d, i] = _.useState(!1), [u, m] = _.useState(t.date), g = (x) => {
308
- m(Ze(x));
309
- }, p = async () => {
310
- if (t.is_manual && !t.guid) {
311
- o({ ...t, date: u }), i(!1);
312
- return;
313
- }
314
- await s({ ...t, date: u }), a(P.TRANSACTION_DETAILS_CLICK_DATE, { transaction_guid: t.guid }), i(!1);
315
- };
316
- return /* @__PURE__ */ l(w, { className: "mx-txn-date-action", children: [
317
- /* @__PURE__ */ e(F, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ l(
318
- U,
319
- {
320
- onClick: () => {
321
- a(h.ON_TRANSACTION_DATE_CLICK), i(!0);
322
- },
323
- children: [
324
- /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(z, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ e(S, { name: "calendar_month", sx: { color: "text.primary" }, weight: D.Dark }) }) }),
325
- /* @__PURE__ */ e(
326
- M,
327
- {
328
- primary: c.date_title,
329
- primaryTypographyProps: { variant: "XSmall" },
330
- secondary: /* @__PURE__ */ e(T, { bold: !0, variant: "Body", children: Ee(W(t.date), Oe.YEAR_MONTH_DAY) })
331
- }
332
- ),
333
- /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(S, { name: "chevron_right", weight: D.Dark }) })
334
- ]
335
- }
336
- ) }),
337
- /* @__PURE__ */ e(
338
- de,
339
- {
340
- ariaLabelClose: n.close_aria,
341
- isOpen: d,
342
- onClose: () => i(!1),
343
- onPrimaryAction: p,
344
- primaryText: n.save_button,
345
- secondaryText: n.cancel_button,
346
- title: c.date_edit_title,
347
- children: /* @__PURE__ */ e(f, { alignItems: "center", mt: r.Spacing.XXLarge, children: /* @__PURE__ */ e(
348
- Me,
349
- {
350
- beginDate: W(u),
351
- copy: {
352
- nextAria: c.date_next_aria,
353
- prevAria: c.date_prev_aria,
354
- today: n.date_range_picker.today
355
- },
356
- onDateSelected: g,
357
- selectionType: Ke.Single
358
- }
359
- ) })
360
- }
361
- )
362
- ] });
363
- }, pt = ({ transaction: t }) => {
364
- const { onEvent: r } = L(), { removeTransaction: a } = v(), { setShouldDisableDrawerScroll: s } = G(), { common: o, transactions: n } = A(), [c, d] = _.useState(!1), i = async () => {
365
- await a(t.guid), r(h.ON_TRANSACTION_DELETE_DELETED);
366
- };
367
- return /* @__PURE__ */ l(w, { className: "mx-txn-delete", children: [
368
- t && /* @__PURE__ */ e(F, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ l(
369
- U,
370
- {
371
- onClick: () => {
372
- r(h.ON_TRANSACTION_DELETE_CLICK), s(!0), d(!0);
373
- },
374
- children: [
375
- /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(z, { variant: "rounded", children: /* @__PURE__ */ e(oe, { color: "secondary", fontSize: "small" }) }) }),
376
- /* @__PURE__ */ e(
377
- M,
378
- {
379
- primary: n.manual_transaction_delete_title,
380
- secondary: n.manual_transaction_delete_subtitle
381
- }
382
- ),
383
- /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(oe, {}) })
384
- ]
385
- }
386
- ) }),
387
- /* @__PURE__ */ e(
388
- V,
389
- {
390
- copy: { title: n.manual_transaction_delete_title },
391
- isOpen: c,
392
- onClose: () => {
393
- s(!1), d(!1);
394
- },
395
- onPrimaryAction: i,
396
- onSecondaryAction: () => r(h.ON_TRANSACTION_DELETE_CANCEL),
397
- primaryText: o.delete_button,
398
- secondaryText: o.cancel_button,
399
- children: /* @__PURE__ */ e(T, { sx: { whiteSpace: "normal" }, variant: "Paragraph", children: n.manual_transaction_delete_description })
400
- }
401
- )
402
- ] });
403
- }, ht = b(pt), Tt = ({ transaction: t }) => {
404
- const { onEvent: r } = L(), { updateTransaction: a } = v(), { setShouldDisableDrawerScroll: s } = G(), { common: o, transactions: n } = A(), [c, d] = _.useState(!1), i = async () => {
405
- await a({ ...t, merchant_guid: "" }), r(P.TRANSACTION_DETAILS_CLICK_DELETE_LOGO, {
406
- transaction_guid: t.guid
407
- });
408
- };
409
- return /* @__PURE__ */ l(w, { className: "mx-txn-delete-logo", children: [
410
- t && /* @__PURE__ */ e(F, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ l(
411
- U,
412
- {
413
- onClick: () => {
414
- r(h.ON_TRANSACTION_DELETE_LOGO_CLICK), d(!0);
415
- },
416
- children: [
417
- /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(z, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ e(S, { name: "delete", sx: { color: "text.primary" }, weight: D.Dark }) }) }),
418
- /* @__PURE__ */ e(M, { primary: n.merchant_logo_title, secondary: n.merchant_logo_desc }),
419
- /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(S, { name: "chevron_right", weight: D.Dark }) })
420
- ]
421
- }
422
- ) }),
423
- /* @__PURE__ */ l(
424
- V,
425
- {
426
- copy: { title: n.merchant_logo_modal_title },
427
- isOpen: c,
428
- onClose: () => {
429
- s(!1), d(!1);
430
- },
431
- onPrimaryAction: i,
432
- onSecondaryAction: () => r(h.ON_TRANSACTION_DELETE_LOGO_CANCEL),
433
- primaryText: o.delete_button,
434
- secondaryText: o.cancel_button,
435
- title: n.merchant_logo_modal_title,
436
- children: [
437
- /* @__PURE__ */ e(T, { sx: { whiteSpace: "normal" }, variant: "Paragraph", children: n.merchant_logo_modal_desc }),
438
- /* @__PURE__ */ e(T, { bold: !0, sx: { whiteSpace: "normal" }, variant: "Paragraph", children: ` ${n.merchant_logo_modal_desc_bold}` })
439
- ]
440
- }
441
- )
442
- ] });
443
- }, yt = b(Tt), St = ({ transaction: t }) => {
444
- const { onEvent: r } = L(), { updateTransaction: a } = v(), { setShouldDisableDrawerScroll: s } = G(), { common: o, transactions: n } = A(), [c, d] = _.useState(!1), i = t.is_hidden, u = async () => {
445
- await a({ ...t, is_hidden: !t.is_hidden }), r(
446
- i ? h.ON_TRANSACTION_UNHIDDEN : h.ON_TRANSACTION_HIDDEN
447
- );
448
- };
449
- return /* @__PURE__ */ l(w, { className: "mx-txn-hide-transaction", children: [
450
- t && /* @__PURE__ */ e(F, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ l(
451
- U,
452
- {
453
- "aria-checked": i,
454
- onClick: () => {
455
- r(
456
- i ? h.ON_TRANSACTION_UNHIDE_CLICK : h.ON_TRANSACTION_HIDE_CLICK
457
- ), r(
458
- i ? "transaction_details_click_unhide_transaction" : "transaction_details_click_hide_transaction",
459
- {
460
- transaction_guid: t.guid
461
- }
462
- ), d(!0);
463
- },
464
- role: "switch",
465
- children: [
466
- /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(z, { sx: { bgcolor: "border.light" }, variant: "rounded", children: i ? /* @__PURE__ */ e(
467
- S,
468
- {
469
- name: "visibilityOff",
470
- sx: { color: "text.primary" },
471
- weight: D.Dark
472
- }
473
- ) : /* @__PURE__ */ e(S, { name: "visibility", sx: { color: "text.primary" }, weight: D.Dark }) }) }),
474
- /* @__PURE__ */ e(
475
- M,
476
- {
477
- primary: i ? n.hide_trnx_subtitle_unhide_trnx : n.hide_trnx_subtitle_hide_trnx,
478
- secondary: i ? n.hide_trnx_desc_unhiding : n.hide_trnx_desc_hiding
479
- }
480
- ),
481
- /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(
482
- et,
483
- {
484
- checked: i,
485
- id: "hide-transaction",
486
- name: "hide-transaction",
487
- tabIndex: -1
488
- }
489
- ) })
490
- ]
491
- }
492
- ) }),
493
- /* @__PURE__ */ e(
494
- V,
495
- {
496
- copy: {
497
- title: i ? n.hide_trnx_subtitle_unhide_trnx : n.hide_trnx_subtitle_hide_trnx
498
- },
499
- isOpen: c,
500
- onClose: () => {
501
- s(!1), d(!1);
502
- },
503
- onPrimaryAction: u,
504
- onSecondaryAction: () => r(
505
- i ? h.ON_TRANSACTION_UNHIDE_CANCEL_CLICK : h.ON_TRANSACTION_HIDE_CANCEL_CLICK
506
- ),
507
- primaryText: i ? o.unhide_button : o.hide_button,
508
- secondaryText: o.cancel_button,
509
- children: /* @__PURE__ */ e(T, { truncate: !1, variant: "Paragraph", children: i ? n.hide_trnx_desc_unhiding : n.hide_trnx_desc_hiding })
510
- }
511
- )
512
- ] });
513
- }, Ct = b(St), Le = ({ transaction: t }) => {
514
- const { amount: r, description: a, isIncome: s, merchant_guid: o, payee: n, top_level_category_guid: c } = t;
515
- return /* @__PURE__ */ l(f, { className: "mx-txn-amount-header", direction: "row", gap: 12, px: 16, py: 24, children: [
516
- /* @__PURE__ */ e(
517
- pe,
518
- {
519
- categoryGuid: c || "",
520
- merchantGuid: o || "",
521
- size: 64
522
- }
523
- ),
524
- /* @__PURE__ */ l(f, { overflow: "hidden'", children: [
525
- /* @__PURE__ */ e(T, { bold: !0, mb: 4, truncate: !0, variant: "Body", children: a || n }),
526
- /* @__PURE__ */ l(Ae, { color: s ? "success.main" : "text.primary", truncate: !0, children: [
527
- s ? "+" : "",
528
- te(r, "0,0.00")
529
- ] })
530
- ] })
531
- ] });
532
- }, ft = ({ transaction: t }) => {
533
- const { onEvent: r } = L(), { updateTransaction: a } = v(), { updateManualTransaction: s } = G(), { common: o, transactions: n } = A(), [c, d] = _.useState(!1), [i, u] = _.useState("");
534
- _.useEffect(() => {
535
- c && u(t.memo ? t.memo : "");
536
- }, [c]);
537
- const m = async () => {
538
- if (t.is_manual && !t.guid) {
539
- s({ ...t, memo: i }), d(!1);
540
- return;
541
- }
542
- await a({ ...t, memo: i }), r(P.TRANSACTION_DETAILS_CLICK_MEMO, { transaction_guid: t.guid }), d(!1);
543
- };
544
- return /* @__PURE__ */ l("div", { className: "mx-txn-memo-action", children: [
545
- /* @__PURE__ */ e(F, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ l(
546
- U,
547
- {
548
- onClick: () => {
549
- r(h.ON_TRANSACTION_MEMO_CLICK), d(!0);
550
- },
551
- children: [
552
- /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(z, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ e(S, { name: "article", sx: { color: "text.primary" }, weight: D.Dark }) }) }),
553
- /* @__PURE__ */ e(
554
- M,
555
- {
556
- primary: n.memo_title,
557
- primaryTypographyProps: { variant: "XSmall" },
558
- secondary: /* @__PURE__ */ e(
559
- T,
560
- {
561
- bold: !0,
562
- sx: { overflowWrap: "break-word", whiteSpace: "wrap" },
563
- variant: "Body",
564
- children: t.memo ? t.memo : n.memo_desc
565
- }
566
- )
567
- }
568
- ),
569
- /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(S, { name: "chevron_right", weight: D.Dark }) })
570
- ]
571
- }
572
- ) }),
573
- /* @__PURE__ */ l(
574
- de,
575
- {
576
- ariaLabelClose: o.close_aria,
577
- isOpen: c,
578
- onClose: () => d(!1),
579
- onPrimaryAction: m,
580
- title: n.memo_title,
581
- children: [
582
- /* @__PURE__ */ e(Le, { transaction: t }),
583
- /* @__PURE__ */ e(
584
- De,
585
- {
586
- "aria-label": n.memo_desc_aria,
587
- focused: !0,
588
- fullWidth: !0,
589
- multiline: !0,
590
- name: "memo",
591
- onChange: (g) => u(g.target.value),
592
- placeholder: n.memo_desc,
593
- rows: 4,
594
- sx: { px: 16 },
595
- value: i
596
- }
597
- )
598
- ]
599
- }
600
- )
601
- ] });
602
- }, bt = b(ft), At = ({
603
- index: t,
604
- onDeleteRow: r,
605
- onCategoryChanged: a,
606
- onUpdateAmount: s,
607
- split: o
608
- }) => {
609
- const n = ee(), { onEvent: c } = L(), { transactions: d } = A(), [i, u] = _.useState(`${o.amount}`), [m, g] = _.useState(!1), p = t === 0, x = (y) => {
610
- isNaN(Number(y)) || (u(y), s(t, Number(y)));
611
- };
612
- return /* @__PURE__ */ l(
613
- w,
614
- {
615
- bgcolor: "background.paper",
616
- className: "mx-txn-split-manager-row",
617
- pb: n.Spacing.Tiny,
618
- px: n.Spacing.XSmall,
619
- children: [
620
- /* @__PURE__ */ l(ge, { alignItems: p ? "center" : "start", container: !0, children: [
621
- /* @__PURE__ */ e(ge, { item: !0, xs: 7, children: /* @__PURE__ */ l(f, { alignItems: "start", children: [
622
- /* @__PURE__ */ e(
623
- ce,
624
- {
625
- endIcon: /* @__PURE__ */ e(Ue, {}),
626
- onClick: () => g(!0),
627
- startIcon: /* @__PURE__ */ e(he, { categoryGuid: o.top_level_category_guid }),
628
- sx: { px: n.Spacing.Small, py: n.Spacing.XSmall },
629
- children: o.category
630
- }
631
- ),
632
- /* @__PURE__ */ e(w, { children: !o.category_guid && /* @__PURE__ */ l(
633
- f,
634
- {
635
- color: "error.main",
636
- direction: "row",
637
- gap: n.Spacing.XSmall,
638
- p: n.Spacing.Small,
639
- children: [
640
- /* @__PURE__ */ e(ie, { sx: { fontSize: n.FontSize.Body } }),
641
- /* @__PURE__ */ e(T, { variant: "Small", children: d.split_transaction_errors_select_category })
642
- ]
643
- }
644
- ) })
645
- ] }) }),
646
- /* @__PURE__ */ e(ge, { item: !0, xs: 5, children: p ? /* @__PURE__ */ e("div", { className: "mx-txn-split-manager-row-top-container", children: /* @__PURE__ */ e(T, { children: te(o.amount, "0,0.00") }) }) : /* @__PURE__ */ l(f, { alignItems: "start", children: [
647
- /* @__PURE__ */ l(f, { alignItems: "start", direction: "row", gap: n.Spacing.XSmall, children: [
648
- /* @__PURE__ */ e(
649
- Qe,
650
- {
651
- amount: i,
652
- ariaLabel: d.split_transaction_edit_split_amount,
653
- name: "split-amount-input",
654
- setAmount: x,
655
- sx: {
656
- ".MuiOutlinedInput-input": { p: n.Spacing.Small }
657
- },
658
- type: "number"
659
- }
660
- ),
661
- /* @__PURE__ */ e(
662
- Q,
663
- {
664
- "aria-label": d.split_transaction_delete_split_btn,
665
- color: "secondary",
666
- onClick: () => {
667
- c(h.ON_TRANSACTION_SPLIT_DELETE_CLICK), r(t);
668
- },
669
- sx: { w: 44, h: 44 },
670
- children: /* @__PURE__ */ e(oe, {})
671
- }
672
- )
673
- ] }),
674
- !i && /* @__PURE__ */ l(
675
- f,
676
- {
677
- color: "error.main",
678
- direction: "row",
679
- gap: n.Spacing.XSmall,
680
- py: n.Spacing.Small,
681
- children: [
682
- /* @__PURE__ */ e(ie, { sx: { fontSize: n.FontSize.Body } }),
683
- /* @__PURE__ */ e(T, { variant: "Small", children: d.split_transaction_errors_enter_an_amount })
684
- ]
685
- }
686
- )
687
- ] }) })
688
- ] }),
689
- /* @__PURE__ */ e(
690
- we,
691
- {
692
- initialSelected: o.category_guid,
693
- onClose: () => g(!1),
694
- onSelect: (y) => {
695
- a(t, y), g(!1);
696
- },
697
- showDrawer: m,
698
- title: d.actions_select_a_category
699
- }
700
- )
701
- ]
702
- }
703
- );
704
- }, xt = b(At), Nt = ({
705
- onAddSplit: t,
706
- onCategoryChanged: r,
707
- onDeleteSplit: a,
708
- onUpdateAmount: s,
709
- splits: o,
710
- transaction: n
711
- }) => {
712
- const c = ee(), { transactions: d } = A(), { onEvent: i } = L(), [u, m] = _.useState("");
713
- return _.useEffect(() => {
714
- m(o.length <= 1 ? d.split_transaction_errors_min_splits : ""), m(
715
- o[0].amount < 0 ? se(
716
- d.split_transaction_errors_totals_must_equal_amount,
717
- te(n.amount, "0,0.00")
718
- ) : ""
719
- );
720
- }, [o]), /* @__PURE__ */ l(w, { className: "mx-txn-split-manager", children: [
721
- o.map((g, p) => /* @__PURE__ */ e(
722
- xt,
723
- {
724
- index: p,
725
- onCategoryChanged: r,
726
- onDeleteRow: a,
727
- onUpdateAmount: s,
728
- split: g
729
- },
730
- p
731
- )),
732
- u && /* @__PURE__ */ l(
733
- f,
734
- {
735
- color: "error.main",
736
- direction: "row",
737
- gap: c.Spacing.XSmall,
738
- p: c.Spacing.Medium,
739
- children: [
740
- /* @__PURE__ */ e(ie, { sx: { fontSize: c.FontSize.Body } }),
741
- /* @__PURE__ */ e(T, { variant: "Small", children: u })
742
- ]
743
- }
744
- ),
745
- /* @__PURE__ */ e(w, { p: c.Spacing.Medium, children: /* @__PURE__ */ e(
746
- ce,
747
- {
748
- "aria-label": d.split_transaction_add_split_btn,
749
- onClick: () => {
750
- i(h.ON_TRANSACTION_SPLIT_ADD_CLICK), t();
751
- },
752
- children: d.split_transaction_add_split_btn
753
- }
754
- ) })
755
- ] });
756
- }, It = b(Nt), Dt = ({ transaction: t }) => {
757
- const { onEvent: r } = L(), { splitTransaction: a, unSplitTransaction: s } = v(), { common: o, transactions: n } = A(), { setShouldDisableDrawerScroll: c } = G(), { categories: d } = xe(), i = {
758
- ...t,
759
- amount: t.amount - 1,
760
- guid: "",
761
- has_been_split: !1,
762
- parent_guid: t.guid
763
- }, u = {
764
- ...t,
765
- amount: 1,
766
- category_guid: void 0,
767
- category: n.split_transaction_select_category_btn,
768
- guid: "",
769
- has_been_split: !1,
770
- parent_guid: t.guid,
771
- top_level_category_guid: void 0
772
- }, [m, g] = _.useState(!1), [p, x] = _.useState(!1), [y, N] = _.useState([]), C = () => {
773
- const E = [...y];
774
- E.push({ ...u }), E[0].amount -= 1, N(E);
775
- }, R = (E) => {
776
- if (E > 0) {
777
- const H = y[E], O = [...y];
778
- O.splice(E, 1), O[0].amount += H.amount, N(O);
779
- }
780
- }, K = (E, H) => {
781
- const O = [...y];
782
- O[E].amount = H, O[0].amount = t.amount - O.reduce(
783
- (j, me, Re) => j + (Re !== 0 ? me.amount : 0),
784
- 0
785
- ), N(O);
786
- }, $ = (E, H) => {
787
- const O = [...y], j = d.find((me) => me.guid === H);
788
- j && (O[E] = {
789
- ...O[E],
790
- category_guid: H,
791
- category: j.name,
792
- top_level_category_guid: j.parent_guid || H
793
- }, N(O));
794
- }, I = () => {
795
- if (t.parent_guid || t.has_been_split) {
796
- x(!0);
797
- return;
798
- }
799
- N([{ ...i }, { ...u }]), r(P.TRANSACTION_DETAILS_CLICK_SPLIT, {
800
- transaction_guid: t.guid
801
- }), g(!0);
802
- }, k = async () => {
803
- r(h.ON_TRANSACTION_SPLIT_SAVE_CLICK), await a({ ...t, has_been_split: !0 }, y), g(!1);
804
- }, Y = async () => {
805
- r(h.ON_TRANSACTION_SPLIT_CANCEL_CLICK), N([{ ...i }, { ...u }]), g(!1);
806
- }, _e = async () => {
807
- r(P.TRANSACTION_DETAILS_CLICK_UNSPLIT, {
808
- transaction_guid: t.guid
809
- });
810
- const E = t.parent_guid ?? t.guid;
811
- await s(E);
812
- }, ue = _.useMemo(() => {
813
- const E = y.some((O) => !O.category_guid), H = y.some((O) => O.amount <= 0);
814
- return E || H;
815
- }, [y]);
816
- return /* @__PURE__ */ l(_.Fragment, { children: [
817
- t && /* @__PURE__ */ e(F, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ l(U, { onClick: I, children: [
818
- /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(z, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ e(S, { name: "call_split", sx: { color: "text.primary" }, weight: D.Dark }) }) }),
819
- /* @__PURE__ */ e(
820
- M,
821
- {
822
- primary: t.has_been_split || t.parent_guid ? n.split_transaction_unsplit_title : n.split_transaction_title,
823
- secondary: t.has_been_split || t.parent_guid ? n.split_transaction_unsplit_subtitle : n.split_transaction_desc
824
- }
825
- ),
826
- /* @__PURE__ */ e(X, { children: t.has_been_split || t.parent_guid ? /* @__PURE__ */ e(S, { name: "delete", weight: D.Dark }) : /* @__PURE__ */ e(S, { name: "chevron_right", weight: D.Dark }) })
827
- ] }) }),
828
- /* @__PURE__ */ l(
829
- de,
830
- {
831
- ariaLabelClose: o.close_aria,
832
- isOpen: m,
833
- isPrimaryDisabled: ue,
834
- onClose: Y,
835
- onPrimaryAction: k,
836
- primaryText: o.save_button,
837
- secondaryText: o.cancel_button,
838
- title: n.split_transaction_title,
839
- children: [
840
- /* @__PURE__ */ e(Le, { transaction: t }),
841
- /* @__PURE__ */ e(
842
- It,
843
- {
844
- onAddSplit: C,
845
- onCategoryChanged: $,
846
- onDeleteSplit: R,
847
- onUpdateAmount: K,
848
- splits: y,
849
- transaction: t
850
- }
851
- )
852
- ]
853
- }
854
- ),
855
- /* @__PURE__ */ e(
856
- V,
857
- {
858
- copy: { title: n.split_transaction_unsplit_title },
859
- isOpen: p,
860
- onClose: () => {
861
- c(!1), x(!1);
862
- },
863
- onPrimaryAction: _e,
864
- onSecondaryAction: () => {
865
- r(h.ON_TRANSACTION_UNSPLIT_CANCEL);
866
- },
867
- primaryText: o.delete_button,
868
- secondaryText: o.cancel_button,
869
- children: /* @__PURE__ */ e(le, { variant: "Paragraph", children: se(
870
- n.split_transaction_unsplit_description,
871
- t.description
872
- ) })
873
- }
874
- )
875
- ] });
876
- }, vt = b(Dt), Et = () => {
877
- const t = ve(), { onEvent: r } = L(), { addTag: a } = v(), { transactions: s } = A(), [o, n] = _.useState(!1), [c, d] = _.useState(""), [i, u] = _.useState(""), m = _.useRef(null);
878
- _.useEffect(() => {
879
- o && m?.current?.focus();
880
- }, [o]);
881
- const g = () => {
882
- r(
883
- o ? h.ON_TRANSACTION_TAGS_TAG_ADD_CANCEL_CLICK : h.ON_TRANSACTION_TAGS_TAG_ADD_CLICK
884
- ), o || d(""), n(!o);
885
- }, p = async () => {
886
- r(h.ON_TRANSACTION_TAGS_TAG_ADDED), await a(c), n(!1);
887
- };
888
- return _.useEffect(() => {
889
- u(c.length > 40 ? s.tags_error_name_must_be_40_chars : "");
890
- }, [c]), /* @__PURE__ */ l(w, { className: "mx-txn-tag-manager-header", children: [
891
- /* @__PURE__ */ l(
892
- f,
893
- {
894
- alignItems: "center",
895
- bgcolor: t.palette.background.default,
896
- direction: "row",
897
- justifyContent: "space-between",
898
- px: 24,
899
- py: 16,
900
- children: [
901
- /* @__PURE__ */ e(T, { bold: !0, children: s.tags_your_tags }),
902
- /* @__PURE__ */ e(
903
- ce,
904
- {
905
- "aria-expanded": o,
906
- "aria-label": s.tags_add_tag_btn_aria,
907
- onClick: g,
908
- children: s.tags_add_tag_btn
909
- }
910
- )
911
- ]
912
- }
913
- ),
914
- /* @__PURE__ */ l(
915
- V,
916
- {
917
- copy: { title: s.tags_add_tag_btn },
918
- isOpen: o,
919
- onClose: () => n(!1),
920
- onPrimaryAction: p,
921
- onSecondaryAction: () => n(!1),
922
- children: [
923
- /* @__PURE__ */ e(
924
- Te,
925
- {
926
- "aria-label": s.tags_placeholder,
927
- name: "add-tag",
928
- onChange: (x) => d(x.target.value),
929
- placeholder: s.tags_placeholder,
930
- sx: { width: "100%" },
931
- value: c
932
- }
933
- ),
934
- /* @__PURE__ */ e(le, { id: "add-tag-error", sx: { color: "error.main" }, variant: "ParagraphSmall", children: i })
935
- ]
936
- }
937
- )
938
- ] });
939
- }, Ot = b(Et), wt = ({ onSearchValueChanged: t, searchValue: r }) => {
940
- const { common: a, transactions: s } = A(), o = ee(), n = /* @__PURE__ */ e(
941
- Q,
942
- {
943
- "aria-label": s.tags_cancel_search || "Search",
944
- onClick: () => t(""),
945
- children: /* @__PURE__ */ e(ie, {})
946
- }
947
- );
948
- return /* @__PURE__ */ e(w, { className: "mx-txn-tag-manager-search", px: o.Spacing.Large, py: o.Spacing.Medium, children: /* @__PURE__ */ e(
949
- Te,
950
- {
951
- InputProps: {
952
- startAdornment: /* @__PURE__ */ e(ye, { position: "start", children: /* @__PURE__ */ e(Xe, { color: "disabled" }) }),
953
- endAdornment: /* @__PURE__ */ e(ye, { position: "end", sx: { padding: 0 }, children: r ? n : null })
954
- },
955
- "aria-label": a.search_aria,
956
- name: "search",
957
- onChange: (c) => t(c.target.value),
958
- placeholder: a.search_placeholder,
959
- sx: { bgcolor: "background.paper", width: "100%" },
960
- value: r
961
- }
962
- ) });
963
- }, Lt = b(wt), Rt = ({ onTagChecked: t, selectedTags: r, tag: a }) => {
964
- const { onEvent: s } = L(), { removeTag: o, updateTag: n } = v(), { common: c, transactions: d } = A(), [i, u] = _.useState(!1), [m, g] = _.useState(!1), [p, x] = _.useState(""), [y, N] = _.useState(""), C = async () => {
965
- s(h.ON_TRANSACTION_TAGS_TAG_EDIT_SAVED), a && await n({ ...a, name: p }), u(!1);
966
- }, R = async () => {
967
- s(h.ON_TRANSACTION_TAGS_TAG_DELETED), await o(a.guid), g(!1);
968
- };
969
- _.useEffect(() => {
970
- N(p.length > 40 ? d.tags_error_name_must_be_40_chars : "");
971
- }, [p]);
972
- const K = () => {
973
- s(h.ON_TRANSACTION_TAGS_TAG_EDIT_CLICK), x(a.name), u(!0);
974
- }, $ = () => {
975
- s(h.ON_TRANSACTION_TAGS_TAG_DELETE_CLICK), g(!0);
976
- };
977
- return /* @__PURE__ */ l(
978
- F,
979
- {
980
- className: "mx-txn-transaction-manager-row",
981
- disableGutters: !0,
982
- disablePadding: !0,
983
- secondaryAction: !a.is_default_tag && /* @__PURE__ */ l(f, { direction: "row", children: [
984
- /* @__PURE__ */ e(
985
- Q,
986
- {
987
- "aria-label": `Edit ${a.name} tag`,
988
- color: "secondary",
989
- onClick: K,
990
- children: /* @__PURE__ */ e(Ve, { color: "secondary" })
991
- }
992
- ),
993
- /* @__PURE__ */ e(
994
- Q,
995
- {
996
- "aria-label": `Delete ${a.name} tag`,
997
- color: "secondary",
998
- onClick: $,
999
- children: /* @__PURE__ */ e(oe, { color: "secondary" })
1000
- }
1001
- )
1002
- ] }),
1003
- children: [
1004
- /* @__PURE__ */ l(
1005
- U,
1006
- {
1007
- "aria-checked": r.includes(a.guid),
1008
- onClick: () => t(a.guid),
1009
- role: "checkbox",
1010
- children: [
1011
- /* @__PURE__ */ e(X, { sx: { ml: 0 }, children: /* @__PURE__ */ e(Je, { checked: r.includes(a.guid), edge: "start", tabIndex: -1 }) }),
1012
- /* @__PURE__ */ e(M, { children: a.name })
1013
- ]
1014
- }
1015
- ),
1016
- /* @__PURE__ */ l(
1017
- V,
1018
- {
1019
- copy: { title: "Update tag name" },
1020
- isOpen: i,
1021
- onClose: () => u(!1),
1022
- onPrimaryAction: C,
1023
- onSecondaryAction: () => u(!1),
1024
- children: [
1025
- /* @__PURE__ */ e(
1026
- Te,
1027
- {
1028
- "aria-describedby": y ? "update-tag-error" : void 0,
1029
- "aria-label": d.tags_update_the_tag_name,
1030
- name: "update-tag",
1031
- onChange: (I) => x(I.target.value),
1032
- placeholder: "Tag name",
1033
- sx: { width: "100%" },
1034
- value: p
1035
- }
1036
- ),
1037
- /* @__PURE__ */ e(le, { id: "update-tag-error", sx: { color: "error.main" }, variant: "ParagraphSmall", children: y })
1038
- ]
1039
- }
1040
- ),
1041
- /* @__PURE__ */ e(
1042
- V,
1043
- {
1044
- copy: { title: d.tags_delete_title },
1045
- isOpen: m,
1046
- onClose: () => g(!1),
1047
- onPrimaryAction: R,
1048
- onSecondaryAction: () => s(h.ON_TRANSACTION_TAGS_TAG_DELETE_CANCEL_CLICK),
1049
- primaryText: c.delete_button,
1050
- secondaryText: c.cancel_button,
1051
- children: /* @__PURE__ */ e(T, { truncate: !1, children: d.tags_deleting_this_tag_will_remove_it })
1052
- }
1053
- )
1054
- ]
1055
- }
1056
- );
1057
- }, kt = b(Rt), Pt = ({ selectedTags: t, onTagChecked: r }) => {
1058
- const { tags: a } = v(), [s, o] = _.useState(""), n = a.filter(
1059
- (c) => c.name.toLowerCase().includes(s.toLowerCase())
1060
- );
1061
- return /* @__PURE__ */ l("div", { className: "mx-txn-tag-manager", children: [
1062
- /* @__PURE__ */ e(
1063
- Lt,
1064
- {
1065
- onSearchValueChanged: (c) => o(c),
1066
- searchValue: s
1067
- }
1068
- ),
1069
- /* @__PURE__ */ e(Ot, {}),
1070
- /* @__PURE__ */ e(ne, { sx: { boxShadow: "none" }, children: /* @__PURE__ */ e(J, { children: n.map((c) => /* @__PURE__ */ l(_.Fragment, { children: [
1071
- /* @__PURE__ */ e(kt, { onTagChecked: r, selectedTags: t, tag: c }),
1072
- /* @__PURE__ */ e(Z, { sx: { ml: 24 } })
1073
- ] }, c.guid)) }) })
1074
- ] });
1075
- }, Gt = b(Pt), Mt = ({ transaction: t }) => {
1076
- const { onEvent: r } = L(), { tags: a, updateTaggings: s, updateTransaction: o } = v(), { common: n, transactions: c } = A(), { updateManualTransaction: d } = G(), [i, u] = _.useState(!1), [m, g] = _.useState(t.tags);
1077
- _.useEffect(() => {
1078
- g(t.tags);
1079
- }, [i, t]);
1080
- const p = (N) => {
1081
- const C = [...m], R = m.indexOf(N);
1082
- R >= 0 ? C.splice(R, 1) : C.push(N), g(C);
1083
- }, x = async () => {
1084
- if (t.is_manual && !t.guid) {
1085
- d({ ...t, tags: m }), u(!1);
1086
- return;
1087
- }
1088
- await s(m, t.guid), await o({ ...t, tags: m }), r(P.TRANSACTION_DETAILS_CLICK_TAGS, { transaction_guid: t.guid }), u(!1);
1089
- }, y = _.useMemo(
1090
- () => t.tags.map(
1091
- (N, C, R) => `${a.find((K) => K.guid === N)?.name}${C < R.length - 1 ? " / " : ""}`
1092
- ),
1093
- [a, t]
1094
- );
1095
- return /* @__PURE__ */ l(_.Fragment, { children: [
1096
- /* @__PURE__ */ e(F, { disableGutters: !0, disablePadding: !0, children: /* @__PURE__ */ l(
1097
- U,
1098
- {
1099
- onClick: () => {
1100
- r(h.ON_TRANSACTION_TAGS_CLICK), u(!0);
1101
- },
1102
- children: [
1103
- /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(z, { sx: { bgcolor: "border.light" }, variant: "rounded", children: /* @__PURE__ */ e(S, { name: "local_offer", sx: { color: "text.primary" }, weight: D.Dark }) }) }),
1104
- /* @__PURE__ */ e(
1105
- M,
1106
- {
1107
- primary: c.tags_title,
1108
- primaryTypographyProps: { variant: "XSmall" },
1109
- secondary: /* @__PURE__ */ e(T, { bold: !0, variant: "Body", children: t.tags?.length > 0 ? y : c.tags_desc })
1110
- }
1111
- ),
1112
- /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(S, { name: "chevron_right", weight: D.Dark }) })
1113
- ]
1114
- }
1115
- ) }),
1116
- /* @__PURE__ */ e(
1117
- de,
1118
- {
1119
- ariaLabelClose: n.close_aria,
1120
- isOpen: i,
1121
- onClose: () => u(!1),
1122
- onPrimaryAction: x,
1123
- primaryText: n.save_button,
1124
- secondaryText: n.cancel_button,
1125
- title: c.tags_title,
1126
- children: /* @__PURE__ */ e(Gt, { onTagChecked: p, selectedTags: m })
1127
- }
1128
- )
1129
- ] });
1130
- }, Kt = b(Mt), $t = ({ transaction: t, viewOnly: r = !1 }) => {
1131
- const { updateTransaction: a } = v(), { common: s, transactions: o } = A(), { onEvent: n } = L(), [c, d] = _.useState(!1), [i, u] = _.useState(""), m = _.useRef(null);
1132
- _.useEffect(() => {
1133
- c && (u(t.description), m?.current?.focus());
1134
- }, [c]);
1135
- const g = async () => {
1136
- n(P.TRANSACTION_DETAILS_CLICK_DESCRIPTION, {
1137
- transaction_guid: t.guid
1138
- }), await a({ ...t, description: i }), d(!1);
1139
- };
1140
- return /* @__PURE__ */ e(w, { className: "mx-txn-transaction-description", children: c ? /* @__PURE__ */ l(je, { row: !0, children: [
1141
- /* @__PURE__ */ e(
1142
- De,
1143
- {
1144
- "aria-label": o.description_add_a_subcategory,
1145
- name: "add-subcategory",
1146
- onChange: (p) => u(p.target.value),
1147
- ref: m,
1148
- sx: {
1149
- backgroundColor: "background.paper",
1150
- ".MuiOutlinedInput-root": { borderTopRightRadius: 0, borderBottomRightRadius: 0 },
1151
- ".MuiOutlinedInput-input": { p: 11 },
1152
- width: 250
1153
- },
1154
- value: i
1155
- }
1156
- ),
1157
- /* @__PURE__ */ e(
1158
- ce,
1159
- {
1160
- disabled: !i,
1161
- onClick: g,
1162
- sx: { borderTopLeftRadius: 0, borderBottomLeftRadius: 0 },
1163
- variant: "outlined",
1164
- children: s.save_button
1165
- }
1166
- )
1167
- ] }) : /* @__PURE__ */ l(f, { alignItems: "center", direction: "row", gap: 4, sx: { minHeight: 44 }, children: [
1168
- /* @__PURE__ */ e(T, { bold: !0, children: t.description }),
1169
- !r && /* @__PURE__ */ e(
1170
- Q,
1171
- {
1172
- "aria-label": o.description_edit_transaction_name,
1173
- onClick: () => {
1174
- d(!0), n(h.ON_TRANSACTION_DESCRIPTION_EDIT_CLICK);
1175
- },
1176
- sx: { color: "action.active" },
1177
- children: /* @__PURE__ */ e(S, { name: "create", size: 22 })
1178
- }
1179
- )
1180
- ] }) });
1181
- }, Bt = b($t), Ft = ({ transaction: t }) => {
1182
- const { updateTransaction: r } = v(), { transactions: a } = A(), { onEvent: s } = L(), o = ve(), n = async () => {
1183
- s(P.TRANSACTION_DETAILS_CLICK_FLAG, { transaction_guid: t.guid }), await r({ ...t, is_flagged: !t.is_flagged });
1184
- };
1185
- return /* @__PURE__ */ e("div", { className: "mx-txn-transaction-flag", children: /* @__PURE__ */ e(
1186
- qe,
1187
- {
1188
- "aria-label": a.flag_btn_aria,
1189
- "aria-pressed": t.is_flagged,
1190
- color: "warning",
1191
- onClick: n,
1192
- selected: t.is_flagged,
1193
- sx: {
1194
- borderRadius: 6,
1195
- color: o.palette.secondary.main,
1196
- "&.Mui-selected": {
1197
- color: o.palette.common.white,
1198
- backgroundColor: o.palette.warning.dark,
1199
- ":hover": {
1200
- color: o.palette.common.white,
1201
- backgroundColor: o.palette.warning.main
1202
- }
1203
- },
1204
- ":hover": {
1205
- color: o.palette.warning.contrastText,
1206
- backgroundColor: o.palette.warning.light
1207
- }
1208
- },
1209
- value: "flagged",
1210
- children: /* @__PURE__ */ e(We, { color: "inherit" })
1211
- }
1212
- ) });
1213
- }, Ht = b(Ft), ae = (t, r, a, s = !0, o = "inset") => s ? /* @__PURE__ */ l(_.Fragment, { children: [
1214
- /* @__PURE__ */ l(F, { disableGutters: !0, disablePadding: !0, children: [
1215
- /* @__PURE__ */ e(B, { children: /* @__PURE__ */ e(z, { sx: { bgcolor: "border.light" }, variant: "rounded", children: t }) }),
1216
- /* @__PURE__ */ e(
1217
- M,
1218
- {
1219
- primary: r,
1220
- primaryTypographyProps: { variant: "XSmall" },
1221
- secondary: a
1222
- }
1223
- )
1224
- ] }),
1225
- /* @__PURE__ */ e(Z, { variant: o })
1226
- ] }) : null, zt = ({ transaction: t }) => {
1227
- const { transactions: r } = A(), { tags: a } = v(), s = _.useMemo(() => {
1228
- const o = new Map(a.map((n) => [n.guid, n.name]));
1229
- return t.tags.map((n) => o.get(n)).filter(Boolean).join(" / ");
1230
- }, [a, t.tags]);
1231
- return /* @__PURE__ */ l(J, { sx: { "& .MuiListItem-root": { px: 24, py: 12 } }, children: [
1232
- ae(
1233
- /* @__PURE__ */ e(
1234
- he,
1235
- {
1236
- categoryGuid: t.top_level_category_guid,
1237
- size: 24,
1238
- sx: { color: "text.primary" },
1239
- variant: be.Transparent
1240
- }
1241
- ),
1242
- r.category_title,
1243
- /* @__PURE__ */ e(T, { bold: !0, variant: "Body", children: t.category ?? r.actions_select_a_category })
1244
- ),
1245
- ae(
1246
- /* @__PURE__ */ e(S, { name: "calendar_month", sx: { color: "text.primary" }, weight: D.Dark }),
1247
- r.date_title,
1248
- /* @__PURE__ */ e(T, { bold: !0, variant: "Body", children: Ee(W(t.date), Oe.YEAR_MONTH_DAY) })
1249
- ),
1250
- ae(
1251
- /* @__PURE__ */ e(S, { name: "article", sx: { color: "text.primary" }, weight: D.Dark }),
1252
- r.memo_title,
1253
- /* @__PURE__ */ e(T, { bold: !0, sx: { overflowWrap: "break-word", whiteSpace: "wrap" }, variant: "Body", children: t.memo ?? r.memo_desc }),
1254
- !!t.memo,
1255
- t.tags?.length > 0 ? "inset" : "fullWidth"
1256
- ),
1257
- ae(
1258
- /* @__PURE__ */ e(S, { name: "local_offer", sx: { color: "text.primary" }, weight: D.Dark }),
1259
- r.tags_title,
1260
- /* @__PURE__ */ e(T, { bold: !0, variant: "Body", children: t.tags?.length ? s : r.tags_desc }),
1261
- !!t.tags?.length,
1262
- "fullWidth"
1263
- )
1264
- ] });
1265
- }, Ut = b(zt), Xt = ({
1266
- bottomActions: t = at,
1267
- topActions: r = tt,
1268
- transaction: a
1269
- }) => {
1270
- const { onEvent: s } = L(), { isCopyLoaded: o } = Fe(), { userFeatures: n } = He(), c = a?.number && a.number.length > 4;
1271
- if (_.useEffect(
1272
- () => s(P.TRANSACTION_DETAILS_VIEW, { transaction_guid: a.guid }),
1273
- []
1274
- ), !o)
1275
- return /* @__PURE__ */ e(Ie, {});
1276
- const d = $e(n, "MX_TXN_DETAILS_VIEW_ONLY");
1277
- return /* @__PURE__ */ e(w, { className: "mx-txn-transaction-details", width: "100%", children: a && /* @__PURE__ */ l(f, { children: [
1278
- /* @__PURE__ */ l(f, { gap: 12, p: 24, children: [
1279
- /* @__PURE__ */ e(ne, { elevation: 2, sx: { width: 64 }, children: /* @__PURE__ */ e(
1280
- pe,
1281
- {
1282
- categoryGuid: a.top_level_category_guid || "",
1283
- merchantGuid: a.merchant_guid || "",
1284
- size: 64
1285
- }
1286
- ) }),
1287
- /* @__PURE__ */ e(Bt, { transaction: a, viewOnly: d }),
1288
- /* @__PURE__ */ l(f, { direction: "row", justifyContent: "space-between", sx: { minHeight: 44 }, children: [
1289
- /* @__PURE__ */ l(Ae, { color: a.isIncome ? "success.main" : "text.primary", children: [
1290
- a.isIncome ? "+" : "",
1291
- te(a.amount, "0,0.00")
1292
- ] }),
1293
- !d && /* @__PURE__ */ e(Ht, { transaction: a })
1294
- ] }),
1295
- /* @__PURE__ */ l(f, { bgcolor: "background.highlight", borderRadius: "12px", gap: 4, p: 8, children: [
1296
- /* @__PURE__ */ e(T, { bold: !0, children: `${a.account}
1297
- ${c ? a.number : "•".repeat(4).concat(a.number ?? "")}` }),
1298
- /* @__PURE__ */ e(T, { bold: !0, color: "secondary", variant: "Tiny", children: a.feed_description })
1299
- ] })
1300
- ] }),
1301
- /* @__PURE__ */ e(ne, { square: !0, sx: { boxShadow: "none" }, children: d ? /* @__PURE__ */ e(Ut, { transaction: a }) : /* @__PURE__ */ e(J, { children: r.map((i, u) => /* @__PURE__ */ l(_.Fragment, { children: [
1302
- i === q.Category && /* @__PURE__ */ e(mt, { transaction: a }),
1303
- i === q.Date && /* @__PURE__ */ e(gt, { transaction: a }),
1304
- i === q.Memo && /* @__PURE__ */ e(bt, { transaction: a }),
1305
- i === q.Tags && /* @__PURE__ */ e(Kt, { transaction: a }),
1306
- /* @__PURE__ */ e(Z, { variant: u < r.length - 1 ? "inset" : "fullWidth" })
1307
- ] }, i)) }) }),
1308
- !d && /* @__PURE__ */ l(_.Fragment, { children: [
1309
- /* @__PURE__ */ e(T, { bold: !0, mb: 8, ml: 26, mt: 16, variant: "Body", children: "Actions" }),
1310
- /* @__PURE__ */ e(ne, { square: !0, sx: { boxShadow: "none" }, children: /* @__PURE__ */ l(J, { children: [
1311
- t.map((i, u) => /* @__PURE__ */ l(_.Fragment, { children: [
1312
- i === re.SplitTransaction && /* @__PURE__ */ e(vt, { transaction: a }),
1313
- i === re.HideTransaction && /* @__PURE__ */ e(Ct, { transaction: a }),
1314
- i === re.MerchantLogo && /* @__PURE__ */ e(yt, { transaction: a }),
1315
- /* @__PURE__ */ e(Z, { variant: u < t.length - 1 ? "inset" : "fullWidth" })
1316
- ] }, i)),
1317
- a.is_manual && !a.parent_guid && !a.has_been_split && /* @__PURE__ */ e(ht, { transaction: a })
1318
- ] }) })
1319
- ] })
1320
- ] }) });
1321
- }, ka = b(Xt);
1322
- export {
1323
- re as B,
1324
- mt as C,
1325
- gt as D,
1326
- bt as M,
1327
- lt as S,
1328
- Ra as T,
1329
- ka as a,
1330
- st as b,
1331
- Kt as c,
1332
- q as d,
1333
- G as u
1334
- };