@sensiblestats/widget-react 0.128.1 → 0.129.0
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/CHANGELOG.md +6 -0
- package/dist/index.cjs +232 -171
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +232 -171
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -897,19 +897,69 @@ var formatTime = (when, tag2, clock3, opts) => formatDate(when, tag2, { ...clock
|
|
|
897
897
|
var clockOf = (ui) => ui.clock ?? "24h";
|
|
898
898
|
var formatFixed = (n, tag2, digits) => formatNumber(n, tag2, { minimumFractionDigits: digits, maximumFractionDigits: digits });
|
|
899
899
|
|
|
900
|
+
// src/zone.ts
|
|
901
|
+
var DAY_MS = 864e5;
|
|
902
|
+
var formatters = /* @__PURE__ */ new Map();
|
|
903
|
+
var formatterFor = (timeZone) => {
|
|
904
|
+
let f = formatters.get(timeZone);
|
|
905
|
+
if (!f) {
|
|
906
|
+
f = new Intl.DateTimeFormat(BUNDLED_TAG, {
|
|
907
|
+
timeZone,
|
|
908
|
+
year: "numeric",
|
|
909
|
+
month: "2-digit",
|
|
910
|
+
day: "2-digit",
|
|
911
|
+
hour: "2-digit",
|
|
912
|
+
minute: "2-digit",
|
|
913
|
+
second: "2-digit",
|
|
914
|
+
hourCycle: "h23"
|
|
915
|
+
});
|
|
916
|
+
formatters.set(timeZone, f);
|
|
917
|
+
}
|
|
918
|
+
return f;
|
|
919
|
+
};
|
|
920
|
+
function validZone(timeZone) {
|
|
921
|
+
if (typeof timeZone !== "string" || timeZone.trim() === "") return void 0;
|
|
922
|
+
const zone = timeZone.trim();
|
|
923
|
+
try {
|
|
924
|
+
new Intl.DateTimeFormat("en", { timeZone: zone });
|
|
925
|
+
return zone;
|
|
926
|
+
} catch {
|
|
927
|
+
return void 0;
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
function zonedParts(ms, timeZone) {
|
|
931
|
+
const out = { year: NaN, month: NaN, day: NaN, hour: NaN, minute: NaN, second: NaN };
|
|
932
|
+
if (Number.isNaN(ms)) return out;
|
|
933
|
+
if (timeZone === void 0) {
|
|
934
|
+
const d = new Date(ms);
|
|
935
|
+
return { year: d.getFullYear(), month: d.getMonth() + 1, day: d.getDate(), hour: d.getHours(), minute: d.getMinutes(), second: d.getSeconds() };
|
|
936
|
+
}
|
|
937
|
+
for (const p of formatterFor(timeZone).formatToParts(ms)) {
|
|
938
|
+
if (p.type in out) out[p.type] = Number(p.value);
|
|
939
|
+
}
|
|
940
|
+
return out;
|
|
941
|
+
}
|
|
942
|
+
function zonedDayNumber(ms, timeZone) {
|
|
943
|
+
const p = zonedParts(ms, timeZone);
|
|
944
|
+
return Date.UTC(p.year, p.month - 1, p.day) / DAY_MS;
|
|
945
|
+
}
|
|
946
|
+
function zoneOffsetMinutes(ms, timeZone) {
|
|
947
|
+
const p = zonedParts(ms, timeZone);
|
|
948
|
+
const wall = Date.UTC(p.year, p.month - 1, p.day, p.hour, p.minute, p.second);
|
|
949
|
+
return Math.round((wall - Math.floor(ms / 1e3) * 1e3) / 6e4);
|
|
950
|
+
}
|
|
951
|
+
|
|
900
952
|
// src/kickoff.ts
|
|
901
|
-
function formatBettingKickoff(kickoffUtc, ui, tag2, clock3 = "24h", now = /* @__PURE__ */ new Date()) {
|
|
953
|
+
function formatBettingKickoff(kickoffUtc, ui, tag2, clock3 = "24h", now = /* @__PURE__ */ new Date(), timeZone) {
|
|
902
954
|
const at2 = new Date(kickoffUtc);
|
|
903
|
-
const time = formatTime(at2, tag2, clock3);
|
|
904
|
-
const
|
|
905
|
-
const
|
|
906
|
-
const dayDiff = Math.round((atLocalDate.getTime() - nowLocalDate.getTime()) / 864e5);
|
|
907
|
-
const dayLabel = dayDiff === 0 ? ui.today : dayDiff === 1 ? ui.tomorrow : formatDate(at2, tag2, { weekday: "short", day: "numeric", month: "short" });
|
|
955
|
+
const time = formatTime(at2, tag2, clock3, { timeZone });
|
|
956
|
+
const dayDiff = zonedDayNumber(at2.getTime(), timeZone) - zonedDayNumber(now.getTime(), timeZone);
|
|
957
|
+
const dayLabel = dayDiff === 0 ? ui.today : dayDiff === 1 ? ui.tomorrow : formatDate(at2, tag2, { weekday: "short", day: "numeric", month: "short", timeZone });
|
|
908
958
|
return { dayLabel, time };
|
|
909
959
|
}
|
|
910
960
|
|
|
911
961
|
// src/nbaFormDay.ts
|
|
912
|
-
var
|
|
962
|
+
var DAY_MS2 = 864e5;
|
|
913
963
|
var ISO_DATE = /^\d{4}-\d{2}-\d{2}$/;
|
|
914
964
|
function utcMs(etDate) {
|
|
915
965
|
if (!ISO_DATE.test(etDate)) return null;
|
|
@@ -921,7 +971,7 @@ function formDay(etDate, anchorEtDate, tag2) {
|
|
|
921
971
|
const at2 = utcMs(etDate);
|
|
922
972
|
if (at2 === null) return etDate;
|
|
923
973
|
const anchor = utcMs(anchorEtDate);
|
|
924
|
-
const days = anchor === null ? Infinity : Math.abs(Math.round((at2 - anchor) /
|
|
974
|
+
const days = anchor === null ? Infinity : Math.abs(Math.round((at2 - anchor) / DAY_MS2));
|
|
925
975
|
const options = days <= 6 ? { weekday: "short", timeZone: "UTC" } : { day: "numeric", month: "short", timeZone: "UTC" };
|
|
926
976
|
return formatDate(at2, tag2, options);
|
|
927
977
|
}
|
|
@@ -977,13 +1027,13 @@ var shortDate = (tag2, ms, opts) => nbsp(formatDate(ms, tag2, opts).replace("Sep
|
|
|
977
1027
|
var signed = (line) => line.replace(/^-/, "\u2212");
|
|
978
1028
|
var decimalMark = (tag2) => new Intl.NumberFormat(tag2).formatToParts(1.1).find((p) => p.type === "decimal")?.value ?? ".";
|
|
979
1029
|
var INTL_LEAVES = {
|
|
980
|
-
chartTimeLabel: (c) => (ms) => formatDate(ms, c.tag, { day: "numeric", month: "short", ...clockFields(c.clock) }),
|
|
981
|
-
logShortDate: (c) => (ms) => shortDate(c.tag, ms, { day: "numeric", month: "short" }),
|
|
1030
|
+
chartTimeLabel: (c) => (ms) => formatDate(ms, c.tag, { day: "numeric", month: "short", ...clockFields(c.clock), timeZone: c.timeZone }),
|
|
1031
|
+
logShortDate: (c) => (ms) => shortDate(c.tag, ms, { day: "numeric", month: "short", timeZone: c.timeZone }),
|
|
982
1032
|
"games.formatPts": (c) => (n) => formatNumber(n, c.tag),
|
|
983
|
-
"games.formatDayTime": (c) => (iso) => formatDate(iso, c.tag, { weekday: "short", ...clockFields(c.clock) }),
|
|
1033
|
+
"games.formatDayTime": (c) => (iso) => formatDate(iso, c.tag, { weekday: "short", ...clockFields(c.clock), timeZone: c.timeZone }),
|
|
984
1034
|
"nba.lineText": (c) => (line) => signed(line).replace(".", decimalMark(c.tag)),
|
|
985
1035
|
"nba.formDay": (c) => (etDate, anchorEtDate) => formDay(etDate, anchorEtDate, c.tag),
|
|
986
|
-
bettingKickoff: (c) => (kickoffUtc, now) => formatBettingKickoff(kickoffUtc, { today: c.t("widget.today"), tomorrow: c.t("widget.tomorrow") }, c.tag, c.clock, now),
|
|
1036
|
+
bettingKickoff: (c) => (kickoffUtc, now) => formatBettingKickoff(kickoffUtc, { today: c.t("widget.today"), tomorrow: c.t("widget.tomorrow") }, c.tag, c.clock, now, c.timeZone),
|
|
987
1037
|
v8FormResult: (c) => (result) => codeLabel(c.table, "result", result) ?? result
|
|
988
1038
|
};
|
|
989
1039
|
var pairs = (c, key, list) => list.map(([home, away]) => c.t(key, { home, away })).join(", ");
|
|
@@ -1016,7 +1066,7 @@ var ROW_LEAVES = {
|
|
|
1016
1066
|
availabilityNext: (c) => (opponent, isHome, ms) => {
|
|
1017
1067
|
const line = c.t(isHome ? "widget.availabilityNext.home" : "widget.availabilityNext.away", { opponent });
|
|
1018
1068
|
if (ms === null || !(ms > 0)) return line;
|
|
1019
|
-
return c.t("widget.availabilityNext.dated", { text: line, date: shortDate(c.tag, ms, { weekday: "short", day: "numeric", month: "short" }) });
|
|
1069
|
+
return c.t("widget.availabilityNext.dated", { text: line, date: shortDate(c.tag, ms, { weekday: "short", day: "numeric", month: "short", timeZone: c.timeZone }) });
|
|
1020
1070
|
},
|
|
1021
1071
|
availabilityBack: (c) => (ms) => c.t("widget.availabilityBack", { date: shortDate(c.tag, ms, { day: "numeric", month: "short" }) }),
|
|
1022
1072
|
perfRankedAgainst: (c) => (competition, group) => c.t("widget.perfRankedAgainst", { competition, group: codeLabel(c.table, "groupNoun", group) ?? group }),
|
|
@@ -1187,7 +1237,7 @@ function setPath(root, path, value) {
|
|
|
1187
1237
|
node[parts2[parts2.length - 1]] = value;
|
|
1188
1238
|
}
|
|
1189
1239
|
var ownedByLeaf = (key) => key.startsWith("widget.code.") || Object.keys(LEAVES).some((path) => key === `widget.${path}` || key.startsWith(`widget.${path}.`));
|
|
1190
|
-
function buildLocaleStrings(table, tag2, clock3 = "24h") {
|
|
1240
|
+
function buildLocaleStrings(table, tag2, clock3 = "24h", timeZone) {
|
|
1191
1241
|
const root = {};
|
|
1192
1242
|
for (const [key, row] of Object.entries(table)) {
|
|
1193
1243
|
if (key.startsWith("widget.") && typeof row === "string" && !ownedByLeaf(key)) setPath(root, key.slice("widget.".length), row);
|
|
@@ -1195,6 +1245,7 @@ function buildLocaleStrings(table, tag2, clock3 = "24h") {
|
|
|
1195
1245
|
const ctx = {
|
|
1196
1246
|
tag: tag2,
|
|
1197
1247
|
clock: clock3,
|
|
1248
|
+
timeZone,
|
|
1198
1249
|
table,
|
|
1199
1250
|
t: (key, tokens = {}) => fill(table[key] ?? key, tokens, tag2)
|
|
1200
1251
|
};
|
|
@@ -1219,7 +1270,7 @@ function parseOddsFormat(value) {
|
|
|
1219
1270
|
}
|
|
1220
1271
|
|
|
1221
1272
|
// src/version.generated.ts
|
|
1222
|
-
var WIDGET_REACT_VERSION = "0.
|
|
1273
|
+
var WIDGET_REACT_VERSION = "0.129.0";
|
|
1223
1274
|
|
|
1224
1275
|
// src/config.ts
|
|
1225
1276
|
function hostTag(cfg) {
|
|
@@ -1228,7 +1279,8 @@ function hostTag(cfg) {
|
|
|
1228
1279
|
}
|
|
1229
1280
|
var isBundledFamily = (tag2) => sameFamily(tag2, BUNDLED_TAG);
|
|
1230
1281
|
function normalizeUi(cfg, loaded) {
|
|
1231
|
-
const
|
|
1282
|
+
const timeZone = validZone(cfg.timeZone);
|
|
1283
|
+
const strings = buildLocaleStrings(loaded.strings, loaded.tag, loaded.clock, timeZone);
|
|
1232
1284
|
return {
|
|
1233
1285
|
theme: cfg.theme ?? "auto",
|
|
1234
1286
|
oddsFormat: parseOddsFormat(cfg.oddsFormat) ?? "decimal",
|
|
@@ -1237,6 +1289,7 @@ function normalizeUi(cfg, loaded) {
|
|
|
1237
1289
|
headerTitle: cfg.headerTitle,
|
|
1238
1290
|
locale: loaded.tag,
|
|
1239
1291
|
clock: loaded.clock,
|
|
1292
|
+
timeZone,
|
|
1240
1293
|
hostTag: hostTag(cfg),
|
|
1241
1294
|
rawBettingLabels: isBundledFamily(loaded.tag),
|
|
1242
1295
|
cta: cfg.cta,
|
|
@@ -1742,9 +1795,9 @@ function projectSeries(samples) {
|
|
|
1742
1795
|
yMin = pMin - FLAT_DOMAIN_PAD;
|
|
1743
1796
|
yMax = pMax + FLAT_DOMAIN_PAD;
|
|
1744
1797
|
} else {
|
|
1745
|
-
const
|
|
1746
|
-
yMin = pMin -
|
|
1747
|
-
yMax = pMax +
|
|
1798
|
+
const pad = (pMax - pMin) * 0.1;
|
|
1799
|
+
yMin = pMin - pad;
|
|
1800
|
+
yMax = pMax + pad;
|
|
1748
1801
|
}
|
|
1749
1802
|
const x = (atMs) => round2(PLOT_X0 + (atMs - tMin) / (tMax - tMin) * (PLOT_X1 - PLOT_X0));
|
|
1750
1803
|
const y = (price) => round2(PLOT_Y1 - (price - yMin) / (yMax - yMin) * (PLOT_Y1 - PLOT_Y0));
|
|
@@ -3507,12 +3560,12 @@ import { matchKey as matchKey3 } from "@sensiblestats/widget-sdk";
|
|
|
3507
3560
|
var PREFIX2 = "ss-w-schedule:";
|
|
3508
3561
|
var SCHEMA_VERSION = 7;
|
|
3509
3562
|
var TTL_MS3 = 6 * 36e5;
|
|
3510
|
-
function scheduleCacheKey(operatorId, encodedUserKey2, localDate) {
|
|
3511
|
-
return `${PREFIX2}${operatorId}:${encodedUserKey2}:${localDate}`;
|
|
3563
|
+
function scheduleCacheKey(operatorId, encodedUserKey2, localDate, timeZone) {
|
|
3564
|
+
return `${PREFIX2}${operatorId}:${encodedUserKey2}:${timeZone ?? "local"}:${localDate}`;
|
|
3512
3565
|
}
|
|
3513
|
-
function read(operatorId, encodedUserKey2, localDate) {
|
|
3566
|
+
function read(operatorId, encodedUserKey2, localDate, timeZone) {
|
|
3514
3567
|
try {
|
|
3515
|
-
const raw = localStorage.getItem(scheduleCacheKey(operatorId, encodedUserKey2, localDate));
|
|
3568
|
+
const raw = localStorage.getItem(scheduleCacheKey(operatorId, encodedUserKey2, localDate, timeZone));
|
|
3516
3569
|
if (!raw) return null;
|
|
3517
3570
|
const entry = JSON.parse(raw);
|
|
3518
3571
|
if (entry.v !== SCHEMA_VERSION || !entry.payload) return null;
|
|
@@ -3521,13 +3574,13 @@ function read(operatorId, encodedUserKey2, localDate) {
|
|
|
3521
3574
|
return null;
|
|
3522
3575
|
}
|
|
3523
3576
|
}
|
|
3524
|
-
function readSchedule(operatorId, encodedUserKey2, localDate, nowMs) {
|
|
3525
|
-
const entry = read(operatorId, encodedUserKey2, localDate);
|
|
3577
|
+
function readSchedule(operatorId, encodedUserKey2, localDate, nowMs, timeZone) {
|
|
3578
|
+
const entry = read(operatorId, encodedUserKey2, localDate, timeZone);
|
|
3526
3579
|
if (!entry) return null;
|
|
3527
3580
|
return nowMs - entry.at > TTL_MS3 ? null : entry.payload;
|
|
3528
3581
|
}
|
|
3529
|
-
function readScheduleIgnoringTtl(operatorId, encodedUserKey2, localDate) {
|
|
3530
|
-
return read(operatorId, encodedUserKey2, localDate)?.payload ?? null;
|
|
3582
|
+
function readScheduleIgnoringTtl(operatorId, encodedUserKey2, localDate, timeZone) {
|
|
3583
|
+
return read(operatorId, encodedUserKey2, localDate, timeZone)?.payload ?? null;
|
|
3531
3584
|
}
|
|
3532
3585
|
function skeletonOnly(payload) {
|
|
3533
3586
|
return {
|
|
@@ -3566,8 +3619,8 @@ function skeletonOnly(payload) {
|
|
|
3566
3619
|
}))
|
|
3567
3620
|
};
|
|
3568
3621
|
}
|
|
3569
|
-
function writeSchedule(operatorId, encodedUserKey2, localDate, payload, nowMs) {
|
|
3570
|
-
const keep = scheduleCacheKey(operatorId, encodedUserKey2, localDate);
|
|
3622
|
+
function writeSchedule(operatorId, encodedUserKey2, localDate, payload, nowMs, timeZone) {
|
|
3623
|
+
const keep = scheduleCacheKey(operatorId, encodedUserKey2, localDate, timeZone);
|
|
3571
3624
|
const mine = `${PREFIX2}${operatorId}:${encodedUserKey2}:`;
|
|
3572
3625
|
try {
|
|
3573
3626
|
for (let i = localStorage.length - 1; i >= 0; i--) {
|
|
@@ -3579,9 +3632,9 @@ function writeSchedule(operatorId, encodedUserKey2, localDate, payload, nowMs) {
|
|
|
3579
3632
|
} catch {
|
|
3580
3633
|
}
|
|
3581
3634
|
}
|
|
3582
|
-
function clearSchedule(operatorId, encodedUserKey2, localDate) {
|
|
3635
|
+
function clearSchedule(operatorId, encodedUserKey2, localDate, timeZone) {
|
|
3583
3636
|
try {
|
|
3584
|
-
localStorage.removeItem(scheduleCacheKey(operatorId, encodedUserKey2, localDate));
|
|
3637
|
+
localStorage.removeItem(scheduleCacheKey(operatorId, encodedUserKey2, localDate, timeZone));
|
|
3585
3638
|
} catch {
|
|
3586
3639
|
}
|
|
3587
3640
|
}
|
|
@@ -3623,6 +3676,51 @@ function nearestTennisKeys(open) {
|
|
|
3623
3676
|
return [...open.values()].sort((a, b) => a.kickoffUnix - b.kickoffUnix).slice(0, MAX_TENNIS_KEYS).map((e) => e.key);
|
|
3624
3677
|
}
|
|
3625
3678
|
|
|
3679
|
+
// src/scheduleDays.ts
|
|
3680
|
+
var MAX_AFTER_TODAY = 6;
|
|
3681
|
+
var parts = (date) => {
|
|
3682
|
+
const [y = 0, m = 1, d = 1] = date.split("-").map(Number);
|
|
3683
|
+
return [y, m, d];
|
|
3684
|
+
};
|
|
3685
|
+
function offsetOf(localDate, timeZone) {
|
|
3686
|
+
const [y, m, d] = parts(localDate);
|
|
3687
|
+
if (timeZone === void 0) return -new Date(y, m - 1, d, 12).getTimezoneOffset();
|
|
3688
|
+
const utcNoon = Date.UTC(y, m - 1, d, 12);
|
|
3689
|
+
return zoneOffsetMinutes(utcNoon - zoneOffsetMinutes(utcNoon, timeZone) * 6e4, timeZone);
|
|
3690
|
+
}
|
|
3691
|
+
function localDateOfUnix(unix, offsetMinutes = -new Date(unix * 1e3).getTimezoneOffset()) {
|
|
3692
|
+
return new Date((unix + offsetMinutes * 60) * 1e3).toISOString().slice(0, 10);
|
|
3693
|
+
}
|
|
3694
|
+
var dayAfter = (date) => {
|
|
3695
|
+
const [y, m, d] = parts(date);
|
|
3696
|
+
return new Date(Date.UTC(y, m - 1, d + 1)).toISOString().slice(0, 10);
|
|
3697
|
+
};
|
|
3698
|
+
function buildDayChips(today, matchDays, sport) {
|
|
3699
|
+
const dates = /* @__PURE__ */ new Set();
|
|
3700
|
+
for (const md of matchDays) {
|
|
3701
|
+
if (sport !== "all" && md.sport !== sport) continue;
|
|
3702
|
+
for (const date of md.dates) if (date > today) dates.add(date);
|
|
3703
|
+
}
|
|
3704
|
+
const chips = [{ date: today, isToday: true, gapBefore: false }];
|
|
3705
|
+
for (const date of [...dates].sort().slice(0, MAX_AFTER_TODAY)) {
|
|
3706
|
+
const prev = chips[chips.length - 1];
|
|
3707
|
+
chips.push({ date, isToday: false, gapBefore: prev !== void 0 && dayAfter(prev.date) !== date });
|
|
3708
|
+
}
|
|
3709
|
+
return chips;
|
|
3710
|
+
}
|
|
3711
|
+
function weekdayAndDay(date, tag2) {
|
|
3712
|
+
const [y, m, d] = parts(date);
|
|
3713
|
+
const at2 = new Date(Date.UTC(y, m - 1, d, 12));
|
|
3714
|
+
return {
|
|
3715
|
+
weekday: formatDate(at2, tag2, { weekday: "short", timeZone: "UTC" }),
|
|
3716
|
+
day: formatDate(at2, tag2, { day: "numeric", timeZone: "UTC" })
|
|
3717
|
+
};
|
|
3718
|
+
}
|
|
3719
|
+
function weekdayLong(date, tag2) {
|
|
3720
|
+
const [y, m, d] = parts(date);
|
|
3721
|
+
return formatDate(new Date(Date.UTC(y, m - 1, d, 12)), tag2, { weekday: "long", timeZone: "UTC" });
|
|
3722
|
+
}
|
|
3723
|
+
|
|
3626
3724
|
// src/liveClock.ts
|
|
3627
3725
|
import { matchKey as matchKey2 } from "@sensiblestats/widget-sdk";
|
|
3628
3726
|
function isTreatedLive(state, pollStale) {
|
|
@@ -3642,7 +3740,11 @@ var STALE_AFTER_FAILURES = 2;
|
|
|
3642
3740
|
function encodedUserKey(operatorUserId, anonymousUserId) {
|
|
3643
3741
|
return encodeURIComponent(operatorUserId || anonymousUserId || "none");
|
|
3644
3742
|
}
|
|
3645
|
-
function localDateOf(now) {
|
|
3743
|
+
function localDateOf(now, timeZone) {
|
|
3744
|
+
if (timeZone !== void 0) {
|
|
3745
|
+
const p = zonedParts(now.getTime(), timeZone);
|
|
3746
|
+
return `${p.year}-${`${p.month}`.padStart(2, "0")}-${`${p.day}`.padStart(2, "0")}`;
|
|
3747
|
+
}
|
|
3646
3748
|
const y = now.getFullYear();
|
|
3647
3749
|
const m = `${now.getMonth() + 1}`.padStart(2, "0");
|
|
3648
3750
|
const d = `${now.getDate()}`.padStart(2, "0");
|
|
@@ -3668,19 +3770,19 @@ function useMatchDiscovery(opts) {
|
|
|
3668
3770
|
statesRef.current = states;
|
|
3669
3771
|
const getStatesRef = useRef4(opts.getStates);
|
|
3670
3772
|
getStatesRef.current = opts.getStates;
|
|
3671
|
-
const [localDate, setLocalDate] = useState4(() => localDateOf(/* @__PURE__ */ new Date()));
|
|
3773
|
+
const [localDate, setLocalDate] = useState4(() => localDateOf(/* @__PURE__ */ new Date(), opts.timeZone));
|
|
3672
3774
|
useEffect5(() => {
|
|
3673
3775
|
const id = setInterval(() => {
|
|
3674
|
-
const next = localDateOf(/* @__PURE__ */ new Date());
|
|
3776
|
+
const next = localDateOf(/* @__PURE__ */ new Date(), opts.timeZone);
|
|
3675
3777
|
setLocalDate((prev) => prev === next ? prev : next);
|
|
3676
3778
|
}, ROLLOVER_CHECK_MS);
|
|
3677
3779
|
return () => clearInterval(id);
|
|
3678
|
-
}, []);
|
|
3780
|
+
}, [opts.timeZone]);
|
|
3679
3781
|
useEffect5(() => {
|
|
3680
3782
|
let cancelled = false;
|
|
3681
|
-
const utcOffsetMinutes = -(/* @__PURE__ */ new Date()).getTimezoneOffset();
|
|
3783
|
+
const utcOffsetMinutes = opts.timeZone === void 0 ? -(/* @__PURE__ */ new Date()).getTimezoneOffset() : offsetOf(localDate, opts.timeZone);
|
|
3682
3784
|
const key = encodedUserKey(opts.operatorUserId, opts.anonymousUserId);
|
|
3683
|
-
const cached = readSchedule(opts.operatorId, key, localDate, Date.now());
|
|
3785
|
+
const cached = readSchedule(opts.operatorId, key, localDate, Date.now(), opts.timeZone);
|
|
3684
3786
|
if (cached) {
|
|
3685
3787
|
if (!cancelled) {
|
|
3686
3788
|
setGroups(cached.groups);
|
|
@@ -3700,12 +3802,12 @@ function useMatchDiscovery(opts) {
|
|
|
3700
3802
|
setScheduleLoaded(true);
|
|
3701
3803
|
return;
|
|
3702
3804
|
}
|
|
3703
|
-
writeSchedule(opts.operatorId, key, localDate, payload, Date.now());
|
|
3805
|
+
writeSchedule(opts.operatorId, key, localDate, payload, Date.now(), opts.timeZone);
|
|
3704
3806
|
setGroups(payload.groups);
|
|
3705
3807
|
setMatchDays(payload.matchDays ?? []);
|
|
3706
3808
|
setScheduleLoaded(true);
|
|
3707
3809
|
} catch {
|
|
3708
|
-
const fallback = readScheduleIgnoringTtl(opts.operatorId, key, localDate);
|
|
3810
|
+
const fallback = readScheduleIgnoringTtl(opts.operatorId, key, localDate, opts.timeZone);
|
|
3709
3811
|
if (!cancelled && fallback) {
|
|
3710
3812
|
setGroups(fallback.groups);
|
|
3711
3813
|
setMatchDays(fallback.matchDays ?? []);
|
|
@@ -3716,7 +3818,7 @@ function useMatchDiscovery(opts) {
|
|
|
3716
3818
|
return () => {
|
|
3717
3819
|
cancelled = true;
|
|
3718
3820
|
};
|
|
3719
|
-
}, [opts.operatorId, opts.operatorUserId, opts.anonymousUserId, localDate, refreshKey]);
|
|
3821
|
+
}, [opts.operatorId, opts.operatorUserId, opts.anonymousUserId, localDate, refreshKey, opts.timeZone]);
|
|
3720
3822
|
const tick = useCallback2(async () => {
|
|
3721
3823
|
const ids = dueMatchIds(groupsRef.current, statesRef.current, Date.now());
|
|
3722
3824
|
if (ids.football.length === 0 && ids.nba.length === 0 && ids.nfl.length === 0 && ids.tennis.length === 0) return;
|
|
@@ -3751,10 +3853,10 @@ function useMatchDiscovery(opts) {
|
|
|
3751
3853
|
return n;
|
|
3752
3854
|
}, [groups, states, stale]);
|
|
3753
3855
|
const refreshSchedule = useCallback2(async () => {
|
|
3754
|
-
clearSchedule(opts.operatorId, encodedUserKey(opts.operatorUserId, opts.anonymousUserId), localDate);
|
|
3856
|
+
clearSchedule(opts.operatorId, encodedUserKey(opts.operatorUserId, opts.anonymousUserId), localDate, opts.timeZone);
|
|
3755
3857
|
setRefreshKey((n) => n + 1);
|
|
3756
3858
|
setScheduleVersion((n) => n + 1);
|
|
3757
|
-
}, [opts.operatorId, opts.operatorUserId, opts.anonymousUserId, localDate]);
|
|
3859
|
+
}, [opts.operatorId, opts.operatorUserId, opts.anonymousUserId, localDate, opts.timeZone]);
|
|
3758
3860
|
return { groups, localDate, matchDays, scheduleLoaded, states, liveCount, stale, refreshSchedule, scheduleVersion, _tick: tick };
|
|
3759
3861
|
}
|
|
3760
3862
|
|
|
@@ -6289,8 +6391,8 @@ function OddsRow({ vm, row, ui, slip, inSlipIds, history, suppressSlip }) {
|
|
|
6289
6391
|
] });
|
|
6290
6392
|
}
|
|
6291
6393
|
var STALE_AFTER_MS = 12e4;
|
|
6292
|
-
function fmtHhMm(iso, tag2, clock3) {
|
|
6293
|
-
return formatTime(iso, tag2, clock3);
|
|
6394
|
+
function fmtHhMm(iso, tag2, clock3, timeZone) {
|
|
6395
|
+
return formatTime(iso, tag2, clock3, { timeZone });
|
|
6294
6396
|
}
|
|
6295
6397
|
function MarketOddsCard({ vm, ui, slip, monitor, inSlipIds, hideHeader, pinRef }) {
|
|
6296
6398
|
const [open, setOpen] = useState24(false);
|
|
@@ -6303,7 +6405,7 @@ function MarketOddsCard({ vm, ui, slip, monitor, inSlipIds, hideHeader, pinRef }
|
|
|
6303
6405
|
const isClosed = closedReason !== null;
|
|
6304
6406
|
const asOfMs = live ? new Date(live.asOfUtc).getTime() : NaN;
|
|
6305
6407
|
const isStale = live != null && !isClosed && (vm.awaitingLiveUpdate === true || Date.now() - asOfMs > STALE_AFTER_MS);
|
|
6306
|
-
const staleTime = isStale && live ? fmtHhMm(live.asOfUtc, ui.locale, clockOf(ui)) : null;
|
|
6408
|
+
const staleTime = isStale && live ? fmtHhMm(live.asOfUtc, ui.locale, clockOf(ui), ui.timeZone) : null;
|
|
6307
6409
|
const [, setStaleTick] = useState24(0);
|
|
6308
6410
|
const watchStale = live != null && !isClosed && !isStale;
|
|
6309
6411
|
useEffect19(() => {
|
|
@@ -6429,9 +6531,9 @@ function allowedForStars(stars, leg) {
|
|
|
6429
6531
|
import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
6430
6532
|
var asOf = (iso, ui) => {
|
|
6431
6533
|
const at2 = new Date(iso);
|
|
6432
|
-
const time = fmtHhMm(iso, ui.locale, clockOf(ui));
|
|
6433
|
-
if (at2.
|
|
6434
|
-
return `${formatDate(at2, ui.locale, { day: "numeric", month: "short" })} ${time}`;
|
|
6534
|
+
const time = fmtHhMm(iso, ui.locale, clockOf(ui), ui.timeZone);
|
|
6535
|
+
if (zonedDayNumber(at2.getTime(), ui.timeZone) === zonedDayNumber(Date.now(), ui.timeZone)) return time;
|
|
6536
|
+
return `${formatDate(at2, ui.locale, { day: "numeric", month: "short", timeZone: ui.timeZone })} ${time}`;
|
|
6435
6537
|
};
|
|
6436
6538
|
function CardLine({ card, ui, slip, sport, marketKey, conversation, operatorUserId, anonymousUserId }) {
|
|
6437
6539
|
const matchId = card.matchId;
|
|
@@ -6653,9 +6755,8 @@ function instantMs(iso) {
|
|
|
6653
6755
|
const ms = Date.parse(iso);
|
|
6654
6756
|
return Number.isNaN(ms) ? null : ms;
|
|
6655
6757
|
}
|
|
6656
|
-
function localDayStart(ms) {
|
|
6657
|
-
|
|
6658
|
-
return new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime();
|
|
6758
|
+
function localDayStart(ms, timeZone) {
|
|
6759
|
+
return zonedDayNumber(ms, timeZone) * 864e5;
|
|
6659
6760
|
}
|
|
6660
6761
|
function kickoffText(ui, iso) {
|
|
6661
6762
|
if (instantMs(iso) === null) return null;
|
|
@@ -6820,15 +6921,15 @@ function MatchCard({ card, ui, slip, sport, marketKey, conversation, operatorUse
|
|
|
6820
6921
|
import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
6821
6922
|
var STATUSES = ["available", "doubtful", "out"];
|
|
6822
6923
|
var MAX_MARKS = 30;
|
|
6823
|
-
|
|
6824
|
-
function clock(iso) {
|
|
6924
|
+
function clock(iso, ui) {
|
|
6825
6925
|
if (!iso) return null;
|
|
6826
6926
|
const at2 = new Date(iso);
|
|
6827
|
-
|
|
6927
|
+
if (Number.isNaN(at2.getTime())) return null;
|
|
6928
|
+
return formatTime(at2, ui.locale, clockOf(ui), { timeZone: ui.timeZone });
|
|
6828
6929
|
}
|
|
6829
6930
|
function badge(card, ui) {
|
|
6830
6931
|
if (card.status === "out") {
|
|
6831
|
-
const time = clock(card.statusAsOfUtc);
|
|
6932
|
+
const time = clock(card.statusAsOfUtc, ui);
|
|
6832
6933
|
return { kind: "out", text: time ? ui.v8Out(time) : ui.v8OutNoTime };
|
|
6833
6934
|
}
|
|
6834
6935
|
return card.status === "doubtful" ? { kind: "doubtful", text: ui.v8Doubtful } : null;
|
|
@@ -6876,10 +6977,10 @@ function SinceLines({ since, ui }) {
|
|
|
6876
6977
|
// src/components/dashboard/v8/YouRibbon.tsx
|
|
6877
6978
|
import { jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
6878
6979
|
var FROM_CHATS_SHOWN = 2;
|
|
6879
|
-
function showsNoGamesNote(chip, now = Date.now()) {
|
|
6980
|
+
function showsNoGamesNote(chip, now = Date.now(), timeZone) {
|
|
6880
6981
|
if (chip.kind !== "competition") return false;
|
|
6881
6982
|
const at2 = instantMs(chip.nextGameAtUtc);
|
|
6882
|
-
if (at2 !== null) return localDayStart(at2) > localDayStart(now);
|
|
6983
|
+
if (at2 !== null) return localDayStart(at2, timeZone) > localDayStart(now, timeZone);
|
|
6883
6984
|
return chip.noGamesToday === true;
|
|
6884
6985
|
}
|
|
6885
6986
|
function YouRibbon({ ribbon, ui, controller, holds, sport, onMore }) {
|
|
@@ -6889,7 +6990,7 @@ function YouRibbon({ ribbon, ui, controller, holds, sport, onMore }) {
|
|
|
6889
6990
|
return /* @__PURE__ */ jsxs22("section", { className: "ss-w-v8-sec ss-w-v8-ribbon", children: [
|
|
6890
6991
|
/* @__PURE__ */ jsxs22("div", { className: "ss-w-v8-chips", children: [
|
|
6891
6992
|
ribbon.stars.map((chip, i) => {
|
|
6892
|
-
const quiet = showsNoGamesNote(chip);
|
|
6993
|
+
const quiet = showsNoGamesNote(chip, Date.now(), ui.timeZone);
|
|
6893
6994
|
return /* @__PURE__ */ jsxs22("span", { className: `ss-w-v8-chip ss-w-v8-chip--${chip.kind}`, children: [
|
|
6894
6995
|
chip.playing && !quiet ? /* @__PURE__ */ jsx24("i", { className: "ss-w-v8-playing", "aria-hidden": "true" }) : null,
|
|
6895
6996
|
chip.label,
|
|
@@ -7102,54 +7203,9 @@ import { useCallback as useCallback21, useMemo as useMemo8, useState as useState
|
|
|
7102
7203
|
|
|
7103
7204
|
// src/useScheduleDay.ts
|
|
7104
7205
|
import { useCallback as useCallback20, useEffect as useEffect23, useRef as useRef18, useState as useState28 } from "react";
|
|
7105
|
-
|
|
7106
|
-
// src/scheduleDays.ts
|
|
7107
|
-
var MAX_AFTER_TODAY = 6;
|
|
7108
|
-
var parts = (date) => {
|
|
7109
|
-
const [y = 0, m = 1, d = 1] = date.split("-").map(Number);
|
|
7110
|
-
return [y, m, d];
|
|
7111
|
-
};
|
|
7112
|
-
function offsetOf(localDate) {
|
|
7113
|
-
const [y, m, d] = parts(localDate);
|
|
7114
|
-
return -new Date(y, m - 1, d, 12).getTimezoneOffset();
|
|
7115
|
-
}
|
|
7116
|
-
function localDateOfUnix(unix, offsetMinutes = -new Date(unix * 1e3).getTimezoneOffset()) {
|
|
7117
|
-
return new Date((unix + offsetMinutes * 60) * 1e3).toISOString().slice(0, 10);
|
|
7118
|
-
}
|
|
7119
|
-
var dayAfter = (date) => {
|
|
7120
|
-
const [y, m, d] = parts(date);
|
|
7121
|
-
return new Date(Date.UTC(y, m - 1, d + 1)).toISOString().slice(0, 10);
|
|
7122
|
-
};
|
|
7123
|
-
function buildDayChips(today, matchDays, sport) {
|
|
7124
|
-
const dates = /* @__PURE__ */ new Set();
|
|
7125
|
-
for (const md of matchDays) {
|
|
7126
|
-
if (sport !== "all" && md.sport !== sport) continue;
|
|
7127
|
-
for (const date of md.dates) if (date > today) dates.add(date);
|
|
7128
|
-
}
|
|
7129
|
-
const chips = [{ date: today, isToday: true, gapBefore: false }];
|
|
7130
|
-
for (const date of [...dates].sort().slice(0, MAX_AFTER_TODAY)) {
|
|
7131
|
-
const prev = chips[chips.length - 1];
|
|
7132
|
-
chips.push({ date, isToday: false, gapBefore: prev !== void 0 && dayAfter(prev.date) !== date });
|
|
7133
|
-
}
|
|
7134
|
-
return chips;
|
|
7135
|
-
}
|
|
7136
|
-
function weekdayAndDay(date, tag2) {
|
|
7137
|
-
const [y, m, d] = parts(date);
|
|
7138
|
-
const at2 = new Date(Date.UTC(y, m - 1, d, 12));
|
|
7139
|
-
return {
|
|
7140
|
-
weekday: formatDate(at2, tag2, { weekday: "short", timeZone: "UTC" }),
|
|
7141
|
-
day: formatDate(at2, tag2, { day: "numeric", timeZone: "UTC" })
|
|
7142
|
-
};
|
|
7143
|
-
}
|
|
7144
|
-
function weekdayLong(date, tag2) {
|
|
7145
|
-
const [y, m, d] = parts(date);
|
|
7146
|
-
return formatDate(new Date(Date.UTC(y, m - 1, d, 12)), tag2, { weekday: "long", timeZone: "UTC" });
|
|
7147
|
-
}
|
|
7148
|
-
|
|
7149
|
-
// src/useScheduleDay.ts
|
|
7150
7206
|
var EMPTY = [];
|
|
7151
7207
|
function useScheduleDay(opts) {
|
|
7152
|
-
const { localDate, today, todayGroups, enabled, resetKey } = opts;
|
|
7208
|
+
const { localDate, today, todayGroups, enabled, resetKey, timeZone } = opts;
|
|
7153
7209
|
const getRef = useRef18(opts.getSchedule);
|
|
7154
7210
|
getRef.current = opts.getSchedule;
|
|
7155
7211
|
const daysRef = useRef18(/* @__PURE__ */ new Map());
|
|
@@ -7157,12 +7213,14 @@ function useScheduleDay(opts) {
|
|
|
7157
7213
|
const [retryKey, setRetryKey] = useState28(0);
|
|
7158
7214
|
const [seenDate, setSeenDate] = useState28(localDate);
|
|
7159
7215
|
const [seenReset, setSeenReset] = useState28(resetKey);
|
|
7216
|
+
const [seenZone, setSeenZone] = useState28(timeZone);
|
|
7160
7217
|
if (seenDate !== localDate) {
|
|
7161
7218
|
setSeenDate(localDate);
|
|
7162
7219
|
setFetched({ status: "idle", groups: EMPTY });
|
|
7163
7220
|
}
|
|
7164
|
-
if (seenReset !== resetKey) {
|
|
7221
|
+
if (seenReset !== resetKey || seenZone !== timeZone) {
|
|
7165
7222
|
setSeenReset(resetKey);
|
|
7223
|
+
setSeenZone(timeZone);
|
|
7166
7224
|
daysRef.current.clear();
|
|
7167
7225
|
setFetched({ status: "idle", groups: EMPTY });
|
|
7168
7226
|
}
|
|
@@ -7173,7 +7231,7 @@ function useScheduleDay(opts) {
|
|
|
7173
7231
|
setFetched({ status: "loading", groups: EMPTY });
|
|
7174
7232
|
void (async () => {
|
|
7175
7233
|
try {
|
|
7176
|
-
const payload = await getRef.current(localDate, offsetOf(localDate));
|
|
7234
|
+
const payload = await getRef.current(localDate, offsetOf(localDate, timeZone));
|
|
7177
7235
|
if (cancelled) return;
|
|
7178
7236
|
if (!payload) {
|
|
7179
7237
|
setFetched({ status: "error", groups: EMPTY });
|
|
@@ -7188,7 +7246,7 @@ function useScheduleDay(opts) {
|
|
|
7188
7246
|
return () => {
|
|
7189
7247
|
cancelled = true;
|
|
7190
7248
|
};
|
|
7191
|
-
}, [localDate, isToday, enabled, retryKey, resetKey]);
|
|
7249
|
+
}, [localDate, isToday, enabled, retryKey, resetKey, timeZone]);
|
|
7192
7250
|
const retry = useCallback20(() => {
|
|
7193
7251
|
setRetryKey((k) => k + 1);
|
|
7194
7252
|
}, []);
|
|
@@ -7200,7 +7258,7 @@ function useScheduleDay(opts) {
|
|
|
7200
7258
|
}
|
|
7201
7259
|
|
|
7202
7260
|
// src/useMatchesDay.ts
|
|
7203
|
-
function useMatchesDay({ discovery, day, sport, getSchedule, enabled }) {
|
|
7261
|
+
function useMatchesDay({ discovery, day, sport, getSchedule, enabled, timeZone }) {
|
|
7204
7262
|
const { localDate: today, matchDays } = discovery;
|
|
7205
7263
|
const chips = useMemo8(() => buildDayChips(today, matchDays, sport), [today, matchDays, sport]);
|
|
7206
7264
|
const selected = chips.some((c) => c.date === day) ? day : today;
|
|
@@ -7210,6 +7268,7 @@ function useMatchesDay({ discovery, day, sport, getSchedule, enabled }) {
|
|
|
7210
7268
|
todayGroups: discovery.groups,
|
|
7211
7269
|
getSchedule,
|
|
7212
7270
|
enabled,
|
|
7271
|
+
timeZone,
|
|
7213
7272
|
resetKey: String(discovery.scheduleVersion)
|
|
7214
7273
|
});
|
|
7215
7274
|
return { ...loaded, chips, selected };
|
|
@@ -8744,7 +8803,7 @@ function ticksFor(lo, hi) {
|
|
|
8744
8803
|
return out;
|
|
8745
8804
|
}
|
|
8746
8805
|
function scatterScale(e) {
|
|
8747
|
-
const { w, h, pad
|
|
8806
|
+
const { w, h, pad } = SCATTER_VIEW;
|
|
8748
8807
|
const xs = finite3([...e.field.map((d) => d.returnPct), ...e.marked.map((m) => m.returnPct), e.tourReturnPct]);
|
|
8749
8808
|
const ys = finite3([...e.field.map((d) => d.servePct), ...e.marked.map((m) => m.servePct), e.tourServePct]);
|
|
8750
8809
|
const x0 = Math.floor(Math.min(...xs) - 1);
|
|
@@ -8752,26 +8811,26 @@ function scatterScale(e) {
|
|
|
8752
8811
|
const y0 = Math.floor(Math.min(...ys) - 1);
|
|
8753
8812
|
const y1 = Math.ceil(Math.max(...ys) + 1);
|
|
8754
8813
|
return {
|
|
8755
|
-
x: (v) => round22(
|
|
8756
|
-
y: (v) => round22(h -
|
|
8814
|
+
x: (v) => round22(pad.l + (v - x0) / (x1 - x0) * (w - pad.l - pad.r)),
|
|
8815
|
+
y: (v) => round22(h - pad.b - (v - y0) / (y1 - y0) * (h - pad.t - pad.b)),
|
|
8757
8816
|
ticksX: ticksFor(x0, x1),
|
|
8758
8817
|
ticksY: ticksFor(y0, y1)
|
|
8759
8818
|
};
|
|
8760
8819
|
}
|
|
8761
8820
|
function formBars(e) {
|
|
8762
|
-
const { w, h, pad
|
|
8821
|
+
const { w, h, pad } = FORM_VIEW;
|
|
8763
8822
|
const n = e.matches.length;
|
|
8764
8823
|
const bounds = finite3([e.min, e.max, e.tourServePct]);
|
|
8765
8824
|
const lo = Math.min(...bounds) - 4;
|
|
8766
8825
|
const hi = Math.max(...bounds) + 2;
|
|
8767
|
-
const plotW = w -
|
|
8768
|
-
const base = h -
|
|
8769
|
-
const y = (v) => round22(base - (v - lo) / (hi - lo) * (h -
|
|
8826
|
+
const plotW = w - pad.l - pad.r;
|
|
8827
|
+
const base = h - pad.b;
|
|
8828
|
+
const y = (v) => round22(base - (v - lo) / (hi - lo) * (h - pad.t - pad.b));
|
|
8770
8829
|
const slot = plotW / Math.max(n, 1);
|
|
8771
8830
|
const bw = Math.max(1, Math.min(MAX_BAR_W, slot - BAR_GAP));
|
|
8772
8831
|
const bars = e.matches.map((m, i) => {
|
|
8773
8832
|
const top = y(clampTo(m.servePct, lo, hi));
|
|
8774
|
-
return { x: round22(
|
|
8833
|
+
return { x: round22(pad.l + slot * i + (slot - bw) / 2), w: round22(bw), y: top, h: round22(base - top), won: m.result === "W" };
|
|
8775
8834
|
});
|
|
8776
8835
|
return { bars, tourY: y(e.tourServePct) };
|
|
8777
8836
|
}
|
|
@@ -8794,9 +8853,9 @@ function roundSpan(e) {
|
|
|
8794
8853
|
return { lo, span: ROUND_STEPS - lo };
|
|
8795
8854
|
}
|
|
8796
8855
|
function pathRounds(e) {
|
|
8797
|
-
const { h, pad
|
|
8798
|
-
const base = h -
|
|
8799
|
-
const plotH = h -
|
|
8856
|
+
const { h, pad } = PATH_VIEW;
|
|
8857
|
+
const base = h - pad.b;
|
|
8858
|
+
const plotH = h - pad.t - pad.b;
|
|
8800
8859
|
const { lo, span } = roundSpan(e);
|
|
8801
8860
|
const seen = /* @__PURE__ */ new Map();
|
|
8802
8861
|
for (const ev of e.events) {
|
|
@@ -8820,11 +8879,11 @@ function pathGutter(e) {
|
|
|
8820
8879
|
return Math.max(PATH_VIEW.pad.l, Math.ceil(longest * GLYPH_W) + GUTTER_PAD + 4);
|
|
8821
8880
|
}
|
|
8822
8881
|
function pathBars(e, left = PATH_VIEW.pad.l) {
|
|
8823
|
-
const { w, h, pad
|
|
8882
|
+
const { w, h, pad } = PATH_VIEW;
|
|
8824
8883
|
const n = e.events.length;
|
|
8825
|
-
const plotW = w - left -
|
|
8826
|
-
const plotH = h -
|
|
8827
|
-
const base = h -
|
|
8884
|
+
const plotW = w - left - pad.r;
|
|
8885
|
+
const plotH = h - pad.t - pad.b;
|
|
8886
|
+
const base = h - pad.b;
|
|
8828
8887
|
const slot = plotW / Math.max(n, 1);
|
|
8829
8888
|
const bw = Math.max(1, Math.min(MAX_BAR_W, slot - BAR_GAP));
|
|
8830
8889
|
const { lo, span } = roundSpan(e);
|
|
@@ -8884,7 +8943,7 @@ function TennisInsightPriceRow({ prices }) {
|
|
|
8884
8943
|
] });
|
|
8885
8944
|
}
|
|
8886
8945
|
function ServeReturnChart({ vm, e, ui }) {
|
|
8887
|
-
const { w, h, pad
|
|
8946
|
+
const { w, h, pad } = SCATTER_VIEW;
|
|
8888
8947
|
const s = scatterScale(e);
|
|
8889
8948
|
const tx = s.x(e.tourReturnPct);
|
|
8890
8949
|
const ty = s.y(e.tourServePct);
|
|
@@ -8896,19 +8955,19 @@ function ServeReturnChart({ vm, e, ui }) {
|
|
|
8896
8955
|
});
|
|
8897
8956
|
return /* @__PURE__ */ jsxs34("svg", { className: "ss-w-tni-svg", viewBox: `0 0 ${w} ${h}`, width: "100%", role: "img", "aria-label": summaryOf(vm, ui), children: [
|
|
8898
8957
|
s.ticksX.map((t) => /* @__PURE__ */ jsxs34("g", { children: [
|
|
8899
|
-
/* @__PURE__ */ jsx38("line", { className: "ss-w-tni-grid", x1: s.x(t), x2: s.x(t), y1:
|
|
8900
|
-
/* @__PURE__ */ jsx38("text", { className: "ss-w-tni-tick", x: s.x(t), y: h -
|
|
8958
|
+
/* @__PURE__ */ jsx38("line", { className: "ss-w-tni-grid", x1: s.x(t), x2: s.x(t), y1: pad.t, y2: h - pad.b }),
|
|
8959
|
+
/* @__PURE__ */ jsx38("text", { className: "ss-w-tni-tick", x: s.x(t), y: h - pad.b + 11, textAnchor: "middle", children: pct(t, ui, 0) })
|
|
8901
8960
|
] }, `x${t}`)),
|
|
8902
8961
|
s.ticksY.map((t) => /* @__PURE__ */ jsxs34("g", { children: [
|
|
8903
|
-
/* @__PURE__ */ jsx38("line", { className: "ss-w-tni-grid", x1:
|
|
8904
|
-
/* @__PURE__ */ jsx38("text", { className: "ss-w-tni-tick", x:
|
|
8962
|
+
/* @__PURE__ */ jsx38("line", { className: "ss-w-tni-grid", x1: pad.l, x2: w - pad.r, y1: s.y(t), y2: s.y(t) }),
|
|
8963
|
+
/* @__PURE__ */ jsx38("text", { className: "ss-w-tni-tick", x: pad.l - 4, y: s.y(t) + 3, textAnchor: "end", children: pct(t, ui, 0) })
|
|
8905
8964
|
] }, `y${t}`)),
|
|
8906
|
-
/* @__PURE__ */ jsx38("text", { className: "ss-w-tni-axis", x:
|
|
8907
|
-
/* @__PURE__ */ jsx38("text", { className: "ss-w-tni-axis", transform: `translate(8 ${
|
|
8965
|
+
/* @__PURE__ */ jsx38("text", { className: "ss-w-tni-axis", x: pad.l + (w - pad.l - pad.r) / 2, y: h - 3, textAnchor: "middle", children: e.xAxis }),
|
|
8966
|
+
/* @__PURE__ */ jsx38("text", { className: "ss-w-tni-axis", transform: `translate(8 ${pad.t + (h - pad.t - pad.b) / 2}) rotate(-90)`, textAnchor: "middle", children: e.yAxis }),
|
|
8908
8967
|
e.field.map((d) => /* @__PURE__ */ jsx38("circle", { className: "ss-w-tni-dot", cx: s.x(d.returnPct), cy: s.y(d.servePct), r: 2.4 }, d.playerId)),
|
|
8909
|
-
/* @__PURE__ */ jsx38("line", { className: "ss-w-tni-tour", x1: tx, x2: tx, y1:
|
|
8910
|
-
/* @__PURE__ */ jsx38("line", { className: "ss-w-tni-tour", x1:
|
|
8911
|
-
/* @__PURE__ */ jsx38("text", { className: "ss-w-tni-lab ss-w-tni-lab-faint", x: w -
|
|
8968
|
+
/* @__PURE__ */ jsx38("line", { className: "ss-w-tni-tour", x1: tx, x2: tx, y1: pad.t, y2: h - pad.b }),
|
|
8969
|
+
/* @__PURE__ */ jsx38("line", { className: "ss-w-tni-tour", x1: pad.l, x2: w - pad.r, y1: ty, y2: ty }),
|
|
8970
|
+
/* @__PURE__ */ jsx38("text", { className: "ss-w-tni-lab ss-w-tni-lab-faint", x: w - pad.r - 2, y: ty - 4, textAnchor: "end", children: e.tourAverage }),
|
|
8912
8971
|
e.marked.map((m, i) => {
|
|
8913
8972
|
const l = labels[i];
|
|
8914
8973
|
return /* @__PURE__ */ jsxs34("g", { children: [
|
|
@@ -8929,15 +8988,15 @@ function ServeReturnCard({ vm, e, ui }) {
|
|
|
8929
8988
|
] });
|
|
8930
8989
|
}
|
|
8931
8990
|
function ServeFormCard({ vm, e, ui }) {
|
|
8932
|
-
const { w, h, pad
|
|
8991
|
+
const { w, h, pad } = FORM_VIEW;
|
|
8933
8992
|
const { bars, tourY } = formBars(e);
|
|
8934
8993
|
const lo = Math.min(e.min, e.tourServePct) - 4;
|
|
8935
8994
|
const hi = Math.max(e.max, e.tourServePct) + 2;
|
|
8936
|
-
const base = h -
|
|
8937
|
-
const yOf = (v) => base - (v - lo) / (hi - lo) * (h -
|
|
8995
|
+
const base = h - pad.b;
|
|
8996
|
+
const yOf = (v) => base - (v - lo) / (hi - lo) * (h - pad.t - pad.b);
|
|
8938
8997
|
const ticks = [];
|
|
8939
8998
|
for (let t = Math.ceil(lo / 5) * 5; t <= hi; t += 5) ticks.push(t);
|
|
8940
|
-
const slot = (w -
|
|
8999
|
+
const slot = (w - pad.l - pad.r) / Math.max(e.matches.length, 1);
|
|
8941
9000
|
const tiles = [
|
|
8942
9001
|
{ label: e.labels.average, value: pct(e.average, ui) },
|
|
8943
9002
|
e.winsAverage == null ? null : { label: e.labels.inWins, value: pct(e.winsAverage, ui) },
|
|
@@ -8946,10 +9005,10 @@ function ServeFormCard({ vm, e, ui }) {
|
|
|
8946
9005
|
].filter((t) => t !== null);
|
|
8947
9006
|
return /* @__PURE__ */ jsxs34(Fragment8, { children: [
|
|
8948
9007
|
/* @__PURE__ */ jsxs34("svg", { className: "ss-w-tni-svg", viewBox: `0 0 ${w} ${h}`, width: "100%", role: "img", "aria-label": summaryOf(vm, ui), children: [
|
|
8949
|
-
/* @__PURE__ */ jsx38("text", { className: "ss-w-tni-axis", x:
|
|
9008
|
+
/* @__PURE__ */ jsx38("text", { className: "ss-w-tni-axis", x: pad.l, y: 9, children: e.labels.metric }),
|
|
8950
9009
|
ticks.map((t) => /* @__PURE__ */ jsxs34("g", { children: [
|
|
8951
|
-
/* @__PURE__ */ jsx38("line", { className: "ss-w-tni-grid", x1:
|
|
8952
|
-
/* @__PURE__ */ jsx38("text", { className: "ss-w-tni-tick", x:
|
|
9010
|
+
/* @__PURE__ */ jsx38("line", { className: "ss-w-tni-grid", x1: pad.l, x2: w - pad.r, y1: yOf(t), y2: yOf(t) }),
|
|
9011
|
+
/* @__PURE__ */ jsx38("text", { className: "ss-w-tni-tick", x: pad.l - 4, y: yOf(t) + 3, textAnchor: "end", children: pct(t, ui, 0) })
|
|
8953
9012
|
] }, t)),
|
|
8954
9013
|
bars.map((b, i) => {
|
|
8955
9014
|
const m = e.matches[i];
|
|
@@ -8961,8 +9020,8 @@ function ServeFormCard({ vm, e, ui }) {
|
|
|
8961
9020
|
/* @__PURE__ */ jsx38("text", { className: "ss-w-tni-xl", x: cx, y: base + (i % 2 === 0 ? 22 : 32), textAnchor: "middle", children: fitLabel(m.opponent, formLabelWidth(slot), FORM_GLYPH_W) })
|
|
8962
9021
|
] }, m.matchId);
|
|
8963
9022
|
}),
|
|
8964
|
-
/* @__PURE__ */ jsx38("line", { className: "ss-w-tni-tour", x1:
|
|
8965
|
-
/* @__PURE__ */ jsx38("text", { className: "ss-w-tni-lab ss-w-tni-lab-faint", x: w -
|
|
9023
|
+
/* @__PURE__ */ jsx38("line", { className: "ss-w-tni-tour", x1: pad.l, x2: w - pad.r, y1: tourY, y2: tourY }),
|
|
9024
|
+
/* @__PURE__ */ jsx38("text", { className: "ss-w-tni-lab ss-w-tni-lab-faint", x: w - pad.r - 2, y: pad.t - 4, textAnchor: "end", children: `${e.labels.tourAverage} ${pct(e.tourServePct, ui)}` })
|
|
8966
9025
|
] }),
|
|
8967
9026
|
/* @__PURE__ */ jsx38("div", { className: "ss-w-tni-tiles", children: tiles.map((t) => /* @__PURE__ */ jsxs34("div", { className: "ss-w-tni-tile", children: [
|
|
8968
9027
|
/* @__PURE__ */ jsx38("span", { className: "ss-w-tni-tile-v", children: t.value }),
|
|
@@ -8971,12 +9030,12 @@ function ServeFormCard({ vm, e, ui }) {
|
|
|
8971
9030
|
] });
|
|
8972
9031
|
}
|
|
8973
9032
|
function SeasonPathCard({ vm, e, ui }) {
|
|
8974
|
-
const { w, h, pad
|
|
9033
|
+
const { w, h, pad } = PATH_VIEW;
|
|
8975
9034
|
const left = pathGutter(e);
|
|
8976
9035
|
const bars = pathBars(e, left);
|
|
8977
9036
|
const rounds = pathRounds(e);
|
|
8978
|
-
const base = h -
|
|
8979
|
-
const labelled = (w -
|
|
9037
|
+
const base = h - pad.b;
|
|
9038
|
+
const labelled = (w - pad.l - pad.r) / Math.max(e.events.length, 1) >= 22;
|
|
8980
9039
|
const NAME_ROOM = 46;
|
|
8981
9040
|
const namesShown = labelled && e.events.some((ev) => ev.name);
|
|
8982
9041
|
const hasTitle = e.events.some((ev) => ev.title);
|
|
@@ -8985,10 +9044,10 @@ function SeasonPathCard({ vm, e, ui }) {
|
|
|
8985
9044
|
return /* @__PURE__ */ jsxs34(Fragment8, { children: [
|
|
8986
9045
|
/* @__PURE__ */ jsxs34("svg", { className: "ss-w-tni-svg", viewBox: `0 0 ${w} ${h + (namesShown ? NAME_ROOM : -14)}`, width: "100%", role: "img", "aria-label": summaryOf(vm, ui), children: [
|
|
8987
9046
|
rounds.map((r) => /* @__PURE__ */ jsxs34("g", { children: [
|
|
8988
|
-
/* @__PURE__ */ jsx38("line", { className: "ss-w-tni-grid ss-w-tni-rline", x1: left, x2: w -
|
|
9047
|
+
/* @__PURE__ */ jsx38("line", { className: "ss-w-tni-grid ss-w-tni-rline", x1: left, x2: w - pad.r, y1: r.y, y2: r.y }),
|
|
8989
9048
|
/* @__PURE__ */ jsx38("text", { className: "ss-w-tni-tick", x: left - 4, y: r.y + 3, textAnchor: "end", children: r.label })
|
|
8990
9049
|
] }, `r${r.roundIndex}`)),
|
|
8991
|
-
/* @__PURE__ */ jsx38("line", { className: "ss-w-tni-grid", x1: left, x2: w -
|
|
9050
|
+
/* @__PURE__ */ jsx38("line", { className: "ss-w-tni-grid", x1: left, x2: w - pad.r, y1: base, y2: base }),
|
|
8992
9051
|
bars.map((b, i) => {
|
|
8993
9052
|
const ev = e.events[i];
|
|
8994
9053
|
const surface = surfaceOf(b.surface);
|
|
@@ -9412,7 +9471,7 @@ function FixtureCard({ card, ui }) {
|
|
|
9412
9471
|
// src/components/dashboard/CountdownCard.tsx
|
|
9413
9472
|
import { Fragment as Fragment11, useEffect as useEffect29, useState as useState36 } from "react";
|
|
9414
9473
|
import { jsx as jsx43, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
9415
|
-
var
|
|
9474
|
+
var DAY_MS3 = 864e5;
|
|
9416
9475
|
function remainingSegments(kickoffUnix, nowMs, withSeconds) {
|
|
9417
9476
|
const totalSeconds = Math.floor((kickoffUnix * 1e3 - nowMs) / 1e3);
|
|
9418
9477
|
if (totalSeconds <= 0) return null;
|
|
@@ -9420,10 +9479,10 @@ function remainingSegments(kickoffUnix, nowMs, withSeconds) {
|
|
|
9420
9479
|
const hours = Math.floor(totalSeconds % 86400 / 3600);
|
|
9421
9480
|
const minutes = Math.floor(totalSeconds % 3600 / 60);
|
|
9422
9481
|
const seconds = totalSeconds % 60;
|
|
9423
|
-
const
|
|
9424
|
-
if (days > 0) return [{ value:
|
|
9425
|
-
const segs = [{ value:
|
|
9426
|
-
if (withSeconds) segs.push({ value:
|
|
9482
|
+
const pad = (n) => String(n).padStart(2, "0");
|
|
9483
|
+
if (days > 0) return [{ value: pad(days), unit: "d" }, { value: pad(hours), unit: "h" }];
|
|
9484
|
+
const segs = [{ value: pad(hours), unit: "h" }, { value: pad(minutes), unit: "m" }];
|
|
9485
|
+
if (withSeconds) segs.push({ value: pad(seconds), unit: "s" });
|
|
9427
9486
|
return segs;
|
|
9428
9487
|
}
|
|
9429
9488
|
function CountdownCard({ card, ui }) {
|
|
@@ -9433,7 +9492,7 @@ function CountdownCard({ card, ui }) {
|
|
|
9433
9492
|
const [reduced] = useState36(
|
|
9434
9493
|
() => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches
|
|
9435
9494
|
);
|
|
9436
|
-
const withinDay = data.kickoffUnix * 1e3 - nowMs <
|
|
9495
|
+
const withinDay = data.kickoffUnix * 1e3 - nowMs < DAY_MS3;
|
|
9437
9496
|
useEffect29(() => {
|
|
9438
9497
|
if (reduced) return;
|
|
9439
9498
|
const id = window.setInterval(() => setNowMs(Date.now()), withinDay ? 1e3 : 6e4);
|
|
@@ -10741,7 +10800,7 @@ function MonitorMatchCard({ match, promotedPins, monitor, ui, slip, onAsk }) {
|
|
|
10741
10800
|
] })
|
|
10742
10801
|
] }, row.label);
|
|
10743
10802
|
}) }),
|
|
10744
|
-
match.status === "stale" && /* @__PURE__ */ jsx72("span", { className: "ss-w-mon-asof", children: ui.asOf(formatTime(match.asOfUtc, ui.locale, clockOf(ui))) }),
|
|
10803
|
+
match.status === "stale" && /* @__PURE__ */ jsx72("span", { className: "ss-w-mon-asof", children: ui.asOf(formatTime(match.asOfUtc, ui.locale, clockOf(ui), { timeZone: ui.timeZone })) }),
|
|
10745
10804
|
match.momentum.length > 0 && /* @__PURE__ */ jsxs67("div", { className: "ss-w-mon-mom", children: [
|
|
10746
10805
|
/* @__PURE__ */ jsx72("span", { className: "ss-w-mon-stat-l", children: ui.momentumLabel }),
|
|
10747
10806
|
/* @__PURE__ */ jsx72(MomentumWave, { points: match.momentum, label: ui.momentumLabel, clubIsHome: true })
|
|
@@ -11768,12 +11827,11 @@ function splitAtFirstSpace(label) {
|
|
|
11768
11827
|
const i = label.indexOf(" ");
|
|
11769
11828
|
return i > 0 && i < label.length - 1 ? [label.slice(0, i), label.slice(i + 1)] : null;
|
|
11770
11829
|
}
|
|
11771
|
-
function isOtherLocalDay(kickoffUnix, now) {
|
|
11772
|
-
|
|
11773
|
-
return at2.getFullYear() !== now.getFullYear() || at2.getMonth() !== now.getMonth() || at2.getDate() !== now.getDate();
|
|
11830
|
+
function isOtherLocalDay(kickoffUnix, now, timeZone) {
|
|
11831
|
+
return zonedDayNumber(kickoffUnix * 1e3, timeZone) !== zonedDayNumber(now.getTime(), timeZone);
|
|
11774
11832
|
}
|
|
11775
|
-
function kickoffLabel(kickoffUnix, tag2, clock3) {
|
|
11776
|
-
return formatTime(kickoffUnix * 1e3, tag2, clock3);
|
|
11833
|
+
function kickoffLabel(kickoffUnix, tag2, clock3, timeZone) {
|
|
11834
|
+
return formatTime(kickoffUnix * 1e3, tag2, clock3, { timeZone });
|
|
11777
11835
|
}
|
|
11778
11836
|
function Side2({ name, crest, abbr, away = false }) {
|
|
11779
11837
|
return /* @__PURE__ */ jsxs79("span", { className: away ? "ss-w-drow-side ss-w-drow-side--away" : "ss-w-drow-side", children: [
|
|
@@ -11791,12 +11849,12 @@ function rowStatusOf(state, stale, ui) {
|
|
|
11791
11849
|
}
|
|
11792
11850
|
function FixtureRow({ match, state, stale, ui, monitor, onOpen }) {
|
|
11793
11851
|
const { isLive, hasScore, score, ticked, when: clock3 } = rowStatusOf(state, stale, ui);
|
|
11794
|
-
const when = clock3 ?? kickoffLabel(match.kickoffUnix, ui.locale, clockOf(ui));
|
|
11852
|
+
const when = clock3 ?? kickoffLabel(match.kickoffUnix, ui.locale, clockOf(ui), ui.timeZone);
|
|
11795
11853
|
const isUsSport = sportKeyOf(match.sport) !== "football";
|
|
11796
11854
|
const pinSport = slipSportOf8(match.sport);
|
|
11797
11855
|
const liveTone = isLive || state?.isHalfTime;
|
|
11798
11856
|
const clockParts = isUsSport && isLive && ticked !== null && !state?.isHalfTime ? splitAtFirstSpace(ticked) : null;
|
|
11799
|
-
const dayMarker = isUsSport && !liveTone && state?.phase !== "live" && isOtherLocalDay(match.kickoffUnix, /* @__PURE__ */ new Date()) ? formatDate(match.kickoffUnix * 1e3, ui.locale, { weekday: "short" }) : null;
|
|
11857
|
+
const dayMarker = isUsSport && !liveTone && state?.phase !== "live" && isOtherLocalDay(match.kickoffUnix, /* @__PURE__ */ new Date(), ui.timeZone) ? formatDate(match.kickoffUnix * 1e3, ui.locale, { weekday: "short", timeZone: ui.timeZone }) : null;
|
|
11800
11858
|
const twoLines = clockParts ?? (dayMarker !== null ? [when, dayMarker] : null);
|
|
11801
11859
|
const whenClass = [
|
|
11802
11860
|
"ss-w-drow-when",
|
|
@@ -11966,7 +12024,7 @@ function TennisFixtureRow({ match, state, stale, ui, prices, slip, monitor }) {
|
|
|
11966
12024
|
live ? /* @__PURE__ */ jsxs80("span", { className: "ss-w-trow-when ss-w-trow-live", children: [
|
|
11967
12025
|
ui.liveLabel,
|
|
11968
12026
|
setLabel ? /* @__PURE__ */ jsx85("span", { className: "ss-w-trow-set", children: setLabel }) : null
|
|
11969
|
-
] }) : endMark ? /* @__PURE__ */ jsx85("span", { className: "ss-w-trow-when ss-w-trow-when--end", children: endMark }) : match.timeTba ? /* @__PURE__ */ jsx85("span", { className: "ss-w-trow-when ss-w-trow-when--tba", children: ui.tennis.timeTba }) : /* @__PURE__ */ jsx85("span", { className: "ss-w-trow-when", children: kickoffLabel(match.kickoffUnix, ui.locale, clockOf(ui)) }),
|
|
12027
|
+
] }) : endMark ? /* @__PURE__ */ jsx85("span", { className: "ss-w-trow-when ss-w-trow-when--end", children: endMark }) : match.timeTba ? /* @__PURE__ */ jsx85("span", { className: "ss-w-trow-when ss-w-trow-when--tba", children: ui.tennis.timeTba }) : /* @__PURE__ */ jsx85("span", { className: "ss-w-trow-when", children: kickoffLabel(match.kickoffUnix, ui.locale, clockOf(ui), ui.timeZone) }),
|
|
11970
12028
|
pinned ? /* @__PURE__ */ jsx85("button", { type: "button", className: "ss-w-trow-players ss-w-trow-open", onClick: open, children: players }) : /* @__PURE__ */ jsx85("span", { className: "ss-w-trow-players", children: players }),
|
|
11971
12029
|
showPrices && (entry === void 0 ? /* @__PURE__ */ jsx85("span", { className: "ss-w-trow-prices" }) : entry === null ? /* @__PURE__ */ jsx85("span", { className: "ss-w-trow-prices", children: /* @__PURE__ */ jsx85("span", { className: "ss-w-trow-noodds", children: ui.tennis.noOdds }) }) : /* @__PURE__ */ jsx85(TennisPriceCell, { match, price: entry, ui, slip })),
|
|
11972
12030
|
pinnable && monitor && pin && /* @__PURE__ */ jsx85(PinToggle, { ui, monitor, pin })
|
|
@@ -12561,7 +12619,7 @@ function OddsLiveStrip({ m, ui }) {
|
|
|
12561
12619
|
m.minuteLabel && /* @__PURE__ */ jsx91("span", { className: "ss-w-mon-min", children: m.minuteLabel }),
|
|
12562
12620
|
m.isSuspended && !m.isSettled && /* @__PURE__ */ jsx91("span", { className: "ss-w-mon-susp", children: ui.suspendedLabel }),
|
|
12563
12621
|
m.isSettled && /* @__PURE__ */ jsx91("span", { className: "ss-w-mon-pill", children: ui.fullTimeLabel }),
|
|
12564
|
-
stale && /* @__PURE__ */ jsx91("span", { className: "ss-w-mon-asof", children: ui.asOf(formatTime(m.asOfUtc, ui.locale, clockOf(ui))) })
|
|
12622
|
+
stale && /* @__PURE__ */ jsx91("span", { className: "ss-w-mon-asof", children: ui.asOf(formatTime(m.asOfUtc, ui.locale, clockOf(ui), { timeZone: ui.timeZone })) })
|
|
12565
12623
|
] });
|
|
12566
12624
|
}
|
|
12567
12625
|
function MatchesPanel({ monitor, ui, slip, onAsk, discovery }) {
|
|
@@ -12688,7 +12746,7 @@ var countryThenName = (a, b) => {
|
|
|
12688
12746
|
};
|
|
12689
12747
|
function matchSections(a) {
|
|
12690
12748
|
const live = (m) => isTreatedLive(a.states.get(keyOf3(m)), a.stale);
|
|
12691
|
-
const offset = offsetOf(a.date);
|
|
12749
|
+
const offset = offsetOf(a.date, a.timeZone);
|
|
12692
12750
|
const onDate = (m) => localDateOfUnix(m.kickoffUnix, offset) === a.date;
|
|
12693
12751
|
const afterMidnight = [];
|
|
12694
12752
|
const built = [];
|
|
@@ -12871,8 +12929,8 @@ function useModalDialog(onClose, opts = {}) {
|
|
|
12871
12929
|
|
|
12872
12930
|
// src/components/MatchSheet.tsx
|
|
12873
12931
|
import { jsx as jsx95, jsxs as jsxs89 } from "react/jsx-runtime";
|
|
12874
|
-
function kickoffDate(kickoffUnix, lang) {
|
|
12875
|
-
return formatDate(kickoffUnix * 1e3, lang, { weekday: "short", day: "numeric", month: "short" });
|
|
12932
|
+
function kickoffDate(kickoffUnix, lang, timeZone) {
|
|
12933
|
+
return formatDate(kickoffUnix * 1e3, lang, { weekday: "short", day: "numeric", month: "short", timeZone });
|
|
12876
12934
|
}
|
|
12877
12935
|
function MatchSheet({ match, league, state, stale, ui, monitor, onAsk, onClose, opener }) {
|
|
12878
12936
|
const { dialogRef, onKeyDown } = useModalDialog(onClose, { opener });
|
|
@@ -12925,7 +12983,7 @@ function MatchSheet({ match, league, state, stale, ui, monitor, onAsk, onClose,
|
|
|
12925
12983
|
};
|
|
12926
12984
|
const { score, when } = rowStatusOf(state, stale, ui);
|
|
12927
12985
|
const statusParts = [when, score].filter((v) => v !== null && v !== void 0);
|
|
12928
|
-
const status2 = statusParts.length > 0 ? statusParts.join(" \xB7 ") : ui.kickoffLine(kickoffDate(match.kickoffUnix, ui.locale), kickoffLabel(match.kickoffUnix, ui.locale, clockOf(ui)));
|
|
12986
|
+
const status2 = statusParts.length > 0 ? statusParts.join(" \xB7 ") : ui.kickoffLine(kickoffDate(match.kickoffUnix, ui.locale, ui.timeZone), kickoffLabel(match.kickoffUnix, ui.locale, clockOf(ui), ui.timeZone));
|
|
12929
12987
|
return /* @__PURE__ */ jsx95("div", { className: "ss-w-tool-backdrop ss-w-sheet-backdrop", onClick: onBackdrop, children: /* @__PURE__ */ jsxs89("div", { ref: dialogRef, className: "ss-w-tool ss-w-sheet", role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, tabIndex: -1, onKeyDown, children: [
|
|
12930
12988
|
/* @__PURE__ */ jsxs89("div", { className: "ss-w-tool-head", children: [
|
|
12931
12989
|
/* @__PURE__ */ jsxs89("h2", { id: titleId, className: "ss-w-tool-title", children: [
|
|
@@ -13282,7 +13340,8 @@ function ScheduleMatchesPanel({ discovery, ui, monitor, sport, offered, onSport,
|
|
|
13282
13340
|
pinnedKeys,
|
|
13283
13341
|
isToday,
|
|
13284
13342
|
date: selected,
|
|
13285
|
-
query: q
|
|
13343
|
+
query: q,
|
|
13344
|
+
timeZone: ui.timeZone
|
|
13286
13345
|
});
|
|
13287
13346
|
const priced = sectionsFor("");
|
|
13288
13347
|
const { sections, afterMidnight } = searching ? sectionsFor(query) : priced;
|
|
@@ -16824,7 +16883,7 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
16824
16883
|
void request(lastRequest.current);
|
|
16825
16884
|
} }) : null
|
|
16826
16885
|
] }),
|
|
16827
|
-
quotedAt ? /* @__PURE__ */ jsx138("p", { className: "ss-w-v8-builder-note", "data-testid": "v8-asof", children: ui.v8PricesAsOf(fmtHhMm(quotedAt, ui.locale, clockOf(ui))) }) : null
|
|
16886
|
+
quotedAt ? /* @__PURE__ */ jsx138("p", { className: "ss-w-v8-builder-note", "data-testid": "v8-asof", children: ui.v8PricesAsOf(fmtHhMm(quotedAt, ui.locale, clockOf(ui), ui.timeZone)) }) : null
|
|
16828
16887
|
] }) : null
|
|
16829
16888
|
] }) : null });
|
|
16830
16889
|
}
|
|
@@ -20669,7 +20728,8 @@ function StatsWidget(props) {
|
|
|
20669
20728
|
operatorUserId,
|
|
20670
20729
|
anonymousUserId,
|
|
20671
20730
|
isOpen: panelOpen,
|
|
20672
|
-
pinnedMatchIds
|
|
20731
|
+
pinnedMatchIds,
|
|
20732
|
+
timeZone: ui.timeZone
|
|
20673
20733
|
});
|
|
20674
20734
|
const offeredSports = useMemo13(() => {
|
|
20675
20735
|
const seen = new Set(discovery.matchDays.map((d) => d.sport));
|
|
@@ -20684,7 +20744,8 @@ function StatsWidget(props) {
|
|
|
20684
20744
|
day: matchesDay,
|
|
20685
20745
|
sport: scheduleSport.sport,
|
|
20686
20746
|
getSchedule,
|
|
20687
|
-
enabled: panelOpen && monitor.activeTab === "matches"
|
|
20747
|
+
enabled: panelOpen && monitor.activeTab === "matches",
|
|
20748
|
+
timeZone: ui.timeZone
|
|
20688
20749
|
});
|
|
20689
20750
|
const prevLiveSnapshotRef = useRef43(monitor.snapshot);
|
|
20690
20751
|
useEffect52(() => {
|