@mx-cartographer/experiences 7.0.52-alpha.mega7 → 7.0.52-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/CHANGELOG.md +0 -6
- package/dist/{EmptyState-Cu00ZWJL.mjs → EmptyState-C0lr9E5T.mjs} +5 -5
- package/dist/MiniWidgetContainer-CldJb_TI.mjs +55 -0
- package/dist/{ViewMoreMicroCard-BAz2NyEO.mjs → ViewMoreMicroCard-DfbJb5f9.mjs} +2 -2
- package/dist/accounts/index.es.js +1 -1
- package/dist/analytics/index.es.js +1 -1
- package/dist/budgets/components/bubblechart/Mercury.d.ts +2 -3
- package/dist/budgets/index.es.js +658 -742
- package/dist/budgets/utils/BubblesSVG.d.ts +8 -25
- package/dist/cashflow/index.es.js +1 -1
- package/dist/common/components/EmptyState.d.ts +1 -1
- package/dist/common/components/MiniWidgetContainer.d.ts +0 -1
- package/dist/common/index.es.js +2 -2
- package/dist/goals/index.es.js +1 -1
- package/dist/investments/index.es.js +1 -1
- package/dist/microinsights/index.es.js +1 -1
- package/dist/networth/index.es.js +1 -1
- package/dist/recurringtransactions/index.es.js +1 -1
- package/dist/spending/index.es.js +1 -1
- package/dist/trends/index.es.js +3 -3
- package/package.json +2 -2
- package/dist/MiniWidgetContainer-DTQdRK-3.mjs +0 -56
package/dist/budgets/index.es.js
CHANGED
|
@@ -1,289 +1,129 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as e, jsxs as d, Fragment as $e } from "react/jsx-runtime";
|
|
2
2
|
import l from "react";
|
|
3
3
|
import { observer as I } from "mobx-react-lite";
|
|
4
|
-
import { endOfMonth as
|
|
5
|
-
import { startOfMonth as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
4
|
+
import { endOfMonth as de } from "date-fns/endOfMonth";
|
|
5
|
+
import { startOfMonth as J } from "date-fns/startOfMonth";
|
|
6
|
+
import W from "@mui/material/Box";
|
|
7
|
+
import b from "@mui/material/Stack";
|
|
8
8
|
import Q from "@mui/material/styles/useTheme";
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
9
|
+
import { Icon as $, Text as p, CategoryIcon as H, H1 as Ge, H3 as Be } from "@mxenabled/mxui";
|
|
10
|
+
import { u as Pe } from "../BudgetUtil-2EncZLBQ.mjs";
|
|
11
|
+
import { C as Ne } from "../ConnectionsDrawer-BprLSCBH.mjs";
|
|
12
|
+
import * as E from "d3";
|
|
13
|
+
import je from "@mui/material/Tooltip";
|
|
14
|
+
import { i as w, m as j, u as D, g as X, b as ee, p as ze, j as te, h as ne, a as Ue, d as Se } from "../hooks-CE2TKk4a.mjs";
|
|
15
|
+
import { L as P } from "../Loader-DUaFpDGv.mjs";
|
|
16
|
+
import { E as ce } from "../EmptyState-C0lr9E5T.mjs";
|
|
17
|
+
import { u as me } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
18
|
+
import { A as k, W as Fe } from "../WidgetContainer-hsbxZmZB.mjs";
|
|
19
|
+
import K from "@mui/material/List";
|
|
12
20
|
import { f as T } from "../NumberFormatting-CtWHhyBX.mjs";
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import { b as
|
|
20
|
-
import { D as
|
|
21
|
-
import
|
|
21
|
+
import Ae from "@mui/material/Button";
|
|
22
|
+
import oe from "@mui/material/Divider";
|
|
23
|
+
import V from "@mui/material/ListItem";
|
|
24
|
+
import ae from "@mui/material/ListItemAvatar";
|
|
25
|
+
import Y from "@mui/material/ListItemButton";
|
|
26
|
+
import Z from "@mui/material/ListItemText";
|
|
27
|
+
import { b as L } from "../Localization-2MODESHW.mjs";
|
|
28
|
+
import { D as M } from "../Drawer-kEE73B87.mjs";
|
|
29
|
+
import We from "@mui/material/ListItemSecondaryAction";
|
|
22
30
|
import { C as He } from "../CurrencyInput-CRtdzs3o.mjs";
|
|
23
|
-
import { a as
|
|
24
|
-
import {
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import {
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
import { M as st } from "../ManageIncome-clecqBHm.mjs";
|
|
50
|
-
const it = I(() => {
|
|
51
|
-
const { budgets: t } = w(), { totalBudgeted: a } = D(), { incomeTotal: i } = ee(), s = i - a;
|
|
52
|
-
return /* @__PURE__ */ u(C, { direction: "row", justifyContent: "center", my: 16, spacing: 20, children: [
|
|
53
|
-
/* @__PURE__ */ u(C, { alignItems: "center", children: [
|
|
54
|
-
/* @__PURE__ */ e(y, { bold: !0, variant: "Body", children: T(i, "0,0") }),
|
|
55
|
-
/* @__PURE__ */ e(y, { color: "secondary", variant: "Small", children: t.projected_income })
|
|
56
|
-
] }),
|
|
57
|
-
/* @__PURE__ */ e(y, { bold: !0, justifyContent: "center", variant: "Body", children: "-" }),
|
|
58
|
-
/* @__PURE__ */ u(C, { alignItems: "center", children: [
|
|
59
|
-
/* @__PURE__ */ e(y, { bold: !0, variant: "Body", children: T(a, "0,0") }),
|
|
60
|
-
/* @__PURE__ */ e(y, { color: "secondary", variant: "Small", children: t.budgeted })
|
|
61
|
-
] }),
|
|
62
|
-
/* @__PURE__ */ e(y, { bold: !0, justifyContent: "center", variant: "Body", children: "=" }),
|
|
63
|
-
/* @__PURE__ */ u(C, { alignItems: "center", children: [
|
|
64
|
-
/* @__PURE__ */ e(y, { bold: !0, variant: "Body", children: T(s, "0,0") }),
|
|
65
|
-
/* @__PURE__ */ e(y, { color: "secondary", variant: "Small", children: t.remaining })
|
|
66
|
-
] })
|
|
67
|
-
] });
|
|
68
|
-
}), ct = I(
|
|
69
|
-
({ category: t }) => {
|
|
70
|
-
const { budgets: a } = w(), { budgets: i } = D(), s = l.useMemo(() => {
|
|
71
|
-
const n = i.find((c) => c.category_guid === t.guid), o = T(t.totalAverageAmount, "0,0"), r = n ? M(a.recalculate_previous_budget, T(n.amount, "0,0")) : a.recalculate_new_budget;
|
|
72
|
-
return `${o} - ${r}`;
|
|
73
|
-
}, [a, i]);
|
|
74
|
-
return /* @__PURE__ */ u(l.Fragment, { children: [
|
|
75
|
-
/* @__PURE__ */ e(K, { children: /* @__PURE__ */ u(V, { children: [
|
|
76
|
-
/* @__PURE__ */ e(re, { children: /* @__PURE__ */ e(H, { categoryGuid: t.guid, variant: "filled" }) }),
|
|
77
|
-
/* @__PURE__ */ e(Y, { primary: t.name, secondary: s })
|
|
78
|
-
] }) }),
|
|
79
|
-
/* @__PURE__ */ e(ae, {})
|
|
80
|
-
] }, t.guid);
|
|
81
|
-
}
|
|
82
|
-
), lt = ({ onRecalculateBudgets: t }) => {
|
|
83
|
-
const { budgets: a, common: i } = w(), { spendCategories: s } = j(), { recalculateBudgets: n, setAlert: o } = D(), [r, c] = l.useState(!1), m = s.filter((d) => d.totalAverageAmount > 0), g = async () => {
|
|
84
|
-
await n(m), c(!1), o(a.alert_recalculated_budgets), t?.();
|
|
31
|
+
import { a as N } from "../Dialog-CWW597AF.mjs";
|
|
32
|
+
import { M as Xe } from "../MiniWidgetContainer-CldJb_TI.mjs";
|
|
33
|
+
import { isAfter as Ke } from "date-fns/isAfter";
|
|
34
|
+
import { startOfToday as q } from "date-fns/startOfToday";
|
|
35
|
+
import Ve from "@mui/material/Alert";
|
|
36
|
+
import Ye from "@mui/material/Snackbar";
|
|
37
|
+
import be from "@mui/material/Tab";
|
|
38
|
+
import Ze from "@mui/material/Tabs";
|
|
39
|
+
import { e as qe } from "../exportTransactionsToCSV-D8TTNrrE.mjs";
|
|
40
|
+
import { T as xe, a as Je } from "../TransactionDetails-Cl8xcpbh.mjs";
|
|
41
|
+
import ge from "@mui/material/Card";
|
|
42
|
+
import pe from "@mui/material/CardContent";
|
|
43
|
+
import { S as ue } from "../StatusBar-BK_uYHAB.mjs";
|
|
44
|
+
import { S as ve } from "../SingleSegmentDonut-BgbLgwHi.mjs";
|
|
45
|
+
import { u as Qe, b as et } from "../CategorySelectorDrawer-BmenK5bu.mjs";
|
|
46
|
+
import Te from "@mui/material/CardHeader";
|
|
47
|
+
import { subDays as tt } from "date-fns/subDays";
|
|
48
|
+
import nt from "@mui/material/IconButton";
|
|
49
|
+
import { M as ot } from "../ManageIncome-clecqBHm.mjs";
|
|
50
|
+
const ye = 5, at = 100, rt = 25, st = (t) => {
|
|
51
|
+
const o = (a) => {
|
|
52
|
+
a.active || t.alphaTarget(0.3).restart(), a.subject.fx = a.subject.x, a.subject.fy = a.subject.y;
|
|
53
|
+
}, i = (a) => {
|
|
54
|
+
a.subject.fx = a.x, a.subject.fy = a.y;
|
|
55
|
+
}, s = (a) => {
|
|
56
|
+
a.active || t.alphaTarget(0), a.subject.fx = null, a.subject.fy = null;
|
|
85
57
|
};
|
|
86
|
-
return
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
onPrimaryAction: g,
|
|
96
|
-
title: a.recalculate_title,
|
|
97
|
-
children: /* @__PURE__ */ u(C, { children: [
|
|
98
|
-
/* @__PURE__ */ u(C, { mx: 24, my: 16, children: [
|
|
99
|
-
/* @__PURE__ */ e(y, { bold: !0, variant: "Body", children: a.recalculate_description_top }),
|
|
100
|
-
/* @__PURE__ */ e(y, { variant: "ParagraphSmall", children: a.recalculate_description_bottom })
|
|
101
|
-
] }),
|
|
102
|
-
/* @__PURE__ */ e(F, { bgcolor: "background.paper", children: /* @__PURE__ */ e(W, { children: m.map((d) => /* @__PURE__ */ e(ct, { category: d }, d.guid)) }) })
|
|
103
|
-
] })
|
|
104
|
-
}
|
|
105
|
-
)
|
|
106
|
-
] });
|
|
107
|
-
}, se = ({
|
|
108
|
-
amount: t,
|
|
109
|
-
categoryName: a,
|
|
110
|
-
onAmountChanged: i
|
|
111
|
-
}) => {
|
|
112
|
-
const { budgets: s } = w(), { totalBudgeted: n } = D(), { incomeTotal: o } = ee(), r = o - n;
|
|
113
|
-
return /* @__PURE__ */ u(C, { gap: 16, children: [
|
|
114
|
-
/* @__PURE__ */ u(C, { children: [
|
|
115
|
-
/* @__PURE__ */ e(y, { children: M(
|
|
116
|
-
s.add_description_top,
|
|
117
|
-
T(r, "0,0")
|
|
118
|
-
) }),
|
|
119
|
-
/* @__PURE__ */ e(y, { children: M(s.add_description_bottom, a) })
|
|
120
|
-
] }),
|
|
121
|
-
/* @__PURE__ */ e(
|
|
122
|
-
He,
|
|
123
|
-
{
|
|
124
|
-
amount: t,
|
|
125
|
-
autoFocus: !0,
|
|
126
|
-
label: s.add_label,
|
|
127
|
-
minAmount: 0,
|
|
128
|
-
setAmount: i,
|
|
129
|
-
sx: { ".MuiTypography-Body": { p: 0 } }
|
|
130
|
-
}
|
|
131
|
-
)
|
|
132
|
-
] });
|
|
133
|
-
}, dt = I(({ category: t, onAddBudget: a }) => {
|
|
134
|
-
const { budgets: i, common: s } = w(), [n, o] = l.useState(!1), [r, c] = l.useState(
|
|
135
|
-
`${t.totalAmount === 0 ? "" : t.totalAmount}`
|
|
136
|
-
);
|
|
137
|
-
return /* @__PURE__ */ u(l.Fragment, { children: [
|
|
138
|
-
/* @__PURE__ */ e(K, { children: /* @__PURE__ */ u(V, { onClick: () => o(!0), children: [
|
|
139
|
-
/* @__PURE__ */ e(re, { children: /* @__PURE__ */ e(H, { categoryGuid: t.guid }) }),
|
|
140
|
-
/* @__PURE__ */ e(
|
|
141
|
-
Y,
|
|
142
|
-
{
|
|
143
|
-
primary: t.name,
|
|
144
|
-
secondary: T(t.totalAmount, "0,0")
|
|
145
|
-
}
|
|
146
|
-
),
|
|
147
|
-
/* @__PURE__ */ e(Fe, { children: /* @__PURE__ */ e(N, { name: "add", size: 20 }) })
|
|
148
|
-
] }) }, t.guid),
|
|
149
|
-
/* @__PURE__ */ e(
|
|
150
|
-
$,
|
|
151
|
-
{
|
|
152
|
-
copy: { close_aria: s.close_aria, title: i.add_title },
|
|
153
|
-
disablePrimaryButton: Number(r) <= 0,
|
|
154
|
-
isOpen: n,
|
|
155
|
-
onClose: () => o(!1),
|
|
156
|
-
onPrimaryAction: () => a(t, Number(r)),
|
|
157
|
-
primaryText: i.add_save_button,
|
|
158
|
-
children: /* @__PURE__ */ e(se, { amount: r, categoryName: t.name, onAmountChanged: c })
|
|
159
|
-
}
|
|
160
|
-
)
|
|
161
|
-
] });
|
|
162
|
-
}), Ie = I(({ onRecalculateBudgets: t }) => {
|
|
163
|
-
const { budgets: a } = w(), { addBudget: i, setAlert: s, unbudgetedCategories: n } = D(), o = async (r, c) => {
|
|
164
|
-
await i(r, c), s(M(a.alert_budget_created, r.name));
|
|
165
|
-
};
|
|
166
|
-
return /* @__PURE__ */ u(C, { children: [
|
|
167
|
-
/* @__PURE__ */ e(it, {}),
|
|
168
|
-
/* @__PURE__ */ e(F, { bgcolor: "background.paper", children: /* @__PURE__ */ e(W, { children: n.map((r) => /* @__PURE__ */ e(
|
|
169
|
-
dt,
|
|
170
|
-
{
|
|
171
|
-
category: r,
|
|
172
|
-
onAddBudget: o
|
|
173
|
-
},
|
|
174
|
-
r.guid
|
|
175
|
-
)) }) }),
|
|
176
|
-
/* @__PURE__ */ e(lt, { onRecalculateBudgets: t })
|
|
177
|
-
] });
|
|
178
|
-
}), be = 5, Ee = 100, J = 25, ut = (t) => {
|
|
179
|
-
const a = (n) => {
|
|
180
|
-
n.active || t.alphaTarget(0.3).restart(), n.subject.fx = n.subject.x, n.subject.fy = n.subject.y;
|
|
181
|
-
}, i = (n) => {
|
|
182
|
-
n.subject.fx = n.x, n.subject.fy = n.y;
|
|
183
|
-
}, s = (n) => {
|
|
184
|
-
n.active || t.alphaTarget(0), n.subject.fx = null, n.subject.fy = null;
|
|
185
|
-
};
|
|
186
|
-
return O.drag().on("start", a).on("drag", i).on("end", s);
|
|
187
|
-
}, mt = (t) => {
|
|
188
|
-
let a = t.transaction_total / t.amount;
|
|
189
|
-
a < 0 ? a = 0 : a > 1 && (a = 1);
|
|
190
|
-
const i = a * 2 * Math.PI, s = O.interpolate(0, i), n = O.arc().cornerRadius(5).innerRadius(t.radius - be * 2).outerRadius(t.radius - be).startAngle(0).endAngle(0);
|
|
191
|
-
return (o) => (n.endAngle(s(o)), n(t) || "");
|
|
192
|
-
}, gt = (t) => {
|
|
193
|
-
O.selectAll(".bubble").call(ut(t));
|
|
194
|
-
}, Ce = (t, a, i) => Math.min(Math.max(t, a), i), pt = (t, a, i) => {
|
|
58
|
+
return E.drag().on("start", o).on("drag", i).on("end", s);
|
|
59
|
+
}, it = (t) => {
|
|
60
|
+
let o = t.transaction_total / t.amount;
|
|
61
|
+
o < 0 ? o = 0 : o > 1 && (o = 1);
|
|
62
|
+
const i = o * 2 * Math.PI, s = E.interpolate(0, i), a = E.arc().cornerRadius(5).innerRadius(t.radius - ye * 2).outerRadius(t.radius - ye).startAngle(0).endAngle(0);
|
|
63
|
+
return (n) => (a.endAngle(s(n)), a(t) || "");
|
|
64
|
+
}, ct = (t) => {
|
|
65
|
+
E.selectAll(".bubble").call(st(t));
|
|
66
|
+
}, lt = (t, o, i) => {
|
|
195
67
|
t.alpha(1).restart().force(
|
|
196
68
|
"x",
|
|
197
|
-
|
|
69
|
+
E.forceX().x(i / 2).strength(0.01)
|
|
198
70
|
).force(
|
|
199
71
|
"y",
|
|
200
|
-
|
|
201
|
-
)
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
const o = n.radius ?? J;
|
|
205
|
-
n.x = Ce(n.x ?? 0, o, i - o), n.y = Ce(n.y ?? 0, o, a - o);
|
|
206
|
-
}), O.selectAll(".bubble").data(s).attr("transform", (n) => `translate(${n.x},${n.y})`);
|
|
207
|
-
});
|
|
208
|
-
}, Oe = (t, a) => O.scaleLinear().domain([t, a]).range([J, Ee]), ht = (t) => {
|
|
209
|
-
const a = t.reduce((o, r) => {
|
|
72
|
+
E.forceY().y(o / 2).strength(0.01)
|
|
73
|
+
);
|
|
74
|
+
}, dt = (t, o) => E.scaleLinear().domain([t, o]).range([rt, at]), ut = (t) => {
|
|
75
|
+
const o = t.reduce((n, r) => {
|
|
210
76
|
const c = Math.max(r.transaction_total, r.amount);
|
|
211
|
-
return c >
|
|
212
|
-
}, 0), i = t.reduce((
|
|
77
|
+
return c > n ? c : n;
|
|
78
|
+
}, 0), i = t.reduce((n, r) => {
|
|
213
79
|
const c = Math.max(r.transaction_total, r.amount);
|
|
214
|
-
return c <
|
|
215
|
-
},
|
|
216
|
-
const r = s(Math.max(
|
|
80
|
+
return c < n ? c : n;
|
|
81
|
+
}, o), s = dt(i, o), a = t.map((n) => {
|
|
82
|
+
const r = s(Math.max(n.transaction_total, n.amount)) || 25;
|
|
217
83
|
return {
|
|
218
|
-
...
|
|
84
|
+
...n,
|
|
219
85
|
radius: r
|
|
220
86
|
};
|
|
221
87
|
});
|
|
222
|
-
return
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
}
|
|
232
|
-
const { maxRadius: o, minRadius: r } = ft(t, a, n);
|
|
233
|
-
return O.scaleLinear().domain([s, i]).range([r, o]);
|
|
234
|
-
}, yt = (t, a, i = !1, s, n) => {
|
|
235
|
-
const o = a.map((g) => Math.max(g.transaction_total, g.amount)), r = Math.min(...o), c = Math.max(...o), m = i ? _t(t.length, s, c, r, n) : Oe(r, c);
|
|
236
|
-
return t.map((g) => ({
|
|
237
|
-
...g,
|
|
238
|
-
radius: m(Math.max(g.transaction_total, g.amount))
|
|
239
|
-
}));
|
|
240
|
-
}, Se = 5, bt = 2e3, Ct = ({ bubble: t }) => {
|
|
241
|
-
const a = Q(), {
|
|
242
|
-
amount: i,
|
|
243
|
-
guid: s,
|
|
244
|
-
budgetColors: { mercury: n },
|
|
245
|
-
radius: o,
|
|
246
|
-
transaction_total: r
|
|
247
|
-
} = t, c = `mercury-${s}`;
|
|
88
|
+
return E.forceSimulation(a).velocityDecay(0.05).force("collide", E.forceCollide((n) => n.radius + 2).strength(0.5)).on("tick", () => {
|
|
89
|
+
E.selectAll(".bubble").data(a).attr("transform", (n) => `translate(${n.x},${n.y})`);
|
|
90
|
+
});
|
|
91
|
+
}, fe = 5, mt = 2e3;
|
|
92
|
+
function gt({ bubble: t }) {
|
|
93
|
+
const o = Q(), {
|
|
94
|
+
guid: i,
|
|
95
|
+
budgetColors: { mercury: s },
|
|
96
|
+
radius: a
|
|
97
|
+
} = t, n = `mercury-${i}`;
|
|
248
98
|
l.useEffect(() => {
|
|
249
|
-
|
|
250
|
-
}, [
|
|
251
|
-
const
|
|
252
|
-
return /* @__PURE__ */ e("g", { className:
|
|
99
|
+
E.select(`.${n}`).selectAll(".status").remove(), E.select(`.${n}`).append("path").transition().duration(mt).delay(0).attr("class", "status").attr("style", `fill: ${s}; fill-opacity: 1;`).attrTween("d", () => it(t));
|
|
100
|
+
}, [t]);
|
|
101
|
+
const r = E.arc().innerRadius((c) => c - 2 * fe).outerRadius((c) => c - fe).startAngle(0).endAngle(2 * Math.PI);
|
|
102
|
+
return /* @__PURE__ */ e("g", { className: n, children: /* @__PURE__ */ e(
|
|
253
103
|
"path",
|
|
254
104
|
{
|
|
255
|
-
d:
|
|
256
|
-
style: { fill:
|
|
105
|
+
d: r(a) || "",
|
|
106
|
+
style: { fill: o.palette.common.white, fillOpacity: 0.35 }
|
|
257
107
|
}
|
|
258
108
|
) });
|
|
259
|
-
}
|
|
260
|
-
|
|
109
|
+
}
|
|
110
|
+
const G = 75, le = 50;
|
|
111
|
+
function pt({ bubble: t, isDraggable: o, onClick: i = () => {
|
|
261
112
|
} }) {
|
|
262
|
-
const [s,
|
|
263
|
-
if (t)
|
|
264
|
-
return {
|
|
265
|
-
amount: t.amount,
|
|
266
|
-
budgetColors: t.budgetColors,
|
|
267
|
-
guid: t.guid,
|
|
268
|
-
radius: t.radius,
|
|
269
|
-
transaction_total: t.transaction_total
|
|
270
|
-
};
|
|
271
|
-
}, [t.amount, t.budgetColors, t.guid, t.radius, t.transaction_total]);
|
|
113
|
+
const [s, a] = l.useState(!1);
|
|
272
114
|
if (!t) return;
|
|
273
115
|
const {
|
|
274
|
-
budgetColors: { background:
|
|
275
|
-
category: { icon:
|
|
276
|
-
guid:
|
|
277
|
-
description:
|
|
278
|
-
radius:
|
|
279
|
-
x:
|
|
280
|
-
y:
|
|
281
|
-
} = t
|
|
282
|
-
let
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
p <= P && (v = o < 320 ? 16 : 24);
|
|
286
|
-
const B = `${t.category.name}: ${_}`, E = {
|
|
116
|
+
budgetColors: { background: n, text: r },
|
|
117
|
+
category: { icon: c, name: y },
|
|
118
|
+
guid: g,
|
|
119
|
+
description: h,
|
|
120
|
+
radius: m,
|
|
121
|
+
x: C,
|
|
122
|
+
y: _
|
|
123
|
+
} = t;
|
|
124
|
+
let u = -12, B = -12;
|
|
125
|
+
m > G ? (u = -14, B = -45) : m > le && (B = -32);
|
|
126
|
+
const f = `${t.category.name}: ${h}`, A = {
|
|
287
127
|
modifiers: [
|
|
288
128
|
{
|
|
289
129
|
name: "offset",
|
|
@@ -291,857 +131,933 @@ function Bt({ bubble: t, isDraggable: a, onClick: i = () => {
|
|
|
291
131
|
}
|
|
292
132
|
]
|
|
293
133
|
};
|
|
294
|
-
return /* @__PURE__ */
|
|
134
|
+
return /* @__PURE__ */ d(
|
|
295
135
|
"g",
|
|
296
136
|
{
|
|
297
137
|
className: "bubble",
|
|
298
|
-
id: `bubble-${
|
|
138
|
+
id: `bubble-${g}`,
|
|
299
139
|
onClick: () => i(t),
|
|
300
|
-
onMouseEnter: () =>
|
|
301
|
-
onMouseLeave: () =>
|
|
302
|
-
style: { cursor:
|
|
140
|
+
onMouseEnter: () => a(!0),
|
|
141
|
+
onMouseLeave: () => a(!1),
|
|
142
|
+
style: { cursor: o ? "pointer" : "default" },
|
|
303
143
|
textAnchor: "middle",
|
|
304
|
-
x:
|
|
305
|
-
y:
|
|
144
|
+
x: C,
|
|
145
|
+
y: _,
|
|
306
146
|
children: [
|
|
307
147
|
/* @__PURE__ */ e(
|
|
308
|
-
|
|
148
|
+
je,
|
|
309
149
|
{
|
|
310
150
|
followCursor: !0,
|
|
311
151
|
open: s,
|
|
312
|
-
slotProps: { popper:
|
|
313
|
-
title:
|
|
314
|
-
children: /* @__PURE__ */ e("circle", { fill:
|
|
152
|
+
slotProps: { popper: A },
|
|
153
|
+
title: f,
|
|
154
|
+
children: /* @__PURE__ */ e("circle", { fill: n, id: `circle-${g}`, r: m })
|
|
315
155
|
}
|
|
316
156
|
),
|
|
317
|
-
/* @__PURE__ */ e("svg", { x, y:
|
|
318
|
-
|
|
319
|
-
|
|
157
|
+
/* @__PURE__ */ e("svg", { x: u, y: B, children: /* @__PURE__ */ e($, { name: c, size: m <= G ? 24 : 32, sx: { fill: r } }) }),
|
|
158
|
+
m > G && /* @__PURE__ */ e(
|
|
159
|
+
p,
|
|
320
160
|
{
|
|
321
161
|
bold: !0,
|
|
322
162
|
component: "text",
|
|
323
|
-
id: `budget-category-${
|
|
324
|
-
sx: { fill:
|
|
163
|
+
id: `budget-category-${g}`,
|
|
164
|
+
sx: { fill: r },
|
|
325
165
|
variant: "Small",
|
|
326
166
|
y: 4,
|
|
327
|
-
children:
|
|
167
|
+
children: y
|
|
328
168
|
}
|
|
329
169
|
),
|
|
330
|
-
|
|
331
|
-
|
|
170
|
+
m > le && /* @__PURE__ */ e(
|
|
171
|
+
p,
|
|
332
172
|
{
|
|
333
173
|
bold: !0,
|
|
334
174
|
component: "text",
|
|
335
|
-
id: `budget-description-${
|
|
336
|
-
sx: { fill:
|
|
175
|
+
id: `budget-description-${g}-1`,
|
|
176
|
+
sx: { fill: r },
|
|
337
177
|
variant: "Body",
|
|
338
|
-
y:
|
|
339
|
-
children:
|
|
178
|
+
y: m <= G ? 12 : 24,
|
|
179
|
+
children: m <= G ? h.split(" ")[0] : h
|
|
340
180
|
}
|
|
341
181
|
),
|
|
342
|
-
|
|
343
|
-
|
|
182
|
+
m <= G && m > le && /* @__PURE__ */ e(
|
|
183
|
+
p,
|
|
344
184
|
{
|
|
345
185
|
component: "text",
|
|
346
|
-
id: `budget-description-${
|
|
347
|
-
sx: { fill:
|
|
186
|
+
id: `budget-description-${g}-2`,
|
|
187
|
+
sx: { fill: r },
|
|
348
188
|
variant: "XSmall",
|
|
349
189
|
y: 28,
|
|
350
|
-
children:
|
|
190
|
+
children: h.split(" ")[1]
|
|
351
191
|
}
|
|
352
192
|
),
|
|
353
|
-
/* @__PURE__ */ e(
|
|
193
|
+
/* @__PURE__ */ e(gt, { bubble: t })
|
|
354
194
|
]
|
|
355
195
|
},
|
|
356
|
-
|
|
196
|
+
g
|
|
357
197
|
);
|
|
358
198
|
}
|
|
359
|
-
|
|
199
|
+
let F;
|
|
200
|
+
const ht = ({
|
|
360
201
|
height: t,
|
|
361
|
-
width:
|
|
202
|
+
width: o,
|
|
362
203
|
isDraggable: i = !1,
|
|
363
204
|
onClick: s = () => {
|
|
364
205
|
}
|
|
365
206
|
}) => {
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
const h = b.get(S.guid);
|
|
372
|
-
h && Object.assign(S, {
|
|
373
|
-
vx: h.vx,
|
|
374
|
-
vy: h.vy,
|
|
375
|
-
x: h.x,
|
|
376
|
-
y: h.y
|
|
377
|
-
});
|
|
378
|
-
});
|
|
379
|
-
}
|
|
380
|
-
r.current = f, c.current = !1, o(_);
|
|
381
|
-
}, [m]);
|
|
382
|
-
return l.useEffect(() => {
|
|
383
|
-
g();
|
|
384
|
-
}, [g]), l.useEffect(() => () => {
|
|
385
|
-
r.current && (r.current.stop(), r.current = null);
|
|
386
|
-
}, []), l.useEffect(() => {
|
|
387
|
-
const d = r.current;
|
|
388
|
-
if (!d) return;
|
|
389
|
-
const f = d.nodes(), _ = a > 0 && a < 450 || t > 0 && t < 300, p = yt(f, m, _, t, a);
|
|
390
|
-
d.nodes(p), pt(d, t, a), o([...p]);
|
|
391
|
-
}, [t, a, m]), l.useLayoutEffect(() => {
|
|
392
|
-
const d = r.current;
|
|
393
|
-
d && (i && !c.current ? (gt(d), c.current = !0) : !i && c.current && (c.current = !1));
|
|
394
|
-
}, [i, n.length]), /* @__PURE__ */ e("svg", { height: t, style: { overflow: "visible" }, width: Math.abs(a), children: n.map((d) => /* @__PURE__ */ e(Bt, { bubble: d, isDraggable: i, onClick: s }, d.guid)) });
|
|
395
|
-
}, At = I(xt), vt = ({
|
|
207
|
+
const { detailedBudgets: a } = w();
|
|
208
|
+
return F = l.useMemo(() => ut(a), [a]), l.useEffect(() => {
|
|
209
|
+
lt(F, t, o), i && ct(F);
|
|
210
|
+
}, [F, t, o]), /* @__PURE__ */ e("svg", { height: t, style: { overflow: "visible" }, width: Math.abs(o), children: F.nodes().map((n) => /* @__PURE__ */ e(pt, { bubble: n, isDraggable: i, onClick: s }, n.guid)) });
|
|
211
|
+
}, _t = I(ht), bt = ({
|
|
396
212
|
isMiniWidget: t = !1,
|
|
397
|
-
onConnectAccountsClick:
|
|
213
|
+
onConnectAccountsClick: o,
|
|
398
214
|
createBudgetOnClick: i
|
|
399
215
|
}) => {
|
|
400
|
-
const {
|
|
401
|
-
|
|
402
|
-
const { data:
|
|
403
|
-
|
|
216
|
+
const { recalculateBudgets: s } = w(), { spendCategories: a } = j(), { budgets: n } = D(), [r, c] = l.useState(!1), [y, g] = l.useState(!1), [h, m] = l.useState(!1), C = l.useMemo(() => [...a.filter((u) => u.totalAverageAmount > 0)], [a]), _ = async () => {
|
|
217
|
+
m(!0);
|
|
218
|
+
const { data: u, isSuccess: B } = await s(C);
|
|
219
|
+
m(!1), B ? (u.length === 0 && c(!0), g(!1)) : g(!0);
|
|
404
220
|
};
|
|
405
|
-
return
|
|
406
|
-
|
|
221
|
+
return h ? /* @__PURE__ */ e(P, {}) : y ? /* @__PURE__ */ e(
|
|
222
|
+
ce,
|
|
407
223
|
{
|
|
408
|
-
header:
|
|
224
|
+
header: n.autogenerate_budgets_error_header,
|
|
409
225
|
icon: "error",
|
|
410
226
|
iconColor: "#4D4D4D",
|
|
411
|
-
onClick: (
|
|
412
|
-
|
|
227
|
+
onClick: (u) => {
|
|
228
|
+
u === "primary" ? _() : i();
|
|
413
229
|
},
|
|
414
|
-
primaryButton:
|
|
415
|
-
secondaryButton:
|
|
416
|
-
subText:
|
|
230
|
+
primaryButton: n.autogenerate_budgets_error_primary_button,
|
|
231
|
+
secondaryButton: n.zero_state_generate_budgets_secondary_button,
|
|
232
|
+
subText: n.autogenerate_budgets_error_subheader,
|
|
417
233
|
sx: {
|
|
418
234
|
width: { sm: 468 },
|
|
419
235
|
".buttons-footer": {
|
|
420
|
-
width: 208
|
|
421
|
-
|
|
422
|
-
},
|
|
423
|
-
...n && { mt: 0 }
|
|
236
|
+
width: 208
|
|
237
|
+
}
|
|
424
238
|
}
|
|
425
239
|
}
|
|
426
|
-
) : /* @__PURE__ */ e(
|
|
427
|
-
|
|
240
|
+
) : /* @__PURE__ */ e($e, { children: r ? /* @__PURE__ */ e(
|
|
241
|
+
ce,
|
|
428
242
|
{
|
|
429
|
-
header:
|
|
243
|
+
header: n.zero_state_generate_budgets_header,
|
|
430
244
|
icon: "error",
|
|
431
245
|
iconColor: "#4D4D4D",
|
|
432
|
-
onClick: (
|
|
433
|
-
|
|
246
|
+
onClick: (u) => {
|
|
247
|
+
u === "primary" ? o() : i();
|
|
434
248
|
},
|
|
435
|
-
primaryButton:
|
|
436
|
-
secondaryButton:
|
|
437
|
-
subText:
|
|
249
|
+
primaryButton: n.zero_state_generate_budgets_primary_button,
|
|
250
|
+
secondaryButton: n.zero_state_generate_budgets_secondary_button,
|
|
251
|
+
subText: n.zero_state_generate_budgets_subheader,
|
|
438
252
|
sx: {
|
|
439
253
|
width: t ? "100%" : { sm: 500 },
|
|
440
254
|
height: t ? "100%" : { sm: 468 },
|
|
441
|
-
mt:
|
|
255
|
+
mt: 50,
|
|
442
256
|
".buttons-footer": {
|
|
443
257
|
width: 208,
|
|
444
|
-
height: 100
|
|
445
|
-
...n && { mt: 16, button: { height: "max-content" } }
|
|
258
|
+
height: 100
|
|
446
259
|
},
|
|
447
260
|
padding: t ? 5 : 0
|
|
448
261
|
}
|
|
449
262
|
}
|
|
450
263
|
) : /* @__PURE__ */ e(
|
|
451
|
-
|
|
264
|
+
ce,
|
|
452
265
|
{
|
|
453
|
-
header:
|
|
266
|
+
header: n.create_budgets_title,
|
|
454
267
|
icon: "bubble_chart",
|
|
455
268
|
iconColor: "#1A1A1A",
|
|
456
|
-
onClick: (
|
|
457
|
-
|
|
269
|
+
onClick: (u) => {
|
|
270
|
+
u === "primary" ? _() : i();
|
|
458
271
|
},
|
|
459
|
-
primaryButton:
|
|
460
|
-
secondaryButton: t ? void 0 :
|
|
461
|
-
subText:
|
|
272
|
+
primaryButton: n.empty_state_primary_button,
|
|
273
|
+
secondaryButton: t ? void 0 : n.empty_state_secondary_button,
|
|
274
|
+
subText: n.empty_state_subheader,
|
|
462
275
|
sx: {
|
|
463
276
|
width: t ? "100%" : { sm: 432 },
|
|
464
277
|
height: t ? "100%" : { sm: 468 },
|
|
465
|
-
mt:
|
|
278
|
+
mt: 50,
|
|
466
279
|
".buttons-footer": {
|
|
467
280
|
width: 208,
|
|
468
|
-
height: 100
|
|
469
|
-
...n && { mt: 24, button: { height: "max-content" } }
|
|
281
|
+
height: 100
|
|
470
282
|
},
|
|
471
|
-
padding: t ? 4 : 0
|
|
472
|
-
...n && { svg: { height: 32, width: 32 } }
|
|
283
|
+
padding: t ? 4 : 0
|
|
473
284
|
}
|
|
474
285
|
}
|
|
475
286
|
) });
|
|
476
|
-
},
|
|
287
|
+
}, we = I(
|
|
477
288
|
({
|
|
478
289
|
createBudgetOnClick: t = () => {
|
|
479
290
|
},
|
|
480
|
-
height:
|
|
291
|
+
height: o,
|
|
481
292
|
isDraggable: i = !1,
|
|
482
293
|
isMiniWidget: s = !1,
|
|
483
|
-
shouldShowZeroState:
|
|
484
|
-
unavailableWidth:
|
|
294
|
+
shouldShowZeroState: a,
|
|
295
|
+
unavailableWidth: n = 24
|
|
485
296
|
}) => {
|
|
486
|
-
const { onEvent: r } = X(), { setSelectedBudget: c } =
|
|
487
|
-
c(
|
|
488
|
-
budget_category:
|
|
297
|
+
const { onEvent: r } = X(), { setSelectedBudget: c } = w(), { isLoadingCategoryTotals: y } = j(), { isInitialized: g } = ee(), { accounts: h } = D(), { availableWidth: m } = ze(), { isMobile: C } = me(), [_, u] = l.useState(!1), B = l.useMemo(() => m - n, [m]), f = (x) => {
|
|
298
|
+
c(x), r(k.BUDGETS_CLICK_BUDGET_CATEGORY, {
|
|
299
|
+
budget_category: x.category.name,
|
|
489
300
|
click_type: "bubble"
|
|
490
301
|
});
|
|
491
|
-
},
|
|
492
|
-
|
|
302
|
+
}, A = () => {
|
|
303
|
+
u(!0), r(k.ACCOUNTS_CLICK_CONNECT);
|
|
493
304
|
};
|
|
494
|
-
return
|
|
495
|
-
|
|
496
|
-
|
|
305
|
+
return y ? /* @__PURE__ */ e(b, { alignItems: "center", height: o, justifyContent: "center", width: Math.abs(B), children: /* @__PURE__ */ e(P, {}) }) : /* @__PURE__ */ d(W, { ml: a || C ? 0 : 24, sx: { alignSelf: "center" }, children: [
|
|
306
|
+
a || !g ? /* @__PURE__ */ e(
|
|
307
|
+
bt,
|
|
497
308
|
{
|
|
498
309
|
createBudgetOnClick: t,
|
|
499
310
|
isMiniWidget: s,
|
|
500
|
-
onConnectAccountsClick:
|
|
311
|
+
onConnectAccountsClick: A
|
|
501
312
|
}
|
|
502
313
|
) : /* @__PURE__ */ e(
|
|
503
|
-
|
|
314
|
+
_t,
|
|
504
315
|
{
|
|
505
|
-
height:
|
|
316
|
+
height: o,
|
|
506
317
|
isDraggable: i,
|
|
507
|
-
onClick:
|
|
508
|
-
width:
|
|
318
|
+
onClick: f,
|
|
319
|
+
width: B
|
|
509
320
|
}
|
|
510
321
|
),
|
|
511
322
|
/* @__PURE__ */ e(
|
|
512
|
-
|
|
323
|
+
Ne,
|
|
513
324
|
{
|
|
514
|
-
onClose: () =>
|
|
515
|
-
showConnectionsWidget:
|
|
516
|
-
title:
|
|
325
|
+
onClose: () => u(!1),
|
|
326
|
+
showConnectionsWidget: _,
|
|
327
|
+
title: h.manage_connections
|
|
517
328
|
}
|
|
518
329
|
)
|
|
519
330
|
] });
|
|
520
331
|
}
|
|
521
|
-
),
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
332
|
+
), yt = I(() => {
|
|
333
|
+
const { budgets: t } = D(), { totalBudgeted: o } = w(), { incomeTotal: i } = te(), s = i - o;
|
|
334
|
+
return /* @__PURE__ */ d(b, { direction: "row", justifyContent: "center", my: 16, spacing: 20, children: [
|
|
335
|
+
/* @__PURE__ */ d(b, { alignItems: "center", children: [
|
|
336
|
+
/* @__PURE__ */ e(p, { bold: !0, variant: "Body", children: T(i, "0,0") }),
|
|
337
|
+
/* @__PURE__ */ e(p, { color: "secondary", variant: "Small", children: t.projected_income })
|
|
338
|
+
] }),
|
|
339
|
+
/* @__PURE__ */ e(p, { bold: !0, justifyContent: "center", variant: "Body", children: "-" }),
|
|
340
|
+
/* @__PURE__ */ d(b, { alignItems: "center", children: [
|
|
341
|
+
/* @__PURE__ */ e(p, { bold: !0, variant: "Body", children: T(o, "0,0") }),
|
|
342
|
+
/* @__PURE__ */ e(p, { color: "secondary", variant: "Small", children: t.budgeted })
|
|
343
|
+
] }),
|
|
344
|
+
/* @__PURE__ */ e(p, { bold: !0, justifyContent: "center", variant: "Body", children: "=" }),
|
|
345
|
+
/* @__PURE__ */ d(b, { alignItems: "center", children: [
|
|
346
|
+
/* @__PURE__ */ e(p, { bold: !0, variant: "Body", children: T(s, "0,0") }),
|
|
347
|
+
/* @__PURE__ */ e(p, { color: "secondary", variant: "Small", children: t.remaining })
|
|
348
|
+
] })
|
|
349
|
+
] });
|
|
350
|
+
}), ft = I(
|
|
351
|
+
({ category: t }) => {
|
|
352
|
+
const { budgets: o } = D(), { budgets: i } = w(), s = l.useMemo(() => {
|
|
353
|
+
const a = i.find((c) => c.category_guid === t.guid), n = T(t.totalAverageAmount, "0,0"), r = a ? L(o.recalculate_previous_budget, T(a.amount, "0,0")) : o.recalculate_new_budget;
|
|
354
|
+
return `${n} - ${r}`;
|
|
355
|
+
}, [o, i]);
|
|
356
|
+
return /* @__PURE__ */ d(l.Fragment, { children: [
|
|
357
|
+
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ d(Y, { children: [
|
|
358
|
+
/* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(H, { categoryGuid: t.guid, variant: "filled" }) }),
|
|
359
|
+
/* @__PURE__ */ e(Z, { primary: t.name, secondary: s })
|
|
360
|
+
] }) }),
|
|
361
|
+
/* @__PURE__ */ e(oe, {})
|
|
362
|
+
] }, t.guid);
|
|
363
|
+
}
|
|
364
|
+
), Ct = ({ onRecalculateBudgets: t }) => {
|
|
365
|
+
const { budgets: o, common: i } = D(), { spendCategories: s } = j(), { recalculateBudgets: a, setAlert: n } = w(), [r, c] = l.useState(!1), y = s.filter((h) => h.totalAverageAmount > 0), g = async () => {
|
|
366
|
+
await a(y), c(!1), n(o.alert_recalculated_budgets), t?.();
|
|
367
|
+
};
|
|
368
|
+
return /* @__PURE__ */ d(l.Fragment, { children: [
|
|
369
|
+
/* @__PURE__ */ e(Ae, { onClick: () => c(!0), sx: { mt: 24, mx: 24 }, variant: "text", children: o.recalculate_button }),
|
|
370
|
+
/* @__PURE__ */ e(p, { sx: { mx: 24, my: 16, textAlign: "center", whiteSpace: "wrap" }, variant: "Paragraph", children: o.recalculate_help }),
|
|
371
|
+
/* @__PURE__ */ e(
|
|
372
|
+
M,
|
|
373
|
+
{
|
|
374
|
+
ariaLabelClose: i.close_aria,
|
|
375
|
+
isOpen: r,
|
|
376
|
+
onClose: () => c(!1),
|
|
377
|
+
onPrimaryAction: g,
|
|
378
|
+
title: o.recalculate_title,
|
|
379
|
+
children: /* @__PURE__ */ d(b, { children: [
|
|
380
|
+
/* @__PURE__ */ d(b, { mx: 24, my: 16, children: [
|
|
381
|
+
/* @__PURE__ */ e(p, { bold: !0, variant: "Body", children: o.recalculate_description_top }),
|
|
382
|
+
/* @__PURE__ */ e(p, { variant: "ParagraphSmall", children: o.recalculate_description_bottom })
|
|
383
|
+
] }),
|
|
384
|
+
/* @__PURE__ */ e(W, { bgcolor: "background.paper", children: /* @__PURE__ */ e(K, { children: y.map((h) => /* @__PURE__ */ e(ft, { category: h }, h.guid)) }) })
|
|
385
|
+
] })
|
|
386
|
+
}
|
|
387
|
+
)
|
|
388
|
+
] });
|
|
389
|
+
}, re = ({
|
|
390
|
+
amount: t,
|
|
391
|
+
categoryName: o,
|
|
392
|
+
onAmountChanged: i
|
|
526
393
|
}) => {
|
|
527
|
-
const {
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
394
|
+
const { budgets: s } = D(), { totalBudgeted: a } = w(), { incomeTotal: n } = te(), r = n - a;
|
|
395
|
+
return /* @__PURE__ */ d(b, { gap: 16, children: [
|
|
396
|
+
/* @__PURE__ */ d(b, { children: [
|
|
397
|
+
/* @__PURE__ */ e(p, { children: L(
|
|
398
|
+
s.add_description_top,
|
|
399
|
+
T(r, "0,0")
|
|
400
|
+
) }),
|
|
401
|
+
/* @__PURE__ */ e(p, { children: L(s.add_description_bottom, o) })
|
|
402
|
+
] }),
|
|
536
403
|
/* @__PURE__ */ e(
|
|
537
|
-
|
|
404
|
+
He,
|
|
538
405
|
{
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
406
|
+
amount: t,
|
|
407
|
+
autoFocus: !0,
|
|
408
|
+
label: s.add_label,
|
|
409
|
+
minAmount: 0,
|
|
410
|
+
setAmount: i,
|
|
411
|
+
sx: { ".MuiTypography-Body": { p: 0 } }
|
|
543
412
|
}
|
|
544
|
-
)
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
413
|
+
)
|
|
414
|
+
] });
|
|
415
|
+
}, Bt = I(({ category: t, onAddBudget: o }) => {
|
|
416
|
+
const { budgets: i, common: s } = D(), [a, n] = l.useState(!1), [r, c] = l.useState(
|
|
417
|
+
`${t.totalAmount === 0 ? "" : t.totalAmount}`
|
|
418
|
+
);
|
|
419
|
+
return /* @__PURE__ */ d(l.Fragment, { children: [
|
|
420
|
+
/* @__PURE__ */ e(V, { children: /* @__PURE__ */ d(Y, { onClick: () => n(!0), children: [
|
|
421
|
+
/* @__PURE__ */ e(ae, { children: /* @__PURE__ */ e(H, { categoryGuid: t.guid }) }),
|
|
422
|
+
/* @__PURE__ */ e(
|
|
423
|
+
Z,
|
|
424
|
+
{
|
|
425
|
+
primary: t.name,
|
|
426
|
+
secondary: T(t.totalAmount, "0,0")
|
|
427
|
+
}
|
|
428
|
+
),
|
|
429
|
+
/* @__PURE__ */ e(We, { children: /* @__PURE__ */ e($, { name: "add", size: 20 }) })
|
|
430
|
+
] }) }, t.guid),
|
|
431
|
+
/* @__PURE__ */ e(
|
|
432
|
+
N,
|
|
433
|
+
{
|
|
434
|
+
copy: { close_aria: s.close_aria, title: i.add_title },
|
|
435
|
+
disablePrimaryButton: Number(r) <= 0,
|
|
436
|
+
isOpen: a,
|
|
437
|
+
onClose: () => n(!1),
|
|
438
|
+
onPrimaryAction: () => o(t, Number(r)),
|
|
439
|
+
primaryText: i.add_save_button,
|
|
440
|
+
children: /* @__PURE__ */ e(re, { amount: r, categoryName: t.name, onAmountChanged: c })
|
|
441
|
+
}
|
|
442
|
+
)
|
|
549
443
|
] });
|
|
550
|
-
},
|
|
551
|
-
const
|
|
552
|
-
|
|
553
|
-
}
|
|
444
|
+
}), De = I(({ onRecalculateBudgets: t }) => {
|
|
445
|
+
const { budgets: o } = D(), { addBudget: i, setAlert: s, unbudgetedCategories: a } = w(), n = async (r, c) => {
|
|
446
|
+
await i(r, c), s(L(o.alert_budget_created, r.name));
|
|
447
|
+
};
|
|
448
|
+
return /* @__PURE__ */ d(b, { children: [
|
|
449
|
+
/* @__PURE__ */ e(yt, {}),
|
|
450
|
+
/* @__PURE__ */ e(W, { bgcolor: "background.paper", children: /* @__PURE__ */ e(K, { children: a.map((r) => /* @__PURE__ */ e(
|
|
451
|
+
Bt,
|
|
452
|
+
{
|
|
453
|
+
category: r,
|
|
454
|
+
onAddBudget: n
|
|
455
|
+
},
|
|
456
|
+
r.guid
|
|
457
|
+
)) }) }),
|
|
458
|
+
/* @__PURE__ */ e(Ct, { onRecalculateBudgets: t })
|
|
459
|
+
] });
|
|
460
|
+
}), St = (t) => {
|
|
461
|
+
const o = Q(), { onEvent: i } = X(), { detailedBudgets: s, isDataLoaded: a, loadBudgetData: n, setTheme: r } = w(), { budgets: c, common: y } = D(), { isCopyLoaded: g, isInitialized: h, selectedAccounts: m } = ee(), { reloadCategoryTotals: C } = j(), _ = Pe(), u = s.length === 0, [B, f] = l.useState(!1), A = () => {
|
|
462
|
+
f(!0), i(k.BUDGETS_CLICK_ADD);
|
|
463
|
+
}, x = () => {
|
|
464
|
+
f(!1);
|
|
465
|
+
};
|
|
554
466
|
return l.useEffect(() => {
|
|
555
|
-
r(
|
|
556
|
-
}, [
|
|
557
|
-
|
|
467
|
+
r(o);
|
|
468
|
+
}, [o]), l.useEffect(() => {
|
|
469
|
+
h && !a && C(m, J(/* @__PURE__ */ new Date()), de(/* @__PURE__ */ new Date())).then(
|
|
558
470
|
() => {
|
|
559
|
-
|
|
471
|
+
n().finally();
|
|
560
472
|
}
|
|
561
473
|
);
|
|
562
|
-
}, [
|
|
563
|
-
|
|
474
|
+
}, [h, m]), g ? /* @__PURE__ */ d(
|
|
475
|
+
Xe,
|
|
564
476
|
{
|
|
565
|
-
|
|
566
|
-
primaryCtaLabel: b ? c.get_started_cta : c.details_cta,
|
|
567
|
-
sx: { height: "100%" },
|
|
477
|
+
primaryCtaLabel: u ? c.get_started_cta : c.details_cta,
|
|
568
478
|
title: c.budgets_title,
|
|
569
479
|
...t,
|
|
570
480
|
children: [
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
481
|
+
a ? /* @__PURE__ */ d(b, { height: 450, mt: 32, children: [
|
|
482
|
+
/* @__PURE__ */ e(
|
|
483
|
+
we,
|
|
484
|
+
{
|
|
485
|
+
createBudgetOnClick: A,
|
|
486
|
+
height: 370,
|
|
487
|
+
isMiniWidget: !0,
|
|
488
|
+
shouldShowZeroState: u
|
|
489
|
+
}
|
|
490
|
+
),
|
|
491
|
+
!u && /* @__PURE__ */ d(W, { ml: 16, children: [
|
|
492
|
+
/* @__PURE__ */ e(p, { bold: !0, color: _ < 0 ? "error.main" : "success.main", children: T(Math.abs(_), "0,0") }),
|
|
493
|
+
/* @__PURE__ */ e(p, { children: _ < 0 ? c.overspent_in_budgets : c.left_in_budgets })
|
|
494
|
+
] })
|
|
495
|
+
] }) : /* @__PURE__ */ e(P, {}),
|
|
580
496
|
/* @__PURE__ */ e(
|
|
581
|
-
|
|
497
|
+
M,
|
|
582
498
|
{
|
|
583
|
-
ariaLabelClose:
|
|
584
|
-
isOpen:
|
|
585
|
-
onClose: () =>
|
|
499
|
+
ariaLabelClose: y.close_aria,
|
|
500
|
+
isOpen: B,
|
|
501
|
+
onClose: () => f(!1),
|
|
586
502
|
title: c.add_new_title,
|
|
587
|
-
children: /* @__PURE__ */ e(
|
|
503
|
+
children: /* @__PURE__ */ e(De, { onRecalculateBudgets: x })
|
|
588
504
|
}
|
|
589
505
|
)
|
|
590
506
|
]
|
|
591
507
|
}
|
|
592
|
-
) : /* @__PURE__ */ e(
|
|
593
|
-
},
|
|
508
|
+
) : /* @__PURE__ */ e(P, {});
|
|
509
|
+
}, wn = I(St), Ie = ({ budget: t }) => {
|
|
594
510
|
const {
|
|
595
|
-
amount:
|
|
511
|
+
amount: o,
|
|
596
512
|
budgetColors: { background: i },
|
|
597
513
|
category: { name: s },
|
|
598
|
-
category_guid:
|
|
599
|
-
percentage:
|
|
514
|
+
category_guid: a,
|
|
515
|
+
percentage: n,
|
|
600
516
|
transaction_total: r
|
|
601
517
|
} = t, c = [
|
|
602
518
|
{
|
|
603
519
|
color: i,
|
|
604
|
-
percentage: `${
|
|
520
|
+
percentage: `${n}%`
|
|
605
521
|
}
|
|
606
522
|
];
|
|
607
|
-
return /* @__PURE__ */ e(
|
|
608
|
-
/* @__PURE__ */ e(H, { categoryGuid:
|
|
609
|
-
/* @__PURE__ */ e(
|
|
610
|
-
/* @__PURE__ */ e(
|
|
611
|
-
/* @__PURE__ */ e(
|
|
523
|
+
return /* @__PURE__ */ e(ge, { sx: { mt: 24, mx: 24 }, children: /* @__PURE__ */ e(pe, { children: /* @__PURE__ */ d(b, { alignItems: "center", gap: 16, children: [
|
|
524
|
+
/* @__PURE__ */ e(H, { categoryGuid: a, size: 56 }),
|
|
525
|
+
/* @__PURE__ */ e(Ge, { children: `${T(r, "0,0")} / ${T(o, "0,0")}` }),
|
|
526
|
+
/* @__PURE__ */ e(p, { bold: !0, variant: "XSmall", children: s }),
|
|
527
|
+
/* @__PURE__ */ e(ue, { data: c, height: 10 })
|
|
612
528
|
] }) }) });
|
|
613
|
-
},
|
|
614
|
-
const { budgets: t } =
|
|
615
|
-
return /* @__PURE__ */
|
|
616
|
-
/* @__PURE__ */ e(
|
|
617
|
-
/* @__PURE__ */ e(
|
|
618
|
-
/* @__PURE__ */ e(
|
|
529
|
+
}, At = I(() => {
|
|
530
|
+
const { budgets: t } = D();
|
|
531
|
+
return /* @__PURE__ */ d(b, { alignItems: "center", gap: 12, height: "auto", mb: 24, mt: 24, children: [
|
|
532
|
+
/* @__PURE__ */ e($, { color: "secondary", name: "bubble_chart", sx: { fontSize: 32 } }),
|
|
533
|
+
/* @__PURE__ */ e(p, { bold: !0, color: "secondary", variant: "Small", children: t.zero_state_no_sub_budgets }),
|
|
534
|
+
/* @__PURE__ */ e(p, { color: "text.secondary", variant: "XSmall", children: t.zero_state_no_sub_budgets_description })
|
|
619
535
|
] });
|
|
620
|
-
}),
|
|
536
|
+
}), xt = I(({ budget: t }) => {
|
|
621
537
|
const {
|
|
622
|
-
amount:
|
|
538
|
+
amount: o,
|
|
623
539
|
budgetColors: { background: i },
|
|
624
540
|
category: s,
|
|
625
|
-
percentage:
|
|
626
|
-
transaction_total:
|
|
627
|
-
} = t, { setSelectedSubBudget: r } =
|
|
628
|
-
return /* @__PURE__ */ e(
|
|
629
|
-
/* @__PURE__ */ e(
|
|
541
|
+
percentage: a,
|
|
542
|
+
transaction_total: n
|
|
543
|
+
} = t, { setSelectedSubBudget: r } = w();
|
|
544
|
+
return /* @__PURE__ */ e(V, { children: /* @__PURE__ */ d(Y, { onClick: () => r(t), children: [
|
|
545
|
+
/* @__PURE__ */ e(ae, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(ve, { color: i, percent: a, size: 40, children: /* @__PURE__ */ e(H, { categoryGuid: s.parent_guid, variant: "basic" }) }) }),
|
|
630
546
|
/* @__PURE__ */ e(
|
|
631
|
-
|
|
547
|
+
Z,
|
|
632
548
|
{
|
|
633
|
-
primary: /* @__PURE__ */ e(
|
|
634
|
-
secondary: /* @__PURE__ */ e(
|
|
635
|
-
${T(
|
|
636
|
-
${T(
|
|
549
|
+
primary: /* @__PURE__ */ e(b, { component: "span", direction: "row", justifyContent: "space-between", children: /* @__PURE__ */ e(p, { bold: !0, variant: "Body", children: t.category.name }) }),
|
|
550
|
+
secondary: /* @__PURE__ */ e(b, { component: "span", direction: "row", justifyContent: "space-between", children: /* @__PURE__ */ e(p, { fontWeight: 400, variant: "Body", children: `
|
|
551
|
+
${T(n, "0,0")} /
|
|
552
|
+
${T(o, "0,0")}
|
|
637
553
|
` }) })
|
|
638
554
|
}
|
|
639
555
|
)
|
|
640
556
|
] }) });
|
|
641
|
-
}),
|
|
642
|
-
const { budgets: i, common: s } =
|
|
557
|
+
}), vt = I(({ category: t, parentBudget: o }) => {
|
|
558
|
+
const { budgets: i, common: s } = D(), { setExpandedGuid: a, setOnSelect: n } = Qe(), { addBudget: r } = w(), [c, y] = l.useState(!1), [g, h] = l.useState(!1), [m, C] = l.useState(""), [_, u] = l.useState(void 0);
|
|
643
559
|
l.useEffect(() => {
|
|
644
|
-
|
|
645
|
-
const
|
|
646
|
-
|
|
560
|
+
n((A) => {
|
|
561
|
+
const x = t.subCategories.find((v) => v.guid === A);
|
|
562
|
+
x && (u(x), C(`${x.currentAmount === 0 ? "" : x.currentAmount}`), h(!0));
|
|
647
563
|
});
|
|
648
564
|
}, []);
|
|
649
|
-
const
|
|
650
|
-
|
|
651
|
-
},
|
|
652
|
-
|
|
565
|
+
const B = () => {
|
|
566
|
+
a(t.guid), y(!0);
|
|
567
|
+
}, f = async () => {
|
|
568
|
+
_ && Number(m) > 0 && (await r(_, Number(m), o.guid), h(!1), y(!1), u(void 0));
|
|
653
569
|
};
|
|
654
|
-
return /* @__PURE__ */
|
|
655
|
-
/* @__PURE__ */ e(
|
|
656
|
-
/* @__PURE__ */
|
|
657
|
-
/* @__PURE__ */ e(
|
|
658
|
-
/* @__PURE__ */ e(
|
|
570
|
+
return /* @__PURE__ */ d(W, { children: [
|
|
571
|
+
/* @__PURE__ */ e(V, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(Y, { onClick: B, children: /* @__PURE__ */ e(Z, { children: /* @__PURE__ */ d(b, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
572
|
+
/* @__PURE__ */ d(b, { alignItems: "center", direction: "row", gap: 8, children: [
|
|
573
|
+
/* @__PURE__ */ e($, { fill: !0, name: "add_box", size: 24, sx: { color: "primary.light" } }),
|
|
574
|
+
/* @__PURE__ */ e(p, { bold: !0, sx: { color: "primary.light" }, variant: "Body", children: i.add_sub_budget_button })
|
|
659
575
|
] }),
|
|
660
|
-
/* @__PURE__ */ e(
|
|
576
|
+
/* @__PURE__ */ e($, { name: "chevron_right", size: 24, sx: { color: "primary.light" } })
|
|
661
577
|
] }) }) }) }),
|
|
662
|
-
/* @__PURE__ */ e(
|
|
578
|
+
/* @__PURE__ */ e(oe, {}),
|
|
663
579
|
/* @__PURE__ */ e(
|
|
664
|
-
|
|
580
|
+
M,
|
|
665
581
|
{
|
|
666
582
|
ariaLabelClose: s.close_aria,
|
|
667
583
|
isOpen: c,
|
|
668
|
-
onClose: () =>
|
|
584
|
+
onClose: () => y(!1),
|
|
669
585
|
title: i.add_sub_budget_title,
|
|
670
|
-
children: /* @__PURE__ */ e(
|
|
586
|
+
children: /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(et, { category: t, subCategories: t.subCategories }) })
|
|
671
587
|
}
|
|
672
588
|
),
|
|
673
589
|
/* @__PURE__ */ e(
|
|
674
|
-
|
|
590
|
+
N,
|
|
675
591
|
{
|
|
676
592
|
copy: { close_aria: s.close_aria, title: i.add_title },
|
|
677
|
-
disablePrimaryButton: Number(
|
|
593
|
+
disablePrimaryButton: Number(m) <= 0,
|
|
678
594
|
isOpen: g,
|
|
679
|
-
onClose: () =>
|
|
680
|
-
onPrimaryAction:
|
|
595
|
+
onClose: () => h(!1),
|
|
596
|
+
onPrimaryAction: f,
|
|
681
597
|
primaryText: i.add_save_button,
|
|
682
598
|
children: /* @__PURE__ */ e(
|
|
683
|
-
|
|
599
|
+
re,
|
|
684
600
|
{
|
|
685
|
-
amount:
|
|
686
|
-
categoryName:
|
|
687
|
-
onAmountChanged:
|
|
601
|
+
amount: m,
|
|
602
|
+
categoryName: _?.name || "",
|
|
603
|
+
onAmountChanged: C
|
|
688
604
|
}
|
|
689
605
|
)
|
|
690
606
|
}
|
|
691
607
|
)
|
|
692
608
|
] });
|
|
693
|
-
}),
|
|
694
|
-
const { category:
|
|
609
|
+
}), Tt = I(({ budget: t }) => {
|
|
610
|
+
const { category: o, subBudgets: i } = t, { budgets: s, common: a } = D(), { deleteBudget: n, selectedSubBudget: r, setSelectedSubBudget: c, updateBudget: y } = w(), { filter: g, setFilter: h } = ne(), [m, C] = l.useState(!1), [_, u] = l.useState(!1), [B, f] = l.useState("");
|
|
695
611
|
l.useEffect(() => {
|
|
696
|
-
r && (
|
|
612
|
+
r && (f(`${r.amount}`), h({
|
|
697
613
|
...g,
|
|
698
|
-
custom: (
|
|
614
|
+
custom: (S) => S.category_guid === r.category_guid
|
|
699
615
|
}));
|
|
700
616
|
}, [r]);
|
|
701
|
-
const
|
|
702
|
-
r && await
|
|
617
|
+
const A = async () => {
|
|
618
|
+
r && await y({
|
|
703
619
|
...r,
|
|
704
|
-
amount: Number(
|
|
620
|
+
amount: Number(B)
|
|
705
621
|
});
|
|
706
|
-
},
|
|
707
|
-
r && await
|
|
622
|
+
}, x = async () => {
|
|
623
|
+
r && await n(r.guid), u(!1), v();
|
|
708
624
|
}, v = () => {
|
|
709
|
-
|
|
625
|
+
h({
|
|
710
626
|
...g,
|
|
711
|
-
custom: (
|
|
627
|
+
custom: (S) => S.category_guid === t.category_guid || S.top_level_category_guid === t.category_guid
|
|
712
628
|
}), c(void 0);
|
|
713
629
|
};
|
|
714
|
-
return /* @__PURE__ */
|
|
715
|
-
/* @__PURE__ */
|
|
716
|
-
i.length === 0 ? /* @__PURE__ */ e(
|
|
717
|
-
/* @__PURE__ */ e(
|
|
718
|
-
/* @__PURE__ */ e(
|
|
719
|
-
] },
|
|
720
|
-
/* @__PURE__ */ e(
|
|
630
|
+
return /* @__PURE__ */ d(l.Fragment, { children: [
|
|
631
|
+
/* @__PURE__ */ d(K, { sx: { bgcolor: "background.paper" }, children: [
|
|
632
|
+
i.length === 0 ? /* @__PURE__ */ e(At, {}) : i.map((S) => /* @__PURE__ */ d(l.Fragment, { children: [
|
|
633
|
+
/* @__PURE__ */ e(xt, { budget: S }),
|
|
634
|
+
/* @__PURE__ */ e(oe, {})
|
|
635
|
+
] }, S.guid)),
|
|
636
|
+
/* @__PURE__ */ e(vt, { category: o, parentBudget: t })
|
|
721
637
|
] }),
|
|
722
638
|
/* @__PURE__ */ e(
|
|
723
|
-
|
|
639
|
+
M,
|
|
724
640
|
{
|
|
725
|
-
ariaLabelClose:
|
|
641
|
+
ariaLabelClose: a.close_aria,
|
|
726
642
|
isOpen: !!r,
|
|
727
643
|
onClose: v,
|
|
728
|
-
onPrimaryAction: () =>
|
|
729
|
-
onSecondaryAction: () =>
|
|
644
|
+
onPrimaryAction: () => C(!0),
|
|
645
|
+
onSecondaryAction: () => u(!0),
|
|
730
646
|
primaryText: s.details_edit_button,
|
|
731
647
|
secondaryText: s.details_delete_button,
|
|
732
648
|
title: s.details_title,
|
|
733
|
-
children: r && /* @__PURE__ */
|
|
734
|
-
/* @__PURE__ */ e(
|
|
735
|
-
/* @__PURE__ */ e(
|
|
649
|
+
children: r && /* @__PURE__ */ d(b, { gap: 24, children: [
|
|
650
|
+
/* @__PURE__ */ e(Ie, { budget: r }),
|
|
651
|
+
/* @__PURE__ */ e(xe, { height: "100%" })
|
|
736
652
|
] })
|
|
737
653
|
}
|
|
738
654
|
),
|
|
739
|
-
r && /* @__PURE__ */
|
|
655
|
+
r && /* @__PURE__ */ d(l.Fragment, { children: [
|
|
740
656
|
/* @__PURE__ */ e(
|
|
741
|
-
|
|
657
|
+
N,
|
|
742
658
|
{
|
|
743
|
-
copy: { close_aria:
|
|
744
|
-
disablePrimaryButton: Number(
|
|
745
|
-
isOpen:
|
|
746
|
-
onClose: () =>
|
|
747
|
-
onPrimaryAction:
|
|
659
|
+
copy: { close_aria: a.close_aria, title: s.details_edit_title },
|
|
660
|
+
disablePrimaryButton: Number(B) <= 0,
|
|
661
|
+
isOpen: m,
|
|
662
|
+
onClose: () => C(!1),
|
|
663
|
+
onPrimaryAction: A,
|
|
748
664
|
primaryText: s.edit_save_button,
|
|
749
665
|
children: /* @__PURE__ */ e(
|
|
750
|
-
|
|
666
|
+
re,
|
|
751
667
|
{
|
|
752
|
-
amount:
|
|
668
|
+
amount: B,
|
|
753
669
|
categoryName: r.category.name,
|
|
754
|
-
onAmountChanged:
|
|
670
|
+
onAmountChanged: f
|
|
755
671
|
}
|
|
756
672
|
)
|
|
757
673
|
}
|
|
758
674
|
),
|
|
759
675
|
/* @__PURE__ */ e(
|
|
760
|
-
|
|
676
|
+
N,
|
|
761
677
|
{
|
|
762
|
-
copy: { close_aria:
|
|
763
|
-
isOpen:
|
|
764
|
-
onClose: () =>
|
|
765
|
-
onPrimaryAction:
|
|
678
|
+
copy: { close_aria: a.close_aria, title: s.delete_title },
|
|
679
|
+
isOpen: _,
|
|
680
|
+
onClose: () => u(!1),
|
|
681
|
+
onPrimaryAction: x,
|
|
766
682
|
primaryColor: "error",
|
|
767
683
|
primaryText: "Delete",
|
|
768
684
|
secondaryColor: "secondary",
|
|
769
|
-
children: /* @__PURE__ */ e(
|
|
685
|
+
children: /* @__PURE__ */ e(p, { variant: "Paragraph", children: L(s.delete_description, r.category.name) })
|
|
770
686
|
}
|
|
771
687
|
)
|
|
772
688
|
] })
|
|
773
689
|
] });
|
|
774
|
-
}),
|
|
775
|
-
const { is_mobile_webview:
|
|
690
|
+
}), wt = I(({ budget: t }) => {
|
|
691
|
+
const { is_mobile_webview: o } = Ue(), { setAlert: i } = w(), { budgets: s, common: a, transactions: n } = D(), { isDesktop: r, isSmallTablet: c, isTablet: y } = me(), {
|
|
776
692
|
sortedTransactions: g,
|
|
777
|
-
sortedTransactionsWithSplits:
|
|
778
|
-
tags:
|
|
779
|
-
} =
|
|
780
|
-
() => g.find((
|
|
781
|
-
[
|
|
782
|
-
),
|
|
783
|
-
|
|
784
|
-
},
|
|
785
|
-
|
|
786
|
-
}, v = g.length > 0 && !
|
|
787
|
-
return /* @__PURE__ */
|
|
788
|
-
/* @__PURE__ */ e(
|
|
789
|
-
/* @__PURE__ */
|
|
790
|
-
/* @__PURE__ */
|
|
791
|
-
|
|
693
|
+
sortedTransactionsWithSplits: h,
|
|
694
|
+
tags: m
|
|
695
|
+
} = ne(), [C, _] = l.useState(0), [u, B] = l.useState(""), f = l.useMemo(
|
|
696
|
+
() => g.find((S) => S.guid === u),
|
|
697
|
+
[u, g]
|
|
698
|
+
), A = (S, O) => {
|
|
699
|
+
_(O);
|
|
700
|
+
}, x = () => {
|
|
701
|
+
qe(h, m), i(s.alert_csv_downloaded);
|
|
702
|
+
}, v = g.length > 0 && !o && (r || y && !c);
|
|
703
|
+
return /* @__PURE__ */ d(b, { gap: 24, children: [
|
|
704
|
+
/* @__PURE__ */ e(Ie, { budget: t }),
|
|
705
|
+
/* @__PURE__ */ d(b, { children: [
|
|
706
|
+
/* @__PURE__ */ d(
|
|
707
|
+
Ze,
|
|
792
708
|
{
|
|
793
|
-
onChange:
|
|
709
|
+
onChange: A,
|
|
794
710
|
sx: { width: "100%" },
|
|
795
711
|
textColor: "primary",
|
|
796
|
-
value:
|
|
712
|
+
value: C,
|
|
797
713
|
variant: "fullWidth",
|
|
798
714
|
children: [
|
|
799
|
-
/* @__PURE__ */ e(
|
|
800
|
-
/* @__PURE__ */ e(
|
|
715
|
+
/* @__PURE__ */ e(be, { label: s.details_transactions_tab }),
|
|
716
|
+
/* @__PURE__ */ e(be, { label: s.details_subbudgets_tab })
|
|
801
717
|
]
|
|
802
718
|
}
|
|
803
719
|
),
|
|
804
|
-
|
|
805
|
-
v && /* @__PURE__ */ e(
|
|
806
|
-
|
|
720
|
+
C === 0 && /* @__PURE__ */ d(b, { children: [
|
|
721
|
+
v && /* @__PURE__ */ e(b, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ e(
|
|
722
|
+
Ae,
|
|
807
723
|
{
|
|
808
|
-
onClick:
|
|
809
|
-
startIcon: /* @__PURE__ */ e(
|
|
724
|
+
onClick: x,
|
|
725
|
+
startIcon: /* @__PURE__ */ e($, { name: "ios_share" }),
|
|
810
726
|
variant: "text",
|
|
811
|
-
children:
|
|
727
|
+
children: n.export_csv_btn
|
|
812
728
|
}
|
|
813
729
|
) }),
|
|
814
|
-
/* @__PURE__ */ e(
|
|
730
|
+
/* @__PURE__ */ e(xe, { height: "100%", onClick: B })
|
|
815
731
|
] }),
|
|
816
|
-
|
|
732
|
+
C === 1 && /* @__PURE__ */ e(Tt, { budget: t }),
|
|
817
733
|
/* @__PURE__ */ e(
|
|
818
|
-
|
|
734
|
+
M,
|
|
819
735
|
{
|
|
820
|
-
ariaLabelClose:
|
|
821
|
-
isOpen: !!
|
|
822
|
-
onClose: () =>
|
|
736
|
+
ariaLabelClose: a.close_aria,
|
|
737
|
+
isOpen: !!f,
|
|
738
|
+
onClose: () => B(""),
|
|
823
739
|
title: s.details_transaction_drawer,
|
|
824
|
-
children:
|
|
740
|
+
children: f && /* @__PURE__ */ e(Je, { transaction: f })
|
|
825
741
|
}
|
|
826
742
|
)
|
|
827
743
|
] })
|
|
828
744
|
] });
|
|
829
|
-
}),
|
|
830
|
-
const { selectedAccountGuids: t } =
|
|
745
|
+
}), Dt = I(() => {
|
|
746
|
+
const { selectedAccountGuids: t } = ee(), { budgets: o, common: i } = D(), {
|
|
831
747
|
dateRange: s,
|
|
832
|
-
deleteBudget:
|
|
833
|
-
selectedBudget:
|
|
748
|
+
deleteBudget: a,
|
|
749
|
+
selectedBudget: n,
|
|
834
750
|
selectedSubBudget: r,
|
|
835
751
|
setAlert: c,
|
|
836
|
-
setSelectedBudget:
|
|
752
|
+
setSelectedBudget: y,
|
|
837
753
|
updateBudget: g
|
|
838
|
-
} =
|
|
754
|
+
} = w(), { setFilter: h } = ne(), [m, C] = l.useState(!1), [_, u] = l.useState(!1), [B, f] = l.useState(!1), [A, x] = l.useState("");
|
|
839
755
|
l.useEffect(() => {
|
|
840
|
-
|
|
756
|
+
n && !r && (x(`${n.amount}`), C(!0), h({
|
|
841
757
|
accounts: t,
|
|
842
758
|
dateRange: s,
|
|
843
|
-
custom: (R) => R.category_guid ===
|
|
759
|
+
custom: (R) => R.category_guid === n.category_guid || R.top_level_category_guid === n.category_guid,
|
|
844
760
|
showSplits: !0
|
|
845
761
|
}));
|
|
846
|
-
}, [
|
|
762
|
+
}, [n]);
|
|
847
763
|
const v = async () => {
|
|
848
|
-
|
|
849
|
-
...
|
|
850
|
-
amount: Number(
|
|
851
|
-
percentage:
|
|
852
|
-
}), c(
|
|
853
|
-
},
|
|
854
|
-
|
|
855
|
-
},
|
|
856
|
-
|
|
857
|
-
|
|
764
|
+
n && (await g({
|
|
765
|
+
...n,
|
|
766
|
+
amount: Number(A),
|
|
767
|
+
percentage: n.category.totalAmount / Number(A) * 100
|
|
768
|
+
}), c(L(o.alert_budget_updated, n.category.name)));
|
|
769
|
+
}, S = async () => {
|
|
770
|
+
n && (await a(n.guid), c(L(o.alert_budget_deleted, n.category.name))), f(!1), O();
|
|
771
|
+
}, O = () => {
|
|
772
|
+
C(!1), setTimeout(() => {
|
|
773
|
+
y(void 0);
|
|
858
774
|
}, 250);
|
|
859
775
|
};
|
|
860
|
-
if (
|
|
861
|
-
return /* @__PURE__ */
|
|
776
|
+
if (n)
|
|
777
|
+
return /* @__PURE__ */ d(l.Fragment, { children: [
|
|
862
778
|
/* @__PURE__ */ e(
|
|
863
|
-
|
|
779
|
+
M,
|
|
864
780
|
{
|
|
865
781
|
ariaLabelClose: i.close_aria,
|
|
866
|
-
isOpen:
|
|
867
|
-
onClose:
|
|
868
|
-
onPrimaryAction: () =>
|
|
869
|
-
onSecondaryAction: () =>
|
|
870
|
-
primaryText:
|
|
782
|
+
isOpen: m,
|
|
783
|
+
onClose: O,
|
|
784
|
+
onPrimaryAction: () => u(!0),
|
|
785
|
+
onSecondaryAction: () => f(!0),
|
|
786
|
+
primaryText: o.details_edit_button,
|
|
871
787
|
secondaryColor: "error",
|
|
872
|
-
secondaryText:
|
|
873
|
-
title:
|
|
874
|
-
children: /* @__PURE__ */ e(
|
|
788
|
+
secondaryText: o.details_delete_button,
|
|
789
|
+
title: o.details_title,
|
|
790
|
+
children: /* @__PURE__ */ e(wt, { budget: n })
|
|
875
791
|
}
|
|
876
792
|
),
|
|
877
793
|
/* @__PURE__ */ e(
|
|
878
|
-
|
|
794
|
+
N,
|
|
879
795
|
{
|
|
880
|
-
copy: { close_aria: i.close_aria, title:
|
|
881
|
-
disablePrimaryButton: Number(
|
|
882
|
-
isOpen:
|
|
883
|
-
onClose: () =>
|
|
796
|
+
copy: { close_aria: i.close_aria, title: o.details_edit_title },
|
|
797
|
+
disablePrimaryButton: Number(A) <= 0,
|
|
798
|
+
isOpen: _,
|
|
799
|
+
onClose: () => u(!1),
|
|
884
800
|
onPrimaryAction: v,
|
|
885
|
-
primaryText:
|
|
801
|
+
primaryText: o.edit_save_button,
|
|
886
802
|
children: /* @__PURE__ */ e(
|
|
887
|
-
|
|
803
|
+
re,
|
|
888
804
|
{
|
|
889
|
-
amount:
|
|
890
|
-
categoryName:
|
|
891
|
-
onAmountChanged:
|
|
805
|
+
amount: A,
|
|
806
|
+
categoryName: n.category.name,
|
|
807
|
+
onAmountChanged: x
|
|
892
808
|
}
|
|
893
809
|
)
|
|
894
810
|
}
|
|
895
811
|
),
|
|
896
812
|
/* @__PURE__ */ e(
|
|
897
|
-
|
|
813
|
+
N,
|
|
898
814
|
{
|
|
899
|
-
copy: { close_aria: i.close_aria, title:
|
|
900
|
-
isOpen:
|
|
901
|
-
onClose: () =>
|
|
902
|
-
onPrimaryAction:
|
|
815
|
+
copy: { close_aria: i.close_aria, title: o.delete_title },
|
|
816
|
+
isOpen: B,
|
|
817
|
+
onClose: () => f(!1),
|
|
818
|
+
onPrimaryAction: S,
|
|
903
819
|
primaryColor: "error",
|
|
904
|
-
primaryText:
|
|
820
|
+
primaryText: o.details_delete_button,
|
|
905
821
|
secondaryColor: "secondary",
|
|
906
|
-
children: /* @__PURE__ */ e(
|
|
822
|
+
children: /* @__PURE__ */ e(p, { variant: "Paragraph", children: L(o.delete_description, n.category.name) })
|
|
907
823
|
}
|
|
908
824
|
)
|
|
909
825
|
] });
|
|
910
|
-
}),
|
|
826
|
+
}), It = ({ budget: t, onClick: o }) => {
|
|
911
827
|
const {
|
|
912
828
|
amount: i,
|
|
913
|
-
budgetColors: { background: s, description:
|
|
914
|
-
category_guid:
|
|
829
|
+
budgetColors: { background: s, description: a },
|
|
830
|
+
category_guid: n,
|
|
915
831
|
description: r,
|
|
916
832
|
percentage: c,
|
|
917
|
-
subBudgets:
|
|
833
|
+
subBudgets: y,
|
|
918
834
|
transaction_total: g
|
|
919
835
|
} = t;
|
|
920
|
-
return /* @__PURE__ */ e(
|
|
921
|
-
/* @__PURE__ */ e(
|
|
836
|
+
return /* @__PURE__ */ e(V, { children: /* @__PURE__ */ d(Y, { onClick: () => o?.(t), children: [
|
|
837
|
+
/* @__PURE__ */ e(ae, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(ve, { color: s, percent: c, size: 40, children: /* @__PURE__ */ e(H, { categoryGuid: n, variant: "basic" }) }) }),
|
|
922
838
|
/* @__PURE__ */ e(
|
|
923
|
-
|
|
839
|
+
Z,
|
|
924
840
|
{
|
|
925
|
-
primary: /* @__PURE__ */
|
|
926
|
-
/* @__PURE__ */ e(
|
|
927
|
-
/* @__PURE__ */ e(
|
|
841
|
+
primary: /* @__PURE__ */ d(b, { component: "span", direction: "row", justifyContent: "space-between", children: [
|
|
842
|
+
/* @__PURE__ */ e(p, { bold: !0, variant: "Body", children: t.category.name }),
|
|
843
|
+
/* @__PURE__ */ e(p, { fontWeight: 400, variant: "Body", children: `
|
|
928
844
|
${T(g, "0,0")} /
|
|
929
845
|
${T(i, "0,0")}
|
|
930
846
|
` })
|
|
931
847
|
] }),
|
|
932
|
-
secondary: /* @__PURE__ */
|
|
933
|
-
/* @__PURE__ */ e(
|
|
934
|
-
/* @__PURE__ */ e(
|
|
848
|
+
secondary: /* @__PURE__ */ d(b, { component: "span", direction: "row", justifyContent: "space-between", children: [
|
|
849
|
+
/* @__PURE__ */ e(p, { variant: "XSmall", children: `${y.length} Sub-budgets` }),
|
|
850
|
+
/* @__PURE__ */ e(p, { bold: c > 100, color: a, variant: "XSmall", children: r })
|
|
935
851
|
] })
|
|
936
852
|
}
|
|
937
853
|
)
|
|
938
854
|
] }) });
|
|
939
|
-
},
|
|
940
|
-
const { onEvent: t } = X(), { budgets:
|
|
941
|
-
s(
|
|
942
|
-
budget_category:
|
|
855
|
+
}, Et = I(() => {
|
|
856
|
+
const { onEvent: t } = X(), { budgets: o } = D(), { detailedBudgets: i, setSelectedBudget: s } = w(), a = (n) => {
|
|
857
|
+
s(n), t(k.BUDGETS_CLICK_BUDGET_CATEGORY, {
|
|
858
|
+
budget_category: n.category.name,
|
|
943
859
|
click_type: "list"
|
|
944
860
|
});
|
|
945
861
|
};
|
|
946
|
-
return /* @__PURE__ */
|
|
947
|
-
/* @__PURE__ */ e(
|
|
948
|
-
/* @__PURE__ */ e(
|
|
949
|
-
/* @__PURE__ */ e(
|
|
950
|
-
/* @__PURE__ */ e(
|
|
951
|
-
] },
|
|
862
|
+
return /* @__PURE__ */ d(ge, { elevation: 2, children: [
|
|
863
|
+
/* @__PURE__ */ e(Te, { sx: { pb: 8, pl: 24 }, title: /* @__PURE__ */ e(Be, { children: o.budget_categories_title }) }),
|
|
864
|
+
/* @__PURE__ */ e(pe, { sx: { p: 0, ":last-child": { p: 0 } }, children: /* @__PURE__ */ e(K, { children: i.map((n) => /* @__PURE__ */ d(l.Fragment, { children: [
|
|
865
|
+
/* @__PURE__ */ e(It, { budget: n, onClick: a }),
|
|
866
|
+
/* @__PURE__ */ e(oe, {})
|
|
867
|
+
] }, n.guid)) }) })
|
|
952
868
|
] });
|
|
953
|
-
}),
|
|
954
|
-
const t = Q(), { onEvent:
|
|
955
|
-
const v = c.reduce((z,
|
|
956
|
-
let
|
|
957
|
-
|
|
958
|
-
let
|
|
959
|
-
|
|
869
|
+
}), Ot = I(() => {
|
|
870
|
+
const t = Q(), { onEvent: o } = X(), { visibleAccounts: i } = Se(), { budgets: s, common: a, recurring: n } = D(), { incomeCategories: r, spendCategories: c } = j(), { detailedBudgets: y, totalBudgeted: g } = w(), { incomeTotal: h } = te(), { setFilter: m } = ne(), [C, _] = l.useState(!1), [u, B] = l.useMemo(() => {
|
|
871
|
+
const v = c.reduce((z, se) => z + se.totalAmount, 0);
|
|
872
|
+
let S = v / g;
|
|
873
|
+
S > 1 && (S = 1);
|
|
874
|
+
let O = t.palette.success.main;
|
|
875
|
+
S > 0.8 && S < 1 ? O = t.palette.warning.main : S >= 1 && (O = t.palette.error.main);
|
|
960
876
|
const R = [
|
|
961
877
|
{
|
|
962
|
-
color:
|
|
963
|
-
percentage: `${
|
|
878
|
+
color: O,
|
|
879
|
+
percentage: `${S}`
|
|
964
880
|
}
|
|
965
881
|
];
|
|
966
882
|
return [v, R];
|
|
967
|
-
}, [
|
|
883
|
+
}, [y, c]), [f, A] = l.useMemo(() => {
|
|
968
884
|
const v = Math.abs(
|
|
969
885
|
r.reduce((R, z) => R + z.totalAmount, 0)
|
|
970
886
|
);
|
|
971
|
-
let
|
|
972
|
-
|
|
973
|
-
const
|
|
887
|
+
let S = v / h;
|
|
888
|
+
S > 1 && (S = 1);
|
|
889
|
+
const O = [
|
|
974
890
|
{
|
|
975
891
|
color: t.palette.secondary.main,
|
|
976
|
-
percentage: `${
|
|
892
|
+
percentage: `${S}`
|
|
977
893
|
}
|
|
978
894
|
];
|
|
979
|
-
return [v,
|
|
980
|
-
}, [r,
|
|
981
|
-
|
|
895
|
+
return [v, O];
|
|
896
|
+
}, [r, h]), x = () => {
|
|
897
|
+
m({
|
|
982
898
|
accounts: i.map((v) => v.guid),
|
|
983
899
|
dateRange: {
|
|
984
|
-
start:
|
|
900
|
+
start: tt(/* @__PURE__ */ new Date(), 90),
|
|
985
901
|
end: /* @__PURE__ */ new Date()
|
|
986
902
|
}
|
|
987
|
-
}),
|
|
903
|
+
}), _(!0), o(k.BUDGETS_CLICK_EDIT_INCOME);
|
|
988
904
|
};
|
|
989
|
-
return /* @__PURE__ */
|
|
990
|
-
/* @__PURE__ */ e(
|
|
991
|
-
/* @__PURE__ */ e(
|
|
992
|
-
/* @__PURE__ */
|
|
993
|
-
/* @__PURE__ */ e(
|
|
994
|
-
/* @__PURE__ */ e(
|
|
995
|
-
/* @__PURE__ */ e(
|
|
905
|
+
return /* @__PURE__ */ d(ge, { elevation: 2, sx: { overflow: "visible" }, children: [
|
|
906
|
+
/* @__PURE__ */ e(Te, { sx: { pb: 8, pl: 24 }, title: /* @__PURE__ */ e(Be, { children: s.overview_title }) }),
|
|
907
|
+
/* @__PURE__ */ e(pe, { sx: { pt: 12, px: 24 }, children: /* @__PURE__ */ d(b, { gap: 24, children: [
|
|
908
|
+
/* @__PURE__ */ d(b, { gap: 8, children: [
|
|
909
|
+
/* @__PURE__ */ e(p, { bold: !0, sx: { mb: 8 }, variant: "Body", children: s.spending_title }),
|
|
910
|
+
/* @__PURE__ */ e(ue, { data: B, height: 16 }),
|
|
911
|
+
/* @__PURE__ */ e(p, { variant: "Small", children: L(
|
|
996
912
|
s.spending_description,
|
|
997
|
-
T(
|
|
913
|
+
T(u, "0,0"),
|
|
998
914
|
T(g, "0,0")
|
|
999
915
|
) })
|
|
1000
916
|
] }),
|
|
1001
|
-
/* @__PURE__ */
|
|
1002
|
-
/* @__PURE__ */
|
|
1003
|
-
/* @__PURE__ */ e(
|
|
917
|
+
/* @__PURE__ */ d(b, { gap: 8, children: [
|
|
918
|
+
/* @__PURE__ */ d(b, { alignItems: "center", direction: "row", gap: 4, mb: -4, children: [
|
|
919
|
+
/* @__PURE__ */ e(p, { bold: !0, variant: "Body", children: s.income_title }),
|
|
1004
920
|
/* @__PURE__ */ e(
|
|
1005
|
-
|
|
921
|
+
nt,
|
|
1006
922
|
{
|
|
1007
|
-
"aria-label":
|
|
1008
|
-
onClick:
|
|
923
|
+
"aria-label": n.manage_income,
|
|
924
|
+
onClick: x,
|
|
1009
925
|
sx: { p: 0 },
|
|
1010
|
-
children: /* @__PURE__ */ e(
|
|
926
|
+
children: /* @__PURE__ */ e($, { color: "primary", name: "edit" })
|
|
1011
927
|
}
|
|
1012
928
|
)
|
|
1013
929
|
] }),
|
|
1014
|
-
/* @__PURE__ */ e(
|
|
1015
|
-
/* @__PURE__ */ e(
|
|
930
|
+
/* @__PURE__ */ e(ue, { data: A, height: 16 }),
|
|
931
|
+
/* @__PURE__ */ e(p, { variant: "Small", children: L(
|
|
1016
932
|
s.income_description,
|
|
1017
|
-
T(
|
|
1018
|
-
T(
|
|
933
|
+
T(f, "0,0"),
|
|
934
|
+
T(h, "0,0")
|
|
1019
935
|
) })
|
|
1020
936
|
] })
|
|
1021
937
|
] }) }),
|
|
1022
938
|
/* @__PURE__ */ e(
|
|
1023
|
-
|
|
939
|
+
M,
|
|
1024
940
|
{
|
|
1025
|
-
ariaLabelClose:
|
|
1026
|
-
isOpen:
|
|
1027
|
-
onClose: () =>
|
|
1028
|
-
title:
|
|
1029
|
-
children: /* @__PURE__ */ e(
|
|
941
|
+
ariaLabelClose: a.close_aria,
|
|
942
|
+
isOpen: C,
|
|
943
|
+
onClose: () => _(!1),
|
|
944
|
+
title: n.manage_income,
|
|
945
|
+
children: /* @__PURE__ */ e(ot, { forOverview: !0 })
|
|
1030
946
|
}
|
|
1031
947
|
)
|
|
1032
948
|
] });
|
|
1033
|
-
}),
|
|
1034
|
-
const i = Q(), { onEvent: s } = X(), { visibleAccounts:
|
|
1035
|
-
alert:
|
|
1036
|
-
dateRange:
|
|
1037
|
-
isDataLoaded:
|
|
1038
|
-
loadBudgetData:
|
|
1039
|
-
setDateRange:
|
|
1040
|
-
setAlert:
|
|
1041
|
-
setTheme:
|
|
949
|
+
}), Ce = 480, Dn = I(({ onBackClick: t, sx: o }) => {
|
|
950
|
+
const i = Q(), { onEvent: s } = X(), { visibleAccounts: a } = Se(), { budgets: n, common: r } = D(), { isCopyLoaded: c, isInitialized: y, selectedAccounts: g, setDisplayedDate: h, setSelectedAccounts: m } = ee(), {
|
|
951
|
+
alert: C,
|
|
952
|
+
dateRange: _,
|
|
953
|
+
isDataLoaded: u,
|
|
954
|
+
loadBudgetData: B,
|
|
955
|
+
setDateRange: f,
|
|
956
|
+
setAlert: A,
|
|
957
|
+
setTheme: x,
|
|
1042
958
|
detailedBudgets: v
|
|
1043
|
-
} =
|
|
1044
|
-
l.useEffect(() => (
|
|
1045
|
-
|
|
959
|
+
} = w(), { loadRepeatingTransactions: S, setDateRange: O } = te(), { reloadCategoryTotals: R } = j(), { isSmallTablet: z, isMobile: se, isSmallMobile: Ee } = me(), U = z || se || Ee, [Oe, ie] = l.useState(!1);
|
|
960
|
+
l.useEffect(() => (x(i), m(a), f({ start: J(q()), end: de(q()) }), s(k.BUDGETS_VIEW), () => {
|
|
961
|
+
f({ start: J(q()), end: de(q()) });
|
|
1046
962
|
}), []), l.useEffect(() => {
|
|
1047
|
-
|
|
1048
|
-
}, [
|
|
1049
|
-
|
|
1050
|
-
}, [
|
|
1051
|
-
const
|
|
1052
|
-
|
|
1053
|
-
},
|
|
1054
|
-
s(
|
|
1055
|
-
},
|
|
1056
|
-
|
|
1057
|
-
},
|
|
1058
|
-
|
|
1059
|
-
},
|
|
1060
|
-
return !c || !
|
|
1061
|
-
|
|
963
|
+
m(a);
|
|
964
|
+
}, [a]), l.useEffect(() => {
|
|
965
|
+
y && (h(_.start, _.end), R(g, _.start, _.end).finally(), O(_), u || (S().finally(), B().finally()));
|
|
966
|
+
}, [y, g, _]);
|
|
967
|
+
const Le = (_e) => {
|
|
968
|
+
f({ start: _e[0] || /* @__PURE__ */ new Date(), end: _e[1] || /* @__PURE__ */ new Date() });
|
|
969
|
+
}, Re = () => {
|
|
970
|
+
s(k.BUDGETS_CLICK_FILTER);
|
|
971
|
+
}, he = () => {
|
|
972
|
+
ie(!0), s(k.BUDGETS_CLICK_ADD);
|
|
973
|
+
}, ke = () => {
|
|
974
|
+
ie(!1);
|
|
975
|
+
}, Me = Ke(_.end, J(/* @__PURE__ */ new Date()));
|
|
976
|
+
return !c || !y || !u ? /* @__PURE__ */ e(P, {}) : /* @__PURE__ */ d(
|
|
977
|
+
Fe,
|
|
1062
978
|
{
|
|
1063
|
-
accountOptions:
|
|
979
|
+
accountOptions: a,
|
|
1064
980
|
actions: [
|
|
1065
981
|
{
|
|
1066
982
|
iconName: "add",
|
|
1067
|
-
label:
|
|
1068
|
-
onClick:
|
|
983
|
+
label: n.add_title,
|
|
984
|
+
onClick: he
|
|
1069
985
|
}
|
|
1070
986
|
],
|
|
1071
987
|
calendarActions: {
|
|
1072
|
-
onRangeChanged:
|
|
1073
|
-
shouldDisableNext:
|
|
988
|
+
onRangeChanged: Le,
|
|
989
|
+
shouldDisableNext: Me,
|
|
1074
990
|
shouldDisablePicker: !0
|
|
1075
991
|
},
|
|
1076
|
-
onAccountsFilterClick:
|
|
992
|
+
onAccountsFilterClick: Re,
|
|
1077
993
|
onBackClick: t,
|
|
1078
|
-
sx:
|
|
1079
|
-
title:
|
|
994
|
+
sx: o,
|
|
995
|
+
title: n.budgets_title,
|
|
1080
996
|
children: [
|
|
1081
|
-
(!
|
|
1082
|
-
|
|
1083
|
-
|
|
997
|
+
(!y || !u) && /* @__PURE__ */ e(P, {}),
|
|
998
|
+
y && u && /* @__PURE__ */ d(
|
|
999
|
+
b,
|
|
1084
1000
|
{
|
|
1085
1001
|
direction: U ? "column" : "row",
|
|
1086
1002
|
height: "100%",
|
|
1087
1003
|
sx: { justifyContent: "center" },
|
|
1088
1004
|
width: "100%",
|
|
1089
1005
|
children: [
|
|
1090
|
-
/* @__PURE__ */ e(
|
|
1091
|
-
|
|
1006
|
+
/* @__PURE__ */ e(b, { height: U ? 450 : "calc(100dvh - 150px)", children: /* @__PURE__ */ e(
|
|
1007
|
+
we,
|
|
1092
1008
|
{
|
|
1093
|
-
createBudgetOnClick:
|
|
1009
|
+
createBudgetOnClick: he,
|
|
1094
1010
|
height: U ? 450 : 800,
|
|
1095
1011
|
isDraggable: !0,
|
|
1096
1012
|
shouldShowZeroState: v.length === 0,
|
|
1097
|
-
unavailableWidth: U ? 0 :
|
|
1013
|
+
unavailableWidth: U ? 0 : Ce
|
|
1098
1014
|
}
|
|
1099
1015
|
) }),
|
|
1100
|
-
v.length !== 0 && /* @__PURE__ */
|
|
1101
|
-
|
|
1016
|
+
v.length !== 0 && /* @__PURE__ */ d(
|
|
1017
|
+
b,
|
|
1102
1018
|
{
|
|
1103
1019
|
gap: 24,
|
|
1104
1020
|
height: "100%",
|
|
1105
1021
|
sx: { mr: 24, mt: 48 },
|
|
1106
|
-
width: U ? "100%" :
|
|
1022
|
+
width: U ? "100%" : Ce,
|
|
1107
1023
|
children: [
|
|
1108
|
-
/* @__PURE__ */ e(
|
|
1109
|
-
/* @__PURE__ */ e(
|
|
1024
|
+
/* @__PURE__ */ e(Ot, {}),
|
|
1025
|
+
/* @__PURE__ */ e(Et, {})
|
|
1110
1026
|
]
|
|
1111
1027
|
}
|
|
1112
1028
|
)
|
|
1113
1029
|
]
|
|
1114
1030
|
}
|
|
1115
1031
|
),
|
|
1116
|
-
/* @__PURE__ */ e(
|
|
1032
|
+
/* @__PURE__ */ e(Dt, {}),
|
|
1117
1033
|
/* @__PURE__ */ e(
|
|
1118
|
-
|
|
1034
|
+
M,
|
|
1119
1035
|
{
|
|
1120
1036
|
ariaLabelClose: r.close_aria,
|
|
1121
|
-
isOpen:
|
|
1122
|
-
onClose: () =>
|
|
1123
|
-
title:
|
|
1124
|
-
children: /* @__PURE__ */ e(
|
|
1037
|
+
isOpen: Oe,
|
|
1038
|
+
onClose: () => ie(!1),
|
|
1039
|
+
title: n.add_new_title,
|
|
1040
|
+
children: /* @__PURE__ */ e(De, { onRecalculateBudgets: ke })
|
|
1125
1041
|
}
|
|
1126
1042
|
),
|
|
1127
1043
|
/* @__PURE__ */ e(
|
|
1128
|
-
|
|
1044
|
+
Ye,
|
|
1129
1045
|
{
|
|
1130
1046
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
1131
1047
|
autoHideDuration: 3500,
|
|
1132
1048
|
onClose: () => {
|
|
1133
|
-
|
|
1049
|
+
A("");
|
|
1134
1050
|
},
|
|
1135
|
-
open: !!
|
|
1051
|
+
open: !!C,
|
|
1136
1052
|
children: /* @__PURE__ */ e(
|
|
1137
|
-
|
|
1053
|
+
Ve,
|
|
1138
1054
|
{
|
|
1139
1055
|
onClose: () => {
|
|
1140
|
-
|
|
1056
|
+
A("");
|
|
1141
1057
|
},
|
|
1142
1058
|
severity: "success",
|
|
1143
1059
|
variant: "filled",
|
|
1144
|
-
children:
|
|
1060
|
+
children: C
|
|
1145
1061
|
}
|
|
1146
1062
|
)
|
|
1147
1063
|
}
|
|
@@ -1151,6 +1067,6 @@ const xt = ({
|
|
|
1151
1067
|
);
|
|
1152
1068
|
});
|
|
1153
1069
|
export {
|
|
1154
|
-
|
|
1155
|
-
|
|
1070
|
+
wn as BubbleBudgetsMiniWidget,
|
|
1071
|
+
Dn as BubbleBudgetsWidget
|
|
1156
1072
|
};
|