@mx-cartographer/experiences 7.2.15-alpha.sms4 → 7.3.0-alpha.sms1
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-vp_TAbGt.mjs → Account-Bxw0_4FU.mjs} +1 -1
- package/dist/{AccountDetailsContent-Vj4LO6cx.mjs → AccountDetailsContent-CAM9y39M.mjs} +6 -6
- package/dist/{AccountDetailsHeader-Df1JkzYi.mjs → AccountDetailsHeader-JtSX6Uf9.mjs} +4 -4
- package/dist/{AccountFields-DUToRRqW.mjs → AccountFields-C9FlatNb.mjs} +2 -2
- package/dist/{AccountListItem-CeY_WIpj.mjs → AccountListItem-JFMZROh7.mjs} +7 -7
- package/dist/{AccountStore-BkoLK9Tq.mjs → AccountStore-BgNOyMdp.mjs} +74 -100
- package/dist/Accounts-BRf_YeTf.mjs +27 -0
- package/dist/CategoryStore-yHI0hWmK.mjs +174 -0
- package/dist/CategoryUtil-pZRIYOgN.mjs +80 -0
- package/dist/{ConnectDrawer-Bw5s6Dw1.mjs → ConnectDrawer-BQNs-hjk.mjs} +9 -9
- package/dist/{ConnectionsDrawer-BDvVuJQf.mjs → ConnectionsDrawer-ByGQE7D5.mjs} +3 -3
- package/dist/{DebtsStore-BD_XwsI7.mjs → DebtsStore-C9bblOgW.mjs} +1 -1
- package/dist/{GoalStore-DZ_Jvsa_.mjs → GoalStore-D-aB35SY.mjs} +151 -111
- package/dist/{ManageIncome-B9yGuahc.mjs → ManageIncome-1s_q5W4X.mjs} +3 -3
- package/dist/{NetWorthStore-D1NiDUcc.mjs → NetWorthStore-DCsTZpuS.mjs} +2 -2
- package/dist/{NotificationStore-C6PH6MKm.mjs → NotificationStore-BxP_P2dA.mjs} +23 -15
- package/dist/{RecurringSettings-D9GFcsXV.mjs → RecurringSettings-A_rAGCTP.mjs} +3 -3
- package/dist/{RecurringTransactions-ej39mgA6.mjs → RecurringTransactions-DK8dWldr.mjs} +3 -3
- package/dist/{RecurringTransactionsStore-DrzS1LmF.mjs → RecurringTransactionsStore-C4YOD7_D.mjs} +29 -26
- package/dist/{TransactionDetails-BqCr2FTh.mjs → TransactionDetails-oP1eSuiS.mjs} +43 -43
- package/dist/TransactionStore-ai3uII_r.mjs +690 -0
- package/dist/{WidgetContainer-EbrN1oIo.mjs → WidgetContainer-BHWANqT4.mjs} +1 -1
- package/dist/accounts/index.es.js +29 -29
- package/dist/accounts/stores/AccountStore.d.ts +25 -22
- package/dist/accounts/utils/Accounts.d.ts +2 -1
- package/dist/budgets/index.es.js +4 -4
- package/dist/budgets/store/BudgetsStore.d.ts +1 -0
- package/dist/cashflow/index.es.js +6 -6
- package/dist/categories/index.es.js +1 -1
- package/dist/categories/stores/CategoryStore.d.ts +5 -1
- package/dist/categories/util/CategoryUtil.d.ts +3 -2
- package/dist/common/index.es.js +206 -219
- package/dist/common/stores/AppDataStore.d.ts +3 -1
- package/dist/common/stores/GlobalCopyStore.d.ts +0 -1
- package/dist/common/stores/GlobalStore.d.ts +3 -6
- package/dist/common/stores/UserStore.d.ts +3 -2
- package/dist/common/types/Account.d.ts +9 -6
- package/dist/dashboard/index.es.js +1 -1
- package/dist/debts/index.es.js +5 -5
- package/dist/finstrong/index.es.js +4 -4
- package/dist/goals/index.es.js +7 -7
- package/dist/goals/stores/GoalStore.d.ts +17 -4
- package/dist/help/index.es.js +1 -1
- package/dist/investments/index.es.js +2 -2
- package/dist/investments/stores/HoldingStore.d.ts +1 -0
- package/dist/networth/index.es.js +4 -4
- package/dist/notifications/index.es.js +2 -2
- package/dist/notifications/stores/NotificationStore.d.ts +3 -1
- package/dist/recurringtransactions/index.es.js +8 -8
- package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +3 -2
- package/dist/settings/index.es.js +1 -1
- package/dist/spending/index.es.js +3 -3
- package/dist/transactions/components/shared/transactiondetails/actions/DateAction.d.ts +2 -2
- package/dist/transactions/index.es.js +6 -6
- package/dist/transactions/stores/TransactionStore.d.ts +21 -77
- package/dist/trends/index.es.js +4 -4
- package/dist/{useAccountDisplayName-jS05A6-6.mjs → useAccountDisplayName-BUAApBIb.mjs} +1 -1
- package/package.json +4 -4
- package/dist/Accounts-C1QxUB-e.mjs +0 -9
- package/dist/CategoryStore-BCcpI3oJ.mjs +0 -183
- package/dist/CategoryUtil-BR3H5i6n.mjs +0 -78
- package/dist/TransactionStore-RGu9PZK8.mjs +0 -677
package/dist/trends/index.es.js
CHANGED
|
@@ -20,9 +20,9 @@ import { C as pt } from "../CurrencyText-kyC1aseI.mjs";
|
|
|
20
20
|
import { b as Ct } from "../Localization-2MODESHW.mjs";
|
|
21
21
|
import { H as Ie } from "../HeaderCell-DjuifqHJ.mjs";
|
|
22
22
|
import { T as M, b as ft } from "../ViewMoreMicroCard-SCn2wt4i.mjs";
|
|
23
|
-
import { A as _, W as ke } from "../WidgetContainer-
|
|
23
|
+
import { A as _, W as ke } from "../WidgetContainer-BHWANqT4.mjs";
|
|
24
24
|
import { c as Tt } from "../Category-CevNQ03n.mjs";
|
|
25
|
-
import { a as Ne, T as He } from "../TransactionDetails-
|
|
25
|
+
import { a as Ne, T as He } from "../TransactionDetails-oP1eSuiS.mjs";
|
|
26
26
|
import { D as Ce } from "../Drawer-kEE73B87.mjs";
|
|
27
27
|
import { L as Q } from "../Loader-DUaFpDGv.mjs";
|
|
28
28
|
import { useTheme as We } from "@mui/material/styles";
|
|
@@ -42,11 +42,11 @@ import Oe from "@mui/material/styles/useTheme";
|
|
|
42
42
|
import Nt from "@mui/material/Divider";
|
|
43
43
|
import { useTheme as Ht, Stack as Wt } from "@mui/material";
|
|
44
44
|
import Ot from "@mui/material/Paper";
|
|
45
|
-
import { b as Vt } from "../CategoryUtil-
|
|
45
|
+
import { b as Vt } from "../CategoryUtil-pZRIYOgN.mjs";
|
|
46
46
|
import { E as Gt } from "../ExportCsvAction-sX8Rg4Ov.mjs";
|
|
47
47
|
import { u as Bt } from "../useInsightsEnabled-DBpwEq10.mjs";
|
|
48
48
|
import { E as zt } from "../EmptyState-DA_lfRBv.mjs";
|
|
49
|
-
import { l as Pt } from "../ConnectDrawer-
|
|
49
|
+
import { l as Pt } from "../ConnectDrawer-BQNs-hjk.mjs";
|
|
50
50
|
const Ve = ({ selectedTab: t, onTabChange: o }) => /* @__PURE__ */ e(
|
|
51
51
|
dt,
|
|
52
52
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mx-cartographer/experiences",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.0-alpha.sms1",
|
|
4
4
|
"description": "Library containing experience widgets",
|
|
5
5
|
"author": "MX",
|
|
6
6
|
"license": "MIT",
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
"@mui/x-date-pickers-pro": "^7.29.4",
|
|
187
187
|
"@mxenabled/cssinjs": "^0.6.0",
|
|
188
188
|
"@mxenabled/mx-icons": "^1.5.1",
|
|
189
|
-
"@mxenabled/mxui": "^1.5.
|
|
189
|
+
"@mxenabled/mxui": "^1.5.8",
|
|
190
190
|
"@mxenabled/web-widget-sdk": "^0.0.13",
|
|
191
191
|
"@tanstack/react-virtual": "^3.13.2",
|
|
192
192
|
"bowser": "^2.11.0",
|
|
@@ -252,7 +252,7 @@
|
|
|
252
252
|
"storybook-dark-mode": "4.0.1",
|
|
253
253
|
"typescript": "^5.8.2",
|
|
254
254
|
"vi-canvas-mock": "^1.0.0",
|
|
255
|
-
"vite": "^5.4.
|
|
255
|
+
"vite": "^5.4.21",
|
|
256
256
|
"vite-plugin-dts": "^4.5.3",
|
|
257
257
|
"vite-tsconfig-paths": "^5.1.4",
|
|
258
258
|
"vitest": "^3.0.8"
|
|
@@ -272,5 +272,5 @@
|
|
|
272
272
|
"CHANGELOG.md",
|
|
273
273
|
"README.md"
|
|
274
274
|
],
|
|
275
|
-
"packageManager": "yarn@4.
|
|
275
|
+
"packageManager": "yarn@4.11.0"
|
|
276
276
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { A as _ } from "./ConnectDrawer-Bw5s6Dw1.mjs";
|
|
2
|
-
const s = (t) => t && (t.account_type === _.CREDIT_CARD || t.account_type === _.LOAN || t.account_type === _.MORTGAGE || t.account_type === _.LINE_OF_CREDIT || t.account_type === _.CHECKING_LINE_OF_CREDIT), p = (t) => t.is_manual || !t.guid, E = (t) => t.account_type === _.LINE_OF_CREDIT || t.account_type === _.CREDIT_CARD || t.account_type === _.CHECKING_LINE_OF_CREDIT, a = (t) => t.account_type === _.SAVINGS || t.account_type === _.CHECKING || t.account_type === _.LINE_OF_CREDIT || t.account_type === _.CREDIT_CARD || t.account_type === _.LOAN || t.account_type === _.MORTGAGE, y = (t) => t.account_type === _.LOAN || t.account_type === _.MORTGAGE;
|
|
3
|
-
export {
|
|
4
|
-
s as a,
|
|
5
|
-
E as b,
|
|
6
|
-
y as c,
|
|
7
|
-
p as i,
|
|
8
|
-
a as u
|
|
9
|
-
};
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
import { makeAutoObservable as u, runInAction as l } from "mobx";
|
|
2
|
-
import { getUnixTime as r } from "date-fns/getUnixTime";
|
|
3
|
-
import { subMonths as g } from "date-fns/subMonths";
|
|
4
|
-
import { startOfMonth as h } from "date-fns/startOfMonth";
|
|
5
|
-
import { endOfMonth as d } from "date-fns/endOfMonth";
|
|
6
|
-
import { a as T, g as m } from "./CategoryUtil-BR3H5i6n.mjs";
|
|
7
|
-
import { F as p, A as i } from "./Fetch-87LIQbEA.mjs";
|
|
8
|
-
import { b as f, c as w } from "./Category-CevNQ03n.mjs";
|
|
9
|
-
class y {
|
|
10
|
-
fetchInstance;
|
|
11
|
-
constructor(t, e, o) {
|
|
12
|
-
this.fetchInstance = new p(t, e, void 0, o);
|
|
13
|
-
}
|
|
14
|
-
addCategory = async (t) => this.fetchInstance.post(i.CATEGORIES, t).then((e) => e.category);
|
|
15
|
-
getCategories = async () => this.fetchInstance.get(i.CATEGORIES).then((t) => t.categories);
|
|
16
|
-
getDateRangeCategoryTotals = async (t, e, o) => o.length === 0 ? [] : this.fetchInstance.post(`${i.DATE_RANGE_CATEGORY_TOTALS}/from/${t}/to/${e}`, {
|
|
17
|
-
account_guid: o.map((a) => a.guid)
|
|
18
|
-
}).then((a) => a.date_range_category_totals);
|
|
19
|
-
getMonthlyCategoryTotals = async (t, e, o) => {
|
|
20
|
-
try {
|
|
21
|
-
const a = `${i.MONTHLY_CATEGORY_TOTALS}/from/${t}/to/${e}`;
|
|
22
|
-
if (o) {
|
|
23
|
-
const s = o.length === 0 ? [""] : o.map((C) => C.guid);
|
|
24
|
-
return (await this.fetchInstance.post(a, { account_guid: s })).monthly_category_totals;
|
|
25
|
-
} else
|
|
26
|
-
return (await this.fetchInstance.get(a)).monthly_category_totals;
|
|
27
|
-
} catch (a) {
|
|
28
|
-
throw console.error("Error fetching monthly category totals:", a), a;
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
removeCategory = async (t) => this.fetchInstance.delete(`${i.CATEGORIES}/${t}`);
|
|
32
|
-
updateCategory = async (t) => this.fetchInstance.put(`${i.CATEGORIES}/${t.guid}`, t).then((e) => e.category);
|
|
33
|
-
}
|
|
34
|
-
class S {
|
|
35
|
-
expandedGuid = null;
|
|
36
|
-
selectedGuid = null;
|
|
37
|
-
searchValue = "";
|
|
38
|
-
showSelected = !0;
|
|
39
|
-
shouldDisableDrawerScroll = !1;
|
|
40
|
-
unselectable = [];
|
|
41
|
-
unselectableText = "";
|
|
42
|
-
savedOnSelect;
|
|
43
|
-
// todo
|
|
44
|
-
constructor() {
|
|
45
|
-
u(this);
|
|
46
|
-
}
|
|
47
|
-
setExpandedGuid = (t) => this.expandedGuid = t;
|
|
48
|
-
setSelectedGuid = (t) => this.selectedGuid = t;
|
|
49
|
-
setSearchValue = (t) => this.searchValue = t;
|
|
50
|
-
setShouldDisableDrawerScroll = (t) => this.shouldDisableDrawerScroll = t;
|
|
51
|
-
setShowSelected = (t) => this.showSelected = t;
|
|
52
|
-
setUnselectable = (t) => this.unselectable = t;
|
|
53
|
-
setUnselectableText = (t) => this.unselectableText = t;
|
|
54
|
-
onSelect = (t) => this.savedOnSelect(t);
|
|
55
|
-
setOnSelect = (t) => this.savedOnSelect = t;
|
|
56
|
-
}
|
|
57
|
-
class G {
|
|
58
|
-
globalStore;
|
|
59
|
-
uiStore;
|
|
60
|
-
api = new y("/", "");
|
|
61
|
-
categories = [];
|
|
62
|
-
dateRangeCategoryTotals = [];
|
|
63
|
-
monthlyCategoryTotals = [];
|
|
64
|
-
dataRangeTotalsLoaded = !1;
|
|
65
|
-
isLoadingCategoryTotals = !1;
|
|
66
|
-
monthlyTotalsLoaded = !1;
|
|
67
|
-
constructor(t) {
|
|
68
|
-
this.globalStore = t, this.uiStore = new S(), this.api = new y(t.endpoint, t.sessionToken, t.onError), u(this);
|
|
69
|
-
}
|
|
70
|
-
get detailedCategories() {
|
|
71
|
-
return T(
|
|
72
|
-
this.categories,
|
|
73
|
-
this.dateRangeCategoryTotals,
|
|
74
|
-
this.monthlyCategoryTotals
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
get detailedCategoriesWithTransactions() {
|
|
78
|
-
return m(
|
|
79
|
-
this.detailedCategories,
|
|
80
|
-
this.globalStore.transactionStore.sortedTransactions
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
get incomeCategories() {
|
|
84
|
-
return this.detailedCategories.filter((t) => t.is_income);
|
|
85
|
-
}
|
|
86
|
-
get spendCategories() {
|
|
87
|
-
return this.detailedCategories.filter(
|
|
88
|
-
(t) => !t.is_income && !t.isTransfer && t.guid !== f.INVESTMENTS
|
|
89
|
-
);
|
|
90
|
-
}
|
|
91
|
-
get transferCategories() {
|
|
92
|
-
return this.detailedCategories.filter((t) => t.isTransfer);
|
|
93
|
-
}
|
|
94
|
-
addCategory = async (t, e) => {
|
|
95
|
-
const o = { name: t, parent_guid: e };
|
|
96
|
-
try {
|
|
97
|
-
await this.api.addCategory(o), await this.loadCategories();
|
|
98
|
-
} catch (a) {
|
|
99
|
-
console.error(`Error occurred while adding category: ${a}`);
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
loadCategories = async (t) => {
|
|
103
|
-
try {
|
|
104
|
-
const e = t || await this.api.getCategories(), { default_categories: o } = this.globalStore.copyStore.copy.categories;
|
|
105
|
-
l(() => {
|
|
106
|
-
this.categories = e.map((a) => ({
|
|
107
|
-
...a,
|
|
108
|
-
name: o[a.guid] ? o[a.guid].replace(/&/g, "&") : a.name
|
|
109
|
-
}));
|
|
110
|
-
});
|
|
111
|
-
} catch (e) {
|
|
112
|
-
console.error(`Error occurred while getting categories: ${e}`);
|
|
113
|
-
}
|
|
114
|
-
};
|
|
115
|
-
loadDateRangeCategoryTotals = async (t, e, o) => {
|
|
116
|
-
this.setIsLoadingCategoryTotals(!0);
|
|
117
|
-
try {
|
|
118
|
-
const a = await this.api.getDateRangeCategoryTotals(
|
|
119
|
-
r(e),
|
|
120
|
-
r(o),
|
|
121
|
-
t
|
|
122
|
-
);
|
|
123
|
-
l(() => {
|
|
124
|
-
this.dateRangeCategoryTotals = a, this.setIsLoadingCategoryTotals(!1), this.dataRangeTotalsLoaded = !0;
|
|
125
|
-
});
|
|
126
|
-
} catch (a) {
|
|
127
|
-
this.setIsLoadingCategoryTotals(!1), console.error(`Error occurred while getting date range category totals: ${a}`);
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
loadMonthlyCategoryTotals = async (t = this.globalStore.globalUiStore.selectedAccounts, e, o) => {
|
|
131
|
-
const a = r(h(e ?? g(/* @__PURE__ */ new Date(), 11))), s = r(d(o ?? /* @__PURE__ */ new Date()));
|
|
132
|
-
try {
|
|
133
|
-
const n = await this.api.getMonthlyCategoryTotals(a, s, t);
|
|
134
|
-
l(() => {
|
|
135
|
-
this.monthlyCategoryTotals = n, this.monthlyTotalsLoaded = !0;
|
|
136
|
-
});
|
|
137
|
-
} catch (n) {
|
|
138
|
-
console.error(`Error occurred while getting monthly category totals: ${n}`);
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
reloadCategoryTotals = async (t, e, o) => {
|
|
142
|
-
this.setIsLoadingCategoryTotals(!0);
|
|
143
|
-
try {
|
|
144
|
-
const a = await this.api.getDateRangeCategoryTotals(
|
|
145
|
-
r(e),
|
|
146
|
-
r(o),
|
|
147
|
-
t
|
|
148
|
-
), s = await this.api.getMonthlyCategoryTotals(
|
|
149
|
-
r(h(g(o, 11))),
|
|
150
|
-
r(d(o)),
|
|
151
|
-
t
|
|
152
|
-
);
|
|
153
|
-
l(() => {
|
|
154
|
-
this.dateRangeCategoryTotals = a, this.monthlyCategoryTotals = s, this.dataRangeTotalsLoaded = !0, this.monthlyTotalsLoaded = !0, this.setIsLoadingCategoryTotals(!1);
|
|
155
|
-
});
|
|
156
|
-
} catch (a) {
|
|
157
|
-
console.error(`Error occurred while getting category totals: ${a}`);
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
removeCategory = async (t) => {
|
|
161
|
-
try {
|
|
162
|
-
await this.api.removeCategory(t), await this.loadCategories();
|
|
163
|
-
} catch (e) {
|
|
164
|
-
console.error(`Error occurred while removing category: ${e}`);
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
setIsLoadingCategoryTotals = (t) => {
|
|
168
|
-
this.isLoadingCategoryTotals = t;
|
|
169
|
-
};
|
|
170
|
-
updateCategory = async (t) => {
|
|
171
|
-
try {
|
|
172
|
-
await this.api.updateCategory(t), await this.loadCategories();
|
|
173
|
-
} catch (e) {
|
|
174
|
-
console.error(`Error occurred while updating category: ${e}`);
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
// TODO: Remove this after refactoring Trends components to use detailedCategories
|
|
178
|
-
getCategoryName = (t) => this.categories.find((o) => o.guid === t)?.name ?? w[t];
|
|
179
|
-
}
|
|
180
|
-
export {
|
|
181
|
-
G as C,
|
|
182
|
-
y as a
|
|
183
|
-
};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { format as l } from "date-fns/format";
|
|
2
|
-
import { startOfMonth as h } from "date-fns/startOfMonth";
|
|
3
|
-
import { startOfToday as M } from "date-fns/startOfToday";
|
|
4
|
-
import { subMonths as T } from "date-fns/subMonths";
|
|
5
|
-
import { CategoryIconList as C } from "@mxenabled/mxui";
|
|
6
|
-
import { C as N, a as O, b } from "./Category-CevNQ03n.mjs";
|
|
7
|
-
import { f as D, D as E } from "./Dialog-CWW597AF.mjs";
|
|
8
|
-
const R = 3, d = 12, Y = (n, r, t) => n.filter((e) => !e.parent_guid).map(
|
|
9
|
-
(e) => _(
|
|
10
|
-
e,
|
|
11
|
-
r,
|
|
12
|
-
t,
|
|
13
|
-
n.filter((o) => o.parent_guid === e.guid)
|
|
14
|
-
)
|
|
15
|
-
), x = (n, r) => {
|
|
16
|
-
const t = C.find((e) => e.guid === n);
|
|
17
|
-
return t ? r.palette.categories[t.colorName] || "" : r.palette.categories.uncategorized || "";
|
|
18
|
-
}, _ = (n, r, t, e = []) => {
|
|
19
|
-
const o = n.guid, i = n.parent_guid || o, u = o === i, s = r.find((a) => a.category_guid === o)?.total || 0, c = f(
|
|
20
|
-
t.filter((a) => a.category_guid === o)
|
|
21
|
-
), g = f(
|
|
22
|
-
t.filter(
|
|
23
|
-
(a) => a.category_guid === o || a.top_level_category_guid === o
|
|
24
|
-
)
|
|
25
|
-
), m = e.map(
|
|
26
|
-
(a) => _(a, r, t)
|
|
27
|
-
), p = m.reduce(
|
|
28
|
-
(a, A) => a + A.currentAmount,
|
|
29
|
-
s
|
|
30
|
-
);
|
|
31
|
-
return {
|
|
32
|
-
...n,
|
|
33
|
-
currentAmount: s,
|
|
34
|
-
averageAmount: y(c),
|
|
35
|
-
color: N[i],
|
|
36
|
-
icon: O[i],
|
|
37
|
-
isTransfer: i === b.TRANSFER,
|
|
38
|
-
monthlyAmounts: c,
|
|
39
|
-
subCategories: m,
|
|
40
|
-
totalAmount: u ? p : 0,
|
|
41
|
-
totalAverageAmount: y(g),
|
|
42
|
-
totalMonthlyAmounts: u ? g : []
|
|
43
|
-
};
|
|
44
|
-
}, k = (n, r) => n.map((t) => {
|
|
45
|
-
const e = r.filter(
|
|
46
|
-
(o) => o.category_guid === t.guid || o.top_level_category_guid === t.guid
|
|
47
|
-
);
|
|
48
|
-
return {
|
|
49
|
-
...t,
|
|
50
|
-
transactions: e
|
|
51
|
-
};
|
|
52
|
-
}), y = (n, r = R) => {
|
|
53
|
-
const t = r > history.length ? history.length : r;
|
|
54
|
-
return Math.ceil(
|
|
55
|
-
Math.max(
|
|
56
|
-
0,
|
|
57
|
-
n.slice(-t).reduce((e, o) => e + o.amount, 0) / t
|
|
58
|
-
)
|
|
59
|
-
);
|
|
60
|
-
}, f = (n) => {
|
|
61
|
-
const r = [], t = M();
|
|
62
|
-
for (let e = 0; e <= d; e++) {
|
|
63
|
-
const o = h(T(t, d - e)), u = n.filter(
|
|
64
|
-
(s) => s.year_month === Number(l(o, "yyyyMM"))
|
|
65
|
-
).reduce((s, c) => s + c.total, 0);
|
|
66
|
-
r.push({
|
|
67
|
-
amount: u,
|
|
68
|
-
isoDate: l(o, "yyyy-MM-dd"),
|
|
69
|
-
label: D(o, E.MONTH_YEAR)
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
return r;
|
|
73
|
-
};
|
|
74
|
-
export {
|
|
75
|
-
Y as a,
|
|
76
|
-
x as b,
|
|
77
|
-
k as g
|
|
78
|
-
};
|