@burdenoff/microfe-brainyrich 2026.512.1 → 2026.705.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 (109) hide show
  1. package/dist/brainyrich/BrainyRichRoot.js +53 -88
  2. package/dist/brainyrich/BrainyRichRoot.js.map +1 -1
  3. package/dist/brainyrich/BrainyRichRoutes.js +15 -35
  4. package/dist/brainyrich/BrainyRichRoutes.js.map +1 -1
  5. package/dist/brainyrich/hooks/useBrainyRichApi.js +543 -0
  6. package/dist/brainyrich/hooks/useBrainyRichApi.js.map +1 -0
  7. package/dist/brainyrich/index.js +0 -1
  8. package/dist/brainyrich/pages/AccountsPage.js +690 -160
  9. package/dist/brainyrich/pages/AccountsPage.js.map +1 -1
  10. package/dist/brainyrich/pages/AiAssistantPage.js +537 -363
  11. package/dist/brainyrich/pages/AiAssistantPage.js.map +1 -1
  12. package/dist/brainyrich/pages/AnalyticsPage.js +587 -268
  13. package/dist/brainyrich/pages/AnalyticsPage.js.map +1 -1
  14. package/dist/brainyrich/pages/DashboardPage.js +350 -232
  15. package/dist/brainyrich/pages/DashboardPage.js.map +1 -1
  16. package/dist/brainyrich/pages/FamilyPage.js +550 -337
  17. package/dist/brainyrich/pages/FamilyPage.js.map +1 -1
  18. package/dist/brainyrich/pages/GoalsPage.js +775 -142
  19. package/dist/brainyrich/pages/GoalsPage.js.map +1 -1
  20. package/dist/brainyrich/pages/InvestmentsPage.js +410 -311
  21. package/dist/brainyrich/pages/InvestmentsPage.js.map +1 -1
  22. package/dist/brainyrich/pages/PortfoliosPage.js +823 -154
  23. package/dist/brainyrich/pages/PortfoliosPage.js.map +1 -1
  24. package/dist/brainyrich/pages/ReportsPage.js +388 -251
  25. package/dist/brainyrich/pages/ReportsPage.js.map +1 -1
  26. package/dist/brainyrich/pages/RiskPage.js +411 -196
  27. package/dist/brainyrich/pages/RiskPage.js.map +1 -1
  28. package/dist/brainyrich/pages/TaxPage.js +622 -221
  29. package/dist/brainyrich/pages/TaxPage.js.map +1 -1
  30. package/dist/brainyrich/pages/_shared.js +222 -41
  31. package/dist/brainyrich/pages/_shared.js.map +1 -1
  32. package/dist/index.js +2 -3
  33. package/package.json +1 -1
  34. package/dist/brainyrich/BrainyRichRoot.d.ts +0 -5
  35. package/dist/brainyrich/BrainyRichRoot.d.ts.map +0 -1
  36. package/dist/brainyrich/BrainyRichRoutes.d.ts +0 -2
  37. package/dist/brainyrich/BrainyRichRoutes.d.ts.map +0 -1
  38. package/dist/brainyrich/index.d.ts +0 -5
  39. package/dist/brainyrich/index.d.ts.map +0 -1
  40. package/dist/brainyrich/pages/AccountsPage.d.ts +0 -2
  41. package/dist/brainyrich/pages/AccountsPage.d.ts.map +0 -1
  42. package/dist/brainyrich/pages/AdvisorsPage.d.ts +0 -2
  43. package/dist/brainyrich/pages/AdvisorsPage.d.ts.map +0 -1
  44. package/dist/brainyrich/pages/AdvisorsPage.js +0 -375
  45. package/dist/brainyrich/pages/AdvisorsPage.js.map +0 -1
  46. package/dist/brainyrich/pages/AiAssistantPage.d.ts +0 -2
  47. package/dist/brainyrich/pages/AiAssistantPage.d.ts.map +0 -1
  48. package/dist/brainyrich/pages/AnalyticsPage.d.ts +0 -2
  49. package/dist/brainyrich/pages/AnalyticsPage.d.ts.map +0 -1
  50. package/dist/brainyrich/pages/AssistantPage.d.ts +0 -2
  51. package/dist/brainyrich/pages/AssistantPage.d.ts.map +0 -1
  52. package/dist/brainyrich/pages/AssistantPage.js +0 -332
  53. package/dist/brainyrich/pages/AssistantPage.js.map +0 -1
  54. package/dist/brainyrich/pages/DashboardPage.d.ts +0 -2
  55. package/dist/brainyrich/pages/DashboardPage.d.ts.map +0 -1
  56. package/dist/brainyrich/pages/EstatePage.d.ts +0 -2
  57. package/dist/brainyrich/pages/EstatePage.d.ts.map +0 -1
  58. package/dist/brainyrich/pages/EstatePage.js +0 -269
  59. package/dist/brainyrich/pages/EstatePage.js.map +0 -1
  60. package/dist/brainyrich/pages/FamilyPage.d.ts +0 -2
  61. package/dist/brainyrich/pages/FamilyPage.d.ts.map +0 -1
  62. package/dist/brainyrich/pages/GoalsPage.d.ts +0 -2
  63. package/dist/brainyrich/pages/GoalsPage.d.ts.map +0 -1
  64. package/dist/brainyrich/pages/InsurancePage.d.ts +0 -2
  65. package/dist/brainyrich/pages/InsurancePage.d.ts.map +0 -1
  66. package/dist/brainyrich/pages/InsurancePage.js +0 -181
  67. package/dist/brainyrich/pages/InsurancePage.js.map +0 -1
  68. package/dist/brainyrich/pages/InvestmentsPage.d.ts +0 -2
  69. package/dist/brainyrich/pages/InvestmentsPage.d.ts.map +0 -1
  70. package/dist/brainyrich/pages/MarketplacePage.d.ts +0 -2
  71. package/dist/brainyrich/pages/MarketplacePage.d.ts.map +0 -1
  72. package/dist/brainyrich/pages/MarketplacePage.js +0 -450
  73. package/dist/brainyrich/pages/MarketplacePage.js.map +0 -1
  74. package/dist/brainyrich/pages/PortfoliosPage.d.ts +0 -2
  75. package/dist/brainyrich/pages/PortfoliosPage.d.ts.map +0 -1
  76. package/dist/brainyrich/pages/ReportsPage.d.ts +0 -2
  77. package/dist/brainyrich/pages/ReportsPage.d.ts.map +0 -1
  78. package/dist/brainyrich/pages/RiskPage.d.ts +0 -2
  79. package/dist/brainyrich/pages/RiskPage.d.ts.map +0 -1
  80. package/dist/brainyrich/pages/TaxPage.d.ts +0 -2
  81. package/dist/brainyrich/pages/TaxPage.d.ts.map +0 -1
  82. package/dist/brainyrich/pages/_shared.d.ts +0 -21
  83. package/dist/brainyrich/pages/_shared.d.ts.map +0 -1
  84. package/dist/brainyrich/providers/BrainyRichProvider.d.ts +0 -6
  85. package/dist/brainyrich/providers/BrainyRichProvider.d.ts.map +0 -1
  86. package/dist/brainyrich/store/brainyrichStore.d.ts +0 -19
  87. package/dist/brainyrich/store/brainyrichStore.d.ts.map +0 -1
  88. package/dist/brainyrich/store/brainyrichStore.js +0 -272
  89. package/dist/brainyrich/store/brainyrichStore.js.map +0 -1
  90. package/dist/brainyrich/types/index.d.ts +0 -116
  91. package/dist/brainyrich/types/index.d.ts.map +0 -1
  92. package/dist/brainyrich/utils/cn.d.ts +0 -4
  93. package/dist/brainyrich/utils/cn.d.ts.map +0 -1
  94. package/dist/brainyrich/utils/i18n.d.ts +0 -6
  95. package/dist/brainyrich/utils/i18n.d.ts.map +0 -1
  96. package/dist/brainyrich/utils/navigation.d.ts +0 -2
  97. package/dist/brainyrich/utils/navigation.d.ts.map +0 -1
  98. package/dist/dev/main.d.ts +0 -2
  99. package/dist/dev/main.d.ts.map +0 -1
  100. package/dist/generated/global-operations.d.ts +0 -2
  101. package/dist/generated/global-operations.d.ts.map +0 -1
  102. package/dist/generated/global-types.d.ts +0 -18199
  103. package/dist/generated/global-types.d.ts.map +0 -1
  104. package/dist/generated/wspace-operations.d.ts +0 -2
  105. package/dist/generated/wspace-operations.d.ts.map +0 -1
  106. package/dist/generated/wspace-types.d.ts +0 -43046
  107. package/dist/generated/wspace-types.d.ts.map +0 -1
  108. package/dist/index.d.ts +0 -2
  109. package/dist/index.d.ts.map +0 -1
@@ -1,258 +1,376 @@
1
1
  import { tWithFallback as e } from "../utils/i18n.js";
2
- import { useBrainyRichStore as t } from "../store/brainyrichStore.js";
3
- import { KpiGrid as n, SectionShell as r, formatMoney as i, statusBadgeVariant as a } from "./_shared.js";
4
- import { ArrowDownRight as o, ArrowUpRight as s, BarChart3 as c, Bell as l, Briefcase as u, Target as d, TrendingUp as f, Wallet as p } from "lucide-react";
5
- import { useI18n as m } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
6
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
7
- import { Badge as _, Button as v, Card as y, CardContent as b, CardDescription as x, CardHeader as S, CardTitle as C } from "@burdenoff/fe-libs/ui";
2
+ import { useAcknowledgeInsight as t, useCreateAccount as n, useDismissInsight as r, useGoals as i, useInsights as a, useNetWorthSummary as o, usePortfolios as s, useResolveInsight as c } from "../hooks/useBrainyRichApi.js";
3
+ import { AllocationBars as l, EmptyState as u, ErrorState as d, KpiGrid as f, LoadingState as p, SectionShell as m, formatDate as h, formatMoney as g, statusBadgeVariant as _ } from "./_shared.js";
4
+ import { useMemo as v, useState as y } from "react";
5
+ import { Bell as b, Briefcase as x, Check as S, CircleCheck as C, MoreHorizontal as w, PlusCircle as T, Target as E, Wallet as D, X as O } from "lucide-react";
6
+ import { useI18n as k } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
7
+ import { jsx as A, jsxs as j } from "react/jsx-runtime";
8
+ import { Badge as M, Button as N, Card as P, CardContent as F, CardDescription as I, CardHeader as L, CardTitle as R, Dialog as z, DialogContent as B, DialogDescription as V, DialogFooter as H, DialogHeader as U, DialogTitle as W, DropdownMenu as G, DropdownMenuContent as K, DropdownMenuItem as q, DropdownMenuTrigger as J, Input as Y, Label as X, Select as Z, SelectContent as Q, SelectItem as $, SelectTrigger as ee, SelectValue as te } from "@burdenoff/fe-libs/ui";
8
9
  //#region src/brainyrich/pages/DashboardPage.tsx
9
- var w = [
10
- {
11
- name: "S&P 500",
12
- value: "5,321.08",
13
- change: "+1.2%",
14
- positive: !0
15
- },
16
- {
17
- name: "NIFTY 50",
18
- value: "23,851.40",
19
- change: "+0.8%",
20
- positive: !0
21
- },
22
- {
23
- name: "NASDAQ",
24
- value: "16,742.39",
25
- change: "-0.3%",
26
- positive: !1
27
- }
10
+ var ne = [
11
+ "BANK",
12
+ "BROKERAGE",
13
+ "RETIREMENT",
14
+ "CASH",
15
+ "CRYPTO",
16
+ "REAL_ESTATE",
17
+ "ALTERNATIVE",
18
+ "LIABILITY"
28
19
  ];
29
- function T() {
30
- let { t: T } = m(), { metrics: E, workItems: D, portfolios: O, holdings: k, goals: A } = t(), j = (t, n, r) => e(T, t, n, r), M = E.map((e) => ({
31
- ...e,
32
- label: e.label === "Net Worth" ? j("brainyrich.dashboard.metrics.netWorth", "Net Worth") : e.label === "Invested Assets" ? j("brainyrich.dashboard.metrics.investedAssets", "Invested Assets") : e.label === "Liquidity" ? j("brainyrich.dashboard.metrics.liquidity", "Liquidity") : e.label === "Goal Completion" ? j("brainyrich.dashboard.metrics.goalCompletion", "Goal Completion") : e.label
33
- })), N = O.reduce((e, t) => e + t.value, 0), P = A.length ? Math.round(A.reduce((e, t) => e + t.currentAmount / t.targetAmount * 100, 0) / A.length) : 0;
34
- return /* @__PURE__ */ g(r, {
35
- title: j("brainyrich.dashboard.title", "Wealth Dashboard"),
36
- description: j("brainyrich.dashboard.description", "Your consolidated financial overview at a glance"),
37
- actionLabel: j("brainyrich.dashboard.actions.healthCheck", "Run Health Check"),
38
- badges: [j("brainyrich.dashboard.badges.liveData", "Live Data")],
20
+ function re() {
21
+ let { t } = k(), n = (n, r, i) => e(t, n, r, i), r = o(), c = s(), y = i(), S = a({ status: "OPEN" }), w = r.data, T = w?.currency ?? "USD", O = w ? [
22
+ {
23
+ label: n("brainyrich.dashboard.metrics.netWorth", "Net Worth"),
24
+ value: g(w.totalNetWorth, T)
25
+ },
26
+ {
27
+ label: n("brainyrich.dashboard.metrics.investedAssets", "Invested Assets"),
28
+ value: g(w.totalMarketValue, T)
29
+ },
30
+ {
31
+ label: n("brainyrich.dashboard.metrics.liquidity", "Cash & Liquidity"),
32
+ value: g(w.totalCash, T)
33
+ },
34
+ {
35
+ label: n("brainyrich.dashboard.metrics.accounts", "Linked Accounts"),
36
+ value: String(w.accountCount)
37
+ }
38
+ ] : [], N = v(() => {
39
+ if (!w) return [];
40
+ let e = w.byAssetClass.reduce((e, t) => e + t.marketValue, 0);
41
+ return e <= 0 ? [] : w.byAssetClass.slice().sort((e, t) => t.marketValue - e.marketValue).map((t) => ({
42
+ label: t.assetClass.replace(/_/g, " "),
43
+ value: t.marketValue / e * 100,
44
+ caption: g(t.marketValue, T)
45
+ }));
46
+ }, [w, T]), z = c.data.slice(0, 5), B = y.data.slice(0, 5), V = S.data.slice(0, 6);
47
+ return /* @__PURE__ */ j(m, {
48
+ title: n("brainyrich.dashboard.title", "Wealth Dashboard"),
49
+ description: n("brainyrich.dashboard.description", "Your consolidated financial overview at a glance"),
50
+ actions: /* @__PURE__ */ A(ae, { translate: n }),
39
51
  children: [
40
- /* @__PURE__ */ h(n, { items: M }),
41
- /* @__PURE__ */ g("div", {
52
+ r.isLoading ? /* @__PURE__ */ A(p, { rows: 1 }) : r.isError ? /* @__PURE__ */ A(d, {
53
+ title: n("brainyrich.dashboard.netWorthError", "Could not load net worth"),
54
+ onRetry: () => r.refetch()
55
+ }) : w ? /* @__PURE__ */ A(f, { items: O }) : /* @__PURE__ */ A(u, {
56
+ icon: /* @__PURE__ */ A(D, {
57
+ className: "size-6",
58
+ "aria-hidden": "true"
59
+ }),
60
+ title: n("brainyrich.dashboard.noSummary", "No financial data yet"),
61
+ description: n("brainyrich.dashboard.noSummaryDesc", "Link your first account to see your net worth here.")
62
+ }),
63
+ /* @__PURE__ */ j("div", {
42
64
  className: "grid gap-6 lg:grid-cols-3",
43
- children: [/* @__PURE__ */ g(y, {
65
+ children: [/* @__PURE__ */ j(P, {
44
66
  className: "lg:col-span-2",
45
- children: [/* @__PURE__ */ g(S, { children: [/* @__PURE__ */ g(C, {
67
+ children: [/* @__PURE__ */ j(L, { children: [/* @__PURE__ */ j(R, {
46
68
  className: "flex items-center gap-2",
47
- children: [/* @__PURE__ */ h(u, { className: "h-5 w-5" }), j("brainyrich.dashboard.sections.portfolioSnapshot", "Portfolio Snapshot")]
48
- }), /* @__PURE__ */ h(x, { children: j("brainyrich.dashboard.sections.portfolioSnapshotDescription", "Current allocation across strategies") })] }), /* @__PURE__ */ g(b, {
49
- className: "space-y-4",
50
- children: [/* @__PURE__ */ g("div", {
51
- className: "flex items-baseline justify-between",
52
- children: [/* @__PURE__ */ h("span", {
53
- className: "text-2xl font-bold",
54
- children: i(N)
55
- }), /* @__PURE__ */ g("span", {
56
- className: "text-sm text-emerald-600 flex items-center gap-1",
69
+ children: [/* @__PURE__ */ A(x, {
70
+ className: "h-5 w-5",
71
+ "aria-hidden": "true"
72
+ }), n("brainyrich.dashboard.sections.assetAllocation", "Asset Allocation")]
73
+ }), /* @__PURE__ */ A(I, { children: n("brainyrich.dashboard.sections.assetAllocationDescription", "Market value distributed across asset classes") })] }), /* @__PURE__ */ A(F, { children: r.isLoading ? /* @__PURE__ */ A(p, { rows: 3 }) : r.isError ? /* @__PURE__ */ A(d, { onRetry: () => r.refetch() }) : N.length > 0 ? /* @__PURE__ */ A(l, { data: N }) : /* @__PURE__ */ A(u, {
74
+ icon: /* @__PURE__ */ A(x, {
75
+ className: "size-6",
76
+ "aria-hidden": "true"
77
+ }),
78
+ title: n("brainyrich.dashboard.noAllocation", "No holdings to allocate"),
79
+ description: n("brainyrich.dashboard.noAllocationDesc", "Add holdings to your accounts to see how your wealth is allocated.")
80
+ }) })]
81
+ }), /* @__PURE__ */ j(P, { children: [/* @__PURE__ */ A(L, {
82
+ className: "pb-3",
83
+ children: /* @__PURE__ */ j(R, {
84
+ className: "flex items-center gap-2 text-base",
85
+ children: [/* @__PURE__ */ A(E, {
86
+ className: "h-4 w-4",
87
+ "aria-hidden": "true"
88
+ }), n("brainyrich.dashboard.sections.goals", "Goals")]
89
+ })
90
+ }), /* @__PURE__ */ A(F, {
91
+ className: "space-y-3",
92
+ children: y.isLoading ? /* @__PURE__ */ A(p, { rows: 3 }) : y.isError ? /* @__PURE__ */ A(d, { onRetry: () => y.refetch() }) : B.length > 0 ? B.map((e) => /* @__PURE__ */ j("div", {
93
+ className: "flex items-start justify-between gap-2 rounded-lg border border-border-subtle p-3",
94
+ children: [/* @__PURE__ */ j("div", {
95
+ className: "min-w-0 space-y-0.5",
96
+ children: [/* @__PURE__ */ A("p", {
97
+ className: "truncate text-sm font-medium text-text-primary",
98
+ children: e.name
99
+ }), /* @__PURE__ */ j("p", {
100
+ className: "text-xs text-text-secondary",
57
101
  children: [
58
- /* @__PURE__ */ h(f, { className: "h-3 w-3" }),
59
- j("brainyrich.dashboard.weightedYtdPrefix", "Weighted YTD +"),
60
- (O.reduce((e, t) => e + t.ytdReturnPct * t.value, 0) / N).toFixed(1),
61
- "%"
102
+ g(e.targetAmount, e.currency),
103
+ " · ",
104
+ h(e.targetDate)
62
105
  ]
63
106
  })]
64
- }), O.map((e) => {
65
- let t = Math.round(e.value / N * 100);
66
- return /* @__PURE__ */ g("div", {
67
- className: "space-y-1",
68
- children: [
69
- /* @__PURE__ */ g("div", {
70
- className: "flex items-center justify-between text-sm",
71
- children: [/* @__PURE__ */ h("span", {
72
- className: "font-medium",
73
- children: e.name
74
- }), /* @__PURE__ */ g("span", { children: [
75
- i(e.value),
76
- " (",
77
- t,
78
- "%)"
79
- ] })]
80
- }),
81
- /* @__PURE__ */ h("div", {
82
- className: "h-2 rounded bg-muted overflow-hidden",
83
- children: /* @__PURE__ */ h("div", {
84
- className: "h-2 rounded bg-primary",
85
- style: { width: `${t}%` }
86
- })
87
- }),
88
- /* @__PURE__ */ g("div", {
89
- className: "flex items-center justify-between text-xs text-muted-foreground",
90
- children: [/* @__PURE__ */ g("span", { children: [
91
- j("brainyrich.dashboard.portfolio.ytdPrefix", "YTD +"),
92
- e.ytdReturnPct,
93
- "%"
94
- ] }), /* @__PURE__ */ h(_, {
95
- variant: e.risk === "High" ? "destructive" : e.risk === "Moderate" ? "secondary" : "outline",
96
- className: "text-[10px]",
97
- children: e.risk
98
- })]
99
- })
100
- ]
101
- }, e.id);
107
+ }), /* @__PURE__ */ A(M, {
108
+ variant: _(e.projection),
109
+ className: "shrink-0",
110
+ children: e.projection.replace(/_/g, " ")
102
111
  })]
103
- })]
104
- }), /* @__PURE__ */ g("div", {
105
- className: "space-y-4",
106
- children: [/* @__PURE__ */ g(y, { children: [/* @__PURE__ */ h(S, {
107
- className: "pb-3",
108
- children: /* @__PURE__ */ g(C, {
109
- className: "flex items-center gap-2 text-base",
110
- children: [/* @__PURE__ */ h(c, { className: "h-4 w-4" }), j("brainyrich.dashboard.sections.marketSummary", "Market Summary")]
111
- })
112
- }), /* @__PURE__ */ h(b, {
113
- className: "space-y-3",
114
- children: w.map((e) => /* @__PURE__ */ g("div", {
115
- className: "flex items-center justify-between",
116
- children: [/* @__PURE__ */ h("span", {
117
- className: "text-sm font-medium",
118
- children: e.name
119
- }), /* @__PURE__ */ g("div", {
120
- className: "text-right",
121
- children: [/* @__PURE__ */ h("div", {
122
- className: "text-sm",
123
- children: e.value
124
- }), /* @__PURE__ */ g("div", {
125
- className: `text-xs flex items-center gap-0.5 ${e.positive ? "text-emerald-600" : "text-red-600"}`,
126
- children: [e.positive ? /* @__PURE__ */ h(s, { className: "h-3 w-3" }) : /* @__PURE__ */ h(o, { className: "h-3 w-3" }), e.change]
127
- })]
128
- })]
129
- }, e.name))
130
- })] }), /* @__PURE__ */ g(y, { children: [/* @__PURE__ */ h(S, {
131
- className: "pb-3",
132
- children: /* @__PURE__ */ g(C, {
133
- className: "flex items-center gap-2 text-base",
134
- children: [/* @__PURE__ */ h(d, { className: "h-4 w-4" }), j("brainyrich.dashboard.sections.goalProgress", "Goal Progress")]
135
- })
136
- }), /* @__PURE__ */ g(b, {
137
- className: "space-y-3",
138
- children: [/* @__PURE__ */ g("div", {
139
- className: "text-center",
140
- children: [/* @__PURE__ */ g("span", {
141
- className: "text-3xl font-bold",
142
- children: [P, "%"]
143
- }), /* @__PURE__ */ h("p", {
144
- className: "text-xs text-muted-foreground mt-1",
145
- children: j("brainyrich.dashboard.goalProgress.averageCompletion", "Average goal completion")
146
- })]
147
- }), A.map((e) => {
148
- let t = Math.round(e.currentAmount / e.targetAmount * 100);
149
- return /* @__PURE__ */ g("div", {
150
- className: "space-y-1",
151
- children: [/* @__PURE__ */ g("div", {
152
- className: "flex justify-between text-xs",
153
- children: [/* @__PURE__ */ h("span", { children: e.title }), /* @__PURE__ */ g("span", { children: [t, "%"] })]
154
- }), /* @__PURE__ */ h("div", {
155
- className: "h-1.5 rounded bg-muted overflow-hidden",
156
- children: /* @__PURE__ */ h("div", {
157
- className: "h-1.5 rounded bg-emerald-500",
158
- style: { width: `${t}%` }
159
- })
160
- })]
161
- }, e.id);
162
- })]
163
- })] })]
164
- })]
112
+ }, e.id)) : /* @__PURE__ */ A(u, {
113
+ icon: /* @__PURE__ */ A(E, {
114
+ className: "size-6",
115
+ "aria-hidden": "true"
116
+ }),
117
+ title: n("brainyrich.dashboard.noGoals", "No goals yet"),
118
+ description: n("brainyrich.dashboard.noGoalsDesc", "Set a financial goal to start tracking progress.")
119
+ })
120
+ })] })]
165
121
  }),
166
- /* @__PURE__ */ g(y, { children: [/* @__PURE__ */ g(S, { children: [/* @__PURE__ */ g(C, {
122
+ /* @__PURE__ */ j(P, { children: [/* @__PURE__ */ j(L, { children: [/* @__PURE__ */ j(R, {
167
123
  className: "flex items-center gap-2",
168
- children: [/* @__PURE__ */ h(p, { className: "h-5 w-5" }), j("brainyrich.dashboard.sections.topHoldings", "Top Holdings")]
169
- }), /* @__PURE__ */ h(x, { children: j("brainyrich.dashboard.sections.topHoldingsDescription", "Highest-value positions across all portfolios") })] }), /* @__PURE__ */ h(b, { children: /* @__PURE__ */ h("div", {
170
- className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4",
171
- children: k.map((e) => /* @__PURE__ */ g("div", {
172
- className: "flex items-center justify-between rounded-lg border p-3",
173
- children: [/* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("p", {
174
- className: "font-semibold text-sm",
175
- children: e.symbol
176
- }), /* @__PURE__ */ h("p", {
177
- className: "text-xs text-muted-foreground",
178
- children: e.sector
179
- })] }), /* @__PURE__ */ g("div", {
180
- className: "text-right",
181
- children: [/* @__PURE__ */ h("p", {
182
- className: "text-sm font-medium",
183
- children: i(e.marketValue)
184
- }), /* @__PURE__ */ g("p", {
185
- className: `text-xs ${e.changePct >= 0 ? "text-emerald-600" : "text-red-600"}`,
186
- children: [
187
- e.changePct >= 0 ? "+" : "",
188
- e.changePct,
189
- "%"
190
- ]
124
+ children: [/* @__PURE__ */ A(D, {
125
+ className: "h-5 w-5",
126
+ "aria-hidden": "true"
127
+ }), n("brainyrich.dashboard.sections.portfolios", "Portfolios")]
128
+ }), /* @__PURE__ */ A(I, { children: n("brainyrich.dashboard.sections.portfoliosDescription", "Your active investment strategies") })] }), /* @__PURE__ */ A(F, { children: c.isLoading ? /* @__PURE__ */ A(p, { rows: 3 }) : c.isError ? /* @__PURE__ */ A(d, { onRetry: () => c.refetch() }) : z.length > 0 ? /* @__PURE__ */ A("div", {
129
+ className: "grid gap-3 sm:grid-cols-2",
130
+ children: z.map((e) => /* @__PURE__ */ j("div", {
131
+ className: "flex items-start justify-between gap-2 rounded-lg border border-border-subtle p-3",
132
+ children: [/* @__PURE__ */ j("div", {
133
+ className: "min-w-0 space-y-0.5",
134
+ children: [/* @__PURE__ */ A("p", {
135
+ className: "truncate text-sm font-medium text-text-primary",
136
+ children: e.name
137
+ }), e.description ? /* @__PURE__ */ A("p", {
138
+ className: "truncate text-xs text-text-secondary",
139
+ children: e.description
140
+ }) : /* @__PURE__ */ A("p", {
141
+ className: "text-xs text-text-secondary",
142
+ children: e.baseCurrency
191
143
  })]
144
+ }), /* @__PURE__ */ A(M, {
145
+ variant: _(e.status),
146
+ className: "shrink-0",
147
+ children: e.status
192
148
  })]
193
- }, e.symbol))
149
+ }, e.id))
150
+ }) : /* @__PURE__ */ A(u, {
151
+ icon: /* @__PURE__ */ A(D, {
152
+ className: "size-6",
153
+ "aria-hidden": "true"
154
+ }),
155
+ title: n("brainyrich.dashboard.noPortfolios", "No portfolios yet"),
156
+ description: n("brainyrich.dashboard.noPortfoliosDesc", "Create a portfolio to organize your investment strategy.")
194
157
  }) })] }),
195
- /* @__PURE__ */ g(y, { children: [/* @__PURE__ */ g(S, { children: [/* @__PURE__ */ g(C, {
158
+ /* @__PURE__ */ j(P, { children: [/* @__PURE__ */ j(L, { children: [/* @__PURE__ */ j(R, {
196
159
  className: "flex items-center gap-2",
197
- children: [/* @__PURE__ */ h(l, { className: "h-5 w-5" }), j("brainyrich.dashboard.sections.activeWorkItems", "Active Work Items")]
198
- }), /* @__PURE__ */ h(x, { children: j("brainyrich.dashboard.sections.activeWorkItemsDescription", "Tasks and initiatives from your wealth operations teams") })] }), /* @__PURE__ */ h(b, {
160
+ children: [/* @__PURE__ */ A(b, {
161
+ className: "h-5 w-5",
162
+ "aria-hidden": "true"
163
+ }), n("brainyrich.dashboard.sections.needsAttention", "Needs Attention")]
164
+ }), /* @__PURE__ */ A(I, { children: n("brainyrich.dashboard.sections.needsAttentionDescription", "Open insights that may require action") })] }), /* @__PURE__ */ A(F, {
199
165
  className: "space-y-3",
200
- children: D.map((e) => /* @__PURE__ */ g("div", {
201
- className: "flex items-center justify-between rounded-lg border p-3",
202
- children: [/* @__PURE__ */ g("div", {
203
- className: "space-y-0.5",
204
- children: [/* @__PURE__ */ h("p", {
205
- className: "text-sm font-medium",
206
- children: e.title
207
- }), /* @__PURE__ */ g("p", {
208
- className: "text-xs text-muted-foreground",
209
- children: [
210
- e.owner,
211
- " · ",
212
- e.updatedAt
213
- ]
166
+ children: S.isLoading ? /* @__PURE__ */ A(p, { rows: 3 }) : S.isError ? /* @__PURE__ */ A(d, { onRetry: () => S.refetch() }) : V.length > 0 ? V.map((e) => /* @__PURE__ */ A(ie, {
167
+ insight: e,
168
+ translate: n
169
+ }, e.id)) : /* @__PURE__ */ A(u, {
170
+ icon: /* @__PURE__ */ A(C, {
171
+ className: "size-6",
172
+ "aria-hidden": "true"
173
+ }),
174
+ title: n("brainyrich.dashboard.noInsights", "All clear"),
175
+ description: n("brainyrich.dashboard.noInsightsDesc", "There are no open insights that need your attention.")
176
+ })
177
+ })] })
178
+ ]
179
+ });
180
+ }
181
+ function ie({ insight: e, translate: n }) {
182
+ let i = t(), a = r(), o = c(), s = i.isPending || a.isPending || o.isPending;
183
+ return /* @__PURE__ */ j("div", {
184
+ className: "flex items-start justify-between gap-3 rounded-lg border border-border-subtle p-3",
185
+ children: [/* @__PURE__ */ j("div", {
186
+ className: "min-w-0 space-y-1",
187
+ children: [
188
+ /* @__PURE__ */ j("div", {
189
+ className: "flex items-center gap-2",
190
+ children: [/* @__PURE__ */ A(M, {
191
+ variant: _(e.severity),
192
+ children: e.severity
193
+ }), /* @__PURE__ */ A("span", {
194
+ className: "text-xs text-text-secondary",
195
+ children: e.type.replace(/_/g, " ")
196
+ })]
197
+ }),
198
+ /* @__PURE__ */ A("p", {
199
+ className: "text-sm font-medium text-text-primary",
200
+ children: e.title
201
+ }),
202
+ e.detail ? /* @__PURE__ */ A("p", {
203
+ className: "text-xs text-text-secondary",
204
+ children: e.detail
205
+ }) : null
206
+ ]
207
+ }), /* @__PURE__ */ j(G, { children: [/* @__PURE__ */ A(J, {
208
+ asChild: !0,
209
+ children: /* @__PURE__ */ A(N, {
210
+ variant: "ghost",
211
+ size: "icon",
212
+ className: "shrink-0",
213
+ disabled: s,
214
+ "aria-label": n("brainyrich.dashboard.insightActions", "Insight actions"),
215
+ children: /* @__PURE__ */ A(w, {
216
+ className: "size-4",
217
+ "aria-hidden": "true"
218
+ })
219
+ })
220
+ }), /* @__PURE__ */ j(K, {
221
+ align: "end",
222
+ children: [
223
+ /* @__PURE__ */ j(q, {
224
+ onSelect: () => i.mutate(e.id),
225
+ children: [/* @__PURE__ */ A(S, {
226
+ className: "size-4",
227
+ "aria-hidden": "true"
228
+ }), n("brainyrich.dashboard.insight.acknowledge", "Acknowledge")]
229
+ }),
230
+ /* @__PURE__ */ j(q, {
231
+ onSelect: () => o.mutate(e.id),
232
+ children: [/* @__PURE__ */ A(C, {
233
+ className: "size-4",
234
+ "aria-hidden": "true"
235
+ }), n("brainyrich.dashboard.insight.resolve", "Resolve")]
236
+ }),
237
+ /* @__PURE__ */ j(q, {
238
+ onSelect: () => a.mutate(e.id),
239
+ children: [/* @__PURE__ */ A(O, {
240
+ className: "size-4",
241
+ "aria-hidden": "true"
242
+ }), n("brainyrich.dashboard.insight.dismiss", "Dismiss")]
243
+ })
244
+ ]
245
+ })] })]
246
+ });
247
+ }
248
+ function ae({ translate: e }) {
249
+ let [t, r] = y(!1), [i, a] = y(""), [o, s] = y("BROKERAGE"), [c, l] = y(""), [u, d] = y(""), [f, p] = y("USD"), m = n(), h = i.trim(), g = h.length > 0 && !m.isPending, _ = () => {
250
+ a(""), s("BROKERAGE"), l(""), d(""), p("USD"), m.reset();
251
+ };
252
+ return /* @__PURE__ */ j(z, {
253
+ open: t,
254
+ onOpenChange: (e) => {
255
+ r(e), e || _();
256
+ },
257
+ children: [/* @__PURE__ */ j(N, {
258
+ size: "sm",
259
+ onClick: () => r(!0),
260
+ children: [/* @__PURE__ */ A(T, {
261
+ className: "size-4",
262
+ "aria-hidden": "true"
263
+ }), e("brainyrich.dashboard.actions.newAccount", "New Account")]
264
+ }), /* @__PURE__ */ A(B, { children: /* @__PURE__ */ j("form", {
265
+ onSubmit: (e) => {
266
+ if (e.preventDefault(), !g) return;
267
+ let t = Number.parseFloat(u), n = {
268
+ name: h,
269
+ type: o,
270
+ currency: f.trim() || "USD",
271
+ isManual: !0,
272
+ ...c.trim() ? { institution: c.trim() } : {},
273
+ ...Number.isFinite(t) ? { cashBalance: t } : {}
274
+ };
275
+ m.mutate(n, { onSuccess: () => {
276
+ _(), r(!1);
277
+ } });
278
+ },
279
+ className: "space-y-4",
280
+ children: [
281
+ /* @__PURE__ */ j(U, { children: [/* @__PURE__ */ A(W, { children: e("brainyrich.dashboard.newAccount.title", "New Account") }), /* @__PURE__ */ A(V, { children: e("brainyrich.dashboard.newAccount.description", "Add a manual account to track alongside your linked institutions.") })] }),
282
+ /* @__PURE__ */ j("div", {
283
+ className: "space-y-2",
284
+ children: [/* @__PURE__ */ A(X, {
285
+ htmlFor: "bra-account-name",
286
+ children: e("brainyrich.dashboard.newAccount.name", "Account name")
287
+ }), /* @__PURE__ */ A(Y, {
288
+ id: "bra-account-name",
289
+ value: i,
290
+ onChange: (e) => a(e.target.value),
291
+ placeholder: e("brainyrich.dashboard.newAccount.namePlaceholder", "e.g. Fidelity Brokerage"),
292
+ required: !0,
293
+ autoFocus: !0
294
+ })]
295
+ }),
296
+ /* @__PURE__ */ j("div", {
297
+ className: "grid gap-4 sm:grid-cols-2",
298
+ children: [/* @__PURE__ */ j("div", {
299
+ className: "space-y-2",
300
+ children: [/* @__PURE__ */ A(X, {
301
+ htmlFor: "bra-account-type",
302
+ children: e("brainyrich.dashboard.newAccount.type", "Type")
303
+ }), /* @__PURE__ */ j(Z, {
304
+ value: o,
305
+ onValueChange: (e) => s(e),
306
+ children: [/* @__PURE__ */ A(ee, {
307
+ id: "bra-account-type",
308
+ children: /* @__PURE__ */ A(te, {})
309
+ }), /* @__PURE__ */ A(Q, { children: ne.map((e) => /* @__PURE__ */ A($, {
310
+ value: e,
311
+ children: e.replace(/_/g, " ")
312
+ }, e)) })]
313
+ })]
314
+ }), /* @__PURE__ */ j("div", {
315
+ className: "space-y-2",
316
+ children: [/* @__PURE__ */ A(X, {
317
+ htmlFor: "bra-account-currency",
318
+ children: e("brainyrich.dashboard.newAccount.currency", "Currency")
319
+ }), /* @__PURE__ */ A(Y, {
320
+ id: "bra-account-currency",
321
+ value: f,
322
+ onChange: (e) => p(e.target.value.toUpperCase()),
323
+ maxLength: 3
214
324
  })]
215
- }), /* @__PURE__ */ h(_, {
216
- variant: a(e.status),
217
- children: e.status.replace("_", " ")
218
325
  })]
219
- }, e.id))
220
- })] }),
221
- /* @__PURE__ */ h("div", {
222
- className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4",
223
- children: [
224
- {
225
- label: j("brainyrich.dashboard.quickActions.placeTradeOrder", "Place Trade Order"),
226
- desc: j("brainyrich.dashboard.quickActions.placeTradeOrderDesc", "Buy or sell securities")
227
- },
228
- {
229
- label: j("brainyrich.dashboard.quickActions.linkNewAccount", "Link New Account"),
230
- desc: j("brainyrich.dashboard.quickActions.linkNewAccountDesc", "Connect a financial account")
231
- },
232
- {
233
- label: j("brainyrich.dashboard.quickActions.generateReport", "Generate Report"),
234
- desc: j("brainyrich.dashboard.quickActions.generateReportDesc", "Create a wealth snapshot")
235
- },
236
- {
237
- label: j("brainyrich.dashboard.quickActions.askWealthAi", "Ask Wealth AI"),
238
- desc: j("brainyrich.dashboard.quickActions.askWealthAiDesc", "Get personalized advice")
239
- }
240
- ].map((e) => /* @__PURE__ */ g(v, {
241
- variant: "outline",
242
- className: "h-auto flex-col items-start p-4 text-left",
243
- children: [/* @__PURE__ */ h("span", {
244
- className: "font-medium text-sm",
245
- children: e.label
246
- }), /* @__PURE__ */ h("span", {
247
- className: "text-xs text-muted-foreground",
248
- children: e.desc
326
+ }),
327
+ /* @__PURE__ */ j("div", {
328
+ className: "space-y-2",
329
+ children: [/* @__PURE__ */ A(X, {
330
+ htmlFor: "bra-account-institution",
331
+ children: e("brainyrich.dashboard.newAccount.institution", "Institution (optional)")
332
+ }), /* @__PURE__ */ A(Y, {
333
+ id: "bra-account-institution",
334
+ value: c,
335
+ onChange: (e) => l(e.target.value),
336
+ placeholder: e("brainyrich.dashboard.newAccount.institutionPlaceholder", "e.g. Fidelity")
249
337
  })]
250
- }, e.label))
251
- })
252
- ]
338
+ }),
339
+ /* @__PURE__ */ j("div", {
340
+ className: "space-y-2",
341
+ children: [/* @__PURE__ */ A(X, {
342
+ htmlFor: "bra-account-cash",
343
+ children: e("brainyrich.dashboard.newAccount.cash", "Cash balance (optional)")
344
+ }), /* @__PURE__ */ A(Y, {
345
+ id: "bra-account-cash",
346
+ type: "number",
347
+ inputMode: "decimal",
348
+ step: "0.01",
349
+ value: u,
350
+ onChange: (e) => d(e.target.value),
351
+ placeholder: "0.00"
352
+ })]
353
+ }),
354
+ m.isError ? /* @__PURE__ */ A("p", {
355
+ className: "text-sm text-status-error-text",
356
+ children: m.error instanceof Error ? m.error.message : e("brainyrich.dashboard.newAccount.error", "Could not create account.")
357
+ }) : null,
358
+ /* @__PURE__ */ j(H, { children: [/* @__PURE__ */ A(N, {
359
+ type: "button",
360
+ variant: "outline",
361
+ onClick: () => r(!1),
362
+ disabled: m.isPending,
363
+ children: e("brainyrich.common.cancel", "Cancel")
364
+ }), /* @__PURE__ */ A(N, {
365
+ type: "submit",
366
+ disabled: !g,
367
+ children: m.isPending ? e("brainyrich.dashboard.newAccount.creating", "Creating…") : e("brainyrich.dashboard.newAccount.create", "Create account")
368
+ })] })
369
+ ]
370
+ }) })]
253
371
  });
254
372
  }
255
373
  //#endregion
256
- export { T as DashboardPage };
374
+ export { re as DashboardPage };
257
375
 
258
376
  //# sourceMappingURL=DashboardPage.js.map