@pitvox/partner-react 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,73 +1,73 @@
1
- import { jsx as t, jsxs as o, Fragment as z } from "react/jsx-runtime";
2
- import { createContext as Le, useMemo as k, useContext as Re, useState as W, useCallback as O } from "react";
3
- import { useQueryClient as Q, QueryClient as $e, QueryClientProvider as De, useQuery as L, useMutation as ae } from "@tanstack/react-query";
4
- import { useSearchParams as se } from "react-router-dom";
5
- const G = Le(null), Be = "https://cdn.pitvox.com", Me = "https://api.pitvox.com";
6
- let H = null;
7
- function $t({
8
- partnerSlug: e,
1
+ import { jsx as e, jsxs as l, Fragment as Q } from "react/jsx-runtime";
2
+ import { createContext as Re, useMemo as k, useContext as De, useState as j, useCallback as G } from "react";
3
+ import { useQueryClient as J, QueryClient as Ie, QueryClientProvider as Me, useQuery as L, useMutation as ie } from "@tanstack/react-query";
4
+ import { useSearchParams as oe } from "react-router-dom";
5
+ const z = Re(null), Be = "https://cdn.pitvox.com", Ae = "https://api.pitvox.com";
6
+ let W = null;
7
+ function At({
8
+ partnerSlug: t,
9
9
  apiKey: r,
10
10
  cdnUrl: n = Be,
11
- apiUrl: a = Me,
11
+ apiUrl: a = Ae,
12
12
  getSteamId: s,
13
13
  children: i
14
14
  }) {
15
15
  const c = k(() => ({
16
- partnerSlug: e,
16
+ partnerSlug: t,
17
17
  apiKey: r,
18
18
  cdnUrl: n.replace(/\/$/, ""),
19
19
  apiUrl: a.replace(/\/$/, ""),
20
20
  getSteamId: s || (() => null)
21
- }), [e, r, n, a, s]);
22
- let l = !1;
21
+ }), [t, r, n, a, s]);
22
+ let o = !1;
23
23
  try {
24
- Q(), l = !0;
24
+ J(), o = !0;
25
25
  } catch {
26
- l = !1;
26
+ o = !1;
27
27
  }
28
- return l ? /* @__PURE__ */ t(G.Provider, { value: c, children: i }) : (H || (H = new $e({
28
+ return o ? /* @__PURE__ */ e(z.Provider, { value: c, children: i }) : (W || (W = new Ie({
29
29
  defaultOptions: {
30
30
  queries: { staleTime: 6e4 }
31
31
  }
32
- })), /* @__PURE__ */ t(De, { client: H, children: /* @__PURE__ */ t(G.Provider, { value: c, children: i }) }));
32
+ })), /* @__PURE__ */ e(Me, { client: W, children: /* @__PURE__ */ e(z.Provider, { value: c, children: i }) }));
33
33
  }
34
34
  function T() {
35
- const e = Re(G);
36
- if (!e)
35
+ const t = De(z);
36
+ if (!t)
37
37
  throw new Error("usePitVox must be used within a <PitVoxPartnerProvider>");
38
- return e;
38
+ return t;
39
39
  }
40
- async function R(e, r) {
41
- const n = await fetch(`${e}/${r}`);
40
+ async function $(t, r) {
41
+ const n = await fetch(`${t}/${r}`);
42
42
  if (!n.ok) {
43
43
  if (n.status === 404 || n.status === 403) return null;
44
44
  throw new Error(`CDN fetch failed: ${n.status}`);
45
45
  }
46
46
  return n.json();
47
47
  }
48
- function U(e) {
49
- if (!e && e !== 0) return "-";
50
- const r = Math.floor(e / 1e3), n = Math.floor(r / 60), a = r % 60, s = e % 1e3;
48
+ function E(t) {
49
+ if (!t && t !== 0) return "-";
50
+ const r = Math.floor(t / 1e3), n = Math.floor(r / 60), a = r % 60, s = t % 1e3;
51
51
  return `${n}:${String(a).padStart(2, "0")}.${String(s).padStart(3, "0")}`;
52
52
  }
53
- function P(e) {
54
- return !e && e !== 0 ? "-" : (e / 1e3).toFixed(3);
53
+ function P(t) {
54
+ return !t && t !== 0 ? "-" : (t / 1e3).toFixed(3);
55
55
  }
56
- function B(e) {
57
- if (!e) return "";
58
- let r = e;
56
+ function I(t) {
57
+ if (!t) return "";
58
+ let r = t;
59
59
  return r.startsWith("ks_") && (r = r.slice(3)), r.split("_").map((n) => n.charAt(0).toUpperCase() + n.slice(1)).join(" ");
60
60
  }
61
- function J(e, r, n) {
62
- const a = e.split("_").map((c) => c.charAt(0).toUpperCase() + c.slice(1)).join(" "), s = n === "acc" || !n && (r == null ? void 0 : r.toLowerCase()) === "track config";
61
+ function V(t, r, n) {
62
+ const a = t.split("_").map((c) => c.charAt(0).toUpperCase() + c.slice(1)).join(" "), s = n === "acc" || !n && (r == null ? void 0 : r.toLowerCase()) === "track config";
63
63
  if (!r || r === "default" || s) return a;
64
64
  const i = r.split("_").map((c) => c.charAt(0).toUpperCase() + c.slice(1)).join(" ");
65
65
  return `${a} ${i}`;
66
66
  }
67
- function E(e) {
68
- if (!e) return "-";
67
+ function F(t) {
68
+ if (!t) return "-";
69
69
  try {
70
- return new Date(e).toLocaleDateString("en-GB", {
70
+ return new Date(t).toLocaleDateString("en-GB", {
71
71
  day: "numeric",
72
72
  month: "short",
73
73
  year: "numeric"
@@ -76,22 +76,22 @@ function E(e) {
76
76
  return "-";
77
77
  }
78
78
  }
79
- function Dt(e) {
80
- if (!e) return "";
81
- const r = Date.now() - new Date(e).getTime(), n = Math.floor(r / 1e3);
79
+ function Pt(t) {
80
+ if (!t) return "";
81
+ const r = Date.now() - new Date(t).getTime(), n = Math.floor(r / 1e3);
82
82
  if (n < 60) return "Just now";
83
83
  const a = Math.floor(n / 60);
84
84
  if (a < 60) return `${a}m ago`;
85
85
  const s = Math.floor(a / 60);
86
86
  if (s < 24) return `${s}h ago`;
87
87
  const i = Math.floor(s / 24);
88
- return i < 30 ? `${i}d ago` : E(e);
88
+ return i < 30 ? `${i}d ago` : F(t);
89
89
  }
90
- function Bt(e) {
91
- return e == null ? "" : `${e >= 0 ? "+" : "-"}${(Math.abs(e) / 1e3).toFixed(3)}`;
90
+ function Ut(t) {
91
+ return t == null ? "" : `${t >= 0 ? "+" : "-"}${(Math.abs(t) / 1e3).toFixed(3)}`;
92
92
  }
93
- function ie(e) {
94
- return e ? {
93
+ function le(t) {
94
+ return t ? {
95
95
  E: "Eco",
96
96
  RD: "Road",
97
97
  SC: "SuperCar",
@@ -102,100 +102,100 @@ function ie(e) {
102
102
  MR: "Medium Race",
103
103
  SR: "Soft Race",
104
104
  S: "Soft"
105
- }[e] || e : "Unknown";
105
+ }[t] || t : "Unknown";
106
106
  }
107
- function Ie(e = {}) {
108
- var l, v, d, f, N, x;
109
- const { cdnUrl: r, partnerSlug: n } = T(), { game: a, gameVersion: s } = e, i = L({
107
+ function Pe(t = {}) {
108
+ var o, m, d, g, N, x;
109
+ const { cdnUrl: r, partnerSlug: n } = T(), { game: a, gameVersion: s } = t, i = L({
110
110
  queryKey: ["pitvox", "leaderboards", n, "index"],
111
- queryFn: () => R(r, `leaderboards/partners/${n}/index.json`),
111
+ queryFn: () => $(r, `leaderboards/partners/${n}/index.json`),
112
112
  staleTime: 3e4,
113
113
  refetchInterval: 3e4
114
114
  }), c = k(() => {
115
- var g;
116
- if (!((g = i.data) != null && g.tracks)) return [];
117
- let m = i.data.tracks;
118
- return a && (m = m.filter((p) => p.game === a)), s && (m = m.filter((p) => p.gameVersion === s)), m.map((p) => ({
115
+ var f;
116
+ if (!((f = i.data) != null && f.tracks)) return [];
117
+ let h = i.data.tracks;
118
+ return a && (h = h.filter((p) => p.game === a)), s && (h = h.filter((p) => p.gameVersion === s)), h.map((p) => ({
119
119
  id: p.trackId,
120
120
  layout: p.layout,
121
121
  game: p.game,
122
122
  gameVersion: p.gameVersion,
123
- displayName: J(p.trackId, p.layout, p.game),
123
+ displayName: V(p.trackId, p.layout, p.game),
124
124
  driverCount: p.driverCount || 0,
125
125
  carCount: p.carCount || 0,
126
126
  record: p.recordHolder ? {
127
127
  visibleId: p.recordHolder.steamId || p.recordHolder.userId,
128
128
  carId: p.recordHolder.carId,
129
- carDisplayName: B(p.recordHolder.carId),
129
+ carDisplayName: I(p.recordHolder.carId),
130
130
  lapTimeMs: p.recordHolder.lapTimeMs,
131
131
  timestamp: p.recordHolder.recordedAt
132
132
  } : null,
133
133
  recordByTag: p.recordByTag || null
134
134
  }));
135
- }, [(l = i.data) == null ? void 0 : l.tracks, a, s]);
135
+ }, [(o = i.data) == null ? void 0 : o.tracks, a, s]);
136
136
  return {
137
137
  ...i,
138
138
  data: c,
139
- partner: ((v = i.data) == null ? void 0 : v.partner) || null,
139
+ partner: ((m = i.data) == null ? void 0 : m.partner) || null,
140
140
  generatedAt: (d = i.data) == null ? void 0 : d.generatedAt,
141
- totalLaps: ((f = i.data) == null ? void 0 : f.totalLaps) || 0,
141
+ totalLaps: ((g = i.data) == null ? void 0 : g.totalLaps) || 0,
142
142
  totalUsers: ((N = i.data) == null ? void 0 : N.totalUsers) || 0,
143
143
  versions: ((x = i.data) == null ? void 0 : x.versions) || {}
144
144
  };
145
145
  }
146
- function le(e, r, n = {}) {
147
- const { cdnUrl: a, partnerSlug: s } = T(), { carId: i, game: c, gameVersion: l } = n, v = r || "default", d = l ? `leaderboards/partners/${s}/v/${l}/tracks/${e}/${v}.json` : `leaderboards/partners/${s}/tracks/${e}/${v}.json`, { data: f, isLoading: N, error: x } = L({
148
- queryKey: ["pitvox", "leaderboards", s, "track", e, v, l],
149
- queryFn: () => R(a, d),
150
- enabled: !!e,
146
+ function ce(t, r, n = {}) {
147
+ const { cdnUrl: a, partnerSlug: s } = T(), { carId: i, game: c, gameVersion: o } = n, m = r || "default", d = o ? `leaderboards/partners/${s}/v/${o}/tracks/${t}/${m}.json` : `leaderboards/partners/${s}/tracks/${t}/${m}.json`, { data: g, isLoading: N, error: x } = L({
148
+ queryKey: ["pitvox", "leaderboards", s, "track", t, m, o],
149
+ queryFn: () => $(a, d),
150
+ enabled: !!t,
151
151
  staleTime: 3e4,
152
152
  refetchInterval: 3e4
153
153
  });
154
154
  return { data: k(() => {
155
- if (!(f != null && f.entries)) return [];
156
- let g = f.entries;
157
- if (c && (g = g.filter((p) => p.game === c)), !i) {
158
- const p = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new Map();
159
- for (const u of g) {
155
+ if (!(g != null && g.entries)) return [];
156
+ let f = g.entries;
157
+ if (c && (f = f.filter((p) => p.game === c)), !i) {
158
+ const p = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map();
159
+ for (const u of f) {
160
160
  const y = u.steamId || u.userId;
161
- h.has(u.carId) || h.set(u.carId, /* @__PURE__ */ new Set()), h.get(u.carId).add(y), (!p.has(u.carId) || u.lapTimeMs < p.get(u.carId).lapTimeMs) && p.set(u.carId, u);
161
+ v.has(u.carId) || v.set(u.carId, /* @__PURE__ */ new Set()), v.get(u.carId).add(y), (!p.has(u.carId) || u.lapTimeMs < p.get(u.carId).lapTimeMs) && p.set(u.carId, u);
162
162
  }
163
163
  return Array.from(p.values()).map((u) => {
164
164
  var y;
165
- return { ...u, driverCount: ((y = h.get(u.carId)) == null ? void 0 : y.size) || 0 };
165
+ return { ...u, driverCount: ((y = v.get(u.carId)) == null ? void 0 : y.size) || 0 };
166
166
  }).sort((u, y) => u.lapTimeMs - y.lapTimeMs);
167
167
  }
168
- return g.filter((p) => p.carId === i).sort((p, h) => p.lapTimeMs - h.lapTimeMs);
169
- }, [f == null ? void 0 : f.entries, i, c]), isLoading: N, error: x };
170
- }
171
- function Ae(e, r, n, a, s = {}) {
172
- var x, m;
173
- const { cdnUrl: i, partnerSlug: c } = T(), { showInvalid: l = !1, game: v, gameVersion: d } = s, f = L({
174
- queryKey: ["pitvox", "laps", c, e],
175
- queryFn: () => R(i, `laps/partners/${c}/${e}.json`),
176
- enabled: !!e,
168
+ return f.filter((p) => p.carId === i).sort((p, v) => p.lapTimeMs - v.lapTimeMs);
169
+ }, [g == null ? void 0 : g.entries, i, c]), isLoading: N, error: x };
170
+ }
171
+ function Ue(t, r, n, a, s = {}) {
172
+ var x, h;
173
+ const { cdnUrl: i, partnerSlug: c } = T(), { showInvalid: o = !1, game: m, gameVersion: d } = s, g = L({
174
+ queryKey: ["pitvox", "laps", c, t],
175
+ queryFn: () => $(i, `laps/partners/${c}/${t}.json`),
176
+ enabled: !!t,
177
177
  staleTime: 3e4,
178
178
  refetchInterval: 3e4
179
179
  }), N = k(() => {
180
- var g;
181
- return (g = f.data) != null && g.laps ? f.data.laps.filter((p) => {
180
+ var f;
181
+ return (f = g.data) != null && f.laps ? g.data.laps.filter((p) => {
182
182
  if (p.trackId !== r) return !1;
183
183
  if (n) {
184
184
  if (p.trackLayout !== n) return !1;
185
185
  } else if (p.trackLayout && p.trackLayout !== "default") return !1;
186
- return !(p.carId !== a || v && p.game !== v || d && p.gameVersion !== d || !l && !p.isValid);
187
- }).sort((p, h) => p.lapTimeMs - h.lapTimeMs) : [];
188
- }, [(x = f.data) == null ? void 0 : x.laps, r, n, a, v, d, l]);
186
+ return !(p.carId !== a || m && p.game !== m || d && p.gameVersion !== d || !o && !p.isValid);
187
+ }).sort((p, v) => p.lapTimeMs - v.lapTimeMs) : [];
188
+ }, [(x = g.data) == null ? void 0 : x.laps, r, n, a, m, d, o]);
189
189
  return {
190
- ...f,
190
+ ...g,
191
191
  data: N,
192
- driverName: ((m = f.data) == null ? void 0 : m.driverName) || "Driver"
192
+ driverName: ((h = g.data) == null ? void 0 : h.driverName) || "Driver"
193
193
  };
194
194
  }
195
- function Pe() {
196
- const { cdnUrl: e } = T(), { data: r } = L({
195
+ function Ee() {
196
+ const { cdnUrl: t } = T(), { data: r } = L({
197
197
  queryKey: ["pitvox", "users", "index"],
198
- queryFn: () => R(e, "users/index.json"),
198
+ queryFn: () => $(t, "users/index.json"),
199
199
  staleTime: 5 * 6e4,
200
200
  gcTime: 30 * 6e4
201
201
  }), n = (r == null ? void 0 : r.users) || {};
@@ -209,9 +209,9 @@ function Pe() {
209
209
  };
210
210
  }
211
211
  function Fe() {
212
- const { cdnUrl: e } = T(), { data: r } = L({
212
+ const { cdnUrl: t } = T(), { data: r } = L({
213
213
  queryKey: ["pitvox", "cars", "index"],
214
- queryFn: () => R(e, "cars/index.json"),
214
+ queryFn: () => $(t, "cars/index.json"),
215
215
  staleTime: 5 * 6e4,
216
216
  gcTime: 30 * 6e4
217
217
  });
@@ -220,71 +220,71 @@ function Fe() {
220
220
  cars: (r == null ? void 0 : r.cars) || {}
221
221
  };
222
222
  }
223
- function Mt(e, r) {
224
- return le(e, null, { carId: r });
223
+ function Et(t, r) {
224
+ return ce(t, null, { carId: r });
225
225
  }
226
- function Ue() {
227
- const { cdnUrl: e, partnerSlug: r } = T();
226
+ function _e() {
227
+ const { cdnUrl: t, partnerSlug: r } = T();
228
228
  return L({
229
229
  queryKey: ["pitvox", "competitions", r],
230
230
  queryFn: async () => {
231
- const n = await R(e, "competitions/index.json");
231
+ const n = await $(t, "competitions/index.json");
232
232
  return n != null && n.competitions ? n.competitions.filter((a) => a.partnerSlug === r) : [];
233
233
  },
234
234
  staleTime: 6e4
235
235
  });
236
236
  }
237
- function oe(e) {
237
+ function de(t) {
238
238
  const { cdnUrl: r, partnerSlug: n } = T();
239
239
  return L({
240
- queryKey: ["pitvox", "competition", n, e, "config"],
241
- queryFn: () => R(r, `competitions/${n}/${e}/config.json`),
242
- enabled: !!e,
240
+ queryKey: ["pitvox", "competition", n, t, "config"],
241
+ queryFn: () => $(r, `competitions/${n}/${t}/config.json`),
242
+ enabled: !!t,
243
243
  staleTime: 6e4
244
244
  });
245
245
  }
246
- function Ee(e) {
246
+ function qe(t) {
247
247
  const { cdnUrl: r, partnerSlug: n } = T();
248
248
  return L({
249
- queryKey: ["pitvox", "competition", n, e, "standings"],
250
- queryFn: () => R(r, `competitions/${n}/${e}/standings.json`),
251
- enabled: !!e,
249
+ queryKey: ["pitvox", "competition", n, t, "standings"],
250
+ queryFn: () => $(r, `competitions/${n}/${t}/standings.json`),
251
+ enabled: !!t,
252
252
  staleTime: 6e4
253
253
  });
254
254
  }
255
- function qe(e, r) {
255
+ function je(t, r) {
256
256
  const { cdnUrl: n, partnerSlug: a } = T();
257
257
  return L({
258
- queryKey: ["pitvox", "competition", a, e, "round", r],
259
- queryFn: () => R(n, `competitions/${a}/${e}/rounds/${r}.json`),
260
- enabled: !!e && r != null,
258
+ queryKey: ["pitvox", "competition", a, t, "round", r],
259
+ queryFn: () => $(n, `competitions/${a}/${t}/rounds/${r}.json`),
260
+ enabled: !!t && r != null,
261
261
  staleTime: 6e4
262
262
  });
263
263
  }
264
- function It(e, r = []) {
264
+ function Ft(t, r = []) {
265
265
  const { cdnUrl: n, partnerSlug: a } = T();
266
266
  return L({
267
- queryKey: ["pitvox", "competition", a, e, "allRounds", r],
267
+ queryKey: ["pitvox", "competition", a, t, "allRounds", r],
268
268
  queryFn: async () => (await Promise.all(
269
269
  r.map(
270
- (i) => R(n, `competitions/${a}/${e}/rounds/${i}.json`).catch(() => null)
270
+ (i) => $(n, `competitions/${a}/${t}/rounds/${i}.json`).catch(() => null)
271
271
  )
272
272
  )).filter(Boolean),
273
- enabled: !!e && r.length > 0,
273
+ enabled: !!t && r.length > 0,
274
274
  staleTime: 6e4
275
275
  });
276
276
  }
277
- function _e(e) {
277
+ function Ve(t) {
278
278
  const { cdnUrl: r, partnerSlug: n } = T();
279
279
  return L({
280
- queryKey: ["pitvox", "competition", n, e, "entrylist"],
281
- queryFn: () => R(r, `competitions/${n}/${e}/entrylist.json`),
282
- enabled: !!e,
280
+ queryKey: ["pitvox", "competition", n, t, "entrylist"],
281
+ queryFn: () => $(r, `competitions/${n}/${t}/entrylist.json`),
282
+ enabled: !!t,
283
283
  staleTime: 6e4
284
284
  });
285
285
  }
286
- async function ce(e, r, n, a = {}) {
287
- const s = await fetch(`${e}${n}`, {
286
+ async function pe(t, r, n, a = {}) {
287
+ const s = await fetch(`${t}${n}`, {
288
288
  ...a,
289
289
  headers: {
290
290
  "Content-Type": "application/json",
@@ -298,63 +298,63 @@ async function ce(e, r, n, a = {}) {
298
298
  }
299
299
  return s.json();
300
300
  }
301
- function je(e, r, n, a) {
302
- return ce(e, r, `/api/v1/competitions/${n}/register`, {
301
+ function Ke(t, r, n, a) {
302
+ return pe(t, r, `/api/v1/competitions/${n}/register`, {
303
303
  method: "POST",
304
304
  body: JSON.stringify(a)
305
305
  });
306
306
  }
307
- function Ve(e, r, n, a) {
308
- return ce(e, r, `/api/v1/competitions/${n}/register/${a}`, {
307
+ function He(t, r, n, a) {
308
+ return pe(t, r, `/api/v1/competitions/${n}/register/${a}`, {
309
309
  method: "DELETE"
310
310
  });
311
311
  }
312
- function Ke(e) {
312
+ function Oe(t) {
313
313
  const { cdnUrl: r, partnerSlug: n, getSteamId: a } = T(), s = a();
314
314
  return L({
315
- queryKey: ["pitvox", "registration", n, e, s],
315
+ queryKey: ["pitvox", "registration", n, t, s],
316
316
  queryFn: async () => {
317
- var v;
318
- const i = await fetch(`${r}/competitions/${n}/${e}/entrylist.json`);
317
+ var m;
318
+ const i = await fetch(`${r}/competitions/${n}/${t}/entrylist.json`);
319
319
  if (!i.ok) return { isRegistered: !1, entryList: null };
320
320
  const c = await i.json();
321
- return { isRegistered: !!s && ((v = c.drivers) == null ? void 0 : v.some((d) => d.steamId === s)), entryList: c };
321
+ return { isRegistered: !!s && ((m = c.drivers) == null ? void 0 : m.some((d) => d.steamId === s)), entryList: c };
322
322
  },
323
- enabled: !!e,
323
+ enabled: !!t,
324
324
  staleTime: 6e4
325
325
  });
326
326
  }
327
- function He(e) {
328
- const { apiUrl: r, apiKey: n, partnerSlug: a } = T(), s = Q();
329
- return ae({
330
- mutationFn: (i) => je(r, n, e, i),
327
+ function We(t) {
328
+ const { apiUrl: r, apiKey: n, partnerSlug: a } = T(), s = J();
329
+ return ie({
330
+ mutationFn: (i) => Ke(r, n, t, i),
331
331
  onSuccess: () => {
332
332
  s.invalidateQueries({
333
- queryKey: ["pitvox", "registration", a, e]
333
+ queryKey: ["pitvox", "registration", a, t]
334
334
  }), s.invalidateQueries({
335
- queryKey: ["pitvox", "competition", a, e, "entrylist"]
335
+ queryKey: ["pitvox", "competition", a, t, "entrylist"]
336
336
  });
337
337
  }
338
338
  });
339
339
  }
340
- function Oe(e) {
341
- const { apiUrl: r, apiKey: n, partnerSlug: a, getSteamId: s } = T(), i = Q();
342
- return ae({
340
+ function Ge(t) {
341
+ const { apiUrl: r, apiKey: n, partnerSlug: a, getSteamId: s } = T(), i = J();
342
+ return ie({
343
343
  mutationFn: (c) => {
344
- const l = c || s();
345
- if (!l) throw new Error("No Steam ID available");
346
- return Ve(r, n, e, l);
344
+ const o = c || s();
345
+ if (!o) throw new Error("No Steam ID available");
346
+ return He(r, n, t, o);
347
347
  },
348
348
  onSuccess: () => {
349
349
  i.invalidateQueries({
350
- queryKey: ["pitvox", "registration", a, e]
350
+ queryKey: ["pitvox", "registration", a, t]
351
351
  }), i.invalidateQueries({
352
- queryKey: ["pitvox", "competition", a, e, "entrylist"]
352
+ queryKey: ["pitvox", "competition", a, t, "entrylist"]
353
353
  });
354
354
  }
355
355
  });
356
356
  }
357
- const Ge = {
357
+ const ze = {
358
358
  formula: "Formula",
359
359
  gt3: "GT3",
360
360
  gt2: "GT2",
@@ -374,93 +374,93 @@ const Ge = {
374
374
  "2000s": "2000s",
375
375
  "2010s": "2010s",
376
376
  "2020s": "2020s"
377
- }, de = [
377
+ }, ue = [
378
378
  { id: "class", tags: ["formula", "gt3", "gt2", "gt4", "cup", "prototype", "rally"] },
379
379
  { id: "tier", tags: ["hypercar", "supercar", "sports_car", "hot_hatch", "lightweight"] },
380
380
  { id: "era", tags: ["1960s", "1970s", "1980s", "1990s", "2000s", "2010s", "2020s"] }
381
381
  ];
382
- function ze(e) {
383
- for (const r of de)
384
- if (r.tags.includes(e)) return r.id;
382
+ function Qe(t) {
383
+ for (const r of ue)
384
+ if (r.tags.includes(t)) return r.id;
385
385
  return "other";
386
386
  }
387
- function pe(e, r) {
387
+ function me(t, r) {
388
388
  if (r.size === 0) return !0;
389
389
  const n = {};
390
390
  for (const a of r) {
391
- const s = ze(a);
391
+ const s = Qe(a);
392
392
  n[s] || (n[s] = []), n[s].push(a);
393
393
  }
394
394
  for (const a of Object.values(n))
395
- if (!a.some((s) => e.includes(s))) return !1;
395
+ if (!a.some((s) => t.includes(s))) return !1;
396
396
  return !0;
397
397
  }
398
- function ue() {
399
- const [e, r] = W(/* @__PURE__ */ new Set()), n = O((s) => {
398
+ function he() {
399
+ const [t, r] = j(/* @__PURE__ */ new Set()), n = G((s) => {
400
400
  r((i) => {
401
401
  const c = new Set(i);
402
402
  return c.has(s) ? c.delete(s) : c.add(s), c;
403
403
  });
404
- }, []), a = O(() => r(/* @__PURE__ */ new Set()), []);
405
- return { activeTags: e, toggle: n, clear: a };
404
+ }, []), a = G(() => r(/* @__PURE__ */ new Set()), []);
405
+ return { activeTags: t, toggle: n, clear: a };
406
406
  }
407
- function Z(e) {
408
- const [r, n] = W(e), a = O((s) => {
407
+ function Z(t) {
408
+ const [r, n] = j(t), a = G((s) => {
409
409
  n(
410
410
  (i) => i.key === s ? { key: s, dir: i.dir === "asc" ? "desc" : "asc" } : { key: s, dir: s.includes("timestamp") || s.includes("Date") ? "desc" : "asc" }
411
411
  );
412
412
  }, []);
413
413
  return [r, a];
414
414
  }
415
- function X(e, r, n) {
416
- return [...e].sort((a, s) => {
415
+ function X(t, r, n) {
416
+ return [...t].sort((a, s) => {
417
417
  const i = n(a, r.key), c = n(s, r.key);
418
418
  if (i == null && c == null) return 0;
419
419
  if (i == null) return 1;
420
420
  if (c == null) return -1;
421
- const l = typeof i == "string" ? i.localeCompare(c) : i - c;
422
- return r.dir === "desc" ? -l : l;
421
+ const o = typeof i == "string" ? i.localeCompare(c) : i - c;
422
+ return r.dir === "desc" ? -o : o;
423
423
  });
424
424
  }
425
- function me(e, r = !1) {
426
- const n = r ? e == null ? void 0 : e.filter((a) => a.isValid) : e;
425
+ function ve(t, r = !1) {
426
+ const n = r ? t == null ? void 0 : t.filter((a) => a.isValid) : t;
427
427
  return n != null && n.length ? {
428
428
  s1: Math.min(...n.map((a) => a.sector1Ms).filter(Boolean)),
429
429
  s2: Math.min(...n.map((a) => a.sector2Ms).filter(Boolean)),
430
430
  s3: Math.min(...n.map((a) => a.sector3Ms).filter(Boolean))
431
431
  } : null;
432
432
  }
433
- function We({ active: e, dir: r }) {
434
- return e ? r === "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" }) });
433
+ function Je({ active: t, dir: r }) {
434
+ return t ? r === "asc" ? /* @__PURE__ */ e("svg", { className: "pvx-sort-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 15.75l7.5-7.5 7.5 7.5" }) }) : /* @__PURE__ */ e("svg", { className: "pvx-sort-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 8.25l-7.5 7.5-7.5-7.5" }) }) : /* @__PURE__ */ e("svg", { className: "pvx-sort-icon pvx-sort-icon--inactive", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 9l4-4 4 4M16 15l-4 4-4-4" }) });
435
435
  }
436
- function D({ label: e, sortKey: r, config: n, onSort: a, className: s = "" }) {
437
- return /* @__PURE__ */ t(
436
+ function D({ label: t, sortKey: r, config: n, onSort: a, className: s = "" }) {
437
+ return /* @__PURE__ */ e(
438
438
  "th",
439
439
  {
440
440
  className: `pvx-th pvx-th--sortable ${s}`,
441
441
  onClick: () => a(r),
442
- children: /* @__PURE__ */ o("span", { className: "pvx-th-inner", children: [
443
- e,
444
- /* @__PURE__ */ t(We, { active: n.key === r, dir: n.dir })
442
+ children: /* @__PURE__ */ l("span", { className: "pvx-th-inner", children: [
443
+ t,
444
+ /* @__PURE__ */ e(Je, { active: n.key === r, dir: n.dir })
445
445
  ] })
446
446
  }
447
447
  );
448
448
  }
449
- function Y({ userId: e, getUserDisplay: r }) {
450
- const { displayName: n, avatarUrl: a } = r(e);
451
- return /* @__PURE__ */ o("span", { className: "pvx-driver", children: [
452
- a ? /* @__PURE__ */ t("img", { src: a, alt: "", className: "pvx-driver-avatar" }) : /* @__PURE__ */ t("span", { className: "pvx-driver-avatar pvx-driver-avatar--placeholder" }),
453
- /* @__PURE__ */ t("span", { className: "pvx-driver-name", children: n })
449
+ function Y({ userId: t, getUserDisplay: r }) {
450
+ const { displayName: n, avatarUrl: a } = r(t);
451
+ return /* @__PURE__ */ l("span", { className: "pvx-driver", children: [
452
+ a ? /* @__PURE__ */ e("img", { src: a, alt: "", className: "pvx-driver-avatar" }) : /* @__PURE__ */ e("span", { className: "pvx-driver-avatar pvx-driver-avatar--placeholder" }),
453
+ /* @__PURE__ */ e("span", { className: "pvx-driver-name", children: n })
454
454
  ] });
455
455
  }
456
- function ve({ rank: e, podium: r = !1 }) {
457
- return /* @__PURE__ */ t("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 });
456
+ function xe({ rank: t, podium: r = !1 }) {
457
+ return /* @__PURE__ */ e("span", { className: r ? t === 1 ? "pvx-rank pvx-rank--gold" : t === 2 ? "pvx-rank pvx-rank--silver" : t === 3 ? "pvx-rank pvx-rank--bronze" : "pvx-rank" : "pvx-rank", children: t });
458
458
  }
459
- function he({ availableTags: e, activeTags: r, onToggle: n, onClear: a }) {
460
- if (!e || e.length < 2) return null;
461
- const s = de.map((i) => ({ id: i.id, tags: i.tags.filter((c) => e.includes(c)) })).filter((i) => i.tags.length > 0);
462
- return /* @__PURE__ */ o("div", { className: "pvx-tag-bar", children: [
463
- /* @__PURE__ */ t(
459
+ function ge({ availableTags: t, activeTags: r, onToggle: n, onClear: a }) {
460
+ if (!t || t.length < 2) return null;
461
+ const s = ue.map((i) => ({ id: i.id, tags: i.tags.filter((c) => t.includes(c)) })).filter((i) => i.tags.length > 0);
462
+ return /* @__PURE__ */ l("div", { className: "pvx-tag-bar", children: [
463
+ /* @__PURE__ */ e(
464
464
  "button",
465
465
  {
466
466
  onClick: a,
@@ -468,185 +468,185 @@ function he({ availableTags: e, activeTags: r, onToggle: n, onClear: a }) {
468
468
  children: "All"
469
469
  }
470
470
  ),
471
- s.map((i, c) => /* @__PURE__ */ o("span", { className: "contents", children: [
472
- c > 0 && /* @__PURE__ */ t("span", { className: "pvx-tag-separator" }),
473
- i.tags.map((l) => /* @__PURE__ */ t(
471
+ s.map((i, c) => /* @__PURE__ */ l("span", { className: "contents", children: [
472
+ c > 0 && /* @__PURE__ */ e("span", { className: "pvx-tag-separator" }),
473
+ i.tags.map((o) => /* @__PURE__ */ e(
474
474
  "button",
475
475
  {
476
- onClick: () => n(l),
477
- className: `pvx-tag ${r.has(l) ? "pvx-tag--active" : ""}`,
478
- children: Ge[l] || l
476
+ onClick: () => n(o),
477
+ className: `pvx-tag ${r.has(o) ? "pvx-tag--active" : ""}`,
478
+ children: ze[o] || o
479
479
  },
480
- l
480
+ o
481
481
  ))
482
482
  ] }, i.id))
483
483
  ] });
484
484
  }
485
- function ee({ segments: e }) {
486
- return /* @__PURE__ */ t("nav", { className: "pvx-breadcrumb", "aria-label": "Breadcrumb", children: /* @__PURE__ */ t("ol", { className: "pvx-breadcrumb-list", children: e.map((r, n) => {
487
- const a = n === e.length - 1;
488
- return /* @__PURE__ */ o("li", { className: "pvx-breadcrumb-item", children: [
489
- n > 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" }) }),
490
- !a && r.onClick ? /* @__PURE__ */ t("button", { onClick: r.onClick, className: "pvx-breadcrumb-link", children: r.label }) : /* @__PURE__ */ t("span", { className: "pvx-breadcrumb-current", children: r.label })
485
+ function ee({ segments: t }) {
486
+ return /* @__PURE__ */ e("nav", { className: "pvx-breadcrumb", "aria-label": "Breadcrumb", children: /* @__PURE__ */ e("ol", { className: "pvx-breadcrumb-list", children: t.map((r, n) => {
487
+ const a = n === t.length - 1;
488
+ return /* @__PURE__ */ l("li", { className: "pvx-breadcrumb-item", children: [
489
+ n > 0 && /* @__PURE__ */ e("svg", { className: "pvx-breadcrumb-chevron", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.25 4.5l7.5 7.5-7.5 7.5" }) }),
490
+ !a && r.onClick ? /* @__PURE__ */ e("button", { onClick: r.onClick, className: "pvx-breadcrumb-link", children: r.label }) : /* @__PURE__ */ e("span", { className: "pvx-breadcrumb-current", children: r.label })
491
491
  ] }, r.key);
492
492
  }) }) });
493
493
  }
494
- function j({ message: e }) {
495
- return /* @__PURE__ */ o("div", { className: "pvx-empty", children: [
496
- /* @__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" }) }),
497
- /* @__PURE__ */ t("p", { children: e })
494
+ function K({ message: t }) {
495
+ return /* @__PURE__ */ l("div", { className: "pvx-empty", children: [
496
+ /* @__PURE__ */ e("svg", { className: "pvx-empty-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 1.5, stroke: "currentColor", children: /* @__PURE__ */ e("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" }) }),
497
+ /* @__PURE__ */ e("p", { children: t })
498
498
  ] });
499
499
  }
500
- function V() {
501
- return /* @__PURE__ */ t("div", { className: "pvx-loading", children: "Loading..." });
502
- }
503
- function Qe() {
504
- 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" }) });
505
- }
506
- function Je() {
507
- 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" }) });
508
- }
509
- function Ze({ tracks: e, isLoading: r, carMetadata: n, getUserDisplay: a, onTrackSelect: s }) {
510
- const [i, c] = Z({ key: "record.timestamp", dir: "desc" }), { activeTags: l, toggle: v, clear: d } = ue(), f = k(() => {
511
- var g;
512
- if (!((g = n == null ? void 0 : n.tags) != null && g.length)) return [];
513
- const m = /* @__PURE__ */ new Set();
514
- for (const p of e || [])
515
- p.recordByTag && Object.keys(p.recordByTag).forEach((h) => m.add(h));
516
- return n.tags.filter((p) => m.has(p));
517
- }, [e, n]), N = k(() => e ? l.size === 0 ? e : e.map((m) => {
518
- var h, u;
519
- if (!m.recordByTag) return null;
520
- let g = null;
500
+ function H() {
501
+ return /* @__PURE__ */ e("div", { className: "pvx-loading", children: "Loading..." });
502
+ }
503
+ function Ze() {
504
+ return /* @__PURE__ */ e("svg", { className: "pvx-icon pvx-icon--valid", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 12.75l6 6 9-13.5" }) });
505
+ }
506
+ function Xe() {
507
+ return /* @__PURE__ */ e("svg", { className: "pvx-icon pvx-icon--invalid", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) });
508
+ }
509
+ function Ye({ tracks: t, isLoading: r, carMetadata: n, getUserDisplay: a, onTrackSelect: s }) {
510
+ const [i, c] = Z({ key: "record.timestamp", dir: "desc" }), { activeTags: o, toggle: m, clear: d } = he(), g = k(() => {
511
+ var f;
512
+ if (!((f = n == null ? void 0 : n.tags) != null && f.length)) return [];
513
+ const h = /* @__PURE__ */ new Set();
514
+ for (const p of t || [])
515
+ p.recordByTag && Object.keys(p.recordByTag).forEach((v) => h.add(v));
516
+ return n.tags.filter((p) => h.has(p));
517
+ }, [t, n]), N = k(() => t ? o.size === 0 ? t : t.map((h) => {
518
+ var v, u;
519
+ if (!h.recordByTag) return null;
520
+ let f = null;
521
521
  const p = /* @__PURE__ */ new Set();
522
- for (const y of Object.values(m.recordByTag)) {
522
+ for (const y of Object.values(h.recordByTag)) {
523
523
  if (p.has(y.carId)) continue;
524
524
  p.add(y.carId);
525
- const C = ((u = (h = n == null ? void 0 : n.cars) == null ? void 0 : h[y.carId]) == null ? void 0 : u.tags) || ["sports_car"];
526
- pe(C, l) && (!g || y.lapTimeMs < g.lapTimeMs) && (g = y);
525
+ const C = ((u = (v = n == null ? void 0 : n.cars) == null ? void 0 : v[y.carId]) == null ? void 0 : u.tags) || ["sports_car"];
526
+ me(C, o) && (!f || y.lapTimeMs < f.lapTimeMs) && (f = y);
527
527
  }
528
- return g ? {
529
- ...m,
528
+ return f ? {
529
+ ...h,
530
530
  record: {
531
- visibleId: g.steamId || g.identifier,
532
- carId: g.carId,
533
- carDisplayName: B(g.carId),
534
- lapTimeMs: g.lapTimeMs,
535
- timestamp: g.recordedAt
531
+ visibleId: f.steamId || f.identifier,
532
+ carId: f.carId,
533
+ carDisplayName: I(f.carId),
534
+ lapTimeMs: f.lapTimeMs,
535
+ timestamp: f.recordedAt
536
536
  }
537
537
  } : null;
538
- }).filter(Boolean) : [], [e, l, n]), x = k(() => X(N, i, (m, g) => {
539
- var p, h;
540
- switch (g) {
538
+ }).filter(Boolean) : [], [t, o, n]), x = k(() => X(N, i, (h, f) => {
539
+ var p, v;
540
+ switch (f) {
541
541
  case "displayName":
542
- return m.displayName;
542
+ return h.displayName;
543
543
  case "record.lapTimeMs":
544
- return (p = m.record) == null ? void 0 : p.lapTimeMs;
544
+ return (p = h.record) == null ? void 0 : p.lapTimeMs;
545
545
  case "driverCount":
546
- return m.driverCount || 0;
546
+ return h.driverCount || 0;
547
547
  case "carCount":
548
- return m.carCount || 0;
548
+ return h.carCount || 0;
549
549
  case "record.timestamp":
550
550
  default:
551
- return (h = m.record) != null && h.timestamp ? new Date(m.record.timestamp).getTime() : 0;
551
+ return (v = h.record) != null && v.timestamp ? new Date(h.record.timestamp).getTime() : 0;
552
552
  }
553
553
  }), [N, i]);
554
- return r ? /* @__PURE__ */ t(V, {}) : e != null && e.length ? /* @__PURE__ */ o("div", { className: "pvx-card", children: [
555
- /* @__PURE__ */ t("div", { className: "pvx-card-header", children: /* @__PURE__ */ t("h2", { className: "pvx-card-title", children: "Track Records" }) }),
556
- /* @__PURE__ */ t(he, { availableTags: f, activeTags: l, onToggle: v, onClear: d }),
557
- /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ o("table", { className: "pvx-table", children: [
558
- /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ o("tr", { className: "pvx-thead-row", children: [
559
- /* @__PURE__ */ t(D, { label: "Track", sortKey: "displayName", config: i, onSort: c }),
560
- /* @__PURE__ */ t("th", { className: "pvx-th", children: "Record Holder" }),
561
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-lg", children: "Car" }),
562
- /* @__PURE__ */ t(D, { label: "Lap Time", sortKey: "record.lapTimeMs", config: i, onSort: c }),
563
- /* @__PURE__ */ t(D, { label: "Drivers", sortKey: "driverCount", config: i, onSort: c, className: "pvx-hidden-below-md" }),
564
- /* @__PURE__ */ t(D, { label: "Cars", sortKey: "carCount", config: i, onSort: c, className: "pvx-hidden-below-lg" }),
565
- /* @__PURE__ */ t(D, { label: "Date", sortKey: "record.timestamp", config: i, onSort: c, className: "pvx-hidden-below-xl" })
554
+ return r ? /* @__PURE__ */ e(H, {}) : t != null && t.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
555
+ /* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ e("h2", { className: "pvx-card-title", children: "Track Records" }) }),
556
+ /* @__PURE__ */ e(ge, { availableTags: g, activeTags: o, onToggle: m, onClear: d }),
557
+ /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
558
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
559
+ /* @__PURE__ */ e(D, { label: "Track", sortKey: "displayName", config: i, onSort: c }),
560
+ /* @__PURE__ */ e("th", { className: "pvx-th", children: "Record Holder" }),
561
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-lg", children: "Car" }),
562
+ /* @__PURE__ */ e(D, { label: "Lap Time", sortKey: "record.lapTimeMs", config: i, onSort: c }),
563
+ /* @__PURE__ */ e(D, { label: "Drivers", sortKey: "driverCount", config: i, onSort: c, className: "pvx-hidden-below-md" }),
564
+ /* @__PURE__ */ e(D, { label: "Cars", sortKey: "carCount", config: i, onSort: c, className: "pvx-hidden-below-lg" }),
565
+ /* @__PURE__ */ e(D, { label: "Date", sortKey: "record.timestamp", config: i, onSort: c, className: "pvx-hidden-below-xl" })
566
566
  ] }) }),
567
- /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: x.map((m) => {
568
- var g, p, h;
569
- return /* @__PURE__ */ o(
567
+ /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: x.map((h) => {
568
+ var f, p, v;
569
+ return /* @__PURE__ */ l(
570
570
  "tr",
571
571
  {
572
572
  className: "pvx-row pvx-row--clickable",
573
- onClick: () => s(m.id, m.layout),
573
+ onClick: () => s(h.id, h.layout),
574
574
  children: [
575
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary", children: m.displayName }),
576
- /* @__PURE__ */ t("td", { className: "pvx-td", children: (g = m.record) != null && g.visibleId ? /* @__PURE__ */ t(Y, { userId: m.record.visibleId, getUserDisplay: a }) : "-" }),
577
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-hidden-below-lg", children: ((p = m.record) == null ? void 0 : p.carDisplayName) || "-" }),
578
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: m.record ? U(m.record.lapTimeMs) : "-" }),
579
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: m.driverCount || "-" }),
580
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: m.carCount || "-" }),
581
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: (h = m.record) != null && h.timestamp ? E(m.record.timestamp) : "-" })
575
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary", children: h.displayName }),
576
+ /* @__PURE__ */ e("td", { className: "pvx-td", children: (f = h.record) != null && f.visibleId ? /* @__PURE__ */ e(Y, { userId: h.record.visibleId, getUserDisplay: a }) : "-" }),
577
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-hidden-below-lg", children: ((p = h.record) == null ? void 0 : p.carDisplayName) || "-" }),
578
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: h.record ? E(h.record.lapTimeMs) : "-" }),
579
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: h.driverCount || "-" }),
580
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: h.carCount || "-" }),
581
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: (v = h.record) != null && v.timestamp ? F(h.record.timestamp) : "-" })
582
582
  ]
583
583
  },
584
- `${m.id}|${m.layout || ""}`
584
+ `${h.id}|${h.layout || ""}`
585
585
  );
586
586
  }) })
587
587
  ] }) })
588
- ] }) : /* @__PURE__ */ t(j, { message: "No lap times recorded yet." });
588
+ ] }) : /* @__PURE__ */ e(K, { message: "No lap times recorded yet." });
589
589
  }
590
- function Xe({ entries: e, isLoading: r, track: n, carMetadata: a, getUserDisplay: s, onCarSelect: i, onNavigate: c }) {
591
- const [l, v] = Z({ key: "lapTimeMs", dir: "asc" }), { activeTags: d, toggle: f, clear: N } = ue(), x = k(() => {
590
+ function et({ entries: t, isLoading: r, track: n, carMetadata: a, getUserDisplay: s, onCarSelect: i, onNavigate: c }) {
591
+ const [o, m] = Z({ key: "lapTimeMs", dir: "asc" }), { activeTags: d, toggle: g, clear: N } = he(), x = k(() => {
592
592
  var u, y, C;
593
- if (!e || !((u = a == null ? void 0 : a.tags) != null && u.length)) return [];
594
- const h = /* @__PURE__ */ new Set();
595
- for (const $ of e)
596
- (((C = (y = a.cars) == null ? void 0 : y[$.carId]) == null ? void 0 : C.tags) || ["sports_car"]).forEach((S) => h.add(S));
597
- return a.tags.filter(($) => h.has($));
598
- }, [e, a]), m = k(() => e ? d.size === 0 ? e : e.filter((h) => {
593
+ if (!t || !((u = a == null ? void 0 : a.tags) != null && u.length)) return [];
594
+ const v = /* @__PURE__ */ new Set();
595
+ for (const R of t)
596
+ (((C = (y = a.cars) == null ? void 0 : y[R.carId]) == null ? void 0 : C.tags) || ["sports_car"]).forEach((S) => v.add(S));
597
+ return a.tags.filter((R) => v.has(R));
598
+ }, [t, a]), h = k(() => t ? d.size === 0 ? t : t.filter((v) => {
599
599
  var y, C;
600
- const u = ((C = (y = a == null ? void 0 : a.cars) == null ? void 0 : y[h.carId]) == null ? void 0 : C.tags) || ["sports_car"];
601
- return pe(u, d);
602
- }) : [], [e, d, a]), g = k(() => X(m, l, (h, u) => {
600
+ const u = ((C = (y = a == null ? void 0 : a.cars) == null ? void 0 : y[v.carId]) == null ? void 0 : C.tags) || ["sports_car"];
601
+ return me(u, d);
602
+ }) : [], [t, d, a]), f = k(() => X(h, o, (v, u) => {
603
603
  switch (u) {
604
604
  case "carId":
605
- return B(h.carId);
605
+ return I(v.carId);
606
606
  case "driverCount":
607
- return h.driverCount || 0;
607
+ return v.driverCount || 0;
608
608
  case "lapTimeMs":
609
609
  default:
610
- return h.lapTimeMs;
610
+ return v.lapTimeMs;
611
611
  }
612
- }), [m, l]), p = [
612
+ }), [h, o]), p = [
613
613
  { key: "tracks", label: "Tracks", onClick: () => c("tracks") },
614
614
  { key: "track", label: n.displayName }
615
615
  ];
616
- return r ? /* @__PURE__ */ t(V, {}) : /* @__PURE__ */ o("div", { className: "pvx-card", children: [
617
- /* @__PURE__ */ t("div", { className: "pvx-card-header", children: /* @__PURE__ */ t(ee, { segments: p }) }),
618
- /* @__PURE__ */ t(he, { availableTags: x, activeTags: d, onToggle: f, onClear: N }),
619
- e != null && e.length ? /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ o("table", { className: "pvx-table", children: [
620
- /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ o("tr", { className: "pvx-thead-row", children: [
621
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
622
- /* @__PURE__ */ t(D, { label: "Car", sortKey: "carId", config: l, onSort: v }),
623
- /* @__PURE__ */ t("th", { className: "pvx-th", children: "Record Holder" }),
624
- /* @__PURE__ */ t(D, { label: "Lap Time", sortKey: "lapTimeMs", config: l, onSort: v }),
625
- /* @__PURE__ */ t(D, { label: "Drivers", sortKey: "driverCount", config: l, onSort: v, className: "pvx-hidden-below-md" }),
626
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-lg", children: "Date" })
616
+ return r ? /* @__PURE__ */ e(H, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
617
+ /* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ e(ee, { segments: p }) }),
618
+ /* @__PURE__ */ e(ge, { availableTags: x, activeTags: d, onToggle: g, onClear: N }),
619
+ t != null && t.length ? /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
620
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
621
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
622
+ /* @__PURE__ */ e(D, { label: "Car", sortKey: "carId", config: o, onSort: m }),
623
+ /* @__PURE__ */ e("th", { className: "pvx-th", children: "Record Holder" }),
624
+ /* @__PURE__ */ e(D, { label: "Lap Time", sortKey: "lapTimeMs", config: o, onSort: m }),
625
+ /* @__PURE__ */ e(D, { label: "Drivers", sortKey: "driverCount", config: o, onSort: m, className: "pvx-hidden-below-md" }),
626
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-lg", children: "Date" })
627
627
  ] }) }),
628
- /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: g.map((h, u) => /* @__PURE__ */ o(
628
+ /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: f.map((v, u) => /* @__PURE__ */ l(
629
629
  "tr",
630
630
  {
631
631
  className: "pvx-row pvx-row--clickable",
632
- onClick: () => i(h.carId),
632
+ onClick: () => i(v.carId),
633
633
  children: [
634
- /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t(ve, { rank: u + 1, podium: !0 }) }),
635
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary", children: B(h.carId) }),
636
- /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t(Y, { userId: h.steamId || h.userId, getUserDisplay: s }) }),
637
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: U(h.lapTimeMs) }),
638
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: h.driverCount || "-" }),
639
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-lg", children: h.recordedAt ? E(h.recordedAt) : "-" })
634
+ /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(xe, { rank: u + 1, podium: !0 }) }),
635
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary", children: I(v.carId) }),
636
+ /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(Y, { userId: v.steamId || v.userId, getUserDisplay: s }) }),
637
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: E(v.lapTimeMs) }),
638
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: v.driverCount || "-" }),
639
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-lg", children: v.recordedAt ? F(v.recordedAt) : "-" })
640
640
  ]
641
641
  },
642
- h.carId
642
+ v.carId
643
643
  )) })
644
- ] }) }) : /* @__PURE__ */ t(j, { message: "No lap times for this track yet." })
644
+ ] }) }) : /* @__PURE__ */ e(K, { message: "No lap times for this track yet." })
645
645
  ] });
646
646
  }
647
- function Ye({ entries: e, isLoading: r, track: n, carId: a, getUserDisplay: s, onDriverSelect: i, onNavigate: c }) {
648
- const [l, v] = Z({ key: "lapTimeMs", dir: "asc" }), d = k(() => me(e), [e]), f = k(() => X(e || [], l, (x, m) => {
649
- switch (m) {
647
+ function tt({ entries: t, isLoading: r, track: n, carId: a, getUserDisplay: s, onDriverSelect: i, onNavigate: c }) {
648
+ const [o, m] = Z({ key: "lapTimeMs", dir: "asc" }), d = k(() => ve(t), [t]), g = k(() => X(t || [], o, (x, h) => {
649
+ switch (h) {
650
650
  case "userId":
651
651
  return s(x.steamId || x.userId).displayName;
652
652
  case "lapCount":
@@ -655,237 +655,237 @@ function Ye({ entries: e, isLoading: r, track: n, carId: a, getUserDisplay: s, o
655
655
  default:
656
656
  return x.lapTimeMs;
657
657
  }
658
- }), [e, l, s]), N = [
658
+ }), [t, o, s]), N = [
659
659
  { key: "tracks", label: "Tracks", onClick: () => c("tracks") },
660
660
  { key: "track", label: n.displayName, onClick: () => c("track") },
661
- { key: "car", label: B(a) }
661
+ { key: "car", label: I(a) }
662
662
  ];
663
- return r ? /* @__PURE__ */ t(V, {}) : /* @__PURE__ */ o("div", { className: "pvx-card", children: [
664
- /* @__PURE__ */ t("div", { className: "pvx-card-header", children: /* @__PURE__ */ t(ee, { segments: N }) }),
665
- e != null && e.length ? /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ o("table", { className: "pvx-table", children: [
666
- /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ o("tr", { className: "pvx-thead-row", children: [
667
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
668
- /* @__PURE__ */ t(D, { label: "Driver", sortKey: "userId", config: l, onSort: v }),
669
- /* @__PURE__ */ t(D, { label: "Lap Time", sortKey: "lapTimeMs", config: l, onSort: v }),
670
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
671
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
672
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" }),
673
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-lg", children: "Tyre" }),
674
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-xl", children: "Fuel" }),
675
- /* @__PURE__ */ t(D, { label: "Laps", sortKey: "lapCount", config: l, onSort: v, className: "pvx-hidden-below-lg" }),
676
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
663
+ return r ? /* @__PURE__ */ e(H, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
664
+ /* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ e(ee, { segments: N }) }),
665
+ t != null && t.length ? /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
666
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
667
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
668
+ /* @__PURE__ */ e(D, { label: "Driver", sortKey: "userId", config: o, onSort: m }),
669
+ /* @__PURE__ */ e(D, { label: "Lap Time", sortKey: "lapTimeMs", config: o, onSort: m }),
670
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
671
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
672
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" }),
673
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-lg", children: "Tyre" }),
674
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-xl", children: "Fuel" }),
675
+ /* @__PURE__ */ e(D, { label: "Laps", sortKey: "lapCount", config: o, onSort: m, className: "pvx-hidden-below-lg" }),
676
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
677
677
  ] }) }),
678
- /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: f.map((x, m) => {
679
- const g = m + 1, p = x.steamId || x.userId, h = d && x.sector1Ms === d.s1, u = d && x.sector2Ms === d.s2, y = d && x.sector3Ms === d.s3;
680
- return /* @__PURE__ */ o(
678
+ /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: g.map((x, h) => {
679
+ const f = h + 1, p = x.steamId || x.userId, v = d && x.sector1Ms === d.s1, u = d && x.sector2Ms === d.s2, y = d && x.sector3Ms === d.s3;
680
+ return /* @__PURE__ */ l(
681
681
  "tr",
682
682
  {
683
- className: `pvx-row pvx-row--clickable ${g <= 3 ? "pvx-row--podium" : ""}`,
683
+ className: `pvx-row pvx-row--clickable ${f <= 3 ? "pvx-row--podium" : ""}`,
684
684
  onClick: () => i(p),
685
685
  children: [
686
- /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t(ve, { rank: g, podium: !0 }) }),
687
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ t(Y, { userId: p, getUserDisplay: s }) }),
688
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: U(x.lapTimeMs) }),
689
- /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${h ? "pvx-td--best-sector" : ""}`, children: P(x.sector1Ms) }),
690
- /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${u ? "pvx-td--best-sector" : ""}`, children: P(x.sector2Ms) }),
691
- /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${y ? "pvx-td--best-sector" : ""}`, children: P(x.sector3Ms) }),
692
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: ie(x.tyreCompound), children: x.tyreCompound || "-" }),
693
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-xl", children: x.startingFuelL ? `${x.startingFuelL}L` : "-" }),
694
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: x.lapCount || "-" }),
695
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: x.recordedAt ? E(x.recordedAt) : "-" })
686
+ /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(xe, { rank: f, podium: !0 }) }),
687
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ e(Y, { userId: p, getUserDisplay: s }) }),
688
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: E(x.lapTimeMs) }),
689
+ /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${v ? "pvx-td--best-sector" : ""}`, children: P(x.sector1Ms) }),
690
+ /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${u ? "pvx-td--best-sector" : ""}`, children: P(x.sector2Ms) }),
691
+ /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${y ? "pvx-td--best-sector" : ""}`, children: P(x.sector3Ms) }),
692
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: le(x.tyreCompound), children: x.tyreCompound || "-" }),
693
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-xl", children: x.startingFuelL ? `${x.startingFuelL}L` : "-" }),
694
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: x.lapCount || "-" }),
695
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: x.recordedAt ? F(x.recordedAt) : "-" })
696
696
  ]
697
697
  },
698
698
  p
699
699
  );
700
700
  }) })
701
- ] }) }) : /* @__PURE__ */ t(j, { message: "No lap times for this car yet." })
701
+ ] }) }) : /* @__PURE__ */ e(K, { message: "No lap times for this car yet." })
702
702
  ] });
703
703
  }
704
- function et({ userId: e, track: r, carId: n, game: a, gameVersion: s, showInvalid: i, getUserDisplay: c, onToggleInvalid: l, onNavigate: v }) {
705
- const { data: d, driverName: f, isLoading: N } = Ae(e, r.id, r.layout, n, { showInvalid: i, game: a, gameVersion: s }), { displayName: x, avatarUrl: m } = c(e, f), g = k(() => me(d, !0), [d]), p = k(() => {
704
+ function nt({ userId: t, track: r, carId: n, game: a, gameVersion: s, showInvalid: i, getUserDisplay: c, onToggleInvalid: o, onNavigate: m }) {
705
+ const { data: d, driverName: g, isLoading: N } = Ue(t, r.id, r.layout, n, { showInvalid: i, game: a, gameVersion: s }), { displayName: x, avatarUrl: h } = c(t, g), f = k(() => ve(d, !0), [d]), p = k(() => {
706
706
  const u = (d == null ? void 0 : d.filter((y) => y.isValid)) || [];
707
707
  return u.length ? Math.min(...u.map((y) => y.lapTimeMs)) : null;
708
- }, [d]), h = [
709
- { key: "tracks", label: "Tracks", onClick: () => v("tracks") },
710
- { key: "track", label: r.displayName, onClick: () => v("track") },
711
- { key: "car", label: B(n), onClick: () => v("car") },
708
+ }, [d]), v = [
709
+ { key: "tracks", label: "Tracks", onClick: () => m("tracks") },
710
+ { key: "track", label: r.displayName, onClick: () => m("track") },
711
+ { key: "car", label: I(n), onClick: () => m("car") },
712
712
  { key: "driver", label: x }
713
713
  ];
714
- return N ? /* @__PURE__ */ t(V, {}) : /* @__PURE__ */ o("div", { className: "pvx-card", children: [
715
- /* @__PURE__ */ o("div", { className: "pvx-card-header pvx-card-header--split", children: [
716
- /* @__PURE__ */ o("div", { className: "pvx-card-header-left", children: [
717
- /* @__PURE__ */ t(ee, { segments: h }),
718
- m ? /* @__PURE__ */ t("img", { src: m, alt: "", className: "pvx-driver-avatar pvx-driver-avatar--lg" }) : /* @__PURE__ */ t("span", { className: "pvx-driver-avatar pvx-driver-avatar--lg pvx-driver-avatar--placeholder" })
714
+ return N ? /* @__PURE__ */ e(H, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
715
+ /* @__PURE__ */ l("div", { className: "pvx-card-header pvx-card-header--split", children: [
716
+ /* @__PURE__ */ l("div", { className: "pvx-card-header-left", children: [
717
+ /* @__PURE__ */ e(ee, { segments: v }),
718
+ h ? /* @__PURE__ */ e("img", { src: h, alt: "", className: "pvx-driver-avatar pvx-driver-avatar--lg" }) : /* @__PURE__ */ e("span", { className: "pvx-driver-avatar pvx-driver-avatar--lg pvx-driver-avatar--placeholder" })
719
719
  ] }),
720
- /* @__PURE__ */ o("label", { className: "pvx-checkbox-label", children: [
721
- /* @__PURE__ */ t(
720
+ /* @__PURE__ */ l("label", { className: "pvx-checkbox-label", children: [
721
+ /* @__PURE__ */ e(
722
722
  "input",
723
723
  {
724
724
  type: "checkbox",
725
725
  checked: i,
726
- onChange: l,
726
+ onChange: o,
727
727
  className: "pvx-checkbox"
728
728
  }
729
729
  ),
730
- /* @__PURE__ */ t("span", { children: "Show invalid laps" })
730
+ /* @__PURE__ */ e("span", { children: "Show invalid laps" })
731
731
  ] })
732
732
  ] }),
733
- d != null && d.length ? /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ o("table", { className: "pvx-table", children: [
734
- /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ o("tr", { className: "pvx-thead-row", children: [
735
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
736
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-md", children: "Lap" }),
737
- /* @__PURE__ */ t("th", { className: "pvx-th", children: "Lap Time" }),
738
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
739
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
740
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" }),
741
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--narrow", children: "Valid" }),
742
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-lg", children: "Tyre" }),
743
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-lg", children: "Fuel" }),
744
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
733
+ d != null && d.length ? /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
734
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
735
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
736
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-md", children: "Lap" }),
737
+ /* @__PURE__ */ e("th", { className: "pvx-th", children: "Lap Time" }),
738
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
739
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
740
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" }),
741
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-th--narrow", children: "Valid" }),
742
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-lg", children: "Tyre" }),
743
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-lg", children: "Fuel" }),
744
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
745
745
  ] }) }),
746
- /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: d.map((u, y) => {
747
- const C = u.isValid && u.lapTimeMs === p, $ = g && u.isValid && u.sector1Ms === g.s1, _ = g && u.isValid && u.sector2Ms === g.s2, S = g && u.isValid && u.sector3Ms === g.s3;
746
+ /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: d.map((u, y) => {
747
+ const C = u.isValid && u.lapTimeMs === p, R = f && u.isValid && u.sector1Ms === f.s1, q = f && u.isValid && u.sector2Ms === f.s2, S = f && u.isValid && u.sector3Ms === f.s3;
748
748
  let A = "pvx-row";
749
- return u.isValid || (A += " pvx-row--invalid"), C && (A += " pvx-row--personal-best"), /* @__PURE__ */ o("tr", { className: A, children: [
750
- /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t("span", { className: `pvx-rank ${C ? "pvx-rank--gold" : ""}`, children: y + 1 }) }),
751
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-md", children: u.lapNumber || "-" }),
752
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: U(u.lapTimeMs) }),
753
- /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${$ ? "pvx-td--best-sector" : ""}`, children: P(u.sector1Ms) }),
754
- /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${_ ? "pvx-td--best-sector" : ""}`, children: P(u.sector2Ms) }),
755
- /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${S ? "pvx-td--best-sector" : ""}`, children: P(u.sector3Ms) }),
756
- /* @__PURE__ */ t("td", { className: "pvx-td", title: u.isValid ? void 0 : u.invalidReason || "Invalid", children: u.isValid ? /* @__PURE__ */ t(Qe, {}) : /* @__PURE__ */ t(Je, {}) }),
757
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: ie(u.tyreCompound), children: u.tyreCompound || "-" }),
758
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: u.startingFuelL ? `${u.startingFuelL}L` : "-" }),
759
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: E(u.timestamp) })
749
+ return u.isValid || (A += " pvx-row--invalid"), C && (A += " pvx-row--personal-best"), /* @__PURE__ */ l("tr", { className: A, children: [
750
+ /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e("span", { className: `pvx-rank ${C ? "pvx-rank--gold" : ""}`, children: y + 1 }) }),
751
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-md", children: u.lapNumber || "-" }),
752
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: E(u.lapTimeMs) }),
753
+ /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${R ? "pvx-td--best-sector" : ""}`, children: P(u.sector1Ms) }),
754
+ /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${q ? "pvx-td--best-sector" : ""}`, children: P(u.sector2Ms) }),
755
+ /* @__PURE__ */ e("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${S ? "pvx-td--best-sector" : ""}`, children: P(u.sector3Ms) }),
756
+ /* @__PURE__ */ e("td", { className: "pvx-td", title: u.isValid ? void 0 : u.invalidReason || "Invalid", children: u.isValid ? /* @__PURE__ */ e(Ze, {}) : /* @__PURE__ */ e(Xe, {}) }),
757
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: le(u.tyreCompound), children: u.tyreCompound || "-" }),
758
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: u.startingFuelL ? `${u.startingFuelL}L` : "-" }),
759
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: F(u.timestamp) })
760
760
  ] }, u.id);
761
761
  }) })
762
- ] }) }) : /* @__PURE__ */ t(j, { message: i ? "No laps recorded for this combination." : 'No valid laps. Try enabling "Show invalid laps".' })
762
+ ] }) }) : /* @__PURE__ */ e(K, { message: i ? "No laps recorded for this combination." : 'No valid laps. Try enabling "Show invalid laps".' })
763
763
  ] });
764
764
  }
765
- function At({ className: e, defaultGame: r = "evo", title: n = "Leaderboards" }) {
766
- const [a, s] = se(), i = Pe(), c = Fe(), l = a.get("game") || r, v = a.get("version"), d = a.get("track"), f = a.get("car"), N = a.get("driver"), x = a.get("invalid") === "true", {
767
- data: m,
768
- isLoading: g,
765
+ function _t({ className: t, defaultGame: r = "evo", title: n = "Leaderboards" }) {
766
+ const [a, s] = oe(), i = Ee(), c = Fe(), o = a.get("game") || r, m = a.get("version"), d = a.get("track"), g = a.get("car"), N = a.get("driver"), x = a.get("invalid") === "true", {
767
+ data: h,
768
+ isLoading: f,
769
769
  generatedAt: p,
770
- totalLaps: h,
770
+ totalLaps: v,
771
771
  totalUsers: u,
772
772
  versions: y
773
- } = Ie({ game: l }), C = y == null ? void 0 : y[l], $ = v || (C == null ? void 0 : C.default) || null, _ = k(() => !m || !$ ? m || [] : m.filter((b) => b.gameVersion === $), [m, $]), S = k(() => {
773
+ } = Pe({ game: o }), C = y == null ? void 0 : y[o], R = m || (C == null ? void 0 : C.default) || null, q = k(() => !h || !R ? h || [] : h.filter((b) => b.gameVersion === R), [h, R]), S = k(() => {
774
774
  if (!d) return null;
775
775
  const [b, w] = d.split("|");
776
- return { id: b, layout: w || null, displayName: J(b, w, l) };
777
- }, [d, l]), { data: A, isLoading: te } = le(
776
+ return { id: b, layout: w || null, displayName: V(b, w, o) };
777
+ }, [d, o]), { data: A, isLoading: te } = ce(
778
778
  S == null ? void 0 : S.id,
779
779
  S == null ? void 0 : S.layout,
780
- { carId: f, game: l, gameVersion: $ }
780
+ { carId: g, game: o, gameVersion: R }
781
781
  );
782
- function I(b) {
782
+ function B(b) {
783
783
  s(b);
784
784
  }
785
- function be(b) {
786
- I({ game: b });
785
+ function Ce(b) {
786
+ B({ game: b });
787
787
  }
788
- function ye(b) {
789
- const w = { game: l };
790
- b && b !== (C == null ? void 0 : C.default) && (w.version = b), I(w);
788
+ function we(b) {
789
+ const w = { game: o };
790
+ b && b !== (C == null ? void 0 : C.default) && (w.version = b), B(w);
791
791
  }
792
- function Ce(b, w) {
793
- const ne = { game: l, track: w ? `${b}|${w}` : b };
794
- v && (ne.version = v), I(ne);
792
+ function ke(b, w) {
793
+ const ne = { game: o, track: w ? `${b}|${w}` : b };
794
+ m && (ne.version = m), B(ne);
795
795
  }
796
- function we(b) {
797
- const w = { game: l, track: d };
798
- v && (w.version = v), b && (w.car = b), I(w);
796
+ function Te(b) {
797
+ const w = { game: o, track: d };
798
+ m && (w.version = m), b && (w.car = b), B(w);
799
799
  }
800
- function ke(b) {
801
- const w = { game: l, track: d, car: f, driver: b };
802
- v && (w.version = v), I(w);
800
+ function Se(b) {
801
+ const w = { game: o, track: d, car: g, driver: b };
802
+ m && (w.version = m), B(w);
803
803
  }
804
- function K(b) {
805
- const w = { game: l };
806
- v && (w.version = v), (b === "track" || b === "car") && (w.track = d), b === "car" && (w.car = f), I(w);
804
+ function O(b) {
805
+ const w = { game: o };
806
+ m && (w.version = m), (b === "track" || b === "car") && (w.track = d), b === "car" && (w.car = g), B(w);
807
807
  }
808
- function Te() {
809
- const b = { game: l, track: d, car: f, driver: N };
810
- v && (b.version = v), x || (b.invalid = "true"), I(b);
808
+ function Le() {
809
+ const b = { game: o, track: d, car: g, driver: N };
810
+ m && (b.version = m), x || (b.invalid = "true"), B(b);
811
811
  }
812
- const Se = () => S && f && N ? /* @__PURE__ */ t(
813
- et,
812
+ const $e = () => S && g && N ? /* @__PURE__ */ e(
813
+ nt,
814
814
  {
815
815
  userId: N,
816
816
  track: S,
817
- carId: f,
818
- game: l,
819
- gameVersion: $,
817
+ carId: g,
818
+ game: o,
819
+ gameVersion: R,
820
820
  showInvalid: x,
821
821
  getUserDisplay: i,
822
- onToggleInvalid: Te,
823
- onNavigate: K
822
+ onToggleInvalid: Le,
823
+ onNavigate: O
824
824
  }
825
- ) : S && f ? /* @__PURE__ */ t(
826
- Ye,
825
+ ) : S && g ? /* @__PURE__ */ e(
826
+ tt,
827
827
  {
828
828
  entries: A || [],
829
829
  isLoading: te,
830
830
  track: S,
831
- carId: f,
831
+ carId: g,
832
832
  getUserDisplay: i,
833
- onDriverSelect: ke,
834
- onNavigate: K
833
+ onDriverSelect: Se,
834
+ onNavigate: O
835
835
  }
836
- ) : S ? /* @__PURE__ */ t(
837
- Xe,
836
+ ) : S ? /* @__PURE__ */ e(
837
+ et,
838
838
  {
839
839
  entries: A || [],
840
840
  isLoading: te,
841
841
  track: S,
842
842
  carMetadata: c,
843
843
  getUserDisplay: i,
844
- onCarSelect: we,
845
- onNavigate: K
844
+ onCarSelect: Te,
845
+ onNavigate: O
846
846
  }
847
- ) : /* @__PURE__ */ t(
848
- Ze,
847
+ ) : /* @__PURE__ */ e(
848
+ Ye,
849
849
  {
850
- tracks: _,
851
- isLoading: g,
850
+ tracks: q,
851
+ isLoading: f,
852
852
  carMetadata: c,
853
853
  getUserDisplay: i,
854
- onTrackSelect: Ce
854
+ onTrackSelect: ke
855
855
  }
856
856
  );
857
- return /* @__PURE__ */ o("div", { className: `pvx-leaderboard-explorer ${e || ""}`, children: [
858
- /* @__PURE__ */ o("div", { className: "pvx-explorer-header", children: [
859
- /* @__PURE__ */ t("h1", { className: "pvx-explorer-title", children: n }),
860
- /* @__PURE__ */ o("div", { className: "pvx-explorer-stats", children: [
861
- h > 0 && /* @__PURE__ */ o("span", { children: [
862
- h.toLocaleString(),
857
+ return /* @__PURE__ */ l("div", { className: `pvx-leaderboard-explorer ${t || ""}`, children: [
858
+ /* @__PURE__ */ l("div", { className: "pvx-explorer-header", children: [
859
+ /* @__PURE__ */ e("h1", { className: "pvx-explorer-title", children: n }),
860
+ /* @__PURE__ */ l("div", { className: "pvx-explorer-stats", children: [
861
+ v > 0 && /* @__PURE__ */ l("span", { children: [
862
+ v.toLocaleString(),
863
863
  " laps"
864
864
  ] }),
865
- h > 0 && u > 0 && /* @__PURE__ */ t("span", { className: "pvx-explorer-stats-sep", children: "|" }),
866
- u > 0 && /* @__PURE__ */ o("span", { children: [
865
+ v > 0 && u > 0 && /* @__PURE__ */ e("span", { className: "pvx-explorer-stats-sep", children: "|" }),
866
+ u > 0 && /* @__PURE__ */ l("span", { children: [
867
867
  u.toLocaleString(),
868
868
  " drivers"
869
869
  ] })
870
870
  ] })
871
871
  ] }),
872
- /* @__PURE__ */ o("div", { className: "pvx-explorer-controls", children: [
873
- /* @__PURE__ */ t("div", { className: "pvx-game-tabs", children: ["evo", "acc"].map((b) => /* @__PURE__ */ t(
872
+ /* @__PURE__ */ l("div", { className: "pvx-explorer-controls", children: [
873
+ /* @__PURE__ */ e("div", { className: "pvx-game-tabs", children: ["evo", "acc"].map((b) => /* @__PURE__ */ e(
874
874
  "button",
875
875
  {
876
- onClick: () => be(b),
877
- className: `pvx-game-tab ${l === b ? "pvx-game-tab--active" : ""}`,
876
+ onClick: () => Ce(b),
877
+ className: `pvx-game-tab ${o === b ? "pvx-game-tab--active" : ""}`,
878
878
  children: b === "evo" ? "AC EVO" : "ACC"
879
879
  },
880
880
  b
881
881
  )) }),
882
- C && /* @__PURE__ */ t(
882
+ C && /* @__PURE__ */ e(
883
883
  "select",
884
884
  {
885
- value: $ || "",
886
- onChange: (b) => ye(b.target.value),
885
+ value: R || "",
886
+ onChange: (b) => we(b.target.value),
887
887
  className: "pvx-version-select",
888
- children: C.available.slice().reverse().map((b) => /* @__PURE__ */ o("option", { value: b, children: [
888
+ children: C.available.slice().reverse().map((b) => /* @__PURE__ */ l("option", { value: b, children: [
889
889
  "v",
890
890
  b,
891
891
  b === C.default ? " (Latest)" : ""
@@ -893,14 +893,14 @@ function At({ className: e, defaultGame: r = "evo", title: n = "Leaderboards" })
893
893
  }
894
894
  )
895
895
  ] }),
896
- Se(),
897
- p && /* @__PURE__ */ o("p", { className: "pvx-data-timestamp", children: [
896
+ $e(),
897
+ p && /* @__PURE__ */ l("p", { className: "pvx-data-timestamp", children: [
898
898
  "Data updated: ",
899
899
  new Date(p).toLocaleString()
900
900
  ] })
901
901
  ] });
902
902
  }
903
- const tt = {
903
+ const rt = {
904
904
  GBR: "🇬🇧",
905
905
  DEU: "🇩🇪",
906
906
  NLD: "🇳🇱",
@@ -931,24 +931,24 @@ const tt = {
931
931
  RUS: "🇷🇺",
932
932
  TUR: "🇹🇷",
933
933
  KOR: "🇰🇷"
934
- }, nt = {
934
+ }, at = {
935
935
  championship: "Championship",
936
936
  series: "Series",
937
937
  event: "Event"
938
938
  }, re = ["PRACTICE", "QUALIFYING", "RACE"];
939
- function xe({ position: e }) {
940
- 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 });
939
+ function fe({ position: t }) {
940
+ return /* @__PURE__ */ e("span", { className: t === 1 ? "pvx-rank pvx-rank--gold" : t === 2 ? "pvx-rank pvx-rank--silver" : t === 3 ? "pvx-rank pvx-rank--bronze" : "pvx-rank", children: t });
941
941
  }
942
- function fe({ nation: e }) {
943
- const r = e && tt[e];
944
- return r ? /* @__PURE__ */ t("span", { className: "pvx-nation-flag", title: e, children: r }) : null;
942
+ function Ne({ nation: t }) {
943
+ const r = t && rt[t];
944
+ return r ? /* @__PURE__ */ e("span", { className: "pvx-nation-flag", title: t, children: r }) : null;
945
945
  }
946
- function rt({ sessions: e, activeSession: r, onSelect: n }) {
947
- if (!e || e.length <= 1) return null;
948
- const a = [...e].sort(
946
+ function st({ sessions: t, activeSession: r, onSelect: n }) {
947
+ if (!t || t.length <= 1) return null;
948
+ const a = [...t].sort(
949
949
  (s, i) => re.indexOf(s.type) - re.indexOf(i.type)
950
950
  );
951
- return /* @__PURE__ */ t("div", { className: "pvx-session-tabs", children: a.map((s) => /* @__PURE__ */ t(
951
+ return /* @__PURE__ */ e("div", { className: "pvx-session-tabs", children: a.map((s) => /* @__PURE__ */ e(
952
952
  "button",
953
953
  {
954
954
  onClick: () => n(s.type),
@@ -958,21 +958,21 @@ function rt({ sessions: e, activeSession: r, onSelect: n }) {
958
958
  s.type
959
959
  )) });
960
960
  }
961
- function ge({ type: e }) {
962
- return /* @__PURE__ */ t("span", { className: `pvx-comp-badge pvx-comp-badge--${e}`, children: nt[e] || e });
961
+ function be({ type: t }) {
962
+ return /* @__PURE__ */ e("span", { className: `pvx-comp-badge pvx-comp-badge--${t}`, children: at[t] || t });
963
963
  }
964
- function F({ children: e, variant: r = "default" }) {
965
- return /* @__PURE__ */ t("span", { className: `pvx-info-pill ${r !== "default" ? `pvx-info-pill--${r}` : ""}`, children: e });
964
+ function U({ children: t, variant: r = "default" }) {
965
+ return /* @__PURE__ */ e("span", { className: `pvx-info-pill ${r !== "default" ? `pvx-info-pill--${r}` : ""}`, children: t });
966
966
  }
967
- function Ne(e) {
968
- if (!e) return "TBD";
969
- const r = new Date(e);
967
+ function ye(t) {
968
+ if (!t) return "TBD";
969
+ const r = new Date(t);
970
970
  if (isNaN(r)) return "TBD";
971
971
  const n = r.toLocaleDateString("en-GB", { weekday: "short", day: "numeric", month: "short" }), a = r.toLocaleTimeString("en-GB", { hour: "2-digit", minute: "2-digit" });
972
972
  return `${n} • ${a}`;
973
973
  }
974
- function at(e) {
975
- return e.reduce((r, n) => {
974
+ function it(t) {
975
+ return t.reduce((r, n) => {
976
976
  var a;
977
977
  return (a = n.splits) != null && a.length ? r ? r.map((s, i) => {
978
978
  const c = n.splits[i];
@@ -980,64 +980,64 @@ function at(e) {
980
980
  }) : [...n.splits] : r;
981
981
  }, null);
982
982
  }
983
- function q({ message: e = "Loading..." }) {
984
- return /* @__PURE__ */ t("div", { className: "pvx-loading", children: e });
983
+ function _({ message: t = "Loading..." }) {
984
+ return /* @__PURE__ */ e("div", { className: "pvx-loading", children: t });
985
985
  }
986
- function M({ message: e = "No data available." }) {
987
- return /* @__PURE__ */ t("div", { className: "pvx-empty", children: /* @__PURE__ */ t("p", { children: e }) });
986
+ function M({ message: t = "No data available." }) {
987
+ return /* @__PURE__ */ e("div", { className: "pvx-empty", children: /* @__PURE__ */ e("p", { children: t }) });
988
988
  }
989
- function st({ competitions: e, isLoading: r, onSelect: n, className: a }) {
990
- return r ? /* @__PURE__ */ t(q, { message: "Loading competitions..." }) : e != null && e.length ? /* @__PURE__ */ t("div", { className: `pvx-comp-grid ${a || ""}`, children: e.map((s) => /* @__PURE__ */ t(it, { comp: s, onSelect: n }, s.id)) }) : /* @__PURE__ */ t(M, { message: "No competitions available." });
989
+ function ot({ competitions: t, isLoading: r, onSelect: n, className: a }) {
990
+ return r ? /* @__PURE__ */ e(_, { message: "Loading competitions..." }) : t != null && t.length ? /* @__PURE__ */ e("div", { className: `pvx-comp-grid ${a || ""}`, children: t.map((s) => /* @__PURE__ */ e(lt, { comp: s, onSelect: n }, s.id)) }) : /* @__PURE__ */ e(M, { message: "No competitions available." });
991
991
  }
992
- function it({ comp: e, onSelect: r }) {
993
- var g, p, h;
994
- const { cdnUrl: n } = T(), a = e.posterCdnPath ? `${n}/${e.posterCdnPath}` : null, s = e.registration, i = (s == null ? void 0 : s.currentCount) || 0, c = s == null ? void 0 : s.maxParticipants, l = c && i >= c, v = (s == null ? void 0 : s.deadline) && new Date(s.deadline) < /* @__PURE__ */ new Date(), d = (s == null ? void 0 : s.isOpen) && !v && !l, f = /* @__PURE__ */ new Date(), N = (g = e.rounds) == null ? void 0 : g.find((u) => u.startTime && new Date(u.startTime) >= f), x = ((p = e.rounds) == null ? void 0 : p.length) || 0, m = ((h = e.rounds) == null ? void 0 : h.filter((u) => u.isFinalized).length) || 0;
995
- return /* @__PURE__ */ o(
992
+ function lt({ comp: t, onSelect: r }) {
993
+ var f, p, v;
994
+ const { cdnUrl: n } = T(), a = t.posterCdnPath ? `${n}/${t.posterCdnPath}` : null, s = t.registration, i = (s == null ? void 0 : s.currentCount) || 0, c = s == null ? void 0 : s.maxParticipants, o = c && i >= c, m = (s == null ? void 0 : s.deadline) && new Date(s.deadline) < /* @__PURE__ */ new Date(), d = (s == null ? void 0 : s.isOpen) && !m && !o, g = /* @__PURE__ */ new Date(), N = (f = t.rounds) == null ? void 0 : f.find((u) => u.startTime && new Date(u.startTime) >= g), x = ((p = t.rounds) == null ? void 0 : p.length) || 0, h = ((v = t.rounds) == null ? void 0 : v.filter((u) => u.isFinalized).length) || 0;
995
+ return /* @__PURE__ */ l(
996
996
  "div",
997
997
  {
998
998
  className: "pvx-comp-card",
999
- onClick: () => r(e.id),
999
+ onClick: () => r(t.id),
1000
1000
  role: "button",
1001
1001
  tabIndex: 0,
1002
1002
  onKeyDown: (u) => {
1003
- (u.key === "Enter" || u.key === " ") && (u.preventDefault(), r(e.id));
1003
+ (u.key === "Enter" || u.key === " ") && (u.preventDefault(), r(t.id));
1004
1004
  },
1005
1005
  children: [
1006
- /* @__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(lt, {}) }) }),
1007
- /* @__PURE__ */ o("div", { className: "pvx-comp-card-body", children: [
1008
- /* @__PURE__ */ t("h3", { className: "pvx-comp-card-title", children: e.name }),
1009
- e.description && /* @__PURE__ */ t("p", { className: "pvx-comp-card-desc", children: e.description }),
1010
- /* @__PURE__ */ o("div", { className: "pvx-comp-card-pills", children: [
1011
- /* @__PURE__ */ t(ge, { type: e.type }),
1012
- e.game && /* @__PURE__ */ t(F, { children: e.game.toUpperCase() }),
1013
- e.formatDescription && e.formatDescription.split(", ").map((u, y) => /* @__PURE__ */ t(F, { variant: "format", children: u }, y))
1006
+ /* @__PURE__ */ e("div", { className: "pvx-comp-card-poster", children: a ? /* @__PURE__ */ e("img", { src: a, alt: t.name, className: "pvx-comp-card-poster-img" }) : /* @__PURE__ */ e("div", { className: "pvx-comp-card-poster-placeholder", children: /* @__PURE__ */ e(ct, {}) }) }),
1007
+ /* @__PURE__ */ l("div", { className: "pvx-comp-card-body", children: [
1008
+ /* @__PURE__ */ e("h3", { className: "pvx-comp-card-title", children: t.name }),
1009
+ t.description && /* @__PURE__ */ e("p", { className: "pvx-comp-card-desc", children: t.description }),
1010
+ /* @__PURE__ */ l("div", { className: "pvx-comp-card-pills", children: [
1011
+ /* @__PURE__ */ e(be, { type: t.type }),
1012
+ t.game && /* @__PURE__ */ e(U, { children: t.game.toUpperCase() }),
1013
+ t.formatDescription && t.formatDescription.split(", ").map((u, y) => /* @__PURE__ */ e(U, { variant: "format", children: u }, y))
1014
1014
  ] }),
1015
- e.carsDescription && /* @__PURE__ */ t("div", { className: "pvx-comp-card-pills", children: e.carsDescription.split(", ").map((u, y) => /* @__PURE__ */ t(F, { children: u }, y)) }),
1016
- /* @__PURE__ */ o("div", { className: "pvx-comp-card-schedule", children: [
1017
- N ? /* @__PURE__ */ o("span", { className: "pvx-comp-card-schedule-next", children: [
1018
- /* @__PURE__ */ t("span", { className: "pvx-comp-card-schedule-label", children: "Next:" }),
1015
+ t.carsDescription && /* @__PURE__ */ e("div", { className: "pvx-comp-card-pills", children: t.carsDescription.split(", ").map((u, y) => /* @__PURE__ */ e(U, { children: u }, y)) }),
1016
+ /* @__PURE__ */ l("div", { className: "pvx-comp-card-schedule", children: [
1017
+ N ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
1018
+ /* @__PURE__ */ e("span", { className: "pvx-comp-card-schedule-label", children: "Next:" }),
1019
1019
  " ",
1020
1020
  "R",
1021
1021
  N.roundNumber,
1022
1022
  " ",
1023
1023
  N.track || "TBD",
1024
1024
  " — ",
1025
- Ne(N.startTime)
1026
- ] }) : x > 0 ? /* @__PURE__ */ o("span", { className: "pvx-comp-card-schedule-next", children: [
1027
- m,
1025
+ ye(N.startTime)
1026
+ ] }) : x > 0 ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
1027
+ h,
1028
1028
  "/",
1029
1029
  x,
1030
1030
  " rounds completed"
1031
1031
  ] }) : null,
1032
- x > 0 && /* @__PURE__ */ o("span", { className: "pvx-comp-card-round-count", children: [
1032
+ x > 0 && /* @__PURE__ */ l("span", { className: "pvx-comp-card-round-count", children: [
1033
1033
  x,
1034
1034
  " round",
1035
1035
  x !== 1 ? "s" : ""
1036
1036
  ] })
1037
1037
  ] }),
1038
- s && /* @__PURE__ */ o("div", { className: "pvx-comp-card-reg", children: [
1039
- /* @__PURE__ */ t("span", { className: `pvx-comp-reg-badge ${d ? "pvx-comp-reg-badge--open" : l ? "pvx-comp-reg-badge--full" : "pvx-comp-reg-badge--closed"}`, children: d ? "Registration Open" : l ? "Full" : "Registration Closed" }),
1040
- /* @__PURE__ */ o("span", { className: "pvx-comp-reg-count", children: [
1038
+ s && /* @__PURE__ */ l("div", { className: "pvx-comp-card-reg", children: [
1039
+ /* @__PURE__ */ e("span", { className: `pvx-comp-reg-badge ${d ? "pvx-comp-reg-badge--open" : o ? "pvx-comp-reg-badge--full" : "pvx-comp-reg-badge--closed"}`, children: d ? "Registration Open" : o ? "Full" : "Registration Closed" }),
1040
+ /* @__PURE__ */ l("span", { className: "pvx-comp-reg-count", children: [
1041
1041
  i,
1042
1042
  "/",
1043
1043
  c || "∞",
@@ -1049,28 +1049,28 @@ function it({ comp: e, onSelect: r }) {
1049
1049
  }
1050
1050
  );
1051
1051
  }
1052
- function lt() {
1053
- return /* @__PURE__ */ o("svg", { className: "pvx-comp-trophy-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
1054
- /* @__PURE__ */ t("path", { d: "M6 9H4.5a2.5 2.5 0 0 1 0-5H6" }),
1055
- /* @__PURE__ */ t("path", { d: "M18 9h1.5a2.5 2.5 0 0 0 0-5H18" }),
1056
- /* @__PURE__ */ t("path", { d: "M4 22h16" }),
1057
- /* @__PURE__ */ t("path", { d: "M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22" }),
1058
- /* @__PURE__ */ t("path", { d: "M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22" }),
1059
- /* @__PURE__ */ t("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
1052
+ function ct() {
1053
+ 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: [
1054
+ /* @__PURE__ */ e("path", { d: "M6 9H4.5a2.5 2.5 0 0 1 0-5H6" }),
1055
+ /* @__PURE__ */ e("path", { d: "M18 9h1.5a2.5 2.5 0 0 0 0-5H18" }),
1056
+ /* @__PURE__ */ e("path", { d: "M4 22h16" }),
1057
+ /* @__PURE__ */ e("path", { d: "M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22" }),
1058
+ /* @__PURE__ */ e("path", { d: "M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22" }),
1059
+ /* @__PURE__ */ e("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
1060
1060
  ] });
1061
1061
  }
1062
- function ot({ competitionId: e, className: r }) {
1063
- var l, v;
1064
- const { data: n, isLoading: a } = Ee(e), { data: s, isLoading: i } = oe(e);
1062
+ function dt({ competitionId: t, className: r }) {
1063
+ var o, m;
1064
+ const { data: n, isLoading: a } = qe(t), { data: s, isLoading: i } = de(t);
1065
1065
  if (a || i)
1066
- return /* @__PURE__ */ t(q, { message: "Loading standings..." });
1067
- if (!((l = n == null ? void 0 : n.standings) != null && l.length))
1068
- return /* @__PURE__ */ t(M, { message: "No standings data yet. Results will appear once rounds are finalised." });
1069
- const c = ((v = s == null ? void 0 : s.rounds) == null ? void 0 : v.filter((d) => d.isFinalized)) || [];
1070
- return /* @__PURE__ */ o("div", { className: `pvx-card ${r || ""}`, children: [
1071
- /* @__PURE__ */ t("div", { className: "pvx-card-header--split", children: /* @__PURE__ */ o("div", { className: "pvx-card-header-left", children: [
1072
- /* @__PURE__ */ t("h3", { className: "pvx-card-title", children: "Championship Standings" }),
1073
- /* @__PURE__ */ o("span", { className: "pvx-standings-subtitle", children: [
1066
+ return /* @__PURE__ */ e(_, { message: "Loading standings..." });
1067
+ if (!((o = n == null ? void 0 : n.standings) != null && o.length))
1068
+ return /* @__PURE__ */ e(M, { message: "No standings data yet. Results will appear once rounds are finalised." });
1069
+ const c = ((m = s == null ? void 0 : s.rounds) == null ? void 0 : m.filter((d) => d.isFinalized)) || [];
1070
+ return /* @__PURE__ */ l("div", { className: `pvx-card ${r || ""}`, children: [
1071
+ /* @__PURE__ */ e("div", { className: "pvx-card-header--split", children: /* @__PURE__ */ l("div", { className: "pvx-card-header-left", children: [
1072
+ /* @__PURE__ */ e("h3", { className: "pvx-card-title", children: "Championship Standings" }),
1073
+ /* @__PURE__ */ l("span", { className: "pvx-standings-subtitle", children: [
1074
1074
  "After ",
1075
1075
  n.roundsCompleted,
1076
1076
  " round",
@@ -1078,14 +1078,14 @@ function ot({ competitionId: e, className: r }) {
1078
1078
  n.countingRounds > 0 && ` (best ${n.countingRounds} count)`
1079
1079
  ] })
1080
1080
  ] }) }),
1081
- /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ o("table", { className: "pvx-table", children: [
1082
- /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ o("tr", { className: "pvx-thead-row", children: [
1083
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--narrow", children: "Pos" }),
1084
- /* @__PURE__ */ t("th", { className: "pvx-th", children: "Driver" }),
1085
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--center pvx-hidden-below-sm", children: "W" }),
1086
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--center pvx-hidden-below-sm", children: "Pod" }),
1087
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--center", children: "Points" }),
1088
- c.map((d) => /* @__PURE__ */ o(
1081
+ /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
1082
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
1083
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-th--narrow", children: "Pos" }),
1084
+ /* @__PURE__ */ e("th", { className: "pvx-th", children: "Driver" }),
1085
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-th--center pvx-hidden-below-sm", children: "W" }),
1086
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-th--center pvx-hidden-below-sm", children: "Pod" }),
1087
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-th--center", children: "Points" }),
1088
+ c.map((d) => /* @__PURE__ */ l(
1089
1089
  "th",
1090
1090
  {
1091
1091
  className: "pvx-th pvx-th--center pvx-hidden-below-md",
@@ -1098,8 +1098,8 @@ function ot({ competitionId: e, className: r }) {
1098
1098
  d.roundNumber
1099
1099
  ))
1100
1100
  ] }) }),
1101
- /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: n.standings.map((d) => /* @__PURE__ */ t(
1102
- ct,
1101
+ /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: n.standings.map((d) => /* @__PURE__ */ e(
1102
+ pt,
1103
1103
  {
1104
1104
  driver: d,
1105
1105
  finalizedRounds: c
@@ -1109,107 +1109,107 @@ function ot({ competitionId: e, className: r }) {
1109
1109
  ] }) })
1110
1110
  ] });
1111
1111
  }
1112
- function ct({ driver: e, finalizedRounds: r }) {
1113
- var c, l, v;
1114
- const n = e.position <= 3, a = new Map(
1115
- ((c = e.roundResults) == null ? void 0 : c.map((d) => [d.roundNumber, d])) || []
1116
- ), s = ((l = e.roundResults) == null ? void 0 : l.filter((d) => d.position === 1).length) || 0, i = ((v = e.roundResults) == null ? void 0 : v.filter((d) => d.position <= 3).length) || 0;
1117
- return /* @__PURE__ */ o("tr", { className: `pvx-row ${n ? "pvx-row--podium" : ""}`, children: [
1118
- /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t(xe, { position: e.position }) }),
1119
- /* @__PURE__ */ o("td", { className: "pvx-td pvx-td--primary", children: [
1120
- /* @__PURE__ */ t(fe, { nation: e.nation }),
1121
- e.driverName
1112
+ function pt({ driver: t, finalizedRounds: r }) {
1113
+ var c, o, m;
1114
+ const n = t.position <= 3, a = new Map(
1115
+ ((c = t.roundResults) == null ? void 0 : c.map((d) => [d.roundNumber, d])) || []
1116
+ ), s = ((o = t.roundResults) == null ? void 0 : o.filter((d) => d.position === 1).length) || 0, i = ((m = t.roundResults) == null ? void 0 : m.filter((d) => d.position <= 3).length) || 0;
1117
+ return /* @__PURE__ */ l("tr", { className: `pvx-row ${n ? "pvx-row--podium" : ""}`, children: [
1118
+ /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(fe, { position: t.position }) }),
1119
+ /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
1120
+ /* @__PURE__ */ e(Ne, { nation: t.nation }),
1121
+ t.driverName
1122
1122
  ] }),
1123
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: s || "-" }),
1124
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: i || "-" }),
1125
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-standings-total", children: e.totalPoints }),
1123
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: s || "-" }),
1124
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: i || "-" }),
1125
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--center pvx-standings-total", children: t.totalPoints }),
1126
1126
  r.map((d) => {
1127
- const f = a.get(d.roundNumber), N = f == null ? void 0 : f.dropped;
1128
- return /* @__PURE__ */ t(
1127
+ const g = a.get(d.roundNumber), N = g == null ? void 0 : g.dropped;
1128
+ return /* @__PURE__ */ e(
1129
1129
  "td",
1130
1130
  {
1131
- className: `pvx-td pvx-td--center pvx-hidden-below-md ${!N && (f == null ? void 0 : f.position) <= 3 ? "pvx-standings-cell--podium" : ""}`,
1132
- children: f ? /* @__PURE__ */ o("div", { className: `pvx-standings-round-cell ${N ? "pvx-standings-round-cell--dropped" : ""}`, children: [
1133
- /* @__PURE__ */ o("span", { className: "pvx-standings-round-pos", children: [
1131
+ className: `pvx-td pvx-td--center pvx-hidden-below-md ${!N && (g == null ? void 0 : g.position) <= 3 ? "pvx-standings-cell--podium" : ""}`,
1132
+ children: g ? /* @__PURE__ */ l("div", { className: `pvx-standings-round-cell ${N ? "pvx-standings-round-cell--dropped" : ""}`, children: [
1133
+ /* @__PURE__ */ l("span", { className: "pvx-standings-round-pos", children: [
1134
1134
  "P",
1135
- f.position
1135
+ g.position
1136
1136
  ] }),
1137
- /* @__PURE__ */ t("span", { className: "pvx-standings-round-pts", children: f.points })
1138
- ] }) : /* @__PURE__ */ t("span", { className: "pvx-td--muted", children: "-" })
1137
+ /* @__PURE__ */ e("span", { className: "pvx-standings-round-pts", children: g.points })
1138
+ ] }) : /* @__PURE__ */ e("span", { className: "pvx-td--muted", children: "-" })
1139
1139
  },
1140
1140
  d.roundNumber
1141
1141
  );
1142
1142
  })
1143
1143
  ] });
1144
1144
  }
1145
- function dt({ competitionId: e, roundNumber: r, className: n }) {
1146
- var f, N;
1147
- const { data: a, isLoading: s } = qe(e, r), [i, c] = W(null);
1145
+ function ut({ competitionId: t, roundNumber: r, className: n }) {
1146
+ var g, N;
1147
+ const { data: a, isLoading: s } = je(t, r), [i, c] = j(null);
1148
1148
  if (s)
1149
- return /* @__PURE__ */ t(q, { message: "Loading results..." });
1149
+ return /* @__PURE__ */ e(_, { message: "Loading results..." });
1150
1150
  if (!a)
1151
- return /* @__PURE__ */ t(M, { message: "No results for this round." });
1152
- const l = a.sessions || [];
1153
- if (!l.length)
1154
- return /* @__PURE__ */ t(M, { message: "No session data for this round." });
1155
- const v = i || ((f = l.find((x) => x.type === "RACE")) == null ? void 0 : f.type) || ((N = l[0]) == null ? void 0 : N.type), d = l.find((x) => x.type === v) || l[0];
1156
- return /* @__PURE__ */ o("div", { className: `pvx-round-results ${n || ""}`, children: [
1157
- /* @__PURE__ */ o("div", { className: "pvx-round-results-header", children: [
1158
- /* @__PURE__ */ o("div", { children: [
1159
- /* @__PURE__ */ o("h4", { className: "pvx-round-results-title", children: [
1151
+ return /* @__PURE__ */ e(M, { message: "No results for this round." });
1152
+ const o = a.sessions || [];
1153
+ if (!o.length)
1154
+ return /* @__PURE__ */ e(M, { message: "No session data for this round." });
1155
+ const m = i || ((g = o.find((x) => x.type === "RACE")) == null ? void 0 : g.type) || ((N = o[0]) == null ? void 0 : N.type), d = o.find((x) => x.type === m) || o[0];
1156
+ return /* @__PURE__ */ l("div", { className: `pvx-round-results ${n || ""}`, children: [
1157
+ /* @__PURE__ */ l("div", { className: "pvx-round-results-header", children: [
1158
+ /* @__PURE__ */ l("div", { children: [
1159
+ /* @__PURE__ */ l("h4", { className: "pvx-round-results-title", children: [
1160
1160
  "Round ",
1161
1161
  a.roundNumber,
1162
1162
  a.track ? `: ${a.track}` : ""
1163
1163
  ] }),
1164
- a.startTime && /* @__PURE__ */ t("p", { className: "pvx-round-results-date", children: new Date(a.startTime).toLocaleDateString("en-GB", {
1164
+ a.startTime && /* @__PURE__ */ e("p", { className: "pvx-round-results-date", children: new Date(a.startTime).toLocaleDateString("en-GB", {
1165
1165
  day: "numeric",
1166
1166
  month: "long",
1167
1167
  year: "numeric"
1168
1168
  }) })
1169
1169
  ] }),
1170
- /* @__PURE__ */ t(pt, { sessions: l })
1170
+ /* @__PURE__ */ e(mt, { sessions: o })
1171
1171
  ] }),
1172
- /* @__PURE__ */ t(
1173
- rt,
1172
+ /* @__PURE__ */ e(
1173
+ st,
1174
1174
  {
1175
- sessions: l,
1176
- activeSession: v,
1175
+ sessions: o,
1176
+ activeSession: m,
1177
1177
  onSelect: c
1178
1178
  }
1179
1179
  ),
1180
- /* @__PURE__ */ t(ut, { session: d })
1180
+ /* @__PURE__ */ e(ht, { session: d })
1181
1181
  ] });
1182
1182
  }
1183
- function pt({ sessions: e }) {
1183
+ function mt({ sessions: t }) {
1184
1184
  var s;
1185
- const r = e.find((i) => i.type === "RACE"), n = (s = r == null ? void 0 : r.results) == null ? void 0 : s.filter((i) => i.position <= 3).sort((i, c) => i.position - c.position);
1185
+ const r = t.find((i) => i.type === "RACE"), n = (s = r == null ? void 0 : r.results) == null ? void 0 : s.filter((i) => i.position <= 3).sort((i, c) => i.position - c.position);
1186
1186
  if (!(n != null && n.length)) return null;
1187
1187
  const a = ["🥇", "🥈", "🥉"];
1188
- return /* @__PURE__ */ t("div", { className: "pvx-round-podium-summary", children: n.map((i) => /* @__PURE__ */ o("span", { className: "pvx-round-podium-item", children: [
1189
- /* @__PURE__ */ t("span", { children: a[i.position - 1] }),
1190
- /* @__PURE__ */ t("span", { children: i.driverName })
1188
+ return /* @__PURE__ */ e("div", { className: "pvx-round-podium-summary", children: n.map((i) => /* @__PURE__ */ l("span", { className: "pvx-round-podium-item", children: [
1189
+ /* @__PURE__ */ e("span", { children: a[i.position - 1] }),
1190
+ /* @__PURE__ */ e("span", { children: i.driverName })
1191
1191
  ] }, i.driverId)) });
1192
1192
  }
1193
- function ut({ session: e }) {
1193
+ function ht({ session: t }) {
1194
1194
  var a;
1195
- const r = e.type === "RACE";
1196
- if (!((a = e.results) != null && a.length))
1197
- return /* @__PURE__ */ t(M, { message: `No results for ${e.type}.` });
1198
- const n = at(e.results);
1199
- return /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ o("table", { className: "pvx-table", children: [
1200
- /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ o("tr", { className: "pvx-thead-row", children: [
1201
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--narrow", children: "Pos" }),
1202
- /* @__PURE__ */ t("th", { className: "pvx-th", children: "Driver" }),
1203
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "Car" }),
1204
- /* @__PURE__ */ t("th", { className: "pvx-th", children: "Best Lap" }),
1205
- r && /* @__PURE__ */ o(z, { children: [
1206
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "Laps" }),
1207
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "Time / Gap" }),
1208
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--center", children: "Points" })
1195
+ const r = t.type === "RACE";
1196
+ if (!((a = t.results) != null && a.length))
1197
+ return /* @__PURE__ */ e(M, { message: `No results for ${t.type}.` });
1198
+ const n = it(t.results);
1199
+ return /* @__PURE__ */ e("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
1200
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
1201
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-th--narrow", children: "Pos" }),
1202
+ /* @__PURE__ */ e("th", { className: "pvx-th", children: "Driver" }),
1203
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "Car" }),
1204
+ /* @__PURE__ */ e("th", { className: "pvx-th", children: "Best Lap" }),
1205
+ r && /* @__PURE__ */ l(Q, { children: [
1206
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "Laps" }),
1207
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-hidden-below-sm", children: "Time / Gap" }),
1208
+ /* @__PURE__ */ e("th", { className: "pvx-th pvx-th--center", children: "Points" })
1209
1209
  ] })
1210
1210
  ] }) }),
1211
- /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: e.results.map((s, i) => /* @__PURE__ */ t(
1212
- mt,
1211
+ /* @__PURE__ */ e("tbody", { className: "pvx-tbody", children: t.results.map((s, i) => /* @__PURE__ */ e(
1212
+ vt,
1213
1213
  {
1214
1214
  result: s,
1215
1215
  isRace: r,
@@ -1220,134 +1220,134 @@ function ut({ session: e }) {
1220
1220
  )) })
1221
1221
  ] }) });
1222
1222
  }
1223
- function mt({ result: e, isRace: r, fastestSplits: n, rowIndex: a }) {
1224
- const s = e.position <= 3;
1225
- return /* @__PURE__ */ o("tr", { className: `pvx-row ${s ? "pvx-row--podium" : ""}`, children: [
1226
- /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t(xe, { position: e.position }) }),
1227
- /* @__PURE__ */ o("td", { className: "pvx-td pvx-td--primary", children: [
1228
- /* @__PURE__ */ t(fe, { nation: e.nation }),
1229
- e.driverName,
1230
- e.carNumber != null && /* @__PURE__ */ o("span", { className: "pvx-car-number", children: [
1223
+ function vt({ result: t, isRace: r, fastestSplits: n, rowIndex: a }) {
1224
+ const s = t.position <= 3;
1225
+ return /* @__PURE__ */ l("tr", { className: `pvx-row ${s ? "pvx-row--podium" : ""}`, children: [
1226
+ /* @__PURE__ */ e("td", { className: "pvx-td", children: /* @__PURE__ */ e(fe, { position: t.position }) }),
1227
+ /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--primary", children: [
1228
+ /* @__PURE__ */ e(Ne, { nation: t.nation }),
1229
+ t.driverName,
1230
+ t.carNumber != null && /* @__PURE__ */ l("span", { className: "pvx-car-number", children: [
1231
1231
  "#",
1232
- e.carNumber
1232
+ t.carNumber
1233
1233
  ] }),
1234
- e.penalty && /* @__PURE__ */ t("span", { className: "pvx-penalty", children: e.penalty })
1234
+ t.penalty && /* @__PURE__ */ e("span", { className: "pvx-penalty", children: t.penalty })
1235
1235
  ] }),
1236
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-hidden-below-sm", children: B(e.carId) }),
1237
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--mono", children: /* @__PURE__ */ t(
1238
- vt,
1236
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-hidden-below-sm", children: I(t.carId) }),
1237
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--mono", children: /* @__PURE__ */ e(
1238
+ xt,
1239
1239
  {
1240
- bestLap: e.bestLapFormatted,
1241
- hasBestLap: e.hasBestLap,
1242
- splits: e.splits,
1240
+ bestLap: t.bestLapFormatted,
1241
+ hasBestLap: t.hasBestLap,
1242
+ splits: t.splits,
1243
1243
  fastestSplits: n,
1244
1244
  showAbove: a <= 1
1245
1245
  }
1246
1246
  ) }),
1247
- r && /* @__PURE__ */ o(z, { children: [
1248
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-hidden-below-sm", children: e.lapsCompleted }),
1249
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: e.position === 1 ? e.totalTime || "-" : e.gap || "-" }),
1250
- /* @__PURE__ */ o("td", { className: "pvx-td pvx-td--center", children: [
1251
- /* @__PURE__ */ t("span", { className: "pvx-session-points", children: e.points }),
1252
- e.pointsOverride !== 0 && e.pointsOverride && /* @__PURE__ */ o("span", { className: "pvx-points-override", children: [
1247
+ r && /* @__PURE__ */ l(Q, { children: [
1248
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-hidden-below-sm", children: t.lapsCompleted }),
1249
+ /* @__PURE__ */ e("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: t.position === 1 ? t.totalTime || "-" : t.gap || "-" }),
1250
+ /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--center", children: [
1251
+ /* @__PURE__ */ e("span", { className: "pvx-session-points", children: t.points }),
1252
+ t.pointsOverride !== 0 && t.pointsOverride && /* @__PURE__ */ l("span", { className: "pvx-points-override", children: [
1253
1253
  "(",
1254
- e.pointsOverride > 0 ? "+" : "",
1255
- e.pointsOverride,
1254
+ t.pointsOverride > 0 ? "+" : "",
1255
+ t.pointsOverride,
1256
1256
  ")"
1257
1257
  ] })
1258
1258
  ] })
1259
1259
  ] })
1260
1260
  ] });
1261
1261
  }
1262
- function vt({ bestLap: e, hasBestLap: r, splits: n, fastestSplits: a, showAbove: s }) {
1263
- return e ? /* @__PURE__ */ o("span", { className: `pvx-best-lap-cell ${r ? "pvx-best-lap-cell--fastest" : ""}`, children: [
1264
- /* @__PURE__ */ t("span", { className: "pvx-best-lap-time", children: e }),
1265
- (n == null ? void 0 : n.length) > 0 && /* @__PURE__ */ t("span", { className: "pvx-splits-tooltip-anchor", children: /* @__PURE__ */ t("span", { className: `pvx-splits-tooltip ${s ? "" : "pvx-splits-tooltip--above"}`, children: n.map((i, c) => {
1266
- const l = a && i === a[c];
1267
- return /* @__PURE__ */ o("span", { className: "pvx-splits-tooltip-row", children: [
1268
- /* @__PURE__ */ o("span", { className: "pvx-splits-tooltip-label", children: [
1262
+ function xt({ bestLap: t, hasBestLap: r, splits: n, fastestSplits: a, showAbove: s }) {
1263
+ return t ? /* @__PURE__ */ l("span", { className: `pvx-best-lap-cell ${r ? "pvx-best-lap-cell--fastest" : ""}`, children: [
1264
+ /* @__PURE__ */ e("span", { className: "pvx-best-lap-time", children: t }),
1265
+ (n == null ? void 0 : n.length) > 0 && /* @__PURE__ */ e("span", { className: "pvx-splits-tooltip-anchor", children: /* @__PURE__ */ e("span", { className: `pvx-splits-tooltip ${s ? "" : "pvx-splits-tooltip--above"}`, children: n.map((i, c) => {
1266
+ const o = a && i === a[c];
1267
+ return /* @__PURE__ */ l("span", { className: "pvx-splits-tooltip-row", children: [
1268
+ /* @__PURE__ */ l("span", { className: "pvx-splits-tooltip-label", children: [
1269
1269
  "S",
1270
1270
  c + 1
1271
1271
  ] }),
1272
- /* @__PURE__ */ t("span", { className: l ? "pvx-splits-tooltip-best" : "", children: i })
1272
+ /* @__PURE__ */ e("span", { className: o ? "pvx-splits-tooltip-best" : "", children: i })
1273
1273
  ] }, c);
1274
1274
  }) }) })
1275
- ] }) : /* @__PURE__ */ t("span", { className: "pvx-td--muted", children: "-" });
1275
+ ] }) : /* @__PURE__ */ e("span", { className: "pvx-td--muted", children: "-" });
1276
1276
  }
1277
- function ht({ competitionId: e, className: r }) {
1278
- const { data: n, isLoading: a } = _e(e);
1277
+ function gt({ competitionId: t, className: r }) {
1278
+ const { data: n, isLoading: a } = Ve(t);
1279
1279
  if (a)
1280
- return /* @__PURE__ */ t(q, { message: "Loading drivers..." });
1280
+ return /* @__PURE__ */ e(_, { message: "Loading drivers..." });
1281
1281
  const s = (n == null ? void 0 : n.drivers) || (n == null ? void 0 : n.entries) || [];
1282
- return s.length ? /* @__PURE__ */ t("div", { className: `pvx-entry-grid ${r || ""}`, children: s.map((i) => {
1283
- var c, l;
1284
- return /* @__PURE__ */ o("div", { className: "pvx-entry-card", children: [
1285
- i.avatarUrl ? /* @__PURE__ */ t(
1282
+ return s.length ? /* @__PURE__ */ e("div", { className: `pvx-entry-grid ${r || ""}`, children: s.map((i) => {
1283
+ var c, o;
1284
+ return /* @__PURE__ */ l("div", { className: "pvx-entry-card", children: [
1285
+ i.avatarUrl ? /* @__PURE__ */ e(
1286
1286
  "img",
1287
1287
  {
1288
1288
  src: i.avatarUrl,
1289
1289
  alt: "",
1290
1290
  className: "pvx-entry-avatar"
1291
1291
  }
1292
- ) : /* @__PURE__ */ t("div", { className: "pvx-entry-avatar pvx-entry-avatar--placeholder", children: ((l = (c = i.displayName) == null ? void 0 : c.charAt(0)) == null ? void 0 : l.toUpperCase()) || "?" }),
1293
- /* @__PURE__ */ t("span", { className: "pvx-entry-name", children: i.displayName })
1292
+ ) : /* @__PURE__ */ e("div", { className: "pvx-entry-avatar pvx-entry-avatar--placeholder", children: ((o = (c = i.displayName) == null ? void 0 : c.charAt(0)) == null ? void 0 : o.toUpperCase()) || "?" }),
1293
+ /* @__PURE__ */ e("span", { className: "pvx-entry-name", children: i.displayName })
1294
1294
  ] }, i.steamId || i.driverId);
1295
- }) }) : /* @__PURE__ */ t(M, { message: "No drivers registered yet." });
1295
+ }) }) : /* @__PURE__ */ e(M, { message: "No drivers registered yet." });
1296
1296
  }
1297
- const xt = [
1297
+ const ft = [
1298
1298
  { id: "standings", label: "Standings" },
1299
1299
  { id: "rounds", label: "Rounds" },
1300
1300
  { id: "drivers", label: "Drivers" }
1301
1301
  ];
1302
- function Pt({ className: e, title: r = "Competitions" }) {
1303
- const [n, a] = se(), s = n.get("competition"), i = n.get("tab") || "standings", c = n.get("round") ? Number(n.get("round")) : null, { data: l, isLoading: v } = Ue();
1304
- function d(g) {
1305
- a({ competition: g });
1302
+ function qt({ className: t, title: r = "Competitions" }) {
1303
+ const [n, a] = oe(), s = n.get("competition"), i = n.get("tab") || "standings", c = n.get("round") ? Number(n.get("round")) : null, { data: o, isLoading: m } = _e();
1304
+ function d(f) {
1305
+ a({ competition: f });
1306
1306
  }
1307
- function f() {
1307
+ function g() {
1308
1308
  a({});
1309
1309
  }
1310
- function N(g) {
1311
- a({ competition: s, tab: g });
1310
+ function N(f) {
1311
+ a({ competition: s, tab: f });
1312
1312
  }
1313
- function x(g) {
1314
- a({ competition: s, tab: "rounds", round: String(g) });
1313
+ function x(f) {
1314
+ a({ competition: s, tab: "rounds", round: String(f) });
1315
1315
  }
1316
- function m() {
1316
+ function h() {
1317
1317
  a({ competition: s, tab: "rounds" });
1318
1318
  }
1319
- return s ? /* @__PURE__ */ t("div", { className: `pvx-comp-explorer ${e || ""}`, children: /* @__PURE__ */ t(
1320
- ft,
1319
+ return s ? /* @__PURE__ */ e("div", { className: `pvx-comp-explorer ${t || ""}`, children: /* @__PURE__ */ e(
1320
+ Nt,
1321
1321
  {
1322
1322
  competitionId: s,
1323
1323
  activeTab: i,
1324
1324
  selectedRound: c,
1325
- onBack: f,
1325
+ onBack: g,
1326
1326
  onTabChange: N,
1327
1327
  onSelectRound: x,
1328
- onDeselectRound: m
1328
+ onDeselectRound: h
1329
1329
  }
1330
- ) }) : /* @__PURE__ */ o("div", { className: `pvx-comp-explorer ${e || ""}`, children: [
1331
- /* @__PURE__ */ o("div", { className: "pvx-explorer-header", children: [
1332
- /* @__PURE__ */ t("h2", { className: "pvx-explorer-title", children: r }),
1333
- !v && (l == null ? void 0 : l.length) > 0 && /* @__PURE__ */ t("div", { className: "pvx-explorer-stats", children: /* @__PURE__ */ o("span", { children: [
1334
- l.length,
1330
+ ) }) : /* @__PURE__ */ l("div", { className: `pvx-comp-explorer ${t || ""}`, children: [
1331
+ /* @__PURE__ */ l("div", { className: "pvx-explorer-header", children: [
1332
+ /* @__PURE__ */ e("h2", { className: "pvx-explorer-title", children: r }),
1333
+ !m && (o == null ? void 0 : o.length) > 0 && /* @__PURE__ */ e("div", { className: "pvx-explorer-stats", children: /* @__PURE__ */ l("span", { children: [
1334
+ o.length,
1335
1335
  " competition",
1336
- l.length !== 1 ? "s" : ""
1336
+ o.length !== 1 ? "s" : ""
1337
1337
  ] }) })
1338
1338
  ] }),
1339
- /* @__PURE__ */ t(
1340
- st,
1339
+ /* @__PURE__ */ e(
1340
+ ot,
1341
1341
  {
1342
- competitions: l,
1343
- isLoading: v,
1342
+ competitions: o,
1343
+ isLoading: m,
1344
1344
  onSelect: d
1345
1345
  }
1346
1346
  )
1347
1347
  ] });
1348
1348
  }
1349
- function ft({
1350
- competitionId: e,
1349
+ function Nt({
1350
+ competitionId: t,
1351
1351
  activeTab: r,
1352
1352
  selectedRound: n,
1353
1353
  onBack: a,
@@ -1355,130 +1355,130 @@ function ft({
1355
1355
  onSelectRound: i,
1356
1356
  onDeselectRound: c
1357
1357
  }) {
1358
- var g, p;
1359
- const { data: l, isLoading: v } = oe(e);
1360
- if (v)
1361
- return /* @__PURE__ */ t(q, { message: "Loading competition..." });
1362
- if (!l)
1363
- return /* @__PURE__ */ o("div", { children: [
1364
- /* @__PURE__ */ t(M, { message: "Competition not found." }),
1365
- /* @__PURE__ */ t("div", { className: "pvx-comp-back-link-wrap", children: /* @__PURE__ */ t("button", { onClick: a, className: "pvx-comp-back-link", children: "← Back to competitions" }) })
1358
+ var f, p;
1359
+ const { data: o, isLoading: m } = de(t);
1360
+ if (m)
1361
+ return /* @__PURE__ */ e(_, { message: "Loading competition..." });
1362
+ if (!o)
1363
+ return /* @__PURE__ */ l("div", { children: [
1364
+ /* @__PURE__ */ e(M, { message: "Competition not found." }),
1365
+ /* @__PURE__ */ e("div", { className: "pvx-comp-back-link-wrap", children: /* @__PURE__ */ e("button", { onClick: a, className: "pvx-comp-back-link", children: "← Back to competitions" }) })
1366
1366
  ] });
1367
- const d = l.type === "championship", f = ((g = l.rounds) == null ? void 0 : g.filter((h) => h.isFinalized)) || [], N = l.rounds || [], x = xt.filter((h) => !(h.id === "standings" && !d || h.id === "rounds" && f.length === 0)), m = x.find((h) => h.id === r) ? r : ((p = x[0]) == null ? void 0 : p.id) || "standings";
1368
- return /* @__PURE__ */ o(z, { children: [
1369
- /* @__PURE__ */ t("button", { onClick: a, className: "pvx-comp-back-link", children: "← Competitions" }),
1370
- /* @__PURE__ */ o("div", { className: "pvx-comp-detail-header", children: [
1371
- /* @__PURE__ */ t("h2", { className: "pvx-explorer-title", children: l.name }),
1372
- l.description && /* @__PURE__ */ t("p", { className: "pvx-comp-detail-desc", children: l.description }),
1373
- /* @__PURE__ */ o("div", { className: "pvx-comp-detail-meta", children: [
1374
- /* @__PURE__ */ t(ge, { type: l.type }),
1375
- l.game && /* @__PURE__ */ t(F, { children: l.game.toUpperCase() }),
1376
- l.countingRounds > 0 && /* @__PURE__ */ o(F, { variant: "format", children: [
1367
+ const d = o.type === "championship", g = ((f = o.rounds) == null ? void 0 : f.filter((v) => v.isFinalized)) || [], N = o.rounds || [], x = ft.filter((v) => !(v.id === "standings" && !d || v.id === "rounds" && g.length === 0)), h = x.find((v) => v.id === r) ? r : ((p = x[0]) == null ? void 0 : p.id) || "standings";
1368
+ return /* @__PURE__ */ l(Q, { children: [
1369
+ /* @__PURE__ */ e("button", { onClick: a, className: "pvx-comp-back-link", children: "← Competitions" }),
1370
+ /* @__PURE__ */ l("div", { className: "pvx-comp-detail-header", children: [
1371
+ /* @__PURE__ */ e("h2", { className: "pvx-explorer-title", children: o.name }),
1372
+ o.description && /* @__PURE__ */ e("p", { className: "pvx-comp-detail-desc", children: o.description }),
1373
+ /* @__PURE__ */ l("div", { className: "pvx-comp-detail-meta", children: [
1374
+ /* @__PURE__ */ e(be, { type: o.type }),
1375
+ o.game && /* @__PURE__ */ e(U, { children: o.game.toUpperCase() }),
1376
+ o.countingRounds > 0 && /* @__PURE__ */ l(U, { variant: "format", children: [
1377
1377
  "Best ",
1378
- l.countingRounds,
1378
+ o.countingRounds,
1379
1379
  " of ",
1380
1380
  N.length,
1381
1381
  " rounds count"
1382
1382
  ] }),
1383
- N.length > 0 && /* @__PURE__ */ o(F, { children: [
1383
+ N.length > 0 && /* @__PURE__ */ l(U, { children: [
1384
1384
  N.length,
1385
1385
  " round",
1386
1386
  N.length !== 1 ? "s" : ""
1387
1387
  ] })
1388
1388
  ] })
1389
1389
  ] }),
1390
- N.length > 0 && /* @__PURE__ */ t(gt, { rounds: N }),
1391
- x.length > 1 && /* @__PURE__ */ t("div", { className: "pvx-comp-tabs", children: x.map((h) => /* @__PURE__ */ t(
1390
+ N.length > 0 && /* @__PURE__ */ e(bt, { rounds: N }),
1391
+ x.length > 1 && /* @__PURE__ */ e("div", { className: "pvx-comp-tabs", children: x.map((v) => /* @__PURE__ */ e(
1392
1392
  "button",
1393
1393
  {
1394
- onClick: () => s(h.id),
1395
- className: `pvx-comp-tab ${m === h.id ? "pvx-comp-tab--active" : ""}`,
1396
- children: h.label
1394
+ onClick: () => s(v.id),
1395
+ className: `pvx-comp-tab ${h === v.id ? "pvx-comp-tab--active" : ""}`,
1396
+ children: v.label
1397
1397
  },
1398
- h.id
1398
+ v.id
1399
1399
  )) }),
1400
- m === "standings" && /* @__PURE__ */ t(ot, { competitionId: e }),
1401
- m === "rounds" && /* @__PURE__ */ t(
1402
- Nt,
1400
+ h === "standings" && /* @__PURE__ */ e(dt, { competitionId: t }),
1401
+ h === "rounds" && /* @__PURE__ */ e(
1402
+ yt,
1403
1403
  {
1404
- competitionId: e,
1405
- finalizedRounds: f,
1404
+ competitionId: t,
1405
+ finalizedRounds: g,
1406
1406
  selectedRound: n,
1407
1407
  onSelectRound: i,
1408
1408
  onDeselectRound: c
1409
1409
  }
1410
1410
  ),
1411
- m === "drivers" && /* @__PURE__ */ t(ht, { competitionId: e })
1411
+ h === "drivers" && /* @__PURE__ */ e(gt, { competitionId: t })
1412
1412
  ] });
1413
1413
  }
1414
- function gt({ rounds: e }) {
1415
- const r = /* @__PURE__ */ new Date(), n = e.find((a) => a.startTime && new Date(a.startTime) >= r);
1416
- return /* @__PURE__ */ t("div", { className: "pvx-comp-schedule", children: /* @__PURE__ */ t("div", { className: "pvx-comp-schedule-list", children: e.map((a) => {
1414
+ function bt({ rounds: t }) {
1415
+ const r = /* @__PURE__ */ new Date(), n = t.find((a) => a.startTime && new Date(a.startTime) >= r);
1416
+ return /* @__PURE__ */ e("div", { className: "pvx-comp-schedule", children: /* @__PURE__ */ e("div", { className: "pvx-comp-schedule-list", children: t.map((a) => {
1417
1417
  const s = a === n, i = a.startTime && new Date(a.startTime) < r;
1418
- return /* @__PURE__ */ o(
1418
+ return /* @__PURE__ */ l(
1419
1419
  "div",
1420
1420
  {
1421
1421
  className: `pvx-comp-schedule-item ${s ? "pvx-comp-schedule-item--next" : ""} ${i ? "pvx-comp-schedule-item--past" : ""}`,
1422
1422
  children: [
1423
- /* @__PURE__ */ o("span", { className: "pvx-comp-schedule-round", children: [
1423
+ /* @__PURE__ */ l("span", { className: "pvx-comp-schedule-round", children: [
1424
1424
  "R",
1425
1425
  a.roundNumber
1426
1426
  ] }),
1427
- /* @__PURE__ */ t("span", { className: "pvx-comp-schedule-track", children: a.track || "TBD" }),
1428
- /* @__PURE__ */ t("span", { className: "pvx-comp-schedule-date", children: Ne(a.startTime) }),
1429
- a.isFinalized && /* @__PURE__ */ t("span", { className: "pvx-comp-schedule-badge", children: "Results" })
1427
+ /* @__PURE__ */ e("span", { className: "pvx-comp-schedule-track", children: a.track || "TBD" }),
1428
+ /* @__PURE__ */ e("span", { className: "pvx-comp-schedule-date", children: ye(a.startTime) }),
1429
+ a.isFinalized && /* @__PURE__ */ e("span", { className: "pvx-comp-schedule-badge", children: "Results" })
1430
1430
  ]
1431
1431
  },
1432
1432
  a.roundNumber
1433
1433
  );
1434
1434
  }) }) });
1435
1435
  }
1436
- function Nt({ competitionId: e, finalizedRounds: r, selectedRound: n, onSelectRound: a, onDeselectRound: s }) {
1437
- return r.length ? /* @__PURE__ */ o("div", { className: "pvx-comp-rounds", children: [
1438
- /* @__PURE__ */ t("div", { className: "pvx-comp-round-pills", children: r.map((i) => /* @__PURE__ */ o(
1436
+ function yt({ competitionId: t, finalizedRounds: r, selectedRound: n, onSelectRound: a, onDeselectRound: s }) {
1437
+ return r.length ? /* @__PURE__ */ l("div", { className: "pvx-comp-rounds", children: [
1438
+ /* @__PURE__ */ e("div", { className: "pvx-comp-round-pills", children: r.map((i) => /* @__PURE__ */ l(
1439
1439
  "button",
1440
1440
  {
1441
1441
  onClick: () => n === i.roundNumber ? s() : a(i.roundNumber),
1442
1442
  className: `pvx-comp-round-pill ${n === i.roundNumber ? "pvx-comp-round-pill--active" : ""}`,
1443
1443
  children: [
1444
- /* @__PURE__ */ o("span", { className: "pvx-comp-round-pill-num", children: [
1444
+ /* @__PURE__ */ l("span", { className: "pvx-comp-round-pill-num", children: [
1445
1445
  "R",
1446
1446
  i.roundNumber
1447
1447
  ] }),
1448
- i.track && /* @__PURE__ */ t("span", { className: "pvx-comp-round-pill-track", children: i.track })
1448
+ i.track && /* @__PURE__ */ e("span", { className: "pvx-comp-round-pill-track", children: i.track })
1449
1449
  ]
1450
1450
  },
1451
1451
  i.roundNumber
1452
1452
  )) }),
1453
- n ? /* @__PURE__ */ t(dt, { competitionId: e, roundNumber: n }) : /* @__PURE__ */ t("div", { className: "pvx-empty", children: /* @__PURE__ */ t("p", { children: "Select a round to view results." }) })
1454
- ] }) : /* @__PURE__ */ t(M, { message: "No finalised rounds yet." });
1453
+ n ? /* @__PURE__ */ e(ut, { competitionId: t, roundNumber: n }) : /* @__PURE__ */ e("div", { className: "pvx-empty", children: /* @__PURE__ */ e("p", { children: "Select a round to view results." }) })
1454
+ ] }) : /* @__PURE__ */ e(M, { message: "No finalised rounds yet." });
1455
1455
  }
1456
- function Ft({
1457
- competitionId: e,
1456
+ function jt({
1457
+ competitionId: t,
1458
1458
  driverData: r,
1459
1459
  className: n,
1460
1460
  children: a
1461
1461
  }) {
1462
- const { data: s, isLoading: i } = Ke(e), c = He(e), l = Oe(e), v = (s == null ? void 0 : s.isRegistered) || !1, d = i || c.isPending || l.isPending, f = c.error || l.error || null, N = () => {
1462
+ const { data: s, isLoading: i } = Oe(t), c = We(t), o = Ge(t), m = (s == null ? void 0 : s.isRegistered) || !1, d = i || c.isPending || o.isPending, g = c.error || o.error || null, N = () => {
1463
1463
  r && c.mutate(r);
1464
1464
  }, x = () => {
1465
- l.mutate();
1465
+ o.mutate();
1466
1466
  };
1467
- return typeof a == "function" ? a({ isRegistered: v, isLoading: d, register: N, withdraw: x, error: f }) : /* @__PURE__ */ t(
1467
+ return typeof a == "function" ? a({ isRegistered: m, isLoading: d, register: N, withdraw: x, error: g }) : /* @__PURE__ */ e(
1468
1468
  "button",
1469
1469
  {
1470
1470
  className: n,
1471
- onClick: v ? x : N,
1471
+ onClick: m ? x : N,
1472
1472
  disabled: d,
1473
- children: d ? "Loading..." : v ? "Withdraw" : "Register"
1473
+ children: d ? "Loading..." : m ? "Withdraw" : "Register"
1474
1474
  }
1475
1475
  );
1476
1476
  }
1477
- function bt(e) {
1477
+ function Ct(t) {
1478
1478
  const { cdnUrl: r, partnerSlug: n } = T(), a = L({
1479
- queryKey: ["pitvox", "laps", n, e],
1480
- queryFn: () => R(r, `laps/partners/${n}/${e}.json`),
1481
- enabled: !!e,
1479
+ queryKey: ["pitvox", "laps", n, t],
1480
+ queryFn: () => $(r, `laps/partners/${n}/${t}.json`),
1481
+ enabled: !!t,
1482
1482
  staleTime: 3e4,
1483
1483
  refetchInterval: 3e4
1484
1484
  }), s = a.data;
@@ -1500,19 +1500,19 @@ function bt(e) {
1500
1500
  } : null
1501
1501
  };
1502
1502
  }
1503
- function yt(e) {
1503
+ function wt(t) {
1504
1504
  var i;
1505
1505
  const { cdnUrl: r, partnerSlug: n } = T(), a = L({
1506
1506
  queryKey: ["pitvox", "ratings", n],
1507
- queryFn: () => R(r, `leaderboards/partners/${n}/ratings.json`),
1507
+ queryFn: () => $(r, `leaderboards/partners/${n}/ratings.json`),
1508
1508
  staleTime: 6e4,
1509
1509
  refetchInterval: 6e4
1510
1510
  }), s = k(() => {
1511
1511
  var c;
1512
- return !((c = a.data) != null && c.drivers) || !e ? null : a.data.drivers.find(
1513
- (l) => l.identifier === e
1512
+ return !((c = a.data) != null && c.drivers) || !t ? null : a.data.drivers.find(
1513
+ (o) => o.identifier === t
1514
1514
  ) || null;
1515
- }, [(i = a.data) == null ? void 0 : i.drivers, e]);
1515
+ }, [(i = a.data) == null ? void 0 : i.drivers, t]);
1516
1516
  return {
1517
1517
  isLoading: a.isLoading,
1518
1518
  error: a.error,
@@ -1526,109 +1526,199 @@ function yt(e) {
1526
1526
  } : null
1527
1527
  };
1528
1528
  }
1529
- function Ct({ driverName: e, avatarUrl: r, memberSince: n, className: a = "" }) {
1530
- const s = n ? new Date(n).toLocaleDateString("en-GB", { month: "short", year: "numeric" }) : null;
1531
- return /* @__PURE__ */ o("div", { className: `pvx-dash-profile ${a}`, children: [
1532
- r ? /* @__PURE__ */ t("img", { src: r, alt: "", className: "pvx-dash-profile-avatar" }) : /* @__PURE__ */ t("div", { className: "pvx-dash-profile-avatar pvx-dash-profile-avatar--placeholder", children: (e || "?")[0].toUpperCase() }),
1533
- /* @__PURE__ */ o("div", { className: "pvx-dash-profile-info", children: [
1534
- /* @__PURE__ */ t("h2", { className: "pvx-dash-profile-name", children: e }),
1535
- s && /* @__PURE__ */ o("p", { className: "pvx-dash-profile-since", children: [
1529
+ function kt({ driverName: t, avatarUrl: r, memberSince: n, className: a = "" }) {
1530
+ const s = n ? new Date(n).toLocaleDateString("en-GB", { day: "2-digit", month: "2-digit", year: "numeric" }) : null;
1531
+ return /* @__PURE__ */ l("div", { className: `pvx-card pvx-dash-profile ${a}`, children: [
1532
+ r ? /* @__PURE__ */ e("img", { src: r, alt: "", className: "pvx-dash-profile-avatar" }) : /* @__PURE__ */ e("div", { className: "pvx-dash-profile-avatar pvx-dash-profile-avatar--placeholder", children: (t || "?")[0].toUpperCase() }),
1533
+ /* @__PURE__ */ l("div", { className: "pvx-dash-profile-info", children: [
1534
+ /* @__PURE__ */ e("h2", { className: "pvx-dash-profile-name", children: t }),
1535
+ s && /* @__PURE__ */ l("p", { className: "pvx-dash-profile-since", children: [
1536
1536
  "Racing since ",
1537
1537
  s
1538
1538
  ] })
1539
1539
  ] })
1540
1540
  ] });
1541
1541
  }
1542
- function wt({ stats: e, rating: r, className: n = "" }) {
1543
- const a = [];
1544
- return e && (a.push({ label: "Total Laps", value: e.lapCount.toLocaleString() }), a.push({ label: "Cars Driven", value: e.carBreakdown.length }), a.push({ label: "Tracks Driven", value: e.trackBreakdown.length }), a.push({ label: "Records Held", value: e.recordsHeld }), e.bestRanking != null && a.push({ label: "Best Ranking", value: `#${e.bestRanking}` })), r && a.push({
1545
- label: "Driver Rating",
1546
- value: r.rating.toFixed(1),
1547
- sub: `#${r.rank} of ${r.totalDrivers}`
1548
- }), a.length ? /* @__PURE__ */ t("div", { className: `pvx-dash-stats ${n}`, children: a.map((s) => /* @__PURE__ */ o("div", { className: "pvx-dash-stat-card", children: [
1549
- /* @__PURE__ */ t("span", { className: "pvx-dash-stat-value", children: s.value }),
1550
- /* @__PURE__ */ t("span", { className: "pvx-dash-stat-label", children: s.label }),
1551
- s.sub && /* @__PURE__ */ t("span", { className: "pvx-dash-stat-sub", children: s.sub })
1552
- ] }, s.label)) }) : null;
1553
- }
1554
- function kt({ records: e, className: r = "" }) {
1555
- return e != null && e.length ? /* @__PURE__ */ o("div", { className: `pvx-card ${r}`, children: [
1556
- /* @__PURE__ */ t("div", { className: "pvx-card-header", children: /* @__PURE__ */ t("h3", { className: "pvx-card-title", children: "Current Records" }) }),
1557
- /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ o("table", { className: "pvx-table", children: [
1558
- /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ o("tr", { className: "pvx-thead-row", children: [
1559
- /* @__PURE__ */ t("th", { className: "pvx-th", children: "Track" }),
1560
- /* @__PURE__ */ t("th", { className: "pvx-th", children: "Car" }),
1561
- /* @__PURE__ */ t("th", { className: "pvx-th", children: "Lap Time" }),
1562
- /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "Game" })
1542
+ function Tt() {
1543
+ 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: [
1544
+ /* @__PURE__ */ e("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
1545
+ /* @__PURE__ */ e("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
1546
+ /* @__PURE__ */ e("line", { x1: "10", y1: "3", x2: "8", y2: "21" }),
1547
+ /* @__PURE__ */ e("line", { x1: "16", y1: "3", x2: "14", y2: "21" })
1548
+ ] });
1549
+ }
1550
+ function St() {
1551
+ 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: [
1552
+ /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "10" }),
1553
+ /* @__PURE__ */ e("circle", { cx: "12", cy: "12", r: "2" }),
1554
+ /* @__PURE__ */ e("path", { d: "M12 14v4" }),
1555
+ /* @__PURE__ */ e("path", { d: "M10.5 12.5l-4 2.5" }),
1556
+ /* @__PURE__ */ e("path", { d: "M13.5 12.5l4 2.5" })
1557
+ ] });
1558
+ }
1559
+ function Lt() {
1560
+ return /* @__PURE__ */ e("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ e("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" }) });
1561
+ }
1562
+ function ae({ items: t, labelKey: r, countKey: n }) {
1563
+ if (!(t != null && t.length)) return null;
1564
+ const a = t.slice().sort((s, i) => i[n] - s[n]).slice(0, 10);
1565
+ return /* @__PURE__ */ l("div", { className: "pvx-dash-tooltip", children: [
1566
+ a.map((s, i) => /* @__PURE__ */ l("div", { className: "pvx-dash-tooltip-row", children: [
1567
+ /* @__PURE__ */ e("span", { className: "pvx-dash-tooltip-label", children: s[r] }),
1568
+ /* @__PURE__ */ e("span", { className: "pvx-dash-tooltip-value", children: s[n] })
1569
+ ] }, i)),
1570
+ t.length > 10 && /* @__PURE__ */ l("div", { className: "pvx-dash-tooltip-row pvx-dash-tooltip-more", children: [
1571
+ "+",
1572
+ t.length - 10,
1573
+ " more"
1574
+ ] })
1575
+ ] });
1576
+ }
1577
+ function $t({ stats: t, rating: r, className: n = "" }) {
1578
+ if (!t) return null;
1579
+ const a = t.trackBreakdown.map((i) => ({
1580
+ name: V(i.trackId, i.layout),
1581
+ lapCount: i.lapCount
1582
+ })), s = t.carBreakdown.map((i) => ({
1583
+ name: I(i.carId),
1584
+ lapCount: i.lapCount
1585
+ }));
1586
+ return /* @__PURE__ */ l("div", { className: `pvx-dash-stats ${n}`, children: [
1587
+ /* @__PURE__ */ l("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--has-tooltip", children: [
1588
+ /* @__PURE__ */ e(Tt, {}),
1589
+ /* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
1590
+ /* @__PURE__ */ e("span", { className: "pvx-dash-stat-value", children: t.lapCount.toLocaleString() }),
1591
+ /* @__PURE__ */ e("span", { className: "pvx-dash-stat-label", children: "Total Laps" })
1592
+ ] }),
1593
+ /* @__PURE__ */ e(ae, { items: a, labelKey: "name", countKey: "lapCount" })
1594
+ ] }),
1595
+ /* @__PURE__ */ l("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--has-tooltip", children: [
1596
+ /* @__PURE__ */ e(St, {}),
1597
+ /* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
1598
+ /* @__PURE__ */ e("span", { className: "pvx-dash-stat-value", children: t.carBreakdown.length }),
1599
+ /* @__PURE__ */ e("span", { className: "pvx-dash-stat-label", children: "Cars Used" })
1600
+ ] }),
1601
+ /* @__PURE__ */ e(ae, { items: s, labelKey: "name", countKey: "lapCount" })
1602
+ ] }),
1603
+ r && /* @__PURE__ */ l("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--rating", children: [
1604
+ /* @__PURE__ */ e(Lt, {}),
1605
+ /* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
1606
+ /* @__PURE__ */ e("span", { className: "pvx-dash-stat-value", children: r.rating.toFixed(1) }),
1607
+ /* @__PURE__ */ e("span", { className: "pvx-dash-stat-label", children: "Driver Rating" }),
1608
+ /* @__PURE__ */ l("span", { className: "pvx-dash-stat-sub", children: [
1609
+ "#",
1610
+ r.rank,
1611
+ " of ",
1612
+ r.totalDrivers
1613
+ ] })
1614
+ ] })
1615
+ ] })
1616
+ ] });
1617
+ }
1618
+ const se = 10;
1619
+ function Rt({ records: t, className: r = "" }) {
1620
+ const [n, a] = j(!1), s = k(() => t != null && t.length ? t.slice().sort((o, m) => {
1621
+ const d = o.recordedAt ? new Date(o.recordedAt).getTime() : 0;
1622
+ return (m.recordedAt ? new Date(m.recordedAt).getTime() : 0) - d;
1623
+ }) : [], [t]);
1624
+ if (!s.length) return null;
1625
+ const i = n ? s : s.slice(0, se), c = s.length > se;
1626
+ return /* @__PURE__ */ l("div", { className: `pvx-card ${r}`, children: [
1627
+ /* @__PURE__ */ e("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
1628
+ /* @__PURE__ */ e("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: [
1629
+ /* @__PURE__ */ e("path", { d: "M6 9H4.5a2.5 2.5 0 010-5H6" }),
1630
+ /* @__PURE__ */ e("path", { d: "M18 9h1.5a2.5 2.5 0 000-5H18" }),
1631
+ /* @__PURE__ */ e("path", { d: "M4 22h16" }),
1632
+ /* @__PURE__ */ e("path", { d: "M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20 7 22" }),
1633
+ /* @__PURE__ */ e("path", { d: "M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20 17 22" }),
1634
+ /* @__PURE__ */ e("path", { d: "M18 2H6v7a6 6 0 0012 0V2z" })
1563
1635
  ] }) }),
1564
- /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: e.map((n, a) => /* @__PURE__ */ o("tr", { className: "pvx-row", children: [
1565
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary", children: J(n.trackId, n.layout, n.game) }),
1566
- /* @__PURE__ */ t("td", { className: "pvx-td", children: B(n.carId) }),
1567
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--mono", children: U(n.lapTimeMs) }),
1568
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-hidden-below-sm", children: /* @__PURE__ */ o("span", { className: `pvx-dash-game-badge pvx-dash-game-badge--${n.game || "evo"}`, children: [
1569
- (n.game || "evo").toUpperCase(),
1570
- n.gameVersion ? ` ${n.gameVersion}` : ""
1571
- ] }) })
1572
- ] }, a)) })
1573
- ] }) })
1574
- ] }) : null;
1636
+ "Current Records",
1637
+ /* @__PURE__ */ l("span", { className: "pvx-dash-records-count", children: [
1638
+ "(",
1639
+ s.length,
1640
+ ")"
1641
+ ] })
1642
+ ] }) }),
1643
+ /* @__PURE__ */ e("div", { className: "pvx-dash-records-list", children: i.map((o, m) => /* @__PURE__ */ l("div", { className: "pvx-dash-record-row", children: [
1644
+ /* @__PURE__ */ l("div", { className: "pvx-dash-record-info", children: [
1645
+ /* @__PURE__ */ e("span", { className: "pvx-dash-record-track", children: V(o.trackId, o.layout, o.game) }),
1646
+ /* @__PURE__ */ e("span", { className: "pvx-dash-record-car", children: I(o.carId) })
1647
+ ] }),
1648
+ /* @__PURE__ */ l("div", { className: "pvx-dash-record-time", children: [
1649
+ /* @__PURE__ */ e("span", { className: "pvx-dash-record-lap", children: E(o.lapTimeMs) }),
1650
+ /* @__PURE__ */ l("span", { className: `pvx-dash-game-badge pvx-dash-game-badge--${o.game || "evo"}`, children: [
1651
+ (o.game || "evo").toUpperCase(),
1652
+ o.gameVersion ? ` ${o.gameVersion}` : ""
1653
+ ] })
1654
+ ] })
1655
+ ] }, m)) }),
1656
+ c && /* @__PURE__ */ e(
1657
+ "button",
1658
+ {
1659
+ className: "pvx-dash-records-toggle",
1660
+ onClick: () => a(!n),
1661
+ children: n ? "Show less" : `Show all ${s.length} records`
1662
+ }
1663
+ )
1664
+ ] });
1575
1665
  }
1576
- function Ut({ steamId: e, avatarUrl: r, memberSince: n, className: a = "" }) {
1577
- const { data: s, isLoading: i, error: c } = bt(e), { data: l, isLoading: v } = yt(e);
1578
- return i || v ? /* @__PURE__ */ t("div", { className: "pvx-loading", children: "Loading dashboard..." }) : c ? /* @__PURE__ */ t("div", { className: "pvx-empty", children: "Failed to load dashboard data." }) : s ? /* @__PURE__ */ o("div", { className: `pvx-dash ${a}`, children: [
1579
- /* @__PURE__ */ t(
1580
- Ct,
1666
+ function Vt({ steamId: t, avatarUrl: r, memberSince: n, className: a = "" }) {
1667
+ const { data: s, isLoading: i, error: c } = Ct(t), { data: o, isLoading: m } = wt(t);
1668
+ return i || m ? /* @__PURE__ */ e("div", { className: "pvx-loading", children: "Loading dashboard..." }) : c ? /* @__PURE__ */ e("div", { className: "pvx-empty", children: "Failed to load dashboard data." }) : s ? /* @__PURE__ */ l("div", { className: `pvx-dash ${a}`, children: [
1669
+ /* @__PURE__ */ e(
1670
+ kt,
1581
1671
  {
1582
1672
  driverName: s.driverName,
1583
1673
  avatarUrl: r,
1584
1674
  memberSince: n
1585
1675
  }
1586
1676
  ),
1587
- /* @__PURE__ */ t(wt, { stats: s, rating: l }),
1588
- /* @__PURE__ */ t(kt, { records: s.currentRecords })
1589
- ] }) : /* @__PURE__ */ t("div", { className: "pvx-empty", children: "No data available yet. Start driving to see your stats!" });
1677
+ /* @__PURE__ */ e($t, { stats: s, rating: o }),
1678
+ /* @__PURE__ */ e(Rt, { records: s.currentRecords })
1679
+ ] }) : /* @__PURE__ */ e("div", { className: "pvx-empty", children: "No data available yet. Start driving to see your stats!" });
1590
1680
  }
1591
1681
  export {
1592
- Xe as CarsTable,
1593
- st as CompetitionCards,
1594
- Pt as CompetitionExplorer,
1595
- Ut as DriverDashboard,
1596
- Ct as DriverProfile,
1597
- Ye as DriversTable,
1598
- ht as EntryList,
1599
- et as LapHistoryTable,
1600
- At as LeaderboardExplorer,
1601
- $t as PitVoxPartnerProvider,
1602
- kt as RecordsTable,
1603
- Ft as RegisterButton,
1604
- dt as RoundResults,
1605
- ot as StandingsTable,
1606
- wt as StatsCards,
1607
- Ze as TracksTable,
1608
- B as formatCarName,
1609
- E as formatDate,
1610
- Bt as formatDelta,
1611
- U as formatLapTime,
1612
- Dt as formatRelativeTime,
1682
+ et as CarsTable,
1683
+ ot as CompetitionCards,
1684
+ qt as CompetitionExplorer,
1685
+ Vt as DriverDashboard,
1686
+ kt as DriverProfile,
1687
+ tt as DriversTable,
1688
+ gt as EntryList,
1689
+ nt as LapHistoryTable,
1690
+ _t as LeaderboardExplorer,
1691
+ At as PitVoxPartnerProvider,
1692
+ Rt as RecordsTable,
1693
+ jt as RegisterButton,
1694
+ ut as RoundResults,
1695
+ dt as StandingsTable,
1696
+ $t as StatsCards,
1697
+ Ye as TracksTable,
1698
+ I as formatCarName,
1699
+ F as formatDate,
1700
+ Ut as formatDelta,
1701
+ E as formatLapTime,
1702
+ Pt as formatRelativeTime,
1613
1703
  P as formatSectorTime,
1614
- J as formatTrackName,
1615
- ie as formatTyreCompound,
1616
- Mt as useCarLeaderboard,
1704
+ V as formatTrackName,
1705
+ le as formatTyreCompound,
1706
+ Et as useCarLeaderboard,
1617
1707
  Fe as useCarMetadata,
1618
- It as useCompetitionAllRounds,
1619
- oe as useCompetitionConfig,
1620
- _e as useCompetitionEntryList,
1621
- qe as useCompetitionRound,
1622
- Ee as useCompetitionStandings,
1623
- Ue as useCompetitions,
1624
- Ae as useDriverLaps,
1625
- yt as useDriverRating,
1626
- bt as useDriverStats,
1627
- Ie as useLeaderboardIndex,
1708
+ Ft as useCompetitionAllRounds,
1709
+ de as useCompetitionConfig,
1710
+ Ve as useCompetitionEntryList,
1711
+ je as useCompetitionRound,
1712
+ qe as useCompetitionStandings,
1713
+ _e as useCompetitions,
1714
+ Ue as useDriverLaps,
1715
+ wt as useDriverRating,
1716
+ Ct as useDriverStats,
1717
+ Pe as useLeaderboardIndex,
1628
1718
  T as usePitVox,
1629
- He as useRegister,
1630
- Ke as useRegistrationStatus,
1631
- le as useTrackLeaderboard,
1632
- Pe as useUserLookup,
1633
- Oe as useWithdraw
1719
+ We as useRegister,
1720
+ Oe as useRegistrationStatus,
1721
+ ce as useTrackLeaderboard,
1722
+ Ee as useUserLookup,
1723
+ Ge as useWithdraw
1634
1724
  };