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