@pitvox/partner-react 0.7.21 → 0.7.23

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/index.js CHANGED
@@ -1,94 +1,99 @@
1
- import { jsx as n, jsxs as l, Fragment as _ } from "react/jsx-runtime";
2
- import { createContext as je, useMemo as $, useContext as Ve, useState as B, useCallback as K, useRef as Ke, useEffect as He } from "react";
3
- import { useQueryClient as H, QueryClient as We, QueryClientProvider as Oe, useQuery as M, useMutation as Q, useQueries as xe } from "@tanstack/react-query";
4
- const ae = je(null), ze = "https://cdn.pitvox.com", Qe = "https://pitvox.com";
5
- let te = null;
6
- function vt({
1
+ import { jsx as n, jsxs as l, Fragment as B } from "react/jsx-runtime";
2
+ import { createContext as Qe, useMemo as T, useContext as Ye, useState as E, useEffect as $e, useCallback as H, useRef as Ze } from "react";
3
+ import { useQueryClient as V, QueryClient as Je, QueryClientProvider as Xe, useQuery as R, useMutation as G, useQueries as be } from "@tanstack/react-query";
4
+ import en from "react-markdown";
5
+ const oe = Qe(null), nn = "https://cdn.pitvox.com", tn = "https://pitvox.com";
6
+ let se = null;
7
+ function Zt({
7
8
  partnerSlug: e = null,
8
- cdnUrl: t = ze,
9
- pitvoxUrl: s = Qe,
10
- getSteamId: r,
9
+ cdnUrl: t = nn,
10
+ pitvoxUrl: r = tn,
11
+ getSteamId: s,
11
12
  onRegister: a,
12
- onWithdraw: i,
13
- onFetchNotifications: o,
13
+ onWithdraw: o,
14
+ onFetchNotifications: i,
14
15
  onMarkNotificationRead: d,
15
16
  onMarkAllNotificationsRead: p,
16
17
  onFetchServerPassword: c,
17
- children: u
18
+ onEnterPromotion: u,
19
+ onWithdrawPromotionEntry: v,
20
+ children: f
18
21
  }) {
19
- const v = $(() => ({
22
+ const h = T(() => ({
20
23
  partnerSlug: e,
21
24
  cdnUrl: t.replace(/\/$/, ""),
22
- pitvoxUrl: s.replace(/\/$/, ""),
23
- getSteamId: r || (() => null),
25
+ pitvoxUrl: r.replace(/\/$/, ""),
26
+ getSteamId: s || (() => null),
24
27
  onRegister: a || null,
25
- onWithdraw: i || null,
26
- onFetchNotifications: o || null,
28
+ onWithdraw: o || null,
29
+ onFetchNotifications: i || null,
27
30
  onMarkNotificationRead: d || null,
28
31
  onMarkAllNotificationsRead: p || null,
29
- onFetchServerPassword: c || null
30
- }), [e, t, s, r, a, i, o, d, p, c]);
31
- let f = !1;
32
+ onFetchServerPassword: c || null,
33
+ onEnterPromotion: u || null,
34
+ onWithdrawPromotionEntry: v || null
35
+ }), [e, t, r, s, a, o, i, d, p, c, u, v]);
36
+ let y = !1;
32
37
  try {
33
- H(), f = !0;
38
+ V(), y = !0;
34
39
  } catch {
35
- f = !1;
40
+ y = !1;
36
41
  }
37
- return f ? /* @__PURE__ */ n(ae.Provider, { value: v, children: u }) : (te || (te = new We({
42
+ return y ? /* @__PURE__ */ n(oe.Provider, { value: h, children: f }) : (se || (se = new Je({
38
43
  defaultOptions: {
39
44
  queries: { staleTime: 6e4 }
40
45
  }
41
- })), /* @__PURE__ */ n(Oe, { client: te, children: /* @__PURE__ */ n(ae.Provider, { value: v, children: u }) }));
46
+ })), /* @__PURE__ */ n(Xe, { client: se, children: /* @__PURE__ */ n(oe.Provider, { value: h, children: f }) }));
42
47
  }
43
- function C() {
44
- const e = Ve(ae);
48
+ function S() {
49
+ const e = Ye(oe);
45
50
  if (!e)
46
51
  throw new Error("usePitVox must be used within a <PitVoxPartnerProvider>");
47
52
  return e;
48
53
  }
49
- async function D(e, t) {
50
- const s = await fetch(`${e}/${t}`);
51
- if (!s.ok) {
52
- if (s.status === 404 || s.status === 403) return null;
53
- throw new Error(`CDN fetch failed: ${s.status}`);
54
+ async function M(e, t) {
55
+ const r = await fetch(`${e}/${t}`);
56
+ if (!r.ok) {
57
+ if (r.status === 404 || r.status === 403) return null;
58
+ throw new Error(`CDN fetch failed: ${r.status}`);
54
59
  }
55
- return s.json();
60
+ return r.json();
56
61
  }
57
- function ie(e, t, s, ...r) {
62
+ function de(e, t, r, ...s) {
58
63
  const a = ["leaderboards"];
59
- return e && a.push(`partners/${e}`), t && a.push(t), s && a.push(`v/${s}`), [...a, ...r].join("/");
64
+ return e && a.push(`partners/${e}`), t && a.push(t), r && a.push(`v/${r}`), [...a, ...s].join("/");
60
65
  }
61
- function Ge(e, t, s, r) {
62
- const a = r || "default";
63
- return e ? `laps/partners/${e}/${t}/${s}/${a}.json` : `laps/${t}/${s}/${a}.json`;
66
+ function rn(e, t, r, s) {
67
+ const a = s || "default";
68
+ return e ? `laps/partners/${e}/${t}/${r}/${a}.json` : `laps/${t}/${r}/${a}.json`;
64
69
  }
65
- function ye(e, t) {
70
+ function Te(e, t) {
66
71
  return e ? `laps/partners/${e}/${t}/index.json` : `laps/${t}/index.json`;
67
72
  }
68
- function Ye(e) {
73
+ function sn(e) {
69
74
  return e ? `recent-laps/partners/${e}.json` : "recent-laps.json";
70
75
  }
71
76
  function q(e) {
72
77
  if (!e && e !== 0) return "-";
73
- const t = Math.floor(e / 1e3), s = Math.floor(t / 60), r = t % 60, a = e % 1e3;
74
- return `${s}:${String(r).padStart(2, "0")}.${String(a).padStart(3, "0")}`;
78
+ const t = Math.floor(e / 1e3), r = Math.floor(t / 60), s = t % 60, a = e % 1e3;
79
+ return `${r}:${String(s).padStart(2, "0")}.${String(a).padStart(3, "0")}`;
75
80
  }
76
- function E(e) {
81
+ function F(e) {
77
82
  return !e && e !== 0 ? "-" : e >= 6e4 ? q(e) : (e / 1e3).toFixed(3);
78
83
  }
79
84
  function I(e) {
80
85
  if (!e) return "";
81
86
  let t = e;
82
- return t.startsWith("ks_") && (t = t.slice(3)), t.split("_").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" ");
87
+ return t.startsWith("ks_") && (t = t.slice(3)), t.split("_").map((r) => r.charAt(0).toUpperCase() + r.slice(1)).join(" ");
83
88
  }
84
- function j(e, t, s) {
89
+ function z(e, t, r) {
85
90
  if (!e) return "";
86
- const r = e.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" "), a = s === "acc" || !s && (t == null ? void 0 : t.toLowerCase()) === "track config";
87
- if (!t || t === "default" || a) return r;
88
- const i = t.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" ");
89
- return `${r} ${i}`;
91
+ const s = e.split("_").map((i) => i.charAt(0).toUpperCase() + i.slice(1)).join(" "), a = r === "acc" || !r && (t == null ? void 0 : t.toLowerCase()) === "track config";
92
+ if (!t || t === "default" || a) return s;
93
+ const o = t.split("_").map((i) => i.charAt(0).toUpperCase() + i.slice(1)).join(" ");
94
+ return `${s} ${o}`;
90
95
  }
91
- function W(e) {
96
+ function Q(e) {
92
97
  if (!e) return "-";
93
98
  try {
94
99
  return new Date(e).toLocaleDateString("en-GB", {
@@ -100,25 +105,25 @@ function W(e) {
100
105
  return "-";
101
106
  }
102
107
  }
103
- function oe(e) {
108
+ function pe(e) {
104
109
  if (!e) return "";
105
- const t = Date.now() - new Date(e).getTime(), s = Math.floor(t / 1e3);
106
- if (s < 60) return "Just now";
107
- const r = Math.floor(s / 60);
108
- if (r < 60) return `${r}m ago`;
109
- const a = Math.floor(r / 60);
110
+ const t = Date.now() - new Date(e).getTime(), r = Math.floor(t / 1e3);
111
+ if (r < 60) return "Just now";
112
+ const s = Math.floor(r / 60);
113
+ if (s < 60) return `${s}m ago`;
114
+ const a = Math.floor(s / 60);
110
115
  if (a < 24) return `${a}h ago`;
111
- const i = Math.floor(a / 24);
112
- return i < 30 ? `${i}d ago` : W(e);
116
+ const o = Math.floor(a / 24);
117
+ return o < 30 ? `${o}d ago` : Q(e);
113
118
  }
114
- function xt(e) {
119
+ function Jt(e) {
115
120
  return e == null ? "" : `${e >= 0 ? "+" : "-"}${(Math.abs(e) / 1e3).toFixed(3)}`;
116
121
  }
117
- function Je(e, t) {
118
- const { type: s, title: r, trackId: a, trackLayout: i, carId: o, game: d, data: p } = e, c = typeof p == "string" ? JSON.parse(p) : p, u = a ? j(a, i, d) : null, v = o ? I(o) : null, f = [u, v].filter(Boolean).join(" — ");
119
- return s === "RECORD_BEATEN" && f ? `${c != null && c.beatenBySteamId && t ? t(c.beatenBySteamId).displayName : "Someone"} beat your record on ${f}` : s === "RECORD_SET" && f ? `You set a new record on ${f}` : r || "New notification";
122
+ function an(e, t) {
123
+ const { type: r, title: s, trackId: a, trackLayout: o, carId: i, game: d, data: p } = e, c = typeof p == "string" ? JSON.parse(p) : p, u = a ? z(a, o, d) : null, v = i ? I(i) : null, f = [u, v].filter(Boolean).join(" — ");
124
+ return r === "RECORD_BEATEN" && f ? `${c != null && c.beatenBySteamId && t ? t(c.beatenBySteamId).displayName : "Someone"} beat your record on ${f}` : r === "RECORD_SET" && f ? `You set a new record on ${f}` : s || "New notification";
120
125
  }
121
- function ke(e) {
126
+ function Re(e) {
122
127
  return e ? {
123
128
  E: "Eco",
124
129
  RD: "Road",
@@ -132,519 +137,1028 @@ function ke(e) {
132
137
  S: "Soft"
133
138
  }[e] || e : "Unknown";
134
139
  }
135
- function we(e) {
140
+ function Me(e) {
136
141
  if (!e) return "-";
137
142
  const t = Number(e);
138
143
  return isNaN(t) ? "-" : t % 1 ? `${t.toFixed(1)}L` : `${t}L`;
139
144
  }
140
- function Ze(e = {}) {
145
+ function on(e = {}) {
141
146
  var p, c, u, v, f, h;
142
- const { cdnUrl: t, partnerSlug: s } = C(), { game: r, gameVersion: a } = e, i = ie(s, null, null, "index.json"), o = M({
143
- queryKey: ["pitvox", "leaderboards", s, "index"],
144
- queryFn: () => D(t, i),
147
+ const { cdnUrl: t, partnerSlug: r } = S(), { game: s, gameVersion: a } = e, o = de(r, null, null, "index.json"), i = R({
148
+ queryKey: ["pitvox", "leaderboards", r, "index"],
149
+ queryFn: () => M(t, o),
145
150
  staleTime: 3e4,
146
151
  refetchInterval: 3e4
147
- }), d = $(() => {
152
+ }), d = T(() => {
148
153
  var x;
149
- if (!((x = o.data) != null && x.tracks)) return [];
150
- let k = o.data.tracks;
151
- return r && (k = k.filter((g) => g.game === r)), a && (k = k.filter((g) => g.gameVersion === a)), k.map((g) => ({
152
- id: g.trackId,
153
- layout: g.layout,
154
- game: g.game,
155
- gameVersion: g.gameVersion,
156
- displayName: j(g.trackId, g.layout, g.game),
157
- driverCount: g.driverCount || 0,
158
- carCount: g.carCount || 0,
159
- record: g.recordHolder ? {
160
- visibleId: g.recordHolder.steamId || g.recordHolder.userId,
161
- carId: g.recordHolder.carId,
162
- carDisplayName: I(g.recordHolder.carId),
163
- lapTimeMs: g.recordHolder.lapTimeMs,
164
- timestamp: g.recordHolder.recordedAt
154
+ if (!((x = i.data) != null && x.tracks)) return [];
155
+ let y = i.data.tracks;
156
+ return s && (y = y.filter((m) => m.game === s)), a && (y = y.filter((m) => m.gameVersion === a)), y.map((m) => ({
157
+ id: m.trackId,
158
+ layout: m.layout,
159
+ game: m.game,
160
+ gameVersion: m.gameVersion,
161
+ displayName: z(m.trackId, m.layout, m.game),
162
+ driverCount: m.driverCount || 0,
163
+ carCount: m.carCount || 0,
164
+ record: m.recordHolder ? {
165
+ visibleId: m.recordHolder.steamId || m.recordHolder.userId,
166
+ carId: m.recordHolder.carId,
167
+ carDisplayName: I(m.recordHolder.carId),
168
+ lapTimeMs: m.recordHolder.lapTimeMs,
169
+ timestamp: m.recordHolder.recordedAt
165
170
  } : null,
166
- recordByTag: g.recordByTag || null
171
+ recordByTag: m.recordByTag || null
167
172
  }));
168
- }, [(p = o.data) == null ? void 0 : p.tracks, r, a]);
173
+ }, [(p = i.data) == null ? void 0 : p.tracks, s, a]);
169
174
  return {
170
- ...o,
175
+ ...i,
171
176
  data: d,
172
- partner: ((c = o.data) == null ? void 0 : c.partner) || null,
173
- generatedAt: (u = o.data) == null ? void 0 : u.generatedAt,
174
- totalLaps: ((v = o.data) == null ? void 0 : v.totalLaps) || 0,
175
- totalUsers: ((f = o.data) == null ? void 0 : f.totalUsers) || 0,
176
- versions: ((h = o.data) == null ? void 0 : h.versions) || {}
177
+ partner: ((c = i.data) == null ? void 0 : c.partner) || null,
178
+ generatedAt: (u = i.data) == null ? void 0 : u.generatedAt,
179
+ totalLaps: ((v = i.data) == null ? void 0 : v.totalLaps) || 0,
180
+ totalUsers: ((f = i.data) == null ? void 0 : f.totalUsers) || 0,
181
+ versions: ((h = i.data) == null ? void 0 : h.versions) || {}
177
182
  };
178
183
  }
179
- function Xe(e, t, s = {}) {
180
- const { cdnUrl: r, partnerSlug: a } = C(), { carId: i, game: o, gameVersion: d } = s, p = t || "default", c = ie(a, o, d, `tracks/${e}/${p}.json`), { data: u, isLoading: v, error: f } = M({
181
- queryKey: ["pitvox", "leaderboards", a, "track", e, p, o, d],
182
- queryFn: () => D(r, c),
184
+ function ln(e, t, r = {}) {
185
+ const { cdnUrl: s, partnerSlug: a } = S(), { carId: o, game: i, gameVersion: d } = r, p = t || "default", c = de(a, i, d, `tracks/${e}/${p}.json`), { data: u, isLoading: v, error: f } = R({
186
+ queryKey: ["pitvox", "leaderboards", a, "track", e, p, i, d],
187
+ queryFn: () => M(s, c),
183
188
  enabled: !!e,
184
189
  staleTime: 3e4,
185
190
  refetchInterval: 3e4
186
191
  });
187
- return { data: $(() => {
192
+ return { data: T(() => {
188
193
  if (!(u != null && u.entries)) return [];
189
- let k = u.entries;
190
- if (o && (k = k.filter((x) => x.game === o)), !i) {
191
- const x = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
192
- for (const y of k) {
193
- const m = y.steamId || y.userId;
194
- g.has(y.carId) || g.set(y.carId, /* @__PURE__ */ new Set()), g.get(y.carId).add(m), (!x.has(y.carId) || y.lapTimeMs < x.get(y.carId).lapTimeMs) && x.set(y.carId, y);
194
+ let y = u.entries;
195
+ if (i && (y = y.filter((x) => x.game === i)), !o) {
196
+ const x = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
197
+ for (const b of y) {
198
+ const g = b.steamId || b.userId;
199
+ m.has(b.carId) || m.set(b.carId, /* @__PURE__ */ new Set()), m.get(b.carId).add(g), (!x.has(b.carId) || b.lapTimeMs < x.get(b.carId).lapTimeMs) && x.set(b.carId, b);
195
200
  }
196
- return Array.from(x.values()).map((y) => {
197
- var m;
198
- return { ...y, driverCount: ((m = g.get(y.carId)) == null ? void 0 : m.size) || 0 };
199
- }).sort((y, m) => y.lapTimeMs - m.lapTimeMs);
201
+ return Array.from(x.values()).map((b) => {
202
+ var g;
203
+ return { ...b, driverCount: ((g = m.get(b.carId)) == null ? void 0 : g.size) || 0 };
204
+ }).sort((b, g) => b.lapTimeMs - g.lapTimeMs);
200
205
  }
201
- return k.filter((x) => x.carId === i).sort((x, g) => x.lapTimeMs - g.lapTimeMs);
202
- }, [u == null ? void 0 : u.entries, i, o]), isLoading: v, error: f };
203
- }
204
- function en(e, t, s, r, a = {}) {
205
- var x, g;
206
- const { cdnUrl: i, partnerSlug: o } = C(), { showInvalid: d = !1, game: p, gameVersion: c } = a, u = e && t ? Ge(o, e, t, s) : null, f = M({
207
- queryKey: ["pitvox", "laps", o, e, t, s || "default"],
208
- queryFn: () => D(i, u),
206
+ return y.filter((x) => x.carId === o).sort((x, m) => x.lapTimeMs - m.lapTimeMs);
207
+ }, [u == null ? void 0 : u.entries, o, i]), isLoading: v, error: f };
208
+ }
209
+ function cn(e, t, r, s, a = {}) {
210
+ var x, m;
211
+ const { cdnUrl: o, partnerSlug: i } = S(), { showInvalid: d = !1, game: p, gameVersion: c } = a, u = e && t ? rn(i, e, t, r) : null, f = R({
212
+ queryKey: ["pitvox", "laps", i, e, t, r || "default"],
213
+ queryFn: () => M(o, u),
209
214
  enabled: !!e && !!t,
210
215
  staleTime: 3e4,
211
216
  refetchInterval: 3e4
212
- }), h = $(() => {
213
- var y;
214
- return (y = f.data) != null && y.laps ? f.data.laps.filter((m) => !(m.carId !== r || p && m.game !== p || c && m.gameVersion !== c || !d && !m.isValid)).sort((m, w) => m.lapTimeMs - w.lapTimeMs) : [];
215
- }, [(x = f.data) == null ? void 0 : x.laps, r, p, c, d]), k = $(() => {
216
- const y = h.filter((N) => N.isValid && N.sector1Ms && N.sector2Ms && N.sector3Ms);
217
- if (y.length < 2) return null;
218
- const m = Math.min(...y.map((N) => N.sector1Ms)), w = Math.min(...y.map((N) => N.sector2Ms)), S = Math.min(...y.map((N) => N.sector3Ms)), R = m + w + S, T = Math.min(...y.map((N) => N.lapTimeMs));
219
- return R >= T ? null : { lapTimeMs: R, sector1Ms: m, sector2Ms: w, sector3Ms: S };
217
+ }), h = T(() => {
218
+ var b;
219
+ return (b = f.data) != null && b.laps ? f.data.laps.filter((g) => !(g.carId !== s || p && g.game !== p || c && g.gameVersion !== c || !d && !g.isValid)).sort((g, k) => g.lapTimeMs - k.lapTimeMs) : [];
220
+ }, [(x = f.data) == null ? void 0 : x.laps, s, p, c, d]), y = T(() => {
221
+ const b = h.filter((N) => N.isValid && N.sector1Ms && N.sector2Ms && N.sector3Ms);
222
+ if (b.length < 2) return null;
223
+ const g = Math.min(...b.map((N) => N.sector1Ms)), k = Math.min(...b.map((N) => N.sector2Ms)), C = Math.min(...b.map((N) => N.sector3Ms)), P = g + k + C, A = Math.min(...b.map((N) => N.lapTimeMs));
224
+ return P >= A ? null : { lapTimeMs: P, sector1Ms: g, sector2Ms: k, sector3Ms: C };
220
225
  }, [h]);
221
226
  return {
222
227
  ...f,
223
228
  data: h,
224
- driverName: ((g = f.data) == null ? void 0 : g.driverName) || "Driver",
225
- theoreticalBest: k
229
+ driverName: ((m = f.data) == null ? void 0 : m.driverName) || "Driver",
230
+ theoreticalBest: y
226
231
  };
227
232
  }
228
- function Ce() {
229
- const { cdnUrl: e } = C(), { data: t } = M({
233
+ function ue() {
234
+ const { cdnUrl: e } = S(), { data: t } = R({
230
235
  queryKey: ["pitvox", "users", "index"],
231
- queryFn: () => D(e, "users/index.json"),
236
+ queryFn: () => M(e, "users/index.json"),
232
237
  staleTime: 5 * 6e4,
233
238
  gcTime: 30 * 6e4
234
- }), s = (t == null ? void 0 : t.users) || {};
235
- return (r, a) => {
236
- const i = s[r];
239
+ }), r = (t == null ? void 0 : t.users) || {};
240
+ return (s, a) => {
241
+ const o = r[s];
237
242
  return {
238
- displayName: (i == null ? void 0 : i.displayName) || a || r || "Unknown",
239
- avatarUrl: (i == null ? void 0 : i.avatarUrl) || null,
240
- affiliations: (i == null ? void 0 : i.affiliations) || []
243
+ displayName: (o == null ? void 0 : o.displayName) || a || s || "Unknown",
244
+ avatarUrl: (o == null ? void 0 : o.avatarUrl) || null,
245
+ affiliations: (o == null ? void 0 : o.affiliations) || []
241
246
  };
242
247
  };
243
248
  }
244
- function gt(e = "evo") {
245
- const { cdnUrl: t } = C(), { data: s } = M({
249
+ function Xt(e = "evo") {
250
+ const { cdnUrl: t } = S(), { data: r } = R({
246
251
  queryKey: ["pitvox", "cars", e],
247
- queryFn: () => D(t, `cars/${e}.json`),
252
+ queryFn: () => M(t, `cars/${e}.json`),
248
253
  staleTime: 5 * 6e4,
249
254
  gcTime: 30 * 6e4
250
255
  });
251
256
  return {
252
- tags: (s == null ? void 0 : s.tags) || [],
253
- cars: (s == null ? void 0 : s.cars) || {},
254
- categories: (s == null ? void 0 : s.categories) || [],
255
- tagLabels: (s == null ? void 0 : s.tagLabels) || {}
257
+ tags: (r == null ? void 0 : r.tags) || [],
258
+ cars: (r == null ? void 0 : r.cars) || {},
259
+ categories: (r == null ? void 0 : r.categories) || [],
260
+ tagLabels: (r == null ? void 0 : r.tagLabels) || {}
256
261
  };
257
262
  }
258
- function ft() {
259
- var a, i;
260
- const { cdnUrl: e, partnerSlug: t } = C(), s = Ye(t), r = M({
263
+ function er() {
264
+ var a, o;
265
+ const { cdnUrl: e, partnerSlug: t } = S(), r = sn(t), s = R({
261
266
  queryKey: ["pitvox", "recentLaps", t],
262
- queryFn: () => D(e, s),
267
+ queryFn: () => M(e, r),
263
268
  staleTime: 3e4,
264
269
  refetchInterval: 3e4,
265
270
  gcTime: 10 * 6e4
266
271
  });
267
272
  return {
268
- groups: ((a = r.data) == null ? void 0 : a.groups) || [],
269
- generatedAt: ((i = r.data) == null ? void 0 : i.generatedAt) || null,
270
- isLoading: r.isLoading
273
+ groups: ((a = s.data) == null ? void 0 : a.groups) || [],
274
+ generatedAt: ((o = s.data) == null ? void 0 : o.generatedAt) || null,
275
+ isLoading: s.isLoading
271
276
  };
272
277
  }
273
- function Nt(e, t) {
274
- return Xe(e, null, { carId: t });
278
+ function nr(e, t) {
279
+ return ln(e, null, { carId: t });
275
280
  }
276
- function bt() {
277
- const { cdnUrl: e, partnerSlug: t } = C();
278
- return M({
281
+ function tr() {
282
+ const { cdnUrl: e, partnerSlug: t } = S();
283
+ return R({
279
284
  queryKey: ["pitvox", "competitions", t],
280
285
  queryFn: async () => {
281
- const s = await D(e, "competitions/index.json");
282
- return s != null && s.competitions ? t ? s.competitions.filter((r) => r.partnerSlug === t) : s.competitions : [];
286
+ const r = await M(e, "competitions/index.json");
287
+ return r != null && r.competitions ? t ? r.competitions.filter((s) => s.partnerSlug === t) : r.competitions : [];
283
288
  },
284
289
  staleTime: 6e4
285
290
  });
286
291
  }
287
- function Le(e, t = {}) {
288
- const s = C(), r = t.partnerSlug || s.partnerSlug;
289
- return M({
290
- queryKey: ["pitvox", "competition", r, e, "config"],
291
- queryFn: () => D(s.cdnUrl, `competitions/${r}/${e}/config.json`),
292
- enabled: !!r && !!e,
292
+ function Pe(e, t = {}) {
293
+ const r = S(), s = t.partnerSlug || r.partnerSlug;
294
+ return R({
295
+ queryKey: ["pitvox", "competition", s, e, "config"],
296
+ queryFn: () => M(r.cdnUrl, `competitions/${s}/${e}/config.json`),
297
+ enabled: !!s && !!e,
293
298
  staleTime: 6e4
294
299
  });
295
300
  }
296
- function Se(e, t = {}) {
297
- const s = C(), r = t.partnerSlug || s.partnerSlug;
298
- return M({
299
- queryKey: ["pitvox", "competition", r, e, "standings"],
300
- queryFn: () => D(s.cdnUrl, `competitions/${r}/${e}/standings.json`),
301
- enabled: !!r && !!e,
301
+ function De(e, t = {}) {
302
+ const r = S(), s = t.partnerSlug || r.partnerSlug;
303
+ return R({
304
+ queryKey: ["pitvox", "competition", s, e, "standings"],
305
+ queryFn: () => M(r.cdnUrl, `competitions/${s}/${e}/standings.json`),
306
+ enabled: !!s && !!e,
302
307
  staleTime: 6e4
303
308
  });
304
309
  }
305
- function nn(e, t, s = {}) {
306
- const r = C(), a = s.partnerSlug || r.partnerSlug;
307
- return M({
310
+ function dn(e, t, r = {}) {
311
+ const s = S(), a = r.partnerSlug || s.partnerSlug;
312
+ return R({
308
313
  queryKey: ["pitvox", "competition", a, e, "round", t],
309
- queryFn: () => D(r.cdnUrl, `competitions/${a}/${e}/rounds/${t}.json`),
314
+ queryFn: () => M(s.cdnUrl, `competitions/${a}/${e}/rounds/${t}.json`),
310
315
  enabled: !!a && !!e && t != null,
311
316
  staleTime: 6e4
312
317
  });
313
318
  }
314
- function tn(e, t = [], s = {}) {
315
- const r = C(), a = s.partnerSlug || r.partnerSlug;
316
- return M({
319
+ function pn(e, t = [], r = {}) {
320
+ const s = S(), a = r.partnerSlug || s.partnerSlug;
321
+ return R({
317
322
  queryKey: ["pitvox", "competition", a, e, "allRounds", t],
318
323
  queryFn: async () => (await Promise.all(
319
324
  t.map(
320
- (o) => D(r.cdnUrl, `competitions/${a}/${e}/rounds/${o}.json`).catch(() => null)
325
+ (i) => M(s.cdnUrl, `competitions/${a}/${e}/rounds/${i}.json`).catch(() => null)
321
326
  )
322
327
  )).filter(Boolean),
323
328
  enabled: !!a && !!e && t.length > 0,
324
329
  staleTime: 6e4
325
330
  });
326
331
  }
327
- function sn(e, t = {}) {
328
- const s = C(), r = t.partnerSlug || s.partnerSlug;
329
- return M({
330
- queryKey: ["pitvox", "competition", r, e, "leaderboard"],
331
- queryFn: () => D(s.cdnUrl, `competitions/${r}/${e}/leaderboard.json`).catch(() => null),
332
- enabled: !!r && !!e,
332
+ function un(e, t = {}) {
333
+ const r = S(), s = t.partnerSlug || r.partnerSlug;
334
+ return R({
335
+ queryKey: ["pitvox", "competition", s, e, "leaderboard"],
336
+ queryFn: () => M(r.cdnUrl, `competitions/${s}/${e}/leaderboard.json`).catch(() => null),
337
+ enabled: !!s && !!e,
333
338
  staleTime: 6e4
334
339
  });
335
340
  }
336
- function rn(e, t, s = {}) {
337
- const r = C(), a = s.partnerSlug || r.partnerSlug;
338
- return M({
341
+ function hn(e, t, r = {}) {
342
+ const s = S(), a = r.partnerSlug || s.partnerSlug;
343
+ return R({
339
344
  queryKey: ["pitvox", "competition", a, e, "round", t, "leaderboard"],
340
- queryFn: () => D(r.cdnUrl, `competitions/${a}/${e}/rounds/${t}/leaderboard.json`).catch(() => null),
345
+ queryFn: () => M(s.cdnUrl, `competitions/${a}/${e}/rounds/${t}/leaderboard.json`).catch(() => null),
341
346
  enabled: !!a && !!e && t != null,
342
347
  staleTime: 6e4
343
348
  });
344
349
  }
345
- function an(e, t, s = {}) {
346
- const r = C(), a = s.partnerSlug || r.partnerSlug;
347
- return M({
350
+ function mn(e, t, r = {}) {
351
+ const s = S(), a = r.partnerSlug || s.partnerSlug;
352
+ return R({
348
353
  queryKey: ["pitvox", "competition", a, e, "round", t, "laps"],
349
- queryFn: () => D(r.cdnUrl, `competitions/${a}/${e}/rounds/${t}/laps.json`).catch(() => null),
354
+ queryFn: () => M(s.cdnUrl, `competitions/${a}/${e}/rounds/${t}/laps.json`).catch(() => null),
350
355
  enabled: !!a && !!e && t != null,
351
356
  staleTime: 6e4
352
357
  });
353
358
  }
354
- function on(e, t, s = {}) {
355
- const r = C(), a = s.partnerSlug || r.partnerSlug;
356
- return M({
359
+ function vn(e, t, r = {}) {
360
+ const s = S(), a = r.partnerSlug || s.partnerSlug;
361
+ return R({
357
362
  queryKey: ["pitvox", "competition", a, e, "round", t, "positions"],
358
- queryFn: () => D(r.cdnUrl, `competitions/${a}/${e}/rounds/${t}/positions.json`).catch(() => null),
359
- enabled: (s.enabled ?? !0) && !!a && !!e && t != null,
363
+ queryFn: () => M(s.cdnUrl, `competitions/${a}/${e}/rounds/${t}/positions.json`).catch(() => null),
364
+ enabled: (r.enabled ?? !0) && !!a && !!e && t != null,
360
365
  staleTime: 6e4
361
366
  });
362
367
  }
363
- function $e(e, t = {}) {
364
- const s = C(), r = t.partnerSlug || s.partnerSlug;
365
- return M({
366
- queryKey: ["pitvox", "competition", r, e, "entrylist"],
367
- queryFn: () => D(s.cdnUrl, `competitions/${r}/${e}/entrylist.json`),
368
- enabled: !!r && !!e,
368
+ function Ae(e, t = {}) {
369
+ const r = S(), s = t.partnerSlug || r.partnerSlug;
370
+ return R({
371
+ queryKey: ["pitvox", "competition", s, e, "entrylist"],
372
+ queryFn: () => M(r.cdnUrl, `competitions/${s}/${e}/entrylist.json`),
373
+ enabled: !!s && !!e,
369
374
  staleTime: 6e4
370
375
  });
371
376
  }
372
- function le(e) {
373
- const { cdnUrl: t, partnerSlug: s, getSteamId: r } = C(), a = r();
374
- return M({
375
- queryKey: ["pitvox", "registration", s, e, a],
377
+ function he(e) {
378
+ const { cdnUrl: t, partnerSlug: r, getSteamId: s } = S(), a = s();
379
+ return R({
380
+ queryKey: ["pitvox", "registration", r, e, a],
376
381
  queryFn: async () => {
377
382
  var p;
378
- const i = await fetch(`${t}/competitions/${s}/${e}/entrylist.json`);
379
- if (!i.ok) return { isRegistered: !1, entryList: null };
380
- const o = await i.json();
381
- return { isRegistered: !!a && ((p = o.drivers) == null ? void 0 : p.some((c) => c.steamId === a)), entryList: o };
383
+ const o = await fetch(`${t}/competitions/${r}/${e}/entrylist.json`);
384
+ if (!o.ok) return { isRegistered: !1, entryList: null };
385
+ const i = await o.json();
386
+ return { isRegistered: !!a && ((p = i.drivers) == null ? void 0 : p.some((c) => c.steamId === a)), entryList: i };
382
387
  },
383
388
  enabled: !!e,
384
389
  staleTime: 6e4
385
390
  });
386
391
  }
387
- function Re(e) {
388
- const { onRegister: t, partnerSlug: s, getSteamId: r } = C(), a = H(), i = Ce();
389
- return Q({
390
- mutationFn: (o) => {
392
+ function Ee(e) {
393
+ const { onRegister: t, partnerSlug: r, getSteamId: s } = S(), a = V(), o = ue();
394
+ return G({
395
+ mutationFn: (i) => {
391
396
  if (!t)
392
397
  throw new Error(
393
398
  "No onRegister callback provided to PitVoxPartnerProvider. Provide onRegister for in-app registration, or use useRegistrationUrl() to link to pitvox.com."
394
399
  );
395
- return t(e, o);
400
+ return t(e, i);
396
401
  },
397
402
  onSuccess: () => {
398
- const o = r();
403
+ const i = s();
399
404
  if (a.setQueriesData(
400
- { queryKey: ["pitvox", "registration", s, e] },
405
+ { queryKey: ["pitvox", "registration", r, e] },
401
406
  (d) => d ? { ...d, isRegistered: !0 } : { isRegistered: !0, entryList: null }
402
- ), o) {
403
- const d = i(o), p = {
404
- steamId: o,
407
+ ), i) {
408
+ const d = o(i), p = {
409
+ steamId: i,
405
410
  displayName: d.displayName,
406
411
  avatarUrl: d.avatarUrl
407
412
  };
408
413
  a.setQueriesData(
409
- { queryKey: ["pitvox", "competition", s, e, "entrylist"] },
414
+ { queryKey: ["pitvox", "competition", r, e, "entrylist"] },
410
415
  (c) => {
411
416
  var v;
412
- return c ? ((v = c.drivers) == null ? void 0 : v.some((f) => f.steamId === o)) ? c : { ...c, drivers: [...c.drivers || [], p] } : { drivers: [p] };
417
+ return c ? ((v = c.drivers) == null ? void 0 : v.some((f) => f.steamId === i)) ? c : { ...c, drivers: [...c.drivers || [], p] } : { drivers: [p] };
413
418
  }
414
419
  );
415
420
  }
416
421
  }
417
422
  });
418
423
  }
419
- function Te(e) {
420
- const { onWithdraw: t, partnerSlug: s, getSteamId: r } = C(), a = H();
421
- return Q({
422
- mutationFn: (i) => {
424
+ function Be(e) {
425
+ const { onWithdraw: t, partnerSlug: r, getSteamId: s } = S(), a = V();
426
+ return G({
427
+ mutationFn: (o) => {
423
428
  if (!t)
424
429
  throw new Error(
425
430
  "No onWithdraw callback provided to PitVoxPartnerProvider. Provide onWithdraw for in-app withdrawal, or use useRegistrationUrl() to link to pitvox.com."
426
431
  );
427
- const o = i || r();
428
- if (!o) throw new Error("No Steam ID available");
429
- return t(e, o);
432
+ const i = o || s();
433
+ if (!i) throw new Error("No Steam ID available");
434
+ return t(e, i);
430
435
  },
431
436
  onSuccess: () => {
432
- const i = r();
437
+ const o = s();
433
438
  a.setQueriesData(
434
- { queryKey: ["pitvox", "registration", s, e] },
435
- (o) => o ? { ...o, isRegistered: !1 } : { isRegistered: !1, entryList: null }
436
- ), i && a.setQueriesData(
437
- { queryKey: ["pitvox", "competition", s, e, "entrylist"] },
438
- (o) => o != null && o.drivers ? { ...o, drivers: o.drivers.filter((d) => d.steamId !== i) } : o
439
+ { queryKey: ["pitvox", "registration", r, e] },
440
+ (i) => i ? { ...i, isRegistered: !1 } : { isRegistered: !1, entryList: null }
441
+ ), o && a.setQueriesData(
442
+ { queryKey: ["pitvox", "competition", r, e, "entrylist"] },
443
+ (i) => i != null && i.drivers ? { ...i, drivers: i.drivers.filter((d) => d.steamId !== o) } : i
439
444
  );
440
445
  }
441
446
  });
442
447
  }
443
- function ce() {
444
- const { onRegister: e, onWithdraw: t } = C(), s = !!(e && t);
445
- return { isPowerMode: s, isBasicMode: !s };
448
+ function me() {
449
+ const { onRegister: e, onWithdraw: t } = S(), r = !!(e && t);
450
+ return { isPowerMode: r, isBasicMode: !r };
451
+ }
452
+ function ve(e) {
453
+ const { pitvoxUrl: t, partnerSlug: r } = S();
454
+ return `${t}/p/${r}/competitions/${e}/register`;
455
+ }
456
+ function J(e, t = /* @__PURE__ */ new Date()) {
457
+ var r;
458
+ return e.winnersAnnouncedAt || (r = e.winners) != null && r.length ? "winners" : e.opensAt && t < new Date(e.opensAt) ? "upcoming" : e.closesAt && t >= new Date(e.closesAt) ? "closed" : "open";
446
459
  }
447
- function de(e) {
448
- const { pitvoxUrl: t, partnerSlug: s } = C();
449
- return `${t}/p/${s}/competitions/${e}/register`;
460
+ const xn = {
461
+ upcoming: "Opens soon",
462
+ open: "Open",
463
+ closed: "Closed",
464
+ winners: "Winners announced"
465
+ };
466
+ function gn() {
467
+ const { cdnUrl: e, partnerSlug: t } = S();
468
+ return R({
469
+ queryKey: ["pitvox", "promotions", t],
470
+ queryFn: async () => {
471
+ const r = await M(e, "promotions/index.json");
472
+ return r != null && r.promotions ? t ? r.promotions.filter((s) => s.partnerSlug === t) : r.promotions : [];
473
+ },
474
+ staleTime: 6e4
475
+ });
476
+ }
477
+ function fn(e, t = {}) {
478
+ const r = S(), s = t.partnerSlug || r.partnerSlug;
479
+ return R({
480
+ queryKey: ["pitvox", "promotion", s, e, "config"],
481
+ queryFn: () => M(r.cdnUrl, `promotions/${s}/${e}/config.json`),
482
+ enabled: !!s && !!e,
483
+ staleTime: 6e4
484
+ });
485
+ }
486
+ function Nn(e, t = {}) {
487
+ const r = S(), s = t.partnerSlug || r.partnerSlug;
488
+ return R({
489
+ queryKey: ["pitvox", "promotion", s, e, "entrylist"],
490
+ queryFn: () => M(r.cdnUrl, `promotions/${s}/${e}/entrylist.json`),
491
+ enabled: !!s && !!e,
492
+ staleTime: 6e4
493
+ });
494
+ }
495
+ function yn(e) {
496
+ const { cdnUrl: t, partnerSlug: r, getSteamId: s } = S(), a = s();
497
+ return R({
498
+ queryKey: ["pitvox", "promotionEntry", r, e, a],
499
+ queryFn: async () => {
500
+ var d;
501
+ const o = await M(t, `promotions/${r}/${e}/entrylist.json`);
502
+ return o ? { isEntered: !!a && ((d = o.entrants) == null ? void 0 : d.some((p) => p.steamId === a)), entryList: o } : { isEntered: !1, entryList: null };
503
+ },
504
+ enabled: !!e,
505
+ staleTime: 6e4
506
+ });
450
507
  }
451
- function ln(e, t) {
452
- for (const s of t)
453
- if (s.tags.includes(e)) return s.id;
508
+ function bn(e) {
509
+ const { onEnterPromotion: t, partnerSlug: r, getSteamId: s } = S(), a = V(), o = ue();
510
+ return G({
511
+ mutationFn: (i) => {
512
+ if (!t)
513
+ throw new Error(
514
+ "No onEnterPromotion callback provided to PitVoxPartnerProvider. Provide onEnterPromotion for in-app entry, or use usePromotionUrl() to link to pitvox.com."
515
+ );
516
+ return t(e, i);
517
+ },
518
+ onSuccess: () => {
519
+ const i = s();
520
+ if (a.setQueriesData(
521
+ { queryKey: ["pitvox", "promotionEntry", r, e] },
522
+ (d) => d ? { ...d, isEntered: !0 } : { isEntered: !0, entryList: null }
523
+ ), i) {
524
+ const d = o(i), p = {
525
+ steamId: i,
526
+ displayName: d.displayName,
527
+ avatarUrl: d.avatarUrl
528
+ };
529
+ a.setQueriesData(
530
+ { queryKey: ["pitvox", "promotion", r, e, "entrylist"] },
531
+ (c) => {
532
+ var f;
533
+ if (!c) return { entrants: [p], count: 1 };
534
+ if ((f = c.entrants) == null ? void 0 : f.some((h) => h.steamId === i)) return c;
535
+ const v = [...c.entrants || [], p];
536
+ return { ...c, entrants: v, count: v.length };
537
+ }
538
+ );
539
+ }
540
+ }
541
+ });
542
+ }
543
+ function wn(e) {
544
+ const { onWithdrawPromotionEntry: t, partnerSlug: r, getSteamId: s } = S(), a = V();
545
+ return G({
546
+ mutationFn: (o) => {
547
+ if (!t)
548
+ throw new Error(
549
+ "No onWithdrawPromotionEntry callback provided to PitVoxPartnerProvider. Provide onWithdrawPromotionEntry for in-app withdrawal, or use usePromotionUrl() to link to pitvox.com."
550
+ );
551
+ const i = o || s();
552
+ if (!i) throw new Error("No Steam ID available");
553
+ return t(e, i);
554
+ },
555
+ onSuccess: () => {
556
+ const o = s();
557
+ a.setQueriesData(
558
+ { queryKey: ["pitvox", "promotionEntry", r, e] },
559
+ (i) => i ? { ...i, isEntered: !1 } : { isEntered: !1, entryList: null }
560
+ ), o && a.setQueriesData(
561
+ { queryKey: ["pitvox", "promotion", r, e, "entrylist"] },
562
+ (i) => {
563
+ if (!(i != null && i.entrants)) return i;
564
+ const d = i.entrants.filter((p) => p.steamId !== o);
565
+ return { ...i, entrants: d, count: d.length };
566
+ }
567
+ );
568
+ }
569
+ });
570
+ }
571
+ function kn() {
572
+ const { onEnterPromotion: e, onWithdrawPromotionEntry: t } = S(), r = !!(e && t);
573
+ return { isPowerMode: r, isBasicMode: !r };
574
+ }
575
+ function Cn(e) {
576
+ const { pitvoxUrl: t, partnerSlug: r } = S();
577
+ return `${t}/p/${r}/promotions/${e}`;
578
+ }
579
+ const Sn = {
580
+ GBR: "🇬🇧",
581
+ DEU: "🇩🇪",
582
+ NLD: "🇳🇱",
583
+ SWE: "🇸🇪",
584
+ ESP: "🇪🇸",
585
+ ZAF: "🇿🇦",
586
+ FRA: "🇫🇷",
587
+ ITA: "🇮🇹",
588
+ USA: "🇺🇸",
589
+ AUS: "🇦🇺",
590
+ BRA: "🇧🇷",
591
+ JPN: "🇯🇵",
592
+ CAN: "🇨🇦",
593
+ POL: "🇵🇱",
594
+ AUT: "🇦🇹",
595
+ BEL: "🇧🇪",
596
+ PRT: "🇵🇹",
597
+ NOR: "🇳🇴",
598
+ DNK: "🇩🇰",
599
+ FIN: "🇫🇮",
600
+ IRL: "🇮🇪",
601
+ CHE: "🇨🇭",
602
+ NZL: "🇳🇿",
603
+ MEX: "🇲🇽",
604
+ ARG: "🇦🇷",
605
+ CZE: "🇨🇿",
606
+ HUN: "🇭🇺",
607
+ RUS: "🇷🇺",
608
+ TUR: "🇹🇷",
609
+ KOR: "🇰🇷"
610
+ }, xe = ["🥇", "🥈", "🥉"], Ln = {
611
+ championship: "Championship",
612
+ series: "Series",
613
+ event: "Event",
614
+ hotlap: "Hotlap"
615
+ }, $n = ["PRACTICE", "QUALIFYING", "RACE"];
616
+ function we(e) {
617
+ const t = $n.indexOf(e);
618
+ if (t >= 0) return t;
619
+ const r = e.match(/^PRACTICE_(\d+)$/);
620
+ return r ? 100 + parseInt(r[1]) : 999;
621
+ }
622
+ function X(e) {
623
+ const t = e.match(/^PRACTICE_(\d+)$/);
624
+ return t ? `P${t[1]}` : e;
625
+ }
626
+ function ge({ position: e }) {
627
+ return /* @__PURE__ */ n("span", { className: e === 1 ? "pvx-rank pvx-rank--gold" : e === 2 ? "pvx-rank pvx-rank--silver" : e === 3 ? "pvx-rank pvx-rank--bronze" : "pvx-rank", children: e });
628
+ }
629
+ function ee({ nation: e }) {
630
+ const t = e && Sn[e];
631
+ return t ? /* @__PURE__ */ n("span", { className: "pvx-nation-flag", title: e, children: t }) : null;
632
+ }
633
+ function Tn({ sessions: e, activeSession: t, onSelect: r }) {
634
+ if (!e || e.length <= 1) return null;
635
+ const s = [...e].sort(
636
+ (a, o) => we(a.type) - we(o.type)
637
+ );
638
+ return /* @__PURE__ */ n("div", { className: "pvx-session-tabs", children: s.map((a) => /* @__PURE__ */ n(
639
+ "button",
640
+ {
641
+ onClick: () => r(a.type),
642
+ className: `pvx-session-tab ${t === a.type ? "pvx-session-tab--active" : ""}`,
643
+ children: X(a.type)
644
+ },
645
+ a.type
646
+ )) });
647
+ }
648
+ function Rn({ type: e }) {
649
+ return /* @__PURE__ */ n("span", { className: `pvx-comp-badge pvx-comp-badge--${e}`, children: Ln[e] || e });
650
+ }
651
+ function ae({ children: e, variant: t = "default" }) {
652
+ return /* @__PURE__ */ n("span", { className: `pvx-info-pill ${t !== "default" ? `pvx-info-pill--${t}` : ""}`, children: e });
653
+ }
654
+ function Mn(e) {
655
+ if (!e) return "TBD";
656
+ const t = new Date(e);
657
+ if (isNaN(t)) return "TBD";
658
+ const r = t.toLocaleDateString("en-GB", { weekday: "short", day: "numeric", month: "short" }), s = t.toLocaleTimeString("en-GB", { hour: "2-digit", minute: "2-digit" });
659
+ return `${r} • ${s}`;
660
+ }
661
+ function Pn(e) {
662
+ return e.reduce((t, r) => {
663
+ var s;
664
+ return (s = r.splits) != null && s.length ? t ? t.map((a, o) => {
665
+ const i = r.splits[o];
666
+ return i && i < a ? i : a;
667
+ }) : [...r.splits] : t;
668
+ }, null);
669
+ }
670
+ function W({ message: e = "Loading..." }) {
671
+ return /* @__PURE__ */ n("div", { className: "pvx-loading", children: e });
672
+ }
673
+ function _({ message: e = "No data available." }) {
674
+ return /* @__PURE__ */ n("div", { className: "pvx-empty", children: /* @__PURE__ */ n("p", { children: e }) });
675
+ }
676
+ const Ue = 3;
677
+ function O(e) {
678
+ if (!e) return !1;
679
+ if (e.closesAt) {
680
+ const t = new Date(e.closesAt).getTime();
681
+ if (!Number.isNaN(t)) return Date.now() >= t;
682
+ }
683
+ return !!e.isClosed;
684
+ }
685
+ function Dn(e) {
686
+ const t = e == null ? void 0 : e.rounds;
687
+ return t != null && t.length ? e.type === "hotlap" ? t.every((r) => O(r)) : t.every((r) => r.isFinalized) : !1;
688
+ }
689
+ function An(e) {
690
+ const t = e == null ? void 0 : e.rounds;
691
+ if (!(t != null && t.length)) return null;
692
+ let r = null;
693
+ for (const s of t) {
694
+ if (!s.startTime) continue;
695
+ const a = new Date(s.startTime);
696
+ isNaN(a) || (!r || a > r) && (r = a);
697
+ }
698
+ return r;
699
+ }
700
+ function _e(e, t = Ue) {
701
+ if (!Dn(e)) return "active";
702
+ const r = An(e);
703
+ if (!r) return "recently-completed";
704
+ const s = t * 24 * 60 * 60 * 1e3;
705
+ return Date.now() - r.getTime() <= s ? "recently-completed" : "archived";
706
+ }
707
+ function rr(e, t, r = Ue) {
708
+ if (!(e != null && e.length)) return [];
709
+ const s = new Set(Array.isArray(t) ? t : [t]);
710
+ return e.filter((a) => s.has(_e(a, r)));
711
+ }
712
+ function En(e, t = 3) {
713
+ const r = e == null ? void 0 : e.standings;
714
+ return Array.isArray(r) ? [...r].sort((s, a) => (s.position ?? 999) - (a.position ?? 999)).slice(0, t) : [];
715
+ }
716
+ const Bn = {
717
+ giveaway: "Giveaway"
718
+ };
719
+ function Ie({ promotion: e, status: t }) {
720
+ const r = t || J(e);
721
+ return /* @__PURE__ */ n("span", { className: `pvx-promo-status pvx-promo-status--${r}`, children: xn[r] || r });
722
+ }
723
+ function Fe({ type: e }) {
724
+ return /* @__PURE__ */ n("span", { className: `pvx-promo-type pvx-promo-type--${e || "giveaway"}`, children: Bn[e] || e });
725
+ }
726
+ function K(e) {
727
+ if (!e) return "";
728
+ const t = new Date(e);
729
+ if (isNaN(t)) return "";
730
+ const r = t.toLocaleDateString(void 0, { weekday: "short", day: "numeric", month: "short" }), s = t.toLocaleTimeString(void 0, { hour: "2-digit", minute: "2-digit" });
731
+ return `${r} ${s}`;
732
+ }
733
+ function Un(e, t) {
734
+ const r = t || J(e);
735
+ return r === "upcoming" ? `Entries open ${K(e.opensAt)}` : r === "open" && e.closesAt ? `Entries close ${K(e.closesAt)}` : r === "open" ? "Entries open now" : r === "closed" ? `Entries closed ${K(e.closesAt)}` : null;
736
+ }
737
+ function le({ className: e }) {
738
+ return /* @__PURE__ */ l(
739
+ "svg",
740
+ {
741
+ className: e,
742
+ xmlns: "http://www.w3.org/2000/svg",
743
+ viewBox: "0 0 24 24",
744
+ fill: "none",
745
+ stroke: "currentColor",
746
+ strokeWidth: "2",
747
+ strokeLinecap: "round",
748
+ strokeLinejoin: "round",
749
+ children: [
750
+ /* @__PURE__ */ n("rect", { x: "3", y: "8", width: "18", height: "4", rx: "1" }),
751
+ /* @__PURE__ */ n("path", { d: "M12 8v13" }),
752
+ /* @__PURE__ */ n("path", { d: "M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7" }),
753
+ /* @__PURE__ */ n("path", { d: "M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5" })
754
+ ]
755
+ }
756
+ );
757
+ }
758
+ function _n({ promotions: e, isLoading: t, onSelect: r, className: s }) {
759
+ if (t)
760
+ return /* @__PURE__ */ n(W, { message: "Loading promotions..." });
761
+ if (!(e != null && e.length))
762
+ return /* @__PURE__ */ n(_, { message: "No promotions running right now." });
763
+ const a = e.length === 1 ? "pvx-promo-grid--single" : e.length === 2 ? "pvx-promo-grid--pair" : "";
764
+ return /* @__PURE__ */ n("div", { className: `pvx-promo-grid ${a} ${s || ""}`, children: e.map((o) => /* @__PURE__ */ n(In, { promo: o, onSelect: r }, o.id)) });
765
+ }
766
+ function In({ promo: e, onSelect: t }) {
767
+ const { cdnUrl: r } = S(), s = e.posterCdnPath ? `${r}/${e.posterCdnPath}` : null, a = J(e), o = Un(e, a);
768
+ return /* @__PURE__ */ l(
769
+ "div",
770
+ {
771
+ className: "pvx-promo-card",
772
+ role: "button",
773
+ tabIndex: 0,
774
+ onClick: () => t == null ? void 0 : t(e.id),
775
+ onKeyDown: (i) => {
776
+ (i.key === "Enter" || i.key === " ") && (i.preventDefault(), t == null || t(e.id));
777
+ },
778
+ children: [
779
+ /* @__PURE__ */ n("div", { className: "pvx-promo-card-poster", children: s ? /* @__PURE__ */ n("img", { src: s, alt: e.title, className: "pvx-promo-card-poster-img" }) : /* @__PURE__ */ n("div", { className: "pvx-promo-card-poster-placeholder", children: /* @__PURE__ */ n(le, { className: "pvx-promo-gift-icon" }) }) }),
780
+ /* @__PURE__ */ l("div", { className: "pvx-promo-card-body", children: [
781
+ /* @__PURE__ */ l("div", { className: "pvx-promo-card-badges", children: [
782
+ /* @__PURE__ */ n(Ie, { promotion: e, status: a }),
783
+ /* @__PURE__ */ n(Fe, { type: e.type }),
784
+ e.game && /* @__PURE__ */ n("span", { className: "pvx-promo-game", children: e.game })
785
+ ] }),
786
+ /* @__PURE__ */ n("h3", { className: "pvx-promo-card-title", children: e.title }),
787
+ e.prizeDescription && /* @__PURE__ */ n("p", { className: "pvx-promo-card-prize", children: e.prizeDescription }),
788
+ /* @__PURE__ */ l("div", { className: "pvx-promo-card-meta", children: [
789
+ o && /* @__PURE__ */ n("span", { children: o }),
790
+ /* @__PURE__ */ l("span", { children: [
791
+ e.entryCount,
792
+ " ",
793
+ e.entryCount === 1 ? "entry" : "entries",
794
+ e.maxEntrants ? ` / ${e.maxEntrants}` : ""
795
+ ] })
796
+ ] })
797
+ ] })
798
+ ]
799
+ }
800
+ );
801
+ }
802
+ function Fn({
803
+ promotionId: e,
804
+ driverData: t,
805
+ className: r,
806
+ children: s
807
+ }) {
808
+ const { data: a, isLoading: o } = yn(e), { isPowerMode: i } = kn(), d = Cn(e), p = bn(e), c = wn(e), u = (a == null ? void 0 : a.isEntered) || !1, v = o || p.isPending || c.isPending, f = p.error || c.error || null, h = () => {
809
+ i && p.mutate(t || {});
810
+ }, y = () => {
811
+ i && c.mutate();
812
+ };
813
+ return typeof s == "function" ? s({ isEntered: u, isLoading: v, enter: h, withdraw: y, error: f, isPowerMode: i, promotionUrl: d }) : i ? /* @__PURE__ */ n(
814
+ "button",
815
+ {
816
+ className: `pvx-promo-enter-btn ${r || ""}`,
817
+ onClick: u ? y : h,
818
+ disabled: v,
819
+ children: v ? "Loading..." : u ? "Withdraw Entry" : "Enter Giveaway"
820
+ }
821
+ ) : /* @__PURE__ */ n(
822
+ "a",
823
+ {
824
+ href: d,
825
+ target: "_blank",
826
+ rel: "noopener noreferrer",
827
+ className: `pvx-promo-enter-link ${r || ""}`,
828
+ children: u ? "View Entry" : "Enter on PitVox"
829
+ }
830
+ );
831
+ }
832
+ function qn({ promotionId: e, driverData: t, onBack: r, className: s }) {
833
+ const { cdnUrl: a, getSteamId: o } = S(), { data: i, isLoading: d } = fn(e), { data: p } = Nn(e);
834
+ if (d)
835
+ return /* @__PURE__ */ n(W, { message: "Loading promotion..." });
836
+ if (!i)
837
+ return /* @__PURE__ */ n(_, { message: "Promotion not found." });
838
+ const c = J(i), u = i.winners || [], v = (p == null ? void 0 : p.entrants) || [], f = v.length || i.entryCount || 0, h = i.maxEntrants && f >= i.maxEntrants, y = i.posterCdnPath ? `${a}/${i.posterCdnPath}` : null, x = o();
839
+ return /* @__PURE__ */ l("div", { className: `pvx-promo-detail ${s || ""}`, children: [
840
+ r && /* @__PURE__ */ n("button", { type: "button", className: "pvx-promo-back", onClick: r, children: "← All promotions" }),
841
+ y && /* @__PURE__ */ n("div", { className: "pvx-promo-detail-poster", children: /* @__PURE__ */ n("img", { src: y, alt: i.title }) }),
842
+ /* @__PURE__ */ l("div", { className: "pvx-promo-detail-header", children: [
843
+ /* @__PURE__ */ l("div", { className: "pvx-promo-card-badges", children: [
844
+ /* @__PURE__ */ n(Ie, { promotion: i, status: c }),
845
+ /* @__PURE__ */ n(Fe, { type: i.type }),
846
+ i.game && /* @__PURE__ */ n("span", { className: "pvx-promo-game", children: i.game })
847
+ ] }),
848
+ /* @__PURE__ */ n("h2", { className: "pvx-promo-detail-title", children: i.title }),
849
+ i.prizeDescription && /* @__PURE__ */ n("p", { className: "pvx-promo-detail-prize", children: i.prizeDescription }),
850
+ /* @__PURE__ */ l("div", { className: "pvx-promo-detail-meta", children: [
851
+ i.opensAt && c === "upcoming" && /* @__PURE__ */ l("span", { children: [
852
+ "Opens ",
853
+ K(i.opensAt)
854
+ ] }),
855
+ i.closesAt && /* @__PURE__ */ l("span", { children: [
856
+ c === "open" || c === "upcoming" ? "Closes" : "Closed",
857
+ " ",
858
+ K(i.closesAt)
859
+ ] }),
860
+ /* @__PURE__ */ l("span", { children: [
861
+ f,
862
+ " ",
863
+ f === 1 ? "entry" : "entries",
864
+ i.maxEntrants ? ` / ${i.maxEntrants}` : ""
865
+ ] })
866
+ ] })
867
+ ] }),
868
+ u.length > 0 && /* @__PURE__ */ l("div", { className: "pvx-promo-winners", children: [
869
+ /* @__PURE__ */ n("h3", { className: "pvx-promo-section-title", children: u.length === 1 ? "Winner" : "Winners" }),
870
+ /* @__PURE__ */ n("div", { className: "pvx-promo-winners-list", children: u.map((m) => /* @__PURE__ */ l("div", { className: "pvx-promo-winner", children: [
871
+ m.avatarUrl ? /* @__PURE__ */ n("img", { src: m.avatarUrl, alt: "", className: "pvx-promo-avatar pvx-promo-avatar--lg" }) : /* @__PURE__ */ n("div", { className: "pvx-promo-avatar pvx-promo-avatar--lg pvx-promo-avatar--placeholder", children: /* @__PURE__ */ n(le, { className: "pvx-promo-avatar-glyph" }) }),
872
+ /* @__PURE__ */ n("span", { className: "pvx-promo-winner-name", children: m.displayName })
873
+ ] }, m.steamId)) })
874
+ ] }),
875
+ /* @__PURE__ */ l("div", { className: "pvx-promo-action", children: [
876
+ c === "upcoming" && /* @__PURE__ */ l("p", { className: "pvx-promo-action-note", children: [
877
+ "Entries aren't open yet — come back ",
878
+ i.opensAt ? K(i.opensAt) : "soon",
879
+ "."
880
+ ] }),
881
+ (c === "closed" || c === "winners") && /* @__PURE__ */ l("p", { className: "pvx-promo-action-note", children: [
882
+ "Entries have closed.",
883
+ c === "closed" && " Winners will be announced here once the draw is done."
884
+ ] }),
885
+ c === "open" && !x && /* @__PURE__ */ n("p", { className: "pvx-promo-action-note", children: "Sign in with Steam to enter this giveaway." }),
886
+ c === "open" && x && /* @__PURE__ */ n(Fn, { promotionId: e, driverData: t, children: ({ isEntered: m, isLoading: b, enter: g, withdraw: k, error: C, isPowerMode: P, promotionUrl: A }) => /* @__PURE__ */ l("div", { className: "pvx-promo-action-row", children: [
887
+ /* @__PURE__ */ l("div", { className: "pvx-promo-action-text", children: [
888
+ C && /* @__PURE__ */ n("p", { className: "pvx-promo-error", children: C.message }),
889
+ /* @__PURE__ */ n("p", { className: "pvx-promo-action-note", children: m ? "✓ You're in the draw." : h ? "This giveaway is full." : "One click and you're in the draw." }),
890
+ !m && !h && /* @__PURE__ */ n("p", { className: "pvx-promo-disclosure", children: "Entering displays your Steam name and avatar publicly; winners are announced by name." })
891
+ ] }),
892
+ P ? /* @__PURE__ */ n(
893
+ "button",
894
+ {
895
+ type: "button",
896
+ className: m ? "pvx-promo-withdraw-btn" : "pvx-promo-enter-btn",
897
+ onClick: m ? k : g,
898
+ disabled: b || !m && h,
899
+ children: b ? "Loading..." : m ? "Withdraw Entry" : "Enter Giveaway"
900
+ }
901
+ ) : /* @__PURE__ */ n(
902
+ "a",
903
+ {
904
+ href: A,
905
+ target: "_blank",
906
+ rel: "noopener noreferrer",
907
+ className: "pvx-promo-enter-link",
908
+ children: m ? "View Entry" : "Enter on PitVox"
909
+ }
910
+ )
911
+ ] }) })
912
+ ] }),
913
+ i.description && /* @__PURE__ */ n("div", { className: "pvx-promo-description", children: /* @__PURE__ */ n(en, { children: i.description }) }),
914
+ v.length > 0 && /* @__PURE__ */ l("div", { className: "pvx-promo-entrants", children: [
915
+ /* @__PURE__ */ l("h3", { className: "pvx-promo-section-title", children: [
916
+ "Entrants ",
917
+ /* @__PURE__ */ l("span", { className: "pvx-promo-section-count", children: [
918
+ "(",
919
+ v.length,
920
+ ")"
921
+ ] })
922
+ ] }),
923
+ /* @__PURE__ */ n("div", { className: "pvx-promo-entrants-grid", children: v.map((m) => /* @__PURE__ */ l("div", { className: "pvx-promo-entrant", children: [
924
+ m.avatarUrl ? /* @__PURE__ */ n("img", { src: m.avatarUrl, alt: "", className: "pvx-promo-avatar" }) : /* @__PURE__ */ n("div", { className: "pvx-promo-avatar pvx-promo-avatar--placeholder", children: /* @__PURE__ */ n(le, { className: "pvx-promo-avatar-glyph" }) }),
925
+ /* @__PURE__ */ n("span", { className: "pvx-promo-entrant-name", title: m.displayName, children: m.displayName })
926
+ ] }, m.steamId)) })
927
+ ] })
928
+ ] });
929
+ }
930
+ const ce = "promotion";
931
+ function ke() {
932
+ return typeof window > "u" ? null : new URLSearchParams(window.location.search).get(ce);
933
+ }
934
+ function sr({ title: e = "Promotions", driverData: t, className: r }) {
935
+ const { data: s = [], isLoading: a } = gn(), [o, i] = E(ke);
936
+ $e(() => {
937
+ const p = () => i(ke());
938
+ return window.addEventListener("popstate", p), () => window.removeEventListener("popstate", p);
939
+ }, []);
940
+ const d = H((p) => {
941
+ if (i(p), typeof window < "u") {
942
+ const c = new URL(window.location.href);
943
+ p ? c.searchParams.set(ce, p) : c.searchParams.delete(ce), window.history.pushState({}, "", c);
944
+ }
945
+ }, []);
946
+ return /* @__PURE__ */ l("div", { className: `pvx-promo-explorer ${r || ""}`, children: [
947
+ e && /* @__PURE__ */ n("h1", { className: "pvx-promo-explorer-title", children: e }),
948
+ o ? /* @__PURE__ */ n(
949
+ qn,
950
+ {
951
+ promotionId: o,
952
+ driverData: t,
953
+ onBack: () => d(null)
954
+ }
955
+ ) : /* @__PURE__ */ n(
956
+ _n,
957
+ {
958
+ promotions: s,
959
+ isLoading: a,
960
+ onSelect: d
961
+ }
962
+ )
963
+ ] });
964
+ }
965
+ function Wn(e, t) {
966
+ for (const r of t)
967
+ if (r.tags.includes(e)) return r.id;
454
968
  return "other";
455
969
  }
456
- function Me(e, t, s = []) {
970
+ function qe(e, t, r = []) {
457
971
  if (t.size === 0) return !0;
458
- const r = {};
972
+ const s = {};
459
973
  for (const a of t) {
460
- const i = ln(a, s);
461
- r[i] || (r[i] = []), r[i].push(a);
974
+ const o = Wn(a, r);
975
+ s[o] || (s[o] = []), s[o].push(a);
462
976
  }
463
- for (const a of Object.values(r))
464
- if (!a.some((i) => e.includes(i))) return !1;
977
+ for (const a of Object.values(s))
978
+ if (!a.some((o) => e.includes(o))) return !1;
465
979
  return !0;
466
980
  }
467
- function De(e, t) {
468
- const [s, r] = B(/* @__PURE__ */ new Set()), a = e !== void 0, i = a ? e : s, o = K((p) => {
469
- const c = new Set(i);
470
- c.has(p) ? c.delete(p) : c.add(p), a && t ? t(c) : r(c);
471
- }, [i, a, t]), d = K(() => {
472
- a && t ? t(/* @__PURE__ */ new Set()) : r(/* @__PURE__ */ new Set());
981
+ function We(e, t) {
982
+ const [r, s] = E(/* @__PURE__ */ new Set()), a = e !== void 0, o = a ? e : r, i = H((p) => {
983
+ const c = new Set(o);
984
+ c.has(p) ? c.delete(p) : c.add(p), a && t ? t(c) : s(c);
985
+ }, [o, a, t]), d = H(() => {
986
+ a && t ? t(/* @__PURE__ */ new Set()) : s(/* @__PURE__ */ new Set());
473
987
  }, [a, t]);
474
- return { activeTags: i, toggle: o, clear: d };
988
+ return { activeTags: o, toggle: i, clear: d };
475
989
  }
476
- function G(e) {
477
- const [t, s] = B(e), r = K((a) => {
478
- s(
479
- (i) => i.key === a ? { key: a, dir: i.dir === "asc" ? "desc" : "asc" } : { key: a, dir: a.includes("timestamp") || a.includes("Date") ? "desc" : "asc" }
990
+ function ne(e) {
991
+ const [t, r] = E(e), s = H((a) => {
992
+ r(
993
+ (o) => o.key === a ? { key: a, dir: o.dir === "asc" ? "desc" : "asc" } : { key: a, dir: a.includes("timestamp") || a.includes("Date") ? "desc" : "asc" }
480
994
  );
481
995
  }, []);
482
- return [t, r];
483
- }
484
- function Y(e, t, s) {
485
- return [...e].sort((r, a) => {
486
- const i = s(r, t.key), o = s(a, t.key);
487
- if (i == null && o == null) return 0;
488
- if (i == null) return 1;
489
- if (o == null) return -1;
490
- const d = typeof i == "string" ? i.localeCompare(o) : i - o;
996
+ return [t, s];
997
+ }
998
+ function te(e, t, r) {
999
+ return [...e].sort((s, a) => {
1000
+ const o = r(s, t.key), i = r(a, t.key);
1001
+ if (o == null && i == null) return 0;
1002
+ if (o == null) return 1;
1003
+ if (i == null) return -1;
1004
+ const d = typeof o == "string" ? o.localeCompare(i) : o - i;
491
1005
  return t.dir === "desc" ? -d : d;
492
1006
  });
493
1007
  }
494
- function Pe(e, t = !1) {
495
- const s = t ? e == null ? void 0 : e.filter((r) => r.isValid) : e;
496
- return s != null && s.length ? {
497
- s1: Math.min(...s.map((r) => r.sector1Ms).filter(Boolean)),
498
- s2: Math.min(...s.map((r) => r.sector2Ms).filter(Boolean)),
499
- s3: Math.min(...s.map((r) => r.sector3Ms).filter(Boolean))
1008
+ function je(e, t = !1) {
1009
+ const r = t ? e == null ? void 0 : e.filter((s) => s.isValid) : e;
1010
+ return r != null && r.length ? {
1011
+ s1: Math.min(...r.map((s) => s.sector1Ms).filter(Boolean)),
1012
+ s2: Math.min(...r.map((s) => s.sector2Ms).filter(Boolean)),
1013
+ s3: Math.min(...r.map((s) => s.sector3Ms).filter(Boolean))
500
1014
  } : null;
501
1015
  }
502
- function cn({ active: e, dir: t }) {
1016
+ function jn({ active: e, dir: t }) {
503
1017
  return e ? t === "asc" ? /* @__PURE__ */ n("svg", { className: "pvx-sort-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 15.75l7.5-7.5 7.5 7.5" }) }) : /* @__PURE__ */ n("svg", { className: "pvx-sort-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 8.25l-7.5 7.5-7.5-7.5" }) }) : /* @__PURE__ */ n("svg", { className: "pvx-sort-icon pvx-sort-icon--inactive", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 9l4-4 4 4M16 15l-4 4-4-4" }) });
504
1018
  }
505
- function A({ label: e, sortKey: t, config: s, onSort: r, className: a = "" }) {
1019
+ function U({ label: e, sortKey: t, config: r, onSort: s, className: a = "" }) {
506
1020
  return /* @__PURE__ */ n(
507
1021
  "th",
508
1022
  {
509
1023
  className: `pvx-th pvx-th--sortable ${a}`,
510
- onClick: () => r(t),
1024
+ onClick: () => s(t),
511
1025
  children: /* @__PURE__ */ l("span", { className: "pvx-th-inner", children: [
512
1026
  e,
513
- /* @__PURE__ */ n(cn, { active: s.key === t, dir: s.dir })
1027
+ /* @__PURE__ */ n(jn, { active: r.key === t, dir: r.dir })
514
1028
  ] })
515
1029
  }
516
1030
  );
517
1031
  }
518
- function J({ userId: e, getUserDisplay: t }) {
519
- const { displayName: s, avatarUrl: r } = t(e);
1032
+ function re({ userId: e, getUserDisplay: t }) {
1033
+ const { displayName: r, avatarUrl: s } = t(e);
520
1034
  return /* @__PURE__ */ l("span", { className: "pvx-driver", children: [
521
- r ? /* @__PURE__ */ n("img", { src: r, alt: "", className: "pvx-driver-avatar" }) : /* @__PURE__ */ n("span", { className: "pvx-driver-avatar pvx-driver-avatar--placeholder" }),
522
- /* @__PURE__ */ n("span", { className: "pvx-driver-name", children: s })
1035
+ s ? /* @__PURE__ */ n("img", { src: s, alt: "", className: "pvx-driver-avatar" }) : /* @__PURE__ */ n("span", { className: "pvx-driver-avatar pvx-driver-avatar--placeholder" }),
1036
+ /* @__PURE__ */ n("span", { className: "pvx-driver-name", children: r })
523
1037
  ] });
524
1038
  }
525
- function pe({ rank: e, podium: t = !1 }) {
1039
+ function fe({ rank: e, podium: t = !1 }) {
526
1040
  return /* @__PURE__ */ n("span", { className: t ? e === 1 ? "pvx-rank pvx-rank--gold" : e === 2 ? "pvx-rank pvx-rank--silver" : e === 3 ? "pvx-rank pvx-rank--bronze" : "pvx-rank" : "pvx-rank", children: e });
527
1041
  }
528
- function Ae({ availableTags: e, activeTags: t, onToggle: s, onClear: r, categories: a = [], tagLabels: i = {} }) {
1042
+ function Ve({ availableTags: e, activeTags: t, onToggle: r, onClear: s, categories: a = [], tagLabels: o = {} }) {
529
1043
  if (!e || e.length < 2) return null;
530
- const o = a.map((d) => ({ id: d.id, tags: d.tags.filter((p) => e.includes(p)) })).filter((d) => d.tags.length > 0);
1044
+ const i = a.map((d) => ({ id: d.id, tags: d.tags.filter((p) => e.includes(p)) })).filter((d) => d.tags.length > 0);
531
1045
  return /* @__PURE__ */ l("div", { className: "pvx-tag-bar", children: [
532
1046
  /* @__PURE__ */ n(
533
1047
  "button",
534
1048
  {
535
- onClick: r,
1049
+ onClick: s,
536
1050
  className: `pvx-tag ${t.size === 0 ? "pvx-tag--active" : ""}`,
537
1051
  children: "All"
538
1052
  }
539
1053
  ),
540
- o.map((d, p) => /* @__PURE__ */ l("span", { className: "contents", children: [
1054
+ i.map((d, p) => /* @__PURE__ */ l("span", { className: "contents", children: [
541
1055
  p > 0 && /* @__PURE__ */ n("span", { className: "pvx-tag-separator" }),
542
1056
  d.tags.map((c) => /* @__PURE__ */ n(
543
1057
  "button",
544
1058
  {
545
- onClick: () => s(c),
1059
+ onClick: () => r(c),
546
1060
  className: `pvx-tag ${t.has(c) ? "pvx-tag--active" : ""}`,
547
- children: i[c] || c
1061
+ children: o[c] || c
548
1062
  },
549
1063
  c
550
1064
  ))
551
1065
  ] }, d.id))
552
1066
  ] });
553
1067
  }
554
- function ue({ segments: e }) {
555
- return /* @__PURE__ */ n("nav", { className: "pvx-breadcrumb", "aria-label": "Breadcrumb", children: /* @__PURE__ */ n("ol", { className: "pvx-breadcrumb-list", children: e.map((t, s) => {
556
- const r = s === e.length - 1;
1068
+ function Ne({ segments: e }) {
1069
+ return /* @__PURE__ */ n("nav", { className: "pvx-breadcrumb", "aria-label": "Breadcrumb", children: /* @__PURE__ */ n("ol", { className: "pvx-breadcrumb-list", children: e.map((t, r) => {
1070
+ const s = r === e.length - 1;
557
1071
  return /* @__PURE__ */ l("li", { className: "pvx-breadcrumb-item", children: [
558
- s > 0 && /* @__PURE__ */ n("svg", { className: "pvx-breadcrumb-chevron", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.25 4.5l7.5 7.5-7.5 7.5" }) }),
559
- !r && t.onClick ? /* @__PURE__ */ n("button", { onClick: t.onClick, className: "pvx-breadcrumb-link", children: t.label }) : /* @__PURE__ */ n("span", { className: "pvx-breadcrumb-current", children: t.label })
1072
+ r > 0 && /* @__PURE__ */ n("svg", { className: "pvx-breadcrumb-chevron", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.25 4.5l7.5 7.5-7.5 7.5" }) }),
1073
+ !s && t.onClick ? /* @__PURE__ */ n("button", { onClick: t.onClick, className: "pvx-breadcrumb-link", children: t.label }) : /* @__PURE__ */ n("span", { className: "pvx-breadcrumb-current", children: t.label })
560
1074
  ] }, t.key);
561
1075
  }) }) });
562
1076
  }
563
- function O({ message: e }) {
1077
+ function Y({ message: e }) {
564
1078
  return /* @__PURE__ */ l("div", { className: "pvx-empty", children: [
565
1079
  /* @__PURE__ */ n("svg", { className: "pvx-empty-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M16.5 18.75h-9m9 0a3 3 0 013 3h-15a3 3 0 013-3m9 0v-4.5A3.375 3.375 0 0013.125 10.875h-2.25A3.375 3.375 0 007.5 14.25v4.5" }) }),
566
1080
  /* @__PURE__ */ n("p", { children: e })
567
1081
  ] });
568
1082
  }
569
- function z() {
1083
+ function Z() {
570
1084
  return /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading..." });
571
1085
  }
572
- function dn() {
1086
+ function Vn() {
573
1087
  return /* @__PURE__ */ n("svg", { className: "pvx-icon pvx-icon--valid", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 12.75l6 6 9-13.5" }) });
574
1088
  }
575
- function pn() {
1089
+ function Kn() {
576
1090
  return /* @__PURE__ */ n("svg", { className: "pvx-icon pvx-icon--invalid", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) });
577
1091
  }
578
- function yt({ tracks: e, isLoading: t, carMetadata: s, getUserDisplay: r, onTrackSelect: a, tags: i, onTagChange: o }) {
579
- const [d, p] = G({ key: "record.timestamp", dir: "desc" }), { activeTags: c, toggle: u, clear: v } = De(i, o), f = $(() => {
580
- var g;
581
- if (!((g = s == null ? void 0 : s.tags) != null && g.length)) return [];
1092
+ function ar({ tracks: e, isLoading: t, carMetadata: r, getUserDisplay: s, onTrackSelect: a, tags: o, onTagChange: i }) {
1093
+ const [d, p] = ne({ key: "record.timestamp", dir: "desc" }), { activeTags: c, toggle: u, clear: v } = We(o, i), f = T(() => {
1094
+ var m;
1095
+ if (!((m = r == null ? void 0 : r.tags) != null && m.length)) return [];
582
1096
  const x = /* @__PURE__ */ new Set();
583
- for (const y of e || [])
584
- y.recordByTag && Object.keys(y.recordByTag).forEach((m) => x.add(m));
585
- return s.tags.filter((y) => x.has(y));
586
- }, [e, s]), h = $(() => e ? c.size === 0 ? e : e.map((x) => {
587
- var m, w;
1097
+ for (const b of e || [])
1098
+ b.recordByTag && Object.keys(b.recordByTag).forEach((g) => x.add(g));
1099
+ return r.tags.filter((b) => x.has(b));
1100
+ }, [e, r]), h = T(() => e ? c.size === 0 ? e : e.map((x) => {
1101
+ var g, k;
588
1102
  if (!x.recordByTag) return null;
589
- let g = null;
590
- const y = /* @__PURE__ */ new Set();
591
- for (const S of Object.values(x.recordByTag)) {
592
- if (y.has(S.carId)) continue;
593
- y.add(S.carId);
594
- const R = ((w = (m = s == null ? void 0 : s.cars) == null ? void 0 : m[S.carId]) == null ? void 0 : w.tags) || [];
595
- Me(R, c, s == null ? void 0 : s.categories) && (!g || S.lapTimeMs < g.lapTimeMs) && (g = S);
1103
+ let m = null;
1104
+ const b = /* @__PURE__ */ new Set();
1105
+ for (const C of Object.values(x.recordByTag)) {
1106
+ if (b.has(C.carId)) continue;
1107
+ b.add(C.carId);
1108
+ const P = ((k = (g = r == null ? void 0 : r.cars) == null ? void 0 : g[C.carId]) == null ? void 0 : k.tags) || [];
1109
+ qe(P, c, r == null ? void 0 : r.categories) && (!m || C.lapTimeMs < m.lapTimeMs) && (m = C);
596
1110
  }
597
- return g ? {
1111
+ return m ? {
598
1112
  ...x,
599
1113
  record: {
600
- visibleId: g.steamId || g.identifier,
601
- carId: g.carId,
602
- carDisplayName: I(g.carId),
603
- lapTimeMs: g.lapTimeMs,
604
- timestamp: g.recordedAt
1114
+ visibleId: m.steamId || m.identifier,
1115
+ carId: m.carId,
1116
+ carDisplayName: I(m.carId),
1117
+ lapTimeMs: m.lapTimeMs,
1118
+ timestamp: m.recordedAt
605
1119
  }
606
1120
  } : null;
607
- }).filter(Boolean) : [], [e, c, s]), k = $(() => Y(h, d, (x, g) => {
608
- var y, m;
609
- switch (g) {
1121
+ }).filter(Boolean) : [], [e, c, r]), y = T(() => te(h, d, (x, m) => {
1122
+ var b, g;
1123
+ switch (m) {
610
1124
  case "displayName":
611
1125
  return x.displayName;
612
1126
  case "record.lapTimeMs":
613
- return (y = x.record) == null ? void 0 : y.lapTimeMs;
1127
+ return (b = x.record) == null ? void 0 : b.lapTimeMs;
614
1128
  case "driverCount":
615
1129
  return x.driverCount || 0;
616
1130
  case "carCount":
617
1131
  return x.carCount || 0;
618
1132
  case "record.timestamp":
619
1133
  default:
620
- return (m = x.record) != null && m.timestamp ? new Date(x.record.timestamp).getTime() : 0;
1134
+ return (g = x.record) != null && g.timestamp ? new Date(x.record.timestamp).getTime() : 0;
621
1135
  }
622
1136
  }), [h, d]);
623
- return t ? /* @__PURE__ */ n(z, {}) : e != null && e.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
1137
+ return t ? /* @__PURE__ */ n(Z, {}) : e != null && e.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
624
1138
  /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n("h2", { className: "pvx-card-title", children: "Track Records" }) }),
625
1139
  /* @__PURE__ */ n(
626
- Ae,
1140
+ Ve,
627
1141
  {
628
1142
  availableTags: f,
629
1143
  activeTags: c,
630
1144
  onToggle: u,
631
1145
  onClear: v,
632
- categories: s == null ? void 0 : s.categories,
633
- tagLabels: s == null ? void 0 : s.tagLabels
1146
+ categories: r == null ? void 0 : r.categories,
1147
+ tagLabels: r == null ? void 0 : r.tagLabels
634
1148
  }
635
1149
  ),
636
1150
  /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
637
1151
  /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
638
- /* @__PURE__ */ n(A, { label: "Track", sortKey: "displayName", config: d, onSort: p }),
1152
+ /* @__PURE__ */ n(U, { label: "Track", sortKey: "displayName", config: d, onSort: p }),
639
1153
  /* @__PURE__ */ n("th", { className: "pvx-th", children: "Record Holder" }),
640
1154
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Car" }),
641
- /* @__PURE__ */ n(A, { label: "Lap Time", sortKey: "record.lapTimeMs", config: d, onSort: p }),
642
- /* @__PURE__ */ n(A, { label: "Drivers", sortKey: "driverCount", config: d, onSort: p, className: "pvx-hidden-below-md" }),
643
- /* @__PURE__ */ n(A, { label: "Cars", sortKey: "carCount", config: d, onSort: p, className: "pvx-hidden-below-lg" }),
644
- /* @__PURE__ */ n(A, { label: "Date", sortKey: "record.timestamp", config: d, onSort: p, className: "pvx-hidden-below-xl" })
1155
+ /* @__PURE__ */ n(U, { label: "Lap Time", sortKey: "record.lapTimeMs", config: d, onSort: p }),
1156
+ /* @__PURE__ */ n(U, { label: "Drivers", sortKey: "driverCount", config: d, onSort: p, className: "pvx-hidden-below-md" }),
1157
+ /* @__PURE__ */ n(U, { label: "Cars", sortKey: "carCount", config: d, onSort: p, className: "pvx-hidden-below-lg" }),
1158
+ /* @__PURE__ */ n(U, { label: "Date", sortKey: "record.timestamp", config: d, onSort: p, className: "pvx-hidden-below-xl" })
645
1159
  ] }) }),
646
- /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: k.map((x) => {
647
- var g, y, m;
1160
+ /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: y.map((x) => {
1161
+ var m, b, g;
648
1162
  return /* @__PURE__ */ l(
649
1163
  "tr",
650
1164
  {
@@ -652,90 +1166,90 @@ function yt({ tracks: e, isLoading: t, carMetadata: s, getUserDisplay: r, onTrac
652
1166
  onClick: () => a(x.id, x.layout),
653
1167
  children: [
654
1168
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: x.displayName }),
655
- /* @__PURE__ */ n("td", { className: "pvx-td", children: (g = x.record) != null && g.visibleId ? /* @__PURE__ */ n(J, { userId: x.record.visibleId, getUserDisplay: r }) : "-" }),
656
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-lg", children: ((y = x.record) == null ? void 0 : y.carDisplayName) || "-" }),
1169
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: (m = x.record) != null && m.visibleId ? /* @__PURE__ */ n(re, { userId: x.record.visibleId, getUserDisplay: s }) : "-" }),
1170
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-lg", children: ((b = x.record) == null ? void 0 : b.carDisplayName) || "-" }),
657
1171
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: x.record ? q(x.record.lapTimeMs) : "-" }),
658
1172
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: x.driverCount || "-" }),
659
1173
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: x.carCount || "-" }),
660
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: (m = x.record) != null && m.timestamp ? W(x.record.timestamp) : "-" })
1174
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: (g = x.record) != null && g.timestamp ? Q(x.record.timestamp) : "-" })
661
1175
  ]
662
1176
  },
663
1177
  `${x.id}|${x.layout || ""}`
664
1178
  );
665
1179
  }) })
666
1180
  ] }) })
667
- ] }) : /* @__PURE__ */ n(O, { message: "No lap times recorded yet." });
668
- }
669
- function kt({ entries: e, isLoading: t, track: s, carMetadata: r, getUserDisplay: a, onCarSelect: i, onNavigate: o, tags: d, onTagChange: p }) {
670
- const [c, u] = G({ key: "lapTimeMs", dir: "asc" }), { activeTags: v, toggle: f, clear: h } = De(d, p), k = $(() => {
671
- var w, S, R;
672
- if (!e || !((w = r == null ? void 0 : r.tags) != null && w.length)) return [];
673
- const m = /* @__PURE__ */ new Set();
674
- for (const T of e)
675
- (((R = (S = r.cars) == null ? void 0 : S[T.carId]) == null ? void 0 : R.tags) || []).forEach((b) => m.add(b));
676
- return r.tags.filter((T) => m.has(T));
677
- }, [e, r]), x = $(() => e ? v.size === 0 ? e : e.filter((m) => {
678
- var S, R;
679
- const w = ((R = (S = r == null ? void 0 : r.cars) == null ? void 0 : S[m.carId]) == null ? void 0 : R.tags) || [];
680
- return Me(w, v, r == null ? void 0 : r.categories);
681
- }) : [], [e, v, r]), g = $(() => Y(x, c, (m, w) => {
682
- switch (w) {
1181
+ ] }) : /* @__PURE__ */ n(Y, { message: "No lap times recorded yet." });
1182
+ }
1183
+ function ir({ entries: e, isLoading: t, track: r, carMetadata: s, getUserDisplay: a, onCarSelect: o, onNavigate: i, tags: d, onTagChange: p }) {
1184
+ const [c, u] = ne({ key: "lapTimeMs", dir: "asc" }), { activeTags: v, toggle: f, clear: h } = We(d, p), y = T(() => {
1185
+ var k, C, P;
1186
+ if (!e || !((k = s == null ? void 0 : s.tags) != null && k.length)) return [];
1187
+ const g = /* @__PURE__ */ new Set();
1188
+ for (const A of e)
1189
+ (((P = (C = s.cars) == null ? void 0 : C[A.carId]) == null ? void 0 : P.tags) || []).forEach((L) => g.add(L));
1190
+ return s.tags.filter((A) => g.has(A));
1191
+ }, [e, s]), x = T(() => e ? v.size === 0 ? e : e.filter((g) => {
1192
+ var C, P;
1193
+ const k = ((P = (C = s == null ? void 0 : s.cars) == null ? void 0 : C[g.carId]) == null ? void 0 : P.tags) || [];
1194
+ return qe(k, v, s == null ? void 0 : s.categories);
1195
+ }) : [], [e, v, s]), m = T(() => te(x, c, (g, k) => {
1196
+ switch (k) {
683
1197
  case "carId":
684
- return I(m.carId);
1198
+ return I(g.carId);
685
1199
  case "driverCount":
686
- return m.driverCount || 0;
1200
+ return g.driverCount || 0;
687
1201
  case "lapTimeMs":
688
1202
  default:
689
- return m.lapTimeMs;
1203
+ return g.lapTimeMs;
690
1204
  }
691
- }), [x, c]), y = [
692
- { key: "tracks", label: "Tracks", onClick: () => o("tracks") },
693
- { key: "track", label: s.displayName }
1205
+ }), [x, c]), b = [
1206
+ { key: "tracks", label: "Tracks", onClick: () => i("tracks") },
1207
+ { key: "track", label: r.displayName }
694
1208
  ];
695
- return t ? /* @__PURE__ */ n(z, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
696
- /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(ue, { segments: y }) }),
1209
+ return t ? /* @__PURE__ */ n(Z, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
1210
+ /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(Ne, { segments: b }) }),
697
1211
  /* @__PURE__ */ n(
698
- Ae,
1212
+ Ve,
699
1213
  {
700
- availableTags: k,
1214
+ availableTags: y,
701
1215
  activeTags: v,
702
1216
  onToggle: f,
703
1217
  onClear: h,
704
- categories: r == null ? void 0 : r.categories,
705
- tagLabels: r == null ? void 0 : r.tagLabels
1218
+ categories: s == null ? void 0 : s.categories,
1219
+ tagLabels: s == null ? void 0 : s.tagLabels
706
1220
  }
707
1221
  ),
708
1222
  e != null && e.length ? /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
709
1223
  /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
710
1224
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
711
- /* @__PURE__ */ n(A, { label: "Car", sortKey: "carId", config: c, onSort: u }),
1225
+ /* @__PURE__ */ n(U, { label: "Car", sortKey: "carId", config: c, onSort: u }),
712
1226
  /* @__PURE__ */ n("th", { className: "pvx-th", children: "Record Holder" }),
713
- /* @__PURE__ */ n(A, { label: "Lap Time", sortKey: "lapTimeMs", config: c, onSort: u }),
714
- /* @__PURE__ */ n(A, { label: "Drivers", sortKey: "driverCount", config: c, onSort: u, className: "pvx-hidden-below-md" }),
1227
+ /* @__PURE__ */ n(U, { label: "Lap Time", sortKey: "lapTimeMs", config: c, onSort: u }),
1228
+ /* @__PURE__ */ n(U, { label: "Drivers", sortKey: "driverCount", config: c, onSort: u, className: "pvx-hidden-below-md" }),
715
1229
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Date" })
716
1230
  ] }) }),
717
- /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: g.map((m, w) => /* @__PURE__ */ l(
1231
+ /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: m.map((g, k) => /* @__PURE__ */ l(
718
1232
  "tr",
719
1233
  {
720
1234
  className: "pvx-row pvx-row--clickable",
721
- onClick: () => i(m.carId),
1235
+ onClick: () => o(g.carId),
722
1236
  children: [
723
- /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(pe, { rank: w + 1, podium: !0 }) }),
724
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: I(m.carId) }),
725
- /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(J, { userId: m.steamId || m.userId, getUserDisplay: a }) }),
726
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: q(m.lapTimeMs) }),
727
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: m.driverCount || "-" }),
728
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-lg", children: m.recordedAt ? W(m.recordedAt) : "-" })
1237
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(fe, { rank: k + 1, podium: !0 }) }),
1238
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: I(g.carId) }),
1239
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(re, { userId: g.steamId || g.userId, getUserDisplay: a }) }),
1240
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: q(g.lapTimeMs) }),
1241
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: g.driverCount || "-" }),
1242
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-lg", children: g.recordedAt ? Q(g.recordedAt) : "-" })
729
1243
  ]
730
1244
  },
731
- m.carId
1245
+ g.carId
732
1246
  )) })
733
- ] }) }) : /* @__PURE__ */ n(O, { message: "No lap times for this track yet." })
1247
+ ] }) }) : /* @__PURE__ */ n(Y, { message: "No lap times for this track yet." })
734
1248
  ] });
735
1249
  }
736
- function wt({ entries: e, isLoading: t, track: s, carId: r, getUserDisplay: a, onDriverSelect: i, onNavigate: o, highlightId: d }) {
737
- const [p, c] = G({ key: "lapTimeMs", dir: "asc" }), u = $(() => Pe(e), [e]), v = $(() => Y(e || [], p, (h, k) => {
738
- switch (k) {
1250
+ function or({ entries: e, isLoading: t, track: r, carId: s, getUserDisplay: a, onDriverSelect: o, onNavigate: i, highlightId: d }) {
1251
+ const [p, c] = ne({ key: "lapTimeMs", dir: "asc" }), u = T(() => je(e), [e]), v = T(() => te(e || [], p, (h, y) => {
1252
+ switch (y) {
739
1253
  case "userId":
740
1254
  return a(h.steamId || h.userId).displayName;
741
1255
  case "lapCount":
@@ -745,73 +1259,73 @@ function wt({ entries: e, isLoading: t, track: s, carId: r, getUserDisplay: a, o
745
1259
  return h.lapTimeMs;
746
1260
  }
747
1261
  }), [e, p, a]), f = [
748
- { key: "tracks", label: "Tracks", onClick: () => o("tracks") },
749
- { key: "track", label: s.displayName, onClick: () => o("track") },
750
- { key: "car", label: I(r) }
1262
+ { key: "tracks", label: "Tracks", onClick: () => i("tracks") },
1263
+ { key: "track", label: r.displayName, onClick: () => i("track") },
1264
+ { key: "car", label: I(s) }
751
1265
  ];
752
- return t ? /* @__PURE__ */ n(z, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
753
- /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(ue, { segments: f }) }),
1266
+ return t ? /* @__PURE__ */ n(Z, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
1267
+ /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(Ne, { segments: f }) }),
754
1268
  e != null && e.length ? /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
755
1269
  /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
756
1270
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
757
- /* @__PURE__ */ n(A, { label: "Driver", sortKey: "userId", config: p, onSort: c }),
758
- /* @__PURE__ */ n(A, { label: "Lap Time", sortKey: "lapTimeMs", config: p, onSort: c }),
1271
+ /* @__PURE__ */ n(U, { label: "Driver", sortKey: "userId", config: p, onSort: c }),
1272
+ /* @__PURE__ */ n(U, { label: "Lap Time", sortKey: "lapTimeMs", config: p, onSort: c }),
759
1273
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
760
1274
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
761
1275
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" }),
762
1276
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Tyre" }),
763
1277
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-xl", children: "Fuel" }),
764
- /* @__PURE__ */ n(A, { label: "Laps", sortKey: "lapCount", config: p, onSort: c, className: "pvx-hidden-below-lg" }),
1278
+ /* @__PURE__ */ n(U, { label: "Laps", sortKey: "lapCount", config: p, onSort: c, className: "pvx-hidden-below-lg" }),
765
1279
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
766
1280
  ] }) }),
767
- /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: v.map((h, k) => {
768
- const x = k + 1, g = h.steamId || h.userId, y = u && h.sector1Ms === u.s1, m = u && h.sector2Ms === u.s2, w = u && h.sector3Ms === u.s3;
1281
+ /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: v.map((h, y) => {
1282
+ const x = y + 1, m = h.steamId || h.userId, b = u && h.sector1Ms === u.s1, g = u && h.sector2Ms === u.s2, k = u && h.sector3Ms === u.s3;
769
1283
  return /* @__PURE__ */ l(
770
1284
  "tr",
771
1285
  {
772
- className: `pvx-row pvx-row--clickable ${d && g === d ? "pvx-row--highlight" : x <= 3 ? "pvx-row--podium" : ""}`,
773
- onClick: () => i(g),
1286
+ className: `pvx-row pvx-row--clickable ${d && m === d ? "pvx-row--highlight" : x <= 3 ? "pvx-row--podium" : ""}`,
1287
+ onClick: () => o(m),
774
1288
  children: [
775
- /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(pe, { rank: x, podium: !0 }) }),
776
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(J, { userId: g, getUserDisplay: a }) }),
1289
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(fe, { rank: x, podium: !0 }) }),
1290
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(re, { userId: m, getUserDisplay: a }) }),
777
1291
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: q(h.lapTimeMs) }),
778
- /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${y ? "pvx-td--best-sector" : ""}`, children: E(h.sector1Ms) }),
779
- /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${m ? "pvx-td--best-sector" : ""}`, children: E(h.sector2Ms) }),
780
- /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${w ? "pvx-td--best-sector" : ""}`, children: E(h.sector3Ms) }),
781
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: ke(h.tyreCompound), children: h.tyreCompound || "-" }),
782
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-xl", children: we(h.startingFuelL) }),
1292
+ /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${b ? "pvx-td--best-sector" : ""}`, children: F(h.sector1Ms) }),
1293
+ /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${g ? "pvx-td--best-sector" : ""}`, children: F(h.sector2Ms) }),
1294
+ /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${k ? "pvx-td--best-sector" : ""}`, children: F(h.sector3Ms) }),
1295
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: Re(h.tyreCompound), children: h.tyreCompound || "-" }),
1296
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-xl", children: Me(h.startingFuelL) }),
783
1297
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: h.lapCount || "-" }),
784
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: h.recordedAt ? W(h.recordedAt) : "-" })
1298
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: h.recordedAt ? Q(h.recordedAt) : "-" })
785
1299
  ]
786
1300
  },
787
- g
1301
+ m
788
1302
  );
789
1303
  }) })
790
- ] }) }) : /* @__PURE__ */ n(O, { message: "No lap times for this car yet." })
1304
+ ] }) }) : /* @__PURE__ */ n(Y, { message: "No lap times for this car yet." })
791
1305
  ] });
792
1306
  }
793
- function Ct({ userId: e, track: t, carId: s, game: r, gameVersion: a, showInvalid: i, getUserDisplay: o, onToggleInvalid: d, onNavigate: p }) {
794
- const { data: c, driverName: u, theoreticalBest: v, isLoading: f } = en(e, t.id, t.layout, s, { showInvalid: i, game: r, gameVersion: a }), { displayName: h, avatarUrl: k } = o(e, u), x = $(() => Pe(c, !0), [c]), g = $(() => {
795
- const m = (c == null ? void 0 : c.filter((w) => w.isValid)) || [];
796
- return m.length ? Math.min(...m.map((w) => w.lapTimeMs)) : null;
797
- }, [c]), y = [
1307
+ function lr({ userId: e, track: t, carId: r, game: s, gameVersion: a, showInvalid: o, getUserDisplay: i, onToggleInvalid: d, onNavigate: p }) {
1308
+ const { data: c, driverName: u, theoreticalBest: v, isLoading: f } = cn(e, t.id, t.layout, r, { showInvalid: o, game: s, gameVersion: a }), { displayName: h, avatarUrl: y } = i(e, u), x = T(() => je(c, !0), [c]), m = T(() => {
1309
+ const g = (c == null ? void 0 : c.filter((k) => k.isValid)) || [];
1310
+ return g.length ? Math.min(...g.map((k) => k.lapTimeMs)) : null;
1311
+ }, [c]), b = [
798
1312
  { key: "tracks", label: "Tracks", onClick: () => p("tracks") },
799
1313
  { key: "track", label: t.displayName, onClick: () => p("track") },
800
- { key: "car", label: I(s), onClick: () => p("car") },
1314
+ { key: "car", label: I(r), onClick: () => p("car") },
801
1315
  { key: "driver", label: h }
802
1316
  ];
803
- return f ? /* @__PURE__ */ n(z, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
1317
+ return f ? /* @__PURE__ */ n(Z, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
804
1318
  /* @__PURE__ */ l("div", { className: "pvx-card-header pvx-card-header--split", children: [
805
1319
  /* @__PURE__ */ l("div", { className: "pvx-card-header-left", children: [
806
- /* @__PURE__ */ n(ue, { segments: y }),
807
- k ? /* @__PURE__ */ n("img", { src: k, alt: "", className: "pvx-driver-avatar pvx-driver-avatar--lg" }) : /* @__PURE__ */ n("span", { className: "pvx-driver-avatar pvx-driver-avatar--lg pvx-driver-avatar--placeholder" })
1320
+ /* @__PURE__ */ n(Ne, { segments: b }),
1321
+ y ? /* @__PURE__ */ n("img", { src: y, alt: "", className: "pvx-driver-avatar pvx-driver-avatar--lg" }) : /* @__PURE__ */ n("span", { className: "pvx-driver-avatar pvx-driver-avatar--lg pvx-driver-avatar--placeholder" })
808
1322
  ] }),
809
1323
  /* @__PURE__ */ l("label", { className: "pvx-checkbox-label", children: [
810
1324
  /* @__PURE__ */ n(
811
1325
  "input",
812
1326
  {
813
1327
  type: "checkbox",
814
- checked: i,
1328
+ checked: o,
815
1329
  onChange: d,
816
1330
  className: "pvx-checkbox"
817
1331
  }
@@ -824,11 +1338,11 @@ function Ct({ userId: e, track: t, carId: s, game: r, gameVersion: a, showInvali
824
1338
  /* @__PURE__ */ n("span", { className: "pvx-theoretical-best-time", children: q(v.lapTimeMs) }),
825
1339
  /* @__PURE__ */ l("span", { className: "pvx-theoretical-best-sectors", children: [
826
1340
  "(",
827
- E(v.sector1Ms),
1341
+ F(v.sector1Ms),
828
1342
  " + ",
829
- E(v.sector2Ms),
1343
+ F(v.sector2Ms),
830
1344
  " + ",
831
- E(v.sector3Ms),
1345
+ F(v.sector3Ms),
832
1346
  ")"
833
1347
  ] })
834
1348
  ] }),
@@ -845,27 +1359,27 @@ function Ct({ userId: e, track: t, carId: s, game: r, gameVersion: a, showInvali
845
1359
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Fuel" }),
846
1360
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
847
1361
  ] }) }),
848
- /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: c.map((m, w) => {
849
- const S = m.isValid && m.lapTimeMs === g, R = x && m.isValid && m.sector1Ms === x.s1, T = x && m.isValid && m.sector2Ms === x.s2, N = x && m.isValid && m.sector3Ms === x.s3;
850
- let b = "pvx-row";
851
- return m.isValid || (b += " pvx-row--invalid"), S && (b += " pvx-row--personal-best"), /* @__PURE__ */ l("tr", { className: b, children: [
852
- /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n("span", { className: `pvx-rank ${S ? "pvx-rank--gold" : ""}`, children: w + 1 }) }),
853
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-md", children: m.lapNumber || "-" }),
854
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: q(m.lapTimeMs) }),
855
- /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${R ? "pvx-td--best-sector" : ""}`, children: E(m.sector1Ms) }),
856
- /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${T ? "pvx-td--best-sector" : ""}`, children: E(m.sector2Ms) }),
857
- /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${N ? "pvx-td--best-sector" : ""}`, children: E(m.sector3Ms) }),
858
- /* @__PURE__ */ n("td", { className: "pvx-td", title: m.isValid ? void 0 : m.invalidReason || "Invalid", children: m.isValid ? /* @__PURE__ */ n(dn, {}) : /* @__PURE__ */ n(pn, {}) }),
859
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: ke(m.tyreCompound), children: m.tyreCompound || "-" }),
860
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: we(m.startingFuelL) }),
861
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: W(m.timestamp) })
862
- ] }, m.id);
1362
+ /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: c.map((g, k) => {
1363
+ const C = g.isValid && g.lapTimeMs === m, P = x && g.isValid && g.sector1Ms === x.s1, A = x && g.isValid && g.sector2Ms === x.s2, N = x && g.isValid && g.sector3Ms === x.s3;
1364
+ let L = "pvx-row";
1365
+ return g.isValid || (L += " pvx-row--invalid"), C && (L += " pvx-row--personal-best"), /* @__PURE__ */ l("tr", { className: L, children: [
1366
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n("span", { className: `pvx-rank ${C ? "pvx-rank--gold" : ""}`, children: k + 1 }) }),
1367
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-md", children: g.lapNumber || "-" }),
1368
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: q(g.lapTimeMs) }),
1369
+ /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${P ? "pvx-td--best-sector" : ""}`, children: F(g.sector1Ms) }),
1370
+ /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${A ? "pvx-td--best-sector" : ""}`, children: F(g.sector2Ms) }),
1371
+ /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${N ? "pvx-td--best-sector" : ""}`, children: F(g.sector3Ms) }),
1372
+ /* @__PURE__ */ n("td", { className: "pvx-td", title: g.isValid ? void 0 : g.invalidReason || "Invalid", children: g.isValid ? /* @__PURE__ */ n(Vn, {}) : /* @__PURE__ */ n(Kn, {}) }),
1373
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: Re(g.tyreCompound), children: g.tyreCompound || "-" }),
1374
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: Me(g.startingFuelL) }),
1375
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: Q(g.timestamp) })
1376
+ ] }, g.id);
863
1377
  }) })
864
- ] }) }) : /* @__PURE__ */ n(O, { message: i ? "No laps recorded for this combination." : 'No valid laps. Try enabling "Show invalid laps".' })
1378
+ ] }) }) : /* @__PURE__ */ n(Y, { message: o ? "No laps recorded for this combination." : 'No valid laps. Try enabling "Show invalid laps".' })
865
1379
  ] });
866
1380
  }
867
- function Lt({ drivers: e, isLoading: t, getUserDisplay: s, game: r, gameVersion: a, onComboSelect: i }) {
868
- const [o, d] = G({ key: "rank", dir: "asc" }), [p, c] = B(null), u = $(() => e ? Y(e, o, (f, h) => {
1381
+ function cr({ drivers: e, isLoading: t, getUserDisplay: r, game: s, gameVersion: a, onComboSelect: o }) {
1382
+ const [i, d] = ne({ key: "rank", dir: "asc" }), [p, c] = E(null), u = T(() => e ? te(e, i, (f, h) => {
869
1383
  switch (h) {
870
1384
  case "rating":
871
1385
  return f.rating;
@@ -877,10 +1391,10 @@ function Lt({ drivers: e, isLoading: t, getUserDisplay: s, game: r, gameVersion:
877
1391
  default:
878
1392
  return f.rank;
879
1393
  }
880
- }) : [], [e, o]);
881
- if (t) return /* @__PURE__ */ n(z, {});
1394
+ }) : [], [e, i]);
1395
+ if (t) return /* @__PURE__ */ n(Z, {});
882
1396
  if (!(e != null && e.length))
883
- return /* @__PURE__ */ n("div", { className: "pvx-card", children: /* @__PURE__ */ n(O, { message: "Not enough data for rankings yet." }) });
1397
+ return /* @__PURE__ */ n("div", { className: "pvx-card", children: /* @__PURE__ */ n(Y, { message: "Not enough data for rankings yet." }) });
884
1398
  const v = 5;
885
1399
  return /* @__PURE__ */ l("div", { className: "pvx-card", children: [
886
1400
  /* @__PURE__ */ l("div", { className: "pvx-card-header pvx-rankings-header", children: [
@@ -900,25 +1414,25 @@ function Lt({ drivers: e, isLoading: t, getUserDisplay: s, game: r, gameVersion:
900
1414
  ] }),
901
1415
  /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
902
1416
  /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
903
- /* @__PURE__ */ n(A, { label: "#", sortKey: "rank", config: o, onSort: d, className: "pvx-th--narrow" }),
1417
+ /* @__PURE__ */ n(U, { label: "#", sortKey: "rank", config: i, onSort: d, className: "pvx-th--narrow" }),
904
1418
  /* @__PURE__ */ n("th", { className: "pvx-th", children: "Driver" }),
905
- /* @__PURE__ */ n(A, { label: "Rating", sortKey: "rating", config: o, onSort: d }),
906
- /* @__PURE__ */ n(A, { label: "Cars", sortKey: "distinctCars", config: o, onSort: d, className: "pvx-hidden-below-sm" }),
907
- /* @__PURE__ */ n(A, { label: "Combos", sortKey: "comboCount", config: o, onSort: d, className: "pvx-hidden-below-sm" })
1419
+ /* @__PURE__ */ n(U, { label: "Rating", sortKey: "rating", config: i, onSort: d }),
1420
+ /* @__PURE__ */ n(U, { label: "Cars", sortKey: "distinctCars", config: i, onSort: d, className: "pvx-hidden-below-sm" }),
1421
+ /* @__PURE__ */ n(U, { label: "Combos", sortKey: "comboCount", config: i, onSort: d, className: "pvx-hidden-below-sm" })
908
1422
  ] }) }),
909
1423
  /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: u.map((f) => {
910
1424
  const h = p === f.identifier;
911
1425
  return /* @__PURE__ */ n(
912
- un,
1426
+ Hn,
913
1427
  {
914
1428
  driver: f,
915
- getUserDisplay: s,
1429
+ getUserDisplay: r,
916
1430
  isExpanded: h,
917
1431
  onToggle: () => c(h ? null : f.identifier),
918
1432
  colCount: v,
919
- game: r,
1433
+ game: s,
920
1434
  gameVersion: a,
921
- onComboSelect: i
1435
+ onComboSelect: o
922
1436
  },
923
1437
  f.identifier
924
1438
  );
@@ -926,28 +1440,28 @@ function Lt({ drivers: e, isLoading: t, getUserDisplay: s, game: r, gameVersion:
926
1440
  ] }) })
927
1441
  ] });
928
1442
  }
929
- function un({ driver: e, getUserDisplay: t, isExpanded: s, onToggle: r, colCount: a, game: i, gameVersion: o, onComboSelect: d }) {
1443
+ function Hn({ driver: e, getUserDisplay: t, isExpanded: r, onToggle: s, colCount: a, game: o, gameVersion: i, onComboSelect: d }) {
930
1444
  const p = e.identifier;
931
- return /* @__PURE__ */ l(_, { children: [
1445
+ return /* @__PURE__ */ l(B, { children: [
932
1446
  /* @__PURE__ */ l(
933
1447
  "tr",
934
1448
  {
935
1449
  className: `pvx-row pvx-row--clickable ${e.rank <= 3 ? "pvx-row--podium" : ""}`,
936
- onClick: r,
1450
+ onClick: s,
937
1451
  children: [
938
- /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(pe, { rank: e.rank, podium: !0 }) }),
939
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(J, { userId: p, getUserDisplay: t }) }),
1452
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(fe, { rank: e.rank, podium: !0 }) }),
1453
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(re, { userId: p, getUserDisplay: t }) }),
940
1454
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: e.rating.toFixed(1) }),
941
1455
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: e.distinctCars || "-" }),
942
1456
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: /* @__PURE__ */ l("span", { className: "pvx-rankings-combo-count", children: [
943
1457
  e.comboCount,
944
- /* @__PURE__ */ n("svg", { className: `pvx-rankings-chevron ${s ? "pvx-rankings-chevron--open" : ""}`, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ n("path", { d: "m6 9 6 6 6-6" }) })
1458
+ /* @__PURE__ */ n("svg", { className: `pvx-rankings-chevron ${r ? "pvx-rankings-chevron--open" : ""}`, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ n("path", { d: "m6 9 6 6 6-6" }) })
945
1459
  ] }) })
946
1460
  ]
947
1461
  }
948
1462
  ),
949
- s && e.combos && /* @__PURE__ */ n("tr", { children: /* @__PURE__ */ n("td", { colSpan: a, className: "pvx-rankings-combos-cell", children: /* @__PURE__ */ n("div", { className: "pvx-rankings-combos", children: e.combos.map((c, u) => {
950
- const v = c.layout ? `${c.trackId}|${c.layout}` : c.trackId, f = d ? () => d({ track: v, car: c.carId, highlight: p, game: i, gameVersion: o }) : void 0;
1463
+ r && e.combos && /* @__PURE__ */ n("tr", { children: /* @__PURE__ */ n("td", { colSpan: a, className: "pvx-rankings-combos-cell", children: /* @__PURE__ */ n("div", { className: "pvx-rankings-combos", children: e.combos.map((c, u) => {
1464
+ const v = c.layout ? `${c.trackId}|${c.layout}` : c.trackId, f = d ? () => d({ track: v, car: c.carId, highlight: p, game: o, gameVersion: i }) : void 0;
951
1465
  return /* @__PURE__ */ l(
952
1466
  "div",
953
1467
  {
@@ -956,7 +1470,7 @@ function un({ driver: e, getUserDisplay: t, isExpanded: s, onToggle: r, colCount
956
1470
  role: f ? "button" : void 0,
957
1471
  children: [
958
1472
  /* @__PURE__ */ l("div", { className: "pvx-rankings-combo-info", children: [
959
- /* @__PURE__ */ n("p", { className: "pvx-rankings-combo-track", children: j(c.trackId, c.layout, i) }),
1473
+ /* @__PURE__ */ n("p", { className: "pvx-rankings-combo-track", children: z(c.trackId, c.layout, o) }),
960
1474
  /* @__PURE__ */ n("p", { className: "pvx-rankings-combo-car", children: I(c.carId) })
961
1475
  ] }),
962
1476
  /* @__PURE__ */ l("div", { className: "pvx-rankings-combo-stats", children: [
@@ -980,160 +1494,140 @@ function un({ driver: e, getUserDisplay: t, isExpanded: s, onToggle: r, colCount
980
1494
  }) }) }) })
981
1495
  ] });
982
1496
  }
983
- const hn = {
984
- GBR: "🇬🇧",
985
- DEU: "🇩🇪",
986
- NLD: "🇳🇱",
987
- SWE: "🇸🇪",
988
- ESP: "🇪🇸",
989
- ZAF: "🇿🇦",
990
- FRA: "🇫🇷",
991
- ITA: "🇮🇹",
992
- USA: "🇺🇸",
993
- AUS: "🇦🇺",
994
- BRA: "🇧🇷",
995
- JPN: "🇯🇵",
996
- CAN: "🇨🇦",
997
- POL: "🇵🇱",
998
- AUT: "🇦🇹",
999
- BEL: "🇧🇪",
1000
- PRT: "🇵🇹",
1001
- NOR: "🇳🇴",
1002
- DNK: "🇩🇰",
1003
- FIN: "🇫🇮",
1004
- IRL: "🇮🇪",
1005
- CHE: "🇨🇭",
1006
- NZL: "🇳🇿",
1007
- MEX: "🇲🇽",
1008
- ARG: "🇦🇷",
1009
- CZE: "🇨🇿",
1010
- HUN: "🇭🇺",
1011
- RUS: "🇷🇺",
1012
- TUR: "🇹🇷",
1013
- KOR: "🇰🇷"
1014
- }, he = ["🥇", "🥈", "🥉"], mn = {
1015
- championship: "Championship",
1016
- series: "Series",
1017
- event: "Event",
1018
- hotlap: "Hotlap"
1019
- }, vn = ["PRACTICE", "QUALIFYING", "RACE"];
1020
- function ge(e) {
1021
- const t = vn.indexOf(e);
1022
- if (t >= 0) return t;
1023
- const s = e.match(/^PRACTICE_(\d+)$/);
1024
- return s ? 100 + parseInt(s[1]) : 999;
1025
- }
1026
- function Z(e) {
1027
- const t = e.match(/^PRACTICE_(\d+)$/);
1028
- return t ? `P${t[1]}` : e;
1029
- }
1030
- function me({ position: e }) {
1031
- return /* @__PURE__ */ n("span", { className: e === 1 ? "pvx-rank pvx-rank--gold" : e === 2 ? "pvx-rank pvx-rank--silver" : e === 3 ? "pvx-rank pvx-rank--bronze" : "pvx-rank", children: e });
1032
- }
1033
- function X({ nation: e }) {
1034
- const t = e && hn[e];
1035
- return t ? /* @__PURE__ */ n("span", { className: "pvx-nation-flag", title: e, children: t }) : null;
1036
- }
1037
- function xn({ sessions: e, activeSession: t, onSelect: s }) {
1038
- if (!e || e.length <= 1) return null;
1039
- const r = [...e].sort(
1040
- (a, i) => ge(a.type) - ge(i.type)
1041
- );
1042
- return /* @__PURE__ */ n("div", { className: "pvx-session-tabs", children: r.map((a) => /* @__PURE__ */ n(
1043
- "button",
1044
- {
1045
- onClick: () => s(a.type),
1046
- className: `pvx-session-tab ${t === a.type ? "pvx-session-tab--active" : ""}`,
1047
- children: Z(a.type)
1048
- },
1049
- a.type
1050
- )) });
1051
- }
1052
- function gn({ type: e }) {
1053
- return /* @__PURE__ */ n("span", { className: `pvx-comp-badge pvx-comp-badge--${e}`, children: mn[e] || e });
1054
- }
1055
- function se({ children: e, variant: t = "default" }) {
1056
- return /* @__PURE__ */ n("span", { className: `pvx-info-pill ${t !== "default" ? `pvx-info-pill--${t}` : ""}`, children: e });
1057
- }
1058
- function fn(e) {
1059
- if (!e) return "TBD";
1060
- const t = new Date(e);
1061
- if (isNaN(t)) return "TBD";
1062
- const s = t.toLocaleDateString("en-GB", { weekday: "short", day: "numeric", month: "short" }), r = t.toLocaleTimeString("en-GB", { hour: "2-digit", minute: "2-digit" });
1063
- return `${s} • ${r}`;
1064
- }
1065
- function Nn(e) {
1066
- return e.reduce((t, s) => {
1067
- var r;
1068
- return (r = s.splits) != null && r.length ? t ? t.map((a, i) => {
1069
- const o = s.splits[i];
1070
- return o && o < a ? o : a;
1071
- }) : [...s.splits] : t;
1072
- }, null);
1497
+ function On({ competitionId: e, topN: t = 3, label: r = "Completed", className: s }) {
1498
+ const { data: a } = De(e), o = En(a, t);
1499
+ return /* @__PURE__ */ l("div", { className: `pvx-comp-completed-badge ${s || ""}`, children: [
1500
+ /* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-label", children: r }),
1501
+ o.length > 0 && /* @__PURE__ */ n("ol", { className: "pvx-comp-completed-badge-podium", children: o.map((i, d) => /* @__PURE__ */ l("li", { className: "pvx-comp-completed-badge-driver", children: [
1502
+ /* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-medal", "aria-hidden": "true", children: xe[d] || "" }),
1503
+ /* @__PURE__ */ n(ee, { nation: i.nation }),
1504
+ /* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-name", children: i.driverName })
1505
+ ] }, i.driverId || d)) })
1506
+ ] });
1073
1507
  }
1074
- function V({ message: e = "Loading..." }) {
1075
- return /* @__PURE__ */ n("div", { className: "pvx-loading", children: e });
1508
+ const Gn = {
1509
+ GameModeSelectionWeatherType_CLEAR: "Clear",
1510
+ GameModeSelectionWeatherType_SCATTERED_CLOUDS: "Scattered Clouds",
1511
+ GameModeSelectionWeatherType_BROKEN_CLOUDS: "Broken Clouds",
1512
+ GameModeSelectionWeatherType_OVERCAST: "Overcast",
1513
+ GameModeSelectionWeatherType_DRIZZLE: "Drizzle",
1514
+ GameModeSelectionWeatherType_DAMP: "Damp",
1515
+ GameModeSelectionWeatherType_RAIN: "Rain",
1516
+ GameModeSelectionWeatherType_HEAVY_RAIN: "Heavy Rain"
1517
+ }, zn = {
1518
+ viewBox: "0 0 24 24",
1519
+ fill: "none",
1520
+ stroke: "currentColor",
1521
+ strokeWidth: 1.5,
1522
+ strokeLinecap: "round",
1523
+ strokeLinejoin: "round"
1524
+ };
1525
+ function Qn() {
1526
+ return /* @__PURE__ */ l(B, { children: [
1527
+ /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "4" }),
1528
+ /* @__PURE__ */ n("path", { d: "M12 2v2" }),
1529
+ /* @__PURE__ */ n("path", { d: "M12 20v2" }),
1530
+ /* @__PURE__ */ n("path", { d: "m4.93 4.93 1.41 1.41" }),
1531
+ /* @__PURE__ */ n("path", { d: "m17.66 17.66 1.41 1.41" }),
1532
+ /* @__PURE__ */ n("path", { d: "M2 12h2" }),
1533
+ /* @__PURE__ */ n("path", { d: "M20 12h2" }),
1534
+ /* @__PURE__ */ n("path", { d: "m6.34 17.66-1.41 1.41" }),
1535
+ /* @__PURE__ */ n("path", { d: "m19.07 4.93-1.41 1.41" })
1536
+ ] });
1076
1537
  }
1077
- function U({ message: e = "No data available." }) {
1078
- return /* @__PURE__ */ n("div", { className: "pvx-empty", children: /* @__PURE__ */ n("p", { children: e }) });
1538
+ function Yn() {
1539
+ return /* @__PURE__ */ l(B, { children: [
1540
+ /* @__PURE__ */ n("path", { d: "M12 2v2" }),
1541
+ /* @__PURE__ */ n("path", { d: "m4.93 4.93 1.41 1.41" }),
1542
+ /* @__PURE__ */ n("path", { d: "M20 12h2" }),
1543
+ /* @__PURE__ */ n("path", { d: "m19.07 4.93-1.41 1.41" }),
1544
+ /* @__PURE__ */ n("path", { d: "M15.947 12.65a4 4 0 0 0-5.925-4.128" }),
1545
+ /* @__PURE__ */ n("path", { d: "M13 22H7a5 5 0 1 1 4.9-6H13a3 3 0 0 1 0 6Z" })
1546
+ ] });
1079
1547
  }
1080
- const Be = 3;
1081
- function ee(e) {
1082
- if (!e) return !1;
1083
- if (e.closesAt) {
1084
- const t = new Date(e.closesAt).getTime();
1085
- if (!Number.isNaN(t)) return Date.now() >= t;
1086
- }
1087
- return !!e.isClosed;
1548
+ function Zn() {
1549
+ return /* @__PURE__ */ l(B, { children: [
1550
+ /* @__PURE__ */ n("path", { d: "M17.5 21H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z" }),
1551
+ /* @__PURE__ */ n("path", { d: "M22 10a3 3 0 0 0-3-3h-2.207a5.502 5.502 0 0 0-10.702.5" })
1552
+ ] });
1088
1553
  }
1089
- function bn(e) {
1090
- const t = e == null ? void 0 : e.rounds;
1091
- return t != null && t.length ? e.type === "hotlap" ? t.every((s) => ee(s)) : t.every((s) => s.isFinalized) : !1;
1554
+ function Jn() {
1555
+ return /* @__PURE__ */ n("path", { d: "M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z" });
1556
+ }
1557
+ function Xn() {
1558
+ return /* @__PURE__ */ l(B, { children: [
1559
+ /* @__PURE__ */ n("path", { d: "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242" }),
1560
+ /* @__PURE__ */ n("path", { d: "M8 19v1" }),
1561
+ /* @__PURE__ */ n("path", { d: "M8 14v1" }),
1562
+ /* @__PURE__ */ n("path", { d: "M16 19v1" }),
1563
+ /* @__PURE__ */ n("path", { d: "M16 14v1" }),
1564
+ /* @__PURE__ */ n("path", { d: "M12 21v1" }),
1565
+ /* @__PURE__ */ n("path", { d: "M12 16v1" })
1566
+ ] });
1092
1567
  }
1093
- function yn(e) {
1094
- const t = e == null ? void 0 : e.rounds;
1095
- if (!(t != null && t.length)) return null;
1096
- let s = null;
1097
- for (const r of t) {
1098
- if (!r.startTime) continue;
1099
- const a = new Date(r.startTime);
1100
- isNaN(a) || (!s || a > s) && (s = a);
1101
- }
1102
- return s;
1568
+ function et() {
1569
+ return /* @__PURE__ */ l(B, { children: [
1570
+ /* @__PURE__ */ n("path", { d: "M16 17H7" }),
1571
+ /* @__PURE__ */ n("path", { d: "M17 21H9" }),
1572
+ /* @__PURE__ */ n("path", { d: "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242" })
1573
+ ] });
1103
1574
  }
1104
- function Ie(e, t = Be) {
1105
- if (!bn(e)) return "active";
1106
- const s = yn(e);
1107
- if (!s) return "recently-completed";
1108
- const r = t * 24 * 60 * 60 * 1e3;
1109
- return Date.now() - s.getTime() <= r ? "recently-completed" : "archived";
1575
+ function nt() {
1576
+ return /* @__PURE__ */ l(B, { children: [
1577
+ /* @__PURE__ */ n("path", { d: "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242" }),
1578
+ /* @__PURE__ */ n("path", { d: "M16 14v6" }),
1579
+ /* @__PURE__ */ n("path", { d: "M8 14v6" }),
1580
+ /* @__PURE__ */ n("path", { d: "M12 16v6" })
1581
+ ] });
1110
1582
  }
1111
- function St(e, t, s = Be) {
1112
- if (!(e != null && e.length)) return [];
1113
- const r = new Set(Array.isArray(t) ? t : [t]);
1114
- return e.filter((a) => r.has(Ie(a, s)));
1115
- }
1116
- function kn(e, t = 3) {
1117
- const s = e == null ? void 0 : e.standings;
1118
- return Array.isArray(s) ? [...s].sort((r, a) => (r.position ?? 999) - (a.position ?? 999)).slice(0, t) : [];
1119
- }
1120
- function wn({ competitionId: e, topN: t = 3, label: s = "Completed", className: r }) {
1121
- const { data: a } = Se(e), i = kn(a, t);
1122
- return /* @__PURE__ */ l("div", { className: `pvx-comp-completed-badge ${r || ""}`, children: [
1123
- /* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-label", children: s }),
1124
- i.length > 0 && /* @__PURE__ */ n("ol", { className: "pvx-comp-completed-badge-podium", children: i.map((o, d) => /* @__PURE__ */ l("li", { className: "pvx-comp-completed-badge-driver", children: [
1125
- /* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-medal", "aria-hidden": "true", children: he[d] || "" }),
1126
- /* @__PURE__ */ n(X, { nation: o.nation }),
1127
- /* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-name", children: o.driverName })
1128
- ] }, o.driverId || d)) })
1583
+ function tt() {
1584
+ return /* @__PURE__ */ l(B, { children: [
1585
+ /* @__PURE__ */ n("path", { d: "M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242" }),
1586
+ /* @__PURE__ */ n("path", { d: "m9.2 22 3-7" }),
1587
+ /* @__PURE__ */ n("path", { d: "m9 13-3 7" }),
1588
+ /* @__PURE__ */ n("path", { d: "m17 13-3 7" })
1129
1589
  ] });
1130
1590
  }
1131
- function $t({ competitions: e, isLoading: t, onSelect: s, onRegister: r, className: a }) {
1132
- return t ? /* @__PURE__ */ n(V, { message: "Loading competitions..." }) : e != null && e.length ? /* @__PURE__ */ n("div", { className: `pvx-comp-grid ${a || ""}`, children: e.map((i) => /* @__PURE__ */ n(Cn, { comp: i, onSelect: s, onRegister: r || s }, i.id)) }) : /* @__PURE__ */ n(U, { message: "No competitions available." });
1591
+ const rt = {
1592
+ GameModeSelectionWeatherType_CLEAR: Qn,
1593
+ GameModeSelectionWeatherType_SCATTERED_CLOUDS: Yn,
1594
+ GameModeSelectionWeatherType_BROKEN_CLOUDS: Zn,
1595
+ GameModeSelectionWeatherType_OVERCAST: Jn,
1596
+ GameModeSelectionWeatherType_DRIZZLE: Xn,
1597
+ GameModeSelectionWeatherType_DAMP: et,
1598
+ GameModeSelectionWeatherType_RAIN: nt,
1599
+ GameModeSelectionWeatherType_HEAVY_RAIN: tt
1600
+ };
1601
+ function st({ weatherType: e, weatherBehaviour: t, className: r }) {
1602
+ const s = e ? rt[e] : null;
1603
+ if (!s) return null;
1604
+ const a = Gn[e] || e, o = t === "GameModeSelectionWeatherBehaviour_DYNAMIC", i = o ? `${a} · Dynamic` : a;
1605
+ return /* @__PURE__ */ l(
1606
+ "span",
1607
+ {
1608
+ className: `pvx-weather-icon ${r || ""}`.trim(),
1609
+ title: i,
1610
+ "aria-label": i,
1611
+ children: [
1612
+ /* @__PURE__ */ n("svg", { className: "pvx-weather-icon-main", ...zn, children: /* @__PURE__ */ n(s, {}) }),
1613
+ o && /* @__PURE__ */ n("span", { className: "pvx-weather-icon-dynamic", "aria-hidden": "true", children: /* @__PURE__ */ l("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
1614
+ /* @__PURE__ */ n("path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }),
1615
+ /* @__PURE__ */ n("path", { d: "M21 3v5h-5" }),
1616
+ /* @__PURE__ */ n("path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }),
1617
+ /* @__PURE__ */ n("path", { d: "M8 16H3v5" })
1618
+ ] }) })
1619
+ ]
1620
+ }
1621
+ );
1133
1622
  }
1134
- function Cn({ comp: e, onSelect: t, onRegister: s }) {
1135
- var S, R, T, N;
1136
- const { cdnUrl: r } = C(), a = e.posterCdnPath ? `${r}/${e.posterCdnPath}` : null, i = e.registration, o = (i == null ? void 0 : i.currentCount) || 0, d = i == null ? void 0 : i.maxParticipants, p = d && o >= d, c = (i == null ? void 0 : i.deadline) && new Date(i.deadline) < /* @__PURE__ */ new Date(), u = (i == null ? void 0 : i.isOpen) && !c && !p, v = /* @__PURE__ */ new Date(), f = (S = e.rounds) == null ? void 0 : S.find((b) => b.startTime && new Date(b.startTime) >= v), h = ((R = e.rounds) == null ? void 0 : R.length) || 0, k = e.type === "hotlap", x = k && h > 1, g = k ? ((T = e.rounds) == null ? void 0 : T.filter(ee).length) || 0 : ((N = e.rounds) == null ? void 0 : N.filter((b) => b.isFinalized).length) || 0, y = Ie(e), m = y === "recently-completed" || y === "archived", w = e.type === "championship";
1623
+ function dr({ competitions: e, isLoading: t, onSelect: r, onRegister: s, className: a }) {
1624
+ return t ? /* @__PURE__ */ n(W, { message: "Loading competitions..." }) : e != null && e.length ? /* @__PURE__ */ n("div", { className: `pvx-comp-grid ${a || ""}`, children: e.map((o) => /* @__PURE__ */ n(at, { comp: o, onSelect: r, onRegister: s || r }, o.id)) }) : /* @__PURE__ */ n(_, { message: "No competitions available." });
1625
+ }
1626
+ function at({ comp: e, onSelect: t, onRegister: r }) {
1627
+ var A, N, L, w, D;
1628
+ const { cdnUrl: s } = S(), a = e.posterCdnPath ? `${s}/${e.posterCdnPath}` : null, o = e.registration, i = (o == null ? void 0 : o.currentCount) || 0, d = o == null ? void 0 : o.maxParticipants, p = d && i >= d, c = (o == null ? void 0 : o.deadline) && new Date(o.deadline) < /* @__PURE__ */ new Date(), u = (o == null ? void 0 : o.isOpen) && !c && !p, v = /* @__PURE__ */ new Date(), f = (A = e.rounds) == null ? void 0 : A.find(
1629
+ ($) => $.startTime && new Date($.startTime) <= v && !O($)
1630
+ ), h = f || ((N = e.rounds) == null ? void 0 : N.find(($) => $.startTime && new Date($.startTime) >= v)), y = !!f, x = ((L = e.rounds) == null ? void 0 : L.length) || 0, m = e.type === "hotlap", b = m && x > 1, g = m ? ((w = e.rounds) == null ? void 0 : w.filter(O).length) || 0 : ((D = e.rounds) == null ? void 0 : D.filter(($) => $.isFinalized).length) || 0, k = _e(e), C = k === "recently-completed" || k === "archived", P = e.type === "championship";
1137
1631
  return /* @__PURE__ */ l(
1138
1632
  "div",
1139
1633
  {
@@ -1141,51 +1635,61 @@ function Cn({ comp: e, onSelect: t, onRegister: s }) {
1141
1635
  onClick: () => t(e.id),
1142
1636
  role: "button",
1143
1637
  tabIndex: 0,
1144
- onKeyDown: (b) => {
1145
- (b.key === "Enter" || b.key === " ") && (b.preventDefault(), t(e.id));
1638
+ onKeyDown: ($) => {
1639
+ ($.key === "Enter" || $.key === " ") && ($.preventDefault(), t(e.id));
1146
1640
  },
1147
1641
  children: [
1148
- /* @__PURE__ */ n("div", { className: "pvx-comp-card-poster", children: a ? /* @__PURE__ */ n("img", { src: a, alt: e.name, className: "pvx-comp-card-poster-img" }) : /* @__PURE__ */ n("div", { className: "pvx-comp-card-poster-placeholder", children: /* @__PURE__ */ n(Sn, {}) }) }),
1642
+ /* @__PURE__ */ n("div", { className: "pvx-comp-card-poster", children: a ? /* @__PURE__ */ n("img", { src: a, alt: e.name, className: "pvx-comp-card-poster-img" }) : /* @__PURE__ */ n("div", { className: "pvx-comp-card-poster-placeholder", children: /* @__PURE__ */ n(ot, {}) }) }),
1149
1643
  /* @__PURE__ */ l("div", { className: "pvx-comp-card-body", children: [
1150
1644
  /* @__PURE__ */ n("h3", { className: "pvx-comp-card-title", children: e.name }),
1151
1645
  e.description && /* @__PURE__ */ n("p", { className: "pvx-comp-card-desc", children: e.description }),
1152
1646
  /* @__PURE__ */ l("div", { className: "pvx-comp-card-pills", children: [
1153
- /* @__PURE__ */ n(gn, { type: e.type }),
1154
- e.game && /* @__PURE__ */ n(se, { children: e.game.toUpperCase() }),
1155
- e.formatDescription && e.formatDescription.split(", ").map((b, L) => /* @__PURE__ */ n(se, { variant: "format", children: b }, L))
1647
+ /* @__PURE__ */ n(Rn, { type: e.type }),
1648
+ e.game && /* @__PURE__ */ n(ae, { children: e.game.toUpperCase() }),
1649
+ e.formatDescription && e.formatDescription.split(", ").map(($, j) => /* @__PURE__ */ n(ae, { variant: "format", children: $ }, j))
1156
1650
  ] }),
1157
- e.carsDescription && /* @__PURE__ */ n("div", { className: "pvx-comp-card-pills", children: e.carsDescription.split(", ").map((b, L) => /* @__PURE__ */ n(se, { children: b }, L)) }),
1651
+ e.carsDescription && /* @__PURE__ */ n("div", { className: "pvx-comp-card-pills", children: e.carsDescription.split(", ").map(($, j) => /* @__PURE__ */ n(ae, { children: $ }, j)) }),
1158
1652
  /* @__PURE__ */ l("div", { className: "pvx-comp-card-schedule", children: [
1159
- f ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
1160
- /* @__PURE__ */ n("span", { className: "pvx-comp-card-schedule-label", children: "Next:" }),
1653
+ h ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
1654
+ /* @__PURE__ */ n("span", { className: "pvx-comp-card-schedule-label", children: y ? "Live:" : "Next:" }),
1161
1655
  " ",
1162
- (e.type !== "hotlap" || x) && `R${f.roundNumber} `,
1163
- f.track || "TBD",
1656
+ (e.type !== "hotlap" || b) && `R${h.roundNumber} `,
1657
+ h.track || "TBD",
1164
1658
  " · ",
1165
- fn(f.startTime)
1166
- ] }) : h > 0 ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
1659
+ Mn(h.startTime),
1660
+ (h.weatherType || e.weatherType) && /* @__PURE__ */ l(B, { children: [
1661
+ " ",
1662
+ /* @__PURE__ */ n(
1663
+ st,
1664
+ {
1665
+ weatherType: h.weatherType || e.weatherType,
1666
+ weatherBehaviour: h.weatherBehaviour || e.weatherBehaviour
1667
+ }
1668
+ )
1669
+ ] })
1670
+ ] }) : x > 0 ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
1167
1671
  g,
1168
1672
  "/",
1169
- h,
1673
+ x,
1170
1674
  " rounds completed"
1171
1675
  ] }) : null,
1172
- h > 0 && /* @__PURE__ */ l("span", { className: "pvx-comp-card-round-count", children: [
1173
- h,
1676
+ x > 0 && /* @__PURE__ */ l("span", { className: "pvx-comp-card-round-count", children: [
1677
+ x,
1174
1678
  " round",
1175
- h !== 1 ? "s" : ""
1679
+ x !== 1 ? "s" : ""
1176
1680
  ] })
1177
1681
  ] }),
1178
- m && (w || x) && /* @__PURE__ */ n(wn, { competitionId: e.id }),
1179
- i && !m && /* @__PURE__ */ n(
1180
- Ln,
1682
+ C && (P || b) && /* @__PURE__ */ n(On, { competitionId: e.id }),
1683
+ o && !C && /* @__PURE__ */ n(
1684
+ it,
1181
1685
  {
1182
1686
  competitionId: e.id,
1183
1687
  regOpen: u,
1184
1688
  isFull: p,
1185
1689
  deadlinePassed: c,
1186
- regCount: o,
1690
+ regCount: i,
1187
1691
  regMax: d,
1188
- onRegister: s
1692
+ onRegister: r
1189
1693
  }
1190
1694
  )
1191
1695
  ] })
@@ -1193,13 +1697,13 @@ function Cn({ comp: e, onSelect: t, onRegister: s }) {
1193
1697
  }
1194
1698
  );
1195
1699
  }
1196
- function Ln({ competitionId: e, regOpen: t, isFull: s, deadlinePassed: r, regCount: a, regMax: i, onRegister: o }) {
1197
- const { isPowerMode: d } = ce(), p = de(e), { data: c } = le(e), u = (c == null ? void 0 : c.isRegistered) || !1, v = i ? a / i * 100 : 0, f = v >= 100 ? "full" : v >= 75 ? "warning" : "ok";
1700
+ function it({ competitionId: e, regOpen: t, isFull: r, deadlinePassed: s, regCount: a, regMax: o, onRegister: i }) {
1701
+ const { isPowerMode: d } = me(), p = ve(e), { data: c } = he(e), u = (c == null ? void 0 : c.isRegistered) || !1, v = o ? a / o * 100 : 0, f = v >= 100 ? "full" : v >= 75 ? "warning" : "ok";
1198
1702
  return /* @__PURE__ */ l("div", { className: "pvx-comp-card-reg", children: [
1199
1703
  /* @__PURE__ */ n("div", { className: "pvx-comp-card-reg-info", children: /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${f}`, children: [
1200
1704
  a,
1201
1705
  "/",
1202
- i || "∞",
1706
+ o || "∞",
1203
1707
  " drivers"
1204
1708
  ] }) }),
1205
1709
  /* @__PURE__ */ n("div", { className: "pvx-comp-card-reg-action", children: u ? /* @__PURE__ */ n(
@@ -1207,7 +1711,7 @@ function Ln({ competitionId: e, regOpen: t, isFull: s, deadlinePassed: r, regCou
1207
1711
  {
1208
1712
  className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--registered",
1209
1713
  onClick: (h) => {
1210
- h.stopPropagation(), o(e);
1714
+ h.stopPropagation(), i(e);
1211
1715
  },
1212
1716
  children: "✓ Registered"
1213
1717
  }
@@ -1216,7 +1720,7 @@ function Ln({ competitionId: e, regOpen: t, isFull: s, deadlinePassed: r, regCou
1216
1720
  {
1217
1721
  className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--open",
1218
1722
  onClick: (h) => {
1219
- h.stopPropagation(), o(e);
1723
+ h.stopPropagation(), i(e);
1220
1724
  },
1221
1725
  children: "Register"
1222
1726
  }
@@ -1230,10 +1734,10 @@ function Ln({ competitionId: e, regOpen: t, isFull: s, deadlinePassed: r, regCou
1230
1734
  onClick: (h) => h.stopPropagation(),
1231
1735
  children: "Register"
1232
1736
  }
1233
- ) : /* @__PURE__ */ n("span", { className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--closed", children: s ? "Full" : "Closed" }) })
1737
+ ) : /* @__PURE__ */ n("span", { className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--closed", children: r ? "Full" : "Closed" }) })
1234
1738
  ] });
1235
1739
  }
1236
- function Sn() {
1740
+ function ot() {
1237
1741
  return /* @__PURE__ */ l("svg", { className: "pvx-comp-trophy-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
1238
1742
  /* @__PURE__ */ n("path", { d: "M6 9H4.5a2.5 2.5 0 0 1 0-5H6" }),
1239
1743
  /* @__PURE__ */ n("path", { d: "M18 9h1.5a2.5 2.5 0 0 0 0-5H18" }),
@@ -1243,24 +1747,24 @@ function Sn() {
1243
1747
  /* @__PURE__ */ n("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
1244
1748
  ] });
1245
1749
  }
1246
- function $n({ competitionId: e, className: t }) {
1750
+ function lt({ competitionId: e, className: t }) {
1247
1751
  var c, u, v;
1248
- const { data: s, isLoading: r } = Se(e), { data: a, isLoading: i } = Le(e);
1249
- if (r || i)
1250
- return /* @__PURE__ */ n(V, { message: "Loading standings..." });
1251
- if (!((c = s == null ? void 0 : s.standings) != null && c.length))
1252
- return /* @__PURE__ */ n(U, { message: "No standings data yet. Results will appear once rounds are finalised." });
1253
- const o = (a == null ? void 0 : a.type) === "hotlap", d = o ? ((u = a == null ? void 0 : a.rounds) == null ? void 0 : u.filter(ee)) || [] : ((v = a == null ? void 0 : a.rounds) == null ? void 0 : v.filter((f) => f.isFinalized)) || [], p = s.roundsClosed ?? s.roundsCompleted ?? 0;
1752
+ const { data: r, isLoading: s } = De(e), { data: a, isLoading: o } = Pe(e);
1753
+ if (s || o)
1754
+ return /* @__PURE__ */ n(W, { message: "Loading standings..." });
1755
+ if (!((c = r == null ? void 0 : r.standings) != null && c.length))
1756
+ return /* @__PURE__ */ n(_, { message: "No standings data yet. Results will appear once rounds are finalised." });
1757
+ const i = (a == null ? void 0 : a.type) === "hotlap", d = i ? ((u = a == null ? void 0 : a.rounds) == null ? void 0 : u.filter(O)) || [] : ((v = a == null ? void 0 : a.rounds) == null ? void 0 : v.filter((f) => f.isFinalized)) || [], p = r.roundsClosed ?? r.roundsCompleted ?? 0;
1254
1758
  return /* @__PURE__ */ l("div", { className: `pvx-card ${t || ""}`, children: [
1255
1759
  /* @__PURE__ */ n("div", { className: "pvx-card-header--split", children: /* @__PURE__ */ l("div", { className: "pvx-card-header-left", children: [
1256
- /* @__PURE__ */ n("h3", { className: "pvx-card-title", children: o ? "Overall Standings" : "Championship Standings" }),
1760
+ /* @__PURE__ */ n("h3", { className: "pvx-card-title", children: i ? "Overall Standings" : "Championship Standings" }),
1257
1761
  /* @__PURE__ */ l("span", { className: "pvx-standings-subtitle", children: [
1258
1762
  "After ",
1259
1763
  p,
1260
1764
  " round",
1261
1765
  p !== 1 ? "s" : "",
1262
- o ? " closed" : "",
1263
- s.countingRounds > 0 && ` (best ${s.countingRounds} count)`
1766
+ i ? " closed" : "",
1767
+ r.countingRounds > 0 && ` (best ${r.countingRounds} count)`
1264
1768
  ] })
1265
1769
  ] }) }),
1266
1770
  /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
@@ -1283,8 +1787,8 @@ function $n({ competitionId: e, className: t }) {
1283
1787
  f.roundNumber
1284
1788
  ))
1285
1789
  ] }) }),
1286
- /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: s.standings.map((f) => /* @__PURE__ */ n(
1287
- Rn,
1790
+ /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: r.standings.map((f) => /* @__PURE__ */ n(
1791
+ ct,
1288
1792
  {
1289
1793
  driver: f,
1290
1794
  columnRounds: d
@@ -1294,22 +1798,22 @@ function $n({ competitionId: e, className: t }) {
1294
1798
  ] }) })
1295
1799
  ] });
1296
1800
  }
1297
- function Rn({ driver: e, columnRounds: t }) {
1298
- var o, d, p;
1299
- const s = e.position <= 3, r = new Map(
1300
- ((o = e.roundResults) == null ? void 0 : o.map((c) => [c.roundNumber, c])) || []
1301
- ), a = ((d = e.roundResults) == null ? void 0 : d.filter((c) => c.position === 1).length) || 0, i = ((p = e.roundResults) == null ? void 0 : p.filter((c) => c.position <= 3).length) || 0;
1302
- return /* @__PURE__ */ l("tr", { className: `pvx-row ${s ? "pvx-row--podium" : ""}`, children: [
1303
- /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(me, { position: e.position }) }),
1801
+ function ct({ driver: e, columnRounds: t }) {
1802
+ var i, d, p;
1803
+ const r = e.position <= 3, s = new Map(
1804
+ ((i = e.roundResults) == null ? void 0 : i.map((c) => [c.roundNumber, c])) || []
1805
+ ), a = ((d = e.roundResults) == null ? void 0 : d.filter((c) => c.position === 1).length) || 0, o = ((p = e.roundResults) == null ? void 0 : p.filter((c) => c.position <= 3).length) || 0;
1806
+ return /* @__PURE__ */ l("tr", { className: `pvx-row ${r ? "pvx-row--podium" : ""}`, children: [
1807
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(ge, { position: e.position }) }),
1304
1808
  /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
1305
- /* @__PURE__ */ n(X, { nation: e.nation }),
1809
+ /* @__PURE__ */ n(ee, { nation: e.nation }),
1306
1810
  e.driverName
1307
1811
  ] }),
1308
1812
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: a || "-" }),
1309
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: i || "-" }),
1813
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: o || "-" }),
1310
1814
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-standings-total", children: e.totalPoints }),
1311
1815
  t.map((c) => {
1312
- const u = r.get(c.roundNumber), v = u == null ? void 0 : u.dropped;
1816
+ const u = s.get(c.roundNumber), v = u == null ? void 0 : u.dropped;
1313
1817
  return /* @__PURE__ */ n(
1314
1818
  "td",
1315
1819
  {
@@ -1327,7 +1831,7 @@ function Rn({ driver: e, columnRounds: t }) {
1327
1831
  })
1328
1832
  ] });
1329
1833
  }
1330
- const fe = [
1834
+ const Ce = [
1331
1835
  "#f59e0b",
1332
1836
  "#3b82f6",
1333
1837
  "#ef4444",
@@ -1353,109 +1857,109 @@ const fe = [
1353
1857
  "#f87171",
1354
1858
  "#38bdf8"
1355
1859
  ];
1356
- function Tn(e, t) {
1357
- return e.map((s) => ({
1358
- driverName: s.driverName,
1359
- carClass: s.carClass,
1360
- positions: s.positions.map((r, a) => {
1361
- const o = e.filter((d) => d.positions[a] != null).sort((d, p) => d.positions[a] - p.positions[a]).findIndex((d) => d.driverName === s.driverName);
1362
- return o === -1 ? null : o + 1;
1860
+ function dt(e, t) {
1861
+ return e.map((r) => ({
1862
+ driverName: r.driverName,
1863
+ carClass: r.carClass,
1864
+ positions: r.positions.map((s, a) => {
1865
+ const i = e.filter((d) => d.positions[a] != null).sort((d, p) => d.positions[a] - p.positions[a]).findIndex((d) => d.driverName === r.driverName);
1866
+ return i === -1 ? null : i + 1;
1363
1867
  })
1364
1868
  }));
1365
1869
  }
1366
- function Mn({ title: e, drivers: t, timingPoints: s }) {
1367
- const [r, a] = B(() => /* @__PURE__ */ new Set()), i = K((N) => {
1368
- a((b) => {
1369
- const L = new Set(b);
1370
- return L.has(N) ? L.delete(N) : L.add(N), L;
1870
+ function pt({ title: e, drivers: t, timingPoints: r }) {
1871
+ const [s, a] = E(() => /* @__PURE__ */ new Set()), o = H((N) => {
1872
+ a((L) => {
1873
+ const w = new Set(L);
1874
+ return w.has(N) ? w.delete(N) : w.add(N), w;
1371
1875
  });
1372
- }, []), { series: o, maxPos: d } = $(() => {
1876
+ }, []), { series: i, maxPos: d } = T(() => {
1373
1877
  let N = 1;
1374
- return { series: t.map((L, P) => {
1375
- for (const F of L.positions) F != null && F > N && (N = F);
1376
- return { ...L, colour: fe[P % fe.length] };
1878
+ return { series: t.map((w, D) => {
1879
+ for (const $ of w.positions) $ != null && $ > N && (N = $);
1880
+ return { ...w, colour: Ce[D % Ce.length] };
1377
1881
  }), maxPos: N };
1378
1882
  }, [t]);
1379
- if (!o.length || s.length < 2)
1883
+ if (!i.length || r.length < 2)
1380
1884
  return /* @__PURE__ */ l("div", { className: "pvx-positions-empty", children: [
1381
1885
  "No position data for ",
1382
1886
  e || "this race",
1383
1887
  "."
1384
1888
  ] });
1385
- const p = 800, c = 34, u = 12, v = 12, f = 22, h = 34, k = p - c - u, x = Math.max(f * (d - 1), f), g = v + x + h, y = s.length, m = (N) => c + (y === 1 ? 0 : N / (y - 1) * k), w = (N) => v + (d === 1 ? 0 : (N - 1) / (d - 1) * x), S = (N) => {
1386
- const b = [];
1387
- let L = [];
1388
- return N.forEach((P, F) => {
1389
- P == null ? L.length && (b.push(L), L = []) : L.push([m(F), w(P)]);
1390
- }), L.length && b.push(L), b;
1391
- }, R = r.size > 0, T = Math.ceil(y / 24);
1889
+ const p = 800, c = 34, u = 12, v = 12, f = 22, h = 34, y = p - c - u, x = Math.max(f * (d - 1), f), m = v + x + h, b = r.length, g = (N) => c + (b === 1 ? 0 : N / (b - 1) * y), k = (N) => v + (d === 1 ? 0 : (N - 1) / (d - 1) * x), C = (N) => {
1890
+ const L = [];
1891
+ let w = [];
1892
+ return N.forEach((D, $) => {
1893
+ D == null ? w.length && (L.push(w), w = []) : w.push([g($), k(D)]);
1894
+ }), w.length && L.push(w), L;
1895
+ }, P = s.size > 0, A = Math.ceil(b / 24);
1392
1896
  return /* @__PURE__ */ l("div", { className: "pvx-positions-chart", children: [
1393
1897
  e && /* @__PURE__ */ n("div", { className: "pvx-positions-title", children: e }),
1394
1898
  /* @__PURE__ */ l(
1395
1899
  "svg",
1396
1900
  {
1397
1901
  className: "pvx-positions-svg",
1398
- viewBox: `0 0 ${p} ${g}`,
1902
+ viewBox: `0 0 ${p} ${m}`,
1399
1903
  preserveAspectRatio: "xMidYMid meet",
1400
1904
  role: "img",
1401
1905
  "aria-label": `Race position progression${e ? ` — ${e}` : ""}`,
1402
1906
  children: [
1403
- Array.from({ length: d }, (N, b) => b + 1).map((N) => /* @__PURE__ */ l("g", { children: [
1907
+ Array.from({ length: d }, (N, L) => L + 1).map((N) => /* @__PURE__ */ l("g", { children: [
1404
1908
  /* @__PURE__ */ n(
1405
1909
  "line",
1406
1910
  {
1407
1911
  className: "pvx-positions-grid",
1408
1912
  x1: c,
1409
- y1: w(N),
1913
+ y1: k(N),
1410
1914
  x2: p - u,
1411
- y2: w(N)
1915
+ y2: k(N)
1412
1916
  }
1413
1917
  ),
1414
- /* @__PURE__ */ l("text", { className: "pvx-positions-axis", x: c - 6, y: w(N) + 3, textAnchor: "end", children: [
1918
+ /* @__PURE__ */ l("text", { className: "pvx-positions-axis", x: c - 6, y: k(N) + 3, textAnchor: "end", children: [
1415
1919
  "P",
1416
1920
  N
1417
1921
  ] })
1418
1922
  ] }, `y${N}`)),
1419
- s.map((N, b) => b % T === 0 && /* @__PURE__ */ n(
1923
+ r.map((N, L) => L % A === 0 && /* @__PURE__ */ n(
1420
1924
  "text",
1421
1925
  {
1422
1926
  className: "pvx-positions-axis",
1423
- x: m(b),
1424
- y: g - h + 16,
1927
+ x: g(L),
1928
+ y: m - h + 16,
1425
1929
  textAnchor: "middle",
1426
1930
  children: N.label
1427
1931
  },
1428
- `x${b}`
1932
+ `x${L}`
1429
1933
  )),
1430
- o.map((N) => {
1431
- const b = R && !r.has(N.driverName);
1432
- return /* @__PURE__ */ l("g", { opacity: b ? 0.12 : 1, children: [
1433
- S(N.positions).map((L, P) => /* @__PURE__ */ n(
1934
+ i.map((N) => {
1935
+ const L = P && !s.has(N.driverName);
1936
+ return /* @__PURE__ */ l("g", { opacity: L ? 0.12 : 1, children: [
1937
+ C(N.positions).map((w, D) => /* @__PURE__ */ n(
1434
1938
  "polyline",
1435
1939
  {
1436
1940
  fill: "none",
1437
1941
  stroke: N.colour,
1438
- strokeWidth: b ? 1 : 2,
1439
- points: L.map(([F, ne]) => `${F},${ne}`).join(" ")
1942
+ strokeWidth: L ? 1 : 2,
1943
+ points: w.map(([$, j]) => `${$},${j}`).join(" ")
1440
1944
  },
1441
- P
1945
+ D
1442
1946
  )),
1443
- !b && N.positions.map((L, P) => L != null && /* @__PURE__ */ n("circle", { cx: m(P), cy: w(L), r: 2.4, fill: N.colour, children: /* @__PURE__ */ n("title", { children: `${N.driverName} — ${s[P].label}: P${L}` }) }, P))
1947
+ !L && N.positions.map((w, D) => w != null && /* @__PURE__ */ n("circle", { cx: g(D), cy: k(w), r: 2.4, fill: N.colour, children: /* @__PURE__ */ n("title", { children: `${N.driverName} — ${r[D].label}: P${w}` }) }, D))
1444
1948
  ] }, N.driverName);
1445
1949
  })
1446
1950
  ]
1447
1951
  }
1448
1952
  ),
1449
1953
  /* @__PURE__ */ l("div", { className: "pvx-positions-legend", children: [
1450
- o.map((N) => {
1451
- const b = R && !r.has(N.driverName);
1954
+ i.map((N) => {
1955
+ const L = P && !s.has(N.driverName);
1452
1956
  return /* @__PURE__ */ l(
1453
1957
  "button",
1454
1958
  {
1455
1959
  type: "button",
1456
1960
  className: "pvx-positions-legend-item",
1457
- style: { opacity: b ? 0.4 : 1 },
1458
- onClick: () => i(N.driverName),
1961
+ style: { opacity: L ? 0.4 : 1 },
1962
+ onClick: () => o(N.driverName),
1459
1963
  children: [
1460
1964
  /* @__PURE__ */ n("span", { className: "pvx-positions-swatch", style: { background: N.colour } }),
1461
1965
  N.driverName
@@ -1464,7 +1968,7 @@ function Mn({ title: e, drivers: t, timingPoints: s }) {
1464
1968
  N.driverName
1465
1969
  );
1466
1970
  }),
1467
- R && /* @__PURE__ */ n(
1971
+ P && /* @__PURE__ */ n(
1468
1972
  "button",
1469
1973
  {
1470
1974
  type: "button",
@@ -1476,108 +1980,108 @@ function Mn({ title: e, drivers: t, timingPoints: s }) {
1476
1980
  ] })
1477
1981
  ] });
1478
1982
  }
1479
- function Dn({ positions: e }) {
1480
- const t = (e == null ? void 0 : e.timingPoints) || [], s = (e == null ? void 0 : e.drivers) || [], r = $(() => {
1481
- const a = [...new Set(s.map((i) => i.carClass).filter(Boolean))];
1482
- return a.length <= 1 ? [{ title: a[0] || null, drivers: s }] : a.sort().map((i) => ({
1483
- title: i,
1484
- drivers: Tn(
1485
- s.filter((o) => o.carClass === i),
1983
+ function ut({ positions: e }) {
1984
+ const t = (e == null ? void 0 : e.timingPoints) || [], r = (e == null ? void 0 : e.drivers) || [], s = T(() => {
1985
+ const a = [...new Set(r.map((o) => o.carClass).filter(Boolean))];
1986
+ return a.length <= 1 ? [{ title: a[0] || null, drivers: r }] : a.sort().map((o) => ({
1987
+ title: o,
1988
+ drivers: dt(
1989
+ r.filter((i) => i.carClass === o),
1486
1990
  t.length
1487
1991
  )
1488
1992
  }));
1489
- }, [s, t.length]);
1490
- return !t.length || !s.length ? /* @__PURE__ */ n("div", { className: "pvx-positions-empty", children: "No position data available for this race." }) : /* @__PURE__ */ n("div", { className: "pvx-positions", children: r.map((a, i) => /* @__PURE__ */ n(
1491
- Mn,
1993
+ }, [r, t.length]);
1994
+ return !t.length || !r.length ? /* @__PURE__ */ n("div", { className: "pvx-positions-empty", children: "No position data available for this race." }) : /* @__PURE__ */ n("div", { className: "pvx-positions", children: s.map((a, o) => /* @__PURE__ */ n(
1995
+ pt,
1492
1996
  {
1493
- title: r.length > 1 ? a.title : null,
1997
+ title: s.length > 1 ? a.title : null,
1494
1998
  drivers: a.drivers,
1495
1999
  timingPoints: t
1496
2000
  },
1497
- a.title || i
2001
+ a.title || o
1498
2002
  )) });
1499
2003
  }
1500
- function Rt({ competitionId: e, roundNumber: t, className: s }) {
2004
+ function pr({ competitionId: e, roundNumber: t, className: r }) {
1501
2005
  var p;
1502
- const { data: r, isLoading: a } = nn(e, t);
2006
+ const { data: s, isLoading: a } = dn(e, t);
1503
2007
  if (a)
1504
- return /* @__PURE__ */ n(V, { message: "Loading results..." });
1505
- if (!r)
1506
- return /* @__PURE__ */ n(U, { message: "No results for this round." });
1507
- const o = (r.sessions || []).find((c) => c.type === "RACE"), d = (p = o == null ? void 0 : o.results) == null ? void 0 : p.filter((c) => c.position <= 3).sort((c, u) => c.position - u.position);
1508
- return /* @__PURE__ */ l("div", { className: `pvx-round-results ${s || ""}`, children: [
2008
+ return /* @__PURE__ */ n(W, { message: "Loading results..." });
2009
+ if (!s)
2010
+ return /* @__PURE__ */ n(_, { message: "No results for this round." });
2011
+ const i = (s.sessions || []).find((c) => c.type === "RACE"), d = (p = i == null ? void 0 : i.results) == null ? void 0 : p.filter((c) => c.position <= 3).sort((c, u) => c.position - u.position);
2012
+ return /* @__PURE__ */ l("div", { className: `pvx-round-results ${r || ""}`, children: [
1509
2013
  /* @__PURE__ */ l("div", { className: "pvx-round-results-header", children: [
1510
2014
  /* @__PURE__ */ l("div", { children: [
1511
2015
  /* @__PURE__ */ l("h4", { className: "pvx-round-results-title", children: [
1512
2016
  "Round ",
1513
- r.roundNumber,
1514
- r.track ? `: ${r.track}` : ""
2017
+ s.roundNumber,
2018
+ s.track ? `: ${s.track}` : ""
1515
2019
  ] }),
1516
- r.startTime && /* @__PURE__ */ n("p", { className: "pvx-round-results-date", children: new Date(r.startTime).toLocaleDateString("en-GB", {
2020
+ s.startTime && /* @__PURE__ */ n("p", { className: "pvx-round-results-date", children: new Date(s.startTime).toLocaleDateString("en-GB", {
1517
2021
  day: "numeric",
1518
2022
  month: "long",
1519
2023
  year: "numeric"
1520
2024
  }) })
1521
2025
  ] }),
1522
2026
  (d == null ? void 0 : d.length) > 0 && /* @__PURE__ */ n("div", { className: "pvx-round-podium-summary", children: d.map((c) => /* @__PURE__ */ l("span", { className: "pvx-round-podium-item", children: [
1523
- /* @__PURE__ */ n("span", { children: he[c.position - 1] }),
2027
+ /* @__PURE__ */ n("span", { children: xe[c.position - 1] }),
1524
2028
  /* @__PURE__ */ n("span", { children: c.driverName })
1525
2029
  ] }, c.driverId)) })
1526
2030
  ] }),
1527
- /* @__PURE__ */ n(ve, { round: r, competitionId: e })
2031
+ /* @__PURE__ */ n(ye, { round: s, competitionId: e })
1528
2032
  ] });
1529
2033
  }
1530
- function ve({ round: e, competitionId: t, className: s }) {
1531
- var h, k, x, g, y, m;
1532
- const [r, a] = B(null), i = (e == null ? void 0 : e.sessions) || [];
1533
- if (!i.length)
1534
- return /* @__PURE__ */ n(U, { message: "No session data for this round." });
1535
- const { data: o } = an(
2034
+ function ye({ round: e, competitionId: t, className: r }) {
2035
+ var h, y, x, m, b, g;
2036
+ const [s, a] = E(null), o = (e == null ? void 0 : e.sessions) || [];
2037
+ if (!o.length)
2038
+ return /* @__PURE__ */ n(_, { message: "No session data for this round." });
2039
+ const { data: i } = mn(
1536
2040
  t,
1537
2041
  e == null ? void 0 : e.roundNumber,
1538
2042
  {}
1539
- ), d = i.some((w) => w.type === "RACE"), { data: p } = on(
2043
+ ), d = o.some((k) => k.type === "RACE"), { data: p } = vn(
1540
2044
  t,
1541
2045
  e == null ? void 0 : e.roundNumber,
1542
2046
  { enabled: !!t && d }
1543
- ), c = r || ((h = i.find((w) => w.type === "RACE")) == null ? void 0 : h.type) || ((k = i[0]) == null ? void 0 : k.type), u = i.find((w) => w.type === c) || i[0], v = ((g = (x = o == null ? void 0 : o.sessions) == null ? void 0 : x.find((w) => w.type === c)) == null ? void 0 : g.drivers) || null, f = (u == null ? void 0 : u.type) === "RACE" && ((y = p == null ? void 0 : p.timingPoints) == null ? void 0 : y.length) > 0 && ((m = p == null ? void 0 : p.drivers) == null ? void 0 : m.length) > 0;
1544
- return /* @__PURE__ */ l("div", { className: s || "", children: [
2047
+ ), c = s || ((h = o.find((k) => k.type === "RACE")) == null ? void 0 : h.type) || ((y = o[0]) == null ? void 0 : y.type), u = o.find((k) => k.type === c) || o[0], v = ((m = (x = i == null ? void 0 : i.sessions) == null ? void 0 : x.find((k) => k.type === c)) == null ? void 0 : m.drivers) || null, f = (u == null ? void 0 : u.type) === "RACE" && ((b = p == null ? void 0 : p.timingPoints) == null ? void 0 : b.length) > 0 && ((g = p == null ? void 0 : p.drivers) == null ? void 0 : g.length) > 0;
2048
+ return /* @__PURE__ */ l("div", { className: r || "", children: [
1545
2049
  /* @__PURE__ */ n(
1546
- xn,
2050
+ Tn,
1547
2051
  {
1548
- sessions: i,
2052
+ sessions: o,
1549
2053
  activeSession: c,
1550
2054
  onSelect: a
1551
2055
  }
1552
2056
  ),
1553
- /* @__PURE__ */ n(Pn, { session: u, sessionLaps: v }),
2057
+ /* @__PURE__ */ n(ht, { session: u, sessionLaps: v }),
1554
2058
  f && /* @__PURE__ */ l("div", { className: "pvx-positions-section", children: [
1555
2059
  /* @__PURE__ */ n("div", { className: "pvx-positions-section-title", children: "Race Positions" }),
1556
- /* @__PURE__ */ n(Dn, { positions: p })
2060
+ /* @__PURE__ */ n(ut, { positions: p })
1557
2061
  ] })
1558
2062
  ] });
1559
2063
  }
1560
- function Pn({ session: e, sessionLaps: t }) {
2064
+ function ht({ session: e, sessionLaps: t }) {
1561
2065
  var u;
1562
- const s = e.type === "RACE", [r, a] = B(null);
2066
+ const r = e.type === "RACE", [s, a] = E(null);
1563
2067
  if (!((u = e.results) != null && u.length))
1564
- return /* @__PURE__ */ n(U, { message: `No results for ${e.type}.` });
1565
- const i = Nn(e.results), o = s ? 7 : 4, d = [...new Set(e.results.map((v) => v.carClass).filter(Boolean))], p = d.length > 1, c = (v, f, h) => {
1566
- var g;
1567
- const k = (g = t == null ? void 0 : t[v.driverId]) == null ? void 0 : g.laps, x = r === v.driverId && !!k;
2068
+ return /* @__PURE__ */ n(_, { message: `No results for ${e.type}.` });
2069
+ const o = Pn(e.results), i = r ? 7 : 4, d = [...new Set(e.results.map((v) => v.carClass).filter(Boolean))], p = d.length > 1, c = (v, f, h) => {
2070
+ var m;
2071
+ const y = (m = t == null ? void 0 : t[v.driverId]) == null ? void 0 : m.laps, x = s === v.driverId && !!y;
1568
2072
  return /* @__PURE__ */ n(
1569
- An,
2073
+ mt,
1570
2074
  {
1571
2075
  result: v,
1572
- isRace: s,
1573
- fastestSplits: i,
2076
+ isRace: r,
2077
+ fastestSplits: o,
1574
2078
  rowIndex: f,
1575
2079
  displayPosition: h,
1576
- hasLapDetail: !!k,
2080
+ hasLapDetail: !!y,
1577
2081
  isExpanded: x,
1578
2082
  onToggle: () => a(x ? null : v.driverId),
1579
- driverLaps: x ? k : null,
1580
- colCount: o
2083
+ driverLaps: x ? y : null,
2084
+ colCount: i
1581
2085
  },
1582
2086
  v.driverId || f
1583
2087
  );
@@ -1588,36 +2092,36 @@ function Pn({ session: e, sessionLaps: t }) {
1588
2092
  /* @__PURE__ */ n("th", { className: "pvx-th", children: "Driver" }),
1589
2093
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Car" }),
1590
2094
  /* @__PURE__ */ n("th", { className: "pvx-th", children: "Best Lap" }),
1591
- s && /* @__PURE__ */ l(_, { children: [
2095
+ r && /* @__PURE__ */ l(B, { children: [
1592
2096
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Laps" }),
1593
2097
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Time / Gap" }),
1594
2098
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--center", children: "Points" })
1595
2099
  ] })
1596
2100
  ] }) }),
1597
2101
  /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: p ? d.sort().map((v) => {
1598
- const f = e.results.filter((h) => h.carClass === v).sort((h, k) => (h.classPosition ?? h.position) - (k.classPosition ?? k.position));
2102
+ const f = e.results.filter((h) => h.carClass === v).sort((h, y) => (h.classPosition ?? h.position) - (y.classPosition ?? y.position));
1599
2103
  return [
1600
- /* @__PURE__ */ n("tr", { className: "pvx-row pvx-row--class-header", children: /* @__PURE__ */ n("td", { colSpan: o, className: "pvx-td pvx-td--class-header", children: v }) }, `hdr-${v}`),
2104
+ /* @__PURE__ */ n("tr", { className: "pvx-row pvx-row--class-header", children: /* @__PURE__ */ n("td", { colSpan: i, className: "pvx-td pvx-td--class-header", children: v }) }, `hdr-${v}`),
1601
2105
  ...f.map(
1602
- (h, k) => c(h, k, h.classPosition ?? h.position)
2106
+ (h, y) => c(h, y, h.classPosition ?? h.position)
1603
2107
  )
1604
2108
  ];
1605
2109
  }) : e.results.map((v, f) => c(v, f)) })
1606
2110
  ] }) });
1607
2111
  }
1608
- function An({ result: e, isRace: t, fastestSplits: s, rowIndex: r, displayPosition: a, hasLapDetail: i, isExpanded: o, onToggle: d, driverLaps: p, colCount: c }) {
2112
+ function mt({ result: e, isRace: t, fastestSplits: r, rowIndex: s, displayPosition: a, hasLapDetail: o, isExpanded: i, onToggle: d, driverLaps: p, colCount: c }) {
1609
2113
  const u = a ?? e.position, v = u <= 3;
1610
- return /* @__PURE__ */ l(_, { children: [
2114
+ return /* @__PURE__ */ l(B, { children: [
1611
2115
  /* @__PURE__ */ l(
1612
2116
  "tr",
1613
2117
  {
1614
- className: `pvx-row ${v ? "pvx-row--podium" : ""} ${i ? "pvx-row--expandable" : ""}`,
1615
- onClick: i ? d : void 0,
1616
- style: i ? { cursor: "pointer" } : void 0,
2118
+ className: `pvx-row ${v ? "pvx-row--podium" : ""} ${o ? "pvx-row--expandable" : ""}`,
2119
+ onClick: o ? d : void 0,
2120
+ style: o ? { cursor: "pointer" } : void 0,
1617
2121
  children: [
1618
- /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(me, { position: u }) }),
2122
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(ge, { position: u }) }),
1619
2123
  /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
1620
- /* @__PURE__ */ n(X, { nation: e.nation }),
2124
+ /* @__PURE__ */ n(ee, { nation: e.nation }),
1621
2125
  e.driverName,
1622
2126
  e.carNumber != null && /* @__PURE__ */ l("span", { className: "pvx-car-number", children: [
1623
2127
  "#",
@@ -1627,16 +2131,16 @@ function An({ result: e, isRace: t, fastestSplits: s, rowIndex: r, displayPositi
1627
2131
  ] }),
1628
2132
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: I(e.carId) }),
1629
2133
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono", children: /* @__PURE__ */ n(
1630
- In,
2134
+ xt,
1631
2135
  {
1632
2136
  bestLap: e.bestLapFormatted,
1633
2137
  hasBestLap: e.hasBestLap,
1634
2138
  splits: e.splits,
1635
- fastestSplits: s,
1636
- showAbove: r <= 1
2139
+ fastestSplits: r,
2140
+ showAbove: s <= 1
1637
2141
  }
1638
2142
  ) }),
1639
- t && /* @__PURE__ */ l(_, { children: [
2143
+ t && /* @__PURE__ */ l(B, { children: [
1640
2144
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: e.lapsCompleted }),
1641
2145
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: e.position === 1 ? e.totalTime || "-" : e.gap || "-" }),
1642
2146
  /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--center", children: [
@@ -1652,11 +2156,11 @@ function An({ result: e, isRace: t, fastestSplits: s, rowIndex: r, displayPositi
1652
2156
  ]
1653
2157
  }
1654
2158
  ),
1655
- o && p && /* @__PURE__ */ n("tr", { className: "pvx-row pvx-row--lap-detail", children: /* @__PURE__ */ n("td", { colSpan: c, className: "pvx-td pvx-td--lap-detail", children: /* @__PURE__ */ n(Bn, { laps: p }) }) })
2159
+ i && p && /* @__PURE__ */ n("tr", { className: "pvx-row pvx-row--lap-detail", children: /* @__PURE__ */ n("td", { colSpan: c, className: "pvx-td pvx-td--lap-detail", children: /* @__PURE__ */ n(vt, { laps: p }) }) })
1656
2160
  ] });
1657
2161
  }
1658
- function Bn({ laps: e }) {
1659
- const t = Math.min(...e.filter((s) => s.valid && s.timeMs > 0).map((s) => s.timeMs));
2162
+ function vt({ laps: e }) {
2163
+ const t = Math.min(...e.filter((r) => r.valid && r.timeMs > 0).map((r) => r.timeMs));
1660
2164
  return /* @__PURE__ */ l("table", { className: "pvx-table pvx-table--laps", children: [
1661
2165
  /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
1662
2166
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "Lap" }),
@@ -1665,41 +2169,41 @@ function Bn({ laps: e }) {
1665
2169
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
1666
2170
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" })
1667
2171
  ] }) }),
1668
- /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: e.map((s) => {
2172
+ /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: e.map((r) => {
1669
2173
  var a;
1670
- const r = s.valid && s.timeMs === t;
1671
- return /* @__PURE__ */ l("tr", { className: `pvx-row ${s.valid ? "" : "pvx-row--invalid"} ${r ? "pvx-row--fastest" : ""}`, children: [
1672
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted", children: s.lap }),
1673
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono", children: s.time }),
1674
- (s.splits || []).map((i, o) => /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: i }, o)),
1675
- Array.from({ length: Math.max(0, 3 - (((a = s.splits) == null ? void 0 : a.length) || 0)) }).map((i, o) => /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm" }, `pad-${o}`))
1676
- ] }, s.lap);
2174
+ const s = r.valid && r.timeMs === t;
2175
+ return /* @__PURE__ */ l("tr", { className: `pvx-row ${r.valid ? "" : "pvx-row--invalid"} ${s ? "pvx-row--fastest" : ""}`, children: [
2176
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted", children: r.lap }),
2177
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono", children: r.time }),
2178
+ (r.splits || []).map((o, i) => /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: o }, i)),
2179
+ Array.from({ length: Math.max(0, 3 - (((a = r.splits) == null ? void 0 : a.length) || 0)) }).map((o, i) => /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm" }, `pad-${i}`))
2180
+ ] }, r.lap);
1677
2181
  }) })
1678
2182
  ] });
1679
2183
  }
1680
- function In({ bestLap: e, hasBestLap: t, splits: s, fastestSplits: r, showAbove: a }) {
2184
+ function xt({ bestLap: e, hasBestLap: t, splits: r, fastestSplits: s, showAbove: a }) {
1681
2185
  return e ? /* @__PURE__ */ l("span", { className: `pvx-best-lap-cell ${t ? "pvx-best-lap-cell--fastest" : ""}`, children: [
1682
2186
  /* @__PURE__ */ n("span", { className: "pvx-best-lap-time", children: e }),
1683
- (s == null ? void 0 : s.length) > 0 && /* @__PURE__ */ n("span", { className: "pvx-splits-tooltip-anchor", children: /* @__PURE__ */ n("span", { className: `pvx-splits-tooltip ${a ? "" : "pvx-splits-tooltip--above"}`, children: s.map((i, o) => {
1684
- const d = r && i === r[o];
2187
+ (r == null ? void 0 : r.length) > 0 && /* @__PURE__ */ n("span", { className: "pvx-splits-tooltip-anchor", children: /* @__PURE__ */ n("span", { className: `pvx-splits-tooltip ${a ? "" : "pvx-splits-tooltip--above"}`, children: r.map((o, i) => {
2188
+ const d = s && o === s[i];
1685
2189
  return /* @__PURE__ */ l("span", { className: "pvx-splits-tooltip-row", children: [
1686
2190
  /* @__PURE__ */ l("span", { className: "pvx-splits-tooltip-label", children: [
1687
2191
  "S",
1688
- o + 1
2192
+ i + 1
1689
2193
  ] }),
1690
- /* @__PURE__ */ n("span", { className: d ? "pvx-splits-tooltip-best" : "", children: i })
1691
- ] }, o);
2194
+ /* @__PURE__ */ n("span", { className: d ? "pvx-splits-tooltip-best" : "", children: o })
2195
+ ] }, i);
1692
2196
  }) }) })
1693
2197
  ] }) : /* @__PURE__ */ n("span", { className: "pvx-td--muted", children: "-" });
1694
2198
  }
1695
- function Tt({ competitionId: e, className: t }) {
1696
- const { getSteamId: s } = C(), { data: r, isLoading: a } = $e(e), i = s();
2199
+ function ur({ competitionId: e, className: t }) {
2200
+ const { getSteamId: r } = S(), { data: s, isLoading: a } = Ae(e), o = r();
1697
2201
  if (a)
1698
- return /* @__PURE__ */ n(V, { message: "Loading drivers..." });
1699
- const o = (r == null ? void 0 : r.drivers) || (r == null ? void 0 : r.entries) || [];
1700
- return o.length ? /* @__PURE__ */ n("div", { className: `pvx-entry-grid ${t || ""}`, children: o.map((d) => {
2202
+ return /* @__PURE__ */ n(W, { message: "Loading drivers..." });
2203
+ const i = (s == null ? void 0 : s.drivers) || (s == null ? void 0 : s.entries) || [];
2204
+ return i.length ? /* @__PURE__ */ n("div", { className: `pvx-entry-grid ${t || ""}`, children: i.map((d) => {
1701
2205
  var c, u;
1702
- const p = i && d.steamId === i;
2206
+ const p = o && d.steamId === o;
1703
2207
  return /* @__PURE__ */ l("div", { className: `pvx-entry-card ${p ? "pvx-entry-card--you" : ""}`, children: [
1704
2208
  d.avatarUrl ? /* @__PURE__ */ n(
1705
2209
  "img",
@@ -1714,24 +2218,24 @@ function Tt({ competitionId: e, className: t }) {
1714
2218
  p && /* @__PURE__ */ n("span", { className: "pvx-entry-you", children: " (you)" })
1715
2219
  ] })
1716
2220
  ] }, d.steamId || d.driverId);
1717
- }) }) : /* @__PURE__ */ n(U, { message: "No drivers registered yet." });
2221
+ }) }) : /* @__PURE__ */ n(_, { message: "No drivers registered yet." });
1718
2222
  }
1719
- function Mt({
2223
+ function hr({
1720
2224
  competitionId: e,
1721
2225
  driverData: t,
1722
- className: s,
1723
- children: r
2226
+ className: r,
2227
+ children: s
1724
2228
  }) {
1725
- const { data: a, isLoading: i } = le(e), { isPowerMode: o } = ce(), d = de(e), p = Re(e), c = Te(e), u = (a == null ? void 0 : a.isRegistered) || !1, v = i || p.isPending || c.isPending, f = p.error || c.error || null, h = () => {
1726
- o && p.mutate(t || {});
1727
- }, k = () => {
1728
- o && c.mutate();
2229
+ const { data: a, isLoading: o } = he(e), { isPowerMode: i } = me(), d = ve(e), p = Ee(e), c = Be(e), u = (a == null ? void 0 : a.isRegistered) || !1, v = o || p.isPending || c.isPending, f = p.error || c.error || null, h = () => {
2230
+ i && p.mutate(t || {});
2231
+ }, y = () => {
2232
+ i && c.mutate();
1729
2233
  };
1730
- return typeof r == "function" ? r({ isRegistered: u, isLoading: v, register: h, withdraw: k, error: f, isPowerMode: o, registrationUrl: d }) : o ? /* @__PURE__ */ n(
2234
+ return typeof s == "function" ? s({ isRegistered: u, isLoading: v, register: h, withdraw: y, error: f, isPowerMode: i, registrationUrl: d }) : i ? /* @__PURE__ */ n(
1731
2235
  "button",
1732
2236
  {
1733
- className: `pvx-comp-register-btn ${s || ""}`,
1734
- onClick: u ? k : h,
2237
+ className: `pvx-comp-register-btn ${r || ""}`,
2238
+ onClick: u ? y : h,
1735
2239
  disabled: v,
1736
2240
  children: v ? "Loading..." : u ? "Withdraw" : "Register"
1737
2241
  }
@@ -1741,49 +2245,49 @@ function Mt({
1741
2245
  href: d,
1742
2246
  target: "_blank",
1743
2247
  rel: "noopener noreferrer",
1744
- className: `pvx-comp-register-link ${s || ""}`,
2248
+ className: `pvx-comp-register-link ${r || ""}`,
1745
2249
  children: u ? "View Registration" : "Register on PitVox"
1746
2250
  }
1747
2251
  );
1748
2252
  }
1749
- function Dt({ competitionId: e, registration: t, onWithdrawSuccess: s, className: r }) {
1750
- const { getSteamId: a } = C(), { isPowerMode: i } = ce(), o = de(e), { data: d, isLoading: p } = le(e), { data: c, isLoading: u } = $e(e), v = Re(e), f = Te(e), h = a(), k = (d == null ? void 0 : d.isRegistered) || !1, x = (c == null ? void 0 : c.drivers) || (c == null ? void 0 : c.entries) || [], g = t || {}, y = x.length || g.currentCount || 0, m = g.maxParticipants && y >= g.maxParticipants, w = g.deadline && new Date(g.deadline) < /* @__PURE__ */ new Date(), S = g.isOpen && !w && !m;
1751
- return p || u ? /* @__PURE__ */ n(V, { message: "Loading registration..." }) : k ? /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${r || ""}`, children: /* @__PURE__ */ n(
1752
- Fn,
2253
+ function mr({ competitionId: e, registration: t, onWithdrawSuccess: r, className: s }) {
2254
+ const { getSteamId: a } = S(), { isPowerMode: o } = me(), i = ve(e), { data: d, isLoading: p } = he(e), { data: c, isLoading: u } = Ae(e), v = Ee(e), f = Be(e), h = a(), y = (d == null ? void 0 : d.isRegistered) || !1, x = (c == null ? void 0 : c.drivers) || (c == null ? void 0 : c.entries) || [], m = t || {}, b = x.length || m.currentCount || 0, g = m.maxParticipants && b >= m.maxParticipants, k = m.deadline && new Date(m.deadline) < /* @__PURE__ */ new Date(), C = m.isOpen && !k && !g;
2255
+ return p || u ? /* @__PURE__ */ n(W, { message: "Loading registration..." }) : y ? /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: /* @__PURE__ */ n(
2256
+ ft,
1753
2257
  {
1754
2258
  competitionId: e,
1755
2259
  drivers: x,
1756
2260
  steamId: h,
1757
- isPowerMode: i,
1758
- registrationUrl: o,
2261
+ isPowerMode: o,
2262
+ registrationUrl: i,
1759
2263
  withdrawMutation: f,
1760
- onWithdrawSuccess: s,
1761
- registration: g
2264
+ onWithdrawSuccess: r,
2265
+ registration: m
1762
2266
  }
1763
- ) }) : S ? h ? i ? /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${r || ""}`, children: /* @__PURE__ */ n(
1764
- Un,
2267
+ ) }) : C ? h ? o ? /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: /* @__PURE__ */ n(
2268
+ gt,
1765
2269
  {
1766
2270
  competitionId: e,
1767
2271
  registerMutation: v,
1768
- registration: g
2272
+ registration: m
1769
2273
  }
1770
- ) }) : /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${r || ""}`, children: /* @__PURE__ */ n("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Register on PitVox" }) }) : /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${r || ""}`, children: i ? /* @__PURE__ */ n("div", { className: "pvx-reg-status-msg", children: "Sign in to register for this competition." }) : /* @__PURE__ */ n("div", { className: "pvx-reg-status-msg", children: /* @__PURE__ */ n("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Register on PitVox" }) }) }) : /* @__PURE__ */ l("div", { className: `pvx-reg-panel ${r || ""}`, children: [
1771
- /* @__PURE__ */ n("div", { className: "pvx-reg-status-msg", children: m ? "Registration is full." : w ? "Registration deadline has passed." : "Registration is closed." }),
1772
- x.length > 0 && /* @__PURE__ */ n(Ue, { drivers: x, steamId: h })
2274
+ ) }) : /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: /* @__PURE__ */ n("a", { href: i, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Register on PitVox" }) }) : /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: o ? /* @__PURE__ */ n("div", { className: "pvx-reg-status-msg", children: "Sign in to register for this competition." }) : /* @__PURE__ */ n("div", { className: "pvx-reg-status-msg", children: /* @__PURE__ */ n("a", { href: i, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Register on PitVox" }) }) }) : /* @__PURE__ */ l("div", { className: `pvx-reg-panel ${s || ""}`, children: [
2275
+ /* @__PURE__ */ n("div", { className: "pvx-reg-status-msg", children: g ? "Registration is full." : k ? "Registration deadline has passed." : "Registration is closed." }),
2276
+ x.length > 0 && /* @__PURE__ */ n(Ke, { drivers: x, steamId: h })
1773
2277
  ] });
1774
2278
  }
1775
- function Un({ competitionId: e, registerMutation: t, registration: s }) {
1776
- const [r, a] = B(""), [i, o] = B("intermediate"), [d, p] = B(""), c = (h) => {
2279
+ function gt({ competitionId: e, registerMutation: t, registration: r }) {
2280
+ const [s, a] = E(""), [o, i] = E("intermediate"), [d, p] = E(""), c = (h) => {
1777
2281
  h.preventDefault(), t.mutate({
1778
- discordUsername: r || void 0,
1779
- experience: i,
2282
+ discordUsername: s || void 0,
2283
+ experience: o,
1780
2284
  comments: d || void 0
1781
2285
  });
1782
- }, u = s || {}, v = u.currentCount || 0, f = u.maxParticipants;
2286
+ }, u = r || {}, v = u.currentCount || 0, f = u.maxParticipants;
1783
2287
  return /* @__PURE__ */ l("form", { className: "pvx-reg-form", onSubmit: c, children: [
1784
2288
  /* @__PURE__ */ l("div", { className: "pvx-reg-form-header", children: [
1785
2289
  /* @__PURE__ */ n("h3", { className: "pvx-reg-form-title", children: "Register" }),
1786
- f && /* @__PURE__ */ n(Fe, { count: v, max: f })
2290
+ f && /* @__PURE__ */ n(He, { count: v, max: f })
1787
2291
  ] }),
1788
2292
  t.error && /* @__PURE__ */ n("div", { className: "pvx-reg-error", children: t.error.message || "Registration failed" }),
1789
2293
  /* @__PURE__ */ l("div", { className: "pvx-reg-field", children: [
@@ -1798,7 +2302,7 @@ function Un({ competitionId: e, registerMutation: t, registration: s }) {
1798
2302
  type: "text",
1799
2303
  className: "pvx-reg-input",
1800
2304
  placeholder: "e.g. username",
1801
- value: r,
2305
+ value: s,
1802
2306
  onChange: (h) => a(h.target.value)
1803
2307
  }
1804
2308
  )
@@ -1810,8 +2314,8 @@ function Un({ competitionId: e, registerMutation: t, registration: s }) {
1810
2314
  {
1811
2315
  id: `pvx-exp-${e}`,
1812
2316
  className: "pvx-reg-select",
1813
- value: i,
1814
- onChange: (h) => o(h.target.value),
2317
+ value: o,
2318
+ onChange: (h) => i(h.target.value),
1815
2319
  children: [
1816
2320
  /* @__PURE__ */ n("option", { value: "beginner", children: "Beginner" }),
1817
2321
  /* @__PURE__ */ n("option", { value: "intermediate", children: "Intermediate" }),
@@ -1848,22 +2352,22 @@ function Un({ competitionId: e, registerMutation: t, registration: s }) {
1848
2352
  ) })
1849
2353
  ] });
1850
2354
  }
1851
- function Fn({ competitionId: e, drivers: t, steamId: s, isPowerMode: r, registrationUrl: a, withdrawMutation: i, onWithdrawSuccess: o, registration: d }) {
1852
- const [p, c] = B(!1), u = () => {
1853
- i.mutate(void 0, {
2355
+ function ft({ competitionId: e, drivers: t, steamId: r, isPowerMode: s, registrationUrl: a, withdrawMutation: o, onWithdrawSuccess: i, registration: d }) {
2356
+ const [p, c] = E(!1), u = () => {
2357
+ o.mutate(void 0, {
1854
2358
  onSuccess: () => {
1855
- c(!1), o && o();
2359
+ c(!1), i && i();
1856
2360
  }
1857
2361
  });
1858
2362
  }, v = d || {}, f = t.length || v.currentCount || 0, h = v.maxParticipants;
1859
- return /* @__PURE__ */ l(_, { children: [
2363
+ return /* @__PURE__ */ l(B, { children: [
1860
2364
  /* @__PURE__ */ l("div", { className: "pvx-reg-form-header", children: [
1861
2365
  /* @__PURE__ */ n("h3", { className: "pvx-reg-form-title", children: "Registered Drivers" }),
1862
- h && /* @__PURE__ */ n(Fe, { count: f, max: h })
2366
+ h && /* @__PURE__ */ n(He, { count: f, max: h })
1863
2367
  ] }),
1864
- /* @__PURE__ */ n(Ue, { drivers: t, steamId: s }),
1865
- i.error && /* @__PURE__ */ n("div", { className: "pvx-reg-error", children: i.error.message || "Withdrawal failed" }),
1866
- r ? /* @__PURE__ */ n("div", { className: "pvx-reg-actions", children: p ? /* @__PURE__ */ l("div", { className: "pvx-reg-confirm", children: [
2368
+ /* @__PURE__ */ n(Ke, { drivers: t, steamId: r }),
2369
+ o.error && /* @__PURE__ */ n("div", { className: "pvx-reg-error", children: o.error.message || "Withdrawal failed" }),
2370
+ s ? /* @__PURE__ */ n("div", { className: "pvx-reg-actions", children: p ? /* @__PURE__ */ l("div", { className: "pvx-reg-confirm", children: [
1867
2371
  /* @__PURE__ */ n("p", { className: "pvx-reg-confirm-text", children: "Are you sure you want to unregister?" }),
1868
2372
  /* @__PURE__ */ l("div", { className: "pvx-reg-confirm-actions", children: [
1869
2373
  /* @__PURE__ */ n(
@@ -1881,8 +2385,8 @@ function Fn({ competitionId: e, drivers: t, steamId: s, isPowerMode: r, registra
1881
2385
  type: "button",
1882
2386
  className: "pvx-reg-danger-btn",
1883
2387
  onClick: u,
1884
- disabled: i.isPending,
1885
- children: i.isPending ? "Unregistering..." : "Yes, Unregister"
2388
+ disabled: o.isPending,
2389
+ children: o.isPending ? "Unregistering..." : "Yes, Unregister"
1886
2390
  }
1887
2391
  )
1888
2392
  ] })
@@ -1897,115 +2401,117 @@ function Fn({ competitionId: e, drivers: t, steamId: s, isPowerMode: r, registra
1897
2401
  ) }) : /* @__PURE__ */ n("div", { className: "pvx-reg-actions", children: /* @__PURE__ */ n("a", { href: a, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Manage on PitVox" }) })
1898
2402
  ] });
1899
2403
  }
1900
- function Ue({ drivers: e, steamId: t }) {
2404
+ function Ke({ drivers: e, steamId: t }) {
1901
2405
  if (!e.length)
1902
2406
  return /* @__PURE__ */ n("div", { className: "pvx-reg-no-drivers", children: "No drivers registered yet." });
1903
- const s = [...e].sort((r, a) => {
1904
- const i = t && r.steamId === t ? -1 : 0, o = t && a.steamId === t ? -1 : 0;
1905
- return i - o;
2407
+ const r = [...e].sort((s, a) => {
2408
+ const o = t && s.steamId === t ? -1 : 0, i = t && a.steamId === t ? -1 : 0;
2409
+ return o - i;
1906
2410
  });
1907
- return /* @__PURE__ */ n("div", { className: "pvx-reg-driver-list", children: s.map((r) => {
1908
- var i, o;
1909
- const a = t && r.steamId === t;
2411
+ return /* @__PURE__ */ n("div", { className: "pvx-reg-driver-list", children: r.map((s) => {
2412
+ var o, i;
2413
+ const a = t && s.steamId === t;
1910
2414
  return /* @__PURE__ */ l(
1911
2415
  "div",
1912
2416
  {
1913
2417
  className: `pvx-reg-driver-row ${a ? "pvx-reg-driver-row--you" : ""}`,
1914
2418
  children: [
1915
- r.avatarUrl ? /* @__PURE__ */ n("img", { src: r.avatarUrl, alt: "", className: "pvx-reg-driver-avatar" }) : /* @__PURE__ */ n("div", { className: "pvx-reg-driver-avatar pvx-reg-driver-avatar--placeholder", children: ((o = (i = r.displayName) == null ? void 0 : i.charAt(0)) == null ? void 0 : o.toUpperCase()) || "?" }),
2419
+ s.avatarUrl ? /* @__PURE__ */ n("img", { src: s.avatarUrl, alt: "", className: "pvx-reg-driver-avatar" }) : /* @__PURE__ */ n("div", { className: "pvx-reg-driver-avatar pvx-reg-driver-avatar--placeholder", children: ((i = (o = s.displayName) == null ? void 0 : o.charAt(0)) == null ? void 0 : i.toUpperCase()) || "?" }),
1916
2420
  /* @__PURE__ */ l("span", { className: "pvx-reg-driver-name", children: [
1917
- r.displayName,
2421
+ s.displayName,
1918
2422
  a && /* @__PURE__ */ n("span", { className: "pvx-entry-you", children: " (you)" })
1919
2423
  ] })
1920
2424
  ]
1921
2425
  },
1922
- r.steamId || r.driverId
2426
+ s.steamId || s.driverId
1923
2427
  );
1924
2428
  }) });
1925
2429
  }
1926
- function Fe({ count: e, max: t }) {
1927
- const s = t ? e / t * 100 : 0, r = s >= 100 ? "full" : s >= 75 ? "warning" : "ok";
1928
- return /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${r}`, children: [
2430
+ function He({ count: e, max: t }) {
2431
+ const r = t ? e / t * 100 : 0, s = r >= 100 ? "full" : r >= 75 ? "warning" : "ok";
2432
+ return /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${s}`, children: [
1929
2433
  e,
1930
2434
  "/",
1931
2435
  t,
1932
2436
  " drivers"
1933
2437
  ] });
1934
2438
  }
1935
- function Pt({ competitionId: e, className: t }) {
1936
- const { data: s, isLoading: r } = Le(e), a = (s == null ? void 0 : s.type) === "championship", i = (s == null ? void 0 : s.type) === "hotlap", o = $(() => (s == null ? void 0 : s.rounds) || [], [s]), d = i && o.length > 1, p = i && !d, { data: c } = sn(p ? e : null), u = $(
1937
- () => o.filter((b) => b.isFinalized),
1938
- [o]
1939
- ), v = $(
1940
- () => u.map((b) => b.roundNumber),
2439
+ function vr({ competitionId: e, className: t }) {
2440
+ const { data: r, isLoading: s } = Pe(e), a = (r == null ? void 0 : r.type) === "championship", o = (r == null ? void 0 : r.type) === "hotlap", i = T(() => (r == null ? void 0 : r.rounds) || [], [r]), d = o && i.length > 1, p = o && !d, { data: c } = un(p ? e : null), u = T(
2441
+ () => i.filter((w) => w.isFinalized),
2442
+ [i]
2443
+ ), v = T(
2444
+ () => u.map((w) => w.roundNumber),
1941
2445
  [u]
1942
- ), { data: f = [], isLoading: h } = tn(
2446
+ ), { data: f = [], isLoading: h } = pn(
1943
2447
  e,
1944
2448
  v
1945
- ), k = p && f.length > 0 ? f[0] : null, x = (k == null ? void 0 : k.sessions) || [], g = d ? "standings" : p ? "leaderboard" : a ? "standings" : v.length > 0 ? `round-${v[v.length - 1]}` : null, [y, m] = B(null), w = y || g;
1946
- if (r || h)
1947
- return /* @__PURE__ */ n(V, { message: "Loading results..." });
1948
- if (!s)
1949
- return /* @__PURE__ */ n(U, { message: "Competition not found." });
2449
+ ), y = p && f.length > 0 ? f[0] : null, x = (y == null ? void 0 : y.sessions) || [], m = d ? i.find(
2450
+ (w) => w.startTime && new Date(w.startTime) <= /* @__PURE__ */ new Date() && !O(w)
2451
+ ) : null, b = d ? m ? `hlround-${m.roundNumber}` : "standings" : p ? "leaderboard" : a ? "standings" : v.length > 0 ? `round-${v[v.length - 1]}` : null, [g, k] = E(null), C = g || b;
2452
+ if (s || h)
2453
+ return /* @__PURE__ */ n(W, { message: "Loading results..." });
2454
+ if (!r)
2455
+ return /* @__PURE__ */ n(_, { message: "Competition not found." });
1950
2456
  if (!u.length)
1951
- return /* @__PURE__ */ n(U, { message: "No results available yet. Results will appear here once rounds are finalised." });
1952
- const S = new Map(f.map((b) => [`round-${b.roundNumber}`, b])), R = new Map(f.map((b) => [b.roundNumber, b])), T = [];
2457
+ return /* @__PURE__ */ n(_, { message: "No results available yet. Results will appear here once rounds are finalised." });
2458
+ const P = new Map(f.map((w) => [`round-${w.roundNumber}`, w])), A = new Map(f.map((w) => [w.roundNumber, w])), N = [];
1953
2459
  if (d) {
1954
- T.push({ id: "standings", label: "Standings" });
1955
- for (const b of [...o].sort((L, P) => L.roundNumber - P.roundNumber))
1956
- T.push({ id: `hlround-${b.roundNumber}`, label: `R${b.roundNumber}`, track: b.track || null });
2460
+ N.push({ id: "standings", label: "Standings" });
2461
+ for (const w of [...i].sort((D, $) => D.roundNumber - $.roundNumber))
2462
+ N.push({ id: `hlround-${w.roundNumber}`, label: `R${w.roundNumber}`, track: w.track || null });
1957
2463
  } else if (p) {
1958
- T.push({ id: "leaderboard", label: "Leaderboard" });
1959
- for (const b of x)
1960
- T.push({ id: `session-${b.type}`, label: Z(b.type) });
2464
+ N.push({ id: "leaderboard", label: "Leaderboard" });
2465
+ for (const w of x)
2466
+ N.push({ id: `session-${w.type}`, label: X(w.type) });
1961
2467
  } else if (a) {
1962
- T.push({ id: "standings", label: "Standings" });
1963
- for (const b of u)
1964
- T.push({ id: `round-${b.roundNumber}`, label: `R${b.roundNumber}`, track: null });
2468
+ N.push({ id: "standings", label: "Standings" });
2469
+ for (const w of u)
2470
+ N.push({ id: `round-${w.roundNumber}`, label: `R${w.roundNumber}`, track: null });
1965
2471
  } else
1966
- for (const b of u)
1967
- T.push({ id: `round-${b.roundNumber}`, label: `R${b.roundNumber}`, track: null });
1968
- let N;
1969
- if (w === "standings")
1970
- N = /* @__PURE__ */ n($n, { competitionId: e });
1971
- else if (w === "leaderboard")
1972
- N = /* @__PURE__ */ n(Ee, { leaderboard: c, config: s });
1973
- else if (w != null && w.startsWith("hlround-")) {
1974
- const b = parseInt(w.slice(8), 10), L = o.find((P) => P.roundNumber === b);
1975
- N = L ? /* @__PURE__ */ n(qn, { competitionId: e, roundMeta: L, roundData: R.get(b) }) : /* @__PURE__ */ n(U, { message: "No results for this round." });
1976
- } else if (w != null && w.startsWith("session-"))
1977
- N = /* @__PURE__ */ n(
1978
- qe,
2472
+ for (const w of u)
2473
+ N.push({ id: `round-${w.roundNumber}`, label: `R${w.roundNumber}`, track: null });
2474
+ let L;
2475
+ if (C === "standings")
2476
+ L = /* @__PURE__ */ n(lt, { competitionId: e });
2477
+ else if (C === "leaderboard")
2478
+ L = /* @__PURE__ */ n(Oe, { leaderboard: c, config: r });
2479
+ else if (C != null && C.startsWith("hlround-")) {
2480
+ const w = parseInt(C.slice(8), 10), D = i.find(($) => $.roundNumber === w);
2481
+ L = D ? /* @__PURE__ */ n(yt, { competitionId: e, roundMeta: D, roundData: A.get(w) }) : /* @__PURE__ */ n(_, { message: "No results for this round." });
2482
+ } else if (C != null && C.startsWith("session-"))
2483
+ L = /* @__PURE__ */ n(
2484
+ Ge,
1979
2485
  {
1980
- session: x.find((b) => `session-${b.type}` === w),
1981
- round: k,
2486
+ session: x.find((w) => `session-${w.type}` === C),
2487
+ round: y,
1982
2488
  competitionId: e
1983
2489
  }
1984
2490
  );
1985
2491
  else {
1986
- const b = S.get(w);
1987
- N = b ? /* @__PURE__ */ n(En, { round: b, competitionId: e }) : /* @__PURE__ */ n(U, { message: "No results for this round." });
2492
+ const w = P.get(C);
2493
+ L = w ? /* @__PURE__ */ n(Nt, { round: w, competitionId: e }) : /* @__PURE__ */ n(_, { message: "No results for this round." });
1988
2494
  }
1989
2495
  return /* @__PURE__ */ l("div", { className: t || "", children: [
1990
- /* @__PURE__ */ n("div", { className: "pvx-results-tabs", children: T.map((b) => /* @__PURE__ */ l(
2496
+ /* @__PURE__ */ n("div", { className: "pvx-results-tabs", children: N.map((w) => /* @__PURE__ */ l(
1991
2497
  "button",
1992
2498
  {
1993
- className: `pvx-results-tab ${w === b.id ? "pvx-results-tab--active" : ""}`,
1994
- onClick: () => m(b.id),
1995
- title: b.track || void 0,
2499
+ className: `pvx-results-tab ${C === w.id ? "pvx-results-tab--active" : ""}`,
2500
+ onClick: () => k(w.id),
2501
+ title: w.track || void 0,
1996
2502
  children: [
1997
- /* @__PURE__ */ n("span", { className: "pvx-results-tab-label", children: b.label }),
1998
- b.track && /* @__PURE__ */ n("span", { className: "pvx-results-tab-track", children: b.track })
2503
+ /* @__PURE__ */ n("span", { className: "pvx-results-tab-label", children: w.label }),
2504
+ w.track && /* @__PURE__ */ n("span", { className: "pvx-results-tab-track", children: w.track })
1999
2505
  ]
2000
2506
  },
2001
- b.id
2507
+ w.id
2002
2508
  )) }),
2003
- N
2509
+ L
2004
2510
  ] });
2005
2511
  }
2006
- function En({ round: e, competitionId: t }) {
2007
- var i;
2008
- const r = (e.sessions || []).find((o) => o.type === "RACE"), a = (i = r == null ? void 0 : r.results) == null ? void 0 : i.filter((o) => o.position <= 3).sort((o, d) => o.position - d.position);
2512
+ function Nt({ round: e, competitionId: t }) {
2513
+ var o;
2514
+ const s = (e.sessions || []).find((i) => i.type === "RACE"), a = (o = s == null ? void 0 : s.results) == null ? void 0 : o.filter((i) => i.position <= 3).sort((i, d) => i.position - d.position);
2009
2515
  return /* @__PURE__ */ l("div", { className: "pvx-card", children: [
2010
2516
  /* @__PURE__ */ l("div", { className: "pvx-card-header--split", children: [
2011
2517
  /* @__PURE__ */ l("div", { children: [
@@ -2020,19 +2526,19 @@ function En({ round: e, competitionId: t }) {
2020
2526
  year: "numeric"
2021
2527
  }) })
2022
2528
  ] }),
2023
- (a == null ? void 0 : a.length) > 0 && /* @__PURE__ */ n("div", { className: "pvx-round-podium-summary", children: a.map((o) => /* @__PURE__ */ l("span", { className: "pvx-round-podium-item", children: [
2024
- /* @__PURE__ */ n("span", { children: he[o.position - 1] }),
2025
- /* @__PURE__ */ n("span", { children: o.driverName })
2026
- ] }, o.driverId)) })
2529
+ (a == null ? void 0 : a.length) > 0 && /* @__PURE__ */ n("div", { className: "pvx-round-podium-summary", children: a.map((i) => /* @__PURE__ */ l("span", { className: "pvx-round-podium-item", children: [
2530
+ /* @__PURE__ */ n("span", { children: xe[i.position - 1] }),
2531
+ /* @__PURE__ */ n("span", { children: i.driverName })
2532
+ ] }, i.driverId)) })
2027
2533
  ] }),
2028
- /* @__PURE__ */ n(ve, { round: e, competitionId: t })
2534
+ /* @__PURE__ */ n(ye, { round: e, competitionId: t })
2029
2535
  ] });
2030
2536
  }
2031
- function Ee({ leaderboard: e, config: t, heading: s }) {
2032
- var r;
2033
- return (r = e == null ? void 0 : e.drivers) != null && r.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
2537
+ function Oe({ leaderboard: e, config: t, heading: r }) {
2538
+ var s;
2539
+ return (s = e == null ? void 0 : e.drivers) != null && s.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
2034
2540
  /* @__PURE__ */ n("div", { className: "pvx-card-header--split", children: /* @__PURE__ */ l("div", { children: [
2035
- /* @__PURE__ */ n("h4", { className: "pvx-card-title", children: s || e.track || (t == null ? void 0 : t.name) || "Hotlap Leaderboard" }),
2541
+ /* @__PURE__ */ n("h4", { className: "pvx-card-title", children: r || e.track || (t == null ? void 0 : t.name) || "Hotlap Leaderboard" }),
2036
2542
  /* @__PURE__ */ l("span", { className: "pvx-standings-subtitle", children: [
2037
2543
  e.sessionsCompleted,
2038
2544
  " session",
@@ -2051,194 +2557,194 @@ function Ee({ leaderboard: e, config: t, heading: s }) {
2051
2557
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Gap" })
2052
2558
  ] }) }),
2053
2559
  /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: e.drivers.map((a) => {
2054
- const i = a.position === 1 ? "" : `+${((a.bestLapMs - e.drivers[0].bestLapMs) / 1e3).toFixed(3)}`;
2560
+ const o = a.position === 1 ? "" : `+${((a.bestLapMs - e.drivers[0].bestLapMs) / 1e3).toFixed(3)}`;
2055
2561
  return /* @__PURE__ */ l("tr", { className: `pvx-row ${a.position <= 3 ? "pvx-row--podium" : ""}`, children: [
2056
- /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(me, { position: a.position }) }),
2562
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(ge, { position: a.position }) }),
2057
2563
  /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
2058
- /* @__PURE__ */ n(X, { nation: a.nation }),
2564
+ /* @__PURE__ */ n(ee, { nation: a.nation }),
2059
2565
  a.driverName
2060
2566
  ] }),
2061
2567
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: I(a.carId) }),
2062
2568
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono", children: /* @__PURE__ */ n("span", { className: a.position === 1 ? "pvx-best-lap-cell--fastest" : "", children: a.bestLapFormatted }) }),
2063
2569
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: a.totalLaps }),
2064
2570
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: a.sessionsParticipated }),
2065
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: i })
2571
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: o })
2066
2572
  ] }, a.driverId);
2067
2573
  }) })
2068
2574
  ] }) })
2069
- ] }) : /* @__PURE__ */ n(U, { message: "No lap times recorded yet." });
2575
+ ] }) : /* @__PURE__ */ n(_, { message: "No lap times recorded yet." });
2070
2576
  }
2071
- function qe({ session: e, round: t, competitionId: s }) {
2577
+ function Ge({ session: e, round: t, competitionId: r }) {
2072
2578
  return e ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
2073
- /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n("h4", { className: "pvx-card-title", children: Z(e.type) }) }),
2579
+ /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n("h4", { className: "pvx-card-title", children: X(e.type) }) }),
2074
2580
  /* @__PURE__ */ n(
2075
- ve,
2581
+ ye,
2076
2582
  {
2077
2583
  round: { ...t, sessions: [e] },
2078
- competitionId: s
2584
+ competitionId: r
2079
2585
  }
2080
2586
  )
2081
- ] }) : /* @__PURE__ */ n(U, { message: "Session data not available." });
2587
+ ] }) : /* @__PURE__ */ n(_, { message: "Session data not available." });
2082
2588
  }
2083
- function qn({ competitionId: e, roundMeta: t, roundData: s }) {
2084
- const { data: r } = rn(e, t.roundNumber), a = (s == null ? void 0 : s.sessions) || [], [i, o] = B("leaderboard"), d = [
2589
+ function yt({ competitionId: e, roundMeta: t, roundData: r }) {
2590
+ const { data: s } = hn(e, t.roundNumber), a = (r == null ? void 0 : r.sessions) || [], [o, i] = E("leaderboard"), d = [
2085
2591
  { id: "leaderboard", label: "Leaderboard" },
2086
- ...a.map((u) => ({ id: `session-${u.type}`, label: Z(u.type) }))
2087
- ], p = d.some((u) => u.id === i) ? i : "leaderboard", c = `Round ${t.roundNumber}${t.track ? ` — ${t.track}` : ""}`;
2592
+ ...a.map((u) => ({ id: `session-${u.type}`, label: X(u.type) }))
2593
+ ], p = d.some((u) => u.id === o) ? o : "leaderboard", c = `Round ${t.roundNumber}${t.track ? ` — ${t.track}` : ""}`;
2088
2594
  return /* @__PURE__ */ l("div", { children: [
2089
2595
  /* @__PURE__ */ n("div", { className: "pvx-session-tabs", children: d.map((u) => /* @__PURE__ */ n(
2090
2596
  "button",
2091
2597
  {
2092
- onClick: () => o(u.id),
2598
+ onClick: () => i(u.id),
2093
2599
  className: `pvx-session-tab ${p === u.id ? "pvx-session-tab--active" : ""}`,
2094
2600
  children: u.label
2095
2601
  },
2096
2602
  u.id
2097
2603
  )) }),
2098
- p === "leaderboard" ? /* @__PURE__ */ n(Ee, { leaderboard: r, heading: c }) : /* @__PURE__ */ n(
2099
- qe,
2604
+ p === "leaderboard" ? /* @__PURE__ */ n(Oe, { leaderboard: s, heading: c }) : /* @__PURE__ */ n(
2605
+ Ge,
2100
2606
  {
2101
2607
  session: a.find((u) => `session-${u.type}` === p),
2102
- round: s,
2608
+ round: r,
2103
2609
  competitionId: e
2104
2610
  }
2105
2611
  )
2106
2612
  ] });
2107
2613
  }
2108
- function _n(e) {
2109
- const { cdnUrl: t } = C(), s = M({
2614
+ function bt(e) {
2615
+ const { cdnUrl: t } = S(), r = R({
2110
2616
  queryKey: ["pitvox", "laps", "global", e, "index"],
2111
- queryFn: () => D(t, ye(null, e)),
2617
+ queryFn: () => M(t, Te(null, e)),
2112
2618
  enabled: !!e,
2113
2619
  staleTime: 3e4,
2114
2620
  refetchInterval: 3e4
2115
- }), r = s.data;
2621
+ }), s = r.data;
2116
2622
  return {
2117
- isLoading: s.isLoading,
2118
- error: s.error,
2119
- data: r ? {
2120
- driverName: r.driverName || "Driver",
2121
- lapCount: r.lapCount || 0,
2122
- trackBreakdown: r.trackBreakdown || [],
2123
- carBreakdown: r.carBreakdown || [],
2124
- recordsHeld: r.recordsHeld || 0,
2125
- currentRecords: r.currentRecords || [],
2126
- bestRanking: r.bestRanking ?? null,
2127
- bestRankingTrackId: r.bestRankingTrackId ?? null,
2128
- bestRankingLayout: r.bestRankingLayout ?? null,
2129
- bestRankingCarId: r.bestRankingCarId ?? null,
2130
- generatedAt: r.generatedAt
2623
+ isLoading: r.isLoading,
2624
+ error: r.error,
2625
+ data: s ? {
2626
+ driverName: s.driverName || "Driver",
2627
+ lapCount: s.lapCount || 0,
2628
+ trackBreakdown: s.trackBreakdown || [],
2629
+ carBreakdown: s.carBreakdown || [],
2630
+ recordsHeld: s.recordsHeld || 0,
2631
+ currentRecords: s.currentRecords || [],
2632
+ bestRanking: s.bestRanking ?? null,
2633
+ bestRankingTrackId: s.bestRankingTrackId ?? null,
2634
+ bestRankingLayout: s.bestRankingLayout ?? null,
2635
+ bestRankingCarId: s.bestRankingCarId ?? null,
2636
+ generatedAt: s.generatedAt
2131
2637
  } : null
2132
2638
  };
2133
2639
  }
2134
- function jn(e) {
2135
- const { cdnUrl: t, partnerSlug: s } = C(), r = M({
2136
- queryKey: ["pitvox", "laps", s || "global", e, "index"],
2137
- queryFn: () => D(t, ye(s, e)),
2640
+ function wt(e) {
2641
+ const { cdnUrl: t, partnerSlug: r } = S(), s = R({
2642
+ queryKey: ["pitvox", "laps", r || "global", e, "index"],
2643
+ queryFn: () => M(t, Te(r, e)),
2138
2644
  enabled: !!e,
2139
2645
  staleTime: 3e4,
2140
2646
  refetchInterval: 3e4
2141
- }), a = $(() => {
2142
- var i;
2143
- return ((i = r.data) == null ? void 0 : i.combos) || [];
2144
- }, [r.data]);
2647
+ }), a = T(() => {
2648
+ var o;
2649
+ return ((o = s.data) == null ? void 0 : o.combos) || [];
2650
+ }, [s.data]);
2145
2651
  return {
2146
- isLoading: r.isLoading,
2147
- error: r.error,
2652
+ isLoading: s.isLoading,
2653
+ error: s.error,
2148
2654
  data: a
2149
2655
  };
2150
2656
  }
2151
- function _e(e = {}) {
2152
- const { cdnUrl: t, partnerSlug: s } = C(), { game: r, gameVersion: a, enabled: i = !0 } = e, o = ie(s, r, a, "ratings.json");
2153
- return M({
2154
- queryKey: ["pitvox", "ratings", s, r || null, a || null],
2155
- queryFn: () => D(t, o),
2657
+ function ze(e = {}) {
2658
+ const { cdnUrl: t, partnerSlug: r } = S(), { game: s, gameVersion: a, enabled: o = !0 } = e, i = de(r, s, a, "ratings.json");
2659
+ return R({
2660
+ queryKey: ["pitvox", "ratings", r, s || null, a || null],
2661
+ queryFn: () => M(t, i),
2156
2662
  staleTime: 3e4,
2157
2663
  refetchInterval: 3e4,
2158
- enabled: i
2664
+ enabled: o
2159
2665
  });
2160
2666
  }
2161
- function At(e) {
2162
- var r;
2163
- const t = _e(), s = $(() => {
2667
+ function xr(e) {
2668
+ var s;
2669
+ const t = ze(), r = T(() => {
2164
2670
  var a;
2165
2671
  return !((a = t.data) != null && a.drivers) || !e ? null : t.data.drivers.find(
2166
- (i) => i.identifier === e
2672
+ (o) => o.identifier === e
2167
2673
  ) || null;
2168
- }, [(r = t.data) == null ? void 0 : r.drivers, e]);
2674
+ }, [(s = t.data) == null ? void 0 : s.drivers, e]);
2169
2675
  return {
2170
2676
  isLoading: t.isLoading,
2171
2677
  error: t.error,
2172
- data: s ? {
2173
- rating: s.rating,
2174
- rank: s.rank,
2678
+ data: r ? {
2679
+ rating: r.rating,
2680
+ rank: r.rank,
2175
2681
  totalDrivers: t.data.driverCount || t.data.drivers.length,
2176
- comboCount: s.comboCount || 0,
2177
- distinctCars: s.distinctCars || 0,
2178
- combos: s.combos || []
2682
+ comboCount: r.comboCount || 0,
2683
+ distinctCars: r.distinctCars || 0,
2684
+ combos: r.combos || []
2179
2685
  } : null
2180
2686
  };
2181
2687
  }
2182
- function re(e = {}) {
2183
- const t = _e(e);
2688
+ function ie(e = {}) {
2689
+ const t = ze(e);
2184
2690
  return {
2185
2691
  data: t.data || null,
2186
2692
  isLoading: t.isLoading,
2187
2693
  error: t.error
2188
2694
  };
2189
2695
  }
2190
- function Vn(e) {
2696
+ function kt(e) {
2191
2697
  var p, c;
2192
- const { versions: t } = Ze(), s = (p = t == null ? void 0 : t.evo) == null ? void 0 : p.default, r = (c = t == null ? void 0 : t.lmu) == null ? void 0 : c.default, a = re({ game: "evo", gameVersion: s, enabled: !!s }), i = re({ game: "acc" }), o = re({ game: "lmu", gameVersion: r, enabled: !!r });
2698
+ const { versions: t } = on(), r = (p = t == null ? void 0 : t.evo) == null ? void 0 : p.default, s = (c = t == null ? void 0 : t.lmu) == null ? void 0 : c.default, a = ie({ game: "evo", gameVersion: r, enabled: !!r }), o = ie({ game: "acc" }), i = ie({ game: "lmu", gameVersion: s, enabled: !!s });
2193
2699
  return {
2194
- data: $(() => e ? [
2700
+ data: T(() => e ? [
2195
2701
  { data: a.data, game: "evo", label: "EVO" },
2196
- { data: i.data, game: "acc", label: "ACC" },
2197
- { data: o.data, game: "lmu", label: "LMU" }
2702
+ { data: o.data, game: "acc", label: "ACC" },
2703
+ { data: i.data, game: "lmu", label: "LMU" }
2198
2704
  ].map(({ data: u, game: v, label: f }) => {
2199
2705
  var x;
2200
2706
  if (!((x = u == null ? void 0 : u.drivers) != null && x.length)) return null;
2201
- const h = [...u.drivers].sort((g, y) => y.rating - g.rating), k = h.findIndex((g) => g.identifier === e);
2202
- return k === -1 ? null : {
2707
+ const h = [...u.drivers].sort((m, b) => b.rating - m.rating), y = h.findIndex((m) => m.identifier === e);
2708
+ return y === -1 ? null : {
2203
2709
  game: v,
2204
2710
  label: f,
2205
- rating: h[k].rating,
2206
- rank: k + 1,
2711
+ rating: h[y].rating,
2712
+ rank: y + 1,
2207
2713
  totalDrivers: h.length
2208
2714
  };
2209
- }).filter(Boolean) : [], [e, a.data, i.data, o.data]),
2210
- isLoading: a.isLoading || i.isLoading || o.isLoading
2715
+ }).filter(Boolean) : [], [e, a.data, o.data, i.data]),
2716
+ isLoading: a.isLoading || o.isLoading || i.isLoading
2211
2717
  };
2212
2718
  }
2213
- function Kn() {
2214
- const { cdnUrl: e, partnerSlug: t, getSteamId: s, onFetchServerPassword: r } = C(), a = s(), { data: i, isLoading: o } = M({
2719
+ function Ct() {
2720
+ const { cdnUrl: e, partnerSlug: t, getSteamId: r, onFetchServerPassword: s } = S(), a = r(), { data: o, isLoading: i } = R({
2215
2721
  queryKey: ["pitvox", "competitions", t],
2216
2722
  queryFn: async () => {
2217
- const h = await D(e, "competitions/index.json");
2218
- return h != null && h.competitions ? h.competitions.filter((k) => k.partnerSlug === t) : [];
2723
+ const h = await M(e, "competitions/index.json");
2724
+ return h != null && h.competitions ? h.competitions.filter((y) => y.partnerSlug === t) : [];
2219
2725
  },
2220
2726
  staleTime: 6e4
2221
- }), d = (i == null ? void 0 : i.map((h) => h.id)) || [], p = xe({
2727
+ }), d = (o == null ? void 0 : o.map((h) => h.id)) || [], p = be({
2222
2728
  queries: d.map((h) => ({
2223
2729
  queryKey: ["pitvox", "competition", t, h, "entrylist"],
2224
- queryFn: () => D(e, `competitions/${t}/${h}/entrylist.json`),
2730
+ queryFn: () => M(e, `competitions/${t}/${h}/entrylist.json`),
2225
2731
  enabled: !!a && d.length > 0,
2226
2732
  staleTime: 6e4
2227
2733
  }))
2228
- }), c = p.some((h) => h.isLoading), u = $(() => {
2229
- var x, g;
2230
- if (!i || !a || c) return [];
2231
- const h = /* @__PURE__ */ new Date(), k = [];
2232
- for (let y = 0; y < i.length; y++) {
2233
- const m = i[y], w = (x = p[y]) == null ? void 0 : x.data;
2234
- if (!((g = w == null ? void 0 : w.drivers) == null ? void 0 : g.some((N) => N.steamId === a))) continue;
2235
- const R = m.type === "hotlap", T = m.rounds || [];
2236
- for (const N of T) {
2237
- if (R ? ee(N) : N.isFinalized) continue;
2238
- const L = N.dediStatus === "running" || N.dediStatus === "provisioning", P = N.dediStatus === "scheduled", F = N.startTime && new Date(N.startTime) > h, ne = L || P || N.dediServerAddress;
2239
- !L && !F && !ne || k.push({
2240
- competitionId: m.id,
2241
- competitionName: m.name,
2734
+ }), c = p.some((h) => h.isLoading), u = T(() => {
2735
+ var x, m;
2736
+ if (!o || !a || c) return [];
2737
+ const h = /* @__PURE__ */ new Date(), y = [];
2738
+ for (let b = 0; b < o.length; b++) {
2739
+ const g = o[b], k = (x = p[b]) == null ? void 0 : x.data;
2740
+ if (!((m = k == null ? void 0 : k.drivers) == null ? void 0 : m.some((N) => N.steamId === a))) continue;
2741
+ const P = g.type === "hotlap", A = g.rounds || [];
2742
+ for (const N of A) {
2743
+ if (P ? O(N) : N.isFinalized) continue;
2744
+ const w = N.dediStatus === "running" || N.dediStatus === "provisioning", D = N.dediStatus === "scheduled", $ = N.startTime && new Date(N.startTime) > h, j = w || D || N.dediServerAddress;
2745
+ !w && !$ && !j || y.push({
2746
+ competitionId: g.id,
2747
+ competitionName: g.name,
2242
2748
  roundNumber: N.roundNumber,
2243
2749
  track: N.track || "TBD",
2244
2750
  startTime: N.startTime,
@@ -2247,49 +2753,49 @@ function Kn() {
2247
2753
  });
2248
2754
  }
2249
2755
  }
2250
- return k.sort((y, m) => {
2251
- const w = y.dediStatus === "running" || y.dediStatus === "provisioning", S = m.dediStatus === "running" || m.dediStatus === "provisioning";
2252
- return w && !S ? -1 : !w && S ? 1 : new Date(y.startTime) - new Date(m.startTime);
2253
- }), k.length > 0 && (k[0].isNext = !0), k;
2254
- }, [i, a, c, p]), v = xe({
2756
+ return y.sort((b, g) => {
2757
+ const k = b.dediStatus === "running" || b.dediStatus === "provisioning", C = g.dediStatus === "running" || g.dediStatus === "provisioning";
2758
+ return k && !C ? -1 : !k && C ? 1 : new Date(b.startTime) - new Date(g.startTime);
2759
+ }), y.length > 0 && (y[0].isNext = !0), y;
2760
+ }, [o, a, c, p]), v = be({
2255
2761
  queries: u.map((h) => ({
2256
2762
  queryKey: ["pitvox", "serverInfo", h.competitionId, h.roundNumber],
2257
- queryFn: () => r(h.competitionId, h.roundNumber),
2258
- enabled: !!r && u.length > 0,
2763
+ queryFn: () => s(h.competitionId, h.roundNumber),
2764
+ enabled: !!s && u.length > 0,
2259
2765
  staleTime: 5 * 6e4,
2260
2766
  // 5 minutes
2261
2767
  retry: !1
2262
2768
  }))
2263
2769
  });
2264
2770
  return {
2265
- data: $(() => u.length ? r ? u.map((h, k) => {
2266
- var g;
2267
- const x = (g = v[k]) == null ? void 0 : g.data;
2771
+ data: T(() => u.length ? s ? u.map((h, y) => {
2772
+ var m;
2773
+ const x = (m = v[y]) == null ? void 0 : m.data;
2268
2774
  return x != null && x.success ? {
2269
2775
  ...h,
2270
2776
  serverAddress: x.serverAddress || null,
2271
2777
  serverPassword: x.serverPassword || null
2272
2778
  } : h;
2273
- }) : u : [], [u, r, v]),
2274
- isLoading: o || !!a && c
2779
+ }) : u : [], [u, s, v]),
2780
+ isLoading: i || !!a && c
2275
2781
  };
2276
2782
  }
2277
- function Hn() {
2278
- const { onFetchNotifications: e } = C();
2783
+ function St() {
2784
+ const { onFetchNotifications: e } = S();
2279
2785
  return !!e;
2280
2786
  }
2281
- function Wn(e = {}) {
2282
- const { onFetchNotifications: t, partnerSlug: s } = C(), { limit: r = 20, unreadOnly: a = !1 } = e;
2283
- return M({
2284
- queryKey: ["pitvox", "notifications", s, { limit: r, unreadOnly: a }],
2285
- queryFn: () => t({ limit: r, unreadOnly: a }),
2787
+ function Lt(e = {}) {
2788
+ const { onFetchNotifications: t, partnerSlug: r } = S(), { limit: s = 20, unreadOnly: a = !1 } = e;
2789
+ return R({
2790
+ queryKey: ["pitvox", "notifications", r, { limit: s, unreadOnly: a }],
2791
+ queryFn: () => t({ limit: s, unreadOnly: a }),
2286
2792
  enabled: !!t,
2287
2793
  staleTime: 3e4,
2288
2794
  refetchInterval: 3e4
2289
2795
  });
2290
2796
  }
2291
- function Bt() {
2292
- const { onFetchNotifications: e, partnerSlug: t } = C(), { data: s, isLoading: r } = M({
2797
+ function gr() {
2798
+ const { onFetchNotifications: e, partnerSlug: t } = S(), { data: r, isLoading: s } = R({
2293
2799
  queryKey: ["pitvox", "notifications", t, { limit: 1, unreadOnly: !1 }],
2294
2800
  queryFn: () => e({ limit: 1 }),
2295
2801
  enabled: !!e,
@@ -2297,57 +2803,57 @@ function Bt() {
2297
2803
  refetchInterval: 3e4,
2298
2804
  select: (a) => (a == null ? void 0 : a.unreadCount) ?? 0
2299
2805
  });
2300
- return { count: s ?? 0, isLoading: r };
2806
+ return { count: r ?? 0, isLoading: s };
2301
2807
  }
2302
- function On() {
2303
- const { onMarkNotificationRead: e, partnerSlug: t } = C(), s = H();
2304
- return Q({
2305
- mutationFn: (r) => {
2808
+ function $t() {
2809
+ const { onMarkNotificationRead: e, partnerSlug: t } = S(), r = V();
2810
+ return G({
2811
+ mutationFn: (s) => {
2306
2812
  if (!e)
2307
2813
  throw new Error("No onMarkNotificationRead callback provided to PitVoxPartnerProvider.");
2308
- return e(r);
2814
+ return e(s);
2309
2815
  },
2310
- onSuccess: (r, a) => {
2311
- s.setQueriesData(
2816
+ onSuccess: (s, a) => {
2817
+ r.setQueriesData(
2312
2818
  { queryKey: ["pitvox", "notifications", t] },
2313
- (i) => i != null && i.notifications ? {
2314
- ...i,
2315
- unreadCount: Math.max(0, (i.unreadCount || 0) - 1),
2316
- notifications: i.notifications.map(
2317
- (o) => o.id === a ? { ...o, isRead: !0, readAt: (/* @__PURE__ */ new Date()).toISOString() } : o
2819
+ (o) => o != null && o.notifications ? {
2820
+ ...o,
2821
+ unreadCount: Math.max(0, (o.unreadCount || 0) - 1),
2822
+ notifications: o.notifications.map(
2823
+ (i) => i.id === a ? { ...i, isRead: !0, readAt: (/* @__PURE__ */ new Date()).toISOString() } : i
2318
2824
  )
2319
- } : i
2825
+ } : o
2320
2826
  );
2321
2827
  }
2322
2828
  });
2323
2829
  }
2324
- function zn() {
2325
- const { onMarkAllNotificationsRead: e, partnerSlug: t } = C(), s = H();
2326
- return Q({
2830
+ function Tt() {
2831
+ const { onMarkAllNotificationsRead: e, partnerSlug: t } = S(), r = V();
2832
+ return G({
2327
2833
  mutationFn: () => {
2328
2834
  if (!e)
2329
2835
  throw new Error("No onMarkAllNotificationsRead callback provided to PitVoxPartnerProvider.");
2330
2836
  return e();
2331
2837
  },
2332
2838
  onSuccess: () => {
2333
- s.setQueriesData(
2839
+ r.setQueriesData(
2334
2840
  { queryKey: ["pitvox", "notifications", t] },
2335
- (r) => r != null && r.notifications ? {
2336
- ...r,
2841
+ (s) => s != null && s.notifications ? {
2842
+ ...s,
2337
2843
  unreadCount: 0,
2338
- notifications: r.notifications.map((a) => ({
2844
+ notifications: s.notifications.map((a) => ({
2339
2845
  ...a,
2340
2846
  isRead: !0,
2341
2847
  readAt: a.readAt || (/* @__PURE__ */ new Date()).toISOString()
2342
2848
  }))
2343
- } : r
2849
+ } : s
2344
2850
  );
2345
2851
  }
2346
2852
  });
2347
2853
  }
2348
- function Qn({ driverName: e, avatarUrl: t, memberSince: s, className: r = "" }) {
2349
- const a = s ? new Date(s).toLocaleDateString("en-GB", { day: "2-digit", month: "2-digit", year: "numeric" }) : null;
2350
- return /* @__PURE__ */ l("div", { className: `pvx-card pvx-dash-profile ${r}`, children: [
2854
+ function Rt({ driverName: e, avatarUrl: t, memberSince: r, className: s = "" }) {
2855
+ const a = r ? new Date(r).toLocaleDateString("en-GB", { day: "2-digit", month: "2-digit", year: "numeric" }) : null;
2856
+ return /* @__PURE__ */ l("div", { className: `pvx-card pvx-dash-profile ${s}`, children: [
2351
2857
  t ? /* @__PURE__ */ n("img", { src: t, alt: "", className: "pvx-dash-profile-avatar" }) : /* @__PURE__ */ n("div", { className: "pvx-dash-profile-avatar pvx-dash-profile-avatar--placeholder", children: (e || "?")[0].toUpperCase() }),
2352
2858
  /* @__PURE__ */ l("div", { className: "pvx-dash-profile-info", children: [
2353
2859
  /* @__PURE__ */ n("h2", { className: "pvx-dash-profile-name", children: e }),
@@ -2358,7 +2864,7 @@ function Qn({ driverName: e, avatarUrl: t, memberSince: s, className: r = "" })
2358
2864
  ] })
2359
2865
  ] });
2360
2866
  }
2361
- function Gn() {
2867
+ function Mt() {
2362
2868
  return /* @__PURE__ */ l("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2363
2869
  /* @__PURE__ */ n("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
2364
2870
  /* @__PURE__ */ n("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
@@ -2366,7 +2872,7 @@ function Gn() {
2366
2872
  /* @__PURE__ */ n("line", { x1: "16", y1: "3", x2: "14", y2: "21" })
2367
2873
  ] });
2368
2874
  }
2369
- function Yn() {
2875
+ function Pt() {
2370
2876
  return /* @__PURE__ */ l("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2371
2877
  /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "10" }),
2372
2878
  /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "2" }),
@@ -2375,19 +2881,19 @@ function Yn() {
2375
2881
  /* @__PURE__ */ n("path", { d: "M13.5 12.5l4 2.5" })
2376
2882
  ] });
2377
2883
  }
2378
- function Ne() {
2884
+ function Se() {
2379
2885
  return /* @__PURE__ */ n("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ n("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" }) });
2380
2886
  }
2381
- function be({ icon: e, value: t, label: s, items: r, labelKey: a, countKey: i }) {
2382
- const [o, d] = B(!1), p = Ke(null);
2383
- He(() => {
2384
- if (!o) return;
2887
+ function Le({ icon: e, value: t, label: r, items: s, labelKey: a, countKey: o }) {
2888
+ const [i, d] = E(!1), p = Ze(null);
2889
+ $e(() => {
2890
+ if (!i) return;
2385
2891
  function u(v) {
2386
2892
  p.current && !p.current.contains(v.target) && d(!1);
2387
2893
  }
2388
2894
  return document.addEventListener("mousedown", u), () => document.removeEventListener("mousedown", u);
2389
- }, [o]);
2390
- const c = r != null && r.length ? r.slice().sort((u, v) => v[i] - u[i]) : null;
2895
+ }, [i]);
2896
+ const c = s != null && s.length ? s.slice().sort((u, v) => v[o] - u[o]) : null;
2391
2897
  return /* @__PURE__ */ l(
2392
2898
  "div",
2393
2899
  {
@@ -2398,61 +2904,61 @@ function be({ icon: e, value: t, label: s, items: r, labelKey: a, countKey: i })
2398
2904
  e,
2399
2905
  /* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
2400
2906
  /* @__PURE__ */ n("span", { className: "pvx-dash-stat-value", children: t }),
2401
- /* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children: s })
2907
+ /* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children: r })
2402
2908
  ] }),
2403
- c && /* @__PURE__ */ n("div", { className: `pvx-dash-tooltip pvx-dash-tooltip--scrollable ${o ? "pvx-dash-tooltip--open" : ""}`, children: c.map((u, v) => /* @__PURE__ */ l("div", { className: "pvx-dash-tooltip-row", children: [
2909
+ c && /* @__PURE__ */ n("div", { className: `pvx-dash-tooltip pvx-dash-tooltip--scrollable ${i ? "pvx-dash-tooltip--open" : ""}`, children: c.map((u, v) => /* @__PURE__ */ l("div", { className: "pvx-dash-tooltip-row", children: [
2404
2910
  /* @__PURE__ */ n("span", { className: "pvx-dash-tooltip-label", children: u[a] }),
2405
- /* @__PURE__ */ n("span", { className: "pvx-dash-tooltip-value", children: u[i] })
2911
+ /* @__PURE__ */ n("span", { className: "pvx-dash-tooltip-value", children: u[o] })
2406
2912
  ] }, v)) })
2407
2913
  ]
2408
2914
  }
2409
2915
  );
2410
2916
  }
2411
- function Jn({ stats: e, gameRatings: t, onGameRatingSelect: s, rating: r, className: a = "" }) {
2917
+ function Dt({ stats: e, gameRatings: t, onGameRatingSelect: r, rating: s, className: a = "" }) {
2412
2918
  if (!e) return null;
2413
- const i = e.trackBreakdown.map((p) => ({
2414
- name: j(p.trackId, p.layout),
2919
+ const o = e.trackBreakdown.map((p) => ({
2920
+ name: z(p.trackId, p.layout),
2415
2921
  lapCount: p.lapCount
2416
- })), o = e.carBreakdown.map((p) => ({
2922
+ })), i = e.carBreakdown.map((p) => ({
2417
2923
  name: I(p.carId),
2418
2924
  lapCount: p.lapCount
2419
2925
  })), d = Array.isArray(t) && t.length > 0;
2420
2926
  return /* @__PURE__ */ l("div", { className: `pvx-dash-stats ${a}`, children: [
2421
2927
  /* @__PURE__ */ n(
2422
- be,
2928
+ Le,
2423
2929
  {
2424
- icon: /* @__PURE__ */ n(Gn, {}),
2930
+ icon: /* @__PURE__ */ n(Mt, {}),
2425
2931
  value: e.lapCount.toLocaleString(),
2426
2932
  label: "Total Laps",
2427
- items: i,
2933
+ items: o,
2428
2934
  labelKey: "name",
2429
2935
  countKey: "lapCount"
2430
2936
  }
2431
2937
  ),
2432
2938
  /* @__PURE__ */ n(
2433
- be,
2939
+ Le,
2434
2940
  {
2435
- icon: /* @__PURE__ */ n(Yn, {}),
2941
+ icon: /* @__PURE__ */ n(Pt, {}),
2436
2942
  value: e.carBreakdown.length,
2437
2943
  label: "Cars Used",
2438
- items: o,
2944
+ items: i,
2439
2945
  labelKey: "name",
2440
2946
  countKey: "lapCount"
2441
2947
  }
2442
2948
  ),
2443
2949
  d ? /* @__PURE__ */ l("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--rating-chips", children: [
2444
- /* @__PURE__ */ n(Ne, {}),
2950
+ /* @__PURE__ */ n(Se, {}),
2445
2951
  /* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
2446
2952
  /* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children: "Driver Rating" }),
2447
2953
  /* @__PURE__ */ n("div", { className: "pvx-dash-rating-chips", children: t.map((p) => {
2448
- const c = !!s;
2954
+ const c = !!r;
2449
2955
  return /* @__PURE__ */ l(
2450
2956
  "span",
2451
2957
  {
2452
2958
  className: `pvx-dash-rating-chip${c ? " pvx-dash-rating-chip--clickable" : ""}`,
2453
- onClick: c ? () => s(p) : void 0,
2959
+ onClick: c ? () => r(p) : void 0,
2454
2960
  onKeyDown: c ? (v) => {
2455
- c && (v.key === "Enter" || v.key === " ") && (v.preventDefault(), s(p));
2961
+ c && (v.key === "Enter" || v.key === " ") && (v.preventDefault(), r(p));
2456
2962
  } : void 0,
2457
2963
  role: c ? "button" : void 0,
2458
2964
  tabIndex: c ? 0 : void 0,
@@ -2472,23 +2978,23 @@ function Jn({ stats: e, gameRatings: t, onGameRatingSelect: s, rating: r, classN
2472
2978
  );
2473
2979
  }) })
2474
2980
  ] })
2475
- ] }) : r ? /* @__PURE__ */ l("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--rating", children: [
2476
- /* @__PURE__ */ n(Ne, {}),
2981
+ ] }) : s ? /* @__PURE__ */ l("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--rating", children: [
2982
+ /* @__PURE__ */ n(Se, {}),
2477
2983
  /* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
2478
- /* @__PURE__ */ n("span", { className: "pvx-dash-stat-value", children: r.rating.toFixed(1) }),
2984
+ /* @__PURE__ */ n("span", { className: "pvx-dash-stat-value", children: s.rating.toFixed(1) }),
2479
2985
  /* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children: "Driver Rating" }),
2480
2986
  /* @__PURE__ */ l("span", { className: "pvx-dash-stat-sub", children: [
2481
2987
  "#",
2482
- r.rank,
2988
+ s.rank,
2483
2989
  " of ",
2484
- r.totalDrivers
2990
+ s.totalDrivers
2485
2991
  ] })
2486
2992
  ] })
2487
2993
  ] }) : null
2488
2994
  ] });
2489
2995
  }
2490
- function Zn({ combos: e, onComboSelect: t, className: s = "" }) {
2491
- return e != null && e.length ? /* @__PURE__ */ l("div", { className: `pvx-card ${s}`, children: [
2996
+ function At({ combos: e, onComboSelect: t, className: r = "" }) {
2997
+ return e != null && e.length ? /* @__PURE__ */ l("div", { className: `pvx-card ${r}`, children: [
2492
2998
  /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
2493
2999
  /* @__PURE__ */ n("span", { className: "pvx-dash-combos-icon", children: /* @__PURE__ */ l("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2494
3000
  /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "10" }),
@@ -2501,18 +3007,18 @@ function Zn({ combos: e, onComboSelect: t, className: s = "" }) {
2501
3007
  ")"
2502
3008
  ] })
2503
3009
  ] }) }),
2504
- /* @__PURE__ */ n("div", { className: "pvx-dash-combos-list", children: e.map((r) => /* @__PURE__ */ n(
2505
- Xn,
3010
+ /* @__PURE__ */ n("div", { className: "pvx-dash-combos-list", children: e.map((s) => /* @__PURE__ */ n(
3011
+ Et,
2506
3012
  {
2507
- combo: r,
2508
- onClick: t ? () => t(r) : null
3013
+ combo: s,
3014
+ onClick: t ? () => t(s) : null
2509
3015
  },
2510
- `${r.trackId}|${r.trackLayout || ""}|${r.carId}|${r.game || ""}|${r.gameVersion || ""}`
3016
+ `${s.trackId}|${s.trackLayout || ""}|${s.carId}|${s.game || ""}|${s.gameVersion || ""}`
2511
3017
  )) })
2512
3018
  ] }) : null;
2513
3019
  }
2514
- function Xn({ combo: e, onClick: t }) {
2515
- const s = e.game || "evo", r = e.gapToLeaderMs && e.gapToLeaderMs > 0 ? (e.gapToLeaderMs / 1e3).toFixed(3) : null, a = e.rank === 1 && e.totalDrivers > 1;
3020
+ function Et({ combo: e, onClick: t }) {
3021
+ const r = e.game || "evo", s = e.gapToLeaderMs && e.gapToLeaderMs > 0 ? (e.gapToLeaderMs / 1e3).toFixed(3) : null, a = e.rank === 1 && e.totalDrivers > 1;
2516
3022
  return /* @__PURE__ */ l(
2517
3023
  "div",
2518
3024
  {
@@ -2526,12 +3032,12 @@ function Xn({ combo: e, onClick: t }) {
2526
3032
  children: [
2527
3033
  /* @__PURE__ */ l("div", { className: "pvx-dash-combo-info", children: [
2528
3034
  /* @__PURE__ */ l("div", { className: "pvx-dash-combo-title", children: [
2529
- e.game && /* @__PURE__ */ n("span", { className: `pvx-dash-game-badge pvx-dash-game-badge--${s}`, children: s.toUpperCase() }),
2530
- /* @__PURE__ */ n("span", { className: "pvx-dash-combo-track", children: j(e.trackId, e.trackLayout, e.game) })
3035
+ e.game && /* @__PURE__ */ n("span", { className: `pvx-dash-game-badge pvx-dash-game-badge--${r}`, children: r.toUpperCase() }),
3036
+ /* @__PURE__ */ n("span", { className: "pvx-dash-combo-track", children: z(e.trackId, e.trackLayout, e.game) })
2531
3037
  ] }),
2532
3038
  /* @__PURE__ */ l("div", { className: "pvx-dash-combo-meta", children: [
2533
3039
  /* @__PURE__ */ n("span", { className: "pvx-dash-combo-car", children: I(e.carId) }),
2534
- e.lapCount > 0 && /* @__PURE__ */ l(_, { children: [
3040
+ e.lapCount > 0 && /* @__PURE__ */ l(B, { children: [
2535
3041
  /* @__PURE__ */ n("span", { className: "pvx-dash-combo-meta-sep", children: "·" }),
2536
3042
  /* @__PURE__ */ l("span", { children: [
2537
3043
  e.lapCount,
@@ -2539,9 +3045,9 @@ function Xn({ combo: e, onClick: t }) {
2539
3045
  e.lapCount === 1 ? "lap" : "laps"
2540
3046
  ] })
2541
3047
  ] }),
2542
- e.lastDrivenAt && /* @__PURE__ */ l(_, { children: [
3048
+ e.lastDrivenAt && /* @__PURE__ */ l(B, { children: [
2543
3049
  /* @__PURE__ */ n("span", { className: "pvx-dash-combo-meta-sep", children: "·" }),
2544
- /* @__PURE__ */ n("span", { children: oe(e.lastDrivenAt) })
3050
+ /* @__PURE__ */ n("span", { children: pe(e.lastDrivenAt) })
2545
3051
  ] })
2546
3052
  ] })
2547
3053
  ] }),
@@ -2567,9 +3073,9 @@ function Xn({ combo: e, onClick: t }) {
2567
3073
  e.totalDrivers,
2568
3074
  " on leaderboard"
2569
3075
  ] }) : null,
2570
- r && /* @__PURE__ */ l("span", { className: "pvx-dash-combo-gap", children: [
3076
+ s && /* @__PURE__ */ l("span", { className: "pvx-dash-combo-gap", children: [
2571
3077
  "+",
2572
- r
3078
+ s
2573
3079
  ] }),
2574
3080
  e.personalBestMs && /* @__PURE__ */ n("span", { className: "pvx-dash-combo-pb", children: q(e.personalBestMs) })
2575
3081
  ] })
@@ -2577,15 +3083,15 @@ function Xn({ combo: e, onClick: t }) {
2577
3083
  }
2578
3084
  );
2579
3085
  }
2580
- function et({ events: e, isLoading: t, className: s, limit: r = 3 }) {
3086
+ function Bt({ events: e, isLoading: t, className: r, limit: s = 3 }) {
2581
3087
  if (t)
2582
3088
  return /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading upcoming events..." });
2583
3089
  if (!(e != null && e.length))
2584
3090
  return null;
2585
- const a = r ? e.slice(0, r) : e, i = e.length - a.length;
2586
- return /* @__PURE__ */ l("div", { className: `pvx-card ${s || ""}`, children: [
3091
+ const a = s ? e.slice(0, s) : e, o = e.length - a.length;
3092
+ return /* @__PURE__ */ l("div", { className: `pvx-card ${r || ""}`, children: [
2587
3093
  /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
2588
- /* @__PURE__ */ n(st, {}),
3094
+ /* @__PURE__ */ n(It, {}),
2589
3095
  "Upcoming Events",
2590
3096
  /* @__PURE__ */ l("span", { className: "pvx-dash-records-count", children: [
2591
3097
  "(",
@@ -2594,178 +3100,178 @@ function et({ events: e, isLoading: t, className: s, limit: r = 3 }) {
2594
3100
  ] })
2595
3101
  ] }) }),
2596
3102
  /* @__PURE__ */ l("div", { className: "pvx-upcoming-list", children: [
2597
- a.map((o) => /* @__PURE__ */ l(
3103
+ a.map((i) => /* @__PURE__ */ l(
2598
3104
  "div",
2599
3105
  {
2600
- className: `pvx-upcoming-item ${o.isNext ? "pvx-upcoming-item--next" : ""}`,
3106
+ className: `pvx-upcoming-item ${i.isNext ? "pvx-upcoming-item--next" : ""}`,
2601
3107
  children: [
2602
3108
  /* @__PURE__ */ l("div", { className: "pvx-upcoming-info", children: [
2603
- /* @__PURE__ */ n("span", { className: "pvx-upcoming-comp", children: o.competitionName }),
3109
+ /* @__PURE__ */ n("span", { className: "pvx-upcoming-comp", children: i.competitionName }),
2604
3110
  /* @__PURE__ */ l("span", { className: "pvx-upcoming-round", children: [
2605
3111
  "Round ",
2606
- o.roundNumber,
3112
+ i.roundNumber,
2607
3113
  ": ",
2608
- o.track
3114
+ i.track
2609
3115
  ] }),
2610
- o.serverPassword && /* @__PURE__ */ n(
2611
- nt,
3116
+ i.serverPassword && /* @__PURE__ */ n(
3117
+ Ut,
2612
3118
  {
2613
- password: o.serverPassword,
2614
- address: o.serverAddress
3119
+ password: i.serverPassword,
3120
+ address: i.serverAddress
2615
3121
  }
2616
3122
  )
2617
3123
  ] }),
2618
3124
  /* @__PURE__ */ l("div", { className: "pvx-upcoming-time", children: [
2619
- /* @__PURE__ */ n("span", { className: "pvx-upcoming-date", children: new Date(o.startTime).toLocaleDateString("en-GB", {
3125
+ /* @__PURE__ */ n("span", { className: "pvx-upcoming-date", children: new Date(i.startTime).toLocaleDateString("en-GB", {
2620
3126
  day: "numeric",
2621
3127
  month: "short",
2622
3128
  year: "numeric"
2623
3129
  }) }),
2624
- /* @__PURE__ */ n("span", { className: "pvx-upcoming-relative", children: o.dediStatus === "running" ? "Live now" : o.dediStatus === "provisioning" ? "Starting..." : tt(o.startTime) }),
2625
- o.dediStatus === "running" && /* @__PURE__ */ n("span", { className: "pvx-upcoming-badge pvx-upcoming-badge--live", children: "Live" }),
2626
- !o.dediStatus && o.isNext && /* @__PURE__ */ n("span", { className: "pvx-upcoming-badge", children: "Next" })
3130
+ /* @__PURE__ */ n("span", { className: "pvx-upcoming-relative", children: i.dediStatus === "running" ? "Live now" : i.dediStatus === "provisioning" ? "Starting..." : _t(i.startTime) }),
3131
+ i.dediStatus === "running" && /* @__PURE__ */ n("span", { className: "pvx-upcoming-badge pvx-upcoming-badge--live", children: "Live" }),
3132
+ !i.dediStatus && i.isNext && /* @__PURE__ */ n("span", { className: "pvx-upcoming-badge", children: "Next" })
2627
3133
  ] })
2628
3134
  ]
2629
3135
  },
2630
- `${o.competitionId}-${o.roundNumber}`
3136
+ `${i.competitionId}-${i.roundNumber}`
2631
3137
  )),
2632
- i > 0 && /* @__PURE__ */ l("div", { className: "pvx-upcoming-remaining", children: [
3138
+ o > 0 && /* @__PURE__ */ l("div", { className: "pvx-upcoming-remaining", children: [
2633
3139
  "+",
2634
- i,
3140
+ o,
2635
3141
  " more event",
2636
- i !== 1 ? "s" : ""
3142
+ o !== 1 ? "s" : ""
2637
3143
  ] })
2638
3144
  ] })
2639
3145
  ] });
2640
3146
  }
2641
- function nt({ password: e, address: t }) {
2642
- const [s, r] = B(!1), [a, i] = B(!1), o = t ? e ? `join:${t}|${e}` : `join:${t}` : null, d = K(async () => {
2643
- if (o)
3147
+ function Ut({ password: e, address: t }) {
3148
+ const [r, s] = E(!1), [a, o] = E(!1), i = t ? e ? `join:${t}|${e}` : `join:${t}` : null, d = H(async () => {
3149
+ if (i)
2644
3150
  try {
2645
- await navigator.clipboard.writeText(o), r(!0), setTimeout(() => r(!1), 2e3);
3151
+ await navigator.clipboard.writeText(i), s(!0), setTimeout(() => s(!1), 2e3);
2646
3152
  } catch {
2647
3153
  }
2648
- }, [o]);
3154
+ }, [i]);
2649
3155
  return /* @__PURE__ */ l("div", { className: "pvx-server-info", children: [
2650
- o && /* @__PURE__ */ l(
3156
+ i && /* @__PURE__ */ l(
2651
3157
  "span",
2652
3158
  {
2653
3159
  className: "pvx-server-detail pvx-server-detail--clickable",
2654
3160
  onClick: d,
2655
3161
  title: "Copy join string to clipboard",
2656
3162
  children: [
2657
- /* @__PURE__ */ n(at, {}),
3163
+ /* @__PURE__ */ n(qt, {}),
2658
3164
  " ",
2659
- s ? "Copied!" : "Join"
3165
+ r ? "Copied!" : "Join"
2660
3166
  ]
2661
3167
  }
2662
3168
  ),
2663
- e && /* @__PURE__ */ l(_, { children: [
3169
+ e && /* @__PURE__ */ l(B, { children: [
2664
3170
  /* @__PURE__ */ n(
2665
3171
  "span",
2666
3172
  {
2667
3173
  className: "pvx-server-detail pvx-server-detail--clickable",
2668
- onClick: () => i((p) => !p),
3174
+ onClick: () => o((p) => !p),
2669
3175
  title: a ? "Hide password" : "Reveal password",
2670
- children: a ? /* @__PURE__ */ n(ot, {}) : /* @__PURE__ */ n(it, {})
3176
+ children: a ? /* @__PURE__ */ n(jt, {}) : /* @__PURE__ */ n(Wt, {})
2671
3177
  }
2672
3178
  ),
2673
3179
  a && /* @__PURE__ */ l("span", { className: "pvx-server-detail", children: [
2674
- /* @__PURE__ */ n(rt, {}),
3180
+ /* @__PURE__ */ n(Ft, {}),
2675
3181
  " ",
2676
3182
  e
2677
3183
  ] })
2678
3184
  ] })
2679
3185
  ] });
2680
3186
  }
2681
- function tt(e) {
3187
+ function _t(e) {
2682
3188
  const t = new Date(e).getTime() - Date.now();
2683
3189
  if (t <= 0) return "Now";
2684
- const s = Math.floor(t / (1e3 * 60 * 60));
2685
- if (s < 1) return "Less than 1 hour";
2686
- if (s < 24) return `in ${s}h`;
2687
- const r = Math.floor(s / 24);
2688
- if (r === 1) return "Tomorrow";
2689
- if (r < 7) return `in ${r} days`;
2690
- if (r < 30) {
2691
- const a = Math.floor(r / 7);
3190
+ const r = Math.floor(t / (1e3 * 60 * 60));
3191
+ if (r < 1) return "Less than 1 hour";
3192
+ if (r < 24) return `in ${r}h`;
3193
+ const s = Math.floor(r / 24);
3194
+ if (s === 1) return "Tomorrow";
3195
+ if (s < 7) return `in ${s} days`;
3196
+ if (s < 30) {
3197
+ const a = Math.floor(s / 7);
2692
3198
  return `in ${a} week${a !== 1 ? "s" : ""}`;
2693
3199
  }
2694
- return oe(e);
3200
+ return pe(e);
2695
3201
  }
2696
- function st() {
3202
+ function It() {
2697
3203
  return /* @__PURE__ */ l("svg", { className: "pvx-dash-records-icon", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2698
3204
  /* @__PURE__ */ n("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
2699
3205
  /* @__PURE__ */ n("path", { d: "M16 2v4M8 2v4M3 10h18" })
2700
3206
  ] });
2701
3207
  }
2702
- function rt() {
3208
+ function Ft() {
2703
3209
  return /* @__PURE__ */ l("svg", { className: "pvx-server-icon", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2704
3210
  /* @__PURE__ */ n("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2" }),
2705
3211
  /* @__PURE__ */ n("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
2706
3212
  ] });
2707
3213
  }
2708
- function at() {
3214
+ function qt() {
2709
3215
  return /* @__PURE__ */ l("svg", { className: "pvx-server-icon pvx-server-icon--action", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2710
3216
  /* @__PURE__ */ n("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
2711
3217
  /* @__PURE__ */ n("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
2712
3218
  ] });
2713
3219
  }
2714
- function it() {
3220
+ function Wt() {
2715
3221
  return /* @__PURE__ */ l("svg", { className: "pvx-server-icon pvx-server-icon--action", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2716
3222
  /* @__PURE__ */ n("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
2717
3223
  /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "3" })
2718
3224
  ] });
2719
3225
  }
2720
- function ot() {
3226
+ function jt() {
2721
3227
  return /* @__PURE__ */ l("svg", { className: "pvx-server-icon pvx-server-icon--action", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2722
3228
  /* @__PURE__ */ n("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }),
2723
3229
  /* @__PURE__ */ n("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
2724
3230
  ] });
2725
3231
  }
2726
- function lt({ notifications: e, unreadCount: t = 0, onMarkRead: s, onMarkAllRead: r, isLoading: a, className: i }) {
2727
- const o = Ce();
2728
- return a ? /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading notifications..." }) : /* @__PURE__ */ l("div", { className: `pvx-card ${i || ""}`, children: [
3232
+ function Vt({ notifications: e, unreadCount: t = 0, onMarkRead: r, onMarkAllRead: s, isLoading: a, className: o }) {
3233
+ const i = ue();
3234
+ return a ? /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading notifications..." }) : /* @__PURE__ */ l("div", { className: `pvx-card ${o || ""}`, children: [
2729
3235
  /* @__PURE__ */ l("div", { className: "pvx-card-header", children: [
2730
3236
  /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
2731
- /* @__PURE__ */ n(pt, {}),
3237
+ /* @__PURE__ */ n(Ot, {}),
2732
3238
  "Notifications",
2733
3239
  t > 0 && /* @__PURE__ */ n("span", { className: "pvx-notif-badge", children: t > 99 ? "99+" : t })
2734
3240
  ] }),
2735
- t > 0 && r && /* @__PURE__ */ n("button", { className: "pvx-notif-mark-all", onClick: r, children: "Mark all read" })
3241
+ t > 0 && s && /* @__PURE__ */ n("button", { className: "pvx-notif-mark-all", onClick: s, children: "Mark all read" })
2736
3242
  ] }),
2737
3243
  e != null && e.length ? /* @__PURE__ */ n("div", { className: "pvx-notif-list", children: e.map((d) => /* @__PURE__ */ n(
2738
- ct,
3244
+ Kt,
2739
3245
  {
2740
3246
  notification: d,
2741
- getUserDisplay: o,
2742
- onMarkRead: s
3247
+ getUserDisplay: i,
3248
+ onMarkRead: r
2743
3249
  },
2744
3250
  d.id
2745
3251
  )) }) : /* @__PURE__ */ n("div", { className: "pvx-notif-empty", children: "No notifications" })
2746
3252
  ] });
2747
3253
  }
2748
- function ct({ notification: e, getUserDisplay: t, onMarkRead: s }) {
2749
- const r = () => {
2750
- !e.isRead && s && s(e.id);
3254
+ function Kt({ notification: e, getUserDisplay: t, onMarkRead: r }) {
3255
+ const s = () => {
3256
+ !e.isRead && r && r(e.id);
2751
3257
  };
2752
3258
  return /* @__PURE__ */ l(
2753
3259
  "button",
2754
3260
  {
2755
3261
  className: `pvx-notif-item ${e.isRead ? "" : "pvx-notif-item--unread"}`,
2756
- onClick: r,
3262
+ onClick: s,
2757
3263
  children: [
2758
- /* @__PURE__ */ n(dt, { type: e.type }),
3264
+ /* @__PURE__ */ n(Ht, { type: e.type }),
2759
3265
  /* @__PURE__ */ l("div", { className: "pvx-notif-content", children: [
2760
- /* @__PURE__ */ n("span", { className: "pvx-notif-message", children: Je(e, t) }),
2761
- /* @__PURE__ */ n("span", { className: "pvx-notif-time", children: oe(e.createdAt) })
3266
+ /* @__PURE__ */ n("span", { className: "pvx-notif-message", children: an(e, t) }),
3267
+ /* @__PURE__ */ n("span", { className: "pvx-notif-time", children: pe(e.createdAt) })
2762
3268
  ] }),
2763
3269
  !e.isRead && /* @__PURE__ */ n("span", { className: "pvx-notif-dot" })
2764
3270
  ]
2765
3271
  }
2766
3272
  );
2767
3273
  }
2768
- function dt({ type: e }) {
3274
+ function Ht({ type: e }) {
2769
3275
  return e === "RECORD_BEATEN" ? /* @__PURE__ */ n("span", { className: "pvx-notif-icon pvx-notif-icon--beaten", children: /* @__PURE__ */ n("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ n("path", { d: "m7 7 10 10M17 7v10H7" }) }) }) : e === "ADMIN_MESSAGE" ? /* @__PURE__ */ n("span", { className: "pvx-notif-icon pvx-notif-icon--admin", children: /* @__PURE__ */ l("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2770
3276
  /* @__PURE__ */ n("path", { d: "m3 11 18-5v12L3 13v-2z" }),
2771
3277
  /* @__PURE__ */ n("path", { d: "M11.6 16.8a3 3 0 1 1-5.8-1.6" })
@@ -2778,61 +3284,61 @@ function dt({ type: e }) {
2778
3284
  /* @__PURE__ */ n("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
2779
3285
  ] }) });
2780
3286
  }
2781
- function pt() {
3287
+ function Ot() {
2782
3288
  return /* @__PURE__ */ l("svg", { className: "pvx-dash-records-icon", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2783
3289
  /* @__PURE__ */ n("path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" }),
2784
3290
  /* @__PURE__ */ n("path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0" })
2785
3291
  ] });
2786
3292
  }
2787
- function It({
3293
+ function fr({
2788
3294
  steamId: e,
2789
3295
  avatarUrl: t,
2790
- memberSince: s,
2791
- hideProfile: r = !1,
3296
+ memberSince: r,
3297
+ hideProfile: s = !1,
2792
3298
  onComboSelect: a,
2793
- onGameRatingSelect: i,
2794
- className: o = ""
3299
+ onGameRatingSelect: o,
3300
+ className: i = ""
2795
3301
  }) {
2796
- const { data: d, isLoading: p, error: c } = _n(e), { data: u } = Vn(e), { data: v } = jn(e), { data: f, isLoading: h } = Kn(), k = Hn(), { data: x, isLoading: g } = Wn({ limit: 10 }), y = On(), m = zn();
2797
- return p ? /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading dashboard..." }) : c ? /* @__PURE__ */ n("div", { className: "pvx-empty", children: "Failed to load dashboard data." }) : d ? /* @__PURE__ */ l("div", { className: `pvx-dash ${o}`, children: [
2798
- !r && /* @__PURE__ */ n(
2799
- Qn,
3302
+ const { data: d, isLoading: p, error: c } = bt(e), { data: u } = kt(e), { data: v } = wt(e), { data: f, isLoading: h } = Ct(), y = St(), { data: x, isLoading: m } = Lt({ limit: 10 }), b = $t(), g = Tt();
3303
+ return p ? /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading dashboard..." }) : c ? /* @__PURE__ */ n("div", { className: "pvx-empty", children: "Failed to load dashboard data." }) : d ? /* @__PURE__ */ l("div", { className: `pvx-dash ${i}`, children: [
3304
+ !s && /* @__PURE__ */ n(
3305
+ Rt,
2800
3306
  {
2801
3307
  driverName: d.driverName,
2802
3308
  avatarUrl: t,
2803
- memberSince: s
3309
+ memberSince: r
2804
3310
  }
2805
3311
  ),
2806
3312
  /* @__PURE__ */ n(
2807
- Jn,
3313
+ Dt,
2808
3314
  {
2809
3315
  stats: d,
2810
3316
  gameRatings: u,
2811
- onGameRatingSelect: i
3317
+ onGameRatingSelect: o
2812
3318
  }
2813
3319
  ),
2814
- e && /* @__PURE__ */ n(et, { events: f, isLoading: h }),
2815
- /* @__PURE__ */ l("div", { className: `pvx-dash-row ${k ? "pvx-dash-row--2col" : ""}`, children: [
2816
- /* @__PURE__ */ n(Zn, { combos: v, onComboSelect: a }),
2817
- k && /* @__PURE__ */ n(
2818
- lt,
3320
+ e && /* @__PURE__ */ n(Bt, { events: f, isLoading: h }),
3321
+ /* @__PURE__ */ l("div", { className: `pvx-dash-row ${y ? "pvx-dash-row--2col" : ""}`, children: [
3322
+ /* @__PURE__ */ n(At, { combos: v, onComboSelect: a }),
3323
+ y && /* @__PURE__ */ n(
3324
+ Vt,
2819
3325
  {
2820
3326
  notifications: x == null ? void 0 : x.notifications,
2821
3327
  unreadCount: (x == null ? void 0 : x.unreadCount) || 0,
2822
- onMarkRead: (w) => y.mutate(w),
2823
- onMarkAllRead: () => m.mutate(),
2824
- isLoading: g
3328
+ onMarkRead: (k) => b.mutate(k),
3329
+ onMarkAllRead: () => g.mutate(),
3330
+ isLoading: m
2825
3331
  }
2826
3332
  )
2827
3333
  ] })
2828
3334
  ] }) : /* @__PURE__ */ n("div", { className: "pvx-empty", children: "No data available yet. Start driving to see your stats!" });
2829
3335
  }
2830
- function Ut({ records: e, className: t = "" }) {
2831
- const s = $(() => e != null && e.length ? e.slice().sort((r, a) => {
2832
- const i = r.recordedAt ? new Date(r.recordedAt).getTime() : 0;
2833
- return (a.recordedAt ? new Date(a.recordedAt).getTime() : 0) - i;
3336
+ function Nr({ records: e, className: t = "" }) {
3337
+ const r = T(() => e != null && e.length ? e.slice().sort((s, a) => {
3338
+ const o = s.recordedAt ? new Date(s.recordedAt).getTime() : 0;
3339
+ return (a.recordedAt ? new Date(a.recordedAt).getTime() : 0) - o;
2834
3340
  }) : [], [e]);
2835
- return s.length ? /* @__PURE__ */ l("div", { className: `pvx-card ${t}`, children: [
3341
+ return r.length ? /* @__PURE__ */ l("div", { className: `pvx-card ${t}`, children: [
2836
3342
  /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
2837
3343
  /* @__PURE__ */ n("span", { className: "pvx-dash-records-icon", children: /* @__PURE__ */ l("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2838
3344
  /* @__PURE__ */ n("path", { d: "M6 9H4.5a2.5 2.5 0 010-5H6" }),
@@ -2845,110 +3351,130 @@ function Ut({ records: e, className: t = "" }) {
2845
3351
  "Current Records",
2846
3352
  /* @__PURE__ */ l("span", { className: "pvx-dash-records-count", children: [
2847
3353
  "(",
2848
- s.length,
3354
+ r.length,
2849
3355
  ")"
2850
3356
  ] })
2851
3357
  ] }) }),
2852
- /* @__PURE__ */ n("div", { className: "pvx-dash-records-list", children: s.map((r, a) => /* @__PURE__ */ l("div", { className: "pvx-dash-record-row", children: [
3358
+ /* @__PURE__ */ n("div", { className: "pvx-dash-records-list", children: r.map((s, a) => /* @__PURE__ */ l("div", { className: "pvx-dash-record-row", children: [
2853
3359
  /* @__PURE__ */ l("div", { className: "pvx-dash-record-info", children: [
2854
- /* @__PURE__ */ n("span", { className: "pvx-dash-record-track", children: j(r.trackId, r.layout, r.game) }),
2855
- /* @__PURE__ */ n("span", { className: "pvx-dash-record-car", children: I(r.carId) })
3360
+ /* @__PURE__ */ n("span", { className: "pvx-dash-record-track", children: z(s.trackId, s.layout, s.game) }),
3361
+ /* @__PURE__ */ n("span", { className: "pvx-dash-record-car", children: I(s.carId) })
2856
3362
  ] }),
2857
3363
  /* @__PURE__ */ l("div", { className: "pvx-dash-record-time", children: [
2858
- /* @__PURE__ */ n("span", { className: "pvx-dash-record-lap", children: q(r.lapTimeMs) }),
2859
- /* @__PURE__ */ l("span", { className: `pvx-dash-game-badge pvx-dash-game-badge--${r.game || "evo"}`, children: [
2860
- (r.game || "evo").toUpperCase(),
2861
- r.gameVersion ? ` ${r.gameVersion}` : ""
3364
+ /* @__PURE__ */ n("span", { className: "pvx-dash-record-lap", children: q(s.lapTimeMs) }),
3365
+ /* @__PURE__ */ l("span", { className: `pvx-dash-game-badge pvx-dash-game-badge--${s.game || "evo"}`, children: [
3366
+ (s.game || "evo").toUpperCase(),
3367
+ s.gameVersion ? ` ${s.gameVersion}` : ""
2862
3368
  ] })
2863
3369
  ] })
2864
3370
  ] }, a)) })
2865
3371
  ] }) : null;
2866
3372
  }
2867
3373
  export {
2868
- kt as CarsTable,
2869
- U as CompEmptyState,
2870
- V as CompLoadingState,
2871
- Cn as CompetitionCard,
2872
- $t as CompetitionCards,
2873
- Pt as CompetitionResultsTabs,
2874
- wn as CompletedBadge,
2875
- Be as DEFAULT_COMPLETION_GRACE_DAYS,
2876
- It as DriverDashboard,
2877
- Qn as DriverProfile,
2878
- wt as DriversTable,
2879
- Tt as EntryList,
2880
- se as InfoPill,
2881
- Ct as LapHistoryTable,
2882
- lt as NotificationsCard,
2883
- he as PODIUM_MEDALS,
2884
- vt as PitVoxPartnerProvider,
2885
- Dn as RacePositionsChart,
2886
- Lt as RankingsTable,
2887
- Zn as RecentCombosCard,
2888
- Ut as RecordsTable,
2889
- Mt as RegisterButton,
2890
- Dt as RegistrationPanel,
2891
- Rt as RoundResults,
2892
- ve as RoundSessionResults,
2893
- $n as StandingsTable,
2894
- Jn as StatsCards,
2895
- yt as TracksTable,
2896
- gn as TypeBadge,
2897
- et as UpcomingEvents,
2898
- ye as buildDriverIndexPath,
2899
- Ge as buildLapsPath,
2900
- ie as buildLeaderboardPath,
2901
- Ye as buildRecentLapsPath,
2902
- D as fetchCdnJson,
2903
- St as filterCompetitionsByStatus,
3374
+ ir as CarsTable,
3375
+ _ as CompEmptyState,
3376
+ W as CompLoadingState,
3377
+ at as CompetitionCard,
3378
+ dr as CompetitionCards,
3379
+ vr as CompetitionResultsTabs,
3380
+ On as CompletedBadge,
3381
+ Ue as DEFAULT_COMPLETION_GRACE_DAYS,
3382
+ fr as DriverDashboard,
3383
+ Rt as DriverProfile,
3384
+ or as DriversTable,
3385
+ Fn as EnterButton,
3386
+ ur as EntryList,
3387
+ ae as InfoPill,
3388
+ lr as LapHistoryTable,
3389
+ Vt as NotificationsCard,
3390
+ xe as PODIUM_MEDALS,
3391
+ xn as PROMOTION_STATUS_LABELS,
3392
+ Zt as PitVoxPartnerProvider,
3393
+ In as PromotionCard,
3394
+ _n as PromotionCards,
3395
+ qn as PromotionDetail,
3396
+ sr as PromotionExplorer,
3397
+ Ie as PromotionStatusBadge,
3398
+ Fe as PromotionTypeBadge,
3399
+ ut as RacePositionsChart,
3400
+ cr as RankingsTable,
3401
+ At as RecentCombosCard,
3402
+ Nr as RecordsTable,
3403
+ hr as RegisterButton,
3404
+ mr as RegistrationPanel,
3405
+ pr as RoundResults,
3406
+ ye as RoundSessionResults,
3407
+ lt as StandingsTable,
3408
+ Dt as StatsCards,
3409
+ ar as TracksTable,
3410
+ Rn as TypeBadge,
3411
+ Bt as UpcomingEvents,
3412
+ st as WeatherIcon,
3413
+ Te as buildDriverIndexPath,
3414
+ rn as buildLapsPath,
3415
+ de as buildLeaderboardPath,
3416
+ sn as buildRecentLapsPath,
3417
+ M as fetchCdnJson,
3418
+ rr as filterCompetitionsByStatus,
2904
3419
  I as formatCarName,
2905
- W as formatDate,
2906
- xt as formatDelta,
2907
- we as formatFuel,
3420
+ Q as formatDate,
3421
+ Jt as formatDelta,
3422
+ Me as formatFuel,
2908
3423
  q as formatLapTime,
2909
- Je as formatNotificationMessage,
2910
- oe as formatRelativeTime,
2911
- E as formatSectorTime,
2912
- Z as formatSessionLabel,
2913
- j as formatTrackName,
2914
- ke as formatTyreCompound,
2915
- kn as getCompetitionPodium,
2916
- Ie as getCompetitionStatus,
2917
- yn as getCompletionDate,
2918
- bn as isCompetitionComplete,
2919
- ee as isRoundClosed,
2920
- Nt as useCarLeaderboard,
2921
- gt as useCarMetadata,
2922
- tn as useCompetitionAllRounds,
2923
- Le as useCompetitionConfig,
2924
- $e as useCompetitionEntryList,
2925
- sn as useCompetitionLeaderboard,
2926
- nn as useCompetitionRound,
2927
- an as useCompetitionRoundLaps,
2928
- rn as useCompetitionRoundLeaderboard,
2929
- on as useCompetitionRoundPositions,
2930
- Se as useCompetitionStandings,
2931
- bt as useCompetitions,
2932
- jn as useDriverCombos,
2933
- en as useDriverLaps,
2934
- At as useDriverRating,
2935
- re as useDriverRatings,
2936
- Vn as useDriverRatingsByGame,
2937
- _n as useDriverStats,
2938
- Ze as useLeaderboardIndex,
2939
- zn as useMarkAllNotificationsRead,
2940
- On as useMarkNotificationRead,
2941
- Wn as useNotifications,
2942
- Hn as useNotificationsEnabled,
2943
- C as usePitVox,
2944
- ft as useRecentLaps,
2945
- Re as useRegister,
2946
- ce as useRegistrationMode,
2947
- le as useRegistrationStatus,
2948
- de as useRegistrationUrl,
2949
- Xe as useTrackLeaderboard,
2950
- Bt as useUnreadCount,
2951
- Kn as useUpcomingEvents,
2952
- Ce as useUserLookup,
2953
- Te as useWithdraw
3424
+ an as formatNotificationMessage,
3425
+ K as formatPromotionDate,
3426
+ pe as formatRelativeTime,
3427
+ F as formatSectorTime,
3428
+ X as formatSessionLabel,
3429
+ z as formatTrackName,
3430
+ Re as formatTyreCompound,
3431
+ En as getCompetitionPodium,
3432
+ _e as getCompetitionStatus,
3433
+ An as getCompletionDate,
3434
+ J as getPromotionStatus,
3435
+ Dn as isCompetitionComplete,
3436
+ O as isRoundClosed,
3437
+ Un as promotionWindowSummary,
3438
+ nr as useCarLeaderboard,
3439
+ Xt as useCarMetadata,
3440
+ pn as useCompetitionAllRounds,
3441
+ Pe as useCompetitionConfig,
3442
+ Ae as useCompetitionEntryList,
3443
+ un as useCompetitionLeaderboard,
3444
+ dn as useCompetitionRound,
3445
+ mn as useCompetitionRoundLaps,
3446
+ hn as useCompetitionRoundLeaderboard,
3447
+ vn as useCompetitionRoundPositions,
3448
+ De as useCompetitionStandings,
3449
+ tr as useCompetitions,
3450
+ wt as useDriverCombos,
3451
+ cn as useDriverLaps,
3452
+ xr as useDriverRating,
3453
+ ie as useDriverRatings,
3454
+ kt as useDriverRatingsByGame,
3455
+ bt as useDriverStats,
3456
+ bn as useEnterPromotion,
3457
+ on as useLeaderboardIndex,
3458
+ Tt as useMarkAllNotificationsRead,
3459
+ $t as useMarkNotificationRead,
3460
+ Lt as useNotifications,
3461
+ St as useNotificationsEnabled,
3462
+ S as usePitVox,
3463
+ fn as usePromotionConfig,
3464
+ Nn as usePromotionEntryList,
3465
+ yn as usePromotionEntryStatus,
3466
+ kn as usePromotionMode,
3467
+ Cn as usePromotionUrl,
3468
+ gn as usePromotions,
3469
+ er as useRecentLaps,
3470
+ Ee as useRegister,
3471
+ me as useRegistrationMode,
3472
+ he as useRegistrationStatus,
3473
+ ve as useRegistrationUrl,
3474
+ ln as useTrackLeaderboard,
3475
+ gr as useUnreadCount,
3476
+ Ct as useUpcomingEvents,
3477
+ ue as useUserLookup,
3478
+ Be as useWithdraw,
3479
+ wn as useWithdrawPromotionEntry
2954
3480
  };