@mx-cartographer/experiences 7.4.9 → 7.4.10

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