@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,1209 +1,1090 @@
1
- import { s as B } from "../GlobalCopyApi-BeXzaDH9.mjs";
2
- import { A as me, Dt as r, Et as U, J as S, M as Pe, Pt as ye, Tt as le, j as je, ln as ue, un as _e } from "../core-BexP5oiV.mjs";
3
- import { An as Fe, Bn as Te, Gn as $e, Mn as Ce, Xn as He, _r as ve, gr as Ue, kn as Z, lr as q, mr as pe, qn as Ye, sr as $, ur as Ze, yr as qe } from "../accounts-DkyAiLpg.mjs";
4
- import { n as Re } from "../Analytics-BKzTPees.mjs";
5
- import { O as xe, d as Ee, g as N, h as he, i as be, n as j, p as R, t as Se } from "../Loader-BlVzRtUd.mjs";
6
- import { n as Je, r as Xe, t as Qe } from "../OriginalBalanceAction-sbiqaxok.mjs";
1
+ import { jsxs as c, jsx as e, Fragment as F } from "react/jsx-runtime";
7
2
  import T from "react";
8
- import { observer as K } from "mobx-react-lite";
9
- import g from "@mui/material/Stack";
10
- import { H2 as Ie, H3 as de, Icon as et, InstitutionLogo as Q, P as Y, Text as C } from "@mxenabled/mxui";
11
- import ge from "@mui/material/Button";
12
- import { AddBox as Ge, ArrowUpwardAlt as tt, CheckCircle as nt, ChevronRight as z, ExpandLess as at, ExpandMore as it, Icon as fe, NoteStack as Ne, Payments as ke, Person as we, Trophy as ot } from "@mxenabled/mx-icons";
13
- import { Fragment as F, jsx as e, jsxs as c } from "react/jsx-runtime";
14
- import { useTheme as rt } from "@mui/material/styles";
15
- import st from "@mui/material/Box";
3
+ import { observer as D } from "mobx-react-lite";
4
+ import Pe from "@mui/material/Alert";
5
+ import je from "@mui/material/Snackbar";
6
+ import f from "@mui/material/Stack";
16
7
  import re from "@mui/material/Tab";
17
- import ct from "@mui/material/Tabs";
18
- import lt from "@mui/material/IconButton";
19
- import { getUnixTime as dt } from "date-fns/getUnixTime";
20
- import { fromUnixTime as ee } from "date-fns/fromUnixTime";
21
- import Ke from "@mui/material/Card";
22
- import De from "@mui/material/CardContent";
23
- import mt from "@mui/material/CardHeader";
24
- import E from "@mui/material/Divider";
25
- import ut from "@mui/material/Checkbox";
8
+ import Fe from "@mui/material/Tabs";
9
+ import { b as B } from "../Localization-DnoVyBNK.mjs";
10
+ import { f as I } from "../NumberFormatting--XMeeBfr.mjs";
11
+ import { Text as C, H3 as le, P as Y, Icon as $e, InstitutionLogo as X, H2 as Te } from "@mxenabled/mxui";
12
+ import me from "@mui/material/Button";
13
+ import Ce from "@mui/material/Card";
14
+ import Re from "@mui/material/CardActionArea";
15
+ import xe from "@mui/material/CardContent";
16
+ import ge from "@mui/material/Grid";
17
+ import te from "@mui/material/Avatar";
18
+ import He from "@mui/material/CardHeader";
19
+ import { Payments as Ee, NoteStack as Se, Person as ve, ArrowUpwardAlt as Ue, CheckCircle as Ye, ChevronRight as z, Icon as ye, ExpandLess as Ze, ExpandMore as qe, AddBox as Ie, Trophy as Je } from "@mxenabled/mx-icons";
20
+ import { g as ue, T as r, G as de, a as Qe, M as U, b as Xe } from "../GoalsUtil-C9EnLWvC.mjs";
21
+ import { u as x, k as N, a as _e, i as pe, c as j, C as Ge, f as Ne } from "../hooks-97sNJ_lf.mjs";
22
+ import { u as he } from "../useScreenSize-mWpmnh5w.mjs";
23
+ import { S as et } from "../StatusBar-CPfSXe80.mjs";
24
+ import v from "@mui/material/Divider";
26
25
  import O from "@mui/material/List";
26
+ import { L as Z } from "../ListItemAction-BqUCLj_w.mjs";
27
+ import { C as ke } from "../CurrencyInput-DaGEQaLW.mjs";
28
+ import { fromUnixTime as ee } from "date-fns/fromUnixTime";
29
+ import tt from "@mui/material/IconButton";
27
30
  import k from "@mui/material/ListItem";
31
+ import P from "@mui/material/ListItemAvatar";
28
32
  import L from "@mui/material/ListItemButton";
29
- import _t from "@mui/material/ListItemIcon";
30
33
  import w from "@mui/material/ListItemText";
31
- import Me from "@mui/material/TextField";
32
- import te from "@mui/material/Avatar";
33
- import P from "@mui/material/ListItemAvatar";
34
- import { AdapterDateFns as pt } from "@mui/x-date-pickers/AdapterDateFnsV3";
35
- import ht from "@mui/material/Alert";
36
- import bt from "@mui/material/Snackbar";
37
- import gt from "@mui/material/Collapse";
38
- import Ae from "@mui/material/Grid";
39
- import { DatePicker as yt } from "@mui/x-date-pickers";
40
- import { LocalizationProvider as ft } from "@mui/x-date-pickers/LocalizationProvider";
41
- import Le from "@mui/material/CardActionArea";
42
- import { isValid as At } from "date-fns/isValid";
34
+ import { f as be, D as fe } from "../DateFormats-HudZ3Bjs.mjs";
35
+ import { D as q } from "../Drawer-DsnW2o0v.mjs";
36
+ import { g as we, u as nt } from "../useAccountDisplayName-BsiXA0qf.mjs";
37
+ import ot from "@mui/material/Collapse";
38
+ import at from "@mui/material/ListItemIcon";
39
+ import it from "@mui/material/Checkbox";
40
+ import { C as De } from "../ConnectCard-D7uxoH5Y.mjs";
41
+ import { c as Ae } from "../Account-DR7Plrqy.mjs";
42
+ import Ke from "@mui/material/TextField";
43
+ import { M as rt, I as st, O as ct } from "../OriginalBalanceAction-YrvxBYAl.mjs";
44
+ import { getUnixTime as lt } from "date-fns/getUnixTime";
45
+ import { isValid as dt } from "date-fns/isValid";
46
+ import { AdapterDateFns as mt } from "@mui/x-date-pickers/AdapterDateFnsV3";
47
+ import { DatePicker as ut } from "@mui/x-date-pickers";
48
+ import { LocalizationProvider as _t } from "@mui/x-date-pickers/LocalizationProvider";
49
+ import { D as pt } from "../Dialog-Bvd2n8hz.mjs";
50
+ import { u as Me } from "../useWidgetLoadTimer-B0tB-yzL.mjs";
51
+ import { A as $ } from "../Analytics-WeZYytR0.mjs";
52
+ import { L as Le } from "../Loader-CxeBwuPG.mjs";
53
+ import { W as ht } from "../WidgetContainer-DJnp6t6c.mjs";
54
+ import { E as bt } from "../EmptyState-CJUDc3kD.mjs";
55
+ import ft from "@mui/material/Box";
56
+ import { useTheme as gt } from "@mui/material/styles";
57
+ import { S as yt } from "../SingleSegmentDonut-7Uy6VEld.mjs";
58
+ import { M as At } from "../MicroWidgetContainer-B2NnKBgW.mjs";
43
59
  function se({ title: t, subtitle: n }) {
44
- return /* @__PURE__ */ c(g, { children: [/* @__PURE__ */ e(C, {
45
- bold: !0,
46
- variant: "body1",
47
- children: t
48
- }), /* @__PURE__ */ e(C, {
49
- sx: { fontWeight: 400 },
50
- variant: "body1",
51
- children: n
52
- })] });
60
+ return /* @__PURE__ */ c(f, { children: [
61
+ /* @__PURE__ */ e(C, { bold: !0, variant: "body1", children: t }),
62
+ /* @__PURE__ */ e(C, { sx: { fontWeight: 400 }, variant: "body1", children: n })
63
+ ] });
53
64
  }
54
- var Tt = (t, n) => n ? S(t, t < 1e3 ? "0" : "0.00a").replace(/(\d+)(?:\.0+|(\.\d*?[1-9])0*)([a-zA-Z]* ?\$?)/g, "$1$2$3") : S(t, "0,0.00"), Oe = K(({ goal: t, isInDrawer: n = !1, onClick: u }) => {
55
- const { goals: d } = R(), { isMobile: _, isTablet: o } = pe(), m = _ || o, { backgroundColor: p, color: s, percentage: h, percentageText: i, projectedText: a } = me(d, t), b = t.track_type === r.DEBT_TRACK ? t.initial_amount : t.amount, l = [{
56
- color: p,
57
- percentage: `${h}`
58
- }];
59
- let f = /* @__PURE__ */ e(ke, {});
60
- return t.track_type === r.DEBT_TRACK ? f = /* @__PURE__ */ e(Ne, {}) : t.track_type === r.RETIREMENT_TRACK && (f = /* @__PURE__ */ e(we, {})), /* @__PURE__ */ e(Ke, {
61
- elevation: 2,
62
- sx: { "&:focus-within": {
63
- outline: "2px solid",
64
- outlineColor: "primary.main"
65
- } },
66
- children: /* @__PURE__ */ c(Le, {
67
- disabled: !u,
68
- onClick: u,
69
- children: [/* @__PURE__ */ e(mt, {
70
- avatar: /* @__PURE__ */ e(te, {
71
- sx: {
72
- bgcolor: p,
73
- color: s,
74
- height: 48,
75
- width: 48
76
- },
77
- variant: "rounded",
78
- children: f
79
- }),
80
- subheader: /* @__PURE__ */ e(C, {
81
- sx: {
82
- fontWeight: 700,
83
- fontSize: n || m ? "18px" : "23px",
84
- lineHeight: n || m ? "24px" : "32px"
85
- },
86
- children: `${S(t.current_amount, m ? "0,0" : "0,0.00")} / ${Tt(b, m)}`
87
- }),
65
+ const Tt = (t, n) => n ? I(t, t < 1e3 ? "0" : "0.00a").replace(
66
+ /(\d+)(?:\.0+|(\.\d*?[1-9])0*)([a-zA-Z]* ?\$?)/g,
67
+ "$1$2$3"
68
+ ) : I(t, "0,0.00"), Oe = D(
69
+ ({ goal: t, isInDrawer: n = !1, onClick: u }) => {
70
+ const { goals: d } = x(), { isMobile: _, isTablet: i } = he(), m = _ || i, {
71
+ backgroundColor: p,
72
+ color: s,
73
+ percentage: h,
74
+ percentageText: a,
75
+ projectedText: o
76
+ } = ue(d, t), b = t.track_type === r.DEBT_TRACK ? t.initial_amount : t.amount, l = [
77
+ {
78
+ color: p,
79
+ percentage: `${h}`
80
+ }
81
+ ];
82
+ let y = /* @__PURE__ */ e(Ee, {});
83
+ return t.track_type === r.DEBT_TRACK ? y = /* @__PURE__ */ e(Se, {}) : t.track_type === r.RETIREMENT_TRACK && (y = /* @__PURE__ */ e(ve, {})), /* @__PURE__ */ e(
84
+ Ce,
85
+ {
86
+ elevation: 2,
88
87
  sx: {
89
- alignItems: "flex-start",
90
- "& .MuiCardHeader-content": { minWidth: 0 }
88
+ "&:focus-within": {
89
+ outline: "2px solid",
90
+ outlineColor: "primary.main"
91
+ }
91
92
  },
92
- title: /* @__PURE__ */ e(C, {
93
- color: "text.secondary",
94
- fontWeight: 400,
95
- sx: {
96
- fontSize: "15px",
97
- lineHeight: "20px"
98
- },
99
- variant: "h4",
100
- children: t.name
101
- })
102
- }), /* @__PURE__ */ e(De, {
103
- sx: { pt: 0 },
104
- children: /* @__PURE__ */ c(g, {
105
- gap: 6,
106
- children: [/* @__PURE__ */ e(qe, {
107
- data: l,
108
- height: 24
109
- }), /* @__PURE__ */ c(g, {
110
- alignItems: "center",
111
- direction: "row",
112
- justifyContent: "space-between",
113
- children: [/* @__PURE__ */ e(C, {
114
- color: "text.secondary",
115
- variant: "caption",
116
- children: i
117
- }), t.projected_to_complete_at && /* @__PURE__ */ e(C, {
118
- color: "text.secondary",
119
- variant: "caption",
120
- children: a
121
- })]
122
- })]
123
- })
124
- })]
125
- })
126
- });
127
- }), Ct = K(({ trackType: t }) => {
128
- const { goals: n } = R(), { setAlert: u, monthlyCashFlowProfile: d, updateMonthlyCashFlowProfile: _ } = N(), o = T.useMemo(() => {
129
- let i = 0;
130
- return t === r.SAVINGS_TRACK ? i = d?.amount_allocated_for_savings_goals || 0 : t === r.DEBT_TRACK ? i = d?.amount_allocated_for_debt_goals || 0 : t === r.RETIREMENT_TRACK && (i = d?.amount_allocated_for_retirement_goals || 0), i;
93
+ children: /* @__PURE__ */ c(Re, { disabled: !u, onClick: u, children: [
94
+ /* @__PURE__ */ e(
95
+ He,
96
+ {
97
+ avatar: /* @__PURE__ */ e(te, { sx: { bgcolor: p, color: s, height: 48, width: 48 }, variant: "rounded", children: y }),
98
+ subheader: /* @__PURE__ */ e(
99
+ C,
100
+ {
101
+ sx: {
102
+ fontWeight: 700,
103
+ fontSize: n || m ? "18px" : "23px",
104
+ lineHeight: n || m ? "24px" : "32px"
105
+ },
106
+ children: `${I(t.current_amount, m ? "0,0" : "0,0.00")} / ${Tt(
107
+ b,
108
+ m
109
+ )}`
110
+ }
111
+ ),
112
+ sx: { alignItems: "flex-start", "& .MuiCardHeader-content": { minWidth: 0 } },
113
+ title: /* @__PURE__ */ e(
114
+ C,
115
+ {
116
+ color: "text.secondary",
117
+ fontWeight: 400,
118
+ sx: {
119
+ fontSize: "15px",
120
+ lineHeight: "20px"
121
+ },
122
+ variant: "h4",
123
+ children: t.name
124
+ }
125
+ )
126
+ }
127
+ ),
128
+ /* @__PURE__ */ e(xe, { sx: { pt: 0 }, children: /* @__PURE__ */ c(f, { gap: 6, children: [
129
+ /* @__PURE__ */ e(et, { data: l, height: 24 }),
130
+ /* @__PURE__ */ c(f, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
131
+ /* @__PURE__ */ e(C, { color: "text.secondary", variant: "caption", children: a }),
132
+ t.projected_to_complete_at && /* @__PURE__ */ e(C, { color: "text.secondary", variant: "caption", children: o })
133
+ ] })
134
+ ] }) })
135
+ ] })
136
+ }
137
+ );
138
+ }
139
+ ), Ct = D(({ trackType: t }) => {
140
+ const { goals: n } = x(), { setAlert: u, monthlyCashFlowProfile: d, updateMonthlyCashFlowProfile: _ } = N(), i = T.useMemo(() => {
141
+ let a = 0;
142
+ return t === r.SAVINGS_TRACK ? a = d?.amount_allocated_for_savings_goals || 0 : t === r.DEBT_TRACK ? a = d?.amount_allocated_for_debt_goals || 0 : t === r.RETIREMENT_TRACK && (a = d?.amount_allocated_for_retirement_goals || 0), a;
131
143
  }, [d]);
132
144
  T.useEffect(() => {
133
- p(o);
134
- }, [o]);
135
- const [m, p] = T.useState(o), s = m < 0 || m > 99999999, h = async () => {
145
+ p(i);
146
+ }, [i]);
147
+ const [m, p] = T.useState(i), s = m < 0 || m > 99999999, h = async () => {
136
148
  if (d) {
137
- const i = { ...d };
138
- t === r.SAVINGS_TRACK ? i.amount_allocated_for_savings_goals = m : t === r.DEBT_TRACK ? i.amount_allocated_for_debt_goals = m : t === r.RETIREMENT_TRACK && (i.amount_allocated_for_retirement_goals = m), await _(i), u(n.alert_contribution_updated);
149
+ const a = { ...d };
150
+ t === r.SAVINGS_TRACK ? a.amount_allocated_for_savings_goals = m : t === r.DEBT_TRACK ? a.amount_allocated_for_debt_goals = m : t === r.RETIREMENT_TRACK && (a.amount_allocated_for_retirement_goals = m), await _(a), u(n.alert_contribution_updated);
139
151
  }
140
152
  };
141
- return /* @__PURE__ */ e(g, {
142
- bgcolor: "background.paper",
143
- children: /* @__PURE__ */ e(Z, {
153
+ return /* @__PURE__ */ e(f, { bgcolor: "background.paper", children: /* @__PURE__ */ e(
154
+ Z,
155
+ {
144
156
  isSaveDisabled: !m || isNaN(m),
145
157
  label: n.contribution_label,
146
- onCancel: () => p(o),
158
+ onCancel: () => p(i),
147
159
  onSave: h,
148
160
  primaryText: n.contribution_label,
149
- secondaryText: S(o, "0,0.00"),
150
- children: /* @__PURE__ */ e(Te, {
151
- amount: m,
152
- autoFocus: !0,
153
- error: s,
154
- fullWidth: !0,
155
- minAmount: 0,
156
- setAmount: (i) => p(isNaN(Number(i)) ? m : Number(i)),
157
- sx: { ".MuiTypography-body1": { p: 0 } }
158
- })
159
- })
160
- });
161
- }), vt = ({ goal: t, index: n, onUpClick: u }) => {
162
- const { goals: d } = R(), { percentage: _ } = me(d, t), o = t.goal_type === le.KEEP_BALANCE_BELOW || t.has_been_spent ? d.goal_completed : B(d.goal_percentage_reached, `${_ * 100}`);
163
- return /* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(L, {
164
- disableRipple: !0,
165
- sx: {
166
- ":hover": { backgroundColor: "unset" },
167
- cursor: "default"
168
- },
169
- children: [t.track_type !== r.RETIREMENT_TRACK && /* @__PURE__ */ e(P, {
170
- sx: {
171
- alignItems: "center",
172
- display: "flex",
173
- justifyContent: "center",
174
- ".MuiAvatar-root": {
175
- height: "16px",
176
- width: "16px"
161
+ secondaryText: I(i, "0,0.00"),
162
+ children: /* @__PURE__ */ e(
163
+ ke,
164
+ {
165
+ amount: m,
166
+ autoFocus: !0,
167
+ error: s,
168
+ fullWidth: !0,
169
+ minAmount: 0,
170
+ setAmount: (a) => p(isNaN(Number(a)) ? m : Number(a)),
171
+ sx: { ".MuiTypography-body1": { p: 0 } }
177
172
  }
178
- },
179
- children: t.track_type === r.SAVINGS_TRACK ? /* @__PURE__ */ e(lt, {
180
- onClick: () => u?.(t),
181
- children: /* @__PURE__ */ e(tt, {
182
- color: "primary",
183
- size: 24
184
- })
185
- }) : /* @__PURE__ */ e(te, {
186
- sx: {
187
- bgcolor: "text.primary",
188
- height: "16px",
189
- width: "16px"
190
- },
191
- children: /* @__PURE__ */ e(C, {
192
- bold: !0,
193
- variant: "caption",
194
- children: n + 1
195
- })
196
- })
197
- }), /* @__PURE__ */ e(w, {
198
- slotProps: { primary: { variant: "body1" } },
199
- children: /* @__PURE__ */ c(g, {
200
- alignItems: "center",
201
- direction: "row",
202
- justifyContent: "space-between",
203
- children: [/* @__PURE__ */ c(g, {
204
- sx: { maxWidth: "70%" },
205
- children: [/* @__PURE__ */ e(C, {
206
- bold: !0,
207
- variant: "body1",
208
- children: t.name
209
- }), /* @__PURE__ */ e(C, {
210
- variant: "caption",
211
- children: t.is_complete ? o : B(d.goal_projection, _e(ee(t.projected_to_complete_at || 0), ue.MONTH_SHORT_YEAR))
212
- })]
213
- }), /* @__PURE__ */ e(C, {
214
- bold: !0,
215
- variant: "body1",
216
- children: S(t.amount, "0,0.00")
217
- })]
218
- })
219
- })]
220
- }) });
221
- }, Rt = ({ goal: t }) => {
222
- const { goals: n } = R();
223
- return /* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(L, {
224
- disableRipple: !0,
225
- sx: {
226
- ":hover": { backgroundColor: "unset" },
227
- cursor: "default"
228
- },
229
- children: [/* @__PURE__ */ e(P, {
230
- sx: {
231
- alignItems: "center",
232
- display: "flex",
233
- justifyContent: "center"
234
- },
235
- children: /* @__PURE__ */ e(nt, {
236
- color: "success",
237
- filled: !0,
238
- size: 20
239
- })
240
- }), /* @__PURE__ */ e(w, {
241
- slotProps: { primary: { variant: "body1" } },
242
- children: /* @__PURE__ */ c(g, {
243
- alignItems: "center",
244
- direction: "row",
245
- justifyContent: "space-between",
246
- children: [/* @__PURE__ */ c(g, { children: [/* @__PURE__ */ e(C, {
247
- bold: !0,
248
- variant: "body1",
249
- children: t.name
250
- }), /* @__PURE__ */ e(C, {
251
- variant: "caption",
252
- children: B(n.completed_label, _e(ee(t.completed_at || 0), ue.MONTH_SHORT_YEAR))
253
- })] }), /* @__PURE__ */ e(C, {
254
- bold: !0,
255
- variant: "body1",
256
- children: S(t.amount, "0,0.00")
257
- })]
258
- })
259
- })]
260
- }) }, t.guid);
261
- }, xt = ({ trackType: t }) => {
262
- const { goals: n, common: u } = R(), { loadGoals: d, orderedGoals: _, reorderGoals: o } = N(), m = _.filter((y) => y.track_type === t), p = m.filter((y) => y.track_type === r.SAVINGS_TRACK && !y.has_been_spent || y.track_type !== r.SAVINGS_TRACK && !y.is_complete), s = m.filter((y) => y.track_type === r.SAVINGS_TRACK && y.has_been_spent || y.track_type !== r.SAVINGS_TRACK && y.is_complete), [h, i] = T.useState(!1);
263
- let a = n.manage_saving_goals, b = n.manage_saving_drawer_title, l = n.manage_saving_title, f = n.manage_saving_description;
264
- t === r.DEBT_TRACK ? (a = n.manage_debt_goals, b = n.manage_debt_drawer_title, l = n.manage_debt_title, f = n.manage_debt_description) : t === r.RETIREMENT_TRACK && (a = n.manage_retirement_goals, b = n.manage_retirement_drawer_title, l = n.manage_retirement_title, f = n.manage_retirement_description);
265
- const x = async (y) => {
266
- const A = [...p], v = A.findIndex((D) => D.guid === y.guid);
267
- let G = v - 1;
268
- G < 0 && (G = A.length - 1), A.splice(G, 0, A.splice(v, 1)[0]);
269
- for (let D = 0; D < A.length; D++) A[D].position = D + 1;
270
- await o(A), await d();
173
+ )
174
+ }
175
+ ) });
176
+ }), Rt = ({ goal: t, index: n, onUpClick: u }) => {
177
+ const { goals: d } = x(), { percentage: _ } = ue(d, t), i = t.goal_type === de.KEEP_BALANCE_BELOW || t.has_been_spent ? d.goal_completed : B(d.goal_percentage_reached, `${_ * 100}`);
178
+ return /* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(
179
+ L,
180
+ {
181
+ disableRipple: !0,
182
+ sx: { ":hover": { backgroundColor: "unset" }, cursor: "default" },
183
+ children: [
184
+ t.track_type !== r.RETIREMENT_TRACK && /* @__PURE__ */ e(
185
+ P,
186
+ {
187
+ sx: {
188
+ alignItems: "center",
189
+ display: "flex",
190
+ justifyContent: "center",
191
+ ".MuiAvatar-root": { height: "16px", width: "16px" }
192
+ },
193
+ children: t.track_type === r.SAVINGS_TRACK ? /* @__PURE__ */ e(tt, { onClick: () => u?.(t), children: /* @__PURE__ */ e(Ue, { color: "primary", size: 24 }) }) : /* @__PURE__ */ e(te, { sx: { bgcolor: "text.primary", height: "16px", width: "16px" }, children: /* @__PURE__ */ e(C, { bold: !0, variant: "caption", children: n + 1 }) })
194
+ }
195
+ ),
196
+ /* @__PURE__ */ e(w, { slotProps: { primary: { variant: "body1" } }, children: /* @__PURE__ */ c(f, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
197
+ /* @__PURE__ */ c(f, { sx: { maxWidth: "70%" }, children: [
198
+ /* @__PURE__ */ e(C, { bold: !0, variant: "body1", children: t.name }),
199
+ /* @__PURE__ */ e(C, { variant: "caption", children: t.is_complete ? i : B(
200
+ d.goal_projection,
201
+ be(
202
+ ee(t.projected_to_complete_at || 0),
203
+ fe.MONTH_SHORT_YEAR
204
+ )
205
+ ) })
206
+ ] }),
207
+ /* @__PURE__ */ e(C, { bold: !0, variant: "body1", children: I(t.amount, "0,0.00") })
208
+ ] }) })
209
+ ]
210
+ }
211
+ ) });
212
+ }, xt = ({ goal: t }) => {
213
+ const { goals: n } = x();
214
+ return /* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(
215
+ L,
216
+ {
217
+ disableRipple: !0,
218
+ sx: { ":hover": { backgroundColor: "unset" }, cursor: "default" },
219
+ children: [
220
+ /* @__PURE__ */ e(P, { sx: { alignItems: "center", display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ e(Ye, { color: "success", filled: !0, size: 20 }) }),
221
+ /* @__PURE__ */ e(w, { slotProps: { primary: { variant: "body1" } }, children: /* @__PURE__ */ c(f, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
222
+ /* @__PURE__ */ c(f, { children: [
223
+ /* @__PURE__ */ e(C, { bold: !0, variant: "body1", children: t.name }),
224
+ /* @__PURE__ */ e(C, { variant: "caption", children: B(
225
+ n.completed_label,
226
+ be(
227
+ ee(t.completed_at || 0),
228
+ fe.MONTH_SHORT_YEAR
229
+ )
230
+ ) })
231
+ ] }),
232
+ /* @__PURE__ */ e(C, { bold: !0, variant: "body1", children: I(t.amount, "0,0.00") })
233
+ ] }) })
234
+ ]
235
+ }
236
+ ) }, t.guid);
237
+ }, Et = ({ trackType: t }) => {
238
+ const { goals: n, common: u } = x(), { loadGoals: d, orderedGoals: _, reorderGoals: i } = N(), m = _.filter((g) => g.track_type === t), p = m.filter(
239
+ (g) => g.track_type === r.SAVINGS_TRACK && !g.has_been_spent || g.track_type !== r.SAVINGS_TRACK && !g.is_complete
240
+ ), s = m.filter(
241
+ (g) => g.track_type === r.SAVINGS_TRACK && g.has_been_spent || g.track_type !== r.SAVINGS_TRACK && g.is_complete
242
+ ), [h, a] = T.useState(!1);
243
+ let o = n.manage_saving_goals, b = n.manage_saving_drawer_title, l = n.manage_saving_title, y = n.manage_saving_description;
244
+ t === r.DEBT_TRACK ? (o = n.manage_debt_goals, b = n.manage_debt_drawer_title, l = n.manage_debt_title, y = n.manage_debt_description) : t === r.RETIREMENT_TRACK && (o = n.manage_retirement_goals, b = n.manage_retirement_drawer_title, l = n.manage_retirement_title, y = n.manage_retirement_description);
245
+ const E = async (g) => {
246
+ const A = [...p], R = A.findIndex((K) => K.guid === g.guid);
247
+ let G = R - 1;
248
+ G < 0 && (G = A.length - 1), A.splice(G, 0, A.splice(R, 1)[0]);
249
+ for (let K = 0; K < A.length; K++)
250
+ A[K].position = K + 1;
251
+ await i(A), await d();
271
252
  };
272
- return /* @__PURE__ */ c(g, { children: [/* @__PURE__ */ e(ge, {
273
- endIcon: /* @__PURE__ */ e(z, {}),
274
- onClick: () => i(!0),
275
- children: a
276
- }), /* @__PURE__ */ e(q, {
277
- ariaLabelClose: u.close_aria,
278
- isOpen: h,
279
- onClose: () => i(!1),
280
- title: b,
281
- children: /* @__PURE__ */ c(g, { children: [
282
- /* @__PURE__ */ c(g, {
283
- m: 24,
284
- children: [/* @__PURE__ */ e(de, { children: l }), /* @__PURE__ */ e(Y, {
285
- color: "text.secondary",
286
- variant: "subtitle2",
287
- children: f
288
- })]
289
- }),
290
- /* @__PURE__ */ e(Ct, { trackType: t }),
291
- /* @__PURE__ */ e(C, {
292
- bold: !0,
293
- sx: {
294
- mb: 4,
295
- mx: 24,
296
- mt: 12
297
- },
298
- variant: "caption",
299
- children: n.goal_priority
300
- }),
301
- /* @__PURE__ */ e(O, {
302
- sx: { bgcolor: "background.paper" },
303
- children: p.map((y, A) => {
304
- const v = A >= p.length - 1;
305
- return /* @__PURE__ */ c(g, { children: [/* @__PURE__ */ e(vt, {
306
- goal: y,
307
- index: A,
308
- onUpClick: x
309
- }), /* @__PURE__ */ e(E, { variant: v ? "fullWidth" : "inset" })] }, `ongoing-${y.guid}`);
310
- })
311
- }),
312
- t !== r.RETIREMENT_TRACK && s.length > 0 && /* @__PURE__ */ c(g, { children: [/* @__PURE__ */ e(C, {
313
- bold: !0,
314
- sx: {
315
- mb: 4,
316
- mx: 24,
317
- mt: 12
318
- },
319
- variant: "caption",
320
- children: n.complete_title
321
- }), /* @__PURE__ */ e(O, {
322
- sx: { bgcolor: "background.paper" },
323
- children: s.map((y, A) => {
324
- const v = A > p.length - 1;
325
- return /* @__PURE__ */ c(g, { children: [/* @__PURE__ */ e(Rt, { goal: y }), /* @__PURE__ */ e(E, { variant: v ? "fullWidth" : "inset" })] }, `complete-${y.guid}`);
326
- })
327
- })] })
328
- ] })
329
- })] });
330
- }, ce = K(({ trackType: t, onAddGoals: n }) => {
331
- const { isMobile: u } = pe(), { goals: d } = R(), { selectedAccountGuids: _ } = he(), { orderedGoals: o, setSelectedGoal: m } = N(), p = o.filter((a) => a.track_type === t && (a.track_type !== r.RETIREMENT_TRACK && _.includes(a.account_guid) || a.track_type === r.RETIREMENT_TRACK)), s = p.filter((a) => a.track_type === r.SAVINGS_TRACK && !a.has_been_spent || a.track_type !== r.SAVINGS_TRACK && !a.is_complete), h = p.filter((a) => a.track_type === r.SAVINGS_TRACK && a.has_been_spent || a.track_type !== r.SAVINGS_TRACK && a.is_complete), i = t === r.DEBT_TRACK ? d.zero_state_complete_debt : d.zero_state_complete_savings;
332
- return /* @__PURE__ */ c(g, {
333
- mt: 16,
334
- mx: u ? 24 : 0,
335
- children: [
336
- /* @__PURE__ */ c(g, {
337
- alignItems: "center",
338
- direction: "row",
339
- justifyContent: "space-between",
340
- mb: 8,
341
- children: [/* @__PURE__ */ e(de, {
342
- color: "text.secondary",
343
- variant: "body2",
344
- children: d.ongoing_title
345
- }), /* @__PURE__ */ e(xt, { trackType: t })]
346
- }),
347
- s.length > 0 ? /* @__PURE__ */ e(Ae, {
348
- container: !0,
349
- spacing: 24,
350
- children: s.map((a, b, l) => /* @__PURE__ */ e(Ae, {
351
- size: u || b === 0 && l.length !== 2 ? 12 : 6,
352
- children: /* @__PURE__ */ e(Oe, {
353
- goal: a,
354
- onClick: () => m(a)
355
- }, a.guid)
356
- }, b))
357
- }) : /* @__PURE__ */ c(g, {
253
+ return /* @__PURE__ */ c(f, { children: [
254
+ /* @__PURE__ */ e(me, { endIcon: /* @__PURE__ */ e(z, {}), onClick: () => a(!0), children: o }),
255
+ /* @__PURE__ */ e(
256
+ q,
257
+ {
258
+ ariaLabelClose: u.close_aria,
259
+ isOpen: h,
260
+ onClose: () => a(!1),
261
+ title: b,
262
+ children: /* @__PURE__ */ c(f, { children: [
263
+ /* @__PURE__ */ c(f, { m: 24, children: [
264
+ /* @__PURE__ */ e(le, { children: l }),
265
+ /* @__PURE__ */ e(Y, { color: "text.secondary", variant: "subtitle2", children: y })
266
+ ] }),
267
+ /* @__PURE__ */ e(Ct, { trackType: t }),
268
+ /* @__PURE__ */ e(C, { bold: !0, sx: { mb: 4, mx: 24, mt: 12 }, variant: "caption", children: n.goal_priority }),
269
+ /* @__PURE__ */ e(O, { sx: { bgcolor: "background.paper" }, children: p.map((g, A) => {
270
+ const R = A >= p.length - 1;
271
+ return /* @__PURE__ */ c(f, { children: [
272
+ /* @__PURE__ */ e(Rt, { goal: g, index: A, onUpClick: E }),
273
+ /* @__PURE__ */ e(v, { variant: R ? "fullWidth" : "inset" })
274
+ ] }, `ongoing-${g.guid}`);
275
+ }) }),
276
+ t !== r.RETIREMENT_TRACK && s.length > 0 && /* @__PURE__ */ c(f, { children: [
277
+ /* @__PURE__ */ e(C, { bold: !0, sx: { mb: 4, mx: 24, mt: 12 }, variant: "caption", children: n.complete_title }),
278
+ /* @__PURE__ */ e(O, { sx: { bgcolor: "background.paper" }, children: s.map((g, A) => {
279
+ const R = A > p.length - 1;
280
+ return /* @__PURE__ */ c(f, { children: [
281
+ /* @__PURE__ */ e(xt, { goal: g }),
282
+ /* @__PURE__ */ e(v, { variant: R ? "fullWidth" : "inset" })
283
+ ] }, `complete-${g.guid}`);
284
+ }) })
285
+ ] })
286
+ ] })
287
+ }
288
+ )
289
+ ] });
290
+ }, ce = D(({ trackType: t, onAddGoals: n }) => {
291
+ const { isMobile: u } = he(), { goals: d } = x(), { selectedAccountGuids: _ } = _e(), { orderedGoals: i, setSelectedGoal: m } = N(), p = i.filter(
292
+ (o) => o.track_type === t && (o.track_type !== r.RETIREMENT_TRACK && _.includes(o.account_guid) || o.track_type === r.RETIREMENT_TRACK)
293
+ ), s = p.filter(
294
+ (o) => o.track_type === r.SAVINGS_TRACK && !o.has_been_spent || o.track_type !== r.SAVINGS_TRACK && !o.is_complete
295
+ ), h = p.filter(
296
+ (o) => o.track_type === r.SAVINGS_TRACK && o.has_been_spent || o.track_type !== r.SAVINGS_TRACK && o.is_complete
297
+ ), a = t === r.DEBT_TRACK ? d.zero_state_complete_debt : d.zero_state_complete_savings;
298
+ return /* @__PURE__ */ c(f, { mt: 16, mx: u ? 24 : 0, children: [
299
+ /* @__PURE__ */ c(f, { alignItems: "center", direction: "row", justifyContent: "space-between", mb: 8, children: [
300
+ /* @__PURE__ */ e(le, { color: "text.secondary", variant: "body2", children: d.ongoing_title }),
301
+ /* @__PURE__ */ e(Et, { trackType: t })
302
+ ] }),
303
+ s.length > 0 ? /* @__PURE__ */ e(ge, { container: !0, spacing: 24, children: s.map((o, b, l) => (
304
+ // Goal should be full width in mobile or if it's the first goal (unless there are 2)
305
+ /* @__PURE__ */ e(ge, { size: u || b === 0 && l.length !== 2 ? 12 : 6, children: /* @__PURE__ */ e(Oe, { goal: o, onClick: () => m(o) }, o.guid) }, b)
306
+ )) }) : /* @__PURE__ */ c(
307
+ f,
308
+ {
358
309
  alignItems: "center",
359
310
  bgcolor: "background.default",
360
311
  borderRadius: 2,
361
312
  height: 166,
362
313
  justifyContent: "center",
363
314
  py: 18,
364
- children: [/* @__PURE__ */ e(Y, {
365
- sx: (a) => ({
366
- color: "text.secondary",
367
- [a.breakpoints.down("sm")]: { px: 10 },
368
- width: { sm: 381 }
369
- }),
370
- variant: "body2",
371
- children: Pe(t, d)
372
- }), /* @__PURE__ */ e(ge, {
373
- onClick: n,
374
- sx: {
375
- mt: 16,
376
- width: { sm: 224 }
377
- },
378
- variant: "contained",
379
- children: d.add_goals_button
380
- })]
381
- }),
382
- t !== r.RETIREMENT_TRACK && /* @__PURE__ */ c(g, {
383
- gap: 16,
384
- mt: 48,
385
315
  children: [
386
- /* @__PURE__ */ e(de, {
387
- color: "text.secondary",
388
- variant: "body2",
389
- children: d.complete_title
390
- }),
391
- h.length === 0 && /* @__PURE__ */ e(g, {
392
- alignItems: "center",
393
- bgcolor: "background.default",
394
- borderRadius: 2,
395
- py: 18,
396
- children: /* @__PURE__ */ e(Y, {
397
- sx: (a) => ({
316
+ /* @__PURE__ */ e(
317
+ Y,
318
+ {
319
+ sx: (o) => ({
398
320
  color: "text.secondary",
399
- width: { sm: 393 },
400
- [a.breakpoints.down("sm")]: { px: 10 }
321
+ [o.breakpoints.down("sm")]: {
322
+ px: 10
323
+ },
324
+ width: { sm: 381 }
401
325
  }),
402
326
  variant: "body2",
403
- children: i
404
- })
405
- }),
406
- h.map((a) => /* @__PURE__ */ e(Ke, {
407
- elevation: 2,
408
- children: /* @__PURE__ */ e(Le, {
409
- onClick: () => m(a),
410
- children: /* @__PURE__ */ e(De, {
411
- sx: { ":last-child": { pb: 16 } },
412
- children: /* @__PURE__ */ c(g, {
413
- alignItems: "center",
414
- direction: "row",
415
- justifyContent: "space-between",
416
- children: [/* @__PURE__ */ c(g, {
417
- alignItems: "center",
418
- direction: "row",
419
- gap: 6,
420
- children: [/* @__PURE__ */ e(et, {
421
- color: "success",
422
- fill: !0,
423
- name: "check_circle",
424
- size: 20
425
- }), /* @__PURE__ */ e(C, {
426
- color: "text.secondary",
427
- variant: "body1",
428
- children: a.name
429
- })]
430
- }), /* @__PURE__ */ e(C, {
431
- bold: !0,
432
- variant: "body1",
433
- children: S(a.amount, "0,0.00")
434
- })]
435
- })
436
- })
437
- })
438
- }, a.guid))
327
+ children: Qe(t, d)
328
+ }
329
+ ),
330
+ /* @__PURE__ */ e(me, { onClick: n, sx: { mt: 16, width: { sm: 224 } }, variant: "contained", children: d.add_goals_button })
439
331
  ]
440
- })
441
- ]
442
- });
443
- }), Et = ({ goalType: t, onClick: n }) => {
444
- const { goals: u } = R(), { bgcolor: d, icon: _, label: o, description: m, subTypes: p, type: s } = t, [h, i] = T.useState(!1), a = p.length > 0;
445
- return /* @__PURE__ */ e(g, { children: /* @__PURE__ */ c(O, {
446
- sx: { bgcolor: "background.paper" },
447
- children: [
448
- /* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(L, {
449
- onClick: a ? () => i(!h) : () => n(s === r.RETIREMENT_TRACK ? u.retirement : "", s === r.RETIREMENT_TRACK ? U.RETIREMENT : U.OTHER, s),
450
- children: [
451
- /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(te, {
452
- sx: { bgcolor: d },
453
- variant: "rounded",
454
- children: /* @__PURE__ */ e(fe, {
455
- name: _,
456
- sx: { color: "grey.900" }
457
- })
458
- }) }),
459
- /* @__PURE__ */ e(w, {
460
- primary: o,
461
- secondary: m,
462
- sx: { mr: 24 }
332
+ }
333
+ ),
334
+ t !== r.RETIREMENT_TRACK && /* @__PURE__ */ c(f, { gap: 16, mt: 48, children: [
335
+ /* @__PURE__ */ e(le, { color: "text.secondary", variant: "body2", children: d.complete_title }),
336
+ h.length === 0 && /* @__PURE__ */ e(f, { alignItems: "center", bgcolor: "background.default", borderRadius: 2, py: 18, children: /* @__PURE__ */ e(
337
+ Y,
338
+ {
339
+ sx: (o) => ({
340
+ color: "text.secondary",
341
+ width: { sm: 393 },
342
+ [o.breakpoints.down("sm")]: {
343
+ px: 10
344
+ }
463
345
  }),
464
- !a && /* @__PURE__ */ e(z, {}),
465
- a && (h ? /* @__PURE__ */ e(at, {}) : /* @__PURE__ */ e(it, {}))
466
- ]
467
- }) }),
468
- /* @__PURE__ */ e(E, { variant: "inset" }),
469
- a && /* @__PURE__ */ e(gt, {
470
- in: h,
471
- children: /* @__PURE__ */ e(O, {
472
- sx: { bgcolor: "background.default" },
473
- children: p.map((b, l) => /* @__PURE__ */ e(k, {
474
- sx: { pl: 48 },
475
- children: /* @__PURE__ */ c(L, {
476
- onClick: () => n(b.label, b.metaType, s),
477
- children: [
478
- /* @__PURE__ */ e(_t, {
479
- sx: { mr: 8 },
480
- children: /* @__PURE__ */ e(fe, { name: b.icon })
481
- }),
482
- /* @__PURE__ */ e(w, {
483
- primary: b.label,
484
- slotProps: { primary: { variant: "body1" } }
485
- }),
486
- /* @__PURE__ */ e(z, {})
487
- ]
488
- })
489
- }, l))
490
- })
491
- })
492
- ]
493
- }) });
494
- }, Be = ({ accounts: t, isOpen: n, onClose: u, onSave: d, title: _ }) => {
495
- const { goals: o, common: m } = R(), { config: p } = be(), [s, h] = T.useState([]), i = (a) => {
496
- const b = s.findIndex((f) => f.guid === a.guid), l = [...s];
497
- b >= 0 ? l.splice(b, 1) : l.push(a), h(l);
498
- };
499
- return /* @__PURE__ */ c(q, {
500
- ariaLabelClose: m.close_aria,
501
- isOpen: n,
502
- onClose: u,
503
- onPrimaryAction: () => d(s),
504
- title: _,
505
- children: [/* @__PURE__ */ c(O, {
506
- sx: { bgcolor: "background.white" },
507
- children: [/* @__PURE__ */ e(E, { variant: "fullWidth" }), t.map((a, b) => /* @__PURE__ */ c(T.Fragment, { children: [/* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(L, {
508
- onClick: () => i(a),
346
+ variant: "body2",
347
+ children: a
348
+ }
349
+ ) }),
350
+ h.map((o) => /* @__PURE__ */ e(Ce, { elevation: 2, children: /* @__PURE__ */ e(Re, { onClick: () => m(o), children: /* @__PURE__ */ e(xe, { sx: { ":last-child": { pb: 16 } }, children: /* @__PURE__ */ c(f, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
351
+ /* @__PURE__ */ c(f, { alignItems: "center", direction: "row", gap: 6, children: [
352
+ /* @__PURE__ */ e($e, { color: "success", fill: !0, name: "check_circle", size: 20 }),
353
+ /* @__PURE__ */ e(C, { color: "text.secondary", variant: "body1", children: o.name })
354
+ ] }),
355
+ /* @__PURE__ */ e(C, { bold: !0, variant: "body1", children: I(o.amount, "0,0.00") })
356
+ ] }) }) }) }, o.guid))
357
+ ] })
358
+ ] });
359
+ }), St = ({ goalType: t, onClick: n }) => {
360
+ const { goals: u } = x(), { bgcolor: d, icon: _, label: i, description: m, subTypes: p, type: s } = t, [h, a] = T.useState(!1), o = p.length > 0;
361
+ return /* @__PURE__ */ e(f, { children: /* @__PURE__ */ c(O, { sx: { bgcolor: "background.paper" }, children: [
362
+ /* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(
363
+ L,
364
+ {
365
+ onClick: o ? () => a(!h) : () => n(
366
+ s === r.RETIREMENT_TRACK ? u.retirement : "",
367
+ s === r.RETIREMENT_TRACK ? U.RETIREMENT : U.OTHER,
368
+ s
369
+ ),
509
370
  children: [
510
- /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(Q, {
511
- alt: a?.name || "",
512
- institutionGuid: a?.institution_guid || ""
513
- }) }),
514
- /* @__PURE__ */ e(w, {
515
- primary: ve(a, { allowNickname: p?.show_account_nicknames_in_master }),
516
- secondary: S(a.balance || 0, "0,0.00")
517
- }),
518
- /* @__PURE__ */ e(ut, { checked: s.some((l) => l.guid === a.guid) })
371
+ /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(te, { sx: { bgcolor: d }, variant: "rounded", children: /* @__PURE__ */ e(ye, { name: _, sx: { color: "grey.900" } }) }) }),
372
+ /* @__PURE__ */ e(w, { primary: i, secondary: m, sx: { mr: 24 } }),
373
+ !o && /* @__PURE__ */ e(z, {}),
374
+ o && (h ? /* @__PURE__ */ e(Ze, {}) : /* @__PURE__ */ e(qe, {}))
519
375
  ]
520
- }) }), /* @__PURE__ */ e(E, { variant: b < t.length - 1 ? "inset" : "fullWidth" })] }, a.guid))]
521
- }), p.show_connections_widget_in_master && /* @__PURE__ */ e(Ce, {
522
- description: o.connect_description,
523
- label: o.connect_button,
524
- title: o.connect_title
525
- })]
526
- });
527
- }, St = ({ onClose: t }) => {
528
- const { goals: n } = R(), { addGoal: u, debtGoals: d, setAlert: _, setSelectedGoal: o } = N(), { config: m } = be(), { visibleDebtAccounts: p } = j(), [s, h] = T.useState(!1), i = je(n), a = (l, f, x) => {
529
- x === r.DEBT_TRACK ? h(!0) : o({
376
+ }
377
+ ) }),
378
+ /* @__PURE__ */ e(v, { variant: "inset" }),
379
+ o && /* @__PURE__ */ e(ot, { in: h, children: /* @__PURE__ */ e(O, { sx: { bgcolor: "background.default" }, children: p.map((b, l) => /* @__PURE__ */ e(k, { sx: { pl: 48 }, children: /* @__PURE__ */ c(L, { onClick: () => n(b.label, b.metaType, s), children: [
380
+ /* @__PURE__ */ e(at, { sx: { mr: 8 }, children: /* @__PURE__ */ e(ye, { name: b.icon }) }),
381
+ /* @__PURE__ */ e(
382
+ w,
383
+ {
384
+ primary: b.label,
385
+ slotProps: { primary: { variant: "body1" } }
386
+ }
387
+ ),
388
+ /* @__PURE__ */ e(z, {})
389
+ ] }) }, l)) }) })
390
+ ] }) });
391
+ }, Be = ({
392
+ accounts: t,
393
+ isOpen: n,
394
+ onClose: u,
395
+ onSave: d,
396
+ title: _
397
+ }) => {
398
+ const { goals: i, common: m } = x(), { config: p } = pe(), [s, h] = T.useState([]), a = (o) => {
399
+ const b = s.findIndex((y) => y.guid === o.guid), l = [...s];
400
+ b >= 0 ? l.splice(b, 1) : l.push(o), h(l);
401
+ };
402
+ return /* @__PURE__ */ c(
403
+ q,
404
+ {
405
+ ariaLabelClose: m.close_aria,
406
+ isOpen: n,
407
+ onClose: u,
408
+ onPrimaryAction: () => d(s),
409
+ title: _,
410
+ children: [
411
+ /* @__PURE__ */ c(O, { sx: { bgcolor: "background.white" }, children: [
412
+ /* @__PURE__ */ e(v, { variant: "fullWidth" }),
413
+ t.map((o, b) => /* @__PURE__ */ c(T.Fragment, { children: [
414
+ /* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(L, { onClick: () => a(o), children: [
415
+ /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
416
+ X,
417
+ {
418
+ alt: o?.name || "",
419
+ institutionGuid: o?.institution_guid || ""
420
+ }
421
+ ) }),
422
+ /* @__PURE__ */ e(
423
+ w,
424
+ {
425
+ primary: we(o, {
426
+ allowNickname: p?.show_account_nicknames_in_master
427
+ }),
428
+ secondary: I(o.balance || 0, "0,0.00")
429
+ }
430
+ ),
431
+ /* @__PURE__ */ e(it, { checked: s.some((l) => l.guid === o.guid) })
432
+ ] }) }),
433
+ /* @__PURE__ */ e(v, { variant: b < t.length - 1 ? "inset" : "fullWidth" })
434
+ ] }, o.guid))
435
+ ] }),
436
+ p.show_connections_widget_in_master && /* @__PURE__ */ e(
437
+ De,
438
+ {
439
+ description: i.connect_description,
440
+ label: i.connect_button,
441
+ title: i.connect_title
442
+ }
443
+ )
444
+ ]
445
+ }
446
+ );
447
+ }, vt = ({ onClose: t }) => {
448
+ const { goals: n } = x(), { addGoal: u, debtGoals: d, setAlert: _, setSelectedGoal: i } = N(), { config: m } = pe(), { visibleDebtAccounts: p } = j(), [s, h] = T.useState(!1), a = Xe(n), o = (l, y, E) => {
449
+ E === r.DEBT_TRACK ? h(!0) : i({
530
450
  amount: 0,
531
451
  current_amount: 0,
532
- goal_type: le.SAVE_AMOUNT,
452
+ goal_type: de.SAVE_AMOUNT,
533
453
  initial_amount: 0,
534
- meta_type: f,
454
+ meta_type: y,
535
455
  name: l,
536
- track_type: x
456
+ track_type: E
537
457
  });
538
458
  }, b = async (l) => {
539
- for (const f of l) {
540
- let x = U.CREDIT_CARD;
541
- f.account_type === ye.LOAN ? x = U.LOANS : f.account_type === ye.LINE_OF_CREDIT && (x = U.LINE_OF_CREDIT), await u({
542
- account_guid: f.guid,
459
+ for (const y of l) {
460
+ let E = U.CREDIT_CARD;
461
+ y.account_type === Ae.LOAN ? E = U.LOANS : y.account_type === Ae.LINE_OF_CREDIT && (E = U.LINE_OF_CREDIT), await u({
462
+ account_guid: y.guid,
543
463
  amount: 0,
544
464
  current_amount: 0,
545
- goal_type: le.KEEP_BALANCE_BELOW,
546
- initial_amount: f.balance || 0,
547
- interest_rate: f.interest_rate || 0,
548
- meta_type: x,
549
- monthly_payment: f.minimum_payment || 0,
550
- name: ve(f, { allowNickname: m?.show_account_nicknames_in_master }),
465
+ goal_type: de.KEEP_BALANCE_BELOW,
466
+ initial_amount: y.balance || 0,
467
+ interest_rate: y.interest_rate || 0,
468
+ meta_type: E,
469
+ monthly_payment: y.minimum_payment || 0,
470
+ name: we(y, {
471
+ allowNickname: m?.show_account_nicknames_in_master
472
+ }),
551
473
  track_type: r.DEBT_TRACK
552
474
  }), _(n.alert_goal_added);
553
475
  }
554
476
  h(!1), t?.(r.DEBT_TRACK);
555
477
  };
556
- return /* @__PURE__ */ c(g, { children: [/* @__PURE__ */ e(O, {
557
- sx: { bgcolor: "background.paper" },
558
- children: i.map((l, f) => /* @__PURE__ */ e(Et, {
559
- goalType: l,
560
- onClick: a
561
- }, f))
562
- }), /* @__PURE__ */ e(Be, {
563
- accounts: p.filter((l) => !d.find((f) => f.account_guid === l.guid)),
564
- isOpen: s,
565
- onClose: () => h(!1),
566
- onSave: b,
567
- title: n.select_debt_accounts_title
568
- })] });
478
+ return /* @__PURE__ */ c(f, { children: [
479
+ /* @__PURE__ */ e(O, { sx: { bgcolor: "background.paper" }, children: a.map((l, y) => /* @__PURE__ */ e(St, { goalType: l, onClick: o }, y)) }),
480
+ /* @__PURE__ */ e(
481
+ Be,
482
+ {
483
+ accounts: p.filter((l) => !d.find((y) => y.account_guid === l.guid)),
484
+ isOpen: s,
485
+ onClose: () => h(!1),
486
+ onSave: b,
487
+ title: n.select_debt_accounts_title
488
+ }
489
+ )
490
+ ] });
569
491
  }, We = ({ account: t }) => {
570
- const n = Ue(t);
571
- return /* @__PURE__ */ c(k, {
572
- sx: {
573
- bgcolor: "background.paper",
574
- p: 24
575
- },
576
- children: [/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(Q, {
577
- alt: t.name || "",
578
- institutionGuid: t.institution_guid || ""
579
- }) }), /* @__PURE__ */ e(w, {
580
- primary: n,
581
- secondary: S(t.balance || 0, "0,0.00")
582
- })]
583
- });
584
- }, It = K(({ goal: t }) => {
585
- const { goals: n } = R(), { setAlert: u, setSelectedGoal: d, updateGoal: _, updateRetirementGoal: o } = N(), [m, p] = T.useState(t.amount), s = !t.guid, h = m < 0 || m > 9999999999e-2, i = t.track_type === r.SAVINGS_TRACK && t.has_been_spent || t.track_type !== r.SAVINGS_TRACK && t.is_complete, a = async () => {
586
- const l = {
587
- ...t,
588
- amount: m
589
- };
590
- t.amount = m, s ? d(l) : (t.track_type !== r.RETIREMENT_TRACK ? await _(l) : await o(l), u(n.alert_goal_updated_amount));
492
+ const n = nt(t);
493
+ return /* @__PURE__ */ c(k, { sx: { bgcolor: "background.paper", p: 24 }, children: [
494
+ /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
495
+ X,
496
+ {
497
+ alt: t.name || "",
498
+ institutionGuid: t.institution_guid || ""
499
+ }
500
+ ) }),
501
+ /* @__PURE__ */ e(
502
+ w,
503
+ {
504
+ primary: n,
505
+ secondary: I(t.balance || 0, "0,0.00")
506
+ }
507
+ )
508
+ ] });
509
+ }, It = D(({ goal: t }) => {
510
+ const { goals: n } = x(), { setAlert: u, setSelectedGoal: d, updateGoal: _, updateRetirementGoal: i } = N(), [m, p] = T.useState(t.amount), s = !t.guid, h = m < 0 || m > 9999999999e-2, a = t.track_type === r.SAVINGS_TRACK && t.has_been_spent || t.track_type !== r.SAVINGS_TRACK && t.is_complete, o = async () => {
511
+ const l = { ...t, amount: m };
512
+ t.amount = m, s ? d(l) : (t.track_type !== r.RETIREMENT_TRACK ? await _(l) : await i(l), u(n.alert_goal_updated_amount));
591
513
  }, b = () => {
592
514
  setTimeout(() => {
593
515
  p(t.amount);
594
516
  }, 250);
595
517
  };
596
- return /* @__PURE__ */ e(Z, {
597
- isDisabled: i,
598
- isSaveDisabled: h,
599
- label: n.details_amount_to_save,
600
- onCancel: b,
601
- onSave: a,
602
- primaryText: n.details_amount_to_save,
603
- secondaryText: S(t.amount, "0,0"),
604
- zeroStateText: s && t.amount === 0 ? n.add_amount : void 0,
605
- children: /* @__PURE__ */ e(Te, {
606
- amount: m,
607
- autoFocus: !0,
608
- error: h,
609
- fullWidth: !0,
610
- minAmount: 0,
611
- setAmount: (l) => p(isNaN(Number(l)) ? m : Number(l)),
612
- sx: { ".MuiTypography-body1": { p: 0 } }
613
- })
614
- });
518
+ return /* @__PURE__ */ e(
519
+ Z,
520
+ {
521
+ isDisabled: a,
522
+ isSaveDisabled: h,
523
+ label: n.details_amount_to_save,
524
+ onCancel: b,
525
+ onSave: o,
526
+ primaryText: n.details_amount_to_save,
527
+ secondaryText: I(t.amount, "0,0"),
528
+ zeroStateText: s && t.amount === 0 ? n.add_amount : void 0,
529
+ children: /* @__PURE__ */ e(
530
+ ke,
531
+ {
532
+ amount: m,
533
+ autoFocus: !0,
534
+ error: h,
535
+ fullWidth: !0,
536
+ minAmount: 0,
537
+ setAmount: (l) => p(isNaN(Number(l)) ? m : Number(l)),
538
+ sx: { ".MuiTypography-body1": { p: 0 } }
539
+ }
540
+ )
541
+ }
542
+ );
615
543
  }), Gt = ({ goal: t }) => {
616
- const { visibleCheckingAccounts: n, visibleSavingsAccounts: u } = j(), { accounts: d, goals: _ } = R(), { config: o } = be(), { setAlert: m, setSelectedGoal: p, updateGoal: s } = N(), h = !t.guid, [i, a] = T.useState(!1), b = async ({ balance: l, guid: f }) => {
617
- const x = {
618
- ...t,
619
- account_guid: f,
620
- current_amount: l || 0
621
- };
622
- h ? p(x) : (await s(x), m(_.alert_account_changed)), a(!1);
544
+ const { visibleCheckingAccounts: n, visibleSavingsAccounts: u } = j(), { accounts: d, goals: _ } = x(), { config: i } = pe(), { setAlert: m, setSelectedGoal: p, updateGoal: s } = N(), h = !t.guid, [a, o] = T.useState(!1), b = async ({ balance: l, guid: y }) => {
545
+ const E = { ...t, account_guid: y, current_amount: l || 0 };
546
+ h ? p(E) : (await s(E), m(_.alert_account_changed)), o(!1);
623
547
  };
624
- return /* @__PURE__ */ c(g, { children: [h && !t.account_guid ? /* @__PURE__ */ e(k, {
625
- disableGutters: !0,
626
- disablePadding: !0,
627
- sx: { bgcolor: "background.paper" },
628
- children: /* @__PURE__ */ c(L, {
629
- onClick: () => a(!0),
630
- children: [/* @__PURE__ */ e(w, { children: /* @__PURE__ */ c(g, {
631
- alignItems: "center",
632
- color: "primary.main",
633
- direction: "row",
634
- gap: 8,
635
- children: [/* @__PURE__ */ e(Ge, { filled: !0 }), _.details_add_account]
636
- }) }), /* @__PURE__ */ e(z, { color: "primary" })]
637
- })
638
- }) : /* @__PURE__ */ c(g, {
639
- sx: {
640
- gap: 8,
641
- my: 24,
642
- mx: 24
643
- },
644
- children: [/* @__PURE__ */ e(ge, {
645
- onClick: () => a(!0),
646
- variant: "text",
647
- children: _.details_change_account
648
- }), /* @__PURE__ */ e(C, {
649
- color: "text.secondary",
650
- sx: { textAlign: "center" },
651
- variant: "subtitle1",
652
- children: B(_.details_change_account_description, t.name)
653
- })]
654
- }), /* @__PURE__ */ e(q, {
655
- isOpen: i,
656
- onClose: () => a(!1),
657
- title: _.details_change_account,
658
- children: /* @__PURE__ */ c(g, { children: [
659
- n.length > 0 && /* @__PURE__ */ e(C, {
660
- bold: !0,
661
- sx: {
662
- mb: 4,
663
- ml: 24,
664
- mt: 12
665
- },
666
- variant: "caption",
667
- children: d.account_types[1]
668
- }),
669
- /* @__PURE__ */ e(O, {
670
- sx: { bgcolor: "background.paper" },
671
- children: n.map((l) => /* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(L, {
672
- onClick: () => b(l),
673
- children: [
674
- /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(Q, {
675
- alt: l?.name || "",
676
- institutionGuid: l?.institution_guid || ""
677
- }) }),
678
- /* @__PURE__ */ e(w, {
679
- primary: l?.name || l?.feed_name,
680
- secondary: S(l?.balance || 0, "0,0.00")
681
- }),
682
- /* @__PURE__ */ e(z, {})
683
- ]
684
- }) }, l.guid))
685
- }),
686
- u.length > 0 && /* @__PURE__ */ e(C, {
687
- bold: !0,
688
- sx: {
689
- mb: 4,
690
- ml: 24,
691
- mt: 12
692
- },
693
- variant: "caption",
694
- children: d.account_types[2]
695
- }),
696
- /* @__PURE__ */ e(O, {
697
- sx: { bgcolor: "background.paper" },
698
- children: u.map((l) => /* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(L, {
699
- onClick: () => b(l),
700
- children: [
701
- /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(Q, {
702
- alt: l?.name || "",
703
- institutionGuid: l?.institution_guid || ""
704
- }) }),
705
- /* @__PURE__ */ e(w, {
706
- primary: l?.name || l?.feed_name,
707
- secondary: S(l?.balance || 0, "0,0.00")
708
- }),
709
- /* @__PURE__ */ e(z, {})
710
- ]
711
- }) }, l.guid))
712
- }),
713
- o.show_connections_widget_in_master && /* @__PURE__ */ e(Ce, {
714
- description: _.connect_description,
715
- label: _.connect_button,
716
- title: _.connect_title
717
- })
718
- ] })
719
- })] });
720
- }, Nt = K(({ goal: t }) => {
721
- const { goals: n } = R(), { setAlert: u, setSelectedGoal: d, updateGoal: _ } = N(), [o, m] = T.useState(t.name), p = !t.guid, s = t.track_type === r.SAVINGS_TRACK && t.has_been_spent || t.track_type !== r.SAVINGS_TRACK && t.is_complete, h = async () => {
722
- const a = {
723
- ...t,
724
- name: o
725
- };
726
- t.name = o, p ? d(a) : (await _(a), u(n.alert_goal_updated_name));
727
- }, i = () => {
548
+ return /* @__PURE__ */ c(f, { children: [
549
+ h && !t.account_guid ? /* @__PURE__ */ e(k, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ c(L, { onClick: () => o(!0), children: [
550
+ /* @__PURE__ */ e(w, { children: /* @__PURE__ */ c(f, { alignItems: "center", color: "primary.main", direction: "row", gap: 8, children: [
551
+ /* @__PURE__ */ e(Ie, { filled: !0 }),
552
+ _.details_add_account
553
+ ] }) }),
554
+ /* @__PURE__ */ e(z, { color: "primary" })
555
+ ] }) }) : /* @__PURE__ */ c(f, { sx: { gap: 8, my: 24, mx: 24 }, children: [
556
+ /* @__PURE__ */ e(me, { onClick: () => o(!0), variant: "text", children: _.details_change_account }),
557
+ /* @__PURE__ */ e(C, { color: "text.secondary", sx: { textAlign: "center" }, variant: "subtitle1", children: B(_.details_change_account_description, t.name) })
558
+ ] }),
559
+ /* @__PURE__ */ e(q, { isOpen: a, onClose: () => o(!1), title: _.details_change_account, children: /* @__PURE__ */ c(f, { children: [
560
+ n.length > 0 && /* @__PURE__ */ e(C, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "caption", children: d.account_types[1] }),
561
+ /* @__PURE__ */ e(O, { sx: { bgcolor: "background.paper" }, children: n.map((l) => /* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(L, { onClick: () => b(l), children: [
562
+ /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
563
+ X,
564
+ {
565
+ alt: l?.name || "",
566
+ institutionGuid: l?.institution_guid || ""
567
+ }
568
+ ) }),
569
+ /* @__PURE__ */ e(
570
+ w,
571
+ {
572
+ primary: l?.name || l?.feed_name,
573
+ secondary: I(l?.balance || 0, "0,0.00")
574
+ }
575
+ ),
576
+ /* @__PURE__ */ e(z, {})
577
+ ] }) }, l.guid)) }),
578
+ u.length > 0 && /* @__PURE__ */ e(C, { bold: !0, sx: { mb: 4, ml: 24, mt: 12 }, variant: "caption", children: d.account_types[2] }),
579
+ /* @__PURE__ */ e(O, { sx: { bgcolor: "background.paper" }, children: u.map((l) => /* @__PURE__ */ e(k, { children: /* @__PURE__ */ c(L, { onClick: () => b(l), children: [
580
+ /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(
581
+ X,
582
+ {
583
+ alt: l?.name || "",
584
+ institutionGuid: l?.institution_guid || ""
585
+ }
586
+ ) }),
587
+ /* @__PURE__ */ e(
588
+ w,
589
+ {
590
+ primary: l?.name || l?.feed_name,
591
+ secondary: I(l?.balance || 0, "0,0.00")
592
+ }
593
+ ),
594
+ /* @__PURE__ */ e(z, {})
595
+ ] }) }, l.guid)) }),
596
+ i.show_connections_widget_in_master && /* @__PURE__ */ e(
597
+ De,
598
+ {
599
+ description: _.connect_description,
600
+ label: _.connect_button,
601
+ title: _.connect_title
602
+ }
603
+ )
604
+ ] }) })
605
+ ] });
606
+ }, Nt = D(({ goal: t }) => {
607
+ const { goals: n } = x(), { setAlert: u, setSelectedGoal: d, updateGoal: _ } = N(), [i, m] = T.useState(t.name), p = !t.guid, s = t.track_type === r.SAVINGS_TRACK && t.has_been_spent || t.track_type !== r.SAVINGS_TRACK && t.is_complete, h = async () => {
608
+ const o = { ...t, name: i };
609
+ t.name = i, p ? d(o) : (await _(o), u(n.alert_goal_updated_name));
610
+ }, a = () => {
728
611
  setTimeout(() => {
729
612
  m(t.name);
730
613
  }, 250);
731
614
  };
732
- return /* @__PURE__ */ e(Z, {
733
- isDisabled: s,
734
- isSaveDisabled: !o,
735
- label: n.details_goal_name,
736
- onCancel: i,
737
- onSave: h,
738
- primaryText: n.details_goal_name,
739
- secondaryText: t.name,
740
- children: /* @__PURE__ */ e(Me, {
741
- error: !o,
742
- fullWidth: !0,
615
+ return /* @__PURE__ */ e(
616
+ Z,
617
+ {
618
+ isDisabled: s,
619
+ isSaveDisabled: !i,
743
620
  label: n.details_goal_name,
744
- onChange: (a) => m(a.target.value),
745
- value: o
746
- })
747
- });
621
+ onCancel: a,
622
+ onSave: h,
623
+ primaryText: n.details_goal_name,
624
+ secondaryText: t.name,
625
+ children: /* @__PURE__ */ e(
626
+ Ke,
627
+ {
628
+ error: !i,
629
+ fullWidth: !0,
630
+ label: n.details_goal_name,
631
+ onChange: (o) => m(o.target.value),
632
+ value: i
633
+ }
634
+ )
635
+ }
636
+ );
748
637
  }), kt = ({ goal: t }) => {
749
- const { goals: n } = R(), { setAlert: u, setSelectedGoal: d, updateRetirementGoal: _ } = N(), [o, m] = T.useState(t.retirement_age || 65), p = !t.guid, s = async () => {
750
- if (!isNaN(o)) {
751
- const a = {
752
- ...t,
753
- retirement_age: o
754
- };
755
- t.retirement_age = o, p ? d(a) : (await _(a), u(n.alert_goal_updated_retirement_age));
638
+ const { goals: n } = x(), { setAlert: u, setSelectedGoal: d, updateRetirementGoal: _ } = N(), [i, m] = T.useState(t.retirement_age || 65), p = !t.guid, s = async () => {
639
+ if (!isNaN(i)) {
640
+ const o = { ...t, retirement_age: i };
641
+ t.retirement_age = i, p ? d(o) : (await _(o), u(n.alert_goal_updated_retirement_age));
756
642
  }
757
643
  }, h = () => {
758
644
  setTimeout(() => {
759
645
  m(t.retirement_age || 65);
760
646
  }, 250);
761
- }, i = !o || isNaN(o) || o < 20 || o >= 100;
762
- return /* @__PURE__ */ e(Z, {
763
- isDisabled: t.is_complete,
764
- isSaveDisabled: i,
765
- label: n.details_retirement_age,
766
- onCancel: h,
767
- onSave: s,
768
- primaryText: n.details_retirement_age,
769
- secondaryText: `${t.retirement_age}`,
770
- zeroStateText: p && !t.retirement_age ? n.add_age : void 0,
771
- children: /* @__PURE__ */ e(Me, {
772
- error: i,
773
- fullWidth: !0,
647
+ }, a = !i || isNaN(i) || i < 20 || i >= 100;
648
+ return /* @__PURE__ */ e(
649
+ Z,
650
+ {
651
+ isDisabled: t.is_complete,
652
+ isSaveDisabled: a,
774
653
  label: n.details_retirement_age,
775
- onChange: (a) => m(Number(a.target.value)),
776
- value: isNaN(o) ? "" : o
777
- })
778
- });
779
- }, wt = K(({ goal: t }) => {
780
- const { goals: n } = R(), { user: u, updateUser: d } = xe(), { setAlert: _ } = N(), [o, m] = T.useState(ee(u.birthday ?? 0)), [p, s] = T.useState(null), h = t.is_complete, i = async () => {
781
- o && At(o) && (await d({
782
- ...u,
783
- birthday: dt(o)
784
- }), _(n.alert_goal_updated_birthday));
654
+ onCancel: h,
655
+ onSave: s,
656
+ primaryText: n.details_retirement_age,
657
+ secondaryText: `${t.retirement_age}`,
658
+ zeroStateText: p && !t.retirement_age ? n.add_age : void 0,
659
+ children: /* @__PURE__ */ e(
660
+ Ke,
661
+ {
662
+ error: a,
663
+ fullWidth: !0,
664
+ label: n.details_retirement_age,
665
+ onChange: (o) => m(Number(o.target.value)),
666
+ value: isNaN(i) ? "" : i
667
+ }
668
+ )
669
+ }
670
+ );
671
+ }, wt = D(({ goal: t }) => {
672
+ const { goals: n } = x(), { user: u, updateUser: d } = Ge(), { setAlert: _ } = N(), [i, m] = T.useState(ee(u.birthday ?? 0)), [p, s] = T.useState(null), h = t.is_complete, a = async () => {
673
+ i && dt(i) && (await d({ ...u, birthday: lt(i) }), _(n.alert_goal_updated_birthday));
785
674
  };
786
- return /* @__PURE__ */ e(Z, {
787
- isDisabled: h,
788
- isSaveDisabled: !!p,
789
- label: n.details_birthday,
790
- onSave: i,
791
- primaryText: n.details_birthday,
792
- secondaryText: `${_e(ee(u.birthday ?? 0), ue.MONTH_DAY_YEAR)}`,
793
- zeroStateText: !t.guid && !u.birthday ? n.add_birthday : void 0,
794
- children: /* @__PURE__ */ e(ft, {
795
- dateAdapter: pt,
796
- children: /* @__PURE__ */ e(yt, {
797
- label: n.details_birthday,
798
- onChange: m,
799
- onError: (a) => s(a),
800
- sx: { width: "100%" },
801
- value: o
802
- })
803
- })
804
- });
805
- }), Kt = ({ goal: t }) => {
806
- const { goals: n } = R(), { visibleRetirementAccounts: u } = j(), { addRetirementGoalAccount: d, newRetirementGoalAccounts: _, retirementGoalAccounts: o, selectedGoal: m, setAlert: p, setNewRetirementGoalAccounts: s, setSelectedGoal: h } = N(), [i, a] = T.useState(!1), b = !t.guid, l = u.filter((y) => b ? _.find((A) => A.account_guid === y.guid) : o.find((A) => A.account_guid === y.guid)), f = u.filter((y) => !o.find((A) => A.account_guid === y.guid)), x = async (y) => {
807
- const A = y.map((v) => ({
808
- account_guid: v.guid,
675
+ return /* @__PURE__ */ e(
676
+ Z,
677
+ {
678
+ isDisabled: h,
679
+ isSaveDisabled: !!p,
680
+ label: n.details_birthday,
681
+ onSave: a,
682
+ primaryText: n.details_birthday,
683
+ secondaryText: `${be(ee(u.birthday ?? 0), fe.MONTH_DAY_YEAR)}`,
684
+ zeroStateText: !t.guid && !u.birthday ? n.add_birthday : void 0,
685
+ children: /* @__PURE__ */ e(_t, { dateAdapter: mt, children: /* @__PURE__ */ e(
686
+ ut,
687
+ {
688
+ label: n.details_birthday,
689
+ onChange: m,
690
+ onError: (o) => s(o),
691
+ sx: { width: "100%" },
692
+ value: i
693
+ }
694
+ ) })
695
+ }
696
+ );
697
+ }), Dt = ({ goal: t }) => {
698
+ const { goals: n } = x(), { visibleRetirementAccounts: u } = j(), {
699
+ addRetirementGoalAccount: d,
700
+ newRetirementGoalAccounts: _,
701
+ retirementGoalAccounts: i,
702
+ selectedGoal: m,
703
+ setAlert: p,
704
+ setNewRetirementGoalAccounts: s,
705
+ setSelectedGoal: h
706
+ } = N(), [a, o] = T.useState(!1), b = !t.guid, l = u.filter(
707
+ (g) => b ? _.find((A) => A.account_guid === g.guid) : i.find((A) => A.account_guid === g.guid)
708
+ ), y = u.filter(
709
+ (g) => !i.find((A) => A.account_guid === g.guid)
710
+ ), E = async (g) => {
711
+ const A = g.map((R) => ({
712
+ account_guid: R.guid,
809
713
  retirement_goal_guid: t.guid
810
714
  }));
811
- if (b) s(A);
812
- else for (const v of A)
813
- await d(v), p(n.alert_account_added);
715
+ if (b)
716
+ s(A);
717
+ else
718
+ for (const R of A)
719
+ await d(R), p(n.alert_account_added);
814
720
  h({
815
721
  ...m,
816
- current_amount: y.reduce((v, G) => v + (G.balance || 0), 0)
817
- }), a(!1);
722
+ current_amount: g.reduce((R, G) => R + (G.balance || 0), 0)
723
+ }), o(!1);
818
724
  };
819
- return /* @__PURE__ */ c(g, { children: [
820
- l.map((y) => /* @__PURE__ */ c(g, { children: [/* @__PURE__ */ e(We, { account: y }), /* @__PURE__ */ e(E, {})] }, y.guid)),
821
- /* @__PURE__ */ e(k, {
822
- disableGutters: !0,
823
- disablePadding: !0,
824
- sx: { bgcolor: "background.paper" },
825
- children: /* @__PURE__ */ c(L, {
826
- onClick: () => a(!0),
827
- children: [/* @__PURE__ */ e(w, { children: /* @__PURE__ */ c(g, {
828
- alignItems: "center",
829
- color: "primary.main",
830
- direction: "row",
831
- gap: 8,
832
- children: [/* @__PURE__ */ e(Ge, { filled: !0 }), n.details_add_account]
833
- }) }), /* @__PURE__ */ e(z, { color: "primary" })]
834
- })
835
- }),
836
- /* @__PURE__ */ e(Be, {
837
- accounts: f,
838
- isOpen: i,
839
- onClose: () => a(!1),
840
- onSave: x,
841
- title: n.add_select_accounts
842
- })
725
+ return /* @__PURE__ */ c(f, { children: [
726
+ l.map((g) => /* @__PURE__ */ c(f, { children: [
727
+ /* @__PURE__ */ e(We, { account: g }),
728
+ /* @__PURE__ */ e(v, {})
729
+ ] }, g.guid)),
730
+ /* @__PURE__ */ e(k, { disableGutters: !0, disablePadding: !0, sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ c(L, { onClick: () => o(!0), children: [
731
+ /* @__PURE__ */ e(w, { children: /* @__PURE__ */ c(f, { alignItems: "center", color: "primary.main", direction: "row", gap: 8, children: [
732
+ /* @__PURE__ */ e(Ie, { filled: !0 }),
733
+ n.details_add_account
734
+ ] }) }),
735
+ /* @__PURE__ */ e(z, { color: "primary" })
736
+ ] }) }),
737
+ /* @__PURE__ */ e(
738
+ Be,
739
+ {
740
+ accounts: y,
741
+ isOpen: a,
742
+ onClose: () => o(!1),
743
+ onSave: E,
744
+ title: n.add_select_accounts
745
+ }
746
+ )
843
747
  ] });
844
- }, Dt = K(({ goal: t }) => {
845
- const { goals: n } = R(), { visibleAccounts: u } = j(), d = T.useMemo(() => u.find((m) => m.guid === t.account_guid), [u, t]), _ = t.track_type;
846
- let o = n.details_save_title;
847
- return t.track_type === r.DEBT_TRACK ? o = n.details_debt_title : t.track_type === r.RETIREMENT_TRACK && (o = n.details_retirement_title), /* @__PURE__ */ c(g, { children: [
848
- /* @__PURE__ */ c(g, {
849
- mx: 24,
850
- children: [
851
- /* @__PURE__ */ e(C, {
852
- color: "text.secondary",
853
- sx: {
854
- mb: 4,
855
- mt: 24
856
- },
857
- variant: "caption",
858
- children: o
859
- }),
860
- /* @__PURE__ */ e(Oe, {
861
- goal: t,
862
- isInDrawer: !0
863
- }),
864
- /* @__PURE__ */ e(C, {
865
- color: "text.secondary",
866
- sx: {
867
- mb: 4,
868
- mt: 24
869
- },
870
- variant: "caption",
871
- children: n.details_title
872
- })
873
- ]
874
- }),
875
- /* @__PURE__ */ c(O, {
876
- sx: { bgcolor: "background.paper" },
877
- children: [
878
- _ !== r.RETIREMENT_TRACK ? /* @__PURE__ */ e(Nt, { goal: t }) : /* @__PURE__ */ e(k, {
879
- sx: { px: 24 },
880
- children: /* @__PURE__ */ e(w, {
881
- primary: /* @__PURE__ */ c(g, {
882
- alignItems: "center",
883
- direction: "row",
884
- justifyContent: "space-between",
885
- children: [/* @__PURE__ */ e(C, {
886
- variant: "body1",
887
- children: n.details_goal_name
888
- }), /* @__PURE__ */ e(C, {
889
- bold: !0,
890
- color: "text.primary",
891
- sx: { mr: 4 },
892
- variant: "body1",
893
- children: n.retirement
894
- })]
895
- }),
896
- slotProps: { primary: { variant: "body1" } }
897
- })
898
- }),
899
- /* @__PURE__ */ e(E, { sx: { ml: 24 } }),
900
- (_ === r.SAVINGS_TRACK || _ === r.RETIREMENT_TRACK) && /* @__PURE__ */ c(F, { children: [/* @__PURE__ */ e(It, { goal: t }), /* @__PURE__ */ e(E, { sx: { ml: _ === r.RETIREMENT_TRACK ? 24 : 0 } })] }),
901
- t.track_type === r.DEBT_TRACK && /* @__PURE__ */ c(F, { children: [
902
- /* @__PURE__ */ e(Je, { goal: t }),
903
- /* @__PURE__ */ e(E, { sx: { ml: 24 } }),
904
- /* @__PURE__ */ e(Xe, { goal: t }),
905
- /* @__PURE__ */ e(E, { sx: { ml: 24 } }),
906
- /* @__PURE__ */ e(Qe, { goal: t }),
907
- /* @__PURE__ */ e(E, { variant: "fullWidth" })
908
- ] }),
909
- t.track_type === r.RETIREMENT_TRACK && /* @__PURE__ */ c(F, { children: [
910
- /* @__PURE__ */ e(kt, { goal: t }),
911
- /* @__PURE__ */ e(E, { sx: { ml: 24 } }),
912
- /* @__PURE__ */ e(wt, { goal: t }),
913
- /* @__PURE__ */ e(E, { variant: "fullWidth" })
914
- ] })
915
- ]
916
- }),
917
- /* @__PURE__ */ e(C, {
918
- color: "text.secondary",
919
- sx: {
920
- mb: 4,
921
- ml: 24,
922
- mt: 12
923
- },
924
- variant: "caption",
925
- children: t.track_type === r.RETIREMENT_TRACK ? n.details_accounts : n.details_account
926
- }),
927
- t.track_type !== r.RETIREMENT_TRACK && d && /* @__PURE__ */ c(F, { children: [/* @__PURE__ */ e(We, { account: d }), /* @__PURE__ */ e(E, {})] }),
928
- t.track_type === r.RETIREMENT_TRACK && /* @__PURE__ */ c(F, { children: [/* @__PURE__ */ e(Kt, { goal: t }), /* @__PURE__ */ e(E, {})] }),
748
+ }, Kt = D(({ goal: t }) => {
749
+ const { goals: n } = x(), { visibleAccounts: u } = j(), d = T.useMemo(
750
+ () => u.find((m) => m.guid === t.account_guid),
751
+ [u, t]
752
+ ), _ = t.track_type;
753
+ let i = n.details_save_title;
754
+ return t.track_type === r.DEBT_TRACK ? i = n.details_debt_title : t.track_type === r.RETIREMENT_TRACK && (i = n.details_retirement_title), /* @__PURE__ */ c(f, { children: [
755
+ /* @__PURE__ */ c(f, { mx: 24, children: [
756
+ /* @__PURE__ */ e(C, { color: "text.secondary", sx: { mb: 4, mt: 24 }, variant: "caption", children: i }),
757
+ /* @__PURE__ */ e(Oe, { goal: t, isInDrawer: !0 }),
758
+ /* @__PURE__ */ e(C, { color: "text.secondary", sx: { mb: 4, mt: 24 }, variant: "caption", children: n.details_title })
759
+ ] }),
760
+ /* @__PURE__ */ c(O, { sx: { bgcolor: "background.paper" }, children: [
761
+ _ !== r.RETIREMENT_TRACK ? /* @__PURE__ */ e(Nt, { goal: t }) : /* @__PURE__ */ e(k, { sx: { px: 24 }, children: /* @__PURE__ */ e(
762
+ w,
763
+ {
764
+ primary: /* @__PURE__ */ c(f, { alignItems: "center", direction: "row", justifyContent: "space-between", children: [
765
+ /* @__PURE__ */ e(C, { variant: "body1", children: n.details_goal_name }),
766
+ /* @__PURE__ */ e(C, { bold: !0, color: "text.primary", sx: { mr: 4 }, variant: "body1", children: n.retirement })
767
+ ] }),
768
+ slotProps: { primary: { variant: "body1" } }
769
+ }
770
+ ) }),
771
+ /* @__PURE__ */ e(v, { sx: { ml: 24 } }),
772
+ (_ === r.SAVINGS_TRACK || _ === r.RETIREMENT_TRACK) && /* @__PURE__ */ c(F, { children: [
773
+ /* @__PURE__ */ e(It, { goal: t }),
774
+ /* @__PURE__ */ e(v, { sx: { ml: _ === r.RETIREMENT_TRACK ? 24 : 0 } })
775
+ ] }),
776
+ t.track_type === r.DEBT_TRACK && /* @__PURE__ */ c(F, { children: [
777
+ /* @__PURE__ */ e(rt, { goal: t }),
778
+ /* @__PURE__ */ e(v, { sx: { ml: 24 } }),
779
+ /* @__PURE__ */ e(st, { goal: t }),
780
+ /* @__PURE__ */ e(v, { sx: { ml: 24 } }),
781
+ /* @__PURE__ */ e(ct, { goal: t }),
782
+ /* @__PURE__ */ e(v, { variant: "fullWidth" })
783
+ ] }),
784
+ t.track_type === r.RETIREMENT_TRACK && /* @__PURE__ */ c(F, { children: [
785
+ /* @__PURE__ */ e(kt, { goal: t }),
786
+ /* @__PURE__ */ e(v, { sx: { ml: 24 } }),
787
+ /* @__PURE__ */ e(wt, { goal: t }),
788
+ /* @__PURE__ */ e(v, { variant: "fullWidth" })
789
+ ] })
790
+ ] }),
791
+ /* @__PURE__ */ e(C, { color: "text.secondary", sx: { mb: 4, ml: 24, mt: 12 }, variant: "caption", children: t.track_type === r.RETIREMENT_TRACK ? n.details_accounts : n.details_account }),
792
+ t.track_type !== r.RETIREMENT_TRACK && d && /* @__PURE__ */ c(F, { children: [
793
+ /* @__PURE__ */ e(We, { account: d }),
794
+ /* @__PURE__ */ e(v, {})
795
+ ] }),
796
+ t.track_type === r.RETIREMENT_TRACK && /* @__PURE__ */ c(F, { children: [
797
+ /* @__PURE__ */ e(Dt, { goal: t }),
798
+ /* @__PURE__ */ e(v, {})
799
+ ] }),
929
800
  t.track_type === r.SAVINGS_TRACK && !t.is_complete && /* @__PURE__ */ e(Gt, { goal: t })
930
801
  ] });
931
- }), Mt = K(({ onClose: t }) => {
932
- const { visibleRetirementAccounts: n } = j(), { goals: u, common: d } = R(), { addGoal: _, addRetirementGoal: o, deleteGoal: m, deleteRetirementGoal: p, newRetirementGoalAccounts: s, retirementGoalAccounts: h, selectedGoal: i, setAlert: a, setSelectedGoal: b, updateGoal: l } = N(), { user: f } = xe(), [x, y] = T.useState(!1), A = !i?.guid, v = i?.track_type === r.SAVINGS_TRACK && i.is_complete && !i.has_been_spent, G = T.useMemo(() => {
933
- const I = A ? s : h;
934
- return n.filter((V) => I.some((M) => M.account_guid === V.guid));
935
- }, [
936
- A,
937
- n,
938
- s,
939
- h
940
- ]), D = T.useMemo(() => {
941
- if (!i) return !1;
942
- if (!A && !v) return !0;
943
- const { account_guid: I, track_type: V, name: M, amount: J, retirement_age: oe } = i;
944
- return V === r.SAVINGS_TRACK ? I ? !!M && !!J : !1 : V === r.RETIREMENT_TRACK ? G.length ? !!M && !!J && !!oe && !!f.birthday : !1 : !0;
945
- }, [
946
- i,
947
- G,
948
- f.birthday
949
- ]);
950
- let W = d.delete_button, H = () => y(!0);
951
- A ? (H = () => ne(), W = d.save_button) : v && (H = () => ie(), W = u.mark_as_complete_button);
802
+ }), Mt = D(({ onClose: t }) => {
803
+ const { visibleRetirementAccounts: n } = j(), { goals: u, common: d } = x(), {
804
+ addGoal: _,
805
+ addRetirementGoal: i,
806
+ deleteGoal: m,
807
+ deleteRetirementGoal: p,
808
+ newRetirementGoalAccounts: s,
809
+ retirementGoalAccounts: h,
810
+ selectedGoal: a,
811
+ setAlert: o,
812
+ setSelectedGoal: b,
813
+ updateGoal: l
814
+ } = N(), { user: y } = Ge(), [E, g] = T.useState(!1), A = !a?.guid, R = a?.track_type === r.SAVINGS_TRACK && a.is_complete && !a.has_been_spent, G = T.useMemo(() => {
815
+ const S = A ? s : h;
816
+ return n.filter((V) => S.some((M) => M.account_guid === V.guid));
817
+ }, [A, n, s, h]), K = T.useMemo(() => {
818
+ if (!a) return !1;
819
+ if (!A && !R) return !0;
820
+ const { account_guid: S, track_type: V, name: M, amount: J, retirement_age: ie } = a;
821
+ return V === r.SAVINGS_TRACK ? S ? !!M && !!J : !1 : V === r.RETIREMENT_TRACK ? G.length ? !!M && !!J && !!ie && !!y.birthday : !1 : !0;
822
+ }, [a, G, y.birthday]);
823
+ let W = d.delete_button, H = () => g(!0);
824
+ A ? (H = () => ne(), W = d.save_button) : R && (H = () => ae(), W = u.mark_as_complete_button);
952
825
  const ne = async () => {
953
- if (i) {
954
- const I = i.track_type;
955
- I !== r.RETIREMENT_TRACK ? await _(i) : I === r.RETIREMENT_TRACK && await o({
956
- ...i,
957
- target_amount: i.amount
958
- }), a(u.alert_goal_added), b(void 0), I && t?.(I);
826
+ if (a) {
827
+ const S = a.track_type;
828
+ S !== r.RETIREMENT_TRACK ? await _(a) : S === r.RETIREMENT_TRACK && await i({ ...a, target_amount: a.amount }), o(u.alert_goal_added), b(void 0), S && t?.(S);
959
829
  }
830
+ }, oe = async () => {
831
+ a && (a.track_type !== r.RETIREMENT_TRACK ? await m(a.guid) : a.track_type === r.RETIREMENT_TRACK && await p(a), o(u.alert_goal_deleted), b(void 0));
960
832
  }, ae = async () => {
961
- i && (i.track_type !== r.RETIREMENT_TRACK ? await m(i.guid) : i.track_type === r.RETIREMENT_TRACK && await p(i), a(u.alert_goal_deleted), b(void 0));
962
- }, ie = async () => {
963
- await l({
964
- ...i,
833
+ const S = {
834
+ ...a,
965
835
  has_been_spent: !0
966
- }), a(u.alert_goal_completed), b(void 0);
836
+ };
837
+ await l(S), o(u.alert_goal_completed), b(void 0);
967
838
  };
968
- return /* @__PURE__ */ c(g, { children: [/* @__PURE__ */ e(q, {
969
- ariaLabelClose: d.close_aria,
970
- hasSecondaryAction: A,
971
- isOpen: !!i,
972
- isPrimaryDisabled: !D,
973
- onClose: () => b(void 0),
974
- onPrimaryAction: H,
975
- primaryColor: A || v ? "primary" : "error",
976
- primaryText: W,
977
- secondaryColor: "primary",
978
- title: u.goal_details,
979
- children: i && /* @__PURE__ */ e(Dt, { goal: i })
980
- }), /* @__PURE__ */ e(Ze, {
981
- copy: {
982
- close_aria: d.close_aria,
983
- title: u.delete_goal
984
- },
985
- isOpen: x,
986
- maxWidth: "xs",
987
- onClose: () => y(!1),
988
- onPrimaryAction: ae,
989
- primaryColor: "error",
990
- primaryText: d.delete_button,
991
- children: /* @__PURE__ */ e(C, {
992
- variant: "subtitle1",
993
- children: B(u.delete_description, i?.name || "")
994
- })
995
- })] });
996
- }), Sn = K(({ onBackClick: t, onMenuClick: n, sx: u }) => {
997
- const { onEvent: d } = Ee(), { isMobile: _ } = pe(), { isAccountDataLoaded: o, loadAccountData: m } = j(), { isInitialized: p } = he(), { goals: s, common: h } = R(), { alert: i, allGoals: a, goals: b, isAllGoalDataLoaded: l, loadGoalData: f, monthlyCashFlowProfile: x, setAlert: y, retirmentGoals: A } = N(), [v, G] = T.useState(0), [D, W] = T.useState(!1), H = x?.amount_allocated_for_savings_goals || 0, ne = x?.amount_allocated_for_debt_goals || 0, ae = x?.amount_allocated_for_retirement_goals || 0;
998
- Re({
839
+ return /* @__PURE__ */ c(f, { children: [
840
+ /* @__PURE__ */ e(
841
+ q,
842
+ {
843
+ ariaLabelClose: d.close_aria,
844
+ hasSecondaryAction: A,
845
+ isOpen: !!a,
846
+ isPrimaryDisabled: !K,
847
+ onClose: () => b(void 0),
848
+ onPrimaryAction: H,
849
+ primaryColor: A || R ? "primary" : "error",
850
+ primaryText: W,
851
+ secondaryColor: "primary",
852
+ title: u.goal_details,
853
+ children: a && /* @__PURE__ */ e(Kt, { goal: a })
854
+ }
855
+ ),
856
+ /* @__PURE__ */ e(
857
+ pt,
858
+ {
859
+ copy: { close_aria: d.close_aria, title: u.delete_goal },
860
+ isOpen: E,
861
+ maxWidth: "xs",
862
+ onClose: () => g(!1),
863
+ onPrimaryAction: oe,
864
+ primaryColor: "error",
865
+ primaryText: d.delete_button,
866
+ children: /* @__PURE__ */ e(C, { variant: "subtitle1", children: B(u.delete_description, a?.name || "") })
867
+ }
868
+ )
869
+ ] });
870
+ }), jn = D(({ onBackClick: t, onMenuClick: n, sx: u }) => {
871
+ const { onEvent: d } = Ne(), { isMobile: _ } = he(), { isAccountDataLoaded: i, loadAccountData: m } = j(), { isInitialized: p } = _e(), { goals: s, common: h } = x(), {
872
+ alert: a,
873
+ allGoals: o,
874
+ goals: b,
875
+ isAllGoalDataLoaded: l,
876
+ loadGoalData: y,
877
+ monthlyCashFlowProfile: E,
878
+ setAlert: g,
879
+ retirmentGoals: A
880
+ } = N(), [R, G] = T.useState(0), [K, W] = T.useState(!1), H = E?.amount_allocated_for_savings_goals || 0, ne = E?.amount_allocated_for_debt_goals || 0, oe = E?.amount_allocated_for_retirement_goals || 0;
881
+ Me({
999
882
  widgetName: "GoalsWidget",
1000
883
  isLoaded: l
1001
884
  }), T.useEffect(() => {
1002
- o || m().finally(), d($.GOALS_VIEW);
885
+ i || m().finally(), d($.GOALS_VIEW);
1003
886
  }, []), T.useEffect(() => {
1004
- p && f().finally();
887
+ p && y().finally();
1005
888
  }, [p]);
1006
- const ie = () => {
889
+ const ae = () => {
1007
890
  d($.GOALS_CLICK_FILTER);
1008
- }, I = () => {
891
+ }, S = () => {
1009
892
  W(!0), d($.GOALS_CLICK_ADD);
1010
- }, V = (X) => {
1011
- W(!1), X === r.SAVINGS_TRACK ? G(0) : X === r.DEBT_TRACK ? G(1) : X === r.RETIREMENT_TRACK && G(2);
1012
- }, M = T.useMemo(() => l && a.length === 0, [
1013
- b,
1014
- l,
1015
- A
1016
- ]);
1017
- if (!p || !l) return /* @__PURE__ */ e(Se, {});
1018
- const J = B(_ ? s.tab_subtitle_mobile : s.tab_subtitle, S(H, "0,0")), oe = B(_ ? s.tab_subtitle_mobile : s.tab_subtitle, S(ne, "0,0")), Ve = B(_ ? s.tab_subtitle_mobile : s.tab_subtitle, S(ae, "0,0"));
1019
- return /* @__PURE__ */ c($e, {
1020
- actions: [{
1021
- iconName: "add",
1022
- label: s.add_title,
1023
- onClick: I
1024
- }],
1025
- onAccountsFilterClick: ie,
1026
- onBackClick: t,
1027
- onMenuClick: n,
1028
- sx: u,
1029
- title: s.title,
1030
- children: [
1031
- /* @__PURE__ */ c(g, {
1032
- mx: _ ? 0 : 48,
1033
- my: 24,
1034
- children: [/* @__PURE__ */ c(ct, {
1035
- onChange: (X, ze) => G(ze),
1036
- sx: { bgcolor: "background.paper" },
1037
- textColor: "primary",
1038
- value: M ? !1 : v,
1039
- variant: "fullWidth",
1040
- children: [
1041
- /* @__PURE__ */ e(re, {
1042
- disabled: M,
1043
- label: /* @__PURE__ */ e(se, {
1044
- subtitle: J,
1045
- title: s.tab_saving_title
1046
- })
1047
- }),
1048
- /* @__PURE__ */ e(re, {
1049
- disabled: M,
1050
- label: /* @__PURE__ */ e(se, {
1051
- subtitle: oe,
1052
- title: s.tab_debt_title
1053
- })
1054
- }),
1055
- /* @__PURE__ */ e(re, {
1056
- disabled: M,
1057
- label: /* @__PURE__ */ e(se, {
1058
- subtitle: Ve,
1059
- title: s.tab_retirement_title
1060
- })
1061
- })
1062
- ]
1063
- }), M ? /* @__PURE__ */ e(Fe, {
1064
- header: s.create_goals_header,
1065
- icon: "trophy",
1066
- onClick: I,
1067
- primaryButton: s.add_goals_button,
1068
- subText: s.empty_state_subheader,
1069
- sx: {
1070
- width: { sm: 432 },
1071
- ".buttons-footer": { width: 139 }
893
+ }, V = (Q) => {
894
+ W(!1), Q === r.SAVINGS_TRACK ? G(0) : Q === r.DEBT_TRACK ? G(1) : Q === r.RETIREMENT_TRACK && G(2);
895
+ }, M = T.useMemo(
896
+ () => l && o.length === 0,
897
+ [b, l, A]
898
+ );
899
+ if (!p || !l)
900
+ return /* @__PURE__ */ e(Le, {});
901
+ const J = B(
902
+ _ ? s.tab_subtitle_mobile : s.tab_subtitle,
903
+ I(H, "0,0")
904
+ ), ie = B(
905
+ _ ? s.tab_subtitle_mobile : s.tab_subtitle,
906
+ I(ne, "0,0")
907
+ ), Ve = B(
908
+ _ ? s.tab_subtitle_mobile : s.tab_subtitle,
909
+ I(oe, "0,0")
910
+ );
911
+ return /* @__PURE__ */ c(
912
+ ht,
913
+ {
914
+ actions: [
915
+ {
916
+ iconName: "add",
917
+ label: s.add_title,
918
+ onClick: S
919
+ }
920
+ ],
921
+ onAccountsFilterClick: ae,
922
+ onBackClick: t,
923
+ onMenuClick: n,
924
+ sx: u,
925
+ title: s.title,
926
+ children: [
927
+ /* @__PURE__ */ c(f, { mx: _ ? 0 : 48, my: 24, children: [
928
+ /* @__PURE__ */ c(
929
+ Fe,
930
+ {
931
+ onChange: (Q, ze) => G(ze),
932
+ sx: { bgcolor: "background.paper" },
933
+ textColor: "primary",
934
+ value: M ? !1 : R,
935
+ variant: "fullWidth",
936
+ children: [
937
+ /* @__PURE__ */ e(
938
+ re,
939
+ {
940
+ disabled: M,
941
+ label: /* @__PURE__ */ e(se, { subtitle: J, title: s.tab_saving_title })
942
+ }
943
+ ),
944
+ /* @__PURE__ */ e(
945
+ re,
946
+ {
947
+ disabled: M,
948
+ label: /* @__PURE__ */ e(se, { subtitle: ie, title: s.tab_debt_title })
949
+ }
950
+ ),
951
+ /* @__PURE__ */ e(
952
+ re,
953
+ {
954
+ disabled: M,
955
+ label: /* @__PURE__ */ e(se, { subtitle: Ve, title: s.tab_retirement_title })
956
+ }
957
+ )
958
+ ]
959
+ }
960
+ ),
961
+ M ? /* @__PURE__ */ e(
962
+ bt,
963
+ {
964
+ header: s.create_goals_header,
965
+ icon: "trophy",
966
+ onClick: S,
967
+ primaryButton: s.add_goals_button,
968
+ subText: s.empty_state_subheader,
969
+ sx: {
970
+ width: { sm: 432 },
971
+ ".buttons-footer": {
972
+ width: 139
973
+ }
974
+ }
975
+ }
976
+ ) : /* @__PURE__ */ c(F, { children: [
977
+ R === 0 && /* @__PURE__ */ e(ce, { onAddGoals: S, trackType: r.SAVINGS_TRACK }),
978
+ R === 1 && /* @__PURE__ */ e(ce, { onAddGoals: S, trackType: r.DEBT_TRACK }),
979
+ R === 2 && /* @__PURE__ */ e(ce, { onAddGoals: S, trackType: r.RETIREMENT_TRACK })
980
+ ] })
981
+ ] }),
982
+ /* @__PURE__ */ e(Mt, { onClose: V }),
983
+ /* @__PURE__ */ e(
984
+ q,
985
+ {
986
+ ariaLabelClose: h.close_aria,
987
+ isOpen: K,
988
+ onClose: () => W(!1),
989
+ title: s.add_goal_title,
990
+ children: /* @__PURE__ */ e(vt, { onClose: V })
1072
991
  }
1073
- }) : /* @__PURE__ */ c(F, { children: [
1074
- v === 0 && /* @__PURE__ */ e(ce, {
1075
- onAddGoals: I,
1076
- trackType: r.SAVINGS_TRACK
1077
- }),
1078
- v === 1 && /* @__PURE__ */ e(ce, {
1079
- onAddGoals: I,
1080
- trackType: r.DEBT_TRACK
1081
- }),
1082
- v === 2 && /* @__PURE__ */ e(ce, {
1083
- onAddGoals: I,
1084
- trackType: r.RETIREMENT_TRACK
1085
- })
1086
- ] })]
1087
- }),
1088
- /* @__PURE__ */ e(Mt, { onClose: V }),
1089
- /* @__PURE__ */ e(q, {
1090
- ariaLabelClose: h.close_aria,
1091
- isOpen: D,
1092
- onClose: () => W(!1),
1093
- title: s.add_goal_title,
1094
- children: /* @__PURE__ */ e(St, { onClose: V })
1095
- }),
1096
- /* @__PURE__ */ e(bt, {
1097
- onClose: () => y(""),
1098
- open: !!i,
1099
- children: /* @__PURE__ */ e(ht, {
1100
- onClose: () => y(""),
1101
- severity: "success",
1102
- variant: "filled",
1103
- children: i
1104
- })
1105
- })
1106
- ]
1107
- });
1108
- }), Lt = K(({ goal: t }) => {
1109
- const { goals: n } = R(), u = rt(), { backgroundColor: d, color: _, percentage: o, projectedText: m } = me(n, t), p = Math.round(o * 100);
1110
- let s = /* @__PURE__ */ e(ke, {});
1111
- return t.track_type === r.DEBT_TRACK ? s = /* @__PURE__ */ e(Ne, {}) : t.track_type === r.RETIREMENT_TRACK && (s = /* @__PURE__ */ e(we, {})), /* @__PURE__ */ c(g, {
1112
- alignItems: "center",
1113
- direction: "row",
1114
- spacing: 12,
1115
- sx: { py: 12 },
1116
- children: [
1117
- /* @__PURE__ */ e(te, {
1118
- sx: {
1119
- bgcolor: d,
1120
- color: _,
1121
- height: 32,
1122
- width: 32
1123
- },
1124
- variant: "rounded",
1125
- children: s
1126
- }),
1127
- /* @__PURE__ */ c(st, {
1128
- sx: { width: "100%" },
1129
- children: [/* @__PURE__ */ e(Ie, {
1130
- fontSize: 15,
1131
- fontWeight: 600,
1132
- variant: "body1",
1133
- children: t.name
1134
- }), t.projected_to_complete_at && /* @__PURE__ */ e(C, {
1135
- color: "text.secondary",
1136
- variant: "caption",
1137
- children: m
1138
- })]
1139
- }),
1140
- /* @__PURE__ */ e(He, {
992
+ ),
993
+ /* @__PURE__ */ e(je, { onClose: () => g(""), open: !!a, children: /* @__PURE__ */ e(Pe, { onClose: () => g(""), severity: "success", variant: "filled", children: a }) })
994
+ ]
995
+ }
996
+ );
997
+ }), Lt = D(({ goal: t }) => {
998
+ const { goals: n } = x(), u = gt(), {
999
+ backgroundColor: d,
1000
+ color: _,
1001
+ percentage: i,
1002
+ projectedText: m
1003
+ } = ue(n, t), p = Math.round(i * 100);
1004
+ let s = /* @__PURE__ */ e(Ee, {});
1005
+ return t.track_type === r.DEBT_TRACK ? s = /* @__PURE__ */ e(Se, {}) : t.track_type === r.RETIREMENT_TRACK && (s = /* @__PURE__ */ e(ve, {})), /* @__PURE__ */ c(f, { alignItems: "center", direction: "row", spacing: 12, sx: { py: 12 }, children: [
1006
+ /* @__PURE__ */ e(te, { sx: { bgcolor: d, color: _, height: 32, width: 32 }, variant: "rounded", children: s }),
1007
+ /* @__PURE__ */ c(ft, { sx: { width: "100%" }, children: [
1008
+ /* @__PURE__ */ e(Te, { fontSize: 15, fontWeight: 600, variant: "body1", children: t.name }),
1009
+ t.projected_to_complete_at && /* @__PURE__ */ e(C, { color: "text.secondary", variant: "caption", children: m })
1010
+ ] }),
1011
+ /* @__PURE__ */ e(
1012
+ yt,
1013
+ {
1141
1014
  backgroundStrokeColor: u.palette.neutral.light,
1142
1015
  color: u.palette.primary.main,
1143
1016
  percent: p,
1144
1017
  size: 40,
1145
1018
  strokeWidth: 3,
1146
- children: /* @__PURE__ */ e(Y, {
1147
- fontWeight: 700,
1148
- variant: "caption",
1149
- children: `${p}%`
1150
- })
1151
- })
1019
+ children: /* @__PURE__ */ e(Y, { fontWeight: 700, variant: "caption", children: `${p}%` })
1020
+ }
1021
+ )
1022
+ ] });
1023
+ }), Ot = ({ header: t, subText: n, sx: u }) => /* @__PURE__ */ c(
1024
+ f,
1025
+ {
1026
+ sx: {
1027
+ alignItems: "center",
1028
+ alignSelf: "center",
1029
+ px: 24,
1030
+ ...u
1031
+ },
1032
+ children: [
1033
+ /* @__PURE__ */ e(Je, { size: 32 }),
1034
+ /* @__PURE__ */ e(Te, { fontSize: 15, fontWeight: 600, children: t }),
1035
+ /* @__PURE__ */ e(
1036
+ Y,
1037
+ {
1038
+ color: "text.secondary",
1039
+ sx: { fontWeight: 400, maxWidth: { sm: 424 }, textAlign: "center" },
1040
+ variant: "subtitle2",
1041
+ children: n
1042
+ }
1043
+ )
1152
1044
  ]
1153
- });
1154
- }), Ot = ({ header: t, subText: n, sx: u }) => /* @__PURE__ */ c(g, {
1155
- sx: {
1156
- alignItems: "center",
1157
- alignSelf: "center",
1158
- px: 24,
1159
- ...u
1160
- },
1161
- children: [
1162
- /* @__PURE__ */ e(ot, { size: 32 }),
1163
- /* @__PURE__ */ e(Ie, {
1164
- fontSize: 15,
1165
- fontWeight: 600,
1166
- children: t
1167
- }),
1168
- /* @__PURE__ */ e(Y, {
1169
- color: "text.secondary",
1170
- sx: {
1171
- fontWeight: 400,
1172
- maxWidth: { sm: 424 },
1173
- textAlign: "center"
1174
- },
1175
- variant: "subtitle2",
1176
- children: n
1177
- })
1178
- ]
1179
- }), In = K(({ onCTAClick: t }) => {
1180
- const { isAccountDataLoaded: n, loadAccountData: u, visibleAccounts: d } = j(), { onEvent: _ } = Ee(), { goals: o } = R(), { isInitialized: m } = he(), { ongoingGoalsForMicroWidget: p, isAllGoalDataLoaded: s, loadGoalData: h } = N();
1181
- Re({
1045
+ }
1046
+ ), Fn = D(({ onCTAClick: t }) => {
1047
+ const { isAccountDataLoaded: n, loadAccountData: u, visibleAccounts: d } = j(), { onEvent: _ } = Ne(), { goals: i } = x(), { isInitialized: m } = _e(), { ongoingGoalsForMicroWidget: p, isAllGoalDataLoaded: s, loadGoalData: h } = N();
1048
+ Me({
1182
1049
  widgetName: "GoalsMicroWidget",
1183
1050
  isLoaded: s
1184
1051
  }), T.useEffect(() => {
1185
1052
  n || u().finally();
1186
1053
  }, []), T.useEffect(() => {
1187
- m && (h().finally(), _($.GOALS_LOAD_WIDGET, { state: d?.length ? "default" : "zeroState" }));
1054
+ m && (h().finally(), _($.GOALS_LOAD_WIDGET, {
1055
+ state: d?.length ? "default" : "zeroState"
1056
+ }));
1188
1057
  }, [m]);
1189
- const i = T.useMemo(() => s && p.length === 0, [p, s]), a = () => {
1190
- _(i ? $.GOALS_CLICK_GET_STARTED : $.GOALS_CLICK_VIEW_DETAILS), t();
1058
+ const a = T.useMemo(
1059
+ () => s && p.length === 0,
1060
+ [p, s]
1061
+ ), o = () => {
1062
+ _(
1063
+ a ? $.GOALS_CLICK_GET_STARTED : $.GOALS_CLICK_VIEW_DETAILS
1064
+ ), t();
1191
1065
  };
1192
- return !m || !s ? /* @__PURE__ */ e(Se, {}) : /* @__PURE__ */ e(Ye, {
1193
- className: "mx-goals-microwidget",
1194
- ctaLabel: i ? o.get_started : o.view_details,
1195
- onCTAClick: a,
1196
- title: o.title,
1197
- children: i ? /* @__PURE__ */ e(Ot, {
1198
- header: o.create_goals_header,
1199
- subText: o.micro_zero_state_description
1200
- }) : /* @__PURE__ */ e(g, {
1201
- sx: { justifyContent: "space-between" },
1202
- children: p.map((b, l) => /* @__PURE__ */ c(T.Fragment, { children: [/* @__PURE__ */ e(Lt, { goal: b }), l !== p.length - 1 && /* @__PURE__ */ e(E, {})] }, b.guid))
1203
- })
1204
- });
1066
+ return !m || !s ? /* @__PURE__ */ e(Le, {}) : /* @__PURE__ */ e(
1067
+ At,
1068
+ {
1069
+ className: "mx-goals-microwidget",
1070
+ ctaLabel: a ? i.get_started : i.view_details,
1071
+ onCTAClick: o,
1072
+ title: i.title,
1073
+ children: a ? /* @__PURE__ */ e(
1074
+ Ot,
1075
+ {
1076
+ header: i.create_goals_header,
1077
+ subText: i.micro_zero_state_description
1078
+ }
1079
+ ) : /* @__PURE__ */ e(f, { sx: { justifyContent: "space-between" }, children: p.map((b, l) => /* @__PURE__ */ c(T.Fragment, { children: [
1080
+ /* @__PURE__ */ e(Lt, { goal: b }),
1081
+ l !== p.length - 1 && /* @__PURE__ */ e(v, {})
1082
+ ] }, b.guid)) })
1083
+ }
1084
+ );
1205
1085
  });
1206
1086
  export {
1207
- In as GoalsMicroWidget,
1208
- Sn as GoalsWidget
1087
+ Fn as GoalsMicroWidget,
1088
+ jn as GoalsWidget
1209
1089
  };
1090
+ //# sourceMappingURL=index.es.js.map