@mx-cartographer/experiences 8.0.19 → 8.0.20

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