@mx-cartographer/experiences 7.0.49-alpha.mega1 → 7.0.50-alpha.bb1

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