@mx-cartographer/experiences 7.0.23-alpha.al8 → 7.0.23
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/CHANGELOG.md +1 -1
- package/dist/{AccountStore-DRJfrlJa.mjs → AccountStore-BaMynkQT.mjs} +17 -17
- package/dist/{ExportCsvAction-CbMfQ2Wa.mjs → ExportCsvAction-CbdFfDV5.mjs} +1 -1
- package/dist/{TransactionStore-0tLtBEIC.mjs → TransactionStore-Cep_Eeql.mjs} +1 -1
- package/dist/accounts/index.es.js +1 -1
- package/dist/budgets/index.es.js +1 -1
- package/dist/common/index.es.js +3 -3
- package/dist/exportTransactionsToCSV-B5qAKd6C.mjs +47 -0
- package/dist/goals/index.es.js +494 -493
- package/dist/transactions/index.es.js +4 -4
- package/dist/trends/index.es.js +99 -96
- package/package.json +1 -1
- package/dist/exportTransactionsToCSV-BDlt8u0n.mjs +0 -47
|
@@ -3,10 +3,10 @@ import { u as B, C as Re, D as He, M as Be, c as Pe, T as $e, a as Ve } from "..
|
|
|
3
3
|
import { B as ya, d as ba, b as Ta } from "../TransactionDetails-C-z3HGTT.mjs";
|
|
4
4
|
import { T as M } from "../User-Dq9Qj764.mjs";
|
|
5
5
|
import { O as Sa } from "../User-Dq9Qj764.mjs";
|
|
6
|
-
import { S as ee, D as We } from "../TransactionStore-
|
|
7
|
-
import { T as wa } from "../TransactionStore-
|
|
8
|
-
import { e as Ge } from "../exportTransactionsToCSV-
|
|
9
|
-
import { E as va } from "../ExportCsvAction-
|
|
6
|
+
import { S as ee, D as We } from "../TransactionStore-Cep_Eeql.mjs";
|
|
7
|
+
import { T as wa } from "../TransactionStore-Cep_Eeql.mjs";
|
|
8
|
+
import { e as Ge } from "../exportTransactionsToCSV-B5qAKd6C.mjs";
|
|
9
|
+
import { E as va } from "../ExportCsvAction-CbdFfDV5.mjs";
|
|
10
10
|
import { jsxs as _, jsx as e } from "react/jsx-runtime";
|
|
11
11
|
import u from "react";
|
|
12
12
|
import { observer as S } from "mobx-react-lite";
|
package/dist/trends/index.es.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as e, jsxs as f, Fragment as Fe } from "react/jsx-runtime";
|
|
2
2
|
import i from "react";
|
|
3
3
|
import { observer as M } from "mobx-react-lite";
|
|
4
|
-
import { Icon as
|
|
4
|
+
import { Icon as se, Text as X, CategoryIcon as Te, P as Y, H3 as De, ChevronRightIcon as Pe } from "@mxenabled/mxui";
|
|
5
5
|
import O from "@mui/material/Box";
|
|
6
6
|
import _ from "@mui/material/Stack";
|
|
7
7
|
import pe from "@mui/material/Button";
|
|
@@ -12,7 +12,7 @@ import { T as eo } from "../TrendsStore-WrHxzdbQ.mjs";
|
|
|
12
12
|
import { i as Ue, c as Xe, d as Ze, e as Qe, f as qe, h as Je, b as Le, g as xe, j as _e } from "../SpendingData-D5vsfYKo.mjs";
|
|
13
13
|
import et from "@mui/material/ToggleButton";
|
|
14
14
|
import tt from "@mui/material/ToggleButtonGroup";
|
|
15
|
-
import { u as R, k as F, e as H, a as P, f as
|
|
15
|
+
import { u as R, k as F, e as H, a as P, f as re, c as ae, v as q, l as ve, p as nt, m as ot } from "../hooks-DkUqN6JE.mjs";
|
|
16
16
|
import { u as K } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
17
17
|
import { f as Z, D as B } from "../Dialog-CWW597AF.mjs";
|
|
18
18
|
import { DataGridPro as st } from "@mui/x-data-grid-pro";
|
|
@@ -43,7 +43,7 @@ import wt from "@mui/material/Divider";
|
|
|
43
43
|
import { useTheme as Dt, Stack as It } from "@mui/material";
|
|
44
44
|
import Et from "@mui/material/Paper";
|
|
45
45
|
import { b as Lt } from "../CategoryUtil-BR3H5i6n.mjs";
|
|
46
|
-
import { E as xt } from "../ExportCsvAction-
|
|
46
|
+
import { E as xt } from "../ExportCsvAction-CbdFfDV5.mjs";
|
|
47
47
|
import { E as vt } from "../EmptyState-C0lr9E5T.mjs";
|
|
48
48
|
const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
49
49
|
tt,
|
|
@@ -52,7 +52,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
52
52
|
onChange: o,
|
|
53
53
|
orientation: "horizontal",
|
|
54
54
|
value: n,
|
|
55
|
-
children: ["Chart", "Table"].map((t) => /* @__PURE__ */ e(et, { color: "primary", sx: { width: 56 }, value: t, children: t === "Chart" ? /* @__PURE__ */ e(
|
|
55
|
+
children: ["Chart", "Table"].map((t) => /* @__PURE__ */ e(et, { color: "primary", sx: { width: 56 }, value: t, children: t === "Chart" ? /* @__PURE__ */ e(se, { name: "table_chart_view" }) : /* @__PURE__ */ e(se, { name: "format_list_bulleted" }) }, t))
|
|
56
56
|
}
|
|
57
57
|
), Oe = ({ selectedDateRange: n, selectedCategoryGuid: o }) => {
|
|
58
58
|
const { trends: t } = R(), { isMobile: s, isDesktop: a } = K(), { getCategoryName: h } = F(), l = i.useMemo(() => {
|
|
@@ -200,7 +200,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
200
200
|
isOpen: t,
|
|
201
201
|
onClose: s
|
|
202
202
|
}) => {
|
|
203
|
-
const { onEvent: a } = H(), { selectedAccountGuids: h } = P(), { common: l } = R(), { setFilter: c, sortedTransactions: d } =
|
|
203
|
+
const { onEvent: a } = H(), { selectedAccountGuids: h } = P(), { common: l } = R(), { setFilter: c, sortedTransactions: d } = re(), [m, C] = i.useState(""), u = i.useMemo(
|
|
204
204
|
() => d.find((r) => r.guid === m),
|
|
205
205
|
[m, d]
|
|
206
206
|
);
|
|
@@ -229,9 +229,9 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
229
229
|
}
|
|
230
230
|
);
|
|
231
231
|
}, Wt = M(Nt), Ot = ({ onBackClick: n, sx: o }) => {
|
|
232
|
-
const { onEvent: t } = H(), { isDesktop: s, isTablet: a, isMobile: h } = K(), { visibleAccounts: l } =
|
|
232
|
+
const { onEvent: t } = H(), { isDesktop: s, isTablet: a, isMobile: h } = K(), { visibleAccounts: l } = ae(), { loadMonthlyCategoryTotals: c, monthlyCategoryTotals: d, getCategoryName: m } = F(), { sortedTransactions: C } = re(), { selectedDateRange: u, setSelectedDateRange: b } = q(), { isCopyLoaded: r, isInitialized: g, selectedAccounts: T, setSelectedAccounts: p } = P(), { trends: E } = R(), [w, I] = i.useState(!1), [k, D] = i.useState(!1), [N, x] = i.useState("Chart"), [L, $] = i.useState(""), [z, ie] = i.useState(window.innerHeight), ee = z - (h ? 315 : 345);
|
|
233
233
|
i.useEffect(() => {
|
|
234
|
-
const S = () =>
|
|
234
|
+
const S = () => ie(window.innerHeight);
|
|
235
235
|
return window.addEventListener("resize", S), () => window.removeEventListener("resize", S);
|
|
236
236
|
}, []), i.useEffect(() => {
|
|
237
237
|
p(l);
|
|
@@ -264,9 +264,9 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
264
264
|
b({ start: W, end: G }), t(y.TRENDS_CLICK_TIME_WINDOW, {
|
|
265
265
|
time_period: ge + "M"
|
|
266
266
|
});
|
|
267
|
-
},
|
|
267
|
+
}, ce = () => {
|
|
268
268
|
t(y.TRENDS_CLICK_FILTER);
|
|
269
|
-
},
|
|
269
|
+
}, le = (S) => {
|
|
270
270
|
$(S);
|
|
271
271
|
}, de = (S) => {
|
|
272
272
|
$(S), t(y.TRENDS_CLICK_LEGEND, { category: m(S) });
|
|
@@ -284,7 +284,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
284
284
|
calendarActions: { onRangeChanged: oe },
|
|
285
285
|
dateRange: u,
|
|
286
286
|
dateRangeVariant: "timeframebuttons",
|
|
287
|
-
onAccountsFilterClick:
|
|
287
|
+
onAccountsFilterClick: ce,
|
|
288
288
|
onBackClick: n,
|
|
289
289
|
sx: o,
|
|
290
290
|
title: E.title,
|
|
@@ -317,7 +317,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
317
317
|
),
|
|
318
318
|
/* @__PURE__ */ f(_, { alignItems: "center", flexDirection: "row", width: "100%", children: [
|
|
319
319
|
/* @__PURE__ */ e(O, { flexGrow: 1, children: L && /* @__PURE__ */ f(pe, { onClick: () => $(""), sx: { p: 0, pr: 5 }, children: [
|
|
320
|
-
/* @__PURE__ */ e(
|
|
320
|
+
/* @__PURE__ */ e(se, { name: "arrow_back" }),
|
|
321
321
|
E.all_categories
|
|
322
322
|
] }) }),
|
|
323
323
|
/* @__PURE__ */ e(pe, { onClick: () => D(!0), sx: { px: 5 }, children: `${E.view_transactions} (${C.length})` })
|
|
@@ -339,7 +339,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
339
339
|
Ve,
|
|
340
340
|
{
|
|
341
341
|
monthlyCategoryTotals: d,
|
|
342
|
-
onClickRow:
|
|
342
|
+
onClickRow: le,
|
|
343
343
|
selectedCategory: L,
|
|
344
344
|
selectedDateRange: u
|
|
345
345
|
}
|
|
@@ -379,7 +379,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
379
379
|
}
|
|
380
380
|
);
|
|
381
381
|
}, Gt = M(Vt), Bt = ({ onPrimaryCtaClick: n, sx: o }) => {
|
|
382
|
-
const { visibleAccounts: t } =
|
|
382
|
+
const { visibleAccounts: t } = ae(), { loadMonthlyCategoryTotals: s, monthlyTotalsLoaded: a } = F(), { isInitialized: h } = ve(), { trends: l } = R(), { isCopyLoaded: c, selectedAccounts: d, setSelectedAccounts: m } = P();
|
|
383
383
|
return i.useEffect(() => {
|
|
384
384
|
m(t);
|
|
385
385
|
}, [t]), i.useEffect(() => {
|
|
@@ -489,7 +489,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
489
489
|
] })
|
|
490
490
|
] });
|
|
491
491
|
}), Zn = M(({ onCtaClick: n }) => {
|
|
492
|
-
const { visibleAccounts: o } =
|
|
492
|
+
const { visibleAccounts: o } = ae(), { onEvent: t } = H(), { monthlyCategoryTotals: s, loadMonthlyCategoryTotals: a, monthlyTotalsLoaded: h } = F(), l = {
|
|
493
493
|
start: lt(/* @__PURE__ */ new Date(), 1),
|
|
494
494
|
end: /* @__PURE__ */ new Date()
|
|
495
495
|
}, { trends: c } = R(), { selectedAccounts: d, setSelectedAccounts: m, isInitialized: C } = P();
|
|
@@ -754,7 +754,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
754
754
|
}
|
|
755
755
|
) });
|
|
756
756
|
}), Xt = M(({ onClose: n }) => {
|
|
757
|
-
const o = Ne(), { onEvent: t } = H(), { common: s, trends: a } = R(), { selectedCategoryData: h, selectedDateRangeMonthRange: l } = q(), { sortedTransactions: c } =
|
|
757
|
+
const o = Ne(), { onEvent: t } = H(), { common: s, trends: a } = R(), { selectedCategoryData: h, selectedDateRangeMonthRange: l } = q(), { sortedTransactions: c } = re(), [d, m] = i.useState(null);
|
|
758
758
|
if (!h)
|
|
759
759
|
return null;
|
|
760
760
|
const { guid: C, name: u, is_income: b, totalAmount: r } = h, g = b ? a.category_income : a.category_spending, T = Lt(C, o), p = b ? a.income_label : a.spending_label, E = ` ${h.transactions.length === 1 ? a.transaction : a.transactions} (${h.transactions.length})`, w = i.useMemo(
|
|
@@ -860,16 +860,15 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
860
860
|
}
|
|
861
861
|
);
|
|
862
862
|
}, Jt = M(qt), en = ({ onBackClick: n, onInsightCardClick: o, sx: t }) => {
|
|
863
|
-
const { onEvent: s } = H(), { config: a } = ot(), { isLargeDesktop: h, isDesktop: l, isMobile: c } = K(), { visibleAccounts: d } =
|
|
863
|
+
const { onEvent: s } = H(), { config: a } = ot(), { isLargeDesktop: h, isDesktop: l, isMobile: c } = K(), { visibleAccounts: d } = ae(), { loadDateRangeCategoryTotals: m, loadMonthlyCategoryTotals: C, monthlyCategoryTotals: u } = F(), { setFilter: b } = re(), { selectedDateRange: r, setSelectedCategoryData: g, setSelectedDateRange: T } = q(), {
|
|
864
864
|
isCopyLoaded: p,
|
|
865
865
|
isInitialized: E,
|
|
866
866
|
selectedAccounts: w,
|
|
867
867
|
selectedAccountGuids: I,
|
|
868
868
|
setSelectedAccounts: k
|
|
869
|
-
} = P(), { trends: D } = R(), N = Ye(), x = l || h, [L, $] = i.useState(!1), [z,
|
|
869
|
+
} = P(), { trends: D } = R(), N = Ye(), x = l || h, [L, $] = i.useState(!1), [z, ie] = i.useState("Chart"), [J, ee] = i.useState(""), [te, ne] = i.useState(!1), [oe, ce] = i.useState(window.innerHeight), le = oe - 208, de = oe - (N ? 494 : 266);
|
|
870
870
|
i.useEffect(() => {
|
|
871
|
-
|
|
872
|
-
const v = () => le(window.innerHeight);
|
|
871
|
+
const v = () => ce(window.innerHeight);
|
|
873
872
|
return window.addEventListener("resize", v), () => window.removeEventListener("resize", v);
|
|
874
873
|
}, []), i.useEffect(() => {
|
|
875
874
|
k(d);
|
|
@@ -905,7 +904,7 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
905
904
|
}, ue = () => {
|
|
906
905
|
g(null), ne(!1);
|
|
907
906
|
}, me = (v, V) => {
|
|
908
|
-
|
|
907
|
+
ie(V ?? z), s(y.TRENDS_CLICK_TOGGLE_VIEW, {
|
|
909
908
|
...A,
|
|
910
909
|
toggleView: V
|
|
911
910
|
});
|
|
@@ -924,8 +923,10 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
924
923
|
ee(v);
|
|
925
924
|
}, ge = () => {
|
|
926
925
|
ee(""), s(y.TRENDS_CLICK_ALL_CATEGORIES, A);
|
|
927
|
-
}
|
|
928
|
-
|
|
926
|
+
};
|
|
927
|
+
if (!p || !L) return /* @__PURE__ */ e(Q, {});
|
|
928
|
+
const Ge = a.show_connections_widget_in_master ? "buttons" : "no-buttons", Be = L && d.length === 0;
|
|
929
|
+
return /* @__PURE__ */ f(
|
|
929
930
|
Ae,
|
|
930
931
|
{
|
|
931
932
|
accountOptions: d,
|
|
@@ -936,84 +937,86 @@ const We = ({ selectedTab: n, onTabChange: o }) => /* @__PURE__ */ e(
|
|
|
936
937
|
onBackClick: n,
|
|
937
938
|
sx: t,
|
|
938
939
|
title: D.title,
|
|
939
|
-
children:
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
940
|
+
children: [
|
|
941
|
+
/* @__PURE__ */ f(
|
|
942
|
+
_,
|
|
943
|
+
{
|
|
944
|
+
sx: {
|
|
945
|
+
px: c ? 0 : 48
|
|
946
|
+
},
|
|
947
|
+
children: [
|
|
948
|
+
/* @__PURE__ */ f(
|
|
949
|
+
_,
|
|
950
|
+
{
|
|
951
|
+
flexDirection: "row",
|
|
952
|
+
justifyContent: "space-between",
|
|
953
|
+
sx: { pb: c ? 12 : 24, pt: c ? 24 : 48 },
|
|
954
|
+
children: [
|
|
955
|
+
/* @__PURE__ */ e(
|
|
956
|
+
Oe,
|
|
957
|
+
{
|
|
958
|
+
selectedCategoryGuid: J,
|
|
959
|
+
selectedDateRange: r
|
|
960
|
+
}
|
|
961
|
+
),
|
|
962
|
+
/* @__PURE__ */ e(We, { onTabChange: me, selectedTab: z })
|
|
963
|
+
]
|
|
964
|
+
}
|
|
965
|
+
),
|
|
966
|
+
Be && /* @__PURE__ */ e(
|
|
967
|
+
vt,
|
|
968
|
+
{
|
|
969
|
+
header: "",
|
|
970
|
+
icon: "",
|
|
971
|
+
onClick: () => {
|
|
972
|
+
},
|
|
973
|
+
primaryButton: D.empty_state_primary,
|
|
974
|
+
subText: D.empty_state_sub_text,
|
|
975
|
+
variant: Ge
|
|
976
|
+
}
|
|
977
|
+
),
|
|
978
|
+
/* @__PURE__ */ e(_, { alignItems: "center", flexDirection: "row", width: "100%", children: /* @__PURE__ */ e(O, { flexGrow: 1, children: J && /* @__PURE__ */ f(pe, { onClick: ge, sx: { p: 0, pr: 5 }, children: [
|
|
979
|
+
/* @__PURE__ */ e(se, { name: "arrow_back" }),
|
|
980
|
+
D.all_categories
|
|
981
|
+
] }) }) }),
|
|
982
|
+
/* @__PURE__ */ f(_, { flexDirection: x ? "row" : "column", gap: x ? 48 : 16, children: [
|
|
983
|
+
z === "Chart" && /* @__PURE__ */ f(Fe, { children: [
|
|
984
|
+
/* @__PURE__ */ e(O, { sx: { width: x ? "68%" : "100%" }, children: /* @__PURE__ */ e(
|
|
985
|
+
Jt,
|
|
967
986
|
{
|
|
968
|
-
|
|
969
|
-
|
|
987
|
+
availableHeight: le,
|
|
988
|
+
minHeight: 450,
|
|
989
|
+
selectedDateRange: r,
|
|
990
|
+
totals: u
|
|
970
991
|
}
|
|
971
|
-
),
|
|
972
|
-
/* @__PURE__ */
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
992
|
+
) }),
|
|
993
|
+
/* @__PURE__ */ f(_, { gap: 16, sx: { width: x ? "32%" : "100%" }, children: [
|
|
994
|
+
N && /* @__PURE__ */ e(Yt, { onInsightCardClick: o }),
|
|
995
|
+
/* @__PURE__ */ e(
|
|
996
|
+
Kt,
|
|
997
|
+
{
|
|
998
|
+
availableHeight: de,
|
|
999
|
+
onCategoryClick: he
|
|
1000
|
+
}
|
|
1001
|
+
)
|
|
1002
|
+
] })
|
|
1003
|
+
] }),
|
|
1004
|
+
z === "Table" && /* @__PURE__ */ e(O, { sx: { width: "100%" }, children: /* @__PURE__ */ e(
|
|
1005
|
+
Ve,
|
|
984
1006
|
{
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
1007
|
+
height: "unset",
|
|
1008
|
+
monthlyCategoryTotals: u,
|
|
1009
|
+
onClickRow: G,
|
|
1010
|
+
selectedCategory: J,
|
|
1011
|
+
selectedDateRange: r
|
|
989
1012
|
}
|
|
990
|
-
) })
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
onCategoryClick: he
|
|
998
|
-
}
|
|
999
|
-
)
|
|
1000
|
-
] })
|
|
1001
|
-
] }),
|
|
1002
|
-
z === "Table" && /* @__PURE__ */ e(O, { sx: { width: "100%" }, children: /* @__PURE__ */ e(
|
|
1003
|
-
Ve,
|
|
1004
|
-
{
|
|
1005
|
-
height: "unset",
|
|
1006
|
-
monthlyCategoryTotals: u,
|
|
1007
|
-
onClickRow: G,
|
|
1008
|
-
selectedCategory: J,
|
|
1009
|
-
selectedDateRange: r
|
|
1010
|
-
}
|
|
1011
|
-
) })
|
|
1012
|
-
] }),
|
|
1013
|
-
te && /* @__PURE__ */ e(Xt, { onClose: ue })
|
|
1014
|
-
]
|
|
1015
|
-
}
|
|
1016
|
-
)
|
|
1013
|
+
) })
|
|
1014
|
+
] })
|
|
1015
|
+
]
|
|
1016
|
+
}
|
|
1017
|
+
),
|
|
1018
|
+
te && /* @__PURE__ */ e(Xt, { onClose: ue })
|
|
1019
|
+
]
|
|
1017
1020
|
}
|
|
1018
1021
|
);
|
|
1019
1022
|
}, Qn = M(en);
|
package/package.json
CHANGED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { fromUnixTime as c } from "date-fns/fromUnixTime";
|
|
2
|
-
import { c as u } from "./Category-CevNQ03n.mjs";
|
|
3
|
-
import { f as p, D as m } from "./Dialog-CWW597AF.mjs";
|
|
4
|
-
import { T as g } from "./User-Dq9Qj764.mjs";
|
|
5
|
-
function f(n) {
|
|
6
|
-
return new Set(
|
|
7
|
-
n.filter((e) => e.parent_guid !== void 0).map((e) => e.parent_guid)
|
|
8
|
-
);
|
|
9
|
-
}
|
|
10
|
-
function T(n) {
|
|
11
|
-
return n.reduce((e, t) => (t.parent_guid && (e[t.parent_guid] || (e[t.parent_guid] = []), e[t.parent_guid].push(t)), e), {});
|
|
12
|
-
}
|
|
13
|
-
function E(n, e) {
|
|
14
|
-
const t = f(e), i = T(e), o = /* @__PURE__ */ new Set(), a = [];
|
|
15
|
-
for (const r of n)
|
|
16
|
-
t.has(r.guid) ? (i[r.guid] ?? []).slice().sort((s, d) => Math.abs(d.amount) - Math.abs(s.amount)).forEach((s) => {
|
|
17
|
-
o.has(s.guid) || (a.push(s), o.add(s.guid));
|
|
18
|
-
}) : o.has(r.guid) || (a.push(r), o.add(r.guid));
|
|
19
|
-
return a;
|
|
20
|
-
}
|
|
21
|
-
const j = (n, e) => {
|
|
22
|
-
const t = h(l(n, e)), i = encodeURIComponent(t), o = document.createElement("a");
|
|
23
|
-
o.href = `data:attachment/csv;charset=utf-8,${i}`, o.download = "transactions.csv", document.body.appendChild(o), o.click(), document.body.removeChild(o);
|
|
24
|
-
}, l = (n, e) => n.map((t) => ({
|
|
25
|
-
Date: p(c(t.date), m.YEAR_MONTH_DAY),
|
|
26
|
-
Description: _(t),
|
|
27
|
-
"Original Description": t.feed_description,
|
|
28
|
-
Amount: `${t.amount}`,
|
|
29
|
-
Type: t.transaction_type === g.CREDIT ? "Credit" : "Debit",
|
|
30
|
-
"Parent Category": u[t.top_level_category_guid || ""],
|
|
31
|
-
Category: t.category,
|
|
32
|
-
Account: t.account,
|
|
33
|
-
Tags: C(t, e),
|
|
34
|
-
Memo: t.memo
|
|
35
|
-
})), h = (n) => {
|
|
36
|
-
const e = Object.keys(n[0]).join(",").concat(`\r
|
|
37
|
-
`), t = n.map((i) => Object.values(i).join(",")).join(`\r
|
|
38
|
-
`);
|
|
39
|
-
return e + t;
|
|
40
|
-
}, _ = (n) => {
|
|
41
|
-
let e = n.parent_guid ? "Split: " : "";
|
|
42
|
-
return e += n.is_hidden ? "(Excluded) " : "", e += n.description, e;
|
|
43
|
-
}, C = (n, e) => n.tags.map((t) => e.filter((o) => o.guid === t)[0]?.name ?? "").join(" ");
|
|
44
|
-
export {
|
|
45
|
-
j as e,
|
|
46
|
-
E as f
|
|
47
|
-
};
|