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

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 (248) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/README.md +10 -10
  3. package/dist/Account-DR7Plrqy.mjs +119 -0
  4. package/dist/Account-DR7Plrqy.mjs.map +1 -0
  5. package/dist/AccountDetailsDrawer-C1hhmlmI.mjs +922 -0
  6. package/dist/AccountDetailsDrawer-C1hhmlmI.mjs.map +1 -0
  7. package/dist/AccountDetailsHeader-BliEZhz7.mjs +230 -0
  8. package/dist/AccountDetailsHeader-BliEZhz7.mjs.map +1 -0
  9. package/dist/AccountUtils-Cbh8r9cP.mjs +29 -0
  10. package/dist/AccountUtils-Cbh8r9cP.mjs.map +1 -0
  11. package/dist/Analytics-CkYXKvco.mjs +54 -0
  12. package/dist/Analytics-CkYXKvco.mjs.map +1 -0
  13. package/dist/Analytics-WeZYytR0.mjs +140 -0
  14. package/dist/Analytics-WeZYytR0.mjs.map +1 -0
  15. package/dist/ApiEndpoints-DXwIYNUV.mjs +50 -0
  16. package/dist/ApiEndpoints-DXwIYNUV.mjs.map +1 -0
  17. package/dist/BeatMaterialIcon-1KOfRZrA.mjs +27 -0
  18. package/dist/BeatMaterialIcon-1KOfRZrA.mjs.map +1 -0
  19. package/dist/BudgetUtil-Bg2AQJpQ.mjs +75 -0
  20. package/dist/BudgetUtil-Bg2AQJpQ.mjs.map +1 -0
  21. package/dist/Category-DEKZGLYe.mjs +302 -0
  22. package/dist/Category-DEKZGLYe.mjs.map +1 -0
  23. package/dist/CategorySelectorDrawer-NJsFsKP1.mjs +431 -0
  24. package/dist/CategorySelectorDrawer-NJsFsKP1.mjs.map +1 -0
  25. package/dist/Connect-BH0Pt6zc.mjs +43 -0
  26. package/dist/Connect-BH0Pt6zc.mjs.map +1 -0
  27. package/dist/ConnectCard-D7uxoH5Y.mjs +55 -0
  28. package/dist/ConnectCard-D7uxoH5Y.mjs.map +1 -0
  29. package/dist/ConnectDrawer-CW4LA3H3.mjs +58 -0
  30. package/dist/ConnectDrawer-CW4LA3H3.mjs.map +1 -0
  31. package/dist/ConnectionsDrawer-CZU9ku-k.mjs +54 -0
  32. package/dist/ConnectionsDrawer-CZU9ku-k.mjs.map +1 -0
  33. package/dist/CurrencyDialog-DumQCTPO.mjs +374 -0
  34. package/dist/CurrencyDialog-DumQCTPO.mjs.map +1 -0
  35. package/dist/CurrencyInput-DaGEQaLW.mjs +88 -0
  36. package/dist/CurrencyInput-DaGEQaLW.mjs.map +1 -0
  37. package/dist/CurrencyText-CCbE6MmF.mjs +21 -0
  38. package/dist/CurrencyText-CCbE6MmF.mjs.map +1 -0
  39. package/dist/DateFormats-HudZ3Bjs.mjs +65 -0
  40. package/dist/DateFormats-HudZ3Bjs.mjs.map +1 -0
  41. package/dist/DateUtil-CzBmbjmA.mjs +75 -0
  42. package/dist/DateUtil-CzBmbjmA.mjs.map +1 -0
  43. package/dist/DebtUtils-i4pI2Uoe.mjs +154 -0
  44. package/dist/DebtUtils-i4pI2Uoe.mjs.map +1 -0
  45. package/dist/Dialog-Bvd2n8hz.mjs +67 -0
  46. package/dist/Dialog-Bvd2n8hz.mjs.map +1 -0
  47. package/dist/Donut-SzzfZDHF.mjs +89 -0
  48. package/dist/Donut-SzzfZDHF.mjs.map +1 -0
  49. package/dist/Drawer-DsnW2o0v.mjs +175 -0
  50. package/dist/Drawer-DsnW2o0v.mjs.map +1 -0
  51. package/dist/EmbeddedCard-DH8vQ3qN.mjs +859 -0
  52. package/dist/EmbeddedCard-DH8vQ3qN.mjs.map +1 -0
  53. package/dist/EmptyState-CJUDc3kD.mjs +85 -0
  54. package/dist/EmptyState-CJUDc3kD.mjs.map +1 -0
  55. package/dist/Error-Dtw6yxkf.mjs +85 -0
  56. package/dist/Error-Dtw6yxkf.mjs.map +1 -0
  57. package/dist/ErrorBoundary-CsdOcnJ9.mjs +24 -0
  58. package/dist/ErrorBoundary-CsdOcnJ9.mjs.map +1 -0
  59. package/dist/ExportCsvAction-C9KWH3Az.mjs +25 -0
  60. package/dist/ExportCsvAction-C9KWH3Az.mjs.map +1 -0
  61. package/dist/GlobalAccountFilter-BhzR5Vb1.mjs +230 -0
  62. package/dist/GlobalAccountFilter-BhzR5Vb1.mjs.map +1 -0
  63. package/dist/GlobalCopyApi-wcnDUzMV.mjs +129 -0
  64. package/dist/GlobalCopyApi-wcnDUzMV.mjs.map +1 -0
  65. package/dist/GoalsUtil-C9EnLWvC.mjs +108 -0
  66. package/dist/GoalsUtil-C9EnLWvC.mjs.map +1 -0
  67. package/dist/HeaderCell-P8w6CmfO.mjs +7 -0
  68. package/dist/HeaderCell-P8w6CmfO.mjs.map +1 -0
  69. package/dist/Help-CkQTjORd.mjs +300 -0
  70. package/dist/Help-CkQTjORd.mjs.map +1 -0
  71. package/dist/Help-aERwhajy.mjs +3210 -0
  72. package/dist/Help-aERwhajy.mjs.map +1 -0
  73. package/dist/IconBacking-DgT8DCeh.mjs +40 -0
  74. package/dist/IconBacking-DgT8DCeh.mjs.map +1 -0
  75. package/dist/InformationTooltip-4su8bn1e.mjs +42 -0
  76. package/dist/InformationTooltip-4su8bn1e.mjs.map +1 -0
  77. package/dist/InvestmentUtil-BItV7uEs.mjs +135 -0
  78. package/dist/InvestmentUtil-BItV7uEs.mjs.map +1 -0
  79. package/dist/LineChart-CUfiH86G.mjs +613 -0
  80. package/dist/LineChart-CUfiH86G.mjs.map +1 -0
  81. package/dist/ListItemAction-BqUCLj_w.mjs +70 -0
  82. package/dist/ListItemAction-BqUCLj_w.mjs.map +1 -0
  83. package/dist/ListItemRow-kH1rn8Xu.mjs +68 -0
  84. package/dist/ListItemRow-kH1rn8Xu.mjs.map +1 -0
  85. package/dist/ListItemWrapper-DRse79Iu.mjs +44 -0
  86. package/dist/ListItemWrapper-DRse79Iu.mjs.map +1 -0
  87. package/dist/Loader-CxeBwuPG.mjs +22 -0
  88. package/dist/Loader-CxeBwuPG.mjs.map +1 -0
  89. package/dist/Localization-DnoVyBNK.mjs +39 -0
  90. package/dist/Localization-DnoVyBNK.mjs.map +1 -0
  91. package/dist/ManageIncome-Be9WHv-s.mjs +906 -0
  92. package/dist/ManageIncome-Be9WHv-s.mjs.map +1 -0
  93. package/dist/MicroWidgetContainer-B2NnKBgW.mjs +46 -0
  94. package/dist/MicroWidgetContainer-B2NnKBgW.mjs.map +1 -0
  95. package/dist/MiniWidgetContainer-Bmv_WeUd.mjs +67 -0
  96. package/dist/MiniWidgetContainer-Bmv_WeUd.mjs.map +1 -0
  97. package/dist/NetWorthUtils-Dj7CgAg2.mjs +96 -0
  98. package/dist/NetWorthUtils-Dj7CgAg2.mjs.map +1 -0
  99. package/dist/Notification-DTNYSd8P.mjs +8 -0
  100. package/dist/Notification-DTNYSd8P.mjs.map +1 -0
  101. package/dist/NotificationSettings-CW7okUrk.mjs +678 -0
  102. package/dist/NotificationSettings-CW7okUrk.mjs.map +1 -0
  103. package/dist/NotificationUtils-BRGFTePr.mjs +24 -0
  104. package/dist/NotificationUtils-BRGFTePr.mjs.map +1 -0
  105. package/dist/NumberFormatting--XMeeBfr.mjs +50 -0
  106. package/dist/NumberFormatting--XMeeBfr.mjs.map +1 -0
  107. package/dist/OriginalBalanceAction-YrvxBYAl.mjs +115 -0
  108. package/dist/OriginalBalanceAction-YrvxBYAl.mjs.map +1 -0
  109. package/dist/RecurringSettings-kRqAViNn.mjs +89 -0
  110. package/dist/RecurringSettings-kRqAViNn.mjs.map +1 -0
  111. package/dist/RecurringTransactionsUtil-CHWmqvW5.mjs +299 -0
  112. package/dist/RecurringTransactionsUtil-CHWmqvW5.mjs.map +1 -0
  113. package/dist/ResponsiveButton-CC9F_Ezk.mjs +46 -0
  114. package/dist/ResponsiveButton-CC9F_Ezk.mjs.map +1 -0
  115. package/dist/SearchBox-Cpgu_gdO.mjs +51 -0
  116. package/dist/SearchBox-Cpgu_gdO.mjs.map +1 -0
  117. package/dist/Select-CSpkK5cR.mjs +62 -0
  118. package/dist/Select-CSpkK5cR.mjs.map +1 -0
  119. package/dist/SelectionBox-B4xELRgp.mjs +49 -0
  120. package/dist/SelectionBox-B4xELRgp.mjs.map +1 -0
  121. package/dist/SingleSegmentDonut-7Uy6VEld.mjs +70 -0
  122. package/dist/SingleSegmentDonut-7Uy6VEld.mjs.map +1 -0
  123. package/dist/Sizes-DISGrlUg.mjs +7 -0
  124. package/dist/Sizes-DISGrlUg.mjs.map +1 -0
  125. package/dist/SkeletonLoader-BaNboJjD.mjs +39 -0
  126. package/dist/SkeletonLoader-BaNboJjD.mjs.map +1 -0
  127. package/dist/SpendingData-Fii_xATx.mjs +54 -0
  128. package/dist/SpendingData-Fii_xATx.mjs.map +1 -0
  129. package/dist/SpendingLegend-CxvNOg3c.mjs +204 -0
  130. package/dist/SpendingLegend-CxvNOg3c.mjs.map +1 -0
  131. package/dist/StatusBar-CPfSXe80.mjs +31 -0
  132. package/dist/StatusBar-CPfSXe80.mjs.map +1 -0
  133. package/dist/TabContentContainer-B0eYJP5p.mjs +49 -0
  134. package/dist/TabContentContainer-B0eYJP5p.mjs.map +1 -0
  135. package/dist/ToggleListItem-Dl1lXNwj.mjs +92 -0
  136. package/dist/ToggleListItem-Dl1lXNwj.mjs.map +1 -0
  137. package/dist/TransactionDetails-roZ5xLq8.mjs +1708 -0
  138. package/dist/TransactionDetails-roZ5xLq8.mjs.map +1 -0
  139. package/dist/TransactionUtils-BphBJBbU.mjs +235 -0
  140. package/dist/TransactionUtils-BphBJBbU.mjs.map +1 -0
  141. package/dist/TrendsUtil-D9z3kIj_.mjs +70 -0
  142. package/dist/TrendsUtil-D9z3kIj_.mjs.map +1 -0
  143. package/dist/UserStore-BjnNCO5a.mjs +3121 -0
  144. package/dist/UserStore-BjnNCO5a.mjs.map +1 -0
  145. package/dist/ViewMoreMicroCard-fnwE0hqd.mjs +1280 -0
  146. package/dist/ViewMoreMicroCard-fnwE0hqd.mjs.map +1 -0
  147. package/dist/WidgetContainer-DJnp6t6c.mjs +483 -0
  148. package/dist/WidgetContainer-DJnp6t6c.mjs.map +1 -0
  149. package/dist/accounts/components/detailsdrawer/Accounts/AccountDetailsDrawer.d.ts +6 -0
  150. package/dist/accounts/index.d.ts +1 -0
  151. package/dist/accounts/index.es.js +784 -12
  152. package/dist/accounts/index.es.js.map +1 -0
  153. package/dist/analytics/index.es.js +140 -155
  154. package/dist/analytics/index.es.js.map +1 -0
  155. package/dist/budgets/index.es.js +1267 -1317
  156. package/dist/budgets/index.es.js.map +1 -0
  157. package/dist/cashflow/context/hooks.d.ts +7 -6
  158. package/dist/cashflow/index.es.js +944 -1076
  159. package/dist/cashflow/index.es.js.map +1 -0
  160. package/dist/categories/index.es.js +5 -4
  161. package/dist/categories/index.es.js.map +1 -0
  162. package/dist/common/components/DataRow.d.ts +1 -0
  163. package/dist/common/components/ListItemWrapper.d.ts +2 -1
  164. package/dist/common/constants/Analytics.d.ts +3 -0
  165. package/dist/common/index.es.js +310 -101
  166. package/dist/common/index.es.js.map +1 -0
  167. package/dist/core/index.es.js +105 -80
  168. package/dist/core/index.es.js.map +1 -0
  169. package/dist/core/stores/CashflowStore.d.ts +8 -7
  170. package/dist/core/stores/RecurringTransactionsStore.d.ts +53 -1
  171. package/dist/core/stores/TransactionStore.d.ts +1 -0
  172. package/dist/core/types/localization/RecurringCopy.d.ts +14 -1
  173. package/dist/core/types/localization/SpendingCopy.d.ts +1 -0
  174. package/dist/core/utils/AccountUtils.d.ts +8 -0
  175. package/dist/core/utils/DateUtil.d.ts +2 -0
  176. package/dist/core/utils/RecurringTransactionsUtil.d.ts +2 -1
  177. package/dist/dashboard/index.es.js +142 -185
  178. package/dist/dashboard/index.es.js.map +1 -0
  179. package/dist/debts/index.es.js +1273 -1384
  180. package/dist/debts/index.es.js.map +1 -0
  181. package/dist/finstrong/index.es.js +3473 -3367
  182. package/dist/finstrong/index.es.js.map +1 -0
  183. package/dist/goals/index.es.js +984 -1103
  184. package/dist/goals/index.es.js.map +1 -0
  185. package/dist/help/index.es.js +26 -3
  186. package/dist/help/index.es.js.map +1 -0
  187. package/dist/hooks-97sNJ_lf.mjs +78 -0
  188. package/dist/hooks-97sNJ_lf.mjs.map +1 -0
  189. package/dist/insights/components/insights/WeeklyNoSpendDays/BubbleWeek.d.ts +4 -1
  190. package/dist/insights/components/insights/WeeklyNoSpendDays/WeeklyNoSpendDays.d.ts +4 -2
  191. package/dist/insights/index.es.js +4871 -93
  192. package/dist/insights/index.es.js.map +1 -0
  193. package/dist/investments/index.es.js +1523 -1533
  194. package/dist/investments/index.es.js.map +1 -0
  195. package/dist/merchants/index.es.js +65 -75
  196. package/dist/merchants/index.es.js.map +1 -0
  197. package/dist/microinsights/index.es.js +826 -15
  198. package/dist/microinsights/index.es.js.map +1 -0
  199. package/dist/networth/index.es.js +504 -550
  200. package/dist/networth/index.es.js.map +1 -0
  201. package/dist/notifications/index.es.js +162 -169
  202. package/dist/notifications/index.es.js.map +1 -0
  203. package/dist/recurringtransactions/components/RecurringTransactionDetails.d.ts +3 -2
  204. package/dist/recurringtransactions/components/RecurringTransactionDetailsDrawer.d.ts +3 -0
  205. package/dist/recurringtransactions/components/RecurringTransactionList.d.ts +11 -0
  206. package/dist/recurringtransactions/components/UpcomingRecurrenceCard.d.ts +8 -0
  207. package/dist/recurringtransactions/components/actions/LinkTransactionDrawer.d.ts +10 -0
  208. package/dist/recurringtransactions/components/actions/MarkAsPaidDialog.d.ts +7 -0
  209. package/dist/recurringtransactions/components/actions/MarkAsUnpaidDialog.d.ts +7 -0
  210. package/dist/recurringtransactions/index.es.js +1012 -10
  211. package/dist/recurringtransactions/index.es.js.map +1 -0
  212. package/dist/settings/index.es.js +892 -13
  213. package/dist/settings/index.es.js.map +1 -0
  214. package/dist/spending/index.es.js +457 -400
  215. package/dist/spending/index.es.js.map +1 -0
  216. package/dist/transactions/components/shared/transactionlist/TransactionRow.d.ts +1 -0
  217. package/dist/transactions/index.es.js +604 -10
  218. package/dist/transactions/index.es.js.map +1 -0
  219. package/dist/trends/index.es.js +1408 -1268
  220. package/dist/trends/index.es.js.map +1 -0
  221. package/dist/useAccountDisplayName-BsiXA0qf.mjs +24 -0
  222. package/dist/useAccountDisplayName-BsiXA0qf.mjs.map +1 -0
  223. package/dist/useAriaLive-MkYebyUR.mjs +36 -0
  224. package/dist/useAriaLive-MkYebyUR.mjs.map +1 -0
  225. package/dist/useDimensions-CeDR9V8N.mjs +37 -0
  226. package/dist/useDimensions-CeDR9V8N.mjs.map +1 -0
  227. package/dist/useInsightsEnabled-D5Sdm0TJ.mjs +12 -0
  228. package/dist/useInsightsEnabled-D5Sdm0TJ.mjs.map +1 -0
  229. package/dist/useScreenSize-mWpmnh5w.mjs +37 -0
  230. package/dist/useScreenSize-mWpmnh5w.mjs.map +1 -0
  231. package/dist/useWidgetLoadTimer-B0tB-yzL.mjs +20 -0
  232. package/dist/useWidgetLoadTimer-B0tB-yzL.mjs.map +1 -0
  233. package/package.json +30 -30
  234. package/dist/Analytics-BKzTPees.mjs +0 -61
  235. package/dist/GlobalCopyApi-BeXzaDH9.mjs +0 -487
  236. package/dist/HeaderCell-EhCUSjvj.mjs +0 -10
  237. package/dist/Loader-BlVzRtUd.mjs +0 -73
  238. package/dist/MiniWidgetContainer-COwnjfy7.mjs +0 -110
  239. package/dist/OriginalBalanceAction-sbiqaxok.mjs +0 -110
  240. package/dist/SpendingLegend-D15ixlQ1.mjs +0 -222
  241. package/dist/accounts-DkyAiLpg.mjs +0 -15632
  242. package/dist/core-BexP5oiV.mjs +0 -4047
  243. package/dist/help-CctDYrAH.mjs +0 -2308
  244. package/dist/insights/components/insights/P2pCategorization/_tests_/P2pCategorizationMultipleTransaction.test.d.ts +0 -0
  245. package/dist/insights/components/insights/P2pCategorization/_tests_/P2pCategorizationSingleTransaction.test.d.ts +0 -0
  246. package/dist/microinsights-CRf3ChsJ.mjs +0 -1814
  247. package/dist/recurringtransactions-gbJ_NA8u.mjs +0 -1564
  248. package/dist/settings-ZMHe439l.mjs +0 -1526
@@ -1,77 +1,87 @@
1
- import { J as ee, Pt as We, T as O, X as Fe, w as Ne } from "../core-BexP5oiV.mjs";
2
- import { An as Ee, Gn as Ge, i as ge, lr as Me, mr as M, sr as H, vr as Ue } from "../accounts-DkyAiLpg.mjs";
3
- import { n as je } from "../Analytics-BKzTPees.mjs";
4
- import { d as pe, h as J, n as ae, p as G, t as xe, v as U } from "../Loader-BlVzRtUd.mjs";
5
- import T, { useState as z } from "react";
6
- import { observer as R } from "mobx-react-lite";
7
- import f from "@mui/material/Stack";
8
- import { InstitutionLogo as te, P as Q, Text as o } from "@mxenabled/mxui";
9
- import He from "@mui/material/Button";
10
- import ne from "@mui/material/Paper";
11
- import { Icon as k } from "@mxenabled/mx-icons";
12
- import { Fragment as se, jsx as e, jsxs as i } from "react/jsx-runtime";
13
- import { useTheme as X } from "@mui/material/styles";
14
- import ze from "@mui/material/Box";
15
- import Oe from "@mui/material/Tab";
16
- import Ve from "@mui/material/Tabs";
1
+ import { jsxs as i, jsx as e, Fragment as le } from "react/jsx-runtime";
2
+ import T, { useState as O } from "react";
3
+ import { observer as $ } from "mobx-react-lite";
4
+ import _ from "@mui/material/Stack";
5
+ import Fe from "@mui/material/Tab";
6
+ import Ee from "@mui/material/Tabs";
7
+ import { C as pe } from "../ConnectionsDrawer-CZU9ku-k.mjs";
8
+ import xe from "@mui/material/useMediaQuery";
9
+ import Ne from "@mui/material/Box";
10
+ import Me from "@mui/material/Collapse";
11
+ import Y from "@mui/material/Divider";
12
+ import ne from "@mui/material/List";
13
+ import ie from "@mui/material/ListItem";
14
+ import Ge from "@mui/material/ListItemButton";
17
15
  import ye from "@mui/material/ToggleButton";
18
- import ve from "@mui/material/ToggleButtonGroup";
19
- import fe from "@mui/material/useMediaQuery";
20
- import le from "@mui/material/IconButton";
21
- import { Stack as Re } from "@mui/material";
22
- import K from "@mui/material/Divider";
23
- import $e from "@mui/material/Tooltip";
24
- import ie from "@mui/material/List";
25
- import oe from "@mui/material/ListItem";
26
- import Pe from "@mui/material/ListItemButton";
27
- import qe from "@mui/material/ListItemText";
28
- import be from "@mui/material/TextField";
16
+ import fe from "@mui/material/ToggleButtonGroup";
17
+ import { Text as o, P as X, InstitutionLogo as oe } from "@mxenabled/mxui";
18
+ import Ue from "@mui/material/Button";
19
+ import { u as N, f as ve, v as U, a as J, c as ce } from "../hooks-97sNJ_lf.mjs";
20
+ import { A as z } from "../Analytics-WeZYytR0.mjs";
21
+ import { f as re, a as je } from "../NumberFormatting--XMeeBfr.mjs";
22
+ import { u as j } from "../useScreenSize-mWpmnh5w.mjs";
23
+ import { useTheme as Z } from "@mui/material/styles";
24
+ import { Icon as B } from "@mxenabled/mx-icons";
25
+ import { D as He } from "../Donut-SzzfZDHF.mjs";
26
+ import { f as ze, A as V } from "../InvestmentUtil-BItV7uEs.mjs";
27
+ import Oe from "@mui/material/ListItemText";
28
+ import de from "@mui/material/IconButton";
29
+ import Ve from "@mui/material/Tooltip";
30
+ import be from "@mui/material/Accordion";
31
+ import _e from "@mui/material/AccordionDetails";
32
+ import we from "@mui/material/AccordionSummary";
33
+ import se from "@mui/material/Paper";
29
34
  import p from "@mui/system/Stack";
30
- import { DataGridPro as Ke } from "@mui/x-data-grid-pro";
31
- import Ye from "@mui/material/Collapse";
32
- import _e from "@mui/material/Accordion";
33
- import we from "@mui/material/AccordionDetails";
34
- import Ce from "@mui/material/AccordionSummary";
35
- var ce = ({ sx: n = {} }) => {
36
- const { investments: g } = G(), { onEvent: c } = pe(), { setShowConnectionsWidget: m } = U();
37
- return /* @__PURE__ */ i(f, {
38
- sx: {
39
- alignItems: "center",
40
- gap: 24,
41
- height: 164,
42
- p: 24,
43
- width: "100%",
44
- ...n
45
- },
46
- children: [/* @__PURE__ */ i(f, {
47
- className: "inner-container",
48
- sx: {
49
- alignItems: "center",
50
- gap: 8,
51
- width: "100%",
52
- textAlign: "center"
53
- },
54
- children: [/* @__PURE__ */ e(o, {
55
- sx: { fontWeight: 600 },
56
- variant: "body1",
57
- children: g.overview.investment_accounts_footer
58
- }), /* @__PURE__ */ e(o, {
35
+ import Ce from "@mui/material/TextField";
36
+ import { D as Re } from "../Drawer-DsnW2o0v.mjs";
37
+ import { DataGridPro as $e } from "@mui/x-data-grid-pro";
38
+ import { Stack as Pe } from "@mui/material";
39
+ import { L as De } from "../Loader-CxeBwuPG.mjs";
40
+ import { u as qe } from "../useWidgetLoadTimer-B0tB-yzL.mjs";
41
+ import { W as Ke } from "../WidgetContainer-DJnp6t6c.mjs";
42
+ import { c as Ye } from "../Account-DR7Plrqy.mjs";
43
+ import { E as Qe } from "../EmptyState-CJUDc3kD.mjs";
44
+ const me = ({ sx: t = {} }) => {
45
+ const { investments: u } = N(), { onEvent: c } = ve(), { setShowConnectionsWidget: m } = U();
46
+ return /* @__PURE__ */ i(_, { sx: { alignItems: "center", gap: 24, height: 164, p: 24, width: "100%", ...t }, children: [
47
+ /* @__PURE__ */ i(
48
+ _,
49
+ {
50
+ className: "inner-container",
59
51
  sx: {
60
- color: "text.secondary",
61
- fontWeight: 400
52
+ alignItems: "center",
53
+ gap: 8,
54
+ width: "100%",
55
+ textAlign: "center"
62
56
  },
63
- variant: "subtitle2",
64
- children: g.overview.connect_more_accounts_description
65
- })]
66
- }), /* @__PURE__ */ e(He, {
67
- onClick: () => {
68
- m(!0), c(H.ACCOUNTS_CLICK_CONNECT);
69
- },
70
- sx: { fontWeight: 600 },
71
- variant: "outlined",
72
- children: g.overview.connect_accounts
73
- })]
74
- });
57
+ children: [
58
+ /* @__PURE__ */ e(o, { sx: { fontWeight: 600 }, variant: "body1", children: u.overview.investment_accounts_footer }),
59
+ /* @__PURE__ */ e(
60
+ o,
61
+ {
62
+ sx: {
63
+ color: "text.secondary",
64
+ fontWeight: 400
65
+ },
66
+ variant: "subtitle2",
67
+ children: u.overview.connect_more_accounts_description
68
+ }
69
+ )
70
+ ]
71
+ }
72
+ ),
73
+ /* @__PURE__ */ e(
74
+ Ue,
75
+ {
76
+ onClick: () => {
77
+ m(!0), c(z.ACCOUNTS_CLICK_CONNECT);
78
+ },
79
+ sx: { fontWeight: 600 },
80
+ variant: "outlined",
81
+ children: u.overview.connect_accounts
82
+ }
83
+ )
84
+ ] });
75
85
  }, Je = {
76
86
  allocations_cash: "#AEDCCC",
77
87
  allocations_convertible: "#80CAD0",
@@ -82,943 +92,917 @@ var ce = ({ sx: n = {} }) => {
82
92
  allocations_unknown: "#161D6A",
83
93
  allocations_us_bond: "#254995",
84
94
  allocations_us_stock: "#1E2D84"
85
- }, Qe = [
86
- { name: "allocations_cash" },
87
- { name: "allocations_convertible" },
88
- { name: "allocations_foreign_bond" },
89
- { name: "allocations_foreign_stock" },
90
- { name: "allocations_other" },
91
- { name: "allocations_preferred" },
92
- { name: "allocations_us_bond" },
93
- { name: "allocations_us_stock" },
94
- { name: "allocations_unknown" }
95
- ], Xe = (n, g, c) => {
96
- const m = c === void 0 ? 0 : g, v = c === void 0 ? g : c;
97
- return n >= Math.min(m, v) && n < Math.max(m, v);
98
- }, Ze = (n, g, c) => {
99
- const m = [...new Set(n.map((y) => y.name.toLowerCase()))];
100
- let v;
101
- return m.map((y) => {
102
- const u = n.reduce((l, h) => {
103
- const x = h.name;
104
- return x.toLowerCase() === y ? (v = x, Y(h) * h[g] / 100 + l) : l;
95
+ }, Xe = [
96
+ {
97
+ name: "allocations_cash"
98
+ },
99
+ {
100
+ name: "allocations_convertible"
101
+ },
102
+ {
103
+ name: "allocations_foreign_bond"
104
+ },
105
+ {
106
+ name: "allocations_foreign_stock"
107
+ },
108
+ {
109
+ name: "allocations_other"
110
+ },
111
+ {
112
+ name: "allocations_preferred"
113
+ },
114
+ {
115
+ name: "allocations_us_bond"
116
+ },
117
+ {
118
+ name: "allocations_us_stock"
119
+ },
120
+ {
121
+ name: "allocations_unknown"
122
+ }
123
+ ], Ze = (t, u, c) => {
124
+ const m = u, f = c;
125
+ return t >= Math.min(m, f) && t < Math.max(m, f);
126
+ }, et = (t, u, c) => {
127
+ const m = [
128
+ ...new Set(t.map((d) => d.name.toLowerCase()))
129
+ ];
130
+ let f;
131
+ return m.map((d) => {
132
+ const l = t.reduce((x, h) => {
133
+ const b = h.name;
134
+ return b.toLowerCase() === d ? (f = b, Q(h) * h[u] / 100 + x) : x;
105
135
  }, 0);
106
136
  return {
107
- displayName: v,
108
- name: v,
109
- value: u,
110
- percentage: u / c
137
+ displayName: f,
138
+ name: f,
139
+ value: l,
140
+ percentage: l / c
111
141
  };
112
142
  });
113
- }, Y = (n) => n.calculated_market_value ? n.calculated_market_value : n.market_value, et = (n, g, c) => {
114
- const m = Object.values(g.allocations_list), v = [];
115
- let y = 0;
116
- const u = n.map(({ guid: t }) => t), l = c.filter(({ account_guid: t }) => u.includes(t)).map((t) => ({
117
- ...t,
118
- name: t.symbol || t.description,
119
- gainLoss: t.cost_basis || t.cost_basis === 0 ? Y(t) - t.cost_basis : 0
120
- })), { cashBalance: h, totalAccountBalance: x } = n.reduce((t, d) => ({
121
- cashBalance: t.cashBalance + (d.cash_balance || 0),
122
- totalAccountBalance: t.totalAccountBalance + (d.balance || 0)
123
- }), {
124
- cashBalance: 0,
125
- totalAccountBalance: 0
126
- }), { marketValue: _, totalGainLoss: a } = l.reduce((t, d) => ({
127
- marketValue: t.marketValue + Y(d),
128
- totalGainLoss: t.totalGainLoss + d.gainLoss
129
- }), {
130
- marketValue: 0,
131
- totalGainLoss: 0
132
- }), r = _ + h;
133
- return Qe.forEach((t, d) => {
134
- const D = l.filter((I) => !!I[t.name]);
135
- let w = D.reduce((I, B) => I + Y(B) * B[t.name] / 100, 0);
136
- const L = Ze(D, t.name, w);
137
- if (t.name === "allocations_cash" && h > 0) {
138
- w += h;
139
- const I = {
140
- displayName: g.cash_balance_display_name,
143
+ }, Q = (t) => t.calculated_market_value ? t.calculated_market_value : t.market_value, tt = (t, u, c) => {
144
+ const m = Object.values(u.allocations_list), f = [];
145
+ let v = 0;
146
+ const d = t.map(({ guid: n }) => n), l = c.filter(({ account_guid: n }) => d.includes(n)).map((n) => ({
147
+ ...n,
148
+ name: n.symbol || n.description,
149
+ gainLoss: n.cost_basis || n.cost_basis === 0 ? Q(n) - n.cost_basis : 0
150
+ })), { cashBalance: x, totalAccountBalance: h } = t.reduce(
151
+ (n, g) => ({
152
+ cashBalance: n.cashBalance + (g.cash_balance || 0),
153
+ totalAccountBalance: n.totalAccountBalance + (g.balance || 0)
154
+ }),
155
+ { cashBalance: 0, totalAccountBalance: 0 }
156
+ ), { marketValue: b, totalGainLoss: s } = l.reduce(
157
+ (n, g) => ({
158
+ marketValue: n.marketValue + Q(g),
159
+ totalGainLoss: n.totalGainLoss + g.gainLoss
160
+ }),
161
+ { marketValue: 0, totalGainLoss: 0 }
162
+ ), y = b + x;
163
+ Xe.forEach((n, g) => {
164
+ const C = l.filter(
165
+ (W) => !!W[n.name]
166
+ );
167
+ let D = C.reduce(
168
+ (W, A) => W + Q(A) * A[n.name] / 100,
169
+ 0
170
+ );
171
+ const k = et(
172
+ C,
173
+ n.name,
174
+ D
175
+ );
176
+ if (n.name === "allocations_cash" && x > 0) {
177
+ D += x;
178
+ const W = {
179
+ displayName: u.cash_balance_display_name,
141
180
  name: "allocations_name",
142
- value: h,
143
- percentage: h / r
181
+ value: x,
182
+ percentage: x / y
144
183
  };
145
- L.push(I);
184
+ k.push(W);
146
185
  }
147
- w > 0 && (v.push({
148
- name: t.name,
149
- displayName: m[d],
150
- guid: `${t.name}-${d}`,
151
- holdings: L,
152
- percentage: w / r,
153
- value: w,
154
- color: Je[t.name]
155
- }), y += w);
156
- }), {
157
- investmentsData: v,
158
- donutData: v.map(({ displayName: t, guid: d, color: D, value: w }) => ({
159
- id: d,
160
- color: D,
161
- label: t,
162
- value: w / y * 100
163
- })),
164
- totalAmount: y,
165
- totalGainLoss: a,
166
- totalMarketValue: r,
167
- totalGainLossPercentage: a / x
186
+ D > 0 && (f.push({
187
+ name: n.name,
188
+ displayName: m[g],
189
+ guid: `${n.name}-${g}`,
190
+ holdings: k,
191
+ percentage: D / y,
192
+ value: D,
193
+ color: Je[n.name]
194
+ }), v += D);
195
+ });
196
+ const r = f.map(
197
+ ({ displayName: n, guid: g, color: C, value: D }) => ({
198
+ id: g,
199
+ color: C,
200
+ label: n,
201
+ value: D / v * 100
202
+ })
203
+ );
204
+ return {
205
+ investmentsData: f,
206
+ donutData: r,
207
+ totalAmount: v,
208
+ totalGainLoss: s,
209
+ totalMarketValue: y,
210
+ totalGainLossPercentage: s / h
168
211
  };
169
- }, re = (n) => n < 1e-3 ? "< 0.1%" : Fe(n), V = (n) => n === 0 ? ee(n, "0,0.00") : Xe(n, -0.01, 0.01) ? "< $0.01" : ee(n, "0,0.00"), tt = ({ data: n, onSelected: g, selectedId: c, selectedTabs: m, setSelectedTabs: v }) => {
170
- const y = (a, r) => {
171
- r !== null && v(r);
172
- }, { isMobile: u } = M(), { investments: { allocation: l } } = G(), h = [{
173
- label: l.tabs_label_dollar,
174
- value: 0
175
- }, {
176
- label: l.tabs_label_percent,
177
- value: 1
178
- }], x = !n?.investmentsData.length, { isSmallMobile: _ } = M();
179
- return /* @__PURE__ */ i(f, {
180
- sx: {
181
- mt: 15,
182
- gap: 12,
183
- width: u ? 250 : 412
184
- },
185
- children: [
186
- /* @__PURE__ */ e(ve, {
212
+ }, ae = (t) => t < 1e-3 ? "< 0.1%" : je(t), R = (t) => t === 0 ? re(t, "0,0.00") : Ze(t, -0.01, 0.01) ? "< $0.01" : re(t, "0,0.00"), nt = ({
213
+ data: t,
214
+ onSelected: u,
215
+ selectedId: c,
216
+ selectedTabs: m,
217
+ setSelectedTabs: f
218
+ }) => {
219
+ const v = (s, y) => {
220
+ y !== null && f(y);
221
+ }, { isMobile: d } = j(), {
222
+ investments: { allocation: l }
223
+ } = N(), x = [
224
+ { label: l.tabs_label_dollar, value: 0 },
225
+ { label: l.tabs_label_percent, value: 1 }
226
+ ], h = !t?.investmentsData.length, { isSmallMobile: b } = j();
227
+ return /* @__PURE__ */ i(_, { sx: { mt: 15, gap: 12, width: d ? 250 : 412 }, children: [
228
+ /* @__PURE__ */ e(
229
+ fe,
230
+ {
187
231
  exclusive: !0,
188
232
  fullWidth: !0,
189
- onChange: y,
190
- value: x ? -1 : m,
191
- children: h.map(({ label: a, value: r }) => /* @__PURE__ */ e(ye, {
192
- color: "primary",
193
- value: r,
194
- children: /* @__PURE__ */ e(o, {
195
- bold: !0,
196
- textTransform: "capitalize",
197
- variant: "body1",
198
- children: a
199
- })
200
- }, a))
201
- }),
202
- /* @__PURE__ */ e(ie, {
203
- sx: { px: 12 },
204
- children: n.investmentsData.map((a) => /* @__PURE__ */ i(T.Fragment, { children: [
205
- /* @__PURE__ */ e(oe, {
206
- disableGutters: !0,
207
- disablePadding: !0,
208
- sx: { minHeight: 44 },
209
- children: /* @__PURE__ */ i(Pe, {
210
- "aria-expanded": c === a.guid,
211
- onClick: () => g(a.guid),
212
- sx: {
213
- minHeight: 44,
214
- px: 12,
215
- py: 0
216
- },
217
- children: [/* @__PURE__ */ e(ze, {
218
- borderRadius: 4,
219
- flexShrink: 0,
220
- height: 8,
221
- sx: {
222
- backgroundColor: a.color,
223
- mr: 8
224
- },
225
- width: 8
226
- }), /* @__PURE__ */ i(f, {
227
- alignItems: "center",
228
- direction: "row",
229
- justifyContent: "space-between",
230
- width: "100%",
231
- children: [/* @__PURE__ */ e(o, {
232
- bold: c === a.guid,
233
- children: a.displayName
234
- }), /* @__PURE__ */ e(o, {
235
- bold: c === a.guid,
236
- variant: "body1",
237
- children: m === 0 ? V(a.value) : re(a.percentage)
238
- })]
239
- })]
240
- })
241
- }),
242
- /* @__PURE__ */ e(K, {}),
243
- a.holdings && a.holdings.length > 0 && /* @__PURE__ */ e(Ye, {
244
- in: c === a.guid,
245
- unmountOnExit: !0,
246
- children: /* @__PURE__ */ i(ie, { children: [a?.holdings?.map((r) => /* @__PURE__ */ e(oe, {
247
- sx: {
248
- pl: 24,
249
- pr: 8,
250
- py: 0
251
- },
252
- children: /* @__PURE__ */ i(f, {
253
- direction: "row",
254
- justifyContent: "space-between",
255
- width: "100%",
256
- children: [/* @__PURE__ */ i(o, { children: [r.displayName, " "] }), /* @__PURE__ */ e(o, { children: m === 0 ? V(r.value) : re(r.percentage) })]
257
- })
258
- }, r.displayName)), /* @__PURE__ */ e(K, {})] })
259
- })
260
- ] }, a.guid))
261
- }),
262
- x ? /* @__PURE__ */ i(se, { children: [
263
- /* @__PURE__ */ e(o, {
233
+ onChange: v,
234
+ value: h ? -1 : m,
235
+ children: x.map(({ label: s, value: y }) => /* @__PURE__ */ e(ye, { color: "primary", value: y, children: /* @__PURE__ */ e(o, { bold: !0, textTransform: "capitalize", variant: "body1", children: s }) }, s))
236
+ }
237
+ ),
238
+ /* @__PURE__ */ e(ne, { sx: { px: 12 }, children: t.investmentsData.map((s) => /* @__PURE__ */ i(T.Fragment, { children: [
239
+ /* @__PURE__ */ e(
240
+ ie,
241
+ {
242
+ disableGutters: !0,
243
+ disablePadding: !0,
264
244
  sx: {
265
- color: "secondary.main",
266
- p: 8,
267
- textAlign: "center"
245
+ minHeight: 44
268
246
  },
269
- children: l.empty_data
270
- }),
271
- /* @__PURE__ */ e(K, {}),
272
- /* @__PURE__ */ e(ce, { sx: { ".inner-container": { width: _ ? "100%" : 364 } } })
273
- ] }) : m === 0 && /* @__PURE__ */ e(o, {
274
- bold: !0,
275
- sx: {
276
- textAlign: "right",
277
- pr: 24
278
- },
279
- children: `${l.total_label_text} ${V(n.totalAmount)}`
280
- })
281
- ]
282
- });
283
- }, nt = ({ data: n, hoveredId: g, isPercentage: c, onMouseEnter: m, onMouseLeave: v, onSelected: y, selectedId: u, size: l = 150, totalLabel: h }) => {
284
- const x = X(), _ = x.palette.mode === "dark", a = T.useMemo(() => u ? n.investmentsData.find(({ guid: I }) => I === u) : void 0, [u]), { investments: { allocation: r } } = G(), t = T.useMemo(() => n.donutData.length > 0 ? n.donutData : [{
285
- id: "0",
286
- color: x.palette.neutral.light,
287
- value: 100
288
- }], [n, x]), d = _ ? "#0AC295" : "#09A57F", D = _ ? "grey.300" : "grey.700", w = () => a ? r.pie_chart_centered_click_for_details : c ? re(n.totalGainLossPercentage) : V(n.totalGainLoss), L = n.totalGainLoss >= 0 ? d : D;
289
- return /* @__PURE__ */ e(Ue, {
290
- data: t,
291
- hoveredId: g,
292
- onClick: y,
293
- onMouseEnter: m,
294
- onMouseLeave: v,
295
- selectedId: u,
296
- size: l,
297
- children: /* @__PURE__ */ e(f, {
298
- alignItems: "center",
299
- height: "100%",
300
- justifyContent: "center",
301
- width: "100%",
302
- children: /* @__PURE__ */ e(f, {
303
- alignItems: "center",
304
- justifyContent: "center",
305
- minHeight: l,
306
- minWidth: l,
307
- children: /* @__PURE__ */ i(f, {
308
- alignItems: "center",
309
- sx: {
310
- gap: {
311
- xs: 4,
312
- xl: 8
313
- },
314
- mb: {
315
- xs: 4,
316
- xl: 8
247
+ children: /* @__PURE__ */ i(
248
+ Ge,
249
+ {
250
+ "aria-expanded": c === s.guid,
251
+ onClick: () => u(s.guid),
252
+ sx: { minHeight: 44, px: 12, py: 0 },
253
+ children: [
254
+ /* @__PURE__ */ e(
255
+ Ne,
256
+ {
257
+ borderRadius: 4,
258
+ flexShrink: 0,
259
+ height: 8,
260
+ sx: { backgroundColor: s.color, mr: 8 },
261
+ width: 8
262
+ }
263
+ ),
264
+ /* @__PURE__ */ i(
265
+ _,
266
+ {
267
+ alignItems: "center",
268
+ direction: "row",
269
+ justifyContent: "space-between",
270
+ width: "100%",
271
+ children: [
272
+ /* @__PURE__ */ e(o, { bold: c === s.guid, children: s.displayName }),
273
+ /* @__PURE__ */ e(o, { bold: c === s.guid, variant: "body1", children: m === 0 ? R(s.value) : ae(s.percentage) })
274
+ ]
275
+ }
276
+ )
277
+ ]
317
278
  }
279
+ )
280
+ }
281
+ ),
282
+ /* @__PURE__ */ e(Y, {}),
283
+ s.holdings && s.holdings.length > 0 && /* @__PURE__ */ e(Me, { in: c === s.guid, unmountOnExit: !0, children: /* @__PURE__ */ i(ne, { children: [
284
+ s?.holdings?.map((y) => /* @__PURE__ */ e(
285
+ ie,
286
+ {
287
+ sx: {
288
+ pl: 24,
289
+ pr: 8,
290
+ py: 0
291
+ },
292
+ children: /* @__PURE__ */ i(_, { direction: "row", justifyContent: "space-between", width: "100%", children: [
293
+ /* @__PURE__ */ i(o, { children: [
294
+ y.displayName,
295
+ " "
296
+ ] }),
297
+ /* @__PURE__ */ e(o, { children: m === 0 ? R(y.value) : ae(y.percentage) })
298
+ ] })
318
299
  },
319
- children: [
320
- /* @__PURE__ */ e(o, {
321
- color: "text.secondary",
322
- noWrap: !0,
323
- children: a?.displayName ?? h
324
- }),
325
- /* @__PURE__ */ e(Q, {
326
- color: "text.primary",
327
- variant: "h1",
328
- children: V(a?.value ?? n.totalMarketValue)
329
- }),
330
- /* @__PURE__ */ i(f, {
300
+ y.displayName
301
+ )),
302
+ /* @__PURE__ */ e(Y, {})
303
+ ] }) })
304
+ ] }, s.guid)) }),
305
+ h ? /* @__PURE__ */ i(le, { children: [
306
+ /* @__PURE__ */ e(o, { sx: { color: "secondary.main", p: 8, textAlign: "center" }, children: l.empty_data }),
307
+ /* @__PURE__ */ e(Y, {}),
308
+ /* @__PURE__ */ e(
309
+ me,
310
+ {
311
+ sx: {
312
+ ".inner-container": { width: b ? "100%" : 364 }
313
+ }
314
+ }
315
+ )
316
+ ] }) : m === 0 && /* @__PURE__ */ e(o, { bold: !0, sx: { textAlign: "right", pr: 24 }, children: `${l.total_label_text} ${R(t.totalAmount)}` })
317
+ ] });
318
+ }, it = ({
319
+ data: t,
320
+ hoveredId: u,
321
+ isPercentage: c,
322
+ onMouseEnter: m,
323
+ onMouseLeave: f,
324
+ onSelected: v,
325
+ selectedId: d,
326
+ size: l = 150,
327
+ totalLabel: x
328
+ }) => {
329
+ const h = Z(), b = h.palette.mode === "dark", s = T.useMemo(
330
+ () => d ? t.investmentsData.find(({ guid: k }) => k === d) : void 0,
331
+ [d]
332
+ ), {
333
+ investments: { allocation: y }
334
+ } = N(), r = T.useMemo(() => t.donutData.length > 0 ? t.donutData : [{ id: "0", color: h.palette.neutral.light, value: 100 }], [t, h]), n = b ? "#0AC295" : "#09A57F", g = b ? "grey.300" : "grey.700", C = () => s ? y.pie_chart_centered_click_for_details : c ? ae(t.totalGainLossPercentage) : R(t.totalGainLoss), D = t.totalGainLoss >= 0 ? n : g;
335
+ return /* @__PURE__ */ e(
336
+ He,
337
+ {
338
+ data: r,
339
+ hoveredId: u,
340
+ onClick: v,
341
+ onMouseEnter: m,
342
+ onMouseLeave: f,
343
+ selectedId: d,
344
+ size: l,
345
+ children: /* @__PURE__ */ e(_, { alignItems: "center", height: "100%", justifyContent: "center", width: "100%", children: /* @__PURE__ */ e(_, { alignItems: "center", justifyContent: "center", minHeight: l, minWidth: l, children: /* @__PURE__ */ i(_, { alignItems: "center", sx: { gap: { xs: 4, xl: 8 }, mb: { xs: 4, xl: 8 } }, children: [
346
+ /* @__PURE__ */ e(o, { color: "text.secondary", noWrap: !0, children: s?.displayName ?? x }),
347
+ /* @__PURE__ */ e(X, { color: "text.primary", variant: "h1", children: R(s?.value ?? t.totalMarketValue) }),
348
+ /* @__PURE__ */ i(_, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
349
+ !s && /* @__PURE__ */ e(
350
+ B,
351
+ {
352
+ name: t.totalGainLoss >= 0 ? "trending_up" : "trending_down",
353
+ size: 20,
354
+ sx: { color: D }
355
+ }
356
+ ),
357
+ /* @__PURE__ */ e(
358
+ o,
359
+ {
331
360
  sx: {
332
- alignItems: "center",
333
- flexDirection: "row",
334
- gap: 4
361
+ color: D,
362
+ fontWeight: 700
335
363
  },
336
- children: [!a && /* @__PURE__ */ e(k, {
337
- name: n.totalGainLoss >= 0 ? "trending_up" : "trending_down",
338
- size: 20,
339
- sx: { color: L }
340
- }), /* @__PURE__ */ e(o, {
341
- sx: {
342
- color: L,
343
- fontWeight: 700
344
- },
345
- variant: "body2",
346
- children: w()
347
- })]
348
- })
349
- ]
350
- })
351
- })
352
- })
353
- });
354
- }, it = () => {
355
- const [n, g] = T.useState(0), [c, m] = T.useState(""), [v, y] = T.useState(""), u = (d) => {
356
- c !== d ? m(d) : (m(""), y(""));
357
- }, { selectedAccountGuids: l } = J(), { visibleHoldings: h } = U(), { visibleInvestmentAccounts: x } = ae(), { investments: { allocation: _ } } = G(), a = et(x.filter(({ guid: d }) => l.includes(d)), _, h), { isMobile: r } = M(), t = fe("(max-width:768px)");
358
- return /* @__PURE__ */ i(f, {
359
- alignItems: t ? "center" : "flex-start",
360
- direction: t ? "column" : "row",
361
- gap: {
362
- xs: 16,
363
- md: 64,
364
- xl: 100
365
- },
366
- sx: {
367
- justifyContent: "center",
368
- mt: 50,
369
- width: "100%"
370
- },
371
- children: [/* @__PURE__ */ e(nt, {
372
- data: a,
373
- hoveredId: v,
374
- isPercentage: n === 1,
375
- onMouseEnter: (d) => {
376
- c === d ? y("") : c || y(d);
377
- },
378
- onMouseLeave: () => {
379
- y("");
380
- },
381
- onSelected: u,
382
- selectedId: c,
383
- size: r ? 280 : 400,
384
- totalLabel: _.pie_chart_centered_text
385
- }), /* @__PURE__ */ e(tt, {
386
- data: a,
387
- onSelected: u,
388
- selectedId: c,
389
- selectedTabs: n,
390
- setSelectedTabs: g
391
- })]
392
- });
393
- }, ot = R(it), rt = ({ analysisDetails: n, analysisType: g, copy: c, setAnalysisType: m }) => {
394
- const { isSmallMobile: v } = M(), y = T.useMemo(() => Object.keys(n).filter((l) => n[l] >= 1).map((l) => ({
395
- key: l,
396
- value: ee(n[l], "0,0"),
397
- formattedKey: Ne(l)
398
- })), [n]), u = [{
399
- label: c.equities,
400
- value: O.Stocks
401
- }, {
402
- label: c.bonds,
403
- value: O.Bonds
404
- }];
405
- return /* @__PURE__ */ i(f, {
406
- sx: {
407
- gap: 12,
408
- width: { md: 412 }
409
- },
410
- children: [/* @__PURE__ */ e(ve, {
411
- color: "primary",
412
- exclusive: !0,
413
- onChange: (l, h) => h && m(h),
414
- sx: {
415
- width: "100%",
416
- "& .MuiToggleButton-root": {
417
- color: "secondary.main",
418
- fontWeight: 600,
419
- textTransform: "capitalize"
420
- }
421
- },
422
- value: y.length ? g : -1,
423
- children: u.map(({ label: l, value: h }) => /* @__PURE__ */ e(ye, {
424
- sx: { width: "100%" },
425
- value: h,
426
- children: l
427
- }, h))
428
- }), y.length ? /* @__PURE__ */ e(ie, {
364
+ variant: "body2",
365
+ children: C()
366
+ }
367
+ )
368
+ ] })
369
+ ] }) }) })
370
+ }
371
+ );
372
+ }, ot = () => {
373
+ const [t, u] = T.useState(0), [c, m] = T.useState(""), [f, v] = T.useState(""), d = (n) => {
374
+ c !== n ? m(n) : (m(""), v(""));
375
+ }, { selectedAccountGuids: l } = J(), { visibleHoldings: x } = U(), { visibleInvestmentAccounts: h } = ce(), {
376
+ investments: { allocation: b }
377
+ } = N(), s = tt(
378
+ h.filter(({ guid: n }) => l.includes(n)),
379
+ b,
380
+ x
381
+ ), { isMobile: y } = j(), r = xe("(max-width:768px)");
382
+ return /* @__PURE__ */ i(
383
+ _,
384
+ {
385
+ alignItems: r ? "center" : "flex-start",
386
+ direction: r ? "column" : "row",
387
+ gap: { xs: 16, md: 64, xl: 100 },
429
388
  sx: {
430
- "& .MuiListItemSecondaryAction-root": { pr: 12 },
431
- "& .MuiListItem-divider": { borderColor: "neutral.light" },
432
- "& .MuiListItem-root": {
433
- minHeight: 44,
434
- px: 12
435
- }
389
+ justifyContent: "center",
390
+ mt: 50,
391
+ width: "100%"
436
392
  },
437
- children: y.map(({ value: l, formattedKey: h }) => /* @__PURE__ */ e(oe, {
438
- divider: !0,
439
- secondaryAction: /* @__PURE__ */ e(o, { children: l }),
440
- children: /* @__PURE__ */ e(qe, {
441
- primary: h,
442
- slotProps: { primary: { fontStyle: "normal" } }
443
- })
444
- }, h))
445
- }) : /* @__PURE__ */ i(se, { children: [
446
- /* @__PURE__ */ e(o, {
393
+ children: [
394
+ /* @__PURE__ */ e(
395
+ it,
396
+ {
397
+ data: s,
398
+ hoveredId: f,
399
+ isPercentage: t === 1,
400
+ onMouseEnter: (n) => {
401
+ c === n ? v("") : c || v(n);
402
+ },
403
+ onMouseLeave: () => {
404
+ v("");
405
+ },
406
+ onSelected: d,
407
+ selectedId: c,
408
+ size: y ? 280 : 400,
409
+ totalLabel: b.pie_chart_centered_text
410
+ }
411
+ ),
412
+ /* @__PURE__ */ e(
413
+ nt,
414
+ {
415
+ data: s,
416
+ onSelected: d,
417
+ selectedId: c,
418
+ selectedTabs: t,
419
+ setSelectedTabs: u
420
+ }
421
+ )
422
+ ]
423
+ }
424
+ );
425
+ }, rt = $(ot), st = ({
426
+ analysisDetails: t,
427
+ analysisType: u,
428
+ copy: c,
429
+ setAnalysisType: m
430
+ }) => {
431
+ const { isSmallMobile: f } = j(), v = T.useMemo(() => Object.keys(t).filter((l) => t[l] >= 1).map((l) => ({
432
+ key: l,
433
+ value: re(t[l], "0,0"),
434
+ formattedKey: ze(l)
435
+ })), [t]), d = [
436
+ { label: c.equities, value: V.Stocks },
437
+ { label: c.bonds, value: V.Bonds }
438
+ ];
439
+ return /* @__PURE__ */ i(_, { sx: { gap: 12, width: { md: 412 } }, children: [
440
+ /* @__PURE__ */ e(
441
+ fe,
442
+ {
443
+ color: "primary",
444
+ exclusive: !0,
445
+ onChange: (l, x) => x && m(x),
447
446
  sx: {
448
- color: "secondary.main",
449
- p: 8,
450
- textAlign: "center"
447
+ width: "100%",
448
+ "& .MuiToggleButton-root": {
449
+ color: "secondary.main",
450
+ fontWeight: 600,
451
+ textTransform: "capitalize"
452
+ }
451
453
  },
452
- children: c.empty_data
453
- }),
454
- /* @__PURE__ */ e(K, { sx: { borderColor: "neutral.light" } }),
455
- /* @__PURE__ */ e(ce, { sx: { ".inner-container": { width: v ? "100%" : 364 } } })
456
- ] })]
457
- });
458
- }, at = ({ body: n, title: g }) => /* @__PURE__ */ i(f, {
459
- sx: {
460
- gap: 4,
461
- p: 12
462
- },
463
- children: [/* @__PURE__ */ e(o, {
464
- bold: !0,
465
- variant: "body1",
466
- children: g
467
- }), /* @__PURE__ */ e(Q, {
468
- variant: "subtitle2",
469
- children: n
470
- })]
471
- }), st = ({ placement: n = "bottom", tooltip_info_body: g, tooltip_info_title: c }) => /* @__PURE__ */ e($e, {
472
- enterTouchDelay: 500,
473
- placement: n,
474
- title: /* @__PURE__ */ e(at, {
475
- body: g,
476
- title: c
477
- }),
478
- children: /* @__PURE__ */ e(le, {
479
- "aria-label": c,
480
- sx: {
481
- minHeight: 0,
482
- minWidth: 0,
483
- p: 0
484
- },
485
- children: /* @__PURE__ */ e(k, {
486
- name: "info",
487
- sx: { color: "info.main" }
488
- })
489
- })
490
- }), lt = () => {
491
- const { investments: { analysis: n } } = G(), { analysisChartData: g, analysisDetails: c, analysisType: m, setAnalysisType: v } = U(), y = fe("(min-width:320px) and (max-width:375px)"), { isMobile: u } = M(), l = X().palette.mode === "dark", { cellDimension: h, columns: x, rows: _, textVariant: a } = T.useMemo(() => {
492
- const r = m === O.Stocks, t = Object.values(r ? n.stock_column_labels : n.bond_column_labels), d = Object.values(r ? n.stock_row_labels : n.bond_row_labels);
493
- return {
494
- cellDimension: u ? 72 : 100,
495
- columns: t,
496
- rows: d,
497
- textVariant: u ? "caption" : "body1"
498
- };
499
- }, [
500
- n,
501
- u,
502
- m
503
- ]);
504
- return /* @__PURE__ */ i(f, {
505
- sx: {
506
- flexDirection: { md: "row" },
507
- gap: u ? 48 : 64,
508
- justifyContent: "center",
509
- pt: 48,
510
- px: 16
511
- },
512
- children: [/* @__PURE__ */ i(f, {
513
- sx: {
514
- alignItems: "center",
515
- flexDirection: "row",
516
- justifyContent: "center",
517
- pr: { lg: 72 }
518
- },
519
- children: [/* @__PURE__ */ i(f, {
454
+ value: v.length ? u : -1,
455
+ children: d.map(({ label: l, value: x }) => /* @__PURE__ */ e(ye, { sx: { width: "100%" }, value: x, children: l }, x))
456
+ }
457
+ ),
458
+ v.length ? /* @__PURE__ */ e(
459
+ ne,
460
+ {
520
461
  sx: {
521
- alignItems: "center",
522
- bottom: u ? 10 : 24,
523
- gap: u ? 0 : 24,
524
- position: "relative",
525
- transform: "rotate(-180deg)",
526
- writingMode: "vertical-rl"
462
+ "& .MuiListItemSecondaryAction-root": { pr: 12 },
463
+ "& .MuiListItem-divider": { borderColor: "neutral.light" },
464
+ "& .MuiListItem-root": { minHeight: 44, px: 12 }
527
465
  },
528
- children: [/* @__PURE__ */ e(Q, {
529
- bold: !0,
530
- color: "secondary.main",
531
- variant: a,
532
- children: m === O.Stocks ? n.market_capitalization : n.credit_quality
533
- }), /* @__PURE__ */ e(f, {
466
+ children: v.map(({ value: l, formattedKey: x }) => /* @__PURE__ */ e(ie, { divider: !0, secondaryAction: /* @__PURE__ */ e(o, { children: l }), children: /* @__PURE__ */ e(
467
+ Oe,
468
+ {
469
+ primary: x,
470
+ slotProps: { primary: { fontStyle: "normal" } }
471
+ }
472
+ ) }, x))
473
+ }
474
+ ) : /* @__PURE__ */ i(le, { children: [
475
+ /* @__PURE__ */ e(o, { sx: { color: "secondary.main", p: 8, textAlign: "center" }, children: c.empty_data }),
476
+ /* @__PURE__ */ e(Y, { sx: { borderColor: "neutral.light" } }),
477
+ /* @__PURE__ */ e(
478
+ me,
479
+ {
534
480
  sx: {
535
- flexDirection: "row",
536
- height: u ? 224 : 308,
537
- justifyContent: "space-around"
538
- },
539
- children: x.map((r) => /* @__PURE__ */ e(o, {
540
- sx: {
541
- color: "secondary.main",
542
- pl: 12,
543
- pr: u ? 4 : 0
544
- },
545
- variant: a,
546
- children: r
547
- }, r))
548
- })]
549
- }), /* @__PURE__ */ i(f, {
550
- sx: { gap: 4 },
551
- children: [
552
- /* @__PURE__ */ i(f, {
553
- sx: {
554
- alignSelf: y ? "start" : "center",
555
- flexDirection: "row",
556
- gap: 8,
557
- pb: 12
558
- },
559
- children: [/* @__PURE__ */ e(o, {
560
- bold: !0,
561
- children: n.invest_analysis
562
- }), /* @__PURE__ */ e(st, {
563
- tooltip_info_body: n.tooltip_info_body,
564
- tooltip_info_title: n.tooltip_info_title
565
- })]
566
- }),
567
- g.map((r, t, d) => /* @__PURE__ */ e(f, {
481
+ ".inner-container": { width: f ? "100%" : 364 }
482
+ }
483
+ }
484
+ )
485
+ ] })
486
+ ] });
487
+ }, at = ({ body: t, title: u }) => /* @__PURE__ */ i(_, { sx: { gap: 4, p: 12 }, children: [
488
+ /* @__PURE__ */ e(o, { bold: !0, variant: "body1", children: u }),
489
+ /* @__PURE__ */ e(X, { variant: "subtitle2", children: t })
490
+ ] }), lt = ({
491
+ placement: t = "bottom",
492
+ tooltip_info_body: u,
493
+ tooltip_info_title: c
494
+ }) => /* @__PURE__ */ e(
495
+ Ve,
496
+ {
497
+ enterTouchDelay: 500,
498
+ placement: t,
499
+ title: /* @__PURE__ */ e(at, { body: u, title: c }),
500
+ children: /* @__PURE__ */ e(de, { "aria-label": c, sx: { minHeight: 0, minWidth: 0, p: 0 }, children: /* @__PURE__ */ e(B, { name: "info", sx: { color: "info.main" } }) })
501
+ }
502
+ ), ct = () => {
503
+ const {
504
+ investments: { analysis: t }
505
+ } = N(), { analysisChartData: u, analysisDetails: c, analysisType: m, setAnalysisType: f } = U(), v = xe("(min-width:320px) and (max-width:375px)"), { isMobile: d } = j(), x = Z().palette.mode === "dark", { cellDimension: h, columns: b, rows: s, textVariant: y } = T.useMemo(() => {
506
+ const r = m === V.Stocks, n = Object.values(r ? t.stock_column_labels : t.bond_column_labels), g = Object.values(r ? t.stock_row_labels : t.bond_row_labels);
507
+ return { cellDimension: d ? 72 : 100, columns: n, rows: g, textVariant: d ? "caption" : "body1" };
508
+ }, [t, d, m]);
509
+ return /* @__PURE__ */ i(
510
+ _,
511
+ {
512
+ sx: {
513
+ flexDirection: { md: "row" },
514
+ gap: d ? 48 : 64,
515
+ justifyContent: "center",
516
+ pt: 48,
517
+ px: 16
518
+ },
519
+ children: [
520
+ /* @__PURE__ */ i(
521
+ _,
522
+ {
568
523
  sx: {
524
+ alignItems: "center",
569
525
  flexDirection: "row",
570
- gap: 4
526
+ justifyContent: "center",
527
+ pr: { lg: 72 }
571
528
  },
572
- children: r.map((D, w) => {
573
- const L = t === 0, I = t === d.length - 1, B = w === 0, F = w === r.length - 1, N = Number(D.replace("%", "")) >= 25;
574
- let S = "grey.200", E = "grey.900";
575
- return l ? (S = N ? "grey.200" : "grey.700", E = N ? "grey.900" : "common.white") : (S = N ? "grey.700" : "grey.200", E = N ? "common.white" : "grey.900"), /* @__PURE__ */ e(f, {
576
- sx: {
577
- borderBottomLeftRadius: I && B ? 4 : 0,
578
- borderBottomRightRadius: I && F ? 4 : 0,
579
- borderTopLeftRadius: L && B ? 4 : 0,
580
- borderTopRightRadius: L && F ? 4 : 0,
581
- alignItems: "center",
582
- bgcolor: S,
583
- height: h,
584
- justifyContent: "center",
585
- width: h
586
- },
587
- children: /* @__PURE__ */ e(o, {
529
+ children: [
530
+ /* @__PURE__ */ i(
531
+ _,
532
+ {
588
533
  sx: {
589
- color: E,
590
- fontWeight: u ? 600 : 700
534
+ alignItems: "center",
535
+ bottom: d ? 10 : 24,
536
+ gap: d ? 0 : 24,
537
+ position: "relative",
538
+ transform: "rotate(-180deg)",
539
+ writingMode: "vertical-rl"
591
540
  },
592
- variant: u ? "body1" : "h3",
593
- children: D
594
- })
595
- }, w);
596
- })
597
- }, t)),
598
- /* @__PURE__ */ e(f, {
599
- sx: {
600
- alignSelf: "center",
601
- flexDirection: "row",
602
- pt: 12
603
- },
604
- children: _.map((r) => /* @__PURE__ */ e(f, {
605
- sx: {
606
- alignItems: "center",
607
- width: h
608
- },
609
- children: /* @__PURE__ */ e(o, {
610
- color: "secondary.main",
611
- variant: a,
612
- children: r
613
- })
614
- }, r))
615
- }),
616
- /* @__PURE__ */ e(o, {
617
- bold: !0,
618
- sx: {
619
- color: "secondary.main",
620
- pt: u ? 4 : 24,
621
- textAlign: "center"
541
+ children: [
542
+ /* @__PURE__ */ e(X, { bold: !0, color: "secondary.main", variant: y, children: m === V.Stocks ? t.market_capitalization : t.credit_quality }),
543
+ /* @__PURE__ */ e(
544
+ _,
545
+ {
546
+ sx: {
547
+ flexDirection: "row",
548
+ height: d ? 224 : 308,
549
+ justifyContent: "space-around"
550
+ },
551
+ children: b.map((r) => /* @__PURE__ */ e(
552
+ o,
553
+ {
554
+ sx: {
555
+ color: "secondary.main",
556
+ pl: 12,
557
+ pr: d ? 4 : 0
558
+ },
559
+ variant: y,
560
+ children: r
561
+ },
562
+ r
563
+ ))
564
+ }
565
+ )
566
+ ]
567
+ }
568
+ ),
569
+ /* @__PURE__ */ i(_, { sx: { gap: 4 }, children: [
570
+ /* @__PURE__ */ i(
571
+ _,
572
+ {
573
+ sx: {
574
+ alignSelf: v ? "start" : "center",
575
+ flexDirection: "row",
576
+ gap: 8,
577
+ pb: 12
578
+ },
579
+ children: [
580
+ /* @__PURE__ */ e(o, { bold: !0, children: t.invest_analysis }),
581
+ /* @__PURE__ */ e(
582
+ lt,
583
+ {
584
+ tooltip_info_body: t.tooltip_info_body,
585
+ tooltip_info_title: t.tooltip_info_title
586
+ }
587
+ )
588
+ ]
589
+ }
590
+ ),
591
+ u.map((r, n, g) => /* @__PURE__ */ e(_, { sx: { flexDirection: "row", gap: 4 }, children: r.map((C, D) => {
592
+ const k = n === 0, W = n === g.length - 1, A = D === 0, G = D === r.length - 1, F = Number(C.replace("%", "")) >= 25;
593
+ let L = "grey.200", H = "grey.900";
594
+ return x ? (L = F ? "grey.200" : "grey.700", H = F ? "grey.900" : "common.white") : (L = F ? "grey.700" : "grey.200", H = F ? "common.white" : "grey.900"), /* @__PURE__ */ e(
595
+ _,
596
+ {
597
+ sx: {
598
+ ...{
599
+ borderBottomLeftRadius: W && A ? 4 : 0,
600
+ borderBottomRightRadius: W && G ? 4 : 0,
601
+ borderTopLeftRadius: k && A ? 4 : 0,
602
+ borderTopRightRadius: k && G ? 4 : 0
603
+ },
604
+ alignItems: "center",
605
+ bgcolor: L,
606
+ height: h,
607
+ justifyContent: "center",
608
+ width: h
609
+ },
610
+ children: /* @__PURE__ */ e(
611
+ o,
612
+ {
613
+ sx: {
614
+ color: H,
615
+ fontWeight: d ? 600 : 700
616
+ },
617
+ variant: d ? "body1" : "h3",
618
+ children: C
619
+ }
620
+ )
621
+ },
622
+ D
623
+ );
624
+ }) }, n)),
625
+ /* @__PURE__ */ e(_, { sx: { alignSelf: "center", flexDirection: "row", pt: 12 }, children: s.map((r) => /* @__PURE__ */ e(_, { sx: { alignItems: "center", width: h }, children: /* @__PURE__ */ e(o, { color: "secondary.main", variant: y, children: r }) }, r)) }),
626
+ /* @__PURE__ */ e(
627
+ o,
628
+ {
629
+ bold: !0,
630
+ sx: { color: "secondary.main", pt: d ? 4 : 24, textAlign: "center" },
631
+ variant: y,
632
+ children: m === V.Stocks ? t.valuation : t.duration
633
+ }
634
+ )
635
+ ] })
636
+ ]
637
+ }
638
+ ),
639
+ /* @__PURE__ */ e(
640
+ st,
641
+ {
642
+ analysisDetails: c,
643
+ analysisType: m,
644
+ copy: {
645
+ empty_data: t.empty_data,
646
+ equities: t.equities,
647
+ bonds: t.bonds
622
648
  },
623
- variant: a,
624
- children: m === O.Stocks ? n.valuation : n.duration
625
- })
626
- ]
627
- })]
628
- }), /* @__PURE__ */ e(rt, {
629
- analysisDetails: c,
630
- analysisType: m,
631
- copy: {
632
- empty_data: n.empty_data,
633
- equities: n.equities,
634
- bonds: n.bonds
635
- },
636
- setAnalysisType: v
637
- })]
638
- });
639
- }, ct = R(lt), dt = ({ accountHoldingsData: n, currentEditedCostBasis: g, editingHoldingId: c, handleCostBasisBlur: m, handleCostBasisClick: v, handleCostBasisChange: y, handleCostBasisKeyDown: u, isOpen: l, onClose: h }) => {
640
- const { investments: x } = G(), [_, a] = T.useState({}), r = (t) => (d, D) => {
641
- a((w) => ({
642
- ...w,
643
- [t]: D
649
+ setAnalysisType: f
650
+ }
651
+ )
652
+ ]
653
+ }
654
+ );
655
+ }, dt = $(ct), mt = ({
656
+ accountHoldingsData: t,
657
+ currentEditedCostBasis: u,
658
+ editingHoldingId: c,
659
+ handleCostBasisBlur: m,
660
+ handleCostBasisClick: f,
661
+ handleCostBasisChange: v,
662
+ handleCostBasisKeyDown: d,
663
+ isOpen: l,
664
+ onClose: x
665
+ }) => {
666
+ const { investments: h } = N(), [b, s] = T.useState({}), y = (r) => (n, g) => {
667
+ s((C) => ({
668
+ ...C,
669
+ [r]: g
644
670
  }));
645
671
  };
646
- return /* @__PURE__ */ i(Me, {
647
- ariaLabelClose: x.overview.close_investment_drawer,
648
- isOpen: l,
649
- onClose: h,
650
- title: x.overview.investment_details,
651
- children: [
652
- /* @__PURE__ */ i(p, {
653
- sx: {
654
- gap: 8,
655
- p: 24
656
- },
657
- children: [
658
- /* @__PURE__ */ e(te, {
659
- alt: n.accounts.institutionName || "",
660
- institutionGuid: n.accounts.institution_guid || "",
661
- size: 64
662
- }),
663
- /* @__PURE__ */ e(o, {
664
- sx: { color: "text.primary" },
665
- variant: "body2",
666
- children: n.accounts.memberName
667
- }),
668
- /* @__PURE__ */ e(o, {
669
- sx: { color: "text.primary" },
670
- variant: "h2",
671
- children: n.accounts.user_name || n.accounts.name
672
- }),
673
- /* @__PURE__ */ i(p, {
672
+ return /* @__PURE__ */ i(
673
+ Re,
674
+ {
675
+ ariaLabelClose: h.overview.close_investment_drawer,
676
+ isOpen: l,
677
+ onClose: x,
678
+ title: h.overview.investment_details,
679
+ children: [
680
+ /* @__PURE__ */ i(p, { sx: { gap: 8, p: 24 }, children: [
681
+ /* @__PURE__ */ e(
682
+ oe,
683
+ {
684
+ alt: t.accounts.institutionName || "",
685
+ institutionGuid: t.accounts.institution_guid || "",
686
+ size: 64
687
+ }
688
+ ),
689
+ /* @__PURE__ */ e(o, { sx: { color: "text.primary" }, variant: "body2", children: t.accounts.memberName }),
690
+ /* @__PURE__ */ e(o, { sx: { color: "text.primary" }, variant: "h2", children: t.accounts.user_name || t.accounts.name }),
691
+ /* @__PURE__ */ i(p, { sx: { alignItems: "center", flexDirection: "row", justifyContent: "space-between" }, children: [
692
+ /* @__PURE__ */ e(o, { sx: { color: "text.primary", fontWeight: 600 }, variant: "body1", children: h.overview.current_balance }),
693
+ /* @__PURE__ */ e(o, { sx: { color: "text.primary", fontWeight: 600 }, variant: "body1", children: t.accounts.balance?.toLocaleString("en-US", {
694
+ currency: "USD",
695
+ maximumFractionDigits: 2,
696
+ minimumFractionDigits: 2,
697
+ style: "currency"
698
+ }) })
699
+ ] })
700
+ ] }),
701
+ /* @__PURE__ */ i(
702
+ p,
703
+ {
674
704
  sx: {
675
- alignItems: "center",
705
+ bgcolor: "background.default",
676
706
  flexDirection: "row",
677
- justifyContent: "space-between"
707
+ justifyContent: "space-between",
708
+ px: 24,
709
+ py: 10
678
710
  },
679
- children: [/* @__PURE__ */ e(o, {
680
- sx: {
681
- color: "text.primary",
682
- fontWeight: 600
711
+ children: [
712
+ /* @__PURE__ */ e(o, { sx: { color: "text.primary", fontWeight: 700 }, variant: "caption", children: h.overview.holding }),
713
+ /* @__PURE__ */ e(o, { sx: { color: "text.primary", fontWeight: 700 }, variant: "caption", children: h.overview.market_value })
714
+ ]
715
+ }
716
+ ),
717
+ t.holdings?.map((r, n) => {
718
+ const g = c === r.id;
719
+ return /* @__PURE__ */ i(
720
+ be,
721
+ {
722
+ disableGutters: !0,
723
+ expanded: b[r.id] === !0,
724
+ onChange: r ? y(r?.id) : () => {
683
725
  },
684
- variant: "body1",
685
- children: x.overview.current_balance
686
- }), /* @__PURE__ */ e(o, {
687
- sx: {
688
- color: "text.primary",
689
- fontWeight: 600
690
- },
691
- variant: "body1",
692
- children: n.accounts.balance?.toLocaleString("en-US", {
693
- currency: "USD",
694
- maximumFractionDigits: 2,
695
- minimumFractionDigits: 2,
696
- style: "currency"
697
- })
698
- })]
699
- })
700
- ]
701
- }),
702
- /* @__PURE__ */ i(p, {
703
- sx: {
704
- bgcolor: "background.default",
705
- flexDirection: "row",
706
- justifyContent: "space-between",
707
- px: 24,
708
- py: 10
709
- },
710
- children: [/* @__PURE__ */ e(o, {
711
- sx: {
712
- color: "text.primary",
713
- fontWeight: 700
714
- },
715
- variant: "caption",
716
- children: x.overview.holding
717
- }), /* @__PURE__ */ e(o, {
718
- sx: {
719
- color: "text.primary",
720
- fontWeight: 700
721
- },
722
- variant: "caption",
723
- children: x.overview.market_value
724
- })]
725
- }),
726
- n.holdings?.map((t, d) => {
727
- const D = c === t.id;
728
- return /* @__PURE__ */ i(_e, {
729
- disableGutters: !0,
730
- expanded: _[t.id] === !0,
731
- onChange: t ? r(t?.id) : () => {
732
- },
733
- sx: {
734
- ":before": d === 0 ? { opacity: 0 } : {},
735
- ".MuiAccordionDetails-root": { p: 0 }
736
- },
737
- children: [/* @__PURE__ */ e(Ce, {
738
- "aria-controls": "panel1a-content",
739
- id: "panel1a-header",
740
- sx: [{ height: 64 }, _[t.id] && d > 0 && {
741
- borderTop: 1,
742
- borderColor: "divider"
743
- }],
744
- children: /* @__PURE__ */ i(p, {
745
726
  sx: {
746
- flexDirection: "row",
747
- width: "100%"
727
+ ":before": n === 0 ? { opacity: 0 } : {},
728
+ ".MuiAccordionDetails-root": { p: 0 }
748
729
  },
749
- children: [/* @__PURE__ */ e("div", { style: { width: 24 } }), /* @__PURE__ */ i(p, {
750
- sx: [{
751
- alignItems: "center",
752
- flexDirection: "row",
753
- justifyContent: "space-between",
754
- pr: 24,
755
- py: 14,
756
- width: "100%"
757
- }, _[t.id] && {
758
- borderBottom: 1,
759
- borderColor: "divider"
760
- }],
761
- children: [/* @__PURE__ */ e(p, {
762
- sx: {
763
- alignItems: "center",
764
- flexDirection: "row",
765
- gap: 12
766
- },
767
- children: /* @__PURE__ */ i(p, {
768
- sx: {
769
- overflow: "hidden",
770
- width: 98
771
- },
772
- children: [/* @__PURE__ */ e(o, {
773
- sx: { fontWeight: 600 },
774
- variant: "body1",
775
- children: t.holding
776
- }), /* @__PURE__ */ e(o, {
777
- variant: "caption",
778
- children: t.description
779
- })]
780
- })
781
- }), /* @__PURE__ */ i(p, {
782
- sx: {
783
- alignItems: "center",
784
- flex: 1,
785
- flexDirection: "row",
786
- gap: 12,
787
- justifyContent: "flex-end"
788
- },
789
- children: [/* @__PURE__ */ i(p, { children: [/* @__PURE__ */ e(o, {
790
- sx: {
791
- fontWeight: 600,
792
- textAlign: "right"
793
- },
794
- variant: "body1",
795
- children: t.marketValue?.toLocaleString("en-US", {
796
- currency: "USD",
797
- maximumFractionDigits: 2,
798
- minimumFractionDigits: 2,
799
- style: "currency"
800
- })
801
- }), /* @__PURE__ */ i(p, {
730
+ children: [
731
+ /* @__PURE__ */ e(
732
+ we,
733
+ {
734
+ "aria-controls": "panel1a-content",
735
+ id: "panel1a-header",
736
+ sx: [
737
+ { height: 64 },
738
+ b[r.id] && n > 0 && {
739
+ borderTop: 1,
740
+ borderColor: "divider"
741
+ }
742
+ ],
743
+ children: /* @__PURE__ */ i(p, { sx: { flexDirection: "row", width: "100%" }, children: [
744
+ /* @__PURE__ */ e("div", { style: { width: 24 } }),
745
+ /* @__PURE__ */ i(
746
+ p,
747
+ {
748
+ sx: [
749
+ {
750
+ alignItems: "center",
751
+ flexDirection: "row",
752
+ justifyContent: "space-between",
753
+ pr: 24,
754
+ py: 14,
755
+ width: "100%"
756
+ },
757
+ b[r.id] && {
758
+ borderBottom: 1,
759
+ borderColor: "divider"
760
+ }
761
+ ],
762
+ children: [
763
+ /* @__PURE__ */ e(
764
+ p,
765
+ {
766
+ sx: {
767
+ alignItems: "center",
768
+ flexDirection: "row",
769
+ gap: 12
770
+ },
771
+ children: /* @__PURE__ */ i(p, { sx: { overflow: "hidden", width: 98 }, children: [
772
+ /* @__PURE__ */ e(o, { sx: { fontWeight: 600 }, variant: "body1", children: r.holding }),
773
+ /* @__PURE__ */ e(o, { variant: "caption", children: r.description })
774
+ ] })
775
+ }
776
+ ),
777
+ /* @__PURE__ */ i(
778
+ p,
779
+ {
780
+ sx: {
781
+ alignItems: "center",
782
+ flex: 1,
783
+ flexDirection: "row",
784
+ gap: 12,
785
+ justifyContent: "flex-end"
786
+ },
787
+ children: [
788
+ /* @__PURE__ */ i(p, { children: [
789
+ /* @__PURE__ */ e(o, { sx: { fontWeight: 600, textAlign: "right" }, variant: "body1", children: r.marketValue?.toLocaleString("en-US", {
790
+ currency: "USD",
791
+ maximumFractionDigits: 2,
792
+ minimumFractionDigits: 2,
793
+ style: "currency"
794
+ }) }),
795
+ /* @__PURE__ */ i(p, { sx: { alignItems: "center", gap: 2, flexDirection: "row" }, children: [
796
+ r.totalGainLoss !== 0 && /* @__PURE__ */ e(
797
+ B,
798
+ {
799
+ name: r.totalGainLoss >= 0 ? "trending_up" : "trending_down",
800
+ size: 12,
801
+ sx: {
802
+ verticalAlign: "middle",
803
+ mr: 1,
804
+ color: r.totalGainLoss >= 0 ? "success.main" : "grey.700"
805
+ }
806
+ }
807
+ ),
808
+ /* @__PURE__ */ e(
809
+ o,
810
+ {
811
+ sx: {
812
+ color: r.totalGainLoss <= 0 ? "grey.700" : "success.main",
813
+ fontWeight: r.totalGainLoss <= 0 ? 400 : 700
814
+ },
815
+ variant: "caption",
816
+ children: r.costBasis ? `${(r.totalGainLoss / r.costBasis * 100).toFixed(2)}%` : "0.00%"
817
+ }
818
+ ),
819
+ /* @__PURE__ */ e(o, { sx: { color: "grey.700" }, variant: "caption", children: "|" }),
820
+ /* @__PURE__ */ e(
821
+ o,
822
+ {
823
+ sx: {
824
+ color: r.totalGainLoss <= 0 ? "grey.700" : "success.main",
825
+ fontWeight: r.totalGainLoss <= 0 ? 400 : 700
826
+ },
827
+ variant: "caption",
828
+ children: Math.abs(r.totalGainLoss).toLocaleString("en-US", {
829
+ currency: "USD",
830
+ maximumFractionDigits: 2,
831
+ minimumFractionDigits: 2,
832
+ style: "currency"
833
+ })
834
+ }
835
+ )
836
+ ] })
837
+ ] }),
838
+ /* @__PURE__ */ e(
839
+ B,
840
+ {
841
+ name: b[r.id] ? "expand_less" : "expand_more",
842
+ size: 20
843
+ }
844
+ )
845
+ ]
846
+ }
847
+ )
848
+ ]
849
+ }
850
+ )
851
+ ] })
852
+ }
853
+ ),
854
+ /* @__PURE__ */ e(_e, { children: /* @__PURE__ */ i(
855
+ p,
856
+ {
802
857
  sx: {
803
858
  alignItems: "center",
804
- gap: 2,
805
- flexDirection: "row"
859
+ bgcolor: "background.default",
860
+ flexDirection: "row",
861
+ pl: 24
806
862
  },
807
863
  children: [
808
- t.totalGainLoss !== 0 && /* @__PURE__ */ e(k, {
809
- name: t.totalGainLoss >= 0 ? "trending_up" : "trending_down",
810
- size: 12,
811
- sx: {
812
- verticalAlign: "middle",
813
- mr: 1,
814
- color: t.totalGainLoss >= 0 ? "success.main" : "grey.700"
815
- }
816
- }),
817
- /* @__PURE__ */ e(o, {
818
- sx: {
819
- color: t.totalGainLoss <= 0 ? "grey.700" : "success.main",
820
- fontWeight: t.totalGainLoss <= 0 ? 400 : 700
821
- },
822
- variant: "caption",
823
- children: t.costBasis ? `${(t.totalGainLoss / t.costBasis * 100).toFixed(2)}%` : "0.00%"
824
- }),
825
- /* @__PURE__ */ e(o, {
826
- sx: { color: "grey.700" },
827
- variant: "caption",
828
- children: "|"
829
- }),
830
- /* @__PURE__ */ e(o, {
831
- sx: {
832
- color: t.totalGainLoss <= 0 ? "grey.700" : "success.main",
833
- fontWeight: t.totalGainLoss <= 0 ? 400 : 700
834
- },
835
- variant: "caption",
836
- children: Math.abs(t.totalGainLoss).toLocaleString("en-US", {
837
- currency: "USD",
838
- maximumFractionDigits: 2,
839
- minimumFractionDigits: 2,
840
- style: "currency"
841
- })
842
- })
864
+ /* @__PURE__ */ e(p, { sx: { width: 32 } }),
865
+ /* @__PURE__ */ i(p, { sx: { flex: 1 }, children: [
866
+ /* @__PURE__ */ i(
867
+ p,
868
+ {
869
+ sx: {
870
+ alignItems: "center",
871
+ borderBottom: 1,
872
+ borderColor: "divider",
873
+ flexDirection: "row",
874
+ height: 48,
875
+ justifyContent: "space-between",
876
+ pr: 24
877
+ },
878
+ children: [
879
+ /* @__PURE__ */ e(o, { sx: { color: "text.primary" }, variant: "body1", children: h.overview.quantity }),
880
+ /* @__PURE__ */ e(o, { sx: { color: "text.primary" }, variant: "body2", children: r.qty })
881
+ ]
882
+ }
883
+ ),
884
+ /* @__PURE__ */ i(
885
+ p,
886
+ {
887
+ sx: {
888
+ alignItems: "center",
889
+ flexDirection: "row",
890
+ height: 48,
891
+ justifyContent: "space-between",
892
+ pr: 24
893
+ },
894
+ children: [
895
+ /* @__PURE__ */ e(o, { sx: { color: "text.primary" }, variant: "body1", children: h.overview.cost_basis_header }),
896
+ /* @__PURE__ */ i(
897
+ p,
898
+ {
899
+ direction: "row",
900
+ sx: {
901
+ alignItems: "center",
902
+ gap: 4
903
+ },
904
+ children: [
905
+ g ? /* @__PURE__ */ e(
906
+ Ce,
907
+ {
908
+ autoFocus: !0,
909
+ onBlur: () => m(r.id),
910
+ onChange: v,
911
+ onKeyDown: (C) => d(C, r.id),
912
+ size: "small",
913
+ sx: {
914
+ fontSize: 14,
915
+ width: 58,
916
+ "& .MuiInputBase-input": {
917
+ padding: "4px 0",
918
+ textAlign: "center",
919
+ fontWeight: 600,
920
+ color: "text.primary"
921
+ },
922
+ "& .MuiOutlinedInput-notchedOutline": {
923
+ border: "none"
924
+ }
925
+ },
926
+ value: u
927
+ }
928
+ ) : /* @__PURE__ */ e(o, { sx: { fontSize: 14, width: 58 }, variant: "body2", children: r.costBasis?.toLocaleString("en-US", {
929
+ currency: "USD",
930
+ maximumFractionDigits: 2,
931
+ minimumFractionDigits: 2,
932
+ style: "currency"
933
+ }) }),
934
+ /* @__PURE__ */ e(
935
+ de,
936
+ {
937
+ onClick: () => f(r.id, r.costBasis),
938
+ sx: { minWidth: 16, minHeight: 16 },
939
+ children: /* @__PURE__ */ e(B, { name: "stylus", size: 16, sx: { color: "grey.700" } })
940
+ }
941
+ )
942
+ ]
943
+ }
944
+ )
945
+ ]
946
+ }
947
+ )
948
+ ] })
843
949
  ]
844
- })] }), /* @__PURE__ */ e(k, {
845
- name: _[t.id] ? "expand_less" : "expand_more",
846
- size: 20
847
- })]
848
- })]
849
- })]
850
- })
851
- }), /* @__PURE__ */ e(we, { children: /* @__PURE__ */ i(p, {
852
- sx: {
853
- alignItems: "center",
854
- bgcolor: "background.default",
855
- flexDirection: "row",
856
- pl: 24
950
+ }
951
+ ) })
952
+ ]
857
953
  },
858
- children: [/* @__PURE__ */ e(p, { sx: { width: 32 } }), /* @__PURE__ */ i(p, {
859
- sx: { flex: 1 },
860
- children: [/* @__PURE__ */ i(p, {
861
- sx: {
862
- alignItems: "center",
863
- borderBottom: 1,
864
- borderColor: "divider",
865
- flexDirection: "row",
866
- height: 48,
867
- justifyContent: "space-between",
868
- pr: 24
869
- },
870
- children: [/* @__PURE__ */ e(o, {
871
- sx: { color: "text.primary" },
872
- variant: "body1",
873
- children: x.overview.quantity
874
- }), /* @__PURE__ */ e(o, {
875
- sx: { color: "text.primary" },
876
- variant: "body2",
877
- children: t.qty
878
- })]
879
- }), /* @__PURE__ */ i(p, {
880
- sx: {
881
- alignItems: "center",
882
- flexDirection: "row",
883
- height: 48,
884
- justifyContent: "space-between",
885
- pr: 24
886
- },
887
- children: [/* @__PURE__ */ e(o, {
888
- sx: { color: "text.primary" },
889
- variant: "body1",
890
- children: x.overview.cost_basis_header
891
- }), /* @__PURE__ */ i(p, {
892
- direction: "row",
893
- sx: {
894
- alignItems: "center",
895
- gap: 4
896
- },
897
- children: [D ? /* @__PURE__ */ e(be, {
898
- autoFocus: !0,
899
- onBlur: () => m(t.id),
900
- onChange: y,
901
- onKeyDown: (w) => u(w, t.id),
902
- size: "small",
903
- sx: {
904
- fontSize: 14,
905
- width: 58,
906
- "& .MuiInputBase-input": {
907
- padding: "4px 0",
908
- textAlign: "center",
909
- fontWeight: 600,
910
- color: "text.primary"
911
- },
912
- "& .MuiOutlinedInput-notchedOutline": { border: "none" }
913
- },
914
- value: g
915
- }) : /* @__PURE__ */ e(o, {
916
- sx: {
917
- fontSize: 14,
918
- width: 58
919
- },
920
- variant: "body2",
921
- children: t.costBasis?.toLocaleString("en-US", {
922
- currency: "USD",
923
- maximumFractionDigits: 2,
924
- minimumFractionDigits: 2,
925
- style: "currency"
926
- })
927
- }), /* @__PURE__ */ e(le, {
928
- onClick: () => v(t.id, t.costBasis),
929
- sx: {
930
- minWidth: 16,
931
- minHeight: 16
932
- },
933
- children: /* @__PURE__ */ e(k, {
934
- name: "stylus",
935
- size: 16,
936
- sx: { color: "grey.700" }
937
- })
938
- })]
939
- })]
940
- })]
941
- })]
942
- }) })]
943
- }, t.id);
944
- })
945
- ]
946
- });
947
- }, mt = R(dt), q = (n) => /* @__PURE__ */ i(Re, {
948
- sx: {
949
- alignItems: "center",
950
- flexDirection: "row",
951
- gap: 4
952
- },
953
- children: [/* @__PURE__ */ e(o, {
954
- sx: {
955
- color: "text.primary",
956
- fontWeight: 600,
957
- fontSize: 14
954
+ r.id
955
+ );
956
+ })
957
+ ]
958
+ }
959
+ );
960
+ }, ut = $(mt), K = (t) => /* @__PURE__ */ i(Pe, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
961
+ /* @__PURE__ */ e(o, { sx: { color: "text.primary", fontWeight: 600, fontSize: 14 }, variant: "body2", children: t.colDef.headerName }),
962
+ /* @__PURE__ */ e(B, { name: "expand_all", size: 12 })
963
+ ] }), ht = ({
964
+ data: t,
965
+ editingHoldingId: u,
966
+ currentEditedCostBasis: c,
967
+ handleCostBasisClick: m,
968
+ handleCostBasisChange: f,
969
+ handleCostBasisKeyDown: v,
970
+ handleCostBasisBlur: d
971
+ }) => {
972
+ const { investments: l } = N(), h = Z().palette.mode === "dark", b = "success.main", s = h ? "grey.300" : "grey.700", y = (n, g = "lesserThan") => g === "greaterThan" ? n >= 0 ? b : s : n <= 0 ? s : b, r = [
973
+ {
974
+ field: "qty",
975
+ headerName: l.overview.qty_header,
976
+ sortable: !1,
977
+ width: 48,
978
+ align: "center",
979
+ headerAlign: "center"
958
980
  },
959
- variant: "body2",
960
- children: n.colDef.headerName
961
- }), /* @__PURE__ */ e(k, {
962
- name: "expand_all",
963
- size: 12
964
- })]
965
- }), ut = ({ data: n, editingHoldingId: g, currentEditedCostBasis: c, handleCostBasisClick: m, handleCostBasisChange: v, handleCostBasisKeyDown: y, handleCostBasisBlur: u }) => {
966
- const { investments: l } = G(), h = X().palette.mode === "dark", x = "success.main", _ = h ? "grey.300" : "grey.700", a = (r, t = "lesserThan") => t === "greaterThan" ? r >= 0 ? x : _ : r <= 0 ? _ : x;
967
- return /* @__PURE__ */ e(ne, {
968
- sx: {
969
- boxShadow: "none",
970
- width: "100%"
981
+ {
982
+ field: "holding",
983
+ headerName: l.overview.holding_header,
984
+ flex: 1,
985
+ renderHeader: K,
986
+ renderCell: (n) => /* @__PURE__ */ e(_, { sx: { alignItems: "center", gap: 16, flexDirection: "row" }, children: /* @__PURE__ */ i(_, { children: [
987
+ /* @__PURE__ */ e(o, { sx: { fontWeight: 700 }, children: n.row.holding }),
988
+ /* @__PURE__ */ e(o, { sx: { color: "text.secondary", fontWeight: 400 }, variant: "tiny", children: n.row.description })
989
+ ] }) })
971
990
  },
972
- children: /* @__PURE__ */ e(Ke, {
973
- columns: [
974
- {
975
- field: "qty",
976
- headerName: l.overview.qty_header,
977
- sortable: !1,
978
- width: 48,
979
- align: "center",
980
- headerAlign: "center"
981
- },
982
- {
983
- field: "holding",
984
- headerName: l.overview.holding_header,
985
- flex: 1,
986
- renderHeader: q,
987
- renderCell: (r) => /* @__PURE__ */ e(f, {
988
- sx: {
989
- alignItems: "center",
990
- gap: 16,
991
- flexDirection: "row"
992
- },
993
- children: /* @__PURE__ */ i(f, { children: [/* @__PURE__ */ e(o, {
994
- sx: { fontWeight: 700 },
995
- children: r.row.holding
996
- }), /* @__PURE__ */ e(o, {
997
- sx: {
998
- color: "text.secondary",
999
- fontWeight: 400
1000
- },
1001
- variant: "tiny",
1002
- children: r.row.description
1003
- })] })
1004
- })
1005
- },
1006
- {
1007
- field: "costBasis",
1008
- headerName: l.overview.cost_basis_header,
1009
- width: 132,
1010
- renderHeader: q,
1011
- renderCell: (r) => /* @__PURE__ */ i(f, {
1012
- sx: {
1013
- alignItems: "center",
1014
- flexDirection: "row",
1015
- gap: 4
1016
- },
1017
- children: [g === r.row.id ? /* @__PURE__ */ e(be, {
991
+ {
992
+ field: "costBasis",
993
+ headerName: l.overview.cost_basis_header,
994
+ width: 132,
995
+ renderHeader: K,
996
+ renderCell: (n) => {
997
+ const g = u === n.row.id;
998
+ return /* @__PURE__ */ i(_, { sx: { alignItems: "center", flexDirection: "row", gap: 4 }, children: [
999
+ g ? /* @__PURE__ */ e(
1000
+ Ce,
1001
+ {
1018
1002
  autoFocus: !0,
1019
- onBlur: () => u(r.row.id),
1020
- onChange: v,
1021
- onKeyDown: (t) => y(t, r.row.id),
1003
+ onBlur: () => d(n.row.id),
1004
+ onChange: f,
1005
+ onKeyDown: (C) => v(C, n.row.id),
1022
1006
  size: "small",
1023
1007
  sx: {
1024
1008
  fontSize: 14,
@@ -1029,374 +1013,382 @@ var ce = ({ sx: n = {} }) => {
1029
1013
  fontWeight: 600,
1030
1014
  color: "text.primary"
1031
1015
  },
1032
- "& .MuiOutlinedInput-notchedOutline": { border: "none" }
1016
+ "& .MuiOutlinedInput-notchedOutline": {
1017
+ border: "none"
1018
+ }
1033
1019
  },
1034
1020
  value: c
1035
- }) : /* @__PURE__ */ e(o, {
1021
+ }
1022
+ ) : /* @__PURE__ */ e(o, { sx: { fontSize: 14, width: 57 }, variant: "body2", children: n.value?.toLocaleString("en-US", {
1023
+ currency: "USD",
1024
+ maximumFractionDigits: 2,
1025
+ minimumFractionDigits: 2,
1026
+ style: "currency"
1027
+ }) }),
1028
+ /* @__PURE__ */ e(
1029
+ de,
1030
+ {
1031
+ onClick: () => m(n.row.id, n.row.costBasis),
1032
+ sx: { minWidth: 12, minHeight: 12 },
1033
+ children: /* @__PURE__ */ e(B, { name: "stylus", size: 12, sx: { color: "grey.700" } })
1034
+ }
1035
+ )
1036
+ ] });
1037
+ },
1038
+ align: "center",
1039
+ headerAlign: "center"
1040
+ },
1041
+ {
1042
+ field: "totalGainLoss",
1043
+ headerName: l.overview.total_gain_loss_header,
1044
+ width: 196,
1045
+ renderHeader: K,
1046
+ renderCell: (n) => {
1047
+ const g = n.row.costBasis, C = g ? n.row.totalGainLoss / g * 100 : 0;
1048
+ return /* @__PURE__ */ i(_, { sx: { alignItems: "center", flexDirection: "row", gap: 2 }, children: [
1049
+ n.value !== 0 && /* @__PURE__ */ e(
1050
+ B,
1051
+ {
1052
+ name: n.value > 0 ? "trending_up" : "trending_down",
1053
+ size: 16,
1036
1054
  sx: {
1037
- fontSize: 14,
1038
- width: 57
1055
+ color: y(n.value),
1056
+ mr: 1,
1057
+ verticalAlign: "middle"
1058
+ }
1059
+ }
1060
+ ),
1061
+ /* @__PURE__ */ e(
1062
+ o,
1063
+ {
1064
+ sx: {
1065
+ color: y(n.value),
1066
+ fontWeight: n.value > 0 ? 700 : 400
1067
+ },
1068
+ variant: "body2",
1069
+ children: g ? `${C.toFixed(2)}%` : "0.00%"
1070
+ }
1071
+ ),
1072
+ /* @__PURE__ */ e(o, { sx: { color: "text.secondary" }, variant: "caption", children: "|" }),
1073
+ /* @__PURE__ */ e(
1074
+ o,
1075
+ {
1076
+ sx: {
1077
+ color: y(n.value),
1078
+ fontWeight: n.value > 0 ? 700 : 400
1039
1079
  },
1040
1080
  variant: "body2",
1041
- children: r.value?.toLocaleString("en-US", {
1081
+ children: Math.abs(n.value).toLocaleString("en-US", {
1042
1082
  currency: "USD",
1043
1083
  maximumFractionDigits: 2,
1044
1084
  minimumFractionDigits: 2,
1045
1085
  style: "currency"
1046
1086
  })
1047
- }), /* @__PURE__ */ e(le, {
1048
- onClick: () => m(r.row.id, r.row.costBasis),
1049
- sx: {
1050
- minWidth: 12,
1051
- minHeight: 12
1052
- },
1053
- children: /* @__PURE__ */ e(k, {
1054
- name: "stylus",
1055
- size: 12,
1056
- sx: { color: "grey.700" }
1057
- })
1058
- })]
1059
- }),
1060
- align: "center",
1061
- headerAlign: "center"
1062
- },
1063
- {
1064
- field: "totalGainLoss",
1065
- headerName: l.overview.total_gain_loss_header,
1066
- width: 196,
1067
- renderHeader: q,
1068
- renderCell: (r) => {
1069
- const t = r.row.costBasis, d = t ? r.row.totalGainLoss / t * 100 : 0;
1070
- return /* @__PURE__ */ i(f, {
1071
- sx: {
1072
- alignItems: "center",
1073
- flexDirection: "row",
1074
- gap: 2
1075
- },
1076
- children: [
1077
- r.value !== 0 && /* @__PURE__ */ e(k, {
1078
- name: r.value > 0 ? "trending_up" : "trending_down",
1079
- size: 16,
1080
- sx: {
1081
- color: a(r.value),
1082
- mr: 1,
1083
- verticalAlign: "middle"
1084
- }
1085
- }),
1086
- /* @__PURE__ */ e(o, {
1087
- sx: {
1088
- color: a(r.value),
1089
- fontWeight: r.value > 0 ? 700 : 400
1090
- },
1091
- variant: "body2",
1092
- children: t ? `${d.toFixed(2)}%` : "0.00%"
1093
- }),
1094
- /* @__PURE__ */ e(o, {
1095
- sx: { color: "text.secondary" },
1096
- variant: "caption",
1097
- children: "|"
1098
- }),
1099
- /* @__PURE__ */ e(o, {
1100
- sx: {
1101
- color: a(r.value),
1102
- fontWeight: r.value > 0 ? 700 : 400
1103
- },
1104
- variant: "body2",
1105
- children: Math.abs(r.value).toLocaleString("en-US", {
1106
- currency: "USD",
1107
- maximumFractionDigits: 2,
1108
- minimumFractionDigits: 2,
1109
- style: "currency"
1110
- })
1111
- })
1112
- ]
1113
- });
1114
- },
1115
- align: "right",
1116
- headerAlign: "right",
1117
- sortable: !1
1118
- },
1087
+ }
1088
+ )
1089
+ ] });
1090
+ },
1091
+ align: "right",
1092
+ headerAlign: "right",
1093
+ sortable: !1
1094
+ },
1095
+ {
1096
+ field: "marketValue",
1097
+ headerName: l.overview.market_value_header,
1098
+ width: 132,
1099
+ renderHeader: K,
1100
+ renderCell: (n) => /* @__PURE__ */ e(o, { sx: { fontWeight: 700 }, variant: "body2", children: n.value?.toLocaleString("en-US", {
1101
+ currency: "USD",
1102
+ maximumFractionDigits: 2,
1103
+ minimumFractionDigits: 2,
1104
+ style: "currency"
1105
+ }) }),
1106
+ align: "right",
1107
+ headerAlign: "right"
1108
+ }
1109
+ ];
1110
+ return /* @__PURE__ */ e(
1111
+ se,
1112
+ {
1113
+ sx: {
1114
+ boxShadow: "none",
1115
+ width: "100%"
1116
+ },
1117
+ children: /* @__PURE__ */ e(
1118
+ $e,
1119
1119
  {
1120
- field: "marketValue",
1121
- headerName: l.overview.market_value_header,
1122
- width: 132,
1123
- renderHeader: q,
1124
- renderCell: (r) => /* @__PURE__ */ e(o, {
1125
- sx: { fontWeight: 700 },
1126
- variant: "body2",
1127
- children: r.value?.toLocaleString("en-US", {
1128
- currency: "USD",
1129
- maximumFractionDigits: 2,
1130
- minimumFractionDigits: 2,
1131
- style: "currency"
1132
- })
1133
- }),
1134
- align: "right",
1135
- headerAlign: "right"
1120
+ columns: r,
1121
+ disableColumnFilter: !0,
1122
+ disableColumnMenu: !0,
1123
+ disableRowSelectionOnClick: !0,
1124
+ hideFooter: !0,
1125
+ rows: t,
1126
+ slotProps: { baseIconButton: { sx: { display: "none" } } }
1136
1127
  }
1137
- ],
1138
- disableColumnFilter: !0,
1139
- disableColumnMenu: !0,
1140
- disableRowSelectionOnClick: !0,
1141
- hideFooter: !0,
1142
- rows: n,
1143
- slotProps: { baseIconButton: { sx: { display: "none" } } }
1144
- })
1145
- });
1146
- }, ht = () => {
1147
- const { isMobile: n } = M(), [g, c] = z({}), [m, v] = z(!1), { selectedAccountGuids: y } = J(), { visibleHoldings: u, updateHoldings: l } = U(), [h, x] = T.useState(!1), [_, a] = z({
1128
+ )
1129
+ }
1130
+ );
1131
+ }, gt = () => {
1132
+ const { isMobile: t } = j(), [u, c] = O({}), [m, f] = O(!1), { selectedAccountGuids: v } = J(), { visibleHoldings: d, updateHoldings: l } = U(), [x, h] = T.useState(!1), [b, s] = O({
1148
1133
  accounts: [],
1149
1134
  holdings: []
1150
- }), { accounts: r, investments: t } = G(), { isCopyLoaded: d } = J(), [D, w] = z(null), [L, I] = z(""), B = X().palette.mode === "dark", F = B ? "#0AC295" : "#09A57F", N = B ? "grey.300" : "grey.700", S = (s, b = "lesserThan") => b === "greaterThan" ? s >= 0 ? F : N : s <= 0 ? N : F, E = (s, b) => {
1151
- w(s), I(b.toFixed(2));
1152
- }, de = (s) => {
1153
- const b = s.target.value;
1154
- /^\d*\.?\d*$/.test(b) && I(b);
1155
- }, me = (s, b) => {
1156
- s.key === "Enter" ? Z(b) : s.key === "Escape" && w(null);
1157
- }, Z = (s) => {
1158
- const b = u.find(({ guid: W }) => W === s);
1159
- if (!b) return;
1160
- const j = Number(L);
1161
- if (l({
1162
- ...b,
1163
- cost_basis: j
1164
- }), n) {
1165
- const W = _.holdings.map((C) => C.id === s ? {
1166
- ...C,
1167
- costBasis: j
1168
- } : C);
1169
- a((C) => ({
1170
- ...C,
1171
- holdings: W
1135
+ }), { accounts: y, investments: r } = N(), { isCopyLoaded: n } = J(), [g, C] = O(null), [D, k] = O(""), A = Z().palette.mode === "dark", G = A ? "#0AC295" : "#09A57F", F = A ? "grey.300" : "grey.700", L = (a, w = "lesserThan") => w === "greaterThan" ? a >= 0 ? G : F : a <= 0 ? F : G, H = (a, w) => {
1136
+ C(a), k(w.toFixed(2));
1137
+ }, ee = (a) => {
1138
+ const w = a.target.value;
1139
+ /^\d*\.?\d*$/.test(w) && k(w);
1140
+ }, ue = (a, w) => {
1141
+ a.key === "Enter" ? te(w) : a.key === "Escape" && C(null);
1142
+ }, te = (a) => {
1143
+ const w = d.find(({ guid: E }) => E === a);
1144
+ if (!w) return;
1145
+ const M = Number(D);
1146
+ if (l({ ...w, cost_basis: M }), t) {
1147
+ const E = b.holdings.map(
1148
+ (S) => S.id === a ? { ...S, costBasis: M } : S
1149
+ );
1150
+ s((S) => ({
1151
+ ...S,
1152
+ holdings: E
1172
1153
  }));
1173
1154
  }
1174
- w(null);
1175
- }, De = (s) => (b, j) => {
1176
- c((W) => ({
1177
- ...W,
1178
- [s]: j
1155
+ C(null);
1156
+ }, Se = (a) => (w, M) => {
1157
+ c((E) => ({
1158
+ ...E,
1159
+ [a]: M
1179
1160
  }));
1180
- }, { visibleHoldings: ue } = U(), { visibleInvestmentAccounts: Se } = ae(), $ = Se.filter(({ guid: s }) => y.includes(s)), Le = $.reduce((s, b) => s + (b.balance || 0), 0), Ie = $.map(({ guid: s }) => s), P = ue.filter(({ account_guid: s }) => Ie.includes(s)).reduce((s, b) => s + (b.market_value ? b.market_value - (b.cost_basis || 0) : 0), 0), Ae = () => {
1181
- v(!1);
1161
+ }, { visibleHoldings: he } = U(), { visibleInvestmentAccounts: Le } = ce(), P = Le.filter(
1162
+ ({ guid: a }) => v.includes(a)
1163
+ ), Ie = P.reduce((a, w) => a + (w.balance || 0), 0), Ae = P.map(({ guid: a }) => a), q = he.filter(
1164
+ ({ account_guid: a }) => Ae.includes(a)
1165
+ ).reduce((a, w) => {
1166
+ const M = w.market_value ? w.market_value - (w.cost_basis || 0) : 0;
1167
+ return a + M;
1168
+ }, 0), Te = () => {
1169
+ f(!1);
1182
1170
  };
1183
- return d ? /* @__PURE__ */ i(p, {
1184
- sx: {
1185
- alignItems: "center",
1186
- gap: 48,
1187
- pt: 48,
1188
- width: "100%"
1189
- },
1190
- children: [
1191
- !!$.length && /* @__PURE__ */ i(p, {
1192
- sx: { alignItems: "center" },
1193
- children: [
1194
- /* @__PURE__ */ e(o, {
1195
- sx: { color: "text.secondary" },
1196
- children: t.overview.total_portfolio
1197
- }),
1198
- /* @__PURE__ */ e(Q, {
1199
- variant: "h1",
1200
- children: Le.toLocaleString("en-US", {
1171
+ return n ? /* @__PURE__ */ i(p, { sx: { alignItems: "center", gap: 48, pt: 48, width: "100%" }, children: [
1172
+ !!P.length && /* @__PURE__ */ i(p, { sx: { alignItems: "center" }, children: [
1173
+ /* @__PURE__ */ e(o, { sx: { color: "text.secondary" }, children: r.overview.total_portfolio }),
1174
+ /* @__PURE__ */ e(X, { variant: "h1", children: Ie.toLocaleString("en-US", {
1175
+ currency: "USD",
1176
+ maximumFractionDigits: 2,
1177
+ minimumFractionDigits: 2,
1178
+ style: "currency"
1179
+ }) }),
1180
+ /* @__PURE__ */ i(p, { sx: { alignItems: "center", flexDirection: "row", gap: 8 }, children: [
1181
+ /* @__PURE__ */ e(
1182
+ B,
1183
+ {
1184
+ name: q >= 0 ? "trending_up" : "trending_down",
1185
+ size: 20,
1186
+ sx: { color: L(q, "greaterThan") }
1187
+ }
1188
+ ),
1189
+ /* @__PURE__ */ e(
1190
+ o,
1191
+ {
1192
+ sx: { color: L(q, "greaterThan"), fontWeight: 700 },
1193
+ variant: "body2",
1194
+ children: q.toLocaleString("en-US", {
1201
1195
  currency: "USD",
1202
1196
  maximumFractionDigits: 2,
1203
1197
  minimumFractionDigits: 2,
1204
1198
  style: "currency"
1205
1199
  })
1206
- }),
1207
- /* @__PURE__ */ i(p, {
1208
- sx: {
1209
- alignItems: "center",
1210
- flexDirection: "row",
1211
- gap: 8
1212
- },
1213
- children: [/* @__PURE__ */ e(k, {
1214
- name: P >= 0 ? "trending_up" : "trending_down",
1215
- size: 20,
1216
- sx: { color: S(P, "greaterThan") }
1217
- }), /* @__PURE__ */ e(o, {
1218
- sx: {
1219
- color: S(P, "greaterThan"),
1220
- fontWeight: 700
1221
- },
1222
- variant: "body2",
1223
- children: P.toLocaleString("en-US", {
1224
- currency: "USD",
1225
- maximumFractionDigits: 2,
1226
- minimumFractionDigits: 2,
1227
- style: "currency"
1228
- })
1229
- })]
1230
- })
1231
- ]
1232
- }),
1233
- $.map((s) => {
1234
- const b = ue.filter((A) => A.account_guid === s.guid).map((A) => ({
1235
- id: A.guid,
1236
- qty: A.shares || 0,
1237
- holding: A.symbol || A.description || "Unknown",
1238
- costBasis: A.cost_basis || 0,
1239
- totalGainLoss: A.market_value ? A.market_value - (A.cost_basis || 0) : 0,
1240
- marketValue: A.market_value || 0,
1241
- description: A.description || ""
1242
- })), j = b.length > 0, W = s.balance, C = b.reduce((A, Be) => Be.totalGainLoss + A, 0), he = W ? C / W * 100 : 0;
1243
- if (n) return /* @__PURE__ */ e(ne, {
1244
- onClick: b.length ? () => {
1245
- v(!0), a({
1246
- holdings: b,
1247
- accounts: s
1248
- });
1249
- } : void 0,
1250
- sx: {
1251
- width: "100%",
1252
- overflow: "hidden"
1253
- },
1254
- children: /* @__PURE__ */ i(p, {
1200
+ }
1201
+ )
1202
+ ] })
1203
+ ] }),
1204
+ P.map((a) => {
1205
+ const w = he.filter((I) => I.account_guid === a.guid).map((I) => ({
1206
+ id: I.guid,
1207
+ qty: I.shares || 0,
1208
+ holding: I.symbol || I.description || "Unknown",
1209
+ costBasis: I.cost_basis || 0,
1210
+ totalGainLoss: I.market_value ? I.market_value - (I.cost_basis || 0) : 0,
1211
+ marketValue: I.market_value || 0,
1212
+ description: I.description || ""
1213
+ })), M = w.length > 0, E = a.balance, S = w.reduce(
1214
+ (I, We) => We.totalGainLoss + I,
1215
+ 0
1216
+ ), ge = E ? S / E * 100 : 0;
1217
+ if (t)
1218
+ return /* @__PURE__ */ e(
1219
+ se,
1220
+ {
1221
+ onClick: w.length ? () => {
1222
+ f(!0), s({
1223
+ holdings: w,
1224
+ accounts: a
1225
+ });
1226
+ } : void 0,
1255
1227
  sx: {
1256
- border: 1,
1257
- borderColor: "divider",
1258
- borderRadius: "8px",
1259
- ml: 16,
1260
- mr: 16,
1261
- overflow: "hidden",
1262
- pt: 14
1228
+ width: "100%",
1229
+ overflow: "hidden"
1263
1230
  },
1264
- children: [/* @__PURE__ */ i(p, {
1265
- sx: {
1266
- alignItems: "center",
1267
- borderBottom: 1,
1268
- borderColor: "divider",
1269
- flexDirection: "row",
1270
- pb: 14,
1271
- pl: 14,
1272
- pr: 14
1273
- },
1274
- children: [/* @__PURE__ */ e(te, {
1275
- alt: s.institutionName || "",
1276
- institutionGuid: s.institution_guid || "",
1277
- size: 32
1278
- }), /* @__PURE__ */ i(p, {
1279
- sx: {
1280
- overflow: "hidden",
1281
- pl: 13,
1282
- pr: 13
1283
- },
1284
- children: [/* @__PURE__ */ e(o, {
1285
- sx: { color: "text.secondary" },
1286
- variant: "caption",
1287
- children: s.memberName
1288
- }), /* @__PURE__ */ e(o, {
1289
- sx: {
1290
- color: "text.primary",
1291
- fontWeight: 600
1292
- },
1293
- variant: "body1",
1294
- children: s.user_name || s.name
1295
- })]
1296
- })]
1297
- }), /* @__PURE__ */ i(p, {
1298
- sx: {
1299
- alignItems: "center",
1300
- flexDirection: "row",
1301
- justifyContent: "space-between",
1302
- pb: 8,
1303
- pt: 8
1304
- },
1305
- children: [/* @__PURE__ */ i(p, {
1231
+ children: /* @__PURE__ */ i(
1232
+ p,
1233
+ {
1306
1234
  sx: {
1307
- alignItems: "center",
1308
- borderRight: 1,
1235
+ border: 1,
1309
1236
  borderColor: "divider",
1310
- flex: 1,
1311
- justifyContent: "center",
1312
- pb: 14,
1313
- pl: 7,
1314
- pr: 7,
1237
+ borderRadius: "8px",
1238
+ ml: 16,
1239
+ mr: 16,
1240
+ overflow: "hidden",
1315
1241
  pt: 14
1316
1242
  },
1317
- children: [/* @__PURE__ */ e(o, {
1318
- sx: {
1319
- color: "text.secondary",
1320
- fontSize: 11
1321
- },
1322
- variant: "body2",
1323
- children: t.overview.total_gain_Loss
1324
- }), /* @__PURE__ */ i(p, {
1325
- sx: {
1326
- alignItems: "center",
1327
- flexDirection: "row",
1328
- gap: 2,
1329
- justifyContent: "flex-end"
1330
- },
1331
- children: [
1332
- C !== 0 && /* @__PURE__ */ e(k, {
1333
- name: C > 0 ? "trending_up" : "trending_down",
1334
- size: 20,
1335
- sx: { color: S(C) }
1336
- }),
1337
- /* @__PURE__ */ i(o, {
1243
+ children: [
1244
+ /* @__PURE__ */ i(
1245
+ p,
1246
+ {
1338
1247
  sx: {
1339
- color: S(C),
1340
- fontWeight: 600
1248
+ alignItems: "center",
1249
+ borderBottom: 1,
1250
+ borderColor: "divider",
1251
+ flexDirection: "row",
1252
+ pb: 14,
1253
+ pl: 14,
1254
+ pr: 14
1341
1255
  },
1342
- variant: "body1",
1343
- children: [he.toFixed(2), "%"]
1344
- }),
1345
- /* @__PURE__ */ e(o, {
1346
- sx: { color: "text.secondary" },
1347
- variant: "caption",
1348
- children: "|"
1349
- }),
1350
- /* @__PURE__ */ e(o, {
1256
+ children: [
1257
+ /* @__PURE__ */ e(
1258
+ oe,
1259
+ {
1260
+ alt: a.institutionName || "",
1261
+ institutionGuid: a.institution_guid || "",
1262
+ size: 32
1263
+ }
1264
+ ),
1265
+ /* @__PURE__ */ i(p, { sx: { overflow: "hidden", pl: 13, pr: 13 }, children: [
1266
+ /* @__PURE__ */ e(o, { sx: { color: "text.secondary" }, variant: "caption", children: a.memberName }),
1267
+ /* @__PURE__ */ e(o, { sx: { color: "text.primary", fontWeight: 600 }, variant: "body1", children: a.user_name || a.name })
1268
+ ] })
1269
+ ]
1270
+ }
1271
+ ),
1272
+ /* @__PURE__ */ i(
1273
+ p,
1274
+ {
1351
1275
  sx: {
1352
- color: S(C),
1353
- fontWeight: 600
1276
+ alignItems: "center",
1277
+ flexDirection: "row",
1278
+ justifyContent: "space-between",
1279
+ pb: 8,
1280
+ pt: 8
1354
1281
  },
1355
- variant: "body1",
1356
- children: Math.abs(C).toLocaleString("en-US", {
1357
- currency: "USD",
1358
- maximumFractionDigits: 2,
1359
- minimumFractionDigits: 2,
1360
- style: "currency"
1361
- })
1362
- })
1363
- ]
1364
- })]
1365
- }), /* @__PURE__ */ i(p, {
1366
- sx: {
1367
- alignItems: "center",
1368
- flex: 1,
1369
- justifyContent: "center",
1370
- pb: 14,
1371
- pl: 7,
1372
- pr: 7,
1373
- pt: 14
1374
- },
1375
- children: [/* @__PURE__ */ e(o, {
1376
- sx: { color: "text.secondary" },
1377
- variant: "caption",
1378
- children: t.overview.total_value
1379
- }), /* @__PURE__ */ e(o, {
1380
- sx: {
1381
- color: "text.primary",
1382
- fontWeight: 600
1383
- },
1384
- variant: "body1",
1385
- children: W?.toLocaleString("en-US", {
1386
- currency: "USD",
1387
- maximumFractionDigits: 2,
1388
- minimumFractionDigits: 2,
1389
- style: "currency"
1390
- })
1391
- })]
1392
- })]
1393
- })]
1394
- })
1395
- }, s.guid);
1396
- const Te = B ? "grey.700" : "grey.400", ke = b.length ? "text.primary" : Te;
1397
- return /* @__PURE__ */ i(_e, {
1398
- expanded: g[s.guid] === !0,
1399
- onChange: j ? De(s.guid) : () => {
1282
+ children: [
1283
+ /* @__PURE__ */ i(
1284
+ p,
1285
+ {
1286
+ sx: {
1287
+ alignItems: "center",
1288
+ borderRight: 1,
1289
+ borderColor: "divider",
1290
+ flex: 1,
1291
+ justifyContent: "center",
1292
+ pb: 14,
1293
+ pl: 7,
1294
+ pr: 7,
1295
+ pt: 14
1296
+ },
1297
+ children: [
1298
+ /* @__PURE__ */ e(o, { sx: { color: "text.secondary", fontSize: 11 }, variant: "body2", children: r.overview.total_gain_Loss }),
1299
+ /* @__PURE__ */ i(
1300
+ p,
1301
+ {
1302
+ sx: {
1303
+ alignItems: "center",
1304
+ flexDirection: "row",
1305
+ gap: 2,
1306
+ justifyContent: "flex-end"
1307
+ },
1308
+ children: [
1309
+ S !== 0 && /* @__PURE__ */ e(
1310
+ B,
1311
+ {
1312
+ name: S > 0 ? "trending_up" : "trending_down",
1313
+ size: 20,
1314
+ sx: { color: L(S) }
1315
+ }
1316
+ ),
1317
+ /* @__PURE__ */ i(
1318
+ o,
1319
+ {
1320
+ sx: {
1321
+ color: L(S),
1322
+ fontWeight: 600
1323
+ },
1324
+ variant: "body1",
1325
+ children: [
1326
+ ge.toFixed(2),
1327
+ "%"
1328
+ ]
1329
+ }
1330
+ ),
1331
+ /* @__PURE__ */ e(o, { sx: { color: "text.secondary" }, variant: "caption", children: "|" }),
1332
+ /* @__PURE__ */ e(
1333
+ o,
1334
+ {
1335
+ sx: {
1336
+ color: L(S),
1337
+ fontWeight: 600
1338
+ },
1339
+ variant: "body1",
1340
+ children: Math.abs(S).toLocaleString("en-US", {
1341
+ currency: "USD",
1342
+ maximumFractionDigits: 2,
1343
+ minimumFractionDigits: 2,
1344
+ style: "currency"
1345
+ })
1346
+ }
1347
+ )
1348
+ ]
1349
+ }
1350
+ )
1351
+ ]
1352
+ }
1353
+ ),
1354
+ /* @__PURE__ */ i(
1355
+ p,
1356
+ {
1357
+ sx: {
1358
+ alignItems: "center",
1359
+ flex: 1,
1360
+ justifyContent: "center",
1361
+ pb: 14,
1362
+ pl: 7,
1363
+ pr: 7,
1364
+ pt: 14
1365
+ },
1366
+ children: [
1367
+ /* @__PURE__ */ e(o, { sx: { color: "text.secondary" }, variant: "caption", children: r.overview.total_value }),
1368
+ /* @__PURE__ */ e(o, { sx: { color: "text.primary", fontWeight: 600 }, variant: "body1", children: E?.toLocaleString("en-US", {
1369
+ currency: "USD",
1370
+ maximumFractionDigits: 2,
1371
+ minimumFractionDigits: 2,
1372
+ style: "currency"
1373
+ }) })
1374
+ ]
1375
+ }
1376
+ )
1377
+ ]
1378
+ }
1379
+ )
1380
+ ]
1381
+ }
1382
+ )
1383
+ },
1384
+ a.guid
1385
+ );
1386
+ const ke = A ? "grey.700" : "grey.400", Be = w.length ? "text.primary" : ke;
1387
+ return /* @__PURE__ */ i(
1388
+ be,
1389
+ {
1390
+ expanded: u[a.guid] === !0,
1391
+ onChange: M ? Se(a.guid) : () => {
1400
1392
  },
1401
1393
  sx: {
1402
1394
  border: 1,
@@ -1404,255 +1396,253 @@ var ce = ({ sx: n = {} }) => {
1404
1396
  borderRadius: "4px",
1405
1397
  width: "100%"
1406
1398
  },
1407
- children: [/* @__PURE__ */ i(Ce, {
1408
- "aria-controls": "panel1a-content",
1409
- id: "panel1a-header",
1410
- sx: [g[s.guid] && {
1411
- borderBottom: 1,
1412
- borderColor: "divider",
1413
- maxHeight: 88
1414
- }],
1415
- children: [/* @__PURE__ */ i(p, {
1416
- sx: {
1417
- alignItems: "center",
1418
- flexDirection: "row",
1419
- gap: 13,
1420
- p: 14,
1421
- width: "100%"
1422
- },
1423
- children: [
1424
- /* @__PURE__ */ e(k, {
1425
- name: "expand_more",
1426
- size: 20,
1427
- sx: { color: ke }
1428
- }),
1429
- /* @__PURE__ */ e(te, {
1430
- alt: s.institutionName || "",
1431
- institutionGuid: s.institution_guid || "",
1432
- size: 32
1433
- }),
1434
- /* @__PURE__ */ i(p, {
1435
- sx: { alignItems: "flex-start" },
1436
- children: [/* @__PURE__ */ e(o, {
1437
- sx: { color: "text.secondary" },
1438
- variant: "caption",
1439
- children: s.memberName
1440
- }), /* @__PURE__ */ e(o, {
1441
- sx: {
1442
- color: "text.primary",
1443
- fontWeight: 600
1444
- },
1445
- variant: "body1",
1446
- children: s.user_name || s.name
1447
- })]
1448
- })
1449
- ]
1450
- }), /* @__PURE__ */ i(p, {
1451
- sx: { flexDirection: "row" },
1452
- children: [/* @__PURE__ */ i(p, {
1453
- sx: {
1454
- alignItems: "flex-end",
1455
- pb: 14,
1456
- pl: 24,
1457
- pr: 24,
1458
- pt: 14
1459
- },
1460
- children: [/* @__PURE__ */ e(o, {
1461
- sx: { color: "text.secondary" },
1462
- variant: "caption",
1463
- children: t.overview.total_gain_Loss
1464
- }), /* @__PURE__ */ i(p, {
1465
- sx: {
1466
- alignItems: "center",
1467
- flexDirection: "row",
1468
- gap: 2,
1469
- justifyContent: "flex-end"
1470
- },
1471
- children: [
1472
- C !== 0 && /* @__PURE__ */ e(k, {
1473
- name: C >= 0 ? "trending_up" : "trending_down",
1474
- size: 20,
1475
- sx: { color: S(C) }
1476
- }),
1477
- /* @__PURE__ */ i(o, {
1478
- sx: {
1479
- color: S(C),
1480
- fontWeight: 600
1481
- },
1482
- variant: "body1",
1483
- children: [he.toFixed(2), "%"]
1484
- }),
1485
- /* @__PURE__ */ e(o, {
1486
- sx: { color: "text.secondary" },
1487
- variant: "caption",
1488
- children: "|"
1489
- }),
1490
- /* @__PURE__ */ e(o, {
1399
+ children: [
1400
+ /* @__PURE__ */ i(
1401
+ we,
1402
+ {
1403
+ "aria-controls": "panel1a-content",
1404
+ id: "panel1a-header",
1405
+ sx: [
1406
+ u[a.guid] && {
1407
+ borderBottom: 1,
1408
+ borderColor: "divider",
1409
+ maxHeight: 88
1410
+ }
1411
+ ],
1412
+ children: [
1413
+ /* @__PURE__ */ i(
1414
+ p,
1415
+ {
1491
1416
  sx: {
1492
- color: S(C),
1493
- fontWeight: 600
1417
+ alignItems: "center",
1418
+ flexDirection: "row",
1419
+ gap: 13,
1420
+ p: 14,
1421
+ width: "100%"
1494
1422
  },
1495
- variant: "body1",
1496
- children: Math.abs(C).toLocaleString("en-US", {
1423
+ children: [
1424
+ /* @__PURE__ */ e(B, { name: "expand_more", size: 20, sx: { color: Be } }),
1425
+ /* @__PURE__ */ e(
1426
+ oe,
1427
+ {
1428
+ alt: a.institutionName || "",
1429
+ institutionGuid: a.institution_guid || "",
1430
+ size: 32
1431
+ }
1432
+ ),
1433
+ /* @__PURE__ */ i(p, { sx: { alignItems: "flex-start" }, children: [
1434
+ /* @__PURE__ */ e(o, { sx: { color: "text.secondary" }, variant: "caption", children: a.memberName }),
1435
+ /* @__PURE__ */ e(o, { sx: { color: "text.primary", fontWeight: 600 }, variant: "body1", children: a.user_name || a.name })
1436
+ ] })
1437
+ ]
1438
+ }
1439
+ ),
1440
+ /* @__PURE__ */ i(p, { sx: { flexDirection: "row" }, children: [
1441
+ /* @__PURE__ */ i(p, { sx: { alignItems: "flex-end", pb: 14, pl: 24, pr: 24, pt: 14 }, children: [
1442
+ /* @__PURE__ */ e(o, { sx: { color: "text.secondary" }, variant: "caption", children: r.overview.total_gain_Loss }),
1443
+ /* @__PURE__ */ i(
1444
+ p,
1445
+ {
1446
+ sx: {
1447
+ alignItems: "center",
1448
+ flexDirection: "row",
1449
+ gap: 2,
1450
+ justifyContent: "flex-end"
1451
+ },
1452
+ children: [
1453
+ S !== 0 && /* @__PURE__ */ e(
1454
+ B,
1455
+ {
1456
+ name: S >= 0 ? "trending_up" : "trending_down",
1457
+ size: 20,
1458
+ sx: { color: L(S) }
1459
+ }
1460
+ ),
1461
+ /* @__PURE__ */ i(
1462
+ o,
1463
+ {
1464
+ sx: {
1465
+ color: L(S),
1466
+ fontWeight: 600
1467
+ },
1468
+ variant: "body1",
1469
+ children: [
1470
+ ge.toFixed(2),
1471
+ "%"
1472
+ ]
1473
+ }
1474
+ ),
1475
+ /* @__PURE__ */ e(o, { sx: { color: "text.secondary" }, variant: "caption", children: "|" }),
1476
+ /* @__PURE__ */ e(
1477
+ o,
1478
+ {
1479
+ sx: {
1480
+ color: L(S),
1481
+ fontWeight: 600
1482
+ },
1483
+ variant: "body1",
1484
+ children: Math.abs(S).toLocaleString("en-US", {
1485
+ currency: "USD",
1486
+ maximumFractionDigits: 2,
1487
+ minimumFractionDigits: 2,
1488
+ style: "currency"
1489
+ })
1490
+ }
1491
+ )
1492
+ ]
1493
+ }
1494
+ )
1495
+ ] }),
1496
+ /* @__PURE__ */ e(p, { sx: { alignItems: "flex-end", gap: 12, pb: 14, pl: 16, pr: 16, pt: 14 }, children: /* @__PURE__ */ i(p, { sx: { alignItems: "flex-end" }, children: [
1497
+ /* @__PURE__ */ e(o, { sx: { color: "text.secondary" }, variant: "caption", children: r.overview.total_value }),
1498
+ /* @__PURE__ */ e(o, { sx: { color: "text.primary", fontWeight: 600 }, variant: "body1", children: E?.toLocaleString("en-US", {
1497
1499
  currency: "USD",
1498
1500
  maximumFractionDigits: 2,
1499
1501
  minimumFractionDigits: 2,
1500
1502
  style: "currency"
1501
- })
1502
- })
1503
- ]
1504
- })]
1505
- }), /* @__PURE__ */ e(p, {
1506
- sx: {
1507
- alignItems: "flex-end",
1508
- gap: 12,
1509
- pb: 14,
1510
- pl: 16,
1511
- pr: 16,
1512
- pt: 14
1513
- },
1514
- children: /* @__PURE__ */ i(p, {
1515
- sx: { alignItems: "flex-end" },
1516
- children: [/* @__PURE__ */ e(o, {
1517
- sx: { color: "text.secondary" },
1518
- variant: "caption",
1519
- children: t.overview.total_value
1520
- }), /* @__PURE__ */ e(o, {
1521
- sx: {
1522
- color: "text.primary",
1523
- fontWeight: 600
1524
- },
1525
- variant: "body1",
1526
- children: W?.toLocaleString("en-US", {
1527
- currency: "USD",
1528
- maximumFractionDigits: 2,
1529
- minimumFractionDigits: 2,
1530
- style: "currency"
1531
- })
1532
- })]
1533
- })
1534
- })]
1535
- })]
1536
- }), /* @__PURE__ */ e(we, {
1537
- sx: {
1538
- bgcolor: "background.default",
1539
- p: 12
1540
- },
1541
- children: /* @__PURE__ */ e(ne, {
1542
- sx: {
1543
- border: 1,
1544
- borderColor: "neutral.light"
1545
- },
1546
- children: /* @__PURE__ */ e(ut, {
1547
- currentEditedCostBasis: L,
1548
- data: b,
1549
- editingHoldingId: D,
1550
- handleCostBasisBlur: Z,
1551
- handleCostBasisChange: de,
1552
- handleCostBasisClick: E,
1553
- handleCostBasisKeyDown: me
1554
- })
1555
- })
1556
- })]
1557
- }, s.guid);
1558
- }),
1559
- /* @__PURE__ */ e(ce, {}),
1560
- /* @__PURE__ */ e(mt, {
1561
- accountHoldingsData: _,
1562
- currentEditedCostBasis: L,
1563
- editingHoldingId: D,
1564
- handleCostBasisBlur: Z,
1565
- handleCostBasisChange: de,
1566
- handleCostBasisClick: E,
1567
- handleCostBasisKeyDown: me,
1503
+ }) })
1504
+ ] }) })
1505
+ ] })
1506
+ ]
1507
+ }
1508
+ ),
1509
+ /* @__PURE__ */ e(_e, { sx: { bgcolor: "background.default", p: 12 }, children: /* @__PURE__ */ e(se, { sx: { border: 1, borderColor: "neutral.light" }, children: /* @__PURE__ */ e(
1510
+ ht,
1511
+ {
1512
+ currentEditedCostBasis: D,
1513
+ data: w,
1514
+ editingHoldingId: g,
1515
+ handleCostBasisBlur: te,
1516
+ handleCostBasisChange: ee,
1517
+ handleCostBasisClick: H,
1518
+ handleCostBasisKeyDown: ue
1519
+ }
1520
+ ) }) })
1521
+ ]
1522
+ },
1523
+ a.guid
1524
+ );
1525
+ }),
1526
+ /* @__PURE__ */ e(me, {}),
1527
+ /* @__PURE__ */ e(
1528
+ ut,
1529
+ {
1530
+ accountHoldingsData: b,
1531
+ currentEditedCostBasis: D,
1532
+ editingHoldingId: g,
1533
+ handleCostBasisBlur: te,
1534
+ handleCostBasisChange: ee,
1535
+ handleCostBasisClick: H,
1536
+ handleCostBasisKeyDown: ue,
1568
1537
  isOpen: m,
1569
- onClose: Ae
1570
- }),
1571
- /* @__PURE__ */ e(ge, {
1572
- onClose: () => x(!1),
1573
- showConnectionsWidget: h,
1574
- title: r.manage_connections
1575
- })
1576
- ]
1577
- }) : /* @__PURE__ */ e(xe, {});
1578
- }, gt = R(ht), pt = ({ title: n }) => /* @__PURE__ */ e(o, {
1579
- bold: !0,
1580
- variant: "body1",
1581
- children: n
1582
- }), Jt = R(({ onBackClick: n, onMenuClick: g, sx: c }) => {
1583
- const { onEvent: m } = pe(), { isMobile: v } = M(), { isAccountDataLoaded: y, loadAccountData: u, visibleInvestmentAccounts: l } = ae(), { visibleHoldings: h, setShowConnectionsWidget: x, showConnectionsWidget: _ } = U(), { investments: a, accounts: r } = G(), { isInitialized: t } = J(), [d, D] = T.useState(0), { loadHoldings: w, holdingsLoaded: L } = U();
1584
- je({
1538
+ onClose: Te
1539
+ }
1540
+ ),
1541
+ /* @__PURE__ */ e(
1542
+ pe,
1543
+ {
1544
+ onClose: () => h(!1),
1545
+ showConnectionsWidget: x,
1546
+ title: y.manage_connections
1547
+ }
1548
+ )
1549
+ ] }) : /* @__PURE__ */ e(De, {});
1550
+ }, pt = $(gt), xt = ({ title: t }) => /* @__PURE__ */ e(o, { bold: !0, variant: "body1", children: t }), ln = $(({ onBackClick: t, onMenuClick: u, sx: c }) => {
1551
+ const { onEvent: m } = ve(), { isMobile: f } = j(), {
1552
+ isAccountDataLoaded: v,
1553
+ loadAccountData: d,
1554
+ visibleInvestmentAccounts: l
1555
+ } = ce(), {
1556
+ visibleHoldings: x,
1557
+ setShowConnectionsWidget: h,
1558
+ showConnectionsWidget: b
1559
+ } = U(), { investments: s, accounts: y } = N(), { isInitialized: r } = J(), [n, g] = T.useState(0), { loadHoldings: C, holdingsLoaded: D } = U();
1560
+ qe({
1585
1561
  widgetName: "InvestmentsWidget",
1586
- isLoaded: L
1562
+ isLoaded: D
1587
1563
  }), T.useEffect(() => {
1588
- y || u().finally();
1564
+ v || d().finally();
1589
1565
  }, []), T.useEffect(() => {
1590
- t && w().finally();
1591
- }, [t]);
1592
- const I = () => {
1593
- m(H.INVESTMENT_WIDGET_ACCOUNT_FILTER_CLICK);
1566
+ r && C().finally();
1567
+ }, [r]);
1568
+ const k = () => {
1569
+ m(z.INVESTMENT_WIDGET_ACCOUNT_FILTER_CLICK);
1594
1570
  };
1595
- if (!t || !L) return /* @__PURE__ */ e(xe, {});
1596
- const B = [
1597
- H.INVESTMENT_WIDGET_DETAILS_CLICK,
1598
- H.INVESTMENT_WIDGET_ALLOCATION_CLICK,
1599
- H.INVESTMENT_WIDGET_ANALYSIS_CLICK
1600
- ], F = l.length === 0 && h.length === 0, N = [
1601
- a.tab_overview_title,
1602
- a.tab_allocation_title,
1603
- a.tab_analysis_title
1571
+ if (!r || !D) return /* @__PURE__ */ e(De, {});
1572
+ const W = [
1573
+ z.INVESTMENT_WIDGET_DETAILS_CLICK,
1574
+ z.INVESTMENT_WIDGET_ALLOCATION_CLICK,
1575
+ z.INVESTMENT_WIDGET_ANALYSIS_CLICK
1576
+ ], A = l.length === 0 && x.length === 0, G = [
1577
+ s.tab_overview_title,
1578
+ s.tab_allocation_title,
1579
+ s.tab_analysis_title
1604
1580
  ];
1605
- return /* @__PURE__ */ i(Ge, {
1606
- allowedAccountTypes: [We.INVESTMENT],
1607
- onAccountsFilterClick: I,
1608
- onBackClick: n,
1609
- onMenuClick: g,
1610
- sx: c,
1611
- title: a.title,
1612
- children: [/* @__PURE__ */ i(f, {
1613
- mx: v ? 0 : 48,
1614
- my: 24,
1615
- children: [/* @__PURE__ */ e(Ve, {
1616
- onChange: (S, E) => {
1617
- D(E), m(B[E]);
1618
- },
1619
- sx: { bgcolor: "background.paper" },
1620
- textColor: "primary",
1621
- value: F ? -1 : d,
1622
- variant: "fullWidth",
1623
- children: N.map((S) => /* @__PURE__ */ e(Oe, {
1624
- disabled: F,
1625
- label: /* @__PURE__ */ e(pt, { title: S })
1626
- }, S))
1627
- }), F ? /* @__PURE__ */ e(Ee, {
1628
- header: a.empty_state_header,
1629
- icon: "bid_landscape",
1630
- onClick: () => {
1631
- x(!0), m(H.ACCOUNTS_CLICK_CONNECT);
1632
- },
1633
- primaryButton: a.overview.connect_accounts,
1634
- subText: a.empty_state_description,
1635
- sx: {
1636
- width: { sm: 432 },
1637
- ".buttons-footer": { width: 167 },
1638
- ".MuiTypography-h2": {
1639
- mt: 20,
1640
- mb: 4
1641
- },
1642
- px: 16
1643
- }
1644
- }) : /* @__PURE__ */ i(se, { children: [
1645
- d === 0 && /* @__PURE__ */ e(gt, {}),
1646
- d === 1 && /* @__PURE__ */ e(ot, {}),
1647
- d === 2 && /* @__PURE__ */ e(ct, {})
1648
- ] })]
1649
- }), /* @__PURE__ */ e(ge, {
1650
- onClose: () => x(!1),
1651
- showConnectionsWidget: _,
1652
- title: r.manage_connections
1653
- })]
1654
- });
1581
+ return /* @__PURE__ */ i(
1582
+ Ke,
1583
+ {
1584
+ allowedAccountTypes: [Ye.INVESTMENT],
1585
+ onAccountsFilterClick: k,
1586
+ onBackClick: t,
1587
+ onMenuClick: u,
1588
+ sx: c,
1589
+ title: s.title,
1590
+ children: [
1591
+ /* @__PURE__ */ i(_, { mx: f ? 0 : 48, my: 24, children: [
1592
+ /* @__PURE__ */ e(
1593
+ Ee,
1594
+ {
1595
+ onChange: (F, L) => {
1596
+ g(L), m(W[L]);
1597
+ },
1598
+ sx: { bgcolor: "background.paper" },
1599
+ textColor: "primary",
1600
+ value: A ? -1 : n,
1601
+ variant: "fullWidth",
1602
+ children: G.map((F) => /* @__PURE__ */ e(Fe, { disabled: A, label: /* @__PURE__ */ e(xt, { title: F }) }, F))
1603
+ }
1604
+ ),
1605
+ A ? /* @__PURE__ */ e(
1606
+ Qe,
1607
+ {
1608
+ header: s.empty_state_header,
1609
+ icon: "bid_landscape",
1610
+ onClick: () => {
1611
+ h(!0), m(z.ACCOUNTS_CLICK_CONNECT);
1612
+ },
1613
+ primaryButton: s.overview.connect_accounts,
1614
+ subText: s.empty_state_description,
1615
+ sx: {
1616
+ width: { sm: 432 },
1617
+ ".buttons-footer": {
1618
+ width: 167
1619
+ },
1620
+ ".MuiTypography-h2": {
1621
+ mt: 20,
1622
+ mb: 4
1623
+ },
1624
+ px: 16
1625
+ }
1626
+ }
1627
+ ) : /* @__PURE__ */ i(le, { children: [
1628
+ n === 0 && /* @__PURE__ */ e(pt, {}),
1629
+ n === 1 && /* @__PURE__ */ e(rt, {}),
1630
+ n === 2 && /* @__PURE__ */ e(dt, {})
1631
+ ] })
1632
+ ] }),
1633
+ /* @__PURE__ */ e(
1634
+ pe,
1635
+ {
1636
+ onClose: () => h(!1),
1637
+ showConnectionsWidget: b,
1638
+ title: y.manage_connections
1639
+ }
1640
+ )
1641
+ ]
1642
+ }
1643
+ );
1655
1644
  });
1656
1645
  export {
1657
- Jt as InvestmentsWidget
1646
+ ln as InvestmentsWidget
1658
1647
  };
1648
+ //# sourceMappingURL=index.es.js.map