@pitvox/partner-react 0.7.11 → 0.7.13

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,12 +1,12 @@
1
- import { jsx as t, jsxs as l, Fragment as U } from "react/jsx-runtime";
2
- import { createContext as De, useMemo as L, useContext as Ie, useState as D, useCallback as H, useRef as Pe, useEffect as Be } from "react";
3
- import { useQueryClient as _, QueryClient as Ae, QueryClientProvider as Ue, useQuery as T, useMutation as O, useQueries as ce } from "@tanstack/react-query";
4
- const Z = De(null), Fe = "https://cdn.pitvox.com", Ee = "https://pitvox.com";
1
+ import { jsx as t, jsxs as l, Fragment as F } from "react/jsx-runtime";
2
+ import { createContext as Be, useMemo as S, useContext as Ae, useState as D, useCallback as H, useRef as Ue, useEffect as Fe } from "react";
3
+ import { useQueryClient as _, QueryClient as Ee, QueryClientProvider as _e, useQuery as T, useMutation as O, useQueries as ce } from "@tanstack/react-query";
4
+ const Z = Be(null), qe = "https://cdn.pitvox.com", je = "https://pitvox.com";
5
5
  let Y = null;
6
- function en({
6
+ function rn({
7
7
  partnerSlug: e = null,
8
- cdnUrl: n = Fe,
9
- pitvoxUrl: s = Ee,
8
+ cdnUrl: n = qe,
9
+ pitvoxUrl: s = je,
10
10
  getSteamId: r,
11
11
  onRegister: a,
12
12
  onWithdraw: i,
@@ -16,7 +16,7 @@ function en({
16
16
  onFetchServerPassword: c,
17
17
  children: u
18
18
  }) {
19
- const g = L(() => ({
19
+ const g = S(() => ({
20
20
  partnerSlug: e,
21
21
  cdnUrl: n.replace(/\/$/, ""),
22
22
  pitvoxUrl: s.replace(/\/$/, ""),
@@ -34,14 +34,14 @@ function en({
34
34
  } catch {
35
35
  f = !1;
36
36
  }
37
- return f ? /* @__PURE__ */ t(Z.Provider, { value: g, children: u }) : (Y || (Y = new Ae({
37
+ return f ? /* @__PURE__ */ t(Z.Provider, { value: g, children: u }) : (Y || (Y = new Ee({
38
38
  defaultOptions: {
39
39
  queries: { staleTime: 6e4 }
40
40
  }
41
- })), /* @__PURE__ */ t(Ue, { client: Y, children: /* @__PURE__ */ t(Z.Provider, { value: g, children: u }) }));
41
+ })), /* @__PURE__ */ t(_e, { client: Y, children: /* @__PURE__ */ t(Z.Provider, { value: g, children: u }) }));
42
42
  }
43
- function k() {
44
- const e = Ie(Z);
43
+ function C() {
44
+ const e = Ae(Z);
45
45
  if (!e)
46
46
  throw new Error("usePitVox must be used within a <PitVoxPartnerProvider>");
47
47
  return e;
@@ -58,23 +58,23 @@ function X(e, n, s, ...r) {
58
58
  const a = ["leaderboards"];
59
59
  return e && a.push(`partners/${e}`), n && a.push(n), s && a.push(`v/${s}`), [...a, ...r].join("/");
60
60
  }
61
- function _e(e, n, s, r) {
61
+ function Ve(e, n, s, r) {
62
62
  const a = r || "default";
63
63
  return e ? `laps/partners/${e}/${n}/${s}/${a}.json` : `laps/${n}/${s}/${a}.json`;
64
64
  }
65
- function qe(e, n) {
65
+ function Ke(e, n) {
66
66
  return e ? `laps/partners/${e}/${n}/index.json` : `laps/${n}/index.json`;
67
67
  }
68
- function je(e) {
68
+ function He(e) {
69
69
  return e ? `recent-laps/partners/${e}.json` : "recent-laps.json";
70
70
  }
71
- function A(e) {
71
+ function U(e) {
72
72
  if (!e && e !== 0) return "-";
73
73
  const n = Math.floor(e / 1e3), s = Math.floor(n / 60), r = n % 60, a = e % 1e3;
74
74
  return `${s}:${String(r).padStart(2, "0")}.${String(a).padStart(3, "0")}`;
75
75
  }
76
76
  function B(e) {
77
- return !e && e !== 0 ? "-" : e >= 6e4 ? A(e) : (e / 1e3).toFixed(3);
77
+ return !e && e !== 0 ? "-" : e >= 6e4 ? U(e) : (e / 1e3).toFixed(3);
78
78
  }
79
79
  function I(e) {
80
80
  if (!e) return "";
@@ -111,10 +111,10 @@ function ue(e) {
111
111
  const i = Math.floor(a / 24);
112
112
  return i < 30 ? `${i}d ago` : j(e);
113
113
  }
114
- function tn(e) {
114
+ function sn(e) {
115
115
  return e == null ? "" : `${e >= 0 ? "+" : "-"}${(Math.abs(e) / 1e3).toFixed(3)}`;
116
116
  }
117
- function Ve(e, n) {
117
+ function Oe(e, n) {
118
118
  const { type: s, title: r, trackId: a, trackLayout: i, carId: o, game: d, data: p } = e, c = typeof p == "string" ? JSON.parse(p) : p, u = a ? q(a, i, d) : null, g = o ? I(o) : null, f = [u, g].filter(Boolean).join(" — ");
119
119
  return s === "RECORD_BEATEN" && f ? `${c != null && c.beatenBySteamId && n ? n(c.beatenBySteamId).displayName : "Someone"} beat your record on ${f}` : s === "RECORD_SET" && f ? `You set a new record on ${f}` : r || "New notification";
120
120
  }
@@ -137,18 +137,18 @@ function he(e) {
137
137
  const n = Number(e);
138
138
  return isNaN(n) ? "-" : n % 1 ? `${n.toFixed(1)}L` : `${n}L`;
139
139
  }
140
- function nn(e = {}) {
140
+ function an(e = {}) {
141
141
  var p, c, u, g, f, m;
142
- const { cdnUrl: n, partnerSlug: s } = k(), { game: r, gameVersion: a } = e, i = X(s, null, null, "index.json"), o = T({
142
+ const { cdnUrl: n, partnerSlug: s } = C(), { game: r, gameVersion: a } = e, i = X(s, null, null, "index.json"), o = T({
143
143
  queryKey: ["pitvox", "leaderboards", s, "index"],
144
144
  queryFn: () => R(n, i),
145
145
  staleTime: 3e4,
146
146
  refetchInterval: 3e4
147
- }), d = L(() => {
147
+ }), d = S(() => {
148
148
  var x;
149
149
  if (!((x = o.data) != null && x.tracks)) return [];
150
- let b = o.data.tracks;
151
- return r && (b = b.filter((v) => v.game === r)), a && (b = b.filter((v) => v.gameVersion === a)), b.map((v) => ({
150
+ let y = o.data.tracks;
151
+ return r && (y = y.filter((v) => v.game === r)), a && (y = y.filter((v) => v.gameVersion === a)), y.map((v) => ({
152
152
  id: v.trackId,
153
153
  layout: v.layout,
154
154
  game: v.game,
@@ -176,20 +176,20 @@ function nn(e = {}) {
176
176
  versions: ((m = o.data) == null ? void 0 : m.versions) || {}
177
177
  };
178
178
  }
179
- function Ke(e, n, s = {}) {
180
- const { cdnUrl: r, partnerSlug: a } = k(), { carId: i, game: o, gameVersion: d } = s, p = n || "default", c = X(a, o, d, `tracks/${e}/${p}.json`), { data: u, isLoading: g, error: f } = T({
179
+ function We(e, n, s = {}) {
180
+ const { cdnUrl: r, partnerSlug: a } = C(), { carId: i, game: o, gameVersion: d } = s, p = n || "default", c = X(a, o, d, `tracks/${e}/${p}.json`), { data: u, isLoading: g, error: f } = T({
181
181
  queryKey: ["pitvox", "leaderboards", a, "track", e, p, o, d],
182
182
  queryFn: () => R(r, c),
183
183
  enabled: !!e,
184
184
  staleTime: 3e4,
185
185
  refetchInterval: 3e4
186
186
  });
187
- return { data: L(() => {
187
+ return { data: S(() => {
188
188
  if (!(u != null && u.entries)) return [];
189
- let b = u.entries;
190
- if (o && (b = b.filter((x) => x.game === o)), !i) {
189
+ let y = u.entries;
190
+ if (o && (y = y.filter((x) => x.game === o)), !i) {
191
191
  const x = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map();
192
- for (const N of b) {
192
+ for (const N of y) {
193
193
  const h = N.steamId || N.userId;
194
194
  v.has(N.carId) || v.set(N.carId, /* @__PURE__ */ new Set()), v.get(N.carId).add(h), (!x.has(N.carId) || N.lapTimeMs < x.get(N.carId).lapTimeMs) && x.set(N.carId, N);
195
195
  }
@@ -198,35 +198,35 @@ function Ke(e, n, s = {}) {
198
198
  return { ...N, driverCount: ((h = v.get(N.carId)) == null ? void 0 : h.size) || 0 };
199
199
  }).sort((N, h) => N.lapTimeMs - h.lapTimeMs);
200
200
  }
201
- return b.filter((x) => x.carId === i).sort((x, v) => x.lapTimeMs - v.lapTimeMs);
201
+ return y.filter((x) => x.carId === i).sort((x, v) => x.lapTimeMs - v.lapTimeMs);
202
202
  }, [u == null ? void 0 : u.entries, i, o]), isLoading: g, error: f };
203
203
  }
204
- function He(e, n, s, r, a = {}) {
204
+ function ze(e, n, s, r, a = {}) {
205
205
  var x, v;
206
- const { cdnUrl: i, partnerSlug: o } = k(), { showInvalid: d = !1, game: p, gameVersion: c } = a, u = e && n ? _e(o, e, n, s) : null, f = T({
206
+ const { cdnUrl: i, partnerSlug: o } = C(), { showInvalid: d = !1, game: p, gameVersion: c } = a, u = e && n ? Ve(o, e, n, s) : null, f = T({
207
207
  queryKey: ["pitvox", "laps", o, e, n, s || "default"],
208
208
  queryFn: () => R(i, u),
209
209
  enabled: !!e && !!n,
210
210
  staleTime: 3e4,
211
211
  refetchInterval: 3e4
212
- }), m = L(() => {
212
+ }), m = S(() => {
213
213
  var N;
214
214
  return (N = f.data) != null && N.laps ? f.data.laps.filter((h) => !(h.carId !== r || p && h.game !== p || c && h.gameVersion !== c || !d && !h.isValid)).sort((h, w) => h.lapTimeMs - w.lapTimeMs) : [];
215
- }, [(x = f.data) == null ? void 0 : x.laps, r, p, c, d]), b = L(() => {
216
- const N = m.filter(($) => $.isValid && $.sector1Ms && $.sector2Ms && $.sector3Ms);
215
+ }, [(x = f.data) == null ? void 0 : x.laps, r, p, c, d]), y = S(() => {
216
+ const N = m.filter((k) => k.isValid && k.sector1Ms && k.sector2Ms && k.sector3Ms);
217
217
  if (N.length < 2) return null;
218
- const h = Math.min(...N.map(($) => $.sector1Ms)), w = Math.min(...N.map(($) => $.sector2Ms)), y = Math.min(...N.map(($) => $.sector3Ms)), C = h + w + y, S = Math.min(...N.map(($) => $.lapTimeMs));
219
- return C >= S ? null : { lapTimeMs: C, sector1Ms: h, sector2Ms: w, sector3Ms: y };
218
+ const h = Math.min(...N.map((k) => k.sector1Ms)), w = Math.min(...N.map((k) => k.sector2Ms)), b = Math.min(...N.map((k) => k.sector3Ms)), L = h + w + b, M = Math.min(...N.map((k) => k.lapTimeMs));
219
+ return L >= M ? null : { lapTimeMs: L, sector1Ms: h, sector2Ms: w, sector3Ms: b };
220
220
  }, [m]);
221
221
  return {
222
222
  ...f,
223
223
  data: m,
224
224
  driverName: ((v = f.data) == null ? void 0 : v.driverName) || "Driver",
225
- theoreticalBest: b
225
+ theoreticalBest: y
226
226
  };
227
227
  }
228
228
  function ve() {
229
- const { cdnUrl: e } = k(), { data: n } = T({
229
+ const { cdnUrl: e } = C(), { data: n } = T({
230
230
  queryKey: ["pitvox", "users", "index"],
231
231
  queryFn: () => R(e, "users/index.json"),
232
232
  staleTime: 5 * 6e4,
@@ -241,8 +241,8 @@ function ve() {
241
241
  };
242
242
  };
243
243
  }
244
- function rn() {
245
- const { cdnUrl: e } = k(), { data: n } = T({
244
+ function on() {
245
+ const { cdnUrl: e } = C(), { data: n } = T({
246
246
  queryKey: ["pitvox", "cars", "evo"],
247
247
  queryFn: () => R(e, "cars/evo.json"),
248
248
  staleTime: 5 * 6e4,
@@ -253,9 +253,9 @@ function rn() {
253
253
  cars: (n == null ? void 0 : n.cars) || {}
254
254
  };
255
255
  }
256
- function sn() {
256
+ function ln() {
257
257
  var a, i;
258
- const { cdnUrl: e, partnerSlug: n } = k(), s = je(n), r = T({
258
+ const { cdnUrl: e, partnerSlug: n } = C(), s = He(n), r = T({
259
259
  queryKey: ["pitvox", "recentLaps", n],
260
260
  queryFn: () => R(e, s),
261
261
  staleTime: 3e4,
@@ -268,11 +268,11 @@ function sn() {
268
268
  isLoading: r.isLoading
269
269
  };
270
270
  }
271
- function an(e, n) {
272
- return Ke(e, null, { carId: n });
271
+ function cn(e, n) {
272
+ return We(e, null, { carId: n });
273
273
  }
274
- function on() {
275
- const { cdnUrl: e, partnerSlug: n } = k();
274
+ function dn() {
275
+ const { cdnUrl: e, partnerSlug: n } = C();
276
276
  return T({
277
277
  queryKey: ["pitvox", "competitions", n],
278
278
  queryFn: async () => {
@@ -283,7 +283,7 @@ function on() {
283
283
  });
284
284
  }
285
285
  function xe(e, n = {}) {
286
- const s = k(), r = n.partnerSlug || s.partnerSlug;
286
+ const s = C(), r = n.partnerSlug || s.partnerSlug;
287
287
  return T({
288
288
  queryKey: ["pitvox", "competition", r, e, "config"],
289
289
  queryFn: () => R(s.cdnUrl, `competitions/${r}/${e}/config.json`),
@@ -292,7 +292,7 @@ function xe(e, n = {}) {
292
292
  });
293
293
  }
294
294
  function ge(e, n = {}) {
295
- const s = k(), r = n.partnerSlug || s.partnerSlug;
295
+ const s = C(), r = n.partnerSlug || s.partnerSlug;
296
296
  return T({
297
297
  queryKey: ["pitvox", "competition", r, e, "standings"],
298
298
  queryFn: () => R(s.cdnUrl, `competitions/${r}/${e}/standings.json`),
@@ -300,8 +300,8 @@ function ge(e, n = {}) {
300
300
  staleTime: 6e4
301
301
  });
302
302
  }
303
- function Oe(e, n, s = {}) {
304
- const r = k(), a = s.partnerSlug || r.partnerSlug;
303
+ function Ge(e, n, s = {}) {
304
+ const r = C(), a = s.partnerSlug || r.partnerSlug;
305
305
  return T({
306
306
  queryKey: ["pitvox", "competition", a, e, "round", n],
307
307
  queryFn: () => R(r.cdnUrl, `competitions/${a}/${e}/rounds/${n}.json`),
@@ -309,8 +309,8 @@ function Oe(e, n, s = {}) {
309
309
  staleTime: 6e4
310
310
  });
311
311
  }
312
- function We(e, n = [], s = {}) {
313
- const r = k(), a = s.partnerSlug || r.partnerSlug;
312
+ function Qe(e, n = [], s = {}) {
313
+ const r = C(), a = s.partnerSlug || r.partnerSlug;
314
314
  return T({
315
315
  queryKey: ["pitvox", "competition", a, e, "allRounds", n],
316
316
  queryFn: async () => (await Promise.all(
@@ -322,8 +322,8 @@ function We(e, n = [], s = {}) {
322
322
  staleTime: 6e4
323
323
  });
324
324
  }
325
- function ze(e, n = {}) {
326
- const s = k(), r = n.partnerSlug || s.partnerSlug;
325
+ function Ye(e, n = {}) {
326
+ const s = C(), r = n.partnerSlug || s.partnerSlug;
327
327
  return T({
328
328
  queryKey: ["pitvox", "competition", r, e, "leaderboard"],
329
329
  queryFn: () => R(s.cdnUrl, `competitions/${r}/${e}/leaderboard.json`).catch(() => null),
@@ -331,8 +331,8 @@ function ze(e, n = {}) {
331
331
  staleTime: 6e4
332
332
  });
333
333
  }
334
- function Ge(e, n, s = {}) {
335
- const r = k(), a = s.partnerSlug || r.partnerSlug;
334
+ function Je(e, n, s = {}) {
335
+ const r = C(), a = s.partnerSlug || r.partnerSlug;
336
336
  return T({
337
337
  queryKey: ["pitvox", "competition", a, e, "round", n, "laps"],
338
338
  queryFn: () => R(r.cdnUrl, `competitions/${a}/${e}/rounds/${n}/laps.json`).catch(() => null),
@@ -341,7 +341,7 @@ function Ge(e, n, s = {}) {
341
341
  });
342
342
  }
343
343
  function fe(e, n = {}) {
344
- const s = k(), r = n.partnerSlug || s.partnerSlug;
344
+ const s = C(), r = n.partnerSlug || s.partnerSlug;
345
345
  return T({
346
346
  queryKey: ["pitvox", "competition", r, e, "entrylist"],
347
347
  queryFn: () => R(s.cdnUrl, `competitions/${r}/${e}/entrylist.json`),
@@ -350,7 +350,7 @@ function fe(e, n = {}) {
350
350
  });
351
351
  }
352
352
  function ee(e) {
353
- const { cdnUrl: n, partnerSlug: s, getSteamId: r } = k(), a = r();
353
+ const { cdnUrl: n, partnerSlug: s, getSteamId: r } = C(), a = r();
354
354
  return T({
355
355
  queryKey: ["pitvox", "registration", s, e, a],
356
356
  queryFn: async () => {
@@ -365,7 +365,7 @@ function ee(e) {
365
365
  });
366
366
  }
367
367
  function Ne(e) {
368
- const { onRegister: n, partnerSlug: s, getSteamId: r } = k(), a = _(), i = ve();
368
+ const { onRegister: n, partnerSlug: s, getSteamId: r } = C(), a = _(), i = ve();
369
369
  return O({
370
370
  mutationFn: (o) => {
371
371
  if (!n)
@@ -397,7 +397,7 @@ function Ne(e) {
397
397
  });
398
398
  }
399
399
  function be(e) {
400
- const { onWithdraw: n, partnerSlug: s, getSteamId: r } = k(), a = _();
400
+ const { onWithdraw: n, partnerSlug: s, getSteamId: r } = C(), a = _();
401
401
  return O({
402
402
  mutationFn: (i) => {
403
403
  if (!n)
@@ -421,14 +421,14 @@ function be(e) {
421
421
  });
422
422
  }
423
423
  function te() {
424
- const { onRegister: e, onWithdraw: n } = k(), s = !!(e && n);
424
+ const { onRegister: e, onWithdraw: n } = C(), s = !!(e && n);
425
425
  return { isPowerMode: s, isBasicMode: !s };
426
426
  }
427
427
  function ne(e) {
428
- const { pitvoxUrl: n, partnerSlug: s } = k();
428
+ const { pitvoxUrl: n, partnerSlug: s } = C();
429
429
  return `${n}/p/${s}/competitions/${e}/register`;
430
430
  }
431
- const Qe = {
431
+ const Ze = {
432
432
  formula: "Formula",
433
433
  gt3: "GT3",
434
434
  gt2: "GT2",
@@ -453,7 +453,7 @@ const Qe = {
453
453
  { id: "tier", tags: ["hypercar", "supercar", "sports_car", "hot_hatch", "lightweight"] },
454
454
  { id: "era", tags: ["1960s", "1970s", "1980s", "1990s", "2000s", "2010s", "2020s"] }
455
455
  ];
456
- function Ye(e) {
456
+ function Xe(e) {
457
457
  for (const n of ye)
458
458
  if (n.tags.includes(e)) return n.id;
459
459
  return "other";
@@ -462,7 +462,7 @@ function we(e, n) {
462
462
  if (n.size === 0) return !0;
463
463
  const s = {};
464
464
  for (const r of n) {
465
- const a = Ye(r);
465
+ const a = Xe(r);
466
466
  s[a] || (s[a] = []), s[a].push(r);
467
467
  }
468
468
  for (const r of Object.values(s))
@@ -504,10 +504,10 @@ function Ce(e, n = !1) {
504
504
  s3: Math.min(...s.map((r) => r.sector3Ms).filter(Boolean))
505
505
  } : null;
506
506
  }
507
- function Je({ active: e, dir: n }) {
507
+ function et({ active: e, dir: n }) {
508
508
  return e ? n === "asc" ? /* @__PURE__ */ t("svg", { className: "pvx-sort-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 15.75l7.5-7.5 7.5 7.5" }) }) : /* @__PURE__ */ t("svg", { className: "pvx-sort-icon", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19.5 8.25l-7.5 7.5-7.5-7.5" }) }) : /* @__PURE__ */ t("svg", { className: "pvx-sort-icon pvx-sort-icon--inactive", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8 9l4-4 4 4M16 15l-4 4-4-4" }) });
509
509
  }
510
- function M({ label: e, sortKey: n, config: s, onSort: r, className: a = "" }) {
510
+ function $({ label: e, sortKey: n, config: s, onSort: r, className: a = "" }) {
511
511
  return /* @__PURE__ */ t(
512
512
  "th",
513
513
  {
@@ -515,7 +515,7 @@ function M({ label: e, sortKey: n, config: s, onSort: r, className: a = "" }) {
515
515
  onClick: () => r(n),
516
516
  children: /* @__PURE__ */ l("span", { className: "pvx-th-inner", children: [
517
517
  e,
518
- /* @__PURE__ */ t(Je, { active: s.key === n, dir: s.dir })
518
+ /* @__PURE__ */ t(et, { active: s.key === n, dir: s.dir })
519
519
  ] })
520
520
  }
521
521
  );
@@ -549,7 +549,7 @@ function Le({ availableTags: e, activeTags: n, onToggle: s, onClear: r }) {
549
549
  {
550
550
  onClick: () => s(d),
551
551
  className: `pvx-tag ${n.has(d) ? "pvx-tag--active" : ""}`,
552
- children: Qe[d] || d
552
+ children: Ze[d] || d
553
553
  },
554
554
  d
555
555
  ))
@@ -574,30 +574,30 @@ function V({ message: e }) {
574
574
  function K() {
575
575
  return /* @__PURE__ */ t("div", { className: "pvx-loading", children: "Loading..." });
576
576
  }
577
- function Ze() {
577
+ function tt() {
578
578
  return /* @__PURE__ */ t("svg", { className: "pvx-icon pvx-icon--valid", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M4.5 12.75l6 6 9-13.5" }) });
579
579
  }
580
- function Xe() {
580
+ function nt() {
581
581
  return /* @__PURE__ */ t("svg", { className: "pvx-icon pvx-icon--invalid", fill: "none", viewBox: "0 0 24 24", strokeWidth: 2, stroke: "currentColor", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) });
582
582
  }
583
- function ln({ tracks: e, isLoading: n, carMetadata: s, getUserDisplay: r, onTrackSelect: a, tags: i, onTagChange: o }) {
584
- const [d, p] = W({ key: "record.timestamp", dir: "desc" }), { activeTags: c, toggle: u, clear: g } = ke(i, o), f = L(() => {
583
+ function pn({ tracks: e, isLoading: n, carMetadata: s, getUserDisplay: r, onTrackSelect: a, tags: i, onTagChange: o }) {
584
+ const [d, p] = W({ key: "record.timestamp", dir: "desc" }), { activeTags: c, toggle: u, clear: g } = ke(i, o), f = S(() => {
585
585
  var v;
586
586
  if (!((v = s == null ? void 0 : s.tags) != null && v.length)) return [];
587
587
  const x = /* @__PURE__ */ new Set();
588
588
  for (const N of e || [])
589
589
  N.recordByTag && Object.keys(N.recordByTag).forEach((h) => x.add(h));
590
590
  return s.tags.filter((N) => x.has(N));
591
- }, [e, s]), m = L(() => e ? c.size === 0 ? e : e.map((x) => {
591
+ }, [e, s]), m = S(() => e ? c.size === 0 ? e : e.map((x) => {
592
592
  var h, w;
593
593
  if (!x.recordByTag) return null;
594
594
  let v = null;
595
595
  const N = /* @__PURE__ */ new Set();
596
- for (const y of Object.values(x.recordByTag)) {
597
- if (N.has(y.carId)) continue;
598
- N.add(y.carId);
599
- const C = ((w = (h = s == null ? void 0 : s.cars) == null ? void 0 : h[y.carId]) == null ? void 0 : w.tags) || ["sports_car"];
600
- we(C, c) && (!v || y.lapTimeMs < v.lapTimeMs) && (v = y);
596
+ for (const b of Object.values(x.recordByTag)) {
597
+ if (N.has(b.carId)) continue;
598
+ N.add(b.carId);
599
+ const L = ((w = (h = s == null ? void 0 : s.cars) == null ? void 0 : h[b.carId]) == null ? void 0 : w.tags) || ["sports_car"];
600
+ we(L, c) && (!v || b.lapTimeMs < v.lapTimeMs) && (v = b);
601
601
  }
602
602
  return v ? {
603
603
  ...x,
@@ -609,7 +609,7 @@ function ln({ tracks: e, isLoading: n, carMetadata: s, getUserDisplay: r, onTrac
609
609
  timestamp: v.recordedAt
610
610
  }
611
611
  } : null;
612
- }).filter(Boolean) : [], [e, c, s]), b = L(() => z(m, d, (x, v) => {
612
+ }).filter(Boolean) : [], [e, c, s]), y = S(() => z(m, d, (x, v) => {
613
613
  var N, h;
614
614
  switch (v) {
615
615
  case "displayName":
@@ -630,15 +630,15 @@ function ln({ tracks: e, isLoading: n, carMetadata: s, getUserDisplay: r, onTrac
630
630
  /* @__PURE__ */ t(Le, { availableTags: f, activeTags: c, onToggle: u, onClear: g }),
631
631
  /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
632
632
  /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
633
- /* @__PURE__ */ t(M, { label: "Track", sortKey: "displayName", config: d, onSort: p }),
633
+ /* @__PURE__ */ t($, { label: "Track", sortKey: "displayName", config: d, onSort: p }),
634
634
  /* @__PURE__ */ t("th", { className: "pvx-th", children: "Record Holder" }),
635
635
  /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-lg", children: "Car" }),
636
- /* @__PURE__ */ t(M, { label: "Lap Time", sortKey: "record.lapTimeMs", config: d, onSort: p }),
637
- /* @__PURE__ */ t(M, { label: "Drivers", sortKey: "driverCount", config: d, onSort: p, className: "pvx-hidden-below-md" }),
638
- /* @__PURE__ */ t(M, { label: "Cars", sortKey: "carCount", config: d, onSort: p, className: "pvx-hidden-below-lg" }),
639
- /* @__PURE__ */ t(M, { label: "Date", sortKey: "record.timestamp", config: d, onSort: p, className: "pvx-hidden-below-xl" })
636
+ /* @__PURE__ */ t($, { label: "Lap Time", sortKey: "record.lapTimeMs", config: d, onSort: p }),
637
+ /* @__PURE__ */ t($, { label: "Drivers", sortKey: "driverCount", config: d, onSort: p, className: "pvx-hidden-below-md" }),
638
+ /* @__PURE__ */ t($, { label: "Cars", sortKey: "carCount", config: d, onSort: p, className: "pvx-hidden-below-lg" }),
639
+ /* @__PURE__ */ t($, { label: "Date", sortKey: "record.timestamp", config: d, onSort: p, className: "pvx-hidden-below-xl" })
640
640
  ] }) }),
641
- /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: b.map((x) => {
641
+ /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: y.map((x) => {
642
642
  var v, N, h;
643
643
  return /* @__PURE__ */ l(
644
644
  "tr",
@@ -649,7 +649,7 @@ function ln({ tracks: e, isLoading: n, carMetadata: s, getUserDisplay: r, onTrac
649
649
  /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary", children: x.displayName }),
650
650
  /* @__PURE__ */ t("td", { className: "pvx-td", children: (v = x.record) != null && v.visibleId ? /* @__PURE__ */ t(G, { userId: x.record.visibleId, getUserDisplay: r }) : "-" }),
651
651
  /* @__PURE__ */ t("td", { className: "pvx-td pvx-hidden-below-lg", children: ((N = x.record) == null ? void 0 : N.carDisplayName) || "-" }),
652
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: x.record ? A(x.record.lapTimeMs) : "-" }),
652
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: x.record ? U(x.record.lapTimeMs) : "-" }),
653
653
  /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: x.driverCount || "-" }),
654
654
  /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: x.carCount || "-" }),
655
655
  /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: (h = x.record) != null && h.timestamp ? j(x.record.timestamp) : "-" })
@@ -661,19 +661,19 @@ function ln({ tracks: e, isLoading: n, carMetadata: s, getUserDisplay: r, onTrac
661
661
  ] }) })
662
662
  ] }) : /* @__PURE__ */ t(V, { message: "No lap times recorded yet." });
663
663
  }
664
- function cn({ entries: e, isLoading: n, track: s, carMetadata: r, getUserDisplay: a, onCarSelect: i, onNavigate: o, tags: d, onTagChange: p }) {
665
- const [c, u] = W({ key: "lapTimeMs", dir: "asc" }), { activeTags: g, toggle: f, clear: m } = ke(d, p), b = L(() => {
666
- var w, y, C;
664
+ function un({ entries: e, isLoading: n, track: s, carMetadata: r, getUserDisplay: a, onCarSelect: i, onNavigate: o, tags: d, onTagChange: p }) {
665
+ const [c, u] = W({ key: "lapTimeMs", dir: "asc" }), { activeTags: g, toggle: f, clear: m } = ke(d, p), y = S(() => {
666
+ var w, b, L;
667
667
  if (!e || !((w = r == null ? void 0 : r.tags) != null && w.length)) return [];
668
668
  const h = /* @__PURE__ */ new Set();
669
- for (const S of e)
670
- (((C = (y = r.cars) == null ? void 0 : y[S.carId]) == null ? void 0 : C.tags) || ["sports_car"]).forEach((E) => h.add(E));
671
- return r.tags.filter((S) => h.has(S));
672
- }, [e, r]), x = L(() => e ? g.size === 0 ? e : e.filter((h) => {
673
- var y, C;
674
- const w = ((C = (y = r == null ? void 0 : r.cars) == null ? void 0 : y[h.carId]) == null ? void 0 : C.tags) || ["sports_car"];
669
+ for (const M of e)
670
+ (((L = (b = r.cars) == null ? void 0 : b[M.carId]) == null ? void 0 : L.tags) || ["sports_car"]).forEach((A) => h.add(A));
671
+ return r.tags.filter((M) => h.has(M));
672
+ }, [e, r]), x = S(() => e ? g.size === 0 ? e : e.filter((h) => {
673
+ var b, L;
674
+ const w = ((L = (b = r == null ? void 0 : r.cars) == null ? void 0 : b[h.carId]) == null ? void 0 : L.tags) || ["sports_car"];
675
675
  return we(w, g);
676
- }) : [], [e, g, r]), v = L(() => z(x, c, (h, w) => {
676
+ }) : [], [e, g, r]), v = S(() => z(x, c, (h, w) => {
677
677
  switch (w) {
678
678
  case "carId":
679
679
  return I(h.carId);
@@ -689,14 +689,14 @@ function cn({ entries: e, isLoading: n, track: s, carMetadata: r, getUserDisplay
689
689
  ];
690
690
  return n ? /* @__PURE__ */ t(K, {}) : /* @__PURE__ */ l("div", { className: "pvx-card", children: [
691
691
  /* @__PURE__ */ t("div", { className: "pvx-card-header", children: /* @__PURE__ */ t(se, { segments: N }) }),
692
- /* @__PURE__ */ t(Le, { availableTags: b, activeTags: g, onToggle: f, onClear: m }),
692
+ /* @__PURE__ */ t(Le, { availableTags: y, activeTags: g, onToggle: f, onClear: m }),
693
693
  e != null && e.length ? /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
694
694
  /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
695
695
  /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
696
- /* @__PURE__ */ t(M, { label: "Car", sortKey: "carId", config: c, onSort: u }),
696
+ /* @__PURE__ */ t($, { label: "Car", sortKey: "carId", config: c, onSort: u }),
697
697
  /* @__PURE__ */ t("th", { className: "pvx-th", children: "Record Holder" }),
698
- /* @__PURE__ */ t(M, { label: "Lap Time", sortKey: "lapTimeMs", config: c, onSort: u }),
699
- /* @__PURE__ */ t(M, { label: "Drivers", sortKey: "driverCount", config: c, onSort: u, className: "pvx-hidden-below-md" }),
698
+ /* @__PURE__ */ t($, { label: "Lap Time", sortKey: "lapTimeMs", config: c, onSort: u }),
699
+ /* @__PURE__ */ t($, { label: "Drivers", sortKey: "driverCount", config: c, onSort: u, className: "pvx-hidden-below-md" }),
700
700
  /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-lg", children: "Date" })
701
701
  ] }) }),
702
702
  /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: v.map((h, w) => /* @__PURE__ */ l(
@@ -708,7 +708,7 @@ function cn({ entries: e, isLoading: n, track: s, carMetadata: r, getUserDisplay
708
708
  /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t(re, { rank: w + 1, podium: !0 }) }),
709
709
  /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary", children: I(h.carId) }),
710
710
  /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t(G, { userId: h.steamId || h.userId, getUserDisplay: a }) }),
711
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: A(h.lapTimeMs) }),
711
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: U(h.lapTimeMs) }),
712
712
  /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: h.driverCount || "-" }),
713
713
  /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-lg", children: h.recordedAt ? j(h.recordedAt) : "-" })
714
714
  ]
@@ -718,9 +718,9 @@ function cn({ entries: e, isLoading: n, track: s, carMetadata: r, getUserDisplay
718
718
  ] }) }) : /* @__PURE__ */ t(V, { message: "No lap times for this track yet." })
719
719
  ] });
720
720
  }
721
- function dn({ entries: e, isLoading: n, track: s, carId: r, getUserDisplay: a, onDriverSelect: i, onNavigate: o, highlightId: d }) {
722
- const [p, c] = W({ key: "lapTimeMs", dir: "asc" }), u = L(() => Ce(e), [e]), g = L(() => z(e || [], p, (m, b) => {
723
- switch (b) {
721
+ function mn({ entries: e, isLoading: n, track: s, carId: r, getUserDisplay: a, onDriverSelect: i, onNavigate: o, highlightId: d }) {
722
+ const [p, c] = W({ key: "lapTimeMs", dir: "asc" }), u = S(() => Ce(e), [e]), g = S(() => z(e || [], p, (m, y) => {
723
+ switch (y) {
724
724
  case "userId":
725
725
  return a(m.steamId || m.userId).displayName;
726
726
  case "lapCount":
@@ -739,18 +739,18 @@ function dn({ entries: e, isLoading: n, track: s, carId: r, getUserDisplay: a, o
739
739
  e != null && e.length ? /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
740
740
  /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
741
741
  /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--narrow", children: "#" }),
742
- /* @__PURE__ */ t(M, { label: "Driver", sortKey: "userId", config: p, onSort: c }),
743
- /* @__PURE__ */ t(M, { label: "Lap Time", sortKey: "lapTimeMs", config: p, onSort: c }),
742
+ /* @__PURE__ */ t($, { label: "Driver", sortKey: "userId", config: p, onSort: c }),
743
+ /* @__PURE__ */ t($, { label: "Lap Time", sortKey: "lapTimeMs", config: p, onSort: c }),
744
744
  /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S1" }),
745
745
  /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S2" }),
746
746
  /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "S3" }),
747
747
  /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-lg", children: "Tyre" }),
748
748
  /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-xl", children: "Fuel" }),
749
- /* @__PURE__ */ t(M, { label: "Laps", sortKey: "lapCount", config: p, onSort: c, className: "pvx-hidden-below-lg" }),
749
+ /* @__PURE__ */ t($, { label: "Laps", sortKey: "lapCount", config: p, onSort: c, className: "pvx-hidden-below-lg" }),
750
750
  /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
751
751
  ] }) }),
752
- /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: g.map((m, b) => {
753
- const x = b + 1, v = m.steamId || m.userId, N = u && m.sector1Ms === u.s1, h = u && m.sector2Ms === u.s2, w = u && m.sector3Ms === u.s3;
752
+ /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: g.map((m, y) => {
753
+ const x = y + 1, v = m.steamId || m.userId, N = u && m.sector1Ms === u.s1, h = u && m.sector2Ms === u.s2, w = u && m.sector3Ms === u.s3;
754
754
  return /* @__PURE__ */ l(
755
755
  "tr",
756
756
  {
@@ -759,7 +759,7 @@ function dn({ entries: e, isLoading: n, track: s, carId: r, getUserDisplay: a, o
759
759
  children: [
760
760
  /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t(re, { rank: x, podium: !0 }) }),
761
761
  /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ t(G, { userId: v, getUserDisplay: a }) }),
762
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: A(m.lapTimeMs) }),
762
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: U(m.lapTimeMs) }),
763
763
  /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${N ? "pvx-td--best-sector" : ""}`, children: B(m.sector1Ms) }),
764
764
  /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${h ? "pvx-td--best-sector" : ""}`, children: B(m.sector2Ms) }),
765
765
  /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${w ? "pvx-td--best-sector" : ""}`, children: B(m.sector3Ms) }),
@@ -775,8 +775,8 @@ function dn({ entries: e, isLoading: n, track: s, carId: r, getUserDisplay: a, o
775
775
  ] }) }) : /* @__PURE__ */ t(V, { message: "No lap times for this car yet." })
776
776
  ] });
777
777
  }
778
- function pn({ userId: e, track: n, carId: s, game: r, gameVersion: a, showInvalid: i, getUserDisplay: o, onToggleInvalid: d, onNavigate: p }) {
779
- const { data: c, driverName: u, theoreticalBest: g, isLoading: f } = He(e, n.id, n.layout, s, { showInvalid: i, game: r, gameVersion: a }), { displayName: m, avatarUrl: b } = o(e, u), x = L(() => Ce(c, !0), [c]), v = L(() => {
778
+ function hn({ userId: e, track: n, carId: s, game: r, gameVersion: a, showInvalid: i, getUserDisplay: o, onToggleInvalid: d, onNavigate: p }) {
779
+ const { data: c, driverName: u, theoreticalBest: g, isLoading: f } = ze(e, n.id, n.layout, s, { showInvalid: i, game: r, gameVersion: a }), { displayName: m, avatarUrl: y } = o(e, u), x = S(() => Ce(c, !0), [c]), v = S(() => {
780
780
  const h = (c == null ? void 0 : c.filter((w) => w.isValid)) || [];
781
781
  return h.length ? Math.min(...h.map((w) => w.lapTimeMs)) : null;
782
782
  }, [c]), N = [
@@ -789,7 +789,7 @@ function pn({ userId: e, track: n, carId: s, game: r, gameVersion: a, showInvali
789
789
  /* @__PURE__ */ l("div", { className: "pvx-card-header pvx-card-header--split", children: [
790
790
  /* @__PURE__ */ l("div", { className: "pvx-card-header-left", children: [
791
791
  /* @__PURE__ */ t(se, { segments: N }),
792
- b ? /* @__PURE__ */ t("img", { src: b, alt: "", className: "pvx-driver-avatar pvx-driver-avatar--lg" }) : /* @__PURE__ */ t("span", { className: "pvx-driver-avatar pvx-driver-avatar--lg pvx-driver-avatar--placeholder" })
792
+ y ? /* @__PURE__ */ t("img", { src: y, alt: "", className: "pvx-driver-avatar pvx-driver-avatar--lg" }) : /* @__PURE__ */ t("span", { className: "pvx-driver-avatar pvx-driver-avatar--lg pvx-driver-avatar--placeholder" })
793
793
  ] }),
794
794
  /* @__PURE__ */ l("label", { className: "pvx-checkbox-label", children: [
795
795
  /* @__PURE__ */ t(
@@ -806,7 +806,7 @@ function pn({ userId: e, track: n, carId: s, game: r, gameVersion: a, showInvali
806
806
  ] }),
807
807
  g && /* @__PURE__ */ l("div", { className: "pvx-theoretical-best", children: [
808
808
  /* @__PURE__ */ t("span", { className: "pvx-theoretical-best-label", children: "Theoretical Best:" }),
809
- /* @__PURE__ */ t("span", { className: "pvx-theoretical-best-time", children: A(g.lapTimeMs) }),
809
+ /* @__PURE__ */ t("span", { className: "pvx-theoretical-best-time", children: U(g.lapTimeMs) }),
810
810
  /* @__PURE__ */ l("span", { className: "pvx-theoretical-best-sectors", children: [
811
811
  "(",
812
812
  B(g.sector1Ms),
@@ -831,16 +831,16 @@ function pn({ userId: e, track: n, carId: s, game: r, gameVersion: a, showInvali
831
831
  /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
832
832
  ] }) }),
833
833
  /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: c.map((h, w) => {
834
- const y = h.isValid && h.lapTimeMs === v, C = x && h.isValid && h.sector1Ms === x.s1, S = x && h.isValid && h.sector2Ms === x.s2, $ = x && h.isValid && h.sector3Ms === x.s3;
835
- let E = "pvx-row";
836
- return h.isValid || (E += " pvx-row--invalid"), y && (E += " pvx-row--personal-best"), /* @__PURE__ */ l("tr", { className: E, children: [
837
- /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t("span", { className: `pvx-rank ${y ? "pvx-rank--gold" : ""}`, children: w + 1 }) }),
834
+ const b = h.isValid && h.lapTimeMs === v, L = x && h.isValid && h.sector1Ms === x.s1, M = x && h.isValid && h.sector2Ms === x.s2, k = x && h.isValid && h.sector3Ms === x.s3;
835
+ let A = "pvx-row";
836
+ return h.isValid || (A += " pvx-row--invalid"), b && (A += " pvx-row--personal-best"), /* @__PURE__ */ l("tr", { className: A, children: [
837
+ /* @__PURE__ */ t("td", { className: "pvx-td", children: /* @__PURE__ */ t("span", { className: `pvx-rank ${b ? "pvx-rank--gold" : ""}`, children: w + 1 }) }),
838
838
  /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-md", children: h.lapNumber || "-" }),
839
- /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: A(h.lapTimeMs) }),
840
- /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${C ? "pvx-td--best-sector" : ""}`, children: B(h.sector1Ms) }),
841
- /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${S ? "pvx-td--best-sector" : ""}`, children: B(h.sector2Ms) }),
842
- /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${$ ? "pvx-td--best-sector" : ""}`, children: B(h.sector3Ms) }),
843
- /* @__PURE__ */ t("td", { className: "pvx-td", title: h.isValid ? void 0 : h.invalidReason || "Invalid", children: h.isValid ? /* @__PURE__ */ t(Ze, {}) : /* @__PURE__ */ t(Xe, {}) }),
839
+ /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: U(h.lapTimeMs) }),
840
+ /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${L ? "pvx-td--best-sector" : ""}`, children: B(h.sector1Ms) }),
841
+ /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${M ? "pvx-td--best-sector" : ""}`, children: B(h.sector2Ms) }),
842
+ /* @__PURE__ */ t("td", { className: `pvx-td pvx-td--mono pvx-td--sector pvx-hidden-below-sm ${k ? "pvx-td--best-sector" : ""}`, children: B(h.sector3Ms) }),
843
+ /* @__PURE__ */ t("td", { className: "pvx-td", title: h.isValid ? void 0 : h.invalidReason || "Invalid", children: h.isValid ? /* @__PURE__ */ t(tt, {}) : /* @__PURE__ */ t(nt, {}) }),
844
844
  /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", title: me(h.tyreCompound), children: h.tyreCompound || "-" }),
845
845
  /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: he(h.startingFuelL) }),
846
846
  /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: j(h.timestamp) })
@@ -849,8 +849,8 @@ function pn({ userId: e, track: n, carId: s, game: r, gameVersion: a, showInvali
849
849
  ] }) }) : /* @__PURE__ */ t(V, { message: i ? "No laps recorded for this combination." : 'No valid laps. Try enabling "Show invalid laps".' })
850
850
  ] });
851
851
  }
852
- function un({ drivers: e, isLoading: n, getUserDisplay: s, game: r, gameVersion: a, onComboSelect: i }) {
853
- const [o, d] = W({ key: "rank", dir: "asc" }), [p, c] = D(null), u = L(() => e ? z(e, o, (f, m) => {
852
+ function vn({ drivers: e, isLoading: n, getUserDisplay: s, game: r, gameVersion: a, onComboSelect: i }) {
853
+ const [o, d] = W({ key: "rank", dir: "asc" }), [p, c] = D(null), u = S(() => e ? z(e, o, (f, m) => {
854
854
  switch (m) {
855
855
  case "rating":
856
856
  return f.rating;
@@ -885,16 +885,16 @@ function un({ drivers: e, isLoading: n, getUserDisplay: s, game: r, gameVersion:
885
885
  ] }),
886
886
  /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
887
887
  /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
888
- /* @__PURE__ */ t(M, { label: "#", sortKey: "rank", config: o, onSort: d, className: "pvx-th--narrow" }),
888
+ /* @__PURE__ */ t($, { label: "#", sortKey: "rank", config: o, onSort: d, className: "pvx-th--narrow" }),
889
889
  /* @__PURE__ */ t("th", { className: "pvx-th", children: "Driver" }),
890
- /* @__PURE__ */ t(M, { label: "Rating", sortKey: "rating", config: o, onSort: d }),
891
- /* @__PURE__ */ t(M, { label: "Cars", sortKey: "distinctCars", config: o, onSort: d, className: "pvx-hidden-below-sm" }),
892
- /* @__PURE__ */ t(M, { label: "Combos", sortKey: "comboCount", config: o, onSort: d, className: "pvx-hidden-below-sm" })
890
+ /* @__PURE__ */ t($, { label: "Rating", sortKey: "rating", config: o, onSort: d }),
891
+ /* @__PURE__ */ t($, { label: "Cars", sortKey: "distinctCars", config: o, onSort: d, className: "pvx-hidden-below-sm" }),
892
+ /* @__PURE__ */ t($, { label: "Combos", sortKey: "comboCount", config: o, onSort: d, className: "pvx-hidden-below-sm" })
893
893
  ] }) }),
894
894
  /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: u.map((f) => {
895
895
  const m = p === f.identifier;
896
896
  return /* @__PURE__ */ t(
897
- et,
897
+ rt,
898
898
  {
899
899
  driver: f,
900
900
  getUserDisplay: s,
@@ -911,9 +911,9 @@ function un({ drivers: e, isLoading: n, getUserDisplay: s, game: r, gameVersion:
911
911
  ] }) })
912
912
  ] });
913
913
  }
914
- function et({ driver: e, getUserDisplay: n, isExpanded: s, onToggle: r, colCount: a, game: i, gameVersion: o, onComboSelect: d }) {
914
+ function rt({ driver: e, getUserDisplay: n, isExpanded: s, onToggle: r, colCount: a, game: i, gameVersion: o, onComboSelect: d }) {
915
915
  const p = e.identifier;
916
- return /* @__PURE__ */ l(U, { children: [
916
+ return /* @__PURE__ */ l(F, { children: [
917
917
  /* @__PURE__ */ l(
918
918
  "tr",
919
919
  {
@@ -945,7 +945,7 @@ function et({ driver: e, getUserDisplay: n, isExpanded: s, onToggle: r, colCount
945
945
  /* @__PURE__ */ t("p", { className: "pvx-rankings-combo-car", children: I(c.carId) })
946
946
  ] }),
947
947
  /* @__PURE__ */ l("div", { className: "pvx-rankings-combo-stats", children: [
948
- /* @__PURE__ */ t("p", { className: "pvx-rankings-combo-time", children: A(c.lapTimeMs) }),
948
+ /* @__PURE__ */ t("p", { className: "pvx-rankings-combo-time", children: U(c.lapTimeMs) }),
949
949
  /* @__PURE__ */ l("p", { className: `pvx-rankings-combo-pct ${c.percentile >= 75 ? "pvx-rankings-combo-pct--high" : c.percentile >= 50 ? "pvx-rankings-combo-pct--mid" : c.percentile >= 25 ? "pvx-rankings-combo-pct--low" : "pvx-rankings-combo-pct--bottom"}`, children: [
950
950
  c.percentile.toFixed(0),
951
951
  "%",
@@ -965,7 +965,7 @@ function et({ driver: e, getUserDisplay: n, isExpanded: s, onToggle: r, colCount
965
965
  }) }) }) })
966
966
  ] });
967
967
  }
968
- const tt = {
968
+ const st = {
969
969
  GBR: "🇬🇧",
970
970
  DEU: "🇩🇪",
971
971
  NLD: "🇳🇱",
@@ -996,14 +996,14 @@ const tt = {
996
996
  RUS: "🇷🇺",
997
997
  TUR: "🇹🇷",
998
998
  KOR: "🇰🇷"
999
- }, ae = ["🥇", "🥈", "🥉"], nt = {
999
+ }, ae = ["🥇", "🥈", "🥉"], at = {
1000
1000
  championship: "Championship",
1001
1001
  series: "Series",
1002
1002
  event: "Event",
1003
1003
  hotlap: "Hotlap"
1004
- }, rt = ["PRACTICE", "QUALIFYING", "RACE"];
1004
+ }, it = ["PRACTICE", "QUALIFYING", "RACE"];
1005
1005
  function de(e) {
1006
- const n = rt.indexOf(e);
1006
+ const n = it.indexOf(e);
1007
1007
  if (n >= 0) return n;
1008
1008
  const s = e.match(/^PRACTICE_(\d+)$/);
1009
1009
  return s ? 100 + parseInt(s[1]) : 999;
@@ -1016,10 +1016,10 @@ function oe({ position: e }) {
1016
1016
  return /* @__PURE__ */ t("span", { className: e === 1 ? "pvx-rank pvx-rank--gold" : e === 2 ? "pvx-rank pvx-rank--silver" : e === 3 ? "pvx-rank pvx-rank--bronze" : "pvx-rank", children: e });
1017
1017
  }
1018
1018
  function Q({ nation: e }) {
1019
- const n = e && tt[e];
1019
+ const n = e && st[e];
1020
1020
  return n ? /* @__PURE__ */ t("span", { className: "pvx-nation-flag", title: e, children: n }) : null;
1021
1021
  }
1022
- function st({ sessions: e, activeSession: n, onSelect: s }) {
1022
+ function ot({ sessions: e, activeSession: n, onSelect: s }) {
1023
1023
  if (!e || e.length <= 1) return null;
1024
1024
  const r = [...e].sort(
1025
1025
  (a, i) => de(a.type) - de(i.type)
@@ -1034,20 +1034,20 @@ function st({ sessions: e, activeSession: n, onSelect: s }) {
1034
1034
  a.type
1035
1035
  )) });
1036
1036
  }
1037
- function at({ type: e }) {
1038
- return /* @__PURE__ */ t("span", { className: `pvx-comp-badge pvx-comp-badge--${e}`, children: nt[e] || e });
1037
+ function lt({ type: e }) {
1038
+ return /* @__PURE__ */ t("span", { className: `pvx-comp-badge pvx-comp-badge--${e}`, children: at[e] || e });
1039
1039
  }
1040
1040
  function J({ children: e, variant: n = "default" }) {
1041
1041
  return /* @__PURE__ */ t("span", { className: `pvx-info-pill ${n !== "default" ? `pvx-info-pill--${n}` : ""}`, children: e });
1042
1042
  }
1043
- function it(e) {
1043
+ function ct(e) {
1044
1044
  if (!e) return "TBD";
1045
1045
  const n = new Date(e);
1046
1046
  if (isNaN(n)) return "TBD";
1047
1047
  const s = n.toLocaleDateString("en-GB", { weekday: "short", day: "numeric", month: "short" }), r = n.toLocaleTimeString("en-GB", { hour: "2-digit", minute: "2-digit" });
1048
1048
  return `${s} • ${r}`;
1049
1049
  }
1050
- function ot(e) {
1050
+ function dt(e) {
1051
1051
  return e.reduce((n, s) => {
1052
1052
  var r;
1053
1053
  return (r = s.splits) != null && r.length ? n ? n.map((a, i) => {
@@ -1056,18 +1056,18 @@ function ot(e) {
1056
1056
  }) : [...s.splits] : n;
1057
1057
  }, null);
1058
1058
  }
1059
- function F({ message: e = "Loading..." }) {
1059
+ function E({ message: e = "Loading..." }) {
1060
1060
  return /* @__PURE__ */ t("div", { className: "pvx-loading", children: e });
1061
1061
  }
1062
1062
  function P({ message: e = "No data available." }) {
1063
1063
  return /* @__PURE__ */ t("div", { className: "pvx-empty", children: /* @__PURE__ */ t("p", { children: e }) });
1064
1064
  }
1065
1065
  const Se = 3;
1066
- function lt(e) {
1066
+ function pt(e) {
1067
1067
  const n = e == null ? void 0 : e.rounds;
1068
1068
  return n != null && n.length ? e.type === "hotlap" ? n.every((s) => s.isFinalized && s.dediStatus === "completed") : n.every((s) => s.isFinalized) : !1;
1069
1069
  }
1070
- function ct(e) {
1070
+ function ut(e) {
1071
1071
  const n = e == null ? void 0 : e.rounds;
1072
1072
  if (!(n != null && n.length)) return null;
1073
1073
  let s = null;
@@ -1079,23 +1079,23 @@ function ct(e) {
1079
1079
  return s;
1080
1080
  }
1081
1081
  function Te(e, n = Se) {
1082
- if (!lt(e)) return "active";
1083
- const s = ct(e);
1082
+ if (!pt(e)) return "active";
1083
+ const s = ut(e);
1084
1084
  if (!s) return "recently-completed";
1085
1085
  const r = n * 24 * 60 * 60 * 1e3;
1086
1086
  return Date.now() - s.getTime() <= r ? "recently-completed" : "archived";
1087
1087
  }
1088
- function mn(e, n, s = Se) {
1088
+ function xn(e, n, s = Se) {
1089
1089
  if (!(e != null && e.length)) return [];
1090
1090
  const r = new Set(Array.isArray(n) ? n : [n]);
1091
1091
  return e.filter((a) => r.has(Te(a, s)));
1092
1092
  }
1093
- function dt(e, n = 3) {
1093
+ function mt(e, n = 3) {
1094
1094
  const s = e == null ? void 0 : e.standings;
1095
1095
  return Array.isArray(s) ? [...s].sort((r, a) => (r.position ?? 999) - (a.position ?? 999)).slice(0, n) : [];
1096
1096
  }
1097
- function pt({ competitionId: e, topN: n = 3, label: s = "Completed", className: r }) {
1098
- const { data: a } = ge(e), i = dt(a, n);
1097
+ function ht({ competitionId: e, topN: n = 3, label: s = "Completed", className: r }) {
1098
+ const { data: a } = ge(e), i = mt(a, n);
1099
1099
  return /* @__PURE__ */ l("div", { className: `pvx-comp-completed-badge ${r || ""}`, children: [
1100
1100
  /* @__PURE__ */ t("span", { className: "pvx-comp-completed-badge-label", children: s }),
1101
1101
  i.length > 0 && /* @__PURE__ */ t("ol", { className: "pvx-comp-completed-badge-podium", children: i.map((o, d) => /* @__PURE__ */ l("li", { className: "pvx-comp-completed-badge-driver", children: [
@@ -1105,12 +1105,12 @@ function pt({ competitionId: e, topN: n = 3, label: s = "Completed", className:
1105
1105
  ] }, o.driverId || d)) })
1106
1106
  ] });
1107
1107
  }
1108
- function hn({ competitions: e, isLoading: n, onSelect: s, onRegister: r, className: a }) {
1109
- return n ? /* @__PURE__ */ t(F, { message: "Loading competitions..." }) : e != null && e.length ? /* @__PURE__ */ t("div", { className: `pvx-comp-grid ${a || ""}`, children: e.map((i) => /* @__PURE__ */ t(ut, { comp: i, onSelect: s, onRegister: r || s }, i.id)) }) : /* @__PURE__ */ t(P, { message: "No competitions available." });
1108
+ function gn({ competitions: e, isLoading: n, onSelect: s, onRegister: r, className: a }) {
1109
+ return n ? /* @__PURE__ */ t(E, { message: "Loading competitions..." }) : e != null && e.length ? /* @__PURE__ */ t("div", { className: `pvx-comp-grid ${a || ""}`, children: e.map((i) => /* @__PURE__ */ t(vt, { comp: i, onSelect: s, onRegister: r || s }, i.id)) }) : /* @__PURE__ */ t(P, { message: "No competitions available." });
1110
1110
  }
1111
- function ut({ comp: e, onSelect: n, onRegister: s }) {
1112
- var h, w, y;
1113
- const { cdnUrl: r } = k(), a = e.posterCdnPath ? `${r}/${e.posterCdnPath}` : null, i = e.registration, o = (i == null ? void 0 : i.currentCount) || 0, d = i == null ? void 0 : i.maxParticipants, p = d && o >= d, c = (i == null ? void 0 : i.deadline) && new Date(i.deadline) < /* @__PURE__ */ new Date(), u = (i == null ? void 0 : i.isOpen) && !c && !p, g = /* @__PURE__ */ new Date(), f = (h = e.rounds) == null ? void 0 : h.find((C) => C.startTime && new Date(C.startTime) >= g), m = ((w = e.rounds) == null ? void 0 : w.length) || 0, b = ((y = e.rounds) == null ? void 0 : y.filter((C) => C.isFinalized).length) || 0, x = Te(e), v = x === "recently-completed" || x === "archived", N = e.type === "championship";
1111
+ function vt({ comp: e, onSelect: n, onRegister: s }) {
1112
+ var h, w, b;
1113
+ const { cdnUrl: r } = C(), a = e.posterCdnPath ? `${r}/${e.posterCdnPath}` : null, i = e.registration, o = (i == null ? void 0 : i.currentCount) || 0, d = i == null ? void 0 : i.maxParticipants, p = d && o >= d, c = (i == null ? void 0 : i.deadline) && new Date(i.deadline) < /* @__PURE__ */ new Date(), u = (i == null ? void 0 : i.isOpen) && !c && !p, g = /* @__PURE__ */ new Date(), f = (h = e.rounds) == null ? void 0 : h.find((L) => L.startTime && new Date(L.startTime) >= g), m = ((w = e.rounds) == null ? void 0 : w.length) || 0, y = ((b = e.rounds) == null ? void 0 : b.filter((L) => L.isFinalized).length) || 0, x = Te(e), v = x === "recently-completed" || x === "archived", N = e.type === "championship";
1114
1114
  return /* @__PURE__ */ l(
1115
1115
  "div",
1116
1116
  {
@@ -1118,20 +1118,20 @@ function ut({ comp: e, onSelect: n, onRegister: s }) {
1118
1118
  onClick: () => n(e.id),
1119
1119
  role: "button",
1120
1120
  tabIndex: 0,
1121
- onKeyDown: (C) => {
1122
- (C.key === "Enter" || C.key === " ") && (C.preventDefault(), n(e.id));
1121
+ onKeyDown: (L) => {
1122
+ (L.key === "Enter" || L.key === " ") && (L.preventDefault(), n(e.id));
1123
1123
  },
1124
1124
  children: [
1125
- /* @__PURE__ */ t("div", { className: "pvx-comp-card-poster", children: a ? /* @__PURE__ */ t("img", { src: a, alt: e.name, className: "pvx-comp-card-poster-img" }) : /* @__PURE__ */ t("div", { className: "pvx-comp-card-poster-placeholder", children: /* @__PURE__ */ t(ht, {}) }) }),
1125
+ /* @__PURE__ */ t("div", { className: "pvx-comp-card-poster", children: a ? /* @__PURE__ */ t("img", { src: a, alt: e.name, className: "pvx-comp-card-poster-img" }) : /* @__PURE__ */ t("div", { className: "pvx-comp-card-poster-placeholder", children: /* @__PURE__ */ t(gt, {}) }) }),
1126
1126
  /* @__PURE__ */ l("div", { className: "pvx-comp-card-body", children: [
1127
1127
  /* @__PURE__ */ t("h3", { className: "pvx-comp-card-title", children: e.name }),
1128
1128
  e.description && /* @__PURE__ */ t("p", { className: "pvx-comp-card-desc", children: e.description }),
1129
1129
  /* @__PURE__ */ l("div", { className: "pvx-comp-card-pills", children: [
1130
- /* @__PURE__ */ t(at, { type: e.type }),
1130
+ /* @__PURE__ */ t(lt, { type: e.type }),
1131
1131
  e.game && /* @__PURE__ */ t(J, { children: e.game.toUpperCase() }),
1132
- e.formatDescription && e.formatDescription.split(", ").map((C, S) => /* @__PURE__ */ t(J, { variant: "format", children: C }, S))
1132
+ e.formatDescription && e.formatDescription.split(", ").map((L, M) => /* @__PURE__ */ t(J, { variant: "format", children: L }, M))
1133
1133
  ] }),
1134
- e.carsDescription && /* @__PURE__ */ t("div", { className: "pvx-comp-card-pills", children: e.carsDescription.split(", ").map((C, S) => /* @__PURE__ */ t(J, { children: C }, S)) }),
1134
+ e.carsDescription && /* @__PURE__ */ t("div", { className: "pvx-comp-card-pills", children: e.carsDescription.split(", ").map((L, M) => /* @__PURE__ */ t(J, { children: L }, M)) }),
1135
1135
  /* @__PURE__ */ l("div", { className: "pvx-comp-card-schedule", children: [
1136
1136
  f ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
1137
1137
  /* @__PURE__ */ t("span", { className: "pvx-comp-card-schedule-label", children: "Next:" }),
@@ -1139,9 +1139,9 @@ function ut({ comp: e, onSelect: n, onRegister: s }) {
1139
1139
  e.type !== "hotlap" && `R${f.roundNumber} `,
1140
1140
  f.track || "TBD",
1141
1141
  " · ",
1142
- it(f.startTime)
1142
+ ct(f.startTime)
1143
1143
  ] }) : m > 0 ? /* @__PURE__ */ l("span", { className: "pvx-comp-card-schedule-next", children: [
1144
- b,
1144
+ y,
1145
1145
  "/",
1146
1146
  m,
1147
1147
  " rounds completed"
@@ -1152,9 +1152,9 @@ function ut({ comp: e, onSelect: n, onRegister: s }) {
1152
1152
  m !== 1 ? "s" : ""
1153
1153
  ] })
1154
1154
  ] }),
1155
- v && N && /* @__PURE__ */ t(pt, { competitionId: e.id }),
1155
+ v && N && /* @__PURE__ */ t(ht, { competitionId: e.id }),
1156
1156
  i && !v && /* @__PURE__ */ t(
1157
- mt,
1157
+ xt,
1158
1158
  {
1159
1159
  competitionId: e.id,
1160
1160
  regOpen: u,
@@ -1170,7 +1170,7 @@ function ut({ comp: e, onSelect: n, onRegister: s }) {
1170
1170
  }
1171
1171
  );
1172
1172
  }
1173
- function mt({ competitionId: e, regOpen: n, isFull: s, deadlinePassed: r, regCount: a, regMax: i, onRegister: o }) {
1173
+ function xt({ competitionId: e, regOpen: n, isFull: s, deadlinePassed: r, regCount: a, regMax: i, onRegister: o }) {
1174
1174
  const { isPowerMode: d } = te(), p = ne(e), { data: c } = ee(e), u = (c == null ? void 0 : c.isRegistered) || !1, g = i ? a / i * 100 : 0, f = g >= 100 ? "full" : g >= 75 ? "warning" : "ok";
1175
1175
  return /* @__PURE__ */ l("div", { className: "pvx-comp-card-reg", children: [
1176
1176
  /* @__PURE__ */ t("div", { className: "pvx-comp-card-reg-info", children: /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${f}`, children: [
@@ -1210,7 +1210,7 @@ function mt({ competitionId: e, regOpen: n, isFull: s, deadlinePassed: r, regCou
1210
1210
  ) : /* @__PURE__ */ t("span", { className: "pvx-comp-card-reg-btn pvx-comp-card-reg-btn--closed", children: s ? "Full" : "Closed" }) })
1211
1211
  ] });
1212
1212
  }
1213
- function ht() {
1213
+ function gt() {
1214
1214
  return /* @__PURE__ */ l("svg", { className: "pvx-comp-trophy-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: [
1215
1215
  /* @__PURE__ */ t("path", { d: "M6 9H4.5a2.5 2.5 0 0 1 0-5H6" }),
1216
1216
  /* @__PURE__ */ t("path", { d: "M18 9h1.5a2.5 2.5 0 0 0 0-5H18" }),
@@ -1220,11 +1220,11 @@ function ht() {
1220
1220
  /* @__PURE__ */ t("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
1221
1221
  ] });
1222
1222
  }
1223
- function vt({ competitionId: e, className: n }) {
1223
+ function ft({ competitionId: e, className: n }) {
1224
1224
  var d, p;
1225
1225
  const { data: s, isLoading: r } = ge(e), { data: a, isLoading: i } = xe(e);
1226
1226
  if (r || i)
1227
- return /* @__PURE__ */ t(F, { message: "Loading standings..." });
1227
+ return /* @__PURE__ */ t(E, { message: "Loading standings..." });
1228
1228
  if (!((d = s == null ? void 0 : s.standings) != null && d.length))
1229
1229
  return /* @__PURE__ */ t(P, { message: "No standings data yet. Results will appear once rounds are finalised." });
1230
1230
  const o = ((p = a == null ? void 0 : a.rounds) == null ? void 0 : p.filter((c) => c.isFinalized)) || [];
@@ -1260,7 +1260,7 @@ function vt({ competitionId: e, className: n }) {
1260
1260
  ))
1261
1261
  ] }) }),
1262
1262
  /* @__PURE__ */ t("tbody", { className: "pvx-tbody", children: s.standings.map((c) => /* @__PURE__ */ t(
1263
- xt,
1263
+ Nt,
1264
1264
  {
1265
1265
  driver: c,
1266
1266
  finalizedRounds: o
@@ -1270,7 +1270,7 @@ function vt({ competitionId: e, className: n }) {
1270
1270
  ] }) })
1271
1271
  ] });
1272
1272
  }
1273
- function xt({ driver: e, finalizedRounds: n }) {
1273
+ function Nt({ driver: e, finalizedRounds: n }) {
1274
1274
  var o, d, p;
1275
1275
  const s = e.position <= 3, r = new Map(
1276
1276
  ((o = e.roundResults) == null ? void 0 : o.map((c) => [c.roundNumber, c])) || []
@@ -1303,11 +1303,11 @@ function xt({ driver: e, finalizedRounds: n }) {
1303
1303
  })
1304
1304
  ] });
1305
1305
  }
1306
- function vn({ competitionId: e, roundNumber: n, className: s }) {
1306
+ function fn({ competitionId: e, roundNumber: n, className: s }) {
1307
1307
  var p;
1308
- const { data: r, isLoading: a } = Oe(e, n);
1308
+ const { data: r, isLoading: a } = Ge(e, n);
1309
1309
  if (a)
1310
- return /* @__PURE__ */ t(F, { message: "Loading results..." });
1310
+ return /* @__PURE__ */ t(E, { message: "Loading results..." });
1311
1311
  if (!r)
1312
1312
  return /* @__PURE__ */ t(P, { message: "No results for this round." });
1313
1313
  const o = (r.sessions || []).find((c) => c.type === "RACE"), d = (p = o == null ? void 0 : o.results) == null ? void 0 : p.filter((c) => c.position <= 3).sort((c, u) => c.position - u.position);
@@ -1338,36 +1338,36 @@ function le({ round: e, competitionId: n, className: s }) {
1338
1338
  const [r, a] = D(null), i = (e == null ? void 0 : e.sessions) || [];
1339
1339
  if (!i.length)
1340
1340
  return /* @__PURE__ */ t(P, { message: "No session data for this round." });
1341
- const { data: o } = Ge(
1341
+ const { data: o } = Je(
1342
1342
  n,
1343
1343
  e == null ? void 0 : e.roundNumber,
1344
1344
  {}
1345
- ), d = r || ((u = i.find((b) => b.type === "RACE")) == null ? void 0 : u.type) || ((g = i[0]) == null ? void 0 : g.type), p = i.find((b) => b.type === d) || i[0], c = ((m = (f = o == null ? void 0 : o.sessions) == null ? void 0 : f.find((b) => b.type === d)) == null ? void 0 : m.drivers) || null;
1345
+ ), d = r || ((u = i.find((y) => y.type === "RACE")) == null ? void 0 : u.type) || ((g = i[0]) == null ? void 0 : g.type), p = i.find((y) => y.type === d) || i[0], c = ((m = (f = o == null ? void 0 : o.sessions) == null ? void 0 : f.find((y) => y.type === d)) == null ? void 0 : m.drivers) || null;
1346
1346
  return /* @__PURE__ */ l("div", { className: s || "", children: [
1347
1347
  /* @__PURE__ */ t(
1348
- st,
1348
+ ot,
1349
1349
  {
1350
1350
  sessions: i,
1351
1351
  activeSession: d,
1352
1352
  onSelect: a
1353
1353
  }
1354
1354
  ),
1355
- /* @__PURE__ */ t(gt, { session: p, sessionLaps: c })
1355
+ /* @__PURE__ */ t(bt, { session: p, sessionLaps: c })
1356
1356
  ] });
1357
1357
  }
1358
- function gt({ session: e, sessionLaps: n }) {
1358
+ function bt({ session: e, sessionLaps: n }) {
1359
1359
  var d;
1360
1360
  const s = e.type === "RACE", [r, a] = D(null);
1361
1361
  if (!((d = e.results) != null && d.length))
1362
1362
  return /* @__PURE__ */ t(P, { message: `No results for ${e.type}.` });
1363
- const i = ot(e.results), o = s ? 7 : 4;
1363
+ const i = dt(e.results), o = s ? 7 : 4;
1364
1364
  return /* @__PURE__ */ t("div", { className: "pvx-table-scroll", children: /* @__PURE__ */ l("table", { className: "pvx-table", children: [
1365
1365
  /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
1366
1366
  /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--narrow", children: "Pos" }),
1367
1367
  /* @__PURE__ */ t("th", { className: "pvx-th", children: "Driver" }),
1368
1368
  /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "Car" }),
1369
1369
  /* @__PURE__ */ t("th", { className: "pvx-th", children: "Best Lap" }),
1370
- s && /* @__PURE__ */ l(U, { children: [
1370
+ s && /* @__PURE__ */ l(F, { children: [
1371
1371
  /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "Laps" }),
1372
1372
  /* @__PURE__ */ t("th", { className: "pvx-th pvx-hidden-below-sm", children: "Time / Gap" }),
1373
1373
  /* @__PURE__ */ t("th", { className: "pvx-th pvx-th--center", children: "Points" })
@@ -1377,7 +1377,7 @@ function gt({ session: e, sessionLaps: n }) {
1377
1377
  var f;
1378
1378
  const u = (f = n == null ? void 0 : n[p.driverId]) == null ? void 0 : f.laps, g = r === p.driverId && !!u;
1379
1379
  return /* @__PURE__ */ t(
1380
- ft,
1380
+ yt,
1381
1381
  {
1382
1382
  result: p,
1383
1383
  isRace: s,
@@ -1394,9 +1394,9 @@ function gt({ session: e, sessionLaps: n }) {
1394
1394
  }) })
1395
1395
  ] }) });
1396
1396
  }
1397
- function ft({ result: e, isRace: n, fastestSplits: s, rowIndex: r, hasLapDetail: a, isExpanded: i, onToggle: o, driverLaps: d, colCount: p }) {
1397
+ function yt({ result: e, isRace: n, fastestSplits: s, rowIndex: r, hasLapDetail: a, isExpanded: i, onToggle: o, driverLaps: d, colCount: p }) {
1398
1398
  const c = e.position <= 3;
1399
- return /* @__PURE__ */ l(U, { children: [
1399
+ return /* @__PURE__ */ l(F, { children: [
1400
1400
  /* @__PURE__ */ l(
1401
1401
  "tr",
1402
1402
  {
@@ -1416,7 +1416,7 @@ function ft({ result: e, isRace: n, fastestSplits: s, rowIndex: r, hasLapDetail:
1416
1416
  ] }),
1417
1417
  /* @__PURE__ */ t("td", { className: "pvx-td pvx-hidden-below-sm", children: I(e.carId) }),
1418
1418
  /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--mono", children: /* @__PURE__ */ t(
1419
- bt,
1419
+ kt,
1420
1420
  {
1421
1421
  bestLap: e.bestLapFormatted,
1422
1422
  hasBestLap: e.hasBestLap,
@@ -1425,7 +1425,7 @@ function ft({ result: e, isRace: n, fastestSplits: s, rowIndex: r, hasLapDetail:
1425
1425
  showAbove: r <= 1
1426
1426
  }
1427
1427
  ) }),
1428
- n && /* @__PURE__ */ l(U, { children: [
1428
+ n && /* @__PURE__ */ l(F, { children: [
1429
1429
  /* @__PURE__ */ t("td", { className: "pvx-td pvx-hidden-below-sm", children: e.lapsCompleted }),
1430
1430
  /* @__PURE__ */ t("td", { className: "pvx-td pvx-td--mono pvx-td--muted pvx-hidden-below-sm", children: e.position === 1 ? e.totalTime || "-" : e.gap || "-" }),
1431
1431
  /* @__PURE__ */ l("td", { className: "pvx-td pvx-td--center", children: [
@@ -1441,10 +1441,10 @@ function ft({ result: e, isRace: n, fastestSplits: s, rowIndex: r, hasLapDetail:
1441
1441
  ]
1442
1442
  }
1443
1443
  ),
1444
- i && d && /* @__PURE__ */ t("tr", { className: "pvx-row pvx-row--lap-detail", children: /* @__PURE__ */ t("td", { colSpan: p, className: "pvx-td pvx-td--lap-detail", children: /* @__PURE__ */ t(Nt, { laps: d }) }) })
1444
+ i && d && /* @__PURE__ */ t("tr", { className: "pvx-row pvx-row--lap-detail", children: /* @__PURE__ */ t("td", { colSpan: p, className: "pvx-td pvx-td--lap-detail", children: /* @__PURE__ */ t(wt, { laps: d }) }) })
1445
1445
  ] });
1446
1446
  }
1447
- function Nt({ laps: e }) {
1447
+ function wt({ laps: e }) {
1448
1448
  const n = Math.min(...e.filter((s) => s.valid && s.timeMs > 0).map((s) => s.timeMs));
1449
1449
  return /* @__PURE__ */ l("table", { className: "pvx-table pvx-table--laps", children: [
1450
1450
  /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ l("tr", { className: "pvx-thead-row", children: [
@@ -1466,7 +1466,7 @@ function Nt({ laps: e }) {
1466
1466
  }) })
1467
1467
  ] });
1468
1468
  }
1469
- function bt({ bestLap: e, hasBestLap: n, splits: s, fastestSplits: r, showAbove: a }) {
1469
+ function kt({ bestLap: e, hasBestLap: n, splits: s, fastestSplits: r, showAbove: a }) {
1470
1470
  return e ? /* @__PURE__ */ l("span", { className: `pvx-best-lap-cell ${n ? "pvx-best-lap-cell--fastest" : ""}`, children: [
1471
1471
  /* @__PURE__ */ t("span", { className: "pvx-best-lap-time", children: e }),
1472
1472
  (s == null ? void 0 : s.length) > 0 && /* @__PURE__ */ t("span", { className: "pvx-splits-tooltip-anchor", children: /* @__PURE__ */ t("span", { className: `pvx-splits-tooltip ${a ? "" : "pvx-splits-tooltip--above"}`, children: s.map((i, o) => {
@@ -1481,10 +1481,10 @@ function bt({ bestLap: e, hasBestLap: n, splits: s, fastestSplits: r, showAbove:
1481
1481
  }) }) })
1482
1482
  ] }) : /* @__PURE__ */ t("span", { className: "pvx-td--muted", children: "-" });
1483
1483
  }
1484
- function xn({ competitionId: e, className: n }) {
1485
- const { getSteamId: s } = k(), { data: r, isLoading: a } = fe(e), i = s();
1484
+ function Nn({ competitionId: e, className: n }) {
1485
+ const { getSteamId: s } = C(), { data: r, isLoading: a } = fe(e), i = s();
1486
1486
  if (a)
1487
- return /* @__PURE__ */ t(F, { message: "Loading drivers..." });
1487
+ return /* @__PURE__ */ t(E, { message: "Loading drivers..." });
1488
1488
  const o = (r == null ? void 0 : r.drivers) || (r == null ? void 0 : r.entries) || [];
1489
1489
  return o.length ? /* @__PURE__ */ t("div", { className: `pvx-entry-grid ${n || ""}`, children: o.map((d) => {
1490
1490
  var c, u;
@@ -1505,7 +1505,7 @@ function xn({ competitionId: e, className: n }) {
1505
1505
  ] }, d.steamId || d.driverId);
1506
1506
  }) }) : /* @__PURE__ */ t(P, { message: "No drivers registered yet." });
1507
1507
  }
1508
- function gn({
1508
+ function bn({
1509
1509
  competitionId: e,
1510
1510
  driverData: n,
1511
1511
  className: s,
@@ -1513,14 +1513,14 @@ function gn({
1513
1513
  }) {
1514
1514
  const { data: a, isLoading: i } = ee(e), { isPowerMode: o } = te(), d = ne(e), p = Ne(e), c = be(e), u = (a == null ? void 0 : a.isRegistered) || !1, g = i || p.isPending || c.isPending, f = p.error || c.error || null, m = () => {
1515
1515
  o && p.mutate(n || {});
1516
- }, b = () => {
1516
+ }, y = () => {
1517
1517
  o && c.mutate();
1518
1518
  };
1519
- return typeof r == "function" ? r({ isRegistered: u, isLoading: g, register: m, withdraw: b, error: f, isPowerMode: o, registrationUrl: d }) : o ? /* @__PURE__ */ t(
1519
+ return typeof r == "function" ? r({ isRegistered: u, isLoading: g, register: m, withdraw: y, error: f, isPowerMode: o, registrationUrl: d }) : o ? /* @__PURE__ */ t(
1520
1520
  "button",
1521
1521
  {
1522
1522
  className: `pvx-comp-register-btn ${s || ""}`,
1523
- onClick: u ? b : m,
1523
+ onClick: u ? y : m,
1524
1524
  disabled: g,
1525
1525
  children: g ? "Loading..." : u ? "Withdraw" : "Register"
1526
1526
  }
@@ -1535,10 +1535,10 @@ function gn({
1535
1535
  }
1536
1536
  );
1537
1537
  }
1538
- function fn({ competitionId: e, registration: n, onWithdrawSuccess: s, className: r }) {
1539
- const { getSteamId: a } = k(), { isPowerMode: i } = te(), o = ne(e), { data: d, isLoading: p } = ee(e), { data: c, isLoading: u } = fe(e), g = Ne(e), f = be(e), m = a(), b = (d == null ? void 0 : d.isRegistered) || !1, x = (c == null ? void 0 : c.drivers) || (c == null ? void 0 : c.entries) || [], v = n || {}, N = x.length || v.currentCount || 0, h = v.maxParticipants && N >= v.maxParticipants, w = v.deadline && new Date(v.deadline) < /* @__PURE__ */ new Date(), y = v.isOpen && !w && !h;
1540
- return p || u ? /* @__PURE__ */ t(F, { message: "Loading registration..." }) : b ? /* @__PURE__ */ t("div", { className: `pvx-reg-panel ${r || ""}`, children: /* @__PURE__ */ t(
1541
- wt,
1538
+ function yn({ competitionId: e, registration: n, onWithdrawSuccess: s, className: r }) {
1539
+ const { getSteamId: a } = C(), { isPowerMode: i } = te(), o = ne(e), { data: d, isLoading: p } = ee(e), { data: c, isLoading: u } = fe(e), g = Ne(e), f = be(e), m = a(), y = (d == null ? void 0 : d.isRegistered) || !1, x = (c == null ? void 0 : c.drivers) || (c == null ? void 0 : c.entries) || [], v = n || {}, N = x.length || v.currentCount || 0, h = v.maxParticipants && N >= v.maxParticipants, w = v.deadline && new Date(v.deadline) < /* @__PURE__ */ new Date(), b = v.isOpen && !w && !h;
1540
+ return p || u ? /* @__PURE__ */ t(E, { message: "Loading registration..." }) : y ? /* @__PURE__ */ t("div", { className: `pvx-reg-panel ${r || ""}`, children: /* @__PURE__ */ t(
1541
+ Lt,
1542
1542
  {
1543
1543
  competitionId: e,
1544
1544
  drivers: x,
@@ -1549,8 +1549,8 @@ function fn({ competitionId: e, registration: n, onWithdrawSuccess: s, className
1549
1549
  onWithdrawSuccess: s,
1550
1550
  registration: v
1551
1551
  }
1552
- ) }) : y ? m ? i ? /* @__PURE__ */ t("div", { className: `pvx-reg-panel ${r || ""}`, children: /* @__PURE__ */ t(
1553
- yt,
1552
+ ) }) : b ? m ? i ? /* @__PURE__ */ t("div", { className: `pvx-reg-panel ${r || ""}`, children: /* @__PURE__ */ t(
1553
+ Ct,
1554
1554
  {
1555
1555
  competitionId: e,
1556
1556
  registerMutation: g,
@@ -1561,7 +1561,7 @@ function fn({ competitionId: e, registration: n, onWithdrawSuccess: s, className
1561
1561
  x.length > 0 && /* @__PURE__ */ t(Re, { drivers: x, steamId: m })
1562
1562
  ] });
1563
1563
  }
1564
- function yt({ competitionId: e, registerMutation: n, registration: s }) {
1564
+ function Ct({ competitionId: e, registerMutation: n, registration: s }) {
1565
1565
  const [r, a] = D(""), [i, o] = D("intermediate"), [d, p] = D(""), c = (m) => {
1566
1566
  m.preventDefault(), n.mutate({
1567
1567
  discordUsername: r || void 0,
@@ -1637,7 +1637,7 @@ function yt({ competitionId: e, registerMutation: n, registration: s }) {
1637
1637
  ) })
1638
1638
  ] });
1639
1639
  }
1640
- function wt({ competitionId: e, drivers: n, steamId: s, isPowerMode: r, registrationUrl: a, withdrawMutation: i, onWithdrawSuccess: o, registration: d }) {
1640
+ function Lt({ competitionId: e, drivers: n, steamId: s, isPowerMode: r, registrationUrl: a, withdrawMutation: i, onWithdrawSuccess: o, registration: d }) {
1641
1641
  const [p, c] = D(!1), u = () => {
1642
1642
  i.mutate(void 0, {
1643
1643
  onSuccess: () => {
@@ -1645,7 +1645,7 @@ function wt({ competitionId: e, drivers: n, steamId: s, isPowerMode: r, registra
1645
1645
  }
1646
1646
  });
1647
1647
  }, g = d || {}, f = n.length || g.currentCount || 0, m = g.maxParticipants;
1648
- return /* @__PURE__ */ l(U, { children: [
1648
+ return /* @__PURE__ */ l(F, { children: [
1649
1649
  /* @__PURE__ */ l("div", { className: "pvx-reg-form-header", children: [
1650
1650
  /* @__PURE__ */ t("h3", { className: "pvx-reg-form-title", children: "Registered Drivers" }),
1651
1651
  m && /* @__PURE__ */ t($e, { count: f, max: m })
@@ -1721,64 +1721,64 @@ function $e({ count: e, max: n }) {
1721
1721
  " drivers"
1722
1722
  ] });
1723
1723
  }
1724
- function Nn({ competitionId: e, className: n }) {
1725
- const { data: s, isLoading: r } = xe(e), a = (s == null ? void 0 : s.type) === "championship", i = (s == null ? void 0 : s.type) === "hotlap", { data: o } = ze(i ? e : null), d = L(
1724
+ function wn({ competitionId: e, className: n }) {
1725
+ const { data: s, isLoading: r } = xe(e), a = (s == null ? void 0 : s.type) === "championship", i = (s == null ? void 0 : s.type) === "hotlap", { data: o } = Ye(i ? e : null), d = S(
1726
1726
  () => {
1727
- var y;
1728
- return ((y = s == null ? void 0 : s.rounds) == null ? void 0 : y.filter((C) => C.isFinalized)) || [];
1727
+ var b;
1728
+ return ((b = s == null ? void 0 : s.rounds) == null ? void 0 : b.filter((L) => L.isFinalized)) || [];
1729
1729
  },
1730
1730
  [s]
1731
- ), p = L(
1732
- () => d.map((y) => y.roundNumber),
1731
+ ), p = S(
1732
+ () => d.map((b) => b.roundNumber),
1733
1733
  [d]
1734
- ), { data: c = [], isLoading: u } = We(
1734
+ ), { data: c = [], isLoading: u } = Qe(
1735
1735
  e,
1736
1736
  p
1737
- ), g = i && c.length > 0 ? c[0] : null, f = (g == null ? void 0 : g.sessions) || [], m = i ? "leaderboard" : a ? "standings" : p.length > 0 ? `round-${p[p.length - 1]}` : null, [b, x] = D(null), v = b || m;
1737
+ ), g = i && c.length > 0 ? c[0] : null, f = (g == null ? void 0 : g.sessions) || [], m = i ? "leaderboard" : a ? "standings" : p.length > 0 ? `round-${p[p.length - 1]}` : null, [y, x] = D(null), v = y || m;
1738
1738
  if (r || u)
1739
- return /* @__PURE__ */ t(F, { message: "Loading results..." });
1739
+ return /* @__PURE__ */ t(E, { message: "Loading results..." });
1740
1740
  if (!s)
1741
1741
  return /* @__PURE__ */ t(P, { message: "Competition not found." });
1742
1742
  if (!d.length)
1743
1743
  return /* @__PURE__ */ t(P, { message: "No results available yet. Results will appear here once rounds are finalised." });
1744
- const N = new Map(c.map((y) => [`round-${y.roundNumber}`, y])), h = [];
1744
+ const N = new Map(c.map((b) => [`round-${b.roundNumber}`, b])), h = [];
1745
1745
  if (a && h.push({ id: "standings", label: "Standings" }), i) {
1746
1746
  h.push({ id: "leaderboard", label: "Leaderboard" });
1747
- for (const y of f)
1748
- h.push({ id: `session-${y.type}`, label: ie(y.type) });
1747
+ for (const b of f)
1748
+ h.push({ id: `session-${b.type}`, label: ie(b.type) });
1749
1749
  } else
1750
- for (const y of d)
1750
+ for (const b of d)
1751
1751
  h.push({
1752
- id: `round-${y.roundNumber}`,
1753
- label: `R${y.roundNumber}`,
1752
+ id: `round-${b.roundNumber}`,
1753
+ label: `R${b.roundNumber}`,
1754
1754
  track: null
1755
1755
  });
1756
1756
  const w = N.get(v);
1757
1757
  return /* @__PURE__ */ l("div", { className: n || "", children: [
1758
- /* @__PURE__ */ t("div", { className: "pvx-results-tabs", children: h.map((y) => /* @__PURE__ */ l(
1758
+ /* @__PURE__ */ t("div", { className: "pvx-results-tabs", children: h.map((b) => /* @__PURE__ */ l(
1759
1759
  "button",
1760
1760
  {
1761
- className: `pvx-results-tab ${v === y.id ? "pvx-results-tab--active" : ""}`,
1762
- onClick: () => x(y.id),
1763
- title: y.track || void 0,
1761
+ className: `pvx-results-tab ${v === b.id ? "pvx-results-tab--active" : ""}`,
1762
+ onClick: () => x(b.id),
1763
+ title: b.track || void 0,
1764
1764
  children: [
1765
- /* @__PURE__ */ t("span", { className: "pvx-results-tab-label", children: y.label }),
1766
- y.track && /* @__PURE__ */ t("span", { className: "pvx-results-tab-track", children: y.track })
1765
+ /* @__PURE__ */ t("span", { className: "pvx-results-tab-label", children: b.label }),
1766
+ b.track && /* @__PURE__ */ t("span", { className: "pvx-results-tab-track", children: b.track })
1767
1767
  ]
1768
1768
  },
1769
- y.id
1769
+ b.id
1770
1770
  )) }),
1771
- v === "standings" ? /* @__PURE__ */ t(vt, { competitionId: e }) : v === "leaderboard" ? /* @__PURE__ */ t(Ct, { leaderboard: o, config: s }) : v != null && v.startsWith("session-") ? /* @__PURE__ */ t(
1772
- Lt,
1771
+ v === "standings" ? /* @__PURE__ */ t(ft, { competitionId: e }) : v === "leaderboard" ? /* @__PURE__ */ t(Tt, { leaderboard: o, config: s }) : v != null && v.startsWith("session-") ? /* @__PURE__ */ t(
1772
+ Rt,
1773
1773
  {
1774
- session: f.find((y) => `session-${y.type}` === v),
1774
+ session: f.find((b) => `session-${b.type}` === v),
1775
1775
  round: g,
1776
1776
  competitionId: e
1777
1777
  }
1778
- ) : w ? /* @__PURE__ */ t(kt, { round: w, competitionId: e }) : /* @__PURE__ */ t(P, { message: "No results for this round." })
1778
+ ) : w ? /* @__PURE__ */ t(St, { round: w, competitionId: e }) : /* @__PURE__ */ t(P, { message: "No results for this round." })
1779
1779
  ] });
1780
1780
  }
1781
- function kt({ round: e, competitionId: n }) {
1781
+ function St({ round: e, competitionId: n }) {
1782
1782
  var i;
1783
1783
  const r = (e.sessions || []).find((o) => o.type === "RACE"), a = (i = r == null ? void 0 : r.results) == null ? void 0 : i.filter((o) => o.position <= 3).sort((o, d) => o.position - d.position);
1784
1784
  return /* @__PURE__ */ l("div", { className: "pvx-card", children: [
@@ -1803,7 +1803,7 @@ function kt({ round: e, competitionId: n }) {
1803
1803
  /* @__PURE__ */ t(le, { round: e, competitionId: n })
1804
1804
  ] });
1805
1805
  }
1806
- function Ct({ leaderboard: e, config: n }) {
1806
+ function Tt({ leaderboard: e, config: n }) {
1807
1807
  var s;
1808
1808
  return (s = e == null ? void 0 : e.drivers) != null && s.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
1809
1809
  /* @__PURE__ */ t("div", { className: "pvx-card-header--split", children: /* @__PURE__ */ l("div", { children: [
@@ -1843,7 +1843,7 @@ function Ct({ leaderboard: e, config: n }) {
1843
1843
  ] }) })
1844
1844
  ] }) : /* @__PURE__ */ t(P, { message: "No lap times recorded yet." });
1845
1845
  }
1846
- function Lt({ session: e, round: n, competitionId: s }) {
1846
+ function Rt({ session: e, round: n, competitionId: s }) {
1847
1847
  return e ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
1848
1848
  /* @__PURE__ */ t("div", { className: "pvx-card-header", children: /* @__PURE__ */ t("h4", { className: "pvx-card-title", children: ie(e.type) }) }),
1849
1849
  /* @__PURE__ */ t(
@@ -1855,10 +1855,10 @@ function Lt({ session: e, round: n, competitionId: s }) {
1855
1855
  )
1856
1856
  ] }) : /* @__PURE__ */ t(P, { message: "Session data not available." });
1857
1857
  }
1858
- function St(e) {
1859
- const { cdnUrl: n } = k(), s = T({
1858
+ function $t(e) {
1859
+ const { cdnUrl: n } = C(), s = T({
1860
1860
  queryKey: ["pitvox", "laps", "global", e, "index"],
1861
- queryFn: () => R(n, qe(null, e)),
1861
+ queryFn: () => R(n, Ke(null, e)),
1862
1862
  enabled: !!e,
1863
1863
  staleTime: 3e4,
1864
1864
  refetchInterval: 3e4
@@ -1882,7 +1882,7 @@ function St(e) {
1882
1882
  };
1883
1883
  }
1884
1884
  function Me(e = {}) {
1885
- const { cdnUrl: n, partnerSlug: s } = k(), { game: r, gameVersion: a, enabled: i = !0 } = e, o = X(s, r, a, "ratings.json");
1885
+ const { cdnUrl: n, partnerSlug: s } = C(), { game: r, gameVersion: a, enabled: i = !0 } = e, o = X(s, r, a, "ratings.json");
1886
1886
  return T({
1887
1887
  queryKey: ["pitvox", "ratings", s, r || null, a || null],
1888
1888
  queryFn: () => R(n, o),
@@ -1891,9 +1891,9 @@ function Me(e = {}) {
1891
1891
  enabled: i
1892
1892
  });
1893
1893
  }
1894
- function Tt(e) {
1894
+ function Mt(e) {
1895
1895
  var r;
1896
- const n = Me(), s = L(() => {
1896
+ const n = Me(), s = S(() => {
1897
1897
  var a;
1898
1898
  return !((a = n.data) != null && a.drivers) || !e ? null : n.data.drivers.find(
1899
1899
  (i) => i.identifier === e
@@ -1912,7 +1912,7 @@ function Tt(e) {
1912
1912
  } : null
1913
1913
  };
1914
1914
  }
1915
- function bn(e = {}) {
1915
+ function kn(e = {}) {
1916
1916
  const n = Me(e);
1917
1917
  return {
1918
1918
  data: n.data || null,
@@ -1920,12 +1920,12 @@ function bn(e = {}) {
1920
1920
  error: n.error
1921
1921
  };
1922
1922
  }
1923
- function Rt() {
1924
- const { cdnUrl: e, partnerSlug: n, getSteamId: s, onFetchServerPassword: r } = k(), a = s(), { data: i, isLoading: o } = T({
1923
+ function Dt() {
1924
+ const { cdnUrl: e, partnerSlug: n, getSteamId: s, onFetchServerPassword: r } = C(), a = s(), { data: i, isLoading: o } = T({
1925
1925
  queryKey: ["pitvox", "competitions", n],
1926
1926
  queryFn: async () => {
1927
1927
  const m = await R(e, "competitions/index.json");
1928
- return m != null && m.competitions ? m.competitions.filter((b) => b.partnerSlug === n) : [];
1928
+ return m != null && m.competitions ? m.competitions.filter((y) => y.partnerSlug === n) : [];
1929
1929
  },
1930
1930
  staleTime: 6e4
1931
1931
  }), d = (i == null ? void 0 : i.map((m) => m.id)) || [], p = ce({
@@ -1935,24 +1935,32 @@ function Rt() {
1935
1935
  enabled: !!a && d.length > 0,
1936
1936
  staleTime: 6e4
1937
1937
  }))
1938
- }), c = p.some((m) => m.isLoading), u = L(() => {
1938
+ }), c = p.some((m) => m.isLoading), u = S(() => {
1939
1939
  var x, v;
1940
1940
  if (!i || !a || c) return [];
1941
- const m = /* @__PURE__ */ new Date(), b = [];
1941
+ const m = /* @__PURE__ */ new Date(), y = [];
1942
1942
  for (let N = 0; N < i.length; N++) {
1943
1943
  const h = i[N], w = (x = p[N]) == null ? void 0 : x.data;
1944
- if (!((v = w == null ? void 0 : w.drivers) == null ? void 0 : v.some((S) => S.steamId === a))) continue;
1945
- const C = h.rounds || [];
1946
- for (const S of C)
1947
- S.isFinalized || !S.startTime || new Date(S.startTime) <= m || b.push({
1944
+ if (!((v = w == null ? void 0 : w.drivers) == null ? void 0 : v.some((k) => k.steamId === a))) continue;
1945
+ const L = h.type === "hotlap", M = h.rounds || [];
1946
+ for (const k of M) {
1947
+ if (k.isFinalized && (!L || k.dediStatus === "completed")) continue;
1948
+ const A = k.dediStatus === "running" || k.dediStatus === "provisioning", De = k.dediStatus === "scheduled", Ie = k.startTime && new Date(k.startTime) > m, Pe = A || De || k.dediServerAddress;
1949
+ !A && !Ie && !Pe || y.push({
1948
1950
  competitionId: h.id,
1949
1951
  competitionName: h.name,
1950
- roundNumber: S.roundNumber,
1951
- track: S.track || "TBD",
1952
- startTime: S.startTime
1952
+ roundNumber: k.roundNumber,
1953
+ track: k.track || "TBD",
1954
+ startTime: k.startTime,
1955
+ dediStatus: k.dediStatus || null,
1956
+ dediServerAddress: k.dediServerAddress || null
1953
1957
  });
1958
+ }
1954
1959
  }
1955
- return b.sort((N, h) => new Date(N.startTime) - new Date(h.startTime)), b.length > 0 && (b[0].isNext = !0), b;
1960
+ return y.sort((N, h) => {
1961
+ const w = N.dediStatus === "running" || N.dediStatus === "provisioning", b = h.dediStatus === "running" || h.dediStatus === "provisioning";
1962
+ return w && !b ? -1 : !w && b ? 1 : new Date(N.startTime) - new Date(h.startTime);
1963
+ }), y.length > 0 && (y[0].isNext = !0), y;
1956
1964
  }, [i, a, c, p]), g = ce({
1957
1965
  queries: u.map((m) => ({
1958
1966
  queryKey: ["pitvox", "serverInfo", m.competitionId, m.roundNumber],
@@ -1964,9 +1972,9 @@ function Rt() {
1964
1972
  }))
1965
1973
  });
1966
1974
  return {
1967
- data: L(() => u.length ? r ? u.map((m, b) => {
1975
+ data: S(() => u.length ? r ? u.map((m, y) => {
1968
1976
  var v;
1969
- const x = (v = g[b]) == null ? void 0 : v.data;
1977
+ const x = (v = g[y]) == null ? void 0 : v.data;
1970
1978
  return x != null && x.success ? {
1971
1979
  ...m,
1972
1980
  serverAddress: x.serverAddress || null,
@@ -1976,12 +1984,12 @@ function Rt() {
1976
1984
  isLoading: o || !!a && c
1977
1985
  };
1978
1986
  }
1979
- function $t() {
1980
- const { onFetchNotifications: e } = k();
1987
+ function It() {
1988
+ const { onFetchNotifications: e } = C();
1981
1989
  return !!e;
1982
1990
  }
1983
- function Mt(e = {}) {
1984
- const { onFetchNotifications: n, partnerSlug: s } = k(), { limit: r = 20, unreadOnly: a = !1 } = e;
1991
+ function Pt(e = {}) {
1992
+ const { onFetchNotifications: n, partnerSlug: s } = C(), { limit: r = 20, unreadOnly: a = !1 } = e;
1985
1993
  return T({
1986
1994
  queryKey: ["pitvox", "notifications", s, { limit: r, unreadOnly: a }],
1987
1995
  queryFn: () => n({ limit: r, unreadOnly: a }),
@@ -1990,8 +1998,8 @@ function Mt(e = {}) {
1990
1998
  refetchInterval: 3e4
1991
1999
  });
1992
2000
  }
1993
- function yn() {
1994
- const { onFetchNotifications: e, partnerSlug: n } = k(), { data: s, isLoading: r } = T({
2001
+ function Cn() {
2002
+ const { onFetchNotifications: e, partnerSlug: n } = C(), { data: s, isLoading: r } = T({
1995
2003
  queryKey: ["pitvox", "notifications", n, { limit: 1, unreadOnly: !1 }],
1996
2004
  queryFn: () => e({ limit: 1 }),
1997
2005
  enabled: !!e,
@@ -2001,8 +2009,8 @@ function yn() {
2001
2009
  });
2002
2010
  return { count: s ?? 0, isLoading: r };
2003
2011
  }
2004
- function Dt() {
2005
- const { onMarkNotificationRead: e, partnerSlug: n } = k(), s = _();
2012
+ function Bt() {
2013
+ const { onMarkNotificationRead: e, partnerSlug: n } = C(), s = _();
2006
2014
  return O({
2007
2015
  mutationFn: (r) => {
2008
2016
  if (!e)
@@ -2023,8 +2031,8 @@ function Dt() {
2023
2031
  }
2024
2032
  });
2025
2033
  }
2026
- function It() {
2027
- const { onMarkAllNotificationsRead: e, partnerSlug: n } = k(), s = _();
2034
+ function At() {
2035
+ const { onMarkAllNotificationsRead: e, partnerSlug: n } = C(), s = _();
2028
2036
  return O({
2029
2037
  mutationFn: () => {
2030
2038
  if (!e)
@@ -2047,7 +2055,7 @@ function It() {
2047
2055
  }
2048
2056
  });
2049
2057
  }
2050
- function Pt({ driverName: e, avatarUrl: n, memberSince: s, className: r = "" }) {
2058
+ function Ut({ driverName: e, avatarUrl: n, memberSince: s, className: r = "" }) {
2051
2059
  const a = s ? new Date(s).toLocaleDateString("en-GB", { day: "2-digit", month: "2-digit", year: "numeric" }) : null;
2052
2060
  return /* @__PURE__ */ l("div", { className: `pvx-card pvx-dash-profile ${r}`, children: [
2053
2061
  n ? /* @__PURE__ */ t("img", { src: n, alt: "", className: "pvx-dash-profile-avatar" }) : /* @__PURE__ */ t("div", { className: "pvx-dash-profile-avatar pvx-dash-profile-avatar--placeholder", children: (e || "?")[0].toUpperCase() }),
@@ -2060,7 +2068,7 @@ function Pt({ driverName: e, avatarUrl: n, memberSince: s, className: r = "" })
2060
2068
  ] })
2061
2069
  ] });
2062
2070
  }
2063
- function Bt() {
2071
+ function Ft() {
2064
2072
  return /* @__PURE__ */ l("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2065
2073
  /* @__PURE__ */ t("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
2066
2074
  /* @__PURE__ */ t("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
@@ -2068,7 +2076,7 @@ function Bt() {
2068
2076
  /* @__PURE__ */ t("line", { x1: "16", y1: "3", x2: "14", y2: "21" })
2069
2077
  ] });
2070
2078
  }
2071
- function At() {
2079
+ function Et() {
2072
2080
  return /* @__PURE__ */ l("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2073
2081
  /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10" }),
2074
2082
  /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "2" }),
@@ -2077,12 +2085,12 @@ function At() {
2077
2085
  /* @__PURE__ */ t("path", { d: "M13.5 12.5l4 2.5" })
2078
2086
  ] });
2079
2087
  }
2080
- function Ut() {
2088
+ function _t() {
2081
2089
  return /* @__PURE__ */ t("svg", { className: "pvx-dash-stat-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ t("polygon", { points: "12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2" }) });
2082
2090
  }
2083
2091
  function pe({ icon: e, value: n, label: s, items: r, labelKey: a, countKey: i }) {
2084
- const [o, d] = D(!1), p = Pe(null);
2085
- Be(() => {
2092
+ const [o, d] = D(!1), p = Ue(null);
2093
+ Fe(() => {
2086
2094
  if (!o) return;
2087
2095
  function u(g) {
2088
2096
  p.current && !p.current.contains(g.target) && d(!1);
@@ -2110,7 +2118,7 @@ function pe({ icon: e, value: n, label: s, items: r, labelKey: a, countKey: i })
2110
2118
  }
2111
2119
  );
2112
2120
  }
2113
- function Ft({ stats: e, rating: n, className: s = "" }) {
2121
+ function qt({ stats: e, rating: n, className: s = "" }) {
2114
2122
  if (!e) return null;
2115
2123
  const r = e.trackBreakdown.map((i) => ({
2116
2124
  name: q(i.trackId, i.layout),
@@ -2123,7 +2131,7 @@ function Ft({ stats: e, rating: n, className: s = "" }) {
2123
2131
  /* @__PURE__ */ t(
2124
2132
  pe,
2125
2133
  {
2126
- icon: /* @__PURE__ */ t(Bt, {}),
2134
+ icon: /* @__PURE__ */ t(Ft, {}),
2127
2135
  value: e.lapCount.toLocaleString(),
2128
2136
  label: "Total Laps",
2129
2137
  items: r,
@@ -2134,7 +2142,7 @@ function Ft({ stats: e, rating: n, className: s = "" }) {
2134
2142
  /* @__PURE__ */ t(
2135
2143
  pe,
2136
2144
  {
2137
- icon: /* @__PURE__ */ t(At, {}),
2145
+ icon: /* @__PURE__ */ t(Et, {}),
2138
2146
  value: e.carBreakdown.length,
2139
2147
  label: "Cars Used",
2140
2148
  items: a,
@@ -2143,7 +2151,7 @@ function Ft({ stats: e, rating: n, className: s = "" }) {
2143
2151
  }
2144
2152
  ),
2145
2153
  n && /* @__PURE__ */ l("div", { className: "pvx-dash-stat-card pvx-dash-stat-card--rating", children: [
2146
- /* @__PURE__ */ t(Ut, {}),
2154
+ /* @__PURE__ */ t(_t, {}),
2147
2155
  /* @__PURE__ */ l("div", { className: "pvx-dash-stat-content", children: [
2148
2156
  /* @__PURE__ */ t("span", { className: "pvx-dash-stat-value", children: n.rating.toFixed(1) }),
2149
2157
  /* @__PURE__ */ t("span", { className: "pvx-dash-stat-label", children: "Driver Rating" }),
@@ -2157,8 +2165,8 @@ function Ft({ stats: e, rating: n, className: s = "" }) {
2157
2165
  ] })
2158
2166
  ] });
2159
2167
  }
2160
- function Et({ records: e, className: n = "" }) {
2161
- const s = L(() => e != null && e.length ? e.slice().sort((r, a) => {
2168
+ function jt({ records: e, className: n = "" }) {
2169
+ const s = S(() => e != null && e.length ? e.slice().sort((r, a) => {
2162
2170
  const i = r.recordedAt ? new Date(r.recordedAt).getTime() : 0;
2163
2171
  return (a.recordedAt ? new Date(a.recordedAt).getTime() : 0) - i;
2164
2172
  }) : [], [e]);
@@ -2185,7 +2193,7 @@ function Et({ records: e, className: n = "" }) {
2185
2193
  /* @__PURE__ */ t("span", { className: "pvx-dash-record-car", children: I(r.carId) })
2186
2194
  ] }),
2187
2195
  /* @__PURE__ */ l("div", { className: "pvx-dash-record-time", children: [
2188
- /* @__PURE__ */ t("span", { className: "pvx-dash-record-lap", children: A(r.lapTimeMs) }),
2196
+ /* @__PURE__ */ t("span", { className: "pvx-dash-record-lap", children: U(r.lapTimeMs) }),
2189
2197
  /* @__PURE__ */ l("span", { className: `pvx-dash-game-badge pvx-dash-game-badge--${r.game || "evo"}`, children: [
2190
2198
  (r.game || "evo").toUpperCase(),
2191
2199
  r.gameVersion ? ` ${r.gameVersion}` : ""
@@ -2194,7 +2202,7 @@ function Et({ records: e, className: n = "" }) {
2194
2202
  ] }, a)) })
2195
2203
  ] }) : null;
2196
2204
  }
2197
- function _t({ events: e, isLoading: n, className: s, limit: r = 3 }) {
2205
+ function Vt({ events: e, isLoading: n, className: s, limit: r = 3 }) {
2198
2206
  if (n)
2199
2207
  return /* @__PURE__ */ t("div", { className: "pvx-loading", children: "Loading upcoming events..." });
2200
2208
  if (!(e != null && e.length))
@@ -2202,7 +2210,7 @@ function _t({ events: e, isLoading: n, className: s, limit: r = 3 }) {
2202
2210
  const a = r ? e.slice(0, r) : e, i = e.length - a.length;
2203
2211
  return /* @__PURE__ */ l("div", { className: `pvx-card ${s || ""}`, children: [
2204
2212
  /* @__PURE__ */ t("div", { className: "pvx-card-header", children: /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
2205
- /* @__PURE__ */ t(Vt, {}),
2213
+ /* @__PURE__ */ t(Ot, {}),
2206
2214
  "Upcoming Events",
2207
2215
  /* @__PURE__ */ l("span", { className: "pvx-dash-records-count", children: [
2208
2216
  "(",
@@ -2225,7 +2233,7 @@ function _t({ events: e, isLoading: n, className: s, limit: r = 3 }) {
2225
2233
  o.track
2226
2234
  ] }),
2227
2235
  o.serverPassword && /* @__PURE__ */ t(
2228
- qt,
2236
+ Kt,
2229
2237
  {
2230
2238
  password: o.serverPassword,
2231
2239
  address: o.serverAddress
@@ -2238,7 +2246,7 @@ function _t({ events: e, isLoading: n, className: s, limit: r = 3 }) {
2238
2246
  month: "short",
2239
2247
  year: "numeric"
2240
2248
  }) }),
2241
- /* @__PURE__ */ t("span", { className: "pvx-upcoming-relative", children: o.dediStatus === "running" ? "Live now" : o.dediStatus === "provisioning" ? "Starting..." : jt(o.startTime) }),
2249
+ /* @__PURE__ */ t("span", { className: "pvx-upcoming-relative", children: o.dediStatus === "running" ? "Live now" : o.dediStatus === "provisioning" ? "Starting..." : Ht(o.startTime) }),
2242
2250
  o.dediStatus === "running" && /* @__PURE__ */ t("span", { className: "pvx-upcoming-badge pvx-upcoming-badge--live", children: "Live" }),
2243
2251
  !o.dediStatus && o.isNext && /* @__PURE__ */ t("span", { className: "pvx-upcoming-badge", children: "Next" })
2244
2252
  ] })
@@ -2255,7 +2263,7 @@ function _t({ events: e, isLoading: n, className: s, limit: r = 3 }) {
2255
2263
  ] })
2256
2264
  ] });
2257
2265
  }
2258
- function qt({ password: e, address: n }) {
2266
+ function Kt({ password: e, address: n }) {
2259
2267
  const [s, r] = D(!1), [a, i] = D(!1), o = n ? e ? `join:${n}|${e}` : `join:${n}` : null, d = H(async () => {
2260
2268
  if (o)
2261
2269
  try {
@@ -2271,31 +2279,31 @@ function qt({ password: e, address: n }) {
2271
2279
  onClick: d,
2272
2280
  title: "Copy join string to clipboard",
2273
2281
  children: [
2274
- /* @__PURE__ */ t(Ht, {}),
2282
+ /* @__PURE__ */ t(zt, {}),
2275
2283
  " ",
2276
2284
  s ? "Copied!" : "Join"
2277
2285
  ]
2278
2286
  }
2279
2287
  ),
2280
- e && /* @__PURE__ */ l(U, { children: [
2288
+ e && /* @__PURE__ */ l(F, { children: [
2281
2289
  /* @__PURE__ */ t(
2282
2290
  "span",
2283
2291
  {
2284
2292
  className: "pvx-server-detail pvx-server-detail--clickable",
2285
2293
  onClick: () => i((p) => !p),
2286
2294
  title: a ? "Hide password" : "Reveal password",
2287
- children: a ? /* @__PURE__ */ t(Wt, {}) : /* @__PURE__ */ t(Ot, {})
2295
+ children: a ? /* @__PURE__ */ t(Qt, {}) : /* @__PURE__ */ t(Gt, {})
2288
2296
  }
2289
2297
  ),
2290
2298
  a && /* @__PURE__ */ l("span", { className: "pvx-server-detail", children: [
2291
- /* @__PURE__ */ t(Kt, {}),
2299
+ /* @__PURE__ */ t(Wt, {}),
2292
2300
  " ",
2293
2301
  e
2294
2302
  ] })
2295
2303
  ] })
2296
2304
  ] });
2297
2305
  }
2298
- function jt(e) {
2306
+ function Ht(e) {
2299
2307
  const n = new Date(e).getTime() - Date.now();
2300
2308
  if (n <= 0) return "Now";
2301
2309
  const s = Math.floor(n / (1e3 * 60 * 60));
@@ -2310,49 +2318,49 @@ function jt(e) {
2310
2318
  }
2311
2319
  return ue(e);
2312
2320
  }
2313
- function Vt() {
2321
+ function Ot() {
2314
2322
  return /* @__PURE__ */ l("svg", { className: "pvx-dash-records-icon", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2315
2323
  /* @__PURE__ */ t("rect", { x: "3", y: "4", width: "18", height: "18", rx: "2" }),
2316
2324
  /* @__PURE__ */ t("path", { d: "M16 2v4M8 2v4M3 10h18" })
2317
2325
  ] });
2318
2326
  }
2319
- function Kt() {
2327
+ function Wt() {
2320
2328
  return /* @__PURE__ */ l("svg", { className: "pvx-server-icon", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2321
2329
  /* @__PURE__ */ t("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2" }),
2322
2330
  /* @__PURE__ */ t("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
2323
2331
  ] });
2324
2332
  }
2325
- function Ht() {
2333
+ function zt() {
2326
2334
  return /* @__PURE__ */ l("svg", { className: "pvx-server-icon pvx-server-icon--action", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2327
2335
  /* @__PURE__ */ t("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2" }),
2328
2336
  /* @__PURE__ */ t("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
2329
2337
  ] });
2330
2338
  }
2331
- function Ot() {
2339
+ function Gt() {
2332
2340
  return /* @__PURE__ */ l("svg", { className: "pvx-server-icon pvx-server-icon--action", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2333
2341
  /* @__PURE__ */ t("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
2334
2342
  /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "3" })
2335
2343
  ] });
2336
2344
  }
2337
- function Wt() {
2345
+ function Qt() {
2338
2346
  return /* @__PURE__ */ l("svg", { className: "pvx-server-icon pvx-server-icon--action", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2339
2347
  /* @__PURE__ */ t("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24" }),
2340
2348
  /* @__PURE__ */ t("line", { x1: "1", y1: "1", x2: "23", y2: "23" })
2341
2349
  ] });
2342
2350
  }
2343
- function zt({ notifications: e, unreadCount: n = 0, onMarkRead: s, onMarkAllRead: r, isLoading: a, className: i }) {
2351
+ function Yt({ notifications: e, unreadCount: n = 0, onMarkRead: s, onMarkAllRead: r, isLoading: a, className: i }) {
2344
2352
  const o = ve();
2345
2353
  return a ? /* @__PURE__ */ t("div", { className: "pvx-loading", children: "Loading notifications..." }) : /* @__PURE__ */ l("div", { className: `pvx-card ${i || ""}`, children: [
2346
2354
  /* @__PURE__ */ l("div", { className: "pvx-card-header", children: [
2347
2355
  /* @__PURE__ */ l("h3", { className: "pvx-card-title", children: [
2348
- /* @__PURE__ */ t(Yt, {}),
2356
+ /* @__PURE__ */ t(Xt, {}),
2349
2357
  "Notifications",
2350
2358
  n > 0 && /* @__PURE__ */ t("span", { className: "pvx-notif-badge", children: n > 99 ? "99+" : n })
2351
2359
  ] }),
2352
2360
  n > 0 && r && /* @__PURE__ */ t("button", { className: "pvx-notif-mark-all", onClick: r, children: "Mark all read" })
2353
2361
  ] }),
2354
2362
  e != null && e.length ? /* @__PURE__ */ t("div", { className: "pvx-notif-list", children: e.map((d) => /* @__PURE__ */ t(
2355
- Gt,
2363
+ Jt,
2356
2364
  {
2357
2365
  notification: d,
2358
2366
  getUserDisplay: o,
@@ -2362,7 +2370,7 @@ function zt({ notifications: e, unreadCount: n = 0, onMarkRead: s, onMarkAllRead
2362
2370
  )) }) : /* @__PURE__ */ t("div", { className: "pvx-notif-empty", children: "No notifications" })
2363
2371
  ] });
2364
2372
  }
2365
- function Gt({ notification: e, getUserDisplay: n, onMarkRead: s }) {
2373
+ function Jt({ notification: e, getUserDisplay: n, onMarkRead: s }) {
2366
2374
  const r = () => {
2367
2375
  !e.isRead && s && s(e.id);
2368
2376
  };
@@ -2372,9 +2380,9 @@ function Gt({ notification: e, getUserDisplay: n, onMarkRead: s }) {
2372
2380
  className: `pvx-notif-item ${e.isRead ? "" : "pvx-notif-item--unread"}`,
2373
2381
  onClick: r,
2374
2382
  children: [
2375
- /* @__PURE__ */ t(Qt, { type: e.type }),
2383
+ /* @__PURE__ */ t(Zt, { type: e.type }),
2376
2384
  /* @__PURE__ */ l("div", { className: "pvx-notif-content", children: [
2377
- /* @__PURE__ */ t("span", { className: "pvx-notif-message", children: Ve(e, n) }),
2385
+ /* @__PURE__ */ t("span", { className: "pvx-notif-message", children: Oe(e, n) }),
2378
2386
  /* @__PURE__ */ t("span", { className: "pvx-notif-time", children: ue(e.createdAt) })
2379
2387
  ] }),
2380
2388
  !e.isRead && /* @__PURE__ */ t("span", { className: "pvx-notif-dot" })
@@ -2382,7 +2390,7 @@ function Gt({ notification: e, getUserDisplay: n, onMarkRead: s }) {
2382
2390
  }
2383
2391
  );
2384
2392
  }
2385
- function Qt({ type: e }) {
2393
+ function Zt({ type: e }) {
2386
2394
  return e === "RECORD_BEATEN" ? /* @__PURE__ */ t("span", { className: "pvx-notif-icon pvx-notif-icon--beaten", children: /* @__PURE__ */ t("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ t("path", { d: "m7 7 10 10M17 7v10H7" }) }) }) : e === "ADMIN_MESSAGE" ? /* @__PURE__ */ t("span", { className: "pvx-notif-icon pvx-notif-icon--admin", children: /* @__PURE__ */ l("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2387
2395
  /* @__PURE__ */ t("path", { d: "m3 11 18-5v12L3 13v-2z" }),
2388
2396
  /* @__PURE__ */ t("path", { d: "M11.6 16.8a3 3 0 1 1-5.8-1.6" })
@@ -2395,33 +2403,33 @@ function Qt({ type: e }) {
2395
2403
  /* @__PURE__ */ t("path", { d: "M18 2H6v7a6 6 0 0 0 12 0V2Z" })
2396
2404
  ] }) });
2397
2405
  }
2398
- function Yt() {
2406
+ function Xt() {
2399
2407
  return /* @__PURE__ */ l("svg", { className: "pvx-dash-records-icon", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [
2400
2408
  /* @__PURE__ */ t("path", { d: "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9" }),
2401
2409
  /* @__PURE__ */ t("path", { d: "M10.3 21a1.94 1.94 0 0 0 3.4 0" })
2402
2410
  ] });
2403
2411
  }
2404
- function wn({ steamId: e, avatarUrl: n, memberSince: s, className: r = "" }) {
2405
- const { data: a, isLoading: i, error: o } = St(e), { data: d, isLoading: p } = Tt(e), { data: c, isLoading: u } = Rt(), g = $t(), { data: f, isLoading: m } = Mt({ limit: 10 }), b = Dt(), x = It();
2412
+ function Ln({ steamId: e, avatarUrl: n, memberSince: s, className: r = "" }) {
2413
+ const { data: a, isLoading: i, error: o } = $t(e), { data: d, isLoading: p } = Mt(e), { data: c, isLoading: u } = Dt(), g = It(), { data: f, isLoading: m } = Pt({ limit: 10 }), y = Bt(), x = At();
2406
2414
  return i || p ? /* @__PURE__ */ t("div", { className: "pvx-loading", children: "Loading dashboard..." }) : o ? /* @__PURE__ */ t("div", { className: "pvx-empty", children: "Failed to load dashboard data." }) : a ? /* @__PURE__ */ l("div", { className: `pvx-dash ${r}`, children: [
2407
2415
  /* @__PURE__ */ t(
2408
- Pt,
2416
+ Ut,
2409
2417
  {
2410
2418
  driverName: a.driverName,
2411
2419
  avatarUrl: n,
2412
2420
  memberSince: s
2413
2421
  }
2414
2422
  ),
2415
- /* @__PURE__ */ t(Ft, { stats: a, rating: d }),
2416
- e && /* @__PURE__ */ t(_t, { events: c, isLoading: u }),
2423
+ /* @__PURE__ */ t(qt, { stats: a, rating: d }),
2424
+ e && /* @__PURE__ */ t(Vt, { events: c, isLoading: u }),
2417
2425
  /* @__PURE__ */ l("div", { className: `pvx-dash-row ${g ? "pvx-dash-row--2col" : ""}`, children: [
2418
- /* @__PURE__ */ t(Et, { records: a.currentRecords }),
2426
+ /* @__PURE__ */ t(jt, { records: a.currentRecords }),
2419
2427
  g && /* @__PURE__ */ t(
2420
- zt,
2428
+ Yt,
2421
2429
  {
2422
2430
  notifications: f == null ? void 0 : f.notifications,
2423
2431
  unreadCount: (f == null ? void 0 : f.unreadCount) || 0,
2424
- onMarkRead: (v) => b.mutate(v),
2432
+ onMarkRead: (v) => y.mutate(v),
2425
2433
  onMarkAllRead: () => x.mutate(),
2426
2434
  isLoading: m
2427
2435
  }
@@ -2430,83 +2438,83 @@ function wn({ steamId: e, avatarUrl: n, memberSince: s, className: r = "" }) {
2430
2438
  ] }) : /* @__PURE__ */ t("div", { className: "pvx-empty", children: "No data available yet. Start driving to see your stats!" });
2431
2439
  }
2432
2440
  export {
2433
- cn as CarsTable,
2441
+ un as CarsTable,
2434
2442
  P as CompEmptyState,
2435
- F as CompLoadingState,
2436
- ut as CompetitionCard,
2437
- hn as CompetitionCards,
2438
- Nn as CompetitionResultsTabs,
2439
- pt as CompletedBadge,
2443
+ E as CompLoadingState,
2444
+ vt as CompetitionCard,
2445
+ gn as CompetitionCards,
2446
+ wn as CompetitionResultsTabs,
2447
+ ht as CompletedBadge,
2440
2448
  Se as DEFAULT_COMPLETION_GRACE_DAYS,
2441
- wn as DriverDashboard,
2442
- Pt as DriverProfile,
2443
- dn as DriversTable,
2444
- xn as EntryList,
2449
+ Ln as DriverDashboard,
2450
+ Ut as DriverProfile,
2451
+ mn as DriversTable,
2452
+ Nn as EntryList,
2445
2453
  J as InfoPill,
2446
- pn as LapHistoryTable,
2447
- zt as NotificationsCard,
2454
+ hn as LapHistoryTable,
2455
+ Yt as NotificationsCard,
2448
2456
  ae as PODIUM_MEDALS,
2449
- en as PitVoxPartnerProvider,
2450
- un as RankingsTable,
2451
- Et as RecordsTable,
2452
- gn as RegisterButton,
2453
- fn as RegistrationPanel,
2454
- vn as RoundResults,
2457
+ rn as PitVoxPartnerProvider,
2458
+ vn as RankingsTable,
2459
+ jt as RecordsTable,
2460
+ bn as RegisterButton,
2461
+ yn as RegistrationPanel,
2462
+ fn as RoundResults,
2455
2463
  le as RoundSessionResults,
2456
- vt as StandingsTable,
2457
- Ft as StatsCards,
2458
- ln as TracksTable,
2459
- at as TypeBadge,
2460
- _t as UpcomingEvents,
2461
- qe as buildDriverIndexPath,
2462
- _e as buildLapsPath,
2464
+ ft as StandingsTable,
2465
+ qt as StatsCards,
2466
+ pn as TracksTable,
2467
+ lt as TypeBadge,
2468
+ Vt as UpcomingEvents,
2469
+ Ke as buildDriverIndexPath,
2470
+ Ve as buildLapsPath,
2463
2471
  X as buildLeaderboardPath,
2464
- je as buildRecentLapsPath,
2472
+ He as buildRecentLapsPath,
2465
2473
  R as fetchCdnJson,
2466
- mn as filterCompetitionsByStatus,
2474
+ xn as filterCompetitionsByStatus,
2467
2475
  I as formatCarName,
2468
2476
  j as formatDate,
2469
- tn as formatDelta,
2477
+ sn as formatDelta,
2470
2478
  he as formatFuel,
2471
- A as formatLapTime,
2472
- Ve as formatNotificationMessage,
2479
+ U as formatLapTime,
2480
+ Oe as formatNotificationMessage,
2473
2481
  ue as formatRelativeTime,
2474
2482
  B as formatSectorTime,
2475
2483
  ie as formatSessionLabel,
2476
2484
  q as formatTrackName,
2477
2485
  me as formatTyreCompound,
2478
- dt as getCompetitionPodium,
2486
+ mt as getCompetitionPodium,
2479
2487
  Te as getCompetitionStatus,
2480
- ct as getCompletionDate,
2481
- lt as isCompetitionComplete,
2482
- an as useCarLeaderboard,
2483
- rn as useCarMetadata,
2484
- We as useCompetitionAllRounds,
2488
+ ut as getCompletionDate,
2489
+ pt as isCompetitionComplete,
2490
+ cn as useCarLeaderboard,
2491
+ on as useCarMetadata,
2492
+ Qe as useCompetitionAllRounds,
2485
2493
  xe as useCompetitionConfig,
2486
2494
  fe as useCompetitionEntryList,
2487
- ze as useCompetitionLeaderboard,
2488
- Oe as useCompetitionRound,
2489
- Ge as useCompetitionRoundLaps,
2495
+ Ye as useCompetitionLeaderboard,
2496
+ Ge as useCompetitionRound,
2497
+ Je as useCompetitionRoundLaps,
2490
2498
  ge as useCompetitionStandings,
2491
- on as useCompetitions,
2492
- He as useDriverLaps,
2493
- Tt as useDriverRating,
2494
- bn as useDriverRatings,
2495
- St as useDriverStats,
2496
- nn as useLeaderboardIndex,
2497
- It as useMarkAllNotificationsRead,
2498
- Dt as useMarkNotificationRead,
2499
- Mt as useNotifications,
2500
- $t as useNotificationsEnabled,
2501
- k as usePitVox,
2502
- sn as useRecentLaps,
2499
+ dn as useCompetitions,
2500
+ ze as useDriverLaps,
2501
+ Mt as useDriverRating,
2502
+ kn as useDriverRatings,
2503
+ $t as useDriverStats,
2504
+ an as useLeaderboardIndex,
2505
+ At as useMarkAllNotificationsRead,
2506
+ Bt as useMarkNotificationRead,
2507
+ Pt as useNotifications,
2508
+ It as useNotificationsEnabled,
2509
+ C as usePitVox,
2510
+ ln as useRecentLaps,
2503
2511
  Ne as useRegister,
2504
2512
  te as useRegistrationMode,
2505
2513
  ee as useRegistrationStatus,
2506
2514
  ne as useRegistrationUrl,
2507
- Ke as useTrackLeaderboard,
2508
- yn as useUnreadCount,
2509
- Rt as useUpcomingEvents,
2515
+ We as useTrackLeaderboard,
2516
+ Cn as useUnreadCount,
2517
+ Dt as useUpcomingEvents,
2510
2518
  ve as useUserLookup,
2511
2519
  be as useWithdraw
2512
2520
  };