@mx-cartographer/experiences 8.0.0-alpha.sms2 → 9.0.0-alpha.mega1

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