@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.
- package/dist/brainyrich/BrainyRichRoot.js +53 -88
- package/dist/brainyrich/BrainyRichRoot.js.map +1 -1
- package/dist/brainyrich/BrainyRichRoutes.js +15 -35
- package/dist/brainyrich/BrainyRichRoutes.js.map +1 -1
- package/dist/brainyrich/hooks/useBrainyRichApi.js +543 -0
- package/dist/brainyrich/hooks/useBrainyRichApi.js.map +1 -0
- package/dist/brainyrich/index.js +0 -1
- package/dist/brainyrich/pages/AccountsPage.js +690 -160
- package/dist/brainyrich/pages/AccountsPage.js.map +1 -1
- package/dist/brainyrich/pages/AiAssistantPage.js +537 -363
- package/dist/brainyrich/pages/AiAssistantPage.js.map +1 -1
- package/dist/brainyrich/pages/AnalyticsPage.js +587 -268
- package/dist/brainyrich/pages/AnalyticsPage.js.map +1 -1
- package/dist/brainyrich/pages/DashboardPage.js +350 -232
- package/dist/brainyrich/pages/DashboardPage.js.map +1 -1
- package/dist/brainyrich/pages/FamilyPage.js +550 -337
- package/dist/brainyrich/pages/FamilyPage.js.map +1 -1
- package/dist/brainyrich/pages/GoalsPage.js +775 -142
- package/dist/brainyrich/pages/GoalsPage.js.map +1 -1
- package/dist/brainyrich/pages/InvestmentsPage.js +410 -311
- package/dist/brainyrich/pages/InvestmentsPage.js.map +1 -1
- package/dist/brainyrich/pages/PortfoliosPage.js +823 -154
- package/dist/brainyrich/pages/PortfoliosPage.js.map +1 -1
- package/dist/brainyrich/pages/ReportsPage.js +388 -251
- package/dist/brainyrich/pages/ReportsPage.js.map +1 -1
- package/dist/brainyrich/pages/RiskPage.js +411 -196
- package/dist/brainyrich/pages/RiskPage.js.map +1 -1
- package/dist/brainyrich/pages/TaxPage.js +622 -221
- package/dist/brainyrich/pages/TaxPage.js.map +1 -1
- package/dist/brainyrich/pages/_shared.js +222 -41
- package/dist/brainyrich/pages/_shared.js.map +1 -1
- package/dist/index.js +2 -3
- package/package.json +1 -1
- package/dist/brainyrich/BrainyRichRoot.d.ts +0 -5
- package/dist/brainyrich/BrainyRichRoot.d.ts.map +0 -1
- package/dist/brainyrich/BrainyRichRoutes.d.ts +0 -2
- package/dist/brainyrich/BrainyRichRoutes.d.ts.map +0 -1
- package/dist/brainyrich/index.d.ts +0 -5
- package/dist/brainyrich/index.d.ts.map +0 -1
- package/dist/brainyrich/pages/AccountsPage.d.ts +0 -2
- package/dist/brainyrich/pages/AccountsPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/AdvisorsPage.d.ts +0 -2
- package/dist/brainyrich/pages/AdvisorsPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/AdvisorsPage.js +0 -375
- package/dist/brainyrich/pages/AdvisorsPage.js.map +0 -1
- package/dist/brainyrich/pages/AiAssistantPage.d.ts +0 -2
- package/dist/brainyrich/pages/AiAssistantPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/AnalyticsPage.d.ts +0 -2
- package/dist/brainyrich/pages/AnalyticsPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/AssistantPage.d.ts +0 -2
- package/dist/brainyrich/pages/AssistantPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/AssistantPage.js +0 -332
- package/dist/brainyrich/pages/AssistantPage.js.map +0 -1
- package/dist/brainyrich/pages/DashboardPage.d.ts +0 -2
- package/dist/brainyrich/pages/DashboardPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/EstatePage.d.ts +0 -2
- package/dist/brainyrich/pages/EstatePage.d.ts.map +0 -1
- package/dist/brainyrich/pages/EstatePage.js +0 -269
- package/dist/brainyrich/pages/EstatePage.js.map +0 -1
- package/dist/brainyrich/pages/FamilyPage.d.ts +0 -2
- package/dist/brainyrich/pages/FamilyPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/GoalsPage.d.ts +0 -2
- package/dist/brainyrich/pages/GoalsPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/InsurancePage.d.ts +0 -2
- package/dist/brainyrich/pages/InsurancePage.d.ts.map +0 -1
- package/dist/brainyrich/pages/InsurancePage.js +0 -181
- package/dist/brainyrich/pages/InsurancePage.js.map +0 -1
- package/dist/brainyrich/pages/InvestmentsPage.d.ts +0 -2
- package/dist/brainyrich/pages/InvestmentsPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/MarketplacePage.d.ts +0 -2
- package/dist/brainyrich/pages/MarketplacePage.d.ts.map +0 -1
- package/dist/brainyrich/pages/MarketplacePage.js +0 -450
- package/dist/brainyrich/pages/MarketplacePage.js.map +0 -1
- package/dist/brainyrich/pages/PortfoliosPage.d.ts +0 -2
- package/dist/brainyrich/pages/PortfoliosPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/ReportsPage.d.ts +0 -2
- package/dist/brainyrich/pages/ReportsPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/RiskPage.d.ts +0 -2
- package/dist/brainyrich/pages/RiskPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/TaxPage.d.ts +0 -2
- package/dist/brainyrich/pages/TaxPage.d.ts.map +0 -1
- package/dist/brainyrich/pages/_shared.d.ts +0 -21
- package/dist/brainyrich/pages/_shared.d.ts.map +0 -1
- package/dist/brainyrich/providers/BrainyRichProvider.d.ts +0 -6
- package/dist/brainyrich/providers/BrainyRichProvider.d.ts.map +0 -1
- package/dist/brainyrich/store/brainyrichStore.d.ts +0 -19
- package/dist/brainyrich/store/brainyrichStore.d.ts.map +0 -1
- package/dist/brainyrich/store/brainyrichStore.js +0 -272
- package/dist/brainyrich/store/brainyrichStore.js.map +0 -1
- package/dist/brainyrich/types/index.d.ts +0 -116
- package/dist/brainyrich/types/index.d.ts.map +0 -1
- package/dist/brainyrich/utils/cn.d.ts +0 -4
- package/dist/brainyrich/utils/cn.d.ts.map +0 -1
- package/dist/brainyrich/utils/i18n.d.ts +0 -6
- package/dist/brainyrich/utils/i18n.d.ts.map +0 -1
- package/dist/brainyrich/utils/navigation.d.ts +0 -2
- package/dist/brainyrich/utils/navigation.d.ts.map +0 -1
- package/dist/dev/main.d.ts +0 -2
- package/dist/dev/main.d.ts.map +0 -1
- package/dist/generated/global-operations.d.ts +0 -2
- package/dist/generated/global-operations.d.ts.map +0 -1
- package/dist/generated/global-types.d.ts +0 -18199
- package/dist/generated/global-types.d.ts.map +0 -1
- package/dist/generated/wspace-operations.d.ts +0 -2
- package/dist/generated/wspace-operations.d.ts.map +0 -1
- package/dist/generated/wspace-types.d.ts +0 -43046
- package/dist/generated/wspace-types.d.ts.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.d.ts.map +0 -1
|
@@ -1,258 +1,376 @@
|
|
|
1
1
|
import { tWithFallback as e } from "../utils/i18n.js";
|
|
2
|
-
import {
|
|
3
|
-
import { KpiGrid as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
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
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
|
30
|
-
let { t
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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__ */
|
|
41
|
-
|
|
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__ */
|
|
65
|
+
children: [/* @__PURE__ */ j(P, {
|
|
44
66
|
className: "lg:col-span-2",
|
|
45
|
-
children: [/* @__PURE__ */
|
|
67
|
+
children: [/* @__PURE__ */ j(L, { children: [/* @__PURE__ */ j(R, {
|
|
46
68
|
className: "flex items-center gap-2",
|
|
47
|
-
children: [/* @__PURE__ */
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
(
|
|
61
|
-
"%"
|
|
102
|
+
g(e.targetAmount, e.currency),
|
|
103
|
+
" · ",
|
|
104
|
+
h(e.targetDate)
|
|
62
105
|
]
|
|
63
106
|
})]
|
|
64
|
-
}),
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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__ */
|
|
122
|
+
/* @__PURE__ */ j(P, { children: [/* @__PURE__ */ j(L, { children: [/* @__PURE__ */ j(R, {
|
|
167
123
|
className: "flex items-center gap-2",
|
|
168
|
-
children: [/* @__PURE__ */
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
className: "
|
|
178
|
-
children:
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
className: "text-
|
|
183
|
-
children:
|
|
184
|
-
})
|
|
185
|
-
className:
|
|
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.
|
|
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__ */
|
|
158
|
+
/* @__PURE__ */ j(P, { children: [/* @__PURE__ */ j(L, { children: [/* @__PURE__ */ j(R, {
|
|
196
159
|
className: "flex items-center gap-2",
|
|
197
|
-
children: [/* @__PURE__ */
|
|
198
|
-
|
|
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:
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
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
|
-
},
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
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
|
-
},
|
|
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 {
|
|
374
|
+
export { re as DashboardPage };
|
|
257
375
|
|
|
258
376
|
//# sourceMappingURL=DashboardPage.js.map
|