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