@mx-cartographer/experiences 8.0.0-alpha.bb4 → 8.0.0-alpha.mega2

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