@burdenoff/microfe-brainyrich 2026.828.1 → 2026.830.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/brainyrich/BrainyRichRoot.d.ts.map +1 -1
- package/dist/brainyrich/BrainyRichRoot.js +59 -59
- package/dist/brainyrich/BrainyRichRoot.js.map +1 -1
- package/dist/brainyrich/components/viz.d.ts.map +1 -1
- package/dist/brainyrich/components/viz.js +149 -148
- package/dist/brainyrich/components/viz.js.map +1 -1
- package/dist/brainyrich/hooks/useTr.d.ts +17 -0
- package/dist/brainyrich/hooks/useTr.d.ts.map +1 -0
- package/dist/brainyrich/hooks/useTr.js +14 -0
- package/dist/brainyrich/hooks/useTr.js.map +1 -0
- package/dist/brainyrich/pages/AiAssistantPage.js +192 -192
- package/dist/brainyrich/pages/AiAssistantPage.js.map +1 -1
- package/dist/brainyrich/pages/AnalyticsPage.d.ts.map +1 -1
- package/dist/brainyrich/pages/AnalyticsPage.js +253 -252
- package/dist/brainyrich/pages/AnalyticsPage.js.map +1 -1
- package/dist/brainyrich/pages/DashboardPage.js +115 -115
- package/dist/brainyrich/pages/DashboardPage.js.map +1 -1
- package/dist/brainyrich/pages/FamilyPage.js +59 -59
- package/dist/brainyrich/pages/FamilyPage.js.map +1 -1
- package/dist/brainyrich/pages/GoalsPage.js +285 -285
- package/dist/brainyrich/pages/GoalsPage.js.map +1 -1
- package/dist/brainyrich/pages/InvestmentsPage.js +18 -18
- package/dist/brainyrich/pages/InvestmentsPage.js.map +1 -1
- package/dist/brainyrich/pages/PortfoliosPage.d.ts.map +1 -1
- package/dist/brainyrich/pages/PortfoliosPage.js +477 -471
- package/dist/brainyrich/pages/PortfoliosPage.js.map +1 -1
- package/dist/brainyrich/pages/ReportsPage.js +52 -52
- 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 +272 -271
- package/dist/brainyrich/pages/RiskPage.js.map +1 -1
- package/dist/brainyrich/pages/TaxPage.d.ts.map +1 -1
- package/dist/brainyrich/pages/TaxPage.js +198 -197
- package/dist/brainyrich/pages/TaxPage.js.map +1 -1
- package/dist/brainyrich/pages/_shared.d.ts.map +1 -1
- package/dist/brainyrich/pages/_shared.js +84 -82
- package/dist/brainyrich/pages/_shared.js.map +1 -1
- package/dist/brainyrich/types/bra.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import { useAllHoldings as e, useArchivePortfolio as t, useCreateHolding as n, useCreatePortfolio as r, useDeleteHolding as i, useHouseholds as a, useModelPortfolios as o, usePagedPortfolios as s, usePortfolio as c, useUpdateHolding as l, useUpdatePortfolio as u } from "../hooks/useBrainyRichApi.js";
|
|
2
2
|
import { LoadMore as d } from "../components/LoadMore.js";
|
|
3
3
|
import { ConfirmDialog as f } from "../components/ConfirmDialog.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { useTr as p } from "../hooks/useTr.js";
|
|
5
|
+
import { DonutChart as m, FadeIn as h, GlassCard as g, StatTile as _ } from "../components/viz.js";
|
|
6
|
+
import { AccountPicker as v } from "../components/pickers.js";
|
|
6
7
|
import "../components/index.js";
|
|
7
|
-
import { AllocationBars as
|
|
8
|
+
import { AllocationBars as y, EmptyState as ee, ErrorState as te, LoadingState as ne, SectionShell as re, deltaToneClass as b, formatCompact as ie, formatMoney as x, formatPct as S, statusBadgeVariant as ae } from "./_shared.js";
|
|
8
9
|
import { hapticSuccess as C, showToast as w } from "../utils/nativeControls.js";
|
|
9
10
|
import { useTrackBrainyRichPageView as T } from "../hooks/useBrainyRichAnalytics.js";
|
|
10
|
-
import { TagField as
|
|
11
|
+
import { TagField as E } from "../components/reuse/TagField.js";
|
|
11
12
|
import { CommentThread as oe } from "../components/reuse/CommentThread.js";
|
|
12
|
-
import { useMemo as
|
|
13
|
-
import { ArrowDownRight as
|
|
14
|
-
import { Fragment as
|
|
15
|
-
import { Badge as
|
|
13
|
+
import { useMemo as D, useState as O } from "react";
|
|
14
|
+
import { ArrowDownRight as k, ArrowUpRight as A, Briefcase as j, MoreHorizontal as M, Pencil as se, Plus as ce, Trash2 as le } from "lucide-react";
|
|
15
|
+
import { Fragment as ue, jsx as N, jsxs as P } from "react/jsx-runtime";
|
|
16
|
+
import { Badge as F, Button as I, Card as L, CardContent as R, CardDescription as z, CardHeader as B, CardTitle as V, DropdownMenu as de, DropdownMenuContent as fe, DropdownMenuItem as H, DropdownMenuLabel as pe, DropdownMenuSeparator as me, DropdownMenuTrigger as he, Input as U, Label as W, ResponsiveDialog as G, ResponsiveDialogContent as K, ResponsiveDialogDescription as q, ResponsiveDialogFooter as ge, ResponsiveDialogHeader as _e, ResponsiveDialogTitle as ve, Select as ye, SelectContent as be, SelectItem as J, SelectTrigger as xe, SelectValue as Se, Sheet as Ce, SheetContent as we, SheetDescription as Te, SheetHeader as Ee, SheetTitle as De, Table as Oe, TableBody as ke, TableCell as Y, TableHead as X, TableHeader as Ae, TableRow as je, Textarea as Me } from "@burdenoff/fe-libs/ui";
|
|
16
17
|
//#region src/brainyrich/pages/PortfoliosPage.tsx
|
|
17
|
-
var
|
|
18
|
+
var Ne = [
|
|
18
19
|
"EQUITY",
|
|
19
20
|
"FIXED_INCOME",
|
|
20
21
|
"CASH",
|
|
@@ -22,7 +23,7 @@ var Me = [
|
|
|
22
23
|
"COMMODITY",
|
|
23
24
|
"CRYPTO",
|
|
24
25
|
"ALTERNATIVE"
|
|
25
|
-
],
|
|
26
|
+
], Pe = [
|
|
26
27
|
"DRAFT",
|
|
27
28
|
"ACTIVE",
|
|
28
29
|
"ARCHIVED"
|
|
@@ -30,7 +31,7 @@ var Me = [
|
|
|
30
31
|
if (e.trim() === "") return;
|
|
31
32
|
let t = Number(e);
|
|
32
33
|
return Number.isFinite(t) ? t : void 0;
|
|
33
|
-
},
|
|
34
|
+
}, Fe = {
|
|
34
35
|
EQUITY: "brand",
|
|
35
36
|
FIXED_INCOME: "blue",
|
|
36
37
|
CASH: "teal",
|
|
@@ -38,8 +39,8 @@ var Me = [
|
|
|
38
39
|
COMMODITY: "warning",
|
|
39
40
|
CRYPTO: "indigo",
|
|
40
41
|
ALTERNATIVE: "info"
|
|
41
|
-
},
|
|
42
|
-
function
|
|
42
|
+
}, Ie = (e) => Fe[e.toUpperCase()] ?? "neutral";
|
|
43
|
+
function Le(e) {
|
|
43
44
|
return Array.isArray(e) ? e.flatMap((e) => {
|
|
44
45
|
if (!e || typeof e != "object") return [];
|
|
45
46
|
let { assetClass: t, targetPct: n } = e;
|
|
@@ -57,21 +58,21 @@ function Ie(e) {
|
|
|
57
58
|
}] : [];
|
|
58
59
|
}) : [];
|
|
59
60
|
}
|
|
60
|
-
function
|
|
61
|
-
return
|
|
61
|
+
function Re(e) {
|
|
62
|
+
return Le(e).map((e) => ({
|
|
62
63
|
label: Q(e.assetClass),
|
|
63
64
|
value: e.targetPct,
|
|
64
65
|
tone: "accent"
|
|
65
66
|
}));
|
|
66
67
|
}
|
|
67
|
-
function
|
|
68
|
-
return
|
|
68
|
+
function ze(e) {
|
|
69
|
+
return Le(e).filter((e) => e.targetPct > 0).sort((e, t) => t.targetPct - e.targetPct).map((e) => ({
|
|
69
70
|
label: Q(e.assetClass),
|
|
70
71
|
value: e.targetPct,
|
|
71
|
-
tone:
|
|
72
|
+
tone: Ie(e.assetClass)
|
|
72
73
|
}));
|
|
73
74
|
}
|
|
74
|
-
var
|
|
75
|
+
var Be = {
|
|
75
76
|
marketValue: 0,
|
|
76
77
|
costBasis: 0,
|
|
77
78
|
unrealizedGain: 0,
|
|
@@ -80,11 +81,11 @@ var ze = {
|
|
|
80
81
|
maxDriftPct: null,
|
|
81
82
|
driftAssetClass: null
|
|
82
83
|
};
|
|
83
|
-
function
|
|
84
|
-
if (e.length === 0) return
|
|
84
|
+
function Ve(e, t) {
|
|
85
|
+
if (e.length === 0) return Be;
|
|
85
86
|
let n = 0, r = 0, i = /* @__PURE__ */ new Map();
|
|
86
87
|
for (let t of e) n += t.marketValue, r += t.costBasis, i.set(t.assetClass, (i.get(t.assetClass) ?? 0) + t.marketValue);
|
|
87
|
-
let a = n - r, o =
|
|
88
|
+
let a = n - r, o = Le(t), s = null, c = null;
|
|
88
89
|
if (o.length > 0 && n > 0) {
|
|
89
90
|
let e = new Set([...i.keys(), ...o.map((e) => e.assetClass)]);
|
|
90
91
|
for (let t of e) {
|
|
@@ -102,21 +103,21 @@ function Be(e, t) {
|
|
|
102
103
|
driftAssetClass: c
|
|
103
104
|
};
|
|
104
105
|
}
|
|
105
|
-
function
|
|
106
|
-
let n = e > 0, r = e < 0, i = n ? "text-status-success-text" : r ? "text-status-error-text" : "text-text-secondary", a = n ?
|
|
107
|
-
return /* @__PURE__ */
|
|
106
|
+
function He({ value: e, currency: t }) {
|
|
107
|
+
let n = e > 0, r = e < 0, i = n ? "text-status-success-text" : r ? "text-status-error-text" : "text-text-secondary", a = n ? A : r ? k : null;
|
|
108
|
+
return /* @__PURE__ */ P("span", {
|
|
108
109
|
className: `inline-flex items-center justify-end gap-1 font-medium ${i}`,
|
|
109
110
|
children: [
|
|
110
|
-
a ? /* @__PURE__ */
|
|
111
|
+
a ? /* @__PURE__ */ N(a, {
|
|
111
112
|
className: "size-3.5",
|
|
112
113
|
"aria-hidden": "true"
|
|
113
114
|
}) : null,
|
|
114
115
|
n ? "+" : "",
|
|
115
|
-
|
|
116
|
+
x(e, t)
|
|
116
117
|
]
|
|
117
118
|
});
|
|
118
119
|
}
|
|
119
|
-
function
|
|
120
|
+
function Ue() {
|
|
120
121
|
return {
|
|
121
122
|
name: "",
|
|
122
123
|
baseCurrency: "USD",
|
|
@@ -127,9 +128,9 @@ function He() {
|
|
|
127
128
|
householdId: Z
|
|
128
129
|
};
|
|
129
130
|
}
|
|
130
|
-
function
|
|
131
|
-
let { data:
|
|
132
|
-
e &&
|
|
131
|
+
function We({ open: e, onOpenChange: t, editing: n }) {
|
|
132
|
+
let i = p(), { data: s } = o(), { data: c } = a(), l = r(), d = u(), [f, m] = O(Ue), [h, g] = O(null), _ = n?.id ?? "new";
|
|
133
|
+
e && h !== _ && (g(_), m(n ? {
|
|
133
134
|
name: n.name,
|
|
134
135
|
baseCurrency: n.baseCurrency,
|
|
135
136
|
description: n.description ?? "",
|
|
@@ -137,193 +138,193 @@ function Ue({ open: e, onOpenChange: t, editing: n }) {
|
|
|
137
138
|
status: n.status,
|
|
138
139
|
modelPortfolioId: n.modelPortfolioId ?? Z,
|
|
139
140
|
householdId: n.householdId ?? Z
|
|
140
|
-
} :
|
|
141
|
-
let
|
|
142
|
-
return /* @__PURE__ */
|
|
141
|
+
} : Ue())), !e && h !== null && g(null);
|
|
142
|
+
let v = l.isPending || d.isPending, y = f.name.trim().length > 0;
|
|
143
|
+
return /* @__PURE__ */ N(G, {
|
|
143
144
|
open: e,
|
|
144
145
|
onOpenChange: t,
|
|
145
|
-
children: /* @__PURE__ */
|
|
146
|
+
children: /* @__PURE__ */ P(K, {
|
|
146
147
|
className: "max-h-[90vh] overflow-y-auto sm:max-w-lg",
|
|
147
148
|
children: [
|
|
148
|
-
/* @__PURE__ */
|
|
149
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ P(_e, { children: [/* @__PURE__ */ N(ve, { children: n ? i("brainyrich.portfolios.form.editTitle", "Edit portfolio") : i("brainyrich.portfolios.form.newTitle", "New portfolio") }), /* @__PURE__ */ N(q, { children: n ? i("brainyrich.portfolios.form.editDescription", "Update this portfolio's strategy settings.") : i("brainyrich.portfolios.form.newDescription", "Create an investment portfolio to organize and rebalance holdings.") })] }),
|
|
150
|
+
/* @__PURE__ */ P("div", {
|
|
150
151
|
className: "space-y-4 py-2",
|
|
151
152
|
children: [
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
+
/* @__PURE__ */ P("div", {
|
|
153
154
|
className: "space-y-1.5",
|
|
154
|
-
children: [/* @__PURE__ */
|
|
155
|
+
children: [/* @__PURE__ */ N(W, {
|
|
155
156
|
htmlFor: "pf-name",
|
|
156
|
-
children: "Name"
|
|
157
|
-
}), /* @__PURE__ */
|
|
157
|
+
children: i("brainyrich.portfolios.form.name", "Name")
|
|
158
|
+
}), /* @__PURE__ */ N(U, {
|
|
158
159
|
id: "pf-name",
|
|
159
|
-
value:
|
|
160
|
-
onChange: (e) =>
|
|
160
|
+
value: f.name,
|
|
161
|
+
onChange: (e) => m((t) => ({
|
|
161
162
|
...t,
|
|
162
163
|
name: e.target.value
|
|
163
164
|
})),
|
|
164
|
-
placeholder: "Growth Portfolio",
|
|
165
|
-
"aria-invalid": !
|
|
165
|
+
placeholder: i("brainyrich.portfolios.form.namePlaceholder", "Growth Portfolio"),
|
|
166
|
+
"aria-invalid": !y
|
|
166
167
|
})]
|
|
167
168
|
}),
|
|
168
|
-
/* @__PURE__ */
|
|
169
|
+
/* @__PURE__ */ P("div", {
|
|
169
170
|
className: "grid grid-cols-2 gap-4",
|
|
170
|
-
children: [/* @__PURE__ */
|
|
171
|
+
children: [/* @__PURE__ */ P("div", {
|
|
171
172
|
className: "space-y-1.5",
|
|
172
|
-
children: [/* @__PURE__ */
|
|
173
|
+
children: [/* @__PURE__ */ N(W, {
|
|
173
174
|
htmlFor: "pf-currency",
|
|
174
|
-
children: "Base currency"
|
|
175
|
-
}), /* @__PURE__ */
|
|
175
|
+
children: i("brainyrich.portfolios.form.currency", "Base currency")
|
|
176
|
+
}), /* @__PURE__ */ N(U, {
|
|
176
177
|
id: "pf-currency",
|
|
177
|
-
value:
|
|
178
|
-
onChange: (e) =>
|
|
178
|
+
value: f.baseCurrency,
|
|
179
|
+
onChange: (e) => m((t) => ({
|
|
179
180
|
...t,
|
|
180
181
|
baseCurrency: e.target.value.toUpperCase()
|
|
181
182
|
})),
|
|
182
|
-
placeholder: "USD",
|
|
183
|
+
placeholder: i("brainyrich.portfolios.form.currencyPlaceholder", "USD"),
|
|
183
184
|
maxLength: 3
|
|
184
185
|
})]
|
|
185
|
-
}), /* @__PURE__ */
|
|
186
|
+
}), /* @__PURE__ */ P("div", {
|
|
186
187
|
className: "space-y-1.5",
|
|
187
|
-
children: [/* @__PURE__ */
|
|
188
|
+
children: [/* @__PURE__ */ N(W, {
|
|
188
189
|
htmlFor: "pf-drift",
|
|
189
|
-
children: "Drift threshold %"
|
|
190
|
-
}), /* @__PURE__ */
|
|
190
|
+
children: i("brainyrich.portfolios.form.driftThreshold", "Drift threshold %")
|
|
191
|
+
}), /* @__PURE__ */ N(U, {
|
|
191
192
|
id: "pf-drift",
|
|
192
193
|
type: "number",
|
|
193
194
|
min: 0,
|
|
194
195
|
step: "0.5",
|
|
195
|
-
value:
|
|
196
|
-
onChange: (e) =>
|
|
196
|
+
value: f.driftThresholdPct,
|
|
197
|
+
onChange: (e) => m((t) => ({
|
|
197
198
|
...t,
|
|
198
199
|
driftThresholdPct: e.target.value
|
|
199
200
|
}))
|
|
200
201
|
})]
|
|
201
202
|
})]
|
|
202
203
|
}),
|
|
203
|
-
n ? /* @__PURE__ */
|
|
204
|
+
n ? /* @__PURE__ */ P("div", {
|
|
204
205
|
className: "space-y-1.5",
|
|
205
|
-
children: [/* @__PURE__ */
|
|
206
|
+
children: [/* @__PURE__ */ N(W, {
|
|
206
207
|
htmlFor: "pf-status",
|
|
207
|
-
children: "Status"
|
|
208
|
-
}), /* @__PURE__ */
|
|
209
|
-
value:
|
|
210
|
-
onValueChange: (e) =>
|
|
208
|
+
children: i("brainyrich.portfolios.form.status", "Status")
|
|
209
|
+
}), /* @__PURE__ */ P(ye, {
|
|
210
|
+
value: f.status,
|
|
211
|
+
onValueChange: (e) => m((t) => ({
|
|
211
212
|
...t,
|
|
212
213
|
status: e
|
|
213
214
|
})),
|
|
214
|
-
children: [/* @__PURE__ */
|
|
215
|
+
children: [/* @__PURE__ */ N(xe, {
|
|
215
216
|
id: "pf-status",
|
|
216
|
-
children: /* @__PURE__ */
|
|
217
|
-
}), /* @__PURE__ */
|
|
217
|
+
children: /* @__PURE__ */ N(Se, {})
|
|
218
|
+
}), /* @__PURE__ */ N(be, { children: Pe.map((e) => /* @__PURE__ */ N(J, {
|
|
218
219
|
value: e,
|
|
219
220
|
children: Q(e)
|
|
220
221
|
}, e)) })]
|
|
221
222
|
})]
|
|
222
223
|
}) : null,
|
|
223
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ P("div", {
|
|
224
225
|
className: "space-y-1.5",
|
|
225
|
-
children: [/* @__PURE__ */
|
|
226
|
+
children: [/* @__PURE__ */ N(W, {
|
|
226
227
|
htmlFor: "pf-model",
|
|
227
|
-
children: "Model portfolio"
|
|
228
|
-
}), /* @__PURE__ */
|
|
229
|
-
value:
|
|
230
|
-
onValueChange: (e) =>
|
|
228
|
+
children: i("brainyrich.portfolios.form.modelPortfolio", "Model portfolio")
|
|
229
|
+
}), /* @__PURE__ */ P(ye, {
|
|
230
|
+
value: f.modelPortfolioId,
|
|
231
|
+
onValueChange: (e) => m((t) => ({
|
|
231
232
|
...t,
|
|
232
233
|
modelPortfolioId: e
|
|
233
234
|
})),
|
|
234
|
-
children: [/* @__PURE__ */
|
|
235
|
+
children: [/* @__PURE__ */ N(xe, {
|
|
235
236
|
id: "pf-model",
|
|
236
|
-
children: /* @__PURE__ */
|
|
237
|
-
}), /* @__PURE__ */
|
|
237
|
+
children: /* @__PURE__ */ N(Se, { placeholder: i("brainyrich.common.none", "None") })
|
|
238
|
+
}), /* @__PURE__ */ P(be, { children: [/* @__PURE__ */ N(J, {
|
|
238
239
|
value: Z,
|
|
239
|
-
children: "None"
|
|
240
|
-
}),
|
|
240
|
+
children: i("brainyrich.common.none", "None")
|
|
241
|
+
}), s.map((e) => /* @__PURE__ */ N(J, {
|
|
241
242
|
value: e.id,
|
|
242
243
|
children: e.name
|
|
243
244
|
}, e.id))] })]
|
|
244
245
|
})]
|
|
245
246
|
}),
|
|
246
|
-
n ? null : /* @__PURE__ */
|
|
247
|
+
n ? null : /* @__PURE__ */ P("div", {
|
|
247
248
|
className: "space-y-1.5",
|
|
248
|
-
children: [/* @__PURE__ */
|
|
249
|
+
children: [/* @__PURE__ */ N(W, {
|
|
249
250
|
htmlFor: "pf-household",
|
|
250
|
-
children: "Household"
|
|
251
|
-
}), /* @__PURE__ */
|
|
252
|
-
value:
|
|
253
|
-
onValueChange: (e) =>
|
|
251
|
+
children: i("brainyrich.portfolios.form.household", "Household")
|
|
252
|
+
}), /* @__PURE__ */ P(ye, {
|
|
253
|
+
value: f.householdId,
|
|
254
|
+
onValueChange: (e) => m((t) => ({
|
|
254
255
|
...t,
|
|
255
256
|
householdId: e
|
|
256
257
|
})),
|
|
257
|
-
children: [/* @__PURE__ */
|
|
258
|
+
children: [/* @__PURE__ */ N(xe, {
|
|
258
259
|
id: "pf-household",
|
|
259
|
-
children: /* @__PURE__ */
|
|
260
|
-
}), /* @__PURE__ */
|
|
260
|
+
children: /* @__PURE__ */ N(Se, { placeholder: i("brainyrich.common.none", "None") })
|
|
261
|
+
}), /* @__PURE__ */ P(be, { children: [/* @__PURE__ */ N(J, {
|
|
261
262
|
value: Z,
|
|
262
|
-
children: "None"
|
|
263
|
-
}),
|
|
263
|
+
children: i("brainyrich.common.none", "None")
|
|
264
|
+
}), c.map((e) => /* @__PURE__ */ N(J, {
|
|
264
265
|
value: e.id,
|
|
265
266
|
children: e.name
|
|
266
267
|
}, e.id))] })]
|
|
267
268
|
})]
|
|
268
269
|
}),
|
|
269
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ P("div", {
|
|
270
271
|
className: "space-y-1.5",
|
|
271
|
-
children: [/* @__PURE__ */
|
|
272
|
+
children: [/* @__PURE__ */ N(W, {
|
|
272
273
|
htmlFor: "pf-desc",
|
|
273
|
-
children: "Description"
|
|
274
|
-
}), /* @__PURE__ */
|
|
274
|
+
children: i("brainyrich.portfolios.form.description", "Description")
|
|
275
|
+
}), /* @__PURE__ */ N(Me, {
|
|
275
276
|
id: "pf-desc",
|
|
276
|
-
value:
|
|
277
|
-
onChange: (e) =>
|
|
277
|
+
value: f.description,
|
|
278
|
+
onChange: (e) => m((t) => ({
|
|
278
279
|
...t,
|
|
279
280
|
description: e.target.value
|
|
280
281
|
})),
|
|
281
|
-
placeholder: "Optional notes about this strategy",
|
|
282
|
+
placeholder: i("brainyrich.portfolios.form.descriptionPlaceholder", "Optional notes about this strategy"),
|
|
282
283
|
rows: 3
|
|
283
284
|
})]
|
|
284
285
|
})
|
|
285
286
|
]
|
|
286
287
|
}),
|
|
287
|
-
/* @__PURE__ */
|
|
288
|
+
/* @__PURE__ */ P(ge, { children: [/* @__PURE__ */ N(I, {
|
|
288
289
|
variant: "outline",
|
|
289
290
|
onClick: () => t(!1),
|
|
290
|
-
disabled:
|
|
291
|
-
children: "Cancel"
|
|
292
|
-
}), /* @__PURE__ */
|
|
291
|
+
disabled: v,
|
|
292
|
+
children: i("brainyrich.common.cancel", "Cancel")
|
|
293
|
+
}), /* @__PURE__ */ N(I, {
|
|
293
294
|
onClick: () => {
|
|
294
|
-
if (!
|
|
295
|
-
let e = $(
|
|
296
|
-
n ?
|
|
295
|
+
if (!y) return;
|
|
296
|
+
let e = $(f.driftThresholdPct), r = f.modelPortfolioId === Z ? null : f.modelPortfolioId, a = f.householdId === Z ? null : f.householdId;
|
|
297
|
+
n ? d.mutate({
|
|
297
298
|
id: n.id,
|
|
298
299
|
input: {
|
|
299
|
-
name:
|
|
300
|
-
baseCurrency:
|
|
301
|
-
description:
|
|
300
|
+
name: f.name.trim(),
|
|
301
|
+
baseCurrency: f.baseCurrency.trim() || "USD",
|
|
302
|
+
description: f.description.trim() || null,
|
|
302
303
|
driftThresholdPct: e,
|
|
303
|
-
status:
|
|
304
|
+
status: f.status,
|
|
304
305
|
modelPortfolioId: r
|
|
305
306
|
}
|
|
306
307
|
}, { onSuccess: () => {
|
|
307
|
-
C(), w("Portfolio saved"), t(!1);
|
|
308
|
-
} }) :
|
|
309
|
-
name:
|
|
310
|
-
baseCurrency:
|
|
311
|
-
description:
|
|
308
|
+
C(), w(i("brainyrich.portfolios.form.saved", "Portfolio saved")), t(!1);
|
|
309
|
+
} }) : l.mutate({
|
|
310
|
+
name: f.name.trim(),
|
|
311
|
+
baseCurrency: f.baseCurrency.trim() || "USD",
|
|
312
|
+
description: f.description.trim() || null,
|
|
312
313
|
driftThresholdPct: e,
|
|
313
314
|
modelPortfolioId: r,
|
|
314
|
-
householdId:
|
|
315
|
+
householdId: a
|
|
315
316
|
}, { onSuccess: () => {
|
|
316
|
-
C(), w("Portfolio created"), t(!1);
|
|
317
|
+
C(), w(i("brainyrich.portfolios.form.created", "Portfolio created")), t(!1);
|
|
317
318
|
} });
|
|
318
319
|
},
|
|
319
|
-
disabled: !
|
|
320
|
-
children:
|
|
320
|
+
disabled: !y || v,
|
|
321
|
+
children: v ? i("brainyrich.common.saving", "Saving…") : n ? i("brainyrich.portfolios.form.saveChanges", "Save changes") : i("brainyrich.portfolios.form.create", "Create portfolio")
|
|
321
322
|
})] })
|
|
322
323
|
]
|
|
323
324
|
})
|
|
324
325
|
});
|
|
325
326
|
}
|
|
326
|
-
function
|
|
327
|
+
function Ge() {
|
|
327
328
|
return {
|
|
328
329
|
accountId: "",
|
|
329
330
|
symbol: "",
|
|
@@ -334,9 +335,9 @@ function We() {
|
|
|
334
335
|
costBasis: "0"
|
|
335
336
|
};
|
|
336
337
|
}
|
|
337
|
-
function
|
|
338
|
-
let a =
|
|
339
|
-
e &&
|
|
338
|
+
function Ke({ open: e, onOpenChange: t, portfolioId: r, editing: i }) {
|
|
339
|
+
let a = p(), o = n(), s = l(), [c, u] = O(Ge), [d, f] = O(null), m = i?.id ?? "new";
|
|
340
|
+
e && d !== m && (f(m), u(i ? {
|
|
340
341
|
accountId: i.accountId,
|
|
341
342
|
symbol: i.symbol,
|
|
342
343
|
name: i.name ?? "",
|
|
@@ -344,127 +345,127 @@ function Ge({ open: e, onOpenChange: t, portfolioId: r, editing: i }) {
|
|
|
344
345
|
quantity: String(i.quantity),
|
|
345
346
|
lastPrice: String(i.lastPrice),
|
|
346
347
|
costBasis: String(i.costBasis)
|
|
347
|
-
} :
|
|
348
|
-
let
|
|
349
|
-
return /* @__PURE__ */
|
|
348
|
+
} : Ge())), !e && d !== null && f(null);
|
|
349
|
+
let h = o.isPending || s.isPending, g = c.symbol.trim().length > 0, _ = i ? !0 : c.accountId.trim().length > 0, y = g && _ && !h;
|
|
350
|
+
return /* @__PURE__ */ N(G, {
|
|
350
351
|
open: e,
|
|
351
352
|
onOpenChange: t,
|
|
352
|
-
children: /* @__PURE__ */
|
|
353
|
+
children: /* @__PURE__ */ P(K, {
|
|
353
354
|
className: "max-h-[90vh] overflow-y-auto sm:max-w-lg",
|
|
354
355
|
children: [
|
|
355
|
-
/* @__PURE__ */
|
|
356
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ P(_e, { children: [/* @__PURE__ */ N(ve, { children: i ? a("brainyrich.portfolios.holding.editTitle", "Edit holding") : a("brainyrich.portfolios.holding.addTitle", "Add holding") }), /* @__PURE__ */ N(q, { children: i ? a("brainyrich.portfolios.holding.editDescription", "Update the position details for this holding.") : a("brainyrich.portfolios.holding.addDescription", "Add a position to this portfolio from one of your accounts.") })] }),
|
|
357
|
+
/* @__PURE__ */ P("div", {
|
|
357
358
|
className: "space-y-4 py-2",
|
|
358
359
|
children: [
|
|
359
|
-
i ? null : /* @__PURE__ */
|
|
360
|
+
i ? null : /* @__PURE__ */ N(v, {
|
|
360
361
|
id: "h-account",
|
|
361
|
-
value:
|
|
362
|
-
onChange: (e) =>
|
|
362
|
+
value: c.accountId,
|
|
363
|
+
onChange: (e) => u((t) => ({
|
|
363
364
|
...t,
|
|
364
365
|
accountId: e
|
|
365
366
|
})),
|
|
366
|
-
placeholder: "Select account"
|
|
367
|
+
placeholder: a("brainyrich.portfolios.holding.accountPlaceholder", "Select account")
|
|
367
368
|
}),
|
|
368
|
-
/* @__PURE__ */
|
|
369
|
+
/* @__PURE__ */ P("div", {
|
|
369
370
|
className: "grid grid-cols-2 gap-4",
|
|
370
|
-
children: [/* @__PURE__ */
|
|
371
|
+
children: [/* @__PURE__ */ P("div", {
|
|
371
372
|
className: "space-y-1.5",
|
|
372
|
-
children: [/* @__PURE__ */
|
|
373
|
+
children: [/* @__PURE__ */ N(W, {
|
|
373
374
|
htmlFor: "h-symbol",
|
|
374
|
-
children: "Symbol"
|
|
375
|
-
}), /* @__PURE__ */
|
|
375
|
+
children: a("brainyrich.portfolios.holding.symbol", "Symbol")
|
|
376
|
+
}), /* @__PURE__ */ N(U, {
|
|
376
377
|
id: "h-symbol",
|
|
377
|
-
value:
|
|
378
|
-
onChange: (e) =>
|
|
378
|
+
value: c.symbol,
|
|
379
|
+
onChange: (e) => u((t) => ({
|
|
379
380
|
...t,
|
|
380
381
|
symbol: e.target.value
|
|
381
382
|
})),
|
|
382
|
-
placeholder: "AAPL",
|
|
383
|
+
placeholder: a("brainyrich.portfolios.holding.symbolPlaceholder", "AAPL"),
|
|
383
384
|
disabled: !!i,
|
|
384
|
-
"aria-invalid": !
|
|
385
|
+
"aria-invalid": !g
|
|
385
386
|
})]
|
|
386
|
-
}), /* @__PURE__ */
|
|
387
|
+
}), /* @__PURE__ */ P("div", {
|
|
387
388
|
className: "space-y-1.5",
|
|
388
|
-
children: [/* @__PURE__ */
|
|
389
|
+
children: [/* @__PURE__ */ N(W, {
|
|
389
390
|
htmlFor: "h-class",
|
|
390
|
-
children: "Asset class"
|
|
391
|
-
}), /* @__PURE__ */
|
|
392
|
-
value:
|
|
393
|
-
onValueChange: (e) =>
|
|
391
|
+
children: a("brainyrich.portfolios.holding.assetClass", "Asset class")
|
|
392
|
+
}), /* @__PURE__ */ P(ye, {
|
|
393
|
+
value: c.assetClass,
|
|
394
|
+
onValueChange: (e) => u((t) => ({
|
|
394
395
|
...t,
|
|
395
396
|
assetClass: e
|
|
396
397
|
})),
|
|
397
|
-
children: [/* @__PURE__ */
|
|
398
|
+
children: [/* @__PURE__ */ N(xe, {
|
|
398
399
|
id: "h-class",
|
|
399
|
-
children: /* @__PURE__ */
|
|
400
|
-
}), /* @__PURE__ */
|
|
400
|
+
children: /* @__PURE__ */ N(Se, {})
|
|
401
|
+
}), /* @__PURE__ */ N(be, { children: Ne.map((e) => /* @__PURE__ */ N(J, {
|
|
401
402
|
value: e,
|
|
402
403
|
children: Q(e)
|
|
403
404
|
}, e)) })]
|
|
404
405
|
})]
|
|
405
406
|
})]
|
|
406
407
|
}),
|
|
407
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ P("div", {
|
|
408
409
|
className: "space-y-1.5",
|
|
409
|
-
children: [/* @__PURE__ */
|
|
410
|
+
children: [/* @__PURE__ */ N(W, {
|
|
410
411
|
htmlFor: "h-name",
|
|
411
|
-
children: "Name"
|
|
412
|
-
}), /* @__PURE__ */
|
|
412
|
+
children: a("brainyrich.portfolios.holding.name", "Name")
|
|
413
|
+
}), /* @__PURE__ */ N(U, {
|
|
413
414
|
id: "h-name",
|
|
414
|
-
value:
|
|
415
|
-
onChange: (e) =>
|
|
415
|
+
value: c.name,
|
|
416
|
+
onChange: (e) => u((t) => ({
|
|
416
417
|
...t,
|
|
417
418
|
name: e.target.value
|
|
418
419
|
})),
|
|
419
|
-
placeholder: "Apple Inc."
|
|
420
|
+
placeholder: a("brainyrich.portfolios.holding.namePlaceholder", "Apple Inc.")
|
|
420
421
|
})]
|
|
421
422
|
}),
|
|
422
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ P("div", {
|
|
423
424
|
className: "grid grid-cols-3 gap-4",
|
|
424
425
|
children: [
|
|
425
|
-
/* @__PURE__ */
|
|
426
|
+
/* @__PURE__ */ P("div", {
|
|
426
427
|
className: "space-y-1.5",
|
|
427
|
-
children: [/* @__PURE__ */
|
|
428
|
+
children: [/* @__PURE__ */ N(W, {
|
|
428
429
|
htmlFor: "h-qty",
|
|
429
|
-
children: "Quantity"
|
|
430
|
-
}), /* @__PURE__ */
|
|
430
|
+
children: a("brainyrich.portfolios.holding.quantity", "Quantity")
|
|
431
|
+
}), /* @__PURE__ */ N(U, {
|
|
431
432
|
id: "h-qty",
|
|
432
433
|
type: "number",
|
|
433
434
|
step: "any",
|
|
434
|
-
value:
|
|
435
|
-
onChange: (e) =>
|
|
435
|
+
value: c.quantity,
|
|
436
|
+
onChange: (e) => u((t) => ({
|
|
436
437
|
...t,
|
|
437
438
|
quantity: e.target.value
|
|
438
439
|
}))
|
|
439
440
|
})]
|
|
440
441
|
}),
|
|
441
|
-
/* @__PURE__ */
|
|
442
|
+
/* @__PURE__ */ P("div", {
|
|
442
443
|
className: "space-y-1.5",
|
|
443
|
-
children: [/* @__PURE__ */
|
|
444
|
+
children: [/* @__PURE__ */ N(W, {
|
|
444
445
|
htmlFor: "h-price",
|
|
445
|
-
children: "Last price"
|
|
446
|
-
}), /* @__PURE__ */
|
|
446
|
+
children: a("brainyrich.portfolios.holding.lastPrice", "Last price")
|
|
447
|
+
}), /* @__PURE__ */ N(U, {
|
|
447
448
|
id: "h-price",
|
|
448
449
|
type: "number",
|
|
449
450
|
step: "any",
|
|
450
|
-
value:
|
|
451
|
-
onChange: (e) =>
|
|
451
|
+
value: c.lastPrice,
|
|
452
|
+
onChange: (e) => u((t) => ({
|
|
452
453
|
...t,
|
|
453
454
|
lastPrice: e.target.value
|
|
454
455
|
}))
|
|
455
456
|
})]
|
|
456
457
|
}),
|
|
457
|
-
/* @__PURE__ */
|
|
458
|
+
/* @__PURE__ */ P("div", {
|
|
458
459
|
className: "space-y-1.5",
|
|
459
|
-
children: [/* @__PURE__ */
|
|
460
|
+
children: [/* @__PURE__ */ N(W, {
|
|
460
461
|
htmlFor: "h-cost",
|
|
461
|
-
children: "Cost basis"
|
|
462
|
-
}), /* @__PURE__ */
|
|
462
|
+
children: a("brainyrich.portfolios.holding.costBasis", "Cost basis")
|
|
463
|
+
}), /* @__PURE__ */ N(U, {
|
|
463
464
|
id: "h-cost",
|
|
464
465
|
type: "number",
|
|
465
466
|
step: "any",
|
|
466
|
-
value:
|
|
467
|
-
onChange: (e) =>
|
|
467
|
+
value: c.costBasis,
|
|
468
|
+
onChange: (e) => u((t) => ({
|
|
468
469
|
...t,
|
|
469
470
|
costBasis: e.target.value
|
|
470
471
|
}))
|
|
@@ -474,159 +475,159 @@ function Ge({ open: e, onOpenChange: t, portfolioId: r, editing: i }) {
|
|
|
474
475
|
})
|
|
475
476
|
]
|
|
476
477
|
}),
|
|
477
|
-
/* @__PURE__ */
|
|
478
|
+
/* @__PURE__ */ P(ge, { children: [/* @__PURE__ */ N(I, {
|
|
478
479
|
variant: "outline",
|
|
479
480
|
onClick: () => t(!1),
|
|
480
|
-
disabled:
|
|
481
|
-
children: "Cancel"
|
|
482
|
-
}), /* @__PURE__ */
|
|
481
|
+
disabled: h,
|
|
482
|
+
children: a("brainyrich.common.cancel", "Cancel")
|
|
483
|
+
}), /* @__PURE__ */ N(I, {
|
|
483
484
|
onClick: () => {
|
|
484
|
-
!
|
|
485
|
+
!g || !_ || (i ? s.mutate({
|
|
485
486
|
id: i.id,
|
|
486
487
|
input: {
|
|
487
|
-
name:
|
|
488
|
-
assetClass:
|
|
489
|
-
quantity: $(
|
|
490
|
-
lastPrice: $(
|
|
491
|
-
costBasis: $(
|
|
488
|
+
name: c.name.trim() || null,
|
|
489
|
+
assetClass: c.assetClass,
|
|
490
|
+
quantity: $(c.quantity),
|
|
491
|
+
lastPrice: $(c.lastPrice),
|
|
492
|
+
costBasis: $(c.costBasis)
|
|
492
493
|
}
|
|
493
494
|
}, { onSuccess: () => {
|
|
494
|
-
C(), w("Holding saved"), t(!1);
|
|
495
|
-
} }) :
|
|
496
|
-
accountId:
|
|
495
|
+
C(), w(a("brainyrich.portfolios.holding.saved", "Holding saved")), t(!1);
|
|
496
|
+
} }) : o.mutate({
|
|
497
|
+
accountId: c.accountId,
|
|
497
498
|
portfolioId: r,
|
|
498
|
-
symbol:
|
|
499
|
-
name:
|
|
500
|
-
assetClass:
|
|
501
|
-
quantity: $(
|
|
502
|
-
lastPrice: $(
|
|
503
|
-
costBasis: $(
|
|
499
|
+
symbol: c.symbol.trim().toUpperCase(),
|
|
500
|
+
name: c.name.trim() || null,
|
|
501
|
+
assetClass: c.assetClass,
|
|
502
|
+
quantity: $(c.quantity),
|
|
503
|
+
lastPrice: $(c.lastPrice),
|
|
504
|
+
costBasis: $(c.costBasis)
|
|
504
505
|
}, { onSuccess: () => {
|
|
505
|
-
C(), w("Holding added"), t(!1);
|
|
506
|
+
C(), w(a("brainyrich.portfolios.holding.added", "Holding added")), t(!1);
|
|
506
507
|
} }));
|
|
507
508
|
},
|
|
508
|
-
disabled: !
|
|
509
|
-
children:
|
|
509
|
+
disabled: !y,
|
|
510
|
+
children: h ? a("brainyrich.common.saving", "Saving…") : i ? a("brainyrich.portfolios.holding.saveChanges", "Save changes") : a("brainyrich.portfolios.holding.add", "Add holding")
|
|
510
511
|
})] })
|
|
511
512
|
]
|
|
512
513
|
})
|
|
513
514
|
});
|
|
514
515
|
}
|
|
515
|
-
function
|
|
516
|
-
let { data: r, isLoading: a, isError: o, refetch: s } = c(t ?? void 0), l = e({ portfolioId: t ?? void 0 }, { enabled: t !== null }), u = i(), [d,
|
|
517
|
-
if (
|
|
516
|
+
function qe({ portfolioId: t, onOpenChange: n }) {
|
|
517
|
+
let { data: r, isLoading: a, isError: o, refetch: s } = c(t ?? void 0), l = e({ portfolioId: t ?? void 0 }, { enabled: t !== null }), u = i(), [d, p] = O(!1), [v, re] = O(null), [b, C] = O(null), w = D(() => t ? l.data : [], [t, l.data]), T = r?.baseCurrency ?? "USD", k = w.reduce((e, t) => e + t.marketValue, 0), A = w.reduce((e, t) => e + t.costBasis, 0), U = k - A, W = A > 0 ? U / A * 100 : 0, G = D(() => {
|
|
518
|
+
if (w.length === 0 || k <= 0) return [];
|
|
518
519
|
let e = /* @__PURE__ */ new Map();
|
|
519
|
-
return
|
|
520
|
+
return w.forEach((t) => e.set(t.assetClass, (e.get(t.assetClass) ?? 0) + t.marketValue)), Array.from(e.entries()).map(([e, t]) => ({
|
|
520
521
|
label: Q(e),
|
|
521
522
|
value: t,
|
|
522
|
-
tone:
|
|
523
|
+
tone: Ie(e)
|
|
523
524
|
})).sort((e, t) => t.value - e.value);
|
|
524
|
-
}, [
|
|
525
|
+
}, [w, k]), K = D(() => {
|
|
525
526
|
let e = /* @__PURE__ */ new Map();
|
|
526
|
-
return k <= 0 ||
|
|
527
|
-
}, [
|
|
528
|
-
let t =
|
|
527
|
+
return k <= 0 || w.forEach((t) => e.set(Q(t.assetClass), (e.get(Q(t.assetClass)) ?? 0) + t.marketValue / k * 100)), e;
|
|
528
|
+
}, [w, k]), q = D(() => Re(r?.targetAllocation).map((e) => {
|
|
529
|
+
let t = K.get(e.label) ?? 0;
|
|
529
530
|
return {
|
|
530
531
|
label: e.label,
|
|
531
532
|
value: e.value,
|
|
532
533
|
tone: "accent",
|
|
533
|
-
caption: `${
|
|
534
|
+
caption: `${S(e.value, 0)} target · ${S(t, 0)} actual`
|
|
534
535
|
};
|
|
535
|
-
}), [r?.targetAllocation,
|
|
536
|
-
|
|
537
|
-
},
|
|
538
|
-
|
|
536
|
+
}), [r?.targetAllocation, K]), ge = () => {
|
|
537
|
+
re(null), p(!0);
|
|
538
|
+
}, _e = (e) => {
|
|
539
|
+
re(e), p(!0);
|
|
539
540
|
};
|
|
540
|
-
return /* @__PURE__ */
|
|
541
|
+
return /* @__PURE__ */ N(Ce, {
|
|
541
542
|
open: t !== null,
|
|
542
543
|
onOpenChange: n,
|
|
543
|
-
children: /* @__PURE__ */
|
|
544
|
+
children: /* @__PURE__ */ N(we, {
|
|
544
545
|
className: "flex w-full flex-col gap-0 overflow-y-auto p-0 sm:max-w-2xl",
|
|
545
|
-
children: a || t !== null && l.isPending ? /* @__PURE__ */
|
|
546
|
+
children: a || t !== null && l.isPending ? /* @__PURE__ */ N("div", {
|
|
546
547
|
className: "p-6",
|
|
547
|
-
children: /* @__PURE__ */
|
|
548
|
-
}) : o || l.isError ? /* @__PURE__ */
|
|
548
|
+
children: /* @__PURE__ */ N(ne, { rows: 5 })
|
|
549
|
+
}) : o || l.isError ? /* @__PURE__ */ N("div", {
|
|
549
550
|
className: "p-6",
|
|
550
|
-
children: /* @__PURE__ */
|
|
551
|
+
children: /* @__PURE__ */ N(te, { onRetry: () => {
|
|
551
552
|
s(), l.refetch();
|
|
552
553
|
} })
|
|
553
|
-
}) : r ? /* @__PURE__ */
|
|
554
|
-
/* @__PURE__ */
|
|
554
|
+
}) : r ? /* @__PURE__ */ P(ue, { children: [
|
|
555
|
+
/* @__PURE__ */ P(Ee, {
|
|
555
556
|
className: "border-b border-border-subtle p-6",
|
|
556
|
-
children: [/* @__PURE__ */
|
|
557
|
+
children: [/* @__PURE__ */ P("div", {
|
|
557
558
|
className: "flex items-center gap-2",
|
|
558
|
-
children: [/* @__PURE__ */
|
|
559
|
+
children: [/* @__PURE__ */ N(De, {
|
|
559
560
|
className: "text-xl",
|
|
560
561
|
children: r.name
|
|
561
|
-
}), /* @__PURE__ */
|
|
562
|
-
variant:
|
|
562
|
+
}), /* @__PURE__ */ N(F, {
|
|
563
|
+
variant: ae(r.status),
|
|
563
564
|
children: Q(r.status)
|
|
564
565
|
})]
|
|
565
|
-
}), /* @__PURE__ */
|
|
566
|
+
}), /* @__PURE__ */ N(Te, { children: r.description?.trim() ? r.description : `${r.baseCurrency} · Drift threshold ${S(r.driftThresholdPct)}` })]
|
|
566
567
|
}),
|
|
567
|
-
/* @__PURE__ */
|
|
568
|
+
/* @__PURE__ */ P("div", {
|
|
568
569
|
className: "space-y-6 p-6",
|
|
569
570
|
children: [
|
|
570
|
-
/* @__PURE__ */
|
|
571
|
+
/* @__PURE__ */ P(h, {
|
|
571
572
|
className: "grid grid-cols-2 gap-3 lg:grid-cols-4",
|
|
572
573
|
children: [
|
|
573
|
-
/* @__PURE__ */
|
|
574
|
+
/* @__PURE__ */ N(_, {
|
|
574
575
|
label: "Market value",
|
|
575
|
-
value:
|
|
576
|
+
value: x(k, T),
|
|
576
577
|
glow: !0
|
|
577
578
|
}),
|
|
578
|
-
/* @__PURE__ */
|
|
579
|
+
/* @__PURE__ */ N(_, {
|
|
579
580
|
label: "Unrealized gain",
|
|
580
|
-
value:
|
|
581
|
-
delta:
|
|
582
|
-
deltaTone:
|
|
581
|
+
value: x(U, T),
|
|
582
|
+
delta: A > 0 ? W : void 0,
|
|
583
|
+
deltaTone: U > 0 ? "positive" : U < 0 ? "negative" : "neutral"
|
|
583
584
|
}),
|
|
584
|
-
/* @__PURE__ */
|
|
585
|
+
/* @__PURE__ */ N(_, {
|
|
585
586
|
label: "Holdings",
|
|
586
|
-
value: String(
|
|
587
|
+
value: String(w.length)
|
|
587
588
|
}),
|
|
588
|
-
/* @__PURE__ */
|
|
589
|
+
/* @__PURE__ */ N(_, {
|
|
589
590
|
label: "Drift threshold",
|
|
590
|
-
value:
|
|
591
|
+
value: S(r.driftThresholdPct)
|
|
591
592
|
})
|
|
592
593
|
]
|
|
593
594
|
}),
|
|
594
|
-
/* @__PURE__ */
|
|
595
|
+
/* @__PURE__ */ N(h, {
|
|
595
596
|
index: 1,
|
|
596
|
-
children: /* @__PURE__ */
|
|
597
|
+
children: /* @__PURE__ */ P(g, {
|
|
597
598
|
glow: !0,
|
|
598
599
|
className: "space-y-5",
|
|
599
|
-
children: [/* @__PURE__ */
|
|
600
|
+
children: [/* @__PURE__ */ P("div", {
|
|
600
601
|
className: "flex items-center justify-between gap-2",
|
|
601
|
-
children: [/* @__PURE__ */
|
|
602
|
+
children: [/* @__PURE__ */ N("h3", {
|
|
602
603
|
className: "text-sm font-semibold text-text-primary",
|
|
603
604
|
children: "Target vs actual allocation"
|
|
604
|
-
}), /* @__PURE__ */
|
|
605
|
+
}), /* @__PURE__ */ N(F, {
|
|
605
606
|
variant: "outline",
|
|
606
|
-
children:
|
|
607
|
+
children: T
|
|
607
608
|
})]
|
|
608
|
-
}), /* @__PURE__ */
|
|
609
|
+
}), /* @__PURE__ */ P("div", {
|
|
609
610
|
className: "grid gap-6 md:grid-cols-2",
|
|
610
|
-
children: [/* @__PURE__ */
|
|
611
|
+
children: [/* @__PURE__ */ P("div", {
|
|
611
612
|
className: "space-y-2",
|
|
612
|
-
children: [/* @__PURE__ */
|
|
613
|
+
children: [/* @__PURE__ */ N("p", {
|
|
613
614
|
className: "text-xs font-medium uppercase tracking-wide text-text-secondary",
|
|
614
615
|
children: "Actual — by market value"
|
|
615
|
-
}),
|
|
616
|
-
data:
|
|
617
|
-
centerValue:
|
|
616
|
+
}), G.length > 0 ? /* @__PURE__ */ N(m, {
|
|
617
|
+
data: G,
|
|
618
|
+
centerValue: ie(k, T),
|
|
618
619
|
centerLabel: "Market value",
|
|
619
|
-
valueFormatter: (e) =>
|
|
620
|
-
}) : /* @__PURE__ */
|
|
620
|
+
valueFormatter: (e) => x(e, T)
|
|
621
|
+
}) : /* @__PURE__ */ N("p", {
|
|
621
622
|
className: "py-8 text-center text-sm text-text-secondary",
|
|
622
623
|
children: "Add holdings to see the live allocation."
|
|
623
624
|
})]
|
|
624
|
-
}), /* @__PURE__ */
|
|
625
|
+
}), /* @__PURE__ */ P("div", {
|
|
625
626
|
className: "space-y-2",
|
|
626
|
-
children: [/* @__PURE__ */
|
|
627
|
+
children: [/* @__PURE__ */ N("p", {
|
|
627
628
|
className: "text-xs font-medium uppercase tracking-wide text-text-secondary",
|
|
628
629
|
children: "Target — vs live actual"
|
|
629
|
-
}),
|
|
630
|
+
}), q.length > 0 ? /* @__PURE__ */ N(y, { data: q }) : /* @__PURE__ */ N("p", {
|
|
630
631
|
className: "py-8 text-center text-sm text-text-secondary",
|
|
631
632
|
children: "No target allocation set for this portfolio."
|
|
632
633
|
})]
|
|
@@ -634,132 +635,132 @@ function Ke({ portfolioId: t, onOpenChange: n }) {
|
|
|
634
635
|
})]
|
|
635
636
|
})
|
|
636
637
|
}),
|
|
637
|
-
/* @__PURE__ */
|
|
638
|
+
/* @__PURE__ */ N(L, { children: /* @__PURE__ */ N(R, {
|
|
638
639
|
className: "p-4",
|
|
639
|
-
children: /* @__PURE__ */
|
|
640
|
+
children: /* @__PURE__ */ N(E, {
|
|
640
641
|
entityType: "brainyrich-portfolio",
|
|
641
642
|
entityId: r.id
|
|
642
643
|
})
|
|
643
644
|
}) }),
|
|
644
|
-
/* @__PURE__ */
|
|
645
|
+
/* @__PURE__ */ P(L, { children: [/* @__PURE__ */ P(B, {
|
|
645
646
|
className: "flex flex-row items-center justify-between",
|
|
646
|
-
children: [/* @__PURE__ */
|
|
647
|
+
children: [/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(V, {
|
|
647
648
|
className: "text-base",
|
|
648
649
|
children: "Holdings"
|
|
649
|
-
}), /* @__PURE__ */
|
|
650
|
+
}), /* @__PURE__ */ N(z, { children: "Positions held in this portfolio" })] }), /* @__PURE__ */ P(I, {
|
|
650
651
|
size: "sm",
|
|
651
|
-
onClick:
|
|
652
|
-
children: [/* @__PURE__ */
|
|
652
|
+
onClick: ge,
|
|
653
|
+
children: [/* @__PURE__ */ N(ce, {
|
|
653
654
|
className: "size-4",
|
|
654
655
|
"aria-hidden": "true"
|
|
655
656
|
}), "Add holding"]
|
|
656
657
|
})]
|
|
657
|
-
}), /* @__PURE__ */
|
|
658
|
-
icon: /* @__PURE__ */ j
|
|
658
|
+
}), /* @__PURE__ */ N(R, { children: w.length === 0 ? /* @__PURE__ */ N(ee, {
|
|
659
|
+
icon: /* @__PURE__ */ N(j, {
|
|
659
660
|
className: "size-6",
|
|
660
661
|
"aria-hidden": "true"
|
|
661
662
|
}),
|
|
662
663
|
title: "No holdings yet",
|
|
663
664
|
description: "Add positions to start tracking this portfolio.",
|
|
664
|
-
action: /* @__PURE__ */
|
|
665
|
+
action: /* @__PURE__ */ P(I, {
|
|
665
666
|
size: "sm",
|
|
666
|
-
onClick:
|
|
667
|
-
children: [/* @__PURE__ */
|
|
667
|
+
onClick: ge,
|
|
668
|
+
children: [/* @__PURE__ */ N(ce, {
|
|
668
669
|
className: "size-4",
|
|
669
670
|
"aria-hidden": "true"
|
|
670
671
|
}), "Add holding"]
|
|
671
672
|
})
|
|
672
|
-
}) : /* @__PURE__ */
|
|
673
|
+
}) : /* @__PURE__ */ N("div", {
|
|
673
674
|
className: "overflow-x-auto",
|
|
674
|
-
children: /* @__PURE__ */
|
|
675
|
-
/* @__PURE__ */
|
|
676
|
-
/* @__PURE__ */
|
|
677
|
-
/* @__PURE__ */
|
|
675
|
+
children: /* @__PURE__ */ P(Oe, { children: [/* @__PURE__ */ N(Ae, { children: /* @__PURE__ */ P(je, { children: [
|
|
676
|
+
/* @__PURE__ */ N(X, { children: "Symbol" }),
|
|
677
|
+
/* @__PURE__ */ N(X, { children: "Class" }),
|
|
678
|
+
/* @__PURE__ */ N(X, {
|
|
678
679
|
className: "text-right",
|
|
679
680
|
children: "Qty"
|
|
680
681
|
}),
|
|
681
|
-
/* @__PURE__ */
|
|
682
|
+
/* @__PURE__ */ N(X, {
|
|
682
683
|
className: "text-right",
|
|
683
684
|
children: "Price"
|
|
684
685
|
}),
|
|
685
|
-
/* @__PURE__ */
|
|
686
|
+
/* @__PURE__ */ N(X, {
|
|
686
687
|
className: "text-right",
|
|
687
688
|
children: "Market value"
|
|
688
689
|
}),
|
|
689
|
-
/* @__PURE__ */
|
|
690
|
+
/* @__PURE__ */ N(X, {
|
|
690
691
|
className: "text-right",
|
|
691
692
|
children: "Gain"
|
|
692
693
|
}),
|
|
693
|
-
/* @__PURE__ */
|
|
694
|
-
] }) }), /* @__PURE__ */
|
|
694
|
+
/* @__PURE__ */ N(X, { className: "w-10" })
|
|
695
|
+
] }) }), /* @__PURE__ */ N(ke, { children: w.map((e) => {
|
|
695
696
|
let t = e.marketValue - e.costBasis, n = e.costBasis > 0 ? t / e.costBasis * 100 : 0;
|
|
696
|
-
return /* @__PURE__ */
|
|
697
|
+
return /* @__PURE__ */ P(je, {
|
|
697
698
|
className: "transition-colors motion-safe:hover:bg-bg-sunken/60",
|
|
698
699
|
children: [
|
|
699
|
-
/* @__PURE__ */
|
|
700
|
+
/* @__PURE__ */ P(Y, { children: [/* @__PURE__ */ N("div", {
|
|
700
701
|
className: "font-semibold text-text-primary",
|
|
701
702
|
children: e.symbol
|
|
702
|
-
}), e.name ? /* @__PURE__ */
|
|
703
|
+
}), e.name ? /* @__PURE__ */ N("div", {
|
|
703
704
|
className: "text-xs text-text-secondary",
|
|
704
705
|
children: e.name
|
|
705
706
|
}) : null] }),
|
|
706
|
-
/* @__PURE__ */
|
|
707
|
+
/* @__PURE__ */ N(Y, { children: /* @__PURE__ */ N(F, {
|
|
707
708
|
variant: "outline",
|
|
708
709
|
children: Q(e.assetClass)
|
|
709
710
|
}) }),
|
|
710
|
-
/* @__PURE__ */
|
|
711
|
+
/* @__PURE__ */ N(Y, {
|
|
711
712
|
className: "text-right tabular-nums",
|
|
712
713
|
children: e.quantity
|
|
713
714
|
}),
|
|
714
|
-
/* @__PURE__ */
|
|
715
|
+
/* @__PURE__ */ N(Y, {
|
|
715
716
|
className: "text-right tabular-nums",
|
|
716
|
-
children:
|
|
717
|
+
children: x(e.lastPrice, e.currency)
|
|
717
718
|
}),
|
|
718
|
-
/* @__PURE__ */
|
|
719
|
+
/* @__PURE__ */ N(Y, {
|
|
719
720
|
className: "text-right font-medium tabular-nums",
|
|
720
|
-
children:
|
|
721
|
+
children: x(e.marketValue, e.currency)
|
|
721
722
|
}),
|
|
722
|
-
/* @__PURE__ */
|
|
723
|
+
/* @__PURE__ */ P(Y, {
|
|
723
724
|
className: "text-right tabular-nums",
|
|
724
|
-
children: [/* @__PURE__ */
|
|
725
|
+
children: [/* @__PURE__ */ N(He, {
|
|
725
726
|
value: t,
|
|
726
727
|
currency: e.currency
|
|
727
|
-
}), e.costBasis > 0 ? /* @__PURE__ */
|
|
728
|
+
}), e.costBasis > 0 ? /* @__PURE__ */ P("div", {
|
|
728
729
|
className: "text-xs text-text-secondary",
|
|
729
|
-
children: [t > 0 ? "+" : "",
|
|
730
|
+
children: [t > 0 ? "+" : "", S(n)]
|
|
730
731
|
}) : null]
|
|
731
732
|
}),
|
|
732
|
-
/* @__PURE__ */
|
|
733
|
+
/* @__PURE__ */ N(Y, {
|
|
733
734
|
className: "text-right",
|
|
734
|
-
children: /* @__PURE__ */
|
|
735
|
+
children: /* @__PURE__ */ P(de, { children: [/* @__PURE__ */ N(he, {
|
|
735
736
|
asChild: !0,
|
|
736
|
-
children: /* @__PURE__ */
|
|
737
|
+
children: /* @__PURE__ */ N(I, {
|
|
737
738
|
variant: "ghost",
|
|
738
739
|
size: "icon",
|
|
739
740
|
className: "size-10",
|
|
740
741
|
"aria-label": `Actions for ${e.symbol}`,
|
|
741
|
-
children: /* @__PURE__ */
|
|
742
|
+
children: /* @__PURE__ */ N(M, {
|
|
742
743
|
className: "size-4",
|
|
743
744
|
"aria-hidden": "true"
|
|
744
745
|
})
|
|
745
746
|
})
|
|
746
|
-
}), /* @__PURE__ */
|
|
747
|
+
}), /* @__PURE__ */ P(fe, {
|
|
747
748
|
align: "end",
|
|
748
749
|
children: [
|
|
749
|
-
/* @__PURE__ */
|
|
750
|
-
/* @__PURE__ */
|
|
751
|
-
/* @__PURE__ */
|
|
750
|
+
/* @__PURE__ */ N(pe, { children: e.symbol }),
|
|
751
|
+
/* @__PURE__ */ N(me, {}),
|
|
752
|
+
/* @__PURE__ */ P(H, {
|
|
752
753
|
className: "gap-2",
|
|
753
|
-
onClick: () =>
|
|
754
|
-
children: [/* @__PURE__ */
|
|
754
|
+
onClick: () => _e(e),
|
|
755
|
+
children: [/* @__PURE__ */ N(se, {
|
|
755
756
|
className: "size-4",
|
|
756
757
|
"aria-hidden": "true"
|
|
757
758
|
}), "Edit"]
|
|
758
759
|
}),
|
|
759
|
-
/* @__PURE__ */
|
|
760
|
+
/* @__PURE__ */ P(H, {
|
|
760
761
|
className: "gap-2 text-status-error-text focus:text-status-error-text",
|
|
761
|
-
onClick: () =>
|
|
762
|
-
children: [/* @__PURE__ */
|
|
762
|
+
onClick: () => C(e),
|
|
763
|
+
children: [/* @__PURE__ */ N(le, {
|
|
763
764
|
className: "size-4",
|
|
764
765
|
"aria-hidden": "true"
|
|
765
766
|
}), "Delete"]
|
|
@@ -771,51 +772,51 @@ function Ke({ portfolioId: t, onOpenChange: n }) {
|
|
|
771
772
|
}, e.id);
|
|
772
773
|
}) })] })
|
|
773
774
|
}) })] }),
|
|
774
|
-
/* @__PURE__ */
|
|
775
|
+
/* @__PURE__ */ P(L, { children: [/* @__PURE__ */ P(B, {
|
|
775
776
|
className: "pb-3",
|
|
776
|
-
children: [/* @__PURE__ */
|
|
777
|
+
children: [/* @__PURE__ */ N(V, {
|
|
777
778
|
className: "text-sm",
|
|
778
779
|
children: "Tags"
|
|
779
|
-
}), /* @__PURE__ */
|
|
780
|
-
}), /* @__PURE__ */
|
|
780
|
+
}), /* @__PURE__ */ N(z, { children: "Organize and filter this portfolio." })]
|
|
781
|
+
}), /* @__PURE__ */ N(R, { children: /* @__PURE__ */ N(E, {
|
|
781
782
|
entityType: "brainyrich-portfolio",
|
|
782
783
|
entityId: r.id,
|
|
783
784
|
hideLabel: !0
|
|
784
785
|
}) })] }),
|
|
785
|
-
/* @__PURE__ */
|
|
786
|
+
/* @__PURE__ */ N(L, { children: /* @__PURE__ */ N(R, {
|
|
786
787
|
className: "pt-6",
|
|
787
|
-
children: /* @__PURE__ */
|
|
788
|
+
children: /* @__PURE__ */ N(oe, {
|
|
788
789
|
entityType: "brainyrich-portfolio",
|
|
789
790
|
entityId: r.id
|
|
790
791
|
})
|
|
791
792
|
}) })
|
|
792
793
|
]
|
|
793
794
|
}),
|
|
794
|
-
/* @__PURE__ */
|
|
795
|
+
/* @__PURE__ */ N(Ke, {
|
|
795
796
|
open: d,
|
|
796
|
-
onOpenChange:
|
|
797
|
+
onOpenChange: p,
|
|
797
798
|
portfolioId: r.id,
|
|
798
|
-
editing:
|
|
799
|
+
editing: v
|
|
799
800
|
}),
|
|
800
|
-
/* @__PURE__ */
|
|
801
|
-
open:
|
|
801
|
+
/* @__PURE__ */ N(f, {
|
|
802
|
+
open: b !== null,
|
|
802
803
|
onOpenChange: (e) => {
|
|
803
|
-
e ||
|
|
804
|
+
e || C(null);
|
|
804
805
|
},
|
|
805
806
|
title: "Delete holding?",
|
|
806
|
-
description:
|
|
807
|
+
description: b ? `Remove ${b.symbol} from this portfolio. This cannot be undone.` : void 0,
|
|
807
808
|
confirmLabel: "Delete",
|
|
808
809
|
pendingLabel: "Deleting…",
|
|
809
810
|
destructive: !0,
|
|
810
811
|
pending: u.isPending,
|
|
811
812
|
onConfirm: () => {
|
|
812
|
-
|
|
813
|
+
b && u.mutate(b.id, { onSuccess: () => C(null) });
|
|
813
814
|
}
|
|
814
815
|
})
|
|
815
|
-
] }) : /* @__PURE__ */
|
|
816
|
+
] }) : /* @__PURE__ */ N("div", {
|
|
816
817
|
className: "p-6",
|
|
817
|
-
children: /* @__PURE__ */
|
|
818
|
-
icon: /* @__PURE__ */ j
|
|
818
|
+
children: /* @__PURE__ */ N(ee, {
|
|
819
|
+
icon: /* @__PURE__ */ N(j, {
|
|
819
820
|
className: "size-6",
|
|
820
821
|
"aria-hidden": "true"
|
|
821
822
|
}),
|
|
@@ -826,24 +827,24 @@ function Ke({ portfolioId: t, onOpenChange: n }) {
|
|
|
826
827
|
})
|
|
827
828
|
});
|
|
828
829
|
}
|
|
829
|
-
function
|
|
830
|
-
let r = Math.abs(e), i = t > 0 && r > t, a = !i && t > 0 && r >= t * .75, o = t > 0 ? Math.min(100, r / t * 100) : 0, s = i ? "bg-status-error-bg" : a ? "bg-status-warning-bg" : "bg-accent-teal", c = i ? "text-status-error-text" : a ? "text-status-warning-text" : "text-text-secondary", l = n ? `Widest drift: ${Q(n)} ${e > 0 ? "over" : "under"}-weight by ${
|
|
831
|
-
return /* @__PURE__ */
|
|
830
|
+
function Je({ driftPct: e, thresholdPct: t, assetClass: n }) {
|
|
831
|
+
let r = Math.abs(e), i = t > 0 && r > t, a = !i && t > 0 && r >= t * .75, o = t > 0 ? Math.min(100, r / t * 100) : 0, s = i ? "bg-status-error-bg" : a ? "bg-status-warning-bg" : "bg-accent-teal", c = i ? "text-status-error-text" : a ? "text-status-warning-text" : "text-text-secondary", l = n ? `Widest drift: ${Q(n)} ${e > 0 ? "over" : "under"}-weight by ${S(r)}` : `Widest drift ${S(r)}`;
|
|
832
|
+
return /* @__PURE__ */ P("div", {
|
|
832
833
|
className: "space-y-1",
|
|
833
|
-
children: [/* @__PURE__ */
|
|
834
|
+
children: [/* @__PURE__ */ P("div", {
|
|
834
835
|
className: "flex items-center justify-between gap-2 text-xs",
|
|
835
|
-
children: [/* @__PURE__ */
|
|
836
|
+
children: [/* @__PURE__ */ N("span", {
|
|
836
837
|
className: "text-text-secondary",
|
|
837
838
|
children: "Drift"
|
|
838
|
-
}), /* @__PURE__ */
|
|
839
|
+
}), /* @__PURE__ */ P("span", {
|
|
839
840
|
className: `font-medium tabular-nums ${c}`,
|
|
840
841
|
children: [
|
|
841
842
|
i ? "⚠ " : "",
|
|
842
843
|
e > 0 ? "+" : "",
|
|
843
|
-
|
|
844
|
+
S(e)
|
|
844
845
|
]
|
|
845
846
|
})]
|
|
846
|
-
}), /* @__PURE__ */
|
|
847
|
+
}), /* @__PURE__ */ N("div", {
|
|
847
848
|
className: "h-1.5 w-full overflow-hidden rounded-full bg-bg-sunken",
|
|
848
849
|
role: "progressbar",
|
|
849
850
|
"aria-valuenow": Math.round(o),
|
|
@@ -851,114 +852,114 @@ function qe({ driftPct: e, thresholdPct: t, assetClass: n }) {
|
|
|
851
852
|
"aria-valuemax": 100,
|
|
852
853
|
"aria-label": l,
|
|
853
854
|
title: l,
|
|
854
|
-
children: /* @__PURE__ */
|
|
855
|
+
children: /* @__PURE__ */ N("div", {
|
|
855
856
|
className: `h-full rounded-full ${s}`,
|
|
856
857
|
style: { width: `${o}%` }
|
|
857
858
|
})
|
|
858
859
|
})]
|
|
859
860
|
});
|
|
860
861
|
}
|
|
861
|
-
function
|
|
862
|
-
let s =
|
|
863
|
-
return /* @__PURE__ */
|
|
862
|
+
function Ye({ portfolio: e, valuation: t, valuationError: n, index: r, onView: i, onEdit: a, onArchive: o }) {
|
|
863
|
+
let s = D(() => ze(e.targetAllocation), [e.targetAllocation]), c = s[0], l = e.tags ?? [];
|
|
864
|
+
return /* @__PURE__ */ N(h, {
|
|
864
865
|
index: r,
|
|
865
866
|
as: "div",
|
|
866
867
|
className: "h-full",
|
|
867
|
-
children: /* @__PURE__ */
|
|
868
|
+
children: /* @__PURE__ */ P(L, {
|
|
868
869
|
className: "flex h-full flex-col transition-shadow motion-safe:hover:shadow-[var(--shadow-pop-hover,var(--shadow-elevation-2))]",
|
|
869
|
-
children: [/* @__PURE__ */
|
|
870
|
+
children: [/* @__PURE__ */ P(B, {
|
|
870
871
|
className: "pb-3",
|
|
871
|
-
children: [/* @__PURE__ */
|
|
872
|
+
children: [/* @__PURE__ */ P("div", {
|
|
872
873
|
className: "flex items-start justify-between gap-2",
|
|
873
|
-
children: [/* @__PURE__ */
|
|
874
|
+
children: [/* @__PURE__ */ P("div", {
|
|
874
875
|
className: "flex min-w-0 items-center gap-2",
|
|
875
876
|
children: [
|
|
876
|
-
/* @__PURE__ */
|
|
877
|
+
/* @__PURE__ */ N("span", {
|
|
877
878
|
className: "flex size-8 shrink-0 items-center justify-center rounded-lg bg-[var(--color-action-primary-bg)]/12 text-[var(--color-action-primary-text)]",
|
|
878
|
-
children: /* @__PURE__ */ j
|
|
879
|
+
children: /* @__PURE__ */ N(j, {
|
|
879
880
|
className: "size-4",
|
|
880
881
|
"aria-hidden": "true"
|
|
881
882
|
})
|
|
882
883
|
}),
|
|
883
|
-
/* @__PURE__ */
|
|
884
|
+
/* @__PURE__ */ N(V, {
|
|
884
885
|
className: "truncate text-base",
|
|
885
886
|
children: e.name
|
|
886
887
|
}),
|
|
887
|
-
/* @__PURE__ */
|
|
888
|
-
variant:
|
|
888
|
+
/* @__PURE__ */ N(F, {
|
|
889
|
+
variant: ae(e.status),
|
|
889
890
|
children: Q(e.status)
|
|
890
891
|
})
|
|
891
892
|
]
|
|
892
|
-
}), /* @__PURE__ */
|
|
893
|
+
}), /* @__PURE__ */ P(de, { children: [/* @__PURE__ */ N(he, {
|
|
893
894
|
asChild: !0,
|
|
894
|
-
children: /* @__PURE__ */
|
|
895
|
+
children: /* @__PURE__ */ N(I, {
|
|
895
896
|
variant: "ghost",
|
|
896
897
|
size: "icon",
|
|
897
898
|
className: "size-9 shrink-0",
|
|
898
899
|
"aria-label": `Actions for ${e.name}`,
|
|
899
|
-
children: /* @__PURE__ */
|
|
900
|
+
children: /* @__PURE__ */ N(M, {
|
|
900
901
|
className: "size-4",
|
|
901
902
|
"aria-hidden": "true"
|
|
902
903
|
})
|
|
903
904
|
})
|
|
904
|
-
}), /* @__PURE__ */
|
|
905
|
+
}), /* @__PURE__ */ P(fe, {
|
|
905
906
|
align: "end",
|
|
906
907
|
children: [
|
|
907
|
-
/* @__PURE__ */
|
|
908
|
-
/* @__PURE__ */
|
|
909
|
-
/* @__PURE__ */
|
|
908
|
+
/* @__PURE__ */ N(pe, { children: e.name }),
|
|
909
|
+
/* @__PURE__ */ N(me, {}),
|
|
910
|
+
/* @__PURE__ */ P(H, {
|
|
910
911
|
className: "gap-2",
|
|
911
912
|
onClick: a,
|
|
912
|
-
children: [/* @__PURE__ */
|
|
913
|
+
children: [/* @__PURE__ */ N(se, {
|
|
913
914
|
className: "size-4",
|
|
914
915
|
"aria-hidden": "true"
|
|
915
916
|
}), "Edit"]
|
|
916
917
|
}),
|
|
917
|
-
/* @__PURE__ */
|
|
918
|
+
/* @__PURE__ */ P(H, {
|
|
918
919
|
className: "gap-2 text-status-error-text focus:text-status-error-text",
|
|
919
920
|
disabled: e.status === "ARCHIVED",
|
|
920
921
|
onClick: o,
|
|
921
|
-
children: [/* @__PURE__ */
|
|
922
|
+
children: [/* @__PURE__ */ N(le, {
|
|
922
923
|
className: "size-4",
|
|
923
924
|
"aria-hidden": "true"
|
|
924
925
|
}), "Archive"]
|
|
925
926
|
})
|
|
926
927
|
]
|
|
927
928
|
})] })]
|
|
928
|
-
}), e.description?.trim() ? /* @__PURE__ */
|
|
929
|
+
}), e.description?.trim() ? /* @__PURE__ */ N(z, {
|
|
929
930
|
className: "line-clamp-2",
|
|
930
931
|
children: e.description
|
|
931
932
|
}) : null]
|
|
932
|
-
}), /* @__PURE__ */
|
|
933
|
+
}), /* @__PURE__ */ P(R, {
|
|
933
934
|
className: "flex flex-1 flex-col justify-between gap-4",
|
|
934
935
|
children: [
|
|
935
|
-
n ? /* @__PURE__ */
|
|
936
|
+
n ? /* @__PURE__ */ N("p", {
|
|
936
937
|
className: "text-sm text-text-secondary",
|
|
937
938
|
children: "Valuation unavailable — positions could not be loaded."
|
|
938
|
-
}) : t ? t.holdingCount > 0 ? /* @__PURE__ */
|
|
939
|
+
}) : t ? t.holdingCount > 0 ? /* @__PURE__ */ P("div", {
|
|
939
940
|
className: "space-y-2",
|
|
940
|
-
children: [/* @__PURE__ */
|
|
941
|
+
children: [/* @__PURE__ */ P("div", {
|
|
941
942
|
className: "flex flex-wrap items-baseline gap-x-3 gap-y-1",
|
|
942
943
|
children: [
|
|
943
|
-
/* @__PURE__ */
|
|
944
|
+
/* @__PURE__ */ N("span", {
|
|
944
945
|
className: "text-2xl font-semibold tabular-nums text-text-primary",
|
|
945
|
-
children:
|
|
946
|
+
children: ie(t.marketValue, e.baseCurrency)
|
|
946
947
|
}),
|
|
947
|
-
t.gainPct === null ? null : /* @__PURE__ */
|
|
948
|
-
className: `inline-flex items-center gap-1 text-sm font-medium tabular-nums ${
|
|
948
|
+
t.gainPct === null ? null : /* @__PURE__ */ P("span", {
|
|
949
|
+
className: `inline-flex items-center gap-1 text-sm font-medium tabular-nums ${b(t.unrealizedGain)}`,
|
|
949
950
|
children: [
|
|
950
|
-
t.unrealizedGain > 0 ? /* @__PURE__ */
|
|
951
|
+
t.unrealizedGain > 0 ? /* @__PURE__ */ N(A, {
|
|
951
952
|
className: "size-3.5",
|
|
952
953
|
"aria-hidden": "true"
|
|
953
|
-
}) : t.unrealizedGain < 0 ? /* @__PURE__ */
|
|
954
|
+
}) : t.unrealizedGain < 0 ? /* @__PURE__ */ N(k, {
|
|
954
955
|
className: "size-3.5",
|
|
955
956
|
"aria-hidden": "true"
|
|
956
957
|
}) : null,
|
|
957
958
|
t.unrealizedGain > 0 ? "+" : "",
|
|
958
|
-
|
|
959
|
+
S(t.gainPct)
|
|
959
960
|
]
|
|
960
961
|
}),
|
|
961
|
-
/* @__PURE__ */
|
|
962
|
+
/* @__PURE__ */ P("span", {
|
|
962
963
|
className: "text-xs text-text-secondary",
|
|
963
964
|
children: [
|
|
964
965
|
t.holdingCount,
|
|
@@ -967,71 +968,71 @@ function Je({ portfolio: e, valuation: t, valuationError: n, index: r, onView: i
|
|
|
967
968
|
]
|
|
968
969
|
})
|
|
969
970
|
]
|
|
970
|
-
}), t.maxDriftPct === null ? /* @__PURE__ */
|
|
971
|
+
}), t.maxDriftPct === null ? /* @__PURE__ */ N("p", {
|
|
971
972
|
className: "text-xs text-text-secondary",
|
|
972
973
|
children: "Drift needs a target allocation on this portfolio."
|
|
973
|
-
}) : /* @__PURE__ */
|
|
974
|
+
}) : /* @__PURE__ */ N(Je, {
|
|
974
975
|
driftPct: t.maxDriftPct,
|
|
975
976
|
thresholdPct: e.driftThresholdPct,
|
|
976
977
|
assetClass: t.driftAssetClass
|
|
977
978
|
})]
|
|
978
|
-
}) : /* @__PURE__ */
|
|
979
|
+
}) : /* @__PURE__ */ N("p", {
|
|
979
980
|
className: "text-sm text-text-secondary",
|
|
980
981
|
children: "No holdings yet — add positions to value this portfolio."
|
|
981
|
-
}) : /* @__PURE__ */
|
|
982
|
+
}) : /* @__PURE__ */ P("div", {
|
|
982
983
|
className: "space-y-2",
|
|
983
984
|
"aria-busy": "true",
|
|
984
|
-
children: [/* @__PURE__ */
|
|
985
|
+
children: [/* @__PURE__ */ N("div", { className: "h-7 w-32 animate-pulse rounded bg-bg-sunken" }), /* @__PURE__ */ N("div", { className: "h-1.5 w-full animate-pulse rounded-full bg-bg-sunken" })]
|
|
985
986
|
}),
|
|
986
|
-
/* @__PURE__ */
|
|
987
|
+
/* @__PURE__ */ P("div", {
|
|
987
988
|
className: "grid grid-cols-[auto_1fr] items-center gap-4",
|
|
988
|
-
children: [s.length > 0 ? /* @__PURE__ */
|
|
989
|
+
children: [s.length > 0 ? /* @__PURE__ */ N("div", {
|
|
989
990
|
className: "w-28 shrink-0",
|
|
990
|
-
children: /* @__PURE__ */
|
|
991
|
+
children: /* @__PURE__ */ N(m, {
|
|
991
992
|
data: s,
|
|
992
993
|
legend: !1,
|
|
993
994
|
height: 112,
|
|
994
|
-
centerValue: c ?
|
|
995
|
+
centerValue: c ? S(c.value, 0) : void 0,
|
|
995
996
|
centerLabel: c?.label,
|
|
996
|
-
valueFormatter: (e) =>
|
|
997
|
+
valueFormatter: (e) => S(e, 0)
|
|
997
998
|
})
|
|
998
|
-
}) : /* @__PURE__ */
|
|
999
|
+
}) : /* @__PURE__ */ P("div", {
|
|
999
1000
|
className: "flex size-28 shrink-0 items-center justify-center rounded-full border border-dashed border-border-subtle text-center text-[10px] leading-tight text-text-secondary",
|
|
1000
1001
|
children: [
|
|
1001
1002
|
"No target",
|
|
1002
|
-
/* @__PURE__ */
|
|
1003
|
+
/* @__PURE__ */ N("br", {}),
|
|
1003
1004
|
"allocation"
|
|
1004
1005
|
]
|
|
1005
|
-
}), /* @__PURE__ */
|
|
1006
|
+
}), /* @__PURE__ */ P("div", {
|
|
1006
1007
|
className: "min-w-0 space-y-2",
|
|
1007
1008
|
children: [
|
|
1008
|
-
/* @__PURE__ */
|
|
1009
|
+
/* @__PURE__ */ P("div", {
|
|
1009
1010
|
className: "flex flex-wrap items-center gap-1.5",
|
|
1010
|
-
children: [/* @__PURE__ */
|
|
1011
|
+
children: [/* @__PURE__ */ N(F, {
|
|
1011
1012
|
variant: "outline",
|
|
1012
1013
|
children: e.baseCurrency
|
|
1013
|
-
}), /* @__PURE__ */
|
|
1014
|
+
}), /* @__PURE__ */ P(F, {
|
|
1014
1015
|
variant: "secondary",
|
|
1015
|
-
children: ["Drift ≤ ",
|
|
1016
|
+
children: ["Drift ≤ ", S(e.driftThresholdPct)]
|
|
1016
1017
|
})]
|
|
1017
1018
|
}),
|
|
1018
|
-
s.length > 0 ? /* @__PURE__ */
|
|
1019
|
+
s.length > 0 ? /* @__PURE__ */ N("ul", {
|
|
1019
1020
|
className: "space-y-1",
|
|
1020
1021
|
"aria-label": "Target allocation",
|
|
1021
|
-
children: s.slice(0, 3).map((e) => /* @__PURE__ */
|
|
1022
|
+
children: s.slice(0, 3).map((e) => /* @__PURE__ */ P("li", {
|
|
1022
1023
|
className: "flex items-center gap-1.5 text-xs",
|
|
1023
|
-
children: [/* @__PURE__ */
|
|
1024
|
+
children: [/* @__PURE__ */ N("span", {
|
|
1024
1025
|
className: "truncate text-text-secondary",
|
|
1025
1026
|
children: e.label
|
|
1026
|
-
}), /* @__PURE__ */
|
|
1027
|
+
}), /* @__PURE__ */ N("span", {
|
|
1027
1028
|
className: "ml-auto font-medium tabular-nums text-text-primary",
|
|
1028
|
-
children:
|
|
1029
|
+
children: S(e.value, 0)
|
|
1029
1030
|
})]
|
|
1030
1031
|
}, e.label))
|
|
1031
1032
|
}) : null,
|
|
1032
|
-
l.length > 0 ? /* @__PURE__ */
|
|
1033
|
+
l.length > 0 ? /* @__PURE__ */ N("div", {
|
|
1033
1034
|
className: "flex flex-wrap gap-1",
|
|
1034
|
-
children: l.slice(0, 3).map((e) => /* @__PURE__ */
|
|
1035
|
+
children: l.slice(0, 3).map((e) => /* @__PURE__ */ N(F, {
|
|
1035
1036
|
variant: "outline",
|
|
1036
1037
|
className: "text-[10px]",
|
|
1037
1038
|
children: e
|
|
@@ -1040,7 +1041,7 @@ function Je({ portfolio: e, valuation: t, valuationError: n, index: r, onView: i
|
|
|
1040
1041
|
]
|
|
1041
1042
|
})]
|
|
1042
1043
|
}),
|
|
1043
|
-
/* @__PURE__ */
|
|
1044
|
+
/* @__PURE__ */ N(I, {
|
|
1044
1045
|
variant: "outline",
|
|
1045
1046
|
size: "sm",
|
|
1046
1047
|
className: "w-full",
|
|
@@ -1052,154 +1053,159 @@ function Je({ portfolio: e, valuation: t, valuationError: n, index: r, onView: i
|
|
|
1052
1053
|
})
|
|
1053
1054
|
});
|
|
1054
1055
|
}
|
|
1055
|
-
function
|
|
1056
|
+
function Xe() {
|
|
1056
1057
|
T("brainyrich.portfolios.viewed");
|
|
1057
|
-
let { items:
|
|
1058
|
+
let n = p(), { items: r, hasMore: i, loadMore: a, isLoading: o, isFetchingNextPage: c, isError: l, refetch: u } = s(), m = t(), g = e(), v = D(() => {
|
|
1058
1059
|
let e = /* @__PURE__ */ new Map();
|
|
1059
|
-
for (let t of
|
|
1060
|
+
for (let t of g.data) {
|
|
1060
1061
|
if (!t.portfolioId) continue;
|
|
1061
1062
|
let n = e.get(t.portfolioId);
|
|
1062
1063
|
n ? n.push(t) : e.set(t.portfolioId, [t]);
|
|
1063
1064
|
}
|
|
1064
1065
|
return e;
|
|
1065
|
-
}, [
|
|
1066
|
+
}, [g.data]), y = D(() => {
|
|
1066
1067
|
let e = /* @__PURE__ */ new Map();
|
|
1067
|
-
for (let t of
|
|
1068
|
+
for (let t of r) e.set(t.id, Ve(v.get(t.id) ?? [], t.targetAllocation));
|
|
1068
1069
|
return e;
|
|
1069
|
-
}, [
|
|
1070
|
+
}, [r, v]), [b, x] = O(!1), [ae, E] = O(null), [oe, k] = O(null), [A, M] = O(null), se = r.filter((e) => e.status === "ACTIVE").length, le = r.filter((e) => e.status === "DRAFT").length, F = r.length > 0 ? r.reduce((e, t) => e + t.driftThresholdPct, 0) / r.length : 0, L = D(() => {
|
|
1070
1071
|
let e = /* @__PURE__ */ new Map();
|
|
1071
|
-
for (let t of
|
|
1072
|
-
let n =
|
|
1072
|
+
for (let t of r) {
|
|
1073
|
+
let n = y.get(t.id);
|
|
1073
1074
|
!n || n.holdingCount === 0 || e.set(t.baseCurrency, (e.get(t.baseCurrency) ?? 0) + n.marketValue);
|
|
1074
1075
|
}
|
|
1075
1076
|
return e;
|
|
1076
|
-
}, [
|
|
1077
|
-
let t =
|
|
1077
|
+
}, [r, y]), R = Array.from(L.keys()).sort(), z = R.length === 1 ? R[0] : void 0, B = r.filter((e) => {
|
|
1078
|
+
let t = y.get(e.id)?.maxDriftPct;
|
|
1078
1079
|
return t == null || e.driftThresholdPct <= 0 ? !1 : Math.abs(t) > e.driftThresholdPct;
|
|
1079
|
-
}).length,
|
|
1080
|
-
|
|
1081
|
-
},
|
|
1082
|
-
|
|
1080
|
+
}).length, V = () => {
|
|
1081
|
+
E(null), x(!0);
|
|
1082
|
+
}, de = (e) => {
|
|
1083
|
+
E(e), x(!0);
|
|
1083
1084
|
};
|
|
1084
|
-
return /* @__PURE__ */
|
|
1085
|
+
return /* @__PURE__ */ N("div", {
|
|
1085
1086
|
"data-tour": "brainyrich-page-portfolios",
|
|
1086
1087
|
className: "contents",
|
|
1087
|
-
children: /* @__PURE__ */
|
|
1088
|
-
title: "Portfolios",
|
|
1089
|
-
description: "Organize holdings into strategies and keep allocations on target.",
|
|
1090
|
-
badges:
|
|
1091
|
-
actions: /* @__PURE__ */
|
|
1088
|
+
children: /* @__PURE__ */ P(re, {
|
|
1089
|
+
title: n("brainyrich.portfolios.title", "Portfolios"),
|
|
1090
|
+
description: n("brainyrich.portfolios.description", "Organize holdings into strategies and keep allocations on target."),
|
|
1091
|
+
badges: r.length > 0 ? [`${r.length} ${n("brainyrich.portfolios.totalSuffix", "total")}`] : [],
|
|
1092
|
+
actions: /* @__PURE__ */ P(I, {
|
|
1092
1093
|
size: "sm",
|
|
1093
|
-
onClick:
|
|
1094
|
-
children: [/* @__PURE__ */
|
|
1094
|
+
onClick: V,
|
|
1095
|
+
children: [/* @__PURE__ */ N(ce, {
|
|
1095
1096
|
className: "size-4",
|
|
1096
1097
|
"aria-hidden": "true"
|
|
1097
|
-
}), "New portfolio"]
|
|
1098
|
+
}), n("brainyrich.portfolios.actions.newPortfolio", "New portfolio")]
|
|
1098
1099
|
}),
|
|
1099
1100
|
children: [
|
|
1100
|
-
|
|
1101
|
-
icon: /* @__PURE__ */ j
|
|
1101
|
+
o ? /* @__PURE__ */ N(ne, { rows: 4 }) : l ? /* @__PURE__ */ N(te, { onRetry: () => u() }) : r.length === 0 ? /* @__PURE__ */ N(ee, {
|
|
1102
|
+
icon: /* @__PURE__ */ N(j, {
|
|
1102
1103
|
className: "size-6",
|
|
1103
1104
|
"aria-hidden": "true"
|
|
1104
1105
|
}),
|
|
1105
|
-
title: "No portfolios yet",
|
|
1106
|
-
description: "Create your first portfolio to start organizing holdings and tracking drift.",
|
|
1107
|
-
action: /* @__PURE__ */
|
|
1106
|
+
title: n("brainyrich.portfolios.empty.title", "No portfolios yet"),
|
|
1107
|
+
description: n("brainyrich.portfolios.empty.description", "Create your first portfolio to start organizing holdings and tracking drift."),
|
|
1108
|
+
action: /* @__PURE__ */ P(I, {
|
|
1108
1109
|
size: "sm",
|
|
1109
|
-
onClick:
|
|
1110
|
-
children: [/* @__PURE__ */
|
|
1110
|
+
onClick: V,
|
|
1111
|
+
children: [/* @__PURE__ */ N(ce, {
|
|
1111
1112
|
className: "size-4",
|
|
1112
1113
|
"aria-hidden": "true"
|
|
1113
|
-
}), "New portfolio"]
|
|
1114
|
+
}), n("brainyrich.portfolios.actions.newPortfolio", "New portfolio")]
|
|
1114
1115
|
})
|
|
1115
|
-
}) : /* @__PURE__ */
|
|
1116
|
-
/* @__PURE__ */
|
|
1116
|
+
}) : /* @__PURE__ */ P(ue, { children: [
|
|
1117
|
+
/* @__PURE__ */ P(h, {
|
|
1117
1118
|
className: "grid grid-cols-2 gap-3 lg:grid-cols-5",
|
|
1118
1119
|
children: [
|
|
1119
|
-
/* @__PURE__ */
|
|
1120
|
-
label: "Portfolios",
|
|
1121
|
-
value: String(
|
|
1120
|
+
/* @__PURE__ */ N(_, {
|
|
1121
|
+
label: n("brainyrich.portfolios.metrics.count", "Portfolios"),
|
|
1122
|
+
value: String(r.length),
|
|
1122
1123
|
glow: !0
|
|
1123
1124
|
}),
|
|
1124
|
-
/* @__PURE__ */
|
|
1125
|
-
label:
|
|
1126
|
-
value:
|
|
1125
|
+
/* @__PURE__ */ N(_, {
|
|
1126
|
+
label: z ? `${n("brainyrich.portfolios.metrics.totalValue", "Total value")} (${z})` : n("brainyrich.portfolios.metrics.totalValue", "Total value"),
|
|
1127
|
+
value: g.isPending ? "…" : g.isError ? "—" : z ? ie(L.get(z) ?? 0, z) : R.length === 0 ? "—" : `${R.length} currencies`
|
|
1127
1128
|
}),
|
|
1128
|
-
/* @__PURE__ */
|
|
1129
|
-
label: "Active",
|
|
1129
|
+
/* @__PURE__ */ N(_, {
|
|
1130
|
+
label: n("brainyrich.portfolios.metrics.active", "Active"),
|
|
1130
1131
|
value: String(se)
|
|
1131
1132
|
}),
|
|
1132
|
-
/* @__PURE__ */
|
|
1133
|
-
label: "Drafts",
|
|
1134
|
-
value: String(
|
|
1133
|
+
/* @__PURE__ */ N(_, {
|
|
1134
|
+
label: n("brainyrich.portfolios.metrics.drafts", "Drafts"),
|
|
1135
|
+
value: String(le)
|
|
1135
1136
|
}),
|
|
1136
|
-
/* @__PURE__ */
|
|
1137
|
-
label: "Past drift threshold",
|
|
1138
|
-
value:
|
|
1137
|
+
/* @__PURE__ */ N(_, {
|
|
1138
|
+
label: n("brainyrich.portfolios.metrics.pastDriftThreshold", "Past drift threshold"),
|
|
1139
|
+
value: g.isPending ? "…" : g.isError ? "—" : String(B)
|
|
1139
1140
|
})
|
|
1140
1141
|
]
|
|
1141
1142
|
}),
|
|
1142
|
-
!
|
|
1143
|
+
!g.isPending && !g.isError && R.length > 1 ? /* @__PURE__ */ P("p", {
|
|
1143
1144
|
className: "text-xs text-text-secondary",
|
|
1144
1145
|
children: [
|
|
1145
|
-
"Market value is not FX-converted
|
|
1146
|
+
n("brainyrich.portfolios.footnote.notFxConverted", "Market value is not FX-converted"),
|
|
1147
|
+
":",
|
|
1148
|
+
" ",
|
|
1149
|
+
R.map((e) => ie(L.get(e) ?? 0, e)).join(" · "),
|
|
1150
|
+
".",
|
|
1146
1151
|
" ",
|
|
1147
|
-
|
|
1148
|
-
"
|
|
1149
|
-
|
|
1152
|
+
n("brainyrich.portfolios.footnote.averageDriftThreshold", "Average drift threshold"),
|
|
1153
|
+
" ",
|
|
1154
|
+
S(F),
|
|
1150
1155
|
"."
|
|
1151
1156
|
]
|
|
1152
|
-
}) : /* @__PURE__ */
|
|
1157
|
+
}) : /* @__PURE__ */ P("p", {
|
|
1153
1158
|
className: "text-xs text-text-secondary",
|
|
1154
1159
|
children: [
|
|
1155
|
-
"Average drift threshold across these portfolios
|
|
1156
|
-
|
|
1160
|
+
n("brainyrich.portfolios.footnote.averageDriftThresholdAcross", "Average drift threshold across these portfolios"),
|
|
1161
|
+
": ",
|
|
1162
|
+
S(F),
|
|
1157
1163
|
"."
|
|
1158
1164
|
]
|
|
1159
1165
|
}),
|
|
1160
|
-
/* @__PURE__ */
|
|
1166
|
+
/* @__PURE__ */ N("div", {
|
|
1161
1167
|
className: "grid gap-4 md:grid-cols-2 xl:grid-cols-3",
|
|
1162
|
-
children:
|
|
1168
|
+
children: r.map((e, t) => /* @__PURE__ */ N(Ye, {
|
|
1163
1169
|
portfolio: e,
|
|
1164
|
-
valuation:
|
|
1165
|
-
valuationError:
|
|
1170
|
+
valuation: g.isPending ? void 0 : y.get(e.id),
|
|
1171
|
+
valuationError: g.isError,
|
|
1166
1172
|
index: t,
|
|
1167
|
-
onView: () =>
|
|
1168
|
-
onEdit: () =>
|
|
1169
|
-
onArchive: () =>
|
|
1173
|
+
onView: () => k(e.id),
|
|
1174
|
+
onEdit: () => de(e),
|
|
1175
|
+
onArchive: () => M(e)
|
|
1170
1176
|
}, e.id))
|
|
1171
1177
|
}),
|
|
1172
|
-
/* @__PURE__ */
|
|
1173
|
-
hasMore:
|
|
1174
|
-
onClick:
|
|
1175
|
-
loading:
|
|
1178
|
+
/* @__PURE__ */ N(d, {
|
|
1179
|
+
hasMore: i,
|
|
1180
|
+
onClick: a,
|
|
1181
|
+
loading: c
|
|
1176
1182
|
})
|
|
1177
1183
|
] }),
|
|
1178
|
-
/* @__PURE__ */
|
|
1179
|
-
open:
|
|
1180
|
-
onOpenChange:
|
|
1181
|
-
editing:
|
|
1184
|
+
/* @__PURE__ */ N(We, {
|
|
1185
|
+
open: b,
|
|
1186
|
+
onOpenChange: x,
|
|
1187
|
+
editing: ae
|
|
1182
1188
|
}),
|
|
1183
|
-
/* @__PURE__ */
|
|
1184
|
-
portfolioId:
|
|
1189
|
+
/* @__PURE__ */ N(qe, {
|
|
1190
|
+
portfolioId: oe,
|
|
1185
1191
|
onOpenChange: (e) => {
|
|
1186
|
-
e ||
|
|
1192
|
+
e || k(null);
|
|
1187
1193
|
}
|
|
1188
1194
|
}),
|
|
1189
|
-
/* @__PURE__ */
|
|
1190
|
-
open:
|
|
1195
|
+
/* @__PURE__ */ N(f, {
|
|
1196
|
+
open: A !== null,
|
|
1191
1197
|
onOpenChange: (e) => {
|
|
1192
|
-
e ||
|
|
1198
|
+
e || M(null);
|
|
1193
1199
|
},
|
|
1194
|
-
title: "Archive portfolio?",
|
|
1195
|
-
description:
|
|
1196
|
-
confirmLabel: "Archive",
|
|
1197
|
-
pendingLabel: "Archiving…",
|
|
1200
|
+
title: n("brainyrich.portfolios.archive.title", "Archive portfolio?"),
|
|
1201
|
+
description: A ? n("brainyrich.portfolios.archive.description", `Archive "${A.name}". It will move to archived status and stop appearing in active views.`, { name: A.name }) : void 0,
|
|
1202
|
+
confirmLabel: n("brainyrich.portfolios.archive.confirm", "Archive"),
|
|
1203
|
+
pendingLabel: n("brainyrich.portfolios.archive.pending", "Archiving…"),
|
|
1198
1204
|
destructive: !0,
|
|
1199
|
-
pending:
|
|
1205
|
+
pending: m.isPending,
|
|
1200
1206
|
onConfirm: () => {
|
|
1201
|
-
|
|
1202
|
-
C(), w("Portfolio archived"),
|
|
1207
|
+
A && m.mutate(A.id, { onSuccess: () => {
|
|
1208
|
+
C(), w(n("brainyrich.portfolios.archive.success", "Portfolio archived")), M(null);
|
|
1203
1209
|
} });
|
|
1204
1210
|
}
|
|
1205
1211
|
})
|
|
@@ -1208,6 +1214,6 @@ function Ye() {
|
|
|
1208
1214
|
});
|
|
1209
1215
|
}
|
|
1210
1216
|
//#endregion
|
|
1211
|
-
export {
|
|
1217
|
+
export { Xe as PortfoliosPage };
|
|
1212
1218
|
|
|
1213
1219
|
//# sourceMappingURL=PortfoliosPage.js.map
|