@mx-cartographer/experiences 7.0.27-alpha.sms4 → 7.0.27-alpha.sms6
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.
- package/dist/{Account-BW3-oYEs.mjs → Account-CK-DrCEa.mjs} +1 -1
- package/dist/{AccountDetailsContent-UxSEMBo_.mjs → AccountDetailsContent-BZAbCT6q.mjs} +8 -8
- package/dist/{AccountDetailsHeader-Eb3WvBGm.mjs → AccountDetailsHeader-DXTi1p0V.mjs} +11 -11
- package/dist/{AccountFields-CIz-r3gP.mjs → AccountFields-Bxvi1C4Z.mjs} +2 -2
- package/dist/{AccountListItem-B-ZjJ4Gp.mjs → AccountListItem-CnE3rCVZ.mjs} +3 -3
- package/dist/{AccountStore-BaMynkQT.mjs → AccountStore-DiGbJBUT.mjs} +2 -2
- package/dist/{Accounts-CA-nqAjT.mjs → Accounts-BBkQjUmS.mjs} +1 -1
- package/dist/{BudgetUtil-CeSLAcsl.mjs → BudgetUtil-D5jO0box.mjs} +1 -1
- package/dist/{CategorySelectorDrawer-BJ9jlCyt.mjs → CategorySelectorDrawer-joMax4Fb.mjs} +1 -1
- package/dist/{ConnectDrawer-phFH6OHt.mjs → ConnectDrawer-D86nRDxQ.mjs} +1 -1
- package/dist/{ConnectionsDrawer-ihxkAi1P.mjs → ConnectionsDrawer-BkNr5Up0.mjs} +2 -2
- package/dist/{CurrencyInput-bEx2Mbd0.mjs → CurrencyInput-BkflFU_-.mjs} +1 -1
- package/dist/{DebtsStore-VkyMADzd.mjs → DebtsStore-qrqY9Abz.mjs} +1 -1
- package/dist/{ExportCsvAction-CbdFfDV5.mjs → ExportCsvAction-DRfdZis1.mjs} +3 -3
- package/dist/{GoalStore-eSOkI6uE.mjs → GoalStore-BQRcowCN.mjs} +2 -2
- package/dist/{Help-KAAMEubC.mjs → Help-B3dFeYi2.mjs} +1 -1
- package/dist/{LineChart-BWWmmJxV.mjs → LineChart-Dyps2sOy.mjs} +1 -1
- package/dist/{ListItemAction-DNZZ5fSa.mjs → ListItemAction-BgKx_n6d.mjs} +1 -1
- package/dist/{ManageIncome-DbsiKUoO.mjs → ManageIncome-CFh-N0KK.mjs} +4 -4
- package/dist/{MicroWidgetContainer-Dxz8uBN9.mjs → MicroWidgetContainer-DPDsZIiS.mjs} +1 -1
- package/dist/{MiniWidgetContainer-CTyjmE1h.mjs → MiniWidgetContainer-BzW7V_04.mjs} +1 -1
- package/dist/{NetWorthStore-B6xF9eGH.mjs → NetWorthStore-DWG9Mkuu.mjs} +2 -2
- package/dist/NotificationSettings-BaG4tpPe.mjs +671 -0
- package/dist/{OriginalBalanceAction-DepsKiJz.mjs → OriginalBalanceAction-B--pIAF0.mjs} +3 -3
- package/dist/{RecurringSettings-Dj29piAQ.mjs → RecurringSettings-C9TjSuS_.mjs} +3 -3
- package/dist/{TransactionDetails-C-z3HGTT.mjs → TransactionDetails-C2gYzV0z.mjs} +37 -37
- package/dist/{TransactionStore-Cep_Eeql.mjs → TransactionStore-CZOvxcSw.mjs} +2 -2
- package/dist/{TrendsStore-WrHxzdbQ.mjs → TrendsStore-pvzHAX6B.mjs} +225 -231
- package/dist/{User-Dq9Qj764.mjs → User-D-O9EHMb.mjs} +1 -1
- package/dist/{WidgetContainer-CdBs9WOZ.mjs → WidgetContainer-Bn6JPnY3.mjs} +2 -2
- package/dist/accounts/index.es.js +12 -12
- package/dist/analytics/index.es.js +11 -11
- package/dist/budgets/index.es.js +10 -10
- package/dist/cashflow/index.es.js +7 -7
- package/dist/categories/index.es.js +1 -1
- package/dist/common/index.es.js +105 -104
- package/dist/dashboard/index.es.js +2 -2
- package/dist/debts/index.es.js +9 -9
- package/dist/{exportTransactionsToCSV-B5qAKd6C.mjs → exportTransactionsToCSV-zyHeWfQo.mjs} +1 -1
- package/dist/finstrong/index.es.js +6 -6
- package/dist/goals/index.es.js +11 -11
- package/dist/help/index.es.js +3 -3
- package/dist/{hooks-DkUqN6JE.mjs → hooks-DlI63qSB.mjs} +8 -8
- package/dist/investments/index.es.js +3 -3
- package/dist/merchants/index.es.js +1 -1
- package/dist/networth/index.es.js +7 -7
- package/dist/notifications/index.es.js +2 -2
- package/dist/recurringtransactions/index.es.js +8 -8
- package/dist/settings/index.es.js +7 -7
- package/dist/spending/index.es.js +14 -14
- package/dist/transactions/index.es.js +13 -13
- package/dist/trends/index.es.js +70 -69
- package/dist/useInsightsEnabled-fGr6xrSj.mjs +11 -0
- package/package.json +1 -1
- package/dist/NotificationSettings-ClJT-Sg3.mjs +0 -664
|
@@ -1,74 +1,69 @@
|
|
|
1
|
-
import M, { useState as J, useEffect as K, useRef as vt } from "react";
|
|
2
|
-
import { l as St, u as _t, k as Q } from "./hooks-DkUqN6JE.mjs";
|
|
3
1
|
import { jsxs as f, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import M, { useRef as Ct, useState as bt, useEffect as vt } from "react";
|
|
4
3
|
import L from "@mui/material/Box";
|
|
5
4
|
import T from "@mui/material/Stack";
|
|
6
|
-
import { useTheme as
|
|
7
|
-
import { LineChart as
|
|
8
|
-
import { u as
|
|
9
|
-
import { u as
|
|
10
|
-
import { observer as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
5
|
+
import { useTheme as J } from "@mui/material/styles";
|
|
6
|
+
import { LineChart as St } from "@mui/x-charts";
|
|
7
|
+
import { u as K } from "./useScreenSize-B6JyS_Lj.mjs";
|
|
8
|
+
import { u as _t } from "./useDimensions-27p2evRx.mjs";
|
|
9
|
+
import { observer as Mt } from "mobx-react-lite";
|
|
10
|
+
import Tt from "@mui/material/Card";
|
|
11
|
+
import Dt from "@mui/material/CardContent";
|
|
13
12
|
import P from "@mui/material/Divider";
|
|
14
13
|
import X from "@mui/material/Grid";
|
|
15
|
-
import { CategoryIcon as
|
|
16
|
-
import {
|
|
14
|
+
import { CategoryIcon as At, Text as S } from "@mxenabled/mxui";
|
|
15
|
+
import { u as Lt, l as Q } from "./hooks-DlI63qSB.mjs";
|
|
16
|
+
import { b as Rt } from "./Localization-2MODESHW.mjs";
|
|
17
17
|
import { C as O } from "./CurrencyText-YUhH2caW.mjs";
|
|
18
|
-
import { useTheme as wt, Card as Ht, CardContent as
|
|
19
|
-
import { f as R, D as
|
|
20
|
-
import
|
|
21
|
-
import { C as A, b as
|
|
22
|
-
import { f as
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import { makeAutoObservable as
|
|
28
|
-
import { addSeconds as
|
|
29
|
-
import { differenceInCalendarMonths as
|
|
18
|
+
import { useTheme as wt, Card as Ht, CardContent as It, Box as kt } from "@mui/material";
|
|
19
|
+
import { f as R, D as w } from "./Dialog-CWW597AF.mjs";
|
|
20
|
+
import Et from "@mui/material/Button";
|
|
21
|
+
import { C as A, b as Gt, c as Nt } from "./Category-CevNQ03n.mjs";
|
|
22
|
+
import { f as V } from "./NumberFormatting-CtWHhyBX.mjs";
|
|
23
|
+
import Bt from "@mui/material/ListItem";
|
|
24
|
+
import Ot from "@mui/material/ListItemButton";
|
|
25
|
+
import z from "@mui/material/ListItemIcon";
|
|
26
|
+
import $t from "@mui/material/ListItemText";
|
|
27
|
+
import { makeAutoObservable as Wt } from "mobx";
|
|
28
|
+
import { addSeconds as jt } from "date-fns/addSeconds";
|
|
29
|
+
import { differenceInCalendarMonths as Ft } from "date-fns/differenceInCalendarMonths";
|
|
30
30
|
import { endOfMonth as q } from "date-fns/endOfMonth";
|
|
31
|
-
import { subMonths as
|
|
32
|
-
const
|
|
33
|
-
const {
|
|
34
|
-
return K(() => {
|
|
35
|
-
o && e.clientInsightProfile?.is_enabled && n(!0);
|
|
36
|
-
}, [o, e.clientInsightProfile]), r;
|
|
37
|
-
}, tt = ({ categoryGuid: o, topLevelCategoryGuid: e }) => {
|
|
38
|
-
const { categories: r } = _t(), { getCategoryName: n } = Q(), a = n(o);
|
|
31
|
+
import { subMonths as Yt } from "date-fns/subMonths";
|
|
32
|
+
const U = ({ categoryGuid: r, topLevelCategoryGuid: e }) => {
|
|
33
|
+
const { categories: o } = Lt(), { getCategoryName: a } = Q(), n = a(r);
|
|
39
34
|
return /* @__PURE__ */ f(T, { alignItems: "center", direction: "column", gap: "8", justifyContent: "center", mb: 4, children: [
|
|
40
35
|
/* @__PURE__ */ s(
|
|
41
36
|
L,
|
|
42
37
|
{
|
|
43
|
-
"aria-label":
|
|
38
|
+
"aria-label": Rt(o.category_icon_label_aria, n),
|
|
44
39
|
mb: 4,
|
|
45
40
|
role: "img",
|
|
46
|
-
children: /* @__PURE__ */ s(
|
|
41
|
+
children: /* @__PURE__ */ s(At, { categoryGuid: e })
|
|
47
42
|
}
|
|
48
43
|
),
|
|
49
|
-
/* @__PURE__ */ s(S, { variant: "Body", children:
|
|
44
|
+
/* @__PURE__ */ s(S, { variant: "Body", children: n })
|
|
50
45
|
] });
|
|
51
|
-
},
|
|
52
|
-
categoryGuids: { guid:
|
|
53
|
-
hoveredAreaData:
|
|
54
|
-
cursorPosition:
|
|
55
|
-
chartContainerRef:
|
|
46
|
+
}, Pt = ({
|
|
47
|
+
categoryGuids: { guid: r, topLevelGuid: e },
|
|
48
|
+
hoveredAreaData: o,
|
|
49
|
+
cursorPosition: a,
|
|
50
|
+
chartContainerRef: n
|
|
56
51
|
}) => {
|
|
57
|
-
const i =
|
|
58
|
-
if (
|
|
52
|
+
const i = J(), l = Ct(null), [h, g] = bt({ x: a.x, y: a.y });
|
|
53
|
+
if (vt(() => {
|
|
59
54
|
(() => {
|
|
60
|
-
const u =
|
|
55
|
+
const u = l.current, x = n.current;
|
|
61
56
|
if (!u || !x) return;
|
|
62
|
-
const y = u.getBoundingClientRect(),
|
|
63
|
-
let p =
|
|
64
|
-
p + y.width * 2 >
|
|
57
|
+
const y = u.getBoundingClientRect(), b = x.getBoundingClientRect();
|
|
58
|
+
let p = a.x, v = a.y;
|
|
59
|
+
p + y.width * 2 > b.right ? p = a.x - y.width : p - y.width < b.left && (p = a.x), v + y.height * 2 > b.bottom && (v = a.y - y.height), g({ x: p, y: v });
|
|
65
60
|
})();
|
|
66
|
-
}, [
|
|
67
|
-
const
|
|
61
|
+
}, [a, n]), !o) return null;
|
|
62
|
+
const C = o.reduce((d, u) => d + u.y, 0);
|
|
68
63
|
return /* @__PURE__ */ s(
|
|
69
|
-
|
|
64
|
+
Tt,
|
|
70
65
|
{
|
|
71
|
-
ref:
|
|
66
|
+
ref: l,
|
|
72
67
|
sx: {
|
|
73
68
|
position: "absolute",
|
|
74
69
|
top: h.y,
|
|
@@ -76,14 +71,14 @@ const Ee = () => {
|
|
|
76
71
|
width: 250,
|
|
77
72
|
pointerEvents: "none"
|
|
78
73
|
},
|
|
79
|
-
children: /* @__PURE__ */ f(
|
|
74
|
+
children: /* @__PURE__ */ f(Dt, { children: [
|
|
80
75
|
/* @__PURE__ */ f(L, { alignItems: "center", display: "flex", flexDirection: "column", children: [
|
|
81
|
-
/* @__PURE__ */ s(
|
|
82
|
-
/* @__PURE__ */ s(S, { variant: "Small", children: `${
|
|
83
|
-
/* @__PURE__ */ s(O, { amount:
|
|
76
|
+
/* @__PURE__ */ s(U, { categoryGuid: r, topLevelCategoryGuid: e }),
|
|
77
|
+
/* @__PURE__ */ s(S, { variant: "Small", children: `${o.length}-month total` }),
|
|
78
|
+
/* @__PURE__ */ s(O, { amount: C, bold: !0, formatString: "0,0", variant: "body2" })
|
|
84
79
|
] }),
|
|
85
80
|
/* @__PURE__ */ s(P, { sx: { my: 16, width: "100%" } }),
|
|
86
|
-
/* @__PURE__ */ s(X, { container: !0, children:
|
|
81
|
+
/* @__PURE__ */ s(X, { container: !0, children: o.map((d, u) => /* @__PURE__ */ f(M.Fragment, { children: [
|
|
87
82
|
u > 0 && u % 3 === 0 && /* @__PURE__ */ s(P, { sx: { my: 16, width: "100%" } }),
|
|
88
83
|
/* @__PURE__ */ s(X, { item: !0, xs: 4, children: /* @__PURE__ */ f(L, { alignItems: "center", display: "flex", flexDirection: "column", children: [
|
|
89
84
|
/* @__PURE__ */ s(S, { color: i.palette.text.secondary, variant: "XSmall", children: d.x }),
|
|
@@ -101,44 +96,44 @@ const Ee = () => {
|
|
|
101
96
|
] })
|
|
102
97
|
}
|
|
103
98
|
);
|
|
104
|
-
},
|
|
105
|
-
categoryGuids: { guid:
|
|
106
|
-
itemData: { dataIndex:
|
|
107
|
-
series:
|
|
108
|
-
xData:
|
|
99
|
+
}, Xt = Mt(Pt), Vt = ({
|
|
100
|
+
categoryGuids: { guid: r, topLevelGuid: e },
|
|
101
|
+
itemData: { dataIndex: o },
|
|
102
|
+
series: a,
|
|
103
|
+
xData: n
|
|
109
104
|
}) => {
|
|
110
|
-
const i = wt(),
|
|
111
|
-
return
|
|
112
|
-
/* @__PURE__ */ s(
|
|
113
|
-
/* @__PURE__ */ s(S, { color: i.palette.text.secondary, variant: "Small", children: R(h,
|
|
114
|
-
/* @__PURE__ */ s(O, { amount: String(
|
|
105
|
+
const i = wt(), l = a.data[o], h = n[o];
|
|
106
|
+
return l === void 0 || !h ? null : /* @__PURE__ */ s(Ht, { sx: { pt: 4, px: 8 }, children: /* @__PURE__ */ s(It, { children: /* @__PURE__ */ f(kt, { alignItems: "center", display: "flex", flexDirection: "column", children: [
|
|
107
|
+
/* @__PURE__ */ s(U, { categoryGuid: r, topLevelCategoryGuid: e }),
|
|
108
|
+
/* @__PURE__ */ s(S, { color: i.palette.text.secondary, variant: "Small", children: R(h, w.MONTH_SHORT_YEAR) }),
|
|
109
|
+
/* @__PURE__ */ s(O, { amount: String(l), bold: !0, formatString: "0,0", variant: "Body" })
|
|
115
110
|
] }) }) });
|
|
116
|
-
},
|
|
117
|
-
sx:
|
|
111
|
+
}, zt = ({
|
|
112
|
+
sx: r,
|
|
118
113
|
categoryGuids: e,
|
|
119
|
-
hoveredLegend:
|
|
120
|
-
legendRef:
|
|
121
|
-
onHoverLegend:
|
|
114
|
+
hoveredLegend: o,
|
|
115
|
+
legendRef: a,
|
|
116
|
+
onHoverLegend: n,
|
|
122
117
|
onClickLegend: i
|
|
123
118
|
}) => {
|
|
124
|
-
const { isMobile:
|
|
119
|
+
const { isMobile: l } = K(), { getCategoryName: h } = Q();
|
|
125
120
|
return /* @__PURE__ */ s(
|
|
126
121
|
T,
|
|
127
122
|
{
|
|
128
123
|
direction: "row",
|
|
129
124
|
flexWrap: "wrap",
|
|
130
|
-
gap:
|
|
125
|
+
gap: l ? 2 : 6,
|
|
131
126
|
justifyContent: "start",
|
|
132
|
-
ref:
|
|
133
|
-
sx:
|
|
134
|
-
children: e.map(({ guid: g, top_level_guid:
|
|
135
|
-
const d =
|
|
127
|
+
ref: a,
|
|
128
|
+
sx: r,
|
|
129
|
+
children: e.map(({ guid: g, top_level_guid: C }) => {
|
|
130
|
+
const d = o === g, u = A[g], x = A[C], y = u ?? x ?? A.default, b = y + "33";
|
|
136
131
|
return /* @__PURE__ */ f(
|
|
137
|
-
|
|
132
|
+
Et,
|
|
138
133
|
{
|
|
139
134
|
onClick: () => i(g),
|
|
140
|
-
onMouseEnter: () =>
|
|
141
|
-
onMouseLeave: () =>
|
|
135
|
+
onMouseEnter: () => n(g),
|
|
136
|
+
onMouseLeave: () => n(null),
|
|
142
137
|
sx: {
|
|
143
138
|
color: "text.primary",
|
|
144
139
|
fontWeight: "normal",
|
|
@@ -157,9 +152,9 @@ const Ee = () => {
|
|
|
157
152
|
sx: {
|
|
158
153
|
width: 16,
|
|
159
154
|
height: 16,
|
|
160
|
-
marginRight:
|
|
155
|
+
marginRight: l ? 5 : 10,
|
|
161
156
|
borderRadius: "2px",
|
|
162
|
-
backgroundColor:
|
|
157
|
+
backgroundColor: o ? d ? y : b : y
|
|
163
158
|
}
|
|
164
159
|
}
|
|
165
160
|
),
|
|
@@ -171,44 +166,44 @@ const Ee = () => {
|
|
|
171
166
|
})
|
|
172
167
|
}
|
|
173
168
|
);
|
|
174
|
-
},
|
|
175
|
-
onHoverArea:
|
|
169
|
+
}, Ie = ({
|
|
170
|
+
onHoverArea: r,
|
|
176
171
|
onHoverPoint: e,
|
|
177
|
-
onHoverLegend:
|
|
178
|
-
onClickLegend:
|
|
179
|
-
stackedDatasets:
|
|
172
|
+
onHoverLegend: o,
|
|
173
|
+
onClickLegend: a,
|
|
174
|
+
stackedDatasets: n,
|
|
180
175
|
unstackedDatasets: i = [],
|
|
181
|
-
availableHeight:
|
|
176
|
+
availableHeight: l = 0,
|
|
182
177
|
minimumHeight: h = 350
|
|
183
178
|
}) => {
|
|
184
|
-
const g =
|
|
179
|
+
const g = J(), { isMobile: C } = K(), [d, { height: u }] = _t(), x = M.useRef(null), [y, b] = M.useState(0);
|
|
185
180
|
M.useEffect(() => {
|
|
186
|
-
const t = Math.max(
|
|
187
|
-
|
|
188
|
-
}, [
|
|
189
|
-
const [p, v] = M.useState(null), [
|
|
181
|
+
const t = Math.max(l - u, h);
|
|
182
|
+
b(t);
|
|
183
|
+
}, [l, u]);
|
|
184
|
+
const [p, v] = M.useState(null), [Z, H] = M.useState({
|
|
190
185
|
hoveredSeriesId: null,
|
|
191
186
|
hoveredAreaData: null,
|
|
192
187
|
isAreaHovered: !1,
|
|
193
188
|
cursorPos: { x: 0, y: 0 }
|
|
194
|
-
}), { hoveredSeriesId: D, hoveredAreaData: $, isAreaHovered:
|
|
195
|
-
(t,
|
|
196
|
-
) ?? [0],
|
|
197
|
-
...i.flatMap((t) => t.dataset.map((
|
|
198
|
-
),
|
|
199
|
-
id: `stacked-${
|
|
189
|
+
}), { hoveredSeriesId: D, hoveredAreaData: $, isAreaHovered: tt, cursorPos: I } = Z, W = tt && D && $, j = !W, G = [...n, ...i], et = G[0]?.dataset.length ?? 0, N = G.flatMap((t) => t.dataset.map((c) => c.x)), ot = G.flatMap((t) => t.dataset.map((c) => c.y)), rt = n[0]?.dataset?.map(
|
|
190
|
+
(t, c) => n.reduce((m, _) => m + _.dataset[c]?.y || 0, 0)
|
|
191
|
+
) ?? [0], at = Math.max(...rt), nt = Math.max(
|
|
192
|
+
...i.flatMap((t) => t.dataset.map((c) => c.y))
|
|
193
|
+
), st = Math.floor(Math.min(...ot) / 100) * 100, it = Math.ceil(Math.max(at, nt) / 100) * 100, k = n.map((t, c) => ({
|
|
194
|
+
id: `stacked-${c}`,
|
|
200
195
|
guid: t.category_guid,
|
|
201
196
|
top_level_guid: t.top_level_category_guid,
|
|
202
197
|
area: !0,
|
|
203
|
-
color:
|
|
198
|
+
color: n[c].category_color ?? g.palette.primary.main,
|
|
204
199
|
data: t.dataset.map((m) => m.y),
|
|
205
|
-
label:
|
|
200
|
+
label: n[c].category_name,
|
|
206
201
|
stack: "total",
|
|
207
202
|
type: "line",
|
|
208
203
|
highlightScope: { highlight: "item" },
|
|
209
|
-
valueFormatter: (m) =>
|
|
210
|
-
})), F = i.map((t,
|
|
211
|
-
id: `unstacked-${
|
|
204
|
+
valueFormatter: (m) => V(m, "0,0")
|
|
205
|
+
})), F = i.map((t, c) => ({
|
|
206
|
+
id: `unstacked-${c}`,
|
|
212
207
|
guid: t.category_guid,
|
|
213
208
|
top_level_guid: t.top_level_category_guid,
|
|
214
209
|
area: !1,
|
|
@@ -216,66 +211,66 @@ const Ee = () => {
|
|
|
216
211
|
data: t.dataset.map((m) => m.y),
|
|
217
212
|
label: t.category_name,
|
|
218
213
|
type: "line",
|
|
219
|
-
valueFormatter: (m) =>
|
|
220
|
-
})), Y = [...
|
|
221
|
-
...
|
|
214
|
+
valueFormatter: (m) => V(m, "0,0")
|
|
215
|
+
})), Y = [...k, ...F], ct = [
|
|
216
|
+
...k.map(({ guid: t, top_level_guid: c }) => ({
|
|
222
217
|
guid: t,
|
|
223
|
-
top_level_guid:
|
|
218
|
+
top_level_guid: c
|
|
224
219
|
})),
|
|
225
|
-
...F.map(({ guid: t, top_level_guid:
|
|
220
|
+
...F.map(({ guid: t, top_level_guid: c }) => ({
|
|
226
221
|
guid: t,
|
|
227
|
-
top_level_guid:
|
|
222
|
+
top_level_guid: c
|
|
228
223
|
}))
|
|
229
|
-
],
|
|
230
|
-
const m = t.startsWith("stacked-") ?
|
|
224
|
+
], E = (t) => {
|
|
225
|
+
const m = t.startsWith("stacked-") ? n[parseInt(t.split("-")[1])] : i[parseInt(t.split("-")[1])];
|
|
231
226
|
return {
|
|
232
227
|
guid: m?.category_guid,
|
|
233
228
|
topLevelGuid: m?.top_level_category_guid
|
|
234
229
|
};
|
|
235
|
-
},
|
|
236
|
-
v(t),
|
|
230
|
+
}, lt = (t) => {
|
|
231
|
+
v(t), o?.(t ?? "");
|
|
232
|
+
}, dt = (t) => {
|
|
233
|
+
a?.(t ?? "");
|
|
234
|
+
}, ut = () => {
|
|
235
|
+
const t = E(String(D)).guid;
|
|
236
|
+
t && a?.(t);
|
|
237
237
|
}, mt = (t) => {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}, ht = (t) => {
|
|
243
|
-
const l = String(t?.seriesId), m = k(l).guid, _ = Y.find((B) => B.id === l), ft = _ && t?.dataIndex !== void 0, xt = _ && t?.dataIndex === void 0;
|
|
244
|
-
if (ft)
|
|
245
|
-
w({
|
|
246
|
-
hoveredSeriesId: l,
|
|
238
|
+
const c = String(t?.seriesId), m = E(c).guid, _ = Y.find((B) => B.id === c), pt = _ && t?.dataIndex !== void 0, yt = _ && t?.dataIndex === void 0;
|
|
239
|
+
if (pt)
|
|
240
|
+
H({
|
|
241
|
+
hoveredSeriesId: c,
|
|
247
242
|
hoveredAreaData: null,
|
|
248
243
|
isAreaHovered: !1,
|
|
249
|
-
cursorPos:
|
|
244
|
+
cursorPos: I
|
|
250
245
|
}), e?.(m);
|
|
251
|
-
else if (
|
|
252
|
-
const B = _?.data.map((
|
|
253
|
-
x: N[
|
|
254
|
-
y:
|
|
246
|
+
else if (yt) {
|
|
247
|
+
const B = _?.data.map((ft, xt) => ({
|
|
248
|
+
x: N[xt],
|
|
249
|
+
y: ft
|
|
255
250
|
})) ?? [];
|
|
256
|
-
|
|
257
|
-
hoveredSeriesId:
|
|
251
|
+
H({
|
|
252
|
+
hoveredSeriesId: c,
|
|
258
253
|
hoveredAreaData: B,
|
|
259
254
|
isAreaHovered: !0,
|
|
260
|
-
cursorPos:
|
|
261
|
-
}),
|
|
255
|
+
cursorPos: I
|
|
256
|
+
}), r?.(m);
|
|
262
257
|
} else
|
|
263
|
-
|
|
258
|
+
H({
|
|
264
259
|
hoveredSeriesId: null,
|
|
265
260
|
hoveredAreaData: null,
|
|
266
261
|
isAreaHovered: !1,
|
|
267
|
-
cursorPos:
|
|
262
|
+
cursorPos: I
|
|
268
263
|
});
|
|
269
|
-
},
|
|
270
|
-
const
|
|
271
|
-
|
|
264
|
+
}, gt = (t) => {
|
|
265
|
+
const c = t.currentTarget.getBoundingClientRect();
|
|
266
|
+
H((m) => ({
|
|
272
267
|
...m,
|
|
273
268
|
cursorPos: {
|
|
274
|
-
x: t.clientX -
|
|
275
|
-
y: t.clientY -
|
|
269
|
+
x: t.clientX - c.left,
|
|
270
|
+
y: t.clientY - c.top
|
|
276
271
|
}
|
|
277
272
|
}));
|
|
278
|
-
},
|
|
273
|
+
}, ht = {
|
|
279
274
|
p: 4,
|
|
280
275
|
"& .MuiBarLabel-root": {
|
|
281
276
|
fontSize: 10,
|
|
@@ -291,17 +286,17 @@ const Ee = () => {
|
|
|
291
286
|
'& [class*="MuiLineElement-series-unstacked-"]': {
|
|
292
287
|
strokeWidth: 3
|
|
293
288
|
},
|
|
294
|
-
...p &&
|
|
289
|
+
...p && k.reduce((t, c, m) => {
|
|
295
290
|
const _ = `.MuiAreaElement-series-stacked-${m}`;
|
|
296
291
|
return t[_] = {
|
|
297
|
-
opacity:
|
|
292
|
+
opacity: k[m].guid === p ? 0.9 : 0.2
|
|
298
293
|
}, t;
|
|
299
294
|
}, {})
|
|
300
295
|
};
|
|
301
296
|
return /* @__PURE__ */ s(
|
|
302
297
|
L,
|
|
303
298
|
{
|
|
304
|
-
onMouseMove:
|
|
299
|
+
onMouseMove: gt,
|
|
305
300
|
ref: x,
|
|
306
301
|
sx: {
|
|
307
302
|
position: "relative",
|
|
@@ -322,12 +317,12 @@ const Ee = () => {
|
|
|
322
317
|
sx: { width: "100%", position: "relative" },
|
|
323
318
|
children: [
|
|
324
319
|
/* @__PURE__ */ s(
|
|
325
|
-
|
|
320
|
+
St,
|
|
326
321
|
{
|
|
327
322
|
height: y,
|
|
328
323
|
margin: { bottom: 50 },
|
|
329
|
-
onAreaClick:
|
|
330
|
-
onHighlightChange:
|
|
324
|
+
onAreaClick: ut,
|
|
325
|
+
onHighlightChange: mt,
|
|
331
326
|
series: Y,
|
|
332
327
|
skipAnimation: !0,
|
|
333
328
|
slotProps: {
|
|
@@ -339,13 +334,13 @@ const Ee = () => {
|
|
|
339
334
|
itemContent: (t) => j && D ? /* @__PURE__ */ s(
|
|
340
335
|
Vt,
|
|
341
336
|
{
|
|
342
|
-
categoryGuids:
|
|
337
|
+
categoryGuids: E(D),
|
|
343
338
|
xData: N,
|
|
344
339
|
...t
|
|
345
340
|
}
|
|
346
341
|
) : null
|
|
347
342
|
},
|
|
348
|
-
sx:
|
|
343
|
+
sx: ht,
|
|
349
344
|
tooltip: {
|
|
350
345
|
trigger: j ? "item" : "none"
|
|
351
346
|
},
|
|
@@ -353,39 +348,39 @@ const Ee = () => {
|
|
|
353
348
|
{
|
|
354
349
|
data: N,
|
|
355
350
|
scaleType: "time",
|
|
356
|
-
valueFormatter: (t) => R(t,
|
|
357
|
-
tickNumber:
|
|
351
|
+
valueFormatter: (t) => R(t, w.MONTH_SHORT_YEAR),
|
|
352
|
+
tickNumber: et
|
|
358
353
|
// How many ticks to show on the x-axis
|
|
359
354
|
}
|
|
360
355
|
],
|
|
361
356
|
yAxis: [
|
|
362
357
|
{
|
|
363
|
-
min:
|
|
364
|
-
max:
|
|
358
|
+
min: st,
|
|
359
|
+
max: it || 100
|
|
365
360
|
}
|
|
366
361
|
]
|
|
367
362
|
}
|
|
368
363
|
),
|
|
369
364
|
/* @__PURE__ */ s(
|
|
370
|
-
|
|
365
|
+
zt,
|
|
371
366
|
{
|
|
372
|
-
categoryGuids:
|
|
367
|
+
categoryGuids: ct,
|
|
373
368
|
hoveredLegend: p,
|
|
374
369
|
legendRef: d,
|
|
375
|
-
onClickLegend:
|
|
376
|
-
onHoverLegend:
|
|
377
|
-
sx: { px:
|
|
370
|
+
onClickLegend: dt,
|
|
371
|
+
onHoverLegend: lt,
|
|
372
|
+
sx: { px: C ? 0 : 24 }
|
|
378
373
|
}
|
|
379
374
|
),
|
|
380
375
|
W && /* @__PURE__ */ s(
|
|
381
|
-
|
|
376
|
+
Xt,
|
|
382
377
|
{
|
|
383
|
-
categoryGuids:
|
|
378
|
+
categoryGuids: E(D),
|
|
384
379
|
chartContainerRef: x,
|
|
385
|
-
cursorPosition:
|
|
380
|
+
cursorPosition: I,
|
|
386
381
|
hoveredAreaData: $.map((t) => ({
|
|
387
382
|
...t,
|
|
388
|
-
x: R(t.x,
|
|
383
|
+
x: R(t.x, w.MONTH_SHORT_YEAR)
|
|
389
384
|
}))
|
|
390
385
|
}
|
|
391
386
|
)
|
|
@@ -394,19 +389,19 @@ const Ee = () => {
|
|
|
394
389
|
)
|
|
395
390
|
}
|
|
396
391
|
);
|
|
397
|
-
},
|
|
398
|
-
onClick:
|
|
392
|
+
}, ke = ({
|
|
393
|
+
onClick: r,
|
|
399
394
|
leftIcon: e,
|
|
400
|
-
rightIcon:
|
|
401
|
-
title:
|
|
402
|
-
subtitle:
|
|
395
|
+
rightIcon: o,
|
|
396
|
+
title: a,
|
|
397
|
+
subtitle: n,
|
|
403
398
|
rightContent: i,
|
|
404
|
-
titleBold:
|
|
399
|
+
titleBold: l = !0,
|
|
405
400
|
rightContentBold: h = !0
|
|
406
401
|
}) => {
|
|
407
402
|
const g = /* @__PURE__ */ f(M.Fragment, { children: [
|
|
408
|
-
e && /* @__PURE__ */ s(
|
|
409
|
-
/* @__PURE__ */ s(
|
|
403
|
+
e && /* @__PURE__ */ s(z, { sx: { ml: 0 }, children: e }),
|
|
404
|
+
/* @__PURE__ */ s($t, { children: /* @__PURE__ */ f(
|
|
410
405
|
T,
|
|
411
406
|
{
|
|
412
407
|
sx: {
|
|
@@ -416,21 +411,21 @@ const Ee = () => {
|
|
|
416
411
|
},
|
|
417
412
|
children: [
|
|
418
413
|
/* @__PURE__ */ f(T, { sx: { flex: 1, minWidth: 0 }, children: [
|
|
419
|
-
/* @__PURE__ */ s(S, { bold:
|
|
420
|
-
|
|
414
|
+
/* @__PURE__ */ s(S, { bold: l, variant: "body1", children: a }),
|
|
415
|
+
n && /* @__PURE__ */ s(S, { variant: "caption", children: n })
|
|
421
416
|
] }),
|
|
422
417
|
/* @__PURE__ */ f(T, { sx: { flexDirection: "row", alignItems: "center", gap: 1 }, children: [
|
|
423
418
|
i && /* @__PURE__ */ s(S, { bold: h, display: "flex", variant: "body1", children: i }),
|
|
424
|
-
|
|
419
|
+
o && /* @__PURE__ */ s(z, { children: o })
|
|
425
420
|
] })
|
|
426
421
|
]
|
|
427
422
|
}
|
|
428
423
|
) })
|
|
429
424
|
] });
|
|
430
|
-
return /* @__PURE__ */ s(
|
|
431
|
-
|
|
425
|
+
return /* @__PURE__ */ s(Bt, { sx: { bgcolor: "background.paper" }, children: r ? /* @__PURE__ */ s(
|
|
426
|
+
Ot,
|
|
432
427
|
{
|
|
433
|
-
onClick:
|
|
428
|
+
onClick: r,
|
|
434
429
|
sx: {
|
|
435
430
|
py: 14
|
|
436
431
|
},
|
|
@@ -449,77 +444,77 @@ const Ee = () => {
|
|
|
449
444
|
children: g
|
|
450
445
|
}
|
|
451
446
|
) });
|
|
452
|
-
},
|
|
453
|
-
function
|
|
454
|
-
const
|
|
455
|
-
for (;
|
|
456
|
-
const
|
|
457
|
-
|
|
447
|
+
}, qt = (r) => A[r] ?? A.default, Jt = (r) => Nt[r];
|
|
448
|
+
function Kt(r, e) {
|
|
449
|
+
const o = [], a = new Date(r);
|
|
450
|
+
for (; a <= e; ) {
|
|
451
|
+
const n = a.getFullYear(), i = String(a.getMonth() + 1).padStart(2, "0");
|
|
452
|
+
o.push(+`${n}${i}`), a.setMonth(a.getMonth() + 1);
|
|
458
453
|
}
|
|
459
|
-
return
|
|
454
|
+
return o;
|
|
460
455
|
}
|
|
461
|
-
const
|
|
462
|
-
const
|
|
463
|
-
top_level_category_guid:
|
|
464
|
-
category_guid:
|
|
465
|
-
amount:
|
|
466
|
-
year_month:
|
|
467
|
-
}, { top_level_category_guid: i, category_guid:
|
|
468
|
-
return
|
|
469
|
-
}, {}),
|
|
470
|
-
const
|
|
471
|
-
return Object.entries(
|
|
472
|
-
const g = h[0].top_level_category_guid,
|
|
456
|
+
const Qt = (r) => r.reduce((o, a) => {
|
|
457
|
+
const n = {
|
|
458
|
+
top_level_category_guid: a.top_level_category_guid,
|
|
459
|
+
category_guid: a.category_guid,
|
|
460
|
+
amount: a.total,
|
|
461
|
+
year_month: a.year_month
|
|
462
|
+
}, { top_level_category_guid: i, category_guid: l } = n;
|
|
463
|
+
return o[l] || (o[l] = []), o[l].push(n), i !== l && (o[i] || (o[i] = []), o[i].push(n)), o;
|
|
464
|
+
}, {}), Ee = (r, e, o) => {
|
|
465
|
+
const a = Qt(r), n = Kt(e, o);
|
|
466
|
+
return Object.entries(a).map(([l, h]) => {
|
|
467
|
+
const g = h[0].top_level_category_guid, C = n.map((d) => {
|
|
473
468
|
const u = h.filter((p) => p.year_month === d).reduce((p, v) => p + Math.abs(v.amount), 0), x = Number(String(d).slice(0, 4)), y = Number(String(d).slice(4));
|
|
474
469
|
return { x: new Date(x, y - 1), y: u };
|
|
475
470
|
}).sort((d, u) => d.x.getTime() - u.x.getTime());
|
|
476
471
|
return {
|
|
477
472
|
top_level_category_guid: g,
|
|
478
|
-
category_guid:
|
|
479
|
-
category_name:
|
|
480
|
-
category_color:
|
|
481
|
-
dataset:
|
|
473
|
+
category_guid: l,
|
|
474
|
+
category_name: Jt(l),
|
|
475
|
+
category_color: qt(g),
|
|
476
|
+
dataset: C
|
|
482
477
|
};
|
|
483
478
|
});
|
|
484
|
-
},
|
|
485
|
-
const
|
|
486
|
-
return (
|
|
487
|
-
},
|
|
488
|
-
const
|
|
489
|
-
return
|
|
490
|
-
const
|
|
491
|
-
const u = d.monthlyAmounts.slice(-e).find((x) =>
|
|
479
|
+
}, Ge = (r, e) => {
|
|
480
|
+
const o = typeof r == "string" ? parseFloat(r.replace(/[^0-9.-]+/g, "")) : r, a = typeof e == "string" ? parseFloat(e.replace(/[^0-9.-]+/g, "")) : e;
|
|
481
|
+
return (o || 0) - (a || 0);
|
|
482
|
+
}, Ut = (r, e) => {
|
|
483
|
+
const o = r.subCategories.filter((i) => i.currentAmount !== 0), a = r.totalMonthlyAmounts.slice(-e), n = (i) => i.substring(0, 3) + " " + i.slice(-4);
|
|
484
|
+
return a.map((i) => {
|
|
485
|
+
const l = n(i.label), h = o.map((d) => {
|
|
486
|
+
const u = d.monthlyAmounts.slice(-e).find((x) => n(x.label) === l);
|
|
492
487
|
return {
|
|
493
488
|
label: d.name,
|
|
494
489
|
amount: Math.abs(u?.amount || 0),
|
|
495
|
-
header:
|
|
490
|
+
header: l
|
|
496
491
|
};
|
|
497
|
-
}), g =
|
|
492
|
+
}), g = r.monthlyAmounts.slice(-e).find((d) => n(d.label) === l);
|
|
498
493
|
return [{
|
|
499
|
-
label:
|
|
494
|
+
label: r.name,
|
|
500
495
|
amount: Math.abs(g?.amount || 0),
|
|
501
|
-
header:
|
|
496
|
+
header: l
|
|
502
497
|
}, ...h].sort((d, u) => u.amount - d.amount);
|
|
503
498
|
});
|
|
504
|
-
},
|
|
505
|
-
const
|
|
506
|
-
x:
|
|
507
|
-
y: Math.abs(
|
|
508
|
-
})) : [],
|
|
509
|
-
return { monthlyAmounts:
|
|
510
|
-
},
|
|
511
|
-
(e) => e.totalAmount !== 0 && e.isTransfer === !1 && e.guid !==
|
|
512
|
-
).sort((e,
|
|
513
|
-
class
|
|
499
|
+
}, Zt = (r, e) => {
|
|
500
|
+
const o = r ? r.totalMonthlyAmounts.slice(-e).map((n) => ({
|
|
501
|
+
x: n.label.substring(0, 3),
|
|
502
|
+
y: Math.abs(n.amount)
|
|
503
|
+
})) : [], a = r ? Ut(r, e) : [];
|
|
504
|
+
return { monthlyAmounts: o, tooltipLabels: a };
|
|
505
|
+
}, te = (r) => r.slice().filter(
|
|
506
|
+
(e) => e.totalAmount !== 0 && e.isTransfer === !1 && e.guid !== Gt.INVESTMENTS
|
|
507
|
+
).sort((e, o) => Math.abs(o.totalAmount) - Math.abs(e.totalAmount));
|
|
508
|
+
class Ne {
|
|
514
509
|
globalStore;
|
|
515
510
|
selectedCategoryData = null;
|
|
516
511
|
selectedDateRange;
|
|
517
512
|
visibleListLength = 5;
|
|
518
513
|
constructor(e) {
|
|
519
514
|
this.globalStore = e, this.selectedDateRange = {
|
|
520
|
-
start:
|
|
515
|
+
start: jt(q(Yt(/* @__PURE__ */ new Date(), 6)), 1),
|
|
521
516
|
end: q(/* @__PURE__ */ new Date())
|
|
522
|
-
},
|
|
517
|
+
}, Wt(this);
|
|
523
518
|
}
|
|
524
519
|
setSelectedCategoryData = (e) => {
|
|
525
520
|
this.selectedCategoryData = e;
|
|
@@ -531,16 +526,16 @@ class Oe {
|
|
|
531
526
|
this.visibleListLength = e;
|
|
532
527
|
};
|
|
533
528
|
get sortedDetailedCategoriesWithTransactions() {
|
|
534
|
-
return
|
|
529
|
+
return te(
|
|
535
530
|
this.globalStore.categoryStore.detailedCategoriesWithTransactions
|
|
536
531
|
);
|
|
537
532
|
}
|
|
538
533
|
get selectedDateRangeMonthCount() {
|
|
539
|
-
return
|
|
534
|
+
return Ft(this.selectedDateRange.end, this.selectedDateRange.start) + 1;
|
|
540
535
|
}
|
|
541
536
|
get selectedDateRangeMonthRange() {
|
|
542
|
-
const e = R(this.selectedDateRange.start,
|
|
543
|
-
return `${e} - ${
|
|
537
|
+
const e = R(this.selectedDateRange.start, w.MONTH_LONG), o = R(this.selectedDateRange.end, w.MONTH_LONG);
|
|
538
|
+
return `${e} - ${o}`;
|
|
544
539
|
}
|
|
545
540
|
get visibleCategories() {
|
|
546
541
|
return this.sortedDetailedCategoriesWithTransactions.slice(0, this.visibleListLength);
|
|
@@ -549,17 +544,16 @@ class Oe {
|
|
|
549
544
|
return this.sortedDetailedCategoriesWithTransactions.slice(this.visibleListLength);
|
|
550
545
|
}
|
|
551
546
|
get categoryDetailsChartData() {
|
|
552
|
-
return
|
|
547
|
+
return Zt(
|
|
553
548
|
this.selectedCategoryData,
|
|
554
549
|
this.selectedDateRangeMonthCount
|
|
555
550
|
);
|
|
556
551
|
}
|
|
557
552
|
}
|
|
558
553
|
export {
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
Ee as u
|
|
554
|
+
ke as L,
|
|
555
|
+
Ie as S,
|
|
556
|
+
Ne as T,
|
|
557
|
+
Ge as a,
|
|
558
|
+
Ee as g
|
|
565
559
|
};
|