@mx-cartographer/experiences 7.0.58-alpha.mm1 → 7.0.58-alpha.mm2
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/trends/index.es.js +234 -233
- package/package.json +1 -1
package/dist/trends/index.es.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import { jsx as e, jsxs as C, Fragment as
|
|
1
|
+
import { jsx as e, jsxs as C, Fragment as qe } from "react/jsx-runtime";
|
|
2
2
|
import i from "react";
|
|
3
3
|
import { observer as v } from "mobx-react-lite";
|
|
4
|
-
import { Icon as ie, Text as Q, CategoryIcon as fe, P as X, H3 as Le, ChevronRightIcon as
|
|
4
|
+
import { Icon as ie, Text as Q, CategoryIcon as fe, P as X, H3 as Le, ChevronRightIcon as Je } from "@mxenabled/mxui";
|
|
5
5
|
import W from "@mui/material/Box";
|
|
6
|
-
import
|
|
6
|
+
import b from "@mui/material/Stack";
|
|
7
7
|
import ge from "@mui/material/Button";
|
|
8
8
|
import { addSeconds as xe } from "date-fns/addSeconds";
|
|
9
9
|
import { differenceInCalendarMonths as pe } from "date-fns/differenceInCalendarMonths";
|
|
10
|
-
import { a as
|
|
10
|
+
import { a as et, g as tt, S as nt, L as ve } from "../TrendsStore-BKBnNQba.mjs";
|
|
11
11
|
import { T as mo } from "../TrendsStore-BKBnNQba.mjs";
|
|
12
|
-
import { i as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { u as R, m as K, g as k, b as ee, h as ce, d as le, v as te, f as Te, p as
|
|
12
|
+
import { i as ot, c as st, d as rt, e as at, f as it, h as ct, b as Me, g as Ae, j as we } from "../SpendingData-D5vsfYKo.mjs";
|
|
13
|
+
import lt from "@mui/material/ToggleButton";
|
|
14
|
+
import dt from "@mui/material/ToggleButtonGroup";
|
|
15
|
+
import { u as R, m as K, g as k, b as ee, h as ce, d as le, v as te, f as Te, p as ht, a as Re } from "../hooks-CE2TKk4a.mjs";
|
|
16
16
|
import { u as $ } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
17
17
|
import { f as q, D as B } from "../Dialog-CWW597AF.mjs";
|
|
18
18
|
import { DataGridPro as ut } from "@mui/x-data-grid-pro";
|
|
19
19
|
import { C as mt } from "../CurrencyText-YUhH2caW.mjs";
|
|
20
|
-
import { c as
|
|
20
|
+
import { c as ke } from "../Category-CevNQ03n.mjs";
|
|
21
21
|
import { b as gt } from "../Localization-2MODESHW.mjs";
|
|
22
22
|
import { H as De } from "../HeaderCell-DjuifqHJ.mjs";
|
|
23
23
|
import { T as A, b as pt } from "../ViewMoreMicroCard-BAz2NyEO.mjs";
|
|
24
|
-
import { A as
|
|
25
|
-
import { a as
|
|
24
|
+
import { A as y, W as Ne } from "../WidgetContainer-B8MRJ5Y1.mjs";
|
|
25
|
+
import { a as He, T as We } from "../TransactionDetails-DAp_CPCP.mjs";
|
|
26
26
|
import { D as Ce } from "../Drawer-kEE73B87.mjs";
|
|
27
27
|
import { L as J } from "../Loader-DUaFpDGv.mjs";
|
|
28
|
-
import { useTheme as
|
|
28
|
+
import { useTheme as Oe } from "@mui/material/styles";
|
|
29
29
|
import { L as ye } from "../LineChart-B2Y7zwMu.mjs";
|
|
30
30
|
import { M as Ct } from "../MiniWidgetContainer-DTQdRK-3.mjs";
|
|
31
31
|
import { subMonths as ft } from "date-fns";
|
|
@@ -38,7 +38,7 @@ import Lt from "@mui/material/ListItem";
|
|
|
38
38
|
import xt from "@mui/material/ListItemButton";
|
|
39
39
|
import vt from "@mui/material/ListItemIcon";
|
|
40
40
|
import Mt from "@mui/material/ListItemText";
|
|
41
|
-
import
|
|
41
|
+
import Ve from "@mui/material/styles/useTheme";
|
|
42
42
|
import At from "@mui/material/Divider";
|
|
43
43
|
import { useTheme as Rt, Stack as kt } from "@mui/material";
|
|
44
44
|
import Nt from "@mui/material/Paper";
|
|
@@ -47,17 +47,17 @@ import { E as Wt } from "../ExportCsvAction-CBJAfyAw.mjs";
|
|
|
47
47
|
import { u as Ot } from "../useInsightsEnabled-DSnpkUq0.mjs";
|
|
48
48
|
import { E as Vt } from "../EmptyState-w2yYDuKG.mjs";
|
|
49
49
|
import { k as Gt } from "../ConnectDrawer-DJA_S-rX.mjs";
|
|
50
|
-
const
|
|
51
|
-
|
|
50
|
+
const Ge = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
51
|
+
dt,
|
|
52
52
|
{
|
|
53
53
|
exclusive: !0,
|
|
54
54
|
onChange: o,
|
|
55
55
|
orientation: "horizontal",
|
|
56
56
|
value: t,
|
|
57
|
-
children: ["Chart", "Table"].map((n) => /* @__PURE__ */ e(
|
|
57
|
+
children: ["Chart", "Table"].map((n) => /* @__PURE__ */ e(lt, { color: "primary", sx: { width: 56 }, value: n, children: n === "Chart" ? /* @__PURE__ */ e(ie, { name: "table_chart_view" }) : /* @__PURE__ */ e(ie, { name: "format_list_bulleted" }) }, n))
|
|
58
58
|
}
|
|
59
|
-
),
|
|
60
|
-
const { trends: n } = R(), { isMobile: s, isDesktop: a } = $(), { getCategoryName:
|
|
59
|
+
), Be = ({ selectedDateRange: t, selectedCategoryGuid: o }) => {
|
|
60
|
+
const { trends: n } = R(), { isMobile: s, isDesktop: a } = $(), { getCategoryName: d } = K(), h = i.useMemo(() => {
|
|
61
61
|
const l = q(
|
|
62
62
|
t.start,
|
|
63
63
|
s ? B.MONTH_SHORT_YEAR : B.MONTH_YEAR
|
|
@@ -79,17 +79,17 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
79
79
|
textOverflow: "unset"
|
|
80
80
|
},
|
|
81
81
|
variant: a ? "H3" : "Body",
|
|
82
|
-
children:
|
|
82
|
+
children: d(o) || n.sub_title
|
|
83
83
|
}
|
|
84
84
|
),
|
|
85
|
-
/* @__PURE__ */ e(Q, { variant: a ? "Body" : "Small", children:
|
|
85
|
+
/* @__PURE__ */ e(Q, { variant: a ? "Body" : "Small", children: h })
|
|
86
86
|
] });
|
|
87
87
|
}, Bt = (t) => {
|
|
88
88
|
const o = t.row[t.field];
|
|
89
|
-
return /* @__PURE__ */ e(
|
|
89
|
+
return /* @__PURE__ */ e(b, { alignItems: "flex-end", tabIndex: t.tabIndex, children: /* @__PURE__ */ e(mt, { amount: o, variant: "Small" }) });
|
|
90
90
|
}, zt = ({ categoryGuid: t, topLevelCategoryGuid: o }) => {
|
|
91
|
-
const { categories: n } = R(), s = n.default_categories[t]?.replace(/&/g, "&") ??
|
|
92
|
-
return /* @__PURE__ */ C(
|
|
91
|
+
const { categories: n } = R(), s = n.default_categories[t]?.replace(/&/g, "&") ?? ke[t];
|
|
92
|
+
return /* @__PURE__ */ C(b, { alignItems: "center", direction: "row", justifyContent: "center", children: [
|
|
93
93
|
/* @__PURE__ */ e(
|
|
94
94
|
W,
|
|
95
95
|
{
|
|
@@ -100,7 +100,7 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
100
100
|
),
|
|
101
101
|
/* @__PURE__ */ e(Q, { sx: { ml: 12, pb: 6 }, variant: "Small", children: s })
|
|
102
102
|
] });
|
|
103
|
-
}, Ft = (t) => /* @__PURE__ */ e(
|
|
103
|
+
}, Ft = (t) => /* @__PURE__ */ e(b, { alignItems: "center", direction: "row", height: "100%", width: "100%", children: /* @__PURE__ */ e(
|
|
104
104
|
zt,
|
|
105
105
|
{
|
|
106
106
|
categoryGuid: t.row.category,
|
|
@@ -113,17 +113,17 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
113
113
|
n.push(a), s.setMonth(s.getMonth() + 1);
|
|
114
114
|
}
|
|
115
115
|
return n;
|
|
116
|
-
},
|
|
116
|
+
}, ze = ({
|
|
117
117
|
monthlyCategoryTotals: t,
|
|
118
118
|
selectedDateRange: o,
|
|
119
119
|
selectedCategory: n,
|
|
120
120
|
onClickRow: s,
|
|
121
121
|
height: a = "100dvh",
|
|
122
|
-
sx:
|
|
122
|
+
sx: d = {}
|
|
123
123
|
}) => {
|
|
124
|
-
const { onEvent:
|
|
124
|
+
const { onEvent: h } = k(), l = q(/* @__PURE__ */ new Date(), B.MONTH_SHORT), [c, g] = i.useState([
|
|
125
125
|
{ field: l, sort: "desc" }
|
|
126
|
-
]), f = i.useMemo(() => Pt(o.start, o.end), [o]),
|
|
126
|
+
]), f = i.useMemo(() => Pt(o.start, o.end), [o]), u = [
|
|
127
127
|
{
|
|
128
128
|
field: "category",
|
|
129
129
|
flex: 1,
|
|
@@ -147,48 +147,48 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
147
147
|
sortable: !0,
|
|
148
148
|
hideSortIcons: !1,
|
|
149
149
|
type: "number",
|
|
150
|
-
sortComparator:
|
|
150
|
+
sortComparator: et
|
|
151
151
|
})
|
|
152
152
|
)
|
|
153
|
-
],
|
|
153
|
+
], T = i.useMemo(() => {
|
|
154
154
|
const r = t.filter(
|
|
155
|
-
(p) => !
|
|
156
|
-
),
|
|
155
|
+
(p) => !ot(p) && !st(p)
|
|
156
|
+
), _ = (n ? r.filter(
|
|
157
157
|
(p) => p.category_guid === n || p.top_level_category_guid === n
|
|
158
158
|
) : r).reduce(
|
|
159
159
|
(p, D) => {
|
|
160
|
-
const { category_guid: w, top_level_category_guid:
|
|
160
|
+
const { category_guid: w, top_level_category_guid: I, month: N, total: E, year: O } = D, M = n ? w : I;
|
|
161
161
|
p[M] || (p[M] = {
|
|
162
162
|
id: M,
|
|
163
163
|
category: M,
|
|
164
164
|
category_guid: w,
|
|
165
|
-
top_level_category_guid:
|
|
165
|
+
top_level_category_guid: I
|
|
166
166
|
});
|
|
167
167
|
const L = q(new Date(O, N - 1), B.MONTH_SHORT);
|
|
168
|
-
return p[M][L] || (p[M][L] = 0), p[M][L] = p[M][L] + Math.abs(
|
|
168
|
+
return p[M][L] || (p[M][L] = 0), p[M][L] = p[M][L] + Math.abs(E), p;
|
|
169
169
|
},
|
|
170
170
|
{}
|
|
171
171
|
);
|
|
172
|
-
return Object.values(
|
|
172
|
+
return Object.values(_);
|
|
173
173
|
}, [t, n]);
|
|
174
|
-
return /* @__PURE__ */ e(W, { sx: { height: a, width: "100%", overflowX: "auto", boxShadow: "none", ...
|
|
174
|
+
return /* @__PURE__ */ e(W, { sx: { height: a, width: "100%", overflowX: "auto", boxShadow: "none", ...d }, children: /* @__PURE__ */ e(
|
|
175
175
|
ut,
|
|
176
176
|
{
|
|
177
|
-
columns:
|
|
177
|
+
columns: u,
|
|
178
178
|
disableColumnFilter: !0,
|
|
179
179
|
disableColumnMenu: !0,
|
|
180
180
|
hideFooter: !0,
|
|
181
181
|
initialState: { sorting: { sortModel: c } },
|
|
182
182
|
onRowClick: (r) => {
|
|
183
|
-
s?.(r.row.category),
|
|
183
|
+
s?.(r.row.category), h(y.TRENDS_CLICK_LIST_ITEM, {
|
|
184
184
|
...A,
|
|
185
|
-
listItem:
|
|
185
|
+
listItem: ke[r.row.category]
|
|
186
186
|
});
|
|
187
187
|
},
|
|
188
188
|
onSortModelChange: (r) => {
|
|
189
|
-
g(r),
|
|
189
|
+
g(r), h(y.TRENDS_CLICK_TABLE_SORT, A);
|
|
190
190
|
},
|
|
191
|
-
rows:
|
|
191
|
+
rows: T,
|
|
192
192
|
slotProps: { baseIconButton: { color: "secondary", sx: { ml: 8 } } },
|
|
193
193
|
sortModel: c,
|
|
194
194
|
sortingOrder: ["asc", "desc"]
|
|
@@ -202,89 +202,89 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
202
202
|
isOpen: n,
|
|
203
203
|
onClose: s
|
|
204
204
|
}) => {
|
|
205
|
-
const { onEvent: a } = k(), { selectedAccountGuids:
|
|
205
|
+
const { onEvent: a } = k(), { selectedAccountGuids: d } = ee(), { common: h } = R(), { setFilter: l, sortedTransactions: c } = ce(), [g, f] = i.useState(""), u = i.useMemo(
|
|
206
206
|
() => c.find((r) => r.guid === g),
|
|
207
207
|
[g, c]
|
|
208
208
|
);
|
|
209
209
|
i.useEffect(() => {
|
|
210
210
|
l({
|
|
211
|
-
accounts:
|
|
211
|
+
accounts: d,
|
|
212
212
|
dateRange: o,
|
|
213
213
|
custom: (r) => t === "" || t === r.category_guid || t === r.top_level_category_guid,
|
|
214
214
|
showSplits: !!t
|
|
215
215
|
});
|
|
216
|
-
}, [
|
|
217
|
-
const
|
|
216
|
+
}, [d, t, o]), i.useEffect(() => a(y.TRENDS_VIEW_TRANSACTIONS), []);
|
|
217
|
+
const T = () => {
|
|
218
218
|
f(""), s();
|
|
219
219
|
};
|
|
220
220
|
return /* @__PURE__ */ C(
|
|
221
221
|
Ce,
|
|
222
222
|
{
|
|
223
|
-
ariaLabelClose:
|
|
223
|
+
ariaLabelClose: h.close_aria,
|
|
224
224
|
isOpen: n,
|
|
225
|
-
onClose:
|
|
225
|
+
onClose: T,
|
|
226
226
|
title: Kt.title,
|
|
227
227
|
children: [
|
|
228
|
-
|
|
229
|
-
!
|
|
228
|
+
u && /* @__PURE__ */ e(He, { transaction: u }),
|
|
229
|
+
!u && /* @__PURE__ */ e(We, { onClick: f })
|
|
230
230
|
]
|
|
231
231
|
}
|
|
232
232
|
);
|
|
233
233
|
}, jt = v($t), Yt = ({ onBackClick: t, sx: o }) => {
|
|
234
|
-
const { onEvent: n } = k(), { isDesktop: s, isTablet: a, isMobile:
|
|
234
|
+
const { onEvent: n } = k(), { isDesktop: s, isTablet: a, isMobile: d } = $(), { visibleAccounts: h } = le(), { loadMonthlyCategoryTotals: l, monthlyCategoryTotals: c, getCategoryName: g } = K(), { sortedTransactions: f } = ce(), { selectedDateRange: u, setSelectedDateRange: T } = te(), { isCopyLoaded: r, isInitialized: m, selectedAccounts: _, setSelectedAccounts: p } = ee(), { trends: D } = R(), [w, I] = i.useState(!1), [N, E] = i.useState(!1), [O, M] = i.useState("Chart"), [L, z] = i.useState(""), [F, de] = i.useState(window.innerHeight), j = F - (d ? 315 : 345);
|
|
235
235
|
i.useEffect(() => {
|
|
236
236
|
const S = () => de(window.innerHeight);
|
|
237
237
|
return window.addEventListener("resize", S), () => window.removeEventListener("resize", S);
|
|
238
238
|
}, []), i.useEffect(() => {
|
|
239
|
-
p(
|
|
240
|
-
}, [
|
|
239
|
+
p(h);
|
|
240
|
+
}, [h]), i.useEffect(() => {
|
|
241
241
|
m && l(
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
242
|
+
_,
|
|
243
|
+
u.start,
|
|
244
|
+
u.end
|
|
245
245
|
).finally(() => {
|
|
246
|
-
|
|
246
|
+
I(!0);
|
|
247
247
|
});
|
|
248
|
-
}, [m,
|
|
248
|
+
}, [m, _, u]);
|
|
249
249
|
const ne = i.useMemo(() => {
|
|
250
250
|
if (!w) return { stackedDatasets: [], unstackedDatasets: [] };
|
|
251
|
-
const S =
|
|
251
|
+
const S = tt(
|
|
252
252
|
c,
|
|
253
|
-
|
|
254
|
-
|
|
253
|
+
u.start,
|
|
254
|
+
u.end
|
|
255
255
|
), H = L.length ? S.filter(
|
|
256
256
|
(G) => G.top_level_category_guid === L || G.category_guid === L
|
|
257
|
-
) :
|
|
257
|
+
) : rt(S);
|
|
258
258
|
return {
|
|
259
|
-
stackedDatasets: H.filter(
|
|
260
|
-
unstackedDatasets: H.filter(
|
|
259
|
+
stackedDatasets: H.filter(at),
|
|
260
|
+
unstackedDatasets: H.filter(it)
|
|
261
261
|
};
|
|
262
|
-
}, [c, L,
|
|
263
|
-
M(H ?? O), n(
|
|
262
|
+
}, [c, L, u]), P = (S, H) => {
|
|
263
|
+
M(H ?? O), n(y.TRENDS_CLICK_TOGGLE_VIEW);
|
|
264
264
|
}, he = (S) => {
|
|
265
265
|
const H = xe(S?.[0], 1), G = S?.[1], ae = pe(G, H);
|
|
266
|
-
|
|
266
|
+
T({ start: H, end: G }), n(y.TRENDS_CLICK_TIME_WINDOW, {
|
|
267
267
|
time_period: ae + "M"
|
|
268
268
|
});
|
|
269
269
|
}, Y = () => {
|
|
270
|
-
n(
|
|
270
|
+
n(y.TRENDS_CLICK_FILTER);
|
|
271
271
|
}, oe = (S) => {
|
|
272
272
|
z(S);
|
|
273
273
|
}, ue = (S) => {
|
|
274
|
-
z(S), n(
|
|
274
|
+
z(S), n(y.TRENDS_CLICK_LEGEND, { category: g(S) });
|
|
275
275
|
}, se = (S) => {
|
|
276
|
-
n(
|
|
276
|
+
n(y.TRENDS_HOVER_LEGEND, { category: g(S) });
|
|
277
277
|
}, re = (S) => {
|
|
278
|
-
n(
|
|
278
|
+
n(y.TRENDS_HOVER_AREA, { category: S });
|
|
279
279
|
}, me = (S) => {
|
|
280
|
-
n(
|
|
280
|
+
n(y.TRENDS_HOVER_POINT, { category: S });
|
|
281
281
|
};
|
|
282
282
|
return !r || !m || !w ? /* @__PURE__ */ e(J, {}) : /* @__PURE__ */ C(
|
|
283
|
-
|
|
283
|
+
Ne,
|
|
284
284
|
{
|
|
285
|
-
accountOptions:
|
|
285
|
+
accountOptions: h,
|
|
286
286
|
calendarActions: { onRangeChanged: he },
|
|
287
|
-
dateRange:
|
|
287
|
+
dateRange: u,
|
|
288
288
|
dateRangeVariant: "timeframebuttons",
|
|
289
289
|
onAccountsFilterClick: Y,
|
|
290
290
|
onBackClick: t,
|
|
@@ -292,7 +292,7 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
292
292
|
title: D.title,
|
|
293
293
|
children: [
|
|
294
294
|
/* @__PURE__ */ C(
|
|
295
|
-
|
|
295
|
+
b,
|
|
296
296
|
{
|
|
297
297
|
sx: {
|
|
298
298
|
// eslint-disable-next-line no-nested-ternary
|
|
@@ -300,33 +300,33 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
300
300
|
},
|
|
301
301
|
children: [
|
|
302
302
|
/* @__PURE__ */ C(
|
|
303
|
-
|
|
303
|
+
b,
|
|
304
304
|
{
|
|
305
305
|
flexDirection: "row",
|
|
306
306
|
justifyContent: "space-between",
|
|
307
|
-
sx: { pb:
|
|
307
|
+
sx: { pb: d ? 12 : 24, pt: d ? 24 : 48 },
|
|
308
308
|
children: [
|
|
309
309
|
/* @__PURE__ */ e(
|
|
310
|
-
|
|
310
|
+
Be,
|
|
311
311
|
{
|
|
312
312
|
selectedCategoryGuid: L,
|
|
313
|
-
selectedDateRange:
|
|
313
|
+
selectedDateRange: u
|
|
314
314
|
}
|
|
315
315
|
),
|
|
316
|
-
/* @__PURE__ */ e(
|
|
316
|
+
/* @__PURE__ */ e(Ge, { onTabChange: P, selectedTab: O })
|
|
317
317
|
]
|
|
318
318
|
}
|
|
319
319
|
),
|
|
320
|
-
/* @__PURE__ */ C(
|
|
320
|
+
/* @__PURE__ */ C(b, { alignItems: "center", flexDirection: "row", width: "100%", children: [
|
|
321
321
|
/* @__PURE__ */ e(W, { flexGrow: 1, children: L && /* @__PURE__ */ C(ge, { onClick: () => z(""), sx: { p: 0, pr: 5 }, children: [
|
|
322
322
|
/* @__PURE__ */ e(ie, { name: "arrow_back" }),
|
|
323
323
|
D.all_categories
|
|
324
324
|
] }) }),
|
|
325
|
-
/* @__PURE__ */ e(ge, { onClick: () =>
|
|
325
|
+
/* @__PURE__ */ e(ge, { onClick: () => E(!0), sx: { px: 5 }, children: `${D.view_transactions} (${f.length})` })
|
|
326
326
|
] }),
|
|
327
327
|
/* @__PURE__ */ C(W, { children: [
|
|
328
328
|
O === "Chart" && /* @__PURE__ */ e(
|
|
329
|
-
|
|
329
|
+
nt,
|
|
330
330
|
{
|
|
331
331
|
availableHeight: j,
|
|
332
332
|
onClickLegend: ue,
|
|
@@ -338,12 +338,12 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
338
338
|
}
|
|
339
339
|
),
|
|
340
340
|
O === "Table" && /* @__PURE__ */ e(
|
|
341
|
-
|
|
341
|
+
ze,
|
|
342
342
|
{
|
|
343
343
|
monthlyCategoryTotals: c,
|
|
344
344
|
onClickRow: oe,
|
|
345
345
|
selectedCategory: L,
|
|
346
|
-
selectedDateRange:
|
|
346
|
+
selectedDateRange: u
|
|
347
347
|
}
|
|
348
348
|
)
|
|
349
349
|
] })
|
|
@@ -354,16 +354,16 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
354
354
|
jt,
|
|
355
355
|
{
|
|
356
356
|
categoryGuid: L,
|
|
357
|
-
dateRange:
|
|
357
|
+
dateRange: u,
|
|
358
358
|
isOpen: N,
|
|
359
|
-
onClose: () =>
|
|
359
|
+
onClose: () => E(!1)
|
|
360
360
|
}
|
|
361
361
|
)
|
|
362
362
|
]
|
|
363
363
|
}
|
|
364
364
|
);
|
|
365
365
|
}, ao = v(Yt), Ut = () => {
|
|
366
|
-
const t =
|
|
366
|
+
const t = Oe(), { monthlyCategoryTotals: o } = K(), { trends: n } = R(), s = ct(o);
|
|
367
367
|
return /* @__PURE__ */ e(
|
|
368
368
|
ye,
|
|
369
369
|
{
|
|
@@ -381,19 +381,19 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
381
381
|
}
|
|
382
382
|
);
|
|
383
383
|
}, Xt = v(Ut), Zt = ({ onPrimaryCtaClick: t, sx: o }) => {
|
|
384
|
-
const { visibleAccounts: n } = le(), { loadMonthlyCategoryTotals: s, monthlyTotalsLoaded: a } = K(), { isInitialized:
|
|
384
|
+
const { visibleAccounts: n } = le(), { loadMonthlyCategoryTotals: s, monthlyTotalsLoaded: a } = K(), { isInitialized: d } = Te(), { trends: h } = R(), { isCopyLoaded: l, selectedAccounts: c, setSelectedAccounts: g } = ee();
|
|
385
385
|
return i.useEffect(() => {
|
|
386
386
|
g(n);
|
|
387
387
|
}, [n]), i.useEffect(() => {
|
|
388
|
-
|
|
389
|
-
}, [
|
|
388
|
+
d && s(c).finally();
|
|
389
|
+
}, [d, c]), !l || !d ? /* @__PURE__ */ e(J, {}) : /* @__PURE__ */ e(
|
|
390
390
|
Ct,
|
|
391
391
|
{
|
|
392
392
|
onPrimaryCtaClick: t,
|
|
393
|
-
primaryCtaLabel:
|
|
394
|
-
subTitle:
|
|
393
|
+
primaryCtaLabel: h.primary_cta,
|
|
394
|
+
subTitle: h.sub_title,
|
|
395
395
|
sx: o,
|
|
396
|
-
title:
|
|
396
|
+
title: h.mini_title,
|
|
397
397
|
children: a ? /* @__PURE__ */ e(Xt, {}) : /* @__PURE__ */ e(J, {})
|
|
398
398
|
}
|
|
399
399
|
);
|
|
@@ -403,14 +403,14 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
403
403
|
transactionType: n,
|
|
404
404
|
percentage: s,
|
|
405
405
|
secondaryLabel: a,
|
|
406
|
-
shouldDisplayPercentage:
|
|
406
|
+
shouldDisplayPercentage: d
|
|
407
407
|
}) => {
|
|
408
|
-
const { availableWidth:
|
|
408
|
+
const { availableWidth: h } = ht(), l = i.useRef(null), c = i.useRef(null), g = wt(Number(Math.abs(s)), {
|
|
409
409
|
style: "percent",
|
|
410
410
|
minimumIntegerDigits: 1
|
|
411
|
-
}), f =
|
|
411
|
+
}), f = h === 288 && Z(o, "0,0.00").length > 10 ? Z(o, "0,0") : Z(o, "0,0.00"), u = n === "spending" ? s > 0 : s >= 0, T = n === "spending" ? "error.main" : "success.main", r = n === "spending" ? "success.main" : "text.secondary", m = l?.current, _ = c?.current, p = m && _ ? m.scrollWidth > _.clientWidth - Qt : !1;
|
|
412
412
|
return /* @__PURE__ */ C(
|
|
413
|
-
|
|
413
|
+
b,
|
|
414
414
|
{
|
|
415
415
|
sx: {
|
|
416
416
|
border: 1,
|
|
@@ -423,7 +423,7 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
423
423
|
},
|
|
424
424
|
children: [
|
|
425
425
|
/* @__PURE__ */ C(
|
|
426
|
-
|
|
426
|
+
b,
|
|
427
427
|
{
|
|
428
428
|
sx: {
|
|
429
429
|
alignItems: "center",
|
|
@@ -432,13 +432,13 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
432
432
|
},
|
|
433
433
|
children: [
|
|
434
434
|
/* @__PURE__ */ e(X, { color: "text.secondary", variant: "caption", children: t }),
|
|
435
|
-
|
|
436
|
-
|
|
435
|
+
d && /* @__PURE__ */ C(b, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
|
|
436
|
+
u ? /* @__PURE__ */ e(Tt, { size: 20, sx: { color: T } }) : /* @__PURE__ */ e(yt, { size: 20, sx: { color: r } }),
|
|
437
437
|
/* @__PURE__ */ e(
|
|
438
438
|
X,
|
|
439
439
|
{
|
|
440
440
|
sx: {
|
|
441
|
-
color:
|
|
441
|
+
color: u ? T : r,
|
|
442
442
|
fontWeight: 600
|
|
443
443
|
},
|
|
444
444
|
variant: "body2",
|
|
@@ -450,7 +450,7 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
450
450
|
}
|
|
451
451
|
),
|
|
452
452
|
/* @__PURE__ */ C(
|
|
453
|
-
|
|
453
|
+
b,
|
|
454
454
|
{
|
|
455
455
|
ref: c,
|
|
456
456
|
sx: {
|
|
@@ -467,10 +467,10 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
467
467
|
children: /* @__PURE__ */ e(Le, { children: f })
|
|
468
468
|
}
|
|
469
469
|
),
|
|
470
|
-
|
|
470
|
+
d && h >= 450 && !p && /* @__PURE__ */ e(
|
|
471
471
|
X,
|
|
472
472
|
{
|
|
473
|
-
color:
|
|
473
|
+
color: u ? T : r,
|
|
474
474
|
variant: "caption",
|
|
475
475
|
children: a
|
|
476
476
|
}
|
|
@@ -483,48 +483,48 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
483
483
|
);
|
|
484
484
|
}, qt = v(() => {
|
|
485
485
|
const { trends: t } = R();
|
|
486
|
-
return /* @__PURE__ */ C(
|
|
486
|
+
return /* @__PURE__ */ C(b, { sx: { alignItems: "start", flexDirection: "row", gap: 12 }, children: [
|
|
487
487
|
/* @__PURE__ */ e(_t, { size: 32 }),
|
|
488
|
-
/* @__PURE__ */ C(
|
|
488
|
+
/* @__PURE__ */ C(b, { children: [
|
|
489
489
|
/* @__PURE__ */ e(X, { fontWeight: 600, variant: "body1", children: t.zero_state_content_header }),
|
|
490
490
|
/* @__PURE__ */ e(X, { color: "text.secondary", variant: "subtitle2", children: t.zero_state_content_description })
|
|
491
491
|
] })
|
|
492
492
|
] });
|
|
493
493
|
}), co = v(({ onCtaClick: t }) => {
|
|
494
|
-
const { visibleAccounts: o } = le(), { onEvent: n } = k(), { monthlyCategoryTotals: s, loadMonthlyCategoryTotals: a, monthlyTotalsLoaded:
|
|
494
|
+
const { visibleAccounts: o } = le(), { onEvent: n } = k(), { monthlyCategoryTotals: s, loadMonthlyCategoryTotals: a, monthlyTotalsLoaded: d } = K(), h = {
|
|
495
495
|
start: ft(/* @__PURE__ */ new Date(), 1),
|
|
496
496
|
end: /* @__PURE__ */ new Date()
|
|
497
497
|
}, { trends: l } = R(), { selectedAccounts: c, setSelectedAccounts: g, isInitialized: f } = ee();
|
|
498
498
|
i.useEffect(() => {
|
|
499
499
|
g(o);
|
|
500
500
|
}, [o]), i.useEffect(() => {
|
|
501
|
-
f && a(c,
|
|
502
|
-
n(
|
|
501
|
+
f && a(c, h.start).then(() => {
|
|
502
|
+
n(y.TRENDS_LOAD_WIDGET, {
|
|
503
503
|
state: o?.length ? "default" : "zeroState"
|
|
504
504
|
});
|
|
505
505
|
});
|
|
506
506
|
}, [f, c]);
|
|
507
|
-
const { spendingData:
|
|
507
|
+
const { spendingData: u, incomeData: T } = i.useMemo(
|
|
508
508
|
() => ({
|
|
509
|
-
spendingData: Me(s,
|
|
510
|
-
incomeData: Ae(s,
|
|
509
|
+
spendingData: Me(s, h),
|
|
510
|
+
incomeData: Ae(s, h)
|
|
511
511
|
}),
|
|
512
|
-
[s,
|
|
513
|
-
), [r, m] =
|
|
512
|
+
[s, h]
|
|
513
|
+
), [r, m] = u, [_, p] = T, D = we(m.y, r.y), w = we(p.y, _.y), I = f && !o?.length, N = () => {
|
|
514
514
|
n(
|
|
515
|
-
|
|
515
|
+
I ? y.TRENDS_CLICK_GET_STARTED : y.TRENDS_CLICK_VIEW_MORE
|
|
516
516
|
), t();
|
|
517
517
|
};
|
|
518
|
-
return !
|
|
518
|
+
return !d || !f ? /* @__PURE__ */ e(J, {}) : /* @__PURE__ */ e(
|
|
519
519
|
Dt,
|
|
520
520
|
{
|
|
521
521
|
className: "mx-trends-microwidget",
|
|
522
522
|
ctaLabel: l.micro_primary_cta_label,
|
|
523
523
|
onCTAClick: N,
|
|
524
|
-
subHeader:
|
|
524
|
+
subHeader: I ? void 0 : l.micro_subheader,
|
|
525
525
|
title: l.title,
|
|
526
|
-
children:
|
|
527
|
-
|
|
526
|
+
children: I ? /* @__PURE__ */ e(qt, {}) : /* @__PURE__ */ C(
|
|
527
|
+
b,
|
|
528
528
|
{
|
|
529
529
|
sx: {
|
|
530
530
|
alignItems: "stretch",
|
|
@@ -548,7 +548,7 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
548
548
|
{
|
|
549
549
|
percentage: w,
|
|
550
550
|
secondaryLabel: l.micro_secondary_label,
|
|
551
|
-
shouldDisplayPercentage: p.y !== 0 &&
|
|
551
|
+
shouldDisplayPercentage: p.y !== 0 && _.y !== 0,
|
|
552
552
|
title: l.income_label,
|
|
553
553
|
totalAmount: p.y,
|
|
554
554
|
transactionType: "income"
|
|
@@ -561,9 +561,9 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
561
561
|
);
|
|
562
562
|
}), Jt = v(
|
|
563
563
|
({ isExpanded: t, onClick: o }) => {
|
|
564
|
-
const n =
|
|
564
|
+
const n = Ve();
|
|
565
565
|
return /* @__PURE__ */ e(Lt, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(xt, { onClick: o, sx: { justifyContent: "center" }, children: /* @__PURE__ */ C(
|
|
566
|
-
|
|
566
|
+
b,
|
|
567
567
|
{
|
|
568
568
|
sx: { color: n.palette.primary.main, flexDirection: "row", alignItems: "center" },
|
|
569
569
|
children: [
|
|
@@ -588,11 +588,11 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
588
588
|
name: n,
|
|
589
589
|
transactions: s,
|
|
590
590
|
onClick: a,
|
|
591
|
-
isLastItem:
|
|
592
|
-
showDivider:
|
|
591
|
+
isLastItem: d = !1,
|
|
592
|
+
showDivider: h = !0
|
|
593
593
|
}) => {
|
|
594
594
|
const { trends: l } = R(), { onEvent: c } = k(), g = `${s.length} ${s.length === 1 ? l.transaction : l.transactions}`, f = () => {
|
|
595
|
-
a?.(), c(
|
|
595
|
+
a?.(), c(y.TRENDS_CLICK_LIST_ITEM, {
|
|
596
596
|
...A,
|
|
597
597
|
listItem: n
|
|
598
598
|
});
|
|
@@ -604,33 +604,33 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
604
604
|
leftIcon: o ? /* @__PURE__ */ e(fe, { categoryGuid: o }) : void 0,
|
|
605
605
|
onClick: f,
|
|
606
606
|
rightContent: Z(Math.abs(t), "0,0.00"),
|
|
607
|
-
rightIcon: a ? /* @__PURE__ */ e(
|
|
607
|
+
rightIcon: a ? /* @__PURE__ */ e(Je, {}) : void 0,
|
|
608
608
|
subtitle: g,
|
|
609
609
|
title: n
|
|
610
610
|
}
|
|
611
611
|
),
|
|
612
|
-
|
|
612
|
+
h && /* @__PURE__ */ e(At, { sx: { ml: d ? 24 : 68 } })
|
|
613
613
|
] }, o);
|
|
614
614
|
}
|
|
615
615
|
), en = v(
|
|
616
616
|
({ availableHeight: t = 0, onCategoryClick: o }) => {
|
|
617
|
-
const { collapsedCategories: n, visibleCategories: s, setVisibleListLength: a } = te(), { isLargeDesktop:
|
|
617
|
+
const { collapsedCategories: n, visibleCategories: s, setVisibleListLength: a } = te(), { isLargeDesktop: d, isDesktop: h } = $(), { trends: l } = R(), { onEvent: c } = k(), [g, f] = i.useState(!1), u = h || d;
|
|
618
618
|
i.useEffect(() => {
|
|
619
|
-
const m = Math.floor(t / 64) - 1,
|
|
620
|
-
m !== s.length && (a(
|
|
619
|
+
const m = Math.floor(t / 64) - 1, _ = s.length + n.length;
|
|
620
|
+
m !== s.length && (a(u ? Math.max(m, 5) : 5), f(m >= _));
|
|
621
621
|
}, [t]);
|
|
622
|
-
const
|
|
623
|
-
f(!g), c(
|
|
622
|
+
const T = () => {
|
|
623
|
+
f(!g), c(y.TRENDS_CLICK_VIEW_MORE, {
|
|
624
624
|
...A
|
|
625
625
|
});
|
|
626
626
|
}, r = s.length + (g ? n.length : 0);
|
|
627
|
-
return /* @__PURE__ */ e(
|
|
628
|
-
/* @__PURE__ */ e(
|
|
629
|
-
s.map((m,
|
|
627
|
+
return /* @__PURE__ */ e(b, { sx: { bgColor: "background.paper", width: "100%" }, children: /* @__PURE__ */ C(Et, { children: [
|
|
628
|
+
/* @__PURE__ */ e(b, { sx: { pb: 4, pt: 16, px: 16 }, children: /* @__PURE__ */ e(Le, { children: l.categories }) }),
|
|
629
|
+
s.map((m, _) => /* @__PURE__ */ e(
|
|
630
630
|
Ee,
|
|
631
631
|
{
|
|
632
632
|
...m,
|
|
633
|
-
isLastItem:
|
|
633
|
+
isLastItem: _ === r - 1,
|
|
634
634
|
onClick: m.transactions.length > 0 ? () => o(m) : void 0,
|
|
635
635
|
showDivider: !0
|
|
636
636
|
},
|
|
@@ -641,8 +641,8 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
641
641
|
{
|
|
642
642
|
in: g,
|
|
643
643
|
sx: { "&.MuiCollapse-root .MuiListItemButton-root": { paddingLeft: 24 } },
|
|
644
|
-
children: n.map((m,
|
|
645
|
-
const p = s.length +
|
|
644
|
+
children: n.map((m, _) => {
|
|
645
|
+
const p = s.length + _;
|
|
646
646
|
return /* @__PURE__ */ e(
|
|
647
647
|
Ee,
|
|
648
648
|
{
|
|
@@ -656,39 +656,40 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
656
656
|
})
|
|
657
657
|
}
|
|
658
658
|
),
|
|
659
|
-
n.length > 0 && /* @__PURE__ */ e(Jt, { isExpanded: g, onClick:
|
|
659
|
+
n.length > 0 && /* @__PURE__ */ e(Jt, { isExpanded: g, onClick: T })
|
|
660
660
|
] }) });
|
|
661
661
|
}
|
|
662
662
|
), tn = ({ beats: t, onInsightCardClick: o }) => {
|
|
663
|
-
const n = Rt(), { onEvent: s } = k(), {
|
|
664
|
-
o?.(
|
|
665
|
-
},
|
|
666
|
-
return /* @__PURE__ */ e(kt, { sx: { height:
|
|
663
|
+
const n = Rt(), { onEvent: s } = k(), { is_mobile_webview: a } = Re(), { isMobile: d, isDesktop: h, isLargeDesktop: l } = $(), { beatStore: c, endpoint: g, sessionToken: f } = Te(), u = n.palette.mode === "dark", T = h || l, r = T || d ? 1 : 2, m = () => null, _ = (I) => {
|
|
664
|
+
o?.(I), s(y.TRENDS_CLICK_INSIGHT, A);
|
|
665
|
+
}, p = T ? 200 : 170, D = T ? 170 : 124, w = t.length > 0 ? p : D;
|
|
666
|
+
return /* @__PURE__ */ e(kt, { sx: { height: w }, children: /* @__PURE__ */ e(
|
|
667
667
|
pt,
|
|
668
668
|
{
|
|
669
|
-
areBeatsLoading:
|
|
669
|
+
areBeatsLoading: c.isLoading,
|
|
670
670
|
beats: t,
|
|
671
|
-
endpoint:
|
|
672
|
-
|
|
673
|
-
|
|
671
|
+
endpoint: g,
|
|
672
|
+
heightOverrides: !T && a ? p : void 0,
|
|
673
|
+
logOutUser: m,
|
|
674
|
+
onCardClick: _,
|
|
674
675
|
showBorder: !0,
|
|
675
676
|
showCTAColocatedWithText: !1,
|
|
676
677
|
showCarouselControls: !0,
|
|
677
|
-
showHeader:
|
|
678
|
+
showHeader: T,
|
|
678
679
|
showIcon: !0,
|
|
679
680
|
showWithMargin: !1,
|
|
680
|
-
token:
|
|
681
|
-
useDarkMode:
|
|
681
|
+
token: f,
|
|
682
|
+
useDarkMode: u,
|
|
682
683
|
userHasFullInsightFeedBeats: !1,
|
|
683
684
|
variant: "outlined",
|
|
684
|
-
visibleCardsCount:
|
|
685
|
+
visibleCardsCount: r
|
|
685
686
|
}
|
|
686
687
|
) });
|
|
687
688
|
}, nn = v(tn), on = v(({ chartLabel: t, chartColor: o }) => {
|
|
688
689
|
const { onEvent: n } = k(), {
|
|
689
690
|
categoryDetailsChartData: { monthlyAmounts: s, tooltipLabels: a }
|
|
690
691
|
} = te();
|
|
691
|
-
return /* @__PURE__ */ e(
|
|
692
|
+
return /* @__PURE__ */ e(b, { sx: { pt: 12, width: "100%" }, children: /* @__PURE__ */ e(
|
|
692
693
|
ye,
|
|
693
694
|
{
|
|
694
695
|
baseline: "min",
|
|
@@ -702,7 +703,7 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
702
703
|
stroke: o
|
|
703
704
|
}),
|
|
704
705
|
onItemClick: () => {
|
|
705
|
-
n(
|
|
706
|
+
n(y.TRENDS_CLICK_CHART, A);
|
|
706
707
|
},
|
|
707
708
|
showArea: !0,
|
|
708
709
|
showAverage: !0,
|
|
@@ -718,14 +719,14 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
718
719
|
}
|
|
719
720
|
) });
|
|
720
721
|
}), sn = v(({ onClose: t }) => {
|
|
721
|
-
const o =
|
|
722
|
-
if (!
|
|
722
|
+
const o = Ve(), { onEvent: n } = k(), { common: s, trends: a } = R(), { selectedCategoryData: d, selectedDateRangeMonthRange: h } = te(), { sortedTransactions: l } = ce(), [c, g] = i.useState(null);
|
|
723
|
+
if (!d)
|
|
723
724
|
return null;
|
|
724
|
-
const { guid: f, name:
|
|
725
|
-
() => l.find((
|
|
725
|
+
const { guid: f, name: u, is_income: T, totalAmount: r } = d, m = T ? a.category_income : a.category_spending, _ = Ht(f, o), p = T ? a.income_label : a.spending_label, D = ` ${d.transactions.length === 1 ? a.transaction : a.transactions} (${d.transactions.length})`, w = i.useMemo(
|
|
726
|
+
() => l.find((E) => E.guid === c),
|
|
726
727
|
[c, l]
|
|
727
|
-
),
|
|
728
|
-
t?.(), n(
|
|
728
|
+
), I = (E) => E.category_guid === f || E.top_level_category_guid === f, N = () => {
|
|
729
|
+
t?.(), n(y.TRENDS_CLICK_BACK, A);
|
|
729
730
|
};
|
|
730
731
|
return /* @__PURE__ */ C(
|
|
731
732
|
Ce,
|
|
@@ -736,28 +737,28 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
736
737
|
shouldShowHeaderShadow: !0,
|
|
737
738
|
title: m,
|
|
738
739
|
children: [
|
|
739
|
-
/* @__PURE__ */ C(
|
|
740
|
+
/* @__PURE__ */ C(b, { sx: { alignItems: "center", height: "100%" }, children: [
|
|
740
741
|
/* @__PURE__ */ C(Nt, { sx: { borderRadius: 0, pb: 4, pt: 16, width: "100%" }, children: [
|
|
741
742
|
/* @__PURE__ */ e(
|
|
742
743
|
ve,
|
|
743
744
|
{
|
|
744
745
|
leftIcon: /* @__PURE__ */ e(fe, { categoryGuid: f }),
|
|
745
746
|
rightContent: Z(Math.abs(r), "0,0.00"),
|
|
746
|
-
subtitle:
|
|
747
|
-
title:
|
|
747
|
+
subtitle: h,
|
|
748
|
+
title: u
|
|
748
749
|
}
|
|
749
750
|
),
|
|
750
|
-
/* @__PURE__ */ e(on, { chartColor:
|
|
751
|
-
/* @__PURE__ */ C(
|
|
751
|
+
/* @__PURE__ */ e(on, { chartColor: _, chartLabel: p }),
|
|
752
|
+
/* @__PURE__ */ C(b, { alignItems: "center", direction: "row", justifyContent: "space-between", sx: { mx: 24 }, children: [
|
|
752
753
|
/* @__PURE__ */ e(Q, { bold: !0, variant: "body1", children: D }),
|
|
753
|
-
/* @__PURE__ */ e(Wt, { filter:
|
|
754
|
+
/* @__PURE__ */ e(Wt, { filter: I })
|
|
754
755
|
] })
|
|
755
756
|
] }),
|
|
756
757
|
/* @__PURE__ */ e(
|
|
757
|
-
|
|
758
|
+
We,
|
|
758
759
|
{
|
|
759
760
|
bgcolor: "transparent",
|
|
760
|
-
filter:
|
|
761
|
+
filter: I,
|
|
761
762
|
height: "calc(100vh - 475px)",
|
|
762
763
|
onClick: g
|
|
763
764
|
}
|
|
@@ -770,7 +771,7 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
770
771
|
isOpen: !!w,
|
|
771
772
|
onClose: () => g(""),
|
|
772
773
|
title: a.transaction,
|
|
773
|
-
children: w && /* @__PURE__ */ e(
|
|
774
|
+
children: w && /* @__PURE__ */ e(He, { transaction: w })
|
|
774
775
|
}
|
|
775
776
|
)
|
|
776
777
|
]
|
|
@@ -780,37 +781,37 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
780
781
|
const n = Ae(t, o), s = Me(t, o);
|
|
781
782
|
return [n, s].filter((a) => a.length > 0);
|
|
782
783
|
}, an = (t, o) => {
|
|
783
|
-
const [n, s] = t, a = n,
|
|
784
|
+
const [n, s] = t, a = n, d = s ?? n, h = [];
|
|
784
785
|
if (a) {
|
|
785
786
|
const l = a.reduce((c, g) => c + g.y, 0);
|
|
786
|
-
|
|
787
|
+
h.push({ label: o.income_label, amount: l });
|
|
787
788
|
}
|
|
788
|
-
if (
|
|
789
|
-
const l =
|
|
790
|
-
|
|
789
|
+
if (d) {
|
|
790
|
+
const l = d.reduce((c, g) => c + g.y, 0);
|
|
791
|
+
h.push({ label: o.spending_label, amount: l });
|
|
791
792
|
}
|
|
792
|
-
return
|
|
793
|
+
return h;
|
|
793
794
|
}, cn = ({
|
|
794
795
|
availableHeight: t = 0,
|
|
795
796
|
minHeight: o = 500,
|
|
796
797
|
selectedDateRange: n,
|
|
797
798
|
totals: s
|
|
798
799
|
}) => {
|
|
799
|
-
const a =
|
|
800
|
+
const a = Oe(), { onEvent: d } = k(), { trends: h } = R(), { isSmallMobile: l, isMobile: c, isSmallTablet: g, isTablet: f } = $(), u = [a.palette.chart?.chart1, a.palette.chart?.chart2], T = rn(s, n), r = an(T, h), [m, _] = i.useState(0), p = 458, D = 195, w = 56, I = c || l ? D : g || f ? p : m;
|
|
800
801
|
return i.useEffect(() => {
|
|
801
|
-
const
|
|
802
|
-
|
|
802
|
+
const E = Math.max(t - w, o);
|
|
803
|
+
_(E);
|
|
803
804
|
}, [t]), /* @__PURE__ */ e(
|
|
804
805
|
ye,
|
|
805
806
|
{
|
|
806
807
|
baseline: "min",
|
|
807
|
-
colors:
|
|
808
|
+
colors: u,
|
|
808
809
|
curveType: "bump",
|
|
809
|
-
datasets:
|
|
810
|
-
height:
|
|
810
|
+
datasets: T,
|
|
811
|
+
height: I,
|
|
811
812
|
labels: r,
|
|
812
813
|
onItemClick: () => {
|
|
813
|
-
|
|
814
|
+
d(y.TRENDS_CLICK_CHART, A);
|
|
814
815
|
},
|
|
815
816
|
showArea: !0,
|
|
816
817
|
showAxisHighlight: !0,
|
|
@@ -858,15 +859,15 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
858
859
|
"WeeklyNoSpendDays",
|
|
859
860
|
"WeeklySmallPurchasesSummary"
|
|
860
861
|
], hn = ({ onBackClick: t, onInsightCardClick: o, sx: n }) => {
|
|
861
|
-
const { onEvent: s } = k(), { config: a } =
|
|
862
|
+
const { onEvent: s } = k(), { config: a } = Re(), { isLargeDesktop: d, isDesktop: h, isMobile: l } = $(), { visibleAccounts: c } = le(), { loadDateRangeCategoryTotals: g, loadMonthlyCategoryTotals: f, monthlyCategoryTotals: u } = K(), { setFilter: T } = ce(), { selectedDateRange: r, setSelectedCategoryData: m, setSelectedDateRange: _ } = te(), {
|
|
862
863
|
isCopyLoaded: p,
|
|
863
864
|
isInitialized: D,
|
|
864
865
|
selectedAccounts: w,
|
|
865
|
-
selectedAccountGuids:
|
|
866
|
+
selectedAccountGuids: I,
|
|
866
867
|
setSelectedAccounts: N
|
|
867
|
-
} = ee(), { trends:
|
|
868
|
-
() => c && c.length === 0 ||
|
|
869
|
-
[c,
|
|
868
|
+
} = ee(), { trends: E, connect: O } = R(), { beatStore: M } = Te(), z = Ot() && a.show_insights_widget_in_master, F = h || d, [de, _e] = i.useState(!1), [j, ne] = i.useState(!1), [P, he] = i.useState("Chart"), [Y, oe] = i.useState(""), [ue, se] = i.useState(!1), [re, me] = i.useState(window.innerHeight), S = re - 208, H = re - (z ? 494 : 266), [G, ae] = i.useState(!1), Fe = a.show_connections_widget_in_master ? "buttons" : "no-buttons", be = i.useMemo(
|
|
869
|
+
() => c && c.length === 0 || u.length === 0,
|
|
870
|
+
[c, u]
|
|
870
871
|
);
|
|
871
872
|
i.useEffect(() => {
|
|
872
873
|
D && M.loadBeats().finally(() => ne(!0));
|
|
@@ -885,117 +886,117 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
885
886
|
r.end
|
|
886
887
|
);
|
|
887
888
|
}).finally(() => {
|
|
888
|
-
_e(!0), s(
|
|
889
|
+
_e(!0), s(y.TRENDS_LOAD_WIDGET, {
|
|
889
890
|
...A,
|
|
890
891
|
time_period: `${pe(r.end, r.start)}M`
|
|
891
892
|
});
|
|
892
893
|
});
|
|
893
894
|
}, [D, w, r]), i.useEffect(() => {
|
|
894
|
-
if (
|
|
895
|
+
if (u.length !== 0) {
|
|
895
896
|
const x = {
|
|
896
|
-
accounts:
|
|
897
|
+
accounts: I,
|
|
897
898
|
dateRange: { start: r.start, end: r.end }
|
|
898
899
|
};
|
|
899
|
-
|
|
900
|
+
T({
|
|
900
901
|
...x,
|
|
901
|
-
custom: (V) => !!
|
|
902
|
+
custom: (V) => !!u.find(
|
|
902
903
|
(U) => U.top_level_category_guid === V.top_level_category_guid || U.category_guid === V.category_guid
|
|
903
904
|
)
|
|
904
905
|
});
|
|
905
906
|
}
|
|
906
|
-
}, [
|
|
907
|
-
const
|
|
907
|
+
}, [u]);
|
|
908
|
+
const Pe = (x) => {
|
|
908
909
|
m(x), se(!0);
|
|
909
|
-
}, Pe = () => {
|
|
910
|
-
m(null), se(!1);
|
|
911
910
|
}, Ke = () => {
|
|
912
|
-
|
|
913
|
-
}, $e = (
|
|
914
|
-
|
|
911
|
+
m(null), se(!1);
|
|
912
|
+
}, $e = () => {
|
|
913
|
+
ae(!0), s(y.TRENDS_CLICK_CONNECT_ACCOUNTS);
|
|
914
|
+
}, je = (x, V) => {
|
|
915
|
+
he(V ?? P), s(y.TRENDS_CLICK_TOGGLE_VIEW, {
|
|
915
916
|
...A,
|
|
916
917
|
toggleView: V
|
|
917
918
|
});
|
|
918
|
-
},
|
|
919
|
-
const V = xe(x?.[0], 1), U = x?.[1],
|
|
920
|
-
|
|
919
|
+
}, Ye = (x) => {
|
|
920
|
+
const V = xe(x?.[0], 1), U = x?.[1], Qe = pe(U, V);
|
|
921
|
+
_({ start: V, end: U }), s(y.TRENDS_CLICK_TIME_WINDOW, {
|
|
921
922
|
...A,
|
|
922
|
-
time_period:
|
|
923
|
+
time_period: Qe + "M"
|
|
923
924
|
});
|
|
924
|
-
},
|
|
925
|
-
s(
|
|
925
|
+
}, Ue = (x) => {
|
|
926
|
+
s(y.TRENDS_CLICK_FILTER, {
|
|
926
927
|
...A,
|
|
927
928
|
filterValue: x
|
|
928
929
|
});
|
|
929
|
-
},
|
|
930
|
+
}, Xe = (x) => {
|
|
930
931
|
oe(x);
|
|
931
|
-
},
|
|
932
|
-
oe(""), s(
|
|
932
|
+
}, Ze = () => {
|
|
933
|
+
oe(""), s(y.TRENDS_CLICK_ALL_CATEGORIES, A);
|
|
933
934
|
};
|
|
934
935
|
return !p || !de ? /* @__PURE__ */ e(J, {}) : /* @__PURE__ */ C(
|
|
935
|
-
|
|
936
|
+
Ne,
|
|
936
937
|
{
|
|
937
938
|
accountOptions: c,
|
|
938
|
-
calendarActions: { onRangeChanged:
|
|
939
|
+
calendarActions: { onRangeChanged: Ye },
|
|
939
940
|
dateRange: r,
|
|
940
941
|
dateRangeVariant: l ? "timeframetabs" : "timeframebuttons",
|
|
941
|
-
onAccountsFilterClick:
|
|
942
|
+
onAccountsFilterClick: Ue,
|
|
942
943
|
onBackClick: t,
|
|
943
944
|
sx: n,
|
|
944
|
-
title:
|
|
945
|
+
title: E.title,
|
|
945
946
|
children: [
|
|
946
947
|
be && /* @__PURE__ */ e(
|
|
947
948
|
Vt,
|
|
948
949
|
{
|
|
949
|
-
header:
|
|
950
|
+
header: E.zero_state_content_header,
|
|
950
951
|
icon: "",
|
|
951
|
-
onClick:
|
|
952
|
-
primaryButton:
|
|
953
|
-
subText:
|
|
952
|
+
onClick: $e,
|
|
953
|
+
primaryButton: E.empty_state_primary,
|
|
954
|
+
subText: E.empty_state_sub_text,
|
|
954
955
|
sx: { height: S },
|
|
955
|
-
variant:
|
|
956
|
+
variant: Fe
|
|
956
957
|
}
|
|
957
958
|
),
|
|
958
959
|
!be && /* @__PURE__ */ C(
|
|
959
|
-
|
|
960
|
+
b,
|
|
960
961
|
{
|
|
961
962
|
sx: {
|
|
962
963
|
px: l ? 0 : 48
|
|
963
964
|
},
|
|
964
965
|
children: [
|
|
965
966
|
/* @__PURE__ */ C(
|
|
966
|
-
|
|
967
|
+
b,
|
|
967
968
|
{
|
|
968
969
|
flexDirection: "row",
|
|
969
970
|
justifyContent: "space-between",
|
|
970
971
|
sx: { pb: l ? 12 : 24, pt: l ? 24 : 48 },
|
|
971
972
|
children: [
|
|
972
973
|
/* @__PURE__ */ e(
|
|
973
|
-
|
|
974
|
+
Be,
|
|
974
975
|
{
|
|
975
976
|
selectedCategoryGuid: Y,
|
|
976
977
|
selectedDateRange: r
|
|
977
978
|
}
|
|
978
979
|
),
|
|
979
|
-
/* @__PURE__ */ e(
|
|
980
|
+
/* @__PURE__ */ e(Ge, { onTabChange: je, selectedTab: P })
|
|
980
981
|
]
|
|
981
982
|
}
|
|
982
983
|
),
|
|
983
|
-
/* @__PURE__ */ e(
|
|
984
|
+
/* @__PURE__ */ e(b, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(W, { flexGrow: 1, children: Y && /* @__PURE__ */ C(ge, { onClick: Ze, sx: { p: 0, pr: 5 }, children: [
|
|
984
985
|
/* @__PURE__ */ e(ie, { name: "arrow_back" }),
|
|
985
|
-
|
|
986
|
+
E.all_categories
|
|
986
987
|
] }) }) }),
|
|
987
|
-
/* @__PURE__ */ C(
|
|
988
|
-
P === "Chart" && /* @__PURE__ */ C(
|
|
988
|
+
/* @__PURE__ */ C(b, { flexDirection: F ? "row" : "column", gap: F ? 48 : 16, children: [
|
|
989
|
+
P === "Chart" && /* @__PURE__ */ C(qe, { children: [
|
|
989
990
|
/* @__PURE__ */ e(W, { sx: { width: F ? "68%" : "100%" }, children: /* @__PURE__ */ e(
|
|
990
991
|
ln,
|
|
991
992
|
{
|
|
992
993
|
availableHeight: S,
|
|
993
994
|
minHeight: 450,
|
|
994
995
|
selectedDateRange: r,
|
|
995
|
-
totals:
|
|
996
|
+
totals: u
|
|
996
997
|
}
|
|
997
998
|
) }),
|
|
998
|
-
/* @__PURE__ */ C(
|
|
999
|
+
/* @__PURE__ */ C(b, { gap: 16, sx: { width: F ? "32%" : "100%" }, children: [
|
|
999
1000
|
z && j && Se.length > 0 && /* @__PURE__ */ e(
|
|
1000
1001
|
nn,
|
|
1001
1002
|
{
|
|
@@ -1007,23 +1008,23 @@ const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
1007
1008
|
en,
|
|
1008
1009
|
{
|
|
1009
1010
|
availableHeight: H,
|
|
1010
|
-
onCategoryClick:
|
|
1011
|
+
onCategoryClick: Pe
|
|
1011
1012
|
}
|
|
1012
1013
|
)
|
|
1013
1014
|
] })
|
|
1014
1015
|
] }),
|
|
1015
1016
|
P === "Table" && /* @__PURE__ */ e(W, { sx: { width: "100%" }, children: /* @__PURE__ */ e(
|
|
1016
|
-
|
|
1017
|
+
ze,
|
|
1017
1018
|
{
|
|
1018
1019
|
height: "unset",
|
|
1019
|
-
monthlyCategoryTotals:
|
|
1020
|
-
onClickRow:
|
|
1020
|
+
monthlyCategoryTotals: u,
|
|
1021
|
+
onClickRow: Xe,
|
|
1021
1022
|
selectedCategory: Y,
|
|
1022
1023
|
selectedDateRange: r
|
|
1023
1024
|
}
|
|
1024
1025
|
) })
|
|
1025
1026
|
] }),
|
|
1026
|
-
ue && /* @__PURE__ */ e(sn, { onClose:
|
|
1027
|
+
ue && /* @__PURE__ */ e(sn, { onClose: Ke })
|
|
1027
1028
|
]
|
|
1028
1029
|
}
|
|
1029
1030
|
),
|