@mx-cartographer/experiences 8.0.0-alpha.sms2 → 9.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 (139) hide show
  1. package/CHANGELOG.md +217 -0
  2. package/dist/{Account-Cp30A3ad.mjs → Account-BIKn4XEZ.mjs} +1 -1
  3. package/dist/Account-CMjOp7S2.mjs +118 -0
  4. package/dist/AccountApi-DgZ8ILj1.mjs +19 -0
  5. package/dist/AccountDetailsHeader-BOV91g1o.mjs +95 -0
  6. package/dist/AccountDisplayName-CO7z3v99.mjs +11 -0
  7. package/dist/{AccountFields-CW6cIthP.mjs → AccountFields-BRRH37K1.mjs} +10 -11
  8. package/dist/{AccountListItem-DxmAs98Z.mjs → AccountListItem-Ds5C0mOT.mjs} +4 -4
  9. package/dist/{AccountStore-hIs-yA6W.mjs → AccountStore-BFKvXJSD.mjs} +79 -69
  10. package/dist/{Accounts-DUHkUyK4.mjs → Accounts-CuE8aSZN.mjs} +1 -1
  11. package/dist/{BudgetUtil-CIDAPPPT.mjs → BudgetUtil-CDSOZXem.mjs} +4 -4
  12. package/dist/CategorySelectorDrawer-C4aZYP4N.mjs +418 -0
  13. package/dist/CategoryStore-DEqAnHbi.mjs +186 -0
  14. package/dist/{CategoryUtil-DfVKKkRf.mjs → CategoryUtil-CFHBvaV4.mjs} +1 -1
  15. package/dist/{ConnectionsDrawer-CSo6AFkG.mjs → ConnectionsDrawer-BExzgE16.mjs} +5 -5
  16. package/dist/{CurrencyInput-BrGvhgVK.mjs → CurrencyInput-DDQ4DBrE.mjs} +1 -1
  17. package/dist/{CurrencyText-Dr0EZ7bp.mjs → CurrencyText-C-85TnUF.mjs} +3 -3
  18. package/dist/{DateUtil-CDPZw_-m.mjs → DateUtil-CVsMhbZU.mjs} +3 -3
  19. package/dist/{DebtsStore-hi1cqrRk.mjs → DebtsStore-Dv_T7Dts.mjs} +12 -12
  20. package/dist/{Dialog-CDV0kKxj.mjs → Dialog-CWymUiuO.mjs} +32 -35
  21. package/dist/Drawer-Bet2ZPJo.mjs +176 -0
  22. package/dist/{ExportCsvAction-CQ1grpwo.mjs → ExportCsvAction-oG_Mn66T.mjs} +3 -3
  23. package/dist/{FinstrongStore-dKZOZ2hM.mjs → FinstrongStore-BjFkMTIL.mjs} +6 -6
  24. package/dist/GlobalAccountFilter-BpWlPAl5.mjs +316 -0
  25. package/dist/{GoalStore-CFeAJloA.mjs → GoalStore-Dbjgft2i.mjs} +155 -137
  26. package/dist/{Help-i4OasOO-.mjs → Help-BW_ar-4B.mjs} +2 -2
  27. package/dist/LineChart-DHj-Bufi.mjs +580 -0
  28. package/dist/{ListItemAction-BNCWQAN_.mjs → ListItemAction-Cbr3417C.mjs} +10 -10
  29. package/dist/{ManageIncome-D_qVX5dN.mjs → ManageIncome-DIIyqDTp.mjs} +85 -85
  30. package/dist/{MicroWidgetContainer-BGpNl5ZS.mjs → MicroWidgetContainer-DSyYwRCU.mjs} +2 -2
  31. package/dist/{MiniWidgetContainer-D7MkHG15.mjs → MiniWidgetContainer-DKn7ndO6.mjs} +1 -1
  32. package/dist/NetWorthStore-B6ziBtaH.mjs +168 -0
  33. package/dist/NotificationSettings-e789PcRb.mjs +676 -0
  34. package/dist/{OriginalBalanceAction-62e0mU_3.mjs → OriginalBalanceAction-DFoG79Ba.mjs} +3 -3
  35. package/dist/{RecurringSettings-RfZ8Wuhh.mjs → RecurringSettings-BpCUcE8w.mjs} +4 -4
  36. package/dist/{RecurringTransactionsStore-D3EOKZ2B.mjs → RecurringTransactionsStore-D_--5PWH.mjs} +1 -1
  37. package/dist/{RecurringTransactions-Bhx56aA3.mjs → RepeatingTransaction-C2txVA9O.mjs} +3 -3
  38. package/dist/{SettingsStore-BASMQSIp.mjs → SettingsStore-CInvh-rQ.mjs} +1 -1
  39. package/dist/SpendingData-B7NuTQ9s.mjs +53 -0
  40. package/dist/SpendingLegend-BxefXiQd.mjs +193 -0
  41. package/dist/TransactionDetails-CPwv9xtZ.mjs +1374 -0
  42. package/dist/{TransactionStore-DgLrYW4C.mjs → TransactionStore-D2aMUClq.mjs} +128 -111
  43. package/dist/TrendsStore-BdsYfCc7.mjs +183 -0
  44. package/dist/{User-DqNX2GAK.mjs → User-CulNdZUr.mjs} +21 -20
  45. package/dist/ViewMoreMicroCard-CDWR16_h.mjs +1147 -0
  46. package/dist/WidgetContainer-mzejMmz2.mjs +555 -0
  47. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +1 -0
  48. package/dist/accounts/index.es.js +933 -232
  49. package/dist/accounts/stores/AccountStore.d.ts +6 -2
  50. package/dist/accounts/utils/AccountDetails.d.ts +5 -0
  51. package/dist/analytics/index.es.js +2 -2
  52. package/dist/budgets/components/AddBudgets.d.ts +2 -1
  53. package/dist/budgets/index.es.js +561 -522
  54. package/dist/cashflow/index.es.js +397 -396
  55. package/dist/categories/components/CustomCategories/AddSubcategory.d.ts +1 -0
  56. package/dist/categories/components/CustomCategories/DeleteSubcategory.d.ts +1 -0
  57. package/dist/categories/components/CustomCategories/RenameSubcategory.d.ts +1 -0
  58. package/dist/categories/components/SubcategoryRow.d.ts +1 -0
  59. package/dist/categories/index.es.js +2 -2
  60. package/dist/categories/stores/CategoryStore.d.ts +5 -3
  61. package/dist/common/components/GlobalAccountFilter.d.ts +11 -0
  62. package/dist/common/components/WidgetContainer.d.ts +7 -6
  63. package/dist/common/components/charts/linechart/CustomTooltip.d.ts +6 -1
  64. package/dist/common/components/charts/stackedlinechart/CustomPointTooltip.d.ts +5 -2
  65. package/dist/common/components/globalaccountfilter/GlobalAccountFilterList.d.ts +7 -0
  66. package/dist/common/components/index.d.ts +2 -2
  67. package/dist/common/hooks/index.d.ts +1 -0
  68. package/dist/common/hooks/useWidgetLoadTimer.d.ts +6 -0
  69. package/dist/common/index.es.js +325 -306
  70. package/dist/common/stores/GlobalUiStore.d.ts +7 -4
  71. package/dist/common/types/localization/AccountsCopy.d.ts +6 -0
  72. package/dist/common/types/localization/CategoryCopy.d.ts +3 -0
  73. package/dist/common/types/localization/CommonCopy.d.ts +3 -0
  74. package/dist/common/types/localization/GoalsCopy.d.ts +3 -1
  75. package/dist/common/types/localization/MicroInsightsCopy.d.ts +1 -0
  76. package/dist/common/types/localization/TransactionsCopy.d.ts +4 -0
  77. package/dist/common/types/localization/TrendsCopy.d.ts +4 -0
  78. package/dist/dashboard/index.es.js +95 -125
  79. package/dist/debts/index.es.js +466 -460
  80. package/dist/{exportTransactionsToCSV-BFpuIAXW.mjs → exportTransactionsToCSV-BU1jTY0Q.mjs} +4 -4
  81. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +4 -5
  82. package/dist/finstrong/index.es.js +1660 -1553
  83. package/dist/goals/index.es.js +716 -677
  84. package/dist/goals/stores/GoalStore.d.ts +2 -0
  85. package/dist/help/index.es.js +14 -10
  86. package/dist/{hooks-C41HAxM5.mjs → hooks-fY_n74f7.mjs} +16 -16
  87. package/dist/investments/index.es.js +464 -457
  88. package/dist/merchants/index.es.js +1 -1
  89. package/dist/microinsights/MicroCardTemplate.d.ts +23 -0
  90. package/dist/microinsights/beaticons/BeatMaterialIcon.d.ts +8 -0
  91. package/dist/microinsights/beaticons/MonthlySpendComparisonIcon.d.ts +1 -2
  92. package/dist/microinsights/beaticons/index.d.ts +1 -0
  93. package/dist/microinsights/cards/InsightCard.d.ts +0 -2
  94. package/dist/microinsights/cards/ViewMoreMicroCard.d.ts +2 -5
  95. package/dist/microinsights/index.d.ts +2 -2
  96. package/dist/microinsights/index.es.js +824 -14
  97. package/dist/networth/components/NetWorthChart.d.ts +3 -2
  98. package/dist/networth/components/NetWorthList.d.ts +3 -3
  99. package/dist/networth/index.es.js +433 -438
  100. package/dist/networth/stores/NetWorthStore.d.ts +20 -9
  101. package/dist/networth/utils/NetWorthUtils.d.ts +2 -2
  102. package/dist/notifications/index.es.js +5 -5
  103. package/dist/recurringtransactions/index.es.js +331 -325
  104. package/dist/settings/index.es.js +293 -285
  105. package/dist/spending/components/SpendingChart.d.ts +1 -1
  106. package/dist/spending/components/SpendingList.d.ts +1 -1
  107. package/dist/spending/components/SpendingTabLabel.d.ts +1 -0
  108. package/dist/spending/index.es.js +250 -235
  109. package/dist/transactions/index.es.js +288 -281
  110. package/dist/transactions/stores/TransactionStore.d.ts +5 -0
  111. package/dist/trends/components/TrendsTable.d.ts +0 -2
  112. package/dist/trends/index.es.js +876 -802
  113. package/dist/trends/utils/TrendsData.d.ts +1 -0
  114. package/dist/trends/utils/TrendsTable.d.ts +12 -0
  115. package/dist/{useAccountDisplayName-usSZCQ7I.mjs → useAccountDisplayName-DbkgGLdg.mjs} +2 -2
  116. package/dist/useAriaLive-B3_pRUio.mjs +35 -0
  117. package/dist/{useInsightsEnabled-CNjP5cfR.mjs → useInsightsEnabled-dhmXeSyF.mjs} +1 -1
  118. package/dist/useWidgetLoadTimer-CrUzxN-P.mjs +19 -0
  119. package/package.json +26 -21
  120. package/dist/AccountDetailsContent-C1HumFnW.mjs +0 -683
  121. package/dist/AccountDetailsHeader-NMx79DGs.mjs +0 -87
  122. package/dist/CategorySelectorDrawer-DqDAA_5I.mjs +0 -399
  123. package/dist/CategoryStore-MUwRWH9e.mjs +0 -176
  124. package/dist/ConnectDrawer-Dn1MlqLz.mjs +0 -545
  125. package/dist/Drawer-Dqe5EqvA.mjs +0 -163
  126. package/dist/LineChart-bc1D9xBE.mjs +0 -581
  127. package/dist/NetWorthStore-8FFC1Bs0.mjs +0 -150
  128. package/dist/NotificationSettings-BsWiYD94.mjs +0 -672
  129. package/dist/SpendingData-DPQ96k3x.mjs +0 -55
  130. package/dist/SpendingLegend-CZzDb-7d.mjs +0 -193
  131. package/dist/TransactionDetails-Duv1X9ec.mjs +0 -1379
  132. package/dist/TrendsStore-_mRaFUdf.mjs +0 -182
  133. package/dist/ViewMoreMicroCard-CH9E-jOx.mjs +0 -1930
  134. package/dist/WidgetContainer-B1Jzb4XA.mjs +0 -565
  135. package/dist/common/components/accountfilter/AccountFilter.d.ts +0 -20
  136. package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +0 -31
  137. package/dist/common/components/accountfilter/index.d.ts +0 -1
  138. package/dist/microinsights/cards/BaseCard.d.ts +0 -13
  139. package/dist/{ToggleListItem-ciFTiqRS.mjs → Notification-Bs1fdbzI.mjs} +1 -1
@@ -1,110 +1,118 @@
1
- import { jsx as t, jsxs as r, Fragment as v } from "react/jsx-runtime";
2
- import { fromUnixTime as _t } from "date-fns/fromUnixTime";
3
- import { observer as w } from "mobx-react-lite";
4
- import { useTheme as z } from "@mui/material/styles";
5
- import { L as wt } from "../LineChart-bc1D9xBE.mjs";
6
- import { u as Z } from "../useScreenSize-B6JyS_Lj.mjs";
7
- import { q as bt, u as T, d as J, g as Q, b as P, r as tt, n as Wt } from "../hooks-C41HAxM5.mjs";
8
- import { f as vt, a as It } from "../Dialog-CDV0kKxj.mjs";
9
- import W from "@mui/material/Divider";
10
- import B from "@mui/material/List";
1
+ import { jsx as e, jsxs as o, Fragment as D } from "react/jsx-runtime";
2
+ import { fromUnixTime as oe } from "date-fns/fromUnixTime";
3
+ import { observer as S } from "mobx-react-lite";
4
+ import ie from "@mui/material/Stack/Stack";
5
+ import { useTheme as j } from "@mui/material/styles";
6
+ import { L as ae } from "../LineChart-DHj-Bufi.mjs";
7
+ import { p as se, q as R, u as N, g as z, d as ce, b as Y } from "../hooks-fY_n74f7.mjs";
8
+ import { u as q } from "../useScreenSize-B6JyS_Lj.mjs";
9
+ import { f as le, D as me } from "../Dialog-CWymUiuO.mjs";
10
+ import u from "react";
11
+ import de from "@mui/material/Button";
12
+ import T from "@mui/material/Divider";
13
+ import $ from "@mui/material/List";
11
14
  import k from "@mui/material/ListSubheader";
12
- import h from "@mui/material/Stack";
13
- import { Text as m, Icon as H, H1 as Tt, P as Lt } from "@mxenabled/mxui";
14
- import d from "react";
15
- import D from "@mui/material/ListItem";
16
- import et from "@mui/material/ListItemButton";
15
+ import d from "@mui/material/Stack";
16
+ import { Text as m, Icon as B, P as Z } from "@mxenabled/mxui";
17
+ import A from "@mui/material/ListItem";
18
+ import J from "@mui/material/ListItemButton";
17
19
  import _ from "@mui/material/ListItemText";
18
- import { i as nt } from "../DateUtil-CDPZw_-m.mjs";
19
- import { C as y } from "../CurrencyText-Dr0EZ7bp.mjs";
20
- import { Button as Nt, Stack as Et } from "@mui/material";
21
- import { format as kt, fromUnixTime as Dt, differenceInMonths as At } from "date-fns";
22
- import { g as K } from "../NetWorthStore-8FFC1Bs0.mjs";
23
- import { N as Re } from "../NetWorthStore-8FFC1Bs0.mjs";
24
- import { Icon as ot } from "@mxenabled/mx-icons";
20
+ import { i as Q } from "../DateUtil-CVsMhbZU.mjs";
21
+ import { C as x } from "../CurrencyText-C-85TnUF.mjs";
22
+ import P from "@mui/material/styles/useTheme";
23
+ import { Stack as he } from "@mui/material";
24
+ import ee from "@mui/material/Box";
25
+ import pe from "@mui/material/Collapse";
26
+ import X from "@mui/material/ListItemIcon";
27
+ import { g as F } from "../NetWorthStore-B6ziBtaH.mjs";
28
+ import { N as vt } from "../NetWorthStore-B6ziBtaH.mjs";
29
+ import { D as K } from "../Drawer-Bet2ZPJo.mjs";
30
+ import { A as v, W as ue } from "../WidgetContainer-mzejMmz2.mjs";
31
+ import { format as fe, fromUnixTime as xe, differenceInMonths as ge } from "date-fns";
32
+ import { Icon as te } from "@mxenabled/mx-icons";
25
33
  import { f as U } from "../NumberFormatting-DjTD0t3W.mjs";
26
- import { L as O } from "../Loader-BSWSYqvn.mjs";
27
- import { M as Mt } from "../MicroWidgetContainer-BGpNl5ZS.mjs";
28
- import { A as b, W as Ht } from "../WidgetContainer-B1Jzb4XA.mjs";
29
- import rt from "@mui/material/Box";
30
- import { C as Bt } from "../ConnectionsDrawer-CSo6AFkG.mjs";
31
- import Ot from "@mui/material/Collapse";
32
- import V from "@mui/material/ListItemIcon";
33
- import it from "@mui/material/styles/useTheme";
34
- import { D as Y } from "../Drawer-Dqe5EqvA.mjs";
35
- import { E as zt } from "../EmptyState-DoxNUae-.mjs";
36
- const Rt = ({
37
- chartData: e,
38
- hoveredData: l,
39
- onDataClick: i,
40
- onMouseEnter: n,
41
- onMouseLeave: s,
42
- selectedData: o
43
- }) => {
44
- const { isMobile: a } = Z(), { availableWidth: c } = bt(), u = z(), C = c - 320, x = e.map((f) => ({
45
- x: vt(_t(f.x), It.MONTH_SHORT),
46
- y: f.y
47
- })), g = o ? { index: e.findIndex((f) => f.x === o.x) } : void 0, S = l ? { index: e.findIndex((f) => f.x === l.x) } : void 0, p = (f) => ({
48
- fill: f === g?.index ? u.palette.success.main : "",
49
- filter: f === S?.index ? `drop-shadow(0px 0px 10px ${u.palette.success.main})` : "none",
50
- stroke: u.palette.success.main
51
- });
52
- return /* @__PURE__ */ t(
53
- wt,
34
+ import { L as ne } from "../Loader-BSWSYqvn.mjs";
35
+ import { M as ye } from "../MicroWidgetContainer-DSyYwRCU.mjs";
36
+ import { u as re } from "../useWidgetLoadTimer-CrUzxN-P.mjs";
37
+ import { C as Ce } from "../ConnectionsDrawer-BExzgE16.mjs";
38
+ import { E as _e } from "../EmptyState-DoxNUae-.mjs";
39
+ const Se = () => {
40
+ const { isMobile: t } = q(), { availableWidth: a } = se(), i = j(), {
41
+ hoveredData: n,
42
+ netWorthChartData: s,
43
+ selectedData: r,
44
+ setHoveredIndex: c,
45
+ setSelectedIndex: l
46
+ } = R(), f = a - 320, g = s.map((h) => ({
47
+ x: le(oe(h.x), me.MONTH_SHORT),
48
+ y: h.y
49
+ })), w = r ? { index: s.findIndex((h) => h.x === r.x) } : void 0, y = n ? { index: s.findIndex((h) => h.x === n.x) } : void 0, b = (h) => ({
50
+ fill: h === w?.index ? i.palette.success.main : "",
51
+ filter: h === y?.index ? `drop-shadow(0px 0px 10px ${i.palette.success.main})` : "none",
52
+ stroke: i.palette.success.main
53
+ }), I = (h, M) => {
54
+ l(M);
55
+ }, L = (h) => {
56
+ c(h);
57
+ }, E = () => {
58
+ c(-1);
59
+ };
60
+ return /* @__PURE__ */ e(ie, { sx: { width: "100%" }, children: /* @__PURE__ */ e(
61
+ ae,
54
62
  {
55
63
  baseline: "min",
56
64
  chartFor: "networthChart",
57
65
  chartXaxisSx: { "& .MuiChartsAxis-tickLabel": { transform: "translateX(8px)" } },
58
66
  chartYaxisSx: { "& .MuiChartsAxis-tickLabel": { transform: "translateX(-8px)" } },
59
- colors: [u.palette.success.main],
60
- datasets: [x],
67
+ colors: [i.palette.success.main],
68
+ datasets: [g],
61
69
  height: 350,
62
70
  labels: [],
63
- margin: { right: 20, left: 100 },
64
- markHandlers: { onMarkClick: i, onMouseEnter: n, onMouseLeave: s },
65
- markStyles: p,
71
+ margin: { right: 20, left: 38 },
72
+ markHandlers: { onMarkClick: I, onMouseEnter: L, onMouseLeave: E },
73
+ markStyles: b,
66
74
  showArea: !0,
67
75
  useCustomMark: !0,
68
76
  valueFormatterString: "0.0[0]a",
69
- width: a ? 320 : C
77
+ width: t ? a - 48 : f
70
78
  }
71
- );
72
- }, jt = w(Rt), $t = ({
73
- item: e,
74
- getStyles: l,
79
+ ) });
80
+ }, we = S(Se), be = ({
81
+ item: t,
82
+ getStyles: a,
75
83
  isHovered: i = !1,
76
84
  isSelected: n = !1,
77
85
  onItemClick: s,
78
- onMouseEnter: o,
79
- onMouseLeave: a
86
+ onMouseEnter: r,
87
+ onMouseLeave: c
80
88
  }) => {
81
- const [c, u] = d.useState({
89
+ const [l, f] = u.useState({
82
90
  color: ""
83
91
  });
84
- return d.useEffect(() => {
85
- u(l(e));
86
- }, [i, n]), /* @__PURE__ */ r(d.Fragment, { children: [
87
- /* @__PURE__ */ t(
88
- D,
92
+ return u.useEffect(() => {
93
+ f(a(t));
94
+ }, [i, n]), /* @__PURE__ */ o(u.Fragment, { children: [
95
+ /* @__PURE__ */ e(
96
+ A,
89
97
  {
90
98
  sx: {
91
- ...c,
99
+ ...l,
92
100
  minHeight: 44,
93
- "&:hover": { color: n ? "inherit" : c.color }
101
+ "&:hover": { color: n ? "inherit" : l.color }
94
102
  },
95
- children: /* @__PURE__ */ t(
96
- et,
103
+ children: /* @__PURE__ */ e(
104
+ J,
97
105
  {
98
- onClick: (C) => s?.(C, e.x),
99
- onMouseEnter: () => o(e.x),
100
- onMouseLeave: () => a(),
106
+ onClick: (g) => s?.(g, t.x),
107
+ onMouseEnter: () => r(t.x),
108
+ onMouseLeave: () => c(),
101
109
  sx: { minHeight: 20, padding: 12 },
102
- children: /* @__PURE__ */ t(
110
+ children: /* @__PURE__ */ e(
103
111
  _,
104
112
  {
105
- primary: /* @__PURE__ */ r(h, { direction: "row", justifyContent: "space-between", sx: { fontWeight: 400 }, children: [
106
- /* @__PURE__ */ t(m, { variant: "Body", children: nt(e.x) }),
107
- /* @__PURE__ */ t(y, { amount: e.y, sx: { color: "inherit" }, variant: "Body" })
113
+ primary: /* @__PURE__ */ o(d, { direction: "row", justifyContent: "space-between", sx: { fontWeight: 400 }, children: [
114
+ /* @__PURE__ */ e(m, { variant: "Body", children: Q(t.x) }),
115
+ /* @__PURE__ */ e(x, { amount: t.y, sx: { color: "inherit" }, variant: "Body" })
108
116
  ] })
109
117
  }
110
118
  )
@@ -112,164 +120,154 @@ const Rt = ({
112
120
  )
113
121
  }
114
122
  ),
115
- /* @__PURE__ */ t(W, {})
116
- ] }, e.x);
117
- }, Gt = w($t), Xt = ({
118
- chartData: e,
119
- hoveredData: l,
120
- onDataClick: i,
121
- onButtonClick: n,
122
- onMouseEnter: s,
123
- onMouseLeave: o,
124
- selectedData: a
125
- }) => {
126
- const { net_worth: c } = T(), u = z(), C = (x) => {
127
- const g = x.x === l?.x, S = x.x === a?.x, p = {
128
- backgroundColor: "inherit",
129
- borderBottom: "inherit",
130
- color: "inherit"
131
- };
132
- return g && (p.color = S ? "inherit" : p.color, p.backgroundColor = u.palette.action.hover), S && (p.backgroundColor = u.palette.primary.main, p.borderBottom = u.palette.border.light, p.color = u.palette.common.white), p;
133
- };
134
- return /* @__PURE__ */ r(h, { direction: "column", sx: { width: 320 }, children: [
135
- /* @__PURE__ */ r(B, { children: [
136
- /* @__PURE__ */ t(k, { sx: { backgroundColor: "transparent", mb: 8, mt: 12, px: 12 }, children: /* @__PURE__ */ t(m, { bold: !0, component: "h2", variant: "Body", children: c.monthly_totals }) }),
137
- /* @__PURE__ */ t(W, {}),
138
- e.map((x, g) => /* @__PURE__ */ t(
139
- Gt,
140
- {
141
- getStyles: C,
142
- isHovered: x.x === l?.x,
143
- isSelected: x.x === a?.x,
144
- item: x,
145
- onItemClick: (S) => i(S, g),
146
- onMouseEnter: () => s(g),
147
- onMouseLeave: () => o()
148
- },
149
- x.x
150
- ))
151
- ] }),
152
- /* @__PURE__ */ t(
153
- Nt,
154
- {
155
- onClick: () => n(),
156
- sx: { alignSelf: "center", marginTop: 16, width: "fit-content" },
157
- variant: "outlined",
158
- children: c.view_assets_and_liabilities
159
- }
160
- )
161
- ] });
162
- }, Ft = w(Xt), Kt = ({
163
- currencyLabel: e,
164
- currencyVariant: l = "Small",
123
+ /* @__PURE__ */ e(T, {})
124
+ ] }, t.x);
125
+ }, ve = S(be), We = ({
126
+ currencyLabel: t,
127
+ currencyVariant: a = "Small",
165
128
  iconSize: i,
166
129
  netWorth: n,
167
130
  theme: s
168
131
  }) => {
169
- let o = s.palette.secondary.main, a = s.palette.secondary.main, c = "trending_flat";
170
- return n.change < 0 ? c = "trending_down" : n.change > 0 && (o = s.palette.success.main, a = s.palette.success.main, c = "trending_up"), /* @__PURE__ */ r(Et, { alignItems: "center", direction: "row", spacing: 4, children: [
171
- /* @__PURE__ */ t(
172
- H,
132
+ let r = s.palette.secondary.main, c = s.palette.secondary.main, l = "trending_flat";
133
+ return n.change < 0 ? l = "trending_down" : n.change > 0 && (r = s.palette.success.main, c = s.palette.success.main, l = "trending_up"), /* @__PURE__ */ o(he, { alignItems: "center", direction: "row", spacing: 4, children: [
134
+ /* @__PURE__ */ e(
135
+ B,
173
136
  {
174
- name: c,
137
+ name: l,
175
138
  size: i,
176
139
  sx: {
177
- color: o
140
+ color: r
178
141
  }
179
142
  }
180
143
  ),
181
- /* @__PURE__ */ t(y, { amount: n.change, color: a, variant: l }),
182
- /* @__PURE__ */ t(m, { variant: "Small", children: e })
183
- ] });
184
- }, R = w(Kt), Ut = ({ hoveredData: e, selectedData: l }) => {
185
- const { net_worth: i } = T(), n = z(), s = e || l, o = kt(Dt(s.x), "MMMM");
186
- return /* @__PURE__ */ r(h, { alignItems: "center", direction: "column", m: 24, children: [
187
- /* @__PURE__ */ t(m, { color: n.palette.secondary.main, variant: "Small", children: `${o} ${i.net_worth}` }),
188
- /* @__PURE__ */ t(y, { amount: s.y, variant: "H2" }),
189
- /* @__PURE__ */ t(R, { currencyLabel: i.this_month, netWorth: s, theme: n })
144
+ /* @__PURE__ */ e(x, { amount: n.change, color: c, variant: a }),
145
+ /* @__PURE__ */ e(m, { variant: "Small", children: t })
190
146
  ] });
191
- }, Vt = w(Ut), Yt = ({ amount: e, copy: l, trendValue: i }) => {
192
- const n = i > 0, o = i === 0 ? "trending_flat" : n ? "trending_up" : "trending_down";
193
- return /* @__PURE__ */ r(h, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: [
194
- /* @__PURE__ */ t(Tt, { children: U(e, "0,0") }),
195
- e !== 0 && /* @__PURE__ */ r(h, { sx: { color: n ? "success.main" : "text.secondary" }, children: [
196
- /* @__PURE__ */ r(h, { sx: { flexDirection: "row", gap: 8 }, children: [
197
- /* @__PURE__ */ t(ot, { name: o, size: 20 }),
198
- /* @__PURE__ */ t(m, { sx: { fontWeight: 600, textAlign: "right" }, variant: "body1", children: U(i, "0,0.00") })
199
- ] }),
200
- /* @__PURE__ */ t(m, { sx: { display: "block", textAlign: "right" }, variant: "caption", children: l.this_month })
201
- ] })
202
- ] });
203
- }, qt = ({ copy: e }) => /* @__PURE__ */ r(h, { sx: { flexDirection: "row", gap: 12 }, children: [
204
- /* @__PURE__ */ t(ot, { name: "elevation", size: 32, sx: { color: "text.primary" } }),
205
- /* @__PURE__ */ r(h, { children: [
206
- /* @__PURE__ */ t(m, { sx: { display: "block", fontWeight: 600 }, variant: "body1", children: e.empty_widget_header }),
207
- /* @__PURE__ */ t(Lt, { sx: { color: "text.secondary" }, variant: "body2", children: e.zero_state_description })
208
- ] })
209
- ] }), He = w(({ onCTAClick: e }) => {
210
- const [l, i] = d.useState(!1), { visibleAccounts: n } = J(), { onEvent: s } = Q(), { net_worth: o, common: a } = T(), { isInitialized: c, selectedAccounts: u, setSelectedAccounts: C } = P(), { loadChartData: x, loadNetWorthData: g, netWorthData: S, selectedData: p } = tt(), f = async () => {
211
- await g(u), await x(1), i(!0);
212
- };
213
- if (d.useEffect(() => C(n), [n]), d.useEffect(() => {
214
- c && f().finally(), s(b.NET_WORTH_LOAD_WIDGET, {
215
- state: n?.length ? "default" : "zeroState"
216
- });
217
- }, [c]), !l) return /* @__PURE__ */ t(O, { height: 100 });
218
- const L = () => {
219
- s(
220
- n.length ? b.NET_WORTH_CLICK_VIEW_DETAILS : b.NET_WORTH_CLICK_GET_STARTED
221
- ), e();
222
- };
223
- return /* @__PURE__ */ t(
224
- Mt,
225
- {
226
- className: "mx-networth-microwidget",
227
- ctaLabel: a.see_details,
228
- onCTAClick: L,
229
- title: o.net_worth,
230
- children: S.accounts.length ? /* @__PURE__ */ t(
231
- Yt,
147
+ }, G = S(We), Te = ({
148
+ netWorth: t,
149
+ gains: a,
150
+ losses: i,
151
+ totalGains: n,
152
+ totalLosses: s
153
+ }) => {
154
+ const { net_worth: r } = N(), c = P();
155
+ return /* @__PURE__ */ o(D, { children: [
156
+ /* @__PURE__ */ o(d, { alignItems: "center", justifyContent: "space-between", mb: 8, pt: 24, children: [
157
+ /* @__PURE__ */ e(m, { variant: "Small", children: Q(t?.x) }),
158
+ /* @__PURE__ */ e(m, { variant: "Body", children: r.total_change }),
159
+ t && /* @__PURE__ */ e(G, { currencyVariant: "H1", iconSize: 32, netWorth: t, theme: c })
160
+ ] }),
161
+ /* @__PURE__ */ o($, { children: [
162
+ /* @__PURE__ */ e(k, { sx: { mb: 8, mt: 12, mx: 8 }, children: /* @__PURE__ */ e(
163
+ _,
232
164
  {
233
- amount: p?.y,
234
- copy: o,
235
- trendValue: p?.change
165
+ primary: /* @__PURE__ */ o(d, { direction: "row", justifyContent: "space-between", children: [
166
+ /* @__PURE__ */ e(m, { sx: { fontWeight: 700 }, variant: "XSmall", children: r.gains }),
167
+ /* @__PURE__ */ e(x, { amount: n, sx: { fontWeight: 400 }, variant: "XSmall" })
168
+ ] })
236
169
  }
237
- ) : /* @__PURE__ */ t(qt, { copy: o })
238
- }
239
- );
240
- }), Zt = ({ accounts: e, name: l, icon: i }) => {
241
- const [n, s] = d.useState(!1);
242
- return /* @__PURE__ */ r(v, { children: [
243
- /* @__PURE__ */ t(D, { sx: (o) => ({ backgroundColor: o.palette.background.paper }), children: /* @__PURE__ */ r(et, { onClick: () => s(!n), children: [
244
- i && /* @__PURE__ */ t(V, { children: /* @__PURE__ */ t(H, { name: i, size: 24, sx: { mr: 12 } }) }),
245
- /* @__PURE__ */ t(
170
+ ) }),
171
+ a?.map((l) => /* @__PURE__ */ o(u.Fragment, { children: [
172
+ /* @__PURE__ */ e(A, { sx: { backgroundColor: c.palette.background.paper, py: 14 }, children: /* @__PURE__ */ e(
173
+ _,
174
+ {
175
+ primary: /* @__PURE__ */ o(d, { direction: "row", justifyContent: "space-between", children: [
176
+ /* @__PURE__ */ e(m, { sx: { mr: 10 }, variant: "Body", children: l.accountName }),
177
+ /* @__PURE__ */ e(
178
+ x,
179
+ {
180
+ amount: l.gain,
181
+ sx: { color: c.palette.success.main, flexShrink: 0, fontWeight: 700 },
182
+ variant: "Body"
183
+ }
184
+ )
185
+ ] }),
186
+ sx: { px: 16 }
187
+ }
188
+ ) }),
189
+ /* @__PURE__ */ e(T, {})
190
+ ] }, l.accountName)),
191
+ /* @__PURE__ */ e(k, { sx: { mb: 8, mt: 12, mx: 8 }, children: /* @__PURE__ */ e(
246
192
  _,
247
193
  {
248
- primary: /* @__PURE__ */ t(m, { sx: { fontWeight: 700 }, variant: "Body", children: l })
194
+ primary: /* @__PURE__ */ o(d, { direction: "row", justifyContent: "space-between", children: [
195
+ /* @__PURE__ */ e(m, { sx: { fontWeight: 700 }, variant: "XSmall", children: r.losses }),
196
+ /* @__PURE__ */ e(x, { amount: s, sx: { fontWeight: 400 }, variant: "XSmall" })
197
+ ] })
198
+ }
199
+ ) }),
200
+ i?.map((l) => /* @__PURE__ */ o(D, { children: [
201
+ /* @__PURE__ */ e(
202
+ A,
203
+ {
204
+ sx: { backgroundColor: c.palette.background.paper, py: 14 },
205
+ children: /* @__PURE__ */ e(
206
+ _,
207
+ {
208
+ primary: /* @__PURE__ */ o(d, { direction: "row", justifyContent: "space-between", children: [
209
+ /* @__PURE__ */ e(
210
+ m,
211
+ {
212
+ sx: {
213
+ mr: 10
214
+ },
215
+ variant: "Body",
216
+ children: l.accountName
217
+ }
218
+ ),
219
+ /* @__PURE__ */ e(
220
+ x,
221
+ {
222
+ amount: l.loss,
223
+ sx: { flexShrink: 0, fontWeight: 700 },
224
+ variant: "Body"
225
+ }
226
+ )
227
+ ] }),
228
+ sx: { px: 16 }
229
+ }
230
+ )
231
+ },
232
+ l.accountName
233
+ ),
234
+ /* @__PURE__ */ e(T, {})
235
+ ] }))
236
+ ] })
237
+ ] });
238
+ }, Ie = S(Te), Le = ({ accounts: t, name: a, icon: i }) => {
239
+ const [n, s] = u.useState(!1);
240
+ return /* @__PURE__ */ o(D, { children: [
241
+ /* @__PURE__ */ e(A, { sx: (r) => ({ backgroundColor: r.palette.background.paper }), children: /* @__PURE__ */ o(J, { onClick: () => s(!n), children: [
242
+ i && /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(B, { name: i, size: 24, sx: { mr: 12 } }) }),
243
+ /* @__PURE__ */ e(
244
+ _,
245
+ {
246
+ primary: /* @__PURE__ */ e(m, { sx: { fontWeight: 700 }, variant: "Body", children: a })
249
247
  }
250
248
  ),
251
- /* @__PURE__ */ t(V, { children: n ? /* @__PURE__ */ t(H, { name: "expand_less", size: 24 }) : /* @__PURE__ */ t(H, { name: "expand_more", size: 24 }) })
249
+ /* @__PURE__ */ e(X, { children: n ? /* @__PURE__ */ e(B, { name: "expand_less", size: 24 }) : /* @__PURE__ */ e(B, { name: "expand_more", size: 24 }) })
252
250
  ] }) }),
253
- /* @__PURE__ */ t(W, {}),
254
- /* @__PURE__ */ t(Ot, { in: n, timeout: "auto", unmountOnExit: !0, children: e.map((o, a) => /* @__PURE__ */ r(B, { children: [
255
- /* @__PURE__ */ t(D, { sx: () => ({ py: 14 }), children: /* @__PURE__ */ t(
251
+ /* @__PURE__ */ e(T, {}),
252
+ /* @__PURE__ */ e(pe, { in: n, timeout: "auto", unmountOnExit: !0, children: t.map((r, c) => /* @__PURE__ */ o($, { children: [
253
+ /* @__PURE__ */ e(A, { sx: () => ({ py: 14 }), children: /* @__PURE__ */ e(
256
254
  _,
257
255
  {
258
- primary: /* @__PURE__ */ r(h, { direction: "row", justifyContent: "space-between", sx: { fontWeight: 400 }, children: [
259
- /* @__PURE__ */ t(
256
+ primary: /* @__PURE__ */ o(d, { direction: "row", justifyContent: "space-between", sx: { fontWeight: 400 }, children: [
257
+ /* @__PURE__ */ e(
260
258
  m,
261
259
  {
262
260
  sx: {
263
261
  marginRight: 10
264
262
  },
265
263
  variant: "Body",
266
- children: o.accountName
264
+ children: r.accountName
267
265
  }
268
266
  ),
269
- /* @__PURE__ */ t(
270
- y,
267
+ /* @__PURE__ */ e(
268
+ x,
271
269
  {
272
- amount: o.balance,
270
+ amount: r.balance,
273
271
  sx: {
274
272
  flexShrink: 0
275
273
  },
@@ -280,20 +278,20 @@ const Rt = ({
280
278
  sx: { pl: 72, pr: 16 }
281
279
  }
282
280
  ) }),
283
- a < e.length - 1 ? /* @__PURE__ */ t(W, { variant: "inset" }) : /* @__PURE__ */ t(W, {})
284
- ] }, o.accountName)) })
281
+ c < t.length - 1 ? /* @__PURE__ */ e(T, { variant: "inset" }) : /* @__PURE__ */ e(T, {})
282
+ ] }, r.accountName)) })
285
283
  ] });
286
- }, q = ({ groupedAccounts: e }) => /* @__PURE__ */ t(v, { children: e.map(({ accounts: l, icon: i, name: n }) => /* @__PURE__ */ t(Zt, { accounts: l, icon: i, name: n }, n)) }), Jt = ({
287
- netWorth: e,
288
- assets: l,
284
+ }, V = ({ groupedAccounts: t }) => /* @__PURE__ */ e(D, { children: t.map(({ accounts: a, icon: i, name: n }) => /* @__PURE__ */ e(Le, { accounts: a, icon: i, name: n }, n)) }), De = ({
285
+ netWorth: t,
286
+ assets: a,
289
287
  liabilities: i,
290
288
  totalAssets: n,
291
289
  totalLiabilities: s
292
290
  }) => {
293
- const { net_worth: o } = T(), a = it();
294
- return /* @__PURE__ */ r(v, { children: [
295
- /* @__PURE__ */ r(
296
- rt,
291
+ const { net_worth: r } = N(), c = P();
292
+ return /* @__PURE__ */ o(D, { children: [
293
+ /* @__PURE__ */ o(
294
+ ee,
297
295
  {
298
296
  sx: {
299
297
  alignItems: "center",
@@ -304,194 +302,215 @@ const Rt = ({
304
302
  marginBottom: 8
305
303
  },
306
304
  children: [
307
- /* @__PURE__ */ t(m, { variant: "Body", children: o.current_net_worth }),
308
- /* @__PURE__ */ t(y, { amount: e?.y ?? 0, variant: "H1" }),
309
- e && /* @__PURE__ */ t(
310
- R,
305
+ /* @__PURE__ */ e(m, { variant: "Body", children: r.current_net_worth }),
306
+ /* @__PURE__ */ e(x, { amount: t?.y ?? 0, variant: "H1" }),
307
+ t && /* @__PURE__ */ e(
308
+ G,
311
309
  {
312
- currencyLabel: o.this_month,
310
+ currencyLabel: r.this_month,
313
311
  iconSize: 20,
314
- netWorth: e,
315
- theme: a
312
+ netWorth: t,
313
+ theme: c
316
314
  }
317
315
  )
318
316
  ]
319
317
  }
320
318
  ),
321
- /* @__PURE__ */ r(B, { children: [
322
- /* @__PURE__ */ t(k, { sx: { mb: 8, mt: 12, mx: 8 }, children: /* @__PURE__ */ t(
319
+ /* @__PURE__ */ o($, { children: [
320
+ /* @__PURE__ */ e(k, { sx: { mb: 8, mt: 12, mx: 8 }, children: /* @__PURE__ */ e(
323
321
  _,
324
322
  {
325
- primary: /* @__PURE__ */ r(h, { direction: "row", justifyContent: "space-between", children: [
326
- /* @__PURE__ */ t(m, { sx: { fontWeight: 700 }, variant: "XSmall", children: o.assets }),
327
- /* @__PURE__ */ t(y, { amount: n, sx: { fontWeight: 400 }, variant: "XSmall" })
323
+ primary: /* @__PURE__ */ o(d, { direction: "row", justifyContent: "space-between", children: [
324
+ /* @__PURE__ */ e(m, { sx: { fontWeight: 700 }, variant: "XSmall", children: r.assets }),
325
+ /* @__PURE__ */ e(x, { amount: n, sx: { fontWeight: 400 }, variant: "XSmall" })
328
326
  ] })
329
327
  }
330
328
  ) }),
331
- /* @__PURE__ */ t(q, { groupedAccounts: K(l) }),
332
- /* @__PURE__ */ t(k, { sx: { mb: 8, mt: 12, mx: 8 }, children: /* @__PURE__ */ t(
329
+ /* @__PURE__ */ e(V, { groupedAccounts: F(a) }),
330
+ /* @__PURE__ */ e(k, { sx: { mb: 8, mt: 12, mx: 8 }, children: /* @__PURE__ */ e(
333
331
  _,
334
332
  {
335
- primary: /* @__PURE__ */ r(h, { direction: "row", justifyContent: "space-between", children: [
336
- /* @__PURE__ */ t(m, { sx: { fontWeight: 700 }, variant: "XSmall", children: o.liabilities }),
337
- /* @__PURE__ */ t(y, { amount: s, sx: { fontWeight: 400 }, variant: "XSmall" })
333
+ primary: /* @__PURE__ */ o(d, { direction: "row", justifyContent: "space-between", children: [
334
+ /* @__PURE__ */ e(m, { sx: { fontWeight: 700 }, variant: "XSmall", children: r.liabilities }),
335
+ /* @__PURE__ */ e(x, { amount: s, sx: { fontWeight: 400 }, variant: "XSmall" })
338
336
  ] })
339
337
  }
340
338
  ) }),
341
- /* @__PURE__ */ t(q, { groupedAccounts: K(i) })
339
+ /* @__PURE__ */ e(V, { groupedAccounts: F(i) })
342
340
  ] })
343
341
  ] });
344
- }, Qt = w(Jt), Pt = ({
345
- netWorth: e,
346
- gains: l,
347
- losses: i,
348
- totalGains: n,
349
- totalLosses: s
350
- }) => {
351
- const { net_worth: o } = T(), a = it();
352
- return /* @__PURE__ */ r(v, { children: [
353
- /* @__PURE__ */ r(h, { alignItems: "center", justifyContent: "space-between", mb: 8, pt: 24, children: [
354
- /* @__PURE__ */ t(m, { variant: "Small", children: nt(e?.x) }),
355
- /* @__PURE__ */ t(m, { variant: "Body", children: o.total_change }),
356
- e && /* @__PURE__ */ t(R, { currencyVariant: "H1", iconSize: 32, netWorth: e, theme: a })
357
- ] }),
358
- /* @__PURE__ */ r(B, { children: [
359
- /* @__PURE__ */ t(k, { sx: { mb: 8, mt: 12, mx: 8 }, children: /* @__PURE__ */ t(
360
- _,
361
- {
362
- primary: /* @__PURE__ */ r(h, { direction: "row", justifyContent: "space-between", children: [
363
- /* @__PURE__ */ t(m, { sx: { fontWeight: 700 }, variant: "XSmall", children: o.gains }),
364
- /* @__PURE__ */ t(y, { amount: n, sx: { fontWeight: 400 }, variant: "XSmall" })
365
- ] })
366
- }
367
- ) }),
368
- l?.map((c) => /* @__PURE__ */ r(d.Fragment, { children: [
369
- /* @__PURE__ */ t(D, { sx: { backgroundColor: a.palette.background.paper, py: 14 }, children: /* @__PURE__ */ t(
370
- _,
371
- {
372
- primary: /* @__PURE__ */ r(h, { direction: "row", justifyContent: "space-between", children: [
373
- /* @__PURE__ */ t(m, { sx: { mr: 10 }, variant: "Body", children: c.accountName }),
374
- /* @__PURE__ */ t(
375
- y,
376
- {
377
- amount: c.gain,
378
- sx: { color: a.palette.success.main, flexShrink: 0, fontWeight: 700 },
379
- variant: "Body"
380
- }
381
- )
382
- ] }),
383
- sx: { px: 16 }
384
- }
385
- ) }),
386
- /* @__PURE__ */ t(W, {})
387
- ] }, c.accountName)),
388
- /* @__PURE__ */ t(k, { sx: { mb: 8, mt: 12, mx: 8 }, children: /* @__PURE__ */ t(
389
- _,
342
+ }, Ne = S(De), Ee = () => {
343
+ const { net_worth: t } = N(), a = j(), { onEvent: i } = z(), {
344
+ assetsLiabilities: n,
345
+ gainsLosses: s,
346
+ hoveredData: r,
347
+ netWorthChartData: c,
348
+ selectedData: l,
349
+ setHoveredIndex: f,
350
+ setSelectedIndex: g
351
+ } = R(), [w, y] = u.useState(!1), [b, I] = u.useState(!1), L = (p) => {
352
+ const C = p.x === r?.x, O = p.x === l?.x, W = {
353
+ backgroundColor: "inherit",
354
+ borderBottom: "inherit",
355
+ color: "inherit"
356
+ };
357
+ return C && (W.color = O ? "inherit" : W.color, W.backgroundColor = a.palette.action.hover), O && (W.backgroundColor = a.palette.primary.main, W.borderBottom = a.palette.border.light, W.color = a.palette.common.white), W;
358
+ }, E = (p, C) => {
359
+ g(C), p.currentTarget instanceof HTMLDivElement && y(!0);
360
+ }, h = () => {
361
+ I(!0), i(v.NET_WORTH_WIDGET_CLICK_ASSETS_LIABILITIES);
362
+ }, M = (p) => {
363
+ f(p);
364
+ }, H = () => {
365
+ f(-1);
366
+ };
367
+ return /* @__PURE__ */ o(d, { direction: "column", sx: { width: 320 }, children: [
368
+ /* @__PURE__ */ o($, { children: [
369
+ /* @__PURE__ */ e(k, { sx: { backgroundColor: "transparent", mb: 8, mt: 12, px: 12 }, children: /* @__PURE__ */ e(m, { bold: !0, component: "h2", variant: "Body", children: t.monthly_totals }) }),
370
+ /* @__PURE__ */ e(T, {}),
371
+ c.map((p, C) => /* @__PURE__ */ e(
372
+ ve,
390
373
  {
391
- primary: /* @__PURE__ */ r(h, { direction: "row", justifyContent: "space-between", children: [
392
- /* @__PURE__ */ t(m, { sx: { fontWeight: 700 }, variant: "XSmall", children: o.losses }),
393
- /* @__PURE__ */ t(y, { amount: s, sx: { fontWeight: 400 }, variant: "XSmall" })
394
- ] })
395
- }
396
- ) }),
397
- i?.map((c) => /* @__PURE__ */ r(v, { children: [
398
- /* @__PURE__ */ t(
399
- D,
400
- {
401
- sx: { backgroundColor: a.palette.background.paper, py: 14 },
402
- children: /* @__PURE__ */ t(
403
- _,
404
- {
405
- primary: /* @__PURE__ */ r(h, { direction: "row", justifyContent: "space-between", children: [
406
- /* @__PURE__ */ t(
407
- m,
408
- {
409
- sx: {
410
- mr: 10
411
- },
412
- variant: "Body",
413
- children: c.accountName
414
- }
415
- ),
416
- /* @__PURE__ */ t(
417
- y,
418
- {
419
- amount: c.loss,
420
- sx: { flexShrink: 0, fontWeight: 700 },
421
- variant: "Body"
422
- }
423
- )
424
- ] }),
425
- sx: { px: 16 }
426
- }
427
- )
428
- },
429
- c.accountName
430
- ),
431
- /* @__PURE__ */ t(W, {})
432
- ] }))
374
+ getStyles: L,
375
+ isHovered: p.x === r?.x,
376
+ isSelected: p.x === l?.x,
377
+ item: p,
378
+ onItemClick: (O) => E(O, C),
379
+ onMouseEnter: () => M(C),
380
+ onMouseLeave: () => H()
381
+ },
382
+ p.x
383
+ ))
384
+ ] }),
385
+ /* @__PURE__ */ e(
386
+ de,
387
+ {
388
+ onClick: () => h(),
389
+ sx: { alignSelf: "center", marginTop: 16, width: "fit-content" },
390
+ variant: "outlined",
391
+ children: t.view_assets_and_liabilities
392
+ }
393
+ ),
394
+ /* @__PURE__ */ e(
395
+ K,
396
+ {
397
+ ariaLabelClose: "Close",
398
+ isOpen: w,
399
+ onClose: () => y(!1),
400
+ shouldShowHeaderBorders: !1,
401
+ shouldShowHeaderShadow: !0,
402
+ title: t.gains_and_losses,
403
+ children: s && /* @__PURE__ */ e(Ie, { ...s })
404
+ }
405
+ ),
406
+ /* @__PURE__ */ e(
407
+ K,
408
+ {
409
+ ariaLabelClose: "Close",
410
+ isOpen: b,
411
+ onClose: () => I(!1),
412
+ shouldShowHeaderBorders: !1,
413
+ shouldShowHeaderShadow: !0,
414
+ title: t.assets_and_liabilities,
415
+ children: n && /* @__PURE__ */ e(Ne, { ...n })
416
+ }
417
+ )
418
+ ] });
419
+ }, Me = S(Ee), ke = ({ hoveredData: t, selectedData: a }) => {
420
+ const { net_worth: i } = N(), n = j(), s = t || a, r = fe(xe(s.x), "MMMM");
421
+ return /* @__PURE__ */ o(d, { alignItems: "center", direction: "column", m: 24, children: [
422
+ /* @__PURE__ */ e(m, { color: n.palette.secondary.main, variant: "Small", children: `${r} ${i.net_worth}` }),
423
+ /* @__PURE__ */ e(x, { amount: s.y, variant: "H2" }),
424
+ /* @__PURE__ */ e(G, { currencyLabel: i.this_month, netWorth: s, theme: n })
425
+ ] });
426
+ }, Ae = S(ke), He = ({ amount: t, copy: a, trendValue: i }) => {
427
+ const n = i > 0, r = i === 0 ? "trending_flat" : n ? "trending_up" : "trending_down";
428
+ return /* @__PURE__ */ o(d, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: [
429
+ /* @__PURE__ */ e(Z, { variant: "H1", children: U(t, "0,0") }),
430
+ t !== 0 && /* @__PURE__ */ o(d, { sx: { color: n ? "success.main" : "text.secondary" }, children: [
431
+ /* @__PURE__ */ o(d, { sx: { flexDirection: "row", gap: 8 }, children: [
432
+ /* @__PURE__ */ e(te, { name: r, size: 20 }),
433
+ /* @__PURE__ */ e(m, { sx: { fontWeight: 600, textAlign: "right" }, variant: "body1", children: U(i, "0,0.00") })
434
+ ] }),
435
+ /* @__PURE__ */ e(m, { sx: { display: "block", textAlign: "right" }, variant: "caption", children: a.this_month })
433
436
  ] })
434
437
  ] });
435
- }, te = w(Pt), Be = w(({ onBackClick: e }) => {
436
- const { isCopyLoaded: l, isInitialized: i, selectedAccounts: n, setSelectedAccounts: s } = P(), { accounts: o, net_worth: a } = T(), { visibleAccounts: c } = J(), {
437
- assetsLiabilities: u,
438
- gainsLosses: C,
439
- hoveredData: x,
440
- loadChartData: g,
441
- loadNetWorthData: S,
442
- netWorthChartData: p,
443
- selectedData: f,
444
- setHoveredData: L,
445
- setSelectedData: at
446
- } = tt(), { isMobile: N } = Z(), { onEvent: E } = Q(), { onLoad: st } = Wt(), [ct, lt] = d.useState(!1), [A, mt] = d.useState(6), [dt, j] = d.useState(!1), [ht, $] = d.useState(!1), [ut, G] = d.useState(!1), pt = async () => {
447
- await S(n), await g(A), lt(!0);
448
- };
449
- d.useEffect(() => {
450
- E(b.NET_WORTH_VIEW);
451
- }, []), d.useEffect(() => {
452
- s(c);
453
- }, [c]), d.useEffect(() => {
454
- i && pt().finally(() => {
455
- st?.("NetWorthWidget");
438
+ }, Oe = ({ copy: t }) => /* @__PURE__ */ o(d, { sx: { flexDirection: "row", gap: 12 }, children: [
439
+ /* @__PURE__ */ e(te, { name: "elevation", size: 32, sx: { color: "text.primary" } }),
440
+ /* @__PURE__ */ o(d, { children: [
441
+ /* @__PURE__ */ e(m, { sx: { display: "block", fontWeight: 600 }, variant: "body1", children: t.empty_widget_header }),
442
+ /* @__PURE__ */ e(Z, { sx: { color: "text.secondary" }, variant: "body2", children: t.zero_state_description })
443
+ ] })
444
+ ] }), _t = S(({ onCTAClick: t }) => {
445
+ const { visibleAccounts: a } = ce(), { onEvent: i } = z(), { net_worth: n, common: s } = N(), { isInitialized: r } = Y(), { isNetWorthDataLoaded: c, loadNetWorthData: l, netWorthData: f, selectedData: g } = R();
446
+ if (u.useEffect(() => {
447
+ c || l().finally();
448
+ }, []), re({
449
+ widgetName: "NetWorthMicroWidget",
450
+ isLoaded: c
451
+ }), u.useEffect(() => {
452
+ c && i(v.NET_WORTH_LOAD_WIDGET, {
453
+ state: a?.length ? "default" : "zeroState"
456
454
  });
457
- }, [i, n]), d.useEffect(() => {
458
- E(b.NET_WORTH_WIDGET_CLICK_TIMEFRAME, { time_period: A + "M" }), g(A).finally();
459
- }, [A]);
460
- const ft = (I, M) => {
461
- at(M), I.currentTarget instanceof HTMLDivElement && j(!0);
462
- }, xt = (I) => {
463
- L(I);
464
- }, gt = () => {
465
- L(null);
466
- }, yt = () => {
467
- E(b.NET_WORTH_WIDGET_CLICK_ASSETS_LIABILITIES), $(!0);
468
- }, Ct = async (I) => {
469
- const M = I[0], F = I[1];
470
- M && F && mt(At(F, M));
471
- }, X = {
472
- chartData: p,
473
- hoveredData: x,
474
- onButtonClick: yt,
475
- onDataClick: ft,
476
- onMouseEnter: xt,
477
- onMouseLeave: gt,
478
- selectedData: f
479
- }, St = () => {
480
- G(!0), E(b.ACCOUNTS_CLICK_CONNECT);
455
+ }, [c]), !r || !c) return /* @__PURE__ */ e(ne, { height: 100 });
456
+ const w = () => {
457
+ i(
458
+ a.length ? v.NET_WORTH_CLICK_VIEW_DETAILS : v.NET_WORTH_CLICK_GET_STARTED
459
+ ), t();
481
460
  };
482
- return l ? /* @__PURE__ */ t(
483
- Ht,
461
+ return /* @__PURE__ */ e(
462
+ ye,
484
463
  {
485
- accountOptions: c,
486
- calendarActions: {
487
- onRangeChanged: Ct
488
- },
489
- dateRangeVariant: N ? "timeframetabs" : "timeframebuttons",
490
- onAccountsFilterClick: () => E(b.NET_WORTH_WIDGET_CLICK_FILTER),
491
- onBackClick: e,
464
+ className: "mx-networth-microwidget",
465
+ ctaLabel: s.see_details,
466
+ onCTAClick: w,
467
+ title: n.net_worth,
468
+ children: f.accounts.length ? /* @__PURE__ */ e(
469
+ He,
470
+ {
471
+ amount: g?.y,
472
+ copy: n,
473
+ trendValue: g?.change
474
+ }
475
+ ) : /* @__PURE__ */ e(Oe, { copy: n })
476
+ }
477
+ );
478
+ }), St = S(({ onBackClick: t }) => {
479
+ const { isInitialized: a } = Y(), { accounts: i, net_worth: n } = N(), {
480
+ hoveredData: s,
481
+ isNetWorthDataLoaded: r,
482
+ loadNetWorthData: c,
483
+ netWorthChartData: l,
484
+ selectedData: f,
485
+ setTimeframe: g,
486
+ timeframe: w
487
+ } = R(), { isMobile: y } = q(), { onEvent: b } = z(), [I, L] = u.useState(!1);
488
+ re({
489
+ widgetName: "NetWorthWidget",
490
+ isLoaded: r
491
+ }), u.useEffect(() => {
492
+ r || c().finally(), b(v.NET_WORTH_VIEW);
493
+ }, []), u.useEffect(() => {
494
+ b(v.NET_WORTH_WIDGET_CLICK_TIMEFRAME, { time_period: w + "M" });
495
+ }, [w]);
496
+ const E = async (H) => {
497
+ const p = H[0], C = H[1];
498
+ p && C && g(ge(C, p));
499
+ }, h = () => {
500
+ L(!0), b(v.ACCOUNTS_CLICK_CONNECT);
501
+ };
502
+ if (!a || !r) return /* @__PURE__ */ e(ne, {});
503
+ const M = l.length === 0;
504
+ return /* @__PURE__ */ o(
505
+ ue,
506
+ {
507
+ calendarActions: { onRangeChanged: E },
508
+ dateRangeVariant: y ? "timeframetabs" : "timeframebuttons",
509
+ onAccountsFilterClick: () => b(v.NET_WORTH_WIDGET_CLICK_FILTER),
510
+ onBackClick: t,
492
511
  showDividerAboveDateSelector: !1,
493
512
  sx: {
494
- p: N ? 0 : 48,
513
+ p: y ? 0 : 48,
495
514
  "& .MuiCardHeader-root": {
496
515
  px: 16,
497
516
  py: 12
@@ -503,30 +522,16 @@ const Rt = ({
503
522
  width: "100%"
504
523
  }
505
524
  },
506
- title: a.net_worth,
507
- children: ct ? /* @__PURE__ */ r(v, { children: [
508
- p.length ? /* @__PURE__ */ r(v, { children: [
509
- f && /* @__PURE__ */ t(Vt, { hoveredData: x, selectedData: f }),
510
- /* @__PURE__ */ r(
511
- h,
512
- {
513
- alignItems: N ? "center" : "flex-start",
514
- direction: N ? "column" : "row",
515
- spacing: N ? 0 : 48,
516
- children: [
517
- /* @__PURE__ */ t(jt, { ...X }),
518
- /* @__PURE__ */ t(Ft, { ...X })
519
- ]
520
- }
521
- )
522
- ] }) : /* @__PURE__ */ t(rt, { sx: { justifyItems: "center" }, children: /* @__PURE__ */ t(
523
- zt,
525
+ title: n.net_worth,
526
+ children: [
527
+ M ? /* @__PURE__ */ e(ee, { sx: { justifyItems: "center" }, children: /* @__PURE__ */ e(
528
+ _e,
524
529
  {
525
- header: a.empty_widget_header,
530
+ header: n.empty_widget_header,
526
531
  icon: "elevation",
527
- onClick: St,
528
- primaryButton: a.empty_widget_button,
529
- subText: a.empty_widget_description,
532
+ onClick: h,
533
+ primaryButton: n.empty_widget_button,
534
+ subText: n.empty_widget_description,
530
535
  sx: {
531
536
  width: { sm: 432 },
532
537
  ".buttons-footer": {
@@ -534,48 +539,38 @@ const Rt = ({
534
539
  }
535
540
  }
536
541
  }
537
- ) }),
538
- /* @__PURE__ */ t(
539
- Bt,
540
- {
541
- onClose: () => G(!1),
542
- showConnectionsWidget: ut,
543
- title: o.manage_connections
544
- }
545
- ),
546
- /* @__PURE__ */ t(
547
- Y,
548
- {
549
- ariaLabelClose: "Close",
550
- isOpen: dt,
551
- onClose: () => j(!1),
552
- shouldShowHeaderBorders: !1,
553
- shouldShowHeaderShadow: !0,
554
- title: a.gains_and_losses,
555
- children: C && /* @__PURE__ */ t(te, { ...C })
556
- }
557
- ),
558
- /* @__PURE__ */ t(
559
- Y,
542
+ ) }) : /* @__PURE__ */ o(D, { children: [
543
+ f && /* @__PURE__ */ e(Ae, { hoveredData: s, selectedData: f }),
544
+ /* @__PURE__ */ o(
545
+ d,
546
+ {
547
+ alignItems: y ? "center" : "flex-start",
548
+ direction: y ? "column" : "row",
549
+ spacing: y ? 0 : 48,
550
+ children: [
551
+ /* @__PURE__ */ e(we, {}),
552
+ /* @__PURE__ */ e(Me, {})
553
+ ]
554
+ }
555
+ )
556
+ ] }),
557
+ /* @__PURE__ */ e(
558
+ Ce,
560
559
  {
561
- ariaLabelClose: "Close",
562
- isOpen: ht,
563
- onClose: () => $(!1),
564
- shouldShowHeaderBorders: !1,
565
- shouldShowHeaderShadow: !0,
566
- title: a.assets_and_liabilities,
567
- children: u && /* @__PURE__ */ t(Qt, { ...u })
560
+ onClose: () => L(!1),
561
+ showConnectionsWidget: I,
562
+ title: i.manage_connections
568
563
  }
569
564
  )
570
- ] }) : /* @__PURE__ */ t(O, {})
565
+ ]
571
566
  }
572
- ) : /* @__PURE__ */ t(O, {});
567
+ );
573
568
  });
574
569
  export {
575
- jt as NetWorthChart,
576
- Ft as NetWorthList,
577
- He as NetWorthMicroWidget,
578
- Re as NetWorthStore,
579
- Vt as NetWorthSummary,
580
- Be as NetWorthWidget
570
+ we as NetWorthChart,
571
+ Me as NetWorthList,
572
+ _t as NetWorthMicroWidget,
573
+ vt as NetWorthStore,
574
+ Ae as NetWorthSummary,
575
+ St as NetWorthWidget
581
576
  };