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