@sensiblestats/widget-react 0.151.0 → 0.153.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 +17 -0
- package/dist/index.cjs +768 -638
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +20 -3
- package/dist/index.d.ts +20 -3
- package/dist/index.js +1667 -1537
- package/dist/index.js.map +1 -1
- package/dist/styles.css +33 -26
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -574,6 +574,8 @@ var BUNDLED_EN_GB = {
|
|
|
574
574
|
"widget.addAllPriceMoved": "All {count} added. A price changed, so the total changed too.",
|
|
575
575
|
"widget.addAllPartial": "{added} of {total} added. Not added: {notAdded}",
|
|
576
576
|
"widget.addAllPartial.pair": "{home} vs {away}",
|
|
577
|
+
"widget.v2GameTitle": "{home} v {away}",
|
|
578
|
+
"widget.v2GameTitle.away": "{away} at {home}",
|
|
577
579
|
"widget.asOf": "Prices as of {time}",
|
|
578
580
|
"widget.liveFactEarlier": "Earlier facts ({count})",
|
|
579
581
|
"widget.liveFactKickoff": "Kick-off {price}",
|
|
@@ -609,7 +611,12 @@ var BUNDLED_EN_GB = {
|
|
|
609
611
|
"widget.v2ChipBuildCombo": "Build a combo",
|
|
610
612
|
"widget.v2AnotherMarketTitle": "Markets on this game",
|
|
611
613
|
"widget.v2PriceGone": "This price is no longer on the board",
|
|
612
|
-
"widget.v2CardLabel": "{
|
|
614
|
+
"widget.v2CardLabel": "{game}, {market}",
|
|
615
|
+
"widget.v2PriceHint": "Tap a price to add it to your slip.",
|
|
616
|
+
"widget.v2KickoffLine": "{date}, {time}",
|
|
617
|
+
"widget.v2GameLine": "{game} \xB7 {time}",
|
|
618
|
+
"widget.v2ChangeMarket": "{market}, change market",
|
|
619
|
+
"widget.v2AddLabel": "Add to slip: {label}, {price}",
|
|
613
620
|
"widget.v8PricesAsOf": "Prices as of {time}",
|
|
614
621
|
"widget.v8InjuryAsOf": "as of {time}",
|
|
615
622
|
"widget.v8PausedNext": "No priced games in this sport right now. Next games: {when}. Stats and questions still work.",
|
|
@@ -1089,6 +1096,15 @@ function legsLabel(table, n) {
|
|
|
1089
1096
|
const key = LEG_COUNTS.includes(n) ? `widget.v8BuilderLegs.${n}` : "widget.v8BuilderLegs.other";
|
|
1090
1097
|
return fill(text(table, key) ?? key, { n }, "und");
|
|
1091
1098
|
}
|
|
1099
|
+
var UNFILLED = /\{\w+\}/;
|
|
1100
|
+
function translate(table, key, tokens, tag2) {
|
|
1101
|
+
const row = table[key];
|
|
1102
|
+
const own = row === void 0 ? void 0 : fill(row, tokens, tag2);
|
|
1103
|
+
if (own !== void 0 && !UNFILLED.test(own)) return own;
|
|
1104
|
+
const bundled = BUNDLED_EN_GB[key];
|
|
1105
|
+
if (bundled !== void 0) return fill(bundled, tokens, tag2);
|
|
1106
|
+
return own ?? key;
|
|
1107
|
+
}
|
|
1092
1108
|
var nbsp = (s) => s.replace(/\s/g, "\xA0");
|
|
1093
1109
|
var shortDate = (tag2, ms, opts) => nbsp(formatDate(ms, tag2, opts).replace("Sept", "Sep"));
|
|
1094
1110
|
var signed = (line) => line.replace(/^-/, "\u2212");
|
|
@@ -1101,6 +1117,16 @@ var INTL_LEAVES = {
|
|
|
1101
1117
|
"nba.lineText": (c) => (line) => signed(line).replace(".", decimalMark(c.tag)),
|
|
1102
1118
|
"nba.formDay": (c) => (etDate, anchorEtDate) => formDay(etDate, anchorEtDate, c.tag),
|
|
1103
1119
|
bettingKickoff: (c) => (kickoffUtc, now) => formatBettingKickoff(kickoffUtc, { today: c.t("widget.today"), tomorrow: c.t("widget.tomorrow") }, c.tag, c.clock, now, c.timeZone),
|
|
1120
|
+
v2KickoffLine: (c) => (kickoffUtc) => {
|
|
1121
|
+
const at2 = new Date(kickoffUtc);
|
|
1122
|
+
return c.t("widget.v2KickoffLine", {
|
|
1123
|
+
date: formatDate(at2, c.tag, { weekday: "short", day: "numeric", month: "short", timeZone: c.timeZone }),
|
|
1124
|
+
time: formatTime(at2, c.tag, c.clock, { timeZone: c.timeZone })
|
|
1125
|
+
});
|
|
1126
|
+
},
|
|
1127
|
+
v2GameLine: (c) => (game, kickoffUtc) => c.t("widget.v2GameLine", { game, time: formatTime(new Date(kickoffUtc), c.tag, c.clock, { timeZone: c.timeZone }) }),
|
|
1128
|
+
// The matchup the server words when it sends no title (a 0.152 server): an NBA game reads away at home, every other sport home v away.
|
|
1129
|
+
v2GameTitle: (c) => (home, away, sport) => c.t(sport === "nba" ? "widget.v2GameTitle.away" : "widget.v2GameTitle", { home, away }),
|
|
1104
1130
|
v8FormResult: (c) => (result) => codeLabel(c.table, "result", result) ?? result
|
|
1105
1131
|
};
|
|
1106
1132
|
var pairs = (c, key, list) => list.map(([home, away]) => c.t(key, { home, away })).join(", ");
|
|
@@ -1171,7 +1197,9 @@ var ROW_LEAVES = {
|
|
|
1171
1197
|
v8BuilderSwapLeg: (c) => (pair, market) => c.t("widget.v8BuilderSwapLeg", { pair, market }),
|
|
1172
1198
|
v8BuilderSwap: (c) => (leg) => c.t("widget.v8BuilderSwap", { leg }),
|
|
1173
1199
|
v8Follow: (c) => (name) => c.t("widget.v8Follow", { name }),
|
|
1174
|
-
v2CardLabel: (c) => (
|
|
1200
|
+
v2CardLabel: (c) => (game, market) => c.t("widget.v2CardLabel", { game, market }),
|
|
1201
|
+
v2ChangeMarket: (c) => (market) => c.t("widget.v2ChangeMarket", { market }),
|
|
1202
|
+
v2AddLabel: (c) => (label, price) => c.t("widget.v2AddLabel", { label, price }),
|
|
1175
1203
|
v8PricesAsOf: (c) => (time) => c.t("widget.v8PricesAsOf", { time }),
|
|
1176
1204
|
v8InjuryAsOf: (c) => (time) => c.t("widget.v8InjuryAsOf", { time }),
|
|
1177
1205
|
v8PausedNext: (c) => (when) => c.t("widget.v8PausedNext", { when }),
|
|
@@ -1317,18 +1345,21 @@ function setPath(root, path, value) {
|
|
|
1317
1345
|
}
|
|
1318
1346
|
node[parts2[parts2.length - 1]] = value;
|
|
1319
1347
|
}
|
|
1320
|
-
var
|
|
1348
|
+
var RETIRED_ROWS = /* @__PURE__ */ new Set(["widget.v2ChipAnotherMarket", "widget.v2ChipBuildCombo", "widget.v2AnotherMarketTitle"]);
|
|
1349
|
+
var ownedByLeaf = (key) => RETIRED_ROWS.has(key) || key.startsWith("widget.code.") || Object.keys(LEAVES).some((path) => key === `widget.${path}` || key.startsWith(`widget.${path}.`));
|
|
1321
1350
|
function buildLocaleStrings(table, tag2, clock3 = "24h", timeZone) {
|
|
1322
1351
|
const root = {};
|
|
1323
|
-
for (const [
|
|
1324
|
-
|
|
1352
|
+
for (const rows of [BUNDLED_EN_GB, table]) {
|
|
1353
|
+
for (const [key, row] of Object.entries(rows)) {
|
|
1354
|
+
if (key.startsWith("widget.") && typeof row === "string" && !ownedByLeaf(key)) setPath(root, key.slice("widget.".length), row);
|
|
1355
|
+
}
|
|
1325
1356
|
}
|
|
1326
1357
|
const ctx = {
|
|
1327
1358
|
tag: tag2,
|
|
1328
1359
|
clock: clock3,
|
|
1329
1360
|
timeZone,
|
|
1330
1361
|
table,
|
|
1331
|
-
t: (key, tokens = {}) =>
|
|
1362
|
+
t: (key, tokens = {}) => translate(table, key, tokens, tag2)
|
|
1332
1363
|
};
|
|
1333
1364
|
for (const [path, make] of Object.entries(LEAVES)) setPath(root, path, make(ctx));
|
|
1334
1365
|
for (const [path, set, codes] of CODE_LEAVES) {
|
|
@@ -1386,7 +1417,7 @@ function parseCustomTotal(text2, format2) {
|
|
|
1386
1417
|
}
|
|
1387
1418
|
|
|
1388
1419
|
// src/version.generated.ts
|
|
1389
|
-
var WIDGET_REACT_VERSION = "0.
|
|
1420
|
+
var WIDGET_REACT_VERSION = "0.153.0";
|
|
1390
1421
|
|
|
1391
1422
|
// src/config.ts
|
|
1392
1423
|
function hostTag(cfg) {
|
|
@@ -1679,10 +1710,13 @@ function normalizeUi(cfg, loaded) {
|
|
|
1679
1710
|
favError: strings.favError,
|
|
1680
1711
|
v8Follow: strings.v8Follow,
|
|
1681
1712
|
v2ChipLive: strings.v2ChipLive,
|
|
1682
|
-
v2ChipAnotherMarket: strings.v2ChipAnotherMarket,
|
|
1683
|
-
v2ChipBuildCombo: strings.v2ChipBuildCombo,
|
|
1684
|
-
v2AnotherMarketTitle: strings.v2AnotherMarketTitle,
|
|
1685
1713
|
v2PriceGone: strings.v2PriceGone,
|
|
1714
|
+
v2PriceHint: strings.v2PriceHint,
|
|
1715
|
+
v2KickoffLine: strings.v2KickoffLine,
|
|
1716
|
+
v2GameLine: strings.v2GameLine,
|
|
1717
|
+
v2GameTitle: strings.v2GameTitle,
|
|
1718
|
+
v2ChangeMarket: strings.v2ChangeMarket,
|
|
1719
|
+
v2AddLabel: strings.v2AddLabel,
|
|
1686
1720
|
v2CardLabel: strings.v2CardLabel,
|
|
1687
1721
|
v8NotForMe: strings.v8NotForMe,
|
|
1688
1722
|
v8Since: strings.v8Since,
|
|
@@ -3198,6 +3232,42 @@ function createDashboardTapSignal(sendSignal, log) {
|
|
|
3198
3232
|
}
|
|
3199
3233
|
|
|
3200
3234
|
// src/theme.ts
|
|
3235
|
+
var PILL_MIX = 72;
|
|
3236
|
+
var LIGHT_PANEL = "#ffffff";
|
|
3237
|
+
var DARK_PANEL = "#141b24";
|
|
3238
|
+
var DARK_INK = "#06231a";
|
|
3239
|
+
var DEFAULT_ACCENT = { light: "#17936a", dark: "#37c891" };
|
|
3240
|
+
function rgb(hex) {
|
|
3241
|
+
const m = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(hex.trim());
|
|
3242
|
+
if (!m) return null;
|
|
3243
|
+
const raw = m[1] ?? "";
|
|
3244
|
+
const h = raw.length === 3 ? raw.replace(/./g, (c) => c + c) : raw;
|
|
3245
|
+
return [0, 2, 4].map((i) => parseInt(h.slice(i, i + 2), 16));
|
|
3246
|
+
}
|
|
3247
|
+
function luminance(c) {
|
|
3248
|
+
const [r, g, b] = c.map((v) => {
|
|
3249
|
+
const x = v / 255;
|
|
3250
|
+
return x <= 0.03928 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4;
|
|
3251
|
+
});
|
|
3252
|
+
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
3253
|
+
}
|
|
3254
|
+
function contrast(a, b) {
|
|
3255
|
+
const la = luminance(rgb(a) ?? [0, 0, 0]);
|
|
3256
|
+
const lb = luminance(rgb(b) ?? [0, 0, 0]);
|
|
3257
|
+
return (Math.max(la, lb) + 0.05) / (Math.min(la, lb) + 0.05);
|
|
3258
|
+
}
|
|
3259
|
+
var toHex = (c) => "#" + c.map((v) => Math.round(v).toString(16).padStart(2, "0")).join("");
|
|
3260
|
+
function pillFor(accent, panel, theme) {
|
|
3261
|
+
const base = rgb(accent ?? "") ?? rgb(DEFAULT_ACCENT[theme]);
|
|
3262
|
+
const lightPanel = luminance(rgb(panel) ?? [255, 255, 255]) >= 0.18;
|
|
3263
|
+
const ink = lightPanel ? "#ffffff" : DARK_INK;
|
|
3264
|
+
for (let pct2 = lightPanel ? PILL_MIX : 100; pct2 > 0; pct2 -= 5) {
|
|
3265
|
+
const k = pct2 / 100;
|
|
3266
|
+
const pill = toHex(base.map((v) => lightPanel ? v * k : v * k + 255 * (1 - k)));
|
|
3267
|
+
if (contrast(pill, ink) >= 4.5 && contrast(pill, panel) >= 3) return { pill, ink };
|
|
3268
|
+
}
|
|
3269
|
+
return { pill: lightPanel ? "#000000" : "#ffffff", ink };
|
|
3270
|
+
}
|
|
3201
3271
|
function themeAttrs(ui, userTheme) {
|
|
3202
3272
|
const style = {
|
|
3203
3273
|
"--ss-w-offset-x": `${ui.offset.x}px`,
|
|
@@ -3213,6 +3283,15 @@ function themeAttrs(ui, userTheme) {
|
|
|
3213
3283
|
style["--ss-w-line"] = "color-mix(in srgb, var(--ss-w-ink) 12%, var(--ss-w-panel))";
|
|
3214
3284
|
style["--ss-w-faint"] = "color-mix(in srgb, var(--ss-w-ink) 55%, var(--ss-w-panel))";
|
|
3215
3285
|
}
|
|
3286
|
+
if (ui.accent || ui.surface) {
|
|
3287
|
+
const surface = ui.surface && rgb(ui.surface) ? ui.surface : void 0;
|
|
3288
|
+
const light = pillFor(ui.accent, surface ?? LIGHT_PANEL, "light");
|
|
3289
|
+
const dark = pillFor(ui.accent, surface ?? DARK_PANEL, "dark");
|
|
3290
|
+
style["--ss-w-pill-light"] = light.pill;
|
|
3291
|
+
style["--ss-w-on-pill-light"] = light.ink;
|
|
3292
|
+
style["--ss-w-pill-dark"] = dark.pill;
|
|
3293
|
+
style["--ss-w-on-pill-dark"] = dark.ink;
|
|
3294
|
+
}
|
|
3216
3295
|
const theme = ui.surface || ui.ink ? ui.theme : userTheme ?? ui.theme;
|
|
3217
3296
|
return { "data-ss-w-theme": theme, "data-ss-w-pos": ui.position, style };
|
|
3218
3297
|
}
|
|
@@ -5763,7 +5842,8 @@ function sendGreetingOnce(log, owner, meta, surface) {
|
|
|
5763
5842
|
matchStep: meta.matchStep,
|
|
5764
5843
|
matchId: meta.matchId ?? null,
|
|
5765
5844
|
competitionId: meta.competitionId ?? null,
|
|
5766
|
-
|
|
5845
|
+
// The canvas greeting draws no chooser, whatever an older server reports.
|
|
5846
|
+
chooserShown: false
|
|
5767
5847
|
}
|
|
5768
5848
|
});
|
|
5769
5849
|
log({
|
|
@@ -5973,7 +6053,7 @@ function SportSwitch({ sports, selected, onSelect, liveLabel: liveLabel3, groupL
|
|
|
5973
6053
|
}
|
|
5974
6054
|
|
|
5975
6055
|
// src/components/dashboard/v2/MarketFirstGreeting.tsx
|
|
5976
|
-
var
|
|
6056
|
+
var import_react35 = require("react");
|
|
5977
6057
|
|
|
5978
6058
|
// src/useFeaturedHighlight.ts
|
|
5979
6059
|
var import_react22 = require("react");
|
|
@@ -6034,7 +6114,102 @@ function SinceLines({ since, ui }) {
|
|
|
6034
6114
|
}
|
|
6035
6115
|
|
|
6036
6116
|
// src/components/dashboard/v2/FeaturedCard.tsx
|
|
6037
|
-
var
|
|
6117
|
+
var import_react29 = require("react");
|
|
6118
|
+
|
|
6119
|
+
// src/components/PinToggle.tsx
|
|
6120
|
+
var import_react26 = require("react");
|
|
6121
|
+
var import_widget_sdk16 = require("@sensiblestats/widget-sdk");
|
|
6122
|
+
|
|
6123
|
+
// src/components/Toast.tsx
|
|
6124
|
+
var import_react25 = require("react");
|
|
6125
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
6126
|
+
var DISMISS_MS = 4e3;
|
|
6127
|
+
function Toast({ toast, onDismiss }) {
|
|
6128
|
+
(0, import_react25.useEffect)(() => {
|
|
6129
|
+
if (!toast) return;
|
|
6130
|
+
const timer = setTimeout(onDismiss, DISMISS_MS);
|
|
6131
|
+
return () => clearTimeout(timer);
|
|
6132
|
+
}, [toast, onDismiss]);
|
|
6133
|
+
if (!toast) return null;
|
|
6134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: `ss-w-toast ss-w-toast-${toast.kind}`, role: "status", "aria-live": "polite", children: toast.text });
|
|
6135
|
+
}
|
|
6136
|
+
|
|
6137
|
+
// src/components/PinToggle.tsx
|
|
6138
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
6139
|
+
var PIN_GLYPHS = {
|
|
6140
|
+
pin: { viewBox: "0 0 24 24", strokeWidth: 1.4, transform: "scale(1.5)", d: "M9.5 1.5 14.5 6.5 13 8l-.5-.5-3 3 .3 2.2-1.4 1.4L5.6 11.3l-3.3 3.3-1-1 3.3-3.3L1.9 7.5l1.4-1.4 2.2.3 3-3L8 2.9z" },
|
|
6141
|
+
star: { viewBox: "0 0 24 24", strokeWidth: 2, d: "M12 2.5l2.9 5.9 6.5.95-4.7 4.58 1.1 6.47L12 17.35 6.1 20.4l1.1-6.47L2.5 9.35l6.5-.95z" },
|
|
6142
|
+
bookmark: { viewBox: "0 0 24 24", strokeWidth: 2, d: "M7 3h10a1.5 1.5 0 0 1 1.5 1.5V21l-6.5-3.6L5.5 21V4.5A1.5 1.5 0 0 1 7 3z" }
|
|
6143
|
+
};
|
|
6144
|
+
function PinToggle({ pin, monitor, ui, market }) {
|
|
6145
|
+
const [toast, setToast] = (0, import_react26.useState)(null);
|
|
6146
|
+
const dismiss = (0, import_react26.useCallback)(() => setToast(null), []);
|
|
6147
|
+
const log = useEventLog();
|
|
6148
|
+
if (!monitor || !monitor.enabled) return null;
|
|
6149
|
+
const key = pinKey(pin);
|
|
6150
|
+
const wireSport = (0, import_widget_sdk16.toWireSport)(pin.sport);
|
|
6151
|
+
const sportField = wireSport ? { sport: wireSport } : {};
|
|
6152
|
+
const pinned = monitor.isPinned(key);
|
|
6153
|
+
const labels = pin.kind === "match" ? { pin: ui.matchPinLabel, unpin: ui.matchUnpinLabel } : { pin: ui.pinLabel, unpin: ui.unpinLabel };
|
|
6154
|
+
const onClick = (e) => {
|
|
6155
|
+
e.stopPropagation();
|
|
6156
|
+
if (pin.kind === "match" && !monitor.isPinned(key)) {
|
|
6157
|
+
const result2 = monitor.pinMatch({ matchId: pin.matchId, marketDeveloperName: market, sport: pin.sport, ...pin.tour ? { tour: pin.tour } : {} });
|
|
6158
|
+
if (result2 === "added") {
|
|
6159
|
+
log?.log({
|
|
6160
|
+
name: "pin_add",
|
|
6161
|
+
entityType: "match",
|
|
6162
|
+
entityId: (0, import_widget_sdk16.qualifiedId)(pin.sport, "game", (0, import_widget_sdk16.localIdOf)(pin.sport, pin.matchId, pin.tour)),
|
|
6163
|
+
marketDeveloperName: pin.marketDeveloperName,
|
|
6164
|
+
...sportField
|
|
6165
|
+
});
|
|
6166
|
+
} else if (result2 === "match_limit") {
|
|
6167
|
+
setToast({ kind: "error", text: ui.matchLimitToast });
|
|
6168
|
+
}
|
|
6169
|
+
return;
|
|
6170
|
+
}
|
|
6171
|
+
const result = monitor.togglePin({ ...pin, key });
|
|
6172
|
+
if ((result === "added" || result === "removed") && (pin.kind === "match" || pin.marketDeveloperName !== void 0)) {
|
|
6173
|
+
log?.log({
|
|
6174
|
+
name: result === "added" ? "pin_add" : "pin_remove",
|
|
6175
|
+
entityType: pin.kind === "match" ? "match" : "market",
|
|
6176
|
+
entityId: pin.kind === "match" ? (0, import_widget_sdk16.qualifiedId)(pin.sport, "game", (0, import_widget_sdk16.localIdOf)(pin.sport, pin.matchId, pin.tour)) : (0, import_widget_sdk16.qualifiedId)(pin.sport, "market", pin.marketDeveloperName),
|
|
6177
|
+
marketDeveloperName: pin.marketDeveloperName,
|
|
6178
|
+
...sportField
|
|
6179
|
+
});
|
|
6180
|
+
} else if (result === "market_limit") {
|
|
6181
|
+
setToast({ kind: "error", text: ui.marketLimitToast });
|
|
6182
|
+
}
|
|
6183
|
+
};
|
|
6184
|
+
const glyph = PIN_GLYPHS[ui.pinIcon];
|
|
6185
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "ss-w-pin-wrap", children: [
|
|
6186
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
6187
|
+
"button",
|
|
6188
|
+
{
|
|
6189
|
+
type: "button",
|
|
6190
|
+
className: "ss-w-pin",
|
|
6191
|
+
"data-on": pinned || void 0,
|
|
6192
|
+
"data-icon": ui.pinIcon,
|
|
6193
|
+
"aria-pressed": pinned,
|
|
6194
|
+
"aria-label": pinned ? labels.unpin : labels.pin,
|
|
6195
|
+
onClick,
|
|
6196
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("svg", { viewBox: glyph.viewBox, "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
|
|
6197
|
+
"path",
|
|
6198
|
+
{
|
|
6199
|
+
transform: glyph.transform,
|
|
6200
|
+
d: glyph.d,
|
|
6201
|
+
fill: pinned ? "currentColor" : "none",
|
|
6202
|
+
stroke: pinned ? "none" : "currentColor",
|
|
6203
|
+
strokeWidth: glyph.strokeWidth,
|
|
6204
|
+
strokeLinejoin: "round",
|
|
6205
|
+
strokeLinecap: "round"
|
|
6206
|
+
}
|
|
6207
|
+
) })
|
|
6208
|
+
}
|
|
6209
|
+
),
|
|
6210
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Toast, { toast, onDismiss: dismiss })
|
|
6211
|
+
] });
|
|
6212
|
+
}
|
|
6038
6213
|
|
|
6039
6214
|
// src/components/dashboard/v8/kickoffText.ts
|
|
6040
6215
|
var ISO_INSTANT = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(:\d{2}(\.\d+)?)?(Z|[+-]\d{2}:?\d{2})$/;
|
|
@@ -6052,38 +6227,38 @@ function kickoffText(ui, iso) {
|
|
|
6052
6227
|
return `${k.dayLabel} ${k.time}`;
|
|
6053
6228
|
}
|
|
6054
6229
|
|
|
6055
|
-
// src/components/dashboard/v2/
|
|
6056
|
-
var
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
6061
|
-
var DISMISS_MS = 4e3;
|
|
6062
|
-
function Toast({ toast, onDismiss }) {
|
|
6063
|
-
(0, import_react25.useEffect)(() => {
|
|
6064
|
-
if (!toast) return;
|
|
6065
|
-
const timer = setTimeout(onDismiss, DISMISS_MS);
|
|
6066
|
-
return () => clearTimeout(timer);
|
|
6067
|
-
}, [toast, onDismiss]);
|
|
6068
|
-
if (!toast) return null;
|
|
6069
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { className: `ss-w-toast ss-w-toast-${toast.kind}`, role: "status", "aria-live": "polite", children: toast.text });
|
|
6230
|
+
// src/components/dashboard/v2/MarketPicker.tsx
|
|
6231
|
+
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
6232
|
+
function MarketMenu({ markets, current, label, onPick }) {
|
|
6233
|
+
if (markets.length === 0) return null;
|
|
6234
|
+
return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("ul", { className: "ss-w-v2-menu ss-w-v2-picker-list", "aria-label": label, children: markets.map((m) => /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "ss-w-v2-picker-row", "aria-current": m.market === current ? "true" : void 0, onClick: () => onPick(m), children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "ss-w-v2-market", children: m.marketLabel }) }) }, m.market)) });
|
|
6070
6235
|
}
|
|
6071
6236
|
|
|
6237
|
+
// src/components/dashboard/v2/MarketRows.tsx
|
|
6238
|
+
var import_react28 = require("react");
|
|
6239
|
+
|
|
6072
6240
|
// src/components/dashboard/v2/Price.tsx
|
|
6073
|
-
var
|
|
6241
|
+
var import_react27 = require("react");
|
|
6242
|
+
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
6074
6243
|
function logRowTap(events, slot) {
|
|
6075
6244
|
return (e) => {
|
|
6076
|
-
if (e.target instanceof Element && e.target.closest(".ss-w-v2-
|
|
6245
|
+
if (e.target instanceof Element && e.target.closest(".ss-w-pin, .ss-w-v2-mkt, .ss-w-v2-menu")) return;
|
|
6077
6246
|
events?.cardTap(slot);
|
|
6078
6247
|
};
|
|
6079
6248
|
}
|
|
6080
|
-
function
|
|
6249
|
+
function Pill({ price }) {
|
|
6250
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "ss-w-pill", children: [
|
|
6251
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("svg", { viewBox: "0 0 24 24", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("path", { d: "M12 5v14M5 12h14" }) }),
|
|
6252
|
+
price
|
|
6253
|
+
] });
|
|
6254
|
+
}
|
|
6255
|
+
function PriceButtons({ selections, ui, onAdd, rowLabel }) {
|
|
6081
6256
|
const { oddsFormat } = useOddsSettings();
|
|
6082
|
-
const [busy, setBusy] = (0,
|
|
6083
|
-
const [goneFor, setGoneFor] = (0,
|
|
6084
|
-
const [toast, setToast] = (0,
|
|
6085
|
-
const dismiss = (0,
|
|
6086
|
-
const inFlight2 = (0,
|
|
6257
|
+
const [busy, setBusy] = (0, import_react27.useState)(/* @__PURE__ */ new Set());
|
|
6258
|
+
const [goneFor, setGoneFor] = (0, import_react27.useState)(null);
|
|
6259
|
+
const [toast, setToast] = (0, import_react27.useState)(null);
|
|
6260
|
+
const dismiss = (0, import_react27.useCallback)(() => setToast(null), []);
|
|
6261
|
+
const inFlight2 = (0, import_react27.useRef)(/* @__PURE__ */ new Set());
|
|
6087
6262
|
const tap = async (s) => {
|
|
6088
6263
|
if (!onAdd || inFlight2.current.has(s.matchOddsId)) return;
|
|
6089
6264
|
inFlight2.current.add(s.matchOddsId);
|
|
@@ -6100,135 +6275,103 @@ function PriceButtons({ selections, ui, onAdd }) {
|
|
|
6100
6275
|
if (result.outcome === "gone") setGoneFor(selections);
|
|
6101
6276
|
if (result.toast) setToast({ toast: result.toast, for: selections });
|
|
6102
6277
|
};
|
|
6103
|
-
|
|
6104
|
-
|
|
6105
|
-
|
|
6106
|
-
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6278
|
+
const asRow = selections.length === 1 || rowLabel !== void 0;
|
|
6279
|
+
const buttons = selections.map((s) => {
|
|
6280
|
+
const label = asRow ? rowLabel ?? s.label : s.label;
|
|
6281
|
+
const price = formatOdds(s.formats, oddsFormat);
|
|
6282
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(
|
|
6283
|
+
"button",
|
|
6284
|
+
{
|
|
6285
|
+
type: "button",
|
|
6286
|
+
className: asRow ? "ss-w-v2-row" : "ss-w-v2-tile",
|
|
6287
|
+
"aria-label": ui.v2AddLabel(label, price),
|
|
6288
|
+
disabled: busy.has(s.matchOddsId),
|
|
6289
|
+
onClick: onAdd ? () => {
|
|
6290
|
+
void tap(s);
|
|
6291
|
+
} : void 0,
|
|
6292
|
+
children: [
|
|
6293
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { children: label }),
|
|
6294
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Pill, { price })
|
|
6295
|
+
]
|
|
6296
|
+
},
|
|
6297
|
+
s.matchOddsId
|
|
6298
|
+
);
|
|
6299
|
+
});
|
|
6300
|
+
if (selections.length === 0) return null;
|
|
6301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
|
|
6302
|
+
asRow ? buttons : /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("div", { className: "ss-w-v2-tiles", "data-count": Math.min(selections.length, 3), children: buttons }),
|
|
6303
|
+
goneFor === selections ? /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("p", { className: "ss-w-v2-gone", role: "status", children: ui.v2PriceGone }) : null,
|
|
6304
|
+
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Toast, { toast: toast?.for === selections ? toast.toast : null, onDismiss: dismiss })
|
|
6112
6305
|
] });
|
|
6113
6306
|
}
|
|
6114
6307
|
|
|
6308
|
+
// src/components/dashboard/v2/MarketRows.tsx
|
|
6309
|
+
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
6310
|
+
var FACT_KEY = { GOALS_OVER_UNDER: "goals", BOTH_TEAMS_TO_SCORE: "btts", FULLTIME_RESULT: "result" };
|
|
6311
|
+
function FactRowView({ row, ui, matchId, add, lead }) {
|
|
6312
|
+
const events = (0, import_react28.useContext)(GreetingEventsContext);
|
|
6313
|
+
const hook = lead ? events?.hook : { kind: "fact", factKey: FACT_KEY[row.market] ?? row.market };
|
|
6314
|
+
const selections = (0, import_react28.useMemo)(() => [row.selection], [row.selection]);
|
|
6315
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "ss-w-v2-fact", children: [
|
|
6316
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { children: row.stat }),
|
|
6317
|
+
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PriceButtons, { selections, ui, rowLabel: row.label, onAdd: add ? (s) => add(matchId, row.market, s, hook) : void 0 })
|
|
6318
|
+
] });
|
|
6319
|
+
}
|
|
6320
|
+
function FactRows({ rows, hide, ui, matchId, add, lead = false }) {
|
|
6321
|
+
const shown2 = rows.filter((r) => r.market !== hide);
|
|
6322
|
+
if (shown2.length === 0) return null;
|
|
6323
|
+
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_jsx_runtime10.Fragment, { children: shown2.map((r) => /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FactRowView, { row: r, ui, matchId, add, lead }, `${r.market}:${r.selection.matchOddsId}`)) });
|
|
6324
|
+
}
|
|
6325
|
+
|
|
6115
6326
|
// src/components/dashboard/v2/FeaturedCard.tsx
|
|
6116
|
-
var
|
|
6117
|
-
function
|
|
6118
|
-
const
|
|
6119
|
-
|
|
6120
|
-
const
|
|
6121
|
-
|
|
6122
|
-
|
|
6123
|
-
|
|
6124
|
-
|
|
6125
|
-
function FeaturedCard({ card, ui, tag: tag2, highlighted = false, add }) {
|
|
6126
|
-
const events = (0, import_react27.useContext)(GreetingEventsContext);
|
|
6127
|
-
const sub = [kickoffText(ui, card.startsAtUtc), card.competition].filter(Boolean).join(" \xB7 ");
|
|
6128
|
-
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
|
|
6327
|
+
var import_jsx_runtime11 = require("react/jsx-runtime");
|
|
6328
|
+
function FeaturedCard({ card, ui, tag: tag2, sport, open, onToggleMenu, onPick, picked, highlighted = false, add }) {
|
|
6329
|
+
const events = (0, import_react29.useContext)(GreetingEventsContext);
|
|
6330
|
+
const monitor = usePersonalGreeting()?.monitor;
|
|
6331
|
+
const title = card.title ?? ui.v2GameTitle(card.home.label, card.away.label, sport);
|
|
6332
|
+
const meta = [instantMs(card.startsAtUtc) === null ? null : ui.v2KickoffLine(card.startsAtUtc), card.competition].filter(Boolean).join(" \xB7 ");
|
|
6333
|
+
const markets = card.markets ?? [];
|
|
6334
|
+
const label = ui.v2CardLabel(title, card.marketLabel);
|
|
6335
|
+
return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(
|
|
6129
6336
|
"article",
|
|
6130
6337
|
{
|
|
6131
6338
|
className: "ss-w-v8-card ss-w-v2-featured",
|
|
6132
6339
|
"data-match-id": card.matchId,
|
|
6133
6340
|
"data-highlight": highlighted ? "true" : void 0,
|
|
6134
|
-
"aria-label":
|
|
6341
|
+
"aria-label": label,
|
|
6135
6342
|
onClickCapture: logRowTap(events, 0),
|
|
6136
6343
|
children: [
|
|
6137
|
-
/* @__PURE__ */ (0,
|
|
6138
|
-
/* @__PURE__ */ (0,
|
|
6139
|
-
|
|
6140
|
-
card.home.label,
|
|
6141
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Star, { team: card.home, ui })
|
|
6142
|
-
] }),
|
|
6143
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "ss-w-v2-team", children: [
|
|
6144
|
-
card.away.label,
|
|
6145
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(Star, { team: card.away, ui })
|
|
6146
|
-
] })
|
|
6147
|
-
] }),
|
|
6148
|
-
sub ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "ss-w-v8-card-sub", children: sub }) : null
|
|
6344
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "ss-w-v2-head", children: [
|
|
6345
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("h3", { className: "ss-w-v2-title", children: title }),
|
|
6346
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PinToggle, { ui, monitor, market: card.market, pin: { kind: "match", matchId: Number(card.matchId), ...sport === "nba" ? { sport: "basketball" } : {} } })
|
|
6149
6347
|
] }),
|
|
6150
|
-
/* @__PURE__ */ (0,
|
|
6151
|
-
|
|
6152
|
-
|
|
6348
|
+
meta ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "ss-w-v2-meta", children: meta }) : null,
|
|
6349
|
+
card.hook ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FactRows, { rows: [card.hook], hide: picked, ui, matchId: card.matchId, add, lead: true }) : null,
|
|
6350
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "ss-w-v2-head", children: [
|
|
6351
|
+
markets.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("button", { type: "button", className: "ss-w-v2-mkt", "aria-label": ui.v2ChangeMarket(card.marketLabel), "aria-expanded": open, onClick: onToggleMenu, children: [
|
|
6352
|
+
card.marketLabel,
|
|
6353
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)("svg", { viewBox: "0 0 24 24", width: "14", height: "14", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("path", { d: "M6 9l6 6 6-6", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round" }) })
|
|
6354
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "ss-w-v2-mkt", children: card.marketLabel }),
|
|
6355
|
+
card.yourMarket ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: "ss-w-v2-tag", children: tag2 }) : null
|
|
6153
6356
|
] }),
|
|
6154
|
-
/* @__PURE__ */ (0,
|
|
6155
|
-
|
|
6357
|
+
open ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(MarketMenu, { markets, current: card.market, label: ui.v2ChangeMarket(card.marketLabel), onPick }) : null,
|
|
6358
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(PriceButtons, { selections: card.selections, ui, onAdd: add ? (s) => add(card.matchId, card.market, s, events?.hook) : void 0 }),
|
|
6359
|
+
add ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "ss-w-v2-hint", children: ui.v2PriceHint }) : null,
|
|
6360
|
+
card.stat ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "ss-w-v2-stat", children: card.stat }) : null,
|
|
6361
|
+
/* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FactRows, { rows: card.facts ?? [], hide: picked, ui, matchId: card.matchId, add })
|
|
6156
6362
|
]
|
|
6157
6363
|
}
|
|
6158
6364
|
);
|
|
6159
6365
|
}
|
|
6160
6366
|
|
|
6161
|
-
// src/components/dashboard/v2/MarketPicker.tsx
|
|
6162
|
-
var import_jsx_runtime9 = require("react/jsx-runtime");
|
|
6163
|
-
function MarketPicker({ markets, current, title, onPick }) {
|
|
6164
|
-
const { oddsFormat } = useOddsSettings();
|
|
6165
|
-
if (markets.length === 0) return null;
|
|
6166
|
-
return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("section", { className: "ss-w-v8-sec ss-w-v2-picker", "aria-label": title, children: [
|
|
6167
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("h3", { className: "ss-w-v2-picker-title", children: title }),
|
|
6168
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("ul", { className: "ss-w-v2-picker-list", children: markets.map((m) => /* @__PURE__ */ (0, import_jsx_runtime9.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("button", { type: "button", className: "ss-w-v2-picker-row", "aria-current": m.market === current ? "true" : void 0, onClick: () => onPick(m), children: [
|
|
6169
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "ss-w-v2-market", children: m.marketLabel }),
|
|
6170
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "ss-w-v2-picker-prices", children: m.selections.map((s) => /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("span", { className: "ss-w-v2-picker-price", children: [
|
|
6171
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "ss-w-mol-lab", children: s.label }),
|
|
6172
|
-
/* @__PURE__ */ (0, import_jsx_runtime9.jsx)("span", { className: "ss-w-mol-tick", children: formatOdds(s.formats, oddsFormat) })
|
|
6173
|
-
] }, s.matchOddsId)) })
|
|
6174
|
-
] }) }, m.market)) })
|
|
6175
|
-
] });
|
|
6176
|
-
}
|
|
6177
|
-
|
|
6178
|
-
// src/components/dashboard/v2/MarketRows.tsx
|
|
6179
|
-
var import_react28 = require("react");
|
|
6180
|
-
var import_jsx_runtime10 = require("react/jsx-runtime");
|
|
6181
|
-
function StripRows({ rows, tag: tag2, ui, slotBase, matchId, hide, add }) {
|
|
6182
|
-
const events = (0, import_react28.useContext)(GreetingEventsContext);
|
|
6183
|
-
if (rows.length === 0) return null;
|
|
6184
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("section", { className: "ss-w-v8-sec ss-w-v2-strip", children: rows.map((r, i) => r.market === hide ? null : /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("article", { className: "ss-w-v8-card ss-w-v2-strip-row", onClickCapture: logRowTap(events, slotBase + i), children: [
|
|
6185
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: "ss-w-v2-head", children: [
|
|
6186
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "ss-w-v2-market", children: r.marketLabel }),
|
|
6187
|
-
r.yourMarket ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "ss-w-v2-tag", children: tag2 }) : null
|
|
6188
|
-
] }),
|
|
6189
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PriceButtons, { selections: r.selections, ui, onAdd: add ? (s) => add(matchId, r.market, s) : void 0 }),
|
|
6190
|
-
r.stat ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "ss-w-v2-stat", children: r.stat }) : null
|
|
6191
|
-
] }, `${r.market}:${i}`)) });
|
|
6192
|
-
}
|
|
6193
|
-
function AlternativeRows({ rows, market, marketLabel, ui, slotBase, add }) {
|
|
6194
|
-
const events = (0, import_react28.useContext)(GreetingEventsContext);
|
|
6195
|
-
if (rows.length === 0) return null;
|
|
6196
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("section", { className: "ss-w-v8-sec ss-w-v2-alts", children: rows.map((r, i) => {
|
|
6197
|
-
const sub = [kickoffText(ui, r.startsAtUtc), r.competition].filter(Boolean).join(" \xB7 ");
|
|
6198
|
-
return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
|
|
6199
|
-
"article",
|
|
6200
|
-
{
|
|
6201
|
-
className: "ss-w-v8-card ss-w-v2-alt-row",
|
|
6202
|
-
"data-match-id": r.matchId,
|
|
6203
|
-
"aria-label": ui.v2CardLabel(r.home, r.away, r.marketLabel ?? marketLabel),
|
|
6204
|
-
onClickCapture: logRowTap(events, slotBase + i),
|
|
6205
|
-
children: [
|
|
6206
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("header", { className: "ss-w-v8-card-head", children: [
|
|
6207
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("b", { className: "ss-w-v8-card-name", children: [
|
|
6208
|
-
r.home,
|
|
6209
|
-
" - ",
|
|
6210
|
-
r.away
|
|
6211
|
-
] }),
|
|
6212
|
-
sub ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "ss-w-v8-card-sub", children: sub }) : null
|
|
6213
|
-
] }),
|
|
6214
|
-
r.marketLabel ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("div", { className: "ss-w-v2-head", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("span", { className: "ss-w-v2-market", children: r.marketLabel }) }) : null,
|
|
6215
|
-
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PriceButtons, { selections: r.selections, ui, onAdd: add ? (s) => add(r.matchId, market, s) : void 0 }),
|
|
6216
|
-
r.stat ? /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("p", { className: "ss-w-v2-stat", children: r.stat }) : null
|
|
6217
|
-
]
|
|
6218
|
-
},
|
|
6219
|
-
`${r.matchId}:${i}`
|
|
6220
|
-
);
|
|
6221
|
-
}) });
|
|
6222
|
-
}
|
|
6223
|
-
|
|
6224
6367
|
// src/components/dashboard/v2/useRepriceAdd.ts
|
|
6225
|
-
var
|
|
6368
|
+
var import_react34 = require("react");
|
|
6226
6369
|
|
|
6227
6370
|
// src/nflKickoff.ts
|
|
6228
|
-
var
|
|
6229
|
-
var
|
|
6371
|
+
var import_react30 = require("react");
|
|
6372
|
+
var import_widget_sdk17 = require("@sensiblestats/widget-sdk");
|
|
6230
6373
|
var MAX_TIMEOUT_MS = 2147483647;
|
|
6231
|
-
var isNfl = (sport) => (0,
|
|
6374
|
+
var isNfl = (sport) => (0, import_widget_sdk17.sportOf)(sport) === "americanfootball";
|
|
6232
6375
|
var nflStarted = (vm, nowMs) => isNfl(vm.sport) && !(vm.kickoffUtc != null && Date.parse(vm.kickoffUtc) > nowMs);
|
|
6233
6376
|
function guardNflKickoff(slip, vm, ui) {
|
|
6234
6377
|
const host = slip.onAddToSlip;
|
|
@@ -6253,9 +6396,9 @@ function guardLegsPreMatch(slip, legs, ui) {
|
|
|
6253
6396
|
};
|
|
6254
6397
|
}
|
|
6255
6398
|
function useNextKickoffRender(kickoffs) {
|
|
6256
|
-
const [tick, setTick] = (0,
|
|
6399
|
+
const [tick, setTick] = (0, import_react30.useState)(0);
|
|
6257
6400
|
const key = kickoffs.map((k) => k ?? "").join("|");
|
|
6258
|
-
(0,
|
|
6401
|
+
(0, import_react30.useEffect)(() => {
|
|
6259
6402
|
const now = Date.now();
|
|
6260
6403
|
const upcoming = key.split("|").map((k) => k ? Date.parse(k) : NaN).filter((ms) => ms > now);
|
|
6261
6404
|
if (upcoming.length === 0) return;
|
|
@@ -6267,23 +6410,23 @@ function useNextKickoffRender(kickoffs) {
|
|
|
6267
6410
|
}
|
|
6268
6411
|
|
|
6269
6412
|
// src/slipAdd.ts
|
|
6270
|
-
var
|
|
6271
|
-
var
|
|
6413
|
+
var import_react33 = require("react");
|
|
6414
|
+
var import_widget_sdk18 = require("@sensiblestats/widget-sdk");
|
|
6272
6415
|
|
|
6273
6416
|
// src/trackingContext.ts
|
|
6274
|
-
var
|
|
6417
|
+
var import_react31 = require("react");
|
|
6275
6418
|
var noop = () => {
|
|
6276
6419
|
};
|
|
6277
|
-
var TrackingContext = (0,
|
|
6420
|
+
var TrackingContext = (0, import_react31.createContext)(noop);
|
|
6278
6421
|
function useTrack() {
|
|
6279
|
-
return (0,
|
|
6422
|
+
return (0, import_react31.useContext)(TrackingContext);
|
|
6280
6423
|
}
|
|
6281
6424
|
|
|
6282
6425
|
// src/slipStateContext.ts
|
|
6283
|
-
var
|
|
6284
|
-
var SlipStateContext = (0,
|
|
6426
|
+
var import_react32 = require("react");
|
|
6427
|
+
var SlipStateContext = (0, import_react32.createContext)(null);
|
|
6285
6428
|
function useSlipState() {
|
|
6286
|
-
return (0,
|
|
6429
|
+
return (0, import_react32.useContext)(SlipStateContext);
|
|
6287
6430
|
}
|
|
6288
6431
|
|
|
6289
6432
|
// src/slipAdd.ts
|
|
@@ -6315,12 +6458,12 @@ function useSlipAdd(slip, ui) {
|
|
|
6315
6458
|
const handler = slip.onAddToSlip;
|
|
6316
6459
|
const rawLabels = !!ui?.rawBettingLabels;
|
|
6317
6460
|
const operatorFormat = ui?.oddsFormat ?? "decimal";
|
|
6318
|
-
return (0,
|
|
6461
|
+
return (0, import_react33.useCallback)(async (selection, { marketDeveloperName, selectionLabel, line, fact, hook }) => {
|
|
6319
6462
|
if (!handler) return { kind: "failed" };
|
|
6320
6463
|
const display = slipDisplay({ ...selection.display, market: marketDeveloperName, selection: selectionLabel, line });
|
|
6321
6464
|
const out = toHostSelection(display ? { ...selection, display } : selection, operatorFormat);
|
|
6322
6465
|
const pick = slipPickFields(out, rawLabels ? selectionLabel : void 0, line);
|
|
6323
|
-
const wireSport = (0,
|
|
6466
|
+
const wireSport = (0, import_widget_sdk18.toWireSport)(out.sport);
|
|
6324
6467
|
const sportField = {
|
|
6325
6468
|
...wireSport ? { sport: wireSport } : {},
|
|
6326
6469
|
...wireSport === "tennis" && out.tour ? { tour: out.tour } : {}
|
|
@@ -6343,7 +6486,7 @@ function useSlipAdd(slip, ui) {
|
|
|
6343
6486
|
}
|
|
6344
6487
|
try {
|
|
6345
6488
|
const raw = await withTimeout(Promise.resolve(handler(out)));
|
|
6346
|
-
if (raw != null && !(0,
|
|
6489
|
+
if (raw != null && !(0, import_widget_sdk18.isAddToSlipResult)(raw)) throw new Error("malformed add-to-slip result");
|
|
6347
6490
|
const result = withSafeMessage(raw ?? void 0);
|
|
6348
6491
|
track({ name: "add_to_slip_result", outcome: slipOutcome(result), ...clickFields });
|
|
6349
6492
|
if (marketDeveloperName !== void 0) {
|
|
@@ -6376,9 +6519,9 @@ function useSlipAdd(slip, ui) {
|
|
|
6376
6519
|
}
|
|
6377
6520
|
|
|
6378
6521
|
// src/components/dashboard/v8/builderLegs.ts
|
|
6379
|
-
var
|
|
6522
|
+
var import_widget_sdk19 = require("@sensiblestats/widget-sdk");
|
|
6380
6523
|
function slipSportOfWire(sport) {
|
|
6381
|
-
const hit = Object.entries(
|
|
6524
|
+
const hit = Object.entries(import_widget_sdk19.SPORTS).find(([, spec]) => spec.wireKey === sport);
|
|
6382
6525
|
return hit ? hit[0] : void 0;
|
|
6383
6526
|
}
|
|
6384
6527
|
function readLeg(raw, sport) {
|
|
@@ -6418,8 +6561,8 @@ function useRepriceAdd({ conversation, locale, slip, ui, sport = "football" }) {
|
|
|
6418
6561
|
const operatorUserId = scope?.operatorUserId;
|
|
6419
6562
|
const anonymousUserId = scope?.anonymousUserId;
|
|
6420
6563
|
const host = slip?.onAddToSlip;
|
|
6421
|
-
const kickoffs = (0,
|
|
6422
|
-
const guarded = (0,
|
|
6564
|
+
const kickoffs = (0, import_react34.useRef)(/* @__PURE__ */ new Map());
|
|
6565
|
+
const guarded = (0, import_react34.useMemo)(() => {
|
|
6423
6566
|
if (!slip || !host) return NO_SLIP;
|
|
6424
6567
|
return {
|
|
6425
6568
|
...slip,
|
|
@@ -6428,7 +6571,7 @@ function useRepriceAdd({ conversation, locale, slip, ui, sport = "football" }) {
|
|
|
6428
6571
|
}, [slip, host, ui]);
|
|
6429
6572
|
const addToSlip = useSlipAdd(guarded, ui);
|
|
6430
6573
|
const canAdd2 = !!conversation && !!host;
|
|
6431
|
-
const add = (0,
|
|
6574
|
+
const add = (0, import_react34.useCallback)(async (matchId, market, selection, hook) => {
|
|
6432
6575
|
if (!conversation || !slip) return { outcome: "failed" };
|
|
6433
6576
|
try {
|
|
6434
6577
|
const grid = await conversation.getBuilderGrid(locale, {
|
|
@@ -6463,13 +6606,9 @@ function useRepriceAdd({ conversation, locale, slip, ui, sport = "football" }) {
|
|
|
6463
6606
|
}
|
|
6464
6607
|
|
|
6465
6608
|
// src/components/dashboard/v2/MarketFirstGreeting.tsx
|
|
6466
|
-
var
|
|
6467
|
-
var STRIP_SLOT = 1;
|
|
6468
|
-
var ALT_SLOT = 4;
|
|
6609
|
+
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
6469
6610
|
var CHIP_LABEL = {
|
|
6470
|
-
live_games: (ui) => ui.v2ChipLive
|
|
6471
|
-
another_market: (ui) => ui.v2ChipAnotherMarket,
|
|
6472
|
-
build_combo: (ui) => ui.v2ChipBuildCombo
|
|
6611
|
+
live_games: (ui) => ui.v2ChipLive
|
|
6473
6612
|
};
|
|
6474
6613
|
var chipsFor = (section2) => section2.chips.filter((c) => Object.prototype.hasOwnProperty.call(CHIP_LABEL, c) && (!section2.coolOff || c === "live_games"));
|
|
6475
6614
|
function MarketFirstGreeting({ section: section2, ui, slip, sport, onAct }) {
|
|
@@ -6477,17 +6616,17 @@ function MarketFirstGreeting({ section: section2, ui, slip, sport, onAct }) {
|
|
|
6477
6616
|
const personal = usePersonalGreeting();
|
|
6478
6617
|
const openTab = personal?.openTab;
|
|
6479
6618
|
const add = useRepriceAdd({ conversation: personal?.conversation ?? null, locale: ui.hostTag, slip, ui, sport });
|
|
6480
|
-
const [chosen, setChosen] = (0,
|
|
6481
|
-
const [open, setOpen] = (0,
|
|
6619
|
+
const [chosen, setChosen] = (0, import_react35.useState)(null);
|
|
6620
|
+
const [open, setOpen] = (0, import_react35.useState)(false);
|
|
6482
6621
|
const base = section2.coolOff ? void 0 : section2.featured;
|
|
6483
6622
|
const pickedRow = base && chosen && chosen.matchId === base.matchId ? chosen.row : null;
|
|
6484
6623
|
const card = base && pickedRow ? { ...base, market: pickedRow.market, marketLabel: pickedRow.marketLabel, selections: pickedRow.selections, stat: pickedRow.stat, yourMarket: true } : base;
|
|
6485
|
-
const
|
|
6486
|
-
const rootRef = (0,
|
|
6487
|
-
const [pickCount, setPickCount] = (0,
|
|
6488
|
-
(0,
|
|
6624
|
+
const menu = base && pickedRow ? [{ market: base.market, marketLabel: base.marketLabel, yourMarket: base.yourMarket, selections: base.selections, stat: base.stat }, ...base.markets ?? []] : base?.markets ?? [];
|
|
6625
|
+
const rootRef = (0, import_react35.useRef)(null);
|
|
6626
|
+
const [pickCount, setPickCount] = (0, import_react35.useState)(0);
|
|
6627
|
+
(0, import_react35.useEffect)(() => {
|
|
6489
6628
|
if (pickCount === 0) return;
|
|
6490
|
-
rootRef.current?.querySelector(".ss-w-v2-featured .ss-w-
|
|
6629
|
+
rootRef.current?.querySelector(".ss-w-v2-featured .ss-w-v2-tile, .ss-w-v2-featured > .ss-w-v2-row, .ss-w-v2-chips button")?.focus();
|
|
6491
6630
|
}, [pickCount]);
|
|
6492
6631
|
const pick = (row) => {
|
|
6493
6632
|
setPickCount((n) => n + 1);
|
|
@@ -6500,28 +6639,29 @@ function MarketFirstGreeting({ section: section2, ui, slip, sport, onAct }) {
|
|
|
6500
6639
|
setChosen({ matchId: card.matchId, row });
|
|
6501
6640
|
log?.log({ name: "market_choose", entityType: "market", entityId: row.market });
|
|
6502
6641
|
};
|
|
6503
|
-
const request = (0,
|
|
6642
|
+
const request = (0, import_react35.useContext)(GreetingHighlightContext);
|
|
6504
6643
|
const highlighted = useFeaturedHighlight(card && request?.matchId === card.matchId ? card.matchId : null, request?.token, request?.clear);
|
|
6505
|
-
const
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
section2.
|
|
6524
|
-
|
|
6644
|
+
const chips = openTab ? chipsFor(section2) : [];
|
|
6645
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "ss-w-v2", ref: rootRef, children: [
|
|
6646
|
+
section2.hello ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "ss-w-v2-hello", children: section2.hello }) : null,
|
|
6647
|
+
card ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
6648
|
+
FeaturedCard,
|
|
6649
|
+
{
|
|
6650
|
+
card: { ...card, markets: menu },
|
|
6651
|
+
ui,
|
|
6652
|
+
tag: section2.yourMarketLabel,
|
|
6653
|
+
sport,
|
|
6654
|
+
open,
|
|
6655
|
+
onToggleMenu: () => setOpen((o) => !o),
|
|
6656
|
+
onPick: pick,
|
|
6657
|
+
picked: pickedRow?.market,
|
|
6658
|
+
highlighted,
|
|
6659
|
+
add
|
|
6660
|
+
}
|
|
6661
|
+
) : null,
|
|
6662
|
+
section2.asks.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(AskCards, { asks: section2.asks, ui, ofYours: false, onAct }) : null,
|
|
6663
|
+
section2.since.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SinceLines, { since: section2.since, ui }) : null,
|
|
6664
|
+
chips.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "ss-w-v8-chips ss-w-v2-chips", children: chips.map((c) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("button", { type: "button", className: "ss-w-v8-chip", onClick: () => openTab?.("live"), children: CHIP_LABEL[c](ui) }, c)) }) : null
|
|
6525
6665
|
] });
|
|
6526
6666
|
}
|
|
6527
6667
|
|
|
@@ -6529,7 +6669,7 @@ function MarketFirstGreeting({ section: section2, ui, slip, sport, onAct }) {
|
|
|
6529
6669
|
var import_react44 = require("react");
|
|
6530
6670
|
|
|
6531
6671
|
// src/useBuilderGrid.ts
|
|
6532
|
-
var
|
|
6672
|
+
var import_react36 = require("react");
|
|
6533
6673
|
|
|
6534
6674
|
// src/builderMemory.ts
|
|
6535
6675
|
var GRID_TTL_MS = 5 * 6e4;
|
|
@@ -6625,18 +6765,18 @@ function forget(memory3, key, flight) {
|
|
|
6625
6765
|
if (flights?.get(key) === flight) flights.delete(key);
|
|
6626
6766
|
}
|
|
6627
6767
|
function useBuilderGrid({ conversation, locale, memory: memory3, initial: initial2 }) {
|
|
6628
|
-
const [seed] = (0,
|
|
6629
|
-
const [grid, setGrid] = (0,
|
|
6630
|
-
const [status2, setStatus] = (0,
|
|
6631
|
-
const [confirmed, setConfirmed] = (0,
|
|
6632
|
-
const [answered, setAnswered] = (0,
|
|
6633
|
-
const seq = (0,
|
|
6634
|
-
const mounted = (0,
|
|
6635
|
-
const hung = (0,
|
|
6636
|
-
const waiting = (0,
|
|
6637
|
-
const memoryRef = (0,
|
|
6768
|
+
const [seed] = (0, import_react36.useState)(() => memory3 && conversation && initial2 ? memory3.cachedGrid(gridKey(locale, initial2)) : void 0);
|
|
6769
|
+
const [grid, setGrid] = (0, import_react36.useState)(seed ?? null);
|
|
6770
|
+
const [status2, setStatus] = (0, import_react36.useState)(seed ? "ready" : "idle");
|
|
6771
|
+
const [confirmed, setConfirmed] = (0, import_react36.useState)(false);
|
|
6772
|
+
const [answered, setAnswered] = (0, import_react36.useState)(seed && initial2 ? { req: initial2, locale } : null);
|
|
6773
|
+
const seq = (0, import_react36.useRef)(0);
|
|
6774
|
+
const mounted = (0, import_react36.useRef)(true);
|
|
6775
|
+
const hung = (0, import_react36.useRef)(void 0);
|
|
6776
|
+
const waiting = (0, import_react36.useRef)(null);
|
|
6777
|
+
const memoryRef = (0, import_react36.useRef)(memory3);
|
|
6638
6778
|
memoryRef.current = memory3;
|
|
6639
|
-
const stopWaiting = (0,
|
|
6779
|
+
const stopWaiting = (0, import_react36.useCallback)((release, keep) => {
|
|
6640
6780
|
window.clearTimeout(hung.current);
|
|
6641
6781
|
const w = waiting.current;
|
|
6642
6782
|
waiting.current = null;
|
|
@@ -6644,14 +6784,14 @@ function useBuilderGrid({ conversation, locale, memory: memory3, initial: initia
|
|
|
6644
6784
|
w.flight.waiters -= 1;
|
|
6645
6785
|
if (release && w.key !== keep && w.flight.waiters <= 0 && memoryRef.current) forget(memoryRef.current, w.key, w.flight);
|
|
6646
6786
|
}, []);
|
|
6647
|
-
(0,
|
|
6787
|
+
(0, import_react36.useEffect)(() => {
|
|
6648
6788
|
mounted.current = true;
|
|
6649
6789
|
return () => {
|
|
6650
6790
|
mounted.current = false;
|
|
6651
6791
|
stopWaiting(true);
|
|
6652
6792
|
};
|
|
6653
6793
|
}, [stopWaiting]);
|
|
6654
|
-
const request = (0,
|
|
6794
|
+
const request = (0, import_react36.useCallback)(async (req) => {
|
|
6655
6795
|
if (!conversation) return;
|
|
6656
6796
|
const mine = ++seq.current;
|
|
6657
6797
|
const key = memory3 ? gridKey(locale, req) : null;
|
|
@@ -6727,13 +6867,13 @@ function useBuilderGrid({ conversation, locale, memory: memory3, initial: initia
|
|
|
6727
6867
|
}
|
|
6728
6868
|
|
|
6729
6869
|
// src/components/AddToSlipButton.tsx
|
|
6730
|
-
var
|
|
6731
|
-
var
|
|
6870
|
+
var import_react37 = require("react");
|
|
6871
|
+
var import_jsx_runtime13 = require("react/jsx-runtime");
|
|
6732
6872
|
function SlipButton({ selection, marketDeveloperName, selectionLabel, line, slip, ui, price, ariaLabel, hold, fact }) {
|
|
6733
|
-
const [pending, setPending] = (0,
|
|
6734
|
-
const [settledLocal, setSettledLocal] = (0,
|
|
6735
|
-
const [toast, setToast] = (0,
|
|
6736
|
-
const dismiss = (0,
|
|
6873
|
+
const [pending, setPending] = (0, import_react37.useState)(false);
|
|
6874
|
+
const [settledLocal, setSettledLocal] = (0, import_react37.useState)(false);
|
|
6875
|
+
const [toast, setToast] = (0, import_react37.useState)(null);
|
|
6876
|
+
const dismiss = (0, import_react37.useCallback)(() => setToast(null), []);
|
|
6737
6877
|
const add = useSlipAdd(slip, ui);
|
|
6738
6878
|
const slipState = useSlipState();
|
|
6739
6879
|
const { oddsFormat } = useOddsSettings();
|
|
@@ -6754,8 +6894,8 @@ function SlipButton({ selection, marketDeveloperName, selectionLabel, line, slip
|
|
|
6754
6894
|
setPending(false);
|
|
6755
6895
|
}
|
|
6756
6896
|
};
|
|
6757
|
-
return /* @__PURE__ */ (0,
|
|
6758
|
-
price ? /* @__PURE__ */ (0,
|
|
6897
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("div", { className: "ss-w-slip", children: [
|
|
6898
|
+
price ? /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
6759
6899
|
"button",
|
|
6760
6900
|
{
|
|
6761
6901
|
type: "button",
|
|
@@ -6765,15 +6905,15 @@ function SlipButton({ selection, marketDeveloperName, selectionLabel, line, slip
|
|
|
6765
6905
|
disabled: pending || settled || hold,
|
|
6766
6906
|
onClick,
|
|
6767
6907
|
children: [
|
|
6768
|
-
settled ? /* @__PURE__ */ (0,
|
|
6769
|
-
price.label ? /* @__PURE__ */ (0,
|
|
6770
|
-
/* @__PURE__ */ (0,
|
|
6908
|
+
settled ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-mol-tick", "aria-hidden": "true", children: "\u2713" }) : null,
|
|
6909
|
+
price.label ? /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-mol-lab", children: price.label }) : null,
|
|
6910
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsxs)("span", { className: price.valueClass, children: [
|
|
6771
6911
|
price.lead,
|
|
6772
6912
|
formatOdds(selection.forms, oddsFormat)
|
|
6773
6913
|
] })
|
|
6774
6914
|
]
|
|
6775
6915
|
}
|
|
6776
|
-
) : /* @__PURE__ */ (0,
|
|
6916
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
6777
6917
|
"button",
|
|
6778
6918
|
{
|
|
6779
6919
|
type: "button",
|
|
@@ -6784,12 +6924,12 @@ function SlipButton({ selection, marketDeveloperName, selectionLabel, line, slip
|
|
|
6784
6924
|
children: settled ? ui.inSlip : ui.addToSlip
|
|
6785
6925
|
}
|
|
6786
6926
|
),
|
|
6787
|
-
/* @__PURE__ */ (0,
|
|
6927
|
+
/* @__PURE__ */ (0, import_jsx_runtime13.jsx)(Toast, { toast, onDismiss: dismiss })
|
|
6788
6928
|
] });
|
|
6789
6929
|
}
|
|
6790
6930
|
function AddToSlipButton({ it, slip, ui }) {
|
|
6791
6931
|
const selection = it.addToSlipEnabled ? toSlipSelection(it, slip.conversationId) : null;
|
|
6792
|
-
return /* @__PURE__ */ (0,
|
|
6932
|
+
return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(
|
|
6793
6933
|
SlipButton,
|
|
6794
6934
|
{
|
|
6795
6935
|
selection,
|
|
@@ -6807,7 +6947,7 @@ var import_react43 = require("react");
|
|
|
6807
6947
|
var import_widget_sdk22 = require("@sensiblestats/widget-sdk");
|
|
6808
6948
|
|
|
6809
6949
|
// src/components/OddsMovementBadge.tsx
|
|
6810
|
-
var
|
|
6950
|
+
var import_jsx_runtime14 = (
|
|
6811
6951
|
// Strikethrough is invisible to screen readers, so the whole was/now/direction sentence rides
|
|
6812
6952
|
// on one aria-label and the visual glyphs are hidden from the accessibility tree.
|
|
6813
6953
|
require("react/jsx-runtime")
|
|
@@ -6824,105 +6964,26 @@ function OddsMovementBadge({
|
|
|
6824
6964
|
if (previous === void 0 || direction2 === void 0) return null;
|
|
6825
6965
|
const directionWord2 = direction2 === "shortened" ? ui.oddsShortened : ui.oddsDrifted;
|
|
6826
6966
|
const label = ui.oddsMoved(previous, current, directionWord2);
|
|
6827
|
-
return /* @__PURE__ */ (0,
|
|
6828
|
-
/* @__PURE__ */ (0,
|
|
6829
|
-
/* @__PURE__ */ (0,
|
|
6967
|
+
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "ss-w-move", role: "img", "aria-label": label, children: [
|
|
6968
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ss-w-move-prev", "aria-hidden": "true", children: previous }),
|
|
6969
|
+
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: "ss-w-move-arrow", "aria-hidden": "true", children: direction2 === "shortened" ? "\u25BC" : "\u25B2" })
|
|
6830
6970
|
] });
|
|
6831
6971
|
}
|
|
6832
6972
|
|
|
6833
6973
|
// src/components/Crest.tsx
|
|
6834
|
-
var
|
|
6835
|
-
var
|
|
6974
|
+
var import_react38 = require("react");
|
|
6975
|
+
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
6836
6976
|
function initials(name) {
|
|
6837
6977
|
return (name ?? "").trim().slice(0, 1).toUpperCase() || "?";
|
|
6838
6978
|
}
|
|
6839
6979
|
function Crest({ url, name, kind, abbr }) {
|
|
6840
6980
|
const cls = kind === "comp" ? "ss-w-bi-comp-logo" : kind === "player" ? "ss-w-bi-crest ss-w-bi-crest--player" : "ss-w-bi-crest";
|
|
6841
|
-
const [failed, setFailed] = (0,
|
|
6981
|
+
const [failed, setFailed] = (0, import_react38.useState)(false);
|
|
6842
6982
|
if (url && !failed) {
|
|
6843
|
-
return /* @__PURE__ */ (0,
|
|
6983
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("img", { className: cls, src: url, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
6844
6984
|
}
|
|
6845
|
-
if (abbr) return /* @__PURE__ */ (0,
|
|
6846
|
-
return /* @__PURE__ */ (0,
|
|
6847
|
-
}
|
|
6848
|
-
|
|
6849
|
-
// src/components/PinToggle.tsx
|
|
6850
|
-
var import_react38 = require("react");
|
|
6851
|
-
var import_widget_sdk19 = require("@sensiblestats/widget-sdk");
|
|
6852
|
-
var import_jsx_runtime15 = require("react/jsx-runtime");
|
|
6853
|
-
var PIN_GLYPHS = {
|
|
6854
|
-
pin: { viewBox: "0 0 24 24", strokeWidth: 1.4, transform: "scale(1.5)", d: "M9.5 1.5 14.5 6.5 13 8l-.5-.5-3 3 .3 2.2-1.4 1.4L5.6 11.3l-3.3 3.3-1-1 3.3-3.3L1.9 7.5l1.4-1.4 2.2.3 3-3L8 2.9z" },
|
|
6855
|
-
star: { viewBox: "0 0 24 24", strokeWidth: 2, d: "M12 2.5l2.9 5.9 6.5.95-4.7 4.58 1.1 6.47L12 17.35 6.1 20.4l1.1-6.47L2.5 9.35l6.5-.95z" },
|
|
6856
|
-
bookmark: { viewBox: "0 0 24 24", strokeWidth: 2, d: "M7 3h10a1.5 1.5 0 0 1 1.5 1.5V21l-6.5-3.6L5.5 21V4.5A1.5 1.5 0 0 1 7 3z" }
|
|
6857
|
-
};
|
|
6858
|
-
function PinToggle({ pin, monitor, ui, market }) {
|
|
6859
|
-
const [toast, setToast] = (0, import_react38.useState)(null);
|
|
6860
|
-
const dismiss = (0, import_react38.useCallback)(() => setToast(null), []);
|
|
6861
|
-
const log = useEventLog();
|
|
6862
|
-
if (!monitor || !monitor.enabled) return null;
|
|
6863
|
-
const key = pinKey(pin);
|
|
6864
|
-
const wireSport = (0, import_widget_sdk19.toWireSport)(pin.sport);
|
|
6865
|
-
const sportField = wireSport ? { sport: wireSport } : {};
|
|
6866
|
-
const pinned = monitor.isPinned(key);
|
|
6867
|
-
const labels = pin.kind === "match" ? { pin: ui.matchPinLabel, unpin: ui.matchUnpinLabel } : { pin: ui.pinLabel, unpin: ui.unpinLabel };
|
|
6868
|
-
const onClick = (e) => {
|
|
6869
|
-
e.stopPropagation();
|
|
6870
|
-
if (pin.kind === "match" && !monitor.isPinned(key)) {
|
|
6871
|
-
const result2 = monitor.pinMatch({ matchId: pin.matchId, marketDeveloperName: market, sport: pin.sport, ...pin.tour ? { tour: pin.tour } : {} });
|
|
6872
|
-
if (result2 === "added") {
|
|
6873
|
-
log?.log({
|
|
6874
|
-
name: "pin_add",
|
|
6875
|
-
entityType: "match",
|
|
6876
|
-
entityId: (0, import_widget_sdk19.qualifiedId)(pin.sport, "game", (0, import_widget_sdk19.localIdOf)(pin.sport, pin.matchId, pin.tour)),
|
|
6877
|
-
marketDeveloperName: pin.marketDeveloperName,
|
|
6878
|
-
...sportField
|
|
6879
|
-
});
|
|
6880
|
-
} else if (result2 === "match_limit") {
|
|
6881
|
-
setToast({ kind: "error", text: ui.matchLimitToast });
|
|
6882
|
-
}
|
|
6883
|
-
return;
|
|
6884
|
-
}
|
|
6885
|
-
const result = monitor.togglePin({ ...pin, key });
|
|
6886
|
-
if ((result === "added" || result === "removed") && (pin.kind === "match" || pin.marketDeveloperName !== void 0)) {
|
|
6887
|
-
log?.log({
|
|
6888
|
-
name: result === "added" ? "pin_add" : "pin_remove",
|
|
6889
|
-
entityType: pin.kind === "match" ? "match" : "market",
|
|
6890
|
-
entityId: pin.kind === "match" ? (0, import_widget_sdk19.qualifiedId)(pin.sport, "game", (0, import_widget_sdk19.localIdOf)(pin.sport, pin.matchId, pin.tour)) : (0, import_widget_sdk19.qualifiedId)(pin.sport, "market", pin.marketDeveloperName),
|
|
6891
|
-
marketDeveloperName: pin.marketDeveloperName,
|
|
6892
|
-
...sportField
|
|
6893
|
-
});
|
|
6894
|
-
} else if (result === "market_limit") {
|
|
6895
|
-
setToast({ kind: "error", text: ui.marketLimitToast });
|
|
6896
|
-
}
|
|
6897
|
-
};
|
|
6898
|
-
const glyph = PIN_GLYPHS[ui.pinIcon];
|
|
6899
|
-
return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)("div", { className: "ss-w-pin-wrap", children: [
|
|
6900
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6901
|
-
"button",
|
|
6902
|
-
{
|
|
6903
|
-
type: "button",
|
|
6904
|
-
className: "ss-w-pin",
|
|
6905
|
-
"data-on": pinned || void 0,
|
|
6906
|
-
"data-icon": ui.pinIcon,
|
|
6907
|
-
"aria-pressed": pinned,
|
|
6908
|
-
"aria-label": pinned ? labels.unpin : labels.pin,
|
|
6909
|
-
onClick,
|
|
6910
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("svg", { viewBox: glyph.viewBox, "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
|
|
6911
|
-
"path",
|
|
6912
|
-
{
|
|
6913
|
-
transform: glyph.transform,
|
|
6914
|
-
d: glyph.d,
|
|
6915
|
-
fill: pinned ? "currentColor" : "none",
|
|
6916
|
-
stroke: pinned ? "none" : "currentColor",
|
|
6917
|
-
strokeWidth: glyph.strokeWidth,
|
|
6918
|
-
strokeLinejoin: "round",
|
|
6919
|
-
strokeLinecap: "round"
|
|
6920
|
-
}
|
|
6921
|
-
) })
|
|
6922
|
-
}
|
|
6923
|
-
),
|
|
6924
|
-
/* @__PURE__ */ (0, import_jsx_runtime15.jsx)(Toast, { toast, onDismiss: dismiss })
|
|
6925
|
-
] });
|
|
6985
|
+
if (abbr) return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: `${cls} ss-w-bi-crest-mono ss-w-bi-crest--abbr`, "aria-hidden": "true", children: abbr });
|
|
6986
|
+
return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("span", { className: `${cls} ss-w-bi-crest-mono`, "aria-hidden": "true", children: initials(name) });
|
|
6926
6987
|
}
|
|
6927
6988
|
|
|
6928
6989
|
// src/components/PriceHistoryButton.tsx
|
|
@@ -7997,9 +8058,9 @@ function GreetingDashboard({ dashboard, dashboards, defaultSport, greeting, onTa
|
|
|
7997
8058
|
const badgePlacement = layout === LAYOUT_CLASSES.goal ? "end" : "meta";
|
|
7998
8059
|
return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(GreetingEventsContext.Provider, { value: events, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: `ss-w-dash ${layout}`, children: [
|
|
7999
8060
|
sets ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(SportSwitch, { sports: sets, selected, onSelect: select, liveLabel: ui.liveLabel, groupLabel: ui.sportGroupLabel, tag: ui.locale }) : null,
|
|
8000
|
-
/* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "ss-w-dash-head", children: [
|
|
8061
|
+
shown2.marketFirst ? null : /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)("div", { className: "ss-w-dash-head", children: [
|
|
8001
8062
|
/* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "ss-w-dash-title", children: shown2.title }),
|
|
8002
|
-
shown2.subtitle
|
|
8063
|
+
shown2.subtitle ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "ss-w-dash-subtitle", children: shown2.subtitle }) : null
|
|
8003
8064
|
] }),
|
|
8004
8065
|
shown2.marketFirst ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(MarketFirstGreeting, { section: shown2.marketFirst, ui, slip, sport: active?.sport ?? (defaultSport || greeting?.sport || "football"), onAct }, active?.sport ?? "") : personal && slip ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(PersonalGreeting, { personal, ui, slip, sport: active?.sport ?? (defaultSport || greeting?.sport || "football"), starsElsewhere, onAct }, active?.sport ?? "") : /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { className: "ss-w-dash-grid", children: shown2.tiles.map((t, i) => /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
|
|
8005
8066
|
DashboardTile,
|
|
@@ -8228,14 +8289,16 @@ function usePopupTelemetry(log, isOpen, popupText, dismissPopup, confirmedShown)
|
|
|
8228
8289
|
var import_react55 = require("react");
|
|
8229
8290
|
var CLEARED = { text: null, asks: [] };
|
|
8230
8291
|
function useMobileBinding(args) {
|
|
8231
|
-
const { binding, panelOpen, popupText, asks, cta } = args;
|
|
8292
|
+
const { binding, panelOpen, popupText, asks, cta, price } = args;
|
|
8232
8293
|
const latest = (0, import_react55.useRef)(args);
|
|
8233
8294
|
latest.current = args;
|
|
8234
8295
|
const bindingRef = (0, import_react55.useRef)(binding);
|
|
8235
8296
|
bindingRef.current = binding;
|
|
8236
8297
|
const backRef = (0, import_react55.useRef)(null);
|
|
8298
|
+
const priceRef = (0, import_react55.useRef)(null);
|
|
8299
|
+
const priceInFlight = (0, import_react55.useRef)(/* @__PURE__ */ new Set()).current;
|
|
8237
8300
|
const [confirmedShown, setConfirmedShown] = (0, import_react55.useState)(null);
|
|
8238
|
-
const teaserKey = panelOpen || !popupText ? "" : JSON.stringify([popupText, asks.map((a) => a.label), cta]);
|
|
8301
|
+
const teaserKey = panelOpen || !popupText ? "" : JSON.stringify([popupText, asks.map((a) => a.label), cta, price]);
|
|
8239
8302
|
const reported = (0, import_react55.useRef)({ binding: void 0, key: "" });
|
|
8240
8303
|
(0, import_react55.useEffect)(() => {
|
|
8241
8304
|
if (!binding) return;
|
|
@@ -8243,7 +8306,7 @@ function useMobileBinding(args) {
|
|
|
8243
8306
|
if (prev.binding === binding && prev.key === teaserKey) return;
|
|
8244
8307
|
reported.current = { binding, key: teaserKey };
|
|
8245
8308
|
if (teaserKey === "" && prev.binding !== binding) return;
|
|
8246
|
-
binding.onTeaser(teaserKey === "" ? CLEARED : { text: popupText, asks: asks.map((a, index) => ({ index, label: a.label })), ...cta ? { cta } : {} });
|
|
8309
|
+
binding.onTeaser(teaserKey === "" ? CLEARED : { text: popupText, asks: asks.map((a, index) => ({ index, label: a.label })), ...cta ? { cta } : {}, ...price ? { price } : {} });
|
|
8247
8310
|
}, [binding, teaserKey]);
|
|
8248
8311
|
(0, import_react55.useEffect)(() => {
|
|
8249
8312
|
if (!binding) return;
|
|
@@ -8259,6 +8322,12 @@ function useMobileBinding(args) {
|
|
|
8259
8322
|
tapCta: () => {
|
|
8260
8323
|
if (latest.current.cta) latest.current.onCta();
|
|
8261
8324
|
},
|
|
8325
|
+
tapTeaser: () => latest.current.onTeaserTap(),
|
|
8326
|
+
tapPrice: (matchOddsId) => {
|
|
8327
|
+
const { panelOpen: open, popupText: text2, price: shown2 } = latest.current;
|
|
8328
|
+
if (open || !text2 || shown2?.matchOddsId !== matchOddsId) return;
|
|
8329
|
+
priceRef.current?.();
|
|
8330
|
+
},
|
|
8262
8331
|
dismissTeaser: () => latest.current.dismissPopup(),
|
|
8263
8332
|
teaserShown: () => setConfirmedShown(latest.current.popupText),
|
|
8264
8333
|
back: () => backRef.current?.() ?? false
|
|
@@ -8269,8 +8338,12 @@ function useMobileBinding(args) {
|
|
|
8269
8338
|
const onRegisterBack = (0, import_react55.useCallback)((fn) => {
|
|
8270
8339
|
backRef.current = fn;
|
|
8271
8340
|
}, []);
|
|
8272
|
-
|
|
8273
|
-
|
|
8341
|
+
const onRegisterPrice = (0, import_react55.useCallback)((fn) => {
|
|
8342
|
+
priceRef.current = fn;
|
|
8343
|
+
}, []);
|
|
8344
|
+
const onPriceResult = (0, import_react55.useCallback)((result) => bindingRef.current?.onPriceResult(result), []);
|
|
8345
|
+
if (!binding) return { confirmedShown: void 0, onCloseRequested: void 0, onRegisterBack: void 0, onRegisterPrice: void 0, onPriceResult: void 0, priceInFlight: void 0 };
|
|
8346
|
+
return { confirmedShown, onCloseRequested, onRegisterBack, onRegisterPrice, onPriceResult, priceInFlight };
|
|
8274
8347
|
}
|
|
8275
8348
|
|
|
8276
8349
|
// src/openTelemetry.ts
|
|
@@ -8302,13 +8375,14 @@ function BrandMark({ logoUrl, className }) {
|
|
|
8302
8375
|
|
|
8303
8376
|
// src/components/GreetingBubble.tsx
|
|
8304
8377
|
var import_jsx_runtime35 = require("react/jsx-runtime");
|
|
8305
|
-
function GreetingBubble({ text: text2, onOpen, onDismiss, dismissLabel, asks, cta, onCta, price }) {
|
|
8378
|
+
function GreetingBubble({ text: text2, game, onOpen, onDismiss, dismissLabel, asks, cta, onCta, price }) {
|
|
8306
8379
|
const body = /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("button", { type: "button", className: "ss-w-greeting-body", onClick: onOpen, children: [
|
|
8307
8380
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "ss-w-greeting-dots", "aria-hidden": "true", children: [
|
|
8308
8381
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("i", {}),
|
|
8309
8382
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("i", {}),
|
|
8310
8383
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("i", {})
|
|
8311
8384
|
] }),
|
|
8385
|
+
game ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "ss-w-greeting-game", children: game }) : null,
|
|
8312
8386
|
/* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "ss-w-greeting-text", children: text2 })
|
|
8313
8387
|
] });
|
|
8314
8388
|
const dismiss = onDismiss ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("button", { type: "button", className: "ss-w-greeting-x", "aria-label": dismissLabel, onClick: onDismiss, children: "\xD7" }) : null;
|
|
@@ -8334,7 +8408,7 @@ function GreetingBubble({ text: text2, onOpen, onDismiss, dismissLabel, asks, ct
|
|
|
8334
8408
|
|
|
8335
8409
|
// src/components/ChatFab.tsx
|
|
8336
8410
|
var import_jsx_runtime36 = require("react/jsx-runtime");
|
|
8337
|
-
function ChatFab({ label, busy = false, greeting, popupText, logoUrl, onOpen, onDismissPopup, dismissLabel, introAllowed = false, onIntroStart, asks, cta, onCta, onBubbleClick, price }) {
|
|
8411
|
+
function ChatFab({ label, busy = false, greeting, popupText, logoUrl, onOpen, onDismissPopup, dismissLabel, introAllowed = false, onIntroStart, asks, cta, onCta, onBubbleClick, price, game }) {
|
|
8338
8412
|
const bubble = popupText ?? greeting;
|
|
8339
8413
|
const hidden = busy && !label;
|
|
8340
8414
|
const track = useTrack();
|
|
@@ -8348,7 +8422,7 @@ function ChatFab({ label, busy = false, greeting, popupText, logoUrl, onOpen, on
|
|
|
8348
8422
|
}
|
|
8349
8423
|
}, [bubble, onIntroStart]);
|
|
8350
8424
|
return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: intro ? "ss-w-fab-wrap ss-w-intro" : "ss-w-fab-wrap", children: [
|
|
8351
|
-
bubble ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(GreetingBubble, { text: bubble, onOpen: () => {
|
|
8425
|
+
bubble ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(GreetingBubble, { text: bubble, game: popupText ? game : void 0, onOpen: () => {
|
|
8352
8426
|
track({ name: "bubble_click" });
|
|
8353
8427
|
if (popupText && !cta) onBubbleClick?.();
|
|
8354
8428
|
onOpen();
|
|
@@ -8366,17 +8440,47 @@ var import_jsx_runtime37 = require("react/jsx-runtime");
|
|
|
8366
8440
|
function BubblePrice({ matchId, price, conversation, slip, ui, hook, sport }) {
|
|
8367
8441
|
const selections = (0, import_react59.useMemo)(() => [price.selection], [price.selection]);
|
|
8368
8442
|
const add = useRepriceAdd({ conversation, locale: ui.hostTag, slip, ui, sport });
|
|
8369
|
-
return /* @__PURE__ */ (0, import_jsx_runtime37.
|
|
8370
|
-
|
|
8371
|
-
|
|
8372
|
-
|
|
8443
|
+
return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("div", { className: "ss-w-greeting-pick", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(PriceButtons, { selections, ui, rowLabel: price.label || price.selection.label, onAdd: add ? (s) => add(matchId, price.market, s, hook) : void 0 }) });
|
|
8444
|
+
}
|
|
8445
|
+
|
|
8446
|
+
// src/components/MobileBubblePrice.tsx
|
|
8447
|
+
var import_react60 = require("react");
|
|
8448
|
+
function MobileBubblePrice(props) {
|
|
8449
|
+
const add = useRepriceAdd({ conversation: props.conversation, locale: props.ui.hostTag, slip: props.slip, ui: props.ui, sport: props.sport });
|
|
8450
|
+
const latest = (0, import_react60.useRef)({ props, add });
|
|
8451
|
+
latest.current = { props, add };
|
|
8452
|
+
const { onRegister, inFlight: inFlight2 } = props;
|
|
8453
|
+
(0, import_react60.useEffect)(() => {
|
|
8454
|
+
onRegister(() => {
|
|
8455
|
+
const { props: p, add: run } = latest.current;
|
|
8456
|
+
const id = p.price.selection.matchOddsId;
|
|
8457
|
+
if (inFlight2.has(id)) return;
|
|
8458
|
+
const report = (r) => {
|
|
8459
|
+
const now = latest.current.props;
|
|
8460
|
+
try {
|
|
8461
|
+
now.onResult({ matchOddsId: id, outcome: r.outcome, text: r.toast?.text ?? (r.outcome === "gone" ? now.ui.v2PriceGone : null) });
|
|
8462
|
+
} catch {
|
|
8463
|
+
}
|
|
8464
|
+
};
|
|
8465
|
+
if (!run) {
|
|
8466
|
+
report({ outcome: "failed" });
|
|
8467
|
+
return;
|
|
8468
|
+
}
|
|
8469
|
+
inFlight2.add(id);
|
|
8470
|
+
run(p.matchId, p.price.market, p.price.selection, p.hook).then(report, () => report({ outcome: "failed" })).finally(() => {
|
|
8471
|
+
inFlight2.delete(id);
|
|
8472
|
+
});
|
|
8473
|
+
});
|
|
8474
|
+
return () => onRegister(null);
|
|
8475
|
+
}, [onRegister, inFlight2]);
|
|
8476
|
+
return null;
|
|
8373
8477
|
}
|
|
8374
8478
|
|
|
8375
8479
|
// src/components/ChatPanel.tsx
|
|
8376
8480
|
var import_react121 = require("react");
|
|
8377
8481
|
|
|
8378
8482
|
// src/components/ChatHeader.tsx
|
|
8379
|
-
var
|
|
8483
|
+
var import_react61 = require("react");
|
|
8380
8484
|
var import_jsx_runtime38 = require("react/jsx-runtime");
|
|
8381
8485
|
function ChatHeader({
|
|
8382
8486
|
onClose,
|
|
@@ -8392,18 +8496,18 @@ function ChatHeader({
|
|
|
8392
8496
|
onOpenFavourites,
|
|
8393
8497
|
favouritesLabel
|
|
8394
8498
|
}) {
|
|
8395
|
-
const [menuOpen, setMenuOpen] = (0,
|
|
8396
|
-
const wrapRef = (0,
|
|
8397
|
-
const kebabRef = (0,
|
|
8398
|
-
const firstItemRef = (0,
|
|
8499
|
+
const [menuOpen, setMenuOpen] = (0, import_react61.useState)(false);
|
|
8500
|
+
const wrapRef = (0, import_react61.useRef)(null);
|
|
8501
|
+
const kebabRef = (0, import_react61.useRef)(null);
|
|
8502
|
+
const firstItemRef = (0, import_react61.useRef)(null);
|
|
8399
8503
|
const hasNew = !!(canReset && onNewConversation);
|
|
8400
8504
|
const hasSettings = !!onOpenSettings;
|
|
8401
8505
|
const hasFavourites = !!onOpenFavourites;
|
|
8402
8506
|
const hasMenu = hasFavourites || hasNew || hasSettings;
|
|
8403
|
-
(0,
|
|
8507
|
+
(0, import_react61.useEffect)(() => {
|
|
8404
8508
|
if (menuOpen) firstItemRef.current?.focus();
|
|
8405
8509
|
}, [menuOpen]);
|
|
8406
|
-
(0,
|
|
8510
|
+
(0, import_react61.useEffect)(() => {
|
|
8407
8511
|
if (!menuOpen) return;
|
|
8408
8512
|
const onPointer = (e) => {
|
|
8409
8513
|
if (!(wrapRef.current && e.composedPath().includes(wrapRef.current))) setMenuOpen(false);
|
|
@@ -8491,10 +8595,10 @@ function ChatHeader({
|
|
|
8491
8595
|
}
|
|
8492
8596
|
|
|
8493
8597
|
// src/components/MessageList.tsx
|
|
8494
|
-
var
|
|
8598
|
+
var import_react76 = require("react");
|
|
8495
8599
|
|
|
8496
8600
|
// src/components/ChatMessage.tsx
|
|
8497
|
-
var
|
|
8601
|
+
var import_react75 = require("react");
|
|
8498
8602
|
|
|
8499
8603
|
// src/components/Markdown.tsx
|
|
8500
8604
|
var import_react_markdown = __toESM(require("react-markdown"), 1);
|
|
@@ -8512,7 +8616,7 @@ function Markdown({ text: text2 }) {
|
|
|
8512
8616
|
}
|
|
8513
8617
|
|
|
8514
8618
|
// src/components/EntityCardList.tsx
|
|
8515
|
-
var
|
|
8619
|
+
var import_react62 = require("react");
|
|
8516
8620
|
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
8517
8621
|
var MAX_VISIBLE = 3;
|
|
8518
8622
|
var RECORD_RE = /^(\d+)-(\d+)-(\d+)$/;
|
|
@@ -8615,7 +8719,7 @@ function ScopeTabs({ scopes, active, onSelect }) {
|
|
|
8615
8719
|
)) });
|
|
8616
8720
|
}
|
|
8617
8721
|
function EntityCardItem({ c }) {
|
|
8618
|
-
const [active, setActive] = (0,
|
|
8722
|
+
const [active, setActive] = (0, import_react62.useState)(0);
|
|
8619
8723
|
const hasBody = c.scopes.length > 0;
|
|
8620
8724
|
if (!hasBody) {
|
|
8621
8725
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "ss-w-ecard ss-w-ecard-bare", "data-kind": c.kind, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(CardHeader, { c, showScopeCrest: false }) });
|
|
@@ -8630,7 +8734,7 @@ function EntityCardItem({ c }) {
|
|
|
8630
8734
|
] });
|
|
8631
8735
|
}
|
|
8632
8736
|
function EntityCardList({ cards, disabled, showLessLabel, showMoreLabel }) {
|
|
8633
|
-
const [expanded, setExpanded] = (0,
|
|
8737
|
+
const [expanded, setExpanded] = (0, import_react62.useState)(false);
|
|
8634
8738
|
if (cards.length === 0) return null;
|
|
8635
8739
|
const visible = expanded ? cards : cards.slice(0, MAX_VISIBLE);
|
|
8636
8740
|
const overflow = cards.length - MAX_VISIBLE;
|
|
@@ -8779,20 +8883,20 @@ function BettingInsightList({ insights, ui, slip, monitor }) {
|
|
|
8779
8883
|
}
|
|
8780
8884
|
|
|
8781
8885
|
// src/components/ComboCardList.tsx
|
|
8782
|
-
var
|
|
8886
|
+
var import_react65 = require("react");
|
|
8783
8887
|
|
|
8784
8888
|
// src/components/AddAllToSlipButton.tsx
|
|
8785
|
-
var
|
|
8889
|
+
var import_react63 = require("react");
|
|
8786
8890
|
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
8787
8891
|
function AddAllToSlipButton({ legs, slip, ui, labels, combo, chatCombo, sizeless, hold, onStartedGame }) {
|
|
8788
8892
|
const add = useSlipAdd(slip, ui);
|
|
8789
8893
|
const slipState = useSlipState();
|
|
8790
8894
|
const log = useEventLog();
|
|
8791
8895
|
const track = useTrack();
|
|
8792
|
-
const [pending, setPending] = (0,
|
|
8793
|
-
const [settledLocal, setSettledLocal] = (0,
|
|
8794
|
-
const [toast, setToast] = (0,
|
|
8795
|
-
const dismiss = (0,
|
|
8896
|
+
const [pending, setPending] = (0, import_react63.useState)(false);
|
|
8897
|
+
const [settledLocal, setSettledLocal] = (0, import_react63.useState)({});
|
|
8898
|
+
const [toast, setToast] = (0, import_react63.useState)(null);
|
|
8899
|
+
const dismiss = (0, import_react63.useCallback)(() => setToast(null), []);
|
|
8796
8900
|
if (!slip.onAddToSlip || legs.length < 2) return null;
|
|
8797
8901
|
const settled = slipState ? slipState.settled : settledLocal;
|
|
8798
8902
|
const open = legs.filter((leg) => !settled[slipKey(leg)]);
|
|
@@ -8865,10 +8969,10 @@ function AddAllToSlipButton({ legs, slip, ui, labels, combo, chatCombo, sizeless
|
|
|
8865
8969
|
}
|
|
8866
8970
|
|
|
8867
8971
|
// src/presetToolsContext.ts
|
|
8868
|
-
var
|
|
8869
|
-
var PresetToolsContext = (0,
|
|
8972
|
+
var import_react64 = require("react");
|
|
8973
|
+
var PresetToolsContext = (0, import_react64.createContext)(null);
|
|
8870
8974
|
function usePresetTools() {
|
|
8871
|
-
return (0,
|
|
8975
|
+
return (0, import_react64.useContext)(PresetToolsContext);
|
|
8872
8976
|
}
|
|
8873
8977
|
|
|
8874
8978
|
// src/components/ComboCardList.tsx
|
|
@@ -8882,7 +8986,7 @@ function ComboLegRow({ leg, addToSlipEnabled, ui, slip, monitor, hold, closed, s
|
|
|
8882
8986
|
const showPin = !!monitor && leg.pinEnabled;
|
|
8883
8987
|
const factText = leg.fact ? (leg.fact.direction === "over" ? ui.presets.legFactOver : ui.presets.legFactUnder)(leg.fact.hits, leg.fact.games) : void 0;
|
|
8884
8988
|
const line = leg.statText ?? factText;
|
|
8885
|
-
const noteId = (0,
|
|
8989
|
+
const noteId = (0, import_react65.useId)();
|
|
8886
8990
|
return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("li", { className: "ss-w-combo-leg", children: [
|
|
8887
8991
|
leg.competition || kickoff || showPin ? /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("div", { className: "ss-w-combo-leg-meta", children: [
|
|
8888
8992
|
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { className: "ss-w-bi-comp", children: leg.competition ?? "" }),
|
|
@@ -9506,7 +9610,7 @@ function NbaInsightList({ insights, ui, slip, monitor }) {
|
|
|
9506
9610
|
}
|
|
9507
9611
|
|
|
9508
9612
|
// src/components/NflInsightList.tsx
|
|
9509
|
-
var
|
|
9613
|
+
var import_react66 = require("react");
|
|
9510
9614
|
|
|
9511
9615
|
// src/strings/types.ts
|
|
9512
9616
|
var fillNfl = (template, values) => template.replace(/\{(\w+)\}/g, (whole, key) => key in values ? String(values[key]) : whole);
|
|
@@ -9523,7 +9627,7 @@ function teamImage(vm, abbr) {
|
|
|
9523
9627
|
return void 0;
|
|
9524
9628
|
}
|
|
9525
9629
|
function Badge({ abbr, url }) {
|
|
9526
|
-
const [failed, setFailed] = (0,
|
|
9630
|
+
const [failed, setFailed] = (0, import_react66.useState)(false);
|
|
9527
9631
|
if (url && !failed) {
|
|
9528
9632
|
return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("img", { className: "ss-w-nfl-badge ss-w-nfl-badge--img", src: url, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
9529
9633
|
}
|
|
@@ -10134,7 +10238,7 @@ function TennisInsightList({ insights, ui }) {
|
|
|
10134
10238
|
}
|
|
10135
10239
|
|
|
10136
10240
|
// src/components/CompactOddsList.tsx
|
|
10137
|
-
var
|
|
10241
|
+
var import_react67 = require("react");
|
|
10138
10242
|
var import_widget_sdk24 = require("@sensiblestats/widget-sdk");
|
|
10139
10243
|
|
|
10140
10244
|
// src/compactList.ts
|
|
@@ -10256,11 +10360,11 @@ function Row2({ row, columns, ui, slip, monitor, rowRef }) {
|
|
|
10256
10360
|
] });
|
|
10257
10361
|
}
|
|
10258
10362
|
function CompactOddsList({ list, ui, slip, monitor }) {
|
|
10259
|
-
const [shown2, setShown] = (0,
|
|
10363
|
+
const [shown2, setShown] = (0, import_react67.useState)(COMPACT_PAGE);
|
|
10260
10364
|
const hidden = list.rowCount - shown2;
|
|
10261
|
-
const [focusIndex, setFocusIndex] = (0,
|
|
10262
|
-
const focusRef = (0,
|
|
10263
|
-
(0,
|
|
10365
|
+
const [focusIndex, setFocusIndex] = (0, import_react67.useState)(null);
|
|
10366
|
+
const focusRef = (0, import_react67.useRef)(null);
|
|
10367
|
+
(0, import_react67.useEffect)(() => {
|
|
10264
10368
|
if (focusIndex !== null) focusRef.current?.focus();
|
|
10265
10369
|
}, [focusIndex]);
|
|
10266
10370
|
let left = shown2;
|
|
@@ -10495,7 +10599,7 @@ function FixtureCard({ card, ui }) {
|
|
|
10495
10599
|
}
|
|
10496
10600
|
|
|
10497
10601
|
// src/components/dashboard/CountdownCard.tsx
|
|
10498
|
-
var
|
|
10602
|
+
var import_react68 = require("react");
|
|
10499
10603
|
var import_jsx_runtime52 = require("react/jsx-runtime");
|
|
10500
10604
|
var DAY_MS3 = 864e5;
|
|
10501
10605
|
function remainingSegments(kickoffUnix, nowMs, withSeconds) {
|
|
@@ -10514,12 +10618,12 @@ function remainingSegments(kickoffUnix, nowMs, withSeconds) {
|
|
|
10514
10618
|
function CountdownCard({ card, ui }) {
|
|
10515
10619
|
const { data } = card;
|
|
10516
10620
|
const unitLabel = { d: data.daysUnit, h: data.hoursUnit, m: data.minutesUnit, s: data.secondsUnit };
|
|
10517
|
-
const [nowMs, setNowMs] = (0,
|
|
10518
|
-
const [reduced] = (0,
|
|
10621
|
+
const [nowMs, setNowMs] = (0, import_react68.useState)(() => Date.now());
|
|
10622
|
+
const [reduced] = (0, import_react68.useState)(
|
|
10519
10623
|
() => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches
|
|
10520
10624
|
);
|
|
10521
10625
|
const withinDay = data.kickoffUnix * 1e3 - nowMs < DAY_MS3;
|
|
10522
|
-
(0,
|
|
10626
|
+
(0, import_react68.useEffect)(() => {
|
|
10523
10627
|
if (reduced) return;
|
|
10524
10628
|
const id = window.setInterval(() => setNowMs(Date.now()), withinDay ? 1e3 : 6e4);
|
|
10525
10629
|
return () => window.clearInterval(id);
|
|
@@ -10527,7 +10631,7 @@ function CountdownCard({ card, ui }) {
|
|
|
10527
10631
|
const segments = remainingSegments(data.kickoffUnix, nowMs, withinDay && !reduced);
|
|
10528
10632
|
return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "ss-w-fandash-card ss-w-fandash-countdown", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "ss-w-fandash-countdown-top", children: [
|
|
10529
10633
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "ss-w-fandash-eyebrow", children: card.title ?? ui.countdownTitle }),
|
|
10530
|
-
segments ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "ss-w-fandash-countdown-clock", children: segments.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(
|
|
10634
|
+
segments ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "ss-w-fandash-countdown-clock", children: segments.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_react68.Fragment, { children: [
|
|
10531
10635
|
i > 0 ? /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "ss-w-fandash-countdown-colon", children: ":" }) : null,
|
|
10532
10636
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("span", { className: "ss-w-fandash-countdown-seg", children: [
|
|
10533
10637
|
/* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "ss-w-fandash-countdown-value", children: s.value }),
|
|
@@ -10538,7 +10642,7 @@ function CountdownCard({ card, ui }) {
|
|
|
10538
10642
|
}
|
|
10539
10643
|
|
|
10540
10644
|
// src/components/dashboard/InjuriesCard.tsx
|
|
10541
|
-
var
|
|
10645
|
+
var import_react69 = require("react");
|
|
10542
10646
|
var import_jsx_runtime53 = require("react/jsx-runtime");
|
|
10543
10647
|
var SHOWN = 3;
|
|
10544
10648
|
function ColHead({ name, crestUrl }) {
|
|
@@ -10561,7 +10665,7 @@ function InjuryList({ rows, emptyLabel, limit }) {
|
|
|
10561
10665
|
}
|
|
10562
10666
|
function InjuriesCard({ card, ui }) {
|
|
10563
10667
|
const { data } = card;
|
|
10564
|
-
const [expanded, setExpanded] = (0,
|
|
10668
|
+
const [expanded, setExpanded] = (0, import_react69.useState)(false);
|
|
10565
10669
|
const hidden = Math.max(0, data.ours.length - SHOWN) + Math.max(0, data.theirs.length - SHOWN);
|
|
10566
10670
|
const limit = expanded ? void 0 : SHOWN;
|
|
10567
10671
|
const { showMore, showLess } = ui;
|
|
@@ -10666,7 +10770,7 @@ function LinksCard({ card }) {
|
|
|
10666
10770
|
}
|
|
10667
10771
|
|
|
10668
10772
|
// src/components/dashboard/PostMatchResultCard.tsx
|
|
10669
|
-
var
|
|
10773
|
+
var import_react70 = require("react");
|
|
10670
10774
|
var import_jsx_runtime59 = require("react/jsx-runtime");
|
|
10671
10775
|
function initials3(name) {
|
|
10672
10776
|
return name.trim().slice(0, 3).toUpperCase();
|
|
@@ -10676,7 +10780,7 @@ function PostMatchCrest({
|
|
|
10676
10780
|
name,
|
|
10677
10781
|
side
|
|
10678
10782
|
}) {
|
|
10679
|
-
const [failed, setFailed] = (0,
|
|
10783
|
+
const [failed, setFailed] = (0, import_react70.useState)(false);
|
|
10680
10784
|
const cls = `ss-w-fandash-postmatch-crest ss-w-fandash-postmatch-crest--${side}`;
|
|
10681
10785
|
if (url && !failed) {
|
|
10682
10786
|
return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("img", { className: cls, src: url, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
@@ -10875,10 +10979,10 @@ function RestingFormCard({ card }) {
|
|
|
10875
10979
|
}
|
|
10876
10980
|
|
|
10877
10981
|
// src/components/dashboard/LiveScoreCard.tsx
|
|
10878
|
-
var
|
|
10982
|
+
var import_react72 = require("react");
|
|
10879
10983
|
|
|
10880
10984
|
// src/useLiveClock.ts
|
|
10881
|
-
var
|
|
10985
|
+
var import_react71 = require("react");
|
|
10882
10986
|
var TICK_MS = 6e4;
|
|
10883
10987
|
var MAX_LIVE_TICK_MINUTES = 15;
|
|
10884
10988
|
function computeDisplayMinute(minute, clockRunning, receivedAtMs) {
|
|
@@ -10887,10 +10991,10 @@ function computeDisplayMinute(minute, clockRunning, receivedAtMs) {
|
|
|
10887
10991
|
return minute + Math.min(Math.max(0, elapsedMinutes), MAX_LIVE_TICK_MINUTES);
|
|
10888
10992
|
}
|
|
10889
10993
|
function useLiveClock(minute, clockRunning, receivedAtMs) {
|
|
10890
|
-
const [displayMinute, setDisplayMinute] = (0,
|
|
10994
|
+
const [displayMinute, setDisplayMinute] = (0, import_react71.useState)(
|
|
10891
10995
|
() => computeDisplayMinute(minute, clockRunning, receivedAtMs)
|
|
10892
10996
|
);
|
|
10893
|
-
(0,
|
|
10997
|
+
(0, import_react71.useEffect)(() => {
|
|
10894
10998
|
setDisplayMinute(computeDisplayMinute(minute, clockRunning, receivedAtMs));
|
|
10895
10999
|
if (!clockRunning) return;
|
|
10896
11000
|
const id = window.setInterval(() => {
|
|
@@ -10907,7 +11011,7 @@ function initials5(name) {
|
|
|
10907
11011
|
return name.trim().slice(0, 3).toUpperCase();
|
|
10908
11012
|
}
|
|
10909
11013
|
function LiveCrest({ url, name, side }) {
|
|
10910
|
-
const [failed, setFailed] = (0,
|
|
11014
|
+
const [failed, setFailed] = (0, import_react72.useState)(false);
|
|
10911
11015
|
const cls = `ss-w-fandash-live-crest ss-w-fandash-live-crest--${side}`;
|
|
10912
11016
|
if (url && !failed) {
|
|
10913
11017
|
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("img", { className: cls, src: url, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
@@ -10929,7 +11033,7 @@ function LiveScoreCard({
|
|
|
10929
11033
|
}) {
|
|
10930
11034
|
const { data } = card;
|
|
10931
11035
|
const seedKey = `${data.minute}:${data.homeScore}:${data.awayScore}`;
|
|
10932
|
-
const seedRef = (0,
|
|
11036
|
+
const seedRef = (0, import_react72.useRef)(null);
|
|
10933
11037
|
if (!seedRef.current || seedRef.current.key !== seedKey) {
|
|
10934
11038
|
seedRef.current = { key: seedKey, receivedAtMs: Date.now() };
|
|
10935
11039
|
}
|
|
@@ -10975,7 +11079,7 @@ function LiveScoreCard({
|
|
|
10975
11079
|
}
|
|
10976
11080
|
|
|
10977
11081
|
// src/components/dashboard/LiveTimelineCard.tsx
|
|
10978
|
-
var
|
|
11082
|
+
var import_react73 = require("react");
|
|
10979
11083
|
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
10980
11084
|
var SHOWN2 = 3;
|
|
10981
11085
|
function EventIcon({ type }) {
|
|
@@ -11017,7 +11121,7 @@ function EventRow({ e }) {
|
|
|
11017
11121
|
] });
|
|
11018
11122
|
}
|
|
11019
11123
|
function LiveTimelineCard({ card, ui }) {
|
|
11020
|
-
const [expanded, setExpanded] = (0,
|
|
11124
|
+
const [expanded, setExpanded] = (0, import_react73.useState)(false);
|
|
11021
11125
|
const events = card.data.events;
|
|
11022
11126
|
if (!events || events.length === 0) return null;
|
|
11023
11127
|
const sorted2 = [...events].sort((a, b) => b.minute - a.minute);
|
|
@@ -11041,7 +11145,7 @@ function LiveTimelineCard({ card, ui }) {
|
|
|
11041
11145
|
}
|
|
11042
11146
|
|
|
11043
11147
|
// src/components/dashboard/MomentumWave.tsx
|
|
11044
|
-
var
|
|
11148
|
+
var import_react74 = require("react");
|
|
11045
11149
|
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
11046
11150
|
var WIDTH = 270;
|
|
11047
11151
|
var HEIGHT = 56;
|
|
@@ -11066,7 +11170,7 @@ function MomentumWave({
|
|
|
11066
11170
|
}) {
|
|
11067
11171
|
if (points.length === 0) return null;
|
|
11068
11172
|
const { area, line, lastLeftPct, lastTopPx } = buildPaths(points);
|
|
11069
|
-
const clipId = (0,
|
|
11173
|
+
const clipId = (0, import_react74.useId)();
|
|
11070
11174
|
const topClipId = `${clipId}-top`;
|
|
11071
11175
|
const bottomClipId = `${clipId}-bottom`;
|
|
11072
11176
|
const topClass = clubIsHome ? "ss-w-fandash-live-mom-home" : "ss-w-fandash-live-mom-away";
|
|
@@ -11216,7 +11320,7 @@ function FanDashboardCard({ card, onTap, ui, goalEvents }) {
|
|
|
11216
11320
|
// src/components/ChatMessage.tsx
|
|
11217
11321
|
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
11218
11322
|
function ChatMessage({ message, disabled, onAct, onTap, ui, slip, monitor, onGreetingSport }) {
|
|
11219
|
-
const [sport, setSport] = (0,
|
|
11323
|
+
const [sport, setSport] = (0, import_react75.useState)(null);
|
|
11220
11324
|
if (message.role === "user") {
|
|
11221
11325
|
return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "ss-w-msg ss-w-user", "data-msg-id": message.id, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "ss-w-bubble", children: message.text }) });
|
|
11222
11326
|
}
|
|
@@ -11271,11 +11375,11 @@ function turnAnchor(messages) {
|
|
|
11271
11375
|
function MessageList({ controller, ui, slip, onDashboardTap, monitor, onGreetingSport }) {
|
|
11272
11376
|
const { state, send } = controller;
|
|
11273
11377
|
const { oddsFormat } = useOddsSettings();
|
|
11274
|
-
const listRef = (0,
|
|
11275
|
-
const endRef = (0,
|
|
11276
|
-
const pinnedRef = (0,
|
|
11277
|
-
const anchoredTurnRef = (0,
|
|
11278
|
-
(0,
|
|
11378
|
+
const listRef = (0, import_react76.useRef)(null);
|
|
11379
|
+
const endRef = (0, import_react76.useRef)(null);
|
|
11380
|
+
const pinnedRef = (0, import_react76.useRef)(true);
|
|
11381
|
+
const anchoredTurnRef = (0, import_react76.useRef)(null);
|
|
11382
|
+
(0, import_react76.useEffect)(() => {
|
|
11279
11383
|
const anchor = turnAnchor(state.messages);
|
|
11280
11384
|
const list = listRef.current;
|
|
11281
11385
|
if (anchor && anchor.turnId !== anchoredTurnRef.current) {
|
|
@@ -11334,13 +11438,13 @@ function MessageList({ controller, ui, slip, onDashboardTap, monitor, onGreeting
|
|
|
11334
11438
|
}
|
|
11335
11439
|
|
|
11336
11440
|
// src/components/ChatInput.tsx
|
|
11337
|
-
var
|
|
11441
|
+
var import_react77 = require("react");
|
|
11338
11442
|
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
11339
|
-
var ChatInput = (0,
|
|
11340
|
-
const [value, setValue] = (0,
|
|
11341
|
-
const textareaRef = (0,
|
|
11342
|
-
const stopRef = (0,
|
|
11343
|
-
const textBoxWantsFocusRef = (0,
|
|
11443
|
+
var ChatInput = (0, import_react77.forwardRef)(function ChatInput2({ placeholder, streaming, onSend, onStop, stopLabel, sendLabel, disabled = false }, ref) {
|
|
11444
|
+
const [value, setValue] = (0, import_react77.useState)("");
|
|
11445
|
+
const textareaRef = (0, import_react77.useRef)(null);
|
|
11446
|
+
const stopRef = (0, import_react77.useRef)(null);
|
|
11447
|
+
const textBoxWantsFocusRef = (0, import_react77.useRef)(false);
|
|
11344
11448
|
const submit = () => {
|
|
11345
11449
|
if (disabled) return;
|
|
11346
11450
|
const t = value.trim();
|
|
@@ -11354,7 +11458,7 @@ var ChatInput = (0, import_react76.forwardRef)(function ChatInput2({ placeholder
|
|
|
11354
11458
|
submit();
|
|
11355
11459
|
}
|
|
11356
11460
|
};
|
|
11357
|
-
(0,
|
|
11461
|
+
(0, import_react77.useImperativeHandle)(ref, () => ({
|
|
11358
11462
|
focus() {
|
|
11359
11463
|
const box = textareaRef.current;
|
|
11360
11464
|
if (box && !box.disabled) {
|
|
@@ -11366,7 +11470,7 @@ var ChatInput = (0, import_react76.forwardRef)(function ChatInput2({ placeholder
|
|
|
11366
11470
|
stopRef.current?.focus();
|
|
11367
11471
|
}
|
|
11368
11472
|
}), []);
|
|
11369
|
-
(0,
|
|
11473
|
+
(0, import_react77.useEffect)(() => {
|
|
11370
11474
|
if (streaming || disabled || !textBoxWantsFocusRef.current) return;
|
|
11371
11475
|
textBoxWantsFocusRef.current = false;
|
|
11372
11476
|
const box = textareaRef.current;
|
|
@@ -11397,7 +11501,7 @@ var ChatInput = (0, import_react76.forwardRef)(function ChatInput2({ placeholder
|
|
|
11397
11501
|
});
|
|
11398
11502
|
|
|
11399
11503
|
// src/components/TabBar.tsx
|
|
11400
|
-
var
|
|
11504
|
+
var import_react78 = require("react");
|
|
11401
11505
|
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
11402
11506
|
var TIGHT_LEVELS = [0, 1, 2, 3, 4, 5, 6, 7];
|
|
11403
11507
|
var FOCUS_EDGE = 24;
|
|
@@ -11420,16 +11524,16 @@ function TabBar({ monitor, ui, matchCount, trendsCount, liveCount, hasSchedule,
|
|
|
11420
11524
|
...gamesEnabled ? [{ tab: "games", label: ui.tabGames, count: 0, dot: false }] : []
|
|
11421
11525
|
];
|
|
11422
11526
|
const track = useTrack();
|
|
11423
|
-
const listRef = (0,
|
|
11527
|
+
const listRef = (0, import_react78.useRef)(null);
|
|
11424
11528
|
const activeTab = monitor.activeTab;
|
|
11425
|
-
(0,
|
|
11529
|
+
(0, import_react78.useEffect)(() => {
|
|
11426
11530
|
const el = listRef.current?.querySelector("[data-on]");
|
|
11427
11531
|
if (!el || typeof el.scrollIntoView !== "function") return;
|
|
11428
11532
|
const reduce = typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
11429
11533
|
el.scrollIntoView({ block: "nearest", inline: "nearest", behavior: reduce ? "auto" : "smooth" });
|
|
11430
11534
|
}, [activeTab]);
|
|
11431
11535
|
const labelSignature = tabs.map((t) => `${t.tab}:${t.label}:${t.count}`).join("|");
|
|
11432
|
-
(0,
|
|
11536
|
+
(0, import_react78.useLayoutEffect)(() => {
|
|
11433
11537
|
const strip = listRef.current;
|
|
11434
11538
|
if (!strip) return;
|
|
11435
11539
|
const measure = () => {
|
|
@@ -11453,7 +11557,7 @@ function TabBar({ monitor, ui, matchCount, trendsCount, liveCount, hasSchedule,
|
|
|
11453
11557
|
fonts?.removeEventListener?.("loadingdone", measure);
|
|
11454
11558
|
};
|
|
11455
11559
|
}, [labelSignature]);
|
|
11456
|
-
const pointerDown = (0,
|
|
11560
|
+
const pointerDown = (0, import_react78.useRef)(false);
|
|
11457
11561
|
const keepFocusedTabInView = (e) => {
|
|
11458
11562
|
const strip = e.currentTarget;
|
|
11459
11563
|
const tab = e.target;
|
|
@@ -11513,7 +11617,7 @@ function TabBar({ monitor, ui, matchCount, trendsCount, liveCount, hasSchedule,
|
|
|
11513
11617
|
}
|
|
11514
11618
|
|
|
11515
11619
|
// src/components/MonitorTabs.tsx
|
|
11516
|
-
var
|
|
11620
|
+
var import_react91 = require("react");
|
|
11517
11621
|
|
|
11518
11622
|
// src/components/MarketAccordion.tsx
|
|
11519
11623
|
var import_widget_sdk25 = require("@sensiblestats/widget-sdk");
|
|
@@ -11575,7 +11679,7 @@ function MarketAccordion({ match, monitor, ui, slip }) {
|
|
|
11575
11679
|
}
|
|
11576
11680
|
|
|
11577
11681
|
// src/components/MonitorFormH2H.tsx
|
|
11578
|
-
var
|
|
11682
|
+
var import_react79 = require("react");
|
|
11579
11683
|
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
11580
11684
|
function resultClass2(result) {
|
|
11581
11685
|
if (result === "W") return "ss-w-h2h-result--win";
|
|
@@ -11591,7 +11695,7 @@ function FormDots({ form, ui }) {
|
|
|
11591
11695
|
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("div", { className: "ss-w-h2h-dots", children: form.map((m, i) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: `ss-w-h2h-result ${resultClass2(m.result)}`, children: resultLabel(m.result, ui) }, i)) });
|
|
11592
11696
|
}
|
|
11593
11697
|
function MonitorFormH2H({ formAndH2H, homeTeamName, awayTeamName, ui }) {
|
|
11594
|
-
const [expanded, setExpanded] = (0,
|
|
11698
|
+
const [expanded, setExpanded] = (0, import_react79.useState)(false);
|
|
11595
11699
|
const { homeForm, awayForm, h2h, homeShortCode, awayShortCode } = formAndH2H;
|
|
11596
11700
|
if (homeForm.length === 0 && awayForm.length === 0 && !h2h) {
|
|
11597
11701
|
return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_jsx_runtime79.Fragment, {});
|
|
@@ -11669,10 +11773,10 @@ function MonitorFormH2H({ formAndH2H, homeTeamName, awayTeamName, ui }) {
|
|
|
11669
11773
|
}
|
|
11670
11774
|
|
|
11671
11775
|
// src/components/CompLogo.tsx
|
|
11672
|
-
var
|
|
11776
|
+
var import_react80 = require("react");
|
|
11673
11777
|
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
11674
11778
|
function CompLogo({ url }) {
|
|
11675
|
-
const [failed, setFailed] = (0,
|
|
11779
|
+
const [failed, setFailed] = (0, import_react80.useState)(null);
|
|
11676
11780
|
if (!url || failed === url) return null;
|
|
11677
11781
|
return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("img", { className: "ss-w-mon-comp-logo", src: url, alt: "", "aria-hidden": "true", onError: () => setFailed(url) });
|
|
11678
11782
|
}
|
|
@@ -11830,7 +11934,7 @@ function MonitorSkeleton({ pin, monitor, ui }) {
|
|
|
11830
11934
|
}
|
|
11831
11935
|
|
|
11832
11936
|
// src/components/NbaMonitorCard.tsx
|
|
11833
|
-
var
|
|
11937
|
+
var import_react84 = require("react");
|
|
11834
11938
|
|
|
11835
11939
|
// src/sportLabel.ts
|
|
11836
11940
|
var CODE = { football: "football", basketball: "nba", nba: "nba", americanfootball: "nfl", nfl: "nfl", tennis: "tennis" };
|
|
@@ -11840,7 +11944,7 @@ var sportLabel = (ui, sport) => {
|
|
|
11840
11944
|
};
|
|
11841
11945
|
|
|
11842
11946
|
// src/components/NbaFormSection.tsx
|
|
11843
|
-
var
|
|
11947
|
+
var import_react81 = require("react");
|
|
11844
11948
|
|
|
11845
11949
|
// src/components/NbaFormRest.tsx
|
|
11846
11950
|
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
@@ -11940,8 +12044,8 @@ function Row3({ game, abbr, tonight, ui }) {
|
|
|
11940
12044
|
] });
|
|
11941
12045
|
}
|
|
11942
12046
|
function NbaFormSection({ match, monitor, ui }) {
|
|
11943
|
-
const [open, setOpen] = (0,
|
|
11944
|
-
const [side, setSide] = (0,
|
|
12047
|
+
const [open, setOpen] = (0, import_react81.useState)(false);
|
|
12048
|
+
const [side, setSide] = (0, import_react81.useState)("away");
|
|
11945
12049
|
const form = useNbaForm(match, monitor);
|
|
11946
12050
|
const b = match.basketball;
|
|
11947
12051
|
if (!form || !b || !form.home && !form.away) return null;
|
|
@@ -11986,10 +12090,10 @@ function NbaFormSection({ match, monitor, ui }) {
|
|
|
11986
12090
|
}
|
|
11987
12091
|
|
|
11988
12092
|
// src/components/NbaPropsSection.tsx
|
|
11989
|
-
var
|
|
12093
|
+
var import_react83 = require("react");
|
|
11990
12094
|
|
|
11991
12095
|
// src/components/PropsPieces.tsx
|
|
11992
|
-
var
|
|
12096
|
+
var import_react82 = require("react");
|
|
11993
12097
|
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
11994
12098
|
var livePlayer = (bundle, p) => bundle.live === true || !p.live && !p.nflLive ? p : { ...p, live: null, nflLive: null };
|
|
11995
12099
|
var hasLiveLine = (p) => p.live != null || p.nflLive != null;
|
|
@@ -12002,9 +12106,9 @@ function preKickoff(match) {
|
|
|
12002
12106
|
return Number.isFinite(kickoff) && Date.now() < kickoff;
|
|
12003
12107
|
}
|
|
12004
12108
|
function usePreKickoff(match) {
|
|
12005
|
-
const [, setTick] = (0,
|
|
12109
|
+
const [, setTick] = (0, import_react82.useState)(0);
|
|
12006
12110
|
const pre = preKickoff(match);
|
|
12007
|
-
(0,
|
|
12111
|
+
(0, import_react82.useEffect)(() => {
|
|
12008
12112
|
if (!pre || !match.kickoffUtc) return;
|
|
12009
12113
|
const wait = Math.min(Math.max(Date.parse(match.kickoffUtc) - Date.now(), 0), MAX_TIMER_MS);
|
|
12010
12114
|
const id = setTimeout(() => setTick((t) => t + 1), wait);
|
|
@@ -12018,7 +12122,7 @@ function usePropsOpen(match, monitor, descriptor) {
|
|
|
12018
12122
|
const pre = descriptor.sport === "basketball" ? match.phase === "preMatch" : beforeKickoff;
|
|
12019
12123
|
const live = match.phase === "live";
|
|
12020
12124
|
const open = pre || live;
|
|
12021
|
-
(0,
|
|
12125
|
+
(0, import_react82.useEffect)(() => {
|
|
12022
12126
|
if (!open) return;
|
|
12023
12127
|
if (sport) monitor.loadPlayerProps?.(match.matchId, sport);
|
|
12024
12128
|
else monitor.loadPlayerProps?.(match.matchId);
|
|
@@ -12096,7 +12200,7 @@ function PropBars({ bars, line, title, wide, ui, note }) {
|
|
|
12096
12200
|
function PropPlayerPanel({ player: given, bundle, descriptor, ui, slip }) {
|
|
12097
12201
|
const player = livePlayer(bundle, given);
|
|
12098
12202
|
const stats = descriptor.stats.map((k) => player.stats.find((s) => s.stat === k)).filter((s) => s != null);
|
|
12099
|
-
const [picked, setPicked] = (0,
|
|
12203
|
+
const [picked, setPicked] = (0, import_react82.useState)(null);
|
|
12100
12204
|
const active = stats.find((s) => s.stat === picked) ?? stats[0];
|
|
12101
12205
|
const sample = active?.games?.length ?? 0;
|
|
12102
12206
|
const hitsOf = (price, text2) => descriptor.showHits && sample > 0 && price.hits != null ? text2(price.hits) : null;
|
|
@@ -12145,8 +12249,8 @@ function PropPlayerPanel({ player: given, bundle, descriptor, ui, slip }) {
|
|
|
12145
12249
|
] });
|
|
12146
12250
|
}
|
|
12147
12251
|
function PropRoster({ bundle, players, side, descriptor, ui, slip }) {
|
|
12148
|
-
const [openId, setOpenId] = (0,
|
|
12149
|
-
const [brokenShots, setBrokenShots] = (0,
|
|
12252
|
+
const [openId, setOpenId] = (0, import_react82.useState)(null);
|
|
12253
|
+
const [brokenShots, setBrokenShots] = (0, import_react82.useState)(/* @__PURE__ */ new Set());
|
|
12150
12254
|
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "ss-w-props-list", children: players.map((given) => {
|
|
12151
12255
|
const p = livePlayer(bundle, given);
|
|
12152
12256
|
const isOpen = openId === p.playerId;
|
|
@@ -12192,12 +12296,12 @@ function PropRoster({ bundle, players, side, descriptor, ui, slip }) {
|
|
|
12192
12296
|
}
|
|
12193
12297
|
var BOX_QUIET_MS = 12e4;
|
|
12194
12298
|
function StatsClock({ boxAsOfUtc, match, live, atBreak: atBreak2, ago, ui }) {
|
|
12195
|
-
const [tick, setTick] = (0,
|
|
12299
|
+
const [tick, setTick] = (0, import_react82.useState)(0);
|
|
12196
12300
|
const time = clock2(boxAsOfUtc, ui);
|
|
12197
12301
|
const at2 = time === "" ? Number.NaN : Date.parse(boxAsOfUtc);
|
|
12198
12302
|
const valid = !Number.isNaN(at2);
|
|
12199
12303
|
const onBreak = atBreak(match);
|
|
12200
|
-
(0,
|
|
12304
|
+
(0, import_react82.useEffect)(() => {
|
|
12201
12305
|
if (!valid || onBreak) return;
|
|
12202
12306
|
const age2 = Date.now() - at2;
|
|
12203
12307
|
const wait = age2 < BOX_QUIET_MS ? BOX_QUIET_MS - age2 : 6e4 - age2 % 6e4;
|
|
@@ -12258,12 +12362,12 @@ var nbaDescriptor = (ui, match) => ({
|
|
|
12258
12362
|
tenGameBars: false
|
|
12259
12363
|
});
|
|
12260
12364
|
function StatsClock2({ bundle, match, ui }) {
|
|
12261
|
-
const [tick, setTick] = (0,
|
|
12365
|
+
const [tick, setTick] = (0, import_react83.useState)(0);
|
|
12262
12366
|
const at2 = bundle.live === true && bundle.boxAsOfUtc ? Date.parse(bundle.boxAsOfUtc) : Number.NaN;
|
|
12263
12367
|
const time = clock2(bundle.boxAsOfUtc, ui);
|
|
12264
12368
|
const valid = !Number.isNaN(at2) && time !== "";
|
|
12265
12369
|
const onBreak = atBreak(match);
|
|
12266
|
-
(0,
|
|
12370
|
+
(0, import_react83.useEffect)(() => {
|
|
12267
12371
|
if (!valid || onBreak) return;
|
|
12268
12372
|
const age2 = Date.now() - at2;
|
|
12269
12373
|
const wait = age2 < BOX_QUIET_MS2 ? BOX_QUIET_MS2 - age2 : 6e4 - age2 % 6e4;
|
|
@@ -12277,7 +12381,7 @@ function StatsClock2({ bundle, match, ui }) {
|
|
|
12277
12381
|
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", { className: "ss-w-props-asof ss-w-props-asof--live", children: ui.nba.propsStatsLive(time) });
|
|
12278
12382
|
}
|
|
12279
12383
|
function NbaPropsSection({ match, monitor, ui, slip }) {
|
|
12280
|
-
const [side, setSide] = (0,
|
|
12384
|
+
const [side, setSide] = (0, import_react83.useState)("home");
|
|
12281
12385
|
const descriptor = nbaDescriptor(ui, match);
|
|
12282
12386
|
const { bundle, live, open } = usePropsOpen(match, monitor, descriptor);
|
|
12283
12387
|
if (!open || !bundle || bundle.players.length === 0 || (bundle.live ?? false) !== live) return null;
|
|
@@ -12315,7 +12419,7 @@ function city(teamName, nickname) {
|
|
|
12315
12419
|
return name.slice(0, name.length - nickname.length).trim() || null;
|
|
12316
12420
|
}
|
|
12317
12421
|
function BadgeCrest({ url, abbreviation }) {
|
|
12318
|
-
const [failed, setFailed] = (0,
|
|
12422
|
+
const [failed, setFailed] = (0, import_react84.useState)(false);
|
|
12319
12423
|
if (url && !failed) {
|
|
12320
12424
|
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("img", { className: "ss-w-nbamon-badge ss-w-nbamon-badge--img", src: url, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
12321
12425
|
}
|
|
@@ -12450,7 +12554,7 @@ function NbaMonitorCard({ match, monitor, ui, slip, onAsk }) {
|
|
|
12450
12554
|
}
|
|
12451
12555
|
|
|
12452
12556
|
// src/components/NflFormSection.tsx
|
|
12453
|
-
var
|
|
12557
|
+
var import_react85 = require("react");
|
|
12454
12558
|
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
12455
12559
|
var outcomeOf = (g) => g.teamScore > g.opponentScore ? "win" : g.teamScore < g.opponentScore ? "loss" : "tie";
|
|
12456
12560
|
var signedSpread2 = (v) => v > 0 ? `+${v}` : String(v);
|
|
@@ -12503,7 +12607,7 @@ function H2hRow({ game, home, ui }) {
|
|
|
12503
12607
|
] });
|
|
12504
12608
|
}
|
|
12505
12609
|
function NflFormSection({ match, monitor, ui }) {
|
|
12506
|
-
const [segment, setSegment] = (0,
|
|
12610
|
+
const [segment, setSegment] = (0, import_react85.useState)("away");
|
|
12507
12611
|
const { live, open } = usePropsOpen(match, monitor, { sport: "americanfootball" });
|
|
12508
12612
|
const bundle = monitor.playerProps?.[monitorMatchKey("americanfootball", match.matchId)]?.bundle;
|
|
12509
12613
|
const form = bundle?.form;
|
|
@@ -12536,7 +12640,7 @@ function NflFormSection({ match, monitor, ui }) {
|
|
|
12536
12640
|
}
|
|
12537
12641
|
|
|
12538
12642
|
// src/components/NflPropsSection.tsx
|
|
12539
|
-
var
|
|
12643
|
+
var import_react86 = require("react");
|
|
12540
12644
|
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
12541
12645
|
var TRENDS_SHOWN = 3;
|
|
12542
12646
|
var SCORERS_SHOWN = 8;
|
|
@@ -12609,7 +12713,7 @@ function ShowMore({ label, onClick }) {
|
|
|
12609
12713
|
return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("button", { type: "button", className: "ss-w-props-more", onClick, children: label });
|
|
12610
12714
|
}
|
|
12611
12715
|
function Trends({ bundle, facts, descriptor, ui, slip }) {
|
|
12612
|
-
const [all, setAll] = (0,
|
|
12716
|
+
const [all, setAll] = (0, import_react86.useState)(false);
|
|
12613
12717
|
const shown2 = all ? facts : facts.slice(0, TRENDS_SHOWN);
|
|
12614
12718
|
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("section", { className: "ss-w-props ss-w-props-trends", lang: ui.locale, children: [
|
|
12615
12719
|
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "ss-w-props-head", children: ui.nfl.propsTrends }),
|
|
@@ -12642,7 +12746,7 @@ function Trends({ bundle, facts, descriptor, ui, slip }) {
|
|
|
12642
12746
|
] });
|
|
12643
12747
|
}
|
|
12644
12748
|
function Scorers({ bundle, scorers, abbreviations, descriptor, ui, slip }) {
|
|
12645
|
-
const [all, setAll] = (0,
|
|
12749
|
+
const [all, setAll] = (0, import_react86.useState)(false);
|
|
12646
12750
|
const shown2 = all ? scorers : scorers.slice(0, SCORERS_SHOWN);
|
|
12647
12751
|
const cell2 = (name, column, price, stat) => price && stat ? /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(PropPrice, { price, label: "", ariaName: `${name}, ${column}`, player: name, stat, bundle, descriptor, ui, slip }) : /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "ss-w-props-scorer-none", children: "\u2014" });
|
|
12648
12752
|
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "ss-w-props-scorers", children: [
|
|
@@ -12672,7 +12776,7 @@ function Scorers({ bundle, scorers, abbreviations, descriptor, ui, slip }) {
|
|
|
12672
12776
|
] });
|
|
12673
12777
|
}
|
|
12674
12778
|
function NflPropsSection({ match, monitor, ui, slip }) {
|
|
12675
|
-
const [tab, setTab] = (0,
|
|
12779
|
+
const [tab, setTab] = (0, import_react86.useState)(null);
|
|
12676
12780
|
const descriptor = nflDescriptor(ui);
|
|
12677
12781
|
const { bundle, live, open } = usePropsOpen(match, monitor, descriptor);
|
|
12678
12782
|
if (!open || !bundle || bundle.players.length === 0 || (bundle.live ?? false) !== live) return null;
|
|
@@ -12872,14 +12976,14 @@ function NflMonitorCard({ match, monitor, ui, slip, onAsk }) {
|
|
|
12872
12976
|
}
|
|
12873
12977
|
|
|
12874
12978
|
// src/components/TennisMonitorCard.tsx
|
|
12875
|
-
var
|
|
12979
|
+
var import_react89 = require("react");
|
|
12876
12980
|
var import_widget_sdk28 = require("@sensiblestats/widget-sdk");
|
|
12877
12981
|
|
|
12878
12982
|
// src/components/TennisFixtureRow.tsx
|
|
12879
12983
|
var import_widget_sdk27 = require("@sensiblestats/widget-sdk");
|
|
12880
12984
|
|
|
12881
12985
|
// src/components/FixtureRow.tsx
|
|
12882
|
-
var
|
|
12986
|
+
var import_react87 = require("react");
|
|
12883
12987
|
var import_widget_sdk26 = require("@sensiblestats/widget-sdk");
|
|
12884
12988
|
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
12885
12989
|
function splitAtFirstSpace(label) {
|
|
@@ -12893,7 +12997,7 @@ function kickoffLabel(kickoffUnix, tag2, clock3, timeZone) {
|
|
|
12893
12997
|
return formatTime(kickoffUnix * 1e3, tag2, clock3, { timeZone });
|
|
12894
12998
|
}
|
|
12895
12999
|
function Side2({ name, crest, abbr, away = false }) {
|
|
12896
|
-
const [failed, setFailed] = (0,
|
|
13000
|
+
const [failed, setFailed] = (0, import_react87.useState)(false);
|
|
12897
13001
|
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("span", { className: away ? "ss-w-drow-side ss-w-drow-side--away" : "ss-w-drow-side", children: [
|
|
12898
13002
|
crest && !failed ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("img", { className: abbr ? "ss-w-drow-crest ss-w-drow-crest--wide" : "ss-w-drow-crest", src: crest, alt: "", onError: () => setFailed(true) }) : abbr ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("span", { className: "ss-w-drow-crest ss-w-drow-crest--abbr", children: abbr }) : null,
|
|
12899
13003
|
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("span", { className: "ss-w-drow-nm", children: name })
|
|
@@ -13135,7 +13239,7 @@ function TennisLiveScoreboard({ t, score, live, ui }) {
|
|
|
13135
13239
|
}
|
|
13136
13240
|
|
|
13137
13241
|
// src/components/TennisStatsTables.tsx
|
|
13138
|
-
var
|
|
13242
|
+
var import_react88 = require("react");
|
|
13139
13243
|
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
13140
13244
|
function formatStat(row, value, locale) {
|
|
13141
13245
|
if (value == null) return "\u2013";
|
|
@@ -13173,8 +13277,8 @@ function Tables({ table, labels, names, locale }) {
|
|
|
13173
13277
|
] });
|
|
13174
13278
|
}
|
|
13175
13279
|
function TennisStatsTables({ serveReturn, today, labels, names, ui, resetKey }) {
|
|
13176
|
-
const [tab, setTab] = (0,
|
|
13177
|
-
(0,
|
|
13280
|
+
const [tab, setTab] = (0, import_react88.useState)("match");
|
|
13281
|
+
(0, import_react88.useEffect)(() => {
|
|
13178
13282
|
setTab("match");
|
|
13179
13283
|
}, [resetKey]);
|
|
13180
13284
|
const sets = serveReturn.sets.filter((s) => s.table.serve.length + s.table.return.length > 0);
|
|
@@ -13205,7 +13309,7 @@ function TennisStatsTables({ serveReturn, today, labels, names, ui, resetKey })
|
|
|
13205
13309
|
] }),
|
|
13206
13310
|
today.rows.map((r) => {
|
|
13207
13311
|
const f = (v) => formatStat({ kind: "pct" }, v, locale);
|
|
13208
|
-
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(
|
|
13312
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsxs)(import_react88.Fragment, { children: [
|
|
13209
13313
|
/* @__PURE__ */ (0, import_jsx_runtime96.jsx)("span", { className: "ss-w-ts-l", children: r.label }),
|
|
13210
13314
|
/* @__PURE__ */ (0, import_jsx_runtime96.jsxs)("span", { className: "ss-w-ts-today-v ss-w-ts-today-v--a", children: [
|
|
13211
13315
|
f(r.p1Today),
|
|
@@ -13340,7 +13444,7 @@ function HeadToHead({ t, ui }) {
|
|
|
13340
13444
|
] });
|
|
13341
13445
|
}
|
|
13342
13446
|
function TennisMonitorCard({ match, monitor, ui, slip, onAsk }) {
|
|
13343
|
-
const lastTables = (0,
|
|
13447
|
+
const lastTables = (0, import_react89.useRef)(null);
|
|
13344
13448
|
const t = match.tennis;
|
|
13345
13449
|
if (!t) return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(UnavailableCard, { match, monitor, ui, sport: "tennis" });
|
|
13346
13450
|
const preMatch = match.phase === "preMatch";
|
|
@@ -13420,7 +13524,7 @@ function TennisMonitorCard({ match, monitor, ui, slip, onAsk }) {
|
|
|
13420
13524
|
}
|
|
13421
13525
|
|
|
13422
13526
|
// src/components/ScoreboardStrip.tsx
|
|
13423
|
-
var
|
|
13527
|
+
var import_react90 = require("react");
|
|
13424
13528
|
var import_widget_sdk29 = require("@sensiblestats/widget-sdk");
|
|
13425
13529
|
var import_jsx_runtime98 = require("react/jsx-runtime");
|
|
13426
13530
|
function nbaStatus(m, ui) {
|
|
@@ -13515,8 +13619,8 @@ function rowsFor(m) {
|
|
|
13515
13619
|
];
|
|
13516
13620
|
}
|
|
13517
13621
|
function useStripScroll(selectedKey) {
|
|
13518
|
-
const stripRef = (0,
|
|
13519
|
-
(0,
|
|
13622
|
+
const stripRef = (0, import_react90.useRef)(null);
|
|
13623
|
+
(0, import_react90.useEffect)(() => {
|
|
13520
13624
|
const strip = stripRef.current;
|
|
13521
13625
|
const pressed = strip?.querySelector('[aria-pressed="true"]');
|
|
13522
13626
|
if (!strip || !pressed) return;
|
|
@@ -13690,7 +13794,7 @@ function OddsLiveStrip({ m, ui }) {
|
|
|
13690
13794
|
] });
|
|
13691
13795
|
}
|
|
13692
13796
|
function MatchesPanel({ monitor, ui, slip, onAsk, discovery }) {
|
|
13693
|
-
const seedIndex = (0,
|
|
13797
|
+
const seedIndex = (0, import_react91.useMemo)(() => buildSeedIndex(discovery?.groups ?? []), [discovery?.groups]);
|
|
13694
13798
|
const tiles = orderTiles(
|
|
13695
13799
|
monitor.pins,
|
|
13696
13800
|
monitor.snapshot,
|
|
@@ -13762,7 +13866,7 @@ function TrendsPanel({ monitor, ui, slip }) {
|
|
|
13762
13866
|
}
|
|
13763
13867
|
|
|
13764
13868
|
// src/components/LivePanel.tsx
|
|
13765
|
-
var
|
|
13869
|
+
var import_react94 = require("react");
|
|
13766
13870
|
var import_widget_sdk36 = require("@sensiblestats/widget-sdk");
|
|
13767
13871
|
|
|
13768
13872
|
// src/scheduleView.ts
|
|
@@ -13937,20 +14041,20 @@ function LeagueGroup({ view, open, onToggle, disambiguate, rowCap, onShowAll, on
|
|
|
13937
14041
|
}
|
|
13938
14042
|
|
|
13939
14043
|
// src/components/MatchSheet.tsx
|
|
13940
|
-
var
|
|
14044
|
+
var import_react93 = require("react");
|
|
13941
14045
|
var import_widget_sdk34 = require("@sensiblestats/widget-sdk");
|
|
13942
14046
|
|
|
13943
14047
|
// src/useModalDialog.ts
|
|
13944
|
-
var
|
|
14048
|
+
var import_react92 = require("react");
|
|
13945
14049
|
var FOCUSABLE = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
13946
14050
|
function useModalDialog(onClose, opts = {}) {
|
|
13947
|
-
const dialogRef = (0,
|
|
13948
|
-
const onCloseRef = (0,
|
|
14051
|
+
const dialogRef = (0, import_react92.useRef)(null);
|
|
14052
|
+
const onCloseRef = (0, import_react92.useRef)(onClose);
|
|
13949
14053
|
onCloseRef.current = onClose;
|
|
13950
|
-
const openerRef = (0,
|
|
14054
|
+
const openerRef = (0, import_react92.useRef)(opts.opener);
|
|
13951
14055
|
openerRef.current = opts.opener;
|
|
13952
14056
|
const restore = opts.restoreFocus ?? true;
|
|
13953
|
-
(0,
|
|
14057
|
+
(0, import_react92.useEffect)(() => {
|
|
13954
14058
|
const dialog = dialogRef.current;
|
|
13955
14059
|
const root = dialog?.getRootNode();
|
|
13956
14060
|
const focusedAtMount = root?.activeElement ?? null;
|
|
@@ -13961,7 +14065,7 @@ function useModalDialog(onClose, opts = {}) {
|
|
|
13961
14065
|
if (target instanceof HTMLElement) target.focus({ preventScroll: true });
|
|
13962
14066
|
};
|
|
13963
14067
|
}, []);
|
|
13964
|
-
(0,
|
|
14068
|
+
(0, import_react92.useEffect)(() => {
|
|
13965
14069
|
const onKey = (e) => {
|
|
13966
14070
|
if (e.key !== "Escape") return;
|
|
13967
14071
|
e.stopPropagation();
|
|
@@ -14002,8 +14106,8 @@ function kickoffDate(kickoffUnix, lang, timeZone) {
|
|
|
14002
14106
|
function MatchSheet({ match, league, state, stale, ui, monitor, onAsk, onClose, opener }) {
|
|
14003
14107
|
const { dialogRef, onKeyDown } = useModalDialog(onClose, { opener });
|
|
14004
14108
|
const log = useEventLog();
|
|
14005
|
-
const titleId = (0,
|
|
14006
|
-
const [limitHit, setLimitHit] = (0,
|
|
14109
|
+
const titleId = (0, import_react93.useId)();
|
|
14110
|
+
const [limitHit, setLimitHit] = (0, import_react93.useState)(false);
|
|
14007
14111
|
const pinSport = (0, import_widget_sdk34.slipSportOf)(match.sport);
|
|
14008
14112
|
const tour = pinSport === "tennis" && isKnownTour(match.tour) ? match.tour : void 0;
|
|
14009
14113
|
const followable = pinSport !== "tennis" || tour !== void 0;
|
|
@@ -14104,10 +14208,10 @@ var OPEN_TOP_GROUPS = 2;
|
|
|
14104
14208
|
var QUIET_ROWS = 4;
|
|
14105
14209
|
function LivePanel({ discovery, ui, monitor, sport, offered, onSport, league, onLeague, onSeeAll, onAsk }) {
|
|
14106
14210
|
const { groups, states, stale } = discovery;
|
|
14107
|
-
const [mine, setMine] = (0,
|
|
14108
|
-
const [toggled, setToggled] = (0,
|
|
14109
|
-
const [sheet, setSheet] = (0,
|
|
14110
|
-
const pinnedKeys = (0,
|
|
14211
|
+
const [mine, setMine] = (0, import_react94.useState)(false);
|
|
14212
|
+
const [toggled, setToggled] = (0, import_react94.useState)(/* @__PURE__ */ new Map());
|
|
14213
|
+
const [sheet, setSheet] = (0, import_react94.useState)(null);
|
|
14214
|
+
const pinnedKeys = (0, import_react94.useMemo)(
|
|
14111
14215
|
() => new Set(monitor.pins.filter((p) => p.kind === "match").map((p) => (0, import_widget_sdk36.matchKey)(p.sport, p.matchId, p.tour))),
|
|
14112
14216
|
[monitor.pins]
|
|
14113
14217
|
);
|
|
@@ -14213,20 +14317,20 @@ function LivePanel({ discovery, ui, monitor, sport, offered, onSport, league, on
|
|
|
14213
14317
|
}
|
|
14214
14318
|
|
|
14215
14319
|
// src/components/ScheduleMatchesPanel.tsx
|
|
14216
|
-
var
|
|
14320
|
+
var import_react98 = require("react");
|
|
14217
14321
|
var import_widget_sdk38 = require("@sensiblestats/widget-sdk");
|
|
14218
14322
|
|
|
14219
14323
|
// src/useTennisRowPrices.ts
|
|
14220
|
-
var
|
|
14324
|
+
var import_react95 = require("react");
|
|
14221
14325
|
var import_widget_sdk37 = require("@sensiblestats/widget-sdk");
|
|
14222
14326
|
var TENNIS_PRICE_POLL_MS = 6e4;
|
|
14223
14327
|
function useTennisRowPrices(a) {
|
|
14224
|
-
const [state, setState] = (0,
|
|
14225
|
-
const getPricesRef = (0,
|
|
14328
|
+
const [state, setState] = (0, import_react95.useState)({ byId: null, stale: false });
|
|
14329
|
+
const getPricesRef = (0, import_react95.useRef)(a.getPrices);
|
|
14226
14330
|
getPricesRef.current = a.getPrices;
|
|
14227
|
-
const latest = (0,
|
|
14331
|
+
const latest = (0, import_react95.useRef)(0);
|
|
14228
14332
|
const idsKey = a.keys.filter((k) => isKnownTour(k.tour)).slice(0, MAX_TENNIS_KEYS).map((k) => `${k.tour}:${k.matchId}`).sort().join(",");
|
|
14229
|
-
(0,
|
|
14333
|
+
(0, import_react95.useEffect)(() => {
|
|
14230
14334
|
if (!a.enabled || idsKey === "") {
|
|
14231
14335
|
latest.current++;
|
|
14232
14336
|
setState((prev) => prev.byId === null && !prev.stale ? prev : { byId: null, stale: false });
|
|
@@ -14264,11 +14368,11 @@ function useTennisRowPrices(a) {
|
|
|
14264
14368
|
}
|
|
14265
14369
|
|
|
14266
14370
|
// src/components/DayStrip.tsx
|
|
14267
|
-
var
|
|
14371
|
+
var import_react96 = require("react");
|
|
14268
14372
|
var import_jsx_runtime107 = require("react/jsx-runtime");
|
|
14269
14373
|
function DayStrip({ chips, selected, onSelect, ui, locale }) {
|
|
14270
|
-
const listRef = (0,
|
|
14271
|
-
(0,
|
|
14374
|
+
const listRef = (0, import_react96.useRef)(null);
|
|
14375
|
+
(0, import_react96.useEffect)(() => {
|
|
14272
14376
|
const el = listRef.current?.querySelector('[aria-pressed="true"]');
|
|
14273
14377
|
if (!el || typeof el.scrollIntoView !== "function") return;
|
|
14274
14378
|
const reduce = typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
@@ -14297,7 +14401,7 @@ function DayStrip({ chips, selected, onSelect, ui, locale }) {
|
|
|
14297
14401
|
}
|
|
14298
14402
|
|
|
14299
14403
|
// src/components/games/ui/SearchField.tsx
|
|
14300
|
-
var
|
|
14404
|
+
var import_react97 = require("react");
|
|
14301
14405
|
|
|
14302
14406
|
// src/components/games/ui/icons.tsx
|
|
14303
14407
|
var import_jsx_runtime108 = require("react/jsx-runtime");
|
|
@@ -14336,8 +14440,8 @@ var IconFlame = ({ size = 16 }) => svg(size, /* @__PURE__ */ (0, import_jsx_runt
|
|
|
14336
14440
|
// src/components/games/ui/SearchField.tsx
|
|
14337
14441
|
var import_jsx_runtime109 = require("react/jsx-runtime");
|
|
14338
14442
|
function SearchField({ id, label, labelHidden = false, placeholder, value, onChange, disabled, inputRef, onKeyDown, clearLabel }) {
|
|
14339
|
-
const localRef = (0,
|
|
14340
|
-
const setInputRef = (0,
|
|
14443
|
+
const localRef = (0, import_react97.useRef)(null);
|
|
14444
|
+
const setInputRef = (0, import_react97.useCallback)((node) => {
|
|
14341
14445
|
localRef.current = node;
|
|
14342
14446
|
if (typeof inputRef === "function") inputRef(node);
|
|
14343
14447
|
else if (inputRef) inputRef.current = node;
|
|
@@ -14383,18 +14487,18 @@ var TOP_ROW_CAP = 3;
|
|
|
14383
14487
|
var SKELETON_ROWS = 3;
|
|
14384
14488
|
function ScheduleMatchesPanel({ discovery, ui, monitor, sport, offered, onSport, day, onDay, loaded, onOpenLive, onAsk, locale, getTennisPrices, slip }) {
|
|
14385
14489
|
const { localDate: today, states, stale } = discovery;
|
|
14386
|
-
const searchId = (0,
|
|
14387
|
-
const [query, setQuery] = (0,
|
|
14388
|
-
const [toggled, setToggled] = (0,
|
|
14389
|
-
const [expanded, setExpanded] = (0,
|
|
14390
|
-
const listRef = (0,
|
|
14391
|
-
const [sheet, setSheet] = (0,
|
|
14490
|
+
const searchId = (0, import_react98.useId)();
|
|
14491
|
+
const [query, setQuery] = (0, import_react98.useState)("");
|
|
14492
|
+
const [toggled, setToggled] = (0, import_react98.useState)(/* @__PURE__ */ new Map());
|
|
14493
|
+
const [expanded, setExpanded] = (0, import_react98.useState)(/* @__PURE__ */ new Set());
|
|
14494
|
+
const listRef = (0, import_react98.useRef)(null);
|
|
14495
|
+
const [sheet, setSheet] = (0, import_react98.useState)(null);
|
|
14392
14496
|
const { chips, selected } = loaded;
|
|
14393
|
-
(0,
|
|
14497
|
+
(0, import_react98.useEffect)(() => {
|
|
14394
14498
|
if (selected !== day) onDay(selected);
|
|
14395
14499
|
}, [day, selected, onDay]);
|
|
14396
14500
|
const isToday = selected === today;
|
|
14397
|
-
const pinnedKeys = (0,
|
|
14501
|
+
const pinnedKeys = (0, import_react98.useMemo)(
|
|
14398
14502
|
() => new Set(monitor.pins.filter((p) => p.kind === "match").map((p) => (0, import_widget_sdk38.matchKey)(p.sport, p.matchId, p.tour))),
|
|
14399
14503
|
[monitor.pins]
|
|
14400
14504
|
);
|
|
@@ -14532,7 +14636,7 @@ function ScheduleMatchesPanel({ discovery, ui, monitor, sport, offered, onSport,
|
|
|
14532
14636
|
}
|
|
14533
14637
|
|
|
14534
14638
|
// src/components/GamesPanel.tsx
|
|
14535
|
-
var
|
|
14639
|
+
var import_react113 = require("react");
|
|
14536
14640
|
|
|
14537
14641
|
// src/components/GamesLoginWall.tsx
|
|
14538
14642
|
var import_jsx_runtime111 = require("react/jsx-runtime");
|
|
@@ -14541,7 +14645,7 @@ function GamesLoginWall({ ui }) {
|
|
|
14541
14645
|
}
|
|
14542
14646
|
|
|
14543
14647
|
// src/components/GamesHub.tsx
|
|
14544
|
-
var
|
|
14648
|
+
var import_react99 = require("react");
|
|
14545
14649
|
|
|
14546
14650
|
// src/components/games/ui/gameMeta.ts
|
|
14547
14651
|
function prettifyGameId(gameId) {
|
|
@@ -14692,8 +14796,8 @@ function pickHeroGame(games) {
|
|
|
14692
14796
|
}
|
|
14693
14797
|
var tileKey = (g) => `${g.gameId}-${g.gameDay}-${g.fixtureId}`;
|
|
14694
14798
|
function GamesHub({ games, myWeeklyRow, weeklyPrize, onOpen, ui }) {
|
|
14695
|
-
const [, setTick] = (0,
|
|
14696
|
-
(0,
|
|
14799
|
+
const [, setTick] = (0, import_react99.useState)(0);
|
|
14800
|
+
(0, import_react99.useEffect)(() => {
|
|
14697
14801
|
const id = setInterval(() => setTick((t) => t + 1), 6e4);
|
|
14698
14802
|
return () => clearInterval(id);
|
|
14699
14803
|
}, []);
|
|
@@ -14753,10 +14857,10 @@ function GamesHub({ games, myWeeklyRow, weeklyPrize, onOpen, ui }) {
|
|
|
14753
14857
|
}
|
|
14754
14858
|
|
|
14755
14859
|
// src/components/GameScreenHost.tsx
|
|
14756
|
-
var
|
|
14860
|
+
var import_react111 = require("react");
|
|
14757
14861
|
|
|
14758
14862
|
// src/useGamePlay.ts
|
|
14759
|
-
var
|
|
14863
|
+
var import_react100 = require("react");
|
|
14760
14864
|
function toSubmitResult(payload) {
|
|
14761
14865
|
return {
|
|
14762
14866
|
// 'pending' means the play is recorded but awaiting resolution (fixture games)
|
|
@@ -14768,17 +14872,17 @@ function toSubmitResult(payload) {
|
|
|
14768
14872
|
};
|
|
14769
14873
|
}
|
|
14770
14874
|
function useGamePlay(conversation, { gameId, gameDay, fixtureId, locale, refresh }) {
|
|
14771
|
-
const [result, setResult] = (0,
|
|
14772
|
-
const [submitting, setSubmitting] = (0,
|
|
14773
|
-
const [rawStatus, setRawStatus] = (0,
|
|
14774
|
-
const inFlightRef = (0,
|
|
14775
|
-
const convRef = (0,
|
|
14875
|
+
const [result, setResult] = (0, import_react100.useState)(null);
|
|
14876
|
+
const [submitting, setSubmitting] = (0, import_react100.useState)(false);
|
|
14877
|
+
const [rawStatus, setRawStatus] = (0, import_react100.useState)(null);
|
|
14878
|
+
const inFlightRef = (0, import_react100.useRef)(false);
|
|
14879
|
+
const convRef = (0, import_react100.useRef)(conversation);
|
|
14776
14880
|
convRef.current = conversation;
|
|
14777
|
-
const optsRef = (0,
|
|
14881
|
+
const optsRef = (0, import_react100.useRef)({ gameId, gameDay, fixtureId, locale, refresh });
|
|
14778
14882
|
optsRef.current = { gameId, gameDay, fixtureId, locale, refresh };
|
|
14779
|
-
const resultRef = (0,
|
|
14883
|
+
const resultRef = (0, import_react100.useRef)(null);
|
|
14780
14884
|
resultRef.current = result;
|
|
14781
|
-
const refetch = (0,
|
|
14885
|
+
const refetch = (0, import_react100.useCallback)(async () => {
|
|
14782
14886
|
const conv = convRef.current;
|
|
14783
14887
|
if (!conv) return;
|
|
14784
14888
|
const opts = optsRef.current;
|
|
@@ -14794,7 +14898,7 @@ function useGamePlay(conversation, { gameId, gameDay, fixtureId, locale, refresh
|
|
|
14794
14898
|
} catch {
|
|
14795
14899
|
}
|
|
14796
14900
|
}, []);
|
|
14797
|
-
const submit = (0,
|
|
14901
|
+
const submit = (0, import_react100.useCallback)(async (answerJson) => {
|
|
14798
14902
|
const conv = convRef.current;
|
|
14799
14903
|
if (!conv || inFlightRef.current) return;
|
|
14800
14904
|
inFlightRef.current = true;
|
|
@@ -14821,14 +14925,14 @@ function useGamePlay(conversation, { gameId, gameDay, fixtureId, locale, refresh
|
|
|
14821
14925
|
setSubmitting(false);
|
|
14822
14926
|
}
|
|
14823
14927
|
}, [refetch]);
|
|
14824
|
-
const hydrate = (0,
|
|
14928
|
+
const hydrate = (0, import_react100.useCallback)(() => {
|
|
14825
14929
|
void refetch();
|
|
14826
14930
|
}, [refetch]);
|
|
14827
14931
|
return { result, submitting, submit, hydrate, rawStatus };
|
|
14828
14932
|
}
|
|
14829
14933
|
|
|
14830
14934
|
// src/components/games/MysteryTigerGame.tsx
|
|
14831
|
-
var
|
|
14935
|
+
var import_react102 = require("react");
|
|
14832
14936
|
|
|
14833
14937
|
// src/components/games/nationFlags.ts
|
|
14834
14938
|
var FLAGS = {
|
|
@@ -15039,7 +15143,7 @@ function isNationCode(flag) {
|
|
|
15039
15143
|
}
|
|
15040
15144
|
|
|
15041
15145
|
// src/components/games/PlayerAvatar.tsx
|
|
15042
|
-
var
|
|
15146
|
+
var import_react101 = require("react");
|
|
15043
15147
|
var import_jsx_runtime116 = require("react/jsx-runtime");
|
|
15044
15148
|
function initialsOf(name) {
|
|
15045
15149
|
const parts2 = name.trim().split(/\s+/).filter(Boolean);
|
|
@@ -15057,7 +15161,7 @@ function PlayerAvatar({
|
|
|
15057
15161
|
imagePath,
|
|
15058
15162
|
className
|
|
15059
15163
|
}) {
|
|
15060
|
-
const [failed, setFailed] = (0,
|
|
15164
|
+
const [failed, setFailed] = (0, import_react101.useState)(false);
|
|
15061
15165
|
const showImage = Boolean(imagePath) && !isPlaceholderImage(imagePath) && !failed;
|
|
15062
15166
|
return /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("div", { className, "aria-hidden": "true", children: showImage ? /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("img", { src: imagePath, alt: "", loading: "lazy", onError: () => setFailed(true) }) : /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("span", { className: "ss-w-av-initials", children: initialsOf(name) }) });
|
|
15063
15167
|
}
|
|
@@ -15301,8 +15405,8 @@ function MysteryTigerGame({
|
|
|
15301
15405
|
onBack
|
|
15302
15406
|
}) {
|
|
15303
15407
|
const t = ui.games.mysteryTiger;
|
|
15304
|
-
const [query, setQuery] = (0,
|
|
15305
|
-
const inputId = (0,
|
|
15408
|
+
const [query, setQuery] = (0, import_react102.useState)("");
|
|
15409
|
+
const inputId = (0, import_react102.useId)();
|
|
15306
15410
|
const clientState = parseClientState(result?.clientStateJson);
|
|
15307
15411
|
const guessResults = clientState?.guessResults ?? [];
|
|
15308
15412
|
const alreadyGuessedIds = new Set(guessResults.map((g) => g.playerId));
|
|
@@ -15563,13 +15667,13 @@ function HigherOrLowerGame({
|
|
|
15563
15667
|
}
|
|
15564
15668
|
|
|
15565
15669
|
// src/components/games/CareerPathGame.tsx
|
|
15566
|
-
var
|
|
15670
|
+
var import_react104 = require("react");
|
|
15567
15671
|
|
|
15568
15672
|
// src/components/games/ui/CrestShield.tsx
|
|
15569
|
-
var
|
|
15673
|
+
var import_react103 = require("react");
|
|
15570
15674
|
var import_jsx_runtime127 = require("react/jsx-runtime");
|
|
15571
15675
|
function CrestShield({ src, name, size = 28 }) {
|
|
15572
|
-
const [failed, setFailed] = (0,
|
|
15676
|
+
const [failed, setFailed] = (0, import_react103.useState)(false);
|
|
15573
15677
|
if (src && !isPlaceholderImage(src) && !failed) {
|
|
15574
15678
|
return /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("img", { className: "ss-g-crest", src, alt: name, width: size, height: size, loading: "lazy", onError: () => setFailed(true) });
|
|
15575
15679
|
}
|
|
@@ -15601,8 +15705,8 @@ function CareerPathGame({
|
|
|
15601
15705
|
}) {
|
|
15602
15706
|
const s = ui.games.careerPath;
|
|
15603
15707
|
const title = gameTitle({ gameId: "career-path" }, ui.games.titles);
|
|
15604
|
-
const [query, setQuery] = (0,
|
|
15605
|
-
const inputId = (0,
|
|
15708
|
+
const [query, setQuery] = (0, import_react104.useState)("");
|
|
15709
|
+
const inputId = (0, import_react104.useId)();
|
|
15606
15710
|
const clientState = parseClientState3(result?.clientStateJson);
|
|
15607
15711
|
const alreadyGuessedIds = new Set(clientState?.guessResults.map((g) => g.playerId) ?? []);
|
|
15608
15712
|
const isOver = result?.alreadyPlayed === true || clientState?.solved === true || clientState?.failed === true;
|
|
@@ -15708,7 +15812,7 @@ function CareerPathGame({
|
|
|
15708
15812
|
}
|
|
15709
15813
|
|
|
15710
15814
|
// src/components/games/BeatTheGridGame.tsx
|
|
15711
|
-
var
|
|
15815
|
+
var import_react105 = __toESM(require("react"), 1);
|
|
15712
15816
|
|
|
15713
15817
|
// src/components/games/ui/OptionList.tsx
|
|
15714
15818
|
var import_jsx_runtime129 = require("react/jsx-runtime");
|
|
@@ -15797,10 +15901,10 @@ function SearchSheet({
|
|
|
15797
15901
|
ui
|
|
15798
15902
|
}) {
|
|
15799
15903
|
const s = ui.games.beatTheGrid;
|
|
15800
|
-
const [query, setQuery] = (0,
|
|
15801
|
-
const inputId = (0,
|
|
15802
|
-
const inputRef = (0,
|
|
15803
|
-
(0,
|
|
15904
|
+
const [query, setQuery] = (0, import_react105.useState)("");
|
|
15905
|
+
const inputId = (0, import_react105.useId)();
|
|
15906
|
+
const inputRef = (0, import_react105.useRef)(null);
|
|
15907
|
+
(0, import_react105.useEffect)(() => {
|
|
15804
15908
|
inputRef.current?.focus();
|
|
15805
15909
|
}, [row, col]);
|
|
15806
15910
|
const filtered = playerPool.filter(
|
|
@@ -15865,7 +15969,7 @@ function BeatTheGridGame({
|
|
|
15865
15969
|
}) {
|
|
15866
15970
|
const s = ui.games.beatTheGrid;
|
|
15867
15971
|
const title = gameTitle({ gameId: "beat-the-grid" }, ui.games.titles);
|
|
15868
|
-
const [activeCell, setActiveCell] = (0,
|
|
15972
|
+
const [activeCell, setActiveCell] = (0, import_react105.useState)(null);
|
|
15869
15973
|
const clientState = parseClientState4(result?.clientStateJson);
|
|
15870
15974
|
const filledCells = clientState?.cells ?? [];
|
|
15871
15975
|
const isLocked2 = result?.alreadyPlayed === true || clientState?.isComplete === true;
|
|
@@ -15939,7 +16043,7 @@ function BeatTheGridGame({
|
|
|
15939
16043
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { "aria-hidden": "true", children: abbr }),
|
|
15940
16044
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("span", { className: "ss-g-sr", children: rowLabel })
|
|
15941
16045
|
] });
|
|
15942
|
-
return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(
|
|
16046
|
+
return /* @__PURE__ */ (0, import_jsx_runtime130.jsxs)(import_react105.default.Fragment, { children: [
|
|
15943
16047
|
/* @__PURE__ */ (0, import_jsx_runtime130.jsx)("div", { className: "ss-g-btg-rowhdr", "data-meta": rowMeta ? "true" : void 0, children: rowHeaderContent }),
|
|
15944
16048
|
cols.map((colLabel, colIdx) => {
|
|
15945
16049
|
const filled = findCellResult(filledCells, rowIdx, colIdx);
|
|
@@ -16020,7 +16124,7 @@ function BeatTheGridGame({
|
|
|
16020
16124
|
}
|
|
16021
16125
|
|
|
16022
16126
|
// src/components/games/GuessTheXiGame.tsx
|
|
16023
|
-
var
|
|
16127
|
+
var import_react106 = require("react");
|
|
16024
16128
|
|
|
16025
16129
|
// src/components/games/ui/PitchSvg.tsx
|
|
16026
16130
|
var import_jsx_runtime131 = require("react/jsx-runtime");
|
|
@@ -16109,8 +16213,8 @@ function GuessTheXiGame({
|
|
|
16109
16213
|
onBack
|
|
16110
16214
|
}) {
|
|
16111
16215
|
const t = ui.games.guessTheXi;
|
|
16112
|
-
const [query, setQuery] = (0,
|
|
16113
|
-
const inputId = (0,
|
|
16216
|
+
const [query, setQuery] = (0, import_react106.useState)("");
|
|
16217
|
+
const inputId = (0, import_react106.useId)();
|
|
16114
16218
|
const clientState = parseClientState5(result?.clientStateJson);
|
|
16115
16219
|
const isOver = result?.alreadyPlayed === true || clientState?.status === "solved" || clientState?.status === "failed";
|
|
16116
16220
|
const solved = clientState?.status === "solved";
|
|
@@ -16252,7 +16356,7 @@ function GuessTheXiGame({
|
|
|
16252
16356
|
}
|
|
16253
16357
|
|
|
16254
16358
|
// src/components/games/DailyQuizGame.tsx
|
|
16255
|
-
var
|
|
16359
|
+
var import_react107 = require("react");
|
|
16256
16360
|
var import_jsx_runtime133 = require("react/jsx-runtime");
|
|
16257
16361
|
function parseClientState6(json) {
|
|
16258
16362
|
if (!json) return null;
|
|
@@ -16293,8 +16397,8 @@ function DailyQuizGame({
|
|
|
16293
16397
|
}) {
|
|
16294
16398
|
const s = ui.games.dailyQuiz;
|
|
16295
16399
|
const title = gameTitle({ gameId: "daily-quiz" }, ui.games.titles);
|
|
16296
|
-
const [selections, setSelections] = (0,
|
|
16297
|
-
const [page, setPage] = (0,
|
|
16400
|
+
const [selections, setSelections] = (0, import_react107.useState)(/* @__PURE__ */ new Map());
|
|
16401
|
+
const [page, setPage] = (0, import_react107.useState)(0);
|
|
16298
16402
|
const clientState = parseClientState6(result?.clientStateJson);
|
|
16299
16403
|
const results2 = clientState?.results ?? [];
|
|
16300
16404
|
const isRevealed = results2.length > 0 || result?.alreadyPlayed === true;
|
|
@@ -16404,7 +16508,7 @@ function DailyQuizGame({
|
|
|
16404
16508
|
}
|
|
16405
16509
|
|
|
16406
16510
|
// src/components/games/MatchdayPredictorGame.tsx
|
|
16407
|
-
var
|
|
16511
|
+
var import_react108 = require("react");
|
|
16408
16512
|
var import_jsx_runtime134 = require("react/jsx-runtime");
|
|
16409
16513
|
var SCORER_SEARCH_THRESHOLD = 9;
|
|
16410
16514
|
function parseClientState7(json) {
|
|
@@ -16500,12 +16604,12 @@ function MatchdayPredictorGame({
|
|
|
16500
16604
|
onBack
|
|
16501
16605
|
}) {
|
|
16502
16606
|
const t = ui.games.predictor;
|
|
16503
|
-
const [homeScore, setHomeScore] = (0,
|
|
16504
|
-
const [awayScore, setAwayScore] = (0,
|
|
16505
|
-
const [firstScorerPlayerId, setFirstScorerPlayerId] = (0,
|
|
16506
|
-
const [lastEdited, setLastEdited] = (0,
|
|
16507
|
-
const [query, setQuery] = (0,
|
|
16508
|
-
const searchId = (0,
|
|
16607
|
+
const [homeScore, setHomeScore] = (0, import_react108.useState)(0);
|
|
16608
|
+
const [awayScore, setAwayScore] = (0, import_react108.useState)(0);
|
|
16609
|
+
const [firstScorerPlayerId, setFirstScorerPlayerId] = (0, import_react108.useState)(null);
|
|
16610
|
+
const [lastEdited, setLastEdited] = (0, import_react108.useState)("home");
|
|
16611
|
+
const [query, setQuery] = (0, import_react108.useState)("");
|
|
16612
|
+
const searchId = (0, import_react108.useId)();
|
|
16509
16613
|
const clientState = parseClientState7(result?.clientStateJson);
|
|
16510
16614
|
const alreadyPlayed = result?.alreadyPlayed === true;
|
|
16511
16615
|
const header = /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
|
|
@@ -16672,7 +16776,7 @@ function MatchdayPredictorGame({
|
|
|
16672
16776
|
}
|
|
16673
16777
|
|
|
16674
16778
|
// src/components/games/StartingXiGame.tsx
|
|
16675
|
-
var
|
|
16779
|
+
var import_react109 = require("react");
|
|
16676
16780
|
var import_jsx_runtime135 = require("react/jsx-runtime");
|
|
16677
16781
|
var POINTS_PER_STARTER = 8;
|
|
16678
16782
|
var XI_SIZE = 11;
|
|
@@ -16716,10 +16820,10 @@ function StartingXiGame({
|
|
|
16716
16820
|
lockAtUtc
|
|
16717
16821
|
}) {
|
|
16718
16822
|
const t = ui.games.startingXi;
|
|
16719
|
-
const [slotPlayers, setSlotPlayers] = (0,
|
|
16720
|
-
const [active, setActive] = (0,
|
|
16721
|
-
const [query, setQuery] = (0,
|
|
16722
|
-
const searchId = (0,
|
|
16823
|
+
const [slotPlayers, setSlotPlayers] = (0, import_react109.useState)(() => Array(XI_SIZE).fill(null));
|
|
16824
|
+
const [active, setActive] = (0, import_react109.useState)(0);
|
|
16825
|
+
const [query, setQuery] = (0, import_react109.useState)("");
|
|
16826
|
+
const searchId = (0, import_react109.useId)();
|
|
16723
16827
|
const clientState = parseClientState8(result?.clientStateJson);
|
|
16724
16828
|
const alreadyPlayed = result?.alreadyPlayed === true;
|
|
16725
16829
|
const header = /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
|
|
@@ -16858,7 +16962,7 @@ function StartingXiGame({
|
|
|
16858
16962
|
}
|
|
16859
16963
|
|
|
16860
16964
|
// src/components/games/StatLadderGame.tsx
|
|
16861
|
-
var
|
|
16965
|
+
var import_react110 = require("react");
|
|
16862
16966
|
var import_jsx_runtime136 = require("react/jsx-runtime");
|
|
16863
16967
|
function ladderClue(ladder) {
|
|
16864
16968
|
const mystery = ladder.find((r) => r.rank === 2);
|
|
@@ -16895,9 +16999,9 @@ function StatLadderGame({
|
|
|
16895
16999
|
onBack
|
|
16896
17000
|
}) {
|
|
16897
17001
|
const t = ui.games.statLadder;
|
|
16898
|
-
const [query, setQuery] = (0,
|
|
16899
|
-
const [selectedId, setSelectedId] = (0,
|
|
16900
|
-
const searchId = (0,
|
|
17002
|
+
const [query, setQuery] = (0, import_react110.useState)("");
|
|
17003
|
+
const [selectedId, setSelectedId] = (0, import_react110.useState)(null);
|
|
17004
|
+
const searchId = (0, import_react110.useId)();
|
|
16901
17005
|
const clientState = parseClientState9(result?.clientStateJson);
|
|
16902
17006
|
const revealed = clientState != null;
|
|
16903
17007
|
const header = /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(GameHeader, { title: gameTitle({ gameId: "stat-ladder" }, ui.games.titles), eyebrow: t.eyebrow, onBack, backLabel: ui.back });
|
|
@@ -17103,8 +17207,8 @@ function GameScreenHost({
|
|
|
17103
17207
|
ui
|
|
17104
17208
|
}) {
|
|
17105
17209
|
const { gameId, fixtureId, gameDay = "", lockAtUtc = null } = selected;
|
|
17106
|
-
const [configJson, setConfigJson] = (0,
|
|
17107
|
-
(0,
|
|
17210
|
+
const [configJson, setConfigJson] = (0, import_react111.useState)(null);
|
|
17211
|
+
(0, import_react111.useEffect)(() => {
|
|
17108
17212
|
setConfigJson(null);
|
|
17109
17213
|
if (!conversation) return;
|
|
17110
17214
|
let cancelled = false;
|
|
@@ -17127,12 +17231,12 @@ function GameScreenHost({
|
|
|
17127
17231
|
fixtureId: fixtureId || void 0,
|
|
17128
17232
|
locale: ui.hostTag
|
|
17129
17233
|
});
|
|
17130
|
-
(0,
|
|
17234
|
+
(0, import_react111.useEffect)(() => {
|
|
17131
17235
|
if (conversation) hydrate();
|
|
17132
17236
|
}, [conversation, gameId]);
|
|
17133
|
-
const hydrateRef = (0,
|
|
17237
|
+
const hydrateRef = (0, import_react111.useRef)(hydrate);
|
|
17134
17238
|
hydrateRef.current = hydrate;
|
|
17135
|
-
(0,
|
|
17239
|
+
(0, import_react111.useEffect)(() => {
|
|
17136
17240
|
if (!FIXTURE_GAME_IDS.has(gameId)) return;
|
|
17137
17241
|
if (rawStatus !== "pending") return;
|
|
17138
17242
|
const timerId = setInterval(() => {
|
|
@@ -17245,7 +17349,7 @@ function GameScreenHost({
|
|
|
17245
17349
|
}
|
|
17246
17350
|
|
|
17247
17351
|
// src/components/Leaderboard.tsx
|
|
17248
|
-
var
|
|
17352
|
+
var import_react112 = require("react");
|
|
17249
17353
|
|
|
17250
17354
|
// src/components/LeaderboardRow.tsx
|
|
17251
17355
|
var import_jsx_runtime139 = require("react/jsx-runtime");
|
|
@@ -17332,7 +17436,7 @@ function Leaderboard({
|
|
|
17332
17436
|
ui,
|
|
17333
17437
|
onPlay
|
|
17334
17438
|
}) {
|
|
17335
|
-
const [segment, setSegment] = (0,
|
|
17439
|
+
const [segment, setSegment] = (0, import_react112.useState)("weekly");
|
|
17336
17440
|
const myRow = segment === "weekly" ? data.myWeeklyRow : data.myAllTimeRow;
|
|
17337
17441
|
const offBoard = myRow !== null && myRow !== void 0 && myRow.rank === -1;
|
|
17338
17442
|
const isEmpty = segment === "weekly" ? data.weeklyTop.length === 0 : data.allTimeTop.length === 0;
|
|
@@ -17437,9 +17541,9 @@ function GamesPanel({
|
|
|
17437
17541
|
leaderboardLoading,
|
|
17438
17542
|
refreshHub
|
|
17439
17543
|
}) {
|
|
17440
|
-
const [selected, setSelected] = (0,
|
|
17441
|
-
const [segment, setSegment] = (0,
|
|
17442
|
-
(0,
|
|
17544
|
+
const [selected, setSelected] = (0, import_react113.useState)(null);
|
|
17545
|
+
const [segment, setSegment] = (0, import_react113.useState)("play");
|
|
17546
|
+
(0, import_react113.useEffect)(() => {
|
|
17443
17547
|
ensureGamesFonts();
|
|
17444
17548
|
}, []);
|
|
17445
17549
|
if (!loggedIn) return /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(GamesLoginWall, { ui });
|
|
@@ -17503,10 +17607,10 @@ function GamesPanel({
|
|
|
17503
17607
|
}
|
|
17504
17608
|
|
|
17505
17609
|
// src/components/FavouritesPanel.tsx
|
|
17506
|
-
var
|
|
17610
|
+
var import_react116 = require("react");
|
|
17507
17611
|
|
|
17508
17612
|
// src/components/FavouriteChips.tsx
|
|
17509
|
-
var
|
|
17613
|
+
var import_react114 = require("react");
|
|
17510
17614
|
var import_jsx_runtime144 = require("react/jsx-runtime");
|
|
17511
17615
|
async function toggleWithNotice(controller, kind, id, onNotice) {
|
|
17512
17616
|
const outcome = await controller.toggle(kind, id);
|
|
@@ -17552,12 +17656,12 @@ function Group({ title, entities, sport, ui, controller, onNotice }) {
|
|
|
17552
17656
|
] });
|
|
17553
17657
|
}
|
|
17554
17658
|
function FavouriteChips({ controller, ui, sport, sportLabel: sportLabel2, onNotice }) {
|
|
17555
|
-
const [confirming, setConfirming] = (0,
|
|
17659
|
+
const [confirming, setConfirming] = (0, import_react114.useState)(false);
|
|
17556
17660
|
const data = controller.data;
|
|
17557
|
-
(0,
|
|
17661
|
+
(0, import_react114.useEffect)(() => {
|
|
17558
17662
|
setConfirming(false);
|
|
17559
17663
|
}, [sport]);
|
|
17560
|
-
(0,
|
|
17664
|
+
(0, import_react114.useEffect)(() => {
|
|
17561
17665
|
if (!confirming) return;
|
|
17562
17666
|
const onPointerDown = (e) => {
|
|
17563
17667
|
if (!(e.target instanceof Element) || !e.target.closest("[data-fav-confirm]")) setConfirming(false);
|
|
@@ -17611,21 +17715,21 @@ function FavouriteChips({ controller, ui, sport, sportLabel: sportLabel2, onNoti
|
|
|
17611
17715
|
}
|
|
17612
17716
|
|
|
17613
17717
|
// src/components/FavouritesSearch.tsx
|
|
17614
|
-
var
|
|
17718
|
+
var import_react115 = require("react");
|
|
17615
17719
|
var import_jsx_runtime145 = require("react/jsx-runtime");
|
|
17616
17720
|
var MIN_LETTERS = 2;
|
|
17617
17721
|
var MAX_LENGTH = 64;
|
|
17618
17722
|
var DEBOUNCE_MS = 250;
|
|
17619
17723
|
function FavouritesSearch({ controller, ui, sport, onNotice }) {
|
|
17620
|
-
const [query, setQuery] = (0,
|
|
17621
|
-
const [answer, setAnswer] = (0,
|
|
17622
|
-
const controllerRef = (0,
|
|
17724
|
+
const [query, setQuery] = (0, import_react115.useState)("");
|
|
17725
|
+
const [answer, setAnswer] = (0, import_react115.useState)(null);
|
|
17726
|
+
const controllerRef = (0, import_react115.useRef)(controller);
|
|
17623
17727
|
controllerRef.current = controller;
|
|
17624
17728
|
const trimmed = query.trim();
|
|
17625
17729
|
const queryKey = `${sport}|${trimmed}`;
|
|
17626
17730
|
const results2 = answer?.key === queryKey ? answer.rows : [];
|
|
17627
17731
|
const settled = answer?.key === queryKey;
|
|
17628
|
-
(0,
|
|
17732
|
+
(0, import_react115.useEffect)(() => {
|
|
17629
17733
|
setAnswer(null);
|
|
17630
17734
|
if (trimmed.length < MIN_LETTERS) return;
|
|
17631
17735
|
let cancelled = false;
|
|
@@ -17688,13 +17792,13 @@ function FavouritesSearch({ controller, ui, sport, onNotice }) {
|
|
|
17688
17792
|
// src/components/FavouritesPanel.tsx
|
|
17689
17793
|
var import_jsx_runtime146 = require("react/jsx-runtime");
|
|
17690
17794
|
function FavouritesPanel({ controller, ui, sport, sports, onSportChange }) {
|
|
17691
|
-
const [notice, setNotice] = (0,
|
|
17692
|
-
const refreshRef = (0,
|
|
17795
|
+
const [notice, setNotice] = (0, import_react116.useState)(null);
|
|
17796
|
+
const refreshRef = (0, import_react116.useRef)(controller.refresh);
|
|
17693
17797
|
refreshRef.current = controller.refresh;
|
|
17694
|
-
(0,
|
|
17798
|
+
(0, import_react116.useEffect)(() => {
|
|
17695
17799
|
void refreshRef.current();
|
|
17696
17800
|
}, []);
|
|
17697
|
-
(0,
|
|
17801
|
+
(0, import_react116.useEffect)(() => {
|
|
17698
17802
|
setNotice(null);
|
|
17699
17803
|
}, [sport]);
|
|
17700
17804
|
const sportLabel2 = sports.find((s) => s.sport === sport)?.label ?? sportLabel(ui, sport);
|
|
@@ -17720,11 +17824,11 @@ function FavouritesPanel({ controller, ui, sport, sports, onSportChange }) {
|
|
|
17720
17824
|
}
|
|
17721
17825
|
|
|
17722
17826
|
// src/components/PresetTools.tsx
|
|
17723
|
-
var
|
|
17827
|
+
var import_react117 = require("react");
|
|
17724
17828
|
var import_jsx_runtime147 = require("react/jsx-runtime");
|
|
17725
17829
|
function PresetToolModal({ title, closeLabel, onClose, children, footer, className }) {
|
|
17726
17830
|
const { dialogRef, onKeyDown } = useModalDialog(onClose, { restoreFocus: false });
|
|
17727
|
-
const titleId = (0,
|
|
17831
|
+
const titleId = (0, import_react117.useId)();
|
|
17728
17832
|
return /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("div", { className: className ? `ss-w-tool-backdrop ${className}` : "ss-w-tool-backdrop", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { ref: dialogRef, className: "ss-w-tool", role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, tabIndex: -1, onKeyDown, children: [
|
|
17729
17833
|
/* @__PURE__ */ (0, import_jsx_runtime147.jsxs)("div", { className: "ss-w-tool-head", children: [
|
|
17730
17834
|
/* @__PURE__ */ (0, import_jsx_runtime147.jsx)("h2", { id: titleId, className: "ss-w-tool-title", children: title }),
|
|
@@ -17774,9 +17878,9 @@ function BuildComboTool({ grid, strings, streaming, formatKickoff, initialTotal,
|
|
|
17774
17878
|
const totalOptions = comboTotals(grid);
|
|
17775
17879
|
const totals = totalOptions.map((o) => o.value);
|
|
17776
17880
|
const legChoices = comboLegChoices(grid);
|
|
17777
|
-
const [total, setTotal] = (0,
|
|
17778
|
-
const [legs, setLegs] = (0,
|
|
17779
|
-
const [announcement, setAnnouncement] = (0,
|
|
17881
|
+
const [total, setTotal] = (0, import_react117.useState)(() => nearest(totals, initialTotal));
|
|
17882
|
+
const [legs, setLegs] = (0, import_react117.useState)(() => legsForTotal(grid, nearest(totals, initialTotal), clampLegs(legChoices, initialLegs)));
|
|
17883
|
+
const [announcement, setAnnouncement] = (0, import_react117.useState)("");
|
|
17780
17884
|
const cell2 = findCombo(grid, total, legs);
|
|
17781
17885
|
const minLegs = legChoices[0] ?? legs;
|
|
17782
17886
|
const maxLegs = legChoices[legChoices.length - 1] ?? legs;
|
|
@@ -17814,11 +17918,8 @@ function FavouritesSheet({ ui, controller, sport, sports, onSportChange, onClose
|
|
|
17814
17918
|
return /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(PresetToolModal, { title: ui.tabFavourites, closeLabel: ui.closeSheetLabel, onClose, className: "ss-w-set-backdrop-in ss-w-fav-sheet", children: /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(FavouritesPanel, { controller, ui, sport, sports, onSportChange }) });
|
|
17815
17919
|
}
|
|
17816
17920
|
|
|
17817
|
-
// src/components/BuilderPanel.tsx
|
|
17818
|
-
var import_react118 = require("react");
|
|
17819
|
-
|
|
17820
17921
|
// src/components/dashboard/v8/SentenceBuilder.tsx
|
|
17821
|
-
var
|
|
17922
|
+
var import_react118 = require("react");
|
|
17822
17923
|
var import_widget_sdk39 = require("@sensiblestats/widget-sdk");
|
|
17823
17924
|
var import_jsx_runtime149 = require("react/jsx-runtime");
|
|
17824
17925
|
var TOTALS = ["any", "3", "5", "10", "20", "50"];
|
|
@@ -17853,16 +17954,15 @@ function openingGames(preset) {
|
|
|
17853
17954
|
}
|
|
17854
17955
|
var ALL_MARKETS = "*";
|
|
17855
17956
|
var usableMarkets = (preset) => preset.marketOptions && preset.marketOptions.some((m) => m.key === preset.marketKey) ? preset.marketOptions : null;
|
|
17856
|
-
function SentenceBuilder({ preset, ui, conversation, memory: memory3,
|
|
17957
|
+
function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, sport, operatorUserId, anonymousUserId, onCoolOff }) {
|
|
17857
17958
|
const { oddsFormat } = useOddsSettings();
|
|
17858
17959
|
const totals = totalKeys(preset);
|
|
17859
17960
|
const opening = openingGames(preset);
|
|
17860
17961
|
const gamesOptions = opening.options;
|
|
17861
17962
|
const marketOptions = usableMarkets(preset);
|
|
17862
|
-
const [fingerprint] = (0,
|
|
17863
|
-
const [
|
|
17864
|
-
|
|
17865
|
-
const kept = keepsMarket ? void 0 : memory3?.savedView(sport);
|
|
17963
|
+
const [fingerprint] = (0, import_react118.useState)(() => JSON.stringify(preset));
|
|
17964
|
+
const [saved] = (0, import_react118.useState)(() => {
|
|
17965
|
+
const kept = memory3?.savedView(sport);
|
|
17866
17966
|
return kept && kept.fingerprint === fingerprint ? kept : null;
|
|
17867
17967
|
});
|
|
17868
17968
|
const openingView = {
|
|
@@ -17870,15 +17970,15 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, keepMarket
|
|
|
17870
17970
|
total: asTotal(preset.totalTarget, totals),
|
|
17871
17971
|
custom: null,
|
|
17872
17972
|
// All markets opens unless the visitor has a usual market, which is never beaten.
|
|
17873
|
-
marketKey: marketOptions && !
|
|
17973
|
+
marketKey: marketOptions && !marketOptions.some((m) => m.usual) ? null : preset.marketKey,
|
|
17874
17974
|
gamesId: opening.option?.id ?? null,
|
|
17875
17975
|
matchIds: opening.option ? opening.option.matchIds : preset.matchIds,
|
|
17876
17976
|
// The server never widens by itself: an all-games preset with no ids asks for it.
|
|
17877
17977
|
widen: opening.option ? opening.option.matchIds.length === 0 : preset.gamesScope === "all" && preset.matchIds.length === 0
|
|
17878
17978
|
};
|
|
17879
|
-
const [view, setView] = (0,
|
|
17880
|
-
const autoWidened = (0,
|
|
17881
|
-
const [widenedNote, setWidenedNote] = (0,
|
|
17979
|
+
const [view, setView] = (0, import_react118.useState)(() => saved?.view ?? openingView);
|
|
17980
|
+
const autoWidened = (0, import_react118.useRef)(false);
|
|
17981
|
+
const [widenedNote, setWidenedNote] = (0, import_react118.useState)(saved?.widenedNote ?? false);
|
|
17882
17982
|
const track = useTrack();
|
|
17883
17983
|
const requestFor = (v, extra) => ({
|
|
17884
17984
|
sport,
|
|
@@ -17894,18 +17994,18 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, keepMarket
|
|
|
17894
17994
|
...operatorUserId ? { operatorUserId } : {},
|
|
17895
17995
|
...anonymousUserId ? { anonymousUserId } : {}
|
|
17896
17996
|
});
|
|
17897
|
-
const [editing, setEditing] = (0,
|
|
17898
|
-
const [draft, setDraft] = (0,
|
|
17899
|
-
const [invalid, setInvalid] = (0,
|
|
17900
|
-
const inputRef = (0,
|
|
17901
|
-
const pencilRef = (0,
|
|
17902
|
-
const noteId = (0,
|
|
17903
|
-
const customId = (0,
|
|
17904
|
-
(0,
|
|
17997
|
+
const [editing, setEditing] = (0, import_react118.useState)(false);
|
|
17998
|
+
const [draft, setDraft] = (0, import_react118.useState)("");
|
|
17999
|
+
const [invalid, setInvalid] = (0, import_react118.useState)(null);
|
|
18000
|
+
const inputRef = (0, import_react118.useRef)(null);
|
|
18001
|
+
const pencilRef = (0, import_react118.useRef)(null);
|
|
18002
|
+
const noteId = (0, import_react118.useId)();
|
|
18003
|
+
const customId = (0, import_react118.useId)();
|
|
18004
|
+
(0, import_react118.useEffect)(() => {
|
|
17905
18005
|
if (editing) inputRef.current?.focus();
|
|
17906
18006
|
}, [editing]);
|
|
17907
18007
|
const customLabel = (c) => c.format === oddsFormat ? c.text : c.decimal;
|
|
17908
|
-
(0,
|
|
18008
|
+
(0, import_react118.useEffect)(() => {
|
|
17909
18009
|
if (view.legs === 1) {
|
|
17910
18010
|
setEditing(false);
|
|
17911
18011
|
setDraft("");
|
|
@@ -17921,16 +18021,16 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, keepMarket
|
|
|
17921
18021
|
setEditing(false);
|
|
17922
18022
|
pencilRef.current?.focus();
|
|
17923
18023
|
};
|
|
17924
|
-
const [first] = (0,
|
|
18024
|
+
const [first] = (0, import_react118.useState)(() => requestFor(view));
|
|
17925
18025
|
const { grid, answeredFor, status: status2, confirmed, request } = useBuilderGrid({ conversation, locale: ui.hostTag, memory: memory3, initial: first });
|
|
17926
|
-
const [shown2, setShown] = (0,
|
|
18026
|
+
const [shown2, setShown] = (0, import_react118.useState)(null);
|
|
17927
18027
|
if (grid === null) {
|
|
17928
18028
|
if (shown2 !== null && status2 === "ready") setShown(null);
|
|
17929
18029
|
} else if (answeredFor && (shown2?.seen !== grid || shown2.seenReq !== answeredFor)) {
|
|
17930
18030
|
setShown(shownAfter(shown2, grid, answeredFor));
|
|
17931
18031
|
}
|
|
17932
|
-
const lastRequest = (0,
|
|
17933
|
-
(0,
|
|
18032
|
+
const lastRequest = (0, import_react118.useRef)(first);
|
|
18033
|
+
(0, import_react118.useEffect)(() => {
|
|
17934
18034
|
void request(lastRequest.current);
|
|
17935
18035
|
}, [request]);
|
|
17936
18036
|
const send = (req) => {
|
|
@@ -17968,7 +18068,7 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, keepMarket
|
|
|
17968
18068
|
};
|
|
17969
18069
|
const canNarrow = preset.matchIds.length > 0;
|
|
17970
18070
|
const ready = status2 === "ready" && grid !== null;
|
|
17971
|
-
const [tapped, setTapped] = (0,
|
|
18071
|
+
const [tapped, setTapped] = (0, import_react118.useState)(null);
|
|
17972
18072
|
const busy = tapped !== null && status2 === "loading" && shown2 !== null;
|
|
17973
18073
|
const g = ready ? shown2?.grid ?? grid : busy ? shown2.grid : null;
|
|
17974
18074
|
const suggested = g?.status === "miss" || g?.nearest === true ? g.legCountThatLands : null;
|
|
@@ -17977,8 +18077,8 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, keepMarket
|
|
|
17977
18077
|
...[preset.legs, suggested].filter((n) => n !== null && n > 4)
|
|
17978
18078
|
])).sort((a, b) => a - b);
|
|
17979
18079
|
const rows = g && g.status === "ok" ? legsOf(g, sport) : null;
|
|
17980
|
-
const sectionRef = (0,
|
|
17981
|
-
(0,
|
|
18080
|
+
const sectionRef = (0, import_react118.useRef)(null);
|
|
18081
|
+
(0, import_react118.useEffect)(() => {
|
|
17982
18082
|
if (tapped === null || status2 !== "ready") return;
|
|
17983
18083
|
setTapped(null);
|
|
17984
18084
|
const root = sectionRef.current;
|
|
@@ -17995,14 +18095,14 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, keepMarket
|
|
|
17995
18095
|
}, [tapped, status2]);
|
|
17996
18096
|
const rowSlip = rows ? guardLegsPreMatch(slip, rows, ui) : slip;
|
|
17997
18097
|
useNextKickoffRender(rows ? rows.map((l) => l.kickoffUtc) : []);
|
|
17998
|
-
const [startedNote, setStartedNote] = (0,
|
|
18098
|
+
const [startedNote, setStartedNote] = (0, import_react118.useState)(false);
|
|
17999
18099
|
const anyStarted = rows !== null && rows.some((l) => !preMatchOpen(l.kickoffUtc, Date.now()));
|
|
18000
|
-
(0,
|
|
18100
|
+
(0, import_react118.useEffect)(() => {
|
|
18001
18101
|
if (startedNote && status2 === "ready" && !anyStarted) setStartedNote(false);
|
|
18002
18102
|
}, [startedNote, status2, anyStarted]);
|
|
18003
18103
|
const market = rows?.[0]?.market;
|
|
18004
|
-
const [seen2, setSeen] = (0,
|
|
18005
|
-
(0,
|
|
18104
|
+
const [seen2, setSeen] = (0, import_react118.useState)(null);
|
|
18105
|
+
(0, import_react118.useEffect)(() => {
|
|
18006
18106
|
if (market) setSeen(market);
|
|
18007
18107
|
}, [market]);
|
|
18008
18108
|
const marketName = view.marketKey === null ? null : marketOptions?.find((m) => m.key === view.marketKey)?.label ?? market ?? seen2;
|
|
@@ -18046,14 +18146,14 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, keepMarket
|
|
|
18046
18146
|
};
|
|
18047
18147
|
};
|
|
18048
18148
|
const canWiden = gamesOptions === null || allGames !== null;
|
|
18049
|
-
(0,
|
|
18149
|
+
(0, import_react118.useEffect)(() => {
|
|
18050
18150
|
if (!empty2 || !singles || widened || !canWiden || autoWidened.current) return;
|
|
18051
18151
|
autoWidened.current = true;
|
|
18052
18152
|
const next = { ...view, widen: true, matchIds: [], gamesId: allGames ? allGames.id : view.gamesId };
|
|
18053
18153
|
commit(next, true);
|
|
18054
18154
|
send(requestFor(next));
|
|
18055
18155
|
}, [empty2, singles, widened, canWiden, view]);
|
|
18056
|
-
(0,
|
|
18156
|
+
(0, import_react118.useEffect)(() => {
|
|
18057
18157
|
if (coolOff) onCoolOff?.(sport);
|
|
18058
18158
|
}, [coolOff, onCoolOff, sport]);
|
|
18059
18159
|
if (coolOff) return null;
|
|
@@ -18248,14 +18348,10 @@ function GamesOptions({ options, ui }) {
|
|
|
18248
18348
|
|
|
18249
18349
|
// src/components/BuilderPanel.tsx
|
|
18250
18350
|
var import_jsx_runtime150 = require("react/jsx-runtime");
|
|
18251
|
-
function BuilderPanel({ options, sport, onSportChange, ui, slip, onCoolOff
|
|
18351
|
+
function BuilderPanel({ options, sport, onSportChange, ui, slip, onCoolOff }) {
|
|
18252
18352
|
const ctx = usePersonalGreeting();
|
|
18253
18353
|
const scope = useSportScope();
|
|
18254
18354
|
const active = options.find((o) => o.sport === sport) ?? options[0];
|
|
18255
|
-
const handingOff = active?.keepMarket === true;
|
|
18256
|
-
(0, import_react118.useEffect)(() => {
|
|
18257
|
-
if (handingOff) onHandOffMounted?.();
|
|
18258
|
-
}, [handingOff]);
|
|
18259
18355
|
if (!active) return null;
|
|
18260
18356
|
return /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("div", { className: "ss-w-mon-list ss-w-builder-tab", children: [
|
|
18261
18357
|
options.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime150.jsx)("div", { className: "ss-w-dash-sports", role: "group", "aria-label": ui.sportGroupLabel, children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
|
|
@@ -18276,7 +18372,6 @@ function BuilderPanel({ options, sport, onSportChange, ui, slip, onCoolOff, onHa
|
|
|
18276
18372
|
ui,
|
|
18277
18373
|
conversation: ctx?.conversation ?? null,
|
|
18278
18374
|
memory: ctx?.memory,
|
|
18279
|
-
keepMarket: active.keepMarket,
|
|
18280
18375
|
slip,
|
|
18281
18376
|
sport: active.sport,
|
|
18282
18377
|
operatorUserId: scope?.operatorUserId,
|
|
@@ -19082,7 +19177,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
19082
19177
|
}
|
|
19083
19178
|
}
|
|
19084
19179
|
),
|
|
19085
|
-
tabs && tabs.activeTab === "builder" && hasBuilder && builder && /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(BuilderPanel, { options: builder.options, sport: builder.sport, onSportChange: builder.onSportChange, ui, slip, onCoolOff: builder.onCoolOff
|
|
19180
|
+
tabs && tabs.activeTab === "builder" && hasBuilder && builder && /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(BuilderPanel, { options: builder.options, sport: builder.sport, onSportChange: builder.onSportChange, ui, slip, onCoolOff: builder.onCoolOff }),
|
|
19086
19181
|
monitor && monitor.activeTab === "following" && /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(MatchesPanel, { monitor, ui, slip, onAsk: paused ? void 0 : handleAsk, discovery }),
|
|
19087
19182
|
monitor && monitor.activeTab === "trends" && /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(TrendsPanel, { monitor, ui, slip }),
|
|
19088
19183
|
monitor && monitor.activeTab === "fixtures" && /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(Fixtures, { fixtures: clubFixturesResult?.fixtures ?? [], loading: clubFixturesResult?.loading ?? false, ui }),
|
|
@@ -19161,6 +19256,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
19161
19256
|
.ss-w-root, .ss-w-root * { box-sizing: border-box; margin: 0; padding: 0; }
|
|
19162
19257
|
.ss-w-root {
|
|
19163
19258
|
--ss-w-accent: #17936a;
|
|
19259
|
+
--ss-w-pill: var(--ss-w-pill-light, color-mix(in srgb, var(--ss-w-accent) 72%, #000)); --ss-w-on-accent: var(--ss-w-on-pill-light, #fff);
|
|
19164
19260
|
--ss-w-cta: #f5a623; --ss-w-cta-ink: #1b1300;
|
|
19165
19261
|
--ss-w-ink: #14181d; --ss-w-faint: #6b7580; --ss-w-line: #e4e8ec;
|
|
19166
19262
|
--ss-w-panel: #ffffff; --ss-w-bubble: #f3f5f7; --ss-w-nav: #0e1622;
|
|
@@ -19174,6 +19270,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
19174
19270
|
@media (prefers-color-scheme: dark) {
|
|
19175
19271
|
.ss-w-root[data-ss-w-theme="auto"] {
|
|
19176
19272
|
--ss-w-accent: #37c891; --ss-w-cta: #ffb638; --ss-w-cta-ink: #1b1300;
|
|
19273
|
+
--ss-w-pill: var(--ss-w-pill-dark, var(--ss-w-accent)); --ss-w-on-accent: var(--ss-w-on-pill-dark, #06231a);
|
|
19177
19274
|
--ss-w-ink: #e8edf2; --ss-w-faint: #8b95a1;
|
|
19178
19275
|
--ss-w-line: #2a3441; --ss-w-panel: #141b24; --ss-w-bubble: #1e2732; --ss-w-nav: #0a0f16;
|
|
19179
19276
|
--ss-w-pos: #37c891; --ss-w-neg: #f0655d; --ss-w-warn: #e0a030;
|
|
@@ -19183,6 +19280,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
19183
19280
|
}
|
|
19184
19281
|
.ss-w-root[data-ss-w-theme="dark"] {
|
|
19185
19282
|
--ss-w-accent: #37c891; --ss-w-cta: #ffb638; --ss-w-cta-ink: #1b1300;
|
|
19283
|
+
--ss-w-pill: var(--ss-w-pill-dark, var(--ss-w-accent)); --ss-w-on-accent: var(--ss-w-on-pill-dark, #06231a);
|
|
19186
19284
|
--ss-w-ink: #e8edf2; --ss-w-faint: #8b95a1;
|
|
19187
19285
|
--ss-w-line: #2a3441; --ss-w-panel: #141b24; --ss-w-bubble: #1e2732; --ss-w-nav: #0a0f16;
|
|
19188
19286
|
--ss-w-pos: #37c891; --ss-w-neg: #f0655d; --ss-w-warn: #e0a030;
|
|
@@ -19191,6 +19289,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
19191
19289
|
}
|
|
19192
19290
|
.ss-w-root[data-ss-w-theme="light"] {
|
|
19193
19291
|
--ss-w-accent: #17936a; --ss-w-cta: #f5a623; --ss-w-cta-ink: #1b1300;
|
|
19292
|
+
--ss-w-pill: var(--ss-w-pill-light, color-mix(in srgb, var(--ss-w-accent) 72%, #000)); --ss-w-on-accent: var(--ss-w-on-pill-light, #fff);
|
|
19194
19293
|
--ss-w-ink: #14181d; --ss-w-faint: #6b7580;
|
|
19195
19294
|
--ss-w-line: #e4e8ec; --ss-w-panel: #ffffff; --ss-w-bubble: #f3f5f7; --ss-w-nav: #0e1622;
|
|
19196
19295
|
--ss-w-home: #3a63a8; --ss-w-away: #c8102e; --ss-w-track: #e9edf1;
|
|
@@ -19311,20 +19410,20 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
19311
19410
|
.ss-w-root[data-ss-w-pos="left"] .ss-w-fab-wrap { left: var(--ss-w-offset-x); align-items: flex-start; }
|
|
19312
19411
|
.ss-w-fab { width: 56px; height: 56px; border: none; border-radius: 50%; background: var(--ss-w-nav); color: #fff; cursor: pointer; display: grid; place-items: center; box-shadow: 0 6px 20px rgba(0,0,0,.28); }
|
|
19313
19412
|
.ss-w-fab-mark { width: 30px; height: 30px; display: block; object-fit: contain; }
|
|
19314
|
-
.ss-w-greeting { max-width:
|
|
19413
|
+
.ss-w-greeting { max-width: 300px; display: flex; align-items: flex-start; background: var(--ss-w-panel); color: var(--ss-w-ink); border: 1px solid var(--ss-w-line); border-radius: 18px; box-shadow: 0 4px 14px rgba(0,0,0,.14); }
|
|
19315
19414
|
.ss-w-greeting-body { position: relative; flex: 1; min-width: 0; text-align: left; background: none; border: none; color: inherit; font: inherit; cursor: pointer; padding: 9px 4px 9px 12px; }
|
|
19316
19415
|
.ss-w-greeting-x { flex: none; background: none; border: none; color: var(--ss-w-faint); cursor: pointer; font-size: 17px; line-height: 1; padding: 7px 9px 0 2px; }
|
|
19317
|
-
.ss-w-greeting-text { display: block; }
|
|
19416
|
+
.ss-w-greeting-text { display: block; font-size: 14px; line-height: 1.45; }
|
|
19417
|
+
.ss-w-greeting-game { display: block; font-size: 13px; font-weight: 600; color: var(--ss-w-faint); }
|
|
19418
|
+
.ss-w-greeting-pick .ss-w-v2-row { border: 0; padding: 0; min-height: 44px; font-size: 15px; font-weight: 600; background: none; }
|
|
19318
19419
|
/* Bubble asks (onboarding presets, spec C6): the line stays one button, the asks stack under it as
|
|
19319
|
-
sibling buttons.
|
|
19320
|
-
153 px (TR) at 12px/600, measured 2026-10-04. A longer label wraps, never an ellipsis. */
|
|
19420
|
+
sibling buttons. A longer label wraps, never an ellipsis. */
|
|
19321
19421
|
.ss-w-greeting--asks { flex-direction: column; align-items: stretch; }
|
|
19322
19422
|
.ss-w-greeting-top { display: flex; align-items: flex-start; }
|
|
19323
19423
|
.ss-w-greeting-asks { display: flex; flex-direction: column; gap: 6px; padding: 0 10px 10px; }
|
|
19324
19424
|
.ss-w-greeting-ask { min-height: 44px; width: 100%; text-align: left; font: inherit; font-size: 12px; font-weight: 600; line-height: 1.3; color: var(--ss-w-accent); background: color-mix(in srgb, var(--ss-w-accent) 8%, var(--ss-w-panel)); border: 1px solid color-mix(in srgb, var(--ss-w-accent) 35%, var(--ss-w-line)); border-radius: 10px; padding: 6px 10px; cursor: pointer; white-space: normal; overflow-wrap: anywhere; }
|
|
19325
|
-
.ss-w-greeting-cta { min-height: 44px; width: 100%; text-align: center; font: inherit; font-size:
|
|
19425
|
+
.ss-w-greeting-cta { min-height: 44px; width: 100%; text-align: center; font: inherit; font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--ss-w-on-accent); background: var(--ss-w-pill); border: 0; border-radius: 12px; padding: 6px 10px; cursor: pointer; white-space: normal; overflow-wrap: anywhere; }
|
|
19326
19426
|
.ss-w-greeting-cta:focus-visible { outline: 2px solid var(--ss-w-accent); outline-offset: 2px; }
|
|
19327
|
-
.ss-w-greeting-price { display: flex; flex-direction: column; gap: 4px; }
|
|
19328
19427
|
.ss-w-greeting-ask:hover { border-color: var(--ss-w-accent); }
|
|
19329
19428
|
.ss-w-greeting-ask:focus-visible { outline: 2px solid var(--ss-w-accent); outline-offset: 2px; }
|
|
19330
19429
|
/* Typing indicator: overlays the text area so bubble height stays put; hidden at
|
|
@@ -20807,38 +20906,38 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
20807
20906
|
.ss-w-v8-since-line { margin: 0; font-size: 13px; line-height: 1.35; color: var(--ss-w-ink); overflow-wrap: anywhere; }
|
|
20808
20907
|
.ss-w-v8-since-line::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--ss-w-accent); vertical-align: 2px; }
|
|
20809
20908
|
.ss-w-v2 { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
|
|
20810
|
-
.ss-w-v2-featured { border-color: color-mix(in srgb, var(--ss-w-accent) 40%, var(--ss-w-line)); }
|
|
20811
20909
|
.ss-w-v2-featured[data-highlight="true"] { box-shadow: 0 0 0 2px var(--ss-w-accent); animation: ss-w-v2-pulse 1s ease-in-out 2; }
|
|
20812
20910
|
@keyframes ss-w-v2-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ss-w-accent) 35%, transparent); } }
|
|
20813
|
-
.ss-w-v2-teams { display: flex; flex-direction: column; gap: 2px; }
|
|
20814
|
-
.ss-w-v2-team { display: flex; align-items: center; gap: 4px; min-width: 0; }
|
|
20815
|
-
.ss-w-v2-star { flex: none; min-width: 32px; min-height: 32px; padding: 0; border: 0; background: transparent; font: inherit; font-size: 16px; line-height: 1; color: var(--ss-w-accent); cursor: pointer; }
|
|
20816
|
-
.ss-w-v2-star:focus-visible { outline: 2px solid var(--ss-w-accent); outline-offset: 2px; border-radius: 8px; }
|
|
20817
20911
|
.ss-w-v2-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; min-width: 0; }
|
|
20818
20912
|
.ss-w-v2-market { min-width: 0; font-size: 12px; font-weight: 600; line-height: 1.25; color: var(--ss-w-faint); overflow-wrap: anywhere; }
|
|
20819
20913
|
.ss-w-v2-tag { flex: 0 1 auto; padding: 2px 7px; border-radius: 6px; background: color-mix(in srgb, var(--ss-w-accent) 14%, var(--ss-w-panel)); color: var(--ss-w-ink); font-size: 11px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
|
|
20820
|
-
.ss-w-v2-
|
|
20821
|
-
.ss-w-
|
|
20822
|
-
.ss-w-
|
|
20823
|
-
.ss-w-v2-
|
|
20914
|
+
.ss-w-v2-stat { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ss-w-ink); overflow-wrap: anywhere; }
|
|
20915
|
+
.ss-w-pill { display: inline-flex; align-items: center; gap: 4px; background: var(--ss-w-pill); color: var(--ss-w-on-accent); border-radius: 999px; padding: 4px 11px 4px 7px; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
|
|
20916
|
+
.ss-w-pill svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 3; fill: none; }
|
|
20917
|
+
.ss-w-v2-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
|
|
20918
|
+
.ss-w-v2-tiles[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
20919
|
+
.ss-w-v2-tile { min-height: 66px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 8px 4px; border: 1.5px solid var(--ss-w-pill); border-radius: 12px; background: var(--ss-w-panel); box-shadow: 0 2px 0 color-mix(in srgb, var(--ss-w-pill) 25%, var(--ss-w-panel)); font: inherit; font-size: 13px; font-weight: 500; color: var(--ss-w-ink); text-align: center; overflow-wrap: anywhere; cursor: pointer; }
|
|
20920
|
+
.ss-w-v2-row { width: 100%; min-height: 46px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px 6px 12px; border: 1px solid var(--ss-w-line); border-radius: 10px; background: var(--ss-w-panel); font: inherit; font-size: 14px; font-weight: 500; color: var(--ss-w-ink); text-align: start; overflow-wrap: anywhere; cursor: pointer; }
|
|
20921
|
+
.ss-w-v2-tile:disabled, .ss-w-v2-row:disabled { opacity: 0.6; cursor: default; }
|
|
20922
|
+
.ss-w-v2-tile:focus-visible, .ss-w-v2-row:focus-visible, .ss-w-v2-mkt:focus-visible { outline: 2px solid var(--ss-w-accent); outline-offset: 2px; }
|
|
20923
|
+
.ss-w-v2-fact { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--ss-w-bubble); }
|
|
20924
|
+
.ss-w-v2-fact p { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ss-w-ink); overflow-wrap: anywhere; }
|
|
20925
|
+
.ss-w-v2-title { margin: 0; flex: 1 1 0; min-width: 0; font-size: 19px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
|
|
20926
|
+
.ss-w-v2-meta { margin: -6px 0 0; font-size: 13px; color: var(--ss-w-faint); overflow-wrap: anywhere; }
|
|
20927
|
+
.ss-w-v2-mkt { min-height: 36px; display: inline-flex; align-items: center; gap: 4px; padding: 0 10px 0 12px; border: 1px solid var(--ss-w-line); border-radius: 999px; background: var(--ss-w-panel); font: inherit; font-size: 14px; font-weight: 600; color: var(--ss-w-ink); cursor: pointer; }
|
|
20928
|
+
.ss-w-v2-hint { margin: 0; font-size: 12px; color: var(--ss-w-faint); }
|
|
20929
|
+
.ss-w-v2-hello { margin: 0; padding: 10px 13px; border-radius: 4px 16px 16px 16px; background: color-mix(in srgb, var(--ss-w-accent) 8%, var(--ss-w-panel)); font-size: 15px; line-height: 1.5; color: var(--ss-w-ink); overflow-wrap: anywhere; }
|
|
20824
20930
|
.ss-w-v2 .ss-w-toast { position: static; width: auto; max-width: none; box-shadow: none; }
|
|
20825
20931
|
.ss-w-v2-gone { margin: 0; font-size: 12.5px; line-height: 1.35; color: var(--ss-w-ink); overflow-wrap: anywhere; }
|
|
20826
|
-
.ss-w-v2-
|
|
20827
|
-
.ss-w-v2-
|
|
20828
|
-
.ss-w-v2-strip-row, .ss-w-v2-alt-row { gap: 6px; padding: 8px 12px; }
|
|
20932
|
+
.ss-w-v2-alts { gap: 6px; }
|
|
20933
|
+
.ss-w-v2-alt-row { gap: 6px; padding: 8px 12px; }
|
|
20829
20934
|
.ss-w-v2-chips .ss-w-v8-chip { font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
|
|
20830
20935
|
.ss-w-v2-chips .ss-w-v8-chip:focus-visible { outline: 2px solid var(--ss-w-accent); outline-offset: 2px; }
|
|
20831
|
-
.ss-w-v2-chooser { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--ss-w-ink); overflow-wrap: anywhere; }
|
|
20832
20936
|
.ss-w-v2-picker { gap: 6px; }
|
|
20833
|
-
.ss-w-v2-picker-title { margin: 0; font-size: 11.5px; font-weight: 600; color: var(--ss-w-faint); }
|
|
20834
20937
|
.ss-w-v2-picker-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
|
|
20835
20938
|
.ss-w-v2-picker-row { display: flex; flex-direction: column; align-items: stretch; gap: 4px; width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--ss-w-line); border-radius: 12px; background: var(--ss-w-panel); font: inherit; text-align: start; color: var(--ss-w-ink); cursor: pointer; }
|
|
20836
20939
|
.ss-w-v2-picker-row[aria-current="true"] { border-color: var(--ss-w-accent); }
|
|
20837
20940
|
.ss-w-v2-picker-row:focus-visible { outline: 2px solid var(--ss-w-accent); outline-offset: 2px; }
|
|
20838
|
-
.ss-w-v2-picker-prices { display: flex; flex-wrap: wrap; gap: 4px 12px; min-width: 0; font-size: 12.5px; }
|
|
20839
|
-
.ss-w-v2-picker-price { display: inline-flex; gap: 6px; min-width: 0; }
|
|
20840
|
-
.ss-w-v2-picker-price .ss-w-mol-lab, .ss-w-v2-picker-price .ss-w-mol-tick { font-size: 12.5px; }
|
|
20841
|
-
.ss-w-v2-picker-price .ss-w-mol-lab { color: var(--ss-w-ink); }
|
|
20842
20941
|
@media (prefers-reduced-motion: no-preference) { .ss-w-v2-picker-row { transition: border-color 120ms ease; } }
|
|
20843
20942
|
|
|
20844
20943
|
/* guess */
|
|
@@ -20854,6 +20953,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
20854
20953
|
/* team and player cards */
|
|
20855
20954
|
.ss-w-v8-cards { gap: 8px; }
|
|
20856
20955
|
.ss-w-v8-card { display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 10px 12px; border: 1px solid var(--ss-w-line); border-radius: 14px; background: var(--ss-w-panel); }
|
|
20956
|
+
.ss-w-v2-featured.ss-w-v8-card { border-color: color-mix(in srgb, var(--ss-w-accent) 40%, var(--ss-w-line)); gap: 10px; padding: 14px 16px; border-radius: 16px; }
|
|
20857
20957
|
.ss-w-v8-team { border-color: color-mix(in srgb, var(--ss-w-accent) 40%, var(--ss-w-line)); }
|
|
20858
20958
|
.ss-w-v8-card-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 2px 8px; min-width: 0; }
|
|
20859
20959
|
.ss-w-v8-card-name { flex: 1 1 0; min-width: 0; font-size: 14.5px; font-weight: 650; line-height: 1.2; color: var(--ss-w-ink); overflow-wrap: anywhere; }
|
|
@@ -20886,8 +20986,10 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
20886
20986
|
.ss-w-v8-card-lead { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
|
|
20887
20987
|
.ss-w-v8-card-mkt { min-width: 0; font-size: 11.5px; font-weight: 600; line-height: 1.25; color: var(--ss-w-faint); overflow-wrap: anywhere; }
|
|
20888
20988
|
.ss-w-v8-card-row .ss-w-slip { flex: none; max-width: 70%; }
|
|
20889
|
-
.ss-w-v8-card-row .ss-w-slip-btn.ss-w-slip-btn--price { padding: 5px 8px; white-space: normal; }
|
|
20890
|
-
.ss-w-v8-card-row .ss-w-slip-btn--price .ss-w-mol-lab { text-wrap: balance; }
|
|
20989
|
+
.ss-w-v8-card-row .ss-w-slip-btn.ss-w-slip-btn--price { padding: 5px 8px; white-space: normal; background: var(--ss-w-pill); color: var(--ss-w-on-accent); border-color: transparent; border-radius: 999px; }
|
|
20990
|
+
.ss-w-v8-card-row .ss-w-slip-btn--price .ss-w-mol-lab { text-wrap: balance; color: var(--ss-w-on-accent); }
|
|
20991
|
+
.ss-w-v8-card-row .ss-w-slip-btn.ss-w-slip-btn--price[data-settled] { background: var(--ss-w-panel); color: var(--ss-w-faint); border-color: var(--ss-w-line); }
|
|
20992
|
+
.ss-w-v8-card-row .ss-w-slip-btn--price[data-settled] .ss-w-mol-lab { color: var(--ss-w-faint); }
|
|
20891
20993
|
.ss-w-v8-card-asof { min-width: 0; font-size: 10.5px; line-height: 1.25; color: var(--ss-w-faint); overflow-wrap: anywhere; }
|
|
20892
20994
|
.ss-w-v8-card-line--pending { min-height: 39.5px; border-radius: 10px; background: color-mix(in srgb, var(--ss-w-faint) 12%, var(--ss-w-panel)); }
|
|
20893
20995
|
.ss-w-v8-hit-row { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
|
|
@@ -22244,12 +22346,6 @@ function StatsWidget(props) {
|
|
|
22244
22346
|
return sports.includes(sport) ? prev : { greeting: builderGreeting, sports: [...sports, sport] };
|
|
22245
22347
|
});
|
|
22246
22348
|
}, [builderGreeting]);
|
|
22247
|
-
const [handOffPending, setHandOffPending] = (0, import_react122.useState)(false);
|
|
22248
|
-
const consumeHandOff = (0, import_react122.useCallback)(() => setHandOffPending(false), []);
|
|
22249
|
-
const openTabFromChip = (0, import_react122.useCallback)((tab) => {
|
|
22250
|
-
if (tab === "builder") setHandOffPending(true);
|
|
22251
|
-
monitor.setActiveTab(tab);
|
|
22252
|
-
}, [monitor.setActiveTab]);
|
|
22253
22349
|
const builderOptions = (0, import_react122.useMemo)(() => {
|
|
22254
22350
|
const greeting = builderGreeting;
|
|
22255
22351
|
if (!greeting) return [];
|
|
@@ -22257,7 +22353,7 @@ function StatsWidget(props) {
|
|
|
22257
22353
|
const sets = switchSets(greeting.greetingDashboards);
|
|
22258
22354
|
const optionFor = (sport, label, d) => {
|
|
22259
22355
|
const handOff = d?.marketFirst?.builder;
|
|
22260
|
-
if (handOff) return [{ sport, label, preset: handOff
|
|
22356
|
+
if (handOff) return [{ sport, label, preset: handOff }];
|
|
22261
22357
|
return d?.personal?.builder ? [{ sport, label, preset: d.personal.builder }] : [];
|
|
22262
22358
|
};
|
|
22263
22359
|
const options = sets ? sets.flatMap((s) => optionFor(s.sport, s.label, s.dashboard)) : (() => {
|
|
@@ -22265,7 +22361,7 @@ function StatsWidget(props) {
|
|
|
22265
22361
|
return optionFor(sport, sportLabel(ui, sport), greeting.greetingDashboard);
|
|
22266
22362
|
})();
|
|
22267
22363
|
return options.filter((o) => !cooled.includes(o.sport));
|
|
22268
|
-
}, [builderGreeting, coolOff, ui
|
|
22364
|
+
}, [builderGreeting, coolOff, ui]);
|
|
22269
22365
|
const builderSport = [builderSportPick, rememberedSport, latestGreeting?.defaultSport].find((s) => !!s && builderOptions.some((o) => o.sport === s)) ?? builderOptions[0]?.sport ?? "";
|
|
22270
22366
|
const [panelEverOpened, setPanelEverOpened] = (0, import_react122.useState)(panelOpen);
|
|
22271
22367
|
if (panelOpen && !panelEverOpened) setPanelEverOpened(true);
|
|
@@ -22340,13 +22436,25 @@ function StatsWidget(props) {
|
|
|
22340
22436
|
});
|
|
22341
22437
|
const onCtaRef = (0, import_react122.useRef)(() => {
|
|
22342
22438
|
});
|
|
22439
|
+
const onTeaserTapRef = (0, import_react122.useRef)(() => {
|
|
22440
|
+
});
|
|
22441
|
+
const bubble = controller.state.greetingBubble;
|
|
22442
|
+
const bubblePrice = !stringsPending && controller.state.popupText && bubble?.price && bubble.matchId ? { matchId: bubble.matchId, price: bubble.price, sport: bubble.sport } : null;
|
|
22443
|
+
const bubbleGame = !stringsPending && controller.state.popupText && bubble?.game ? instantMs(bubble.startsAtUtc) === null ? bubble.game : ui.v2GameLine(bubble.game, bubble.startsAtUtc) : void 0;
|
|
22343
22444
|
const bubbleCta = controller.state.popupText ? controller.state.greetingBubble?.cta ?? null : null;
|
|
22344
22445
|
const mobile = useMobileBinding({
|
|
22345
22446
|
binding: props.mobile,
|
|
22346
22447
|
panelOpen,
|
|
22347
22448
|
popupText: controller.state.popupText,
|
|
22348
22449
|
cta: bubbleCta,
|
|
22450
|
+
price: bubblePrice ? {
|
|
22451
|
+
matchOddsId: bubblePrice.price.selection.matchOddsId,
|
|
22452
|
+
marketLabel: bubblePrice.price.marketLabel,
|
|
22453
|
+
label: bubblePrice.price.selection.label,
|
|
22454
|
+
odds: formatOdds(bubblePrice.price.selection.formats, oddsSettings.oddsFormat)
|
|
22455
|
+
} : null,
|
|
22349
22456
|
onCta: () => onCtaRef.current(),
|
|
22457
|
+
onTeaserTap: () => onTeaserTapRef.current(),
|
|
22350
22458
|
asks,
|
|
22351
22459
|
open: controller.open,
|
|
22352
22460
|
close: controller.close,
|
|
@@ -22355,7 +22463,7 @@ function StatsWidget(props) {
|
|
|
22355
22463
|
const dismissPopup = usePopupTelemetry(logger, panelOpen, controller.state.popupText, controller.dismissPopup, mobile.confirmedShown);
|
|
22356
22464
|
dismissPopupRef.current = dismissPopup;
|
|
22357
22465
|
const greetingMeta = latestGreetingMeta(controller.state.messages);
|
|
22358
|
-
useBubbleGreetingShown(logger, logger ?? NO_OWNER, controller.state.popupText,
|
|
22466
|
+
useBubbleGreetingShown(logger, logger ?? NO_OWNER, controller.state.popupText, greetingMeta, mobile.confirmedShown);
|
|
22359
22467
|
const [highlight, setHighlight] = (0, import_react122.useState)(null);
|
|
22360
22468
|
const clearHighlight = (0, import_react122.useCallback)(() => setHighlight(null), []);
|
|
22361
22469
|
(0, import_react122.useEffect)(() => {
|
|
@@ -22375,6 +22483,12 @@ function StatsWidget(props) {
|
|
|
22375
22483
|
const matchId = greetingBubble?.matchId;
|
|
22376
22484
|
if (matchId) setHighlight((prev) => ({ matchId, token: (prev?.token ?? 0) + 1 }));
|
|
22377
22485
|
};
|
|
22486
|
+
onTeaserTapRef.current = () => {
|
|
22487
|
+
if (!controller.state.popupText) return;
|
|
22488
|
+
track({ name: "bubble_click" });
|
|
22489
|
+
if (!bubbleCta) logCtaClick();
|
|
22490
|
+
openFromCta();
|
|
22491
|
+
};
|
|
22378
22492
|
const onCta = (0, import_react122.useCallback)(() => onCtaRef.current(), []);
|
|
22379
22493
|
useOpenTelemetry(logger, panelOpen);
|
|
22380
22494
|
const onControlRef = (0, import_react122.useRef)(props.onControl);
|
|
@@ -22431,14 +22545,15 @@ function StatsWidget(props) {
|
|
|
22431
22545
|
favourites: favouritesEnabled && monitor.enabled ? favourites : null,
|
|
22432
22546
|
conversation: built?.conversation ?? null,
|
|
22433
22547
|
openFavourites: () => setFavouritesOpen(true),
|
|
22434
|
-
openTab:
|
|
22548
|
+
openTab: monitor.setActiveTab,
|
|
22435
22549
|
// Not before the club probe has answered: a club brand has no Favourites sheet, and the invite must not appear and then go.
|
|
22436
22550
|
favouritesOffered: favouritesEnabled && monitor.enabled && clubFixturesResult.settled && !clubFixturesResult.enabled,
|
|
22437
22551
|
// The sheet is offered, so a link to it opens it: the probe is out for at most CLUB_TAB_WAIT_MS before it is.
|
|
22438
22552
|
favouritesReady: favouritesEnabled && monitor.enabled && clubFixturesResult.tabReady && !clubFixturesResult.enabled,
|
|
22439
22553
|
holds,
|
|
22440
|
-
memory: builderMemory
|
|
22441
|
-
|
|
22554
|
+
memory: builderMemory,
|
|
22555
|
+
monitor: monitor.enabled ? monitor : void 0
|
|
22556
|
+
}), [monitor, favouritesEnabled, monitor.enabled, monitor.setActiveTab, clubFixturesResult.settled, clubFixturesResult.tabReady, clubFixturesResult.enabled, favourites, built, holds, builderMemory]);
|
|
22442
22557
|
if (!built || widgetStrings.state === "unavailable") return null;
|
|
22443
22558
|
const attrs = themeAttrs(ui, oddsSettings.userTheme);
|
|
22444
22559
|
return /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(EventLogContext.Provider, { value: logger, children: /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(TrackingContext.Provider, { value: track, children: /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(SportScopeContext.Provider, { value: sportScope, children: /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(OddsSettingsContext.Provider, { value: oddsSettings, children: /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(HostEventsProvider, { value: hostEvents, children: /* @__PURE__ */ (0, import_jsx_runtime162.jsx)("div", { ref: rootRef, className: "ss-w-root", "data-ss-w-theme": attrs["data-ss-w-theme"], "data-ss-w-pos": attrs["data-ss-w-pos"], "data-ss-w-mobile": props.mobile ? "" : void 0, style: attrs.style, children: panelOpen ? /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(PersonalGreetingContext.Provider, { value: personalGreeting, children: /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(GreetingHighlightContext.Provider, { value: highlightRequest, children: /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
|
|
@@ -22473,11 +22588,25 @@ function StatsWidget(props) {
|
|
|
22473
22588
|
presetGrid,
|
|
22474
22589
|
favouritesEnabled: favouritesEnabled && clubFixturesResult.tabReady && !clubFixturesResult.enabled,
|
|
22475
22590
|
favourites: { controller: favourites, sport: favSport, sports: favSports, onSportChange: setFavSportPick, open: favouritesOpen, onOpenChange: setFavouritesOpen },
|
|
22476
|
-
builder: { options: builderOptions, sport: builderSport, onSportChange: setBuilderSportPick, onCoolOff: onBuilderCoolOff,
|
|
22591
|
+
builder: { options: builderOptions, sport: builderSport, onSportChange: setBuilderSportPick, onCoolOff: onBuilderCoolOff, tabs: monitor },
|
|
22477
22592
|
onCloseRequested: mobile.onCloseRequested,
|
|
22478
22593
|
onRegisterBack: mobile.onRegisterBack
|
|
22479
22594
|
}
|
|
22480
|
-
) }) }) : props.mobile ?
|
|
22595
|
+
) }) }) : props.mobile ? bubblePrice && mobile.onRegisterPrice && mobile.onPriceResult && mobile.priceInFlight ? /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
|
|
22596
|
+
MobileBubblePrice,
|
|
22597
|
+
{
|
|
22598
|
+
matchId: bubblePrice.matchId,
|
|
22599
|
+
price: bubblePrice.price,
|
|
22600
|
+
conversation: built?.conversation ?? null,
|
|
22601
|
+
slip,
|
|
22602
|
+
ui,
|
|
22603
|
+
hook: hookOf(greetingMeta),
|
|
22604
|
+
sport: bubblePrice.sport,
|
|
22605
|
+
inFlight: mobile.priceInFlight,
|
|
22606
|
+
onRegister: mobile.onRegisterPrice,
|
|
22607
|
+
onResult: mobile.onPriceResult
|
|
22608
|
+
}
|
|
22609
|
+
) : null : /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
|
|
22481
22610
|
ChatFab,
|
|
22482
22611
|
{
|
|
22483
22612
|
label: stringsPending ? cfg?.launcherLabel : ui.launcherLabel,
|
|
@@ -22492,18 +22621,19 @@ function StatsWidget(props) {
|
|
|
22492
22621
|
onIntroStart: markIntroDone,
|
|
22493
22622
|
asks,
|
|
22494
22623
|
cta: bubbleCta ?? void 0,
|
|
22624
|
+
game: bubbleGame,
|
|
22495
22625
|
onCta,
|
|
22496
22626
|
onBubbleClick: logCtaClick,
|
|
22497
|
-
price:
|
|
22627
|
+
price: bubblePrice ? /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(
|
|
22498
22628
|
BubblePrice,
|
|
22499
22629
|
{
|
|
22500
|
-
matchId:
|
|
22501
|
-
price:
|
|
22630
|
+
matchId: bubblePrice.matchId,
|
|
22631
|
+
price: bubblePrice.price,
|
|
22502
22632
|
conversation: built?.conversation ?? null,
|
|
22503
22633
|
slip,
|
|
22504
22634
|
ui,
|
|
22505
22635
|
hook: hookOf(greetingMeta),
|
|
22506
|
-
sport:
|
|
22636
|
+
sport: bubblePrice.sport
|
|
22507
22637
|
}
|
|
22508
22638
|
) : void 0
|
|
22509
22639
|
}
|