@sensiblestats/widget-react 0.128.1 → 0.130.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/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 atLocalDate = new Date(at2.getFullYear(), at2.getMonth(), at2.getDate());
905
- const nowLocalDate = new Date(now.getFullYear(), now.getMonth(), now.getDate());
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 DAY_MS = 864e5;
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) / DAY_MS));
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
  };
@@ -1206,6 +1257,21 @@ function buildLocaleStrings(table, tag2, clock3 = "24h") {
1206
1257
  }
1207
1258
 
1208
1259
  // src/odds.ts
1260
+ var DISPLAY_KEYS = ["home", "away", "kickoffUtc", "market", "marketLabel", "selection", "line", "player"];
1261
+ var DISPLAY_MAX = 80;
1262
+ function slipDisplay(parts2) {
1263
+ const out = {};
1264
+ for (const k of DISPLAY_KEYS) {
1265
+ const v = typeof parts2[k] === "string" ? parts2[k].trim() : "";
1266
+ if (!v || k === "kickoffUtc" && !Number.isFinite(Date.parse(v))) continue;
1267
+ out[k] = v.slice(0, DISPLAY_MAX);
1268
+ }
1269
+ return Object.keys(out).length > 0 ? out : void 0;
1270
+ }
1271
+ function withMatch(selection, match) {
1272
+ const display = slipDisplay({ home: match.home, away: match.away, kickoffUtc: match.kickoffUtc, marketLabel: match.marketLabel, player: match.player });
1273
+ return display ? { ...selection, display } : selection;
1274
+ }
1209
1275
  function formatOdds(forms, format2) {
1210
1276
  return (format2 === "american" ? forms.american : format2 === "fractional" ? forms.fractional : forms.decimal) ?? forms.decimal;
1211
1277
  }
@@ -1219,7 +1285,7 @@ function parseOddsFormat(value) {
1219
1285
  }
1220
1286
 
1221
1287
  // src/version.generated.ts
1222
- var WIDGET_REACT_VERSION = "0.128.1";
1288
+ var WIDGET_REACT_VERSION = "0.130.0";
1223
1289
 
1224
1290
  // src/config.ts
1225
1291
  function hostTag(cfg) {
@@ -1228,7 +1294,8 @@ function hostTag(cfg) {
1228
1294
  }
1229
1295
  var isBundledFamily = (tag2) => sameFamily(tag2, BUNDLED_TAG);
1230
1296
  function normalizeUi(cfg, loaded) {
1231
- const strings = buildLocaleStrings(loaded.strings, loaded.tag, loaded.clock);
1297
+ const timeZone = validZone(cfg.timeZone);
1298
+ const strings = buildLocaleStrings(loaded.strings, loaded.tag, loaded.clock, timeZone);
1232
1299
  return {
1233
1300
  theme: cfg.theme ?? "auto",
1234
1301
  oddsFormat: parseOddsFormat(cfg.oddsFormat) ?? "decimal",
@@ -1237,6 +1304,7 @@ function normalizeUi(cfg, loaded) {
1237
1304
  headerTitle: cfg.headerTitle,
1238
1305
  locale: loaded.tag,
1239
1306
  clock: loaded.clock,
1307
+ timeZone,
1240
1308
  hostTag: hostTag(cfg),
1241
1309
  rawBettingLabels: isBundledFamily(loaded.tag),
1242
1310
  cta: cfg.cta,
@@ -1742,9 +1810,9 @@ function projectSeries(samples) {
1742
1810
  yMin = pMin - FLAT_DOMAIN_PAD;
1743
1811
  yMax = pMax + FLAT_DOMAIN_PAD;
1744
1812
  } else {
1745
- const pad2 = (pMax - pMin) * 0.1;
1746
- yMin = pMin - pad2;
1747
- yMax = pMax + pad2;
1813
+ const pad = (pMax - pMin) * 0.1;
1814
+ yMin = pMin - pad;
1815
+ yMax = pMax + pad;
1748
1816
  }
1749
1817
  const x = (atMs) => round2(PLOT_X0 + (atMs - tMin) / (tMax - tMin) * (PLOT_X1 - PLOT_X0));
1750
1818
  const y = (price) => round2(PLOT_Y1 - (price - yMin) / (yMax - yMin) * (PLOT_Y1 - PLOT_Y0));
@@ -1895,7 +1963,7 @@ function toSlipSelection(vm, conversationId) {
1895
1963
  if (vm.quotedAtUtc !== void 0) selection.quotedAtUtc = vm.quotedAtUtc;
1896
1964
  if (vm.id !== void 0) selection.insightId = vm.id;
1897
1965
  if (conversationId !== void 0) selection.conversationId = conversationId;
1898
- return selection;
1966
+ return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc, marketLabel: vm.market });
1899
1967
  }
1900
1968
  function toMarketOddsVM(card) {
1901
1969
  const rows = Array.isArray(card.rows) ? card.rows : [];
@@ -2012,7 +2080,7 @@ function marketOddsRowToSlipSelection(vm, row, conversationId) {
2012
2080
  const slipSport = slipSportOf(vm.sport);
2013
2081
  if (slipSport) selection.sport = slipSport;
2014
2082
  if (conversationId !== void 0) selection.conversationId = conversationId;
2015
- return selection;
2083
+ return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc, marketLabel: vm.market });
2016
2084
  }
2017
2085
  function finite(v) {
2018
2086
  return typeof v === "number" && Number.isFinite(v) ? v : void 0;
@@ -2086,7 +2154,7 @@ function comboLegToSlipSelection(leg, conversationId) {
2086
2154
  if (leg.quotedAtUtc !== void 0) selection.quotedAtUtc = leg.quotedAtUtc;
2087
2155
  if (leg.sport !== void 0) selection.sport = leg.sport;
2088
2156
  if (conversationId !== void 0) selection.conversationId = conversationId;
2089
- return selection;
2157
+ return withMatch(selection, { home: leg.homeTeamName, away: leg.awayTeamName, kickoffUtc: leg.kickoffUtc, marketLabel: leg.market });
2090
2158
  }
2091
2159
  var isNum = (v) => typeof v === "number" && Number.isFinite(v);
2092
2160
  var isObj = (v) => typeof v === "object" && v !== null;
@@ -2219,7 +2287,7 @@ function toNbaSlipSelection(vm, key, conversationId) {
2219
2287
  sport: "basketball"
2220
2288
  };
2221
2289
  if (conversationId !== void 0) selection.conversationId = conversationId;
2222
- return selection;
2290
+ return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc });
2223
2291
  }
2224
2292
  function nbaCoHitLegs(vm, conversationId) {
2225
2293
  if (vm.evidence.kind !== "co_hit") return [];
@@ -2232,6 +2300,7 @@ function nbaCoHitLegs(vm, conversationId) {
2232
2300
  matchId: vm.matchId,
2233
2301
  homeTeamName: vm.homeTeamName ?? "",
2234
2302
  awayTeamName: vm.awayTeamName ?? "",
2303
+ kickoffUtc: vm.kickoffUtc ?? void 0,
2235
2304
  market: vm.title,
2236
2305
  marketDeveloperName: s.marketDeveloperName,
2237
2306
  selection: s.selectionLabel,
@@ -2338,7 +2407,7 @@ function toNflSlipSelection(vm, key, nowMs, conversationId) {
2338
2407
  sport: "americanfootball"
2339
2408
  };
2340
2409
  if (conversationId !== void 0) selection.conversationId = conversationId;
2341
- return selection;
2410
+ return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc });
2342
2411
  }
2343
2412
 
2344
2413
  // src/slipKey.ts
@@ -2397,11 +2466,11 @@ function slipPickFields(selection, label, line) {
2397
2466
  if (Number.isFinite(odds) && odds > 1 && odds <= MAX_ODDS) fields.odds = odds;
2398
2467
  return fields;
2399
2468
  }
2400
- function chipSelection(market, matchId, conversationId) {
2469
+ function chipSelection(market, match, conversationId) {
2401
2470
  if (!market || !market.addToSlipEnabled || typeof market.matchOddsId !== "number" || typeof market.price !== "number" || !market.priceFormats) return null;
2402
- const selection = { matchOddsId: market.matchOddsId, matchId, oddsDecimal: market.price, forms: market.priceFormats };
2471
+ const selection = { matchOddsId: market.matchOddsId, matchId: match.matchId, oddsDecimal: market.price, forms: market.priceFormats };
2403
2472
  if (conversationId !== void 0) selection.conversationId = conversationId;
2404
- return selection;
2473
+ return withMatch(selection, { home: match.homeTeamName, away: match.awayTeamName, kickoffUtc: match.kickoffUtc, marketLabel: market.marketLabel });
2405
2474
  }
2406
2475
  function chipPriceText(market, format2) {
2407
2476
  return typeof market.price === "number" && market.priceFormats ? formatOdds(market.priceFormats, format2) : void 0;
@@ -3507,12 +3576,12 @@ import { matchKey as matchKey3 } from "@sensiblestats/widget-sdk";
3507
3576
  var PREFIX2 = "ss-w-schedule:";
3508
3577
  var SCHEMA_VERSION = 7;
3509
3578
  var TTL_MS3 = 6 * 36e5;
3510
- function scheduleCacheKey(operatorId, encodedUserKey2, localDate) {
3511
- return `${PREFIX2}${operatorId}:${encodedUserKey2}:${localDate}`;
3579
+ function scheduleCacheKey(operatorId, encodedUserKey2, localDate, timeZone) {
3580
+ return `${PREFIX2}${operatorId}:${encodedUserKey2}:${timeZone ?? "local"}:${localDate}`;
3512
3581
  }
3513
- function read(operatorId, encodedUserKey2, localDate) {
3582
+ function read(operatorId, encodedUserKey2, localDate, timeZone) {
3514
3583
  try {
3515
- const raw = localStorage.getItem(scheduleCacheKey(operatorId, encodedUserKey2, localDate));
3584
+ const raw = localStorage.getItem(scheduleCacheKey(operatorId, encodedUserKey2, localDate, timeZone));
3516
3585
  if (!raw) return null;
3517
3586
  const entry = JSON.parse(raw);
3518
3587
  if (entry.v !== SCHEMA_VERSION || !entry.payload) return null;
@@ -3521,13 +3590,13 @@ function read(operatorId, encodedUserKey2, localDate) {
3521
3590
  return null;
3522
3591
  }
3523
3592
  }
3524
- function readSchedule(operatorId, encodedUserKey2, localDate, nowMs) {
3525
- const entry = read(operatorId, encodedUserKey2, localDate);
3593
+ function readSchedule(operatorId, encodedUserKey2, localDate, nowMs, timeZone) {
3594
+ const entry = read(operatorId, encodedUserKey2, localDate, timeZone);
3526
3595
  if (!entry) return null;
3527
3596
  return nowMs - entry.at > TTL_MS3 ? null : entry.payload;
3528
3597
  }
3529
- function readScheduleIgnoringTtl(operatorId, encodedUserKey2, localDate) {
3530
- return read(operatorId, encodedUserKey2, localDate)?.payload ?? null;
3598
+ function readScheduleIgnoringTtl(operatorId, encodedUserKey2, localDate, timeZone) {
3599
+ return read(operatorId, encodedUserKey2, localDate, timeZone)?.payload ?? null;
3531
3600
  }
3532
3601
  function skeletonOnly(payload) {
3533
3602
  return {
@@ -3566,8 +3635,8 @@ function skeletonOnly(payload) {
3566
3635
  }))
3567
3636
  };
3568
3637
  }
3569
- function writeSchedule(operatorId, encodedUserKey2, localDate, payload, nowMs) {
3570
- const keep = scheduleCacheKey(operatorId, encodedUserKey2, localDate);
3638
+ function writeSchedule(operatorId, encodedUserKey2, localDate, payload, nowMs, timeZone) {
3639
+ const keep = scheduleCacheKey(operatorId, encodedUserKey2, localDate, timeZone);
3571
3640
  const mine = `${PREFIX2}${operatorId}:${encodedUserKey2}:`;
3572
3641
  try {
3573
3642
  for (let i = localStorage.length - 1; i >= 0; i--) {
@@ -3579,9 +3648,9 @@ function writeSchedule(operatorId, encodedUserKey2, localDate, payload, nowMs) {
3579
3648
  } catch {
3580
3649
  }
3581
3650
  }
3582
- function clearSchedule(operatorId, encodedUserKey2, localDate) {
3651
+ function clearSchedule(operatorId, encodedUserKey2, localDate, timeZone) {
3583
3652
  try {
3584
- localStorage.removeItem(scheduleCacheKey(operatorId, encodedUserKey2, localDate));
3653
+ localStorage.removeItem(scheduleCacheKey(operatorId, encodedUserKey2, localDate, timeZone));
3585
3654
  } catch {
3586
3655
  }
3587
3656
  }
@@ -3623,6 +3692,51 @@ function nearestTennisKeys(open) {
3623
3692
  return [...open.values()].sort((a, b) => a.kickoffUnix - b.kickoffUnix).slice(0, MAX_TENNIS_KEYS).map((e) => e.key);
3624
3693
  }
3625
3694
 
3695
+ // src/scheduleDays.ts
3696
+ var MAX_AFTER_TODAY = 6;
3697
+ var parts = (date) => {
3698
+ const [y = 0, m = 1, d = 1] = date.split("-").map(Number);
3699
+ return [y, m, d];
3700
+ };
3701
+ function offsetOf(localDate, timeZone) {
3702
+ const [y, m, d] = parts(localDate);
3703
+ if (timeZone === void 0) return -new Date(y, m - 1, d, 12).getTimezoneOffset();
3704
+ const utcNoon = Date.UTC(y, m - 1, d, 12);
3705
+ return zoneOffsetMinutes(utcNoon - zoneOffsetMinutes(utcNoon, timeZone) * 6e4, timeZone);
3706
+ }
3707
+ function localDateOfUnix(unix, offsetMinutes = -new Date(unix * 1e3).getTimezoneOffset()) {
3708
+ return new Date((unix + offsetMinutes * 60) * 1e3).toISOString().slice(0, 10);
3709
+ }
3710
+ var dayAfter = (date) => {
3711
+ const [y, m, d] = parts(date);
3712
+ return new Date(Date.UTC(y, m - 1, d + 1)).toISOString().slice(0, 10);
3713
+ };
3714
+ function buildDayChips(today, matchDays, sport) {
3715
+ const dates = /* @__PURE__ */ new Set();
3716
+ for (const md of matchDays) {
3717
+ if (sport !== "all" && md.sport !== sport) continue;
3718
+ for (const date of md.dates) if (date > today) dates.add(date);
3719
+ }
3720
+ const chips = [{ date: today, isToday: true, gapBefore: false }];
3721
+ for (const date of [...dates].sort().slice(0, MAX_AFTER_TODAY)) {
3722
+ const prev = chips[chips.length - 1];
3723
+ chips.push({ date, isToday: false, gapBefore: prev !== void 0 && dayAfter(prev.date) !== date });
3724
+ }
3725
+ return chips;
3726
+ }
3727
+ function weekdayAndDay(date, tag2) {
3728
+ const [y, m, d] = parts(date);
3729
+ const at2 = new Date(Date.UTC(y, m - 1, d, 12));
3730
+ return {
3731
+ weekday: formatDate(at2, tag2, { weekday: "short", timeZone: "UTC" }),
3732
+ day: formatDate(at2, tag2, { day: "numeric", timeZone: "UTC" })
3733
+ };
3734
+ }
3735
+ function weekdayLong(date, tag2) {
3736
+ const [y, m, d] = parts(date);
3737
+ return formatDate(new Date(Date.UTC(y, m - 1, d, 12)), tag2, { weekday: "long", timeZone: "UTC" });
3738
+ }
3739
+
3626
3740
  // src/liveClock.ts
3627
3741
  import { matchKey as matchKey2 } from "@sensiblestats/widget-sdk";
3628
3742
  function isTreatedLive(state, pollStale) {
@@ -3642,7 +3756,11 @@ var STALE_AFTER_FAILURES = 2;
3642
3756
  function encodedUserKey(operatorUserId, anonymousUserId) {
3643
3757
  return encodeURIComponent(operatorUserId || anonymousUserId || "none");
3644
3758
  }
3645
- function localDateOf(now) {
3759
+ function localDateOf(now, timeZone) {
3760
+ if (timeZone !== void 0) {
3761
+ const p = zonedParts(now.getTime(), timeZone);
3762
+ return `${p.year}-${`${p.month}`.padStart(2, "0")}-${`${p.day}`.padStart(2, "0")}`;
3763
+ }
3646
3764
  const y = now.getFullYear();
3647
3765
  const m = `${now.getMonth() + 1}`.padStart(2, "0");
3648
3766
  const d = `${now.getDate()}`.padStart(2, "0");
@@ -3668,19 +3786,19 @@ function useMatchDiscovery(opts) {
3668
3786
  statesRef.current = states;
3669
3787
  const getStatesRef = useRef4(opts.getStates);
3670
3788
  getStatesRef.current = opts.getStates;
3671
- const [localDate, setLocalDate] = useState4(() => localDateOf(/* @__PURE__ */ new Date()));
3789
+ const [localDate, setLocalDate] = useState4(() => localDateOf(/* @__PURE__ */ new Date(), opts.timeZone));
3672
3790
  useEffect5(() => {
3673
3791
  const id = setInterval(() => {
3674
- const next = localDateOf(/* @__PURE__ */ new Date());
3792
+ const next = localDateOf(/* @__PURE__ */ new Date(), opts.timeZone);
3675
3793
  setLocalDate((prev) => prev === next ? prev : next);
3676
3794
  }, ROLLOVER_CHECK_MS);
3677
3795
  return () => clearInterval(id);
3678
- }, []);
3796
+ }, [opts.timeZone]);
3679
3797
  useEffect5(() => {
3680
3798
  let cancelled = false;
3681
- const utcOffsetMinutes = -(/* @__PURE__ */ new Date()).getTimezoneOffset();
3799
+ const utcOffsetMinutes = opts.timeZone === void 0 ? -(/* @__PURE__ */ new Date()).getTimezoneOffset() : offsetOf(localDate, opts.timeZone);
3682
3800
  const key = encodedUserKey(opts.operatorUserId, opts.anonymousUserId);
3683
- const cached = readSchedule(opts.operatorId, key, localDate, Date.now());
3801
+ const cached = readSchedule(opts.operatorId, key, localDate, Date.now(), opts.timeZone);
3684
3802
  if (cached) {
3685
3803
  if (!cancelled) {
3686
3804
  setGroups(cached.groups);
@@ -3700,12 +3818,12 @@ function useMatchDiscovery(opts) {
3700
3818
  setScheduleLoaded(true);
3701
3819
  return;
3702
3820
  }
3703
- writeSchedule(opts.operatorId, key, localDate, payload, Date.now());
3821
+ writeSchedule(opts.operatorId, key, localDate, payload, Date.now(), opts.timeZone);
3704
3822
  setGroups(payload.groups);
3705
3823
  setMatchDays(payload.matchDays ?? []);
3706
3824
  setScheduleLoaded(true);
3707
3825
  } catch {
3708
- const fallback = readScheduleIgnoringTtl(opts.operatorId, key, localDate);
3826
+ const fallback = readScheduleIgnoringTtl(opts.operatorId, key, localDate, opts.timeZone);
3709
3827
  if (!cancelled && fallback) {
3710
3828
  setGroups(fallback.groups);
3711
3829
  setMatchDays(fallback.matchDays ?? []);
@@ -3716,7 +3834,7 @@ function useMatchDiscovery(opts) {
3716
3834
  return () => {
3717
3835
  cancelled = true;
3718
3836
  };
3719
- }, [opts.operatorId, opts.operatorUserId, opts.anonymousUserId, localDate, refreshKey]);
3837
+ }, [opts.operatorId, opts.operatorUserId, opts.anonymousUserId, localDate, refreshKey, opts.timeZone]);
3720
3838
  const tick = useCallback2(async () => {
3721
3839
  const ids = dueMatchIds(groupsRef.current, statesRef.current, Date.now());
3722
3840
  if (ids.football.length === 0 && ids.nba.length === 0 && ids.nfl.length === 0 && ids.tennis.length === 0) return;
@@ -3751,10 +3869,10 @@ function useMatchDiscovery(opts) {
3751
3869
  return n;
3752
3870
  }, [groups, states, stale]);
3753
3871
  const refreshSchedule = useCallback2(async () => {
3754
- clearSchedule(opts.operatorId, encodedUserKey(opts.operatorUserId, opts.anonymousUserId), localDate);
3872
+ clearSchedule(opts.operatorId, encodedUserKey(opts.operatorUserId, opts.anonymousUserId), localDate, opts.timeZone);
3755
3873
  setRefreshKey((n) => n + 1);
3756
3874
  setScheduleVersion((n) => n + 1);
3757
- }, [opts.operatorId, opts.operatorUserId, opts.anonymousUserId, localDate]);
3875
+ }, [opts.operatorId, opts.operatorUserId, opts.anonymousUserId, localDate, opts.timeZone]);
3758
3876
  return { groups, localDate, matchDays, scheduleLoaded, states, liveCount, stale, refreshSchedule, scheduleVersion, _tick: tick };
3759
3877
  }
3760
3878
 
@@ -5845,7 +5963,8 @@ function useSlipAdd(slip, ui) {
5845
5963
  const operatorFormat = ui?.oddsFormat ?? "decimal";
5846
5964
  return useCallback14(async (selection, { marketDeveloperName, selectionLabel, line }) => {
5847
5965
  if (!handler) return { kind: "failed" };
5848
- const out = toHostSelection(selection, operatorFormat);
5966
+ const display = slipDisplay({ ...selection.display, market: marketDeveloperName, selection: selectionLabel, line });
5967
+ const out = toHostSelection(display ? { ...selection, display } : selection, operatorFormat);
5849
5968
  const pick = slipPickFields(out, rawLabels ? selectionLabel : void 0, line);
5850
5969
  const wireSport = toWireSport3(out.sport);
5851
5970
  const sportField = {
@@ -6289,8 +6408,8 @@ function OddsRow({ vm, row, ui, slip, inSlipIds, history, suppressSlip }) {
6289
6408
  ] });
6290
6409
  }
6291
6410
  var STALE_AFTER_MS = 12e4;
6292
- function fmtHhMm(iso, tag2, clock3) {
6293
- return formatTime(iso, tag2, clock3);
6411
+ function fmtHhMm(iso, tag2, clock3, timeZone) {
6412
+ return formatTime(iso, tag2, clock3, { timeZone });
6294
6413
  }
6295
6414
  function MarketOddsCard({ vm, ui, slip, monitor, inSlipIds, hideHeader, pinRef }) {
6296
6415
  const [open, setOpen] = useState24(false);
@@ -6303,7 +6422,7 @@ function MarketOddsCard({ vm, ui, slip, monitor, inSlipIds, hideHeader, pinRef }
6303
6422
  const isClosed = closedReason !== null;
6304
6423
  const asOfMs = live ? new Date(live.asOfUtc).getTime() : NaN;
6305
6424
  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;
6425
+ const staleTime = isStale && live ? fmtHhMm(live.asOfUtc, ui.locale, clockOf(ui), ui.timeZone) : null;
6307
6426
  const [, setStaleTick] = useState24(0);
6308
6427
  const watchStale = live != null && !isClosed && !isStale;
6309
6428
  useEffect19(() => {
@@ -6429,9 +6548,9 @@ function allowedForStars(stars, leg) {
6429
6548
  import { jsx as jsx13, jsxs as jsxs11 } from "react/jsx-runtime";
6430
6549
  var asOf = (iso, ui) => {
6431
6550
  const at2 = new Date(iso);
6432
- const time = fmtHhMm(iso, ui.locale, clockOf(ui));
6433
- if (at2.toDateString() === (/* @__PURE__ */ new Date()).toDateString()) return time;
6434
- return `${formatDate(at2, ui.locale, { day: "numeric", month: "short" })} ${time}`;
6551
+ const time = fmtHhMm(iso, ui.locale, clockOf(ui), ui.timeZone);
6552
+ if (zonedDayNumber(at2.getTime(), ui.timeZone) === zonedDayNumber(Date.now(), ui.timeZone)) return time;
6553
+ return `${formatDate(at2, ui.locale, { day: "numeric", month: "short", timeZone: ui.timeZone })} ${time}`;
6435
6554
  };
6436
6555
  function CardLine({ card, ui, slip, sport, marketKey, conversation, operatorUserId, anonymousUserId }) {
6437
6556
  const matchId = card.matchId;
@@ -6653,9 +6772,8 @@ function instantMs(iso) {
6653
6772
  const ms = Date.parse(iso);
6654
6773
  return Number.isNaN(ms) ? null : ms;
6655
6774
  }
6656
- function localDayStart(ms) {
6657
- const d = new Date(ms);
6658
- return new Date(d.getFullYear(), d.getMonth(), d.getDate()).getTime();
6775
+ function localDayStart(ms, timeZone) {
6776
+ return zonedDayNumber(ms, timeZone) * 864e5;
6659
6777
  }
6660
6778
  function kickoffText(ui, iso) {
6661
6779
  if (instantMs(iso) === null) return null;
@@ -6820,15 +6938,15 @@ function MatchCard({ card, ui, slip, sport, marketKey, conversation, operatorUse
6820
6938
  import { jsx as jsx22, jsxs as jsxs20 } from "react/jsx-runtime";
6821
6939
  var STATUSES = ["available", "doubtful", "out"];
6822
6940
  var MAX_MARKS = 30;
6823
- var pad = (n) => String(n).padStart(2, "0");
6824
- function clock(iso) {
6941
+ function clock(iso, ui) {
6825
6942
  if (!iso) return null;
6826
6943
  const at2 = new Date(iso);
6827
- return Number.isNaN(at2.getTime()) ? null : `${pad(at2.getHours())}:${pad(at2.getMinutes())}`;
6944
+ if (Number.isNaN(at2.getTime())) return null;
6945
+ return formatTime(at2, ui.locale, clockOf(ui), { timeZone: ui.timeZone });
6828
6946
  }
6829
6947
  function badge(card, ui) {
6830
6948
  if (card.status === "out") {
6831
- const time = clock(card.statusAsOfUtc);
6949
+ const time = clock(card.statusAsOfUtc, ui);
6832
6950
  return { kind: "out", text: time ? ui.v8Out(time) : ui.v8OutNoTime };
6833
6951
  }
6834
6952
  return card.status === "doubtful" ? { kind: "doubtful", text: ui.v8Doubtful } : null;
@@ -6876,10 +6994,10 @@ function SinceLines({ since, ui }) {
6876
6994
  // src/components/dashboard/v8/YouRibbon.tsx
6877
6995
  import { jsx as jsx24, jsxs as jsxs22 } from "react/jsx-runtime";
6878
6996
  var FROM_CHATS_SHOWN = 2;
6879
- function showsNoGamesNote(chip, now = Date.now()) {
6997
+ function showsNoGamesNote(chip, now = Date.now(), timeZone) {
6880
6998
  if (chip.kind !== "competition") return false;
6881
6999
  const at2 = instantMs(chip.nextGameAtUtc);
6882
- if (at2 !== null) return localDayStart(at2) > localDayStart(now);
7000
+ if (at2 !== null) return localDayStart(at2, timeZone) > localDayStart(now, timeZone);
6883
7001
  return chip.noGamesToday === true;
6884
7002
  }
6885
7003
  function YouRibbon({ ribbon, ui, controller, holds, sport, onMore }) {
@@ -6889,7 +7007,7 @@ function YouRibbon({ ribbon, ui, controller, holds, sport, onMore }) {
6889
7007
  return /* @__PURE__ */ jsxs22("section", { className: "ss-w-v8-sec ss-w-v8-ribbon", children: [
6890
7008
  /* @__PURE__ */ jsxs22("div", { className: "ss-w-v8-chips", children: [
6891
7009
  ribbon.stars.map((chip, i) => {
6892
- const quiet = showsNoGamesNote(chip);
7010
+ const quiet = showsNoGamesNote(chip, Date.now(), ui.timeZone);
6893
7011
  return /* @__PURE__ */ jsxs22("span", { className: `ss-w-v8-chip ss-w-v8-chip--${chip.kind}`, children: [
6894
7012
  chip.playing && !quiet ? /* @__PURE__ */ jsx24("i", { className: "ss-w-v8-playing", "aria-hidden": "true" }) : null,
6895
7013
  chip.label,
@@ -7102,54 +7220,9 @@ import { useCallback as useCallback21, useMemo as useMemo8, useState as useState
7102
7220
 
7103
7221
  // src/useScheduleDay.ts
7104
7222
  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
7223
  var EMPTY = [];
7151
7224
  function useScheduleDay(opts) {
7152
- const { localDate, today, todayGroups, enabled, resetKey } = opts;
7225
+ const { localDate, today, todayGroups, enabled, resetKey, timeZone } = opts;
7153
7226
  const getRef = useRef18(opts.getSchedule);
7154
7227
  getRef.current = opts.getSchedule;
7155
7228
  const daysRef = useRef18(/* @__PURE__ */ new Map());
@@ -7157,12 +7230,14 @@ function useScheduleDay(opts) {
7157
7230
  const [retryKey, setRetryKey] = useState28(0);
7158
7231
  const [seenDate, setSeenDate] = useState28(localDate);
7159
7232
  const [seenReset, setSeenReset] = useState28(resetKey);
7233
+ const [seenZone, setSeenZone] = useState28(timeZone);
7160
7234
  if (seenDate !== localDate) {
7161
7235
  setSeenDate(localDate);
7162
7236
  setFetched({ status: "idle", groups: EMPTY });
7163
7237
  }
7164
- if (seenReset !== resetKey) {
7238
+ if (seenReset !== resetKey || seenZone !== timeZone) {
7165
7239
  setSeenReset(resetKey);
7240
+ setSeenZone(timeZone);
7166
7241
  daysRef.current.clear();
7167
7242
  setFetched({ status: "idle", groups: EMPTY });
7168
7243
  }
@@ -7173,7 +7248,7 @@ function useScheduleDay(opts) {
7173
7248
  setFetched({ status: "loading", groups: EMPTY });
7174
7249
  void (async () => {
7175
7250
  try {
7176
- const payload = await getRef.current(localDate, offsetOf(localDate));
7251
+ const payload = await getRef.current(localDate, offsetOf(localDate, timeZone));
7177
7252
  if (cancelled) return;
7178
7253
  if (!payload) {
7179
7254
  setFetched({ status: "error", groups: EMPTY });
@@ -7188,7 +7263,7 @@ function useScheduleDay(opts) {
7188
7263
  return () => {
7189
7264
  cancelled = true;
7190
7265
  };
7191
- }, [localDate, isToday, enabled, retryKey, resetKey]);
7266
+ }, [localDate, isToday, enabled, retryKey, resetKey, timeZone]);
7192
7267
  const retry = useCallback20(() => {
7193
7268
  setRetryKey((k) => k + 1);
7194
7269
  }, []);
@@ -7200,7 +7275,7 @@ function useScheduleDay(opts) {
7200
7275
  }
7201
7276
 
7202
7277
  // src/useMatchesDay.ts
7203
- function useMatchesDay({ discovery, day, sport, getSchedule, enabled }) {
7278
+ function useMatchesDay({ discovery, day, sport, getSchedule, enabled, timeZone }) {
7204
7279
  const { localDate: today, matchDays } = discovery;
7205
7280
  const chips = useMemo8(() => buildDayChips(today, matchDays, sport), [today, matchDays, sport]);
7206
7281
  const selected = chips.some((c) => c.date === day) ? day : today;
@@ -7210,6 +7285,7 @@ function useMatchesDay({ discovery, day, sport, getSchedule, enabled }) {
7210
7285
  todayGroups: discovery.groups,
7211
7286
  getSchedule,
7212
7287
  enabled,
7288
+ timeZone,
7213
7289
  resetKey: String(discovery.scheduleVersion)
7214
7290
  });
7215
7291
  return { ...loaded, chips, selected };
@@ -8744,7 +8820,7 @@ function ticksFor(lo, hi) {
8744
8820
  return out;
8745
8821
  }
8746
8822
  function scatterScale(e) {
8747
- const { w, h, pad: pad2 } = SCATTER_VIEW;
8823
+ const { w, h, pad } = SCATTER_VIEW;
8748
8824
  const xs = finite3([...e.field.map((d) => d.returnPct), ...e.marked.map((m) => m.returnPct), e.tourReturnPct]);
8749
8825
  const ys = finite3([...e.field.map((d) => d.servePct), ...e.marked.map((m) => m.servePct), e.tourServePct]);
8750
8826
  const x0 = Math.floor(Math.min(...xs) - 1);
@@ -8752,26 +8828,26 @@ function scatterScale(e) {
8752
8828
  const y0 = Math.floor(Math.min(...ys) - 1);
8753
8829
  const y1 = Math.ceil(Math.max(...ys) + 1);
8754
8830
  return {
8755
- x: (v) => round22(pad2.l + (v - x0) / (x1 - x0) * (w - pad2.l - pad2.r)),
8756
- y: (v) => round22(h - pad2.b - (v - y0) / (y1 - y0) * (h - pad2.t - pad2.b)),
8831
+ x: (v) => round22(pad.l + (v - x0) / (x1 - x0) * (w - pad.l - pad.r)),
8832
+ y: (v) => round22(h - pad.b - (v - y0) / (y1 - y0) * (h - pad.t - pad.b)),
8757
8833
  ticksX: ticksFor(x0, x1),
8758
8834
  ticksY: ticksFor(y0, y1)
8759
8835
  };
8760
8836
  }
8761
8837
  function formBars(e) {
8762
- const { w, h, pad: pad2 } = FORM_VIEW;
8838
+ const { w, h, pad } = FORM_VIEW;
8763
8839
  const n = e.matches.length;
8764
8840
  const bounds = finite3([e.min, e.max, e.tourServePct]);
8765
8841
  const lo = Math.min(...bounds) - 4;
8766
8842
  const hi = Math.max(...bounds) + 2;
8767
- const plotW = w - pad2.l - pad2.r;
8768
- const base = h - pad2.b;
8769
- const y = (v) => round22(base - (v - lo) / (hi - lo) * (h - pad2.t - pad2.b));
8843
+ const plotW = w - pad.l - pad.r;
8844
+ const base = h - pad.b;
8845
+ const y = (v) => round22(base - (v - lo) / (hi - lo) * (h - pad.t - pad.b));
8770
8846
  const slot = plotW / Math.max(n, 1);
8771
8847
  const bw = Math.max(1, Math.min(MAX_BAR_W, slot - BAR_GAP));
8772
8848
  const bars = e.matches.map((m, i) => {
8773
8849
  const top = y(clampTo(m.servePct, lo, hi));
8774
- return { x: round22(pad2.l + slot * i + (slot - bw) / 2), w: round22(bw), y: top, h: round22(base - top), won: m.result === "W" };
8850
+ return { x: round22(pad.l + slot * i + (slot - bw) / 2), w: round22(bw), y: top, h: round22(base - top), won: m.result === "W" };
8775
8851
  });
8776
8852
  return { bars, tourY: y(e.tourServePct) };
8777
8853
  }
@@ -8794,9 +8870,9 @@ function roundSpan(e) {
8794
8870
  return { lo, span: ROUND_STEPS - lo };
8795
8871
  }
8796
8872
  function pathRounds(e) {
8797
- const { h, pad: pad2 } = PATH_VIEW;
8798
- const base = h - pad2.b;
8799
- const plotH = h - pad2.t - pad2.b;
8873
+ const { h, pad } = PATH_VIEW;
8874
+ const base = h - pad.b;
8875
+ const plotH = h - pad.t - pad.b;
8800
8876
  const { lo, span } = roundSpan(e);
8801
8877
  const seen = /* @__PURE__ */ new Map();
8802
8878
  for (const ev of e.events) {
@@ -8820,11 +8896,11 @@ function pathGutter(e) {
8820
8896
  return Math.max(PATH_VIEW.pad.l, Math.ceil(longest * GLYPH_W) + GUTTER_PAD + 4);
8821
8897
  }
8822
8898
  function pathBars(e, left = PATH_VIEW.pad.l) {
8823
- const { w, h, pad: pad2 } = PATH_VIEW;
8899
+ const { w, h, pad } = PATH_VIEW;
8824
8900
  const n = e.events.length;
8825
- const plotW = w - left - pad2.r;
8826
- const plotH = h - pad2.t - pad2.b;
8827
- const base = h - pad2.b;
8901
+ const plotW = w - left - pad.r;
8902
+ const plotH = h - pad.t - pad.b;
8903
+ const base = h - pad.b;
8828
8904
  const slot = plotW / Math.max(n, 1);
8829
8905
  const bw = Math.max(1, Math.min(MAX_BAR_W, slot - BAR_GAP));
8830
8906
  const { lo, span } = roundSpan(e);
@@ -8884,7 +8960,7 @@ function TennisInsightPriceRow({ prices }) {
8884
8960
  ] });
8885
8961
  }
8886
8962
  function ServeReturnChart({ vm, e, ui }) {
8887
- const { w, h, pad: pad2 } = SCATTER_VIEW;
8963
+ const { w, h, pad } = SCATTER_VIEW;
8888
8964
  const s = scatterScale(e);
8889
8965
  const tx = s.x(e.tourReturnPct);
8890
8966
  const ty = s.y(e.tourServePct);
@@ -8896,19 +8972,19 @@ function ServeReturnChart({ vm, e, ui }) {
8896
8972
  });
8897
8973
  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
8974
  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: pad2.t, y2: h - pad2.b }),
8900
- /* @__PURE__ */ jsx38("text", { className: "ss-w-tni-tick", x: s.x(t), y: h - pad2.b + 11, textAnchor: "middle", children: pct(t, ui, 0) })
8975
+ /* @__PURE__ */ jsx38("line", { className: "ss-w-tni-grid", x1: s.x(t), x2: s.x(t), y1: pad.t, y2: h - pad.b }),
8976
+ /* @__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
8977
  ] }, `x${t}`)),
8902
8978
  s.ticksY.map((t) => /* @__PURE__ */ jsxs34("g", { children: [
8903
- /* @__PURE__ */ jsx38("line", { className: "ss-w-tni-grid", x1: pad2.l, x2: w - pad2.r, y1: s.y(t), y2: s.y(t) }),
8904
- /* @__PURE__ */ jsx38("text", { className: "ss-w-tni-tick", x: pad2.l - 4, y: s.y(t) + 3, textAnchor: "end", children: pct(t, ui, 0) })
8979
+ /* @__PURE__ */ jsx38("line", { className: "ss-w-tni-grid", x1: pad.l, x2: w - pad.r, y1: s.y(t), y2: s.y(t) }),
8980
+ /* @__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
8981
  ] }, `y${t}`)),
8906
- /* @__PURE__ */ jsx38("text", { className: "ss-w-tni-axis", x: pad2.l + (w - pad2.l - pad2.r) / 2, y: h - 3, textAnchor: "middle", children: e.xAxis }),
8907
- /* @__PURE__ */ jsx38("text", { className: "ss-w-tni-axis", transform: `translate(8 ${pad2.t + (h - pad2.t - pad2.b) / 2}) rotate(-90)`, textAnchor: "middle", children: e.yAxis }),
8982
+ /* @__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 }),
8983
+ /* @__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
8984
  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: pad2.t, y2: h - pad2.b }),
8910
- /* @__PURE__ */ jsx38("line", { className: "ss-w-tni-tour", x1: pad2.l, x2: w - pad2.r, y1: ty, y2: ty }),
8911
- /* @__PURE__ */ jsx38("text", { className: "ss-w-tni-lab ss-w-tni-lab-faint", x: w - pad2.r - 2, y: ty - 4, textAnchor: "end", children: e.tourAverage }),
8985
+ /* @__PURE__ */ jsx38("line", { className: "ss-w-tni-tour", x1: tx, x2: tx, y1: pad.t, y2: h - pad.b }),
8986
+ /* @__PURE__ */ jsx38("line", { className: "ss-w-tni-tour", x1: pad.l, x2: w - pad.r, y1: ty, y2: ty }),
8987
+ /* @__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
8988
  e.marked.map((m, i) => {
8913
8989
  const l = labels[i];
8914
8990
  return /* @__PURE__ */ jsxs34("g", { children: [
@@ -8929,15 +9005,15 @@ function ServeReturnCard({ vm, e, ui }) {
8929
9005
  ] });
8930
9006
  }
8931
9007
  function ServeFormCard({ vm, e, ui }) {
8932
- const { w, h, pad: pad2 } = FORM_VIEW;
9008
+ const { w, h, pad } = FORM_VIEW;
8933
9009
  const { bars, tourY } = formBars(e);
8934
9010
  const lo = Math.min(e.min, e.tourServePct) - 4;
8935
9011
  const hi = Math.max(e.max, e.tourServePct) + 2;
8936
- const base = h - pad2.b;
8937
- const yOf = (v) => base - (v - lo) / (hi - lo) * (h - pad2.t - pad2.b);
9012
+ const base = h - pad.b;
9013
+ const yOf = (v) => base - (v - lo) / (hi - lo) * (h - pad.t - pad.b);
8938
9014
  const ticks = [];
8939
9015
  for (let t = Math.ceil(lo / 5) * 5; t <= hi; t += 5) ticks.push(t);
8940
- const slot = (w - pad2.l - pad2.r) / Math.max(e.matches.length, 1);
9016
+ const slot = (w - pad.l - pad.r) / Math.max(e.matches.length, 1);
8941
9017
  const tiles = [
8942
9018
  { label: e.labels.average, value: pct(e.average, ui) },
8943
9019
  e.winsAverage == null ? null : { label: e.labels.inWins, value: pct(e.winsAverage, ui) },
@@ -8946,10 +9022,10 @@ function ServeFormCard({ vm, e, ui }) {
8946
9022
  ].filter((t) => t !== null);
8947
9023
  return /* @__PURE__ */ jsxs34(Fragment8, { children: [
8948
9024
  /* @__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: pad2.l, y: 9, children: e.labels.metric }),
9025
+ /* @__PURE__ */ jsx38("text", { className: "ss-w-tni-axis", x: pad.l, y: 9, children: e.labels.metric }),
8950
9026
  ticks.map((t) => /* @__PURE__ */ jsxs34("g", { children: [
8951
- /* @__PURE__ */ jsx38("line", { className: "ss-w-tni-grid", x1: pad2.l, x2: w - pad2.r, y1: yOf(t), y2: yOf(t) }),
8952
- /* @__PURE__ */ jsx38("text", { className: "ss-w-tni-tick", x: pad2.l - 4, y: yOf(t) + 3, textAnchor: "end", children: pct(t, ui, 0) })
9027
+ /* @__PURE__ */ jsx38("line", { className: "ss-w-tni-grid", x1: pad.l, x2: w - pad.r, y1: yOf(t), y2: yOf(t) }),
9028
+ /* @__PURE__ */ jsx38("text", { className: "ss-w-tni-tick", x: pad.l - 4, y: yOf(t) + 3, textAnchor: "end", children: pct(t, ui, 0) })
8953
9029
  ] }, t)),
8954
9030
  bars.map((b, i) => {
8955
9031
  const m = e.matches[i];
@@ -8961,8 +9037,8 @@ function ServeFormCard({ vm, e, ui }) {
8961
9037
  /* @__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
9038
  ] }, m.matchId);
8963
9039
  }),
8964
- /* @__PURE__ */ jsx38("line", { className: "ss-w-tni-tour", x1: pad2.l, x2: w - pad2.r, y1: tourY, y2: tourY }),
8965
- /* @__PURE__ */ jsx38("text", { className: "ss-w-tni-lab ss-w-tni-lab-faint", x: w - pad2.r - 2, y: pad2.t - 4, textAnchor: "end", children: `${e.labels.tourAverage} ${pct(e.tourServePct, ui)}` })
9040
+ /* @__PURE__ */ jsx38("line", { className: "ss-w-tni-tour", x1: pad.l, x2: w - pad.r, y1: tourY, y2: tourY }),
9041
+ /* @__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
9042
  ] }),
8967
9043
  /* @__PURE__ */ jsx38("div", { className: "ss-w-tni-tiles", children: tiles.map((t) => /* @__PURE__ */ jsxs34("div", { className: "ss-w-tni-tile", children: [
8968
9044
  /* @__PURE__ */ jsx38("span", { className: "ss-w-tni-tile-v", children: t.value }),
@@ -8971,12 +9047,12 @@ function ServeFormCard({ vm, e, ui }) {
8971
9047
  ] });
8972
9048
  }
8973
9049
  function SeasonPathCard({ vm, e, ui }) {
8974
- const { w, h, pad: pad2 } = PATH_VIEW;
9050
+ const { w, h, pad } = PATH_VIEW;
8975
9051
  const left = pathGutter(e);
8976
9052
  const bars = pathBars(e, left);
8977
9053
  const rounds = pathRounds(e);
8978
- const base = h - pad2.b;
8979
- const labelled = (w - pad2.l - pad2.r) / Math.max(e.events.length, 1) >= 22;
9054
+ const base = h - pad.b;
9055
+ const labelled = (w - pad.l - pad.r) / Math.max(e.events.length, 1) >= 22;
8980
9056
  const NAME_ROOM = 46;
8981
9057
  const namesShown = labelled && e.events.some((ev) => ev.name);
8982
9058
  const hasTitle = e.events.some((ev) => ev.title);
@@ -8985,10 +9061,10 @@ function SeasonPathCard({ vm, e, ui }) {
8985
9061
  return /* @__PURE__ */ jsxs34(Fragment8, { children: [
8986
9062
  /* @__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
9063
  rounds.map((r) => /* @__PURE__ */ jsxs34("g", { children: [
8988
- /* @__PURE__ */ jsx38("line", { className: "ss-w-tni-grid ss-w-tni-rline", x1: left, x2: w - pad2.r, y1: r.y, y2: r.y }),
9064
+ /* @__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
9065
  /* @__PURE__ */ jsx38("text", { className: "ss-w-tni-tick", x: left - 4, y: r.y + 3, textAnchor: "end", children: r.label })
8990
9066
  ] }, `r${r.roundIndex}`)),
8991
- /* @__PURE__ */ jsx38("line", { className: "ss-w-tni-grid", x1: left, x2: w - pad2.r, y1: base, y2: base }),
9067
+ /* @__PURE__ */ jsx38("line", { className: "ss-w-tni-grid", x1: left, x2: w - pad.r, y1: base, y2: base }),
8992
9068
  bars.map((b, i) => {
8993
9069
  const ev = e.events[i];
8994
9070
  const surface = surfaceOf(b.surface);
@@ -9412,7 +9488,7 @@ function FixtureCard({ card, ui }) {
9412
9488
  // src/components/dashboard/CountdownCard.tsx
9413
9489
  import { Fragment as Fragment11, useEffect as useEffect29, useState as useState36 } from "react";
9414
9490
  import { jsx as jsx43, jsxs as jsxs39 } from "react/jsx-runtime";
9415
- var DAY_MS2 = 864e5;
9491
+ var DAY_MS3 = 864e5;
9416
9492
  function remainingSegments(kickoffUnix, nowMs, withSeconds) {
9417
9493
  const totalSeconds = Math.floor((kickoffUnix * 1e3 - nowMs) / 1e3);
9418
9494
  if (totalSeconds <= 0) return null;
@@ -9420,10 +9496,10 @@ function remainingSegments(kickoffUnix, nowMs, withSeconds) {
9420
9496
  const hours = Math.floor(totalSeconds % 86400 / 3600);
9421
9497
  const minutes = Math.floor(totalSeconds % 3600 / 60);
9422
9498
  const seconds = totalSeconds % 60;
9423
- const pad2 = (n) => String(n).padStart(2, "0");
9424
- if (days > 0) return [{ value: pad2(days), unit: "d" }, { value: pad2(hours), unit: "h" }];
9425
- const segs = [{ value: pad2(hours), unit: "h" }, { value: pad2(minutes), unit: "m" }];
9426
- if (withSeconds) segs.push({ value: pad2(seconds), unit: "s" });
9499
+ const pad = (n) => String(n).padStart(2, "0");
9500
+ if (days > 0) return [{ value: pad(days), unit: "d" }, { value: pad(hours), unit: "h" }];
9501
+ const segs = [{ value: pad(hours), unit: "h" }, { value: pad(minutes), unit: "m" }];
9502
+ if (withSeconds) segs.push({ value: pad(seconds), unit: "s" });
9427
9503
  return segs;
9428
9504
  }
9429
9505
  function CountdownCard({ card, ui }) {
@@ -9433,7 +9509,7 @@ function CountdownCard({ card, ui }) {
9433
9509
  const [reduced] = useState36(
9434
9510
  () => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches
9435
9511
  );
9436
- const withinDay = data.kickoffUnix * 1e3 - nowMs < DAY_MS2;
9512
+ const withinDay = data.kickoffUnix * 1e3 - nowMs < DAY_MS3;
9437
9513
  useEffect29(() => {
9438
9514
  if (reduced) return;
9439
9515
  const id = window.setInterval(() => setNowMs(Date.now()), withinDay ? 1e3 : 6e4);
@@ -10461,7 +10537,7 @@ function MarketAccordion({ match, monitor, ui, slip }) {
10461
10537
  // src/components/LiveFactBlock.tsx
10462
10538
  import { useState as useState44 } from "react";
10463
10539
  import { jsx as jsx70, jsxs as jsxs65 } from "react/jsx-runtime";
10464
- function LiveFactBlock({ facts, matchId, ui, slip, onAsk }) {
10540
+ function LiveFactBlock({ facts, match, ui, slip, onAsk }) {
10465
10541
  const [expanded, setExpanded] = useState44(false);
10466
10542
  const { oddsFormat } = useOddsSettings();
10467
10543
  const [current, ...earlier] = facts;
@@ -10490,7 +10566,7 @@ function LiveFactBlock({ facts, matchId, ui, slip, onAsk }) {
10490
10566
  /* @__PURE__ */ jsx70(
10491
10567
  SlipButton,
10492
10568
  {
10493
- selection: chipSelection(m, matchId, slip.conversationId),
10569
+ selection: chipSelection(m, match, slip.conversationId),
10494
10570
  marketDeveloperName: m.marketDeveloperName,
10495
10571
  selectionLabel: m.selectionLabel,
10496
10572
  slip,
@@ -10512,7 +10588,7 @@ function LiveFactBlock({ facts, matchId, ui, slip, onAsk }) {
10512
10588
  {
10513
10589
  type: "button",
10514
10590
  className: "ss-w-fact-link",
10515
- onClick: () => onAsk(current.text, { kind: "liveFact", matchId, subject: current.text.slice(0, 400) }),
10591
+ onClick: () => onAsk(current.text, { kind: "liveFact", matchId: match.matchId, subject: current.text.slice(0, 400) }),
10516
10592
  children: ui.liveFactAsk
10517
10593
  }
10518
10594
  ),
@@ -10703,11 +10779,11 @@ function MonitorMatchCard({ match, promotedPins, monitor, ui, slip, onAsk }) {
10703
10779
  /* @__PURE__ */ jsx72("span", { className: "ss-w-mon-scorers-ball", "aria-hidden": "true", children: "\u26BD" }),
10704
10780
  /* @__PURE__ */ jsx72("ul", { className: "ss-w-mon-scorers-col ss-w-mon-scorers-away", children: awayScorers.map((s, i) => /* @__PURE__ */ jsx72("li", { children: s.label }, `${s.player}-${i}`)) })
10705
10781
  ] }),
10706
- live && match.facts && match.facts.length > 0 && /* @__PURE__ */ jsx72(LiveFactBlock, { facts: match.facts, matchId: match.matchId, ui, slip, onAsk }),
10782
+ live && match.facts && match.facts.length > 0 && /* @__PURE__ */ jsx72(LiveFactBlock, { facts: match.facts, match, ui, slip, onAsk }),
10707
10783
  /* @__PURE__ */ jsx72("div", { className: "ss-w-mon-stats", children: orderedRows.map((row) => {
10708
10784
  const { home, away } = splitWidths2(row.homeNum, row.awayNum);
10709
10785
  const promoted = isPromoted(row, promotedPins);
10710
- const selection = chipSelection(row.market, match.matchId, slip.conversationId);
10786
+ const selection = chipSelection(row.market, match, slip.conversationId);
10711
10787
  const chipPrice = row.market ? chipPriceText(row.market, oddsFormat) : void 0;
10712
10788
  return /* @__PURE__ */ jsxs67("div", { className: promoted ? "ss-w-mon-stat ss-w-mon-pstrip" : "ss-w-mon-stat", children: [
10713
10789
  /* @__PURE__ */ jsxs67("div", { className: "ss-w-mon-stat-row", children: [
@@ -10741,7 +10817,7 @@ function MonitorMatchCard({ match, promotedPins, monitor, ui, slip, onAsk }) {
10741
10817
  ] })
10742
10818
  ] }, row.label);
10743
10819
  }) }),
10744
- match.status === "stale" && /* @__PURE__ */ jsx72("span", { className: "ss-w-mon-asof", children: ui.asOf(formatTime(match.asOfUtc, ui.locale, clockOf(ui))) }),
10820
+ 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
10821
  match.momentum.length > 0 && /* @__PURE__ */ jsxs67("div", { className: "ss-w-mon-mom", children: [
10746
10822
  /* @__PURE__ */ jsx72("span", { className: "ss-w-mon-stat-l", children: ui.momentumLabel }),
10747
10823
  /* @__PURE__ */ jsx72(MomentumWave, { points: match.momentum, label: ui.momentumLabel, clubIsHome: true })
@@ -10961,7 +11037,7 @@ function usePropsOpen(match, monitor, descriptor) {
10961
11037
  }, [match.matchId, match.asOfUtc, open]);
10962
11038
  return { bundle: monitor.playerProps?.[monitorMatchKey(sport, match.matchId)]?.bundle, live, open };
10963
11039
  }
10964
- function PropPrice({ price, label, ariaName, stat, bundle, descriptor, ui, slip }) {
11040
+ function PropPrice({ price, label, ariaName, player, stat, bundle, descriptor, ui, slip }) {
10965
11041
  const { oddsFormat } = useOddsSettings();
10966
11042
  const shown2 = formatOdds(price.priceFormats, oddsFormat);
10967
11043
  if (bundle.addToSlipEnabled && takesSport(slip, descriptor.sport)) {
@@ -10977,7 +11053,7 @@ function PropPrice({ price, label, ariaName, stat, bundle, descriptor, ui, slip
10977
11053
  return /* @__PURE__ */ jsx76(
10978
11054
  SlipButton,
10979
11055
  {
10980
- selection,
11056
+ selection: withMatch(selection, { home: bundle.homeAbbreviation, away: bundle.awayAbbreviation, kickoffUtc: bundle.startsAtUtc, marketLabel: stat.label, player }),
10981
11057
  marketDeveloperName: stat.marketDeveloperName,
10982
11058
  selectionLabel: price.label,
10983
11059
  line: price.line != null ? String(price.line) : void 0,
@@ -11038,7 +11114,7 @@ function PropPlayerPanel({ player: given, bundle, descriptor, ui, slip }) {
11038
11114
  const hitsOf = (price, text2) => descriptor.showHits && sample > 0 && price.hits != null ? text2(price.hits) : null;
11039
11115
  const bars = active ? descriptor.bars(active, player) : [];
11040
11116
  const title = typeof descriptor.barsTitle === "function" ? descriptor.barsTitle(bars.length, bars.some((b) => b.live)) : descriptor.barsTitle;
11041
- const priceProps = { bundle, descriptor, ui, slip };
11117
+ const priceProps = { bundle, descriptor, ui, slip, player: player.name };
11042
11118
  const liveValue = (s) => hasLiveLine(player) ? descriptor.live?.(s, player) ?? null : null;
11043
11119
  const liveChips = stats.some((s) => liveValue(s) !== null);
11044
11120
  return /* @__PURE__ */ jsxs71("div", { className: "ss-w-props-panel", children: [
@@ -11529,6 +11605,7 @@ function Trends({ bundle, facts, descriptor, ui, slip }) {
11529
11605
  price: f.price,
11530
11606
  label: "",
11531
11607
  ariaName: `${f.playerName}, ${bet}`,
11608
+ player: f.playerName,
11532
11609
  stat: f,
11533
11610
  bundle,
11534
11611
  descriptor,
@@ -11544,7 +11621,7 @@ function Trends({ bundle, facts, descriptor, ui, slip }) {
11544
11621
  function Scorers({ bundle, scorers, abbreviations, descriptor, ui, slip }) {
11545
11622
  const [all, setAll] = useState50(false);
11546
11623
  const shown2 = all ? scorers : scorers.slice(0, SCORERS_SHOWN);
11547
- const cell2 = (name, column, price, stat) => price && stat ? /* @__PURE__ */ jsx80(PropPrice, { price, label: "", ariaName: `${name}, ${column}`, stat, bundle, descriptor, ui, slip }) : /* @__PURE__ */ jsx80("span", { className: "ss-w-props-scorer-none", children: "\u2014" });
11624
+ const cell2 = (name, column, price, stat) => price && stat ? /* @__PURE__ */ jsx80(PropPrice, { price, label: "", ariaName: `${name}, ${column}`, player: name, stat, bundle, descriptor, ui, slip }) : /* @__PURE__ */ jsx80("span", { className: "ss-w-props-scorer-none", children: "\u2014" });
11548
11625
  return /* @__PURE__ */ jsxs75("div", { className: "ss-w-props-scorers", children: [
11549
11626
  /* @__PURE__ */ jsxs75("div", { className: "ss-w-props-scorer ss-w-props-scorer-head", children: [
11550
11627
  /* @__PURE__ */ jsx80("span", { children: ui.nfl.propsPlayer }),
@@ -11768,12 +11845,11 @@ function splitAtFirstSpace(label) {
11768
11845
  const i = label.indexOf(" ");
11769
11846
  return i > 0 && i < label.length - 1 ? [label.slice(0, i), label.slice(i + 1)] : null;
11770
11847
  }
11771
- function isOtherLocalDay(kickoffUnix, now) {
11772
- const at2 = new Date(kickoffUnix * 1e3);
11773
- return at2.getFullYear() !== now.getFullYear() || at2.getMonth() !== now.getMonth() || at2.getDate() !== now.getDate();
11848
+ function isOtherLocalDay(kickoffUnix, now, timeZone) {
11849
+ return zonedDayNumber(kickoffUnix * 1e3, timeZone) !== zonedDayNumber(now.getTime(), timeZone);
11774
11850
  }
11775
- function kickoffLabel(kickoffUnix, tag2, clock3) {
11776
- return formatTime(kickoffUnix * 1e3, tag2, clock3);
11851
+ function kickoffLabel(kickoffUnix, tag2, clock3, timeZone) {
11852
+ return formatTime(kickoffUnix * 1e3, tag2, clock3, { timeZone });
11777
11853
  }
11778
11854
  function Side2({ name, crest, abbr, away = false }) {
11779
11855
  return /* @__PURE__ */ jsxs79("span", { className: away ? "ss-w-drow-side ss-w-drow-side--away" : "ss-w-drow-side", children: [
@@ -11791,12 +11867,12 @@ function rowStatusOf(state, stale, ui) {
11791
11867
  }
11792
11868
  function FixtureRow({ match, state, stale, ui, monitor, onOpen }) {
11793
11869
  const { isLive, hasScore, score, ticked, when: clock3 } = rowStatusOf(state, stale, ui);
11794
- const when = clock3 ?? kickoffLabel(match.kickoffUnix, ui.locale, clockOf(ui));
11870
+ const when = clock3 ?? kickoffLabel(match.kickoffUnix, ui.locale, clockOf(ui), ui.timeZone);
11795
11871
  const isUsSport = sportKeyOf(match.sport) !== "football";
11796
11872
  const pinSport = slipSportOf8(match.sport);
11797
11873
  const liveTone = isLive || state?.isHalfTime;
11798
11874
  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;
11875
+ 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
11876
  const twoLines = clockParts ?? (dayMarker !== null ? [when, dayMarker] : null);
11801
11877
  const whenClass = [
11802
11878
  "ss-w-drow-when",
@@ -11860,12 +11936,12 @@ var hasGames = (s) => s.sets.some((x) => (x.p1Games ?? 0) > 0 || (x.p2Games ?? 0
11860
11936
 
11861
11937
  // src/components/TennisFixtureRow.tsx
11862
11938
  import { Fragment as Fragment21, jsx as jsx85, jsxs as jsxs80 } from "react/jsx-runtime";
11863
- function TennisSidePrice({ matchId, tour, price, forms, value, oddsId, player, ui, slip, name, lead, movedLabel }) {
11939
+ function TennisSidePrice({ matchId, tour, pair, price, forms, value, oddsId, player, ui, slip, name, lead, movedLabel }) {
11864
11940
  const { oddsFormat } = useOddsSettings();
11865
11941
  const added = useSlipState()?.added;
11866
11942
  const slipAllowed = !!slip && price.addToSlipEnabled && slipOpenFor(slip, "tennis");
11867
11943
  const label = formatOdds(forms, oddsFormat);
11868
- const selection = slipAllowed && oddsId != null ? {
11944
+ const selection = slipAllowed && oddsId != null ? withMatch({
11869
11945
  matchOddsId: oddsId,
11870
11946
  matchId,
11871
11947
  oddsDecimal: value,
@@ -11874,7 +11950,7 @@ function TennisSidePrice({ matchId, tour, price, forms, value, oddsId, player, u
11874
11950
  sport: "tennis",
11875
11951
  ...tour ? { tour } : {},
11876
11952
  ...slip.conversationId !== void 0 ? { conversationId: slip.conversationId } : {}
11877
- } : null;
11953
+ }, pair) : null;
11878
11954
  const inSlip = oddsId != null && !!added?.[slipKey({ matchOddsId: oddsId, sport: "tennis" })];
11879
11955
  const ariaLabel = `${player} ${label}${movedLabel ? `, ${movedLabel}` : ""}`;
11880
11956
  if (selection) {
@@ -11910,7 +11986,14 @@ function TennisSidePrice({ matchId, tour, price, forms, value, oddsId, player, u
11910
11986
  ] });
11911
11987
  }
11912
11988
  function TennisPriceCell({ match, price, ui, slip }) {
11913
- const common = { matchId: match.matchId, tour: match.tour, price, ui, slip };
11989
+ const common = {
11990
+ matchId: match.matchId,
11991
+ tour: match.tour,
11992
+ price,
11993
+ ui,
11994
+ slip,
11995
+ pair: { home: match.homeTeamName, away: match.awayTeamName, kickoffUtc: match.kickoffUnix > 0 ? new Date(match.kickoffUnix * 1e3).toISOString() : null }
11996
+ };
11914
11997
  return /* @__PURE__ */ jsxs80("span", { className: "ss-w-trow-prices", children: [
11915
11998
  /* @__PURE__ */ jsx85(TennisSidePrice, { ...common, forms: price.p1, value: price.p1Value, oddsId: price.p1OddsId, player: match.homeTeamName }),
11916
11999
  /* @__PURE__ */ jsx85(TennisSidePrice, { ...common, forms: price.p2, value: price.p2Value, oddsId: price.p2OddsId, player: match.awayTeamName })
@@ -11966,7 +12049,7 @@ function TennisFixtureRow({ match, state, stale, ui, prices, slip, monitor }) {
11966
12049
  live ? /* @__PURE__ */ jsxs80("span", { className: "ss-w-trow-when ss-w-trow-live", children: [
11967
12050
  ui.liveLabel,
11968
12051
  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)) }),
12052
+ ] }) : 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
12053
  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
12054
  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
12055
  pinnable && monitor && pin && /* @__PURE__ */ jsx85(PinToggle, { ui, monitor, pin })
@@ -12118,7 +12201,7 @@ function WinnerPrice({ match, t, price, ui, slip }) {
12118
12201
  const liveBlock = t.live ?? null;
12119
12202
  const paused = !!liveBlock?.pricesPaused;
12120
12203
  const effective = price && paused ? { ...price, addToSlipEnabled: false } : price;
12121
- const common = effective ? { matchId: match.matchId, tour: t.header.tour, price: effective, ui, slip } : null;
12204
+ const common = effective ? { matchId: match.matchId, tour: t.header.tour, price: effective, ui, slip, pair: { home: t.p1.name, away: t.p2.name, kickoffUtc: t.header.startsAtUtc } } : null;
12122
12205
  const moved = price && (direction(price.p1Direction) || direction(price.p2Direction));
12123
12206
  const since = price?.previousAtUtc ? ui.bettingKickoff(price.previousAtUtc).dayLabel : null;
12124
12207
  const sides = price && common ? [
@@ -12561,7 +12644,7 @@ function OddsLiveStrip({ m, ui }) {
12561
12644
  m.minuteLabel && /* @__PURE__ */ jsx91("span", { className: "ss-w-mon-min", children: m.minuteLabel }),
12562
12645
  m.isSuspended && !m.isSettled && /* @__PURE__ */ jsx91("span", { className: "ss-w-mon-susp", children: ui.suspendedLabel }),
12563
12646
  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))) })
12647
+ stale && /* @__PURE__ */ jsx91("span", { className: "ss-w-mon-asof", children: ui.asOf(formatTime(m.asOfUtc, ui.locale, clockOf(ui), { timeZone: ui.timeZone })) })
12565
12648
  ] });
12566
12649
  }
12567
12650
  function MatchesPanel({ monitor, ui, slip, onAsk, discovery }) {
@@ -12688,7 +12771,7 @@ var countryThenName = (a, b) => {
12688
12771
  };
12689
12772
  function matchSections(a) {
12690
12773
  const live = (m) => isTreatedLive(a.states.get(keyOf3(m)), a.stale);
12691
- const offset = offsetOf(a.date);
12774
+ const offset = offsetOf(a.date, a.timeZone);
12692
12775
  const onDate = (m) => localDateOfUnix(m.kickoffUnix, offset) === a.date;
12693
12776
  const afterMidnight = [];
12694
12777
  const built = [];
@@ -12871,8 +12954,8 @@ function useModalDialog(onClose, opts = {}) {
12871
12954
 
12872
12955
  // src/components/MatchSheet.tsx
12873
12956
  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" });
12957
+ function kickoffDate(kickoffUnix, lang, timeZone) {
12958
+ return formatDate(kickoffUnix * 1e3, lang, { weekday: "short", day: "numeric", month: "short", timeZone });
12876
12959
  }
12877
12960
  function MatchSheet({ match, league, state, stale, ui, monitor, onAsk, onClose, opener }) {
12878
12961
  const { dialogRef, onKeyDown } = useModalDialog(onClose, { opener });
@@ -12925,7 +13008,7 @@ function MatchSheet({ match, league, state, stale, ui, monitor, onAsk, onClose,
12925
13008
  };
12926
13009
  const { score, when } = rowStatusOf(state, stale, ui);
12927
13010
  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)));
13011
+ 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
13012
  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
13013
  /* @__PURE__ */ jsxs89("div", { className: "ss-w-tool-head", children: [
12931
13014
  /* @__PURE__ */ jsxs89("h2", { id: titleId, className: "ss-w-tool-title", children: [
@@ -13282,7 +13365,8 @@ function ScheduleMatchesPanel({ discovery, ui, monitor, sport, offered, onSport,
13282
13365
  pinnedKeys,
13283
13366
  isToday,
13284
13367
  date: selected,
13285
- query: q
13368
+ query: q,
13369
+ timeZone: ui.timeZone
13286
13370
  });
13287
13371
  const priced = sectionsFor("");
13288
13372
  const { sections, afterMidnight } = searching ? sectionsFor(query) : priced;
@@ -16714,8 +16798,8 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
16714
16798
  send(requestFor(next));
16715
16799
  }, [empty2, singles, widened, canWiden, view]);
16716
16800
  useEffect49(() => {
16717
- if (coolOff) onCoolOff?.();
16718
- }, [coolOff, onCoolOff]);
16801
+ if (coolOff) onCoolOff?.(sport);
16802
+ }, [coolOff, onCoolOff, sport]);
16719
16803
  if (coolOff) return null;
16720
16804
  const nextGames = preset.nextGames?.trim() || null;
16721
16805
  const nextAtMs = instantMs(preset.nextGamesAtUtc);
@@ -16824,7 +16908,7 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
16824
16908
  void request(lastRequest.current);
16825
16909
  } }) : null
16826
16910
  ] }),
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
16911
+ 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
16912
  ] }) : null
16829
16913
  ] }) : null });
16830
16914
  }
@@ -18412,7 +18496,10 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
18412
18496
  .ss-w-combo-leg-market { font-size: 11.5px; font-weight: 600; line-height: 1.25; color: var(--ss-w-faint); overflow-wrap: break-word; }
18413
18497
  .ss-w-combo-leg-sel { font-size: 13px; font-weight: 700; line-height: 1.2; color: var(--ss-w-ink); overflow-wrap: break-word; }
18414
18498
  .ss-w-combo-leg-price { flex: none; font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 17px; font-weight: 800; line-height: 1.05; color: var(--ss-w-accent); }
18415
- .ss-w-combo-leg-pick .ss-w-slip { flex: none; }
18499
+ .ss-w-combo-leg-pick .ss-w-slip { display: contents; }
18500
+ .ss-w-combo-leg-pick .ss-w-slip-btn { flex: none; }
18501
+ .ss-w-combo-leg .ss-w-bi-team { white-space: normal; text-overflow: clip; overflow-wrap: break-word; line-height: 1.25; }
18502
+ .ss-w-combo-leg-pick .ss-w-toast { position: static; flex-basis: 100%; width: auto; max-width: none; box-shadow: none; }
18416
18503
  .ss-w-combo-leg-stat { font-size: 12px; line-height: 1.45; color: var(--ss-w-ink); background: var(--ss-w-bubble); border-radius: 8px; padding: 6px 9px; }
18417
18504
  .ss-w-combo-math { font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 700; line-height: 1.4; color: var(--ss-w-ink); text-align: right; background: color-mix(in srgb, var(--ss-w-accent) 9%, var(--ss-w-panel)); border-radius: 8px; padding: 8px 10px; overflow-wrap: anywhere; }
18418
18505
  .ss-w-combo-note { font-size: 11px; line-height: 1.4; color: var(--ss-w-faint); }
@@ -20669,7 +20756,8 @@ function StatsWidget(props) {
20669
20756
  operatorUserId,
20670
20757
  anonymousUserId,
20671
20758
  isOpen: panelOpen,
20672
- pinnedMatchIds
20759
+ pinnedMatchIds,
20760
+ timeZone: ui.timeZone
20673
20761
  });
20674
20762
  const offeredSports = useMemo13(() => {
20675
20763
  const seen = new Set(discovery.matchDays.map((d) => d.sport));
@@ -20684,7 +20772,8 @@ function StatsWidget(props) {
20684
20772
  day: matchesDay,
20685
20773
  sport: scheduleSport.sport,
20686
20774
  getSchedule,
20687
- enabled: panelOpen && monitor.activeTab === "matches"
20775
+ enabled: panelOpen && monitor.activeTab === "matches",
20776
+ timeZone: ui.timeZone
20688
20777
  });
20689
20778
  const prevLiveSnapshotRef = useRef43(monitor.snapshot);
20690
20779
  useEffect52(() => {
@@ -20748,17 +20837,26 @@ function StatsWidget(props) {
20748
20837
  () => [...controller.state.messages].reverse().find((m) => m.role === "assistant" && (m.greetingDashboard !== void 0 || m.greetingDashboards !== void 0)) ?? null,
20749
20838
  [controller.state.messages]
20750
20839
  );
20751
- const [coolOffGreeting, setCoolOffGreeting] = useState79(null);
20752
- const onBuilderCoolOff = useCallback27(() => setCoolOffGreeting(builderGreeting), [builderGreeting]);
20840
+ const [coolOff, setCoolOff] = useState79(null);
20841
+ const onBuilderCoolOff = useCallback27((sport) => {
20842
+ if (!builderGreeting) return;
20843
+ setCoolOff((prev) => {
20844
+ const sports = prev?.greeting === builderGreeting ? prev.sports : [];
20845
+ return sports.includes(sport) ? prev : { greeting: builderGreeting, sports: [...sports, sport] };
20846
+ });
20847
+ }, [builderGreeting]);
20753
20848
  const builderOptions = useMemo13(() => {
20754
20849
  const greeting = builderGreeting;
20755
- if (!greeting || greeting === coolOffGreeting) return [];
20850
+ if (!greeting) return [];
20851
+ const cooled = coolOff?.greeting === greeting ? coolOff.sports : [];
20756
20852
  const sets = switchSets(greeting.greetingDashboards);
20757
- if (sets) return sets.flatMap((s) => s.dashboard.personal?.builder ? [{ sport: s.sport, label: s.label, preset: s.dashboard.personal.builder }] : []);
20758
- const preset = greeting.greetingDashboard?.personal?.builder;
20759
- const sport = greeting.defaultSport || "football";
20760
- return preset ? [{ sport, label: sportLabel(ui, sport), preset }] : [];
20761
- }, [builderGreeting, coolOffGreeting, ui]);
20853
+ const options = sets ? sets.flatMap((s) => s.dashboard.personal?.builder ? [{ sport: s.sport, label: s.label, preset: s.dashboard.personal.builder }] : []) : (() => {
20854
+ const preset = greeting.greetingDashboard?.personal?.builder;
20855
+ const sport = greeting.defaultSport || "football";
20856
+ return preset ? [{ sport, label: sportLabel(ui, sport), preset }] : [];
20857
+ })();
20858
+ return options.filter((o) => !cooled.includes(o.sport));
20859
+ }, [builderGreeting, coolOff, ui]);
20762
20860
  const builderSport = [builderSportPick, rememberedSport, latestGreeting?.defaultSport].find((s) => !!s && builderOptions.some((o) => o.sport === s)) ?? builderOptions[0]?.sport ?? "";
20763
20861
  const [panelEverOpened, setPanelEverOpened] = useState79(panelOpen);
20764
20862
  if (panelOpen && !panelEverOpened) setPanelEverOpened(true);