@burdenoff/microfe-atheletebridge 2026.827.1 → 2026.829.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atheletebridge/components/LoadingState.d.ts.map +1 -1
- package/dist/atheletebridge/components/LoadingState.js +39 -32
- package/dist/atheletebridge/components/LoadingState.js.map +1 -1
- package/dist/atheletebridge/components/TeamCard.d.ts.map +1 -1
- package/dist/atheletebridge/components/TeamCard.js +45 -49
- package/dist/atheletebridge/components/TeamCard.js.map +1 -1
- package/dist/atheletebridge/pages/DashboardPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/DashboardPage.js +56 -24
- package/dist/atheletebridge/pages/DashboardPage.js.map +1 -1
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.js +58 -56
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.js.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js +110 -106
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixturesListPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixturesListPage.js +80 -71
- package/dist/atheletebridge/pages/fixtures/FixturesListPage.js.map +1 -1
- package/dist/atheletebridge/pages/onboarding/OnboardingPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/onboarding/OnboardingPage.js +244 -210
- package/dist/atheletebridge/pages/onboarding/OnboardingPage.js.map +1 -1
- package/dist/atheletebridge/pages/performance/PerformancePage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/performance/PerformancePage.js +197 -148
- package/dist/atheletebridge/pages/performance/PerformancePage.js.map +1 -1
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.js +169 -143
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/programs/ProgramsListPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/programs/ProgramsListPage.js +77 -72
- package/dist/atheletebridge/pages/programs/ProgramsListPage.js.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionDetailPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionDetailPage.js +104 -86
- package/dist/atheletebridge/pages/sessions/SessionDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionsListPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionsListPage.js +54 -49
- package/dist/atheletebridge/pages/sessions/SessionsListPage.js.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamDetailPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamDetailPage.js +286 -267
- package/dist/atheletebridge/pages/teams/TeamDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamFormPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamFormPage.js +185 -180
- package/dist/atheletebridge/pages/teams/TeamFormPage.js.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamsListPage.d.ts.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamsListPage.js +70 -74
- package/dist/atheletebridge/pages/teams/TeamsListPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
1
|
+
import { useAbTranslate as e } from "../../i18n.js";
|
|
2
|
+
import { useAthleteBridge as t } from "../../context/AthleteBridgeContext.js";
|
|
3
|
+
import { PageLayout as n } from "../../components/PageLayout.js";
|
|
4
|
+
import { StatusBadge as r } from "../../components/StatusBadge.js";
|
|
5
|
+
import { PROGRAM_LEVEL_LABELS as i, SPORT_ICONS as a, SPORT_LABELS as o } from "../../components/domain.js";
|
|
6
|
+
import { EmptyState as ee } from "../../components/EmptyState.js";
|
|
7
|
+
import { ErrorState as te, LoadingState as s } from "../../components/LoadingState.js";
|
|
8
|
+
import { useAddDrill as ne, useArchiveProgram as c, useProgram as l, useRemoveDrill as u, useTransitionProgram as d, useUploadFile as f } from "../../hooks/useAthleteBridgeApi.js";
|
|
9
|
+
import { FormField as p, fieldInputClass as m } from "../../components/form.js";
|
|
10
|
+
import { DrillVideoLink as h } from "../../components/DrillVideoLink.js";
|
|
11
|
+
import { useMemo as re, useState as g } from "react";
|
|
12
|
+
import { Archive as _, ArrowLeft as ie, Copy as ae, Edit as oe, FileVideo as se, Loader2 as v, Plus as y, Send as ce, Trash2 as le, Undo2 as ue } from "lucide-react";
|
|
13
|
+
import { useParams as b } from "react-router";
|
|
14
|
+
import { Fragment as de, jsx as x, jsxs as S } from "react/jsx-runtime";
|
|
15
|
+
import { Accordion as fe, AccordionContent as pe, AccordionItem as me, AccordionTrigger as he, Badge as C, GlassCard as w, ResponsiveDialog as T, ResponsiveDialogContent as E, ResponsiveDialogFooter as D, ResponsiveDialogHeader as O, ResponsiveDialogTitle as k } from "@burdenoff/fe-libs/ui";
|
|
15
16
|
//#region src/atheletebridge/pages/programs/ProgramDetailPage.tsx
|
|
16
|
-
var
|
|
17
|
+
var A = {
|
|
17
18
|
name: "",
|
|
18
19
|
description: "",
|
|
19
20
|
weekNumber: "1",
|
|
@@ -21,17 +22,17 @@ var j = {
|
|
|
21
22
|
reps: "",
|
|
22
23
|
durationSec: "",
|
|
23
24
|
restSec: ""
|
|
24
|
-
},
|
|
25
|
+
}, j = ({ children: e }) => /* @__PURE__ */ x("span", {
|
|
25
26
|
className: "inline-flex items-center rounded-md border border-border-seam bg-bg-sunken px-2 py-0.5 text-xs font-medium tabular-nums text-text-secondary",
|
|
26
27
|
children: e
|
|
27
|
-
}),
|
|
28
|
+
}), M = (e) => {
|
|
28
29
|
let t = e.trim();
|
|
29
30
|
if (!t) return;
|
|
30
31
|
let n = Number.parseInt(t, 10);
|
|
31
32
|
return Number.isNaN(n) ? void 0 : n;
|
|
32
33
|
};
|
|
33
|
-
function
|
|
34
|
-
let { id: P } =
|
|
34
|
+
function N() {
|
|
35
|
+
let N = e(), { id: P } = b(), { navigateTo: F } = t(), I = l(P), L = d(), R = c(), z = ne(), B = u(P), ge = f(), [_e, V] = g(!1), [H, U] = g(A), [W, G] = g(null), [K, q] = g(!1), [J, Y] = g(null), X = re(() => {
|
|
35
36
|
let e = I.data?.drills?.items ?? [], t = /* @__PURE__ */ new Map();
|
|
36
37
|
for (let n of e) {
|
|
37
38
|
let e = t.get(n.weekNumber) ?? [];
|
|
@@ -42,44 +43,52 @@ function P() {
|
|
|
42
43
|
drills: [...t].sort((e, t) => e.orderIndex - t.orderIndex)
|
|
43
44
|
}));
|
|
44
45
|
}, [I.data]);
|
|
45
|
-
if (I.isLoading) return /* @__PURE__ */
|
|
46
|
-
title: "Program",
|
|
47
|
-
children: /* @__PURE__ */
|
|
46
|
+
if (I.isLoading) return /* @__PURE__ */ x(n, {
|
|
47
|
+
title: N("atheletebridge.pages.programDetail.title", "Program"),
|
|
48
|
+
children: /* @__PURE__ */ x(s, { label: N("atheletebridge.pages.programDetail.loading", "Loading program…") })
|
|
48
49
|
});
|
|
49
|
-
if (I.isError || !I.data) return /* @__PURE__ */
|
|
50
|
-
title: "Program",
|
|
51
|
-
children: /* @__PURE__ */
|
|
52
|
-
title: "Program not found",
|
|
53
|
-
message: "This program does not exist or you do not have access to it.",
|
|
50
|
+
if (I.isError || !I.data) return /* @__PURE__ */ x(n, {
|
|
51
|
+
title: N("atheletebridge.pages.programDetail.title", "Program"),
|
|
52
|
+
children: /* @__PURE__ */ x(te, {
|
|
53
|
+
title: N("atheletebridge.pages.programDetail.notFoundTitle", "Program not found"),
|
|
54
|
+
message: N("atheletebridge.pages.programDetail.notFoundMessage", "This program does not exist or you do not have access to it."),
|
|
54
55
|
onRetry: () => F("/programs")
|
|
55
56
|
})
|
|
56
57
|
});
|
|
57
|
-
let Z = I.data, Q = Z.drills?.items.length ?? 0,
|
|
58
|
+
let Z = I.data, Q = Z.drills?.items.length ?? 0, ve = a[Z.sport], ye = X.map(({ week: e }) => `week-${e}`), $ = (e) => {
|
|
58
59
|
P && L.mutate({
|
|
59
60
|
id: P,
|
|
60
61
|
status: e
|
|
61
62
|
});
|
|
62
63
|
};
|
|
63
|
-
return /* @__PURE__ */
|
|
64
|
+
return /* @__PURE__ */ S(n, {
|
|
64
65
|
title: Z.name,
|
|
65
66
|
gradientTitle: !0,
|
|
66
|
-
description: `${
|
|
67
|
-
actions: /* @__PURE__ */
|
|
67
|
+
description: `${o[Z.sport]} · ${i[Z.level]} · ${Z.weeks} ${Z.weeks === 1 ? "week" : "weeks"}`,
|
|
68
|
+
actions: /* @__PURE__ */ S("div", {
|
|
68
69
|
className: "flex flex-wrap items-center gap-2",
|
|
69
70
|
children: [
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
+
/* @__PURE__ */ S("button", {
|
|
71
72
|
type: "button",
|
|
72
73
|
onClick: () => F("/programs"),
|
|
73
74
|
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",
|
|
74
|
-
children: [
|
|
75
|
+
children: [
|
|
76
|
+
/* @__PURE__ */ x(ie, { className: "h-4 w-4" }),
|
|
77
|
+
" ",
|
|
78
|
+
N("atheletebridge.pages.programDetail.back", "Back")
|
|
79
|
+
]
|
|
75
80
|
}),
|
|
76
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ S("button", {
|
|
77
82
|
type: "button",
|
|
78
83
|
onClick: () => F(`/programs/${Z.id}/edit`),
|
|
79
84
|
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",
|
|
80
|
-
children: [
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ x(oe, { className: "h-4 w-4" }),
|
|
87
|
+
" ",
|
|
88
|
+
N("atheletebridge.pages.programDetail.edit", "Edit")
|
|
89
|
+
]
|
|
81
90
|
}),
|
|
82
|
-
Z.status !== "ARCHIVED" && /* @__PURE__ */
|
|
91
|
+
Z.status !== "ARCHIVED" && /* @__PURE__ */ S("button", {
|
|
83
92
|
type: "button",
|
|
84
93
|
onClick: async () => {
|
|
85
94
|
P && (await R.mutateAsync(P), F("/programs"));
|
|
@@ -87,46 +96,46 @@ function P() {
|
|
|
87
96
|
disabled: R.isPending,
|
|
88
97
|
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-2 text-sm font-medium text-status-error-text transition-colors hover:bg-status-error-bg-subtle disabled:opacity-60",
|
|
89
98
|
children: [
|
|
90
|
-
R.isPending ? /* @__PURE__ */
|
|
99
|
+
R.isPending ? /* @__PURE__ */ x(v, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ x(_, { className: "h-4 w-4" }),
|
|
91
100
|
" ",
|
|
92
|
-
"Archive"
|
|
101
|
+
N("atheletebridge.pages.programDetail.archive", "Archive")
|
|
93
102
|
]
|
|
94
103
|
})
|
|
95
104
|
]
|
|
96
105
|
}),
|
|
97
106
|
children: [
|
|
98
|
-
/* @__PURE__ */
|
|
107
|
+
/* @__PURE__ */ S(w, {
|
|
99
108
|
treatment: "insight",
|
|
100
109
|
className: "mb-8 p-6",
|
|
101
110
|
children: [
|
|
102
|
-
/* @__PURE__ */
|
|
111
|
+
/* @__PURE__ */ S("div", {
|
|
103
112
|
className: "flex items-start gap-4",
|
|
104
|
-
children: [/* @__PURE__ */
|
|
113
|
+
children: [/* @__PURE__ */ x("div", {
|
|
105
114
|
className: "flex h-14 w-14 shrink-0 items-center justify-center rounded-2xl bg-[var(--color-accent-soft)] text-text-primary",
|
|
106
|
-
children: /* @__PURE__ */
|
|
115
|
+
children: /* @__PURE__ */ x(ve, {
|
|
107
116
|
className: "h-7 w-7",
|
|
108
117
|
"aria-hidden": "true"
|
|
109
118
|
})
|
|
110
|
-
}), /* @__PURE__ */
|
|
119
|
+
}), /* @__PURE__ */ S("div", {
|
|
111
120
|
className: "min-w-0 flex-1",
|
|
112
|
-
children: [/* @__PURE__ */
|
|
121
|
+
children: [/* @__PURE__ */ S("div", {
|
|
113
122
|
className: "flex flex-wrap items-center gap-2",
|
|
114
123
|
children: [
|
|
115
|
-
/* @__PURE__ */
|
|
124
|
+
/* @__PURE__ */ x(C, {
|
|
116
125
|
variant: "secondary",
|
|
117
|
-
children:
|
|
126
|
+
children: o[Z.sport]
|
|
118
127
|
}),
|
|
119
|
-
/* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ x(C, {
|
|
120
129
|
variant: "secondary",
|
|
121
|
-
children:
|
|
130
|
+
children: i[Z.level]
|
|
122
131
|
}),
|
|
123
|
-
/* @__PURE__ */
|
|
124
|
-
Z.isTemplate && /* @__PURE__ */
|
|
132
|
+
/* @__PURE__ */ x(r, { status: Z.status }),
|
|
133
|
+
Z.isTemplate && /* @__PURE__ */ S("span", {
|
|
125
134
|
className: "inline-flex items-center gap-1 text-xs text-text-secondary",
|
|
126
|
-
children: [/* @__PURE__ */
|
|
135
|
+
children: [/* @__PURE__ */ x(ae, { className: "h-3.5 w-3.5" }), " Template"]
|
|
127
136
|
})
|
|
128
137
|
]
|
|
129
|
-
}), /* @__PURE__ */
|
|
138
|
+
}), /* @__PURE__ */ S("p", {
|
|
130
139
|
className: "mt-2 text-sm text-text-secondary",
|
|
131
140
|
children: [
|
|
132
141
|
Z.weeks,
|
|
@@ -140,93 +149,110 @@ function P() {
|
|
|
140
149
|
})]
|
|
141
150
|
})]
|
|
142
151
|
}),
|
|
143
|
-
Z.summary && /* @__PURE__ */
|
|
152
|
+
Z.summary && /* @__PURE__ */ x("p", {
|
|
144
153
|
className: "mt-4 text-sm text-text-secondary",
|
|
145
154
|
children: Z.summary
|
|
146
155
|
}),
|
|
147
|
-
Z.tags.length > 0 && /* @__PURE__ */
|
|
156
|
+
Z.tags.length > 0 && /* @__PURE__ */ x("div", {
|
|
148
157
|
className: "mt-4 flex flex-wrap gap-1.5",
|
|
149
|
-
children: Z.tags.map((e) => /* @__PURE__ */
|
|
158
|
+
children: Z.tags.map((e) => /* @__PURE__ */ x("span", {
|
|
150
159
|
className: "inline-flex items-center rounded-full bg-bg-sunken px-2 py-0.5 text-xs text-text-secondary",
|
|
151
160
|
children: e
|
|
152
161
|
}, e))
|
|
153
162
|
}),
|
|
154
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ S("div", {
|
|
155
164
|
className: "mt-5 flex flex-wrap items-center gap-2 border-t border-border-seam pt-5",
|
|
156
165
|
children: [
|
|
157
|
-
/* @__PURE__ */
|
|
166
|
+
/* @__PURE__ */ x("span", {
|
|
158
167
|
className: "text-sm font-medium text-text-primary",
|
|
159
|
-
children: "Publish lifecycle:"
|
|
168
|
+
children: N("atheletebridge.pages.programDetail.lifecycle", "Publish lifecycle:")
|
|
160
169
|
}),
|
|
161
|
-
Z.status === "DRAFT" && /* @__PURE__ */
|
|
170
|
+
Z.status === "DRAFT" && /* @__PURE__ */ S("button", {
|
|
162
171
|
type: "button",
|
|
163
172
|
onClick: () => $("PUBLISHED"),
|
|
164
173
|
disabled: L.isPending,
|
|
165
174
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-60",
|
|
166
|
-
children: [
|
|
175
|
+
children: [
|
|
176
|
+
/* @__PURE__ */ x(ce, { className: "h-4 w-4" }),
|
|
177
|
+
" ",
|
|
178
|
+
N("atheletebridge.pages.programDetail.publish", "Publish")
|
|
179
|
+
]
|
|
167
180
|
}),
|
|
168
|
-
Z.status === "PUBLISHED" && /* @__PURE__ */
|
|
181
|
+
Z.status === "PUBLISHED" && /* @__PURE__ */ S(de, { children: [/* @__PURE__ */ S("button", {
|
|
169
182
|
type: "button",
|
|
170
183
|
onClick: () => $("DRAFT"),
|
|
171
184
|
disabled: L.isPending,
|
|
172
185
|
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-1.5 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-60",
|
|
173
|
-
children: [
|
|
174
|
-
|
|
186
|
+
children: [
|
|
187
|
+
/* @__PURE__ */ x(ue, { className: "h-4 w-4" }),
|
|
188
|
+
" ",
|
|
189
|
+
N("atheletebridge.pages.programDetail.pullBackToDraft", "Pull back to draft")
|
|
190
|
+
]
|
|
191
|
+
}), /* @__PURE__ */ S("button", {
|
|
175
192
|
type: "button",
|
|
176
193
|
onClick: () => $("ARCHIVED"),
|
|
177
194
|
disabled: L.isPending,
|
|
178
195
|
className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-3 py-1.5 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-60",
|
|
179
|
-
children: [
|
|
196
|
+
children: [
|
|
197
|
+
/* @__PURE__ */ x(_, { className: "h-4 w-4" }),
|
|
198
|
+
" ",
|
|
199
|
+
N("atheletebridge.pages.programDetail.archiveAction", "Archive")
|
|
200
|
+
]
|
|
180
201
|
})] }),
|
|
181
|
-
Z.status === "ARCHIVED" && /* @__PURE__ */
|
|
202
|
+
Z.status === "ARCHIVED" && /* @__PURE__ */ x("span", {
|
|
182
203
|
className: "text-sm text-text-secondary",
|
|
183
|
-
children: "This program is archived."
|
|
204
|
+
children: N("atheletebridge.pages.programDetail.archived", "This program is archived.")
|
|
184
205
|
}),
|
|
185
|
-
L.isPending && /* @__PURE__ */
|
|
206
|
+
L.isPending && /* @__PURE__ */ x(v, { className: "h-4 w-4 animate-spin text-text-secondary" })
|
|
186
207
|
]
|
|
187
208
|
})
|
|
188
209
|
]
|
|
189
210
|
}),
|
|
190
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ S("section", { children: [/* @__PURE__ */ S("div", {
|
|
191
212
|
className: "mb-4 flex items-center justify-between",
|
|
192
|
-
children: [/* @__PURE__ */
|
|
213
|
+
children: [/* @__PURE__ */ S("h2", {
|
|
193
214
|
className: "text-lg font-semibold text-text-primary",
|
|
194
215
|
children: [
|
|
195
|
-
"
|
|
216
|
+
N("atheletebridge.pages.programDetail.drillsTitle", "Drills"),
|
|
217
|
+
" (",
|
|
196
218
|
Q,
|
|
197
219
|
")"
|
|
198
220
|
]
|
|
199
|
-
}), /* @__PURE__ */
|
|
221
|
+
}), /* @__PURE__ */ S("button", {
|
|
200
222
|
type: "button",
|
|
201
223
|
onClick: () => {
|
|
202
224
|
Y(null), V(!0);
|
|
203
225
|
},
|
|
204
226
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-3 py-1.5 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90",
|
|
205
|
-
children: [
|
|
227
|
+
children: [
|
|
228
|
+
/* @__PURE__ */ x(y, { className: "h-4 w-4" }),
|
|
229
|
+
" ",
|
|
230
|
+
N("atheletebridge.pages.programDetail.addDrill", "Add drill")
|
|
231
|
+
]
|
|
206
232
|
})]
|
|
207
|
-
}), Q === 0 ? /* @__PURE__ */
|
|
233
|
+
}), Q === 0 ? /* @__PURE__ */ x(ee, {
|
|
208
234
|
illustration: "empty-data",
|
|
209
|
-
icon: /* @__PURE__ */
|
|
210
|
-
title: "No drills yet",
|
|
211
|
-
description: "Add drills with sets, reps and durations, organized by week."
|
|
212
|
-
}) : /* @__PURE__ */
|
|
235
|
+
icon: /* @__PURE__ */ x(y, { className: "h-10 w-10" }),
|
|
236
|
+
title: N("atheletebridge.pages.programDetail.noDrillsTitle", "No drills yet"),
|
|
237
|
+
description: N("atheletebridge.pages.programDetail.noDrillsHint", "Add drills with sets, reps and durations, organized by week.")
|
|
238
|
+
}) : /* @__PURE__ */ x(fe, {
|
|
213
239
|
type: "multiple",
|
|
214
|
-
defaultValue:
|
|
240
|
+
defaultValue: ye,
|
|
215
241
|
className: "flex flex-col gap-3",
|
|
216
|
-
children: X.map(({ week: e, drills: t }) => /* @__PURE__ */
|
|
242
|
+
children: X.map(({ week: e, drills: t }) => /* @__PURE__ */ x(w, {
|
|
217
243
|
treatment: "insight",
|
|
218
244
|
className: "overflow-hidden px-4 py-0",
|
|
219
|
-
children: /* @__PURE__ */
|
|
245
|
+
children: /* @__PURE__ */ S(me, {
|
|
220
246
|
value: `week-${e}`,
|
|
221
247
|
className: "border-b-0",
|
|
222
|
-
children: [/* @__PURE__ */
|
|
248
|
+
children: [/* @__PURE__ */ x(he, {
|
|
223
249
|
className: "py-4",
|
|
224
|
-
children: /* @__PURE__ */
|
|
250
|
+
children: /* @__PURE__ */ S("span", {
|
|
225
251
|
className: "flex items-center gap-2.5",
|
|
226
|
-
children: [/* @__PURE__ */
|
|
252
|
+
children: [/* @__PURE__ */ S("span", {
|
|
227
253
|
className: "text-sm font-semibold text-text-primary",
|
|
228
254
|
children: ["Week ", e]
|
|
229
|
-
}), /* @__PURE__ */ C
|
|
255
|
+
}), /* @__PURE__ */ S(C, {
|
|
230
256
|
variant: "secondary",
|
|
231
257
|
children: [
|
|
232
258
|
t.length,
|
|
@@ -235,41 +261,41 @@ function P() {
|
|
|
235
261
|
]
|
|
236
262
|
})]
|
|
237
263
|
})
|
|
238
|
-
}), /* @__PURE__ */
|
|
264
|
+
}), /* @__PURE__ */ x(pe, {
|
|
239
265
|
className: "pb-2",
|
|
240
|
-
children: /* @__PURE__ */
|
|
266
|
+
children: /* @__PURE__ */ x("div", {
|
|
241
267
|
className: "divide-y divide-border-seam",
|
|
242
|
-
children: t.map((e) => /* @__PURE__ */
|
|
268
|
+
children: t.map((e) => /* @__PURE__ */ S("div", {
|
|
243
269
|
className: "flex items-start gap-4 py-3",
|
|
244
|
-
children: [/* @__PURE__ */
|
|
270
|
+
children: [/* @__PURE__ */ S("div", {
|
|
245
271
|
className: "min-w-0 flex-1",
|
|
246
272
|
children: [
|
|
247
|
-
/* @__PURE__ */
|
|
273
|
+
/* @__PURE__ */ x("p", {
|
|
248
274
|
className: "text-sm font-medium text-text-primary",
|
|
249
275
|
children: e.name
|
|
250
276
|
}),
|
|
251
|
-
e.description && /* @__PURE__ */
|
|
277
|
+
e.description && /* @__PURE__ */ x("p", {
|
|
252
278
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
253
279
|
children: e.description
|
|
254
280
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ S("div", {
|
|
256
282
|
className: "mt-2 flex flex-wrap gap-1.5",
|
|
257
283
|
children: [
|
|
258
|
-
e.sets !== null && /* @__PURE__ */
|
|
259
|
-
e.reps !== null && /* @__PURE__ */
|
|
260
|
-
e.durationSec !== null && /* @__PURE__ */
|
|
261
|
-
e.restSec !== null && /* @__PURE__ */
|
|
284
|
+
e.sets !== null && /* @__PURE__ */ S(j, { children: [e.sets, " sets"] }),
|
|
285
|
+
e.reps !== null && /* @__PURE__ */ S(j, { children: [e.reps, " reps"] }),
|
|
286
|
+
e.durationSec !== null && /* @__PURE__ */ S(j, { children: [e.durationSec, "s work"] }),
|
|
287
|
+
e.restSec !== null && /* @__PURE__ */ S(j, { children: [e.restSec, "s rest"] })
|
|
262
288
|
]
|
|
263
289
|
}),
|
|
264
|
-
e.video?.id && /* @__PURE__ */
|
|
290
|
+
e.video?.id && /* @__PURE__ */ x("div", { children: /* @__PURE__ */ x(h, { fileId: e.video.id }) })
|
|
265
291
|
]
|
|
266
|
-
}), /* @__PURE__ */
|
|
292
|
+
}), /* @__PURE__ */ x("button", {
|
|
267
293
|
type: "button",
|
|
268
294
|
onClick: () => void B.mutate(e.id),
|
|
269
295
|
disabled: B.isPending,
|
|
270
|
-
"aria-label":
|
|
296
|
+
"aria-label": `${N("common.delete", "Delete")} ${e.name}`,
|
|
271
297
|
className: "rounded-lg p-2 text-text-secondary transition-colors hover:bg-status-error-bg-subtle hover:text-status-error-text disabled:opacity-60",
|
|
272
|
-
children: /* @__PURE__ */
|
|
298
|
+
children: /* @__PURE__ */ x(le, { className: "h-4 w-4" })
|
|
273
299
|
})]
|
|
274
300
|
}, e.id))
|
|
275
301
|
})
|
|
@@ -277,21 +303,21 @@ function P() {
|
|
|
277
303
|
})
|
|
278
304
|
}, e))
|
|
279
305
|
})] }),
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
open:
|
|
306
|
+
/* @__PURE__ */ x(T, {
|
|
307
|
+
open: _e,
|
|
282
308
|
onOpenChange: V,
|
|
283
|
-
children: /* @__PURE__ */
|
|
309
|
+
children: /* @__PURE__ */ S(E, { children: [/* @__PURE__ */ x(O, { children: /* @__PURE__ */ x(k, { children: N("atheletebridge.pages.programDetail.addDrill", "Add drill") }) }), /* @__PURE__ */ S("form", {
|
|
284
310
|
onSubmit: async (e) => {
|
|
285
311
|
if (e.preventDefault(), Y(null), !P) return;
|
|
286
312
|
if (!H.name.trim()) {
|
|
287
313
|
Y("Drill name is required.");
|
|
288
314
|
return;
|
|
289
315
|
}
|
|
290
|
-
let t =
|
|
316
|
+
let t = M(H.weekNumber) ?? 1, n;
|
|
291
317
|
if (W) {
|
|
292
318
|
q(!0);
|
|
293
319
|
try {
|
|
294
|
-
n = await
|
|
320
|
+
n = await ge(W);
|
|
295
321
|
} catch (e) {
|
|
296
322
|
Y(e instanceof Error ? e.message : "Failed to upload the demo video."), q(!1);
|
|
297
323
|
return;
|
|
@@ -305,25 +331,25 @@ function P() {
|
|
|
305
331
|
description: H.description.trim() || void 0,
|
|
306
332
|
weekNumber: t,
|
|
307
333
|
orderIndex: I.data?.drills?.items.filter((e) => e.weekNumber === t).length ?? 0,
|
|
308
|
-
sets:
|
|
309
|
-
reps:
|
|
310
|
-
durationSec:
|
|
311
|
-
restSec:
|
|
334
|
+
sets: M(H.sets),
|
|
335
|
+
reps: M(H.reps),
|
|
336
|
+
durationSec: M(H.durationSec),
|
|
337
|
+
restSec: M(H.restSec),
|
|
312
338
|
videoFileId: n
|
|
313
|
-
}), U(
|
|
339
|
+
}), U(A), G(null), V(!1);
|
|
314
340
|
} catch (e) {
|
|
315
341
|
Y(e instanceof Error ? e.message : "Failed to add drill.");
|
|
316
342
|
}
|
|
317
343
|
},
|
|
318
344
|
className: "space-y-4 px-1",
|
|
319
345
|
children: [
|
|
320
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ x(p, {
|
|
321
347
|
label: "Name",
|
|
322
348
|
htmlFor: "drillName",
|
|
323
349
|
required: !0,
|
|
324
|
-
children: /* @__PURE__ */
|
|
350
|
+
children: /* @__PURE__ */ x("input", {
|
|
325
351
|
id: "drillName",
|
|
326
|
-
className:
|
|
352
|
+
className: m,
|
|
327
353
|
value: H.name,
|
|
328
354
|
onChange: (e) => U((t) => ({
|
|
329
355
|
...t,
|
|
@@ -332,12 +358,12 @@ function P() {
|
|
|
332
358
|
placeholder: "e.g. Box jumps"
|
|
333
359
|
})
|
|
334
360
|
}),
|
|
335
|
-
/* @__PURE__ */
|
|
361
|
+
/* @__PURE__ */ x(p, {
|
|
336
362
|
label: "Description",
|
|
337
363
|
htmlFor: "drillDesc",
|
|
338
|
-
children: /* @__PURE__ */
|
|
364
|
+
children: /* @__PURE__ */ x("textarea", {
|
|
339
365
|
id: "drillDesc",
|
|
340
|
-
className:
|
|
366
|
+
className: m,
|
|
341
367
|
rows: 2,
|
|
342
368
|
value: H.description,
|
|
343
369
|
onChange: (e) => U((t) => ({
|
|
@@ -347,16 +373,16 @@ function P() {
|
|
|
347
373
|
placeholder: "How to perform the drill."
|
|
348
374
|
})
|
|
349
375
|
}),
|
|
350
|
-
/* @__PURE__ */
|
|
376
|
+
/* @__PURE__ */ S("div", {
|
|
351
377
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
352
378
|
children: [
|
|
353
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ x(p, {
|
|
354
380
|
label: "Week",
|
|
355
381
|
htmlFor: "drillWeek",
|
|
356
|
-
children: /* @__PURE__ */
|
|
382
|
+
children: /* @__PURE__ */ x("input", {
|
|
357
383
|
id: "drillWeek",
|
|
358
384
|
inputMode: "numeric",
|
|
359
|
-
className:
|
|
385
|
+
className: m,
|
|
360
386
|
value: H.weekNumber,
|
|
361
387
|
onChange: (e) => U((t) => ({
|
|
362
388
|
...t,
|
|
@@ -364,13 +390,13 @@ function P() {
|
|
|
364
390
|
}))
|
|
365
391
|
})
|
|
366
392
|
}),
|
|
367
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ x(p, {
|
|
368
394
|
label: "Sets",
|
|
369
395
|
htmlFor: "drillSets",
|
|
370
|
-
children: /* @__PURE__ */
|
|
396
|
+
children: /* @__PURE__ */ x("input", {
|
|
371
397
|
id: "drillSets",
|
|
372
398
|
inputMode: "numeric",
|
|
373
|
-
className:
|
|
399
|
+
className: m,
|
|
374
400
|
value: H.sets,
|
|
375
401
|
onChange: (e) => U((t) => ({
|
|
376
402
|
...t,
|
|
@@ -378,13 +404,13 @@ function P() {
|
|
|
378
404
|
}))
|
|
379
405
|
})
|
|
380
406
|
}),
|
|
381
|
-
/* @__PURE__ */
|
|
407
|
+
/* @__PURE__ */ x(p, {
|
|
382
408
|
label: "Reps",
|
|
383
409
|
htmlFor: "drillReps",
|
|
384
|
-
children: /* @__PURE__ */
|
|
410
|
+
children: /* @__PURE__ */ x("input", {
|
|
385
411
|
id: "drillReps",
|
|
386
412
|
inputMode: "numeric",
|
|
387
|
-
className:
|
|
413
|
+
className: m,
|
|
388
414
|
value: H.reps,
|
|
389
415
|
onChange: (e) => U((t) => ({
|
|
390
416
|
...t,
|
|
@@ -394,28 +420,28 @@ function P() {
|
|
|
394
420
|
})
|
|
395
421
|
]
|
|
396
422
|
}),
|
|
397
|
-
/* @__PURE__ */
|
|
423
|
+
/* @__PURE__ */ S("div", {
|
|
398
424
|
className: "grid grid-cols-2 gap-4",
|
|
399
|
-
children: [/* @__PURE__ */
|
|
425
|
+
children: [/* @__PURE__ */ x(p, {
|
|
400
426
|
label: "Work (sec)",
|
|
401
427
|
htmlFor: "drillDuration",
|
|
402
|
-
children: /* @__PURE__ */
|
|
428
|
+
children: /* @__PURE__ */ x("input", {
|
|
403
429
|
id: "drillDuration",
|
|
404
430
|
inputMode: "numeric",
|
|
405
|
-
className:
|
|
431
|
+
className: m,
|
|
406
432
|
value: H.durationSec,
|
|
407
433
|
onChange: (e) => U((t) => ({
|
|
408
434
|
...t,
|
|
409
435
|
durationSec: e.target.value
|
|
410
436
|
}))
|
|
411
437
|
})
|
|
412
|
-
}), /* @__PURE__ */
|
|
438
|
+
}), /* @__PURE__ */ x(p, {
|
|
413
439
|
label: "Rest (sec)",
|
|
414
440
|
htmlFor: "drillRest",
|
|
415
|
-
children: /* @__PURE__ */
|
|
441
|
+
children: /* @__PURE__ */ x("input", {
|
|
416
442
|
id: "drillRest",
|
|
417
443
|
inputMode: "numeric",
|
|
418
|
-
className:
|
|
444
|
+
className: m,
|
|
419
445
|
value: H.restSec,
|
|
420
446
|
onChange: (e) => U((t) => ({
|
|
421
447
|
...t,
|
|
@@ -424,41 +450,41 @@ function P() {
|
|
|
424
450
|
})
|
|
425
451
|
})]
|
|
426
452
|
}),
|
|
427
|
-
/* @__PURE__ */
|
|
453
|
+
/* @__PURE__ */ S(p, {
|
|
428
454
|
label: "Demo video",
|
|
429
455
|
htmlFor: "drillVideo",
|
|
430
456
|
hint: "Optional — attach a short demo clip; it's stored in workspace files.",
|
|
431
|
-
children: [/* @__PURE__ */
|
|
457
|
+
children: [/* @__PURE__ */ x("input", {
|
|
432
458
|
id: "drillVideo",
|
|
433
459
|
type: "file",
|
|
434
460
|
accept: "video/*",
|
|
435
|
-
className:
|
|
461
|
+
className: m,
|
|
436
462
|
onChange: (e) => G(e.target.files?.[0] ?? null)
|
|
437
|
-
}), W && /* @__PURE__ */
|
|
463
|
+
}), W && /* @__PURE__ */ S("p", {
|
|
438
464
|
className: "mt-1 inline-flex items-center gap-1 text-xs text-text-secondary",
|
|
439
465
|
children: [
|
|
440
|
-
/* @__PURE__ */
|
|
466
|
+
/* @__PURE__ */ x(se, { className: "h-3.5 w-3.5" }),
|
|
441
467
|
" ",
|
|
442
468
|
W.name
|
|
443
469
|
]
|
|
444
470
|
})]
|
|
445
471
|
}),
|
|
446
|
-
J && /* @__PURE__ */
|
|
472
|
+
J && /* @__PURE__ */ x("p", {
|
|
447
473
|
className: "text-sm text-status-error-text",
|
|
448
474
|
children: J
|
|
449
475
|
}),
|
|
450
|
-
/* @__PURE__ */
|
|
476
|
+
/* @__PURE__ */ S(D, { children: [/* @__PURE__ */ x("button", {
|
|
451
477
|
type: "button",
|
|
452
478
|
onClick: () => {
|
|
453
479
|
V(!1), G(null);
|
|
454
480
|
},
|
|
455
481
|
className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken",
|
|
456
|
-
children: "Cancel"
|
|
457
|
-
}), /* @__PURE__ */
|
|
482
|
+
children: N("common.cancel", "Cancel")
|
|
483
|
+
}), /* @__PURE__ */ S("button", {
|
|
458
484
|
type: "submit",
|
|
459
485
|
disabled: z.isPending || K,
|
|
460
486
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-60",
|
|
461
|
-
children: [(z.isPending || K) && /* @__PURE__ */
|
|
487
|
+
children: [(z.isPending || K) && /* @__PURE__ */ x(v, { className: "h-4 w-4 animate-spin" }), K ? N("atheletebridge.pages.programDetail.uploadingVideo", "Uploading video…") : N("atheletebridge.pages.programDetail.addDrill", "Add drill")]
|
|
462
488
|
})] })
|
|
463
489
|
]
|
|
464
490
|
})] })
|
|
@@ -467,6 +493,6 @@ function P() {
|
|
|
467
493
|
});
|
|
468
494
|
}
|
|
469
495
|
//#endregion
|
|
470
|
-
export {
|
|
496
|
+
export { N as ProgramDetailPage };
|
|
471
497
|
|
|
472
498
|
//# sourceMappingURL=ProgramDetailPage.js.map
|