@pitvox/partner-react 0.7.21 → 0.7.22

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,13 +1,13 @@
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";
1
+ import { jsx as n, jsxs as l, Fragment as B } from "react/jsx-runtime";
2
+ import { createContext as He, useMemo as T, useContext as je, useState as E, useCallback as K, useRef as Ve, useEffect as We } from "react";
3
+ import { useQueryClient as O, QueryClient as Ke, QueryClientProvider as Oe, useQuery as $, useMutation as Y, useQueries as xe } from "@tanstack/react-query";
4
+ const ae = He(null), Ge = "https://cdn.pitvox.com", ze = "https://pitvox.com";
5
5
  let te = null;
6
- function vt({
6
+ function Rt({
7
7
  partnerSlug: e = null,
8
- cdnUrl: t = ze,
9
- pitvoxUrl: s = Qe,
10
- getSteamId: r,
8
+ cdnUrl: t = Ge,
9
+ pitvoxUrl: r = ze,
10
+ getSteamId: s,
11
11
  onRegister: a,
12
12
  onWithdraw: i,
13
13
  onFetchNotifications: o,
@@ -16,51 +16,51 @@ function vt({
16
16
  onFetchServerPassword: c,
17
17
  children: u
18
18
  }) {
19
- const v = $(() => ({
19
+ const v = T(() => ({
20
20
  partnerSlug: e,
21
21
  cdnUrl: t.replace(/\/$/, ""),
22
- pitvoxUrl: s.replace(/\/$/, ""),
23
- getSteamId: r || (() => null),
22
+ pitvoxUrl: r.replace(/\/$/, ""),
23
+ getSteamId: s || (() => null),
24
24
  onRegister: a || null,
25
25
  onWithdraw: i || null,
26
26
  onFetchNotifications: o || null,
27
27
  onMarkNotificationRead: d || null,
28
28
  onMarkAllNotificationsRead: p || null,
29
29
  onFetchServerPassword: c || null
30
- }), [e, t, s, r, a, i, o, d, p, c]);
30
+ }), [e, t, r, s, a, i, o, d, p, c]);
31
31
  let f = !1;
32
32
  try {
33
- H(), f = !0;
33
+ O(), f = !0;
34
34
  } catch {
35
35
  f = !1;
36
36
  }
37
- return f ? /* @__PURE__ */ n(ae.Provider, { value: v, children: u }) : (te || (te = new We({
37
+ return f ? /* @__PURE__ */ n(ae.Provider, { value: v, children: u }) : (te || (te = new Ke({
38
38
  defaultOptions: {
39
39
  queries: { staleTime: 6e4 }
40
40
  }
41
41
  })), /* @__PURE__ */ n(Oe, { client: te, children: /* @__PURE__ */ n(ae.Provider, { value: v, children: u }) }));
42
42
  }
43
- function C() {
44
- const e = Ve(ae);
43
+ function L() {
44
+ const e = je(ae);
45
45
  if (!e)
46
46
  throw new Error("usePitVox must be used within a <PitVoxPartnerProvider>");
47
47
  return e;
48
48
  }
49
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}`);
50
+ const r = await fetch(`${e}/${t}`);
51
+ if (!r.ok) {
52
+ if (r.status === 404 || r.status === 403) return null;
53
+ throw new Error(`CDN fetch failed: ${r.status}`);
54
54
  }
55
- return s.json();
55
+ return r.json();
56
56
  }
57
- function ie(e, t, s, ...r) {
57
+ function ie(e, t, r, ...s) {
58
58
  const a = ["leaderboards"];
59
- return e && a.push(`partners/${e}`), t && a.push(t), s && a.push(`v/${s}`), [...a, ...r].join("/");
59
+ return e && a.push(`partners/${e}`), t && a.push(t), r && a.push(`v/${r}`), [...a, ...s].join("/");
60
60
  }
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`;
61
+ function Qe(e, t, r, s) {
62
+ const a = s || "default";
63
+ return e ? `laps/partners/${e}/${t}/${r}/${a}.json` : `laps/${t}/${r}/${a}.json`;
64
64
  }
65
65
  function ye(e, t) {
66
66
  return e ? `laps/partners/${e}/${t}/index.json` : `laps/${t}/index.json`;
@@ -70,25 +70,25 @@ function Ye(e) {
70
70
  }
71
71
  function q(e) {
72
72
  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")}`;
73
+ const t = Math.floor(e / 1e3), r = Math.floor(t / 60), s = t % 60, a = e % 1e3;
74
+ return `${r}:${String(s).padStart(2, "0")}.${String(a).padStart(3, "0")}`;
75
75
  }
76
- function E(e) {
76
+ function F(e) {
77
77
  return !e && e !== 0 ? "-" : e >= 6e4 ? q(e) : (e / 1e3).toFixed(3);
78
78
  }
79
- function I(e) {
79
+ function _(e) {
80
80
  if (!e) return "";
81
81
  let t = e;
82
- return t.startsWith("ks_") && (t = t.slice(3)), t.split("_").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" ");
82
+ return t.startsWith("ks_") && (t = t.slice(3)), t.split("_").map((r) => r.charAt(0).toUpperCase() + r.slice(1)).join(" ");
83
83
  }
84
- function j(e, t, s) {
84
+ function V(e, t, r) {
85
85
  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;
86
+ const s = e.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" "), a = r === "acc" || !r && (t == null ? void 0 : t.toLowerCase()) === "track config";
87
+ if (!t || t === "default" || a) return s;
88
88
  const i = t.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" ");
89
- return `${r} ${i}`;
89
+ return `${s} ${i}`;
90
90
  }
91
- function W(e) {
91
+ function G(e) {
92
92
  if (!e) return "-";
93
93
  try {
94
94
  return new Date(e).toLocaleDateString("en-GB", {
@@ -102,21 +102,21 @@ function W(e) {
102
102
  }
103
103
  function oe(e) {
104
104
  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);
105
+ const t = Date.now() - new Date(e).getTime(), r = Math.floor(t / 1e3);
106
+ if (r < 60) return "Just now";
107
+ const s = Math.floor(r / 60);
108
+ if (s < 60) return `${s}m ago`;
109
+ const a = Math.floor(s / 60);
110
110
  if (a < 24) return `${a}h ago`;
111
111
  const i = Math.floor(a / 24);
112
- return i < 30 ? `${i}d ago` : W(e);
112
+ return i < 30 ? `${i}d ago` : G(e);
113
113
  }
114
- function xt(e) {
114
+ function Tt(e) {
115
115
  return e == null ? "" : `${e >= 0 ? "+" : "-"}${(Math.abs(e) / 1e3).toFixed(3)}`;
116
116
  }
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";
117
+ function Ze(e, t) {
118
+ const { type: r, title: s, trackId: a, trackLayout: i, carId: o, game: d, data: p } = e, c = typeof p == "string" ? JSON.parse(p) : p, u = a ? V(a, i, d) : null, v = o ? _(o) : null, f = [u, v].filter(Boolean).join(" — ");
119
+ 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
120
  }
121
121
  function ke(e) {
122
122
  return e ? {
@@ -137,35 +137,35 @@ function we(e) {
137
137
  const t = Number(e);
138
138
  return isNaN(t) ? "-" : t % 1 ? `${t.toFixed(1)}L` : `${t}L`;
139
139
  }
140
- function Ze(e = {}) {
140
+ function Je(e = {}) {
141
141
  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"],
142
+ const { cdnUrl: t, partnerSlug: r } = L(), { game: s, gameVersion: a } = e, i = ie(r, null, null, "index.json"), o = $({
143
+ queryKey: ["pitvox", "leaderboards", r, "index"],
144
144
  queryFn: () => D(t, i),
145
145
  staleTime: 3e4,
146
146
  refetchInterval: 3e4
147
- }), d = $(() => {
148
- var x;
149
- if (!((x = o.data) != null && x.tracks)) return [];
147
+ }), d = T(() => {
148
+ var m;
149
+ if (!((m = o.data) != null && m.tracks)) return [];
150
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) => ({
151
+ return s && (k = k.filter((g) => g.game === s)), a && (k = k.filter((g) => g.gameVersion === a)), k.map((g) => ({
152
152
  id: g.trackId,
153
153
  layout: g.layout,
154
154
  game: g.game,
155
155
  gameVersion: g.gameVersion,
156
- displayName: j(g.trackId, g.layout, g.game),
156
+ displayName: V(g.trackId, g.layout, g.game),
157
157
  driverCount: g.driverCount || 0,
158
158
  carCount: g.carCount || 0,
159
159
  record: g.recordHolder ? {
160
160
  visibleId: g.recordHolder.steamId || g.recordHolder.userId,
161
161
  carId: g.recordHolder.carId,
162
- carDisplayName: I(g.recordHolder.carId),
162
+ carDisplayName: _(g.recordHolder.carId),
163
163
  lapTimeMs: g.recordHolder.lapTimeMs,
164
164
  timestamp: g.recordHolder.recordedAt
165
165
  } : null,
166
166
  recordByTag: g.recordByTag || null
167
167
  }));
168
- }, [(p = o.data) == null ? void 0 : p.tracks, r, a]);
168
+ }, [(p = o.data) == null ? void 0 : p.tracks, s, a]);
169
169
  return {
170
170
  ...o,
171
171
  data: d,
@@ -176,47 +176,47 @@ function Ze(e = {}) {
176
176
  versions: ((h = o.data) == null ? void 0 : h.versions) || {}
177
177
  };
178
178
  }
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({
179
+ function Xe(e, t, r = {}) {
180
+ const { cdnUrl: s, partnerSlug: a } = L(), { carId: i, game: o, gameVersion: d } = r, p = t || "default", c = ie(a, o, d, `tracks/${e}/${p}.json`), { data: u, isLoading: v, error: f } = $({
181
181
  queryKey: ["pitvox", "leaderboards", a, "track", e, p, o, d],
182
- queryFn: () => D(r, c),
182
+ queryFn: () => D(s, c),
183
183
  enabled: !!e,
184
184
  staleTime: 3e4,
185
185
  refetchInterval: 3e4
186
186
  });
187
- return { data: $(() => {
187
+ return { data: T(() => {
188
188
  if (!(u != null && u.entries)) return [];
189
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);
190
+ if (o && (k = k.filter((m) => m.game === o)), !i) {
191
+ const m = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map();
192
+ for (const b of k) {
193
+ const x = b.steamId || b.userId;
194
+ g.has(b.carId) || g.set(b.carId, /* @__PURE__ */ new Set()), g.get(b.carId).add(x), (!m.has(b.carId) || b.lapTimeMs < m.get(b.carId).lapTimeMs) && m.set(b.carId, b);
195
195
  }
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);
196
+ return Array.from(m.values()).map((b) => {
197
+ var x;
198
+ return { ...b, driverCount: ((x = g.get(b.carId)) == null ? void 0 : x.size) || 0 };
199
+ }).sort((b, x) => b.lapTimeMs - x.lapTimeMs);
200
200
  }
201
- return k.filter((x) => x.carId === i).sort((x, g) => x.lapTimeMs - g.lapTimeMs);
201
+ return k.filter((m) => m.carId === i).sort((m, g) => m.lapTimeMs - g.lapTimeMs);
202
202
  }, [u == null ? void 0 : u.entries, i, o]), isLoading: v, error: f };
203
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"],
204
+ function en(e, t, r, s, a = {}) {
205
+ var m, g;
206
+ const { cdnUrl: i, partnerSlug: o } = L(), { showInvalid: d = !1, game: p, gameVersion: c } = a, u = e && t ? Qe(o, e, t, r) : null, f = $({
207
+ queryKey: ["pitvox", "laps", o, e, t, r || "default"],
208
208
  queryFn: () => D(i, u),
209
209
  enabled: !!e && !!t,
210
210
  staleTime: 3e4,
211
211
  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 };
212
+ }), h = T(() => {
213
+ var b;
214
+ return (b = f.data) != null && b.laps ? f.data.laps.filter((x) => !(x.carId !== s || p && x.game !== p || c && x.gameVersion !== c || !d && !x.isValid)).sort((x, w) => x.lapTimeMs - w.lapTimeMs) : [];
215
+ }, [(m = f.data) == null ? void 0 : m.laps, s, p, c, d]), k = T(() => {
216
+ const b = h.filter((N) => N.isValid && N.sector1Ms && N.sector2Ms && N.sector3Ms);
217
+ if (b.length < 2) return null;
218
+ const x = Math.min(...b.map((N) => N.sector1Ms)), w = Math.min(...b.map((N) => N.sector2Ms)), C = Math.min(...b.map((N) => N.sector3Ms)), M = x + w + C, P = Math.min(...b.map((N) => N.lapTimeMs));
219
+ return M >= P ? null : { lapTimeMs: M, sector1Ms: x, sector2Ms: w, sector3Ms: C };
220
220
  }, [h]);
221
221
  return {
222
222
  ...f,
@@ -226,156 +226,156 @@ function en(e, t, s, r, a = {}) {
226
226
  };
227
227
  }
228
228
  function Ce() {
229
- const { cdnUrl: e } = C(), { data: t } = M({
229
+ const { cdnUrl: e } = L(), { data: t } = $({
230
230
  queryKey: ["pitvox", "users", "index"],
231
231
  queryFn: () => D(e, "users/index.json"),
232
232
  staleTime: 5 * 6e4,
233
233
  gcTime: 30 * 6e4
234
- }), s = (t == null ? void 0 : t.users) || {};
235
- return (r, a) => {
236
- const i = s[r];
234
+ }), r = (t == null ? void 0 : t.users) || {};
235
+ return (s, a) => {
236
+ const i = r[s];
237
237
  return {
238
- displayName: (i == null ? void 0 : i.displayName) || a || r || "Unknown",
238
+ displayName: (i == null ? void 0 : i.displayName) || a || s || "Unknown",
239
239
  avatarUrl: (i == null ? void 0 : i.avatarUrl) || null,
240
240
  affiliations: (i == null ? void 0 : i.affiliations) || []
241
241
  };
242
242
  };
243
243
  }
244
- function gt(e = "evo") {
245
- const { cdnUrl: t } = C(), { data: s } = M({
244
+ function $t(e = "evo") {
245
+ const { cdnUrl: t } = L(), { data: r } = $({
246
246
  queryKey: ["pitvox", "cars", e],
247
247
  queryFn: () => D(t, `cars/${e}.json`),
248
248
  staleTime: 5 * 6e4,
249
249
  gcTime: 30 * 6e4
250
250
  });
251
251
  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) || {}
252
+ tags: (r == null ? void 0 : r.tags) || [],
253
+ cars: (r == null ? void 0 : r.cars) || {},
254
+ categories: (r == null ? void 0 : r.categories) || [],
255
+ tagLabels: (r == null ? void 0 : r.tagLabels) || {}
256
256
  };
257
257
  }
258
- function ft() {
258
+ function Mt() {
259
259
  var a, i;
260
- const { cdnUrl: e, partnerSlug: t } = C(), s = Ye(t), r = M({
260
+ const { cdnUrl: e, partnerSlug: t } = L(), r = Ye(t), s = $({
261
261
  queryKey: ["pitvox", "recentLaps", t],
262
- queryFn: () => D(e, s),
262
+ queryFn: () => D(e, r),
263
263
  staleTime: 3e4,
264
264
  refetchInterval: 3e4,
265
265
  gcTime: 10 * 6e4
266
266
  });
267
267
  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
268
+ groups: ((a = s.data) == null ? void 0 : a.groups) || [],
269
+ generatedAt: ((i = s.data) == null ? void 0 : i.generatedAt) || null,
270
+ isLoading: s.isLoading
271
271
  };
272
272
  }
273
- function Nt(e, t) {
273
+ function Dt(e, t) {
274
274
  return Xe(e, null, { carId: t });
275
275
  }
276
- function bt() {
277
- const { cdnUrl: e, partnerSlug: t } = C();
278
- return M({
276
+ function At() {
277
+ const { cdnUrl: e, partnerSlug: t } = L();
278
+ return $({
279
279
  queryKey: ["pitvox", "competitions", t],
280
280
  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 : [];
281
+ const r = await D(e, "competitions/index.json");
282
+ return r != null && r.competitions ? t ? r.competitions.filter((s) => s.partnerSlug === t) : r.competitions : [];
283
283
  },
284
284
  staleTime: 6e4
285
285
  });
286
286
  }
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,
287
+ function Se(e, t = {}) {
288
+ const r = L(), s = t.partnerSlug || r.partnerSlug;
289
+ return $({
290
+ queryKey: ["pitvox", "competition", s, e, "config"],
291
+ queryFn: () => D(r.cdnUrl, `competitions/${s}/${e}/config.json`),
292
+ enabled: !!s && !!e,
293
293
  staleTime: 6e4
294
294
  });
295
295
  }
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,
296
+ function Le(e, t = {}) {
297
+ const r = L(), s = t.partnerSlug || r.partnerSlug;
298
+ return $({
299
+ queryKey: ["pitvox", "competition", s, e, "standings"],
300
+ queryFn: () => D(r.cdnUrl, `competitions/${s}/${e}/standings.json`),
301
+ enabled: !!s && !!e,
302
302
  staleTime: 6e4
303
303
  });
304
304
  }
305
- function nn(e, t, s = {}) {
306
- const r = C(), a = s.partnerSlug || r.partnerSlug;
307
- return M({
305
+ function nn(e, t, r = {}) {
306
+ const s = L(), a = r.partnerSlug || s.partnerSlug;
307
+ return $({
308
308
  queryKey: ["pitvox", "competition", a, e, "round", t],
309
- queryFn: () => D(r.cdnUrl, `competitions/${a}/${e}/rounds/${t}.json`),
309
+ queryFn: () => D(s.cdnUrl, `competitions/${a}/${e}/rounds/${t}.json`),
310
310
  enabled: !!a && !!e && t != null,
311
311
  staleTime: 6e4
312
312
  });
313
313
  }
314
- function tn(e, t = [], s = {}) {
315
- const r = C(), a = s.partnerSlug || r.partnerSlug;
316
- return M({
314
+ function tn(e, t = [], r = {}) {
315
+ const s = L(), a = r.partnerSlug || s.partnerSlug;
316
+ return $({
317
317
  queryKey: ["pitvox", "competition", a, e, "allRounds", t],
318
318
  queryFn: async () => (await Promise.all(
319
319
  t.map(
320
- (o) => D(r.cdnUrl, `competitions/${a}/${e}/rounds/${o}.json`).catch(() => null)
320
+ (o) => D(s.cdnUrl, `competitions/${a}/${e}/rounds/${o}.json`).catch(() => null)
321
321
  )
322
322
  )).filter(Boolean),
323
323
  enabled: !!a && !!e && t.length > 0,
324
324
  staleTime: 6e4
325
325
  });
326
326
  }
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,
327
+ function rn(e, t = {}) {
328
+ const r = L(), s = t.partnerSlug || r.partnerSlug;
329
+ return $({
330
+ queryKey: ["pitvox", "competition", s, e, "leaderboard"],
331
+ queryFn: () => D(r.cdnUrl, `competitions/${s}/${e}/leaderboard.json`).catch(() => null),
332
+ enabled: !!s && !!e,
333
333
  staleTime: 6e4
334
334
  });
335
335
  }
336
- function rn(e, t, s = {}) {
337
- const r = C(), a = s.partnerSlug || r.partnerSlug;
338
- return M({
336
+ function sn(e, t, r = {}) {
337
+ const s = L(), a = r.partnerSlug || s.partnerSlug;
338
+ return $({
339
339
  queryKey: ["pitvox", "competition", a, e, "round", t, "leaderboard"],
340
- queryFn: () => D(r.cdnUrl, `competitions/${a}/${e}/rounds/${t}/leaderboard.json`).catch(() => null),
340
+ queryFn: () => D(s.cdnUrl, `competitions/${a}/${e}/rounds/${t}/leaderboard.json`).catch(() => null),
341
341
  enabled: !!a && !!e && t != null,
342
342
  staleTime: 6e4
343
343
  });
344
344
  }
345
- function an(e, t, s = {}) {
346
- const r = C(), a = s.partnerSlug || r.partnerSlug;
347
- return M({
345
+ function an(e, t, r = {}) {
346
+ const s = L(), a = r.partnerSlug || s.partnerSlug;
347
+ return $({
348
348
  queryKey: ["pitvox", "competition", a, e, "round", t, "laps"],
349
- queryFn: () => D(r.cdnUrl, `competitions/${a}/${e}/rounds/${t}/laps.json`).catch(() => null),
349
+ queryFn: () => D(s.cdnUrl, `competitions/${a}/${e}/rounds/${t}/laps.json`).catch(() => null),
350
350
  enabled: !!a && !!e && t != null,
351
351
  staleTime: 6e4
352
352
  });
353
353
  }
354
- function on(e, t, s = {}) {
355
- const r = C(), a = s.partnerSlug || r.partnerSlug;
356
- return M({
354
+ function on(e, t, r = {}) {
355
+ const s = L(), a = r.partnerSlug || s.partnerSlug;
356
+ return $({
357
357
  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,
358
+ queryFn: () => D(s.cdnUrl, `competitions/${a}/${e}/rounds/${t}/positions.json`).catch(() => null),
359
+ enabled: (r.enabled ?? !0) && !!a && !!e && t != null,
360
360
  staleTime: 6e4
361
361
  });
362
362
  }
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,
363
+ function Re(e, t = {}) {
364
+ const r = L(), s = t.partnerSlug || r.partnerSlug;
365
+ return $({
366
+ queryKey: ["pitvox", "competition", s, e, "entrylist"],
367
+ queryFn: () => D(r.cdnUrl, `competitions/${s}/${e}/entrylist.json`),
368
+ enabled: !!s && !!e,
369
369
  staleTime: 6e4
370
370
  });
371
371
  }
372
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],
373
+ const { cdnUrl: t, partnerSlug: r, getSteamId: s } = L(), a = s();
374
+ return $({
375
+ queryKey: ["pitvox", "registration", r, e, a],
376
376
  queryFn: async () => {
377
377
  var p;
378
- const i = await fetch(`${t}/competitions/${s}/${e}/entrylist.json`);
378
+ const i = await fetch(`${t}/competitions/${r}/${e}/entrylist.json`);
379
379
  if (!i.ok) return { isRegistered: !1, entryList: null };
380
380
  const o = await i.json();
381
381
  return { isRegistered: !!a && ((p = o.drivers) == null ? void 0 : p.some((c) => c.steamId === a)), entryList: o };
@@ -384,9 +384,9 @@ function le(e) {
384
384
  staleTime: 6e4
385
385
  });
386
386
  }
387
- function Re(e) {
388
- const { onRegister: t, partnerSlug: s, getSteamId: r } = C(), a = H(), i = Ce();
389
- return Q({
387
+ function Te(e) {
388
+ const { onRegister: t, partnerSlug: r, getSteamId: s } = L(), a = O(), i = Ce();
389
+ return Y({
390
390
  mutationFn: (o) => {
391
391
  if (!t)
392
392
  throw new Error(
@@ -395,9 +395,9 @@ function Re(e) {
395
395
  return t(e, o);
396
396
  },
397
397
  onSuccess: () => {
398
- const o = r();
398
+ const o = s();
399
399
  if (a.setQueriesData(
400
- { queryKey: ["pitvox", "registration", s, e] },
400
+ { queryKey: ["pitvox", "registration", r, e] },
401
401
  (d) => d ? { ...d, isRegistered: !0 } : { isRegistered: !0, entryList: null }
402
402
  ), o) {
403
403
  const d = i(o), p = {
@@ -406,7 +406,7 @@ function Re(e) {
406
406
  avatarUrl: d.avatarUrl
407
407
  };
408
408
  a.setQueriesData(
409
- { queryKey: ["pitvox", "competition", s, e, "entrylist"] },
409
+ { queryKey: ["pitvox", "competition", r, e, "entrylist"] },
410
410
  (c) => {
411
411
  var v;
412
412
  return c ? ((v = c.drivers) == null ? void 0 : v.some((f) => f.steamId === o)) ? c : { ...c, drivers: [...c.drivers || [], p] } : { drivers: [p] };
@@ -416,74 +416,74 @@ function Re(e) {
416
416
  }
417
417
  });
418
418
  }
419
- function Te(e) {
420
- const { onWithdraw: t, partnerSlug: s, getSteamId: r } = C(), a = H();
421
- return Q({
419
+ function $e(e) {
420
+ const { onWithdraw: t, partnerSlug: r, getSteamId: s } = L(), a = O();
421
+ return Y({
422
422
  mutationFn: (i) => {
423
423
  if (!t)
424
424
  throw new Error(
425
425
  "No onWithdraw callback provided to PitVoxPartnerProvider. Provide onWithdraw for in-app withdrawal, or use useRegistrationUrl() to link to pitvox.com."
426
426
  );
427
- const o = i || r();
427
+ const o = i || s();
428
428
  if (!o) throw new Error("No Steam ID available");
429
429
  return t(e, o);
430
430
  },
431
431
  onSuccess: () => {
432
- const i = r();
432
+ const i = s();
433
433
  a.setQueriesData(
434
- { queryKey: ["pitvox", "registration", s, e] },
434
+ { queryKey: ["pitvox", "registration", r, e] },
435
435
  (o) => o ? { ...o, isRegistered: !1 } : { isRegistered: !1, entryList: null }
436
436
  ), i && a.setQueriesData(
437
- { queryKey: ["pitvox", "competition", s, e, "entrylist"] },
437
+ { queryKey: ["pitvox", "competition", r, e, "entrylist"] },
438
438
  (o) => o != null && o.drivers ? { ...o, drivers: o.drivers.filter((d) => d.steamId !== i) } : o
439
439
  );
440
440
  }
441
441
  });
442
442
  }
443
443
  function ce() {
444
- const { onRegister: e, onWithdraw: t } = C(), s = !!(e && t);
445
- return { isPowerMode: s, isBasicMode: !s };
444
+ const { onRegister: e, onWithdraw: t } = L(), r = !!(e && t);
445
+ return { isPowerMode: r, isBasicMode: !r };
446
446
  }
447
447
  function de(e) {
448
- const { pitvoxUrl: t, partnerSlug: s } = C();
449
- return `${t}/p/${s}/competitions/${e}/register`;
448
+ const { pitvoxUrl: t, partnerSlug: r } = L();
449
+ return `${t}/p/${r}/competitions/${e}/register`;
450
450
  }
451
451
  function ln(e, t) {
452
- for (const s of t)
453
- if (s.tags.includes(e)) return s.id;
452
+ for (const r of t)
453
+ if (r.tags.includes(e)) return r.id;
454
454
  return "other";
455
455
  }
456
- function Me(e, t, s = []) {
456
+ function Me(e, t, r = []) {
457
457
  if (t.size === 0) return !0;
458
- const r = {};
458
+ const s = {};
459
459
  for (const a of t) {
460
- const i = ln(a, s);
461
- r[i] || (r[i] = []), r[i].push(a);
460
+ const i = ln(a, r);
461
+ s[i] || (s[i] = []), s[i].push(a);
462
462
  }
463
- for (const a of Object.values(r))
463
+ for (const a of Object.values(s))
464
464
  if (!a.some((i) => e.includes(i))) return !1;
465
465
  return !0;
466
466
  }
467
467
  function De(e, t) {
468
- const [s, r] = B(/* @__PURE__ */ new Set()), a = e !== void 0, i = a ? e : s, o = K((p) => {
468
+ const [r, s] = E(/* @__PURE__ */ new Set()), a = e !== void 0, i = a ? e : r, o = K((p) => {
469
469
  const c = new Set(i);
470
- c.has(p) ? c.delete(p) : c.add(p), a && t ? t(c) : r(c);
470
+ c.has(p) ? c.delete(p) : c.add(p), a && t ? t(c) : s(c);
471
471
  }, [i, a, t]), d = K(() => {
472
- a && t ? t(/* @__PURE__ */ new Set()) : r(/* @__PURE__ */ new Set());
472
+ a && t ? t(/* @__PURE__ */ new Set()) : s(/* @__PURE__ */ new Set());
473
473
  }, [a, t]);
474
474
  return { activeTags: i, toggle: o, clear: d };
475
475
  }
476
- function G(e) {
477
- const [t, s] = B(e), r = K((a) => {
478
- s(
476
+ function Z(e) {
477
+ const [t, r] = E(e), s = K((a) => {
478
+ r(
479
479
  (i) => i.key === a ? { key: a, dir: i.dir === "asc" ? "desc" : "asc" } : { key: a, dir: a.includes("timestamp") || a.includes("Date") ? "desc" : "asc" }
480
480
  );
481
481
  }, []);
482
- return [t, r];
482
+ return [t, s];
483
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);
484
+ function J(e, t, r) {
485
+ return [...e].sort((s, a) => {
486
+ const i = r(s, t.key), o = r(a, t.key);
487
487
  if (i == null && o == null) return 0;
488
488
  if (i == null) return 1;
489
489
  if (o == null) return -1;
@@ -491,48 +491,48 @@ function Y(e, t, s) {
491
491
  return t.dir === "desc" ? -d : d;
492
492
  });
493
493
  }
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))
494
+ function Ae(e, t = !1) {
495
+ const r = t ? e == null ? void 0 : e.filter((s) => s.isValid) : e;
496
+ return r != null && r.length ? {
497
+ s1: Math.min(...r.map((s) => s.sector1Ms).filter(Boolean)),
498
+ s2: Math.min(...r.map((s) => s.sector2Ms).filter(Boolean)),
499
+ s3: Math.min(...r.map((s) => s.sector3Ms).filter(Boolean))
500
500
  } : null;
501
501
  }
502
502
  function cn({ active: e, dir: t }) {
503
503
  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
504
  }
505
- function A({ label: e, sortKey: t, config: s, onSort: r, className: a = "" }) {
505
+ function I({ label: e, sortKey: t, config: r, onSort: s, className: a = "" }) {
506
506
  return /* @__PURE__ */ n(
507
507
  "th",
508
508
  {
509
509
  className: `pvx-th pvx-th--sortable ${a}`,
510
- onClick: () => r(t),
510
+ onClick: () => s(t),
511
511
  children: /* @__PURE__ */ l("span", { className: "pvx-th-inner", children: [
512
512
  e,
513
- /* @__PURE__ */ n(cn, { active: s.key === t, dir: s.dir })
513
+ /* @__PURE__ */ n(cn, { active: r.key === t, dir: r.dir })
514
514
  ] })
515
515
  }
516
516
  );
517
517
  }
518
- function J({ userId: e, getUserDisplay: t }) {
519
- const { displayName: s, avatarUrl: r } = t(e);
518
+ function X({ userId: e, getUserDisplay: t }) {
519
+ const { displayName: r, avatarUrl: s } = t(e);
520
520
  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 })
521
+ s ? /* @__PURE__ */ n("img", { src: s, 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: r })
523
523
  ] });
524
524
  }
525
525
  function pe({ rank: e, podium: t = !1 }) {
526
526
  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
527
  }
528
- function Ae({ availableTags: e, activeTags: t, onToggle: s, onClear: r, categories: a = [], tagLabels: i = {} }) {
528
+ function Pe({ availableTags: e, activeTags: t, onToggle: r, onClear: s, categories: a = [], tagLabels: i = {} }) {
529
529
  if (!e || e.length < 2) return null;
530
530
  const o = a.map((d) => ({ id: d.id, tags: d.tags.filter((p) => e.includes(p)) })).filter((d) => d.tags.length > 0);
531
531
  return /* @__PURE__ */ l("div", { className: "pvx-tag-bar", children: [
532
532
  /* @__PURE__ */ n(
533
533
  "button",
534
534
  {
535
- onClick: r,
535
+ onClick: s,
536
536
  className: `pvx-tag ${t.size === 0 ? "pvx-tag--active" : ""}`,
537
537
  children: "All"
538
538
  }
@@ -542,7 +542,7 @@ function Ae({ availableTags: e, activeTags: t, onToggle: s, onClear: r, categori
542
542
  d.tags.map((c) => /* @__PURE__ */ n(
543
543
  "button",
544
544
  {
545
- onClick: () => s(c),
545
+ onClick: () => r(c),
546
546
  className: `pvx-tag ${t.has(c) ? "pvx-tag--active" : ""}`,
547
547
  children: i[c] || c
548
548
  },
@@ -552,21 +552,21 @@ function Ae({ availableTags: e, activeTags: t, onToggle: s, onClear: r, categori
552
552
  ] });
553
553
  }
554
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;
555
+ return /* @__PURE__ */ n("nav", { className: "pvx-breadcrumb", "aria-label": "Breadcrumb", children: /* @__PURE__ */ n("ol", { className: "pvx-breadcrumb-list", children: e.map((t, r) => {
556
+ const s = r === e.length - 1;
557
557
  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 })
558
+ 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" }) }),
559
+ !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
560
  ] }, t.key);
561
561
  }) }) });
562
562
  }
563
- function O({ message: e }) {
563
+ function z({ message: e }) {
564
564
  return /* @__PURE__ */ l("div", { className: "pvx-empty", children: [
565
565
  /* @__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
566
  /* @__PURE__ */ n("p", { children: e })
567
567
  ] });
568
568
  }
569
- function z() {
569
+ function Q() {
570
570
  return /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading..." });
571
571
  }
572
572
  function dn() {
@@ -575,166 +575,166 @@ function dn() {
575
575
  function pn() {
576
576
  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
577
  }
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 = $(() => {
578
+ function Pt({ tracks: e, isLoading: t, carMetadata: r, getUserDisplay: s, onTrackSelect: a, tags: i, onTagChange: o }) {
579
+ const [d, p] = Z({ key: "record.timestamp", dir: "desc" }), { activeTags: c, toggle: u, clear: v } = De(i, o), f = T(() => {
580
580
  var g;
581
- if (!((g = s == null ? void 0 : s.tags) != null && g.length)) return [];
582
- 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;
588
- if (!x.recordByTag) return null;
581
+ if (!((g = r == null ? void 0 : r.tags) != null && g.length)) return [];
582
+ const m = /* @__PURE__ */ new Set();
583
+ for (const b of e || [])
584
+ b.recordByTag && Object.keys(b.recordByTag).forEach((x) => m.add(x));
585
+ return r.tags.filter((b) => m.has(b));
586
+ }, [e, r]), h = T(() => e ? c.size === 0 ? e : e.map((m) => {
587
+ var x, w;
588
+ if (!m.recordByTag) return null;
589
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);
590
+ const b = /* @__PURE__ */ new Set();
591
+ for (const C of Object.values(m.recordByTag)) {
592
+ if (b.has(C.carId)) continue;
593
+ b.add(C.carId);
594
+ const M = ((w = (x = r == null ? void 0 : r.cars) == null ? void 0 : x[C.carId]) == null ? void 0 : w.tags) || [];
595
+ Me(M, c, r == null ? void 0 : r.categories) && (!g || C.lapTimeMs < g.lapTimeMs) && (g = C);
596
596
  }
597
597
  return g ? {
598
- ...x,
598
+ ...m,
599
599
  record: {
600
600
  visibleId: g.steamId || g.identifier,
601
601
  carId: g.carId,
602
- carDisplayName: I(g.carId),
602
+ carDisplayName: _(g.carId),
603
603
  lapTimeMs: g.lapTimeMs,
604
604
  timestamp: g.recordedAt
605
605
  }
606
606
  } : null;
607
- }).filter(Boolean) : [], [e, c, s]), k = $(() => Y(h, d, (x, g) => {
608
- var y, m;
607
+ }).filter(Boolean) : [], [e, c, r]), k = T(() => J(h, d, (m, g) => {
608
+ var b, x;
609
609
  switch (g) {
610
610
  case "displayName":
611
- return x.displayName;
611
+ return m.displayName;
612
612
  case "record.lapTimeMs":
613
- return (y = x.record) == null ? void 0 : y.lapTimeMs;
613
+ return (b = m.record) == null ? void 0 : b.lapTimeMs;
614
614
  case "driverCount":
615
- return x.driverCount || 0;
615
+ return m.driverCount || 0;
616
616
  case "carCount":
617
- return x.carCount || 0;
617
+ return m.carCount || 0;
618
618
  case "record.timestamp":
619
619
  default:
620
- return (m = x.record) != null && m.timestamp ? new Date(x.record.timestamp).getTime() : 0;
620
+ return (x = m.record) != null && x.timestamp ? new Date(m.record.timestamp).getTime() : 0;
621
621
  }
622
622
  }), [h, d]);
623
- return t ? /* @__PURE__ */ n(z, {}) : e != null && e.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
623
+ return t ? /* @__PURE__ */ n(Q, {}) : e != null && e.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
624
624
  /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n("h2", { className: "pvx-card-title", children: "Track Records" }) }),
625
625
  /* @__PURE__ */ n(
626
- Ae,
626
+ Pe,
627
627
  {
628
628
  availableTags: f,
629
629
  activeTags: c,
630
630
  onToggle: u,
631
631
  onClear: v,
632
- categories: s == null ? void 0 : s.categories,
633
- tagLabels: s == null ? void 0 : s.tagLabels
632
+ categories: r == null ? void 0 : r.categories,
633
+ tagLabels: r == null ? void 0 : r.tagLabels
634
634
  }
635
635
  ),
636
636
  /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
637
637
  /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
638
- /* @__PURE__ */ n(A, { label: "Track", sortKey: "displayName", config: d, onSort: p }),
638
+ /* @__PURE__ */ n(I, { label: "Track", sortKey: "displayName", config: d, onSort: p }),
639
639
  /* @__PURE__ */ n("th", { className: "pvx-th", children: "Record Holder" }),
640
640
  /* @__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" })
641
+ /* @__PURE__ */ n(I, { label: "Lap Time", sortKey: "record.lapTimeMs", config: d, onSort: p }),
642
+ /* @__PURE__ */ n(I, { label: "Drivers", sortKey: "driverCount", config: d, onSort: p, className: "pvx-hidden-below-md" }),
643
+ /* @__PURE__ */ n(I, { label: "Cars", sortKey: "carCount", config: d, onSort: p, className: "pvx-hidden-below-lg" }),
644
+ /* @__PURE__ */ n(I, { label: "Date", sortKey: "record.timestamp", config: d, onSort: p, className: "pvx-hidden-below-xl" })
645
645
  ] }) }),
646
- /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: k.map((x) => {
647
- var g, y, m;
646
+ /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: k.map((m) => {
647
+ var g, b, x;
648
648
  return /* @__PURE__ */ l(
649
649
  "tr",
650
650
  {
651
651
  className: "pvx-row pvx-row--clickable",
652
- onClick: () => a(x.id, x.layout),
652
+ onClick: () => a(m.id, m.layout),
653
653
  children: [
654
- /* @__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) || "-" }),
657
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: x.record ? q(x.record.lapTimeMs) : "-" }),
658
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: x.driverCount || "-" }),
659
- /* @__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) : "-" })
654
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: m.displayName }),
655
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: (g = m.record) != null && g.visibleId ? /* @__PURE__ */ n(X, { userId: m.record.visibleId, getUserDisplay: s }) : "-" }),
656
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-lg", children: ((b = m.record) == null ? void 0 : b.carDisplayName) || "-" }),
657
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: m.record ? q(m.record.lapTimeMs) : "-" }),
658
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: m.driverCount || "-" }),
659
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: m.carCount || "-" }),
660
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: (x = m.record) != null && x.timestamp ? G(m.record.timestamp) : "-" })
661
661
  ]
662
662
  },
663
- `${x.id}|${x.layout || ""}`
663
+ `${m.id}|${m.layout || ""}`
664
664
  );
665
665
  }) })
666
666
  ] }) })
667
- ] }) : /* @__PURE__ */ n(O, { message: "No lap times recorded yet." });
667
+ ] }) : /* @__PURE__ */ n(z, { message: "No lap times recorded yet." });
668
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) => {
669
+ function Bt({ entries: e, isLoading: t, track: r, carMetadata: s, getUserDisplay: a, onCarSelect: i, onNavigate: o, tags: d, onTagChange: p }) {
670
+ const [c, u] = Z({ key: "lapTimeMs", dir: "asc" }), { activeTags: v, toggle: f, clear: h } = De(d, p), k = T(() => {
671
+ var w, C, M;
672
+ if (!e || !((w = s == null ? void 0 : s.tags) != null && w.length)) return [];
673
+ const x = /* @__PURE__ */ new Set();
674
+ for (const P of e)
675
+ (((M = (C = s.cars) == null ? void 0 : C[P.carId]) == null ? void 0 : M.tags) || []).forEach((S) => x.add(S));
676
+ return s.tags.filter((P) => x.has(P));
677
+ }, [e, s]), m = T(() => e ? v.size === 0 ? e : e.filter((x) => {
678
+ var C, M;
679
+ const w = ((M = (C = s == null ? void 0 : s.cars) == null ? void 0 : C[x.carId]) == null ? void 0 : M.tags) || [];
680
+ return Me(w, v, s == null ? void 0 : s.categories);
681
+ }) : [], [e, v, s]), g = T(() => J(m, c, (x, w) => {
682
682
  switch (w) {
683
683
  case "carId":
684
- return I(m.carId);
684
+ return _(x.carId);
685
685
  case "driverCount":
686
- return m.driverCount || 0;
686
+ return x.driverCount || 0;
687
687
  case "lapTimeMs":
688
688
  default:
689
- return m.lapTimeMs;
689
+ return x.lapTimeMs;
690
690
  }
691
- }), [x, c]), y = [
691
+ }), [m, c]), b = [
692
692
  { key: "tracks", label: "Tracks", onClick: () => o("tracks") },
693
- { key: "track", label: s.displayName }
693
+ { key: "track", label: r.displayName }
694
694
  ];
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 }) }),
695
+ return t ? /* @__PURE__ */ n(Q, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
696
+ /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(ue, { segments: b }) }),
697
697
  /* @__PURE__ */ n(
698
- Ae,
698
+ Pe,
699
699
  {
700
700
  availableTags: k,
701
701
  activeTags: v,
702
702
  onToggle: f,
703
703
  onClear: h,
704
- categories: r == null ? void 0 : r.categories,
705
- tagLabels: r == null ? void 0 : r.tagLabels
704
+ categories: s == null ? void 0 : s.categories,
705
+ tagLabels: s == null ? void 0 : s.tagLabels
706
706
  }
707
707
  ),
708
708
  e != null && e.length ? /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
709
709
  /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
710
710
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
711
- /* @__PURE__ */ n(A, { label: "Car", sortKey: "carId", config: c, onSort: u }),
711
+ /* @__PURE__ */ n(I, { label: "Car", sortKey: "carId", config: c, onSort: u }),
712
712
  /* @__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" }),
713
+ /* @__PURE__ */ n(I, { label: "Lap Time", sortKey: "lapTimeMs", config: c, onSort: u }),
714
+ /* @__PURE__ */ n(I, { label: "Drivers", sortKey: "driverCount", config: c, onSort: u, className: "pvx-hidden-below-md" }),
715
715
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Date" })
716
716
  ] }) }),
717
- /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: g.map((m, w) => /* @__PURE__ */ l(
717
+ /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: g.map((x, w) => /* @__PURE__ */ l(
718
718
  "tr",
719
719
  {
720
720
  className: "pvx-row pvx-row--clickable",
721
- onClick: () => i(m.carId),
721
+ onClick: () => i(x.carId),
722
722
  children: [
723
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) : "-" })
724
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: _(x.carId) }),
725
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(X, { userId: x.steamId || x.userId, getUserDisplay: a }) }),
726
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: q(x.lapTimeMs) }),
727
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: x.driverCount || "-" }),
728
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-lg", children: x.recordedAt ? G(x.recordedAt) : "-" })
729
729
  ]
730
730
  },
731
- m.carId
731
+ x.carId
732
732
  )) })
733
- ] }) }) : /* @__PURE__ */ n(O, { message: "No lap times for this track yet." })
733
+ ] }) }) : /* @__PURE__ */ n(z, { message: "No lap times for this track yet." })
734
734
  ] });
735
735
  }
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) => {
736
+ function It({ entries: e, isLoading: t, track: r, carId: s, getUserDisplay: a, onDriverSelect: i, onNavigate: o, highlightId: d }) {
737
+ const [p, c] = Z({ key: "lapTimeMs", dir: "asc" }), u = T(() => Ae(e), [e]), v = T(() => J(e || [], p, (h, k) => {
738
738
  switch (k) {
739
739
  case "userId":
740
740
  return a(h.steamId || h.userId).displayName;
@@ -746,64 +746,64 @@ function wt({ entries: e, isLoading: t, track: s, carId: r, getUserDisplay: a, o
746
746
  }
747
747
  }), [e, p, a]), f = [
748
748
  { key: "tracks", label: "Tracks", onClick: () => o("tracks") },
749
- { key: "track", label: s.displayName, onClick: () => o("track") },
750
- { key: "car", label: I(r) }
749
+ { key: "track", label: r.displayName, onClick: () => o("track") },
750
+ { key: "car", label: _(s) }
751
751
  ];
752
- return t ? /* @__PURE__ */ n(z, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
752
+ return t ? /* @__PURE__ */ n(Q, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
753
753
  /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(ue, { segments: f }) }),
754
754
  e != null && e.length ? /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
755
755
  /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
756
756
  /* @__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 }),
757
+ /* @__PURE__ */ n(I, { label: "Driver", sortKey: "userId", config: p, onSort: c }),
758
+ /* @__PURE__ */ n(I, { label: "Lap Time", sortKey: "lapTimeMs", config: p, onSort: c }),
759
759
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
760
760
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
761
761
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" }),
762
762
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Tyre" }),
763
763
  /* @__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" }),
764
+ /* @__PURE__ */ n(I, { label: "Laps", sortKey: "lapCount", config: p, onSort: c, className: "pvx-hidden-below-lg" }),
765
765
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
766
766
  ] }) }),
767
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;
768
+ const m = k + 1, g = h.steamId || h.userId, b = u && h.sector1Ms === u.s1, x = u && h.sector2Ms === u.s2, w = u && h.sector3Ms === u.s3;
769
769
  return /* @__PURE__ */ l(
770
770
  "tr",
771
771
  {
772
- className: `pvx-row pvx-row--clickable ${d && g === d ? "pvx-row--highlight" : x <= 3 ? "pvx-row--podium" : ""}`,
772
+ className: `pvx-row pvx-row--clickable ${d && g === d ? "pvx-row--highlight" : m <= 3 ? "pvx-row--podium" : ""}`,
773
773
  onClick: () => i(g),
774
774
  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 }) }),
775
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(pe, { rank: m, podium: !0 }) }),
776
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(X, { userId: g, getUserDisplay: a }) }),
777
777
  /* @__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) }),
778
+ /* @__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) }),
779
+ /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${x ? "pvx-td--best-sector" : ""}`, children: F(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: F(h.sector3Ms) }),
781
781
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: ke(h.tyreCompound), children: h.tyreCompound || "-" }),
782
782
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-xl", children: we(h.startingFuelL) }),
783
783
  /* @__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) : "-" })
784
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: h.recordedAt ? G(h.recordedAt) : "-" })
785
785
  ]
786
786
  },
787
787
  g
788
788
  );
789
789
  }) })
790
- ] }) }) : /* @__PURE__ */ n(O, { message: "No lap times for this car yet." })
790
+ ] }) }) : /* @__PURE__ */ n(z, { message: "No lap times for this car yet." })
791
791
  ] });
792
792
  }
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 = [
793
+ function Et({ userId: e, track: t, carId: r, game: s, 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, r, { showInvalid: i, game: s, gameVersion: a }), { displayName: h, avatarUrl: k } = o(e, u), m = T(() => Ae(c, !0), [c]), g = T(() => {
795
+ const x = (c == null ? void 0 : c.filter((w) => w.isValid)) || [];
796
+ return x.length ? Math.min(...x.map((w) => w.lapTimeMs)) : null;
797
+ }, [c]), b = [
798
798
  { key: "tracks", label: "Tracks", onClick: () => p("tracks") },
799
799
  { key: "track", label: t.displayName, onClick: () => p("track") },
800
- { key: "car", label: I(s), onClick: () => p("car") },
800
+ { key: "car", label: _(r), onClick: () => p("car") },
801
801
  { key: "driver", label: h }
802
802
  ];
803
- return f ? /* @__PURE__ */ n(z, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
803
+ return f ? /* @__PURE__ */ n(Q, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
804
804
  /* @__PURE__ */ l("div", { className: "pvx-card-header pvx-card-header--split", children: [
805
805
  /* @__PURE__ */ l("div", { className: "pvx-card-header-left", children: [
806
- /* @__PURE__ */ n(ue, { segments: y }),
806
+ /* @__PURE__ */ n(ue, { segments: b }),
807
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" })
808
808
  ] }),
809
809
  /* @__PURE__ */ l("label", { className: "pvx-checkbox-label", children: [
@@ -824,11 +824,11 @@ function Ct({ userId: e, track: t, carId: s, game: r, gameVersion: a, showInvali
824
824
  /* @__PURE__ */ n("span", { className: "pvx-theoretical-best-time", children: q(v.lapTimeMs) }),
825
825
  /* @__PURE__ */ l("span", { className: "pvx-theoretical-best-sectors", children: [
826
826
  "(",
827
- E(v.sector1Ms),
827
+ F(v.sector1Ms),
828
828
  " + ",
829
- E(v.sector2Ms),
829
+ F(v.sector2Ms),
830
830
  " + ",
831
- E(v.sector3Ms),
831
+ F(v.sector3Ms),
832
832
  ")"
833
833
  ] })
834
834
  ] }),
@@ -845,27 +845,27 @@ function Ct({ userId: e, track: t, carId: s, game: r, gameVersion: a, showInvali
845
845
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Fuel" }),
846
846
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
847
847
  ] }) }),
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);
848
+ /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: c.map((x, w) => {
849
+ const C = x.isValid && x.lapTimeMs === g, M = m && x.isValid && x.sector1Ms === m.s1, P = m && x.isValid && x.sector2Ms === m.s2, N = m && x.isValid && x.sector3Ms === m.s3;
850
+ let S = "pvx-row";
851
+ return x.isValid || (S += " pvx-row--invalid"), C && (S += " pvx-row--personal-best"), /* @__PURE__ */ l("tr", { className: S, children: [
852
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n("span", { className: `pvx-rank ${C ? "pvx-rank--gold" : ""}`, children: w + 1 }) }),
853
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-md", children: x.lapNumber || "-" }),
854
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: q(x.lapTimeMs) }),
855
+ /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${M ? "pvx-td--best-sector" : ""}`, children: F(x.sector1Ms) }),
856
+ /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${P ? "pvx-td--best-sector" : ""}`, children: F(x.sector2Ms) }),
857
+ /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${N ? "pvx-td--best-sector" : ""}`, children: F(x.sector3Ms) }),
858
+ /* @__PURE__ */ n("td", { className: "pvx-td", title: x.isValid ? void 0 : x.invalidReason || "Invalid", children: x.isValid ? /* @__PURE__ */ n(dn, {}) : /* @__PURE__ */ n(pn, {}) }),
859
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: ke(x.tyreCompound), children: x.tyreCompound || "-" }),
860
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: we(x.startingFuelL) }),
861
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: G(x.timestamp) })
862
+ ] }, x.id);
863
863
  }) })
864
- ] }) }) : /* @__PURE__ */ n(O, { message: i ? "No laps recorded for this combination." : 'No valid laps. Try enabling "Show invalid laps".' })
864
+ ] }) }) : /* @__PURE__ */ n(z, { message: i ? "No laps recorded for this combination." : 'No valid laps. Try enabling "Show invalid laps".' })
865
865
  ] });
866
866
  }
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) => {
867
+ function _t({ drivers: e, isLoading: t, getUserDisplay: r, game: s, gameVersion: a, onComboSelect: i }) {
868
+ const [o, d] = Z({ key: "rank", dir: "asc" }), [p, c] = E(null), u = T(() => e ? J(e, o, (f, h) => {
869
869
  switch (h) {
870
870
  case "rating":
871
871
  return f.rating;
@@ -878,9 +878,9 @@ function Lt({ drivers: e, isLoading: t, getUserDisplay: s, game: r, gameVersion:
878
878
  return f.rank;
879
879
  }
880
880
  }) : [], [e, o]);
881
- if (t) return /* @__PURE__ */ n(z, {});
881
+ if (t) return /* @__PURE__ */ n(Q, {});
882
882
  if (!(e != null && e.length))
883
- return /* @__PURE__ */ n("div", { className: "pvx-card", children: /* @__PURE__ */ n(O, { message: "Not enough data for rankings yet." }) });
883
+ return /* @__PURE__ */ n("div", { className: "pvx-card", children: /* @__PURE__ */ n(z, { message: "Not enough data for rankings yet." }) });
884
884
  const v = 5;
885
885
  return /* @__PURE__ */ l("div", { className: "pvx-card", children: [
886
886
  /* @__PURE__ */ l("div", { className: "pvx-card-header pvx-rankings-header", children: [
@@ -900,11 +900,11 @@ function Lt({ drivers: e, isLoading: t, getUserDisplay: s, game: r, gameVersion:
900
900
  ] }),
901
901
  /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
902
902
  /* @__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" }),
903
+ /* @__PURE__ */ n(I, { label: "#", sortKey: "rank", config: o, onSort: d, className: "pvx-th--narrow" }),
904
904
  /* @__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" })
905
+ /* @__PURE__ */ n(I, { label: "Rating", sortKey: "rating", config: o, onSort: d }),
906
+ /* @__PURE__ */ n(I, { label: "Cars", sortKey: "distinctCars", config: o, onSort: d, className: "pvx-hidden-below-sm" }),
907
+ /* @__PURE__ */ n(I, { label: "Combos", sortKey: "comboCount", config: o, onSort: d, className: "pvx-hidden-below-sm" })
908
908
  ] }) }),
909
909
  /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: u.map((f) => {
910
910
  const h = p === f.identifier;
@@ -912,11 +912,11 @@ function Lt({ drivers: e, isLoading: t, getUserDisplay: s, game: r, gameVersion:
912
912
  un,
913
913
  {
914
914
  driver: f,
915
- getUserDisplay: s,
915
+ getUserDisplay: r,
916
916
  isExpanded: h,
917
917
  onToggle: () => c(h ? null : f.identifier),
918
918
  colCount: v,
919
- game: r,
919
+ game: s,
920
920
  gameVersion: a,
921
921
  onComboSelect: i
922
922
  },
@@ -926,27 +926,27 @@ function Lt({ drivers: e, isLoading: t, getUserDisplay: s, game: r, gameVersion:
926
926
  ] }) })
927
927
  ] });
928
928
  }
929
- function un({ driver: e, getUserDisplay: t, isExpanded: s, onToggle: r, colCount: a, game: i, gameVersion: o, onComboSelect: d }) {
929
+ function un({ driver: e, getUserDisplay: t, isExpanded: r, onToggle: s, colCount: a, game: i, gameVersion: o, onComboSelect: d }) {
930
930
  const p = e.identifier;
931
- return /* @__PURE__ */ l(_, { children: [
931
+ return /* @__PURE__ */ l(B, { children: [
932
932
  /* @__PURE__ */ l(
933
933
  "tr",
934
934
  {
935
935
  className: `pvx-row pvx-row--clickable ${e.rank <= 3 ? "pvx-row--podium" : ""}`,
936
- onClick: r,
936
+ onClick: s,
937
937
  children: [
938
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 }) }),
939
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(X, { userId: p, getUserDisplay: t }) }),
940
940
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: e.rating.toFixed(1) }),
941
941
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: e.distinctCars || "-" }),
942
942
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: /* @__PURE__ */ l("span", { className: "pvx-rankings-combo-count", children: [
943
943
  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" }) })
944
+ /* @__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
945
  ] }) })
946
946
  ]
947
947
  }
948
948
  ),
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) => {
949
+ 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) => {
950
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;
951
951
  return /* @__PURE__ */ l(
952
952
  "div",
@@ -956,8 +956,8 @@ function un({ driver: e, getUserDisplay: t, isExpanded: s, onToggle: r, colCount
956
956
  role: f ? "button" : void 0,
957
957
  children: [
958
958
  /* @__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) }),
960
- /* @__PURE__ */ n("p", { className: "pvx-rankings-combo-car", children: I(c.carId) })
959
+ /* @__PURE__ */ n("p", { className: "pvx-rankings-combo-track", children: V(c.trackId, c.layout, i) }),
960
+ /* @__PURE__ */ n("p", { className: "pvx-rankings-combo-car", children: _(c.carId) })
961
961
  ] }),
962
962
  /* @__PURE__ */ l("div", { className: "pvx-rankings-combo-stats", children: [
963
963
  /* @__PURE__ */ n("p", { className: "pvx-rankings-combo-time", children: q(c.lapTimeMs) }),
@@ -1020,31 +1020,31 @@ const hn = {
1020
1020
  function ge(e) {
1021
1021
  const t = vn.indexOf(e);
1022
1022
  if (t >= 0) return t;
1023
- const s = e.match(/^PRACTICE_(\d+)$/);
1024
- return s ? 100 + parseInt(s[1]) : 999;
1023
+ const r = e.match(/^PRACTICE_(\d+)$/);
1024
+ return r ? 100 + parseInt(r[1]) : 999;
1025
1025
  }
1026
- function Z(e) {
1026
+ function ee(e) {
1027
1027
  const t = e.match(/^PRACTICE_(\d+)$/);
1028
1028
  return t ? `P${t[1]}` : e;
1029
1029
  }
1030
1030
  function me({ position: e }) {
1031
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
1032
  }
1033
- function X({ nation: e }) {
1033
+ function ne({ nation: e }) {
1034
1034
  const t = e && hn[e];
1035
1035
  return t ? /* @__PURE__ */ n("span", { className: "pvx-nation-flag", title: e, children: t }) : null;
1036
1036
  }
1037
- function xn({ sessions: e, activeSession: t, onSelect: s }) {
1037
+ function xn({ sessions: e, activeSession: t, onSelect: r }) {
1038
1038
  if (!e || e.length <= 1) return null;
1039
- const r = [...e].sort(
1039
+ const s = [...e].sort(
1040
1040
  (a, i) => ge(a.type) - ge(i.type)
1041
1041
  );
1042
- return /* @__PURE__ */ n("div", { className: "pvx-session-tabs", children: r.map((a) => /* @__PURE__ */ n(
1042
+ return /* @__PURE__ */ n("div", { className: "pvx-session-tabs", children: s.map((a) => /* @__PURE__ */ n(
1043
1043
  "button",
1044
1044
  {
1045
- onClick: () => s(a.type),
1045
+ onClick: () => r(a.type),
1046
1046
  className: `pvx-session-tab ${t === a.type ? "pvx-session-tab--active" : ""}`,
1047
- children: Z(a.type)
1047
+ children: ee(a.type)
1048
1048
  },
1049
1049
  a.type
1050
1050
  )) });
@@ -1052,33 +1052,33 @@ function xn({ sessions: e, activeSession: t, onSelect: s }) {
1052
1052
  function gn({ type: e }) {
1053
1053
  return /* @__PURE__ */ n("span", { className: `pvx-comp-badge pvx-comp-badge--${e}`, children: mn[e] || e });
1054
1054
  }
1055
- function se({ children: e, variant: t = "default" }) {
1055
+ function re({ children: e, variant: t = "default" }) {
1056
1056
  return /* @__PURE__ */ n("span", { className: `pvx-info-pill ${t !== "default" ? `pvx-info-pill--${t}` : ""}`, children: e });
1057
1057
  }
1058
1058
  function fn(e) {
1059
1059
  if (!e) return "TBD";
1060
1060
  const t = new Date(e);
1061
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}`;
1062
+ const r = t.toLocaleDateString("en-GB", { weekday: "short", day: "numeric", month: "short" }), s = t.toLocaleTimeString("en-GB", { hour: "2-digit", minute: "2-digit" });
1063
+ return `${r} • ${s}`;
1064
1064
  }
1065
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];
1066
+ return e.reduce((t, r) => {
1067
+ var s;
1068
+ return (s = r.splits) != null && s.length ? t ? t.map((a, i) => {
1069
+ const o = r.splits[i];
1070
1070
  return o && o < a ? o : a;
1071
- }) : [...s.splits] : t;
1071
+ }) : [...r.splits] : t;
1072
1072
  }, null);
1073
1073
  }
1074
- function V({ message: e = "Loading..." }) {
1074
+ function W({ message: e = "Loading..." }) {
1075
1075
  return /* @__PURE__ */ n("div", { className: "pvx-loading", children: e });
1076
1076
  }
1077
1077
  function U({ message: e = "No data available." }) {
1078
1078
  return /* @__PURE__ */ n("div", { className: "pvx-empty", children: /* @__PURE__ */ n("p", { children: e }) });
1079
1079
  }
1080
1080
  const Be = 3;
1081
- function ee(e) {
1081
+ function j(e) {
1082
1082
  if (!e) return !1;
1083
1083
  if (e.closesAt) {
1084
1084
  const t = new Date(e.closesAt).getTime();
@@ -1088,52 +1088,169 @@ function ee(e) {
1088
1088
  }
1089
1089
  function bn(e) {
1090
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;
1091
+ return t != null && t.length ? e.type === "hotlap" ? t.every((r) => j(r)) : t.every((r) => r.isFinalized) : !1;
1092
1092
  }
1093
1093
  function yn(e) {
1094
1094
  const t = e == null ? void 0 : e.rounds;
1095
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);
1096
+ let r = null;
1097
+ for (const s of t) {
1098
+ if (!s.startTime) continue;
1099
+ const a = new Date(s.startTime);
1100
+ isNaN(a) || (!r || a > r) && (r = a);
1101
1101
  }
1102
- return s;
1102
+ return r;
1103
1103
  }
1104
1104
  function Ie(e, t = Be) {
1105
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";
1106
+ const r = yn(e);
1107
+ if (!r) return "recently-completed";
1108
+ const s = t * 24 * 60 * 60 * 1e3;
1109
+ return Date.now() - r.getTime() <= s ? "recently-completed" : "archived";
1110
1110
  }
1111
- function St(e, t, s = Be) {
1111
+ function Ut(e, t, r = Be) {
1112
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)));
1113
+ const s = new Set(Array.isArray(t) ? t : [t]);
1114
+ return e.filter((a) => s.has(Ie(a, r)));
1115
1115
  }
1116
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) : [];
1117
+ const r = e == null ? void 0 : e.standings;
1118
+ return Array.isArray(r) ? [...r].sort((s, a) => (s.position ?? 999) - (a.position ?? 999)).slice(0, t) : [];
1119
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 }),
1120
+ function wn({ competitionId: e, topN: t = 3, label: r = "Completed", className: s }) {
1121
+ const { data: a } = Le(e), i = kn(a, t);
1122
+ return /* @__PURE__ */ l("div", { className: `pvx-comp-completed-badge ${s || ""}`, children: [
1123
+ /* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-label", children: r }),
1124
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
1125
  /* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-medal", "aria-hidden": "true", children: he[d] || "" }),
1126
- /* @__PURE__ */ n(X, { nation: o.nation }),
1126
+ /* @__PURE__ */ n(ne, { nation: o.nation }),
1127
1127
  /* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-name", children: o.driverName })
1128
1128
  ] }, o.driverId || d)) })
1129
1129
  ] });
1130
1130
  }
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." });
1131
+ const Cn = {
1132
+ GameModeSelectionWeatherType_CLEAR: "Clear",
1133
+ GameModeSelectionWeatherType_SCATTERED_CLOUDS: "Scattered Clouds",
1134
+ GameModeSelectionWeatherType_BROKEN_CLOUDS: "Broken Clouds",
1135
+ GameModeSelectionWeatherType_OVERCAST: "Overcast",
1136
+ GameModeSelectionWeatherType_DRIZZLE: "Drizzle",
1137
+ GameModeSelectionWeatherType_DAMP: "Damp",
1138
+ GameModeSelectionWeatherType_RAIN: "Rain",
1139
+ GameModeSelectionWeatherType_HEAVY_RAIN: "Heavy Rain"
1140
+ }, Sn = {
1141
+ viewBox: "0 0 24 24",
1142
+ fill: "none",
1143
+ stroke: "currentColor",
1144
+ strokeWidth: 1.5,
1145
+ strokeLinecap: "round",
1146
+ strokeLinejoin: "round"
1147
+ };
1148
+ function Ln() {
1149
+ return /* @__PURE__ */ l(B, { children: [
1150
+ /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "4" }),
1151
+ /* @__PURE__ */ n("path", { d: "M12 2v2" }),
1152
+ /* @__PURE__ */ n("path", { d: "M12 20v2" }),
1153
+ /* @__PURE__ */ n("path", { d: "m4.93 4.93 1.41 1.41" }),
1154
+ /* @__PURE__ */ n("path", { d: "m17.66 17.66 1.41 1.41" }),
1155
+ /* @__PURE__ */ n("path", { d: "M2 12h2" }),
1156
+ /* @__PURE__ */ n("path", { d: "M20 12h2" }),
1157
+ /* @__PURE__ */ n("path", { d: "m6.34 17.66-1.41 1.41" }),
1158
+ /* @__PURE__ */ n("path", { d: "m19.07 4.93-1.41 1.41" })
1159
+ ] });
1160
+ }
1161
+ function Rn() {
1162
+ return /* @__PURE__ */ l(B, { children: [
1163
+ /* @__PURE__ */ n("path", { d: "M12 2v2" }),
1164
+ /* @__PURE__ */ n("path", { d: "m4.93 4.93 1.41 1.41" }),
1165
+ /* @__PURE__ */ n("path", { d: "M20 12h2" }),
1166
+ /* @__PURE__ */ n("path", { d: "m19.07 4.93-1.41 1.41" }),
1167
+ /* @__PURE__ */ n("path", { d: "M15.947 12.65a4 4 0 0 0-5.925-4.128" }),
1168
+ /* @__PURE__ */ n("path", { d: "M13 22H7a5 5 0 1 1 4.9-6H13a3 3 0 0 1 0 6Z" })
1169
+ ] });
1170
+ }
1171
+ function Tn() {
1172
+ return /* @__PURE__ */ l(B, { children: [
1173
+ /* @__PURE__ */ n("path", { d: "M17.5 21H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z" }),
1174
+ /* @__PURE__ */ n("path", { d: "M22 10a3 3 0 0 0-3-3h-2.207a5.502 5.502 0 0 0-10.702.5" })
1175
+ ] });
1176
+ }
1177
+ function $n() {
1178
+ return /* @__PURE__ */ n("path", { d: "M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z" });
1179
+ }
1180
+ function Mn() {
1181
+ return /* @__PURE__ */ l(B, { children: [
1182
+ /* @__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" }),
1183
+ /* @__PURE__ */ n("path", { d: "M8 19v1" }),
1184
+ /* @__PURE__ */ n("path", { d: "M8 14v1" }),
1185
+ /* @__PURE__ */ n("path", { d: "M16 19v1" }),
1186
+ /* @__PURE__ */ n("path", { d: "M16 14v1" }),
1187
+ /* @__PURE__ */ n("path", { d: "M12 21v1" }),
1188
+ /* @__PURE__ */ n("path", { d: "M12 16v1" })
1189
+ ] });
1133
1190
  }
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";
1191
+ function Dn() {
1192
+ return /* @__PURE__ */ l(B, { children: [
1193
+ /* @__PURE__ */ n("path", { d: "M16 17H7" }),
1194
+ /* @__PURE__ */ n("path", { d: "M17 21H9" }),
1195
+ /* @__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" })
1196
+ ] });
1197
+ }
1198
+ function An() {
1199
+ return /* @__PURE__ */ l(B, { children: [
1200
+ /* @__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" }),
1201
+ /* @__PURE__ */ n("path", { d: "M16 14v6" }),
1202
+ /* @__PURE__ */ n("path", { d: "M8 14v6" }),
1203
+ /* @__PURE__ */ n("path", { d: "M12 16v6" })
1204
+ ] });
1205
+ }
1206
+ function Pn() {
1207
+ return /* @__PURE__ */ l(B, { children: [
1208
+ /* @__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" }),
1209
+ /* @__PURE__ */ n("path", { d: "m9.2 22 3-7" }),
1210
+ /* @__PURE__ */ n("path", { d: "m9 13-3 7" }),
1211
+ /* @__PURE__ */ n("path", { d: "m17 13-3 7" })
1212
+ ] });
1213
+ }
1214
+ const Bn = {
1215
+ GameModeSelectionWeatherType_CLEAR: Ln,
1216
+ GameModeSelectionWeatherType_SCATTERED_CLOUDS: Rn,
1217
+ GameModeSelectionWeatherType_BROKEN_CLOUDS: Tn,
1218
+ GameModeSelectionWeatherType_OVERCAST: $n,
1219
+ GameModeSelectionWeatherType_DRIZZLE: Mn,
1220
+ GameModeSelectionWeatherType_DAMP: Dn,
1221
+ GameModeSelectionWeatherType_RAIN: An,
1222
+ GameModeSelectionWeatherType_HEAVY_RAIN: Pn
1223
+ };
1224
+ function In({ weatherType: e, weatherBehaviour: t, className: r }) {
1225
+ const s = e ? Bn[e] : null;
1226
+ if (!s) return null;
1227
+ const a = Cn[e] || e, i = t === "GameModeSelectionWeatherBehaviour_DYNAMIC", o = i ? `${a} · Dynamic` : a;
1228
+ return /* @__PURE__ */ l(
1229
+ "span",
1230
+ {
1231
+ className: `pvx-weather-icon ${r || ""}`.trim(),
1232
+ title: o,
1233
+ "aria-label": o,
1234
+ children: [
1235
+ /* @__PURE__ */ n("svg", { className: "pvx-weather-icon-main", ...Sn, children: /* @__PURE__ */ n(s, {}) }),
1236
+ i && /* @__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: [
1237
+ /* @__PURE__ */ n("path", { d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8" }),
1238
+ /* @__PURE__ */ n("path", { d: "M21 3v5h-5" }),
1239
+ /* @__PURE__ */ n("path", { d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16" }),
1240
+ /* @__PURE__ */ n("path", { d: "M8 16H3v5" })
1241
+ ] }) })
1242
+ ]
1243
+ }
1244
+ );
1245
+ }
1246
+ function Ft({ competitions: e, isLoading: t, onSelect: r, onRegister: s, className: a }) {
1247
+ return t ? /* @__PURE__ */ n(W, { message: "Loading competitions..." }) : e != null && e.length ? /* @__PURE__ */ n("div", { className: `pvx-comp-grid ${a || ""}`, children: e.map((i) => /* @__PURE__ */ n(En, { comp: i, onSelect: r, onRegister: s || r }, i.id)) }) : /* @__PURE__ */ n(U, { message: "No competitions available." });
1248
+ }
1249
+ function En({ comp: e, onSelect: t, onRegister: r }) {
1250
+ var P, N, S, y, A;
1251
+ const { cdnUrl: s } = L(), a = e.posterCdnPath ? `${s}/${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 = (P = e.rounds) == null ? void 0 : P.find(
1252
+ (R) => R.startTime && new Date(R.startTime) <= v && !j(R)
1253
+ ), h = f || ((N = e.rounds) == null ? void 0 : N.find((R) => R.startTime && new Date(R.startTime) >= v)), k = !!f, m = ((S = e.rounds) == null ? void 0 : S.length) || 0, g = e.type === "hotlap", b = g && m > 1, x = g ? ((y = e.rounds) == null ? void 0 : y.filter(j).length) || 0 : ((A = e.rounds) == null ? void 0 : A.filter((R) => R.isFinalized).length) || 0, w = Ie(e), C = w === "recently-completed" || w === "archived", M = e.type === "championship";
1137
1254
  return /* @__PURE__ */ l(
1138
1255
  "div",
1139
1256
  {
@@ -1141,43 +1258,53 @@ function Cn({ comp: e, onSelect: t, onRegister: s }) {
1141
1258
  onClick: () => t(e.id),
1142
1259
  role: "button",
1143
1260
  tabIndex: 0,
1144
- onKeyDown: (b) => {
1145
- (b.key === "Enter" || b.key === " ") && (b.preventDefault(), t(e.id));
1261
+ onKeyDown: (R) => {
1262
+ (R.key === "Enter" || R.key === " ") && (R.preventDefault(), t(e.id));
1146
1263
  },
1147
1264
  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, {}) }) }),
1265
+ /* @__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(Un, {}) }) }),
1149
1266
  /* @__PURE__ */ l("div", { className: "pvx-comp-card-body", children: [
1150
1267
  /* @__PURE__ */ n("h3", { className: "pvx-comp-card-title", children: e.name }),
1151
1268
  e.description && /* @__PURE__ */ n("p", { className: "pvx-comp-card-desc", children: e.description }),
1152
1269
  /* @__PURE__ */ l("div", { className: "pvx-comp-card-pills", children: [
1153
1270
  /* @__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))
1271
+ e.game && /* @__PURE__ */ n(re, { children: e.game.toUpperCase() }),
1272
+ e.formatDescription && e.formatDescription.split(", ").map((R, H) => /* @__PURE__ */ n(re, { variant: "format", children: R }, H))
1156
1273
  ] }),
1157
- e.carsDescription && /* @__PURE__ */ n("div", { className: "pvx-comp-card-pills", children: e.carsDescription.split(", ").map((b, L) => /* @__PURE__ */ n(se, { children: b }, L)) }),
1274
+ e.carsDescription && /* @__PURE__ */ n("div", { className: "pvx-comp-card-pills", children: e.carsDescription.split(", ").map((R, H) => /* @__PURE__ */ n(re, { children: R }, H)) }),
1158
1275
  /* @__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:" }),
1276
+ h ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
1277
+ /* @__PURE__ */ n("span", { className: "pvx-comp-card-schedule-label", children: k ? "Live:" : "Next:" }),
1161
1278
  " ",
1162
- (e.type !== "hotlap" || x) && `R${f.roundNumber} `,
1163
- f.track || "TBD",
1279
+ (e.type !== "hotlap" || b) && `R${h.roundNumber} `,
1280
+ h.track || "TBD",
1164
1281
  " · ",
1165
- fn(f.startTime)
1166
- ] }) : h > 0 ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
1167
- g,
1282
+ fn(h.startTime),
1283
+ (h.weatherType || e.weatherType) && /* @__PURE__ */ l(B, { children: [
1284
+ " ",
1285
+ /* @__PURE__ */ n(
1286
+ In,
1287
+ {
1288
+ weatherType: h.weatherType || e.weatherType,
1289
+ weatherBehaviour: h.weatherBehaviour || e.weatherBehaviour
1290
+ }
1291
+ )
1292
+ ] })
1293
+ ] }) : m > 0 ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
1294
+ x,
1168
1295
  "/",
1169
- h,
1296
+ m,
1170
1297
  " rounds completed"
1171
1298
  ] }) : null,
1172
- h > 0 && /* @__PURE__ */ l("span", { className: "pvx-comp-card-round-count", children: [
1173
- h,
1299
+ m > 0 && /* @__PURE__ */ l("span", { className: "pvx-comp-card-round-count", children: [
1300
+ m,
1174
1301
  " round",
1175
- h !== 1 ? "s" : ""
1302
+ m !== 1 ? "s" : ""
1176
1303
  ] })
1177
1304
  ] }),
1178
- m && (w || x) && /* @__PURE__ */ n(wn, { competitionId: e.id }),
1179
- i && !m && /* @__PURE__ */ n(
1180
- Ln,
1305
+ C && (M || b) && /* @__PURE__ */ n(wn, { competitionId: e.id }),
1306
+ i && !C && /* @__PURE__ */ n(
1307
+ _n,
1181
1308
  {
1182
1309
  competitionId: e.id,
1183
1310
  regOpen: u,
@@ -1185,7 +1312,7 @@ function Cn({ comp: e, onSelect: t, onRegister: s }) {
1185
1312
  deadlinePassed: c,
1186
1313
  regCount: o,
1187
1314
  regMax: d,
1188
- onRegister: s
1315
+ onRegister: r
1189
1316
  }
1190
1317
  )
1191
1318
  ] })
@@ -1193,7 +1320,7 @@ function Cn({ comp: e, onSelect: t, onRegister: s }) {
1193
1320
  }
1194
1321
  );
1195
1322
  }
1196
- function Ln({ competitionId: e, regOpen: t, isFull: s, deadlinePassed: r, regCount: a, regMax: i, onRegister: o }) {
1323
+ function _n({ competitionId: e, regOpen: t, isFull: r, deadlinePassed: s, regCount: a, regMax: i, onRegister: o }) {
1197
1324
  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";
1198
1325
  return /* @__PURE__ */ l("div", { className: "pvx-comp-card-reg", children: [
1199
1326
  /* @__PURE__ */ n("div", { className: "pvx-comp-card-reg-info", children: /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${f}`, children: [
@@ -1230,10 +1357,10 @@ function Ln({ competitionId: e, regOpen: t, isFull: s, deadlinePassed: r, regCou
1230
1357
  onClick: (h) => h.stopPropagation(),
1231
1358
  children: "Register"
1232
1359
  }
1233
- ) : /* @__PURE__ */ n("span", { className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--closed", children: s ? "Full" : "Closed" }) })
1360
+ ) : /* @__PURE__ */ n("span", { className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--closed", children: r ? "Full" : "Closed" }) })
1234
1361
  ] });
1235
1362
  }
1236
- function Sn() {
1363
+ function Un() {
1237
1364
  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
1365
  /* @__PURE__ */ n("path", { d: "M6 9H4.5a2.5 2.5 0 0 1 0-5H6" }),
1239
1366
  /* @__PURE__ */ n("path", { d: "M18 9h1.5a2.5 2.5 0 0 0 0-5H18" }),
@@ -1243,14 +1370,14 @@ function Sn() {
1243
1370
  /* @__PURE__ */ n("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
1244
1371
  ] });
1245
1372
  }
1246
- function $n({ competitionId: e, className: t }) {
1373
+ function Fn({ competitionId: e, className: t }) {
1247
1374
  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))
1375
+ const { data: r, isLoading: s } = Le(e), { data: a, isLoading: i } = Se(e);
1376
+ if (s || i)
1377
+ return /* @__PURE__ */ n(W, { message: "Loading standings..." });
1378
+ if (!((c = r == null ? void 0 : r.standings) != null && c.length))
1252
1379
  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;
1380
+ const o = (a == null ? void 0 : a.type) === "hotlap", d = o ? ((u = a == null ? void 0 : a.rounds) == null ? void 0 : u.filter(j)) || [] : ((v = a == null ? void 0 : a.rounds) == null ? void 0 : v.filter((f) => f.isFinalized)) || [], p = r.roundsClosed ?? r.roundsCompleted ?? 0;
1254
1381
  return /* @__PURE__ */ l("div", { className: `pvx-card ${t || ""}`, children: [
1255
1382
  /* @__PURE__ */ n("div", { className: "pvx-card-header--split", children: /* @__PURE__ */ l("div", { className: "pvx-card-header-left", children: [
1256
1383
  /* @__PURE__ */ n("h3", { className: "pvx-card-title", children: o ? "Overall Standings" : "Championship Standings" }),
@@ -1260,7 +1387,7 @@ function $n({ competitionId: e, className: t }) {
1260
1387
  " round",
1261
1388
  p !== 1 ? "s" : "",
1262
1389
  o ? " closed" : "",
1263
- s.countingRounds > 0 && ` (best ${s.countingRounds} count)`
1390
+ r.countingRounds > 0 && ` (best ${r.countingRounds} count)`
1264
1391
  ] })
1265
1392
  ] }) }),
1266
1393
  /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
@@ -1283,8 +1410,8 @@ function $n({ competitionId: e, className: t }) {
1283
1410
  f.roundNumber
1284
1411
  ))
1285
1412
  ] }) }),
1286
- /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: s.standings.map((f) => /* @__PURE__ */ n(
1287
- Rn,
1413
+ /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: r.standings.map((f) => /* @__PURE__ */ n(
1414
+ qn,
1288
1415
  {
1289
1416
  driver: f,
1290
1417
  columnRounds: d
@@ -1294,22 +1421,22 @@ function $n({ competitionId: e, className: t }) {
1294
1421
  ] }) })
1295
1422
  ] });
1296
1423
  }
1297
- function Rn({ driver: e, columnRounds: t }) {
1424
+ function qn({ driver: e, columnRounds: t }) {
1298
1425
  var o, d, p;
1299
- const s = e.position <= 3, r = new Map(
1426
+ const r = e.position <= 3, s = new Map(
1300
1427
  ((o = e.roundResults) == null ? void 0 : o.map((c) => [c.roundNumber, c])) || []
1301
1428
  ), 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: [
1429
+ return /* @__PURE__ */ l("tr", { className: `pvx-row ${r ? "pvx-row--podium" : ""}`, children: [
1303
1430
  /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(me, { position: e.position }) }),
1304
1431
  /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
1305
- /* @__PURE__ */ n(X, { nation: e.nation }),
1432
+ /* @__PURE__ */ n(ne, { nation: e.nation }),
1306
1433
  e.driverName
1307
1434
  ] }),
1308
1435
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: a || "-" }),
1309
1436
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: i || "-" }),
1310
1437
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-standings-total", children: e.totalPoints }),
1311
1438
  t.map((c) => {
1312
- const u = r.get(c.roundNumber), v = u == null ? void 0 : u.dropped;
1439
+ const u = s.get(c.roundNumber), v = u == null ? void 0 : u.dropped;
1313
1440
  return /* @__PURE__ */ n(
1314
1441
  "td",
1315
1442
  {
@@ -1353,42 +1480,42 @@ const fe = [
1353
1480
  "#f87171",
1354
1481
  "#38bdf8"
1355
1482
  ];
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);
1483
+ function Hn(e, t) {
1484
+ return e.map((r) => ({
1485
+ driverName: r.driverName,
1486
+ carClass: r.carClass,
1487
+ positions: r.positions.map((s, a) => {
1488
+ const o = e.filter((d) => d.positions[a] != null).sort((d, p) => d.positions[a] - p.positions[a]).findIndex((d) => d.driverName === r.driverName);
1362
1489
  return o === -1 ? null : o + 1;
1363
1490
  })
1364
1491
  }));
1365
1492
  }
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;
1493
+ function jn({ title: e, drivers: t, timingPoints: r }) {
1494
+ const [s, a] = E(() => /* @__PURE__ */ new Set()), i = K((N) => {
1495
+ a((S) => {
1496
+ const y = new Set(S);
1497
+ return y.has(N) ? y.delete(N) : y.add(N), y;
1371
1498
  });
1372
- }, []), { series: o, maxPos: d } = $(() => {
1499
+ }, []), { series: o, maxPos: d } = T(() => {
1373
1500
  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] };
1501
+ return { series: t.map((y, A) => {
1502
+ for (const R of y.positions) R != null && R > N && (N = R);
1503
+ return { ...y, colour: fe[A % fe.length] };
1377
1504
  }), maxPos: N };
1378
1505
  }, [t]);
1379
- if (!o.length || s.length < 2)
1506
+ if (!o.length || r.length < 2)
1380
1507
  return /* @__PURE__ */ l("div", { className: "pvx-positions-empty", children: [
1381
1508
  "No position data for ",
1382
1509
  e || "this race",
1383
1510
  "."
1384
1511
  ] });
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);
1512
+ const p = 800, c = 34, u = 12, v = 12, f = 22, h = 34, k = p - c - u, m = Math.max(f * (d - 1), f), g = v + m + h, b = r.length, x = (N) => c + (b === 1 ? 0 : N / (b - 1) * k), w = (N) => v + (d === 1 ? 0 : (N - 1) / (d - 1) * m), C = (N) => {
1513
+ const S = [];
1514
+ let y = [];
1515
+ return N.forEach((A, R) => {
1516
+ A == null ? y.length && (S.push(y), y = []) : y.push([x(R), w(A)]);
1517
+ }), y.length && S.push(y), S;
1518
+ }, M = s.size > 0, P = Math.ceil(b / 24);
1392
1519
  return /* @__PURE__ */ l("div", { className: "pvx-positions-chart", children: [
1393
1520
  e && /* @__PURE__ */ n("div", { className: "pvx-positions-title", children: e }),
1394
1521
  /* @__PURE__ */ l(
@@ -1400,7 +1527,7 @@ function Mn({ title: e, drivers: t, timingPoints: s }) {
1400
1527
  role: "img",
1401
1528
  "aria-label": `Race position progression${e ? ` — ${e}` : ""}`,
1402
1529
  children: [
1403
- Array.from({ length: d }, (N, b) => b + 1).map((N) => /* @__PURE__ */ l("g", { children: [
1530
+ Array.from({ length: d }, (N, S) => S + 1).map((N) => /* @__PURE__ */ l("g", { children: [
1404
1531
  /* @__PURE__ */ n(
1405
1532
  "line",
1406
1533
  {
@@ -1416,31 +1543,31 @@ function Mn({ title: e, drivers: t, timingPoints: s }) {
1416
1543
  N
1417
1544
  ] })
1418
1545
  ] }, `y${N}`)),
1419
- s.map((N, b) => b % T === 0 && /* @__PURE__ */ n(
1546
+ r.map((N, S) => S % P === 0 && /* @__PURE__ */ n(
1420
1547
  "text",
1421
1548
  {
1422
1549
  className: "pvx-positions-axis",
1423
- x: m(b),
1550
+ x: x(S),
1424
1551
  y: g - h + 16,
1425
1552
  textAnchor: "middle",
1426
1553
  children: N.label
1427
1554
  },
1428
- `x${b}`
1555
+ `x${S}`
1429
1556
  )),
1430
1557
  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(
1558
+ const S = M && !s.has(N.driverName);
1559
+ return /* @__PURE__ */ l("g", { opacity: S ? 0.12 : 1, children: [
1560
+ C(N.positions).map((y, A) => /* @__PURE__ */ n(
1434
1561
  "polyline",
1435
1562
  {
1436
1563
  fill: "none",
1437
1564
  stroke: N.colour,
1438
- strokeWidth: b ? 1 : 2,
1439
- points: L.map(([F, ne]) => `${F},${ne}`).join(" ")
1565
+ strokeWidth: S ? 1 : 2,
1566
+ points: y.map(([R, H]) => `${R},${H}`).join(" ")
1440
1567
  },
1441
- P
1568
+ A
1442
1569
  )),
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))
1570
+ !S && N.positions.map((y, A) => y != null && /* @__PURE__ */ n("circle", { cx: x(A), cy: w(y), r: 2.4, fill: N.colour, children: /* @__PURE__ */ n("title", { children: `${N.driverName} — ${r[A].label}: P${y}` }) }, A))
1444
1571
  ] }, N.driverName);
1445
1572
  })
1446
1573
  ]
@@ -1448,13 +1575,13 @@ function Mn({ title: e, drivers: t, timingPoints: s }) {
1448
1575
  ),
1449
1576
  /* @__PURE__ */ l("div", { className: "pvx-positions-legend", children: [
1450
1577
  o.map((N) => {
1451
- const b = R && !r.has(N.driverName);
1578
+ const S = M && !s.has(N.driverName);
1452
1579
  return /* @__PURE__ */ l(
1453
1580
  "button",
1454
1581
  {
1455
1582
  type: "button",
1456
1583
  className: "pvx-positions-legend-item",
1457
- style: { opacity: b ? 0.4 : 1 },
1584
+ style: { opacity: S ? 0.4 : 1 },
1458
1585
  onClick: () => i(N.driverName),
1459
1586
  children: [
1460
1587
  /* @__PURE__ */ n("span", { className: "pvx-positions-swatch", style: { background: N.colour } }),
@@ -1464,7 +1591,7 @@ function Mn({ title: e, drivers: t, timingPoints: s }) {
1464
1591
  N.driverName
1465
1592
  );
1466
1593
  }),
1467
- R && /* @__PURE__ */ n(
1594
+ M && /* @__PURE__ */ n(
1468
1595
  "button",
1469
1596
  {
1470
1597
  type: "button",
@@ -1476,44 +1603,44 @@ function Mn({ title: e, drivers: t, timingPoints: s }) {
1476
1603
  ] })
1477
1604
  ] });
1478
1605
  }
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) => ({
1606
+ function Vn({ positions: e }) {
1607
+ const t = (e == null ? void 0 : e.timingPoints) || [], r = (e == null ? void 0 : e.drivers) || [], s = T(() => {
1608
+ const a = [...new Set(r.map((i) => i.carClass).filter(Boolean))];
1609
+ return a.length <= 1 ? [{ title: a[0] || null, drivers: r }] : a.sort().map((i) => ({
1483
1610
  title: i,
1484
- drivers: Tn(
1485
- s.filter((o) => o.carClass === i),
1611
+ drivers: Hn(
1612
+ r.filter((o) => o.carClass === i),
1486
1613
  t.length
1487
1614
  )
1488
1615
  }));
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,
1616
+ }, [r, t.length]);
1617
+ 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, i) => /* @__PURE__ */ n(
1618
+ jn,
1492
1619
  {
1493
- title: r.length > 1 ? a.title : null,
1620
+ title: s.length > 1 ? a.title : null,
1494
1621
  drivers: a.drivers,
1495
1622
  timingPoints: t
1496
1623
  },
1497
1624
  a.title || i
1498
1625
  )) });
1499
1626
  }
1500
- function Rt({ competitionId: e, roundNumber: t, className: s }) {
1627
+ function qt({ competitionId: e, roundNumber: t, className: r }) {
1501
1628
  var p;
1502
- const { data: r, isLoading: a } = nn(e, t);
1629
+ const { data: s, isLoading: a } = nn(e, t);
1503
1630
  if (a)
1504
- return /* @__PURE__ */ n(V, { message: "Loading results..." });
1505
- if (!r)
1631
+ return /* @__PURE__ */ n(W, { message: "Loading results..." });
1632
+ if (!s)
1506
1633
  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: [
1634
+ const o = (s.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);
1635
+ return /* @__PURE__ */ l("div", { className: `pvx-round-results ${r || ""}`, children: [
1509
1636
  /* @__PURE__ */ l("div", { className: "pvx-round-results-header", children: [
1510
1637
  /* @__PURE__ */ l("div", { children: [
1511
1638
  /* @__PURE__ */ l("h4", { className: "pvx-round-results-title", children: [
1512
1639
  "Round ",
1513
- r.roundNumber,
1514
- r.track ? `: ${r.track}` : ""
1640
+ s.roundNumber,
1641
+ s.track ? `: ${s.track}` : ""
1515
1642
  ] }),
1516
- r.startTime && /* @__PURE__ */ n("p", { className: "pvx-round-results-date", children: new Date(r.startTime).toLocaleDateString("en-GB", {
1643
+ s.startTime && /* @__PURE__ */ n("p", { className: "pvx-round-results-date", children: new Date(s.startTime).toLocaleDateString("en-GB", {
1517
1644
  day: "numeric",
1518
1645
  month: "long",
1519
1646
  year: "numeric"
@@ -1524,12 +1651,12 @@ function Rt({ competitionId: e, roundNumber: t, className: s }) {
1524
1651
  /* @__PURE__ */ n("span", { children: c.driverName })
1525
1652
  ] }, c.driverId)) })
1526
1653
  ] }),
1527
- /* @__PURE__ */ n(ve, { round: r, competitionId: e })
1654
+ /* @__PURE__ */ n(ve, { round: s, competitionId: e })
1528
1655
  ] });
1529
1656
  }
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) || [];
1657
+ function ve({ round: e, competitionId: t, className: r }) {
1658
+ var h, k, m, g, b, x;
1659
+ const [s, a] = E(null), i = (e == null ? void 0 : e.sessions) || [];
1533
1660
  if (!i.length)
1534
1661
  return /* @__PURE__ */ n(U, { message: "No session data for this round." });
1535
1662
  const { data: o } = an(
@@ -1540,8 +1667,8 @@ function ve({ round: e, competitionId: t, className: s }) {
1540
1667
  t,
1541
1668
  e == null ? void 0 : e.roundNumber,
1542
1669
  { 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: [
1670
+ ), c = s || ((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 = (m = o == null ? void 0 : o.sessions) == null ? void 0 : m.find((w) => w.type === c)) == null ? void 0 : g.drivers) || null, f = (u == null ? void 0 : u.type) === "RACE" && ((b = p == null ? void 0 : p.timingPoints) == null ? void 0 : b.length) > 0 && ((x = p == null ? void 0 : p.drivers) == null ? void 0 : x.length) > 0;
1671
+ return /* @__PURE__ */ l("div", { className: r || "", children: [
1545
1672
  /* @__PURE__ */ n(
1546
1673
  xn,
1547
1674
  {
@@ -1550,33 +1677,33 @@ function ve({ round: e, competitionId: t, className: s }) {
1550
1677
  onSelect: a
1551
1678
  }
1552
1679
  ),
1553
- /* @__PURE__ */ n(Pn, { session: u, sessionLaps: v }),
1680
+ /* @__PURE__ */ n(Wn, { session: u, sessionLaps: v }),
1554
1681
  f && /* @__PURE__ */ l("div", { className: "pvx-positions-section", children: [
1555
1682
  /* @__PURE__ */ n("div", { className: "pvx-positions-section-title", children: "Race Positions" }),
1556
- /* @__PURE__ */ n(Dn, { positions: p })
1683
+ /* @__PURE__ */ n(Vn, { positions: p })
1557
1684
  ] })
1558
1685
  ] });
1559
1686
  }
1560
- function Pn({ session: e, sessionLaps: t }) {
1687
+ function Wn({ session: e, sessionLaps: t }) {
1561
1688
  var u;
1562
- const s = e.type === "RACE", [r, a] = B(null);
1689
+ const r = e.type === "RACE", [s, a] = E(null);
1563
1690
  if (!((u = e.results) != null && u.length))
1564
1691
  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) => {
1692
+ const i = Nn(e.results), o = r ? 7 : 4, d = [...new Set(e.results.map((v) => v.carClass).filter(Boolean))], p = d.length > 1, c = (v, f, h) => {
1566
1693
  var g;
1567
- const k = (g = t == null ? void 0 : t[v.driverId]) == null ? void 0 : g.laps, x = r === v.driverId && !!k;
1694
+ const k = (g = t == null ? void 0 : t[v.driverId]) == null ? void 0 : g.laps, m = s === v.driverId && !!k;
1568
1695
  return /* @__PURE__ */ n(
1569
- An,
1696
+ Kn,
1570
1697
  {
1571
1698
  result: v,
1572
- isRace: s,
1699
+ isRace: r,
1573
1700
  fastestSplits: i,
1574
1701
  rowIndex: f,
1575
1702
  displayPosition: h,
1576
1703
  hasLapDetail: !!k,
1577
- isExpanded: x,
1578
- onToggle: () => a(x ? null : v.driverId),
1579
- driverLaps: x ? k : null,
1704
+ isExpanded: m,
1705
+ onToggle: () => a(m ? null : v.driverId),
1706
+ driverLaps: m ? k : null,
1580
1707
  colCount: o
1581
1708
  },
1582
1709
  v.driverId || f
@@ -1588,7 +1715,7 @@ function Pn({ session: e, sessionLaps: t }) {
1588
1715
  /* @__PURE__ */ n("th", { className: "pvx-th", children: "Driver" }),
1589
1716
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Car" }),
1590
1717
  /* @__PURE__ */ n("th", { className: "pvx-th", children: "Best Lap" }),
1591
- s && /* @__PURE__ */ l(_, { children: [
1718
+ r && /* @__PURE__ */ l(B, { children: [
1592
1719
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Laps" }),
1593
1720
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Time / Gap" }),
1594
1721
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--center", children: "Points" })
@@ -1605,9 +1732,9 @@ function Pn({ session: e, sessionLaps: t }) {
1605
1732
  }) : e.results.map((v, f) => c(v, f)) })
1606
1733
  ] }) });
1607
1734
  }
1608
- function An({ result: e, isRace: t, fastestSplits: s, rowIndex: r, displayPosition: a, hasLapDetail: i, isExpanded: o, onToggle: d, driverLaps: p, colCount: c }) {
1735
+ function Kn({ result: e, isRace: t, fastestSplits: r, rowIndex: s, displayPosition: a, hasLapDetail: i, isExpanded: o, onToggle: d, driverLaps: p, colCount: c }) {
1609
1736
  const u = a ?? e.position, v = u <= 3;
1610
- return /* @__PURE__ */ l(_, { children: [
1737
+ return /* @__PURE__ */ l(B, { children: [
1611
1738
  /* @__PURE__ */ l(
1612
1739
  "tr",
1613
1740
  {
@@ -1617,7 +1744,7 @@ function An({ result: e, isRace: t, fastestSplits: s, rowIndex: r, displayPositi
1617
1744
  children: [
1618
1745
  /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(me, { position: u }) }),
1619
1746
  /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
1620
- /* @__PURE__ */ n(X, { nation: e.nation }),
1747
+ /* @__PURE__ */ n(ne, { nation: e.nation }),
1621
1748
  e.driverName,
1622
1749
  e.carNumber != null && /* @__PURE__ */ l("span", { className: "pvx-car-number", children: [
1623
1750
  "#",
@@ -1625,18 +1752,18 @@ function An({ result: e, isRace: t, fastestSplits: s, rowIndex: r, displayPositi
1625
1752
  ] }),
1626
1753
  e.penalty && /* @__PURE__ */ n("span", { className: "pvx-penalty", children: e.penalty })
1627
1754
  ] }),
1628
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: I(e.carId) }),
1755
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: _(e.carId) }),
1629
1756
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono", children: /* @__PURE__ */ n(
1630
- In,
1757
+ Gn,
1631
1758
  {
1632
1759
  bestLap: e.bestLapFormatted,
1633
1760
  hasBestLap: e.hasBestLap,
1634
1761
  splits: e.splits,
1635
- fastestSplits: s,
1636
- showAbove: r <= 1
1762
+ fastestSplits: r,
1763
+ showAbove: s <= 1
1637
1764
  }
1638
1765
  ) }),
1639
- t && /* @__PURE__ */ l(_, { children: [
1766
+ t && /* @__PURE__ */ l(B, { children: [
1640
1767
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: e.lapsCompleted }),
1641
1768
  /* @__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
1769
  /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--center", children: [
@@ -1652,11 +1779,11 @@ function An({ result: e, isRace: t, fastestSplits: s, rowIndex: r, displayPositi
1652
1779
  ]
1653
1780
  }
1654
1781
  ),
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 }) }) })
1782
+ 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(On, { laps: p }) }) })
1656
1783
  ] });
1657
1784
  }
1658
- function Bn({ laps: e }) {
1659
- const t = Math.min(...e.filter((s) => s.valid && s.timeMs > 0).map((s) => s.timeMs));
1785
+ function On({ laps: e }) {
1786
+ const t = Math.min(...e.filter((r) => r.valid && r.timeMs > 0).map((r) => r.timeMs));
1660
1787
  return /* @__PURE__ */ l("table", { className: "pvx-table pvx-table--laps", children: [
1661
1788
  /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
1662
1789
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "Lap" }),
@@ -1665,23 +1792,23 @@ function Bn({ laps: e }) {
1665
1792
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
1666
1793
  /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" })
1667
1794
  ] }) }),
1668
- /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: e.map((s) => {
1795
+ /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: e.map((r) => {
1669
1796
  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);
1797
+ const s = r.valid && r.timeMs === t;
1798
+ return /* @__PURE__ */ l("tr", { className: `pvx-row ${r.valid ? "" : "pvx-row--invalid"} ${s ? "pvx-row--fastest" : ""}`, children: [
1799
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted", children: r.lap }),
1800
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono", children: r.time }),
1801
+ (r.splits || []).map((i, o) => /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: i }, o)),
1802
+ Array.from({ length: Math.max(0, 3 - (((a = r.splits) == null ? void 0 : a.length) || 0)) }).map((i, o) => /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm" }, `pad-${o}`))
1803
+ ] }, r.lap);
1677
1804
  }) })
1678
1805
  ] });
1679
1806
  }
1680
- function In({ bestLap: e, hasBestLap: t, splits: s, fastestSplits: r, showAbove: a }) {
1807
+ function Gn({ bestLap: e, hasBestLap: t, splits: r, fastestSplits: s, showAbove: a }) {
1681
1808
  return e ? /* @__PURE__ */ l("span", { className: `pvx-best-lap-cell ${t ? "pvx-best-lap-cell--fastest" : ""}`, children: [
1682
1809
  /* @__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];
1810
+ (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((i, o) => {
1811
+ const d = s && i === s[o];
1685
1812
  return /* @__PURE__ */ l("span", { className: "pvx-splits-tooltip-row", children: [
1686
1813
  /* @__PURE__ */ l("span", { className: "pvx-splits-tooltip-label", children: [
1687
1814
  "S",
@@ -1692,11 +1819,11 @@ function In({ bestLap: e, hasBestLap: t, splits: s, fastestSplits: r, showAbove:
1692
1819
  }) }) })
1693
1820
  ] }) : /* @__PURE__ */ n("span", { className: "pvx-td--muted", children: "-" });
1694
1821
  }
1695
- function Tt({ competitionId: e, className: t }) {
1696
- const { getSteamId: s } = C(), { data: r, isLoading: a } = $e(e), i = s();
1822
+ function Ht({ competitionId: e, className: t }) {
1823
+ const { getSteamId: r } = L(), { data: s, isLoading: a } = Re(e), i = r();
1697
1824
  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) || [];
1825
+ return /* @__PURE__ */ n(W, { message: "Loading drivers..." });
1826
+ const o = (s == null ? void 0 : s.drivers) || (s == null ? void 0 : s.entries) || [];
1700
1827
  return o.length ? /* @__PURE__ */ n("div", { className: `pvx-entry-grid ${t || ""}`, children: o.map((d) => {
1701
1828
  var c, u;
1702
1829
  const p = i && d.steamId === i;
@@ -1716,21 +1843,21 @@ function Tt({ competitionId: e, className: t }) {
1716
1843
  ] }, d.steamId || d.driverId);
1717
1844
  }) }) : /* @__PURE__ */ n(U, { message: "No drivers registered yet." });
1718
1845
  }
1719
- function Mt({
1846
+ function jt({
1720
1847
  competitionId: e,
1721
1848
  driverData: t,
1722
- className: s,
1723
- children: r
1849
+ className: r,
1850
+ children: s
1724
1851
  }) {
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 = () => {
1852
+ const { data: a, isLoading: i } = le(e), { isPowerMode: o } = ce(), d = de(e), p = Te(e), c = $e(e), u = (a == null ? void 0 : a.isRegistered) || !1, v = i || p.isPending || c.isPending, f = p.error || c.error || null, h = () => {
1726
1853
  o && p.mutate(t || {});
1727
1854
  }, k = () => {
1728
1855
  o && c.mutate();
1729
1856
  };
1730
- return typeof r == "function" ? r({ isRegistered: u, isLoading: v, register: h, withdraw: k, error: f, isPowerMode: o, registrationUrl: d }) : o ? /* @__PURE__ */ n(
1857
+ return typeof s == "function" ? s({ isRegistered: u, isLoading: v, register: h, withdraw: k, error: f, isPowerMode: o, registrationUrl: d }) : o ? /* @__PURE__ */ n(
1731
1858
  "button",
1732
1859
  {
1733
- className: `pvx-comp-register-btn ${s || ""}`,
1860
+ className: `pvx-comp-register-btn ${r || ""}`,
1734
1861
  onClick: u ? k : h,
1735
1862
  disabled: v,
1736
1863
  children: v ? "Loading..." : u ? "Withdraw" : "Register"
@@ -1741,49 +1868,49 @@ function Mt({
1741
1868
  href: d,
1742
1869
  target: "_blank",
1743
1870
  rel: "noopener noreferrer",
1744
- className: `pvx-comp-register-link ${s || ""}`,
1871
+ className: `pvx-comp-register-link ${r || ""}`,
1745
1872
  children: u ? "View Registration" : "Register on PitVox"
1746
1873
  }
1747
1874
  );
1748
1875
  }
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,
1876
+ function Vt({ competitionId: e, registration: t, onWithdrawSuccess: r, className: s }) {
1877
+ const { getSteamId: a } = L(), { isPowerMode: i } = ce(), o = de(e), { data: d, isLoading: p } = le(e), { data: c, isLoading: u } = Re(e), v = Te(e), f = $e(e), h = a(), k = (d == null ? void 0 : d.isRegistered) || !1, m = (c == null ? void 0 : c.drivers) || (c == null ? void 0 : c.entries) || [], g = t || {}, b = m.length || g.currentCount || 0, x = g.maxParticipants && b >= g.maxParticipants, w = g.deadline && new Date(g.deadline) < /* @__PURE__ */ new Date(), C = g.isOpen && !w && !x;
1878
+ return p || u ? /* @__PURE__ */ n(W, { message: "Loading registration..." }) : k ? /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: /* @__PURE__ */ n(
1879
+ Qn,
1753
1880
  {
1754
1881
  competitionId: e,
1755
- drivers: x,
1882
+ drivers: m,
1756
1883
  steamId: h,
1757
1884
  isPowerMode: i,
1758
1885
  registrationUrl: o,
1759
1886
  withdrawMutation: f,
1760
- onWithdrawSuccess: s,
1887
+ onWithdrawSuccess: r,
1761
1888
  registration: g
1762
1889
  }
1763
- ) }) : S ? h ? i ? /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${r || ""}`, children: /* @__PURE__ */ n(
1764
- Un,
1890
+ ) }) : C ? h ? i ? /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: /* @__PURE__ */ n(
1891
+ zn,
1765
1892
  {
1766
1893
  competitionId: e,
1767
1894
  registerMutation: v,
1768
1895
  registration: g
1769
1896
  }
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 })
1897
+ ) }) : /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, 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 ${s || ""}`, 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 ${s || ""}`, children: [
1898
+ /* @__PURE__ */ n("div", { className: "pvx-reg-status-msg", children: x ? "Registration is full." : w ? "Registration deadline has passed." : "Registration is closed." }),
1899
+ m.length > 0 && /* @__PURE__ */ n(Ee, { drivers: m, steamId: h })
1773
1900
  ] });
1774
1901
  }
1775
- function Un({ competitionId: e, registerMutation: t, registration: s }) {
1776
- const [r, a] = B(""), [i, o] = B("intermediate"), [d, p] = B(""), c = (h) => {
1902
+ function zn({ competitionId: e, registerMutation: t, registration: r }) {
1903
+ const [s, a] = E(""), [i, o] = E("intermediate"), [d, p] = E(""), c = (h) => {
1777
1904
  h.preventDefault(), t.mutate({
1778
- discordUsername: r || void 0,
1905
+ discordUsername: s || void 0,
1779
1906
  experience: i,
1780
1907
  comments: d || void 0
1781
1908
  });
1782
- }, u = s || {}, v = u.currentCount || 0, f = u.maxParticipants;
1909
+ }, u = r || {}, v = u.currentCount || 0, f = u.maxParticipants;
1783
1910
  return /* @__PURE__ */ l("form", { className: "pvx-reg-form", onSubmit: c, children: [
1784
1911
  /* @__PURE__ */ l("div", { className: "pvx-reg-form-header", children: [
1785
1912
  /* @__PURE__ */ n("h3", { className: "pvx-reg-form-title", children: "Register" }),
1786
- f && /* @__PURE__ */ n(Fe, { count: v, max: f })
1913
+ f && /* @__PURE__ */ n(_e, { count: v, max: f })
1787
1914
  ] }),
1788
1915
  t.error && /* @__PURE__ */ n("div", { className: "pvx-reg-error", children: t.error.message || "Registration failed" }),
1789
1916
  /* @__PURE__ */ l("div", { className: "pvx-reg-field", children: [
@@ -1798,7 +1925,7 @@ function Un({ competitionId: e, registerMutation: t, registration: s }) {
1798
1925
  type: "text",
1799
1926
  className: "pvx-reg-input",
1800
1927
  placeholder: "e.g. username",
1801
- value: r,
1928
+ value: s,
1802
1929
  onChange: (h) => a(h.target.value)
1803
1930
  }
1804
1931
  )
@@ -1848,22 +1975,22 @@ function Un({ competitionId: e, registerMutation: t, registration: s }) {
1848
1975
  ) })
1849
1976
  ] });
1850
1977
  }
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 = () => {
1978
+ function Qn({ competitionId: e, drivers: t, steamId: r, isPowerMode: s, registrationUrl: a, withdrawMutation: i, onWithdrawSuccess: o, registration: d }) {
1979
+ const [p, c] = E(!1), u = () => {
1853
1980
  i.mutate(void 0, {
1854
1981
  onSuccess: () => {
1855
1982
  c(!1), o && o();
1856
1983
  }
1857
1984
  });
1858
1985
  }, v = d || {}, f = t.length || v.currentCount || 0, h = v.maxParticipants;
1859
- return /* @__PURE__ */ l(_, { children: [
1986
+ return /* @__PURE__ */ l(B, { children: [
1860
1987
  /* @__PURE__ */ l("div", { className: "pvx-reg-form-header", children: [
1861
1988
  /* @__PURE__ */ n("h3", { className: "pvx-reg-form-title", children: "Registered Drivers" }),
1862
- h && /* @__PURE__ */ n(Fe, { count: f, max: h })
1989
+ h && /* @__PURE__ */ n(_e, { count: f, max: h })
1863
1990
  ] }),
1864
- /* @__PURE__ */ n(Ue, { drivers: t, steamId: s }),
1991
+ /* @__PURE__ */ n(Ee, { drivers: t, steamId: r }),
1865
1992
  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: [
1993
+ s ? /* @__PURE__ */ n("div", { className: "pvx-reg-actions", children: p ? /* @__PURE__ */ l("div", { className: "pvx-reg-confirm", children: [
1867
1994
  /* @__PURE__ */ n("p", { className: "pvx-reg-confirm-text", children: "Are you sure you want to unregister?" }),
1868
1995
  /* @__PURE__ */ l("div", { className: "pvx-reg-confirm-actions", children: [
1869
1996
  /* @__PURE__ */ n(
@@ -1897,115 +2024,117 @@ function Fn({ competitionId: e, drivers: t, steamId: s, isPowerMode: r, registra
1897
2024
  ) }) : /* @__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
2025
  ] });
1899
2026
  }
1900
- function Ue({ drivers: e, steamId: t }) {
2027
+ function Ee({ drivers: e, steamId: t }) {
1901
2028
  if (!e.length)
1902
2029
  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;
2030
+ const r = [...e].sort((s, a) => {
2031
+ const i = t && s.steamId === t ? -1 : 0, o = t && a.steamId === t ? -1 : 0;
1905
2032
  return i - o;
1906
2033
  });
1907
- return /* @__PURE__ */ n("div", { className: "pvx-reg-driver-list", children: s.map((r) => {
2034
+ return /* @__PURE__ */ n("div", { className: "pvx-reg-driver-list", children: r.map((s) => {
1908
2035
  var i, o;
1909
- const a = t && r.steamId === t;
2036
+ const a = t && s.steamId === t;
1910
2037
  return /* @__PURE__ */ l(
1911
2038
  "div",
1912
2039
  {
1913
2040
  className: `pvx-reg-driver-row ${a ? "pvx-reg-driver-row--you" : ""}`,
1914
2041
  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()) || "?" }),
2042
+ 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: ((o = (i = s.displayName) == null ? void 0 : i.charAt(0)) == null ? void 0 : o.toUpperCase()) || "?" }),
1916
2043
  /* @__PURE__ */ l("span", { className: "pvx-reg-driver-name", children: [
1917
- r.displayName,
2044
+ s.displayName,
1918
2045
  a && /* @__PURE__ */ n("span", { className: "pvx-entry-you", children: " (you)" })
1919
2046
  ] })
1920
2047
  ]
1921
2048
  },
1922
- r.steamId || r.driverId
2049
+ s.steamId || s.driverId
1923
2050
  );
1924
2051
  }) });
1925
2052
  }
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: [
2053
+ function _e({ count: e, max: t }) {
2054
+ const r = t ? e / t * 100 : 0, s = r >= 100 ? "full" : r >= 75 ? "warning" : "ok";
2055
+ return /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${s}`, children: [
1929
2056
  e,
1930
2057
  "/",
1931
2058
  t,
1932
2059
  " drivers"
1933
2060
  ] });
1934
2061
  }
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),
2062
+ function Wt({ competitionId: e, className: t }) {
2063
+ const { data: r, isLoading: s } = Se(e), a = (r == null ? void 0 : r.type) === "championship", i = (r == null ? void 0 : r.type) === "hotlap", o = T(() => (r == null ? void 0 : r.rounds) || [], [r]), d = i && o.length > 1, p = i && !d, { data: c } = rn(p ? e : null), u = T(
2064
+ () => o.filter((y) => y.isFinalized),
1938
2065
  [o]
1939
- ), v = $(
1940
- () => u.map((b) => b.roundNumber),
2066
+ ), v = T(
2067
+ () => u.map((y) => y.roundNumber),
1941
2068
  [u]
1942
2069
  ), { data: f = [], isLoading: h } = tn(
1943
2070
  e,
1944
2071
  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)
2072
+ ), k = p && f.length > 0 ? f[0] : null, m = (k == null ? void 0 : k.sessions) || [], g = d ? o.find(
2073
+ (y) => y.startTime && new Date(y.startTime) <= /* @__PURE__ */ new Date() && !j(y)
2074
+ ) : null, b = d ? g ? `hlround-${g.roundNumber}` : "standings" : p ? "leaderboard" : a ? "standings" : v.length > 0 ? `round-${v[v.length - 1]}` : null, [x, w] = E(null), C = x || b;
2075
+ if (s || h)
2076
+ return /* @__PURE__ */ n(W, { message: "Loading results..." });
2077
+ if (!r)
1949
2078
  return /* @__PURE__ */ n(U, { message: "Competition not found." });
1950
2079
  if (!u.length)
1951
2080
  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 = [];
2081
+ const M = new Map(f.map((y) => [`round-${y.roundNumber}`, y])), P = new Map(f.map((y) => [y.roundNumber, y])), N = [];
1953
2082
  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 });
2083
+ N.push({ id: "standings", label: "Standings" });
2084
+ for (const y of [...o].sort((A, R) => A.roundNumber - R.roundNumber))
2085
+ N.push({ id: `hlround-${y.roundNumber}`, label: `R${y.roundNumber}`, track: y.track || null });
1957
2086
  } 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) });
2087
+ N.push({ id: "leaderboard", label: "Leaderboard" });
2088
+ for (const y of m)
2089
+ N.push({ id: `session-${y.type}`, label: ee(y.type) });
1961
2090
  } 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 });
2091
+ N.push({ id: "standings", label: "Standings" });
2092
+ for (const y of u)
2093
+ N.push({ id: `round-${y.roundNumber}`, label: `R${y.roundNumber}`, track: null });
1965
2094
  } 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,
2095
+ for (const y of u)
2096
+ N.push({ id: `round-${y.roundNumber}`, label: `R${y.roundNumber}`, track: null });
2097
+ let S;
2098
+ if (C === "standings")
2099
+ S = /* @__PURE__ */ n(Fn, { competitionId: e });
2100
+ else if (C === "leaderboard")
2101
+ S = /* @__PURE__ */ n(Ue, { leaderboard: c, config: r });
2102
+ else if (C != null && C.startsWith("hlround-")) {
2103
+ const y = parseInt(C.slice(8), 10), A = o.find((R) => R.roundNumber === y);
2104
+ S = A ? /* @__PURE__ */ n(Zn, { competitionId: e, roundMeta: A, roundData: P.get(y) }) : /* @__PURE__ */ n(U, { message: "No results for this round." });
2105
+ } else if (C != null && C.startsWith("session-"))
2106
+ S = /* @__PURE__ */ n(
2107
+ Fe,
1979
2108
  {
1980
- session: x.find((b) => `session-${b.type}` === w),
2109
+ session: m.find((y) => `session-${y.type}` === C),
1981
2110
  round: k,
1982
2111
  competitionId: e
1983
2112
  }
1984
2113
  );
1985
2114
  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." });
2115
+ const y = M.get(C);
2116
+ S = y ? /* @__PURE__ */ n(Yn, { round: y, competitionId: e }) : /* @__PURE__ */ n(U, { message: "No results for this round." });
1988
2117
  }
1989
2118
  return /* @__PURE__ */ l("div", { className: t || "", children: [
1990
- /* @__PURE__ */ n("div", { className: "pvx-results-tabs", children: T.map((b) => /* @__PURE__ */ l(
2119
+ /* @__PURE__ */ n("div", { className: "pvx-results-tabs", children: N.map((y) => /* @__PURE__ */ l(
1991
2120
  "button",
1992
2121
  {
1993
- className: `pvx-results-tab ${w === b.id ? "pvx-results-tab--active" : ""}`,
1994
- onClick: () => m(b.id),
1995
- title: b.track || void 0,
2122
+ className: `pvx-results-tab ${C === y.id ? "pvx-results-tab--active" : ""}`,
2123
+ onClick: () => w(y.id),
2124
+ title: y.track || void 0,
1996
2125
  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 })
2126
+ /* @__PURE__ */ n("span", { className: "pvx-results-tab-label", children: y.label }),
2127
+ y.track && /* @__PURE__ */ n("span", { className: "pvx-results-tab-track", children: y.track })
1999
2128
  ]
2000
2129
  },
2001
- b.id
2130
+ y.id
2002
2131
  )) }),
2003
- N
2132
+ S
2004
2133
  ] });
2005
2134
  }
2006
- function En({ round: e, competitionId: t }) {
2135
+ function Yn({ round: e, competitionId: t }) {
2007
2136
  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);
2137
+ const s = (e.sessions || []).find((o) => o.type === "RACE"), a = (i = s == null ? void 0 : s.results) == null ? void 0 : i.filter((o) => o.position <= 3).sort((o, d) => o.position - d.position);
2009
2138
  return /* @__PURE__ */ l("div", { className: "pvx-card", children: [
2010
2139
  /* @__PURE__ */ l("div", { className: "pvx-card-header--split", children: [
2011
2140
  /* @__PURE__ */ l("div", { children: [
@@ -2028,11 +2157,11 @@ function En({ round: e, competitionId: t }) {
2028
2157
  /* @__PURE__ */ n(ve, { round: e, competitionId: t })
2029
2158
  ] });
2030
2159
  }
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: [
2160
+ function Ue({ leaderboard: e, config: t, heading: r }) {
2161
+ var s;
2162
+ return (s = e == null ? void 0 : e.drivers) != null && s.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
2034
2163
  /* @__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" }),
2164
+ /* @__PURE__ */ n("h4", { className: "pvx-card-title", children: r || e.track || (t == null ? void 0 : t.name) || "Hotlap Leaderboard" }),
2036
2165
  /* @__PURE__ */ l("span", { className: "pvx-standings-subtitle", children: [
2037
2166
  e.sessionsCompleted,
2038
2167
  " session",
@@ -2055,10 +2184,10 @@ function Ee({ leaderboard: e, config: t, heading: s }) {
2055
2184
  return /* @__PURE__ */ l("tr", { className: `pvx-row ${a.position <= 3 ? "pvx-row--podium" : ""}`, children: [
2056
2185
  /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(me, { position: a.position }) }),
2057
2186
  /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
2058
- /* @__PURE__ */ n(X, { nation: a.nation }),
2187
+ /* @__PURE__ */ n(ne, { nation: a.nation }),
2059
2188
  a.driverName
2060
2189
  ] }),
2061
- /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: I(a.carId) }),
2190
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: _(a.carId) }),
2062
2191
  /* @__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
2192
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: a.totalLaps }),
2064
2193
  /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: a.sessionsParticipated }),
@@ -2068,22 +2197,22 @@ function Ee({ leaderboard: e, config: t, heading: s }) {
2068
2197
  ] }) })
2069
2198
  ] }) : /* @__PURE__ */ n(U, { message: "No lap times recorded yet." });
2070
2199
  }
2071
- function qe({ session: e, round: t, competitionId: s }) {
2200
+ function Fe({ session: e, round: t, competitionId: r }) {
2072
2201
  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) }) }),
2202
+ /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n("h4", { className: "pvx-card-title", children: ee(e.type) }) }),
2074
2203
  /* @__PURE__ */ n(
2075
2204
  ve,
2076
2205
  {
2077
2206
  round: { ...t, sessions: [e] },
2078
- competitionId: s
2207
+ competitionId: r
2079
2208
  }
2080
2209
  )
2081
2210
  ] }) : /* @__PURE__ */ n(U, { message: "Session data not available." });
2082
2211
  }
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 = [
2212
+ function Zn({ competitionId: e, roundMeta: t, roundData: r }) {
2213
+ const { data: s } = sn(e, t.roundNumber), a = (r == null ? void 0 : r.sessions) || [], [i, o] = E("leaderboard"), d = [
2085
2214
  { id: "leaderboard", label: "Leaderboard" },
2086
- ...a.map((u) => ({ id: `session-${u.type}`, label: Z(u.type) }))
2215
+ ...a.map((u) => ({ id: `session-${u.type}`, label: ee(u.type) }))
2087
2216
  ], p = d.some((u) => u.id === i) ? i : "leaderboard", c = `Round ${t.roundNumber}${t.track ? ` — ${t.track}` : ""}`;
2088
2217
  return /* @__PURE__ */ l("div", { children: [
2089
2218
  /* @__PURE__ */ n("div", { className: "pvx-session-tabs", children: d.map((u) => /* @__PURE__ */ n(
@@ -2095,110 +2224,110 @@ function qn({ competitionId: e, roundMeta: t, roundData: s }) {
2095
2224
  },
2096
2225
  u.id
2097
2226
  )) }),
2098
- p === "leaderboard" ? /* @__PURE__ */ n(Ee, { leaderboard: r, heading: c }) : /* @__PURE__ */ n(
2099
- qe,
2227
+ p === "leaderboard" ? /* @__PURE__ */ n(Ue, { leaderboard: s, heading: c }) : /* @__PURE__ */ n(
2228
+ Fe,
2100
2229
  {
2101
2230
  session: a.find((u) => `session-${u.type}` === p),
2102
- round: s,
2231
+ round: r,
2103
2232
  competitionId: e
2104
2233
  }
2105
2234
  )
2106
2235
  ] });
2107
2236
  }
2108
- function _n(e) {
2109
- const { cdnUrl: t } = C(), s = M({
2237
+ function Jn(e) {
2238
+ const { cdnUrl: t } = L(), r = $({
2110
2239
  queryKey: ["pitvox", "laps", "global", e, "index"],
2111
2240
  queryFn: () => D(t, ye(null, e)),
2112
2241
  enabled: !!e,
2113
2242
  staleTime: 3e4,
2114
2243
  refetchInterval: 3e4
2115
- }), r = s.data;
2244
+ }), s = r.data;
2116
2245
  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
2246
+ isLoading: r.isLoading,
2247
+ error: r.error,
2248
+ data: s ? {
2249
+ driverName: s.driverName || "Driver",
2250
+ lapCount: s.lapCount || 0,
2251
+ trackBreakdown: s.trackBreakdown || [],
2252
+ carBreakdown: s.carBreakdown || [],
2253
+ recordsHeld: s.recordsHeld || 0,
2254
+ currentRecords: s.currentRecords || [],
2255
+ bestRanking: s.bestRanking ?? null,
2256
+ bestRankingTrackId: s.bestRankingTrackId ?? null,
2257
+ bestRankingLayout: s.bestRankingLayout ?? null,
2258
+ bestRankingCarId: s.bestRankingCarId ?? null,
2259
+ generatedAt: s.generatedAt
2131
2260
  } : null
2132
2261
  };
2133
2262
  }
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)),
2263
+ function Xn(e) {
2264
+ const { cdnUrl: t, partnerSlug: r } = L(), s = $({
2265
+ queryKey: ["pitvox", "laps", r || "global", e, "index"],
2266
+ queryFn: () => D(t, ye(r, e)),
2138
2267
  enabled: !!e,
2139
2268
  staleTime: 3e4,
2140
2269
  refetchInterval: 3e4
2141
- }), a = $(() => {
2270
+ }), a = T(() => {
2142
2271
  var i;
2143
- return ((i = r.data) == null ? void 0 : i.combos) || [];
2144
- }, [r.data]);
2272
+ return ((i = s.data) == null ? void 0 : i.combos) || [];
2273
+ }, [s.data]);
2145
2274
  return {
2146
- isLoading: r.isLoading,
2147
- error: r.error,
2275
+ isLoading: s.isLoading,
2276
+ error: s.error,
2148
2277
  data: a
2149
2278
  };
2150
2279
  }
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],
2280
+ function qe(e = {}) {
2281
+ const { cdnUrl: t, partnerSlug: r } = L(), { game: s, gameVersion: a, enabled: i = !0 } = e, o = ie(r, s, a, "ratings.json");
2282
+ return $({
2283
+ queryKey: ["pitvox", "ratings", r, s || null, a || null],
2155
2284
  queryFn: () => D(t, o),
2156
2285
  staleTime: 3e4,
2157
2286
  refetchInterval: 3e4,
2158
2287
  enabled: i
2159
2288
  });
2160
2289
  }
2161
- function At(e) {
2162
- var r;
2163
- const t = _e(), s = $(() => {
2290
+ function Kt(e) {
2291
+ var s;
2292
+ const t = qe(), r = T(() => {
2164
2293
  var a;
2165
2294
  return !((a = t.data) != null && a.drivers) || !e ? null : t.data.drivers.find(
2166
2295
  (i) => i.identifier === e
2167
2296
  ) || null;
2168
- }, [(r = t.data) == null ? void 0 : r.drivers, e]);
2297
+ }, [(s = t.data) == null ? void 0 : s.drivers, e]);
2169
2298
  return {
2170
2299
  isLoading: t.isLoading,
2171
2300
  error: t.error,
2172
- data: s ? {
2173
- rating: s.rating,
2174
- rank: s.rank,
2301
+ data: r ? {
2302
+ rating: r.rating,
2303
+ rank: r.rank,
2175
2304
  totalDrivers: t.data.driverCount || t.data.drivers.length,
2176
- comboCount: s.comboCount || 0,
2177
- distinctCars: s.distinctCars || 0,
2178
- combos: s.combos || []
2305
+ comboCount: r.comboCount || 0,
2306
+ distinctCars: r.distinctCars || 0,
2307
+ combos: r.combos || []
2179
2308
  } : null
2180
2309
  };
2181
2310
  }
2182
- function re(e = {}) {
2183
- const t = _e(e);
2311
+ function se(e = {}) {
2312
+ const t = qe(e);
2184
2313
  return {
2185
2314
  data: t.data || null,
2186
2315
  isLoading: t.isLoading,
2187
2316
  error: t.error
2188
2317
  };
2189
2318
  }
2190
- function Vn(e) {
2319
+ function et(e) {
2191
2320
  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 });
2321
+ const { versions: t } = Je(), 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 = se({ game: "evo", gameVersion: r, enabled: !!r }), i = se({ game: "acc" }), o = se({ game: "lmu", gameVersion: s, enabled: !!s });
2193
2322
  return {
2194
- data: $(() => e ? [
2323
+ data: T(() => e ? [
2195
2324
  { data: a.data, game: "evo", label: "EVO" },
2196
2325
  { data: i.data, game: "acc", label: "ACC" },
2197
2326
  { data: o.data, game: "lmu", label: "LMU" }
2198
2327
  ].map(({ data: u, game: v, label: f }) => {
2199
- var x;
2200
- 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);
2328
+ var m;
2329
+ if (!((m = u == null ? void 0 : u.drivers) != null && m.length)) return null;
2330
+ const h = [...u.drivers].sort((g, b) => b.rating - g.rating), k = h.findIndex((g) => g.identifier === e);
2202
2331
  return k === -1 ? null : {
2203
2332
  game: v,
2204
2333
  label: f,
@@ -2210,8 +2339,8 @@ function Vn(e) {
2210
2339
  isLoading: a.isLoading || i.isLoading || o.isLoading
2211
2340
  };
2212
2341
  }
2213
- function Kn() {
2214
- const { cdnUrl: e, partnerSlug: t, getSteamId: s, onFetchServerPassword: r } = C(), a = s(), { data: i, isLoading: o } = M({
2342
+ function nt() {
2343
+ const { cdnUrl: e, partnerSlug: t, getSteamId: r, onFetchServerPassword: s } = L(), a = r(), { data: i, isLoading: o } = $({
2215
2344
  queryKey: ["pitvox", "competitions", t],
2216
2345
  queryFn: async () => {
2217
2346
  const h = await D(e, "competitions/index.json");
@@ -2225,20 +2354,20 @@ function Kn() {
2225
2354
  enabled: !!a && d.length > 0,
2226
2355
  staleTime: 6e4
2227
2356
  }))
2228
- }), c = p.some((h) => h.isLoading), u = $(() => {
2229
- var x, g;
2357
+ }), c = p.some((h) => h.isLoading), u = T(() => {
2358
+ var m, g;
2230
2359
  if (!i || !a || c) return [];
2231
2360
  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;
2361
+ for (let b = 0; b < i.length; b++) {
2362
+ const x = i[b], w = (m = p[b]) == null ? void 0 : m.data;
2234
2363
  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,
2364
+ const M = x.type === "hotlap", P = x.rounds || [];
2365
+ for (const N of P) {
2366
+ if (M ? j(N) : N.isFinalized) continue;
2367
+ const y = N.dediStatus === "running" || N.dediStatus === "provisioning", A = N.dediStatus === "scheduled", R = N.startTime && new Date(N.startTime) > h, H = y || A || N.dediServerAddress;
2368
+ !y && !R && !H || k.push({
2369
+ competitionId: x.id,
2370
+ competitionName: x.name,
2242
2371
  roundNumber: N.roundNumber,
2243
2372
  track: N.track || "TBD",
2244
2373
  startTime: N.startTime,
@@ -2247,49 +2376,49 @@ function Kn() {
2247
2376
  });
2248
2377
  }
2249
2378
  }
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);
2379
+ return k.sort((b, x) => {
2380
+ const w = b.dediStatus === "running" || b.dediStatus === "provisioning", C = x.dediStatus === "running" || x.dediStatus === "provisioning";
2381
+ return w && !C ? -1 : !w && C ? 1 : new Date(b.startTime) - new Date(x.startTime);
2253
2382
  }), k.length > 0 && (k[0].isNext = !0), k;
2254
2383
  }, [i, a, c, p]), v = xe({
2255
2384
  queries: u.map((h) => ({
2256
2385
  queryKey: ["pitvox", "serverInfo", h.competitionId, h.roundNumber],
2257
- queryFn: () => r(h.competitionId, h.roundNumber),
2258
- enabled: !!r && u.length > 0,
2386
+ queryFn: () => s(h.competitionId, h.roundNumber),
2387
+ enabled: !!s && u.length > 0,
2259
2388
  staleTime: 5 * 6e4,
2260
2389
  // 5 minutes
2261
2390
  retry: !1
2262
2391
  }))
2263
2392
  });
2264
2393
  return {
2265
- data: $(() => u.length ? r ? u.map((h, k) => {
2394
+ data: T(() => u.length ? s ? u.map((h, k) => {
2266
2395
  var g;
2267
- const x = (g = v[k]) == null ? void 0 : g.data;
2268
- return x != null && x.success ? {
2396
+ const m = (g = v[k]) == null ? void 0 : g.data;
2397
+ return m != null && m.success ? {
2269
2398
  ...h,
2270
- serverAddress: x.serverAddress || null,
2271
- serverPassword: x.serverPassword || null
2399
+ serverAddress: m.serverAddress || null,
2400
+ serverPassword: m.serverPassword || null
2272
2401
  } : h;
2273
- }) : u : [], [u, r, v]),
2402
+ }) : u : [], [u, s, v]),
2274
2403
  isLoading: o || !!a && c
2275
2404
  };
2276
2405
  }
2277
- function Hn() {
2278
- const { onFetchNotifications: e } = C();
2406
+ function tt() {
2407
+ const { onFetchNotifications: e } = L();
2279
2408
  return !!e;
2280
2409
  }
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 }),
2410
+ function rt(e = {}) {
2411
+ const { onFetchNotifications: t, partnerSlug: r } = L(), { limit: s = 20, unreadOnly: a = !1 } = e;
2412
+ return $({
2413
+ queryKey: ["pitvox", "notifications", r, { limit: s, unreadOnly: a }],
2414
+ queryFn: () => t({ limit: s, unreadOnly: a }),
2286
2415
  enabled: !!t,
2287
2416
  staleTime: 3e4,
2288
2417
  refetchInterval: 3e4
2289
2418
  });
2290
2419
  }
2291
- function Bt() {
2292
- const { onFetchNotifications: e, partnerSlug: t } = C(), { data: s, isLoading: r } = M({
2420
+ function Ot() {
2421
+ const { onFetchNotifications: e, partnerSlug: t } = L(), { data: r, isLoading: s } = $({
2293
2422
  queryKey: ["pitvox", "notifications", t, { limit: 1, unreadOnly: !1 }],
2294
2423
  queryFn: () => e({ limit: 1 }),
2295
2424
  enabled: !!e,
@@ -2297,18 +2426,18 @@ function Bt() {
2297
2426
  refetchInterval: 3e4,
2298
2427
  select: (a) => (a == null ? void 0 : a.unreadCount) ?? 0
2299
2428
  });
2300
- return { count: s ?? 0, isLoading: r };
2429
+ return { count: r ?? 0, isLoading: s };
2301
2430
  }
2302
- function On() {
2303
- const { onMarkNotificationRead: e, partnerSlug: t } = C(), s = H();
2304
- return Q({
2305
- mutationFn: (r) => {
2431
+ function st() {
2432
+ const { onMarkNotificationRead: e, partnerSlug: t } = L(), r = O();
2433
+ return Y({
2434
+ mutationFn: (s) => {
2306
2435
  if (!e)
2307
2436
  throw new Error("No onMarkNotificationRead callback provided to PitVoxPartnerProvider.");
2308
- return e(r);
2437
+ return e(s);
2309
2438
  },
2310
- onSuccess: (r, a) => {
2311
- s.setQueriesData(
2439
+ onSuccess: (s, a) => {
2440
+ r.setQueriesData(
2312
2441
  { queryKey: ["pitvox", "notifications", t] },
2313
2442
  (i) => i != null && i.notifications ? {
2314
2443
  ...i,
@@ -2321,33 +2450,33 @@ function On() {
2321
2450
  }
2322
2451
  });
2323
2452
  }
2324
- function zn() {
2325
- const { onMarkAllNotificationsRead: e, partnerSlug: t } = C(), s = H();
2326
- return Q({
2453
+ function at() {
2454
+ const { onMarkAllNotificationsRead: e, partnerSlug: t } = L(), r = O();
2455
+ return Y({
2327
2456
  mutationFn: () => {
2328
2457
  if (!e)
2329
2458
  throw new Error("No onMarkAllNotificationsRead callback provided to PitVoxPartnerProvider.");
2330
2459
  return e();
2331
2460
  },
2332
2461
  onSuccess: () => {
2333
- s.setQueriesData(
2462
+ r.setQueriesData(
2334
2463
  { queryKey: ["pitvox", "notifications", t] },
2335
- (r) => r != null && r.notifications ? {
2336
- ...r,
2464
+ (s) => s != null && s.notifications ? {
2465
+ ...s,
2337
2466
  unreadCount: 0,
2338
- notifications: r.notifications.map((a) => ({
2467
+ notifications: s.notifications.map((a) => ({
2339
2468
  ...a,
2340
2469
  isRead: !0,
2341
2470
  readAt: a.readAt || (/* @__PURE__ */ new Date()).toISOString()
2342
2471
  }))
2343
- } : r
2472
+ } : s
2344
2473
  );
2345
2474
  }
2346
2475
  });
2347
2476
  }
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: [
2477
+ function it({ driverName: e, avatarUrl: t, memberSince: r, className: s = "" }) {
2478
+ const a = r ? new Date(r).toLocaleDateString("en-GB", { day: "2-digit", month: "2-digit", year: "numeric" }) : null;
2479
+ return /* @__PURE__ */ l("div", { className: `pvx-card pvx-dash-profile ${s}`, children: [
2351
2480
  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
2481
  /* @__PURE__ */ l("div", { className: "pvx-dash-profile-info", children: [
2353
2482
  /* @__PURE__ */ n("h2", { className: "pvx-dash-profile-name", children: e }),
@@ -2358,7 +2487,7 @@ function Qn({ driverName: e, avatarUrl: t, memberSince: s, className: r = "" })
2358
2487
  ] })
2359
2488
  ] });
2360
2489
  }
2361
- function Gn() {
2490
+ function ot() {
2362
2491
  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
2492
  /* @__PURE__ */ n("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
2364
2493
  /* @__PURE__ */ n("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
@@ -2366,7 +2495,7 @@ function Gn() {
2366
2495
  /* @__PURE__ */ n("line", { x1: "16", y1: "3", x2: "14", y2: "21" })
2367
2496
  ] });
2368
2497
  }
2369
- function Yn() {
2498
+ function lt() {
2370
2499
  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
2500
  /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "10" }),
2372
2501
  /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "2" }),
@@ -2378,16 +2507,16 @@ function Yn() {
2378
2507
  function Ne() {
2379
2508
  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
2509
  }
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(() => {
2510
+ function be({ icon: e, value: t, label: r, items: s, labelKey: a, countKey: i }) {
2511
+ const [o, d] = E(!1), p = Ve(null);
2512
+ We(() => {
2384
2513
  if (!o) return;
2385
2514
  function u(v) {
2386
2515
  p.current && !p.current.contains(v.target) && d(!1);
2387
2516
  }
2388
2517
  return document.addEventListener("mousedown", u), () => document.removeEventListener("mousedown", u);
2389
2518
  }, [o]);
2390
- const c = r != null && r.length ? r.slice().sort((u, v) => v[i] - u[i]) : null;
2519
+ const c = s != null && s.length ? s.slice().sort((u, v) => v[i] - u[i]) : null;
2391
2520
  return /* @__PURE__ */ l(
2392
2521
  "div",
2393
2522
  {
@@ -2398,7 +2527,7 @@ function be({ icon: e, value: t, label: s, items: r, labelKey: a, countKey: i })
2398
2527
  e,
2399
2528
  /* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
2400
2529
  /* @__PURE__ */ n("span", { className: "pvx-dash-stat-value", children: t }),
2401
- /* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children: s })
2530
+ /* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children: r })
2402
2531
  ] }),
2403
2532
  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: [
2404
2533
  /* @__PURE__ */ n("span", { className: "pvx-dash-tooltip-label", children: u[a] }),
@@ -2408,20 +2537,20 @@ function be({ icon: e, value: t, label: s, items: r, labelKey: a, countKey: i })
2408
2537
  }
2409
2538
  );
2410
2539
  }
2411
- function Jn({ stats: e, gameRatings: t, onGameRatingSelect: s, rating: r, className: a = "" }) {
2540
+ function ct({ stats: e, gameRatings: t, onGameRatingSelect: r, rating: s, className: a = "" }) {
2412
2541
  if (!e) return null;
2413
2542
  const i = e.trackBreakdown.map((p) => ({
2414
- name: j(p.trackId, p.layout),
2543
+ name: V(p.trackId, p.layout),
2415
2544
  lapCount: p.lapCount
2416
2545
  })), o = e.carBreakdown.map((p) => ({
2417
- name: I(p.carId),
2546
+ name: _(p.carId),
2418
2547
  lapCount: p.lapCount
2419
2548
  })), d = Array.isArray(t) && t.length > 0;
2420
2549
  return /* @__PURE__ */ l("div", { className: `pvx-dash-stats ${a}`, children: [
2421
2550
  /* @__PURE__ */ n(
2422
2551
  be,
2423
2552
  {
2424
- icon: /* @__PURE__ */ n(Gn, {}),
2553
+ icon: /* @__PURE__ */ n(ot, {}),
2425
2554
  value: e.lapCount.toLocaleString(),
2426
2555
  label: "Total Laps",
2427
2556
  items: i,
@@ -2432,7 +2561,7 @@ function Jn({ stats: e, gameRatings: t, onGameRatingSelect: s, rating: r, classN
2432
2561
  /* @__PURE__ */ n(
2433
2562
  be,
2434
2563
  {
2435
- icon: /* @__PURE__ */ n(Yn, {}),
2564
+ icon: /* @__PURE__ */ n(lt, {}),
2436
2565
  value: e.carBreakdown.length,
2437
2566
  label: "Cars Used",
2438
2567
  items: o,
@@ -2445,14 +2574,14 @@ function Jn({ stats: e, gameRatings: t, onGameRatingSelect: s, rating: r, classN
2445
2574
  /* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
2446
2575
  /* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children: "Driver Rating" }),
2447
2576
  /* @__PURE__ */ n("div", { className: "pvx-dash-rating-chips", children: t.map((p) => {
2448
- const c = !!s;
2577
+ const c = !!r;
2449
2578
  return /* @__PURE__ */ l(
2450
2579
  "span",
2451
2580
  {
2452
2581
  className: `pvx-dash-rating-chip${c ? " pvx-dash-rating-chip--clickable" : ""}`,
2453
- onClick: c ? () => s(p) : void 0,
2582
+ onClick: c ? () => r(p) : void 0,
2454
2583
  onKeyDown: c ? (v) => {
2455
- c && (v.key === "Enter" || v.key === " ") && (v.preventDefault(), s(p));
2584
+ c && (v.key === "Enter" || v.key === " ") && (v.preventDefault(), r(p));
2456
2585
  } : void 0,
2457
2586
  role: c ? "button" : void 0,
2458
2587
  tabIndex: c ? 0 : void 0,
@@ -2472,23 +2601,23 @@ function Jn({ stats: e, gameRatings: t, onGameRatingSelect: s, rating: r, classN
2472
2601
  );
2473
2602
  }) })
2474
2603
  ] })
2475
- ] }) : r ? /* @__PURE__ */ l("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--rating", children: [
2604
+ ] }) : s ? /* @__PURE__ */ l("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--rating", children: [
2476
2605
  /* @__PURE__ */ n(Ne, {}),
2477
2606
  /* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
2478
- /* @__PURE__ */ n("span", { className: "pvx-dash-stat-value", children: r.rating.toFixed(1) }),
2607
+ /* @__PURE__ */ n("span", { className: "pvx-dash-stat-value", children: s.rating.toFixed(1) }),
2479
2608
  /* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children: "Driver Rating" }),
2480
2609
  /* @__PURE__ */ l("span", { className: "pvx-dash-stat-sub", children: [
2481
2610
  "#",
2482
- r.rank,
2611
+ s.rank,
2483
2612
  " of ",
2484
- r.totalDrivers
2613
+ s.totalDrivers
2485
2614
  ] })
2486
2615
  ] })
2487
2616
  ] }) : null
2488
2617
  ] });
2489
2618
  }
2490
- function Zn({ combos: e, onComboSelect: t, className: s = "" }) {
2491
- return e != null && e.length ? /* @__PURE__ */ l("div", { className: `pvx-card ${s}`, children: [
2619
+ function dt({ combos: e, onComboSelect: t, className: r = "" }) {
2620
+ return e != null && e.length ? /* @__PURE__ */ l("div", { className: `pvx-card ${r}`, children: [
2492
2621
  /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
2493
2622
  /* @__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
2623
  /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "10" }),
@@ -2501,18 +2630,18 @@ function Zn({ combos: e, onComboSelect: t, className: s = "" }) {
2501
2630
  ")"
2502
2631
  ] })
2503
2632
  ] }) }),
2504
- /* @__PURE__ */ n("div", { className: "pvx-dash-combos-list", children: e.map((r) => /* @__PURE__ */ n(
2505
- Xn,
2633
+ /* @__PURE__ */ n("div", { className: "pvx-dash-combos-list", children: e.map((s) => /* @__PURE__ */ n(
2634
+ pt,
2506
2635
  {
2507
- combo: r,
2508
- onClick: t ? () => t(r) : null
2636
+ combo: s,
2637
+ onClick: t ? () => t(s) : null
2509
2638
  },
2510
- `${r.trackId}|${r.trackLayout || ""}|${r.carId}|${r.game || ""}|${r.gameVersion || ""}`
2639
+ `${s.trackId}|${s.trackLayout || ""}|${s.carId}|${s.game || ""}|${s.gameVersion || ""}`
2511
2640
  )) })
2512
2641
  ] }) : null;
2513
2642
  }
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;
2643
+ function pt({ combo: e, onClick: t }) {
2644
+ 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
2645
  return /* @__PURE__ */ l(
2517
2646
  "div",
2518
2647
  {
@@ -2526,12 +2655,12 @@ function Xn({ combo: e, onClick: t }) {
2526
2655
  children: [
2527
2656
  /* @__PURE__ */ l("div", { className: "pvx-dash-combo-info", children: [
2528
2657
  /* @__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) })
2658
+ e.game && /* @__PURE__ */ n("span", { className: `pvx-dash-game-badge pvx-dash-game-badge--${r}`, children: r.toUpperCase() }),
2659
+ /* @__PURE__ */ n("span", { className: "pvx-dash-combo-track", children: V(e.trackId, e.trackLayout, e.game) })
2531
2660
  ] }),
2532
2661
  /* @__PURE__ */ l("div", { className: "pvx-dash-combo-meta", children: [
2533
- /* @__PURE__ */ n("span", { className: "pvx-dash-combo-car", children: I(e.carId) }),
2534
- e.lapCount > 0 && /* @__PURE__ */ l(_, { children: [
2662
+ /* @__PURE__ */ n("span", { className: "pvx-dash-combo-car", children: _(e.carId) }),
2663
+ e.lapCount > 0 && /* @__PURE__ */ l(B, { children: [
2535
2664
  /* @__PURE__ */ n("span", { className: "pvx-dash-combo-meta-sep", children: "·" }),
2536
2665
  /* @__PURE__ */ l("span", { children: [
2537
2666
  e.lapCount,
@@ -2539,7 +2668,7 @@ function Xn({ combo: e, onClick: t }) {
2539
2668
  e.lapCount === 1 ? "lap" : "laps"
2540
2669
  ] })
2541
2670
  ] }),
2542
- e.lastDrivenAt && /* @__PURE__ */ l(_, { children: [
2671
+ e.lastDrivenAt && /* @__PURE__ */ l(B, { children: [
2543
2672
  /* @__PURE__ */ n("span", { className: "pvx-dash-combo-meta-sep", children: "·" }),
2544
2673
  /* @__PURE__ */ n("span", { children: oe(e.lastDrivenAt) })
2545
2674
  ] })
@@ -2567,9 +2696,9 @@ function Xn({ combo: e, onClick: t }) {
2567
2696
  e.totalDrivers,
2568
2697
  " on leaderboard"
2569
2698
  ] }) : null,
2570
- r && /* @__PURE__ */ l("span", { className: "pvx-dash-combo-gap", children: [
2699
+ s && /* @__PURE__ */ l("span", { className: "pvx-dash-combo-gap", children: [
2571
2700
  "+",
2572
- r
2701
+ s
2573
2702
  ] }),
2574
2703
  e.personalBestMs && /* @__PURE__ */ n("span", { className: "pvx-dash-combo-pb", children: q(e.personalBestMs) })
2575
2704
  ] })
@@ -2577,15 +2706,15 @@ function Xn({ combo: e, onClick: t }) {
2577
2706
  }
2578
2707
  );
2579
2708
  }
2580
- function et({ events: e, isLoading: t, className: s, limit: r = 3 }) {
2709
+ function ut({ events: e, isLoading: t, className: r, limit: s = 3 }) {
2581
2710
  if (t)
2582
2711
  return /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading upcoming events..." });
2583
2712
  if (!(e != null && e.length))
2584
2713
  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: [
2714
+ const a = s ? e.slice(0, s) : e, i = e.length - a.length;
2715
+ return /* @__PURE__ */ l("div", { className: `pvx-card ${r || ""}`, children: [
2587
2716
  /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
2588
- /* @__PURE__ */ n(st, {}),
2717
+ /* @__PURE__ */ n(vt, {}),
2589
2718
  "Upcoming Events",
2590
2719
  /* @__PURE__ */ l("span", { className: "pvx-dash-records-count", children: [
2591
2720
  "(",
@@ -2608,7 +2737,7 @@ function et({ events: e, isLoading: t, className: s, limit: r = 3 }) {
2608
2737
  o.track
2609
2738
  ] }),
2610
2739
  o.serverPassword && /* @__PURE__ */ n(
2611
- nt,
2740
+ ht,
2612
2741
  {
2613
2742
  password: o.serverPassword,
2614
2743
  address: o.serverAddress
@@ -2621,7 +2750,7 @@ function et({ events: e, isLoading: t, className: s, limit: r = 3 }) {
2621
2750
  month: "short",
2622
2751
  year: "numeric"
2623
2752
  }) }),
2624
- /* @__PURE__ */ n("span", { className: "pvx-upcoming-relative", children: o.dediStatus === "running" ? "Live now" : o.dediStatus === "provisioning" ? "Starting..." : tt(o.startTime) }),
2753
+ /* @__PURE__ */ n("span", { className: "pvx-upcoming-relative", children: o.dediStatus === "running" ? "Live now" : o.dediStatus === "provisioning" ? "Starting..." : mt(o.startTime) }),
2625
2754
  o.dediStatus === "running" && /* @__PURE__ */ n("span", { className: "pvx-upcoming-badge pvx-upcoming-badge--live", children: "Live" }),
2626
2755
  !o.dediStatus && o.isNext && /* @__PURE__ */ n("span", { className: "pvx-upcoming-badge", children: "Next" })
2627
2756
  ] })
@@ -2638,11 +2767,11 @@ function et({ events: e, isLoading: t, className: s, limit: r = 3 }) {
2638
2767
  ] })
2639
2768
  ] });
2640
2769
  }
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 () => {
2770
+ function ht({ password: e, address: t }) {
2771
+ const [r, s] = E(!1), [a, i] = E(!1), o = t ? e ? `join:${t}|${e}` : `join:${t}` : null, d = K(async () => {
2643
2772
  if (o)
2644
2773
  try {
2645
- await navigator.clipboard.writeText(o), r(!0), setTimeout(() => r(!1), 2e3);
2774
+ await navigator.clipboard.writeText(o), s(!0), setTimeout(() => s(!1), 2e3);
2646
2775
  } catch {
2647
2776
  }
2648
2777
  }, [o]);
@@ -2654,110 +2783,110 @@ function nt({ password: e, address: t }) {
2654
2783
  onClick: d,
2655
2784
  title: "Copy join string to clipboard",
2656
2785
  children: [
2657
- /* @__PURE__ */ n(at, {}),
2786
+ /* @__PURE__ */ n(gt, {}),
2658
2787
  " ",
2659
- s ? "Copied!" : "Join"
2788
+ r ? "Copied!" : "Join"
2660
2789
  ]
2661
2790
  }
2662
2791
  ),
2663
- e && /* @__PURE__ */ l(_, { children: [
2792
+ e && /* @__PURE__ */ l(B, { children: [
2664
2793
  /* @__PURE__ */ n(
2665
2794
  "span",
2666
2795
  {
2667
2796
  className: "pvx-server-detail pvx-server-detail--clickable",
2668
2797
  onClick: () => i((p) => !p),
2669
2798
  title: a ? "Hide password" : "Reveal password",
2670
- children: a ? /* @__PURE__ */ n(ot, {}) : /* @__PURE__ */ n(it, {})
2799
+ children: a ? /* @__PURE__ */ n(Nt, {}) : /* @__PURE__ */ n(ft, {})
2671
2800
  }
2672
2801
  ),
2673
2802
  a && /* @__PURE__ */ l("span", { className: "pvx-server-detail", children: [
2674
- /* @__PURE__ */ n(rt, {}),
2803
+ /* @__PURE__ */ n(xt, {}),
2675
2804
  " ",
2676
2805
  e
2677
2806
  ] })
2678
2807
  ] })
2679
2808
  ] });
2680
2809
  }
2681
- function tt(e) {
2810
+ function mt(e) {
2682
2811
  const t = new Date(e).getTime() - Date.now();
2683
2812
  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);
2813
+ const r = Math.floor(t / (1e3 * 60 * 60));
2814
+ if (r < 1) return "Less than 1 hour";
2815
+ if (r < 24) return `in ${r}h`;
2816
+ const s = Math.floor(r / 24);
2817
+ if (s === 1) return "Tomorrow";
2818
+ if (s < 7) return `in ${s} days`;
2819
+ if (s < 30) {
2820
+ const a = Math.floor(s / 7);
2692
2821
  return `in ${a} week${a !== 1 ? "s" : ""}`;
2693
2822
  }
2694
2823
  return oe(e);
2695
2824
  }
2696
- function st() {
2825
+ function vt() {
2697
2826
  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
2827
  /* @__PURE__ */ n("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
2699
2828
  /* @__PURE__ */ n("path", { d: "M16 2v4M8 2v4M3 10h18" })
2700
2829
  ] });
2701
2830
  }
2702
- function rt() {
2831
+ function xt() {
2703
2832
  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
2833
  /* @__PURE__ */ n("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2" }),
2705
2834
  /* @__PURE__ */ n("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
2706
2835
  ] });
2707
2836
  }
2708
- function at() {
2837
+ function gt() {
2709
2838
  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
2839
  /* @__PURE__ */ n("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
2711
2840
  /* @__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
2841
  ] });
2713
2842
  }
2714
- function it() {
2843
+ function ft() {
2715
2844
  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
2845
  /* @__PURE__ */ n("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
2717
2846
  /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "3" })
2718
2847
  ] });
2719
2848
  }
2720
- function ot() {
2849
+ function Nt() {
2721
2850
  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
2851
  /* @__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
2852
  /* @__PURE__ */ n("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
2724
2853
  ] });
2725
2854
  }
2726
- function lt({ notifications: e, unreadCount: t = 0, onMarkRead: s, onMarkAllRead: r, isLoading: a, className: i }) {
2855
+ function bt({ notifications: e, unreadCount: t = 0, onMarkRead: r, onMarkAllRead: s, isLoading: a, className: i }) {
2727
2856
  const o = Ce();
2728
2857
  return a ? /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading notifications..." }) : /* @__PURE__ */ l("div", { className: `pvx-card ${i || ""}`, children: [
2729
2858
  /* @__PURE__ */ l("div", { className: "pvx-card-header", children: [
2730
2859
  /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
2731
- /* @__PURE__ */ n(pt, {}),
2860
+ /* @__PURE__ */ n(wt, {}),
2732
2861
  "Notifications",
2733
2862
  t > 0 && /* @__PURE__ */ n("span", { className: "pvx-notif-badge", children: t > 99 ? "99+" : t })
2734
2863
  ] }),
2735
- t > 0 && r && /* @__PURE__ */ n("button", { className: "pvx-notif-mark-all", onClick: r, children: "Mark all read" })
2864
+ t > 0 && s && /* @__PURE__ */ n("button", { className: "pvx-notif-mark-all", onClick: s, children: "Mark all read" })
2736
2865
  ] }),
2737
2866
  e != null && e.length ? /* @__PURE__ */ n("div", { className: "pvx-notif-list", children: e.map((d) => /* @__PURE__ */ n(
2738
- ct,
2867
+ yt,
2739
2868
  {
2740
2869
  notification: d,
2741
2870
  getUserDisplay: o,
2742
- onMarkRead: s
2871
+ onMarkRead: r
2743
2872
  },
2744
2873
  d.id
2745
2874
  )) }) : /* @__PURE__ */ n("div", { className: "pvx-notif-empty", children: "No notifications" })
2746
2875
  ] });
2747
2876
  }
2748
- function ct({ notification: e, getUserDisplay: t, onMarkRead: s }) {
2749
- const r = () => {
2750
- !e.isRead && s && s(e.id);
2877
+ function yt({ notification: e, getUserDisplay: t, onMarkRead: r }) {
2878
+ const s = () => {
2879
+ !e.isRead && r && r(e.id);
2751
2880
  };
2752
2881
  return /* @__PURE__ */ l(
2753
2882
  "button",
2754
2883
  {
2755
2884
  className: `pvx-notif-item ${e.isRead ? "" : "pvx-notif-item--unread"}`,
2756
- onClick: r,
2885
+ onClick: s,
2757
2886
  children: [
2758
- /* @__PURE__ */ n(dt, { type: e.type }),
2887
+ /* @__PURE__ */ n(kt, { type: e.type }),
2759
2888
  /* @__PURE__ */ l("div", { className: "pvx-notif-content", children: [
2760
- /* @__PURE__ */ n("span", { className: "pvx-notif-message", children: Je(e, t) }),
2889
+ /* @__PURE__ */ n("span", { className: "pvx-notif-message", children: Ze(e, t) }),
2761
2890
  /* @__PURE__ */ n("span", { className: "pvx-notif-time", children: oe(e.createdAt) })
2762
2891
  ] }),
2763
2892
  !e.isRead && /* @__PURE__ */ n("span", { className: "pvx-notif-dot" })
@@ -2765,7 +2894,7 @@ function ct({ notification: e, getUserDisplay: t, onMarkRead: s }) {
2765
2894
  }
2766
2895
  );
2767
2896
  }
2768
- function dt({ type: e }) {
2897
+ function kt({ type: e }) {
2769
2898
  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
2899
  /* @__PURE__ */ n("path", { d: "m3 11 18-5v12L3 13v-2z" }),
2771
2900
  /* @__PURE__ */ n("path", { d: "M11.6 16.8a3 3 0 1 1-5.8-1.6" })
@@ -2778,61 +2907,61 @@ function dt({ type: e }) {
2778
2907
  /* @__PURE__ */ n("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
2779
2908
  ] }) });
2780
2909
  }
2781
- function pt() {
2910
+ function wt() {
2782
2911
  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
2912
  /* @__PURE__ */ n("path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" }),
2784
2913
  /* @__PURE__ */ n("path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0" })
2785
2914
  ] });
2786
2915
  }
2787
- function It({
2916
+ function Gt({
2788
2917
  steamId: e,
2789
2918
  avatarUrl: t,
2790
- memberSince: s,
2791
- hideProfile: r = !1,
2919
+ memberSince: r,
2920
+ hideProfile: s = !1,
2792
2921
  onComboSelect: a,
2793
2922
  onGameRatingSelect: i,
2794
2923
  className: o = ""
2795
2924
  }) {
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();
2925
+ const { data: d, isLoading: p, error: c } = Jn(e), { data: u } = et(e), { data: v } = Xn(e), { data: f, isLoading: h } = nt(), k = tt(), { data: m, isLoading: g } = rt({ limit: 10 }), b = st(), x = at();
2797
2926
  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,
2927
+ !s && /* @__PURE__ */ n(
2928
+ it,
2800
2929
  {
2801
2930
  driverName: d.driverName,
2802
2931
  avatarUrl: t,
2803
- memberSince: s
2932
+ memberSince: r
2804
2933
  }
2805
2934
  ),
2806
2935
  /* @__PURE__ */ n(
2807
- Jn,
2936
+ ct,
2808
2937
  {
2809
2938
  stats: d,
2810
2939
  gameRatings: u,
2811
2940
  onGameRatingSelect: i
2812
2941
  }
2813
2942
  ),
2814
- e && /* @__PURE__ */ n(et, { events: f, isLoading: h }),
2943
+ e && /* @__PURE__ */ n(ut, { events: f, isLoading: h }),
2815
2944
  /* @__PURE__ */ l("div", { className: `pvx-dash-row ${k ? "pvx-dash-row--2col" : ""}`, children: [
2816
- /* @__PURE__ */ n(Zn, { combos: v, onComboSelect: a }),
2945
+ /* @__PURE__ */ n(dt, { combos: v, onComboSelect: a }),
2817
2946
  k && /* @__PURE__ */ n(
2818
- lt,
2947
+ bt,
2819
2948
  {
2820
- notifications: x == null ? void 0 : x.notifications,
2821
- unreadCount: (x == null ? void 0 : x.unreadCount) || 0,
2822
- onMarkRead: (w) => y.mutate(w),
2823
- onMarkAllRead: () => m.mutate(),
2949
+ notifications: m == null ? void 0 : m.notifications,
2950
+ unreadCount: (m == null ? void 0 : m.unreadCount) || 0,
2951
+ onMarkRead: (w) => b.mutate(w),
2952
+ onMarkAllRead: () => x.mutate(),
2824
2953
  isLoading: g
2825
2954
  }
2826
2955
  )
2827
2956
  ] })
2828
2957
  ] }) : /* @__PURE__ */ n("div", { className: "pvx-empty", children: "No data available yet. Start driving to see your stats!" });
2829
2958
  }
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;
2959
+ function zt({ records: e, className: t = "" }) {
2960
+ const r = T(() => e != null && e.length ? e.slice().sort((s, a) => {
2961
+ const i = s.recordedAt ? new Date(s.recordedAt).getTime() : 0;
2833
2962
  return (a.recordedAt ? new Date(a.recordedAt).getTime() : 0) - i;
2834
2963
  }) : [], [e]);
2835
- return s.length ? /* @__PURE__ */ l("div", { className: `pvx-card ${t}`, children: [
2964
+ return r.length ? /* @__PURE__ */ l("div", { className: `pvx-card ${t}`, children: [
2836
2965
  /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
2837
2966
  /* @__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
2967
  /* @__PURE__ */ n("path", { d: "M6 9H4.5a2.5 2.5 0 010-5H6" }),
@@ -2845,110 +2974,111 @@ function Ut({ records: e, className: t = "" }) {
2845
2974
  "Current Records",
2846
2975
  /* @__PURE__ */ l("span", { className: "pvx-dash-records-count", children: [
2847
2976
  "(",
2848
- s.length,
2977
+ r.length,
2849
2978
  ")"
2850
2979
  ] })
2851
2980
  ] }) }),
2852
- /* @__PURE__ */ n("div", { className: "pvx-dash-records-list", children: s.map((r, a) => /* @__PURE__ */ l("div", { className: "pvx-dash-record-row", children: [
2981
+ /* @__PURE__ */ n("div", { className: "pvx-dash-records-list", children: r.map((s, a) => /* @__PURE__ */ l("div", { className: "pvx-dash-record-row", children: [
2853
2982
  /* @__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) })
2983
+ /* @__PURE__ */ n("span", { className: "pvx-dash-record-track", children: V(s.trackId, s.layout, s.game) }),
2984
+ /* @__PURE__ */ n("span", { className: "pvx-dash-record-car", children: _(s.carId) })
2856
2985
  ] }),
2857
2986
  /* @__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}` : ""
2987
+ /* @__PURE__ */ n("span", { className: "pvx-dash-record-lap", children: q(s.lapTimeMs) }),
2988
+ /* @__PURE__ */ l("span", { className: `pvx-dash-game-badge pvx-dash-game-badge--${s.game || "evo"}`, children: [
2989
+ (s.game || "evo").toUpperCase(),
2990
+ s.gameVersion ? ` ${s.gameVersion}` : ""
2862
2991
  ] })
2863
2992
  ] })
2864
2993
  ] }, a)) })
2865
2994
  ] }) : null;
2866
2995
  }
2867
2996
  export {
2868
- kt as CarsTable,
2997
+ Bt as CarsTable,
2869
2998
  U as CompEmptyState,
2870
- V as CompLoadingState,
2871
- Cn as CompetitionCard,
2872
- $t as CompetitionCards,
2873
- Pt as CompetitionResultsTabs,
2999
+ W as CompLoadingState,
3000
+ En as CompetitionCard,
3001
+ Ft as CompetitionCards,
3002
+ Wt as CompetitionResultsTabs,
2874
3003
  wn as CompletedBadge,
2875
3004
  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,
3005
+ Gt as DriverDashboard,
3006
+ it as DriverProfile,
3007
+ It as DriversTable,
3008
+ Ht as EntryList,
3009
+ re as InfoPill,
3010
+ Et as LapHistoryTable,
3011
+ bt as NotificationsCard,
2883
3012
  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,
3013
+ Rt as PitVoxPartnerProvider,
3014
+ Vn as RacePositionsChart,
3015
+ _t as RankingsTable,
3016
+ dt as RecentCombosCard,
3017
+ zt as RecordsTable,
3018
+ jt as RegisterButton,
3019
+ Vt as RegistrationPanel,
3020
+ qt as RoundResults,
2892
3021
  ve as RoundSessionResults,
2893
- $n as StandingsTable,
2894
- Jn as StatsCards,
2895
- yt as TracksTable,
3022
+ Fn as StandingsTable,
3023
+ ct as StatsCards,
3024
+ Pt as TracksTable,
2896
3025
  gn as TypeBadge,
2897
- et as UpcomingEvents,
3026
+ ut as UpcomingEvents,
3027
+ In as WeatherIcon,
2898
3028
  ye as buildDriverIndexPath,
2899
- Ge as buildLapsPath,
3029
+ Qe as buildLapsPath,
2900
3030
  ie as buildLeaderboardPath,
2901
3031
  Ye as buildRecentLapsPath,
2902
3032
  D as fetchCdnJson,
2903
- St as filterCompetitionsByStatus,
2904
- I as formatCarName,
2905
- W as formatDate,
2906
- xt as formatDelta,
3033
+ Ut as filterCompetitionsByStatus,
3034
+ _ as formatCarName,
3035
+ G as formatDate,
3036
+ Tt as formatDelta,
2907
3037
  we as formatFuel,
2908
3038
  q as formatLapTime,
2909
- Je as formatNotificationMessage,
3039
+ Ze as formatNotificationMessage,
2910
3040
  oe as formatRelativeTime,
2911
- E as formatSectorTime,
2912
- Z as formatSessionLabel,
2913
- j as formatTrackName,
3041
+ F as formatSectorTime,
3042
+ ee as formatSessionLabel,
3043
+ V as formatTrackName,
2914
3044
  ke as formatTyreCompound,
2915
3045
  kn as getCompetitionPodium,
2916
3046
  Ie as getCompetitionStatus,
2917
3047
  yn as getCompletionDate,
2918
3048
  bn as isCompetitionComplete,
2919
- ee as isRoundClosed,
2920
- Nt as useCarLeaderboard,
2921
- gt as useCarMetadata,
3049
+ j as isRoundClosed,
3050
+ Dt as useCarLeaderboard,
3051
+ $t as useCarMetadata,
2922
3052
  tn as useCompetitionAllRounds,
2923
- Le as useCompetitionConfig,
2924
- $e as useCompetitionEntryList,
2925
- sn as useCompetitionLeaderboard,
3053
+ Se as useCompetitionConfig,
3054
+ Re as useCompetitionEntryList,
3055
+ rn as useCompetitionLeaderboard,
2926
3056
  nn as useCompetitionRound,
2927
3057
  an as useCompetitionRoundLaps,
2928
- rn as useCompetitionRoundLeaderboard,
3058
+ sn as useCompetitionRoundLeaderboard,
2929
3059
  on as useCompetitionRoundPositions,
2930
- Se as useCompetitionStandings,
2931
- bt as useCompetitions,
2932
- jn as useDriverCombos,
3060
+ Le as useCompetitionStandings,
3061
+ At as useCompetitions,
3062
+ Xn as useDriverCombos,
2933
3063
  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,
3064
+ Kt as useDriverRating,
3065
+ se as useDriverRatings,
3066
+ et as useDriverRatingsByGame,
3067
+ Jn as useDriverStats,
3068
+ Je as useLeaderboardIndex,
3069
+ at as useMarkAllNotificationsRead,
3070
+ st as useMarkNotificationRead,
3071
+ rt as useNotifications,
3072
+ tt as useNotificationsEnabled,
3073
+ L as usePitVox,
3074
+ Mt as useRecentLaps,
3075
+ Te as useRegister,
2946
3076
  ce as useRegistrationMode,
2947
3077
  le as useRegistrationStatus,
2948
3078
  de as useRegistrationUrl,
2949
3079
  Xe as useTrackLeaderboard,
2950
- Bt as useUnreadCount,
2951
- Kn as useUpcomingEvents,
3080
+ Ot as useUnreadCount,
3081
+ nt as useUpcomingEvents,
2952
3082
  Ce as useUserLookup,
2953
- Te as useWithdraw
3083
+ $e as useWithdraw
2954
3084
  };