@mx-cartographer/experiences 7.2.5 → 11.6.4-alpha.san1

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