@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.
Files changed (66) hide show
  1. package/dist/brainyrich/BrainyRichRoot.js +55 -90
  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/components/ActorName.js +38 -0
  6. package/dist/brainyrich/components/ActorName.js.map +1 -0
  7. package/dist/brainyrich/components/ConfirmDialog.js +25 -0
  8. package/dist/brainyrich/components/ConfirmDialog.js.map +1 -0
  9. package/dist/brainyrich/components/LoadMore.js +24 -0
  10. package/dist/brainyrich/components/LoadMore.js.map +1 -0
  11. package/dist/brainyrich/components/index.js +5 -0
  12. package/dist/brainyrich/components/notify.js +38 -0
  13. package/dist/brainyrich/components/notify.js.map +1 -0
  14. package/dist/brainyrich/components/pickers.js +232 -0
  15. package/dist/brainyrich/components/pickers.js.map +1 -0
  16. package/dist/brainyrich/components/reuse/CommentThread.js +208 -0
  17. package/dist/brainyrich/components/reuse/CommentThread.js.map +1 -0
  18. package/dist/brainyrich/components/reuse/DocumentsPanel.js +237 -0
  19. package/dist/brainyrich/components/reuse/DocumentsPanel.js.map +1 -0
  20. package/dist/brainyrich/components/reuse/TagField.js +206 -0
  21. package/dist/brainyrich/components/reuse/TagField.js.map +1 -0
  22. package/dist/brainyrich/components/reuse/transport.js +24 -0
  23. package/dist/brainyrich/components/reuse/transport.js.map +1 -0
  24. package/dist/brainyrich/hooks/useBrainyRichApi.js +815 -0
  25. package/dist/brainyrich/hooks/useBrainyRichApi.js.map +1 -0
  26. package/dist/brainyrich/index.js +0 -1
  27. package/dist/brainyrich/pages/AccountsPage.js +743 -160
  28. package/dist/brainyrich/pages/AccountsPage.js.map +1 -1
  29. package/dist/brainyrich/pages/AiAssistantPage.js +556 -363
  30. package/dist/brainyrich/pages/AiAssistantPage.js.map +1 -1
  31. package/dist/brainyrich/pages/AnalyticsPage.js +601 -268
  32. package/dist/brainyrich/pages/AnalyticsPage.js.map +1 -1
  33. package/dist/brainyrich/pages/DashboardPage.js +375 -231
  34. package/dist/brainyrich/pages/DashboardPage.js.map +1 -1
  35. package/dist/brainyrich/pages/FamilyPage.js +599 -337
  36. package/dist/brainyrich/pages/FamilyPage.js.map +1 -1
  37. package/dist/brainyrich/pages/GoalsPage.js +810 -141
  38. package/dist/brainyrich/pages/GoalsPage.js.map +1 -1
  39. package/dist/brainyrich/pages/InvestmentsPage.js +410 -311
  40. package/dist/brainyrich/pages/InvestmentsPage.js.map +1 -1
  41. package/dist/brainyrich/pages/PortfoliosPage.js +867 -156
  42. package/dist/brainyrich/pages/PortfoliosPage.js.map +1 -1
  43. package/dist/brainyrich/pages/ReportsPage.js +421 -251
  44. package/dist/brainyrich/pages/ReportsPage.js.map +1 -1
  45. package/dist/brainyrich/pages/RiskPage.js +557 -194
  46. package/dist/brainyrich/pages/RiskPage.js.map +1 -1
  47. package/dist/brainyrich/pages/TaxPage.js +655 -221
  48. package/dist/brainyrich/pages/TaxPage.js.map +1 -1
  49. package/dist/brainyrich/pages/_shared.js +222 -41
  50. package/dist/brainyrich/pages/_shared.js.map +1 -1
  51. package/dist/index.js +2 -3
  52. package/dist/node_modules/sonner/dist/index.js +163 -0
  53. package/dist/node_modules/sonner/dist/index.js.map +1 -0
  54. package/package.json +3 -2
  55. package/dist/brainyrich/pages/AdvisorsPage.js +0 -375
  56. package/dist/brainyrich/pages/AdvisorsPage.js.map +0 -1
  57. package/dist/brainyrich/pages/AssistantPage.js +0 -332
  58. package/dist/brainyrich/pages/AssistantPage.js.map +0 -1
  59. package/dist/brainyrich/pages/EstatePage.js +0 -269
  60. package/dist/brainyrich/pages/EstatePage.js.map +0 -1
  61. package/dist/brainyrich/pages/InsurancePage.js +0 -181
  62. package/dist/brainyrich/pages/InsurancePage.js.map +0 -1
  63. package/dist/brainyrich/pages/MarketplacePage.js +0 -450
  64. package/dist/brainyrich/pages/MarketplacePage.js.map +0 -1
  65. package/dist/brainyrich/store/brainyrichStore.js +0 -272
  66. package/dist/brainyrich/store/brainyrichStore.js.map +0 -1
@@ -1,389 +1,582 @@
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 { useAccounts as t, useAcknowledgeInsight as n, useCreateInsight as r, useDismissInsight as i, useGoals as a, useHouseholds as o, usePagedInsights as s, usePortfolios as c, useResolveInsight as l } from "../hooks/useBrainyRichApi.js";
3
+ import { LoadMore as u } from "../components/LoadMore.js";
4
+ import { ConfirmDialog as d } from "../components/ConfirmDialog.js";
5
+ import { SubjectPicker as f, parseSubject as p } from "../components/pickers.js";
6
+ import "../components/index.js";
7
+ import { EmptyState as m, ErrorState as ee, KpiGrid as te, LoadingState as ne, SectionShell as re, formatDate as h, statusBadgeVariant as g } from "./_shared.js";
8
+ import { useMemo as _, useState as v } from "react";
9
+ import { AlertTriangle as y, BellRing as b, CheckCircle2 as x, Info as S, Lightbulb as C, MoreHorizontal as w, Plus as ie, ShieldAlert as ae, XCircle as oe } from "lucide-react";
10
+ import { useI18n as se } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
11
+ import { Fragment as ce, jsx as T, jsxs as E } from "react/jsx-runtime";
12
+ import { Badge as D, Button as O, Card as le, CardContent as k, CardDescription as A, CardHeader as ue, CardTitle as de, Dialog as j, DialogContent as M, DialogDescription as N, DialogFooter as P, DialogHeader as fe, DialogTitle as F, DropdownMenu as I, DropdownMenuContent as L, DropdownMenuItem as R, DropdownMenuSeparator as z, DropdownMenuTrigger as B, Input as V, Label as H, Select as U, SelectContent as W, SelectItem as G, SelectTrigger as K, SelectValue as q, Textarea as J } from "@burdenoff/fe-libs/ui";
9
13
  //#region src/brainyrich/pages/AiAssistantPage.tsx
10
- var j = 0;
11
- function M() {
12
- return j += 1, `msg-${j}`;
14
+ var pe = [
15
+ "REBALANCE_DUE",
16
+ "DRIFT",
17
+ "CONCENTRATION_RISK",
18
+ "CASH_DRAG",
19
+ "FEE_ANOMALY",
20
+ "TAX_OPPORTUNITY",
21
+ "GOAL_AT_RISK"
22
+ ], me = [
23
+ "INFO",
24
+ "LOW",
25
+ "MEDIUM",
26
+ "HIGH",
27
+ "CRITICAL"
28
+ ], he = [
29
+ "OPEN",
30
+ "ACKNOWLEDGED",
31
+ "RESOLVED",
32
+ "DISMISSED"
33
+ ], Y = "__all__";
34
+ function X(e) {
35
+ return e.toLowerCase().split("_").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" ");
13
36
  }
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
37
+ function ge(e) {
38
+ switch (e) {
39
+ case "CRITICAL": return {
40
+ icon: ae,
41
+ tone: "text-status-error-text"
42
+ };
43
+ case "HIGH": return {
44
+ icon: y,
45
+ tone: "text-status-error-text"
46
+ };
47
+ case "MEDIUM": return {
48
+ icon: b,
49
+ tone: "text-status-warning-text"
50
+ };
51
+ case "LOW": return {
52
+ icon: C,
53
+ tone: "text-status-warning-text"
54
+ };
55
+ default: return {
56
+ icon: S,
57
+ tone: "text-text-secondary"
58
+ };
67
59
  }
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
60
  }
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?`;
61
+ function _e() {
62
+ return {
63
+ title: "",
64
+ type: "DRIFT",
65
+ severity: "MEDIUM",
66
+ subject: "",
67
+ detail: "",
68
+ metrics: "",
69
+ ownerId: ""
70
+ };
78
71
  }
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"
72
+ function Z() {
73
+ let { t: d } = se(), f = (t, n, r) => e(d, t, n, r), [h, g] = v(Y), [y, x] = v(Y), [S, C] = v(Y), { items: w, hasMore: ae, loadMore: oe, isLoading: D, isFetchingNextPage: A, isError: ue, refetch: de } = s({
74
+ ...h === Y ? {} : { severity: h },
75
+ ...y === Y ? {} : { status: y }
76
+ }), j = t(), M = c(), N = a(), P = o(), fe = _(() => {
77
+ let e = /* @__PURE__ */ new Map();
78
+ for (let t of j.data) e.set(t.id, t.name);
79
+ for (let t of M.data) e.set(t.id, t.name);
80
+ for (let t of N.data) e.set(t.id, t.name);
81
+ for (let t of P.data) e.set(t.id, t.name);
82
+ return e;
83
+ }, [
84
+ j.data,
85
+ M.data,
86
+ N.data,
87
+ P.data
88
+ ]), F = n(), I = i(), L = l(), R = r(), [z, B] = v(!1), [V, J] = v(_e), ge = (e, t) => J((n) => ({
89
+ ...n,
90
+ [e]: t
91
+ })), Z = _(() => S === Y ? w : w.filter((e) => e.type === S), [w, S]), Q = _(() => ({
92
+ open: w.filter((e) => e.status === "OPEN").length,
93
+ urgent: w.filter((e) => e.severity === "HIGH" || e.severity === "CRITICAL").length,
94
+ resolved: w.filter((e) => e.status === "RESOLVED").length
95
+ }), [w]), be = _(() => {
96
+ if (!V.metrics.trim()) return !0;
97
+ try {
98
+ return JSON.parse(V.metrics), !0;
99
+ } catch {
100
+ return !1;
101
+ }
102
+ }, [V.metrics]), xe = V.title.trim().length > 0 && p(V.subject) !== null && be, Se = () => {
103
+ J(_e()), B(!0);
104
+ }, Ce = () => {
105
+ if (!xe) return;
106
+ let e = p(V.subject);
107
+ if (!e) return;
108
+ let t;
109
+ if (V.metrics.trim()) try {
110
+ t = JSON.parse(V.metrics);
111
+ } catch {
112
+ return;
113
+ }
114
+ let n = {
115
+ title: V.title.trim(),
116
+ type: V.type,
117
+ severity: V.severity,
118
+ subjectType: e.subjectType,
119
+ subjectId: e.subjectId,
120
+ detail: V.detail.trim() || null,
121
+ ...t ? { metrics: t } : {},
122
+ ...V.ownerId.trim() ? { ownerId: V.ownerId.trim() } : {}
108
123
  };
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
- ]
124
+ R.mutate(n, { onSuccess: () => B(!1) });
125
+ }, $ = h !== Y || y !== Y || S !== Y;
126
+ return /* @__PURE__ */ E(ce, { children: [/* @__PURE__ */ T(re, {
127
+ title: f("brainyrich.insights.title", "Insights"),
128
+ description: f("brainyrich.insights.description", "Advisory insights across portfolios, accounts and goals — triage, acknowledge and resolve."),
129
+ badges: [f("brainyrich.insights.badges.advisory", "Advisory")],
130
+ actionLabel: f("brainyrich.insights.actions.create", "New insight"),
131
+ onAction: Se,
132
+ children: D ? /* @__PURE__ */ T(ne, { rows: 4 }) : ue ? /* @__PURE__ */ T(ee, {
133
+ title: f("brainyrich.insights.error.title", "Could not load insights"),
134
+ description: f("brainyrich.insights.error.description", "We could not reach the insights service. Please try again."),
135
+ onRetry: () => de()
136
+ }) : /* @__PURE__ */ E(ce, { children: [
137
+ /* @__PURE__ */ T(te, { items: [
138
+ {
139
+ label: f("brainyrich.insights.metrics.total", "Insights"),
140
+ value: String(w.length),
141
+ trend: f("brainyrich.insights.metrics.totalTrend", "In your inbox")
142
+ },
143
+ {
144
+ label: f("brainyrich.insights.metrics.open", "Open"),
145
+ value: String(Q.open),
146
+ trend: f("brainyrich.insights.metrics.openTrend", "Awaiting action"),
147
+ deltaTone: Q.open > 0 ? "negative" : "positive"
148
+ },
149
+ {
150
+ label: f("brainyrich.insights.metrics.urgent", "High priority"),
151
+ value: String(Q.urgent),
152
+ trend: f("brainyrich.insights.metrics.urgentTrend", "High or critical"),
153
+ deltaTone: Q.urgent > 0 ? "negative" : "positive"
154
+ },
155
+ {
156
+ label: f("brainyrich.insights.metrics.resolved", "Resolved"),
157
+ value: String(Q.resolved),
158
+ trend: f("brainyrich.insights.metrics.resolvedTrend", "Closed out"),
159
+ deltaTone: "positive"
127
160
  }
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",
161
+ ] }),
162
+ /* @__PURE__ */ T(le, { children: /* @__PURE__ */ E(k, {
163
+ className: "flex flex-col gap-3 p-4 sm:flex-row sm:items-end",
144
164
  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")]
165
+ /* @__PURE__ */ E("div", {
166
+ className: "w-full space-y-1.5 sm:w-48",
167
+ children: [/* @__PURE__ */ T(H, {
168
+ htmlFor: "insight-filter-severity",
169
+ children: f("brainyrich.insights.filters.severity", "Severity")
170
+ }), /* @__PURE__ */ E(U, {
171
+ value: h,
172
+ onValueChange: g,
173
+ children: [/* @__PURE__ */ T(K, {
174
+ id: "insight-filter-severity",
175
+ children: /* @__PURE__ */ T(q, {})
176
+ }), /* @__PURE__ */ E(W, { children: [/* @__PURE__ */ T(G, {
177
+ value: Y,
178
+ children: f("brainyrich.insights.filters.all", "All")
179
+ }), me.map((e) => /* @__PURE__ */ T(G, {
180
+ value: e,
181
+ children: X(e)
182
+ }, e))] })]
183
+ })]
184
+ }),
185
+ /* @__PURE__ */ E("div", {
186
+ className: "w-full space-y-1.5 sm:w-48",
187
+ children: [/* @__PURE__ */ T(H, {
188
+ htmlFor: "insight-filter-status",
189
+ children: f("brainyrich.insights.filters.status", "Status")
190
+ }), /* @__PURE__ */ E(U, {
191
+ value: y,
192
+ onValueChange: x,
193
+ children: [/* @__PURE__ */ T(K, {
194
+ id: "insight-filter-status",
195
+ children: /* @__PURE__ */ T(q, {})
196
+ }), /* @__PURE__ */ E(W, { children: [/* @__PURE__ */ T(G, {
197
+ value: Y,
198
+ children: f("brainyrich.insights.filters.all", "All")
199
+ }), he.map((e) => /* @__PURE__ */ T(G, {
200
+ value: e,
201
+ children: X(e)
202
+ }, e))] })]
203
+ })]
150
204
  }),
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")]
205
+ /* @__PURE__ */ E("div", {
206
+ className: "w-full space-y-1.5 sm:w-56",
207
+ children: [/* @__PURE__ */ T(H, {
208
+ htmlFor: "insight-filter-type",
209
+ children: f("brainyrich.insights.filters.type", "Type")
210
+ }), /* @__PURE__ */ E(U, {
211
+ value: S,
212
+ onValueChange: C,
213
+ children: [/* @__PURE__ */ T(K, {
214
+ id: "insight-filter-type",
215
+ children: /* @__PURE__ */ T(q, {})
216
+ }), /* @__PURE__ */ E(W, { children: [/* @__PURE__ */ T(G, {
217
+ value: Y,
218
+ children: f("brainyrich.insights.filters.all", "All")
219
+ }), pe.map((e) => /* @__PURE__ */ T(G, {
220
+ value: e,
221
+ children: X(e)
222
+ }, e))] })]
223
+ })]
224
+ })
225
+ ]
226
+ }) }),
227
+ Z.length === 0 ? /* @__PURE__ */ T(m, {
228
+ icon: /* @__PURE__ */ T(b, {
229
+ className: "size-6",
230
+ "aria-hidden": "true"
231
+ }),
232
+ title: $ ? f("brainyrich.insights.empty.filteredTitle", "No matching insights") : f("brainyrich.insights.empty.title", "No advisory insights yet"),
233
+ 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."),
234
+ action: $ ? /* @__PURE__ */ T(O, {
235
+ variant: "outline",
236
+ size: "sm",
237
+ onClick: () => {
238
+ g(Y), x(Y), C(Y);
239
+ },
240
+ children: f("brainyrich.insights.actions.clearFilters", "Clear filters")
241
+ }) : /* @__PURE__ */ E(O, {
242
+ size: "sm",
243
+ onClick: Se,
244
+ children: [/* @__PURE__ */ T(ie, {
245
+ className: "size-4",
246
+ "aria-hidden": "true"
247
+ }), f("brainyrich.insights.actions.create", "New insight")]
248
+ })
249
+ }) : /* @__PURE__ */ T("div", {
250
+ className: "space-y-3",
251
+ children: Z.map((e) => /* @__PURE__ */ T(ve, {
252
+ insight: e,
253
+ subjectName: fe.get(e.subjectId),
254
+ translate: f,
255
+ onAcknowledge: () => F.mutate(e.id),
256
+ onDismiss: () => I.mutate(e.id),
257
+ onResolve: () => L.mutate(e.id),
258
+ acknowledgePending: F.isPending,
259
+ dismissPending: I.isPending,
260
+ resolvePending: L.isPending
261
+ }, e.id))
262
+ }),
263
+ /* @__PURE__ */ T(u, {
264
+ hasMore: ae,
265
+ onClick: oe,
266
+ loading: A,
267
+ label: f("brainyrich.insights.actions.loadMore", "Load more insights")
268
+ })
269
+ ] })
270
+ }), /* @__PURE__ */ T(ye, {
271
+ open: z,
272
+ form: V,
273
+ setField: ge,
274
+ metricsValid: be,
275
+ valid: xe,
276
+ pending: R.isPending,
277
+ onSubmit: Ce,
278
+ onOpenChange: (e) => B(e),
279
+ translate: f
280
+ })] });
281
+ }
282
+ function ve({ insight: e, subjectName: t, translate: n, onAcknowledge: r, onDismiss: i, onResolve: a, acknowledgePending: o, dismissPending: s, resolvePending: c }) {
283
+ let l = ge(e.severity), u = l.icon, f = e.status === "RESOLVED" || e.status === "DISMISSED", [p, m] = v(!1);
284
+ return /* @__PURE__ */ E(le, { children: [
285
+ /* @__PURE__ */ T(ue, {
286
+ className: "pb-3",
287
+ children: /* @__PURE__ */ E("div", {
288
+ className: "flex items-start justify-between gap-3",
289
+ children: [/* @__PURE__ */ E("div", {
290
+ className: "flex min-w-0 items-start gap-3",
291
+ children: [/* @__PURE__ */ T("span", {
292
+ className: `mt-0.5 flex size-9 shrink-0 items-center justify-center rounded-full bg-bg-sunken ${l.tone}`,
293
+ children: /* @__PURE__ */ T(u, {
294
+ className: "size-5",
295
+ "aria-hidden": "true"
156
296
  })
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")
297
+ }), /* @__PURE__ */ E("div", {
298
+ className: "min-w-0",
299
+ children: [/* @__PURE__ */ T(de, {
300
+ className: "text-base",
301
+ children: e.title
302
+ }), /* @__PURE__ */ E(A, {
303
+ className: "mt-1 flex flex-wrap items-center gap-2",
304
+ children: [
305
+ /* @__PURE__ */ T(D, {
306
+ variant: "outline",
307
+ children: X(e.type)
308
+ }),
309
+ /* @__PURE__ */ T(D, {
310
+ variant: g(e.severity),
311
+ children: /* @__PURE__ */ E("span", {
312
+ className: `inline-flex items-center gap-1 ${l.tone}`,
313
+ children: [/* @__PURE__ */ T(u, {
314
+ className: "size-3",
315
+ "aria-hidden": "true"
316
+ }), X(e.severity)]
317
+ })
318
+ }),
319
+ /* @__PURE__ */ T(D, {
320
+ variant: g(e.status),
321
+ children: X(e.status)
322
+ })
323
+ ]
324
+ })]
325
+ })]
326
+ }), /* @__PURE__ */ E(I, { children: [/* @__PURE__ */ T(B, {
327
+ asChild: !0,
328
+ children: /* @__PURE__ */ T(O, {
329
+ variant: "ghost",
330
+ size: "icon",
331
+ "aria-label": n("brainyrich.insights.actions.menu", "Insight actions"),
332
+ children: /* @__PURE__ */ T(w, {
333
+ className: "size-4",
334
+ "aria-hidden": "true"
177
335
  })
178
- }), /* @__PURE__ */ S(E, {
179
- className: "space-y-2 p-3 pt-0",
336
+ })
337
+ }), /* @__PURE__ */ E(L, {
338
+ align: "end",
339
+ children: [
340
+ /* @__PURE__ */ E(R, {
341
+ disabled: o || e.status === "ACKNOWLEDGED" || f,
342
+ onSelect: r,
343
+ children: [/* @__PURE__ */ T(x, {
344
+ className: "size-4",
345
+ "aria-hidden": "true"
346
+ }), n("brainyrich.insights.actions.acknowledge", "Acknowledge")]
347
+ }),
348
+ /* @__PURE__ */ E(R, {
349
+ disabled: c || e.status === "RESOLVED",
350
+ onSelect: a,
351
+ children: [/* @__PURE__ */ T(x, {
352
+ className: "size-4",
353
+ "aria-hidden": "true"
354
+ }), n("brainyrich.insights.actions.resolve", "Resolve")]
355
+ }),
356
+ /* @__PURE__ */ T(z, {}),
357
+ /* @__PURE__ */ E(R, {
358
+ className: "text-status-error-text focus:text-status-error-text",
359
+ disabled: s || e.status === "DISMISSED",
360
+ onSelect: (e) => {
361
+ e.preventDefault(), m(!0);
362
+ },
363
+ children: [/* @__PURE__ */ T(oe, {
364
+ className: "size-4",
365
+ "aria-hidden": "true"
366
+ }), n("brainyrich.insights.actions.dismiss", "Dismiss")]
367
+ })
368
+ ]
369
+ })] })]
370
+ })
371
+ }),
372
+ /* @__PURE__ */ E(k, {
373
+ className: "space-y-3",
374
+ children: [
375
+ e.detail ? /* @__PURE__ */ T("p", {
376
+ className: "text-sm text-text-secondary",
377
+ children: e.detail
378
+ }) : null,
379
+ /* @__PURE__ */ E("dl", {
380
+ className: "grid grid-cols-2 gap-3 rounded-lg bg-bg-sunken p-3 text-sm sm:grid-cols-3",
381
+ children: [
382
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("dt", {
383
+ className: "text-xs text-text-secondary",
384
+ children: n("brainyrich.insights.card.subjectType", "Subject")
385
+ }), /* @__PURE__ */ T("dd", {
386
+ className: "font-medium text-text-primary",
387
+ children: X(e.subjectType)
388
+ })] }),
389
+ /* @__PURE__ */ E("div", {
390
+ className: "min-w-0",
391
+ children: [/* @__PURE__ */ T("dt", {
392
+ className: "text-xs text-text-secondary",
393
+ children: n("brainyrich.insights.card.subject", "Reference")
394
+ }), /* @__PURE__ */ T("dd", {
395
+ className: "truncate font-medium text-text-primary",
396
+ title: t ? `${t} (${e.subjectId})` : e.subjectId,
397
+ children: t ?? e.subjectId
398
+ })]
399
+ }),
400
+ /* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("dt", {
401
+ className: "text-xs text-text-secondary",
402
+ children: n("brainyrich.insights.card.created", "Created")
403
+ }), /* @__PURE__ */ T("dd", {
404
+ className: "font-medium text-text-primary",
405
+ children: h(e.createdAt)
406
+ })] })
407
+ ]
408
+ }),
409
+ /* @__PURE__ */ E("div", {
410
+ className: "flex flex-wrap items-center gap-2",
411
+ children: [/* @__PURE__ */ E(O, {
412
+ variant: "outline",
413
+ size: "sm",
414
+ disabled: o || e.status === "ACKNOWLEDGED" || f,
415
+ onClick: r,
416
+ children: [/* @__PURE__ */ T(x, {
417
+ className: "size-4",
418
+ "aria-hidden": "true"
419
+ }), n("brainyrich.insights.actions.acknowledge", "Acknowledge")]
420
+ }), /* @__PURE__ */ E(O, {
421
+ size: "sm",
422
+ disabled: c || e.status === "RESOLVED",
423
+ onClick: a,
424
+ children: [/* @__PURE__ */ T(x, {
425
+ className: "size-4",
426
+ "aria-hidden": "true"
427
+ }), n("brainyrich.insights.actions.resolve", "Resolve")]
428
+ })]
429
+ })
430
+ ]
431
+ }),
432
+ /* @__PURE__ */ T(d, {
433
+ open: p,
434
+ onOpenChange: m,
435
+ title: n("brainyrich.insights.dismiss.title", "Dismiss this insight?"),
436
+ description: n("brainyrich.insights.dismiss.description", "Dismissing removes this insight from active triage. You can still find it by filtering for dismissed insights."),
437
+ confirmLabel: n("brainyrich.insights.actions.dismiss", "Dismiss"),
438
+ pendingLabel: n("brainyrich.insights.dismiss.pending", "Dismissing…"),
439
+ destructive: !0,
440
+ pending: s,
441
+ onConfirm: i
442
+ })
443
+ ] });
444
+ }
445
+ function ye({ open: e, form: t, setField: n, metricsValid: r, valid: i, pending: a, onSubmit: o, onOpenChange: s, translate: c }) {
446
+ return /* @__PURE__ */ T(j, {
447
+ open: e,
448
+ onOpenChange: s,
449
+ children: /* @__PURE__ */ E(M, {
450
+ className: "max-h-[90vh] overflow-y-auto sm:max-w-lg",
451
+ children: [/* @__PURE__ */ E(fe, { children: [/* @__PURE__ */ T(F, { children: c("brainyrich.insights.form.createTitle", "New insight") }), /* @__PURE__ */ T(N, { children: c("brainyrich.insights.form.subtitle", "Flag an advisory insight against a portfolio, account, goal or household.") })] }), /* @__PURE__ */ E("form", {
452
+ className: "space-y-4",
453
+ onSubmit: (e) => {
454
+ e.preventDefault(), o();
455
+ },
456
+ children: [
457
+ /* @__PURE__ */ E("div", {
458
+ className: "space-y-1.5",
459
+ children: [/* @__PURE__ */ T(H, {
460
+ htmlFor: "insight-title",
461
+ children: c("brainyrich.insights.form.title", "Title")
462
+ }), /* @__PURE__ */ T(V, {
463
+ id: "insight-title",
464
+ value: t.title,
465
+ onChange: (e) => n("title", e.target.value),
466
+ placeholder: c("brainyrich.insights.form.titlePlaceholder", "e.g. Technology concentration above threshold"),
467
+ required: !0
468
+ })]
469
+ }),
470
+ /* @__PURE__ */ E("div", {
471
+ className: "grid grid-cols-2 gap-3",
472
+ children: [/* @__PURE__ */ E("div", {
473
+ className: "space-y-1.5",
474
+ children: [/* @__PURE__ */ T(H, {
475
+ htmlFor: "insight-type",
476
+ children: c("brainyrich.insights.form.type", "Type")
477
+ }), /* @__PURE__ */ E(U, {
478
+ value: t.type,
479
+ onValueChange: (e) => n("type", e),
480
+ children: [/* @__PURE__ */ T(K, {
481
+ id: "insight-type",
482
+ children: /* @__PURE__ */ T(q, {})
483
+ }), /* @__PURE__ */ T(W, { children: pe.map((e) => /* @__PURE__ */ T(G, {
484
+ value: e,
485
+ children: X(e)
486
+ }, e)) })]
487
+ })]
488
+ }), /* @__PURE__ */ E("div", {
489
+ className: "space-y-1.5",
490
+ children: [/* @__PURE__ */ T(H, {
491
+ htmlFor: "insight-severity",
492
+ children: c("brainyrich.insights.form.severity", "Severity")
493
+ }), /* @__PURE__ */ E(U, {
494
+ value: t.severity,
495
+ onValueChange: (e) => n("severity", e),
496
+ children: [/* @__PURE__ */ T(K, {
497
+ id: "insight-severity",
498
+ children: /* @__PURE__ */ T(q, {})
499
+ }), /* @__PURE__ */ T(W, { children: me.map((e) => /* @__PURE__ */ T(G, {
500
+ value: e,
501
+ children: X(e)
502
+ }, e)) })]
503
+ })]
504
+ })]
505
+ }),
506
+ /* @__PURE__ */ T(f, {
507
+ id: "insight-subject",
508
+ label: c("brainyrich.insights.form.subject", "Subject"),
509
+ placeholder: c("brainyrich.insights.form.subjectPlaceholder", "Select an account, portfolio, goal or household"),
510
+ value: t.subject,
511
+ onChange: (e) => n("subject", e)
512
+ }),
513
+ /* @__PURE__ */ E("div", {
514
+ className: "space-y-1.5",
515
+ children: [/* @__PURE__ */ T(H, {
516
+ htmlFor: "insight-owner",
517
+ children: c("brainyrich.insights.form.ownerId", "Owner ID (optional)")
518
+ }), /* @__PURE__ */ T(V, {
519
+ id: "insight-owner",
520
+ value: t.ownerId,
521
+ onChange: (e) => n("ownerId", e.target.value),
522
+ placeholder: c("brainyrich.insights.form.ownerIdPlaceholder", "Defaults to the current owner")
523
+ })]
524
+ }),
525
+ /* @__PURE__ */ E("div", {
526
+ className: "space-y-1.5",
527
+ children: [/* @__PURE__ */ T(H, {
528
+ htmlFor: "insight-detail",
529
+ children: c("brainyrich.insights.form.detail", "Detail")
530
+ }), /* @__PURE__ */ T(J, {
531
+ id: "insight-detail",
532
+ value: t.detail,
533
+ onChange: (e) => n("detail", e.target.value),
534
+ rows: 3,
535
+ placeholder: c("brainyrich.insights.form.detailPlaceholder", "Explain the finding and recommended action.")
536
+ })]
537
+ }),
538
+ /* @__PURE__ */ E("div", {
539
+ className: "space-y-1.5",
180
540
  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
- })]
190
- }),
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
- })]
541
+ /* @__PURE__ */ T(H, {
542
+ htmlFor: "insight-metrics",
543
+ children: c("brainyrich.insights.form.metrics", "Metrics JSON (optional)")
200
544
  }),
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
- })]
545
+ /* @__PURE__ */ T(J, {
546
+ id: "insight-metrics",
547
+ value: t.metrics,
548
+ onChange: (e) => n("metrics", e.target.value),
549
+ rows: 3,
550
+ className: "font-mono text-xs",
551
+ placeholder: "{ \"driftPct\": 8.2 }",
552
+ "aria-invalid": !r
210
553
  }),
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
- })]
554
+ r ? null : /* @__PURE__ */ E("p", {
555
+ className: "flex items-center gap-1 text-xs text-status-error-text",
556
+ children: [/* @__PURE__ */ T(y, {
557
+ className: "size-3.5",
558
+ "aria-hidden": "true"
559
+ }), c("brainyrich.insights.form.metricsInvalid", "Enter valid JSON or leave blank.")]
221
560
  })
222
561
  ]
562
+ }),
563
+ /* @__PURE__ */ E(P, { children: [/* @__PURE__ */ T(O, {
564
+ type: "button",
565
+ variant: "outline",
566
+ onClick: () => s(!1),
567
+ disabled: a,
568
+ children: c("brainyrich.insights.form.cancel", "Cancel")
569
+ }), /* @__PURE__ */ T(O, {
570
+ type: "submit",
571
+ disabled: !i || a,
572
+ children: a ? c("brainyrich.insights.form.saving", "Saving…") : c("brainyrich.insights.form.create", "Create insight")
223
573
  })] })
224
574
  ]
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))
329
- })]
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
- })]
378
- })]
379
- })
380
- ]
381
- })
382
575
  })]
383
576
  })
384
577
  });
385
578
  }
386
579
  //#endregion
387
- export { L as AiAssistantPage };
580
+ export { Z as AiAssistantPage };
388
581
 
389
582
  //# sourceMappingURL=AiAssistantPage.js.map