@burdenoff/microfe-atheletebridge 2026.1116.1 → 2026.1123.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.
Files changed (37) hide show
  1. package/dist/atheletebridge/AthleteBridgeRoot.js +71 -55
  2. package/dist/atheletebridge/AthleteBridgeRoot.js.map +1 -1
  3. package/dist/atheletebridge/AthleteBridgeRoutes.js +30 -6
  4. package/dist/atheletebridge/AthleteBridgeRoutes.js.map +1 -1
  5. package/dist/atheletebridge/components/MatchupRow.js +11 -2
  6. package/dist/atheletebridge/components/MatchupRow.js.map +1 -1
  7. package/dist/atheletebridge/components/analytics/AiInsightsPanel.d.ts +5 -0
  8. package/dist/atheletebridge/components/analytics/AiInsightsPanel.js +617 -0
  9. package/dist/atheletebridge/components/analytics/AiInsightsPanel.js.map +1 -0
  10. package/dist/atheletebridge/components/wearables/ConnectedDevicesPanel.d.ts +5 -0
  11. package/dist/atheletebridge/components/wearables/ConnectedDevicesPanel.js +453 -0
  12. package/dist/atheletebridge/components/wearables/ConnectedDevicesPanel.js.map +1 -0
  13. package/dist/atheletebridge/hooks/index.d.ts +2 -0
  14. package/dist/atheletebridge/hooks/index.js +1 -0
  15. package/dist/atheletebridge/hooks/useInsightsWearablesMarketplaceApi.d.ts +62 -0
  16. package/dist/atheletebridge/hooks/useInsightsWearablesMarketplaceApi.js +362 -0
  17. package/dist/atheletebridge/hooks/useInsightsWearablesMarketplaceApi.js.map +1 -0
  18. package/dist/atheletebridge/pages/DashboardPage.js +71 -1
  19. package/dist/atheletebridge/pages/DashboardPage.js.map +1 -1
  20. package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.d.ts +3 -1
  21. package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.js +346 -317
  22. package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.js.map +1 -1
  23. package/dist/atheletebridge/pages/athletes/AthleteProfilePage.js +171 -159
  24. package/dist/atheletebridge/pages/athletes/AthleteProfilePage.js.map +1 -1
  25. package/dist/atheletebridge/pages/devices/ConnectedDevicesPage.d.ts +1 -0
  26. package/dist/atheletebridge/pages/devices/ConnectedDevicesPage.js +14 -0
  27. package/dist/atheletebridge/pages/devices/ConnectedDevicesPage.js.map +1 -0
  28. package/dist/atheletebridge/pages/marketplace/MarketplacePage.d.ts +1 -0
  29. package/dist/atheletebridge/pages/marketplace/MarketplacePage.js +756 -0
  30. package/dist/atheletebridge/pages/marketplace/MarketplacePage.js.map +1 -0
  31. package/dist/atheletebridge/pages/performance/PerformancePage.js +296 -277
  32. package/dist/atheletebridge/pages/performance/PerformancePage.js.map +1 -1
  33. package/dist/atheletebridge/pages/sessions/SessionDetailPage.js +279 -147
  34. package/dist/atheletebridge/pages/sessions/SessionDetailPage.js.map +1 -1
  35. package/dist/atheletebridge/types/index.d.ts +1 -0
  36. package/dist/atheletebridge/types/insights.d.ts +270 -0
  37. package/package.json +1 -1
@@ -5,29 +5,30 @@ import { StatCard as r } from "../../components/viz/StatCard.js";
5
5
  import { RatingStars as i } from "../../components/viz/RatingStars.js";
6
6
  import { SessionCard as a } from "../../components/SessionCard.js";
7
7
  import { Crest as o } from "../../components/Crest.js";
8
- import { UserAvatar as s } from "../../components/UserAvatar.js";
9
- import { EmptyState as c } from "../../components/EmptyState.js";
10
- import { SubjectDecisions as ee } from "../../components/ai/SubjectDecisions.js";
11
- import { ErrorState as te, LoadingState as l } from "../../components/LoadingState.js";
8
+ import { UserAvatar as ee } from "../../components/UserAvatar.js";
9
+ import { EmptyState as s } from "../../components/EmptyState.js";
10
+ import { SubjectDecisions as te } from "../../components/ai/SubjectDecisions.js";
11
+ import { ConnectedDevicesPanel as ne } from "../../components/wearables/ConnectedDevicesPanel.js";
12
+ import { ErrorState as c, LoadingState as re } from "../../components/LoadingState.js";
12
13
  import "../../components/viz/index.js";
13
- import { MEMBER_ROLE_LABELS as u, METRIC_TYPE_LABELS as d, SPORT_LABELS as ne } from "../../components/domain.js";
14
- import { useAthleteBridge as re } from "../../context/AthleteBridgeContext.js";
14
+ import { MEMBER_ROLE_LABELS as ie, METRIC_TYPE_LABELS as l, SPORT_LABELS as u } from "../../components/domain.js";
15
+ import { useAthleteBridge as d } from "../../context/AthleteBridgeContext.js";
15
16
  import { useAthleteProfile as f, useTeam as p } from "../../hooks/useAthleteBridgeApi.js";
16
- import { formatDate as m, formatDuration as h } from "../../utils/formatters.js";
17
- import { useMemo as g, useState as ie } from "react";
18
- import { ArrowLeft as ae, CalendarClock as _, Dumbbell as v, Gauge as y, LineChart as oe, Ruler as se, Sparkles as ce, Star as le, Users as b, Weight as x } from "lucide-react";
19
- import { useParams as S } from "react-router";
20
- import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
21
- import { Badge as E, GlassCard as D, GradientText as ue, ResponsiveTable as de, Tabs as fe, TabsContent as O, TabsList as k, TabsTrigger as A } from "@burdenoff/fe-libs/ui";
17
+ import { formatDate as m, formatDuration as ae } from "../../utils/formatters.js";
18
+ import { useMemo as h, useState as oe } from "react";
19
+ import { ArrowLeft as se, CalendarClock as g, Dumbbell as _, Gauge as ce, LineChart as le, Ruler as ue, Sparkles as de, Star as v, Users as y, Weight as b } from "lucide-react";
20
+ import { useParams as x } from "react-router";
21
+ import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
22
+ import { Badge as T, GlassCard as E, GradientText as fe, ResponsiveTable as pe, Tabs as me, TabsContent as D, TabsList as O, TabsTrigger as k } from "@burdenoff/fe-libs/ui";
22
23
  // src/atheletebridge/pages/athletes/AthleteProfilePage.tsx
23
- var j = [
24
+ var A = [
24
25
  "1M",
25
26
  "3M",
26
27
  "6M",
27
28
  "YTD",
28
29
  "1Y",
29
30
  "ALL"
30
- ], M = {
31
+ ], j = {
31
32
  "1M": "1M",
32
33
  "3M": "3M",
33
34
  "6M": "6M",
@@ -35,7 +36,7 @@ var j = [
35
36
  "1Y": "1Y",
36
37
  ALL: "All"
37
38
  };
38
- function N(e) {
39
+ function M(e) {
39
40
  let t = Date.now(), n = 864e5;
40
41
  switch (e) {
41
42
  case "1M": return t - 30 * n;
@@ -46,11 +47,11 @@ function N(e) {
46
47
  case "ALL": return 0;
47
48
  }
48
49
  }
49
- var P = (e) => new Date(e).toLocaleDateString(void 0, {
50
+ var N = (e) => new Date(e).toLocaleDateString(void 0, {
50
51
  month: "short",
51
52
  day: "numeric"
52
53
  });
53
- function F(e, t) {
54
+ function P(e, t) {
54
55
  let n = /* @__PURE__ */ new Map();
55
56
  for (let r of e) {
56
57
  let e = new Date(r.recordedAt).getTime();
@@ -71,105 +72,105 @@ function F(e, t) {
71
72
  };
72
73
  }).sort((e, t) => t.points.length - e.points.length);
73
74
  }
74
- function I() {
75
- let { teamId: j, memberId: M } = S(), { navigateTo: I } = re(), z = f(j, M), B = p(j), [V, H] = ie("6M"), U = g(() => N(V), [V]), W = g(() => F(z.metrics, U), [z.metrics, U]), G = g(() => F(z.metrics, 0), [z.metrics]), K = g(() => z.sessions.filter((e) => e.rating !== null), [z.sessions]), q = g(() => K.length > 0 ? K.reduce((e, t) => e + (t.rating ?? 0), 0) / K.length : null, [K]), J = g(() => z.sessions.filter((e) => e.status === "REQUESTED" || e.status === "CONFIRMED").sort((e, t) => new Date(e.scheduledAt).getTime() - new Date(t.scheduledAt).getTime()), [z.sessions]), Y = g(() => [...z.workouts].sort((e, t) => new Date(t.performedAt).getTime() - new Date(e.performedAt).getTime()), [z.workouts]), pe = g(() => z.sessions.filter((e) => e.status === "COMPLETED").length, [z.sessions]);
76
- if (z.isLoading) return /* @__PURE__ */ w(e, {
75
+ function F() {
76
+ let { teamId: A, memberId: j } = x(), { navigateTo: F } = d(), R = f(A, j), z = p(A), [B, V] = oe("6M"), H = h(() => M(B), [B]), U = h(() => P(R.metrics, H), [R.metrics, H]), W = h(() => P(R.metrics, 0), [R.metrics]), G = h(() => R.sessions.filter((e) => e.rating !== null), [R.sessions]), K = h(() => G.length > 0 ? G.reduce((e, t) => e + (t.rating ?? 0), 0) / G.length : null, [G]), q = h(() => R.sessions.filter((e) => e.status === "REQUESTED" || e.status === "CONFIRMED").sort((e, t) => new Date(e.scheduledAt).getTime() - new Date(t.scheduledAt).getTime()), [R.sessions]), J = h(() => [...R.workouts].sort((e, t) => new Date(t.performedAt).getTime() - new Date(e.performedAt).getTime()), [R.workouts]), Y = h(() => R.sessions.filter((e) => e.status === "COMPLETED").length, [R.sessions]);
77
+ if (R.isLoading) return /* @__PURE__ */ C(e, {
77
78
  title: "Athlete",
78
- children: /* @__PURE__ */ w(l, { label: "Loading athlete profile…" })
79
+ children: /* @__PURE__ */ C(re, { label: "Loading athlete profile…" })
79
80
  });
80
- if (z.isError || !z.member) return /* @__PURE__ */ w(e, {
81
+ if (R.isError || !R.member) return /* @__PURE__ */ C(e, {
81
82
  title: "Athlete",
82
- children: /* @__PURE__ */ w(te, {
83
+ children: /* @__PURE__ */ C(c, {
83
84
  title: "Athlete not found",
84
85
  message: "This athlete is not on the roster, or you do not have access.",
85
- onRetry: () => I(j ? `/teams/${j}` : "/teams")
86
+ onRetry: () => F(A ? `/teams/${A}` : "/teams")
86
87
  })
87
88
  });
88
- let X = z.member, Z = B.data?.name ?? null, Q = B.data?.sport, $ = [];
89
+ let X = R.member, Z = z.data?.name ?? null, Q = z.data?.sport, $ = [];
89
90
  X.height != null && $.push({
90
- icon: /* @__PURE__ */ w(se, { className: "h-4 w-4" }),
91
+ icon: /* @__PURE__ */ C(ue, { className: "h-4 w-4" }),
91
92
  label: "Height",
92
93
  value: String(X.height)
93
94
  }), X.weight != null && $.push({
94
- icon: /* @__PURE__ */ w(x, { className: "h-4 w-4" }),
95
+ icon: /* @__PURE__ */ C(b, { className: "h-4 w-4" }),
95
96
  label: "Weight",
96
97
  value: String(X.weight)
97
98
  }), X.dominantSide && $.push({
98
- icon: /* @__PURE__ */ w(y, { className: "h-4 w-4" }),
99
+ icon: /* @__PURE__ */ C(ce, { className: "h-4 w-4" }),
99
100
  label: "Dominant side",
100
101
  value: X.dominantSide
101
102
  }), X.position && $.push({
102
- icon: /* @__PURE__ */ w(b, { className: "h-4 w-4" }),
103
+ icon: /* @__PURE__ */ C(y, { className: "h-4 w-4" }),
103
104
  label: "Position",
104
105
  value: X.position
105
106
  }), X.joinedAt && $.push({
106
- icon: /* @__PURE__ */ w(_, { className: "h-4 w-4" }),
107
+ icon: /* @__PURE__ */ C(g, { className: "h-4 w-4" }),
107
108
  label: "Joined",
108
109
  value: m(X.joinedAt)
109
110
  });
110
- let me = W[0] ?? null;
111
- return /* @__PURE__ */ T(e, {
112
- title: /* @__PURE__ */ w(ue, { children: X.displayName }),
113
- description: Z ? `${Z}${Q ? ` · ${ne[Q]}` : ""}` : void 0,
114
- actions: /* @__PURE__ */ T("button", {
111
+ let he = U[0] ?? null;
112
+ return /* @__PURE__ */ w(e, {
113
+ title: /* @__PURE__ */ C(fe, { children: X.displayName }),
114
+ description: Z ? `${Z}${Q ? ` · ${u[Q]}` : ""}` : void 0,
115
+ actions: /* @__PURE__ */ w("button", {
115
116
  type: "button",
116
- onClick: () => I(j ? `/teams/${j}` : "/teams"),
117
+ onClick: () => F(A ? `/teams/${A}` : "/teams"),
117
118
  className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
118
- children: [/* @__PURE__ */ w(ae, { className: "h-4 w-4" }), " Back to team"]
119
+ children: [/* @__PURE__ */ C(se, { className: "h-4 w-4" }), " Back to team"]
119
120
  }),
120
- children: [/* @__PURE__ */ w(D, {
121
+ children: [/* @__PURE__ */ C(E, {
121
122
  treatment: "insight",
122
123
  className: "mb-8 p-6",
123
- children: /* @__PURE__ */ T("div", {
124
+ children: /* @__PURE__ */ w("div", {
124
125
  className: "flex flex-col gap-6 md:flex-row md:items-start",
125
- children: [/* @__PURE__ */ w(s, {
126
+ children: [/* @__PURE__ */ C(ee, {
126
127
  name: X.displayName,
127
128
  id: X.userId,
128
129
  jersey: X.jerseyNumber,
129
130
  size: "xl",
130
131
  ring: !0,
131
132
  className: "shrink-0"
132
- }), /* @__PURE__ */ T("div", {
133
+ }), /* @__PURE__ */ w("div", {
133
134
  className: "min-w-0 flex-1",
134
- children: [/* @__PURE__ */ T("div", {
135
+ children: [/* @__PURE__ */ w("div", {
135
136
  className: "flex flex-wrap items-center gap-2",
136
137
  children: [
137
- /* @__PURE__ */ w(E, {
138
+ /* @__PURE__ */ C(T, {
138
139
  variant: "default",
139
- children: u[X.role]
140
+ children: ie[X.role]
140
141
  }),
141
- X.position ? /* @__PURE__ */ w(E, {
142
+ X.position ? /* @__PURE__ */ C(T, {
142
143
  variant: "secondary",
143
144
  children: X.position
144
145
  }) : null,
145
- X.jerseyNumber == null ? null : /* @__PURE__ */ T(E, {
146
+ X.jerseyNumber == null ? null : /* @__PURE__ */ w(T, {
146
147
  variant: "outline",
147
148
  className: "tabular-nums",
148
149
  children: ["#", X.jerseyNumber]
149
150
  }),
150
- Z ? /* @__PURE__ */ T(E, {
151
+ Z ? /* @__PURE__ */ w(T, {
151
152
  variant: "secondary",
152
153
  className: "gap-1.5",
153
- children: [/* @__PURE__ */ w(o, {
154
+ children: [/* @__PURE__ */ C(o, {
154
155
  name: Z,
155
156
  sport: Q,
156
157
  size: 16,
157
158
  showSportGlyph: !1
158
159
  }), Z]
159
160
  }) : null,
160
- /* @__PURE__ */ w(t, { status: X.status })
161
+ /* @__PURE__ */ C(t, { status: X.status })
161
162
  ]
162
- }), $.length > 0 ? /* @__PURE__ */ w("dl", {
163
+ }), $.length > 0 ? /* @__PURE__ */ C("dl", {
163
164
  className: "mt-5 grid grid-cols-2 gap-x-6 gap-y-4 sm:grid-cols-3 lg:grid-cols-5",
164
- children: $.map((e) => /* @__PURE__ */ T("div", {
165
+ children: $.map((e) => /* @__PURE__ */ w("div", {
165
166
  className: "min-w-0",
166
- children: [/* @__PURE__ */ T("dt", {
167
+ children: [/* @__PURE__ */ w("dt", {
167
168
  className: "flex items-center gap-1.5 text-xs font-medium text-text-secondary",
168
- children: [/* @__PURE__ */ w("span", {
169
+ children: [/* @__PURE__ */ C("span", {
169
170
  className: "text-text-muted",
170
171
  children: e.icon
171
172
  }), e.label]
172
- }), /* @__PURE__ */ w("dd", {
173
+ }), /* @__PURE__ */ C("dd", {
173
174
  className: "mt-1 truncate text-lg font-semibold text-text-primary",
174
175
  children: e.value
175
176
  })]
@@ -177,152 +178,156 @@ function I() {
177
178
  }) : null]
178
179
  })]
179
180
  })
180
- }), /* @__PURE__ */ T(fe, {
181
+ }), /* @__PURE__ */ w(me, {
181
182
  defaultValue: "overview",
182
183
  children: [
183
- /* @__PURE__ */ T(k, {
184
+ /* @__PURE__ */ w(O, {
184
185
  className: "mb-6 flex-wrap",
185
186
  children: [
186
- /* @__PURE__ */ w(A, {
187
+ /* @__PURE__ */ C(k, {
187
188
  value: "overview",
188
189
  children: "Overview"
189
190
  }),
190
- /* @__PURE__ */ w(A, {
191
+ /* @__PURE__ */ C(k, {
191
192
  value: "metrics",
192
193
  children: "Metrics"
193
194
  }),
194
- /* @__PURE__ */ w(A, {
195
+ /* @__PURE__ */ C(k, {
195
196
  value: "workouts",
196
197
  children: "Workouts"
197
198
  }),
198
- /* @__PURE__ */ w(A, {
199
+ /* @__PURE__ */ C(k, {
199
200
  value: "sessions",
200
201
  children: "Sessions"
201
202
  }),
202
- /* @__PURE__ */ w(A, {
203
+ /* @__PURE__ */ C(k, {
203
204
  value: "ai",
204
205
  children: "AI decisions"
206
+ }),
207
+ /* @__PURE__ */ C(k, {
208
+ value: "devices",
209
+ children: "Connected devices"
205
210
  })
206
211
  ]
207
212
  }),
208
- /* @__PURE__ */ T(O, {
213
+ /* @__PURE__ */ w(D, {
209
214
  value: "overview",
210
215
  className: "space-y-8",
211
216
  children: [
212
- /* @__PURE__ */ T("div", {
217
+ /* @__PURE__ */ w("div", {
213
218
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
214
219
  children: [
215
- /* @__PURE__ */ T(D, {
220
+ /* @__PURE__ */ w(E, {
216
221
  treatment: "metric",
217
222
  className: "flex flex-col gap-2 p-5",
218
- children: [/* @__PURE__ */ w("span", {
223
+ children: [/* @__PURE__ */ C("span", {
219
224
  className: "text-sm font-medium text-text-secondary",
220
225
  children: "Avg session rating"
221
- }), q == null ? /* @__PURE__ */ w("span", {
226
+ }), K == null ? /* @__PURE__ */ C("span", {
222
227
  className: "text-sm text-text-muted",
223
228
  children: "No rated sessions yet"
224
- }) : /* @__PURE__ */ w(C, { children: /* @__PURE__ */ w(i, {
225
- value: q,
229
+ }) : /* @__PURE__ */ C(S, { children: /* @__PURE__ */ C(i, {
230
+ value: K,
226
231
  max: 5,
227
232
  size: 20,
228
233
  showValue: !0,
229
- count: K.length
234
+ count: G.length
230
235
  }) })]
231
236
  }),
232
- /* @__PURE__ */ w(r, {
237
+ /* @__PURE__ */ C(r, {
233
238
  label: "Sessions",
234
- value: z.sessions.length,
235
- icon: /* @__PURE__ */ w(_, { className: "h-4 w-4" })
239
+ value: R.sessions.length,
240
+ icon: /* @__PURE__ */ C(g, { className: "h-4 w-4" })
236
241
  }),
237
- /* @__PURE__ */ w(r, {
242
+ /* @__PURE__ */ C(r, {
238
243
  label: "Completed",
239
- value: pe,
240
- icon: /* @__PURE__ */ w(le, { className: "h-4 w-4" })
244
+ value: Y,
245
+ icon: /* @__PURE__ */ C(v, { className: "h-4 w-4" })
241
246
  }),
242
- /* @__PURE__ */ w(r, {
247
+ /* @__PURE__ */ C(r, {
243
248
  label: "Workouts logged",
244
- value: z.workouts.length,
245
- icon: /* @__PURE__ */ w(v, { className: "h-4 w-4" })
249
+ value: R.workouts.length,
250
+ icon: /* @__PURE__ */ C(_, { className: "h-4 w-4" })
246
251
  })
247
252
  ]
248
253
  }),
249
- G.some((e) => e.deltaPct != null) ? /* @__PURE__ */ T("section", { children: [/* @__PURE__ */ w("h2", {
254
+ W.some((e) => e.deltaPct != null) ? /* @__PURE__ */ w("section", { children: [/* @__PURE__ */ C("h2", {
250
255
  className: "mb-4 text-lg font-semibold text-text-primary",
251
256
  children: "Improvement"
252
- }), /* @__PURE__ */ w("div", {
257
+ }), /* @__PURE__ */ C("div", {
253
258
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",
254
- children: G.filter((e) => e.deltaPct != null).slice(0, 4).map((e) => /* @__PURE__ */ w(r, {
255
- label: `${d[e.type]}${e.unit ? ` (${e.unit})` : ""}`,
259
+ children: W.filter((e) => e.deltaPct != null).slice(0, 4).map((e) => /* @__PURE__ */ C(r, {
260
+ label: `${l[e.type]}${e.unit ? ` (${e.unit})` : ""}`,
256
261
  value: e.last.toLocaleString(),
257
262
  delta: e.deltaPct ?? void 0,
258
263
  deltaLabel: "first → latest",
259
264
  sparkline: e.points.map((e) => e.value)
260
265
  }, e.type))
261
266
  })] }) : null,
262
- /* @__PURE__ */ w(R, {
267
+ /* @__PURE__ */ C(L, {
263
268
  title: "Performance trend",
264
- groups: W,
265
- primary: me,
266
- range: V,
267
- onRangeChange: H
269
+ groups: U,
270
+ primary: he,
271
+ range: B,
272
+ onRangeChange: V
268
273
  }),
269
- /* @__PURE__ */ T("section", { children: [/* @__PURE__ */ T("h2", {
274
+ /* @__PURE__ */ w("section", { children: [/* @__PURE__ */ w("h2", {
270
275
  className: "mb-4 text-lg font-semibold text-text-primary",
271
276
  children: [
272
277
  "Upcoming sessions (",
273
- J.length,
278
+ q.length,
274
279
  ")"
275
280
  ]
276
- }), J.length === 0 ? /* @__PURE__ */ w(c, {
281
+ }), q.length === 0 ? /* @__PURE__ */ C(s, {
277
282
  illustration: "empty-calendar",
278
- icon: /* @__PURE__ */ w(_, { className: "h-10 w-10" }),
283
+ icon: /* @__PURE__ */ C(g, { className: "h-10 w-10" }),
279
284
  title: "No upcoming sessions",
280
285
  description: "Confirmed and requested coaching sessions for this athlete appear here."
281
- }) : /* @__PURE__ */ w("div", {
286
+ }) : /* @__PURE__ */ C("div", {
282
287
  className: "grid grid-cols-1 gap-4 md:grid-cols-2",
283
- children: J.slice(0, 6).map((e) => /* @__PURE__ */ w(a, {
288
+ children: q.slice(0, 6).map((e) => /* @__PURE__ */ C(a, {
284
289
  session: e,
285
290
  athleteName: X.displayName,
286
- onClick: () => I(`/sessions/${e.id}`)
291
+ onClick: () => F(`/sessions/${e.id}`)
287
292
  }, e.id))
288
293
  })] })
289
294
  ]
290
295
  }),
291
- /* @__PURE__ */ T(O, {
296
+ /* @__PURE__ */ w(D, {
292
297
  value: "metrics",
293
298
  className: "space-y-8",
294
- children: [/* @__PURE__ */ T("div", {
299
+ children: [/* @__PURE__ */ w("div", {
295
300
  className: "flex flex-wrap items-center justify-between gap-3",
296
- children: [/* @__PURE__ */ w("h2", {
301
+ children: [/* @__PURE__ */ C("h2", {
297
302
  className: "text-lg font-semibold text-text-primary",
298
303
  children: "Performance metrics"
299
- }), /* @__PURE__ */ w(L, {
300
- value: V,
301
- onChange: H
304
+ }), /* @__PURE__ */ C(I, {
305
+ value: B,
306
+ onChange: V
302
307
  })]
303
- }), W.length === 0 ? /* @__PURE__ */ w(c, {
308
+ }), U.length === 0 ? /* @__PURE__ */ C(s, {
304
309
  illustration: "empty-data",
305
- icon: /* @__PURE__ */ w(oe, { className: "h-10 w-10" }),
310
+ icon: /* @__PURE__ */ C(le, { className: "h-10 w-10" }),
306
311
  title: "No metrics in this range",
307
312
  description: "Record metrics for this athlete — speed, strength, endurance — to chart progress over time."
308
- }) : /* @__PURE__ */ w("div", {
313
+ }) : /* @__PURE__ */ C("div", {
309
314
  className: "grid grid-cols-1 gap-4 lg:grid-cols-2",
310
- children: W.map((e) => /* @__PURE__ */ T(D, {
315
+ children: U.map((e) => /* @__PURE__ */ w(E, {
311
316
  treatment: "metric",
312
317
  className: "p-5",
313
318
  children: [
314
- /* @__PURE__ */ T("div", {
319
+ /* @__PURE__ */ w("div", {
315
320
  className: "mb-3 flex items-start justify-between gap-3",
316
- children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("h3", {
321
+ children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("h3", {
317
322
  className: "text-sm font-semibold uppercase tracking-wide text-text-secondary",
318
- children: d[e.type]
319
- }), /* @__PURE__ */ T("p", {
323
+ children: l[e.type]
324
+ }), /* @__PURE__ */ w("p", {
320
325
  className: "mt-1 text-2xl font-semibold tabular-nums text-text-primary",
321
- children: [e.last.toLocaleString(), e.unit ? /* @__PURE__ */ w("span", {
326
+ children: [e.last.toLocaleString(), e.unit ? /* @__PURE__ */ C("span", {
322
327
  className: "ml-1 text-sm text-text-secondary",
323
328
  children: e.unit
324
329
  }) : null]
325
- })] }), e.deltaPct == null ? null : /* @__PURE__ */ T(E, {
330
+ })] }), e.deltaPct == null ? null : /* @__PURE__ */ w(T, {
326
331
  variant: e.deltaPct >= 0 ? "default" : "destructive",
327
332
  className: "tabular-nums",
328
333
  children: [
@@ -332,16 +337,16 @@ function I() {
332
337
  ]
333
338
  })]
334
339
  }),
335
- /* @__PURE__ */ w(n, {
340
+ /* @__PURE__ */ C(n, {
336
341
  series: e.points.map((e) => ({
337
- label: P(e.recordedAt),
342
+ label: N(e.recordedAt),
338
343
  value: e.value
339
344
  })),
340
- seriesLabel: d[e.type],
345
+ seriesLabel: l[e.type],
341
346
  height: 160,
342
347
  valueFormatter: (t) => `${t.toLocaleString()}${e.unit ? ` ${e.unit}` : ""}`
343
348
  }),
344
- /* @__PURE__ */ T("p", {
349
+ /* @__PURE__ */ w("p", {
345
350
  className: "mt-2 text-xs text-text-muted tabular-nums",
346
351
  children: [
347
352
  "Peak ",
@@ -356,20 +361,20 @@ function I() {
356
361
  }, e.type))
357
362
  })]
358
363
  }),
359
- /* @__PURE__ */ w(O, {
364
+ /* @__PURE__ */ C(D, {
360
365
  value: "workouts",
361
- children: Y.length === 0 ? /* @__PURE__ */ w(c, {
366
+ children: J.length === 0 ? /* @__PURE__ */ C(s, {
362
367
  illustration: "empty-data",
363
- icon: /* @__PURE__ */ w(v, { className: "h-10 w-10" }),
368
+ icon: /* @__PURE__ */ C(_, { className: "h-10 w-10" }),
364
369
  title: "No workouts logged",
365
370
  description: "This athlete's logged training sessions will appear here."
366
- }) : /* @__PURE__ */ w(de, {
371
+ }) : /* @__PURE__ */ C(pe, {
367
372
  columns: [
368
373
  {
369
374
  key: "title",
370
375
  header: "Workout",
371
376
  priority: "primary",
372
- cell: (e) => /* @__PURE__ */ w("span", {
377
+ cell: (e) => /* @__PURE__ */ C("span", {
373
378
  className: "font-medium text-text-primary",
374
379
  children: e.title
375
380
  })
@@ -378,16 +383,16 @@ function I() {
378
383
  key: "duration",
379
384
  header: "Duration",
380
385
  priority: "secondary",
381
- cell: (e) => /* @__PURE__ */ w("span", {
386
+ cell: (e) => /* @__PURE__ */ C("span", {
382
387
  className: "tabular-nums text-text-secondary",
383
- children: e.durationMin == null ? "—" : h(e.durationMin)
388
+ children: e.durationMin == null ? "—" : ae(e.durationMin)
384
389
  })
385
390
  },
386
391
  {
387
392
  key: "load",
388
393
  header: "Load",
389
394
  priority: "hidden-on-mobile",
390
- cell: (e) => /* @__PURE__ */ w("span", {
395
+ cell: (e) => /* @__PURE__ */ C("span", {
391
396
  className: "tabular-nums text-text-secondary",
392
397
  children: e.totalLoad == null ? "—" : e.totalLoad.toLocaleString()
393
398
  })
@@ -396,7 +401,7 @@ function I() {
396
401
  key: "rpe",
397
402
  header: "RPE",
398
403
  priority: "hidden-on-mobile",
399
- cell: (e) => /* @__PURE__ */ w("span", {
404
+ cell: (e) => /* @__PURE__ */ C("span", {
400
405
  className: "tabular-nums text-text-secondary",
401
406
  children: e.rpe == null ? "—" : e.rpe
402
407
  })
@@ -405,123 +410,130 @@ function I() {
405
410
  key: "status",
406
411
  header: "Status",
407
412
  priority: "secondary",
408
- cell: (e) => /* @__PURE__ */ w(t, { status: e.status })
413
+ cell: (e) => /* @__PURE__ */ C(t, { status: e.status })
409
414
  },
410
415
  {
411
416
  key: "date",
412
417
  header: "Date",
413
418
  priority: "secondary",
414
- cell: (e) => /* @__PURE__ */ w("span", {
419
+ cell: (e) => /* @__PURE__ */ C("span", {
415
420
  className: "whitespace-nowrap text-text-secondary",
416
421
  children: m(e.performedAt)
417
422
  })
418
423
  }
419
424
  ],
420
- data: Y,
425
+ data: J,
421
426
  rowKey: (e) => e.id
422
427
  })
423
428
  }),
424
- /* @__PURE__ */ w(O, {
429
+ /* @__PURE__ */ C(D, {
425
430
  value: "sessions",
426
- children: z.sessions.length === 0 ? /* @__PURE__ */ w(c, {
431
+ children: R.sessions.length === 0 ? /* @__PURE__ */ C(s, {
427
432
  illustration: "empty-calendar",
428
- icon: /* @__PURE__ */ w(_, { className: "h-10 w-10" }),
433
+ icon: /* @__PURE__ */ C(g, { className: "h-10 w-10" }),
429
434
  title: "No coaching sessions",
430
435
  description: "Booked, completed and cancelled sessions for this athlete will appear here."
431
- }) : /* @__PURE__ */ w("div", {
436
+ }) : /* @__PURE__ */ C("div", {
432
437
  className: "grid grid-cols-1 gap-4 md:grid-cols-2",
433
- children: [...z.sessions].sort((e, t) => new Date(t.scheduledAt).getTime() - new Date(e.scheduledAt).getTime()).map((e) => /* @__PURE__ */ w(a, {
438
+ children: [...R.sessions].sort((e, t) => new Date(t.scheduledAt).getTime() - new Date(e.scheduledAt).getTime()).map((e) => /* @__PURE__ */ C(a, {
434
439
  session: e,
435
440
  athleteName: X.displayName,
436
- onClick: () => I(`/sessions/${e.id}`)
441
+ onClick: () => F(`/sessions/${e.id}`)
437
442
  }, e.id))
438
443
  })
439
444
  }),
440
- /* @__PURE__ */ w(O, {
445
+ /* @__PURE__ */ C(D, {
441
446
  value: "ai",
442
- children: X.userId ? /* @__PURE__ */ w(ee, { subject: {
447
+ children: X.userId ? /* @__PURE__ */ C(te, { subject: {
443
448
  kind: "athlete",
444
449
  athleteId: X.userId
445
- } }) : /* @__PURE__ */ w(c, {
450
+ } }) : /* @__PURE__ */ C(s, {
446
451
  illustration: "empty-data",
447
- icon: /* @__PURE__ */ w(ce, { className: "h-10 w-10" }),
452
+ icon: /* @__PURE__ */ C(de, { className: "h-10 w-10" }),
448
453
  title: "No AI decisions for this roster entry",
449
454
  description: "AI assessments are keyed to an athlete's account. Link this roster entry to a user to see the decisions made about them."
450
455
  })
456
+ }),
457
+ /* @__PURE__ */ C(D, {
458
+ value: "devices",
459
+ children: /* @__PURE__ */ C(ne, {
460
+ athleteId: X.userId || void 0,
461
+ athleteName: X.displayName
462
+ })
451
463
  })
452
464
  ]
453
465
  })]
454
466
  });
455
467
  }
456
- function L({ value: e, onChange: t }) {
457
- return /* @__PURE__ */ w("div", {
468
+ function I({ value: e, onChange: t }) {
469
+ return /* @__PURE__ */ C("div", {
458
470
  role: "group",
459
471
  "aria-label": "Trend range",
460
472
  className: "inline-flex items-center gap-1 rounded-lg border border-border-seam bg-bg-surface p-1",
461
- children: j.map((n) => {
473
+ children: A.map((n) => {
462
474
  let r = n === e;
463
- return /* @__PURE__ */ w("button", {
475
+ return /* @__PURE__ */ C("button", {
464
476
  type: "button",
465
477
  "aria-pressed": r,
466
478
  onClick: () => t(n),
467
479
  className: r ? "rounded-md bg-action-primary-bg px-2.5 py-1 text-xs font-medium text-action-primary-text" : "rounded-md px-2.5 py-1 text-xs font-medium text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary",
468
- children: M[n]
480
+ children: j[n]
469
481
  }, n);
470
482
  })
471
483
  });
472
484
  }
473
- function R({ title: e, groups: t, primary: r, range: i, onRangeChange: a }) {
485
+ function L({ title: e, groups: t, primary: r, range: i, onRangeChange: a }) {
474
486
  let o = t.find((e) => e.type !== r?.type) ?? null;
475
- return /* @__PURE__ */ T(D, {
487
+ return /* @__PURE__ */ w(E, {
476
488
  treatment: "metric",
477
489
  className: "p-5",
478
- children: [/* @__PURE__ */ T("div", {
490
+ children: [/* @__PURE__ */ w("div", {
479
491
  className: "mb-4 flex flex-wrap items-center justify-between gap-3",
480
- children: [/* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("h2", {
492
+ children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("h2", {
481
493
  className: "text-lg font-semibold text-text-primary",
482
494
  children: e
483
- }), r ? /* @__PURE__ */ T("div", {
495
+ }), r ? /* @__PURE__ */ w("div", {
484
496
  className: "mt-1 flex flex-wrap items-center gap-x-4 gap-y-1 text-xs text-text-secondary",
485
- children: [/* @__PURE__ */ T("span", {
497
+ children: [/* @__PURE__ */ w("span", {
486
498
  className: "inline-flex items-center gap-1.5",
487
499
  children: [
488
- /* @__PURE__ */ w("span", {
500
+ /* @__PURE__ */ C("span", {
489
501
  className: "h-2 w-2 rounded-full bg-[var(--color-accent-primary)]",
490
502
  "aria-hidden": "true"
491
503
  }),
492
- d[r.type],
504
+ l[r.type],
493
505
  r.unit ? ` (${r.unit})` : ""
494
506
  ]
495
- }), o ? /* @__PURE__ */ T("span", {
507
+ }), o ? /* @__PURE__ */ w("span", {
496
508
  className: "inline-flex items-center gap-1.5",
497
509
  children: [
498
- /* @__PURE__ */ w("span", {
510
+ /* @__PURE__ */ C("span", {
499
511
  className: "h-2 w-2 rounded-full bg-[var(--color-accent-teal)]",
500
512
  "aria-hidden": "true"
501
513
  }),
502
- d[o.type],
514
+ l[o.type],
503
515
  o.unit ? ` (${o.unit})` : ""
504
516
  ]
505
517
  }) : null]
506
- }) : null] }), /* @__PURE__ */ w(L, {
518
+ }) : null] }), /* @__PURE__ */ C(I, {
507
519
  value: i,
508
520
  onChange: a
509
521
  })]
510
- }), r ? /* @__PURE__ */ w(n, {
522
+ }), r ? /* @__PURE__ */ C(n, {
511
523
  series: r.points.map((e) => ({
512
- label: P(e.recordedAt),
524
+ label: N(e.recordedAt),
513
525
  value: e.value
514
526
  })),
515
527
  compare: o ? o.points.map((e) => e.value) : void 0,
516
- seriesLabel: d[r.type],
517
- compareLabel: o ? d[o.type] : void 0,
528
+ seriesLabel: l[r.type],
529
+ compareLabel: o ? l[o.type] : void 0,
518
530
  height: 240
519
- }) : /* @__PURE__ */ w("div", {
531
+ }) : /* @__PURE__ */ C("div", {
520
532
  className: "flex h-40 items-center justify-center text-sm text-text-muted",
521
533
  children: "No metric readings in this range."
522
534
  })]
523
535
  });
524
536
  }
525
- export { I as AthleteProfilePage };
537
+ export { F as AthleteProfilePage };
526
538
 
527
539
  //# sourceMappingURL=AthleteProfilePage.js.map