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