@burdenoff/microfe-atheletebridge 2026.1123.2 → 2026.1128.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/admin/AdminDashboardPage.js +4 -0
- package/dist/atheletebridge/admin/AdminDashboardPage.js.map +1 -1
- package/dist/atheletebridge/components/AthleteSelect.js +23 -22
- package/dist/atheletebridge/components/AthleteSelect.js.map +1 -1
- package/dist/atheletebridge/components/EmptyState.d.ts +8 -0
- package/dist/atheletebridge/components/EmptyState.js +42 -29
- package/dist/atheletebridge/components/EmptyState.js.map +1 -1
- package/dist/atheletebridge/components/FilterSelect.js +10 -9
- package/dist/atheletebridge/components/FilterSelect.js.map +1 -1
- package/dist/atheletebridge/components/ai/AgentRunFeed.js.map +1 -1
- package/dist/atheletebridge/components/ai/AiModelPicker.js +49 -49
- package/dist/atheletebridge/components/ai/AiModelPicker.js.map +1 -1
- package/dist/atheletebridge/components/ai/DecisionCard.js +16 -16
- package/dist/atheletebridge/components/ai/DecisionCard.js.map +1 -1
- package/dist/atheletebridge/components/ai/RunDecisionPanel.js +42 -42
- package/dist/atheletebridge/components/ai/RunDecisionPanel.js.map +1 -1
- package/dist/atheletebridge/components/analytics/AiInsightsPanel.js +52 -52
- package/dist/atheletebridge/components/analytics/AiInsightsPanel.js.map +1 -1
- package/dist/atheletebridge/components/registration/RegistrationEntryFields.js +24 -23
- package/dist/atheletebridge/components/registration/RegistrationEntryFields.js.map +1 -1
- package/dist/atheletebridge/components/wearables/ConnectedDevicesPanel.js.map +1 -1
- package/dist/atheletebridge/pages/DashboardPage.js.map +1 -1
- package/dist/atheletebridge/pages/StandingsPage.js.map +1 -1
- package/dist/atheletebridge/pages/analytics/CoachAnalyticsPage.js.map +1 -1
- package/dist/atheletebridge/pages/athletes/AthleteProfilePage.js +1 -0
- package/dist/atheletebridge/pages/athletes/AthleteProfilePage.js.map +1 -1
- package/dist/atheletebridge/pages/audit/AuditLogPage.js +1 -0
- package/dist/atheletebridge/pages/audit/AuditLogPage.js.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixtureDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixtureFormPage.js +56 -56
- package/dist/atheletebridge/pages/fixtures/FixtureFormPage.js.map +1 -1
- package/dist/atheletebridge/pages/fixtures/FixturesListPage.js +1 -0
- package/dist/atheletebridge/pages/fixtures/FixturesListPage.js.map +1 -1
- package/dist/atheletebridge/pages/marketplace/MarketplacePage.js +97 -97
- package/dist/atheletebridge/pages/marketplace/MarketplacePage.js.map +1 -1
- package/dist/atheletebridge/pages/onboarding/OnboardingPage.js +34 -34
- package/dist/atheletebridge/pages/onboarding/OnboardingPage.js.map +1 -1
- package/dist/atheletebridge/pages/performance/PerformancePage.js +182 -182
- package/dist/atheletebridge/pages/performance/PerformancePage.js.map +1 -1
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.js +13 -13
- package/dist/atheletebridge/pages/programs/ProgramDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/programs/ProgramFormPage.js +61 -60
- package/dist/atheletebridge/pages/programs/ProgramFormPage.js.map +1 -1
- package/dist/atheletebridge/pages/programs/ProgramsListPage.js +1 -0
- package/dist/atheletebridge/pages/programs/ProgramsListPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.js +26 -21
- package/dist/atheletebridge/pages/registrations/MyRegistrationsPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegisterPage.js +1 -0
- package/dist/atheletebridge/pages/registrations/RegisterPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.js +205 -204
- package/dist/atheletebridge/pages/registrations/RegistrationFormBuilderPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.js +121 -115
- package/dist/atheletebridge/pages/registrations/RegistrationFormDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js +59 -40
- package/dist/atheletebridge/pages/registrations/RegistrationSubmissionPage.js.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionFormPage.js +59 -59
- package/dist/atheletebridge/pages/sessions/SessionFormPage.js.map +1 -1
- package/dist/atheletebridge/pages/sessions/SessionsListPage.js +1 -0
- package/dist/atheletebridge/pages/sessions/SessionsListPage.js.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamDetailPage.js +143 -143
- package/dist/atheletebridge/pages/teams/TeamDetailPage.js.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamFormPage.js +72 -72
- package/dist/atheletebridge/pages/teams/TeamFormPage.js.map +1 -1
- package/dist/atheletebridge/pages/teams/TeamsListPage.js +1 -0
- package/dist/atheletebridge/pages/teams/TeamsListPage.js.map +1 -1
- package/dist/atheletebridge/pages/tournaments/TournamentBracketPage.js.map +1 -1
- package/package.json +3 -3
|
@@ -13,10 +13,10 @@ import { safeExternalHref as ge } from "../../utils/url.js";
|
|
|
13
13
|
import { useEffect as _e, useMemo as ve, useRef as ye, useState as l } from "react";
|
|
14
14
|
import { CheckCircle2 as be, Download as xe, ExternalLink as Se, Loader2 as u, Plus as d, Search as Ce, ShoppingBag as we, Sparkles as Te, Star as Ee, Store as De } from "lucide-react";
|
|
15
15
|
import { Fragment as Oe, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
16
|
-
import { Badge as m, GlassCard as h, GradientText as ke, ResponsiveDialog as g, ResponsiveDialogContent as _, ResponsiveDialogFooter as v, ResponsiveDialogHeader as y, ResponsiveDialogTitle as b, Tabs as Ae, TabsContent as x, TabsList as je, TabsTrigger as S } from "@burdenoff/fe-libs/ui";
|
|
16
|
+
import { Badge as m, GlassCard as h, GradientText as ke, ResponsiveDialog as g, ResponsiveDialogContent as _, ResponsiveDialogFooter as v, ResponsiveDialogHeader as y, ResponsiveDialogTitle as b, Tabs as Ae, TabsContent as x, TabsList as je, TabsTrigger as S, ThemedSelect as C } from "@burdenoff/fe-libs/ui";
|
|
17
17
|
// src/atheletebridge/pages/marketplace/MarketplacePage.tsx
|
|
18
18
|
var Me = Object.keys(s), Ne = Object.keys(o);
|
|
19
|
-
function
|
|
19
|
+
function w(e, t) {
|
|
20
20
|
if (e <= 0) return "Free";
|
|
21
21
|
try {
|
|
22
22
|
return new Intl.NumberFormat(void 0, {
|
|
@@ -27,26 +27,26 @@ function C(e, t) {
|
|
|
27
27
|
return `${(e / 100).toFixed(2)} ${t}`;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
let { navigateTo:
|
|
32
|
-
search:
|
|
33
|
-
sport:
|
|
34
|
-
level:
|
|
35
|
-
freeOnly:
|
|
36
|
-
}),
|
|
30
|
+
function T() {
|
|
31
|
+
let { navigateTo: T, currentUser: E } = ne(), [D, Pe] = l(""), [O, Fe] = l(""), [k, Ie] = l(""), [A, Le] = l(!1), j = ce({
|
|
32
|
+
search: D || void 0,
|
|
33
|
+
sport: O || void 0,
|
|
34
|
+
level: k || void 0,
|
|
35
|
+
freeOnly: A || void 0
|
|
36
|
+
}), M = de(), N = ue(), Re = re({ pagination: { limit: 50 } }), ze = ie({ pagination: { limit: 50 } }), P = ae(), Be = pe(), Ve = oe(), F = se(), I = fe(), L = he(), R = me(), [He, z] = l(null), Ue = ye(!1), { mutateAsync: We } = Ve;
|
|
37
37
|
_e(() => {
|
|
38
38
|
if (Ue.current) return;
|
|
39
39
|
let e = new URLSearchParams(window.location.search), t = e.get("athMarketplacePurchase"), n = e.get("status");
|
|
40
40
|
t && n === "success" && (Ue.current = !0, We(t).then(() => {
|
|
41
|
-
|
|
41
|
+
z("Purchase confirmed! Your immutable training plan snapshot is in My Library.");
|
|
42
42
|
}).catch(() => {
|
|
43
|
-
|
|
43
|
+
z("Checking payment status — refresh My Library in a moment.");
|
|
44
44
|
}));
|
|
45
45
|
}, [We]);
|
|
46
|
-
let [Ge,
|
|
47
|
-
|
|
46
|
+
let [Ge, B] = l(!1), [V, Ke] = l(""), [qe, Je] = l(""), [Ye, Xe] = l(""), [Ze, Qe] = l(E?.name || E?.firstName || "Head Coach"), [$e, et] = l("0"), [tt, nt] = l("USD"), [rt, it] = l(!0), [at, H] = l(null), [U, W] = l(null), [ot, st] = l(""), [ct, lt] = l(""), [G, K] = l(null), [q, J] = l(null), [ut, dt] = l(5), [ft, Y] = l(""), [pt, X] = l(null), [Z, Q] = l(null), $ = le(Z?.id), [mt, ht] = l(null), gt = ve(() => new Set((N.data ?? []).filter((e) => e.status === "COMPLETED").map((e) => e.listingId)), [N.data]), _t = async (e) => {
|
|
47
|
+
ht(null);
|
|
48
48
|
try {
|
|
49
|
-
if (e.priceCents <= 0) await
|
|
49
|
+
if (e.priceCents <= 0) await P.mutateAsync(e.id), z(`Acquired "${e.title}" — open My Library to import it into your workspace.`);
|
|
50
50
|
else {
|
|
51
51
|
let t = await Be.mutateAsync({
|
|
52
52
|
listingId: e.id,
|
|
@@ -55,7 +55,7 @@ function w() {
|
|
|
55
55
|
n && window.location.assign(n);
|
|
56
56
|
}
|
|
57
57
|
} catch (e) {
|
|
58
|
-
|
|
58
|
+
ht(e instanceof Error ? e.message : "Unable to acquire training plan.");
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
61
|
return /* @__PURE__ */ p(e, {
|
|
@@ -70,7 +70,7 @@ function w() {
|
|
|
70
70
|
actions: /* @__PURE__ */ p("button", {
|
|
71
71
|
type: "button",
|
|
72
72
|
onClick: () => {
|
|
73
|
-
|
|
73
|
+
H(null), B(!0);
|
|
74
74
|
},
|
|
75
75
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-semibold text-action-primary-text transition-colors hover:bg-action-primary-bg/90",
|
|
76
76
|
children: [/* @__PURE__ */ f(d, { className: "h-4 w-4" }), " Publish a plan"]
|
|
@@ -99,7 +99,7 @@ function w() {
|
|
|
99
99
|
children: [
|
|
100
100
|
/* @__PURE__ */ f(we, { className: "mr-1.5 h-4 w-4" }),
|
|
101
101
|
" My Library (",
|
|
102
|
-
(
|
|
102
|
+
(N.data ?? []).length,
|
|
103
103
|
")"
|
|
104
104
|
]
|
|
105
105
|
}),
|
|
@@ -108,7 +108,7 @@ function w() {
|
|
|
108
108
|
children: [
|
|
109
109
|
/* @__PURE__ */ f(Te, { className: "mr-1.5 h-4 w-4" }),
|
|
110
110
|
" Coach Studio (",
|
|
111
|
-
|
|
111
|
+
M.data?.items.length ?? 0,
|
|
112
112
|
")"
|
|
113
113
|
]
|
|
114
114
|
})
|
|
@@ -127,14 +127,14 @@ function w() {
|
|
|
127
127
|
type: "search",
|
|
128
128
|
"aria-label": "Search marketplace training plans",
|
|
129
129
|
placeholder: "Search plans, coaches, sports…",
|
|
130
|
-
value:
|
|
130
|
+
value: D,
|
|
131
131
|
onChange: (e) => Pe(e.target.value),
|
|
132
132
|
className: `${a} pl-9`
|
|
133
133
|
})]
|
|
134
134
|
}),
|
|
135
|
-
/* @__PURE__ */ p(
|
|
135
|
+
/* @__PURE__ */ p(C, {
|
|
136
136
|
"aria-label": "Filter by sport",
|
|
137
|
-
value:
|
|
137
|
+
value: O,
|
|
138
138
|
onChange: (e) => Fe(e.target.value),
|
|
139
139
|
className: a,
|
|
140
140
|
children: [/* @__PURE__ */ f("option", {
|
|
@@ -147,9 +147,9 @@ function w() {
|
|
|
147
147
|
}),
|
|
148
148
|
/* @__PURE__ */ p("div", {
|
|
149
149
|
className: "flex items-center gap-2",
|
|
150
|
-
children: [/* @__PURE__ */ p(
|
|
150
|
+
children: [/* @__PURE__ */ p(C, {
|
|
151
151
|
"aria-label": "Filter by level",
|
|
152
|
-
value:
|
|
152
|
+
value: k,
|
|
153
153
|
onChange: (e) => Ie(e.target.value),
|
|
154
154
|
className: a,
|
|
155
155
|
children: [/* @__PURE__ */ f("option", {
|
|
@@ -163,31 +163,31 @@ function w() {
|
|
|
163
163
|
className: "flex shrink-0 items-center gap-1.5 text-xs text-text-secondary",
|
|
164
164
|
children: [/* @__PURE__ */ f("input", {
|
|
165
165
|
type: "checkbox",
|
|
166
|
-
checked:
|
|
166
|
+
checked: A,
|
|
167
167
|
onChange: (e) => Le(e.target.checked)
|
|
168
168
|
}), "Free"]
|
|
169
169
|
})]
|
|
170
170
|
})
|
|
171
171
|
]
|
|
172
|
-
}),
|
|
172
|
+
}), j.isLoading ? /* @__PURE__ */ f(r, { label: "Loading marketplace training plans…" }) : j.isError ? /* @__PURE__ */ f(ee, {
|
|
173
173
|
title: "Marketplace unavailable",
|
|
174
174
|
message: "Could not load training plan listings.",
|
|
175
|
-
onRetry: () => void
|
|
176
|
-
}) : (
|
|
175
|
+
onRetry: () => void j.refetch()
|
|
176
|
+
}) : (j.data?.items ?? []).length === 0 ? /* @__PURE__ */ f(t, {
|
|
177
177
|
illustration: "empty-data",
|
|
178
178
|
icon: /* @__PURE__ */ f(De, { className: "h-10 w-10" }),
|
|
179
179
|
title: "No training plans published yet",
|
|
180
180
|
description: "Publish one of your workspace training programs to be the first coach on the AthleteBridge marketplace.",
|
|
181
181
|
action: /* @__PURE__ */ p("button", {
|
|
182
182
|
type: "button",
|
|
183
|
-
onClick: () =>
|
|
183
|
+
onClick: () => B(!0),
|
|
184
184
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-semibold text-action-primary-text",
|
|
185
185
|
children: [/* @__PURE__ */ f(d, { className: "h-4 w-4" }), " Publish a plan"]
|
|
186
186
|
})
|
|
187
187
|
}) : /* @__PURE__ */ f("div", {
|
|
188
188
|
className: "grid grid-cols-1 gap-5 md:grid-cols-2 lg:grid-cols-3",
|
|
189
|
-
children: (
|
|
190
|
-
let t = te[e.sport], n =
|
|
189
|
+
children: (j.data?.items ?? []).map((e) => {
|
|
190
|
+
let t = te[e.sport], n = gt.has(e.id);
|
|
191
191
|
return /* @__PURE__ */ p(h, {
|
|
192
192
|
treatment: "insight",
|
|
193
193
|
className: "flex flex-col gap-4 p-5",
|
|
@@ -212,7 +212,7 @@ function w() {
|
|
|
212
212
|
})] })]
|
|
213
213
|
}), /* @__PURE__ */ f(m, {
|
|
214
214
|
variant: e.priceCents === 0 ? "default" : "secondary",
|
|
215
|
-
children:
|
|
215
|
+
children: w(e.priceCents, e.currency)
|
|
216
216
|
})]
|
|
217
217
|
}),
|
|
218
218
|
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("h3", {
|
|
@@ -264,13 +264,13 @@ function w() {
|
|
|
264
264
|
className: "mt-auto flex items-center gap-2 pt-2",
|
|
265
265
|
children: [/* @__PURE__ */ f("button", {
|
|
266
266
|
type: "button",
|
|
267
|
-
onClick: () => void
|
|
268
|
-
disabled:
|
|
267
|
+
onClick: () => void _t(e),
|
|
268
|
+
disabled: P.isPending || Be.isPending || e.priceCents > 0 && !e.paidCheckoutReady,
|
|
269
269
|
className: "inline-flex flex-1 items-center justify-center gap-1.5 rounded-lg bg-action-primary-bg px-3 py-2 text-xs font-semibold text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-50",
|
|
270
|
-
children: n ? "In My Library" : e.priceCents === 0 ? "Get Free Plan" : e.paidCheckoutReady ? `Buy ${
|
|
270
|
+
children: n ? "In My Library" : e.priceCents === 0 ? "Get Free Plan" : e.paidCheckoutReady ? `Buy ${w(e.priceCents, e.currency)}` : "Checkout Pending Setup"
|
|
271
271
|
}), /* @__PURE__ */ f("button", {
|
|
272
272
|
type: "button",
|
|
273
|
-
onClick: () =>
|
|
273
|
+
onClick: () => Q(e),
|
|
274
274
|
className: "rounded-lg border border-border-seam px-3 py-2 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
275
275
|
children: "Reviews"
|
|
276
276
|
})]
|
|
@@ -283,14 +283,14 @@ function w() {
|
|
|
283
283
|
/* @__PURE__ */ f(x, {
|
|
284
284
|
value: "library",
|
|
285
285
|
className: "space-y-4",
|
|
286
|
-
children:
|
|
286
|
+
children: N.isLoading ? /* @__PURE__ */ f(r, { label: "Loading your purchased plan snapshots…" }) : (N.data ?? []).length === 0 ? /* @__PURE__ */ f(t, {
|
|
287
287
|
illustration: "empty-data",
|
|
288
288
|
icon: /* @__PURE__ */ f(we, { className: "h-10 w-10" }),
|
|
289
289
|
title: "Your training plan library is empty",
|
|
290
290
|
description: "Acquire a free or paid training plan from Discover to lock in an immutable snapshot and import it into your workspace."
|
|
291
291
|
}) : /* @__PURE__ */ f("div", {
|
|
292
292
|
className: "grid grid-cols-1 gap-4 md:grid-cols-2",
|
|
293
|
-
children: (
|
|
293
|
+
children: (N.data ?? []).map((e) => {
|
|
294
294
|
let t = e.planSnapshot, n = typeof t?.title == "string" && t.title || e.listing?.title || "Purchased Plan", ee = Array.isArray(t?.drills) ? t.drills.length : 0;
|
|
295
295
|
return /* @__PURE__ */ p(h, {
|
|
296
296
|
treatment: "insight",
|
|
@@ -308,7 +308,7 @@ function w() {
|
|
|
308
308
|
ee,
|
|
309
309
|
" drills ·",
|
|
310
310
|
" ",
|
|
311
|
-
|
|
311
|
+
w(e.priceCents, e.currency)
|
|
312
312
|
]
|
|
313
313
|
})] }), /* @__PURE__ */ f(m, {
|
|
314
314
|
variant: e.status === "COMPLETED" ? "default" : "secondary",
|
|
@@ -325,21 +325,21 @@ function w() {
|
|
|
325
325
|
/* @__PURE__ */ p("button", {
|
|
326
326
|
type: "button",
|
|
327
327
|
onClick: () => {
|
|
328
|
-
|
|
328
|
+
K(null), st(n), lt(""), W(e);
|
|
329
329
|
},
|
|
330
330
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-3 py-1.5 text-xs font-semibold text-action-primary-text hover:bg-action-primary-bg/90",
|
|
331
331
|
children: [/* @__PURE__ */ f(xe, { className: "h-3.5 w-3.5" }), e.importedProgramId ? "Import copy again" : "Import to workspace"]
|
|
332
332
|
}),
|
|
333
333
|
e.importedProgramId ? /* @__PURE__ */ p("button", {
|
|
334
334
|
type: "button",
|
|
335
|
-
onClick: () =>
|
|
335
|
+
onClick: () => T(`/programs/${e.importedProgramId}`),
|
|
336
336
|
className: "inline-flex items-center gap-1 rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
337
337
|
children: ["Open program ", /* @__PURE__ */ f(Se, { className: "h-3.5 w-3.5" })]
|
|
338
338
|
}) : null,
|
|
339
339
|
/* @__PURE__ */ p("button", {
|
|
340
340
|
type: "button",
|
|
341
341
|
onClick: () => {
|
|
342
|
-
|
|
342
|
+
X(null), dt(5), Y(""), J(e);
|
|
343
343
|
},
|
|
344
344
|
className: "inline-flex items-center gap-1 rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
345
345
|
children: [/* @__PURE__ */ f(Ee, { className: "h-3.5 w-3.5" }), " Review"]
|
|
@@ -368,24 +368,24 @@ function w() {
|
|
|
368
368
|
})]
|
|
369
369
|
}), /* @__PURE__ */ f("button", {
|
|
370
370
|
type: "button",
|
|
371
|
-
onClick: () =>
|
|
371
|
+
onClick: () => T("/registrations"),
|
|
372
372
|
className: "rounded-lg border border-border-seam px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
373
373
|
children: "Manage Payout Account"
|
|
374
374
|
})]
|
|
375
|
-
}), (
|
|
375
|
+
}), (M.data?.items ?? []).length === 0 ? /* @__PURE__ */ f(t, {
|
|
376
376
|
illustration: "empty-data",
|
|
377
377
|
icon: /* @__PURE__ */ f(Te, { className: "h-10 w-10" }),
|
|
378
378
|
title: "You haven't published any training plans yet",
|
|
379
379
|
description: "Turn any of your authored workspace training programs (with drills) into a free or paid marketplace listing.",
|
|
380
380
|
action: /* @__PURE__ */ p("button", {
|
|
381
381
|
type: "button",
|
|
382
|
-
onClick: () =>
|
|
382
|
+
onClick: () => B(!0),
|
|
383
383
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-semibold text-action-primary-text",
|
|
384
384
|
children: [/* @__PURE__ */ f(d, { className: "h-4 w-4" }), " Publish a plan"]
|
|
385
385
|
})
|
|
386
386
|
}) : /* @__PURE__ */ f("div", {
|
|
387
387
|
className: "grid grid-cols-1 gap-4 md:grid-cols-2",
|
|
388
|
-
children: (
|
|
388
|
+
children: (M.data?.items ?? []).map((e) => /* @__PURE__ */ p(h, {
|
|
389
389
|
treatment: "insight",
|
|
390
390
|
className: "flex flex-col gap-3 p-5",
|
|
391
391
|
children: [/* @__PURE__ */ p("div", {
|
|
@@ -396,7 +396,7 @@ function w() {
|
|
|
396
396
|
}), /* @__PURE__ */ p("p", {
|
|
397
397
|
className: "text-xs text-text-muted",
|
|
398
398
|
children: [
|
|
399
|
-
|
|
399
|
+
w(e.priceCents, e.currency),
|
|
400
400
|
" · ",
|
|
401
401
|
e.drillCount,
|
|
402
402
|
" drills ·",
|
|
@@ -412,7 +412,7 @@ function w() {
|
|
|
412
412
|
className: "flex flex-wrap gap-2 pt-2",
|
|
413
413
|
children: [e.status === "PUBLISHED" ? /* @__PURE__ */ f("button", {
|
|
414
414
|
type: "button",
|
|
415
|
-
onClick: () => void
|
|
415
|
+
onClick: () => void L.mutate({
|
|
416
416
|
id: e.id,
|
|
417
417
|
input: { status: "UNLISTED" }
|
|
418
418
|
}),
|
|
@@ -420,7 +420,7 @@ function w() {
|
|
|
420
420
|
children: "Unlist"
|
|
421
421
|
}) : /* @__PURE__ */ f("button", {
|
|
422
422
|
type: "button",
|
|
423
|
-
onClick: () => void
|
|
423
|
+
onClick: () => void L.mutate({
|
|
424
424
|
id: e.id,
|
|
425
425
|
input: { status: "PUBLISHED" }
|
|
426
426
|
}),
|
|
@@ -428,7 +428,7 @@ function w() {
|
|
|
428
428
|
children: "Publish"
|
|
429
429
|
}), /* @__PURE__ */ f("button", {
|
|
430
430
|
type: "button",
|
|
431
|
-
onClick: () => void
|
|
431
|
+
onClick: () => void L.mutate({
|
|
432
432
|
id: e.id,
|
|
433
433
|
input: { status: "ARCHIVED" }
|
|
434
434
|
}),
|
|
@@ -443,26 +443,26 @@ function w() {
|
|
|
443
443
|
}),
|
|
444
444
|
/* @__PURE__ */ f(g, {
|
|
445
445
|
open: Ge,
|
|
446
|
-
onOpenChange:
|
|
446
|
+
onOpenChange: B,
|
|
447
447
|
children: /* @__PURE__ */ p(_, { children: [/* @__PURE__ */ f(y, { children: /* @__PURE__ */ f(b, { children: "Publish Training Plan to Marketplace" }) }), /* @__PURE__ */ p("form", {
|
|
448
448
|
onSubmit: async (e) => {
|
|
449
|
-
if (e.preventDefault(),
|
|
450
|
-
|
|
449
|
+
if (e.preventDefault(), H(null), !V) {
|
|
450
|
+
H("Select a training program to publish.");
|
|
451
451
|
return;
|
|
452
452
|
}
|
|
453
453
|
let t = Math.max(0, Math.round((Number.parseFloat($e) || 0) * 100));
|
|
454
454
|
try {
|
|
455
|
-
await
|
|
456
|
-
programId:
|
|
455
|
+
await I.mutateAsync({
|
|
456
|
+
programId: V,
|
|
457
457
|
title: qe.trim() || void 0,
|
|
458
458
|
summary: Ye.trim() || void 0,
|
|
459
459
|
sellerDisplayName: Ze.trim() || "Coach",
|
|
460
460
|
priceCents: t,
|
|
461
461
|
currency: tt.trim().toUpperCase() || "USD",
|
|
462
462
|
publishImmediately: rt
|
|
463
|
-
}),
|
|
463
|
+
}), B(!1), Je(""), Xe(""), et("0");
|
|
464
464
|
} catch (e) {
|
|
465
|
-
|
|
465
|
+
H(e instanceof Error ? e.message : "Failed to publish listing.");
|
|
466
466
|
}
|
|
467
467
|
},
|
|
468
468
|
className: "space-y-4 px-1",
|
|
@@ -470,10 +470,10 @@ function w() {
|
|
|
470
470
|
/* @__PURE__ */ f(i, {
|
|
471
471
|
label: "Source training program",
|
|
472
472
|
htmlFor: "pub-program",
|
|
473
|
-
children: /* @__PURE__ */ p(
|
|
473
|
+
children: /* @__PURE__ */ p(C, {
|
|
474
474
|
id: "pub-program",
|
|
475
475
|
className: a,
|
|
476
|
-
value:
|
|
476
|
+
value: V,
|
|
477
477
|
onChange: (e) => Ke(e.target.value),
|
|
478
478
|
required: !0,
|
|
479
479
|
children: [/* @__PURE__ */ f("option", {
|
|
@@ -566,34 +566,34 @@ function w() {
|
|
|
566
566
|
}) : null,
|
|
567
567
|
/* @__PURE__ */ p(v, { children: [/* @__PURE__ */ f("button", {
|
|
568
568
|
type: "button",
|
|
569
|
-
onClick: () =>
|
|
569
|
+
onClick: () => B(!1),
|
|
570
570
|
className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
571
571
|
children: "Cancel"
|
|
572
572
|
}), /* @__PURE__ */ p("button", {
|
|
573
573
|
type: "submit",
|
|
574
|
-
disabled:
|
|
574
|
+
disabled: I.isPending,
|
|
575
575
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-semibold text-action-primary-text disabled:opacity-60",
|
|
576
|
-
children: [
|
|
576
|
+
children: [I.isPending ? /* @__PURE__ */ f(u, { className: "h-4 w-4 animate-spin" }) : null, "Create listing"]
|
|
577
577
|
})] })
|
|
578
578
|
]
|
|
579
579
|
})] })
|
|
580
580
|
}),
|
|
581
581
|
/* @__PURE__ */ f(g, {
|
|
582
|
-
open: !!
|
|
583
|
-
onOpenChange: (e) => !e &&
|
|
582
|
+
open: !!U,
|
|
583
|
+
onOpenChange: (e) => !e && W(null),
|
|
584
584
|
children: /* @__PURE__ */ p(_, { children: [/* @__PURE__ */ f(y, { children: /* @__PURE__ */ f(b, { children: "Import Plan Snapshot into Workspace" }) }), /* @__PURE__ */ p("form", {
|
|
585
585
|
onSubmit: async (e) => {
|
|
586
|
-
if (e.preventDefault(),
|
|
587
|
-
|
|
586
|
+
if (e.preventDefault(), U) {
|
|
587
|
+
K(null);
|
|
588
588
|
try {
|
|
589
|
-
let e = await
|
|
590
|
-
purchaseId:
|
|
589
|
+
let e = await F.mutateAsync({
|
|
590
|
+
purchaseId: U.id,
|
|
591
591
|
customName: ot.trim() || void 0,
|
|
592
592
|
assignTeamId: ct || void 0
|
|
593
593
|
});
|
|
594
|
-
|
|
594
|
+
W(null), T(`/programs/${e.program.id}`);
|
|
595
595
|
} catch (e) {
|
|
596
|
-
|
|
596
|
+
K(e instanceof Error ? e.message : "Failed to import training plan.");
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
599
|
},
|
|
@@ -614,7 +614,7 @@ function w() {
|
|
|
614
614
|
label: "Assign to team (optional)",
|
|
615
615
|
htmlFor: "imp-team",
|
|
616
616
|
hint: "You can also assign or edit drills after importing.",
|
|
617
|
-
children: /* @__PURE__ */ p(
|
|
617
|
+
children: /* @__PURE__ */ p(C, {
|
|
618
618
|
id: "imp-team",
|
|
619
619
|
className: a,
|
|
620
620
|
value: ct,
|
|
@@ -628,40 +628,40 @@ function w() {
|
|
|
628
628
|
}, e.id))]
|
|
629
629
|
})
|
|
630
630
|
}),
|
|
631
|
-
|
|
631
|
+
G ? /* @__PURE__ */ f("p", {
|
|
632
632
|
className: "text-xs text-status-error-text",
|
|
633
|
-
children:
|
|
633
|
+
children: G
|
|
634
634
|
}) : null,
|
|
635
635
|
/* @__PURE__ */ p(v, { children: [/* @__PURE__ */ f("button", {
|
|
636
636
|
type: "button",
|
|
637
|
-
onClick: () =>
|
|
637
|
+
onClick: () => W(null),
|
|
638
638
|
className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
639
639
|
children: "Cancel"
|
|
640
640
|
}), /* @__PURE__ */ p("button", {
|
|
641
641
|
type: "submit",
|
|
642
|
-
disabled:
|
|
642
|
+
disabled: F.isPending,
|
|
643
643
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-semibold text-action-primary-text disabled:opacity-60",
|
|
644
|
-
children: [
|
|
644
|
+
children: [F.isPending ? /* @__PURE__ */ f(u, { className: "h-4 w-4 animate-spin" }) : null, "Import program"]
|
|
645
645
|
})] })
|
|
646
646
|
]
|
|
647
647
|
})] })
|
|
648
648
|
}),
|
|
649
649
|
/* @__PURE__ */ f(g, {
|
|
650
|
-
open: !!
|
|
651
|
-
onOpenChange: (e) => !e &&
|
|
650
|
+
open: !!q,
|
|
651
|
+
onOpenChange: (e) => !e && J(null),
|
|
652
652
|
children: /* @__PURE__ */ p(_, { children: [/* @__PURE__ */ f(y, { children: /* @__PURE__ */ f(b, { children: "Review Training Plan" }) }), /* @__PURE__ */ p("form", {
|
|
653
653
|
onSubmit: async (e) => {
|
|
654
|
-
if (e.preventDefault(),
|
|
655
|
-
|
|
654
|
+
if (e.preventDefault(), q) {
|
|
655
|
+
X(null);
|
|
656
656
|
try {
|
|
657
|
-
await
|
|
658
|
-
listingId:
|
|
659
|
-
rating:
|
|
657
|
+
await R.mutateAsync({
|
|
658
|
+
listingId: q.listingId,
|
|
659
|
+
rating: ut,
|
|
660
660
|
comment: ft.trim() || void 0,
|
|
661
|
-
reviewerName:
|
|
662
|
-
}),
|
|
661
|
+
reviewerName: E?.name || E?.firstName || void 0
|
|
662
|
+
}), J(null), Y("");
|
|
663
663
|
} catch (e) {
|
|
664
|
-
|
|
664
|
+
X(e instanceof Error ? e.message : "Failed to submit review.");
|
|
665
665
|
}
|
|
666
666
|
}
|
|
667
667
|
},
|
|
@@ -670,7 +670,7 @@ function w() {
|
|
|
670
670
|
/* @__PURE__ */ f(i, {
|
|
671
671
|
label: "Rating",
|
|
672
672
|
children: /* @__PURE__ */ f(n, {
|
|
673
|
-
value:
|
|
673
|
+
value: ut,
|
|
674
674
|
onChange: dt,
|
|
675
675
|
size: 28,
|
|
676
676
|
showLabels: !0
|
|
@@ -684,7 +684,7 @@ function w() {
|
|
|
684
684
|
rows: 3,
|
|
685
685
|
className: a,
|
|
686
686
|
value: ft,
|
|
687
|
-
onChange: (e) =>
|
|
687
|
+
onChange: (e) => Y(e.target.value),
|
|
688
688
|
placeholder: "How well did this plan work for your athletes?"
|
|
689
689
|
})
|
|
690
690
|
}),
|
|
@@ -694,29 +694,29 @@ function w() {
|
|
|
694
694
|
}) : null,
|
|
695
695
|
/* @__PURE__ */ p(v, { children: [/* @__PURE__ */ f("button", {
|
|
696
696
|
type: "button",
|
|
697
|
-
onClick: () =>
|
|
697
|
+
onClick: () => J(null),
|
|
698
698
|
className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
699
699
|
children: "Cancel"
|
|
700
700
|
}), /* @__PURE__ */ p("button", {
|
|
701
701
|
type: "submit",
|
|
702
|
-
disabled:
|
|
702
|
+
disabled: R.isPending,
|
|
703
703
|
className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-semibold text-action-primary-text disabled:opacity-60",
|
|
704
|
-
children: [
|
|
704
|
+
children: [R.isPending ? /* @__PURE__ */ f(u, { className: "h-4 w-4 animate-spin" }) : null, "Submit review"]
|
|
705
705
|
})] })
|
|
706
706
|
]
|
|
707
707
|
})] })
|
|
708
708
|
}),
|
|
709
709
|
/* @__PURE__ */ f(g, {
|
|
710
|
-
open: !!
|
|
711
|
-
onOpenChange: (e) => !e &&
|
|
710
|
+
open: !!Z,
|
|
711
|
+
onOpenChange: (e) => !e && Q(null),
|
|
712
712
|
children: /* @__PURE__ */ p(_, { children: [
|
|
713
|
-
/* @__PURE__ */ f(y, { children: /* @__PURE__ */ p(b, { children: ["Verified Reviews · ",
|
|
713
|
+
/* @__PURE__ */ f(y, { children: /* @__PURE__ */ p(b, { children: ["Verified Reviews · ", Z?.title] }) }),
|
|
714
714
|
/* @__PURE__ */ f("div", {
|
|
715
715
|
className: "max-h-72 space-y-3 overflow-y-auto px-1",
|
|
716
|
-
children:
|
|
716
|
+
children: $.isLoading ? /* @__PURE__ */ f(r, { label: "Loading reviews…" }) : ($.data ?? []).length === 0 ? /* @__PURE__ */ f("p", {
|
|
717
717
|
className: "py-6 text-center text-xs text-text-muted",
|
|
718
718
|
children: "No verified reviews yet."
|
|
719
|
-
}) : (
|
|
719
|
+
}) : ($.data ?? []).map((e) => /* @__PURE__ */ p("div", {
|
|
720
720
|
className: "rounded-lg border border-border-seam bg-bg-sunken/50 p-3 text-xs",
|
|
721
721
|
children: [
|
|
722
722
|
/* @__PURE__ */ p("div", {
|
|
@@ -742,7 +742,7 @@ function w() {
|
|
|
742
742
|
}),
|
|
743
743
|
/* @__PURE__ */ f(v, { children: /* @__PURE__ */ f("button", {
|
|
744
744
|
type: "button",
|
|
745
|
-
onClick: () =>
|
|
745
|
+
onClick: () => Q(null),
|
|
746
746
|
className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
747
747
|
children: "Close"
|
|
748
748
|
}) })
|
|
@@ -751,6 +751,6 @@ function w() {
|
|
|
751
751
|
]
|
|
752
752
|
});
|
|
753
753
|
}
|
|
754
|
-
export {
|
|
754
|
+
export { T as MarketplacePage };
|
|
755
755
|
|
|
756
756
|
//# sourceMappingURL=MarketplacePage.js.map
|