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

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 (222) hide show
  1. package/CHANGELOG.md +128 -1
  2. package/dist/{Account-Bxw0_4FU.mjs → Account-B4CDD-zq.mjs} +1 -1
  3. package/dist/AccountDetailsContent-adZTkM52.mjs +683 -0
  4. package/dist/AccountDetailsHeader-DRjFuyJT.mjs +87 -0
  5. package/dist/{AccountFields-C9FlatNb.mjs → AccountFields-Cl4KHoSj.mjs} +14 -12
  6. package/dist/AccountListItem-wgmlex-_.mjs +90 -0
  7. package/dist/{AccountStore-BgNOyMdp.mjs → AccountStore-HbVblv86.mjs} +19 -8
  8. package/dist/{Accounts-BRf_YeTf.mjs → Accounts-CRUehOiy.mjs} +1 -1
  9. package/dist/{BeatApi-DhJpgCLz.mjs → BeatApi-De2IaqH2.mjs} +1 -1
  10. package/dist/{BeatStore-IBnXd4YK.mjs → BeatStore-D_NYuBSz.mjs} +1 -1
  11. package/dist/{BudgetUtil-B2ZXyw-g.mjs → BudgetUtil-Jv8h9H9l.mjs} +33 -33
  12. package/dist/{CashflowStore-D9Dpuz7X.mjs → CashflowStore-CA190BPF.mjs} +18 -25
  13. package/dist/{Category-CevNQ03n.mjs → Category-Ccoew_sA.mjs} +2 -2
  14. package/dist/{CategorySelectorDrawer-DUe4lH5-.mjs → CategorySelectorDrawer-Dl006GKy.mjs} +43 -41
  15. package/dist/{CategoryStore-yHI0hWmK.mjs → CategoryStore-MUwRWH9e.mjs} +13 -11
  16. package/dist/{CategoryUtil-pZRIYOgN.mjs → CategoryUtil-DfVKKkRf.mjs} +4 -4
  17. package/dist/{ConnectDrawer-BQNs-hjk.mjs → ConnectDrawer-DVp54lUH.mjs} +49 -48
  18. package/dist/{ConnectionsDrawer-ByGQE7D5.mjs → ConnectionsDrawer-Dsc04-4Z.mjs} +3 -3
  19. package/dist/CurrencyInput-D1cjbdCI.mjs +85 -0
  20. package/dist/{CurrencyText-kyC1aseI.mjs → CurrencyText-Dr0EZ7bp.mjs} +1 -1
  21. package/dist/{DateUtil-BcuH7ErC.mjs → DateUtil-CDPZw_-m.mjs} +3 -3
  22. package/dist/{DebtsStore-C9bblOgW.mjs → DebtsStore-pL63fmdT.mjs} +3 -3
  23. package/dist/{Dialog-CWW597AF.mjs → Dialog-CDV0kKxj.mjs} +24 -24
  24. package/dist/{Donut-oaQFlbit.mjs → Donut-Dmy3JTWd.mjs} +12 -12
  25. package/dist/Drawer-BF40nbsH.mjs +163 -0
  26. package/dist/{EmptyState-DA_lfRBv.mjs → EmptyState-DoxNUae-.mjs} +24 -22
  27. package/dist/{ExportCsvAction-sX8Rg4Ov.mjs → ExportCsvAction-QhQK4_FU.mjs} +4 -4
  28. package/dist/{Fetch-87LIQbEA.mjs → Fetch-DecPFeGU.mjs} +24 -22
  29. package/dist/FinstrongStore-BGf36b0z.mjs +451 -0
  30. package/dist/{GoalStore-D-aB35SY.mjs → GoalStore-C1-w3Y1E.mjs} +7 -7
  31. package/dist/HeaderCell-P8w6CmfO.mjs +6 -0
  32. package/dist/{Help-B6dIcujh.mjs → Help-DBfsTkAi.mjs} +125 -146
  33. package/dist/{Help-DhcC-C05.mjs → Help-c-zHlDbv.mjs} +8 -8
  34. package/dist/{IconBacking-B9oC6uL2.mjs → IconBacking-DgT8DCeh.mjs} +11 -11
  35. package/dist/LineChart-C1PxNf7P.mjs +581 -0
  36. package/dist/{ListItemAction-DHa3KJPs.mjs → ListItemAction-BNCWQAN_.mjs} +10 -10
  37. package/dist/Loader-Ckqi9Rx6.mjs +21 -0
  38. package/dist/{ManageIncome-1s_q5W4X.mjs → ManageIncome-8EsStyIQ.mjs} +195 -192
  39. package/dist/{MerchantStore-DrFvsUyy.mjs → MerchantStore-WvZ4gnQe.mjs} +1 -1
  40. package/dist/MicroWidgetContainer-BGpNl5ZS.mjs +45 -0
  41. package/dist/MiniWidgetContainer-CKzf_Ira.mjs +56 -0
  42. package/dist/{NetWorthStore-DCsTZpuS.mjs → NetWorthStore-Bti6u-d9.mjs} +4 -4
  43. package/dist/{NotificationSettings-DqrkNMod.mjs → NotificationSettings-B74rQVYC.mjs} +276 -273
  44. package/dist/{NotificationStore-BxP_P2dA.mjs → NotificationStore-Ck2KdNmT.mjs} +10 -10
  45. package/dist/{NumberFormatting-Buh7u8Oi.mjs → NumberFormatting-DjTD0t3W.mjs} +9 -9
  46. package/dist/{OriginalBalanceAction-CWuVvRq9.mjs → OriginalBalanceAction-2Y_3U_mg.mjs} +10 -10
  47. package/dist/{RecurringSettings-A_rAGCTP.mjs → RecurringSettings-DAncu--R.mjs} +17 -17
  48. package/dist/{RecurringTransactions-DK8dWldr.mjs → RecurringTransactions-CxcSL1dY.mjs} +106 -105
  49. package/dist/{RecurringTransactionsStore-C4YOD7_D.mjs → RecurringTransactionsStore-CNFxyGB6.mjs} +80 -73
  50. package/dist/{ResponsiveButton-DZFp78fJ.mjs → ResponsiveButton-Cn6-R7ue.mjs} +10 -10
  51. package/dist/SearchBox-B7km148n.mjs +39 -0
  52. package/dist/{SettingsStore-BcgS_Ohv.mjs → SettingsStore-BASMQSIp.mjs} +3 -3
  53. package/dist/{SingleSegmentDonut-BgbLgwHi.mjs → SingleSegmentDonut-7Uy6VEld.mjs} +6 -6
  54. package/dist/SkeletonLoader-BaNboJjD.mjs +38 -0
  55. package/dist/{SpendingData-D5vsfYKo.mjs → SpendingData-DPQ96k3x.mjs} +19 -19
  56. package/dist/SpendingLegend-6FqtMcBV.mjs +193 -0
  57. package/dist/{StatusBar-BK_uYHAB.mjs → StatusBar-CPfSXe80.mjs} +6 -6
  58. package/dist/{TabContentContainer-j01JYR_7.mjs → TabContentContainer-CnMXkVqr.mjs} +8 -8
  59. package/dist/{ToggleListItem-r0Kx56wF.mjs → ToggleListItem-ciFTiqRS.mjs} +19 -14
  60. package/dist/TransactionApi-CjBoLleL.mjs +86 -0
  61. package/dist/TransactionDetails-Bn0qY5Hw.mjs +1336 -0
  62. package/dist/{TransactionStore-ai3uII_r.mjs → TransactionStore-DbwAutwC.mjs} +146 -165
  63. package/dist/TrendsStore-_mRaFUdf.mjs +182 -0
  64. package/dist/{User-BQUxBeZV.mjs → User-BklmOUSd.mjs} +107 -107
  65. package/dist/{ViewMoreMicroCard-SCn2wt4i.mjs → ViewMoreMicroCard-DAkyNRlD.mjs} +706 -729
  66. package/dist/{WidgetContainer-BHWANqT4.mjs → WidgetContainer-CDh9fjpR.mjs} +36 -36
  67. package/dist/accounts/components/AccountsListCompact.d.ts +10 -0
  68. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsChart.d.ts +4 -1
  69. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsHeader.d.ts +2 -1
  70. package/dist/accounts/index.es.js +228 -199
  71. package/dist/accounts/stores/AccountStore.d.ts +2 -0
  72. package/dist/analytics/index.es.js +27 -27
  73. package/dist/budgets/index.es.js +459 -462
  74. package/dist/cashflow/index.es.js +419 -428
  75. package/dist/categories/index.es.js +2 -2
  76. package/dist/categories/stores/CategoryStore.d.ts +1 -1
  77. package/dist/common/components/ErrorBoundary.d.ts +1 -1
  78. package/dist/common/components/Loader.d.ts +1 -2
  79. package/dist/common/components/Select.d.ts +4 -2
  80. package/dist/common/components/SkeletonLoader.d.ts +7 -0
  81. package/dist/common/components/accountfilter/AccountFilterOptions.d.ts +1 -1
  82. package/dist/common/components/charts/LineChart.d.ts +12 -2
  83. package/dist/common/components/charts/index.d.ts +0 -3
  84. package/dist/common/components/charts/linechart/CustomLegend.d.ts +3 -1
  85. package/dist/common/components/charts/linechart/CustomMark.d.ts +5 -1
  86. package/dist/common/components/drawer/Drawer.d.ts +3 -0
  87. package/dist/common/components/drawer/Footer.d.ts +17 -0
  88. package/dist/common/components/index.d.ts +0 -1
  89. package/dist/common/hooks/index.d.ts +0 -1
  90. package/dist/common/hooks/useAriaLive.d.ts +1 -1
  91. package/dist/common/index.es.js +413 -674
  92. package/dist/common/stores/GlobalStore.d.ts +7 -1
  93. package/dist/common/stores/GlobalUiStore.d.ts +3 -2
  94. package/dist/common/types/Finstrong.d.ts +54 -0
  95. package/dist/common/types/Global.d.ts +1 -0
  96. package/dist/common/types/Widgets.d.ts +1 -0
  97. package/dist/common/types/index.d.ts +1 -1
  98. package/dist/common/types/localization/FinstrongCopy.d.ts +105 -2
  99. package/dist/common/types/localization/GoalsCopy.d.ts +1 -0
  100. package/dist/common/utils/Theme.d.ts +1 -3
  101. package/dist/dashboard/index.es.js +21 -21
  102. package/dist/debts/components/DebtsChart.d.ts +1 -2
  103. package/dist/debts/index.es.js +673 -665
  104. package/dist/exportTransactionsToCSV-BgV_wTLT.mjs +48 -0
  105. package/dist/finstrong/FinstrongWidget.d.ts +1 -1
  106. package/dist/finstrong/api/FinstrongApi.d.ts +5 -0
  107. package/dist/finstrong/components/ConnectMoreAccountsCard.d.ts +3 -1
  108. package/dist/finstrong/components/CreditScore/CreditScoreContent.d.ts +4 -0
  109. package/dist/finstrong/components/CreditScore/CreditScoreHeader.d.ts +4 -0
  110. package/dist/finstrong/components/FinancialStrengthGraph.d.ts +7 -1
  111. package/dist/finstrong/components/HaveManageableDebt/DebtPaymentTabContent.d.ts +3 -0
  112. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtComponent.d.ts +3 -0
  113. package/dist/finstrong/components/HaveManageableDebt/HaveManageableDebtProgressBar.d.ts +4 -0
  114. package/dist/finstrong/components/HaveManageableDebt/IncomeTabContent.d.ts +3 -0
  115. package/dist/finstrong/components/KeyIndicatorsBorrowTab.d.ts +2 -2
  116. package/dist/finstrong/components/KeyIndicatorsDrawer.d.ts +4 -1
  117. package/dist/finstrong/components/KeyIndicatorsSaveTab.d.ts +2 -2
  118. package/dist/finstrong/components/KeyIndicatorsSpendTab.d.ts +2 -2
  119. package/dist/finstrong/components/KeyIndicatorsTabItem.d.ts +4 -3
  120. package/dist/finstrong/components/KeyIndicatorsTabItemDrawer.d.ts +10 -0
  121. package/dist/finstrong/components/KeyIndicatorsTabsWidget.d.ts +2 -2
  122. package/dist/finstrong/components/MaintainingEmergencySavings/EstimatedContributionCalculator.d.ts +6 -0
  123. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsContent.d.ts +4 -0
  124. package/dist/finstrong/components/MaintainingEmergencySavings/MaintainingEmergencySavingsSticky.d.ts +4 -0
  125. package/dist/finstrong/components/ProgressBar.d.ts +15 -0
  126. package/dist/finstrong/components/SaveEnoughToLiveOn/AvailableTabContent.d.ts +3 -0
  127. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnDrawerContent.d.ts +3 -0
  128. package/dist/finstrong/components/SaveEnoughToLiveOn/SaveEnoughToLiveOnProgressBar.d.ts +4 -0
  129. package/dist/finstrong/components/SaveEnoughToLiveOn/SpendingTabContent.d.ts +3 -0
  130. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeComponent.d.ts +3 -0
  131. package/dist/finstrong/components/SpendLessThanYouMake/SpendLessThanYouMakeProgressBar.d.ts +4 -0
  132. package/dist/finstrong/components/StatusChip.d.ts +5 -0
  133. package/dist/finstrong/components/onboarding/Onboarding.d.ts +2 -0
  134. package/dist/finstrong/components/onboarding/OnboardingAddMonthlyIncome.d.ts +17 -0
  135. package/dist/finstrong/components/onboarding/OnboardingBirthday.d.ts +8 -0
  136. package/dist/finstrong/components/onboarding/OnboardingCreditScore.d.ts +8 -0
  137. package/dist/finstrong/components/onboarding/OnboardingStepsDrawer.d.ts +14 -0
  138. package/dist/finstrong/components/onboarding/OnboardingStepsHeader.d.ts +8 -0
  139. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeDrawerComponent.d.ts +4 -0
  140. package/dist/finstrong/components/paybillsontime/PayBillsOnTimeStickyComponent.d.ts +4 -0
  141. package/dist/finstrong/components/shared/Accounts.d.ts +8 -0
  142. package/dist/finstrong/components/shared/CustomDoubleBarPlot.d.ts +25 -0
  143. package/dist/finstrong/components/shared/DialScoreCard.d.ts +7 -1
  144. package/dist/finstrong/components/shared/DoubleBarChart.d.ts +28 -0
  145. package/dist/finstrong/components/shared/LineGraph.d.ts +7 -0
  146. package/dist/finstrong/components/shared/TotalCard.d.ts +8 -0
  147. package/dist/finstrong/components/shared/Transactions.d.ts +11 -0
  148. package/dist/finstrong/constants/index.d.ts +9 -0
  149. package/dist/finstrong/index.es.js +3175 -1067
  150. package/dist/finstrong/stores/FinstrongStore.d.ts +25 -2
  151. package/dist/finstrong/util/finstrongUtils.d.ts +58 -1
  152. package/dist/goals/index.es.js +580 -570
  153. package/dist/help/components/content/BottomImageContent.d.ts +1 -1
  154. package/dist/help/components/content/LeftImageContent.d.ts +1 -1
  155. package/dist/help/components/content/RightImageContent.d.ts +1 -1
  156. package/dist/help/components/content/TopImageContent.d.ts +1 -1
  157. package/dist/help/index.es.js +6 -6
  158. package/dist/{hooks-D6XlXHf4.mjs → hooks-C41HAxM5.mjs} +3 -3
  159. package/dist/insights/index.es.js +1 -1
  160. package/dist/investments/index.es.js +537 -536
  161. package/dist/merchants/index.es.js +9 -9
  162. package/dist/microinsights/beaticons/BeatIcon.d.ts +2 -9
  163. package/dist/microinsights/beaticons/BeatMerchantLogo.d.ts +3 -2
  164. package/dist/microinsights/beaticons/MonthlySpendComparisonIcon.d.ts +2 -1
  165. package/dist/microinsights/cards/{MicroInsightCard.d.ts → BaseCard.d.ts} +1 -8
  166. package/dist/microinsights/cards/{BeatCard.d.ts → InsightCard.d.ts} +2 -2
  167. package/dist/microinsights/cards/NoRelevantInsightsCard.d.ts +2 -5
  168. package/dist/microinsights/cards/ZeroStateCard.d.ts +2 -5
  169. package/dist/microinsights/carousel/BeatList.d.ts +10 -0
  170. package/dist/microinsights/carousel/CarouselControls.d.ts +1 -3
  171. package/dist/microinsights/carousel/CarouselHeader.d.ts +1 -2
  172. package/dist/microinsights/constants/App.d.ts +0 -1
  173. package/dist/microinsights/index.d.ts +3 -3
  174. package/dist/microinsights/index.es.js +7 -7
  175. package/dist/microinsights/interfaces.d.ts +0 -6
  176. package/dist/networth/components/NetWorthChange.d.ts +3 -1
  177. package/dist/networth/index.es.js +262 -254
  178. package/dist/notifications/index.es.js +90 -91
  179. package/dist/recurringtransactions/components/MicroWidgetContent.d.ts +3 -0
  180. package/dist/recurringtransactions/index.es.js +586 -562
  181. package/dist/recurringtransactions/stores/RecurringTransactionsStore.d.ts +1 -0
  182. package/dist/settings/index.es.js +371 -365
  183. package/dist/spending/index.es.js +267 -419
  184. package/dist/spending/utils/SpendingData.d.ts +2 -1
  185. package/dist/transactions/components/shared/TransactionDetails.d.ts +1 -0
  186. package/dist/transactions/components/shared/TransactionList.d.ts +1 -0
  187. package/dist/transactions/index.es.js +231 -226
  188. package/dist/transactions/stores/TransactionStore.d.ts +1 -1
  189. package/dist/transactions/stores/UiStore.d.ts +0 -2
  190. package/dist/trends/index.es.js +988 -612
  191. package/dist/{useAccountDisplayName-BUAApBIb.mjs → useAccountDisplayName-CcIp09Xc.mjs} +2 -2
  192. package/dist/{useCombineEvents-BUDIR1ba.mjs → useCombineEvents-kNzLTWCp.mjs} +3 -3
  193. package/dist/{useInsightsEnabled-DBpwEq10.mjs → useInsightsEnabled-CNjP5cfR.mjs} +1 -1
  194. package/dist/{useScreenSize-B6JyS_Lj.mjs → useScreenSize-B5afALev.mjs} +1 -1
  195. package/package.json +51 -56
  196. package/dist/AccountDetailsContent-CAM9y39M.mjs +0 -679
  197. package/dist/AccountDetailsHeader-JtSX6Uf9.mjs +0 -120
  198. package/dist/AccountListItem-JFMZROh7.mjs +0 -90
  199. package/dist/CurrencyInput-DUsQbkXb.mjs +0 -85
  200. package/dist/Drawer-kEE73B87.mjs +0 -113
  201. package/dist/FinstrongStore-F2c607dj.mjs +0 -101
  202. package/dist/HeaderCell-DjuifqHJ.mjs +0 -6
  203. package/dist/LineChart-D4GI7nVh.mjs +0 -541
  204. package/dist/Loader-DUaFpDGv.mjs +0 -24
  205. package/dist/MicroWidgetContainer-DpeqN9n3.mjs +0 -45
  206. package/dist/MiniWidgetContainer-D0gfmbaF.mjs +0 -56
  207. package/dist/SearchBox-B2_zLv8-.mjs +0 -42
  208. package/dist/TransactionApi-B3Tksf7L.mjs +0 -86
  209. package/dist/TransactionDetails-oP1eSuiS.mjs +0 -1334
  210. package/dist/TrendsStore-DCYbpXPO.mjs +0 -559
  211. package/dist/accounts/components/AccountsWidgetContent.d.ts +0 -3
  212. package/dist/common/components/barchart/Bar.d.ts +0 -25
  213. package/dist/common/components/barchart/BarChart.d.ts +0 -34
  214. package/dist/common/components/barchart/BarColumn.d.ts +0 -37
  215. package/dist/common/components/barchart/Legend.d.ts +0 -8
  216. package/dist/common/components/barchart/Util.d.ts +0 -42
  217. package/dist/common/components/barchart/index.d.ts +0 -1
  218. package/dist/common/hooks/usePrevious.d.ts +0 -2
  219. package/dist/exportTransactionsToCSV-7bVS7KXf.mjs +0 -47
  220. package/dist/finstrong/utils/Finstrong.d.ts +0 -6
  221. package/dist/transactions/components/shared/transactionlist/DateRow.d.ts +0 -7
  222. package/dist/useAriaLive-B3_pRUio.mjs +0 -35
@@ -1,280 +1,180 @@
1
- import { jsx as e, jsxs as u, Fragment as re } from "react/jsx-runtime";
2
- import x from "@mui/material/Box";
3
- import g from "@mui/material/Stack";
4
- import { useTheme as G, alpha as te } from "@mui/material/styles";
5
- import { PieChart as Oe } from "@mui/x-charts";
6
- import { ChevronRight as j, Check as De, TrendingUp as Me, ArrowRightAlt as Te, TrendingDown as we, AccountBalance as me, ExpandMore as Re, Payments as Fe, CalendarMonth as Pe, CreditCard as ue, Savings as Ge, ContentCopy as Le, MultilineChart as Ee } from "@mxenabled/mx-icons";
7
- import { Text as W, P as y, H3 as H, Icon as he } from "@mxenabled/mxui";
8
- import { format as _e } from "date-fns/format";
9
- import C from "react";
10
- import We from "@mui/material/Avatar";
11
- import ge from "@mui/material/Divider";
12
- import Be from "@mui/material/List";
13
- import He from "@mui/material/ListItem";
14
- import ze from "@mui/material/ListItemAvatar";
15
- import $e from "@mui/material/ListItemButton";
16
- import Ne from "@mui/material/ListItemText";
17
- import { b } from "../Localization-2MODESHW.mjs";
18
- import * as ce from "d3";
19
- import { observer as I } from "mobx-react-lite";
20
- import { u as S, b as z, x as $, p as Y, d as fe, i as ye, m as Ke } from "../hooks-D6XlXHf4.mjs";
21
- import { L as N } from "../Loader-DUaFpDGv.mjs";
22
- import { F as No, a as Ko } from "../FinstrongStore-F2c607dj.mjs";
23
- import q from "@mui/material/Button";
24
- import J from "@mui/material/Card";
25
- import { L as be } from "../LineChart-D4GI7nVh.mjs";
26
- import { l as xe } from "../ConnectDrawer-BQNs-hjk.mjs";
27
- import Xe from "@mui/material/Accordion";
28
- import je from "@mui/material/AccordionDetails";
29
- import Ue from "@mui/material/AccordionSummary";
30
- import Ve from "@mui/material/CardHeader";
31
- import { u as Ye } from "../useDimensions-27p2evRx.mjs";
32
- import { C as qe } from "../ConnectionsDrawer-ByGQE7D5.mjs";
33
- import { R as Je } from "../RecurringSettings-A_rAGCTP.mjs";
34
- import Qe from "@mui/material/TextField";
35
- import { u as Ce } from "../useScreenSize-B6JyS_Lj.mjs";
36
- import { a as Ze } from "../Dialog-CWW597AF.mjs";
37
- import { AdapterDateFns as et } from "@mui/x-date-pickers/AdapterDateFnsV3";
38
- import { StaticDatePicker as tt } from "@mui/x-date-pickers";
39
- import { LocalizationProvider as ot } from "@mui/x-date-pickers/LocalizationProvider";
40
- import { D as V } from "../Drawer-kEE73B87.mjs";
41
- import oe from "@mui/material/Tab";
42
- import nt from "@mui/material/Tabs";
43
- import { f as rt } from "../NumberFormatting-Buh7u8Oi.mjs";
44
- import { T as ne } from "../TabContentContainer-j01JYR_7.mjs";
45
- import it from "@mui/lab/Timeline";
46
- import st, { timelineItemClasses as at } from "@mui/lab/TimelineItem";
47
- import ct from "@mui/lab/TimelineConnector";
48
- import lt from "@mui/lab/TimelineContent";
49
- import dt from "@mui/lab/TimelineDot";
50
- import pt from "@mui/lab/TimelineSeparator";
51
- import { W as mt } from "../WidgetContainer-BHWANqT4.mjs";
52
- var A = /* @__PURE__ */ ((n) => (n.Connections = "connections", n.CreditScore = "credit_score", n.DateOfBirth = "date_of_birth", n.MonthlyIncome = "monthly_income", n))(A || {});
53
- const ut = ({ list: n, onClickItem: o }) => /* @__PURE__ */ e(x, { sx: { bgcolor: "background.paper" }, children: /* @__PURE__ */ e(
54
- Be,
55
- {
56
- sx: {
57
- "& .MuiListItemSecondaryAction-root": {
58
- color: "text.primary",
59
- pr: 24
60
- }
61
- },
62
- children: n.map((t, i) => /* @__PURE__ */ u(C.Fragment, { children: [
63
- /* @__PURE__ */ e(He, { secondaryAction: /* @__PURE__ */ e(j, {}), children: /* @__PURE__ */ u($e, { onClick: () => o(t.key), children: [
64
- /* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(
65
- We,
66
- {
67
- sx: {
68
- bgcolor: "primary.main",
69
- ...!t.isComplete && {
70
- bgcolor: "transparent",
71
- borderColor: "action.active",
72
- borderStyle: "solid",
73
- borderWidth: 1,
74
- color: "action.active"
75
- }
76
- },
77
- children: t.icon
78
- }
79
- ) }),
80
- /* @__PURE__ */ e(
81
- Ne,
82
- {
83
- primary: /* @__PURE__ */ e(W, { sx: { color: "text.secondary" }, variant: "caption", children: t.primaryText }),
84
- secondary: /* @__PURE__ */ e(W, { sx: { color: "text.primary", fontWeight: 600 }, variant: "body1", children: t.secondaryText })
85
- }
86
- )
87
- ] }) }),
88
- i < n.length - 1 && /* @__PURE__ */ e(ge, { sx: { color: "divider", ml: 68 } })
89
- ] }, t.key))
90
- }
91
- ) }), ht = ut, le = (n) => n * (180 / Math.PI), ie = (n, o) => [
92
- {
93
- description: o.vulnerable_description,
94
- max: 25,
95
- scoreContent: o.accordion_details_text.vulnerable,
96
- status: o.vulnerable
97
- },
98
- {
99
- description: o.building_description,
100
- max: 50,
101
- scoreContent: o.accordion_details_text.building,
102
- status: o.building
103
- },
104
- {
105
- description: o.stable_description,
106
- max: 75,
107
- scoreContent: o.accordion_details_text.stable,
108
- status: o.stable
109
- },
110
- {
111
- description: o.strong_description,
112
- max: 100,
113
- scoreContent: o.accordion_details_text.strong,
114
- status: o.strong
115
- }
116
- ].find((d) => n > 0 && n <= d.max) || { status: o.insufficient_data, description: "", scoreContent: "" }, D = {
117
- POOR: "#8C0E0E",
118
- FAIR: "#E32727",
119
- GOOD: "#FFB70D",
120
- VERY_GOOD: "#0EA26C",
121
- EXCEPTIONAL: "#005C3D"
122
- }, M = {
123
- POOR: "#B21C1C",
124
- FAIR: "#FF3232",
125
- GOOD: "#FFC02C",
126
- VERY_GOOD: "#29C76B",
127
- EXCEPTIONAL: "#008A5A"
128
- }, _t = (n, o, t) => n >= 300 && n < 580 ? {
129
- status: t.poor,
130
- color: o ? M.POOR : D.POOR
131
- } : n >= 580 && n < 670 ? {
132
- status: t.fair,
133
- color: o ? M.FAIR : D.FAIR
134
- } : n >= 670 && n < 740 ? {
135
- status: t.good,
136
- color: o ? M.GOOD : D.GOOD
137
- } : n >= 740 && n < 800 ? {
138
- status: t.very_good,
139
- color: o ? M.VERY_GOOD : D.VERY_GOOD
140
- } : n >= 800 && n <= 850 ? {
141
- status: t.exceptional,
142
- color: o ? M.EXCEPTIONAL : D.EXCEPTIONAL
143
- } : { status: t.missing_data }, gt = (n, o, t, i) => {
144
- const d = n.reduce((r, a) => r + a.value, 0);
145
- let l = 0;
146
- const s = n.map((r) => {
147
- const a = r.value / d * o, c = t + l, p = c + a;
148
- return l += a, {
149
- ...r,
150
- startAngle: c,
151
- endAngle: p
152
- };
153
- });
154
- return [s[i].startAngle, s[i].endAngle];
155
- }, ft = (n, o, t, i, d) => {
156
- let l = 0, s = 0;
157
- const r = Math.floor(i), a = i - r;
158
- return r > t ? (l = n, s = o) : r === t && a > 0 && (l = n, s = d), [l, s];
159
- }, yt = (n, o, t = 0) => {
160
- const i = n * Math.sin(o - t), d = -n * Math.cos(o - t);
161
- return [i, d];
162
- }, bt = ({
163
- dynamicCopy: n,
164
- fallbackLabel: o,
165
- icon: t,
166
- key: i,
167
- label: d,
168
- value: l
169
- }) => {
170
- const s = !!l, r = s ? xt(i, l) : n && b(n, o) || o;
171
- return {
172
- icon: s ? /* @__PURE__ */ e(De, {}) : t,
173
- isComplete: s,
174
- key: i,
175
- primaryText: d,
176
- secondaryText: r
177
- };
178
- }, xt = (n, o) => ({
179
- [A.DateOfBirth]: (i) => _e(new Date(Number(i) * 1e3), "MMM d, yyyy"),
180
- [A.MonthlyIncome]: (i) => `$${i}`
181
- })[n]?.(o) ?? String(o), de = (n) => n !== null ? Math.round(n * 100) : null, Ct = ({
182
- dialScoreData: n,
1
+ import { jsxs as a, Fragment as z, jsx as e } from "react/jsx-runtime";
2
+ import k from "@mui/material/Box";
3
+ import p from "@mui/material/Stack";
4
+ import { useTheme as G, alpha as be } from "@mui/material/styles";
5
+ import { PieChart as rn, BarPlot as an } from "@mui/x-charts";
6
+ import { TrendingUp as dt, ArrowRightAlt as sn, TrendingDown as cn, AccountBalance as pt, ChevronRight as Z, CreditCard as He, MultilineChart as _t, CheckCircle as ln, Cancel as dn, Savings as pn, ContentCopy as _n, Add as ht, Cardiology as hn, Payments as un, CalendarMonth as mn, ExpandMore as gn } from "@mxenabled/mx-icons";
7
+ import { P as M, H3 as V, Text as I, InstitutionLogo as ut, H2 as Le, MerchantLogo as yn, Icon as bn } from "@mxenabled/mxui";
8
+ import { g as fn, a as xn, r as et, b as Cn, c as Ne, d as mt, C as ke, e as Me, f as Sn, h as vn, i as wn, j as gt, k as tt, l as kn, m as nt, n as Mn, o as yt, p as Dn, q as bt, s as Oe, t as ft, u as In, v as xt, w as An, A as ne, x as Tn, P as On } from "../FinstrongStore-BGf36b0z.mjs";
9
+ import { y as xi, F as Ci } from "../FinstrongStore-BGf36b0z.mjs";
10
+ import * as ot from "d3";
11
+ import { observer as v } from "mobx-react-lite";
12
+ import { u as x, b as q, a as je, p as J, z as L, q as Fn, d as xe, m as Ke, f as Rn, j as Ve, h as Ln, i as Pn, n as Bn } from "../hooks-C41HAxM5.mjs";
13
+ import { L as ee } from "../Loader-Ckqi9Rx6.mjs";
14
+ import m from "react";
15
+ import B from "@mui/material/Button";
16
+ import Y from "@mui/material/Card";
17
+ import { L as Ye } from "../LineChart-C1PxNf7P.mjs";
18
+ import { C as Ct } from "../ConnectionsDrawer-Dsc04-4Z.mjs";
19
+ import { l as re, g as St, A as Ge } from "../ConnectDrawer-DVp54lUH.mjs";
20
+ import se from "@mui/material/Tab";
21
+ import Xe from "@mui/material/Tabs";
22
+ import Fe from "@mui/material/TextField";
23
+ import { D as Wn, f as $n, a as zn } from "../Dialog-CDV0kKxj.mjs";
24
+ import { u as qe } from "../useScreenSize-B5afALev.mjs";
25
+ import { u as vt } from "../useDimensions-27p2evRx.mjs";
26
+ import Gn from "@mui/material/Chip";
27
+ import { D as oe } from "../Drawer-BF40nbsH.mjs";
28
+ import le from "@mui/material/Divider";
29
+ import ge from "@mui/material/ListItem";
30
+ import wt from "@mui/material/ListItemAvatar";
31
+ import ye from "@mui/material/ListItemText";
32
+ import { g as kt } from "../AccountFields-Cl4KHoSj.mjs";
33
+ import Ee from "@mui/material/List";
34
+ import En from "@mui/material/ListItemButton";
35
+ import Hn from "@mui/material/ListSubheader";
36
+ import { f as $ } from "../NumberFormatting-DjTD0t3W.mjs";
37
+ import { b as K } from "../Localization-2MODESHW.mjs";
38
+ import { S as rt, F as Mt, e as Nn, R as Dt } from "../RecurringTransactions-CxcSL1dY.mjs";
39
+ import { S as jn } from "../StatusBar-CPfSXe80.mjs";
40
+ import { h as It } from "../DateUtil-CDPZw_-m.mjs";
41
+ import { T as Kn, s as Vn, h as Yn, S as Xn, c as qn } from "../TransactionDetails-Bn0qY5Hw.mjs";
42
+ import { T as ce } from "../TabContentContainer-CnMXkVqr.mjs";
43
+ import { E as Re } from "../EmptyState-DoxNUae-.mjs";
44
+ import Un from "@mui/material/useMediaQuery";
45
+ import { ChartsXAxis as Qn } from "@mui/x-charts/ChartsXAxis";
46
+ import { ChartsYAxis as Zn } from "@mui/x-charts/ChartsYAxis";
47
+ import { ResponsiveChartContainer as Jn } from "@mui/x-charts/ResponsiveChartContainer";
48
+ import { useSpring as eo, animated as at } from "@react-spring/web";
49
+ import { startOfMonth as At } from "date-fns/startOfMonth";
50
+ import { endOfMonth as Tt } from "date-fns/endOfMonth";
51
+ import { g as to, S as no, b as oo } from "../SpendingLegend-6FqtMcBV.mjs";
52
+ import { formatISO as ro } from "date-fns/formatISO";
53
+ import { fromUnixTime as ao } from "date-fns/fromUnixTime";
54
+ import { startOfToday as it } from "date-fns/startOfToday";
55
+ import { subDays as io } from "date-fns/subDays";
56
+ import { c as so, d as st, S as co, i as lo } from "../ManageIncome-8EsStyIQ.mjs";
57
+ import { LocalizationProvider as po, DatePicker as _o, StaticDatePicker as ho } from "@mui/x-date-pickers";
58
+ import { AdapterDateFns as Ot } from "@mui/x-date-pickers/AdapterDateFnsV3";
59
+ import { R as uo } from "../RecurringSettings-DAncu--R.mjs";
60
+ import { LocalizationProvider as mo } from "@mui/x-date-pickers/LocalizationProvider";
61
+ import { format as go } from "date-fns/format";
62
+ import yo from "@mui/lab/Timeline";
63
+ import bo, { timelineItemClasses as fo } from "@mui/lab/TimelineItem";
64
+ import xo from "@mui/lab/TimelineConnector";
65
+ import Co from "@mui/lab/TimelineContent";
66
+ import So from "@mui/lab/TimelineDot";
67
+ import vo from "@mui/lab/TimelineSeparator";
68
+ import wo from "@mui/material/Accordion";
69
+ import ko from "@mui/material/AccordionDetails";
70
+ import Mo from "@mui/material/AccordionSummary";
71
+ import Do from "@mui/material/CardHeader";
72
+ import { W as Io } from "../WidgetContainer-CDh9fjpR.mjs";
73
+ const Ao = ({
74
+ dialScoreData: t,
183
75
  dataIndex: o,
184
- arcColor: t,
185
- arcStartAngle: i,
186
- totalAngularSpan: d,
187
- centerX: l,
188
- centerY: s,
189
- arcRadius: r,
190
- innerArcRadius: a,
191
- outterArcRadius: c,
192
- progressEndAngle: p,
76
+ arcColor: n,
77
+ arcStartAngle: r,
78
+ totalAngularSpan: s,
79
+ centerX: i,
80
+ centerY: c,
81
+ arcRadius: l,
82
+ innerArcRadius: _,
83
+ outterArcRadius: d,
84
+ progressEndAngle: u,
193
85
  unitsPerSegment: h,
194
- isFinacialStrengthGraph: m
86
+ isFinacialStrengthGraph: y
195
87
  }) => {
196
- const _ = G(), R = [
197
- { offset: "13.62%", color: _.palette.chartMono.chartMono2 },
198
- { offset: "36.67%", color: _.palette.chartMono.chartMono3 },
199
- { offset: "59.72%", color: _.palette.chartMono.chartMono4 },
200
- { offset: "83.46%", color: _.palette.chartMono.chartMono5 }
201
- ], [T, v] = gt(
202
- n,
203
- d,
204
- i,
88
+ const f = G(), w = [
89
+ { offset: "13.62%", color: f.palette.chartMono.chartMono2 },
90
+ { offset: "36.67%", color: f.palette.chartMono.chartMono3 },
91
+ { offset: "59.72%", color: f.palette.chartMono.chartMono4 },
92
+ { offset: "83.46%", color: f.palette.chartMono.chartMono5 }
93
+ ], [C, D] = fn(
94
+ t,
95
+ s,
96
+ r,
205
97
  o
206
- ), [L, E] = ft(
207
- T,
208
- v,
98
+ ), [S, g] = xn(
99
+ C,
100
+ D,
209
101
  o,
210
102
  h,
211
- p
212
- ), K = ce.arc().innerRadius(a).outerRadius(c).startAngle(T).endAngle(v).padAngle(0.02).cornerRadius(8), F = ce.arc().innerRadius(a).outerRadius(c).startAngle(L).endAngle(E).padAngle(0.02).cornerRadius(8);
213
- return /* @__PURE__ */ u(re, { children: [
103
+ u
104
+ ), b = ot.arc().innerRadius(_).outerRadius(d).startAngle(C).endAngle(D).padAngle(0.02).cornerRadius(8), P = ot.arc().innerRadius(_).outerRadius(d).startAngle(S).endAngle(g).padAngle(0.02).cornerRadius(8);
105
+ return /* @__PURE__ */ a(z, { children: [
214
106
  /* @__PURE__ */ e(
215
107
  "path",
216
108
  {
217
- d: K({}),
218
- fill: m ? _.palette.divider : t
109
+ d: b({}),
110
+ fill: y ? f.palette.divider : n
219
111
  }
220
112
  ),
221
- m && /* @__PURE__ */ e("path", { d: F({}), fill: "url(#arcGradient)" }),
113
+ y && /* @__PURE__ */ e("path", { d: P({}), fill: "url(#arcGradient)" }),
222
114
  /* @__PURE__ */ e("defs", { children: /* @__PURE__ */ e(
223
115
  "linearGradient",
224
116
  {
225
- gradientTransform: `rotate(5, ${l}, ${s})`,
117
+ gradientTransform: `rotate(5, ${i}, ${c})`,
226
118
  gradientUnits: "userSpaceOnUse",
227
119
  id: "arcGradient",
228
- x1: l + r * 0.8 * Math.cos(Math.PI / 1.35),
229
- x2: l - r * 0.8 * Math.cos(Math.PI / 1.35),
230
- y1: s + r * 0.8 * Math.sin(Math.PI / 1.35),
231
- y2: s - r * 0.8 * Math.sin(Math.PI / 1.35),
232
- children: R.map((w, O) => /* @__PURE__ */ e("stop", { offset: w.offset, stopColor: w.color }, O))
120
+ x1: i + l * 0.8 * Math.cos(Math.PI / 1.35),
121
+ x2: i - l * 0.8 * Math.cos(Math.PI / 1.35),
122
+ y1: c + l * 0.8 * Math.sin(Math.PI / 1.35),
123
+ y2: c - l * 0.8 * Math.sin(Math.PI / 1.35),
124
+ children: w.map((F, U) => /* @__PURE__ */ e("stop", { offset: F.offset, stopColor: F.color }, U))
233
125
  }
234
126
  ) })
235
127
  ] });
236
- }, Se = ({
237
- arcRadius: n = 100,
128
+ }, Ft = ({
129
+ arcRadius: t = 100,
238
130
  healthScore: o,
239
- size: t = "L",
240
- dialScoreData: i,
241
- minValue: d = 0,
242
- maxValue: l = 100,
243
- markerColor: s,
244
- healthScoreStatus: r,
245
- footerCenterContent: a,
246
- footerLeftContent: c,
247
- footerRightContent: p,
248
- isFinacialStrengthGraph: h = !1
131
+ size: n = "L",
132
+ dialScoreData: r,
133
+ minValue: s = 0,
134
+ maxValue: i = 100,
135
+ margin: c,
136
+ markerColor: l,
137
+ healthScoreStatus: _,
138
+ footerCenterContent: d,
139
+ footerLeftContent: u,
140
+ footerRightContent: h,
141
+ isFinacialStrengthGraph: y = !1
249
142
  }) => {
250
- const m = G(), _ = -Math.PI / 1.35, R = Math.PI / 1.35, T = R - _, v = T / (l - d), L = (o - d) * v, E = _ + L + 0.02, K = t !== "SM" ? 0.1 : 0.12, F = n, w = n * (1 - K), O = F * 2.5, k = O / 2, P = O / 2, U = (w + F) / 2, Z = o !== 25 && o !== 50 && o !== 75 && o !== 100 ? 0 : 0.12, [ee, ke] = yt(U, E, Z), Ae = o / 25, se = {
143
+ const f = G(), w = -Math.PI / 1.35, C = Math.PI / 1.35, D = C - w, S = D / (i - s), g = (o - s) * S, b = w + g + 0.02, P = n !== "SM" ? 0.1 : 0.12, F = t, U = t * (1 - P), W = F * 2, O = W / 2, E = W / 2, pe = (U + F) / 2, Se = o !== 25 && o !== 50 && o !== 75 && o !== 100 ? 0 : 0.12, [te, j] = Cn(pe, b, Se), ve = o / 25, H = {
251
144
  L: { markerSize: 12, healthScoreFontSize: 64 },
252
- M: { markerSize: 10, healthScoreFontSize: 48 },
145
+ M: { markerSize: 8, healthScoreFontSize: 48 },
253
146
  SM: { markerSize: 3, healthScoreFontSize: 14 }
254
- }, Ie = a === 0 ? Te : we;
255
- return /* @__PURE__ */ u(
256
- g,
147
+ }, we = {
148
+ top: 0,
149
+ right: 0,
150
+ bottom: 0,
151
+ left: 0,
152
+ ...c
153
+ }, N = d === 0 ? sn : cn, ae = n !== "SM" ? 3 : 1, _e = ae * 4, he = H[n].markerSize * 2 + _e;
154
+ return /* @__PURE__ */ a(
155
+ p,
257
156
  {
258
157
  sx: {
259
- width: O,
260
- height: O,
158
+ width: W,
159
+ height: n === "SM" ? W - 7 : W,
261
160
  position: "relative",
262
- alignSelf: "center"
161
+ alignSelf: "center",
162
+ overflow: "visible"
263
163
  },
264
164
  children: [
265
165
  /* @__PURE__ */ e(
266
- Oe,
166
+ rn,
267
167
  {
268
- height: O,
269
- margin: { top: 0, right: 0, bottom: 0, left: 0 },
168
+ height: n === "SM" ? W - 7 : W,
169
+ margin: we,
270
170
  series: [
271
171
  {
272
- data: i,
273
- innerRadius: w,
172
+ data: r,
173
+ innerRadius: U,
274
174
  outerRadius: F,
275
- startAngle: Math.round(le(_)),
175
+ startAngle: Math.round(et(w)),
276
176
  // Use Math.degrees to convert
277
- endAngle: Math.round(le(R))
177
+ endAngle: Math.round(et(C))
278
178
  // Use Math.degrees to convert
279
179
  }
280
180
  ],
@@ -283,22 +183,22 @@ const ut = ({ list: n, onClickItem: o }) => /* @__PURE__ */ e(x, { sx: { bgcolor
283
183
  legend: { hidden: !0 }
284
184
  },
285
185
  slots: {
286
- pieArc: (ae) => /* @__PURE__ */ e(
287
- Ct,
186
+ pieArc: (X) => /* @__PURE__ */ e(
187
+ Ao,
288
188
  {
289
- arcColor: ae.color,
290
- arcRadius: n,
291
- arcStartAngle: _,
292
- centerX: k,
293
- centerY: P,
294
- dataIndex: ae.dataIndex,
295
- dialScoreData: i,
296
- innerArcRadius: w,
297
- isFinacialStrengthGraph: h,
189
+ arcColor: X.color,
190
+ arcRadius: t,
191
+ arcStartAngle: w,
192
+ centerX: O,
193
+ centerY: E,
194
+ dataIndex: X.dataIndex,
195
+ dialScoreData: r,
196
+ innerArcRadius: U,
197
+ isFinacialStrengthGraph: y,
298
198
  outterArcRadius: F,
299
- progressEndAngle: E,
300
- totalAngularSpan: T,
301
- unitsPerSegment: Ae
199
+ progressEndAngle: b,
200
+ totalAngularSpan: D,
201
+ unitsPerSegment: ve
302
202
  }
303
203
  )
304
204
  },
@@ -307,205 +207,239 @@ const ut = ({ list: n, onClickItem: o }) => /* @__PURE__ */ e(x, { sx: { bgcolor
307
207
  stroke: "none"
308
208
  }
309
209
  },
310
- width: O,
311
- children: o >= d && o <= l && /* @__PURE__ */ e(
210
+ width: W
211
+ }
212
+ ),
213
+ o >= s && o <= i && /* @__PURE__ */ e(
214
+ "svg",
215
+ {
216
+ height: he,
217
+ style: {
218
+ position: "absolute",
219
+ left: O + te - H[n].markerSize - 5,
220
+ top: E + j - H[n].markerSize - 5,
221
+ overflow: "visible"
222
+ },
223
+ viewBox: `${O + te - H[n].markerSize - 5} ${E + j - H[n].markerSize - 5} ${he} ${he}`,
224
+ width: he,
225
+ children: /* @__PURE__ */ e(
312
226
  "circle",
313
227
  {
314
- cx: k + ee,
315
- cy: P + ke,
316
- fill: m.palette.common.white,
317
- r: se[t].markerSize,
318
- stroke: h ? "url(#arcGradient)" : s,
319
- strokeWidth: t !== "SM" ? 3 : 1
228
+ cx: O + te,
229
+ cy: E + j,
230
+ fill: f.palette.common.white,
231
+ r: H[n].markerSize,
232
+ stroke: y ? "url(#arcGradient)" : l,
233
+ strokeWidth: ae
320
234
  }
321
235
  )
322
236
  }
323
237
  ),
324
238
  /* @__PURE__ */ e(
325
- x,
239
+ k,
326
240
  {
327
241
  sx: {
328
242
  position: "absolute",
329
- top: `${P}px`,
330
- left: `${k}px`,
243
+ top: `${E}px`,
244
+ left: `${O}px`,
331
245
  transform: "translate(-50%, -50%)",
332
246
  textAlign: "center"
333
247
  },
334
- children: /* @__PURE__ */ u(
335
- g,
248
+ children: /* @__PURE__ */ a(
249
+ p,
336
250
  {
337
251
  spacing: 1,
338
- sx: { alignItems: "center", justifyContent: "center", gap: t !== "M" ? 10 : 3 },
252
+ sx: { alignItems: "center", justifyContent: "center", gap: n !== "M" ? 10 : 3 },
339
253
  children: [
340
254
  /* @__PURE__ */ e(
341
- y,
255
+ M,
342
256
  {
343
257
  sx: {
344
- fontSize: se[t].healthScoreFontSize,
345
- lineHeight: t !== "SM" ? "48px" : "100%"
258
+ fontSize: H[n].healthScoreFontSize,
259
+ lineHeight: n !== "SM" ? "48px" : "100%"
346
260
  },
347
- variant: "H1",
261
+ variant: "h1",
348
262
  children: o
349
263
  }
350
264
  ),
351
- t !== "SM" && /* @__PURE__ */ e(y, { sx: { fontWeight: 600 }, variant: t === "L" ? "body1" : "body2", children: r })
265
+ n !== "SM" && /* @__PURE__ */ e(M, { sx: { fontWeight: 600 }, variant: n === "L" ? "body1" : "body2", children: _ })
352
266
  ]
353
267
  }
354
268
  )
355
269
  }
356
270
  ),
357
- a !== void 0 && /* @__PURE__ */ e(
358
- x,
271
+ d !== void 0 && /* @__PURE__ */ e(
272
+ k,
359
273
  {
360
274
  sx: {
361
275
  position: "absolute",
362
- top: `${P * 2 * 0.83}px`,
363
- left: `${k}px`,
276
+ top: `${E * 2 * 0.83}px`,
277
+ left: `${O}px`,
364
278
  transform: "translate(-50%, -50%)",
365
279
  textAlign: "center"
366
280
  },
367
- children: typeof a == "number" ? /* @__PURE__ */ u(g, { sx: { flexDirection: "row", alignItems: "center", gap: 4 }, children: [
368
- a > 0 ? /* @__PURE__ */ e(Me, { size: 16, sx: { color: "success.main" } }) : /* @__PURE__ */ e(Ie, { size: 16, sx: { color: "text.secondary" } }),
369
- /* @__PURE__ */ e(
370
- y,
371
- {
372
- sx: {
373
- fontWeight: 600,
374
- color: a > 0 ? "success.main" : "text.secondary"
375
- },
376
- variant: "body1",
377
- children: a
378
- }
379
- )
380
- ] }) : /* @__PURE__ */ e(y, { sx: { color: "text.secondary" }, variant: "subtitle2", children: a })
281
+ children: typeof d == "number" ? /* @__PURE__ */ a(
282
+ p,
283
+ {
284
+ sx: {
285
+ flexDirection: "row",
286
+ alignItems: "center",
287
+ gap: 4,
288
+ mt: 24
289
+ },
290
+ children: [
291
+ d > 0 ? /* @__PURE__ */ e(dt, { size: 16, sx: { color: "success.main" } }) : /* @__PURE__ */ e(N, { size: 16, sx: { color: "text.secondary" } }),
292
+ /* @__PURE__ */ e(
293
+ M,
294
+ {
295
+ sx: {
296
+ fontWeight: 600,
297
+ color: d > 0 ? "success.main" : "text.secondary"
298
+ },
299
+ variant: "body1",
300
+ children: d
301
+ }
302
+ )
303
+ ]
304
+ }
305
+ ) : /* @__PURE__ */ e(M, { sx: { color: "text.secondary" }, variant: "subtitle2", children: d })
381
306
  }
382
307
  ),
383
- c !== void 0 && /* @__PURE__ */ e(
384
- x,
308
+ u !== void 0 && /* @__PURE__ */ e(
309
+ k,
385
310
  {
386
311
  sx: {
387
312
  position: "absolute",
388
- top: `${P * 2 * 0.83}px`,
389
- left: `${k - k / 2}px`,
313
+ top: `${E * 2 * 0.83}px`,
314
+ left: `${O - O / 2}px`,
390
315
  // shift left from center
391
316
  transform: "translate(-50%, -50%)",
392
317
  textAlign: "left"
393
318
  },
394
- children: /* @__PURE__ */ e(y, { variant: "body1", children: c })
319
+ children: /* @__PURE__ */ e(M, { variant: "body1", children: u })
395
320
  }
396
321
  ),
397
- p !== void 0 && /* @__PURE__ */ e(
398
- x,
322
+ h !== void 0 && /* @__PURE__ */ e(
323
+ k,
399
324
  {
400
325
  sx: {
401
326
  position: "absolute",
402
- top: `${P * 2 * 0.83}px`,
403
- left: `${k + k / 2}px`,
327
+ top: `${E * 2 * 0.83}px`,
328
+ left: `${O + O / 2}px`,
404
329
  transform: "translate(-50%, -50%)",
405
330
  textAlign: "right"
406
331
  },
407
- children: /* @__PURE__ */ e(y, { variant: "body1", children: p })
332
+ children: /* @__PURE__ */ e(M, { variant: "body1", children: h })
408
333
  }
409
334
  )
410
335
  ]
411
336
  }
412
337
  );
413
- }, ve = I(
414
- ({ arcRadius: n, size: o = "L", healthScore: t, footerCenterContent: i }) => {
415
- const d = [
338
+ }, Rt = v(
339
+ ({
340
+ arcRadius: t,
341
+ size: o = "L",
342
+ healthScore: n,
343
+ footerCenterContent: r,
344
+ margin: s
345
+ }) => {
346
+ const i = [
416
347
  { id: 1, label: "Group A", value: 25 },
417
348
  { id: 2, label: "Group B", value: 25 },
418
349
  { id: 3, label: "Group C", value: 25 },
419
350
  { id: 4, label: "Group D", value: 25 }
420
- ], { finstrong: l } = S(), s = ie(t, l);
351
+ ], { finstrong: c } = x(), l = Ne(n, c);
421
352
  return /* @__PURE__ */ e(
422
- Se,
353
+ Ft,
423
354
  {
424
- arcRadius: n,
425
- dialScoreData: d,
426
- footerCenterContent: o === "L" ? l.footer_center_content_updated_just_now : i,
427
- healthScore: t,
428
- healthScoreStatus: s.status,
355
+ arcRadius: t,
356
+ dialScoreData: i,
357
+ footerCenterContent: o === "L" ? c.footer_center_content_updated_just_now : r,
358
+ healthScore: n,
359
+ healthScoreStatus: l.status,
429
360
  isFinacialStrengthGraph: !0,
361
+ margin: s,
430
362
  size: o
431
363
  }
432
364
  );
433
365
  }
434
- ), Bo = I(
366
+ ), To = v(
435
367
  ({
436
- arcRadius: n,
368
+ arcRadius: t,
437
369
  size: o = "L",
438
- healthScore: t,
439
- maxValue: i = 850,
440
- minValue: d = 300,
441
- footerCenterContent: l
370
+ healthScore: n,
371
+ maxValue: r = 850,
372
+ minValue: s = 300,
373
+ footerCenterContent: i
442
374
  }) => {
443
- const r = G().palette.mode === "dark", a = [
375
+ const l = G().palette.mode === "dark", _ = [
444
376
  {
445
377
  id: 1,
446
378
  label: "Poor",
447
- value: 279,
448
- color: r ? M.POOR : D.POOR
379
+ value: 29,
380
+ color: l ? ke.POOR : Me.POOR
449
381
  },
450
382
  {
451
383
  id: 2,
452
384
  label: "Fair",
453
- value: 89,
454
- color: r ? M.FAIR : D.FAIR
385
+ value: 25,
386
+ color: l ? ke.FAIR : Me.FAIR
455
387
  },
456
388
  {
457
389
  id: 3,
458
390
  label: "Good",
459
- value: 69,
460
- color: r ? M.GOOD : D.GOOD
391
+ value: 17,
392
+ color: l ? ke.GOOD : Me.GOOD
461
393
  },
462
394
  {
463
395
  id: 4,
464
396
  label: "Very Good",
465
- value: 59,
466
- color: r ? M.VERY_GOOD : D.VERY_GOOD
397
+ value: 17,
398
+ color: l ? ke.VERY_GOOD : Me.VERY_GOOD
467
399
  },
468
400
  {
469
401
  id: 5,
470
402
  label: "Exceptional",
471
- value: 50,
472
- color: r ? M.EXCEPTIONAL : D.EXCEPTIONAL
403
+ value: 12,
404
+ color: l ? ke.EXCEPTIONAL : Me.EXCEPTIONAL
473
405
  }
474
- ], { finstrong: c } = S(), { isCopyLoaded: p } = z();
475
- if (!p) return /* @__PURE__ */ e(N, {});
476
- const { status: h, color: m = "none" } = _t(
477
- t,
478
- r,
479
- c.credit_score_status
406
+ ], { finstrong: d } = x(), { isCopyLoaded: u } = q();
407
+ if (!u) return /* @__PURE__ */ e(ee, {});
408
+ const { status: h, color: y = "none" } = mt(
409
+ n,
410
+ l,
411
+ d.credit_score_status
480
412
  );
481
413
  return /* @__PURE__ */ e(
482
- Se,
414
+ Ft,
483
415
  {
484
- arcRadius: n,
485
- dialScoreData: a,
486
- footerCenterContent: l,
487
- footerLeftContent: d,
488
- footerRightContent: i,
489
- healthScore: t,
416
+ arcRadius: t,
417
+ dialScoreData: _,
418
+ footerCenterContent: i,
419
+ footerLeftContent: s,
420
+ footerRightContent: r,
421
+ healthScore: n,
490
422
  healthScoreStatus: h,
491
- markerColor: m,
492
- maxValue: i,
493
- minValue: d,
423
+ markerColor: y,
424
+ maxValue: r,
425
+ minValue: s,
494
426
  size: o
495
427
  }
496
428
  );
497
429
  }
498
- ), Q = ({
499
- isDashboard: n = !1,
500
- hasIcon: o = !0,
501
- buttonText: t,
502
- title: i,
503
- description: d,
430
+ ), Pe = ({
431
+ drawerType: t,
432
+ isDashboard: o = !1,
433
+ hasIcon: n = !0,
434
+ buttonText: r,
435
+ title: s,
436
+ titleDrawer: i,
437
+ description: c,
504
438
  sx: l
505
439
  }) => {
506
- const [s, r] = C.useState(!1), { connect: a, finstrong: c } = S();
507
- return /* @__PURE__ */ u(
508
- J,
440
+ const [_, d] = m.useState(!1), { connect: u, finstrong: h } = x(), { config: y } = je();
441
+ return t && y.show_connections_widget_in_master ? /* @__PURE__ */ a(
442
+ Y,
509
443
  {
510
444
  sx: {
511
445
  pb: 24,
@@ -515,715 +449,2650 @@ const ut = ({ list: n, onClickItem: o }) => /* @__PURE__ */ e(x, { sx: { bgcolor
515
449
  ...l
516
450
  },
517
451
  children: [
518
- /* @__PURE__ */ u(
519
- g,
452
+ /* @__PURE__ */ a(
453
+ p,
520
454
  {
521
455
  sx: {
522
456
  gap: 8,
523
- ...n && { flexDirection: "row", alignItems: "center" }
457
+ ...o && { flexDirection: "row", alignItems: "center" }
524
458
  },
525
459
  children: [
526
- o && /* @__PURE__ */ e(me, { sx: { height: 20, width: 20 } }),
527
- /* @__PURE__ */ e(H, { className: "connect-more-accounts-title", sx: { ...n && { fontSize: 15 } }, children: i || c.connect_more_accounts_title })
460
+ n && /* @__PURE__ */ e(pt, { sx: { height: 20, width: 20 } }),
461
+ /* @__PURE__ */ e(V, { className: "connect-more-accounts-title", sx: { ...o && { fontSize: 15 } }, children: s || h.connect_more_accounts_title })
528
462
  ]
529
463
  }
530
464
  ),
531
465
  /* @__PURE__ */ e(
532
- y,
466
+ M,
533
467
  {
534
468
  className: "connect-more-accounts-description",
535
469
  sx: { color: "text.secondary", mt: 8 },
536
470
  variant: "subtitle1",
537
- children: d || c.connect_more_accounts_description
471
+ children: c || h.connect_more_accounts_description
538
472
  }
539
473
  ),
540
474
  /* @__PURE__ */ e(
541
- q,
475
+ B,
542
476
  {
543
- endIcon: /* @__PURE__ */ e(j, {}),
544
- onClick: () => r(!0),
477
+ endIcon: /* @__PURE__ */ e(Z, {}),
478
+ onClick: () => d(!0),
545
479
  size: "small",
546
480
  sx: { p: 0, mt: 8, "&:hover": { backgroundColor: "transparent" } },
547
- children: /* @__PURE__ */ e(W, { sx: { fontWeight: 600 }, variant: "body2", children: t || c.connect_more_accounts_button })
481
+ children: /* @__PURE__ */ e(I, { sx: { fontWeight: 600 }, variant: "body2", children: r || h.connect_more_accounts_button })
548
482
  }
549
483
  ),
550
- /* @__PURE__ */ e(
551
- xe,
484
+ t === "connectDrawer" && /* @__PURE__ */ e(
485
+ re,
486
+ {
487
+ onClose: () => d(!1),
488
+ showConnectWidget: _,
489
+ title: i || u.mini_title
490
+ }
491
+ ),
492
+ t === "connectionsDrawer" && /* @__PURE__ */ e(
493
+ Ct,
552
494
  {
553
- onClose: () => r(!1),
554
- showConnectWidget: s,
555
- title: a.mini_title
495
+ onClose: () => d(!1),
496
+ showConnectionsWidget: _,
497
+ title: i || u.mini_title
556
498
  }
557
499
  )
558
500
  ]
559
501
  }
560
- );
561
- }, St = I(() => {
562
- const n = G(), [o, { width: t }] = Ye(), { finstrong: i } = S(), { isCopyLoaded: d, isInitialized: l } = z(), { healthScore: s, healthScoreChange: r } = $(), a = n.palette.mode === "dark", c = ie(s?.health_score, i);
563
- return !d || !l ? /* @__PURE__ */ e(N, {}) : /* @__PURE__ */ u(J, { ref: o, sx: { p: 16 }, children: [
564
- /* @__PURE__ */ e(
565
- Ve,
566
- {
567
- action: /* @__PURE__ */ e(
568
- q,
569
- {
570
- endIcon: /* @__PURE__ */ e(j, {}),
571
- sx: {
572
- fontSize: 13,
573
- lineHeight: "16px",
574
- fontWeight: 600,
575
- color: "primary.main"
576
- },
577
- variant: "text",
578
- children: i.financial_strength_header_action
579
- }
580
- ),
581
- subheader: /* @__PURE__ */ e(H, { color: "text.primary", children: i.financial_strength_header }),
582
- sx: {
583
- p: 0,
584
- "& .MuiCardHeader-content": {
585
- overflow: "hidden"
586
- }
587
- }
588
- }
589
- ),
590
- /* @__PURE__ */ e(g, { sx: { justifyContent: "center", alignItems: "center" }, children: /* @__PURE__ */ e(
591
- ve,
592
- {
593
- arcRadius: t <= 323 ? 73 : 154,
594
- footerCenterContent: r,
595
- healthScore: s?.health_score || 0,
596
- size: t <= 323 ? "M" : "L"
597
- }
598
- ) }),
599
- s?.health_score ? /* @__PURE__ */ u(
600
- Xe,
601
- {
602
- sx: {
603
- px: 16,
604
- backgroundColor: a ? "grey.800" : "grey.50",
605
- //TODO: Need to change the background color to palette (supporting both darkmode and lightmode)
606
- "&.Mui-expanded": {
607
- m: 0
608
- },
609
- "&::before": {
610
- display: "none"
611
- }
612
- },
613
- children: [
614
- /* @__PURE__ */ e(
615
- Ue,
616
- {
617
- expandIcon: /* @__PURE__ */ e(Re, { size: 20 }),
618
- sx: {
619
- height: 52,
620
- p: 0,
621
- "&.Mui-expanded": {
622
- minHeight: 0
623
- }
624
- },
625
- children: /* @__PURE__ */ e(y, { sx: { fontWeight: 600 }, variant: "body1", children: i.accordion_title_text })
626
- }
627
- ),
628
- /* @__PURE__ */ e(je, { sx: { "&.MuiAccordionDetails-root": { padding: 0, pb: 16 } }, children: /* @__PURE__ */ e(y, { variant: "subtitle1", children: c.scoreContent }) })
629
- ]
630
- }
631
- ) : /* @__PURE__ */ e(
632
- Q,
633
- {
634
- buttonText: i.connect_more_accounts_title,
635
- description: i.health_score_zero_description,
636
- hasIcon: !1,
637
- isDashboard: !0,
638
- sx: {
639
- backgroundColor: a ? "grey.800" : "grey.50",
640
- //TODO: Need to change the background color to palette (supporting both darkmode and lightmode)
641
- ".connect-more-accounts-title": {
642
- fontWeight: 600,
643
- lineHeight: "20px",
644
- color: "text.primary"
645
- },
646
- ".connect-more-accounts-description": { color: "text.primary" }
647
- },
648
- title: i.health_score_zero_title
649
- }
650
- )
651
- ] });
652
- }), vt = ({ isOpen: n, onClose: o }) => {
653
- const { common: t, finstrong: i } = S(), { isMobile: d } = Ce(), { updateUser: l, user: s } = Y(), [r, a] = C.useState(s.credit_score || 0), c = !isNaN(r), p = () => {
654
- o(), setTimeout(() => a(s.credit_score || 0), 300);
502
+ ) : null;
503
+ };
504
+ var de = /* @__PURE__ */ ((t) => (t.SpendLessThanYouMake = "spendLessThanYouMake", t.PayBillsOnTime = "payBillsOnTime", t.SaveEnoughToLiveOn = "saveEnoughToLiveOn", t.MaintainEmergencySavings = "maintainEmergencySavings", t.HaveManageableDebt = "haveManageableDebt", t.HaveAGoodCreditScore = "haveAGoodCreditScore", t))(de || {});
505
+ const Oo = "https://content.moneydesktop.com/storage/MD_Assets/serenity/loading_animation_final.gif", Fo = ({ isOpen: t, onClose: o }) => {
506
+ const { common: n, finstrong: r } = x(), { isMobile: s } = qe(), { updateUser: i, user: c } = J(), [l, _] = m.useState(c.credit_score || 0), d = !isNaN(l), u = () => {
507
+ o(), setTimeout(() => _(c.credit_score || 0), 300);
655
508
  }, h = () => {
656
- !r || r === s.credit_score || l({ ...s, credit_score: r });
509
+ !l || l === c.credit_score || i({ ...c, credit_score: l });
657
510
  };
658
511
  return /* @__PURE__ */ e(
659
- Ze,
512
+ Wn,
660
513
  {
661
- copy: { close_aria: t.close_aria, title: i.edit_credit_score },
662
- disablePrimaryButton: !r || !c,
663
- isOpen: n,
514
+ copy: { close_aria: n.close_aria, title: r.edit_credit_score },
515
+ disablePrimaryButton: !l || !d,
516
+ isOpen: t,
664
517
  maxWidth: "xs",
665
- onClose: p,
518
+ onClose: u,
666
519
  onPrimaryAction: h,
667
520
  primaryColor: "primary",
668
- primaryText: t.save_button,
521
+ primaryText: n.save_button,
669
522
  sx: {
670
523
  "& .MuiDialog-paper": {
671
- minWidth: d ? "100%" : 400
524
+ minWidth: s ? "100%" : 400
672
525
  }
673
526
  },
674
527
  children: /* @__PURE__ */ e(
675
- Qe,
676
- {
677
- error: !c,
678
- fullWidth: !0,
679
- inputMode: "numeric",
680
- inputProps: {
681
- noValidate: !0,
682
- pattern: "[0-9]*"
683
- },
684
- onChange: (m) => a(Number(m.target.value)),
685
- value: c ? r : ""
686
- }
687
- )
688
- }
689
- );
690
- }, kt = I(vt), At = ({ isOpen: n, onClose: o }) => {
691
- const { finstrong: t } = S(), i = G(), { updateUser: d, user: l } = Y(), [s, r] = C.useState(l.birthday), a = (p) => {
692
- r(Math.floor(new Date(p).getTime() / 1e3));
693
- };
694
- return /* @__PURE__ */ e(
695
- V,
696
- {
697
- isOpen: n,
698
- onClose: o,
699
- onPrimaryAction: () => {
700
- !s || s === l.birthday || (d({ ...l, birthday: s }), o());
701
- },
702
- onSecondaryAction: o,
703
- title: t.date_of_birth,
704
- children: /* @__PURE__ */ e(ot, { dateAdapter: et, children: /* @__PURE__ */ e(
705
- tt,
528
+ "form",
706
529
  {
707
- disableFuture: !0,
708
- onChange: a,
709
- slotProps: {
710
- nextIconButton: {
711
- sx: {
712
- color: "primary.main",
713
- "&:hover": { bgcolor: te(i.palette.primary.light, 0.1) }
714
- }
715
- },
716
- previousIconButton: {
717
- sx: {
718
- color: "primary.main",
719
- "&:hover": { bgcolor: te(i.palette.primary.light, 0.1) }
720
- }
721
- }
722
- },
723
- slots: {
724
- actionBar: () => null,
725
- toolbar: () => null
530
+ onSubmit: (y) => {
531
+ y.preventDefault(), h(), u();
726
532
  },
727
- sx: {
728
- width: "100%",
729
- "& .MuiIconButton-edgeEnd": {
730
- color: "primary.main",
731
- "&:hover": { bgcolor: te(i.palette.primary.light, 0.1) }
533
+ children: /* @__PURE__ */ e(
534
+ Fe,
535
+ {
536
+ error: !d,
537
+ fullWidth: !0,
538
+ inputMode: "numeric",
539
+ inputProps: {
540
+ noValidate: !0,
541
+ pattern: "[0-9]*"
542
+ },
543
+ onChange: (y) => _(Number(y.target.value)),
544
+ value: d ? l : ""
732
545
  }
733
- },
734
- value: s ? new Date(s * 1e3) : /* @__PURE__ */ new Date()
546
+ )
735
547
  }
736
- ) })
548
+ )
737
549
  }
738
550
  );
739
- }, It = I(At), Ot = ({ value: n, completeCopy: o }) => /* @__PURE__ */ u(g, { sx: { gap: 8 }, children: [
740
- /* @__PURE__ */ e(g, { sx: { flexDirection: "row", gap: 4 }, children: Array.from({ length: 4 }).map((t, i) => /* @__PURE__ */ e(
741
- x,
742
- {
743
- sx: {
744
- bgcolor: i < n ? "primary.main" : "neutral.light",
745
- borderRadius: "24px",
746
- height: 4,
747
- width: "100%"
748
- }
551
+ }, Lt = v(Fo), ze = {
552
+ credit_over_time_title: "Your Credit Over Time",
553
+ credit_over_time_zero_state_desc: "Add your credit score to start building a full picture of your credit health."
554
+ }, Ro = ({ chartFor: t }) => {
555
+ const o = G(), n = o.palette.mode === "dark", { monthlySummaries: r } = L(), { user: s } = J(), { finstrong: i } = x(), [c, { width: l }] = vt(), _ = {
556
+ savingsOverTime: {
557
+ icon: /* @__PURE__ */ e(dt, { size: 48, sx: { marginBottom: 8 } }),
558
+ title: i.key_indicators_save.zero_state_title,
559
+ description: i.key_indicators_save.zero_state_description
749
560
  },
750
- i
751
- )) }),
752
- /* @__PURE__ */ u(W, { sx: { color: "text.secondary" }, variant: "body2", children: [
753
- n / 4 * 100,
754
- "% ",
755
- o
756
- ] })
757
- ] }), Dt = ({ isOpen: n, onClose: o }) => {
758
- const { visibleFinstrongAccounts: t } = fe(), { incomeBudget: i } = ye(), {
759
- accounts: d,
760
- common: l,
761
- finstrong: s
762
- } = S(), { user: r } = Y(), [a, c] = C.useState(null), h = [
763
- {
764
- dynamicCopy: s.add_profile_item,
765
- fallbackLabel: s.monthly_income,
766
- icon: /* @__PURE__ */ e(Fe, {}),
767
- key: A.MonthlyIncome,
768
- label: s.monthly_income,
769
- value: i
561
+ debtOverTime: {
562
+ icon: /* @__PURE__ */ e(_t, { size: 48, sx: { marginBottom: 8 } }),
563
+ title: "",
564
+ description: ""
770
565
  },
771
- {
772
- dynamicCopy: s.add_profile_item,
773
- fallbackLabel: s.date_of_birth,
774
- icon: /* @__PURE__ */ e(Pe, {}),
775
- key: A.DateOfBirth,
776
- label: s.date_of_birth,
777
- value: r.birthday
566
+ creditOverTime: {
567
+ icon: /* @__PURE__ */ e(He, { size: 48, sx: { marginBottom: 8 } }),
568
+ title: ze.credit_over_time_title,
569
+ description: ze.credit_over_time_zero_state_desc
570
+ }
571
+ }[t], u = {
572
+ savingsOverTime: {
573
+ title: i.key_indicators_save.savings_over_time,
574
+ valueKey: "available_cash"
778
575
  },
779
- {
780
- dynamicCopy: s.add_profile_item,
781
- fallbackLabel: s.credit_score,
782
- icon: /* @__PURE__ */ e(ue, {}),
783
- key: A.CreditScore,
784
- label: s.credit_score,
785
- value: r.credit_score
576
+ debtOverTime: {
577
+ title: i.key_indicators_borrow.have_manageable_debt_drawer.debt_over_time,
578
+ valueKey: "debt_balance"
786
579
  },
787
- {
788
- fallbackLabel: s.connect_your_accounts,
789
- icon: /* @__PURE__ */ e(me, {}),
790
- key: A.Connections,
791
- label: s.connections,
792
- value: t.length > 0 ? b(
793
- s.connected_account,
794
- String(t.length),
795
- t.length > 1 ? s.accounts : s.account
796
- ) : void 0
580
+ creditOverTime: {
581
+ title: ze.credit_over_time_title,
582
+ valueKey: "credit_score"
797
583
  }
798
- ].map((m) => bt(m));
799
- return /* @__PURE__ */ u(V, { isOpen: n, onClose: o, title: s.financial_profile, children: [
800
- /* @__PURE__ */ u(g, { sx: { gap: 20, p: 24 }, children: [
801
- /* @__PURE__ */ u(g, { sx: { gap: 8 }, children: [
802
- /* @__PURE__ */ e(H, { children: s.your_financial_profile }),
803
- /* @__PURE__ */ e(y, { children: s.financial_profile_description })
804
- ] }),
805
- /* @__PURE__ */ e(
806
- Ot,
807
- {
808
- completeCopy: s.complete,
809
- value: h.reduce((m, _) => m + (_.isComplete ? 1 : 0), 0)
810
- }
811
- )
812
- ] }),
813
- /* @__PURE__ */ e(ht, { list: h, onClickItem: c }),
814
- /* @__PURE__ */ e(x, { sx: { p: 24 }, children: /* @__PURE__ */ e(
815
- Q,
816
- {
817
- description: s.connect_more_accounts_to_view_more_accurate_financial_picture,
818
- isDashboard: !0,
819
- title: s.dont_see_all_your_accounts
820
- }
821
- ) }),
822
- /* @__PURE__ */ e(
823
- V,
824
- {
825
- isOpen: a === A.MonthlyIncome,
826
- onClose: () => c(null),
827
- title: l.settings,
828
- children: /* @__PURE__ */ e(Je, {})
829
- }
830
- ),
831
- /* @__PURE__ */ e(It, { isOpen: a === A.DateOfBirth, onClose: () => c(null) }),
832
- /* @__PURE__ */ e(kt, { isOpen: a === A.CreditScore, onClose: () => c(null) }),
584
+ }[t], h = Sn(r, u.valueKey), y = r.map((F) => F[u.valueKey]), f = Math.max(...y), w = Math.min(...y), C = () => f >= 1e6 ? { formatter: "0.000a", leftMargin: 55 } : f >= 1e3 ? { formatter: "0a", leftMargin: 35 } : { formatter: "0a", leftMargin: 30 }, { formatter: D, leftMargin: S } = C(), g = u.title, b = t === "creditOverTime";
585
+ let P;
586
+ if (b) {
587
+ const { color: F } = mt(
588
+ s?.credit_score ?? 0,
589
+ n,
590
+ i.credit_score_status
591
+ );
592
+ P = F;
593
+ }
594
+ return /* @__PURE__ */ e(Y, { ref: c, sx: { backgroundColor: "background.paper" }, children: h.length >= 1 ? /* @__PURE__ */ a(p, { gap: 8, sx: { pl: 18 }, children: [
595
+ /* @__PURE__ */ e(M, { sx: { pb: 8, pt: 16 }, variant: "h3", children: g }),
833
596
  /* @__PURE__ */ e(
834
- qe,
597
+ Ye,
835
598
  {
836
- onClose: () => c(null),
837
- showConnectionsWidget: a === A.Connections,
838
- title: d.manage_connections
599
+ areaColor: P,
600
+ axisColor: o.palette.divider,
601
+ baseline: "min",
602
+ chartFor: t,
603
+ colors: [o.palette.primary.main],
604
+ curveType: b ? "linear" : "natural",
605
+ datasets: h ? [h] : [],
606
+ height: 244,
607
+ labelFontColor: b ? "text.primary" : "",
608
+ labelFontSize: b ? 13 : void 0,
609
+ labels: [i.key_indicators_label],
610
+ margin: { left: S, top: b ? 25 : 15, right: 20 },
611
+ markStyles: (F) => b ? {
612
+ markLabelStyles: {
613
+ marginLeft: 16,
614
+ transform: F === h.length - 1 ? "translateX(-16px)" : "translateX(16px)",
615
+ fontWeight: 600,
616
+ fill: o.palette.text.primary
617
+ },
618
+ stroke: P
619
+ } : {},
620
+ maxRange: b ? 850 : void 0,
621
+ minRange: (() => {
622
+ if (b)
623
+ return w < 300 ? 0 : 300;
624
+ })(),
625
+ showArea: !0,
626
+ showAverage: !b,
627
+ showMark: !b,
628
+ showMarkLabel: b,
629
+ showXAxis: !0,
630
+ showYAxis: b,
631
+ showYAxisTicks: b,
632
+ useCustomMark: !0,
633
+ valueFormatterString: b ? void 0 : D,
634
+ width: l < 342 ? l - 48 : 342
839
635
  }
840
636
  )
637
+ ] }) : /* @__PURE__ */ a(p, { gap: 8, sx: { alignItems: "center", p: 24, pb: 48 }, children: [
638
+ _.icon,
639
+ /* @__PURE__ */ e(M, { fontWeight: 600, variant: "body1", children: _.title }),
640
+ /* @__PURE__ */ e(M, { align: "center", variant: "subtitle1", children: _.description })
641
+ ] }) });
642
+ }, Ue = v(Ro), Lo = () => {
643
+ const { healthScoreChange: t } = L(), { finstrong: o } = x(), { user: n } = J(), { availableWidth: r } = Fn(), { isSmallMobile: s } = qe(r), [i, c] = m.useState(!1);
644
+ return /* @__PURE__ */ a(k, { children: [
645
+ /* @__PURE__ */ a(p, { sx: { gap: 28 }, children: [
646
+ /* @__PURE__ */ e(
647
+ To,
648
+ {
649
+ arcRadius: s ? 124 : 154,
650
+ footerCenterContent: t,
651
+ healthScore: n.credit_score ?? 0,
652
+ size: s ? "M" : "L"
653
+ }
654
+ ),
655
+ /* @__PURE__ */ e(B, { onClick: () => c(!0), variant: "contained", children: o.credit_score_updated_score }),
656
+ /* @__PURE__ */ e(Ue, { chartFor: "creditOverTime" })
657
+ ] }),
658
+ /* @__PURE__ */ e(Lt, { isOpen: i, onClose: () => c(!1) })
841
659
  ] });
842
- }, Mt = I(Dt), X = {
843
- creditScore: {
844
- poor: 600,
845
- good: 720
846
- },
847
- daysOfCashOnHand: {
848
- poor: 30,
849
- good: 90
850
- },
851
- debtToIncomeRatio: {
852
- poor: 40,
853
- good: 30
854
- },
855
- emergencySavings: {
856
- poor: 750,
857
- good: 1e3
858
- },
859
- spendToIncomeRatio: {
860
- poor: 110,
861
- good: 100
862
- }
863
- }, f = {
864
- GOOD: "Good",
865
- FAIR: "Fair",
866
- OFF_TRACK: "Off Track",
867
- MISSING: "Missing"
868
- }, B = ({
869
- title: n,
870
- description: o,
871
- cardState: t = f.MISSING,
872
- stateTitle: i
873
- }) => {
874
- const d = {
875
- [f.GOOD]: { backgroundColor: "success.lighter", color: "success.main" },
876
- [f.FAIR]: { backgroundColor: "warning.lighter", color: "warning.main" },
877
- [f.OFF_TRACK]: { backgroundColor: "error.lighter", color: "error.main" },
878
- [f.MISSING]: { backgroundColor: "divider", color: "text.secondary" }
660
+ }, Po = v(Lo), Be = ({ status: t }) => {
661
+ const { finstrong: o } = x(), n = vn(wn[t]), r = {
662
+ GOOD: o.key_indicators_good,
663
+ FAIR: o.key_indicators_fair,
664
+ OFF_TRACK: o.key_indicators_off_track,
665
+ MISSING: o.key_indicators_missing
879
666
  }[t];
880
- return /* @__PURE__ */ u(
881
- g,
667
+ return /* @__PURE__ */ e(
668
+ Gn,
882
669
  {
883
- alignItems: "center",
884
- flexDirection: "row",
885
- gap: 12,
886
- justifyContent: "space-between",
670
+ label: /* @__PURE__ */ e(
671
+ M,
672
+ {
673
+ fontWeight: 700,
674
+ sx: { color: n.color, minHeight: 12 },
675
+ uppercase: !0,
676
+ variant: "tiny",
677
+ children: r
678
+ }
679
+ ),
680
+ size: "small",
887
681
  sx: {
888
- p: 16,
889
- border: "1px solid",
890
- borderColor: "divider",
891
- borderRadius: 2
682
+ bgcolor: n.backgroundColor,
683
+ height: 16
892
684
  },
893
- children: [
894
- /* @__PURE__ */ u(x, { sx: { minHeight: 48 }, children: [
895
- /* @__PURE__ */ u(g, { flexDirection: "row", gap: 4, children: [
896
- /* @__PURE__ */ e(y, { fontWeight: 600, sx: { mb: 8 }, truncate: !0, variant: "body1", children: n }),
897
- /* @__PURE__ */ e(
898
- x,
899
- {
900
- sx: {
901
- borderRadius: 3,
902
- backgroundColor: d.backgroundColor,
903
- px: 8,
904
- py: 2,
905
- height: 16
906
- },
907
- children: /* @__PURE__ */ e(y, { fontWeight: 700, sx: { minHeight: 12 }, uppercase: !0, variant: "tiny", children: i })
908
- }
909
- )
910
- ] }),
911
- /* @__PURE__ */ e(y, { color: "secondary", variant: "subtitle2", children: o })
912
- ] }),
913
- /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(he, { color: "secondary", name: "chevron_right", size: 24 }) })
914
- ]
685
+ variant: "filled"
915
686
  }
916
687
  );
917
- }, Tt = () => {
918
- const { healthScore: n } = $(), { finstrong: o } = S(), { key_indicators_spend: t } = o, i = (r) => {
919
- const { good: a, poor: c } = X.spendToIncomeRatio;
920
- let p = f.MISSING, h = t.ratio_missing_description, m = o.key_indicators_missing;
921
- return r !== null && (r < a ? (p = f.GOOD, h = b(t.ratio_good_description, r), m = o.key_indicators_good) : r >= a && r < c ? (p = f.FAIR, h = b(t.ratio_fair_description, r), m = o.key_indicators_fair) : r >= c && (p = f.OFF_TRACK, h = b(t.ratio_off_track_description, r), m = o.key_indicators_off_track)), {
922
- cardState: p,
923
- description: h,
924
- title: t.ratio_card_title,
925
- stateTitle: m
926
- };
927
- }, d = (r) => {
928
- let a = f.MISSING, c = t.count_missing_description, p = o.key_indicators_missing;
929
- return r !== null && (r === 0 ? (a = f.GOOD, c = t.count_good_description, p = o.key_indicators_good) : r >= 1 && (a = f.OFF_TRACK, c = t.count_off_track_description, p = o.key_indicators_off_track)), {
930
- cardState: a,
931
- description: c,
932
- title: t.count_card_title,
933
- stateTitle: p
934
- };
935
- }, { spendToIncomeRatio: l, spendFeeCount: s } = C.useMemo(() => {
936
- const r = n.spend_to_income_ratio !== null ? Math.round(n.spend_to_income_ratio * 100) : null, a = i(r), c = d(n.spending_fee_transaction_count);
937
- return { spendToIncomeRatio: a, spendFeeCount: c };
938
- }, [
939
- n.spend_to_income_ratio,
940
- n.spending_fee_transaction_count,
941
- t,
942
- o
943
- ]);
944
- return /* @__PURE__ */ u(g, { direction: "column", gap: 24, sx: { p: 8, pt: 24 }, children: [
945
- /* @__PURE__ */ e(
946
- B,
688
+ }, Bo = () => {
689
+ const { finstrong: t } = x(), { user: o } = J(), n = gt(o.credit_score ?? null);
690
+ return /* @__PURE__ */ a(p, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: [
691
+ /* @__PURE__ */ e(V, { children: t.credit_score_keep_strong_credit_score }),
692
+ /* @__PURE__ */ e(Be, { status: n })
693
+ ] });
694
+ }, Wo = v(Bo), $o = ({
695
+ additionalContent: t,
696
+ connectTitle: o,
697
+ connectDescription: n,
698
+ children: r,
699
+ description: s,
700
+ drawerTitle: i,
701
+ isOpen: c,
702
+ loadConnectAccountsCard: l = !0,
703
+ onClose: _,
704
+ stickyComponent: d,
705
+ title: u,
706
+ drawerType: h
707
+ }) => {
708
+ const { finstrong: y } = x(), { isCopyLoaded: f } = q();
709
+ return f ? /* @__PURE__ */ e(oe, { isOpen: c, onClose: _, title: i || y.key_indicators, children: /* @__PURE__ */ a(p, { sx: { backgroundColor: "background.default", height: "100%" }, children: [
710
+ (u || s) && /* @__PURE__ */ a(
711
+ p,
947
712
  {
948
- cardState: l.cardState,
949
- description: l.description,
950
- stateTitle: l.stateTitle,
951
- title: l.title
713
+ sx: {
714
+ backgroundColor: "background.paper",
715
+ gap: 8,
716
+ p: 24
717
+ },
718
+ children: [
719
+ u && typeof u == "string" ? /* @__PURE__ */ e(V, { children: u }) : u,
720
+ s && /* @__PURE__ */ e(M, { sx: { lineHeight: "24px" }, children: s })
721
+ ]
952
722
  }
953
723
  ),
954
- /* @__PURE__ */ e(
955
- B,
724
+ d && /* @__PURE__ */ e(
725
+ k,
956
726
  {
957
- cardState: s.cardState,
727
+ sx: {
728
+ position: "sticky",
729
+ top: 0,
730
+ zIndex: 1
731
+ },
732
+ children: d
733
+ }
734
+ ),
735
+ t && /* @__PURE__ */ e(k, { children: t }),
736
+ /* @__PURE__ */ a(p, { sx: { bgcolor: "background.default", gap: 24, p: 24 }, children: [
737
+ r,
738
+ l && /* @__PURE__ */ e(
739
+ Pe,
740
+ {
741
+ description: n,
742
+ drawerType: h,
743
+ isDashboard: !0,
744
+ sx: { backgroundColor: "background.paper" },
745
+ title: o
746
+ }
747
+ )
748
+ ] })
749
+ ] }) }) : /* @__PURE__ */ e(ee, {});
750
+ }, Pt = v($o), zo = ({
751
+ onClick: t,
752
+ shouldShowBalance: o = !0,
753
+ loadAccounts: n
754
+ }) => {
755
+ const { config: r } = je(), { accounts: s } = x(), { selectedAccounts: i } = q(), c = m.useCallback(
756
+ (_) => {
757
+ t?.(_);
758
+ },
759
+ [t]
760
+ ), l = m.useMemo(
761
+ () => Array.from(new Set(i.map((_) => _.account_type))).filter(
762
+ (_) => n ? n.includes(_) : !0
763
+ ),
764
+ [i, n]
765
+ );
766
+ return i.length ? /* @__PURE__ */ e(m.Fragment, { children: l.map((_) => {
767
+ const { accountsForType: d, totalBalanceForType: u } = i.reduce(
768
+ (h, y) => (y.account_type === _ && (h.accountsForType.push(y), h.totalBalanceForType += y.balance || 0), h),
769
+ { accountsForType: [], totalBalanceForType: 0 }
770
+ );
771
+ return /* @__PURE__ */ a(
772
+ Ee,
773
+ {
774
+ subheader: /* @__PURE__ */ e(Hn, { sx: { pb: 4, position: "static", pt: 12, px: 24 }, children: /* @__PURE__ */ a(p, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: [
775
+ /* @__PURE__ */ e(I, { bold: !0, variant: "caption", children: s.account_types[_] }),
776
+ o && /* @__PURE__ */ e(I, { bold: !0, variant: "caption", children: $(u, "0,0.00") })
777
+ ] }) }),
778
+ sx: { bgcolor: "background.paper" },
779
+ children: [
780
+ d.map((h, y) => {
781
+ const { firstValue: f } = kt(h, s), w = St(h, {
782
+ allowNickname: r?.show_account_nicknames_in_master
783
+ }), C = /* @__PURE__ */ a(z, { children: [
784
+ /* @__PURE__ */ e(wt, { children: /* @__PURE__ */ e(ut, { alt: "MX", institutionGuid: h.institution_guid ?? "" }) }),
785
+ /* @__PURE__ */ e(
786
+ ye,
787
+ {
788
+ primary: `${w}${h.account_number ? ` *${h.account_number}` : ""}`,
789
+ primaryTypographyProps: { noWrap: !0, pr: 4, variant: "body1" }
790
+ }
791
+ ),
792
+ o && /* @__PURE__ */ e(M, { bold: !0, variant: "body2", children: $(f ?? 0, "0,0.00") })
793
+ ] });
794
+ return /* @__PURE__ */ a(m.Fragment, { children: [
795
+ /* @__PURE__ */ e(ge, { sx: { px: t ? 0 : 24 }, children: t ? /* @__PURE__ */ e(En, { onClick: () => c(h), children: C }) : C }),
796
+ y !== d.length - 1 && /* @__PURE__ */ e(le, { variant: "inset" })
797
+ ] }, h.guid);
798
+ }),
799
+ /* @__PURE__ */ e(le, {})
800
+ ]
801
+ },
802
+ _
803
+ );
804
+ }) }) : null;
805
+ }, Bt = v(zo), Go = ({ loadAccounts: t, loadMoreLabel: o }) => {
806
+ const n = G(), { config: r } = je(), { connect: s, finstrong: i } = x(), { accounts: c } = x(), { selectedAccounts: l } = q(), [_, d] = m.useState(!1), [u, h] = m.useState(!1), y = m.useMemo(
807
+ () => l.filter(
808
+ (C) => t ? t.includes(C.account_type) : !0
809
+ ),
810
+ [l, t]
811
+ ), f = m.useMemo(() => y.slice(0, 3), [y]), w = (C) => {
812
+ const { firstValue: D } = kt(C, c);
813
+ return D;
814
+ };
815
+ return y.length >= 1 ? /* @__PURE__ */ a(z, { children: [
816
+ /* @__PURE__ */ e(k, { sx: { border: `1px solid ${n.palette.divider}`, borderRadius: 2 }, children: f.map((C, D) => /* @__PURE__ */ a(m.Fragment, { children: [
817
+ /* @__PURE__ */ a(ge, { sx: { px: 24 }, children: [
818
+ /* @__PURE__ */ e(wt, { children: /* @__PURE__ */ e(ut, { alt: "MX", institutionGuid: C.institution_guid ?? "" }) }),
819
+ /* @__PURE__ */ e(
820
+ ye,
821
+ {
822
+ primary: `${St(C, {
823
+ allowNickname: r?.show_account_nicknames_in_master
824
+ })}
825
+ ${C.account_number ? ` *${C.account_number}` : ""}`,
826
+ primaryTypographyProps: { noWrap: !0, pr: 4, variant: "body1" }
827
+ }
828
+ ),
829
+ /* @__PURE__ */ e(M, { bold: !0, variant: "body2", children: $(w(C), "0,0.00") })
830
+ ] }),
831
+ D < f.length - 1 && /* @__PURE__ */ e(le, { variant: "inset" })
832
+ ] }, C.guid)) }),
833
+ y.length > 3 && /* @__PURE__ */ a(z, { children: [
834
+ /* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(
835
+ B,
836
+ {
837
+ endIcon: /* @__PURE__ */ e(Z, {}),
838
+ onClick: () => d(!0),
839
+ size: "small",
840
+ sx: { my: 0, px: 16, py: 12, width: "100%" },
841
+ children: /* @__PURE__ */ a(I, { bold: !0, variant: "body1", children: [
842
+ y.length - 3,
843
+ " ",
844
+ o
845
+ ] })
846
+ }
847
+ ) }),
848
+ /* @__PURE__ */ e(oe, { isOpen: _, onClose: () => d(!1), title: i.accounts, children: /* @__PURE__ */ e(Bt, { loadAccounts: t }) })
849
+ ] })
850
+ ] }) : /* @__PURE__ */ a(z, { children: [
851
+ /* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(
852
+ B,
853
+ {
854
+ onClick: () => h(!0),
855
+ size: "small",
856
+ sx: { my: 0, px: 16, py: 12, width: "100%" },
857
+ variant: "contained",
858
+ children: /* @__PURE__ */ e(I, { bold: !0, variant: "body1", children: i.connect_more_accounts_button })
859
+ }
860
+ ) }),
861
+ /* @__PURE__ */ e(
862
+ re,
863
+ {
864
+ onClose: () => h(!1),
865
+ showConnectWidget: u,
866
+ title: s.mini_title
867
+ }
868
+ )
869
+ ] });
870
+ }, Wt = v(Go), Ce = ({ balance: t, title: o, sx: n }) => /* @__PURE__ */ a(
871
+ p,
872
+ {
873
+ sx: {
874
+ alignItems: "center",
875
+ backgroundColor: "background.default",
876
+ borderRadius: 2,
877
+ height: 72,
878
+ justifyContent: "center",
879
+ p: 12,
880
+ ...n
881
+ },
882
+ children: [
883
+ typeof t == "number" ? /* @__PURE__ */ e(M, { variant: "h2", children: $(t, "0,0.00") }) : t,
884
+ /* @__PURE__ */ e(M, { color: "text.secondary", fontWeight: "400", variant: "subtitle2", children: o })
885
+ ]
886
+ }
887
+ );
888
+ var T = /* @__PURE__ */ ((t) => (t[t.ConnectAccounts = 1] = "ConnectAccounts", t[t.MonthlyIncome = 2] = "MonthlyIncome", t[t.Birthday = 3] = "Birthday", t[t.CreditScore = 4] = "CreditScore", t))(T || {}), De = /* @__PURE__ */ ((t) => (t[t.Months = 1] = "Months", t[t.Years = 2] = "Years", t[t.Days = 3] = "Days", t))(De || {}), Q = /* @__PURE__ */ ((t) => (t[t.Monthly = 1] = "Monthly", t[t.BiWeekly = 2] = "BiWeekly", t[t.Weekly = 3] = "Weekly", t[t.Daily = 4] = "Daily", t))(Q || {});
889
+ const Eo = ({ total: t }) => {
890
+ const { finstrong: o } = x(), n = [
891
+ { id: Q.Monthly, label: o.maintain_emergency_savings_monthly },
892
+ { id: Q.BiWeekly, label: o.maintain_emergency_savings_bi_weekly },
893
+ { id: Q.Weekly, label: o.maintain_emergency_savings_weekly },
894
+ { id: Q.Daily, label: o.maintain_emergency_savings_daily }
895
+ ], r = {
896
+ [Q.Monthly]: o.maintain_emergency_savings_estimated_period_monthly,
897
+ [Q.BiWeekly]: o.maintain_emergency_savings_estimated_period_bi_weekly,
898
+ [Q.Weekly]: o.maintain_emergency_savings_estimated_period_weekly,
899
+ [Q.Daily]: o.maintain_emergency_savings_estimated_period_daily
900
+ }, s = [
901
+ { id: De.Months, label: o.maintain_emergency_savings_months },
902
+ { id: De.Years, label: o.maintain_emergency_savings_years },
903
+ { id: De.Days, label: o.maintain_emergency_savings_days }
904
+ ], i = Math.ceil((t + 1) / 1e3) * 1e3, [c, l] = m.useState(0), [_, d] = m.useState(tt(t)), [u, h] = m.useState(
905
+ tt(t)
906
+ ), [y, f] = m.useState(i), [w, C] = m.useState(kn(t)), [D, S] = m.useState(De.Months);
907
+ m.useEffect(() => {
908
+ l(
909
+ nt({
910
+ contribution: u,
911
+ goalAmount: y,
912
+ goalPeriod: w,
913
+ targetPeriod: D,
914
+ totalSaved: t
915
+ })
916
+ ), d(u);
917
+ }, []);
918
+ const g = (b) => {
919
+ b.preventDefault(), l(
920
+ nt({
921
+ contribution: u,
922
+ goalAmount: y,
923
+ goalPeriod: w,
924
+ targetPeriod: D,
925
+ totalSaved: t
926
+ })
927
+ ), d(u);
928
+ };
929
+ return /* @__PURE__ */ e(Y, { children: /* @__PURE__ */ e("form", { onSubmit: g, children: /* @__PURE__ */ a(p, { sx: { gap: 24, pb: 24, pt: 16, px: 16 }, children: [
930
+ /* @__PURE__ */ e(
931
+ Ce,
932
+ {
933
+ balance: /* @__PURE__ */ a(p, { sx: { flexDirection: "row", height: 32 }, children: [
934
+ /* @__PURE__ */ e(I, { variant: "h2", children: $(c, "0,0") }),
935
+ /* @__PURE__ */ a(I, { sx: { alignSelf: "end", height: 24 }, variant: "subtitle2", children: [
936
+ "/",
937
+ r[_]
938
+ ] })
939
+ ] }),
940
+ title: o.maintain_emergency_savings_estimated_contribution
941
+ }
942
+ ),
943
+ /* @__PURE__ */ e(
944
+ Fe,
945
+ {
946
+ "aria-label": o.maintain_emergency_savings_savings_goal,
947
+ helperText: K(
948
+ o.maintain_emergency_savings_suggested_goal,
949
+ $(i, "0,0")
950
+ ),
951
+ inputProps: {
952
+ noValidate: !0,
953
+ pattern: "[0-9]*"
954
+ },
955
+ label: o.maintain_emergency_savings_savings_goal,
956
+ onChange: (b) => {
957
+ b.target.value && f(Number(b.target.value.replace(/[^0-9]/g, "")));
958
+ },
959
+ value: y ? $(y, "0,0") : ""
960
+ }
961
+ ),
962
+ /* @__PURE__ */ e(
963
+ rt,
964
+ {
965
+ label: o.maintain_emergency_savings_how_often_contribute,
966
+ onChange: h,
967
+ options: n,
968
+ required: !0,
969
+ value: u
970
+ }
971
+ ),
972
+ /* @__PURE__ */ a(p, { sx: { flexDirection: "row" }, children: [
973
+ /* @__PURE__ */ e(
974
+ Fe,
975
+ {
976
+ "aria-label": o.maintain_emergency_savings_meet_your_goal_within,
977
+ fullWidth: !0,
978
+ inputProps: {
979
+ noValidate: !0,
980
+ pattern: "[0-9]*"
981
+ },
982
+ label: o.maintain_emergency_savings_meet_your_goal_within,
983
+ onChange: (b) => {
984
+ isNaN(Number(b.target.value)) || C(Number(b.target.value));
985
+ },
986
+ sx: {
987
+ "& .MuiInputBase-root": {
988
+ borderBottomRightRadius: 0,
989
+ borderTopRightRadius: 0,
990
+ fieldset: {
991
+ borderRightWidth: 0.5
992
+ }
993
+ }
994
+ },
995
+ value: w
996
+ }
997
+ ),
998
+ /* @__PURE__ */ e(
999
+ k,
1000
+ {
1001
+ sx: {
1002
+ "& .MuiInputBase-root": {
1003
+ borderBottomLeftRadius: 0,
1004
+ borderTopLeftRadius: 0,
1005
+ fieldset: {
1006
+ borderLeftWidth: 0.5
1007
+ }
1008
+ }
1009
+ },
1010
+ children: /* @__PURE__ */ e(rt, { label: "", onChange: S, options: s, value: D })
1011
+ }
1012
+ )
1013
+ ] }),
1014
+ /* @__PURE__ */ e(B, { fullWidth: !0, onClick: g, type: "submit", variant: "contained", children: o.maintain_emergency_savings_calculate })
1015
+ ] }) }) });
1016
+ }, Ho = v(Eo), No = () => {
1017
+ const { savingsAccounts: t } = xe(), { finstrong: o } = x(), [n, r] = m.useState(!1), s = m.useMemo(
1018
+ () => t.reduce((i, c) => i + (c.balance ?? 0), 0),
1019
+ [t]
1020
+ );
1021
+ return /* @__PURE__ */ a(p, { sx: { gap: 24 }, children: [
1022
+ /* @__PURE__ */ e(Y, { sx: { bgcolor: "background.paper", p: 16 }, children: /* @__PURE__ */ a(p, { sx: { gap: 16 }, children: [
1023
+ /* @__PURE__ */ e(Ce, { balance: s, title: o.maintain_emergency_savings_your_savings }),
1024
+ t.length ? /* @__PURE__ */ e(
1025
+ Wt,
1026
+ {
1027
+ loadAccounts: [Ge.SAVINGS],
1028
+ loadMoreLabel: o.connect_more_accounts_button
1029
+ }
1030
+ ) : /* @__PURE__ */ e(B, { onClick: () => r(!0), variant: "contained", children: o.connect_more_accounts_button })
1031
+ ] }) }),
1032
+ /* @__PURE__ */ e(Ho, { total: s }),
1033
+ /* @__PURE__ */ e(
1034
+ re,
1035
+ {
1036
+ onClose: () => r(!1),
1037
+ showConnectWidget: n,
1038
+ title: o.connect_more_accounts_button
1039
+ }
1040
+ )
1041
+ ] });
1042
+ }, jo = v(No), We = v(
1043
+ ({ label: t, value: o, status: n, bottomComponent: r, statusBarData: s = [] }) => {
1044
+ const i = {
1045
+ GOOD: {
1046
+ progressBarColor: "primary.main"
1047
+ },
1048
+ FAIR: {
1049
+ progressBarColor: "warning.main"
1050
+ },
1051
+ OFF_TRACK: {
1052
+ progressBarColor: "error.main"
1053
+ },
1054
+ MISSING: {
1055
+ progressBarColor: "text.secondary"
1056
+ }
1057
+ }[n], c = s.map((l, _) => s.length === 2 ? {
1058
+ color: _ === 0 ? "primary.main" : l.color || i?.progressBarColor,
1059
+ percentage: l.percentage
1060
+ } : {
1061
+ color: l.color || i?.progressBarColor,
1062
+ percentage: l.percentage
1063
+ });
1064
+ return /* @__PURE__ */ a(
1065
+ p,
1066
+ {
1067
+ sx: {
1068
+ backgroundColor: "background.paper",
1069
+ gap: 8,
1070
+ p: 24,
1071
+ pt: 0,
1072
+ borderBottom: "1px solid",
1073
+ borderColor: "divider"
1074
+ },
1075
+ children: [
1076
+ /* @__PURE__ */ a(p, { sx: { gap: 2 }, children: [
1077
+ /* @__PURE__ */ e(I, { variant: "body2", children: t }),
1078
+ /* @__PURE__ */ a(
1079
+ p,
1080
+ {
1081
+ sx: {
1082
+ alignItems: "center",
1083
+ flexDirection: "row",
1084
+ gap: 12,
1085
+ justifyContent: "space-between"
1086
+ },
1087
+ children: [
1088
+ /* @__PURE__ */ e(Le, { children: o }),
1089
+ /* @__PURE__ */ e(Be, { status: n })
1090
+ ]
1091
+ }
1092
+ )
1093
+ ] }),
1094
+ /* @__PURE__ */ a(p, { children: [
1095
+ /* @__PURE__ */ e(jn, { data: c, height: 16 }),
1096
+ r
1097
+ ] })
1098
+ ]
1099
+ }
1100
+ );
1101
+ }
1102
+ ), Ko = {
1103
+ sticky_label: "You have saved"
1104
+ }, Vo = ["$0", "$250", "$500", "$750", "$1k"], Yo = () => {
1105
+ const { healthScore: t } = L(), o = Math.round(t.emergency_savings_on_hand ?? NaN) || null, n = Mn(o), r = yt(o);
1106
+ return /* @__PURE__ */ e(
1107
+ We,
1108
+ {
1109
+ bottomComponent: /* @__PURE__ */ e(p, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: Vo.map((s) => /* @__PURE__ */ a(p, { sx: { alignItems: "center", height: 24, width: 30 }, children: [
1110
+ /* @__PURE__ */ e(
1111
+ le,
1112
+ {
1113
+ orientation: "vertical",
1114
+ sx: {
1115
+ borderWidth: 0.5,
1116
+ height: 8,
1117
+ mt: 2
1118
+ }
1119
+ }
1120
+ ),
1121
+ /* @__PURE__ */ e(I, { variant: "caption", children: s })
1122
+ ] }, s)) }),
1123
+ label: Ko.sticky_label,
1124
+ status: r,
1125
+ statusBarData: [
1126
+ {
1127
+ percentage: n
1128
+ }
1129
+ ],
1130
+ value: $(o ?? 0, "0,0.00")
1131
+ }
1132
+ );
1133
+ }, Xo = v(Yo), $e = ({
1134
+ transactions: t = [],
1135
+ amountColor: o = "success.main",
1136
+ amountPosition: n = "center",
1137
+ formatDate: r = It,
1138
+ secondaryIcon: s
1139
+ }) => {
1140
+ const i = G(), { connect: c, finstrong: l, categories: _ } = x(), [d, u] = m.useState(!1), [h, y] = m.useState(!1), { getCategoryName: f } = Ke(), w = 3, C = t.length > w, D = t.length - w;
1141
+ let S = t;
1142
+ return C && (S = t.map((g) => ({
1143
+ ...g,
1144
+ category: _.default_categories[g.top_level_category_guid]?.replace(
1145
+ /&amp;/g,
1146
+ "&"
1147
+ ) ?? f(g.top_level_category_guid)
1148
+ })).sort((g, b) => b.date - g.date)), !t || t.length === 0 ? /* @__PURE__ */ a(z, { children: [
1149
+ /* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(
1150
+ B,
1151
+ {
1152
+ onClick: () => y(!0),
1153
+ size: "small",
1154
+ sx: { my: 0, px: 16, py: 12, width: "100%" },
1155
+ variant: "contained",
1156
+ children: /* @__PURE__ */ e(I, { bold: !0, variant: "body1", children: l.connect_more_accounts_button })
1157
+ }
1158
+ ) }),
1159
+ /* @__PURE__ */ e(
1160
+ re,
1161
+ {
1162
+ onClose: () => y(!1),
1163
+ showConnectWidget: h,
1164
+ title: c.mini_title
1165
+ }
1166
+ )
1167
+ ] }) : /* @__PURE__ */ a(p, { sx: { gap: 16 }, children: [
1168
+ /* @__PURE__ */ e(k, { sx: { border: `1px solid ${i.palette.divider}`, borderRadius: 2 }, children: t.slice(0, w).sort((g, b) => b.date - g.date).map((g, b) => /* @__PURE__ */ a(
1169
+ p,
1170
+ {
1171
+ sx: {
1172
+ alignItems: "center",
1173
+ flexDirection: "row",
1174
+ gap: 16,
1175
+ pl: 24,
1176
+ pt: 14
1177
+ },
1178
+ children: [
1179
+ /* @__PURE__ */ e(p, { sx: { pb: 14 }, children: /* @__PURE__ */ e(
1180
+ yn,
1181
+ {
1182
+ categoryGuid: g.top_level_category_guid || "",
1183
+ merchantGuid: g.merchant_guid || "",
1184
+ size: 32
1185
+ }
1186
+ ) }),
1187
+ /* @__PURE__ */ a(
1188
+ p,
1189
+ {
1190
+ sx: {
1191
+ alignItems: n,
1192
+ flexDirection: "row",
1193
+ gap: 12,
1194
+ justifyContent: "space-between",
1195
+ ...b < Math.min(t.length, w) - 1 && {
1196
+ borderBottom: `1px solid ${i.palette.divider}`
1197
+ },
1198
+ pb: 14,
1199
+ pr: 24,
1200
+ width: "100%"
1201
+ },
1202
+ children: [
1203
+ /* @__PURE__ */ a(p, { sx: { gap: 4 }, children: [
1204
+ /* @__PURE__ */ e(M, { bold: !0, variant: "body1", children: g.description }),
1205
+ /* @__PURE__ */ a(p, { sx: { flexDirection: "row", alignItems: "center", gap: 4 }, children: [
1206
+ !!s && s,
1207
+ /* @__PURE__ */ e(I, { variant: "caption", children: r(g.date) })
1208
+ ] })
1209
+ ] }),
1210
+ /* @__PURE__ */ e(M, { bold: !0, sx: { color: o, flexShrink: 0 }, variant: "body1", children: $(g.amount, "0,0.00") })
1211
+ ]
1212
+ },
1213
+ g.guid || b
1214
+ )
1215
+ ]
1216
+ },
1217
+ b
1218
+ )) }),
1219
+ C && /* @__PURE__ */ a(z, { children: [
1220
+ /* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(
1221
+ B,
1222
+ {
1223
+ endIcon: /* @__PURE__ */ e(Z, {}),
1224
+ onClick: () => u(!0),
1225
+ size: "small",
1226
+ sx: { my: 0, px: 16, py: 12, width: "100%" },
1227
+ children: /* @__PURE__ */ a(I, { bold: !0, variant: "body1", children: [
1228
+ D,
1229
+ " ",
1230
+ l.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_more_transactions
1231
+ ] })
1232
+ }
1233
+ ) }),
1234
+ /* @__PURE__ */ e(
1235
+ oe,
1236
+ {
1237
+ isOpen: d,
1238
+ onClose: () => u(!1),
1239
+ title: l.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_transactions,
1240
+ children: /* @__PURE__ */ e(Kn, { transaction: S })
1241
+ }
1242
+ )
1243
+ ] })
1244
+ ] });
1245
+ }, qo = () => {
1246
+ const {
1247
+ finstrong: {
1248
+ key_indicators_spend: { pay_bills_on_time_drawer: t }
1249
+ }
1250
+ } = x(), { getSpendingFeeTransactions: o, allTransactions: n } = L();
1251
+ return m.useEffect(() => {
1252
+ o().finally();
1253
+ }, []), /* @__PURE__ */ e(z, { children: n.spendingFee.length === 0 ? /* @__PURE__ */ a(
1254
+ Y,
1255
+ {
1256
+ sx: {
1257
+ backgroundColor: "background.paper",
1258
+ pb: 48,
1259
+ pt: 32,
1260
+ px: 24,
1261
+ textAlign: "center",
1262
+ width: "100%"
1263
+ },
1264
+ children: [
1265
+ /* @__PURE__ */ e(ln, { filled: !0, size: 48, sx: { color: "success.main" } }),
1266
+ /* @__PURE__ */ a(p, { sx: { alignItems: "center", gap: 4, pt: 24 }, children: [
1267
+ /* @__PURE__ */ e(V, { children: t.pay_bills_on_time_zero_fees_title }),
1268
+ /* @__PURE__ */ e(M, { variant: "subtitle1", children: t.pay_bills_on_time_zero_fees_description })
1269
+ ] })
1270
+ ]
1271
+ }
1272
+ ) : /* @__PURE__ */ a(
1273
+ Y,
1274
+ {
1275
+ sx: {
1276
+ p: 16,
1277
+ width: "100%",
1278
+ backgroundColor: "background.paper"
1279
+ },
1280
+ children: [
1281
+ /* @__PURE__ */ e(V, { sx: { textAlign: "left", pb: 8 }, children: t.pay_bills_on_time_sticky_fee_count }),
1282
+ /* @__PURE__ */ e(
1283
+ $e,
1284
+ {
1285
+ amountColor: "text.primary",
1286
+ amountPosition: "flex-start",
1287
+ formatDate: (r) => $n(new Date(r * 1e3), zn.MONTH_DAY),
1288
+ secondaryIcon: /* @__PURE__ */ e(dn, { color: "error", filled: !0, size: 12 }),
1289
+ transactions: n.spendingFee
1290
+ }
1291
+ )
1292
+ ]
1293
+ }
1294
+ ) });
1295
+ }, Uo = v(qo), Qo = () => {
1296
+ const { healthScore: t } = L(), { finstrong: o } = x(), { key_indicators_spend: n } = o, { pay_bills_on_time_drawer: r } = n, s = Dn(t.spending_fee_transaction_count);
1297
+ return /* @__PURE__ */ a(
1298
+ p,
1299
+ {
1300
+ sx: {
1301
+ px: 24,
1302
+ pb: 24,
1303
+ backgroundColor: "background.paper",
1304
+ borderBottom: "1px solid",
1305
+ borderColor: "divider"
1306
+ },
1307
+ children: [
1308
+ /* @__PURE__ */ e(M, { variant: "body2", children: r.pay_bills_on_time_sticky_description }),
1309
+ /* @__PURE__ */ a(p, { direction: "row", sx: { alignItems: "center", justifyContent: "space-between" }, children: [
1310
+ /* @__PURE__ */ a(Le, { children: [
1311
+ t.spending_fee_transaction_count,
1312
+ " ",
1313
+ r.pay_bills_on_time_sticky_fee_count
1314
+ ] }),
1315
+ /* @__PURE__ */ e(Be, { status: s })
1316
+ ] })
1317
+ ]
1318
+ }
1319
+ );
1320
+ }, Zo = v(Qo), Jo = () => {
1321
+ const { savingsAndCheckingAccountsBalance: t } = xe(), { finstrong: o } = x();
1322
+ return /* @__PURE__ */ a(p, { gap: 16, sx: { p: 16 }, children: [
1323
+ /* @__PURE__ */ e(
1324
+ Ce,
1325
+ {
1326
+ balance: t,
1327
+ title: o.key_indicators_save.drawer_available_balance
1328
+ }
1329
+ ),
1330
+ /* @__PURE__ */ e(
1331
+ Wt,
1332
+ {
1333
+ loadAccounts: [Ge.SAVINGS, Ge.CHECKING],
1334
+ loadMoreLabel: o.more_accounts
1335
+ }
1336
+ )
1337
+ ] });
1338
+ }, er = v(Jo), tr = () => {
1339
+ const { finstrong: t } = x(), {
1340
+ isSpendingInitialized: o,
1341
+ healthScore: n,
1342
+ allTransactions: r,
1343
+ loadSpendTransactions: s,
1344
+ loadDebtSpend: i
1345
+ } = L();
1346
+ m.useEffect(() => {
1347
+ o || (s().finally(), i().finally());
1348
+ }, [o]);
1349
+ const c = m.useMemo(() => {
1350
+ const l = r.spend.map((d) => d.transaction), _ = r.debtSpend.map((d) => d.transaction);
1351
+ return [...l, ..._];
1352
+ }, [r.spend, r.debtSpend]);
1353
+ return o ? /* @__PURE__ */ a(p, { gap: 16, sx: { p: 16 }, children: [
1354
+ /* @__PURE__ */ e(
1355
+ Ce,
1356
+ {
1357
+ balance: n.ninety_day_spend / 90,
1358
+ title: t.key_indicators_save.drawer_daily_spend
1359
+ }
1360
+ ),
1361
+ /* @__PURE__ */ e($e, { amountColor: "text.primary", transactions: c })
1362
+ ] }) : /* @__PURE__ */ e(ee, {});
1363
+ }, nr = v(tr), or = () => {
1364
+ const [t, o] = m.useState(0), { finstrong: n } = x();
1365
+ return /* @__PURE__ */ a(z, { children: [
1366
+ /* @__PURE__ */ a(Y, { children: [
1367
+ /* @__PURE__ */ a(
1368
+ Xe,
1369
+ {
1370
+ "aria-label": n.key_indicators_save.drawer_title,
1371
+ centered: !0,
1372
+ onChange: (r, s) => o(s),
1373
+ selectionFollowsFocus: !0,
1374
+ sx: { mb: 0 },
1375
+ value: t,
1376
+ variant: "fullWidth",
1377
+ children: [
1378
+ /* @__PURE__ */ e(
1379
+ se,
1380
+ {
1381
+ "aria-controls": "available-details-tabpanel-0",
1382
+ label: n.key_indicators_save.drawer_available,
1383
+ sx: { minHeight: 44 }
1384
+ }
1385
+ ),
1386
+ /* @__PURE__ */ e(
1387
+ se,
1388
+ {
1389
+ "aria-controls": "spending-details-tabpanel-1",
1390
+ label: n.key_indicators_save.drawer_spending,
1391
+ sx: { minHeight: 44 }
1392
+ }
1393
+ )
1394
+ ]
1395
+ }
1396
+ ),
1397
+ /* @__PURE__ */ e(ce, { index: 0, name: "available-details", value: t, children: /* @__PURE__ */ e(er, {}) }),
1398
+ /* @__PURE__ */ e(ce, { index: 1, name: "spending-details", value: t, children: /* @__PURE__ */ e(nr, {}) })
1399
+ ] }),
1400
+ /* @__PURE__ */ e(Ue, { chartFor: "savingsOverTime" })
1401
+ ] });
1402
+ }, rr = v(or), ar = () => {
1403
+ const { finstrong: t } = x(), { healthScore: o } = L(), n = o.months_of_cash_on_hand, r = bt(n ? n * 30 : null), s = 183 / 6, i = Math.floor(n), c = Math.round((n - i) * s), l = n / 6 * 100;
1404
+ return /* @__PURE__ */ e(
1405
+ We,
1406
+ {
1407
+ bottomComponent: /* @__PURE__ */ e(
1408
+ p,
1409
+ {
1410
+ sx: {
1411
+ flexDirection: "row",
1412
+ height: 24,
1413
+ justifyContent: "space-between",
1414
+ mt: 2,
1415
+ px: 1
1416
+ },
1417
+ children: ["0 Mo", "1 Mo", "2 Mo", "3 Mo", "4 Mo", "5 Mo", "6 Mo"].map((d) => /* @__PURE__ */ a(
1418
+ p,
1419
+ {
1420
+ sx: {
1421
+ alignItems: "center",
1422
+ height: 24
1423
+ },
1424
+ children: [
1425
+ /* @__PURE__ */ e(
1426
+ le,
1427
+ {
1428
+ orientation: "vertical",
1429
+ sx: {
1430
+ borderWidth: 1,
1431
+ height: 8
1432
+ }
1433
+ }
1434
+ ),
1435
+ /* @__PURE__ */ e(I, { variant: "caption", children: d })
1436
+ ]
1437
+ },
1438
+ d
1439
+ ))
1440
+ }
1441
+ ),
1442
+ label: t.key_indicators_save.drawer_progress_bar_label,
1443
+ status: r,
1444
+ statusBarData: [
1445
+ {
1446
+ percentage: `${l}%`
1447
+ }
1448
+ ],
1449
+ value: K(t.key_indicators_save.drawer_progress_bar_value, i, c)
1450
+ }
1451
+ );
1452
+ }, ir = v(ar), sr = () => {
1453
+ const { healthScore: t } = L(), { finstrong: o } = x(), n = Oe(t.debt_to_income_ratio), r = ft(n);
1454
+ return /* @__PURE__ */ e(
1455
+ We,
1456
+ {
1457
+ bottomComponent: /* @__PURE__ */ a(
1458
+ p,
1459
+ {
1460
+ sx: {
1461
+ alignItems: "flex-end",
1462
+ flexDirection: "row",
1463
+ height: 24,
1464
+ justifyContent: "space-between",
1465
+ mt: 2,
1466
+ position: "relative"
1467
+ },
1468
+ children: [
1469
+ /* @__PURE__ */ e(
1470
+ k,
1471
+ {
1472
+ sx: {
1473
+ left: "30%",
1474
+ position: "absolute",
1475
+ transform: "translateX(-50%)"
1476
+ },
1477
+ children: /* @__PURE__ */ a(
1478
+ p,
1479
+ {
1480
+ sx: {
1481
+ alignItems: "center",
1482
+ flexDirection: "column",
1483
+ height: 24,
1484
+ justifyContent: "flex-end"
1485
+ },
1486
+ children: [
1487
+ /* @__PURE__ */ e(
1488
+ le,
1489
+ {
1490
+ orientation: "vertical",
1491
+ sx: {
1492
+ borderWidth: 1,
1493
+ height: 8
1494
+ }
1495
+ }
1496
+ ),
1497
+ /* @__PURE__ */ e(I, { sx: { color: "text.primary" }, variant: "caption", children: "30%" })
1498
+ ]
1499
+ }
1500
+ )
1501
+ }
1502
+ ),
1503
+ /* @__PURE__ */ e(
1504
+ k,
1505
+ {
1506
+ sx: {
1507
+ display: "flex",
1508
+ flexDirection: "column",
1509
+ height: 24,
1510
+ justifyContent: "center",
1511
+ marginLeft: "auto"
1512
+ },
1513
+ children: /* @__PURE__ */ e(I, { variant: "body2", children: t.debt_to_income_ratio ? K(
1514
+ o.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_sticky_description,
1515
+ n
1516
+ ) : "-" })
1517
+ }
1518
+ )
1519
+ ]
1520
+ }
1521
+ ),
1522
+ label: o.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_sticky_title,
1523
+ status: r,
1524
+ statusBarData: [
1525
+ {
1526
+ percentage: `${n}%`
1527
+ }
1528
+ ],
1529
+ value: $(t.ninety_day_debt_spend, "0,0.00")
1530
+ }
1531
+ );
1532
+ }, cr = v(sr), lr = () => {
1533
+ const { healthScore: t, allTransactions: o } = L(), { connect: n, finstrong: r } = x(), [s, i] = m.useState(!1);
1534
+ return /* @__PURE__ */ a(p, { gap: 16, sx: { p: 16 }, children: [
1535
+ /* @__PURE__ */ e(
1536
+ Ce,
1537
+ {
1538
+ balance: t.ninety_day_income,
1539
+ sx: { flexDirection: "column-reverse" },
1540
+ title: r.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_income
1541
+ }
1542
+ ),
1543
+ o.income.length ? (
1544
+ // TODO: Need to add More Transactions functionality
1545
+ /* @__PURE__ */ e($e, { transactions: o.income.map((c) => c.transaction) })
1546
+ ) : /* @__PURE__ */ e(
1547
+ B,
1548
+ {
1549
+ onClick: () => {
1550
+ i(!0);
1551
+ },
1552
+ variant: "contained",
1553
+ children: r.connect_more_accounts_button
1554
+ }
1555
+ ),
1556
+ /* @__PURE__ */ e(
1557
+ re,
1558
+ {
1559
+ onClose: () => i(!1),
1560
+ showConnectWidget: s,
1561
+ title: n.mini_title
1562
+ }
1563
+ )
1564
+ ] });
1565
+ }, dr = v(lr), pr = () => {
1566
+ const { allTransactions: t, healthScore: o } = L(), { connect: n, finstrong: r } = x(), [s, i] = m.useState(!1);
1567
+ return /* @__PURE__ */ a(p, { gap: 16, sx: { p: 16 }, children: [
1568
+ /* @__PURE__ */ e(
1569
+ Ce,
1570
+ {
1571
+ balance: o.ninety_day_debt_spend,
1572
+ sx: { flexDirection: "column-reverse" },
1573
+ title: r.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_payments
1574
+ }
1575
+ ),
1576
+ t.debtSpend.length ? (
1577
+ //TODO: Need to add More Transactions functionality
1578
+ /* @__PURE__ */ e(
1579
+ $e,
1580
+ {
1581
+ amountColor: "text.primary",
1582
+ transactions: t.debtSpend.map((c) => c.transaction)
1583
+ }
1584
+ )
1585
+ ) : /* @__PURE__ */ e(
1586
+ B,
1587
+ {
1588
+ onClick: () => {
1589
+ i(!0);
1590
+ },
1591
+ variant: "contained",
1592
+ children: r.connect_more_accounts_button
1593
+ }
1594
+ ),
1595
+ /* @__PURE__ */ e(
1596
+ re,
1597
+ {
1598
+ onClose: () => i(!1),
1599
+ showConnectWidget: s,
1600
+ title: n.mini_title
1601
+ }
1602
+ )
1603
+ ] });
1604
+ }, _r = v(pr), hr = ({
1605
+ color: t,
1606
+ data: o,
1607
+ series: n,
1608
+ style: r,
1609
+ ...s
1610
+ }) => {
1611
+ const i = G(), c = m.useRef(null), { width: l } = eo({
1612
+ width: r.width
1613
+ });
1614
+ m.useLayoutEffect(() => {
1615
+ const h = new ResizeObserver(() => {
1616
+ window.requestAnimationFrame(() => {
1617
+ if (c.current) {
1618
+ const { width: y } = c.current.getBoundingClientRect(), f = y / 2, w = c.current.querySelector("text");
1619
+ w && w.setAttribute("transform", `translate(${f}, -8)`);
1620
+ }
1621
+ });
1622
+ });
1623
+ return c.current && h.observe(c.current), () => {
1624
+ c.current && h.unobserve(c.current);
1625
+ };
1626
+ }, []);
1627
+ const { formattedComparison: _, formattedMain: d } = o[n.index], u = n.type === 0 ? d : _;
1628
+ return /* @__PURE__ */ a("g", { children: [
1629
+ /* @__PURE__ */ e(at.rect, { ...s, fill: t, ref: c, rx: 2, style: r }),
1630
+ /* @__PURE__ */ e(
1631
+ at.text,
1632
+ {
1633
+ fill: i.palette.text.secondary,
1634
+ fontSize: 9,
1635
+ fontWeight: 400,
1636
+ textAnchor: "middle",
1637
+ transform: l.to((h) => `translate(${h / 2}, -5)`),
1638
+ x: r.x,
1639
+ y: r.y,
1640
+ children: u
1641
+ }
1642
+ )
1643
+ ] });
1644
+ }, Te = (t, o = 1e3) => {
1645
+ const n = Math.abs(t) >= o ? "0.[0]a" : "0";
1646
+ return $(t, n);
1647
+ }, $t = ({
1648
+ chartFor: t,
1649
+ data: o,
1650
+ title: n,
1651
+ buttonLabel: r,
1652
+ onClick: s,
1653
+ legendLabelMain: i,
1654
+ legendLabelComparison: c,
1655
+ totalComparison: l,
1656
+ totalMain: _
1657
+ }) => {
1658
+ const d = G(), u = Un(d.breakpoints.down("xs")), h = m.useMemo(
1659
+ () => o.sort((g, b) => g.month - b.month).map((g) => {
1660
+ const b = In(g.month), P = {
1661
+ spending_vs_income: {
1662
+ main: g.standard_spend,
1663
+ comparison: g.income,
1664
+ formattedMain: Te(g.standard_spend),
1665
+ formattedComparison: Te(g.income)
1666
+ },
1667
+ debt_payment_vs_income: {
1668
+ main: g.income,
1669
+ comparison: g.debt_spend,
1670
+ formattedMain: Te(g.income),
1671
+ formattedComparison: Te(g.debt_spend)
1672
+ }
1673
+ };
1674
+ return {
1675
+ label: b,
1676
+ ...P[t]
1677
+ };
1678
+ }),
1679
+ [o, t]
1680
+ ), y = {
1681
+ dataKey: "label",
1682
+ scaleType: "band"
1683
+ }, f = Math.max(...h.map((g) => Math.max(g.main, g.comparison))), C = Math.min(...h.map((g) => Math.min(g.main, g.comparison))) === 0 && f === 0 ? 100 : Math.ceil(f * 1.2 / 1e3) * 1e3, D = C / 3, S = {
1684
+ scaleType: "linear",
1685
+ min: 0,
1686
+ max: C,
1687
+ tickNumber: 4,
1688
+ tickMinStep: D,
1689
+ valueFormatter: (g) => g === 0 ? "$0" : $(g, "0.[0]a")
1690
+ };
1691
+ return /* @__PURE__ */ a(
1692
+ Y,
1693
+ {
1694
+ sx: {
1695
+ px: 16,
1696
+ py: 24
1697
+ },
1698
+ children: [
1699
+ /* @__PURE__ */ a(
1700
+ p,
1701
+ {
1702
+ sx: {
1703
+ alignItems: "center",
1704
+ flexDirection: "row",
1705
+ justifyContent: "space-between",
1706
+ gap: 12,
1707
+ pb: 8
1708
+ },
1709
+ children: [
1710
+ /* @__PURE__ */ e(V, { children: n }),
1711
+ r && /* @__PURE__ */ e(
1712
+ B,
1713
+ {
1714
+ endIcon: /* @__PURE__ */ e(Z, {}),
1715
+ onClick: s,
1716
+ size: "small",
1717
+ sx: {
1718
+ pl: 8,
1719
+ height: 24
1720
+ },
1721
+ variant: "text",
1722
+ children: r
1723
+ }
1724
+ )
1725
+ ]
1726
+ }
1727
+ ),
1728
+ /* @__PURE__ */ a(p, { sx: { alignItems: "center", flexDirection: "row", gap: 24, py: 4 }, children: [
1729
+ /* @__PURE__ */ a(p, { sx: { gap: 8, alignItems: "center", flexDirection: "row" }, children: [
1730
+ /* @__PURE__ */ e(
1731
+ k,
1732
+ {
1733
+ sx: {
1734
+ width: 10,
1735
+ height: 10,
1736
+ backgroundColor: "chartMono.chartMono3",
1737
+ borderRadius: "2px"
1738
+ }
1739
+ }
1740
+ ),
1741
+ /* @__PURE__ */ a(p, { sx: { alignItems: "center", flexDirection: "row" }, children: [
1742
+ /* @__PURE__ */ a(I, { variant: "subtitle2", children: [
1743
+ i,
1744
+ " "
1745
+ ] }),
1746
+ !u && _ && /* @__PURE__ */ e(I, { sx: { fontWeight: 700 }, variant: "subtitle2", children: _ })
1747
+ ] })
1748
+ ] }),
1749
+ /* @__PURE__ */ a(p, { alignItems: "center", direction: "row", spacing: 8, children: [
1750
+ /* @__PURE__ */ e(
1751
+ k,
1752
+ {
1753
+ sx: {
1754
+ width: 10,
1755
+ height: 10,
1756
+ backgroundColor: "chartMono.chartMono5",
1757
+ borderRadius: "2px"
1758
+ }
1759
+ }
1760
+ ),
1761
+ /* @__PURE__ */ a(p, { sx: { alignItems: "center", flexDirection: "row" }, children: [
1762
+ /* @__PURE__ */ a(I, { variant: "subtitle2", children: [
1763
+ c,
1764
+ " "
1765
+ ] }),
1766
+ !u && l && /* @__PURE__ */ e(I, { sx: { fontWeight: 700 }, variant: "subtitle2", children: l })
1767
+ ] })
1768
+ ] })
1769
+ ] }),
1770
+ /* @__PURE__ */ a(
1771
+ Jn,
1772
+ {
1773
+ colors: [`${d.palette.chartMono.chartMono3}`, `${d.palette.chartMono.chartMono5}`],
1774
+ dataset: h,
1775
+ height: 240,
1776
+ margin: { top: 16, bottom: 34, right: 0, left: 50 },
1777
+ series: [
1778
+ { dataKey: "main", type: "bar" },
1779
+ { dataKey: "comparison", type: "bar" }
1780
+ ],
1781
+ xAxis: [y],
1782
+ yAxis: [S],
1783
+ children: [
1784
+ /* @__PURE__ */ e(
1785
+ an,
1786
+ {
1787
+ slots: {
1788
+ bar: (g) => {
1789
+ const { ownerState: b, style: P, ...F } = g;
1790
+ return /* @__PURE__ */ e(
1791
+ hr,
1792
+ {
1793
+ ...F,
1794
+ color: b.color,
1795
+ data: h,
1796
+ series: {
1797
+ index: b.dataIndex,
1798
+ type: Number(b.id.toString().split("-").pop())
1799
+ },
1800
+ style: P
1801
+ }
1802
+ );
1803
+ }
1804
+ }
1805
+ }
1806
+ ),
1807
+ /* @__PURE__ */ e(
1808
+ Qn,
1809
+ {
1810
+ sx: () => ({
1811
+ ".MuiChartsAxis-line": {
1812
+ stroke: d.palette.divider
1813
+ },
1814
+ ".MuiChartsAxis-tick": {
1815
+ stroke: d.palette.divider
1816
+ },
1817
+ ".MuiChartsAxis-tickLabel": {
1818
+ transform: "translateY(10px)"
1819
+ }
1820
+ }),
1821
+ tickLabelStyle: {
1822
+ fontSize: 11,
1823
+ fill: "text.secondary"
1824
+ }
1825
+ }
1826
+ ),
1827
+ /* @__PURE__ */ e(
1828
+ Zn,
1829
+ {
1830
+ sx: () => ({
1831
+ ".MuiChartsAxis-line": {
1832
+ stroke: d.palette.divider
1833
+ },
1834
+ ".MuiChartsAxis-tick": {
1835
+ stroke: d.palette.divider
1836
+ },
1837
+ ".MuiChartsAxis-tickLabel": {
1838
+ transform: "translateX(-8px)"
1839
+ }
1840
+ }),
1841
+ tickLabelStyle: {
1842
+ fontSize: 11,
1843
+ fill: "text.secondary"
1844
+ }
1845
+ }
1846
+ )
1847
+ ]
1848
+ }
1849
+ )
1850
+ ]
1851
+ }
1852
+ );
1853
+ }, ur = () => {
1854
+ const { isIncomeInitialized: t, loadDebtSpend: o, loadIncome: n, monthlySummaries: r } = L(), [s, i] = m.useState(0), { finstrong: c } = x();
1855
+ return m.useEffect(() => {
1856
+ t || (o().finally(), n().finally());
1857
+ }, [t]), t ? /* @__PURE__ */ a(z, { children: [
1858
+ /* @__PURE__ */ a(Y, { children: [
1859
+ /* @__PURE__ */ a(
1860
+ Xe,
1861
+ {
1862
+ "aria-label": c.key_indicators_save.drawer_title,
1863
+ centered: !0,
1864
+ onChange: (l, _) => i(_),
1865
+ selectionFollowsFocus: !0,
1866
+ sx: { mb: 0 },
1867
+ value: s,
1868
+ variant: "fullWidth",
1869
+ children: [
1870
+ /* @__PURE__ */ e(
1871
+ se,
1872
+ {
1873
+ "aria-controls": "income-details-tabpanel-0",
1874
+ id: "income-details-tab-0",
1875
+ label: c.key_indicators_borrow.have_manageable_debt_drawer.income,
1876
+ sx: { minHeight: 44 }
1877
+ }
1878
+ ),
1879
+ /* @__PURE__ */ e(
1880
+ se,
1881
+ {
1882
+ "aria-controls": "debt-payment-details-tabpanel-1",
1883
+ id: "debt-payment-details-tab-1",
1884
+ label: c.key_indicators_borrow.have_manageable_debt_drawer.debt_payment,
1885
+ sx: { minHeight: 44 }
1886
+ }
1887
+ )
1888
+ ]
1889
+ }
1890
+ ),
1891
+ /* @__PURE__ */ e(
1892
+ ce,
1893
+ {
1894
+ "aria-labelledby": "income-details-tab-0",
1895
+ index: 0,
1896
+ name: "income-details",
1897
+ value: s,
1898
+ children: /* @__PURE__ */ e(dr, {})
1899
+ }
1900
+ ),
1901
+ /* @__PURE__ */ e(
1902
+ ce,
1903
+ {
1904
+ "aria-labelledby": "debt-payment-details-tab-1",
1905
+ index: 1,
1906
+ name: "debt-payment-details",
1907
+ value: s,
1908
+ children: /* @__PURE__ */ e(_r, {})
1909
+ }
1910
+ )
1911
+ ] }),
1912
+ r.length ? /* @__PURE__ */ a(z, { children: [
1913
+ /* @__PURE__ */ e(
1914
+ $t,
1915
+ {
1916
+ chartFor: "debt_payment_vs_income",
1917
+ data: r,
1918
+ legendLabelComparison: c.key_indicators_borrow.have_manageable_debt_drawer.debt_payment,
1919
+ legendLabelMain: c.key_indicators_borrow.have_manageable_debt_drawer.income,
1920
+ title: c.key_indicators_borrow.have_manageable_debt_drawer.debt_payment
1921
+ }
1922
+ ),
1923
+ /* @__PURE__ */ e(Ue, { chartFor: "debtOverTime" })
1924
+ ] }) : /* @__PURE__ */ a(z, { children: [
1925
+ /* @__PURE__ */ e(
1926
+ Re,
1927
+ {
1928
+ header: c.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_double_bar_chart_empty_state_header,
1929
+ icon: "multiline_chart",
1930
+ subText: c.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_double_bar_chart_empty_state_description,
1931
+ sx: {
1932
+ backgroundColor: "background.paper",
1933
+ borderRadius: "8px",
1934
+ boxShadow: 1,
1935
+ p: 24,
1936
+ pb: 48
1937
+ },
1938
+ variant: "no-buttons"
1939
+ }
1940
+ ),
1941
+ /* @__PURE__ */ e(
1942
+ Re,
1943
+ {
1944
+ header: c.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_line_chart_empty_state_header,
1945
+ icon: "multiline_chart",
1946
+ subText: c.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_line_chart_empty_state_description,
1947
+ sx: {
1948
+ backgroundColor: "background.paper",
1949
+ borderRadius: "8px",
1950
+ boxShadow: 1,
1951
+ p: 24,
1952
+ pb: 48
1953
+ },
1954
+ variant: "no-buttons"
1955
+ }
1956
+ )
1957
+ ] })
1958
+ ] }) : /* @__PURE__ */ e(ee, {});
1959
+ }, mr = v(ur), gr = () => {
1960
+ const { healthScore: t } = L(), { finstrong: o } = x(), n = Oe(t.spend_to_income_ratio), r = n ?? 0, s = Object.keys(t).length === 0, i = xt(n), c = {
1961
+ GOOD: [{ percentage: `${r}%` }],
1962
+ FAIR: [{ percentage: "100%" }, { percentage: `${r - 100}%` }],
1963
+ OFF_TRACK: [{ percentage: "100%" }, { percentage: `${r - 100}%` }],
1964
+ MISSING: [{ percentage: "0%" }]
1965
+ }[i];
1966
+ return /* @__PURE__ */ e(
1967
+ We,
1968
+ {
1969
+ bottomComponent: /* @__PURE__ */ a(
1970
+ p,
1971
+ {
1972
+ sx: {
1973
+ flexDirection: "row",
1974
+ justifyContent: "space-between",
1975
+ alignItems: "center",
1976
+ mt: 8
1977
+ },
1978
+ children: [
1979
+ /* @__PURE__ */ a(I, { variant: "body2", children: [
1980
+ t.ninety_day_income <= 0 ? "-" : $(t.ninety_day_income, "0,0.00"),
1981
+ " ",
1982
+ o?.key_indicators_spend.spend_less_than_you_make_drawer.income
1983
+ ] }),
1984
+ /* @__PURE__ */ a(I, { variant: "body2", children: [
1985
+ r <= 0 ? "-%" : `${r}%`,
1986
+ " ",
1987
+ o?.key_indicators_spend.spend_less_than_you_make_drawer.spent
1988
+ ] })
1989
+ ]
1990
+ }
1991
+ ),
1992
+ label: o?.key_indicators_spend.spend_less_than_you_make_drawer.spend_less_than_you_make_sticky_description,
1993
+ status: i,
1994
+ statusBarData: c,
1995
+ value: s ? "$0" : $(t.ninety_day_spend, "0,0.00")
1996
+ }
1997
+ );
1998
+ }, yr = v(gr), br = () => {
1999
+ const { accounts: t } = xe(), { categories: o, dateRangeCategoryTotals: n, loadDateRangeCategoryTotals: r } = Ke(), { monthlySummaries: s, handleFinstrongWidgetPrimaryCtaClick: i } = L(), { appDataStore: c } = Rn(), { finstrong: l, goals: _, spending: d } = x(), u = G(), [h, y] = m.useState("");
2000
+ m.useEffect(() => {
2001
+ r(
2002
+ t,
2003
+ At(/* @__PURE__ */ new Date()),
2004
+ Tt(/* @__PURE__ */ new Date())
2005
+ ).finally();
2006
+ }, [t]);
2007
+ const f = m.useMemo(
2008
+ () => to(o, _, u, n),
2009
+ [o, n]
2010
+ ), w = (S) => {
2011
+ y(h === S ? "" : S);
2012
+ }, { totalSpending: C, totalIncome: D } = m.useMemo(() => s?.reduce(
2013
+ (S, { standard_spend: g = 0, income: b = 0 }) => ({
2014
+ totalSpending: S.totalSpending + g,
2015
+ totalIncome: S.totalIncome + b
2016
+ }),
2017
+ { totalSpending: 0, totalIncome: 0 }
2018
+ ), [s]);
2019
+ return /* @__PURE__ */ a(p, { sx: { gap: 24 }, children: [
2020
+ s.length ? /* @__PURE__ */ e(
2021
+ $t,
2022
+ {
2023
+ ...c.appData.client_profile?.allow_trends_widget && {
2024
+ buttonLabel: l.key_indicators_spend.spend_less_than_you_make_drawer.view_more
2025
+ },
2026
+ chartFor: "spending_vs_income",
2027
+ data: s,
2028
+ legendLabelComparison: l.key_indicators_spend.spend_less_than_you_make_drawer.income,
2029
+ legendLabelMain: l.key_indicators_spend.spend_less_than_you_make_drawer.spending,
2030
+ onClick: () => i("trends")(),
2031
+ title: l.key_indicators_spend.spend_less_than_you_make_drawer.trends,
2032
+ totalComparison: $(D, "0,0.00"),
2033
+ totalMain: $(C, "0,0.00")
2034
+ }
2035
+ ) : /* @__PURE__ */ e(
2036
+ Re,
2037
+ {
2038
+ header: l.key_indicators_spend.spend_less_than_you_make_drawer.trends_zero_state_title,
2039
+ icon: "multiline_chart",
2040
+ subText: l.key_indicators_spend.spend_less_than_you_make_drawer.trends_zero_state_description,
2041
+ sx: {
2042
+ backgroundColor: "background.paper",
2043
+ borderRadius: "8px",
2044
+ boxShadow: 1,
2045
+ p: 24,
2046
+ pb: 48,
2047
+ ".empty-state-subtext": {
2048
+ fontSize: 15,
2049
+ lineHeight: "24px",
2050
+ mt: 8
2051
+ }
2052
+ },
2053
+ variant: "no-buttons"
2054
+ }
2055
+ ),
2056
+ f ? /* @__PURE__ */ a(
2057
+ Y,
2058
+ {
2059
+ sx: {
2060
+ px: 16,
2061
+ py: 24
2062
+ },
2063
+ children: [
2064
+ /* @__PURE__ */ a(
2065
+ p,
2066
+ {
2067
+ sx: {
2068
+ alignItems: "center",
2069
+ flexDirection: "row",
2070
+ justifyContent: "space-between",
2071
+ gap: 12,
2072
+ pb: 8
2073
+ },
2074
+ children: [
2075
+ /* @__PURE__ */ e(V, { children: l.key_indicators_spend.spend_less_than_you_make_drawer.spending }),
2076
+ c.appData.client_profile?.allow_spending_widget && /* @__PURE__ */ e(
2077
+ B,
2078
+ {
2079
+ endIcon: /* @__PURE__ */ e(Z, {}),
2080
+ onClick: () => i("spending")(),
2081
+ size: "small",
2082
+ sx: {
2083
+ pl: 8,
2084
+ height: 24
2085
+ },
2086
+ variant: "text",
2087
+ children: l.key_indicators_spend.spend_less_than_you_make_drawer.view_more
2088
+ }
2089
+ )
2090
+ ]
2091
+ }
2092
+ ),
2093
+ /* @__PURE__ */ a(p, { sx: { gap: 12, py: 16, flexDirection: "row", justifyContent: "center" }, children: [
2094
+ /* @__PURE__ */ e(
2095
+ no,
2096
+ {
2097
+ data: f,
2098
+ onSelected: w,
2099
+ selectedId: h,
2100
+ totalLabel: d.total_spending
2101
+ }
2102
+ ),
2103
+ /* @__PURE__ */ e(
2104
+ oo,
2105
+ {
2106
+ data: f,
2107
+ onSelected: w,
2108
+ selectedId: h
2109
+ }
2110
+ )
2111
+ ] })
2112
+ ]
2113
+ }
2114
+ ) : /* @__PURE__ */ e(
2115
+ Re,
2116
+ {
2117
+ header: l.key_indicators_spend.spend_less_than_you_make_drawer.spending_zero_state_title,
2118
+ icon: "donut_small",
2119
+ subText: l.key_indicators_spend.spend_less_than_you_make_drawer.spending_zero_state_description,
2120
+ sx: {
2121
+ backgroundColor: "background.paper",
2122
+ borderRadius: "8px",
2123
+ boxShadow: 1,
2124
+ p: 24,
2125
+ pb: 48,
2126
+ ".empty-state-subtext": {
2127
+ fontSize: 15,
2128
+ lineHeight: "24px",
2129
+ mt: 8
2130
+ }
2131
+ },
2132
+ variant: "no-buttons"
2133
+ }
2134
+ )
2135
+ ] });
2136
+ }, fr = v(br), xr = ({
2137
+ drawerFor: t,
2138
+ isOpen: o,
2139
+ onClose: n
2140
+ }) => {
2141
+ const { finstrong: r } = x(), i = {
2142
+ spendLessThanYouMake: {
2143
+ title: r.key_indicators_spend.spend_less_than_you_make_drawer.spend_less_than_you_make_title,
2144
+ description: r.key_indicators_spend.spend_less_than_you_make_drawer.spend_less_than_you_make_description,
2145
+ stickyComponent: /* @__PURE__ */ e(yr, {}),
2146
+ content: /* @__PURE__ */ e(fr, {}),
2147
+ drawerType: "connectDrawer",
2148
+ connectTitle: r.connect_your_accounts,
2149
+ connectDescription: r.connect_more_accounts_to_unlock_a_fuller_understanding_of_your_finances
2150
+ },
2151
+ payBillsOnTime: {
2152
+ title: r.key_indicators_spend.pay_bills_on_time_drawer.pay_bills_on_time_title,
2153
+ description: r.key_indicators_spend.pay_bills_on_time_drawer.pay_bills_on_time_description,
2154
+ stickyComponent: /* @__PURE__ */ e(Zo, {}),
2155
+ content: /* @__PURE__ */ e(Uo, {}),
2156
+ drawerType: "connectDrawer",
2157
+ connectTitle: r.connect_your_accounts,
2158
+ connectDescription: r.connect_more_accounts_to_unlock_a_fuller_understanding_of_your_finances
2159
+ },
2160
+ maintainEmergencySavings: {
2161
+ content: /* @__PURE__ */ e(jo, {}),
2162
+ description: r.maintain_emergency_savings_description,
2163
+ stickyComponent: /* @__PURE__ */ e(Xo, {}),
2164
+ title: r.maintain_emergency_savings_title,
2165
+ drawerType: "connectDrawer",
2166
+ connectTitle: r.connect_your_accounts,
2167
+ connectDescription: r.connect_more_accounts_to_unlock_a_fuller_understanding_of_your_finances
2168
+ },
2169
+ haveManageableDebt: {
2170
+ title: r.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_title,
2171
+ description: r.key_indicators_borrow.have_manageable_debt_drawer.have_manageable_debt_description,
2172
+ stickyComponent: /* @__PURE__ */ e(cr, {}),
2173
+ content: /* @__PURE__ */ e(mr, {}),
2174
+ drawerType: "connectDrawer",
2175
+ connectTitle: r.dont_see_all_your_accounts,
2176
+ connectDescription: r.connect_more_accounts_to_view_more_accurate_financial_picture
2177
+ },
2178
+ haveAGoodCreditScore: {
2179
+ title: /* @__PURE__ */ e(Wo, {}),
2180
+ description: r.credit_score_description,
2181
+ stickyComponent: null,
2182
+ content: /* @__PURE__ */ e(Po, {})
2183
+ },
2184
+ saveEnoughToLiveOn: {
2185
+ title: r.key_indicators_save.drawer_title,
2186
+ description: r.key_indicators_save.drawer_description,
2187
+ stickyComponent: /* @__PURE__ */ e(ir, {}),
2188
+ content: /* @__PURE__ */ e(rr, {}),
2189
+ drawerType: "connectDrawer",
2190
+ connectTitle: r.dont_see_all_your_accounts,
2191
+ connectDescription: r.connect_more_accounts_to_view_more_accurate_financial_picture
2192
+ }
2193
+ }[t];
2194
+ return /* @__PURE__ */ e(
2195
+ Pt,
2196
+ {
2197
+ connectDescription: i?.connectDescription,
2198
+ connectTitle: i?.connectTitle,
2199
+ description: i?.description,
2200
+ drawerTitle: r.key_indicators,
2201
+ drawerType: i.drawerType,
2202
+ isOpen: o,
2203
+ loadConnectAccountsCard: !0,
2204
+ onClose: n,
2205
+ stickyComponent: i.stickyComponent,
2206
+ title: i.title,
2207
+ children: /* @__PURE__ */ e(p, { sx: { gap: 16 }, children: i.content })
2208
+ }
2209
+ );
2210
+ }, Cr = v(xr), fe = ({
2211
+ drawerFor: t,
2212
+ title: o,
2213
+ description: n,
2214
+ cardState: r = "MISSING"
2215
+ }) => {
2216
+ const { finstrong: s } = x(), [i, c] = m.useState(!1), l = (_) => {
2217
+ (_.key === "Enter" || _.key === " ") && (_.preventDefault(), c(!0));
2218
+ };
2219
+ return /* @__PURE__ */ a(z, { children: [
2220
+ /* @__PURE__ */ a(
2221
+ p,
2222
+ {
2223
+ "aria-label": `${s.key_indicators_open} ${o}`,
2224
+ onClick: () => c(!0),
2225
+ onKeyDown: l,
2226
+ role: "button",
2227
+ sx: {
2228
+ alignItems: "center",
2229
+ borderRadius: 2,
2230
+ cursor: "pointer",
2231
+ flexDirection: "row",
2232
+ gap: 12,
2233
+ justifyContent: "space-between",
2234
+ outline: "1px solid",
2235
+ outlineColor: "divider",
2236
+ p: 16
2237
+ },
2238
+ tabIndex: 0,
2239
+ children: [
2240
+ /* @__PURE__ */ a(p, { sx: { gap: 8, minWidth: 0 }, children: [
2241
+ /* @__PURE__ */ a(p, { sx: { alignItems: "center", flexDirection: "row", gap: 8 }, children: [
2242
+ /* @__PURE__ */ e(I, { sx: { fontWeight: 600 }, variant: "body1", children: o }),
2243
+ /* @__PURE__ */ e(Be, { status: r })
2244
+ ] }),
2245
+ /* @__PURE__ */ e(M, { color: "secondary", variant: "subtitle2", children: n })
2246
+ ] }),
2247
+ /* @__PURE__ */ e(Z, { color: "secondary", size: 24 })
2248
+ ]
2249
+ }
2250
+ ),
2251
+ /* @__PURE__ */ e(
2252
+ Cr,
2253
+ {
2254
+ drawerFor: t,
2255
+ isOpen: i,
2256
+ onClose: () => c(!1)
2257
+ }
2258
+ )
2259
+ ] });
2260
+ }, Sr = () => {
2261
+ const { finstrong: t } = x(), { key_indicators_spend: o } = t, { healthScore: n } = L(), r = (c) => {
2262
+ const l = xt(c), _ = {
2263
+ GOOD: o.ratio_good_description,
2264
+ FAIR: o.ratio_fair_description,
2265
+ OFF_TRACK: o.ratio_off_track_description,
2266
+ MISSING: o.ratio_missing_description
2267
+ }, d = l === "MISSING" ? _[l] : K(_[l], c);
2268
+ return {
2269
+ cardState: l,
2270
+ description: d,
2271
+ title: o.ratio_card_title
2272
+ };
2273
+ }, { spendToIncomeRatio: s, spendFeeCount: i } = m.useMemo(() => {
2274
+ const c = n.spend_to_income_ratio !== null ? Math.round(n.spend_to_income_ratio * 100) : null, l = r(c), _ = An(
2275
+ n.spending_fee_transaction_count,
2276
+ o
2277
+ );
2278
+ return { spendToIncomeRatio: l, spendFeeCount: _ };
2279
+ }, [
2280
+ n.spend_to_income_ratio,
2281
+ n.spending_fee_transaction_count,
2282
+ o,
2283
+ t
2284
+ ]);
2285
+ return /* @__PURE__ */ a(p, { sx: { gap: 24, p: 8, pt: 24 }, children: [
2286
+ /* @__PURE__ */ e(
2287
+ fe,
2288
+ {
2289
+ cardState: s.cardState,
958
2290
  description: s.description,
959
- stateTitle: s.stateTitle,
2291
+ drawerFor: de.SpendLessThanYouMake,
960
2292
  title: s.title
961
2293
  }
2294
+ ),
2295
+ /* @__PURE__ */ e(
2296
+ fe,
2297
+ {
2298
+ cardState: i.cardState,
2299
+ description: i.description,
2300
+ drawerFor: de.PayBillsOnTime,
2301
+ title: i.title
2302
+ }
962
2303
  )
963
2304
  ] });
964
- }, wt = () => {
965
- const { healthScore: n } = $(), { finstrong: o } = S(), { key_indicators_save: t } = o, i = (r) => {
966
- const { good: a, poor: c } = X.daysOfCashOnHand;
967
- let p = f.MISSING, h = t.days_of_cash_missing_description, m = o.key_indicators_missing;
968
- return r !== null && (r >= a ? (p = f.GOOD, h = b(t.days_of_cash_good_description, r), m = o.key_indicators_good) : r < a && r >= c ? (p = f.FAIR, h = b(t.days_of_cash_fair_description, r), m = o.key_indicators_fair) : r < c && (p = f.OFF_TRACK, h = b(t.days_of_cash_off_track_description, r), m = o.key_indicators_off_track)), {
969
- cardState: p,
970
- description: h,
971
- title: t.days_of_cash_title,
972
- stateTitle: m
2305
+ }, vr = v(Sr), wr = () => {
2306
+ const { healthScore: t } = L(), { finstrong: o } = x(), { key_indicators_save: n } = o, r = (l) => {
2307
+ const _ = bt(l), d = {
2308
+ GOOD: n.days_of_cash_good_description,
2309
+ FAIR: n.days_of_cash_fair_description,
2310
+ OFF_TRACK: n.days_of_cash_off_track_description,
2311
+ MISSING: n.days_of_cash_missing_description
2312
+ }, u = _ === "MISSING" ? d[_] : K(d[_], l);
2313
+ return {
2314
+ cardState: _,
2315
+ description: u,
2316
+ title: n.days_of_cash_title
973
2317
  };
974
- }, d = (r) => {
975
- const { good: a, poor: c } = X.emergencySavings;
976
- let p = f.MISSING, h = t.emergency_savings_missing_description, m = o.key_indicators_missing;
977
- return r !== null && (r >= a ? (p = f.GOOD, h = t.emergency_savings_good_description, m = o.key_indicators_good) : r < a && r >= c ? (p = f.FAIR, h = b(
978
- t.emergency_savings_fair_description,
979
- rt(r, "0,0.00")
980
- ), m = o.key_indicators_fair) : r < c && (p = f.OFF_TRACK, h = t.emergency_savings_off_track_description, m = o.key_indicators_off_track)), {
981
- cardState: p,
982
- description: h,
983
- title: t.emergency_savings_title,
984
- stateTitle: m
2318
+ }, s = (l) => {
2319
+ const _ = yt(l), d = {
2320
+ GOOD: n.emergency_savings_good_description,
2321
+ FAIR: n.emergency_savings_fair_description,
2322
+ OFF_TRACK: n.emergency_savings_off_track_description,
2323
+ MISSING: n.emergency_savings_missing_description
2324
+ };
2325
+ let u;
2326
+ return _ === "FAIR" && l !== null ? u = K(
2327
+ d[_],
2328
+ $(l, "0,0.00")
2329
+ ) : u = d[_], {
2330
+ cardState: _,
2331
+ description: u,
2332
+ title: n.emergency_savings_title
985
2333
  };
986
- }, { daysOfCashOnHand: l, emergencySavings: s } = C.useMemo(() => {
987
- const r = n.months_of_cash_on_hand !== null ? Math.round(n.months_of_cash_on_hand * 30) : null, a = i(r), c = n.emergency_savings_on_hand !== null ? Math.round(n.emergency_savings_on_hand) : null, p = d(c);
988
- return { daysOfCashOnHand: a, emergencySavings: p };
2334
+ }, { daysOfCashOnHand: i, emergencySavings: c } = m.useMemo(() => {
2335
+ const l = t.months_of_cash_on_hand !== null ? Math.round(t.months_of_cash_on_hand * 30) : null, _ = r(l), d = t.emergency_savings_on_hand !== null ? Math.round(t.emergency_savings_on_hand) : null, u = s(d);
2336
+ return { daysOfCashOnHand: _, emergencySavings: u };
989
2337
  }, [
990
- n.months_of_cash_on_hand,
991
- n.emergency_savings_on_hand,
992
- t,
2338
+ t.months_of_cash_on_hand,
2339
+ t.emergency_savings_on_hand,
2340
+ n,
993
2341
  o
994
2342
  ]);
995
- return /* @__PURE__ */ u(g, { direction: "column", gap: 24, sx: { p: 8, pt: 24 }, children: [
2343
+ return /* @__PURE__ */ a(p, { direction: "column", gap: 24, sx: { p: 8, pt: 24 }, children: [
996
2344
  /* @__PURE__ */ e(
997
- B,
2345
+ fe,
998
2346
  {
999
- cardState: l.cardState,
1000
- description: l.description,
1001
- stateTitle: l.stateTitle,
1002
- title: l.title
2347
+ cardState: i.cardState,
2348
+ description: i.description,
2349
+ drawerFor: de.SaveEnoughToLiveOn,
2350
+ title: i.title
1003
2351
  }
1004
2352
  ),
1005
2353
  /* @__PURE__ */ e(
1006
- B,
2354
+ fe,
1007
2355
  {
1008
- cardState: s.cardState,
1009
- description: s.description,
1010
- stateTitle: s.stateTitle,
1011
- title: s.title
2356
+ cardState: c.cardState,
2357
+ description: c.description,
2358
+ drawerFor: de.MaintainEmergencySavings,
2359
+ title: c.title
1012
2360
  }
1013
2361
  )
1014
2362
  ] });
1015
- }, Rt = () => {
1016
- const { healthScore: n } = $(), { finstrong: o } = S(), { key_indicators_borrow: t } = o, { user: i } = Y(), d = (a) => {
1017
- const { good: c, poor: p } = X.debtToIncomeRatio;
1018
- let h = f.MISSING, m = t.manage_debit_missing_description, _ = o.key_indicators_missing;
1019
- return a != null && (a <= c ? (h = f.GOOD, m = t.manage_debit_good_description, _ = o.key_indicators_good) : a > c && a <= p ? (h = f.FAIR, m = b(t.manage_debit_fair_description, a), _ = o.key_indicators_fair) : a > p && (h = f.OFF_TRACK, m = b(
1020
- t.manage_debit_off_track_description,
1021
- a
1022
- ), _ = o.key_indicators_off_track)), {
1023
- cardState: h,
1024
- description: m,
1025
- title: t.manage_debit_title,
1026
- stateTitle: _
2363
+ }, kr = v(wr), Mr = () => {
2364
+ const { healthScore: t } = L(), { finstrong: o } = x(), { key_indicators_borrow: n } = o, { user: r } = J(), s = (_) => {
2365
+ const d = ft(_), u = {
2366
+ GOOD: n.manage_debit_good_description,
2367
+ FAIR: n.manage_debit_fair_description,
2368
+ OFF_TRACK: n.manage_debit_off_track_description,
2369
+ MISSING: n.manage_debit_missing_description
2370
+ }, h = d === "FAIR" || d === "OFF_TRACK" ? K(u[d], _) : u[d];
2371
+ return {
2372
+ cardState: d,
2373
+ description: h,
2374
+ title: n.manage_debit_title
1027
2375
  };
1028
- }, l = (a) => {
1029
- const { good: c, poor: p } = X.creditScore;
1030
- let h = f.MISSING, m = t.credit_score_missing_description, _ = o.key_indicators_missing;
1031
- return a !== null && (a >= c ? (h = f.GOOD, m = b(t.credit_score_good_description, a), _ = o.key_indicators_good) : a < c && a >= p ? (h = f.FAIR, m = b(t.credit_score_fair_description, a), _ = o.key_indicators_fair) : a < p && (h = f.OFF_TRACK, m = b(
1032
- t.credit_score_off_track_description,
1033
- a
1034
- ), _ = o.key_indicators_off_track)), {
1035
- cardState: h,
1036
- description: m,
1037
- title: t.credit_score_title,
1038
- stateTitle: _
2376
+ }, i = (_) => {
2377
+ const d = gt(_), u = {
2378
+ GOOD: n.credit_score_good_description,
2379
+ FAIR: n.credit_score_fair_description,
2380
+ OFF_TRACK: n.credit_score_off_track_description,
2381
+ MISSING: n.credit_score_missing_description
2382
+ }, h = d === "MISSING" ? u[d] : K(u[d], _);
2383
+ return {
2384
+ cardState: d,
2385
+ description: h,
2386
+ title: n.credit_score_title
1039
2387
  };
1040
- }, { manageDebtStatus: s, creditScoreStatus: r } = C.useMemo(() => {
1041
- const a = n.debt_to_income_ratio !== null ? Math.round(n.debt_to_income_ratio * 100) : null, c = d(a), p = l(i.credit_score || null);
2388
+ }, { manageDebtStatus: c, creditScoreStatus: l } = m.useMemo(() => {
2389
+ const _ = t.debt_to_income_ratio !== null ? Math.round(t.debt_to_income_ratio * 100) : null, d = s(_), u = i(r.credit_score || null);
1042
2390
  return {
1043
- manageDebtStatus: c,
1044
- creditScoreStatus: p
2391
+ manageDebtStatus: d,
2392
+ creditScoreStatus: u
1045
2393
  };
1046
- }, [n.debt_to_income_ratio, i.credit_score, t, o]);
1047
- return /* @__PURE__ */ u(g, { direction: "column", gap: 24, sx: { p: 8, pt: 24 }, children: [
2394
+ }, [t.debt_to_income_ratio, r.credit_score, n, o]);
2395
+ return /* @__PURE__ */ a(p, { direction: "column", gap: 24, sx: { p: 8, pt: 24 }, children: [
1048
2396
  /* @__PURE__ */ e(
1049
- B,
2397
+ fe,
1050
2398
  {
1051
- cardState: s.cardState,
1052
- description: s.description,
1053
- stateTitle: s.stateTitle,
1054
- title: s.title
2399
+ cardState: c.cardState,
2400
+ description: c.description,
2401
+ drawerFor: de.HaveManageableDebt,
2402
+ title: c.title
1055
2403
  }
1056
2404
  ),
1057
2405
  /* @__PURE__ */ e(
1058
- B,
2406
+ fe,
1059
2407
  {
1060
- cardState: r.cardState,
1061
- description: r.description,
1062
- stateTitle: r.stateTitle,
1063
- title: r.title
2408
+ cardState: l.cardState,
2409
+ description: l.description,
2410
+ drawerFor: de.HaveAGoodCreditScore,
2411
+ title: l.title
1064
2412
  }
1065
2413
  )
1066
2414
  ] });
1067
- }, Ft = () => {
1068
- const [n, o] = C.useState(0), { finstrong: t } = S();
1069
- return /* @__PURE__ */ u(re, { children: [
1070
- /* @__PURE__ */ u(
1071
- nt,
2415
+ }, Dr = v(Mr), Ir = () => {
2416
+ const [t, o] = m.useState(0), { finstrong: n } = x();
2417
+ return /* @__PURE__ */ a(z, { children: [
2418
+ /* @__PURE__ */ a(
2419
+ Xe,
1072
2420
  {
1073
2421
  "aria-label": "Key Indicators",
1074
2422
  centered: !0,
1075
- onChange: (i, d) => o(d),
1076
- sx: { mb: 0 },
2423
+ onChange: (r, s) => o(s),
2424
+ selectionFollowsFocus: !0,
2425
+ sx: {
2426
+ mb: 0,
2427
+ "& .MuiTab-root": {
2428
+ minWidth: 0
2429
+ }
2430
+ },
1077
2431
  textColor: "primary",
1078
- value: n,
2432
+ value: t,
1079
2433
  variant: "fullWidth",
1080
2434
  children: [
1081
- /* @__PURE__ */ e(
1082
- oe,
1083
- {
1084
- "aria-controls": "spend-details-tabpanel-0",
1085
- icon: /* @__PURE__ */ e(ue, { sx: { mr: 8 } }),
1086
- iconPosition: "start",
1087
- id: "spend-details-tab-0",
1088
- label: t.key_indicators_spend.title,
1089
- sx: { minHeight: 44 }
1090
- }
1091
- ),
1092
- /* @__PURE__ */ e(
1093
- oe,
1094
- {
1095
- "aria-controls": "save-details-tabpanel-1",
1096
- icon: /* @__PURE__ */ e(Ge, { sx: { mr: 8 } }),
1097
- iconPosition: "start",
1098
- id: "save-details-tab-1",
1099
- label: t.key_indicators_save.title,
1100
- sx: { minHeight: 44 }
1101
- }
1102
- ),
1103
- /* @__PURE__ */ e(
1104
- oe,
1105
- {
1106
- "aria-controls": "borrow-details-tabpanel-2",
1107
- icon: /* @__PURE__ */ e(Le, { sx: { mr: 8 } }),
1108
- iconPosition: "start",
1109
- id: "borrow-details-tab-2",
1110
- label: t.key_indicators_borrow.title,
1111
- sx: { minHeight: 44 }
1112
- }
1113
- )
2435
+ /* @__PURE__ */ e(
2436
+ se,
2437
+ {
2438
+ "aria-controls": "spend-details-tabpanel-0",
2439
+ icon: /* @__PURE__ */ e(He, { sx: { mr: 8 } }),
2440
+ iconPosition: "start",
2441
+ id: "spend-details-tab-0",
2442
+ label: n.key_indicators_spend.title,
2443
+ sx: { minHeight: 44 }
2444
+ }
2445
+ ),
2446
+ /* @__PURE__ */ e(
2447
+ se,
2448
+ {
2449
+ "aria-controls": "save-details-tabpanel-1",
2450
+ icon: /* @__PURE__ */ e(pn, { sx: { mr: 8 } }),
2451
+ iconPosition: "start",
2452
+ id: "save-details-tab-1",
2453
+ label: n.key_indicators_save.title,
2454
+ sx: { minHeight: 44 }
2455
+ }
2456
+ ),
2457
+ /* @__PURE__ */ e(
2458
+ se,
2459
+ {
2460
+ "aria-controls": "borrow-details-tabpanel-2",
2461
+ icon: /* @__PURE__ */ e(_n, { sx: { mr: 8 } }),
2462
+ iconPosition: "start",
2463
+ id: "borrow-details-tab-2",
2464
+ label: n.key_indicators_borrow.title,
2465
+ sx: { minHeight: 44 }
2466
+ }
2467
+ )
2468
+ ]
2469
+ }
2470
+ ),
2471
+ /* @__PURE__ */ e(ce, { index: 0, name: "spend-details", value: t, children: /* @__PURE__ */ e(vr, {}) }),
2472
+ /* @__PURE__ */ e(ce, { index: 1, name: "save-details", value: t, children: /* @__PURE__ */ e(kr, {}) }),
2473
+ /* @__PURE__ */ e(ce, { index: 2, name: "borrow-details", value: t, children: /* @__PURE__ */ e(Dr, {}) })
2474
+ ] });
2475
+ }, Ar = v(Ir), Tr = ({ onClick: t }) => {
2476
+ const { finstrong: o } = x(), { isCopyLoaded: n } = q();
2477
+ return n ? /* @__PURE__ */ a(p, { sx: { alignItems: "center", gap: 12, pt: 12, pb: 32 }, children: [
2478
+ /* @__PURE__ */ e(_t, { size: 48 }),
2479
+ /* @__PURE__ */ a(p, { sx: { alignItems: "center", gap: 4, textAlign: "center" }, children: [
2480
+ /* @__PURE__ */ e(V, { children: o.missing_data_title }),
2481
+ /* @__PURE__ */ e(M, { sx: { width: { sm: 348 } }, variant: "subtitle1", children: o.missing_data_description })
2482
+ ] }),
2483
+ /* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(
2484
+ B,
2485
+ {
2486
+ endIcon: /* @__PURE__ */ e(Z, {}),
2487
+ onClick: t,
2488
+ size: "small",
2489
+ sx: {
2490
+ fontSize: 13,
2491
+ ":hover": {
2492
+ bgcolor: "transparent"
2493
+ }
2494
+ },
2495
+ variant: "text",
2496
+ children: o.connect_more_accounts_button
2497
+ }
2498
+ ) })
2499
+ ] }) : /* @__PURE__ */ e(ee, {});
2500
+ }, Or = v(Tr), Fr = ({
2501
+ firstDay: t,
2502
+ frequency: o,
2503
+ secondDay: n,
2504
+ incomeTransactions: r,
2505
+ setCurrentStep: s,
2506
+ setFirstDay: i,
2507
+ setFrequency: c,
2508
+ setSecondDay: l,
2509
+ transaction: _
2510
+ }) => {
2511
+ const { finstrong: d } = x();
2512
+ return /* @__PURE__ */ a(m.Fragment, { children: [
2513
+ /* @__PURE__ */ a(p, { children: [
2514
+ !!r.length && /* @__PURE__ */ e(k, { sx: { pb: 24 }, children: r.reduce((u, h, y) => {
2515
+ if (h.guid === _.guid) return u;
2516
+ const f = Vn(y, r), w = Yn(y, r);
2517
+ return u.push(
2518
+ /* @__PURE__ */ a(m.Fragment, { children: [
2519
+ f && /* @__PURE__ */ e(Xn, { children: It(h.date) }),
2520
+ /* @__PURE__ */ e(qn, { transaction: h }),
2521
+ /* @__PURE__ */ e(le, { sx: { ml: w ? 44 : 0 } })
2522
+ ] }, h.guid)
2523
+ ), u;
2524
+ }, []) }),
2525
+ /* @__PURE__ */ e(
2526
+ so,
2527
+ {
2528
+ firstDay: t,
2529
+ frequency: o,
2530
+ onFirstDayChange: i,
2531
+ onFrequencyChange: c,
2532
+ onSecondDayChange: l,
2533
+ secondDay: n,
2534
+ transaction: _
2535
+ }
2536
+ )
2537
+ ] }),
2538
+ /* @__PURE__ */ e(k, { sx: { px: 24 }, children: /* @__PURE__ */ e(
2539
+ B,
2540
+ {
2541
+ fullWidth: !0,
2542
+ onClick: () => s({ step: T.MonthlyIncome, type: "main" }),
2543
+ startIcon: /* @__PURE__ */ e(ht, {}),
2544
+ children: d.onboarding_add_more_income
2545
+ }
2546
+ ) })
2547
+ ] });
2548
+ }, Rr = v(Fr), Lr = ({ selectedDate: t, setSelectedDate: o }) => {
2549
+ const { finstrong: n } = x(), r = G(), s = (i) => {
2550
+ o(Math.floor(new Date(i).getTime() / 1e3));
2551
+ };
2552
+ return /* @__PURE__ */ e(k, { sx: { p: 24 }, children: /* @__PURE__ */ e(po, { dateAdapter: Ot, children: /* @__PURE__ */ e(
2553
+ _o,
2554
+ {
2555
+ disableFuture: !0,
2556
+ label: n.onboarding_select_date,
2557
+ onChange: s,
2558
+ slotProps: {
2559
+ nextIconButton: {
2560
+ sx: {
2561
+ color: "primary.main",
2562
+ "&:hover": { bgcolor: be(r.palette.primary.light, 0.1) }
2563
+ }
2564
+ },
2565
+ previousIconButton: {
2566
+ sx: {
2567
+ color: "primary.main",
2568
+ "&:hover": { bgcolor: be(r.palette.primary.light, 0.1) }
2569
+ }
2570
+ }
2571
+ },
2572
+ sx: {
2573
+ width: "100%",
2574
+ "& .MuiIconButton-edgeEnd": {
2575
+ color: "primary.main",
2576
+ "&:hover": { bgcolor: be(r.palette.primary.light, 0.1) }
2577
+ }
2578
+ },
2579
+ value: t ? new Date(t * 1e3) : null
2580
+ }
2581
+ ) }) });
2582
+ }, Pr = v(Lr), Br = ({ creditScore: t, setCreditScore: o }) => {
2583
+ const { finstrong: n } = x(), r = !isNaN(t);
2584
+ return /* @__PURE__ */ e(k, { sx: { p: 24 }, children: /* @__PURE__ */ e(
2585
+ Fe,
2586
+ {
2587
+ error: !r,
2588
+ fullWidth: !0,
2589
+ inputMode: "numeric",
2590
+ inputProps: {
2591
+ noValidate: !0,
2592
+ pattern: "[0-9]*"
2593
+ },
2594
+ label: n.credit_score,
2595
+ onChange: (s) => o(Number(s.target.value)),
2596
+ value: r ? t : ""
2597
+ }
2598
+ ) });
2599
+ }, Wr = v(Br), zt = ({ value: t, completeCopy: o }) => /* @__PURE__ */ a(p, { sx: { gap: 8 }, children: [
2600
+ /* @__PURE__ */ e(p, { sx: { flexDirection: "row", gap: 4 }, children: Array.from({ length: 4 }).map((n, r) => /* @__PURE__ */ e(
2601
+ k,
2602
+ {
2603
+ sx: {
2604
+ bgcolor: r < t ? "primary.main" : "neutral.light",
2605
+ borderRadius: "24px",
2606
+ height: 4,
2607
+ width: "100%"
2608
+ }
2609
+ },
2610
+ r
2611
+ )) }),
2612
+ /* @__PURE__ */ a(I, { sx: { color: "text.secondary" }, variant: "body2", children: [
2613
+ t / 4 * 100,
2614
+ "% ",
2615
+ o
2616
+ ] })
2617
+ ] }), $r = ({
2618
+ completeCopy: t,
2619
+ primaryText: o,
2620
+ secondaryText: n,
2621
+ value: r
2622
+ }) => /* @__PURE__ */ a(p, { sx: { gap: 20, p: 24 }, children: [
2623
+ /* @__PURE__ */ a(p, { sx: { gap: 8 }, children: [
2624
+ /* @__PURE__ */ e(V, { children: o }),
2625
+ /* @__PURE__ */ e(M, { variant: "subtitle1", children: n })
2626
+ ] }),
2627
+ /* @__PURE__ */ e(zt, { completeCopy: t, value: r })
2628
+ ] }), ct = {
2629
+ step: T.ConnectAccounts,
2630
+ type: "main"
2631
+ }, zr = ({ isOpen: t, onClose: o }) => {
2632
+ const { visibleAccounts: n } = xe(), { calculateHealthScore: r } = L(), { finstrong: s } = x(), { setSelectedAccounts: i } = q(), { addRepeatingTransaction: c, setDateRange: l } = Ve(), { filter: _, setFilter: d, transactions: u } = Ln(), { user: h, userProfile: y, updateUser: f, updateUserProfile: w } = J(), [C, D] = m.useState(h.credit_score || 0), [S, g] = m.useState(
2633
+ ct
2634
+ ), [b, P] = m.useState(1), [F, U] = m.useState(Mt.EveryMonth), [W, O] = m.useState([]), [E, pe] = m.useState(!1), [Se, te] = m.useState(!1), [j, ve] = m.useState(h.birthday), [H, we] = m.useState(15), [N, ae] = m.useState("");
2635
+ m.useEffect(() => {
2636
+ l({ start: At(it()), end: Tt(it()) });
2637
+ }, []), m.useEffect(() => {
2638
+ d({
2639
+ accounts: n.map((A) => A.guid),
2640
+ dateRange: {
2641
+ start: io(/* @__PURE__ */ new Date(), 90),
2642
+ end: /* @__PURE__ */ new Date()
2643
+ },
2644
+ custom: st
2645
+ }), i(n);
2646
+ }, [n]);
2647
+ const _e = m.useMemo(
2648
+ () => u.find((A) => A.guid === N),
2649
+ [N, u]
2650
+ ), he = m.useMemo(() => ({
2651
+ [T.ConnectAccounts]: !0,
2652
+ [T.MonthlyIncome]: !!N,
2653
+ [T.Birthday]: !!h.birthday || !!j,
2654
+ [T.CreditScore]: !!h.credit_score || !!C
2655
+ })[S.step], [C, S, j, N, h]), X = n.length > 0, Gt = m.useMemo(() => {
2656
+ const { step: A } = S;
2657
+ let R = 0;
2658
+ return A >= T.MonthlyIncome && X && R++, A >= T.Birthday && W.length && R++, A >= T.CreditScore && (h.birthday || h.credit_score) && R++, R;
2659
+ }, [S.step, X, W.length, h.birthday, h.credit_score]), Et = (A) => {
2660
+ d({
2661
+ ..._,
2662
+ custom: (R) => A ? lo(R, A) : st(R)
2663
+ });
2664
+ }, Ht = {
2665
+ [T.ConnectAccounts]: {
2666
+ main: X ? /* @__PURE__ */ e(Bt, { shouldShowBalance: !1 }) : null,
2667
+ mainActionContent: X ? s.onboarding_next : s.onboarding_add_accounts,
2668
+ primaryText: s.connect_your_accounts,
2669
+ secondaryText: s.onboarding_connect_your_accounts_secondary
2670
+ },
2671
+ [T.MonthlyIncome]: {
2672
+ detail: /* @__PURE__ */ e(
2673
+ Rr,
2674
+ {
2675
+ firstDay: b,
2676
+ frequency: F,
2677
+ incomeTransactions: W,
2678
+ secondDay: H,
2679
+ setCurrentStep: (A) => {
2680
+ g(A), O((R) => {
2681
+ if (R.some((ie) => ie.guid === N)) return R.filter((ie) => ie.guid !== N);
2682
+ const Ae = u.find((ie) => ie.guid === N);
2683
+ return Ae ? [...R, { ...Ae, firstDay: b, frequency: F, secondDay: H }] : R;
2684
+ });
2685
+ },
2686
+ setFirstDay: P,
2687
+ setFrequency: U,
2688
+ setSecondDay: we,
2689
+ transaction: _e
2690
+ }
2691
+ ),
2692
+ detailActionContent: s.onboarding_confirm_income,
2693
+ main: /* @__PURE__ */ e(
2694
+ co,
2695
+ {
2696
+ onSearch: Et,
2697
+ onSelected: (A) => {
2698
+ g({ step: T.MonthlyIncome, type: "detail" }), ae(A);
2699
+ }
2700
+ }
2701
+ ),
2702
+ mainActionContent: s.onboarding_confirm_income,
2703
+ primaryText: s.onboarding_add_income_primary,
2704
+ secondaryText: s.onboarding_add_income_secondary
2705
+ },
2706
+ [T.Birthday]: {
2707
+ main: /* @__PURE__ */ e(Pr, { selectedDate: j, setSelectedDate: ve }),
2708
+ mainActionContent: s.onboarding_next,
2709
+ primaryText: s.onboarding_birthday_primary,
2710
+ secondaryText: s.onboarding_birthday_secondary
2711
+ },
2712
+ [T.CreditScore]: {
2713
+ main: /* @__PURE__ */ e(Wr, { creditScore: C, setCreditScore: D }),
2714
+ mainActionContent: s.onboarding_next,
2715
+ primaryText: s.onboarding_credit_score_primary,
2716
+ secondaryText: s.onboarding_credit_score_secondary
2717
+ }
2718
+ }, Qe = () => {
2719
+ g(ct), pe(!1), ae(""), o();
2720
+ }, Ze = async () => {
2721
+ pe(!0), await Vt(W), await r(), await w({ ...y, has_completed_finstrong_onboarding: !0 }), Qe();
2722
+ }, Nt = () => {
2723
+ if (S.step === T.CreditScore) {
2724
+ Ze();
2725
+ return;
2726
+ }
2727
+ g({ step: S.step + 1, type: "main" });
2728
+ }, jt = () => {
2729
+ const { step: A } = S, R = A + 1;
2730
+ switch (A) {
2731
+ case T.Birthday:
2732
+ j && j !== h.birthday && f({ ...h, birthday: j });
2733
+ break;
2734
+ case T.CreditScore:
2735
+ C && C !== h.credit_score && f({ ...h, credit_score: C }), Ze();
2736
+ return;
2737
+ case T.MonthlyIncome:
2738
+ N && W.findIndex(({ guid: me }) => me === N) === -1 && O((me) => [
2739
+ ...me,
2740
+ { ..._e, firstDay: b, frequency: F, secondDay: H }
2741
+ ]);
2742
+ break;
2743
+ case T.ConnectAccounts:
2744
+ if (!X) {
2745
+ te(!0);
2746
+ return;
2747
+ }
2748
+ break;
2749
+ }
2750
+ R in T && g({ step: R, type: "main" });
2751
+ }, Kt = () => {
2752
+ const { step: A, type: R } = S;
2753
+ if (R === "detail") {
2754
+ g({ step: A, type: "main" });
2755
+ return;
2756
+ }
2757
+ if (A === T.Birthday && W.length) {
2758
+ g({ step: A - 1, type: "detail" });
2759
+ return;
2760
+ }
2761
+ A > T.ConnectAccounts && g({ step: A - 1, type: "main" });
2762
+ }, Vt = async (A) => {
2763
+ for (const R of A) {
2764
+ const {
2765
+ account_guid: me,
2766
+ amount: Ae,
2767
+ date: ie,
2768
+ description: qt,
2769
+ feed_description: Ut,
2770
+ firstDay: Qt,
2771
+ frequency: Je,
2772
+ secondDay: Zt,
2773
+ merchant_guid: Jt,
2774
+ payee: en,
2775
+ transaction_type: tn
2776
+ } = R, nn = Nn(Je, ao(ie)), on = {
2777
+ account_guid: me,
2778
+ amount: Ae,
2779
+ created_by: 0,
2780
+ description: en || qt || Ut,
2781
+ merchant_guid: Jt,
2782
+ predicted_occurs_on: ro(nn, { representation: "date" }),
2783
+ recurrence_day: Qt,
2784
+ recurrence_type: Je,
2785
+ repeating_transaction_type: Dt.Income,
2786
+ second_recurrence_day: Zt,
2787
+ transaction_type: tn,
2788
+ user_guid: h.guid
2789
+ };
2790
+ await c(on, R);
2791
+ }
2792
+ }, ue = Ht[S.step], Ie = S.step === T.ConnectAccounts, Yt = {
2793
+ fullWidth: !0,
2794
+ ...Ie && !X && { startIcon: /* @__PURE__ */ e(ht, {}) }
2795
+ }, Xt = !Ie || Ie && !X;
2796
+ return /* @__PURE__ */ a(m.Fragment, { children: [
2797
+ /* @__PURE__ */ e(
2798
+ oe,
2799
+ {
2800
+ footerStyles: { px: 24, py: 16 },
2801
+ hasSecondaryAction: !Ie,
2802
+ isOpen: t,
2803
+ isPrimaryDisabled: !he,
2804
+ onClose: Qe,
2805
+ onSecondaryAction: Kt,
2806
+ primaryButtonProps: Yt,
2807
+ primaryText: ue?.mainActionContent,
2808
+ secondaryColor: "primary",
2809
+ secondaryText: s.onboarding_back,
2810
+ title: s.title,
2811
+ ...!E && { onPrimaryAction: jt },
2812
+ children: /* @__PURE__ */ a(p, { sx: { bgcolor: "background.default", height: "100%" }, children: [
2813
+ E && /* @__PURE__ */ a(p, { sx: { alignItems: "center", gap: 24, position: "relative", px: 16, top: 126 }, children: [
2814
+ /* @__PURE__ */ e("img", { alt: "", src: Oo, style: { minHeight: 100, width: 211 } }),
2815
+ /* @__PURE__ */ e(Le, { children: s.onboarding_calculate_primary }),
2816
+ /* @__PURE__ */ e(M, { sx: { textAlign: "center" }, variant: "subtitle1", children: s.onboarding_calculate_secondary })
2817
+ ] }),
2818
+ ue && !E && /* @__PURE__ */ a(m.Fragment, { children: [
2819
+ /* @__PURE__ */ e(
2820
+ $r,
2821
+ {
2822
+ completeCopy: s.complete,
2823
+ primaryText: ue.primaryText,
2824
+ secondaryText: ue.secondaryText,
2825
+ value: Gt
2826
+ }
2827
+ ),
2828
+ S.type === "main" && /* @__PURE__ */ a(k, { sx: { bgcolor: "background.default" }, children: [
2829
+ ue.main,
2830
+ Xt && /* @__PURE__ */ e(p, { sx: { alignItems: "center", px: 24, py: 12 }, children: /* @__PURE__ */ e(B, { fullWidth: !0, onClick: Nt, children: s.onboarding_do_it_later }) })
2831
+ ] }),
2832
+ S.type === "detail" && ue.detail
2833
+ ] })
2834
+ ] })
2835
+ }
2836
+ ),
2837
+ /* @__PURE__ */ e(
2838
+ re,
2839
+ {
2840
+ onClose: () => te(!1),
2841
+ showConnectWidget: Se,
2842
+ title: s.connect_more_accounts_button
2843
+ }
2844
+ )
2845
+ ] });
2846
+ }, Gr = v(zr), Er = () => {
2847
+ const { finstrong: t } = x(), [o, n] = m.useState(!1);
2848
+ return /* @__PURE__ */ a(m.Fragment, { children: [
2849
+ /* @__PURE__ */ a(
2850
+ p,
2851
+ {
2852
+ sx: {
2853
+ alignItems: "center",
2854
+ gap: 48,
2855
+ pb: 24,
2856
+ pt: 72,
2857
+ px: 16
2858
+ },
2859
+ children: [
2860
+ /* @__PURE__ */ a(p, { sx: { alignItems: { sm: "center" }, gap: 24, width: "100%" }, children: [
2861
+ /* @__PURE__ */ e(k, { sx: { textAlign: "center" }, children: /* @__PURE__ */ e(hn, { size: 72 }) }),
2862
+ /* @__PURE__ */ a(p, { sx: { gap: 4, textAlign: "center", width: { sm: 400 } }, children: [
2863
+ /* @__PURE__ */ e(Le, { children: t.onboarding_title }),
2864
+ /* @__PURE__ */ e(M, { sx: { color: "text.secondary" }, variant: "subtitle1", children: t.onboarding_subtitle })
2865
+ ] })
2866
+ ] }),
2867
+ /* @__PURE__ */ e(B, { onClick: () => n(!0), variant: "contained", children: t.onboarding_get_started })
1114
2868
  ]
1115
2869
  }
1116
2870
  ),
1117
- /* @__PURE__ */ e(ne, { index: 0, name: "spend-details", value: n, children: /* @__PURE__ */ e(Tt, {}) }),
1118
- /* @__PURE__ */ e(ne, { index: 1, name: "save-details", value: n, children: /* @__PURE__ */ e(wt, {}) }),
1119
- /* @__PURE__ */ e(ne, { index: 2, name: "borrow-details", value: n, children: /* @__PURE__ */ e(Rt, {}) })
2871
+ /* @__PURE__ */ e(Gr, { isOpen: o, onClose: () => n(!1) })
1120
2872
  ] });
1121
- }, Pt = ({
1122
- additionalContent: n,
1123
- children: o,
1124
- description: t,
1125
- drawerTitle: i,
1126
- isOpen: d,
1127
- loadConnectAccountsCard: l = !0,
1128
- onClose: s,
1129
- stickyComponent: r,
1130
- title: a
1131
- }) => {
1132
- const { finstrong: c } = S(), { isCopyLoaded: p } = z();
1133
- return p ? /* @__PURE__ */ u(V, { isOpen: d, onClose: s, title: i || c.key_indicators, children: [
1134
- (a || t) && /* @__PURE__ */ u(g, { sx: { p: 24, pb: 0, gap: 8, backgroundColor: "background.paper" }, children: [
1135
- a && /* @__PURE__ */ e(H, { children: a }),
1136
- t && /* @__PURE__ */ e(y, { children: t })
2873
+ }, Hr = ({ isOpen: t, onClose: o }) => {
2874
+ const { finstrong: n } = x(), r = G(), { updateUser: s, user: i } = J(), [c, l] = m.useState(i.birthday), _ = (u) => {
2875
+ l(Math.floor(new Date(u).getTime() / 1e3));
2876
+ };
2877
+ return /* @__PURE__ */ e(
2878
+ oe,
2879
+ {
2880
+ isOpen: t,
2881
+ onClose: o,
2882
+ onPrimaryAction: () => {
2883
+ !c || c === i.birthday || (s({ ...i, birthday: c }), o());
2884
+ },
2885
+ onSecondaryAction: o,
2886
+ title: n.date_of_birth,
2887
+ children: /* @__PURE__ */ e(p, { sx: { bgcolor: "background.default", height: "100%" }, children: /* @__PURE__ */ e(mo, { dateAdapter: Ot, children: /* @__PURE__ */ e(
2888
+ ho,
2889
+ {
2890
+ disableFuture: !0,
2891
+ onChange: _,
2892
+ slotProps: {
2893
+ nextIconButton: {
2894
+ sx: {
2895
+ color: "primary.main",
2896
+ "&:hover": { bgcolor: be(r.palette.primary.light, 0.1) }
2897
+ }
2898
+ },
2899
+ previousIconButton: {
2900
+ sx: {
2901
+ color: "primary.main",
2902
+ "&:hover": { bgcolor: be(r.palette.primary.light, 0.1) }
2903
+ }
2904
+ }
2905
+ },
2906
+ slots: {
2907
+ actionBar: () => null,
2908
+ toolbar: () => null
2909
+ },
2910
+ sx: {
2911
+ width: "100%",
2912
+ "& .MuiIconButton-edgeEnd": {
2913
+ color: "primary.main",
2914
+ "&:hover": { bgcolor: be(r.palette.primary.light, 0.1) }
2915
+ }
2916
+ },
2917
+ value: c ? new Date(c * 1e3) : /* @__PURE__ */ new Date()
2918
+ }
2919
+ ) }) })
2920
+ }
2921
+ );
2922
+ }, Nr = v(Hr), jr = ({ isOpen: t, onClose: o }) => {
2923
+ const { visibleFinstrongAccounts: n } = xe(), {
2924
+ accounts: r,
2925
+ common: s,
2926
+ finstrong: i
2927
+ } = x(), { repeatingTransactions: c } = Ve(), { user: l } = J(), _ = c.reduce((f, w) => {
2928
+ const { repeating_transaction_type: C, transactions: D, recurrence_type: S, amount: g } = w;
2929
+ return C === Dt.Income && (D.length > 0 || S === Mt.EveryYear) ? f + g : f;
2930
+ }, 0), [d, u] = m.useState(null), y = [
2931
+ {
2932
+ dynamicCopy: i.add_profile_item,
2933
+ fallbackLabel: i.monthly_income,
2934
+ icon: /* @__PURE__ */ e(un, {}),
2935
+ key: ne.MonthlyIncome,
2936
+ label: i.monthly_income,
2937
+ value: _
2938
+ },
2939
+ {
2940
+ dynamicCopy: i.add_profile_item,
2941
+ fallbackLabel: i.date_of_birth,
2942
+ icon: /* @__PURE__ */ e(mn, {}),
2943
+ key: ne.DateOfBirth,
2944
+ label: i.date_of_birth,
2945
+ value: l.birthday
2946
+ },
2947
+ {
2948
+ dynamicCopy: i.add_profile_item,
2949
+ fallbackLabel: i.credit_score,
2950
+ icon: /* @__PURE__ */ e(He, {}),
2951
+ key: ne.CreditScore,
2952
+ label: i.credit_score,
2953
+ value: l.credit_score
2954
+ },
2955
+ {
2956
+ fallbackLabel: i.connect_your_accounts,
2957
+ icon: /* @__PURE__ */ e(pt, {}),
2958
+ key: ne.Connections,
2959
+ label: i.connections,
2960
+ value: n.length > 0 ? K(
2961
+ i.connected_account,
2962
+ String(n.length),
2963
+ n.length > 1 ? i.accounts : i.account
2964
+ ) : void 0
2965
+ }
2966
+ ].map((f) => Tn(f));
2967
+ return /* @__PURE__ */ a(oe, { isOpen: t, onClose: o, title: i.financial_profile, children: [
2968
+ /* @__PURE__ */ a(p, { sx: { bgcolor: "background.default", height: "100%" }, children: [
2969
+ /* @__PURE__ */ a(p, { sx: { gap: 20, p: 24 }, children: [
2970
+ /* @__PURE__ */ a(p, { sx: { gap: 8 }, children: [
2971
+ /* @__PURE__ */ e(V, { children: i.your_financial_profile }),
2972
+ /* @__PURE__ */ e(M, { children: i.financial_profile_description })
2973
+ ] }),
2974
+ /* @__PURE__ */ e(
2975
+ zt,
2976
+ {
2977
+ completeCopy: i.complete,
2978
+ value: y.reduce((f, w) => f + (w.isComplete ? 1 : 0), 0)
2979
+ }
2980
+ )
2981
+ ] }),
2982
+ /* @__PURE__ */ e(On, { list: y, onClickItem: u }),
2983
+ /* @__PURE__ */ e(k, { sx: { p: 24 }, children: /* @__PURE__ */ e(
2984
+ Pe,
2985
+ {
2986
+ description: i.connect_more_accounts_to_view_more_accurate_financial_picture,
2987
+ drawerType: "connectDrawer",
2988
+ isDashboard: !0,
2989
+ title: i.dont_see_all_your_accounts,
2990
+ titleDrawer: s.add_accounts
2991
+ }
2992
+ ) })
1137
2993
  ] }),
1138
- r && /* @__PURE__ */ e(
1139
- x,
2994
+ /* @__PURE__ */ e(
2995
+ oe,
1140
2996
  {
1141
- sx: {
1142
- position: "sticky",
1143
- top: 0,
1144
- zIndex: 1
1145
- },
1146
- children: r
2997
+ isOpen: d === ne.MonthlyIncome,
2998
+ onClose: () => u(null),
2999
+ title: s.settings,
3000
+ children: /* @__PURE__ */ e(uo, {})
1147
3001
  }
1148
3002
  ),
1149
- n && /* @__PURE__ */ e(x, { children: n }),
1150
- /* @__PURE__ */ e(ge, {}),
1151
- /* @__PURE__ */ u(g, { sx: { p: 24, gap: 24 }, children: [
1152
- o,
1153
- l && /* @__PURE__ */ e(Q, { isDashboard: !0 })
1154
- ] })
1155
- ] }) : /* @__PURE__ */ e(N, {});
1156
- }, Gt = I(Pt), pe = ({
1157
- content: n,
3003
+ /* @__PURE__ */ e(Nr, { isOpen: d === ne.DateOfBirth, onClose: () => u(null) }),
3004
+ /* @__PURE__ */ e(Lt, { isOpen: d === ne.CreditScore, onClose: () => u(null) }),
3005
+ /* @__PURE__ */ e(
3006
+ Ct,
3007
+ {
3008
+ onClose: () => u(null),
3009
+ showConnectionsWidget: d === ne.Connections,
3010
+ title: r.manage_connections
3011
+ }
3012
+ )
3013
+ ] });
3014
+ }, Kr = v(jr), lt = ({
3015
+ content: t,
1158
3016
  islast: o = !1
1159
- }) => /* @__PURE__ */ u(st, { sx: { minHeight: 0 }, children: [
1160
- /* @__PURE__ */ u(pt, { children: [
1161
- /* @__PURE__ */ e(dt, { sx: { bgcolor: "divider", borderWidth: 1, p: 3 } }),
1162
- !o && /* @__PURE__ */ e(ct, { sx: { bgcolor: "divider", width: 0.1 } })
3017
+ }) => /* @__PURE__ */ a(bo, { sx: { minHeight: 0 }, children: [
3018
+ /* @__PURE__ */ a(vo, { children: [
3019
+ /* @__PURE__ */ e(So, { sx: { bgcolor: "divider", borderWidth: 1, p: 3 } }),
3020
+ !o && /* @__PURE__ */ e(xo, { sx: { bgcolor: "divider", width: 0.1 } })
1163
3021
  ] }),
1164
- /* @__PURE__ */ e(lt, { sx: { pb: 16, pl: 12, pr: 0, pt: 5 }, children: /* @__PURE__ */ e(y, { fontSize: 13, fontWeight: 400, variant: "subtitle2", children: n }) })
1165
- ] }), Lt = ({ report: n }) => {
1166
- const { finstrong: o } = S(), { score_history_drawer_timeline: t } = o, {
1167
- health_score_point_difference: i,
1168
- newer_credit_score: d,
1169
- older_credit_score: l,
1170
- older_spend_to_income_ratio: s,
1171
- newer_spend_to_income_ratio: r,
1172
- older_health_score: a,
1173
- newer_health_score: c,
1174
- newer_score_calculated_at: p
1175
- } = n, h = _e(new Date(p), "MMM d"), m = () => i === 0 ? "info.lighter" : i > 0 ? "success.lighter" : "error.lighter", _ = () => i === 0 ? b(t.stayed_at, a) : i > 0 ? t.less_spending : t.more_spending, R = () => {
1176
- if (i === 0) return null;
1177
- const T = i > 0 ? t.up_from : t.down_from, v = b(T, a, c);
1178
- return /* @__PURE__ */ u(re, { children: [
3022
+ /* @__PURE__ */ e(Co, { sx: { pb: 16, pl: 12, pr: 0, pt: 5 }, children: /* @__PURE__ */ e(M, { fontSize: 13, fontWeight: 400, variant: "subtitle2", children: t }) })
3023
+ ] }), Vr = ({ report: t }) => {
3024
+ const { finstrong: o } = x(), { score_history_drawer_timeline: n } = o, {
3025
+ health_score_point_difference: r,
3026
+ newer_credit_score: s,
3027
+ older_credit_score: i,
3028
+ older_spend_to_income_ratio: c,
3029
+ newer_spend_to_income_ratio: l,
3030
+ older_health_score: _,
3031
+ newer_health_score: d,
3032
+ newer_score_calculated_at: u
3033
+ } = t, h = go(new Date(u), "MMM d"), y = () => r === 0 ? "info.light" : r > 0 ? "success.light" : "error.light", f = () => r === 0 ? K(n.stayed_at, _) : r > 0 ? n.less_spending : n.more_spending, w = () => {
3034
+ if (r === 0) return null;
3035
+ const C = r > 0 ? n.up_from : n.down_from, D = K(C, _, d);
3036
+ return /* @__PURE__ */ a(z, { children: [
1179
3037
  /* @__PURE__ */ e(
1180
- he,
3038
+ bn,
1181
3039
  {
1182
3040
  fill: !0,
1183
3041
  name: "circle",
1184
3042
  sx: { color: "text.secondary", fontSize: 8, mx: 4, p: 1 }
1185
3043
  }
1186
3044
  ),
1187
- v
3045
+ D
1188
3046
  ] });
1189
3047
  };
1190
- return /* @__PURE__ */ e(J, { children: /* @__PURE__ */ u(g, { sx: { backgroundColor: "background.paper" }, children: [
1191
- /* @__PURE__ */ e(x, { sx: { borderBottom: "1px solid", borderBottomColor: "divider", p: 16 }, children: /* @__PURE__ */ u(
1192
- g,
3048
+ return /* @__PURE__ */ a(Y, { children: [
3049
+ /* @__PURE__ */ e(
3050
+ k,
1193
3051
  {
1194
- flexDirection: "row",
1195
- sx: { alignItems: "center", gap: 16, height: 48, width: "100%" },
1196
- children: [
1197
- /* @__PURE__ */ e(
1198
- g,
1199
- {
1200
- sx: {
1201
- alignItems: "center",
1202
- backgroundColor: m(),
1203
- borderRadius: 999,
1204
- height: 48,
1205
- justifyContent: "center",
1206
- minWidth: 48
1207
- },
1208
- children: /* @__PURE__ */ e(y, { sx: { fontWeight: 600 }, variant: "Body", children: i > 0 ? `+${i}` : i })
1209
- }
1210
- ),
1211
- /* @__PURE__ */ u(g, { sx: { gap: 2, width: "80%" }, children: [
1212
- /* @__PURE__ */ e(W, { fontWeight: 600, variant: "Body", children: _() }),
1213
- /* @__PURE__ */ u(W, { sx: { color: "text.secondary" }, variant: "subtitle2", children: [
1214
- h,
1215
- " ",
1216
- R()
1217
- ] })
1218
- ] })
1219
- ]
3052
+ sx: {
3053
+ borderBottomColor: "divider",
3054
+ borderBottomStyle: "solid",
3055
+ borderBottomWidth: r !== 0 ? 1 : 0,
3056
+ p: 16
3057
+ },
3058
+ children: /* @__PURE__ */ a(
3059
+ p,
3060
+ {
3061
+ flexDirection: "row",
3062
+ sx: { alignItems: "center", gap: 16, height: 48, width: "100%" },
3063
+ children: [
3064
+ /* @__PURE__ */ e(
3065
+ p,
3066
+ {
3067
+ sx: {
3068
+ alignItems: "center",
3069
+ backgroundColor: y(),
3070
+ borderRadius: 999,
3071
+ height: 48,
3072
+ justifyContent: "center",
3073
+ width: 48
3074
+ },
3075
+ children: /* @__PURE__ */ e(M, { sx: { fontWeight: 600 }, variant: "body1", children: r > 0 ? `+${r}` : r })
3076
+ }
3077
+ ),
3078
+ /* @__PURE__ */ a(p, { sx: { gap: 2, width: "80%" }, children: [
3079
+ /* @__PURE__ */ e(I, { fontWeight: 600, variant: "body1", children: f() }),
3080
+ /* @__PURE__ */ a(I, { sx: { color: "text.secondary" }, variant: "subtitle2", children: [
3081
+ h,
3082
+ " ",
3083
+ w()
3084
+ ] })
3085
+ ] })
3086
+ ]
3087
+ }
3088
+ )
1220
3089
  }
1221
- ) }),
1222
- i !== 0 && /* @__PURE__ */ e(x, { sx: { color: "text.secondary", pb: 8, pl: 32, pr: 16, pt: 12 }, children: /* @__PURE__ */ u(
1223
- it,
3090
+ ),
3091
+ r !== 0 && /* @__PURE__ */ e(k, { sx: { color: "text.secondary", pb: 8, pl: 32, pr: 16, pt: 12 }, children: /* @__PURE__ */ a(
3092
+ yo,
1224
3093
  {
1225
3094
  sx: {
1226
- [`& .${at.root}:before`]: {
3095
+ [`& .${fo.root}:before`]: {
1227
3096
  flex: 0,
1228
3097
  padding: 0
1229
3098
  },
@@ -1232,22 +3101,22 @@ const ut = ({ list: n, onClickItem: o }) => /* @__PURE__ */ e(x, { sx: { bgcolor
1232
3101
  },
1233
3102
  children: [
1234
3103
  /* @__PURE__ */ e(
1235
- pe,
3104
+ lt,
1236
3105
  {
1237
- content: b(
1238
- t.spend_to_income_description,
1239
- de(s),
1240
- de(r)
3106
+ content: K(
3107
+ n.spend_to_income_description,
3108
+ Oe(c),
3109
+ Oe(l)
1241
3110
  )
1242
3111
  }
1243
3112
  ),
1244
3113
  /* @__PURE__ */ e(
1245
- pe,
3114
+ lt,
1246
3115
  {
1247
- content: b(
1248
- t.credit_score_description,
1249
- l,
1250
- d
3116
+ content: K(
3117
+ n.credit_score_description,
3118
+ i,
3119
+ s
1251
3120
  ),
1252
3121
  islast: !0
1253
3122
  }
@@ -1255,206 +3124,445 @@ const ut = ({ list: n, onClickItem: o }) => /* @__PURE__ */ e(x, { sx: { bgcolor
1255
3124
  ]
1256
3125
  }
1257
3126
  ) })
1258
- ] }) });
1259
- }, Et = I(Lt), Wt = ({ isOpen: n, onClose: o }) => {
1260
- const t = G(), { finstrong: i } = S(), { isCopyLoaded: d, isInitialized: l } = z(), { healthScore: s, healthScoreChangeReports: r, augmentedChartData: a } = $();
1261
- if (!d || !l) return /* @__PURE__ */ e(N, {});
1262
- const c = ie(s.health_score || 0, i), p = r.slice().reverse();
3127
+ ] });
3128
+ }, Yr = v(Vr), Xr = ({ isOpen: t, onClose: o }) => {
3129
+ const n = G(), { finstrong: r } = x(), { isCopyLoaded: s, isInitialized: i } = q(), { augmentedChartData: c, healthScore: l, healthScoreChangeReports: _, peerScore: d } = L();
3130
+ if (!s || !i) return /* @__PURE__ */ e(ee, {});
3131
+ const u = Ne(l.health_score || 0, r), h = _.slice().reverse();
1263
3132
  return /* @__PURE__ */ e(
1264
- Gt,
3133
+ Pt,
1265
3134
  {
1266
- additionalContent: /* @__PURE__ */ e(g, { sx: { pl: 18, backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(
1267
- be,
3135
+ additionalContent: /* @__PURE__ */ e(p, { sx: { backgroundColor: "background.paper" }, children: /* @__PURE__ */ e(
3136
+ Ye,
1268
3137
  {
1269
- axisColor: t.palette.divider,
3138
+ axisColor: n.palette.divider,
1270
3139
  baseline: "min",
1271
- colors: [t.palette.primary.main],
3140
+ colors: [n.palette.primary.main],
1272
3141
  curveType: "natural",
1273
- datasets: [a],
3142
+ datasets: [c],
1274
3143
  height: 160,
1275
- labels: [i.key_indicators_label],
1276
- margin: { top: 12, left: 24 },
3144
+ isGraphClippingXAxis: !0,
3145
+ labels: [r.key_indicators_label],
3146
+ margin: { top: 24, bottom: 32, right: 24, left: 45 },
3147
+ peerAverage: Math.round(d?.average_health_score?.average_health_score || 0),
1277
3148
  showArea: !0,
1278
3149
  showAverage: !0,
1279
- title: i.peer_average,
3150
+ title: r.peer_average,
1280
3151
  useCustomMark: !0
1281
3152
  }
1282
3153
  ) }),
1283
- drawerTitle: i.score_history,
1284
- isOpen: n,
3154
+ drawerTitle: r.score_history,
3155
+ isOpen: t,
1285
3156
  loadConnectAccountsCard: !1,
1286
3157
  onClose: o,
1287
- stickyComponent: /* @__PURE__ */ u(
1288
- g,
3158
+ stickyComponent: /* @__PURE__ */ e(
3159
+ p,
1289
3160
  {
1290
- direction: "row",
1291
- sx: { backgroundColor: "background.paper", gap: 16, pb: 12, pt: 8, px: 24 },
1292
- children: [
1293
- /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(
1294
- ve,
3161
+ sx: {
3162
+ backgroundColor: "background.paper",
3163
+ borderBottom: "1px solid",
3164
+ borderColor: "divider",
3165
+ pb: 11,
3166
+ pt: 8,
3167
+ px: 24
3168
+ },
3169
+ children: /* @__PURE__ */ a(p, { sx: { alignItems: "center", flexDirection: "row", gap: 16 }, children: [
3170
+ /* @__PURE__ */ e(
3171
+ Rt,
1295
3172
  {
1296
- arcRadius: 20,
1297
- healthScore: s?.health_score,
3173
+ arcRadius: 24,
3174
+ healthScore: l?.health_score,
3175
+ margin: { top: 9 },
1298
3176
  size: "SM"
1299
3177
  }
1300
- ) }),
1301
- /* @__PURE__ */ u(x, { children: [
1302
- /* @__PURE__ */ e(y, { fontSize: 18, fontWeight: 700, sx: { mb: 4 }, variant: "subtitle1", children: c.status }),
1303
- /* @__PURE__ */ e(y, { variant: "caption", children: c.description })
3178
+ ),
3179
+ /* @__PURE__ */ a(p, { sx: { gap: 4 }, children: [
3180
+ /* @__PURE__ */ e(M, { variant: "h3", children: u.status }),
3181
+ /* @__PURE__ */ e(M, { variant: "caption", children: u.description })
1304
3182
  ] })
1305
- ]
3183
+ ] })
1306
3184
  }
1307
3185
  ),
1308
- children: /* @__PURE__ */ e(g, { sx: { gap: 16 }, children: p.map((h, m) => /* @__PURE__ */ e(Et, { report: h }, m)) })
3186
+ children: /* @__PURE__ */ e(p, { sx: { gap: 16 }, children: h.map((y, f) => /* @__PURE__ */ e(Yr, { report: y }, f)) })
1309
3187
  }
1310
3188
  );
1311
- }, Bt = I(Wt), Ht = ({ onClick: n }) => {
1312
- const { finstrong: o } = S(), { isCopyLoaded: t } = z();
1313
- return t ? /* @__PURE__ */ u(g, { sx: { alignItems: "center", gap: 12, pt: 12, pb: 32 }, children: [
1314
- /* @__PURE__ */ e(Ee, { size: 48 }),
1315
- /* @__PURE__ */ u(g, { sx: { alignItems: "center", gap: 4, textAlign: "center" }, children: [
1316
- /* @__PURE__ */ e(H, { children: o.missing_data_title }),
1317
- /* @__PURE__ */ e(y, { sx: { width: { sm: 348 } }, variant: "subtitle1", children: o.missing_data_description })
3189
+ }, qr = v(Xr), Ur = ({ copy: t }) => {
3190
+ const o = G(), n = [
3191
+ o.palette.chartMono.chartMono5,
3192
+ o.palette.chartMono.chartMono4,
3193
+ o.palette.chartMono.chartMono3,
3194
+ o.palette.chartMono.chartMono2
3195
+ ];
3196
+ return /* @__PURE__ */ a(p, { sx: { gap: 8 }, children: [
3197
+ /* @__PURE__ */ e(p, { sx: { flexDirection: "row", gap: 8, px: 2 }, children: [
3198
+ { color: "chartMono.chartMono2", text: t.vulnerable, value: "0-25" },
3199
+ { color: "chartMono.chartMono3", text: t.building, value: "26-50" },
3200
+ { color: "chartMono.chartMono4", text: t.stable, value: "51-75" },
3201
+ { color: "chartMono.chartMono5", text: t.strong, value: "76-100" }
3202
+ ].map(({ color: r, text: s, value: i }) => /* @__PURE__ */ a(p, { sx: { gap: 4, textAlign: "center", width: "100%" }, children: [
3203
+ /* @__PURE__ */ a(k, { children: [
3204
+ /* @__PURE__ */ e(M, { sx: { fontWeight: 700, textTransform: "uppercase" }, variant: "caption", children: s }),
3205
+ /* @__PURE__ */ a(I, { sx: { color: "text.secondary" }, variant: "caption", children: [
3206
+ "(",
3207
+ i,
3208
+ ")"
3209
+ ] })
3210
+ ] }),
3211
+ /* @__PURE__ */ e(k, { sx: { border: "2px solid", borderColor: r, borderRadius: "3px" } })
3212
+ ] }, s)) }),
3213
+ /* @__PURE__ */ a(k, { children: [
3214
+ /* @__PURE__ */ e(
3215
+ k,
3216
+ {
3217
+ sx: {
3218
+ background: `linear-gradient(to left, ${n.join(", ")})`,
3219
+ borderRadius: "4px",
3220
+ height: 16
3221
+ }
3222
+ }
3223
+ ),
3224
+ /* @__PURE__ */ e(p, { sx: { flexDirection: "row", justifyContent: "space-between" }, children: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100].map((r) => /* @__PURE__ */ a(
3225
+ p,
3226
+ {
3227
+ sx: { alignItems: "center", height: 20, justifyContent: "space-between", width: 24 },
3228
+ children: [
3229
+ /* @__PURE__ */ e(
3230
+ k,
3231
+ {
3232
+ sx: {
3233
+ borderBottom: "1px solid",
3234
+ borderColor: "divider",
3235
+ position: "relative",
3236
+ rotate: "90deg",
3237
+ top: 3.5,
3238
+ width: 8
3239
+ }
3240
+ }
3241
+ ),
3242
+ /* @__PURE__ */ e(I, { sx: { color: "text.secondary" }, variant: "tiny", children: r })
3243
+ ]
3244
+ },
3245
+ r
3246
+ )) })
3247
+ ] })
3248
+ ] });
3249
+ }, Qr = ({ isOpen: t, onClose: o }) => {
3250
+ const { finstrong: n } = x(), { isCopyLoaded: r } = q();
3251
+ return r ? /* @__PURE__ */ e(oe, { isOpen: t, onClose: o, title: n.score_rubric, children: /* @__PURE__ */ a(p, { sx: { bgcolor: "background.default", gap: 36, height: "100%", p: 24 }, children: [
3252
+ /* @__PURE__ */ a(p, { sx: { gap: 20 }, children: [
3253
+ /* @__PURE__ */ a(p, { sx: { gap: 8 }, children: [
3254
+ /* @__PURE__ */ e(V, { sx: { textWrap: "wrap" }, children: n.your_path_to_financial_freedom }),
3255
+ /* @__PURE__ */ e(M, { variant: "subtitle1", children: n.finstrong_freedom_description })
3256
+ ] }),
3257
+ /* @__PURE__ */ e(k, { children: /* @__PURE__ */ e(Ur, { copy: n }) })
3258
+ ] }),
3259
+ /* @__PURE__ */ a(p, { sx: { gap: 12 }, children: [
3260
+ /* @__PURE__ */ e(I, { sx: { fontWeight: 600 }, variant: "body1", children: n.how_do_we_do_this }),
3261
+ /* @__PURE__ */ a(
3262
+ Ee,
3263
+ {
3264
+ component: "ol",
3265
+ sx: {
3266
+ listStyleType: "decimal",
3267
+ pl: 20,
3268
+ pr: 16,
3269
+ "& li": {
3270
+ "::marker": {
3271
+ fontWeight: 600
3272
+ }
3273
+ },
3274
+ "& .MuiListItemText-secondary": {
3275
+ fontSize: 15,
3276
+ lineHeight: "24px",
3277
+ pt: 4
3278
+ }
3279
+ },
3280
+ children: [
3281
+ /* @__PURE__ */ e(ge, { sx: { display: "list-item" }, children: /* @__PURE__ */ e(
3282
+ ye,
3283
+ {
3284
+ primary: n.understand_your_habits,
3285
+ secondary: n.understand_your_habits_description
3286
+ }
3287
+ ) }),
3288
+ /* @__PURE__ */ e(ge, { sx: { display: "list-item", pt: 16 }, children: /* @__PURE__ */ e(
3289
+ ye,
3290
+ {
3291
+ primary: n.see_whats_possible,
3292
+ secondary: n.see_whats_possible_description
3293
+ }
3294
+ ) })
3295
+ ]
3296
+ }
3297
+ )
1318
3298
  ] }),
1319
- /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(
1320
- q,
3299
+ /* @__PURE__ */ a(p, { sx: { gap: 4 }, children: [
3300
+ /* @__PURE__ */ e(I, { sx: { fontWeight: 600, pb: 4 }, variant: "body1", children: n.we_ask_questions }),
3301
+ /* @__PURE__ */ a(
3302
+ Ee,
3303
+ {
3304
+ component: "ol",
3305
+ sx: {
3306
+ listStyleType: "initial",
3307
+ pl: 20,
3308
+ pr: 16,
3309
+ "& li": {
3310
+ minHeight: "max-content",
3311
+ "::marker": {
3312
+ color: "text.secondary",
3313
+ fontWeight: 600
3314
+ }
3315
+ },
3316
+ "& .MuiListItemText-secondary": {
3317
+ fontSize: 15,
3318
+ lineHeight: "24px"
3319
+ }
3320
+ },
3321
+ children: [
3322
+ /* @__PURE__ */ e(ge, { sx: { display: "list-item" }, children: /* @__PURE__ */ e(ye, { secondary: n.we_ask_questions_description_1 }) }),
3323
+ /* @__PURE__ */ e(ge, { sx: { display: "list-item" }, children: /* @__PURE__ */ e(ye, { secondary: n.we_ask_questions_description_2 }) })
3324
+ ]
3325
+ }
3326
+ )
3327
+ ] })
3328
+ ] }) }) : /* @__PURE__ */ e(ee, {});
3329
+ }, Zr = v(Qr), Jr = v(() => {
3330
+ const [t, o] = m.useState(!1), n = G(), [r, { width: s }] = vt(), { finstrong: i } = x(), { isCopyLoaded: c, isInitialized: l } = q(), { healthScore: _, healthScoreChange: d } = L(), u = n.palette.mode === "dark", h = Ne(_?.health_score, i);
3331
+ return !c || !l ? /* @__PURE__ */ e(ee, {}) : /* @__PURE__ */ a(Y, { ref: r, sx: { p: 16, display: "flex", flexDirection: "column", gap: 8 }, children: [
3332
+ /* @__PURE__ */ e(
3333
+ Do,
1321
3334
  {
1322
- endIcon: /* @__PURE__ */ e(j, {}),
1323
- onClick: n,
1324
- size: "small",
3335
+ action: /* @__PURE__ */ e(
3336
+ B,
3337
+ {
3338
+ endIcon: /* @__PURE__ */ e(Z, {}),
3339
+ onClick: () => o(!0),
3340
+ sx: {
3341
+ fontSize: 13,
3342
+ lineHeight: "16px",
3343
+ fontWeight: 600,
3344
+ color: "primary.main"
3345
+ },
3346
+ variant: "text",
3347
+ children: i.financial_strength_header_action
3348
+ }
3349
+ ),
3350
+ subheader: /* @__PURE__ */ e(V, { color: "text.primary", children: i.financial_strength_header }),
1325
3351
  sx: {
1326
- fontSize: 13,
1327
- ":hover": {
1328
- bgcolor: "transparent"
3352
+ p: 0,
3353
+ "& .MuiCardHeader-content": {
3354
+ overflow: "hidden"
3355
+ }
3356
+ }
3357
+ }
3358
+ ),
3359
+ /* @__PURE__ */ e(p, { sx: { justifyContent: "center", alignItems: "center", pb: 4, pt: 20, px: 16 }, children: /* @__PURE__ */ e(
3360
+ Rt,
3361
+ {
3362
+ arcRadius: s <= 323 ? 72.5 : 154,
3363
+ footerCenterContent: d,
3364
+ healthScore: _?.health_score || 0,
3365
+ size: s <= 323 ? "M" : "L"
3366
+ }
3367
+ ) }),
3368
+ _?.health_score ? /* @__PURE__ */ a(
3369
+ wo,
3370
+ {
3371
+ sx: {
3372
+ px: 16,
3373
+ backgroundColor: u ? "grey.800" : "grey.50",
3374
+ //TODO: Need to change the background color to palette (supporting both darkmode and lightmode)
3375
+ "&.Mui-expanded": {
3376
+ m: 0
3377
+ },
3378
+ "&::before": {
3379
+ display: "none"
1329
3380
  }
1330
3381
  },
1331
- variant: "text",
1332
- children: o.connect_more_accounts_button
3382
+ children: [
3383
+ /* @__PURE__ */ e(
3384
+ Mo,
3385
+ {
3386
+ expandIcon: /* @__PURE__ */ e(gn, { size: 20 }),
3387
+ sx: {
3388
+ height: 52,
3389
+ p: 0,
3390
+ "&.Mui-expanded": {
3391
+ minHeight: 0
3392
+ }
3393
+ },
3394
+ children: /* @__PURE__ */ e(M, { sx: { fontWeight: 600 }, variant: "body1", children: i.accordion_title_text })
3395
+ }
3396
+ ),
3397
+ /* @__PURE__ */ e(ko, { sx: { "&.MuiAccordionDetails-root": { padding: 0, pb: 16 } }, children: /* @__PURE__ */ e(M, { variant: "subtitle1", children: h.scoreContent }) })
3398
+ ]
1333
3399
  }
1334
- ) })
1335
- ] }) : /* @__PURE__ */ e(N, {});
1336
- }, zt = I(Ht), $t = ({ onBackClick: n, sx: o }) => {
1337
- const t = G(), { visibleAccounts: i } = fe(), { dateRange: d, isDataLoaded: l, loadBudgetData: s, setTheme: r } = ye(), { reloadCategoryTotals: a } = Ke(), { augmentedChartData: c, calculateHealthScore: p, healthScore: h, loadAugmentedChartData: m } = $(), { finstrong: _, connect: R } = S(), { isCopyLoaded: T, isInitialized: v, selectedAccounts: L, setSelectedAccounts: E } = z(), { isMobile: K } = Ce(), [F, w] = C.useState(!1);
1338
- C.useEffect(() => {
1339
- r(t);
1340
- }, []), C.useEffect(() => E(i), [i]), C.useEffect(() => {
1341
- v && (p().finally(), m().finally());
1342
- }, [v]), C.useEffect(() => {
1343
- v && (a(L, d.start, d.end), l || s());
1344
- }, [d, l, v, L]);
1345
- const [O, k] = C.useState(!1), [P, U] = C.useState(!1);
1346
- if (!T || !v) return /* @__PURE__ */ e(N, {});
1347
- const Z = () => {
1348
- }, ee = () => k(!0);
1349
- return /* @__PURE__ */ u(
1350
- mt,
3400
+ ) : /* @__PURE__ */ e(
3401
+ Pe,
3402
+ {
3403
+ buttonText: i.connect_more_accounts_title,
3404
+ description: i.health_score_zero_description,
3405
+ drawerType: "connectDrawer",
3406
+ hasIcon: !1,
3407
+ isDashboard: !0,
3408
+ sx: {
3409
+ backgroundColor: u ? "grey.800" : "grey.50",
3410
+ //TODO: Need to change the background color to palette (supporting both darkmode and lightmode)
3411
+ ".connect-more-accounts-title": {
3412
+ fontWeight: 600,
3413
+ lineHeight: "20px",
3414
+ color: "text.primary"
3415
+ },
3416
+ ".connect-more-accounts-description": { color: "text.primary" }
3417
+ },
3418
+ title: i.health_score_zero_title
3419
+ }
3420
+ ),
3421
+ /* @__PURE__ */ e(
3422
+ Zr,
3423
+ {
3424
+ isOpen: t,
3425
+ onClose: () => o(!1)
3426
+ }
3427
+ )
3428
+ ] });
3429
+ }), ea = ({ onBackClick: t, sx: o, onPrimaryCtaClick: n }) => {
3430
+ const { visibleAccounts: r } = xe(), { dateRange: s, isDataLoaded: i, loadBudgetData: c, setTheme: l } = Pn(), { reloadCategoryTotals: _ } = Ke(), d = L(), {
3431
+ augmentedChartData: u,
3432
+ calculateHealthScore: h,
3433
+ healthScore: y,
3434
+ loadAugmentedChartData: f,
3435
+ loadMonthlySummaries: w,
3436
+ loadPeerScore: C,
3437
+ peerScore: D
3438
+ } = d, { finstrong: S, connect: g } = x(), { isCopyLoaded: b, isInitialized: P } = q(), { onLoad: F } = Bn(), { loadRepeatingTransactions: U } = Ve(), { isMobile: W } = qe(), O = G(), { userProfile: E } = J(), [pe, Se] = m.useState(!1), [te, j] = m.useState(!1), [ve, H] = m.useState(!1), [we, N] = m.useState(!1);
3439
+ if (m.useEffect(() => {
3440
+ l(O);
3441
+ }, []), m.useEffect(() => {
3442
+ n && (d.handleFinstrongWidgetPrimaryCtaClick = n);
3443
+ }, [n, d]), m.useEffect(() => {
3444
+ P && (w().finally(), C().finally(), h().finally(), f().finally(() => {
3445
+ F?.("FinstrongWidget");
3446
+ }));
3447
+ }, [P]), m.useEffect(() => {
3448
+ P && (_(r, s.start, s.end).finally(() => {
3449
+ Se(!0);
3450
+ }), i || (c(), U().finally()));
3451
+ }, [s, i, P, r]), !b || !P || !pe) return /* @__PURE__ */ e(ee, {});
3452
+ const ae = () => j(!0), _e = Math.round(D?.average_health_score?.average_health_score || 0);
3453
+ return /* @__PURE__ */ a(
3454
+ Io,
1351
3455
  {
1352
- accountOptions: i,
1353
3456
  actions: [
1354
3457
  {
1355
3458
  iconName: "person",
1356
- label: _.profile,
1357
- onClick: ee
3459
+ label: S.profile,
3460
+ onClick: ae
1358
3461
  }
1359
3462
  ],
1360
3463
  hasDivider: !0,
1361
- onAccountsFilterClick: Z,
1362
- onBackClick: n,
3464
+ onBackClick: t,
1363
3465
  sx: o,
1364
- title: _.title,
3466
+ title: S.title,
1365
3467
  children: [
1366
- /* @__PURE__ */ u(
1367
- g,
3468
+ E.has_completed_finstrong_onboarding ? /* @__PURE__ */ a(
3469
+ p,
1368
3470
  {
1369
3471
  sx: {
3472
+ bgcolor: "background.default",
1370
3473
  flexDirection: { md: "row" },
1371
3474
  gap: 24,
1372
3475
  justifyContent: "center",
1373
- pt: K ? 24 : 16,
3476
+ pt: W ? 24 : 16,
1374
3477
  px: 24
1375
3478
  },
1376
3479
  children: [
1377
- /* @__PURE__ */ u(g, { sx: { gap: 24, width: { md: 432 } }, children: [
1378
- /* @__PURE__ */ e(St, {}),
3480
+ /* @__PURE__ */ a(p, { sx: { gap: 24, width: { md: 432 }, height: "100%" }, children: [
3481
+ /* @__PURE__ */ e(Jr, {}),
1379
3482
  /* @__PURE__ */ e(
1380
- Q,
3483
+ Pe,
1381
3484
  {
1382
- description: _.connect_more_accounts_description,
1383
- title: _.connect_more_accounts_title
3485
+ description: S.connect_more_accounts_description,
3486
+ drawerType: "connectDrawer",
3487
+ title: S.connect_more_accounts_title
1384
3488
  }
1385
3489
  )
1386
3490
  ] }),
1387
- /* @__PURE__ */ e(g, { sx: { maxWidth: 848, minWidth: 288, width: { md: 720 } }, children: /* @__PURE__ */ u(J, { sx: { background: t.palette.background.paper, p: 16 }, children: [
1388
- /* @__PURE__ */ u(g, { direction: "row", sx: { alignItems: "center", justifyContent: "space-between" }, children: [
1389
- /* @__PURE__ */ e(H, { children: _.key_indicators }),
3491
+ /* @__PURE__ */ e(p, { sx: { maxWidth: 848, minWidth: 288, width: { md: 720 } }, children: /* @__PURE__ */ a(Y, { sx: { height: "100%", p: 16 }, children: [
3492
+ /* @__PURE__ */ a(p, { direction: "row", sx: { alignItems: "center", justifyContent: "space-between" }, children: [
3493
+ /* @__PURE__ */ e(V, { children: S.key_indicators }),
1390
3494
  /* @__PURE__ */ e(
1391
- q,
3495
+ B,
1392
3496
  {
1393
- endIcon: /* @__PURE__ */ e(j, {}),
1394
- onClick: () => U(!0),
3497
+ endIcon: /* @__PURE__ */ e(Z, {}),
3498
+ onClick: () => H(!0),
1395
3499
  sx: {
1396
3500
  fontSize: 13
1397
3501
  },
1398
3502
  variant: "text",
1399
- children: _.whats_changed
3503
+ children: S.whats_changed
1400
3504
  }
1401
3505
  )
1402
3506
  ] }),
1403
- c.length ? /* @__PURE__ */ e(
1404
- be,
3507
+ u.length ? /* @__PURE__ */ e(
3508
+ Ye,
1405
3509
  {
1406
- axisColor: t.palette.divider,
3510
+ axisColor: O.palette.divider,
1407
3511
  baseline: "min",
1408
- colors: [t.palette.primary.main],
3512
+ colors: [O.palette.primary.main],
1409
3513
  curveType: "natural",
1410
- customLegendVariant: "XSmall",
1411
- datasets: [c],
3514
+ customLegendBoxSx: { borderRadius: "2px" },
3515
+ customLegendSx: { left: 0 },
3516
+ customLegendVariant: "caption",
3517
+ datasets: [u],
1412
3518
  height: 300,
1413
3519
  isGraphClippingXAxis: !0,
1414
- labelBackgroundColor: t.palette.border.dark,
1415
- labelFontColor: t.palette.common.white,
1416
- labelFontSize: typeof t.typography.XSmall?.fontSize == "string" ? parseFloat(t.typography.XSmall.fontSize) : t.typography.XSmall?.fontSize,
1417
- labels: [_.key_indicators_label],
1418
- margin: { right: 20, left: 25 },
3520
+ labelBackgroundColor: O.palette.neutral.dark,
3521
+ labelFontColor: O.palette.common.white,
3522
+ labelFontSize: typeof O.typography.caption?.fontSize == "string" ? parseFloat(O.typography.caption.fontSize) : O.typography.caption?.fontSize,
3523
+ labels: [S.key_indicators_label],
3524
+ margin: { right: 0, left: 25 },
3525
+ peerAverage: _e,
1419
3526
  showArea: !0,
1420
3527
  showAverage: !0,
1421
3528
  showLegend: !0,
1422
3529
  showMarkLabel: !0,
1423
3530
  showXAxis: !0,
1424
- title: _.peer_average,
1425
- useCustomMark: !0
3531
+ title: S.peer_average,
3532
+ useCustomMark: !0,
3533
+ xAxisScaleType: "band"
1426
3534
  }
1427
- ) : /* @__PURE__ */ e(zt, { onClick: () => w(!0) }),
1428
- h.health_score !== null && /* @__PURE__ */ e(Ft, {})
3535
+ ) : /* @__PURE__ */ e(Or, { onClick: () => N(!0) }),
3536
+ y.health_score !== null && /* @__PURE__ */ e(Ar, {})
1429
3537
  ] }) })
1430
3538
  ]
1431
3539
  }
1432
- ),
1433
- /* @__PURE__ */ e(Mt, { isOpen: O, onClose: () => k(!1) }),
3540
+ ) : /* @__PURE__ */ e(Er, {}),
3541
+ /* @__PURE__ */ e(Kr, { isOpen: te, onClose: () => j(!1) }),
1434
3542
  /* @__PURE__ */ e(
1435
- xe,
3543
+ re,
1436
3544
  {
1437
- onClose: () => w(!1),
1438
- showConnectWidget: F,
1439
- title: R.mini_title
3545
+ onClose: () => N(!1),
3546
+ showConnectWidget: we,
3547
+ title: g.mini_title
1440
3548
  }
1441
3549
  ),
1442
3550
  /* @__PURE__ */ e(
1443
- Bt,
3551
+ qr,
1444
3552
  {
1445
- isOpen: P,
1446
- onClose: () => U(!1)
3553
+ isOpen: ve,
3554
+ onClose: () => H(!1)
1447
3555
  }
1448
3556
  )
1449
3557
  ]
1450
3558
  }
1451
3559
  );
1452
- }, Ho = I($t);
3560
+ }, yi = v(ea);
1453
3561
  export {
1454
- Bo as CreditScoreGraph,
1455
- Se as DialScoreCard,
1456
- ve as FinancialStrengthGraph,
1457
- No as FinstrongApi,
1458
- Ko as FinstrongStore,
1459
- Ho as FinstrongWidget
3562
+ To as CreditScoreGraph,
3563
+ Ft as DialScoreCard,
3564
+ Rt as FinancialStrengthGraph,
3565
+ xi as FinstrongApi,
3566
+ Ci as FinstrongStore,
3567
+ yi as FinstrongWidget
1460
3568
  };