@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.
- package/dist/atheletebridge/AthleteBridgeRoot.js +71 -55
- package/dist/atheletebridge/AthleteBridgeRoot.js.map +1 -1
- package/dist/atheletebridge/AthleteBridgeRoutes.js +30 -6
- package/dist/atheletebridge/AthleteBridgeRoutes.js.map +1 -1
- package/dist/atheletebridge/components/MatchupRow.js +11 -2
- package/dist/atheletebridge/components/MatchupRow.js.map +1 -1
- package/dist/atheletebridge/components/analytics/AiInsightsPanel.d.ts +5 -0
- package/dist/atheletebridge/components/analytics/AiInsightsPanel.js +617 -0
- package/dist/atheletebridge/components/analytics/AiInsightsPanel.js.map +1 -0
- package/dist/atheletebridge/components/wearables/ConnectedDevicesPanel.d.ts +5 -0
- package/dist/atheletebridge/components/wearables/ConnectedDevicesPanel.js +453 -0
- package/dist/atheletebridge/components/wearables/ConnectedDevicesPanel.js.map +1 -0
- package/dist/atheletebridge/hooks/index.d.ts +2 -0
- package/dist/atheletebridge/hooks/index.js +1 -0
- package/dist/atheletebridge/hooks/useInsightsWearablesMarketplaceApi.d.ts +62 -0
- package/dist/atheletebridge/hooks/useInsightsWearablesMarketplaceApi.js +362 -0
- package/dist/atheletebridge/hooks/useInsightsWearablesMarketplaceApi.js.map +1 -0
- package/dist/atheletebridge/pages/DashboardPage.js +71 -1
- package/dist/atheletebridge/pages/DashboardPage.js.map +1 -1
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.d.ts +3 -1
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.js +346 -317
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.js.map +1 -1
- package/dist/atheletebridge/pages/athletes/AthleteProfilePage.js +171 -159
- package/dist/atheletebridge/pages/athletes/AthleteProfilePage.js.map +1 -1
- package/dist/atheletebridge/pages/devices/ConnectedDevicesPage.d.ts +1 -0
- package/dist/atheletebridge/pages/devices/ConnectedDevicesPage.js +14 -0
- package/dist/atheletebridge/pages/devices/ConnectedDevicesPage.js.map +1 -0
- package/dist/atheletebridge/pages/marketplace/MarketplacePage.d.ts +1 -0
- package/dist/atheletebridge/pages/marketplace/MarketplacePage.js +756 -0
- package/dist/atheletebridge/pages/marketplace/MarketplacePage.js.map +1 -0
- package/dist/atheletebridge/pages/performance/PerformancePage.js +296 -277
- package/dist/atheletebridge/pages/performance/PerformancePage.js.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionDetailPage.js +279 -147
- package/dist/atheletebridge/pages/sessions/SessionDetailPage.js.map +1 -1
- package/dist/atheletebridge/types/index.d.ts +1 -0
- package/dist/atheletebridge/types/insights.d.ts +270 -0
- package/package.json +1 -1
|
@@ -1,80 +1,81 @@
|
|
|
1
1
|
import { PageLayout as e } from "../../components/PageLayout.js";
|
|
2
2
|
import { AthleteSelect as t } from "../../components/AthleteSelect.js";
|
|
3
3
|
import { StatusBadge as n } from "../../components/StatusBadge.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { EmptyState as r } from "../../components/EmptyState.js";
|
|
5
|
+
import { Sparkline as i } from "../../components/viz/Sparkline.js";
|
|
6
6
|
import { ErrorState as a, LoadingState as o } from "../../components/LoadingState.js";
|
|
7
7
|
import { CursorPager as s } from "../../components/CursorPager.js";
|
|
8
8
|
import { FilterSelect as c } from "../../components/FilterSelect.js";
|
|
9
9
|
import "../../components/viz/index.js";
|
|
10
10
|
import { FormField as l, fieldInputClass as u } from "../../components/form.js";
|
|
11
11
|
import { METRIC_TYPE_LABELS as d } from "../../components/domain.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
12
|
+
import { useAthleteBridge as f } from "../../context/AthleteBridgeContext.js";
|
|
13
|
+
import { useAbTranslate as p } from "../../i18n.js";
|
|
14
|
+
import { useLogWorkout as m, usePerformanceMetrics as h, useRecordMetric as g, useWorkoutLogs as _ } from "../../hooks/useAthleteBridgeApi.js";
|
|
15
|
+
import { formatDate as v, formatDuration as y } from "../../utils/formatters.js";
|
|
16
|
+
import { cn as b } from "../../utils/cn.js";
|
|
17
|
+
import { useMemo as x, useState as S } from "react";
|
|
18
|
+
import { Activity as C, ArrowDown as w, ArrowUp as T, CalendarRange as E, Dumbbell as D, Gauge as O, HeartPulse as k, Loader2 as A, Move as j, Plus as M, Save as N, Scale as P, Target as F, Users as ee, Watch as I, Zap as L } from "lucide-react";
|
|
19
|
+
import { Fragment as R, jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
20
|
+
import { GlassCard as V, ResponsiveDialog as H, ResponsiveDialogContent as U, ResponsiveDialogFooter as W, ResponsiveDialogHeader as G, ResponsiveDialogTitle as K, ResponsiveTable as te } from "@burdenoff/fe-libs/ui";
|
|
20
21
|
// src/atheletebridge/pages/performance/PerformancePage.tsx
|
|
21
|
-
var
|
|
22
|
+
var q = 10, ne = [
|
|
22
23
|
"COMPLETED",
|
|
23
24
|
"PLANNED",
|
|
24
25
|
"SKIPPED"
|
|
25
|
-
],
|
|
26
|
+
], re = Object.keys(d), ie = 100, ae = { limit: 100 }, oe = [
|
|
26
27
|
"7d",
|
|
27
28
|
"28d",
|
|
28
29
|
"90d"
|
|
29
|
-
],
|
|
30
|
+
], se = {
|
|
30
31
|
"7d": 7,
|
|
31
32
|
"28d": 28,
|
|
32
33
|
"90d": 90
|
|
33
|
-
},
|
|
34
|
+
}, J = (e) => {
|
|
34
35
|
let t = /* @__PURE__ */ new Date();
|
|
35
36
|
t.setHours(23, 59, 59, 999);
|
|
36
37
|
let n = new Date(t);
|
|
37
|
-
return n.setHours(0, 0, 0, 0), n.setDate(n.getDate() - (
|
|
38
|
+
return n.setHours(0, 0, 0, 0), n.setDate(n.getDate() - (se[e] - 1)), {
|
|
38
39
|
start: n.getTime(),
|
|
39
40
|
end: t.getTime()
|
|
40
41
|
};
|
|
41
|
-
},
|
|
42
|
+
}, Y = (e) => new Date(e).getTime(), ce = (e) => v(new Date(e), {
|
|
42
43
|
hour: void 0,
|
|
43
44
|
minute: void 0,
|
|
44
45
|
hour12: void 0
|
|
45
|
-
}),
|
|
46
|
+
}), le = (e) => `${ce(e.start)} – ${ce(e.end)}`, ue = (e, t) => {
|
|
46
47
|
switch (e) {
|
|
47
48
|
case "7d": return t("atheletebridge.pages.performance.window.last7", "Last 7 days");
|
|
48
49
|
case "28d": return t("atheletebridge.pages.performance.window.last28", "Last 28 days");
|
|
49
50
|
case "90d": return t("atheletebridge.pages.performance.window.last90", "Last 90 days");
|
|
50
51
|
}
|
|
51
|
-
},
|
|
52
|
+
}, de = (e, t) => {
|
|
52
53
|
switch (e) {
|
|
53
54
|
case "7d": return t("atheletebridge.pages.performance.window.vsLast7", "vs previous 7 days");
|
|
54
55
|
case "28d": return t("atheletebridge.pages.performance.window.vsLast28", "vs previous 28 days");
|
|
55
56
|
case "90d": return t("atheletebridge.pages.performance.window.vsLast90", "vs previous 90 days");
|
|
56
57
|
}
|
|
57
|
-
},
|
|
58
|
+
}, fe = (e, t) => {
|
|
58
59
|
switch (e) {
|
|
59
60
|
case "7d": return t("atheletebridge.pages.performance.window.noPrior7", "No reading in the previous 7 days");
|
|
60
61
|
case "28d": return t("atheletebridge.pages.performance.window.noPrior28", "No reading in the previous 28 days");
|
|
61
62
|
case "90d": return t("atheletebridge.pages.performance.window.noPrior90", "No reading in the previous 90 days");
|
|
62
63
|
}
|
|
63
|
-
},
|
|
64
|
-
SPEED:
|
|
65
|
-
ENDURANCE:
|
|
66
|
-
STRENGTH:
|
|
67
|
-
AGILITY:
|
|
68
|
-
ACCURACY:
|
|
69
|
-
WEIGHT:
|
|
70
|
-
HEART_RATE:
|
|
71
|
-
CUSTOM:
|
|
72
|
-
},
|
|
64
|
+
}, X = "inline-flex items-center justify-center gap-1.5 rounded-lg px-4 py-2 text-sm font-semibold text-action-primary-text shadow-elevation-1 transition-[filter,box-shadow] hover:shadow-elevation-2 hover:brightness-110 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] bg-[linear-gradient(120deg,var(--color-action-primary-bg),color-mix(in_oklab,var(--color-action-primary-bg)_62%,var(--color-accent-purple)),var(--color-action-primary-bg))]", pe = {
|
|
65
|
+
SPEED: L,
|
|
66
|
+
ENDURANCE: C,
|
|
67
|
+
STRENGTH: D,
|
|
68
|
+
AGILITY: j,
|
|
69
|
+
ACCURACY: F,
|
|
70
|
+
WEIGHT: P,
|
|
71
|
+
HEART_RATE: k,
|
|
72
|
+
CUSTOM: O
|
|
73
|
+
}, me = (e) => {
|
|
73
74
|
let t = e.trim();
|
|
74
75
|
if (!t) return;
|
|
75
76
|
let n = Number.parseInt(t, 10);
|
|
76
77
|
return Number.isNaN(n) ? void 0 : n;
|
|
77
|
-
},
|
|
78
|
+
}, Z = (e) => {
|
|
78
79
|
let t = e.trim();
|
|
79
80
|
if (!t) return;
|
|
80
81
|
let n = Number.parseFloat(t);
|
|
@@ -83,80 +84,89 @@ var K = 10, q = [
|
|
|
83
84
|
let e = /* @__PURE__ */ new Date();
|
|
84
85
|
return (/* @__PURE__ */ new Date(e.getTime() - e.getTimezoneOffset() * 6e4)).toISOString().slice(0, 16);
|
|
85
86
|
}, $ = (e) => (Math.abs(e) >= 100 ? e.toFixed(0) : e.toFixed(2)).replace(/\.?0+$/, "");
|
|
86
|
-
function
|
|
87
|
-
let n = f(), [
|
|
87
|
+
function he() {
|
|
88
|
+
let n = p(), { navigateTo: i } = f(), [a, o] = S({
|
|
88
89
|
athleteId: "",
|
|
89
90
|
displayName: ""
|
|
90
91
|
});
|
|
91
|
-
return /* @__PURE__ */
|
|
92
|
+
return /* @__PURE__ */ B(e, {
|
|
92
93
|
title: n("atheletebridge.pages.performance.title", "Performance"),
|
|
93
|
-
description: n("atheletebridge.pages.performance.description", "
|
|
94
|
-
|
|
94
|
+
description: n("atheletebridge.pages.performance.description", "Track. Analyze. Improve — log workouts, record metrics and review an athlete's progress over time."),
|
|
95
|
+
actions: /* @__PURE__ */ B("button", {
|
|
96
|
+
type: "button",
|
|
97
|
+
onClick: () => i("/devices"),
|
|
98
|
+
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",
|
|
99
|
+
children: [/* @__PURE__ */ z(I, {
|
|
100
|
+
className: "h-4 w-4",
|
|
101
|
+
"aria-hidden": "true"
|
|
102
|
+
}), n("atheletebridge.pages.performance.connectedDevices", "Connected devices")]
|
|
103
|
+
}),
|
|
104
|
+
children: [/* @__PURE__ */ z("div", {
|
|
95
105
|
"data-tour": "performance-athlete-picker",
|
|
96
106
|
className: "sticky top-0 z-20 -mx-6 mb-8 bg-bg-canvas/80 px-6 pb-4 pt-1 backdrop-blur supports-[backdrop-filter]:bg-bg-canvas/60",
|
|
97
|
-
children: /* @__PURE__ */
|
|
107
|
+
children: /* @__PURE__ */ z(V, {
|
|
98
108
|
treatment: "insight",
|
|
99
109
|
className: "p-5 sm:p-6",
|
|
100
|
-
children: /* @__PURE__ */
|
|
101
|
-
athleteId:
|
|
102
|
-
onSelect:
|
|
110
|
+
children: /* @__PURE__ */ z(t, {
|
|
111
|
+
athleteId: a.athleteId,
|
|
112
|
+
onSelect: o,
|
|
103
113
|
idPrefix: "perf-athlete"
|
|
104
114
|
})
|
|
105
115
|
})
|
|
106
|
-
}),
|
|
107
|
-
athleteId:
|
|
108
|
-
displayName:
|
|
109
|
-
}) : /* @__PURE__ */
|
|
116
|
+
}), a.athleteId ? /* @__PURE__ */ z(ge, {
|
|
117
|
+
athleteId: a.athleteId,
|
|
118
|
+
displayName: a.displayName
|
|
119
|
+
}) : /* @__PURE__ */ z(r, {
|
|
110
120
|
illustration: "empty-data",
|
|
111
|
-
icon: /* @__PURE__ */
|
|
121
|
+
icon: /* @__PURE__ */ z(ee, { className: "h-10 w-10" }),
|
|
112
122
|
title: n("atheletebridge.pages.performance.pickAthleteTitle", "Pick an athlete to begin"),
|
|
113
123
|
description: n("atheletebridge.pages.performance.pickAthleteHint", "Choose a team and an athlete above to log workouts, record metrics and review their history.")
|
|
114
124
|
})]
|
|
115
125
|
});
|
|
116
126
|
}
|
|
117
|
-
function
|
|
118
|
-
let
|
|
127
|
+
function ge({ athleteId: e, displayName: t }) {
|
|
128
|
+
let i = p(), [l, u] = S(0), [d, f] = S(""), [m, g] = S(!1), [w, T] = S(!1), k = x(() => d === "" ? null : J(d), [d]), A = _({
|
|
119
129
|
athleteId: e,
|
|
120
|
-
pagination: k ? { limit:
|
|
121
|
-
limit:
|
|
122
|
-
offset: l *
|
|
130
|
+
pagination: k ? { limit: ie } : {
|
|
131
|
+
limit: q,
|
|
132
|
+
offset: l * q
|
|
123
133
|
}
|
|
124
|
-
}),
|
|
125
|
-
let t =
|
|
134
|
+
}), j = h(e, ae), N = x(() => A.data?.items ?? [], [A.data]), P = A.data?.pageInfo.hasMore ?? !1, F = x(() => k ? N.filter((e) => {
|
|
135
|
+
let t = Y(e.performedAt);
|
|
126
136
|
return t >= k.start && t <= k.end;
|
|
127
|
-
}) : N, [N, k]),
|
|
137
|
+
}) : N, [N, k]), ee = k ? Math.max(0, Math.ceil(F.length / q) - 1) : l, I = Math.min(l, ee), L = k ? F.slice(I * q, (I + 1) * q) : F, H = k ? F.length > (I + 1) * q : P, U = x(() => {
|
|
128
138
|
if (!k || !P) return !0;
|
|
129
139
|
let e = N[N.length - 1];
|
|
130
|
-
return e != null &&
|
|
140
|
+
return e != null && Y(e.performedAt) <= k.start;
|
|
131
141
|
}, [
|
|
132
142
|
k,
|
|
133
143
|
P,
|
|
134
144
|
N
|
|
135
|
-
]),
|
|
145
|
+
]), W = x(() => oe.map((e) => ({
|
|
136
146
|
value: e,
|
|
137
|
-
label: `${
|
|
138
|
-
})), [
|
|
139
|
-
comparison:
|
|
140
|
-
noComparison:
|
|
147
|
+
label: `${ue(e, i)} · ${le(J(e))}`
|
|
148
|
+
})), [i]), G = x(() => d === "" ? {
|
|
149
|
+
comparison: i("atheletebridge.pages.performance.window.vsPrevious", "vs previous"),
|
|
150
|
+
noComparison: i("atheletebridge.pages.performance.window.firstReading", "First reading")
|
|
141
151
|
} : {
|
|
142
|
-
comparison:
|
|
143
|
-
noComparison:
|
|
144
|
-
}, [d,
|
|
152
|
+
comparison: de(d, i),
|
|
153
|
+
noComparison: fe(d, i)
|
|
154
|
+
}, [d, i]), K = x(() => {
|
|
145
155
|
let e = /* @__PURE__ */ new Map();
|
|
146
|
-
for (let t of
|
|
156
|
+
for (let t of j.data ?? []) {
|
|
147
157
|
let n = `${t.type}::${t.label}`, r = e.get(n) ?? [];
|
|
148
158
|
r.push(t), e.set(n, r);
|
|
149
159
|
}
|
|
150
160
|
return Array.from(e.entries()).map(([e, t]) => {
|
|
151
|
-
let n = [...t].sort((e, t) =>
|
|
152
|
-
let t =
|
|
161
|
+
let n = [...t].sort((e, t) => Y(e.recordedAt) - Y(t.recordedAt)), r = k ? n.filter((e) => {
|
|
162
|
+
let t = Y(e.recordedAt);
|
|
153
163
|
return t >= k.start && t <= k.end;
|
|
154
164
|
}) : n;
|
|
155
165
|
if (r.length === 0) return null;
|
|
156
166
|
let i = r.map((e) => e.value), a = r[r.length - 1], o = null;
|
|
157
167
|
if (k) {
|
|
158
168
|
let e = k.start - (k.end - k.start + 1), t = n.filter((t) => {
|
|
159
|
-
let n =
|
|
169
|
+
let n = Y(t.recordedAt);
|
|
160
170
|
return n >= e && n < k.start;
|
|
161
171
|
});
|
|
162
172
|
o = t.length > 0 ? t[t.length - 1].value : null;
|
|
@@ -173,23 +183,23 @@ function me({ athleteId: e, displayName: t }) {
|
|
|
173
183
|
series: i,
|
|
174
184
|
recordedAt: a.recordedAt
|
|
175
185
|
};
|
|
176
|
-
}).filter((e) => e !== null).sort((e, t) =>
|
|
177
|
-
}, [
|
|
186
|
+
}).filter((e) => e !== null).sort((e, t) => Y(t.recordedAt) - Y(e.recordedAt));
|
|
187
|
+
}, [j.data, k]), ne = x(() => [
|
|
178
188
|
{
|
|
179
189
|
key: "workout",
|
|
180
|
-
header:
|
|
190
|
+
header: i("atheletebridge.pages.performance.column.workout", "Workout"),
|
|
181
191
|
priority: "primary",
|
|
182
192
|
cell: (e) => {
|
|
183
|
-
let t =
|
|
184
|
-
return /* @__PURE__ */
|
|
193
|
+
let t = _e(e.title);
|
|
194
|
+
return /* @__PURE__ */ B("div", {
|
|
185
195
|
className: "flex items-center gap-3",
|
|
186
|
-
children: [/* @__PURE__ */
|
|
196
|
+
children: [/* @__PURE__ */ z("span", {
|
|
187
197
|
className: "flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-[var(--color-accent-teal)]",
|
|
188
|
-
children: /* @__PURE__ */
|
|
198
|
+
children: /* @__PURE__ */ z(t, {
|
|
189
199
|
className: "h-4 w-4",
|
|
190
200
|
"aria-hidden": "true"
|
|
191
201
|
})
|
|
192
|
-
}), /* @__PURE__ */
|
|
202
|
+
}), /* @__PURE__ */ z("span", {
|
|
193
203
|
className: "min-w-0 truncate font-medium text-text-primary",
|
|
194
204
|
children: e.title
|
|
195
205
|
})]
|
|
@@ -198,234 +208,234 @@ function me({ athleteId: e, displayName: t }) {
|
|
|
198
208
|
},
|
|
199
209
|
{
|
|
200
210
|
key: "duration",
|
|
201
|
-
header:
|
|
211
|
+
header: i("atheletebridge.pages.performance.column.duration", "Duration"),
|
|
202
212
|
priority: "secondary",
|
|
203
|
-
mobileLabel:
|
|
204
|
-
cell: (e) => e.durationMin == null ? /* @__PURE__ */
|
|
213
|
+
mobileLabel: i("atheletebridge.pages.performance.column.duration", "Duration"),
|
|
214
|
+
cell: (e) => e.durationMin == null ? /* @__PURE__ */ z("span", {
|
|
205
215
|
className: "text-text-muted",
|
|
206
216
|
children: "—"
|
|
207
|
-
}) : /* @__PURE__ */
|
|
217
|
+
}) : /* @__PURE__ */ z("span", {
|
|
208
218
|
className: "tabular-nums text-text-secondary",
|
|
209
|
-
children:
|
|
219
|
+
children: y(e.durationMin)
|
|
210
220
|
})
|
|
211
221
|
},
|
|
212
222
|
{
|
|
213
223
|
key: "rpe",
|
|
214
|
-
header:
|
|
224
|
+
header: i("atheletebridge.pages.performance.column.rpe", "RPE"),
|
|
215
225
|
priority: "secondary",
|
|
216
|
-
mobileLabel:
|
|
217
|
-
cell: (e) => e.rpe == null ? /* @__PURE__ */
|
|
226
|
+
mobileLabel: i("atheletebridge.pages.performance.column.rpe", "RPE"),
|
|
227
|
+
cell: (e) => e.rpe == null ? /* @__PURE__ */ z("span", {
|
|
218
228
|
className: "text-text-muted",
|
|
219
229
|
children: "—"
|
|
220
|
-
}) : /* @__PURE__ */
|
|
230
|
+
}) : /* @__PURE__ */ z(ve, { rpe: e.rpe })
|
|
221
231
|
},
|
|
222
232
|
{
|
|
223
233
|
key: "date",
|
|
224
|
-
header:
|
|
234
|
+
header: i("atheletebridge.pages.performance.column.date", "Date"),
|
|
225
235
|
priority: "secondary",
|
|
226
|
-
mobileLabel:
|
|
227
|
-
cell: (e) => /* @__PURE__ */
|
|
236
|
+
mobileLabel: i("atheletebridge.pages.performance.column.date", "Date"),
|
|
237
|
+
cell: (e) => /* @__PURE__ */ z("span", {
|
|
228
238
|
className: "tabular-nums text-text-secondary",
|
|
229
|
-
children:
|
|
239
|
+
children: v(e.performedAt)
|
|
230
240
|
})
|
|
231
241
|
},
|
|
232
242
|
{
|
|
233
243
|
key: "status",
|
|
234
|
-
header:
|
|
244
|
+
header: i("atheletebridge.pages.performance.column.status", "Status"),
|
|
235
245
|
priority: "primary",
|
|
236
|
-
mobileLabel:
|
|
237
|
-
cell: (e) => /* @__PURE__ */
|
|
246
|
+
mobileLabel: i("atheletebridge.pages.performance.column.status", "Status"),
|
|
247
|
+
cell: (e) => /* @__PURE__ */ z(n, { status: e.status })
|
|
238
248
|
},
|
|
239
249
|
{
|
|
240
250
|
key: "notes",
|
|
241
|
-
header:
|
|
251
|
+
header: i("atheletebridge.pages.performance.column.notes", "Notes"),
|
|
242
252
|
priority: "hidden-on-mobile",
|
|
243
|
-
cell: (e) => e.notes ? /* @__PURE__ */
|
|
253
|
+
cell: (e) => e.notes ? /* @__PURE__ */ z("span", {
|
|
244
254
|
className: "line-clamp-2 max-w-[22ch] text-text-secondary",
|
|
245
255
|
children: e.notes
|
|
246
|
-
}) : /* @__PURE__ */
|
|
256
|
+
}) : /* @__PURE__ */ z("span", {
|
|
247
257
|
className: "text-text-muted",
|
|
248
258
|
children: "—"
|
|
249
259
|
})
|
|
250
260
|
}
|
|
251
|
-
], [
|
|
252
|
-
return /* @__PURE__ */
|
|
261
|
+
], [i]);
|
|
262
|
+
return /* @__PURE__ */ B("div", {
|
|
253
263
|
className: "space-y-8 pb-24 sm:pb-0",
|
|
254
264
|
children: [
|
|
255
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ B("div", {
|
|
256
266
|
className: "flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",
|
|
257
|
-
children: [/* @__PURE__ */
|
|
267
|
+
children: [/* @__PURE__ */ B("p", {
|
|
258
268
|
className: "text-sm text-text-secondary",
|
|
259
269
|
children: [
|
|
260
|
-
|
|
270
|
+
i("atheletebridge.pages.performance.tracking", "Tracking"),
|
|
261
271
|
" ",
|
|
262
|
-
/* @__PURE__ */
|
|
272
|
+
/* @__PURE__ */ z("span", {
|
|
263
273
|
className: "font-medium text-text-primary",
|
|
264
|
-
children: t ||
|
|
274
|
+
children: t || i("atheletebridge.pages.performance.athleteFallback", "athlete")
|
|
265
275
|
}),
|
|
266
|
-
k ? /* @__PURE__ */
|
|
276
|
+
k ? /* @__PURE__ */ B(R, { children: [" · ", /* @__PURE__ */ z("span", {
|
|
267
277
|
className: "tabular-nums text-text-muted",
|
|
268
|
-
children:
|
|
278
|
+
children: le(k)
|
|
269
279
|
})] }) : null
|
|
270
280
|
]
|
|
271
|
-
}), /* @__PURE__ */
|
|
281
|
+
}), /* @__PURE__ */ B("div", {
|
|
272
282
|
className: "flex flex-wrap items-center gap-2",
|
|
273
283
|
children: [
|
|
274
|
-
/* @__PURE__ */
|
|
284
|
+
/* @__PURE__ */ B("span", {
|
|
275
285
|
className: "flex items-center gap-2",
|
|
276
286
|
"data-tour": "performance-date-range",
|
|
277
|
-
children: [/* @__PURE__ */
|
|
287
|
+
children: [/* @__PURE__ */ z(E, {
|
|
278
288
|
className: "h-4 w-4 shrink-0 text-text-muted",
|
|
279
289
|
"aria-hidden": "true"
|
|
280
|
-
}), /* @__PURE__ */
|
|
290
|
+
}), /* @__PURE__ */ z(c, {
|
|
281
291
|
value: d,
|
|
282
292
|
onChange: (e) => {
|
|
283
|
-
|
|
293
|
+
f(e), u(0);
|
|
284
294
|
},
|
|
285
|
-
options:
|
|
286
|
-
allLabel:
|
|
287
|
-
ariaLabel:
|
|
295
|
+
options: W,
|
|
296
|
+
allLabel: i("atheletebridge.pages.performance.window.allTime", "All time"),
|
|
297
|
+
ariaLabel: i("atheletebridge.pages.performance.window.ariaLabel", "Date range")
|
|
288
298
|
})]
|
|
289
299
|
}),
|
|
290
|
-
/* @__PURE__ */
|
|
300
|
+
/* @__PURE__ */ B("button", {
|
|
291
301
|
type: "button",
|
|
292
|
-
onClick: () =>
|
|
302
|
+
onClick: () => T(!0),
|
|
293
303
|
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
|
|
294
304
|
children: [
|
|
295
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ z(O, { className: "h-4 w-4" }),
|
|
296
306
|
" ",
|
|
297
|
-
|
|
307
|
+
i("atheletebridge.pages.performance.recordMetric", "Record metric")
|
|
298
308
|
]
|
|
299
309
|
}),
|
|
300
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ B("button", {
|
|
301
311
|
type: "button",
|
|
302
|
-
onClick: () =>
|
|
303
|
-
className:
|
|
312
|
+
onClick: () => g(!0),
|
|
313
|
+
className: b(X, "hidden sm:inline-flex"),
|
|
304
314
|
children: [
|
|
305
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ z(D, { className: "h-4 w-4" }),
|
|
306
316
|
" ",
|
|
307
|
-
|
|
317
|
+
i("atheletebridge.pages.performance.logWorkout", "Log workout")
|
|
308
318
|
]
|
|
309
319
|
})
|
|
310
320
|
]
|
|
311
321
|
})]
|
|
312
322
|
}),
|
|
313
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ B("section", { children: [/* @__PURE__ */ z("h2", {
|
|
314
324
|
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
315
|
-
children:
|
|
316
|
-
}),
|
|
325
|
+
children: i("atheletebridge.pages.performance.metricsTitle", "Performance metrics")
|
|
326
|
+
}), j.isLoading ? /* @__PURE__ */ z(o, { label: i("atheletebridge.pages.performance.loadingMetrics", "Loading metrics…") }) : j.isError ? /* @__PURE__ */ z(a, { onRetry: () => void j.refetch() }) : K.length === 0 ? /* @__PURE__ */ z(r, {
|
|
317
327
|
illustration: "empty-data",
|
|
318
|
-
icon: /* @__PURE__ */
|
|
319
|
-
title: k ?
|
|
320
|
-
description: k ?
|
|
321
|
-
action: /* @__PURE__ */
|
|
328
|
+
icon: /* @__PURE__ */ z(O, { className: "h-10 w-10" }),
|
|
329
|
+
title: k ? i("atheletebridge.pages.performance.metrics.emptyWindowTitle", "No metrics in this window") : i("atheletebridge.pages.performance.metrics.emptyTitle", "No metrics recorded"),
|
|
330
|
+
description: k ? i("atheletebridge.pages.performance.metrics.emptyWindowDescription", "Nothing was recorded for this athlete in the selected period. Widen the date range, or record a metric.") : i("atheletebridge.pages.performance.noMetricsDescription", "Record a metric — speed, strength, endurance and more — to start charting progress."),
|
|
331
|
+
action: /* @__PURE__ */ B("button", {
|
|
322
332
|
type: "button",
|
|
323
|
-
onClick: () =>
|
|
324
|
-
className:
|
|
333
|
+
onClick: () => T(!0),
|
|
334
|
+
className: X,
|
|
325
335
|
children: [
|
|
326
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ z(M, { className: "h-4 w-4" }),
|
|
327
337
|
" ",
|
|
328
|
-
|
|
338
|
+
i("atheletebridge.pages.performance.recordMetricAction", "Record metric")
|
|
329
339
|
]
|
|
330
340
|
})
|
|
331
|
-
}) : /* @__PURE__ */
|
|
332
|
-
className: "grid grid-cols-
|
|
333
|
-
children:
|
|
341
|
+
}) : /* @__PURE__ */ z("div", {
|
|
342
|
+
className: "grid grid-cols-2 gap-3 sm:gap-4 lg:grid-cols-3",
|
|
343
|
+
children: K.map((e) => /* @__PURE__ */ z(ye, {
|
|
334
344
|
metric: e,
|
|
335
|
-
labels:
|
|
336
|
-
tr:
|
|
345
|
+
labels: G,
|
|
346
|
+
tr: i
|
|
337
347
|
}, e.key))
|
|
338
348
|
})] }),
|
|
339
|
-
/* @__PURE__ */
|
|
340
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ B("section", { children: [
|
|
350
|
+
/* @__PURE__ */ z("h2", {
|
|
341
351
|
className: "mb-4 text-lg font-semibold text-text-primary",
|
|
342
|
-
children:
|
|
352
|
+
children: i("atheletebridge.pages.performance.workoutsTitle", "Workout history")
|
|
343
353
|
}),
|
|
344
|
-
A.isLoading ? /* @__PURE__ */
|
|
354
|
+
A.isLoading ? /* @__PURE__ */ z(o, { label: i("atheletebridge.pages.performance.loadingWorkouts", "Loading workouts…") }) : A.isError ? /* @__PURE__ */ z(a, { onRetry: () => void A.refetch() }) : L.length === 0 ? /* @__PURE__ */ z(r, {
|
|
345
355
|
illustration: "empty-data",
|
|
346
|
-
icon: /* @__PURE__ */
|
|
347
|
-
title: k ?
|
|
348
|
-
description: k ?
|
|
349
|
-
action: /* @__PURE__ */
|
|
356
|
+
icon: /* @__PURE__ */ z(C, { className: "h-10 w-10" }),
|
|
357
|
+
title: k ? i("atheletebridge.pages.performance.workouts.emptyWindowTitle", "No workouts in this window") : i("atheletebridge.pages.performance.workouts.emptyTitle", "No workouts logged"),
|
|
358
|
+
description: k ? i("atheletebridge.pages.performance.workouts.emptyWindowDescription", "Nothing was logged for this athlete in the selected period. Widen the date range, or log a workout.") : i("atheletebridge.pages.performance.noWorkoutsDescription", "Log a workout to build this athlete's training history."),
|
|
359
|
+
action: /* @__PURE__ */ B("button", {
|
|
350
360
|
type: "button",
|
|
351
|
-
onClick: () =>
|
|
352
|
-
className:
|
|
361
|
+
onClick: () => g(!0),
|
|
362
|
+
className: X,
|
|
353
363
|
children: [
|
|
354
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ z(D, { className: "h-4 w-4" }),
|
|
355
365
|
" ",
|
|
356
|
-
|
|
366
|
+
i("atheletebridge.pages.performance.logWorkout", "Log workout")
|
|
357
367
|
]
|
|
358
368
|
})
|
|
359
|
-
}) : /* @__PURE__ */
|
|
369
|
+
}) : /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ z(V, {
|
|
360
370
|
treatment: "metric",
|
|
361
371
|
className: "overflow-hidden p-1 sm:p-2",
|
|
362
|
-
children: /* @__PURE__ */
|
|
363
|
-
columns:
|
|
364
|
-
data:
|
|
372
|
+
children: /* @__PURE__ */ z(te, {
|
|
373
|
+
columns: ne,
|
|
374
|
+
data: L,
|
|
365
375
|
rowKey: (e) => e.id,
|
|
366
|
-
caption:
|
|
376
|
+
caption: i("atheletebridge.pages.performance.workouts.caption", "Workout history for {{name}}").replace("{{name}}", t || i("atheletebridge.pages.performance.athleteFallback", "athlete"))
|
|
367
377
|
})
|
|
368
|
-
}), /* @__PURE__ */
|
|
378
|
+
}), /* @__PURE__ */ z(s, {
|
|
369
379
|
className: "mt-6",
|
|
370
|
-
page:
|
|
371
|
-
hasMore:
|
|
372
|
-
onPrev: () => u(Math.max(0,
|
|
373
|
-
onNext: () => u(
|
|
380
|
+
page: I,
|
|
381
|
+
hasMore: H,
|
|
382
|
+
onPrev: () => u(Math.max(0, I - 1)),
|
|
383
|
+
onNext: () => u(I + 1)
|
|
374
384
|
})] }),
|
|
375
|
-
|
|
385
|
+
U ? null : /* @__PURE__ */ z("p", {
|
|
376
386
|
className: "mt-3 text-xs text-text-muted",
|
|
377
|
-
children:
|
|
387
|
+
children: i("atheletebridge.pages.performance.workouts.windowTruncated", "Only the most recent page of workouts was searched, and it does not reach back to the start of this window — older sessions in the range are not listed.")
|
|
378
388
|
})
|
|
379
389
|
] }),
|
|
380
|
-
/* @__PURE__ */
|
|
390
|
+
/* @__PURE__ */ z("div", {
|
|
381
391
|
className: "sticky bottom-0 z-30 -mx-6 border-t border-border-seam bg-bg-canvas/85 px-6 pb-[max(env(safe-area-inset-bottom),0.75rem)] pt-3 backdrop-blur sm:hidden",
|
|
382
|
-
children: /* @__PURE__ */
|
|
392
|
+
children: /* @__PURE__ */ B("button", {
|
|
383
393
|
type: "button",
|
|
384
|
-
onClick: () =>
|
|
385
|
-
className:
|
|
394
|
+
onClick: () => g(!0),
|
|
395
|
+
className: b(X, "w-full py-3 text-base"),
|
|
386
396
|
children: [
|
|
387
|
-
/* @__PURE__ */
|
|
397
|
+
/* @__PURE__ */ z(M, { className: "h-5 w-5" }),
|
|
388
398
|
" ",
|
|
389
|
-
|
|
399
|
+
i("atheletebridge.pages.performance.logWorkout", "Log workout")
|
|
390
400
|
]
|
|
391
401
|
})
|
|
392
402
|
}),
|
|
393
|
-
/* @__PURE__ */
|
|
394
|
-
open:
|
|
395
|
-
onOpenChange:
|
|
403
|
+
/* @__PURE__ */ z(be, {
|
|
404
|
+
open: m,
|
|
405
|
+
onOpenChange: g,
|
|
396
406
|
athleteId: e,
|
|
397
407
|
displayName: t
|
|
398
408
|
}),
|
|
399
|
-
/* @__PURE__ */
|
|
409
|
+
/* @__PURE__ */ z(xe, {
|
|
400
410
|
open: w,
|
|
401
|
-
onOpenChange:
|
|
411
|
+
onOpenChange: T,
|
|
402
412
|
athleteId: e,
|
|
403
413
|
displayName: t
|
|
404
414
|
})
|
|
405
415
|
]
|
|
406
416
|
});
|
|
407
417
|
}
|
|
408
|
-
function
|
|
418
|
+
function _e(e) {
|
|
409
419
|
let t = e.toLowerCase();
|
|
410
|
-
return /strength|lift|squat|deadlift|bench|1rm|weight/.test(t) ?
|
|
420
|
+
return /strength|lift|squat|deadlift|bench|1rm|weight/.test(t) ? D : /speed|sprint|agility|accel|split/.test(t) ? L : /endurance|aerobic|cardio|run|beep|yo-?yo/.test(t) ? C : /recovery|mobility|stretch|rest/.test(t) ? k : /accuracy|shoot|target/.test(t) ? F : D;
|
|
411
421
|
}
|
|
412
|
-
function
|
|
413
|
-
return /* @__PURE__ */
|
|
414
|
-
className:
|
|
422
|
+
function ve({ rpe: e }) {
|
|
423
|
+
return /* @__PURE__ */ z("span", {
|
|
424
|
+
className: b("inline-flex h-7 min-w-[1.75rem] items-center justify-center rounded-md border px-1.5 text-sm font-semibold tabular-nums", e >= 8 ? "border-status-error-border text-status-error-text" : e >= 5 ? "border-status-warning-border text-status-warning-text" : "border-border-seam text-text-secondary"),
|
|
415
425
|
children: e
|
|
416
426
|
});
|
|
417
427
|
}
|
|
418
|
-
function
|
|
419
|
-
let
|
|
420
|
-
return /* @__PURE__ */
|
|
428
|
+
function ye({ metric: e, labels: t, tr: n }) {
|
|
429
|
+
let r = pe[e.type], a = e.previous == null ? null : e.latest - e.previous, o = e.max > e.min, s = o ? Math.round((e.latest - e.min) / (e.max - e.min) * 100) : 100, c = e.unit ? ` ${e.unit}` : "";
|
|
430
|
+
return /* @__PURE__ */ B(V, {
|
|
421
431
|
treatment: "metric",
|
|
422
432
|
className: "flex flex-col gap-3 p-5",
|
|
423
433
|
children: [
|
|
424
|
-
/* @__PURE__ */
|
|
434
|
+
/* @__PURE__ */ B("div", {
|
|
425
435
|
className: "flex items-center justify-between gap-2",
|
|
426
|
-
children: [/* @__PURE__ */
|
|
436
|
+
children: [/* @__PURE__ */ B("span", {
|
|
427
437
|
className: "flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-[var(--color-accent-teal)]",
|
|
428
|
-
children: [/* @__PURE__ */
|
|
438
|
+
children: [/* @__PURE__ */ z(r, {
|
|
429
439
|
className: "h-4 w-4",
|
|
430
440
|
"aria-hidden": "true"
|
|
431
441
|
}), ((e) => {
|
|
@@ -440,28 +450,28 @@ function _e({ metric: e, labels: t, tr: n }) {
|
|
|
440
450
|
case "CUSTOM": return n("atheletebridge.metricType.custom", "Custom");
|
|
441
451
|
}
|
|
442
452
|
})(e.type)]
|
|
443
|
-
}), /* @__PURE__ */
|
|
453
|
+
}), /* @__PURE__ */ z("span", {
|
|
444
454
|
className: "text-xs text-text-muted",
|
|
445
|
-
children:
|
|
455
|
+
children: v(e.recordedAt)
|
|
446
456
|
})]
|
|
447
457
|
}),
|
|
448
|
-
/* @__PURE__ */
|
|
458
|
+
/* @__PURE__ */ B("div", {
|
|
449
459
|
className: "flex items-end justify-between gap-3",
|
|
450
|
-
children: [/* @__PURE__ */
|
|
460
|
+
children: [/* @__PURE__ */ B("div", {
|
|
451
461
|
className: "min-w-0",
|
|
452
|
-
children: [/* @__PURE__ */
|
|
462
|
+
children: [/* @__PURE__ */ z("p", {
|
|
453
463
|
className: "truncate text-sm text-text-secondary",
|
|
454
464
|
children: e.label
|
|
455
|
-
}), /* @__PURE__ */
|
|
465
|
+
}), /* @__PURE__ */ B("p", {
|
|
456
466
|
className: "mt-0.5 text-3xl font-bold leading-none tracking-tight tabular-nums text-text-primary",
|
|
457
|
-
children: [$(e.latest), e.unit ? /* @__PURE__ */
|
|
467
|
+
children: [$(e.latest), e.unit ? /* @__PURE__ */ z("span", {
|
|
458
468
|
className: "ml-1 text-base font-medium text-text-secondary",
|
|
459
469
|
children: e.unit
|
|
460
470
|
}) : null]
|
|
461
471
|
})]
|
|
462
|
-
}), e.series.length > 1 ? /* @__PURE__ */
|
|
472
|
+
}), e.series.length > 1 ? /* @__PURE__ */ z("div", {
|
|
463
473
|
className: "w-24 shrink-0 sm:w-28",
|
|
464
|
-
children: /* @__PURE__ */
|
|
474
|
+
children: /* @__PURE__ */ z(i, {
|
|
465
475
|
data: e.series,
|
|
466
476
|
variant: "area",
|
|
467
477
|
height: 40,
|
|
@@ -469,44 +479,53 @@ function _e({ metric: e, labels: t, tr: n }) {
|
|
|
469
479
|
})
|
|
470
480
|
}) : null]
|
|
471
481
|
}),
|
|
472
|
-
o ? /* @__PURE__ */
|
|
473
|
-
className: "
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
482
|
+
o ? /* @__PURE__ */ B("div", { children: [/* @__PURE__ */ B("div", {
|
|
483
|
+
className: "flex items-center gap-2",
|
|
484
|
+
children: [/* @__PURE__ */ z("span", {
|
|
485
|
+
className: "block h-1.5 flex-1 overflow-hidden rounded-full bg-bg-sunken",
|
|
486
|
+
"aria-hidden": "true",
|
|
487
|
+
children: /* @__PURE__ */ z("span", {
|
|
488
|
+
className: "block h-1.5 rounded-full bg-[var(--color-accent-teal)]",
|
|
489
|
+
style: { width: `${Math.max(4, Math.min(100, s))}%` }
|
|
490
|
+
})
|
|
491
|
+
}), /* @__PURE__ */ B("span", {
|
|
492
|
+
className: "shrink-0 text-[0.7rem] font-semibold tabular-nums text-[var(--color-accent-teal)]",
|
|
493
|
+
children: [s, "%"]
|
|
494
|
+
})]
|
|
495
|
+
}), /* @__PURE__ */ B("div", {
|
|
480
496
|
className: "mt-1 flex justify-between text-[0.7rem] tabular-nums text-text-muted",
|
|
481
497
|
children: [
|
|
482
|
-
/* @__PURE__ */
|
|
483
|
-
/* @__PURE__ */
|
|
484
|
-
|
|
498
|
+
/* @__PURE__ */ z("span", { children: $(e.min) }),
|
|
499
|
+
/* @__PURE__ */ z("span", {
|
|
500
|
+
className: "hidden sm:inline",
|
|
501
|
+
children: $((e.min + e.max) / 2)
|
|
502
|
+
}),
|
|
503
|
+
/* @__PURE__ */ z("span", { children: $(e.max) })
|
|
485
504
|
]
|
|
486
505
|
})] }) : null,
|
|
487
|
-
/* @__PURE__ */
|
|
506
|
+
/* @__PURE__ */ z("div", {
|
|
488
507
|
className: "mt-auto flex items-center gap-1.5 text-sm",
|
|
489
|
-
children: a == null ? /* @__PURE__ */
|
|
508
|
+
children: a == null ? /* @__PURE__ */ z("span", {
|
|
490
509
|
className: "text-text-muted",
|
|
491
510
|
children: t.noComparison
|
|
492
|
-
}) : a === 0 ? /* @__PURE__ */
|
|
511
|
+
}) : a === 0 ? /* @__PURE__ */ B("span", {
|
|
493
512
|
className: "text-text-muted",
|
|
494
513
|
children: [
|
|
495
514
|
n("atheletebridge.pages.performance.window.noChange", "No change"),
|
|
496
515
|
" ",
|
|
497
516
|
t.comparison
|
|
498
517
|
]
|
|
499
|
-
}) : /* @__PURE__ */
|
|
518
|
+
}) : /* @__PURE__ */ B(R, { children: [/* @__PURE__ */ B("span", {
|
|
500
519
|
className: "inline-flex items-center gap-0.5 font-medium tabular-nums text-text-secondary",
|
|
501
520
|
children: [
|
|
502
|
-
|
|
521
|
+
z(a > 0 ? T : w, {
|
|
503
522
|
className: "h-4 w-4",
|
|
504
523
|
"aria-hidden": "true"
|
|
505
524
|
}),
|
|
506
525
|
$(Math.abs(a)),
|
|
507
526
|
c
|
|
508
527
|
]
|
|
509
|
-
}), /* @__PURE__ */
|
|
528
|
+
}), /* @__PURE__ */ z("span", {
|
|
510
529
|
className: "text-text-muted",
|
|
511
530
|
children: t.comparison
|
|
512
531
|
})] })
|
|
@@ -514,32 +533,32 @@ function _e({ metric: e, labels: t, tr: n }) {
|
|
|
514
533
|
]
|
|
515
534
|
});
|
|
516
535
|
}
|
|
517
|
-
function
|
|
518
|
-
let i =
|
|
519
|
-
s(""), d("COMPLETED"), h(Q()), _(""),
|
|
520
|
-
},
|
|
536
|
+
function be({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
537
|
+
let i = p(), a = m(), [o, s] = S(""), [c, d] = S("COMPLETED"), [f, h] = S(Q), [g, _] = S(""), [v, y] = S(""), [x, C] = S(""), [w, T] = S(""), [E, D] = S(null), O = () => {
|
|
538
|
+
s(""), d("COMPLETED"), h(Q()), _(""), y(""), C(""), T(""), D(null);
|
|
539
|
+
}, k = (e) => {
|
|
521
540
|
switch (e) {
|
|
522
541
|
case "COMPLETED": return i("atheletebridge.workoutStatus.completed", "Completed");
|
|
523
542
|
case "PLANNED": return i("atheletebridge.workoutStatus.planned", "Planned");
|
|
524
543
|
case "SKIPPED": return i("atheletebridge.workoutStatus.skipped", "Skipped");
|
|
525
544
|
}
|
|
526
545
|
};
|
|
527
|
-
return /* @__PURE__ */
|
|
546
|
+
return /* @__PURE__ */ z(H, {
|
|
528
547
|
open: e,
|
|
529
548
|
onOpenChange: t,
|
|
530
|
-
children: /* @__PURE__ */
|
|
549
|
+
children: /* @__PURE__ */ B(U, { children: [/* @__PURE__ */ z(G, { children: /* @__PURE__ */ B(K, { children: [i("atheletebridge.pages.performance.logWorkoutDialogTitle", "Log workout"), r ? ` — ${r}` : ""] }) }), /* @__PURE__ */ B("form", {
|
|
531
550
|
onSubmit: async (e) => {
|
|
532
551
|
if (e.preventDefault(), D(null), !o.trim()) D(i("atheletebridge.pages.performance.error.titleRequired", "A workout title is required."));
|
|
533
|
-
else if (!
|
|
552
|
+
else if (!f) D(i("atheletebridge.pages.performance.error.performedAtRequired", "A performed date and time is required."));
|
|
534
553
|
else try {
|
|
535
554
|
await a.mutateAsync({
|
|
536
555
|
athleteId: n,
|
|
537
556
|
title: o.trim(),
|
|
538
557
|
status: c,
|
|
539
|
-
performedAt: new Date(
|
|
540
|
-
durationMin:
|
|
541
|
-
rpe:
|
|
542
|
-
totalLoad:
|
|
558
|
+
performedAt: new Date(f).toISOString(),
|
|
559
|
+
durationMin: me(g),
|
|
560
|
+
rpe: me(v),
|
|
561
|
+
totalLoad: Z(x),
|
|
543
562
|
notes: w.trim() || void 0
|
|
544
563
|
}), O(), t(!1);
|
|
545
564
|
} catch (e) {
|
|
@@ -548,11 +567,11 @@ function ve({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
|
548
567
|
},
|
|
549
568
|
className: "space-y-4 px-1",
|
|
550
569
|
children: [
|
|
551
|
-
/* @__PURE__ */
|
|
570
|
+
/* @__PURE__ */ z(l, {
|
|
552
571
|
label: i("atheletebridge.pages.performance.label.title", "Title"),
|
|
553
572
|
htmlFor: "workoutTitle",
|
|
554
573
|
required: !0,
|
|
555
|
-
children: /* @__PURE__ */
|
|
574
|
+
children: /* @__PURE__ */ z("input", {
|
|
556
575
|
id: "workoutTitle",
|
|
557
576
|
className: u,
|
|
558
577
|
value: o,
|
|
@@ -560,41 +579,41 @@ function ve({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
|
560
579
|
placeholder: i("atheletebridge.pages.performance.placeholder.title", "e.g. Lower-body strength")
|
|
561
580
|
})
|
|
562
581
|
}),
|
|
563
|
-
/* @__PURE__ */
|
|
582
|
+
/* @__PURE__ */ B("div", {
|
|
564
583
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
565
|
-
children: [/* @__PURE__ */
|
|
584
|
+
children: [/* @__PURE__ */ z(l, {
|
|
566
585
|
label: i("atheletebridge.pages.performance.label.status", "Status"),
|
|
567
586
|
htmlFor: "workoutStatus",
|
|
568
|
-
children: /* @__PURE__ */
|
|
587
|
+
children: /* @__PURE__ */ z("select", {
|
|
569
588
|
id: "workoutStatus",
|
|
570
589
|
className: u,
|
|
571
590
|
value: c,
|
|
572
591
|
onChange: (e) => d(e.target.value),
|
|
573
|
-
children:
|
|
592
|
+
children: ne.map((e) => /* @__PURE__ */ z("option", {
|
|
574
593
|
value: e,
|
|
575
|
-
children:
|
|
594
|
+
children: k(e)
|
|
576
595
|
}, e))
|
|
577
596
|
})
|
|
578
|
-
}), /* @__PURE__ */
|
|
597
|
+
}), /* @__PURE__ */ z(l, {
|
|
579
598
|
label: i("atheletebridge.pages.performance.label.performedAt", "Performed at"),
|
|
580
599
|
htmlFor: "workoutPerformedAt",
|
|
581
600
|
required: !0,
|
|
582
|
-
children: /* @__PURE__ */
|
|
601
|
+
children: /* @__PURE__ */ z("input", {
|
|
583
602
|
id: "workoutPerformedAt",
|
|
584
603
|
type: "datetime-local",
|
|
585
604
|
className: u,
|
|
586
|
-
value:
|
|
605
|
+
value: f,
|
|
587
606
|
onChange: (e) => h(e.target.value)
|
|
588
607
|
})
|
|
589
608
|
})]
|
|
590
609
|
}),
|
|
591
|
-
/* @__PURE__ */
|
|
610
|
+
/* @__PURE__ */ B("div", {
|
|
592
611
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
593
612
|
children: [
|
|
594
|
-
/* @__PURE__ */
|
|
613
|
+
/* @__PURE__ */ z(l, {
|
|
595
614
|
label: i("atheletebridge.pages.performance.label.durationMin", "Duration (min)"),
|
|
596
615
|
htmlFor: "workoutDuration",
|
|
597
|
-
children: /* @__PURE__ */
|
|
616
|
+
children: /* @__PURE__ */ z("input", {
|
|
598
617
|
id: "workoutDuration",
|
|
599
618
|
inputMode: "numeric",
|
|
600
619
|
className: u,
|
|
@@ -602,34 +621,34 @@ function ve({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
|
602
621
|
onChange: (e) => _(e.target.value)
|
|
603
622
|
})
|
|
604
623
|
}),
|
|
605
|
-
/* @__PURE__ */
|
|
624
|
+
/* @__PURE__ */ z(l, {
|
|
606
625
|
label: i("atheletebridge.pages.performance.label.rpe", "RPE (1–10)"),
|
|
607
626
|
htmlFor: "workoutRpe",
|
|
608
|
-
children: /* @__PURE__ */
|
|
627
|
+
children: /* @__PURE__ */ z("input", {
|
|
609
628
|
id: "workoutRpe",
|
|
610
629
|
inputMode: "numeric",
|
|
611
630
|
className: u,
|
|
612
631
|
value: v,
|
|
613
|
-
onChange: (e) =>
|
|
632
|
+
onChange: (e) => y(e.target.value)
|
|
614
633
|
})
|
|
615
634
|
}),
|
|
616
|
-
/* @__PURE__ */
|
|
635
|
+
/* @__PURE__ */ z(l, {
|
|
617
636
|
label: i("atheletebridge.pages.performance.label.totalLoad", "Total load"),
|
|
618
637
|
htmlFor: "workoutLoad",
|
|
619
|
-
children: /* @__PURE__ */
|
|
638
|
+
children: /* @__PURE__ */ z("input", {
|
|
620
639
|
id: "workoutLoad",
|
|
621
640
|
inputMode: "decimal",
|
|
622
641
|
className: u,
|
|
623
|
-
value:
|
|
642
|
+
value: x,
|
|
624
643
|
onChange: (e) => C(e.target.value)
|
|
625
644
|
})
|
|
626
645
|
})
|
|
627
646
|
]
|
|
628
647
|
}),
|
|
629
|
-
/* @__PURE__ */
|
|
648
|
+
/* @__PURE__ */ z(l, {
|
|
630
649
|
label: i("atheletebridge.pages.performance.label.notes", "Notes"),
|
|
631
650
|
htmlFor: "workoutNotes",
|
|
632
|
-
children: /* @__PURE__ */
|
|
651
|
+
children: /* @__PURE__ */ z("textarea", {
|
|
633
652
|
id: "workoutNotes",
|
|
634
653
|
rows: 2,
|
|
635
654
|
className: u,
|
|
@@ -638,28 +657,28 @@ function ve({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
|
638
657
|
placeholder: i("atheletebridge.pages.performance.notesPlaceholder", "How did the session go?")
|
|
639
658
|
})
|
|
640
659
|
}),
|
|
641
|
-
E && /* @__PURE__ */
|
|
660
|
+
E && /* @__PURE__ */ z("p", {
|
|
642
661
|
className: "text-sm text-status-error-text",
|
|
643
662
|
children: E
|
|
644
663
|
}),
|
|
645
|
-
/* @__PURE__ */
|
|
664
|
+
/* @__PURE__ */ B(W, { children: [/* @__PURE__ */ z("button", {
|
|
646
665
|
type: "button",
|
|
647
666
|
onClick: () => t(!1),
|
|
648
667
|
className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
|
|
649
668
|
children: i("common.cancel", "Cancel")
|
|
650
|
-
}), /* @__PURE__ */
|
|
669
|
+
}), /* @__PURE__ */ B("button", {
|
|
651
670
|
type: "submit",
|
|
652
671
|
disabled: a.isPending,
|
|
653
|
-
className:
|
|
654
|
-
children: [a.isPending ? /* @__PURE__ */
|
|
672
|
+
className: b(X, "disabled:opacity-60"),
|
|
673
|
+
children: [a.isPending ? /* @__PURE__ */ z(A, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ z(N, { className: "h-4 w-4" }), i("atheletebridge.pages.performance.logWorkout", "Log workout")]
|
|
655
674
|
})] })
|
|
656
675
|
]
|
|
657
676
|
})] })
|
|
658
677
|
});
|
|
659
678
|
}
|
|
660
|
-
function
|
|
661
|
-
let i =
|
|
662
|
-
s("CUSTOM"), d(""), m(""), _(""),
|
|
679
|
+
function xe({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
680
|
+
let i = p(), a = g(), [o, s] = S("CUSTOM"), [c, d] = S(""), [f, m] = S(""), [h, _] = S(""), [v, y] = S(""), [x, C] = S(Q), [w, T] = S(null), E = () => {
|
|
681
|
+
s("CUSTOM"), d(""), m(""), _(""), y(""), C(Q()), T(null);
|
|
663
682
|
}, D = (e) => {
|
|
664
683
|
switch (e) {
|
|
665
684
|
case "SPEED": return i("atheletebridge.metricType.speed", "Speed");
|
|
@@ -672,27 +691,27 @@ function ye({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
|
672
691
|
case "CUSTOM": return i("atheletebridge.metricType.custom", "Custom");
|
|
673
692
|
}
|
|
674
693
|
};
|
|
675
|
-
return /* @__PURE__ */
|
|
694
|
+
return /* @__PURE__ */ z(H, {
|
|
676
695
|
open: e,
|
|
677
696
|
onOpenChange: t,
|
|
678
|
-
children: /* @__PURE__ */
|
|
697
|
+
children: /* @__PURE__ */ B(U, { children: [/* @__PURE__ */ z(G, { children: /* @__PURE__ */ B(K, { children: [i("atheletebridge.pages.performance.recordMetricDialogTitle", "Record metric"), r ? ` — ${r}` : ""] }) }), /* @__PURE__ */ B("form", {
|
|
679
698
|
onSubmit: async (e) => {
|
|
680
699
|
if (e.preventDefault(), T(null), !c.trim()) {
|
|
681
700
|
T(i("atheletebridge.pages.performance.error.metricLabelRequired", "A metric label is required."));
|
|
682
701
|
return;
|
|
683
702
|
}
|
|
684
|
-
let r =
|
|
703
|
+
let r = Z(f);
|
|
685
704
|
if (r === void 0) T(i("atheletebridge.pages.performance.error.metricValueRequired", "A numeric value is required."));
|
|
686
|
-
else if (!
|
|
705
|
+
else if (!x) T(i("atheletebridge.pages.performance.error.recordedAtRequired", "A recorded date and time is required."));
|
|
687
706
|
else try {
|
|
688
707
|
await a.mutateAsync({
|
|
689
708
|
athleteId: n,
|
|
690
709
|
type: o,
|
|
691
710
|
label: c.trim(),
|
|
692
711
|
value: r,
|
|
693
|
-
unit:
|
|
712
|
+
unit: h.trim() || void 0,
|
|
694
713
|
source: v.trim() || void 0,
|
|
695
|
-
recordedAt: new Date(
|
|
714
|
+
recordedAt: new Date(x).toISOString()
|
|
696
715
|
}), E(), t(!1);
|
|
697
716
|
} catch (e) {
|
|
698
717
|
T(e instanceof Error ? e.message : i("atheletebridge.pages.performance.error.recordFailed", "Failed to record metric."));
|
|
@@ -700,39 +719,39 @@ function ye({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
|
700
719
|
},
|
|
701
720
|
className: "space-y-4 px-1",
|
|
702
721
|
children: [
|
|
703
|
-
/* @__PURE__ */
|
|
722
|
+
/* @__PURE__ */ B("div", {
|
|
704
723
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
|
|
705
|
-
children: [/* @__PURE__ */
|
|
724
|
+
children: [/* @__PURE__ */ z(l, {
|
|
706
725
|
label: i("atheletebridge.pages.performance.label.metricType", "Metric type"),
|
|
707
726
|
htmlFor: "metricType",
|
|
708
|
-
children: /* @__PURE__ */
|
|
727
|
+
children: /* @__PURE__ */ z("select", {
|
|
709
728
|
id: "metricType",
|
|
710
729
|
className: u,
|
|
711
730
|
value: o,
|
|
712
731
|
onChange: (e) => s(e.target.value),
|
|
713
|
-
children:
|
|
732
|
+
children: re.map((e) => /* @__PURE__ */ z("option", {
|
|
714
733
|
value: e,
|
|
715
734
|
children: D(e)
|
|
716
735
|
}, e))
|
|
717
736
|
})
|
|
718
|
-
}), /* @__PURE__ */
|
|
737
|
+
}), /* @__PURE__ */ z(l, {
|
|
719
738
|
label: i("atheletebridge.pages.performance.label.recordedAt", "Recorded at"),
|
|
720
739
|
htmlFor: "metricRecordedAt",
|
|
721
740
|
required: !0,
|
|
722
|
-
children: /* @__PURE__ */
|
|
741
|
+
children: /* @__PURE__ */ z("input", {
|
|
723
742
|
id: "metricRecordedAt",
|
|
724
743
|
type: "datetime-local",
|
|
725
744
|
className: u,
|
|
726
|
-
value:
|
|
745
|
+
value: x,
|
|
727
746
|
onChange: (e) => C(e.target.value)
|
|
728
747
|
})
|
|
729
748
|
})]
|
|
730
749
|
}),
|
|
731
|
-
/* @__PURE__ */
|
|
750
|
+
/* @__PURE__ */ z(l, {
|
|
732
751
|
label: i("atheletebridge.pages.performance.label.metricLabel", "Label"),
|
|
733
752
|
htmlFor: "metricLabel",
|
|
734
753
|
required: !0,
|
|
735
|
-
children: /* @__PURE__ */
|
|
754
|
+
children: /* @__PURE__ */ z("input", {
|
|
736
755
|
id: "metricLabel",
|
|
737
756
|
className: u,
|
|
738
757
|
value: c,
|
|
@@ -740,63 +759,63 @@ function ye({ open: e, onOpenChange: t, athleteId: n, displayName: r }) {
|
|
|
740
759
|
placeholder: i("atheletebridge.pages.performance.placeholder.metricLabel", "e.g. 40m sprint")
|
|
741
760
|
})
|
|
742
761
|
}),
|
|
743
|
-
/* @__PURE__ */
|
|
762
|
+
/* @__PURE__ */ B("div", {
|
|
744
763
|
className: "grid grid-cols-2 gap-4",
|
|
745
|
-
children: [/* @__PURE__ */
|
|
764
|
+
children: [/* @__PURE__ */ z(l, {
|
|
746
765
|
label: i("atheletebridge.pages.performance.label.value", "Value"),
|
|
747
766
|
htmlFor: "metricValue",
|
|
748
767
|
required: !0,
|
|
749
|
-
children: /* @__PURE__ */
|
|
768
|
+
children: /* @__PURE__ */ z("input", {
|
|
750
769
|
id: "metricValue",
|
|
751
770
|
inputMode: "decimal",
|
|
752
771
|
className: u,
|
|
753
|
-
value:
|
|
772
|
+
value: f,
|
|
754
773
|
onChange: (e) => m(e.target.value),
|
|
755
774
|
placeholder: i("atheletebridge.pages.performance.placeholder.value", "e.g. 4.8")
|
|
756
775
|
})
|
|
757
|
-
}), /* @__PURE__ */
|
|
776
|
+
}), /* @__PURE__ */ z(l, {
|
|
758
777
|
label: i("atheletebridge.pages.performance.label.unit", "Unit"),
|
|
759
778
|
htmlFor: "metricUnit",
|
|
760
|
-
children: /* @__PURE__ */
|
|
779
|
+
children: /* @__PURE__ */ z("input", {
|
|
761
780
|
id: "metricUnit",
|
|
762
781
|
className: u,
|
|
763
|
-
value:
|
|
782
|
+
value: h,
|
|
764
783
|
onChange: (e) => _(e.target.value),
|
|
765
784
|
placeholder: i("atheletebridge.pages.performance.placeholder.unit", "e.g. s, kg, bpm")
|
|
766
785
|
})
|
|
767
786
|
})]
|
|
768
787
|
}),
|
|
769
|
-
/* @__PURE__ */
|
|
788
|
+
/* @__PURE__ */ z(l, {
|
|
770
789
|
label: i("atheletebridge.pages.performance.label.source", "Source"),
|
|
771
790
|
htmlFor: "metricSource",
|
|
772
791
|
hint: i("atheletebridge.pages.performance.hint.source", "Optional — device, test or coach."),
|
|
773
|
-
children: /* @__PURE__ */
|
|
792
|
+
children: /* @__PURE__ */ z("input", {
|
|
774
793
|
id: "metricSource",
|
|
775
794
|
className: u,
|
|
776
795
|
value: v,
|
|
777
|
-
onChange: (e) =>
|
|
796
|
+
onChange: (e) => y(e.target.value),
|
|
778
797
|
placeholder: i("atheletebridge.pages.performance.placeholder.source", "e.g. GPS vest")
|
|
779
798
|
})
|
|
780
799
|
}),
|
|
781
|
-
w && /* @__PURE__ */
|
|
800
|
+
w && /* @__PURE__ */ z("p", {
|
|
782
801
|
className: "text-sm text-status-error-text",
|
|
783
802
|
children: w
|
|
784
803
|
}),
|
|
785
|
-
/* @__PURE__ */
|
|
804
|
+
/* @__PURE__ */ B(W, { children: [/* @__PURE__ */ z("button", {
|
|
786
805
|
type: "button",
|
|
787
806
|
onClick: () => t(!1),
|
|
788
807
|
className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
|
|
789
808
|
children: i("common.cancel", "Cancel")
|
|
790
|
-
}), /* @__PURE__ */
|
|
809
|
+
}), /* @__PURE__ */ B("button", {
|
|
791
810
|
type: "submit",
|
|
792
811
|
disabled: a.isPending,
|
|
793
|
-
className:
|
|
794
|
-
children: [a.isPending ? /* @__PURE__ */
|
|
812
|
+
className: b(X, "disabled:opacity-60"),
|
|
813
|
+
children: [a.isPending ? /* @__PURE__ */ z(A, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ z(M, { className: "h-4 w-4" }), i("atheletebridge.pages.performance.recordMetric", "Record metric")]
|
|
795
814
|
})] })
|
|
796
815
|
]
|
|
797
816
|
})] })
|
|
798
817
|
});
|
|
799
818
|
}
|
|
800
|
-
export {
|
|
819
|
+
export { he as PerformancePage };
|
|
801
820
|
|
|
802
821
|
//# sourceMappingURL=PerformancePage.js.map
|