@sensiblestats/widget-react 0.131.0 → 0.133.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/index.cjs +465 -351
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +34 -4
- package/dist/index.d.ts +34 -4
- package/dist/index.js +420 -307
- package/dist/index.js.map +1 -1
- package/dist/styles.css +12 -5
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/StatsWidget.tsx
|
|
2
|
-
import { useCallback as
|
|
2
|
+
import { useCallback as useCallback28, useEffect as useEffect54, useMemo as useMemo13, useRef as useRef46, useState as useState80 } from "react";
|
|
3
3
|
import { StatsWidgetClient } from "@sensiblestats/widget-sdk";
|
|
4
4
|
|
|
5
5
|
// src/strings/tag.ts
|
|
@@ -1285,7 +1285,7 @@ function parseOddsFormat(value) {
|
|
|
1285
1285
|
}
|
|
1286
1286
|
|
|
1287
1287
|
// src/version.generated.ts
|
|
1288
|
-
var WIDGET_REACT_VERSION = "0.
|
|
1288
|
+
var WIDGET_REACT_VERSION = "0.133.0";
|
|
1289
1289
|
|
|
1290
1290
|
// src/config.ts
|
|
1291
1291
|
function hostTag(cfg) {
|
|
@@ -1650,8 +1650,9 @@ function normalizeUi(cfg, loaded) {
|
|
|
1650
1650
|
};
|
|
1651
1651
|
}
|
|
1652
1652
|
function toClientOptions(cfg) {
|
|
1653
|
-
const opts = { operatorId: cfg.operatorId, publicKey: cfg.publicKey, client:
|
|
1653
|
+
const opts = { operatorId: cfg.operatorId, publicKey: cfg.publicKey, client: `${cfg.transport?.client ?? "widget-react"}/${WIDGET_REACT_VERSION}` };
|
|
1654
1654
|
if (cfg.baseUrl !== void 0) opts.baseUrl = cfg.baseUrl;
|
|
1655
|
+
if (cfg.transport?.fetch !== void 0) opts.fetch = cfg.transport.fetch;
|
|
1655
1656
|
return opts;
|
|
1656
1657
|
}
|
|
1657
1658
|
function toUserContext(cfg) {
|
|
@@ -1847,7 +1848,9 @@ function readStatCells(raw) {
|
|
|
1847
1848
|
for (const entry of raw) {
|
|
1848
1849
|
const label = str(entry.label);
|
|
1849
1850
|
const value = num(entry.value) ?? str(entry.value);
|
|
1850
|
-
if (label
|
|
1851
|
+
if (label === void 0 || value === void 0) continue;
|
|
1852
|
+
const note = str(entry.note);
|
|
1853
|
+
cells.push({ label, value, ...note !== void 0 ? { note } : {}, ...entry.muted === true ? { muted: true } : {} });
|
|
1851
1854
|
}
|
|
1852
1855
|
return cells;
|
|
1853
1856
|
}
|
|
@@ -1861,6 +1864,7 @@ function toCardVM(card) {
|
|
|
1861
1864
|
competitionId: typeof s.competitionId === "number" ? s.competitionId : null,
|
|
1862
1865
|
label,
|
|
1863
1866
|
image: str(s.imagePath),
|
|
1867
|
+
period: str(s.period),
|
|
1864
1868
|
stats: readStatCells(s.stats)
|
|
1865
1869
|
};
|
|
1866
1870
|
}).filter((s) => s !== null) : [];
|
|
@@ -1871,6 +1875,7 @@ function toCardVM(card) {
|
|
|
1871
1875
|
image: str(card.imagePath) ?? str(card.imageUrl) ?? str(card.image_url) ?? str(card.logoUrl) ?? str(card.logo),
|
|
1872
1876
|
sub: str(card.subtitle) ?? str(card.teamName) ?? str(card.leagueName) ?? str(card.position),
|
|
1873
1877
|
season: str(card.seasonName),
|
|
1878
|
+
chip: str(card.chip),
|
|
1874
1879
|
scopes
|
|
1875
1880
|
};
|
|
1876
1881
|
}
|
|
@@ -7428,7 +7433,7 @@ var WIRE_TO_PUBLIC = {
|
|
|
7428
7433
|
|
|
7429
7434
|
// src/popupTelemetry.ts
|
|
7430
7435
|
import { useCallback as useCallback22, useEffect as useEffect24, useRef as useRef19 } from "react";
|
|
7431
|
-
function usePopupTelemetry(log, isOpen, popupText, dismissPopup) {
|
|
7436
|
+
function usePopupTelemetry(log, isOpen, popupText, dismissPopup, confirmedShown) {
|
|
7432
7437
|
const shownRef = useRef19(/* @__PURE__ */ new Set());
|
|
7433
7438
|
const closedTextRef = useRef19(null);
|
|
7434
7439
|
useEffect24(() => {
|
|
@@ -7437,23 +7442,70 @@ function usePopupTelemetry(log, isOpen, popupText, dismissPopup) {
|
|
|
7437
7442
|
closedTextRef.current = null;
|
|
7438
7443
|
return;
|
|
7439
7444
|
}
|
|
7440
|
-
|
|
7441
|
-
|
|
7442
|
-
|
|
7445
|
+
const text2 = confirmedShown === void 0 || confirmedShown === popupText ? popupText : null;
|
|
7446
|
+
closedTextRef.current = text2;
|
|
7447
|
+
if (text2 && !shownRef.current.has(text2)) {
|
|
7448
|
+
shownRef.current.add(text2);
|
|
7443
7449
|
log?.log({ name: "popup_shown" });
|
|
7444
7450
|
}
|
|
7445
|
-
}, [log, isOpen, popupText]);
|
|
7451
|
+
}, [log, isOpen, popupText, confirmedShown]);
|
|
7446
7452
|
return useCallback22(() => {
|
|
7447
7453
|
log?.log({ name: "popup_dismissed" });
|
|
7448
7454
|
dismissPopup();
|
|
7449
7455
|
}, [log, dismissPopup]);
|
|
7450
7456
|
}
|
|
7451
7457
|
|
|
7458
|
+
// src/mobileBinding.ts
|
|
7459
|
+
import { useCallback as useCallback23, useEffect as useEffect25, useRef as useRef20, useState as useState30 } from "react";
|
|
7460
|
+
var CLEARED = { text: null, asks: [] };
|
|
7461
|
+
function useMobileBinding(args) {
|
|
7462
|
+
const { binding, panelOpen, popupText, asks } = args;
|
|
7463
|
+
const latest = useRef20(args);
|
|
7464
|
+
latest.current = args;
|
|
7465
|
+
const bindingRef = useRef20(binding);
|
|
7466
|
+
bindingRef.current = binding;
|
|
7467
|
+
const backRef = useRef20(null);
|
|
7468
|
+
const [confirmedShown, setConfirmedShown] = useState30(null);
|
|
7469
|
+
const teaserKey = panelOpen || !popupText ? "" : JSON.stringify([popupText, asks.map((a) => a.label)]);
|
|
7470
|
+
const reported = useRef20({ binding: void 0, key: "" });
|
|
7471
|
+
useEffect25(() => {
|
|
7472
|
+
if (!binding) return;
|
|
7473
|
+
const prev = reported.current;
|
|
7474
|
+
if (prev.binding === binding && prev.key === teaserKey) return;
|
|
7475
|
+
reported.current = { binding, key: teaserKey };
|
|
7476
|
+
if (teaserKey === "" && prev.binding !== binding) return;
|
|
7477
|
+
binding.onTeaser(teaserKey === "" ? CLEARED : { text: popupText, asks: asks.map((a, index) => ({ index, label: a.label })) });
|
|
7478
|
+
}, [binding, teaserKey]);
|
|
7479
|
+
useEffect25(() => {
|
|
7480
|
+
if (!binding) return;
|
|
7481
|
+
binding.onHandle({
|
|
7482
|
+
open: () => latest.current.open(),
|
|
7483
|
+
close: () => latest.current.close(),
|
|
7484
|
+
tapAsk: (index) => {
|
|
7485
|
+
const { asks: current, open } = latest.current;
|
|
7486
|
+
if (!Number.isInteger(index) || index < 0 || index >= current.length) return;
|
|
7487
|
+
open();
|
|
7488
|
+
current[index].onTap();
|
|
7489
|
+
},
|
|
7490
|
+
dismissTeaser: () => latest.current.dismissPopup(),
|
|
7491
|
+
teaserShown: () => setConfirmedShown(latest.current.popupText),
|
|
7492
|
+
back: () => backRef.current?.() ?? false
|
|
7493
|
+
});
|
|
7494
|
+
return () => binding.onHandle(null);
|
|
7495
|
+
}, [binding]);
|
|
7496
|
+
const onCloseRequested = useCallback23(() => bindingRef.current?.onCloseRequested(), []);
|
|
7497
|
+
const onRegisterBack = useCallback23((fn) => {
|
|
7498
|
+
backRef.current = fn;
|
|
7499
|
+
}, []);
|
|
7500
|
+
if (!binding) return { confirmedShown: void 0, onCloseRequested: void 0, onRegisterBack: void 0 };
|
|
7501
|
+
return { confirmedShown, onCloseRequested, onRegisterBack };
|
|
7502
|
+
}
|
|
7503
|
+
|
|
7452
7504
|
// src/openTelemetry.ts
|
|
7453
|
-
import { useEffect as
|
|
7505
|
+
import { useEffect as useEffect26, useRef as useRef21 } from "react";
|
|
7454
7506
|
function useOpenTelemetry(log, isOpen) {
|
|
7455
|
-
const openLoggedRef =
|
|
7456
|
-
|
|
7507
|
+
const openLoggedRef = useRef21(false);
|
|
7508
|
+
useEffect26(() => {
|
|
7457
7509
|
if (!isOpen) {
|
|
7458
7510
|
openLoggedRef.current = false;
|
|
7459
7511
|
return;
|
|
@@ -7465,13 +7517,13 @@ function useOpenTelemetry(log, isOpen) {
|
|
|
7465
7517
|
}
|
|
7466
7518
|
|
|
7467
7519
|
// src/components/ChatFab.tsx
|
|
7468
|
-
import { useEffect as
|
|
7520
|
+
import { useEffect as useEffect27, useRef as useRef22, useState as useState32 } from "react";
|
|
7469
7521
|
|
|
7470
7522
|
// src/components/BrandMark.tsx
|
|
7471
|
-
import { useState as
|
|
7523
|
+
import { useState as useState31 } from "react";
|
|
7472
7524
|
import { jsx as jsx27 } from "react/jsx-runtime";
|
|
7473
7525
|
function BrandMark({ logoUrl, className }) {
|
|
7474
|
-
const [failed, setFailed] =
|
|
7526
|
+
const [failed, setFailed] = useState31(false);
|
|
7475
7527
|
if (!logoUrl || failed) return /* @__PURE__ */ jsx27(SsMark, { className });
|
|
7476
7528
|
return /* @__PURE__ */ jsx27("img", { className, src: logoUrl, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
7477
7529
|
}
|
|
@@ -7509,9 +7561,9 @@ function ChatFab({ label, busy = false, greeting, popupText, logoUrl, onOpen, on
|
|
|
7509
7561
|
const bubble = popupText ?? greeting;
|
|
7510
7562
|
const hidden = busy && !label;
|
|
7511
7563
|
const track = useTrack();
|
|
7512
|
-
const [intro, setIntro] =
|
|
7513
|
-
const armedRef =
|
|
7514
|
-
|
|
7564
|
+
const [intro, setIntro] = useState32(false);
|
|
7565
|
+
const armedRef = useRef22(introAllowed);
|
|
7566
|
+
useEffect27(() => {
|
|
7515
7567
|
if (armedRef.current && bubble) {
|
|
7516
7568
|
armedRef.current = false;
|
|
7517
7569
|
setIntro(true);
|
|
@@ -7531,10 +7583,10 @@ function ChatFab({ label, busy = false, greeting, popupText, logoUrl, onOpen, on
|
|
|
7531
7583
|
}
|
|
7532
7584
|
|
|
7533
7585
|
// src/components/ChatPanel.tsx
|
|
7534
|
-
import { useCallback as
|
|
7586
|
+
import { useCallback as useCallback27, useEffect as useEffect53, useLayoutEffect as useLayoutEffect2, useMemo as useMemo12, useRef as useRef45, useState as useState79 } from "react";
|
|
7535
7587
|
|
|
7536
7588
|
// src/components/ChatHeader.tsx
|
|
7537
|
-
import { useEffect as
|
|
7589
|
+
import { useEffect as useEffect28, useRef as useRef23, useState as useState33 } from "react";
|
|
7538
7590
|
import { jsx as jsx30, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
7539
7591
|
function ChatHeader({
|
|
7540
7592
|
onClose,
|
|
@@ -7548,20 +7600,20 @@ function ChatHeader({
|
|
|
7548
7600
|
onOpenSettings,
|
|
7549
7601
|
settingsLabel
|
|
7550
7602
|
}) {
|
|
7551
|
-
const [menuOpen, setMenuOpen] =
|
|
7552
|
-
const wrapRef =
|
|
7553
|
-
const kebabRef =
|
|
7554
|
-
const firstItemRef =
|
|
7603
|
+
const [menuOpen, setMenuOpen] = useState33(false);
|
|
7604
|
+
const wrapRef = useRef23(null);
|
|
7605
|
+
const kebabRef = useRef23(null);
|
|
7606
|
+
const firstItemRef = useRef23(null);
|
|
7555
7607
|
const hasNew = !!(canReset && onNewConversation);
|
|
7556
7608
|
const hasSettings = !!onOpenSettings;
|
|
7557
7609
|
const hasMenu = hasNew || hasSettings;
|
|
7558
|
-
|
|
7610
|
+
useEffect28(() => {
|
|
7559
7611
|
if (menuOpen) firstItemRef.current?.focus();
|
|
7560
7612
|
}, [menuOpen]);
|
|
7561
|
-
|
|
7613
|
+
useEffect28(() => {
|
|
7562
7614
|
if (!menuOpen) return;
|
|
7563
7615
|
const onPointer = (e) => {
|
|
7564
|
-
if (!wrapRef.current
|
|
7616
|
+
if (!(wrapRef.current && e.composedPath().includes(wrapRef.current))) setMenuOpen(false);
|
|
7565
7617
|
};
|
|
7566
7618
|
const onKey = (e) => {
|
|
7567
7619
|
if (e.key === "Escape") {
|
|
@@ -7631,10 +7683,10 @@ function ChatHeader({
|
|
|
7631
7683
|
}
|
|
7632
7684
|
|
|
7633
7685
|
// src/components/MessageList.tsx
|
|
7634
|
-
import { useEffect as
|
|
7686
|
+
import { useEffect as useEffect32, useRef as useRef26 } from "react";
|
|
7635
7687
|
|
|
7636
7688
|
// src/components/ChatMessage.tsx
|
|
7637
|
-
import { useState as
|
|
7689
|
+
import { useState as useState43 } from "react";
|
|
7638
7690
|
|
|
7639
7691
|
// src/components/Markdown.tsx
|
|
7640
7692
|
import ReactMarkdown from "react-markdown";
|
|
@@ -7652,7 +7704,7 @@ function Markdown({ text: text2 }) {
|
|
|
7652
7704
|
}
|
|
7653
7705
|
|
|
7654
7706
|
// src/components/EntityCardList.tsx
|
|
7655
|
-
import { useState as
|
|
7707
|
+
import { useState as useState34 } from "react";
|
|
7656
7708
|
import { jsx as jsx32, jsxs as jsxs28 } from "react/jsx-runtime";
|
|
7657
7709
|
var MAX_VISIBLE = 3;
|
|
7658
7710
|
var RECORD_RE = /^(\d+)-(\d+)-(\d+)$/;
|
|
@@ -7680,23 +7732,34 @@ function FormBar({ w, d, l }) {
|
|
|
7680
7732
|
l > 0 ? /* @__PURE__ */ jsx32("span", { className: "ss-w-form-l", style: { flexGrow: l } }) : null
|
|
7681
7733
|
] });
|
|
7682
7734
|
}
|
|
7735
|
+
function cellClass(s) {
|
|
7736
|
+
return s.muted ? "ss-w-ecard-cell ss-w-ecard-cell--muted" : "ss-w-ecard-cell";
|
|
7737
|
+
}
|
|
7683
7738
|
function StatCellView({ s }) {
|
|
7684
7739
|
const m = RECORD_RE.exec(s.value);
|
|
7685
7740
|
if (m) {
|
|
7686
|
-
return /* @__PURE__ */ jsxs28("div", { className:
|
|
7741
|
+
return /* @__PURE__ */ jsxs28("div", { className: cellClass(s), children: [
|
|
7687
7742
|
/* @__PURE__ */ jsx32("span", { className: "ss-w-ecard-cval", children: /* @__PURE__ */ jsx32(FormBar, { w: Number(m[1]), d: Number(m[2]), l: Number(m[3]) }) }),
|
|
7688
|
-
/* @__PURE__ */ jsx32("span", { className: "ss-w-ecard-clabel", children: s.value })
|
|
7743
|
+
/* @__PURE__ */ jsx32("span", { className: "ss-w-ecard-clabel", children: s.value }),
|
|
7744
|
+
s.note ? /* @__PURE__ */ jsx32("span", { className: "ss-w-ecard-note", children: s.note }) : null
|
|
7689
7745
|
] });
|
|
7690
7746
|
}
|
|
7691
|
-
return /* @__PURE__ */ jsxs28("div", { className:
|
|
7747
|
+
return /* @__PURE__ */ jsxs28("div", { className: cellClass(s), children: [
|
|
7692
7748
|
/* @__PURE__ */ jsx32("span", { className: "ss-w-ecard-cval", children: s.value }),
|
|
7693
|
-
/* @__PURE__ */ jsx32("span", { className: "ss-w-ecard-clabel", children: s.label })
|
|
7749
|
+
/* @__PURE__ */ jsx32("span", { className: "ss-w-ecard-clabel", children: s.label }),
|
|
7750
|
+
s.note ? /* @__PURE__ */ jsx32("span", { className: "ss-w-ecard-note", children: s.note }) : null
|
|
7694
7751
|
] });
|
|
7695
7752
|
}
|
|
7753
|
+
function stripClass(stats) {
|
|
7754
|
+
const noted = stats.some((s) => s.note);
|
|
7755
|
+
return ["ss-w-ecard-strip", noted ? "ss-w-ecard-strip--noted" : "", stats.length > 6 ? "ss-w-ecard-strip--more" : ""].filter(Boolean).join(" ");
|
|
7756
|
+
}
|
|
7696
7757
|
function StatStrip({ stats }) {
|
|
7697
7758
|
if (stats.length === 0) return null;
|
|
7698
|
-
|
|
7699
|
-
|
|
7759
|
+
return /* @__PURE__ */ jsxs28("div", { className: stripClass(stats), style: { gridTemplateColumns: "repeat(3, minmax(0, 1fr))" }, children: [
|
|
7760
|
+
stats.map((s) => /* @__PURE__ */ jsx32(StatCellView, { s }, s.label + s.value)),
|
|
7761
|
+
Array.from({ length: (3 - stats.length % 3) % 3 }, (_, i) => /* @__PURE__ */ jsx32("div", { className: "ss-w-ecard-cell", "aria-hidden": "true" }, `pad${i}`))
|
|
7762
|
+
] });
|
|
7700
7763
|
}
|
|
7701
7764
|
function CardHeader({ c, showScopeCrest }) {
|
|
7702
7765
|
const onlyScope = c.scopes.length === 1 ? c.scopes[0] : null;
|
|
@@ -7715,6 +7778,7 @@ function CardHeader({ c, showScopeCrest }) {
|
|
|
7715
7778
|
] }),
|
|
7716
7779
|
/* @__PURE__ */ jsxs28("span", { className: "ss-w-ecard-meta", children: [
|
|
7717
7780
|
showScopeCrest && onlyScope?.image ? /* @__PURE__ */ jsx32(Crest2, { image: onlyScope.image, label: onlyScope.label }) : null,
|
|
7781
|
+
c.chip ? /* @__PURE__ */ jsx32("span", { className: "ss-w-ecard-chip", children: c.chip }) : null,
|
|
7718
7782
|
c.season ? /* @__PURE__ */ jsx32("span", { className: "ss-w-ecard-season", children: shortSeason(c.season) }) : null
|
|
7719
7783
|
] })
|
|
7720
7784
|
] });
|
|
@@ -7736,7 +7800,7 @@ function ScopeTabs({ scopes, active, onSelect }) {
|
|
|
7736
7800
|
)) });
|
|
7737
7801
|
}
|
|
7738
7802
|
function EntityCardItem({ c }) {
|
|
7739
|
-
const [active, setActive] =
|
|
7803
|
+
const [active, setActive] = useState34(0);
|
|
7740
7804
|
const hasBody = c.scopes.length > 0;
|
|
7741
7805
|
if (!hasBody) {
|
|
7742
7806
|
return /* @__PURE__ */ jsx32("div", { className: "ss-w-ecard ss-w-ecard-bare", "data-kind": c.kind, children: /* @__PURE__ */ jsx32(CardHeader, { c, showScopeCrest: false }) });
|
|
@@ -7746,11 +7810,12 @@ function EntityCardItem({ c }) {
|
|
|
7746
7810
|
return /* @__PURE__ */ jsxs28("div", { className: "ss-w-ecard", "data-kind": c.kind, children: [
|
|
7747
7811
|
/* @__PURE__ */ jsx32(CardHeader, { c, showScopeCrest: !multi }),
|
|
7748
7812
|
multi ? /* @__PURE__ */ jsx32(ScopeTabs, { scopes: c.scopes, active, onSelect: setActive }) : null,
|
|
7749
|
-
/* @__PURE__ */ jsx32(StatStrip, { stats: scope.stats })
|
|
7813
|
+
/* @__PURE__ */ jsx32(StatStrip, { stats: scope.stats }),
|
|
7814
|
+
scope.period ? /* @__PURE__ */ jsx32("div", { className: "ss-w-ecard-period", children: scope.period }) : null
|
|
7750
7815
|
] });
|
|
7751
7816
|
}
|
|
7752
7817
|
function EntityCardList({ cards, disabled, showLessLabel, showMoreLabel }) {
|
|
7753
|
-
const [expanded, setExpanded] =
|
|
7818
|
+
const [expanded, setExpanded] = useState34(false);
|
|
7754
7819
|
if (cards.length === 0) return null;
|
|
7755
7820
|
const visible = expanded ? cards : cards.slice(0, MAX_VISIBLE);
|
|
7756
7821
|
const overflow = cards.length - MAX_VISIBLE;
|
|
@@ -7851,17 +7916,17 @@ function BettingInsightList({ insights, ui, slip, monitor }) {
|
|
|
7851
7916
|
}
|
|
7852
7917
|
|
|
7853
7918
|
// src/components/AddAllToSlipButton.tsx
|
|
7854
|
-
import { useCallback as
|
|
7919
|
+
import { useCallback as useCallback24, useState as useState35 } from "react";
|
|
7855
7920
|
import { jsx as jsx34, jsxs as jsxs30 } from "react/jsx-runtime";
|
|
7856
7921
|
function AddAllToSlipButton({ legs, slip, ui, labels, combo, chatCombo, sizeless, hold, onStartedGame }) {
|
|
7857
7922
|
const add = useSlipAdd(slip, ui);
|
|
7858
7923
|
const slipState = useSlipState();
|
|
7859
7924
|
const log = useEventLog();
|
|
7860
7925
|
const track = useTrack();
|
|
7861
|
-
const [pending, setPending] =
|
|
7862
|
-
const [settledLocal, setSettledLocal] =
|
|
7863
|
-
const [toast, setToast] =
|
|
7864
|
-
const dismiss =
|
|
7926
|
+
const [pending, setPending] = useState35(false);
|
|
7927
|
+
const [settledLocal, setSettledLocal] = useState35({});
|
|
7928
|
+
const [toast, setToast] = useState35(null);
|
|
7929
|
+
const dismiss = useCallback24(() => setToast(null), []);
|
|
7865
7930
|
if (!slip.onAddToSlip || legs.length < 2) return null;
|
|
7866
7931
|
const settled = slipState ? slipState.settled : settledLocal;
|
|
7867
7932
|
const open = legs.filter((leg) => !settled[slipKey(leg)]);
|
|
@@ -9171,7 +9236,7 @@ function TennisInsightList({ insights, ui }) {
|
|
|
9171
9236
|
}
|
|
9172
9237
|
|
|
9173
9238
|
// src/components/CompactOddsList.tsx
|
|
9174
|
-
import { useEffect as
|
|
9239
|
+
import { useEffect as useEffect29, useRef as useRef24, useState as useState36 } from "react";
|
|
9175
9240
|
import { mayPinOrSlip as mayPinOrSlip5, slipSportOf as slipSportOf6, sportOf as sportOf10 } from "@sensiblestats/widget-sdk";
|
|
9176
9241
|
|
|
9177
9242
|
// src/compactList.ts
|
|
@@ -9293,11 +9358,11 @@ function Row({ row, columns, ui, slip, monitor, rowRef }) {
|
|
|
9293
9358
|
] });
|
|
9294
9359
|
}
|
|
9295
9360
|
function CompactOddsList({ list, ui, slip, monitor }) {
|
|
9296
|
-
const [shown2, setShown] =
|
|
9361
|
+
const [shown2, setShown] = useState36(COMPACT_PAGE);
|
|
9297
9362
|
const hidden = list.rowCount - shown2;
|
|
9298
|
-
const [focusIndex, setFocusIndex] =
|
|
9299
|
-
const focusRef =
|
|
9300
|
-
|
|
9363
|
+
const [focusIndex, setFocusIndex] = useState36(null);
|
|
9364
|
+
const focusRef = useRef24(null);
|
|
9365
|
+
useEffect29(() => {
|
|
9301
9366
|
if (focusIndex !== null) focusRef.current?.focus();
|
|
9302
9367
|
}, [focusIndex]);
|
|
9303
9368
|
let left = shown2;
|
|
@@ -9532,7 +9597,7 @@ function FixtureCard({ card, ui }) {
|
|
|
9532
9597
|
}
|
|
9533
9598
|
|
|
9534
9599
|
// src/components/dashboard/CountdownCard.tsx
|
|
9535
|
-
import { Fragment as Fragment11, useEffect as
|
|
9600
|
+
import { Fragment as Fragment11, useEffect as useEffect30, useState as useState37 } from "react";
|
|
9536
9601
|
import { jsx as jsx43, jsxs as jsxs39 } from "react/jsx-runtime";
|
|
9537
9602
|
var DAY_MS3 = 864e5;
|
|
9538
9603
|
function remainingSegments(kickoffUnix, nowMs, withSeconds) {
|
|
@@ -9551,12 +9616,12 @@ function remainingSegments(kickoffUnix, nowMs, withSeconds) {
|
|
|
9551
9616
|
function CountdownCard({ card, ui }) {
|
|
9552
9617
|
const { data } = card;
|
|
9553
9618
|
const unitLabel = { d: data.daysUnit, h: data.hoursUnit, m: data.minutesUnit, s: data.secondsUnit };
|
|
9554
|
-
const [nowMs, setNowMs] =
|
|
9555
|
-
const [reduced] =
|
|
9619
|
+
const [nowMs, setNowMs] = useState37(() => Date.now());
|
|
9620
|
+
const [reduced] = useState37(
|
|
9556
9621
|
() => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches
|
|
9557
9622
|
);
|
|
9558
9623
|
const withinDay = data.kickoffUnix * 1e3 - nowMs < DAY_MS3;
|
|
9559
|
-
|
|
9624
|
+
useEffect30(() => {
|
|
9560
9625
|
if (reduced) return;
|
|
9561
9626
|
const id = window.setInterval(() => setNowMs(Date.now()), withinDay ? 1e3 : 6e4);
|
|
9562
9627
|
return () => window.clearInterval(id);
|
|
@@ -9575,7 +9640,7 @@ function CountdownCard({ card, ui }) {
|
|
|
9575
9640
|
}
|
|
9576
9641
|
|
|
9577
9642
|
// src/components/dashboard/InjuriesCard.tsx
|
|
9578
|
-
import { useState as
|
|
9643
|
+
import { useState as useState38 } from "react";
|
|
9579
9644
|
import { jsx as jsx44, jsxs as jsxs40 } from "react/jsx-runtime";
|
|
9580
9645
|
var SHOWN = 3;
|
|
9581
9646
|
function ColHead({ name, crestUrl }) {
|
|
@@ -9598,7 +9663,7 @@ function InjuryList({ rows, emptyLabel, limit }) {
|
|
|
9598
9663
|
}
|
|
9599
9664
|
function InjuriesCard({ card, ui }) {
|
|
9600
9665
|
const { data } = card;
|
|
9601
|
-
const [expanded, setExpanded] =
|
|
9666
|
+
const [expanded, setExpanded] = useState38(false);
|
|
9602
9667
|
const hidden = Math.max(0, data.ours.length - SHOWN) + Math.max(0, data.theirs.length - SHOWN);
|
|
9603
9668
|
const limit = expanded ? void 0 : SHOWN;
|
|
9604
9669
|
const { showMore, showLess } = ui;
|
|
@@ -9703,7 +9768,7 @@ function LinksCard({ card }) {
|
|
|
9703
9768
|
}
|
|
9704
9769
|
|
|
9705
9770
|
// src/components/dashboard/PostMatchResultCard.tsx
|
|
9706
|
-
import { useState as
|
|
9771
|
+
import { useState as useState39 } from "react";
|
|
9707
9772
|
import { jsx as jsx50, jsxs as jsxs46 } from "react/jsx-runtime";
|
|
9708
9773
|
function initials3(name) {
|
|
9709
9774
|
return name.trim().slice(0, 3).toUpperCase();
|
|
@@ -9713,7 +9778,7 @@ function PostMatchCrest({
|
|
|
9713
9778
|
name,
|
|
9714
9779
|
side
|
|
9715
9780
|
}) {
|
|
9716
|
-
const [failed, setFailed] =
|
|
9781
|
+
const [failed, setFailed] = useState39(false);
|
|
9717
9782
|
const cls = `ss-w-fandash-postmatch-crest ss-w-fandash-postmatch-crest--${side}`;
|
|
9718
9783
|
if (url && !failed) {
|
|
9719
9784
|
return /* @__PURE__ */ jsx50("img", { className: cls, src: url, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
@@ -9912,10 +9977,10 @@ function RestingFormCard({ card }) {
|
|
|
9912
9977
|
}
|
|
9913
9978
|
|
|
9914
9979
|
// src/components/dashboard/LiveScoreCard.tsx
|
|
9915
|
-
import { useRef as
|
|
9980
|
+
import { useRef as useRef25, useState as useState41 } from "react";
|
|
9916
9981
|
|
|
9917
9982
|
// src/useLiveClock.ts
|
|
9918
|
-
import { useEffect as
|
|
9983
|
+
import { useEffect as useEffect31, useState as useState40 } from "react";
|
|
9919
9984
|
var TICK_MS = 6e4;
|
|
9920
9985
|
var MAX_LIVE_TICK_MINUTES = 15;
|
|
9921
9986
|
function computeDisplayMinute(minute, clockRunning, receivedAtMs) {
|
|
@@ -9924,10 +9989,10 @@ function computeDisplayMinute(minute, clockRunning, receivedAtMs) {
|
|
|
9924
9989
|
return minute + Math.min(Math.max(0, elapsedMinutes), MAX_LIVE_TICK_MINUTES);
|
|
9925
9990
|
}
|
|
9926
9991
|
function useLiveClock(minute, clockRunning, receivedAtMs) {
|
|
9927
|
-
const [displayMinute, setDisplayMinute] =
|
|
9992
|
+
const [displayMinute, setDisplayMinute] = useState40(
|
|
9928
9993
|
() => computeDisplayMinute(minute, clockRunning, receivedAtMs)
|
|
9929
9994
|
);
|
|
9930
|
-
|
|
9995
|
+
useEffect31(() => {
|
|
9931
9996
|
setDisplayMinute(computeDisplayMinute(minute, clockRunning, receivedAtMs));
|
|
9932
9997
|
if (!clockRunning) return;
|
|
9933
9998
|
const id = window.setInterval(() => {
|
|
@@ -9944,7 +10009,7 @@ function initials5(name) {
|
|
|
9944
10009
|
return name.trim().slice(0, 3).toUpperCase();
|
|
9945
10010
|
}
|
|
9946
10011
|
function LiveCrest({ url, name, side }) {
|
|
9947
|
-
const [failed, setFailed] =
|
|
10012
|
+
const [failed, setFailed] = useState41(false);
|
|
9948
10013
|
const cls = `ss-w-fandash-live-crest ss-w-fandash-live-crest--${side}`;
|
|
9949
10014
|
if (url && !failed) {
|
|
9950
10015
|
return /* @__PURE__ */ jsx59("img", { className: cls, src: url, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
@@ -9966,7 +10031,7 @@ function LiveScoreCard({
|
|
|
9966
10031
|
}) {
|
|
9967
10032
|
const { data } = card;
|
|
9968
10033
|
const seedKey = `${data.minute}:${data.homeScore}:${data.awayScore}`;
|
|
9969
|
-
const seedRef =
|
|
10034
|
+
const seedRef = useRef25(null);
|
|
9970
10035
|
if (!seedRef.current || seedRef.current.key !== seedKey) {
|
|
9971
10036
|
seedRef.current = { key: seedKey, receivedAtMs: Date.now() };
|
|
9972
10037
|
}
|
|
@@ -10012,7 +10077,7 @@ function LiveScoreCard({
|
|
|
10012
10077
|
}
|
|
10013
10078
|
|
|
10014
10079
|
// src/components/dashboard/LiveTimelineCard.tsx
|
|
10015
|
-
import { useState as
|
|
10080
|
+
import { useState as useState42 } from "react";
|
|
10016
10081
|
import { jsx as jsx60, jsxs as jsxs56 } from "react/jsx-runtime";
|
|
10017
10082
|
var SHOWN2 = 3;
|
|
10018
10083
|
function EventIcon({ type }) {
|
|
@@ -10054,7 +10119,7 @@ function EventRow({ e }) {
|
|
|
10054
10119
|
] });
|
|
10055
10120
|
}
|
|
10056
10121
|
function LiveTimelineCard({ card, ui }) {
|
|
10057
|
-
const [expanded, setExpanded] =
|
|
10122
|
+
const [expanded, setExpanded] = useState42(false);
|
|
10058
10123
|
const events = card.data.events;
|
|
10059
10124
|
if (!events || events.length === 0) return null;
|
|
10060
10125
|
const sorted = [...events].sort((a, b) => b.minute - a.minute);
|
|
@@ -10253,7 +10318,7 @@ function FanDashboardCard({ card, onTap, ui, goalEvents }) {
|
|
|
10253
10318
|
// src/components/ChatMessage.tsx
|
|
10254
10319
|
import { jsx as jsx64, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
10255
10320
|
function ChatMessage({ message, disabled, onAct, onTap, ui, slip, monitor, onGreetingSport }) {
|
|
10256
|
-
const [sport, setSport] =
|
|
10321
|
+
const [sport, setSport] = useState43(null);
|
|
10257
10322
|
if (message.role === "user") {
|
|
10258
10323
|
return /* @__PURE__ */ jsx64("div", { className: "ss-w-msg ss-w-user", "data-msg-id": message.id, children: /* @__PURE__ */ jsx64("div", { className: "ss-w-bubble", children: message.text }) });
|
|
10259
10324
|
}
|
|
@@ -10307,11 +10372,11 @@ function turnAnchor(messages) {
|
|
|
10307
10372
|
function MessageList({ controller, ui, slip, onDashboardTap, monitor, onGreetingSport }) {
|
|
10308
10373
|
const { state, send } = controller;
|
|
10309
10374
|
const { oddsFormat } = useOddsSettings();
|
|
10310
|
-
const listRef =
|
|
10311
|
-
const endRef =
|
|
10312
|
-
const pinnedRef =
|
|
10313
|
-
const anchoredTurnRef =
|
|
10314
|
-
|
|
10375
|
+
const listRef = useRef26(null);
|
|
10376
|
+
const endRef = useRef26(null);
|
|
10377
|
+
const pinnedRef = useRef26(true);
|
|
10378
|
+
const anchoredTurnRef = useRef26(null);
|
|
10379
|
+
useEffect32(() => {
|
|
10315
10380
|
const anchor = turnAnchor(state.messages);
|
|
10316
10381
|
const list = listRef.current;
|
|
10317
10382
|
if (anchor && anchor.turnId !== anchoredTurnRef.current) {
|
|
@@ -10370,13 +10435,13 @@ function MessageList({ controller, ui, slip, onDashboardTap, monitor, onGreeting
|
|
|
10370
10435
|
}
|
|
10371
10436
|
|
|
10372
10437
|
// src/components/ChatInput.tsx
|
|
10373
|
-
import { forwardRef, useEffect as
|
|
10438
|
+
import { forwardRef, useEffect as useEffect33, useImperativeHandle, useRef as useRef27, useState as useState44 } from "react";
|
|
10374
10439
|
import { jsx as jsx67, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
10375
10440
|
var ChatInput = forwardRef(function ChatInput2({ placeholder, streaming, onSend, onStop, stopLabel, sendLabel, disabled = false }, ref) {
|
|
10376
|
-
const [value, setValue] =
|
|
10377
|
-
const textareaRef =
|
|
10378
|
-
const stopRef =
|
|
10379
|
-
const textBoxWantsFocusRef =
|
|
10441
|
+
const [value, setValue] = useState44("");
|
|
10442
|
+
const textareaRef = useRef27(null);
|
|
10443
|
+
const stopRef = useRef27(null);
|
|
10444
|
+
const textBoxWantsFocusRef = useRef27(false);
|
|
10380
10445
|
const submit = () => {
|
|
10381
10446
|
if (disabled) return;
|
|
10382
10447
|
const t = value.trim();
|
|
@@ -10402,7 +10467,7 @@ var ChatInput = forwardRef(function ChatInput2({ placeholder, streaming, onSend,
|
|
|
10402
10467
|
stopRef.current?.focus();
|
|
10403
10468
|
}
|
|
10404
10469
|
}), []);
|
|
10405
|
-
|
|
10470
|
+
useEffect33(() => {
|
|
10406
10471
|
if (streaming || disabled || !textBoxWantsFocusRef.current) return;
|
|
10407
10472
|
textBoxWantsFocusRef.current = false;
|
|
10408
10473
|
const box = textareaRef.current;
|
|
@@ -10433,7 +10498,7 @@ var ChatInput = forwardRef(function ChatInput2({ placeholder, streaming, onSend,
|
|
|
10433
10498
|
});
|
|
10434
10499
|
|
|
10435
10500
|
// src/components/TabBar.tsx
|
|
10436
|
-
import { useEffect as
|
|
10501
|
+
import { useEffect as useEffect34, useLayoutEffect, useRef as useRef28 } from "react";
|
|
10437
10502
|
import { Fragment as Fragment13, jsx as jsx68, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
10438
10503
|
var FIT_STEPS = [[0, false], [1, false], [1, true], [2, true], [3, true], [4, true], [5, true], [6, true]];
|
|
10439
10504
|
function TabBar({ monitor, ui, matchCount, trendsCount, liveCount, hasSchedule, hasBuilder = false, gamesEnabled, clubEnabled, favouritesEnabled }) {
|
|
@@ -10456,9 +10521,9 @@ function TabBar({ monitor, ui, matchCount, trendsCount, liveCount, hasSchedule,
|
|
|
10456
10521
|
...favouritesEnabled && !clubEnabled ? [{ tab: "favourites", label: ui.tabFavourites, count: 0, dot: false }] : []
|
|
10457
10522
|
];
|
|
10458
10523
|
const track = useTrack();
|
|
10459
|
-
const listRef =
|
|
10524
|
+
const listRef = useRef28(null);
|
|
10460
10525
|
const activeTab = monitor.activeTab;
|
|
10461
|
-
|
|
10526
|
+
useEffect34(() => {
|
|
10462
10527
|
const el = listRef.current?.querySelector("[data-on]");
|
|
10463
10528
|
if (!el || typeof el.scrollIntoView !== "function") return;
|
|
10464
10529
|
const reduce = typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
@@ -10581,19 +10646,19 @@ function MarketAccordion({ match, monitor, ui, slip }) {
|
|
|
10581
10646
|
}
|
|
10582
10647
|
|
|
10583
10648
|
// src/components/LiveFactBlock.tsx
|
|
10584
|
-
import { useRef as
|
|
10649
|
+
import { useRef as useRef30, useState as useState45 } from "react";
|
|
10585
10650
|
|
|
10586
10651
|
// src/useFactView.ts
|
|
10587
|
-
import { useEffect as
|
|
10652
|
+
import { useEffect as useEffect35, useRef as useRef29 } from "react";
|
|
10588
10653
|
var DWELL_MS = 1e3;
|
|
10589
10654
|
var seen = /* @__PURE__ */ new Set();
|
|
10590
10655
|
function useFactView(ref, fact, entity2) {
|
|
10591
10656
|
const log = useEventLog();
|
|
10592
|
-
const entityRef =
|
|
10657
|
+
const entityRef = useRef29(entity2);
|
|
10593
10658
|
entityRef.current = entity2;
|
|
10594
10659
|
const id = fact?.id;
|
|
10595
10660
|
const factKey = fact?.factKey;
|
|
10596
|
-
|
|
10661
|
+
useEffect35(() => {
|
|
10597
10662
|
if (id === void 0 || factKey === void 0 || seen.has(id) || !log) return;
|
|
10598
10663
|
const el = ref.current;
|
|
10599
10664
|
if (!el) return;
|
|
@@ -10630,10 +10695,10 @@ function useFactView(ref, fact, entity2) {
|
|
|
10630
10695
|
// src/components/LiveFactBlock.tsx
|
|
10631
10696
|
import { jsx as jsx70, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
10632
10697
|
function LiveFactBlock({ facts, match, ui, slip, onAsk }) {
|
|
10633
|
-
const [expanded, setExpanded] =
|
|
10698
|
+
const [expanded, setExpanded] = useState45(false);
|
|
10634
10699
|
const { oddsFormat } = useOddsSettings();
|
|
10635
10700
|
const log = useEventLog();
|
|
10636
|
-
const sectionRef =
|
|
10701
|
+
const sectionRef = useRef30(null);
|
|
10637
10702
|
const [current, ...earlier] = facts;
|
|
10638
10703
|
const entity2 = current?.market ? { entityType: "market", entityId: current.market.marketDeveloperName } : { entityType: "match", entityId: String(match.matchId) };
|
|
10639
10704
|
useFactView(sectionRef, current, entity2);
|
|
@@ -10707,7 +10772,7 @@ function LiveFactBlock({ facts, match, ui, slip, onAsk }) {
|
|
|
10707
10772
|
}
|
|
10708
10773
|
|
|
10709
10774
|
// src/components/MonitorFormH2H.tsx
|
|
10710
|
-
import { useState as
|
|
10775
|
+
import { useState as useState46 } from "react";
|
|
10711
10776
|
import { Fragment as Fragment14, jsx as jsx71, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
10712
10777
|
function resultClass2(result) {
|
|
10713
10778
|
if (result === "W") return "ss-w-h2h-result--win";
|
|
@@ -10723,7 +10788,7 @@ function FormDots({ form, ui }) {
|
|
|
10723
10788
|
return /* @__PURE__ */ jsx71("div", { className: "ss-w-h2h-dots", children: form.map((m, i) => /* @__PURE__ */ jsx71("span", { className: `ss-w-h2h-result ${resultClass2(m.result)}`, children: resultLabel(m.result, ui) }, i)) });
|
|
10724
10789
|
}
|
|
10725
10790
|
function MonitorFormH2H({ formAndH2H, homeTeamName, awayTeamName, ui }) {
|
|
10726
|
-
const [expanded, setExpanded] =
|
|
10791
|
+
const [expanded, setExpanded] = useState46(false);
|
|
10727
10792
|
const { homeForm, awayForm, h2h, homeShortCode, awayShortCode } = formAndH2H;
|
|
10728
10793
|
if (homeForm.length === 0 && awayForm.length === 0 && !h2h) {
|
|
10729
10794
|
return /* @__PURE__ */ jsx71(Fragment14, {});
|
|
@@ -10956,7 +11021,7 @@ var sportLabel = (ui, sport) => {
|
|
|
10956
11021
|
};
|
|
10957
11022
|
|
|
10958
11023
|
// src/components/NbaFormSection.tsx
|
|
10959
|
-
import { useState as
|
|
11024
|
+
import { useState as useState47 } from "react";
|
|
10960
11025
|
|
|
10961
11026
|
// src/components/NbaFormRest.tsx
|
|
10962
11027
|
import { jsx as jsx74, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
@@ -11055,8 +11120,8 @@ function Row2({ game, abbr, tonight, ui }) {
|
|
|
11055
11120
|
] });
|
|
11056
11121
|
}
|
|
11057
11122
|
function NbaFormSection({ match, monitor, ui }) {
|
|
11058
|
-
const [open, setOpen] =
|
|
11059
|
-
const [side, setSide] =
|
|
11123
|
+
const [open, setOpen] = useState47(false);
|
|
11124
|
+
const [side, setSide] = useState47("away");
|
|
11060
11125
|
const form = useNbaForm(match, monitor);
|
|
11061
11126
|
const b = match.basketball;
|
|
11062
11127
|
if (!form || !b || !form.home && !form.away) return null;
|
|
@@ -11098,10 +11163,10 @@ function NbaFormSection({ match, monitor, ui }) {
|
|
|
11098
11163
|
}
|
|
11099
11164
|
|
|
11100
11165
|
// src/components/NbaPropsSection.tsx
|
|
11101
|
-
import { useEffect as
|
|
11166
|
+
import { useEffect as useEffect37, useState as useState49 } from "react";
|
|
11102
11167
|
|
|
11103
11168
|
// src/components/PropsPieces.tsx
|
|
11104
|
-
import { useEffect as
|
|
11169
|
+
import { useEffect as useEffect36, useState as useState48 } from "react";
|
|
11105
11170
|
import { Fragment as Fragment15, jsx as jsx76, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
11106
11171
|
var livePlayer = (bundle, p) => bundle.live === true || !p.live && !p.nflLive ? p : { ...p, live: null, nflLive: null };
|
|
11107
11172
|
var hasLiveLine = (p) => p.live != null || p.nflLive != null;
|
|
@@ -11114,9 +11179,9 @@ function preKickoff(match) {
|
|
|
11114
11179
|
return Number.isFinite(kickoff) && Date.now() < kickoff;
|
|
11115
11180
|
}
|
|
11116
11181
|
function usePreKickoff(match) {
|
|
11117
|
-
const [, setTick] =
|
|
11182
|
+
const [, setTick] = useState48(0);
|
|
11118
11183
|
const pre = preKickoff(match);
|
|
11119
|
-
|
|
11184
|
+
useEffect36(() => {
|
|
11120
11185
|
if (!pre || !match.kickoffUtc) return;
|
|
11121
11186
|
const wait = Math.min(Math.max(Date.parse(match.kickoffUtc) - Date.now(), 0), MAX_TIMER_MS);
|
|
11122
11187
|
const id = setTimeout(() => setTick((t) => t + 1), wait);
|
|
@@ -11130,7 +11195,7 @@ function usePropsOpen(match, monitor, descriptor) {
|
|
|
11130
11195
|
const pre = descriptor.sport === "basketball" ? match.phase === "preMatch" : beforeKickoff;
|
|
11131
11196
|
const live = match.phase === "live";
|
|
11132
11197
|
const open = pre || live;
|
|
11133
|
-
|
|
11198
|
+
useEffect36(() => {
|
|
11134
11199
|
if (!open) return;
|
|
11135
11200
|
if (sport) monitor.loadPlayerProps?.(match.matchId, sport);
|
|
11136
11201
|
else monitor.loadPlayerProps?.(match.matchId);
|
|
@@ -11208,7 +11273,7 @@ function PropBars({ bars, line, title, wide, ui, note }) {
|
|
|
11208
11273
|
function PropPlayerPanel({ player: given, bundle, descriptor, ui, slip }) {
|
|
11209
11274
|
const player = livePlayer(bundle, given);
|
|
11210
11275
|
const stats = descriptor.stats.map((k) => player.stats.find((s) => s.stat === k)).filter((s) => s != null);
|
|
11211
|
-
const [picked, setPicked] =
|
|
11276
|
+
const [picked, setPicked] = useState48(null);
|
|
11212
11277
|
const active = stats.find((s) => s.stat === picked) ?? stats[0];
|
|
11213
11278
|
const sample = active?.games?.length ?? 0;
|
|
11214
11279
|
const hitsOf = (price, text2) => descriptor.showHits && sample > 0 && price.hits != null ? text2(price.hits) : null;
|
|
@@ -11257,7 +11322,7 @@ function PropPlayerPanel({ player: given, bundle, descriptor, ui, slip }) {
|
|
|
11257
11322
|
] });
|
|
11258
11323
|
}
|
|
11259
11324
|
function PropRoster({ bundle, players, side, descriptor, ui, slip }) {
|
|
11260
|
-
const [openId, setOpenId] =
|
|
11325
|
+
const [openId, setOpenId] = useState48(null);
|
|
11261
11326
|
return /* @__PURE__ */ jsx76("div", { className: "ss-w-props-list", children: players.map((given) => {
|
|
11262
11327
|
const p = livePlayer(bundle, given);
|
|
11263
11328
|
const isOpen = openId === p.playerId;
|
|
@@ -11294,12 +11359,12 @@ function PropRoster({ bundle, players, side, descriptor, ui, slip }) {
|
|
|
11294
11359
|
}
|
|
11295
11360
|
var BOX_QUIET_MS = 12e4;
|
|
11296
11361
|
function StatsClock({ boxAsOfUtc, match, live, atBreak: atBreak2, ago, ui }) {
|
|
11297
|
-
const [tick, setTick] =
|
|
11362
|
+
const [tick, setTick] = useState48(0);
|
|
11298
11363
|
const time = clock2(boxAsOfUtc, ui);
|
|
11299
11364
|
const at2 = time === "" ? Number.NaN : Date.parse(boxAsOfUtc);
|
|
11300
11365
|
const valid = !Number.isNaN(at2);
|
|
11301
11366
|
const onBreak = atBreak(match);
|
|
11302
|
-
|
|
11367
|
+
useEffect36(() => {
|
|
11303
11368
|
if (!valid || onBreak) return;
|
|
11304
11369
|
const age2 = Date.now() - at2;
|
|
11305
11370
|
const wait = age2 < BOX_QUIET_MS ? BOX_QUIET_MS - age2 : 6e4 - age2 % 6e4;
|
|
@@ -11360,12 +11425,12 @@ var nbaDescriptor = (ui, match) => ({
|
|
|
11360
11425
|
tenGameBars: false
|
|
11361
11426
|
});
|
|
11362
11427
|
function StatsClock2({ bundle, match, ui }) {
|
|
11363
|
-
const [tick, setTick] =
|
|
11428
|
+
const [tick, setTick] = useState49(0);
|
|
11364
11429
|
const at2 = bundle.live === true && bundle.boxAsOfUtc ? Date.parse(bundle.boxAsOfUtc) : Number.NaN;
|
|
11365
11430
|
const time = clock2(bundle.boxAsOfUtc, ui);
|
|
11366
11431
|
const valid = !Number.isNaN(at2) && time !== "";
|
|
11367
11432
|
const onBreak = atBreak(match);
|
|
11368
|
-
|
|
11433
|
+
useEffect37(() => {
|
|
11369
11434
|
if (!valid || onBreak) return;
|
|
11370
11435
|
const age2 = Date.now() - at2;
|
|
11371
11436
|
const wait = age2 < BOX_QUIET_MS2 ? BOX_QUIET_MS2 - age2 : 6e4 - age2 % 6e4;
|
|
@@ -11379,7 +11444,7 @@ function StatsClock2({ bundle, match, ui }) {
|
|
|
11379
11444
|
return /* @__PURE__ */ jsx77("span", { className: "ss-w-props-asof ss-w-props-asof--live", children: ui.nba.propsStatsLive(time) });
|
|
11380
11445
|
}
|
|
11381
11446
|
function NbaPropsSection({ match, monitor, ui, slip }) {
|
|
11382
|
-
const [side, setSide] =
|
|
11447
|
+
const [side, setSide] = useState49("home");
|
|
11383
11448
|
const descriptor = nbaDescriptor(ui, match);
|
|
11384
11449
|
const { bundle, live, open } = usePropsOpen(match, monitor, descriptor);
|
|
11385
11450
|
if (!open || !bundle || bundle.players.length === 0 || (bundle.live ?? false) !== live) return null;
|
|
@@ -11528,7 +11593,7 @@ function NbaMonitorCard({ match, monitor, ui, slip }) {
|
|
|
11528
11593
|
}
|
|
11529
11594
|
|
|
11530
11595
|
// src/components/NflFormSection.tsx
|
|
11531
|
-
import { useState as
|
|
11596
|
+
import { useState as useState50 } from "react";
|
|
11532
11597
|
import { Fragment as Fragment17, jsx as jsx79, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
11533
11598
|
var outcomeOf = (g) => g.teamScore > g.opponentScore ? "win" : g.teamScore < g.opponentScore ? "loss" : "tie";
|
|
11534
11599
|
var signedSpread2 = (v) => v > 0 ? `+${v}` : String(v);
|
|
@@ -11580,7 +11645,7 @@ function H2hRow({ game, home, ui }) {
|
|
|
11580
11645
|
] });
|
|
11581
11646
|
}
|
|
11582
11647
|
function NflFormSection({ match, monitor, ui }) {
|
|
11583
|
-
const [segment, setSegment] =
|
|
11648
|
+
const [segment, setSegment] = useState50("away");
|
|
11584
11649
|
const { live, open } = usePropsOpen(match, monitor, { sport: "americanfootball" });
|
|
11585
11650
|
const bundle = monitor.playerProps?.[monitorMatchKey("americanfootball", match.matchId)]?.bundle;
|
|
11586
11651
|
const form = bundle?.form;
|
|
@@ -11613,7 +11678,7 @@ function NflFormSection({ match, monitor, ui }) {
|
|
|
11613
11678
|
}
|
|
11614
11679
|
|
|
11615
11680
|
// src/components/NflPropsSection.tsx
|
|
11616
|
-
import { useState as
|
|
11681
|
+
import { useState as useState51 } from "react";
|
|
11617
11682
|
import { Fragment as Fragment18, jsx as jsx80, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
11618
11683
|
var TRENDS_SHOWN = 3;
|
|
11619
11684
|
var SCORERS_SHOWN = 8;
|
|
@@ -11686,7 +11751,7 @@ function ShowMore({ label, onClick }) {
|
|
|
11686
11751
|
return /* @__PURE__ */ jsx80("button", { type: "button", className: "ss-w-props-more", onClick, children: label });
|
|
11687
11752
|
}
|
|
11688
11753
|
function Trends({ bundle, facts, descriptor, ui, slip }) {
|
|
11689
|
-
const [all, setAll] =
|
|
11754
|
+
const [all, setAll] = useState51(false);
|
|
11690
11755
|
const shown2 = all ? facts : facts.slice(0, TRENDS_SHOWN);
|
|
11691
11756
|
return /* @__PURE__ */ jsxs75("section", { className: "ss-w-props ss-w-props-trends", lang: ui.locale, children: [
|
|
11692
11757
|
/* @__PURE__ */ jsx80("div", { className: "ss-w-props-head", children: ui.nfl.propsTrends }),
|
|
@@ -11719,7 +11784,7 @@ function Trends({ bundle, facts, descriptor, ui, slip }) {
|
|
|
11719
11784
|
] });
|
|
11720
11785
|
}
|
|
11721
11786
|
function Scorers({ bundle, scorers, abbreviations, descriptor, ui, slip }) {
|
|
11722
|
-
const [all, setAll] =
|
|
11787
|
+
const [all, setAll] = useState51(false);
|
|
11723
11788
|
const shown2 = all ? scorers : scorers.slice(0, SCORERS_SHOWN);
|
|
11724
11789
|
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" });
|
|
11725
11790
|
return /* @__PURE__ */ jsxs75("div", { className: "ss-w-props-scorers", children: [
|
|
@@ -11746,7 +11811,7 @@ function Scorers({ bundle, scorers, abbreviations, descriptor, ui, slip }) {
|
|
|
11746
11811
|
] });
|
|
11747
11812
|
}
|
|
11748
11813
|
function NflPropsSection({ match, monitor, ui, slip }) {
|
|
11749
|
-
const [tab, setTab] =
|
|
11814
|
+
const [tab, setTab] = useState51(null);
|
|
11750
11815
|
const descriptor = nflDescriptor(ui);
|
|
11751
11816
|
const { bundle, live, open } = usePropsOpen(match, monitor, descriptor);
|
|
11752
11817
|
if (!open || !bundle || bundle.players.length === 0 || (bundle.live ?? false) !== live) return null;
|
|
@@ -11932,7 +11997,7 @@ function NflMonitorCard({ match, monitor, ui, slip }) {
|
|
|
11932
11997
|
}
|
|
11933
11998
|
|
|
11934
11999
|
// src/components/TennisMonitorCard.tsx
|
|
11935
|
-
import { useRef as
|
|
12000
|
+
import { useRef as useRef31 } from "react";
|
|
11936
12001
|
import { toWireSport as toWireSport5 } from "@sensiblestats/widget-sdk";
|
|
11937
12002
|
|
|
11938
12003
|
// src/components/TennisFixtureRow.tsx
|
|
@@ -12193,7 +12258,7 @@ function TennisLiveScoreboard({ t, score, live, ui }) {
|
|
|
12193
12258
|
}
|
|
12194
12259
|
|
|
12195
12260
|
// src/components/TennisStatsTables.tsx
|
|
12196
|
-
import { Fragment as Fragment22, useEffect as
|
|
12261
|
+
import { Fragment as Fragment22, useEffect as useEffect38, useState as useState52 } from "react";
|
|
12197
12262
|
import { Fragment as Fragment23, jsx as jsx87, jsxs as jsxs82 } from "react/jsx-runtime";
|
|
12198
12263
|
function formatStat(row, value, locale) {
|
|
12199
12264
|
if (value == null) return "\u2013";
|
|
@@ -12231,8 +12296,8 @@ function Tables({ table, labels, names, locale }) {
|
|
|
12231
12296
|
] });
|
|
12232
12297
|
}
|
|
12233
12298
|
function TennisStatsTables({ serveReturn, today, labels, names, ui, resetKey }) {
|
|
12234
|
-
const [tab, setTab] =
|
|
12235
|
-
|
|
12299
|
+
const [tab, setTab] = useState52("match");
|
|
12300
|
+
useEffect38(() => {
|
|
12236
12301
|
setTab("match");
|
|
12237
12302
|
}, [resetKey]);
|
|
12238
12303
|
const sets = serveReturn.sets.filter((s) => s.table.serve.length + s.table.return.length > 0);
|
|
@@ -12398,7 +12463,7 @@ function HeadToHead({ t, ui }) {
|
|
|
12398
12463
|
] });
|
|
12399
12464
|
}
|
|
12400
12465
|
function TennisMonitorCard({ match, monitor, ui, slip, onAsk }) {
|
|
12401
|
-
const lastTables =
|
|
12466
|
+
const lastTables = useRef31(null);
|
|
12402
12467
|
const t = match.tennis;
|
|
12403
12468
|
if (!t) return /* @__PURE__ */ jsx88(UnavailableCard, { match, monitor, ui, sport: "tennis" });
|
|
12404
12469
|
const preMatch = match.phase === "preMatch";
|
|
@@ -12478,7 +12543,7 @@ function TennisMonitorCard({ match, monitor, ui, slip, onAsk }) {
|
|
|
12478
12543
|
}
|
|
12479
12544
|
|
|
12480
12545
|
// src/components/ScoreboardStrip.tsx
|
|
12481
|
-
import { useEffect as
|
|
12546
|
+
import { useEffect as useEffect39, useRef as useRef32 } from "react";
|
|
12482
12547
|
import { sportOf as sportOf11 } from "@sensiblestats/widget-sdk";
|
|
12483
12548
|
import { jsx as jsx89, jsxs as jsxs84 } from "react/jsx-runtime";
|
|
12484
12549
|
function nbaStatus(m, ui) {
|
|
@@ -12573,8 +12638,8 @@ function rowsFor(m) {
|
|
|
12573
12638
|
];
|
|
12574
12639
|
}
|
|
12575
12640
|
function useStripScroll(selectedKey) {
|
|
12576
|
-
const stripRef =
|
|
12577
|
-
|
|
12641
|
+
const stripRef = useRef32(null);
|
|
12642
|
+
useEffect39(() => {
|
|
12578
12643
|
const strip = stripRef.current;
|
|
12579
12644
|
const pressed = strip?.querySelector('[aria-pressed="true"]');
|
|
12580
12645
|
if (!strip || !pressed) return;
|
|
@@ -12820,7 +12885,7 @@ function TrendsPanel({ monitor, ui, slip }) {
|
|
|
12820
12885
|
}
|
|
12821
12886
|
|
|
12822
12887
|
// src/components/LivePanel.tsx
|
|
12823
|
-
import { useMemo as useMemo10, useState as
|
|
12888
|
+
import { useMemo as useMemo10, useState as useState54 } from "react";
|
|
12824
12889
|
import { matchKey as matchKey8 } from "@sensiblestats/widget-sdk";
|
|
12825
12890
|
|
|
12826
12891
|
// src/scheduleView.ts
|
|
@@ -12995,20 +13060,20 @@ function LeagueGroup({ view, open, onToggle, disambiguate, rowCap, onShowAll, on
|
|
|
12995
13060
|
}
|
|
12996
13061
|
|
|
12997
13062
|
// src/components/MatchSheet.tsx
|
|
12998
|
-
import { useId as useId2, useState as
|
|
13063
|
+
import { useId as useId2, useState as useState53 } from "react";
|
|
12999
13064
|
import { localIdOf as localIdOf4, qualifiedId as qualifiedId2, slipSportOf as slipSportOf9, toWireSport as toWireSport6 } from "@sensiblestats/widget-sdk";
|
|
13000
13065
|
|
|
13001
13066
|
// src/useModalDialog.ts
|
|
13002
|
-
import { useEffect as
|
|
13067
|
+
import { useEffect as useEffect40, useRef as useRef33 } from "react";
|
|
13003
13068
|
var FOCUSABLE = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
13004
13069
|
function useModalDialog(onClose, opts = {}) {
|
|
13005
|
-
const dialogRef =
|
|
13006
|
-
const onCloseRef =
|
|
13070
|
+
const dialogRef = useRef33(null);
|
|
13071
|
+
const onCloseRef = useRef33(onClose);
|
|
13007
13072
|
onCloseRef.current = onClose;
|
|
13008
|
-
const openerRef =
|
|
13073
|
+
const openerRef = useRef33(opts.opener);
|
|
13009
13074
|
openerRef.current = opts.opener;
|
|
13010
13075
|
const restore = opts.restoreFocus ?? true;
|
|
13011
|
-
|
|
13076
|
+
useEffect40(() => {
|
|
13012
13077
|
const dialog = dialogRef.current;
|
|
13013
13078
|
const root = dialog?.getRootNode();
|
|
13014
13079
|
const focusedAtMount = root?.activeElement ?? null;
|
|
@@ -13019,7 +13084,7 @@ function useModalDialog(onClose, opts = {}) {
|
|
|
13019
13084
|
if (target instanceof HTMLElement) target.focus({ preventScroll: true });
|
|
13020
13085
|
};
|
|
13021
13086
|
}, []);
|
|
13022
|
-
|
|
13087
|
+
useEffect40(() => {
|
|
13023
13088
|
const onKey = (e) => {
|
|
13024
13089
|
if (e.key !== "Escape") return;
|
|
13025
13090
|
e.stopPropagation();
|
|
@@ -13061,7 +13126,7 @@ function MatchSheet({ match, league, state, stale, ui, monitor, onAsk, onClose,
|
|
|
13061
13126
|
const { dialogRef, onKeyDown } = useModalDialog(onClose, { opener });
|
|
13062
13127
|
const log = useEventLog();
|
|
13063
13128
|
const titleId = useId2();
|
|
13064
|
-
const [limitHit, setLimitHit] =
|
|
13129
|
+
const [limitHit, setLimitHit] = useState53(false);
|
|
13065
13130
|
const pinSport = slipSportOf9(match.sport);
|
|
13066
13131
|
const tour = pinSport === "tennis" && isKnownTour(match.tour) ? match.tour : void 0;
|
|
13067
13132
|
const followable = pinSport !== "tennis" || tour !== void 0;
|
|
@@ -13162,9 +13227,9 @@ var OPEN_TOP_GROUPS = 2;
|
|
|
13162
13227
|
var QUIET_ROWS = 4;
|
|
13163
13228
|
function LivePanel({ discovery, ui, monitor, sport, offered, onSport, league, onLeague, onSeeAll, onAsk }) {
|
|
13164
13229
|
const { groups, states, stale } = discovery;
|
|
13165
|
-
const [mine, setMine] =
|
|
13166
|
-
const [toggled, setToggled] =
|
|
13167
|
-
const [sheet, setSheet] =
|
|
13230
|
+
const [mine, setMine] = useState54(false);
|
|
13231
|
+
const [toggled, setToggled] = useState54(/* @__PURE__ */ new Map());
|
|
13232
|
+
const [sheet, setSheet] = useState54(null);
|
|
13168
13233
|
const pinnedKeys = useMemo10(
|
|
13169
13234
|
() => new Set(monitor.pins.filter((p) => p.kind === "match").map((p) => matchKey8(p.sport, p.matchId, p.tour))),
|
|
13170
13235
|
[monitor.pins]
|
|
@@ -13271,20 +13336,20 @@ function LivePanel({ discovery, ui, monitor, sport, offered, onSport, league, on
|
|
|
13271
13336
|
}
|
|
13272
13337
|
|
|
13273
13338
|
// src/components/ScheduleMatchesPanel.tsx
|
|
13274
|
-
import { useEffect as
|
|
13339
|
+
import { useEffect as useEffect43, useId as useId3, useMemo as useMemo11, useRef as useRef37, useState as useState56 } from "react";
|
|
13275
13340
|
import { matchKey as matchKey10 } from "@sensiblestats/widget-sdk";
|
|
13276
13341
|
|
|
13277
13342
|
// src/useTennisRowPrices.ts
|
|
13278
|
-
import { useEffect as
|
|
13343
|
+
import { useEffect as useEffect41, useRef as useRef34, useState as useState55 } from "react";
|
|
13279
13344
|
import { matchKey as matchKey9 } from "@sensiblestats/widget-sdk";
|
|
13280
13345
|
var TENNIS_PRICE_POLL_MS = 6e4;
|
|
13281
13346
|
function useTennisRowPrices(a) {
|
|
13282
|
-
const [state, setState] =
|
|
13283
|
-
const getPricesRef =
|
|
13347
|
+
const [state, setState] = useState55({ byId: null, stale: false });
|
|
13348
|
+
const getPricesRef = useRef34(a.getPrices);
|
|
13284
13349
|
getPricesRef.current = a.getPrices;
|
|
13285
|
-
const latest =
|
|
13350
|
+
const latest = useRef34(0);
|
|
13286
13351
|
const idsKey = a.keys.filter((k) => isKnownTour(k.tour)).slice(0, MAX_TENNIS_KEYS).map((k) => `${k.tour}:${k.matchId}`).sort().join(",");
|
|
13287
|
-
|
|
13352
|
+
useEffect41(() => {
|
|
13288
13353
|
if (!a.enabled || idsKey === "") {
|
|
13289
13354
|
latest.current++;
|
|
13290
13355
|
setState((prev) => prev.byId === null && !prev.stale ? prev : { byId: null, stale: false });
|
|
@@ -13322,11 +13387,11 @@ function useTennisRowPrices(a) {
|
|
|
13322
13387
|
}
|
|
13323
13388
|
|
|
13324
13389
|
// src/components/DayStrip.tsx
|
|
13325
|
-
import { useEffect as
|
|
13390
|
+
import { useEffect as useEffect42, useRef as useRef35 } from "react";
|
|
13326
13391
|
import { jsx as jsx98, jsxs as jsxs92 } from "react/jsx-runtime";
|
|
13327
13392
|
function DayStrip({ chips, selected, onSelect, ui, locale }) {
|
|
13328
|
-
const listRef =
|
|
13329
|
-
|
|
13393
|
+
const listRef = useRef35(null);
|
|
13394
|
+
useEffect42(() => {
|
|
13330
13395
|
const el = listRef.current?.querySelector('[aria-pressed="true"]');
|
|
13331
13396
|
if (!el || typeof el.scrollIntoView !== "function") return;
|
|
13332
13397
|
const reduce = typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
@@ -13355,7 +13420,7 @@ function DayStrip({ chips, selected, onSelect, ui, locale }) {
|
|
|
13355
13420
|
}
|
|
13356
13421
|
|
|
13357
13422
|
// src/components/games/ui/SearchField.tsx
|
|
13358
|
-
import { useCallback as
|
|
13423
|
+
import { useCallback as useCallback25, useRef as useRef36 } from "react";
|
|
13359
13424
|
|
|
13360
13425
|
// src/components/games/ui/icons.tsx
|
|
13361
13426
|
import { jsx as jsx99 } from "react/jsx-runtime";
|
|
@@ -13394,8 +13459,8 @@ var IconFlame = ({ size = 16 }) => svg(size, /* @__PURE__ */ jsx99("path", { d:
|
|
|
13394
13459
|
// src/components/games/ui/SearchField.tsx
|
|
13395
13460
|
import { jsx as jsx100, jsxs as jsxs93 } from "react/jsx-runtime";
|
|
13396
13461
|
function SearchField({ id, label, labelHidden = false, placeholder, value, onChange, disabled, inputRef, onKeyDown, clearLabel }) {
|
|
13397
|
-
const localRef =
|
|
13398
|
-
const setInputRef =
|
|
13462
|
+
const localRef = useRef36(null);
|
|
13463
|
+
const setInputRef = useCallback25((node) => {
|
|
13399
13464
|
localRef.current = node;
|
|
13400
13465
|
if (typeof inputRef === "function") inputRef(node);
|
|
13401
13466
|
else if (inputRef) inputRef.current = node;
|
|
@@ -13442,13 +13507,13 @@ var SKELETON_ROWS = 3;
|
|
|
13442
13507
|
function ScheduleMatchesPanel({ discovery, ui, monitor, sport, offered, onSport, day, onDay, loaded, onOpenLive, onAsk, locale, getTennisPrices, slip }) {
|
|
13443
13508
|
const { localDate: today, states, stale } = discovery;
|
|
13444
13509
|
const searchId = useId3();
|
|
13445
|
-
const [query, setQuery] =
|
|
13446
|
-
const [toggled, setToggled] =
|
|
13447
|
-
const [expanded, setExpanded] =
|
|
13448
|
-
const listRef =
|
|
13449
|
-
const [sheet, setSheet] =
|
|
13510
|
+
const [query, setQuery] = useState56("");
|
|
13511
|
+
const [toggled, setToggled] = useState56(/* @__PURE__ */ new Map());
|
|
13512
|
+
const [expanded, setExpanded] = useState56(/* @__PURE__ */ new Set());
|
|
13513
|
+
const listRef = useRef37(null);
|
|
13514
|
+
const [sheet, setSheet] = useState56(null);
|
|
13450
13515
|
const { chips, selected } = loaded;
|
|
13451
|
-
|
|
13516
|
+
useEffect43(() => {
|
|
13452
13517
|
if (selected !== day) onDay(selected);
|
|
13453
13518
|
}, [day, selected, onDay]);
|
|
13454
13519
|
const isToday = selected === today;
|
|
@@ -13590,7 +13655,7 @@ function ScheduleMatchesPanel({ discovery, ui, monitor, sport, offered, onSport,
|
|
|
13590
13655
|
}
|
|
13591
13656
|
|
|
13592
13657
|
// src/components/GamesPanel.tsx
|
|
13593
|
-
import { useEffect as
|
|
13658
|
+
import { useEffect as useEffect47, useState as useState71 } from "react";
|
|
13594
13659
|
|
|
13595
13660
|
// src/components/GamesLoginWall.tsx
|
|
13596
13661
|
import { jsx as jsx102 } from "react/jsx-runtime";
|
|
@@ -13599,7 +13664,7 @@ function GamesLoginWall({ ui }) {
|
|
|
13599
13664
|
}
|
|
13600
13665
|
|
|
13601
13666
|
// src/components/GamesHub.tsx
|
|
13602
|
-
import { useEffect as
|
|
13667
|
+
import { useEffect as useEffect44, useState as useState57 } from "react";
|
|
13603
13668
|
|
|
13604
13669
|
// src/components/games/ui/gameMeta.ts
|
|
13605
13670
|
function prettifyGameId(gameId) {
|
|
@@ -13750,8 +13815,8 @@ function pickHeroGame(games) {
|
|
|
13750
13815
|
}
|
|
13751
13816
|
var tileKey = (g) => `${g.gameId}-${g.gameDay}-${g.fixtureId}`;
|
|
13752
13817
|
function GamesHub({ games, myWeeklyRow, weeklyPrize, onOpen, ui }) {
|
|
13753
|
-
const [, setTick] =
|
|
13754
|
-
|
|
13818
|
+
const [, setTick] = useState57(0);
|
|
13819
|
+
useEffect44(() => {
|
|
13755
13820
|
const id = setInterval(() => setTick((t) => t + 1), 6e4);
|
|
13756
13821
|
return () => clearInterval(id);
|
|
13757
13822
|
}, []);
|
|
@@ -13811,10 +13876,10 @@ function GamesHub({ games, myWeeklyRow, weeklyPrize, onOpen, ui }) {
|
|
|
13811
13876
|
}
|
|
13812
13877
|
|
|
13813
13878
|
// src/components/GameScreenHost.tsx
|
|
13814
|
-
import { useEffect as
|
|
13879
|
+
import { useEffect as useEffect46, useRef as useRef40, useState as useState69 } from "react";
|
|
13815
13880
|
|
|
13816
13881
|
// src/useGamePlay.ts
|
|
13817
|
-
import { useCallback as
|
|
13882
|
+
import { useCallback as useCallback26, useRef as useRef38, useState as useState58 } from "react";
|
|
13818
13883
|
function toSubmitResult(payload) {
|
|
13819
13884
|
return {
|
|
13820
13885
|
// 'pending' means the play is recorded but awaiting resolution (fixture games)
|
|
@@ -13826,17 +13891,17 @@ function toSubmitResult(payload) {
|
|
|
13826
13891
|
};
|
|
13827
13892
|
}
|
|
13828
13893
|
function useGamePlay(conversation, { gameId, gameDay, fixtureId, locale, refresh }) {
|
|
13829
|
-
const [result, setResult] =
|
|
13830
|
-
const [submitting, setSubmitting] =
|
|
13831
|
-
const [rawStatus, setRawStatus] =
|
|
13832
|
-
const inFlightRef =
|
|
13833
|
-
const convRef =
|
|
13894
|
+
const [result, setResult] = useState58(null);
|
|
13895
|
+
const [submitting, setSubmitting] = useState58(false);
|
|
13896
|
+
const [rawStatus, setRawStatus] = useState58(null);
|
|
13897
|
+
const inFlightRef = useRef38(false);
|
|
13898
|
+
const convRef = useRef38(conversation);
|
|
13834
13899
|
convRef.current = conversation;
|
|
13835
|
-
const optsRef =
|
|
13900
|
+
const optsRef = useRef38({ gameId, gameDay, fixtureId, locale, refresh });
|
|
13836
13901
|
optsRef.current = { gameId, gameDay, fixtureId, locale, refresh };
|
|
13837
|
-
const resultRef =
|
|
13902
|
+
const resultRef = useRef38(null);
|
|
13838
13903
|
resultRef.current = result;
|
|
13839
|
-
const refetch =
|
|
13904
|
+
const refetch = useCallback26(async () => {
|
|
13840
13905
|
const conv = convRef.current;
|
|
13841
13906
|
if (!conv) return;
|
|
13842
13907
|
const opts = optsRef.current;
|
|
@@ -13852,7 +13917,7 @@ function useGamePlay(conversation, { gameId, gameDay, fixtureId, locale, refresh
|
|
|
13852
13917
|
} catch {
|
|
13853
13918
|
}
|
|
13854
13919
|
}, []);
|
|
13855
|
-
const submit =
|
|
13920
|
+
const submit = useCallback26(async (answerJson) => {
|
|
13856
13921
|
const conv = convRef.current;
|
|
13857
13922
|
if (!conv || inFlightRef.current) return;
|
|
13858
13923
|
inFlightRef.current = true;
|
|
@@ -13879,14 +13944,14 @@ function useGamePlay(conversation, { gameId, gameDay, fixtureId, locale, refresh
|
|
|
13879
13944
|
setSubmitting(false);
|
|
13880
13945
|
}
|
|
13881
13946
|
}, [refetch]);
|
|
13882
|
-
const hydrate =
|
|
13947
|
+
const hydrate = useCallback26(() => {
|
|
13883
13948
|
void refetch();
|
|
13884
13949
|
}, [refetch]);
|
|
13885
13950
|
return { result, submitting, submit, hydrate, rawStatus };
|
|
13886
13951
|
}
|
|
13887
13952
|
|
|
13888
13953
|
// src/components/games/MysteryTigerGame.tsx
|
|
13889
|
-
import { useState as
|
|
13954
|
+
import { useState as useState60, useId as useId4 } from "react";
|
|
13890
13955
|
|
|
13891
13956
|
// src/components/games/nationFlags.ts
|
|
13892
13957
|
var FLAGS = {
|
|
@@ -14097,7 +14162,7 @@ function isNationCode(flag) {
|
|
|
14097
14162
|
}
|
|
14098
14163
|
|
|
14099
14164
|
// src/components/games/PlayerAvatar.tsx
|
|
14100
|
-
import { useState as
|
|
14165
|
+
import { useState as useState59 } from "react";
|
|
14101
14166
|
import { jsx as jsx107 } from "react/jsx-runtime";
|
|
14102
14167
|
function initialsOf(name) {
|
|
14103
14168
|
const parts2 = name.trim().split(/\s+/).filter(Boolean);
|
|
@@ -14115,7 +14180,7 @@ function PlayerAvatar({
|
|
|
14115
14180
|
imagePath,
|
|
14116
14181
|
className
|
|
14117
14182
|
}) {
|
|
14118
|
-
const [failed, setFailed] =
|
|
14183
|
+
const [failed, setFailed] = useState59(false);
|
|
14119
14184
|
const showImage = Boolean(imagePath) && !isPlaceholderImage(imagePath) && !failed;
|
|
14120
14185
|
return /* @__PURE__ */ jsx107("div", { className, "aria-hidden": "true", children: showImage ? /* @__PURE__ */ jsx107("img", { src: imagePath, alt: "", loading: "lazy", onError: () => setFailed(true) }) : /* @__PURE__ */ jsx107("span", { className: "ss-w-av-initials", children: initialsOf(name) }) });
|
|
14121
14186
|
}
|
|
@@ -14359,7 +14424,7 @@ function MysteryTigerGame({
|
|
|
14359
14424
|
onBack
|
|
14360
14425
|
}) {
|
|
14361
14426
|
const t = ui.games.mysteryTiger;
|
|
14362
|
-
const [query, setQuery] =
|
|
14427
|
+
const [query, setQuery] = useState60("");
|
|
14363
14428
|
const inputId = useId4();
|
|
14364
14429
|
const clientState = parseClientState(result?.clientStateJson);
|
|
14365
14430
|
const guessResults = clientState?.guessResults ?? [];
|
|
@@ -14621,13 +14686,13 @@ function HigherOrLowerGame({
|
|
|
14621
14686
|
}
|
|
14622
14687
|
|
|
14623
14688
|
// src/components/games/CareerPathGame.tsx
|
|
14624
|
-
import { useState as
|
|
14689
|
+
import { useState as useState62, useId as useId5 } from "react";
|
|
14625
14690
|
|
|
14626
14691
|
// src/components/games/ui/CrestShield.tsx
|
|
14627
|
-
import { useState as
|
|
14692
|
+
import { useState as useState61 } from "react";
|
|
14628
14693
|
import { jsx as jsx118 } from "react/jsx-runtime";
|
|
14629
14694
|
function CrestShield({ src, name, size = 28 }) {
|
|
14630
|
-
const [failed, setFailed] =
|
|
14695
|
+
const [failed, setFailed] = useState61(false);
|
|
14631
14696
|
if (src && !isPlaceholderImage(src) && !failed) {
|
|
14632
14697
|
return /* @__PURE__ */ jsx118("img", { className: "ss-g-crest", src, alt: name, width: size, height: size, loading: "lazy", onError: () => setFailed(true) });
|
|
14633
14698
|
}
|
|
@@ -14659,7 +14724,7 @@ function CareerPathGame({
|
|
|
14659
14724
|
}) {
|
|
14660
14725
|
const s = ui.games.careerPath;
|
|
14661
14726
|
const title = gameTitle({ gameId: "career-path" }, ui.games.titles);
|
|
14662
|
-
const [query, setQuery] =
|
|
14727
|
+
const [query, setQuery] = useState62("");
|
|
14663
14728
|
const inputId = useId5();
|
|
14664
14729
|
const clientState = parseClientState3(result?.clientStateJson);
|
|
14665
14730
|
const alreadyGuessedIds = new Set(clientState?.guessResults.map((g) => g.playerId) ?? []);
|
|
@@ -14766,7 +14831,7 @@ function CareerPathGame({
|
|
|
14766
14831
|
}
|
|
14767
14832
|
|
|
14768
14833
|
// src/components/games/BeatTheGridGame.tsx
|
|
14769
|
-
import React, { useEffect as
|
|
14834
|
+
import React, { useEffect as useEffect45, useId as useId6, useRef as useRef39, useState as useState63 } from "react";
|
|
14770
14835
|
|
|
14771
14836
|
// src/components/games/ui/OptionList.tsx
|
|
14772
14837
|
import { jsx as jsx120 } from "react/jsx-runtime";
|
|
@@ -14855,10 +14920,10 @@ function SearchSheet({
|
|
|
14855
14920
|
ui
|
|
14856
14921
|
}) {
|
|
14857
14922
|
const s = ui.games.beatTheGrid;
|
|
14858
|
-
const [query, setQuery] =
|
|
14923
|
+
const [query, setQuery] = useState63("");
|
|
14859
14924
|
const inputId = useId6();
|
|
14860
|
-
const inputRef =
|
|
14861
|
-
|
|
14925
|
+
const inputRef = useRef39(null);
|
|
14926
|
+
useEffect45(() => {
|
|
14862
14927
|
inputRef.current?.focus();
|
|
14863
14928
|
}, [row, col]);
|
|
14864
14929
|
const filtered = playerPool.filter(
|
|
@@ -14923,7 +14988,7 @@ function BeatTheGridGame({
|
|
|
14923
14988
|
}) {
|
|
14924
14989
|
const s = ui.games.beatTheGrid;
|
|
14925
14990
|
const title = gameTitle({ gameId: "beat-the-grid" }, ui.games.titles);
|
|
14926
|
-
const [activeCell, setActiveCell] =
|
|
14991
|
+
const [activeCell, setActiveCell] = useState63(null);
|
|
14927
14992
|
const clientState = parseClientState4(result?.clientStateJson);
|
|
14928
14993
|
const filledCells = clientState?.cells ?? [];
|
|
14929
14994
|
const isLocked2 = result?.alreadyPlayed === true || clientState?.isComplete === true;
|
|
@@ -15078,7 +15143,7 @@ function BeatTheGridGame({
|
|
|
15078
15143
|
}
|
|
15079
15144
|
|
|
15080
15145
|
// src/components/games/GuessTheXiGame.tsx
|
|
15081
|
-
import { useState as
|
|
15146
|
+
import { useState as useState64, useId as useId7 } from "react";
|
|
15082
15147
|
|
|
15083
15148
|
// src/components/games/ui/PitchSvg.tsx
|
|
15084
15149
|
import { Fragment as Fragment36, jsx as jsx122, jsxs as jsxs109 } from "react/jsx-runtime";
|
|
@@ -15167,7 +15232,7 @@ function GuessTheXiGame({
|
|
|
15167
15232
|
onBack
|
|
15168
15233
|
}) {
|
|
15169
15234
|
const t = ui.games.guessTheXi;
|
|
15170
|
-
const [query, setQuery] =
|
|
15235
|
+
const [query, setQuery] = useState64("");
|
|
15171
15236
|
const inputId = useId7();
|
|
15172
15237
|
const clientState = parseClientState5(result?.clientStateJson);
|
|
15173
15238
|
const isOver = result?.alreadyPlayed === true || clientState?.status === "solved" || clientState?.status === "failed";
|
|
@@ -15310,7 +15375,7 @@ function GuessTheXiGame({
|
|
|
15310
15375
|
}
|
|
15311
15376
|
|
|
15312
15377
|
// src/components/games/DailyQuizGame.tsx
|
|
15313
|
-
import { useState as
|
|
15378
|
+
import { useState as useState65 } from "react";
|
|
15314
15379
|
import { Fragment as Fragment38, jsx as jsx124, jsxs as jsxs111 } from "react/jsx-runtime";
|
|
15315
15380
|
function parseClientState6(json) {
|
|
15316
15381
|
if (!json) return null;
|
|
@@ -15351,8 +15416,8 @@ function DailyQuizGame({
|
|
|
15351
15416
|
}) {
|
|
15352
15417
|
const s = ui.games.dailyQuiz;
|
|
15353
15418
|
const title = gameTitle({ gameId: "daily-quiz" }, ui.games.titles);
|
|
15354
|
-
const [selections, setSelections] =
|
|
15355
|
-
const [page, setPage] =
|
|
15419
|
+
const [selections, setSelections] = useState65(/* @__PURE__ */ new Map());
|
|
15420
|
+
const [page, setPage] = useState65(0);
|
|
15356
15421
|
const clientState = parseClientState6(result?.clientStateJson);
|
|
15357
15422
|
const results2 = clientState?.results ?? [];
|
|
15358
15423
|
const isRevealed = results2.length > 0 || result?.alreadyPlayed === true;
|
|
@@ -15462,7 +15527,7 @@ function DailyQuizGame({
|
|
|
15462
15527
|
}
|
|
15463
15528
|
|
|
15464
15529
|
// src/components/games/MatchdayPredictorGame.tsx
|
|
15465
|
-
import { useId as useId8, useState as
|
|
15530
|
+
import { useId as useId8, useState as useState66 } from "react";
|
|
15466
15531
|
import { jsx as jsx125, jsxs as jsxs112 } from "react/jsx-runtime";
|
|
15467
15532
|
var SCORER_SEARCH_THRESHOLD = 9;
|
|
15468
15533
|
function parseClientState7(json) {
|
|
@@ -15558,11 +15623,11 @@ function MatchdayPredictorGame({
|
|
|
15558
15623
|
onBack
|
|
15559
15624
|
}) {
|
|
15560
15625
|
const t = ui.games.predictor;
|
|
15561
|
-
const [homeScore, setHomeScore] =
|
|
15562
|
-
const [awayScore, setAwayScore] =
|
|
15563
|
-
const [firstScorerPlayerId, setFirstScorerPlayerId] =
|
|
15564
|
-
const [lastEdited, setLastEdited] =
|
|
15565
|
-
const [query, setQuery] =
|
|
15626
|
+
const [homeScore, setHomeScore] = useState66(0);
|
|
15627
|
+
const [awayScore, setAwayScore] = useState66(0);
|
|
15628
|
+
const [firstScorerPlayerId, setFirstScorerPlayerId] = useState66(null);
|
|
15629
|
+
const [lastEdited, setLastEdited] = useState66("home");
|
|
15630
|
+
const [query, setQuery] = useState66("");
|
|
15566
15631
|
const searchId = useId8();
|
|
15567
15632
|
const clientState = parseClientState7(result?.clientStateJson);
|
|
15568
15633
|
const alreadyPlayed = result?.alreadyPlayed === true;
|
|
@@ -15730,7 +15795,7 @@ function MatchdayPredictorGame({
|
|
|
15730
15795
|
}
|
|
15731
15796
|
|
|
15732
15797
|
// src/components/games/StartingXiGame.tsx
|
|
15733
|
-
import { useId as useId9, useState as
|
|
15798
|
+
import { useId as useId9, useState as useState67 } from "react";
|
|
15734
15799
|
import { Fragment as Fragment39, jsx as jsx126, jsxs as jsxs113 } from "react/jsx-runtime";
|
|
15735
15800
|
var POINTS_PER_STARTER = 8;
|
|
15736
15801
|
var XI_SIZE = 11;
|
|
@@ -15774,9 +15839,9 @@ function StartingXiGame({
|
|
|
15774
15839
|
lockAtUtc
|
|
15775
15840
|
}) {
|
|
15776
15841
|
const t = ui.games.startingXi;
|
|
15777
|
-
const [slotPlayers, setSlotPlayers] =
|
|
15778
|
-
const [active, setActive] =
|
|
15779
|
-
const [query, setQuery] =
|
|
15842
|
+
const [slotPlayers, setSlotPlayers] = useState67(() => Array(XI_SIZE).fill(null));
|
|
15843
|
+
const [active, setActive] = useState67(0);
|
|
15844
|
+
const [query, setQuery] = useState67("");
|
|
15780
15845
|
const searchId = useId9();
|
|
15781
15846
|
const clientState = parseClientState8(result?.clientStateJson);
|
|
15782
15847
|
const alreadyPlayed = result?.alreadyPlayed === true;
|
|
@@ -15916,7 +15981,7 @@ function StartingXiGame({
|
|
|
15916
15981
|
}
|
|
15917
15982
|
|
|
15918
15983
|
// src/components/games/StatLadderGame.tsx
|
|
15919
|
-
import { useId as useId10, useState as
|
|
15984
|
+
import { useId as useId10, useState as useState68 } from "react";
|
|
15920
15985
|
import { jsx as jsx127, jsxs as jsxs114 } from "react/jsx-runtime";
|
|
15921
15986
|
function ladderClue(ladder) {
|
|
15922
15987
|
const mystery = ladder.find((r) => r.rank === 2);
|
|
@@ -15953,8 +16018,8 @@ function StatLadderGame({
|
|
|
15953
16018
|
onBack
|
|
15954
16019
|
}) {
|
|
15955
16020
|
const t = ui.games.statLadder;
|
|
15956
|
-
const [query, setQuery] =
|
|
15957
|
-
const [selectedId, setSelectedId] =
|
|
16021
|
+
const [query, setQuery] = useState68("");
|
|
16022
|
+
const [selectedId, setSelectedId] = useState68(null);
|
|
15958
16023
|
const searchId = useId10();
|
|
15959
16024
|
const clientState = parseClientState9(result?.clientStateJson);
|
|
15960
16025
|
const revealed = clientState != null;
|
|
@@ -16161,8 +16226,8 @@ function GameScreenHost({
|
|
|
16161
16226
|
ui
|
|
16162
16227
|
}) {
|
|
16163
16228
|
const { gameId, fixtureId, gameDay = "", lockAtUtc = null } = selected;
|
|
16164
|
-
const [configJson, setConfigJson] =
|
|
16165
|
-
|
|
16229
|
+
const [configJson, setConfigJson] = useState69(null);
|
|
16230
|
+
useEffect46(() => {
|
|
16166
16231
|
setConfigJson(null);
|
|
16167
16232
|
if (!conversation) return;
|
|
16168
16233
|
let cancelled = false;
|
|
@@ -16185,12 +16250,12 @@ function GameScreenHost({
|
|
|
16185
16250
|
fixtureId: fixtureId || void 0,
|
|
16186
16251
|
locale: ui.hostTag
|
|
16187
16252
|
});
|
|
16188
|
-
|
|
16253
|
+
useEffect46(() => {
|
|
16189
16254
|
if (conversation) hydrate();
|
|
16190
16255
|
}, [conversation, gameId]);
|
|
16191
|
-
const hydrateRef =
|
|
16256
|
+
const hydrateRef = useRef40(hydrate);
|
|
16192
16257
|
hydrateRef.current = hydrate;
|
|
16193
|
-
|
|
16258
|
+
useEffect46(() => {
|
|
16194
16259
|
if (!FIXTURE_GAME_IDS.has(gameId)) return;
|
|
16195
16260
|
if (rawStatus !== "pending") return;
|
|
16196
16261
|
const timerId = setInterval(() => {
|
|
@@ -16303,7 +16368,7 @@ function GameScreenHost({
|
|
|
16303
16368
|
}
|
|
16304
16369
|
|
|
16305
16370
|
// src/components/Leaderboard.tsx
|
|
16306
|
-
import { useState as
|
|
16371
|
+
import { useState as useState70 } from "react";
|
|
16307
16372
|
|
|
16308
16373
|
// src/components/LeaderboardRow.tsx
|
|
16309
16374
|
import { jsx as jsx130, jsxs as jsxs116 } from "react/jsx-runtime";
|
|
@@ -16390,7 +16455,7 @@ function Leaderboard({
|
|
|
16390
16455
|
ui,
|
|
16391
16456
|
onPlay
|
|
16392
16457
|
}) {
|
|
16393
|
-
const [segment, setSegment] =
|
|
16458
|
+
const [segment, setSegment] = useState70("weekly");
|
|
16394
16459
|
const myRow = segment === "weekly" ? data.myWeeklyRow : data.myAllTimeRow;
|
|
16395
16460
|
const offBoard = myRow !== null && myRow !== void 0 && myRow.rank === -1;
|
|
16396
16461
|
const isEmpty = segment === "weekly" ? data.weeklyTop.length === 0 : data.allTimeTop.length === 0;
|
|
@@ -16495,9 +16560,9 @@ function GamesPanel({
|
|
|
16495
16560
|
leaderboardLoading,
|
|
16496
16561
|
refreshHub
|
|
16497
16562
|
}) {
|
|
16498
|
-
const [selected, setSelected] =
|
|
16499
|
-
const [segment, setSegment] =
|
|
16500
|
-
|
|
16563
|
+
const [selected, setSelected] = useState71(null);
|
|
16564
|
+
const [segment, setSegment] = useState71("play");
|
|
16565
|
+
useEffect47(() => {
|
|
16501
16566
|
ensureGamesFonts();
|
|
16502
16567
|
}, []);
|
|
16503
16568
|
if (!loggedIn) return /* @__PURE__ */ jsx134(GamesLoginWall, { ui });
|
|
@@ -16561,10 +16626,10 @@ function GamesPanel({
|
|
|
16561
16626
|
}
|
|
16562
16627
|
|
|
16563
16628
|
// src/components/FavouritesPanel.tsx
|
|
16564
|
-
import { useEffect as
|
|
16629
|
+
import { useEffect as useEffect50, useRef as useRef42, useState as useState74 } from "react";
|
|
16565
16630
|
|
|
16566
16631
|
// src/components/FavouriteChips.tsx
|
|
16567
|
-
import { useEffect as
|
|
16632
|
+
import { useEffect as useEffect48, useState as useState72 } from "react";
|
|
16568
16633
|
import { Fragment as Fragment41, jsx as jsx135, jsxs as jsxs120 } from "react/jsx-runtime";
|
|
16569
16634
|
async function toggleWithNotice(controller, kind, id, onNotice) {
|
|
16570
16635
|
const outcome = await controller.toggle(kind, id);
|
|
@@ -16611,12 +16676,12 @@ function Group({ title, entities, sport, ui, controller, onNotice }) {
|
|
|
16611
16676
|
] });
|
|
16612
16677
|
}
|
|
16613
16678
|
function FavouriteChips({ controller, ui, sport, sportLabel: sportLabel2, onNotice }) {
|
|
16614
|
-
const [confirming, setConfirming] =
|
|
16679
|
+
const [confirming, setConfirming] = useState72(false);
|
|
16615
16680
|
const data = controller.data;
|
|
16616
|
-
|
|
16681
|
+
useEffect48(() => {
|
|
16617
16682
|
setConfirming(false);
|
|
16618
16683
|
}, [sport]);
|
|
16619
|
-
|
|
16684
|
+
useEffect48(() => {
|
|
16620
16685
|
if (!confirming) return;
|
|
16621
16686
|
const onPointerDown = (e) => {
|
|
16622
16687
|
if (!(e.target instanceof Element) || !e.target.closest("[data-fav-confirm]")) setConfirming(false);
|
|
@@ -16670,21 +16735,21 @@ function FavouriteChips({ controller, ui, sport, sportLabel: sportLabel2, onNoti
|
|
|
16670
16735
|
}
|
|
16671
16736
|
|
|
16672
16737
|
// src/components/FavouritesSearch.tsx
|
|
16673
|
-
import { useEffect as
|
|
16738
|
+
import { useEffect as useEffect49, useRef as useRef41, useState as useState73 } from "react";
|
|
16674
16739
|
import { jsx as jsx136, jsxs as jsxs121 } from "react/jsx-runtime";
|
|
16675
16740
|
var MIN_LETTERS = 2;
|
|
16676
16741
|
var MAX_LENGTH = 64;
|
|
16677
16742
|
var DEBOUNCE_MS = 250;
|
|
16678
16743
|
function FavouritesSearch({ controller, ui, sport, onNotice }) {
|
|
16679
|
-
const [query, setQuery] =
|
|
16680
|
-
const [answer, setAnswer] =
|
|
16681
|
-
const controllerRef =
|
|
16744
|
+
const [query, setQuery] = useState73("");
|
|
16745
|
+
const [answer, setAnswer] = useState73(null);
|
|
16746
|
+
const controllerRef = useRef41(controller);
|
|
16682
16747
|
controllerRef.current = controller;
|
|
16683
16748
|
const trimmed = query.trim();
|
|
16684
16749
|
const queryKey = `${sport}|${trimmed}`;
|
|
16685
16750
|
const results2 = answer?.key === queryKey ? answer.rows : [];
|
|
16686
16751
|
const settled = answer?.key === queryKey;
|
|
16687
|
-
|
|
16752
|
+
useEffect49(() => {
|
|
16688
16753
|
setAnswer(null);
|
|
16689
16754
|
if (trimmed.length < MIN_LETTERS) return;
|
|
16690
16755
|
let cancelled = false;
|
|
@@ -16747,13 +16812,13 @@ function FavouritesSearch({ controller, ui, sport, onNotice }) {
|
|
|
16747
16812
|
// src/components/FavouritesPanel.tsx
|
|
16748
16813
|
import { jsx as jsx137, jsxs as jsxs122 } from "react/jsx-runtime";
|
|
16749
16814
|
function FavouritesPanel({ controller, ui, sport, sports, onSportChange }) {
|
|
16750
|
-
const [notice, setNotice] =
|
|
16751
|
-
const refreshRef =
|
|
16815
|
+
const [notice, setNotice] = useState74(null);
|
|
16816
|
+
const refreshRef = useRef42(controller.refresh);
|
|
16752
16817
|
refreshRef.current = controller.refresh;
|
|
16753
|
-
|
|
16818
|
+
useEffect50(() => {
|
|
16754
16819
|
void refreshRef.current();
|
|
16755
16820
|
}, []);
|
|
16756
|
-
|
|
16821
|
+
useEffect50(() => {
|
|
16757
16822
|
setNotice(null);
|
|
16758
16823
|
}, [sport]);
|
|
16759
16824
|
const sportLabel2 = sports.find((s) => s.sport === sport)?.label ?? sportLabel(ui, sport);
|
|
@@ -16779,7 +16844,7 @@ function FavouritesPanel({ controller, ui, sport, sports, onSportChange }) {
|
|
|
16779
16844
|
}
|
|
16780
16845
|
|
|
16781
16846
|
// src/components/dashboard/v8/SentenceBuilder.tsx
|
|
16782
|
-
import { useEffect as
|
|
16847
|
+
import { useEffect as useEffect51, useRef as useRef43, useState as useState75 } from "react";
|
|
16783
16848
|
import { Fragment as Fragment42, jsx as jsx138, jsxs as jsxs123 } from "react/jsx-runtime";
|
|
16784
16849
|
var TOTALS = ["any", "3", "5", "10", "20", "50"];
|
|
16785
16850
|
var BASE_LEGS = [1, 2, 3, 4];
|
|
@@ -16805,8 +16870,8 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
16805
16870
|
const opening = openingGames(preset);
|
|
16806
16871
|
const gamesOptions = opening.options;
|
|
16807
16872
|
const marketOptions = usableMarkets(preset);
|
|
16808
|
-
const [fingerprint] =
|
|
16809
|
-
const [saved] =
|
|
16873
|
+
const [fingerprint] = useState75(() => JSON.stringify(preset));
|
|
16874
|
+
const [saved] = useState75(() => {
|
|
16810
16875
|
const kept = memory3?.savedView(sport);
|
|
16811
16876
|
return kept && kept.fingerprint === fingerprint ? kept : null;
|
|
16812
16877
|
});
|
|
@@ -16820,9 +16885,9 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
16820
16885
|
// The server never widens by itself: an all-games preset with no ids asks for it.
|
|
16821
16886
|
widen: opening.option ? opening.option.matchIds.length === 0 : preset.gamesScope === "all" && preset.matchIds.length === 0
|
|
16822
16887
|
};
|
|
16823
|
-
const [view, setView] =
|
|
16824
|
-
const autoWidened =
|
|
16825
|
-
const [widenedNote, setWidenedNote] =
|
|
16888
|
+
const [view, setView] = useState75(() => saved?.view ?? openingView);
|
|
16889
|
+
const autoWidened = useRef43(false);
|
|
16890
|
+
const [widenedNote, setWidenedNote] = useState75(saved?.widenedNote ?? false);
|
|
16826
16891
|
const requestFor = (v) => ({
|
|
16827
16892
|
sport,
|
|
16828
16893
|
...v.marketKey !== null ? { marketKey: v.marketKey } : {},
|
|
@@ -16834,10 +16899,10 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
16834
16899
|
...operatorUserId ? { operatorUserId } : {},
|
|
16835
16900
|
...anonymousUserId ? { anonymousUserId } : {}
|
|
16836
16901
|
});
|
|
16837
|
-
const [first] =
|
|
16902
|
+
const [first] = useState75(() => requestFor(view));
|
|
16838
16903
|
const { grid, status: status2, confirmed, request } = useBuilderGrid({ conversation, locale: ui.hostTag, memory: memory3, initial: first });
|
|
16839
|
-
const lastRequest =
|
|
16840
|
-
|
|
16904
|
+
const lastRequest = useRef43(first);
|
|
16905
|
+
useEffect51(() => {
|
|
16841
16906
|
void request(lastRequest.current);
|
|
16842
16907
|
}, [request]);
|
|
16843
16908
|
const send = (req) => {
|
|
@@ -16870,14 +16935,14 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
16870
16935
|
const rows = ready && grid.status === "ok" ? legsOf(grid, sport) : null;
|
|
16871
16936
|
const rowSlip = rows ? guardLegsPreMatch(slip, rows, ui) : slip;
|
|
16872
16937
|
useNextKickoffRender(rows ? rows.map((l) => l.kickoffUtc) : []);
|
|
16873
|
-
const [startedNote, setStartedNote] =
|
|
16938
|
+
const [startedNote, setStartedNote] = useState75(false);
|
|
16874
16939
|
const anyStarted = rows !== null && rows.some((l) => !preMatchOpen(l.kickoffUtc, Date.now()));
|
|
16875
|
-
|
|
16940
|
+
useEffect51(() => {
|
|
16876
16941
|
if (startedNote && status2 === "ready" && !anyStarted) setStartedNote(false);
|
|
16877
16942
|
}, [startedNote, status2, anyStarted]);
|
|
16878
16943
|
const market = rows?.[0]?.market;
|
|
16879
|
-
const [seen2, setSeen] =
|
|
16880
|
-
|
|
16944
|
+
const [seen2, setSeen] = useState75(null);
|
|
16945
|
+
useEffect51(() => {
|
|
16881
16946
|
if (market) setSeen(market);
|
|
16882
16947
|
}, [market]);
|
|
16883
16948
|
const marketName = view.marketKey === null ? null : marketOptions?.find((m) => m.key === view.marketKey)?.label ?? market ?? seen2;
|
|
@@ -16890,14 +16955,14 @@ function SentenceBuilder({ preset, ui, conversation, memory: memory3, slip, spor
|
|
|
16890
16955
|
const quotedAt = rows ? oldestQuote(rows) : null;
|
|
16891
16956
|
const combo = ready && grid.total !== null ? { sport, totalChosen: view.total, totalActual: grid.total } : void 0;
|
|
16892
16957
|
const canWiden = gamesOptions === null || allGames !== null;
|
|
16893
|
-
|
|
16958
|
+
useEffect51(() => {
|
|
16894
16959
|
if (!empty2 || !singles || widened || !canWiden || autoWidened.current) return;
|
|
16895
16960
|
autoWidened.current = true;
|
|
16896
16961
|
const next = { ...view, widen: true, matchIds: [], gamesId: allGames ? allGames.id : view.gamesId };
|
|
16897
16962
|
commit(next, true);
|
|
16898
16963
|
send(requestFor(next));
|
|
16899
16964
|
}, [empty2, singles, widened, canWiden, view]);
|
|
16900
|
-
|
|
16965
|
+
useEffect51(() => {
|
|
16901
16966
|
if (coolOff) onCoolOff?.(sport);
|
|
16902
16967
|
}, [coolOff, onCoolOff, sport]);
|
|
16903
16968
|
if (coolOff) return null;
|
|
@@ -17300,10 +17365,10 @@ function Squad({ squad, loading, ui, view, onToggleView, stats, statsLoading, se
|
|
|
17300
17365
|
}
|
|
17301
17366
|
|
|
17302
17367
|
// src/components/PlayerPhoto.tsx
|
|
17303
|
-
import { useState as
|
|
17368
|
+
import { useState as useState76 } from "react";
|
|
17304
17369
|
import { jsx as jsx144 } from "react/jsx-runtime";
|
|
17305
17370
|
function PlayerPhoto({ photoUrl, jerseyNumber, size }) {
|
|
17306
|
-
const [failed, setFailed] =
|
|
17371
|
+
const [failed, setFailed] = useState76(false);
|
|
17307
17372
|
const box = { width: size, height: size };
|
|
17308
17373
|
if (photoUrl && !failed) {
|
|
17309
17374
|
return /* @__PURE__ */ jsx144("img", { className: "ss-w-pd-photo", style: box, src: photoUrl, alt: "", "aria-hidden": "true", onError: () => setFailed(true) });
|
|
@@ -17338,7 +17403,7 @@ function MiniPitch({ positionCode }) {
|
|
|
17338
17403
|
}
|
|
17339
17404
|
|
|
17340
17405
|
// src/components/PerformanceBars.tsx
|
|
17341
|
-
import { useState as
|
|
17406
|
+
import { useState as useState77 } from "react";
|
|
17342
17407
|
import { jsx as jsx146, jsxs as jsxs129 } from "react/jsx-runtime";
|
|
17343
17408
|
var GROUPS = ["shooting", "passing", "possession", "defending"];
|
|
17344
17409
|
function finite4(v) {
|
|
@@ -17384,7 +17449,7 @@ function unrankedLine(ui, reason) {
|
|
|
17384
17449
|
}
|
|
17385
17450
|
}
|
|
17386
17451
|
function PerformanceBars({ performance, competitionName, strings }) {
|
|
17387
|
-
const [mode, setMode] =
|
|
17452
|
+
const [mode, setMode] = useState77("total");
|
|
17388
17453
|
const labelled = performance.metrics.filter((m) => Object.prototype.hasOwnProperty.call(strings.perfMetric, m.key));
|
|
17389
17454
|
if (!labelled.some((m) => valueOf(m, "total") !== null || valueOf(m, "per90") !== null)) return null;
|
|
17390
17455
|
const subtitle = !performance.ranked ? unrankedLine(strings, performance.unrankedReason) : competitionName ? strings.perfRankedAgainst(competitionName, performance.positionGroup) : null;
|
|
@@ -17556,7 +17621,7 @@ function PlayerDetail({ detail, loading, ui, seasonName, onClose }) {
|
|
|
17556
17621
|
}
|
|
17557
17622
|
|
|
17558
17623
|
// src/components/PresetTools.tsx
|
|
17559
|
-
import { useId as useId11, useState as
|
|
17624
|
+
import { useId as useId11, useState as useState78 } from "react";
|
|
17560
17625
|
import { Fragment as Fragment45, jsx as jsx148, jsxs as jsxs131 } from "react/jsx-runtime";
|
|
17561
17626
|
function PresetToolModal({ title, closeLabel, onClose, children, footer, className }) {
|
|
17562
17627
|
const { dialogRef, onKeyDown } = useModalDialog(onClose, { restoreFocus: false });
|
|
@@ -17610,9 +17675,9 @@ function BuildComboTool({ grid, strings, streaming, formatKickoff, initialTotal,
|
|
|
17610
17675
|
const totalOptions = comboTotals(grid);
|
|
17611
17676
|
const totals = totalOptions.map((o) => o.value);
|
|
17612
17677
|
const legChoices = comboLegChoices(grid);
|
|
17613
|
-
const [total, setTotal] =
|
|
17614
|
-
const [legs, setLegs] =
|
|
17615
|
-
const [announcement, setAnnouncement] =
|
|
17678
|
+
const [total, setTotal] = useState78(() => nearest(totals, initialTotal));
|
|
17679
|
+
const [legs, setLegs] = useState78(() => legsForTotal(grid, nearest(totals, initialTotal), clampLegs(legChoices, initialLegs)));
|
|
17680
|
+
const [announcement, setAnnouncement] = useState78("");
|
|
17616
17681
|
const cell2 = findCombo(grid, total, legs);
|
|
17617
17682
|
const minLegs = legChoices[0] ?? legs;
|
|
17618
17683
|
const maxLegs = legChoices[legChoices.length - 1] ?? legs;
|
|
@@ -17682,8 +17747,8 @@ function SettingsSheet({ ui, onClose }) {
|
|
|
17682
17747
|
import { Fragment as Fragment46, jsx as jsx150, jsxs as jsxs133 } from "react/jsx-runtime";
|
|
17683
17748
|
var FULLSCREEN_QUERY = "(max-width: 639px)";
|
|
17684
17749
|
function useIsModal() {
|
|
17685
|
-
const [modal, setModal] =
|
|
17686
|
-
|
|
17750
|
+
const [modal, setModal] = useState79(false);
|
|
17751
|
+
useEffect53(() => {
|
|
17687
17752
|
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
|
|
17688
17753
|
const mql = window.matchMedia(FULLSCREEN_QUERY);
|
|
17689
17754
|
const sync = () => setModal(mql.matches);
|
|
@@ -17695,14 +17760,14 @@ function useIsModal() {
|
|
|
17695
17760
|
}
|
|
17696
17761
|
var HIDDEN_LAYER_STYLE = { position: "absolute", inset: 0, visibility: "hidden", display: "flex", flexDirection: "column" };
|
|
17697
17762
|
var SQUAD_LAYER_STYLE = { display: "flex", flexDirection: "column", flex: 1, minHeight: 0 };
|
|
17698
|
-
function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, schedule, gamesResult, leaderboardResult, clubFixturesResult, clubStandingsResult, clubSquadResult, clubSquadStatsResult, clubPlayerDetailResult, loggedIn, conversation, presetGrid, favouritesEnabled, favourites, builder }) {
|
|
17763
|
+
function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, schedule, gamesResult, leaderboardResult, clubFixturesResult, clubStandingsResult, clubSquadResult, clubSquadStatsResult, clubPlayerDetailResult, loggedIn, conversation, presetGrid, favouritesEnabled, favourites, builder, onCloseRequested, onRegisterBack }) {
|
|
17699
17764
|
const { state, close, stop, send, reset } = controller;
|
|
17700
|
-
const [squadView, setSquadView] =
|
|
17701
|
-
const [selectedPlayerId, setSelectedPlayerId] =
|
|
17765
|
+
const [squadView, setSquadView] = useState79("roster");
|
|
17766
|
+
const [selectedPlayerId, setSelectedPlayerId] = useState79(null);
|
|
17702
17767
|
const clearPlayerDetail = clubPlayerDetailResult?.clear;
|
|
17703
17768
|
const fetchPlayerDetail = clubPlayerDetailResult?.fetch;
|
|
17704
|
-
const squadLayerRef =
|
|
17705
|
-
const squadScrollRef =
|
|
17769
|
+
const squadLayerRef = useRef45(null);
|
|
17770
|
+
const squadScrollRef = useRef45(null);
|
|
17706
17771
|
const selectPlayer = (playerId) => {
|
|
17707
17772
|
squadScrollRef.current = squadLayerRef.current?.querySelector(".ss-w-mon-list")?.scrollTop ?? null;
|
|
17708
17773
|
setSelectedPlayerId(playerId);
|
|
@@ -17725,16 +17790,16 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
17725
17790
|
const hasBuilder = !clubBrand && (builderOptions?.length ?? 0) > 0;
|
|
17726
17791
|
const tabs = monitor ?? (hasBuilder ? tabState : void 0);
|
|
17727
17792
|
const activeTab = tabs?.activeTab;
|
|
17728
|
-
|
|
17793
|
+
useEffect53(() => {
|
|
17729
17794
|
if (activeTab === "squad" || selectedPlayerId === null) return;
|
|
17730
17795
|
setSelectedPlayerId(null);
|
|
17731
17796
|
clearPlayerDetail?.();
|
|
17732
17797
|
}, [activeTab, selectedPlayerId, clearPlayerDetail]);
|
|
17733
|
-
|
|
17798
|
+
useEffect53(() => {
|
|
17734
17799
|
if (activeTab === "favourites" && !favouritesEnabled) setMonitorTab?.("chat");
|
|
17735
17800
|
}, [activeTab, favouritesEnabled, setMonitorTab]);
|
|
17736
17801
|
const storedTab = tabState?.activeTab;
|
|
17737
|
-
|
|
17802
|
+
useEffect53(() => {
|
|
17738
17803
|
const unreachable = storedTab === "builder" ? !hasBuilder : !monitor && storedTab !== void 0 && storedTab !== "chat";
|
|
17739
17804
|
if (unreachable) setMonitorTab?.("chat");
|
|
17740
17805
|
}, [storedTab, hasBuilder, monitor, setMonitorTab]);
|
|
@@ -17743,11 +17808,12 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
17743
17808
|
const closeTab = tabs?.activeTab ?? "chat";
|
|
17744
17809
|
const lastMessage = state.messages[state.messages.length - 1];
|
|
17745
17810
|
const answering = state.isStreaming && !(lastMessage?.role === "assistant" && lastMessage.isGreeting);
|
|
17746
|
-
const closeWith =
|
|
17811
|
+
const closeWith = useCallback27((method) => {
|
|
17747
17812
|
track({ name: "widget_close", method, tab: closeTab, answering });
|
|
17748
|
-
|
|
17749
|
-
|
|
17750
|
-
|
|
17813
|
+
if (onCloseRequested) onCloseRequested();
|
|
17814
|
+
else close();
|
|
17815
|
+
}, [track, closeTab, answering, close, onCloseRequested]);
|
|
17816
|
+
useEffect53(() => {
|
|
17751
17817
|
const onKey = (e) => {
|
|
17752
17818
|
if (e.key === "Escape") closeWith("escape");
|
|
17753
17819
|
};
|
|
@@ -17763,68 +17829,93 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, s
|
|
|
17763
17829
|
tabs?.setActiveTab("chat");
|
|
17764
17830
|
send(text2, { grounding, source });
|
|
17765
17831
|
};
|
|
17766
|
-
|
|
17832
|
+
useEffect53(() => {
|
|
17767
17833
|
if (monitor && monitor.activeTab !== "chat" && state.isStreaming) monitor.markChatActivity();
|
|
17768
17834
|
}, [monitor, state.isStreaming, state.messages.length]);
|
|
17769
17835
|
const onChatTab = !tabs || tabs.activeTab === "chat";
|
|
17770
|
-
const inputRef =
|
|
17771
|
-
const limitRef =
|
|
17772
|
-
const typedSendRef =
|
|
17773
|
-
const focusAfterCloseRef =
|
|
17774
|
-
const [tool, setTool] =
|
|
17775
|
-
const panelRef =
|
|
17836
|
+
const inputRef = useRef45(null);
|
|
17837
|
+
const limitRef = useRef45(null);
|
|
17838
|
+
const typedSendRef = useRef45(false);
|
|
17839
|
+
const focusAfterCloseRef = useRef45(null);
|
|
17840
|
+
const [tool, setTool] = useState79(null);
|
|
17841
|
+
const panelRef = useRef45(null);
|
|
17776
17842
|
const settings = useOddsSettings();
|
|
17777
|
-
const [settingsOpen, setSettingsOpen] =
|
|
17843
|
+
const [settingsOpen, setSettingsOpen] = useState79(false);
|
|
17778
17844
|
const hasSettings = settings.oddsOffered || !settings.themeLocked;
|
|
17779
|
-
const openSettings =
|
|
17845
|
+
const openSettings = useCallback27(() => {
|
|
17780
17846
|
setTool(null);
|
|
17781
17847
|
setSettingsOpen(true);
|
|
17782
17848
|
}, []);
|
|
17783
|
-
const closeSettings =
|
|
17849
|
+
const closeSettings = useCallback27(() => {
|
|
17784
17850
|
setSettingsOpen(false);
|
|
17785
17851
|
panelRef.current?.querySelector(".ss-w-kebab")?.focus();
|
|
17786
17852
|
}, []);
|
|
17787
17853
|
const paused = isPaused(state.limit);
|
|
17788
|
-
|
|
17854
|
+
useEffect53(() => {
|
|
17789
17855
|
if (paused) setTool(null);
|
|
17790
17856
|
}, [paused]);
|
|
17791
|
-
|
|
17857
|
+
useEffect53(() => {
|
|
17792
17858
|
if (!paused) return;
|
|
17793
17859
|
if (typedSendRef.current) limitRef.current?.focus();
|
|
17794
17860
|
typedSendRef.current = false;
|
|
17795
17861
|
}, [paused]);
|
|
17796
|
-
const openTool =
|
|
17862
|
+
const openTool = useCallback27((next) => {
|
|
17797
17863
|
setTool(next);
|
|
17798
17864
|
}, []);
|
|
17799
17865
|
const toolsValue = useMemo12(
|
|
17800
17866
|
() => presetGrid && !paused ? { openBuilder: (total, legs) => openTool({ total, legs }), changeLabel: ui.presets.changeCombo } : null,
|
|
17801
17867
|
[presetGrid, paused, openTool, ui.presets.changeCombo]
|
|
17802
17868
|
);
|
|
17803
|
-
const closeTool =
|
|
17869
|
+
const closeTool = useCallback27(() => {
|
|
17804
17870
|
focusAfterCloseRef.current = "composer";
|
|
17805
17871
|
setTool(null);
|
|
17806
17872
|
}, []);
|
|
17807
|
-
const sendAsk =
|
|
17873
|
+
const sendAsk = useCallback27((ask) => {
|
|
17808
17874
|
focusAfterCloseRef.current = "composer";
|
|
17809
17875
|
setTool(null);
|
|
17810
17876
|
tabs?.setActiveTab("chat");
|
|
17811
17877
|
send(ask.message, { displayText: ask.displayText, preset: ask.preset, source: "preset" });
|
|
17812
17878
|
}, [tabs, send]);
|
|
17813
|
-
const formatKickoff =
|
|
17879
|
+
const formatKickoff = useCallback27((kickoffUtc) => {
|
|
17814
17880
|
const k = ui.bettingKickoff(kickoffUtc);
|
|
17815
17881
|
return `${k.dayLabel} ${k.time}`;
|
|
17816
17882
|
}, [ui]);
|
|
17817
|
-
|
|
17883
|
+
useEffect53(() => {
|
|
17818
17884
|
if (tool) return;
|
|
17819
17885
|
const target = focusAfterCloseRef.current;
|
|
17820
17886
|
focusAfterCloseRef.current = null;
|
|
17821
17887
|
if (target === "composer") inputRef.current?.focus();
|
|
17822
17888
|
}, [tool]);
|
|
17823
|
-
|
|
17889
|
+
useEffect53(() => {
|
|
17824
17890
|
if (!tool || onChatTab && presetGrid) return;
|
|
17825
17891
|
focusAfterCloseRef.current = "composer";
|
|
17826
17892
|
setTool(null);
|
|
17827
17893
|
}, [tool, onChatTab, presetGrid]);
|
|
17894
|
+
const backRef = useRef45(() => false);
|
|
17895
|
+
backRef.current = () => {
|
|
17896
|
+
if (settingsOpen && hasSettings) {
|
|
17897
|
+
closeSettings();
|
|
17898
|
+
return true;
|
|
17899
|
+
}
|
|
17900
|
+
if (tool) {
|
|
17901
|
+
closeTool();
|
|
17902
|
+
return true;
|
|
17903
|
+
}
|
|
17904
|
+
if (selectedPlayerId !== null) {
|
|
17905
|
+
closePlayer();
|
|
17906
|
+
return true;
|
|
17907
|
+
}
|
|
17908
|
+
if (tabs && tabs.activeTab !== "chat") {
|
|
17909
|
+
tabs.setActiveTab("chat");
|
|
17910
|
+
return true;
|
|
17911
|
+
}
|
|
17912
|
+
return false;
|
|
17913
|
+
};
|
|
17914
|
+
useEffect53(() => {
|
|
17915
|
+
if (!onRegisterBack) return;
|
|
17916
|
+
onRegisterBack(() => backRef.current());
|
|
17917
|
+
return () => onRegisterBack(null);
|
|
17918
|
+
}, [onRegisterBack]);
|
|
17828
17919
|
return /* @__PURE__ */ jsxs133("div", { ref: panelRef, className: "ss-w-panel", role: "dialog", "aria-modal": isModal, "aria-label": ui.chatDialogLabel, children: [
|
|
17829
17920
|
/* @__PURE__ */ jsx150(
|
|
17830
17921
|
ChatHeader,
|
|
@@ -18186,6 +18277,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
18186
18277
|
.ss-w-root[data-ss-w-pos="right"] .ss-w-panel,
|
|
18187
18278
|
.ss-w-root[data-ss-w-pos="left"] .ss-w-panel { inset: 0; width: auto; height: auto; border: none; border-radius: 0; }
|
|
18188
18279
|
}
|
|
18280
|
+
.ss-w-root[data-ss-w-mobile] .ss-w-panel { inset: 0; width: 100%; height: 100%; max-width: none; border: 0; border-radius: 0; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
|
|
18189
18281
|
.ss-w-header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--ss-w-line); }
|
|
18190
18282
|
.ss-w-header-mark { width: 18px; height: 18px; display: block; object-fit: contain; }
|
|
18191
18283
|
.ss-w-header-title { font-weight: 660; flex: 1; }
|
|
@@ -18246,7 +18338,7 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
18246
18338
|
/* Entity card: identity header row over a horizontal stat strip */
|
|
18247
18339
|
.ss-w-ecard { display: flex; flex-direction: column; width: 100%; background: var(--ss-w-panel); border: 1px solid var(--ss-w-line); border-radius: 12px; overflow: hidden; text-align: left; }
|
|
18248
18340
|
|
|
18249
|
-
.ss-w-ecard-idtext { display: flex; flex-direction: column; gap: 1px; min-width:
|
|
18341
|
+
.ss-w-ecard-idtext { display: flex; flex-direction: column; gap: 1px; min-width: 45%; max-width: 100%; flex: 1 1 0; }
|
|
18250
18342
|
.ss-w-thumb { width: 54px; height: 54px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 16px; font-weight: 700; color: #fff; background-color: var(--ss-w-nav); background-size: cover; background-position: center; box-shadow: 0 1px 3px rgba(0,0,0,.14); }
|
|
18251
18343
|
.ss-w-thumb.ss-w-team { border-radius: 12px; }
|
|
18252
18344
|
.ss-w-ecard[data-kind="player"] .ss-w-thumb { background-color: var(--ss-w-accent); }
|
|
@@ -18257,10 +18349,10 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
18257
18349
|
.ss-w-ecard-bare { display: flex; align-items: center; }
|
|
18258
18350
|
.ss-w-ecard-bare .ss-w-ecard-hd { padding: 10px 12px; }
|
|
18259
18351
|
|
|
18260
|
-
.ss-w-ecard-hd { display: flex; align-items: center; gap: 11px; padding: 11px 13px; }
|
|
18352
|
+
.ss-w-ecard-hd { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 11px; padding: 11px 13px; }
|
|
18261
18353
|
.ss-w-ecard-hd .ss-w-thumb { width: 40px; height: 40px; font-size: 13px; box-shadow: none; }
|
|
18262
18354
|
.ss-w-ecard-hd .ss-w-thumb.ss-w-team { border-radius: 10px; }
|
|
18263
|
-
.ss-w-ecard-meta { display: inline-flex; align-items: center; gap: 7px; flex:
|
|
18355
|
+
.ss-w-ecard-meta { display: inline-flex; align-items: center; gap: 7px; flex: 0 1 auto; min-width: 0; align-self: flex-start; margin-left: auto; }
|
|
18264
18356
|
.ss-w-ecard-meta .ss-w-ecard-season { margin: 0; }
|
|
18265
18357
|
|
|
18266
18358
|
/* scope tabs: reuse the underline pattern, relocated above the strip */
|
|
@@ -18274,11 +18366,17 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
18274
18366
|
.ss-w-ecard-season { flex: none; margin-left: auto; align-self: center; margin-bottom: 5px; font-size: 10.5px; font-weight: 700; color: var(--ss-w-accent); background: color-mix(in srgb, var(--ss-w-accent) 13%, var(--ss-w-panel)); border-radius: 999px; padding: 3px 9px; white-space: nowrap; }
|
|
18275
18367
|
|
|
18276
18368
|
/* stat strip: 1px gap over a line-colored ground paints hairlines between cells, wrap-safe */
|
|
18277
|
-
.ss-w-ecard-strip { display: grid; gap: 1px; background: var(--ss-w-line); border-top: 1px solid var(--ss-w-line); }
|
|
18369
|
+
.ss-w-ecard-strip { display: grid; gap: 1px; background: var(--ss-w-line); border-top: 1px solid var(--ss-w-line); max-height: calc(2 * 68px + 1px); overflow-y: auto; overscroll-behavior: contain; }
|
|
18370
|
+
.ss-w-ecard-strip--noted { max-height: calc(2 * 86px + 1px); }
|
|
18371
|
+
.ss-w-ecard-strip--more { -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 14px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 14px), transparent); }
|
|
18278
18372
|
.ss-w-ecard-cell { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 4px; padding: 10px 4px 11px; background: var(--ss-w-panel); }
|
|
18279
18373
|
.ss-w-ecard-cval { height: 20px; display: flex; align-items: center; font-size: 17px; font-weight: 720; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
|
|
18280
18374
|
.ss-w-ecard-cval .ss-w-form { width: 42px; }
|
|
18281
|
-
.ss-w-ecard-clabel { font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: var(--ss-w-faint); font-weight: 600; font-variant-numeric: tabular-nums; }
|
|
18375
|
+
.ss-w-ecard-clabel { font-size: 9px; text-transform: uppercase; letter-spacing: .05em; color: var(--ss-w-faint); font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; line-height: 1.3; min-height: 2.6em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
|
|
18376
|
+
.ss-w-ecard-cell--muted > * { opacity: .55; }
|
|
18377
|
+
.ss-w-ecard-note { font-size: 9.5px; color: var(--ss-w-faint); font-style: italic; }
|
|
18378
|
+
.ss-w-ecard-period { font-size: 10.5px; color: var(--ss-w-faint); padding: 6px 13px 8px; border-top: 1px solid var(--ss-w-line); }
|
|
18379
|
+
.ss-w-ecard-chip { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 10.5px; font-weight: 650; color: var(--ss-w-ink); border: 1px solid var(--ss-w-line); border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
|
|
18282
18380
|
|
|
18283
18381
|
.ss-w-form { justify-self: end; display: flex; height: 6px; width: 48px; border-radius: 4px; overflow: hidden; gap: 2px; }
|
|
18284
18382
|
.ss-w-form span { display: block; border-radius: 2px; }
|
|
@@ -20773,9 +20871,9 @@ function StatsWidget(props) {
|
|
|
20773
20871
|
const injectedClient = "client" in props ? props.client : void 0;
|
|
20774
20872
|
const cfg = props.config;
|
|
20775
20873
|
const built = useMemo13(() => buildClient(props), [injectedClient, cfg?.operatorId, cfg?.publicKey, cfg?.baseUrl]);
|
|
20776
|
-
const trackingRef =
|
|
20874
|
+
const trackingRef = useRef46({ envelope: { operatorId: "", widgetVersion: WIDGET_REACT_VERSION } });
|
|
20777
20875
|
const track = useMemo13(() => createTracker(() => trackingRef.current), []);
|
|
20778
|
-
const eventTextRef =
|
|
20876
|
+
const eventTextRef = useRef46(false);
|
|
20779
20877
|
eventTextRef.current = cfg?.eventText === true;
|
|
20780
20878
|
const logger = useMemo13(() => {
|
|
20781
20879
|
if (!built) return null;
|
|
@@ -20792,9 +20890,9 @@ function StatsWidget(props) {
|
|
|
20792
20890
|
[props.config, widgetStrings.strings]
|
|
20793
20891
|
);
|
|
20794
20892
|
const oddsSettings = useOddsSettingsState(ui, built?.conversation, cfg?.operatorId || "default");
|
|
20795
|
-
const rootRef =
|
|
20796
|
-
const introDoneRef =
|
|
20797
|
-
const markIntroDone =
|
|
20893
|
+
const rootRef = useRef46(null);
|
|
20894
|
+
const introDoneRef = useRef46(false);
|
|
20895
|
+
const markIntroDone = useCallback28(() => {
|
|
20798
20896
|
introDoneRef.current = true;
|
|
20799
20897
|
}, []);
|
|
20800
20898
|
const language = injectedClient ? void 0 : hostTag(cfg);
|
|
@@ -20833,15 +20931,15 @@ function StatsWidget(props) {
|
|
|
20833
20931
|
});
|
|
20834
20932
|
const operatorUserId = cfg?.userContext?.operatorUserId;
|
|
20835
20933
|
const anonymousUserId = cfg?.userContext?.anonymousUserId;
|
|
20836
|
-
const getSchedule =
|
|
20934
|
+
const getSchedule = useCallback28(
|
|
20837
20935
|
(localDate, utcOffsetMinutes) => built ? built.conversation.getSchedule(localDate, utcOffsetMinutes, operatorUserId, anonymousUserId) : Promise.resolve(null),
|
|
20838
20936
|
[built, operatorUserId, anonymousUserId]
|
|
20839
20937
|
);
|
|
20840
|
-
const getStates =
|
|
20938
|
+
const getStates = useCallback28(
|
|
20841
20939
|
(matchIds, nbaGameIds, nflGameIds, tennisMatches) => built ? built.conversation.getStates(matchIds, nbaGameIds, nflGameIds, requestTag, tennisMatches) : Promise.resolve(null),
|
|
20842
20940
|
[built, requestTag]
|
|
20843
20941
|
);
|
|
20844
|
-
const getTennisPrices =
|
|
20942
|
+
const getTennisPrices = useCallback28(
|
|
20845
20943
|
(keys) => built ? built.conversation.getStates([], [], [], requestTag, [], keys).then((p) => p?.tennisPrices ?? null) : Promise.resolve(null),
|
|
20846
20944
|
[built, requestTag]
|
|
20847
20945
|
);
|
|
@@ -20865,7 +20963,7 @@ function StatsWidget(props) {
|
|
|
20865
20963
|
return [...seen2];
|
|
20866
20964
|
}, [discovery.matchDays, discovery.groups]);
|
|
20867
20965
|
const scheduleSport = useScheduleSport(offeredSports);
|
|
20868
|
-
const [liveLeague, setLiveLeague] =
|
|
20966
|
+
const [liveLeague, setLiveLeague] = useState80(null);
|
|
20869
20967
|
const [matchesDay, setMatchesDay] = useMatchesDayPick(discovery.localDate);
|
|
20870
20968
|
const matchesLoaded = useMatchesDay({
|
|
20871
20969
|
discovery,
|
|
@@ -20875,8 +20973,8 @@ function StatsWidget(props) {
|
|
|
20875
20973
|
enabled: panelOpen && monitor.activeTab === "matches",
|
|
20876
20974
|
timeZone: ui.timeZone
|
|
20877
20975
|
});
|
|
20878
|
-
const prevLiveSnapshotRef =
|
|
20879
|
-
|
|
20976
|
+
const prevLiveSnapshotRef = useRef46(monitor.snapshot);
|
|
20977
|
+
useEffect54(() => {
|
|
20880
20978
|
const snap = monitor.snapshot;
|
|
20881
20979
|
if (!snap || snap === prevLiveSnapshotRef.current) return;
|
|
20882
20980
|
prevLiveSnapshotRef.current = snap;
|
|
@@ -20916,7 +21014,7 @@ function StatsWidget(props) {
|
|
|
20916
21014
|
const clubSquadResult = useClubSquad(built?.conversation ?? null, { activeTab: monitor.activeTab, enabled: clubFixturesResult.enabled });
|
|
20917
21015
|
const clubSquadStatsResult = useClubSquadStats(built?.conversation ?? null, { activeTab: monitor.activeTab, enabled: clubFixturesResult.enabled });
|
|
20918
21016
|
const clubPlayerDetailResult = useClubPlayerDetail(built?.conversation ?? null);
|
|
20919
|
-
const [favSportPick, setFavSportPick] =
|
|
21017
|
+
const [favSportPick, setFavSportPick] = useState80(null);
|
|
20920
21018
|
const latestGreeting = useMemo13(() => {
|
|
20921
21019
|
for (const m of [...controller.state.messages].reverse()) {
|
|
20922
21020
|
if (m.role === "assistant" && m.defaultSport !== void 0) return m;
|
|
@@ -20932,13 +21030,13 @@ function StatsWidget(props) {
|
|
|
20932
21030
|
const favSport = [favSportPick, rememberedSport, latestGreeting?.defaultSport].find(offered) ?? "football";
|
|
20933
21031
|
const favSports = favSportOptions.length > 0 ? favSportOptions : [{ sport: favSport, label: sportLabel(ui, favSport) }];
|
|
20934
21032
|
const hasFavouritesIdentity = !!(operatorUserId || anonymousUserId);
|
|
20935
|
-
const [builderSportPick, setBuilderSportPick] =
|
|
21033
|
+
const [builderSportPick, setBuilderSportPick] = useState80(null);
|
|
20936
21034
|
const builderGreeting = useMemo13(
|
|
20937
21035
|
() => [...controller.state.messages].reverse().find((m) => m.role === "assistant" && (m.greetingDashboard !== void 0 || m.greetingDashboards !== void 0)) ?? null,
|
|
20938
21036
|
[controller.state.messages]
|
|
20939
21037
|
);
|
|
20940
|
-
const [coolOff, setCoolOff] =
|
|
20941
|
-
const onBuilderCoolOff =
|
|
21038
|
+
const [coolOff, setCoolOff] = useState80(null);
|
|
21039
|
+
const onBuilderCoolOff = useCallback28((sport) => {
|
|
20942
21040
|
if (!builderGreeting) return;
|
|
20943
21041
|
setCoolOff((prev) => {
|
|
20944
21042
|
const sports = prev?.greeting === builderGreeting ? prev.sports : [];
|
|
@@ -20958,7 +21056,7 @@ function StatsWidget(props) {
|
|
|
20958
21056
|
return options.filter((o) => !cooled.includes(o.sport));
|
|
20959
21057
|
}, [builderGreeting, coolOff, ui]);
|
|
20960
21058
|
const builderSport = [builderSportPick, rememberedSport, latestGreeting?.defaultSport].find((s) => !!s && builderOptions.some((o) => o.sport === s)) ?? builderOptions[0]?.sport ?? "";
|
|
20961
|
-
const [panelEverOpened, setPanelEverOpened] =
|
|
21059
|
+
const [panelEverOpened, setPanelEverOpened] = useState80(panelOpen);
|
|
20962
21060
|
if (panelOpen && !panelEverOpened) setPanelEverOpened(true);
|
|
20963
21061
|
const favourites = useFavourites({
|
|
20964
21062
|
conversation: built?.conversation ?? null,
|
|
@@ -20970,14 +21068,14 @@ function StatsWidget(props) {
|
|
|
20970
21068
|
onChanged: discovery.refreshSchedule
|
|
20971
21069
|
});
|
|
20972
21070
|
const favouritesEnabled = hasFavouritesIdentity && favourites.status !== "refused";
|
|
20973
|
-
const getPricePresets =
|
|
21071
|
+
const getPricePresets = useCallback28(
|
|
20974
21072
|
(locale) => built ? built.conversation.getPricePresets(locale, { pool: "open" }) : Promise.resolve(null),
|
|
20975
21073
|
[built]
|
|
20976
21074
|
);
|
|
20977
21075
|
const presetGrid = usePresetGrid({ getPricePresets, isOpen: panelOpen, locale: ui.hostTag });
|
|
20978
21076
|
const markLiveActivity = monitor.markLiveActivity;
|
|
20979
|
-
const prevLiveCountRef =
|
|
20980
|
-
|
|
21077
|
+
const prevLiveCountRef = useRef46(0);
|
|
21078
|
+
useEffect54(() => {
|
|
20981
21079
|
const rose = prevLiveCountRef.current === 0 && discovery.liveCount > 0;
|
|
20982
21080
|
prevLiveCountRef.current = discovery.liveCount;
|
|
20983
21081
|
if (rose) markLiveActivity();
|
|
@@ -21015,8 +21113,6 @@ function StatsWidget(props) {
|
|
|
21015
21113
|
() => built ? createDashboardTapSignal((input) => built.conversation.sendSignal(input), logger) : void 0,
|
|
21016
21114
|
[built, logger]
|
|
21017
21115
|
);
|
|
21018
|
-
const dismissPopup = usePopupTelemetry(logger, panelOpen, controller.state.popupText, controller.dismissPopup);
|
|
21019
|
-
useOpenTelemetry(logger, panelOpen);
|
|
21020
21116
|
const asks = bubbleAsks(controller.state.messages, ui.presets.standoutAsk, oddsSettings.oddsFormat).map((ask) => ({
|
|
21021
21117
|
label: ask.label,
|
|
21022
21118
|
onTap: () => runBubbleAsk(ask, {
|
|
@@ -21027,10 +21123,24 @@ function StatsWidget(props) {
|
|
|
21027
21123
|
log: logger
|
|
21028
21124
|
})
|
|
21029
21125
|
}));
|
|
21030
|
-
const
|
|
21126
|
+
const dismissPopupRef = useRef46(() => {
|
|
21127
|
+
});
|
|
21128
|
+
const mobile = useMobileBinding({
|
|
21129
|
+
binding: props.mobile,
|
|
21130
|
+
panelOpen,
|
|
21131
|
+
popupText: controller.state.popupText,
|
|
21132
|
+
asks,
|
|
21133
|
+
open: controller.open,
|
|
21134
|
+
close: controller.close,
|
|
21135
|
+
dismissPopup: () => dismissPopupRef.current()
|
|
21136
|
+
});
|
|
21137
|
+
const dismissPopup = usePopupTelemetry(logger, panelOpen, controller.state.popupText, controller.dismissPopup, mobile.confirmedShown);
|
|
21138
|
+
dismissPopupRef.current = dismissPopup;
|
|
21139
|
+
useOpenTelemetry(logger, panelOpen);
|
|
21140
|
+
const onControlRef = useRef46(props.onControl);
|
|
21031
21141
|
onControlRef.current = props.onControl;
|
|
21032
21142
|
const { open: openPanel, close: closePanel } = controller;
|
|
21033
|
-
|
|
21143
|
+
useEffect54(() => {
|
|
21034
21144
|
onControlRef.current?.({ open: openPanel, close: closePanel });
|
|
21035
21145
|
return () => onControlRef.current?.(null);
|
|
21036
21146
|
}, [openPanel, closePanel]);
|
|
@@ -21047,11 +21157,11 @@ function StatsWidget(props) {
|
|
|
21047
21157
|
page: cfg?.page
|
|
21048
21158
|
}
|
|
21049
21159
|
};
|
|
21050
|
-
|
|
21160
|
+
useEffect54(() => {
|
|
21051
21161
|
if (!logger) return;
|
|
21052
21162
|
logger.setIdentity({ operatorUserId, anonymousUserId, conversationId });
|
|
21053
21163
|
}, [logger, operatorUserId, anonymousUserId, conversationId]);
|
|
21054
|
-
|
|
21164
|
+
useEffect54(() => {
|
|
21055
21165
|
if (!logger) return;
|
|
21056
21166
|
logger.resume();
|
|
21057
21167
|
const onHide = () => {
|
|
@@ -21069,7 +21179,7 @@ function StatsWidget(props) {
|
|
|
21069
21179
|
logger.dispose();
|
|
21070
21180
|
};
|
|
21071
21181
|
}, [logger]);
|
|
21072
|
-
|
|
21182
|
+
useEffect54(() => {
|
|
21073
21183
|
if (!built || !ui.injectStyles || widgetStrings.state === "unavailable") return;
|
|
21074
21184
|
const node = rootRef.current?.getRootNode();
|
|
21075
21185
|
if (node) injectStyles(node);
|
|
@@ -21090,7 +21200,7 @@ function StatsWidget(props) {
|
|
|
21090
21200
|
}), [favouritesEnabled, monitor.enabled, clubFixturesResult.settled, clubFixturesResult.tabReady, clubFixturesResult.enabled, monitor.setActiveTab, favourites, built, holds, builderMemory]);
|
|
21091
21201
|
if (!built || widgetStrings.state === "unavailable") return null;
|
|
21092
21202
|
const attrs = themeAttrs(ui, oddsSettings.userTheme);
|
|
21093
|
-
return /* @__PURE__ */ jsx152(EventLogContext.Provider, { value: logger, children: /* @__PURE__ */ jsx152(TrackingContext.Provider, { value: track, children: /* @__PURE__ */ jsx152(SportScopeContext.Provider, { value: sportScope, children: /* @__PURE__ */ jsx152(OddsSettingsContext.Provider, { value: oddsSettings, children: /* @__PURE__ */ jsx152(HostEventsProvider, { value: hostEvents, children: /* @__PURE__ */ jsx152("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"], style: attrs.style, children: panelOpen ? /* @__PURE__ */ jsx152(PersonalGreetingContext.Provider, { value: personalGreeting, children: /* @__PURE__ */ jsx152(
|
|
21203
|
+
return /* @__PURE__ */ jsx152(EventLogContext.Provider, { value: logger, children: /* @__PURE__ */ jsx152(TrackingContext.Provider, { value: track, children: /* @__PURE__ */ jsx152(SportScopeContext.Provider, { value: sportScope, children: /* @__PURE__ */ jsx152(OddsSettingsContext.Provider, { value: oddsSettings, children: /* @__PURE__ */ jsx152(HostEventsProvider, { value: hostEvents, children: /* @__PURE__ */ jsx152("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__ */ jsx152(PersonalGreetingContext.Provider, { value: personalGreeting, children: /* @__PURE__ */ jsx152(
|
|
21094
21204
|
ChatPanel,
|
|
21095
21205
|
{
|
|
21096
21206
|
controller,
|
|
@@ -21122,9 +21232,11 @@ function StatsWidget(props) {
|
|
|
21122
21232
|
presetGrid,
|
|
21123
21233
|
favouritesEnabled: favouritesEnabled && clubFixturesResult.tabReady && !clubFixturesResult.enabled,
|
|
21124
21234
|
favourites: { controller: favourites, sport: favSport, sports: favSports, onSportChange: setFavSportPick },
|
|
21125
|
-
builder: { options: builderOptions, sport: builderSport, onSportChange: setBuilderSportPick, onCoolOff: onBuilderCoolOff, tabs: monitor }
|
|
21235
|
+
builder: { options: builderOptions, sport: builderSport, onSportChange: setBuilderSportPick, onCoolOff: onBuilderCoolOff, tabs: monitor },
|
|
21236
|
+
onCloseRequested: mobile.onCloseRequested,
|
|
21237
|
+
onRegisterBack: mobile.onRegisterBack
|
|
21126
21238
|
}
|
|
21127
|
-
) }) : /* @__PURE__ */ jsx152(
|
|
21239
|
+
) }) : props.mobile ? null : /* @__PURE__ */ jsx152(
|
|
21128
21240
|
ChatFab,
|
|
21129
21241
|
{
|
|
21130
21242
|
label: stringsPending ? cfg?.launcherLabel : ui.launcherLabel,
|
|
@@ -21149,6 +21261,7 @@ function emptyConversation() {
|
|
|
21149
21261
|
export {
|
|
21150
21262
|
StatsWidget,
|
|
21151
21263
|
WIDGET_CSS,
|
|
21264
|
+
WIDGET_REACT_VERSION,
|
|
21152
21265
|
createWidgetHost
|
|
21153
21266
|
};
|
|
21154
21267
|
//# sourceMappingURL=index.js.map
|