@pitvox/partner-react 0.7.9 → 0.7.10

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