@mx-cartographer/experiences 8.0.0-alpha.bb3 → 8.0.0-alpha.mega1

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 (203) hide show
  1. package/CHANGELOG.md +178 -1
  2. package/dist/{Account-Bxw0_4FU.mjs → Account-CvR2-dSR.mjs} +1 -1
  3. package/dist/{AccountDetailsContent-CAM9y39M.mjs → AccountDetailsContent-CitErkuS.mjs} +89 -82
  4. package/dist/AccountDetailsHeader-BkG3MNYo.mjs +87 -0
  5. package/dist/{AccountFields-C9FlatNb.mjs → AccountFields-zCMqet85.mjs} +6 -6
  6. package/dist/{AccountListItem-JFMZROh7.mjs → AccountListItem-DHrz8Mml.mjs} +9 -9
  7. package/dist/{AccountStore-BgNOyMdp.mjs → AccountStore-LgfBcYMe.mjs} +112 -75
  8. package/dist/Accounts-Bzy1_REQ.mjs +9 -0
  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-BmZXkL0C.mjs} +2 -2
  12. package/dist/{CategorySelectorDrawer-DUe4lH5-.mjs → CategorySelectorDrawer-B-I3kajA.mjs} +23 -21
  13. package/dist/CategoryStore-CA3tS1BO.mjs +186 -0
  14. package/dist/CategoryUtil-DUM8NuGO.mjs +78 -0
  15. package/dist/{ConnectDrawer-BQNs-hjk.mjs → ConnectDrawer-BkvlItWx.mjs} +11 -11
  16. package/dist/{ConnectionsDrawer-ByGQE7D5.mjs → ConnectionsDrawer-VmuVFHbL.mjs} +5 -5
  17. package/dist/{CurrencyInput-DUsQbkXb.mjs → CurrencyInput-itK0R3wV.mjs} +2 -2
  18. package/dist/{CurrencyText-kyC1aseI.mjs → CurrencyText-Dr0EZ7bp.mjs} +1 -1
  19. package/dist/{DateUtil-BcuH7ErC.mjs → DateUtil-CBdcsyuk.mjs} +3 -3
  20. package/dist/{DebtsStore-C9bblOgW.mjs → DebtsStore-Bq-aPy-5.mjs} +1 -1
  21. package/dist/{Dialog-CWW597AF.mjs → Dialog-BPTr3qHE.mjs} +2 -2
  22. package/dist/{Donut-oaQFlbit.mjs → Donut-Dmy3JTWd.mjs} +12 -12
  23. package/dist/Drawer-By9V-B5L.mjs +178 -0
  24. package/dist/{EmptyState-DA_lfRBv.mjs → EmptyState-DoxNUae-.mjs} +24 -22
  25. package/dist/{ExportCsvAction-sX8Rg4Ov.mjs → ExportCsvAction-Cglo8Mca.mjs} +3 -3
  26. package/dist/{Fetch-87LIQbEA.mjs → Fetch-DecPFeGU.mjs} +24 -22
  27. package/dist/FinstrongStore-BIrX0Xg2.mjs +451 -0
  28. package/dist/{GoalStore-D-aB35SY.mjs → GoalStore-1P19goZ7.mjs} +112 -152
  29. package/dist/{Help-B6dIcujh.mjs → Help-Ea3BlXQp.mjs} +2 -2
  30. package/dist/LineChart-KpPw1phO.mjs +580 -0
  31. package/dist/{ListItemAction-DHa3KJPs.mjs → ListItemAction-BxTkF6Tz.mjs} +10 -10
  32. package/dist/{ManageIncome-1s_q5W4X.mjs → ManageIncome-CaoQl609.mjs} +91 -88
  33. package/dist/{MerchantStore-DrFvsUyy.mjs → MerchantStore-WvZ4gnQe.mjs} +1 -1
  34. package/dist/MicroWidgetContainer-r6mtxRer.mjs +52 -0
  35. package/dist/MiniWidgetContainer-Bg02sF1Y.mjs +71 -0
  36. package/dist/{NetWorthStore-DCsTZpuS.mjs → NetWorthStore-rC0q7P7t.mjs} +2 -2
  37. package/dist/{NotificationSettings-DqrkNMod.mjs → NotificationSettings-uzM8tCoH.mjs} +236 -231
  38. package/dist/{NotificationStore-BxP_P2dA.mjs → NotificationStore-CDX_kqHa.mjs} +7 -15
  39. package/dist/{NumberFormatting-Buh7u8Oi.mjs → NumberFormatting-DjTD0t3W.mjs} +9 -9
  40. package/dist/{OriginalBalanceAction-CWuVvRq9.mjs → OriginalBalanceAction-C6jdS4ws.mjs} +4 -4
  41. package/dist/{RecurringSettings-A_rAGCTP.mjs → RecurringSettings-B4ybrS0B.mjs} +4 -4
  42. package/dist/{RecurringTransactions-DK8dWldr.mjs → RecurringTransactions-BqijW_8S.mjs} +49 -48
  43. package/dist/{RecurringTransactionsStore-C4YOD7_D.mjs → RecurringTransactionsStore-BhBUVm9a.mjs} +26 -29
  44. package/dist/{SettingsStore-BcgS_Ohv.mjs → SettingsStore-krIRNwHK.mjs} +3 -3
  45. package/dist/{SpendingData-D5vsfYKo.mjs → SpendingData-DQ1b9uqq.mjs} +11 -13
  46. package/dist/SpendingLegend-CDO060GT.mjs +193 -0
  47. package/dist/{ToggleListItem-r0Kx56wF.mjs → ToggleListItem-ciFTiqRS.mjs} +19 -14
  48. package/dist/TransactionApi-CjBoLleL.mjs +86 -0
  49. package/dist/TransactionDetails-m5PddMQn.mjs +1380 -0
  50. package/dist/TransactionStore-PRlwE-TF.mjs +677 -0
  51. package/dist/TrendsStore-yO7qYv97.mjs +186 -0
  52. package/dist/{User-BQUxBeZV.mjs → User-Cnlegl1N.mjs} +2 -2
  53. package/dist/{ViewMoreMicroCard-SCn2wt4i.mjs → ViewMoreMicroCard-DwR0v_ll.mjs} +711 -728
  54. package/dist/{WidgetContainer-BHWANqT4.mjs → WidgetContainer-CoFDmQRE.mjs} +4 -4
  55. package/dist/accounts/components/AccountsListCompact.d.ts +10 -0
  56. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +4 -1
  57. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.d.ts +2 -1
  58. package/dist/accounts/index.es.js +245 -235
  59. package/dist/accounts/stores/AccountStore.d.ts +24 -25
  60. package/dist/accounts/utils/Accounts.d.ts +1 -2
  61. package/dist/analytics/index.es.js +2 -2
  62. package/dist/budgets/components/AddBudgets.d.ts +2 -1
  63. package/dist/budgets/index.es.js +611 -580
  64. package/dist/budgets/store/BudgetsStore.d.ts +0 -1
  65. package/dist/cashflow/index.es.js +187 -180
  66. package/dist/categories/index.es.js +2 -2
  67. package/dist/categories/stores/CategoryStore.d.ts +2 -5
  68. package/dist/categories/util/CategoryUtil.d.ts +2 -3
  69. package/dist/common/components/Select.d.ts +4 -2
  70. package/dist/common/components/charts/LineChart.d.ts +12 -2
  71. package/dist/common/components/charts/index.d.ts +0 -3
  72. package/dist/common/components/charts/linechart/CustomLegend.d.ts +3 -1
  73. package/dist/common/components/charts/linechart/CustomMark.d.ts +4 -0
  74. package/dist/common/components/charts/linechart/CustomTooltip.d.ts +6 -1
  75. package/dist/common/components/charts/stackedlinechart/CustomPointTooltip.d.ts +5 -2
  76. package/dist/common/components/drawer/Drawer.d.ts +3 -0
  77. package/dist/common/components/drawer/Footer.d.ts +17 -0
  78. package/dist/common/hooks/index.d.ts +1 -0
  79. package/dist/common/hooks/useWidgetLoadTimer.d.ts +6 -0
  80. package/dist/common/index.es.js +397 -387
  81. package/dist/common/stores/AppDataStore.d.ts +1 -3
  82. package/dist/common/stores/GlobalCopyStore.d.ts +1 -0
  83. package/dist/common/stores/GlobalStore.d.ts +10 -4
  84. package/dist/common/stores/GlobalUiStore.d.ts +2 -3
  85. package/dist/common/stores/UserStore.d.ts +2 -3
  86. package/dist/common/types/Account.d.ts +6 -9
  87. package/dist/common/types/Finstrong.d.ts +54 -0
  88. package/dist/common/types/Global.d.ts +1 -0
  89. package/dist/common/types/Widgets.d.ts +1 -0
  90. package/dist/common/types/index.d.ts +1 -1
  91. package/dist/common/types/localization/FinstrongCopy.d.ts +105 -2
  92. package/dist/common/types/localization/GoalsCopy.d.ts +1 -0
  93. package/dist/common/types/localization/TransactionsCopy.d.ts +1 -0
  94. package/dist/dashboard/index.es.js +90 -88
  95. package/dist/debts/index.es.js +458 -448
  96. package/dist/exportTransactionsToCSV-DuAaI5XA.mjs +48 -0
  97. package/dist/finstrong/FinstrongWidget.d.ts +1 -1
  98. package/dist/finstrong/api/FinstrongApi.d.ts +5 -0
  99. package/dist/finstrong/components/ConnectMoreAccountsCard.d.ts +3 -1
  100. package/dist/finstrong/components/CreditScore/CreditScoreContent.d.ts +4 -0
  101. package/dist/finstrong/components/CreditScore/CreditScoreHeader.d.ts +4 -0
  102. package/dist/finstrong/components/FinancialStrengthGraph.d.ts +7 -1
  103. package/dist/finstrong/components/HaveManageableDebt/DebtPaymentTabContent.d.ts +3 -0
  104. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtComponent.d.ts +3 -0
  105. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtProgressBar.d.ts +4 -0
  106. package/dist/finstrong/components/HaveManageableDebt/IncomeTabContent.d.ts +3 -0
  107. package/dist/finstrong/components/KeyIndicatorsBorrowTab.d.ts +2 -2
  108. package/dist/finstrong/components/KeyIndicatorsDrawer.d.ts +4 -1
  109. package/dist/finstrong/components/KeyIndicatorsSaveTab.d.ts +2 -2
  110. package/dist/finstrong/components/KeyIndicatorsSpendTab.d.ts +2 -2
  111. package/dist/finstrong/components/KeyIndicatorsTabItem.d.ts +4 -3
  112. package/dist/finstrong/components/KeyIndicatorsTabItemDrawer.d.ts +10 -0
  113. package/dist/finstrong/components/KeyIndicatorsTabsWidget.d.ts +2 -2
  114. package/dist/finstrong/components/MaintainingEmergencySavings/EstimatedContributionCalculator.d.ts +6 -0
  115. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsContent.d.ts +4 -0
  116. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsSticky.d.ts +4 -0
  117. package/dist/finstrong/components/ProgressBar.d.ts +15 -0
  118. package/dist/finstrong/components/SaveEnoughToLiveOn/AvailableTabContent.d.ts +3 -0
  119. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnDrawerContent.d.ts +3 -0
  120. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnProgressBar.d.ts +4 -0
  121. package/dist/finstrong/components/SaveEnoughToLiveOn/SpendingTabContent.d.ts +3 -0
  122. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeComponent.d.ts +3 -0
  123. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeProgressBar.d.ts +4 -0
  124. package/dist/finstrong/components/StatusChip.d.ts +5 -0
  125. package/dist/finstrong/components/onboarding/Onboarding.d.ts +2 -0
  126. package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.d.ts +17 -0
  127. package/dist/finstrong/components/onboarding/OnboardingBirthday.d.ts +8 -0
  128. package/dist/finstrong/components/onboarding/OnboardingCreditScore.d.ts +8 -0
  129. package/dist/finstrong/components/onboarding/OnboardingStepsDrawer.d.ts +14 -0
  130. package/dist/finstrong/components/onboarding/OnboardingStepsHeader.d.ts +8 -0
  131. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeDrawerComponent.d.ts +4 -0
  132. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeStickyComponent.d.ts +4 -0
  133. package/dist/finstrong/components/shared/Accounts.d.ts +8 -0
  134. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +24 -0
  135. package/dist/finstrong/components/shared/DialScoreCard.d.ts +7 -1
  136. package/dist/finstrong/components/shared/DoubleBarChart.d.ts +28 -0
  137. package/dist/finstrong/components/shared/LineGraph.d.ts +7 -0
  138. package/dist/finstrong/components/shared/TotalCard.d.ts +8 -0
  139. package/dist/finstrong/components/shared/Transactions.d.ts +11 -0
  140. package/dist/finstrong/constants/index.d.ts +9 -0
  141. package/dist/finstrong/index.es.js +3190 -1073
  142. package/dist/finstrong/stores/FinstrongStore.d.ts +25 -2
  143. package/dist/finstrong/util/finstrongUtils.d.ts +58 -1
  144. package/dist/goals/index.es.js +302 -291
  145. package/dist/goals/stores/GoalStore.d.ts +4 -17
  146. package/dist/help/index.es.js +13 -9
  147. package/dist/{hooks-D6XlXHf4.mjs → hooks-ZMp65DFz.mjs} +12 -12
  148. package/dist/insights/index.es.js +1 -1
  149. package/dist/investments/index.es.js +108 -104
  150. package/dist/investments/stores/HoldingStore.d.ts +0 -1
  151. package/dist/merchants/index.es.js +2 -2
  152. package/dist/microinsights/MicroCardTemplate.d.ts +16 -0
  153. package/dist/microinsights/beaticons/BeatIcon.d.ts +2 -9
  154. package/dist/microinsights/beaticons/BeatMerchantLogo.d.ts +3 -2
  155. package/dist/microinsights/beaticons/MonthlySpendComparisonIcon.d.ts +2 -1
  156. package/dist/microinsights/cards/{MicroInsightCard.d.ts → BaseCard.d.ts} +1 -8
  157. package/dist/microinsights/cards/{BeatCard.d.ts → InsightCard.d.ts} +2 -2
  158. package/dist/microinsights/cards/NoRelevantInsightsCard.d.ts +2 -5
  159. package/dist/microinsights/cards/ZeroStateCard.d.ts +2 -5
  160. package/dist/microinsights/carousel/BeatList.d.ts +10 -0
  161. package/dist/microinsights/carousel/CarouselControls.d.ts +1 -3
  162. package/dist/microinsights/carousel/CarouselHeader.d.ts +1 -2
  163. package/dist/microinsights/constants/App.d.ts +0 -1
  164. package/dist/microinsights/index.d.ts +4 -3
  165. package/dist/microinsights/index.es.js +101 -14
  166. package/dist/microinsights/interfaces.d.ts +0 -6
  167. package/dist/networth/index.es.js +197 -190
  168. package/dist/notifications/index.es.js +25 -25
  169. package/dist/notifications/stores/NotificationStore.d.ts +1 -3
  170. package/dist/recurringtransactions/index.es.js +395 -351
  171. package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +2 -3
  172. package/dist/settings/index.es.js +307 -298
  173. package/dist/spending/index.es.js +299 -438
  174. package/dist/spending/utils/SpendingData.d.ts +2 -1
  175. package/dist/transactions/components/shared/TransactionDetails.d.ts +1 -0
  176. package/dist/transactions/components/shared/TransactionList.d.ts +1 -0
  177. package/dist/transactions/index.es.js +115 -112
  178. package/dist/transactions/stores/TransactionStore.d.ts +77 -21
  179. package/dist/trends/components/TrendsTable.d.ts +0 -2
  180. package/dist/trends/index.es.js +1025 -604
  181. package/dist/trends/utils/TrendsData.d.ts +1 -0
  182. package/dist/{useAccountDisplayName-BUAApBIb.mjs → useAccountDisplayName-B7iXTNM8.mjs} +2 -2
  183. package/dist/{useCombineEvents-BUDIR1ba.mjs → useCombineEvents-CRwX-qWE.mjs} +1 -1
  184. package/dist/{useInsightsEnabled-DBpwEq10.mjs → useInsightsEnabled-B7dxpDrX.mjs} +1 -1
  185. package/dist/useWidgetLoadTimer-hIOioiKx.mjs +19 -0
  186. package/package.json +4 -4
  187. package/dist/AccountDetailsHeader-JtSX6Uf9.mjs +0 -120
  188. package/dist/Accounts-BRf_YeTf.mjs +0 -27
  189. package/dist/CategoryStore-yHI0hWmK.mjs +0 -174
  190. package/dist/CategoryUtil-pZRIYOgN.mjs +0 -80
  191. package/dist/Drawer-kEE73B87.mjs +0 -113
  192. package/dist/FinstrongStore-F2c607dj.mjs +0 -101
  193. package/dist/LineChart-D4GI7nVh.mjs +0 -541
  194. package/dist/MicroWidgetContainer-DpeqN9n3.mjs +0 -45
  195. package/dist/MiniWidgetContainer-D0gfmbaF.mjs +0 -56
  196. package/dist/TransactionApi-B3Tksf7L.mjs +0 -86
  197. package/dist/TransactionDetails-oP1eSuiS.mjs +0 -1334
  198. package/dist/TransactionStore-ai3uII_r.mjs +0 -690
  199. package/dist/TrendsStore-DCYbpXPO.mjs +0 -559
  200. package/dist/common/components/SkeletonLoader.d.ts +0 -7
  201. package/dist/exportTransactionsToCSV-7bVS7KXf.mjs +0 -47
  202. package/dist/finstrong/utils/Finstrong.d.ts +0 -6
  203. package/dist/useAriaLive-B3_pRUio.mjs +0 -35
@@ -1,384 +1,215 @@
1
- import { jsxs as h, jsx as t, Fragment as mt } from "react/jsx-runtime";
2
- import p from "react";
3
- import { observer as v } from "mobx-react-lite";
4
- import { startOfMonth as nt } from "date-fns/startOfMonth";
5
- import { endOfMonth as ot } from "date-fns/endOfMonth";
6
- import x from "@mui/material/Box";
1
+ import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
+ import a from "react";
3
+ import { observer as x } from "mobx-react-lite";
4
+ import { startOfMonth as it } from "date-fns/startOfMonth";
5
+ import { endOfMonth as rt } from "date-fns/endOfMonth";
6
+ import M from "@mui/material/Box";
7
7
  import C from "@mui/material/Stack";
8
- import N from "@mui/material/Tab";
9
- import at from "@mui/material/Tabs";
10
- import ht from "@mui/material/styles/useTheme";
11
- import { b as V } from "../CategoryUtil-pZRIYOgN.mjs";
12
- import { b as S } from "../Category-CevNQ03n.mjs";
13
- import { Text as y, CategoryIcon as ft, CategoryIconVariants as yt } from "@mxenabled/mxui";
14
- import { f as w } from "../NumberFormatting-Buh7u8Oi.mjs";
15
- import { u as bt } from "../useAriaLive-B3_pRUio.mjs";
16
- import Ct from "@mui/material/Button";
17
- import { useTheme as it } from "@mui/material";
18
- import { u as I, b as R, m as z, d as rt, a as st, h as _t, g as St } from "../hooks-D6XlXHf4.mjs";
19
- import { u as lt } from "../useScreenSize-B6JyS_Lj.mjs";
20
- import { D as Tt } from "../Donut-oaQFlbit.mjs";
21
- import { L as F } from "../Loader-DUaFpDGv.mjs";
22
- import { M as Mt } from "../MiniWidgetContainer-D0gfmbaF.mjs";
23
- import { startOfToday as U } from "date-fns/startOfToday";
24
- import { T as Dt, a as xt } from "../TransactionDetails-oP1eSuiS.mjs";
25
- import wt from "@mui/material/Collapse";
26
- import B from "@mui/material/Divider";
27
- import q from "@mui/material/List";
28
- import J from "@mui/material/ListItem";
29
- import vt from "@mui/material/ListItemButton";
30
- import { D as Q } from "../Drawer-kEE73B87.mjs";
31
- import { A as Z, W as It } from "../WidgetContainer-BHWANqT4.mjs";
32
- const j = 5, Et = (n, c, r) => r.reduce((l, a) => {
33
- if (a.total > 0) {
34
- const i = n.find((s) => s.guid === a.category_guid);
35
- if (!i) return l;
36
- const o = i.parent_guid ?? i.guid, e = n.find((s) => s.guid === o);
37
- if (!e) return l;
38
- const d = {
39
- guid: i.guid,
40
- name: i.guid === o ? `General ${i.name}` : i.name,
41
- color: V(e.guid, c),
42
- amount: a.total
43
- }, u = l.find((s) => s.guid === o);
44
- u ? (u.amount += a.total, u.categoryTotals?.push(d)) : l.push({
45
- guid: o,
46
- name: e.name,
47
- color: V(e.guid, c),
48
- categoryTotals: [d],
49
- amount: a.total
50
- });
51
- }
52
- return l;
53
- }, []), ct = (n, c, r, l) => {
54
- const a = Et(n, r, l), i = a.filter(
55
- (s) => s.guid !== S.INCOME && s.guid !== S.INVESTMENTS && s.guid !== S.TRANSFER
56
- ).sort((s, m) => m.amount - s.amount), o = i.reduce(
57
- (s, m) => s + m.amount,
58
- 0
59
- ), e = i.length > j ? j : i.length, d = i.slice(0, e), u = d.map((s) => ({
60
- id: s.guid,
61
- color: V(s.guid, r),
62
- label: s.name,
63
- value: s.amount / o * 100
64
- }));
65
- if (i.length > 5) {
66
- const s = i.slice(j, a.length), m = s.reduce(
67
- (T, g) => T + g.amount,
68
- 0
69
- );
70
- d.push({
71
- guid: "other",
72
- color: r.palette.categories.others || "",
73
- name: c.saving_goal_other,
74
- categoryTotals: s,
75
- amount: m
76
- }), u.push({
77
- id: "other",
78
- color: r.palette.categories.others || "",
79
- label: c.saving_goal_other,
80
- value: m / o * 100
81
- });
82
- }
83
- return {
84
- categoryData: d,
85
- donutData: u,
86
- totalAmount: o
87
- };
88
- }, dt = (n, c, r) => {
89
- const l = n.filter(
90
- (e) => e.guid === S.INCOME || e.parent_guid === S.INCOME
91
- ), a = c.filter((e) => l.some((d) => d.guid === e.category_guid)).sort((e, d) => e.total - d.total).map((e, d) => ({
92
- guid: e.category_guid,
93
- name: n.find((u) => u.guid === e.category_guid)?.name,
94
- color: r[d],
95
- categoryTotals: [],
96
- amount: Math.abs(e.total)
97
- })), i = a.reduce(
98
- (e, d) => e + d.amount,
99
- 0
100
- ), o = a.map((e) => ({
101
- id: e.guid,
102
- color: e.color,
103
- label: e.name,
104
- value: e.amount / i * 100
105
- }));
106
- return {
107
- categoryData: a,
108
- donutData: o,
109
- totalAmount: i
110
- };
111
- }, W = ({ amount: n, label: c }) => /* @__PURE__ */ h(C, { direction: "column", children: [
112
- /* @__PURE__ */ t(y, { bold: !0, sx: { textTransform: "none" }, variant: "Body", children: c }),
113
- /* @__PURE__ */ t(y, { variant: "XSmall", children: w(n, "0,0") })
114
- ] }), At = ({
115
- data: n,
116
- isIncome: c = !1,
117
- onSelected: r,
118
- onViewTransactions: l,
119
- selectedId: a,
120
- size: i = 150,
121
- totalLabel: o,
122
- variant: e = "mini"
123
- }) => {
124
- const { spending: d } = I(), u = it(), { isTablet: s } = lt(), { announce: m, ariaLive: T } = bt(), g = p.useMemo(
125
- () => a ? n.categoryData.find((D) => D.guid === a) : void 0,
126
- [a]
127
- );
128
- p.useEffect(() => {
129
- if (g) {
130
- const D = w(g.amount, "0,0");
131
- m(`${g.name}: ${D}`);
132
- }
133
- }, [g, m]);
134
- const b = p.useMemo(() => n.donutData.length > 0 ? n.donutData : [{ id: "0", color: u.palette.divider, value: 100 }], [n, u]), E = () => {
135
- l?.(a);
136
- }, _ = s ? 32 : 48;
137
- return /* @__PURE__ */ h(mt, { children: [
138
- T,
139
- /* @__PURE__ */ t(Tt, { data: b, onClick: r, selectedId: a, size: i, children: /* @__PURE__ */ t(C, { alignItems: "center", height: "100%", justifyContent: "center", width: "100%", children: /* @__PURE__ */ h(C, { alignItems: "center", justifyContent: "center", minHeight: i, minWidth: i, children: [
140
- g && /* @__PURE__ */ h(
141
- C,
142
- {
143
- alignItems: "center",
144
- gap: e === "mini" ? 0 : 8,
145
- mb: e === "mini" ? 0 : 8,
146
- mt: e === "mini" ? 0 : -16,
147
- sx: e === "mini" ? { gap: 0, mb: 0 } : { gap: { xs: 4, xl: 8 }, mb: { xs: 4, xl: 8 } },
148
- children: [
149
- /* @__PURE__ */ t(
150
- ft,
151
- {
152
- categoryGuid: c ? S.INCOME : g.guid,
153
- size: e === "mini" ? 24 : _,
154
- variant: yt.Transparent
155
- }
156
- ),
157
- /* @__PURE__ */ t(
158
- y,
159
- {
160
- color: "secondary",
161
- noWrap: !0,
162
- variant: e === "mini" ? "Tiny" : "Body",
163
- children: g ? g.name : o
164
- }
165
- )
166
- ]
167
- }
168
- ),
169
- !g && e === "full" && /* @__PURE__ */ t(y, { bold: !0, color: "secondary", sx: { mb: { xs: 4, xl: 8 } }, children: o }),
170
- /* @__PURE__ */ t(y, { variant: e === "mini" ? "H2" : "H1", children: g ? w(g.amount, "0,0") : w(n.totalAmount, "0,0") }),
171
- !g && e === "mini" && /* @__PURE__ */ t(y, { color: "secondary", noWrap: !0, variant: "Tiny", children: o }),
172
- e === "full" && /* @__PURE__ */ t(
173
- Ct,
174
- {
175
- "aria-label": `View ${g?.name || ""} Transactions`,
176
- disabled: n.categoryData.length === 0,
177
- onClick: E,
178
- sx: { mt: { xl: 4, xs: 0 }, zIndex: 1 },
179
- variant: "text",
180
- children: d.view_transactions
181
- }
182
- )
183
- ] }) }) })
184
- ] });
185
- }, O = v(At), tt = ({ data: n, onSelected: c, selectedId: r }) => {
186
- const l = (a, i) => {
187
- (a.key === "Enter" || a.key === " ") && (a.preventDefault(), c(i));
188
- };
189
- return /* @__PURE__ */ t(C, { gap: 8, height: "100%", justifyContent: "center", my: "auto", children: n.categoryData.map((a) => /* @__PURE__ */ h(
190
- C,
191
- {
192
- alignItems: "center",
193
- "aria-label": a.name,
194
- "aria-pressed": a.guid === r,
195
- direction: "row",
196
- gap: 8,
197
- onClick: () => c(a.guid),
198
- onKeyDown: (i) => l(i, a.guid),
199
- role: "button",
200
- sx: { cursor: "pointer" },
201
- tabIndex: 0,
202
- children: [
203
- /* @__PURE__ */ t(x, { borderRadius: 4, height: 8, sx: { backgroundColor: a.color }, width: 8 }),
204
- /* @__PURE__ */ t(y, { bold: a.guid === r, variant: "XSmall", children: a.name })
205
- ]
206
- },
207
- a.guid
208
- )) });
209
- }, Lt = () => {
210
- const n = ht(), { goals: c, spending: r } = I(), { selectedAccounts: l } = R(), {
211
- categories: a,
212
- dateRangeCategoryTotals: i,
213
- dataRangeTotalsLoaded: o,
214
- loadDateRangeCategoryTotals: e
215
- } = z(), d = p.useMemo(
8
+ import E from "@mui/material/Tab";
9
+ import st from "@mui/material/Tabs";
10
+ import bt from "@mui/material/styles/useTheme";
11
+ import { g as ct, a as lt, S as W, b as Q } from "../SpendingLegend-CDO060GT.mjs";
12
+ import { Text as y, Icon as _t } from "@mxenabled/mxui";
13
+ import { f as A } from "../NumberFormatting-DjTD0t3W.mjs";
14
+ import { u as w, b as R, m as F, d as dt, a as V, h as Ct, g as yt } from "../hooks-ZMp65DFz.mjs";
15
+ import { u as gt } from "../useWidgetLoadTimer-hIOioiKx.mjs";
16
+ import { L as P } from "../Loader-DUaFpDGv.mjs";
17
+ import { M as St } from "../MiniWidgetContainer-Bg02sF1Y.mjs";
18
+ import { startOfToday as Z } from "date-fns/startOfToday";
19
+ import Tt from "@mui/material/Button";
20
+ import { useTheme as Mt } from "@mui/material";
21
+ import { e as xt } from "../exportTransactionsToCSV-DuAaI5XA.mjs";
22
+ import { T as wt, a as vt } from "../TransactionDetails-m5PddMQn.mjs";
23
+ import Dt from "@mui/material/Collapse";
24
+ import z from "@mui/material/Divider";
25
+ import tt from "@mui/material/List";
26
+ import et from "@mui/material/ListItem";
27
+ import Lt from "@mui/material/ListItemButton";
28
+ import { u as It } from "../useScreenSize-B6JyS_Lj.mjs";
29
+ import { D as nt } from "../Drawer-By9V-B5L.mjs";
30
+ import { b as L } from "../Category-CevNQ03n.mjs";
31
+ import { A as ot, W as At } from "../WidgetContainer-CoFDmQRE.mjs";
32
+ const N = ({ amount: e, label: d }) => /* @__PURE__ */ l(C, { direction: "column", children: [
33
+ /* @__PURE__ */ t(y, { bold: !0, sx: { textTransform: "none" }, variant: "Body", children: d }),
34
+ /* @__PURE__ */ t(y, { variant: "XSmall", children: A(e, "0,0") })
35
+ ] }), Et = () => {
36
+ const e = bt(), { goals: d, spending: o } = w(), { selectedAccounts: r } = R(), {
37
+ categories: i,
38
+ dateRangeCategoryTotals: s,
39
+ dataRangeTotalsLoaded: n,
40
+ loadDateRangeCategoryTotals: u
41
+ } = F();
42
+ gt({
43
+ widgetName: "SpendingMiniWidget",
44
+ isLoaded: n
45
+ });
46
+ const c = a.useMemo(
216
47
  () => [
217
- n.palette.chartMono.chartMono5,
218
- n.palette.chartMono.chartMono4,
219
- n.palette.chartMono.chartMono3,
220
- n.palette.chartMono.chartMono2,
221
- n.palette.chartMono.chartMono1,
222
- n.palette.chartMono.chartMono6
48
+ e.palette.chartMono.chartMono5,
49
+ e.palette.chartMono.chartMono4,
50
+ e.palette.chartMono.chartMono3,
51
+ e.palette.chartMono.chartMono2,
52
+ e.palette.chartMono.chartMono1,
53
+ e.palette.chartMono.chartMono6
223
54
  ],
224
- [n]
55
+ [e]
225
56
  );
226
- p.useEffect(() => {
227
- e(
228
- l,
229
- nt(/* @__PURE__ */ new Date()),
230
- ot(/* @__PURE__ */ new Date())
57
+ a.useEffect(() => {
58
+ u(
59
+ r,
60
+ it(/* @__PURE__ */ new Date()),
61
+ rt(/* @__PURE__ */ new Date())
231
62
  ).finally();
232
- }, [l]);
233
- const [u, s] = p.useState(""), [m, T] = p.useState(0), g = p.useMemo(
234
- () => ct(a, c, n, i),
235
- [a, i]
236
- ), b = p.useMemo(
237
- () => dt(a, i, d),
238
- [a, i, d]
239
- ), E = (D, L) => {
240
- T(L), s("");
241
- }, _ = (D) => {
242
- s(u === D ? "" : D);
63
+ }, [r]);
64
+ const [m, g] = a.useState(""), [h, v] = a.useState(0), _ = a.useMemo(
65
+ () => ct(i, d, e, s),
66
+ [i, s]
67
+ ), f = a.useMemo(
68
+ () => lt(i, s, c),
69
+ [i, s, c]
70
+ ), O = (T, k) => {
71
+ v(k), g("");
72
+ }, S = (T) => {
73
+ g(m === T ? "" : T);
243
74
  };
244
- return o ? /* @__PURE__ */ h(x, { width: "100%", children: [
245
- /* @__PURE__ */ h(
246
- at,
75
+ return n ? /* @__PURE__ */ l(M, { width: "100%", children: [
76
+ /* @__PURE__ */ l(
77
+ st,
247
78
  {
248
- "aria-label": r.mini_title,
249
- onChange: E,
250
- value: m,
79
+ "aria-label": o.mini_title,
80
+ onChange: O,
81
+ value: h,
251
82
  variant: "fullWidth",
252
83
  children: [
253
84
  /* @__PURE__ */ t(
254
- N,
85
+ E,
255
86
  {
256
87
  "aria-controls": "spending-tabpanel",
257
88
  id: "spending-tab",
258
89
  label: /* @__PURE__ */ t(
259
- W,
90
+ N,
260
91
  {
261
- amount: g.totalAmount,
262
- label: r.spend_tab_title
92
+ amount: _.totalAmount,
93
+ label: o.spend_tab_title
263
94
  }
264
95
  ),
265
- tabIndex: m === 0 ? 0 : -1
96
+ tabIndex: h === 0 ? 0 : -1
266
97
  }
267
98
  ),
268
99
  /* @__PURE__ */ t(
269
- N,
100
+ E,
270
101
  {
271
102
  "aria-controls": "income-tabpanel",
272
103
  id: "income-tab",
273
104
  label: /* @__PURE__ */ t(
274
- W,
105
+ N,
275
106
  {
276
- amount: b.totalAmount,
277
- label: r.income_tab_title
107
+ amount: f.totalAmount,
108
+ label: o.income_tab_title
278
109
  }
279
110
  ),
280
- tabIndex: m === 1 ? 0 : -1
111
+ tabIndex: h === 1 ? 0 : -1
281
112
  }
282
113
  )
283
114
  ]
284
115
  }
285
116
  ),
286
117
  /* @__PURE__ */ t(
287
- x,
118
+ M,
288
119
  {
289
120
  "aria-labelledby": "spending-tab",
290
- hidden: m !== 0,
121
+ hidden: h !== 0,
291
122
  id: "spending-tabpanel",
292
123
  role: "tabpanel",
293
- children: /* @__PURE__ */ h(C, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
124
+ children: /* @__PURE__ */ l(C, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
294
125
  /* @__PURE__ */ t(
295
- O,
126
+ W,
296
127
  {
297
- data: g,
298
- onSelected: _,
299
- selectedId: u,
300
- totalLabel: r.total_spending
128
+ data: _,
129
+ onSelected: S,
130
+ selectedId: m,
131
+ totalLabel: o.total_spending
301
132
  }
302
133
  ),
303
- /* @__PURE__ */ t(tt, { data: g, onSelected: _, selectedId: u })
134
+ /* @__PURE__ */ t(Q, { data: _, onSelected: S, selectedId: m })
304
135
  ] })
305
136
  }
306
137
  ),
307
138
  /* @__PURE__ */ t(
308
- x,
139
+ M,
309
140
  {
310
141
  "aria-labelledby": "income-tab",
311
- hidden: m !== 1,
142
+ hidden: h !== 1,
312
143
  id: "income-tabpanel",
313
144
  role: "tabpanel",
314
- children: /* @__PURE__ */ h(C, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
145
+ children: /* @__PURE__ */ l(C, { direction: "row", gap: 16, justifyContent: "center", p: 24, children: [
315
146
  /* @__PURE__ */ t(
316
- O,
147
+ W,
317
148
  {
318
- data: b,
149
+ data: f,
319
150
  isIncome: !0,
320
- onSelected: _,
321
- selectedId: u,
322
- totalLabel: r.total_income
151
+ onSelected: S,
152
+ selectedId: m,
153
+ totalLabel: o.total_income
323
154
  }
324
155
  ),
325
- /* @__PURE__ */ t(tt, { data: b, onSelected: _, selectedId: u })
156
+ /* @__PURE__ */ t(Q, { data: f, onSelected: S, selectedId: m })
326
157
  ] })
327
158
  }
328
159
  )
329
- ] }) : /* @__PURE__ */ t(F, { height: 250 });
330
- }, Nt = v(Lt), Wt = ({ onPrimaryCtaClick: n, sx: c = {} }) => {
331
- const { visibleAccounts: r } = rt(), { spending: l } = I(), { isCopyLoaded: a, isInitialized: i, setSelectedAccounts: o } = R();
332
- return p.useEffect(() => {
333
- o(r);
334
- }, [r]), !a || !i ? /* @__PURE__ */ t(F, {}) : /* @__PURE__ */ t(
335
- Mt,
160
+ ] }) : /* @__PURE__ */ t(P, { height: 250 });
161
+ }, Wt = x(Et), Nt = ({ onPrimaryCtaClick: e, sx: d = {} }) => {
162
+ const { visibleAccounts: o } = dt(), { spending: r } = w(), { isCopyLoaded: i, isInitialized: s, setSelectedAccounts: n } = R();
163
+ return a.useEffect(() => {
164
+ n(o);
165
+ }, [o]), !i || !s ? /* @__PURE__ */ t(P, {}) : /* @__PURE__ */ t(
166
+ St,
336
167
  {
337
168
  className: "mx-exp-spending-miniwidget",
338
- onPrimaryCtaClick: n,
339
- primaryCtaLabel: l.primary_cta,
340
- sx: c,
341
- title: l.mini_title,
342
- children: /* @__PURE__ */ t(Nt, {})
169
+ onPrimaryCtaClick: e,
170
+ primaryCtaLabel: r.primary_cta,
171
+ sx: { height: "100%", ...d },
172
+ title: r.mini_title,
173
+ children: /* @__PURE__ */ t(Wt, {})
343
174
  }
344
175
  );
345
- }, be = v(Wt), Ot = ({
346
- data: n,
347
- onSelected: c,
348
- selectedId: r = "",
349
- title: l
176
+ }, _e = x(Nt), Rt = ({
177
+ data: e,
178
+ onSelected: d,
179
+ selectedId: o = "",
180
+ title: r
350
181
  }) => {
351
- const { spending: a } = I(), i = n.categoryData.find((o) => o.guid === r);
352
- return /* @__PURE__ */ h(C, { direction: "column", justifyContent: "center", maxWidth: 400, minWidth: 275, width: "100%", children: [
353
- /* @__PURE__ */ t(y, { bold: !0, sx: { py: 12 }, children: `${l} ${a.by_category}` }),
354
- /* @__PURE__ */ t(B, { "aria-hidden": "true" }),
355
- /* @__PURE__ */ t(q, { children: n.categoryData.map((o) => /* @__PURE__ */ h(p.Fragment, { children: [
182
+ const { spending: i } = w(), s = e.categoryData.find((n) => n.guid === o);
183
+ return /* @__PURE__ */ l(C, { direction: "column", justifyContent: "center", maxWidth: 400, minWidth: 275, width: "100%", children: [
184
+ /* @__PURE__ */ t(y, { bold: !0, sx: { py: 12 }, children: `${r} ${i.by_category}` }),
185
+ /* @__PURE__ */ t(z, { "aria-hidden": "true" }),
186
+ /* @__PURE__ */ t(tt, { children: e.categoryData.map((n) => /* @__PURE__ */ l(a.Fragment, { children: [
356
187
  /* @__PURE__ */ t(
357
- J,
188
+ et,
358
189
  {
359
190
  disableGutters: !0,
360
191
  disablePadding: !0,
361
192
  sx: {
362
193
  minHeight: 44
363
194
  },
364
- children: /* @__PURE__ */ h(
365
- vt,
195
+ children: /* @__PURE__ */ l(
196
+ Lt,
366
197
  {
367
- "aria-expanded": i?.guid === o.guid,
368
- onClick: () => c(o.guid),
198
+ "aria-expanded": s?.guid === n.guid,
199
+ onClick: () => d(n.guid),
369
200
  sx: { minHeight: 44, px: 8, py: 0 },
370
201
  children: [
371
202
  /* @__PURE__ */ t(
372
- x,
203
+ M,
373
204
  {
374
205
  borderRadius: 4,
375
206
  flexShrink: 0,
376
207
  height: 8,
377
- sx: { backgroundColor: o.color, mr: 8 },
208
+ sx: { backgroundColor: n.color, mr: 8 },
378
209
  width: 8
379
210
  }
380
211
  ),
381
- /* @__PURE__ */ h(
212
+ /* @__PURE__ */ l(
382
213
  C,
383
214
  {
384
215
  alignItems: "center",
@@ -386,8 +217,8 @@ const j = 5, Et = (n, c, r) => r.reduce((l, a) => {
386
217
  justifyContent: "space-between",
387
218
  width: "100%",
388
219
  children: [
389
- /* @__PURE__ */ t(y, { bold: r === o.guid, children: o.name }),
390
- /* @__PURE__ */ t(y, { bold: r === o.guid, variant: "Body", children: w(o.amount, "0,0") })
220
+ /* @__PURE__ */ t(y, { bold: o === n.guid, children: n.name }),
221
+ /* @__PURE__ */ t(y, { bold: o === n.guid, variant: "Body", children: A(n.amount, "0,0") })
391
222
  ]
392
223
  }
393
224
  )
@@ -396,51 +227,51 @@ const j = 5, Et = (n, c, r) => r.reduce((l, a) => {
396
227
  )
397
228
  }
398
229
  ),
399
- /* @__PURE__ */ t(B, {}),
400
- o.categoryTotals && o.categoryTotals.length > 0 && /* @__PURE__ */ t(wt, { in: i?.guid === o.guid, unmountOnExit: !0, children: /* @__PURE__ */ h(q, { children: [
401
- i?.categoryTotals?.map((e) => /* @__PURE__ */ t(
402
- J,
230
+ /* @__PURE__ */ t(z, {}),
231
+ n.categoryTotals && n.categoryTotals.length > 0 && /* @__PURE__ */ t(Dt, { in: s?.guid === n.guid, unmountOnExit: !0, children: /* @__PURE__ */ l(tt, { children: [
232
+ s?.categoryTotals?.map((u) => /* @__PURE__ */ t(
233
+ et,
403
234
  {
404
235
  sx: {
405
236
  pl: 24,
406
237
  pr: 8,
407
238
  py: 0
408
239
  },
409
- children: /* @__PURE__ */ h(C, { direction: "row", justifyContent: "space-between", width: "100%", children: [
410
- /* @__PURE__ */ h(y, { children: [
411
- e.name,
240
+ children: /* @__PURE__ */ l(C, { direction: "row", justifyContent: "space-between", width: "100%", children: [
241
+ /* @__PURE__ */ l(y, { children: [
242
+ u.name,
412
243
  " "
413
244
  ] }),
414
- /* @__PURE__ */ t(y, { children: w(e.amount, "0,0") })
245
+ /* @__PURE__ */ t(y, { children: A(u.amount, "0,0") })
415
246
  ] })
416
247
  },
417
- e.guid
248
+ u.guid
418
249
  )),
419
- /* @__PURE__ */ t(B, {})
250
+ /* @__PURE__ */ t(z, {})
420
251
  ] }) })
421
- ] }, o.guid)) }),
422
- /* @__PURE__ */ t(y, { bold: !0, sx: { mt: 12, pr: 8, textAlign: "right" }, children: `${a.total}: ${w(n.totalAmount, "0,0")}` })
252
+ ] }, n.guid)) }),
253
+ /* @__PURE__ */ t(y, { bold: !0, sx: { mt: 12, pr: 8, textAlign: "right" }, children: `${i.total}: ${A(e.totalAmount, "0,0")}` })
423
254
  ] });
424
- }, Rt = v(Ot), kt = ({
425
- data: n,
426
- onSelected: c,
427
- onViewTransactions: r,
428
- selectedId: l,
429
- title: a
255
+ }, Ot = x(Rt), kt = ({
256
+ data: e,
257
+ onSelected: d,
258
+ onViewTransactions: o,
259
+ selectedId: r,
260
+ title: i
430
261
  }) => {
431
- const { isDesktop: i, isMobile: o } = lt(), { isLoadingCategoryTotals: e } = z(), { spending: d } = I();
432
- return /* @__PURE__ */ h(
262
+ const { isDesktop: s, isMobile: n } = It(), { isLoadingCategoryTotals: u } = F(), { spending: c } = w();
263
+ return /* @__PURE__ */ l(
433
264
  C,
434
265
  {
435
- alignItems: o ? "center" : "flex-start",
436
- direction: o ? "column" : "row",
266
+ alignItems: n ? "center" : "flex-start",
267
+ direction: n ? "column" : "row",
437
268
  gap: { xs: 16, md: 64, xl: 100 },
438
269
  justifyContent: "center",
439
270
  pt: 50,
440
271
  px: 8,
441
272
  children: [
442
- e && /* @__PURE__ */ t(
443
- O,
273
+ u && /* @__PURE__ */ t(
274
+ W,
444
275
  {
445
276
  data: {
446
277
  categoryData: [],
@@ -450,173 +281,203 @@ const j = 5, Et = (n, c, r) => r.reduce((l, a) => {
450
281
  onSelected: () => {
451
282
  },
452
283
  selectedId: "",
453
- size: i ? 400 : 300,
284
+ size: s ? 400 : 300,
454
285
  totalLabel: "Loading ...",
455
286
  variant: "full"
456
287
  }
457
288
  ),
458
- !e && /* @__PURE__ */ t(
459
- O,
289
+ !u && /* @__PURE__ */ t(
290
+ W,
460
291
  {
461
- data: n,
462
- onSelected: c,
463
- onViewTransactions: r,
464
- selectedId: l,
465
- size: i ? 400 : 300,
466
- totalLabel: d.total_amount,
292
+ data: e,
293
+ onSelected: d,
294
+ onViewTransactions: o,
295
+ selectedId: r,
296
+ size: s ? 400 : 300,
297
+ totalLabel: c.total_amount,
467
298
  variant: "full"
468
299
  }
469
300
  ),
470
- /* @__PURE__ */ t(Rt, { data: n, onSelected: c, selectedId: l, title: a })
301
+ /* @__PURE__ */ t(Ot, { data: e, onSelected: d, selectedId: r, title: i })
471
302
  ]
472
303
  }
473
304
  );
474
- }, et = v(kt), $t = (n) => [
475
- n.palette.chartMono.chartMono5,
476
- n.palette.chartMono.chartMono4,
477
- n.palette.chartMono.chartMono3,
478
- n.palette.chartMono.chartMono2,
479
- n.palette.chartMono.chartMono1,
480
- n.palette.chartMono.chartMono6
481
- ], Gt = () => {
482
- const n = it(), { clientConfig: c } = st(), { categories: r, dateRangeCategoryTotals: l, loadDateRangeCategoryTotals: a } = z(), { goals: i, spending: o } = I(), { displayedDateRange: e, selectedAccounts: d, selectedAccountGuids: u } = R(), { setFilter: s, sortedTransactions: m } = _t(), T = c?.master?.deep_link_params?.account_guids, g = c?.master?.deep_link_params?.view, [b, E] = p.useState(""), [_, D] = p.useState(g === "income" ? 1 : 0), [L, H] = p.useState(""), [gt, P] = p.useState(!1);
483
- p.useEffect(() => {
484
- a(
485
- d,
486
- e.start,
487
- e.end
305
+ }, at = x(kt), $t = (e) => [
306
+ e.palette.chartMono.chartMono5,
307
+ e.palette.chartMono.chartMono4,
308
+ e.palette.chartMono.chartMono3,
309
+ e.palette.chartMono.chartMono2,
310
+ e.palette.chartMono.chartMono1,
311
+ e.palette.chartMono.chartMono6
312
+ ], Bt = () => {
313
+ const e = Mt(), { is_mobile_webview: d } = V(), { clientConfig: o } = V(), {
314
+ categories: r,
315
+ dateRangeCategoryTotals: i,
316
+ loadDateRangeCategoryTotals: s,
317
+ dataRangeTotalsLoaded: n
318
+ } = F(), {
319
+ goals: u,
320
+ spending: c,
321
+ transactions: m
322
+ } = w(), { displayedDateRange: g, selectedAccounts: h, selectedAccountGuids: v } = R(), {
323
+ setFilter: _,
324
+ sortedTransactions: f,
325
+ sortedTransactionsWithSplits: O,
326
+ tags: S
327
+ } = Ct(), T = o?.master?.deep_link_params?.account_guids, k = o?.master?.deep_link_params?.view, [$, H] = a.useState(""), [I, pt] = a.useState(k === "income" ? 1 : 0), [K, U] = a.useState(""), [ut, X] = a.useState(!1);
328
+ gt({
329
+ widgetName: "SpendingWidget",
330
+ isLoaded: n
331
+ }), a.useEffect(() => {
332
+ s(
333
+ h,
334
+ g.start,
335
+ g.end
488
336
  ).finally();
489
- }, [d, e]);
490
- const k = p.useMemo(
491
- () => ct(r, i, n, l),
492
- [r, l]
493
- ), K = p.useMemo(
494
- () => dt(r, l, $t(n)),
495
- [r, l]
496
- ), $ = p.useMemo(
497
- () => m.find((f) => f.guid === L),
498
- [L, m]
499
- ), ut = (f, A) => {
500
- D(A), E("");
501
- }, X = (f) => {
502
- E(b === f || f === "0" ? "" : f);
503
- }, Y = (f) => {
504
- const A = {
505
- accounts: T || u,
506
- dateRange: e
337
+ }, [h, g]);
338
+ const B = a.useMemo(
339
+ () => ct(r, u, e, i),
340
+ [r, i]
341
+ ), Y = a.useMemo(
342
+ () => lt(r, i, $t(e)),
343
+ [r, i]
344
+ ), G = a.useMemo(
345
+ () => f.find((p) => p.guid === K),
346
+ [K, f]
347
+ ), mt = (p, D) => {
348
+ pt(D), H("");
349
+ }, q = (p) => {
350
+ H($ === p || p === "0" ? "" : p);
351
+ }, J = (p) => {
352
+ const D = {
353
+ accounts: T || v,
354
+ dateRange: g
507
355
  };
508
- if (_ === 0)
509
- if (f === "other") {
510
- const M = k.categoryData.find((G) => G.guid === "other");
511
- s({
512
- ...A,
513
- custom: (G) => !!M?.categoryTotals?.find((pt) => pt.guid === G.top_level_category_guid)
356
+ if (I === 0)
357
+ if (p === "other") {
358
+ const b = B.categoryData.find((j) => j.guid === "other");
359
+ _({
360
+ ...D,
361
+ custom: (j) => !!b?.categoryTotals?.find((ft) => ft.guid === j.top_level_category_guid)
514
362
  });
515
363
  } else
516
- s({
517
- ...A,
518
- custom: (M) => f ? M.top_level_category_guid === f : M.top_level_category_guid !== S.INCOME && M.top_level_category_guid !== S.INVESTMENTS && M.top_level_category_guid !== S.TRANSFER,
519
- showSplits: !!f
364
+ _({
365
+ ...D,
366
+ custom: (b) => p ? b.top_level_category_guid === p : b.top_level_category_guid !== L.INCOME && b.top_level_category_guid !== L.INVESTMENTS && b.top_level_category_guid !== L.TRANSFER,
367
+ showSplits: !!p
520
368
  });
521
369
  else
522
- s({
523
- ...A,
524
- custom: (M) => f ? M.category_guid === f : M.category_guid === S.INCOME || M.top_level_category_guid === S.INCOME
370
+ _({
371
+ ...D,
372
+ custom: (b) => p ? b.category_guid === p : b.category_guid === L.INCOME || b.top_level_category_guid === L.INCOME
525
373
  });
526
- P(!0);
374
+ X(!0);
375
+ }, ht = () => {
376
+ xt(O, S);
527
377
  };
528
- return /* @__PURE__ */ h(x, { children: [
529
- /* @__PURE__ */ h(at, { onChange: ut, value: _, variant: "fullWidth", children: [
378
+ return /* @__PURE__ */ l(M, { children: [
379
+ /* @__PURE__ */ l(st, { onChange: mt, value: I, variant: "fullWidth", children: [
530
380
  /* @__PURE__ */ t(
531
- N,
381
+ E,
532
382
  {
533
383
  label: /* @__PURE__ */ t(
534
- W,
384
+ N,
535
385
  {
536
- amount: k.totalAmount,
537
- label: o.spend_tab_title
386
+ amount: B.totalAmount,
387
+ label: c.spend_tab_title
538
388
  }
539
389
  )
540
390
  }
541
391
  ),
542
392
  /* @__PURE__ */ t(
543
- N,
393
+ E,
544
394
  {
545
395
  label: /* @__PURE__ */ t(
546
- W,
396
+ N,
547
397
  {
548
- amount: K.totalAmount,
549
- label: o.income_tab_title
398
+ amount: Y.totalAmount,
399
+ label: c.income_tab_title
550
400
  }
551
401
  )
552
402
  }
553
403
  )
554
404
  ] }),
555
- _ === 0 && /* @__PURE__ */ t(
556
- et,
405
+ I === 0 && /* @__PURE__ */ t(
406
+ at,
557
407
  {
558
- data: k,
559
- onSelected: X,
560
- onViewTransactions: Y,
561
- selectedId: b,
562
- title: o.spend_tab_title
408
+ data: B,
409
+ onSelected: q,
410
+ onViewTransactions: J,
411
+ selectedId: $,
412
+ title: c.spend_tab_title
563
413
  }
564
414
  ),
565
- _ === 1 && /* @__PURE__ */ t(
566
- et,
415
+ I === 1 && /* @__PURE__ */ t(
416
+ at,
567
417
  {
568
- data: K,
569
- onSelected: X,
570
- onViewTransactions: Y,
571
- selectedId: b,
572
- title: o.income_tab_title
418
+ data: Y,
419
+ onSelected: q,
420
+ onViewTransactions: J,
421
+ selectedId: $,
422
+ title: c.income_tab_title
573
423
  }
574
424
  ),
575
425
  /* @__PURE__ */ t(
576
- Q,
426
+ nt,
577
427
  {
578
- ariaLabelClose: o.close_drawer_aria,
579
- isOpen: gt,
580
- onClose: () => P(!1),
581
- title: o.transactions_drawer_title,
582
- children: /* @__PURE__ */ t(Dt, { onClick: H })
428
+ ariaLabelClose: c.close_drawer_aria,
429
+ isOpen: ut,
430
+ onClose: () => X(!1),
431
+ title: c.transactions_drawer_title,
432
+ children: /* @__PURE__ */ l(C, { children: [
433
+ !d && f.length > 0 && /* @__PURE__ */ t(C, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ t(
434
+ Tt,
435
+ {
436
+ onClick: ht,
437
+ startIcon: /* @__PURE__ */ t(_t, { name: "ios_share" }),
438
+ variant: "text",
439
+ children: m.export_csv_btn
440
+ }
441
+ ) }),
442
+ /* @__PURE__ */ t(wt, { onClick: U })
443
+ ] })
583
444
  }
584
445
  ),
585
446
  /* @__PURE__ */ t(
586
- Q,
447
+ nt,
587
448
  {
588
- ariaLabelClose: o.close_drawer_aria,
589
- isOpen: !!$,
590
- onClose: () => H(""),
591
- title: o.transaction_details_drawer_title,
592
- children: $ && /* @__PURE__ */ t(xt, { transaction: $ })
449
+ ariaLabelClose: c.close_drawer_aria,
450
+ isOpen: !!G,
451
+ onClose: () => U(""),
452
+ title: c.transaction_details_drawer_title,
453
+ children: G && /* @__PURE__ */ t(vt, { transaction: G })
593
454
  }
594
455
  )
595
456
  ] });
596
- }, Bt = v(Gt), jt = ({ onBackClick: n, sx: c = {} }) => {
597
- const { visibleAccounts: r } = rt(), { spending: l } = I(), { isCopyLoaded: a, isInitialized: i, setDisplayedDate: o, setSelectedAccounts: e } = R(), { onEvent: d } = St(), { clientConfig: u } = st(), s = u?.master?.deep_link_params?.date_range, [m, T] = p.useState(!1);
598
- p.useEffect(() => {
599
- e(r);
600
- }, [r]), p.useEffect(() => {
601
- s && Array.isArray(s) && s.length === 2 ? o(s[0], s[1]) : o(nt(U()), ot(U())), T(!0), d(Z.SPENDING_VIEW);
457
+ }, Gt = x(Bt), jt = ({ onBackClick: e, sx: d = {} }) => {
458
+ const { visibleAccounts: o } = dt(), { spending: r } = w(), { isCopyLoaded: i, isInitialized: s, setDisplayedDate: n, setSelectedAccounts: u } = R(), { onEvent: c } = yt(), { clientConfig: m } = V(), g = m?.master?.deep_link_params?.date_range, [h, v] = a.useState(!1);
459
+ a.useEffect(() => {
460
+ u(o);
461
+ }, [o]), a.useEffect(() => {
462
+ g && Array.isArray(g) && g.length === 2 ? n(g[0], g[1]) : n(it(Z()), rt(Z())), v(!0), c(ot.SPENDING_VIEW);
602
463
  }, []);
603
- const g = (b) => {
604
- o(b[0], b[1]);
464
+ const _ = (f) => {
465
+ n(f[0], f[1]);
605
466
  };
606
- return !a || !i || !m ? /* @__PURE__ */ t(F, {}) : /* @__PURE__ */ t(
607
- It,
467
+ return !i || !s || !h ? /* @__PURE__ */ t(P, {}) : /* @__PURE__ */ t(
468
+ At,
608
469
  {
609
- accountOptions: r,
610
- calendarActions: { onRangeChanged: g },
611
- onAccountsFilterClick: () => d(Z.SPENDING_CLICK_FILTER),
612
- onBackClick: n,
613
- sx: c,
614
- title: l.title,
615
- children: /* @__PURE__ */ t(x, { height: "calc(100dvh - 150px)", overflow: "scroll", width: "100%", children: /* @__PURE__ */ t(Bt, {}) })
470
+ accountOptions: o,
471
+ calendarActions: { onRangeChanged: _ },
472
+ onAccountsFilterClick: () => c(ot.SPENDING_CLICK_FILTER),
473
+ onBackClick: e,
474
+ sx: d,
475
+ title: r.title,
476
+ children: /* @__PURE__ */ t(M, { width: "100%", children: /* @__PURE__ */ t(Gt, {}) })
616
477
  }
617
478
  );
618
- }, Ce = v(jt);
479
+ }, Ce = x(jt);
619
480
  export {
620
- be as SpendingMiniWidget,
481
+ _e as SpendingMiniWidget,
621
482
  Ce as SpendingWidget
622
483
  };