@pitvox/partner-react 0.5.0 → 0.5.2

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