@burdenoff/microfe-brainyrich 2026.525.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 (45) 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/pages/AdvisorsPage.js +0 -375
  35. package/dist/brainyrich/pages/AdvisorsPage.js.map +0 -1
  36. package/dist/brainyrich/pages/AssistantPage.js +0 -332
  37. package/dist/brainyrich/pages/AssistantPage.js.map +0 -1
  38. package/dist/brainyrich/pages/EstatePage.js +0 -269
  39. package/dist/brainyrich/pages/EstatePage.js.map +0 -1
  40. package/dist/brainyrich/pages/InsurancePage.js +0 -181
  41. package/dist/brainyrich/pages/InsurancePage.js.map +0 -1
  42. package/dist/brainyrich/pages/MarketplacePage.js +0 -450
  43. package/dist/brainyrich/pages/MarketplacePage.js.map +0 -1
  44. package/dist/brainyrich/store/brainyrichStore.js +0 -272
  45. package/dist/brainyrich/store/brainyrichStore.js.map +0 -1
@@ -1,389 +1,563 @@
1
1
  import { tWithFallback as e } from "../utils/i18n.js";
2
- import { useBrainyRichStore as t } from "../store/brainyrichStore.js";
3
- import { SectionShell as n, formatMoney as r } from "./_shared.js";
4
- import { useEffect as i, useRef as a, useState as o } from "react";
5
- import { Bot as s, Calculator as c, Clock as l, FileText as u, Lightbulb as d, Mic as f, Paperclip as p, PieChart as m, Plus as h, Send as g, Sparkles as _, TrendingUp as v, User as y } from "lucide-react";
6
- import { useI18n as b } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
7
- import { jsx as x, jsxs as S } from "react/jsx-runtime";
8
- import { Badge as C, Button as w, Card as T, CardContent as E, CardDescription as D, CardHeader as O, CardTitle as k, Input as A } from "@burdenoff/fe-libs/ui";
2
+ import { useAcknowledgeInsight as t, useCreateInsight as n, useDismissInsight as r, useInsights as i, useResolveInsight as a } from "../hooks/useBrainyRichApi.js";
3
+ import { EmptyState as o, ErrorState as s, KpiGrid as c, LoadingState as l, SectionShell as u, formatDate as d, statusBadgeVariant as f } from "./_shared.js";
4
+ import { useMemo as p, useState as m } from "react";
5
+ import { AlertTriangle as h, BellRing as g, CheckCircle2 as _, Info as v, Lightbulb as y, MoreHorizontal as b, Plus as ee, ShieldAlert as x, XCircle as S } from "lucide-react";
6
+ import { useI18n as te } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
7
+ import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
8
+ import { Badge as E, Button as D, Card as O, CardContent as k, CardDescription as ne, CardHeader as re, CardTitle as A, Dialog as j, DialogContent as M, DialogDescription as N, DialogFooter as P, DialogHeader as F, DialogTitle as I, DropdownMenu as L, DropdownMenuContent as R, DropdownMenuItem as z, DropdownMenuSeparator as B, DropdownMenuTrigger as V, Input as H, Label as U, Select as W, SelectContent as G, SelectItem as K, SelectTrigger as q, SelectValue as J, Textarea as Y } from "@burdenoff/fe-libs/ui";
9
9
  //#region src/brainyrich/pages/AiAssistantPage.tsx
10
- var j = 0;
11
- function M() {
12
- return j += 1, `msg-${j}`;
10
+ var X = [
11
+ "REBALANCE_DUE",
12
+ "DRIFT",
13
+ "CONCENTRATION_RISK",
14
+ "CASH_DRAG",
15
+ "FEE_ANOMALY",
16
+ "TAX_OPPORTUNITY",
17
+ "GOAL_AT_RISK"
18
+ ], ie = [
19
+ "INFO",
20
+ "LOW",
21
+ "MEDIUM",
22
+ "HIGH",
23
+ "CRITICAL"
24
+ ], ae = [
25
+ "OPEN",
26
+ "ACKNOWLEDGED",
27
+ "RESOLVED",
28
+ "DISMISSED"
29
+ ], Z = "__all__";
30
+ function Q(e) {
31
+ return e.toLowerCase().split("_").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" ");
13
32
  }
14
- var N = [
15
- {
16
- id: "1",
17
- titleKey: "brainyrich.aiAssistant.sessions.taxPlanningStrategy",
18
- titleFallback: "Tax Planning Strategy",
19
- title: "Tax Planning Strategy",
20
- lastMessage: /* @__PURE__ */ new Date(Date.now() - 1e3 * 60 * 30),
21
- messageCount: 12
22
- },
23
- {
24
- id: "2",
25
- titleKey: "brainyrich.aiAssistant.sessions.portfolioRebalancingQ2",
26
- titleFallback: "Portfolio Rebalancing Q2",
27
- title: "Portfolio Rebalancing Q2",
28
- lastMessage: /* @__PURE__ */ new Date(Date.now() - 1e3 * 60 * 60 * 2),
29
- messageCount: 8
30
- },
31
- {
32
- id: "3",
33
- titleKey: "brainyrich.aiAssistant.sessions.estateNomineeUpdate",
34
- titleFallback: "Estate Nominee Update",
35
- title: "Estate Nominee Update",
36
- lastMessage: /* @__PURE__ */ new Date(Date.now() - 1e3 * 60 * 60 * 24),
37
- messageCount: 15
38
- },
39
- {
40
- id: "4",
41
- titleKey: "brainyrich.aiAssistant.sessions.retirementCorpusReview",
42
- titleFallback: "Retirement Corpus Review",
43
- title: "Retirement Corpus Review",
44
- lastMessage: /* @__PURE__ */ new Date(Date.now() - 1e3 * 60 * 60 * 48),
45
- messageCount: 6
46
- }
47
- ], P = [
48
- {
49
- key: "brainyrich.aiAssistant.suggestions.portfolioPerformance",
50
- fallback: "Analyze my portfolio performance",
51
- icon: v
52
- },
53
- {
54
- key: "brainyrich.aiAssistant.suggestions.taxOptimization",
55
- fallback: "Tax optimization strategies for FY 2026-27",
56
- icon: c
57
- },
58
- {
59
- key: "brainyrich.aiAssistant.suggestions.retirementCorpus",
60
- fallback: "Review my retirement corpus projections",
61
- icon: m
62
- },
63
- {
64
- key: "brainyrich.aiAssistant.suggestions.estateChecklist",
65
- fallback: "Estate planning checklist for nominees",
66
- icon: u
33
+ function oe(e) {
34
+ switch (e) {
35
+ case "CRITICAL": return {
36
+ icon: x,
37
+ tone: "text-status-error-text"
38
+ };
39
+ case "HIGH": return {
40
+ icon: h,
41
+ tone: "text-status-error-text"
42
+ };
43
+ case "MEDIUM": return {
44
+ icon: g,
45
+ tone: "text-status-warning-text"
46
+ };
47
+ case "LOW": return {
48
+ icon: y,
49
+ tone: "text-status-warning-text"
50
+ };
51
+ default: return {
52
+ icon: v,
53
+ tone: "text-text-secondary"
54
+ };
67
55
  }
68
- ];
69
- function F(e) {
70
- let t = Date.now() - e.getTime(), n = Math.floor(t / 6e4);
71
- if (n < 60) return `${n}m ago`;
72
- let r = Math.floor(n / 60);
73
- return r < 24 ? `${r}h ago` : `${Math.floor(r / 24)}d ago`;
74
56
  }
75
- function I(e, t) {
76
- let n = e.toLowerCase();
77
- return n.includes("tax") || n.includes("80c") || n.includes("deduction") ? `Based on your current tax documents, you have room to optimize Section 80C and 80D deductions. With your net worth of ${t.netWorth}, I recommend maximizing ELSS investments and NPS contributions. Your capital gains statement shows opportunities for tax-loss harvesting worth approximately $3,200. Shall I generate a detailed FY 2026-27 tax plan?` : n.includes("portfolio") || n.includes("invest") || n.includes("stock") || n.includes("rebalanc") ? `Your total portfolio value stands at ${t.portfolioValue} across three strategies. The Growth Portfolio leads YTD returns at 12.4%, but technology concentration has exceeded the 34% threshold. I suggest trimming AAPL/MSFT positions by 5% and rotating into international diversified ETFs. Want me to model a rebalancing scenario?` : n.includes("retire") || n.includes("corpus") || n.includes("pension") ? "Your Retirement Corpus goal is 61.6% funded ($1.54M of $2.5M target by 2035). At your current savings rate, you'll reach 82% by deadline. Increasing SIP contributions by $500/month and utilizing catch-up NPS deposits could close the gap entirely. Shall I run a Monte Carlo simulation for different scenarios?" : n.includes("estate") || n.includes("nominee") || n.includes("will") || n.includes("trust") ? "Your estate planning workflow has a pending nominee update task. Based on your assets, I recommend reviewing beneficiary designations across all linked accounts and updating your healthcare directive. Your current life cover of $200K (2Cr) from HDFC Life may need reassessment given dependents. Would you like a comprehensive estate planning checklist?" : `I can help with investment analysis, tax optimization, retirement planning, estate strategies, and general wealth management. With your current net worth of ${t.netWorth} and active risk alerts to address, there are several areas we can focus on. What specific aspect of your finances would you like to explore?`;
57
+ function se() {
58
+ return {
59
+ title: "",
60
+ type: "DRIFT",
61
+ severity: "MEDIUM",
62
+ subjectType: "PORTFOLIO",
63
+ subjectId: "",
64
+ detail: "",
65
+ metrics: "",
66
+ ownerId: ""
67
+ };
78
68
  }
79
- function L() {
80
- let { t: c } = b(), { metrics: u, portfolios: m, risks: v } = t(), j = m.reduce((e, t) => e + t.value, 0), L = (t, n, r) => e(c, t, n, r), R = v.filter((e) => e.severity === "High").length, z = N.map((e) => ({
81
- ...e,
82
- title: L(e.titleKey, e.titleFallback)
83
- })), B = P.map((e) => ({
84
- ...e,
85
- text: L(e.key, e.fallback)
86
- })), V = u.find((e) => e.label === "Net Worth")?.value ?? r(j), [H, U] = o([{
87
- id: "1",
88
- content: L("brainyrich.aiAssistant.welcomeMessage", "Welcome back! I'm your AI wealth assistant. Your portfolio is at {portfolioValue} with {highRiskCount} high-priority risk alert{sSuffix} needing attention. How can I help you today?", {
89
- portfolioValue: r(j),
90
- highRiskCount: R,
91
- sSuffix: R === 1 ? "" : "s"
92
- }),
93
- sender: "assistant",
94
- timestamp: /* @__PURE__ */ new Date(),
95
- type: "text"
96
- }]), [W, G] = o(""), [K, q] = o(!1), [J, Y] = o("new"), X = a(null), Z = a(null);
97
- i(() => {
98
- X.current?.scrollIntoView({ behavior: "smooth" });
99
- }, [H]);
100
- let Q = () => {
101
- if (!W.trim() || K) return;
102
- let e = {
103
- id: M(),
104
- content: W,
105
- sender: "user",
106
- timestamp: /* @__PURE__ */ new Date(0),
107
- type: "text"
69
+ function $() {
70
+ let { t: d } = te(), f = (t, n, r) => e(d, t, n, r), [h, _] = m(Z), [v, y] = m(Z), [b, x] = m(Z), { data: S, isLoading: E, isError: ne, refetch: re } = i({
71
+ ...h === Z ? {} : { severity: h },
72
+ ...v === Z ? {} : { status: v }
73
+ }), A = t(), j = r(), M = a(), N = n(), [P, F] = m(!1), [I, L] = m(se), R = (e, t) => L((n) => ({
74
+ ...n,
75
+ [e]: t
76
+ })), z = p(() => b === Z ? S : S.filter((e) => e.type === b), [S, b]), B = p(() => ({
77
+ open: S.filter((e) => e.status === "OPEN").length,
78
+ urgent: S.filter((e) => e.severity === "HIGH" || e.severity === "CRITICAL").length,
79
+ resolved: S.filter((e) => e.status === "RESOLVED").length
80
+ }), [S]), V = p(() => {
81
+ if (!I.metrics.trim()) return !0;
82
+ try {
83
+ return JSON.parse(I.metrics), !0;
84
+ } catch {
85
+ return !1;
86
+ }
87
+ }, [I.metrics]), H = I.title.trim().length > 0 && I.subjectType.trim().length > 0 && I.subjectId.trim().length > 0 && V, Y = () => {
88
+ L(se()), F(!0);
89
+ }, oe = () => {
90
+ if (!H) return;
91
+ let e;
92
+ if (I.metrics.trim()) try {
93
+ e = JSON.parse(I.metrics);
94
+ } catch {
95
+ return;
96
+ }
97
+ let t = {
98
+ title: I.title.trim(),
99
+ type: I.type,
100
+ severity: I.severity,
101
+ subjectType: I.subjectType.trim(),
102
+ subjectId: I.subjectId.trim(),
103
+ detail: I.detail.trim() || null,
104
+ ...e ? { metrics: e } : {},
105
+ ...I.ownerId.trim() ? { ownerId: I.ownerId.trim() } : {}
108
106
  };
109
- U((t) => [...t, e]), G(""), q(!0), setTimeout(() => {
110
- let e = I(W, {
111
- netWorth: V,
112
- portfolioValue: r(j)
113
- }), t = {
114
- id: (Date.now() + 1).toString(),
115
- content: e,
116
- sender: "assistant",
117
- timestamp: /* @__PURE__ */ new Date(),
118
- type: "text",
119
- metadata: {
120
- confidence: .92,
121
- sources: ["Financial Planning Standards", "Portfolio Analytics Engine"],
122
- relatedTopics: [
123
- "Tax Planning",
124
- "Retirement Planning",
125
- "Risk Management"
126
- ]
107
+ N.mutate(t, { onSuccess: () => F(!1) });
108
+ }, $ = h !== Z || v !== Z || b !== Z;
109
+ return /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(u, {
110
+ title: f("brainyrich.insights.title", "Insights"),
111
+ description: f("brainyrich.insights.description", "Advisory insights across portfolios, accounts and goals — triage, acknowledge and resolve."),
112
+ badges: [f("brainyrich.insights.badges.advisory", "Advisory")],
113
+ actionLabel: f("brainyrich.insights.actions.create", "New insight"),
114
+ onAction: Y,
115
+ children: E ? /* @__PURE__ */ w(l, { rows: 4 }) : ne ? /* @__PURE__ */ w(s, {
116
+ title: f("brainyrich.insights.error.title", "Could not load insights"),
117
+ description: f("brainyrich.insights.error.description", "We could not reach the insights service. Please try again."),
118
+ onRetry: () => re()
119
+ }) : /* @__PURE__ */ T(C, { children: [
120
+ /* @__PURE__ */ w(c, { items: [
121
+ {
122
+ label: f("brainyrich.insights.metrics.total", "Insights"),
123
+ value: String(S.length),
124
+ trend: f("brainyrich.insights.metrics.totalTrend", "In your inbox")
125
+ },
126
+ {
127
+ label: f("brainyrich.insights.metrics.open", "Open"),
128
+ value: String(B.open),
129
+ trend: f("brainyrich.insights.metrics.openTrend", "Awaiting action"),
130
+ deltaTone: B.open > 0 ? "negative" : "positive"
131
+ },
132
+ {
133
+ label: f("brainyrich.insights.metrics.urgent", "High priority"),
134
+ value: String(B.urgent),
135
+ trend: f("brainyrich.insights.metrics.urgentTrend", "High or critical"),
136
+ deltaTone: B.urgent > 0 ? "negative" : "positive"
137
+ },
138
+ {
139
+ label: f("brainyrich.insights.metrics.resolved", "Resolved"),
140
+ value: String(B.resolved),
141
+ trend: f("brainyrich.insights.metrics.resolvedTrend", "Closed out"),
142
+ deltaTone: "positive"
127
143
  }
128
- };
129
- U((e) => [...e, t]), q(!1);
130
- }, 1500);
131
- }, $ = (e) => {
132
- G(e), Z.current?.focus();
133
- };
134
- return /* @__PURE__ */ x(n, {
135
- title: L("brainyrich.aiAssistant.title", "AI Wealth Assistant"),
136
- description: L("brainyrich.aiAssistant.description", "Personalized financial advice powered by artificial intelligence"),
137
- badges: [L("brainyrich.aiAssistant.badges.aiPowered", "AI Powered")],
138
- actionLabel: L("brainyrich.aiAssistant.actions.exportChat", "Export Chat"),
139
- children: /* @__PURE__ */ S("div", {
140
- className: "grid grid-cols-1 gap-6 lg:grid-cols-4",
141
- style: { minHeight: "calc(100vh - 280px)" },
142
- children: [/* @__PURE__ */ S("div", {
143
- className: "space-y-3 lg:col-span-1",
144
+ ] }),
145
+ /* @__PURE__ */ w(O, { children: /* @__PURE__ */ T(k, {
146
+ className: "flex flex-col gap-3 p-4 sm:flex-row sm:items-end",
144
147
  children: [
145
- /* @__PURE__ */ S(w, {
146
- variant: "outline",
147
- className: "w-full justify-start gap-2",
148
- onClick: () => Y("new"),
149
- children: [/* @__PURE__ */ x(h, { className: "h-4 w-4" }), L("brainyrich.aiAssistant.actions.newConversation", "New Conversation")]
148
+ /* @__PURE__ */ T("div", {
149
+ className: "w-full space-y-1.5 sm:w-48",
150
+ children: [/* @__PURE__ */ w(U, {
151
+ htmlFor: "insight-filter-severity",
152
+ children: f("brainyrich.insights.filters.severity", "Severity")
153
+ }), /* @__PURE__ */ T(W, {
154
+ value: h,
155
+ onValueChange: _,
156
+ children: [/* @__PURE__ */ w(q, {
157
+ id: "insight-filter-severity",
158
+ children: /* @__PURE__ */ w(J, {})
159
+ }), /* @__PURE__ */ T(G, { children: [/* @__PURE__ */ w(K, {
160
+ value: Z,
161
+ children: f("brainyrich.insights.filters.all", "All")
162
+ }), ie.map((e) => /* @__PURE__ */ w(K, {
163
+ value: e,
164
+ children: Q(e)
165
+ }, e))] })]
166
+ })]
150
167
  }),
151
- /* @__PURE__ */ S(T, { children: [/* @__PURE__ */ x(O, {
152
- className: "pb-2",
153
- children: /* @__PURE__ */ S(k, {
154
- className: "flex items-center gap-2 text-sm",
155
- children: [/* @__PURE__ */ x(l, { className: "h-4 w-4" }), L("brainyrich.aiAssistant.sections.recentSessions", "Recent Sessions")]
156
- })
157
- }), /* @__PURE__ */ x(E, {
158
- className: "space-y-1 p-3 pt-0",
159
- children: z.map((e) => /* @__PURE__ */ S("button", {
160
- type: "button",
161
- className: `w-full rounded-md p-2 text-left transition-colors hover:bg-accent ${J === e.id ? "bg-accent" : ""}`,
162
- onClick: () => Y(e.id),
163
- children: [/* @__PURE__ */ x("p", {
164
- className: "truncate text-sm font-medium",
165
- children: e.title
166
- }), /* @__PURE__ */ S("div", {
167
- className: "mt-0.5 flex items-center justify-between text-xs text-muted-foreground",
168
- children: [/* @__PURE__ */ x("span", { children: L("brainyrich.aiAssistant.session.messageCount", "{count} msgs", { count: e.messageCount }) }), /* @__PURE__ */ x("span", { children: F(e.lastMessage) })]
169
- })]
170
- }, e.id))
171
- })] }),
172
- /* @__PURE__ */ S(T, { children: [/* @__PURE__ */ x(O, {
173
- className: "pb-2",
174
- children: /* @__PURE__ */ x(k, {
175
- className: "text-sm",
176
- children: L("brainyrich.aiAssistant.sections.portfolioContext", "Portfolio Context")
177
- })
178
- }), /* @__PURE__ */ S(E, {
179
- className: "space-y-2 p-3 pt-0",
168
+ /* @__PURE__ */ T("div", {
169
+ className: "w-full space-y-1.5 sm:w-48",
170
+ children: [/* @__PURE__ */ w(U, {
171
+ htmlFor: "insight-filter-status",
172
+ children: f("brainyrich.insights.filters.status", "Status")
173
+ }), /* @__PURE__ */ T(W, {
174
+ value: v,
175
+ onValueChange: y,
176
+ children: [/* @__PURE__ */ w(q, {
177
+ id: "insight-filter-status",
178
+ children: /* @__PURE__ */ w(J, {})
179
+ }), /* @__PURE__ */ T(G, { children: [/* @__PURE__ */ w(K, {
180
+ value: Z,
181
+ children: f("brainyrich.insights.filters.all", "All")
182
+ }), ae.map((e) => /* @__PURE__ */ w(K, {
183
+ value: e,
184
+ children: Q(e)
185
+ }, e))] })]
186
+ })]
187
+ }),
188
+ /* @__PURE__ */ T("div", {
189
+ className: "w-full space-y-1.5 sm:w-56",
190
+ children: [/* @__PURE__ */ w(U, {
191
+ htmlFor: "insight-filter-type",
192
+ children: f("brainyrich.insights.filters.type", "Type")
193
+ }), /* @__PURE__ */ T(W, {
194
+ value: b,
195
+ onValueChange: x,
196
+ children: [/* @__PURE__ */ w(q, {
197
+ id: "insight-filter-type",
198
+ children: /* @__PURE__ */ w(J, {})
199
+ }), /* @__PURE__ */ T(G, { children: [/* @__PURE__ */ w(K, {
200
+ value: Z,
201
+ children: f("brainyrich.insights.filters.all", "All")
202
+ }), X.map((e) => /* @__PURE__ */ w(K, {
203
+ value: e,
204
+ children: Q(e)
205
+ }, e))] })]
206
+ })]
207
+ })
208
+ ]
209
+ }) }),
210
+ z.length === 0 ? /* @__PURE__ */ w(o, {
211
+ icon: /* @__PURE__ */ w(g, {
212
+ className: "size-6",
213
+ "aria-hidden": "true"
214
+ }),
215
+ title: $ ? f("brainyrich.insights.empty.filteredTitle", "No matching insights") : f("brainyrich.insights.empty.title", "No advisory insights yet"),
216
+ description: $ ? f("brainyrich.insights.empty.filteredDescription", "No insights match the selected filters. Adjust or clear them to see more.") : f("brainyrich.insights.empty.description", "Advisory insights flag rebalancing, drift, concentration and other opportunities. Create one to get started."),
217
+ action: $ ? /* @__PURE__ */ w(D, {
218
+ variant: "outline",
219
+ size: "sm",
220
+ onClick: () => {
221
+ _(Z), y(Z), x(Z);
222
+ },
223
+ children: f("brainyrich.insights.actions.clearFilters", "Clear filters")
224
+ }) : /* @__PURE__ */ T(D, {
225
+ size: "sm",
226
+ onClick: Y,
227
+ children: [/* @__PURE__ */ w(ee, {
228
+ className: "size-4",
229
+ "aria-hidden": "true"
230
+ }), f("brainyrich.insights.actions.create", "New insight")]
231
+ })
232
+ }) : /* @__PURE__ */ w("div", {
233
+ className: "space-y-3",
234
+ children: z.map((e) => /* @__PURE__ */ w(ce, {
235
+ insight: e,
236
+ translate: f,
237
+ onAcknowledge: () => A.mutate(e.id),
238
+ onDismiss: () => j.mutate(e.id),
239
+ onResolve: () => M.mutate(e.id),
240
+ acknowledgePending: A.isPending,
241
+ dismissPending: j.isPending,
242
+ resolvePending: M.isPending
243
+ }, e.id))
244
+ })
245
+ ] })
246
+ }), /* @__PURE__ */ w(le, {
247
+ open: P,
248
+ form: I,
249
+ setField: R,
250
+ metricsValid: V,
251
+ valid: H,
252
+ pending: N.isPending,
253
+ onSubmit: oe,
254
+ onOpenChange: (e) => F(e),
255
+ translate: f
256
+ })] });
257
+ }
258
+ function ce({ insight: e, translate: t, onAcknowledge: n, onDismiss: r, onResolve: i, acknowledgePending: a, dismissPending: o, resolvePending: s }) {
259
+ let c = oe(e.severity), l = c.icon, u = e.status === "RESOLVED" || e.status === "DISMISSED";
260
+ return /* @__PURE__ */ T(O, { children: [/* @__PURE__ */ w(re, {
261
+ className: "pb-3",
262
+ children: /* @__PURE__ */ T("div", {
263
+ className: "flex items-start justify-between gap-3",
264
+ children: [/* @__PURE__ */ T("div", {
265
+ className: "flex min-w-0 items-start gap-3",
266
+ children: [/* @__PURE__ */ w("span", {
267
+ className: `mt-0.5 flex size-9 shrink-0 items-center justify-center rounded-full bg-bg-sunken ${c.tone}`,
268
+ children: /* @__PURE__ */ w(l, {
269
+ className: "size-5",
270
+ "aria-hidden": "true"
271
+ })
272
+ }), /* @__PURE__ */ T("div", {
273
+ className: "min-w-0",
274
+ children: [/* @__PURE__ */ w(A, {
275
+ className: "text-base",
276
+ children: e.title
277
+ }), /* @__PURE__ */ T(ne, {
278
+ className: "mt-1 flex flex-wrap items-center gap-2",
180
279
  children: [
181
- /* @__PURE__ */ S("div", {
182
- className: "flex items-center justify-between text-sm",
183
- children: [/* @__PURE__ */ x("span", {
184
- className: "text-muted-foreground",
185
- children: L("brainyrich.aiAssistant.context.netWorth", "Net Worth")
186
- }), /* @__PURE__ */ x("span", {
187
- className: "font-medium",
188
- children: V
189
- })]
280
+ /* @__PURE__ */ w(E, {
281
+ variant: "outline",
282
+ children: Q(e.type)
190
283
  }),
191
- /* @__PURE__ */ S("div", {
192
- className: "flex items-center justify-between text-sm",
193
- children: [/* @__PURE__ */ x("span", {
194
- className: "text-muted-foreground",
195
- children: L("brainyrich.aiAssistant.context.invested", "Invested")
196
- }), /* @__PURE__ */ x("span", {
197
- className: "font-medium",
198
- children: r(j)
199
- })]
284
+ /* @__PURE__ */ w(E, {
285
+ variant: f(e.severity),
286
+ children: /* @__PURE__ */ T("span", {
287
+ className: `inline-flex items-center gap-1 ${c.tone}`,
288
+ children: [/* @__PURE__ */ w(l, {
289
+ className: "size-3",
290
+ "aria-hidden": "true"
291
+ }), Q(e.severity)]
292
+ })
200
293
  }),
201
- /* @__PURE__ */ S("div", {
202
- className: "flex items-center justify-between text-sm",
203
- children: [/* @__PURE__ */ x("span", {
204
- className: "text-muted-foreground",
205
- children: L("brainyrich.aiAssistant.context.portfolios", "Portfolios")
206
- }), /* @__PURE__ */ x("span", {
207
- className: "font-medium",
208
- children: m.length
209
- })]
210
- }),
211
- /* @__PURE__ */ S("div", {
212
- className: "flex items-center justify-between text-sm",
213
- children: [/* @__PURE__ */ x("span", {
214
- className: "text-muted-foreground",
215
- children: L("brainyrich.aiAssistant.context.riskAlerts", "Risk Alerts")
216
- }), /* @__PURE__ */ x(C, {
217
- variant: v.some((e) => e.severity === "High") ? "destructive" : "secondary",
218
- className: "text-[10px]",
219
- children: L("brainyrich.aiAssistant.context.activeAlerts", "{count} active", { count: v.length })
220
- })]
294
+ /* @__PURE__ */ w(E, {
295
+ variant: f(e.status),
296
+ children: Q(e.status)
221
297
  })
222
298
  ]
299
+ })]
300
+ })]
301
+ }), /* @__PURE__ */ T(L, { children: [/* @__PURE__ */ w(V, {
302
+ asChild: !0,
303
+ children: /* @__PURE__ */ w(D, {
304
+ variant: "ghost",
305
+ size: "icon",
306
+ "aria-label": t("brainyrich.insights.actions.menu", "Insight actions"),
307
+ children: /* @__PURE__ */ w(b, {
308
+ className: "size-4",
309
+ "aria-hidden": "true"
310
+ })
311
+ })
312
+ }), /* @__PURE__ */ T(R, {
313
+ align: "end",
314
+ children: [
315
+ /* @__PURE__ */ T(z, {
316
+ disabled: a || e.status === "ACKNOWLEDGED" || u,
317
+ onSelect: n,
318
+ children: [/* @__PURE__ */ w(_, {
319
+ className: "size-4",
320
+ "aria-hidden": "true"
321
+ }), t("brainyrich.insights.actions.acknowledge", "Acknowledge")]
322
+ }),
323
+ /* @__PURE__ */ T(z, {
324
+ disabled: s || e.status === "RESOLVED",
325
+ onSelect: i,
326
+ children: [/* @__PURE__ */ w(_, {
327
+ className: "size-4",
328
+ "aria-hidden": "true"
329
+ }), t("brainyrich.insights.actions.resolve", "Resolve")]
330
+ }),
331
+ /* @__PURE__ */ w(B, {}),
332
+ /* @__PURE__ */ T(z, {
333
+ className: "text-status-error-text focus:text-status-error-text",
334
+ disabled: o || e.status === "DISMISSED",
335
+ onSelect: r,
336
+ children: [/* @__PURE__ */ w(S, {
337
+ className: "size-4",
338
+ "aria-hidden": "true"
339
+ }), t("brainyrich.insights.actions.dismiss", "Dismiss")]
340
+ })
341
+ ]
342
+ })] })]
343
+ })
344
+ }), /* @__PURE__ */ T(k, {
345
+ className: "space-y-3",
346
+ children: [
347
+ e.detail ? /* @__PURE__ */ w("p", {
348
+ className: "text-sm text-text-secondary",
349
+ children: e.detail
350
+ }) : null,
351
+ /* @__PURE__ */ T("dl", {
352
+ className: "grid grid-cols-2 gap-3 rounded-lg bg-bg-sunken p-3 text-sm sm:grid-cols-3",
353
+ children: [
354
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("dt", {
355
+ className: "text-xs text-text-secondary",
356
+ children: t("brainyrich.insights.card.subjectType", "Subject")
357
+ }), /* @__PURE__ */ w("dd", {
358
+ className: "font-medium text-text-primary",
359
+ children: Q(e.subjectType)
360
+ })] }),
361
+ /* @__PURE__ */ T("div", {
362
+ className: "min-w-0",
363
+ children: [/* @__PURE__ */ w("dt", {
364
+ className: "text-xs text-text-secondary",
365
+ children: t("brainyrich.insights.card.subjectId", "Subject ID")
366
+ }), /* @__PURE__ */ w("dd", {
367
+ className: "truncate font-medium text-text-primary",
368
+ title: e.subjectId,
369
+ children: e.subjectId
370
+ })]
371
+ }),
372
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("dt", {
373
+ className: "text-xs text-text-secondary",
374
+ children: t("brainyrich.insights.card.created", "Created")
375
+ }), /* @__PURE__ */ w("dd", {
376
+ className: "font-medium text-text-primary",
377
+ children: d(e.createdAt)
223
378
  })] })
224
379
  ]
225
- }), /* @__PURE__ */ x("div", {
226
- className: "flex flex-col lg:col-span-3",
227
- children: /* @__PURE__ */ S(T, {
228
- className: "flex flex-1 flex-col",
229
- children: [
230
- /* @__PURE__ */ x(O, {
231
- className: "border-b py-3",
232
- children: /* @__PURE__ */ S("div", {
233
- className: "flex items-center justify-between",
234
- children: [/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ S(k, {
235
- className: "flex items-center gap-2 text-base",
236
- children: [/* @__PURE__ */ x(s, { className: "h-5 w-5 text-blue-600" }), L("brainyrich.aiAssistant.chat.title", "Financial AI Assistant")]
237
- }), /* @__PURE__ */ x(D, { children: L("brainyrich.aiAssistant.chat.description", "Real-time analysis and personalized wealth recommendations") })] }), /* @__PURE__ */ S("div", {
238
- className: "flex items-center gap-2",
239
- children: [/* @__PURE__ */ x(C, {
240
- variant: "outline",
241
- className: "border-green-200 text-green-600",
242
- children: L("brainyrich.aiAssistant.status.online", "Online")
243
- }), /* @__PURE__ */ S("div", {
244
- className: "flex items-center gap-1 text-sm text-muted-foreground",
245
- children: [/* @__PURE__ */ x("div", { className: "h-2 w-2 animate-pulse rounded-full bg-green-500" }), L("brainyrich.aiAssistant.status.active", "Active")]
246
- })]
247
- })]
248
- })
249
- }),
250
- /* @__PURE__ */ S(E, {
251
- className: "flex-1 space-y-4 overflow-y-auto p-4",
252
- style: {
253
- maxHeight: "calc(100vh - 520px)",
254
- minHeight: "300px"
255
- },
256
- children: [
257
- H.map((e) => /* @__PURE__ */ x("div", {
258
- className: `flex ${e.sender === "user" ? "justify-end" : "justify-start"}`,
259
- children: /* @__PURE__ */ S("div", {
260
- className: `flex max-w-[80%] items-start gap-2 ${e.sender === "user" ? "flex-row-reverse" : ""}`,
261
- children: [/* @__PURE__ */ x("div", {
262
- className: `rounded-full p-2 ${e.sender === "user" ? "bg-primary/10" : "bg-blue-100"}`,
263
- children: e.sender === "user" ? /* @__PURE__ */ x(y, { className: "h-4 w-4" }) : /* @__PURE__ */ x(s, { className: "h-4 w-4 text-blue-600" })
264
- }), /* @__PURE__ */ S("div", {
265
- className: `space-y-1 rounded-lg p-3 ${e.sender === "user" ? "bg-primary text-primary-foreground" : "bg-muted"}`,
266
- children: [
267
- /* @__PURE__ */ x("p", {
268
- className: "text-sm",
269
- children: e.content
270
- }),
271
- e.metadata?.relatedTopics ? /* @__PURE__ */ x("div", {
272
- className: "flex flex-wrap gap-1 pt-1",
273
- children: e.metadata.relatedTopics.map((e) => /* @__PURE__ */ x(C, {
274
- variant: "outline",
275
- className: "text-[10px]",
276
- children: e
277
- }, e))
278
- }) : null,
279
- /* @__PURE__ */ S("p", {
280
- className: "text-[10px] opacity-60",
281
- children: [e.timestamp.toLocaleTimeString([], {
282
- hour: "2-digit",
283
- minute: "2-digit"
284
- }), e.metadata?.confidence ? ` · ${Math.round(e.metadata.confidence * 100)}% confidence` : ""]
285
- })
286
- ]
287
- })]
288
- })
289
- }, e.id)),
290
- K ? /* @__PURE__ */ S("div", {
291
- className: "flex items-center gap-2",
292
- children: [/* @__PURE__ */ x("div", {
293
- className: "rounded-full bg-blue-100 p-2",
294
- children: /* @__PURE__ */ x(s, { className: "h-4 w-4 text-blue-600" })
295
- }), /* @__PURE__ */ x("div", {
296
- className: "rounded-lg bg-muted p-3",
297
- children: /* @__PURE__ */ S("div", {
298
- className: "flex space-x-1",
299
- children: [
300
- /* @__PURE__ */ x("div", { className: "h-2 w-2 animate-bounce rounded-full bg-muted-foreground/40" }),
301
- /* @__PURE__ */ x("div", {
302
- className: "h-2 w-2 animate-bounce rounded-full bg-muted-foreground/40",
303
- style: { animationDelay: "0.1s" }
304
- }),
305
- /* @__PURE__ */ x("div", {
306
- className: "h-2 w-2 animate-bounce rounded-full bg-muted-foreground/40",
307
- style: { animationDelay: "0.2s" }
308
- })
309
- ]
310
- })
311
- })]
312
- }) : null,
313
- /* @__PURE__ */ x("div", { ref: X })
314
- ]
315
- }),
316
- H.length <= 1 ? /* @__PURE__ */ S("div", {
317
- className: "border-t px-4 py-3",
318
- children: [/* @__PURE__ */ S("p", {
319
- className: "mb-2 flex items-center gap-1 text-xs text-muted-foreground",
320
- children: [/* @__PURE__ */ x(_, { className: "h-3 w-3" }), L("brainyrich.aiAssistant.sections.suggestedQuestions", "Suggested questions")]
321
- }), /* @__PURE__ */ x("div", {
322
- className: "grid gap-2 sm:grid-cols-2",
323
- children: B.map((e) => /* @__PURE__ */ S("button", {
324
- type: "button",
325
- className: "flex items-center gap-2 rounded-md border p-2 text-left text-sm transition-colors hover:bg-accent",
326
- onClick: () => $(e.text),
327
- children: [/* @__PURE__ */ x(e.icon, { className: "h-4 w-4 shrink-0 text-muted-foreground" }), e.text]
328
- }, e.text))
380
+ }),
381
+ /* @__PURE__ */ T("div", {
382
+ className: "flex flex-wrap items-center gap-2",
383
+ children: [/* @__PURE__ */ T(D, {
384
+ variant: "outline",
385
+ size: "sm",
386
+ disabled: a || e.status === "ACKNOWLEDGED" || u,
387
+ onClick: n,
388
+ children: [/* @__PURE__ */ w(_, {
389
+ className: "size-4",
390
+ "aria-hidden": "true"
391
+ }), t("brainyrich.insights.actions.acknowledge", "Acknowledge")]
392
+ }), /* @__PURE__ */ T(D, {
393
+ size: "sm",
394
+ disabled: s || e.status === "RESOLVED",
395
+ onClick: i,
396
+ children: [/* @__PURE__ */ w(_, {
397
+ className: "size-4",
398
+ "aria-hidden": "true"
399
+ }), t("brainyrich.insights.actions.resolve", "Resolve")]
400
+ })]
401
+ })
402
+ ]
403
+ })] });
404
+ }
405
+ function le({ open: e, form: t, setField: n, metricsValid: r, valid: i, pending: a, onSubmit: o, onOpenChange: s, translate: c }) {
406
+ return /* @__PURE__ */ w(j, {
407
+ open: e,
408
+ onOpenChange: s,
409
+ children: /* @__PURE__ */ T(M, {
410
+ className: "max-h-[90vh] overflow-y-auto sm:max-w-lg",
411
+ children: [/* @__PURE__ */ T(F, { children: [/* @__PURE__ */ w(I, { children: c("brainyrich.insights.form.createTitle", "New insight") }), /* @__PURE__ */ w(N, { children: c("brainyrich.insights.form.subtitle", "Flag an advisory insight against a portfolio, account, goal or household.") })] }), /* @__PURE__ */ T("form", {
412
+ className: "space-y-4",
413
+ onSubmit: (e) => {
414
+ e.preventDefault(), o();
415
+ },
416
+ children: [
417
+ /* @__PURE__ */ T("div", {
418
+ className: "space-y-1.5",
419
+ children: [/* @__PURE__ */ w(U, {
420
+ htmlFor: "insight-title",
421
+ children: c("brainyrich.insights.form.title", "Title")
422
+ }), /* @__PURE__ */ w(H, {
423
+ id: "insight-title",
424
+ value: t.title,
425
+ onChange: (e) => n("title", e.target.value),
426
+ placeholder: c("brainyrich.insights.form.titlePlaceholder", "e.g. Technology concentration above threshold"),
427
+ required: !0
428
+ })]
429
+ }),
430
+ /* @__PURE__ */ T("div", {
431
+ className: "grid grid-cols-2 gap-3",
432
+ children: [/* @__PURE__ */ T("div", {
433
+ className: "space-y-1.5",
434
+ children: [/* @__PURE__ */ w(U, {
435
+ htmlFor: "insight-type",
436
+ children: c("brainyrich.insights.form.type", "Type")
437
+ }), /* @__PURE__ */ T(W, {
438
+ value: t.type,
439
+ onValueChange: (e) => n("type", e),
440
+ children: [/* @__PURE__ */ w(q, {
441
+ id: "insight-type",
442
+ children: /* @__PURE__ */ w(J, {})
443
+ }), /* @__PURE__ */ w(G, { children: X.map((e) => /* @__PURE__ */ w(K, {
444
+ value: e,
445
+ children: Q(e)
446
+ }, e)) })]
329
447
  })]
330
- }) : null,
331
- /* @__PURE__ */ S("div", {
332
- className: "border-t p-4",
333
- children: [/* @__PURE__ */ S("div", {
334
- className: "flex items-center gap-2",
335
- children: [/* @__PURE__ */ S("div", {
336
- className: "relative flex-1",
337
- children: [/* @__PURE__ */ x(A, {
338
- ref: Z,
339
- value: W,
340
- onChange: (e) => G(e.target.value),
341
- onKeyDown: (e) => {
342
- e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Q());
343
- },
344
- placeholder: L("brainyrich.aiAssistant.input.placeholder", "Ask about investments, taxes, retirement, estate planning..."),
345
- className: "pr-20"
346
- }), /* @__PURE__ */ S("div", {
347
- className: "absolute right-2 top-1/2 flex -translate-y-1/2 items-center gap-1",
348
- children: [/* @__PURE__ */ x(w, {
349
- variant: "ghost",
350
- size: "icon",
351
- className: "h-7 w-7",
352
- children: /* @__PURE__ */ x(p, { className: "h-4 w-4" })
353
- }), /* @__PURE__ */ x(w, {
354
- variant: "ghost",
355
- size: "icon",
356
- className: "h-7 w-7",
357
- children: /* @__PURE__ */ x(f, { className: "h-4 w-4" })
358
- })]
359
- })]
360
- }), /* @__PURE__ */ x(w, {
361
- onClick: Q,
362
- disabled: !W.trim() || K,
363
- size: "sm",
364
- children: /* @__PURE__ */ x(g, { className: "h-4 w-4" })
365
- })]
366
- }), /* @__PURE__ */ S("div", {
367
- className: "mt-2 flex items-center justify-between text-xs text-muted-foreground",
368
- children: [/* @__PURE__ */ S("span", {
369
- className: "flex items-center gap-1",
370
- children: [/* @__PURE__ */ x(d, { className: "h-3 w-3" }), L("brainyrich.aiAssistant.disclaimer", "AI can make mistakes. Always verify important financial information.")]
371
- }), /* @__PURE__ */ S("span", {
372
- className: "flex items-center gap-1",
373
- children: [/* @__PURE__ */ x("kbd", {
374
- className: "rounded bg-muted px-1.5 py-0.5 text-[10px]",
375
- children: "Enter"
376
- }), L("brainyrich.aiAssistant.input.toSend", "to send")]
377
- })]
448
+ }), /* @__PURE__ */ T("div", {
449
+ className: "space-y-1.5",
450
+ children: [/* @__PURE__ */ w(U, {
451
+ htmlFor: "insight-severity",
452
+ children: c("brainyrich.insights.form.severity", "Severity")
453
+ }), /* @__PURE__ */ T(W, {
454
+ value: t.severity,
455
+ onValueChange: (e) => n("severity", e),
456
+ children: [/* @__PURE__ */ w(q, {
457
+ id: "insight-severity",
458
+ children: /* @__PURE__ */ w(J, {})
459
+ }), /* @__PURE__ */ w(G, { children: ie.map((e) => /* @__PURE__ */ w(K, {
460
+ value: e,
461
+ children: Q(e)
462
+ }, e)) })]
378
463
  })]
379
- })
380
- ]
381
- })
464
+ })]
465
+ }),
466
+ /* @__PURE__ */ T("div", {
467
+ className: "grid grid-cols-2 gap-3",
468
+ children: [/* @__PURE__ */ T("div", {
469
+ className: "space-y-1.5",
470
+ children: [/* @__PURE__ */ w(U, {
471
+ htmlFor: "insight-subject-type",
472
+ children: c("brainyrich.insights.form.subjectType", "Subject type")
473
+ }), /* @__PURE__ */ w(H, {
474
+ id: "insight-subject-type",
475
+ value: t.subjectType,
476
+ onChange: (e) => n("subjectType", e.target.value),
477
+ placeholder: c("brainyrich.insights.form.subjectTypePlaceholder", "e.g. PORTFOLIO"),
478
+ required: !0
479
+ })]
480
+ }), /* @__PURE__ */ T("div", {
481
+ className: "space-y-1.5",
482
+ children: [/* @__PURE__ */ w(U, {
483
+ htmlFor: "insight-subject-id",
484
+ children: c("brainyrich.insights.form.subjectId", "Subject ID")
485
+ }), /* @__PURE__ */ w(H, {
486
+ id: "insight-subject-id",
487
+ value: t.subjectId,
488
+ onChange: (e) => n("subjectId", e.target.value),
489
+ placeholder: c("brainyrich.insights.form.subjectIdPlaceholder", "Referenced entity ID"),
490
+ required: !0
491
+ })]
492
+ })]
493
+ }),
494
+ /* @__PURE__ */ T("div", {
495
+ className: "space-y-1.5",
496
+ children: [/* @__PURE__ */ w(U, {
497
+ htmlFor: "insight-owner",
498
+ children: c("brainyrich.insights.form.ownerId", "Owner ID (optional)")
499
+ }), /* @__PURE__ */ w(H, {
500
+ id: "insight-owner",
501
+ value: t.ownerId,
502
+ onChange: (e) => n("ownerId", e.target.value),
503
+ placeholder: c("brainyrich.insights.form.ownerIdPlaceholder", "Defaults to the current owner")
504
+ })]
505
+ }),
506
+ /* @__PURE__ */ T("div", {
507
+ className: "space-y-1.5",
508
+ children: [/* @__PURE__ */ w(U, {
509
+ htmlFor: "insight-detail",
510
+ children: c("brainyrich.insights.form.detail", "Detail")
511
+ }), /* @__PURE__ */ w(Y, {
512
+ id: "insight-detail",
513
+ value: t.detail,
514
+ onChange: (e) => n("detail", e.target.value),
515
+ rows: 3,
516
+ placeholder: c("brainyrich.insights.form.detailPlaceholder", "Explain the finding and recommended action.")
517
+ })]
518
+ }),
519
+ /* @__PURE__ */ T("div", {
520
+ className: "space-y-1.5",
521
+ children: [
522
+ /* @__PURE__ */ w(U, {
523
+ htmlFor: "insight-metrics",
524
+ children: c("brainyrich.insights.form.metrics", "Metrics JSON (optional)")
525
+ }),
526
+ /* @__PURE__ */ w(Y, {
527
+ id: "insight-metrics",
528
+ value: t.metrics,
529
+ onChange: (e) => n("metrics", e.target.value),
530
+ rows: 3,
531
+ className: "font-mono text-xs",
532
+ placeholder: "{ \"driftPct\": 8.2 }",
533
+ "aria-invalid": !r
534
+ }),
535
+ r ? null : /* @__PURE__ */ T("p", {
536
+ className: "flex items-center gap-1 text-xs text-status-error-text",
537
+ children: [/* @__PURE__ */ w(h, {
538
+ className: "size-3.5",
539
+ "aria-hidden": "true"
540
+ }), c("brainyrich.insights.form.metricsInvalid", "Enter valid JSON or leave blank.")]
541
+ })
542
+ ]
543
+ }),
544
+ /* @__PURE__ */ T(P, { children: [/* @__PURE__ */ w(D, {
545
+ type: "button",
546
+ variant: "outline",
547
+ onClick: () => s(!1),
548
+ disabled: a,
549
+ children: c("brainyrich.insights.form.cancel", "Cancel")
550
+ }), /* @__PURE__ */ w(D, {
551
+ type: "submit",
552
+ disabled: !i || a,
553
+ children: a ? c("brainyrich.insights.form.saving", "Saving…") : c("brainyrich.insights.form.create", "Create insight")
554
+ })] })
555
+ ]
382
556
  })]
383
557
  })
384
558
  });
385
559
  }
386
560
  //#endregion
387
- export { L as AiAssistantPage };
561
+ export { $ as AiAssistantPage };
388
562
 
389
563
  //# sourceMappingURL=AiAssistantPage.js.map