@burdenoff/microfe-atheletebridge 2026.1124.1 → 2026.1128.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/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/PageLayout.js +3 -3
- package/dist/atheletebridge/components/PageLayout.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
|
@@ -5,11 +5,12 @@ import { useAthleteBridge as a } from "../../context/AthleteBridgeContext.js";
|
|
|
5
5
|
import { useFixtures as o, useTeams as s } from "../../hooks/useAthleteBridgeApi.js";
|
|
6
6
|
import { useCreateRegistrationForm as c, useRegistrationForm as l, useUpdateRegistrationForm as u } from "../../hooks/useRegistrationApi.js";
|
|
7
7
|
import { minorToInput as d, parseMoney as f } from "../../utils/money.js";
|
|
8
|
-
import { keyFromLabel as
|
|
9
|
-
import { useEffect as
|
|
10
|
-
import { ArrowDown as
|
|
11
|
-
import { useParams as
|
|
12
|
-
import { jsx as
|
|
8
|
+
import { keyFromLabel as ee } from "../../utils/registration.js";
|
|
9
|
+
import { useEffect as p, useRef as m, useState as h } from "react";
|
|
10
|
+
import { ArrowDown as g, ArrowLeft as _, ArrowUp as v, Loader2 as y, Plus as b, Save as x, Trash2 as S } from "lucide-react";
|
|
11
|
+
import { useParams as C } from "react-router";
|
|
12
|
+
import { jsx as w, jsxs as T } from "react/jsx-runtime";
|
|
13
|
+
import { ThemedSelect as E } from "@burdenoff/fe-libs/ui";
|
|
13
14
|
// src/atheletebridge/pages/registrations/RegistrationFormBuilderPage.tsx
|
|
14
15
|
var D = {
|
|
15
16
|
SHORT_TEXT: "Short text",
|
|
@@ -52,7 +53,7 @@ function j(e) {
|
|
|
52
53
|
function M(e) {
|
|
53
54
|
return e ? new Date(e).toISOString() : void 0;
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
+
function te(e) {
|
|
56
57
|
return {
|
|
57
58
|
title: e.title,
|
|
58
59
|
description: e.description ?? "",
|
|
@@ -83,33 +84,33 @@ function N(e) {
|
|
|
83
84
|
}))
|
|
84
85
|
};
|
|
85
86
|
}
|
|
86
|
-
function
|
|
87
|
+
function N(e, t, n) {
|
|
87
88
|
let r = t + n;
|
|
88
89
|
if (r < 0 || r >= e.length) return e;
|
|
89
90
|
let i = [...e], [a] = i.splice(t, 1);
|
|
90
91
|
return a !== void 0 && i.splice(r, 0, a), i;
|
|
91
92
|
}
|
|
92
|
-
var
|
|
93
|
-
function
|
|
94
|
-
let { id: d } =
|
|
95
|
-
|
|
96
|
-
j &&
|
|
97
|
-
}, [j,
|
|
98
|
-
let
|
|
93
|
+
var P = "inline-flex h-8 w-8 items-center justify-center rounded-md border border-border-seam text-text-secondary transition-colors hover:bg-bg-sunken disabled:opacity-40";
|
|
94
|
+
function F() {
|
|
95
|
+
let { id: d } = C(), j = !!d, { navigateTo: F } = a(), I = l(d), L = s({ pagination: { limit: 100 } }), R = o({ pagination: { limit: 100 } }), z = c(), B = u(), [V, H] = h(A), [U, W] = h(null), G = m(null);
|
|
96
|
+
p(() => {
|
|
97
|
+
j && I.data && G.current !== I.data.id && (G.current = I.data.id, H(te(I.data)));
|
|
98
|
+
}, [j, I.data]);
|
|
99
|
+
let K = j && (I.data?.submissionCount ?? 0) > 0, q = (e, t) => H((n) => ({
|
|
99
100
|
...n,
|
|
100
101
|
[e]: t
|
|
101
|
-
})),
|
|
102
|
+
})), J = (e, t) => q("questions", V.questions.map((n) => n.uid === e ? {
|
|
102
103
|
...n,
|
|
103
104
|
...t
|
|
104
|
-
} : n)),
|
|
105
|
+
} : n)), Y = (e, t) => q("fees", V.fees.map((n) => n.uid === e ? {
|
|
105
106
|
...n,
|
|
106
107
|
...t
|
|
107
|
-
} : n)),
|
|
108
|
-
let e = new Set(
|
|
109
|
-
for (let n of
|
|
108
|
+
} : n)), X = () => {
|
|
109
|
+
let e = new Set(V.questions.map((e) => e.key).filter(Boolean)), t = [];
|
|
110
|
+
for (let n of V.questions) {
|
|
110
111
|
let r = n.label.trim();
|
|
111
112
|
if (!r) return "Every question needs a label.";
|
|
112
|
-
let i = n.key ||
|
|
113
|
+
let i = n.key || ee(r, e);
|
|
113
114
|
e.add(i);
|
|
114
115
|
let a = n.optionsText.split(",").map((e) => e.trim()).filter(Boolean);
|
|
115
116
|
if (n.fieldType === "SELECT" && a.length === 0) return `Add at least one option to the dropdown "${r}".`;
|
|
@@ -123,10 +124,10 @@ function I() {
|
|
|
123
124
|
});
|
|
124
125
|
}
|
|
125
126
|
let n = [];
|
|
126
|
-
for (let e of
|
|
127
|
+
for (let e of V.fees) {
|
|
127
128
|
let t = e.name.trim();
|
|
128
129
|
if (!t) return "Every fee needs a name.";
|
|
129
|
-
let r = f(e.amountText,
|
|
130
|
+
let r = f(e.amountText, V.currency);
|
|
130
131
|
if (r === null) return `Enter a valid amount for "${t}".`;
|
|
131
132
|
n.push({
|
|
132
133
|
name: t,
|
|
@@ -139,155 +140,155 @@ function I() {
|
|
|
139
140
|
fields: t,
|
|
140
141
|
fees: n
|
|
141
142
|
};
|
|
142
|
-
},
|
|
143
|
-
if (e.preventDefault(),
|
|
144
|
-
|
|
143
|
+
}, Z = async (e) => {
|
|
144
|
+
if (e.preventDefault(), W(null), !V.title.trim()) {
|
|
145
|
+
W("Give the form a title.");
|
|
145
146
|
return;
|
|
146
147
|
}
|
|
147
|
-
let t =
|
|
148
|
+
let t = V.maxSubmissions.trim() ? Number.parseInt(V.maxSubmissions, 10) : void 0;
|
|
148
149
|
if (t !== void 0 && (Number.isNaN(t) || t < 1)) {
|
|
149
|
-
|
|
150
|
+
W("Capacity must be a positive number.");
|
|
150
151
|
return;
|
|
151
152
|
}
|
|
152
|
-
let n =
|
|
153
|
-
if (typeof n == "string")
|
|
153
|
+
let n = K ? null : X();
|
|
154
|
+
if (typeof n == "string") W(n);
|
|
154
155
|
else try {
|
|
155
|
-
if (j && d) await
|
|
156
|
+
if (j && d) await B.mutateAsync({
|
|
156
157
|
id: d,
|
|
157
158
|
input: {
|
|
158
|
-
title:
|
|
159
|
-
description:
|
|
160
|
-
season:
|
|
161
|
-
teamId:
|
|
162
|
-
fixtureId:
|
|
163
|
-
opensAt: M(
|
|
164
|
-
closesAt: M(
|
|
159
|
+
title: V.title.trim(),
|
|
160
|
+
description: V.description.trim() || null,
|
|
161
|
+
season: V.season.trim() || null,
|
|
162
|
+
teamId: V.teamId || null,
|
|
163
|
+
fixtureId: V.fixtureId || null,
|
|
164
|
+
opensAt: M(V.opensAt) ?? null,
|
|
165
|
+
closesAt: M(V.closesAt) ?? null,
|
|
165
166
|
maxSubmissions: t ?? null,
|
|
166
|
-
waiverText:
|
|
167
|
+
waiverText: V.waiverText.trim() || null,
|
|
167
168
|
...n ? {
|
|
168
|
-
currency:
|
|
169
|
+
currency: V.currency,
|
|
169
170
|
fields: n.fields,
|
|
170
171
|
fees: n.fees
|
|
171
172
|
} : {}
|
|
172
173
|
}
|
|
173
|
-
}),
|
|
174
|
+
}), F(`/registrations/${d}`);
|
|
174
175
|
else if (n) {
|
|
175
|
-
let e = await
|
|
176
|
-
title:
|
|
177
|
-
description:
|
|
178
|
-
season:
|
|
179
|
-
teamId:
|
|
180
|
-
fixtureId:
|
|
181
|
-
slug:
|
|
182
|
-
currency:
|
|
183
|
-
opensAt: M(
|
|
184
|
-
closesAt: M(
|
|
176
|
+
let e = await z.mutateAsync({
|
|
177
|
+
title: V.title.trim(),
|
|
178
|
+
description: V.description.trim() || void 0,
|
|
179
|
+
season: V.season.trim() || void 0,
|
|
180
|
+
teamId: V.teamId || void 0,
|
|
181
|
+
fixtureId: V.fixtureId || void 0,
|
|
182
|
+
slug: V.slug.trim() || void 0,
|
|
183
|
+
currency: V.currency,
|
|
184
|
+
opensAt: M(V.opensAt),
|
|
185
|
+
closesAt: M(V.closesAt),
|
|
185
186
|
maxSubmissions: t,
|
|
186
|
-
waiverText:
|
|
187
|
+
waiverText: V.waiverText.trim() || void 0,
|
|
187
188
|
fields: n.fields,
|
|
188
189
|
fees: n.fees
|
|
189
190
|
});
|
|
190
|
-
|
|
191
|
+
F(`/registrations/${e.id}`);
|
|
191
192
|
}
|
|
192
193
|
} catch (e) {
|
|
193
|
-
|
|
194
|
+
W(e instanceof Error ? e.message : "Failed to save the registration form.");
|
|
194
195
|
}
|
|
195
|
-
}, Q =
|
|
196
|
-
return j &&
|
|
196
|
+
}, Q = z.isPending || B.isPending, $ = j ? "Edit registration form" : "New registration form";
|
|
197
|
+
return j && I.isLoading ? /* @__PURE__ */ w(e, {
|
|
197
198
|
title: $,
|
|
198
|
-
children: /* @__PURE__ */
|
|
199
|
-
}) : j && (
|
|
199
|
+
children: /* @__PURE__ */ w(n, { label: "Loading registration form…" })
|
|
200
|
+
}) : j && (I.isError || !I.data) ? /* @__PURE__ */ w(e, {
|
|
200
201
|
title: $,
|
|
201
|
-
children: /* @__PURE__ */
|
|
202
|
+
children: /* @__PURE__ */ w(t, {
|
|
202
203
|
title: "Registration form not found",
|
|
203
204
|
message: "This form does not exist or you do not have access to it.",
|
|
204
|
-
onRetry: () =>
|
|
205
|
+
onRetry: () => F("/registrations")
|
|
205
206
|
})
|
|
206
|
-
}) : /* @__PURE__ */
|
|
207
|
+
}) : /* @__PURE__ */ w(e, {
|
|
207
208
|
title: $,
|
|
208
209
|
description: "Set the details, the questions families answer and the fees they pay.",
|
|
209
|
-
actions: /* @__PURE__ */
|
|
210
|
+
actions: /* @__PURE__ */ T("button", {
|
|
210
211
|
type: "button",
|
|
211
|
-
onClick: () =>
|
|
212
|
+
onClick: () => F(j && d ? `/registrations/${d}` : "/registrations"),
|
|
212
213
|
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",
|
|
213
|
-
children: [/* @__PURE__ */
|
|
214
|
+
children: [/* @__PURE__ */ w(_, { className: "h-4 w-4" }), " Cancel"]
|
|
214
215
|
}),
|
|
215
|
-
children: /* @__PURE__ */
|
|
216
|
-
onSubmit:
|
|
216
|
+
children: /* @__PURE__ */ T("form", {
|
|
217
|
+
onSubmit: Z,
|
|
217
218
|
className: "max-w-3xl space-y-8",
|
|
218
219
|
children: [
|
|
219
|
-
/* @__PURE__ */
|
|
220
|
+
/* @__PURE__ */ T("section", {
|
|
220
221
|
className: "space-y-5",
|
|
221
222
|
children: [
|
|
222
|
-
/* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ w(r, {
|
|
223
224
|
label: "Form title",
|
|
224
225
|
htmlFor: "title",
|
|
225
226
|
required: !0,
|
|
226
|
-
children: /* @__PURE__ */
|
|
227
|
+
children: /* @__PURE__ */ w("input", {
|
|
227
228
|
id: "title",
|
|
228
229
|
className: i,
|
|
229
|
-
value:
|
|
230
|
-
onChange: (e) =>
|
|
230
|
+
value: V.title,
|
|
231
|
+
onChange: (e) => q("title", e.target.value),
|
|
231
232
|
placeholder: "e.g. U12 Boys — 2026/27 season registration"
|
|
232
233
|
})
|
|
233
234
|
}),
|
|
234
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ w(r, {
|
|
235
236
|
label: "Description",
|
|
236
237
|
htmlFor: "description",
|
|
237
|
-
children: /* @__PURE__ */
|
|
238
|
+
children: /* @__PURE__ */ w("textarea", {
|
|
238
239
|
id: "description",
|
|
239
240
|
rows: 3,
|
|
240
241
|
className: i,
|
|
241
|
-
value:
|
|
242
|
-
onChange: (e) =>
|
|
242
|
+
value: V.description,
|
|
243
|
+
onChange: (e) => q("description", e.target.value),
|
|
243
244
|
placeholder: "Who this is for, training days, what is included."
|
|
244
245
|
})
|
|
245
246
|
}),
|
|
246
|
-
/* @__PURE__ */
|
|
247
|
+
/* @__PURE__ */ T("div", {
|
|
247
248
|
className: "grid grid-cols-1 gap-5 sm:grid-cols-3",
|
|
248
249
|
children: [
|
|
249
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ w(r, {
|
|
250
251
|
label: "Season",
|
|
251
252
|
htmlFor: "season",
|
|
252
|
-
children: /* @__PURE__ */
|
|
253
|
+
children: /* @__PURE__ */ w("input", {
|
|
253
254
|
id: "season",
|
|
254
255
|
className: i,
|
|
255
|
-
value:
|
|
256
|
-
onChange: (e) =>
|
|
256
|
+
value: V.season,
|
|
257
|
+
onChange: (e) => q("season", e.target.value),
|
|
257
258
|
placeholder: "2026/27"
|
|
258
259
|
})
|
|
259
260
|
}),
|
|
260
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ w(r, {
|
|
261
262
|
label: "Team",
|
|
262
263
|
htmlFor: "teamId",
|
|
263
264
|
hint: "Optional squad this registers for.",
|
|
264
|
-
children: /* @__PURE__ */ E
|
|
265
|
+
children: /* @__PURE__ */ T(E, {
|
|
265
266
|
id: "teamId",
|
|
266
267
|
className: i,
|
|
267
|
-
value:
|
|
268
|
-
onChange: (e) =>
|
|
269
|
-
children: [/* @__PURE__ */
|
|
268
|
+
value: V.teamId,
|
|
269
|
+
onChange: (e) => q("teamId", e.target.value),
|
|
270
|
+
children: [/* @__PURE__ */ w("option", {
|
|
270
271
|
value: "",
|
|
271
272
|
children: "No specific team"
|
|
272
|
-
}), (
|
|
273
|
+
}), (L.data?.items ?? []).map((e) => /* @__PURE__ */ w("option", {
|
|
273
274
|
value: e.id,
|
|
274
275
|
children: e.name
|
|
275
276
|
}, e.id))]
|
|
276
277
|
})
|
|
277
278
|
}),
|
|
278
|
-
/* @__PURE__ */
|
|
279
|
+
/* @__PURE__ */ w(r, {
|
|
279
280
|
label: "Fixture",
|
|
280
281
|
htmlFor: "fixtureId",
|
|
281
282
|
hint: "Optional tournament or match this form takes sign-ups for. Families use the same share link.",
|
|
282
|
-
children: /* @__PURE__ */ E
|
|
283
|
+
children: /* @__PURE__ */ T(E, {
|
|
283
284
|
id: "fixtureId",
|
|
284
285
|
className: i,
|
|
285
|
-
value:
|
|
286
|
-
onChange: (e) =>
|
|
287
|
-
children: [/* @__PURE__ */
|
|
286
|
+
value: V.fixtureId,
|
|
287
|
+
onChange: (e) => q("fixtureId", e.target.value),
|
|
288
|
+
children: [/* @__PURE__ */ w("option", {
|
|
288
289
|
value: "",
|
|
289
290
|
children: "Not tied to a fixture"
|
|
290
|
-
}), (
|
|
291
|
+
}), (R.data?.items ?? []).map((e) => /* @__PURE__ */ w("option", {
|
|
291
292
|
value: e.id,
|
|
292
293
|
children: [
|
|
293
294
|
e.competition ?? "Fixture",
|
|
@@ -297,17 +298,17 @@ function I() {
|
|
|
297
298
|
}, e.id))]
|
|
298
299
|
})
|
|
299
300
|
}),
|
|
300
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ w(r, {
|
|
301
302
|
label: "Currency",
|
|
302
303
|
htmlFor: "currency",
|
|
303
|
-
hint:
|
|
304
|
-
children: /* @__PURE__ */
|
|
304
|
+
hint: K ? "Locked after the first registration." : void 0,
|
|
305
|
+
children: /* @__PURE__ */ w(E, {
|
|
305
306
|
id: "currency",
|
|
306
307
|
className: i,
|
|
307
|
-
value:
|
|
308
|
-
disabled:
|
|
309
|
-
onChange: (e) =>
|
|
310
|
-
children: [.../* @__PURE__ */ new Set([
|
|
308
|
+
value: V.currency,
|
|
309
|
+
disabled: K,
|
|
310
|
+
onChange: (e) => q("currency", e.target.value),
|
|
311
|
+
children: [.../* @__PURE__ */ new Set([V.currency, ...O])].map((e) => /* @__PURE__ */ w("option", {
|
|
311
312
|
value: e,
|
|
312
313
|
children: e
|
|
313
314
|
}, e))
|
|
@@ -315,76 +316,76 @@ function I() {
|
|
|
315
316
|
})
|
|
316
317
|
]
|
|
317
318
|
}),
|
|
318
|
-
/* @__PURE__ */
|
|
319
|
+
/* @__PURE__ */ T("div", {
|
|
319
320
|
className: "grid grid-cols-1 gap-5 sm:grid-cols-3",
|
|
320
321
|
children: [
|
|
321
|
-
/* @__PURE__ */
|
|
322
|
+
/* @__PURE__ */ w(r, {
|
|
322
323
|
label: "Opens",
|
|
323
324
|
htmlFor: "opensAt",
|
|
324
325
|
hint: "Leave empty to open on publish.",
|
|
325
|
-
children: /* @__PURE__ */
|
|
326
|
+
children: /* @__PURE__ */ w("input", {
|
|
326
327
|
id: "opensAt",
|
|
327
328
|
type: "datetime-local",
|
|
328
329
|
className: i,
|
|
329
|
-
value:
|
|
330
|
-
onChange: (e) =>
|
|
330
|
+
value: V.opensAt,
|
|
331
|
+
onChange: (e) => q("opensAt", e.target.value)
|
|
331
332
|
})
|
|
332
333
|
}),
|
|
333
|
-
/* @__PURE__ */
|
|
334
|
+
/* @__PURE__ */ w(r, {
|
|
334
335
|
label: "Closes",
|
|
335
336
|
htmlFor: "closesAt",
|
|
336
337
|
hint: "Leave empty to close manually.",
|
|
337
|
-
children: /* @__PURE__ */
|
|
338
|
+
children: /* @__PURE__ */ w("input", {
|
|
338
339
|
id: "closesAt",
|
|
339
340
|
type: "datetime-local",
|
|
340
341
|
className: i,
|
|
341
|
-
value:
|
|
342
|
-
onChange: (e) =>
|
|
342
|
+
value: V.closesAt,
|
|
343
|
+
onChange: (e) => q("closesAt", e.target.value)
|
|
343
344
|
})
|
|
344
345
|
}),
|
|
345
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ w(r, {
|
|
346
347
|
label: "Capacity",
|
|
347
348
|
htmlFor: "maxSubmissions",
|
|
348
349
|
hint: "Maximum registrations.",
|
|
349
|
-
children: /* @__PURE__ */
|
|
350
|
+
children: /* @__PURE__ */ w("input", {
|
|
350
351
|
id: "maxSubmissions",
|
|
351
352
|
inputMode: "numeric",
|
|
352
353
|
className: i,
|
|
353
|
-
value:
|
|
354
|
-
onChange: (e) =>
|
|
354
|
+
value: V.maxSubmissions,
|
|
355
|
+
onChange: (e) => q("maxSubmissions", e.target.value),
|
|
355
356
|
placeholder: "Unlimited"
|
|
356
357
|
})
|
|
357
358
|
})
|
|
358
359
|
]
|
|
359
360
|
}),
|
|
360
|
-
!j && /* @__PURE__ */
|
|
361
|
+
!j && /* @__PURE__ */ w(r, {
|
|
361
362
|
label: "Share-link name",
|
|
362
363
|
htmlFor: "slug",
|
|
363
364
|
hint: "Optional. Lowercase letters, digits and dashes. Generated from the title when empty.",
|
|
364
|
-
children: /* @__PURE__ */
|
|
365
|
+
children: /* @__PURE__ */ w("input", {
|
|
365
366
|
id: "slug",
|
|
366
367
|
className: i,
|
|
367
|
-
value:
|
|
368
|
-
onChange: (e) =>
|
|
368
|
+
value: V.slug,
|
|
369
|
+
onChange: (e) => q("slug", e.target.value),
|
|
369
370
|
placeholder: "u12-boys-2026"
|
|
370
371
|
})
|
|
371
372
|
})
|
|
372
373
|
]
|
|
373
374
|
}),
|
|
374
|
-
/* @__PURE__ */
|
|
375
|
+
/* @__PURE__ */ T("section", {
|
|
375
376
|
className: "space-y-3",
|
|
376
377
|
"aria-labelledby": "builder-questions",
|
|
377
378
|
children: [
|
|
378
|
-
/* @__PURE__ */
|
|
379
|
+
/* @__PURE__ */ T("div", {
|
|
379
380
|
className: "flex items-center justify-between",
|
|
380
|
-
children: [/* @__PURE__ */
|
|
381
|
+
children: [/* @__PURE__ */ w("h2", {
|
|
381
382
|
id: "builder-questions",
|
|
382
383
|
className: "text-base font-semibold text-text-primary",
|
|
383
384
|
children: "Questions"
|
|
384
|
-
}), /* @__PURE__ */
|
|
385
|
+
}), /* @__PURE__ */ T("button", {
|
|
385
386
|
type: "button",
|
|
386
|
-
disabled:
|
|
387
|
-
onClick: () =>
|
|
387
|
+
disabled: K,
|
|
388
|
+
onClick: () => q("questions", [...V.questions, {
|
|
388
389
|
uid: k(),
|
|
389
390
|
key: "",
|
|
390
391
|
label: "",
|
|
@@ -394,107 +395,107 @@ function I() {
|
|
|
394
395
|
helpText: ""
|
|
395
396
|
}]),
|
|
396
397
|
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-50",
|
|
397
|
-
children: [/* @__PURE__ */
|
|
398
|
+
children: [/* @__PURE__ */ w(b, { className: "h-4 w-4" }), " Add question"]
|
|
398
399
|
})]
|
|
399
400
|
}),
|
|
400
|
-
/* @__PURE__ */
|
|
401
|
+
/* @__PURE__ */ T("p", {
|
|
401
402
|
className: "text-xs text-text-secondary",
|
|
402
|
-
children: ["Participant name and contact details are always collected.",
|
|
403
|
+
children: ["Participant name and contact details are always collected.", K && " Questions are locked because this form already has registrations."]
|
|
403
404
|
}),
|
|
404
|
-
|
|
405
|
+
V.questions.map((e, t) => /* @__PURE__ */ T("div", {
|
|
405
406
|
className: "space-y-3 rounded-lg border border-border-seam bg-bg-surface p-4",
|
|
406
407
|
"data-testid": "builder-question",
|
|
407
408
|
children: [
|
|
408
|
-
/* @__PURE__ */
|
|
409
|
+
/* @__PURE__ */ T("div", {
|
|
409
410
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-[1fr_12rem]",
|
|
410
|
-
children: [/* @__PURE__ */
|
|
411
|
+
children: [/* @__PURE__ */ w(r, {
|
|
411
412
|
label: `Question ${t + 1}`,
|
|
412
413
|
htmlFor: `q-label-${e.uid}`,
|
|
413
|
-
children: /* @__PURE__ */
|
|
414
|
+
children: /* @__PURE__ */ w("input", {
|
|
414
415
|
id: `q-label-${e.uid}`,
|
|
415
416
|
className: i,
|
|
416
417
|
value: e.label,
|
|
417
|
-
disabled:
|
|
418
|
-
onChange: (t) =>
|
|
418
|
+
disabled: K,
|
|
419
|
+
onChange: (t) => J(e.uid, { label: t.target.value }),
|
|
419
420
|
placeholder: "e.g. Date of birth"
|
|
420
421
|
})
|
|
421
|
-
}), /* @__PURE__ */
|
|
422
|
+
}), /* @__PURE__ */ w(r, {
|
|
422
423
|
label: "Answer type",
|
|
423
424
|
htmlFor: `q-type-${e.uid}`,
|
|
424
|
-
children: /* @__PURE__ */
|
|
425
|
+
children: /* @__PURE__ */ w(E, {
|
|
425
426
|
id: `q-type-${e.uid}`,
|
|
426
427
|
className: i,
|
|
427
428
|
value: e.fieldType,
|
|
428
|
-
disabled:
|
|
429
|
-
onChange: (t) =>
|
|
430
|
-
children: Object.keys(D).map((e) => /* @__PURE__ */
|
|
429
|
+
disabled: K,
|
|
430
|
+
onChange: (t) => J(e.uid, { fieldType: t.target.value }),
|
|
431
|
+
children: Object.keys(D).map((e) => /* @__PURE__ */ w("option", {
|
|
431
432
|
value: e,
|
|
432
433
|
children: D[e]
|
|
433
434
|
}, e))
|
|
434
435
|
})
|
|
435
436
|
})]
|
|
436
437
|
}),
|
|
437
|
-
e.fieldType === "SELECT" && /* @__PURE__ */
|
|
438
|
+
e.fieldType === "SELECT" && /* @__PURE__ */ w(r, {
|
|
438
439
|
label: "Options",
|
|
439
440
|
htmlFor: `q-options-${e.uid}`,
|
|
440
441
|
hint: "Comma-separated.",
|
|
441
|
-
children: /* @__PURE__ */
|
|
442
|
+
children: /* @__PURE__ */ w("input", {
|
|
442
443
|
id: `q-options-${e.uid}`,
|
|
443
444
|
className: i,
|
|
444
445
|
value: e.optionsText,
|
|
445
|
-
disabled:
|
|
446
|
-
onChange: (t) =>
|
|
446
|
+
disabled: K,
|
|
447
|
+
onChange: (t) => J(e.uid, { optionsText: t.target.value }),
|
|
447
448
|
placeholder: "XS, S, M, L"
|
|
448
449
|
})
|
|
449
450
|
}),
|
|
450
|
-
/* @__PURE__ */
|
|
451
|
+
/* @__PURE__ */ w(r, {
|
|
451
452
|
label: "Help text",
|
|
452
453
|
htmlFor: `q-help-${e.uid}`,
|
|
453
|
-
children: /* @__PURE__ */
|
|
454
|
+
children: /* @__PURE__ */ w("input", {
|
|
454
455
|
id: `q-help-${e.uid}`,
|
|
455
456
|
className: i,
|
|
456
457
|
value: e.helpText,
|
|
457
|
-
disabled:
|
|
458
|
-
onChange: (t) =>
|
|
458
|
+
disabled: K,
|
|
459
|
+
onChange: (t) => J(e.uid, { helpText: t.target.value })
|
|
459
460
|
})
|
|
460
461
|
}),
|
|
461
|
-
/* @__PURE__ */
|
|
462
|
+
/* @__PURE__ */ T("div", {
|
|
462
463
|
className: "flex flex-wrap items-center justify-between gap-3",
|
|
463
|
-
children: [/* @__PURE__ */
|
|
464
|
+
children: [/* @__PURE__ */ T("label", {
|
|
464
465
|
className: "flex items-center gap-2 text-sm text-text-primary",
|
|
465
|
-
children: [/* @__PURE__ */
|
|
466
|
+
children: [/* @__PURE__ */ w("input", {
|
|
466
467
|
type: "checkbox",
|
|
467
468
|
checked: e.required,
|
|
468
|
-
disabled:
|
|
469
|
-
onChange: (t) =>
|
|
469
|
+
disabled: K,
|
|
470
|
+
onChange: (t) => J(e.uid, { required: t.target.checked }),
|
|
470
471
|
className: "h-4 w-4 rounded border-border-seam text-action-primary-bg focus:ring-[var(--color-focus-ring)]"
|
|
471
472
|
}), "Required"]
|
|
472
|
-
}), /* @__PURE__ */
|
|
473
|
+
}), /* @__PURE__ */ T("span", {
|
|
473
474
|
className: "flex gap-2",
|
|
474
475
|
children: [
|
|
475
|
-
/* @__PURE__ */
|
|
476
|
+
/* @__PURE__ */ w("button", {
|
|
476
477
|
type: "button",
|
|
477
478
|
"aria-label": "Move question up",
|
|
478
|
-
className:
|
|
479
|
-
disabled:
|
|
480
|
-
onClick: () =>
|
|
481
|
-
children: /* @__PURE__ */
|
|
479
|
+
className: P,
|
|
480
|
+
disabled: K || t === 0,
|
|
481
|
+
onClick: () => q("questions", N(V.questions, t, -1)),
|
|
482
|
+
children: /* @__PURE__ */ w(v, { className: "h-4 w-4" })
|
|
482
483
|
}),
|
|
483
|
-
/* @__PURE__ */
|
|
484
|
+
/* @__PURE__ */ w("button", {
|
|
484
485
|
type: "button",
|
|
485
486
|
"aria-label": "Move question down",
|
|
486
|
-
className:
|
|
487
|
-
disabled:
|
|
488
|
-
onClick: () =>
|
|
489
|
-
children: /* @__PURE__ */
|
|
487
|
+
className: P,
|
|
488
|
+
disabled: K || t === V.questions.length - 1,
|
|
489
|
+
onClick: () => q("questions", N(V.questions, t, 1)),
|
|
490
|
+
children: /* @__PURE__ */ w(g, { className: "h-4 w-4" })
|
|
490
491
|
}),
|
|
491
|
-
/* @__PURE__ */
|
|
492
|
+
/* @__PURE__ */ w("button", {
|
|
492
493
|
type: "button",
|
|
493
494
|
"aria-label": "Remove question",
|
|
494
|
-
className:
|
|
495
|
-
disabled:
|
|
496
|
-
onClick: () =>
|
|
497
|
-
children: /* @__PURE__ */
|
|
495
|
+
className: P,
|
|
496
|
+
disabled: K,
|
|
497
|
+
onClick: () => q("questions", V.questions.filter((t) => t.uid !== e.uid)),
|
|
498
|
+
children: /* @__PURE__ */ w(S, { className: "h-4 w-4" })
|
|
498
499
|
})
|
|
499
500
|
]
|
|
500
501
|
})]
|
|
@@ -503,20 +504,20 @@ function I() {
|
|
|
503
504
|
}, e.uid))
|
|
504
505
|
]
|
|
505
506
|
}),
|
|
506
|
-
/* @__PURE__ */
|
|
507
|
+
/* @__PURE__ */ T("section", {
|
|
507
508
|
className: "space-y-3",
|
|
508
509
|
"aria-labelledby": "builder-fees",
|
|
509
510
|
children: [
|
|
510
|
-
/* @__PURE__ */
|
|
511
|
+
/* @__PURE__ */ T("div", {
|
|
511
512
|
className: "flex items-center justify-between",
|
|
512
|
-
children: [/* @__PURE__ */
|
|
513
|
+
children: [/* @__PURE__ */ w("h2", {
|
|
513
514
|
id: "builder-fees",
|
|
514
515
|
className: "text-base font-semibold text-text-primary",
|
|
515
516
|
children: "Fees"
|
|
516
|
-
}), /* @__PURE__ */
|
|
517
|
+
}), /* @__PURE__ */ T("button", {
|
|
517
518
|
type: "button",
|
|
518
|
-
disabled:
|
|
519
|
-
onClick: () =>
|
|
519
|
+
disabled: K,
|
|
520
|
+
onClick: () => q("fees", [...V.fees, {
|
|
520
521
|
uid: k(),
|
|
521
522
|
name: "",
|
|
522
523
|
amountText: "",
|
|
@@ -524,105 +525,105 @@ function I() {
|
|
|
524
525
|
description: ""
|
|
525
526
|
}]),
|
|
526
527
|
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-50",
|
|
527
|
-
children: [/* @__PURE__ */
|
|
528
|
+
children: [/* @__PURE__ */ w(b, { className: "h-4 w-4" }), " Add fee"]
|
|
528
529
|
})]
|
|
529
530
|
}),
|
|
530
|
-
/* @__PURE__ */
|
|
531
|
+
/* @__PURE__ */ w("p", {
|
|
531
532
|
className: "text-xs text-text-secondary",
|
|
532
533
|
children: "Required fees are charged on every registration; optional ones (kit, tournament entry) are opt-in. Payments are recorded by the club office as they arrive."
|
|
533
534
|
}),
|
|
534
|
-
|
|
535
|
+
V.fees.map((e) => /* @__PURE__ */ T("div", {
|
|
535
536
|
className: "grid grid-cols-1 gap-3 rounded-lg border border-border-seam bg-bg-surface p-4 sm:grid-cols-[1fr_9rem_9rem_auto]",
|
|
536
537
|
"data-testid": "builder-fee",
|
|
537
538
|
children: [
|
|
538
|
-
/* @__PURE__ */
|
|
539
|
+
/* @__PURE__ */ w(r, {
|
|
539
540
|
label: "Fee name",
|
|
540
541
|
htmlFor: `f-name-${e.uid}`,
|
|
541
|
-
children: /* @__PURE__ */
|
|
542
|
+
children: /* @__PURE__ */ w("input", {
|
|
542
543
|
id: `f-name-${e.uid}`,
|
|
543
544
|
className: i,
|
|
544
545
|
value: e.name,
|
|
545
|
-
disabled:
|
|
546
|
-
onChange: (t) =>
|
|
546
|
+
disabled: K,
|
|
547
|
+
onChange: (t) => Y(e.uid, { name: t.target.value }),
|
|
547
548
|
placeholder: "Membership"
|
|
548
549
|
})
|
|
549
550
|
}),
|
|
550
|
-
/* @__PURE__ */
|
|
551
|
-
label: `Amount (${
|
|
551
|
+
/* @__PURE__ */ w(r, {
|
|
552
|
+
label: `Amount (${V.currency})`,
|
|
552
553
|
htmlFor: `f-amount-${e.uid}`,
|
|
553
|
-
children: /* @__PURE__ */
|
|
554
|
+
children: /* @__PURE__ */ w("input", {
|
|
554
555
|
id: `f-amount-${e.uid}`,
|
|
555
556
|
inputMode: "decimal",
|
|
556
557
|
className: i,
|
|
557
558
|
value: e.amountText,
|
|
558
|
-
disabled:
|
|
559
|
-
onChange: (t) =>
|
|
559
|
+
disabled: K,
|
|
560
|
+
onChange: (t) => Y(e.uid, { amountText: t.target.value }),
|
|
560
561
|
placeholder: "150.00"
|
|
561
562
|
})
|
|
562
563
|
}),
|
|
563
|
-
/* @__PURE__ */
|
|
564
|
+
/* @__PURE__ */ w(r, {
|
|
564
565
|
label: "Type",
|
|
565
566
|
htmlFor: `f-type-${e.uid}`,
|
|
566
|
-
children: /* @__PURE__ */ E
|
|
567
|
+
children: /* @__PURE__ */ T(E, {
|
|
567
568
|
id: `f-type-${e.uid}`,
|
|
568
569
|
className: i,
|
|
569
570
|
value: e.feeType,
|
|
570
|
-
disabled:
|
|
571
|
-
onChange: (t) =>
|
|
572
|
-
children: [/* @__PURE__ */
|
|
571
|
+
disabled: K,
|
|
572
|
+
onChange: (t) => Y(e.uid, { feeType: t.target.value }),
|
|
573
|
+
children: [/* @__PURE__ */ w("option", {
|
|
573
574
|
value: "REQUIRED",
|
|
574
575
|
children: "Required"
|
|
575
|
-
}), /* @__PURE__ */
|
|
576
|
+
}), /* @__PURE__ */ w("option", {
|
|
576
577
|
value: "OPTIONAL",
|
|
577
578
|
children: "Optional"
|
|
578
579
|
})]
|
|
579
580
|
})
|
|
580
581
|
}),
|
|
581
|
-
/* @__PURE__ */
|
|
582
|
+
/* @__PURE__ */ w("div", {
|
|
582
583
|
className: "flex items-end",
|
|
583
|
-
children: /* @__PURE__ */
|
|
584
|
+
children: /* @__PURE__ */ w("button", {
|
|
584
585
|
type: "button",
|
|
585
586
|
"aria-label": "Remove fee",
|
|
586
|
-
className:
|
|
587
|
-
disabled:
|
|
588
|
-
onClick: () =>
|
|
589
|
-
children: /* @__PURE__ */
|
|
587
|
+
className: P,
|
|
588
|
+
disabled: K,
|
|
589
|
+
onClick: () => q("fees", V.fees.filter((t) => t.uid !== e.uid)),
|
|
590
|
+
children: /* @__PURE__ */ w(S, { className: "h-4 w-4" })
|
|
590
591
|
})
|
|
591
592
|
})
|
|
592
593
|
]
|
|
593
594
|
}, e.uid))
|
|
594
595
|
]
|
|
595
596
|
}),
|
|
596
|
-
/* @__PURE__ */
|
|
597
|
+
/* @__PURE__ */ w("section", { children: /* @__PURE__ */ w(r, {
|
|
597
598
|
label: "Waiver / consent",
|
|
598
599
|
htmlFor: "waiverText",
|
|
599
600
|
hint: "Optional. When set, registrants must accept it to submit.",
|
|
600
|
-
children: /* @__PURE__ */
|
|
601
|
+
children: /* @__PURE__ */ w("textarea", {
|
|
601
602
|
id: "waiverText",
|
|
602
603
|
rows: 4,
|
|
603
604
|
className: i,
|
|
604
|
-
value:
|
|
605
|
-
onChange: (e) =>
|
|
605
|
+
value: V.waiverText,
|
|
606
|
+
onChange: (e) => q("waiverText", e.target.value)
|
|
606
607
|
})
|
|
607
608
|
}) }),
|
|
608
|
-
|
|
609
|
+
U && /* @__PURE__ */ w("p", {
|
|
609
610
|
role: "alert",
|
|
610
611
|
className: "text-sm text-status-error-text",
|
|
611
|
-
children:
|
|
612
|
+
children: U
|
|
612
613
|
}),
|
|
613
|
-
/* @__PURE__ */
|
|
614
|
+
/* @__PURE__ */ w("div", {
|
|
614
615
|
className: "pt-2",
|
|
615
|
-
children: /* @__PURE__ */
|
|
616
|
+
children: /* @__PURE__ */ T("button", {
|
|
616
617
|
type: "submit",
|
|
617
618
|
disabled: Q,
|
|
618
619
|
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",
|
|
619
|
-
children: [Q ? /* @__PURE__ */
|
|
620
|
+
children: [Q ? /* @__PURE__ */ w(y, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ w(x, { className: "h-4 w-4" }), j ? "Save changes" : "Create form"]
|
|
620
621
|
})
|
|
621
622
|
})
|
|
622
623
|
]
|
|
623
624
|
})
|
|
624
625
|
});
|
|
625
626
|
}
|
|
626
|
-
export {
|
|
627
|
+
export { F as RegistrationFormBuilderPage };
|
|
627
628
|
|
|
628
629
|
//# sourceMappingURL=RegistrationFormBuilderPage.js.map
|