@mx-cartographer/experiences 7.0.49-alpha.mega1 → 7.0.49-alpha.mega2

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