@mx-cartographer/experiences 9.1.0-alpha.bb1 → 9.1.0

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 (245) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/README.md +10 -10
  3. package/dist/Account-DR7Plrqy.mjs +119 -0
  4. package/dist/Account-DR7Plrqy.mjs.map +1 -0
  5. package/dist/AccountDetailsDrawer-CZPeLsCq.mjs +922 -0
  6. package/dist/AccountDetailsDrawer-CZPeLsCq.mjs.map +1 -0
  7. package/dist/AccountDetailsHeader-BvbCUQSS.mjs +231 -0
  8. package/dist/AccountDetailsHeader-BvbCUQSS.mjs.map +1 -0
  9. package/dist/AccountUtils-B8ZzWI-d.mjs +28 -0
  10. package/dist/AccountUtils-B8ZzWI-d.mjs.map +1 -0
  11. package/dist/Analytics-CkYXKvco.mjs +54 -0
  12. package/dist/Analytics-CkYXKvco.mjs.map +1 -0
  13. package/dist/Analytics-WeZYytR0.mjs +140 -0
  14. package/dist/Analytics-WeZYytR0.mjs.map +1 -0
  15. package/dist/ApiEndpoints-DXwIYNUV.mjs +50 -0
  16. package/dist/ApiEndpoints-DXwIYNUV.mjs.map +1 -0
  17. package/dist/BeatMaterialIcon-1KOfRZrA.mjs +27 -0
  18. package/dist/BeatMaterialIcon-1KOfRZrA.mjs.map +1 -0
  19. package/dist/BudgetUtil-Bg2AQJpQ.mjs +75 -0
  20. package/dist/BudgetUtil-Bg2AQJpQ.mjs.map +1 -0
  21. package/dist/Category-DEKZGLYe.mjs +302 -0
  22. package/dist/Category-DEKZGLYe.mjs.map +1 -0
  23. package/dist/CategorySelectorDrawer-NJsFsKP1.mjs +431 -0
  24. package/dist/CategorySelectorDrawer-NJsFsKP1.mjs.map +1 -0
  25. package/dist/Connect-BH0Pt6zc.mjs +43 -0
  26. package/dist/Connect-BH0Pt6zc.mjs.map +1 -0
  27. package/dist/ConnectCard-D7uxoH5Y.mjs +55 -0
  28. package/dist/ConnectCard-D7uxoH5Y.mjs.map +1 -0
  29. package/dist/ConnectDrawer-CW4LA3H3.mjs +58 -0
  30. package/dist/ConnectDrawer-CW4LA3H3.mjs.map +1 -0
  31. package/dist/ConnectionsDrawer-CZU9ku-k.mjs +54 -0
  32. package/dist/ConnectionsDrawer-CZU9ku-k.mjs.map +1 -0
  33. package/dist/CurrencyDialog-DumQCTPO.mjs +374 -0
  34. package/dist/CurrencyDialog-DumQCTPO.mjs.map +1 -0
  35. package/dist/CurrencyInput-DaGEQaLW.mjs +88 -0
  36. package/dist/CurrencyInput-DaGEQaLW.mjs.map +1 -0
  37. package/dist/CurrencyText-CCbE6MmF.mjs +21 -0
  38. package/dist/CurrencyText-CCbE6MmF.mjs.map +1 -0
  39. package/dist/DateFormats-HudZ3Bjs.mjs +65 -0
  40. package/dist/DateFormats-HudZ3Bjs.mjs.map +1 -0
  41. package/dist/DateUtil-CzBmbjmA.mjs +75 -0
  42. package/dist/DateUtil-CzBmbjmA.mjs.map +1 -0
  43. package/dist/DebtUtils-i4pI2Uoe.mjs +154 -0
  44. package/dist/DebtUtils-i4pI2Uoe.mjs.map +1 -0
  45. package/dist/Dialog-Bvd2n8hz.mjs +67 -0
  46. package/dist/Dialog-Bvd2n8hz.mjs.map +1 -0
  47. package/dist/Donut-SzzfZDHF.mjs +89 -0
  48. package/dist/Donut-SzzfZDHF.mjs.map +1 -0
  49. package/dist/Drawer-DsnW2o0v.mjs +175 -0
  50. package/dist/Drawer-DsnW2o0v.mjs.map +1 -0
  51. package/dist/EmbeddedCard-DH8vQ3qN.mjs +859 -0
  52. package/dist/EmbeddedCard-DH8vQ3qN.mjs.map +1 -0
  53. package/dist/EmptyState-CJUDc3kD.mjs +85 -0
  54. package/dist/EmptyState-CJUDc3kD.mjs.map +1 -0
  55. package/dist/Error-Dtw6yxkf.mjs +85 -0
  56. package/dist/Error-Dtw6yxkf.mjs.map +1 -0
  57. package/dist/ErrorBoundary-CsdOcnJ9.mjs +24 -0
  58. package/dist/ErrorBoundary-CsdOcnJ9.mjs.map +1 -0
  59. package/dist/ExportCsvAction-C9KWH3Az.mjs +25 -0
  60. package/dist/ExportCsvAction-C9KWH3Az.mjs.map +1 -0
  61. package/dist/GlobalAccountFilter-BhzR5Vb1.mjs +230 -0
  62. package/dist/GlobalAccountFilter-BhzR5Vb1.mjs.map +1 -0
  63. package/dist/GlobalCopyApi-wcnDUzMV.mjs +129 -0
  64. package/dist/GlobalCopyApi-wcnDUzMV.mjs.map +1 -0
  65. package/dist/GoalsUtil-C9EnLWvC.mjs +108 -0
  66. package/dist/GoalsUtil-C9EnLWvC.mjs.map +1 -0
  67. package/dist/HeaderCell-P8w6CmfO.mjs +7 -0
  68. package/dist/HeaderCell-P8w6CmfO.mjs.map +1 -0
  69. package/dist/Help-CkQTjORd.mjs +300 -0
  70. package/dist/Help-CkQTjORd.mjs.map +1 -0
  71. package/dist/Help-aERwhajy.mjs +3210 -0
  72. package/dist/Help-aERwhajy.mjs.map +1 -0
  73. package/dist/IconBacking-DgT8DCeh.mjs +40 -0
  74. package/dist/IconBacking-DgT8DCeh.mjs.map +1 -0
  75. package/dist/InformationTooltip-4su8bn1e.mjs +42 -0
  76. package/dist/InformationTooltip-4su8bn1e.mjs.map +1 -0
  77. package/dist/InvestmentUtil-BItV7uEs.mjs +135 -0
  78. package/dist/InvestmentUtil-BItV7uEs.mjs.map +1 -0
  79. package/dist/LineChart-CUfiH86G.mjs +613 -0
  80. package/dist/LineChart-CUfiH86G.mjs.map +1 -0
  81. package/dist/ListItemAction-BqUCLj_w.mjs +70 -0
  82. package/dist/ListItemAction-BqUCLj_w.mjs.map +1 -0
  83. package/dist/ListItemRow-kH1rn8Xu.mjs +68 -0
  84. package/dist/ListItemRow-kH1rn8Xu.mjs.map +1 -0
  85. package/dist/ListItemWrapper-DRse79Iu.mjs +44 -0
  86. package/dist/ListItemWrapper-DRse79Iu.mjs.map +1 -0
  87. package/dist/Loader-CxeBwuPG.mjs +22 -0
  88. package/dist/Loader-CxeBwuPG.mjs.map +1 -0
  89. package/dist/Localization-DnoVyBNK.mjs +39 -0
  90. package/dist/Localization-DnoVyBNK.mjs.map +1 -0
  91. package/dist/ManageIncome-Dcsnnz86.mjs +906 -0
  92. package/dist/ManageIncome-Dcsnnz86.mjs.map +1 -0
  93. package/dist/MicroWidgetContainer-B2NnKBgW.mjs +46 -0
  94. package/dist/MicroWidgetContainer-B2NnKBgW.mjs.map +1 -0
  95. package/dist/MiniWidgetContainer-Bmv_WeUd.mjs +67 -0
  96. package/dist/MiniWidgetContainer-Bmv_WeUd.mjs.map +1 -0
  97. package/dist/NetWorthUtils-DfSH3z70.mjs +96 -0
  98. package/dist/NetWorthUtils-DfSH3z70.mjs.map +1 -0
  99. package/dist/Notification-DTNYSd8P.mjs +8 -0
  100. package/dist/Notification-DTNYSd8P.mjs.map +1 -0
  101. package/dist/NotificationSettings-CW7okUrk.mjs +678 -0
  102. package/dist/NotificationSettings-CW7okUrk.mjs.map +1 -0
  103. package/dist/NotificationUtils-BRGFTePr.mjs +24 -0
  104. package/dist/NotificationUtils-BRGFTePr.mjs.map +1 -0
  105. package/dist/NumberFormatting--XMeeBfr.mjs +50 -0
  106. package/dist/NumberFormatting--XMeeBfr.mjs.map +1 -0
  107. package/dist/OriginalBalanceAction-YrvxBYAl.mjs +115 -0
  108. package/dist/OriginalBalanceAction-YrvxBYAl.mjs.map +1 -0
  109. package/dist/RecurringSettings-D8hBbXV_.mjs +89 -0
  110. package/dist/RecurringSettings-D8hBbXV_.mjs.map +1 -0
  111. package/dist/RecurringTransactionsUtil-CHWmqvW5.mjs +299 -0
  112. package/dist/RecurringTransactionsUtil-CHWmqvW5.mjs.map +1 -0
  113. package/dist/ResponsiveButton-CC9F_Ezk.mjs +46 -0
  114. package/dist/ResponsiveButton-CC9F_Ezk.mjs.map +1 -0
  115. package/dist/SearchBox-Cpgu_gdO.mjs +51 -0
  116. package/dist/SearchBox-Cpgu_gdO.mjs.map +1 -0
  117. package/dist/Select-CSpkK5cR.mjs +62 -0
  118. package/dist/Select-CSpkK5cR.mjs.map +1 -0
  119. package/dist/SelectionBox-B4xELRgp.mjs +49 -0
  120. package/dist/SelectionBox-B4xELRgp.mjs.map +1 -0
  121. package/dist/SingleSegmentDonut-7Uy6VEld.mjs +70 -0
  122. package/dist/SingleSegmentDonut-7Uy6VEld.mjs.map +1 -0
  123. package/dist/Sizes-DISGrlUg.mjs +7 -0
  124. package/dist/Sizes-DISGrlUg.mjs.map +1 -0
  125. package/dist/SkeletonLoader-BaNboJjD.mjs +39 -0
  126. package/dist/SkeletonLoader-BaNboJjD.mjs.map +1 -0
  127. package/dist/SpendingData-Fii_xATx.mjs +54 -0
  128. package/dist/SpendingData-Fii_xATx.mjs.map +1 -0
  129. package/dist/SpendingLegend-CxvNOg3c.mjs +204 -0
  130. package/dist/SpendingLegend-CxvNOg3c.mjs.map +1 -0
  131. package/dist/StatusBar-CPfSXe80.mjs +31 -0
  132. package/dist/StatusBar-CPfSXe80.mjs.map +1 -0
  133. package/dist/TabContentContainer-B0eYJP5p.mjs +49 -0
  134. package/dist/TabContentContainer-B0eYJP5p.mjs.map +1 -0
  135. package/dist/ToggleListItem-Dl1lXNwj.mjs +92 -0
  136. package/dist/ToggleListItem-Dl1lXNwj.mjs.map +1 -0
  137. package/dist/TransactionDetails-roZ5xLq8.mjs +1708 -0
  138. package/dist/TransactionDetails-roZ5xLq8.mjs.map +1 -0
  139. package/dist/TransactionUtils-BphBJBbU.mjs +235 -0
  140. package/dist/TransactionUtils-BphBJBbU.mjs.map +1 -0
  141. package/dist/TrendsUtil-D9z3kIj_.mjs +70 -0
  142. package/dist/TrendsUtil-D9z3kIj_.mjs.map +1 -0
  143. package/dist/UserStore-C1fdL3Iu.mjs +3054 -0
  144. package/dist/UserStore-C1fdL3Iu.mjs.map +1 -0
  145. package/dist/ViewMoreMicroCard-fnwE0hqd.mjs +1280 -0
  146. package/dist/ViewMoreMicroCard-fnwE0hqd.mjs.map +1 -0
  147. package/dist/WidgetContainer-DJnp6t6c.mjs +483 -0
  148. package/dist/WidgetContainer-DJnp6t6c.mjs.map +1 -0
  149. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsDrawer.d.ts +6 -0
  150. package/dist/accounts/index.d.ts +1 -0
  151. package/dist/accounts/index.es.js +784 -12
  152. package/dist/accounts/index.es.js.map +1 -0
  153. package/dist/analytics/index.es.js +140 -155
  154. package/dist/analytics/index.es.js.map +1 -0
  155. package/dist/budgets/index.es.js +1267 -1317
  156. package/dist/budgets/index.es.js.map +1 -0
  157. package/dist/cashflow/index.es.js +943 -1047
  158. package/dist/cashflow/index.es.js.map +1 -0
  159. package/dist/categories/index.es.js +5 -4
  160. package/dist/categories/index.es.js.map +1 -0
  161. package/dist/common/components/DataRow.d.ts +1 -0
  162. package/dist/common/components/ListItemWrapper.d.ts +2 -1
  163. package/dist/common/constants/Analytics.d.ts +3 -0
  164. package/dist/common/index.es.js +310 -101
  165. package/dist/common/index.es.js.map +1 -0
  166. package/dist/core/index.es.js +105 -80
  167. package/dist/core/index.es.js.map +1 -0
  168. package/dist/core/stores/RecurringTransactionsStore.d.ts +29 -1
  169. package/dist/core/stores/TransactionStore.d.ts +1 -0
  170. package/dist/core/types/localization/RecurringCopy.d.ts +14 -1
  171. package/dist/core/types/localization/SpendingCopy.d.ts +1 -0
  172. package/dist/core/utils/DateUtil.d.ts +2 -0
  173. package/dist/core/utils/RecurringTransactionsUtil.d.ts +2 -1
  174. package/dist/dashboard/index.es.js +142 -185
  175. package/dist/dashboard/index.es.js.map +1 -0
  176. package/dist/debts/index.es.js +1273 -1384
  177. package/dist/debts/index.es.js.map +1 -0
  178. package/dist/finstrong/index.es.js +3473 -3367
  179. package/dist/finstrong/index.es.js.map +1 -0
  180. package/dist/goals/index.es.js +984 -1103
  181. package/dist/goals/index.es.js.map +1 -0
  182. package/dist/help/index.es.js +26 -3
  183. package/dist/help/index.es.js.map +1 -0
  184. package/dist/hooks-97sNJ_lf.mjs +78 -0
  185. package/dist/hooks-97sNJ_lf.mjs.map +1 -0
  186. package/dist/insights/components/insights/WeeklyNoSpendDays/BubbleWeek.d.ts +4 -1
  187. package/dist/insights/components/insights/WeeklyNoSpendDays/WeeklyNoSpendDays.d.ts +4 -2
  188. package/dist/insights/index.es.js +4871 -93
  189. package/dist/insights/index.es.js.map +1 -0
  190. package/dist/investments/index.es.js +1523 -1533
  191. package/dist/investments/index.es.js.map +1 -0
  192. package/dist/merchants/index.es.js +65 -75
  193. package/dist/merchants/index.es.js.map +1 -0
  194. package/dist/microinsights/index.es.js +826 -15
  195. package/dist/microinsights/index.es.js.map +1 -0
  196. package/dist/networth/index.es.js +504 -550
  197. package/dist/networth/index.es.js.map +1 -0
  198. package/dist/notifications/index.es.js +162 -169
  199. package/dist/notifications/index.es.js.map +1 -0
  200. package/dist/recurringtransactions/components/RecurringTransactionDetails.d.ts +3 -2
  201. package/dist/recurringtransactions/components/RecurringTransactionDetailsDrawer.d.ts +3 -0
  202. package/dist/recurringtransactions/components/RecurringTransactionList.d.ts +11 -0
  203. package/dist/recurringtransactions/components/UpcomingRecurrenceCard.d.ts +8 -0
  204. package/dist/recurringtransactions/components/actions/LinkTransactionDrawer.d.ts +10 -0
  205. package/dist/recurringtransactions/components/actions/MarkAsPaidDialog.d.ts +7 -0
  206. package/dist/recurringtransactions/components/actions/MarkAsUnpaidDialog.d.ts +7 -0
  207. package/dist/recurringtransactions/index.es.js +1012 -10
  208. package/dist/recurringtransactions/index.es.js.map +1 -0
  209. package/dist/settings/index.es.js +892 -13
  210. package/dist/settings/index.es.js.map +1 -0
  211. package/dist/spending/index.es.js +457 -400
  212. package/dist/spending/index.es.js.map +1 -0
  213. package/dist/transactions/components/shared/transactionlist/TransactionRow.d.ts +1 -0
  214. package/dist/transactions/index.es.js +604 -10
  215. package/dist/transactions/index.es.js.map +1 -0
  216. package/dist/trends/index.es.js +1408 -1268
  217. package/dist/trends/index.es.js.map +1 -0
  218. package/dist/useAccountDisplayName-BsiXA0qf.mjs +24 -0
  219. package/dist/useAccountDisplayName-BsiXA0qf.mjs.map +1 -0
  220. package/dist/useAriaLive-MkYebyUR.mjs +36 -0
  221. package/dist/useAriaLive-MkYebyUR.mjs.map +1 -0
  222. package/dist/useDimensions-CeDR9V8N.mjs +37 -0
  223. package/dist/useDimensions-CeDR9V8N.mjs.map +1 -0
  224. package/dist/useInsightsEnabled-D5Sdm0TJ.mjs +12 -0
  225. package/dist/useInsightsEnabled-D5Sdm0TJ.mjs.map +1 -0
  226. package/dist/useScreenSize-mWpmnh5w.mjs +37 -0
  227. package/dist/useScreenSize-mWpmnh5w.mjs.map +1 -0
  228. package/dist/useWidgetLoadTimer-B0tB-yzL.mjs +20 -0
  229. package/dist/useWidgetLoadTimer-B0tB-yzL.mjs.map +1 -0
  230. package/package.json +30 -30
  231. package/dist/Analytics-BKzTPees.mjs +0 -61
  232. package/dist/GlobalCopyApi-BeXzaDH9.mjs +0 -487
  233. package/dist/HeaderCell-EhCUSjvj.mjs +0 -10
  234. package/dist/Loader-BlVzRtUd.mjs +0 -73
  235. package/dist/MiniWidgetContainer-COwnjfy7.mjs +0 -110
  236. package/dist/OriginalBalanceAction-sbiqaxok.mjs +0 -110
  237. package/dist/SpendingLegend-D15ixlQ1.mjs +0 -222
  238. package/dist/accounts-DkyAiLpg.mjs +0 -15632
  239. package/dist/core-BexP5oiV.mjs +0 -4047
  240. package/dist/help-CctDYrAH.mjs +0 -2308
  241. package/dist/insights/components/insights/P2pCategorization/_tests_/P2pCategorizationMultipleTransaction.test.d.ts +0 -0
  242. package/dist/insights/components/insights/P2pCategorization/_tests_/P2pCategorizationSingleTransaction.test.d.ts +0 -0
  243. package/dist/microinsights-CRf3ChsJ.mjs +0 -1814
  244. package/dist/recurringtransactions-gbJ_NA8u.mjs +0 -1564
  245. package/dist/settings-ZMHe439l.mjs +0 -1526
@@ -1,618 +1,541 @@
1
- import { s as S } from "../GlobalCopyApi-BeXzaDH9.mjs";
2
- import { B as Be, Ft as Pe, J as A, Pt as H, R as Re, V as L, X as Le, ln as Z, un as Q, z as Fe } from "../core-BexP5oiV.mjs";
3
- import { An as $e, Bn as oe, Gn as Oe, Hn as We, In as be, a as Ge, bn as He, kn as ee, lr as ie, mr as le, sr as C } from "../accounts-DkyAiLpg.mjs";
4
- import { n as ze } from "../Analytics-BKzTPees.mjs";
5
- import { M as je, d as E, g as z, h as Ve, i as Ye, l as te, n as re, p as w, t as Ke } from "../Loader-BlVzRtUd.mjs";
6
- import { n as Ue, r as Xe, t as qe } from "../OriginalBalanceAction-sbiqaxok.mjs";
7
- import { t as O } from "../HeaderCell-EhCUSjvj.mjs";
8
- import g from "react";
9
- import { observer as v } from "mobx-react-lite";
1
+ import { jsx as e, jsxs as l, Fragment as R } from "react/jsx-runtime";
2
+ import f from "react";
3
+ import { observer as C } from "mobx-react-lite";
10
4
  import y from "@mui/material/Stack";
11
- import { H3 as Je, Icon as ne, InstitutionLogo as Ze, P as ge, Text as i } from "@mxenabled/mxui";
12
- import xe from "@mui/material/Button";
13
- import me from "@mui/material/Paper";
14
- import { CheckCircle as we, Error as Qe } from "@mxenabled/mx-icons";
15
- import { Fragment as B, jsx as e, jsxs as l } from "react/jsx-runtime";
16
- import { useTheme as et } from "@mui/material/styles";
17
- import se from "@mui/material/Box";
18
- import _e from "@mui/material/Tab";
19
- import tt from "@mui/material/Tabs";
20
- import rt from "@mui/material/IconButton";
21
- import { formatDuration as at, intervalToDuration as nt } from "date-fns";
22
- import { Box as W, Card as ve, Stack as u, useTheme as j } from "@mui/material";
23
- import ot from "@mui/material/Card";
24
- import it from "@mui/material/CardContent";
25
- import lt from "@mui/material/CardHeader";
5
+ import { useTheme as j, Card as ge, Stack as u, Box as W } from "@mui/material";
6
+ import { Text as i, P as xe, H3 as Be, InstitutionLogo as Pe, Icon as ne } from "@mxenabled/mxui";
7
+ import { intervalToDuration as Re, formatDuration as Le } from "date-fns";
8
+ import { s as Fe, D as $, t as $e, b as Oe } from "../DebtUtils-i4pI2Uoe.mjs";
9
+ import { f as I, a as We } from "../NumberFormatting--XMeeBfr.mjs";
10
+ import { f as J, D as Q } from "../DateFormats-HudZ3Bjs.mjs";
11
+ import { G as Ge, q as ee, u as w, k as V, f as k, c as te, i as He, a as ze } from "../hooks-97sNJ_lf.mjs";
12
+ import { u as ae } from "../useScreenSize-mWpmnh5w.mjs";
13
+ import { b as T } from "../Localization-DnoVyBNK.mjs";
14
+ import { D as ie } from "../Drawer-DsnW2o0v.mjs";
15
+ import { A as je, u as Ve } from "../AccountDetailsHeader-BvbCUQSS.mjs";
16
+ import Ye from "@mui/material/Card";
17
+ import Ke from "@mui/material/CardContent";
18
+ import Ue from "@mui/material/CardHeader";
19
+ import le from "@mui/material/Box";
20
+ import { useTheme as qe } from "@mui/material/styles";
21
+ import { LineChart as Xe } from "@mui/x-charts/LineChart";
22
+ import { A as S } from "../Analytics-WeZYytR0.mjs";
23
+ import be from "@mui/material/Tab";
24
+ import Ze from "@mui/material/Tabs";
25
+ import we from "@mui/material/List";
26
26
  import G from "@mui/material/Divider";
27
- import st from "@mui/material/Popover";
28
- import Ce from "@mui/material/List";
29
- import ct from "@mui/material/ListItem";
30
- import dt from "@mui/material/TextField";
31
- import { LineChart as pt } from "@mui/x-charts/LineChart";
32
- import ye from "@mui/material/Alert";
33
- import fe from "@mui/material/AlertTitle";
34
- import { DataGridPro as ut } from "@mui/x-data-grid-pro";
35
- function ht(a, n, r = 0) {
36
- const t = a.map((b) => ({ ...b })).filter((b) => b.interest_rate !== void 0 && b.monthly_payment !== void 0 && !b.is_paid_off);
27
+ import { M as Je, I as Qe, O as et } from "../OriginalBalanceAction-YrvxBYAl.mjs";
28
+ import tt from "@mui/material/TextField";
29
+ import { L as re } from "../ListItemAction-BqUCLj_w.mjs";
30
+ import { C as se } from "../CurrencyInput-DaGEQaLW.mjs";
31
+ import me from "@mui/material/Alert";
32
+ import _e from "@mui/material/AlertTitle";
33
+ import ye from "@mui/material/Paper";
34
+ import { Error as rt, CheckCircle as Ce } from "@mxenabled/mx-icons";
35
+ import { T as fe } from "../TabContentContainer-B0eYJP5p.mjs";
36
+ import { DataGridPro as ot } from "@mui/x-data-grid-pro";
37
+ import { H } from "../HeaderCell-P8w6CmfO.mjs";
38
+ import { A as nt, c as z } from "../Account-DR7Plrqy.mjs";
39
+ import ve from "@mui/material/Button";
40
+ import at from "@mui/material/IconButton";
41
+ import it from "@mui/material/ListItem";
42
+ import lt from "@mui/material/Popover";
43
+ import { u as st } from "../useWidgetLoadTimer-B0tB-yzL.mjs";
44
+ import { L as ct } from "../Loader-CxeBwuPG.mjs";
45
+ import { W as dt } from "../WidgetContainer-DJnp6t6c.mjs";
46
+ import { E as pt } from "../EmptyState-CJUDc3kD.mjs";
47
+ import { C as ut } from "../ConnectDrawer-CW4LA3H3.mjs";
48
+ function ht(r, n, o = 0) {
49
+ const t = r.map((b) => ({ ...b })).filter(
50
+ (b) => b.interest_rate !== void 0 && b.monthly_payment !== void 0 && !b.is_paid_off
51
+ );
37
52
  Fe(t, n);
38
- let o = 0, s = 0;
39
- const p = /* @__PURE__ */ new Date(), c = /* @__PURE__ */ new Date();
53
+ let a = 0, s = 0;
54
+ const d = /* @__PURE__ */ new Date(), c = /* @__PURE__ */ new Date();
40
55
  for (; t.some((b) => b.balance >= 0.01 && !b.is_impossible); ) {
41
56
  let b = !1;
42
- for (const [I, x] of t.entries()) {
57
+ for (const [v, x] of t.entries()) {
43
58
  if (x.balance <= 0.01 || x.is_impossible) continue;
44
- const F = (x.interest_rate ?? 0) / 100 / 12, k = x.balance * F;
45
- let N = x.monthly_payment ?? 0;
46
- I === 0 && r && (N += r), x.balance += k;
47
- const D = Math.min(x.balance, N + s);
48
- if (D <= k) {
59
+ const F = (x.interest_rate ?? 0) / 100 / 12, N = x.balance * F;
60
+ let A = x.monthly_payment ?? 0;
61
+ v === 0 && o && (A += o), x.balance += N;
62
+ const E = Math.min(x.balance, A + s);
63
+ if (E <= N) {
49
64
  x.is_impossible = !0;
50
65
  continue;
51
66
  }
52
- x.balance -= D, x.balance = x.balance < 0.01 ? 0 : x.balance, o += k, x.balance <= 0 && (s += N), D > 0 && (b = !0);
67
+ x.balance -= E, x.balance = x.balance < 0.01 ? 0 : x.balance, a += N, x.balance <= 0 && (s += A), E > 0 && (b = !0);
53
68
  }
54
69
  b && c.setMonth(c.getMonth() + 1);
55
70
  }
56
- const m = t.some((b) => b.is_impossible && b.balance > 0), h = nt({
57
- start: p,
58
- end: c
59
- });
71
+ const m = t.some((b) => b.is_impossible && b.balance > 0), h = Re({ start: d, end: c });
60
72
  return {
61
- payoffSavings: m ? "N/A" : A(o, "0,0.00"),
62
- payoffDate: m ? "Never" : Q(c, Z.MONTH_YEAR),
63
- payoffDuration: m ? "Stagnant" : at(h, { format: ["years", "months"] }) || "0 months"
73
+ payoffSavings: m ? "N/A" : I(a, "0,0.00"),
74
+ payoffDate: m ? "Never" : J(c, Q.MONTH_YEAR),
75
+ payoffDuration: m ? "Stagnant" : Le(h, { format: ["years", "months"] }) || "0 months"
64
76
  };
65
77
  }
66
- var M = () => {
67
- if (!g.useContext(je)) throw new Error("useCateUiStore() must be used within the GlobalDataContext");
68
- return te().uiStore;
69
- }, bt = ({ debts: a, onClickCta: n, sx: r }) => {
70
- const t = j(), { isMobile: o } = le(), { debts: s } = w(), { selectedDebtPriority: p } = M(), { monthlyCashFlowProfile: c } = z(), { payoffDate: m, payoffSavings: h, payoffDuration: b } = g.useMemo(() => ht(a, p, c?.extra_payment ?? 0), [
71
- a,
72
- p,
73
- c
74
- ]);
75
- return /* @__PURE__ */ e(ve, {
76
- sx: {
77
- boxShadow: t.shadows[2],
78
- width: o ? "100%" : "186px",
79
- minWidth: "186px",
80
- ...r
81
- },
82
- children: /* @__PURE__ */ l(u, {
78
+ const P = () => {
79
+ if (!f.useContext(Ge))
80
+ throw new Error("useDebtsUiStore() must be used within the GlobalDataContext");
81
+ return ee().uiStore;
82
+ }, bt = ({ debts: r, onClickCta: n, sx: o }) => {
83
+ const t = j(), { isMobile: a } = ae(), { debts: s } = w(), { selectedDebtPriority: d } = P(), { monthlyCashFlowProfile: c } = V(), { payoffDate: m, payoffSavings: h, payoffDuration: b } = f.useMemo(() => {
84
+ const v = c?.extra_payment ?? 0;
85
+ return ht(r, d, v);
86
+ }, [r, d, c]);
87
+ return /* @__PURE__ */ e(
88
+ ge,
89
+ {
83
90
  sx: {
84
- gap: "12px",
85
- p: "16px"
91
+ boxShadow: t.shadows[2],
92
+ width: a ? "100%" : "186px",
93
+ minWidth: "186px",
94
+ ...o
86
95
  },
87
- children: [
88
- /* @__PURE__ */ l(u, {
89
- gap: o ? "4px" : "0",
90
- sx: {
91
- borderBottom: "1px solid",
92
- borderBottomColor: t.palette.grey[300],
93
- pb: "8px"
94
- },
95
- children: [/* @__PURE__ */ e(i, {
96
- variant: "caption",
97
- children: s.snowball_card_date_description
98
- }), /* @__PURE__ */ e(i, {
96
+ children: /* @__PURE__ */ l(u, { sx: { gap: "12px", p: "16px" }, children: [
97
+ /* @__PURE__ */ l(
98
+ u,
99
+ {
100
+ gap: a ? "4px" : "0",
101
+ sx: {
102
+ borderBottom: "1px solid",
103
+ borderBottomColor: t.palette.grey[300],
104
+ pb: "8px"
105
+ },
106
+ children: [
107
+ /* @__PURE__ */ e(i, { variant: "caption", children: s.snowball_card_date_description }),
108
+ /* @__PURE__ */ e(i, { bold: !0, color: t.palette.primary.main, variant: "body2", children: m })
109
+ ]
110
+ }
111
+ ),
112
+ /* @__PURE__ */ l(u, { gap: a ? "4px" : "0", children: [
113
+ /* @__PURE__ */ e(i, { bold: !0, variant: "body2", children: h }),
114
+ /* @__PURE__ */ e(i, { variant: "caption", children: s.snowball_card_amount_description })
115
+ ] }),
116
+ /* @__PURE__ */ l(u, { gap: a ? "4px" : "0", children: [
117
+ /* @__PURE__ */ e(i, { bold: !0, variant: "body2", children: b }),
118
+ /* @__PURE__ */ e(i, { variant: "caption", children: s.snowball_card_duration_description })
119
+ ] }),
120
+ /* @__PURE__ */ e(
121
+ i,
122
+ {
99
123
  bold: !0,
100
124
  color: t.palette.primary.main,
125
+ onClick: n,
126
+ sx: { cursor: "pointer" },
101
127
  variant: "body2",
102
- children: m
103
- })]
104
- }),
105
- /* @__PURE__ */ l(u, {
106
- gap: o ? "4px" : "0",
107
- children: [/* @__PURE__ */ e(i, {
108
- bold: !0,
109
- variant: "body2",
110
- children: h
111
- }), /* @__PURE__ */ e(i, {
112
- variant: "caption",
113
- children: s.snowball_card_amount_description
114
- })]
115
- }),
116
- /* @__PURE__ */ l(u, {
117
- gap: o ? "4px" : "0",
118
- children: [/* @__PURE__ */ e(i, {
119
- bold: !0,
120
- variant: "body2",
121
- children: b
122
- }), /* @__PURE__ */ e(i, {
123
- variant: "caption",
124
- children: s.snowball_card_duration_description
125
- })]
126
- }),
127
- /* @__PURE__ */ e(i, {
128
- bold: !0,
129
- color: t.palette.primary.main,
130
- onClick: n,
131
- sx: { cursor: "pointer" },
132
- variant: "body2",
133
- children: s.snowball_card_cta
134
- })
135
- ]
136
- })
137
- });
138
- }, mt = v(bt), _t = ({ isOpen: a, onClose: n }) => {
139
- const r = j(), { debts: t } = w(), [o, s] = g.useState(!1);
140
- return /* @__PURE__ */ e(ie, {
141
- ariaLabelClose: "",
142
- isOpen: a,
143
- onClose: n,
144
- title: t.snowball_drawer_title,
145
- children: /* @__PURE__ */ l(u, {
146
- bgcolor: r.palette.background.default,
147
- height: "100%",
148
- children: [/* @__PURE__ */ l(u, {
149
- alignItems: "center",
150
- px: 24,
151
- py: 24,
152
- children: [/* @__PURE__ */ l(u, {
153
- alignItems: "center",
154
- pb: 24,
155
- children: [
156
- /* @__PURE__ */ e(i, {
157
- mb: 12,
158
- truncate: !0,
159
- variant: "h3",
160
- children: t.snowball_drawer_subtitle
161
- }),
162
- /* @__PURE__ */ e(i, {
163
- color: r.palette.secondary.main,
164
- variant: "body2",
165
- children: t.snowball_drawer_amount_description
166
- }),
167
- /* @__PURE__ */ e(ge, {
168
- variant: "h1",
169
- children: t.snowball_drawer_savings
170
- }),
171
- /* @__PURE__ */ e(i, {
172
- color: r.palette.secondary.main,
173
- variant: "body2",
174
- children: t.snowball_drawer_duration_description
175
- })
176
- ]
177
- }), /* @__PURE__ */ l(ve, {
178
- sx: {
179
- display: "grid",
180
- py: 16,
181
- px: 24
182
- },
183
- children: [
184
- /* @__PURE__ */ e(i, {
185
- mb: 4,
186
- truncate: !0,
187
- variant: "h3",
188
- children: t.snowball_drawer_question
189
- }),
190
- /* @__PURE__ */ e(i, {
191
- color: r.palette.secondary.main,
192
- mb: 8,
193
- truncate: !o,
194
- variant: "subtitle2",
195
- children: t.snowball_drawer_answer
196
- }),
197
- /* @__PURE__ */ e(i, {
198
- bold: !0,
199
- color: r.palette.primary.main,
200
- onClick: () => s(!o),
201
- sx: { cursor: "pointer" },
128
+ children: s.snowball_card_cta
129
+ }
130
+ )
131
+ ] })
132
+ }
133
+ );
134
+ }, mt = C(bt), _t = ({ isOpen: r, onClose: n }) => {
135
+ const o = j(), { debts: t } = w(), [a, s] = f.useState(!1);
136
+ return /* @__PURE__ */ e(
137
+ ie,
138
+ {
139
+ ariaLabelClose: "",
140
+ isOpen: r,
141
+ onClose: n,
142
+ title: t.snowball_drawer_title,
143
+ children: /* @__PURE__ */ l(u, { bgcolor: o.palette.background.default, height: "100%", children: [
144
+ /* @__PURE__ */ l(u, { alignItems: "center", px: 24, py: 24, children: [
145
+ /* @__PURE__ */ l(u, { alignItems: "center", pb: 24, children: [
146
+ /* @__PURE__ */ e(i, { mb: 12, truncate: !0, variant: "h3", children: t.snowball_drawer_subtitle }),
147
+ /* @__PURE__ */ e(i, { color: o.palette.secondary.main, variant: "body2", children: t.snowball_drawer_amount_description }),
148
+ /* @__PURE__ */ e(xe, { variant: "h1", children: t.snowball_drawer_savings }),
149
+ /* @__PURE__ */ e(i, { color: o.palette.secondary.main, variant: "body2", children: t.snowball_drawer_duration_description })
150
+ ] }),
151
+ /* @__PURE__ */ l(ge, { sx: { display: "grid", py: 16, px: 24 }, children: [
152
+ /* @__PURE__ */ e(i, { mb: 4, truncate: !0, variant: "h3", children: t.snowball_drawer_question }),
153
+ /* @__PURE__ */ e(
154
+ i,
155
+ {
156
+ color: o.palette.secondary.main,
157
+ mb: 8,
158
+ truncate: !a,
159
+ variant: "subtitle2",
160
+ children: t.snowball_drawer_answer
161
+ }
162
+ ),
163
+ /* @__PURE__ */ e(
164
+ i,
165
+ {
166
+ bold: !0,
167
+ color: o.palette.primary.main,
168
+ onClick: () => s(!a),
169
+ sx: { cursor: "pointer" },
170
+ variant: "body2",
171
+ children: a ? t.snowball_drawer_less : t.snowball_drawer_more
172
+ }
173
+ )
174
+ ] })
175
+ ] }),
176
+ /* @__PURE__ */ l(u, { children: [
177
+ /* @__PURE__ */ e(
178
+ i,
179
+ {
180
+ color: o.palette.secondary.main,
181
+ px: 24,
182
+ sx: { textAlign: "center" },
202
183
  variant: "body2",
203
- children: o ? t.snowball_drawer_less : t.snowball_drawer_more
204
- })
205
- ]
206
- })]
207
- }), /* @__PURE__ */ l(u, { children: [
208
- /* @__PURE__ */ e(i, {
209
- color: r.palette.secondary.main,
210
- px: 24,
211
- sx: { textAlign: "center" },
212
- variant: "body2",
213
- children: t.snowball_drawer_disclaimer
214
- }),
215
- /* @__PURE__ */ l(u, {
216
- flexDirection: "row",
217
- justifyContent: "space-between",
218
- sx: {
219
- pt: 12,
220
- px: 24,
221
- pb: 8
222
- },
223
- children: [/* @__PURE__ */ e(i, {
224
- bold: !0,
225
- variant: "caption",
226
- children: S(t.snowball_drawer_month_header, 1)
227
- }), /* @__PURE__ */ e(i, {
228
- bold: !0,
229
- variant: "caption",
230
- children: t.snowball_drawer_payment_header
231
- })]
232
- }),
233
- /* @__PURE__ */ l(u, {
234
- bgcolor: r.palette.background.paper,
235
- mb: 24,
236
- children: [
237
- /* @__PURE__ */ l(u, {
238
- alignItems: "center",
239
- flexDirection: "row",
240
- pl: 24,
241
- children: [/* @__PURE__ */ e(W, {
242
- sx: {
243
- display: "flex",
244
- alignItems: "center",
245
- justifyContent: "center",
246
- width: 20,
247
- height: 20,
248
- borderRadius: "50%",
249
- backgroundColor: r.palette.success.main,
250
- marginRight: 12
251
- },
252
- children: /* @__PURE__ */ e(i, {
253
- color: "white",
254
- fontWeight: 700,
255
- variant: "body2",
256
- children: "✓"
257
- })
258
- }), /* @__PURE__ */ l(u, {
259
- sx: {
260
- borderBottom: `1px solid ${r.palette.neutral.light}`,
261
- flexDirection: "row",
262
- flexGrow: 1,
263
- py: 14,
264
- pr: 24
265
- },
266
- children: [/* @__PURE__ */ l(u, {
267
- flexGrow: 1,
268
- children: [/* @__PURE__ */ e(i, {
269
- variant: "body1",
270
- children: S(t.snowball_drawer_debt_label, "A")
271
- }), /* @__PURE__ */ l(i, {
272
- color: r.palette.secondary.main,
273
- variant: "caption",
274
- children: [
275
- S(t.snowball_drawer_rollover_explainer_pt1, "$100"),
276
- /* @__PURE__ */ e("strong", { children: S(t.snowball_drawer_debt_label, "B") }),
277
- t.snowball_drawer_rollover_explainer_pt2
278
- ]
279
- })]
280
- }), /* @__PURE__ */ l(u, { children: [/* @__PURE__ */ e(i, {
281
- variant: "body1",
282
- children: "$100.00"
283
- }), /* @__PURE__ */ e(i, {
284
- bold: !0,
285
- color: r.palette.success.main,
286
- textAlign: "end",
287
- variant: "tiny",
288
- children: t.snowball_drawer_paid_label
289
- })] })]
290
- })]
291
- }),
292
- /* @__PURE__ */ l(u, {
293
- alignItems: "center",
294
- flexDirection: "row",
295
- pl: 24,
296
- children: [/* @__PURE__ */ e(W, { sx: {
297
- width: 20,
298
- height: 20,
299
- marginRight: 12,
300
- borderRadius: "50%",
301
- border: `3px solid ${r.palette.neutral.main}`
302
- } }), /* @__PURE__ */ l(u, {
184
+ children: t.snowball_drawer_disclaimer
185
+ }
186
+ ),
187
+ /* @__PURE__ */ l(u, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
188
+ /* @__PURE__ */ e(i, { bold: !0, variant: "caption", children: T(t.snowball_drawer_month_header, 1) }),
189
+ /* @__PURE__ */ e(i, { bold: !0, variant: "caption", children: t.snowball_drawer_payment_header })
190
+ ] }),
191
+ /* @__PURE__ */ l(u, { bgcolor: o.palette.background.paper, mb: 24, children: [
192
+ /* @__PURE__ */ l(u, { alignItems: "center", flexDirection: "row", pl: 24, children: [
193
+ /* @__PURE__ */ e(
194
+ W,
195
+ {
196
+ sx: {
197
+ display: "flex",
198
+ alignItems: "center",
199
+ justifyContent: "center",
200
+ width: 20,
201
+ height: 20,
202
+ borderRadius: "50%",
203
+ backgroundColor: o.palette.success.main,
204
+ marginRight: 12
205
+ },
206
+ children: /* @__PURE__ */ e(i, { color: "white", fontWeight: 700, variant: "body2", children: "✓" })
207
+ }
208
+ ),
209
+ /* @__PURE__ */ l(
210
+ u,
211
+ {
212
+ sx: {
213
+ borderBottom: `1px solid ${o.palette.neutral.light}`,
214
+ flexDirection: "row",
215
+ flexGrow: 1,
216
+ py: 14,
217
+ pr: 24
218
+ },
219
+ children: [
220
+ /* @__PURE__ */ l(u, { flexGrow: 1, children: [
221
+ /* @__PURE__ */ e(i, { variant: "body1", children: T(t.snowball_drawer_debt_label, "A") }),
222
+ /* @__PURE__ */ l(i, { color: o.palette.secondary.main, variant: "caption", children: [
223
+ T(
224
+ t.snowball_drawer_rollover_explainer_pt1,
225
+ "$100"
226
+ ),
227
+ /* @__PURE__ */ e("strong", { children: T(t.snowball_drawer_debt_label, "B") }),
228
+ t.snowball_drawer_rollover_explainer_pt2
229
+ ] })
230
+ ] }),
231
+ /* @__PURE__ */ l(u, { children: [
232
+ /* @__PURE__ */ e(i, { variant: "body1", children: "$100.00" }),
233
+ /* @__PURE__ */ e(
234
+ i,
235
+ {
236
+ bold: !0,
237
+ color: o.palette.success.main,
238
+ textAlign: "end",
239
+ variant: "tiny",
240
+ children: t.snowball_drawer_paid_label
241
+ }
242
+ )
243
+ ] })
244
+ ]
245
+ }
246
+ )
247
+ ] }),
248
+ /* @__PURE__ */ l(u, { alignItems: "center", flexDirection: "row", pl: 24, children: [
249
+ /* @__PURE__ */ e(
250
+ W,
251
+ {
252
+ sx: {
253
+ width: 20,
254
+ height: 20,
255
+ marginRight: 12,
256
+ borderRadius: "50%",
257
+ border: `3px solid ${o.palette.neutral.main}`
258
+ }
259
+ }
260
+ ),
261
+ /* @__PURE__ */ l(
262
+ u,
263
+ {
264
+ sx: {
265
+ borderBottom: `1px solid ${o.palette.neutral.light}`,
266
+ flexDirection: "row",
267
+ flexGrow: 1,
268
+ py: 14,
269
+ pr: 24
270
+ },
271
+ children: [
272
+ /* @__PURE__ */ e(i, { flexGrow: 1, variant: "body1", children: T(t.snowball_drawer_debt_label, "B") }),
273
+ /* @__PURE__ */ e(i, { variant: "body1", children: "$400.00" })
274
+ ]
275
+ }
276
+ )
277
+ ] }),
278
+ /* @__PURE__ */ l(u, { alignItems: "center", flexDirection: "row", pl: 24, py: 14, children: [
279
+ /* @__PURE__ */ e(
280
+ W,
281
+ {
282
+ sx: {
283
+ width: 20,
284
+ height: 20,
285
+ marginRight: 12,
286
+ borderRadius: "50%",
287
+ border: `3px solid ${o.palette.neutral.main}`
288
+ }
289
+ }
290
+ ),
291
+ /* @__PURE__ */ l(u, { flexDirection: "row", flexGrow: 1, pr: 24, children: [
292
+ /* @__PURE__ */ e(i, { flexGrow: 1, variant: "body1", children: T(t.snowball_drawer_debt_label, "C") }),
293
+ /* @__PURE__ */ e(i, { variant: "body1", children: "$1,000.00" })
294
+ ] })
295
+ ] }),
296
+ /* @__PURE__ */ l(
297
+ u,
298
+ {
303
299
  sx: {
304
- borderBottom: `1px solid ${r.palette.neutral.light}`,
300
+ py: 8,
301
+ px: 24,
305
302
  flexDirection: "row",
306
- flexGrow: 1,
307
- py: 14,
308
- pr: 24
309
- },
310
- children: [/* @__PURE__ */ e(i, {
311
- flexGrow: 1,
312
- variant: "body1",
313
- children: S(t.snowball_drawer_debt_label, "B")
314
- }), /* @__PURE__ */ e(i, {
315
- variant: "body1",
316
- children: "$400.00"
317
- })]
318
- })]
319
- }),
320
- /* @__PURE__ */ l(u, {
321
- alignItems: "center",
322
- flexDirection: "row",
323
- pl: 24,
324
- py: 14,
325
- children: [/* @__PURE__ */ e(W, { sx: {
326
- width: 20,
327
- height: 20,
328
- marginRight: 12,
329
- borderRadius: "50%",
330
- border: `3px solid ${r.palette.neutral.main}`
331
- } }), /* @__PURE__ */ l(u, {
332
- flexDirection: "row",
333
- flexGrow: 1,
334
- pr: 24,
335
- children: [/* @__PURE__ */ e(i, {
336
- flexGrow: 1,
337
- variant: "body1",
338
- children: S(t.snowball_drawer_debt_label, "C")
339
- }), /* @__PURE__ */ e(i, {
340
- variant: "body1",
341
- children: "$1,000.00"
342
- })]
343
- })]
344
- }),
345
- /* @__PURE__ */ l(u, {
346
- sx: {
347
- py: 8,
348
- px: 24,
349
- flexDirection: "row",
350
- justifyContent: "space-between",
351
- borderTop: `1px solid ${r.palette.neutral.light}`,
352
- borderBottom: `1px solid ${r.palette.neutral.light}`
353
- },
354
- children: [/* @__PURE__ */ e(i, {
355
- bold: !0,
356
- variant: "body1",
357
- children: t.snowball_drawer_total_label
358
- }), /* @__PURE__ */ e(i, {
359
- bold: !0,
360
- variant: "body1",
361
- children: "$1,500.00"
362
- })]
363
- })
364
- ]
365
- }),
366
- /* @__PURE__ */ l(u, {
367
- flexDirection: "row",
368
- justifyContent: "space-between",
369
- sx: {
370
- pt: 12,
371
- px: 24,
372
- pb: 8
373
- },
374
- children: [/* @__PURE__ */ e(i, {
375
- bold: !0,
376
- variant: "caption",
377
- children: S(t.snowball_drawer_month_header, 2)
378
- }), /* @__PURE__ */ e(i, {
379
- bold: !0,
380
- variant: "caption",
381
- children: t.snowball_drawer_payment_header
382
- })]
383
- }),
384
- /* @__PURE__ */ l(u, {
385
- bgcolor: r.palette.background.paper,
386
- mb: 24,
387
- children: [
388
- /* @__PURE__ */ l(u, {
389
- alignItems: "center",
390
- flexDirection: "row",
391
- pl: 24,
392
- children: [/* @__PURE__ */ e(W, {
393
- sx: {
394
- display: "flex",
395
- alignItems: "center",
396
- justifyContent: "center",
397
- width: 20,
398
- height: 20,
399
- borderRadius: "50%",
400
- backgroundColor: r.palette.success.main,
401
- marginRight: 12
303
+ justifyContent: "space-between",
304
+ borderTop: `1px solid ${o.palette.neutral.light}`,
305
+ borderBottom: `1px solid ${o.palette.neutral.light}`
402
306
  },
403
- children: /* @__PURE__ */ e(i, {
404
- color: "white",
405
- fontWeight: 700,
406
- variant: "body2",
407
- children: "✓"
408
- })
409
- }), /* @__PURE__ */ l(u, {
307
+ children: [
308
+ /* @__PURE__ */ e(i, { bold: !0, variant: "body1", children: t.snowball_drawer_total_label }),
309
+ /* @__PURE__ */ e(i, { bold: !0, variant: "body1", children: "$1,500.00" })
310
+ ]
311
+ }
312
+ )
313
+ ] }),
314
+ /* @__PURE__ */ l(u, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
315
+ /* @__PURE__ */ e(i, { bold: !0, variant: "caption", children: T(t.snowball_drawer_month_header, 2) }),
316
+ /* @__PURE__ */ e(i, { bold: !0, variant: "caption", children: t.snowball_drawer_payment_header })
317
+ ] }),
318
+ /* @__PURE__ */ l(u, { bgcolor: o.palette.background.paper, mb: 24, children: [
319
+ /* @__PURE__ */ l(u, { alignItems: "center", flexDirection: "row", pl: 24, children: [
320
+ /* @__PURE__ */ e(
321
+ W,
322
+ {
323
+ sx: {
324
+ display: "flex",
325
+ alignItems: "center",
326
+ justifyContent: "center",
327
+ width: 20,
328
+ height: 20,
329
+ borderRadius: "50%",
330
+ backgroundColor: o.palette.success.main,
331
+ marginRight: 12
332
+ },
333
+ children: /* @__PURE__ */ e(i, { color: "white", fontWeight: 700, variant: "body2", children: "✓" })
334
+ }
335
+ ),
336
+ /* @__PURE__ */ l(
337
+ u,
338
+ {
339
+ sx: {
340
+ borderBottom: `1px solid ${o.palette.neutral.light}`,
341
+ flexDirection: "row",
342
+ flexGrow: 1,
343
+ py: 14,
344
+ pr: 24
345
+ },
346
+ children: [
347
+ /* @__PURE__ */ l(u, { flexGrow: 1, children: [
348
+ /* @__PURE__ */ e(i, { variant: "body1", children: T(t.snowball_drawer_debt_label, "B") }),
349
+ /* @__PURE__ */ l(i, { color: o.palette.secondary.main, variant: "caption", children: [
350
+ T(
351
+ t.snowball_drawer_rollover_explainer_pt1,
352
+ "$500"
353
+ ),
354
+ /* @__PURE__ */ e("strong", { children: T(t.snowball_drawer_debt_label, "C") }),
355
+ t.snowball_drawer_rollover_explainer_pt2
356
+ ] })
357
+ ] }),
358
+ /* @__PURE__ */ l(u, { children: [
359
+ /* @__PURE__ */ e(i, { variant: "body1", children: "$500.00" }),
360
+ /* @__PURE__ */ e(
361
+ i,
362
+ {
363
+ bold: !0,
364
+ color: o.palette.success.main,
365
+ textAlign: "end",
366
+ variant: "tiny",
367
+ children: t.snowball_drawer_paid_label
368
+ }
369
+ )
370
+ ] })
371
+ ]
372
+ }
373
+ )
374
+ ] }),
375
+ /* @__PURE__ */ l(u, { alignItems: "center", flexDirection: "row", pl: 24, children: [
376
+ /* @__PURE__ */ e(
377
+ W,
378
+ {
379
+ sx: {
380
+ width: 20,
381
+ height: 20,
382
+ marginRight: 12,
383
+ borderRadius: "50%",
384
+ border: `3px solid ${o.palette.neutral.main}`
385
+ }
386
+ }
387
+ ),
388
+ /* @__PURE__ */ l(
389
+ u,
390
+ {
391
+ sx: {
392
+ flexDirection: "row",
393
+ flexGrow: 1,
394
+ py: 14,
395
+ pr: 24
396
+ },
397
+ children: [
398
+ /* @__PURE__ */ e(i, { flexGrow: 1, variant: "body1", children: T(t.snowball_drawer_debt_label, "C") }),
399
+ /* @__PURE__ */ e(i, { variant: "body1", children: "$1,000.00" })
400
+ ]
401
+ }
402
+ )
403
+ ] }),
404
+ /* @__PURE__ */ l(
405
+ u,
406
+ {
410
407
  sx: {
411
- borderBottom: `1px solid ${r.palette.neutral.light}`,
408
+ py: 8,
409
+ px: 24,
412
410
  flexDirection: "row",
413
- flexGrow: 1,
414
- py: 14,
415
- pr: 24
411
+ justifyContent: "space-between",
412
+ borderTop: `1px solid ${o.palette.neutral.light}`,
413
+ borderBottom: `1px solid ${o.palette.neutral.light}`
416
414
  },
417
- children: [/* @__PURE__ */ l(u, {
418
- flexGrow: 1,
419
- children: [/* @__PURE__ */ e(i, {
420
- variant: "body1",
421
- children: S(t.snowball_drawer_debt_label, "B")
422
- }), /* @__PURE__ */ l(i, {
423
- color: r.palette.secondary.main,
424
- variant: "caption",
425
- children: [
426
- S(t.snowball_drawer_rollover_explainer_pt1, "$500"),
427
- /* @__PURE__ */ e("strong", { children: S(t.snowball_drawer_debt_label, "C") }),
428
- t.snowball_drawer_rollover_explainer_pt2
429
- ]
430
- })]
431
- }), /* @__PURE__ */ l(u, { children: [/* @__PURE__ */ e(i, {
432
- variant: "body1",
433
- children: "$500.00"
434
- }), /* @__PURE__ */ e(i, {
435
- bold: !0,
436
- color: r.palette.success.main,
437
- textAlign: "end",
438
- variant: "tiny",
439
- children: t.snowball_drawer_paid_label
440
- })] })]
441
- })]
442
- }),
443
- /* @__PURE__ */ l(u, {
444
- alignItems: "center",
445
- flexDirection: "row",
446
- pl: 24,
447
- children: [/* @__PURE__ */ e(W, { sx: {
448
- width: 20,
449
- height: 20,
450
- marginRight: 12,
451
- borderRadius: "50%",
452
- border: `3px solid ${r.palette.neutral.main}`
453
- } }), /* @__PURE__ */ l(u, {
415
+ children: [
416
+ /* @__PURE__ */ e(i, { bold: !0, variant: "body1", children: t.snowball_drawer_total_label }),
417
+ /* @__PURE__ */ e(i, { bold: !0, variant: "body1", children: "$1,500.00" })
418
+ ]
419
+ }
420
+ )
421
+ ] }),
422
+ /* @__PURE__ */ l(u, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
423
+ /* @__PURE__ */ e(i, { bold: !0, variant: "caption", children: T(t.snowball_drawer_month_header, 3) }),
424
+ /* @__PURE__ */ e(i, { bold: !0, variant: "caption", children: t.snowball_drawer_payment_header })
425
+ ] }),
426
+ /* @__PURE__ */ l(u, { bgcolor: o.palette.background.paper, mb: 24, children: [
427
+ /* @__PURE__ */ l(u, { alignItems: "center", flexDirection: "row", pl: 24, children: [
428
+ /* @__PURE__ */ e(
429
+ W,
430
+ {
431
+ sx: {
432
+ display: "flex",
433
+ alignItems: "center",
434
+ justifyContent: "center",
435
+ width: 20,
436
+ height: 20,
437
+ borderRadius: "50%",
438
+ backgroundColor: o.palette.success.main,
439
+ marginRight: 12
440
+ },
441
+ children: /* @__PURE__ */ e(i, { color: "white", fontWeight: 700, variant: "body2", children: "✓" })
442
+ }
443
+ ),
444
+ /* @__PURE__ */ l(
445
+ u,
446
+ {
447
+ sx: {
448
+ alignItems: "center",
449
+ flexDirection: "row",
450
+ flexGrow: 1,
451
+ py: 14,
452
+ pr: 24
453
+ },
454
+ children: [
455
+ /* @__PURE__ */ e(u, { flexGrow: 1, children: /* @__PURE__ */ e(i, { variant: "body1", children: T(t.snowball_drawer_debt_label, "C") }) }),
456
+ /* @__PURE__ */ l(u, { children: [
457
+ /* @__PURE__ */ e(i, { variant: "body1", children: "$1,500.00" }),
458
+ /* @__PURE__ */ e(
459
+ i,
460
+ {
461
+ bold: !0,
462
+ color: o.palette.success.main,
463
+ textAlign: "end",
464
+ variant: "tiny",
465
+ children: t.snowball_drawer_paid_label
466
+ }
467
+ )
468
+ ] })
469
+ ]
470
+ }
471
+ )
472
+ ] }),
473
+ /* @__PURE__ */ l(
474
+ u,
475
+ {
454
476
  sx: {
477
+ py: 8,
478
+ px: 24,
455
479
  flexDirection: "row",
456
- flexGrow: 1,
457
- py: 14,
458
- pr: 24
480
+ justifyContent: "space-between",
481
+ borderTop: `1px solid ${o.palette.neutral.light}`,
482
+ borderBottom: `1px solid ${o.palette.neutral.light}`
459
483
  },
460
- children: [/* @__PURE__ */ e(i, {
461
- flexGrow: 1,
462
- variant: "body1",
463
- children: S(t.snowball_drawer_debt_label, "C")
464
- }), /* @__PURE__ */ e(i, {
465
- variant: "body1",
466
- children: "$1,000.00"
467
- })]
468
- })]
469
- }),
470
- /* @__PURE__ */ l(u, {
471
- sx: {
472
- py: 8,
473
- px: 24,
474
- flexDirection: "row",
475
- justifyContent: "space-between",
476
- borderTop: `1px solid ${r.palette.neutral.light}`,
477
- borderBottom: `1px solid ${r.palette.neutral.light}`
478
- },
479
- children: [/* @__PURE__ */ e(i, {
480
- bold: !0,
481
- variant: "body1",
482
- children: t.snowball_drawer_total_label
483
- }), /* @__PURE__ */ e(i, {
484
- bold: !0,
485
- variant: "body1",
486
- children: "$1,500.00"
487
- })]
488
- })
489
- ]
490
- }),
491
- /* @__PURE__ */ l(u, {
492
- flexDirection: "row",
493
- justifyContent: "space-between",
494
- sx: {
495
- pt: 12,
496
- px: 24,
497
- pb: 8
498
- },
499
- children: [/* @__PURE__ */ e(i, {
500
- bold: !0,
501
- variant: "caption",
502
- children: S(t.snowball_drawer_month_header, 3)
503
- }), /* @__PURE__ */ e(i, {
504
- bold: !0,
505
- variant: "caption",
506
- children: t.snowball_drawer_payment_header
507
- })]
508
- }),
509
- /* @__PURE__ */ l(u, {
510
- bgcolor: r.palette.background.paper,
511
- mb: 24,
512
- children: [/* @__PURE__ */ l(u, {
513
- alignItems: "center",
514
- flexDirection: "row",
515
- pl: 24,
516
- children: [/* @__PURE__ */ e(W, {
517
- sx: {
518
- display: "flex",
519
- alignItems: "center",
520
- justifyContent: "center",
521
- width: 20,
522
- height: 20,
523
- borderRadius: "50%",
524
- backgroundColor: r.palette.success.main,
525
- marginRight: 12
526
- },
527
- children: /* @__PURE__ */ e(i, {
528
- color: "white",
529
- fontWeight: 700,
530
- variant: "body2",
531
- children: "✓"
532
- })
533
- }), /* @__PURE__ */ l(u, {
534
- sx: {
535
- alignItems: "center",
536
- flexDirection: "row",
537
- flexGrow: 1,
538
- py: 14,
539
- pr: 24
540
- },
541
- children: [/* @__PURE__ */ e(u, {
542
- flexGrow: 1,
543
- children: /* @__PURE__ */ e(i, {
544
- variant: "body1",
545
- children: S(t.snowball_drawer_debt_label, "C")
546
- })
547
- }), /* @__PURE__ */ l(u, { children: [/* @__PURE__ */ e(i, {
548
- variant: "body1",
549
- children: "$1,500.00"
550
- }), /* @__PURE__ */ e(i, {
551
- bold: !0,
552
- color: r.palette.success.main,
553
- textAlign: "end",
554
- variant: "tiny",
555
- children: t.snowball_drawer_paid_label
556
- })] })]
557
- })]
558
- }), /* @__PURE__ */ l(u, {
559
- sx: {
560
- py: 8,
561
- px: 24,
562
- flexDirection: "row",
563
- justifyContent: "space-between",
564
- borderTop: `1px solid ${r.palette.neutral.light}`,
565
- borderBottom: `1px solid ${r.palette.neutral.light}`
566
- },
567
- children: [/* @__PURE__ */ e(i, {
568
- bold: !0,
569
- variant: "body1",
570
- children: t.snowball_drawer_total_label
571
- }), /* @__PURE__ */ e(i, {
572
- bold: !0,
573
- variant: "body1",
574
- children: "$1,500.00"
575
- })]
576
- })]
577
- })
578
- ] })]
579
- })
580
- });
581
- }, yt = v(_t), ft = "#FF7B08";
582
- function gt(a, n) {
583
- const [r, t, o] = a.replace(/^#/, "").match(/.{1,2}/g).map((p) => parseInt(p, 16)), s = [
584
- Math.max(0, Math.min(255, Math.round(r * n))),
484
+ children: [
485
+ /* @__PURE__ */ e(i, { bold: !0, variant: "body1", children: t.snowball_drawer_total_label }),
486
+ /* @__PURE__ */ e(i, { bold: !0, variant: "body1", children: "$1,500.00" })
487
+ ]
488
+ }
489
+ )
490
+ ] })
491
+ ] })
492
+ ] })
493
+ }
494
+ );
495
+ }, yt = C(_t), ft = "#FF7B08";
496
+ function gt(r, n) {
497
+ const [o, t, a] = r.replace(/^#/, "").match(/.{1,2}/g).map((d) => parseInt(d, 16)), s = [
498
+ Math.max(0, Math.min(255, Math.round(o * n))),
585
499
  Math.max(0, Math.min(255, Math.round(t * n))),
586
- Math.max(0, Math.min(255, Math.round(o * n)))
500
+ Math.max(0, Math.min(255, Math.round(a * n)))
587
501
  ];
588
502
  return `rgb(${s[0]}, ${s[1]}, ${s[2]})`;
589
503
  }
590
- var De = ({ sx: a, height: n = 500, width: r, debts: t, hoveredDebtGuid: o, onClickArea: s, onHoverArea: p }) => {
591
- const c = et(), { onEvent: m } = E(), h = t.filter((d) => !d.is_impossible), b = [...new Set(h.flatMap((d) => d.dataset.map((f) => new Date(f.x).getTime())))].sort((d, f) => d - f).map((d) => new Date(d)), I = h.map((d) => {
592
- const f = new Map(d.dataset.map((R) => [new Date(R.x).getTime(), R.y]));
593
- let T = f.get(b[0].getTime()) ?? 0;
594
- const $ = b.map((R) => {
595
- const Y = f.get(R.getTime()) ?? T;
596
- return T = Y, {
597
- x: R,
598
- y: Y
599
- };
504
+ const De = ({
505
+ sx: r,
506
+ height: n = 500,
507
+ width: o,
508
+ debts: t,
509
+ hoveredDebtGuid: a,
510
+ onClickArea: s,
511
+ onHoverArea: d
512
+ }) => {
513
+ const c = qe(), { onEvent: m } = k(), h = t.filter((p) => !p.is_impossible), b = [
514
+ ...new Set(
515
+ h.flatMap((p) => p.dataset.map((g) => new Date(g.x).getTime()))
516
+ )
517
+ ].sort((p, g) => p - g).map((p) => new Date(p)), v = h.map((p) => {
518
+ const g = new Map(p.dataset.map((B) => [new Date(B.x).getTime(), B.y]));
519
+ let D = g.get(b[0].getTime()) ?? 0;
520
+ const M = b.map((B) => {
521
+ const K = g.get(B.getTime()) ?? D;
522
+ return D = K, { x: B, y: K };
600
523
  });
524
+ return { ...p, dataset: M };
525
+ }), x = v.reduce(
526
+ (p, g) => p + (g.dataset[0]?.y ?? 0),
527
+ 0
528
+ ), L = b.map((p, g) => {
529
+ const D = g / (b.length - 1), M = x * (1 - D);
530
+ return { x: p, y: M };
531
+ }), F = Math.ceil(x / 100) * 100, N = b, A = v.map((p, g) => {
532
+ const D = 1 - g / v.length * 0.5, M = gt(ft, D);
601
533
  return {
602
- ...d,
603
- dataset: $
604
- };
605
- }), x = I.reduce((d, f) => d + (f.dataset[0]?.y ?? 0), 0), F = b.map((d, f) => ({
606
- x: d,
607
- y: x * (1 - f / (b.length - 1))
608
- })), k = Math.ceil(x / 100) * 100, N = b, D = I.map((d, f) => {
609
- const T = gt(ft, 1 - f / I.length * 0.5);
610
- return {
611
- id: `debt-${f}`,
612
- guid: d.guid,
613
- label: d.name,
614
- data: d.dataset.map(($) => $.y),
615
- color: T,
534
+ id: `debt-${g}`,
535
+ guid: p.guid,
536
+ label: p.name,
537
+ data: p.dataset.map((B) => B.y),
538
+ color: M,
616
539
  curve: "linear",
617
540
  type: "line",
618
541
  area: !0,
@@ -620,10 +543,10 @@ var De = ({ sx: a, height: n = 500, width: r, debts: t, hoveredDebtGuid: o, onCl
620
543
  showMark: !1
621
544
  };
622
545
  });
623
- D.push({
546
+ A.push({
624
547
  id: "payoff-line",
625
548
  label: "Payoff Line",
626
- data: F.map((d) => d.y),
549
+ data: L.map((p) => p.y),
627
550
  color: c.palette.grey[700],
628
551
  curve: "linear",
629
552
  type: "line",
@@ -631,177 +554,170 @@ var De = ({ sx: a, height: n = 500, width: r, debts: t, hoveredDebtGuid: o, onCl
631
554
  showMark: !1,
632
555
  disableHighlight: !0
633
556
  });
634
- const P = (d) => D.findIndex((f) => f?.guid === d);
635
- return /* @__PURE__ */ e(se, {
636
- sx: {
637
- width: "100%",
638
- height: "100%",
639
- touchAction: "pan-y",
640
- "& svg": {
641
- touchAction: "pan-y",
642
- userSelect: "none"
643
- },
644
- "& .recharts-wrapper": { touchAction: "pan-y" }
645
- },
646
- children: /* @__PURE__ */ e(pt, {
647
- axisHighlight: { x: "none" },
648
- disableLineItemHighlight: !0,
649
- height: n,
650
- hideLegend: !0,
651
- margin: {
652
- bottom: 24,
653
- left: 32,
654
- right: 72,
655
- top: 48
656
- },
657
- onAreaClick: (d, f) => {
658
- s?.();
659
- const T = D.find(($) => $.id === f.seriesId);
660
- m(C.DEBTS_CLICK_CHART_AREA, { account_guid: T?.guid });
661
- },
662
- onHighlightChange: (d) => {
663
- const f = D.find((T) => T.id === d?.seriesId)?.guid;
664
- p?.(f ?? "");
665
- },
666
- series: D,
667
- skipAnimation: !0,
668
- slotProps: { tooltip: { trigger: "none" } },
557
+ const E = (p) => A.findIndex((g) => g?.guid === p);
558
+ return /* @__PURE__ */ e(
559
+ le,
560
+ {
669
561
  sx: {
670
- p: 4,
671
- "& .MuiBarLabel-root": {
672
- fontSize: 10,
673
- fontWeight: 600
674
- },
675
- "& .MuiAreaElement-root": {
676
- opacity: 0.4,
677
- transition: "opacity 0.3s ease"
678
- },
679
- "& .MuiAreaElement-root:hover": { opacity: 1 },
680
- "& .MuiLineElement-series-payoff-line": {
681
- strokeDasharray: "10 5",
682
- strokeWidth: 1
562
+ width: "100%",
563
+ height: "100%",
564
+ touchAction: "pan-y",
565
+ "& svg": {
566
+ touchAction: "pan-y",
567
+ userSelect: "none"
683
568
  },
684
- [`& .MuiLineElement-series-debt-${P(o ?? "0")}`]: { opacity: 1 },
685
- [`& .MuiAreaElement-series-debt-${P(o ?? "0")}`]: { opacity: 1 },
686
- "& .MuiChartsAxis-tickLabel > tspan": { fontFamily: c.typography.body2.fontFamily },
687
- ...a
688
- },
689
- width: r,
690
- xAxis: [{
691
- data: N,
692
- disableTicks: !0,
693
- min: b[0],
694
- scaleType: "time",
695
- tickLabelMinGap: 24,
696
- valueFormatter: (d) => Q(d, Z.MONTH_SHORT_YEAR)
697
- }],
698
- yAxis: [{
699
- min: 0,
700
- max: k,
701
- disableTicks: !0,
702
- valueFormatter: (d) => A(d, "0a")
703
- }]
704
- })
705
- });
706
- }, xt = () => {
707
- const a = j(), { debts: n } = w(), { selectedDebtChartData: r } = M();
708
- return /* @__PURE__ */ l(B, { children: [/* @__PURE__ */ l(ot, {
709
- sx: { "& .MuiCardContent-root:last-child": { pb: 0 } },
710
- children: [/* @__PURE__ */ e(lt, {
711
- sx: { pb: 0 },
712
- title: /* @__PURE__ */ e(Je, {
713
- sx: { pb: 4 },
714
- children: n.details_chart_title
715
- })
716
- }), /* @__PURE__ */ e(it, {
717
- sx: { p: 0 },
718
- children: /* @__PURE__ */ e(De, {
719
- debts: [r],
720
- height: 250
721
- })
722
- })]
723
- }), /* @__PURE__ */ e(i, {
724
- color: a.palette.text.secondary,
725
- sx: {
726
- textAlign: "center",
727
- px: 8,
728
- py: 12
729
- },
730
- variant: "body2",
731
- children: n.details_chart_description
732
- })] });
733
- }, wt = v(xt), vt = () => {
734
- const a = j(), { onEvent: n } = E(), { debts: r } = w(), { selectedDebtChartData: t, showCompleted: o, showError: s } = M();
735
- return g.useEffect(() => n(C.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(Ce, { children: s || o ? /* @__PURE__ */ e(i, {
736
- color: a.palette.secondary.main,
737
- component: "div",
738
- sx: {
739
- p: 32,
740
- textAlign: "center"
741
- },
742
- variant: "body2",
743
- children: s ? r.schedule_error_message : r.schedule_complete_message
744
- }) : /* @__PURE__ */ l(B, { children: [
745
- /* @__PURE__ */ l(y, {
746
- flexDirection: "row",
747
- justifyContent: "space-between",
748
- sx: {
749
- pt: 12,
750
- px: 24,
751
- pb: 8
569
+ "& .recharts-wrapper": {
570
+ touchAction: "pan-y"
571
+ }
752
572
  },
753
- children: [/* @__PURE__ */ e(i, {
754
- bold: !0,
755
- variant: "caption",
756
- children: r.schedule_month_heading
757
- }), /* @__PURE__ */ e(i, {
758
- bold: !0,
759
- variant: "caption",
760
- children: r.schedule_amount_heading
761
- })]
762
- }),
763
- t.dataset.slice(1).map(({ x: p, y: c, payment: m }) => /* @__PURE__ */ e(y, {
764
- bgcolor: a.palette.background.paper,
765
- children: /* @__PURE__ */ e(y, {
766
- alignItems: "center",
767
- flexDirection: "row",
768
- pl: 24,
769
- children: /* @__PURE__ */ l(y, {
573
+ children: /* @__PURE__ */ e(
574
+ Xe,
575
+ {
576
+ axisHighlight: { x: "none" },
577
+ disableLineItemHighlight: !0,
578
+ height: n,
579
+ hideLegend: !0,
580
+ margin: { bottom: 24, left: 32, right: 72, top: 48 },
581
+ onAreaClick: (p, g) => {
582
+ s?.();
583
+ const D = A.find((M) => M.id === g.seriesId);
584
+ m(S.DEBTS_CLICK_CHART_AREA, { account_guid: D?.guid });
585
+ },
586
+ onHighlightChange: (p) => {
587
+ const g = A.find((D) => D.id === p?.seriesId)?.guid;
588
+ d?.(g ?? "");
589
+ },
590
+ series: A,
591
+ skipAnimation: !0,
592
+ slotProps: { tooltip: { trigger: "none" } },
770
593
  sx: {
771
- borderBottom: `1px solid ${a.palette.divider}`,
772
- flexDirection: "row",
773
- flexGrow: 1,
774
- py: 14,
775
- pr: 24
594
+ p: 4,
595
+ "& .MuiBarLabel-root": {
596
+ fontSize: 10,
597
+ fontWeight: 600
598
+ },
599
+ "& .MuiAreaElement-root": {
600
+ opacity: 0.4,
601
+ transition: "opacity 0.3s ease"
602
+ },
603
+ "& .MuiAreaElement-root:hover": {
604
+ opacity: 1
605
+ },
606
+ "& .MuiLineElement-series-payoff-line": {
607
+ strokeDasharray: "10 5",
608
+ strokeWidth: 1
609
+ },
610
+ [`& .MuiLineElement-series-debt-${E(a ?? "0")}`]: {
611
+ opacity: 1
612
+ },
613
+ [`& .MuiAreaElement-series-debt-${E(a ?? "0")}`]: {
614
+ opacity: 1
615
+ },
616
+ "& .MuiChartsAxis-tickLabel > tspan": {
617
+ fontFamily: c.typography.body2.fontFamily
618
+ },
619
+ ...r
776
620
  },
777
- children: [/* @__PURE__ */ l(y, {
778
- flexGrow: 1,
779
- children: [/* @__PURE__ */ e(i, {
780
- bold: !0,
781
- variant: "body1",
782
- children: Q(p, Z.MONTH_YEAR)
783
- }), /* @__PURE__ */ e(i, {
784
- color: a.palette.secondary.main,
785
- variant: "caption",
786
- children: r.schedule_month_label
787
- })]
788
- }), /* @__PURE__ */ l(y, { children: [/* @__PURE__ */ e(i, {
789
- bold: !0,
790
- variant: "body1",
791
- children: A(c, "0,0.00")
792
- }), /* @__PURE__ */ e(i, {
793
- bold: !0,
794
- color: a.palette.success.main,
795
- textAlign: "end",
796
- variant: "tiny",
797
- children: `+${A(m, "0,0")}`
798
- })] })]
799
- })
800
- })
801
- }, String(p))),
802
- /* @__PURE__ */ e(y, {
803
- bgcolor: "background.paper",
804
- children: /* @__PURE__ */ l(y, {
621
+ width: o,
622
+ xAxis: [
623
+ {
624
+ data: N,
625
+ disableTicks: !0,
626
+ min: b[0],
627
+ scaleType: "time",
628
+ tickLabelMinGap: 24,
629
+ valueFormatter: (p) => J(p, Q.MONTH_SHORT_YEAR)
630
+ }
631
+ ],
632
+ yAxis: [
633
+ {
634
+ min: 0,
635
+ max: F,
636
+ disableTicks: !0,
637
+ valueFormatter: (p) => I(p, "0a")
638
+ }
639
+ ]
640
+ }
641
+ )
642
+ }
643
+ );
644
+ }, xt = () => {
645
+ const r = j(), { debts: n } = w(), { selectedDebtChartData: o } = P();
646
+ return /* @__PURE__ */ l(R, { children: [
647
+ /* @__PURE__ */ l(
648
+ Ye,
649
+ {
650
+ sx: {
651
+ "& .MuiCardContent-root:last-child": {
652
+ pb: 0
653
+ }
654
+ },
655
+ children: [
656
+ /* @__PURE__ */ e(Ue, { sx: { pb: 0 }, title: /* @__PURE__ */ e(Be, { sx: { pb: 4 }, children: n.details_chart_title }) }),
657
+ /* @__PURE__ */ e(Ke, { sx: { p: 0 }, children: /* @__PURE__ */ e(De, { debts: [o], height: 250 }) })
658
+ ]
659
+ }
660
+ ),
661
+ /* @__PURE__ */ e(
662
+ i,
663
+ {
664
+ color: r.palette.text.secondary,
665
+ sx: { textAlign: "center", px: 8, py: 12 },
666
+ variant: "body2",
667
+ children: n.details_chart_description
668
+ }
669
+ )
670
+ ] });
671
+ }, wt = C(xt), Ct = () => {
672
+ const r = j(), { onEvent: n } = k(), { debts: o } = w(), { selectedDebtChartData: t, showCompleted: a, showError: s } = P();
673
+ return f.useEffect(() => n(S.DEBT_SCHEDULE_VIEW), []), /* @__PURE__ */ e(we, { children: s || a ? /* @__PURE__ */ e(
674
+ i,
675
+ {
676
+ color: r.palette.secondary.main,
677
+ component: "div",
678
+ sx: { p: 32, textAlign: "center" },
679
+ variant: "body2",
680
+ children: s ? o.schedule_error_message : o.schedule_complete_message
681
+ }
682
+ ) : /* @__PURE__ */ l(R, { children: [
683
+ /* @__PURE__ */ l(y, { flexDirection: "row", justifyContent: "space-between", sx: { pt: 12, px: 24, pb: 8 }, children: [
684
+ /* @__PURE__ */ e(i, { bold: !0, variant: "caption", children: o.schedule_month_heading }),
685
+ /* @__PURE__ */ e(i, { bold: !0, variant: "caption", children: o.schedule_amount_heading })
686
+ ] }),
687
+ t.dataset.slice(1).map(({ x: d, y: c, payment: m }) => /* @__PURE__ */ e(y, { bgcolor: r.palette.background.paper, children: /* @__PURE__ */ e(y, { alignItems: "center", flexDirection: "row", pl: 24, children: /* @__PURE__ */ l(
688
+ y,
689
+ {
690
+ sx: {
691
+ borderBottom: `1px solid ${r.palette.divider}`,
692
+ flexDirection: "row",
693
+ flexGrow: 1,
694
+ py: 14,
695
+ pr: 24
696
+ },
697
+ children: [
698
+ /* @__PURE__ */ l(y, { flexGrow: 1, children: [
699
+ /* @__PURE__ */ e(i, { bold: !0, variant: "body1", children: J(d, Q.MONTH_YEAR) }),
700
+ /* @__PURE__ */ e(i, { color: r.palette.secondary.main, variant: "caption", children: o.schedule_month_label })
701
+ ] }),
702
+ /* @__PURE__ */ l(y, { children: [
703
+ /* @__PURE__ */ e(i, { bold: !0, variant: "body1", children: I(c, "0,0.00") }),
704
+ /* @__PURE__ */ e(
705
+ i,
706
+ {
707
+ bold: !0,
708
+ color: r.palette.success.main,
709
+ textAlign: "end",
710
+ variant: "tiny",
711
+ children: `+${I(m, "0,0")}`
712
+ }
713
+ )
714
+ ] })
715
+ ]
716
+ }
717
+ ) }) }, String(d))),
718
+ /* @__PURE__ */ e(y, { bgcolor: "background.paper", children: /* @__PURE__ */ l(
719
+ y,
720
+ {
805
721
  sx: {
806
722
  alignItems: "center",
807
723
  flexDirection: "row",
@@ -809,139 +725,136 @@ var De = ({ sx: a, height: n = 500, width: r, debts: t, hoveredDebtGuid: o, onCl
809
725
  py: 14,
810
726
  px: 24
811
727
  },
812
- children: [/* @__PURE__ */ e(i, {
813
- flexGrow: 1,
814
- variant: "body1",
815
- children: r.schedule_payoff_label
816
- }), /* @__PURE__ */ e(i, {
817
- variant: "body1",
818
- children: "-"
819
- })]
820
- })
821
- })
728
+ children: [
729
+ /* @__PURE__ */ e(i, { flexGrow: 1, variant: "body1", children: o.schedule_payoff_label }),
730
+ /* @__PURE__ */ e(i, { variant: "body1", children: "-" })
731
+ ]
732
+ }
733
+ ) })
822
734
  ] }) });
823
- }, Ct = v(vt), Dt = v(({ debt: a }) => {
824
- const { debts: n } = w(), { updateAccount: r } = re(), { onEvent: t } = E(), [o, s] = g.useState(a.interest_rate ?? 0), p = o < 0, c = async () => {
825
- await r({
826
- ...a.account,
827
- interest_rate: o
828
- }), a.interest_rate = o, t(C.DEBTS_SAVE_RATE_ACTION, { account_guid: a.guid });
735
+ }, vt = C(Ct), Dt = C(({ debt: r }) => {
736
+ const { debts: n } = w(), { updateAccount: o } = te(), { onEvent: t } = k(), [a, s] = f.useState(r.interest_rate ?? 0), d = a < 0, c = async () => {
737
+ await o({ ...r.account, interest_rate: a }), r.interest_rate = a, t(S.DEBTS_SAVE_RATE_ACTION, { account_guid: r.guid });
829
738
  }, m = () => {
830
739
  setTimeout(() => {
831
- s(a.interest_rate ?? 0);
740
+ s(r.interest_rate ?? 0);
832
741
  }, 250);
833
742
  };
834
- return /* @__PURE__ */ e(ee, {
835
- isSaveDisabled: p,
836
- label: `${n.details_interest_rate} (%)`,
837
- onCancel: m,
838
- onSave: c,
839
- primaryText: n.details_interest_rate,
840
- secondaryText: Le(Number(a.interest_rate) / 100),
841
- zeroStateText: a.interest_rate ? void 0 : n.add_interest_rate,
842
- children: /* @__PURE__ */ e(dt, {
843
- error: p,
844
- fullWidth: !0,
845
- onChange: (h) => s(isNaN(parseFloat(h.target.value)) ? 0 : parseFloat(h.target.value)),
846
- type: "number",
847
- value: o
848
- })
849
- });
850
- }), St = v(({ debt: a }) => {
851
- const { debts: n } = w(), { updateAccount: r } = re(), { onEvent: t } = E(), [o, s] = g.useState(a.monthly_payment ?? 0), p = o < 0 || o > 9999999999e-2, c = async () => {
852
- await r({
853
- ...a.account,
854
- minimum_payment: o
855
- }), a.monthly_payment = o, t(C.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: a.guid });
743
+ return /* @__PURE__ */ e(
744
+ re,
745
+ {
746
+ isSaveDisabled: d,
747
+ label: `${n.details_interest_rate} (%)`,
748
+ onCancel: m,
749
+ onSave: c,
750
+ primaryText: n.details_interest_rate,
751
+ secondaryText: We(Number(r.interest_rate) / 100),
752
+ zeroStateText: r.interest_rate ? void 0 : n.add_interest_rate,
753
+ children: /* @__PURE__ */ e(
754
+ tt,
755
+ {
756
+ error: d,
757
+ fullWidth: !0,
758
+ onChange: (h) => s(isNaN(parseFloat(h.target.value)) ? 0 : parseFloat(h.target.value)),
759
+ type: "number",
760
+ value: a
761
+ }
762
+ )
763
+ }
764
+ );
765
+ }), St = C(({ debt: r }) => {
766
+ const { debts: n } = w(), { updateAccount: o } = te(), { onEvent: t } = k(), [a, s] = f.useState(r.monthly_payment ?? 0), d = a < 0 || a > 9999999999e-2, c = async () => {
767
+ await o({ ...r.account, minimum_payment: a }), r.monthly_payment = a, t(S.DEBTS_SAVE_PAYMENT_ACTION, { account_guid: r.guid });
856
768
  }, m = () => {
857
769
  setTimeout(() => {
858
- s(a.monthly_payment ?? 0);
770
+ s(r.monthly_payment ?? 0);
859
771
  }, 250);
860
772
  };
861
- return /* @__PURE__ */ e(ee, {
862
- isSaveDisabled: p,
863
- label: n.details_monthly_payment,
864
- onCancel: m,
865
- onSave: c,
866
- primaryText: n.details_monthly_payment,
867
- secondaryText: A(a.monthly_payment, "0,0"),
868
- zeroStateText: a.monthly_payment ? void 0 : n.add_monthly_payment,
869
- children: /* @__PURE__ */ e(oe, {
870
- amount: o,
871
- autoFocus: !0,
872
- error: p,
873
- fullWidth: !0,
874
- minAmount: 0,
875
- setAmount: (h) => s(isNaN(Number(h)) ? o : Number(h)),
876
- sx: { ".MuiTypography-body1": { p: 0 } }
877
- })
878
- });
879
- }), At = v(({ debt: a }) => {
880
- const { debts: n } = w(), { updateAccount: r } = re(), { onEvent: t } = E(), [o, s] = g.useState(a.original_balance ?? 0), p = o < 0 || o > 9999999999e-2, c = async () => {
881
- await r({
882
- ...a.account,
883
- original_balance: o
884
- }), a.original_balance = o, t(C.DEBTS_SAVE_BALANCE_ACTION, { account_guid: a.guid });
773
+ return /* @__PURE__ */ e(
774
+ re,
775
+ {
776
+ isSaveDisabled: d,
777
+ label: n.details_monthly_payment,
778
+ onCancel: m,
779
+ onSave: c,
780
+ primaryText: n.details_monthly_payment,
781
+ secondaryText: I(r.monthly_payment, "0,0"),
782
+ zeroStateText: r.monthly_payment ? void 0 : n.add_monthly_payment,
783
+ children: /* @__PURE__ */ e(
784
+ se,
785
+ {
786
+ amount: a,
787
+ autoFocus: !0,
788
+ error: d,
789
+ fullWidth: !0,
790
+ minAmount: 0,
791
+ setAmount: (h) => s(isNaN(Number(h)) ? a : Number(h)),
792
+ sx: { ".MuiTypography-body1": { p: 0 } }
793
+ }
794
+ )
795
+ }
796
+ );
797
+ }), At = C(({ debt: r }) => {
798
+ const { debts: n } = w(), { updateAccount: o } = te(), { onEvent: t } = k(), [a, s] = f.useState(r.original_balance ?? 0), d = a < 0 || a > 9999999999e-2, c = async () => {
799
+ await o({ ...r.account, original_balance: a }), r.original_balance = a, t(S.DEBTS_SAVE_BALANCE_ACTION, { account_guid: r.guid });
885
800
  }, m = () => {
886
801
  setTimeout(() => {
887
- s(a.original_balance ?? 0);
802
+ s(r.original_balance ?? 0);
888
803
  }, 250);
889
804
  };
890
- return /* @__PURE__ */ e(ee, {
891
- isSaveDisabled: p,
892
- label: n.details_original_balance,
893
- onCancel: m,
894
- onSave: c,
895
- primaryText: n.details_original_balance,
896
- secondaryText: A(a.original_balance, "0,0"),
897
- zeroStateText: a.original_balance ? void 0 : n.add_original_balance,
898
- children: /* @__PURE__ */ e(oe, {
899
- amount: o,
900
- autoFocus: !0,
901
- error: p,
902
- fullWidth: !0,
903
- minAmount: 0,
904
- setAmount: (h) => s(isNaN(Number(h)) ? o : Number(h)),
905
- sx: { ".MuiTypography-body1": { p: 0 } }
906
- })
907
- });
805
+ return /* @__PURE__ */ e(
806
+ re,
807
+ {
808
+ isSaveDisabled: d,
809
+ label: n.details_original_balance,
810
+ onCancel: m,
811
+ onSave: c,
812
+ primaryText: n.details_original_balance,
813
+ secondaryText: I(r.original_balance, "0,0"),
814
+ zeroStateText: r.original_balance ? void 0 : n.add_original_balance,
815
+ children: /* @__PURE__ */ e(
816
+ se,
817
+ {
818
+ amount: a,
819
+ autoFocus: !0,
820
+ error: d,
821
+ fullWidth: !0,
822
+ minAmount: 0,
823
+ setAmount: (h) => s(isNaN(Number(h)) ? a : Number(h)),
824
+ sx: { ".MuiTypography-body1": { p: 0 } }
825
+ }
826
+ )
827
+ }
828
+ );
908
829
  }), Tt = () => {
909
- const { onEvent: a } = E(), { selectedDebtChartData: n } = M();
910
- return g.useEffect(() => a(C.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ l(y, {
911
- bgcolor: "background.paper",
912
- children: [n?.goal && /* @__PURE__ */ l(B, { children: [
913
- /* @__PURE__ */ e(Ue, { goal: n.goal }),
830
+ const { onEvent: r } = k(), { selectedDebtChartData: n } = P();
831
+ return f.useEffect(() => r(S.DEBT_DETAILS_VIEW), []), /* @__PURE__ */ l(y, { bgcolor: "background.paper", children: [
832
+ n?.goal && /* @__PURE__ */ l(R, { children: [
833
+ /* @__PURE__ */ e(Je, { goal: n.goal }),
914
834
  /* @__PURE__ */ e(G, {}),
915
- /* @__PURE__ */ e(Xe, { goal: n.goal }),
835
+ /* @__PURE__ */ e(Qe, { goal: n.goal }),
916
836
  /* @__PURE__ */ e(G, {}),
917
- /* @__PURE__ */ e(qe, { goal: n.goal }),
837
+ /* @__PURE__ */ e(et, { goal: n.goal }),
918
838
  /* @__PURE__ */ e(G, {})
919
- ] }), !n?.goal && n?.account && /* @__PURE__ */ l(B, { children: [
839
+ ] }),
840
+ !n?.goal && n?.account && /* @__PURE__ */ l(R, { children: [
920
841
  /* @__PURE__ */ e(St, { debt: n }),
921
842
  /* @__PURE__ */ e(G, {}),
922
843
  /* @__PURE__ */ e(Dt, { debt: n }),
923
844
  /* @__PURE__ */ e(G, {}),
924
845
  /* @__PURE__ */ e(At, { debt: n }),
925
846
  /* @__PURE__ */ e(G, {})
926
- ] })]
927
- });
928
- }, Et = v(Tt), It = ({ setTabValue: a, sx: n }) => {
929
- const { debts: r } = w(), { showError: t, showCompleted: o } = M();
930
- return g.useEffect(() => {
931
- t && a(1);
932
- }, [t]), !t && !o ? /* @__PURE__ */ e(B, {}) : /* @__PURE__ */ l(y, {
933
- gap: 16,
934
- children: [/* @__PURE__ */ e(me, {
935
- sx: {
936
- my: 16,
937
- mx: 24,
938
- ...n
939
- },
940
- children: /* @__PURE__ */ l(ye, {
941
- icon: t ? /* @__PURE__ */ e(Qe, { filled: !0 }) : /* @__PURE__ */ e(we, {
942
- color: "success",
943
- filled: !0
944
- }),
847
+ ] })
848
+ ] });
849
+ }, Et = C(Tt), It = ({ setTabValue: r, sx: n }) => {
850
+ const { debts: o } = w(), { showError: t, showCompleted: a } = P();
851
+ return f.useEffect(() => {
852
+ t && r(1);
853
+ }, [t]), !t && !a ? /* @__PURE__ */ e(R, {}) : /* @__PURE__ */ l(y, { gap: 16, children: [
854
+ /* @__PURE__ */ e(ye, { sx: { my: 16, mx: 24, ...n }, children: /* @__PURE__ */ l(
855
+ me,
856
+ {
857
+ icon: t ? /* @__PURE__ */ e(rt, { filled: !0 }) : /* @__PURE__ */ e(Ce, { color: "success", filled: !0 }),
945
858
  severity: "error",
946
859
  sx: {
947
860
  alignItems: "start",
@@ -949,268 +862,218 @@ var De = ({ sx: a, height: n = 500, width: r, debts: t, hoveredDebtGuid: o, onCl
949
862
  borderRadius: 1,
950
863
  borderColor: t ? "error.main" : "success.main",
951
864
  color: "text.primary",
952
- "&.MuiPaper-root": { backgroundColor: "background.paper" }
865
+ "&.MuiPaper-root": {
866
+ backgroundColor: "background.paper"
867
+ }
953
868
  },
954
- children: [/* @__PURE__ */ e(fe, {
955
- sx: {
956
- fontWeight: 600,
957
- marginTop: 2
958
- },
959
- variant: "body1",
960
- children: t ? r.status_error_title : r.status_complete_title
961
- }), /* @__PURE__ */ e(i, {
962
- component: "p",
963
- variant: "subtitle2",
964
- children: t ? r.status_error_description : r.status_complete_description
965
- })]
966
- })
967
- }), t && /* @__PURE__ */ e(me, {
968
- sx: {
969
- mb: 16,
970
- mt: 100,
971
- mx: 24,
972
- ...n
973
- },
974
- children: /* @__PURE__ */ l(ye, {
975
- icon: /* @__PURE__ */ e(B, {}),
869
+ children: [
870
+ /* @__PURE__ */ e(_e, { sx: { fontWeight: 600, marginTop: 2 }, variant: "body1", children: t ? o.status_error_title : o.status_complete_title }),
871
+ /* @__PURE__ */ e(i, { component: "p", variant: "subtitle2", children: t ? o.status_error_description : o.status_complete_description })
872
+ ]
873
+ }
874
+ ) }),
875
+ t && /* @__PURE__ */ e(ye, { sx: { mb: 16, mt: 100, mx: 24, ...n }, children: /* @__PURE__ */ l(
876
+ me,
877
+ {
878
+ icon: /* @__PURE__ */ e(R, {}),
976
879
  severity: "error",
977
880
  sx: {
978
881
  borderRadius: 2,
979
882
  color: "text.primary",
980
- "&.MuiPaper-root": { backgroundColor: "background.paper" }
883
+ "&.MuiPaper-root": {
884
+ backgroundColor: "background.paper"
885
+ }
981
886
  },
982
- children: [/* @__PURE__ */ e(fe, {
983
- sx: {
984
- fontWeight: 600,
985
- marginTop: 2
986
- },
987
- variant: "body1",
988
- children: r.status_info_title
989
- }), /* @__PURE__ */ e(i, {
990
- component: "p",
991
- variant: "subtitle2",
992
- children: r.status_info_description
993
- })]
994
- })
995
- })]
996
- });
997
- }, kt = v(It), Nt = () => {
998
- const { debts: a } = w(), { showError: n, showCompleted: r } = M(), [t, o] = g.useState(0);
999
- return /* @__PURE__ */ l(B, { children: [
1000
- (n || r) && /* @__PURE__ */ e(kt, {
1001
- setTabValue: o,
1002
- sx: { mt: -24 }
1003
- }),
1004
- /* @__PURE__ */ l(tt, {
1005
- "aria-label": a.details_tabs_aria_label,
1006
- centered: !0,
1007
- onChange: (s, p) => o(p),
1008
- textColor: "primary",
1009
- value: t,
1010
- variant: "fullWidth",
1011
- children: [/* @__PURE__ */ e(_e, {
1012
- "aria-controls": "debt-schedule-tabpanel-0",
1013
- id: "debt-schedule-tab-0",
1014
- label: a.schedule_tab_label
1015
- }), /* @__PURE__ */ e(_e, {
1016
- "aria-controls": "debt-details-tabpanel-1",
1017
- id: "debt-details-tab-1",
1018
- label: a.details_tab_label
1019
- })]
1020
- }),
1021
- /* @__PURE__ */ e(be, {
1022
- index: 0,
1023
- name: "debt-schedule",
1024
- value: t,
1025
- children: /* @__PURE__ */ e(Ct, {})
1026
- }),
1027
- /* @__PURE__ */ e(be, {
1028
- index: 1,
1029
- name: "debt-details",
1030
- value: t,
1031
- children: /* @__PURE__ */ e(Et, {})
1032
- })
887
+ children: [
888
+ /* @__PURE__ */ e(_e, { sx: { fontWeight: 600, marginTop: 2 }, variant: "body1", children: o.status_info_title }),
889
+ /* @__PURE__ */ e(i, { component: "p", variant: "subtitle2", children: o.status_info_description })
890
+ ]
891
+ }
892
+ ) })
1033
893
  ] });
1034
- }, Mt = v(Nt), Bt = ({ isOpen: a, onClose: n }) => {
1035
- const { debts: r } = w(), { showError: t, showCompleted: o } = M(), s = t || o ? /* @__PURE__ */ e(B, {}) : /* @__PURE__ */ e(wt, {});
1036
- return /* @__PURE__ */ e(ie, {
1037
- ariaLabelClose: r.details_close_aria,
1038
- isOpen: a,
1039
- onClose: n,
1040
- title: r.details_title,
1041
- children: /* @__PURE__ */ l(y, {
1042
- bgcolor: "background.default",
1043
- children: [/* @__PURE__ */ e(Ge, { customDetailsChart: s }), /* @__PURE__ */ e(Mt, {})]
1044
- })
1045
- });
1046
- }, Pt = v(() => {
1047
- const { debts: a } = w(), { monthlyCashFlowProfile: n, updateMonthlyCashFlowProfile: r } = z(), { onEvent: t } = E(), [o, s] = g.useState(n?.extra_payment ?? 0), p = o < 0 || o > 9999999999e-2, c = async () => {
1048
- n && (await r({
1049
- ...n,
1050
- extra_payment: o
1051
- }), n.extra_payment = o, t(C.DEBTS_SAVE_PAYDOWN_ACTION, { user_guid: n?.user_guid }));
894
+ }, Mt = C(It), kt = () => {
895
+ const { debts: r } = w(), { showError: n, showCompleted: o } = P(), [t, a] = f.useState(0);
896
+ return /* @__PURE__ */ l(R, { children: [
897
+ (n || o) && /* @__PURE__ */ e(Mt, { setTabValue: a, sx: { mt: -24 } }),
898
+ /* @__PURE__ */ l(
899
+ Ze,
900
+ {
901
+ "aria-label": r.details_tabs_aria_label,
902
+ centered: !0,
903
+ onChange: (s, d) => a(d),
904
+ textColor: "primary",
905
+ value: t,
906
+ variant: "fullWidth",
907
+ children: [
908
+ /* @__PURE__ */ e(
909
+ be,
910
+ {
911
+ "aria-controls": "debt-schedule-tabpanel-0",
912
+ id: "debt-schedule-tab-0",
913
+ label: r.schedule_tab_label
914
+ }
915
+ ),
916
+ /* @__PURE__ */ e(
917
+ be,
918
+ {
919
+ "aria-controls": "debt-details-tabpanel-1",
920
+ id: "debt-details-tab-1",
921
+ label: r.details_tab_label
922
+ }
923
+ )
924
+ ]
925
+ }
926
+ ),
927
+ /* @__PURE__ */ e(fe, { index: 0, name: "debt-schedule", value: t, children: /* @__PURE__ */ e(vt, {}) }),
928
+ /* @__PURE__ */ e(fe, { index: 1, name: "debt-details", value: t, children: /* @__PURE__ */ e(Et, {}) })
929
+ ] });
930
+ }, Nt = C(kt), Bt = ({ isOpen: r, onClose: n }) => {
931
+ const { debts: o } = w(), { showError: t, showCompleted: a } = P(), s = t || a ? /* @__PURE__ */ e(R, {}) : /* @__PURE__ */ e(wt, {});
932
+ return /* @__PURE__ */ e(
933
+ ie,
934
+ {
935
+ ariaLabelClose: o.details_close_aria,
936
+ isOpen: r,
937
+ onClose: n,
938
+ title: o.details_title,
939
+ children: /* @__PURE__ */ l(y, { bgcolor: "background.default", children: [
940
+ /* @__PURE__ */ e(je, { customDetailsChart: s }),
941
+ /* @__PURE__ */ e(Nt, {})
942
+ ] })
943
+ }
944
+ );
945
+ }, Pt = C(() => {
946
+ const { debts: r } = w(), { monthlyCashFlowProfile: n, updateMonthlyCashFlowProfile: o } = V(), { onEvent: t } = k(), [a, s] = f.useState(n?.extra_payment ?? 0), d = a < 0 || a > 9999999999e-2, c = async () => {
947
+ n && (await o({ ...n, extra_payment: a }), n.extra_payment = a, t(S.DEBTS_SAVE_PAYDOWN_ACTION, {
948
+ user_guid: n?.user_guid
949
+ }));
1052
950
  }, m = () => {
1053
951
  setTimeout(() => {
1054
952
  s(n?.extra_payment ?? 0);
1055
953
  }, 250);
1056
954
  };
1057
- return /* @__PURE__ */ e(ee, {
1058
- isSaveDisabled: p,
1059
- label: a.paydown_drawer_extra_payment,
1060
- onCancel: m,
1061
- onSave: c,
1062
- primaryText: a.paydown_drawer_extra_payment,
1063
- secondaryText: A(n?.extra_payment, "0,0"),
1064
- zeroStateText: n?.extra_payment ? void 0 : a.add_extra_payment,
1065
- children: /* @__PURE__ */ e(oe, {
1066
- amount: o,
1067
- autoFocus: !0,
1068
- error: p,
1069
- fullWidth: !0,
1070
- minAmount: 0,
1071
- setAmount: (h) => s(isNaN(Number(h)) ? o : Number(h)),
1072
- sx: { ".MuiTypography-body1": { p: 0 } }
1073
- })
1074
- });
955
+ return /* @__PURE__ */ e(
956
+ re,
957
+ {
958
+ isSaveDisabled: d,
959
+ label: r.paydown_drawer_extra_payment,
960
+ onCancel: m,
961
+ onSave: c,
962
+ primaryText: r.paydown_drawer_extra_payment,
963
+ secondaryText: I(n?.extra_payment, "0,0"),
964
+ zeroStateText: n?.extra_payment ? void 0 : r.add_extra_payment,
965
+ children: /* @__PURE__ */ e(
966
+ se,
967
+ {
968
+ amount: a,
969
+ autoFocus: !0,
970
+ error: d,
971
+ fullWidth: !0,
972
+ minAmount: 0,
973
+ setAmount: (h) => s(isNaN(Number(h)) ? a : Number(h)),
974
+ sx: { ".MuiTypography-body1": { p: 0 } }
975
+ }
976
+ )
977
+ }
978
+ );
1075
979
  }), Rt = () => {
1076
- const { debts: a } = w(), { totalMonthlyPayments: n } = te(), { monthlyCashFlowProfile: r } = z(), t = n + Number(r?.extra_payment);
1077
- return /* @__PURE__ */ l(y, {
1078
- sx: {
1079
- backgroundColor: "background.default",
1080
- height: "100%"
1081
- },
1082
- children: [
1083
- /* @__PURE__ */ l(y, {
1084
- p: 24,
1085
- children: [/* @__PURE__ */ l(y, {
1086
- alignItems: "center",
1087
- gap: 4,
1088
- mb: 24,
1089
- children: [
1090
- /* @__PURE__ */ e(i, {
1091
- variant: "body1",
1092
- children: a.paydown_drawer_mimimum_label
1093
- }),
1094
- /* @__PURE__ */ e(ge, {
1095
- bold: !0,
1096
- variant: "h1",
1097
- children: A(n, "0,0")
1098
- }),
1099
- /* @__PURE__ */ e(i, {
1100
- textAlign: "center",
1101
- truncate: !1,
1102
- variant: "body2",
1103
- width: 208,
1104
- children: a.paydown_drawer_minimum_info
1105
- })
1106
- ]
1107
- }), /* @__PURE__ */ l(y, { children: [/* @__PURE__ */ e(i, {
1108
- variant: "h3",
1109
- children: a.paydown_drawer_subtitle
1110
- }), /* @__PURE__ */ e(i, {
1111
- truncate: !1,
1112
- variant: "subtitle2",
1113
- children: a.paydown_drawer_description
1114
- })] })]
1115
- }),
1116
- /* @__PURE__ */ e(y, {
1117
- sx: { backgroundColor: "background.paper" },
1118
- children: /* @__PURE__ */ e(Pt, {})
1119
- }),
1120
- /* @__PURE__ */ e(y, {
1121
- flexDirection: "row-reverse",
1122
- px: 24,
1123
- py: 12,
1124
- children: /* @__PURE__ */ l(y, {
1125
- gap: 4,
1126
- children: [/* @__PURE__ */ e(i, {
1127
- variant: "body2",
1128
- children: a.paydown_drawer_total_payment
1129
- }), /* @__PURE__ */ e(i, {
1130
- bold: !0,
1131
- textAlign: "right",
1132
- variant: "body1",
1133
- children: A(t, "0,0")
1134
- })]
1135
- })
1136
- })
1137
- ]
1138
- });
1139
- }, Lt = v(Rt), Ft = ({ isOpen: a, onClose: n }) => {
1140
- const { debts: r } = w();
1141
- return /* @__PURE__ */ e(ie, {
1142
- ariaLabelClose: r.paydown_drawer_close_aria,
1143
- isOpen: a,
1144
- onClose: n,
1145
- title: r.paydown_drawer_title,
1146
- children: /* @__PURE__ */ e(Lt, {})
1147
- });
980
+ const { debts: r } = w(), { totalMonthlyPayments: n } = ee(), { monthlyCashFlowProfile: o } = V(), t = n + Number(o?.extra_payment);
981
+ return /* @__PURE__ */ l(y, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
982
+ /* @__PURE__ */ l(y, { p: 24, children: [
983
+ /* @__PURE__ */ l(y, { alignItems: "center", gap: 4, mb: 24, children: [
984
+ /* @__PURE__ */ e(i, { variant: "body1", children: r.paydown_drawer_mimimum_label }),
985
+ /* @__PURE__ */ e(xe, { bold: !0, variant: "h1", children: I(n, "0,0") }),
986
+ /* @__PURE__ */ e(i, { textAlign: "center", truncate: !1, variant: "body2", width: 208, children: r.paydown_drawer_minimum_info })
987
+ ] }),
988
+ /* @__PURE__ */ l(y, { children: [
989
+ /* @__PURE__ */ e(i, { variant: "h3", children: r.paydown_drawer_subtitle }),
990
+ /* @__PURE__ */ e(i, { truncate: !1, variant: "subtitle2", children: r.paydown_drawer_description })
991
+ ] })
992
+ ] }),
993
+ /* @__PURE__ */ e(y, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(Pt, {}) }),
994
+ /* @__PURE__ */ e(y, { flexDirection: "row-reverse", px: 24, py: 12, children: /* @__PURE__ */ l(y, { gap: 4, children: [
995
+ /* @__PURE__ */ e(i, { variant: "body2", children: r.paydown_drawer_total_payment }),
996
+ /* @__PURE__ */ e(i, { bold: !0, textAlign: "right", variant: "body1", children: I(t, "0,0") })
997
+ ] }) })
998
+ ] });
999
+ }, Lt = C(Rt), Ft = ({ isOpen: r, onClose: n }) => {
1000
+ const { debts: o } = w();
1001
+ return /* @__PURE__ */ e(
1002
+ ie,
1003
+ {
1004
+ ariaLabelClose: o.paydown_drawer_close_aria,
1005
+ isOpen: r,
1006
+ onClose: n,
1007
+ title: o.paydown_drawer_title,
1008
+ children: /* @__PURE__ */ e(Lt, {})
1009
+ }
1010
+ );
1148
1011
  };
1149
- function $t(a, n) {
1150
- const r = (t) => {
1012
+ function $t(r, n) {
1013
+ const o = (t) => {
1151
1014
  if (typeof t == "number") return t;
1152
1015
  if (t === "!" || t === "✓") return 1 / 0;
1153
1016
  throw new Error("Unsupported value");
1154
1017
  };
1155
- return r(a) - r(n);
1018
+ return o(r) - o(n);
1156
1019
  }
1157
- function Ot(a) {
1158
- return a.is_paid_off ? "✓" : a.priority === void 0 || a.is_impossible ? "!" : a.priority;
1020
+ function Ot(r) {
1021
+ return r.is_paid_off ? "✓" : r.priority === void 0 || r.is_impossible ? "!" : r.priority;
1159
1022
  }
1160
- var Wt = (a) => {
1023
+ const Wt = (r) => {
1161
1024
  const n = {
1162
1025
  text: "#121417",
1163
1026
  background: "#FFB252"
1164
1027
  };
1165
- return a === "!" && (n.text = "#FFFFFF", n.background = "#DF320C"), a === "✓" && (n.text = "#FFFFFF", n.background = "#09A57F"), n;
1166
- }, Gt = (a) => {
1167
- const n = String(a.formattedValue), r = Wt(n);
1168
- return /* @__PURE__ */ e(se, {
1169
- sx: {
1170
- display: "flex",
1171
- alignItems: "center",
1172
- justifyContent: "center",
1173
- width: 20,
1174
- height: 20,
1175
- borderRadius: "50%",
1176
- backgroundColor: r.background,
1177
- marginLeft: "10px"
1178
- },
1179
- children: /* @__PURE__ */ e(i, {
1180
- color: r.text,
1181
- fontWeight: 700,
1182
- variant: "body2",
1183
- children: n
1184
- })
1185
- });
1186
- }, Ht = (a) => {
1187
- const n = a.row.account, r = Pe[n.account_type];
1188
- return /* @__PURE__ */ l(y, {
1189
- alignItems: "center",
1190
- flexDirection: "row",
1191
- children: [/* @__PURE__ */ e(Ze, {
1192
- alt: `${n.institutionName}`,
1193
- institutionGuid: n.institution_guid || ""
1194
- }), /* @__PURE__ */ l(y, {
1195
- ml: 12,
1196
- children: [/* @__PURE__ */ e(i, {
1197
- variant: "body2",
1198
- children: n.name
1199
- }), /* @__PURE__ */ e(i, {
1200
- variant: "caption",
1201
- children: r
1202
- })]
1203
- })]
1204
- });
1205
- }, zt = ({ sx: a = {}, debts: n, hoveredDebtGuid: r, onHoverRow: t, onClickRow: o }) => {
1206
- const s = j(), { onEvent: p } = E(), { isMobile: c } = le(), { debts: m, common: h } = w(), [b, I] = g.useState([{
1207
- field: "priority",
1208
- sort: "asc"
1209
- }]), x = [
1028
+ return r === "!" && (n.text = "#FFFFFF", n.background = "#DF320C"), r === "✓" && (n.text = "#FFFFFF", n.background = "#09A57F"), n;
1029
+ }, Gt = (r) => {
1030
+ const n = String(r.formattedValue), o = Wt(n);
1031
+ return /* @__PURE__ */ e(
1032
+ le,
1033
+ {
1034
+ sx: {
1035
+ display: "flex",
1036
+ alignItems: "center",
1037
+ justifyContent: "center",
1038
+ width: 20,
1039
+ // Adjust the size as needed
1040
+ height: 20,
1041
+ borderRadius: "50%",
1042
+ backgroundColor: o.background,
1043
+ marginLeft: "10px"
1044
+ },
1045
+ children: /* @__PURE__ */ e(i, { color: o.text, fontWeight: 700, variant: "body2", children: n })
1046
+ }
1047
+ );
1048
+ }, Ht = (r) => {
1049
+ const n = r.row.account, o = nt[n.account_type];
1050
+ return /* @__PURE__ */ l(y, { alignItems: "center", flexDirection: "row", children: [
1051
+ /* @__PURE__ */ e(
1052
+ Pe,
1053
+ {
1054
+ alt: `${n.institutionName}`,
1055
+ institutionGuid: n.institution_guid || ""
1056
+ }
1057
+ ),
1058
+ /* @__PURE__ */ l(y, { ml: 12, children: [
1059
+ /* @__PURE__ */ e(i, { variant: "body2", children: n.name }),
1060
+ /* @__PURE__ */ e(i, { variant: "caption", children: o })
1061
+ ] })
1062
+ ] });
1063
+ }, zt = ({
1064
+ sx: r = {},
1065
+ debts: n,
1066
+ hoveredDebtGuid: o,
1067
+ onHoverRow: t,
1068
+ onClickRow: a
1069
+ }) => {
1070
+ const s = j(), { onEvent: d } = k(), { isMobile: c } = ae(), { debts: m, common: h } = w(), [b, v] = f.useState([
1071
+ { field: "priority", sort: "asc" }
1072
+ ]), x = [
1210
1073
  {
1211
1074
  field: "priority",
1212
1075
  headerName: m.table_column_priority,
1213
- renderHeader: O,
1076
+ renderHeader: H,
1214
1077
  renderCell: Gt,
1215
1078
  sortComparator: $t,
1216
1079
  sortable: !0,
@@ -1224,7 +1087,7 @@ var Wt = (a) => {
1224
1087
  {
1225
1088
  field: "account",
1226
1089
  headerName: m.table_column_account,
1227
- renderHeader: O,
1090
+ renderHeader: H,
1228
1091
  renderCell: Ht,
1229
1092
  sortable: !1,
1230
1093
  type: "custom",
@@ -1236,12 +1099,8 @@ var Wt = (a) => {
1236
1099
  {
1237
1100
  field: "balance",
1238
1101
  headerName: m.table_column_balance,
1239
- renderHeader: O,
1240
- renderCell: (_) => /* @__PURE__ */ e(i, {
1241
- color: s.palette.text.primary,
1242
- variant: "body2",
1243
- children: A(_.value, "0,0")
1244
- }),
1102
+ renderHeader: H,
1103
+ renderCell: (_) => /* @__PURE__ */ e(i, { color: s.palette.text.primary, variant: "body2", children: I(_.value, "0,0") }),
1245
1104
  sortable: !0,
1246
1105
  hideSortIcons: c,
1247
1106
  type: "number",
@@ -1253,12 +1112,8 @@ var Wt = (a) => {
1253
1112
  {
1254
1113
  field: "interest_rate",
1255
1114
  headerName: m.table_column_interest_rate,
1256
- renderHeader: O,
1257
- renderCell: (_) => /* @__PURE__ */ e(i, {
1258
- color: s.palette.text.primary,
1259
- variant: "body2",
1260
- children: isNaN(_.value) ? "---" : `${Number(_.value).toFixed(2)}%`
1261
- }),
1115
+ renderHeader: H,
1116
+ renderCell: (_) => /* @__PURE__ */ e(i, { color: s.palette.text.primary, variant: "body2", children: isNaN(_.value) ? "---" : `${Number(_.value).toFixed(2)}%` }),
1262
1117
  sortable: !0,
1263
1118
  hideSortIcons: c,
1264
1119
  type: "number",
@@ -1270,12 +1125,8 @@ var Wt = (a) => {
1270
1125
  {
1271
1126
  field: "projected_payoff_date",
1272
1127
  headerName: m.table_column_payoff_date,
1273
- renderHeader: O,
1274
- renderCell: (_) => /* @__PURE__ */ e(i, {
1275
- color: s.palette.text.primary,
1276
- variant: "body2",
1277
- children: _.value ? Q(_.value, Z.MONTH_SHORT_YEAR) : "---"
1278
- }),
1128
+ renderHeader: H,
1129
+ renderCell: (_) => /* @__PURE__ */ e(i, { color: s.palette.text.primary, variant: "body2", children: _.value ? J(_.value, Q.MONTH_SHORT_YEAR) : "---" }),
1279
1130
  sortable: !0,
1280
1131
  hideSortIcons: c,
1281
1132
  type: "number",
@@ -1287,12 +1138,8 @@ var Wt = (a) => {
1287
1138
  {
1288
1139
  field: "monthly_payment",
1289
1140
  headerName: m.table_column_amount_due,
1290
- renderHeader: O,
1291
- renderCell: (_) => /* @__PURE__ */ e(i, {
1292
- color: s.palette.text.primary,
1293
- variant: "body2",
1294
- children: typeof _.value == "number" ? A(_.value, "0,0") : "---"
1295
- }),
1141
+ renderHeader: H,
1142
+ renderCell: (_) => /* @__PURE__ */ e(i, { color: s.palette.text.primary, variant: "body2", children: typeof _.value == "number" ? I(_.value, "0,0") : "---" }),
1296
1143
  sortable: !0,
1297
1144
  hideSortIcons: c,
1298
1145
  type: "number",
@@ -1301,309 +1148,351 @@ var Wt = (a) => {
1301
1148
  minWidth: 122,
1302
1149
  flex: 0.6
1303
1150
  }
1304
- ], F = [...x.slice(0, 3), {
1305
- field: "chevron",
1306
- headerClassName: "chevron-header",
1307
- headerName: "",
1308
- renderCell: () => /* @__PURE__ */ e(u, {
1309
- "aria-label": h.see_details,
1310
- role: "button",
1311
- children: /* @__PURE__ */ e(ne, { name: "chevron_right" })
1312
- }),
1313
- sortable: !1,
1314
- hideSortIcons: !0,
1315
- type: "custom",
1316
- align: "right",
1317
- headerAlign: "right",
1318
- width: 20
1319
- }], k = g.useMemo(() => n.map((_, d) => ({
1151
+ ], L = [
1152
+ ...x.slice(0, 3),
1153
+ {
1154
+ field: "chevron",
1155
+ headerClassName: "chevron-header",
1156
+ headerName: "",
1157
+ renderCell: () => /* @__PURE__ */ e(u, { "aria-label": h.see_details, role: "button", children: /* @__PURE__ */ e(ne, { name: "chevron_right" }) }),
1158
+ sortable: !1,
1159
+ hideSortIcons: !0,
1160
+ type: "custom",
1161
+ align: "right",
1162
+ headerAlign: "right",
1163
+ width: 20
1164
+ }
1165
+ ], F = f.useMemo(() => n.map((_, p) => ({
1320
1166
  ..._,
1321
- id: d,
1167
+ id: p,
1322
1168
  priority: Ot(_)
1323
1169
  })), [n]), N = (_) => {
1324
- const d = _.target.closest("[data-id]")?.getAttribute("data-id"), f = n[Number(d)];
1325
- t?.(f?.guid ?? "");
1326
- }, D = (_) => {
1170
+ const D = _.target.closest("[data-id]")?.getAttribute("data-id"), M = n[Number(D)];
1171
+ t?.(M?.guid ?? "");
1172
+ }, A = (_) => {
1327
1173
  c || N(_);
1328
- }, P = (_) => {
1174
+ }, E = (_) => {
1329
1175
  c && N(_);
1330
- }, V = (_) => k.find((d) => d.guid === _)?.id;
1331
- return /* @__PURE__ */ e(se, {
1332
- sx: {
1333
- height: "auto",
1334
- width: "100%",
1335
- mt: "15px",
1336
- overflowX: "auto",
1337
- overflowY: "visible",
1338
- boxShadow: "none",
1339
- ...a
1340
- },
1341
- children: /* @__PURE__ */ e(ut, {
1342
- columns: c ? F : x,
1343
- disableColumnFilter: !0,
1344
- disableColumnMenu: !0,
1345
- hideFooter: !0,
1346
- initialState: { sorting: { sortModel: b } },
1347
- onRowClick: (_) => {
1348
- o(), p(C.DEBTS_CLICK_TABLE_ROW, { account_guid: _.row.guid });
1349
- },
1350
- onSortModelChange: (_) => {
1351
- I(_), p(C.DEBTS_CLICK_TABLE_SORT);
1352
- },
1353
- rows: k,
1354
- slotProps: {
1355
- baseIconButton: {
1356
- color: "secondary",
1357
- sx: { ml: 8 }
1358
- },
1359
- row: {
1360
- onMouseEnter: D,
1361
- onMouseLeave: () => !c && t?.(""),
1362
- onTouchStart: P,
1363
- onClick: c ? P : void 0
1364
- }
1365
- },
1366
- sortModel: b,
1367
- sortingOrder: ["asc", "desc"],
1176
+ }, Y = (_) => F.find((p) => p.guid === _)?.id;
1177
+ return /* @__PURE__ */ e(
1178
+ le,
1179
+ {
1368
1180
  sx: {
1369
- "& .chevron-header": { display: "none" },
1370
- [`& .MuiDataGrid-row[data-id="${V(r)}"]`]: {
1371
- backgroundColor: s.palette.mode === "light" ? "#f8f9fb" : "#1f2329",
1372
- filter: "brightness(98%)"
1181
+ height: "auto",
1182
+ width: "100%",
1183
+ mt: "15px",
1184
+ overflowX: "auto",
1185
+ overflowY: "visible",
1186
+ boxShadow: "none",
1187
+ ...r
1188
+ },
1189
+ children: /* @__PURE__ */ e(
1190
+ ot,
1191
+ {
1192
+ columns: c ? L : x,
1193
+ disableColumnFilter: !0,
1194
+ disableColumnMenu: !0,
1195
+ hideFooter: !0,
1196
+ initialState: { sorting: { sortModel: b } },
1197
+ onRowClick: (_) => {
1198
+ a(), d(S.DEBTS_CLICK_TABLE_ROW, { account_guid: _.row.guid });
1199
+ },
1200
+ onSortModelChange: (_) => {
1201
+ v(_), d(S.DEBTS_CLICK_TABLE_SORT);
1202
+ },
1203
+ rows: F,
1204
+ slotProps: {
1205
+ baseIconButton: { color: "secondary", sx: { ml: 8 } },
1206
+ row: {
1207
+ onMouseEnter: A,
1208
+ onMouseLeave: () => !c && t?.(""),
1209
+ onTouchStart: E,
1210
+ onClick: c ? E : void 0
1211
+ }
1212
+ },
1213
+ sortModel: b,
1214
+ sortingOrder: ["asc", "desc"],
1215
+ sx: {
1216
+ "& .chevron-header": { display: "none" },
1217
+ [`& .MuiDataGrid-row[data-id="${Y(o)}"]`]: {
1218
+ backgroundColor: s.palette.mode === "light" ? "#f8f9fb" : "#1f2329",
1219
+ filter: "brightness(98%)"
1220
+ }
1221
+ }
1373
1222
  }
1374
- }
1375
- })
1376
- });
1377
- }, jt = ({ buttonText: a, disabled: n, isDesktop: r = !1, isOpen: t, onClick: o }) => {
1223
+ )
1224
+ }
1225
+ );
1226
+ }, jt = ({
1227
+ buttonText: r,
1228
+ disabled: n,
1229
+ isDesktop: o = !1,
1230
+ isOpen: t,
1231
+ onClick: a
1232
+ }) => {
1378
1233
  const s = t ? "unfold_less" : "unfold_more";
1379
- return r ? /* @__PURE__ */ e(xe, {
1380
- "aria-controls": "prioritize-debts",
1381
- "aria-describedby": "prioritize-debts",
1382
- "aria-haspopup": !0,
1383
- "aria-label": "prioritize-debts",
1384
- disabled: n,
1385
- onClick: o,
1386
- startIcon: /* @__PURE__ */ e(ne, { name: s }),
1387
- sx: { justifyContent: "start" },
1388
- children: a
1389
- }) : /* @__PURE__ */ e(rt, {
1390
- "aria-controls": "prioritize-debts",
1391
- "aria-describedby": "prioritize-debts",
1392
- "aria-haspopup": !0,
1393
- "aria-label": "prioritize-debts",
1394
- disabled: n,
1395
- onClick: o,
1396
- children: /* @__PURE__ */ e(ne, { name: s })
1397
- });
1398
- }, Vt = v(({ buttonEl: a, onClose: n }) => {
1399
- const { onEvent: r } = E(), { debts: t } = w(), { selectedDebtPriority: o, setSelectedDebtPriority: s } = M(), p = !!a, c = [
1234
+ return o ? /* @__PURE__ */ e(
1235
+ ve,
1236
+ {
1237
+ "aria-controls": "prioritize-debts",
1238
+ "aria-describedby": "prioritize-debts",
1239
+ "aria-haspopup": !0,
1240
+ "aria-label": "prioritize-debts",
1241
+ disabled: n,
1242
+ onClick: a,
1243
+ startIcon: /* @__PURE__ */ e(ne, { name: s }),
1244
+ sx: { justifyContent: "start" },
1245
+ children: r
1246
+ }
1247
+ ) : /* @__PURE__ */ e(
1248
+ at,
1249
+ {
1250
+ "aria-controls": "prioritize-debts",
1251
+ "aria-describedby": "prioritize-debts",
1252
+ "aria-haspopup": !0,
1253
+ "aria-label": "prioritize-debts",
1254
+ disabled: n,
1255
+ onClick: a,
1256
+ children: /* @__PURE__ */ e(ne, { name: s })
1257
+ }
1258
+ );
1259
+ }, Vt = C(({ buttonEl: r, onClose: n }) => {
1260
+ const { onEvent: o } = k(), { debts: t } = w(), { selectedDebtPriority: a, setSelectedDebtPriority: s } = P(), d = !!r, c = [
1400
1261
  {
1401
- priority: L.FASTEST_PAYOFF_FIRST,
1262
+ priority: $.FASTEST_PAYOFF_FIRST,
1402
1263
  text: t.priority_sort_fastest_payoff
1403
1264
  },
1404
1265
  {
1405
- priority: L.HIGHEST_INTEREST,
1266
+ priority: $.HIGHEST_INTEREST,
1406
1267
  text: t.priority_sort_highest_interest
1407
1268
  },
1408
1269
  {
1409
- priority: L.LOWEST_BALANCE,
1270
+ priority: $.LOWEST_BALANCE,
1410
1271
  text: t.priority_sort_lowest_balance
1411
1272
  },
1412
1273
  {
1413
- priority: L.HIGHEST_BALANCE,
1274
+ priority: $.HIGHEST_BALANCE,
1414
1275
  text: t.priority_sort_highest_balance
1415
1276
  }
1416
1277
  ], m = (h) => {
1417
- s(h), r(C.DEBTS_CLICK_PRIORITY, { debts_priority: h });
1278
+ s(h), o(S.DEBTS_CLICK_PRIORITY, { debts_priority: h });
1418
1279
  };
1419
- return /* @__PURE__ */ e(st, {
1420
- anchorEl: a,
1421
- anchorOrigin: {
1422
- vertical: "bottom",
1423
- horizontal: "left"
1424
- },
1425
- id: "prioritize-debts",
1426
- onClose: n,
1427
- open: p,
1428
- transformOrigin: {
1429
- vertical: "top",
1430
- horizontal: "left"
1431
- },
1432
- children: /* @__PURE__ */ e(Ce, { children: c.map(({ priority: h, text: b }) => /* @__PURE__ */ l(ct, {
1433
- onClick: () => m(h),
1434
- sx: {
1435
- bgcolor: o === h ? "primary.main" : void 0,
1436
- color: o === h ? "#fff" : void 0,
1437
- justifyContent: "space-between",
1438
- minHeight: 44,
1439
- minWidth: 268,
1440
- px: 24,
1441
- py: 12,
1442
- "&:hover": {
1443
- bgcolor: "background.highlight",
1444
- cursor: "pointer",
1445
- color: "text.primary"
1446
- }
1280
+ return /* @__PURE__ */ e(
1281
+ lt,
1282
+ {
1283
+ anchorEl: r,
1284
+ anchorOrigin: {
1285
+ vertical: "bottom",
1286
+ horizontal: "left"
1447
1287
  },
1448
- children: [/* @__PURE__ */ e(i, {
1449
- color: "inherit",
1450
- variant: "body2",
1451
- children: b
1452
- }), o === h && /* @__PURE__ */ e(we, {
1453
- color: "inherit",
1454
- filled: !0,
1455
- fontSize: "small"
1456
- })]
1457
- }, h)) })
1458
- });
1459
- }), Yt = v(({ disabled: a, isDesktop: n }) => {
1460
- const { onEvent: r } = E(), { debts: t } = w(), { selectedDebtPriority: o } = M(), [s, p] = g.useState(null), c = (b) => {
1461
- p(b.currentTarget), r(C.DEBTS_CLICK_PRIORITIZE);
1288
+ id: "prioritize-debts",
1289
+ onClose: n,
1290
+ open: d,
1291
+ transformOrigin: {
1292
+ vertical: "top",
1293
+ horizontal: "left"
1294
+ },
1295
+ children: /* @__PURE__ */ e(we, { children: c.map(({ priority: h, text: b }) => /* @__PURE__ */ l(
1296
+ it,
1297
+ {
1298
+ onClick: () => m(h),
1299
+ sx: {
1300
+ bgcolor: a === h ? "primary.main" : void 0,
1301
+ color: a === h ? "#fff" : void 0,
1302
+ justifyContent: "space-between",
1303
+ minHeight: 44,
1304
+ minWidth: 268,
1305
+ px: 24,
1306
+ py: 12,
1307
+ "&:hover": {
1308
+ bgcolor: "background.highlight",
1309
+ cursor: "pointer",
1310
+ color: "text.primary"
1311
+ }
1312
+ },
1313
+ children: [
1314
+ /* @__PURE__ */ e(i, { color: "inherit", variant: "body2", children: b }),
1315
+ a === h && /* @__PURE__ */ e(Ce, { color: "inherit", filled: !0, fontSize: "small" })
1316
+ ]
1317
+ },
1318
+ h
1319
+ )) })
1320
+ }
1321
+ );
1322
+ }), Yt = C(({ disabled: r, isDesktop: n }) => {
1323
+ const { onEvent: o } = k(), { debts: t } = w(), { selectedDebtPriority: a } = P(), [s, d] = f.useState(null), c = (v) => {
1324
+ d(v.currentTarget), o(S.DEBTS_CLICK_PRIORITIZE);
1462
1325
  }, m = () => {
1463
- p(null);
1464
- }, h = !!s;
1465
- return /* @__PURE__ */ l(u, { children: [/* @__PURE__ */ e(jt, {
1466
- buttonText: g.useMemo(() => ({
1467
- [L.FASTEST_PAYOFF_FIRST]: t.priority_sort_fastest_payoff,
1468
- [L.HIGHEST_INTEREST]: t.priority_sort_highest_interest,
1469
- [L.HIGHEST_BALANCE]: t.priority_sort_highest_balance,
1470
- [L.LOWEST_BALANCE]: t.priority_sort_lowest_balance
1471
- })[o] ?? t.priority_sort_lowest_balance, [o]),
1472
- disabled: a,
1473
- isDesktop: n,
1474
- isOpen: h,
1475
- onClick: c
1476
- }), /* @__PURE__ */ e(Vt, {
1477
- buttonEl: s,
1478
- onClose: m
1479
- })] });
1480
- }), Kt = v(({ disabled: a, onClick: n }) => {
1481
- const { debts: r } = w(), { totalMonthlyPayments: t } = te(), { monthlyCashFlowProfile: o } = z(), s = t + Number(o?.extra_payment), p = r.paydown_button_long;
1482
- return /* @__PURE__ */ e(y, {
1483
- alignItems: "center",
1484
- sx: {
1485
- flex: 1,
1486
- flexShrink: 0
1487
- },
1488
- children: /* @__PURE__ */ e(xe, {
1326
+ d(null);
1327
+ }, h = !!s, b = f.useMemo(() => ({
1328
+ [$.FASTEST_PAYOFF_FIRST]: t.priority_sort_fastest_payoff,
1329
+ [$.HIGHEST_INTEREST]: t.priority_sort_highest_interest,
1330
+ [$.HIGHEST_BALANCE]: t.priority_sort_highest_balance,
1331
+ [$.LOWEST_BALANCE]: t.priority_sort_lowest_balance
1332
+ })[a] ?? t.priority_sort_lowest_balance, [a]);
1333
+ return /* @__PURE__ */ l(u, { children: [
1334
+ /* @__PURE__ */ e(
1335
+ jt,
1336
+ {
1337
+ buttonText: b,
1338
+ disabled: r,
1339
+ isDesktop: n,
1340
+ isOpen: h,
1341
+ onClick: c
1342
+ }
1343
+ ),
1344
+ /* @__PURE__ */ e(Vt, { buttonEl: s, onClose: m })
1345
+ ] });
1346
+ }), Kt = C(({ disabled: r, onClick: n }) => {
1347
+ const { debts: o } = w(), { totalMonthlyPayments: t } = ee(), { monthlyCashFlowProfile: a } = V(), s = t + Number(a?.extra_payment), d = o.paydown_button_long;
1348
+ return /* @__PURE__ */ e(y, { alignItems: "center", sx: { flex: 1, flexShrink: 0 }, children: /* @__PURE__ */ e(
1349
+ ve,
1350
+ {
1489
1351
  "aria-controls": "extra-paydown",
1490
1352
  "aria-describedby": "extra-paydown",
1491
1353
  "aria-haspopup": !0,
1492
1354
  "aria-label": "extra-paydown",
1493
- disabled: a,
1355
+ disabled: r,
1494
1356
  onClick: n,
1495
1357
  sx: { justifyContent: "start" },
1496
- children: S(p, A(s, "0,0"))
1497
- })
1498
- });
1499
- }), Ut = ({ onBackClick: a, onMenuClick: n, sx: r }) => {
1500
- const { isDesktop: t, isMobile: o } = le(), { connect: s, debts: p } = w(), { onEvent: c } = E(), { config: { show_connections_widget_in_master: m } } = Ye(), { isInitialized: h } = Ve(), { setSelectedAccount: b } = He(), { selectedDebtPriority: I, setSelectedDebtChartData: x } = M(), { isAccountDataLoaded: F, loadAccountData: k, detailedAccounts: N, visibleDebtAccounts: D } = re(), { isAllGoalDataLoaded: P, loadGoalData: V, monthlyCashFlowProfile: _ } = z(), { debts: d } = te(), [f, T] = g.useState(!1), [$, R] = g.useState(!1), [Y, ce] = g.useState(!1), [K, Se] = g.useState(""), [Ae, de] = g.useState(!1);
1501
- ze({
1358
+ children: T(d, I(s, "0,0"))
1359
+ }
1360
+ ) });
1361
+ }), Ut = ({ onBackClick: r, onMenuClick: n, sx: o }) => {
1362
+ const { isDesktop: t, isMobile: a } = ae(), { connect: s, debts: d } = w(), { onEvent: c } = k(), {
1363
+ config: { show_connections_widget_in_master: m }
1364
+ } = He(), { isInitialized: h } = ze(), { setSelectedAccount: b } = Ve(), { selectedDebtPriority: v, setSelectedDebtChartData: x } = P(), {
1365
+ isAccountDataLoaded: L,
1366
+ loadAccountData: F,
1367
+ detailedAccounts: N,
1368
+ visibleDebtAccounts: A
1369
+ } = te(), { isAllGoalDataLoaded: E, loadGoalData: Y, monthlyCashFlowProfile: _ } = V(), { debts: p } = ee(), [g, D] = f.useState(!1), [M, B] = f.useState(!1), [K, ce] = f.useState(!1), [U, Se] = f.useState(""), [Ae, de] = f.useState(!1);
1370
+ st({
1502
1371
  widgetName: "DebtsWidget",
1503
- isLoaded: P
1372
+ isLoaded: L && E
1504
1373
  });
1505
- const U = g.useMemo(() => Be(d, I, _?.extra_payment ?? 0), [
1506
- d,
1507
- I,
1508
- _
1509
- ]);
1510
- g.useEffect(() => {
1511
- F || k().finally(), c(C.DEBTS_VIEW);
1512
- }, []), g.useEffect(() => {
1513
- h && V().finally();
1374
+ const q = f.useMemo(() => {
1375
+ const O = _?.extra_payment ?? 0;
1376
+ return $e(p, v, O);
1377
+ }, [p, v, _]);
1378
+ f.useEffect(() => {
1379
+ L || F().finally(), c(S.DEBTS_VIEW);
1380
+ }, []), f.useEffect(() => {
1381
+ h && Y().finally();
1514
1382
  }, [h]);
1515
- const pe = (J) => Se(J), ue = () => {
1516
- const J = D.find((ae) => ae.guid === K), he = U.find((ae) => ae.guid === K);
1517
- J && b(J), he && x(he), T(!0);
1518
- }, Te = () => c(C.DEBTS_CLICK_FILTER), Ee = () => {
1519
- ce(!0), c(C.DEBTS_CLICK_SNOWBALL_CTA);
1383
+ const pe = (O) => Se(O), ue = () => {
1384
+ const O = A.find((oe) => oe.guid === U), he = q.find((oe) => oe.guid === U);
1385
+ O && b(O), he && x(he), D(!0);
1386
+ }, Te = () => c(S.DEBTS_CLICK_FILTER), Ee = () => {
1387
+ ce(!0), c(S.DEBTS_CLICK_SNOWBALL_CTA);
1520
1388
  }, Ie = () => {
1521
- R(!0), c(C.DEBTS_CLICK_PAYDOWN);
1389
+ B(!0), c(S.DEBTS_CLICK_PAYDOWN);
1522
1390
  };
1523
- if (!h || !P) return /* @__PURE__ */ e(Ke, {});
1524
- const ke = N.length === 0, Ne = D.length === 0, Me = d.length === 0, X = ke || Ne || Me, q = Re(p, m, () => de(!0));
1525
- return /* @__PURE__ */ l(Oe, {
1526
- actions: [/* @__PURE__ */ e(Yt, { disabled: X }, "prioritize-debts")],
1527
- allowedAccountTypes: [
1528
- H.CREDIT_CARD,
1529
- H.LOAN,
1530
- H.MORTGAGE,
1531
- H.LINE_OF_CREDIT,
1532
- H.CHECKING_LINE_OF_CREDIT
1533
- ],
1534
- hasDivider: !0,
1535
- onAccountsFilterClick: Te,
1536
- onBackClick: a,
1537
- onMenuClick: n,
1538
- slotComponent: /* @__PURE__ */ e(Kt, {
1539
- disabled: X,
1540
- onClick: Ie
1541
- }, "extra-paydown"),
1542
- sx: r,
1543
- title: p.title,
1544
- children: [
1545
- /* @__PURE__ */ l(y, {
1546
- sx: {
1547
- pt: 48,
1548
- px: t ? "48px" : "24px"
1549
- },
1550
- children: [X && /* @__PURE__ */ e($e, {
1551
- header: q.header,
1552
- icon: "note_stack",
1553
- onClick: q.onClickHandler,
1554
- primaryButton: q.primaryButton,
1555
- subText: q.description,
1556
- sx: { maxWidth: 400 }
1557
- }), !X && /* @__PURE__ */ l(B, { children: [/* @__PURE__ */ l(y, {
1558
- sx: {
1559
- alignItems: o ? "flex-start" : "flex-end",
1560
- flexDirection: o ? "column" : "row",
1561
- mx: o ? "-12px" : 0
1562
- },
1563
- children: [/* @__PURE__ */ e(De, {
1564
- debts: U,
1565
- height: o ? 250 : void 0,
1566
- hoveredDebtGuid: K,
1567
- onClickArea: ue,
1568
- onHoverArea: pe,
1569
- sx: { mr: o ? "4px" : "-48px" }
1570
- }), /* @__PURE__ */ e(mt, {
1571
- debts: U,
1572
- onClickCta: Ee,
1573
- sx: { mb: o ? "0px" : "64px" }
1574
- })]
1575
- }), /* @__PURE__ */ e(y, {
1576
- sx: { mx: o ? "-24px" : 0 },
1577
- children: /* @__PURE__ */ e(zt, {
1578
- debts: U,
1579
- hoveredDebtGuid: K,
1580
- onClickRow: ue,
1581
- onHoverRow: pe
1582
- })
1583
- })] })]
1584
- }),
1585
- /* @__PURE__ */ e(yt, {
1586
- isOpen: Y,
1587
- onClose: () => ce(!1)
1588
- }),
1589
- /* @__PURE__ */ e(Bt, {
1590
- isOpen: f,
1591
- onClose: () => T(!1)
1592
- }),
1593
- /* @__PURE__ */ e(Ft, {
1594
- isOpen: $,
1595
- onClose: () => R(!1)
1596
- }),
1597
- /* @__PURE__ */ e(We, {
1598
- onClose: () => de(!1),
1599
- showConnectWidget: Ae,
1600
- title: s.mini_title
1601
- })
1602
- ]
1603
- });
1604
- }, Ir = v(Ut);
1391
+ if (!h || !L || !E)
1392
+ return /* @__PURE__ */ e(ct, {});
1393
+ const Me = N.length === 0, ke = A.length === 0, Ne = p.length === 0, X = Me || ke || Ne, Z = Oe(
1394
+ d,
1395
+ m,
1396
+ () => de(!0)
1397
+ );
1398
+ return /* @__PURE__ */ l(
1399
+ dt,
1400
+ {
1401
+ actions: [/* @__PURE__ */ e(Yt, { disabled: X }, "prioritize-debts")],
1402
+ allowedAccountTypes: [
1403
+ z.CREDIT_CARD,
1404
+ z.LOAN,
1405
+ z.MORTGAGE,
1406
+ z.LINE_OF_CREDIT,
1407
+ z.CHECKING_LINE_OF_CREDIT
1408
+ ],
1409
+ hasDivider: !0,
1410
+ onAccountsFilterClick: Te,
1411
+ onBackClick: r,
1412
+ onMenuClick: n,
1413
+ slotComponent: /* @__PURE__ */ e(Kt, { disabled: X, onClick: Ie }, "extra-paydown"),
1414
+ sx: o,
1415
+ title: d.title,
1416
+ children: [
1417
+ /* @__PURE__ */ l(y, { sx: { pt: 48, px: t ? "48px" : "24px" }, children: [
1418
+ X && /* @__PURE__ */ e(
1419
+ pt,
1420
+ {
1421
+ header: Z.header,
1422
+ icon: "note_stack",
1423
+ onClick: Z.onClickHandler,
1424
+ primaryButton: Z.primaryButton,
1425
+ subText: Z.description,
1426
+ sx: { maxWidth: 400 }
1427
+ }
1428
+ ),
1429
+ !X && /* @__PURE__ */ l(R, { children: [
1430
+ /* @__PURE__ */ l(
1431
+ y,
1432
+ {
1433
+ sx: {
1434
+ alignItems: a ? "flex-start" : "flex-end",
1435
+ flexDirection: a ? "column" : "row",
1436
+ mx: a ? "-12px" : 0
1437
+ },
1438
+ children: [
1439
+ /* @__PURE__ */ e(
1440
+ De,
1441
+ {
1442
+ debts: q,
1443
+ height: a ? 250 : void 0,
1444
+ hoveredDebtGuid: U,
1445
+ onClickArea: ue,
1446
+ onHoverArea: pe,
1447
+ sx: { mr: a ? "4px" : "-48px" }
1448
+ }
1449
+ ),
1450
+ /* @__PURE__ */ e(
1451
+ mt,
1452
+ {
1453
+ debts: q,
1454
+ onClickCta: Ee,
1455
+ sx: { mb: a ? "0px" : "64px" }
1456
+ }
1457
+ )
1458
+ ]
1459
+ }
1460
+ ),
1461
+ /* @__PURE__ */ e(y, { sx: { mx: a ? "-24px" : 0 }, children: /* @__PURE__ */ e(
1462
+ zt,
1463
+ {
1464
+ debts: q,
1465
+ hoveredDebtGuid: U,
1466
+ onClickRow: ue,
1467
+ onHoverRow: pe
1468
+ }
1469
+ ) })
1470
+ ] })
1471
+ ] }),
1472
+ /* @__PURE__ */ e(
1473
+ yt,
1474
+ {
1475
+ isOpen: K,
1476
+ onClose: () => ce(!1)
1477
+ }
1478
+ ),
1479
+ /* @__PURE__ */ e(Bt, { isOpen: g, onClose: () => D(!1) }),
1480
+ /* @__PURE__ */ e(Ft, { isOpen: M, onClose: () => B(!1) }),
1481
+ /* @__PURE__ */ e(
1482
+ ut,
1483
+ {
1484
+ onClose: () => de(!1),
1485
+ showConnectWidget: Ae,
1486
+ title: s.mini_title
1487
+ }
1488
+ )
1489
+ ]
1490
+ }
1491
+ );
1492
+ }, Hr = C(Ut);
1605
1493
  export {
1606
1494
  De as DebtsChart,
1607
1495
  zt as DebtsTable,
1608
- Ir as DebtsWidget
1496
+ Hr as DebtsWidget
1609
1497
  };
1498
+ //# sourceMappingURL=index.es.js.map