@sensiblestats/widget-react 0.129.0 → 0.130.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/index.cjs +72 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +72 -35
- package/dist/index.js.map +1 -1
- package/dist/styles.css +4 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1257,6 +1257,21 @@ function buildLocaleStrings(table, tag2, clock3 = "24h", timeZone) {
|
|
|
1257
1257
|
}
|
|
1258
1258
|
|
|
1259
1259
|
// src/odds.ts
|
|
1260
|
+
var DISPLAY_KEYS = ["home", "away", "kickoffUtc", "market", "marketLabel", "selection", "line", "player"];
|
|
1261
|
+
var DISPLAY_MAX = 80;
|
|
1262
|
+
function slipDisplay(parts2) {
|
|
1263
|
+
const out = {};
|
|
1264
|
+
for (const k of DISPLAY_KEYS) {
|
|
1265
|
+
const v = typeof parts2[k] === "string" ? parts2[k].trim() : "";
|
|
1266
|
+
if (!v || k === "kickoffUtc" && !Number.isFinite(Date.parse(v))) continue;
|
|
1267
|
+
out[k] = v.slice(0, DISPLAY_MAX);
|
|
1268
|
+
}
|
|
1269
|
+
return Object.keys(out).length > 0 ? out : void 0;
|
|
1270
|
+
}
|
|
1271
|
+
function withMatch(selection, match) {
|
|
1272
|
+
const display = slipDisplay({ home: match.home, away: match.away, kickoffUtc: match.kickoffUtc, marketLabel: match.marketLabel, player: match.player });
|
|
1273
|
+
return display ? { ...selection, display } : selection;
|
|
1274
|
+
}
|
|
1260
1275
|
function formatOdds(forms, format2) {
|
|
1261
1276
|
return (format2 === "american" ? forms.american : format2 === "fractional" ? forms.fractional : forms.decimal) ?? forms.decimal;
|
|
1262
1277
|
}
|
|
@@ -1270,7 +1285,7 @@ function parseOddsFormat(value) {
|
|
|
1270
1285
|
}
|
|
1271
1286
|
|
|
1272
1287
|
// src/version.generated.ts
|
|
1273
|
-
var WIDGET_REACT_VERSION = "0.
|
|
1288
|
+
var WIDGET_REACT_VERSION = "0.130.0";
|
|
1274
1289
|
|
|
1275
1290
|
// src/config.ts
|
|
1276
1291
|
function hostTag(cfg) {
|
|
@@ -1948,7 +1963,7 @@ function toSlipSelection(vm, conversationId) {
|
|
|
1948
1963
|
if (vm.quotedAtUtc !== void 0) selection.quotedAtUtc = vm.quotedAtUtc;
|
|
1949
1964
|
if (vm.id !== void 0) selection.insightId = vm.id;
|
|
1950
1965
|
if (conversationId !== void 0) selection.conversationId = conversationId;
|
|
1951
|
-
return selection;
|
|
1966
|
+
return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc, marketLabel: vm.market });
|
|
1952
1967
|
}
|
|
1953
1968
|
function toMarketOddsVM(card) {
|
|
1954
1969
|
const rows = Array.isArray(card.rows) ? card.rows : [];
|
|
@@ -2065,7 +2080,7 @@ function marketOddsRowToSlipSelection(vm, row, conversationId) {
|
|
|
2065
2080
|
const slipSport = slipSportOf(vm.sport);
|
|
2066
2081
|
if (slipSport) selection.sport = slipSport;
|
|
2067
2082
|
if (conversationId !== void 0) selection.conversationId = conversationId;
|
|
2068
|
-
return selection;
|
|
2083
|
+
return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc, marketLabel: vm.market });
|
|
2069
2084
|
}
|
|
2070
2085
|
function finite(v) {
|
|
2071
2086
|
return typeof v === "number" && Number.isFinite(v) ? v : void 0;
|
|
@@ -2139,7 +2154,7 @@ function comboLegToSlipSelection(leg, conversationId) {
|
|
|
2139
2154
|
if (leg.quotedAtUtc !== void 0) selection.quotedAtUtc = leg.quotedAtUtc;
|
|
2140
2155
|
if (leg.sport !== void 0) selection.sport = leg.sport;
|
|
2141
2156
|
if (conversationId !== void 0) selection.conversationId = conversationId;
|
|
2142
|
-
return selection;
|
|
2157
|
+
return withMatch(selection, { home: leg.homeTeamName, away: leg.awayTeamName, kickoffUtc: leg.kickoffUtc, marketLabel: leg.market });
|
|
2143
2158
|
}
|
|
2144
2159
|
var isNum = (v) => typeof v === "number" && Number.isFinite(v);
|
|
2145
2160
|
var isObj = (v) => typeof v === "object" && v !== null;
|
|
@@ -2272,7 +2287,7 @@ function toNbaSlipSelection(vm, key, conversationId) {
|
|
|
2272
2287
|
sport: "basketball"
|
|
2273
2288
|
};
|
|
2274
2289
|
if (conversationId !== void 0) selection.conversationId = conversationId;
|
|
2275
|
-
return selection;
|
|
2290
|
+
return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc });
|
|
2276
2291
|
}
|
|
2277
2292
|
function nbaCoHitLegs(vm, conversationId) {
|
|
2278
2293
|
if (vm.evidence.kind !== "co_hit") return [];
|
|
@@ -2285,6 +2300,7 @@ function nbaCoHitLegs(vm, conversationId) {
|
|
|
2285
2300
|
matchId: vm.matchId,
|
|
2286
2301
|
homeTeamName: vm.homeTeamName ?? "",
|
|
2287
2302
|
awayTeamName: vm.awayTeamName ?? "",
|
|
2303
|
+
kickoffUtc: vm.kickoffUtc ?? void 0,
|
|
2288
2304
|
market: vm.title,
|
|
2289
2305
|
marketDeveloperName: s.marketDeveloperName,
|
|
2290
2306
|
selection: s.selectionLabel,
|
|
@@ -2391,7 +2407,7 @@ function toNflSlipSelection(vm, key, nowMs, conversationId) {
|
|
|
2391
2407
|
sport: "americanfootball"
|
|
2392
2408
|
};
|
|
2393
2409
|
if (conversationId !== void 0) selection.conversationId = conversationId;
|
|
2394
|
-
return selection;
|
|
2410
|
+
return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc });
|
|
2395
2411
|
}
|
|
2396
2412
|
|
|
2397
2413
|
// src/slipKey.ts
|
|
@@ -2450,11 +2466,11 @@ function slipPickFields(selection, label, line) {
|
|
|
2450
2466
|
if (Number.isFinite(odds) && odds > 1 && odds <= MAX_ODDS) fields.odds = odds;
|
|
2451
2467
|
return fields;
|
|
2452
2468
|
}
|
|
2453
|
-
function chipSelection(market,
|
|
2469
|
+
function chipSelection(market, match, conversationId) {
|
|
2454
2470
|
if (!market || !market.addToSlipEnabled || typeof market.matchOddsId !== "number" || typeof market.price !== "number" || !market.priceFormats) return null;
|
|
2455
|
-
const selection = { matchOddsId: market.matchOddsId, matchId, oddsDecimal: market.price, forms: market.priceFormats };
|
|
2471
|
+
const selection = { matchOddsId: market.matchOddsId, matchId: match.matchId, oddsDecimal: market.price, forms: market.priceFormats };
|
|
2456
2472
|
if (conversationId !== void 0) selection.conversationId = conversationId;
|
|
2457
|
-
return selection;
|
|
2473
|
+
return withMatch(selection, { home: match.homeTeamName, away: match.awayTeamName, kickoffUtc: match.kickoffUtc, marketLabel: market.marketLabel });
|
|
2458
2474
|
}
|
|
2459
2475
|
function chipPriceText(market, format2) {
|
|
2460
2476
|
return typeof market.price === "number" && market.priceFormats ? formatOdds(market.priceFormats, format2) : void 0;
|
|
@@ -5947,7 +5963,8 @@ function useSlipAdd(slip, ui) {
|
|
|
5947
5963
|
const operatorFormat = ui?.oddsFormat ?? "decimal";
|
|
5948
5964
|
return useCallback14(async (selection, { marketDeveloperName, selectionLabel, line }) => {
|
|
5949
5965
|
if (!handler) return { kind: "failed" };
|
|
5950
|
-
const
|
|
5966
|
+
const display = slipDisplay({ ...selection.display, market: marketDeveloperName, selection: selectionLabel, line });
|
|
5967
|
+
const out = toHostSelection(display ? { ...selection, display } : selection, operatorFormat);
|
|
5951
5968
|
const pick = slipPickFields(out, rawLabels ? selectionLabel : void 0, line);
|
|
5952
5969
|
const wireSport = toWireSport3(out.sport);
|
|
5953
5970
|
const sportField = {
|
|
@@ -10520,7 +10537,7 @@ function MarketAccordion({ match, monitor, ui, slip }) {
|
|
|
10520
10537
|
// src/components/LiveFactBlock.tsx
|
|
10521
10538
|
import { useState as useState44 } from "react";
|
|
10522
10539
|
import { jsx as jsx70, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
10523
|
-
function LiveFactBlock({ facts,
|
|
10540
|
+
function LiveFactBlock({ facts, match, ui, slip, onAsk }) {
|
|
10524
10541
|
const [expanded, setExpanded] = useState44(false);
|
|
10525
10542
|
const { oddsFormat } = useOddsSettings();
|
|
10526
10543
|
const [current, ...earlier] = facts;
|
|
@@ -10549,7 +10566,7 @@ function LiveFactBlock({ facts, matchId, ui, slip, onAsk }) {
|
|
|
10549
10566
|
/* @__PURE__ */ jsx70(
|
|
10550
10567
|
SlipButton,
|
|
10551
10568
|
{
|
|
10552
|
-
selection: chipSelection(m,
|
|
10569
|
+
selection: chipSelection(m, match, slip.conversationId),
|
|
10553
10570
|
marketDeveloperName: m.marketDeveloperName,
|
|
10554
10571
|
selectionLabel: m.selectionLabel,
|
|
10555
10572
|
slip,
|
|
@@ -10571,7 +10588,7 @@ function LiveFactBlock({ facts, matchId, ui, slip, onAsk }) {
|
|
|
10571
10588
|
{
|
|
10572
10589
|
type: "button",
|
|
10573
10590
|
className: "ss-w-fact-link",
|
|
10574
|
-
onClick: () => onAsk(current.text, { kind: "liveFact", matchId, subject: current.text.slice(0, 400) }),
|
|
10591
|
+
onClick: () => onAsk(current.text, { kind: "liveFact", matchId: match.matchId, subject: current.text.slice(0, 400) }),
|
|
10575
10592
|
children: ui.liveFactAsk
|
|
10576
10593
|
}
|
|
10577
10594
|
),
|
|
@@ -10762,11 +10779,11 @@ function MonitorMatchCard({ match, promotedPins, monitor, ui, slip, onAsk }) {
|
|
|
10762
10779
|
/* @__PURE__ */ jsx72("span", { className: "ss-w-mon-scorers-ball", "aria-hidden": "true", children: "\u26BD" }),
|
|
10763
10780
|
/* @__PURE__ */ jsx72("ul", { className: "ss-w-mon-scorers-col ss-w-mon-scorers-away", children: awayScorers.map((s, i) => /* @__PURE__ */ jsx72("li", { children: s.label }, `${s.player}-${i}`)) })
|
|
10764
10781
|
] }),
|
|
10765
|
-
live && match.facts && match.facts.length > 0 && /* @__PURE__ */ jsx72(LiveFactBlock, { facts: match.facts,
|
|
10782
|
+
live && match.facts && match.facts.length > 0 && /* @__PURE__ */ jsx72(LiveFactBlock, { facts: match.facts, match, ui, slip, onAsk }),
|
|
10766
10783
|
/* @__PURE__ */ jsx72("div", { className: "ss-w-mon-stats", children: orderedRows.map((row) => {
|
|
10767
10784
|
const { home, away } = splitWidths2(row.homeNum, row.awayNum);
|
|
10768
10785
|
const promoted = isPromoted(row, promotedPins);
|
|
10769
|
-
const selection = chipSelection(row.market, match
|
|
10786
|
+
const selection = chipSelection(row.market, match, slip.conversationId);
|
|
10770
10787
|
const chipPrice = row.market ? chipPriceText(row.market, oddsFormat) : void 0;
|
|
10771
10788
|
return /* @__PURE__ */ jsxs67("div", { className: promoted ? "ss-w-mon-stat ss-w-mon-pstrip" : "ss-w-mon-stat", children: [
|
|
10772
10789
|
/* @__PURE__ */ jsxs67("div", { className: "ss-w-mon-stat-row", children: [
|
|
@@ -11020,7 +11037,7 @@ function usePropsOpen(match, monitor, descriptor) {
|
|
|
11020
11037
|
}, [match.matchId, match.asOfUtc, open]);
|
|
11021
11038
|
return { bundle: monitor.playerProps?.[monitorMatchKey(sport, match.matchId)]?.bundle, live, open };
|
|
11022
11039
|
}
|
|
11023
|
-
function PropPrice({ price, label, ariaName, stat, bundle, descriptor, ui, slip }) {
|
|
11040
|
+
function PropPrice({ price, label, ariaName, player, stat, bundle, descriptor, ui, slip }) {
|
|
11024
11041
|
const { oddsFormat } = useOddsSettings();
|
|
11025
11042
|
const shown2 = formatOdds(price.priceFormats, oddsFormat);
|
|
11026
11043
|
if (bundle.addToSlipEnabled && takesSport(slip, descriptor.sport)) {
|
|
@@ -11036,7 +11053,7 @@ function PropPrice({ price, label, ariaName, stat, bundle, descriptor, ui, slip
|
|
|
11036
11053
|
return /* @__PURE__ */ jsx76(
|
|
11037
11054
|
SlipButton,
|
|
11038
11055
|
{
|
|
11039
|
-
selection,
|
|
11056
|
+
selection: withMatch(selection, { home: bundle.homeAbbreviation, away: bundle.awayAbbreviation, kickoffUtc: bundle.startsAtUtc, marketLabel: stat.label, player }),
|
|
11040
11057
|
marketDeveloperName: stat.marketDeveloperName,
|
|
11041
11058
|
selectionLabel: price.label,
|
|
11042
11059
|
line: price.line != null ? String(price.line) : void 0,
|
|
@@ -11097,7 +11114,7 @@ function PropPlayerPanel({ player: given, bundle, descriptor, ui, slip }) {
|
|
|
11097
11114
|
const hitsOf = (price, text2) => descriptor.showHits && sample > 0 && price.hits != null ? text2(price.hits) : null;
|
|
11098
11115
|
const bars = active ? descriptor.bars(active, player) : [];
|
|
11099
11116
|
const title = typeof descriptor.barsTitle === "function" ? descriptor.barsTitle(bars.length, bars.some((b) => b.live)) : descriptor.barsTitle;
|
|
11100
|
-
const priceProps = { bundle, descriptor, ui, slip };
|
|
11117
|
+
const priceProps = { bundle, descriptor, ui, slip, player: player.name };
|
|
11101
11118
|
const liveValue = (s) => hasLiveLine(player) ? descriptor.live?.(s, player) ?? null : null;
|
|
11102
11119
|
const liveChips = stats.some((s) => liveValue(s) !== null);
|
|
11103
11120
|
return /* @__PURE__ */ jsxs71("div", { className: "ss-w-props-panel", children: [
|
|
@@ -11588,6 +11605,7 @@ function Trends({ bundle, facts, descriptor, ui, slip }) {
|
|
|
11588
11605
|
price: f.price,
|
|
11589
11606
|
label: "",
|
|
11590
11607
|
ariaName: `${f.playerName}, ${bet}`,
|
|
11608
|
+
player: f.playerName,
|
|
11591
11609
|
stat: f,
|
|
11592
11610
|
bundle,
|
|
11593
11611
|
descriptor,
|
|
@@ -11603,7 +11621,7 @@ function Trends({ bundle, facts, descriptor, ui, slip }) {
|
|
|
11603
11621
|
function Scorers({ bundle, scorers, abbreviations, descriptor, ui, slip }) {
|
|
11604
11622
|
const [all, setAll] = useState50(false);
|
|
11605
11623
|
const shown2 = all ? scorers : scorers.slice(0, SCORERS_SHOWN);
|
|
11606
|
-
const cell2 = (name, column, price, stat) => price && stat ? /* @__PURE__ */ jsx80(PropPrice, { price, label: "", ariaName: `${name}, ${column}`, stat, bundle, descriptor, ui, slip }) : /* @__PURE__ */ jsx80("span", { className: "ss-w-props-scorer-none", children: "\u2014" });
|
|
11624
|
+
const cell2 = (name, column, price, stat) => price && stat ? /* @__PURE__ */ jsx80(PropPrice, { price, label: "", ariaName: `${name}, ${column}`, player: name, stat, bundle, descriptor, ui, slip }) : /* @__PURE__ */ jsx80("span", { className: "ss-w-props-scorer-none", children: "\u2014" });
|
|
11607
11625
|
return /* @__PURE__ */ jsxs75("div", { className: "ss-w-props-scorers", children: [
|
|
11608
11626
|
/* @__PURE__ */ jsxs75("div", { className: "ss-w-props-scorer ss-w-props-scorer-head", children: [
|
|
11609
11627
|
/* @__PURE__ */ jsx80("span", { children: ui.nfl.propsPlayer }),
|
|
@@ -11918,12 +11936,12 @@ var hasGames = (s) => s.sets.some((x) => (x.p1Games ?? 0) > 0 || (x.p2Games ?? 0
|
|
|
11918
11936
|
|
|
11919
11937
|
// src/components/TennisFixtureRow.tsx
|
|
11920
11938
|
import { Fragment as Fragment21, jsx as jsx85, jsxs as jsxs80 } from "react/jsx-runtime";
|
|
11921
|
-
function TennisSidePrice({ matchId, tour, price, forms, value, oddsId, player, ui, slip, name, lead, movedLabel }) {
|
|
11939
|
+
function TennisSidePrice({ matchId, tour, pair, price, forms, value, oddsId, player, ui, slip, name, lead, movedLabel }) {
|
|
11922
11940
|
const { oddsFormat } = useOddsSettings();
|
|
11923
11941
|
const added = useSlipState()?.added;
|
|
11924
11942
|
const slipAllowed = !!slip && price.addToSlipEnabled && slipOpenFor(slip, "tennis");
|
|
11925
11943
|
const label = formatOdds(forms, oddsFormat);
|
|
11926
|
-
const selection = slipAllowed && oddsId != null ? {
|
|
11944
|
+
const selection = slipAllowed && oddsId != null ? withMatch({
|
|
11927
11945
|
matchOddsId: oddsId,
|
|
11928
11946
|
matchId,
|
|
11929
11947
|
oddsDecimal: value,
|
|
@@ -11932,7 +11950,7 @@ function TennisSidePrice({ matchId, tour, price, forms, value, oddsId, player, u
|
|
|
11932
11950
|
sport: "tennis",
|
|
11933
11951
|
...tour ? { tour } : {},
|
|
11934
11952
|
...slip.conversationId !== void 0 ? { conversationId: slip.conversationId } : {}
|
|
11935
|
-
} : null;
|
|
11953
|
+
}, pair) : null;
|
|
11936
11954
|
const inSlip = oddsId != null && !!added?.[slipKey({ matchOddsId: oddsId, sport: "tennis" })];
|
|
11937
11955
|
const ariaLabel = `${player} ${label}${movedLabel ? `, ${movedLabel}` : ""}`;
|
|
11938
11956
|
if (selection) {
|
|
@@ -11968,7 +11986,14 @@ function TennisSidePrice({ matchId, tour, price, forms, value, oddsId, player, u
|
|
|
11968
11986
|
] });
|
|
11969
11987
|
}
|
|
11970
11988
|
function TennisPriceCell({ match, price, ui, slip }) {
|
|
11971
|
-
const common = {
|
|
11989
|
+
const common = {
|
|
11990
|
+
matchId: match.matchId,
|
|
11991
|
+
tour: match.tour,
|
|
11992
|
+
price,
|
|
11993
|
+
ui,
|
|
11994
|
+
slip,
|
|
11995
|
+
pair: { home: match.homeTeamName, away: match.awayTeamName, kickoffUtc: match.kickoffUnix > 0 ? new Date(match.kickoffUnix * 1e3).toISOString() : null }
|
|
11996
|
+
};
|
|
11972
11997
|
return /* @__PURE__ */ jsxs80("span", { className: "ss-w-trow-prices", children: [
|
|
11973
11998
|
/* @__PURE__ */ jsx85(TennisSidePrice, { ...common, forms: price.p1, value: price.p1Value, oddsId: price.p1OddsId, player: match.homeTeamName }),
|
|
11974
11999
|
/* @__PURE__ */ jsx85(TennisSidePrice, { ...common, forms: price.p2, value: price.p2Value, oddsId: price.p2OddsId, player: match.awayTeamName })
|
|
@@ -12176,7 +12201,7 @@ function WinnerPrice({ match, t, price, ui, slip }) {
|
|
|
12176
12201
|
const liveBlock = t.live ?? null;
|
|
12177
12202
|
const paused = !!liveBlock?.pricesPaused;
|
|
12178
12203
|
const effective = price && paused ? { ...price, addToSlipEnabled: false } : price;
|
|
12179
|
-
const common = effective ? { matchId: match.matchId, tour: t.header.tour, price: effective, ui, slip } : null;
|
|
12204
|
+
const common = effective ? { matchId: match.matchId, tour: t.header.tour, price: effective, ui, slip, pair: { home: t.p1.name, away: t.p2.name, kickoffUtc: t.header.startsAtUtc } } : null;
|
|
12180
12205
|
const moved = price && (direction(price.p1Direction) || direction(price.p2Direction));
|
|
12181
12206
|
const since = price?.previousAtUtc ? ui.bettingKickoff(price.previousAtUtc).dayLabel : null;
|
|
12182
12207
|
const sides = price && common ? [
|
|
@@ -16773,8 +16798,8 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
16773
16798
|
send(requestFor(next));
|
|
16774
16799
|
}, [empty2, singles, widened, canWiden, view]);
|
|
16775
16800
|
useEffect49(() => {
|
|
16776
|
-
if (coolOff) onCoolOff?.();
|
|
16777
|
-
}, [coolOff, onCoolOff]);
|
|
16801
|
+
if (coolOff) onCoolOff?.(sport);
|
|
16802
|
+
}, [coolOff, onCoolOff, sport]);
|
|
16778
16803
|
if (coolOff) return null;
|
|
16779
16804
|
const nextGames = preset.nextGames?.trim() || null;
|
|
16780
16805
|
const nextAtMs = instantMs(preset.nextGamesAtUtc);
|
|
@@ -18471,7 +18496,10 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
18471
18496
|
.ss-w-combo-leg-market { font-size: 11.5px; font-weight: 600; line-height: 1.25; color: var(--ss-w-faint); overflow-wrap: break-word; }
|
|
18472
18497
|
.ss-w-combo-leg-sel { font-size: 13px; font-weight: 700; line-height: 1.2; color: var(--ss-w-ink); overflow-wrap: break-word; }
|
|
18473
18498
|
.ss-w-combo-leg-price { flex: none; font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 17px; font-weight: 800; line-height: 1.05; color: var(--ss-w-accent); }
|
|
18474
|
-
.ss-w-combo-leg-pick .ss-w-slip {
|
|
18499
|
+
.ss-w-combo-leg-pick .ss-w-slip { display: contents; }
|
|
18500
|
+
.ss-w-combo-leg-pick .ss-w-slip-btn { flex: none; }
|
|
18501
|
+
.ss-w-combo-leg .ss-w-bi-team { white-space: normal; text-overflow: clip; overflow-wrap: break-word; line-height: 1.25; }
|
|
18502
|
+
.ss-w-combo-leg-pick .ss-w-toast { position: static; flex-basis: 100%; width: auto; max-width: none; box-shadow: none; }
|
|
18475
18503
|
.ss-w-combo-leg-stat { font-size: 12px; line-height: 1.45; color: var(--ss-w-ink); background: var(--ss-w-bubble); border-radius: 8px; padding: 6px 9px; }
|
|
18476
18504
|
.ss-w-combo-math { font-family: ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 700; line-height: 1.4; color: var(--ss-w-ink); text-align: right; background: color-mix(in srgb, var(--ss-w-accent) 9%, var(--ss-w-panel)); border-radius: 8px; padding: 8px 10px; overflow-wrap: anywhere; }
|
|
18477
18505
|
.ss-w-combo-note { font-size: 11px; line-height: 1.4; color: var(--ss-w-faint); }
|
|
@@ -20809,17 +20837,26 @@ function StatsWidget(props) {
|
|
|
20809
20837
|
() => [...controller.state.messages].reverse().find((m) => m.role === "assistant" && (m.greetingDashboard !== void 0 || m.greetingDashboards !== void 0)) ?? null,
|
|
20810
20838
|
[controller.state.messages]
|
|
20811
20839
|
);
|
|
20812
|
-
const [
|
|
20813
|
-
const onBuilderCoolOff = useCallback27(() =>
|
|
20840
|
+
const [coolOff, setCoolOff] = useState79(null);
|
|
20841
|
+
const onBuilderCoolOff = useCallback27((sport) => {
|
|
20842
|
+
if (!builderGreeting) return;
|
|
20843
|
+
setCoolOff((prev) => {
|
|
20844
|
+
const sports = prev?.greeting === builderGreeting ? prev.sports : [];
|
|
20845
|
+
return sports.includes(sport) ? prev : { greeting: builderGreeting, sports: [...sports, sport] };
|
|
20846
|
+
});
|
|
20847
|
+
}, [builderGreeting]);
|
|
20814
20848
|
const builderOptions = useMemo13(() => {
|
|
20815
20849
|
const greeting = builderGreeting;
|
|
20816
|
-
if (!greeting
|
|
20850
|
+
if (!greeting) return [];
|
|
20851
|
+
const cooled = coolOff?.greeting === greeting ? coolOff.sports : [];
|
|
20817
20852
|
const sets = switchSets(greeting.greetingDashboards);
|
|
20818
|
-
|
|
20819
|
-
|
|
20820
|
-
|
|
20821
|
-
|
|
20822
|
-
|
|
20853
|
+
const options = sets ? sets.flatMap((s) => s.dashboard.personal?.builder ? [{ sport: s.sport, label: s.label, preset: s.dashboard.personal.builder }] : []) : (() => {
|
|
20854
|
+
const preset = greeting.greetingDashboard?.personal?.builder;
|
|
20855
|
+
const sport = greeting.defaultSport || "football";
|
|
20856
|
+
return preset ? [{ sport, label: sportLabel(ui, sport), preset }] : [];
|
|
20857
|
+
})();
|
|
20858
|
+
return options.filter((o) => !cooled.includes(o.sport));
|
|
20859
|
+
}, [builderGreeting, coolOff, ui]);
|
|
20823
20860
|
const builderSport = [builderSportPick, rememberedSport, latestGreeting?.defaultSport].find((s) => !!s && builderOptions.some((o) => o.sport === s)) ?? builderOptions[0]?.sport ?? "";
|
|
20824
20861
|
const [panelEverOpened, setPanelEverOpened] = useState79(panelOpen);
|
|
20825
20862
|
if (panelOpen && !panelEverOpened) setPanelEverOpened(true);
|