@pitvox/partner-react 0.5.7 → 0.5.8

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