@pitvox/partner-react 0.7.12 → 0.7.14

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.
Files changed (3) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +1183 -1178
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,13 +1,13 @@
1
- import { jsx as t, jsxs as l, Fragment as U } from "react/jsx-runtime";
2
- import { createContext as De, useMemo as L, useContext as Ie, useState as D, useCallback as H, useRef as Pe, useEffect as Be } from "react";
3
- import { useQueryClient as _, QueryClient as Ae, QueryClientProvider as Ue, useQuery as T, useMutation as O, useQueries as ce } from "@tanstack/react-query";
4
- const Z = De(null), Fe = "https://cdn.pitvox.com", Ee = "https://pitvox.com";
1
+ import { jsx as n, jsxs as l, Fragment as F } from "react/jsx-runtime";
2
+ import { createContext as Pe, useMemo as S, useContext as Be, useState as D, useCallback as H, useRef as Ae, useEffect as Ue } from "react";
3
+ import { useQueryClient as q, QueryClient as Fe, QueryClientProvider as Ee, useQuery as T, useMutation as W, useQueries as ce } from "@tanstack/react-query";
4
+ const Z = Pe(null), qe = "https://cdn.pitvox.com", je = "https://pitvox.com";
5
5
  let Y = null;
6
- function en({
6
+ function tt({
7
7
  partnerSlug: e = null,
8
- cdnUrl: n = Fe,
9
- pitvoxUrl: s = Ee,
10
- getSteamId: r,
8
+ cdnUrl: r = qe,
9
+ pitvoxUrl: t = je,
10
+ getSteamId: s,
11
11
  onRegister: a,
12
12
  onWithdraw: i,
13
13
  onFetchNotifications: o,
@@ -16,79 +16,79 @@ function en({
16
16
  onFetchServerPassword: c,
17
17
  children: u
18
18
  }) {
19
- const g = L(() => ({
19
+ const g = S(() => ({
20
20
  partnerSlug: e,
21
- cdnUrl: n.replace(/\/$/, ""),
22
- pitvoxUrl: s.replace(/\/$/, ""),
23
- getSteamId: r || (() => null),
21
+ cdnUrl: r.replace(/\/$/, ""),
22
+ pitvoxUrl: t.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, n, s, r, a, i, o, d, p, c]);
30
+ }), [e, r, t, s, a, i, o, d, p, c]);
31
31
  let f = !1;
32
32
  try {
33
- _(), f = !0;
33
+ q(), f = !0;
34
34
  } catch {
35
35
  f = !1;
36
36
  }
37
- return f ? /* @__PURE__ */ t(Z.Provider, { value: g, children: u }) : (Y || (Y = new Ae({
37
+ return f ? /* @__PURE__ */ n(Z.Provider, { value: g, children: u }) : (Y || (Y = new Fe({
38
38
  defaultOptions: {
39
39
  queries: { staleTime: 6e4 }
40
40
  }
41
- })), /* @__PURE__ */ t(Ue, { client: Y, children: /* @__PURE__ */ t(Z.Provider, { value: g, children: u }) }));
41
+ })), /* @__PURE__ */ n(Ee, { client: Y, children: /* @__PURE__ */ n(Z.Provider, { value: g, children: u }) }));
42
42
  }
43
- function k() {
44
- const e = Ie(Z);
43
+ function C() {
44
+ const e = Be(Z);
45
45
  if (!e)
46
46
  throw new Error("usePitVox must be used within a <PitVoxPartnerProvider>");
47
47
  return e;
48
48
  }
49
- async function R(e, n) {
50
- const s = await fetch(`${e}/${n}`);
51
- if (!s.ok) {
52
- if (s.status === 404 || s.status === 403) return null;
53
- throw new Error(`CDN fetch failed: ${s.status}`);
49
+ async function R(e, r) {
50
+ const t = await fetch(`${e}/${r}`);
51
+ if (!t.ok) {
52
+ if (t.status === 404 || t.status === 403) return null;
53
+ throw new Error(`CDN fetch failed: ${t.status}`);
54
54
  }
55
- return s.json();
55
+ return t.json();
56
56
  }
57
- function X(e, n, s, ...r) {
57
+ function X(e, r, t, ...s) {
58
58
  const a = ["leaderboards"];
59
- return e && a.push(`partners/${e}`), n && a.push(n), s && a.push(`v/${s}`), [...a, ...r].join("/");
59
+ return e && a.push(`partners/${e}`), r && a.push(r), t && a.push(`v/${t}`), [...a, ...s].join("/");
60
60
  }
61
- function _e(e, n, s, r) {
62
- const a = r || "default";
63
- return e ? `laps/partners/${e}/${n}/${s}/${a}.json` : `laps/${n}/${s}/${a}.json`;
61
+ function _e(e, r, t, s) {
62
+ const a = s || "default";
63
+ return e ? `laps/partners/${e}/${r}/${t}/${a}.json` : `laps/${r}/${t}/${a}.json`;
64
64
  }
65
- function qe(e, n) {
66
- return e ? `laps/partners/${e}/${n}/index.json` : `laps/${n}/index.json`;
65
+ function Ve(e, r) {
66
+ return e ? `laps/partners/${e}/${r}/index.json` : `laps/${r}/index.json`;
67
67
  }
68
- function je(e) {
68
+ function Ke(e) {
69
69
  return e ? `recent-laps/partners/${e}.json` : "recent-laps.json";
70
70
  }
71
- function A(e) {
71
+ function U(e) {
72
72
  if (!e && e !== 0) return "-";
73
- const n = Math.floor(e / 1e3), s = Math.floor(n / 60), r = n % 60, a = e % 1e3;
74
- return `${s}:${String(r).padStart(2, "0")}.${String(a).padStart(3, "0")}`;
73
+ const r = Math.floor(e / 1e3), t = Math.floor(r / 60), s = r % 60, a = e % 1e3;
74
+ return `${t}:${String(s).padStart(2, "0")}.${String(a).padStart(3, "0")}`;
75
75
  }
76
76
  function B(e) {
77
- return !e && e !== 0 ? "-" : e >= 6e4 ? A(e) : (e / 1e3).toFixed(3);
77
+ return !e && e !== 0 ? "-" : e >= 6e4 ? U(e) : (e / 1e3).toFixed(3);
78
78
  }
79
79
  function I(e) {
80
80
  if (!e) return "";
81
- let n = e;
82
- return n.startsWith("ks_") && (n = n.slice(3)), n.split("_").map((s) => s.charAt(0).toUpperCase() + s.slice(1)).join(" ");
81
+ let r = e;
82
+ return r.startsWith("ks_") && (r = r.slice(3)), r.split("_").map((t) => t.charAt(0).toUpperCase() + t.slice(1)).join(" ");
83
83
  }
84
- function q(e, n, s) {
84
+ function j(e, r, t) {
85
85
  if (!e) return "";
86
- const r = e.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" "), a = s === "acc" || !s && (n == null ? void 0 : n.toLowerCase()) === "track config";
87
- if (!n || n === "default" || a) return r;
88
- const i = n.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" ");
89
- return `${r} ${i}`;
86
+ const s = e.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" "), a = t === "acc" || !t && (r == null ? void 0 : r.toLowerCase()) === "track config";
87
+ if (!r || r === "default" || a) return s;
88
+ const i = r.split("_").map((o) => o.charAt(0).toUpperCase() + o.slice(1)).join(" ");
89
+ return `${s} ${i}`;
90
90
  }
91
- function j(e) {
91
+ function _(e) {
92
92
  if (!e) return "-";
93
93
  try {
94
94
  return new Date(e).toLocaleDateString("en-GB", {
@@ -102,21 +102,21 @@ function j(e) {
102
102
  }
103
103
  function ue(e) {
104
104
  if (!e) return "";
105
- const n = Date.now() - new Date(e).getTime(), s = Math.floor(n / 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 r = Date.now() - new Date(e).getTime(), t = Math.floor(r / 1e3);
106
+ if (t < 60) return "Just now";
107
+ const s = Math.floor(t / 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` : j(e);
112
+ return i < 30 ? `${i}d ago` : _(e);
113
113
  }
114
- function tn(e) {
114
+ function rt(e) {
115
115
  return e == null ? "" : `${e >= 0 ? "+" : "-"}${(Math.abs(e) / 1e3).toFixed(3)}`;
116
116
  }
117
- function Ve(e, n) {
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 ? q(a, i, d) : null, g = o ? I(o) : null, f = [u, g].filter(Boolean).join(" — ");
119
- return s === "RECORD_BEATEN" && f ? `${c != null && c.beatenBySteamId && n ? n(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 He(e, r) {
118
+ const { type: t, title: s, 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, g = o ? I(o) : null, f = [u, g].filter(Boolean).join(" — ");
119
+ return t === "RECORD_BEATEN" && f ? `${c != null && c.beatenBySteamId && r ? r(c.beatenBySteamId).displayName : "Someone"} beat your record on ${f}` : t === "RECORD_SET" && f ? `You set a new record on ${f}` : s || "New notification";
120
120
  }
121
121
  function me(e) {
122
122
  return e ? {
@@ -132,40 +132,40 @@ function me(e) {
132
132
  S: "Soft"
133
133
  }[e] || e : "Unknown";
134
134
  }
135
- function he(e) {
135
+ function ve(e) {
136
136
  if (!e) return "-";
137
- const n = Number(e);
138
- return isNaN(n) ? "-" : n % 1 ? `${n.toFixed(1)}L` : `${n}L`;
137
+ const r = Number(e);
138
+ return isNaN(r) ? "-" : r % 1 ? `${r.toFixed(1)}L` : `${r}L`;
139
139
  }
140
- function nn(e = {}) {
140
+ function st(e = {}) {
141
141
  var p, c, u, g, f, m;
142
- const { cdnUrl: n, partnerSlug: s } = k(), { game: r, gameVersion: a } = e, i = X(s, null, null, "index.json"), o = T({
143
- queryKey: ["pitvox", "leaderboards", s, "index"],
144
- queryFn: () => R(n, i),
142
+ const { cdnUrl: r, partnerSlug: t } = C(), { game: s, gameVersion: a } = e, i = X(t, null, null, "index.json"), o = T({
143
+ queryKey: ["pitvox", "leaderboards", t, "index"],
144
+ queryFn: () => R(r, i),
145
145
  staleTime: 3e4,
146
146
  refetchInterval: 3e4
147
- }), d = L(() => {
147
+ }), d = S(() => {
148
148
  var x;
149
149
  if (!((x = o.data) != null && x.tracks)) return [];
150
- let b = o.data.tracks;
151
- return r && (b = b.filter((v) => v.game === r)), a && (b = b.filter((v) => v.gameVersion === a)), b.map((v) => ({
152
- id: v.trackId,
153
- layout: v.layout,
154
- game: v.game,
155
- gameVersion: v.gameVersion,
156
- displayName: q(v.trackId, v.layout, v.game),
157
- driverCount: v.driverCount || 0,
158
- carCount: v.carCount || 0,
159
- record: v.recordHolder ? {
160
- visibleId: v.recordHolder.steamId || v.recordHolder.userId,
161
- carId: v.recordHolder.carId,
162
- carDisplayName: I(v.recordHolder.carId),
163
- lapTimeMs: v.recordHolder.lapTimeMs,
164
- timestamp: v.recordHolder.recordedAt
150
+ let y = o.data.tracks;
151
+ return s && (y = y.filter((h) => h.game === s)), a && (y = y.filter((h) => h.gameVersion === a)), y.map((h) => ({
152
+ id: h.trackId,
153
+ layout: h.layout,
154
+ game: h.game,
155
+ gameVersion: h.gameVersion,
156
+ displayName: j(h.trackId, h.layout, h.game),
157
+ driverCount: h.driverCount || 0,
158
+ carCount: h.carCount || 0,
159
+ record: h.recordHolder ? {
160
+ visibleId: h.recordHolder.steamId || h.recordHolder.userId,
161
+ carId: h.recordHolder.carId,
162
+ carDisplayName: I(h.recordHolder.carId),
163
+ lapTimeMs: h.recordHolder.lapTimeMs,
164
+ timestamp: h.recordHolder.recordedAt
165
165
  } : null,
166
- recordByTag: v.recordByTag || null
166
+ recordByTag: h.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,186 +176,188 @@ function nn(e = {}) {
176
176
  versions: ((m = o.data) == null ? void 0 : m.versions) || {}
177
177
  };
178
178
  }
179
- function Ke(e, n, s = {}) {
180
- const { cdnUrl: r, partnerSlug: a } = k(), { carId: i, game: o, gameVersion: d } = s, p = n || "default", c = X(a, o, d, `tracks/${e}/${p}.json`), { data: u, isLoading: g, error: f } = T({
179
+ function We(e, r, t = {}) {
180
+ const { cdnUrl: s, partnerSlug: a } = C(), { carId: i, game: o, gameVersion: d } = t, p = r || "default", c = X(a, o, d, `tracks/${e}/${p}.json`), { data: u, isLoading: g, error: f } = T({
181
181
  queryKey: ["pitvox", "leaderboards", a, "track", e, p, o, d],
182
- queryFn: () => R(r, c),
182
+ queryFn: () => R(s, c),
183
183
  enabled: !!e,
184
184
  staleTime: 3e4,
185
185
  refetchInterval: 3e4
186
186
  });
187
- return { data: L(() => {
187
+ return { data: S(() => {
188
188
  if (!(u != null && u.entries)) return [];
189
- let b = u.entries;
190
- if (o && (b = b.filter((x) => x.game === o)), !i) {
191
- const x = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map();
192
- for (const N of b) {
193
- const h = N.steamId || N.userId;
194
- v.has(N.carId) || v.set(N.carId, /* @__PURE__ */ new Set()), v.get(N.carId).add(h), (!x.has(N.carId) || N.lapTimeMs < x.get(N.carId).lapTimeMs) && x.set(N.carId, N);
189
+ let y = u.entries;
190
+ if (o && (y = y.filter((x) => x.game === o)), !i) {
191
+ const x = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map();
192
+ for (const N of y) {
193
+ const v = N.steamId || N.userId;
194
+ h.has(N.carId) || h.set(N.carId, /* @__PURE__ */ new Set()), h.get(N.carId).add(v), (!x.has(N.carId) || N.lapTimeMs < x.get(N.carId).lapTimeMs) && x.set(N.carId, N);
195
195
  }
196
196
  return Array.from(x.values()).map((N) => {
197
- var h;
198
- return { ...N, driverCount: ((h = v.get(N.carId)) == null ? void 0 : h.size) || 0 };
199
- }).sort((N, h) => N.lapTimeMs - h.lapTimeMs);
197
+ var v;
198
+ return { ...N, driverCount: ((v = h.get(N.carId)) == null ? void 0 : v.size) || 0 };
199
+ }).sort((N, v) => N.lapTimeMs - v.lapTimeMs);
200
200
  }
201
- return b.filter((x) => x.carId === i).sort((x, v) => x.lapTimeMs - v.lapTimeMs);
201
+ return y.filter((x) => x.carId === i).sort((x, h) => x.lapTimeMs - h.lapTimeMs);
202
202
  }, [u == null ? void 0 : u.entries, i, o]), isLoading: g, error: f };
203
203
  }
204
- function He(e, n, s, r, a = {}) {
205
- var x, v;
206
- const { cdnUrl: i, partnerSlug: o } = k(), { showInvalid: d = !1, game: p, gameVersion: c } = a, u = e && n ? _e(o, e, n, s) : null, f = T({
207
- queryKey: ["pitvox", "laps", o, e, n, s || "default"],
204
+ function Oe(e, r, t, s, a = {}) {
205
+ var x, h;
206
+ const { cdnUrl: i, partnerSlug: o } = C(), { showInvalid: d = !1, game: p, gameVersion: c } = a, u = e && r ? _e(o, e, r, t) : null, f = T({
207
+ queryKey: ["pitvox", "laps", o, e, r, t || "default"],
208
208
  queryFn: () => R(i, u),
209
- enabled: !!e && !!n,
209
+ enabled: !!e && !!r,
210
210
  staleTime: 3e4,
211
211
  refetchInterval: 3e4
212
- }), m = L(() => {
212
+ }), m = S(() => {
213
213
  var N;
214
- return (N = f.data) != null && N.laps ? f.data.laps.filter((h) => !(h.carId !== r || p && h.game !== p || c && h.gameVersion !== c || !d && !h.isValid)).sort((h, w) => h.lapTimeMs - w.lapTimeMs) : [];
215
- }, [(x = f.data) == null ? void 0 : x.laps, r, p, c, d]), b = L(() => {
216
- const N = m.filter(($) => $.isValid && $.sector1Ms && $.sector2Ms && $.sector3Ms);
214
+ return (N = f.data) != null && N.laps ? f.data.laps.filter((v) => !(v.carId !== s || p && v.game !== p || c && v.gameVersion !== c || !d && !v.isValid)).sort((v, k) => v.lapTimeMs - k.lapTimeMs) : [];
215
+ }, [(x = f.data) == null ? void 0 : x.laps, s, p, c, d]), y = S(() => {
216
+ const N = m.filter((w) => w.isValid && w.sector1Ms && w.sector2Ms && w.sector3Ms);
217
217
  if (N.length < 2) return null;
218
- const h = Math.min(...N.map(($) => $.sector1Ms)), w = Math.min(...N.map(($) => $.sector2Ms)), y = Math.min(...N.map(($) => $.sector3Ms)), C = h + w + y, S = Math.min(...N.map(($) => $.lapTimeMs));
219
- return C >= S ? null : { lapTimeMs: C, sector1Ms: h, sector2Ms: w, sector3Ms: y };
218
+ const v = Math.min(...N.map((w) => w.sector1Ms)), k = Math.min(...N.map((w) => w.sector2Ms)), b = Math.min(...N.map((w) => w.sector3Ms)), L = v + k + b, M = Math.min(...N.map((w) => w.lapTimeMs));
219
+ return L >= M ? null : { lapTimeMs: L, sector1Ms: v, sector2Ms: k, sector3Ms: b };
220
220
  }, [m]);
221
221
  return {
222
222
  ...f,
223
223
  data: m,
224
- driverName: ((v = f.data) == null ? void 0 : v.driverName) || "Driver",
225
- theoreticalBest: b
224
+ driverName: ((h = f.data) == null ? void 0 : h.driverName) || "Driver",
225
+ theoreticalBest: y
226
226
  };
227
227
  }
228
- function ve() {
229
- const { cdnUrl: e } = k(), { data: n } = T({
228
+ function he() {
229
+ const { cdnUrl: e } = C(), { data: r } = T({
230
230
  queryKey: ["pitvox", "users", "index"],
231
231
  queryFn: () => R(e, "users/index.json"),
232
232
  staleTime: 5 * 6e4,
233
233
  gcTime: 30 * 6e4
234
- }), s = (n == null ? void 0 : n.users) || {};
235
- return (r, a) => {
236
- const i = s[r];
234
+ }), t = (r == null ? void 0 : r.users) || {};
235
+ return (s, a) => {
236
+ const i = t[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 rn() {
245
- const { cdnUrl: e } = k(), { data: n } = T({
246
- queryKey: ["pitvox", "cars", "evo"],
247
- queryFn: () => R(e, "cars/evo.json"),
244
+ function at(e = "evo") {
245
+ const { cdnUrl: r } = C(), { data: t } = T({
246
+ queryKey: ["pitvox", "cars", e],
247
+ queryFn: () => R(r, `cars/${e}.json`),
248
248
  staleTime: 5 * 6e4,
249
249
  gcTime: 30 * 6e4
250
250
  });
251
251
  return {
252
- tags: (n == null ? void 0 : n.tags) || [],
253
- cars: (n == null ? void 0 : n.cars) || {}
252
+ tags: (t == null ? void 0 : t.tags) || [],
253
+ cars: (t == null ? void 0 : t.cars) || {},
254
+ categories: (t == null ? void 0 : t.categories) || [],
255
+ tagLabels: (t == null ? void 0 : t.tagLabels) || {}
254
256
  };
255
257
  }
256
- function sn() {
258
+ function it() {
257
259
  var a, i;
258
- const { cdnUrl: e, partnerSlug: n } = k(), s = je(n), r = T({
259
- queryKey: ["pitvox", "recentLaps", n],
260
- queryFn: () => R(e, s),
260
+ const { cdnUrl: e, partnerSlug: r } = C(), t = Ke(r), s = T({
261
+ queryKey: ["pitvox", "recentLaps", r],
262
+ queryFn: () => R(e, t),
261
263
  staleTime: 3e4,
262
264
  refetchInterval: 3e4,
263
265
  gcTime: 10 * 6e4
264
266
  });
265
267
  return {
266
- groups: ((a = r.data) == null ? void 0 : a.groups) || [],
267
- generatedAt: ((i = r.data) == null ? void 0 : i.generatedAt) || null,
268
- 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
269
271
  };
270
272
  }
271
- function an(e, n) {
272
- return Ke(e, null, { carId: n });
273
+ function ot(e, r) {
274
+ return We(e, null, { carId: r });
273
275
  }
274
- function on() {
275
- const { cdnUrl: e, partnerSlug: n } = k();
276
+ function lt() {
277
+ const { cdnUrl: e, partnerSlug: r } = C();
276
278
  return T({
277
- queryKey: ["pitvox", "competitions", n],
279
+ queryKey: ["pitvox", "competitions", r],
278
280
  queryFn: async () => {
279
- const s = await R(e, "competitions/index.json");
280
- return s != null && s.competitions ? n ? s.competitions.filter((r) => r.partnerSlug === n) : s.competitions : [];
281
+ const t = await R(e, "competitions/index.json");
282
+ return t != null && t.competitions ? r ? t.competitions.filter((s) => s.partnerSlug === r) : t.competitions : [];
281
283
  },
282
284
  staleTime: 6e4
283
285
  });
284
286
  }
285
- function xe(e, n = {}) {
286
- const s = k(), r = n.partnerSlug || s.partnerSlug;
287
+ function xe(e, r = {}) {
288
+ const t = C(), s = r.partnerSlug || t.partnerSlug;
287
289
  return T({
288
- queryKey: ["pitvox", "competition", r, e, "config"],
289
- queryFn: () => R(s.cdnUrl, `competitions/${r}/${e}/config.json`),
290
- enabled: !!r && !!e,
290
+ queryKey: ["pitvox", "competition", s, e, "config"],
291
+ queryFn: () => R(t.cdnUrl, `competitions/${s}/${e}/config.json`),
292
+ enabled: !!s && !!e,
291
293
  staleTime: 6e4
292
294
  });
293
295
  }
294
- function ge(e, n = {}) {
295
- const s = k(), r = n.partnerSlug || s.partnerSlug;
296
+ function ge(e, r = {}) {
297
+ const t = C(), s = r.partnerSlug || t.partnerSlug;
296
298
  return T({
297
- queryKey: ["pitvox", "competition", r, e, "standings"],
298
- queryFn: () => R(s.cdnUrl, `competitions/${r}/${e}/standings.json`),
299
- enabled: !!r && !!e,
299
+ queryKey: ["pitvox", "competition", s, e, "standings"],
300
+ queryFn: () => R(t.cdnUrl, `competitions/${s}/${e}/standings.json`),
301
+ enabled: !!s && !!e,
300
302
  staleTime: 6e4
301
303
  });
302
304
  }
303
- function Oe(e, n, s = {}) {
304
- const r = k(), a = s.partnerSlug || r.partnerSlug;
305
+ function ze(e, r, t = {}) {
306
+ const s = C(), a = t.partnerSlug || s.partnerSlug;
305
307
  return T({
306
- queryKey: ["pitvox", "competition", a, e, "round", n],
307
- queryFn: () => R(r.cdnUrl, `competitions/${a}/${e}/rounds/${n}.json`),
308
- enabled: !!a && !!e && n != null,
308
+ queryKey: ["pitvox", "competition", a, e, "round", r],
309
+ queryFn: () => R(s.cdnUrl, `competitions/${a}/${e}/rounds/${r}.json`),
310
+ enabled: !!a && !!e && r != null,
309
311
  staleTime: 6e4
310
312
  });
311
313
  }
312
- function We(e, n = [], s = {}) {
313
- const r = k(), a = s.partnerSlug || r.partnerSlug;
314
+ function Qe(e, r = [], t = {}) {
315
+ const s = C(), a = t.partnerSlug || s.partnerSlug;
314
316
  return T({
315
- queryKey: ["pitvox", "competition", a, e, "allRounds", n],
317
+ queryKey: ["pitvox", "competition", a, e, "allRounds", r],
316
318
  queryFn: async () => (await Promise.all(
317
- n.map(
318
- (o) => R(r.cdnUrl, `competitions/${a}/${e}/rounds/${o}.json`).catch(() => null)
319
+ r.map(
320
+ (o) => R(s.cdnUrl, `competitions/${a}/${e}/rounds/${o}.json`).catch(() => null)
319
321
  )
320
322
  )).filter(Boolean),
321
- enabled: !!a && !!e && n.length > 0,
323
+ enabled: !!a && !!e && r.length > 0,
322
324
  staleTime: 6e4
323
325
  });
324
326
  }
325
- function ze(e, n = {}) {
326
- const s = k(), r = n.partnerSlug || s.partnerSlug;
327
+ function Ge(e, r = {}) {
328
+ const t = C(), s = r.partnerSlug || t.partnerSlug;
327
329
  return T({
328
- queryKey: ["pitvox", "competition", r, e, "leaderboard"],
329
- queryFn: () => R(s.cdnUrl, `competitions/${r}/${e}/leaderboard.json`).catch(() => null),
330
- enabled: !!r && !!e,
330
+ queryKey: ["pitvox", "competition", s, e, "leaderboard"],
331
+ queryFn: () => R(t.cdnUrl, `competitions/${s}/${e}/leaderboard.json`).catch(() => null),
332
+ enabled: !!s && !!e,
331
333
  staleTime: 6e4
332
334
  });
333
335
  }
334
- function Ge(e, n, s = {}) {
335
- const r = k(), a = s.partnerSlug || r.partnerSlug;
336
+ function Ye(e, r, t = {}) {
337
+ const s = C(), a = t.partnerSlug || s.partnerSlug;
336
338
  return T({
337
- queryKey: ["pitvox", "competition", a, e, "round", n, "laps"],
338
- queryFn: () => R(r.cdnUrl, `competitions/${a}/${e}/rounds/${n}/laps.json`).catch(() => null),
339
- enabled: !!a && !!e && n != null,
339
+ queryKey: ["pitvox", "competition", a, e, "round", r, "laps"],
340
+ queryFn: () => R(s.cdnUrl, `competitions/${a}/${e}/rounds/${r}/laps.json`).catch(() => null),
341
+ enabled: !!a && !!e && r != null,
340
342
  staleTime: 6e4
341
343
  });
342
344
  }
343
- function fe(e, n = {}) {
344
- const s = k(), r = n.partnerSlug || s.partnerSlug;
345
+ function fe(e, r = {}) {
346
+ const t = C(), s = r.partnerSlug || t.partnerSlug;
345
347
  return T({
346
- queryKey: ["pitvox", "competition", r, e, "entrylist"],
347
- queryFn: () => R(s.cdnUrl, `competitions/${r}/${e}/entrylist.json`),
348
- enabled: !!r && !!e,
348
+ queryKey: ["pitvox", "competition", s, e, "entrylist"],
349
+ queryFn: () => R(t.cdnUrl, `competitions/${s}/${e}/entrylist.json`),
350
+ enabled: !!s && !!e,
349
351
  staleTime: 6e4
350
352
  });
351
353
  }
352
354
  function ee(e) {
353
- const { cdnUrl: n, partnerSlug: s, getSteamId: r } = k(), a = r();
355
+ const { cdnUrl: r, partnerSlug: t, getSteamId: s } = C(), a = s();
354
356
  return T({
355
- queryKey: ["pitvox", "registration", s, e, a],
357
+ queryKey: ["pitvox", "registration", t, e, a],
356
358
  queryFn: async () => {
357
359
  var p;
358
- const i = await fetch(`${n}/competitions/${s}/${e}/entrylist.json`);
360
+ const i = await fetch(`${r}/competitions/${t}/${e}/entrylist.json`);
359
361
  if (!i.ok) return { isRegistered: !1, entryList: null };
360
362
  const o = await i.json();
361
363
  return { isRegistered: !!a && ((p = o.drivers) == null ? void 0 : p.some((c) => c.steamId === a)), entryList: o };
@@ -365,19 +367,19 @@ function ee(e) {
365
367
  });
366
368
  }
367
369
  function Ne(e) {
368
- const { onRegister: n, partnerSlug: s, getSteamId: r } = k(), a = _(), i = ve();
369
- return O({
370
+ const { onRegister: r, partnerSlug: t, getSteamId: s } = C(), a = q(), i = he();
371
+ return W({
370
372
  mutationFn: (o) => {
371
- if (!n)
373
+ if (!r)
372
374
  throw new Error(
373
375
  "No onRegister callback provided to PitVoxPartnerProvider. Provide onRegister for in-app registration, or use useRegistrationUrl() to link to pitvox.com."
374
376
  );
375
- return n(e, o);
377
+ return r(e, o);
376
378
  },
377
379
  onSuccess: () => {
378
- const o = r();
380
+ const o = s();
379
381
  if (a.setQueriesData(
380
- { queryKey: ["pitvox", "registration", s, e] },
382
+ { queryKey: ["pitvox", "registration", t, e] },
381
383
  (d) => d ? { ...d, isRegistered: !0 } : { isRegistered: !0, entryList: null }
382
384
  ), o) {
383
385
  const d = i(o), p = {
@@ -386,7 +388,7 @@ function Ne(e) {
386
388
  avatarUrl: d.avatarUrl
387
389
  };
388
390
  a.setQueriesData(
389
- { queryKey: ["pitvox", "competition", s, e, "entrylist"] },
391
+ { queryKey: ["pitvox", "competition", t, e, "entrylist"] },
390
392
  (c) => {
391
393
  var g;
392
394
  return c ? ((g = c.drivers) == null ? void 0 : g.some((f) => f.steamId === o)) ? c : { ...c, drivers: [...c.drivers || [], p] } : { drivers: [p] };
@@ -397,221 +399,196 @@ function Ne(e) {
397
399
  });
398
400
  }
399
401
  function be(e) {
400
- const { onWithdraw: n, partnerSlug: s, getSteamId: r } = k(), a = _();
401
- return O({
402
+ const { onWithdraw: r, partnerSlug: t, getSteamId: s } = C(), a = q();
403
+ return W({
402
404
  mutationFn: (i) => {
403
- if (!n)
405
+ if (!r)
404
406
  throw new Error(
405
407
  "No onWithdraw callback provided to PitVoxPartnerProvider. Provide onWithdraw for in-app withdrawal, or use useRegistrationUrl() to link to pitvox.com."
406
408
  );
407
- const o = i || r();
409
+ const o = i || s();
408
410
  if (!o) throw new Error("No Steam ID available");
409
- return n(e, o);
411
+ return r(e, o);
410
412
  },
411
413
  onSuccess: () => {
412
- const i = r();
414
+ const i = s();
413
415
  a.setQueriesData(
414
- { queryKey: ["pitvox", "registration", s, e] },
416
+ { queryKey: ["pitvox", "registration", t, e] },
415
417
  (o) => o ? { ...o, isRegistered: !1 } : { isRegistered: !1, entryList: null }
416
418
  ), i && a.setQueriesData(
417
- { queryKey: ["pitvox", "competition", s, e, "entrylist"] },
419
+ { queryKey: ["pitvox", "competition", t, e, "entrylist"] },
418
420
  (o) => o != null && o.drivers ? { ...o, drivers: o.drivers.filter((d) => d.steamId !== i) } : o
419
421
  );
420
422
  }
421
423
  });
422
424
  }
423
- function te() {
424
- const { onRegister: e, onWithdraw: n } = k(), s = !!(e && n);
425
- return { isPowerMode: s, isBasicMode: !s };
426
- }
427
- function ne(e) {
428
- const { pitvoxUrl: n, partnerSlug: s } = k();
429
- return `${n}/p/${s}/competitions/${e}/register`;
430
- }
431
- const Qe = {
432
- formula: "Formula",
433
- gt3: "GT3",
434
- gt2: "GT2",
435
- gt4: "GT4",
436
- cup: "Cup",
437
- prototype: "Prototype",
438
- rally: "Rally",
439
- hypercar: "Hypercar",
440
- supercar: "Supercar",
441
- sports_car: "Sports Car",
442
- hot_hatch: "Hot Hatch",
443
- lightweight: "Lightweight",
444
- "1960s": "1960s",
445
- "1970s": "1970s",
446
- "1980s": "1980s",
447
- "1990s": "1990s",
448
- "2000s": "2000s",
449
- "2010s": "2010s",
450
- "2020s": "2020s"
451
- }, ye = [
452
- { id: "class", tags: ["formula", "gt3", "gt2", "gt4", "cup", "prototype", "rally"] },
453
- { id: "tier", tags: ["hypercar", "supercar", "sports_car", "hot_hatch", "lightweight"] },
454
- { id: "era", tags: ["1960s", "1970s", "1980s", "1990s", "2000s", "2010s", "2020s"] }
455
- ];
456
- function Ye(e) {
457
- for (const n of ye)
458
- if (n.tags.includes(e)) return n.id;
425
+ function ne() {
426
+ const { onRegister: e, onWithdraw: r } = C(), t = !!(e && r);
427
+ return { isPowerMode: t, isBasicMode: !t };
428
+ }
429
+ function te(e) {
430
+ const { pitvoxUrl: r, partnerSlug: t } = C();
431
+ return `${r}/p/${t}/competitions/${e}/register`;
432
+ }
433
+ function Je(e, r) {
434
+ for (const t of r)
435
+ if (t.tags.includes(e)) return t.id;
459
436
  return "other";
460
437
  }
461
- function we(e, n) {
462
- if (n.size === 0) return !0;
438
+ function ye(e, r, t = []) {
439
+ if (r.size === 0) return !0;
463
440
  const s = {};
464
- for (const r of n) {
465
- const a = Ye(r);
466
- s[a] || (s[a] = []), s[a].push(r);
441
+ for (const a of r) {
442
+ const i = Je(a, t);
443
+ s[i] || (s[i] = []), s[i].push(a);
467
444
  }
468
- for (const r of Object.values(s))
469
- if (!r.some((a) => e.includes(a))) return !1;
445
+ for (const a of Object.values(s))
446
+ if (!a.some((i) => e.includes(i))) return !1;
470
447
  return !0;
471
448
  }
472
- function ke(e, n) {
473
- const [s, r] = D(/* @__PURE__ */ new Set()), a = e !== void 0, i = a ? e : s, o = H((p) => {
449
+ function ke(e, r) {
450
+ const [t, s] = D(/* @__PURE__ */ new Set()), a = e !== void 0, i = a ? e : t, o = H((p) => {
474
451
  const c = new Set(i);
475
- c.has(p) ? c.delete(p) : c.add(p), a && n ? n(c) : r(c);
476
- }, [i, a, n]), d = H(() => {
477
- a && n ? n(/* @__PURE__ */ new Set()) : r(/* @__PURE__ */ new Set());
478
- }, [a, n]);
452
+ c.has(p) ? c.delete(p) : c.add(p), a && r ? r(c) : s(c);
453
+ }, [i, a, r]), d = H(() => {
454
+ a && r ? r(/* @__PURE__ */ new Set()) : s(/* @__PURE__ */ new Set());
455
+ }, [a, r]);
479
456
  return { activeTags: i, toggle: o, clear: d };
480
457
  }
481
- function W(e) {
482
- const [n, s] = D(e), r = H((a) => {
483
- s(
458
+ function O(e) {
459
+ const [r, t] = D(e), s = H((a) => {
460
+ t(
484
461
  (i) => i.key === a ? { key: a, dir: i.dir === "asc" ? "desc" : "asc" } : { key: a, dir: a.includes("timestamp") || a.includes("Date") ? "desc" : "asc" }
485
462
  );
486
463
  }, []);
487
- return [n, r];
464
+ return [r, s];
488
465
  }
489
- function z(e, n, s) {
490
- return [...e].sort((r, a) => {
491
- const i = s(r, n.key), o = s(a, n.key);
466
+ function z(e, r, t) {
467
+ return [...e].sort((s, a) => {
468
+ const i = t(s, r.key), o = t(a, r.key);
492
469
  if (i == null && o == null) return 0;
493
470
  if (i == null) return 1;
494
471
  if (o == null) return -1;
495
472
  const d = typeof i == "string" ? i.localeCompare(o) : i - o;
496
- return n.dir === "desc" ? -d : d;
473
+ return r.dir === "desc" ? -d : d;
497
474
  });
498
475
  }
499
- function Ce(e, n = !1) {
500
- const s = n ? e == null ? void 0 : e.filter((r) => r.isValid) : e;
501
- return s != null && s.length ? {
502
- s1: Math.min(...s.map((r) => r.sector1Ms).filter(Boolean)),
503
- s2: Math.min(...s.map((r) => r.sector2Ms).filter(Boolean)),
504
- s3: Math.min(...s.map((r) => r.sector3Ms).filter(Boolean))
476
+ function we(e, r = !1) {
477
+ const t = r ? e == null ? void 0 : e.filter((s) => s.isValid) : e;
478
+ return t != null && t.length ? {
479
+ s1: Math.min(...t.map((s) => s.sector1Ms).filter(Boolean)),
480
+ s2: Math.min(...t.map((s) => s.sector2Ms).filter(Boolean)),
481
+ s3: Math.min(...t.map((s) => s.sector3Ms).filter(Boolean))
505
482
  } : null;
506
483
  }
507
- function Je({ active: e, dir: n }) {
508
- return e ? n === "asc" ? /* @__PURE__ */ t("svg", { className: "pvx-sort-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 15.75l7.5-7.5 7.5 7.5" }) }) : /* @__PURE__ */ t("svg", { className: "pvx-sort-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 8.25l-7.5 7.5-7.5-7.5" }) }) : /* @__PURE__ */ t("svg", { className: "pvx-sort-icon pvx-sort-icon--inactive", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 9l4-4 4 4M16 15l-4 4-4-4" }) });
484
+ function Ze({ active: e, dir: r }) {
485
+ return e ? r === "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" }) });
509
486
  }
510
- function M({ label: e, sortKey: n, config: s, onSort: r, className: a = "" }) {
511
- return /* @__PURE__ */ t(
487
+ function $({ label: e, sortKey: r, config: t, onSort: s, className: a = "" }) {
488
+ return /* @__PURE__ */ n(
512
489
  "th",
513
490
  {
514
491
  className: `pvx-th pvx-th--sortable ${a}`,
515
- onClick: () => r(n),
492
+ onClick: () => s(r),
516
493
  children: /* @__PURE__ */ l("span", { className: "pvx-th-inner", children: [
517
494
  e,
518
- /* @__PURE__ */ t(Je, { active: s.key === n, dir: s.dir })
495
+ /* @__PURE__ */ n(Ze, { active: t.key === r, dir: t.dir })
519
496
  ] })
520
497
  }
521
498
  );
522
499
  }
523
- function G({ userId: e, getUserDisplay: n }) {
524
- const { displayName: s, avatarUrl: r } = n(e);
500
+ function Q({ userId: e, getUserDisplay: r }) {
501
+ const { displayName: t, avatarUrl: s } = r(e);
525
502
  return /* @__PURE__ */ l("span", { className: "pvx-driver", children: [
526
- r ? /* @__PURE__ */ t("img", { src: r, alt: "", className: "pvx-driver-avatar" }) : /* @__PURE__ */ t("span", { className: "pvx-driver-avatar pvx-driver-avatar--placeholder" }),
527
- /* @__PURE__ */ t("span", { className: "pvx-driver-name", children: s })
503
+ s ? /* @__PURE__ */ n("img", { src: s, alt: "", className: "pvx-driver-avatar" }) : /* @__PURE__ */ n("span", { className: "pvx-driver-avatar pvx-driver-avatar--placeholder" }),
504
+ /* @__PURE__ */ n("span", { className: "pvx-driver-name", children: t })
528
505
  ] });
529
506
  }
530
- function re({ rank: e, podium: n = !1 }) {
531
- return /* @__PURE__ */ t("span", { className: n ? 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 });
507
+ function re({ rank: e, podium: r = !1 }) {
508
+ return /* @__PURE__ */ n("span", { className: r ? 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 });
532
509
  }
533
- function Le({ availableTags: e, activeTags: n, onToggle: s, onClear: r }) {
510
+ function Ce({ availableTags: e, activeTags: r, onToggle: t, onClear: s, categories: a = [], tagLabels: i = {} }) {
534
511
  if (!e || e.length < 2) return null;
535
- const a = ye.map((i) => ({ id: i.id, tags: i.tags.filter((o) => e.includes(o)) })).filter((i) => i.tags.length > 0);
512
+ const o = a.map((d) => ({ id: d.id, tags: d.tags.filter((p) => e.includes(p)) })).filter((d) => d.tags.length > 0);
536
513
  return /* @__PURE__ */ l("div", { className: "pvx-tag-bar", children: [
537
- /* @__PURE__ */ t(
514
+ /* @__PURE__ */ n(
538
515
  "button",
539
516
  {
540
- onClick: r,
541
- className: `pvx-tag ${n.size === 0 ? "pvx-tag--active" : ""}`,
517
+ onClick: s,
518
+ className: `pvx-tag ${r.size === 0 ? "pvx-tag--active" : ""}`,
542
519
  children: "All"
543
520
  }
544
521
  ),
545
- a.map((i, o) => /* @__PURE__ */ l("span", { className: "contents", children: [
546
- o > 0 && /* @__PURE__ */ t("span", { className: "pvx-tag-separator" }),
547
- i.tags.map((d) => /* @__PURE__ */ t(
522
+ o.map((d, p) => /* @__PURE__ */ l("span", { className: "contents", children: [
523
+ p > 0 && /* @__PURE__ */ n("span", { className: "pvx-tag-separator" }),
524
+ d.tags.map((c) => /* @__PURE__ */ n(
548
525
  "button",
549
526
  {
550
- onClick: () => s(d),
551
- className: `pvx-tag ${n.has(d) ? "pvx-tag--active" : ""}`,
552
- children: Qe[d] || d
527
+ onClick: () => t(c),
528
+ className: `pvx-tag ${r.has(c) ? "pvx-tag--active" : ""}`,
529
+ children: i[c] || c
553
530
  },
554
- d
531
+ c
555
532
  ))
556
- ] }, i.id))
533
+ ] }, d.id))
557
534
  ] });
558
535
  }
559
536
  function se({ segments: e }) {
560
- return /* @__PURE__ */ t("nav", { className: "pvx-breadcrumb", "aria-label": "Breadcrumb", children: /* @__PURE__ */ t("ol", { className: "pvx-breadcrumb-list", children: e.map((n, s) => {
561
- const r = s === e.length - 1;
537
+ return /* @__PURE__ */ n("nav", { className: "pvx-breadcrumb", "aria-label": "Breadcrumb", children: /* @__PURE__ */ n("ol", { className: "pvx-breadcrumb-list", children: e.map((r, t) => {
538
+ const s = t === e.length - 1;
562
539
  return /* @__PURE__ */ l("li", { className: "pvx-breadcrumb-item", children: [
563
- s > 0 && /* @__PURE__ */ t("svg", { className: "pvx-breadcrumb-chevron", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.25 4.5l7.5 7.5-7.5 7.5" }) }),
564
- !r && n.onClick ? /* @__PURE__ */ t("button", { onClick: n.onClick, className: "pvx-breadcrumb-link", children: n.label }) : /* @__PURE__ */ t("span", { className: "pvx-breadcrumb-current", children: n.label })
565
- ] }, n.key);
540
+ t > 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" }) }),
541
+ !s && r.onClick ? /* @__PURE__ */ n("button", { onClick: r.onClick, className: "pvx-breadcrumb-link", children: r.label }) : /* @__PURE__ */ n("span", { className: "pvx-breadcrumb-current", children: r.label })
542
+ ] }, r.key);
566
543
  }) }) });
567
544
  }
568
545
  function V({ message: e }) {
569
546
  return /* @__PURE__ */ l("div", { className: "pvx-empty", children: [
570
- /* @__PURE__ */ t("svg", { className: "pvx-empty-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: /* @__PURE__ */ t("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" }) }),
571
- /* @__PURE__ */ t("p", { children: e })
547
+ /* @__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" }) }),
548
+ /* @__PURE__ */ n("p", { children: e })
572
549
  ] });
573
550
  }
574
551
  function K() {
575
- return /* @__PURE__ */ t("div", { className: "pvx-loading", children: "Loading..." });
576
- }
577
- function Ze() {
578
- return /* @__PURE__ */ t("svg", { className: "pvx-icon pvx-icon--valid", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 12.75l6 6 9-13.5" }) });
552
+ return /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading..." });
579
553
  }
580
554
  function Xe() {
581
- return /* @__PURE__ */ t("svg", { className: "pvx-icon pvx-icon--invalid", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) });
555
+ return /* @__PURE__ */ n("svg", { className: "pvx-icon pvx-icon--valid", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 12.75l6 6 9-13.5" }) });
582
556
  }
583
- function ln({ tracks: e, isLoading: n, carMetadata: s, getUserDisplay: r, onTrackSelect: a, tags: i, onTagChange: o }) {
584
- const [d, p] = W({ key: "record.timestamp", dir: "desc" }), { activeTags: c, toggle: u, clear: g } = ke(i, o), f = L(() => {
585
- var v;
586
- if (!((v = s == null ? void 0 : s.tags) != null && v.length)) return [];
557
+ function en() {
558
+ 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" }) });
559
+ }
560
+ function ct({ tracks: e, isLoading: r, carMetadata: t, getUserDisplay: s, onTrackSelect: a, tags: i, onTagChange: o }) {
561
+ const [d, p] = O({ key: "record.timestamp", dir: "desc" }), { activeTags: c, toggle: u, clear: g } = ke(i, o), f = S(() => {
562
+ var h;
563
+ if (!((h = t == null ? void 0 : t.tags) != null && h.length)) return [];
587
564
  const x = /* @__PURE__ */ new Set();
588
565
  for (const N of e || [])
589
- N.recordByTag && Object.keys(N.recordByTag).forEach((h) => x.add(h));
590
- return s.tags.filter((N) => x.has(N));
591
- }, [e, s]), m = L(() => e ? c.size === 0 ? e : e.map((x) => {
592
- var h, w;
566
+ N.recordByTag && Object.keys(N.recordByTag).forEach((v) => x.add(v));
567
+ return t.tags.filter((N) => x.has(N));
568
+ }, [e, t]), m = S(() => e ? c.size === 0 ? e : e.map((x) => {
569
+ var v, k;
593
570
  if (!x.recordByTag) return null;
594
- let v = null;
571
+ let h = null;
595
572
  const N = /* @__PURE__ */ new Set();
596
- for (const y of Object.values(x.recordByTag)) {
597
- if (N.has(y.carId)) continue;
598
- N.add(y.carId);
599
- const C = ((w = (h = s == null ? void 0 : s.cars) == null ? void 0 : h[y.carId]) == null ? void 0 : w.tags) || ["sports_car"];
600
- we(C, c) && (!v || y.lapTimeMs < v.lapTimeMs) && (v = y);
573
+ for (const b of Object.values(x.recordByTag)) {
574
+ if (N.has(b.carId)) continue;
575
+ N.add(b.carId);
576
+ const L = ((k = (v = t == null ? void 0 : t.cars) == null ? void 0 : v[b.carId]) == null ? void 0 : k.tags) || [];
577
+ ye(L, c, t == null ? void 0 : t.categories) && (!h || b.lapTimeMs < h.lapTimeMs) && (h = b);
601
578
  }
602
- return v ? {
579
+ return h ? {
603
580
  ...x,
604
581
  record: {
605
- visibleId: v.steamId || v.identifier,
606
- carId: v.carId,
607
- carDisplayName: I(v.carId),
608
- lapTimeMs: v.lapTimeMs,
609
- timestamp: v.recordedAt
582
+ visibleId: h.steamId || h.identifier,
583
+ carId: h.carId,
584
+ carDisplayName: I(h.carId),
585
+ lapTimeMs: h.lapTimeMs,
586
+ timestamp: h.recordedAt
610
587
  }
611
588
  } : null;
612
- }).filter(Boolean) : [], [e, c, s]), b = L(() => z(m, d, (x, v) => {
613
- var N, h;
614
- switch (v) {
589
+ }).filter(Boolean) : [], [e, c, t]), y = S(() => z(m, d, (x, h) => {
590
+ var N, v;
591
+ switch (h) {
615
592
  case "displayName":
616
593
  return x.displayName;
617
594
  case "record.lapTimeMs":
@@ -622,105 +599,125 @@ function ln({ tracks: e, isLoading: n, carMetadata: s, getUserDisplay: r, onTrac
622
599
  return x.carCount || 0;
623
600
  case "record.timestamp":
624
601
  default:
625
- return (h = x.record) != null && h.timestamp ? new Date(x.record.timestamp).getTime() : 0;
602
+ return (v = x.record) != null && v.timestamp ? new Date(x.record.timestamp).getTime() : 0;
626
603
  }
627
604
  }), [m, d]);
628
- return n ? /* @__PURE__ */ t(K, {}) : e != null && e.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
629
- /* @__PURE__ */ t("div", { className: "pvx-card-header", children: /* @__PURE__ */ t("h2", { className: "pvx-card-title", children: "Track Records" }) }),
630
- /* @__PURE__ */ t(Le, { availableTags: f, activeTags: c, onToggle: u, onClear: g }),
631
- /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
632
- /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
633
- /* @__PURE__ */ t(M, { label: "Track", sortKey: "displayName", config: d, onSort: p }),
634
- /* @__PURE__ */ t("th", { className: "pvx-th", children: "Record Holder" }),
635
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-lg", children: "Car" }),
636
- /* @__PURE__ */ t(M, { label: "Lap Time", sortKey: "record.lapTimeMs", config: d, onSort: p }),
637
- /* @__PURE__ */ t(M, { label: "Drivers", sortKey: "driverCount", config: d, onSort: p, className: "pvx-hidden-below-md" }),
638
- /* @__PURE__ */ t(M, { label: "Cars", sortKey: "carCount", config: d, onSort: p, className: "pvx-hidden-below-lg" }),
639
- /* @__PURE__ */ t(M, { label: "Date", sortKey: "record.timestamp", config: d, onSort: p, className: "pvx-hidden-below-xl" })
605
+ return r ? /* @__PURE__ */ n(K, {}) : e != null && e.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
606
+ /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n("h2", { className: "pvx-card-title", children: "Track Records" }) }),
607
+ /* @__PURE__ */ n(
608
+ Ce,
609
+ {
610
+ availableTags: f,
611
+ activeTags: c,
612
+ onToggle: u,
613
+ onClear: g,
614
+ categories: t == null ? void 0 : t.categories,
615
+ tagLabels: t == null ? void 0 : t.tagLabels
616
+ }
617
+ ),
618
+ /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
619
+ /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
620
+ /* @__PURE__ */ n($, { label: "Track", sortKey: "displayName", config: d, onSort: p }),
621
+ /* @__PURE__ */ n("th", { className: "pvx-th", children: "Record Holder" }),
622
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Car" }),
623
+ /* @__PURE__ */ n($, { label: "Lap Time", sortKey: "record.lapTimeMs", config: d, onSort: p }),
624
+ /* @__PURE__ */ n($, { label: "Drivers", sortKey: "driverCount", config: d, onSort: p, className: "pvx-hidden-below-md" }),
625
+ /* @__PURE__ */ n($, { label: "Cars", sortKey: "carCount", config: d, onSort: p, className: "pvx-hidden-below-lg" }),
626
+ /* @__PURE__ */ n($, { label: "Date", sortKey: "record.timestamp", config: d, onSort: p, className: "pvx-hidden-below-xl" })
640
627
  ] }) }),
641
- /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: b.map((x) => {
642
- var v, N, h;
628
+ /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: y.map((x) => {
629
+ var h, N, v;
643
630
  return /* @__PURE__ */ l(
644
631
  "tr",
645
632
  {
646
633
  className: "pvx-row pvx-row--clickable",
647
634
  onClick: () => a(x.id, x.layout),
648
635
  children: [
649
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary", children: x.displayName }),
650
- /* @__PURE__ */ t("td", { className: "pvx-td", children: (v = x.record) != null && v.visibleId ? /* @__PURE__ */ t(G, { userId: x.record.visibleId, getUserDisplay: r }) : "-" }),
651
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-hidden-below-lg", children: ((N = x.record) == null ? void 0 : N.carDisplayName) || "-" }),
652
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: x.record ? A(x.record.lapTimeMs) : "-" }),
653
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: x.driverCount || "-" }),
654
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: x.carCount || "-" }),
655
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: (h = x.record) != null && h.timestamp ? j(x.record.timestamp) : "-" })
636
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: x.displayName }),
637
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: (h = x.record) != null && h.visibleId ? /* @__PURE__ */ n(Q, { userId: x.record.visibleId, getUserDisplay: s }) : "-" }),
638
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-lg", children: ((N = x.record) == null ? void 0 : N.carDisplayName) || "-" }),
639
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: x.record ? U(x.record.lapTimeMs) : "-" }),
640
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: x.driverCount || "-" }),
641
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: x.carCount || "-" }),
642
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: (v = x.record) != null && v.timestamp ? _(x.record.timestamp) : "-" })
656
643
  ]
657
644
  },
658
645
  `${x.id}|${x.layout || ""}`
659
646
  );
660
647
  }) })
661
648
  ] }) })
662
- ] }) : /* @__PURE__ */ t(V, { message: "No lap times recorded yet." });
663
- }
664
- function cn({ entries: e, isLoading: n, track: s, carMetadata: r, getUserDisplay: a, onCarSelect: i, onNavigate: o, tags: d, onTagChange: p }) {
665
- const [c, u] = W({ key: "lapTimeMs", dir: "asc" }), { activeTags: g, toggle: f, clear: m } = ke(d, p), b = L(() => {
666
- var w, y, C;
667
- if (!e || !((w = r == null ? void 0 : r.tags) != null && w.length)) return [];
668
- const h = /* @__PURE__ */ new Set();
669
- for (const S of e)
670
- (((C = (y = r.cars) == null ? void 0 : y[S.carId]) == null ? void 0 : C.tags) || ["sports_car"]).forEach((E) => h.add(E));
671
- return r.tags.filter((S) => h.has(S));
672
- }, [e, r]), x = L(() => e ? g.size === 0 ? e : e.filter((h) => {
673
- var y, C;
674
- const w = ((C = (y = r == null ? void 0 : r.cars) == null ? void 0 : y[h.carId]) == null ? void 0 : C.tags) || ["sports_car"];
675
- return we(w, g);
676
- }) : [], [e, g, r]), v = L(() => z(x, c, (h, w) => {
677
- switch (w) {
649
+ ] }) : /* @__PURE__ */ n(V, { message: "No lap times recorded yet." });
650
+ }
651
+ function dt({ entries: e, isLoading: r, track: t, carMetadata: s, getUserDisplay: a, onCarSelect: i, onNavigate: o, tags: d, onTagChange: p }) {
652
+ const [c, u] = O({ key: "lapTimeMs", dir: "asc" }), { activeTags: g, toggle: f, clear: m } = ke(d, p), y = S(() => {
653
+ var k, b, L;
654
+ if (!e || !((k = s == null ? void 0 : s.tags) != null && k.length)) return [];
655
+ const v = /* @__PURE__ */ new Set();
656
+ for (const M of e)
657
+ (((L = (b = s.cars) == null ? void 0 : b[M.carId]) == null ? void 0 : L.tags) || []).forEach((A) => v.add(A));
658
+ return s.tags.filter((M) => v.has(M));
659
+ }, [e, s]), x = S(() => e ? g.size === 0 ? e : e.filter((v) => {
660
+ var b, L;
661
+ const k = ((L = (b = s == null ? void 0 : s.cars) == null ? void 0 : b[v.carId]) == null ? void 0 : L.tags) || [];
662
+ return ye(k, g, s == null ? void 0 : s.categories);
663
+ }) : [], [e, g, s]), h = S(() => z(x, c, (v, k) => {
664
+ switch (k) {
678
665
  case "carId":
679
- return I(h.carId);
666
+ return I(v.carId);
680
667
  case "driverCount":
681
- return h.driverCount || 0;
668
+ return v.driverCount || 0;
682
669
  case "lapTimeMs":
683
670
  default:
684
- return h.lapTimeMs;
671
+ return v.lapTimeMs;
685
672
  }
686
673
  }), [x, c]), N = [
687
674
  { key: "tracks", label: "Tracks", onClick: () => o("tracks") },
688
- { key: "track", label: s.displayName }
675
+ { key: "track", label: t.displayName }
689
676
  ];
690
- return n ? /* @__PURE__ */ t(K, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
691
- /* @__PURE__ */ t("div", { className: "pvx-card-header", children: /* @__PURE__ */ t(se, { segments: N }) }),
692
- /* @__PURE__ */ t(Le, { availableTags: b, activeTags: g, onToggle: f, onClear: m }),
693
- e != null && e.length ? /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
694
- /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
695
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
696
- /* @__PURE__ */ t(M, { label: "Car", sortKey: "carId", config: c, onSort: u }),
697
- /* @__PURE__ */ t("th", { className: "pvx-th", children: "Record Holder" }),
698
- /* @__PURE__ */ t(M, { label: "Lap Time", sortKey: "lapTimeMs", config: c, onSort: u }),
699
- /* @__PURE__ */ t(M, { label: "Drivers", sortKey: "driverCount", config: c, onSort: u, className: "pvx-hidden-below-md" }),
700
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-lg", children: "Date" })
677
+ return r ? /* @__PURE__ */ n(K, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
678
+ /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(se, { segments: N }) }),
679
+ /* @__PURE__ */ n(
680
+ Ce,
681
+ {
682
+ availableTags: y,
683
+ activeTags: g,
684
+ onToggle: f,
685
+ onClear: m,
686
+ categories: s == null ? void 0 : s.categories,
687
+ tagLabels: s == null ? void 0 : s.tagLabels
688
+ }
689
+ ),
690
+ e != null && e.length ? /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
691
+ /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
692
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
693
+ /* @__PURE__ */ n($, { label: "Car", sortKey: "carId", config: c, onSort: u }),
694
+ /* @__PURE__ */ n("th", { className: "pvx-th", children: "Record Holder" }),
695
+ /* @__PURE__ */ n($, { label: "Lap Time", sortKey: "lapTimeMs", config: c, onSort: u }),
696
+ /* @__PURE__ */ n($, { label: "Drivers", sortKey: "driverCount", config: c, onSort: u, className: "pvx-hidden-below-md" }),
697
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Date" })
701
698
  ] }) }),
702
- /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: v.map((h, w) => /* @__PURE__ */ l(
699
+ /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: h.map((v, k) => /* @__PURE__ */ l(
703
700
  "tr",
704
701
  {
705
702
  className: "pvx-row pvx-row--clickable",
706
- onClick: () => i(h.carId),
703
+ onClick: () => i(v.carId),
707
704
  children: [
708
- /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t(re, { rank: w + 1, podium: !0 }) }),
709
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary", children: I(h.carId) }),
710
- /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t(G, { userId: h.steamId || h.userId, getUserDisplay: a }) }),
711
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: A(h.lapTimeMs) }),
712
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: h.driverCount || "-" }),
713
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-lg", children: h.recordedAt ? j(h.recordedAt) : "-" })
705
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(re, { rank: k + 1, podium: !0 }) }),
706
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: I(v.carId) }),
707
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(Q, { userId: v.steamId || v.userId, getUserDisplay: a }) }),
708
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: U(v.lapTimeMs) }),
709
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: v.driverCount || "-" }),
710
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-lg", children: v.recordedAt ? _(v.recordedAt) : "-" })
714
711
  ]
715
712
  },
716
- h.carId
713
+ v.carId
717
714
  )) })
718
- ] }) }) : /* @__PURE__ */ t(V, { message: "No lap times for this track yet." })
715
+ ] }) }) : /* @__PURE__ */ n(V, { message: "No lap times for this track yet." })
719
716
  ] });
720
717
  }
721
- function dn({ entries: e, isLoading: n, track: s, carId: r, getUserDisplay: a, onDriverSelect: i, onNavigate: o, highlightId: d }) {
722
- const [p, c] = W({ key: "lapTimeMs", dir: "asc" }), u = L(() => Ce(e), [e]), g = L(() => z(e || [], p, (m, b) => {
723
- switch (b) {
718
+ function pt({ entries: e, isLoading: r, track: t, carId: s, getUserDisplay: a, onDriverSelect: i, onNavigate: o, highlightId: d }) {
719
+ const [p, c] = O({ key: "lapTimeMs", dir: "asc" }), u = S(() => we(e), [e]), g = S(() => z(e || [], p, (m, y) => {
720
+ switch (y) {
724
721
  case "userId":
725
722
  return a(m.steamId || m.userId).displayName;
726
723
  case "lapCount":
@@ -731,68 +728,68 @@ function dn({ entries: e, isLoading: n, track: s, carId: r, getUserDisplay: a, o
731
728
  }
732
729
  }), [e, p, a]), f = [
733
730
  { key: "tracks", label: "Tracks", onClick: () => o("tracks") },
734
- { key: "track", label: s.displayName, onClick: () => o("track") },
735
- { key: "car", label: I(r) }
731
+ { key: "track", label: t.displayName, onClick: () => o("track") },
732
+ { key: "car", label: I(s) }
736
733
  ];
737
- return n ? /* @__PURE__ */ t(K, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
738
- /* @__PURE__ */ t("div", { className: "pvx-card-header", children: /* @__PURE__ */ t(se, { segments: f }) }),
739
- e != null && e.length ? /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
740
- /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
741
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
742
- /* @__PURE__ */ t(M, { label: "Driver", sortKey: "userId", config: p, onSort: c }),
743
- /* @__PURE__ */ t(M, { label: "Lap Time", sortKey: "lapTimeMs", config: p, onSort: c }),
744
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
745
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
746
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" }),
747
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-lg", children: "Tyre" }),
748
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-xl", children: "Fuel" }),
749
- /* @__PURE__ */ t(M, { label: "Laps", sortKey: "lapCount", config: p, onSort: c, className: "pvx-hidden-below-lg" }),
750
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
734
+ return r ? /* @__PURE__ */ n(K, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
735
+ /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n(se, { segments: f }) }),
736
+ e != null && e.length ? /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
737
+ /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
738
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
739
+ /* @__PURE__ */ n($, { label: "Driver", sortKey: "userId", config: p, onSort: c }),
740
+ /* @__PURE__ */ n($, { label: "Lap Time", sortKey: "lapTimeMs", config: p, onSort: c }),
741
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
742
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
743
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" }),
744
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Tyre" }),
745
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-xl", children: "Fuel" }),
746
+ /* @__PURE__ */ n($, { label: "Laps", sortKey: "lapCount", config: p, onSort: c, className: "pvx-hidden-below-lg" }),
747
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
751
748
  ] }) }),
752
- /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: g.map((m, b) => {
753
- const x = b + 1, v = m.steamId || m.userId, N = u && m.sector1Ms === u.s1, h = u && m.sector2Ms === u.s2, w = u && m.sector3Ms === u.s3;
749
+ /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: g.map((m, y) => {
750
+ const x = y + 1, h = m.steamId || m.userId, N = u && m.sector1Ms === u.s1, v = u && m.sector2Ms === u.s2, k = u && m.sector3Ms === u.s3;
754
751
  return /* @__PURE__ */ l(
755
752
  "tr",
756
753
  {
757
- className: `pvx-row pvx-row--clickable ${d && v === d ? "pvx-row--highlight" : x <= 3 ? "pvx-row--podium" : ""}`,
758
- onClick: () => i(v),
754
+ className: `pvx-row pvx-row--clickable ${d && h === d ? "pvx-row--highlight" : x <= 3 ? "pvx-row--podium" : ""}`,
755
+ onClick: () => i(h),
759
756
  children: [
760
- /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t(re, { rank: x, podium: !0 }) }),
761
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ t(G, { userId: v, getUserDisplay: a }) }),
762
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: A(m.lapTimeMs) }),
763
- /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${N ? "pvx-td--best-sector" : ""}`, children: B(m.sector1Ms) }),
764
- /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${h ? "pvx-td--best-sector" : ""}`, children: B(m.sector2Ms) }),
765
- /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${w ? "pvx-td--best-sector" : ""}`, children: B(m.sector3Ms) }),
766
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: me(m.tyreCompound), children: m.tyreCompound || "-" }),
767
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-xl", children: he(m.startingFuelL) }),
768
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: m.lapCount || "-" }),
769
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: m.recordedAt ? j(m.recordedAt) : "-" })
757
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(re, { rank: x, podium: !0 }) }),
758
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(Q, { userId: h, getUserDisplay: a }) }),
759
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: U(m.lapTimeMs) }),
760
+ /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${N ? "pvx-td--best-sector" : ""}`, children: B(m.sector1Ms) }),
761
+ /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${v ? "pvx-td--best-sector" : ""}`, children: B(m.sector2Ms) }),
762
+ /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${k ? "pvx-td--best-sector" : ""}`, children: B(m.sector3Ms) }),
763
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: me(m.tyreCompound), children: m.tyreCompound || "-" }),
764
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-xl", children: ve(m.startingFuelL) }),
765
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: m.lapCount || "-" }),
766
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: m.recordedAt ? _(m.recordedAt) : "-" })
770
767
  ]
771
768
  },
772
- v
769
+ h
773
770
  );
774
771
  }) })
775
- ] }) }) : /* @__PURE__ */ t(V, { message: "No lap times for this car yet." })
772
+ ] }) }) : /* @__PURE__ */ n(V, { message: "No lap times for this car yet." })
776
773
  ] });
777
774
  }
778
- function pn({ userId: e, track: n, carId: s, game: r, gameVersion: a, showInvalid: i, getUserDisplay: o, onToggleInvalid: d, onNavigate: p }) {
779
- const { data: c, driverName: u, theoreticalBest: g, isLoading: f } = He(e, n.id, n.layout, s, { showInvalid: i, game: r, gameVersion: a }), { displayName: m, avatarUrl: b } = o(e, u), x = L(() => Ce(c, !0), [c]), v = L(() => {
780
- const h = (c == null ? void 0 : c.filter((w) => w.isValid)) || [];
781
- return h.length ? Math.min(...h.map((w) => w.lapTimeMs)) : null;
775
+ function ut({ userId: e, track: r, carId: t, game: s, gameVersion: a, showInvalid: i, getUserDisplay: o, onToggleInvalid: d, onNavigate: p }) {
776
+ const { data: c, driverName: u, theoreticalBest: g, isLoading: f } = Oe(e, r.id, r.layout, t, { showInvalid: i, game: s, gameVersion: a }), { displayName: m, avatarUrl: y } = o(e, u), x = S(() => we(c, !0), [c]), h = S(() => {
777
+ const v = (c == null ? void 0 : c.filter((k) => k.isValid)) || [];
778
+ return v.length ? Math.min(...v.map((k) => k.lapTimeMs)) : null;
782
779
  }, [c]), N = [
783
780
  { key: "tracks", label: "Tracks", onClick: () => p("tracks") },
784
- { key: "track", label: n.displayName, onClick: () => p("track") },
785
- { key: "car", label: I(s), onClick: () => p("car") },
781
+ { key: "track", label: r.displayName, onClick: () => p("track") },
782
+ { key: "car", label: I(t), onClick: () => p("car") },
786
783
  { key: "driver", label: m }
787
784
  ];
788
- return f ? /* @__PURE__ */ t(K, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
785
+ return f ? /* @__PURE__ */ n(K, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
789
786
  /* @__PURE__ */ l("div", { className: "pvx-card-header pvx-card-header--split", children: [
790
787
  /* @__PURE__ */ l("div", { className: "pvx-card-header-left", children: [
791
- /* @__PURE__ */ t(se, { segments: N }),
792
- b ? /* @__PURE__ */ t("img", { src: b, alt: "", className: "pvx-driver-avatar pvx-driver-avatar--lg" }) : /* @__PURE__ */ t("span", { className: "pvx-driver-avatar pvx-driver-avatar--lg pvx-driver-avatar--placeholder" })
788
+ /* @__PURE__ */ n(se, { segments: N }),
789
+ y ? /* @__PURE__ */ n("img", { src: y, alt: "", className: "pvx-driver-avatar pvx-driver-avatar--lg" }) : /* @__PURE__ */ n("span", { className: "pvx-driver-avatar pvx-driver-avatar--lg pvx-driver-avatar--placeholder" })
793
790
  ] }),
794
791
  /* @__PURE__ */ l("label", { className: "pvx-checkbox-label", children: [
795
- /* @__PURE__ */ t(
792
+ /* @__PURE__ */ n(
796
793
  "input",
797
794
  {
798
795
  type: "checkbox",
@@ -801,12 +798,12 @@ function pn({ userId: e, track: n, carId: s, game: r, gameVersion: a, showInvali
801
798
  className: "pvx-checkbox"
802
799
  }
803
800
  ),
804
- /* @__PURE__ */ t("span", { children: "Show invalid laps" })
801
+ /* @__PURE__ */ n("span", { children: "Show invalid laps" })
805
802
  ] })
806
803
  ] }),
807
804
  g && /* @__PURE__ */ l("div", { className: "pvx-theoretical-best", children: [
808
- /* @__PURE__ */ t("span", { className: "pvx-theoretical-best-label", children: "Theoretical Best:" }),
809
- /* @__PURE__ */ t("span", { className: "pvx-theoretical-best-time", children: A(g.lapTimeMs) }),
805
+ /* @__PURE__ */ n("span", { className: "pvx-theoretical-best-label", children: "Theoretical Best:" }),
806
+ /* @__PURE__ */ n("span", { className: "pvx-theoretical-best-time", children: U(g.lapTimeMs) }),
810
807
  /* @__PURE__ */ l("span", { className: "pvx-theoretical-best-sectors", children: [
811
808
  "(",
812
809
  B(g.sector1Ms),
@@ -817,40 +814,40 @@ function pn({ userId: e, track: n, carId: s, game: r, gameVersion: a, showInvali
817
814
  ")"
818
815
  ] })
819
816
  ] }),
820
- c != null && c.length ? /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
821
- /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
822
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
823
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-md", children: "Lap" }),
824
- /* @__PURE__ */ t("th", { className: "pvx-th", children: "Lap Time" }),
825
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
826
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
827
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" }),
828
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--narrow", children: "Valid" }),
829
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-lg", children: "Tyre" }),
830
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-lg", children: "Fuel" }),
831
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
817
+ c != null && c.length ? /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
818
+ /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
819
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
820
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-md", children: "Lap" }),
821
+ /* @__PURE__ */ n("th", { className: "pvx-th", children: "Lap Time" }),
822
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
823
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
824
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" }),
825
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "Valid" }),
826
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Tyre" }),
827
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-lg", children: "Fuel" }),
828
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
832
829
  ] }) }),
833
- /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: c.map((h, w) => {
834
- const y = h.isValid && h.lapTimeMs === v, C = x && h.isValid && h.sector1Ms === x.s1, S = x && h.isValid && h.sector2Ms === x.s2, $ = x && h.isValid && h.sector3Ms === x.s3;
835
- let E = "pvx-row";
836
- return h.isValid || (E += " pvx-row--invalid"), y && (E += " pvx-row--personal-best"), /* @__PURE__ */ l("tr", { className: E, children: [
837
- /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t("span", { className: `pvx-rank ${y ? "pvx-rank--gold" : ""}`, children: w + 1 }) }),
838
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-md", children: h.lapNumber || "-" }),
839
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: A(h.lapTimeMs) }),
840
- /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${C ? "pvx-td--best-sector" : ""}`, children: B(h.sector1Ms) }),
841
- /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${S ? "pvx-td--best-sector" : ""}`, children: B(h.sector2Ms) }),
842
- /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${$ ? "pvx-td--best-sector" : ""}`, children: B(h.sector3Ms) }),
843
- /* @__PURE__ */ t("td", { className: "pvx-td", title: h.isValid ? void 0 : h.invalidReason || "Invalid", children: h.isValid ? /* @__PURE__ */ t(Ze, {}) : /* @__PURE__ */ t(Xe, {}) }),
844
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: me(h.tyreCompound), children: h.tyreCompound || "-" }),
845
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: he(h.startingFuelL) }),
846
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: j(h.timestamp) })
847
- ] }, h.id);
830
+ /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: c.map((v, k) => {
831
+ const b = v.isValid && v.lapTimeMs === h, L = x && v.isValid && v.sector1Ms === x.s1, M = x && v.isValid && v.sector2Ms === x.s2, w = x && v.isValid && v.sector3Ms === x.s3;
832
+ let A = "pvx-row";
833
+ return v.isValid || (A += " pvx-row--invalid"), b && (A += " pvx-row--personal-best"), /* @__PURE__ */ l("tr", { className: A, children: [
834
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n("span", { className: `pvx-rank ${b ? "pvx-rank--gold" : ""}`, children: k + 1 }) }),
835
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-md", children: v.lapNumber || "-" }),
836
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: U(v.lapTimeMs) }),
837
+ /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${L ? "pvx-td--best-sector" : ""}`, children: B(v.sector1Ms) }),
838
+ /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${M ? "pvx-td--best-sector" : ""}`, children: B(v.sector2Ms) }),
839
+ /* @__PURE__ */ n("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${w ? "pvx-td--best-sector" : ""}`, children: B(v.sector3Ms) }),
840
+ /* @__PURE__ */ n("td", { className: "pvx-td", title: v.isValid ? void 0 : v.invalidReason || "Invalid", children: v.isValid ? /* @__PURE__ */ n(Xe, {}) : /* @__PURE__ */ n(en, {}) }),
841
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: me(v.tyreCompound), children: v.tyreCompound || "-" }),
842
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: ve(v.startingFuelL) }),
843
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: _(v.timestamp) })
844
+ ] }, v.id);
848
845
  }) })
849
- ] }) }) : /* @__PURE__ */ t(V, { message: i ? "No laps recorded for this combination." : 'No valid laps. Try enabling "Show invalid laps".' })
846
+ ] }) }) : /* @__PURE__ */ n(V, { message: i ? "No laps recorded for this combination." : 'No valid laps. Try enabling "Show invalid laps".' })
850
847
  ] });
851
848
  }
852
- function un({ drivers: e, isLoading: n, getUserDisplay: s, game: r, gameVersion: a, onComboSelect: i }) {
853
- const [o, d] = W({ key: "rank", dir: "asc" }), [p, c] = D(null), u = L(() => e ? z(e, o, (f, m) => {
849
+ function mt({ drivers: e, isLoading: r, getUserDisplay: t, game: s, gameVersion: a, onComboSelect: i }) {
850
+ const [o, d] = O({ key: "rank", dir: "asc" }), [p, c] = D(null), u = S(() => e ? z(e, o, (f, m) => {
854
851
  switch (m) {
855
852
  case "rating":
856
853
  return f.rating;
@@ -863,45 +860,45 @@ function un({ drivers: e, isLoading: n, getUserDisplay: s, game: r, gameVersion:
863
860
  return f.rank;
864
861
  }
865
862
  }) : [], [e, o]);
866
- if (n) return /* @__PURE__ */ t(K, {});
863
+ if (r) return /* @__PURE__ */ n(K, {});
867
864
  if (!(e != null && e.length))
868
- return /* @__PURE__ */ t("div", { className: "pvx-card", children: /* @__PURE__ */ t(V, { message: "Not enough data for rankings yet." }) });
865
+ return /* @__PURE__ */ n("div", { className: "pvx-card", children: /* @__PURE__ */ n(V, { message: "Not enough data for rankings yet." }) });
869
866
  const g = 5;
870
867
  return /* @__PURE__ */ l("div", { className: "pvx-card", children: [
871
868
  /* @__PURE__ */ l("div", { className: "pvx-card-header pvx-rankings-header", children: [
872
- /* @__PURE__ */ t("h2", { className: "pvx-card-title", children: "Driver Rankings" }),
869
+ /* @__PURE__ */ n("h2", { className: "pvx-card-title", children: "Driver Rankings" }),
873
870
  /* @__PURE__ */ l("div", { className: "pvx-rankings-info-trigger", children: [
874
- /* @__PURE__ */ t("svg", { className: "pvx-rankings-info-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" }) }),
871
+ /* @__PURE__ */ n("svg", { className: "pvx-rankings-info-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z" }) }),
875
872
  /* @__PURE__ */ l("div", { className: "pvx-rankings-info-tooltip", children: [
876
- /* @__PURE__ */ t("p", { className: "pvx-rankings-info-title", children: "How ratings work" }),
873
+ /* @__PURE__ */ n("p", { className: "pvx-rankings-info-title", children: "How ratings work" }),
877
874
  /* @__PURE__ */ l("ul", { className: "pvx-rankings-info-list", children: [
878
- /* @__PURE__ */ t("li", { children: "For each car/track combo with 3+ drivers, you're ranked by lap time and given a percentile (100 = fastest, 0 = slowest)" }),
879
- /* @__PURE__ */ t("li", { children: "Your rating is a weighted average across all your combos — bigger fields count more" }),
880
- /* @__PURE__ */ t("li", { children: "A confidence adjustment rewards car diversity: the more different cars you drive competitively, the closer your rating reflects your true score" }),
881
- /* @__PURE__ */ t("li", { children: "Minimum 2 qualifying combos required" })
875
+ /* @__PURE__ */ n("li", { children: "For each car/track combo with 3+ drivers, you're ranked by lap time and given a percentile (100 = fastest, 0 = slowest)" }),
876
+ /* @__PURE__ */ n("li", { children: "Your rating is a weighted average across all your combos — bigger fields count more" }),
877
+ /* @__PURE__ */ n("li", { children: "A confidence adjustment rewards car diversity: the more different cars you drive competitively, the closer your rating reflects your true score" }),
878
+ /* @__PURE__ */ n("li", { children: "Minimum 2 qualifying combos required" })
882
879
  ] })
883
880
  ] })
884
881
  ] })
885
882
  ] }),
886
- /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
887
- /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
888
- /* @__PURE__ */ t(M, { label: "#", sortKey: "rank", config: o, onSort: d, className: "pvx-th--narrow" }),
889
- /* @__PURE__ */ t("th", { className: "pvx-th", children: "Driver" }),
890
- /* @__PURE__ */ t(M, { label: "Rating", sortKey: "rating", config: o, onSort: d }),
891
- /* @__PURE__ */ t(M, { label: "Cars", sortKey: "distinctCars", config: o, onSort: d, className: "pvx-hidden-below-sm" }),
892
- /* @__PURE__ */ t(M, { label: "Combos", sortKey: "comboCount", config: o, onSort: d, className: "pvx-hidden-below-sm" })
883
+ /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
884
+ /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
885
+ /* @__PURE__ */ n($, { label: "#", sortKey: "rank", config: o, onSort: d, className: "pvx-th--narrow" }),
886
+ /* @__PURE__ */ n("th", { className: "pvx-th", children: "Driver" }),
887
+ /* @__PURE__ */ n($, { label: "Rating", sortKey: "rating", config: o, onSort: d }),
888
+ /* @__PURE__ */ n($, { label: "Cars", sortKey: "distinctCars", config: o, onSort: d, className: "pvx-hidden-below-sm" }),
889
+ /* @__PURE__ */ n($, { label: "Combos", sortKey: "comboCount", config: o, onSort: d, className: "pvx-hidden-below-sm" })
893
890
  ] }) }),
894
- /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: u.map((f) => {
891
+ /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: u.map((f) => {
895
892
  const m = p === f.identifier;
896
- return /* @__PURE__ */ t(
897
- et,
893
+ return /* @__PURE__ */ n(
894
+ nn,
898
895
  {
899
896
  driver: f,
900
- getUserDisplay: s,
897
+ getUserDisplay: t,
901
898
  isExpanded: m,
902
899
  onToggle: () => c(m ? null : f.identifier),
903
900
  colCount: g,
904
- game: r,
901
+ game: s,
905
902
  gameVersion: a,
906
903
  onComboSelect: i
907
904
  },
@@ -911,27 +908,27 @@ function un({ drivers: e, isLoading: n, getUserDisplay: s, game: r, gameVersion:
911
908
  ] }) })
912
909
  ] });
913
910
  }
914
- function et({ driver: e, getUserDisplay: n, isExpanded: s, onToggle: r, colCount: a, game: i, gameVersion: o, onComboSelect: d }) {
911
+ function nn({ driver: e, getUserDisplay: r, isExpanded: t, onToggle: s, colCount: a, game: i, gameVersion: o, onComboSelect: d }) {
915
912
  const p = e.identifier;
916
- return /* @__PURE__ */ l(U, { children: [
913
+ return /* @__PURE__ */ l(F, { children: [
917
914
  /* @__PURE__ */ l(
918
915
  "tr",
919
916
  {
920
917
  className: `pvx-row pvx-row--clickable ${e.rank <= 3 ? "pvx-row--podium" : ""}`,
921
- onClick: r,
918
+ onClick: s,
922
919
  children: [
923
- /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t(re, { rank: e.rank, podium: !0 }) }),
924
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ t(G, { userId: p, getUserDisplay: n }) }),
925
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: e.rating.toFixed(1) }),
926
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: e.distinctCars || "-" }),
927
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: /* @__PURE__ */ l("span", { className: "pvx-rankings-combo-count", children: [
920
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(re, { rank: e.rank, podium: !0 }) }),
921
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(Q, { userId: p, getUserDisplay: r }) }),
922
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: e.rating.toFixed(1) }),
923
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: e.distinctCars || "-" }),
924
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: /* @__PURE__ */ l("span", { className: "pvx-rankings-combo-count", children: [
928
925
  e.comboCount,
929
- /* @__PURE__ */ t("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__ */ t("path", { d: "m6 9 6 6 6-6" }) })
926
+ /* @__PURE__ */ n("svg", { className: `pvx-rankings-chevron ${t ? "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" }) })
930
927
  ] }) })
931
928
  ]
932
929
  }
933
930
  ),
934
- s && e.combos && /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: a, className: "pvx-rankings-combos-cell", children: /* @__PURE__ */ t("div", { className: "pvx-rankings-combos", children: e.combos.map((c, u) => {
931
+ t && 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) => {
935
932
  const g = c.layout ? `${c.trackId}|${c.layout}` : c.trackId, f = d ? () => d({ track: g, car: c.carId, highlight: p, game: i, gameVersion: o }) : void 0;
936
933
  return /* @__PURE__ */ l(
937
934
  "div",
@@ -941,11 +938,11 @@ function et({ driver: e, getUserDisplay: n, isExpanded: s, onToggle: r, colCount
941
938
  role: f ? "button" : void 0,
942
939
  children: [
943
940
  /* @__PURE__ */ l("div", { className: "pvx-rankings-combo-info", children: [
944
- /* @__PURE__ */ t("p", { className: "pvx-rankings-combo-track", children: q(c.trackId, c.layout, i) }),
945
- /* @__PURE__ */ t("p", { className: "pvx-rankings-combo-car", children: I(c.carId) })
941
+ /* @__PURE__ */ n("p", { className: "pvx-rankings-combo-track", children: j(c.trackId, c.layout, i) }),
942
+ /* @__PURE__ */ n("p", { className: "pvx-rankings-combo-car", children: I(c.carId) })
946
943
  ] }),
947
944
  /* @__PURE__ */ l("div", { className: "pvx-rankings-combo-stats", children: [
948
- /* @__PURE__ */ t("p", { className: "pvx-rankings-combo-time", children: A(c.lapTimeMs) }),
945
+ /* @__PURE__ */ n("p", { className: "pvx-rankings-combo-time", children: U(c.lapTimeMs) }),
949
946
  /* @__PURE__ */ l("p", { className: `pvx-rankings-combo-pct ${c.percentile >= 75 ? "pvx-rankings-combo-pct--high" : c.percentile >= 50 ? "pvx-rankings-combo-pct--mid" : c.percentile >= 25 ? "pvx-rankings-combo-pct--low" : "pvx-rankings-combo-pct--bottom"}`, children: [
950
947
  c.percentile.toFixed(0),
951
948
  "%",
@@ -965,7 +962,7 @@ function et({ driver: e, getUserDisplay: n, isExpanded: s, onToggle: r, colCount
965
962
  }) }) }) })
966
963
  ] });
967
964
  }
968
- const tt = {
965
+ const tn = {
969
966
  GBR: "🇬🇧",
970
967
  DEU: "🇩🇪",
971
968
  NLD: "🇳🇱",
@@ -996,152 +993,152 @@ const tt = {
996
993
  RUS: "🇷🇺",
997
994
  TUR: "🇹🇷",
998
995
  KOR: "🇰🇷"
999
- }, ae = ["🥇", "🥈", "🥉"], nt = {
996
+ }, ae = ["🥇", "🥈", "🥉"], rn = {
1000
997
  championship: "Championship",
1001
998
  series: "Series",
1002
999
  event: "Event",
1003
1000
  hotlap: "Hotlap"
1004
- }, rt = ["PRACTICE", "QUALIFYING", "RACE"];
1001
+ }, sn = ["PRACTICE", "QUALIFYING", "RACE"];
1005
1002
  function de(e) {
1006
- const n = rt.indexOf(e);
1007
- if (n >= 0) return n;
1008
- const s = e.match(/^PRACTICE_(\d+)$/);
1009
- return s ? 100 + parseInt(s[1]) : 999;
1003
+ const r = sn.indexOf(e);
1004
+ if (r >= 0) return r;
1005
+ const t = e.match(/^PRACTICE_(\d+)$/);
1006
+ return t ? 100 + parseInt(t[1]) : 999;
1010
1007
  }
1011
1008
  function ie(e) {
1012
- const n = e.match(/^PRACTICE_(\d+)$/);
1013
- return n ? `P${n[1]}` : e;
1009
+ const r = e.match(/^PRACTICE_(\d+)$/);
1010
+ return r ? `P${r[1]}` : e;
1014
1011
  }
1015
1012
  function oe({ position: e }) {
1016
- return /* @__PURE__ */ t("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 });
1013
+ 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 });
1017
1014
  }
1018
- function Q({ nation: e }) {
1019
- const n = e && tt[e];
1020
- return n ? /* @__PURE__ */ t("span", { className: "pvx-nation-flag", title: e, children: n }) : null;
1015
+ function G({ nation: e }) {
1016
+ const r = e && tn[e];
1017
+ return r ? /* @__PURE__ */ n("span", { className: "pvx-nation-flag", title: e, children: r }) : null;
1021
1018
  }
1022
- function st({ sessions: e, activeSession: n, onSelect: s }) {
1019
+ function an({ sessions: e, activeSession: r, onSelect: t }) {
1023
1020
  if (!e || e.length <= 1) return null;
1024
- const r = [...e].sort(
1021
+ const s = [...e].sort(
1025
1022
  (a, i) => de(a.type) - de(i.type)
1026
1023
  );
1027
- return /* @__PURE__ */ t("div", { className: "pvx-session-tabs", children: r.map((a) => /* @__PURE__ */ t(
1024
+ return /* @__PURE__ */ n("div", { className: "pvx-session-tabs", children: s.map((a) => /* @__PURE__ */ n(
1028
1025
  "button",
1029
1026
  {
1030
- onClick: () => s(a.type),
1031
- className: `pvx-session-tab ${n === a.type ? "pvx-session-tab--active" : ""}`,
1027
+ onClick: () => t(a.type),
1028
+ className: `pvx-session-tab ${r === a.type ? "pvx-session-tab--active" : ""}`,
1032
1029
  children: ie(a.type)
1033
1030
  },
1034
1031
  a.type
1035
1032
  )) });
1036
1033
  }
1037
- function at({ type: e }) {
1038
- return /* @__PURE__ */ t("span", { className: `pvx-comp-badge pvx-comp-badge--${e}`, children: nt[e] || e });
1034
+ function on({ type: e }) {
1035
+ return /* @__PURE__ */ n("span", { className: `pvx-comp-badge pvx-comp-badge--${e}`, children: rn[e] || e });
1039
1036
  }
1040
- function J({ children: e, variant: n = "default" }) {
1041
- return /* @__PURE__ */ t("span", { className: `pvx-info-pill ${n !== "default" ? `pvx-info-pill--${n}` : ""}`, children: e });
1037
+ function J({ children: e, variant: r = "default" }) {
1038
+ return /* @__PURE__ */ n("span", { className: `pvx-info-pill ${r !== "default" ? `pvx-info-pill--${r}` : ""}`, children: e });
1042
1039
  }
1043
- function it(e) {
1040
+ function ln(e) {
1044
1041
  if (!e) return "TBD";
1045
- const n = new Date(e);
1046
- if (isNaN(n)) return "TBD";
1047
- const s = n.toLocaleDateString("en-GB", { weekday: "short", day: "numeric", month: "short" }), r = n.toLocaleTimeString("en-GB", { hour: "2-digit", minute: "2-digit" });
1048
- return `${s} • ${r}`;
1049
- }
1050
- function ot(e) {
1051
- return e.reduce((n, s) => {
1052
- var r;
1053
- return (r = s.splits) != null && r.length ? n ? n.map((a, i) => {
1054
- const o = s.splits[i];
1042
+ const r = new Date(e);
1043
+ if (isNaN(r)) return "TBD";
1044
+ const t = r.toLocaleDateString("en-GB", { weekday: "short", day: "numeric", month: "short" }), s = r.toLocaleTimeString("en-GB", { hour: "2-digit", minute: "2-digit" });
1045
+ return `${t} • ${s}`;
1046
+ }
1047
+ function cn(e) {
1048
+ return e.reduce((r, t) => {
1049
+ var s;
1050
+ return (s = t.splits) != null && s.length ? r ? r.map((a, i) => {
1051
+ const o = t.splits[i];
1055
1052
  return o && o < a ? o : a;
1056
- }) : [...s.splits] : n;
1053
+ }) : [...t.splits] : r;
1057
1054
  }, null);
1058
1055
  }
1059
- function F({ message: e = "Loading..." }) {
1060
- return /* @__PURE__ */ t("div", { className: "pvx-loading", children: e });
1056
+ function E({ message: e = "Loading..." }) {
1057
+ return /* @__PURE__ */ n("div", { className: "pvx-loading", children: e });
1061
1058
  }
1062
1059
  function P({ message: e = "No data available." }) {
1063
- return /* @__PURE__ */ t("div", { className: "pvx-empty", children: /* @__PURE__ */ t("p", { children: e }) });
1064
- }
1065
- const Se = 3;
1066
- function lt(e) {
1067
- const n = e == null ? void 0 : e.rounds;
1068
- return n != null && n.length ? e.type === "hotlap" ? n.every((s) => s.isFinalized && s.dediStatus === "completed") : n.every((s) => s.isFinalized) : !1;
1069
- }
1070
- function ct(e) {
1071
- const n = e == null ? void 0 : e.rounds;
1072
- if (!(n != null && n.length)) return null;
1073
- let s = null;
1074
- for (const r of n) {
1075
- if (!r.startTime) continue;
1076
- const a = new Date(r.startTime);
1077
- isNaN(a) || (!s || a > s) && (s = a);
1060
+ return /* @__PURE__ */ n("div", { className: "pvx-empty", children: /* @__PURE__ */ n("p", { children: e }) });
1061
+ }
1062
+ const Le = 3;
1063
+ function dn(e) {
1064
+ const r = e == null ? void 0 : e.rounds;
1065
+ return r != null && r.length ? e.type === "hotlap" ? r.every((t) => t.isFinalized && t.dediStatus === "completed") : r.every((t) => t.isFinalized) : !1;
1066
+ }
1067
+ function pn(e) {
1068
+ const r = e == null ? void 0 : e.rounds;
1069
+ if (!(r != null && r.length)) return null;
1070
+ let t = null;
1071
+ for (const s of r) {
1072
+ if (!s.startTime) continue;
1073
+ const a = new Date(s.startTime);
1074
+ isNaN(a) || (!t || a > t) && (t = a);
1078
1075
  }
1079
- return s;
1076
+ return t;
1080
1077
  }
1081
- function Te(e, n = Se) {
1082
- if (!lt(e)) return "active";
1083
- const s = ct(e);
1084
- if (!s) return "recently-completed";
1085
- const r = n * 24 * 60 * 60 * 1e3;
1086
- return Date.now() - s.getTime() <= r ? "recently-completed" : "archived";
1078
+ function Se(e, r = Le) {
1079
+ if (!dn(e)) return "active";
1080
+ const t = pn(e);
1081
+ if (!t) return "recently-completed";
1082
+ const s = r * 24 * 60 * 60 * 1e3;
1083
+ return Date.now() - t.getTime() <= s ? "recently-completed" : "archived";
1087
1084
  }
1088
- function mn(e, n, s = Se) {
1085
+ function vt(e, r, t = Le) {
1089
1086
  if (!(e != null && e.length)) return [];
1090
- const r = new Set(Array.isArray(n) ? n : [n]);
1091
- return e.filter((a) => r.has(Te(a, s)));
1092
- }
1093
- function dt(e, n = 3) {
1094
- const s = e == null ? void 0 : e.standings;
1095
- return Array.isArray(s) ? [...s].sort((r, a) => (r.position ?? 999) - (a.position ?? 999)).slice(0, n) : [];
1096
- }
1097
- function pt({ competitionId: e, topN: n = 3, label: s = "Completed", className: r }) {
1098
- const { data: a } = ge(e), i = dt(a, n);
1099
- return /* @__PURE__ */ l("div", { className: `pvx-comp-completed-badge ${r || ""}`, children: [
1100
- /* @__PURE__ */ t("span", { className: "pvx-comp-completed-badge-label", children: s }),
1101
- i.length > 0 && /* @__PURE__ */ t("ol", { className: "pvx-comp-completed-badge-podium", children: i.map((o, d) => /* @__PURE__ */ l("li", { className: "pvx-comp-completed-badge-driver", children: [
1102
- /* @__PURE__ */ t("span", { className: "pvx-comp-completed-badge-medal", "aria-hidden": "true", children: ae[d] || "" }),
1103
- /* @__PURE__ */ t(Q, { nation: o.nation }),
1104
- /* @__PURE__ */ t("span", { className: "pvx-comp-completed-badge-name", children: o.driverName })
1087
+ const s = new Set(Array.isArray(r) ? r : [r]);
1088
+ return e.filter((a) => s.has(Se(a, t)));
1089
+ }
1090
+ function un(e, r = 3) {
1091
+ const t = e == null ? void 0 : e.standings;
1092
+ return Array.isArray(t) ? [...t].sort((s, a) => (s.position ?? 999) - (a.position ?? 999)).slice(0, r) : [];
1093
+ }
1094
+ function mn({ competitionId: e, topN: r = 3, label: t = "Completed", className: s }) {
1095
+ const { data: a } = ge(e), i = un(a, r);
1096
+ return /* @__PURE__ */ l("div", { className: `pvx-comp-completed-badge ${s || ""}`, children: [
1097
+ /* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-label", children: t }),
1098
+ 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: [
1099
+ /* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-medal", "aria-hidden": "true", children: ae[d] || "" }),
1100
+ /* @__PURE__ */ n(G, { nation: o.nation }),
1101
+ /* @__PURE__ */ n("span", { className: "pvx-comp-completed-badge-name", children: o.driverName })
1105
1102
  ] }, o.driverId || d)) })
1106
1103
  ] });
1107
1104
  }
1108
- function hn({ competitions: e, isLoading: n, onSelect: s, onRegister: r, className: a }) {
1109
- return n ? /* @__PURE__ */ t(F, { message: "Loading competitions..." }) : e != null && e.length ? /* @__PURE__ */ t("div", { className: `pvx-comp-grid ${a || ""}`, children: e.map((i) => /* @__PURE__ */ t(ut, { comp: i, onSelect: s, onRegister: r || s }, i.id)) }) : /* @__PURE__ */ t(P, { message: "No competitions available." });
1105
+ function ht({ competitions: e, isLoading: r, onSelect: t, onRegister: s, className: a }) {
1106
+ return r ? /* @__PURE__ */ n(E, { message: "Loading competitions..." }) : e != null && e.length ? /* @__PURE__ */ n("div", { className: `pvx-comp-grid ${a || ""}`, children: e.map((i) => /* @__PURE__ */ n(vn, { comp: i, onSelect: t, onRegister: s || t }, i.id)) }) : /* @__PURE__ */ n(P, { message: "No competitions available." });
1110
1107
  }
1111
- function ut({ comp: e, onSelect: n, onRegister: s }) {
1112
- var h, w, y;
1113
- const { cdnUrl: r } = k(), 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, g = /* @__PURE__ */ new Date(), f = (h = e.rounds) == null ? void 0 : h.find((C) => C.startTime && new Date(C.startTime) >= g), m = ((w = e.rounds) == null ? void 0 : w.length) || 0, b = ((y = e.rounds) == null ? void 0 : y.filter((C) => C.isFinalized).length) || 0, x = Te(e), v = x === "recently-completed" || x === "archived", N = e.type === "championship";
1108
+ function vn({ comp: e, onSelect: r, onRegister: t }) {
1109
+ var v, k, b;
1110
+ const { cdnUrl: s } = C(), 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, g = /* @__PURE__ */ new Date(), f = (v = e.rounds) == null ? void 0 : v.find((L) => L.startTime && new Date(L.startTime) >= g), m = ((k = e.rounds) == null ? void 0 : k.length) || 0, y = ((b = e.rounds) == null ? void 0 : b.filter((L) => L.isFinalized).length) || 0, x = Se(e), h = x === "recently-completed" || x === "archived", N = e.type === "championship";
1114
1111
  return /* @__PURE__ */ l(
1115
1112
  "div",
1116
1113
  {
1117
1114
  className: "pvx-comp-card",
1118
- onClick: () => n(e.id),
1115
+ onClick: () => r(e.id),
1119
1116
  role: "button",
1120
1117
  tabIndex: 0,
1121
- onKeyDown: (C) => {
1122
- (C.key === "Enter" || C.key === " ") && (C.preventDefault(), n(e.id));
1118
+ onKeyDown: (L) => {
1119
+ (L.key === "Enter" || L.key === " ") && (L.preventDefault(), r(e.id));
1123
1120
  },
1124
1121
  children: [
1125
- /* @__PURE__ */ t("div", { className: "pvx-comp-card-poster", children: a ? /* @__PURE__ */ t("img", { src: a, alt: e.name, className: "pvx-comp-card-poster-img" }) : /* @__PURE__ */ t("div", { className: "pvx-comp-card-poster-placeholder", children: /* @__PURE__ */ t(ht, {}) }) }),
1122
+ /* @__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(xn, {}) }) }),
1126
1123
  /* @__PURE__ */ l("div", { className: "pvx-comp-card-body", children: [
1127
- /* @__PURE__ */ t("h3", { className: "pvx-comp-card-title", children: e.name }),
1128
- e.description && /* @__PURE__ */ t("p", { className: "pvx-comp-card-desc", children: e.description }),
1124
+ /* @__PURE__ */ n("h3", { className: "pvx-comp-card-title", children: e.name }),
1125
+ e.description && /* @__PURE__ */ n("p", { className: "pvx-comp-card-desc", children: e.description }),
1129
1126
  /* @__PURE__ */ l("div", { className: "pvx-comp-card-pills", children: [
1130
- /* @__PURE__ */ t(at, { type: e.type }),
1131
- e.game && /* @__PURE__ */ t(J, { children: e.game.toUpperCase() }),
1132
- e.formatDescription && e.formatDescription.split(", ").map((C, S) => /* @__PURE__ */ t(J, { variant: "format", children: C }, S))
1127
+ /* @__PURE__ */ n(on, { type: e.type }),
1128
+ e.game && /* @__PURE__ */ n(J, { children: e.game.toUpperCase() }),
1129
+ e.formatDescription && e.formatDescription.split(", ").map((L, M) => /* @__PURE__ */ n(J, { variant: "format", children: L }, M))
1133
1130
  ] }),
1134
- e.carsDescription && /* @__PURE__ */ t("div", { className: "pvx-comp-card-pills", children: e.carsDescription.split(", ").map((C, S) => /* @__PURE__ */ t(J, { children: C }, S)) }),
1131
+ e.carsDescription && /* @__PURE__ */ n("div", { className: "pvx-comp-card-pills", children: e.carsDescription.split(", ").map((L, M) => /* @__PURE__ */ n(J, { children: L }, M)) }),
1135
1132
  /* @__PURE__ */ l("div", { className: "pvx-comp-card-schedule", children: [
1136
1133
  f ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
1137
- /* @__PURE__ */ t("span", { className: "pvx-comp-card-schedule-label", children: "Next:" }),
1134
+ /* @__PURE__ */ n("span", { className: "pvx-comp-card-schedule-label", children: "Next:" }),
1138
1135
  " ",
1139
1136
  e.type !== "hotlap" && `R${f.roundNumber} `,
1140
1137
  f.track || "TBD",
1141
1138
  " · ",
1142
- it(f.startTime)
1139
+ ln(f.startTime)
1143
1140
  ] }) : m > 0 ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
1144
- b,
1141
+ y,
1145
1142
  "/",
1146
1143
  m,
1147
1144
  " rounds completed"
@@ -1152,9 +1149,9 @@ function ut({ comp: e, onSelect: n, onRegister: s }) {
1152
1149
  m !== 1 ? "s" : ""
1153
1150
  ] })
1154
1151
  ] }),
1155
- v && N && /* @__PURE__ */ t(pt, { competitionId: e.id }),
1156
- i && !v && /* @__PURE__ */ t(
1157
- mt,
1152
+ h && N && /* @__PURE__ */ n(mn, { competitionId: e.id }),
1153
+ i && !h && /* @__PURE__ */ n(
1154
+ hn,
1158
1155
  {
1159
1156
  competitionId: e.id,
1160
1157
  regOpen: u,
@@ -1162,7 +1159,7 @@ function ut({ comp: e, onSelect: n, onRegister: s }) {
1162
1159
  deadlinePassed: c,
1163
1160
  regCount: o,
1164
1161
  regMax: d,
1165
- onRegister: s
1162
+ onRegister: t
1166
1163
  }
1167
1164
  )
1168
1165
  ] })
@@ -1170,16 +1167,16 @@ function ut({ comp: e, onSelect: n, onRegister: s }) {
1170
1167
  }
1171
1168
  );
1172
1169
  }
1173
- function mt({ competitionId: e, regOpen: n, isFull: s, deadlinePassed: r, regCount: a, regMax: i, onRegister: o }) {
1174
- const { isPowerMode: d } = te(), p = ne(e), { data: c } = ee(e), u = (c == null ? void 0 : c.isRegistered) || !1, g = i ? a / i * 100 : 0, f = g >= 100 ? "full" : g >= 75 ? "warning" : "ok";
1170
+ function hn({ competitionId: e, regOpen: r, isFull: t, deadlinePassed: s, regCount: a, regMax: i, onRegister: o }) {
1171
+ const { isPowerMode: d } = ne(), p = te(e), { data: c } = ee(e), u = (c == null ? void 0 : c.isRegistered) || !1, g = i ? a / i * 100 : 0, f = g >= 100 ? "full" : g >= 75 ? "warning" : "ok";
1175
1172
  return /* @__PURE__ */ l("div", { className: "pvx-comp-card-reg", children: [
1176
- /* @__PURE__ */ t("div", { className: "pvx-comp-card-reg-info", children: /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${f}`, children: [
1173
+ /* @__PURE__ */ n("div", { className: "pvx-comp-card-reg-info", children: /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${f}`, children: [
1177
1174
  a,
1178
1175
  "/",
1179
1176
  i || "∞",
1180
1177
  " drivers"
1181
1178
  ] }) }),
1182
- /* @__PURE__ */ t("div", { className: "pvx-comp-card-reg-action", children: u ? /* @__PURE__ */ t(
1179
+ /* @__PURE__ */ n("div", { className: "pvx-comp-card-reg-action", children: u ? /* @__PURE__ */ n(
1183
1180
  "button",
1184
1181
  {
1185
1182
  className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--registered",
@@ -1188,7 +1185,7 @@ function mt({ competitionId: e, regOpen: n, isFull: s, deadlinePassed: r, regCou
1188
1185
  },
1189
1186
  children: "✓ Registered"
1190
1187
  }
1191
- ) : n ? d ? /* @__PURE__ */ t(
1188
+ ) : r ? d ? /* @__PURE__ */ n(
1192
1189
  "button",
1193
1190
  {
1194
1191
  className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--open",
@@ -1197,7 +1194,7 @@ function mt({ competitionId: e, regOpen: n, isFull: s, deadlinePassed: r, regCou
1197
1194
  },
1198
1195
  children: "Register"
1199
1196
  }
1200
- ) : /* @__PURE__ */ t(
1197
+ ) : /* @__PURE__ */ n(
1201
1198
  "a",
1202
1199
  {
1203
1200
  href: p,
@@ -1207,45 +1204,45 @@ function mt({ competitionId: e, regOpen: n, isFull: s, deadlinePassed: r, regCou
1207
1204
  onClick: (m) => m.stopPropagation(),
1208
1205
  children: "Register"
1209
1206
  }
1210
- ) : /* @__PURE__ */ t("span", { className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--closed", children: s ? "Full" : "Closed" }) })
1207
+ ) : /* @__PURE__ */ n("span", { className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--closed", children: t ? "Full" : "Closed" }) })
1211
1208
  ] });
1212
1209
  }
1213
- function ht() {
1210
+ function xn() {
1214
1211
  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: [
1215
- /* @__PURE__ */ t("path", { d: "M6 9H4.5a2.5 2.5 0 0 1 0-5H6" }),
1216
- /* @__PURE__ */ t("path", { d: "M18 9h1.5a2.5 2.5 0 0 0 0-5H18" }),
1217
- /* @__PURE__ */ t("path", { d: "M4 22h16" }),
1218
- /* @__PURE__ */ t("path", { d: "M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22" }),
1219
- /* @__PURE__ */ t("path", { d: "M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22" }),
1220
- /* @__PURE__ */ t("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
1212
+ /* @__PURE__ */ n("path", { d: "M6 9H4.5a2.5 2.5 0 0 1 0-5H6" }),
1213
+ /* @__PURE__ */ n("path", { d: "M18 9h1.5a2.5 2.5 0 0 0 0-5H18" }),
1214
+ /* @__PURE__ */ n("path", { d: "M4 22h16" }),
1215
+ /* @__PURE__ */ n("path", { d: "M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22" }),
1216
+ /* @__PURE__ */ n("path", { d: "M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22" }),
1217
+ /* @__PURE__ */ n("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
1221
1218
  ] });
1222
1219
  }
1223
- function vt({ competitionId: e, className: n }) {
1220
+ function gn({ competitionId: e, className: r }) {
1224
1221
  var d, p;
1225
- const { data: s, isLoading: r } = ge(e), { data: a, isLoading: i } = xe(e);
1226
- if (r || i)
1227
- return /* @__PURE__ */ t(F, { message: "Loading standings..." });
1228
- if (!((d = s == null ? void 0 : s.standings) != null && d.length))
1229
- return /* @__PURE__ */ t(P, { message: "No standings data yet. Results will appear once rounds are finalised." });
1222
+ const { data: t, isLoading: s } = ge(e), { data: a, isLoading: i } = xe(e);
1223
+ if (s || i)
1224
+ return /* @__PURE__ */ n(E, { message: "Loading standings..." });
1225
+ if (!((d = t == null ? void 0 : t.standings) != null && d.length))
1226
+ return /* @__PURE__ */ n(P, { message: "No standings data yet. Results will appear once rounds are finalised." });
1230
1227
  const o = ((p = a == null ? void 0 : a.rounds) == null ? void 0 : p.filter((c) => c.isFinalized)) || [];
1231
- return /* @__PURE__ */ l("div", { className: `pvx-card ${n || ""}`, children: [
1232
- /* @__PURE__ */ t("div", { className: "pvx-card-header--split", children: /* @__PURE__ */ l("div", { className: "pvx-card-header-left", children: [
1233
- /* @__PURE__ */ t("h3", { className: "pvx-card-title", children: "Championship Standings" }),
1228
+ return /* @__PURE__ */ l("div", { className: `pvx-card ${r || ""}`, children: [
1229
+ /* @__PURE__ */ n("div", { className: "pvx-card-header--split", children: /* @__PURE__ */ l("div", { className: "pvx-card-header-left", children: [
1230
+ /* @__PURE__ */ n("h3", { className: "pvx-card-title", children: "Championship Standings" }),
1234
1231
  /* @__PURE__ */ l("span", { className: "pvx-standings-subtitle", children: [
1235
1232
  "After ",
1236
- s.roundsCompleted,
1233
+ t.roundsCompleted,
1237
1234
  " round",
1238
- s.roundsCompleted !== 1 ? "s" : "",
1239
- s.countingRounds > 0 && ` (best ${s.countingRounds} count)`
1235
+ t.roundsCompleted !== 1 ? "s" : "",
1236
+ t.countingRounds > 0 && ` (best ${t.countingRounds} count)`
1240
1237
  ] })
1241
1238
  ] }) }),
1242
- /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
1243
- /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
1244
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--narrow", children: "Pos" }),
1245
- /* @__PURE__ */ t("th", { className: "pvx-th", children: "Driver" }),
1246
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--center pvx-hidden-below-sm", children: "W" }),
1247
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--center pvx-hidden-below-sm", children: "Pod" }),
1248
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--center", children: "Points" }),
1239
+ /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
1240
+ /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
1241
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "Pos" }),
1242
+ /* @__PURE__ */ n("th", { className: "pvx-th", children: "Driver" }),
1243
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--center pvx-hidden-below-sm", children: "W" }),
1244
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--center pvx-hidden-below-sm", children: "Pod" }),
1245
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--center", children: "Points" }),
1249
1246
  o.map((c) => /* @__PURE__ */ l(
1250
1247
  "th",
1251
1248
  {
@@ -1259,8 +1256,8 @@ function vt({ competitionId: e, className: n }) {
1259
1256
  c.roundNumber
1260
1257
  ))
1261
1258
  ] }) }),
1262
- /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: s.standings.map((c) => /* @__PURE__ */ t(
1263
- xt,
1259
+ /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: t.standings.map((c) => /* @__PURE__ */ n(
1260
+ fn,
1264
1261
  {
1265
1262
  driver: c,
1266
1263
  finalizedRounds: o
@@ -1270,23 +1267,23 @@ function vt({ competitionId: e, className: n }) {
1270
1267
  ] }) })
1271
1268
  ] });
1272
1269
  }
1273
- function xt({ driver: e, finalizedRounds: n }) {
1270
+ function fn({ driver: e, finalizedRounds: r }) {
1274
1271
  var o, d, p;
1275
- const s = e.position <= 3, r = new Map(
1272
+ const t = e.position <= 3, s = new Map(
1276
1273
  ((o = e.roundResults) == null ? void 0 : o.map((c) => [c.roundNumber, c])) || []
1277
1274
  ), 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;
1278
- return /* @__PURE__ */ l("tr", { className: `pvx-row ${s ? "pvx-row--podium" : ""}`, children: [
1279
- /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t(oe, { position: e.position }) }),
1275
+ return /* @__PURE__ */ l("tr", { className: `pvx-row ${t ? "pvx-row--podium" : ""}`, children: [
1276
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(oe, { position: e.position }) }),
1280
1277
  /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
1281
- /* @__PURE__ */ t(Q, { nation: e.nation }),
1278
+ /* @__PURE__ */ n(G, { nation: e.nation }),
1282
1279
  e.driverName
1283
1280
  ] }),
1284
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: a || "-" }),
1285
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: i || "-" }),
1286
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-standings-total", children: e.totalPoints }),
1287
- n.map((c) => {
1288
- const u = r.get(c.roundNumber), g = u == null ? void 0 : u.dropped;
1289
- return /* @__PURE__ */ t(
1281
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: a || "-" }),
1282
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: i || "-" }),
1283
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-standings-total", children: e.totalPoints }),
1284
+ r.map((c) => {
1285
+ const u = s.get(c.roundNumber), g = u == null ? void 0 : u.dropped;
1286
+ return /* @__PURE__ */ n(
1290
1287
  "td",
1291
1288
  {
1292
1289
  className: `pvx-td pvx-td--center pvx-hidden-below-md ${!g && (u == null ? void 0 : u.position) === 1 ? "pvx-standings-cell--p1" : !g && (u == null ? void 0 : u.position) === 2 ? "pvx-standings-cell--p2" : !g && (u == null ? void 0 : u.position) === 3 ? "pvx-standings-cell--p3" : ""}`,
@@ -1295,92 +1292,92 @@ function xt({ driver: e, finalizedRounds: n }) {
1295
1292
  "P",
1296
1293
  u.position
1297
1294
  ] }),
1298
- /* @__PURE__ */ t("span", { className: "pvx-standings-round-pts", children: u.points })
1299
- ] }) : /* @__PURE__ */ t("span", { className: "pvx-td--muted", children: "-" })
1295
+ /* @__PURE__ */ n("span", { className: "pvx-standings-round-pts", children: u.points })
1296
+ ] }) : /* @__PURE__ */ n("span", { className: "pvx-td--muted", children: "-" })
1300
1297
  },
1301
1298
  c.roundNumber
1302
1299
  );
1303
1300
  })
1304
1301
  ] });
1305
1302
  }
1306
- function vn({ competitionId: e, roundNumber: n, className: s }) {
1303
+ function xt({ competitionId: e, roundNumber: r, className: t }) {
1307
1304
  var p;
1308
- const { data: r, isLoading: a } = Oe(e, n);
1305
+ const { data: s, isLoading: a } = ze(e, r);
1309
1306
  if (a)
1310
- return /* @__PURE__ */ t(F, { message: "Loading results..." });
1311
- if (!r)
1312
- return /* @__PURE__ */ t(P, { message: "No results for this round." });
1313
- 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);
1314
- return /* @__PURE__ */ l("div", { className: `pvx-round-results ${s || ""}`, children: [
1307
+ return /* @__PURE__ */ n(E, { message: "Loading results..." });
1308
+ if (!s)
1309
+ return /* @__PURE__ */ n(P, { message: "No results for this round." });
1310
+ 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);
1311
+ return /* @__PURE__ */ l("div", { className: `pvx-round-results ${t || ""}`, children: [
1315
1312
  /* @__PURE__ */ l("div", { className: "pvx-round-results-header", children: [
1316
1313
  /* @__PURE__ */ l("div", { children: [
1317
1314
  /* @__PURE__ */ l("h4", { className: "pvx-round-results-title", children: [
1318
1315
  "Round ",
1319
- r.roundNumber,
1320
- r.track ? `: ${r.track}` : ""
1316
+ s.roundNumber,
1317
+ s.track ? `: ${s.track}` : ""
1321
1318
  ] }),
1322
- r.startTime && /* @__PURE__ */ t("p", { className: "pvx-round-results-date", children: new Date(r.startTime).toLocaleDateString("en-GB", {
1319
+ s.startTime && /* @__PURE__ */ n("p", { className: "pvx-round-results-date", children: new Date(s.startTime).toLocaleDateString("en-GB", {
1323
1320
  day: "numeric",
1324
1321
  month: "long",
1325
1322
  year: "numeric"
1326
1323
  }) })
1327
1324
  ] }),
1328
- (d == null ? void 0 : d.length) > 0 && /* @__PURE__ */ t("div", { className: "pvx-round-podium-summary", children: d.map((c) => /* @__PURE__ */ l("span", { className: "pvx-round-podium-item", children: [
1329
- /* @__PURE__ */ t("span", { children: ae[c.position - 1] }),
1330
- /* @__PURE__ */ t("span", { children: c.driverName })
1325
+ (d == null ? void 0 : d.length) > 0 && /* @__PURE__ */ n("div", { className: "pvx-round-podium-summary", children: d.map((c) => /* @__PURE__ */ l("span", { className: "pvx-round-podium-item", children: [
1326
+ /* @__PURE__ */ n("span", { children: ae[c.position - 1] }),
1327
+ /* @__PURE__ */ n("span", { children: c.driverName })
1331
1328
  ] }, c.driverId)) })
1332
1329
  ] }),
1333
- /* @__PURE__ */ t(le, { round: r, competitionId: e })
1330
+ /* @__PURE__ */ n(le, { round: s, competitionId: e })
1334
1331
  ] });
1335
1332
  }
1336
- function le({ round: e, competitionId: n, className: s }) {
1333
+ function le({ round: e, competitionId: r, className: t }) {
1337
1334
  var u, g, f, m;
1338
- const [r, a] = D(null), i = (e == null ? void 0 : e.sessions) || [];
1335
+ const [s, a] = D(null), i = (e == null ? void 0 : e.sessions) || [];
1339
1336
  if (!i.length)
1340
- return /* @__PURE__ */ t(P, { message: "No session data for this round." });
1341
- const { data: o } = Ge(
1342
- n,
1337
+ return /* @__PURE__ */ n(P, { message: "No session data for this round." });
1338
+ const { data: o } = Ye(
1339
+ r,
1343
1340
  e == null ? void 0 : e.roundNumber,
1344
1341
  {}
1345
- ), d = r || ((u = i.find((b) => b.type === "RACE")) == null ? void 0 : u.type) || ((g = i[0]) == null ? void 0 : g.type), p = i.find((b) => b.type === d) || i[0], c = ((m = (f = o == null ? void 0 : o.sessions) == null ? void 0 : f.find((b) => b.type === d)) == null ? void 0 : m.drivers) || null;
1346
- return /* @__PURE__ */ l("div", { className: s || "", children: [
1347
- /* @__PURE__ */ t(
1348
- st,
1342
+ ), d = s || ((u = i.find((y) => y.type === "RACE")) == null ? void 0 : u.type) || ((g = i[0]) == null ? void 0 : g.type), p = i.find((y) => y.type === d) || i[0], c = ((m = (f = o == null ? void 0 : o.sessions) == null ? void 0 : f.find((y) => y.type === d)) == null ? void 0 : m.drivers) || null;
1343
+ return /* @__PURE__ */ l("div", { className: t || "", children: [
1344
+ /* @__PURE__ */ n(
1345
+ an,
1349
1346
  {
1350
1347
  sessions: i,
1351
1348
  activeSession: d,
1352
1349
  onSelect: a
1353
1350
  }
1354
1351
  ),
1355
- /* @__PURE__ */ t(gt, { session: p, sessionLaps: c })
1352
+ /* @__PURE__ */ n(Nn, { session: p, sessionLaps: c })
1356
1353
  ] });
1357
1354
  }
1358
- function gt({ session: e, sessionLaps: n }) {
1355
+ function Nn({ session: e, sessionLaps: r }) {
1359
1356
  var d;
1360
- const s = e.type === "RACE", [r, a] = D(null);
1357
+ const t = e.type === "RACE", [s, a] = D(null);
1361
1358
  if (!((d = e.results) != null && d.length))
1362
- return /* @__PURE__ */ t(P, { message: `No results for ${e.type}.` });
1363
- const i = ot(e.results), o = s ? 7 : 4;
1364
- return /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
1365
- /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
1366
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--narrow", children: "Pos" }),
1367
- /* @__PURE__ */ t("th", { className: "pvx-th", children: "Driver" }),
1368
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "Car" }),
1369
- /* @__PURE__ */ t("th", { className: "pvx-th", children: "Best Lap" }),
1370
- s && /* @__PURE__ */ l(U, { children: [
1371
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "Laps" }),
1372
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "Time / Gap" }),
1373
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--center", children: "Points" })
1359
+ return /* @__PURE__ */ n(P, { message: `No results for ${e.type}.` });
1360
+ const i = cn(e.results), o = t ? 7 : 4;
1361
+ return /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
1362
+ /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
1363
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "Pos" }),
1364
+ /* @__PURE__ */ n("th", { className: "pvx-th", children: "Driver" }),
1365
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Car" }),
1366
+ /* @__PURE__ */ n("th", { className: "pvx-th", children: "Best Lap" }),
1367
+ t && /* @__PURE__ */ l(F, { children: [
1368
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Laps" }),
1369
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Time / Gap" }),
1370
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--center", children: "Points" })
1374
1371
  ] })
1375
1372
  ] }) }),
1376
- /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: e.results.map((p, c) => {
1373
+ /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: e.results.map((p, c) => {
1377
1374
  var f;
1378
- const u = (f = n == null ? void 0 : n[p.driverId]) == null ? void 0 : f.laps, g = r === p.driverId && !!u;
1379
- return /* @__PURE__ */ t(
1380
- ft,
1375
+ const u = (f = r == null ? void 0 : r[p.driverId]) == null ? void 0 : f.laps, g = s === p.driverId && !!u;
1376
+ return /* @__PURE__ */ n(
1377
+ bn,
1381
1378
  {
1382
1379
  result: p,
1383
- isRace: s,
1380
+ isRace: t,
1384
1381
  fastestSplits: i,
1385
1382
  rowIndex: c,
1386
1383
  hasLapDetail: !!u,
@@ -1394,9 +1391,9 @@ function gt({ session: e, sessionLaps: n }) {
1394
1391
  }) })
1395
1392
  ] }) });
1396
1393
  }
1397
- function ft({ result: e, isRace: n, fastestSplits: s, rowIndex: r, hasLapDetail: a, isExpanded: i, onToggle: o, driverLaps: d, colCount: p }) {
1394
+ function bn({ result: e, isRace: r, fastestSplits: t, rowIndex: s, hasLapDetail: a, isExpanded: i, onToggle: o, driverLaps: d, colCount: p }) {
1398
1395
  const c = e.position <= 3;
1399
- return /* @__PURE__ */ l(U, { children: [
1396
+ return /* @__PURE__ */ l(F, { children: [
1400
1397
  /* @__PURE__ */ l(
1401
1398
  "tr",
1402
1399
  {
@@ -1404,32 +1401,32 @@ function ft({ result: e, isRace: n, fastestSplits: s, rowIndex: r, hasLapDetail:
1404
1401
  onClick: a ? o : void 0,
1405
1402
  style: a ? { cursor: "pointer" } : void 0,
1406
1403
  children: [
1407
- /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t(oe, { position: e.position }) }),
1404
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(oe, { position: e.position }) }),
1408
1405
  /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
1409
- /* @__PURE__ */ t(Q, { nation: e.nation }),
1406
+ /* @__PURE__ */ n(G, { nation: e.nation }),
1410
1407
  e.driverName,
1411
1408
  e.carNumber != null && /* @__PURE__ */ l("span", { className: "pvx-car-number", children: [
1412
1409
  "#",
1413
1410
  e.carNumber
1414
1411
  ] }),
1415
- e.penalty && /* @__PURE__ */ t("span", { className: "pvx-penalty", children: e.penalty })
1412
+ e.penalty && /* @__PURE__ */ n("span", { className: "pvx-penalty", children: e.penalty })
1416
1413
  ] }),
1417
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-hidden-below-sm", children: I(e.carId) }),
1418
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--mono", children: /* @__PURE__ */ t(
1419
- bt,
1414
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: I(e.carId) }),
1415
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono", children: /* @__PURE__ */ n(
1416
+ kn,
1420
1417
  {
1421
1418
  bestLap: e.bestLapFormatted,
1422
1419
  hasBestLap: e.hasBestLap,
1423
1420
  splits: e.splits,
1424
- fastestSplits: s,
1425
- showAbove: r <= 1
1421
+ fastestSplits: t,
1422
+ showAbove: s <= 1
1426
1423
  }
1427
1424
  ) }),
1428
- n && /* @__PURE__ */ l(U, { children: [
1429
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-hidden-below-sm", children: e.lapsCompleted }),
1430
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: e.position === 1 ? e.totalTime || "-" : e.gap || "-" }),
1425
+ r && /* @__PURE__ */ l(F, { children: [
1426
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: e.lapsCompleted }),
1427
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: e.position === 1 ? e.totalTime || "-" : e.gap || "-" }),
1431
1428
  /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--center", children: [
1432
- /* @__PURE__ */ t("span", { className: "pvx-session-points", children: e.points }),
1429
+ /* @__PURE__ */ n("span", { className: "pvx-session-points", children: e.points }),
1433
1430
  e.pointsOverride !== 0 && e.pointsOverride && /* @__PURE__ */ l("span", { className: "pvx-points-override", children: [
1434
1431
  "(",
1435
1432
  e.pointsOverride > 0 ? "+" : "",
@@ -1441,104 +1438,104 @@ function ft({ result: e, isRace: n, fastestSplits: s, rowIndex: r, hasLapDetail:
1441
1438
  ]
1442
1439
  }
1443
1440
  ),
1444
- i && d && /* @__PURE__ */ t("tr", { className: "pvx-row pvx-row--lap-detail", children: /* @__PURE__ */ t("td", { colSpan: p, className: "pvx-td pvx-td--lap-detail", children: /* @__PURE__ */ t(Nt, { laps: d }) }) })
1441
+ i && d && /* @__PURE__ */ n("tr", { className: "pvx-row pvx-row--lap-detail", children: /* @__PURE__ */ n("td", { colSpan: p, className: "pvx-td pvx-td--lap-detail", children: /* @__PURE__ */ n(yn, { laps: d }) }) })
1445
1442
  ] });
1446
1443
  }
1447
- function Nt({ laps: e }) {
1448
- const n = Math.min(...e.filter((s) => s.valid && s.timeMs > 0).map((s) => s.timeMs));
1444
+ function yn({ laps: e }) {
1445
+ const r = Math.min(...e.filter((t) => t.valid && t.timeMs > 0).map((t) => t.timeMs));
1449
1446
  return /* @__PURE__ */ l("table", { className: "pvx-table pvx-table--laps", children: [
1450
- /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
1451
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--narrow", children: "Lap" }),
1452
- /* @__PURE__ */ t("th", { className: "pvx-th", children: "Time" }),
1453
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
1454
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
1455
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" })
1447
+ /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
1448
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "Lap" }),
1449
+ /* @__PURE__ */ n("th", { className: "pvx-th", children: "Time" }),
1450
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
1451
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
1452
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" })
1456
1453
  ] }) }),
1457
- /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: e.map((s) => {
1454
+ /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: e.map((t) => {
1458
1455
  var a;
1459
- const r = s.valid && s.timeMs === n;
1460
- return /* @__PURE__ */ l("tr", { className: `pvx-row ${s.valid ? "" : "pvx-row--invalid"} ${r ? "pvx-row--fastest" : ""}`, children: [
1461
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--muted", children: s.lap }),
1462
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--mono", children: s.time }),
1463
- (s.splits || []).map((i, o) => /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: i }, o)),
1464
- Array.from({ length: Math.max(0, 3 - (((a = s.splits) == null ? void 0 : a.length) || 0)) }).map((i, o) => /* @__PURE__ */ t("td", { className: "pvx-td pvx-hidden-below-sm" }, `pad-${o}`))
1465
- ] }, s.lap);
1456
+ const s = t.valid && t.timeMs === r;
1457
+ return /* @__PURE__ */ l("tr", { className: `pvx-row ${t.valid ? "" : "pvx-row--invalid"} ${s ? "pvx-row--fastest" : ""}`, children: [
1458
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted", children: t.lap }),
1459
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono", children: t.time }),
1460
+ (t.splits || []).map((i, o) => /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: i }, o)),
1461
+ Array.from({ length: Math.max(0, 3 - (((a = t.splits) == null ? void 0 : a.length) || 0)) }).map((i, o) => /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm" }, `pad-${o}`))
1462
+ ] }, t.lap);
1466
1463
  }) })
1467
1464
  ] });
1468
1465
  }
1469
- function bt({ bestLap: e, hasBestLap: n, splits: s, fastestSplits: r, showAbove: a }) {
1470
- return e ? /* @__PURE__ */ l("span", { className: `pvx-best-lap-cell ${n ? "pvx-best-lap-cell--fastest" : ""}`, children: [
1471
- /* @__PURE__ */ t("span", { className: "pvx-best-lap-time", children: e }),
1472
- (s == null ? void 0 : s.length) > 0 && /* @__PURE__ */ t("span", { className: "pvx-splits-tooltip-anchor", children: /* @__PURE__ */ t("span", { className: `pvx-splits-tooltip ${a ? "" : "pvx-splits-tooltip--above"}`, children: s.map((i, o) => {
1473
- const d = r && i === r[o];
1466
+ function kn({ bestLap: e, hasBestLap: r, splits: t, fastestSplits: s, showAbove: a }) {
1467
+ return e ? /* @__PURE__ */ l("span", { className: `pvx-best-lap-cell ${r ? "pvx-best-lap-cell--fastest" : ""}`, children: [
1468
+ /* @__PURE__ */ n("span", { className: "pvx-best-lap-time", children: e }),
1469
+ (t == null ? void 0 : t.length) > 0 && /* @__PURE__ */ n("span", { className: "pvx-splits-tooltip-anchor", children: /* @__PURE__ */ n("span", { className: `pvx-splits-tooltip ${a ? "" : "pvx-splits-tooltip--above"}`, children: t.map((i, o) => {
1470
+ const d = s && i === s[o];
1474
1471
  return /* @__PURE__ */ l("span", { className: "pvx-splits-tooltip-row", children: [
1475
1472
  /* @__PURE__ */ l("span", { className: "pvx-splits-tooltip-label", children: [
1476
1473
  "S",
1477
1474
  o + 1
1478
1475
  ] }),
1479
- /* @__PURE__ */ t("span", { className: d ? "pvx-splits-tooltip-best" : "", children: i })
1476
+ /* @__PURE__ */ n("span", { className: d ? "pvx-splits-tooltip-best" : "", children: i })
1480
1477
  ] }, o);
1481
1478
  }) }) })
1482
- ] }) : /* @__PURE__ */ t("span", { className: "pvx-td--muted", children: "-" });
1479
+ ] }) : /* @__PURE__ */ n("span", { className: "pvx-td--muted", children: "-" });
1483
1480
  }
1484
- function xn({ competitionId: e, className: n }) {
1485
- const { getSteamId: s } = k(), { data: r, isLoading: a } = fe(e), i = s();
1481
+ function gt({ competitionId: e, className: r }) {
1482
+ const { getSteamId: t } = C(), { data: s, isLoading: a } = fe(e), i = t();
1486
1483
  if (a)
1487
- return /* @__PURE__ */ t(F, { message: "Loading drivers..." });
1488
- const o = (r == null ? void 0 : r.drivers) || (r == null ? void 0 : r.entries) || [];
1489
- return o.length ? /* @__PURE__ */ t("div", { className: `pvx-entry-grid ${n || ""}`, children: o.map((d) => {
1484
+ return /* @__PURE__ */ n(E, { message: "Loading drivers..." });
1485
+ const o = (s == null ? void 0 : s.drivers) || (s == null ? void 0 : s.entries) || [];
1486
+ return o.length ? /* @__PURE__ */ n("div", { className: `pvx-entry-grid ${r || ""}`, children: o.map((d) => {
1490
1487
  var c, u;
1491
1488
  const p = i && d.steamId === i;
1492
1489
  return /* @__PURE__ */ l("div", { className: `pvx-entry-card ${p ? "pvx-entry-card--you" : ""}`, children: [
1493
- d.avatarUrl ? /* @__PURE__ */ t(
1490
+ d.avatarUrl ? /* @__PURE__ */ n(
1494
1491
  "img",
1495
1492
  {
1496
1493
  src: d.avatarUrl,
1497
1494
  alt: "",
1498
1495
  className: "pvx-entry-avatar"
1499
1496
  }
1500
- ) : /* @__PURE__ */ t("div", { className: "pvx-entry-avatar pvx-entry-avatar--placeholder", children: ((u = (c = d.displayName) == null ? void 0 : c.charAt(0)) == null ? void 0 : u.toUpperCase()) || "?" }),
1497
+ ) : /* @__PURE__ */ n("div", { className: "pvx-entry-avatar pvx-entry-avatar--placeholder", children: ((u = (c = d.displayName) == null ? void 0 : c.charAt(0)) == null ? void 0 : u.toUpperCase()) || "?" }),
1501
1498
  /* @__PURE__ */ l("span", { className: "pvx-entry-name", children: [
1502
1499
  d.displayName,
1503
- p && /* @__PURE__ */ t("span", { className: "pvx-entry-you", children: " (you)" })
1500
+ p && /* @__PURE__ */ n("span", { className: "pvx-entry-you", children: " (you)" })
1504
1501
  ] })
1505
1502
  ] }, d.steamId || d.driverId);
1506
- }) }) : /* @__PURE__ */ t(P, { message: "No drivers registered yet." });
1503
+ }) }) : /* @__PURE__ */ n(P, { message: "No drivers registered yet." });
1507
1504
  }
1508
- function gn({
1505
+ function ft({
1509
1506
  competitionId: e,
1510
- driverData: n,
1511
- className: s,
1512
- children: r
1507
+ driverData: r,
1508
+ className: t,
1509
+ children: s
1513
1510
  }) {
1514
- const { data: a, isLoading: i } = ee(e), { isPowerMode: o } = te(), d = ne(e), p = Ne(e), c = be(e), u = (a == null ? void 0 : a.isRegistered) || !1, g = i || p.isPending || c.isPending, f = p.error || c.error || null, m = () => {
1515
- o && p.mutate(n || {});
1516
- }, b = () => {
1511
+ const { data: a, isLoading: i } = ee(e), { isPowerMode: o } = ne(), d = te(e), p = Ne(e), c = be(e), u = (a == null ? void 0 : a.isRegistered) || !1, g = i || p.isPending || c.isPending, f = p.error || c.error || null, m = () => {
1512
+ o && p.mutate(r || {});
1513
+ }, y = () => {
1517
1514
  o && c.mutate();
1518
1515
  };
1519
- return typeof r == "function" ? r({ isRegistered: u, isLoading: g, register: m, withdraw: b, error: f, isPowerMode: o, registrationUrl: d }) : o ? /* @__PURE__ */ t(
1516
+ return typeof s == "function" ? s({ isRegistered: u, isLoading: g, register: m, withdraw: y, error: f, isPowerMode: o, registrationUrl: d }) : o ? /* @__PURE__ */ n(
1520
1517
  "button",
1521
1518
  {
1522
- className: `pvx-comp-register-btn ${s || ""}`,
1523
- onClick: u ? b : m,
1519
+ className: `pvx-comp-register-btn ${t || ""}`,
1520
+ onClick: u ? y : m,
1524
1521
  disabled: g,
1525
1522
  children: g ? "Loading..." : u ? "Withdraw" : "Register"
1526
1523
  }
1527
- ) : /* @__PURE__ */ t(
1524
+ ) : /* @__PURE__ */ n(
1528
1525
  "a",
1529
1526
  {
1530
1527
  href: d,
1531
1528
  target: "_blank",
1532
1529
  rel: "noopener noreferrer",
1533
- className: `pvx-comp-register-link ${s || ""}`,
1530
+ className: `pvx-comp-register-link ${t || ""}`,
1534
1531
  children: u ? "View Registration" : "Register on PitVox"
1535
1532
  }
1536
1533
  );
1537
1534
  }
1538
- function fn({ competitionId: e, registration: n, onWithdrawSuccess: s, className: r }) {
1539
- const { getSteamId: a } = k(), { isPowerMode: i } = te(), o = ne(e), { data: d, isLoading: p } = ee(e), { data: c, isLoading: u } = fe(e), g = Ne(e), f = be(e), m = a(), b = (d == null ? void 0 : d.isRegistered) || !1, x = (c == null ? void 0 : c.drivers) || (c == null ? void 0 : c.entries) || [], v = n || {}, N = x.length || v.currentCount || 0, h = v.maxParticipants && N >= v.maxParticipants, w = v.deadline && new Date(v.deadline) < /* @__PURE__ */ new Date(), y = v.isOpen && !w && !h;
1540
- return p || u ? /* @__PURE__ */ t(F, { message: "Loading registration..." }) : b ? /* @__PURE__ */ t("div", { className: `pvx-reg-panel ${r || ""}`, children: /* @__PURE__ */ t(
1541
- wt,
1535
+ function Nt({ competitionId: e, registration: r, onWithdrawSuccess: t, className: s }) {
1536
+ const { getSteamId: a } = C(), { isPowerMode: i } = ne(), o = te(e), { data: d, isLoading: p } = ee(e), { data: c, isLoading: u } = fe(e), g = Ne(e), f = be(e), m = a(), y = (d == null ? void 0 : d.isRegistered) || !1, x = (c == null ? void 0 : c.drivers) || (c == null ? void 0 : c.entries) || [], h = r || {}, N = x.length || h.currentCount || 0, v = h.maxParticipants && N >= h.maxParticipants, k = h.deadline && new Date(h.deadline) < /* @__PURE__ */ new Date(), b = h.isOpen && !k && !v;
1537
+ return p || u ? /* @__PURE__ */ n(E, { message: "Loading registration..." }) : y ? /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: /* @__PURE__ */ n(
1538
+ Cn,
1542
1539
  {
1543
1540
  competitionId: e,
1544
1541
  drivers: x,
@@ -1546,54 +1543,54 @@ function fn({ competitionId: e, registration: n, onWithdrawSuccess: s, className
1546
1543
  isPowerMode: i,
1547
1544
  registrationUrl: o,
1548
1545
  withdrawMutation: f,
1549
- onWithdrawSuccess: s,
1550
- registration: v
1546
+ onWithdrawSuccess: t,
1547
+ registration: h
1551
1548
  }
1552
- ) }) : y ? m ? i ? /* @__PURE__ */ t("div", { className: `pvx-reg-panel ${r || ""}`, children: /* @__PURE__ */ t(
1553
- yt,
1549
+ ) }) : b ? m ? i ? /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: /* @__PURE__ */ n(
1550
+ wn,
1554
1551
  {
1555
1552
  competitionId: e,
1556
1553
  registerMutation: g,
1557
- registration: v
1554
+ registration: h
1558
1555
  }
1559
- ) }) : /* @__PURE__ */ t("div", { className: `pvx-reg-panel ${r || ""}`, children: /* @__PURE__ */ t("a", { href: o, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Register on PitVox" }) }) : /* @__PURE__ */ t("div", { className: `pvx-reg-panel ${r || ""}`, children: i ? /* @__PURE__ */ t("div", { className: "pvx-reg-status-msg", children: "Sign in to register for this competition." }) : /* @__PURE__ */ t("div", { className: "pvx-reg-status-msg", children: /* @__PURE__ */ t("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: [
1560
- /* @__PURE__ */ t("div", { className: "pvx-reg-status-msg", children: h ? "Registration is full." : w ? "Registration deadline has passed." : "Registration is closed." }),
1561
- x.length > 0 && /* @__PURE__ */ t(Re, { drivers: x, steamId: m })
1556
+ ) }) : /* @__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: [
1557
+ /* @__PURE__ */ n("div", { className: "pvx-reg-status-msg", children: v ? "Registration is full." : k ? "Registration deadline has passed." : "Registration is closed." }),
1558
+ x.length > 0 && /* @__PURE__ */ n(Te, { drivers: x, steamId: m })
1562
1559
  ] });
1563
1560
  }
1564
- function yt({ competitionId: e, registerMutation: n, registration: s }) {
1565
- const [r, a] = D(""), [i, o] = D("intermediate"), [d, p] = D(""), c = (m) => {
1566
- m.preventDefault(), n.mutate({
1567
- discordUsername: r || void 0,
1561
+ function wn({ competitionId: e, registerMutation: r, registration: t }) {
1562
+ const [s, a] = D(""), [i, o] = D("intermediate"), [d, p] = D(""), c = (m) => {
1563
+ m.preventDefault(), r.mutate({
1564
+ discordUsername: s || void 0,
1568
1565
  experience: i,
1569
1566
  comments: d || void 0
1570
1567
  });
1571
- }, u = s || {}, g = u.currentCount || 0, f = u.maxParticipants;
1568
+ }, u = t || {}, g = u.currentCount || 0, f = u.maxParticipants;
1572
1569
  return /* @__PURE__ */ l("form", { className: "pvx-reg-form", onSubmit: c, children: [
1573
1570
  /* @__PURE__ */ l("div", { className: "pvx-reg-form-header", children: [
1574
- /* @__PURE__ */ t("h3", { className: "pvx-reg-form-title", children: "Register" }),
1575
- f && /* @__PURE__ */ t($e, { count: g, max: f })
1571
+ /* @__PURE__ */ n("h3", { className: "pvx-reg-form-title", children: "Register" }),
1572
+ f && /* @__PURE__ */ n(Re, { count: g, max: f })
1576
1573
  ] }),
1577
- n.error && /* @__PURE__ */ t("div", { className: "pvx-reg-error", children: n.error.message || "Registration failed" }),
1574
+ r.error && /* @__PURE__ */ n("div", { className: "pvx-reg-error", children: r.error.message || "Registration failed" }),
1578
1575
  /* @__PURE__ */ l("div", { className: "pvx-reg-field", children: [
1579
1576
  /* @__PURE__ */ l("label", { className: "pvx-reg-label", htmlFor: `pvx-discord-${e}`, children: [
1580
1577
  "Discord Username ",
1581
- /* @__PURE__ */ t("span", { className: "pvx-reg-optional", children: "(optional)" })
1578
+ /* @__PURE__ */ n("span", { className: "pvx-reg-optional", children: "(optional)" })
1582
1579
  ] }),
1583
- /* @__PURE__ */ t(
1580
+ /* @__PURE__ */ n(
1584
1581
  "input",
1585
1582
  {
1586
1583
  id: `pvx-discord-${e}`,
1587
1584
  type: "text",
1588
1585
  className: "pvx-reg-input",
1589
1586
  placeholder: "e.g. username",
1590
- value: r,
1587
+ value: s,
1591
1588
  onChange: (m) => a(m.target.value)
1592
1589
  }
1593
1590
  )
1594
1591
  ] }),
1595
1592
  /* @__PURE__ */ l("div", { className: "pvx-reg-field", children: [
1596
- /* @__PURE__ */ t("label", { className: "pvx-reg-label", htmlFor: `pvx-exp-${e}`, children: "Experience Level" }),
1593
+ /* @__PURE__ */ n("label", { className: "pvx-reg-label", htmlFor: `pvx-exp-${e}`, children: "Experience Level" }),
1597
1594
  /* @__PURE__ */ l(
1598
1595
  "select",
1599
1596
  {
@@ -1602,9 +1599,9 @@ function yt({ competitionId: e, registerMutation: n, registration: s }) {
1602
1599
  value: i,
1603
1600
  onChange: (m) => o(m.target.value),
1604
1601
  children: [
1605
- /* @__PURE__ */ t("option", { value: "beginner", children: "Beginner" }),
1606
- /* @__PURE__ */ t("option", { value: "intermediate", children: "Intermediate" }),
1607
- /* @__PURE__ */ t("option", { value: "advanced", children: "Advanced" })
1602
+ /* @__PURE__ */ n("option", { value: "beginner", children: "Beginner" }),
1603
+ /* @__PURE__ */ n("option", { value: "intermediate", children: "Intermediate" }),
1604
+ /* @__PURE__ */ n("option", { value: "advanced", children: "Advanced" })
1608
1605
  ]
1609
1606
  }
1610
1607
  )
@@ -1612,9 +1609,9 @@ function yt({ competitionId: e, registerMutation: n, registration: s }) {
1612
1609
  /* @__PURE__ */ l("div", { className: "pvx-reg-field", children: [
1613
1610
  /* @__PURE__ */ l("label", { className: "pvx-reg-label", htmlFor: `pvx-comments-${e}`, children: [
1614
1611
  "Comments ",
1615
- /* @__PURE__ */ t("span", { className: "pvx-reg-optional", children: "(optional)" })
1612
+ /* @__PURE__ */ n("span", { className: "pvx-reg-optional", children: "(optional)" })
1616
1613
  ] }),
1617
- /* @__PURE__ */ t(
1614
+ /* @__PURE__ */ n(
1618
1615
  "textarea",
1619
1616
  {
1620
1617
  id: `pvx-comments-${e}`,
@@ -1626,36 +1623,36 @@ function yt({ competitionId: e, registerMutation: n, registration: s }) {
1626
1623
  }
1627
1624
  )
1628
1625
  ] }),
1629
- /* @__PURE__ */ t("div", { className: "pvx-reg-actions", children: /* @__PURE__ */ t(
1626
+ /* @__PURE__ */ n("div", { className: "pvx-reg-actions", children: /* @__PURE__ */ n(
1630
1627
  "button",
1631
1628
  {
1632
1629
  type: "submit",
1633
1630
  className: "pvx-comp-register-btn",
1634
- disabled: n.isPending,
1635
- children: n.isPending ? "Registering..." : "Register"
1631
+ disabled: r.isPending,
1632
+ children: r.isPending ? "Registering..." : "Register"
1636
1633
  }
1637
1634
  ) })
1638
1635
  ] });
1639
1636
  }
1640
- function wt({ competitionId: e, drivers: n, steamId: s, isPowerMode: r, registrationUrl: a, withdrawMutation: i, onWithdrawSuccess: o, registration: d }) {
1637
+ function Cn({ competitionId: e, drivers: r, steamId: t, isPowerMode: s, registrationUrl: a, withdrawMutation: i, onWithdrawSuccess: o, registration: d }) {
1641
1638
  const [p, c] = D(!1), u = () => {
1642
1639
  i.mutate(void 0, {
1643
1640
  onSuccess: () => {
1644
1641
  c(!1), o && o();
1645
1642
  }
1646
1643
  });
1647
- }, g = d || {}, f = n.length || g.currentCount || 0, m = g.maxParticipants;
1648
- return /* @__PURE__ */ l(U, { children: [
1644
+ }, g = d || {}, f = r.length || g.currentCount || 0, m = g.maxParticipants;
1645
+ return /* @__PURE__ */ l(F, { children: [
1649
1646
  /* @__PURE__ */ l("div", { className: "pvx-reg-form-header", children: [
1650
- /* @__PURE__ */ t("h3", { className: "pvx-reg-form-title", children: "Registered Drivers" }),
1651
- m && /* @__PURE__ */ t($e, { count: f, max: m })
1647
+ /* @__PURE__ */ n("h3", { className: "pvx-reg-form-title", children: "Registered Drivers" }),
1648
+ m && /* @__PURE__ */ n(Re, { count: f, max: m })
1652
1649
  ] }),
1653
- /* @__PURE__ */ t(Re, { drivers: n, steamId: s }),
1654
- i.error && /* @__PURE__ */ t("div", { className: "pvx-reg-error", children: i.error.message || "Withdrawal failed" }),
1655
- r ? /* @__PURE__ */ t("div", { className: "pvx-reg-actions", children: p ? /* @__PURE__ */ l("div", { className: "pvx-reg-confirm", children: [
1656
- /* @__PURE__ */ t("p", { className: "pvx-reg-confirm-text", children: "Are you sure you want to unregister?" }),
1650
+ /* @__PURE__ */ n(Te, { drivers: r, steamId: t }),
1651
+ i.error && /* @__PURE__ */ n("div", { className: "pvx-reg-error", children: i.error.message || "Withdrawal failed" }),
1652
+ s ? /* @__PURE__ */ n("div", { className: "pvx-reg-actions", children: p ? /* @__PURE__ */ l("div", { className: "pvx-reg-confirm", children: [
1653
+ /* @__PURE__ */ n("p", { className: "pvx-reg-confirm-text", children: "Are you sure you want to unregister?" }),
1657
1654
  /* @__PURE__ */ l("div", { className: "pvx-reg-confirm-actions", children: [
1658
- /* @__PURE__ */ t(
1655
+ /* @__PURE__ */ n(
1659
1656
  "button",
1660
1657
  {
1661
1658
  type: "button",
@@ -1664,7 +1661,7 @@ function wt({ competitionId: e, drivers: n, steamId: s, isPowerMode: r, registra
1664
1661
  children: "Cancel"
1665
1662
  }
1666
1663
  ),
1667
- /* @__PURE__ */ t(
1664
+ /* @__PURE__ */ n(
1668
1665
  "button",
1669
1666
  {
1670
1667
  type: "button",
@@ -1675,7 +1672,7 @@ function wt({ competitionId: e, drivers: n, steamId: s, isPowerMode: r, registra
1675
1672
  }
1676
1673
  )
1677
1674
  ] })
1678
- ] }) : /* @__PURE__ */ t(
1675
+ ] }) : /* @__PURE__ */ n(
1679
1676
  "button",
1680
1677
  {
1681
1678
  type: "button",
@@ -1683,104 +1680,104 @@ function wt({ competitionId: e, drivers: n, steamId: s, isPowerMode: r, registra
1683
1680
  onClick: () => c(!0),
1684
1681
  children: "Unregister"
1685
1682
  }
1686
- ) }) : /* @__PURE__ */ t("div", { className: "pvx-reg-actions", children: /* @__PURE__ */ t("a", { href: a, target: "_blank", rel: "noopener noreferrer", className: "pvx-comp-register-link", children: "Manage on PitVox" }) })
1683
+ ) }) : /* @__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" }) })
1687
1684
  ] });
1688
1685
  }
1689
- function Re({ drivers: e, steamId: n }) {
1686
+ function Te({ drivers: e, steamId: r }) {
1690
1687
  if (!e.length)
1691
- return /* @__PURE__ */ t("div", { className: "pvx-reg-no-drivers", children: "No drivers registered yet." });
1692
- const s = [...e].sort((r, a) => {
1693
- const i = n && r.steamId === n ? -1 : 0, o = n && a.steamId === n ? -1 : 0;
1688
+ return /* @__PURE__ */ n("div", { className: "pvx-reg-no-drivers", children: "No drivers registered yet." });
1689
+ const t = [...e].sort((s, a) => {
1690
+ const i = r && s.steamId === r ? -1 : 0, o = r && a.steamId === r ? -1 : 0;
1694
1691
  return i - o;
1695
1692
  });
1696
- return /* @__PURE__ */ t("div", { className: "pvx-reg-driver-list", children: s.map((r) => {
1693
+ return /* @__PURE__ */ n("div", { className: "pvx-reg-driver-list", children: t.map((s) => {
1697
1694
  var i, o;
1698
- const a = n && r.steamId === n;
1695
+ const a = r && s.steamId === r;
1699
1696
  return /* @__PURE__ */ l(
1700
1697
  "div",
1701
1698
  {
1702
1699
  className: `pvx-reg-driver-row ${a ? "pvx-reg-driver-row--you" : ""}`,
1703
1700
  children: [
1704
- r.avatarUrl ? /* @__PURE__ */ t("img", { src: r.avatarUrl, alt: "", className: "pvx-reg-driver-avatar" }) : /* @__PURE__ */ t("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()) || "?" }),
1701
+ 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()) || "?" }),
1705
1702
  /* @__PURE__ */ l("span", { className: "pvx-reg-driver-name", children: [
1706
- r.displayName,
1707
- a && /* @__PURE__ */ t("span", { className: "pvx-entry-you", children: " (you)" })
1703
+ s.displayName,
1704
+ a && /* @__PURE__ */ n("span", { className: "pvx-entry-you", children: " (you)" })
1708
1705
  ] })
1709
1706
  ]
1710
1707
  },
1711
- r.steamId || r.driverId
1708
+ s.steamId || s.driverId
1712
1709
  );
1713
1710
  }) });
1714
1711
  }
1715
- function $e({ count: e, max: n }) {
1716
- const s = n ? e / n * 100 : 0, r = s >= 100 ? "full" : s >= 75 ? "warning" : "ok";
1717
- return /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${r}`, children: [
1712
+ function Re({ count: e, max: r }) {
1713
+ const t = r ? e / r * 100 : 0, s = t >= 100 ? "full" : t >= 75 ? "warning" : "ok";
1714
+ return /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${s}`, children: [
1718
1715
  e,
1719
1716
  "/",
1720
- n,
1717
+ r,
1721
1718
  " drivers"
1722
1719
  ] });
1723
1720
  }
1724
- function Nn({ competitionId: e, className: n }) {
1725
- const { data: s, isLoading: r } = xe(e), a = (s == null ? void 0 : s.type) === "championship", i = (s == null ? void 0 : s.type) === "hotlap", { data: o } = ze(i ? e : null), d = L(
1721
+ function bt({ competitionId: e, className: r }) {
1722
+ const { data: t, isLoading: s } = xe(e), a = (t == null ? void 0 : t.type) === "championship", i = (t == null ? void 0 : t.type) === "hotlap", { data: o } = Ge(i ? e : null), d = S(
1726
1723
  () => {
1727
- var y;
1728
- return ((y = s == null ? void 0 : s.rounds) == null ? void 0 : y.filter((C) => C.isFinalized)) || [];
1724
+ var b;
1725
+ return ((b = t == null ? void 0 : t.rounds) == null ? void 0 : b.filter((L) => L.isFinalized)) || [];
1729
1726
  },
1730
- [s]
1731
- ), p = L(
1732
- () => d.map((y) => y.roundNumber),
1727
+ [t]
1728
+ ), p = S(
1729
+ () => d.map((b) => b.roundNumber),
1733
1730
  [d]
1734
- ), { data: c = [], isLoading: u } = We(
1731
+ ), { data: c = [], isLoading: u } = Qe(
1735
1732
  e,
1736
1733
  p
1737
- ), g = i && c.length > 0 ? c[0] : null, f = (g == null ? void 0 : g.sessions) || [], m = i ? "leaderboard" : a ? "standings" : p.length > 0 ? `round-${p[p.length - 1]}` : null, [b, x] = D(null), v = b || m;
1738
- if (r || u)
1739
- return /* @__PURE__ */ t(F, { message: "Loading results..." });
1740
- if (!s)
1741
- return /* @__PURE__ */ t(P, { message: "Competition not found." });
1734
+ ), g = i && c.length > 0 ? c[0] : null, f = (g == null ? void 0 : g.sessions) || [], m = i ? "leaderboard" : a ? "standings" : p.length > 0 ? `round-${p[p.length - 1]}` : null, [y, x] = D(null), h = y || m;
1735
+ if (s || u)
1736
+ return /* @__PURE__ */ n(E, { message: "Loading results..." });
1737
+ if (!t)
1738
+ return /* @__PURE__ */ n(P, { message: "Competition not found." });
1742
1739
  if (!d.length)
1743
- return /* @__PURE__ */ t(P, { message: "No results available yet. Results will appear here once rounds are finalised." });
1744
- const N = new Map(c.map((y) => [`round-${y.roundNumber}`, y])), h = [];
1745
- if (a && h.push({ id: "standings", label: "Standings" }), i) {
1746
- h.push({ id: "leaderboard", label: "Leaderboard" });
1747
- for (const y of f)
1748
- h.push({ id: `session-${y.type}`, label: ie(y.type) });
1740
+ return /* @__PURE__ */ n(P, { message: "No results available yet. Results will appear here once rounds are finalised." });
1741
+ const N = new Map(c.map((b) => [`round-${b.roundNumber}`, b])), v = [];
1742
+ if (a && v.push({ id: "standings", label: "Standings" }), i) {
1743
+ v.push({ id: "leaderboard", label: "Leaderboard" });
1744
+ for (const b of f)
1745
+ v.push({ id: `session-${b.type}`, label: ie(b.type) });
1749
1746
  } else
1750
- for (const y of d)
1751
- h.push({
1752
- id: `round-${y.roundNumber}`,
1753
- label: `R${y.roundNumber}`,
1747
+ for (const b of d)
1748
+ v.push({
1749
+ id: `round-${b.roundNumber}`,
1750
+ label: `R${b.roundNumber}`,
1754
1751
  track: null
1755
1752
  });
1756
- const w = N.get(v);
1757
- return /* @__PURE__ */ l("div", { className: n || "", children: [
1758
- /* @__PURE__ */ t("div", { className: "pvx-results-tabs", children: h.map((y) => /* @__PURE__ */ l(
1753
+ const k = N.get(h);
1754
+ return /* @__PURE__ */ l("div", { className: r || "", children: [
1755
+ /* @__PURE__ */ n("div", { className: "pvx-results-tabs", children: v.map((b) => /* @__PURE__ */ l(
1759
1756
  "button",
1760
1757
  {
1761
- className: `pvx-results-tab ${v === y.id ? "pvx-results-tab--active" : ""}`,
1762
- onClick: () => x(y.id),
1763
- title: y.track || void 0,
1758
+ className: `pvx-results-tab ${h === b.id ? "pvx-results-tab--active" : ""}`,
1759
+ onClick: () => x(b.id),
1760
+ title: b.track || void 0,
1764
1761
  children: [
1765
- /* @__PURE__ */ t("span", { className: "pvx-results-tab-label", children: y.label }),
1766
- y.track && /* @__PURE__ */ t("span", { className: "pvx-results-tab-track", children: y.track })
1762
+ /* @__PURE__ */ n("span", { className: "pvx-results-tab-label", children: b.label }),
1763
+ b.track && /* @__PURE__ */ n("span", { className: "pvx-results-tab-track", children: b.track })
1767
1764
  ]
1768
1765
  },
1769
- y.id
1766
+ b.id
1770
1767
  )) }),
1771
- v === "standings" ? /* @__PURE__ */ t(vt, { competitionId: e }) : v === "leaderboard" ? /* @__PURE__ */ t(Ct, { leaderboard: o, config: s }) : v != null && v.startsWith("session-") ? /* @__PURE__ */ t(
1772
- Lt,
1768
+ h === "standings" ? /* @__PURE__ */ n(gn, { competitionId: e }) : h === "leaderboard" ? /* @__PURE__ */ n(Sn, { leaderboard: o, config: t }) : h != null && h.startsWith("session-") ? /* @__PURE__ */ n(
1769
+ Tn,
1773
1770
  {
1774
- session: f.find((y) => `session-${y.type}` === v),
1771
+ session: f.find((b) => `session-${b.type}` === h),
1775
1772
  round: g,
1776
1773
  competitionId: e
1777
1774
  }
1778
- ) : w ? /* @__PURE__ */ t(kt, { round: w, competitionId: e }) : /* @__PURE__ */ t(P, { message: "No results for this round." })
1775
+ ) : k ? /* @__PURE__ */ n(Ln, { round: k, competitionId: e }) : /* @__PURE__ */ n(P, { message: "No results for this round." })
1779
1776
  ] });
1780
1777
  }
1781
- function kt({ round: e, competitionId: n }) {
1778
+ function Ln({ round: e, competitionId: r }) {
1782
1779
  var i;
1783
- 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);
1780
+ 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);
1784
1781
  return /* @__PURE__ */ l("div", { className: "pvx-card", children: [
1785
1782
  /* @__PURE__ */ l("div", { className: "pvx-card-header--split", children: [
1786
1783
  /* @__PURE__ */ l("div", { children: [
@@ -1789,25 +1786,25 @@ function kt({ round: e, competitionId: n }) {
1789
1786
  e.roundNumber,
1790
1787
  e.track ? `: ${e.track}` : ""
1791
1788
  ] }),
1792
- e.startTime && /* @__PURE__ */ t("span", { className: "pvx-standings-subtitle", children: new Date(e.startTime).toLocaleDateString("en-GB", {
1789
+ e.startTime && /* @__PURE__ */ n("span", { className: "pvx-standings-subtitle", children: new Date(e.startTime).toLocaleDateString("en-GB", {
1793
1790
  day: "numeric",
1794
1791
  month: "long",
1795
1792
  year: "numeric"
1796
1793
  }) })
1797
1794
  ] }),
1798
- (a == null ? void 0 : a.length) > 0 && /* @__PURE__ */ t("div", { className: "pvx-round-podium-summary", children: a.map((o) => /* @__PURE__ */ l("span", { className: "pvx-round-podium-item", children: [
1799
- /* @__PURE__ */ t("span", { children: ae[o.position - 1] }),
1800
- /* @__PURE__ */ t("span", { children: o.driverName })
1795
+ (a == null ? void 0 : a.length) > 0 && /* @__PURE__ */ n("div", { className: "pvx-round-podium-summary", children: a.map((o) => /* @__PURE__ */ l("span", { className: "pvx-round-podium-item", children: [
1796
+ /* @__PURE__ */ n("span", { children: ae[o.position - 1] }),
1797
+ /* @__PURE__ */ n("span", { children: o.driverName })
1801
1798
  ] }, o.driverId)) })
1802
1799
  ] }),
1803
- /* @__PURE__ */ t(le, { round: e, competitionId: n })
1800
+ /* @__PURE__ */ n(le, { round: e, competitionId: r })
1804
1801
  ] });
1805
1802
  }
1806
- function Ct({ leaderboard: e, config: n }) {
1807
- var s;
1808
- return (s = e == null ? void 0 : e.drivers) != null && s.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
1809
- /* @__PURE__ */ t("div", { className: "pvx-card-header--split", children: /* @__PURE__ */ l("div", { children: [
1810
- /* @__PURE__ */ t("h4", { className: "pvx-card-title", children: e.track || (n == null ? void 0 : n.name) || "Hotlap Leaderboard" }),
1803
+ function Sn({ leaderboard: e, config: r }) {
1804
+ var t;
1805
+ return (t = e == null ? void 0 : e.drivers) != null && t.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
1806
+ /* @__PURE__ */ n("div", { className: "pvx-card-header--split", children: /* @__PURE__ */ l("div", { children: [
1807
+ /* @__PURE__ */ n("h4", { className: "pvx-card-title", children: e.track || (r == null ? void 0 : r.name) || "Hotlap Leaderboard" }),
1811
1808
  /* @__PURE__ */ l("span", { className: "pvx-standings-subtitle", children: [
1812
1809
  e.sessionsCompleted,
1813
1810
  " session",
@@ -1815,203 +1812,211 @@ function Ct({ leaderboard: e, config: n }) {
1815
1812
  " completed"
1816
1813
  ] })
1817
1814
  ] }) }),
1818
- /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
1819
- /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
1820
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--narrow", children: "Pos" }),
1821
- /* @__PURE__ */ t("th", { className: "pvx-th", children: "Driver" }),
1822
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "Car" }),
1823
- /* @__PURE__ */ t("th", { className: "pvx-th", children: "Best Lap" }),
1824
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "Laps" }),
1825
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "Sessions" }),
1826
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "Gap" })
1815
+ /* @__PURE__ */ n("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
1816
+ /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
1817
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-th--narrow", children: "Pos" }),
1818
+ /* @__PURE__ */ n("th", { className: "pvx-th", children: "Driver" }),
1819
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Car" }),
1820
+ /* @__PURE__ */ n("th", { className: "pvx-th", children: "Best Lap" }),
1821
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Laps" }),
1822
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Sessions" }),
1823
+ /* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-sm", children: "Gap" })
1827
1824
  ] }) }),
1828
- /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: e.drivers.map((r) => {
1829
- const a = r.position === 1 ? "" : `+${((r.bestLapMs - e.drivers[0].bestLapMs) / 1e3).toFixed(3)}`;
1830
- return /* @__PURE__ */ l("tr", { className: `pvx-row ${r.position <= 3 ? "pvx-row--podium" : ""}`, children: [
1831
- /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t(oe, { position: r.position }) }),
1825
+ /* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: e.drivers.map((s) => {
1826
+ const a = s.position === 1 ? "" : `+${((s.bestLapMs - e.drivers[0].bestLapMs) / 1e3).toFixed(3)}`;
1827
+ return /* @__PURE__ */ l("tr", { className: `pvx-row ${s.position <= 3 ? "pvx-row--podium" : ""}`, children: [
1828
+ /* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(oe, { position: s.position }) }),
1832
1829
  /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
1833
- /* @__PURE__ */ t(Q, { nation: r.nation }),
1834
- r.driverName
1830
+ /* @__PURE__ */ n(G, { nation: s.nation }),
1831
+ s.driverName
1835
1832
  ] }),
1836
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-hidden-below-sm", children: I(r.carId) }),
1837
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--mono", children: /* @__PURE__ */ t("span", { className: r.position === 1 ? "pvx-best-lap-cell--fastest" : "", children: r.bestLapFormatted }) }),
1838
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-hidden-below-sm", children: r.totalLaps }),
1839
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-hidden-below-sm", children: r.sessionsParticipated }),
1840
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: a })
1841
- ] }, r.driverId);
1833
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: I(s.carId) }),
1834
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono", children: /* @__PURE__ */ n("span", { className: s.position === 1 ? "pvx-best-lap-cell--fastest" : "", children: s.bestLapFormatted }) }),
1835
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: s.totalLaps }),
1836
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-sm", children: s.sessionsParticipated }),
1837
+ /* @__PURE__ */ n("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: a })
1838
+ ] }, s.driverId);
1842
1839
  }) })
1843
1840
  ] }) })
1844
- ] }) : /* @__PURE__ */ t(P, { message: "No lap times recorded yet." });
1841
+ ] }) : /* @__PURE__ */ n(P, { message: "No lap times recorded yet." });
1845
1842
  }
1846
- function Lt({ session: e, round: n, competitionId: s }) {
1843
+ function Tn({ session: e, round: r, competitionId: t }) {
1847
1844
  return e ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
1848
- /* @__PURE__ */ t("div", { className: "pvx-card-header", children: /* @__PURE__ */ t("h4", { className: "pvx-card-title", children: ie(e.type) }) }),
1849
- /* @__PURE__ */ t(
1845
+ /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ n("h4", { className: "pvx-card-title", children: ie(e.type) }) }),
1846
+ /* @__PURE__ */ n(
1850
1847
  le,
1851
1848
  {
1852
- round: { ...n, sessions: [e] },
1853
- competitionId: s
1849
+ round: { ...r, sessions: [e] },
1850
+ competitionId: t
1854
1851
  }
1855
1852
  )
1856
- ] }) : /* @__PURE__ */ t(P, { message: "Session data not available." });
1853
+ ] }) : /* @__PURE__ */ n(P, { message: "Session data not available." });
1857
1854
  }
1858
- function St(e) {
1859
- const { cdnUrl: n } = k(), s = T({
1855
+ function Rn(e) {
1856
+ const { cdnUrl: r } = C(), t = T({
1860
1857
  queryKey: ["pitvox", "laps", "global", e, "index"],
1861
- queryFn: () => R(n, qe(null, e)),
1858
+ queryFn: () => R(r, Ve(null, e)),
1862
1859
  enabled: !!e,
1863
1860
  staleTime: 3e4,
1864
1861
  refetchInterval: 3e4
1865
- }), r = s.data;
1862
+ }), s = t.data;
1866
1863
  return {
1867
- isLoading: s.isLoading,
1868
- error: s.error,
1869
- data: r ? {
1870
- driverName: r.driverName || "Driver",
1871
- lapCount: r.lapCount || 0,
1872
- trackBreakdown: r.trackBreakdown || [],
1873
- carBreakdown: r.carBreakdown || [],
1874
- recordsHeld: r.recordsHeld || 0,
1875
- currentRecords: r.currentRecords || [],
1876
- bestRanking: r.bestRanking ?? null,
1877
- bestRankingTrackId: r.bestRankingTrackId ?? null,
1878
- bestRankingLayout: r.bestRankingLayout ?? null,
1879
- bestRankingCarId: r.bestRankingCarId ?? null,
1880
- generatedAt: r.generatedAt
1864
+ isLoading: t.isLoading,
1865
+ error: t.error,
1866
+ data: s ? {
1867
+ driverName: s.driverName || "Driver",
1868
+ lapCount: s.lapCount || 0,
1869
+ trackBreakdown: s.trackBreakdown || [],
1870
+ carBreakdown: s.carBreakdown || [],
1871
+ recordsHeld: s.recordsHeld || 0,
1872
+ currentRecords: s.currentRecords || [],
1873
+ bestRanking: s.bestRanking ?? null,
1874
+ bestRankingTrackId: s.bestRankingTrackId ?? null,
1875
+ bestRankingLayout: s.bestRankingLayout ?? null,
1876
+ bestRankingCarId: s.bestRankingCarId ?? null,
1877
+ generatedAt: s.generatedAt
1881
1878
  } : null
1882
1879
  };
1883
1880
  }
1884
- function Me(e = {}) {
1885
- const { cdnUrl: n, partnerSlug: s } = k(), { game: r, gameVersion: a, enabled: i = !0 } = e, o = X(s, r, a, "ratings.json");
1881
+ function $e(e = {}) {
1882
+ const { cdnUrl: r, partnerSlug: t } = C(), { game: s, gameVersion: a, enabled: i = !0 } = e, o = X(t, s, a, "ratings.json");
1886
1883
  return T({
1887
- queryKey: ["pitvox", "ratings", s, r || null, a || null],
1888
- queryFn: () => R(n, o),
1884
+ queryKey: ["pitvox", "ratings", t, s || null, a || null],
1885
+ queryFn: () => R(r, o),
1889
1886
  staleTime: 3e4,
1890
1887
  refetchInterval: 3e4,
1891
1888
  enabled: i
1892
1889
  });
1893
1890
  }
1894
- function Tt(e) {
1895
- var r;
1896
- const n = Me(), s = L(() => {
1891
+ function $n(e) {
1892
+ var s;
1893
+ const r = $e(), t = S(() => {
1897
1894
  var a;
1898
- return !((a = n.data) != null && a.drivers) || !e ? null : n.data.drivers.find(
1895
+ return !((a = r.data) != null && a.drivers) || !e ? null : r.data.drivers.find(
1899
1896
  (i) => i.identifier === e
1900
1897
  ) || null;
1901
- }, [(r = n.data) == null ? void 0 : r.drivers, e]);
1898
+ }, [(s = r.data) == null ? void 0 : s.drivers, e]);
1902
1899
  return {
1903
- isLoading: n.isLoading,
1904
- error: n.error,
1905
- data: s ? {
1906
- rating: s.rating,
1907
- rank: s.rank,
1908
- totalDrivers: n.data.driverCount || n.data.drivers.length,
1909
- comboCount: s.comboCount || 0,
1910
- distinctCars: s.distinctCars || 0,
1911
- combos: s.combos || []
1900
+ isLoading: r.isLoading,
1901
+ error: r.error,
1902
+ data: t ? {
1903
+ rating: t.rating,
1904
+ rank: t.rank,
1905
+ totalDrivers: r.data.driverCount || r.data.drivers.length,
1906
+ comboCount: t.comboCount || 0,
1907
+ distinctCars: t.distinctCars || 0,
1908
+ combos: t.combos || []
1912
1909
  } : null
1913
1910
  };
1914
1911
  }
1915
- function bn(e = {}) {
1916
- const n = Me(e);
1912
+ function yt(e = {}) {
1913
+ const r = $e(e);
1917
1914
  return {
1918
- data: n.data || null,
1919
- isLoading: n.isLoading,
1920
- error: n.error
1915
+ data: r.data || null,
1916
+ isLoading: r.isLoading,
1917
+ error: r.error
1921
1918
  };
1922
1919
  }
1923
- function Rt() {
1924
- const { cdnUrl: e, partnerSlug: n, getSteamId: s, onFetchServerPassword: r } = k(), a = s(), { data: i, isLoading: o } = T({
1925
- queryKey: ["pitvox", "competitions", n],
1920
+ function Mn() {
1921
+ const { cdnUrl: e, partnerSlug: r, getSteamId: t, onFetchServerPassword: s } = C(), a = t(), { data: i, isLoading: o } = T({
1922
+ queryKey: ["pitvox", "competitions", r],
1926
1923
  queryFn: async () => {
1927
1924
  const m = await R(e, "competitions/index.json");
1928
- return m != null && m.competitions ? m.competitions.filter((b) => b.partnerSlug === n) : [];
1925
+ return m != null && m.competitions ? m.competitions.filter((y) => y.partnerSlug === r) : [];
1929
1926
  },
1930
1927
  staleTime: 6e4
1931
1928
  }), d = (i == null ? void 0 : i.map((m) => m.id)) || [], p = ce({
1932
1929
  queries: d.map((m) => ({
1933
- queryKey: ["pitvox", "competition", n, m, "entrylist"],
1934
- queryFn: () => R(e, `competitions/${n}/${m}/entrylist.json`),
1930
+ queryKey: ["pitvox", "competition", r, m, "entrylist"],
1931
+ queryFn: () => R(e, `competitions/${r}/${m}/entrylist.json`),
1935
1932
  enabled: !!a && d.length > 0,
1936
1933
  staleTime: 6e4
1937
1934
  }))
1938
- }), c = p.some((m) => m.isLoading), u = L(() => {
1939
- var x, v;
1935
+ }), c = p.some((m) => m.isLoading), u = S(() => {
1936
+ var x, h;
1940
1937
  if (!i || !a || c) return [];
1941
- const m = /* @__PURE__ */ new Date(), b = [];
1938
+ const m = /* @__PURE__ */ new Date(), y = [];
1942
1939
  for (let N = 0; N < i.length; N++) {
1943
- const h = i[N], w = (x = p[N]) == null ? void 0 : x.data;
1944
- if (!((v = w == null ? void 0 : w.drivers) == null ? void 0 : v.some((S) => S.steamId === a))) continue;
1945
- const C = h.rounds || [];
1946
- for (const S of C)
1947
- S.isFinalized || !S.startTime || new Date(S.startTime) <= m || b.push({
1948
- competitionId: h.id,
1949
- competitionName: h.name,
1950
- roundNumber: S.roundNumber,
1951
- track: S.track || "TBD",
1952
- startTime: S.startTime
1940
+ const v = i[N], k = (x = p[N]) == null ? void 0 : x.data;
1941
+ if (!((h = k == null ? void 0 : k.drivers) == null ? void 0 : h.some((w) => w.steamId === a))) continue;
1942
+ const L = v.type === "hotlap", M = v.rounds || [];
1943
+ for (const w of M) {
1944
+ if (w.isFinalized && (!L || w.dediStatus === "completed")) continue;
1945
+ const A = w.dediStatus === "running" || w.dediStatus === "provisioning", Me = w.dediStatus === "scheduled", De = w.startTime && new Date(w.startTime) > m, Ie = A || Me || w.dediServerAddress;
1946
+ !A && !De && !Ie || y.push({
1947
+ competitionId: v.id,
1948
+ competitionName: v.name,
1949
+ roundNumber: w.roundNumber,
1950
+ track: w.track || "TBD",
1951
+ startTime: w.startTime,
1952
+ dediStatus: w.dediStatus || null,
1953
+ dediServerAddress: w.dediServerAddress || null
1953
1954
  });
1955
+ }
1954
1956
  }
1955
- return b.sort((N, h) => new Date(N.startTime) - new Date(h.startTime)), b.length > 0 && (b[0].isNext = !0), b;
1957
+ return y.sort((N, v) => {
1958
+ const k = N.dediStatus === "running" || N.dediStatus === "provisioning", b = v.dediStatus === "running" || v.dediStatus === "provisioning";
1959
+ return k && !b ? -1 : !k && b ? 1 : new Date(N.startTime) - new Date(v.startTime);
1960
+ }), y.length > 0 && (y[0].isNext = !0), y;
1956
1961
  }, [i, a, c, p]), g = ce({
1957
1962
  queries: u.map((m) => ({
1958
1963
  queryKey: ["pitvox", "serverInfo", m.competitionId, m.roundNumber],
1959
- queryFn: () => r(m.competitionId, m.roundNumber),
1960
- enabled: !!r && u.length > 0,
1964
+ queryFn: () => s(m.competitionId, m.roundNumber),
1965
+ enabled: !!s && u.length > 0,
1961
1966
  staleTime: 5 * 6e4,
1962
1967
  // 5 minutes
1963
1968
  retry: !1
1964
1969
  }))
1965
1970
  });
1966
1971
  return {
1967
- data: L(() => u.length ? r ? u.map((m, b) => {
1968
- var v;
1969
- const x = (v = g[b]) == null ? void 0 : v.data;
1972
+ data: S(() => u.length ? s ? u.map((m, y) => {
1973
+ var h;
1974
+ const x = (h = g[y]) == null ? void 0 : h.data;
1970
1975
  return x != null && x.success ? {
1971
1976
  ...m,
1972
1977
  serverAddress: x.serverAddress || null,
1973
1978
  serverPassword: x.serverPassword || null
1974
1979
  } : m;
1975
- }) : u : [], [u, r, g]),
1980
+ }) : u : [], [u, s, g]),
1976
1981
  isLoading: o || !!a && c
1977
1982
  };
1978
1983
  }
1979
- function $t() {
1980
- const { onFetchNotifications: e } = k();
1984
+ function Dn() {
1985
+ const { onFetchNotifications: e } = C();
1981
1986
  return !!e;
1982
1987
  }
1983
- function Mt(e = {}) {
1984
- const { onFetchNotifications: n, partnerSlug: s } = k(), { limit: r = 20, unreadOnly: a = !1 } = e;
1988
+ function In(e = {}) {
1989
+ const { onFetchNotifications: r, partnerSlug: t } = C(), { limit: s = 20, unreadOnly: a = !1 } = e;
1985
1990
  return T({
1986
- queryKey: ["pitvox", "notifications", s, { limit: r, unreadOnly: a }],
1987
- queryFn: () => n({ limit: r, unreadOnly: a }),
1988
- enabled: !!n,
1991
+ queryKey: ["pitvox", "notifications", t, { limit: s, unreadOnly: a }],
1992
+ queryFn: () => r({ limit: s, unreadOnly: a }),
1993
+ enabled: !!r,
1989
1994
  staleTime: 3e4,
1990
1995
  refetchInterval: 3e4
1991
1996
  });
1992
1997
  }
1993
- function yn() {
1994
- const { onFetchNotifications: e, partnerSlug: n } = k(), { data: s, isLoading: r } = T({
1995
- queryKey: ["pitvox", "notifications", n, { limit: 1, unreadOnly: !1 }],
1998
+ function kt() {
1999
+ const { onFetchNotifications: e, partnerSlug: r } = C(), { data: t, isLoading: s } = T({
2000
+ queryKey: ["pitvox", "notifications", r, { limit: 1, unreadOnly: !1 }],
1996
2001
  queryFn: () => e({ limit: 1 }),
1997
2002
  enabled: !!e,
1998
2003
  staleTime: 3e4,
1999
2004
  refetchInterval: 3e4,
2000
2005
  select: (a) => (a == null ? void 0 : a.unreadCount) ?? 0
2001
2006
  });
2002
- return { count: s ?? 0, isLoading: r };
2007
+ return { count: t ?? 0, isLoading: s };
2003
2008
  }
2004
- function Dt() {
2005
- const { onMarkNotificationRead: e, partnerSlug: n } = k(), s = _();
2006
- return O({
2007
- mutationFn: (r) => {
2009
+ function Pn() {
2010
+ const { onMarkNotificationRead: e, partnerSlug: r } = C(), t = q();
2011
+ return W({
2012
+ mutationFn: (s) => {
2008
2013
  if (!e)
2009
2014
  throw new Error("No onMarkNotificationRead callback provided to PitVoxPartnerProvider.");
2010
- return e(r);
2015
+ return e(s);
2011
2016
  },
2012
- onSuccess: (r, a) => {
2013
- s.setQueriesData(
2014
- { queryKey: ["pitvox", "notifications", n] },
2017
+ onSuccess: (s, a) => {
2018
+ t.setQueriesData(
2019
+ { queryKey: ["pitvox", "notifications", r] },
2015
2020
  (i) => i != null && i.notifications ? {
2016
2021
  ...i,
2017
2022
  unreadCount: Math.max(0, (i.unreadCount || 0) - 1),
@@ -2023,36 +2028,36 @@ function Dt() {
2023
2028
  }
2024
2029
  });
2025
2030
  }
2026
- function It() {
2027
- const { onMarkAllNotificationsRead: e, partnerSlug: n } = k(), s = _();
2028
- return O({
2031
+ function Bn() {
2032
+ const { onMarkAllNotificationsRead: e, partnerSlug: r } = C(), t = q();
2033
+ return W({
2029
2034
  mutationFn: () => {
2030
2035
  if (!e)
2031
2036
  throw new Error("No onMarkAllNotificationsRead callback provided to PitVoxPartnerProvider.");
2032
2037
  return e();
2033
2038
  },
2034
2039
  onSuccess: () => {
2035
- s.setQueriesData(
2036
- { queryKey: ["pitvox", "notifications", n] },
2037
- (r) => r != null && r.notifications ? {
2038
- ...r,
2040
+ t.setQueriesData(
2041
+ { queryKey: ["pitvox", "notifications", r] },
2042
+ (s) => s != null && s.notifications ? {
2043
+ ...s,
2039
2044
  unreadCount: 0,
2040
- notifications: r.notifications.map((a) => ({
2045
+ notifications: s.notifications.map((a) => ({
2041
2046
  ...a,
2042
2047
  isRead: !0,
2043
2048
  readAt: a.readAt || (/* @__PURE__ */ new Date()).toISOString()
2044
2049
  }))
2045
- } : r
2050
+ } : s
2046
2051
  );
2047
2052
  }
2048
2053
  });
2049
2054
  }
2050
- function Pt({ driverName: e, avatarUrl: n, memberSince: s, className: r = "" }) {
2051
- const a = s ? new Date(s).toLocaleDateString("en-GB", { day: "2-digit", month: "2-digit", year: "numeric" }) : null;
2052
- return /* @__PURE__ */ l("div", { className: `pvx-card pvx-dash-profile ${r}`, children: [
2053
- n ? /* @__PURE__ */ t("img", { src: n, alt: "", className: "pvx-dash-profile-avatar" }) : /* @__PURE__ */ t("div", { className: "pvx-dash-profile-avatar pvx-dash-profile-avatar--placeholder", children: (e || "?")[0].toUpperCase() }),
2055
+ function An({ driverName: e, avatarUrl: r, memberSince: t, className: s = "" }) {
2056
+ const a = t ? new Date(t).toLocaleDateString("en-GB", { day: "2-digit", month: "2-digit", year: "numeric" }) : null;
2057
+ return /* @__PURE__ */ l("div", { className: `pvx-card pvx-dash-profile ${s}`, children: [
2058
+ r ? /* @__PURE__ */ n("img", { src: r, alt: "", className: "pvx-dash-profile-avatar" }) : /* @__PURE__ */ n("div", { className: "pvx-dash-profile-avatar pvx-dash-profile-avatar--placeholder", children: (e || "?")[0].toUpperCase() }),
2054
2059
  /* @__PURE__ */ l("div", { className: "pvx-dash-profile-info", children: [
2055
- /* @__PURE__ */ t("h2", { className: "pvx-dash-profile-name", children: e }),
2060
+ /* @__PURE__ */ n("h2", { className: "pvx-dash-profile-name", children: e }),
2056
2061
  a && /* @__PURE__ */ l("p", { className: "pvx-dash-profile-since", children: [
2057
2062
  "Racing since ",
2058
2063
  a
@@ -2060,36 +2065,36 @@ function Pt({ driverName: e, avatarUrl: n, memberSince: s, className: r = "" })
2060
2065
  ] })
2061
2066
  ] });
2062
2067
  }
2063
- function Bt() {
2068
+ function Un() {
2064
2069
  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: [
2065
- /* @__PURE__ */ t("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
2066
- /* @__PURE__ */ t("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
2067
- /* @__PURE__ */ t("line", { x1: "10", y1: "3", x2: "8", y2: "21" }),
2068
- /* @__PURE__ */ t("line", { x1: "16", y1: "3", x2: "14", y2: "21" })
2070
+ /* @__PURE__ */ n("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
2071
+ /* @__PURE__ */ n("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
2072
+ /* @__PURE__ */ n("line", { x1: "10", y1: "3", x2: "8", y2: "21" }),
2073
+ /* @__PURE__ */ n("line", { x1: "16", y1: "3", x2: "14", y2: "21" })
2069
2074
  ] });
2070
2075
  }
2071
- function At() {
2076
+ function Fn() {
2072
2077
  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: [
2073
- /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10" }),
2074
- /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "2" }),
2075
- /* @__PURE__ */ t("path", { d: "M12 14v4" }),
2076
- /* @__PURE__ */ t("path", { d: "M10.5 12.5l-4 2.5" }),
2077
- /* @__PURE__ */ t("path", { d: "M13.5 12.5l4 2.5" })
2078
+ /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "10" }),
2079
+ /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "2" }),
2080
+ /* @__PURE__ */ n("path", { d: "M12 14v4" }),
2081
+ /* @__PURE__ */ n("path", { d: "M10.5 12.5l-4 2.5" }),
2082
+ /* @__PURE__ */ n("path", { d: "M13.5 12.5l4 2.5" })
2078
2083
  ] });
2079
2084
  }
2080
- function Ut() {
2081
- return /* @__PURE__ */ t("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ t("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" }) });
2085
+ function En() {
2086
+ 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" }) });
2082
2087
  }
2083
- function pe({ icon: e, value: n, label: s, items: r, labelKey: a, countKey: i }) {
2084
- const [o, d] = D(!1), p = Pe(null);
2085
- Be(() => {
2088
+ function pe({ icon: e, value: r, label: t, items: s, labelKey: a, countKey: i }) {
2089
+ const [o, d] = D(!1), p = Ae(null);
2090
+ Ue(() => {
2086
2091
  if (!o) return;
2087
2092
  function u(g) {
2088
2093
  p.current && !p.current.contains(g.target) && d(!1);
2089
2094
  }
2090
2095
  return document.addEventListener("mousedown", u), () => document.removeEventListener("mousedown", u);
2091
2096
  }, [o]);
2092
- const c = r != null && r.length ? r.slice().sort((u, g) => g[i] - u[i]) : null;
2097
+ const c = s != null && s.length ? s.slice().sort((u, g) => g[i] - u[i]) : null;
2093
2098
  return /* @__PURE__ */ l(
2094
2099
  "div",
2095
2100
  {
@@ -2099,42 +2104,42 @@ function pe({ icon: e, value: n, label: s, items: r, labelKey: a, countKey: i })
2099
2104
  children: [
2100
2105
  e,
2101
2106
  /* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
2102
- /* @__PURE__ */ t("span", { className: "pvx-dash-stat-value", children: n }),
2103
- /* @__PURE__ */ t("span", { className: "pvx-dash-stat-label", children: s })
2107
+ /* @__PURE__ */ n("span", { className: "pvx-dash-stat-value", children: r }),
2108
+ /* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children: t })
2104
2109
  ] }),
2105
- c && /* @__PURE__ */ t("div", { className: `pvx-dash-tooltip pvx-dash-tooltip--scrollable ${o ? "pvx-dash-tooltip--open" : ""}`, children: c.map((u, g) => /* @__PURE__ */ l("div", { className: "pvx-dash-tooltip-row", children: [
2106
- /* @__PURE__ */ t("span", { className: "pvx-dash-tooltip-label", children: u[a] }),
2107
- /* @__PURE__ */ t("span", { className: "pvx-dash-tooltip-value", children: u[i] })
2110
+ c && /* @__PURE__ */ n("div", { className: `pvx-dash-tooltip pvx-dash-tooltip--scrollable ${o ? "pvx-dash-tooltip--open" : ""}`, children: c.map((u, g) => /* @__PURE__ */ l("div", { className: "pvx-dash-tooltip-row", children: [
2111
+ /* @__PURE__ */ n("span", { className: "pvx-dash-tooltip-label", children: u[a] }),
2112
+ /* @__PURE__ */ n("span", { className: "pvx-dash-tooltip-value", children: u[i] })
2108
2113
  ] }, g)) })
2109
2114
  ]
2110
2115
  }
2111
2116
  );
2112
2117
  }
2113
- function Ft({ stats: e, rating: n, className: s = "" }) {
2118
+ function qn({ stats: e, rating: r, className: t = "" }) {
2114
2119
  if (!e) return null;
2115
- const r = e.trackBreakdown.map((i) => ({
2116
- name: q(i.trackId, i.layout),
2120
+ const s = e.trackBreakdown.map((i) => ({
2121
+ name: j(i.trackId, i.layout),
2117
2122
  lapCount: i.lapCount
2118
2123
  })), a = e.carBreakdown.map((i) => ({
2119
2124
  name: I(i.carId),
2120
2125
  lapCount: i.lapCount
2121
2126
  }));
2122
- return /* @__PURE__ */ l("div", { className: `pvx-dash-stats ${s}`, children: [
2123
- /* @__PURE__ */ t(
2127
+ return /* @__PURE__ */ l("div", { className: `pvx-dash-stats ${t}`, children: [
2128
+ /* @__PURE__ */ n(
2124
2129
  pe,
2125
2130
  {
2126
- icon: /* @__PURE__ */ t(Bt, {}),
2131
+ icon: /* @__PURE__ */ n(Un, {}),
2127
2132
  value: e.lapCount.toLocaleString(),
2128
2133
  label: "Total Laps",
2129
- items: r,
2134
+ items: s,
2130
2135
  labelKey: "name",
2131
2136
  countKey: "lapCount"
2132
2137
  }
2133
2138
  ),
2134
- /* @__PURE__ */ t(
2139
+ /* @__PURE__ */ n(
2135
2140
  pe,
2136
2141
  {
2137
- icon: /* @__PURE__ */ t(At, {}),
2142
+ icon: /* @__PURE__ */ n(Fn, {}),
2138
2143
  value: e.carBreakdown.length,
2139
2144
  label: "Cars Used",
2140
2145
  items: a,
@@ -2142,67 +2147,67 @@ function Ft({ stats: e, rating: n, className: s = "" }) {
2142
2147
  countKey: "lapCount"
2143
2148
  }
2144
2149
  ),
2145
- n && /* @__PURE__ */ l("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--rating", children: [
2146
- /* @__PURE__ */ t(Ut, {}),
2150
+ r && /* @__PURE__ */ l("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--rating", children: [
2151
+ /* @__PURE__ */ n(En, {}),
2147
2152
  /* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
2148
- /* @__PURE__ */ t("span", { className: "pvx-dash-stat-value", children: n.rating.toFixed(1) }),
2149
- /* @__PURE__ */ t("span", { className: "pvx-dash-stat-label", children: "Driver Rating" }),
2153
+ /* @__PURE__ */ n("span", { className: "pvx-dash-stat-value", children: r.rating.toFixed(1) }),
2154
+ /* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children: "Driver Rating" }),
2150
2155
  /* @__PURE__ */ l("span", { className: "pvx-dash-stat-sub", children: [
2151
2156
  "#",
2152
- n.rank,
2157
+ r.rank,
2153
2158
  " of ",
2154
- n.totalDrivers
2159
+ r.totalDrivers
2155
2160
  ] })
2156
2161
  ] })
2157
2162
  ] })
2158
2163
  ] });
2159
2164
  }
2160
- function Et({ records: e, className: n = "" }) {
2161
- const s = L(() => e != null && e.length ? e.slice().sort((r, a) => {
2162
- const i = r.recordedAt ? new Date(r.recordedAt).getTime() : 0;
2165
+ function jn({ records: e, className: r = "" }) {
2166
+ const t = S(() => e != null && e.length ? e.slice().sort((s, a) => {
2167
+ const i = s.recordedAt ? new Date(s.recordedAt).getTime() : 0;
2163
2168
  return (a.recordedAt ? new Date(a.recordedAt).getTime() : 0) - i;
2164
2169
  }) : [], [e]);
2165
- return s.length ? /* @__PURE__ */ l("div", { className: `pvx-card ${n}`, children: [
2166
- /* @__PURE__ */ t("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
2167
- /* @__PURE__ */ t("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: [
2168
- /* @__PURE__ */ t("path", { d: "M6 9H4.5a2.5 2.5 0 010-5H6" }),
2169
- /* @__PURE__ */ t("path", { d: "M18 9h1.5a2.5 2.5 0 000-5H18" }),
2170
- /* @__PURE__ */ t("path", { d: "M4 22h16" }),
2171
- /* @__PURE__ */ t("path", { d: "M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20 7 22" }),
2172
- /* @__PURE__ */ t("path", { d: "M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20 17 22" }),
2173
- /* @__PURE__ */ t("path", { d: "M18 2H6v7a6 6 0 0012 0V2z" })
2170
+ return t.length ? /* @__PURE__ */ l("div", { className: `pvx-card ${r}`, children: [
2171
+ /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
2172
+ /* @__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: [
2173
+ /* @__PURE__ */ n("path", { d: "M6 9H4.5a2.5 2.5 0 010-5H6" }),
2174
+ /* @__PURE__ */ n("path", { d: "M18 9h1.5a2.5 2.5 0 000-5H18" }),
2175
+ /* @__PURE__ */ n("path", { d: "M4 22h16" }),
2176
+ /* @__PURE__ */ n("path", { d: "M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20 7 22" }),
2177
+ /* @__PURE__ */ n("path", { d: "M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20 17 22" }),
2178
+ /* @__PURE__ */ n("path", { d: "M18 2H6v7a6 6 0 0012 0V2z" })
2174
2179
  ] }) }),
2175
2180
  "Current Records",
2176
2181
  /* @__PURE__ */ l("span", { className: "pvx-dash-records-count", children: [
2177
2182
  "(",
2178
- s.length,
2183
+ t.length,
2179
2184
  ")"
2180
2185
  ] })
2181
2186
  ] }) }),
2182
- /* @__PURE__ */ t("div", { className: "pvx-dash-records-list", children: s.map((r, a) => /* @__PURE__ */ l("div", { className: "pvx-dash-record-row", children: [
2187
+ /* @__PURE__ */ n("div", { className: "pvx-dash-records-list", children: t.map((s, a) => /* @__PURE__ */ l("div", { className: "pvx-dash-record-row", children: [
2183
2188
  /* @__PURE__ */ l("div", { className: "pvx-dash-record-info", children: [
2184
- /* @__PURE__ */ t("span", { className: "pvx-dash-record-track", children: q(r.trackId, r.layout, r.game) }),
2185
- /* @__PURE__ */ t("span", { className: "pvx-dash-record-car", children: I(r.carId) })
2189
+ /* @__PURE__ */ n("span", { className: "pvx-dash-record-track", children: j(s.trackId, s.layout, s.game) }),
2190
+ /* @__PURE__ */ n("span", { className: "pvx-dash-record-car", children: I(s.carId) })
2186
2191
  ] }),
2187
2192
  /* @__PURE__ */ l("div", { className: "pvx-dash-record-time", children: [
2188
- /* @__PURE__ */ t("span", { className: "pvx-dash-record-lap", children: A(r.lapTimeMs) }),
2189
- /* @__PURE__ */ l("span", { className: `pvx-dash-game-badge pvx-dash-game-badge--${r.game || "evo"}`, children: [
2190
- (r.game || "evo").toUpperCase(),
2191
- r.gameVersion ? ` ${r.gameVersion}` : ""
2193
+ /* @__PURE__ */ n("span", { className: "pvx-dash-record-lap", children: U(s.lapTimeMs) }),
2194
+ /* @__PURE__ */ l("span", { className: `pvx-dash-game-badge pvx-dash-game-badge--${s.game || "evo"}`, children: [
2195
+ (s.game || "evo").toUpperCase(),
2196
+ s.gameVersion ? ` ${s.gameVersion}` : ""
2192
2197
  ] })
2193
2198
  ] })
2194
2199
  ] }, a)) })
2195
2200
  ] }) : null;
2196
2201
  }
2197
- function _t({ events: e, isLoading: n, className: s, limit: r = 3 }) {
2198
- if (n)
2199
- return /* @__PURE__ */ t("div", { className: "pvx-loading", children: "Loading upcoming events..." });
2202
+ function _n({ events: e, isLoading: r, className: t, limit: s = 3 }) {
2203
+ if (r)
2204
+ return /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading upcoming events..." });
2200
2205
  if (!(e != null && e.length))
2201
2206
  return null;
2202
- const a = r ? e.slice(0, r) : e, i = e.length - a.length;
2203
- return /* @__PURE__ */ l("div", { className: `pvx-card ${s || ""}`, children: [
2204
- /* @__PURE__ */ t("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
2205
- /* @__PURE__ */ t(Vt, {}),
2207
+ const a = s ? e.slice(0, s) : e, i = e.length - a.length;
2208
+ return /* @__PURE__ */ l("div", { className: `pvx-card ${t || ""}`, children: [
2209
+ /* @__PURE__ */ n("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
2210
+ /* @__PURE__ */ n(Hn, {}),
2206
2211
  "Upcoming Events",
2207
2212
  /* @__PURE__ */ l("span", { className: "pvx-dash-records-count", children: [
2208
2213
  "(",
@@ -2217,15 +2222,15 @@ function _t({ events: e, isLoading: n, className: s, limit: r = 3 }) {
2217
2222
  className: `pvx-upcoming-item ${o.isNext ? "pvx-upcoming-item--next" : ""}`,
2218
2223
  children: [
2219
2224
  /* @__PURE__ */ l("div", { className: "pvx-upcoming-info", children: [
2220
- /* @__PURE__ */ t("span", { className: "pvx-upcoming-comp", children: o.competitionName }),
2225
+ /* @__PURE__ */ n("span", { className: "pvx-upcoming-comp", children: o.competitionName }),
2221
2226
  /* @__PURE__ */ l("span", { className: "pvx-upcoming-round", children: [
2222
2227
  "Round ",
2223
2228
  o.roundNumber,
2224
2229
  ": ",
2225
2230
  o.track
2226
2231
  ] }),
2227
- o.serverPassword && /* @__PURE__ */ t(
2228
- qt,
2232
+ o.serverPassword && /* @__PURE__ */ n(
2233
+ Vn,
2229
2234
  {
2230
2235
  password: o.serverPassword,
2231
2236
  address: o.serverAddress
@@ -2233,14 +2238,14 @@ function _t({ events: e, isLoading: n, className: s, limit: r = 3 }) {
2233
2238
  )
2234
2239
  ] }),
2235
2240
  /* @__PURE__ */ l("div", { className: "pvx-upcoming-time", children: [
2236
- /* @__PURE__ */ t("span", { className: "pvx-upcoming-date", children: new Date(o.startTime).toLocaleDateString("en-GB", {
2241
+ /* @__PURE__ */ n("span", { className: "pvx-upcoming-date", children: new Date(o.startTime).toLocaleDateString("en-GB", {
2237
2242
  day: "numeric",
2238
2243
  month: "short",
2239
2244
  year: "numeric"
2240
2245
  }) }),
2241
- /* @__PURE__ */ t("span", { className: "pvx-upcoming-relative", children: o.dediStatus === "running" ? "Live now" : o.dediStatus === "provisioning" ? "Starting..." : jt(o.startTime) }),
2242
- o.dediStatus === "running" && /* @__PURE__ */ t("span", { className: "pvx-upcoming-badge pvx-upcoming-badge--live", children: "Live" }),
2243
- !o.dediStatus && o.isNext && /* @__PURE__ */ t("span", { className: "pvx-upcoming-badge", children: "Next" })
2246
+ /* @__PURE__ */ n("span", { className: "pvx-upcoming-relative", children: o.dediStatus === "running" ? "Live now" : o.dediStatus === "provisioning" ? "Starting..." : Kn(o.startTime) }),
2247
+ o.dediStatus === "running" && /* @__PURE__ */ n("span", { className: "pvx-upcoming-badge pvx-upcoming-badge--live", children: "Live" }),
2248
+ !o.dediStatus && o.isNext && /* @__PURE__ */ n("span", { className: "pvx-upcoming-badge", children: "Next" })
2244
2249
  ] })
2245
2250
  ]
2246
2251
  },
@@ -2255,11 +2260,11 @@ function _t({ events: e, isLoading: n, className: s, limit: r = 3 }) {
2255
2260
  ] })
2256
2261
  ] });
2257
2262
  }
2258
- function qt({ password: e, address: n }) {
2259
- const [s, r] = D(!1), [a, i] = D(!1), o = n ? e ? `join:${n}|${e}` : `join:${n}` : null, d = H(async () => {
2263
+ function Vn({ password: e, address: r }) {
2264
+ const [t, s] = D(!1), [a, i] = D(!1), o = r ? e ? `join:${r}|${e}` : `join:${r}` : null, d = H(async () => {
2260
2265
  if (o)
2261
2266
  try {
2262
- await navigator.clipboard.writeText(o), r(!0), setTimeout(() => r(!1), 2e3);
2267
+ await navigator.clipboard.writeText(o), s(!0), setTimeout(() => s(!1), 2e3);
2263
2268
  } catch {
2264
2269
  }
2265
2270
  }, [o]);
@@ -2271,242 +2276,242 @@ function qt({ password: e, address: n }) {
2271
2276
  onClick: d,
2272
2277
  title: "Copy join string to clipboard",
2273
2278
  children: [
2274
- /* @__PURE__ */ t(Ht, {}),
2279
+ /* @__PURE__ */ n(On, {}),
2275
2280
  " ",
2276
- s ? "Copied!" : "Join"
2281
+ t ? "Copied!" : "Join"
2277
2282
  ]
2278
2283
  }
2279
2284
  ),
2280
- e && /* @__PURE__ */ l(U, { children: [
2281
- /* @__PURE__ */ t(
2285
+ e && /* @__PURE__ */ l(F, { children: [
2286
+ /* @__PURE__ */ n(
2282
2287
  "span",
2283
2288
  {
2284
2289
  className: "pvx-server-detail pvx-server-detail--clickable",
2285
2290
  onClick: () => i((p) => !p),
2286
2291
  title: a ? "Hide password" : "Reveal password",
2287
- children: a ? /* @__PURE__ */ t(Wt, {}) : /* @__PURE__ */ t(Ot, {})
2292
+ children: a ? /* @__PURE__ */ n(Qn, {}) : /* @__PURE__ */ n(zn, {})
2288
2293
  }
2289
2294
  ),
2290
2295
  a && /* @__PURE__ */ l("span", { className: "pvx-server-detail", children: [
2291
- /* @__PURE__ */ t(Kt, {}),
2296
+ /* @__PURE__ */ n(Wn, {}),
2292
2297
  " ",
2293
2298
  e
2294
2299
  ] })
2295
2300
  ] })
2296
2301
  ] });
2297
2302
  }
2298
- function jt(e) {
2299
- const n = new Date(e).getTime() - Date.now();
2300
- if (n <= 0) return "Now";
2301
- const s = Math.floor(n / (1e3 * 60 * 60));
2302
- if (s < 1) return "Less than 1 hour";
2303
- if (s < 24) return `in ${s}h`;
2304
- const r = Math.floor(s / 24);
2305
- if (r === 1) return "Tomorrow";
2306
- if (r < 7) return `in ${r} days`;
2307
- if (r < 30) {
2308
- const a = Math.floor(r / 7);
2303
+ function Kn(e) {
2304
+ const r = new Date(e).getTime() - Date.now();
2305
+ if (r <= 0) return "Now";
2306
+ const t = Math.floor(r / (1e3 * 60 * 60));
2307
+ if (t < 1) return "Less than 1 hour";
2308
+ if (t < 24) return `in ${t}h`;
2309
+ const s = Math.floor(t / 24);
2310
+ if (s === 1) return "Tomorrow";
2311
+ if (s < 7) return `in ${s} days`;
2312
+ if (s < 30) {
2313
+ const a = Math.floor(s / 7);
2309
2314
  return `in ${a} week${a !== 1 ? "s" : ""}`;
2310
2315
  }
2311
2316
  return ue(e);
2312
2317
  }
2313
- function Vt() {
2318
+ function Hn() {
2314
2319
  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: [
2315
- /* @__PURE__ */ t("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
2316
- /* @__PURE__ */ t("path", { d: "M16 2v4M8 2v4M3 10h18" })
2320
+ /* @__PURE__ */ n("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
2321
+ /* @__PURE__ */ n("path", { d: "M16 2v4M8 2v4M3 10h18" })
2317
2322
  ] });
2318
2323
  }
2319
- function Kt() {
2324
+ function Wn() {
2320
2325
  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: [
2321
- /* @__PURE__ */ t("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2" }),
2322
- /* @__PURE__ */ t("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
2326
+ /* @__PURE__ */ n("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2" }),
2327
+ /* @__PURE__ */ n("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
2323
2328
  ] });
2324
2329
  }
2325
- function Ht() {
2330
+ function On() {
2326
2331
  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: [
2327
- /* @__PURE__ */ t("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
2328
- /* @__PURE__ */ t("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
2332
+ /* @__PURE__ */ n("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
2333
+ /* @__PURE__ */ n("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
2329
2334
  ] });
2330
2335
  }
2331
- function Ot() {
2336
+ function zn() {
2332
2337
  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: [
2333
- /* @__PURE__ */ t("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
2334
- /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "3" })
2338
+ /* @__PURE__ */ n("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
2339
+ /* @__PURE__ */ n("circle", { cx: "12", cy: "12", r: "3" })
2335
2340
  ] });
2336
2341
  }
2337
- function Wt() {
2342
+ function Qn() {
2338
2343
  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: [
2339
- /* @__PURE__ */ t("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" }),
2340
- /* @__PURE__ */ t("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
2344
+ /* @__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" }),
2345
+ /* @__PURE__ */ n("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
2341
2346
  ] });
2342
2347
  }
2343
- function zt({ notifications: e, unreadCount: n = 0, onMarkRead: s, onMarkAllRead: r, isLoading: a, className: i }) {
2344
- const o = ve();
2345
- return a ? /* @__PURE__ */ t("div", { className: "pvx-loading", children: "Loading notifications..." }) : /* @__PURE__ */ l("div", { className: `pvx-card ${i || ""}`, children: [
2348
+ function Gn({ notifications: e, unreadCount: r = 0, onMarkRead: t, onMarkAllRead: s, isLoading: a, className: i }) {
2349
+ const o = he();
2350
+ return a ? /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading notifications..." }) : /* @__PURE__ */ l("div", { className: `pvx-card ${i || ""}`, children: [
2346
2351
  /* @__PURE__ */ l("div", { className: "pvx-card-header", children: [
2347
2352
  /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
2348
- /* @__PURE__ */ t(Yt, {}),
2353
+ /* @__PURE__ */ n(Zn, {}),
2349
2354
  "Notifications",
2350
- n > 0 && /* @__PURE__ */ t("span", { className: "pvx-notif-badge", children: n > 99 ? "99+" : n })
2355
+ r > 0 && /* @__PURE__ */ n("span", { className: "pvx-notif-badge", children: r > 99 ? "99+" : r })
2351
2356
  ] }),
2352
- n > 0 && r && /* @__PURE__ */ t("button", { className: "pvx-notif-mark-all", onClick: r, children: "Mark all read" })
2357
+ r > 0 && s && /* @__PURE__ */ n("button", { className: "pvx-notif-mark-all", onClick: s, children: "Mark all read" })
2353
2358
  ] }),
2354
- e != null && e.length ? /* @__PURE__ */ t("div", { className: "pvx-notif-list", children: e.map((d) => /* @__PURE__ */ t(
2355
- Gt,
2359
+ e != null && e.length ? /* @__PURE__ */ n("div", { className: "pvx-notif-list", children: e.map((d) => /* @__PURE__ */ n(
2360
+ Yn,
2356
2361
  {
2357
2362
  notification: d,
2358
2363
  getUserDisplay: o,
2359
- onMarkRead: s
2364
+ onMarkRead: t
2360
2365
  },
2361
2366
  d.id
2362
- )) }) : /* @__PURE__ */ t("div", { className: "pvx-notif-empty", children: "No notifications" })
2367
+ )) }) : /* @__PURE__ */ n("div", { className: "pvx-notif-empty", children: "No notifications" })
2363
2368
  ] });
2364
2369
  }
2365
- function Gt({ notification: e, getUserDisplay: n, onMarkRead: s }) {
2366
- const r = () => {
2367
- !e.isRead && s && s(e.id);
2370
+ function Yn({ notification: e, getUserDisplay: r, onMarkRead: t }) {
2371
+ const s = () => {
2372
+ !e.isRead && t && t(e.id);
2368
2373
  };
2369
2374
  return /* @__PURE__ */ l(
2370
2375
  "button",
2371
2376
  {
2372
2377
  className: `pvx-notif-item ${e.isRead ? "" : "pvx-notif-item--unread"}`,
2373
- onClick: r,
2378
+ onClick: s,
2374
2379
  children: [
2375
- /* @__PURE__ */ t(Qt, { type: e.type }),
2380
+ /* @__PURE__ */ n(Jn, { type: e.type }),
2376
2381
  /* @__PURE__ */ l("div", { className: "pvx-notif-content", children: [
2377
- /* @__PURE__ */ t("span", { className: "pvx-notif-message", children: Ve(e, n) }),
2378
- /* @__PURE__ */ t("span", { className: "pvx-notif-time", children: ue(e.createdAt) })
2382
+ /* @__PURE__ */ n("span", { className: "pvx-notif-message", children: He(e, r) }),
2383
+ /* @__PURE__ */ n("span", { className: "pvx-notif-time", children: ue(e.createdAt) })
2379
2384
  ] }),
2380
- !e.isRead && /* @__PURE__ */ t("span", { className: "pvx-notif-dot" })
2385
+ !e.isRead && /* @__PURE__ */ n("span", { className: "pvx-notif-dot" })
2381
2386
  ]
2382
2387
  }
2383
2388
  );
2384
2389
  }
2385
- function Qt({ type: e }) {
2386
- return e === "RECORD_BEATEN" ? /* @__PURE__ */ t("span", { className: "pvx-notif-icon pvx-notif-icon--beaten", children: /* @__PURE__ */ t("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ t("path", { d: "m7 7 10 10M17 7v10H7" }) }) }) : e === "ADMIN_MESSAGE" ? /* @__PURE__ */ t("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: [
2387
- /* @__PURE__ */ t("path", { d: "m3 11 18-5v12L3 13v-2z" }),
2388
- /* @__PURE__ */ t("path", { d: "M11.6 16.8a3 3 0 1 1-5.8-1.6" })
2389
- ] }) }) : /* @__PURE__ */ t("span", { className: "pvx-notif-icon pvx-notif-icon--record", children: /* @__PURE__ */ l("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2390
- /* @__PURE__ */ t("path", { d: "M6 9H4.5a2.5 2.5 0 0 1 0-5H6" }),
2391
- /* @__PURE__ */ t("path", { d: "M18 9h1.5a2.5 2.5 0 0 0 0-5H18" }),
2392
- /* @__PURE__ */ t("path", { d: "M4 22h16" }),
2393
- /* @__PURE__ */ t("path", { d: "M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22" }),
2394
- /* @__PURE__ */ t("path", { d: "M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22" }),
2395
- /* @__PURE__ */ t("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
2390
+ function Jn({ type: e }) {
2391
+ 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: [
2392
+ /* @__PURE__ */ n("path", { d: "m3 11 18-5v12L3 13v-2z" }),
2393
+ /* @__PURE__ */ n("path", { d: "M11.6 16.8a3 3 0 1 1-5.8-1.6" })
2394
+ ] }) }) : /* @__PURE__ */ n("span", { className: "pvx-notif-icon pvx-notif-icon--record", children: /* @__PURE__ */ l("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2395
+ /* @__PURE__ */ n("path", { d: "M6 9H4.5a2.5 2.5 0 0 1 0-5H6" }),
2396
+ /* @__PURE__ */ n("path", { d: "M18 9h1.5a2.5 2.5 0 0 0 0-5H18" }),
2397
+ /* @__PURE__ */ n("path", { d: "M4 22h16" }),
2398
+ /* @__PURE__ */ n("path", { d: "M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22" }),
2399
+ /* @__PURE__ */ n("path", { d: "M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22" }),
2400
+ /* @__PURE__ */ n("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
2396
2401
  ] }) });
2397
2402
  }
2398
- function Yt() {
2403
+ function Zn() {
2399
2404
  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: [
2400
- /* @__PURE__ */ t("path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" }),
2401
- /* @__PURE__ */ t("path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0" })
2405
+ /* @__PURE__ */ n("path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" }),
2406
+ /* @__PURE__ */ n("path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0" })
2402
2407
  ] });
2403
2408
  }
2404
- function wn({ steamId: e, avatarUrl: n, memberSince: s, className: r = "" }) {
2405
- const { data: a, isLoading: i, error: o } = St(e), { data: d, isLoading: p } = Tt(e), { data: c, isLoading: u } = Rt(), g = $t(), { data: f, isLoading: m } = Mt({ limit: 10 }), b = Dt(), x = It();
2406
- return i || p ? /* @__PURE__ */ t("div", { className: "pvx-loading", children: "Loading dashboard..." }) : o ? /* @__PURE__ */ t("div", { className: "pvx-empty", children: "Failed to load dashboard data." }) : a ? /* @__PURE__ */ l("div", { className: `pvx-dash ${r}`, children: [
2407
- /* @__PURE__ */ t(
2408
- Pt,
2409
+ function wt({ steamId: e, avatarUrl: r, memberSince: t, className: s = "" }) {
2410
+ const { data: a, isLoading: i, error: o } = Rn(e), { data: d, isLoading: p } = $n(e), { data: c, isLoading: u } = Mn(), g = Dn(), { data: f, isLoading: m } = In({ limit: 10 }), y = Pn(), x = Bn();
2411
+ return i || p ? /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading dashboard..." }) : o ? /* @__PURE__ */ n("div", { className: "pvx-empty", children: "Failed to load dashboard data." }) : a ? /* @__PURE__ */ l("div", { className: `pvx-dash ${s}`, children: [
2412
+ /* @__PURE__ */ n(
2413
+ An,
2409
2414
  {
2410
2415
  driverName: a.driverName,
2411
- avatarUrl: n,
2412
- memberSince: s
2416
+ avatarUrl: r,
2417
+ memberSince: t
2413
2418
  }
2414
2419
  ),
2415
- /* @__PURE__ */ t(Ft, { stats: a, rating: d }),
2416
- e && /* @__PURE__ */ t(_t, { events: c, isLoading: u }),
2420
+ /* @__PURE__ */ n(qn, { stats: a, rating: d }),
2421
+ e && /* @__PURE__ */ n(_n, { events: c, isLoading: u }),
2417
2422
  /* @__PURE__ */ l("div", { className: `pvx-dash-row ${g ? "pvx-dash-row--2col" : ""}`, children: [
2418
- /* @__PURE__ */ t(Et, { records: a.currentRecords }),
2419
- g && /* @__PURE__ */ t(
2420
- zt,
2423
+ /* @__PURE__ */ n(jn, { records: a.currentRecords }),
2424
+ g && /* @__PURE__ */ n(
2425
+ Gn,
2421
2426
  {
2422
2427
  notifications: f == null ? void 0 : f.notifications,
2423
2428
  unreadCount: (f == null ? void 0 : f.unreadCount) || 0,
2424
- onMarkRead: (v) => b.mutate(v),
2429
+ onMarkRead: (h) => y.mutate(h),
2425
2430
  onMarkAllRead: () => x.mutate(),
2426
2431
  isLoading: m
2427
2432
  }
2428
2433
  )
2429
2434
  ] })
2430
- ] }) : /* @__PURE__ */ t("div", { className: "pvx-empty", children: "No data available yet. Start driving to see your stats!" });
2435
+ ] }) : /* @__PURE__ */ n("div", { className: "pvx-empty", children: "No data available yet. Start driving to see your stats!" });
2431
2436
  }
2432
2437
  export {
2433
- cn as CarsTable,
2438
+ dt as CarsTable,
2434
2439
  P as CompEmptyState,
2435
- F as CompLoadingState,
2436
- ut as CompetitionCard,
2437
- hn as CompetitionCards,
2438
- Nn as CompetitionResultsTabs,
2439
- pt as CompletedBadge,
2440
- Se as DEFAULT_COMPLETION_GRACE_DAYS,
2441
- wn as DriverDashboard,
2442
- Pt as DriverProfile,
2443
- dn as DriversTable,
2444
- xn as EntryList,
2440
+ E as CompLoadingState,
2441
+ vn as CompetitionCard,
2442
+ ht as CompetitionCards,
2443
+ bt as CompetitionResultsTabs,
2444
+ mn as CompletedBadge,
2445
+ Le as DEFAULT_COMPLETION_GRACE_DAYS,
2446
+ wt as DriverDashboard,
2447
+ An as DriverProfile,
2448
+ pt as DriversTable,
2449
+ gt as EntryList,
2445
2450
  J as InfoPill,
2446
- pn as LapHistoryTable,
2447
- zt as NotificationsCard,
2451
+ ut as LapHistoryTable,
2452
+ Gn as NotificationsCard,
2448
2453
  ae as PODIUM_MEDALS,
2449
- en as PitVoxPartnerProvider,
2450
- un as RankingsTable,
2451
- Et as RecordsTable,
2452
- gn as RegisterButton,
2453
- fn as RegistrationPanel,
2454
- vn as RoundResults,
2454
+ tt as PitVoxPartnerProvider,
2455
+ mt as RankingsTable,
2456
+ jn as RecordsTable,
2457
+ ft as RegisterButton,
2458
+ Nt as RegistrationPanel,
2459
+ xt as RoundResults,
2455
2460
  le as RoundSessionResults,
2456
- vt as StandingsTable,
2457
- Ft as StatsCards,
2458
- ln as TracksTable,
2459
- at as TypeBadge,
2460
- _t as UpcomingEvents,
2461
- qe as buildDriverIndexPath,
2461
+ gn as StandingsTable,
2462
+ qn as StatsCards,
2463
+ ct as TracksTable,
2464
+ on as TypeBadge,
2465
+ _n as UpcomingEvents,
2466
+ Ve as buildDriverIndexPath,
2462
2467
  _e as buildLapsPath,
2463
2468
  X as buildLeaderboardPath,
2464
- je as buildRecentLapsPath,
2469
+ Ke as buildRecentLapsPath,
2465
2470
  R as fetchCdnJson,
2466
- mn as filterCompetitionsByStatus,
2471
+ vt as filterCompetitionsByStatus,
2467
2472
  I as formatCarName,
2468
- j as formatDate,
2469
- tn as formatDelta,
2470
- he as formatFuel,
2471
- A as formatLapTime,
2472
- Ve as formatNotificationMessage,
2473
+ _ as formatDate,
2474
+ rt as formatDelta,
2475
+ ve as formatFuel,
2476
+ U as formatLapTime,
2477
+ He as formatNotificationMessage,
2473
2478
  ue as formatRelativeTime,
2474
2479
  B as formatSectorTime,
2475
2480
  ie as formatSessionLabel,
2476
- q as formatTrackName,
2481
+ j as formatTrackName,
2477
2482
  me as formatTyreCompound,
2478
- dt as getCompetitionPodium,
2479
- Te as getCompetitionStatus,
2480
- ct as getCompletionDate,
2481
- lt as isCompetitionComplete,
2482
- an as useCarLeaderboard,
2483
- rn as useCarMetadata,
2484
- We as useCompetitionAllRounds,
2483
+ un as getCompetitionPodium,
2484
+ Se as getCompetitionStatus,
2485
+ pn as getCompletionDate,
2486
+ dn as isCompetitionComplete,
2487
+ ot as useCarLeaderboard,
2488
+ at as useCarMetadata,
2489
+ Qe as useCompetitionAllRounds,
2485
2490
  xe as useCompetitionConfig,
2486
2491
  fe as useCompetitionEntryList,
2487
- ze as useCompetitionLeaderboard,
2488
- Oe as useCompetitionRound,
2489
- Ge as useCompetitionRoundLaps,
2492
+ Ge as useCompetitionLeaderboard,
2493
+ ze as useCompetitionRound,
2494
+ Ye as useCompetitionRoundLaps,
2490
2495
  ge as useCompetitionStandings,
2491
- on as useCompetitions,
2492
- He as useDriverLaps,
2493
- Tt as useDriverRating,
2494
- bn as useDriverRatings,
2495
- St as useDriverStats,
2496
- nn as useLeaderboardIndex,
2497
- It as useMarkAllNotificationsRead,
2498
- Dt as useMarkNotificationRead,
2499
- Mt as useNotifications,
2500
- $t as useNotificationsEnabled,
2501
- k as usePitVox,
2502
- sn as useRecentLaps,
2496
+ lt as useCompetitions,
2497
+ Oe as useDriverLaps,
2498
+ $n as useDriverRating,
2499
+ yt as useDriverRatings,
2500
+ Rn as useDriverStats,
2501
+ st as useLeaderboardIndex,
2502
+ Bn as useMarkAllNotificationsRead,
2503
+ Pn as useMarkNotificationRead,
2504
+ In as useNotifications,
2505
+ Dn as useNotificationsEnabled,
2506
+ C as usePitVox,
2507
+ it as useRecentLaps,
2503
2508
  Ne as useRegister,
2504
- te as useRegistrationMode,
2509
+ ne as useRegistrationMode,
2505
2510
  ee as useRegistrationStatus,
2506
- ne as useRegistrationUrl,
2507
- Ke as useTrackLeaderboard,
2508
- yn as useUnreadCount,
2509
- Rt as useUpcomingEvents,
2510
- ve as useUserLookup,
2511
+ te as useRegistrationUrl,
2512
+ We as useTrackLeaderboard,
2513
+ kt as useUnreadCount,
2514
+ Mn as useUpcomingEvents,
2515
+ he as useUserLookup,
2511
2516
  be as useWithdraw
2512
2517
  };