@burdenoff/microfe-atheletebridge 2026.1102.1 → 2026.1103.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.
@@ -1,25 +1,27 @@
1
1
  import { useAbTranslate as e } from "../../i18n.js";
2
2
  import { useAthleteBridge as t } from "../../context/AthleteBridgeContext.js";
3
3
  import { PageLayout as n } from "../../components/PageLayout.js";
4
- import { FIXTURE_TYPE_LABELS as r } from "../../components/domain.js";
5
- import { Crest as i } from "../../components/Crest.js";
6
- import { Scoreboard as a } from "../../components/Scoreboard.js";
7
- import { ErrorState as o, LoadingState as s } from "../../components/LoadingState.js";
8
- import { useFixture as c, useRecordFixtureResult as l } from "../../hooks/useAthleteBridgeApi.js";
9
- import { useScheduledTimeGate as u } from "../../hooks/useScheduledTimeGate.js";
4
+ import { FIXTURE_TYPE_LABELS as ee } from "../../components/domain.js";
5
+ import { Crest as r } from "../../components/Crest.js";
6
+ import { Scoreboard as te } from "../../components/Scoreboard.js";
7
+ import { ErrorState as ne, LoadingState as re } from "../../components/LoadingState.js";
8
+ import { useCancelFixture as ie, useFixture as ae, usePostponeFixture as oe, useRecordFixtureResult as se, useUpdateFixture as ce } from "../../hooks/useAthleteBridgeApi.js";
9
+ import { useScheduledTimeGate as le } from "../../hooks/useScheduledTimeGate.js";
10
10
  import "../../hooks/index.js";
11
- import { FormField as d, fieldInputClass as f } from "../../components/form.js";
12
- import { AvailabilityRsvpControl as p } from "../../components/availability/AvailabilityRsvpControl.js";
13
- import { AvailabilityRosterPanel as m } from "../../components/availability/AvailabilityRosterPanel.js";
14
- import { buildRecordResultInput as h, parseScoreInput as g } from "../../utils/recordResult.js";
15
- import { useState as _ } from "react";
16
- import { ArrowLeft as v, Flag as y, Loader2 as b, Minus as x, Trophy as S } from "lucide-react";
17
- import { useParams as C } from "react-router";
18
- import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
19
- import { EmphasisPanel as D, GlassCard as O } from "@burdenoff/fe-libs/ui";
11
+ import { FormField as i, fieldInputClass as a } from "../../components/form.js";
12
+ import { AvailabilityRsvpControl as ue } from "../../components/availability/AvailabilityRsvpControl.js";
13
+ import { AvailabilityRosterPanel as de } from "../../components/availability/AvailabilityRosterPanel.js";
14
+ import { buildScheduleInput as fe, getFixtureLifecycleActions as pe, initialScheduleInputs as me } from "../../utils/fixtureLifecycle.js";
15
+ import { buildRecordResultInput as he, parseScoreInput as o } from "../../utils/recordResult.js";
16
+ import { useState as s } from "react";
17
+ import { ArrowLeft as ge, Ban as _e, CalendarClock as c, CalendarPlus as ve, Flag as ye, Loader2 as l, Minus as be, Trophy as u } from "lucide-react";
18
+ import { useParams as xe } from "react-router";
19
+ import { Fragment as Se, jsx as d, jsxs as f } from "react/jsx-runtime";
20
+ import { EmphasisPanel as p, GlassCard as m, ResponsiveDialog as h, ResponsiveDialogContent as g, ResponsiveDialogFooter as _, ResponsiveDialogHeader as v, ResponsiveDialogTitle as y } from "@burdenoff/fe-libs/ui";
21
+ import { useGlobalUi as Ce } from "@burdenoff/fe-libs/shared/providers/shell/GlobalUiProvider";
20
22
  //#region src/atheletebridge/pages/fixtures/FixtureDetailPage.tsx
21
- function k() {
22
- let k = e(), { id: A } = C(), { navigateTo: j } = t(), M = c(A), N = l(), [P, F] = _(""), [I, L] = _(""), [R, z] = _(""), [B, V] = _(""), [H, U] = _(""), [W, G] = _(""), [ee, te] = _({
23
+ function b() {
24
+ let b = e(), { id: x } = xe(), { navigateTo: S } = t(), C = ae(x), w = se(), T = ce(), E = oe(), D = ie(), { showToast: O } = Ce(), [k, A] = s(""), [j, M] = s(""), [N, we] = s(""), [P, Te] = s(""), [Ee, De] = s(""), [Oe, ke] = s(""), [Ae, je] = s({
23
25
  homeRuns: "",
24
26
  homeWickets: "",
25
27
  homeOvers: "",
@@ -33,210 +35,363 @@ function k() {
33
35
  margin: "",
34
36
  superOver: !1,
35
37
  dls: !1
36
- }), [K, q] = _(null), J = u(M.data?.scheduledAt);
37
- if (M.isLoading) return /* @__PURE__ */ T(n, {
38
- title: k("atheletebridge.pages.fixtureDetail.title", "Fixture"),
39
- children: /* @__PURE__ */ T(s, { label: k("atheletebridge.pages.fixtureDetail.loading", "Loading fixture…") })
38
+ }), [F, I] = s(null), L = le(C.data?.scheduledAt), [R, z] = s(null), [B, V] = s(""), [H, U] = s(""), [Me, W] = s(!1);
39
+ if (C.isLoading) return /* @__PURE__ */ d(n, {
40
+ title: b("atheletebridge.pages.fixtureDetail.title", "Fixture"),
41
+ children: /* @__PURE__ */ d(re, { label: b("atheletebridge.pages.fixtureDetail.loading", "Loading fixture…") })
40
42
  });
41
- if (M.isError || !M.data) return /* @__PURE__ */ T(n, {
42
- title: k("atheletebridge.pages.fixtureDetail.title", "Fixture"),
43
- children: /* @__PURE__ */ T(o, {
44
- title: k("atheletebridge.pages.fixtureDetail.notFoundTitle", "Fixture not found"),
45
- message: k("atheletebridge.pages.fixtureDetail.notFoundMessage", "This fixture does not exist or you do not have access to it."),
46
- onRetry: () => j("/fixtures")
43
+ if (C.isError || !C.data) return /* @__PURE__ */ d(n, {
44
+ title: b("atheletebridge.pages.fixtureDetail.title", "Fixture"),
45
+ children: /* @__PURE__ */ d(ne, {
46
+ title: b("atheletebridge.pages.fixtureDetail.notFoundTitle", "Fixture not found"),
47
+ message: b("atheletebridge.pages.fixtureDetail.notFoundMessage", "This fixture does not exist or you do not have access to it."),
48
+ onRetry: () => S("/fixtures")
47
49
  })
48
50
  });
49
- let Y = M.data, X = Y.homeTeam?.name ?? k("atheletebridge.pages.fixtureDetail.home", "Home"), Z = Y.awayTeam?.name ?? (Y.awayTeamId ? k("atheletebridge.pages.fixtureDetail.away", "Away") : "TBD"), Q = !!Y.awayTeamId && (Y.status === "SCHEDULED" || Y.status === "LIVE"), $ = Q && J, ne = Q && !J;
50
- return g(P), g(I), g(R), g(B), /* @__PURE__ */ E(n, {
51
- title: `${X} vs ${Z}`,
52
- description: `${r[Y.type]}${Y.competition ? ` · ${Y.competition}` : ""}`,
53
- actions: /* @__PURE__ */ E("button", {
51
+ let G = C.data, K = G.homeTeam?.name ?? b("atheletebridge.pages.fixtureDetail.home", "Home"), q = G.awayTeam?.name ?? (G.awayTeamId ? b("atheletebridge.pages.fixtureDetail.away", "Away") : "TBD"), J = !!G.awayTeamId && (G.status === "SCHEDULED" || G.status === "LIVE"), Ne = J && L, Pe = J && !L;
52
+ o(k), o(j), o(N), o(P);
53
+ let { canReschedule: Y, canPostpone: X, canCancel: Z } = pe(G.status), Q = R === "reschedule" ? T.isPending : E.isPending, $ = (e) => {
54
+ let t = me(e, G);
55
+ V(t.scheduledAtInput), U(t.kickoffAtInput), z(e);
56
+ }, Fe = async (e) => {
57
+ e.preventDefault();
58
+ let t = fe(B, H);
59
+ if (!t) {
60
+ O(b("atheletebridge.pages.fixtureDetail.scheduleDateRequired", "Pick a date and time first."), "error");
61
+ return;
62
+ }
63
+ try {
64
+ R === "reschedule" ? (await T.mutateAsync({
65
+ id: G.id,
66
+ input: t
67
+ }), O(b("atheletebridge.pages.fixtureDetail.rescheduledToast", "Fixture rescheduled."), "success")) : (await E.mutateAsync({
68
+ id: G.id,
69
+ input: t
70
+ }), O(b("atheletebridge.pages.fixtureDetail.postponedToast", "Fixture postponed."), "success")), z(null);
71
+ } catch (e) {
72
+ O(e instanceof Error ? e.message : b("common.error", "Something went wrong."), "error");
73
+ }
74
+ }, Ie = async () => {
75
+ try {
76
+ await D.mutateAsync(G.id), O(b("atheletebridge.pages.fixtureDetail.cancelledToast", "Fixture cancelled."), "success"), W(!1);
77
+ } catch (e) {
78
+ O(e instanceof Error ? e.message : b("common.error", "Something went wrong."), "error"), W(!1);
79
+ }
80
+ };
81
+ return /* @__PURE__ */ f(n, {
82
+ title: `${K} vs ${q}`,
83
+ description: `${ee[G.type]}${G.competition ? ` · ${G.competition}` : ""}`,
84
+ actions: /* @__PURE__ */ f("button", {
54
85
  type: "button",
55
- onClick: () => j("/fixtures"),
86
+ onClick: () => S("/fixtures"),
56
87
  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",
57
88
  children: [
58
- /* @__PURE__ */ T(v, { className: "h-4 w-4" }),
89
+ /* @__PURE__ */ d(ge, { className: "h-4 w-4" }),
59
90
  " ",
60
- k("atheletebridge.pages.fixtureDetail.back", "Back")
91
+ b("atheletebridge.pages.fixtureDetail.back", "Back")
61
92
  ]
62
93
  }),
63
94
  children: [
64
- /* @__PURE__ */ T(a, {
65
- fixture: Y,
95
+ /* @__PURE__ */ d(te, {
96
+ fixture: G,
66
97
  variant: "hero",
67
98
  className: "mb-8"
68
99
  }),
69
- /* @__PURE__ */ E("div", {
100
+ /* @__PURE__ */ f("div", {
70
101
  className: "mb-8 grid grid-cols-1 gap-4 lg:grid-cols-[minmax(0,1fr)_2fr]",
71
- children: [/* @__PURE__ */ T(p, {
72
- teamId: Y.homeTeamId,
73
- fixtureId: Y.id
74
- }), /* @__PURE__ */ T(m, {
75
- teamId: Y.homeTeamId,
76
- fixtureId: Y.id
102
+ children: [/* @__PURE__ */ d(ue, {
103
+ teamId: G.homeTeamId,
104
+ fixtureId: G.id
105
+ }), /* @__PURE__ */ d(de, {
106
+ teamId: G.homeTeamId,
107
+ fixtureId: G.id
77
108
  })]
78
109
  }),
79
- Y.notes && /* @__PURE__ */ E(D, {
110
+ G.notes && /* @__PURE__ */ f(p, {
80
111
  className: "mb-8",
81
- children: [/* @__PURE__ */ T("h2", {
112
+ children: [/* @__PURE__ */ d("h2", {
82
113
  className: "mb-2 text-sm font-semibold text-text-primary",
83
- children: k("atheletebridge.pages.fixtureDetail.notes", "Notes")
84
- }), /* @__PURE__ */ T("p", {
114
+ children: b("atheletebridge.pages.fixtureDetail.notes", "Notes")
115
+ }), /* @__PURE__ */ d("p", {
85
116
  className: "text-sm text-text-secondary",
86
- children: Y.notes
117
+ children: G.notes
87
118
  })]
88
119
  }),
89
- ne && /* @__PURE__ */ T(D, {
120
+ (Y || X || Z) && /* @__PURE__ */ f("section", {
90
121
  className: "mb-8",
91
- children: /* @__PURE__ */ T("p", {
122
+ children: [/* @__PURE__ */ f("h2", {
123
+ className: "mb-4 flex items-center gap-2 text-lg font-semibold text-text-primary",
124
+ children: [
125
+ /* @__PURE__ */ d(c, { className: "h-5 w-5" }),
126
+ " ",
127
+ b("atheletebridge.pages.fixtureDetail.fixtureActions", "Fixture actions")
128
+ ]
129
+ }), /* @__PURE__ */ f(m, {
130
+ treatment: "plain",
131
+ className: "flex flex-wrap items-center gap-3 p-5 sm:p-6",
132
+ children: [
133
+ Y && /* @__PURE__ */ f("button", {
134
+ type: "button",
135
+ onClick: () => $("reschedule"),
136
+ 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",
137
+ children: [
138
+ /* @__PURE__ */ d(ve, { className: "h-4 w-4" }),
139
+ " ",
140
+ b("atheletebridge.pages.fixtureDetail.reschedule", "Reschedule")
141
+ ]
142
+ }),
143
+ X && /* @__PURE__ */ f("button", {
144
+ type: "button",
145
+ onClick: () => $("postpone"),
146
+ 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",
147
+ children: [
148
+ /* @__PURE__ */ d(c, { className: "h-4 w-4" }),
149
+ " ",
150
+ b("atheletebridge.pages.fixtureDetail.postpone", "Postpone")
151
+ ]
152
+ }),
153
+ Z && /* @__PURE__ */ f("button", {
154
+ type: "button",
155
+ onClick: () => W(!0),
156
+ className: "inline-flex items-center gap-1.5 rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-status-error-text transition-colors hover:bg-status-error-bg-subtle",
157
+ children: [
158
+ /* @__PURE__ */ d(_e, { className: "h-4 w-4" }),
159
+ " ",
160
+ b("atheletebridge.pages.fixtureDetail.cancelFixture", "Cancel fixture")
161
+ ]
162
+ })
163
+ ]
164
+ })]
165
+ }),
166
+ Pe && /* @__PURE__ */ d(p, {
167
+ className: "mb-8",
168
+ children: /* @__PURE__ */ d("p", {
92
169
  className: "text-sm text-text-secondary",
93
- children: k("atheletebridge.pages.fixtureDetail.recordResultUnavailable", "A result can be recorded once this fixture has started — after its scheduled date and time.")
170
+ children: b("atheletebridge.pages.fixtureDetail.recordResultUnavailable", "A result can be recorded once this fixture has started — after its scheduled date and time.")
94
171
  })
95
172
  }),
96
- $ && /* @__PURE__ */ E("section", {
173
+ Ne && /* @__PURE__ */ f("section", {
97
174
  className: "mb-8",
98
- children: [/* @__PURE__ */ E("h2", {
175
+ children: [/* @__PURE__ */ f("h2", {
99
176
  className: "mb-4 flex items-center gap-2 text-lg font-semibold text-text-primary",
100
177
  children: [
101
- /* @__PURE__ */ T(y, { className: "h-5 w-5" }),
178
+ /* @__PURE__ */ d(ye, { className: "h-5 w-5" }),
102
179
  " ",
103
- k("atheletebridge.pages.fixtureDetail.recordResult", "Record result")
180
+ b("atheletebridge.pages.fixtureDetail.recordResult", "Record result")
104
181
  ]
105
- }), /* @__PURE__ */ E(O, {
182
+ }), /* @__PURE__ */ f(m, {
106
183
  treatment: "insight",
107
184
  className: "p-5 sm:p-6",
108
185
  children: [
109
- /* @__PURE__ */ T("p", {
186
+ /* @__PURE__ */ d("p", {
110
187
  className: "mb-5 text-sm text-text-secondary",
111
- children: k("atheletebridge.pages.fixtureDetail.recordResultDescription", "Recording a final score marks this fixture Completed and recomputes the competition standings for both teams.")
188
+ children: b("atheletebridge.pages.fixtureDetail.recordResultDescription", "Recording a final score marks this fixture Completed and recomputes the competition standings for both teams.")
112
189
  }),
113
- /* @__PURE__ */ E("form", {
190
+ /* @__PURE__ */ f("form", {
114
191
  onSubmit: async (e) => {
115
- if (e.preventDefault(), q(null), !A) return;
116
- let t = h({
117
- homeScore: P,
118
- awayScore: I,
119
- extraTimeHome: R,
120
- extraTimeAway: B,
121
- penaltyHome: H,
122
- penaltyAway: W
192
+ if (e.preventDefault(), I(null), !x) return;
193
+ let t = he({
194
+ homeScore: k,
195
+ awayScore: j,
196
+ extraTimeHome: N,
197
+ extraTimeAway: P,
198
+ penaltyHome: Ee,
199
+ penaltyAway: Oe
123
200
  }, {
124
- scoresRequired: k("atheletebridge.pages.fixtureDetail.scoresRequired", "Both scores are required and must be numbers."),
125
- scoresNegative: k("atheletebridge.pages.fixtureDetail.scoresNegative", "Scores cannot be negative."),
126
- extraTimePair: k("atheletebridge.pages.fixtureDetail.extraTimePair", "Enter both extra-time scores."),
127
- extraTimeNumeric: k("atheletebridge.pages.fixtureDetail.extraTimeNumeric", "Extra-time scores must be numbers."),
128
- extraTimeNegative: k("atheletebridge.pages.fixtureDetail.extraTimeNegative", "Extra-time scores cannot be negative."),
129
- penaltyPair: k("atheletebridge.pages.fixtureDetail.penaltyPair", "Enter both penalty scores."),
130
- penaltyNumeric: k("atheletebridge.pages.fixtureDetail.penaltyNumeric", "Penalty scores must be numbers."),
131
- penaltyNegative: k("atheletebridge.pages.fixtureDetail.penaltyNegative", "Penalty scores cannot be negative."),
132
- extraTimeDecided: k("atheletebridge.pages.fixtureDetail.extraTimeDecided", "Extra time decided the tie — leave the penalty shootout empty."),
133
- extraTimeLevel: k("atheletebridge.pages.fixtureDetail.extraTimeLevel", "Still level after extra time — record the penalty shootout."),
134
- penaltyLevel: k("atheletebridge.pages.fixtureDetail.penaltyLevel", "Penalty scores must have a winner.")
201
+ scoresRequired: b("atheletebridge.pages.fixtureDetail.scoresRequired", "Both scores are required and must be numbers."),
202
+ scoresNegative: b("atheletebridge.pages.fixtureDetail.scoresNegative", "Scores cannot be negative."),
203
+ extraTimePair: b("atheletebridge.pages.fixtureDetail.extraTimePair", "Enter both extra-time scores."),
204
+ extraTimeNumeric: b("atheletebridge.pages.fixtureDetail.extraTimeNumeric", "Extra-time scores must be numbers."),
205
+ extraTimeNegative: b("atheletebridge.pages.fixtureDetail.extraTimeNegative", "Extra-time scores cannot be negative."),
206
+ penaltyPair: b("atheletebridge.pages.fixtureDetail.penaltyPair", "Enter both penalty scores."),
207
+ penaltyNumeric: b("atheletebridge.pages.fixtureDetail.penaltyNumeric", "Penalty scores must be numbers."),
208
+ penaltyNegative: b("atheletebridge.pages.fixtureDetail.penaltyNegative", "Penalty scores cannot be negative."),
209
+ extraTimeDecided: b("atheletebridge.pages.fixtureDetail.extraTimeDecided", "Extra time decided the tie — leave the penalty shootout empty."),
210
+ extraTimeLevel: b("atheletebridge.pages.fixtureDetail.extraTimeLevel", "Still level after extra time — record the penalty shootout."),
211
+ penaltyLevel: b("atheletebridge.pages.fixtureDetail.penaltyLevel", "Penalty scores must have a winner.")
135
212
  });
136
213
  if (!t.ok) {
137
- q(t.error);
214
+ I(t.error);
138
215
  return;
139
216
  }
140
217
  try {
141
- await N.mutateAsync({
142
- id: A,
218
+ await w.mutateAsync({
219
+ id: x,
143
220
  input: t.input
144
- }), F(""), L(""), z(""), V(""), U(""), G("");
221
+ }), A(""), M(""), we(""), Te(""), De(""), ke("");
145
222
  } catch (e) {
146
- q(e instanceof Error ? e.message : k("atheletebridge.pages.fixtureDetail.recordFailed", "Failed to record result."));
223
+ I(e instanceof Error ? e.message : b("atheletebridge.pages.fixtureDetail.recordFailed", "Failed to record result."));
147
224
  }
148
225
  },
149
- children: [/* @__PURE__ */ E(w, { children: [/* @__PURE__ */ E("div", {
226
+ children: [/* @__PURE__ */ f(Se, { children: [/* @__PURE__ */ f("div", {
150
227
  className: "flex flex-wrap items-end justify-center gap-4 sm:gap-6",
151
228
  children: [
152
- /* @__PURE__ */ E("div", {
229
+ /* @__PURE__ */ f("div", {
153
230
  className: "flex items-end gap-3",
154
- children: [/* @__PURE__ */ E("div", {
231
+ children: [/* @__PURE__ */ f("div", {
155
232
  className: "flex flex-col items-center gap-2",
156
- children: [/* @__PURE__ */ T(i, {
157
- name: X,
158
- sport: Y.homeTeam?.sport,
233
+ children: [/* @__PURE__ */ d(r, {
234
+ name: K,
235
+ sport: G.homeTeam?.sport,
159
236
  size: 40
160
- }), /* @__PURE__ */ T("span", {
237
+ }), /* @__PURE__ */ d("span", {
161
238
  className: "max-w-[8rem] truncate text-center text-xs font-medium text-text-secondary",
162
- children: X
239
+ children: K
163
240
  })]
164
- }), /* @__PURE__ */ T(d, {
165
- label: k("atheletebridge.pages.fixtureDetail.home", "Home"),
241
+ }), /* @__PURE__ */ d(i, {
242
+ label: b("atheletebridge.pages.fixtureDetail.home", "Home"),
166
243
  htmlFor: "homeScore",
167
244
  className: "w-24",
168
- children: /* @__PURE__ */ T("input", {
245
+ children: /* @__PURE__ */ d("input", {
169
246
  id: "homeScore",
170
247
  inputMode: "numeric",
171
- className: `${f} text-center text-lg font-bold tabular-nums`,
172
- value: P,
173
- onChange: (e) => F(e.target.value),
248
+ className: `${a} text-center text-lg font-bold tabular-nums`,
249
+ value: k,
250
+ onChange: (e) => A(e.target.value),
174
251
  placeholder: "0"
175
252
  })
176
253
  })]
177
254
  }),
178
- /* @__PURE__ */ T(x, {
255
+ /* @__PURE__ */ d(be, {
179
256
  className: "mb-3 h-5 w-5 shrink-0 text-text-muted",
180
257
  "aria-hidden": "true"
181
258
  }),
182
- /* @__PURE__ */ E("div", {
259
+ /* @__PURE__ */ f("div", {
183
260
  className: "flex items-end gap-3",
184
- children: [/* @__PURE__ */ T(d, {
185
- label: k("atheletebridge.pages.fixtureDetail.away", "Away"),
261
+ children: [/* @__PURE__ */ d(i, {
262
+ label: b("atheletebridge.pages.fixtureDetail.away", "Away"),
186
263
  htmlFor: "awayScore",
187
264
  className: "w-24",
188
- children: /* @__PURE__ */ T("input", {
265
+ children: /* @__PURE__ */ d("input", {
189
266
  id: "awayScore",
190
267
  inputMode: "numeric",
191
- className: `${f} text-center text-lg font-bold tabular-nums`,
192
- value: I,
193
- onChange: (e) => L(e.target.value),
268
+ className: `${a} text-center text-lg font-bold tabular-nums`,
269
+ value: j,
270
+ onChange: (e) => M(e.target.value),
194
271
  placeholder: "0"
195
272
  })
196
- }), /* @__PURE__ */ E("div", {
273
+ }), /* @__PURE__ */ f("div", {
197
274
  className: "flex flex-col items-center gap-2",
198
- children: [/* @__PURE__ */ T(i, {
199
- name: Z,
200
- sport: Y.awayTeam?.sport,
275
+ children: [/* @__PURE__ */ d(r, {
276
+ name: q,
277
+ sport: G.awayTeam?.sport,
201
278
  size: 40
202
- }), /* @__PURE__ */ T("span", {
279
+ }), /* @__PURE__ */ d("span", {
203
280
  className: "max-w-[8rem] truncate text-center text-xs font-medium text-text-secondary",
204
- children: Z
281
+ children: q
205
282
  })]
206
283
  })]
207
284
  })
208
285
  ]
209
- }), !1] }), /* @__PURE__ */ T("div", {
286
+ }), !1] }), /* @__PURE__ */ d("div", {
210
287
  className: "mt-6 flex justify-center",
211
- children: /* @__PURE__ */ E("button", {
288
+ children: /* @__PURE__ */ f("button", {
212
289
  type: "submit",
213
- disabled: N.isPending,
290
+ disabled: w.isPending,
214
291
  className: "inline-flex items-center gap-1.5 rounded-lg bg-action-primary-bg px-6 py-2.5 text-sm font-medium text-action-primary-text transition-colors hover:bg-action-primary-bg/90 disabled:opacity-60",
215
- children: [N.isPending ? /* @__PURE__ */ T(b, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ T(S, { className: "h-4 w-4" }), k("atheletebridge.pages.fixtureDetail.recordResultAction", "Record result")]
292
+ children: [w.isPending ? /* @__PURE__ */ d(l, { className: "h-4 w-4 animate-spin" }) : /* @__PURE__ */ d(u, { className: "h-4 w-4" }), b("atheletebridge.pages.fixtureDetail.recordResultAction", "Record result")]
216
293
  })
217
294
  })]
218
295
  }),
219
- K && /* @__PURE__ */ T("p", {
296
+ F && /* @__PURE__ */ d("p", {
220
297
  className: "mt-3 text-center text-sm text-status-error-text",
221
- children: K
298
+ children: F
222
299
  })
223
300
  ]
224
301
  })]
225
302
  }),
226
- Y.competition && /* @__PURE__ */ E("button", {
303
+ G.competition && /* @__PURE__ */ f("button", {
227
304
  type: "button",
228
- onClick: () => j(`/standings?competition=${encodeURIComponent(Y.competition ?? "")}`),
305
+ onClick: () => S(`/standings?competition=${encodeURIComponent(G.competition ?? "")}`),
229
306
  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",
230
307
  children: [
231
- /* @__PURE__ */ T(S, { className: "h-4 w-4" }),
308
+ /* @__PURE__ */ d(u, { className: "h-4 w-4" }),
232
309
  " ",
233
- k("atheletebridge.pages.fixtureDetail.viewStandings", `View ${Y.competition} standings`)
310
+ b("atheletebridge.pages.fixtureDetail.viewStandings", `View ${G.competition} standings`)
234
311
  ]
312
+ }),
313
+ /* @__PURE__ */ d(h, {
314
+ open: R !== null,
315
+ onOpenChange: (e) => {
316
+ !e && !Q && z(null);
317
+ },
318
+ children: /* @__PURE__ */ f(g, { children: [/* @__PURE__ */ d(v, { children: /* @__PURE__ */ d(y, { children: R === "reschedule" ? b("atheletebridge.pages.fixtureDetail.rescheduleTitle", "Reschedule fixture") : b("atheletebridge.pages.fixtureDetail.postponeTitle", "Postpone fixture") }) }), /* @__PURE__ */ f("form", {
319
+ onSubmit: (e) => void Fe(e),
320
+ className: "space-y-4 px-1",
321
+ children: [
322
+ /* @__PURE__ */ d("p", {
323
+ className: "text-sm text-text-secondary",
324
+ children: R === "reschedule" ? b("atheletebridge.pages.fixtureDetail.rescheduleDescription", "Pick a new date and time for this fixture. Rescheduling a postponed fixture puts it back on the calendar as scheduled.") : b("atheletebridge.pages.fixtureDetail.postponeDescription", "Move this fixture to a later date. Its status becomes Postponed and it stays off the calendar until it is rescheduled.")
325
+ }),
326
+ /* @__PURE__ */ d(i, {
327
+ label: b("atheletebridge.pages.fixtureDetail.newDateTime", "New date & time"),
328
+ htmlFor: "fixtureScheduledAt",
329
+ required: !0,
330
+ children: /* @__PURE__ */ d("input", {
331
+ id: "fixtureScheduledAt",
332
+ type: "datetime-local",
333
+ className: a,
334
+ value: B,
335
+ onChange: (e) => V(e.target.value),
336
+ required: !0
337
+ })
338
+ }),
339
+ /* @__PURE__ */ d(i, {
340
+ label: b("atheletebridge.pages.fixtureDetail.newKickoff", "New kickoff (optional)"),
341
+ htmlFor: "fixtureKickoffAt",
342
+ children: /* @__PURE__ */ d("input", {
343
+ id: "fixtureKickoffAt",
344
+ type: "datetime-local",
345
+ className: a,
346
+ value: H,
347
+ onChange: (e) => U(e.target.value)
348
+ })
349
+ }),
350
+ /* @__PURE__ */ f(_, { children: [/* @__PURE__ */ d("button", {
351
+ type: "button",
352
+ onClick: () => z(null),
353
+ disabled: Q,
354
+ className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-60",
355
+ children: b("common.cancel", "Cancel")
356
+ }), /* @__PURE__ */ f("button", {
357
+ type: "submit",
358
+ disabled: Q,
359
+ 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 disabled:opacity-60",
360
+ children: [Q && /* @__PURE__ */ d(l, { className: "h-4 w-4 animate-spin" }), R === "reschedule" ? b("atheletebridge.pages.fixtureDetail.rescheduleAction", "Reschedule") : b("atheletebridge.pages.fixtureDetail.postponeAction", "Postpone")]
361
+ })] })
362
+ ]
363
+ })] })
364
+ }),
365
+ /* @__PURE__ */ d(h, {
366
+ open: Me,
367
+ onOpenChange: (e) => {
368
+ !e && !D.isPending && W(!1);
369
+ },
370
+ children: /* @__PURE__ */ f(g, { children: [
371
+ /* @__PURE__ */ d(v, { children: /* @__PURE__ */ d(y, { children: b("atheletebridge.pages.fixtureDetail.cancelTitle", "Cancel fixture?") }) }),
372
+ /* @__PURE__ */ d("p", {
373
+ className: "px-1 text-sm text-text-secondary",
374
+ children: b("atheletebridge.pages.fixtureDetail.cancelMessage", "This fixture will be marked Cancelled. A cancelled fixture can never be played or rescheduled. This action cannot be undone.")
375
+ }),
376
+ /* @__PURE__ */ f(_, { children: [/* @__PURE__ */ d("button", {
377
+ type: "button",
378
+ onClick: () => W(!1),
379
+ disabled: D.isPending,
380
+ className: "rounded-lg border border-border-seam px-4 py-2 text-sm font-medium text-text-primary transition-colors hover:bg-bg-sunken disabled:opacity-60",
381
+ children: b("common.keepFixture", "Keep fixture")
382
+ }), /* @__PURE__ */ f("button", {
383
+ type: "button",
384
+ onClick: () => void Ie(),
385
+ disabled: D.isPending,
386
+ className: "inline-flex items-center gap-1.5 rounded-lg bg-action-danger-bg px-4 py-2 text-sm font-semibold text-action-danger-text transition-colors hover:bg-action-danger-bgHover disabled:opacity-60",
387
+ children: [D.isPending && /* @__PURE__ */ d(l, { className: "h-4 w-4 animate-spin" }), b("atheletebridge.pages.fixtureDetail.cancelConfirm", "Cancel fixture")]
388
+ })] })
389
+ ] })
235
390
  })
236
391
  ]
237
392
  });
238
393
  }
239
394
  //#endregion
240
- export { k as FixtureDetailPage };
395
+ export { b as FixtureDetailPage };
241
396
 
242
397
  //# sourceMappingURL=FixtureDetailPage.js.map