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