@burdenoff/microfe-brainyrich 2026.731.2 → 2026.731.3
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.d.ts.map +1 -1
- package/dist/brainyrich/BrainyRichRoot.js +60 -53
- package/dist/brainyrich/BrainyRichRoot.js.map +1 -1
- package/dist/brainyrich/BrainyRichRoutes.d.ts.map +1 -1
- package/dist/brainyrich/BrainyRichRoutes.js +20 -16
- package/dist/brainyrich/BrainyRichRoutes.js.map +1 -1
- package/dist/brainyrich/hooks/useBrainyRichApi.d.ts +696 -1
- package/dist/brainyrich/hooks/useBrainyRichApi.d.ts.map +1 -1
- package/dist/brainyrich/hooks/useBrainyRichApi.js +473 -266
- package/dist/brainyrich/hooks/useBrainyRichApi.js.map +1 -1
- package/dist/brainyrich/pages/FirmPage.d.ts +2 -0
- package/dist/brainyrich/pages/FirmPage.d.ts.map +1 -0
- package/dist/brainyrich/pages/FirmPage.js +255 -0
- package/dist/brainyrich/pages/FirmPage.js.map +1 -0
- package/dist/brainyrich/pages/ReportsPage.d.ts.map +1 -1
- package/dist/brainyrich/pages/ReportsPage.js +606 -331
- package/dist/brainyrich/pages/ReportsPage.js.map +1 -1
- package/dist/brainyrich/pages/RiskPage.d.ts.map +1 -1
- package/dist/brainyrich/pages/RiskPage.js +619 -403
- package/dist/brainyrich/pages/RiskPage.js.map +1 -1
- package/dist/brainyrich/types/bra.d.ts +161 -0
- package/dist/brainyrich/types/bra.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { useAcknowledgeInsight as e, useCreateRebalanceProposal as t,
|
|
2
|
-
import { LoadMore as
|
|
3
|
-
import { ConfirmDialog as
|
|
1
|
+
import { useAcknowledgeInsight as e, useCreateRebalanceProposal as t, useCreateTradeInstruction as n, useDismissInsight as r, useGenerateRiskInsights as i, useHarvestTaxLossInsights as a, useMarketQuote as o, usePagedInsights as s, usePortfolioRiskSignals as ee, usePortfolioRiskSummary as te, usePortfolios as ne, useRebalanceProposals as re, useResolveInsight as ie, useReviewTradeInstruction as ae, useTaxLossOpportunities as oe, useTradeInstructions as se, useTransitionRebalanceProposal as ce } from "../hooks/useBrainyRichApi.js";
|
|
2
|
+
import { LoadMore as le } from "../components/LoadMore.js";
|
|
3
|
+
import { ConfirmDialog as ue } from "../components/ConfirmDialog.js";
|
|
4
4
|
import { ActorName as c } from "../components/ActorName.js";
|
|
5
|
-
import { DonutChart as
|
|
5
|
+
import { DonutChart as de, FadeIn as l, GlassCard as fe, LifecycleStepper as pe, StatTile as u } from "../components/viz.js";
|
|
6
6
|
import "../components/index.js";
|
|
7
|
-
import { EmptyState as d, ErrorState as f, LoadingState as p, SectionShell as
|
|
8
|
-
import { CommentThread as
|
|
7
|
+
import { EmptyState as d, ErrorState as f, LoadingState as p, SectionShell as me, formatDate as m, formatMoney as h, formatPct as g, statusBadgeVariant as _ } from "./_shared.js";
|
|
8
|
+
import { CommentThread as he } from "../components/reuse/CommentThread.js";
|
|
9
9
|
import { useMemo as v, useState as y } from "react";
|
|
10
|
-
import { Activity as
|
|
11
|
-
import { Fragment as
|
|
12
|
-
import { Badge as
|
|
10
|
+
import { Activity as ge, AlertTriangle as _e, ArrowRight as ve, Check as ye, Eye as be, Gauge as b, Layers as xe, LineChart as Se, MoreHorizontal as Ce, Plus as we, RefreshCw as Te, Scale as Ee, Scissors as De, Search as Oe, ShieldAlert as x, ShieldCheck as S, Sparkles as ke, TrendingUp as Ae, X as C } from "lucide-react";
|
|
11
|
+
import { Fragment as je, jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
12
|
+
import { Badge as E, Button as D, Card as O, CardContent as k, CardDescription as A, CardHeader as j, CardTitle as M, Dialog as Me, DialogClose as Ne, DialogContent as Pe, DialogDescription as Fe, DialogFooter as Ie, DialogHeader as Le, DialogTitle as Re, DropdownMenu as ze, DropdownMenuContent as Be, DropdownMenuItem as N, DropdownMenuLabel as Ve, DropdownMenuSeparator as He, DropdownMenuTrigger as Ue, Input as P, Label as F, Select as We, SelectContent as Ge, SelectItem as Ke, SelectTrigger as qe, SelectValue as Je, Table as Ye, TableBody as Xe, TableCell as I, TableHead as L, TableHeader as Ze, TableRow as R, Textarea as Qe } from "@burdenoff/fe-libs/ui";
|
|
13
13
|
//#region src/brainyrich/pages/RiskPage.tsx
|
|
14
|
-
var
|
|
14
|
+
var $e = {
|
|
15
15
|
DRAFT: ["PROPOSED", "CANCELLED"],
|
|
16
16
|
PROPOSED: [
|
|
17
17
|
"APPROVED",
|
|
@@ -22,49 +22,49 @@ var Ke = {
|
|
|
22
22
|
REJECTED: [],
|
|
23
23
|
EXECUTED: [],
|
|
24
24
|
CANCELLED: []
|
|
25
|
-
},
|
|
25
|
+
}, et = new Set([
|
|
26
26
|
"DRIFT",
|
|
27
27
|
"CONCENTRATION_RISK",
|
|
28
28
|
"REBALANCE_DUE",
|
|
29
29
|
"CASH_DRAG",
|
|
30
30
|
"FEE_ANOMALY"
|
|
31
31
|
]);
|
|
32
|
-
function
|
|
32
|
+
function z(e) {
|
|
33
33
|
return e.toLowerCase().split("_").map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" ");
|
|
34
34
|
}
|
|
35
|
-
var
|
|
35
|
+
var tt = [
|
|
36
36
|
"Draft",
|
|
37
37
|
"Proposed",
|
|
38
38
|
"Approved",
|
|
39
39
|
"Executed"
|
|
40
|
-
],
|
|
40
|
+
], nt = {
|
|
41
41
|
DRAFT: "neutral",
|
|
42
42
|
PROPOSED: "warning",
|
|
43
43
|
APPROVED: "blue",
|
|
44
44
|
EXECUTED: "success",
|
|
45
45
|
REJECTED: "error",
|
|
46
46
|
CANCELLED: "neutral"
|
|
47
|
-
},
|
|
47
|
+
}, rt = [
|
|
48
48
|
"PROPOSED",
|
|
49
49
|
"DRAFT",
|
|
50
50
|
"APPROVED",
|
|
51
51
|
"EXECUTED",
|
|
52
52
|
"REJECTED",
|
|
53
53
|
"CANCELLED"
|
|
54
|
-
],
|
|
54
|
+
], it = {
|
|
55
55
|
CRITICAL: "error",
|
|
56
56
|
HIGH: "warning",
|
|
57
57
|
MEDIUM: "info",
|
|
58
58
|
LOW: "teal",
|
|
59
59
|
INFO: "neutral"
|
|
60
|
-
},
|
|
60
|
+
}, at = [
|
|
61
61
|
"CRITICAL",
|
|
62
62
|
"HIGH",
|
|
63
63
|
"MEDIUM",
|
|
64
64
|
"LOW",
|
|
65
65
|
"INFO"
|
|
66
66
|
];
|
|
67
|
-
function
|
|
67
|
+
function B(e) {
|
|
68
68
|
if (!Array.isArray(e) || e.length === 0) return null;
|
|
69
69
|
let t = [];
|
|
70
70
|
for (let n of e) {
|
|
@@ -101,14 +101,14 @@ function Qe(e) {
|
|
|
101
101
|
}
|
|
102
102
|
return t;
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function ot(e) {
|
|
105
105
|
return e == null ? "—" : typeof e == "number" ? Number.isInteger(e) ? e.toLocaleString() : e.toLocaleString(void 0, { maximumFractionDigits: 2 }) : typeof e == "boolean" ? e ? "Yes" : "No" : typeof e == "string" ? e : JSON.stringify(e);
|
|
106
106
|
}
|
|
107
|
-
function
|
|
107
|
+
function st(e) {
|
|
108
108
|
let t = (e ?? "").toUpperCase();
|
|
109
109
|
return t.includes("BUY") || t.includes("ADD") ? "text-status-success-text" : t.includes("SELL") || t.includes("TRIM") || t.includes("REDUCE") ? "text-status-error-text" : "text-text-secondary";
|
|
110
110
|
}
|
|
111
|
-
function
|
|
111
|
+
function ct(e) {
|
|
112
112
|
if (e == null) return "—";
|
|
113
113
|
if (Array.isArray(e)) return `${e.length} trade${e.length === 1 ? "" : "s"}`;
|
|
114
114
|
if (typeof e == "object") {
|
|
@@ -117,66 +117,66 @@ function $e(e) {
|
|
|
117
117
|
}
|
|
118
118
|
return String(e);
|
|
119
119
|
}
|
|
120
|
-
var
|
|
120
|
+
var lt = {
|
|
121
121
|
portfolioId: "",
|
|
122
122
|
driftPct: "",
|
|
123
123
|
rationale: "",
|
|
124
124
|
trades: ""
|
|
125
125
|
};
|
|
126
|
-
function
|
|
126
|
+
function ut(e) {
|
|
127
127
|
if (e.trim() === "") return;
|
|
128
128
|
let t = Number(e);
|
|
129
129
|
return Number.isFinite(t) ? t : void 0;
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
let { data: c, isLoading:
|
|
131
|
+
function V() {
|
|
132
|
+
let { data: c, isLoading: pe, isError: he, refetch: tt } = re(), { data: B } = ne(), [ot, st] = y(void 0), V = ot ?? B[0]?.id ?? "", { data: H, isLoading: ht, isError: gt, refetch: _t } = ee(V || void 0), vt = i(), { data: U, isFetching: yt, refetch: bt } = te(V || void 0), { data: W, isLoading: xt, isError: St, refetch: Ct } = oe(V || void 0), wt = a(), G = se(V || void 0), Tt = n(), K = ae(), [Et, Dt] = y(""), q = o(Et || void 0), [Ot, kt] = y(""), [At, jt] = y("BUY"), [Mt, Nt] = y(""), [Pt, Ft] = y(""), { items: It, hasMore: Lt, loadMore: Rt, isLoading: zt, isFetchingNextPage: Bt, isError: Vt, refetch: Ht } = s(), Ut = t(), J = ce(), Wt = e(), Gt = r(), Kt = ie(), [qt, Jt] = y(!1), [Y, X] = y(lt), [Yt, Xt] = y(null), [Zt, Qt] = y(null), [Z, $t] = y(null), Q = v(() => {
|
|
133
133
|
let e = /* @__PURE__ */ new Map();
|
|
134
|
-
for (let t of
|
|
134
|
+
for (let t of B) e.set(t.id, t);
|
|
135
135
|
return e;
|
|
136
|
-
}, [
|
|
136
|
+
}, [B]), en = v(() => It.filter((e) => et.has(e.type)), [It]), tn = c.filter((e) => e.status === "DRAFT" || e.status === "PROPOSED" || e.status === "APPROVED"), $ = en.filter((e) => e.status === "OPEN"), nn = c.length > 0 ? c.reduce((e, t) => e + (t.driftPct ?? 0), 0) / c.length : null, rn = v(() => c.filter((e) => {
|
|
137
137
|
let t = Q.get(e.portfolioId)?.driftThresholdPct;
|
|
138
138
|
return t != null && Number.isFinite(t) && e.driftPct >= t;
|
|
139
|
-
}).length, [c, Q]),
|
|
139
|
+
}).length, [c, Q]), an = v(() => [...c].sort((e, t) => new Date(e.createdAt).getTime() - new Date(t.createdAt).getTime()).map((e) => e.driftPct).filter((e) => Number.isFinite(e)), [c]), on = v(() => {
|
|
140
140
|
let e = /* @__PURE__ */ new Map();
|
|
141
141
|
for (let t of c) e.set(t.status, (e.get(t.status) ?? 0) + 1);
|
|
142
|
-
return
|
|
143
|
-
label:
|
|
142
|
+
return rt.filter((t) => (e.get(t) ?? 0) > 0).map((t) => ({
|
|
143
|
+
label: z(t),
|
|
144
144
|
value: e.get(t) ?? 0,
|
|
145
|
-
tone:
|
|
145
|
+
tone: nt[t]
|
|
146
146
|
}));
|
|
147
|
-
}, [c]),
|
|
147
|
+
}, [c]), sn = v(() => {
|
|
148
148
|
let e = /* @__PURE__ */ new Map();
|
|
149
149
|
for (let t of $) e.set(t.severity, (e.get(t.severity) ?? 0) + 1);
|
|
150
|
-
return
|
|
151
|
-
label:
|
|
150
|
+
return at.filter((t) => (e.get(t) ?? 0) > 0).map((t) => ({
|
|
151
|
+
label: z(t),
|
|
152
152
|
value: e.get(t) ?? 0,
|
|
153
|
-
tone:
|
|
153
|
+
tone: it[t]
|
|
154
154
|
}));
|
|
155
|
-
}, [$]),
|
|
156
|
-
function
|
|
157
|
-
X(
|
|
155
|
+
}, [$]), cn = B.length > 0;
|
|
156
|
+
function ln() {
|
|
157
|
+
X(lt), Xt(null), Jt(!0);
|
|
158
158
|
}
|
|
159
|
-
function
|
|
159
|
+
function un() {
|
|
160
160
|
if (!Y.portfolioId) return;
|
|
161
161
|
let e;
|
|
162
162
|
if (Y.trades.trim() !== "") try {
|
|
163
163
|
e = JSON.parse(Y.trades);
|
|
164
164
|
} catch {
|
|
165
|
-
|
|
165
|
+
Xt("Trades must be valid JSON.");
|
|
166
166
|
return;
|
|
167
167
|
}
|
|
168
168
|
let t = Q.get(Y.portfolioId);
|
|
169
|
-
|
|
169
|
+
Ut.mutate({
|
|
170
170
|
portfolioId: Y.portfolioId,
|
|
171
171
|
householdId: t?.householdId ?? null,
|
|
172
|
-
driftPct:
|
|
172
|
+
driftPct: ut(Y.driftPct),
|
|
173
173
|
rationale: Y.rationale.trim() || null,
|
|
174
174
|
...e === void 0 ? {} : { trades: e }
|
|
175
|
-
}, { onSuccess: () =>
|
|
175
|
+
}, { onSuccess: () => Jt(!1) });
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function dn(e, t) {
|
|
178
178
|
if (t === "REJECTED" || t === "CANCELLED") {
|
|
179
|
-
|
|
179
|
+
$t({
|
|
180
180
|
proposal: e,
|
|
181
181
|
status: t
|
|
182
182
|
});
|
|
@@ -187,63 +187,63 @@ function W() {
|
|
|
187
187
|
status: t
|
|
188
188
|
});
|
|
189
189
|
}
|
|
190
|
-
function
|
|
190
|
+
function fn(e) {
|
|
191
191
|
let t = Q.get(e.portfolioId)?.driftThresholdPct;
|
|
192
192
|
return t != null && Number.isFinite(t) && e.driftPct >= t;
|
|
193
193
|
}
|
|
194
|
-
return /* @__PURE__ */
|
|
194
|
+
return /* @__PURE__ */ T(me, {
|
|
195
195
|
title: "Risk & Rebalancing",
|
|
196
196
|
description: "Review drift-driven rebalance proposals and act on portfolio risk insights.",
|
|
197
|
-
badges: [`${
|
|
197
|
+
badges: [`${tn.length} active`, `${$.length} open insight${$.length === 1 ? "" : "s"}`],
|
|
198
198
|
actionLabel: "New proposal",
|
|
199
|
-
onAction:
|
|
199
|
+
onAction: ln,
|
|
200
200
|
children: [
|
|
201
|
-
/* @__PURE__ */
|
|
201
|
+
/* @__PURE__ */ T("div", {
|
|
202
202
|
className: "grid gap-4 sm:grid-cols-2 xl:grid-cols-4",
|
|
203
203
|
children: [
|
|
204
|
-
/* @__PURE__ */
|
|
204
|
+
/* @__PURE__ */ w(l, {
|
|
205
205
|
index: 0,
|
|
206
|
-
children: /* @__PURE__ */
|
|
206
|
+
children: /* @__PURE__ */ w(u, {
|
|
207
207
|
label: "Average drift",
|
|
208
|
-
value:
|
|
209
|
-
spark:
|
|
210
|
-
sparkTone:
|
|
208
|
+
value: nn === null ? "—" : g(nn),
|
|
209
|
+
spark: an.length > 1 ? an : void 0,
|
|
210
|
+
sparkTone: rn > 0 ? "error" : "brand",
|
|
211
211
|
glow: !0,
|
|
212
|
-
icon: /* @__PURE__ */
|
|
212
|
+
icon: /* @__PURE__ */ w(b, {
|
|
213
213
|
className: "size-4",
|
|
214
214
|
"aria-hidden": "true"
|
|
215
215
|
})
|
|
216
216
|
})
|
|
217
217
|
}),
|
|
218
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ w(l, {
|
|
219
219
|
index: 1,
|
|
220
|
-
children: /* @__PURE__ */
|
|
220
|
+
children: /* @__PURE__ */ w(u, {
|
|
221
221
|
label: "Active proposals",
|
|
222
|
-
value: String(
|
|
223
|
-
icon: /* @__PURE__ */
|
|
222
|
+
value: String(tn.length),
|
|
223
|
+
icon: /* @__PURE__ */ w(ge, {
|
|
224
224
|
className: "size-4",
|
|
225
225
|
"aria-hidden": "true"
|
|
226
226
|
})
|
|
227
227
|
})
|
|
228
228
|
}),
|
|
229
|
-
/* @__PURE__ */
|
|
229
|
+
/* @__PURE__ */ w(l, {
|
|
230
230
|
index: 2,
|
|
231
|
-
children: /* @__PURE__ */
|
|
231
|
+
children: /* @__PURE__ */ w(u, {
|
|
232
232
|
label: "Total proposals",
|
|
233
233
|
value: String(c.length),
|
|
234
|
-
icon: /* @__PURE__ */
|
|
234
|
+
icon: /* @__PURE__ */ w(xe, {
|
|
235
235
|
className: "size-4",
|
|
236
236
|
"aria-hidden": "true"
|
|
237
237
|
})
|
|
238
238
|
})
|
|
239
239
|
}),
|
|
240
|
-
/* @__PURE__ */
|
|
240
|
+
/* @__PURE__ */ w(l, {
|
|
241
241
|
index: 3,
|
|
242
|
-
children: /* @__PURE__ */
|
|
242
|
+
children: /* @__PURE__ */ w(u, {
|
|
243
243
|
label: "Open risk insights",
|
|
244
244
|
value: String($.length),
|
|
245
245
|
deltaTone: $.length > 0 ? "negative" : "neutral",
|
|
246
|
-
icon: /* @__PURE__ */
|
|
246
|
+
icon: /* @__PURE__ */ w(x, {
|
|
247
247
|
className: "size-4",
|
|
248
248
|
"aria-hidden": "true"
|
|
249
249
|
})
|
|
@@ -251,53 +251,53 @@ function W() {
|
|
|
251
251
|
})
|
|
252
252
|
]
|
|
253
253
|
}),
|
|
254
|
-
(
|
|
254
|
+
(on.length > 0 || sn.length > 0) && !pe ? /* @__PURE__ */ T("div", {
|
|
255
255
|
className: "grid gap-4 lg:grid-cols-2",
|
|
256
|
-
children: [/* @__PURE__ */
|
|
256
|
+
children: [/* @__PURE__ */ w(l, {
|
|
257
257
|
index: 0,
|
|
258
|
-
children: /* @__PURE__ */
|
|
258
|
+
children: /* @__PURE__ */ T(fe, {
|
|
259
259
|
glow: !0,
|
|
260
260
|
className: "h-full",
|
|
261
|
-
children: [/* @__PURE__ */
|
|
261
|
+
children: [/* @__PURE__ */ T("div", {
|
|
262
262
|
className: "mb-3 flex items-center gap-2",
|
|
263
|
-
children: [/* @__PURE__ */
|
|
263
|
+
children: [/* @__PURE__ */ w(Ae, {
|
|
264
264
|
className: "size-4 text-text-secondary",
|
|
265
265
|
"aria-hidden": "true"
|
|
266
|
-
}), /* @__PURE__ */
|
|
266
|
+
}), /* @__PURE__ */ w("h2", {
|
|
267
267
|
className: "text-sm font-semibold text-text-primary",
|
|
268
268
|
children: "Proposal pipeline"
|
|
269
269
|
})]
|
|
270
|
-
}), /* @__PURE__ */
|
|
271
|
-
data:
|
|
270
|
+
}), /* @__PURE__ */ w(de, {
|
|
271
|
+
data: on,
|
|
272
272
|
centerValue: String(c.length),
|
|
273
273
|
centerLabel: "proposals",
|
|
274
274
|
height: 200
|
|
275
275
|
})]
|
|
276
276
|
})
|
|
277
|
-
}), /* @__PURE__ */
|
|
277
|
+
}), /* @__PURE__ */ w(l, {
|
|
278
278
|
index: 1,
|
|
279
|
-
children: /* @__PURE__ */
|
|
279
|
+
children: /* @__PURE__ */ T(fe, {
|
|
280
280
|
className: "h-full",
|
|
281
|
-
children: [/* @__PURE__ */
|
|
281
|
+
children: [/* @__PURE__ */ T("div", {
|
|
282
282
|
className: "mb-3 flex items-center gap-2",
|
|
283
|
-
children: [/* @__PURE__ */
|
|
283
|
+
children: [/* @__PURE__ */ w(x, {
|
|
284
284
|
className: "size-4 text-text-secondary",
|
|
285
285
|
"aria-hidden": "true"
|
|
286
|
-
}), /* @__PURE__ */
|
|
286
|
+
}), /* @__PURE__ */ w("h2", {
|
|
287
287
|
className: "text-sm font-semibold text-text-primary",
|
|
288
288
|
children: "Open risk signals"
|
|
289
289
|
})]
|
|
290
|
-
}),
|
|
291
|
-
data:
|
|
290
|
+
}), sn.length > 0 ? /* @__PURE__ */ w(de, {
|
|
291
|
+
data: sn,
|
|
292
292
|
centerValue: String($.length),
|
|
293
293
|
centerLabel: "open",
|
|
294
294
|
height: 200
|
|
295
|
-
}) : /* @__PURE__ */
|
|
295
|
+
}) : /* @__PURE__ */ T("div", {
|
|
296
296
|
className: "flex h-[200px] flex-col items-center justify-center gap-2 text-center",
|
|
297
|
-
children: [/* @__PURE__ */
|
|
297
|
+
children: [/* @__PURE__ */ w(S, {
|
|
298
298
|
className: "size-8 text-status-success-text",
|
|
299
299
|
"aria-hidden": "true"
|
|
300
|
-
}), /* @__PURE__ */
|
|
300
|
+
}), /* @__PURE__ */ w("p", {
|
|
301
301
|
className: "text-sm text-text-secondary",
|
|
302
302
|
children: "No open risk signals."
|
|
303
303
|
})]
|
|
@@ -305,174 +305,174 @@ function W() {
|
|
|
305
305
|
})
|
|
306
306
|
})]
|
|
307
307
|
}) : null,
|
|
308
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ T(O, { children: [/* @__PURE__ */ T(j, { children: [/* @__PURE__ */ T(M, {
|
|
309
309
|
className: "flex items-center gap-2",
|
|
310
|
-
children: [/* @__PURE__ */
|
|
310
|
+
children: [/* @__PURE__ */ w(b, {
|
|
311
311
|
className: "h-5 w-5",
|
|
312
312
|
"aria-hidden": "true"
|
|
313
313
|
}), "Portfolio risk signals"]
|
|
314
|
-
}), /* @__PURE__ */
|
|
314
|
+
}), /* @__PURE__ */ w(A, { children: "Real, explainable signals computed live from this portfolio's own holdings and target allocation — every signal below shows the real inputs and formula/threshold behind it. Informational only, never a buy/sell recommendation." })] }), /* @__PURE__ */ T(k, {
|
|
315
315
|
className: "space-y-4",
|
|
316
|
-
children: [/* @__PURE__ */
|
|
316
|
+
children: [/* @__PURE__ */ T("div", {
|
|
317
317
|
className: "flex flex-wrap items-center gap-3",
|
|
318
318
|
children: [
|
|
319
|
-
/* @__PURE__ */
|
|
319
|
+
/* @__PURE__ */ T("div", {
|
|
320
320
|
className: "min-w-[220px] space-y-1.5",
|
|
321
|
-
children: [/* @__PURE__ */
|
|
321
|
+
children: [/* @__PURE__ */ w(F, {
|
|
322
322
|
htmlFor: "risk-portfolio",
|
|
323
323
|
children: "Portfolio"
|
|
324
|
-
}), /* @__PURE__ */
|
|
325
|
-
value:
|
|
326
|
-
onValueChange:
|
|
327
|
-
children: [/* @__PURE__ */
|
|
324
|
+
}), /* @__PURE__ */ T(We, {
|
|
325
|
+
value: V,
|
|
326
|
+
onValueChange: st,
|
|
327
|
+
children: [/* @__PURE__ */ w(qe, {
|
|
328
328
|
id: "risk-portfolio",
|
|
329
|
-
children: /* @__PURE__ */
|
|
330
|
-
}), /* @__PURE__ */
|
|
329
|
+
children: /* @__PURE__ */ w(Je, { placeholder: "Select a portfolio" })
|
|
330
|
+
}), /* @__PURE__ */ w(Ge, { children: B.map((e) => /* @__PURE__ */ w(Ke, {
|
|
331
331
|
value: e.id,
|
|
332
332
|
children: e.name
|
|
333
333
|
}, e.id)) })]
|
|
334
334
|
})]
|
|
335
335
|
}),
|
|
336
|
-
/* @__PURE__ */ D
|
|
336
|
+
/* @__PURE__ */ T(D, {
|
|
337
337
|
variant: "outline",
|
|
338
338
|
size: "sm",
|
|
339
339
|
className: "mt-auto",
|
|
340
|
-
disabled: !
|
|
341
|
-
onClick: () =>
|
|
342
|
-
children: [/* @__PURE__ */
|
|
340
|
+
disabled: !V || ht,
|
|
341
|
+
onClick: () => _t(),
|
|
342
|
+
children: [/* @__PURE__ */ w(Te, {
|
|
343
343
|
className: "size-4",
|
|
344
344
|
"aria-hidden": "true"
|
|
345
345
|
}), "Recompute"]
|
|
346
346
|
}),
|
|
347
|
-
/* @__PURE__ */ D
|
|
347
|
+
/* @__PURE__ */ T(D, {
|
|
348
348
|
variant: "outline",
|
|
349
349
|
size: "sm",
|
|
350
350
|
className: "mt-auto",
|
|
351
|
-
disabled: !
|
|
352
|
-
onClick: () =>
|
|
353
|
-
children: [/* @__PURE__ */
|
|
351
|
+
disabled: !V || (H?.signals.length ?? 0) === 0 || vt.isPending,
|
|
352
|
+
onClick: () => vt.mutate(V),
|
|
353
|
+
children: [/* @__PURE__ */ w(x, {
|
|
354
354
|
className: "size-4",
|
|
355
355
|
"aria-hidden": "true"
|
|
356
|
-
}),
|
|
356
|
+
}), vt.isPending ? "Saving…" : "Save as insights"]
|
|
357
357
|
})
|
|
358
358
|
]
|
|
359
|
-
}),
|
|
360
|
-
icon: /* @__PURE__ */
|
|
359
|
+
}), B.length === 0 ? /* @__PURE__ */ w(d, {
|
|
360
|
+
icon: /* @__PURE__ */ w(b, {
|
|
361
361
|
className: "size-6",
|
|
362
362
|
"aria-hidden": "true"
|
|
363
363
|
}),
|
|
364
364
|
title: "No portfolios yet",
|
|
365
365
|
description: "Create a portfolio to compute real risk signals from its holdings."
|
|
366
|
-
}) :
|
|
366
|
+
}) : ht ? /* @__PURE__ */ w(p, {}) : gt ? /* @__PURE__ */ w(f, { onRetry: () => _t() }) : H ? /* @__PURE__ */ T("div", {
|
|
367
367
|
className: "space-y-4",
|
|
368
368
|
children: [
|
|
369
|
-
/* @__PURE__ */
|
|
369
|
+
/* @__PURE__ */ T("div", {
|
|
370
370
|
className: "grid gap-3 sm:grid-cols-3",
|
|
371
371
|
children: [
|
|
372
|
-
/* @__PURE__ */
|
|
372
|
+
/* @__PURE__ */ w(u, {
|
|
373
373
|
label: "Portfolio value",
|
|
374
|
-
value: h(
|
|
375
|
-
icon: /* @__PURE__ */
|
|
374
|
+
value: h(H.totalValue),
|
|
375
|
+
icon: /* @__PURE__ */ w(xe, {
|
|
376
376
|
className: "size-4",
|
|
377
377
|
"aria-hidden": "true"
|
|
378
378
|
})
|
|
379
379
|
}),
|
|
380
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ w(u, {
|
|
381
381
|
label: "Holdings considered",
|
|
382
|
-
value: String(
|
|
383
|
-
icon: /* @__PURE__ */
|
|
382
|
+
value: String(H.holdingsConsidered),
|
|
383
|
+
icon: /* @__PURE__ */ w(ge, {
|
|
384
384
|
className: "size-4",
|
|
385
385
|
"aria-hidden": "true"
|
|
386
386
|
})
|
|
387
387
|
}),
|
|
388
|
-
/* @__PURE__ */
|
|
388
|
+
/* @__PURE__ */ w(u, {
|
|
389
389
|
label: "Signals breached",
|
|
390
|
-
value: String(
|
|
391
|
-
deltaTone:
|
|
392
|
-
icon: /* @__PURE__ */
|
|
390
|
+
value: String(H.signals.length),
|
|
391
|
+
deltaTone: H.signals.length > 0 ? "negative" : "neutral",
|
|
392
|
+
icon: /* @__PURE__ */ w(x, {
|
|
393
393
|
className: "size-4",
|
|
394
394
|
"aria-hidden": "true"
|
|
395
395
|
})
|
|
396
396
|
})
|
|
397
397
|
]
|
|
398
398
|
}),
|
|
399
|
-
|
|
400
|
-
icon: /* @__PURE__ */
|
|
399
|
+
H.signals.length === 0 ? /* @__PURE__ */ w(d, {
|
|
400
|
+
icon: /* @__PURE__ */ w(S, {
|
|
401
401
|
className: "size-6",
|
|
402
402
|
"aria-hidden": "true"
|
|
403
403
|
}),
|
|
404
404
|
title: "No configured threshold was breached",
|
|
405
405
|
description: "This portfolio's concentration, cash, drift and unrealized-loss metrics are all within their configured thresholds."
|
|
406
|
-
}) : /* @__PURE__ */
|
|
406
|
+
}) : /* @__PURE__ */ w("ul", {
|
|
407
407
|
className: "space-y-3",
|
|
408
|
-
children:
|
|
408
|
+
children: H.signals.map((e, t) => /* @__PURE__ */ w(ft, { signal: e }, `${e.kind}-${t}`))
|
|
409
409
|
}),
|
|
410
|
-
/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ T("div", {
|
|
411
411
|
className: "rounded-xl border border-border-subtle bg-bg-surface p-4",
|
|
412
|
-
children: [/* @__PURE__ */
|
|
412
|
+
children: [/* @__PURE__ */ T("div", {
|
|
413
413
|
className: "flex flex-wrap items-center justify-between gap-2",
|
|
414
|
-
children: [/* @__PURE__ */
|
|
414
|
+
children: [/* @__PURE__ */ T("div", {
|
|
415
415
|
className: "flex items-center gap-2",
|
|
416
416
|
children: [
|
|
417
|
-
/* @__PURE__ */
|
|
417
|
+
/* @__PURE__ */ w(ke, {
|
|
418
418
|
className: "size-4 text-text-secondary",
|
|
419
419
|
"aria-hidden": "true"
|
|
420
420
|
}),
|
|
421
|
-
/* @__PURE__ */
|
|
421
|
+
/* @__PURE__ */ w("h3", {
|
|
422
422
|
className: "text-sm font-semibold text-text-primary",
|
|
423
423
|
children: "AI summary"
|
|
424
424
|
}),
|
|
425
|
-
/* @__PURE__ */
|
|
425
|
+
/* @__PURE__ */ w("span", {
|
|
426
426
|
className: "text-xs text-text-muted",
|
|
427
427
|
children: "(optional — plain-language restatement of the signals above; never a source of numbers)"
|
|
428
428
|
})
|
|
429
429
|
]
|
|
430
|
-
}), /* @__PURE__ */ D
|
|
430
|
+
}), /* @__PURE__ */ T(D, {
|
|
431
431
|
variant: "outline",
|
|
432
432
|
size: "sm",
|
|
433
|
-
disabled: !
|
|
434
|
-
onClick: () =>
|
|
435
|
-
children: [/* @__PURE__ */
|
|
433
|
+
disabled: !V || yt,
|
|
434
|
+
onClick: () => bt(),
|
|
435
|
+
children: [/* @__PURE__ */ w(ke, {
|
|
436
436
|
className: "size-4",
|
|
437
437
|
"aria-hidden": "true"
|
|
438
|
-
}),
|
|
438
|
+
}), yt ? "Generating…" : "Generate AI summary"]
|
|
439
439
|
})]
|
|
440
|
-
}),
|
|
440
|
+
}), yt ? /* @__PURE__ */ w("p", {
|
|
441
441
|
className: "mt-2 text-sm text-text-secondary",
|
|
442
442
|
children: "Asking the AI provider…"
|
|
443
|
-
}) :
|
|
443
|
+
}) : U?.generated ? /* @__PURE__ */ T("div", {
|
|
444
444
|
className: "mt-2 space-y-1",
|
|
445
|
-
children: [/* @__PURE__ */
|
|
445
|
+
children: [/* @__PURE__ */ w("p", {
|
|
446
446
|
className: "text-sm text-text-primary",
|
|
447
|
-
children:
|
|
448
|
-
}), /* @__PURE__ */
|
|
447
|
+
children: U.summary
|
|
448
|
+
}), /* @__PURE__ */ T("p", {
|
|
449
449
|
className: "text-xs text-text-muted",
|
|
450
450
|
children: [
|
|
451
451
|
"AI-generated commentary",
|
|
452
|
-
|
|
452
|
+
U.provider ? ` · ${U.provider}` : "",
|
|
453
453
|
" · based on",
|
|
454
454
|
" ",
|
|
455
|
-
|
|
455
|
+
U.signalsConsidered,
|
|
456
456
|
" computed signal",
|
|
457
|
-
|
|
457
|
+
U.signalsConsidered === 1 ? "" : "s",
|
|
458
458
|
" above"
|
|
459
459
|
]
|
|
460
460
|
})]
|
|
461
|
-
}) :
|
|
461
|
+
}) : U && !U.generated ? /* @__PURE__ */ T("p", {
|
|
462
462
|
className: "mt-2 text-sm text-text-secondary",
|
|
463
463
|
children: [
|
|
464
464
|
"AI summary unavailable — ",
|
|
465
|
-
|
|
465
|
+
U.reason ?? "no provider configured",
|
|
466
466
|
". The deterministic signals above are unaffected."
|
|
467
467
|
]
|
|
468
|
-
}) : /* @__PURE__ */
|
|
468
|
+
}) : /* @__PURE__ */ w("p", {
|
|
469
469
|
className: "mt-2 text-sm text-text-muted",
|
|
470
470
|
children: "Not generated yet. The deterministic signals above always work without this."
|
|
471
471
|
})]
|
|
472
472
|
})
|
|
473
473
|
]
|
|
474
|
-
}) : /* @__PURE__ */
|
|
475
|
-
icon: /* @__PURE__ */
|
|
474
|
+
}) : /* @__PURE__ */ w(d, {
|
|
475
|
+
icon: /* @__PURE__ */ w(b, {
|
|
476
476
|
className: "size-6",
|
|
477
477
|
"aria-hidden": "true"
|
|
478
478
|
}),
|
|
@@ -480,67 +480,67 @@ function W() {
|
|
|
480
480
|
description: "Choose a portfolio above to compute its real risk signals."
|
|
481
481
|
})]
|
|
482
482
|
})] }),
|
|
483
|
-
/* @__PURE__ */
|
|
483
|
+
/* @__PURE__ */ T(O, { children: [/* @__PURE__ */ T(j, { children: [/* @__PURE__ */ T(M, {
|
|
484
484
|
className: "flex items-center gap-2",
|
|
485
|
-
children: [/* @__PURE__ */
|
|
485
|
+
children: [/* @__PURE__ */ w(De, {
|
|
486
486
|
className: "h-5 w-5",
|
|
487
487
|
"aria-hidden": "true"
|
|
488
488
|
}), "Tax-loss-harvesting opportunities"]
|
|
489
|
-
}), /* @__PURE__ */
|
|
489
|
+
}), /* @__PURE__ */ w(A, { children: "Real unrealized-loss detection for the selected portfolio, using configurable dollar/percent thresholds and a wash-sale caution flag from your recorded transactions. Detection only — this never places a trade, and it is not tax advice." })] }), /* @__PURE__ */ T(k, {
|
|
490
490
|
className: "space-y-4",
|
|
491
|
-
children: [/* @__PURE__ */
|
|
491
|
+
children: [/* @__PURE__ */ T("div", {
|
|
492
492
|
className: "flex flex-wrap items-center gap-3",
|
|
493
493
|
children: [
|
|
494
|
-
/* @__PURE__ */ D
|
|
494
|
+
/* @__PURE__ */ T(D, {
|
|
495
495
|
variant: "outline",
|
|
496
496
|
size: "sm",
|
|
497
|
-
disabled: !
|
|
498
|
-
onClick: () =>
|
|
499
|
-
children: [/* @__PURE__ */
|
|
497
|
+
disabled: !V || xt,
|
|
498
|
+
onClick: () => Ct(),
|
|
499
|
+
children: [/* @__PURE__ */ w(Te, {
|
|
500
500
|
className: "size-4",
|
|
501
501
|
"aria-hidden": "true"
|
|
502
502
|
}), "Recompute"]
|
|
503
503
|
}),
|
|
504
|
-
/* @__PURE__ */ D
|
|
504
|
+
/* @__PURE__ */ T(D, {
|
|
505
505
|
variant: "outline",
|
|
506
506
|
size: "sm",
|
|
507
|
-
disabled: !
|
|
508
|
-
onClick: () =>
|
|
509
|
-
children: [/* @__PURE__ */
|
|
507
|
+
disabled: !V || (W?.opportunities.length ?? 0) === 0 || wt.isPending,
|
|
508
|
+
onClick: () => wt.mutate({ portfolioId: V }),
|
|
509
|
+
children: [/* @__PURE__ */ w(x, {
|
|
510
510
|
className: "size-4",
|
|
511
511
|
"aria-hidden": "true"
|
|
512
|
-
}),
|
|
512
|
+
}), wt.isPending ? "Saving…" : "Save as insights"]
|
|
513
513
|
}),
|
|
514
|
-
|
|
514
|
+
W ? /* @__PURE__ */ T("span", {
|
|
515
515
|
className: "text-xs text-text-muted",
|
|
516
516
|
children: [
|
|
517
517
|
"Thresholds: ≥",
|
|
518
|
-
h(
|
|
518
|
+
h(W.thresholds.minLossAmount),
|
|
519
519
|
" or ≥",
|
|
520
|
-
g(
|
|
520
|
+
g(W.thresholds.minLossPct),
|
|
521
521
|
" of portfolio value"
|
|
522
522
|
]
|
|
523
523
|
}) : null
|
|
524
524
|
]
|
|
525
|
-
}),
|
|
526
|
-
icon: /* @__PURE__ */
|
|
525
|
+
}), B.length === 0 ? /* @__PURE__ */ w(d, {
|
|
526
|
+
icon: /* @__PURE__ */ w(De, {
|
|
527
527
|
className: "size-6",
|
|
528
528
|
"aria-hidden": "true"
|
|
529
529
|
}),
|
|
530
530
|
title: "No portfolios yet",
|
|
531
531
|
description: "Create a portfolio to detect real tax-loss-harvesting opportunities from its holdings."
|
|
532
|
-
}) :
|
|
532
|
+
}) : xt ? /* @__PURE__ */ w(p, {}) : St ? /* @__PURE__ */ w(f, { onRetry: () => Ct() }) : W && W.opportunities.length > 0 ? /* @__PURE__ */ w("ul", {
|
|
533
533
|
className: "space-y-3",
|
|
534
|
-
children:
|
|
535
|
-
}) :
|
|
536
|
-
icon: /* @__PURE__ */
|
|
534
|
+
children: W.opportunities.map((e) => /* @__PURE__ */ w(pt, { opportunity: e }, e.symbol))
|
|
535
|
+
}) : W ? /* @__PURE__ */ w(d, {
|
|
536
|
+
icon: /* @__PURE__ */ w(S, {
|
|
537
537
|
className: "size-6",
|
|
538
538
|
"aria-hidden": "true"
|
|
539
539
|
}),
|
|
540
540
|
title: "No opportunities at the current thresholds",
|
|
541
541
|
description: "No symbol's unrealized loss clears the configured dollar/percent thresholds."
|
|
542
|
-
}) : /* @__PURE__ */
|
|
543
|
-
icon: /* @__PURE__ */
|
|
542
|
+
}) : /* @__PURE__ */ w(d, {
|
|
543
|
+
icon: /* @__PURE__ */ w(De, {
|
|
544
544
|
className: "size-6",
|
|
545
545
|
"aria-hidden": "true"
|
|
546
546
|
}),
|
|
@@ -548,75 +548,291 @@ function W() {
|
|
|
548
548
|
description: "Choose a portfolio above to detect real tax-loss opportunities."
|
|
549
549
|
})]
|
|
550
550
|
})] }),
|
|
551
|
-
/* @__PURE__ */
|
|
551
|
+
/* @__PURE__ */ T(O, { children: [/* @__PURE__ */ T(j, { children: [/* @__PURE__ */ T(M, {
|
|
552
|
+
className: "flex items-center gap-2",
|
|
553
|
+
children: [/* @__PURE__ */ w(Se, {
|
|
554
|
+
className: "h-5 w-5",
|
|
555
|
+
"aria-hidden": "true"
|
|
556
|
+
}), "Trade instructions"]
|
|
557
|
+
}), /* @__PURE__ */ w(A, { children: "Real BUY/SELL recommendations for a human advisor to review and manually execute elsewhere — this never submits an order anywhere. Reference prices come from a real live market-data feed." })] }), /* @__PURE__ */ T(k, {
|
|
558
|
+
className: "space-y-4",
|
|
559
|
+
children: [
|
|
560
|
+
/* @__PURE__ */ T("div", {
|
|
561
|
+
className: "flex flex-wrap items-end gap-3 rounded-lg border border-border-subtle bg-bg-sunken p-3",
|
|
562
|
+
children: [/* @__PURE__ */ T("div", {
|
|
563
|
+
className: "space-y-1.5",
|
|
564
|
+
children: [/* @__PURE__ */ w(F, {
|
|
565
|
+
htmlFor: "quote-symbol",
|
|
566
|
+
children: "Live quote lookup"
|
|
567
|
+
}), /* @__PURE__ */ T("div", {
|
|
568
|
+
className: "flex gap-2",
|
|
569
|
+
children: [/* @__PURE__ */ w(P, {
|
|
570
|
+
id: "quote-symbol",
|
|
571
|
+
value: Et,
|
|
572
|
+
onChange: (e) => Dt(e.target.value.toUpperCase()),
|
|
573
|
+
placeholder: "AAPL",
|
|
574
|
+
className: "w-28"
|
|
575
|
+
}), /* @__PURE__ */ T(D, {
|
|
576
|
+
variant: "outline",
|
|
577
|
+
size: "sm",
|
|
578
|
+
disabled: !Et || q.isFetching,
|
|
579
|
+
onClick: () => q.refetch(),
|
|
580
|
+
children: [/* @__PURE__ */ w(Oe, {
|
|
581
|
+
className: "size-4",
|
|
582
|
+
"aria-hidden": "true"
|
|
583
|
+
}), "Quote"]
|
|
584
|
+
})]
|
|
585
|
+
})]
|
|
586
|
+
}), q.data ? /* @__PURE__ */ T("span", {
|
|
587
|
+
className: "text-sm text-text-primary",
|
|
588
|
+
children: [
|
|
589
|
+
q.data.symbol,
|
|
590
|
+
":",
|
|
591
|
+
" ",
|
|
592
|
+
/* @__PURE__ */ w("span", {
|
|
593
|
+
className: "font-semibold",
|
|
594
|
+
children: h(q.data.price, q.data.currency ?? "USD")
|
|
595
|
+
}),
|
|
596
|
+
" ",
|
|
597
|
+
/* @__PURE__ */ T("span", {
|
|
598
|
+
className: "text-xs text-text-muted",
|
|
599
|
+
children: ["via ", q.data.source]
|
|
600
|
+
})
|
|
601
|
+
]
|
|
602
|
+
}) : q.isError ? /* @__PURE__ */ w("span", {
|
|
603
|
+
className: "text-sm text-status-error-text",
|
|
604
|
+
children: "Quote unavailable"
|
|
605
|
+
}) : null]
|
|
606
|
+
}),
|
|
607
|
+
/* @__PURE__ */ T("div", {
|
|
608
|
+
className: "grid gap-3 rounded-lg border border-border-subtle bg-bg-sunken p-3 sm:grid-cols-5 sm:items-end",
|
|
609
|
+
children: [
|
|
610
|
+
/* @__PURE__ */ T("div", {
|
|
611
|
+
className: "space-y-1.5",
|
|
612
|
+
children: [/* @__PURE__ */ w(F, {
|
|
613
|
+
htmlFor: "ti-symbol",
|
|
614
|
+
children: "Symbol"
|
|
615
|
+
}), /* @__PURE__ */ w(P, {
|
|
616
|
+
id: "ti-symbol",
|
|
617
|
+
value: Ot,
|
|
618
|
+
onChange: (e) => kt(e.target.value.toUpperCase()),
|
|
619
|
+
placeholder: "MSFT"
|
|
620
|
+
})]
|
|
621
|
+
}),
|
|
622
|
+
/* @__PURE__ */ T("div", {
|
|
623
|
+
className: "space-y-1.5",
|
|
624
|
+
children: [/* @__PURE__ */ w(F, { children: "Action" }), /* @__PURE__ */ T(We, {
|
|
625
|
+
value: At,
|
|
626
|
+
onValueChange: (e) => jt(e),
|
|
627
|
+
children: [/* @__PURE__ */ w(qe, { children: /* @__PURE__ */ w(Je, {}) }), /* @__PURE__ */ T(Ge, { children: [/* @__PURE__ */ w(Ke, {
|
|
628
|
+
value: "BUY",
|
|
629
|
+
children: "Buy"
|
|
630
|
+
}), /* @__PURE__ */ w(Ke, {
|
|
631
|
+
value: "SELL",
|
|
632
|
+
children: "Sell"
|
|
633
|
+
})] })]
|
|
634
|
+
})]
|
|
635
|
+
}),
|
|
636
|
+
/* @__PURE__ */ T("div", {
|
|
637
|
+
className: "space-y-1.5",
|
|
638
|
+
children: [/* @__PURE__ */ w(F, {
|
|
639
|
+
htmlFor: "ti-quantity",
|
|
640
|
+
children: "Quantity"
|
|
641
|
+
}), /* @__PURE__ */ w(P, {
|
|
642
|
+
id: "ti-quantity",
|
|
643
|
+
type: "number",
|
|
644
|
+
min: "0",
|
|
645
|
+
step: "any",
|
|
646
|
+
value: Mt,
|
|
647
|
+
onChange: (e) => Nt(e.target.value)
|
|
648
|
+
})]
|
|
649
|
+
}),
|
|
650
|
+
/* @__PURE__ */ T("div", {
|
|
651
|
+
className: "space-y-1.5 sm:col-span-2",
|
|
652
|
+
children: [/* @__PURE__ */ w(F, {
|
|
653
|
+
htmlFor: "ti-rationale",
|
|
654
|
+
children: "Rationale"
|
|
655
|
+
}), /* @__PURE__ */ w(P, {
|
|
656
|
+
id: "ti-rationale",
|
|
657
|
+
value: Pt,
|
|
658
|
+
onChange: (e) => Ft(e.target.value),
|
|
659
|
+
placeholder: "Optional"
|
|
660
|
+
})]
|
|
661
|
+
}),
|
|
662
|
+
/* @__PURE__ */ w("div", {
|
|
663
|
+
className: "sm:col-span-5",
|
|
664
|
+
children: /* @__PURE__ */ T(D, {
|
|
665
|
+
size: "sm",
|
|
666
|
+
disabled: !V || !Ot.trim() || !Mt || Number(Mt) <= 0 || Tt.isPending,
|
|
667
|
+
onClick: () => {
|
|
668
|
+
Tt.mutate({
|
|
669
|
+
portfolioId: V,
|
|
670
|
+
symbol: Ot.trim(),
|
|
671
|
+
action: At,
|
|
672
|
+
quantity: Number(Mt),
|
|
673
|
+
rationale: Pt.trim() || void 0
|
|
674
|
+
}, { onSuccess: () => {
|
|
675
|
+
kt(""), Nt(""), Ft("");
|
|
676
|
+
} });
|
|
677
|
+
},
|
|
678
|
+
children: [/* @__PURE__ */ w(we, {
|
|
679
|
+
className: "size-4",
|
|
680
|
+
"aria-hidden": "true"
|
|
681
|
+
}), Tt.isPending ? "Creating…" : "Create instruction"]
|
|
682
|
+
})
|
|
683
|
+
})
|
|
684
|
+
]
|
|
685
|
+
}),
|
|
686
|
+
V ? G.isLoading ? /* @__PURE__ */ w(p, {}) : G.isError ? /* @__PURE__ */ w(f, { onRetry: () => G.refetch() }) : G.data.length === 0 ? /* @__PURE__ */ w(d, {
|
|
687
|
+
icon: /* @__PURE__ */ w(Se, {
|
|
688
|
+
className: "size-6",
|
|
689
|
+
"aria-hidden": "true"
|
|
690
|
+
}),
|
|
691
|
+
title: "No trade instructions yet",
|
|
692
|
+
description: "Create one above, or generate one from a rebalance proposal's trades."
|
|
693
|
+
}) : /* @__PURE__ */ T(Ye, { children: [/* @__PURE__ */ w(Ze, { children: /* @__PURE__ */ T(R, { children: [
|
|
694
|
+
/* @__PURE__ */ w(L, { children: "Symbol" }),
|
|
695
|
+
/* @__PURE__ */ w(L, { children: "Action" }),
|
|
696
|
+
/* @__PURE__ */ w(L, { children: "Qty" }),
|
|
697
|
+
/* @__PURE__ */ w(L, { children: "Reference price" }),
|
|
698
|
+
/* @__PURE__ */ w(L, { children: "Source" }),
|
|
699
|
+
/* @__PURE__ */ w(L, { children: "Status" }),
|
|
700
|
+
/* @__PURE__ */ w(L, {
|
|
701
|
+
className: "text-right",
|
|
702
|
+
children: "Review"
|
|
703
|
+
})
|
|
704
|
+
] }) }), /* @__PURE__ */ w(Xe, { children: G.data.map((e) => /* @__PURE__ */ T(R, { children: [
|
|
705
|
+
/* @__PURE__ */ w(I, {
|
|
706
|
+
className: "font-medium",
|
|
707
|
+
children: e.symbol
|
|
708
|
+
}),
|
|
709
|
+
/* @__PURE__ */ w(I, { children: /* @__PURE__ */ w(E, {
|
|
710
|
+
variant: e.action === "BUY" ? "default" : "secondary",
|
|
711
|
+
children: e.action
|
|
712
|
+
}) }),
|
|
713
|
+
/* @__PURE__ */ w(I, { children: e.quantity }),
|
|
714
|
+
/* @__PURE__ */ w(I, { children: e.referencePrice == null ? "—" : h(e.referencePrice) }),
|
|
715
|
+
/* @__PURE__ */ w(I, {
|
|
716
|
+
className: "text-xs text-text-muted",
|
|
717
|
+
children: e.priceSource ?? "—"
|
|
718
|
+
}),
|
|
719
|
+
/* @__PURE__ */ w(I, { children: /* @__PURE__ */ w(E, {
|
|
720
|
+
variant: _(e.status),
|
|
721
|
+
children: e.status
|
|
722
|
+
}) }),
|
|
723
|
+
/* @__PURE__ */ w(I, {
|
|
724
|
+
className: "text-right",
|
|
725
|
+
children: e.status === "PENDING_REVIEW" ? /* @__PURE__ */ T("div", {
|
|
726
|
+
className: "flex justify-end gap-1.5",
|
|
727
|
+
children: [/* @__PURE__ */ w(D, {
|
|
728
|
+
size: "sm",
|
|
729
|
+
variant: "ghost",
|
|
730
|
+
disabled: K.isPending,
|
|
731
|
+
onClick: () => K.mutate({
|
|
732
|
+
id: e.id,
|
|
733
|
+
status: "ACKNOWLEDGED"
|
|
734
|
+
}),
|
|
735
|
+
children: /* @__PURE__ */ w(ye, {
|
|
736
|
+
className: "size-4",
|
|
737
|
+
"aria-hidden": "true"
|
|
738
|
+
})
|
|
739
|
+
}), /* @__PURE__ */ w(D, {
|
|
740
|
+
size: "sm",
|
|
741
|
+
variant: "ghost",
|
|
742
|
+
disabled: K.isPending,
|
|
743
|
+
onClick: () => K.mutate({
|
|
744
|
+
id: e.id,
|
|
745
|
+
status: "DISMISSED"
|
|
746
|
+
}),
|
|
747
|
+
children: /* @__PURE__ */ w(C, {
|
|
748
|
+
className: "size-4",
|
|
749
|
+
"aria-hidden": "true"
|
|
750
|
+
})
|
|
751
|
+
})]
|
|
752
|
+
}) : /* @__PURE__ */ w("span", {
|
|
753
|
+
className: "text-xs text-text-muted",
|
|
754
|
+
children: "Reviewed"
|
|
755
|
+
})
|
|
756
|
+
})
|
|
757
|
+
] }, e.id)) })] }) : /* @__PURE__ */ w(d, {
|
|
758
|
+
icon: /* @__PURE__ */ w(Se, {
|
|
759
|
+
className: "size-6",
|
|
760
|
+
"aria-hidden": "true"
|
|
761
|
+
}),
|
|
762
|
+
title: "Select a portfolio",
|
|
763
|
+
description: "Choose a portfolio above to see and create trade instructions."
|
|
764
|
+
})
|
|
765
|
+
]
|
|
766
|
+
})] }),
|
|
767
|
+
/* @__PURE__ */ T(O, { children: [/* @__PURE__ */ T(j, { children: [/* @__PURE__ */ T(M, {
|
|
552
768
|
className: "flex items-center gap-2",
|
|
553
|
-
children: [/* @__PURE__ */
|
|
769
|
+
children: [/* @__PURE__ */ w(Ee, {
|
|
554
770
|
className: "h-5 w-5",
|
|
555
771
|
"aria-hidden": "true"
|
|
556
772
|
}), "Rebalance proposals"]
|
|
557
|
-
}), /* @__PURE__ */
|
|
558
|
-
icon: /* @__PURE__ */
|
|
773
|
+
}), /* @__PURE__ */ w(A, { children: "Drift against target allocation, with lifecycle actions per proposal." })] }), /* @__PURE__ */ w(k, { children: pe ? /* @__PURE__ */ w(p, {}) : he ? /* @__PURE__ */ w(f, { onRetry: () => tt() }) : c.length === 0 ? /* @__PURE__ */ w(d, {
|
|
774
|
+
icon: /* @__PURE__ */ w(Ee, {
|
|
559
775
|
className: "size-6",
|
|
560
776
|
"aria-hidden": "true"
|
|
561
777
|
}),
|
|
562
778
|
title: "No rebalance proposals",
|
|
563
|
-
description:
|
|
564
|
-
action:
|
|
779
|
+
description: cn ? "Create a proposal when a portfolio drifts from its target allocation." : "Create a portfolio first, then propose a rebalance when it drifts.",
|
|
780
|
+
action: cn ? /* @__PURE__ */ T(D, {
|
|
565
781
|
size: "sm",
|
|
566
|
-
onClick:
|
|
567
|
-
children: [/* @__PURE__ */
|
|
782
|
+
onClick: ln,
|
|
783
|
+
children: [/* @__PURE__ */ w(we, {
|
|
568
784
|
className: "size-4",
|
|
569
785
|
"aria-hidden": "true"
|
|
570
786
|
}), "New proposal"]
|
|
571
787
|
}) : void 0
|
|
572
|
-
}) : /* @__PURE__ */
|
|
788
|
+
}) : /* @__PURE__ */ w("div", {
|
|
573
789
|
className: "overflow-x-auto",
|
|
574
|
-
children: /* @__PURE__ */
|
|
575
|
-
/* @__PURE__ */
|
|
576
|
-
/* @__PURE__ */
|
|
790
|
+
children: /* @__PURE__ */ T(Ye, { children: [/* @__PURE__ */ w(Ze, { children: /* @__PURE__ */ T(R, { children: [
|
|
791
|
+
/* @__PURE__ */ w(L, { children: "Portfolio" }),
|
|
792
|
+
/* @__PURE__ */ w(L, {
|
|
577
793
|
className: "text-right",
|
|
578
794
|
children: "Drift"
|
|
579
795
|
}),
|
|
580
|
-
/* @__PURE__ */
|
|
581
|
-
/* @__PURE__ */
|
|
582
|
-
/* @__PURE__ */
|
|
583
|
-
/* @__PURE__ */
|
|
584
|
-
/* @__PURE__ */
|
|
796
|
+
/* @__PURE__ */ w(L, { children: "Status" }),
|
|
797
|
+
/* @__PURE__ */ w(L, { children: "Rationale" }),
|
|
798
|
+
/* @__PURE__ */ w(L, { children: "Trades" }),
|
|
799
|
+
/* @__PURE__ */ w(L, { children: "Created" }),
|
|
800
|
+
/* @__PURE__ */ w(L, {
|
|
585
801
|
className: "w-12 text-right",
|
|
586
802
|
children: "Actions"
|
|
587
803
|
})
|
|
588
|
-
] }) }), /* @__PURE__ */
|
|
589
|
-
let t = Q.get(e.portfolioId), n =
|
|
590
|
-
return /* @__PURE__ */
|
|
591
|
-
onClick: () =>
|
|
804
|
+
] }) }), /* @__PURE__ */ w(Xe, { children: c.map((e) => {
|
|
805
|
+
let t = Q.get(e.portfolioId), n = fn(e), r = $e[e.status], i = t?.driftThresholdPct, a = i != null && i > 0 ? Math.min(100, e.driftPct / i * 100) : null;
|
|
806
|
+
return /* @__PURE__ */ T(R, {
|
|
807
|
+
onClick: () => Qt(e),
|
|
592
808
|
className: "cursor-pointer transition-colors motion-safe:hover:bg-bg-elevated",
|
|
593
809
|
children: [
|
|
594
|
-
/* @__PURE__ */
|
|
810
|
+
/* @__PURE__ */ T(I, { children: [/* @__PURE__ */ w("p", {
|
|
595
811
|
className: "font-medium text-text-primary",
|
|
596
812
|
children: t?.name ?? "Unknown portfolio"
|
|
597
|
-
}), /* @__PURE__ */
|
|
813
|
+
}), /* @__PURE__ */ T("p", {
|
|
598
814
|
className: "text-xs text-text-secondary",
|
|
599
815
|
children: [t?.baseCurrency ?? "—", i == null ? "" : ` · threshold ${g(i)}`]
|
|
600
816
|
})] }),
|
|
601
|
-
/* @__PURE__ */
|
|
817
|
+
/* @__PURE__ */ T(I, {
|
|
602
818
|
className: "text-right",
|
|
603
|
-
children: [/* @__PURE__ */
|
|
819
|
+
children: [/* @__PURE__ */ T("span", {
|
|
604
820
|
className: `inline-flex items-center justify-end gap-1 font-semibold tabular-nums ${n ? "text-status-error-text" : "text-text-primary"}`,
|
|
605
|
-
children: [n ? /* @__PURE__ */
|
|
821
|
+
children: [n ? /* @__PURE__ */ w(_e, {
|
|
606
822
|
className: "size-4",
|
|
607
823
|
"aria-hidden": "true"
|
|
608
824
|
}) : null, g(e.driftPct)]
|
|
609
|
-
}), a == null ? n ? /* @__PURE__ */
|
|
825
|
+
}), a == null ? n ? /* @__PURE__ */ w("p", {
|
|
610
826
|
className: "text-xs text-status-error-text",
|
|
611
827
|
children: "Over threshold"
|
|
612
|
-
}) : null : /* @__PURE__ */
|
|
828
|
+
}) : null : /* @__PURE__ */ w("div", {
|
|
613
829
|
className: "ml-auto mt-1 h-1.5 w-24 overflow-hidden rounded-full bg-bg-sunken",
|
|
614
830
|
role: "progressbar",
|
|
615
831
|
"aria-valuenow": Math.round(a),
|
|
616
832
|
"aria-valuemin": 0,
|
|
617
833
|
"aria-valuemax": 100,
|
|
618
834
|
"aria-label": `Drift vs threshold for ${t?.name ?? "portfolio"}`,
|
|
619
|
-
children: /* @__PURE__ */
|
|
835
|
+
children: /* @__PURE__ */ w("div", {
|
|
620
836
|
className: "h-full rounded-full",
|
|
621
837
|
style: {
|
|
622
838
|
width: `${a}%`,
|
|
@@ -625,60 +841,60 @@ function W() {
|
|
|
625
841
|
})
|
|
626
842
|
})]
|
|
627
843
|
}),
|
|
628
|
-
/* @__PURE__ */
|
|
844
|
+
/* @__PURE__ */ w(I, { children: /* @__PURE__ */ w(E, {
|
|
629
845
|
variant: _(e.status),
|
|
630
|
-
children:
|
|
846
|
+
children: z(e.status)
|
|
631
847
|
}) }),
|
|
632
|
-
/* @__PURE__ */
|
|
848
|
+
/* @__PURE__ */ w(I, {
|
|
633
849
|
className: "max-w-xs",
|
|
634
|
-
children: /* @__PURE__ */
|
|
850
|
+
children: /* @__PURE__ */ w("p", {
|
|
635
851
|
className: "truncate text-sm text-text-secondary",
|
|
636
852
|
children: e.rationale ?? "—"
|
|
637
853
|
})
|
|
638
854
|
}),
|
|
639
|
-
/* @__PURE__ */
|
|
855
|
+
/* @__PURE__ */ w(I, {
|
|
640
856
|
className: "text-sm text-text-secondary",
|
|
641
|
-
children:
|
|
857
|
+
children: ct(e.trades)
|
|
642
858
|
}),
|
|
643
|
-
/* @__PURE__ */
|
|
859
|
+
/* @__PURE__ */ w(I, {
|
|
644
860
|
className: "text-sm text-text-secondary",
|
|
645
861
|
children: m(e.createdAt)
|
|
646
862
|
}),
|
|
647
|
-
/* @__PURE__ */
|
|
863
|
+
/* @__PURE__ */ w(I, {
|
|
648
864
|
className: "text-right",
|
|
649
865
|
onClick: (e) => e.stopPropagation(),
|
|
650
|
-
children: /* @__PURE__ */
|
|
866
|
+
children: /* @__PURE__ */ T(ze, { children: [/* @__PURE__ */ w(Ue, {
|
|
651
867
|
asChild: !0,
|
|
652
|
-
children: /* @__PURE__ */
|
|
868
|
+
children: /* @__PURE__ */ w(D, {
|
|
653
869
|
variant: "ghost",
|
|
654
870
|
size: "sm",
|
|
655
871
|
"aria-label": `Actions for ${t?.name ?? "proposal"}`,
|
|
656
|
-
children: /* @__PURE__ */
|
|
872
|
+
children: /* @__PURE__ */ w(Ce, {
|
|
657
873
|
className: "size-4",
|
|
658
874
|
"aria-hidden": "true"
|
|
659
875
|
})
|
|
660
876
|
})
|
|
661
|
-
}), /* @__PURE__ */
|
|
877
|
+
}), /* @__PURE__ */ T(Be, {
|
|
662
878
|
align: "end",
|
|
663
|
-
children: [/* @__PURE__ */
|
|
664
|
-
onClick: () =>
|
|
665
|
-
children: [/* @__PURE__ */
|
|
879
|
+
children: [/* @__PURE__ */ T(N, {
|
|
880
|
+
onClick: () => Qt(e),
|
|
881
|
+
children: [/* @__PURE__ */ w(be, {
|
|
666
882
|
className: "size-4",
|
|
667
883
|
"aria-hidden": "true"
|
|
668
884
|
}), "View details"]
|
|
669
|
-
}), r.length > 0 ? /* @__PURE__ */
|
|
670
|
-
/* @__PURE__ */
|
|
671
|
-
/* @__PURE__ */
|
|
885
|
+
}), r.length > 0 ? /* @__PURE__ */ T(je, { children: [
|
|
886
|
+
/* @__PURE__ */ w(He, {}),
|
|
887
|
+
/* @__PURE__ */ w(Ve, { children: "Advance to" }),
|
|
672
888
|
r.map((t) => {
|
|
673
889
|
let n = t === "REJECTED" || t === "CANCELLED";
|
|
674
|
-
return /* @__PURE__ */
|
|
890
|
+
return /* @__PURE__ */ T(N, {
|
|
675
891
|
disabled: J.isPending,
|
|
676
892
|
className: n ? "text-status-error-text" : void 0,
|
|
677
|
-
onClick: () =>
|
|
678
|
-
children: [
|
|
893
|
+
onClick: () => dn(e, t),
|
|
894
|
+
children: [w(n ? C : ve, {
|
|
679
895
|
className: "size-4",
|
|
680
896
|
"aria-hidden": "true"
|
|
681
|
-
}),
|
|
897
|
+
}), z(t)]
|
|
682
898
|
}, t);
|
|
683
899
|
})
|
|
684
900
|
] }) : null]
|
|
@@ -688,75 +904,75 @@ function W() {
|
|
|
688
904
|
}, e.id);
|
|
689
905
|
}) })] })
|
|
690
906
|
}) })] }),
|
|
691
|
-
/* @__PURE__ */
|
|
907
|
+
/* @__PURE__ */ T(O, { children: [/* @__PURE__ */ T(j, { children: [/* @__PURE__ */ T(M, {
|
|
692
908
|
className: "flex items-center gap-2",
|
|
693
|
-
children: [/* @__PURE__ */
|
|
909
|
+
children: [/* @__PURE__ */ w(x, {
|
|
694
910
|
className: "h-5 w-5",
|
|
695
911
|
"aria-hidden": "true"
|
|
696
912
|
}), "Risk insights"]
|
|
697
|
-
}), /* @__PURE__ */
|
|
698
|
-
icon: /* @__PURE__ */
|
|
913
|
+
}), /* @__PURE__ */ w(A, { children: "Drift, concentration, cash-drag and fee-anomaly signals detected across your portfolios." })] }), /* @__PURE__ */ w(k, { children: zt ? /* @__PURE__ */ w(p, {}) : Vt ? /* @__PURE__ */ w(f, { onRetry: () => Ht() }) : en.length === 0 ? /* @__PURE__ */ w(d, {
|
|
914
|
+
icon: /* @__PURE__ */ w(S, {
|
|
699
915
|
className: "size-6",
|
|
700
916
|
"aria-hidden": "true"
|
|
701
917
|
}),
|
|
702
918
|
title: "No risk insights",
|
|
703
919
|
description: "No drift, concentration, cash-drag or fee-anomaly signals are open right now."
|
|
704
|
-
}) : /* @__PURE__ */
|
|
920
|
+
}) : /* @__PURE__ */ T("div", {
|
|
705
921
|
className: "space-y-3",
|
|
706
|
-
children: [
|
|
922
|
+
children: [en.map((e, t) => /* @__PURE__ */ w(l, {
|
|
707
923
|
index: t,
|
|
708
|
-
children: /* @__PURE__ */
|
|
924
|
+
children: /* @__PURE__ */ w(mt, {
|
|
709
925
|
insight: e,
|
|
710
|
-
onAcknowledge: () =>
|
|
711
|
-
onResolve: () =>
|
|
712
|
-
onDismiss: () =>
|
|
713
|
-
actionPending:
|
|
926
|
+
onAcknowledge: () => Wt.mutate(e.id),
|
|
927
|
+
onResolve: () => Kt.mutate(e.id),
|
|
928
|
+
onDismiss: () => Gt.mutate(e.id),
|
|
929
|
+
actionPending: Wt.isPending || Kt.isPending || Gt.isPending
|
|
714
930
|
})
|
|
715
|
-
}, e.id)), /* @__PURE__ */
|
|
716
|
-
hasMore:
|
|
717
|
-
onClick:
|
|
718
|
-
loading:
|
|
931
|
+
}, e.id)), /* @__PURE__ */ w(le, {
|
|
932
|
+
hasMore: Lt,
|
|
933
|
+
onClick: Rt,
|
|
934
|
+
loading: Bt,
|
|
719
935
|
label: "Load more insights"
|
|
720
936
|
})]
|
|
721
937
|
}) })] }),
|
|
722
|
-
/* @__PURE__ */
|
|
723
|
-
open:
|
|
724
|
-
onOpenChange:
|
|
725
|
-
children: /* @__PURE__ */
|
|
726
|
-
/* @__PURE__ */
|
|
727
|
-
|
|
938
|
+
/* @__PURE__ */ w(Me, {
|
|
939
|
+
open: qt,
|
|
940
|
+
onOpenChange: Jt,
|
|
941
|
+
children: /* @__PURE__ */ T(Pe, { children: [
|
|
942
|
+
/* @__PURE__ */ T(Le, { children: [/* @__PURE__ */ w(Re, { children: "New rebalance proposal" }), /* @__PURE__ */ w(Fe, { children: "Propose a rebalance for a portfolio that has drifted from its target allocation." })] }),
|
|
943
|
+
cn ? /* @__PURE__ */ T("div", {
|
|
728
944
|
className: "grid gap-4",
|
|
729
945
|
children: [
|
|
730
|
-
/* @__PURE__ */
|
|
946
|
+
/* @__PURE__ */ T("div", {
|
|
731
947
|
className: "grid gap-4 sm:grid-cols-2",
|
|
732
|
-
children: [/* @__PURE__ */
|
|
948
|
+
children: [/* @__PURE__ */ T("div", {
|
|
733
949
|
className: "space-y-2",
|
|
734
|
-
children: [/* @__PURE__ */
|
|
950
|
+
children: [/* @__PURE__ */ T(F, {
|
|
735
951
|
htmlFor: "prop-portfolio",
|
|
736
|
-
children: ["Portfolio ", /* @__PURE__ */
|
|
952
|
+
children: ["Portfolio ", /* @__PURE__ */ w("span", {
|
|
737
953
|
className: "text-status-error-text",
|
|
738
954
|
children: "*"
|
|
739
955
|
})]
|
|
740
|
-
}), /* @__PURE__ */
|
|
956
|
+
}), /* @__PURE__ */ T(We, {
|
|
741
957
|
value: Y.portfolioId,
|
|
742
958
|
onValueChange: (e) => X((t) => ({
|
|
743
959
|
...t,
|
|
744
960
|
portfolioId: e
|
|
745
961
|
})),
|
|
746
|
-
children: [/* @__PURE__ */
|
|
962
|
+
children: [/* @__PURE__ */ w(qe, {
|
|
747
963
|
id: "prop-portfolio",
|
|
748
|
-
children: /* @__PURE__ */
|
|
749
|
-
}), /* @__PURE__ */
|
|
964
|
+
children: /* @__PURE__ */ w(Je, { placeholder: "Select a portfolio" })
|
|
965
|
+
}), /* @__PURE__ */ w(Ge, { children: B.map((e) => /* @__PURE__ */ w(Ke, {
|
|
750
966
|
value: e.id,
|
|
751
967
|
children: e.name
|
|
752
968
|
}, e.id)) })]
|
|
753
969
|
})]
|
|
754
|
-
}), /* @__PURE__ */
|
|
970
|
+
}), /* @__PURE__ */ T("div", {
|
|
755
971
|
className: "space-y-2",
|
|
756
|
-
children: [/* @__PURE__ */
|
|
972
|
+
children: [/* @__PURE__ */ w(F, {
|
|
757
973
|
htmlFor: "prop-drift",
|
|
758
974
|
children: "Drift %"
|
|
759
|
-
}), /* @__PURE__ */
|
|
975
|
+
}), /* @__PURE__ */ w(P, {
|
|
760
976
|
id: "prop-drift",
|
|
761
977
|
type: "number",
|
|
762
978
|
value: Y.driftPct,
|
|
@@ -768,12 +984,12 @@ function W() {
|
|
|
768
984
|
})]
|
|
769
985
|
})]
|
|
770
986
|
}),
|
|
771
|
-
/* @__PURE__ */
|
|
987
|
+
/* @__PURE__ */ T("div", {
|
|
772
988
|
className: "space-y-2",
|
|
773
|
-
children: [/* @__PURE__ */
|
|
989
|
+
children: [/* @__PURE__ */ w(F, {
|
|
774
990
|
htmlFor: "prop-rationale",
|
|
775
991
|
children: "Rationale"
|
|
776
|
-
}), /* @__PURE__ */
|
|
992
|
+
}), /* @__PURE__ */ w(Qe, {
|
|
777
993
|
id: "prop-rationale",
|
|
778
994
|
value: Y.rationale,
|
|
779
995
|
onChange: (e) => X((t) => ({
|
|
@@ -783,76 +999,76 @@ function W() {
|
|
|
783
999
|
placeholder: "Why is this rebalance needed?"
|
|
784
1000
|
})]
|
|
785
1001
|
}),
|
|
786
|
-
/* @__PURE__ */
|
|
1002
|
+
/* @__PURE__ */ T("div", {
|
|
787
1003
|
className: "space-y-2",
|
|
788
1004
|
children: [
|
|
789
|
-
/* @__PURE__ */
|
|
1005
|
+
/* @__PURE__ */ w(F, {
|
|
790
1006
|
htmlFor: "prop-trades",
|
|
791
1007
|
children: "Trades (JSON, optional)"
|
|
792
1008
|
}),
|
|
793
|
-
/* @__PURE__ */
|
|
1009
|
+
/* @__PURE__ */ w(Qe, {
|
|
794
1010
|
id: "prop-trades",
|
|
795
1011
|
className: "font-mono text-xs",
|
|
796
1012
|
value: Y.trades,
|
|
797
1013
|
onChange: (e) => {
|
|
798
|
-
|
|
1014
|
+
Xt(null), X((t) => ({
|
|
799
1015
|
...t,
|
|
800
1016
|
trades: e.target.value
|
|
801
1017
|
}));
|
|
802
1018
|
},
|
|
803
1019
|
placeholder: "e.g. [{\"symbol\":\"VOO\",\"action\":\"SELL\",\"quantity\":10}]"
|
|
804
1020
|
}),
|
|
805
|
-
|
|
1021
|
+
Yt ? /* @__PURE__ */ w("p", {
|
|
806
1022
|
className: "text-xs text-status-error-text",
|
|
807
|
-
children:
|
|
1023
|
+
children: Yt
|
|
808
1024
|
}) : null
|
|
809
1025
|
]
|
|
810
1026
|
})
|
|
811
1027
|
]
|
|
812
|
-
}) : /* @__PURE__ */
|
|
813
|
-
icon: /* @__PURE__ */
|
|
1028
|
+
}) : /* @__PURE__ */ w(d, {
|
|
1029
|
+
icon: /* @__PURE__ */ w(Ee, {
|
|
814
1030
|
className: "size-6",
|
|
815
1031
|
"aria-hidden": "true"
|
|
816
1032
|
}),
|
|
817
1033
|
title: "Create a portfolio first",
|
|
818
1034
|
description: "A rebalance proposal targets a portfolio. Add a portfolio on the Portfolios page, then return here to propose a rebalance."
|
|
819
1035
|
}),
|
|
820
|
-
/* @__PURE__ */
|
|
1036
|
+
/* @__PURE__ */ T(Ie, { children: [/* @__PURE__ */ w(Ne, {
|
|
821
1037
|
asChild: !0,
|
|
822
|
-
children: /* @__PURE__ */
|
|
1038
|
+
children: /* @__PURE__ */ w(D, {
|
|
823
1039
|
variant: "outline",
|
|
824
1040
|
children: "Cancel"
|
|
825
1041
|
})
|
|
826
|
-
}), /* @__PURE__ */
|
|
827
|
-
onClick:
|
|
828
|
-
disabled: !Y.portfolioId ||
|
|
829
|
-
children:
|
|
1042
|
+
}), /* @__PURE__ */ w(D, {
|
|
1043
|
+
onClick: un,
|
|
1044
|
+
disabled: !Y.portfolioId || Ut.isPending,
|
|
1045
|
+
children: Ut.isPending ? "Creating…" : "Create proposal"
|
|
830
1046
|
})] })
|
|
831
1047
|
] })
|
|
832
1048
|
}),
|
|
833
1049
|
(() => {
|
|
834
|
-
let e =
|
|
835
|
-
return /* @__PURE__ */
|
|
1050
|
+
let e = Zt ? c.find((e) => e.id === Zt.id) ?? Zt : null, t = e ? It.filter((t) => t.subjectId === e.portfolioId) : [];
|
|
1051
|
+
return /* @__PURE__ */ w(dt, {
|
|
836
1052
|
proposal: e,
|
|
837
1053
|
portfolio: e ? Q.get(e.portfolioId) ?? null : null,
|
|
838
1054
|
relatedInsights: t,
|
|
839
|
-
nextStatuses: e ?
|
|
1055
|
+
nextStatuses: e ? $e[e.status] : [],
|
|
840
1056
|
transitionPending: J.isPending,
|
|
841
1057
|
onTransition: (t) => {
|
|
842
|
-
e &&
|
|
1058
|
+
e && dn(e, t);
|
|
843
1059
|
},
|
|
844
1060
|
onOpenChange: (e) => {
|
|
845
|
-
e ||
|
|
1061
|
+
e || Qt(null);
|
|
846
1062
|
}
|
|
847
1063
|
});
|
|
848
1064
|
})(),
|
|
849
|
-
/* @__PURE__ */
|
|
1065
|
+
/* @__PURE__ */ w(ue, {
|
|
850
1066
|
open: Z !== null,
|
|
851
1067
|
onOpenChange: (e) => {
|
|
852
|
-
e ||
|
|
1068
|
+
e || $t(null);
|
|
853
1069
|
},
|
|
854
1070
|
title: Z?.status === "REJECTED" ? "Reject this proposal?" : "Cancel this proposal?",
|
|
855
|
-
description: Z ? `This moves the rebalance proposal for ${Q.get(Z.proposal.portfolioId)?.name ?? "this portfolio"} to ${
|
|
1071
|
+
description: Z ? `This moves the rebalance proposal for ${Q.get(Z.proposal.portfolioId)?.name ?? "this portfolio"} to ${z(Z.status)}. This cannot be undone.` : void 0,
|
|
856
1072
|
confirmLabel: Z?.status === "REJECTED" ? "Reject" : "Cancel proposal",
|
|
857
1073
|
cancelLabel: "Keep",
|
|
858
1074
|
destructive: !0,
|
|
@@ -861,201 +1077,201 @@ function W() {
|
|
|
861
1077
|
Z && J.mutate({
|
|
862
1078
|
id: Z.proposal.id,
|
|
863
1079
|
status: Z.status
|
|
864
|
-
}, { onSuccess: () =>
|
|
1080
|
+
}, { onSuccess: () => $t(null) });
|
|
865
1081
|
}
|
|
866
1082
|
})
|
|
867
1083
|
]
|
|
868
1084
|
});
|
|
869
1085
|
}
|
|
870
|
-
function
|
|
871
|
-
let s = e ?
|
|
872
|
-
return /* @__PURE__ */
|
|
1086
|
+
function dt({ proposal: e, portfolio: t, relatedInsights: n, nextStatuses: r, transitionPending: i, onTransition: a, onOpenChange: o }) {
|
|
1087
|
+
let s = e ? B(e.trades) : null, ee = e != null && t?.driftThresholdPct != null && Number.isFinite(t.driftThresholdPct) && e.driftPct >= t.driftThresholdPct;
|
|
1088
|
+
return /* @__PURE__ */ w(Me, {
|
|
873
1089
|
open: e !== null,
|
|
874
1090
|
onOpenChange: o,
|
|
875
|
-
children: /* @__PURE__ */
|
|
1091
|
+
children: /* @__PURE__ */ w(Pe, {
|
|
876
1092
|
className: "max-h-[88vh] max-w-3xl overflow-y-auto",
|
|
877
|
-
children: e ? /* @__PURE__ */
|
|
878
|
-
/* @__PURE__ */
|
|
879
|
-
/* @__PURE__ */
|
|
1093
|
+
children: e ? /* @__PURE__ */ T(je, { children: [
|
|
1094
|
+
/* @__PURE__ */ T(Le, { children: [
|
|
1095
|
+
/* @__PURE__ */ w("p", {
|
|
880
1096
|
className: "text-xs font-medium uppercase tracking-wide text-text-secondary",
|
|
881
1097
|
children: "Detail"
|
|
882
1098
|
}),
|
|
883
|
-
/* @__PURE__ */
|
|
1099
|
+
/* @__PURE__ */ T(Re, {
|
|
884
1100
|
className: "flex flex-wrap items-center gap-2 text-xl",
|
|
885
1101
|
children: [
|
|
886
1102
|
t?.name ?? "Rebalance proposal",
|
|
887
|
-
/* @__PURE__ */
|
|
1103
|
+
/* @__PURE__ */ w("span", {
|
|
888
1104
|
className: "text-text-secondary",
|
|
889
1105
|
children: "— Rebalance proposal"
|
|
890
1106
|
}),
|
|
891
|
-
/* @__PURE__ */ E
|
|
1107
|
+
/* @__PURE__ */ w(E, {
|
|
892
1108
|
variant: _(e.status),
|
|
893
|
-
children:
|
|
1109
|
+
children: z(e.status)
|
|
894
1110
|
})
|
|
895
1111
|
]
|
|
896
1112
|
}),
|
|
897
|
-
/* @__PURE__ */
|
|
1113
|
+
/* @__PURE__ */ T(Fe, { children: [
|
|
898
1114
|
"Created ",
|
|
899
1115
|
m(e.createdAt),
|
|
900
1116
|
e.executedAt ? ` · executed ${m(e.executedAt)}` : ""
|
|
901
1117
|
] })
|
|
902
1118
|
] }),
|
|
903
|
-
/* @__PURE__ */
|
|
1119
|
+
/* @__PURE__ */ w("div", {
|
|
904
1120
|
className: "rounded-xl border border-border-subtle bg-bg-surface p-4",
|
|
905
|
-
children: /* @__PURE__ */
|
|
906
|
-
steps:
|
|
907
|
-
current:
|
|
1121
|
+
children: /* @__PURE__ */ w(pe, {
|
|
1122
|
+
steps: tt,
|
|
1123
|
+
current: z(e.status)
|
|
908
1124
|
})
|
|
909
1125
|
}),
|
|
910
|
-
/* @__PURE__ */
|
|
1126
|
+
/* @__PURE__ */ T("div", {
|
|
911
1127
|
className: "grid gap-3 sm:grid-cols-2 lg:grid-cols-4",
|
|
912
1128
|
children: [
|
|
913
|
-
/* @__PURE__ */
|
|
1129
|
+
/* @__PURE__ */ w(u, {
|
|
914
1130
|
label: "Drift",
|
|
915
1131
|
value: g(e.driftPct),
|
|
916
1132
|
deltaTone: ee ? "negative" : "neutral",
|
|
917
1133
|
glow: ee,
|
|
918
|
-
icon: /* @__PURE__ */
|
|
1134
|
+
icon: /* @__PURE__ */ w(b, {
|
|
919
1135
|
className: "size-4",
|
|
920
1136
|
"aria-hidden": "true"
|
|
921
1137
|
})
|
|
922
1138
|
}),
|
|
923
|
-
/* @__PURE__ */
|
|
1139
|
+
/* @__PURE__ */ w(u, {
|
|
924
1140
|
label: "Threshold",
|
|
925
1141
|
value: t?.driftThresholdPct == null ? "—" : g(t.driftThresholdPct)
|
|
926
1142
|
}),
|
|
927
|
-
/* @__PURE__ */
|
|
1143
|
+
/* @__PURE__ */ T("div", {
|
|
928
1144
|
className: "rounded-xl border border-border-subtle bg-bg-surface p-4",
|
|
929
|
-
children: [/* @__PURE__ */
|
|
1145
|
+
children: [/* @__PURE__ */ w("p", {
|
|
930
1146
|
className: "text-xs text-text-secondary",
|
|
931
1147
|
children: "Proposed by"
|
|
932
|
-
}), /* @__PURE__ */
|
|
1148
|
+
}), /* @__PURE__ */ w("p", {
|
|
933
1149
|
className: "mt-1 truncate text-sm font-medium text-text-primary",
|
|
934
|
-
children: e.proposedById ? /* @__PURE__ */
|
|
1150
|
+
children: e.proposedById ? /* @__PURE__ */ w(c, { id: e.proposedById }) : "—"
|
|
935
1151
|
})]
|
|
936
1152
|
}),
|
|
937
|
-
/* @__PURE__ */
|
|
1153
|
+
/* @__PURE__ */ T("div", {
|
|
938
1154
|
className: "rounded-xl border border-border-subtle bg-bg-surface p-4",
|
|
939
|
-
children: [/* @__PURE__ */
|
|
1155
|
+
children: [/* @__PURE__ */ w("p", {
|
|
940
1156
|
className: "text-xs text-text-secondary",
|
|
941
1157
|
children: "Approved by"
|
|
942
|
-
}), /* @__PURE__ */
|
|
1158
|
+
}), /* @__PURE__ */ w("p", {
|
|
943
1159
|
className: "mt-1 truncate text-sm font-medium text-text-primary",
|
|
944
|
-
children: e.approvedById ? /* @__PURE__ */
|
|
1160
|
+
children: e.approvedById ? /* @__PURE__ */ w(c, { id: e.approvedById }) : "—"
|
|
945
1161
|
})]
|
|
946
1162
|
})
|
|
947
1163
|
]
|
|
948
1164
|
}),
|
|
949
|
-
/* @__PURE__ */
|
|
1165
|
+
/* @__PURE__ */ T("div", {
|
|
950
1166
|
className: "space-y-2",
|
|
951
|
-
children: [/* @__PURE__ */
|
|
1167
|
+
children: [/* @__PURE__ */ w("h3", {
|
|
952
1168
|
className: "text-sm font-semibold text-text-primary",
|
|
953
1169
|
children: "Proposed trades"
|
|
954
|
-
}), s && s.length > 0 ? /* @__PURE__ */
|
|
1170
|
+
}), s && s.length > 0 ? /* @__PURE__ */ w("div", {
|
|
955
1171
|
className: "overflow-x-auto rounded-lg border border-border-subtle",
|
|
956
|
-
children: /* @__PURE__ */
|
|
957
|
-
/* @__PURE__ */
|
|
958
|
-
/* @__PURE__ */
|
|
959
|
-
/* @__PURE__ */
|
|
1172
|
+
children: /* @__PURE__ */ T(Ye, { children: [/* @__PURE__ */ w(Ze, { children: /* @__PURE__ */ T(R, { children: [
|
|
1173
|
+
/* @__PURE__ */ w(L, { children: "Action" }),
|
|
1174
|
+
/* @__PURE__ */ w(L, { children: "Symbol" }),
|
|
1175
|
+
/* @__PURE__ */ w(L, {
|
|
960
1176
|
className: "text-right",
|
|
961
1177
|
children: "Quantity"
|
|
962
1178
|
}),
|
|
963
|
-
/* @__PURE__ */
|
|
1179
|
+
/* @__PURE__ */ w(L, {
|
|
964
1180
|
className: "text-right",
|
|
965
1181
|
children: "Est. value"
|
|
966
1182
|
})
|
|
967
|
-
] }) }), /* @__PURE__ */
|
|
968
|
-
/* @__PURE__ */
|
|
969
|
-
className: `font-semibold ${
|
|
1183
|
+
] }) }), /* @__PURE__ */ w(Xe, { children: s.map((e, n) => /* @__PURE__ */ T(R, { children: [
|
|
1184
|
+
/* @__PURE__ */ w(I, {
|
|
1185
|
+
className: `font-semibold ${st(e.action)}`,
|
|
970
1186
|
children: e.action ? e.action.toUpperCase() : "—"
|
|
971
1187
|
}),
|
|
972
|
-
/* @__PURE__ */
|
|
1188
|
+
/* @__PURE__ */ w(I, {
|
|
973
1189
|
className: "font-medium text-text-primary",
|
|
974
1190
|
children: e.symbol ?? "—"
|
|
975
1191
|
}),
|
|
976
|
-
/* @__PURE__ */
|
|
1192
|
+
/* @__PURE__ */ w(I, {
|
|
977
1193
|
className: "text-right tabular-nums text-text-secondary",
|
|
978
1194
|
children: e.quantity == null ? "—" : e.quantity.toLocaleString()
|
|
979
1195
|
}),
|
|
980
|
-
/* @__PURE__ */
|
|
1196
|
+
/* @__PURE__ */ w(I, {
|
|
981
1197
|
className: "text-right tabular-nums text-text-secondary",
|
|
982
1198
|
children: e.value == null ? "—" : h(e.value, t?.baseCurrency ?? "USD")
|
|
983
1199
|
})
|
|
984
1200
|
] }, n)) })] })
|
|
985
|
-
}) : /* @__PURE__ */
|
|
1201
|
+
}) : /* @__PURE__ */ T("p", {
|
|
986
1202
|
className: "text-sm text-text-secondary",
|
|
987
|
-
children: [
|
|
1203
|
+
children: [ct(e.trades), " — no structured trade breakdown available."]
|
|
988
1204
|
})]
|
|
989
1205
|
}),
|
|
990
|
-
/* @__PURE__ */
|
|
1206
|
+
/* @__PURE__ */ T("div", {
|
|
991
1207
|
className: "space-y-1",
|
|
992
|
-
children: [/* @__PURE__ */
|
|
1208
|
+
children: [/* @__PURE__ */ w("h3", {
|
|
993
1209
|
className: "text-sm font-semibold text-text-primary",
|
|
994
1210
|
children: "Rationale"
|
|
995
|
-
}), /* @__PURE__ */
|
|
1211
|
+
}), /* @__PURE__ */ w("p", {
|
|
996
1212
|
className: "text-sm text-text-secondary",
|
|
997
1213
|
children: e.rationale ?? "—"
|
|
998
1214
|
})]
|
|
999
1215
|
}),
|
|
1000
|
-
r.length > 0 ? /* @__PURE__ */
|
|
1216
|
+
r.length > 0 ? /* @__PURE__ */ w("div", {
|
|
1001
1217
|
className: "flex flex-wrap gap-2",
|
|
1002
1218
|
children: r.map((e) => {
|
|
1003
1219
|
let t = e === "REJECTED" || e === "CANCELLED";
|
|
1004
|
-
return /* @__PURE__ */ D
|
|
1220
|
+
return /* @__PURE__ */ T(D, {
|
|
1005
1221
|
variant: t ? "outline" : "default",
|
|
1006
1222
|
size: "sm",
|
|
1007
1223
|
disabled: i,
|
|
1008
1224
|
className: t ? "text-status-error-text" : void 0,
|
|
1009
1225
|
onClick: () => a(e),
|
|
1010
|
-
children: [
|
|
1226
|
+
children: [w(t ? C : ve, {
|
|
1011
1227
|
className: "size-4",
|
|
1012
1228
|
"aria-hidden": "true"
|
|
1013
|
-
}),
|
|
1229
|
+
}), z(e)]
|
|
1014
1230
|
}, e);
|
|
1015
1231
|
})
|
|
1016
1232
|
}) : null,
|
|
1017
|
-
n.length > 0 ? /* @__PURE__ */
|
|
1233
|
+
n.length > 0 ? /* @__PURE__ */ T("div", {
|
|
1018
1234
|
className: "space-y-2 border-t border-border-subtle pt-4",
|
|
1019
|
-
children: [/* @__PURE__ */
|
|
1235
|
+
children: [/* @__PURE__ */ T("h3", {
|
|
1020
1236
|
className: "flex items-center gap-2 text-sm font-semibold text-text-primary",
|
|
1021
|
-
children: [/* @__PURE__ */
|
|
1237
|
+
children: [/* @__PURE__ */ w(x, {
|
|
1022
1238
|
className: "size-4",
|
|
1023
1239
|
"aria-hidden": "true"
|
|
1024
1240
|
}), "Risk insights"]
|
|
1025
|
-
}), /* @__PURE__ */
|
|
1241
|
+
}), /* @__PURE__ */ w("ul", {
|
|
1026
1242
|
className: "space-y-2",
|
|
1027
|
-
children: n.map((e) => /* @__PURE__ */
|
|
1243
|
+
children: n.map((e) => /* @__PURE__ */ T("li", {
|
|
1028
1244
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-3",
|
|
1029
|
-
children: [/* @__PURE__ */
|
|
1245
|
+
children: [/* @__PURE__ */ T("div", {
|
|
1030
1246
|
className: "flex flex-wrap items-center gap-2",
|
|
1031
1247
|
children: [
|
|
1032
|
-
/* @__PURE__ */
|
|
1248
|
+
/* @__PURE__ */ w("span", {
|
|
1033
1249
|
className: "text-sm font-medium text-text-primary",
|
|
1034
1250
|
children: e.title
|
|
1035
1251
|
}),
|
|
1036
|
-
/* @__PURE__ */ E
|
|
1252
|
+
/* @__PURE__ */ w(E, {
|
|
1037
1253
|
variant: _(e.severity),
|
|
1038
|
-
children:
|
|
1254
|
+
children: z(e.severity)
|
|
1039
1255
|
}),
|
|
1040
|
-
/* @__PURE__ */ E
|
|
1256
|
+
/* @__PURE__ */ w(E, {
|
|
1041
1257
|
variant: "outline",
|
|
1042
|
-
children:
|
|
1258
|
+
children: z(e.type)
|
|
1043
1259
|
}),
|
|
1044
|
-
/* @__PURE__ */ E
|
|
1260
|
+
/* @__PURE__ */ w(E, {
|
|
1045
1261
|
variant: _(e.status),
|
|
1046
|
-
children:
|
|
1262
|
+
children: z(e.status)
|
|
1047
1263
|
})
|
|
1048
1264
|
]
|
|
1049
|
-
}), e.detail ? /* @__PURE__ */
|
|
1265
|
+
}), e.detail ? /* @__PURE__ */ w("p", {
|
|
1050
1266
|
className: "mt-1 text-xs text-text-secondary",
|
|
1051
1267
|
children: e.detail
|
|
1052
1268
|
}) : null]
|
|
1053
1269
|
}, e.id))
|
|
1054
1270
|
})]
|
|
1055
1271
|
}) : null,
|
|
1056
|
-
/* @__PURE__ */
|
|
1272
|
+
/* @__PURE__ */ w("div", {
|
|
1057
1273
|
className: "border-t border-border-subtle pt-4",
|
|
1058
|
-
children: /* @__PURE__ */
|
|
1274
|
+
children: /* @__PURE__ */ w(he, {
|
|
1059
1275
|
entityType: "brainyrich-rebalance",
|
|
1060
1276
|
entityId: e.id,
|
|
1061
1277
|
heading: "Discussion"
|
|
@@ -1065,57 +1281,57 @@ function nt({ proposal: e, portfolio: t, relatedInsights: n, nextStatuses: r, tr
|
|
|
1065
1281
|
})
|
|
1066
1282
|
});
|
|
1067
1283
|
}
|
|
1068
|
-
function
|
|
1284
|
+
function ft({ signal: e }) {
|
|
1069
1285
|
let t = Object.entries(e.metrics ?? {});
|
|
1070
|
-
return /* @__PURE__ */
|
|
1286
|
+
return /* @__PURE__ */ T("li", {
|
|
1071
1287
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
1072
1288
|
children: [
|
|
1073
|
-
/* @__PURE__ */
|
|
1289
|
+
/* @__PURE__ */ T("div", {
|
|
1074
1290
|
className: "flex flex-wrap items-center gap-2",
|
|
1075
1291
|
children: [
|
|
1076
|
-
/* @__PURE__ */
|
|
1292
|
+
/* @__PURE__ */ w("p", {
|
|
1077
1293
|
className: "font-medium text-text-primary",
|
|
1078
1294
|
children: e.title
|
|
1079
1295
|
}),
|
|
1080
|
-
/* @__PURE__ */ E
|
|
1296
|
+
/* @__PURE__ */ w(E, {
|
|
1081
1297
|
variant: _(e.severity),
|
|
1082
|
-
children:
|
|
1298
|
+
children: z(e.severity)
|
|
1083
1299
|
}),
|
|
1084
|
-
/* @__PURE__ */ E
|
|
1300
|
+
/* @__PURE__ */ w(E, {
|
|
1085
1301
|
variant: "outline",
|
|
1086
|
-
children:
|
|
1302
|
+
children: z(e.kind)
|
|
1087
1303
|
})
|
|
1088
1304
|
]
|
|
1089
1305
|
}),
|
|
1090
|
-
e.detail ? /* @__PURE__ */
|
|
1306
|
+
e.detail ? /* @__PURE__ */ w("p", {
|
|
1091
1307
|
className: "mt-1 text-sm text-text-secondary",
|
|
1092
1308
|
children: e.detail
|
|
1093
1309
|
}) : null,
|
|
1094
|
-
t.length > 0 ? /* @__PURE__ */
|
|
1310
|
+
t.length > 0 ? /* @__PURE__ */ w("dl", {
|
|
1095
1311
|
className: "mt-3 grid grid-cols-2 gap-x-4 gap-y-1 sm:grid-cols-3 lg:grid-cols-4",
|
|
1096
|
-
children: t.map(([e, t]) => /* @__PURE__ */
|
|
1312
|
+
children: t.map(([e, t]) => /* @__PURE__ */ T("div", {
|
|
1097
1313
|
className: "min-w-0",
|
|
1098
|
-
children: [/* @__PURE__ */
|
|
1314
|
+
children: [/* @__PURE__ */ w("dt", {
|
|
1099
1315
|
className: "truncate text-[11px] uppercase tracking-wide text-text-muted",
|
|
1100
|
-
children:
|
|
1101
|
-
}), /* @__PURE__ */
|
|
1316
|
+
children: z(e)
|
|
1317
|
+
}), /* @__PURE__ */ w("dd", {
|
|
1102
1318
|
className: "truncate text-sm font-medium tabular-nums text-text-primary",
|
|
1103
|
-
children:
|
|
1319
|
+
children: ot(t)
|
|
1104
1320
|
})]
|
|
1105
1321
|
}, e))
|
|
1106
1322
|
}) : null
|
|
1107
1323
|
]
|
|
1108
1324
|
});
|
|
1109
1325
|
}
|
|
1110
|
-
function
|
|
1326
|
+
function pt({ opportunity: e }) {
|
|
1111
1327
|
let t = Object.entries(e.metrics ?? {});
|
|
1112
|
-
return /* @__PURE__ */
|
|
1328
|
+
return /* @__PURE__ */ T("li", {
|
|
1113
1329
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
1114
1330
|
children: [
|
|
1115
|
-
/* @__PURE__ */
|
|
1331
|
+
/* @__PURE__ */ T("div", {
|
|
1116
1332
|
className: "flex flex-wrap items-center gap-2",
|
|
1117
1333
|
children: [
|
|
1118
|
-
/* @__PURE__ */
|
|
1334
|
+
/* @__PURE__ */ T("p", {
|
|
1119
1335
|
className: "font-medium text-text-primary",
|
|
1120
1336
|
children: [
|
|
1121
1337
|
e.symbol,
|
|
@@ -1123,21 +1339,21 @@ function it({ opportunity: e }) {
|
|
|
1123
1339
|
h(e.unrealizedLoss)
|
|
1124
1340
|
]
|
|
1125
1341
|
}),
|
|
1126
|
-
/* @__PURE__ */ E
|
|
1342
|
+
/* @__PURE__ */ w(E, {
|
|
1127
1343
|
variant: _(e.severity),
|
|
1128
|
-
children:
|
|
1344
|
+
children: z(e.severity)
|
|
1129
1345
|
}),
|
|
1130
|
-
e.washSaleRisk ? /* @__PURE__ */
|
|
1346
|
+
e.washSaleRisk ? /* @__PURE__ */ T(E, {
|
|
1131
1347
|
variant: "outline",
|
|
1132
1348
|
className: "text-status-error-text",
|
|
1133
|
-
children: [/* @__PURE__ */
|
|
1349
|
+
children: [/* @__PURE__ */ w(_e, {
|
|
1134
1350
|
className: "mr-1 size-3",
|
|
1135
1351
|
"aria-hidden": "true"
|
|
1136
1352
|
}), "Wash-sale caution"]
|
|
1137
1353
|
}) : null
|
|
1138
1354
|
]
|
|
1139
1355
|
}),
|
|
1140
|
-
/* @__PURE__ */
|
|
1356
|
+
/* @__PURE__ */ T("p", {
|
|
1141
1357
|
className: "mt-1 text-sm text-text-secondary",
|
|
1142
1358
|
children: [
|
|
1143
1359
|
"Market value ",
|
|
@@ -1150,99 +1366,99 @@ function it({ opportunity: e }) {
|
|
|
1150
1366
|
" of portfolio value"
|
|
1151
1367
|
]
|
|
1152
1368
|
}),
|
|
1153
|
-
e.washSaleReason ? /* @__PURE__ */
|
|
1369
|
+
e.washSaleReason ? /* @__PURE__ */ w("p", {
|
|
1154
1370
|
className: "mt-1 text-xs text-status-error-text",
|
|
1155
1371
|
children: e.washSaleReason
|
|
1156
1372
|
}) : null,
|
|
1157
|
-
t.length > 0 ? /* @__PURE__ */
|
|
1373
|
+
t.length > 0 ? /* @__PURE__ */ w("dl", {
|
|
1158
1374
|
className: "mt-3 grid grid-cols-2 gap-x-4 gap-y-1 sm:grid-cols-3 lg:grid-cols-4",
|
|
1159
|
-
children: t.filter(([e]) => e !== "formula").map(([e, t]) => /* @__PURE__ */
|
|
1375
|
+
children: t.filter(([e]) => e !== "formula").map(([e, t]) => /* @__PURE__ */ T("div", {
|
|
1160
1376
|
className: "min-w-0",
|
|
1161
|
-
children: [/* @__PURE__ */
|
|
1377
|
+
children: [/* @__PURE__ */ w("dt", {
|
|
1162
1378
|
className: "truncate text-[11px] uppercase tracking-wide text-text-muted",
|
|
1163
|
-
children:
|
|
1164
|
-
}), /* @__PURE__ */
|
|
1379
|
+
children: z(e)
|
|
1380
|
+
}), /* @__PURE__ */ w("dd", {
|
|
1165
1381
|
className: "truncate text-sm font-medium tabular-nums text-text-primary",
|
|
1166
|
-
children:
|
|
1382
|
+
children: ot(t)
|
|
1167
1383
|
})]
|
|
1168
1384
|
}, e))
|
|
1169
1385
|
}) : null
|
|
1170
1386
|
]
|
|
1171
1387
|
});
|
|
1172
1388
|
}
|
|
1173
|
-
function
|
|
1389
|
+
function mt({ insight: e, onAcknowledge: t, onResolve: n, onDismiss: r, actionPending: i }) {
|
|
1174
1390
|
let a = e.status === "RESOLVED" || e.status === "DISMISSED";
|
|
1175
|
-
return /* @__PURE__ */
|
|
1391
|
+
return /* @__PURE__ */ T("div", {
|
|
1176
1392
|
className: "flex items-start justify-between gap-4 rounded-lg border border-border-subtle bg-bg-surface p-4 transition-shadow motion-safe:hover:shadow-[var(--shadow-pop-hover,var(--shadow-elevation-2))]",
|
|
1177
|
-
children: [/* @__PURE__ */
|
|
1393
|
+
children: [/* @__PURE__ */ T("div", {
|
|
1178
1394
|
className: "min-w-0 space-y-1",
|
|
1179
1395
|
children: [
|
|
1180
|
-
/* @__PURE__ */
|
|
1396
|
+
/* @__PURE__ */ T("div", {
|
|
1181
1397
|
className: "flex flex-wrap items-center gap-2",
|
|
1182
1398
|
children: [
|
|
1183
|
-
/* @__PURE__ */
|
|
1399
|
+
/* @__PURE__ */ w("p", {
|
|
1184
1400
|
className: "font-medium text-text-primary",
|
|
1185
1401
|
children: e.title
|
|
1186
1402
|
}),
|
|
1187
|
-
/* @__PURE__ */ E
|
|
1403
|
+
/* @__PURE__ */ w(E, {
|
|
1188
1404
|
variant: _(e.severity),
|
|
1189
|
-
children:
|
|
1405
|
+
children: z(e.severity)
|
|
1190
1406
|
}),
|
|
1191
|
-
/* @__PURE__ */ E
|
|
1407
|
+
/* @__PURE__ */ w(E, {
|
|
1192
1408
|
variant: "outline",
|
|
1193
|
-
children:
|
|
1409
|
+
children: z(e.type)
|
|
1194
1410
|
}),
|
|
1195
|
-
/* @__PURE__ */ E
|
|
1411
|
+
/* @__PURE__ */ w(E, {
|
|
1196
1412
|
variant: _(e.status),
|
|
1197
|
-
children:
|
|
1413
|
+
children: z(e.status)
|
|
1198
1414
|
})
|
|
1199
1415
|
]
|
|
1200
1416
|
}),
|
|
1201
|
-
e.detail ? /* @__PURE__ */
|
|
1417
|
+
e.detail ? /* @__PURE__ */ w("p", {
|
|
1202
1418
|
className: "text-sm text-text-secondary",
|
|
1203
1419
|
children: e.detail
|
|
1204
1420
|
}) : null,
|
|
1205
|
-
/* @__PURE__ */
|
|
1421
|
+
/* @__PURE__ */ T("p", {
|
|
1206
1422
|
className: "text-xs text-text-muted",
|
|
1207
1423
|
children: ["Detected ", m(e.createdAt)]
|
|
1208
1424
|
})
|
|
1209
1425
|
]
|
|
1210
|
-
}), a ? /* @__PURE__ */
|
|
1426
|
+
}), a ? /* @__PURE__ */ w("span", {
|
|
1211
1427
|
className: "mt-1 text-xs text-text-muted",
|
|
1212
1428
|
children: "Closed"
|
|
1213
|
-
}) : /* @__PURE__ */
|
|
1429
|
+
}) : /* @__PURE__ */ T(ze, { children: [/* @__PURE__ */ w(Ue, {
|
|
1214
1430
|
asChild: !0,
|
|
1215
|
-
children: /* @__PURE__ */
|
|
1431
|
+
children: /* @__PURE__ */ w(D, {
|
|
1216
1432
|
variant: "ghost",
|
|
1217
1433
|
size: "sm",
|
|
1218
1434
|
"aria-label": `Actions for ${e.title}`,
|
|
1219
1435
|
disabled: i,
|
|
1220
|
-
children: /* @__PURE__ */
|
|
1436
|
+
children: /* @__PURE__ */ w(Ce, {
|
|
1221
1437
|
className: "size-4",
|
|
1222
1438
|
"aria-hidden": "true"
|
|
1223
1439
|
})
|
|
1224
1440
|
})
|
|
1225
|
-
}), /* @__PURE__ */
|
|
1441
|
+
}), /* @__PURE__ */ T(Be, {
|
|
1226
1442
|
align: "end",
|
|
1227
1443
|
children: [
|
|
1228
|
-
e.status === "OPEN" ? /* @__PURE__ */
|
|
1444
|
+
e.status === "OPEN" ? /* @__PURE__ */ T(N, {
|
|
1229
1445
|
onClick: t,
|
|
1230
|
-
children: [/* @__PURE__ */
|
|
1446
|
+
children: [/* @__PURE__ */ w(ye, {
|
|
1231
1447
|
className: "size-4",
|
|
1232
1448
|
"aria-hidden": "true"
|
|
1233
1449
|
}), "Acknowledge"]
|
|
1234
1450
|
}) : null,
|
|
1235
|
-
/* @__PURE__ */
|
|
1451
|
+
/* @__PURE__ */ T(N, {
|
|
1236
1452
|
onClick: n,
|
|
1237
|
-
children: [/* @__PURE__ */
|
|
1453
|
+
children: [/* @__PURE__ */ w(S, {
|
|
1238
1454
|
className: "size-4",
|
|
1239
1455
|
"aria-hidden": "true"
|
|
1240
1456
|
}), "Resolve"]
|
|
1241
1457
|
}),
|
|
1242
|
-
/* @__PURE__ */
|
|
1458
|
+
/* @__PURE__ */ T(N, {
|
|
1243
1459
|
className: "text-status-error-text",
|
|
1244
1460
|
onClick: r,
|
|
1245
|
-
children: [/* @__PURE__ */
|
|
1461
|
+
children: [/* @__PURE__ */ w(C, {
|
|
1246
1462
|
className: "size-4",
|
|
1247
1463
|
"aria-hidden": "true"
|
|
1248
1464
|
}), "Dismiss"]
|
|
@@ -1252,6 +1468,6 @@ function at({ insight: e, onAcknowledge: t, onResolve: n, onDismiss: r, actionPe
|
|
|
1252
1468
|
});
|
|
1253
1469
|
}
|
|
1254
1470
|
//#endregion
|
|
1255
|
-
export {
|
|
1471
|
+
export { V as RiskPage };
|
|
1256
1472
|
|
|
1257
1473
|
//# sourceMappingURL=RiskPage.js.map
|