@sensiblestats/widget-react 0.147.0 → 0.149.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,22 @@
1
1
  # @sensiblestats/widget-react
2
2
 
3
+ ## 0.149.0
4
+
5
+ ### Minor Changes
6
+
7
+ - c54bb3a: Show live facts on the NBA monitor card, and let LiveFactBlock, chipSelection and useFactView take a sport scope.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [c54bb3a]
12
+ - @sensiblestats/widget-sdk@0.108.1
13
+
14
+ ## 0.148.0
15
+
16
+ ### Minor Changes
17
+
18
+ - 31d37e3: NFL monitor cards show live facts. A fact's price adds to the slip when the host lists americanfootball, and NFL fact events carry nfl ids and the sport.
19
+
3
20
  ## 0.147.0
4
21
 
5
22
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -39,7 +39,7 @@ module.exports = __toCommonJS(index_exports);
39
39
 
40
40
  // src/StatsWidget.tsx
41
41
  var import_react121 = require("react");
42
- var import_widget_sdk39 = require("@sensiblestats/widget-sdk");
42
+ var import_widget_sdk40 = require("@sensiblestats/widget-sdk");
43
43
 
44
44
  // src/strings/tag.ts
45
45
  function familyOf(tag2) {
@@ -1386,7 +1386,7 @@ function parseCustomTotal(text2, format2) {
1386
1386
  }
1387
1387
 
1388
1388
  // src/version.generated.ts
1389
- var WIDGET_REACT_VERSION = "0.147.0";
1389
+ var WIDGET_REACT_VERSION = "0.149.0";
1390
1390
 
1391
1391
  // src/config.ts
1392
1392
  function hostTag(cfg) {
@@ -2684,10 +2684,13 @@ function slipPickFields(selection, label, line) {
2684
2684
  if (Number.isFinite(odds) && odds > 1 && odds <= MAX_ODDS) fields.odds = odds;
2685
2685
  return fields;
2686
2686
  }
2687
- function chipSelection(market, match, conversationId) {
2687
+ function chipSelection(market, match, conversationId, scope) {
2688
2688
  if (!market || !market.addToSlipEnabled || typeof market.matchOddsId !== "number" || typeof market.price !== "number" || !market.priceFormats) return null;
2689
2689
  const selection = { matchOddsId: market.matchOddsId, matchId: match.matchId, oddsDecimal: market.price, forms: market.priceFormats };
2690
2690
  if (conversationId !== void 0) selection.conversationId = conversationId;
2691
+ const slipSport = (0, import_widget_sdk4.slipSportOf)(scope?.sport);
2692
+ if (slipSport !== void 0) selection.sport = slipSport;
2693
+ if (scope?.tour) selection.tour = scope.tour;
2691
2694
  return withMatch(selection, { home: match.homeTeamName, away: match.awayTeamName, kickoffUtc: match.kickoffUtc, marketLabel: market.marketLabel });
2692
2695
  }
2693
2696
  function chipPriceText(market, format2) {
@@ -6784,7 +6787,7 @@ function AddToSlipButton({ it, slip, ui }) {
6784
6787
 
6785
6788
  // src/components/MarketOddsCardList.tsx
6786
6789
  var import_react43 = require("react");
6787
- var import_widget_sdk21 = require("@sensiblestats/widget-sdk");
6790
+ var import_widget_sdk22 = require("@sensiblestats/widget-sdk");
6788
6791
 
6789
6792
  // src/components/OddsMovementBadge.tsx
6790
6793
  var import_jsx_runtime13 = (
@@ -6938,6 +6941,7 @@ function PriceHistoryButton({ selection, monitor, ui, displayLabel }) {
6938
6941
 
6939
6942
  // src/components/LiveFactBlock.tsx
6940
6943
  var import_react41 = require("react");
6944
+ var import_widget_sdk20 = require("@sensiblestats/widget-sdk");
6941
6945
 
6942
6946
  // src/useFactView.ts
6943
6947
  var import_react40 = require("react");
@@ -6996,7 +7000,7 @@ function evidenceText(f, ui) {
6996
7000
  if (e.since) parts2.push(ui.liveFactSince(e.since));
6997
7001
  return parts2.length > 0 ? parts2.join(" \xB7 ") : void 0;
6998
7002
  }
6999
- function LiveFactBlock({ facts, match, ui, slip, onAsk }) {
7003
+ function LiveFactBlock({ facts, match, ui, slip, onAsk, scope }) {
7000
7004
  const [expanded, setExpanded] = (0, import_react41.useState)(false);
7001
7005
  const { oddsFormat } = useOddsSettings();
7002
7006
  const log = useEventLog();
@@ -7005,7 +7009,10 @@ function LiveFactBlock({ facts, match, ui, slip, onAsk }) {
7005
7009
  const earlier = facts.filter((f) => f.marketState && f !== current);
7006
7010
  const background = facts.filter((f) => !f.marketState).slice(0, BACKGROUND_MAX);
7007
7011
  const m = current?.market;
7008
- const entity2 = current?.marketState && m ? { entityType: "market", entityId: m.marketDeveloperName } : { entityType: "match", entityId: String(match.matchId) };
7012
+ const sport = scope?.sport;
7013
+ const wire = (0, import_widget_sdk20.toWireSport)(sport);
7014
+ const sportFields = wire ? { sport: wire, ...scope?.tour ? { tour: scope.tour } : {} } : {};
7015
+ const entity2 = current?.marketState && m ? { entityType: "market", entityId: (0, import_widget_sdk20.qualifiedId)(sport, "market", m.marketDeveloperName), ...sportFields } : { entityType: "match", entityId: (0, import_widget_sdk20.qualifiedId)(sport, "game", (0, import_widget_sdk20.localIdOf)(sport, match.matchId, scope?.tour)), ...sportFields };
7009
7016
  useFactView(sectionRef, current, entity2);
7010
7017
  if (facts.length === 0) return null;
7011
7018
  const open = current?.marketState === "open" && !!m && !m.isSuspended;
@@ -7033,7 +7040,7 @@ function LiveFactBlock({ facts, match, ui, slip, onAsk }) {
7033
7040
  open ? /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(
7034
7041
  SlipButton,
7035
7042
  {
7036
- selection: chipSelection(m, match, slip.conversationId),
7043
+ selection: slipOpenFor(slip, sport) ? chipSelection(m, match, slip.conversationId, scope) : null,
7037
7044
  marketDeveloperName: m.marketDeveloperName,
7038
7045
  selectionLabel: m.selectionLabel,
7039
7046
  slip,
@@ -7065,7 +7072,7 @@ function LiveFactBlock({ facts, match, ui, slip, onAsk }) {
7065
7072
  className: "ss-w-fact-link",
7066
7073
  onClick: () => {
7067
7074
  log?.log({ name: "fact_ask", ...entity2, factId: String(current.id), factKey: current.factKey });
7068
- onAsk(current.text, { kind: "liveFact", matchId: match.matchId, subject: current.text.slice(0, 400) });
7075
+ onAsk(current.text, scope ? { kind: "match", subject: scope.subject, ...sportFields, ...scope.tour ? {} : { matchId: match.matchId } } : { kind: "liveFact", matchId: match.matchId, subject: current.text.slice(0, 400) });
7069
7076
  },
7070
7077
  children: ui.liveFactAsk
7071
7078
  }
@@ -7086,10 +7093,10 @@ function LiveFactBlock({ facts, match, ui, slip, onAsk }) {
7086
7093
 
7087
7094
  // src/components/AllMarketsButton.tsx
7088
7095
  var import_react42 = require("react");
7089
- var import_widget_sdk20 = require("@sensiblestats/widget-sdk");
7096
+ var import_widget_sdk21 = require("@sensiblestats/widget-sdk");
7090
7097
  var import_jsx_runtime18 = require("react/jsx-runtime");
7091
7098
  function allMarketsCount(vm, monitor) {
7092
- if (!monitor?.enabled || !vm.pinEnabled || (0, import_widget_sdk20.sportOf)(vm.sport) !== void 0) return null;
7099
+ if (!monitor?.enabled || !vm.pinEnabled || (0, import_widget_sdk21.sportOf)(vm.sport) !== void 0) return null;
7093
7100
  return vm.marketCount !== void 0 && vm.marketCount >= 2 ? vm.marketCount : null;
7094
7101
  }
7095
7102
  function AllMarketsButton({ vm, count: count2, monitor, ui, surface }) {
@@ -7134,7 +7141,7 @@ function OddsRow({ vm, row, ui, slip, inSlipIds, history, suppressSlip }) {
7134
7141
  const previousOdds = row.previousPriceForms ? formatOdds(row.previousPriceForms, oddsFormat) : void 0;
7135
7142
  const slipAllowed = vm.addToSlipEnabled && !suppressSlip && slipOpenFor(slip, vm.sport) && !nflStarted(vm, Date.now());
7136
7143
  const selection = slipAllowed ? marketOddsRowToSlipSelection(vm, row, slip.conversationId) : null;
7137
- const inSlip = !!inSlipIds && row.matchOddsId != null && !!inSlipIds[slipKey({ matchOddsId: row.matchOddsId, sport: (0, import_widget_sdk21.slipSportOf)(vm.sport) })];
7144
+ const inSlip = !!inSlipIds && row.matchOddsId != null && !!inSlipIds[slipKey({ matchOddsId: row.matchOddsId, sport: (0, import_widget_sdk22.slipSportOf)(vm.sport) })];
7138
7145
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: "ss-w-mo-row", children: [
7139
7146
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("span", { className: "ss-w-mo-sel", children: row.selection }),
7140
7147
  /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(OddsMovementBadge, { previous: previousOdds, current: odds, direction: row.movementDirection, ui }),
@@ -7178,8 +7185,8 @@ function MarketOddsCard({ vm, ui, slip, monitor, inSlipIds, hideHeader, pinRef }
7178
7185
  const id = window.setTimeout(() => setStaleTick((n) => n + 1), Math.max(0, asOfMs + STALE_AFTER_MS - Date.now()) + 1);
7179
7186
  return () => window.clearTimeout(id);
7180
7187
  }, [watchStale, asOfMs]);
7181
- const showPin = !!monitor && (0, import_widget_sdk21.mayPinOrSlip)(vm.sport) && (vm.pinEnabled || (0, import_widget_sdk21.slipSportOf)(vm.sport) !== void 0) && !live && (!!pinRef || !vm.isLive);
7182
- const history = showPin && !pinRef && !hideHeader && (0, import_widget_sdk21.sportOf)(vm.sport) === void 0 ? monitor : void 0;
7188
+ const showPin = !!monitor && (0, import_widget_sdk22.mayPinOrSlip)(vm.sport) && (vm.pinEnabled || (0, import_widget_sdk22.slipSportOf)(vm.sport) !== void 0) && !live && (!!pinRef || !vm.isLive);
7189
+ const history = showPin && !pinRef && !hideHeader && (0, import_widget_sdk22.sportOf)(vm.sport) === void 0 ? monitor : void 0;
7183
7190
  const allMarkets = !hideHeader && !pinRef && !live && !vm.isLive ? allMarketsCount(vm, monitor) : null;
7184
7191
  const showHeader = !!vm.competition || vm.isLive || !!kickoff || showPin || !!live;
7185
7192
  return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)("div", { className: hideHeader ? "ss-w-mocard ss-w-mocard--bare" : "ss-w-mocard", children: [
@@ -7207,7 +7214,7 @@ function MarketOddsCard({ vm, ui, slip, monitor, inSlipIds, hideHeader, pinRef }
7207
7214
  {
7208
7215
  ui,
7209
7216
  monitor,
7210
- pin: pinRef ?? { kind: "match", matchId: vm.matchId, sport: (0, import_widget_sdk21.slipSportOf)(vm.sport) },
7217
+ pin: pinRef ?? { kind: "match", matchId: vm.matchId, sport: (0, import_widget_sdk22.slipSportOf)(vm.sport) },
7211
7218
  market: pinRef ? void 0 : vm.marketDeveloperName
7212
7219
  }
7213
7220
  ) : null
@@ -7536,7 +7543,7 @@ function FollowSuggestions({ chips, ui, controller, holds, sport }) {
7536
7543
  }
7537
7544
 
7538
7545
  // src/components/dashboard/v8/TeamStats.tsx
7539
- var import_widget_sdk22 = require("@sensiblestats/widget-sdk");
7546
+ var import_widget_sdk23 = require("@sensiblestats/widget-sdk");
7540
7547
  var import_jsx_runtime26 = require("react/jsx-runtime");
7541
7548
  var RESULTS = ["W", "D", "L"];
7542
7549
  var results = (form) => (form ?? []).filter((r) => RESULTS.includes(r));
@@ -7551,7 +7558,7 @@ function teamCardHasContent(card) {
7551
7558
  if (card.homeLabel && card.awayLabel) return true;
7552
7559
  return results(card.form).length > 0 || results(card.homeForm).length > 0 || results(card.awayForm).length > 0 || !!card.h2h || !!card.fact;
7553
7560
  }
7554
- var drawsShown = (sport, draws) => draws > 0 || (0, import_widget_sdk22.sportOf)(sport) === void 0 && (0, import_widget_sdk22.fromWireSport)(sport) === void 0;
7561
+ var drawsShown = (sport, draws) => draws > 0 || (0, import_widget_sdk23.sportOf)(sport) === void 0 && (0, import_widget_sdk23.fromWireSport)(sport) === void 0;
7555
7562
  function TeamStats({ card, ui, sport }) {
7556
7563
  const pair = named2(card);
7557
7564
  const h2h = card.h2h;
@@ -10096,7 +10103,7 @@ function TennisInsightList({ insights, ui }) {
10096
10103
 
10097
10104
  // src/components/CompactOddsList.tsx
10098
10105
  var import_react65 = require("react");
10099
- var import_widget_sdk23 = require("@sensiblestats/widget-sdk");
10106
+ var import_widget_sdk24 = require("@sensiblestats/widget-sdk");
10100
10107
 
10101
10108
  // src/compactList.ts
10102
10109
  var COMPACT_MIN_CARDS = 3;
@@ -10194,7 +10201,7 @@ function Row2({ row, columns, ui, slip, monitor, rowRef }) {
10194
10201
  const vm = row.card;
10195
10202
  useNextKickoffRender(isNfl(vm.sport) ? [vm.kickoffUtc] : []);
10196
10203
  const count2 = allMarketsCount(vm, monitor);
10197
- const nflPin = (0, import_widget_sdk23.sportOf)(vm.sport) === "americanfootball" && !vm.isLive;
10204
+ const nflPin = (0, import_widget_sdk24.sportOf)(vm.sport) === "americanfootball" && !vm.isLive;
10198
10205
  const kickoffFallback = vm.kickoffUtc ? ui.bettingKickoff(vm.kickoffUtc) : void 0;
10199
10206
  const when = vm.isLive ? ui.liveLabel : vm.kickoffLabel ?? (kickoffFallback ? `${kickoffFallback.dayLabel} ${kickoffFallback.time}` : void 0);
10200
10207
  return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("div", { className: "ss-w-mol-row", ref: rowRef, tabIndex: rowRef ? -1 : void 0, children: [
@@ -10212,7 +10219,7 @@ function Row2({ row, columns, ui, slip, monitor, rowRef }) {
10212
10219
  /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "ss-w-mol-cells", style: { gridTemplateColumns: `repeat(${row.cells.length || columns}, minmax(0, 1fr))` }, children: row.cells.map((cell2) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Cell2, { row, cell: cell2, ui, slip }, cell2.row.key)) }),
10213
10220
  /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("span", { className: vm.isLive ? "ss-w-mol-side ss-w-mol-side--live" : "ss-w-mol-side", children: [
10214
10221
  when ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { className: "ss-w-mol-when", children: when }) : null,
10215
- count2 !== null && monitor && ui ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AllMarketsButton, { vm, count: count2, monitor, ui, surface: "list" }) : monitor && (vm.pinEnabled && vm.isLive || nflPin) && (0, import_widget_sdk23.mayPinOrSlip)(vm.sport) ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(PinToggle, { ui, monitor, pin: { kind: "match", matchId: vm.matchId, sport: (0, import_widget_sdk23.slipSportOf)(vm.sport) } }) : null
10222
+ count2 !== null && monitor && ui ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(AllMarketsButton, { vm, count: count2, monitor, ui, surface: "list" }) : monitor && (vm.pinEnabled && vm.isLive || nflPin) && (0, import_widget_sdk24.mayPinOrSlip)(vm.sport) ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(PinToggle, { ui, monitor, pin: { kind: "match", matchId: vm.matchId, sport: (0, import_widget_sdk24.slipSportOf)(vm.sport) } }) : null
10216
10223
  ] })
10217
10224
  ] });
10218
10225
  }
@@ -11477,7 +11484,7 @@ function TabBar({ monitor, ui, matchCount, trendsCount, liveCount, hasSchedule,
11477
11484
  var import_react89 = require("react");
11478
11485
 
11479
11486
  // src/components/MarketAccordion.tsx
11480
- var import_widget_sdk24 = require("@sensiblestats/widget-sdk");
11487
+ var import_widget_sdk25 = require("@sensiblestats/widget-sdk");
11481
11488
  var import_jsx_runtime77 = require("react/jsx-runtime");
11482
11489
  function MarketAccordion({ match, monitor, ui, slip }) {
11483
11490
  const slipState = useSlipState();
@@ -11485,7 +11492,7 @@ function MarketAccordion({ match, monitor, ui, slip }) {
11485
11492
  if (markets.length === 0) return null;
11486
11493
  const mk = monitorMatchKey(match.sport, match.matchId);
11487
11494
  const open = monitor.openMarket[mk] ?? null;
11488
- const sport = (0, import_widget_sdk24.slipSportOf)(match.sport);
11495
+ const sport = (0, import_widget_sdk25.slipSportOf)(match.sport);
11489
11496
  return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "ss-w-acc", children: markets.map((m) => {
11490
11497
  const isOpen = open === m.marketDeveloperName && !m.suspended;
11491
11498
  const key = `${mk}:${m.marketDeveloperName}`;
@@ -12322,7 +12329,7 @@ function UnavailableCard({ match, monitor, ui, sport }) {
12322
12329
  /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "ss-w-mon-grace", children: ui.graceNote })
12323
12330
  ] }) });
12324
12331
  }
12325
- function NbaMonitorCard({ match, monitor, ui, slip }) {
12332
+ function NbaMonitorCard({ match, monitor, ui, slip, onAsk }) {
12326
12333
  const b = match.basketball;
12327
12334
  if (!b) return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(UnavailableCard, { match, monitor, ui, sport: "basketball" });
12328
12335
  const live = match.phase === "live";
@@ -12391,7 +12398,18 @@ function NbaMonitorCard({ match, monitor, ui, slip }) {
12391
12398
  ": ",
12392
12399
  t.value
12393
12400
  ] }, t.key) : /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("span", {}, t.key)) })
12394
- ] })
12401
+ ] }),
12402
+ live && match.facts && match.facts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
12403
+ LiveFactBlock,
12404
+ {
12405
+ facts: match.facts,
12406
+ match,
12407
+ ui,
12408
+ slip,
12409
+ onAsk,
12410
+ scope: { sport: "basketball", subject: `${match.awayTeamName ?? ""} ${ui.venue.away} ${match.homeTeamName ?? ""}`.trim() }
12411
+ }
12412
+ )
12395
12413
  ] }),
12396
12414
  /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(NbaFormSection, { match, monitor, ui }, `form-${match.matchId}`),
12397
12415
  /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(MarketAccordion, { match, monitor, ui, slip }),
@@ -12731,7 +12749,7 @@ function playedThrough(f) {
12731
12749
  };
12732
12750
  return Math.max(nonZero(f.homePeriods), nonZero(f.awayPeriods));
12733
12751
  }
12734
- function NflMonitorCard({ match, monitor, ui, slip }) {
12752
+ function NflMonitorCard({ match, monitor, ui, slip, onAsk }) {
12735
12753
  const f = match.americanFootball;
12736
12754
  if (!f) return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(UnavailableCard, { match, monitor, ui, sport: "americanfootball" });
12737
12755
  const live = match.phase === "live";
@@ -12804,6 +12822,17 @@ function NflMonitorCard({ match, monitor, ui, slip }) {
12804
12822
  ] })
12805
12823
  ] })
12806
12824
  ] }),
12825
+ live && match.facts && match.facts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
12826
+ LiveFactBlock,
12827
+ {
12828
+ facts: match.facts,
12829
+ match,
12830
+ ui,
12831
+ slip,
12832
+ onAsk,
12833
+ scope: { sport: "americanfootball", subject: `${match.awayTeamName ?? f.awayAbbreviation} ${ui.venue.away} ${match.homeTeamName ?? f.homeAbbreviation}` }
12834
+ }
12835
+ ),
12807
12836
  /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(MarketAccordion, { match, monitor, ui, slip }),
12808
12837
  /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(NflPropsSection, { match, monitor, ui, slip }, `props-${match.matchId}`),
12809
12838
  /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(NflFormSection, { match, monitor, ui }, `form-${match.matchId}`)
@@ -12812,14 +12841,14 @@ function NflMonitorCard({ match, monitor, ui, slip }) {
12812
12841
 
12813
12842
  // src/components/TennisMonitorCard.tsx
12814
12843
  var import_react87 = require("react");
12815
- var import_widget_sdk27 = require("@sensiblestats/widget-sdk");
12844
+ var import_widget_sdk28 = require("@sensiblestats/widget-sdk");
12816
12845
 
12817
12846
  // src/components/TennisFixtureRow.tsx
12818
- var import_widget_sdk26 = require("@sensiblestats/widget-sdk");
12847
+ var import_widget_sdk27 = require("@sensiblestats/widget-sdk");
12819
12848
 
12820
12849
  // src/components/FixtureRow.tsx
12821
12850
  var import_react85 = require("react");
12822
- var import_widget_sdk25 = require("@sensiblestats/widget-sdk");
12851
+ var import_widget_sdk26 = require("@sensiblestats/widget-sdk");
12823
12852
  var import_jsx_runtime92 = require("react/jsx-runtime");
12824
12853
  function splitAtFirstSpace(label) {
12825
12854
  const i = label.indexOf(" ");
@@ -12850,7 +12879,7 @@ function FixtureRow({ match, state, stale, ui, monitor, onOpen }) {
12850
12879
  const { isLive, hasScore, score, ticked, when: clock3 } = rowStatusOf(state, stale, ui);
12851
12880
  const when = clock3 ?? kickoffLabel(match.kickoffUnix, ui.locale, clockOf(ui), ui.timeZone);
12852
12881
  const isUsSport = sportKeyOf(match.sport) !== "football";
12853
- const pinSport = (0, import_widget_sdk25.slipSportOf)(match.sport);
12882
+ const pinSport = (0, import_widget_sdk26.slipSportOf)(match.sport);
12854
12883
  const liveTone = isLive || state?.isHalfTime;
12855
12884
  const clockParts = isUsSport && isLive && ticked !== null && !state?.isHalfTime ? splitAtFirstSpace(ticked) : null;
12856
12885
  const dayMarker = isUsSport && !liveTone && state?.phase !== "live" && isOtherLocalDay(match.kickoffUnix, /* @__PURE__ */ new Date(), ui.timeZone) ? formatDate(match.kickoffUnix * 1e3, ui.locale, { weekday: "short", timeZone: ui.timeZone }) : null;
@@ -13001,7 +13030,7 @@ function TennisFixtureRow({ match, state, stale, ui, prices, slip, monitor }) {
13001
13030
  const live = isTreatedLive(state, stale);
13002
13031
  const round = match.round ? ui.tennis.round[match.round] ?? match.round : null;
13003
13032
  const showPrices = !live && prices !== void 0 && prices.byId !== null && !prices.stale;
13004
- const entry = showPrices ? isKnownTour(match.tour) ? prices.byId.get((0, import_widget_sdk26.matchKey)("tennis", match.matchId, match.tour)) : void 0 : void 0;
13033
+ const entry = showPrices ? isKnownTour(match.tour) ? prices.byId.get((0, import_widget_sdk27.matchKey)("tennis", match.matchId, match.tour)) : void 0 : void 0;
13005
13034
  const pin = isKnownTour(match.tour) ? { kind: "match", matchId: match.matchId, sport: "tennis", tour: match.tour } : null;
13006
13035
  const pinned = !!monitor && !!pin && monitor.isPinned(pinKey(pin));
13007
13036
  const pinnable = !!monitor?.enabled && !!pin;
@@ -13301,7 +13330,7 @@ function TennisMonitorCard({ match, monitor, ui, slip, onAsk }) {
13301
13330
  const surface = t.header.surface ? surfaceLabel(ui, t.header.surface) : null;
13302
13331
  const ask = () => {
13303
13332
  if (!onAsk) return;
13304
- const wire = (0, import_widget_sdk27.toWireSport)("tennis");
13333
+ const wire = (0, import_widget_sdk28.toWireSport)("tennis");
13305
13334
  const grounding = {
13306
13335
  kind: "match",
13307
13336
  subject: `${t.p1.name} ${ui.tennis.vs} ${t.p2.name}`,
@@ -13360,7 +13389,7 @@ function TennisMonitorCard({ match, monitor, ui, slip, onAsk }) {
13360
13389
 
13361
13390
  // src/components/ScoreboardStrip.tsx
13362
13391
  var import_react88 = require("react");
13363
- var import_widget_sdk28 = require("@sensiblestats/widget-sdk");
13392
+ var import_widget_sdk29 = require("@sensiblestats/widget-sdk");
13364
13393
  var import_jsx_runtime97 = require("react/jsx-runtime");
13365
13394
  function nbaStatus(m, ui) {
13366
13395
  const b = m.basketball;
@@ -13472,7 +13501,7 @@ function ScoreboardStrip({ tiles, selectedKey, onSelect, ui }) {
13472
13501
  const m = tile.match;
13473
13502
  if (!m) return null;
13474
13503
  const nba = isBasketball(m);
13475
- const sport = (0, import_widget_sdk28.sportOf)(m.sport);
13504
+ const sport = (0, import_widget_sdk29.sportOf)(m.sport);
13476
13505
  const inPlay = m.phase === "live" && !atBreak(m) && !(isAmericanFootball(m) && m.americanFootball?.period == null);
13477
13506
  const status2 = nba ? nbaStatus(m, ui) : isTennis(m) ? tennisStatus(m, ui) : isAmericanFootball(m) ? nflStatus(m, ui) : footballStatus(m, ui);
13478
13507
  const selected = tile.pin.key === selectedKey;
@@ -13502,7 +13531,7 @@ function ScoreboardStrip({ tiles, selectedKey, onSelect, ui }) {
13502
13531
  }
13503
13532
 
13504
13533
  // src/components/TrendsStrip.tsx
13505
- var import_widget_sdk29 = require("@sensiblestats/widget-sdk");
13534
+ var import_widget_sdk30 = require("@sensiblestats/widget-sdk");
13506
13535
  var import_jsx_runtime98 = require("react/jsx-runtime");
13507
13536
  function status(m, ui) {
13508
13537
  if (m.isSettled || m.phase === "fullTime") return ui.fullTimeLabel;
@@ -13518,7 +13547,7 @@ function TrendTileButton({ tile, selected, onSelect, ui }) {
13518
13547
  const { oddsFormat } = useOddsSettings();
13519
13548
  const { market: m, vm } = tile;
13520
13549
  const inPlay = m.phase === "live" && !m.isSuspended && !m.isSettled;
13521
- const sport = (0, import_widget_sdk29.sportOf)(m.card?.sport ?? void 0);
13550
+ const sport = (0, import_widget_sdk30.sportOf)(m.card?.sport ?? void 0);
13522
13551
  const home = vm?.homeTeamName ?? m.homeTeamName ?? "";
13523
13552
  const away = vm?.awayTeamName ?? m.awayTeamName ?? "";
13524
13553
  const score = m.phase !== "preMatch" && typeof m.homeScore === "number" ? `${m.homeScore}\u2013${m.awayScore ?? 0}` : null;
@@ -13560,21 +13589,21 @@ function TrendsStrip({ tiles, selectedKey, onSelect, ui }) {
13560
13589
  }
13561
13590
 
13562
13591
  // src/monitorSeed.ts
13563
- var import_widget_sdk30 = require("@sensiblestats/widget-sdk");
13592
+ var import_widget_sdk31 = require("@sensiblestats/widget-sdk");
13564
13593
  function buildSeedIndex(groups) {
13565
13594
  const index = /* @__PURE__ */ new Map();
13566
13595
  for (const group of groups) {
13567
13596
  for (const match of group.matches) {
13568
13597
  const sport = match.sport ?? group.sport ?? "football";
13569
13598
  if (sport !== "football") continue;
13570
- index.set((0, import_widget_sdk30.matchKey)("football", match.matchId), { match, competitionName: group.competitionName });
13599
+ index.set((0, import_widget_sdk31.matchKey)("football", match.matchId), { match, competitionName: group.competitionName });
13571
13600
  }
13572
13601
  }
13573
13602
  return index;
13574
13603
  }
13575
13604
  function seedFor(pin, index, states, stale, now) {
13576
13605
  if (pin.kind !== "match" || pin.sport !== void 0) return void 0;
13577
- const key = (0, import_widget_sdk30.matchKey)("football", pin.matchId);
13606
+ const key = (0, import_widget_sdk31.matchKey)("football", pin.matchId);
13578
13607
  const hit = index.get(key);
13579
13608
  if (!hit) return void 0;
13580
13609
  const { match, competitionName } = hit;
@@ -13642,7 +13671,7 @@ function MatchesPanel({ monitor, ui, slip, onAsk, discovery }) {
13642
13671
  tiles.filter((t) => t.match).length >= 2 && /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(ScoreboardStrip, { tiles, selectedKey: selected.pin.key, onSelect: monitor.selectMatch, ui }),
13643
13672
  /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: "ss-w-mon-list", children: [
13644
13673
  !m && /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(MonitorSkeleton, { pin: selected.pin, monitor, ui }),
13645
- m && (isTennis(m) ? /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(TennisMonitorCard, { match: m, monitor, ui, slip, onAsk }) : sportKeyOf(m.sport) === "americanfootball" ? /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(NflMonitorCard, { match: m, monitor, ui, slip }) : isBasketball(m) ? /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(NbaMonitorCard, { match: m, monitor, ui, slip }) : /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: "ss-w-mon-item", children: [
13674
+ m && (isTennis(m) ? /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(TennisMonitorCard, { match: m, monitor, ui, slip, onAsk }) : sportKeyOf(m.sport) === "americanfootball" ? /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(NflMonitorCard, { match: m, monitor, ui, slip, onAsk }) : isBasketball(m) ? /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(NbaMonitorCard, { match: m, monitor, ui, slip, onAsk }) : /* @__PURE__ */ (0, import_jsx_runtime99.jsxs)("div", { className: "ss-w-mon-item", children: [
13646
13675
  /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
13647
13676
  MonitorMatchCard,
13648
13677
  {
@@ -13702,10 +13731,10 @@ function TrendsPanel({ monitor, ui, slip }) {
13702
13731
 
13703
13732
  // src/components/LivePanel.tsx
13704
13733
  var import_react92 = require("react");
13705
- var import_widget_sdk35 = require("@sensiblestats/widget-sdk");
13734
+ var import_widget_sdk36 = require("@sensiblestats/widget-sdk");
13706
13735
 
13707
13736
  // src/scheduleView.ts
13708
- var import_widget_sdk31 = require("@sensiblestats/widget-sdk");
13737
+ var import_widget_sdk32 = require("@sensiblestats/widget-sdk");
13709
13738
 
13710
13739
  // src/search.ts
13711
13740
  function foldSearchText(s) {
@@ -13725,7 +13754,7 @@ function matchingFixtures(group, query) {
13725
13754
 
13726
13755
  // src/scheduleView.ts
13727
13756
  var TOP_COUNT = 3;
13728
- var keyOf3 = (m) => (0, import_widget_sdk31.matchKey)(m.sport, m.matchId, m.tour);
13757
+ var keyOf3 = (m) => (0, import_widget_sdk32.matchKey)(m.sport, m.matchId, m.tour);
13729
13758
  var sportOf13 = (g) => g.sport ?? "football";
13730
13759
  function isMember(group, pinnedKeys) {
13731
13760
  return group.isStarred || group.isLearned || group.matches.some((m) => pinnedKeys.has(keyOf3(m)));
@@ -13795,7 +13824,7 @@ function liveCountsBySport(groups, states, stale) {
13795
13824
  }
13796
13825
 
13797
13826
  // src/components/LeagueGroup.tsx
13798
- var import_widget_sdk32 = require("@sensiblestats/widget-sdk");
13827
+ var import_widget_sdk33 = require("@sensiblestats/widget-sdk");
13799
13828
 
13800
13829
  // src/components/ScheduleRow.tsx
13801
13830
  var import_jsx_runtime100 = require("react/jsx-runtime");
@@ -13860,7 +13889,7 @@ function LeagueGroup({ view, open, onToggle, disambiguate, rowCap, onShowAll, on
13860
13889
  ScheduleRow,
13861
13890
  {
13862
13891
  match: m,
13863
- state: states.get((0, import_widget_sdk32.matchKey)(m.sport, m.matchId, m.tour)),
13892
+ state: states.get((0, import_widget_sdk33.matchKey)(m.sport, m.matchId, m.tour)),
13864
13893
  stale,
13865
13894
  ui,
13866
13895
  monitor,
@@ -13868,7 +13897,7 @@ function LeagueGroup({ view, open, onToggle, disambiguate, rowCap, onShowAll, on
13868
13897
  slip,
13869
13898
  onOpen: (el) => onOpenMatch(m, group.competitionName, el)
13870
13899
  },
13871
- (0, import_widget_sdk32.matchKey)(m.sport, m.matchId, m.tour)
13900
+ (0, import_widget_sdk33.matchKey)(m.sport, m.matchId, m.tour)
13872
13901
  )),
13873
13902
  hidden > 0 && onShowAll && /* @__PURE__ */ (0, import_jsx_runtime102.jsx)("button", { type: "button", className: "ss-w-lg-showall", onClick: onShowAll, children: ui.showAllN(rows.length) })
13874
13903
  ] })
@@ -13877,7 +13906,7 @@ function LeagueGroup({ view, open, onToggle, disambiguate, rowCap, onShowAll, on
13877
13906
 
13878
13907
  // src/components/MatchSheet.tsx
13879
13908
  var import_react91 = require("react");
13880
- var import_widget_sdk33 = require("@sensiblestats/widget-sdk");
13909
+ var import_widget_sdk34 = require("@sensiblestats/widget-sdk");
13881
13910
 
13882
13911
  // src/useModalDialog.ts
13883
13912
  var import_react90 = require("react");
@@ -13943,7 +13972,7 @@ function MatchSheet({ match, league, state, stale, ui, monitor, onAsk, onClose,
13943
13972
  const log = useEventLog();
13944
13973
  const titleId = (0, import_react91.useId)();
13945
13974
  const [limitHit, setLimitHit] = (0, import_react91.useState)(false);
13946
- const pinSport = (0, import_widget_sdk33.slipSportOf)(match.sport);
13975
+ const pinSport = (0, import_widget_sdk34.slipSportOf)(match.sport);
13947
13976
  const tour = pinSport === "tennis" && isKnownTour(match.tour) ? match.tour : void 0;
13948
13977
  const followable = pinSport !== "tennis" || tour !== void 0;
13949
13978
  const pinned = followable && monitor.isPinned(pinKey(pinSport ? { kind: "match", matchId: match.matchId, sport: pinSport, ...tour ? { tour } : {} } : { kind: "match", matchId: match.matchId }));
@@ -13964,11 +13993,11 @@ function MatchSheet({ match, league, state, stale, ui, monitor, onAsk, onClose,
13964
13993
  return;
13965
13994
  }
13966
13995
  if (result === "added") {
13967
- const wireSport = (0, import_widget_sdk33.toWireSport)(pinSport);
13996
+ const wireSport = (0, import_widget_sdk34.toWireSport)(pinSport);
13968
13997
  log?.log({
13969
13998
  name: "pin_add",
13970
13999
  entityType: "match",
13971
- entityId: (0, import_widget_sdk33.qualifiedId)(pinSport, "game", (0, import_widget_sdk33.localIdOf)(pinSport, match.matchId, tour)),
14000
+ entityId: (0, import_widget_sdk34.qualifiedId)(pinSport, "game", (0, import_widget_sdk34.localIdOf)(pinSport, match.matchId, tour)),
13972
14001
  ...wireSport ? { sport: wireSport } : {}
13973
14002
  });
13974
14003
  }
@@ -13976,7 +14005,7 @@ function MatchSheet({ match, league, state, stale, ui, monitor, onAsk, onClose,
13976
14005
  };
13977
14006
  const ask = () => {
13978
14007
  if (!onAsk) return;
13979
- const wire = (0, import_widget_sdk33.toWireSport)(match.sport);
14008
+ const wire = (0, import_widget_sdk34.toWireSport)(match.sport);
13980
14009
  const grounding = {
13981
14010
  kind: treatedLive ? "liveFact" : "match",
13982
14011
  ...pinSport === "tennis" ? {} : { matchId: match.matchId },
@@ -14012,7 +14041,7 @@ function MatchSheet({ match, league, state, stale, ui, monitor, onAsk, onClose,
14012
14041
  }
14013
14042
 
14014
14043
  // src/components/SportChips.tsx
14015
- var import_widget_sdk34 = require("@sensiblestats/widget-sdk");
14044
+ var import_widget_sdk35 = require("@sensiblestats/widget-sdk");
14016
14045
  var import_jsx_runtime104 = require("react/jsx-runtime");
14017
14046
  var ORDER2 = ["football", "basketball", "americanfootball", "tennis"];
14018
14047
  function SportChips({ offered, value, onChange, counts, ui }) {
@@ -14047,7 +14076,7 @@ function LivePanel({ discovery, ui, monitor, sport, offered, onSport, league, on
14047
14076
  const [toggled, setToggled] = (0, import_react92.useState)(/* @__PURE__ */ new Map());
14048
14077
  const [sheet, setSheet] = (0, import_react92.useState)(null);
14049
14078
  const pinnedKeys = (0, import_react92.useMemo)(
14050
- () => new Set(monitor.pins.filter((p) => p.kind === "match").map((p) => (0, import_widget_sdk35.matchKey)(p.sport, p.matchId, p.tour))),
14079
+ () => new Set(monitor.pins.filter((p) => p.kind === "match").map((p) => (0, import_widget_sdk36.matchKey)(p.sport, p.matchId, p.tour))),
14051
14080
  [monitor.pins]
14052
14081
  );
14053
14082
  const counts = liveCountsBySport(groups, states, stale);
@@ -14123,14 +14152,14 @@ function LivePanel({ discovery, ui, monitor, sport, offered, onSport, league, on
14123
14152
  ScheduleRow,
14124
14153
  {
14125
14154
  match,
14126
- state: states.get((0, import_widget_sdk35.matchKey)(match.sport, match.matchId, match.tour)),
14155
+ state: states.get((0, import_widget_sdk36.matchKey)(match.sport, match.matchId, match.tour)),
14127
14156
  stale,
14128
14157
  ui,
14129
14158
  monitor,
14130
14159
  onOpen: (el) => openMatch(match, group.competitionName, el)
14131
14160
  }
14132
14161
  )
14133
- ] }, (0, import_widget_sdk35.matchKey)(match.sport, match.matchId, match.tour))),
14162
+ ] }, (0, import_widget_sdk36.matchKey)(match.sport, match.matchId, match.tour))),
14134
14163
  /* @__PURE__ */ (0, import_jsx_runtime105.jsx)("button", { type: "button", className: "ss-w-lp-seeall", onClick: onSeeAll, children: ui.seeAllMatches })
14135
14164
  ] })
14136
14165
  ] }),
@@ -14139,7 +14168,7 @@ function LivePanel({ discovery, ui, monitor, sport, offered, onSport, league, on
14139
14168
  {
14140
14169
  match: sheet.match,
14141
14170
  league: sheet.league,
14142
- state: states.get((0, import_widget_sdk35.matchKey)(sheet.match.sport, sheet.match.matchId, sheet.match.tour)),
14171
+ state: states.get((0, import_widget_sdk36.matchKey)(sheet.match.sport, sheet.match.matchId, sheet.match.tour)),
14143
14172
  stale,
14144
14173
  ui,
14145
14174
  monitor,
@@ -14153,11 +14182,11 @@ function LivePanel({ discovery, ui, monitor, sport, offered, onSport, league, on
14153
14182
 
14154
14183
  // src/components/ScheduleMatchesPanel.tsx
14155
14184
  var import_react96 = require("react");
14156
- var import_widget_sdk37 = require("@sensiblestats/widget-sdk");
14185
+ var import_widget_sdk38 = require("@sensiblestats/widget-sdk");
14157
14186
 
14158
14187
  // src/useTennisRowPrices.ts
14159
14188
  var import_react93 = require("react");
14160
- var import_widget_sdk36 = require("@sensiblestats/widget-sdk");
14189
+ var import_widget_sdk37 = require("@sensiblestats/widget-sdk");
14161
14190
  var TENNIS_PRICE_POLL_MS = 6e4;
14162
14191
  function useTennisRowPrices(a) {
14163
14192
  const [state, setState] = (0, import_react93.useState)({ byId: null, stale: false });
@@ -14184,7 +14213,7 @@ function useTennisRowPrices(a) {
14184
14213
  setState({ byId: null, stale: false });
14185
14214
  return;
14186
14215
  }
14187
- setState({ byId: new Map(rows.map((r) => [(0, import_widget_sdk36.matchKey)("tennis", r.matchId, r.tour), r.price ?? null])), stale: false });
14216
+ setState({ byId: new Map(rows.map((r) => [(0, import_widget_sdk37.matchKey)("tennis", r.matchId, r.tour), r.price ?? null])), stale: false });
14188
14217
  },
14189
14218
  () => {
14190
14219
  if (mine !== latest.current) return;
@@ -14334,7 +14363,7 @@ function ScheduleMatchesPanel({ discovery, ui, monitor, sport, offered, onSport,
14334
14363
  }, [day, selected, onDay]);
14335
14364
  const isToday = selected === today;
14336
14365
  const pinnedKeys = (0, import_react96.useMemo)(
14337
- () => new Set(monitor.pins.filter((p) => p.kind === "match").map((p) => (0, import_widget_sdk37.matchKey)(p.sport, p.matchId, p.tour))),
14366
+ () => new Set(monitor.pins.filter((p) => p.kind === "match").map((p) => (0, import_widget_sdk38.matchKey)(p.sport, p.matchId, p.tour))),
14338
14367
  [monitor.pins]
14339
14368
  );
14340
14369
  const searching = query.trim().length > 0;
@@ -14354,7 +14383,7 @@ function ScheduleMatchesPanel({ discovery, ui, monitor, sport, offered, onSport,
14354
14383
  const { oddsOffered } = useOddsSettings();
14355
14384
  const tennisKeys = /* @__PURE__ */ new Map();
14356
14385
  const addTennis = (m) => {
14357
- if (m.sport === "tennis" && isKnownTour(m.tour)) tennisKeys.set((0, import_widget_sdk37.matchKey)("tennis", m.matchId, m.tour), { tour: m.tour, matchId: m.matchId });
14386
+ if (m.sport === "tennis" && isKnownTour(m.tour)) tennisKeys.set((0, import_widget_sdk38.matchKey)("tennis", m.matchId, m.tour), { tour: m.tour, matchId: m.matchId });
14358
14387
  };
14359
14388
  for (const s of priced.sections) for (const v of s.groups) for (const m of v.rows) addTennis(m);
14360
14389
  for (const { match } of priced.afterMidnight) addTennis(match);
@@ -14440,7 +14469,7 @@ function ScheduleMatchesPanel({ discovery, ui, monitor, sport, offered, onSport,
14440
14469
  ScheduleRow,
14441
14470
  {
14442
14471
  match,
14443
- state: states.get((0, import_widget_sdk37.matchKey)(match.sport, match.matchId, match.tour)),
14472
+ state: states.get((0, import_widget_sdk38.matchKey)(match.sport, match.matchId, match.tour)),
14444
14473
  stale,
14445
14474
  ui,
14446
14475
  monitor,
@@ -14449,7 +14478,7 @@ function ScheduleMatchesPanel({ discovery, ui, monitor, sport, offered, onSport,
14449
14478
  onOpen: (el) => openMatch(match, group.competitionName, el)
14450
14479
  }
14451
14480
  )
14452
- ] }, (0, import_widget_sdk37.matchKey)(match.sport, match.matchId, match.tour)))
14481
+ ] }, (0, import_widget_sdk38.matchKey)(match.sport, match.matchId, match.tour)))
14453
14482
  ] }),
14454
14483
  empty2 && /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("div", { className: "ss-w-today-empty", children: searching ? ui.noLeagueResults : ui.noMatchesDay })
14455
14484
  ] }),
@@ -14458,7 +14487,7 @@ function ScheduleMatchesPanel({ discovery, ui, monitor, sport, offered, onSport,
14458
14487
  {
14459
14488
  match: sheet.match,
14460
14489
  league: sheet.league,
14461
- state: states.get((0, import_widget_sdk37.matchKey)(sheet.match.sport, sheet.match.matchId, sheet.match.tour)),
14490
+ state: states.get((0, import_widget_sdk38.matchKey)(sheet.match.sport, sheet.match.matchId, sheet.match.tour)),
14462
14491
  stale,
14463
14492
  ui,
14464
14493
  monitor,
@@ -17758,7 +17787,7 @@ var import_react117 = require("react");
17758
17787
 
17759
17788
  // src/components/dashboard/v8/SentenceBuilder.tsx
17760
17789
  var import_react116 = require("react");
17761
- var import_widget_sdk38 = require("@sensiblestats/widget-sdk");
17790
+ var import_widget_sdk39 = require("@sensiblestats/widget-sdk");
17762
17791
  var import_jsx_runtime148 = require("react/jsx-runtime");
17763
17792
  var TOTALS = ["any", "3", "5", "10", "20", "50"];
17764
17793
  var BASE_LEGS = [1, 2, 3, 4];
@@ -17829,7 +17858,7 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, keepMarket
17829
17858
  widen: v.widen,
17830
17859
  ...extra?.variant ? { variant: extra.variant } : {},
17831
17860
  ...extra?.keep?.length ? { keep: sorted(extra.keep) } : {},
17832
- ...extra?.swapped?.length ? { swapped: [...new Set(extra.swapped)].slice(-import_widget_sdk38.MAX_SWAPPED_IDS) } : {},
17861
+ ...extra?.swapped?.length ? { swapped: [...new Set(extra.swapped)].slice(-import_widget_sdk39.MAX_SWAPPED_IDS) } : {},
17833
17862
  ...operatorUserId ? { operatorUserId } : {},
17834
17863
  ...anonymousUserId ? { anonymousUserId } : {}
17835
17864
  });
@@ -21991,7 +22020,7 @@ function buildClient(props) {
21991
22020
  return { client: props.client, conversation: props.client.conversation() };
21992
22021
  }
21993
22022
  const cfg = props.config;
21994
- const client = new import_widget_sdk39.StatsWidgetClient(toClientOptions(cfg));
22023
+ const client = new import_widget_sdk40.StatsWidgetClient(toClientOptions(cfg));
21995
22024
  return { client, conversation: client.conversation(toUserContext(cfg)) };
21996
22025
  } catch (err) {
21997
22026
  console.error("[StatsWidget] failed to initialize:", err instanceof Error ? err.message : err);