@pitvox/partner-react 0.7.16 → 0.7.17
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 +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +129 -128
- package/dist/styles.css +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16,7 +16,7 @@ function it({
|
|
|
16
16
|
onFetchServerPassword: c,
|
|
17
17
|
children: u
|
|
18
18
|
}) {
|
|
19
|
-
const
|
|
19
|
+
const g = S(() => ({
|
|
20
20
|
partnerSlug: e,
|
|
21
21
|
cdnUrl: t.replace(/\/$/, ""),
|
|
22
22
|
pitvoxUrl: r.replace(/\/$/, ""),
|
|
@@ -34,11 +34,11 @@ function it({
|
|
|
34
34
|
} catch {
|
|
35
35
|
f = !1;
|
|
36
36
|
}
|
|
37
|
-
return f ? /* @__PURE__ */ n(X.Provider, { value:
|
|
37
|
+
return f ? /* @__PURE__ */ n(X.Provider, { value: g, children: u }) : (Y || (Y = new je({
|
|
38
38
|
defaultOptions: {
|
|
39
39
|
queries: { staleTime: 6e4 }
|
|
40
40
|
}
|
|
41
|
-
})), /* @__PURE__ */ n(_e, { client: Y, children: /* @__PURE__ */ n(X.Provider, { value:
|
|
41
|
+
})), /* @__PURE__ */ n(_e, { client: Y, children: /* @__PURE__ */ n(X.Provider, { value: g, children: u }) }));
|
|
42
42
|
}
|
|
43
43
|
function C() {
|
|
44
44
|
const e = Fe(X);
|
|
@@ -115,7 +115,7 @@ function ot(e) {
|
|
|
115
115
|
return e == null ? "" : `${e >= 0 ? "+" : "-"}${(Math.abs(e) / 1e3).toFixed(3)}`;
|
|
116
116
|
}
|
|
117
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,
|
|
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, g = o ? B(o) : null, f = [u, g].filter(Boolean).join(" — ");
|
|
119
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
121
|
function xe(e) {
|
|
@@ -138,15 +138,15 @@ function ge(e) {
|
|
|
138
138
|
return isNaN(t) ? "-" : t % 1 ? `${t.toFixed(1)}L` : `${t}L`;
|
|
139
139
|
}
|
|
140
140
|
function ze(e = {}) {
|
|
141
|
-
var p, c, u,
|
|
141
|
+
var p, c, u, g, f, h;
|
|
142
142
|
const { cdnUrl: t, partnerSlug: r } = C(), { game: s, gameVersion: a } = e, i = ee(r, null, null, "index.json"), o = T({
|
|
143
143
|
queryKey: ["pitvox", "leaderboards", r, "index"],
|
|
144
144
|
queryFn: () => $(t, i),
|
|
145
145
|
staleTime: 3e4,
|
|
146
146
|
refetchInterval: 3e4
|
|
147
147
|
}), d = S(() => {
|
|
148
|
-
var
|
|
149
|
-
if (!((
|
|
148
|
+
var x;
|
|
149
|
+
if (!((x = o.data) != null && x.tracks)) return [];
|
|
150
150
|
let b = o.data.tracks;
|
|
151
151
|
return s && (b = b.filter((m) => m.game === s)), a && (b = b.filter((m) => m.gameVersion === a)), b.map((m) => ({
|
|
152
152
|
id: m.trackId,
|
|
@@ -171,13 +171,13 @@ function ze(e = {}) {
|
|
|
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: ((g = o.data) == null ? void 0 : g.totalLaps) || 0,
|
|
175
175
|
totalUsers: ((f = o.data) == null ? void 0 : f.totalUsers) || 0,
|
|
176
176
|
versions: ((h = o.data) == null ? void 0 : h.versions) || {}
|
|
177
177
|
};
|
|
178
178
|
}
|
|
179
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:
|
|
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: g, error: f } = T({
|
|
181
181
|
queryKey: ["pitvox", "leaderboards", a, "track", e, p, o, d],
|
|
182
182
|
queryFn: () => $(s, c),
|
|
183
183
|
enabled: !!e,
|
|
@@ -187,22 +187,22 @@ function Qe(e, t, r = {}) {
|
|
|
187
187
|
return { data: S(() => {
|
|
188
188
|
if (!(u != null && u.entries)) return [];
|
|
189
189
|
let b = u.entries;
|
|
190
|
-
if (o && (b = b.filter((
|
|
191
|
-
const
|
|
190
|
+
if (o && (b = b.filter((x) => x.game === o)), !i) {
|
|
191
|
+
const x = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
|
|
192
192
|
for (const N of b) {
|
|
193
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), (!
|
|
194
|
+
m.has(N.carId) || m.set(N.carId, /* @__PURE__ */ new Set()), m.get(N.carId).add(v), (!x.has(N.carId) || N.lapTimeMs < x.get(N.carId).lapTimeMs) && x.set(N.carId, N);
|
|
195
195
|
}
|
|
196
|
-
return Array.from(
|
|
196
|
+
return Array.from(x.values()).map((N) => {
|
|
197
197
|
var v;
|
|
198
198
|
return { ...N, driverCount: ((v = m.get(N.carId)) == null ? void 0 : v.size) || 0 };
|
|
199
199
|
}).sort((N, v) => N.lapTimeMs - v.lapTimeMs);
|
|
200
200
|
}
|
|
201
|
-
return b.filter((
|
|
202
|
-
}, [u == null ? void 0 : u.entries, i, o]), isLoading:
|
|
201
|
+
return b.filter((x) => x.carId === i).sort((x, m) => x.lapTimeMs - m.lapTimeMs);
|
|
202
|
+
}, [u == null ? void 0 : u.entries, i, o]), isLoading: g, error: f };
|
|
203
203
|
}
|
|
204
204
|
function Ge(e, t, r, s, a = {}) {
|
|
205
|
-
var
|
|
205
|
+
var x, m;
|
|
206
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
207
|
queryKey: ["pitvox", "laps", o, e, t, r || "default"],
|
|
208
208
|
queryFn: () => $(i, u),
|
|
@@ -212,7 +212,7 @@ function Ge(e, t, r, s, a = {}) {
|
|
|
212
212
|
}), h = S(() => {
|
|
213
213
|
var N;
|
|
214
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
|
-
}, [(
|
|
215
|
+
}, [(x = f.data) == null ? void 0 : x.laps, s, p, c, d]), b = S(() => {
|
|
216
216
|
const N = h.filter((w) => w.isValid && w.sector1Ms && w.sector2Ms && w.sector3Ms);
|
|
217
217
|
if (N.length < 2) return null;
|
|
218
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));
|
|
@@ -390,8 +390,8 @@ function ke(e) {
|
|
|
390
390
|
a.setQueriesData(
|
|
391
391
|
{ queryKey: ["pitvox", "competition", r, e, "entrylist"] },
|
|
392
392
|
(c) => {
|
|
393
|
-
var
|
|
394
|
-
return c ? ((
|
|
393
|
+
var g;
|
|
394
|
+
return c ? ((g = c.drivers) == null ? void 0 : g.some((f) => f.steamId === o)) ? c : { ...c, drivers: [...c.drivers || [], p] } : { drivers: [p] };
|
|
395
395
|
}
|
|
396
396
|
);
|
|
397
397
|
}
|
|
@@ -558,26 +558,26 @@ function rn() {
|
|
|
558
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" }) });
|
|
559
559
|
}
|
|
560
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:
|
|
561
|
+
const [d, p] = O({ key: "record.timestamp", dir: "desc" }), { activeTags: c, toggle: u, clear: g } = Le(i, o), f = S(() => {
|
|
562
562
|
var m;
|
|
563
563
|
if (!((m = r == null ? void 0 : r.tags) != null && m.length)) return [];
|
|
564
|
-
const
|
|
564
|
+
const x = /* @__PURE__ */ new Set();
|
|
565
565
|
for (const N of e || [])
|
|
566
|
-
N.recordByTag && Object.keys(N.recordByTag).forEach((v) =>
|
|
567
|
-
return r.tags.filter((N) =>
|
|
568
|
-
}, [e, r]), h = S(() => e ? c.size === 0 ? e : e.map((
|
|
566
|
+
N.recordByTag && Object.keys(N.recordByTag).forEach((v) => x.add(v));
|
|
567
|
+
return r.tags.filter((N) => x.has(N));
|
|
568
|
+
}, [e, r]), h = S(() => e ? c.size === 0 ? e : e.map((x) => {
|
|
569
569
|
var v, k;
|
|
570
|
-
if (!
|
|
570
|
+
if (!x.recordByTag) return null;
|
|
571
571
|
let m = null;
|
|
572
572
|
const N = /* @__PURE__ */ new Set();
|
|
573
|
-
for (const y of Object.values(
|
|
573
|
+
for (const y of Object.values(x.recordByTag)) {
|
|
574
574
|
if (N.has(y.carId)) continue;
|
|
575
575
|
N.add(y.carId);
|
|
576
576
|
const L = ((k = (v = r == null ? void 0 : r.cars) == null ? void 0 : v[y.carId]) == null ? void 0 : k.tags) || [];
|
|
577
577
|
Ce(L, c, r == null ? void 0 : r.categories) && (!m || y.lapTimeMs < m.lapTimeMs) && (m = y);
|
|
578
578
|
}
|
|
579
579
|
return m ? {
|
|
580
|
-
...
|
|
580
|
+
...x,
|
|
581
581
|
record: {
|
|
582
582
|
visibleId: m.steamId || m.identifier,
|
|
583
583
|
carId: m.carId,
|
|
@@ -586,20 +586,20 @@ function ut({ tracks: e, isLoading: t, carMetadata: r, getUserDisplay: s, onTrac
|
|
|
586
586
|
timestamp: m.recordedAt
|
|
587
587
|
}
|
|
588
588
|
} : null;
|
|
589
|
-
}).filter(Boolean) : [], [e, c, r]), b = S(() => z(h, d, (
|
|
589
|
+
}).filter(Boolean) : [], [e, c, r]), b = S(() => z(h, d, (x, m) => {
|
|
590
590
|
var N, v;
|
|
591
591
|
switch (m) {
|
|
592
592
|
case "displayName":
|
|
593
|
-
return
|
|
593
|
+
return x.displayName;
|
|
594
594
|
case "record.lapTimeMs":
|
|
595
|
-
return (N =
|
|
595
|
+
return (N = x.record) == null ? void 0 : N.lapTimeMs;
|
|
596
596
|
case "driverCount":
|
|
597
|
-
return
|
|
597
|
+
return x.driverCount || 0;
|
|
598
598
|
case "carCount":
|
|
599
|
-
return
|
|
599
|
+
return x.carCount || 0;
|
|
600
600
|
case "record.timestamp":
|
|
601
601
|
default:
|
|
602
|
-
return (v =
|
|
602
|
+
return (v = x.record) != null && v.timestamp ? new Date(x.record.timestamp).getTime() : 0;
|
|
603
603
|
}
|
|
604
604
|
}), [h, d]);
|
|
605
605
|
return t ? /* @__PURE__ */ n(K, {}) : e != null && e.length ? /* @__PURE__ */ l("div", { className: "pvx-card", children: [
|
|
@@ -610,7 +610,7 @@ function ut({ tracks: e, isLoading: t, carMetadata: r, getUserDisplay: s, onTrac
|
|
|
610
610
|
availableTags: f,
|
|
611
611
|
activeTags: c,
|
|
612
612
|
onToggle: u,
|
|
613
|
-
onClear:
|
|
613
|
+
onClear: g,
|
|
614
614
|
categories: r == null ? void 0 : r.categories,
|
|
615
615
|
tagLabels: r == null ? void 0 : r.tagLabels
|
|
616
616
|
}
|
|
@@ -625,42 +625,42 @@ function ut({ tracks: e, isLoading: t, carMetadata: r, getUserDisplay: s, onTrac
|
|
|
625
625
|
/* @__PURE__ */ n(R, { label: "Cars", sortKey: "carCount", config: d, onSort: p, className: "pvx-hidden-below-lg" }),
|
|
626
626
|
/* @__PURE__ */ n(R, { label: "Date", sortKey: "record.timestamp", config: d, onSort: p, className: "pvx-hidden-below-xl" })
|
|
627
627
|
] }) }),
|
|
628
|
-
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: b.map((
|
|
628
|
+
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: b.map((x) => {
|
|
629
629
|
var m, N, v;
|
|
630
630
|
return /* @__PURE__ */ l(
|
|
631
631
|
"tr",
|
|
632
632
|
{
|
|
633
633
|
className: "pvx-row pvx-row--clickable",
|
|
634
|
-
onClick: () => a(
|
|
634
|
+
onClick: () => a(x.id, x.layout),
|
|
635
635
|
children: [
|
|
636
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children:
|
|
637
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", children: (m =
|
|
638
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-lg", children: ((N =
|
|
639
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children:
|
|
640
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children:
|
|
641
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children:
|
|
642
|
-
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: (v =
|
|
636
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: x.displayName }),
|
|
637
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", children: (m = x.record) != null && m.visibleId ? /* @__PURE__ */ n(Q, { userId: x.record.visibleId, getUserDisplay: s }) : "-" }),
|
|
638
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-hidden-below-lg", children: ((N = x.record) == null ? void 0 : N.carDisplayName) || "-" }),
|
|
639
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: x.record ? A(x.record.lapTimeMs) : "-" }),
|
|
640
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-md", children: x.driverCount || "-" }),
|
|
641
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-lg", children: x.carCount || "-" }),
|
|
642
|
+
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--muted pvx-hidden-below-xl", children: (v = x.record) != null && v.timestamp ? _(x.record.timestamp) : "-" })
|
|
643
643
|
]
|
|
644
644
|
},
|
|
645
|
-
`${
|
|
645
|
+
`${x.id}|${x.layout || ""}`
|
|
646
646
|
);
|
|
647
647
|
}) })
|
|
648
648
|
] }) })
|
|
649
649
|
] }) : /* @__PURE__ */ n(V, { message: "No lap times recorded yet." });
|
|
650
650
|
}
|
|
651
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:
|
|
652
|
+
const [c, u] = O({ key: "lapTimeMs", dir: "asc" }), { activeTags: g, toggle: f, clear: h } = Le(d, p), b = S(() => {
|
|
653
653
|
var k, y, L;
|
|
654
654
|
if (!e || !((k = s == null ? void 0 : s.tags) != null && k.length)) return [];
|
|
655
655
|
const v = /* @__PURE__ */ new Set();
|
|
656
656
|
for (const D of e)
|
|
657
657
|
(((L = (y = s.cars) == null ? void 0 : y[D.carId]) == null ? void 0 : L.tags) || []).forEach((U) => v.add(U));
|
|
658
658
|
return s.tags.filter((D) => v.has(D));
|
|
659
|
-
}, [e, s]),
|
|
659
|
+
}, [e, s]), x = S(() => e ? g.size === 0 ? e : e.filter((v) => {
|
|
660
660
|
var y, L;
|
|
661
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,
|
|
663
|
-
}) : [], [e,
|
|
662
|
+
return Ce(k, g, s == null ? void 0 : s.categories);
|
|
663
|
+
}) : [], [e, g, s]), m = S(() => z(x, c, (v, k) => {
|
|
664
664
|
switch (k) {
|
|
665
665
|
case "carId":
|
|
666
666
|
return B(v.carId);
|
|
@@ -670,7 +670,7 @@ function ht({ entries: e, isLoading: t, track: r, carMetadata: s, getUserDisplay
|
|
|
670
670
|
default:
|
|
671
671
|
return v.lapTimeMs;
|
|
672
672
|
}
|
|
673
|
-
}), [
|
|
673
|
+
}), [x, c]), N = [
|
|
674
674
|
{ key: "tracks", label: "Tracks", onClick: () => o("tracks") },
|
|
675
675
|
{ key: "track", label: r.displayName }
|
|
676
676
|
];
|
|
@@ -680,7 +680,7 @@ function ht({ entries: e, isLoading: t, track: r, carMetadata: s, getUserDisplay
|
|
|
680
680
|
Te,
|
|
681
681
|
{
|
|
682
682
|
availableTags: b,
|
|
683
|
-
activeTags:
|
|
683
|
+
activeTags: g,
|
|
684
684
|
onToggle: f,
|
|
685
685
|
onClear: h,
|
|
686
686
|
categories: s == null ? void 0 : s.categories,
|
|
@@ -716,7 +716,7 @@ function ht({ entries: e, isLoading: t, track: r, carMetadata: s, getUserDisplay
|
|
|
716
716
|
] });
|
|
717
717
|
}
|
|
718
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]),
|
|
719
|
+
const [p, c] = O({ key: "lapTimeMs", dir: "asc" }), u = S(() => Se(e), [e]), g = S(() => z(e || [], p, (h, b) => {
|
|
720
720
|
switch (b) {
|
|
721
721
|
case "userId":
|
|
722
722
|
return a(h.steamId || h.userId).displayName;
|
|
@@ -746,15 +746,15 @@ function vt({ entries: e, isLoading: t, track: r, carId: s, getUserDisplay: a, o
|
|
|
746
746
|
/* @__PURE__ */ n(R, { label: "Laps", sortKey: "lapCount", config: p, onSort: c, className: "pvx-hidden-below-lg" }),
|
|
747
747
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
|
|
748
748
|
] }) }),
|
|
749
|
-
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children:
|
|
750
|
-
const
|
|
749
|
+
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: g.map((h, b) => {
|
|
750
|
+
const x = 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;
|
|
751
751
|
return /* @__PURE__ */ l(
|
|
752
752
|
"tr",
|
|
753
753
|
{
|
|
754
|
-
className: `pvx-row pvx-row--clickable ${d && m === d ? "pvx-row--highlight" :
|
|
754
|
+
className: `pvx-row pvx-row--clickable ${d && m === d ? "pvx-row--highlight" : x <= 3 ? "pvx-row--podium" : ""}`,
|
|
755
755
|
onClick: () => i(m),
|
|
756
756
|
children: [
|
|
757
|
-
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(ae, { rank:
|
|
757
|
+
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n(ae, { rank: x, podium: !0 }) }),
|
|
758
758
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary", children: /* @__PURE__ */ n(Q, { userId: m, getUserDisplay: a }) }),
|
|
759
759
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--primary pvx-td--mono", children: A(h.lapTimeMs) }),
|
|
760
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) }),
|
|
@@ -773,7 +773,7 @@ function vt({ entries: e, isLoading: t, track: r, carId: s, getUserDisplay: a, o
|
|
|
773
773
|
] });
|
|
774
774
|
}
|
|
775
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:
|
|
776
|
+
const { data: c, driverName: u, theoreticalBest: g, isLoading: f } = Ge(e, t.id, t.layout, r, { showInvalid: i, game: s, gameVersion: a }), { displayName: h, avatarUrl: b } = o(e, u), x = S(() => Se(c, !0), [c]), m = S(() => {
|
|
777
777
|
const v = (c == null ? void 0 : c.filter((k) => k.isValid)) || [];
|
|
778
778
|
return v.length ? Math.min(...v.map((k) => k.lapTimeMs)) : null;
|
|
779
779
|
}, [c]), N = [
|
|
@@ -801,16 +801,16 @@ function mt({ userId: e, track: t, carId: r, game: s, gameVersion: a, showInvali
|
|
|
801
801
|
/* @__PURE__ */ n("span", { children: "Show invalid laps" })
|
|
802
802
|
] })
|
|
803
803
|
] }),
|
|
804
|
-
|
|
804
|
+
g && /* @__PURE__ */ l("div", { className: "pvx-theoretical-best", children: [
|
|
805
805
|
/* @__PURE__ */ n("span", { className: "pvx-theoretical-best-label", children: "Theoretical Best:" }),
|
|
806
|
-
/* @__PURE__ */ n("span", { className: "pvx-theoretical-best-time", children: A(
|
|
806
|
+
/* @__PURE__ */ n("span", { className: "pvx-theoretical-best-time", children: A(g.lapTimeMs) }),
|
|
807
807
|
/* @__PURE__ */ l("span", { className: "pvx-theoretical-best-sectors", children: [
|
|
808
808
|
"(",
|
|
809
|
-
P(
|
|
809
|
+
P(g.sector1Ms),
|
|
810
810
|
" + ",
|
|
811
|
-
P(
|
|
811
|
+
P(g.sector2Ms),
|
|
812
812
|
" + ",
|
|
813
|
-
P(
|
|
813
|
+
P(g.sector3Ms),
|
|
814
814
|
")"
|
|
815
815
|
] })
|
|
816
816
|
] }),
|
|
@@ -828,7 +828,7 @@ function mt({ userId: e, track: t, carId: r, game: s, gameVersion: a, showInvali
|
|
|
828
828
|
/* @__PURE__ */ n("th", { className: "pvx-th pvx-hidden-below-xl", children: "Date" })
|
|
829
829
|
] }) }),
|
|
830
830
|
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: c.map((v, k) => {
|
|
831
|
-
const y = v.isValid && v.lapTimeMs === m, L =
|
|
831
|
+
const y = v.isValid && v.lapTimeMs === m, L = x && v.isValid && v.sector1Ms === x.s1, D = x && v.isValid && v.sector2Ms === x.s2, w = x && v.isValid && v.sector3Ms === x.s3;
|
|
832
832
|
let U = "pvx-row";
|
|
833
833
|
return v.isValid || (U += " pvx-row--invalid"), y && (U += " pvx-row--personal-best"), /* @__PURE__ */ l("tr", { className: U, children: [
|
|
834
834
|
/* @__PURE__ */ n("td", { className: "pvx-td", children: /* @__PURE__ */ n("span", { className: `pvx-rank ${y ? "pvx-rank--gold" : ""}`, children: k + 1 }) }),
|
|
@@ -863,7 +863,7 @@ function xt({ drivers: e, isLoading: t, getUserDisplay: r, game: s, gameVersion:
|
|
|
863
863
|
if (t) return /* @__PURE__ */ n(K, {});
|
|
864
864
|
if (!(e != null && e.length))
|
|
865
865
|
return /* @__PURE__ */ n("div", { className: "pvx-card", children: /* @__PURE__ */ n(V, { message: "Not enough data for rankings yet." }) });
|
|
866
|
-
const
|
|
866
|
+
const g = 5;
|
|
867
867
|
return /* @__PURE__ */ l("div", { className: "pvx-card", children: [
|
|
868
868
|
/* @__PURE__ */ l("div", { className: "pvx-card-header pvx-rankings-header", children: [
|
|
869
869
|
/* @__PURE__ */ n("h2", { className: "pvx-card-title", children: "Driver Rankings" }),
|
|
@@ -897,7 +897,7 @@ function xt({ drivers: e, isLoading: t, getUserDisplay: r, game: s, gameVersion:
|
|
|
897
897
|
getUserDisplay: r,
|
|
898
898
|
isExpanded: h,
|
|
899
899
|
onToggle: () => c(h ? null : f.identifier),
|
|
900
|
-
colCount:
|
|
900
|
+
colCount: g,
|
|
901
901
|
game: s,
|
|
902
902
|
gameVersion: a,
|
|
903
903
|
onComboSelect: i
|
|
@@ -929,7 +929,7 @@ function sn({ driver: e, getUserDisplay: t, isExpanded: r, onToggle: s, colCount
|
|
|
929
929
|
}
|
|
930
930
|
),
|
|
931
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
|
|
932
|
+
const g = c.layout ? `${c.trackId}|${c.layout}` : c.trackId, f = d ? () => d({ track: g, car: c.carId, highlight: p, game: i, gameVersion: o }) : void 0;
|
|
933
933
|
return /* @__PURE__ */ l(
|
|
934
934
|
"div",
|
|
935
935
|
{
|
|
@@ -1107,7 +1107,7 @@ function ft({ competitions: e, isLoading: t, onSelect: r, onRegister: s, classNa
|
|
|
1107
1107
|
}
|
|
1108
1108
|
function gn({ comp: e, onSelect: t, onRegister: r }) {
|
|
1109
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,
|
|
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, g = /* @__PURE__ */ new Date(), f = (v = e.rounds) == null ? void 0 : v.find((L) => L.startTime && new Date(L.startTime) >= g), h = ((k = e.rounds) == null ? void 0 : k.length) || 0, b = ((y = e.rounds) == null ? void 0 : y.filter((L) => L.isFinalized).length) || 0, x = Re(e), m = x === "recently-completed" || x === "archived", N = e.type === "championship";
|
|
1111
1111
|
return /* @__PURE__ */ l(
|
|
1112
1112
|
"div",
|
|
1113
1113
|
{
|
|
@@ -1168,7 +1168,7 @@ function gn({ comp: e, onSelect: t, onRegister: r }) {
|
|
|
1168
1168
|
);
|
|
1169
1169
|
}
|
|
1170
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,
|
|
1171
|
+
const { isPowerMode: d } = re(), p = se(e), { data: c } = te(e), u = (c == null ? void 0 : c.isRegistered) || !1, g = i ? a / i * 100 : 0, f = g >= 100 ? "full" : g >= 75 ? "warning" : "ok";
|
|
1172
1172
|
return /* @__PURE__ */ l("div", { className: "pvx-comp-card-reg", children: [
|
|
1173
1173
|
/* @__PURE__ */ n("div", { className: "pvx-comp-card-reg-info", children: /* @__PURE__ */ l("span", { className: `pvx-reg-capacity pvx-reg-capacity--${f}`, children: [
|
|
1174
1174
|
a,
|
|
@@ -1282,12 +1282,12 @@ function yn({ driver: e, finalizedRounds: t }) {
|
|
|
1282
1282
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-hidden-below-sm", children: i || "-" }),
|
|
1283
1283
|
/* @__PURE__ */ n("td", { className: "pvx-td pvx-td--center pvx-standings-total", children: e.totalPoints }),
|
|
1284
1284
|
t.map((c) => {
|
|
1285
|
-
const u = s.get(c.roundNumber),
|
|
1285
|
+
const u = s.get(c.roundNumber), g = u == null ? void 0 : u.dropped;
|
|
1286
1286
|
return /* @__PURE__ */ n(
|
|
1287
1287
|
"td",
|
|
1288
1288
|
{
|
|
1289
|
-
className: `pvx-td pvx-td--center pvx-hidden-below-md ${!
|
|
1290
|
-
children: u ? /* @__PURE__ */ l("div", { className: `pvx-standings-round-cell ${
|
|
1289
|
+
className: `pvx-td pvx-td--center pvx-hidden-below-md ${!g && (u == null ? void 0 : u.position) === 1 ? "pvx-standings-cell--p1" : !g && (u == null ? void 0 : u.position) === 2 ? "pvx-standings-cell--p2" : !g && (u == null ? void 0 : u.position) === 3 ? "pvx-standings-cell--p3" : ""}`,
|
|
1290
|
+
children: u ? /* @__PURE__ */ l("div", { className: `pvx-standings-round-cell ${g ? "pvx-standings-round-cell--dropped" : ""}`, children: [
|
|
1291
1291
|
/* @__PURE__ */ l("span", { className: "pvx-standings-round-pos", children: [
|
|
1292
1292
|
"P",
|
|
1293
1293
|
u.position
|
|
@@ -1331,7 +1331,7 @@ function Nt({ competitionId: e, roundNumber: t, className: r }) {
|
|
|
1331
1331
|
] });
|
|
1332
1332
|
}
|
|
1333
1333
|
function de({ round: e, competitionId: t, className: r }) {
|
|
1334
|
-
var u,
|
|
1334
|
+
var u, g, f, h;
|
|
1335
1335
|
const [s, a] = M(null), i = (e == null ? void 0 : e.sessions) || [];
|
|
1336
1336
|
if (!i.length)
|
|
1337
1337
|
return /* @__PURE__ */ n(I, { message: "No session data for this round." });
|
|
@@ -1339,7 +1339,7 @@ function de({ round: e, competitionId: t, className: r }) {
|
|
|
1339
1339
|
t,
|
|
1340
1340
|
e == null ? void 0 : e.roundNumber,
|
|
1341
1341
|
{}
|
|
1342
|
-
), d = s || ((u = i.find((b) => b.type === "RACE")) == null ? void 0 : u.type) || ((
|
|
1342
|
+
), d = s || ((u = i.find((b) => b.type === "RACE")) == null ? void 0 : u.type) || ((g = i[0]) == null ? void 0 : g.type), p = i.find((b) => b.type === d) || i[0], c = ((h = (f = o == null ? void 0 : o.sessions) == null ? void 0 : f.find((b) => b.type === d)) == null ? void 0 : h.drivers) || null;
|
|
1343
1343
|
return /* @__PURE__ */ l("div", { className: r || "", children: [
|
|
1344
1344
|
/* @__PURE__ */ n(
|
|
1345
1345
|
cn,
|
|
@@ -1372,7 +1372,7 @@ function kn({ session: e, sessionLaps: t }) {
|
|
|
1372
1372
|
] }) }),
|
|
1373
1373
|
/* @__PURE__ */ n("tbody", { className: "pvx-tbody", children: e.results.map((p, c) => {
|
|
1374
1374
|
var f;
|
|
1375
|
-
const u = (f = t == null ? void 0 : t[p.driverId]) == null ? void 0 : f.laps,
|
|
1375
|
+
const u = (f = t == null ? void 0 : t[p.driverId]) == null ? void 0 : f.laps, g = s === p.driverId && !!u;
|
|
1376
1376
|
return /* @__PURE__ */ n(
|
|
1377
1377
|
wn,
|
|
1378
1378
|
{
|
|
@@ -1381,9 +1381,9 @@ function kn({ session: e, sessionLaps: t }) {
|
|
|
1381
1381
|
fastestSplits: i,
|
|
1382
1382
|
rowIndex: c,
|
|
1383
1383
|
hasLapDetail: !!u,
|
|
1384
|
-
isExpanded:
|
|
1385
|
-
onToggle: () => a(
|
|
1386
|
-
driverLaps:
|
|
1384
|
+
isExpanded: g,
|
|
1385
|
+
onToggle: () => a(g ? null : p.driverId),
|
|
1386
|
+
driverLaps: g ? u : null,
|
|
1387
1387
|
colCount: o
|
|
1388
1388
|
},
|
|
1389
1389
|
p.driverId || c
|
|
@@ -1508,18 +1508,18 @@ function yt({
|
|
|
1508
1508
|
className: r,
|
|
1509
1509
|
children: s
|
|
1510
1510
|
}) {
|
|
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,
|
|
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, g = i || p.isPending || c.isPending, f = p.error || c.error || null, h = () => {
|
|
1512
1512
|
o && p.mutate(t || {});
|
|
1513
1513
|
}, b = () => {
|
|
1514
1514
|
o && c.mutate();
|
|
1515
1515
|
};
|
|
1516
|
-
return typeof s == "function" ? s({ isRegistered: u, isLoading:
|
|
1516
|
+
return typeof s == "function" ? s({ isRegistered: u, isLoading: g, register: h, withdraw: b, error: f, isPowerMode: o, registrationUrl: d }) : o ? /* @__PURE__ */ n(
|
|
1517
1517
|
"button",
|
|
1518
1518
|
{
|
|
1519
1519
|
className: `pvx-comp-register-btn ${r || ""}`,
|
|
1520
1520
|
onClick: u ? b : h,
|
|
1521
|
-
disabled:
|
|
1522
|
-
children:
|
|
1521
|
+
disabled: g,
|
|
1522
|
+
children: g ? "Loading..." : u ? "Withdraw" : "Register"
|
|
1523
1523
|
}
|
|
1524
1524
|
) : /* @__PURE__ */ n(
|
|
1525
1525
|
"a",
|
|
@@ -1533,12 +1533,12 @@ function yt({
|
|
|
1533
1533
|
);
|
|
1534
1534
|
}
|
|
1535
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),
|
|
1536
|
+
const { getSteamId: a } = C(), { isPowerMode: i } = re(), o = se(e), { data: d, isLoading: p } = te(e), { data: c, isLoading: u } = ye(e), g = ke(e), f = we(e), h = a(), b = (d == null ? void 0 : d.isRegistered) || !1, x = (c == null ? void 0 : c.drivers) || (c == null ? void 0 : c.entries) || [], m = t || {}, N = x.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
1537
|
return p || u ? /* @__PURE__ */ n(q, { message: "Loading registration..." }) : b ? /* @__PURE__ */ n("div", { className: `pvx-reg-panel ${s || ""}`, children: /* @__PURE__ */ n(
|
|
1538
1538
|
Tn,
|
|
1539
1539
|
{
|
|
1540
1540
|
competitionId: e,
|
|
1541
|
-
drivers:
|
|
1541
|
+
drivers: x,
|
|
1542
1542
|
steamId: h,
|
|
1543
1543
|
isPowerMode: i,
|
|
1544
1544
|
registrationUrl: o,
|
|
@@ -1550,12 +1550,12 @@ function kt({ competitionId: e, registration: t, onWithdrawSuccess: r, className
|
|
|
1550
1550
|
Sn,
|
|
1551
1551
|
{
|
|
1552
1552
|
competitionId: e,
|
|
1553
|
-
registerMutation:
|
|
1553
|
+
registerMutation: g,
|
|
1554
1554
|
registration: m
|
|
1555
1555
|
}
|
|
1556
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
1557
|
/* @__PURE__ */ n("div", { className: "pvx-reg-status-msg", children: v ? "Registration is full." : k ? "Registration deadline has passed." : "Registration is closed." }),
|
|
1558
|
-
|
|
1558
|
+
x.length > 0 && /* @__PURE__ */ n(De, { drivers: x, steamId: h })
|
|
1559
1559
|
] });
|
|
1560
1560
|
}
|
|
1561
1561
|
function Sn({ competitionId: e, registerMutation: t, registration: r }) {
|
|
@@ -1565,11 +1565,11 @@ function Sn({ competitionId: e, registerMutation: t, registration: r }) {
|
|
|
1565
1565
|
experience: i,
|
|
1566
1566
|
comments: d || void 0
|
|
1567
1567
|
});
|
|
1568
|
-
}, u = r || {},
|
|
1568
|
+
}, u = r || {}, g = u.currentCount || 0, f = u.maxParticipants;
|
|
1569
1569
|
return /* @__PURE__ */ l("form", { className: "pvx-reg-form", onSubmit: c, children: [
|
|
1570
1570
|
/* @__PURE__ */ l("div", { className: "pvx-reg-form-header", children: [
|
|
1571
1571
|
/* @__PURE__ */ n("h3", { className: "pvx-reg-form-title", children: "Register" }),
|
|
1572
|
-
f && /* @__PURE__ */ n(Me, { count:
|
|
1572
|
+
f && /* @__PURE__ */ n(Me, { count: g, max: f })
|
|
1573
1573
|
] }),
|
|
1574
1574
|
t.error && /* @__PURE__ */ n("div", { className: "pvx-reg-error", children: t.error.message || "Registration failed" }),
|
|
1575
1575
|
/* @__PURE__ */ l("div", { className: "pvx-reg-field", children: [
|
|
@@ -1641,7 +1641,7 @@ function Tn({ competitionId: e, drivers: t, steamId: r, isPowerMode: s, registra
|
|
|
1641
1641
|
c(!1), o && o();
|
|
1642
1642
|
}
|
|
1643
1643
|
});
|
|
1644
|
-
},
|
|
1644
|
+
}, g = d || {}, f = t.length || g.currentCount || 0, h = g.maxParticipants;
|
|
1645
1645
|
return /* @__PURE__ */ l(F, { children: [
|
|
1646
1646
|
/* @__PURE__ */ l("div", { className: "pvx-reg-form-header", children: [
|
|
1647
1647
|
/* @__PURE__ */ n("h3", { className: "pvx-reg-form-title", children: "Registered Drivers" }),
|
|
@@ -1731,7 +1731,7 @@ function wt({ competitionId: e, className: t }) {
|
|
|
1731
1731
|
), { data: c = [], isLoading: u } = Je(
|
|
1732
1732
|
e,
|
|
1733
1733
|
p
|
|
1734
|
-
),
|
|
1734
|
+
), g = i && c.length > 0 ? c[0] : null, f = (g == null ? void 0 : g.sessions) || [], h = i ? "leaderboard" : a ? "standings" : p.length > 0 ? `round-${p[p.length - 1]}` : null, [b, x] = M(null), m = b || h;
|
|
1735
1735
|
if (s || u)
|
|
1736
1736
|
return /* @__PURE__ */ n(q, { message: "Loading results..." });
|
|
1737
1737
|
if (!r)
|
|
@@ -1756,7 +1756,7 @@ function wt({ competitionId: e, className: t }) {
|
|
|
1756
1756
|
"button",
|
|
1757
1757
|
{
|
|
1758
1758
|
className: `pvx-results-tab ${m === y.id ? "pvx-results-tab--active" : ""}`,
|
|
1759
|
-
onClick: () =>
|
|
1759
|
+
onClick: () => x(y.id),
|
|
1760
1760
|
title: y.track || void 0,
|
|
1761
1761
|
children: [
|
|
1762
1762
|
/* @__PURE__ */ n("span", { className: "pvx-results-tab-label", children: y.label }),
|
|
@@ -1769,7 +1769,7 @@ function wt({ competitionId: e, className: t }) {
|
|
|
1769
1769
|
Dn,
|
|
1770
1770
|
{
|
|
1771
1771
|
session: f.find((y) => `session-${y.type}` === m),
|
|
1772
|
-
round:
|
|
1772
|
+
round: g,
|
|
1773
1773
|
competitionId: e
|
|
1774
1774
|
}
|
|
1775
1775
|
) : k ? /* @__PURE__ */ n($n, { round: k, competitionId: e }) : /* @__PURE__ */ n(I, { message: "No results for this round." })
|
|
@@ -1942,12 +1942,12 @@ function In(e) {
|
|
|
1942
1942
|
{ data: a.data, game: "evo", label: "EVO" },
|
|
1943
1943
|
{ data: i.data, game: "acc", label: "ACC" },
|
|
1944
1944
|
{ data: o.data, game: "lmu", label: "LMU" }
|
|
1945
|
-
].map(({ data: u, game:
|
|
1946
|
-
var
|
|
1947
|
-
if (!((
|
|
1945
|
+
].map(({ data: u, game: g, label: f }) => {
|
|
1946
|
+
var x;
|
|
1947
|
+
if (!((x = u == null ? void 0 : u.drivers) != null && x.length)) return null;
|
|
1948
1948
|
const h = [...u.drivers].sort((m, N) => N.rating - m.rating), b = h.findIndex((m) => m.identifier === e);
|
|
1949
1949
|
return b === -1 ? null : {
|
|
1950
|
-
game:
|
|
1950
|
+
game: g,
|
|
1951
1951
|
label: f,
|
|
1952
1952
|
rating: h[b].rating,
|
|
1953
1953
|
rank: b + 1,
|
|
@@ -1973,11 +1973,11 @@ function Pn() {
|
|
|
1973
1973
|
staleTime: 6e4
|
|
1974
1974
|
}))
|
|
1975
1975
|
}), c = p.some((h) => h.isLoading), u = S(() => {
|
|
1976
|
-
var
|
|
1976
|
+
var x, m;
|
|
1977
1977
|
if (!i || !a || c) return [];
|
|
1978
1978
|
const h = /* @__PURE__ */ new Date(), b = [];
|
|
1979
1979
|
for (let N = 0; N < i.length; N++) {
|
|
1980
|
-
const v = i[N], k = (
|
|
1980
|
+
const v = i[N], k = (x = p[N]) == null ? void 0 : x.data;
|
|
1981
1981
|
if (!((m = k == null ? void 0 : k.drivers) == null ? void 0 : m.some((w) => w.steamId === a))) continue;
|
|
1982
1982
|
const L = v.type === "hotlap", D = v.rounds || [];
|
|
1983
1983
|
for (const w of D) {
|
|
@@ -1998,7 +1998,7 @@ function Pn() {
|
|
|
1998
1998
|
const k = N.dediStatus === "running" || N.dediStatus === "provisioning", y = v.dediStatus === "running" || v.dediStatus === "provisioning";
|
|
1999
1999
|
return k && !y ? -1 : !k && y ? 1 : new Date(N.startTime) - new Date(v.startTime);
|
|
2000
2000
|
}), b.length > 0 && (b[0].isNext = !0), b;
|
|
2001
|
-
}, [i, a, c, p]),
|
|
2001
|
+
}, [i, a, c, p]), g = pe({
|
|
2002
2002
|
queries: u.map((h) => ({
|
|
2003
2003
|
queryKey: ["pitvox", "serverInfo", h.competitionId, h.roundNumber],
|
|
2004
2004
|
queryFn: () => s(h.competitionId, h.roundNumber),
|
|
@@ -2011,13 +2011,13 @@ function Pn() {
|
|
|
2011
2011
|
return {
|
|
2012
2012
|
data: S(() => u.length ? s ? u.map((h, b) => {
|
|
2013
2013
|
var m;
|
|
2014
|
-
const
|
|
2015
|
-
return
|
|
2014
|
+
const x = (m = g[b]) == null ? void 0 : m.data;
|
|
2015
|
+
return x != null && x.success ? {
|
|
2016
2016
|
...h,
|
|
2017
|
-
serverAddress:
|
|
2018
|
-
serverPassword:
|
|
2017
|
+
serverAddress: x.serverAddress || null,
|
|
2018
|
+
serverPassword: x.serverPassword || null
|
|
2019
2019
|
} : h;
|
|
2020
|
-
}) : u : [], [u, s,
|
|
2020
|
+
}) : u : [], [u, s, g]),
|
|
2021
2021
|
isLoading: o || !!a && c
|
|
2022
2022
|
};
|
|
2023
2023
|
}
|
|
@@ -2129,12 +2129,12 @@ function ve({ icon: e, value: t, label: r, items: s, labelKey: a, countKey: i })
|
|
|
2129
2129
|
const [o, d] = M(!1), p = Ee(null);
|
|
2130
2130
|
qe(() => {
|
|
2131
2131
|
if (!o) return;
|
|
2132
|
-
function u(
|
|
2133
|
-
p.current && !p.current.contains(
|
|
2132
|
+
function u(g) {
|
|
2133
|
+
p.current && !p.current.contains(g.target) && d(!1);
|
|
2134
2134
|
}
|
|
2135
2135
|
return document.addEventListener("mousedown", u), () => document.removeEventListener("mousedown", u);
|
|
2136
2136
|
}, [o]);
|
|
2137
|
-
const c = s != null && s.length ? s.slice().sort((u,
|
|
2137
|
+
const c = s != null && s.length ? s.slice().sort((u, g) => g[i] - u[i]) : null;
|
|
2138
2138
|
return /* @__PURE__ */ l(
|
|
2139
2139
|
"div",
|
|
2140
2140
|
{
|
|
@@ -2147,10 +2147,10 @@ function ve({ icon: e, value: t, label: r, items: s, labelKey: a, countKey: i })
|
|
|
2147
2147
|
/* @__PURE__ */ n("span", { className: "pvx-dash-stat-value", children: t }),
|
|
2148
2148
|
/* @__PURE__ */ n("span", { className: "pvx-dash-stat-label", children: r })
|
|
2149
2149
|
] }),
|
|
2150
|
-
c && /* @__PURE__ */ n("div", { className: `pvx-dash-tooltip pvx-dash-tooltip--scrollable ${o ? "pvx-dash-tooltip--open" : ""}`, children: c.map((u,
|
|
2150
|
+
c && /* @__PURE__ */ n("div", { className: `pvx-dash-tooltip pvx-dash-tooltip--scrollable ${o ? "pvx-dash-tooltip--open" : ""}`, children: c.map((u, g) => /* @__PURE__ */ l("div", { className: "pvx-dash-tooltip-row", children: [
|
|
2151
2151
|
/* @__PURE__ */ n("span", { className: "pvx-dash-tooltip-label", children: u[a] }),
|
|
2152
2152
|
/* @__PURE__ */ n("span", { className: "pvx-dash-tooltip-value", children: u[i] })
|
|
2153
|
-
] },
|
|
2153
|
+
] }, g)) })
|
|
2154
2154
|
]
|
|
2155
2155
|
}
|
|
2156
2156
|
);
|
|
@@ -2198,8 +2198,8 @@ function Vn({ stats: e, gameRatings: t, onGameRatingSelect: r, rating: s, classN
|
|
|
2198
2198
|
{
|
|
2199
2199
|
className: `pvx-dash-rating-chip${c ? " pvx-dash-rating-chip--clickable" : ""}`,
|
|
2200
2200
|
onClick: c ? () => r(p) : void 0,
|
|
2201
|
-
onKeyDown: c ? (
|
|
2202
|
-
c && (
|
|
2201
|
+
onKeyDown: c ? (g) => {
|
|
2202
|
+
c && (g.key === "Enter" || g.key === " ") && (g.preventDefault(), r(p));
|
|
2203
2203
|
} : void 0,
|
|
2204
2204
|
role: c ? "button" : void 0,
|
|
2205
2205
|
tabIndex: c ? 0 : void 0,
|
|
@@ -2535,16 +2535,17 @@ function St({
|
|
|
2535
2535
|
steamId: e,
|
|
2536
2536
|
avatarUrl: t,
|
|
2537
2537
|
memberSince: r,
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2538
|
+
hideProfile: s = !1,
|
|
2539
|
+
onComboSelect: a,
|
|
2540
|
+
onGameRatingSelect: i,
|
|
2541
|
+
className: o = ""
|
|
2541
2542
|
}) {
|
|
2542
|
-
const { data:
|
|
2543
|
-
return
|
|
2544
|
-
/* @__PURE__ */ n(
|
|
2543
|
+
const { data: d, isLoading: p, error: c } = Mn(e), { data: u } = In(e), { data: g } = Bn(e), { data: f, isLoading: h } = Pn(), b = An(), { data: x, isLoading: m } = Un({ limit: 10 }), N = Fn(), v = En();
|
|
2544
|
+
return p ? /* @__PURE__ */ n("div", { className: "pvx-loading", children: "Loading dashboard..." }) : c ? /* @__PURE__ */ n("div", { className: "pvx-empty", children: "Failed to load dashboard data." }) : d ? /* @__PURE__ */ l("div", { className: `pvx-dash ${o}`, children: [
|
|
2545
|
+
!s && /* @__PURE__ */ n(
|
|
2545
2546
|
qn,
|
|
2546
2547
|
{
|
|
2547
|
-
driverName:
|
|
2548
|
+
driverName: d.driverName,
|
|
2548
2549
|
avatarUrl: t,
|
|
2549
2550
|
memberSince: r
|
|
2550
2551
|
}
|
|
@@ -2552,22 +2553,22 @@ function St({
|
|
|
2552
2553
|
/* @__PURE__ */ n(
|
|
2553
2554
|
Vn,
|
|
2554
2555
|
{
|
|
2555
|
-
stats:
|
|
2556
|
-
gameRatings:
|
|
2557
|
-
onGameRatingSelect:
|
|
2556
|
+
stats: d,
|
|
2557
|
+
gameRatings: u,
|
|
2558
|
+
onGameRatingSelect: i
|
|
2558
2559
|
}
|
|
2559
2560
|
),
|
|
2560
|
-
e && /* @__PURE__ */ n(Wn, { events:
|
|
2561
|
-
/* @__PURE__ */ l("div", { className: `pvx-dash-row ${
|
|
2562
|
-
/* @__PURE__ */ n(Kn, { combos:
|
|
2563
|
-
|
|
2561
|
+
e && /* @__PURE__ */ n(Wn, { events: f, isLoading: h }),
|
|
2562
|
+
/* @__PURE__ */ l("div", { className: `pvx-dash-row ${b ? "pvx-dash-row--2col" : ""}`, children: [
|
|
2563
|
+
/* @__PURE__ */ n(Kn, { combos: g, onComboSelect: a }),
|
|
2564
|
+
b && /* @__PURE__ */ n(
|
|
2564
2565
|
Xn,
|
|
2565
2566
|
{
|
|
2566
|
-
notifications:
|
|
2567
|
-
unreadCount: (
|
|
2568
|
-
onMarkRead: (
|
|
2569
|
-
onMarkAllRead: () =>
|
|
2570
|
-
isLoading:
|
|
2567
|
+
notifications: x == null ? void 0 : x.notifications,
|
|
2568
|
+
unreadCount: (x == null ? void 0 : x.unreadCount) || 0,
|
|
2569
|
+
onMarkRead: (k) => N.mutate(k),
|
|
2570
|
+
onMarkAllRead: () => v.mutate(),
|
|
2571
|
+
isLoading: m
|
|
2571
2572
|
}
|
|
2572
2573
|
)
|
|
2573
2574
|
] })
|