@burdenoff/microfe-brainyrich 2026.1028.3 → 2026.1101.2

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.
@@ -2,45 +2,45 @@ import { tWithFallback as e } from "../utils/i18n.js";
2
2
  import { useAccounts as t, useArchiveHousehold as n, useCreateHousehold as r, useGoals as i, useHousehold as a, usePagedHouseholds as o, usePortfolios as s, useUpdateHousehold as c } from "../hooks/useBrainyRichApi.js";
3
3
  import { LoadMore as ee } from "../components/LoadMore.js";
4
4
  import { ConfirmDialog as te } from "../components/ConfirmDialog.js";
5
- import { ActorName as l } from "../components/ActorName.js";
6
- import { DonutChart as u, FadeIn as d, GlassCard as f, StatTile as p } from "../components/viz.js";
5
+ import { ActorName as ne } from "../components/ActorName.js";
6
+ import { DonutChart as re, FadeIn as l, GlassCard as u, StatTile as d } from "../components/viz.js";
7
7
  import "../components/index.js";
8
- import { EmptyState as m, ErrorState as ne, LoadingState as re, SectionShell as ie, formatCompact as h, formatDate as g, formatMoney as _, statusBadgeVariant as v } from "./_shared.js";
8
+ import { EmptyState as f, ErrorState as p, LoadingState as ie, SectionShell as m, formatCompact as h, formatDate as g, formatMoney as _, formatPct as ae, statusBadgeVariant as v } from "./_shared.js";
9
9
  import { hapticSuccess as y, showToast as b } from "../utils/nativeControls.js";
10
- import { useTrackBrainyRichPageView as x } from "../hooks/useBrainyRichAnalytics.js";
11
- import { DocumentsPanel as ae } from "../components/reuse/DocumentsPanel.js";
10
+ import { useTrackBrainyRichPageView as oe } from "../hooks/useBrainyRichAnalytics.js";
11
+ import { DocumentsPanel as x } from "../components/reuse/DocumentsPanel.js";
12
12
  import { TagField as S } from "../components/reuse/TagField.js";
13
- import { CommentThread as C } from "../components/reuse/CommentThread.js";
14
- import { useMemo as oe, useState as w } from "react";
15
- import { Archive as T, Briefcase as E, Building2 as se, Eye as ce, Mail as le, MoreHorizontal as ue, Pencil as de, Target as D, TrendingUp as O, UserCircle2 as fe, Users as k, Wallet as A } from "lucide-react";
16
- import { useI18n as pe } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
13
+ import { HOUSEHOLD_ENTITY_TYPE as se, HouseholdDetailRail as ce } from "../components/HouseholdDetailRail.js";
14
+ import { useMemo as le, useState as C } from "react";
15
+ import { Archive as w, Briefcase as T, Building2 as E, Eye as D, Mail as ue, MoreHorizontal as de, Pencil as fe, Target as O, TrendingUp as k, UserCircle2 as pe, Users as me, Wallet as A } from "lucide-react";
16
+ import { useI18n as he } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
17
17
  import { jsx as j, jsxs as M } from "react/jsx-runtime";
18
- import { Badge as N, Button as P, Card as F, CardContent as I, DropdownMenu as me, DropdownMenuContent as he, DropdownMenuItem as L, DropdownMenuSeparator as ge, DropdownMenuTrigger as _e, Input as R, Label as z, ResponsiveDialog as ve, ResponsiveDialogClose as B, ResponsiveDialogContent as V, ResponsiveDialogDescription as H, ResponsiveDialogFooter as ye, ResponsiveDialogHeader as U, ResponsiveDialogTitle as W, Select as G, SelectContent as K, SelectItem as q, SelectTrigger as J, SelectValue as Y, Separator as be, Sheet as xe, SheetContent as Se, SheetDescription as Ce, SheetHeader as we, SheetTitle as Te, Table as Ee, TableBody as De, TableCell as X, TableHead as Z, TableHeader as Oe, TableRow as ke, Tabs as Ae, TabsContent as Q, TabsList as je, TabsTrigger as $, Textarea as Me } from "@burdenoff/fe-libs/ui";
18
+ import { Badge as N, Button as P, Card as F, CardContent as I, DropdownMenu as ge, DropdownMenuContent as _e, DropdownMenuItem as L, DropdownMenuSeparator as ve, DropdownMenuTrigger as ye, Input as R, Label as z, ResponsiveDialog as B, ResponsiveDialogClose as V, ResponsiveDialogContent as be, ResponsiveDialogDescription as H, ResponsiveDialogFooter as U, ResponsiveDialogHeader as W, ResponsiveDialogTitle as G, Select as K, SelectContent as q, SelectItem as J, SelectTrigger as xe, SelectValue as Se, Separator as Ce, Sheet as we, SheetContent as Te, SheetDescription as Ee, SheetHeader as De, SheetTitle as Oe, Table as ke, TableBody as Ae, TableCell as Y, TableHead as X, TableHeader as je, TableRow as Me, Tabs as Ne, TabsContent as Z, TabsList as Pe, TabsTrigger as Q, Textarea as Fe } from "@burdenoff/fe-libs/ui";
19
19
  //#region src/brainyrich/pages/FamilyPage.tsx
20
- var Ne = [
20
+ var Ie = [
21
21
  "PROSPECT",
22
22
  "ONBOARDING",
23
23
  "ACTIVE",
24
24
  "INACTIVE"
25
- ], Pe = [
25
+ ], Le = [
26
26
  "CONSERVATIVE",
27
27
  "MODERATE",
28
28
  "BALANCED",
29
29
  "GROWTH",
30
30
  "AGGRESSIVE"
31
- ], Fe = [
31
+ ], Re = [
32
32
  "USD",
33
33
  "EUR",
34
34
  "GBP",
35
35
  "INR",
36
36
  "AED",
37
37
  "SGD"
38
- ], Ie = {
38
+ ], ze = {
39
39
  ACTIVE: "brand",
40
40
  ONBOARDING: "info",
41
41
  PROSPECT: "warning",
42
42
  INACTIVE: "neutral"
43
- }, Le = {
43
+ }, Be = {
44
44
  name: "",
45
45
  status: "PROSPECT",
46
46
  riskProfile: "BALANCED",
@@ -51,23 +51,23 @@ var Ne = [
51
51
  notes: "",
52
52
  tags: ""
53
53
  };
54
- function Re(e) {
54
+ function Ve(e) {
55
55
  return e.split(",").map((e) => e.trim()).filter(Boolean);
56
56
  }
57
- function ze(e) {
57
+ function He(e) {
58
58
  let t = (e.holdings ?? []).reduce((e, t) => e + (Number.isFinite(t.marketValue) ? t.marketValue : 0), 0);
59
59
  return (Number.isFinite(e.cashBalance) ? e.cashBalance : 0) + t;
60
60
  }
61
- function Be() {
62
- let { t } = pe(), i = (n, r, i) => e(t, n, r, i);
63
- x("brainyrich.family.viewed");
64
- let { items: a, hasMore: s, loadMore: u, isLoading: f, isFetchingNextPage: h, isError: g, refetch: ae } = o(), S = r(), C = c(), E = n(), [se, D] = w(!1), [O, A] = w(null), [R, z] = w(Le), [ve, B] = w(void 0), [V, H] = w(null), ye = (e, t) => z((n) => ({
61
+ function Ue() {
62
+ let { t } = he(), i = (n, r, i) => e(t, n, r, i);
63
+ oe("brainyrich.family.viewed");
64
+ let { items: a, hasMore: s, loadMore: re, isLoading: u, isFetchingNextPage: h, isError: g, refetch: ae } = o(), x = r(), S = c(), se = n(), [ce, T] = C(!1), [E, O] = C(null), [k, A] = C(Be), [R, z] = C(void 0), [B, V] = C(null), be = (e, t) => A((n) => ({
65
65
  ...n,
66
66
  [e]: t
67
- })), U = () => {
68
- A(null), z(Le), D(!0);
69
- }, W = (e) => {
70
- A(e), z({
67
+ })), H = () => {
68
+ O(null), A(Be), T(!0);
69
+ }, U = (e) => {
70
+ O(e), A({
71
71
  name: e.name,
72
72
  status: e.status,
73
73
  riskProfile: e.riskProfile,
@@ -77,8 +77,8 @@ function Be() {
77
77
  primaryContactEmail: e.primaryContactEmail ?? "",
78
78
  notes: e.notes ?? "",
79
79
  tags: e.tags.join(", ")
80
- }), D(!0);
81
- }, G = oe(() => {
80
+ }), T(!0);
81
+ }, W = le(() => {
82
82
  let e = a[0]?.currency ?? "USD", t = a.length, n = a.filter((e) => e.status === "ACTIVE").length, r = a.filter((e) => e.status === "PROSPECT").length, i = a.filter((e) => e.status === "ONBOARDING").length, o = a.reduce((e, t) => e + (Number.isFinite(t.aum) ? t.aum : 0), 0), s = /* @__PURE__ */ new Map();
83
83
  for (let e of a) {
84
84
  let t = e.advisorId?.trim() || "";
@@ -98,86 +98,86 @@ function Be() {
98
98
  advisors: c,
99
99
  advisorCount: c.filter((e) => e.advisorId).length,
100
100
  advisorMax: c.reduce((e, t) => Math.max(e, t.value), 0),
101
- statusMix: Ne.map((e) => ({
101
+ statusMix: Ie.map((e) => ({
102
102
  label: e.charAt(0) + e.slice(1).toLowerCase(),
103
103
  value: a.filter((t) => t.status === e).length,
104
- tone: Ie[e]
104
+ tone: ze[e]
105
105
  })).filter((e) => e.value > 0)
106
106
  };
107
- }, [a]), K = S.isPending || C.isPending, q = R.name.trim().length > 0 && !K, J = () => {
108
- if (q) if (O) {
107
+ }, [a]), G = x.isPending || S.isPending, K = k.name.trim().length > 0 && !G, q = () => {
108
+ if (K) if (E) {
109
109
  let e = {
110
- name: R.name.trim(),
111
- status: R.status,
112
- riskProfile: R.riskProfile,
113
- currency: R.currency,
114
- primaryContactName: R.primaryContactName.trim() || null,
115
- primaryContactEmail: R.primaryContactEmail.trim() || null,
116
- notes: R.notes.trim() || null,
117
- tags: Re(R.tags)
110
+ name: k.name.trim(),
111
+ status: k.status,
112
+ riskProfile: k.riskProfile,
113
+ currency: k.currency,
114
+ primaryContactName: k.primaryContactName.trim() || null,
115
+ primaryContactEmail: k.primaryContactEmail.trim() || null,
116
+ notes: k.notes.trim() || null,
117
+ tags: Ve(k.tags)
118
118
  };
119
- C.mutate({
120
- id: O.id,
119
+ S.mutate({
120
+ id: E.id,
121
121
  input: e
122
122
  }, { onSuccess: () => {
123
- y(), b(i("brainyrich.households.saved", "Household saved")), D(!1);
123
+ y(), b(i("brainyrich.households.saved", "Household saved")), T(!1);
124
124
  } });
125
125
  } else {
126
126
  let e = {
127
- name: R.name.trim(),
128
- status: R.status,
129
- riskProfile: R.riskProfile,
130
- currency: R.currency,
131
- primaryContactName: R.primaryContactName.trim() || null,
132
- primaryContactEmail: R.primaryContactEmail.trim() || null,
133
- notes: R.notes.trim() || null,
134
- tags: Re(R.tags)
127
+ name: k.name.trim(),
128
+ status: k.status,
129
+ riskProfile: k.riskProfile,
130
+ currency: k.currency,
131
+ primaryContactName: k.primaryContactName.trim() || null,
132
+ primaryContactEmail: k.primaryContactEmail.trim() || null,
133
+ notes: k.notes.trim() || null,
134
+ tags: Ve(k.tags)
135
135
  };
136
- R.advisorId.trim() && (e.advisorId = R.advisorId.trim()), S.mutate(e, { onSuccess: () => {
137
- y(), b(i("brainyrich.households.created", "Household created")), D(!1);
136
+ k.advisorId.trim() && (e.advisorId = k.advisorId.trim()), x.mutate(e, { onSuccess: () => {
137
+ y(), b(i("brainyrich.households.created", "Household created")), T(!1);
138
138
  } });
139
139
  }
140
- }, Y = !f && !g && a.length > 0;
140
+ }, J = !u && !g && a.length > 0;
141
141
  return /* @__PURE__ */ j("div", {
142
142
  "data-tour": "brainyrich-page-households",
143
143
  className: "contents",
144
- children: /* @__PURE__ */ M(ie, {
144
+ children: /* @__PURE__ */ M(m, {
145
145
  title: i("brainyrich.households.title", "Households"),
146
146
  description: i("brainyrich.households.description", "Client households and family units under advisement"),
147
147
  badges: a.length ? [i("brainyrich.households.count", "{count} households", { count: a.length })] : [],
148
148
  actionLabel: i("brainyrich.households.new", "New household"),
149
- onAction: U,
149
+ onAction: H,
150
150
  children: [
151
- Y ? /* @__PURE__ */ j(Ve, {
152
- firm: G,
151
+ J ? /* @__PURE__ */ j(We, {
152
+ firm: W,
153
153
  tr: i
154
154
  }) : /* @__PURE__ */ M("div", {
155
155
  className: "grid gap-4 md:grid-cols-2 xl:grid-cols-4",
156
156
  children: [
157
- /* @__PURE__ */ j(p, {
157
+ /* @__PURE__ */ j(d, {
158
158
  label: i("brainyrich.households.kpi.aum", "Total AUM"),
159
159
  value: "—",
160
160
  glow: !0
161
161
  }),
162
- /* @__PURE__ */ j(p, {
162
+ /* @__PURE__ */ j(d, {
163
163
  label: i("brainyrich.households.kpi.total", "Households"),
164
164
  value: "—"
165
165
  }),
166
- /* @__PURE__ */ j(p, {
166
+ /* @__PURE__ */ j(d, {
167
167
  label: i("brainyrich.households.kpi.active", "Active"),
168
168
  value: "—"
169
169
  }),
170
- /* @__PURE__ */ j(p, {
170
+ /* @__PURE__ */ j(d, {
171
171
  label: i("brainyrich.households.kpi.prospects", "Prospects"),
172
172
  value: "—"
173
173
  })
174
174
  ]
175
175
  }),
176
- f ? /* @__PURE__ */ j(re, { rows: 5 }) : g ? /* @__PURE__ */ j(ne, {
176
+ u ? /* @__PURE__ */ j(ie, { rows: 5 }) : g ? /* @__PURE__ */ j(p, {
177
177
  title: i("brainyrich.households.error.title", "Could not load households"),
178
178
  onRetry: () => ae()
179
- }) : a.length === 0 ? /* @__PURE__ */ j(m, {
180
- icon: /* @__PURE__ */ j(k, {
179
+ }) : a.length === 0 ? /* @__PURE__ */ j(f, {
180
+ icon: /* @__PURE__ */ j(me, {
181
181
  className: "size-6",
182
182
  "aria-hidden": "true"
183
183
  }),
@@ -185,10 +185,10 @@ function Be() {
185
185
  description: i("brainyrich.households.empty.description", "Create your first client household to start organizing accounts, portfolios and goals."),
186
186
  action: /* @__PURE__ */ j(P, {
187
187
  size: "sm",
188
- onClick: U,
188
+ onClick: H,
189
189
  children: i("brainyrich.households.new", "New household")
190
190
  })
191
- }) : /* @__PURE__ */ j(d, {
191
+ }) : /* @__PURE__ */ j(l, {
192
192
  as: "section",
193
193
  children: /* @__PURE__ */ j(F, {
194
194
  className: "overflow-hidden",
@@ -196,28 +196,28 @@ function Be() {
196
196
  className: "p-0",
197
197
  children: /* @__PURE__ */ j("div", {
198
198
  className: "overflow-x-auto",
199
- children: /* @__PURE__ */ M(Ee, { children: [/* @__PURE__ */ j(Oe, { children: /* @__PURE__ */ M(ke, {
199
+ children: /* @__PURE__ */ M(ke, { children: [/* @__PURE__ */ j(je, { children: /* @__PURE__ */ M(Me, {
200
200
  className: "hover:bg-transparent",
201
201
  children: [
202
- /* @__PURE__ */ j(Z, { children: i("brainyrich.households.col.name", "Household") }),
203
- /* @__PURE__ */ j(Z, { children: i("brainyrich.households.col.status", "Status") }),
204
- /* @__PURE__ */ j(Z, {
202
+ /* @__PURE__ */ j(X, { children: i("brainyrich.households.col.name", "Household") }),
203
+ /* @__PURE__ */ j(X, { children: i("brainyrich.households.col.status", "Status") }),
204
+ /* @__PURE__ */ j(X, {
205
205
  className: "hidden md:table-cell",
206
206
  children: i("brainyrich.households.col.risk", "Risk profile")
207
207
  }),
208
- /* @__PURE__ */ j(Z, {
208
+ /* @__PURE__ */ j(X, {
209
209
  className: "hidden lg:table-cell",
210
210
  children: i("brainyrich.households.col.contact", "Primary contact")
211
211
  }),
212
- /* @__PURE__ */ j(Z, {
212
+ /* @__PURE__ */ j(X, {
213
213
  className: "hidden sm:table-cell",
214
214
  children: i("brainyrich.households.col.advisor", "Advisor")
215
215
  }),
216
- /* @__PURE__ */ j(Z, {
216
+ /* @__PURE__ */ j(X, {
217
217
  className: "text-right",
218
218
  children: i("brainyrich.households.col.aum", "AUM")
219
219
  }),
220
- /* @__PURE__ */ j(Z, {
220
+ /* @__PURE__ */ j(X, {
221
221
  className: "w-12 text-right",
222
222
  children: /* @__PURE__ */ j("span", {
223
223
  className: "sr-only",
@@ -225,13 +225,13 @@ function Be() {
225
225
  })
226
226
  })
227
227
  ]
228
- }) }), /* @__PURE__ */ j(De, { children: a.map((e) => {
229
- let t = G.aum > 0 ? Math.min(100, e.aum / G.aum * 100) : 0;
230
- return /* @__PURE__ */ M(ke, {
228
+ }) }), /* @__PURE__ */ j(Ae, { children: a.map((e) => {
229
+ let t = W.aum > 0 ? Math.min(100, e.aum / W.aum * 100) : 0;
230
+ return /* @__PURE__ */ M(Me, {
231
231
  className: "group cursor-pointer transition-colors",
232
- onClick: () => B(e.id),
232
+ onClick: () => z(e.id),
233
233
  children: [
234
- /* @__PURE__ */ M(X, { children: [/* @__PURE__ */ j("span", {
234
+ /* @__PURE__ */ M(Y, { children: [/* @__PURE__ */ j("span", {
235
235
  className: "font-medium text-text-primary transition-colors group-hover:text-[var(--color-action-primary-text)]",
236
236
  children: e.name
237
237
  }), e.tags.length > 0 ? /* @__PURE__ */ M("div", {
@@ -246,18 +246,18 @@ function Be() {
246
246
  children: ["+", e.tags.length - 3]
247
247
  }) : null]
248
248
  }) : null] }),
249
- /* @__PURE__ */ j(X, { children: /* @__PURE__ */ j(N, {
249
+ /* @__PURE__ */ j(Y, { children: /* @__PURE__ */ j(N, {
250
250
  variant: v(e.status),
251
251
  children: e.status
252
252
  }) }),
253
- /* @__PURE__ */ j(X, {
253
+ /* @__PURE__ */ j(Y, {
254
254
  className: "hidden md:table-cell",
255
255
  children: /* @__PURE__ */ j(N, {
256
256
  variant: "secondary",
257
257
  children: e.riskProfile
258
258
  })
259
259
  }),
260
- /* @__PURE__ */ j(X, {
260
+ /* @__PURE__ */ j(Y, {
261
261
  className: "hidden lg:table-cell",
262
262
  children: e.primaryContactName ? /* @__PURE__ */ M("div", {
263
263
  className: "space-y-0.5",
@@ -266,7 +266,7 @@ function Be() {
266
266
  children: e.primaryContactName
267
267
  }), e.primaryContactEmail ? /* @__PURE__ */ M("p", {
268
268
  className: "flex items-center gap-1 text-xs text-text-secondary",
269
- children: [/* @__PURE__ */ j(le, {
269
+ children: [/* @__PURE__ */ j(ue, {
270
270
  className: "size-3",
271
271
  "aria-hidden": "true"
272
272
  }), e.primaryContactEmail]
@@ -276,20 +276,20 @@ function Be() {
276
276
  children: "—"
277
277
  })
278
278
  }),
279
- /* @__PURE__ */ j(X, {
279
+ /* @__PURE__ */ j(Y, {
280
280
  className: "hidden sm:table-cell",
281
281
  children: e.advisorId ? /* @__PURE__ */ M("span", {
282
282
  className: "flex items-center gap-1.5 text-sm text-text-secondary",
283
- children: [/* @__PURE__ */ j(fe, {
283
+ children: [/* @__PURE__ */ j(pe, {
284
284
  className: "size-3.5",
285
285
  "aria-hidden": "true"
286
- }), /* @__PURE__ */ j(l, { id: e.advisorId })]
286
+ }), /* @__PURE__ */ j(ne, { id: e.advisorId })]
287
287
  }) : /* @__PURE__ */ j("span", {
288
288
  className: "text-sm text-text-muted",
289
289
  children: i("brainyrich.common.unassigned", "Unassigned")
290
290
  })
291
291
  }),
292
- /* @__PURE__ */ j(X, {
292
+ /* @__PURE__ */ j(Y, {
293
293
  className: "text-right",
294
294
  children: /* @__PURE__ */ M("div", {
295
295
  className: "flex flex-col items-end gap-1",
@@ -306,42 +306,42 @@ function Be() {
306
306
  })]
307
307
  })
308
308
  }),
309
- /* @__PURE__ */ j(X, {
309
+ /* @__PURE__ */ j(Y, {
310
310
  className: "text-right",
311
311
  onClick: (e) => e.stopPropagation(),
312
- children: /* @__PURE__ */ M(me, { children: [/* @__PURE__ */ j(_e, {
312
+ children: /* @__PURE__ */ M(ge, { children: [/* @__PURE__ */ j(ye, {
313
313
  asChild: !0,
314
314
  children: /* @__PURE__ */ j(P, {
315
315
  variant: "ghost",
316
316
  size: "icon",
317
317
  "aria-label": i("brainyrich.households.rowMenu", "Household actions"),
318
- children: /* @__PURE__ */ j(ue, {
318
+ children: /* @__PURE__ */ j(de, {
319
319
  className: "size-4",
320
320
  "aria-hidden": "true"
321
321
  })
322
322
  })
323
- }), /* @__PURE__ */ M(he, {
323
+ }), /* @__PURE__ */ M(_e, {
324
324
  align: "end",
325
325
  children: [
326
326
  /* @__PURE__ */ M(L, {
327
- onClick: () => B(e.id),
328
- children: [/* @__PURE__ */ j(ce, {
327
+ onClick: () => z(e.id),
328
+ children: [/* @__PURE__ */ j(D, {
329
329
  className: "size-4",
330
330
  "aria-hidden": "true"
331
331
  }), i("brainyrich.households.action.view", "View details")]
332
332
  }),
333
333
  /* @__PURE__ */ M(L, {
334
- onClick: () => W(e),
335
- children: [/* @__PURE__ */ j(de, {
334
+ onClick: () => U(e),
335
+ children: [/* @__PURE__ */ j(fe, {
336
336
  className: "size-4",
337
337
  "aria-hidden": "true"
338
338
  }), i("brainyrich.households.action.edit", "Edit")]
339
339
  }),
340
- /* @__PURE__ */ j(ge, {}),
340
+ /* @__PURE__ */ j(ve, {}),
341
341
  /* @__PURE__ */ M(L, {
342
342
  className: "text-status-error-text focus:text-status-error-text",
343
- onClick: () => H(e),
344
- children: [/* @__PURE__ */ j(T, {
343
+ onClick: () => V(e),
344
+ children: [/* @__PURE__ */ j(w, {
345
345
  className: "size-4",
346
346
  "aria-hidden": "true"
347
347
  }), i("brainyrich.households.action.archive", "Archive")]
@@ -356,43 +356,43 @@ function Be() {
356
356
  })
357
357
  })
358
358
  }),
359
- !f && !g && a.length > 0 ? /* @__PURE__ */ j(ee, {
359
+ !u && !g && a.length > 0 ? /* @__PURE__ */ j(ee, {
360
360
  hasMore: s,
361
- onClick: u,
361
+ onClick: re,
362
362
  loading: h,
363
363
  label: i("brainyrich.households.loadMore", "Load more households")
364
364
  }) : null,
365
- /* @__PURE__ */ j(He, {
366
- open: se,
367
- onOpenChange: D,
368
- editing: O,
369
- form: R,
370
- setField: ye,
371
- onSubmit: J,
372
- canSubmit: q,
373
- submitting: K,
365
+ /* @__PURE__ */ j(Ge, {
366
+ open: ce,
367
+ onOpenChange: T,
368
+ editing: E,
369
+ form: k,
370
+ setField: be,
371
+ onSubmit: q,
372
+ canSubmit: K,
373
+ submitting: G,
374
374
  tr: i
375
375
  }),
376
- /* @__PURE__ */ j(Ue, {
377
- householdId: ve,
378
- onClose: () => B(void 0),
376
+ /* @__PURE__ */ j(Ke, {
377
+ householdId: R,
378
+ onClose: () => z(void 0),
379
379
  onEdit: (e) => {
380
- B(void 0), W(e);
380
+ z(void 0), U(e);
381
381
  },
382
382
  tr: i
383
383
  }),
384
384
  /* @__PURE__ */ j(te, {
385
- open: !!V,
386
- onOpenChange: (e) => e ? void 0 : H(null),
385
+ open: !!B,
386
+ onOpenChange: (e) => e ? void 0 : V(null),
387
387
  title: i("brainyrich.households.archive.title", "Archive household?"),
388
- description: i("brainyrich.households.archive.description", "Archiving “{name}” removes it from the active list. You can still access its records, but it will no longer appear here.", { name: V?.name ?? "" }),
388
+ description: i("brainyrich.households.archive.description", "Archiving “{name}” removes it from the active list. You can still access its records, but it will no longer appear here.", { name: B?.name ?? "" }),
389
389
  confirmLabel: i("brainyrich.households.action.archive", "Archive"),
390
390
  pendingLabel: i("brainyrich.households.archive.pending", "Archiving…"),
391
391
  destructive: !0,
392
- pending: E.isPending,
392
+ pending: se.isPending,
393
393
  onConfirm: () => {
394
- V && E.mutate(V.id, { onSuccess: () => {
395
- y(), b(i("brainyrich.households.archived", "Household archived", { name: V.name })), H(null);
394
+ B && se.mutate(B.id, { onSuccess: () => {
395
+ y(), b(i("brainyrich.households.archived", "Household archived", { name: B.name })), V(null);
396
396
  } });
397
397
  }
398
398
  })
@@ -400,14 +400,14 @@ function Be() {
400
400
  })
401
401
  });
402
402
  }
403
- function Ve({ firm: e, tr: t }) {
404
- return /* @__PURE__ */ M(d, {
403
+ function We({ firm: e, tr: t }) {
404
+ return /* @__PURE__ */ M(l, {
405
405
  as: "section",
406
406
  className: "space-y-4",
407
407
  children: [/* @__PURE__ */ M("div", {
408
408
  className: "grid gap-4 md:grid-cols-2 xl:grid-cols-4",
409
409
  children: [
410
- /* @__PURE__ */ j(p, {
410
+ /* @__PURE__ */ j(d, {
411
411
  label: t("brainyrich.households.kpi.aum", "Total AUM"),
412
412
  value: _(e.aum, e.currency),
413
413
  glow: !0,
@@ -416,26 +416,26 @@ function Ve({ firm: e, tr: t }) {
416
416
  "aria-hidden": "true"
417
417
  })
418
418
  }),
419
- /* @__PURE__ */ j(p, {
419
+ /* @__PURE__ */ j(d, {
420
420
  label: t("brainyrich.households.kpi.total", "Households"),
421
421
  value: String(e.total),
422
- icon: /* @__PURE__ */ j(k, {
422
+ icon: /* @__PURE__ */ j(me, {
423
423
  className: "size-4",
424
424
  "aria-hidden": "true"
425
425
  })
426
426
  }),
427
- /* @__PURE__ */ j(p, {
427
+ /* @__PURE__ */ j(d, {
428
428
  label: t("brainyrich.households.kpi.active", "Active"),
429
429
  value: String(e.active),
430
- icon: /* @__PURE__ */ j(O, {
430
+ icon: /* @__PURE__ */ j(k, {
431
431
  className: "size-4",
432
432
  "aria-hidden": "true"
433
433
  })
434
434
  }),
435
- /* @__PURE__ */ j(p, {
435
+ /* @__PURE__ */ j(d, {
436
436
  label: t("brainyrich.households.kpi.prospects", "Prospects"),
437
437
  value: String(e.prospects),
438
- icon: /* @__PURE__ */ j(D, {
438
+ icon: /* @__PURE__ */ j(O, {
439
439
  className: "size-4",
440
440
  "aria-hidden": "true"
441
441
  })
@@ -443,7 +443,7 @@ function Ve({ firm: e, tr: t }) {
443
443
  ]
444
444
  }), /* @__PURE__ */ M("div", {
445
445
  className: "grid gap-4 lg:grid-cols-3",
446
- children: [/* @__PURE__ */ M(f, {
446
+ children: [/* @__PURE__ */ M(u, {
447
447
  className: "lg:col-span-2",
448
448
  children: [/* @__PURE__ */ M("div", {
449
449
  className: "mb-4 flex items-center justify-between gap-2",
@@ -453,7 +453,7 @@ function Ve({ firm: e, tr: t }) {
453
453
  }), /* @__PURE__ */ j("p", {
454
454
  className: "text-xs text-text-secondary",
455
455
  children: t("brainyrich.households.firm.advisorCount", "{count} advisors", { count: e.advisorCount })
456
- })] }), /* @__PURE__ */ j(se, {
456
+ })] }), /* @__PURE__ */ j(E, {
457
457
  className: "size-4 text-text-secondary",
458
458
  "aria-hidden": "true"
459
459
  })]
@@ -468,10 +468,10 @@ function Ve({ firm: e, tr: t }) {
468
468
  className: "flex items-center justify-between gap-3 text-xs",
469
469
  children: [/* @__PURE__ */ M("span", {
470
470
  className: "flex items-center gap-1.5 truncate font-medium text-text-primary",
471
- children: [/* @__PURE__ */ j(fe, {
471
+ children: [/* @__PURE__ */ j(pe, {
472
472
  className: "size-3.5 shrink-0 text-text-secondary",
473
473
  "aria-hidden": "true"
474
- }), n.advisorId ? /* @__PURE__ */ j(l, { id: n.advisorId }) : t("brainyrich.common.unassigned", "Unassigned")]
474
+ }), n.advisorId ? /* @__PURE__ */ j(ne, { id: n.advisorId }) : t("brainyrich.common.unassigned", "Unassigned")]
475
475
  }), /* @__PURE__ */ j("span", {
476
476
  className: "shrink-0 tabular-nums text-text-secondary",
477
477
  children: h(n.value, e.currency)
@@ -491,13 +491,13 @@ function Ve({ firm: e, tr: t }) {
491
491
  }, n.advisorId || "unassigned");
492
492
  })
493
493
  })]
494
- }), /* @__PURE__ */ M(f, { children: [/* @__PURE__ */ j("div", {
494
+ }), /* @__PURE__ */ M(u, { children: [/* @__PURE__ */ j("div", {
495
495
  className: "mb-2 flex items-center justify-between gap-2",
496
496
  children: /* @__PURE__ */ j("h2", {
497
497
  className: "text-sm font-semibold text-text-primary",
498
498
  children: t("brainyrich.households.firm.bookMix", "Book by status")
499
499
  })
500
- }), e.statusMix.length > 0 ? /* @__PURE__ */ j(u, {
500
+ }), e.statusMix.length > 0 ? /* @__PURE__ */ j(re, {
501
501
  data: e.statusMix,
502
502
  centerValue: String(e.total),
503
503
  centerLabel: t("brainyrich.households.kpi.total", "Households"),
@@ -511,13 +511,13 @@ function Ve({ firm: e, tr: t }) {
511
511
  })]
512
512
  });
513
513
  }
514
- function He({ open: e, onOpenChange: t, editing: n, form: r, setField: i, onSubmit: a, canSubmit: o, submitting: s, tr: c }) {
515
- return /* @__PURE__ */ j(ve, {
514
+ function Ge({ open: e, onOpenChange: t, editing: n, form: r, setField: i, onSubmit: a, canSubmit: o, submitting: s, tr: c }) {
515
+ return /* @__PURE__ */ j(B, {
516
516
  open: e,
517
517
  onOpenChange: t,
518
- children: /* @__PURE__ */ M(V, {
518
+ children: /* @__PURE__ */ M(be, {
519
519
  className: "max-h-[90vh] overflow-y-auto sm:max-w-lg",
520
- children: [/* @__PURE__ */ M(U, { children: [/* @__PURE__ */ j(W, { children: n ? c("brainyrich.households.form.editTitle", "Edit household") : c("brainyrich.households.form.createTitle", "New household") }), /* @__PURE__ */ j(H, { children: c("brainyrich.households.form.subtitle", "A household groups a client family’s accounts, portfolios and goals.") })] }), /* @__PURE__ */ M("form", {
520
+ children: [/* @__PURE__ */ M(W, { children: [/* @__PURE__ */ j(G, { children: n ? c("brainyrich.households.form.editTitle", "Edit household") : c("brainyrich.households.form.createTitle", "New household") }), /* @__PURE__ */ j(H, { children: c("brainyrich.households.form.subtitle", "A household groups a client family’s accounts, portfolios and goals.") })] }), /* @__PURE__ */ M("form", {
521
521
  className: "space-y-4",
522
522
  onSubmit: (e) => {
523
523
  e.preventDefault(), a();
@@ -540,20 +540,20 @@ function He({ open: e, onOpenChange: t, editing: n, form: r, setField: i, onSubm
540
540
  className: "grid gap-4 sm:grid-cols-2",
541
541
  children: [/* @__PURE__ */ M("div", {
542
542
  className: "space-y-2",
543
- children: [/* @__PURE__ */ j(z, { children: c("brainyrich.households.form.status", "Status") }), /* @__PURE__ */ M(G, {
543
+ children: [/* @__PURE__ */ j(z, { children: c("brainyrich.households.form.status", "Status") }), /* @__PURE__ */ M(K, {
544
544
  value: r.status,
545
545
  onValueChange: (e) => i("status", e),
546
- children: [/* @__PURE__ */ j(J, { children: /* @__PURE__ */ j(Y, {}) }), /* @__PURE__ */ j(K, { children: Ne.map((e) => /* @__PURE__ */ j(q, {
546
+ children: [/* @__PURE__ */ j(xe, { children: /* @__PURE__ */ j(Se, {}) }), /* @__PURE__ */ j(q, { children: Ie.map((e) => /* @__PURE__ */ j(J, {
547
547
  value: e,
548
548
  children: e
549
549
  }, e)) })]
550
550
  })]
551
551
  }), /* @__PURE__ */ M("div", {
552
552
  className: "space-y-2",
553
- children: [/* @__PURE__ */ j(z, { children: c("brainyrich.households.form.risk", "Risk profile") }), /* @__PURE__ */ M(G, {
553
+ children: [/* @__PURE__ */ j(z, { children: c("brainyrich.households.form.risk", "Risk profile") }), /* @__PURE__ */ M(K, {
554
554
  value: r.riskProfile,
555
555
  onValueChange: (e) => i("riskProfile", e),
556
- children: [/* @__PURE__ */ j(J, { children: /* @__PURE__ */ j(Y, {}) }), /* @__PURE__ */ j(K, { children: Pe.map((e) => /* @__PURE__ */ j(q, {
556
+ children: [/* @__PURE__ */ j(xe, { children: /* @__PURE__ */ j(Se, {}) }), /* @__PURE__ */ j(q, { children: Le.map((e) => /* @__PURE__ */ j(J, {
557
557
  value: e,
558
558
  children: e
559
559
  }, e)) })]
@@ -591,10 +591,10 @@ function He({ open: e, onOpenChange: t, editing: n, form: r, setField: i, onSubm
591
591
  className: "grid gap-4 sm:grid-cols-2",
592
592
  children: [/* @__PURE__ */ M("div", {
593
593
  className: "space-y-2",
594
- children: [/* @__PURE__ */ j(z, { children: c("brainyrich.households.form.currency", "Currency") }), /* @__PURE__ */ M(G, {
594
+ children: [/* @__PURE__ */ j(z, { children: c("brainyrich.households.form.currency", "Currency") }), /* @__PURE__ */ M(K, {
595
595
  value: r.currency,
596
596
  onValueChange: (e) => i("currency", e),
597
- children: [/* @__PURE__ */ j(J, { children: /* @__PURE__ */ j(Y, {}) }), /* @__PURE__ */ j(K, { children: Fe.map((e) => /* @__PURE__ */ j(q, {
597
+ children: [/* @__PURE__ */ j(xe, { children: /* @__PURE__ */ j(Se, {}) }), /* @__PURE__ */ j(q, { children: Re.map((e) => /* @__PURE__ */ j(J, {
598
598
  value: e,
599
599
  children: e
600
600
  }, e)) })]
@@ -633,14 +633,14 @@ function He({ open: e, onOpenChange: t, editing: n, form: r, setField: i, onSubm
633
633
  children: [/* @__PURE__ */ j(z, {
634
634
  htmlFor: "hh-notes",
635
635
  children: c("brainyrich.households.form.notes", "Notes")
636
- }), /* @__PURE__ */ j(Me, {
636
+ }), /* @__PURE__ */ j(Fe, {
637
637
  id: "hh-notes",
638
638
  value: r.notes,
639
639
  onChange: (e) => i("notes", e.target.value),
640
640
  rows: 3
641
641
  })]
642
642
  }),
643
- /* @__PURE__ */ M(ye, { children: [/* @__PURE__ */ j(B, {
643
+ /* @__PURE__ */ M(U, { children: [/* @__PURE__ */ j(V, {
644
644
  asChild: !0,
645
645
  children: /* @__PURE__ */ j(P, {
646
646
  type: "button",
@@ -657,39 +657,39 @@ function He({ open: e, onOpenChange: t, editing: n, form: r, setField: i, onSubm
657
657
  })
658
658
  });
659
659
  }
660
- function Ue({ householdId: e, onClose: n, onEdit: r, tr: o }) {
661
- let { data: c, isLoading: ee, isError: te, refetch: d } = a(e), { data: p } = t(e ? { householdId: e } : {}), { data: ie } = s(e ? { householdId: e } : {}), { data: y } = i(e ? { householdId: e } : {}), b = !!e, x = oe(() => [...p].map((e) => ({
660
+ function Ke({ householdId: e, onClose: n, onEdit: r, tr: o }) {
661
+ let { data: c, isLoading: ee, isError: te, refetch: l } = a(e), { data: d } = t(e ? { householdId: e } : {}), { data: m, isLoading: y, isError: b, refetch: oe } = s(e ? { householdId: e } : {}), { data: S } = i(e ? { householdId: e } : {}), C = !!e, w = le(() => [...d].map((e) => ({
662
662
  account: e,
663
- value: ze(e)
664
- })).sort((e, t) => t.value - e.value), [p]), w = x.reduce((e, t) => e + t.value, 0), T = x.filter((e) => e.value > 0).slice(0, 6).map((e) => ({
663
+ value: He(e)
664
+ })).sort((e, t) => t.value - e.value), [d]), E = w.reduce((e, t) => e + t.value, 0), D = w.filter((e) => e.value > 0).slice(0, 6).map((e) => ({
665
665
  label: e.account.name,
666
666
  value: e.value
667
667
  }));
668
- return /* @__PURE__ */ j(xe, {
669
- open: b,
668
+ return /* @__PURE__ */ j(we, {
669
+ open: C,
670
670
  onOpenChange: (e) => e ? void 0 : n(),
671
- children: /* @__PURE__ */ j(Se, {
672
- className: "flex w-full flex-col gap-0 overflow-y-auto p-0 sm:max-w-xl",
671
+ children: /* @__PURE__ */ j(Te, {
672
+ className: "flex w-full flex-col gap-0 overflow-y-auto p-0 sm:max-w-xl lg:max-w-5xl",
673
673
  children: ee ? /* @__PURE__ */ j("div", {
674
674
  className: "p-6",
675
- children: /* @__PURE__ */ j(re, { rows: 4 })
675
+ children: /* @__PURE__ */ j(ie, { rows: 4 })
676
676
  }) : te ? /* @__PURE__ */ j("div", {
677
677
  className: "p-6",
678
- children: /* @__PURE__ */ j(ne, {
678
+ children: /* @__PURE__ */ j(p, {
679
679
  title: o("brainyrich.households.detail.error", "Could not load household"),
680
- onRetry: () => d()
680
+ onRetry: () => l()
681
681
  })
682
682
  }) : c ? /* @__PURE__ */ M("div", {
683
683
  className: "space-y-5 p-6",
684
684
  children: [
685
- /* @__PURE__ */ M(we, {
685
+ /* @__PURE__ */ M(De, {
686
686
  className: "space-y-2 p-0 text-left",
687
687
  children: [
688
- /* @__PURE__ */ j(Te, {
688
+ /* @__PURE__ */ j(Oe, {
689
689
  className: "text-xl",
690
690
  children: c.name
691
691
  }),
692
- /* @__PURE__ */ j(Ce, {
692
+ /* @__PURE__ */ j(Ee, {
693
693
  className: "sr-only",
694
694
  children: o("brainyrich.households.detail.subtitle", "Household overview")
695
695
  }),
@@ -705,7 +705,7 @@ function Ue({ householdId: e, onClose: n, onEdit: r, tr: o }) {
705
705
  })
706
706
  ]
707
707
  }),
708
- /* @__PURE__ */ j(f, {
708
+ /* @__PURE__ */ j(u, {
709
709
  glow: !0,
710
710
  children: /* @__PURE__ */ M("div", {
711
711
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
@@ -736,7 +736,7 @@ function Ue({ householdId: e, onClose: n, onEdit: r, tr: o }) {
736
736
  c.primaryContactEmail ? /* @__PURE__ */ M("a", {
737
737
  href: `mailto:${c.primaryContactEmail}`,
738
738
  className: "mt-0.5 inline-flex items-center gap-1 text-xs text-text-secondary hover:text-[var(--color-action-primary-text)] sm:justify-end",
739
- children: [/* @__PURE__ */ j(le, {
739
+ children: [/* @__PURE__ */ j(ue, {
740
740
  className: "size-3",
741
741
  "aria-hidden": "true"
742
742
  }), c.primaryContactEmail]
@@ -748,86 +748,184 @@ function Ue({ householdId: e, onClose: n, onEdit: r, tr: o }) {
748
748
  /* @__PURE__ */ M("div", {
749
749
  className: "grid grid-cols-3 gap-3",
750
750
  children: [
751
- /* @__PURE__ */ j(We, {
751
+ /* @__PURE__ */ j($, {
752
752
  icon: /* @__PURE__ */ j(A, {
753
753
  className: "size-4",
754
754
  "aria-hidden": "true"
755
755
  }),
756
756
  label: o("brainyrich.households.detail.accounts", "Accounts"),
757
- value: String(p.length)
757
+ value: String(d.length)
758
758
  }),
759
- /* @__PURE__ */ j(We, {
760
- icon: /* @__PURE__ */ j(E, {
759
+ /* @__PURE__ */ j($, {
760
+ icon: /* @__PURE__ */ j(T, {
761
761
  className: "size-4",
762
762
  "aria-hidden": "true"
763
763
  }),
764
764
  label: o("brainyrich.households.detail.portfolios", "Portfolios"),
765
- value: String(ie.length)
765
+ value: String(m.length)
766
766
  }),
767
- /* @__PURE__ */ j(We, {
768
- icon: /* @__PURE__ */ j(D, {
767
+ /* @__PURE__ */ j($, {
768
+ icon: /* @__PURE__ */ j(O, {
769
769
  className: "size-4",
770
770
  "aria-hidden": "true"
771
771
  }),
772
772
  label: o("brainyrich.households.detail.goals", "Goals"),
773
- value: String(y.length)
773
+ value: String(S.length)
774
774
  })
775
775
  ]
776
776
  }),
777
- c.tags.length > 0 ? /* @__PURE__ */ j("div", {
778
- className: "flex flex-wrap gap-1",
779
- children: c.tags.map((e) => /* @__PURE__ */ j(N, {
780
- variant: "outline",
781
- children: e
782
- }, e))
783
- }) : null,
784
- /* @__PURE__ */ M(Ae, {
785
- defaultValue: "overview",
786
- className: "w-full",
787
- children: [
788
- /* @__PURE__ */ M(je, {
789
- className: "w-full justify-start overflow-x-auto",
790
- children: [
791
- /* @__PURE__ */ j($, {
792
- value: "overview",
793
- children: o("brainyrich.households.tab.overview", "Overview")
794
- }),
795
- /* @__PURE__ */ j($, {
796
- value: "accounts",
797
- children: o("brainyrich.households.detail.accounts", "Accounts")
798
- }),
799
- /* @__PURE__ */ j($, {
800
- value: "goals",
801
- children: o("brainyrich.households.detail.goals", "Goals")
802
- }),
803
- /* @__PURE__ */ j($, {
804
- value: "documents",
805
- children: o("brainyrich.households.detail.documents", "Documents")
806
- }),
807
- /* @__PURE__ */ j($, {
808
- value: "discussion",
809
- children: o("brainyrich.households.detail.discussion", "Discussion")
810
- })
811
- ]
812
- }),
813
- /* @__PURE__ */ M(Q, {
814
- value: "overview",
815
- className: "mt-4 space-y-4",
816
- children: [
817
- T.length > 0 ? /* @__PURE__ */ j(F, { children: /* @__PURE__ */ M(I, {
777
+ /* @__PURE__ */ M("div", {
778
+ className: "grid grid-cols-1 gap-5 lg:grid-cols-[minmax(0,1fr)_20rem]",
779
+ children: [/* @__PURE__ */ M(Ne, {
780
+ defaultValue: "accounts",
781
+ className: "w-full min-w-0",
782
+ children: [
783
+ /* @__PURE__ */ M(Pe, {
784
+ className: "w-full justify-start overflow-x-auto",
785
+ children: [
786
+ /* @__PURE__ */ j(Q, {
787
+ value: "accounts",
788
+ children: o("brainyrich.households.detail.accounts", "Accounts")
789
+ }),
790
+ /* @__PURE__ */ j(Q, {
791
+ value: "portfolios",
792
+ children: o("brainyrich.households.detail.portfolios", "Portfolios")
793
+ }),
794
+ /* @__PURE__ */ j(Q, {
795
+ value: "goals",
796
+ children: o("brainyrich.households.detail.goals", "Goals")
797
+ }),
798
+ /* @__PURE__ */ j(Q, {
799
+ value: "documents",
800
+ children: o("brainyrich.households.detail.documents", "Documents")
801
+ }),
802
+ /* @__PURE__ */ j(Q, {
803
+ value: "notes",
804
+ children: o("brainyrich.households.tab.notes", "Notes")
805
+ })
806
+ ]
807
+ }),
808
+ /* @__PURE__ */ M(Z, {
809
+ value: "accounts",
810
+ className: "mt-4 space-y-2",
811
+ children: [D.length > 0 ? /* @__PURE__ */ j(F, { children: /* @__PURE__ */ M(I, {
818
812
  className: "p-4",
819
813
  children: [/* @__PURE__ */ j("h3", {
820
814
  className: "mb-3 text-sm font-medium text-text-primary",
821
815
  children: o("brainyrich.households.detail.allocation", "Where assets sit")
822
- }), /* @__PURE__ */ j(u, {
823
- data: T,
824
- centerValue: h(w, c.currency),
816
+ }), /* @__PURE__ */ j(re, {
817
+ data: D,
818
+ centerValue: h(E, c.currency),
825
819
  centerLabel: o("brainyrich.households.detail.invested", "Invested"),
826
820
  height: 200,
827
821
  valueFormatter: (e) => _(e, c.currency)
828
822
  })]
829
- }) }) : null,
830
- /* @__PURE__ */ j(F, { children: /* @__PURE__ */ M(I, {
823
+ }) }) : null, w.length === 0 ? /* @__PURE__ */ j(f, {
824
+ icon: /* @__PURE__ */ j(A, {
825
+ className: "size-6",
826
+ "aria-hidden": "true"
827
+ }),
828
+ title: o("brainyrich.households.detail.noAccounts", "No accounts linked")
829
+ }) : w.map(({ account: e, value: t }) => /* @__PURE__ */ M("div", {
830
+ className: "flex items-center justify-between gap-3 rounded-lg border border-border-subtle bg-bg-surface p-3 transition-colors hover:border-[var(--color-action-primary-border)]",
831
+ children: [/* @__PURE__ */ M("div", {
832
+ className: "min-w-0",
833
+ children: [/* @__PURE__ */ j("p", {
834
+ className: "truncate text-sm font-medium text-text-primary",
835
+ children: e.name
836
+ }), /* @__PURE__ */ M("p", {
837
+ className: "text-xs text-text-secondary",
838
+ children: [e.institution ?? e.type, e.accountMask ? ` ·••${e.accountMask}` : ""]
839
+ })]
840
+ }), /* @__PURE__ */ j("span", {
841
+ className: "shrink-0 text-sm font-semibold tabular-nums text-status-success-text",
842
+ children: _(t, e.currency)
843
+ })]
844
+ }, e.id))]
845
+ }),
846
+ /* @__PURE__ */ j(Z, {
847
+ value: "portfolios",
848
+ className: "mt-4 space-y-2",
849
+ children: y ? /* @__PURE__ */ j(ie, { rows: 2 }) : b ? /* @__PURE__ */ j(p, {
850
+ title: o("brainyrich.households.detail.portfoliosError", "Could not load portfolios"),
851
+ onRetry: () => oe()
852
+ }) : m.length === 0 ? /* @__PURE__ */ j(f, {
853
+ icon: /* @__PURE__ */ j(T, {
854
+ className: "size-6",
855
+ "aria-hidden": "true"
856
+ }),
857
+ title: o("brainyrich.households.detail.noPortfolios", "No portfolios linked")
858
+ }) : m.map((e) => /* @__PURE__ */ M("div", {
859
+ "data-testid": "household-portfolio-row",
860
+ className: "flex items-center justify-between gap-3 rounded-lg border border-border-subtle bg-bg-surface p-3 transition-colors hover:border-[var(--color-action-primary-border)]",
861
+ children: [/* @__PURE__ */ M("div", {
862
+ className: "min-w-0",
863
+ children: [/* @__PURE__ */ j("p", {
864
+ className: "truncate text-sm font-medium text-text-primary",
865
+ children: e.name
866
+ }), /* @__PURE__ */ M("p", {
867
+ className: "truncate text-xs text-text-secondary",
868
+ children: [
869
+ e.baseCurrency,
870
+ " ·",
871
+ " ",
872
+ o("brainyrich.households.detail.driftThreshold", "Drift threshold {pct}", { pct: ae(e.driftThresholdPct) }),
873
+ e.description ? ` · ${e.description}` : ""
874
+ ]
875
+ })]
876
+ }), /* @__PURE__ */ j(N, {
877
+ variant: v(e.status),
878
+ className: "shrink-0",
879
+ children: e.status.replace(/_/g, " ")
880
+ })]
881
+ }, e.id))
882
+ }),
883
+ /* @__PURE__ */ j(Z, {
884
+ value: "goals",
885
+ className: "mt-4 space-y-2",
886
+ children: S.length === 0 ? /* @__PURE__ */ j(f, {
887
+ icon: /* @__PURE__ */ j(O, {
888
+ className: "size-6",
889
+ "aria-hidden": "true"
890
+ }),
891
+ title: o("brainyrich.households.detail.noGoals", "No goals set")
892
+ }) : S.map((e) => /* @__PURE__ */ M("div", {
893
+ className: "flex items-center justify-between gap-3 rounded-lg border border-border-subtle bg-bg-surface p-3",
894
+ children: [/* @__PURE__ */ M("div", {
895
+ className: "min-w-0",
896
+ children: [/* @__PURE__ */ j("p", {
897
+ className: "truncate text-sm font-medium text-text-primary",
898
+ children: e.name
899
+ }), /* @__PURE__ */ M("p", {
900
+ className: "text-xs text-text-secondary",
901
+ children: [
902
+ o("brainyrich.households.detail.goalTarget", "Target"),
903
+ " ",
904
+ _(e.targetAmount, e.currency),
905
+ " · ",
906
+ g(e.targetDate)
907
+ ]
908
+ })]
909
+ }), /* @__PURE__ */ j(N, {
910
+ variant: v(e.projection),
911
+ className: "shrink-0",
912
+ children: e.projection.replace(/_/g, " ")
913
+ })]
914
+ }, e.id))
915
+ }),
916
+ /* @__PURE__ */ j(Z, {
917
+ value: "documents",
918
+ className: "mt-4",
919
+ children: /* @__PURE__ */ j(x, {
920
+ entityType: se,
921
+ entityId: c.id,
922
+ heading: o("brainyrich.households.detail.documents", "Documents")
923
+ })
924
+ }),
925
+ /* @__PURE__ */ M(Z, {
926
+ value: "notes",
927
+ className: "mt-4 space-y-4",
928
+ children: [/* @__PURE__ */ j(F, { children: /* @__PURE__ */ M(I, {
831
929
  className: "space-y-3 p-4 text-sm",
832
930
  children: [
833
931
  /* @__PURE__ */ M("div", {
@@ -837,21 +935,20 @@ function Ue({ householdId: e, onClose: n, onEdit: r, tr: o }) {
837
935
  children: o("brainyrich.households.detail.advisor", "Advisor")
838
936
  }), /* @__PURE__ */ j("span", {
839
937
  className: "text-right font-medium text-text-primary",
840
- children: c.advisorId ? /* @__PURE__ */ j(l, { id: c.advisorId }) : o("brainyrich.common.unassigned", "Unassigned")
938
+ children: c.advisorId ? /* @__PURE__ */ j(ne, { id: c.advisorId }) : o("brainyrich.common.unassigned", "Unassigned")
841
939
  })]
842
940
  }),
843
- /* @__PURE__ */ j(be, {}),
844
- /* @__PURE__ */ j(Ge, {
941
+ /* @__PURE__ */ j(Ce, {}),
942
+ /* @__PURE__ */ j(qe, {
845
943
  label: o("brainyrich.households.detail.created", "Created"),
846
944
  value: g(c.createdAt)
847
945
  }),
848
- /* @__PURE__ */ j(Ge, {
946
+ /* @__PURE__ */ j(qe, {
849
947
  label: o("brainyrich.households.detail.updated", "Last updated"),
850
948
  value: g(c.updatedAt)
851
949
  })
852
950
  ]
853
- }) }),
854
- c.notes ? /* @__PURE__ */ j(F, { children: /* @__PURE__ */ M(I, {
951
+ }) }), c.notes ? /* @__PURE__ */ j(F, { children: /* @__PURE__ */ M(I, {
855
952
  className: "space-y-1 p-4",
856
953
  children: [/* @__PURE__ */ j("p", {
857
954
  className: "text-xs font-medium uppercase tracking-wide text-text-secondary",
@@ -860,100 +957,23 @@ function Ue({ householdId: e, onClose: n, onEdit: r, tr: o }) {
860
957
  className: "text-sm text-text-primary",
861
958
  children: c.notes
862
959
  })]
863
- }) }) : null,
864
- /* @__PURE__ */ j(F, { children: /* @__PURE__ */ j(I, {
865
- className: "p-4",
866
- children: /* @__PURE__ */ j(S, {
867
- entityType: "brainyrich-household",
868
- entityId: c.id
869
- })
870
- }) })
871
- ]
872
- }),
873
- /* @__PURE__ */ j(Q, {
874
- value: "accounts",
875
- className: "mt-4 space-y-2",
876
- children: x.length === 0 ? /* @__PURE__ */ j(m, {
877
- icon: /* @__PURE__ */ j(A, {
878
- className: "size-6",
879
- "aria-hidden": "true"
880
- }),
881
- title: o("brainyrich.households.detail.noAccounts", "No accounts linked")
882
- }) : x.map(({ account: e, value: t }) => /* @__PURE__ */ M("div", {
883
- className: "flex items-center justify-between gap-3 rounded-lg border border-border-subtle bg-bg-surface p-3 transition-colors hover:border-[var(--color-action-primary-border)]",
884
- children: [/* @__PURE__ */ M("div", {
885
- className: "min-w-0",
886
- children: [/* @__PURE__ */ j("p", {
887
- className: "truncate text-sm font-medium text-text-primary",
888
- children: e.name
889
- }), /* @__PURE__ */ M("p", {
890
- className: "text-xs text-text-secondary",
891
- children: [e.institution ?? e.type, e.accountMask ? ` ·••${e.accountMask}` : ""]
892
- })]
893
- }), /* @__PURE__ */ j("span", {
894
- className: "shrink-0 text-sm font-semibold tabular-nums text-status-success-text",
895
- children: _(t, e.currency)
896
- })]
897
- }, e.id))
898
- }),
899
- /* @__PURE__ */ j(Q, {
900
- value: "goals",
901
- className: "mt-4 space-y-2",
902
- children: y.length === 0 ? /* @__PURE__ */ j(m, {
903
- icon: /* @__PURE__ */ j(D, {
904
- className: "size-6",
905
- "aria-hidden": "true"
906
- }),
907
- title: o("brainyrich.households.detail.noGoals", "No goals set")
908
- }) : y.map((e) => /* @__PURE__ */ M("div", {
909
- className: "flex items-center justify-between gap-3 rounded-lg border border-border-subtle bg-bg-surface p-3",
910
- children: [/* @__PURE__ */ M("div", {
911
- className: "min-w-0",
912
- children: [/* @__PURE__ */ j("p", {
913
- className: "truncate text-sm font-medium text-text-primary",
914
- children: e.name
915
- }), /* @__PURE__ */ M("p", {
916
- className: "text-xs text-text-secondary",
917
- children: [
918
- o("brainyrich.households.detail.goalTarget", "Target"),
919
- " ",
920
- _(e.targetAmount, e.currency),
921
- " · ",
922
- g(e.targetDate)
923
- ]
924
- })]
925
- }), /* @__PURE__ */ j(N, {
926
- variant: v(e.projection),
927
- className: "shrink-0",
928
- children: e.projection.replace(/_/g, " ")
960
+ }) }) : /* @__PURE__ */ j("p", {
961
+ className: "text-sm text-text-secondary",
962
+ children: o("brainyrich.households.detail.noSummary", "No summary yet. Add one with Edit, or leave a note in Comments/Notes.")
929
963
  })]
930
- }, e.id))
931
- }),
932
- /* @__PURE__ */ j(Q, {
933
- value: "documents",
934
- className: "mt-4",
935
- children: /* @__PURE__ */ j(ae, {
936
- entityType: "brainyrich-household",
937
- entityId: c.id,
938
- heading: o("brainyrich.households.detail.documents", "Documents")
939
- })
940
- }),
941
- /* @__PURE__ */ j(Q, {
942
- value: "discussion",
943
- className: "mt-4",
944
- children: /* @__PURE__ */ j(C, {
945
- entityType: "brainyrich-household",
946
- entityId: c.id,
947
- heading: o("brainyrich.households.detail.discussion", "Discussion")
948
964
  })
949
- })
950
- ]
965
+ ]
966
+ }), /* @__PURE__ */ j(ce, {
967
+ householdId: c.id,
968
+ legacyTags: c.tags,
969
+ tr: o
970
+ })]
951
971
  }),
952
972
  /* @__PURE__ */ M(P, {
953
973
  variant: "outline",
954
974
  className: "w-full",
955
975
  onClick: () => r(c),
956
- children: [/* @__PURE__ */ j(de, {
976
+ children: [/* @__PURE__ */ j(fe, {
957
977
  className: "size-4",
958
978
  "aria-hidden": "true"
959
979
  }), o("brainyrich.households.action.edit", "Edit")]
@@ -961,8 +981,8 @@ function Ue({ householdId: e, onClose: n, onEdit: r, tr: o }) {
961
981
  ]
962
982
  }) : /* @__PURE__ */ j("div", {
963
983
  className: "p-6",
964
- children: /* @__PURE__ */ j(m, {
965
- icon: /* @__PURE__ */ j(k, {
984
+ children: /* @__PURE__ */ j(f, {
985
+ icon: /* @__PURE__ */ j(me, {
966
986
  className: "size-6",
967
987
  "aria-hidden": "true"
968
988
  }),
@@ -972,7 +992,7 @@ function Ue({ householdId: e, onClose: n, onEdit: r, tr: o }) {
972
992
  })
973
993
  });
974
994
  }
975
- function We({ icon: e, label: t, value: n }) {
995
+ function $({ icon: e, label: t, value: n }) {
976
996
  return /* @__PURE__ */ M("div", {
977
997
  className: "rounded-lg border border-border-subtle bg-bg-surface p-3 text-center transition-shadow motion-safe:hover:shadow-[var(--shadow-pop-hover,var(--shadow-elevation-2))]",
978
998
  children: [
@@ -991,7 +1011,7 @@ function We({ icon: e, label: t, value: n }) {
991
1011
  ]
992
1012
  });
993
1013
  }
994
- function Ge({ label: e, value: t }) {
1014
+ function qe({ label: e, value: t }) {
995
1015
  return /* @__PURE__ */ M("div", {
996
1016
  className: "flex items-center justify-between gap-4",
997
1017
  children: [/* @__PURE__ */ j("span", {
@@ -1004,6 +1024,6 @@ function Ge({ label: e, value: t }) {
1004
1024
  });
1005
1025
  }
1006
1026
  //#endregion
1007
- export { Be as FamilyPage };
1027
+ export { Ue as FamilyPage };
1008
1028
 
1009
1029
  //# sourceMappingURL=FamilyPage.js.map