@mx-cartographer/experiences 7.13.6 → 7.13.8
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 +8 -0
- package/dist/{ManageIncome-CYQVQmjx.mjs → ManageIncome-XrztG-9d.mjs} +1 -1
- package/dist/{RecurringSettings-BoMIzZGw.mjs → RecurringSettings-O2PM8MWW.mjs} +1 -1
- package/dist/{TransactionDetails-C9DVd4nm.mjs → TransactionDetails-CkQxd3Ao.mjs} +295 -293
- package/dist/accounts/index.es.js +1 -1
- package/dist/budgets/components/BudgetDetailsDrawerV2.d.ts +3 -1
- package/dist/budgets/index.es.js +659 -654
- package/dist/cashflow/index.es.js +2 -2
- package/dist/finstrong/index.es.js +2 -2
- package/dist/insights/index.es.js +1 -1
- package/dist/recurringtransactions/index.es.js +4 -4
- package/dist/spending/index.es.js +1 -1
- package/dist/transactions/index.es.js +2 -2
- package/dist/trends/index.es.js +1 -1
- package/package.json +1 -1
package/dist/budgets/index.es.js
CHANGED
|
@@ -1,270 +1,270 @@
|
|
|
1
|
-
import { jsxs as m, jsx as e, Fragment as
|
|
1
|
+
import { jsxs as m, jsx as e, Fragment as Ke } from "react/jsx-runtime";
|
|
2
2
|
import l from "react";
|
|
3
|
-
import { observer as
|
|
3
|
+
import { observer as I } from "mobx-react-lite";
|
|
4
4
|
import { endOfMonth as Ce } from "date-fns/endOfMonth";
|
|
5
|
-
import { isAfter as
|
|
6
|
-
import { startOfMonth as
|
|
7
|
-
import { startOfToday as
|
|
5
|
+
import { isAfter as Ye } from "date-fns/isAfter";
|
|
6
|
+
import { startOfMonth as ae } from "date-fns/startOfMonth";
|
|
7
|
+
import { startOfToday as oe } from "date-fns/startOfToday";
|
|
8
8
|
import Se from "@mui/material/Alert";
|
|
9
9
|
import xe from "@mui/material/Snackbar";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { Text as B, CategoryIcon as
|
|
15
|
-
import { u as
|
|
16
|
-
import { f as
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import { b as
|
|
10
|
+
import A from "@mui/material/Stack";
|
|
11
|
+
import se from "@mui/material/styles/useTheme";
|
|
12
|
+
import V from "@mui/material/Box";
|
|
13
|
+
import K from "@mui/material/List";
|
|
14
|
+
import { Text as B, CategoryIcon as H, Icon as j, H3 as Le } from "@mxenabled/mxui";
|
|
15
|
+
import { u as E, m as w, i as ie, l as Y, p as ce, a as Ne, g as X, b as Z, h as q, d as ke } from "../hooks-BxkfR-Ff.mjs";
|
|
16
|
+
import { f as D } from "../NumberFormatting-QCaNwbjv.mjs";
|
|
17
|
+
import $e from "@mui/material/Button";
|
|
18
|
+
import le from "@mui/material/Divider";
|
|
19
|
+
import J from "@mui/material/ListItem";
|
|
20
|
+
import de from "@mui/material/ListItemAvatar";
|
|
21
|
+
import Q from "@mui/material/ListItemButton";
|
|
22
|
+
import ee from "@mui/material/ListItemText";
|
|
23
|
+
import { b as L } from "../Localization-CPkpIwIx.mjs";
|
|
24
24
|
import { D as $ } from "../Drawer-Bbe4AMB1.mjs";
|
|
25
|
-
import
|
|
26
|
-
import { C as
|
|
27
|
-
import { D as
|
|
28
|
-
import { C as
|
|
29
|
-
import * as
|
|
30
|
-
import
|
|
31
|
-
import { useTheme as
|
|
32
|
-
import { u as
|
|
33
|
-
import { L as
|
|
25
|
+
import Xe from "@mui/material/ListItemSecondaryAction";
|
|
26
|
+
import { C as Ze } from "../CurrencyInput-DuMktPu3.mjs";
|
|
27
|
+
import { D as W } from "../Dialog-Ck34yr-d.mjs";
|
|
28
|
+
import { C as qe } from "../ConnectionsDrawer-IA7vnv1J.mjs";
|
|
29
|
+
import * as M from "d3";
|
|
30
|
+
import Je from "@mui/material/Tooltip";
|
|
31
|
+
import { useTheme as Ge, alpha as Qe } from "@mui/material/styles";
|
|
32
|
+
import { u as ue } from "../useScreenSize-B6JyS_Lj.mjs";
|
|
33
|
+
import { L as me } from "../Loader-D3rjKx72.mjs";
|
|
34
34
|
import { E as ye } from "../EmptyState-DHAkGsjk.mjs";
|
|
35
35
|
import { A as G } from "../Analytics-BYItVAe-.mjs";
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import { e as
|
|
36
|
+
import Ee from "@mui/material/Tab";
|
|
37
|
+
import et from "@mui/material/Tabs";
|
|
38
|
+
import { e as tt } from "../exportTransactionsToCSV-CdTF_RqL.mjs";
|
|
39
39
|
import { T as Ae } from "../StatusIndicator-CIKUOoN_.mjs";
|
|
40
|
-
import { T as
|
|
40
|
+
import { T as ot, c as nt } from "../TransactionDetails-CkQxd3Ao.mjs";
|
|
41
41
|
import ve from "@mui/material/Card";
|
|
42
42
|
import Te from "@mui/material/CardContent";
|
|
43
43
|
import { S as Be } from "../StatusBar-BK_uYHAB.mjs";
|
|
44
|
-
import { S as
|
|
45
|
-
import { u as
|
|
46
|
-
import
|
|
47
|
-
import { subDays as
|
|
48
|
-
import
|
|
49
|
-
import { M as
|
|
50
|
-
import { u as
|
|
51
|
-
import { W as
|
|
52
|
-
import { u as
|
|
53
|
-
import { M as
|
|
54
|
-
import { b as
|
|
55
|
-
const
|
|
56
|
-
const { budgets: t } =
|
|
57
|
-
return /* @__PURE__ */ m(
|
|
58
|
-
/* @__PURE__ */ m(
|
|
59
|
-
/* @__PURE__ */ e(B, { bold: !0, variant: "body1", children:
|
|
44
|
+
import { S as Pe } from "../SingleSegmentDonut-BgbLgwHi.mjs";
|
|
45
|
+
import { u as at, b as rt } from "../CategorySelectorDrawer-gc41lfFZ.mjs";
|
|
46
|
+
import je from "@mui/material/CardHeader";
|
|
47
|
+
import { subDays as st } from "date-fns/subDays";
|
|
48
|
+
import it from "@mui/material/IconButton";
|
|
49
|
+
import { M as ct } from "../ManageIncome-XrztG-9d.mjs";
|
|
50
|
+
import { u as ze } from "../useWidgetLoadTimer-DgN1bTyu.mjs";
|
|
51
|
+
import { W as lt } from "../WidgetContainer-D_iaToWJ.mjs";
|
|
52
|
+
import { u as dt, g as ut, C as mt } from "../BudgetUtil-CLhRnCoX.mjs";
|
|
53
|
+
import { M as gt } from "../MiniWidgetContainer-xLWSV6Wz.mjs";
|
|
54
|
+
import { b as we } from "../CategoryUtil-BVixr0d5.mjs";
|
|
55
|
+
const pt = I(() => {
|
|
56
|
+
const { budgets: t } = E(), { totalBudgeted: n } = w(), { incomeTotal: c } = ie(), i = c - n;
|
|
57
|
+
return /* @__PURE__ */ m(A, { direction: "row", justifyContent: "center", my: 16, spacing: 20, children: [
|
|
58
|
+
/* @__PURE__ */ m(A, { alignItems: "center", children: [
|
|
59
|
+
/* @__PURE__ */ e(B, { bold: !0, variant: "body1", children: D(c, "0,0") }),
|
|
60
60
|
/* @__PURE__ */ e(B, { color: "secondary", variant: "body2", children: t.projected_income })
|
|
61
61
|
] }),
|
|
62
62
|
/* @__PURE__ */ e(B, { bold: !0, justifyContent: "center", variant: "body1", children: "-" }),
|
|
63
|
-
/* @__PURE__ */ m(
|
|
64
|
-
/* @__PURE__ */ e(B, { bold: !0, variant: "body1", children:
|
|
63
|
+
/* @__PURE__ */ m(A, { alignItems: "center", children: [
|
|
64
|
+
/* @__PURE__ */ e(B, { bold: !0, variant: "body1", children: D(n, "0,0") }),
|
|
65
65
|
/* @__PURE__ */ e(B, { color: "secondary", variant: "body2", children: t.budgeted })
|
|
66
66
|
] }),
|
|
67
67
|
/* @__PURE__ */ e(B, { bold: !0, justifyContent: "center", variant: "body1", children: "=" }),
|
|
68
|
-
/* @__PURE__ */ m(
|
|
69
|
-
/* @__PURE__ */ e(B, { bold: !0, variant: "body1", children:
|
|
68
|
+
/* @__PURE__ */ m(A, { alignItems: "center", children: [
|
|
69
|
+
/* @__PURE__ */ e(B, { bold: !0, variant: "body1", children: D(i, "0,0") }),
|
|
70
70
|
/* @__PURE__ */ e(B, { color: "secondary", variant: "body2", children: t.remaining })
|
|
71
71
|
] })
|
|
72
72
|
] });
|
|
73
|
-
}),
|
|
73
|
+
}), ht = I(
|
|
74
74
|
({ category: t }) => {
|
|
75
|
-
const { budgets: n } =
|
|
76
|
-
const a =
|
|
77
|
-
return `${
|
|
78
|
-
}, [n,
|
|
75
|
+
const { budgets: n } = E(), { budgets: c } = w(), i = l.useMemo(() => {
|
|
76
|
+
const a = c.find((r) => r.category_guid === t.guid), s = D(t.totalAverageAmount, "0,0"), o = a ? L(n.recalculate_previous_budget, D(a.amount, "0,0")) : n.recalculate_new_budget;
|
|
77
|
+
return `${s} - ${o}`;
|
|
78
|
+
}, [n, c]);
|
|
79
79
|
return /* @__PURE__ */ m(l.Fragment, { children: [
|
|
80
|
-
/* @__PURE__ */ e(
|
|
81
|
-
/* @__PURE__ */ e(
|
|
82
|
-
/* @__PURE__ */ e(
|
|
80
|
+
/* @__PURE__ */ e(J, { children: /* @__PURE__ */ m(Q, { children: [
|
|
81
|
+
/* @__PURE__ */ e(de, { children: /* @__PURE__ */ e(H, { categoryGuid: t.guid, variant: "filled" }) }),
|
|
82
|
+
/* @__PURE__ */ e(ee, { primary: t.name, secondary: i })
|
|
83
83
|
] }) }),
|
|
84
|
-
/* @__PURE__ */ e(
|
|
84
|
+
/* @__PURE__ */ e(le, {})
|
|
85
85
|
] }, t.guid);
|
|
86
86
|
}
|
|
87
|
-
),
|
|
88
|
-
const { budgets: n, common:
|
|
89
|
-
await a(g),
|
|
87
|
+
), bt = ({ onRecalculateBudgets: t }) => {
|
|
88
|
+
const { budgets: n, common: c } = E(), { spendCategories: i } = Y(), { recalculateBudgets: a, setAlert: s } = w(), [o, r] = l.useState(!1), g = i.filter((u) => u.totalAverageAmount > 0), d = async () => {
|
|
89
|
+
await a(g), r(!1), s(n.alert_recalculated_budgets), t?.();
|
|
90
90
|
};
|
|
91
91
|
return /* @__PURE__ */ m(l.Fragment, { children: [
|
|
92
|
-
/* @__PURE__ */ e(
|
|
92
|
+
/* @__PURE__ */ e($e, { onClick: () => r(!0), sx: { mt: 24, mx: 24 }, variant: "text", children: n.recalculate_button }),
|
|
93
93
|
/* @__PURE__ */ e(B, { sx: { mx: 24, my: 16, textAlign: "center", whiteSpace: "wrap" }, variant: "subtitle1", children: n.recalculate_help }),
|
|
94
94
|
/* @__PURE__ */ e(
|
|
95
95
|
$,
|
|
96
96
|
{
|
|
97
|
-
ariaLabelClose:
|
|
97
|
+
ariaLabelClose: c.close_aria,
|
|
98
98
|
isOpen: o,
|
|
99
|
-
onClose: () =>
|
|
99
|
+
onClose: () => r(!1),
|
|
100
100
|
onPrimaryAction: d,
|
|
101
101
|
title: n.recalculate_title,
|
|
102
|
-
children: /* @__PURE__ */ m(
|
|
103
|
-
/* @__PURE__ */ m(
|
|
102
|
+
children: /* @__PURE__ */ m(A, { children: [
|
|
103
|
+
/* @__PURE__ */ m(A, { mx: 24, my: 16, children: [
|
|
104
104
|
/* @__PURE__ */ e(B, { bold: !0, variant: "body1", children: n.recalculate_description_top }),
|
|
105
105
|
/* @__PURE__ */ e(B, { variant: "subtitle2", children: n.recalculate_description_bottom })
|
|
106
106
|
] }),
|
|
107
|
-
/* @__PURE__ */ e(
|
|
107
|
+
/* @__PURE__ */ e(V, { bgcolor: "background.paper", children: /* @__PURE__ */ e(K, { children: g.map((u) => /* @__PURE__ */ e(ht, { category: u }, u.guid)) }) })
|
|
108
108
|
] })
|
|
109
109
|
}
|
|
110
110
|
)
|
|
111
111
|
] });
|
|
112
|
-
},
|
|
112
|
+
}, ge = ({
|
|
113
113
|
amount: t,
|
|
114
114
|
categoryName: n,
|
|
115
|
-
onAmountChanged:
|
|
115
|
+
onAmountChanged: c
|
|
116
116
|
}) => {
|
|
117
|
-
const { budgets:
|
|
118
|
-
return /* @__PURE__ */ m(
|
|
119
|
-
/* @__PURE__ */ m(
|
|
120
|
-
/* @__PURE__ */ e(B, { children:
|
|
121
|
-
|
|
122
|
-
|
|
117
|
+
const { budgets: i } = E(), { totalBudgeted: a } = w(), { incomeTotal: s } = ie(), o = s - a;
|
|
118
|
+
return /* @__PURE__ */ m(A, { gap: 16, children: [
|
|
119
|
+
/* @__PURE__ */ m(A, { children: [
|
|
120
|
+
/* @__PURE__ */ e(B, { children: L(
|
|
121
|
+
i.add_description_top,
|
|
122
|
+
D(o, "0,0")
|
|
123
123
|
) }),
|
|
124
|
-
/* @__PURE__ */ e(B, { children:
|
|
124
|
+
/* @__PURE__ */ e(B, { children: L(i.add_description_bottom, n) })
|
|
125
125
|
] }),
|
|
126
126
|
/* @__PURE__ */ e(
|
|
127
|
-
|
|
127
|
+
Ze,
|
|
128
128
|
{
|
|
129
129
|
amount: t,
|
|
130
130
|
autoFocus: !0,
|
|
131
|
-
label:
|
|
131
|
+
label: i.add_label,
|
|
132
132
|
minAmount: 0,
|
|
133
|
-
setAmount:
|
|
133
|
+
setAmount: c,
|
|
134
134
|
sx: { ".MuiTypography-body1": { p: 0 } }
|
|
135
135
|
}
|
|
136
136
|
)
|
|
137
137
|
] });
|
|
138
|
-
},
|
|
139
|
-
const { budgets:
|
|
138
|
+
}, ft = I(({ category: t, onAddBudget: n }) => {
|
|
139
|
+
const { budgets: c, common: i } = E(), [a, s] = l.useState(!1), [o, r] = l.useState(
|
|
140
140
|
`${t.totalAmount === 0 ? "" : t.totalAmount}`
|
|
141
141
|
);
|
|
142
142
|
return /* @__PURE__ */ m(l.Fragment, { children: [
|
|
143
|
-
/* @__PURE__ */ e(
|
|
144
|
-
/* @__PURE__ */ e(
|
|
143
|
+
/* @__PURE__ */ e(J, { children: /* @__PURE__ */ m(Q, { onClick: () => s(!0), children: [
|
|
144
|
+
/* @__PURE__ */ e(de, { children: /* @__PURE__ */ e(H, { categoryGuid: t.guid }) }),
|
|
145
145
|
/* @__PURE__ */ e(
|
|
146
|
-
|
|
146
|
+
ee,
|
|
147
147
|
{
|
|
148
148
|
primary: t.name,
|
|
149
|
-
secondary:
|
|
149
|
+
secondary: D(t.totalAmount, "0,0")
|
|
150
150
|
}
|
|
151
151
|
),
|
|
152
|
-
/* @__PURE__ */ e(
|
|
152
|
+
/* @__PURE__ */ e(Xe, { children: /* @__PURE__ */ e(j, { name: "add", size: 20 }) })
|
|
153
153
|
] }) }, t.guid),
|
|
154
154
|
/* @__PURE__ */ e(
|
|
155
|
-
|
|
155
|
+
W,
|
|
156
156
|
{
|
|
157
|
-
copy: { close_aria:
|
|
157
|
+
copy: { close_aria: i.close_aria, title: c.add_title },
|
|
158
158
|
disablePrimaryButton: Number(o) <= 0,
|
|
159
159
|
isOpen: a,
|
|
160
|
-
onClose: () =>
|
|
160
|
+
onClose: () => s(!1),
|
|
161
161
|
onPrimaryAction: () => n(t, Number(o)),
|
|
162
|
-
primaryText:
|
|
163
|
-
children: /* @__PURE__ */ e(
|
|
162
|
+
primaryText: c.add_save_button,
|
|
163
|
+
children: /* @__PURE__ */ e(ge, { amount: o, categoryName: t.name, onAmountChanged: r })
|
|
164
164
|
}
|
|
165
165
|
)
|
|
166
166
|
] });
|
|
167
|
-
}),
|
|
168
|
-
const { budgets:
|
|
169
|
-
await
|
|
167
|
+
}), Fe = I(({ onAddBudget: t, onRecalculateBudgets: n }) => {
|
|
168
|
+
const { budgets: c } = E(), { addBudget: i, setAlert: a, unbudgetedCategories: s } = w(), o = async (r, g) => {
|
|
169
|
+
await i(r, g), t?.(), a(L(c.alert_budget_created, r.name));
|
|
170
170
|
};
|
|
171
|
-
return /* @__PURE__ */ m(
|
|
172
|
-
/* @__PURE__ */ e(
|
|
173
|
-
/* @__PURE__ */ e(
|
|
174
|
-
|
|
171
|
+
return /* @__PURE__ */ m(A, { children: [
|
|
172
|
+
/* @__PURE__ */ e(pt, {}),
|
|
173
|
+
/* @__PURE__ */ e(V, { bgcolor: "background.paper", children: /* @__PURE__ */ e(K, { children: s.map((r) => /* @__PURE__ */ e(
|
|
174
|
+
ft,
|
|
175
175
|
{
|
|
176
|
-
category:
|
|
176
|
+
category: r,
|
|
177
177
|
onAddBudget: o
|
|
178
178
|
},
|
|
179
|
-
|
|
179
|
+
r.guid
|
|
180
180
|
)) }) }),
|
|
181
|
-
/* @__PURE__ */ e(
|
|
181
|
+
/* @__PURE__ */ e(bt, { onRecalculateBudgets: n })
|
|
182
182
|
] });
|
|
183
|
-
}),
|
|
183
|
+
}), Ie = 5, Ue = 100, re = 25, yt = (t) => {
|
|
184
184
|
const n = (a) => {
|
|
185
185
|
a.active || t.alphaTarget(0.3).restart(), a.subject.fx = a.subject.x, a.subject.fy = a.subject.y;
|
|
186
|
-
},
|
|
186
|
+
}, c = (a) => {
|
|
187
187
|
a.subject.fx = a.x, a.subject.fy = a.y;
|
|
188
|
-
},
|
|
188
|
+
}, i = (a) => {
|
|
189
189
|
a.active || t.alphaTarget(0), a.subject.fx = null, a.subject.fy = null;
|
|
190
190
|
};
|
|
191
|
-
return
|
|
192
|
-
},
|
|
191
|
+
return M.drag().on("start", n).on("drag", c).on("end", i);
|
|
192
|
+
}, _t = (t) => {
|
|
193
193
|
let n = t.transaction_total / t.amount;
|
|
194
194
|
n < 0 ? n = 0 : n > 1 && (n = 1);
|
|
195
|
-
const
|
|
196
|
-
return (
|
|
197
|
-
},
|
|
198
|
-
|
|
199
|
-
},
|
|
195
|
+
const c = n * 2 * Math.PI, i = M.interpolate(0, c), a = M.arc().cornerRadius(5).innerRadius(t.radius - Ie * 2).outerRadius(t.radius - Ie).startAngle(0).endAngle(0);
|
|
196
|
+
return (s) => (a.endAngle(i(s)), a(t) || "");
|
|
197
|
+
}, Ct = (t) => {
|
|
198
|
+
M.selectAll(".bubble").call(yt(t));
|
|
199
|
+
}, Oe = (t, n, c) => Math.min(Math.max(t, n), c), Bt = (t, n, c) => {
|
|
200
200
|
t.alpha(1).restart().force(
|
|
201
201
|
"x",
|
|
202
|
-
|
|
202
|
+
M.forceX().x(c / 2).strength(0.01)
|
|
203
203
|
).force(
|
|
204
204
|
"y",
|
|
205
|
-
|
|
205
|
+
M.forceY().y(n / 2).strength(0.02)
|
|
206
206
|
).on("tick", () => {
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
const
|
|
210
|
-
a.x =
|
|
211
|
-
}),
|
|
207
|
+
const i = t.nodes();
|
|
208
|
+
i.forEach((a) => {
|
|
209
|
+
const s = a.radius ?? re;
|
|
210
|
+
a.x = Oe(a.x ?? 0, s, c - s), a.y = Oe(a.y ?? 0, s, n - s);
|
|
211
|
+
}), M.selectAll(".bubble").data(i).attr("transform", (a) => `translate(${a.x},${a.y})`);
|
|
212
212
|
});
|
|
213
|
-
},
|
|
214
|
-
const n = t.reduce((
|
|
215
|
-
const
|
|
216
|
-
return
|
|
217
|
-
}, 0),
|
|
218
|
-
const
|
|
219
|
-
return
|
|
220
|
-
}, n),
|
|
221
|
-
const o =
|
|
213
|
+
}, We = (t, n) => M.scaleLinear().domain([t, n]).range([re, Ue]), St = (t) => {
|
|
214
|
+
const n = t.reduce((s, o) => {
|
|
215
|
+
const r = Math.max(o.transaction_total, o.amount);
|
|
216
|
+
return r > s ? r : s;
|
|
217
|
+
}, 0), c = t.reduce((s, o) => {
|
|
218
|
+
const r = Math.max(o.transaction_total, o.amount);
|
|
219
|
+
return r < s ? r : s;
|
|
220
|
+
}, n), i = We(c, n), a = t.map((s) => {
|
|
221
|
+
const o = i(Math.max(s.transaction_total, s.amount)) || 25;
|
|
222
222
|
return {
|
|
223
|
-
...
|
|
223
|
+
...s,
|
|
224
224
|
radius: o
|
|
225
225
|
};
|
|
226
226
|
});
|
|
227
|
-
return
|
|
228
|
-
},
|
|
229
|
-
const a = Math.PI *
|
|
230
|
-
let u =
|
|
227
|
+
return M.forceSimulation(a).velocityDecay(0.05).force("collide", M.forceCollide((s) => s.radius + 2).strength(0.7));
|
|
228
|
+
}, xt = (t, n, c) => {
|
|
229
|
+
const a = Math.PI * re ** 2 * t, s = c < 400 || n < 300, o = s ? 40 : 20, r = Math.max(100, c - o), g = Math.max(100, n - o), d = r * g;
|
|
230
|
+
let u = re;
|
|
231
231
|
if (a < d) {
|
|
232
|
-
const
|
|
233
|
-
u = Math.min(
|
|
232
|
+
const p = Math.sqrt(d / (t * Math.PI)), h = Math.min(r, g) / 4;
|
|
233
|
+
u = Math.min(Ue, p, h);
|
|
234
234
|
}
|
|
235
|
-
return
|
|
236
|
-
},
|
|
237
|
-
const { maxRadius:
|
|
238
|
-
return
|
|
239
|
-
},
|
|
240
|
-
const
|
|
235
|
+
return s && t <= 3 && (u = Math.min(u, 45)), { minRadius: Math.max(20, u * 0.6), maxRadius: u };
|
|
236
|
+
}, At = (t, n, c, i, a) => {
|
|
237
|
+
const { maxRadius: s, minRadius: o } = xt(t, n, a);
|
|
238
|
+
return M.scaleLinear().domain([i, c]).range([o, s]);
|
|
239
|
+
}, vt = (t, n, c = !1, i, a) => {
|
|
240
|
+
const s = n.map((d) => Math.max(d.transaction_total, d.amount)), o = Math.min(...s), r = Math.max(...s), g = c ? At(t.length, i, r, o, a) : We(o, r);
|
|
241
241
|
return t.map((d) => ({
|
|
242
242
|
...d,
|
|
243
243
|
radius: g(Math.max(d.transaction_total, d.amount))
|
|
244
244
|
}));
|
|
245
|
-
},
|
|
246
|
-
const n =
|
|
247
|
-
amount:
|
|
248
|
-
guid:
|
|
245
|
+
}, Me = 5, Tt = 2e3, Dt = ({ bubble: t }) => {
|
|
246
|
+
const n = se(), {
|
|
247
|
+
amount: c,
|
|
248
|
+
guid: i,
|
|
249
249
|
budgetColors: { mercury: a },
|
|
250
|
-
radius:
|
|
250
|
+
radius: s,
|
|
251
251
|
transaction_total: o
|
|
252
|
-
} = t,
|
|
252
|
+
} = t, r = `mercury-${i}`;
|
|
253
253
|
l.useEffect(() => {
|
|
254
|
-
|
|
255
|
-
}, [
|
|
256
|
-
const g =
|
|
257
|
-
return /* @__PURE__ */ e("g", { className:
|
|
254
|
+
M.select(`.${r}`).selectAll(".status").remove(), M.select(`.${r}`).append("path").transition().duration(Tt).delay(0).attr("class", "status").attr("style", `fill: ${a}; fill-opacity: 1;`).attrTween("d", () => _t(t));
|
|
255
|
+
}, [c, s, o]);
|
|
256
|
+
const g = M.arc().innerRadius((d) => d - 2 * Me).outerRadius((d) => d - Me).startAngle(0).endAngle(2 * Math.PI);
|
|
257
|
+
return /* @__PURE__ */ e("g", { className: r, children: /* @__PURE__ */ e(
|
|
258
258
|
"path",
|
|
259
259
|
{
|
|
260
|
-
d: g(
|
|
260
|
+
d: g(s) || "",
|
|
261
261
|
style: { fill: n.palette.common.white, fillOpacity: 0.35 }
|
|
262
262
|
}
|
|
263
263
|
) });
|
|
264
|
-
},
|
|
265
|
-
function
|
|
264
|
+
}, Et = l.memo(Dt), U = 75, _e = 50;
|
|
265
|
+
function wt({ bubble: t, isDraggable: n, onClick: c = () => {
|
|
266
266
|
} }) {
|
|
267
|
-
const [
|
|
267
|
+
const [i, a] = l.useState(!1), s = Ge(), { availableWidth: o } = ce(), r = l.useMemo(() => {
|
|
268
268
|
if (t)
|
|
269
269
|
return {
|
|
270
270
|
amount: t.amount,
|
|
@@ -277,26 +277,26 @@ function Et({ bubble: t, isDraggable: n, onClick: i = () => {
|
|
|
277
277
|
if (!t) return;
|
|
278
278
|
const {
|
|
279
279
|
budgetColors: { background: g, text: d },
|
|
280
|
-
category: { icon: u, name:
|
|
281
|
-
guid:
|
|
282
|
-
description:
|
|
283
|
-
radius:
|
|
284
|
-
x:
|
|
285
|
-
y:
|
|
286
|
-
} = t,
|
|
287
|
-
let
|
|
288
|
-
|
|
289
|
-
let
|
|
290
|
-
|
|
291
|
-
const
|
|
280
|
+
category: { icon: u, name: y },
|
|
281
|
+
guid: p,
|
|
282
|
+
description: h,
|
|
283
|
+
radius: _,
|
|
284
|
+
x: C,
|
|
285
|
+
y: x
|
|
286
|
+
} = t, v = o < 400 ? -8 : -12;
|
|
287
|
+
let b = v, S = v;
|
|
288
|
+
_ > U ? (b = -14, S = -45) : _ > _e && (S = -32);
|
|
289
|
+
let f = 32;
|
|
290
|
+
_ <= U && (f = o < 400 ? 16 : 24);
|
|
291
|
+
const T = `${t.category.name}: ${h}`, N = {
|
|
292
292
|
modifiers: [
|
|
293
293
|
{
|
|
294
294
|
name: "offset",
|
|
295
295
|
options: { offset: [0, 15] }
|
|
296
296
|
}
|
|
297
297
|
]
|
|
298
|
-
},
|
|
299
|
-
(k.key === "Enter" || k.key === " ") && (k.preventDefault(),
|
|
298
|
+
}, R = (k) => {
|
|
299
|
+
(k.key === "Enter" || k.key === " ") && (k.preventDefault(), c(t));
|
|
300
300
|
}, O = () => {
|
|
301
301
|
a(!0);
|
|
302
302
|
}, z = () => {
|
|
@@ -305,21 +305,21 @@ function Et({ bubble: t, isDraggable: n, onClick: i = () => {
|
|
|
305
305
|
return /* @__PURE__ */ m(
|
|
306
306
|
"g",
|
|
307
307
|
{
|
|
308
|
-
"aria-label": `${
|
|
308
|
+
"aria-label": `${y} - ${h}`,
|
|
309
309
|
className: "bubble",
|
|
310
|
-
id: `bubble-${
|
|
310
|
+
id: `bubble-${p}`,
|
|
311
311
|
onBlur: z,
|
|
312
|
-
onClick: () =>
|
|
312
|
+
onClick: () => c(t),
|
|
313
313
|
onFocus: O,
|
|
314
|
-
onKeyDown:
|
|
314
|
+
onKeyDown: R,
|
|
315
315
|
onMouseEnter: () => a(!0),
|
|
316
316
|
onMouseLeave: () => a(!1),
|
|
317
317
|
role: "button",
|
|
318
318
|
style: { cursor: n ? "pointer" : "default" },
|
|
319
319
|
tabIndex: 0,
|
|
320
320
|
textAnchor: "middle",
|
|
321
|
-
x:
|
|
322
|
-
y:
|
|
321
|
+
x: C,
|
|
322
|
+
y: x,
|
|
323
323
|
children: [
|
|
324
324
|
/* @__PURE__ */ e("style", { children: `
|
|
325
325
|
.bubble:focus,
|
|
@@ -328,76 +328,76 @@ function Et({ bubble: t, isDraggable: n, onClick: i = () => {
|
|
|
328
328
|
}
|
|
329
329
|
.bubble:focus circle,
|
|
330
330
|
.bubble:focus-visible circle {
|
|
331
|
-
stroke: ${
|
|
331
|
+
stroke: ${s.palette.primary.main};
|
|
332
332
|
stroke-width: 3;
|
|
333
333
|
stroke-opacity: 0.8;
|
|
334
334
|
}
|
|
335
335
|
` }),
|
|
336
|
-
/* @__PURE__ */ e(
|
|
337
|
-
/* @__PURE__ */ e("svg", { x:
|
|
338
|
-
|
|
336
|
+
/* @__PURE__ */ e(Je, { open: i, slotProps: { popper: N }, title: T, children: /* @__PURE__ */ e("circle", { fill: g, id: `circle-${p}`, r: _ }) }),
|
|
337
|
+
/* @__PURE__ */ e("svg", { x: b, y: S, children: /* @__PURE__ */ e(j, { name: u, size: f, sx: { fill: d } }) }),
|
|
338
|
+
_ > U && /* @__PURE__ */ e(
|
|
339
339
|
B,
|
|
340
340
|
{
|
|
341
341
|
bold: !0,
|
|
342
342
|
component: "text",
|
|
343
|
-
id: `budget-category-${
|
|
343
|
+
id: `budget-category-${p}`,
|
|
344
344
|
sx: { fill: d },
|
|
345
345
|
variant: "body2",
|
|
346
346
|
y: 4,
|
|
347
|
-
children:
|
|
347
|
+
children: y
|
|
348
348
|
}
|
|
349
349
|
),
|
|
350
|
-
|
|
350
|
+
_ > _e && /* @__PURE__ */ e(
|
|
351
351
|
B,
|
|
352
352
|
{
|
|
353
353
|
bold: !0,
|
|
354
354
|
component: "text",
|
|
355
|
-
id: `budget-description-${
|
|
355
|
+
id: `budget-description-${p}-1`,
|
|
356
356
|
sx: { fill: d },
|
|
357
357
|
variant: "body1",
|
|
358
|
-
y:
|
|
359
|
-
children:
|
|
358
|
+
y: _ <= U ? 12 : 24,
|
|
359
|
+
children: _ <= U ? h.split(" ")[0] : h
|
|
360
360
|
}
|
|
361
361
|
),
|
|
362
|
-
|
|
362
|
+
_ <= U && _ > _e && /* @__PURE__ */ e(
|
|
363
363
|
B,
|
|
364
364
|
{
|
|
365
365
|
component: "text",
|
|
366
|
-
id: `budget-description-${
|
|
366
|
+
id: `budget-description-${p}-2`,
|
|
367
367
|
sx: { fill: d },
|
|
368
368
|
variant: "caption",
|
|
369
369
|
y: 28,
|
|
370
|
-
children:
|
|
370
|
+
children: h.split(" ")[1]
|
|
371
371
|
}
|
|
372
372
|
),
|
|
373
|
-
/* @__PURE__ */ e(
|
|
373
|
+
/* @__PURE__ */ e(Et, { bubble: r })
|
|
374
374
|
]
|
|
375
375
|
},
|
|
376
|
-
|
|
376
|
+
p
|
|
377
377
|
);
|
|
378
378
|
}
|
|
379
|
-
const
|
|
379
|
+
const It = ({
|
|
380
380
|
height: t,
|
|
381
381
|
width: n,
|
|
382
|
-
isDraggable:
|
|
383
|
-
onClick:
|
|
382
|
+
isDraggable: c = !1,
|
|
383
|
+
onClick: i = () => {
|
|
384
384
|
}
|
|
385
385
|
}) => {
|
|
386
|
-
const [a,
|
|
387
|
-
const u = o.current,
|
|
386
|
+
const [a, s] = l.useState([]), o = l.useRef(null), r = l.useRef(!1), { detailedBudgets: g } = w(), d = l.useCallback(() => {
|
|
387
|
+
const u = o.current, y = St(g), p = y.nodes();
|
|
388
388
|
if (u) {
|
|
389
|
-
const
|
|
390
|
-
|
|
391
|
-
const
|
|
392
|
-
|
|
393
|
-
vx:
|
|
394
|
-
vy:
|
|
395
|
-
x:
|
|
396
|
-
y:
|
|
389
|
+
const h = u.nodes(), _ = new Map(h.map((C) => [C.guid, C]));
|
|
390
|
+
p.forEach((C) => {
|
|
391
|
+
const x = _.get(C.guid);
|
|
392
|
+
x && Object.assign(C, {
|
|
393
|
+
vx: x.vx,
|
|
394
|
+
vy: x.vy,
|
|
395
|
+
x: x.x,
|
|
396
|
+
y: x.y
|
|
397
397
|
});
|
|
398
398
|
});
|
|
399
399
|
}
|
|
400
|
-
o.current =
|
|
400
|
+
o.current = y, r.current = !1, s(p);
|
|
401
401
|
}, [g]);
|
|
402
402
|
return l.useEffect(() => {
|
|
403
403
|
d();
|
|
@@ -406,29 +406,29 @@ const wt = ({
|
|
|
406
406
|
}, []), l.useEffect(() => {
|
|
407
407
|
const u = o.current;
|
|
408
408
|
if (!u) return;
|
|
409
|
-
const
|
|
410
|
-
u.nodes(
|
|
411
|
-
|
|
412
|
-
}, 0),
|
|
413
|
-
}, [t, n,
|
|
414
|
-
},
|
|
409
|
+
const y = u.nodes(), p = n > 0 && n < 450 || t > 0 && t < 300, h = vt(y, g, p, t, n);
|
|
410
|
+
u.nodes(h), Bt(u, t, n), c && setTimeout(() => {
|
|
411
|
+
Ct(u);
|
|
412
|
+
}, 0), s([...h]);
|
|
413
|
+
}, [t, n, c, g]), /* @__PURE__ */ e("svg", { height: t, style: { overflow: "visible" }, width: Math.abs(n), children: a.map((u) => /* @__PURE__ */ e(wt, { bubble: u, isDraggable: c, onClick: i }, u.guid)) });
|
|
414
|
+
}, Ot = I(It), Mt = ({
|
|
415
415
|
isMiniWidget: t = !1,
|
|
416
416
|
onConnectAccountsClick: n,
|
|
417
|
-
createBudgetOnClick:
|
|
417
|
+
createBudgetOnClick: c
|
|
418
418
|
}) => {
|
|
419
|
-
const { config:
|
|
420
|
-
|
|
421
|
-
const { data:
|
|
422
|
-
|
|
419
|
+
const { config: i } = Ne(), { recalculateBudgets: a } = w(), { spendCategories: s } = Y(), { budgets: o } = E(), { availableWidth: r } = ce(), { isMobile: g } = ue(r), d = t && g, [u, y] = l.useState(!1), [p, h] = l.useState(!1), [_, C] = l.useState(!1), x = l.useMemo(() => [...s.filter((b) => b.totalAverageAmount > 0)], [s]), v = async () => {
|
|
420
|
+
C(!0);
|
|
421
|
+
const { data: b, isSuccess: S } = await a(x);
|
|
422
|
+
C(!1), S ? (b.length === 0 && h(!0), y(!1)) : y(!0);
|
|
423
423
|
};
|
|
424
|
-
return
|
|
424
|
+
return _ ? /* @__PURE__ */ e(me, {}) : u ? /* @__PURE__ */ e(
|
|
425
425
|
ye,
|
|
426
426
|
{
|
|
427
427
|
header: o.autogenerate_budgets_error_header,
|
|
428
428
|
icon: "error",
|
|
429
429
|
iconColor: "#4D4D4D",
|
|
430
|
-
onClick: (
|
|
431
|
-
|
|
430
|
+
onClick: (b) => {
|
|
431
|
+
b === "primary" ? v() : c();
|
|
432
432
|
},
|
|
433
433
|
primaryButton: o.autogenerate_budgets_error_primary_button,
|
|
434
434
|
secondaryButton: o.zero_state_generate_budgets_secondary_button,
|
|
@@ -442,16 +442,16 @@ const wt = ({
|
|
|
442
442
|
...d && { justifyContent: "center", mt: 0, svg: { height: 32, width: 32 } }
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
|
-
) : /* @__PURE__ */ e(
|
|
445
|
+
) : /* @__PURE__ */ e(Ke, { children: p ? /* @__PURE__ */ e(
|
|
446
446
|
ye,
|
|
447
447
|
{
|
|
448
448
|
header: o.zero_state_generate_budgets_header,
|
|
449
449
|
icon: "error",
|
|
450
450
|
iconColor: "#4D4D4D",
|
|
451
|
-
onClick: (
|
|
452
|
-
|
|
451
|
+
onClick: (b) => {
|
|
452
|
+
b === "primary" ? n() : c();
|
|
453
453
|
},
|
|
454
|
-
primaryButton:
|
|
454
|
+
primaryButton: i.show_connections_widget_in_master ? o.zero_state_generate_budgets_primary_button : void 0,
|
|
455
455
|
secondaryButton: o.zero_state_generate_budgets_secondary_button,
|
|
456
456
|
subText: o.zero_state_generate_budgets_subheader,
|
|
457
457
|
sx: {
|
|
@@ -473,8 +473,8 @@ const wt = ({
|
|
|
473
473
|
header: o.create_budgets_title,
|
|
474
474
|
icon: "bubble_chart",
|
|
475
475
|
iconColor: "#1A1A1A",
|
|
476
|
-
onClick: (
|
|
477
|
-
|
|
476
|
+
onClick: (b) => {
|
|
477
|
+
b === "primary" ? v() : c();
|
|
478
478
|
},
|
|
479
479
|
primaryButton: o.empty_state_primary_button,
|
|
480
480
|
secondaryButton: t ? void 0 : o.empty_state_secondary_button,
|
|
@@ -493,51 +493,51 @@ const wt = ({
|
|
|
493
493
|
}
|
|
494
494
|
}
|
|
495
495
|
) });
|
|
496
|
-
},
|
|
496
|
+
}, He = I(
|
|
497
497
|
({
|
|
498
498
|
createBudgetOnClick: t = () => {
|
|
499
499
|
},
|
|
500
500
|
height: n,
|
|
501
|
-
isDraggable:
|
|
502
|
-
isMiniWidget:
|
|
501
|
+
isDraggable: c = !1,
|
|
502
|
+
isMiniWidget: i = !1,
|
|
503
503
|
shouldShowZeroState: a,
|
|
504
|
-
unavailableWidth:
|
|
504
|
+
unavailableWidth: s = 24
|
|
505
505
|
}) => {
|
|
506
|
-
const { onEvent: o } =
|
|
507
|
-
|
|
508
|
-
budget_category:
|
|
506
|
+
const { onEvent: o } = X(), { setSelectedBudget: r } = w(), { isInitialized: g } = Z(), { accounts: d } = E(), { availableWidth: u } = ce(), { isMobile: y } = ue(), [p, h] = l.useState(!1), _ = l.useMemo(() => u - s, [u]), C = (v) => {
|
|
507
|
+
r(v), o(G.BUDGETS_CLICK_BUDGET_CATEGORY, {
|
|
508
|
+
budget_category: v.category.name,
|
|
509
509
|
click_type: "bubble"
|
|
510
510
|
});
|
|
511
|
-
},
|
|
512
|
-
|
|
511
|
+
}, x = () => {
|
|
512
|
+
h(!0), o(G.ACCOUNTS_CLICK_CONNECT);
|
|
513
513
|
};
|
|
514
514
|
return /* @__PURE__ */ m(
|
|
515
|
-
|
|
515
|
+
V,
|
|
516
516
|
{
|
|
517
|
-
ml: a ||
|
|
518
|
-
sx: { alignSelf: "center", ...
|
|
517
|
+
ml: a || y ? 0 : 24,
|
|
518
|
+
sx: { alignSelf: "center", ...i && { height: "100%" } },
|
|
519
519
|
children: [
|
|
520
520
|
a || !g ? /* @__PURE__ */ e(
|
|
521
|
-
|
|
521
|
+
Mt,
|
|
522
522
|
{
|
|
523
523
|
createBudgetOnClick: t,
|
|
524
|
-
isMiniWidget:
|
|
525
|
-
onConnectAccountsClick:
|
|
524
|
+
isMiniWidget: i,
|
|
525
|
+
onConnectAccountsClick: x
|
|
526
526
|
}
|
|
527
527
|
) : /* @__PURE__ */ e(
|
|
528
|
-
|
|
528
|
+
Ot,
|
|
529
529
|
{
|
|
530
530
|
height: n,
|
|
531
|
-
isDraggable:
|
|
532
|
-
onClick:
|
|
533
|
-
width:
|
|
531
|
+
isDraggable: c,
|
|
532
|
+
onClick: C,
|
|
533
|
+
width: _
|
|
534
534
|
}
|
|
535
535
|
),
|
|
536
536
|
/* @__PURE__ */ e(
|
|
537
|
-
|
|
537
|
+
qe,
|
|
538
538
|
{
|
|
539
|
-
onClose: () =>
|
|
540
|
-
showConnectionsWidget:
|
|
539
|
+
onClose: () => h(!1),
|
|
540
|
+
showConnectionsWidget: p,
|
|
541
541
|
title: d.manage_connections
|
|
542
542
|
}
|
|
543
543
|
)
|
|
@@ -545,362 +545,362 @@ const wt = ({
|
|
|
545
545
|
}
|
|
546
546
|
);
|
|
547
547
|
}
|
|
548
|
-
),
|
|
548
|
+
), Ve = ({ budget: t }) => {
|
|
549
549
|
const {
|
|
550
550
|
amount: n,
|
|
551
|
-
budgetColors: { background:
|
|
552
|
-
category: { name:
|
|
551
|
+
budgetColors: { background: c },
|
|
552
|
+
category: { name: i },
|
|
553
553
|
category_guid: a,
|
|
554
|
-
percentage:
|
|
554
|
+
percentage: s,
|
|
555
555
|
transaction_total: o
|
|
556
|
-
} = t,
|
|
556
|
+
} = t, r = [
|
|
557
557
|
{
|
|
558
|
-
color:
|
|
559
|
-
percentage: `${
|
|
558
|
+
color: c,
|
|
559
|
+
percentage: `${s}%`
|
|
560
560
|
}
|
|
561
561
|
];
|
|
562
|
-
return /* @__PURE__ */ e(ve, { sx: { mt: 24, mx: 24 }, children: /* @__PURE__ */ e(Te, { children: /* @__PURE__ */ m(
|
|
563
|
-
/* @__PURE__ */ e(
|
|
564
|
-
/* @__PURE__ */ e(B, { variant: "h1", children: `${
|
|
565
|
-
/* @__PURE__ */ e(B, { bold: !0, variant: "caption", children:
|
|
566
|
-
/* @__PURE__ */ e(Be, { data:
|
|
562
|
+
return /* @__PURE__ */ e(ve, { sx: { mt: 24, mx: 24 }, children: /* @__PURE__ */ e(Te, { children: /* @__PURE__ */ m(A, { alignItems: "center", gap: 16, children: [
|
|
563
|
+
/* @__PURE__ */ e(H, { categoryGuid: a, size: 56 }),
|
|
564
|
+
/* @__PURE__ */ e(B, { variant: "h1", children: `${D(o, "0,0")} / ${D(n, "0,0")}` }),
|
|
565
|
+
/* @__PURE__ */ e(B, { bold: !0, variant: "caption", children: i }),
|
|
566
|
+
/* @__PURE__ */ e(Be, { data: r, height: 10 })
|
|
567
567
|
] }) }) });
|
|
568
|
-
},
|
|
569
|
-
const { budgets: t } =
|
|
570
|
-
return /* @__PURE__ */ m(
|
|
568
|
+
}, Rt = I(() => {
|
|
569
|
+
const { budgets: t } = E();
|
|
570
|
+
return /* @__PURE__ */ m(A, { alignItems: "center", gap: 12, height: "auto", mb: 24, mt: 24, children: [
|
|
571
571
|
/* @__PURE__ */ e(j, { color: "action", name: "bubble_chart", sx: { fontSize: 32 } }),
|
|
572
572
|
/* @__PURE__ */ e(B, { bold: !0, color: "text.secondary", variant: "body2", children: t.zero_state_no_sub_budgets }),
|
|
573
573
|
/* @__PURE__ */ e(B, { color: "text.secondary", variant: "caption", children: t.zero_state_no_sub_budgets_description })
|
|
574
574
|
] });
|
|
575
|
-
}),
|
|
575
|
+
}), Lt = I(({ budget: t }) => {
|
|
576
576
|
const {
|
|
577
577
|
amount: n,
|
|
578
|
-
budgetColors: { background:
|
|
579
|
-
category:
|
|
578
|
+
budgetColors: { background: c },
|
|
579
|
+
category: i,
|
|
580
580
|
percentage: a,
|
|
581
|
-
transaction_total:
|
|
582
|
-
} = t, { setSelectedSubBudget: o } =
|
|
583
|
-
return /* @__PURE__ */ e(
|
|
584
|
-
/* @__PURE__ */ e(
|
|
581
|
+
transaction_total: s
|
|
582
|
+
} = t, { setSelectedSubBudget: o } = w();
|
|
583
|
+
return /* @__PURE__ */ e(J, { children: /* @__PURE__ */ m(Q, { onClick: () => o(t), children: [
|
|
584
|
+
/* @__PURE__ */ e(de, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(Pe, { color: c, percent: a, size: 40, children: /* @__PURE__ */ e(H, { categoryGuid: i.parent_guid, variant: "basic" }) }) }),
|
|
585
585
|
/* @__PURE__ */ e(
|
|
586
|
-
|
|
586
|
+
ee,
|
|
587
587
|
{
|
|
588
|
-
primary: /* @__PURE__ */ e(
|
|
589
|
-
secondary: /* @__PURE__ */ e(
|
|
590
|
-
${
|
|
591
|
-
${
|
|
588
|
+
primary: /* @__PURE__ */ e(A, { component: "span", direction: "row", justifyContent: "space-between", children: /* @__PURE__ */ e(B, { bold: !0, variant: "body1", children: t.category.name }) }),
|
|
589
|
+
secondary: /* @__PURE__ */ e(A, { component: "span", direction: "row", justifyContent: "space-between", children: /* @__PURE__ */ e(B, { fontWeight: 400, variant: "body1", children: `
|
|
590
|
+
${D(s, "0,0")} /
|
|
591
|
+
${D(n, "0,0")}
|
|
592
592
|
` }) })
|
|
593
593
|
}
|
|
594
594
|
)
|
|
595
595
|
] }) });
|
|
596
|
-
}),
|
|
597
|
-
const { budgets:
|
|
596
|
+
}), Nt = I(({ category: t, parentBudget: n }) => {
|
|
597
|
+
const { budgets: c, common: i } = E(), { setExpandedGuid: a, setOnSelect: s } = at(), { addBudget: o } = w(), [r, g] = l.useState(!1), [d, u] = l.useState(!1), [y, p] = l.useState(""), [h, _] = l.useState(void 0);
|
|
598
598
|
l.useEffect(() => {
|
|
599
|
-
|
|
600
|
-
const
|
|
601
|
-
|
|
599
|
+
s((v) => {
|
|
600
|
+
const b = t.subCategories.find((S) => S.guid === v);
|
|
601
|
+
b && (_(b), p(`${b.currentAmount === 0 ? "" : b.currentAmount}`), u(!0));
|
|
602
602
|
});
|
|
603
603
|
}, []);
|
|
604
|
-
const
|
|
604
|
+
const C = () => {
|
|
605
605
|
a(t.guid), g(!0);
|
|
606
|
-
},
|
|
607
|
-
|
|
606
|
+
}, x = async () => {
|
|
607
|
+
h && Number(y) > 0 && (await o(h, Number(y), n.guid), u(!1), g(!1), _(void 0));
|
|
608
608
|
};
|
|
609
|
-
return /* @__PURE__ */ m(
|
|
610
|
-
/* @__PURE__ */ e(
|
|
611
|
-
/* @__PURE__ */ m(
|
|
609
|
+
return /* @__PURE__ */ m(V, { children: [
|
|
610
|
+
/* @__PURE__ */ e(J, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(Q, { onClick: C, children: /* @__PURE__ */ e(ee, { children: /* @__PURE__ */ m(A, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
|
|
611
|
+
/* @__PURE__ */ m(A, { alignItems: "center", direction: "row", gap: 8, children: [
|
|
612
612
|
/* @__PURE__ */ e(j, { fill: !0, name: "add_box", size: 24, sx: { color: "primary.light" } }),
|
|
613
|
-
/* @__PURE__ */ e(B, { bold: !0, sx: { color: "primary.light" }, variant: "body1", children:
|
|
613
|
+
/* @__PURE__ */ e(B, { bold: !0, sx: { color: "primary.light" }, variant: "body1", children: c.add_sub_budget_button })
|
|
614
614
|
] }),
|
|
615
615
|
/* @__PURE__ */ e(j, { name: "chevron_right", size: 24, sx: { color: "primary.light" } })
|
|
616
616
|
] }) }) }) }),
|
|
617
|
-
/* @__PURE__ */ e(
|
|
617
|
+
/* @__PURE__ */ e(le, {}),
|
|
618
618
|
/* @__PURE__ */ e(
|
|
619
619
|
$,
|
|
620
620
|
{
|
|
621
|
-
ariaLabelClose:
|
|
622
|
-
isOpen:
|
|
621
|
+
ariaLabelClose: i.close_aria,
|
|
622
|
+
isOpen: r,
|
|
623
623
|
onClose: () => g(!1),
|
|
624
|
-
title:
|
|
625
|
-
children: /* @__PURE__ */ e(
|
|
624
|
+
title: c.add_sub_budget_title,
|
|
625
|
+
children: /* @__PURE__ */ e(K, { children: /* @__PURE__ */ e(rt, { category: t, subCategories: t.subCategories }) })
|
|
626
626
|
}
|
|
627
627
|
),
|
|
628
628
|
/* @__PURE__ */ e(
|
|
629
|
-
|
|
629
|
+
W,
|
|
630
630
|
{
|
|
631
|
-
copy: { close_aria:
|
|
632
|
-
disablePrimaryButton: Number(
|
|
631
|
+
copy: { close_aria: i.close_aria, title: c.add_title },
|
|
632
|
+
disablePrimaryButton: Number(y) <= 0,
|
|
633
633
|
isOpen: d,
|
|
634
634
|
onClose: () => u(!1),
|
|
635
|
-
onPrimaryAction:
|
|
636
|
-
primaryText:
|
|
635
|
+
onPrimaryAction: x,
|
|
636
|
+
primaryText: c.add_save_button,
|
|
637
637
|
children: /* @__PURE__ */ e(
|
|
638
|
-
|
|
638
|
+
ge,
|
|
639
639
|
{
|
|
640
|
-
amount:
|
|
641
|
-
categoryName:
|
|
642
|
-
onAmountChanged:
|
|
640
|
+
amount: y,
|
|
641
|
+
categoryName: h?.name || "",
|
|
642
|
+
onAmountChanged: p
|
|
643
643
|
}
|
|
644
644
|
)
|
|
645
645
|
}
|
|
646
646
|
)
|
|
647
647
|
] });
|
|
648
|
-
}),
|
|
649
|
-
const { category: n, subBudgets:
|
|
648
|
+
}), kt = I(({ budget: t }) => {
|
|
649
|
+
const { category: n, subBudgets: c } = t, { budgets: i, common: a } = E(), { deleteBudget: s, selectedSubBudget: o, setSelectedSubBudget: r, updateBudget: g } = w(), { filter: d, setFilter: u } = q(), [y, p] = l.useState(!1), [h, _] = l.useState(!1), [C, x] = l.useState("");
|
|
650
650
|
l.useEffect(() => {
|
|
651
|
-
o && (
|
|
651
|
+
o && (x(`${o.amount}`), u({
|
|
652
652
|
...d,
|
|
653
|
-
custom: (
|
|
653
|
+
custom: (f) => f.category_guid === o.category_guid
|
|
654
654
|
}));
|
|
655
655
|
}, [o]);
|
|
656
|
-
const
|
|
656
|
+
const v = async () => {
|
|
657
657
|
o && await g({
|
|
658
658
|
...o,
|
|
659
|
-
amount: Number(
|
|
659
|
+
amount: Number(C)
|
|
660
660
|
});
|
|
661
|
-
},
|
|
662
|
-
o && await
|
|
663
|
-
},
|
|
661
|
+
}, b = async () => {
|
|
662
|
+
o && await s(o.guid), _(!1), S();
|
|
663
|
+
}, S = () => {
|
|
664
664
|
u({
|
|
665
665
|
...d,
|
|
666
|
-
custom: (
|
|
667
|
-
}),
|
|
666
|
+
custom: (f) => f.category_guid === t.category_guid || f.top_level_category_guid === t.category_guid
|
|
667
|
+
}), r(void 0);
|
|
668
668
|
};
|
|
669
669
|
return /* @__PURE__ */ m(l.Fragment, { children: [
|
|
670
|
-
/* @__PURE__ */ m(
|
|
671
|
-
|
|
672
|
-
/* @__PURE__ */ e(
|
|
673
|
-
/* @__PURE__ */ e(
|
|
674
|
-
] },
|
|
675
|
-
/* @__PURE__ */ e(
|
|
670
|
+
/* @__PURE__ */ m(K, { sx: { bgcolor: "background.paper" }, children: [
|
|
671
|
+
c.length === 0 ? /* @__PURE__ */ e(Rt, {}) : c.map((f) => /* @__PURE__ */ m(l.Fragment, { children: [
|
|
672
|
+
/* @__PURE__ */ e(Lt, { budget: f }),
|
|
673
|
+
/* @__PURE__ */ e(le, {})
|
|
674
|
+
] }, f.guid)),
|
|
675
|
+
/* @__PURE__ */ e(Nt, { category: n, parentBudget: t })
|
|
676
676
|
] }),
|
|
677
677
|
/* @__PURE__ */ e(
|
|
678
678
|
$,
|
|
679
679
|
{
|
|
680
680
|
ariaLabelClose: a.close_aria,
|
|
681
681
|
isOpen: !!o,
|
|
682
|
-
onClose:
|
|
683
|
-
onPrimaryAction: () =>
|
|
684
|
-
onSecondaryAction: () =>
|
|
685
|
-
primaryText:
|
|
686
|
-
secondaryText:
|
|
687
|
-
title:
|
|
688
|
-
children: o && /* @__PURE__ */ m(
|
|
689
|
-
/* @__PURE__ */ e(
|
|
682
|
+
onClose: S,
|
|
683
|
+
onPrimaryAction: () => p(!0),
|
|
684
|
+
onSecondaryAction: () => _(!0),
|
|
685
|
+
primaryText: i.details_edit_button,
|
|
686
|
+
secondaryText: i.details_delete_button,
|
|
687
|
+
title: i.details_title,
|
|
688
|
+
children: o && /* @__PURE__ */ m(A, { gap: 24, children: [
|
|
689
|
+
/* @__PURE__ */ e(Ve, { budget: o }),
|
|
690
690
|
/* @__PURE__ */ e(Ae, { height: "100%" })
|
|
691
691
|
] })
|
|
692
692
|
}
|
|
693
693
|
),
|
|
694
694
|
o && /* @__PURE__ */ m(l.Fragment, { children: [
|
|
695
695
|
/* @__PURE__ */ e(
|
|
696
|
-
|
|
696
|
+
W,
|
|
697
697
|
{
|
|
698
|
-
copy: { close_aria: a.close_aria, title:
|
|
699
|
-
disablePrimaryButton: Number(
|
|
700
|
-
isOpen:
|
|
701
|
-
onClose: () =>
|
|
702
|
-
onPrimaryAction:
|
|
703
|
-
primaryText:
|
|
698
|
+
copy: { close_aria: a.close_aria, title: i.details_edit_title },
|
|
699
|
+
disablePrimaryButton: Number(C) <= 0,
|
|
700
|
+
isOpen: y,
|
|
701
|
+
onClose: () => p(!1),
|
|
702
|
+
onPrimaryAction: v,
|
|
703
|
+
primaryText: i.edit_save_button,
|
|
704
704
|
children: /* @__PURE__ */ e(
|
|
705
|
-
|
|
705
|
+
ge,
|
|
706
706
|
{
|
|
707
|
-
amount:
|
|
707
|
+
amount: C,
|
|
708
708
|
categoryName: o.category.name,
|
|
709
|
-
onAmountChanged:
|
|
709
|
+
onAmountChanged: x
|
|
710
710
|
}
|
|
711
711
|
)
|
|
712
712
|
}
|
|
713
713
|
),
|
|
714
714
|
/* @__PURE__ */ e(
|
|
715
|
-
|
|
715
|
+
W,
|
|
716
716
|
{
|
|
717
|
-
copy: { close_aria: a.close_aria, title:
|
|
718
|
-
isOpen:
|
|
719
|
-
onClose: () =>
|
|
720
|
-
onPrimaryAction:
|
|
717
|
+
copy: { close_aria: a.close_aria, title: i.delete_title },
|
|
718
|
+
isOpen: h,
|
|
719
|
+
onClose: () => _(!1),
|
|
720
|
+
onPrimaryAction: b,
|
|
721
721
|
primaryColor: "error",
|
|
722
722
|
primaryText: "Delete",
|
|
723
723
|
secondaryColor: "secondary",
|
|
724
|
-
children: /* @__PURE__ */ e(B, { variant: "subtitle1", children:
|
|
724
|
+
children: /* @__PURE__ */ e(B, { variant: "subtitle1", children: L(i.delete_description, o.category.name) })
|
|
725
725
|
}
|
|
726
726
|
)
|
|
727
727
|
] })
|
|
728
728
|
] });
|
|
729
|
-
}),
|
|
730
|
-
const { is_mobile_webview: n } =
|
|
729
|
+
}), $t = I(({ budget: t }) => {
|
|
730
|
+
const { is_mobile_webview: n } = Ne(), { setAlert: c } = w(), { budgets: i, common: a, transactions: s } = E(), { isDesktop: o, isSmallTablet: r, isTablet: g } = ue(), {
|
|
731
731
|
sortedTransactions: d,
|
|
732
732
|
sortedTransactionsWithSplits: u,
|
|
733
|
-
tags:
|
|
734
|
-
} =
|
|
735
|
-
() => d.find((
|
|
736
|
-
[
|
|
737
|
-
),
|
|
738
|
-
|
|
739
|
-
},
|
|
740
|
-
|
|
741
|
-
},
|
|
742
|
-
return /* @__PURE__ */ m(
|
|
743
|
-
/* @__PURE__ */ e(
|
|
744
|
-
/* @__PURE__ */ m(
|
|
733
|
+
tags: y
|
|
734
|
+
} = q(), [p, h] = l.useState(0), [_, C] = l.useState(""), x = l.useMemo(
|
|
735
|
+
() => d.find((f) => f.guid === _),
|
|
736
|
+
[_, d]
|
|
737
|
+
), v = (f, T) => {
|
|
738
|
+
h(T);
|
|
739
|
+
}, b = () => {
|
|
740
|
+
tt(u, y), c(i.alert_csv_downloaded);
|
|
741
|
+
}, S = d.length > 0 && !n && (o || g && !r);
|
|
742
|
+
return /* @__PURE__ */ m(A, { gap: 24, children: [
|
|
743
|
+
/* @__PURE__ */ e(Ve, { budget: t }),
|
|
744
|
+
/* @__PURE__ */ m(A, { children: [
|
|
745
745
|
/* @__PURE__ */ m(
|
|
746
|
-
|
|
746
|
+
et,
|
|
747
747
|
{
|
|
748
|
-
onChange:
|
|
748
|
+
onChange: v,
|
|
749
749
|
sx: { width: "100%" },
|
|
750
750
|
textColor: "primary",
|
|
751
|
-
value:
|
|
751
|
+
value: p,
|
|
752
752
|
variant: "fullWidth",
|
|
753
753
|
children: [
|
|
754
|
-
/* @__PURE__ */ e(
|
|
755
|
-
/* @__PURE__ */ e(
|
|
754
|
+
/* @__PURE__ */ e(Ee, { label: i.details_transactions_tab }),
|
|
755
|
+
/* @__PURE__ */ e(Ee, { label: i.details_subbudgets_tab })
|
|
756
756
|
]
|
|
757
757
|
}
|
|
758
758
|
),
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
759
|
+
p === 0 && /* @__PURE__ */ m(A, { children: [
|
|
760
|
+
S && /* @__PURE__ */ e(A, { direction: "row", justifyContent: "right", mb: -24, mr: 8, mt: 8, zIndex: 1, children: /* @__PURE__ */ e(
|
|
761
|
+
$e,
|
|
762
762
|
{
|
|
763
|
-
onClick:
|
|
763
|
+
onClick: b,
|
|
764
764
|
startIcon: /* @__PURE__ */ e(j, { name: "ios_share" }),
|
|
765
765
|
variant: "text",
|
|
766
|
-
children:
|
|
766
|
+
children: s.export_csv_btn
|
|
767
767
|
}
|
|
768
768
|
) }),
|
|
769
|
-
/* @__PURE__ */ e(Ae, { height: "100%", onClick:
|
|
769
|
+
/* @__PURE__ */ e(Ae, { height: "100%", onClick: C })
|
|
770
770
|
] }),
|
|
771
|
-
|
|
771
|
+
p === 1 && /* @__PURE__ */ e(kt, { budget: t }),
|
|
772
772
|
/* @__PURE__ */ e(
|
|
773
773
|
$,
|
|
774
774
|
{
|
|
775
775
|
ariaLabelClose: a.close_aria,
|
|
776
|
-
isOpen: !!
|
|
777
|
-
onClose: () =>
|
|
778
|
-
title:
|
|
779
|
-
children:
|
|
776
|
+
isOpen: !!x,
|
|
777
|
+
onClose: () => C(""),
|
|
778
|
+
title: i.details_transaction_drawer,
|
|
779
|
+
children: x && /* @__PURE__ */ e(ot, { transaction: x })
|
|
780
780
|
}
|
|
781
781
|
)
|
|
782
782
|
] })
|
|
783
783
|
] });
|
|
784
|
-
}),
|
|
785
|
-
const { selectedAccountGuids: t } =
|
|
786
|
-
alert:
|
|
784
|
+
}), Gt = I(() => {
|
|
785
|
+
const { selectedAccountGuids: t } = Z(), { budgets: n, common: c } = E(), {
|
|
786
|
+
alert: i,
|
|
787
787
|
dateRange: a,
|
|
788
|
-
deleteBudget:
|
|
788
|
+
deleteBudget: s,
|
|
789
789
|
selectedBudget: o,
|
|
790
|
-
selectedSubBudget:
|
|
790
|
+
selectedSubBudget: r,
|
|
791
791
|
setAlert: g,
|
|
792
792
|
setSelectedBudget: d,
|
|
793
793
|
updateBudget: u
|
|
794
|
-
} =
|
|
794
|
+
} = w(), { setFilter: y } = q(), [p, h] = l.useState(!1), [_, C] = l.useState(!1), [x, v] = l.useState(!1), [b, S] = l.useState("");
|
|
795
795
|
l.useEffect(() => {
|
|
796
|
-
o && !
|
|
796
|
+
o && !r && (S(`${o.amount}`), h(!0), y({
|
|
797
797
|
accounts: t,
|
|
798
798
|
dateRange: a,
|
|
799
799
|
custom: (O) => O.category_guid === o.category_guid || O.top_level_category_guid === o.category_guid,
|
|
800
800
|
showSplits: !0
|
|
801
801
|
}));
|
|
802
802
|
}, [o]);
|
|
803
|
-
const
|
|
803
|
+
const f = async () => {
|
|
804
804
|
o && (await u({
|
|
805
805
|
...o,
|
|
806
|
-
amount: Number(
|
|
807
|
-
percentage: o.category.totalAmount / Number(
|
|
808
|
-
}),
|
|
809
|
-
},
|
|
810
|
-
o && (await
|
|
811
|
-
},
|
|
812
|
-
|
|
806
|
+
amount: Number(b),
|
|
807
|
+
percentage: o.category.totalAmount / Number(b) * 100
|
|
808
|
+
}), C(!1), g(L(n.alert_budget_updated, o.category.name)));
|
|
809
|
+
}, T = async () => {
|
|
810
|
+
o && (await s(o.guid), g(L(n.alert_budget_deleted, o.category.name))), N();
|
|
811
|
+
}, N = () => {
|
|
812
|
+
h(!1), setTimeout(() => {
|
|
813
813
|
d(void 0);
|
|
814
814
|
}, 250);
|
|
815
|
-
},
|
|
816
|
-
|
|
815
|
+
}, R = () => {
|
|
816
|
+
C(!1), S(`${o?.amount}`);
|
|
817
817
|
};
|
|
818
818
|
if (o)
|
|
819
819
|
return /* @__PURE__ */ m(l.Fragment, { children: [
|
|
820
820
|
/* @__PURE__ */ m(
|
|
821
821
|
$,
|
|
822
822
|
{
|
|
823
|
-
ariaLabelClose:
|
|
824
|
-
isOpen:
|
|
825
|
-
onClose:
|
|
826
|
-
onPrimaryAction: () =>
|
|
827
|
-
onSecondaryAction: () =>
|
|
823
|
+
ariaLabelClose: c.close_aria,
|
|
824
|
+
isOpen: p,
|
|
825
|
+
onClose: N,
|
|
826
|
+
onPrimaryAction: () => C(!0),
|
|
827
|
+
onSecondaryAction: () => v(!0),
|
|
828
828
|
primaryText: n.details_edit_button,
|
|
829
829
|
secondaryColor: "error",
|
|
830
830
|
secondaryText: n.details_delete_button,
|
|
831
831
|
title: n.details_title,
|
|
832
832
|
children: [
|
|
833
|
-
/* @__PURE__ */ e(
|
|
833
|
+
/* @__PURE__ */ e($t, { budget: o }),
|
|
834
834
|
/* @__PURE__ */ e(
|
|
835
835
|
xe,
|
|
836
836
|
{
|
|
837
837
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
838
838
|
autoHideDuration: 3500,
|
|
839
839
|
onClose: () => g(""),
|
|
840
|
-
open: !!
|
|
841
|
-
children: /* @__PURE__ */ e(Se, { closeText: "", onClose: () => g(""), severity: "success", variant: "filled", children:
|
|
840
|
+
open: !!i,
|
|
841
|
+
children: /* @__PURE__ */ e(Se, { closeText: "", onClose: () => g(""), severity: "success", variant: "filled", children: i })
|
|
842
842
|
}
|
|
843
843
|
)
|
|
844
844
|
]
|
|
845
845
|
}
|
|
846
846
|
),
|
|
847
847
|
/* @__PURE__ */ e(
|
|
848
|
-
|
|
848
|
+
W,
|
|
849
849
|
{
|
|
850
|
-
copy: { close_aria:
|
|
851
|
-
disablePrimaryButton: Number(
|
|
852
|
-
isOpen:
|
|
853
|
-
onClose:
|
|
854
|
-
onPrimaryAction:
|
|
855
|
-
onSecondaryAction:
|
|
850
|
+
copy: { close_aria: c.close_aria, title: n.details_edit_title },
|
|
851
|
+
disablePrimaryButton: Number(b) <= 0,
|
|
852
|
+
isOpen: _,
|
|
853
|
+
onClose: R,
|
|
854
|
+
onPrimaryAction: f,
|
|
855
|
+
onSecondaryAction: R,
|
|
856
856
|
primaryText: n.edit_save_button,
|
|
857
857
|
children: /* @__PURE__ */ e(
|
|
858
|
-
|
|
858
|
+
ge,
|
|
859
859
|
{
|
|
860
|
-
amount:
|
|
860
|
+
amount: b,
|
|
861
861
|
categoryName: o.category.name,
|
|
862
|
-
onAmountChanged:
|
|
862
|
+
onAmountChanged: S
|
|
863
863
|
}
|
|
864
864
|
)
|
|
865
865
|
}
|
|
866
866
|
),
|
|
867
867
|
/* @__PURE__ */ e(
|
|
868
|
-
|
|
868
|
+
W,
|
|
869
869
|
{
|
|
870
|
-
copy: { close_aria:
|
|
871
|
-
isOpen:
|
|
872
|
-
onClose: () =>
|
|
873
|
-
onPrimaryAction:
|
|
870
|
+
copy: { close_aria: c.close_aria, title: n.delete_title },
|
|
871
|
+
isOpen: x,
|
|
872
|
+
onClose: () => v(!1),
|
|
873
|
+
onPrimaryAction: T,
|
|
874
874
|
primaryColor: "error",
|
|
875
875
|
primaryText: n.details_delete_button,
|
|
876
876
|
secondaryColor: "secondary",
|
|
877
|
-
children: /* @__PURE__ */ e(B, { variant: "subtitle1", children:
|
|
877
|
+
children: /* @__PURE__ */ e(B, { variant: "subtitle1", children: L(n.delete_description, o.category.name) })
|
|
878
878
|
}
|
|
879
879
|
)
|
|
880
880
|
] });
|
|
881
|
-
}),
|
|
881
|
+
}), Pt = ({ budget: t, onClick: n }) => {
|
|
882
882
|
const {
|
|
883
|
-
amount:
|
|
884
|
-
budgetColors: { background:
|
|
885
|
-
category_guid:
|
|
883
|
+
amount: c,
|
|
884
|
+
budgetColors: { background: i, description: a },
|
|
885
|
+
category_guid: s,
|
|
886
886
|
description: o,
|
|
887
|
-
percentage:
|
|
887
|
+
percentage: r,
|
|
888
888
|
subBudgets: g,
|
|
889
889
|
transaction_total: d
|
|
890
|
-
} = t, u =
|
|
891
|
-
return /* @__PURE__ */ e(
|
|
892
|
-
/* @__PURE__ */ e(
|
|
890
|
+
} = t, u = r > 100;
|
|
891
|
+
return /* @__PURE__ */ e(J, { children: /* @__PURE__ */ m(Q, { onClick: () => n?.(t), children: [
|
|
892
|
+
/* @__PURE__ */ e(de, { sx: { mb: -8, mr: 16 }, children: /* @__PURE__ */ e(Pe, { color: i, percent: r, size: 40, children: /* @__PURE__ */ e(H, { categoryGuid: s, variant: "basic" }) }) }),
|
|
893
893
|
/* @__PURE__ */ e(
|
|
894
|
-
|
|
894
|
+
ee,
|
|
895
895
|
{
|
|
896
|
-
primary: /* @__PURE__ */ m(
|
|
896
|
+
primary: /* @__PURE__ */ m(A, { component: "span", direction: "row", justifyContent: "space-between", children: [
|
|
897
897
|
/* @__PURE__ */ e(B, { bold: !0, variant: "body1", children: t.category.name }),
|
|
898
898
|
/* @__PURE__ */ e(B, { fontWeight: 400, variant: "body1", children: `
|
|
899
|
-
${
|
|
900
|
-
${
|
|
899
|
+
${D(d, "0,0")} /
|
|
900
|
+
${D(c, "0,0")}
|
|
901
901
|
` })
|
|
902
902
|
] }),
|
|
903
|
-
secondary: /* @__PURE__ */ m(
|
|
903
|
+
secondary: /* @__PURE__ */ m(A, { component: "span", direction: "row", justifyContent: "space-between", children: [
|
|
904
904
|
/* @__PURE__ */ e(B, { variant: "caption", children: `${g.length} Sub-budgets` }),
|
|
905
905
|
/* @__PURE__ */ e(
|
|
906
906
|
B,
|
|
@@ -922,86 +922,86 @@ const wt = ({
|
|
|
922
922
|
}
|
|
923
923
|
)
|
|
924
924
|
] }) });
|
|
925
|
-
},
|
|
926
|
-
const { onEvent: t } =
|
|
927
|
-
s
|
|
928
|
-
budget_category:
|
|
925
|
+
}, jt = I(() => {
|
|
926
|
+
const { onEvent: t } = X(), { budgets: n } = E(), { detailedBudgets: c, setSelectedBudget: i } = w(), a = (s) => {
|
|
927
|
+
i(s), t(G.BUDGETS_CLICK_BUDGET_CATEGORY, {
|
|
928
|
+
budget_category: s.category.name,
|
|
929
929
|
click_type: "list"
|
|
930
930
|
});
|
|
931
931
|
};
|
|
932
932
|
return /* @__PURE__ */ m(ve, { elevation: 2, children: [
|
|
933
|
-
/* @__PURE__ */ e(
|
|
934
|
-
/* @__PURE__ */ e(Te, { sx: { p: 0, ":last-child": { p: 0 } }, children: /* @__PURE__ */ e(
|
|
935
|
-
/* @__PURE__ */ e(
|
|
936
|
-
/* @__PURE__ */ e(
|
|
937
|
-
] },
|
|
933
|
+
/* @__PURE__ */ e(je, { sx: { pb: 8, pl: 24 }, title: /* @__PURE__ */ e(Le, { children: n.budget_categories_title }) }),
|
|
934
|
+
/* @__PURE__ */ e(Te, { sx: { p: 0, ":last-child": { p: 0 } }, children: /* @__PURE__ */ e(K, { children: c.map((s) => /* @__PURE__ */ m(l.Fragment, { children: [
|
|
935
|
+
/* @__PURE__ */ e(Pt, { budget: s, onClick: a }),
|
|
936
|
+
/* @__PURE__ */ e(le, {})
|
|
937
|
+
] }, s.guid)) }) })
|
|
938
938
|
] });
|
|
939
|
-
}),
|
|
940
|
-
const t =
|
|
941
|
-
const
|
|
942
|
-
let
|
|
943
|
-
|
|
944
|
-
let
|
|
945
|
-
|
|
946
|
-
const
|
|
939
|
+
}), zt = I(() => {
|
|
940
|
+
const t = se(), { onEvent: n } = X(), { visibleAccounts: c } = ke(), { budgets: i, common: a, recurring: s } = E(), { incomeCategories: o, spendCategories: r } = Y(), { detailedBudgets: g, totalBudgeted: d } = w(), { incomeTotal: u } = ie(), { setFilter: y } = q(), [p, h] = l.useState(!1), [_, C] = l.useMemo(() => {
|
|
941
|
+
const S = r.reduce((R, O) => R + O.totalAmount, 0);
|
|
942
|
+
let f = S / d;
|
|
943
|
+
f > 1 && (f = 1);
|
|
944
|
+
let T = t.palette.success.main;
|
|
945
|
+
f > 0.8 && f < 1 ? T = t.palette.warning.main : f >= 1 && (T = t.palette.error.main);
|
|
946
|
+
const N = [
|
|
947
947
|
{
|
|
948
|
-
color:
|
|
949
|
-
percentage: `${
|
|
948
|
+
color: T,
|
|
949
|
+
percentage: `${f}`
|
|
950
950
|
}
|
|
951
951
|
];
|
|
952
|
-
return [
|
|
953
|
-
}, [g,
|
|
954
|
-
const
|
|
955
|
-
o.reduce((
|
|
952
|
+
return [S, N];
|
|
953
|
+
}, [g, r]), [x, v] = l.useMemo(() => {
|
|
954
|
+
const S = Math.abs(
|
|
955
|
+
o.reduce((N, R) => N + R.totalAmount, 0)
|
|
956
956
|
);
|
|
957
|
-
let
|
|
958
|
-
|
|
959
|
-
const
|
|
957
|
+
let f = S / u;
|
|
958
|
+
f > 1 && (f = 1);
|
|
959
|
+
const T = [
|
|
960
960
|
{
|
|
961
961
|
color: t.palette.secondary.main,
|
|
962
|
-
percentage: `${
|
|
962
|
+
percentage: `${f}`
|
|
963
963
|
}
|
|
964
964
|
];
|
|
965
|
-
return [
|
|
966
|
-
}, [o, u]),
|
|
967
|
-
|
|
968
|
-
accounts:
|
|
965
|
+
return [S, T];
|
|
966
|
+
}, [o, u]), b = () => {
|
|
967
|
+
y({
|
|
968
|
+
accounts: c.map((S) => S.guid),
|
|
969
969
|
dateRange: {
|
|
970
|
-
start:
|
|
970
|
+
start: st(/* @__PURE__ */ new Date(), 90),
|
|
971
971
|
end: /* @__PURE__ */ new Date()
|
|
972
972
|
}
|
|
973
|
-
}),
|
|
973
|
+
}), h(!0), n(G.BUDGETS_CLICK_EDIT_INCOME);
|
|
974
974
|
};
|
|
975
975
|
return /* @__PURE__ */ m(ve, { elevation: 2, sx: { overflow: "visible" }, children: [
|
|
976
|
-
/* @__PURE__ */ e(
|
|
977
|
-
/* @__PURE__ */ e(Te, { sx: { pt: 12, px: 24 }, children: /* @__PURE__ */ m(
|
|
978
|
-
/* @__PURE__ */ m(
|
|
979
|
-
/* @__PURE__ */ e(B, { bold: !0, sx: { mb: 8 }, variant: "body1", children:
|
|
980
|
-
/* @__PURE__ */ e(Be, { data:
|
|
981
|
-
/* @__PURE__ */ e(B, { variant: "body2", children:
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
976
|
+
/* @__PURE__ */ e(je, { sx: { pb: 8, pl: 24 }, title: /* @__PURE__ */ e(Le, { children: i.overview_title }) }),
|
|
977
|
+
/* @__PURE__ */ e(Te, { sx: { pt: 12, px: 24 }, children: /* @__PURE__ */ m(A, { gap: 24, children: [
|
|
978
|
+
/* @__PURE__ */ m(A, { gap: 8, children: [
|
|
979
|
+
/* @__PURE__ */ e(B, { bold: !0, sx: { mb: 8 }, variant: "body1", children: i.spending_title }),
|
|
980
|
+
/* @__PURE__ */ e(Be, { data: C, height: 16 }),
|
|
981
|
+
/* @__PURE__ */ e(B, { variant: "body2", children: L(
|
|
982
|
+
i.spending_description,
|
|
983
|
+
D(_, "0,0"),
|
|
984
|
+
D(d, "0,0")
|
|
985
985
|
) })
|
|
986
986
|
] }),
|
|
987
|
-
/* @__PURE__ */ m(
|
|
988
|
-
/* @__PURE__ */ m(
|
|
989
|
-
/* @__PURE__ */ e(B, { bold: !0, variant: "body1", children:
|
|
987
|
+
/* @__PURE__ */ m(A, { gap: 8, children: [
|
|
988
|
+
/* @__PURE__ */ m(A, { alignItems: "center", direction: "row", gap: 4, mb: -4, children: [
|
|
989
|
+
/* @__PURE__ */ e(B, { bold: !0, variant: "body1", children: i.income_title }),
|
|
990
990
|
/* @__PURE__ */ e(
|
|
991
|
-
|
|
991
|
+
it,
|
|
992
992
|
{
|
|
993
|
-
"aria-label":
|
|
994
|
-
onClick:
|
|
993
|
+
"aria-label": s.manage_income,
|
|
994
|
+
onClick: b,
|
|
995
995
|
sx: { p: 0 },
|
|
996
996
|
children: /* @__PURE__ */ e(j, { color: "primary", name: "edit" })
|
|
997
997
|
}
|
|
998
998
|
)
|
|
999
999
|
] }),
|
|
1000
|
-
/* @__PURE__ */ e(Be, { data:
|
|
1001
|
-
/* @__PURE__ */ e(B, { variant: "body2", children:
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1000
|
+
/* @__PURE__ */ e(Be, { data: v, height: 16 }),
|
|
1001
|
+
/* @__PURE__ */ e(B, { variant: "body2", children: L(
|
|
1002
|
+
i.income_description,
|
|
1003
|
+
D(x, "0,0"),
|
|
1004
|
+
D(u, "0,0")
|
|
1005
1005
|
) })
|
|
1006
1006
|
] })
|
|
1007
1007
|
] }) }),
|
|
@@ -1009,114 +1009,114 @@ const wt = ({
|
|
|
1009
1009
|
$,
|
|
1010
1010
|
{
|
|
1011
1011
|
ariaLabelClose: a.close_aria,
|
|
1012
|
-
isOpen:
|
|
1013
|
-
onClose: () =>
|
|
1014
|
-
title:
|
|
1015
|
-
children: /* @__PURE__ */ e(
|
|
1012
|
+
isOpen: p,
|
|
1013
|
+
onClose: () => h(!1),
|
|
1014
|
+
title: s.manage_income,
|
|
1015
|
+
children: /* @__PURE__ */ e(ct, { forOverview: !0 })
|
|
1016
1016
|
}
|
|
1017
1017
|
)
|
|
1018
1018
|
] });
|
|
1019
|
-
}),
|
|
1020
|
-
const
|
|
1019
|
+
}), Re = 480, Ho = I(({ onBackClick: t, sx: n }) => {
|
|
1020
|
+
const c = se(), { onEvent: i } = X(), { visibleAccounts: a } = ke(), { budgets: s, common: o } = E(), { isInitialized: r, selectedAccounts: g, setDisplayedDate: d } = Z(), {
|
|
1021
1021
|
alert: u,
|
|
1022
|
-
dateRange:
|
|
1023
|
-
isDataLoaded:
|
|
1024
|
-
loadBudgetData:
|
|
1025
|
-
setDateRange:
|
|
1026
|
-
setAlert:
|
|
1027
|
-
setTheme:
|
|
1028
|
-
detailedBudgets:
|
|
1029
|
-
} =
|
|
1030
|
-
|
|
1022
|
+
dateRange: y,
|
|
1023
|
+
isDataLoaded: p,
|
|
1024
|
+
loadBudgetData: h,
|
|
1025
|
+
setDateRange: _,
|
|
1026
|
+
setAlert: C,
|
|
1027
|
+
setTheme: x,
|
|
1028
|
+
detailedBudgets: v
|
|
1029
|
+
} = w(), { setDateRange: b } = ie(), { loadDateRangeCategoryTotals: S, loadMonthlyCategoryTotals: f } = Y(), { isSmallTablet: T, isMobile: N, isSmallMobile: R } = ue(), O = T || N || R, [z, k] = l.useState(!1);
|
|
1030
|
+
ze({
|
|
1031
1031
|
widgetName: "BubbleBudgetsWidget",
|
|
1032
|
-
isLoaded:
|
|
1032
|
+
isLoaded: p
|
|
1033
1033
|
}), l.useEffect(() => {
|
|
1034
|
-
|
|
1035
|
-
|
|
1034
|
+
x(c), p || h().finally(() => {
|
|
1035
|
+
i(G.BUDGETS_VIEW);
|
|
1036
1036
|
});
|
|
1037
|
-
}, []), l.useEffect(() => (
|
|
1038
|
-
|
|
1037
|
+
}, []), l.useEffect(() => (_({ start: ae(oe()), end: Ce(oe()) }), () => {
|
|
1038
|
+
_({ start: ae(oe()), end: Ce(oe()) });
|
|
1039
1039
|
}), [a]), l.useEffect(() => {
|
|
1040
|
-
|
|
1041
|
-
}, [
|
|
1042
|
-
const
|
|
1043
|
-
|
|
1040
|
+
r && (d(y.start, y.end), S(g, y.start, y.end).finally(), f(g).finally(), b(y));
|
|
1041
|
+
}, [r, g, y]);
|
|
1042
|
+
const pe = (F) => {
|
|
1043
|
+
_({ start: F[0] || /* @__PURE__ */ new Date(), end: F[1] || /* @__PURE__ */ new Date() });
|
|
1044
|
+
}, he = () => {
|
|
1045
|
+
i(G.BUDGETS_CLICK_FILTER);
|
|
1046
|
+
}, te = () => {
|
|
1047
|
+
k(!0), i(G.BUDGETS_CLICK_ADD);
|
|
1044
1048
|
}, be = () => {
|
|
1045
|
-
s(G.BUDGETS_CLICK_FILTER);
|
|
1046
|
-
}, oe = () => {
|
|
1047
|
-
k(!0), s(G.BUDGETS_CLICK_ADD);
|
|
1048
|
-
}, fe = () => {
|
|
1049
1049
|
k(!1);
|
|
1050
|
-
},
|
|
1050
|
+
}, fe = () => {
|
|
1051
1051
|
k(!1);
|
|
1052
|
-
},
|
|
1053
|
-
return !
|
|
1054
|
-
|
|
1052
|
+
}, P = Ye(y.end, ae(/* @__PURE__ */ new Date()));
|
|
1053
|
+
return !r || !p ? /* @__PURE__ */ e(me, {}) : /* @__PURE__ */ m(
|
|
1054
|
+
lt,
|
|
1055
1055
|
{
|
|
1056
1056
|
actions: [
|
|
1057
1057
|
{
|
|
1058
1058
|
iconName: "add",
|
|
1059
|
-
label:
|
|
1060
|
-
onClick:
|
|
1059
|
+
label: s.add_title,
|
|
1060
|
+
onClick: te
|
|
1061
1061
|
}
|
|
1062
1062
|
],
|
|
1063
1063
|
calendarActions: {
|
|
1064
|
-
onRangeChanged:
|
|
1065
|
-
shouldDisableNext:
|
|
1064
|
+
onRangeChanged: pe,
|
|
1065
|
+
shouldDisableNext: P,
|
|
1066
1066
|
shouldDisablePicker: !0
|
|
1067
1067
|
},
|
|
1068
|
-
onAccountsFilterClick:
|
|
1068
|
+
onAccountsFilterClick: he,
|
|
1069
1069
|
onBackClick: t,
|
|
1070
1070
|
sx: n,
|
|
1071
|
-
title:
|
|
1071
|
+
title: s.budgets_title,
|
|
1072
1072
|
children: [
|
|
1073
1073
|
/* @__PURE__ */ m(
|
|
1074
|
-
|
|
1074
|
+
A,
|
|
1075
1075
|
{
|
|
1076
1076
|
direction: O ? "column" : "row",
|
|
1077
1077
|
height: "100%",
|
|
1078
1078
|
sx: { justifyContent: "center" },
|
|
1079
1079
|
width: "100%",
|
|
1080
1080
|
children: [
|
|
1081
|
-
/* @__PURE__ */ e(
|
|
1082
|
-
|
|
1081
|
+
/* @__PURE__ */ e(A, { height: O ? 450 : "calc(100dvh - 150px)", children: /* @__PURE__ */ e(
|
|
1082
|
+
He,
|
|
1083
1083
|
{
|
|
1084
|
-
createBudgetOnClick:
|
|
1084
|
+
createBudgetOnClick: te,
|
|
1085
1085
|
height: O ? 450 : 800,
|
|
1086
1086
|
isDraggable: !0,
|
|
1087
|
-
shouldShowZeroState:
|
|
1088
|
-
unavailableWidth: O ? 0 :
|
|
1087
|
+
shouldShowZeroState: v.length === 0,
|
|
1088
|
+
unavailableWidth: O ? 0 : Re
|
|
1089
1089
|
}
|
|
1090
1090
|
) }),
|
|
1091
|
-
|
|
1092
|
-
|
|
1091
|
+
v.length !== 0 && /* @__PURE__ */ m(
|
|
1092
|
+
A,
|
|
1093
1093
|
{
|
|
1094
1094
|
gap: 24,
|
|
1095
1095
|
height: "100%",
|
|
1096
1096
|
sx: { mr: 24, mt: 48 },
|
|
1097
|
-
width: O ? "100%" :
|
|
1097
|
+
width: O ? "100%" : Re,
|
|
1098
1098
|
children: [
|
|
1099
|
-
/* @__PURE__ */ e(
|
|
1100
|
-
/* @__PURE__ */ e(
|
|
1099
|
+
/* @__PURE__ */ e(zt, {}),
|
|
1100
|
+
/* @__PURE__ */ e(jt, {})
|
|
1101
1101
|
]
|
|
1102
1102
|
}
|
|
1103
1103
|
)
|
|
1104
1104
|
]
|
|
1105
1105
|
}
|
|
1106
1106
|
),
|
|
1107
|
-
/* @__PURE__ */ e(
|
|
1107
|
+
/* @__PURE__ */ e(Gt, {}),
|
|
1108
1108
|
/* @__PURE__ */ e(
|
|
1109
1109
|
$,
|
|
1110
1110
|
{
|
|
1111
1111
|
ariaLabelClose: o.close_aria,
|
|
1112
1112
|
isOpen: z,
|
|
1113
1113
|
onClose: () => k(!1),
|
|
1114
|
-
title:
|
|
1114
|
+
title: s.add_new_title,
|
|
1115
1115
|
children: /* @__PURE__ */ e(
|
|
1116
|
-
|
|
1116
|
+
Fe,
|
|
1117
1117
|
{
|
|
1118
|
-
onAddBudget:
|
|
1119
|
-
onRecalculateBudgets:
|
|
1118
|
+
onAddBudget: be,
|
|
1119
|
+
onRecalculateBudgets: fe
|
|
1120
1120
|
}
|
|
1121
1121
|
)
|
|
1122
1122
|
}
|
|
@@ -1127,7 +1127,7 @@ const wt = ({
|
|
|
1127
1127
|
anchorOrigin: { vertical: "bottom", horizontal: "right" },
|
|
1128
1128
|
autoHideDuration: 3500,
|
|
1129
1129
|
onClose: () => {
|
|
1130
|
-
|
|
1130
|
+
C("");
|
|
1131
1131
|
},
|
|
1132
1132
|
open: !!u,
|
|
1133
1133
|
children: /* @__PURE__ */ e(
|
|
@@ -1135,7 +1135,7 @@ const wt = ({
|
|
|
1135
1135
|
{
|
|
1136
1136
|
closeText: "",
|
|
1137
1137
|
onClose: () => {
|
|
1138
|
-
|
|
1138
|
+
C("");
|
|
1139
1139
|
},
|
|
1140
1140
|
severity: "success",
|
|
1141
1141
|
variant: "filled",
|
|
@@ -1147,88 +1147,88 @@ const wt = ({
|
|
|
1147
1147
|
]
|
|
1148
1148
|
}
|
|
1149
1149
|
);
|
|
1150
|
-
}),
|
|
1150
|
+
}), Ft = ({
|
|
1151
1151
|
budgetsCopy: t,
|
|
1152
1152
|
difference: n,
|
|
1153
|
-
handleAddClick:
|
|
1154
|
-
shouldShowZeroState:
|
|
1153
|
+
handleAddClick: c,
|
|
1154
|
+
shouldShowZeroState: i
|
|
1155
1155
|
}) => {
|
|
1156
|
-
const { availableHeight: a = 0 } =
|
|
1156
|
+
const { availableHeight: a = 0 } = ce(), s = l.useRef(null);
|
|
1157
1157
|
l.useEffect(() => {
|
|
1158
|
-
a > 0 &&
|
|
1158
|
+
a > 0 && s.current === null && (s.current = a);
|
|
1159
1159
|
}, [a]);
|
|
1160
1160
|
const o = l.useMemo(() => {
|
|
1161
|
-
const
|
|
1162
|
-
return
|
|
1161
|
+
const r = s.current ?? a;
|
|
1162
|
+
return r > 0 ? Math.round(Math.max(120, Math.min(450, r * 0.8))) - 40 : 450;
|
|
1163
1163
|
}, [a]);
|
|
1164
|
-
return /* @__PURE__ */ m(
|
|
1164
|
+
return /* @__PURE__ */ m(A, { sx: { height: "100%", justifyContent: "space-between" }, children: [
|
|
1165
1165
|
/* @__PURE__ */ e(
|
|
1166
|
-
|
|
1166
|
+
He,
|
|
1167
1167
|
{
|
|
1168
|
-
createBudgetOnClick:
|
|
1168
|
+
createBudgetOnClick: c,
|
|
1169
1169
|
height: o,
|
|
1170
1170
|
isMiniWidget: !0,
|
|
1171
|
-
shouldShowZeroState:
|
|
1171
|
+
shouldShowZeroState: i
|
|
1172
1172
|
}
|
|
1173
1173
|
),
|
|
1174
|
-
!
|
|
1175
|
-
/* @__PURE__ */ e(B, { bold: !0, color: n < 0 ? "error.main" : "success.main", children:
|
|
1174
|
+
!i && /* @__PURE__ */ m(V, { ml: 16, children: [
|
|
1175
|
+
/* @__PURE__ */ e(B, { bold: !0, color: n < 0 ? "error.main" : "success.main", children: D(Math.abs(n), "0,0") }),
|
|
1176
1176
|
/* @__PURE__ */ e(B, { children: n < 0 ? t.overspent_in_budgets : t.left_in_budgets })
|
|
1177
1177
|
] })
|
|
1178
1178
|
] });
|
|
1179
|
-
},
|
|
1180
|
-
const n =
|
|
1179
|
+
}, Ut = (t) => {
|
|
1180
|
+
const n = se(), { onEvent: c } = X(), { detailedBudgets: i, isDataLoaded: a, loadBudgetData: s, setTheme: o } = w(), { budgets: r, common: g } = E(), { isInitialized: d, selectedAccounts: u } = Z(), { loadDateRangeCategoryTotals: y, loadMonthlyCategoryTotals: p } = Y(), h = dt(), [_, C] = l.useState(!1);
|
|
1181
1181
|
l.useEffect(() => {
|
|
1182
|
-
a ||
|
|
1182
|
+
a || s().finally();
|
|
1183
1183
|
}, []), l.useEffect(() => {
|
|
1184
1184
|
o(n);
|
|
1185
1185
|
}, [n]), l.useEffect(() => {
|
|
1186
|
-
d && !a && (
|
|
1186
|
+
d && !a && (y(
|
|
1187
1187
|
u,
|
|
1188
|
-
|
|
1188
|
+
ae(/* @__PURE__ */ new Date()),
|
|
1189
1189
|
Ce(/* @__PURE__ */ new Date())
|
|
1190
|
-
).finally(),
|
|
1190
|
+
).finally(), p(u).finally());
|
|
1191
1191
|
}, [d, u, a]);
|
|
1192
|
-
const
|
|
1193
|
-
|
|
1194
|
-
},
|
|
1195
|
-
|
|
1196
|
-
},
|
|
1197
|
-
if (
|
|
1192
|
+
const x = () => {
|
|
1193
|
+
C(!0), c(G.BUDGETS_CLICK_ADD);
|
|
1194
|
+
}, v = () => {
|
|
1195
|
+
C(!1);
|
|
1196
|
+
}, b = () => C(!1);
|
|
1197
|
+
if (ze({
|
|
1198
1198
|
widgetName: "BubbleBudgetsMiniWidget",
|
|
1199
1199
|
isLoaded: a
|
|
1200
|
-
}), !d || !a) return /* @__PURE__ */ e(
|
|
1201
|
-
const
|
|
1200
|
+
}), !d || !a) return /* @__PURE__ */ e(me, {});
|
|
1201
|
+
const S = i.length === 0;
|
|
1202
1202
|
return /* @__PURE__ */ m(
|
|
1203
|
-
|
|
1203
|
+
gt,
|
|
1204
1204
|
{
|
|
1205
1205
|
contentStyles: { height: "calc(100% - 66px)", ":last-child": { pb: 0 } },
|
|
1206
|
-
primaryCtaLabel:
|
|
1206
|
+
primaryCtaLabel: S ? r.get_started_cta : r.details_cta,
|
|
1207
1207
|
sx: { height: "100%" },
|
|
1208
|
-
title:
|
|
1208
|
+
title: r.budgets_title,
|
|
1209
1209
|
...t,
|
|
1210
1210
|
children: [
|
|
1211
1211
|
/* @__PURE__ */ e(
|
|
1212
|
-
|
|
1212
|
+
Ft,
|
|
1213
1213
|
{
|
|
1214
|
-
budgetsCopy:
|
|
1215
|
-
difference:
|
|
1216
|
-
handleAddClick:
|
|
1217
|
-
shouldShowZeroState:
|
|
1214
|
+
budgetsCopy: r,
|
|
1215
|
+
difference: h,
|
|
1216
|
+
handleAddClick: x,
|
|
1217
|
+
shouldShowZeroState: S
|
|
1218
1218
|
}
|
|
1219
1219
|
),
|
|
1220
1220
|
/* @__PURE__ */ e(
|
|
1221
1221
|
$,
|
|
1222
1222
|
{
|
|
1223
1223
|
ariaLabelClose: g.close_aria,
|
|
1224
|
-
isOpen:
|
|
1225
|
-
onClose: () =>
|
|
1226
|
-
title:
|
|
1224
|
+
isOpen: _,
|
|
1225
|
+
onClose: () => C(!1),
|
|
1226
|
+
title: r.add_new_title,
|
|
1227
1227
|
children: /* @__PURE__ */ e(
|
|
1228
|
-
|
|
1228
|
+
Fe,
|
|
1229
1229
|
{
|
|
1230
|
-
onAddBudget:
|
|
1231
|
-
onRecalculateBudgets:
|
|
1230
|
+
onAddBudget: v,
|
|
1231
|
+
onRecalculateBudgets: b
|
|
1232
1232
|
}
|
|
1233
1233
|
)
|
|
1234
1234
|
}
|
|
@@ -1236,55 +1236,60 @@ const wt = ({
|
|
|
1236
1236
|
]
|
|
1237
1237
|
}
|
|
1238
1238
|
);
|
|
1239
|
-
},
|
|
1239
|
+
}, Vo = I(Ut), ne = {
|
|
1240
1240
|
CANCEL_DELETE: "Cancel - Delete",
|
|
1241
1241
|
END_SAVE: "End - Save",
|
|
1242
1242
|
END_DELETE: "End - Delete",
|
|
1243
1243
|
START_DELETE: "Start - Delete"
|
|
1244
|
-
},
|
|
1244
|
+
}, Wt = ({
|
|
1245
|
+
onClose: t,
|
|
1246
|
+
onEvent: n,
|
|
1247
|
+
onViewHistory: c,
|
|
1248
|
+
transactionListProps: i
|
|
1249
|
+
}) => {
|
|
1245
1250
|
const {
|
|
1246
|
-
alert:
|
|
1247
|
-
dateRange:
|
|
1248
|
-
deleteBudget:
|
|
1249
|
-
selectedBudget:
|
|
1250
|
-
selectedSubBudget:
|
|
1251
|
-
setAlert:
|
|
1252
|
-
setSelectedBudget:
|
|
1253
|
-
updateBudget:
|
|
1254
|
-
} =
|
|
1251
|
+
alert: a,
|
|
1252
|
+
dateRange: s,
|
|
1253
|
+
deleteBudget: o,
|
|
1254
|
+
selectedBudget: r,
|
|
1255
|
+
selectedSubBudget: g,
|
|
1256
|
+
setAlert: d,
|
|
1257
|
+
setSelectedBudget: u,
|
|
1258
|
+
updateBudget: y
|
|
1259
|
+
} = w(), { budgets: p, common: h } = E(), { isCopyLoaded: _, selectedAccountGuids: C } = Z(), x = Ge(), { setFilter: v } = q(), [b, S] = l.useState(""), [f, T] = l.useState(null), [N, R] = l.useState(!1), O = l.useRef(!1);
|
|
1255
1260
|
if (l.useEffect(() => {
|
|
1256
|
-
!
|
|
1257
|
-
accounts:
|
|
1258
|
-
dateRange:
|
|
1259
|
-
custom: ({ category_guid: P, top_level_category_guid:
|
|
1260
|
-
const { category_guid:
|
|
1261
|
-
return P ===
|
|
1261
|
+
!r || g || (S(`${r.amount}`), v({
|
|
1262
|
+
accounts: C,
|
|
1263
|
+
dateRange: s,
|
|
1264
|
+
custom: ({ category_guid: P, top_level_category_guid: F }) => {
|
|
1265
|
+
const { category_guid: De } = r;
|
|
1266
|
+
return P === De || F === De;
|
|
1262
1267
|
},
|
|
1263
1268
|
showSplits: !0
|
|
1264
|
-
}),
|
|
1265
|
-
}, [
|
|
1266
|
-
if (!
|
|
1267
|
-
const
|
|
1268
|
-
|
|
1269
|
-
|
|
1269
|
+
}), R(!0));
|
|
1270
|
+
}, [r]), !_) return /* @__PURE__ */ e(me, {});
|
|
1271
|
+
if (!r) return null;
|
|
1272
|
+
const z = () => {
|
|
1273
|
+
S(""), T(null), R(!1), setTimeout(() => {
|
|
1274
|
+
u(void 0), t?.();
|
|
1270
1275
|
}, 250);
|
|
1271
|
-
},
|
|
1272
|
-
|
|
1273
|
-
},
|
|
1274
|
-
if (
|
|
1275
|
-
if (
|
|
1276
|
-
|
|
1277
|
-
...
|
|
1278
|
-
amount: Number(
|
|
1279
|
-
}), n?.(
|
|
1280
|
-
|
|
1281
|
-
),
|
|
1276
|
+
}, k = () => {
|
|
1277
|
+
f === "delete" && n?.(ne.CANCEL_DELETE, b), S(r.amount ? `${r.amount}` : ""), T(null);
|
|
1278
|
+
}, pe = async () => {
|
|
1279
|
+
if (f === "edit") {
|
|
1280
|
+
if (O.current) return;
|
|
1281
|
+
O.current = !0, await y({
|
|
1282
|
+
...r,
|
|
1283
|
+
amount: Number(b)
|
|
1284
|
+
}), n?.(ne.END_SAVE, b), d(
|
|
1285
|
+
L(p.alert_budget_updated, r.category.name)
|
|
1286
|
+
), T(null), O.current = !1;
|
|
1282
1287
|
}
|
|
1283
|
-
|
|
1284
|
-
}, { remainingAmount: he, spentPercentage:
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
), fe = (P,
|
|
1288
|
+
f === "delete" && (await o(r.guid), n?.(ne.END_DELETE, b), z());
|
|
1289
|
+
}, { remainingAmount: he, spentPercentage: te, iconColor: be } = ut(
|
|
1290
|
+
r.transaction_total ?? 0,
|
|
1291
|
+
r.amount ?? 0
|
|
1292
|
+
), fe = (P, F) => L(P, /* @__PURE__ */ e("b", { children: F }));
|
|
1288
1293
|
return /* @__PURE__ */ m(l.Fragment, { children: [
|
|
1289
1294
|
/* @__PURE__ */ m(
|
|
1290
1295
|
$,
|
|
@@ -1294,14 +1299,14 @@ const wt = ({
|
|
|
1294
1299
|
px: 24,
|
|
1295
1300
|
py: 16
|
|
1296
1301
|
},
|
|
1297
|
-
isOpen:
|
|
1298
|
-
onClose:
|
|
1299
|
-
onPrimaryAction: () =>
|
|
1302
|
+
isOpen: N,
|
|
1303
|
+
onClose: z,
|
|
1304
|
+
onPrimaryAction: () => T(
|
|
1300
1305
|
"edit"
|
|
1301
1306
|
/* EDIT */
|
|
1302
1307
|
),
|
|
1303
1308
|
onSecondaryAction: () => {
|
|
1304
|
-
n?.(
|
|
1309
|
+
n?.(ne.START_DELETE, b), T(
|
|
1305
1310
|
"delete"
|
|
1306
1311
|
/* DELETE */
|
|
1307
1312
|
);
|
|
@@ -1314,72 +1319,72 @@ const wt = ({
|
|
|
1314
1319
|
pr: 24
|
|
1315
1320
|
}
|
|
1316
1321
|
},
|
|
1317
|
-
title:
|
|
1322
|
+
title: L(p.details_type_title, r.category.name),
|
|
1318
1323
|
children: [
|
|
1319
1324
|
/* @__PURE__ */ e(
|
|
1320
|
-
|
|
1325
|
+
nt,
|
|
1321
1326
|
{
|
|
1322
|
-
amount:
|
|
1327
|
+
amount: r.amount,
|
|
1323
1328
|
icon: /* @__PURE__ */ e(
|
|
1324
|
-
|
|
1329
|
+
H,
|
|
1325
1330
|
{
|
|
1326
|
-
categoryGuid:
|
|
1331
|
+
categoryGuid: r.category.guid,
|
|
1327
1332
|
size: 44,
|
|
1328
1333
|
sx: {
|
|
1329
|
-
bgcolor:
|
|
1330
|
-
border: `1px solid ${
|
|
1334
|
+
bgcolor: Qe(we(r.category.guid, x), 0.15),
|
|
1335
|
+
border: `1px solid ${we(r.category.guid, x)}`,
|
|
1331
1336
|
color: "text.primary"
|
|
1332
1337
|
}
|
|
1333
1338
|
}
|
|
1334
1339
|
),
|
|
1335
|
-
iconColor:
|
|
1336
|
-
onViewHistory:
|
|
1340
|
+
iconColor: be,
|
|
1341
|
+
onViewHistory: c,
|
|
1337
1342
|
remainingAmount: he,
|
|
1338
|
-
spentPercentage:
|
|
1339
|
-
startDate:
|
|
1340
|
-
totalTransaction:
|
|
1343
|
+
spentPercentage: te,
|
|
1344
|
+
startDate: r.start_date,
|
|
1345
|
+
totalTransaction: r.transaction_total
|
|
1341
1346
|
}
|
|
1342
1347
|
),
|
|
1343
|
-
/* @__PURE__ */ e(Ae, {}),
|
|
1344
|
-
|
|
1348
|
+
/* @__PURE__ */ e(Ae, { ...i }),
|
|
1349
|
+
a && /* @__PURE__ */ e(
|
|
1345
1350
|
xe,
|
|
1346
1351
|
{
|
|
1347
1352
|
anchorOrigin: { horizontal: "right", vertical: "bottom" },
|
|
1348
1353
|
autoHideDuration: 3500,
|
|
1349
|
-
onClose: () =>
|
|
1350
|
-
open: !!
|
|
1351
|
-
children: /* @__PURE__ */ e(Se, { closeText: "", onClose: () =>
|
|
1354
|
+
onClose: () => d(""),
|
|
1355
|
+
open: !!a,
|
|
1356
|
+
children: /* @__PURE__ */ e(Se, { closeText: "", onClose: () => d(""), severity: "success", variant: "filled", children: a })
|
|
1352
1357
|
}
|
|
1353
1358
|
)
|
|
1354
1359
|
]
|
|
1355
1360
|
}
|
|
1356
1361
|
),
|
|
1357
|
-
|
|
1358
|
-
|
|
1362
|
+
f && /* @__PURE__ */ e(
|
|
1363
|
+
mt,
|
|
1359
1364
|
{
|
|
1360
1365
|
closeAriaLabel: h.close_aria,
|
|
1361
1366
|
content: fe(
|
|
1362
|
-
p[
|
|
1363
|
-
|
|
1367
|
+
p[f === "edit" ? "edit_budget_content" : "delete_description"],
|
|
1368
|
+
r.category.name
|
|
1364
1369
|
),
|
|
1365
|
-
handleInputChange: (P) =>
|
|
1366
|
-
handleModalClose:
|
|
1367
|
-
handlePrimaryAction:
|
|
1368
|
-
handleSecondaryAction:
|
|
1369
|
-
inputLabel:
|
|
1370
|
-
inputValue:
|
|
1370
|
+
handleInputChange: (P) => S(P.toString()),
|
|
1371
|
+
handleModalClose: k,
|
|
1372
|
+
handlePrimaryAction: pe,
|
|
1373
|
+
handleSecondaryAction: k,
|
|
1374
|
+
inputLabel: f === "edit" ? p.details_edit_title : "",
|
|
1375
|
+
inputValue: b,
|
|
1371
1376
|
isOpen: !0,
|
|
1372
|
-
primaryColor:
|
|
1373
|
-
primaryText: p[
|
|
1374
|
-
secondaryColor:
|
|
1377
|
+
primaryColor: f === "edit" ? "primary" : "error",
|
|
1378
|
+
primaryText: p[f === "edit" ? "add_save_button" : "details_delete_button"],
|
|
1379
|
+
secondaryColor: f === "edit" ? "primary" : "inherit",
|
|
1375
1380
|
secondaryText: h.cancel_button,
|
|
1376
|
-
title: p[
|
|
1381
|
+
title: p[f === "edit" ? "details_edit_title" : "delete_title"]
|
|
1377
1382
|
}
|
|
1378
1383
|
)
|
|
1379
1384
|
] });
|
|
1380
|
-
},
|
|
1385
|
+
}, Ko = I(Wt);
|
|
1381
1386
|
export {
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1387
|
+
Vo as BubbleBudgetsMiniWidget,
|
|
1388
|
+
Ho as BubbleBudgetsWidget,
|
|
1389
|
+
Ko as BudgetDetailsDrawerV2
|
|
1385
1390
|
};
|