@burdenoff/microfe-brainyrich 2026.525.1 → 2026.706.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 +55 -90
- 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/components/ActorName.js +38 -0
- package/dist/brainyrich/components/ActorName.js.map +1 -0
- package/dist/brainyrich/components/ConfirmDialog.js +25 -0
- package/dist/brainyrich/components/ConfirmDialog.js.map +1 -0
- package/dist/brainyrich/components/LoadMore.js +24 -0
- package/dist/brainyrich/components/LoadMore.js.map +1 -0
- package/dist/brainyrich/components/index.js +5 -0
- package/dist/brainyrich/components/notify.js +38 -0
- package/dist/brainyrich/components/notify.js.map +1 -0
- package/dist/brainyrich/components/pickers.js +232 -0
- package/dist/brainyrich/components/pickers.js.map +1 -0
- package/dist/brainyrich/components/reuse/CommentThread.js +208 -0
- package/dist/brainyrich/components/reuse/CommentThread.js.map +1 -0
- package/dist/brainyrich/components/reuse/DocumentsPanel.js +237 -0
- package/dist/brainyrich/components/reuse/DocumentsPanel.js.map +1 -0
- package/dist/brainyrich/components/reuse/TagField.js +206 -0
- package/dist/brainyrich/components/reuse/TagField.js.map +1 -0
- package/dist/brainyrich/components/reuse/transport.js +24 -0
- package/dist/brainyrich/components/reuse/transport.js.map +1 -0
- package/dist/brainyrich/hooks/useBrainyRichApi.js +815 -0
- package/dist/brainyrich/hooks/useBrainyRichApi.js.map +1 -0
- package/dist/brainyrich/index.js +0 -1
- package/dist/brainyrich/pages/AccountsPage.js +743 -160
- package/dist/brainyrich/pages/AccountsPage.js.map +1 -1
- package/dist/brainyrich/pages/AiAssistantPage.js +556 -363
- package/dist/brainyrich/pages/AiAssistantPage.js.map +1 -1
- package/dist/brainyrich/pages/AnalyticsPage.js +601 -268
- package/dist/brainyrich/pages/AnalyticsPage.js.map +1 -1
- package/dist/brainyrich/pages/DashboardPage.js +375 -231
- package/dist/brainyrich/pages/DashboardPage.js.map +1 -1
- package/dist/brainyrich/pages/FamilyPage.js +599 -337
- package/dist/brainyrich/pages/FamilyPage.js.map +1 -1
- package/dist/brainyrich/pages/GoalsPage.js +810 -141
- 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 +867 -156
- package/dist/brainyrich/pages/PortfoliosPage.js.map +1 -1
- package/dist/brainyrich/pages/ReportsPage.js +421 -251
- package/dist/brainyrich/pages/ReportsPage.js.map +1 -1
- package/dist/brainyrich/pages/RiskPage.js +557 -194
- package/dist/brainyrich/pages/RiskPage.js.map +1 -1
- package/dist/brainyrich/pages/TaxPage.js +655 -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/dist/node_modules/sonner/dist/index.js +163 -0
- package/dist/node_modules/sonner/dist/index.js.map +1 -0
- package/package.json +3 -2
- package/dist/brainyrich/pages/AdvisorsPage.js +0 -375
- package/dist/brainyrich/pages/AdvisorsPage.js.map +0 -1
- package/dist/brainyrich/pages/AssistantPage.js +0 -332
- package/dist/brainyrich/pages/AssistantPage.js.map +0 -1
- package/dist/brainyrich/pages/EstatePage.js +0 -269
- package/dist/brainyrich/pages/EstatePage.js.map +0 -1
- package/dist/brainyrich/pages/InsurancePage.js +0 -181
- package/dist/brainyrich/pages/InsurancePage.js.map +0 -1
- package/dist/brainyrich/pages/MarketplacePage.js +0 -450
- package/dist/brainyrich/pages/MarketplacePage.js.map +0 -1
- package/dist/brainyrich/store/brainyrichStore.js +0 -272
- package/dist/brainyrich/store/brainyrichStore.js.map +0 -1
|
@@ -1,258 +1,402 @@
|
|
|
1
1
|
import { tWithFallback as e } from "../utils/i18n.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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 { ConfirmDialog as l } from "../components/ConfirmDialog.js";
|
|
4
|
+
import { HouseholdPicker as u } from "../components/pickers.js";
|
|
5
|
+
import "../components/index.js";
|
|
6
|
+
import { AllocationBars as d, EmptyState as f, ErrorState as p, KpiGrid as m, LoadingState as h, SectionShell as g, formatDate as _, formatMoney as v, statusBadgeVariant as y } from "./_shared.js";
|
|
7
|
+
import { useMemo as b, useState as x } from "react";
|
|
8
|
+
import { Bell as S, Briefcase as C, Check as w, CircleCheck as T, MoreHorizontal as E, PlusCircle as D, Target as O, Wallet as k, X as A } from "lucide-react";
|
|
9
|
+
import { useI18n as j } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
10
|
+
import { jsx as M, jsxs as N } from "react/jsx-runtime";
|
|
11
|
+
import { Badge as P, Button as F, Card as I, CardContent as L, CardDescription as R, CardHeader as z, CardTitle as B, Dialog as V, DialogContent as H, DialogDescription as U, DialogFooter as W, DialogHeader as G, DialogTitle as K, DropdownMenu as q, DropdownMenuContent as J, DropdownMenuItem as Y, DropdownMenuTrigger as X, Input as Z, Label as Q, Select as $, SelectContent as ee, SelectItem as te, SelectTrigger as ne, SelectValue as re } from "@burdenoff/fe-libs/ui";
|
|
8
12
|
//#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
|
-
}
|
|
13
|
+
var ie = [
|
|
14
|
+
"BANK",
|
|
15
|
+
"BROKERAGE",
|
|
16
|
+
"RETIREMENT",
|
|
17
|
+
"CASH",
|
|
18
|
+
"CRYPTO",
|
|
19
|
+
"REAL_ESTATE",
|
|
20
|
+
"ALTERNATIVE",
|
|
21
|
+
"LIABILITY"
|
|
28
22
|
];
|
|
29
|
-
function
|
|
30
|
-
let { t
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
function ae() {
|
|
24
|
+
let { t } = j(), n = (n, r, i) => e(t, n, r, i), r = o(), c = s(), l = i(), u = a({ status: "OPEN" }), x = r.data, w = x?.currency ?? "USD", E = x ? [
|
|
25
|
+
{
|
|
26
|
+
label: n("brainyrich.dashboard.metrics.netWorth", "Net Worth"),
|
|
27
|
+
value: v(x.totalNetWorth, w)
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
label: n("brainyrich.dashboard.metrics.investedAssets", "Invested Assets"),
|
|
31
|
+
value: v(x.totalMarketValue, w)
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
label: n("brainyrich.dashboard.metrics.liquidity", "Cash & Liquidity"),
|
|
35
|
+
value: v(x.totalCash, w)
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
label: n("brainyrich.dashboard.metrics.accounts", "Linked Accounts"),
|
|
39
|
+
value: String(x.accountCount)
|
|
40
|
+
}
|
|
41
|
+
] : [], D = b(() => {
|
|
42
|
+
if (!x) return [];
|
|
43
|
+
let e = x.byAssetClass.reduce((e, t) => e + t.marketValue, 0);
|
|
44
|
+
return e <= 0 ? [] : x.byAssetClass.slice().sort((e, t) => t.marketValue - e.marketValue).map((t) => ({
|
|
45
|
+
label: t.assetClass.replace(/_/g, " "),
|
|
46
|
+
value: t.marketValue / e * 100,
|
|
47
|
+
caption: v(t.marketValue, w)
|
|
48
|
+
}));
|
|
49
|
+
}, [x, w]), A = c.data.slice(0, 5), F = l.data.slice(0, 5), V = u.data.slice(0, 6);
|
|
50
|
+
return /* @__PURE__ */ N(g, {
|
|
51
|
+
title: n("brainyrich.dashboard.title", "Wealth Dashboard"),
|
|
52
|
+
description: n("brainyrich.dashboard.description", "Your consolidated financial overview at a glance"),
|
|
53
|
+
actions: /* @__PURE__ */ M(se, { translate: n }),
|
|
39
54
|
children: [
|
|
40
|
-
/* @__PURE__ */ h
|
|
41
|
-
|
|
55
|
+
r.isLoading ? /* @__PURE__ */ M(h, { rows: 1 }) : r.isError ? /* @__PURE__ */ M(p, {
|
|
56
|
+
title: n("brainyrich.dashboard.netWorthError", "Could not load net worth"),
|
|
57
|
+
onRetry: () => r.refetch()
|
|
58
|
+
}) : x ? /* @__PURE__ */ M(m, { items: E }) : /* @__PURE__ */ M(f, {
|
|
59
|
+
icon: /* @__PURE__ */ M(k, {
|
|
60
|
+
className: "size-6",
|
|
61
|
+
"aria-hidden": "true"
|
|
62
|
+
}),
|
|
63
|
+
title: n("brainyrich.dashboard.noSummary", "No financial data yet"),
|
|
64
|
+
description: n("brainyrich.dashboard.noSummaryDesc", "Link your first account to see your net worth here.")
|
|
65
|
+
}),
|
|
66
|
+
/* @__PURE__ */ N("div", {
|
|
42
67
|
className: "grid gap-6 lg:grid-cols-3",
|
|
43
|
-
children: [/* @__PURE__ */
|
|
68
|
+
children: [/* @__PURE__ */ N(I, {
|
|
44
69
|
className: "lg:col-span-2",
|
|
45
|
-
children: [/* @__PURE__ */
|
|
70
|
+
children: [/* @__PURE__ */ N(z, { children: [/* @__PURE__ */ N(B, {
|
|
46
71
|
className: "flex items-center gap-2",
|
|
47
|
-
children: [/* @__PURE__ */
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
72
|
+
children: [/* @__PURE__ */ M(C, {
|
|
73
|
+
className: "h-5 w-5",
|
|
74
|
+
"aria-hidden": "true"
|
|
75
|
+
}), n("brainyrich.dashboard.sections.assetAllocation", "Asset Allocation")]
|
|
76
|
+
}), /* @__PURE__ */ M(R, { children: n("brainyrich.dashboard.sections.assetAllocationDescription", "Market value distributed across asset classes") })] }), /* @__PURE__ */ M(L, { children: r.isLoading ? /* @__PURE__ */ M(h, { rows: 3 }) : r.isError ? /* @__PURE__ */ M(p, { onRetry: () => r.refetch() }) : D.length > 0 ? /* @__PURE__ */ M(d, { data: D }) : /* @__PURE__ */ M(f, {
|
|
77
|
+
icon: /* @__PURE__ */ M(C, {
|
|
78
|
+
className: "size-6",
|
|
79
|
+
"aria-hidden": "true"
|
|
80
|
+
}),
|
|
81
|
+
title: n("brainyrich.dashboard.noAllocation", "No holdings to allocate"),
|
|
82
|
+
description: n("brainyrich.dashboard.noAllocationDesc", "Add holdings to your accounts to see how your wealth is allocated.")
|
|
83
|
+
}) })]
|
|
84
|
+
}), /* @__PURE__ */ N(I, { children: [/* @__PURE__ */ M(z, {
|
|
85
|
+
className: "pb-3",
|
|
86
|
+
children: /* @__PURE__ */ N(B, {
|
|
87
|
+
className: "flex items-center gap-2 text-base",
|
|
88
|
+
children: [/* @__PURE__ */ M(O, {
|
|
89
|
+
className: "h-4 w-4",
|
|
90
|
+
"aria-hidden": "true"
|
|
91
|
+
}), n("brainyrich.dashboard.sections.goals", "Goals")]
|
|
92
|
+
})
|
|
93
|
+
}), /* @__PURE__ */ M(L, {
|
|
94
|
+
className: "space-y-3",
|
|
95
|
+
children: l.isLoading ? /* @__PURE__ */ M(h, { rows: 3 }) : l.isError ? /* @__PURE__ */ M(p, { onRetry: () => l.refetch() }) : F.length > 0 ? F.map((e) => /* @__PURE__ */ N("div", {
|
|
96
|
+
className: "flex items-start justify-between gap-2 rounded-lg border border-border-subtle p-3",
|
|
97
|
+
children: [/* @__PURE__ */ N("div", {
|
|
98
|
+
className: "min-w-0 space-y-0.5",
|
|
99
|
+
children: [/* @__PURE__ */ M("p", {
|
|
100
|
+
className: "truncate text-sm font-medium text-text-primary",
|
|
101
|
+
children: e.name
|
|
102
|
+
}), /* @__PURE__ */ N("p", {
|
|
103
|
+
className: "text-xs text-text-secondary",
|
|
68
104
|
children: [
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
})
|
|
105
|
+
v(e.targetAmount, e.currency),
|
|
106
|
+
" · ",
|
|
107
|
+
_(e.targetDate)
|
|
100
108
|
]
|
|
101
|
-
}, e.id);
|
|
102
|
-
})]
|
|
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
109
|
})]
|
|
129
|
-
},
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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);
|
|
110
|
+
}), /* @__PURE__ */ M(P, {
|
|
111
|
+
variant: y(e.projection),
|
|
112
|
+
className: "shrink-0",
|
|
113
|
+
children: e.projection.replace(/_/g, " ")
|
|
162
114
|
})]
|
|
163
|
-
})
|
|
164
|
-
|
|
115
|
+
}, e.id)) : /* @__PURE__ */ M(f, {
|
|
116
|
+
icon: /* @__PURE__ */ M(O, {
|
|
117
|
+
className: "size-6",
|
|
118
|
+
"aria-hidden": "true"
|
|
119
|
+
}),
|
|
120
|
+
title: n("brainyrich.dashboard.noGoals", "No goals yet"),
|
|
121
|
+
description: n("brainyrich.dashboard.noGoalsDesc", "Set a financial goal to start tracking progress.")
|
|
122
|
+
})
|
|
123
|
+
})] })]
|
|
165
124
|
}),
|
|
166
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ N(I, { children: [/* @__PURE__ */ N(z, { children: [/* @__PURE__ */ N(B, {
|
|
167
126
|
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
|
-
]
|
|
127
|
+
children: [/* @__PURE__ */ M(k, {
|
|
128
|
+
className: "h-5 w-5",
|
|
129
|
+
"aria-hidden": "true"
|
|
130
|
+
}), n("brainyrich.dashboard.sections.portfolios", "Portfolios")]
|
|
131
|
+
}), /* @__PURE__ */ M(R, { children: n("brainyrich.dashboard.sections.portfoliosDescription", "Your active investment strategies") })] }), /* @__PURE__ */ M(L, { children: c.isLoading ? /* @__PURE__ */ M(h, { rows: 3 }) : c.isError ? /* @__PURE__ */ M(p, { onRetry: () => c.refetch() }) : A.length > 0 ? /* @__PURE__ */ M("div", {
|
|
132
|
+
className: "grid gap-3 sm:grid-cols-2",
|
|
133
|
+
children: A.map((e) => /* @__PURE__ */ N("div", {
|
|
134
|
+
className: "flex items-start justify-between gap-2 rounded-lg border border-border-subtle p-3",
|
|
135
|
+
children: [/* @__PURE__ */ N("div", {
|
|
136
|
+
className: "min-w-0 space-y-0.5",
|
|
137
|
+
children: [/* @__PURE__ */ M("p", {
|
|
138
|
+
className: "truncate text-sm font-medium text-text-primary",
|
|
139
|
+
children: e.name
|
|
140
|
+
}), e.description ? /* @__PURE__ */ M("p", {
|
|
141
|
+
className: "truncate text-xs text-text-secondary",
|
|
142
|
+
children: e.description
|
|
143
|
+
}) : /* @__PURE__ */ M("p", {
|
|
144
|
+
className: "text-xs text-text-secondary",
|
|
145
|
+
children: e.baseCurrency
|
|
191
146
|
})]
|
|
147
|
+
}), /* @__PURE__ */ M(P, {
|
|
148
|
+
variant: y(e.status),
|
|
149
|
+
className: "shrink-0",
|
|
150
|
+
children: e.status
|
|
192
151
|
})]
|
|
193
|
-
}, e.
|
|
152
|
+
}, e.id))
|
|
153
|
+
}) : /* @__PURE__ */ M(f, {
|
|
154
|
+
icon: /* @__PURE__ */ M(k, {
|
|
155
|
+
className: "size-6",
|
|
156
|
+
"aria-hidden": "true"
|
|
157
|
+
}),
|
|
158
|
+
title: n("brainyrich.dashboard.noPortfolios", "No portfolios yet"),
|
|
159
|
+
description: n("brainyrich.dashboard.noPortfoliosDesc", "Create a portfolio to organize your investment strategy.")
|
|
194
160
|
}) })] }),
|
|
195
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ N(I, { children: [/* @__PURE__ */ N(z, { children: [/* @__PURE__ */ N(B, {
|
|
196
162
|
className: "flex items-center gap-2",
|
|
197
|
-
children: [/* @__PURE__ */
|
|
198
|
-
|
|
163
|
+
children: [/* @__PURE__ */ M(S, {
|
|
164
|
+
className: "h-5 w-5",
|
|
165
|
+
"aria-hidden": "true"
|
|
166
|
+
}), n("brainyrich.dashboard.sections.needsAttention", "Needs Attention")]
|
|
167
|
+
}), /* @__PURE__ */ M(R, { children: n("brainyrich.dashboard.sections.needsAttentionDescription", "Open insights that may require action") })] }), /* @__PURE__ */ M(L, {
|
|
199
168
|
className: "space-y-3",
|
|
200
|
-
children:
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
169
|
+
children: u.isLoading ? /* @__PURE__ */ M(h, { rows: 3 }) : u.isError ? /* @__PURE__ */ M(p, { onRetry: () => u.refetch() }) : V.length > 0 ? V.map((e) => /* @__PURE__ */ M(oe, {
|
|
170
|
+
insight: e,
|
|
171
|
+
translate: n
|
|
172
|
+
}, e.id)) : /* @__PURE__ */ M(f, {
|
|
173
|
+
icon: /* @__PURE__ */ M(T, {
|
|
174
|
+
className: "size-6",
|
|
175
|
+
"aria-hidden": "true"
|
|
176
|
+
}),
|
|
177
|
+
title: n("brainyrich.dashboard.noInsights", "All clear"),
|
|
178
|
+
description: n("brainyrich.dashboard.noInsightsDesc", "There are no open insights that need your attention.")
|
|
179
|
+
})
|
|
180
|
+
})] })
|
|
181
|
+
]
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
function oe({ insight: e, translate: n }) {
|
|
185
|
+
let i = t(), a = r(), o = c(), [s, u] = x(!1), d = i.isPending || a.isPending || o.isPending;
|
|
186
|
+
return /* @__PURE__ */ N("div", {
|
|
187
|
+
className: "flex items-start justify-between gap-3 rounded-lg border border-border-subtle p-3",
|
|
188
|
+
children: [
|
|
189
|
+
/* @__PURE__ */ N("div", {
|
|
190
|
+
className: "min-w-0 space-y-1",
|
|
191
|
+
children: [
|
|
192
|
+
/* @__PURE__ */ N("div", {
|
|
193
|
+
className: "flex items-center gap-2",
|
|
194
|
+
children: [/* @__PURE__ */ M(P, {
|
|
195
|
+
variant: y(e.severity),
|
|
196
|
+
children: e.severity
|
|
197
|
+
}), /* @__PURE__ */ M("span", {
|
|
198
|
+
className: "text-xs text-text-secondary",
|
|
199
|
+
children: e.type.replace(/_/g, " ")
|
|
214
200
|
})]
|
|
215
|
-
}),
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
201
|
+
}),
|
|
202
|
+
/* @__PURE__ */ M("p", {
|
|
203
|
+
className: "text-sm font-medium text-text-primary",
|
|
204
|
+
children: e.title
|
|
205
|
+
}),
|
|
206
|
+
e.detail ? /* @__PURE__ */ M("p", {
|
|
207
|
+
className: "text-xs text-text-secondary",
|
|
208
|
+
children: e.detail
|
|
209
|
+
}) : null
|
|
210
|
+
]
|
|
211
|
+
}),
|
|
212
|
+
/* @__PURE__ */ N(q, { children: [/* @__PURE__ */ M(X, {
|
|
213
|
+
asChild: !0,
|
|
214
|
+
children: /* @__PURE__ */ M(F, {
|
|
215
|
+
variant: "ghost",
|
|
216
|
+
size: "icon",
|
|
217
|
+
className: "shrink-0",
|
|
218
|
+
disabled: d,
|
|
219
|
+
"aria-label": n("brainyrich.dashboard.insightActions", "Insight actions"),
|
|
220
|
+
children: /* @__PURE__ */ M(E, {
|
|
221
|
+
className: "size-4",
|
|
222
|
+
"aria-hidden": "true"
|
|
223
|
+
})
|
|
224
|
+
})
|
|
225
|
+
}), /* @__PURE__ */ N(J, {
|
|
226
|
+
align: "end",
|
|
223
227
|
children: [
|
|
224
|
-
{
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
228
|
+
/* @__PURE__ */ N(Y, {
|
|
229
|
+
onSelect: () => i.mutate(e.id),
|
|
230
|
+
children: [/* @__PURE__ */ M(w, {
|
|
231
|
+
className: "size-4",
|
|
232
|
+
"aria-hidden": "true"
|
|
233
|
+
}), n("brainyrich.dashboard.insight.acknowledge", "Acknowledge")]
|
|
234
|
+
}),
|
|
235
|
+
/* @__PURE__ */ N(Y, {
|
|
236
|
+
onSelect: () => o.mutate(e.id),
|
|
237
|
+
children: [/* @__PURE__ */ M(T, {
|
|
238
|
+
className: "size-4",
|
|
239
|
+
"aria-hidden": "true"
|
|
240
|
+
}), n("brainyrich.dashboard.insight.resolve", "Resolve")]
|
|
241
|
+
}),
|
|
242
|
+
/* @__PURE__ */ N(Y, {
|
|
243
|
+
onSelect: () => u(!0),
|
|
244
|
+
children: [/* @__PURE__ */ M(A, {
|
|
245
|
+
className: "size-4",
|
|
246
|
+
"aria-hidden": "true"
|
|
247
|
+
}), n("brainyrich.dashboard.insight.dismiss", "Dismiss")]
|
|
248
|
+
})
|
|
249
|
+
]
|
|
250
|
+
})] }),
|
|
251
|
+
/* @__PURE__ */ M(l, {
|
|
252
|
+
open: s,
|
|
253
|
+
onOpenChange: u,
|
|
254
|
+
title: n("brainyrich.dashboard.insight.dismissTitle", "Dismiss this insight?"),
|
|
255
|
+
description: n("brainyrich.dashboard.insight.dismissDescription", "It will be removed from Needs Attention. You can still find it in the full insights list."),
|
|
256
|
+
confirmLabel: n("brainyrich.dashboard.insight.dismiss", "Dismiss"),
|
|
257
|
+
pendingLabel: n("brainyrich.dashboard.insight.dismissing", "Dismissing…"),
|
|
258
|
+
destructive: !0,
|
|
259
|
+
pending: a.isPending,
|
|
260
|
+
onConfirm: () => a.mutate(e.id, { onSuccess: () => u(!1) })
|
|
251
261
|
})
|
|
252
262
|
]
|
|
253
263
|
});
|
|
254
264
|
}
|
|
265
|
+
function se({ translate: e }) {
|
|
266
|
+
let [t, r] = x(!1), [i, a] = x(""), [o, s] = x("BROKERAGE"), [c, l] = x(""), [d, f] = x(""), [p, m] = x("USD"), [h, g] = x(null), _ = n(), v = i.trim(), y = v.length > 0 && !_.isPending, b = () => {
|
|
267
|
+
a(""), s("BROKERAGE"), l(""), f(""), m("USD"), g(null), _.reset();
|
|
268
|
+
};
|
|
269
|
+
return /* @__PURE__ */ N(V, {
|
|
270
|
+
open: t,
|
|
271
|
+
onOpenChange: (e) => {
|
|
272
|
+
r(e), e || b();
|
|
273
|
+
},
|
|
274
|
+
children: [/* @__PURE__ */ N(F, {
|
|
275
|
+
size: "sm",
|
|
276
|
+
onClick: () => r(!0),
|
|
277
|
+
children: [/* @__PURE__ */ M(D, {
|
|
278
|
+
className: "size-4",
|
|
279
|
+
"aria-hidden": "true"
|
|
280
|
+
}), e("brainyrich.dashboard.actions.newAccount", "New Account")]
|
|
281
|
+
}), /* @__PURE__ */ M(H, { children: /* @__PURE__ */ N("form", {
|
|
282
|
+
onSubmit: (e) => {
|
|
283
|
+
if (e.preventDefault(), !y) return;
|
|
284
|
+
let t = Number.parseFloat(d), n = {
|
|
285
|
+
name: v,
|
|
286
|
+
type: o,
|
|
287
|
+
currency: p.trim() || "USD",
|
|
288
|
+
isManual: !0,
|
|
289
|
+
...c.trim() ? { institution: c.trim() } : {},
|
|
290
|
+
...Number.isFinite(t) ? { cashBalance: t } : {},
|
|
291
|
+
...h ? { householdId: h } : {}
|
|
292
|
+
};
|
|
293
|
+
_.mutate(n, { onSuccess: () => {
|
|
294
|
+
b(), r(!1);
|
|
295
|
+
} });
|
|
296
|
+
},
|
|
297
|
+
className: "space-y-4",
|
|
298
|
+
children: [
|
|
299
|
+
/* @__PURE__ */ N(G, { children: [/* @__PURE__ */ M(K, { children: e("brainyrich.dashboard.newAccount.title", "New Account") }), /* @__PURE__ */ M(U, { children: e("brainyrich.dashboard.newAccount.description", "Add a manual account to track alongside your linked institutions.") })] }),
|
|
300
|
+
/* @__PURE__ */ N("div", {
|
|
301
|
+
className: "space-y-2",
|
|
302
|
+
children: [/* @__PURE__ */ M(Q, {
|
|
303
|
+
htmlFor: "bra-account-name",
|
|
304
|
+
children: e("brainyrich.dashboard.newAccount.name", "Account name")
|
|
305
|
+
}), /* @__PURE__ */ M(Z, {
|
|
306
|
+
id: "bra-account-name",
|
|
307
|
+
value: i,
|
|
308
|
+
onChange: (e) => a(e.target.value),
|
|
309
|
+
placeholder: e("brainyrich.dashboard.newAccount.namePlaceholder", "e.g. Fidelity Brokerage"),
|
|
310
|
+
required: !0,
|
|
311
|
+
autoFocus: !0
|
|
312
|
+
})]
|
|
313
|
+
}),
|
|
314
|
+
/* @__PURE__ */ N("div", {
|
|
315
|
+
className: "grid gap-4 sm:grid-cols-2",
|
|
316
|
+
children: [/* @__PURE__ */ N("div", {
|
|
317
|
+
className: "space-y-2",
|
|
318
|
+
children: [/* @__PURE__ */ M(Q, {
|
|
319
|
+
htmlFor: "bra-account-type",
|
|
320
|
+
children: e("brainyrich.dashboard.newAccount.type", "Type")
|
|
321
|
+
}), /* @__PURE__ */ N($, {
|
|
322
|
+
value: o,
|
|
323
|
+
onValueChange: (e) => s(e),
|
|
324
|
+
children: [/* @__PURE__ */ M(ne, {
|
|
325
|
+
id: "bra-account-type",
|
|
326
|
+
children: /* @__PURE__ */ M(re, {})
|
|
327
|
+
}), /* @__PURE__ */ M(ee, { children: ie.map((e) => /* @__PURE__ */ M(te, {
|
|
328
|
+
value: e,
|
|
329
|
+
children: e.replace(/_/g, " ")
|
|
330
|
+
}, e)) })]
|
|
331
|
+
})]
|
|
332
|
+
}), /* @__PURE__ */ N("div", {
|
|
333
|
+
className: "space-y-2",
|
|
334
|
+
children: [/* @__PURE__ */ M(Q, {
|
|
335
|
+
htmlFor: "bra-account-currency",
|
|
336
|
+
children: e("brainyrich.dashboard.newAccount.currency", "Currency")
|
|
337
|
+
}), /* @__PURE__ */ M(Z, {
|
|
338
|
+
id: "bra-account-currency",
|
|
339
|
+
value: p,
|
|
340
|
+
onChange: (e) => m(e.target.value.toUpperCase()),
|
|
341
|
+
maxLength: 3
|
|
342
|
+
})]
|
|
343
|
+
})]
|
|
344
|
+
}),
|
|
345
|
+
/* @__PURE__ */ N("div", {
|
|
346
|
+
className: "space-y-2",
|
|
347
|
+
children: [/* @__PURE__ */ M(Q, {
|
|
348
|
+
htmlFor: "bra-account-institution",
|
|
349
|
+
children: e("brainyrich.dashboard.newAccount.institution", "Institution (optional)")
|
|
350
|
+
}), /* @__PURE__ */ M(Z, {
|
|
351
|
+
id: "bra-account-institution",
|
|
352
|
+
value: c,
|
|
353
|
+
onChange: (e) => l(e.target.value),
|
|
354
|
+
placeholder: e("brainyrich.dashboard.newAccount.institutionPlaceholder", "e.g. Fidelity")
|
|
355
|
+
})]
|
|
356
|
+
}),
|
|
357
|
+
/* @__PURE__ */ M(u, {
|
|
358
|
+
id: "bra-account-household",
|
|
359
|
+
value: h,
|
|
360
|
+
onChange: g,
|
|
361
|
+
label: e("brainyrich.dashboard.newAccount.household", "Household (optional)"),
|
|
362
|
+
noneLabel: e("brainyrich.dashboard.newAccount.noHousehold", "No household"),
|
|
363
|
+
disabled: _.isPending
|
|
364
|
+
}),
|
|
365
|
+
/* @__PURE__ */ N("div", {
|
|
366
|
+
className: "space-y-2",
|
|
367
|
+
children: [/* @__PURE__ */ M(Q, {
|
|
368
|
+
htmlFor: "bra-account-cash",
|
|
369
|
+
children: e("brainyrich.dashboard.newAccount.cash", "Cash balance (optional)")
|
|
370
|
+
}), /* @__PURE__ */ M(Z, {
|
|
371
|
+
id: "bra-account-cash",
|
|
372
|
+
type: "number",
|
|
373
|
+
inputMode: "decimal",
|
|
374
|
+
step: "0.01",
|
|
375
|
+
value: d,
|
|
376
|
+
onChange: (e) => f(e.target.value),
|
|
377
|
+
placeholder: "0.00"
|
|
378
|
+
})]
|
|
379
|
+
}),
|
|
380
|
+
_.isError ? /* @__PURE__ */ M("p", {
|
|
381
|
+
className: "text-sm text-status-error-text",
|
|
382
|
+
children: _.error instanceof Error ? _.error.message : e("brainyrich.dashboard.newAccount.error", "Could not create account.")
|
|
383
|
+
}) : null,
|
|
384
|
+
/* @__PURE__ */ N(W, { children: [/* @__PURE__ */ M(F, {
|
|
385
|
+
type: "button",
|
|
386
|
+
variant: "outline",
|
|
387
|
+
onClick: () => r(!1),
|
|
388
|
+
disabled: _.isPending,
|
|
389
|
+
children: e("brainyrich.common.cancel", "Cancel")
|
|
390
|
+
}), /* @__PURE__ */ M(F, {
|
|
391
|
+
type: "submit",
|
|
392
|
+
disabled: !y,
|
|
393
|
+
children: _.isPending ? e("brainyrich.dashboard.newAccount.creating", "Creating…") : e("brainyrich.dashboard.newAccount.create", "Create account")
|
|
394
|
+
})] })
|
|
395
|
+
]
|
|
396
|
+
}) })]
|
|
397
|
+
});
|
|
398
|
+
}
|
|
255
399
|
//#endregion
|
|
256
|
-
export {
|
|
400
|
+
export { ae as DashboardPage };
|
|
257
401
|
|
|
258
402
|
//# sourceMappingURL=DashboardPage.js.map
|