@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 CHANGED
@@ -1,5 +1,16 @@
1
1
  # @sensiblestats/widget-react
2
2
 
3
+ ## 0.130.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Smart Acca cools off per sport: a builder 404 for one sport no longer hides the tab for the others. Every add-to-slip selection now carries `display` (match names, kickoff, raw market, selection and line, the player on a prop, and the market as the widget showed it), so a host can label a pick it cannot look up; display never rides tracking or event-log payloads. Acca legs wrap long player and team names instead of cutting them, and the added-to-slip toast sits on its own row.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @sensiblestats/widget-sdk@0.93.0
13
+
3
14
  ## 0.129.0
4
15
 
5
16
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -1295,6 +1295,21 @@ function buildLocaleStrings(table, tag2, clock3 = "24h", timeZone) {
1295
1295
  }
1296
1296
 
1297
1297
  // src/odds.ts
1298
+ var DISPLAY_KEYS = ["home", "away", "kickoffUtc", "market", "marketLabel", "selection", "line", "player"];
1299
+ var DISPLAY_MAX = 80;
1300
+ function slipDisplay(parts2) {
1301
+ const out = {};
1302
+ for (const k of DISPLAY_KEYS) {
1303
+ const v = typeof parts2[k] === "string" ? parts2[k].trim() : "";
1304
+ if (!v || k === "kickoffUtc" && !Number.isFinite(Date.parse(v))) continue;
1305
+ out[k] = v.slice(0, DISPLAY_MAX);
1306
+ }
1307
+ return Object.keys(out).length > 0 ? out : void 0;
1308
+ }
1309
+ function withMatch(selection, match) {
1310
+ const display = slipDisplay({ home: match.home, away: match.away, kickoffUtc: match.kickoffUtc, marketLabel: match.marketLabel, player: match.player });
1311
+ return display ? { ...selection, display } : selection;
1312
+ }
1298
1313
  function formatOdds(forms, format2) {
1299
1314
  return (format2 === "american" ? forms.american : format2 === "fractional" ? forms.fractional : forms.decimal) ?? forms.decimal;
1300
1315
  }
@@ -1308,7 +1323,7 @@ function parseOddsFormat(value) {
1308
1323
  }
1309
1324
 
1310
1325
  // src/version.generated.ts
1311
- var WIDGET_REACT_VERSION = "0.129.0";
1326
+ var WIDGET_REACT_VERSION = "0.130.0";
1312
1327
 
1313
1328
  // src/config.ts
1314
1329
  function hostTag(cfg) {
@@ -1986,7 +2001,7 @@ function toSlipSelection(vm, conversationId) {
1986
2001
  if (vm.quotedAtUtc !== void 0) selection.quotedAtUtc = vm.quotedAtUtc;
1987
2002
  if (vm.id !== void 0) selection.insightId = vm.id;
1988
2003
  if (conversationId !== void 0) selection.conversationId = conversationId;
1989
- return selection;
2004
+ return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc, marketLabel: vm.market });
1990
2005
  }
1991
2006
  function toMarketOddsVM(card) {
1992
2007
  const rows = Array.isArray(card.rows) ? card.rows : [];
@@ -2103,7 +2118,7 @@ function marketOddsRowToSlipSelection(vm, row, conversationId) {
2103
2118
  const slipSport = (0, import_widget_sdk.slipSportOf)(vm.sport);
2104
2119
  if (slipSport) selection.sport = slipSport;
2105
2120
  if (conversationId !== void 0) selection.conversationId = conversationId;
2106
- return selection;
2121
+ return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc, marketLabel: vm.market });
2107
2122
  }
2108
2123
  function finite(v) {
2109
2124
  return typeof v === "number" && Number.isFinite(v) ? v : void 0;
@@ -2177,7 +2192,7 @@ function comboLegToSlipSelection(leg, conversationId) {
2177
2192
  if (leg.quotedAtUtc !== void 0) selection.quotedAtUtc = leg.quotedAtUtc;
2178
2193
  if (leg.sport !== void 0) selection.sport = leg.sport;
2179
2194
  if (conversationId !== void 0) selection.conversationId = conversationId;
2180
- return selection;
2195
+ return withMatch(selection, { home: leg.homeTeamName, away: leg.awayTeamName, kickoffUtc: leg.kickoffUtc, marketLabel: leg.market });
2181
2196
  }
2182
2197
  var isNum = (v) => typeof v === "number" && Number.isFinite(v);
2183
2198
  var isObj = (v) => typeof v === "object" && v !== null;
@@ -2310,7 +2325,7 @@ function toNbaSlipSelection(vm, key, conversationId) {
2310
2325
  sport: "basketball"
2311
2326
  };
2312
2327
  if (conversationId !== void 0) selection.conversationId = conversationId;
2313
- return selection;
2328
+ return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc });
2314
2329
  }
2315
2330
  function nbaCoHitLegs(vm, conversationId) {
2316
2331
  if (vm.evidence.kind !== "co_hit") return [];
@@ -2323,6 +2338,7 @@ function nbaCoHitLegs(vm, conversationId) {
2323
2338
  matchId: vm.matchId,
2324
2339
  homeTeamName: vm.homeTeamName ?? "",
2325
2340
  awayTeamName: vm.awayTeamName ?? "",
2341
+ kickoffUtc: vm.kickoffUtc ?? void 0,
2326
2342
  market: vm.title,
2327
2343
  marketDeveloperName: s.marketDeveloperName,
2328
2344
  selection: s.selectionLabel,
@@ -2429,7 +2445,7 @@ function toNflSlipSelection(vm, key, nowMs, conversationId) {
2429
2445
  sport: "americanfootball"
2430
2446
  };
2431
2447
  if (conversationId !== void 0) selection.conversationId = conversationId;
2432
- return selection;
2448
+ return withMatch(selection, { home: vm.homeTeamName, away: vm.awayTeamName, kickoffUtc: vm.kickoffUtc });
2433
2449
  }
2434
2450
 
2435
2451
  // src/slipKey.ts
@@ -2488,11 +2504,11 @@ function slipPickFields(selection, label, line) {
2488
2504
  if (Number.isFinite(odds) && odds > 1 && odds <= MAX_ODDS) fields.odds = odds;
2489
2505
  return fields;
2490
2506
  }
2491
- function chipSelection(market, matchId, conversationId) {
2507
+ function chipSelection(market, match, conversationId) {
2492
2508
  if (!market || !market.addToSlipEnabled || typeof market.matchOddsId !== "number" || typeof market.price !== "number" || !market.priceFormats) return null;
2493
- const selection = { matchOddsId: market.matchOddsId, matchId, oddsDecimal: market.price, forms: market.priceFormats };
2509
+ const selection = { matchOddsId: market.matchOddsId, matchId: match.matchId, oddsDecimal: market.price, forms: market.priceFormats };
2494
2510
  if (conversationId !== void 0) selection.conversationId = conversationId;
2495
- return selection;
2511
+ return withMatch(selection, { home: match.homeTeamName, away: match.awayTeamName, kickoffUtc: match.kickoffUtc, marketLabel: market.marketLabel });
2496
2512
  }
2497
2513
  function chipPriceText(market, format2) {
2498
2514
  return typeof market.price === "number" && market.priceFormats ? formatOdds(market.priceFormats, format2) : void 0;
@@ -5985,7 +6001,8 @@ function useSlipAdd(slip, ui) {
5985
6001
  const operatorFormat = ui?.oddsFormat ?? "decimal";
5986
6002
  return (0, import_react25.useCallback)(async (selection, { marketDeveloperName, selectionLabel, line }) => {
5987
6003
  if (!handler) return { kind: "failed" };
5988
- const out = toHostSelection(selection, operatorFormat);
6004
+ const display = slipDisplay({ ...selection.display, market: marketDeveloperName, selection: selectionLabel, line });
6005
+ const out = toHostSelection(display ? { ...selection, display } : selection, operatorFormat);
5989
6006
  const pick = slipPickFields(out, rawLabels ? selectionLabel : void 0, line);
5990
6007
  const wireSport = (0, import_widget_sdk16.toWireSport)(out.sport);
5991
6008
  const sportField = {
@@ -10558,7 +10575,7 @@ function MarketAccordion({ match, monitor, ui, slip }) {
10558
10575
  // src/components/LiveFactBlock.tsx
10559
10576
  var import_react61 = require("react");
10560
10577
  var import_jsx_runtime70 = require("react/jsx-runtime");
10561
- function LiveFactBlock({ facts, matchId, ui, slip, onAsk }) {
10578
+ function LiveFactBlock({ facts, match, ui, slip, onAsk }) {
10562
10579
  const [expanded, setExpanded] = (0, import_react61.useState)(false);
10563
10580
  const { oddsFormat } = useOddsSettings();
10564
10581
  const [current, ...earlier] = facts;
@@ -10587,7 +10604,7 @@ function LiveFactBlock({ facts, matchId, ui, slip, onAsk }) {
10587
10604
  /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
10588
10605
  SlipButton,
10589
10606
  {
10590
- selection: chipSelection(m, matchId, slip.conversationId),
10607
+ selection: chipSelection(m, match, slip.conversationId),
10591
10608
  marketDeveloperName: m.marketDeveloperName,
10592
10609
  selectionLabel: m.selectionLabel,
10593
10610
  slip,
@@ -10609,7 +10626,7 @@ function LiveFactBlock({ facts, matchId, ui, slip, onAsk }) {
10609
10626
  {
10610
10627
  type: "button",
10611
10628
  className: "ss-w-fact-link",
10612
- onClick: () => onAsk(current.text, { kind: "liveFact", matchId, subject: current.text.slice(0, 400) }),
10629
+ onClick: () => onAsk(current.text, { kind: "liveFact", matchId: match.matchId, subject: current.text.slice(0, 400) }),
10613
10630
  children: ui.liveFactAsk
10614
10631
  }
10615
10632
  ),
@@ -10800,11 +10817,11 @@ function MonitorMatchCard({ match, promotedPins, monitor, ui, slip, onAsk }) {
10800
10817
  /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "ss-w-mon-scorers-ball", "aria-hidden": "true", children: "\u26BD" }),
10801
10818
  /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("ul", { className: "ss-w-mon-scorers-col ss-w-mon-scorers-away", children: awayScorers.map((s, i) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("li", { children: s.label }, `${s.player}-${i}`)) })
10802
10819
  ] }),
10803
- live && match.facts && match.facts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(LiveFactBlock, { facts: match.facts, matchId: match.matchId, ui, slip, onAsk }),
10820
+ live && match.facts && match.facts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(LiveFactBlock, { facts: match.facts, match, ui, slip, onAsk }),
10804
10821
  /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("div", { className: "ss-w-mon-stats", children: orderedRows.map((row) => {
10805
10822
  const { home, away } = splitWidths2(row.homeNum, row.awayNum);
10806
10823
  const promoted = isPromoted(row, promotedPins);
10807
- const selection = chipSelection(row.market, match.matchId, slip.conversationId);
10824
+ const selection = chipSelection(row.market, match, slip.conversationId);
10808
10825
  const chipPrice = row.market ? chipPriceText(row.market, oddsFormat) : void 0;
10809
10826
  return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: promoted ? "ss-w-mon-stat ss-w-mon-pstrip" : "ss-w-mon-stat", children: [
10810
10827
  /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "ss-w-mon-stat-row", children: [
@@ -11058,7 +11075,7 @@ function usePropsOpen(match, monitor, descriptor) {
11058
11075
  }, [match.matchId, match.asOfUtc, open]);
11059
11076
  return { bundle: monitor.playerProps?.[monitorMatchKey(sport, match.matchId)]?.bundle, live, open };
11060
11077
  }
11061
- function PropPrice({ price, label, ariaName, stat, bundle, descriptor, ui, slip }) {
11078
+ function PropPrice({ price, label, ariaName, player, stat, bundle, descriptor, ui, slip }) {
11062
11079
  const { oddsFormat } = useOddsSettings();
11063
11080
  const shown2 = formatOdds(price.priceFormats, oddsFormat);
11064
11081
  if (bundle.addToSlipEnabled && takesSport(slip, descriptor.sport)) {
@@ -11074,7 +11091,7 @@ function PropPrice({ price, label, ariaName, stat, bundle, descriptor, ui, slip
11074
11091
  return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
11075
11092
  SlipButton,
11076
11093
  {
11077
- selection,
11094
+ selection: withMatch(selection, { home: bundle.homeAbbreviation, away: bundle.awayAbbreviation, kickoffUtc: bundle.startsAtUtc, marketLabel: stat.label, player }),
11078
11095
  marketDeveloperName: stat.marketDeveloperName,
11079
11096
  selectionLabel: price.label,
11080
11097
  line: price.line != null ? String(price.line) : void 0,
@@ -11135,7 +11152,7 @@ function PropPlayerPanel({ player: given, bundle, descriptor, ui, slip }) {
11135
11152
  const hitsOf = (price, text2) => descriptor.showHits && sample > 0 && price.hits != null ? text2(price.hits) : null;
11136
11153
  const bars = active ? descriptor.bars(active, player) : [];
11137
11154
  const title = typeof descriptor.barsTitle === "function" ? descriptor.barsTitle(bars.length, bars.some((b) => b.live)) : descriptor.barsTitle;
11138
- const priceProps = { bundle, descriptor, ui, slip };
11155
+ const priceProps = { bundle, descriptor, ui, slip, player: player.name };
11139
11156
  const liveValue = (s) => hasLiveLine(player) ? descriptor.live?.(s, player) ?? null : null;
11140
11157
  const liveChips = stats.some((s) => liveValue(s) !== null);
11141
11158
  return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "ss-w-props-panel", children: [
@@ -11626,6 +11643,7 @@ function Trends({ bundle, facts, descriptor, ui, slip }) {
11626
11643
  price: f.price,
11627
11644
  label: "",
11628
11645
  ariaName: `${f.playerName}, ${bet}`,
11646
+ player: f.playerName,
11629
11647
  stat: f,
11630
11648
  bundle,
11631
11649
  descriptor,
@@ -11641,7 +11659,7 @@ function Trends({ bundle, facts, descriptor, ui, slip }) {
11641
11659
  function Scorers({ bundle, scorers, abbreviations, descriptor, ui, slip }) {
11642
11660
  const [all, setAll] = (0, import_react67.useState)(false);
11643
11661
  const shown2 = all ? scorers : scorers.slice(0, SCORERS_SHOWN);
11644
- const cell2 = (name, column, price, stat) => price && stat ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(PropPrice, { price, label: "", ariaName: `${name}, ${column}`, stat, bundle, descriptor, ui, slip }) : /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "ss-w-props-scorer-none", children: "\u2014" });
11662
+ const cell2 = (name, column, price, stat) => price && stat ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(PropPrice, { price, label: "", ariaName: `${name}, ${column}`, player: name, stat, bundle, descriptor, ui, slip }) : /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "ss-w-props-scorer-none", children: "\u2014" });
11645
11663
  return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "ss-w-props-scorers", children: [
11646
11664
  /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "ss-w-props-scorer ss-w-props-scorer-head", children: [
11647
11665
  /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { children: ui.nfl.propsPlayer }),
@@ -11956,12 +11974,12 @@ var hasGames = (s) => s.sets.some((x) => (x.p1Games ?? 0) > 0 || (x.p2Games ?? 0
11956
11974
 
11957
11975
  // src/components/TennisFixtureRow.tsx
11958
11976
  var import_jsx_runtime85 = require("react/jsx-runtime");
11959
- function TennisSidePrice({ matchId, tour, price, forms, value, oddsId, player, ui, slip, name, lead, movedLabel }) {
11977
+ function TennisSidePrice({ matchId, tour, pair, price, forms, value, oddsId, player, ui, slip, name, lead, movedLabel }) {
11960
11978
  const { oddsFormat } = useOddsSettings();
11961
11979
  const added = useSlipState()?.added;
11962
11980
  const slipAllowed = !!slip && price.addToSlipEnabled && slipOpenFor(slip, "tennis");
11963
11981
  const label = formatOdds(forms, oddsFormat);
11964
- const selection = slipAllowed && oddsId != null ? {
11982
+ const selection = slipAllowed && oddsId != null ? withMatch({
11965
11983
  matchOddsId: oddsId,
11966
11984
  matchId,
11967
11985
  oddsDecimal: value,
@@ -11970,7 +11988,7 @@ function TennisSidePrice({ matchId, tour, price, forms, value, oddsId, player, u
11970
11988
  sport: "tennis",
11971
11989
  ...tour ? { tour } : {},
11972
11990
  ...slip.conversationId !== void 0 ? { conversationId: slip.conversationId } : {}
11973
- } : null;
11991
+ }, pair) : null;
11974
11992
  const inSlip = oddsId != null && !!added?.[slipKey({ matchOddsId: oddsId, sport: "tennis" })];
11975
11993
  const ariaLabel = `${player} ${label}${movedLabel ? `, ${movedLabel}` : ""}`;
11976
11994
  if (selection) {
@@ -12006,7 +12024,14 @@ function TennisSidePrice({ matchId, tour, price, forms, value, oddsId, player, u
12006
12024
  ] });
12007
12025
  }
12008
12026
  function TennisPriceCell({ match, price, ui, slip }) {
12009
- const common = { matchId: match.matchId, tour: match.tour, price, ui, slip };
12027
+ const common = {
12028
+ matchId: match.matchId,
12029
+ tour: match.tour,
12030
+ price,
12031
+ ui,
12032
+ slip,
12033
+ pair: { home: match.homeTeamName, away: match.awayTeamName, kickoffUtc: match.kickoffUnix > 0 ? new Date(match.kickoffUnix * 1e3).toISOString() : null }
12034
+ };
12010
12035
  return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("span", { className: "ss-w-trow-prices", children: [
12011
12036
  /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(TennisSidePrice, { ...common, forms: price.p1, value: price.p1Value, oddsId: price.p1OddsId, player: match.homeTeamName }),
12012
12037
  /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(TennisSidePrice, { ...common, forms: price.p2, value: price.p2Value, oddsId: price.p2OddsId, player: match.awayTeamName })
@@ -12214,7 +12239,7 @@ function WinnerPrice({ match, t, price, ui, slip }) {
12214
12239
  const liveBlock = t.live ?? null;
12215
12240
  const paused = !!liveBlock?.pricesPaused;
12216
12241
  const effective = price && paused ? { ...price, addToSlipEnabled: false } : price;
12217
- const common = effective ? { matchId: match.matchId, tour: t.header.tour, price: effective, ui, slip } : null;
12242
+ 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;
12218
12243
  const moved = price && (direction(price.p1Direction) || direction(price.p2Direction));
12219
12244
  const since = price?.previousAtUtc ? ui.bettingKickoff(price.previousAtUtc).dayLabel : null;
12220
12245
  const sides = price && common ? [
@@ -16811,8 +16836,8 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
16811
16836
  send(requestFor(next));
16812
16837
  }, [empty2, singles, widened, canWiden, view]);
16813
16838
  (0, import_react97.useEffect)(() => {
16814
- if (coolOff) onCoolOff?.();
16815
- }, [coolOff, onCoolOff]);
16839
+ if (coolOff) onCoolOff?.(sport);
16840
+ }, [coolOff, onCoolOff, sport]);
16816
16841
  if (coolOff) return null;
16817
16842
  const nextGames = preset.nextGames?.trim() || null;
16818
16843
  const nextAtMs = instantMs(preset.nextGamesAtUtc);
@@ -18509,7 +18534,10 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
18509
18534
  .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; }
18510
18535
  .ss-w-combo-leg-sel { font-size: 13px; font-weight: 700; line-height: 1.2; color: var(--ss-w-ink); overflow-wrap: break-word; }
18511
18536
  .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); }
18512
- .ss-w-combo-leg-pick .ss-w-slip { flex: none; }
18537
+ .ss-w-combo-leg-pick .ss-w-slip { display: contents; }
18538
+ .ss-w-combo-leg-pick .ss-w-slip-btn { flex: none; }
18539
+ .ss-w-combo-leg .ss-w-bi-team { white-space: normal; text-overflow: clip; overflow-wrap: break-word; line-height: 1.25; }
18540
+ .ss-w-combo-leg-pick .ss-w-toast { position: static; flex-basis: 100%; width: auto; max-width: none; box-shadow: none; }
18513
18541
  .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; }
18514
18542
  .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; }
18515
18543
  .ss-w-combo-note { font-size: 11px; line-height: 1.4; color: var(--ss-w-faint); }
@@ -20847,17 +20875,26 @@ function StatsWidget(props) {
20847
20875
  () => [...controller.state.messages].reverse().find((m) => m.role === "assistant" && (m.greetingDashboard !== void 0 || m.greetingDashboards !== void 0)) ?? null,
20848
20876
  [controller.state.messages]
20849
20877
  );
20850
- const [coolOffGreeting, setCoolOffGreeting] = (0, import_react102.useState)(null);
20851
- const onBuilderCoolOff = (0, import_react102.useCallback)(() => setCoolOffGreeting(builderGreeting), [builderGreeting]);
20878
+ const [coolOff, setCoolOff] = (0, import_react102.useState)(null);
20879
+ const onBuilderCoolOff = (0, import_react102.useCallback)((sport) => {
20880
+ if (!builderGreeting) return;
20881
+ setCoolOff((prev) => {
20882
+ const sports = prev?.greeting === builderGreeting ? prev.sports : [];
20883
+ return sports.includes(sport) ? prev : { greeting: builderGreeting, sports: [...sports, sport] };
20884
+ });
20885
+ }, [builderGreeting]);
20852
20886
  const builderOptions = (0, import_react102.useMemo)(() => {
20853
20887
  const greeting = builderGreeting;
20854
- if (!greeting || greeting === coolOffGreeting) return [];
20888
+ if (!greeting) return [];
20889
+ const cooled = coolOff?.greeting === greeting ? coolOff.sports : [];
20855
20890
  const sets = switchSets(greeting.greetingDashboards);
20856
- if (sets) return sets.flatMap((s) => s.dashboard.personal?.builder ? [{ sport: s.sport, label: s.label, preset: s.dashboard.personal.builder }] : []);
20857
- const preset = greeting.greetingDashboard?.personal?.builder;
20858
- const sport = greeting.defaultSport || "football";
20859
- return preset ? [{ sport, label: sportLabel(ui, sport), preset }] : [];
20860
- }, [builderGreeting, coolOffGreeting, ui]);
20891
+ const options = sets ? sets.flatMap((s) => s.dashboard.personal?.builder ? [{ sport: s.sport, label: s.label, preset: s.dashboard.personal.builder }] : []) : (() => {
20892
+ const preset = greeting.greetingDashboard?.personal?.builder;
20893
+ const sport = greeting.defaultSport || "football";
20894
+ return preset ? [{ sport, label: sportLabel(ui, sport), preset }] : [];
20895
+ })();
20896
+ return options.filter((o) => !cooled.includes(o.sport));
20897
+ }, [builderGreeting, coolOff, ui]);
20861
20898
  const builderSport = [builderSportPick, rememberedSport, latestGreeting?.defaultSport].find((s) => !!s && builderOptions.some((o) => o.sport === s)) ?? builderOptions[0]?.sport ?? "";
20862
20899
  const [panelEverOpened, setPanelEverOpened] = (0, import_react102.useState)(panelOpen);
20863
20900
  if (panelOpen && !panelEverOpened) setPanelEverOpened(true);