@sensiblestats/widget-react 0.152.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/dist/index.cjs CHANGED
@@ -38,7 +38,7 @@ __export(index_exports, {
38
38
  module.exports = __toCommonJS(index_exports);
39
39
 
40
40
  // src/StatsWidget.tsx
41
- var import_react123 = require("react");
41
+ var import_react122 = require("react");
42
42
  var import_widget_sdk40 = require("@sensiblestats/widget-sdk");
43
43
 
44
44
  // src/strings/tag.ts
@@ -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": "{home} v {away}, {market}",
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) => (home, away, market) => c.t("widget.v2CardLabel", { home, away, market }),
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 ownedByLeaf = (key) => key.startsWith("widget.code.") || Object.keys(LEAVES).some((path) => key === `widget.${path}` || key.startsWith(`widget.${path}.`));
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 [key, row] of Object.entries(table)) {
1324
- if (key.startsWith("widget.") && typeof row === "string" && !ownedByLeaf(key)) setPath(root, key.slice("widget.".length), row);
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 = {}) => fill(table[key] ?? key, tokens, tag2)
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.152.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
- chooserShown: meta.chooserShown
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 import_react34 = require("react");
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 import_react27 = require("react");
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/Price.tsx
6056
- var import_react26 = require("react");
6057
-
6058
- // src/components/Toast.tsx
6059
- var import_react25 = require("react");
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 import_jsx_runtime7 = require("react/jsx-runtime");
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-star")) return;
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 PriceButtons({ selections, ui, onAdd }) {
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, import_react26.useState)(/* @__PURE__ */ new Set());
6083
- const [goneFor, setGoneFor] = (0, import_react26.useState)(null);
6084
- const [toast, setToast] = (0, import_react26.useState)(null);
6085
- const dismiss = (0, import_react26.useCallback)(() => setToast(null), []);
6086
- const inFlight2 = (0, import_react26.useRef)(/* @__PURE__ */ new Set());
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
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
6104
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "ss-w-v2-prices", children: selections.map((s) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { type: "button", className: "ss-w-slip-btn ss-w-slip-btn--price", disabled: busy.has(s.matchOddsId), onClick: onAdd ? () => {
6105
- void tap(s);
6106
- } : void 0, children: [
6107
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "ss-w-mol-lab", children: s.label }),
6108
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "ss-w-mol-tick", children: formatOdds(s.formats, oddsFormat) })
6109
- ] }, s.matchOddsId)) }),
6110
- goneFor === selections ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "ss-w-v2-gone", role: "status", children: ui.v2PriceGone }) : null,
6111
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(Toast, { toast: toast?.for === selections ? toast.toast : null, onDismiss: dismiss })
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 })
6305
+ ] });
6306
+ }
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 })
6112
6318
  ] });
6113
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
+ }
6114
6325
 
6115
6326
  // src/components/dashboard/v2/FeaturedCard.tsx
6116
- var import_jsx_runtime8 = require("react/jsx-runtime");
6117
- function Star({ team, ui }) {
6118
- const controller = usePersonalGreeting()?.favourites;
6119
- if (!controller || controller.status !== "ready") return null;
6120
- const on = controller.isStarred("team", team.id);
6121
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("button", { type: "button", className: "ss-w-v2-star", "aria-label": ui.v8Follow(team.label), "aria-pressed": on, onClick: () => {
6122
- void controller.toggle("team", team.id);
6123
- }, children: on ? "\u2605" : "\u2606" });
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": ui.v2CardLabel(card.home.label, card.away.label, card.marketLabel),
6341
+ "aria-label": label,
6135
6342
  onClickCapture: logRowTap(events, 0),
6136
6343
  children: [
6137
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("header", { className: "ss-w-v8-card-head", children: [
6138
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("b", { className: "ss-w-v8-card-name ss-w-v2-teams", children: [
6139
- /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)("span", { className: "ss-w-v2-team", children: [
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, import_jsx_runtime8.jsxs)("div", { className: "ss-w-v2-head", children: [
6151
- /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "ss-w-v2-market", children: card.marketLabel }),
6152
- card.yourMarket ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("span", { className: "ss-w-v2-tag", children: tag2 }) : null
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, import_jsx_runtime8.jsx)(PriceButtons, { selections: card.selections, ui, onAdd: add ? (s) => add(card.matchId, card.market, s, events?.hook) : void 0 }),
6155
- card.stat ? /* @__PURE__ */ (0, import_jsx_runtime8.jsx)("p", { className: "ss-w-v2-stat", children: card.stat }) : null
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 import_react33 = require("react");
6368
+ var import_react34 = require("react");
6226
6369
 
6227
6370
  // src/nflKickoff.ts
6228
- var import_react29 = require("react");
6229
- var import_widget_sdk16 = require("@sensiblestats/widget-sdk");
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, import_widget_sdk16.sportOf)(sport) === "americanfootball";
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, import_react29.useState)(0);
6399
+ const [tick, setTick] = (0, import_react30.useState)(0);
6257
6400
  const key = kickoffs.map((k) => k ?? "").join("|");
6258
- (0, import_react29.useEffect)(() => {
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 import_react32 = require("react");
6271
- var import_widget_sdk17 = require("@sensiblestats/widget-sdk");
6413
+ var import_react33 = require("react");
6414
+ var import_widget_sdk18 = require("@sensiblestats/widget-sdk");
6272
6415
 
6273
6416
  // src/trackingContext.ts
6274
- var import_react30 = require("react");
6417
+ var import_react31 = require("react");
6275
6418
  var noop = () => {
6276
6419
  };
6277
- var TrackingContext = (0, import_react30.createContext)(noop);
6420
+ var TrackingContext = (0, import_react31.createContext)(noop);
6278
6421
  function useTrack() {
6279
- return (0, import_react30.useContext)(TrackingContext);
6422
+ return (0, import_react31.useContext)(TrackingContext);
6280
6423
  }
6281
6424
 
6282
6425
  // src/slipStateContext.ts
6283
- var import_react31 = require("react");
6284
- var SlipStateContext = (0, import_react31.createContext)(null);
6426
+ var import_react32 = require("react");
6427
+ var SlipStateContext = (0, import_react32.createContext)(null);
6285
6428
  function useSlipState() {
6286
- return (0, import_react31.useContext)(SlipStateContext);
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, import_react32.useCallback)(async (selection, { marketDeveloperName, selectionLabel, line, fact, hook }) => {
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, import_widget_sdk17.toWireSport)(out.sport);
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, import_widget_sdk17.isAddToSlipResult)(raw)) throw new Error("malformed add-to-slip result");
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 import_widget_sdk18 = require("@sensiblestats/widget-sdk");
6522
+ var import_widget_sdk19 = require("@sensiblestats/widget-sdk");
6380
6523
  function slipSportOfWire(sport) {
6381
- const hit = Object.entries(import_widget_sdk18.SPORTS).find(([, spec]) => spec.wireKey === sport);
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, import_react33.useRef)(/* @__PURE__ */ new Map());
6422
- const guarded = (0, import_react33.useMemo)(() => {
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, import_react33.useCallback)(async (matchId, market, selection, hook) => {
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 import_jsx_runtime11 = require("react/jsx-runtime");
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, import_react34.useState)(null);
6481
- const [open, setOpen] = (0, import_react34.useState)(false);
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 chooser = !!card && card.chooser && pickedRow === null;
6486
- const rootRef = (0, import_react34.useRef)(null);
6487
- const [pickCount, setPickCount] = (0, import_react34.useState)(0);
6488
- (0, import_react34.useEffect)(() => {
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-slip-btn, .ss-w-v2-chips button")?.focus();
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, import_react34.useContext)(GreetingHighlightContext);
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 onChip = (c) => {
6506
- if (c === "another_market") setOpen(true);
6507
- else openTab?.(c === "live_games" ? "live" : "builder");
6508
- };
6509
- const chips = chipsFor(section2).filter((c) => {
6510
- if (c === "another_market") return (base?.otherMarkets.length ?? 0) > 0;
6511
- if (!openTab) return false;
6512
- return c !== "build_combo" || !!section2.builder;
6513
- });
6514
- return /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)("div", { className: "ss-w-v2", ref: rootRef, children: [
6515
- card && (chooser || open) ? /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_jsx_runtime11.Fragment, { children: [
6516
- chooser && section2.chooserPrompt ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("p", { className: "ss-w-v2-chooser", children: section2.chooserPrompt }) : null,
6517
- /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(MarketPicker, { markets: base?.otherMarkets ?? [], current: card.market, title: ui.v2AnotherMarketTitle, onPick: pick })
6518
- ] }) : null,
6519
- card ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FeaturedCard, { card, ui, tag: section2.yourMarketLabel, highlighted, add }) : null,
6520
- card ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(StripRows, { rows: card.strip, hide: pickedRow?.market, tag: section2.yourMarketLabel, ui, slotBase: STRIP_SLOT, matchId: card.matchId, add }) : null,
6521
- card && !section2.coolOff && pickedRow === null ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(AlternativeRows, { rows: section2.alternatives, market: card.market, add, marketLabel: card.marketLabel, ui, slotBase: ALT_SLOT }) : null,
6522
- section2.asks.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(AskCards, { asks: section2.asks, ui, ofYours: false, onAct }) : null,
6523
- section2.since.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(SinceLines, { since: section2.since, ui }) : null,
6524
- chips.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("div", { className: "ss-w-v8-chips ss-w-v2-chips", children: chips.map((c) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("button", { type: "button", className: "ss-w-v8-chip", onClick: () => onChip(c), children: CHIP_LABEL[c](ui) }, c)) }) : null
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 import_react35 = require("react");
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, import_react35.useState)(() => memory3 && conversation && initial2 ? memory3.cachedGrid(gridKey(locale, initial2)) : void 0);
6629
- const [grid, setGrid] = (0, import_react35.useState)(seed ?? null);
6630
- const [status2, setStatus] = (0, import_react35.useState)(seed ? "ready" : "idle");
6631
- const [confirmed, setConfirmed] = (0, import_react35.useState)(false);
6632
- const [answered, setAnswered] = (0, import_react35.useState)(seed && initial2 ? { req: initial2, locale } : null);
6633
- const seq = (0, import_react35.useRef)(0);
6634
- const mounted = (0, import_react35.useRef)(true);
6635
- const hung = (0, import_react35.useRef)(void 0);
6636
- const waiting = (0, import_react35.useRef)(null);
6637
- const memoryRef = (0, import_react35.useRef)(memory3);
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, import_react35.useCallback)((release, keep) => {
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, import_react35.useEffect)(() => {
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, import_react35.useCallback)(async (req) => {
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 import_react36 = require("react");
6731
- var import_jsx_runtime12 = require("react/jsx-runtime");
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, import_react36.useState)(false);
6734
- const [settledLocal, setSettledLocal] = (0, import_react36.useState)(false);
6735
- const [toast, setToast] = (0, import_react36.useState)(null);
6736
- const dismiss = (0, import_react36.useCallback)(() => setToast(null), []);
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, import_jsx_runtime12.jsxs)("div", { className: "ss-w-slip", children: [
6758
- price ? /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
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, import_jsx_runtime12.jsx)("span", { className: "ss-w-mol-tick", "aria-hidden": "true", children: "\u2713" }) : null,
6769
- price.label ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "ss-w-mol-lab", children: price.label }) : null,
6770
- /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("span", { className: price.valueClass, children: [
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, import_jsx_runtime12.jsx)(
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, import_jsx_runtime12.jsx)(Toast, { toast, onDismiss: dismiss })
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, import_jsx_runtime12.jsx)(
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 import_jsx_runtime13 = (
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, import_jsx_runtime13.jsxs)("span", { className: "ss-w-move", role: "img", "aria-label": label, children: [
6828
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-move-prev", "aria-hidden": "true", children: previous }),
6829
- /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", { className: "ss-w-move-arrow", "aria-hidden": "true", children: direction2 === "shortened" ? "\u25BC" : "\u25B2" })
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 import_react37 = require("react");
6835
- var import_jsx_runtime14 = require("react/jsx-runtime");
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, import_react37.useState)(false);
6981
+ const [failed, setFailed] = (0, import_react38.useState)(false);
6842
6982
  if (url && !failed) {
6843
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("img", { className: cls, src: url, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
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, import_jsx_runtime14.jsx)("span", { className: `${cls} ss-w-bi-crest-mono ss-w-bi-crest--abbr`, "aria-hidden": "true", children: abbr });
6846
- return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", { className: `${cls} ss-w-bi-crest-mono`, "aria-hidden": "true", children: initials(name) });
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 && !shown2.marketFirst ? /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("span", { className: "ss-w-dash-subtitle", children: shown2.subtitle }) : null
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,
@@ -8314,13 +8375,14 @@ function BrandMark({ logoUrl, className }) {
8314
8375
 
8315
8376
  // src/components/GreetingBubble.tsx
8316
8377
  var import_jsx_runtime35 = require("react/jsx-runtime");
8317
- function GreetingBubble({ text: text2, onOpen, onDismiss, dismissLabel, asks, cta, onCta, price }) {
8378
+ function GreetingBubble({ text: text2, game, onOpen, onDismiss, dismissLabel, asks, cta, onCta, price }) {
8318
8379
  const body = /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("button", { type: "button", className: "ss-w-greeting-body", onClick: onOpen, children: [
8319
8380
  /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("span", { className: "ss-w-greeting-dots", "aria-hidden": "true", children: [
8320
8381
  /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("i", {}),
8321
8382
  /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("i", {}),
8322
8383
  /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("i", {})
8323
8384
  ] }),
8385
+ game ? /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "ss-w-greeting-game", children: game }) : null,
8324
8386
  /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("span", { className: "ss-w-greeting-text", children: text2 })
8325
8387
  ] });
8326
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;
@@ -8346,7 +8408,7 @@ function GreetingBubble({ text: text2, onOpen, onDismiss, dismissLabel, asks, ct
8346
8408
 
8347
8409
  // src/components/ChatFab.tsx
8348
8410
  var import_jsx_runtime36 = require("react/jsx-runtime");
8349
- 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 }) {
8350
8412
  const bubble = popupText ?? greeting;
8351
8413
  const hidden = busy && !label;
8352
8414
  const track = useTrack();
@@ -8360,7 +8422,7 @@ function ChatFab({ label, busy = false, greeting, popupText, logoUrl, onOpen, on
8360
8422
  }
8361
8423
  }, [bubble, onIntroStart]);
8362
8424
  return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)("div", { className: intro ? "ss-w-fab-wrap ss-w-intro" : "ss-w-fab-wrap", children: [
8363
- 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: () => {
8364
8426
  track({ name: "bubble_click" });
8365
8427
  if (popupText && !cta) onBubbleClick?.();
8366
8428
  onOpen();
@@ -8378,10 +8440,7 @@ var import_jsx_runtime37 = require("react/jsx-runtime");
8378
8440
  function BubblePrice({ matchId, price, conversation, slip, ui, hook, sport }) {
8379
8441
  const selections = (0, import_react59.useMemo)(() => [price.selection], [price.selection]);
8380
8442
  const add = useRepriceAdd({ conversation, locale: ui.hostTag, slip, ui, sport });
8381
- return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("div", { className: "ss-w-greeting-price", children: [
8382
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("span", { className: "ss-w-v2-market", children: price.marketLabel }),
8383
- /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(PriceButtons, { selections, ui, onAdd: add ? (s) => add(matchId, price.market, s, hook) : void 0 })
8384
- ] });
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 }) });
8385
8444
  }
8386
8445
 
8387
8446
  // src/components/MobileBubblePrice.tsx
@@ -8418,7 +8477,7 @@ function MobileBubblePrice(props) {
8418
8477
  }
8419
8478
 
8420
8479
  // src/components/ChatPanel.tsx
8421
- var import_react122 = require("react");
8480
+ var import_react121 = require("react");
8422
8481
 
8423
8482
  // src/components/ChatHeader.tsx
8424
8483
  var import_react61 = require("react");
@@ -17859,9 +17918,6 @@ function FavouritesSheet({ ui, controller, sport, sports, onSportChange, onClose
17859
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 }) });
17860
17919
  }
17861
17920
 
17862
- // src/components/BuilderPanel.tsx
17863
- var import_react119 = require("react");
17864
-
17865
17921
  // src/components/dashboard/v8/SentenceBuilder.tsx
17866
17922
  var import_react118 = require("react");
17867
17923
  var import_widget_sdk39 = require("@sensiblestats/widget-sdk");
@@ -17898,16 +17954,15 @@ function openingGames(preset) {
17898
17954
  }
17899
17955
  var ALL_MARKETS = "*";
17900
17956
  var usableMarkets = (preset) => preset.marketOptions && preset.marketOptions.some((m) => m.key === preset.marketKey) ? preset.marketOptions : null;
17901
- function SentenceBuilder({ preset, ui, conversation, memory: memory3, keepMarket = false, slip, sport, operatorUserId, anonymousUserId, onCoolOff }) {
17957
+ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, sport, operatorUserId, anonymousUserId, onCoolOff }) {
17902
17958
  const { oddsFormat } = useOddsSettings();
17903
17959
  const totals = totalKeys(preset);
17904
17960
  const opening = openingGames(preset);
17905
17961
  const gamesOptions = opening.options;
17906
17962
  const marketOptions = usableMarkets(preset);
17907
17963
  const [fingerprint] = (0, import_react118.useState)(() => JSON.stringify(preset));
17908
- const [keepsMarket] = (0, import_react118.useState)(keepMarket);
17909
17964
  const [saved] = (0, import_react118.useState)(() => {
17910
- const kept = keepsMarket ? void 0 : memory3?.savedView(sport);
17965
+ const kept = memory3?.savedView(sport);
17911
17966
  return kept && kept.fingerprint === fingerprint ? kept : null;
17912
17967
  });
17913
17968
  const openingView = {
@@ -17915,7 +17970,7 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, keepMarket
17915
17970
  total: asTotal(preset.totalTarget, totals),
17916
17971
  custom: null,
17917
17972
  // All markets opens unless the visitor has a usual market, which is never beaten.
17918
- marketKey: marketOptions && !keepsMarket && !marketOptions.some((m) => m.usual) ? null : preset.marketKey,
17973
+ marketKey: marketOptions && !marketOptions.some((m) => m.usual) ? null : preset.marketKey,
17919
17974
  gamesId: opening.option?.id ?? null,
17920
17975
  matchIds: opening.option ? opening.option.matchIds : preset.matchIds,
17921
17976
  // The server never widens by itself: an all-games preset with no ids asks for it.
@@ -18293,14 +18348,10 @@ function GamesOptions({ options, ui }) {
18293
18348
 
18294
18349
  // src/components/BuilderPanel.tsx
18295
18350
  var import_jsx_runtime150 = require("react/jsx-runtime");
18296
- function BuilderPanel({ options, sport, onSportChange, ui, slip, onCoolOff, onHandOffMounted }) {
18351
+ function BuilderPanel({ options, sport, onSportChange, ui, slip, onCoolOff }) {
18297
18352
  const ctx = usePersonalGreeting();
18298
18353
  const scope = useSportScope();
18299
18354
  const active = options.find((o) => o.sport === sport) ?? options[0];
18300
- const handingOff = active?.keepMarket === true;
18301
- (0, import_react119.useEffect)(() => {
18302
- if (handingOff) onHandOffMounted?.();
18303
- }, [handingOff]);
18304
18355
  if (!active) return null;
18305
18356
  return /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)("div", { className: "ss-w-mon-list ss-w-builder-tab", children: [
18306
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)(
@@ -18321,7 +18372,6 @@ function BuilderPanel({ options, sport, onSportChange, ui, slip, onCoolOff, onHa
18321
18372
  ui,
18322
18373
  conversation: ctx?.conversation ?? null,
18323
18374
  memory: ctx?.memory,
18324
- keepMarket: active.keepMarket,
18325
18375
  slip,
18326
18376
  sport: active.sport,
18327
18377
  operatorUserId: scope?.operatorUserId,
@@ -18570,10 +18620,10 @@ function Squad({ squad, loading, ui, view, onToggleView, stats, statsLoading, se
18570
18620
  }
18571
18621
 
18572
18622
  // src/components/PlayerPhoto.tsx
18573
- var import_react120 = require("react");
18623
+ var import_react119 = require("react");
18574
18624
  var import_jsx_runtime155 = require("react/jsx-runtime");
18575
18625
  function PlayerPhoto({ photoUrl, jerseyNumber, size }) {
18576
- const [failed, setFailed] = (0, import_react120.useState)(false);
18626
+ const [failed, setFailed] = (0, import_react119.useState)(false);
18577
18627
  const box = { width: size, height: size };
18578
18628
  if (photoUrl && !failed) {
18579
18629
  return /* @__PURE__ */ (0, import_jsx_runtime155.jsx)("img", { className: "ss-w-pd-photo", style: box, src: photoUrl, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
@@ -18608,7 +18658,7 @@ function MiniPitch({ positionCode }) {
18608
18658
  }
18609
18659
 
18610
18660
  // src/components/PerformanceBars.tsx
18611
- var import_react121 = require("react");
18661
+ var import_react120 = require("react");
18612
18662
  var import_jsx_runtime157 = require("react/jsx-runtime");
18613
18663
  var GROUPS = ["shooting", "passing", "possession", "defending"];
18614
18664
  function finite4(v) {
@@ -18654,7 +18704,7 @@ function unrankedLine(ui, reason) {
18654
18704
  }
18655
18705
  }
18656
18706
  function PerformanceBars({ performance, competitionName, strings }) {
18657
- const [mode, setMode] = (0, import_react121.useState)("total");
18707
+ const [mode, setMode] = (0, import_react120.useState)("total");
18658
18708
  const labelled = performance.metrics.filter((m) => Object.prototype.hasOwnProperty.call(strings.perfMetric, m.key));
18659
18709
  if (!labelled.some((m) => valueOf(m, "total") !== null || valueOf(m, "per90") !== null)) return null;
18660
18710
  const subtitle = !performance.ranked ? unrankedLine(strings, performance.unrankedReason) : competitionName ? strings.perfRankedAgainst(competitionName, performance.positionGroup) : null;
@@ -18863,8 +18913,8 @@ function SettingsSheet({ ui, onClose }) {
18863
18913
  var import_jsx_runtime160 = require("react/jsx-runtime");
18864
18914
  var FULLSCREEN_QUERY = "(max-width: 639px)";
18865
18915
  function useIsModal() {
18866
- const [modal, setModal] = (0, import_react122.useState)(false);
18867
- (0, import_react122.useEffect)(() => {
18916
+ const [modal, setModal] = (0, import_react121.useState)(false);
18917
+ (0, import_react121.useEffect)(() => {
18868
18918
  if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
18869
18919
  const mql = window.matchMedia(FULLSCREEN_QUERY);
18870
18920
  const sync = () => setModal(mql.matches);
@@ -18878,12 +18928,12 @@ var HIDDEN_LAYER_STYLE = { position: "absolute", inset: 0, visibility: "hidden",
18878
18928
  var SQUAD_LAYER_STYLE = { display: "flex", flexDirection: "column", flex: 1, minHeight: 0 };
18879
18929
  function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, schedule, gamesResult, leaderboardResult, clubFixturesResult, clubStandingsResult, clubSquadResult, clubSquadStatsResult, clubPlayerDetailResult, loggedIn, conversation, presetGrid, favouritesEnabled, favourites, builder, onCloseRequested, onRegisterBack }) {
18880
18930
  const { state, close, stop, send, reset } = controller;
18881
- const [squadView, setSquadView] = (0, import_react122.useState)("roster");
18882
- const [selectedPlayerId, setSelectedPlayerId] = (0, import_react122.useState)(null);
18931
+ const [squadView, setSquadView] = (0, import_react121.useState)("roster");
18932
+ const [selectedPlayerId, setSelectedPlayerId] = (0, import_react121.useState)(null);
18883
18933
  const clearPlayerDetail = clubPlayerDetailResult?.clear;
18884
18934
  const fetchPlayerDetail = clubPlayerDetailResult?.fetch;
18885
- const squadLayerRef = (0, import_react122.useRef)(null);
18886
- const squadScrollRef = (0, import_react122.useRef)(null);
18935
+ const squadLayerRef = (0, import_react121.useRef)(null);
18936
+ const squadScrollRef = (0, import_react121.useRef)(null);
18887
18937
  const selectPlayer = (playerId) => {
18888
18938
  squadScrollRef.current = squadLayerRef.current?.querySelector(".ss-w-mon-list")?.scrollTop ?? null;
18889
18939
  setSelectedPlayerId(playerId);
@@ -18893,7 +18943,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
18893
18943
  setSelectedPlayerId(null);
18894
18944
  clearPlayerDetail?.();
18895
18945
  };
18896
- (0, import_react122.useLayoutEffect)(() => {
18946
+ (0, import_react121.useLayoutEffect)(() => {
18897
18947
  if (selectedPlayerId !== null || squadScrollRef.current === null) return;
18898
18948
  const list = squadLayerRef.current?.querySelector(".ss-w-mon-list");
18899
18949
  if (list) list.scrollTop = squadScrollRef.current;
@@ -18906,7 +18956,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
18906
18956
  const hasBuilder = !clubBrand && (builderOptions?.length ?? 0) > 0;
18907
18957
  const tabs = monitor ?? (hasBuilder ? tabState : void 0);
18908
18958
  const activeTab = tabs?.activeTab;
18909
- (0, import_react122.useEffect)(() => {
18959
+ (0, import_react121.useEffect)(() => {
18910
18960
  if (activeTab === "squad" || selectedPlayerId === null) return;
18911
18961
  setSelectedPlayerId(null);
18912
18962
  clearPlayerDetail?.();
@@ -18915,11 +18965,11 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
18915
18965
  const favouritesOpen = favouritesOffered && (favourites?.open ?? false);
18916
18966
  const favouritesAskedOpen = favourites?.open ?? false;
18917
18967
  const setFavouritesOpen = favourites?.onOpenChange;
18918
- (0, import_react122.useEffect)(() => {
18968
+ (0, import_react121.useEffect)(() => {
18919
18969
  if (favouritesAskedOpen && !favouritesOffered) setFavouritesOpen?.(false);
18920
18970
  }, [favouritesAskedOpen, favouritesOffered, setFavouritesOpen]);
18921
18971
  const storedTab = tabState?.activeTab;
18922
- (0, import_react122.useEffect)(() => {
18972
+ (0, import_react121.useEffect)(() => {
18923
18973
  const unreachable = storedTab === "builder" ? !hasBuilder : !monitor && storedTab !== void 0 && storedTab !== "chat";
18924
18974
  if (unreachable) setMonitorTab?.("chat");
18925
18975
  }, [storedTab, hasBuilder, monitor, setMonitorTab]);
@@ -18928,12 +18978,12 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
18928
18978
  const closeTab = tabs?.activeTab ?? "chat";
18929
18979
  const lastMessage = state.messages[state.messages.length - 1];
18930
18980
  const answering = state.isStreaming && !(lastMessage?.role === "assistant" && lastMessage.isGreeting);
18931
- const closeWith = (0, import_react122.useCallback)((method) => {
18981
+ const closeWith = (0, import_react121.useCallback)((method) => {
18932
18982
  track({ name: "widget_close", method, tab: closeTab, answering });
18933
18983
  if (onCloseRequested) onCloseRequested();
18934
18984
  else close();
18935
18985
  }, [track, closeTab, answering, close, onCloseRequested]);
18936
- (0, import_react122.useEffect)(() => {
18986
+ (0, import_react121.useEffect)(() => {
18937
18987
  const onKey = (e) => {
18938
18988
  if (e.key === "Escape") closeWith("escape");
18939
18989
  };
@@ -18949,80 +18999,80 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
18949
18999
  tabs?.setActiveTab("chat");
18950
19000
  send(text2, { grounding, source });
18951
19001
  };
18952
- (0, import_react122.useEffect)(() => {
19002
+ (0, import_react121.useEffect)(() => {
18953
19003
  if (monitor && monitor.activeTab !== "chat" && state.isStreaming) monitor.markChatActivity();
18954
19004
  }, [monitor, state.isStreaming, state.messages.length]);
18955
19005
  const onChatTab = !tabs || tabs.activeTab === "chat";
18956
- const inputRef = (0, import_react122.useRef)(null);
18957
- const limitRef = (0, import_react122.useRef)(null);
18958
- const typedSendRef = (0, import_react122.useRef)(false);
18959
- const focusAfterCloseRef = (0, import_react122.useRef)(null);
18960
- const [tool, setTool] = (0, import_react122.useState)(null);
18961
- const panelRef = (0, import_react122.useRef)(null);
19006
+ const inputRef = (0, import_react121.useRef)(null);
19007
+ const limitRef = (0, import_react121.useRef)(null);
19008
+ const typedSendRef = (0, import_react121.useRef)(false);
19009
+ const focusAfterCloseRef = (0, import_react121.useRef)(null);
19010
+ const [tool, setTool] = (0, import_react121.useState)(null);
19011
+ const panelRef = (0, import_react121.useRef)(null);
18962
19012
  const settings = useOddsSettings();
18963
- const [settingsOpen, setSettingsOpen] = (0, import_react122.useState)(false);
19013
+ const [settingsOpen, setSettingsOpen] = (0, import_react121.useState)(false);
18964
19014
  const hasSettings = settings.oddsOffered || !settings.themeLocked;
18965
- const openSettings = (0, import_react122.useCallback)(() => {
19015
+ const openSettings = (0, import_react121.useCallback)(() => {
18966
19016
  setTool(null);
18967
19017
  setFavouritesOpen?.(false);
18968
19018
  setSettingsOpen(true);
18969
19019
  }, [setFavouritesOpen]);
18970
- const closeSettings = (0, import_react122.useCallback)(() => {
19020
+ const closeSettings = (0, import_react121.useCallback)(() => {
18971
19021
  setSettingsOpen(false);
18972
19022
  panelRef.current?.querySelector(".ss-w-kebab")?.focus();
18973
19023
  }, []);
18974
- const openFavourites = (0, import_react122.useCallback)(() => setFavouritesOpen?.(true), [setFavouritesOpen]);
18975
- const closeFavourites = (0, import_react122.useCallback)(() => {
19024
+ const openFavourites = (0, import_react121.useCallback)(() => setFavouritesOpen?.(true), [setFavouritesOpen]);
19025
+ const closeFavourites = (0, import_react121.useCallback)(() => {
18976
19026
  setFavouritesOpen?.(false);
18977
19027
  panelRef.current?.querySelector(".ss-w-kebab")?.focus();
18978
19028
  }, [setFavouritesOpen]);
18979
- (0, import_react122.useEffect)(() => {
19029
+ (0, import_react121.useEffect)(() => {
18980
19030
  if (!favouritesOpen) return;
18981
19031
  setTool(null);
18982
19032
  setSettingsOpen(false);
18983
19033
  }, [favouritesOpen]);
18984
19034
  const paused = isPaused(state.limit);
18985
- (0, import_react122.useEffect)(() => {
19035
+ (0, import_react121.useEffect)(() => {
18986
19036
  if (paused) setTool(null);
18987
19037
  }, [paused]);
18988
- (0, import_react122.useEffect)(() => {
19038
+ (0, import_react121.useEffect)(() => {
18989
19039
  if (!paused) return;
18990
19040
  if (typedSendRef.current) limitRef.current?.focus();
18991
19041
  typedSendRef.current = false;
18992
19042
  }, [paused]);
18993
- const openTool = (0, import_react122.useCallback)((next) => {
19043
+ const openTool = (0, import_react121.useCallback)((next) => {
18994
19044
  setTool(next);
18995
19045
  }, []);
18996
- const toolsValue = (0, import_react122.useMemo)(
19046
+ const toolsValue = (0, import_react121.useMemo)(
18997
19047
  () => presetGrid && !paused ? { openBuilder: (total, legs) => openTool({ total, legs }), changeLabel: ui.presets.changeCombo } : null,
18998
19048
  [presetGrid, paused, openTool, ui.presets.changeCombo]
18999
19049
  );
19000
- const closeTool = (0, import_react122.useCallback)(() => {
19050
+ const closeTool = (0, import_react121.useCallback)(() => {
19001
19051
  focusAfterCloseRef.current = "composer";
19002
19052
  setTool(null);
19003
19053
  }, []);
19004
- const sendAsk = (0, import_react122.useCallback)((ask) => {
19054
+ const sendAsk = (0, import_react121.useCallback)((ask) => {
19005
19055
  focusAfterCloseRef.current = "composer";
19006
19056
  setTool(null);
19007
19057
  tabs?.setActiveTab("chat");
19008
19058
  send(ask.message, { displayText: ask.displayText, preset: ask.preset, source: "preset" });
19009
19059
  }, [tabs, send]);
19010
- const formatKickoff = (0, import_react122.useCallback)((kickoffUtc) => {
19060
+ const formatKickoff = (0, import_react121.useCallback)((kickoffUtc) => {
19011
19061
  const k = ui.bettingKickoff(kickoffUtc);
19012
19062
  return `${k.dayLabel} ${k.time}`;
19013
19063
  }, [ui]);
19014
- (0, import_react122.useEffect)(() => {
19064
+ (0, import_react121.useEffect)(() => {
19015
19065
  if (tool) return;
19016
19066
  const target = focusAfterCloseRef.current;
19017
19067
  focusAfterCloseRef.current = null;
19018
19068
  if (target === "composer") inputRef.current?.focus();
19019
19069
  }, [tool]);
19020
- (0, import_react122.useEffect)(() => {
19070
+ (0, import_react121.useEffect)(() => {
19021
19071
  if (!tool || onChatTab && presetGrid) return;
19022
19072
  focusAfterCloseRef.current = "composer";
19023
19073
  setTool(null);
19024
19074
  }, [tool, onChatTab, presetGrid]);
19025
- const backRef = (0, import_react122.useRef)(() => false);
19075
+ const backRef = (0, import_react121.useRef)(() => false);
19026
19076
  backRef.current = () => {
19027
19077
  if (favouritesOpen) {
19028
19078
  closeFavourites();
@@ -19046,7 +19096,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
19046
19096
  }
19047
19097
  return false;
19048
19098
  };
19049
- (0, import_react122.useEffect)(() => {
19099
+ (0, import_react121.useEffect)(() => {
19050
19100
  if (!onRegisterBack) return;
19051
19101
  onRegisterBack(() => backRef.current());
19052
19102
  return () => onRegisterBack(null);
@@ -19127,7 +19177,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
19127
19177
  }
19128
19178
  }
19129
19179
  ),
19130
- 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, onHandOffMounted: builder.onHandOffMounted }),
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 }),
19131
19181
  monitor && monitor.activeTab === "following" && /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(MatchesPanel, { monitor, ui, slip, onAsk: paused ? void 0 : handleAsk, discovery }),
19132
19182
  monitor && monitor.activeTab === "trends" && /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(TrendsPanel, { monitor, ui, slip }),
19133
19183
  monitor && monitor.activeTab === "fixtures" && /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(Fixtures, { fixtures: clubFixturesResult?.fixtures ?? [], loading: clubFixturesResult?.loading ?? false, ui }),
@@ -19206,6 +19256,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
19206
19256
  .ss-w-root, .ss-w-root * { box-sizing: border-box; margin: 0; padding: 0; }
19207
19257
  .ss-w-root {
19208
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);
19209
19260
  --ss-w-cta: #f5a623; --ss-w-cta-ink: #1b1300;
19210
19261
  --ss-w-ink: #14181d; --ss-w-faint: #6b7580; --ss-w-line: #e4e8ec;
19211
19262
  --ss-w-panel: #ffffff; --ss-w-bubble: #f3f5f7; --ss-w-nav: #0e1622;
@@ -19219,6 +19270,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
19219
19270
  @media (prefers-color-scheme: dark) {
19220
19271
  .ss-w-root[data-ss-w-theme="auto"] {
19221
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);
19222
19274
  --ss-w-ink: #e8edf2; --ss-w-faint: #8b95a1;
19223
19275
  --ss-w-line: #2a3441; --ss-w-panel: #141b24; --ss-w-bubble: #1e2732; --ss-w-nav: #0a0f16;
19224
19276
  --ss-w-pos: #37c891; --ss-w-neg: #f0655d; --ss-w-warn: #e0a030;
@@ -19228,6 +19280,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
19228
19280
  }
19229
19281
  .ss-w-root[data-ss-w-theme="dark"] {
19230
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);
19231
19284
  --ss-w-ink: #e8edf2; --ss-w-faint: #8b95a1;
19232
19285
  --ss-w-line: #2a3441; --ss-w-panel: #141b24; --ss-w-bubble: #1e2732; --ss-w-nav: #0a0f16;
19233
19286
  --ss-w-pos: #37c891; --ss-w-neg: #f0655d; --ss-w-warn: #e0a030;
@@ -19236,6 +19289,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
19236
19289
  }
19237
19290
  .ss-w-root[data-ss-w-theme="light"] {
19238
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);
19239
19293
  --ss-w-ink: #14181d; --ss-w-faint: #6b7580;
19240
19294
  --ss-w-line: #e4e8ec; --ss-w-panel: #ffffff; --ss-w-bubble: #f3f5f7; --ss-w-nav: #0e1622;
19241
19295
  --ss-w-home: #3a63a8; --ss-w-away: #c8102e; --ss-w-track: #e9edf1;
@@ -19356,20 +19410,20 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
19356
19410
  .ss-w-root[data-ss-w-pos="left"] .ss-w-fab-wrap { left: var(--ss-w-offset-x); align-items: flex-start; }
19357
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); }
19358
19412
  .ss-w-fab-mark { width: 30px; height: 30px; display: block; object-fit: contain; }
19359
- .ss-w-greeting { max-width: 240px; 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: 12px; box-shadow: 0 4px 14px rgba(0,0,0,.14); }
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); }
19360
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; }
19361
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; }
19362
- .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; }
19363
19419
  /* Bubble asks (onboarding presets, spec C6): the line stays one button, the asks stack under it as
19364
- sibling buttons. 240 px bubble: 196 px of text room per ask; widest contract ask 167 px (EN),
19365
- 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. */
19366
19421
  .ss-w-greeting--asks { flex-direction: column; align-items: stretch; }
19367
19422
  .ss-w-greeting-top { display: flex; align-items: flex-start; }
19368
19423
  .ss-w-greeting-asks { display: flex; flex-direction: column; gap: 6px; padding: 0 10px 10px; }
19369
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; }
19370
- .ss-w-greeting-cta { min-height: 44px; width: 100%; text-align: center; font: inherit; font-size: 12.5px; font-weight: 700; line-height: 1.3; color: var(--ss-g-on-accent, #fff); background: var(--ss-w-accent); border: 0; border-radius: 10px; padding: 6px 10px; cursor: pointer; white-space: normal; overflow-wrap: anywhere; }
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; }
19371
19426
  .ss-w-greeting-cta:focus-visible { outline: 2px solid var(--ss-w-accent); outline-offset: 2px; }
19372
- .ss-w-greeting-price { display: flex; flex-direction: column; gap: 4px; }
19373
19427
  .ss-w-greeting-ask:hover { border-color: var(--ss-w-accent); }
19374
19428
  .ss-w-greeting-ask:focus-visible { outline: 2px solid var(--ss-w-accent); outline-offset: 2px; }
19375
19429
  /* Typing indicator: overlays the text area so bubble height stays put; hidden at
@@ -20852,38 +20906,38 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
20852
20906
  .ss-w-v8-since-line { margin: 0; font-size: 13px; line-height: 1.35; color: var(--ss-w-ink); overflow-wrap: anywhere; }
20853
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; }
20854
20908
  .ss-w-v2 { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
20855
- .ss-w-v2-featured { border-color: color-mix(in srgb, var(--ss-w-accent) 40%, var(--ss-w-line)); }
20856
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; }
20857
20910
  @keyframes ss-w-v2-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--ss-w-accent) 35%, transparent); } }
20858
- .ss-w-v2-teams { display: flex; flex-direction: column; gap: 2px; }
20859
- .ss-w-v2-team { display: flex; align-items: center; gap: 4px; min-width: 0; }
20860
- .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; }
20861
- .ss-w-v2-star:focus-visible { outline: 2px solid var(--ss-w-accent); outline-offset: 2px; border-radius: 8px; }
20862
20911
  .ss-w-v2-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 8px; min-width: 0; }
20863
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; }
20864
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; }
20865
- .ss-w-v2-prices { display: flex; gap: 6px; min-width: 0; }
20866
- .ss-w-v2-prices .ss-w-slip-btn.ss-w-slip-btn--price { flex: 1 1 0; width: auto; min-width: 0; min-height: 40px; padding: 5px 8px; white-space: normal; }
20867
- .ss-w-v2-prices .ss-w-slip-btn--price .ss-w-mol-lab { text-wrap: balance; }
20868
- .ss-w-v2-stat { margin: 0; font-size: 12.5px; line-height: 1.35; color: var(--ss-w-ink); overflow-wrap: anywhere; }
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; }
20869
20930
  .ss-w-v2 .ss-w-toast { position: static; width: auto; max-width: none; box-shadow: none; }
20870
20931
  .ss-w-v2-gone { margin: 0; font-size: 12.5px; line-height: 1.35; color: var(--ss-w-ink); overflow-wrap: anywhere; }
20871
- .ss-w-v2-prices .ss-w-slip-btn--price:disabled { opacity: 0.6; cursor: default; }
20872
- .ss-w-v2-strip, .ss-w-v2-alts { gap: 6px; }
20873
- .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; }
20874
20934
  .ss-w-v2-chips .ss-w-v8-chip { font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
20875
20935
  .ss-w-v2-chips .ss-w-v8-chip:focus-visible { outline: 2px solid var(--ss-w-accent); outline-offset: 2px; }
20876
- .ss-w-v2-chooser { margin: 0; font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--ss-w-ink); overflow-wrap: anywhere; }
20877
20936
  .ss-w-v2-picker { gap: 6px; }
20878
- .ss-w-v2-picker-title { margin: 0; font-size: 11.5px; font-weight: 600; color: var(--ss-w-faint); }
20879
20937
  .ss-w-v2-picker-list { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
20880
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; }
20881
20939
  .ss-w-v2-picker-row[aria-current="true"] { border-color: var(--ss-w-accent); }
20882
20940
  .ss-w-v2-picker-row:focus-visible { outline: 2px solid var(--ss-w-accent); outline-offset: 2px; }
20883
- .ss-w-v2-picker-prices { display: flex; flex-wrap: wrap; gap: 4px 12px; min-width: 0; font-size: 12.5px; }
20884
- .ss-w-v2-picker-price { display: inline-flex; gap: 6px; min-width: 0; }
20885
- .ss-w-v2-picker-price .ss-w-mol-lab, .ss-w-v2-picker-price .ss-w-mol-tick { font-size: 12.5px; }
20886
- .ss-w-v2-picker-price .ss-w-mol-lab { color: var(--ss-w-ink); }
20887
20941
  @media (prefers-reduced-motion: no-preference) { .ss-w-v2-picker-row { transition: border-color 120ms ease; } }
20888
20942
 
20889
20943
  /* guess */
@@ -20899,6 +20953,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
20899
20953
  /* team and player cards */
20900
20954
  .ss-w-v8-cards { gap: 8px; }
20901
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; }
20902
20957
  .ss-w-v8-team { border-color: color-mix(in srgb, var(--ss-w-accent) 40%, var(--ss-w-line)); }
20903
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; }
20904
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; }
@@ -20931,8 +20986,10 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
20931
20986
  .ss-w-v8-card-lead { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
20932
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; }
20933
20988
  .ss-w-v8-card-row .ss-w-slip { flex: none; max-width: 70%; }
20934
- .ss-w-v8-card-row .ss-w-slip-btn.ss-w-slip-btn--price { padding: 5px 8px; white-space: normal; }
20935
- .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); }
20936
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; }
20937
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)); }
20938
20995
  .ss-w-v8-hit-row { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
@@ -22116,12 +22173,12 @@ function injectStyles(root) {
22116
22173
  function StatsWidget(props) {
22117
22174
  const injectedClient = "client" in props ? props.client : void 0;
22118
22175
  const cfg = props.config;
22119
- const built = (0, import_react123.useMemo)(() => buildClient(props), [injectedClient, cfg?.operatorId, cfg?.publicKey, cfg?.baseUrl]);
22120
- const trackingRef = (0, import_react123.useRef)({ envelope: { operatorId: "", widgetVersion: WIDGET_REACT_VERSION } });
22121
- const track = (0, import_react123.useMemo)(() => createTracker(() => trackingRef.current), []);
22122
- const eventTextRef = (0, import_react123.useRef)(false);
22176
+ const built = (0, import_react122.useMemo)(() => buildClient(props), [injectedClient, cfg?.operatorId, cfg?.publicKey, cfg?.baseUrl]);
22177
+ const trackingRef = (0, import_react122.useRef)({ envelope: { operatorId: "", widgetVersion: WIDGET_REACT_VERSION } });
22178
+ const track = (0, import_react122.useMemo)(() => createTracker(() => trackingRef.current), []);
22179
+ const eventTextRef = (0, import_react122.useRef)(false);
22123
22180
  eventTextRef.current = cfg?.eventText === true;
22124
- const logger = (0, import_react123.useMemo)(() => {
22181
+ const logger = (0, import_react122.useMemo)(() => {
22125
22182
  if (!built) return null;
22126
22183
  const raw = built.client.createEventLogger({
22127
22184
  operatorUserId: cfg?.userContext?.operatorUserId,
@@ -22131,27 +22188,27 @@ function StatsWidget(props) {
22131
22188
  }, [built?.client, track]);
22132
22189
  const widgetStrings = useWidgetStrings(cfg, built?.conversation ?? null);
22133
22190
  const stringsPending = widgetStrings.strings === void 0;
22134
- const ui = (0, import_react123.useMemo)(
22191
+ const ui = (0, import_react122.useMemo)(
22135
22192
  () => normalizeUi(props.config ?? { operatorId: "", publicKey: "" }, widgetStrings.strings ?? BUNDLED),
22136
22193
  [props.config, widgetStrings.strings]
22137
22194
  );
22138
22195
  const oddsSettings = useOddsSettingsState(ui, built?.conversation, cfg?.operatorId || "default");
22139
- const rootRef = (0, import_react123.useRef)(null);
22140
- const introDoneRef = (0, import_react123.useRef)(false);
22141
- const markIntroDone = (0, import_react123.useCallback)(() => {
22196
+ const rootRef = (0, import_react122.useRef)(null);
22197
+ const introDoneRef = (0, import_react122.useRef)(false);
22198
+ const markIntroDone = (0, import_react122.useCallback)(() => {
22142
22199
  introDoneRef.current = true;
22143
22200
  }, []);
22144
22201
  const language = injectedClient ? void 0 : hostTag(cfg);
22145
22202
  const threadLanguage = familyOf(language);
22146
22203
  const convStorageKey = `ss-w-conv:${cfg?.operatorId ?? ""}:${cfg?.userContext?.operatorUserId ?? "anon"}${threadLanguage ? `:lang=${threadLanguage}` : ""}`;
22147
- const sportScope = (0, import_react123.useMemo)(
22204
+ const sportScope = (0, import_react122.useMemo)(
22148
22205
  () => ({ operatorId: cfg?.operatorId ?? "", operatorUserId: cfg?.userContext?.operatorUserId, anonymousUserId: cfg?.userContext?.anonymousUserId }),
22149
22206
  [cfg?.operatorId, cfg?.userContext?.operatorUserId, cfg?.userContext?.anonymousUserId]
22150
22207
  );
22151
- const chatTracking = (0, import_react123.useMemo)(() => ({ track, eventText: () => eventTextRef.current }), [track]);
22208
+ const chatTracking = (0, import_react122.useMemo)(() => ({ track, eventText: () => eventTextRef.current }), [track]);
22152
22209
  const controller = useChatStream(built?.conversation ?? emptyConversation(), ui.starters, built ? ui.greetingMessage : void 0, convStorageKey, cfg?.page, sportScope, language, chatTracking, injectedClient ? oddsSettings.userOddsFormat : oddsSettings.oddsFormat);
22153
22210
  const panelOpen = controller.state.isOpen && !stringsPending;
22154
- const liveCardWatches = (0, import_react123.useMemo)(() => {
22211
+ const liveCardWatches = (0, import_react122.useMemo)(() => {
22155
22212
  const seen2 = /* @__PURE__ */ new Set();
22156
22213
  const out = [];
22157
22214
  for (const msg of controller.state.messages) {
@@ -22177,19 +22234,19 @@ function StatsWidget(props) {
22177
22234
  });
22178
22235
  const operatorUserId = cfg?.userContext?.operatorUserId;
22179
22236
  const anonymousUserId = cfg?.userContext?.anonymousUserId;
22180
- const getSchedule = (0, import_react123.useCallback)(
22237
+ const getSchedule = (0, import_react122.useCallback)(
22181
22238
  (localDate, utcOffsetMinutes) => built ? built.conversation.getSchedule(localDate, utcOffsetMinutes, operatorUserId, anonymousUserId) : Promise.resolve(null),
22182
22239
  [built, operatorUserId, anonymousUserId]
22183
22240
  );
22184
- const getStates = (0, import_react123.useCallback)(
22241
+ const getStates = (0, import_react122.useCallback)(
22185
22242
  (matchIds, nbaGameIds, nflGameIds, tennisMatches) => built ? built.conversation.getStates(matchIds, nbaGameIds, nflGameIds, requestTag, tennisMatches) : Promise.resolve(null),
22186
22243
  [built, requestTag]
22187
22244
  );
22188
- const getTennisPrices = (0, import_react123.useCallback)(
22245
+ const getTennisPrices = (0, import_react122.useCallback)(
22189
22246
  (keys) => built ? built.conversation.getStates([], [], [], requestTag, [], keys).then((p) => p?.tennisPrices ?? null) : Promise.resolve(null),
22190
22247
  [built, requestTag]
22191
22248
  );
22192
- const pinnedMatchIds = (0, import_react123.useMemo)(
22249
+ const pinnedMatchIds = (0, import_react122.useMemo)(
22193
22250
  () => footballMatchPinIds(monitor.pins),
22194
22251
  [monitor.pins]
22195
22252
  );
@@ -22203,13 +22260,13 @@ function StatsWidget(props) {
22203
22260
  pinnedMatchIds,
22204
22261
  timeZone: ui.timeZone
22205
22262
  });
22206
- const offeredSports = (0, import_react123.useMemo)(() => {
22263
+ const offeredSports = (0, import_react122.useMemo)(() => {
22207
22264
  const seen2 = new Set(discovery.matchDays.map((d) => d.sport));
22208
22265
  for (const g of discovery.groups) seen2.add(g.sport ?? "football");
22209
22266
  return [...seen2];
22210
22267
  }, [discovery.matchDays, discovery.groups]);
22211
22268
  const scheduleSport = useScheduleSport(offeredSports);
22212
- const [liveLeague, setLiveLeague] = (0, import_react123.useState)(null);
22269
+ const [liveLeague, setLiveLeague] = (0, import_react122.useState)(null);
22213
22270
  const [matchesDay, setMatchesDay] = useMatchesDayPick(discovery.localDate);
22214
22271
  const matchesLoaded = useMatchesDay({
22215
22272
  discovery,
@@ -22219,8 +22276,8 @@ function StatsWidget(props) {
22219
22276
  enabled: panelOpen && monitor.activeTab === "matches",
22220
22277
  timeZone: ui.timeZone
22221
22278
  });
22222
- const prevLiveSnapshotRef = (0, import_react123.useRef)(monitor.snapshot);
22223
- (0, import_react123.useEffect)(() => {
22279
+ const prevLiveSnapshotRef = (0, import_react122.useRef)(monitor.snapshot);
22280
+ (0, import_react122.useEffect)(() => {
22224
22281
  const snap = monitor.snapshot;
22225
22282
  if (!snap || snap === prevLiveSnapshotRef.current) return;
22226
22283
  prevLiveSnapshotRef.current = snap;
@@ -22260,14 +22317,14 @@ function StatsWidget(props) {
22260
22317
  const clubSquadResult = useClubSquad(built?.conversation ?? null, { activeTab: monitor.activeTab, enabled: clubFixturesResult.enabled });
22261
22318
  const clubSquadStatsResult = useClubSquadStats(built?.conversation ?? null, { activeTab: monitor.activeTab, enabled: clubFixturesResult.enabled });
22262
22319
  const clubPlayerDetailResult = useClubPlayerDetail(built?.conversation ?? null);
22263
- const [favSportPick, setFavSportPick] = (0, import_react123.useState)(null);
22264
- const latestGreeting = (0, import_react123.useMemo)(() => {
22320
+ const [favSportPick, setFavSportPick] = (0, import_react122.useState)(null);
22321
+ const latestGreeting = (0, import_react122.useMemo)(() => {
22265
22322
  for (const m of [...controller.state.messages].reverse()) {
22266
22323
  if (m.role === "assistant" && m.defaultSport !== void 0) return m;
22267
22324
  }
22268
22325
  return null;
22269
22326
  }, [controller.state.messages]);
22270
- const favSportOptions = (0, import_react123.useMemo)(
22327
+ const favSportOptions = (0, import_react122.useMemo)(
22271
22328
  () => (switchSets(latestGreeting?.greetingDashboards) ?? []).map((set) => ({ sport: set.sport, label: set.label })),
22272
22329
  [latestGreeting]
22273
22330
  );
@@ -22276,33 +22333,27 @@ function StatsWidget(props) {
22276
22333
  const favSport = [favSportPick, rememberedSport, latestGreeting?.defaultSport].find(offered) ?? "football";
22277
22334
  const favSports = favSportOptions.length > 0 ? favSportOptions : [{ sport: favSport, label: sportLabel(ui, favSport) }];
22278
22335
  const hasFavouritesIdentity = !!(operatorUserId || anonymousUserId);
22279
- const [builderSportPick, setBuilderSportPick] = (0, import_react123.useState)(null);
22280
- const builderGreeting = (0, import_react123.useMemo)(
22336
+ const [builderSportPick, setBuilderSportPick] = (0, import_react122.useState)(null);
22337
+ const builderGreeting = (0, import_react122.useMemo)(
22281
22338
  () => [...controller.state.messages].reverse().find((m) => m.role === "assistant" && (m.greetingDashboard !== void 0 || m.greetingDashboards !== void 0)) ?? null,
22282
22339
  [controller.state.messages]
22283
22340
  );
22284
- const [coolOff, setCoolOff] = (0, import_react123.useState)(null);
22285
- const onBuilderCoolOff = (0, import_react123.useCallback)((sport) => {
22341
+ const [coolOff, setCoolOff] = (0, import_react122.useState)(null);
22342
+ const onBuilderCoolOff = (0, import_react122.useCallback)((sport) => {
22286
22343
  if (!builderGreeting) return;
22287
22344
  setCoolOff((prev) => {
22288
22345
  const sports = prev?.greeting === builderGreeting ? prev.sports : [];
22289
22346
  return sports.includes(sport) ? prev : { greeting: builderGreeting, sports: [...sports, sport] };
22290
22347
  });
22291
22348
  }, [builderGreeting]);
22292
- const [handOffPending, setHandOffPending] = (0, import_react123.useState)(false);
22293
- const consumeHandOff = (0, import_react123.useCallback)(() => setHandOffPending(false), []);
22294
- const openTabFromChip = (0, import_react123.useCallback)((tab) => {
22295
- if (tab === "builder") setHandOffPending(true);
22296
- monitor.setActiveTab(tab);
22297
- }, [monitor.setActiveTab]);
22298
- const builderOptions = (0, import_react123.useMemo)(() => {
22349
+ const builderOptions = (0, import_react122.useMemo)(() => {
22299
22350
  const greeting = builderGreeting;
22300
22351
  if (!greeting) return [];
22301
22352
  const cooled = coolOff?.greeting === greeting ? coolOff.sports : [];
22302
22353
  const sets = switchSets(greeting.greetingDashboards);
22303
22354
  const optionFor = (sport, label, d) => {
22304
22355
  const handOff = d?.marketFirst?.builder;
22305
- if (handOff) return [{ sport, label, preset: handOff, keepMarket: handOffPending }];
22356
+ if (handOff) return [{ sport, label, preset: handOff }];
22306
22357
  return d?.personal?.builder ? [{ sport, label, preset: d.personal.builder }] : [];
22307
22358
  };
22308
22359
  const options = sets ? sets.flatMap((s) => optionFor(s.sport, s.label, s.dashboard)) : (() => {
@@ -22310,9 +22361,9 @@ function StatsWidget(props) {
22310
22361
  return optionFor(sport, sportLabel(ui, sport), greeting.greetingDashboard);
22311
22362
  })();
22312
22363
  return options.filter((o) => !cooled.includes(o.sport));
22313
- }, [builderGreeting, coolOff, ui, handOffPending]);
22364
+ }, [builderGreeting, coolOff, ui]);
22314
22365
  const builderSport = [builderSportPick, rememberedSport, latestGreeting?.defaultSport].find((s) => !!s && builderOptions.some((o) => o.sport === s)) ?? builderOptions[0]?.sport ?? "";
22315
- const [panelEverOpened, setPanelEverOpened] = (0, import_react123.useState)(panelOpen);
22366
+ const [panelEverOpened, setPanelEverOpened] = (0, import_react122.useState)(panelOpen);
22316
22367
  if (panelOpen && !panelEverOpened) setPanelEverOpened(true);
22317
22368
  const favourites = useFavourites({
22318
22369
  conversation: built?.conversation ?? null,
@@ -22324,16 +22375,16 @@ function StatsWidget(props) {
22324
22375
  onChanged: discovery.refreshSchedule
22325
22376
  });
22326
22377
  const favouritesEnabled = hasFavouritesIdentity && favourites.status !== "refused";
22327
- const [favouritesOpen, setFavouritesOpen] = (0, import_react123.useState)(false);
22378
+ const [favouritesOpen, setFavouritesOpen] = (0, import_react122.useState)(false);
22328
22379
  if (!panelOpen && favouritesOpen) setFavouritesOpen(false);
22329
- const getPricePresets = (0, import_react123.useCallback)(
22380
+ const getPricePresets = (0, import_react122.useCallback)(
22330
22381
  (locale) => built ? built.conversation.getPricePresets(locale, { pool: "open" }) : Promise.resolve(null),
22331
22382
  [built]
22332
22383
  );
22333
22384
  const presetGrid = usePresetGrid({ getPricePresets, isOpen: panelOpen, locale: ui.hostTag });
22334
22385
  const markLiveActivity = monitor.markLiveActivity;
22335
- const prevLiveCountRef = (0, import_react123.useRef)(0);
22336
- (0, import_react123.useEffect)(() => {
22386
+ const prevLiveCountRef = (0, import_react122.useRef)(0);
22387
+ (0, import_react122.useEffect)(() => {
22337
22388
  const rose = prevLiveCountRef.current === 0 && discovery.liveCount > 0;
22338
22389
  prevLiveCountRef.current = discovery.liveCount;
22339
22390
  if (rose) markLiveActivity();
@@ -22347,7 +22398,7 @@ function StatsWidget(props) {
22347
22398
  closePanel: controller.close
22348
22399
  });
22349
22400
  const markAdded = hostEvents.markAdded;
22350
- const slip = (0, import_react123.useMemo)(
22401
+ const slip = (0, import_react122.useMemo)(
22351
22402
  () => {
22352
22403
  const handler = props.config?.onAddToSlip;
22353
22404
  return {
@@ -22367,7 +22418,7 @@ function StatsWidget(props) {
22367
22418
  },
22368
22419
  [props.config?.onAddToSlip, props.config?.slipSports, controller.state.conversationId, markAdded]
22369
22420
  );
22370
- const onDashboardTap = (0, import_react123.useMemo)(
22421
+ const onDashboardTap = (0, import_react122.useMemo)(
22371
22422
  () => built ? createDashboardTapSignal((input) => built.conversation.sendSignal(input), logger) : void 0,
22372
22423
  [built, logger]
22373
22424
  );
@@ -22381,14 +22432,15 @@ function StatsWidget(props) {
22381
22432
  log: logger
22382
22433
  })
22383
22434
  }));
22384
- const dismissPopupRef = (0, import_react123.useRef)(() => {
22435
+ const dismissPopupRef = (0, import_react122.useRef)(() => {
22385
22436
  });
22386
- const onCtaRef = (0, import_react123.useRef)(() => {
22437
+ const onCtaRef = (0, import_react122.useRef)(() => {
22387
22438
  });
22388
- const onTeaserTapRef = (0, import_react123.useRef)(() => {
22439
+ const onTeaserTapRef = (0, import_react122.useRef)(() => {
22389
22440
  });
22390
22441
  const bubble = controller.state.greetingBubble;
22391
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;
22392
22444
  const bubbleCta = controller.state.popupText ? controller.state.greetingBubble?.cta ?? null : null;
22393
22445
  const mobile = useMobileBinding({
22394
22446
  binding: props.mobile,
@@ -22412,15 +22464,15 @@ function StatsWidget(props) {
22412
22464
  dismissPopupRef.current = dismissPopup;
22413
22465
  const greetingMeta = latestGreetingMeta(controller.state.messages);
22414
22466
  useBubbleGreetingShown(logger, logger ?? NO_OWNER, controller.state.popupText, greetingMeta, mobile.confirmedShown);
22415
- const [highlight, setHighlight] = (0, import_react123.useState)(null);
22416
- const clearHighlight = (0, import_react123.useCallback)(() => setHighlight(null), []);
22417
- (0, import_react123.useEffect)(() => {
22467
+ const [highlight, setHighlight] = (0, import_react122.useState)(null);
22468
+ const clearHighlight = (0, import_react122.useCallback)(() => setHighlight(null), []);
22469
+ (0, import_react122.useEffect)(() => {
22418
22470
  if (!panelOpen) setHighlight(null);
22419
22471
  }, [panelOpen]);
22420
- const highlightRequest = (0, import_react123.useMemo)(() => highlight ? { ...highlight, clear: clearHighlight } : null, [highlight, clearHighlight]);
22472
+ const highlightRequest = (0, import_react122.useMemo)(() => highlight ? { ...highlight, clear: clearHighlight } : null, [highlight, clearHighlight]);
22421
22473
  const { open: openFromCta, state: { greetingBubble } } = controller;
22422
22474
  const setTab = monitor.setActiveTab;
22423
- const logCtaClick = (0, import_react123.useCallback)(() => {
22475
+ const logCtaClick = (0, import_react122.useCallback)(() => {
22424
22476
  if (!logger || !greetingMeta) return;
22425
22477
  logger.log({ name: "greeting_cta_click", greeting: { greetingId: greetingMeta.greetingId, case: greetingMeta.case, sport: greetingMeta.sport, market: greetingMeta.market ?? null } });
22426
22478
  }, [logger, greetingMeta]);
@@ -22437,12 +22489,12 @@ function StatsWidget(props) {
22437
22489
  if (!bubbleCta) logCtaClick();
22438
22490
  openFromCta();
22439
22491
  };
22440
- const onCta = (0, import_react123.useCallback)(() => onCtaRef.current(), []);
22492
+ const onCta = (0, import_react122.useCallback)(() => onCtaRef.current(), []);
22441
22493
  useOpenTelemetry(logger, panelOpen);
22442
- const onControlRef = (0, import_react123.useRef)(props.onControl);
22494
+ const onControlRef = (0, import_react122.useRef)(props.onControl);
22443
22495
  onControlRef.current = props.onControl;
22444
22496
  const { open: openPanel, close: closePanel } = controller;
22445
- (0, import_react123.useEffect)(() => {
22497
+ (0, import_react122.useEffect)(() => {
22446
22498
  onControlRef.current?.({ open: openPanel, close: closePanel });
22447
22499
  return () => onControlRef.current?.(null);
22448
22500
  }, [openPanel, closePanel]);
@@ -22459,11 +22511,11 @@ function StatsWidget(props) {
22459
22511
  page: cfg?.page
22460
22512
  }
22461
22513
  };
22462
- (0, import_react123.useEffect)(() => {
22514
+ (0, import_react122.useEffect)(() => {
22463
22515
  if (!logger) return;
22464
22516
  logger.setIdentity({ operatorUserId, anonymousUserId, conversationId });
22465
22517
  }, [logger, operatorUserId, anonymousUserId, conversationId]);
22466
- (0, import_react123.useEffect)(() => {
22518
+ (0, import_react122.useEffect)(() => {
22467
22519
  if (!logger) return;
22468
22520
  logger.resume();
22469
22521
  const onHide = () => {
@@ -22481,26 +22533,27 @@ function StatsWidget(props) {
22481
22533
  logger.dispose();
22482
22534
  };
22483
22535
  }, [logger]);
22484
- (0, import_react123.useEffect)(() => {
22536
+ (0, import_react122.useEffect)(() => {
22485
22537
  if (!built || !ui.injectStyles || widgetStrings.state === "unavailable") return;
22486
22538
  const node = rootRef.current?.getRootNode();
22487
22539
  if (node) injectStyles(node);
22488
22540
  }, [built, ui.injectStyles, widgetStrings.state]);
22489
22541
  const holds = useSessionHolds();
22490
22542
  const builderConversation = built?.conversation ?? null;
22491
- const builderMemory = (0, import_react123.useMemo)(() => createBuilderMemory(), [builderConversation, controller.state.threadEpoch]);
22492
- const personalGreeting = (0, import_react123.useMemo)(() => ({
22543
+ const builderMemory = (0, import_react122.useMemo)(() => createBuilderMemory(), [builderConversation, controller.state.threadEpoch]);
22544
+ const personalGreeting = (0, import_react122.useMemo)(() => ({
22493
22545
  favourites: favouritesEnabled && monitor.enabled ? favourites : null,
22494
22546
  conversation: built?.conversation ?? null,
22495
22547
  openFavourites: () => setFavouritesOpen(true),
22496
- openTab: openTabFromChip,
22548
+ openTab: monitor.setActiveTab,
22497
22549
  // Not before the club probe has answered: a club brand has no Favourites sheet, and the invite must not appear and then go.
22498
22550
  favouritesOffered: favouritesEnabled && monitor.enabled && clubFixturesResult.settled && !clubFixturesResult.enabled,
22499
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.
22500
22552
  favouritesReady: favouritesEnabled && monitor.enabled && clubFixturesResult.tabReady && !clubFixturesResult.enabled,
22501
22553
  holds,
22502
- memory: builderMemory
22503
- }), [favouritesEnabled, monitor.enabled, openTabFromChip, clubFixturesResult.settled, clubFixturesResult.tabReady, clubFixturesResult.enabled, favourites, built, holds, builderMemory]);
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]);
22504
22557
  if (!built || widgetStrings.state === "unavailable") return null;
22505
22558
  const attrs = themeAttrs(ui, oddsSettings.userTheme);
22506
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)(
@@ -22535,7 +22588,7 @@ function StatsWidget(props) {
22535
22588
  presetGrid,
22536
22589
  favouritesEnabled: favouritesEnabled && clubFixturesResult.tabReady && !clubFixturesResult.enabled,
22537
22590
  favourites: { controller: favourites, sport: favSport, sports: favSports, onSportChange: setFavSportPick, open: favouritesOpen, onOpenChange: setFavouritesOpen },
22538
- builder: { options: builderOptions, sport: builderSport, onSportChange: setBuilderSportPick, onCoolOff: onBuilderCoolOff, onHandOffMounted: consumeHandOff, tabs: monitor },
22591
+ builder: { options: builderOptions, sport: builderSport, onSportChange: setBuilderSportPick, onCoolOff: onBuilderCoolOff, tabs: monitor },
22539
22592
  onCloseRequested: mobile.onCloseRequested,
22540
22593
  onRegisterBack: mobile.onRegisterBack
22541
22594
  }
@@ -22568,6 +22621,7 @@ function StatsWidget(props) {
22568
22621
  onIntroStart: markIntroDone,
22569
22622
  asks,
22570
22623
  cta: bubbleCta ?? void 0,
22624
+ game: bubbleGame,
22571
22625
  onCta,
22572
22626
  onBubbleClick: logCtaClick,
22573
22627
  price: bubblePrice ? /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(