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