@pitvox/partner-react 0.6.2 → 0.6.3

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