@sensiblestats/widget-react 0.76.0 → 0.78.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 +934 -849
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +799 -714
- package/dist/index.js.map +1 -1
- package/dist/styles.css +31 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/StatsWidget.tsx
|
|
2
|
-
import { useCallback as useCallback14, useEffect as
|
|
2
|
+
import { useCallback as useCallback14, useEffect as useEffect27, useMemo as useMemo5, useRef as useRef23, useState as useState44 } from "react";
|
|
3
3
|
import { StatsWidgetClient } from "@sensiblestats/widget-sdk";
|
|
4
4
|
|
|
5
5
|
// src/kickoff.ts
|
|
@@ -170,6 +170,8 @@ var STRINGS = {
|
|
|
170
170
|
statRank: "Rank",
|
|
171
171
|
unitDays: "days",
|
|
172
172
|
unitPts: "pts",
|
|
173
|
+
worthNow: (pts) => `Worth ${pts} pts now`,
|
|
174
|
+
worthAfterMiss: (pts) => `${pts} after a miss`,
|
|
173
175
|
thisWeek: "this week",
|
|
174
176
|
newToday: "New today",
|
|
175
177
|
resume: "Resume",
|
|
@@ -510,6 +512,8 @@ var STRINGS = {
|
|
|
510
512
|
statRank: "S\u0131ra",
|
|
511
513
|
unitDays: "g\xFCn",
|
|
512
514
|
unitPts: "puan",
|
|
515
|
+
worthNow: (pts) => `\u015Eimdi ${pts} puan`,
|
|
516
|
+
worthAfterMiss: (pts) => `yanl\u0131\u015Fta ${pts}`,
|
|
513
517
|
thisWeek: "bu hafta",
|
|
514
518
|
newToday: "Bug\xFCn yeni",
|
|
515
519
|
resume: "Devam et",
|
|
@@ -3102,8 +3106,23 @@ function usePopupTelemetry(log, isOpen, popupText, dismissPopup) {
|
|
|
3102
3106
|
}, [log, dismissPopup]);
|
|
3103
3107
|
}
|
|
3104
3108
|
|
|
3109
|
+
// src/openTelemetry.ts
|
|
3110
|
+
import { useEffect as useEffect10, useRef as useRef10 } from "react";
|
|
3111
|
+
function useOpenTelemetry(log, isOpen) {
|
|
3112
|
+
const openLoggedRef = useRef10(false);
|
|
3113
|
+
useEffect10(() => {
|
|
3114
|
+
if (!isOpen) {
|
|
3115
|
+
openLoggedRef.current = false;
|
|
3116
|
+
return;
|
|
3117
|
+
}
|
|
3118
|
+
if (openLoggedRef.current || !log) return;
|
|
3119
|
+
openLoggedRef.current = true;
|
|
3120
|
+
log.log({ name: "widget_open" });
|
|
3121
|
+
}, [log, isOpen]);
|
|
3122
|
+
}
|
|
3123
|
+
|
|
3105
3124
|
// src/components/ChatFab.tsx
|
|
3106
|
-
import { useEffect as
|
|
3125
|
+
import { useEffect as useEffect11, useRef as useRef11, useState as useState9 } from "react";
|
|
3107
3126
|
|
|
3108
3127
|
// src/components/BrandMark.tsx
|
|
3109
3128
|
import { useState as useState8 } from "react";
|
|
@@ -3206,8 +3225,8 @@ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
|
3206
3225
|
function ChatFab({ label, greeting, popupText, logoUrl, onOpen, onDismissPopup, dismissLabel = "Dismiss", introAllowed = false, onIntroStart, asks }) {
|
|
3207
3226
|
const bubble = popupText ?? greeting;
|
|
3208
3227
|
const [intro, setIntro] = useState9(false);
|
|
3209
|
-
const armedRef =
|
|
3210
|
-
|
|
3228
|
+
const armedRef = useRef11(introAllowed);
|
|
3229
|
+
useEffect11(() => {
|
|
3211
3230
|
if (armedRef.current && bubble) {
|
|
3212
3231
|
armedRef.current = false;
|
|
3213
3232
|
setIntro(true);
|
|
@@ -3221,10 +3240,10 @@ function ChatFab({ label, greeting, popupText, logoUrl, onOpen, onDismissPopup,
|
|
|
3221
3240
|
}
|
|
3222
3241
|
|
|
3223
3242
|
// src/components/ChatPanel.tsx
|
|
3224
|
-
import { useCallback as useCallback13, useEffect as
|
|
3243
|
+
import { useCallback as useCallback13, useEffect as useEffect26, useMemo as useMemo4, useRef as useRef22, useState as useState43 } from "react";
|
|
3225
3244
|
|
|
3226
3245
|
// src/components/ChatHeader.tsx
|
|
3227
|
-
import { useEffect as
|
|
3246
|
+
import { useEffect as useEffect12, useRef as useRef12, useState as useState10 } from "react";
|
|
3228
3247
|
import { jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
3229
3248
|
function ChatHeader({
|
|
3230
3249
|
onClose,
|
|
@@ -3237,14 +3256,14 @@ function ChatHeader({
|
|
|
3237
3256
|
moreOptionsLabel = "More options"
|
|
3238
3257
|
}) {
|
|
3239
3258
|
const [menuOpen, setMenuOpen] = useState10(false);
|
|
3240
|
-
const wrapRef =
|
|
3241
|
-
const kebabRef =
|
|
3242
|
-
const firstItemRef =
|
|
3259
|
+
const wrapRef = useRef12(null);
|
|
3260
|
+
const kebabRef = useRef12(null);
|
|
3261
|
+
const firstItemRef = useRef12(null);
|
|
3243
3262
|
const hasMenu = !!(canReset && onNewConversation);
|
|
3244
|
-
|
|
3263
|
+
useEffect12(() => {
|
|
3245
3264
|
if (menuOpen) firstItemRef.current?.focus();
|
|
3246
3265
|
}, [menuOpen]);
|
|
3247
|
-
|
|
3266
|
+
useEffect12(() => {
|
|
3248
3267
|
if (!menuOpen) return;
|
|
3249
3268
|
const onPointer = (e) => {
|
|
3250
3269
|
if (!wrapRef.current?.contains(e.target)) setMenuOpen(false);
|
|
@@ -3300,7 +3319,7 @@ function ChatHeader({
|
|
|
3300
3319
|
}
|
|
3301
3320
|
|
|
3302
3321
|
// src/components/MessageList.tsx
|
|
3303
|
-
import { useEffect as
|
|
3322
|
+
import { useEffect as useEffect18, useRef as useRef15 } from "react";
|
|
3304
3323
|
|
|
3305
3324
|
// src/components/Markdown.tsx
|
|
3306
3325
|
import ReactMarkdown from "react-markdown";
|
|
@@ -3438,11 +3457,11 @@ function useSlipState() {
|
|
|
3438
3457
|
}
|
|
3439
3458
|
|
|
3440
3459
|
// src/components/Toast.tsx
|
|
3441
|
-
import { useEffect as
|
|
3460
|
+
import { useEffect as useEffect13 } from "react";
|
|
3442
3461
|
import { jsx as jsx8 } from "react/jsx-runtime";
|
|
3443
3462
|
var DISMISS_MS = 4e3;
|
|
3444
3463
|
function Toast({ toast, onDismiss }) {
|
|
3445
|
-
|
|
3464
|
+
useEffect13(() => {
|
|
3446
3465
|
if (!toast) return;
|
|
3447
3466
|
const timer = setTimeout(onDismiss, DISMISS_MS);
|
|
3448
3467
|
return () => clearTimeout(timer);
|
|
@@ -3841,7 +3860,7 @@ function ComboCardList({ cards, ui, slip, monitor }) {
|
|
|
3841
3860
|
}
|
|
3842
3861
|
|
|
3843
3862
|
// src/components/MarketOddsCardList.tsx
|
|
3844
|
-
import { useEffect as
|
|
3863
|
+
import { useEffect as useEffect14, useState as useState16 } from "react";
|
|
3845
3864
|
|
|
3846
3865
|
// src/components/AllMarketsButton.tsx
|
|
3847
3866
|
import { jsx as jsx16, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
@@ -3916,7 +3935,7 @@ function MarketOddsCard({ vm, ui, slip, monitor, inSlipIds, hideHeader, pinRef }
|
|
|
3916
3935
|
const staleTime = isStale && live ? fmtHhMm(live.asOfUtc, ui?.locale ?? "en") : null;
|
|
3917
3936
|
const [, setStaleTick] = useState16(0);
|
|
3918
3937
|
const watchStale = live != null && !isClosed && !isStale;
|
|
3919
|
-
|
|
3938
|
+
useEffect14(() => {
|
|
3920
3939
|
if (!watchStale) return;
|
|
3921
3940
|
const id = window.setTimeout(() => setStaleTick((n) => n + 1), Math.max(0, asOfMs + STALE_AFTER_MS - Date.now()) + 1);
|
|
3922
3941
|
return () => window.clearTimeout(id);
|
|
@@ -3995,7 +4014,7 @@ function MarketOddsCardList({ cards, ui, slip, monitor, inSlipIds, hideHeader, p
|
|
|
3995
4014
|
}
|
|
3996
4015
|
|
|
3997
4016
|
// src/components/CompactOddsList.tsx
|
|
3998
|
-
import { useEffect as
|
|
4017
|
+
import { useEffect as useEffect15, useRef as useRef13, useState as useState17 } from "react";
|
|
3999
4018
|
|
|
4000
4019
|
// src/compactList.ts
|
|
4001
4020
|
var COMPACT_MIN_CARDS = 3;
|
|
@@ -4112,8 +4131,8 @@ function CompactOddsList({ list, ui, slip, monitor }) {
|
|
|
4112
4131
|
const [shown, setShown] = useState17(COMPACT_PAGE);
|
|
4113
4132
|
const hidden = list.rowCount - shown;
|
|
4114
4133
|
const [focusIndex, setFocusIndex] = useState17(null);
|
|
4115
|
-
const focusRef =
|
|
4116
|
-
|
|
4134
|
+
const focusRef = useRef13(null);
|
|
4135
|
+
useEffect15(() => {
|
|
4117
4136
|
if (focusIndex !== null) focusRef.current?.focus();
|
|
4118
4137
|
}, [focusIndex]);
|
|
4119
4138
|
let left = shown;
|
|
@@ -4418,7 +4437,7 @@ function FixtureCard({ card }) {
|
|
|
4418
4437
|
}
|
|
4419
4438
|
|
|
4420
4439
|
// src/components/dashboard/CountdownCard.tsx
|
|
4421
|
-
import { Fragment as Fragment6, useEffect as
|
|
4440
|
+
import { Fragment as Fragment6, useEffect as useEffect16, useState as useState18 } from "react";
|
|
4422
4441
|
import { jsx as jsx24, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
4423
4442
|
var DAY_MS = 864e5;
|
|
4424
4443
|
function remainingSegments(kickoffUnix, nowMs, withSeconds) {
|
|
@@ -4442,7 +4461,7 @@ function CountdownCard({ card }) {
|
|
|
4442
4461
|
() => typeof window !== "undefined" && window.matchMedia("(prefers-reduced-motion: reduce)").matches
|
|
4443
4462
|
);
|
|
4444
4463
|
const withinDay = data.kickoffUnix * 1e3 - nowMs < DAY_MS;
|
|
4445
|
-
|
|
4464
|
+
useEffect16(() => {
|
|
4446
4465
|
if (reduced) return;
|
|
4447
4466
|
const id = window.setInterval(() => setNowMs(Date.now()), withinDay ? 1e3 : 6e4);
|
|
4448
4467
|
return () => window.clearInterval(id);
|
|
@@ -4799,10 +4818,10 @@ function RestingFormCard({ card }) {
|
|
|
4799
4818
|
}
|
|
4800
4819
|
|
|
4801
4820
|
// src/components/dashboard/LiveScoreCard.tsx
|
|
4802
|
-
import { useRef as
|
|
4821
|
+
import { useRef as useRef14, useState as useState22 } from "react";
|
|
4803
4822
|
|
|
4804
4823
|
// src/useLiveClock.ts
|
|
4805
|
-
import { useEffect as
|
|
4824
|
+
import { useEffect as useEffect17, useState as useState21 } from "react";
|
|
4806
4825
|
var TICK_MS = 6e4;
|
|
4807
4826
|
var MAX_LIVE_TICK_MINUTES = 15;
|
|
4808
4827
|
function computeDisplayMinute(minute, clockRunning, receivedAtMs) {
|
|
@@ -4814,7 +4833,7 @@ function useLiveClock(minute, clockRunning, receivedAtMs) {
|
|
|
4814
4833
|
const [displayMinute, setDisplayMinute] = useState21(
|
|
4815
4834
|
() => computeDisplayMinute(minute, clockRunning, receivedAtMs)
|
|
4816
4835
|
);
|
|
4817
|
-
|
|
4836
|
+
useEffect17(() => {
|
|
4818
4837
|
setDisplayMinute(computeDisplayMinute(minute, clockRunning, receivedAtMs));
|
|
4819
4838
|
if (!clockRunning) return;
|
|
4820
4839
|
const id = window.setInterval(() => {
|
|
@@ -4850,7 +4869,7 @@ function LiveScoreCard({
|
|
|
4850
4869
|
}) {
|
|
4851
4870
|
const { data } = card;
|
|
4852
4871
|
const seedKey = `${data.minute}:${data.homeScore}:${data.awayScore}`;
|
|
4853
|
-
const seedRef =
|
|
4872
|
+
const seedRef = useRef14(null);
|
|
4854
4873
|
if (!seedRef.current || seedRef.current.key !== seedKey) {
|
|
4855
4874
|
seedRef.current = { key: seedKey, receivedAtMs: Date.now() };
|
|
4856
4875
|
}
|
|
@@ -5174,11 +5193,11 @@ function turnAnchor(messages) {
|
|
|
5174
5193
|
}
|
|
5175
5194
|
function MessageList({ controller, ui, slip, onDashboardTap, monitor }) {
|
|
5176
5195
|
const { state, send } = controller;
|
|
5177
|
-
const listRef =
|
|
5178
|
-
const endRef =
|
|
5179
|
-
const pinnedRef =
|
|
5180
|
-
const anchoredTurnRef =
|
|
5181
|
-
|
|
5196
|
+
const listRef = useRef15(null);
|
|
5197
|
+
const endRef = useRef15(null);
|
|
5198
|
+
const pinnedRef = useRef15(true);
|
|
5199
|
+
const anchoredTurnRef = useRef15(null);
|
|
5200
|
+
useEffect18(() => {
|
|
5182
5201
|
const anchor = turnAnchor(state.messages);
|
|
5183
5202
|
const list = listRef.current;
|
|
5184
5203
|
if (anchor && anchor.turnId !== anchoredTurnRef.current) {
|
|
@@ -5235,13 +5254,13 @@ function MessageList({ controller, ui, slip, onDashboardTap, monitor }) {
|
|
|
5235
5254
|
}
|
|
5236
5255
|
|
|
5237
5256
|
// src/components/ChatInput.tsx
|
|
5238
|
-
import { forwardRef, useEffect as
|
|
5257
|
+
import { forwardRef, useEffect as useEffect19, useImperativeHandle, useRef as useRef16, useState as useState24 } from "react";
|
|
5239
5258
|
import { jsx as jsx48, jsxs as jsxs43 } from "react/jsx-runtime";
|
|
5240
5259
|
var ChatInput = forwardRef(function ChatInput2({ placeholder, streaming, onSend, onStop, stopLabel = "Stop response", sendLabel = "Send message", disabled = false, onType }, ref) {
|
|
5241
5260
|
const [value, setValue] = useState24("");
|
|
5242
|
-
const textareaRef =
|
|
5243
|
-
const stopRef =
|
|
5244
|
-
const textBoxWantsFocusRef =
|
|
5261
|
+
const textareaRef = useRef16(null);
|
|
5262
|
+
const stopRef = useRef16(null);
|
|
5263
|
+
const textBoxWantsFocusRef = useRef16(false);
|
|
5245
5264
|
const submit = () => {
|
|
5246
5265
|
if (disabled) return;
|
|
5247
5266
|
const t = value.trim();
|
|
@@ -5267,7 +5286,7 @@ var ChatInput = forwardRef(function ChatInput2({ placeholder, streaming, onSend,
|
|
|
5267
5286
|
stopRef.current?.focus();
|
|
5268
5287
|
}
|
|
5269
5288
|
}), []);
|
|
5270
|
-
|
|
5289
|
+
useEffect19(() => {
|
|
5271
5290
|
if (streaming || disabled || !textBoxWantsFocusRef.current) return;
|
|
5272
5291
|
textBoxWantsFocusRef.current = false;
|
|
5273
5292
|
const box = textareaRef.current;
|
|
@@ -5759,7 +5778,7 @@ function TodayPanel({ discovery, ui, monitor }) {
|
|
|
5759
5778
|
}
|
|
5760
5779
|
|
|
5761
5780
|
// src/components/GamesPanel.tsx
|
|
5762
|
-
import { useEffect as
|
|
5781
|
+
import { useEffect as useEffect23, useState as useState39 } from "react";
|
|
5763
5782
|
|
|
5764
5783
|
// src/components/GamesLoginWall.tsx
|
|
5765
5784
|
import { jsx as jsx57 } from "react/jsx-runtime";
|
|
@@ -5768,7 +5787,7 @@ function GamesLoginWall({ ui }) {
|
|
|
5768
5787
|
}
|
|
5769
5788
|
|
|
5770
5789
|
// src/components/GamesHub.tsx
|
|
5771
|
-
import { useEffect as
|
|
5790
|
+
import { useEffect as useEffect20, useState as useState26 } from "react";
|
|
5772
5791
|
|
|
5773
5792
|
// src/components/games/ui/gameMeta.ts
|
|
5774
5793
|
function prettifyGameId(gameId) {
|
|
@@ -5954,7 +5973,7 @@ function pickHeroGame(games) {
|
|
|
5954
5973
|
var tileKey = (g) => `${g.gameId}-${g.gameDay}-${g.fixtureId}`;
|
|
5955
5974
|
function GamesHub({ games, myWeeklyRow, weeklyPrize, onOpen, ui }) {
|
|
5956
5975
|
const [, setTick] = useState26(0);
|
|
5957
|
-
|
|
5976
|
+
useEffect20(() => {
|
|
5958
5977
|
const id = setInterval(() => setTick((t) => t + 1), 6e4);
|
|
5959
5978
|
return () => clearInterval(id);
|
|
5960
5979
|
}, []);
|
|
@@ -6014,10 +6033,10 @@ function GamesHub({ games, myWeeklyRow, weeklyPrize, onOpen, ui }) {
|
|
|
6014
6033
|
}
|
|
6015
6034
|
|
|
6016
6035
|
// src/components/GameScreenHost.tsx
|
|
6017
|
-
import { useEffect as
|
|
6036
|
+
import { useEffect as useEffect22, useRef as useRef19, useState as useState38 } from "react";
|
|
6018
6037
|
|
|
6019
6038
|
// src/useGamePlay.ts
|
|
6020
|
-
import { useCallback as useCallback11, useRef as
|
|
6039
|
+
import { useCallback as useCallback11, useRef as useRef17, useState as useState27 } from "react";
|
|
6021
6040
|
function toSubmitResult(payload) {
|
|
6022
6041
|
return {
|
|
6023
6042
|
// 'pending' means the play is recorded but awaiting resolution (fixture games)
|
|
@@ -6032,12 +6051,12 @@ function useGamePlay(conversation, { gameId, gameDay, fixtureId, locale, refresh
|
|
|
6032
6051
|
const [result, setResult] = useState27(null);
|
|
6033
6052
|
const [submitting, setSubmitting] = useState27(false);
|
|
6034
6053
|
const [rawStatus, setRawStatus] = useState27(null);
|
|
6035
|
-
const inFlightRef =
|
|
6036
|
-
const convRef =
|
|
6054
|
+
const inFlightRef = useRef17(false);
|
|
6055
|
+
const convRef = useRef17(conversation);
|
|
6037
6056
|
convRef.current = conversation;
|
|
6038
|
-
const optsRef =
|
|
6057
|
+
const optsRef = useRef17({ gameId, gameDay, fixtureId, locale, refresh });
|
|
6039
6058
|
optsRef.current = { gameId, gameDay, fixtureId, locale, refresh };
|
|
6040
|
-
const resultRef =
|
|
6059
|
+
const resultRef = useRef17(null);
|
|
6041
6060
|
resultRef.current = result;
|
|
6042
6061
|
const refetch = useCallback11(async () => {
|
|
6043
6062
|
const conv = convRef.current;
|
|
@@ -6385,53 +6404,104 @@ function SearchField({ id, label, labelHidden = false, placeholder, value, onCha
|
|
|
6385
6404
|
] });
|
|
6386
6405
|
}
|
|
6387
6406
|
|
|
6407
|
+
// src/components/games/ui/AnswerTray.tsx
|
|
6408
|
+
import { Fragment as Fragment11, jsx as jsx67, jsxs as jsxs59 } from "react/jsx-runtime";
|
|
6409
|
+
function AnswerTray({ id, label, placeholder, optionsLabel, options, query, onQuery, onPick, disabled, minQuery = 0 }) {
|
|
6410
|
+
const needle = query.trim().toLowerCase();
|
|
6411
|
+
const shown = needle.length < minQuery ? [] : needle ? options.filter((o) => o.name.toLowerCase().includes(needle)) : options;
|
|
6412
|
+
return /* @__PURE__ */ jsxs59(Fragment11, { children: [
|
|
6413
|
+
/* @__PURE__ */ jsx67(
|
|
6414
|
+
SearchField,
|
|
6415
|
+
{
|
|
6416
|
+
id,
|
|
6417
|
+
label,
|
|
6418
|
+
labelHidden: true,
|
|
6419
|
+
placeholder,
|
|
6420
|
+
value: query,
|
|
6421
|
+
onChange: onQuery,
|
|
6422
|
+
disabled
|
|
6423
|
+
}
|
|
6424
|
+
),
|
|
6425
|
+
shown.length > 0 && /* @__PURE__ */ jsx67("div", { className: "ss-g-tray", role: "listbox", "aria-label": optionsLabel, children: shown.map((o) => {
|
|
6426
|
+
const { first, last } = splitName(o.name);
|
|
6427
|
+
return /* @__PURE__ */ jsxs59(
|
|
6428
|
+
"button",
|
|
6429
|
+
{
|
|
6430
|
+
type: "button",
|
|
6431
|
+
role: "option",
|
|
6432
|
+
"aria-selected": false,
|
|
6433
|
+
"aria-label": o.name,
|
|
6434
|
+
className: "ss-g-tray-chip",
|
|
6435
|
+
disabled,
|
|
6436
|
+
onClick: () => onPick(o.id),
|
|
6437
|
+
children: [
|
|
6438
|
+
/* @__PURE__ */ jsx67(PlayerAvatar, { className: "ss-g-tray-av", name: o.name, imagePath: o.imagePath }),
|
|
6439
|
+
/* @__PURE__ */ jsxs59("span", { className: "ss-g-tray-name", "aria-hidden": "true", children: [
|
|
6440
|
+
first && /* @__PURE__ */ jsx67("span", { className: "ss-g-tray-first", children: first }),
|
|
6441
|
+
/* @__PURE__ */ jsx67("span", { className: "ss-g-tray-last", children: last })
|
|
6442
|
+
] })
|
|
6443
|
+
]
|
|
6444
|
+
},
|
|
6445
|
+
o.id
|
|
6446
|
+
);
|
|
6447
|
+
}) })
|
|
6448
|
+
] });
|
|
6449
|
+
}
|
|
6450
|
+
|
|
6388
6451
|
// src/components/games/ui/FooterBar.tsx
|
|
6389
|
-
import { jsx as
|
|
6452
|
+
import { jsx as jsx68 } from "react/jsx-runtime";
|
|
6390
6453
|
function FooterBar({ children }) {
|
|
6391
|
-
return /* @__PURE__ */
|
|
6454
|
+
return /* @__PURE__ */ jsx68("div", { className: "ss-g-footer", children });
|
|
6392
6455
|
}
|
|
6393
6456
|
|
|
6394
6457
|
// src/components/games/ui/Silhouette.tsx
|
|
6395
|
-
import { jsx as
|
|
6458
|
+
import { jsx as jsx69, jsxs as jsxs60 } from "react/jsx-runtime";
|
|
6396
6459
|
function Silhouette({ size, variant = "default" }) {
|
|
6397
|
-
return /* @__PURE__ */
|
|
6398
|
-
/* @__PURE__ */
|
|
6399
|
-
/* @__PURE__ */
|
|
6400
|
-
/* @__PURE__ */
|
|
6460
|
+
return /* @__PURE__ */ jsxs60("span", { className: `ss-g-sil ss-g-sil--${variant}`, style: { width: size, height: size }, "aria-hidden": "true", children: [
|
|
6461
|
+
/* @__PURE__ */ jsxs60("svg", { width: size * 0.86, height: size * 0.86, viewBox: "0 0 100 100", children: [
|
|
6462
|
+
/* @__PURE__ */ jsx69("circle", { cx: "50", cy: "40", r: "19", fill: "currentColor" }),
|
|
6463
|
+
/* @__PURE__ */ jsx69("path", { d: "M12 100c0-23 17-38 38-38s38 15 38 38z", fill: "currentColor" })
|
|
6401
6464
|
] }),
|
|
6402
|
-
variant === "mystery" && /* @__PURE__ */
|
|
6465
|
+
variant === "mystery" && /* @__PURE__ */ jsx69("span", { className: "ss-g-sil-q", children: "?" })
|
|
6403
6466
|
] });
|
|
6404
6467
|
}
|
|
6405
6468
|
|
|
6406
6469
|
// src/components/games/ui/GameButton.tsx
|
|
6407
|
-
import { jsx as
|
|
6470
|
+
import { jsx as jsx70 } from "react/jsx-runtime";
|
|
6408
6471
|
function GameButton({ variant = "primary", block = false, className, type = "button", ...rest }) {
|
|
6409
6472
|
const cls = `ss-g-btn ss-g-btn--${variant}${block ? " ss-g-btn--block" : ""}${className ? ` ${className}` : ""}`;
|
|
6410
|
-
return /* @__PURE__ */
|
|
6473
|
+
return /* @__PURE__ */ jsx70("button", { type, className: cls, ...rest });
|
|
6411
6474
|
}
|
|
6412
6475
|
|
|
6413
6476
|
// src/components/games/ui/ResultCard.tsx
|
|
6414
|
-
import { jsx as
|
|
6477
|
+
import { jsx as jsx71, jsxs as jsxs61 } from "react/jsx-runtime";
|
|
6415
6478
|
function ResultCard({ tone, title, score, detail, onBack, ui }) {
|
|
6416
|
-
return /* @__PURE__ */
|
|
6417
|
-
/* @__PURE__ */
|
|
6418
|
-
score !== void 0 && /* @__PURE__ */
|
|
6419
|
-
/* @__PURE__ */
|
|
6479
|
+
return /* @__PURE__ */ jsxs61("div", { className: "ss-g-result", "data-tone": tone, role: "status", children: [
|
|
6480
|
+
/* @__PURE__ */ jsx71("span", { className: "ss-g-result-title", children: title }),
|
|
6481
|
+
score !== void 0 && /* @__PURE__ */ jsxs61("span", { className: "ss-g-result-score", children: [
|
|
6482
|
+
/* @__PURE__ */ jsx71("span", { className: "ss-g-result-num", children: score }),
|
|
6420
6483
|
ui.games.unitPts
|
|
6421
6484
|
] }),
|
|
6422
|
-
detail && /* @__PURE__ */
|
|
6423
|
-
onBack && /* @__PURE__ */
|
|
6485
|
+
detail && /* @__PURE__ */ jsx71("span", { className: "ss-g-result-detail", children: detail }),
|
|
6486
|
+
onBack && /* @__PURE__ */ jsx71(GameButton, { variant: "outline", onClick: onBack, children: ui.games.backToGames })
|
|
6424
6487
|
] });
|
|
6425
6488
|
}
|
|
6426
6489
|
|
|
6427
|
-
// src/components/games/ui/
|
|
6428
|
-
import { jsx as
|
|
6429
|
-
function
|
|
6430
|
-
|
|
6490
|
+
// src/components/games/ui/PointsLadderRow.tsx
|
|
6491
|
+
import { jsx as jsx72, jsxs as jsxs62 } from "react/jsx-runtime";
|
|
6492
|
+
function PointsLadderRow({ ladder, guessesUsed, ui }) {
|
|
6493
|
+
if (!ladder || ladder.length === 0) return null;
|
|
6494
|
+
const now = ladder[Math.min(guessesUsed, ladder.length - 1)];
|
|
6495
|
+
const next = ladder[guessesUsed + 1];
|
|
6496
|
+
if (now === void 0) return null;
|
|
6497
|
+
return /* @__PURE__ */ jsxs62("div", { className: "ss-g-worth", "data-testid": "points-ladder", children: [
|
|
6498
|
+
/* @__PURE__ */ jsx72("span", { className: "ss-g-worth-now", children: ui.games.worthNow(now) }),
|
|
6499
|
+
next !== void 0 && next !== now && /* @__PURE__ */ jsx72("span", { className: "ss-g-worth-next", children: ui.games.worthAfterMiss(next) })
|
|
6500
|
+
] });
|
|
6431
6501
|
}
|
|
6432
6502
|
|
|
6433
6503
|
// src/components/games/MysteryTigerGame.tsx
|
|
6434
|
-
import { Fragment as
|
|
6504
|
+
import { Fragment as Fragment12, jsx as jsx73, jsxs as jsxs63 } from "react/jsx-runtime";
|
|
6435
6505
|
function parseClientState(json) {
|
|
6436
6506
|
if (!json) return null;
|
|
6437
6507
|
try {
|
|
@@ -6545,9 +6615,7 @@ function MysteryTigerGame({
|
|
|
6545
6615
|
const totalGuesses = clientState ? clientState.guessesUsed + clientState.guessesRemaining : MAX_GUESSES;
|
|
6546
6616
|
const score = result?.score ?? 0;
|
|
6547
6617
|
const revealName = isOver ? clientState?.revealedPlayerName : void 0;
|
|
6548
|
-
const
|
|
6549
|
-
(p) => !alreadyGuessedIds.has(p.id) && p.name.toLowerCase().includes(query.toLowerCase())
|
|
6550
|
-
) : [];
|
|
6618
|
+
const pool = config && !isOver ? config.squadPlayers.filter((p) => !alreadyGuessedIds.has(p.id)) : [];
|
|
6551
6619
|
function handleSelect(playerId) {
|
|
6552
6620
|
if (!config || isOver || submitting) return;
|
|
6553
6621
|
const prevGuesses = guessResults.map((g) => g.playerId);
|
|
@@ -6555,22 +6623,22 @@ function MysteryTigerGame({
|
|
|
6555
6623
|
setQuery("");
|
|
6556
6624
|
onSubmit(JSON.stringify({ guesses: newGuesses }));
|
|
6557
6625
|
}
|
|
6558
|
-
const headerRight = !config ? void 0 : isOver ? /* @__PURE__ */
|
|
6626
|
+
const headerRight = !config ? void 0 : isOver ? /* @__PURE__ */ jsxs63(Chip, { variant: "accent", children: [
|
|
6559
6627
|
score,
|
|
6560
6628
|
" ",
|
|
6561
6629
|
ui.games.unitPts
|
|
6562
|
-
] }) : /* @__PURE__ */
|
|
6630
|
+
] }) : /* @__PURE__ */ jsx73("span", { "data-testid": "mt-chip", children: /* @__PURE__ */ jsxs63(Chip, { children: [
|
|
6563
6631
|
ui.games.guess,
|
|
6564
6632
|
" ",
|
|
6565
|
-
/* @__PURE__ */
|
|
6633
|
+
/* @__PURE__ */ jsx73("span", { className: "ss-g-num", children: guessesUsed + 1 }),
|
|
6566
6634
|
" / ",
|
|
6567
6635
|
totalGuesses
|
|
6568
6636
|
] }) });
|
|
6569
6637
|
const segments = Array.from({ length: totalGuesses }, (_, i) => i < guessesUsed ? "done" : i === guessesUsed ? "current" : "todo");
|
|
6570
6638
|
const cols = { gridTemplateColumns: `minmax(0, 1fr) repeat(${keys.length}, 42px)` };
|
|
6571
6639
|
const known = deriveKnownAttributes(guessResults, keys);
|
|
6572
|
-
return /* @__PURE__ */
|
|
6573
|
-
/* @__PURE__ */
|
|
6640
|
+
return /* @__PURE__ */ jsxs63("div", { className: "ss-g-screen ss-g-mt", "data-game": "mystery-tiger", "data-testid": "game-screen-mystery-tiger", children: [
|
|
6641
|
+
/* @__PURE__ */ jsx73(
|
|
6574
6642
|
GameHeader,
|
|
6575
6643
|
{
|
|
6576
6644
|
title: gameTitle({ gameId: "mystery-tiger" }, ui.games.titles),
|
|
@@ -6580,40 +6648,41 @@ function MysteryTigerGame({
|
|
|
6580
6648
|
backLabel: ui.back
|
|
6581
6649
|
}
|
|
6582
6650
|
),
|
|
6583
|
-
!config && /* @__PURE__ */
|
|
6584
|
-
config && /* @__PURE__ */
|
|
6585
|
-
/* @__PURE__ */
|
|
6586
|
-
/* @__PURE__ */
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
revealName
|
|
6651
|
+
!config && /* @__PURE__ */ jsx73("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading }),
|
|
6652
|
+
config && /* @__PURE__ */ jsxs63(Fragment12, { children: [
|
|
6653
|
+
/* @__PURE__ */ jsxs63("div", { className: "ss-g-body", children: [
|
|
6654
|
+
!isOver && /* @__PURE__ */ jsx73(PointsLadderRow, { ladder: config.pointsLadder, guessesUsed, ui }),
|
|
6655
|
+
/* @__PURE__ */ jsxs63("div", { className: `ss-g-mt-card${isOver ? " ss-g-mt-card--reveal" : ""}`, children: [
|
|
6656
|
+
/* @__PURE__ */ jsxs63("div", { className: "ss-g-mt-portrait", children: [
|
|
6657
|
+
revealName ? /* @__PURE__ */ jsx73(PlayerAvatar, { className: "ss-g-mt-photo", name: revealName, imagePath: clientState?.revealedPlayerImagePath }) : /* @__PURE__ */ jsx73(Silhouette, { size: 150, variant: "mystery" }),
|
|
6658
|
+
revealName && /* @__PURE__ */ jsx73("span", { className: "ss-g-mt-reveal-name", children: revealName })
|
|
6590
6659
|
] }),
|
|
6591
|
-
/* @__PURE__ */
|
|
6592
|
-
/* @__PURE__ */
|
|
6593
|
-
/* @__PURE__ */
|
|
6660
|
+
/* @__PURE__ */ jsx73("div", { className: "ss-g-mt-known", style: { gridTemplateColumns: `repeat(${keys.length}, minmax(0, 1fr))` }, children: known.map((k) => /* @__PURE__ */ jsxs63("div", { className: "ss-g-mt-known-cell", children: [
|
|
6661
|
+
/* @__PURE__ */ jsx73("span", { className: "ss-g-mt-lab", children: t.labels[k.key] }),
|
|
6662
|
+
/* @__PURE__ */ jsx73("span", { className: "ss-g-mt-known-v", "data-state": k.state, "data-testid": `known-${k.key}`, children: k.text })
|
|
6594
6663
|
] }, k.key)) })
|
|
6595
6664
|
] }),
|
|
6596
|
-
!isOver && /* @__PURE__ */
|
|
6597
|
-
guessResults.length > 0 && /* @__PURE__ */
|
|
6598
|
-
/* @__PURE__ */
|
|
6599
|
-
/* @__PURE__ */
|
|
6600
|
-
keys.map((k) => /* @__PURE__ */
|
|
6665
|
+
!isOver && /* @__PURE__ */ jsx73(SegmentProgress, { segments, ariaLabel: t.progress(guessesUsed, totalGuesses) }),
|
|
6666
|
+
guessResults.length > 0 && /* @__PURE__ */ jsxs63("div", { className: "ss-g-mt-table", children: [
|
|
6667
|
+
/* @__PURE__ */ jsxs63("div", { className: "ss-g-mt-thead", style: cols, children: [
|
|
6668
|
+
/* @__PURE__ */ jsx73("span", { children: t.yourGuesses }),
|
|
6669
|
+
keys.map((k) => /* @__PURE__ */ jsx73("span", { children: t.labels[k] }, k))
|
|
6601
6670
|
] }),
|
|
6602
6671
|
guessResults.map((gr, i) => {
|
|
6603
6672
|
const name = config.squadPlayers.find((p) => p.id === gr.playerId)?.name ?? `#${gr.playerId}`;
|
|
6604
6673
|
const { first, last } = splitName(name);
|
|
6605
|
-
return /* @__PURE__ */
|
|
6606
|
-
/* @__PURE__ */
|
|
6607
|
-
/* @__PURE__ */
|
|
6608
|
-
/* @__PURE__ */
|
|
6609
|
-
first && /* @__PURE__ */
|
|
6610
|
-
/* @__PURE__ */
|
|
6674
|
+
return /* @__PURE__ */ jsxs63("div", { className: "ss-g-mt-row", style: cols, children: [
|
|
6675
|
+
/* @__PURE__ */ jsxs63("div", { className: "ss-g-mt-who", children: [
|
|
6676
|
+
/* @__PURE__ */ jsx73(PlayerAvatar, { className: "ss-g-mt-av", name }),
|
|
6677
|
+
/* @__PURE__ */ jsxs63("span", { className: "ss-g-mt-names", children: [
|
|
6678
|
+
first && /* @__PURE__ */ jsx73("span", { className: "ss-g-mt-first", children: first }),
|
|
6679
|
+
/* @__PURE__ */ jsx73("span", { className: "ss-g-mt-last", children: last })
|
|
6611
6680
|
] })
|
|
6612
6681
|
] }),
|
|
6613
6682
|
keys.map((key) => {
|
|
6614
6683
|
const v = gr[key];
|
|
6615
6684
|
const arrow = directionArrow(v);
|
|
6616
|
-
return /* @__PURE__ */
|
|
6685
|
+
return /* @__PURE__ */ jsxs63(
|
|
6617
6686
|
"div",
|
|
6618
6687
|
{
|
|
6619
6688
|
className: "ss-g-mt-cell",
|
|
@@ -6621,8 +6690,8 @@ function MysteryTigerGame({
|
|
|
6621
6690
|
"data-verdict": v.verdict,
|
|
6622
6691
|
"aria-label": `${t.labels[key]}: ${v.value ?? v.verdict}${v.direction ? ` ${v.direction}` : ""}`,
|
|
6623
6692
|
children: [
|
|
6624
|
-
/* @__PURE__ */
|
|
6625
|
-
arrow && /* @__PURE__ */
|
|
6693
|
+
/* @__PURE__ */ jsx73("span", { className: "ss-g-mt-cell-v", "aria-hidden": "true", children: tileFace(key, v) }),
|
|
6694
|
+
arrow && /* @__PURE__ */ jsx73("span", { className: "ss-g-mt-cell-dir", "aria-hidden": "true", children: arrow })
|
|
6626
6695
|
]
|
|
6627
6696
|
},
|
|
6628
6697
|
key
|
|
@@ -6631,25 +6700,25 @@ function MysteryTigerGame({
|
|
|
6631
6700
|
] }, gr.playerId);
|
|
6632
6701
|
})
|
|
6633
6702
|
] }),
|
|
6634
|
-
!isOver && /* @__PURE__ */
|
|
6635
|
-
/* @__PURE__ */
|
|
6636
|
-
/* @__PURE__ */
|
|
6703
|
+
!isOver && /* @__PURE__ */ jsxs63("div", { className: "ss-g-mt-legend", children: [
|
|
6704
|
+
/* @__PURE__ */ jsxs63("span", { children: [
|
|
6705
|
+
/* @__PURE__ */ jsx73("i", { className: "ss-g-mt-sw", "data-verdict": "exact" }),
|
|
6637
6706
|
t.legendMatch
|
|
6638
6707
|
] }),
|
|
6639
|
-
/* @__PURE__ */
|
|
6640
|
-
/* @__PURE__ */
|
|
6708
|
+
/* @__PURE__ */ jsxs63("span", { children: [
|
|
6709
|
+
/* @__PURE__ */ jsx73("i", { className: "ss-g-mt-sw", "data-verdict": "near" }),
|
|
6641
6710
|
t.legendClose
|
|
6642
6711
|
] }),
|
|
6643
|
-
/* @__PURE__ */
|
|
6712
|
+
/* @__PURE__ */ jsxs63("span", { children: [
|
|
6644
6713
|
"\u25B2 ",
|
|
6645
6714
|
t.legendHigher
|
|
6646
6715
|
] })
|
|
6647
6716
|
] }),
|
|
6648
|
-
clientState?.hintLine && !isOver && /* @__PURE__ */
|
|
6649
|
-
/* @__PURE__ */
|
|
6650
|
-
/* @__PURE__ */
|
|
6717
|
+
clientState?.hintLine && !isOver && /* @__PURE__ */ jsxs63("div", { className: "ss-g-mt-hint", children: [
|
|
6718
|
+
/* @__PURE__ */ jsx73(IconBulb, {}),
|
|
6719
|
+
/* @__PURE__ */ jsx73("span", { children: clientState.hintLine })
|
|
6651
6720
|
] }),
|
|
6652
|
-
isOver && /* @__PURE__ */
|
|
6721
|
+
isOver && /* @__PURE__ */ jsx73(
|
|
6653
6722
|
ResultCard,
|
|
6654
6723
|
{
|
|
6655
6724
|
tone: clientState?.solved ? "win" : clientState?.failed ? "lose" : "neutral",
|
|
@@ -6661,39 +6730,26 @@ function MysteryTigerGame({
|
|
|
6661
6730
|
}
|
|
6662
6731
|
)
|
|
6663
6732
|
] }),
|
|
6664
|
-
!isOver && /* @__PURE__ */
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
),
|
|
6679
|
-
/* @__PURE__ */ jsx72(
|
|
6680
|
-
SearchField,
|
|
6681
|
-
{
|
|
6682
|
-
id: inputId,
|
|
6683
|
-
label: t.searchLabel,
|
|
6684
|
-
placeholder: t.searchPlaceholder,
|
|
6685
|
-
value: query,
|
|
6686
|
-
onChange: setQuery,
|
|
6687
|
-
disabled: submitting
|
|
6688
|
-
}
|
|
6689
|
-
)
|
|
6690
|
-
] })
|
|
6733
|
+
!isOver && /* @__PURE__ */ jsx73(FooterBar, { children: /* @__PURE__ */ jsx73(
|
|
6734
|
+
AnswerTray,
|
|
6735
|
+
{
|
|
6736
|
+
id: inputId,
|
|
6737
|
+
label: t.searchLabel,
|
|
6738
|
+
placeholder: t.searchPlaceholder,
|
|
6739
|
+
optionsLabel: t.optionsLabel,
|
|
6740
|
+
options: pool,
|
|
6741
|
+
query,
|
|
6742
|
+
onQuery: setQuery,
|
|
6743
|
+
onPick: handleSelect,
|
|
6744
|
+
disabled: submitting
|
|
6745
|
+
}
|
|
6746
|
+
) })
|
|
6691
6747
|
] })
|
|
6692
6748
|
] });
|
|
6693
6749
|
}
|
|
6694
6750
|
|
|
6695
6751
|
// src/components/games/HigherOrLowerGame.tsx
|
|
6696
|
-
import { Fragment as
|
|
6752
|
+
import { Fragment as Fragment13, jsx as jsx74, jsxs as jsxs64 } from "react/jsx-runtime";
|
|
6697
6753
|
var POINTS_PER_CORRECT = 10;
|
|
6698
6754
|
function parseClientState2(json) {
|
|
6699
6755
|
if (!json) return null;
|
|
@@ -6705,11 +6761,11 @@ function parseClientState2(json) {
|
|
|
6705
6761
|
}
|
|
6706
6762
|
function PlayerCard({ name, imagePath, highlight, children }) {
|
|
6707
6763
|
const { first, last } = splitName(name);
|
|
6708
|
-
return /* @__PURE__ */
|
|
6709
|
-
/* @__PURE__ */
|
|
6710
|
-
/* @__PURE__ */
|
|
6711
|
-
first && /* @__PURE__ */
|
|
6712
|
-
/* @__PURE__ */
|
|
6764
|
+
return /* @__PURE__ */ jsxs64("div", { className: `ss-g-hl-card${highlight ? " ss-g-hl-card--b" : ""}`, children: [
|
|
6765
|
+
/* @__PURE__ */ jsx74("div", { className: "ss-g-hl-photo-wrap", children: imagePath ? /* @__PURE__ */ jsx74(PlayerAvatar, { className: "ss-g-hl-photo", name, imagePath }) : /* @__PURE__ */ jsx74(Silhouette, { size: 150 }) }),
|
|
6766
|
+
/* @__PURE__ */ jsxs64("div", { className: "ss-g-hl-info", children: [
|
|
6767
|
+
first && /* @__PURE__ */ jsx74("span", { className: "ss-g-hl-first", children: first }),
|
|
6768
|
+
/* @__PURE__ */ jsx74("span", { className: "ss-g-hl-surname", children: last }),
|
|
6713
6769
|
children
|
|
6714
6770
|
] })
|
|
6715
6771
|
] });
|
|
@@ -6741,47 +6797,47 @@ function HigherOrLowerGame({
|
|
|
6741
6797
|
const newAnswers = [...prevAnswers, { pairIndex: currentPair.pairIndex, pick }];
|
|
6742
6798
|
onSubmit(JSON.stringify({ answers: newAnswers }));
|
|
6743
6799
|
}
|
|
6744
|
-
return /* @__PURE__ */
|
|
6745
|
-
/* @__PURE__ */
|
|
6800
|
+
return /* @__PURE__ */ jsxs64("div", { className: "ss-g-screen ss-g-hl", "data-game": "higher-or-lower", "data-testid": "game-screen-higher-or-lower", children: [
|
|
6801
|
+
/* @__PURE__ */ jsx74(
|
|
6746
6802
|
GameHeader,
|
|
6747
6803
|
{
|
|
6748
6804
|
title: gameTitle({ gameId: "higher-or-lower" }, ui.games.titles),
|
|
6749
6805
|
eyebrow: t.eyebrow(POINTS_PER_CORRECT),
|
|
6750
|
-
right: config ? /* @__PURE__ */
|
|
6806
|
+
right: config ? /* @__PURE__ */ jsx74(StatStack, { value: runLength, label: t.streak }) : void 0,
|
|
6751
6807
|
onBack,
|
|
6752
6808
|
backLabel: ui.back
|
|
6753
6809
|
}
|
|
6754
6810
|
),
|
|
6755
|
-
!config && /* @__PURE__ */
|
|
6756
|
-
config && /* @__PURE__ */
|
|
6757
|
-
/* @__PURE__ */
|
|
6758
|
-
/* @__PURE__ */
|
|
6759
|
-
/* @__PURE__ */
|
|
6760
|
-
/* @__PURE__ */
|
|
6761
|
-
/* @__PURE__ */
|
|
6811
|
+
!config && /* @__PURE__ */ jsx74("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading }),
|
|
6812
|
+
config && /* @__PURE__ */ jsxs64(Fragment13, { children: [
|
|
6813
|
+
/* @__PURE__ */ jsxs64("div", { className: "ss-g-body", children: [
|
|
6814
|
+
/* @__PURE__ */ jsxs64("div", { className: "ss-g-hl-prompt", "data-testid": "hol-prompt", children: [
|
|
6815
|
+
/* @__PURE__ */ jsx74("span", { className: "ss-g-hl-prompt-q", children: t.whoHadMore }),
|
|
6816
|
+
/* @__PURE__ */ jsx74("span", { className: "ss-g-hl-prompt-stat", children: config.statLabel }),
|
|
6817
|
+
/* @__PURE__ */ jsx74("span", { className: "ss-g-hl-prompt-season", children: t.season(config.seasonLabel) })
|
|
6762
6818
|
] }),
|
|
6763
|
-
currentPair && /* @__PURE__ */
|
|
6764
|
-
/* @__PURE__ */
|
|
6765
|
-
/* @__PURE__ */
|
|
6766
|
-
/* @__PURE__ */
|
|
6819
|
+
currentPair && /* @__PURE__ */ jsxs64("div", { className: "ss-g-hl-pair", children: [
|
|
6820
|
+
/* @__PURE__ */ jsxs64(PlayerCard, { name: currentPair.playerAName, imagePath: currentPair.playerAImagePath, children: [
|
|
6821
|
+
/* @__PURE__ */ jsx74("span", { className: "ss-g-hl-value", children: currentPair.playerAValue }),
|
|
6822
|
+
/* @__PURE__ */ jsx74("span", { className: "ss-g-hl-stat", children: config.statLabel })
|
|
6767
6823
|
] }),
|
|
6768
|
-
/* @__PURE__ */
|
|
6769
|
-
/* @__PURE__ */
|
|
6770
|
-
/* @__PURE__ */
|
|
6771
|
-
/* @__PURE__ */
|
|
6824
|
+
/* @__PURE__ */ jsx74("span", { className: "ss-g-hl-vs", "aria-hidden": "true", children: t.vs }),
|
|
6825
|
+
/* @__PURE__ */ jsx74(PlayerCard, { name: currentPair.playerBName, imagePath: currentPair.playerBImagePath, highlight: true, children: /* @__PURE__ */ jsxs64("div", { className: "ss-g-hl-btns", children: [
|
|
6826
|
+
/* @__PURE__ */ jsxs64(GameButton, { variant: "primary", disabled: submitting, onClick: () => handlePick("higher"), children: [
|
|
6827
|
+
/* @__PURE__ */ jsx74(IconArrowUp, { size: 16 }),
|
|
6772
6828
|
t.higher
|
|
6773
6829
|
] }),
|
|
6774
|
-
/* @__PURE__ */
|
|
6775
|
-
/* @__PURE__ */
|
|
6830
|
+
/* @__PURE__ */ jsxs64(GameButton, { variant: "outline", disabled: submitting, onClick: () => handlePick("lower"), children: [
|
|
6831
|
+
/* @__PURE__ */ jsx74(IconArrowDown, { size: 16 }),
|
|
6776
6832
|
t.lower
|
|
6777
6833
|
] })
|
|
6778
6834
|
] }) })
|
|
6779
6835
|
] }),
|
|
6780
|
-
lastAnswer && lastAnswerPair && /* @__PURE__ */
|
|
6781
|
-
lastAnswer.wasCorrect ? /* @__PURE__ */
|
|
6836
|
+
lastAnswer && lastAnswerPair && /* @__PURE__ */ jsxs64("p", { className: "ss-g-hl-feedback", "data-testid": "hol-last", "data-correct": lastAnswer.wasCorrect ? "true" : "false", children: [
|
|
6837
|
+
lastAnswer.wasCorrect ? /* @__PURE__ */ jsx74(IconCheck, {}) : /* @__PURE__ */ jsx74(IconClose, {}),
|
|
6782
6838
|
t.lastAnswer(splitName(lastAnswerPair.playerBName).last, lastAnswer.playerBValue)
|
|
6783
6839
|
] }),
|
|
6784
|
-
isOver && /* @__PURE__ */
|
|
6840
|
+
isOver && /* @__PURE__ */ jsx74(
|
|
6785
6841
|
ResultCard,
|
|
6786
6842
|
{
|
|
6787
6843
|
tone: runEndedWrong ? "lose" : allPairsAnswered ? "win" : "neutral",
|
|
@@ -6793,15 +6849,15 @@ function HigherOrLowerGame({
|
|
|
6793
6849
|
}
|
|
6794
6850
|
)
|
|
6795
6851
|
] }),
|
|
6796
|
-
!isOver && /* @__PURE__ */
|
|
6797
|
-
/* @__PURE__ */
|
|
6852
|
+
!isOver && /* @__PURE__ */ jsx74(FooterBar, { children: /* @__PURE__ */ jsxs64("div", { className: "ss-g-hl-foot", children: [
|
|
6853
|
+
/* @__PURE__ */ jsx74("div", { className: "ss-g-hl-dots", role: "img", "aria-label": t.answersSoFar(answeredCount, config.pairs.length), children: config.pairs.map((p, i) => {
|
|
6798
6854
|
const a = answeredPairs[i];
|
|
6799
|
-
return /* @__PURE__ */
|
|
6855
|
+
return /* @__PURE__ */ jsx74("span", { className: "ss-g-hl-dot", "data-state": a ? a.wasCorrect ? "correct" : "wrong" : "todo" }, p.pairIndex);
|
|
6800
6856
|
}) }),
|
|
6801
|
-
/* @__PURE__ */
|
|
6802
|
-
/* @__PURE__ */
|
|
6857
|
+
/* @__PURE__ */ jsxs64("span", { className: "ss-g-hl-pts", children: [
|
|
6858
|
+
/* @__PURE__ */ jsx74("span", { "data-testid": "hol-score", children: score }),
|
|
6803
6859
|
" ",
|
|
6804
|
-
/* @__PURE__ */
|
|
6860
|
+
/* @__PURE__ */ jsx74("span", { className: "ss-g-hl-pts-unit", children: ui.games.unitPts })
|
|
6805
6861
|
] })
|
|
6806
6862
|
] }) })
|
|
6807
6863
|
] })
|
|
@@ -6813,17 +6869,17 @@ import { useState as useState31, useId as useId3 } from "react";
|
|
|
6813
6869
|
|
|
6814
6870
|
// src/components/games/ui/CrestShield.tsx
|
|
6815
6871
|
import { useState as useState30 } from "react";
|
|
6816
|
-
import { jsx as
|
|
6872
|
+
import { jsx as jsx75 } from "react/jsx-runtime";
|
|
6817
6873
|
function CrestShield({ src, name, size = 28 }) {
|
|
6818
6874
|
const [failed, setFailed] = useState30(false);
|
|
6819
6875
|
if (src && !isPlaceholderImage(src) && !failed) {
|
|
6820
|
-
return /* @__PURE__ */
|
|
6876
|
+
return /* @__PURE__ */ jsx75("img", { className: "ss-g-crest", src, alt: name, width: size, height: size, loading: "lazy", onError: () => setFailed(true) });
|
|
6821
6877
|
}
|
|
6822
|
-
return /* @__PURE__ */
|
|
6878
|
+
return /* @__PURE__ */ jsx75("svg", { className: "ss-g-crest ss-g-crest--ph", width: size, height: size * 32 / 28, viewBox: "0 0 28 32", role: "img", "aria-label": name, children: /* @__PURE__ */ jsx75("path", { d: "M2 3h24v12c0 9-6 14-12 17C8 29 2 24 2 15z", fill: "currentColor" }) });
|
|
6823
6879
|
}
|
|
6824
6880
|
|
|
6825
6881
|
// src/components/games/CareerPathGame.tsx
|
|
6826
|
-
import { Fragment as
|
|
6882
|
+
import { Fragment as Fragment14, jsx as jsx76, jsxs as jsxs65 } from "react/jsx-runtime";
|
|
6827
6883
|
function parseClientState3(json) {
|
|
6828
6884
|
if (!json) return null;
|
|
6829
6885
|
try {
|
|
@@ -6853,17 +6909,15 @@ function CareerPathGame({
|
|
|
6853
6909
|
const alreadyGuessedIds = new Set(clientState?.guessResults.map((g) => g.playerId) ?? []);
|
|
6854
6910
|
const isOver = result?.alreadyPlayed === true || clientState?.solved === true || clientState?.failed === true;
|
|
6855
6911
|
if (!config) {
|
|
6856
|
-
return /* @__PURE__ */
|
|
6857
|
-
/* @__PURE__ */
|
|
6858
|
-
/* @__PURE__ */
|
|
6912
|
+
return /* @__PURE__ */ jsxs65("div", { className: "ss-g-screen", "data-game": "career-path", "data-testid": "game-screen-career-path", children: [
|
|
6913
|
+
/* @__PURE__ */ jsx76(GameHeader, { title, eyebrow: s.eyebrow, onBack, backLabel: ui.back }),
|
|
6914
|
+
/* @__PURE__ */ jsx76("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
6859
6915
|
] });
|
|
6860
6916
|
}
|
|
6861
6917
|
const visiblePath = clientState?.visiblePath ?? config.initialPath;
|
|
6862
6918
|
const totalClubs = clientState?.totalClubs ?? config.totalClubs;
|
|
6863
6919
|
const hidden = isOver ? 0 : Math.max(0, totalClubs - visiblePath.length);
|
|
6864
|
-
const
|
|
6865
|
-
(p) => !alreadyGuessedIds.has(p.id) && p.name.toLowerCase().includes(query.toLowerCase())
|
|
6866
|
-
) : [];
|
|
6920
|
+
const pool = !isOver ? config.typeaheadPool.filter((p) => !alreadyGuessedIds.has(p.id)) : [];
|
|
6867
6921
|
function handleSelect(playerId) {
|
|
6868
6922
|
if (!config || isOver || submitting) return;
|
|
6869
6923
|
const prevGuesses = clientState?.guessResults.map((g) => g.playerId) ?? [];
|
|
@@ -6871,60 +6925,61 @@ function CareerPathGame({
|
|
|
6871
6925
|
setQuery("");
|
|
6872
6926
|
onSubmit(JSON.stringify({ guesses: newGuesses }));
|
|
6873
6927
|
}
|
|
6874
|
-
const right = !isOver && clientState ? /* @__PURE__ */
|
|
6928
|
+
const right = !isOver && clientState ? /* @__PURE__ */ jsx76("span", { "data-testid": "cp-guess-chip", children: /* @__PURE__ */ jsxs65(Chip, { variant: "neutral", children: [
|
|
6875
6929
|
ui.games.guess,
|
|
6876
6930
|
" ",
|
|
6877
|
-
/* @__PURE__ */
|
|
6931
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-num", children: clientState.guessesUsed + 1 }),
|
|
6878
6932
|
" / ",
|
|
6879
6933
|
clientState.guessesUsed + clientState.guessesRemaining
|
|
6880
6934
|
] }) }) : void 0;
|
|
6881
6935
|
const outcome = clientState?.solved ? s.solved : clientState?.failed ? s.failed : ui.games.done;
|
|
6882
|
-
return /* @__PURE__ */
|
|
6883
|
-
/* @__PURE__ */
|
|
6884
|
-
/* @__PURE__ */
|
|
6885
|
-
/* @__PURE__ */
|
|
6886
|
-
|
|
6887
|
-
/* @__PURE__ */
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
/* @__PURE__ */
|
|
6936
|
+
return /* @__PURE__ */ jsxs65("div", { className: "ss-g-screen", "data-game": "career-path", "data-testid": "game-screen-career-path", children: [
|
|
6937
|
+
/* @__PURE__ */ jsx76(GameHeader, { title, eyebrow: s.eyebrow, right, onBack, backLabel: ui.back }),
|
|
6938
|
+
/* @__PURE__ */ jsxs65("div", { className: "ss-g-body", children: [
|
|
6939
|
+
!isOver && /* @__PURE__ */ jsx76(PointsLadderRow, { ladder: config.pointsLadder, guessesUsed: clientState?.guessesUsed ?? 0, ui }),
|
|
6940
|
+
/* @__PURE__ */ jsxs65("div", { className: "ss-g-cp-card", children: [
|
|
6941
|
+
isOver && clientState?.revealedPlayerName ? /* @__PURE__ */ jsx76(PlayerAvatar, { className: "ss-g-cp-photo", name: clientState.revealedPlayerName, imagePath: clientState.revealedPlayerImagePath }) : /* @__PURE__ */ jsx76(Silhouette, { size: 64, variant: isOver ? "default" : "mystery" }),
|
|
6942
|
+
/* @__PURE__ */ jsxs65("div", { className: "ss-g-cp-card-text", children: [
|
|
6943
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-cp-card-title", children: isOver && clientState?.revealedPlayerName ? clientState.revealedPlayerName : s.mysteryPlayer }),
|
|
6944
|
+
clientState?.hintLine ? /* @__PURE__ */ jsx76("span", { className: "ss-g-cp-hint", children: clientState.hintLine }) : !isOver ? /* @__PURE__ */ jsxs65("span", { className: "ss-g-cp-locks", children: [
|
|
6945
|
+
/* @__PURE__ */ jsx76(Chip, { variant: "lock", icon: /* @__PURE__ */ jsx76(IconLock, { size: 11 }), children: s.lockPosition }),
|
|
6946
|
+
/* @__PURE__ */ jsx76(Chip, { variant: "lock", icon: /* @__PURE__ */ jsx76(IconLock, { size: 11 }), children: s.lockNationality })
|
|
6892
6947
|
] }) : null
|
|
6893
6948
|
] })
|
|
6894
6949
|
] }),
|
|
6895
|
-
/* @__PURE__ */
|
|
6950
|
+
/* @__PURE__ */ jsxs65("ol", { className: "ss-g-cp-line", children: [
|
|
6896
6951
|
visiblePath.map((spell, i) => {
|
|
6897
6952
|
const years = i === 0 ? s.firstClub : spellYears(spell);
|
|
6898
|
-
return /* @__PURE__ */
|
|
6899
|
-
/* @__PURE__ */
|
|
6900
|
-
/* @__PURE__ */
|
|
6901
|
-
/* @__PURE__ */
|
|
6953
|
+
return /* @__PURE__ */ jsxs65("li", { className: "ss-g-cp-step", children: [
|
|
6954
|
+
/* @__PURE__ */ jsxs65("span", { className: "ss-g-cp-rail", children: [
|
|
6955
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-cp-tile", children: /* @__PURE__ */ jsx76(CrestShield, { src: spell.crestUrl, name: spell.clubName, size: 30 }) }),
|
|
6956
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-cp-conn", "aria-hidden": "true" })
|
|
6902
6957
|
] }),
|
|
6903
|
-
/* @__PURE__ */
|
|
6904
|
-
/* @__PURE__ */
|
|
6905
|
-
/* @__PURE__ */
|
|
6906
|
-
/* @__PURE__ */
|
|
6907
|
-
spell.isLoan && /* @__PURE__ */
|
|
6958
|
+
/* @__PURE__ */ jsxs65("span", { className: "ss-g-cp-step-text", children: [
|
|
6959
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-cp-club", children: spell.clubName }),
|
|
6960
|
+
/* @__PURE__ */ jsxs65("span", { className: "ss-g-cp-sub", children: [
|
|
6961
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-cp-years", children: years }),
|
|
6962
|
+
spell.isLoan && /* @__PURE__ */ jsxs65(Fragment14, { children: [
|
|
6908
6963
|
years ? " \xB7 " : "",
|
|
6909
|
-
/* @__PURE__ */
|
|
6964
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-cp-loan", children: s.loan })
|
|
6910
6965
|
] })
|
|
6911
6966
|
] })
|
|
6912
6967
|
] })
|
|
6913
6968
|
] }, `${spell.clubName}-${i}`);
|
|
6914
6969
|
}),
|
|
6915
|
-
hidden > 0 && /* @__PURE__ */
|
|
6916
|
-
/* @__PURE__ */
|
|
6917
|
-
/* @__PURE__ */
|
|
6918
|
-
hidden > 1 && /* @__PURE__ */
|
|
6970
|
+
hidden > 0 && /* @__PURE__ */ jsxs65("li", { className: "ss-g-cp-step ss-g-cp-step--hidden", children: [
|
|
6971
|
+
/* @__PURE__ */ jsxs65("span", { className: "ss-g-cp-rail", children: [
|
|
6972
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-cp-tile ss-g-cp-tile--locked", children: /* @__PURE__ */ jsx76(IconLock, { size: 18 }) }),
|
|
6973
|
+
hidden > 1 && /* @__PURE__ */ jsx76("span", { className: "ss-g-cp-conn ss-g-cp-conn--faint", "aria-hidden": "true" })
|
|
6919
6974
|
] }),
|
|
6920
|
-
/* @__PURE__ */
|
|
6975
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-cp-step-text", children: /* @__PURE__ */ jsx76("span", { className: "ss-g-cp-sub", children: s.nextClubHidden }) })
|
|
6921
6976
|
] }),
|
|
6922
|
-
hidden > 1 && /* @__PURE__ */
|
|
6923
|
-
/* @__PURE__ */
|
|
6924
|
-
/* @__PURE__ */
|
|
6977
|
+
hidden > 1 && /* @__PURE__ */ jsxs65("li", { className: "ss-g-cp-step ss-g-cp-step--more", children: [
|
|
6978
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-cp-rail", children: /* @__PURE__ */ jsx76("span", { className: "ss-g-cp-tile ss-g-cp-tile--faint", children: /* @__PURE__ */ jsx76(IconLock, { size: 18 }) }) }),
|
|
6979
|
+
/* @__PURE__ */ jsx76("span", { className: "ss-g-cp-step-text", children: /* @__PURE__ */ jsx76("span", { className: "ss-g-cp-sub", children: s.moreClubs(hidden - 1) }) })
|
|
6925
6980
|
] })
|
|
6926
6981
|
] }),
|
|
6927
|
-
isOver && /* @__PURE__ */
|
|
6982
|
+
isOver && /* @__PURE__ */ jsx76(
|
|
6928
6983
|
ResultCard,
|
|
6929
6984
|
{
|
|
6930
6985
|
tone: clientState?.solved ? "win" : clientState?.failed ? "lose" : "neutral",
|
|
@@ -6936,39 +6991,35 @@ function CareerPathGame({
|
|
|
6936
6991
|
}
|
|
6937
6992
|
)
|
|
6938
6993
|
] }),
|
|
6939
|
-
!isOver && /* @__PURE__ */
|
|
6940
|
-
|
|
6941
|
-
|
|
6942
|
-
|
|
6943
|
-
|
|
6944
|
-
|
|
6945
|
-
|
|
6946
|
-
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
6950
|
-
|
|
6951
|
-
|
|
6952
|
-
|
|
6953
|
-
|
|
6954
|
-
/* @__PURE__ */ jsx75(
|
|
6955
|
-
SearchField,
|
|
6956
|
-
{
|
|
6957
|
-
id: inputId,
|
|
6958
|
-
label: s.searchLabel,
|
|
6959
|
-
placeholder: s.searchPlaceholder,
|
|
6960
|
-
value: query,
|
|
6961
|
-
onChange: setQuery,
|
|
6962
|
-
disabled: submitting
|
|
6963
|
-
}
|
|
6964
|
-
)
|
|
6965
|
-
] })
|
|
6994
|
+
!isOver && /* @__PURE__ */ jsx76(FooterBar, { children: /* @__PURE__ */ jsx76(
|
|
6995
|
+
AnswerTray,
|
|
6996
|
+
{
|
|
6997
|
+
id: inputId,
|
|
6998
|
+
label: s.searchLabel,
|
|
6999
|
+
placeholder: s.searchPlaceholder,
|
|
7000
|
+
optionsLabel: s.searchLabel,
|
|
7001
|
+
options: pool,
|
|
7002
|
+
query,
|
|
7003
|
+
onQuery: setQuery,
|
|
7004
|
+
onPick: handleSelect,
|
|
7005
|
+
disabled: submitting,
|
|
7006
|
+
minQuery: 1
|
|
7007
|
+
}
|
|
7008
|
+
) })
|
|
6966
7009
|
] });
|
|
6967
7010
|
}
|
|
6968
7011
|
|
|
6969
7012
|
// src/components/games/BeatTheGridGame.tsx
|
|
6970
|
-
import React, { useEffect as
|
|
6971
|
-
|
|
7013
|
+
import React, { useEffect as useEffect21, useId as useId4, useRef as useRef18, useState as useState32 } from "react";
|
|
7014
|
+
|
|
7015
|
+
// src/components/games/ui/OptionList.tsx
|
|
7016
|
+
import { jsx as jsx77 } from "react/jsx-runtime";
|
|
7017
|
+
function OptionList({ label, options, onPick }) {
|
|
7018
|
+
return /* @__PURE__ */ jsx77("div", { className: "ss-g-opts", role: "listbox", "aria-label": label, children: options.map((o) => /* @__PURE__ */ jsx77("button", { type: "button", role: "option", "aria-selected": false, className: "ss-g-opt", onClick: () => onPick(o.key), children: o.content }, o.key)) });
|
|
7019
|
+
}
|
|
7020
|
+
|
|
7021
|
+
// src/components/games/BeatTheGridGame.tsx
|
|
7022
|
+
import { Fragment as Fragment15, jsx as jsx78, jsxs as jsxs66 } from "react/jsx-runtime";
|
|
6972
7023
|
function criterionIconKind(label, key) {
|
|
6973
7024
|
const l = (key ?? label).toLowerCase();
|
|
6974
7025
|
if (l.includes("app")) return "calendar";
|
|
@@ -6986,34 +7037,34 @@ function rowAbbrev(label, map, key) {
|
|
|
6986
7037
|
function CriterionIcon({ kind }) {
|
|
6987
7038
|
switch (kind) {
|
|
6988
7039
|
case "calendar":
|
|
6989
|
-
return /* @__PURE__ */
|
|
7040
|
+
return /* @__PURE__ */ jsx78(IconCalendar, {});
|
|
6990
7041
|
case "ball":
|
|
6991
|
-
return /* @__PURE__ */
|
|
7042
|
+
return /* @__PURE__ */ jsx78(IconBall, {});
|
|
6992
7043
|
case "boot":
|
|
6993
|
-
return /* @__PURE__ */
|
|
7044
|
+
return /* @__PURE__ */ jsx78(IconBoot, {});
|
|
6994
7045
|
case "gloves":
|
|
6995
|
-
return /* @__PURE__ */
|
|
7046
|
+
return /* @__PURE__ */ jsx78(IconGloves, {});
|
|
6996
7047
|
case "shield":
|
|
6997
|
-
return /* @__PURE__ */
|
|
7048
|
+
return /* @__PURE__ */ jsx78(IconShield, {});
|
|
6998
7049
|
default:
|
|
6999
|
-
return /* @__PURE__ */
|
|
7050
|
+
return /* @__PURE__ */ jsx78(IconFlag, {});
|
|
7000
7051
|
}
|
|
7001
7052
|
}
|
|
7002
7053
|
function HeaderVisual({ label, textKey: iKey, meta }) {
|
|
7003
7054
|
if (!meta) {
|
|
7004
|
-
return /* @__PURE__ */
|
|
7055
|
+
return /* @__PURE__ */ jsx78(CriterionIcon, { kind: criterionIconKind(label, iKey) });
|
|
7005
7056
|
}
|
|
7006
7057
|
switch (meta.kind) {
|
|
7007
7058
|
case "club":
|
|
7008
|
-
return /* @__PURE__ */
|
|
7059
|
+
return /* @__PURE__ */ jsx78(CrestShield, { src: meta.imageUrl, name: label, size: 24 });
|
|
7009
7060
|
case "coach":
|
|
7010
|
-
return /* @__PURE__ */
|
|
7061
|
+
return /* @__PURE__ */ jsx78(PlayerAvatar, { name: label, imagePath: meta.imageUrl, className: "ss-g-btg-coach-av" });
|
|
7011
7062
|
case "country":
|
|
7012
|
-
return /* @__PURE__ */
|
|
7063
|
+
return /* @__PURE__ */ jsx78("span", { className: "ss-g-btg-hdr-flag", "aria-hidden": "true", children: nationalityFlag(meta.country ?? label) });
|
|
7013
7064
|
case "position":
|
|
7014
|
-
return /* @__PURE__ */
|
|
7065
|
+
return /* @__PURE__ */ jsx78(Fragment15, {});
|
|
7015
7066
|
default:
|
|
7016
|
-
return /* @__PURE__ */
|
|
7067
|
+
return /* @__PURE__ */ jsx78(CriterionIcon, { kind: criterionIconKind(label, iKey) });
|
|
7017
7068
|
}
|
|
7018
7069
|
}
|
|
7019
7070
|
function parseClientState4(json) {
|
|
@@ -7050,19 +7101,19 @@ function SearchSheet({
|
|
|
7050
7101
|
const s = ui.games.beatTheGrid;
|
|
7051
7102
|
const [query, setQuery] = useState32("");
|
|
7052
7103
|
const inputId = useId4();
|
|
7053
|
-
const inputRef =
|
|
7054
|
-
|
|
7104
|
+
const inputRef = useRef18(null);
|
|
7105
|
+
useEffect21(() => {
|
|
7055
7106
|
inputRef.current?.focus();
|
|
7056
7107
|
}, [row, col]);
|
|
7057
7108
|
const filtered = playerPool.filter(
|
|
7058
7109
|
(p) => !alreadyFilledIds.has(p.id) && p.name.toLowerCase().includes(query.toLowerCase())
|
|
7059
7110
|
);
|
|
7060
|
-
return /* @__PURE__ */
|
|
7061
|
-
/* @__PURE__ */
|
|
7062
|
-
/* @__PURE__ */
|
|
7063
|
-
/* @__PURE__ */
|
|
7064
|
-
/* @__PURE__ */
|
|
7065
|
-
/* @__PURE__ */
|
|
7111
|
+
return /* @__PURE__ */ jsxs66("div", { className: "ss-g-btg-sheet", "data-testid": "btg-search-sheet", children: [
|
|
7112
|
+
/* @__PURE__ */ jsxs66("div", { className: "ss-g-btg-sheet-hdr", children: [
|
|
7113
|
+
/* @__PURE__ */ jsx78(Chip, { variant: "neutral", children: rowLabel }),
|
|
7114
|
+
/* @__PURE__ */ jsx78("span", { className: "ss-g-btg-sheet-x", "aria-hidden": "true", children: /* @__PURE__ */ jsx78(IconClose, { size: 12 }) }),
|
|
7115
|
+
/* @__PURE__ */ jsx78(Chip, { variant: "accent", children: colLabel }),
|
|
7116
|
+
/* @__PURE__ */ jsx78(
|
|
7066
7117
|
"button",
|
|
7067
7118
|
{
|
|
7068
7119
|
type: "button",
|
|
@@ -7070,12 +7121,12 @@ function SearchSheet({
|
|
|
7070
7121
|
"data-testid": "btg-sheet-dismiss",
|
|
7071
7122
|
"aria-label": s.closeSearch,
|
|
7072
7123
|
onClick: onDismiss,
|
|
7073
|
-
children: /* @__PURE__ */
|
|
7124
|
+
children: /* @__PURE__ */ jsx78(IconClose, {})
|
|
7074
7125
|
}
|
|
7075
7126
|
)
|
|
7076
7127
|
] }),
|
|
7077
|
-
playerPool.length === 0 ? /* @__PURE__ */
|
|
7078
|
-
/* @__PURE__ */
|
|
7128
|
+
playerPool.length === 0 ? /* @__PURE__ */ jsx78("div", { className: "ss-g-btg-sheet-empty", children: s.emptyPool }) : /* @__PURE__ */ jsxs66(Fragment15, { children: [
|
|
7129
|
+
/* @__PURE__ */ jsx78(
|
|
7079
7130
|
SearchField,
|
|
7080
7131
|
{
|
|
7081
7132
|
id: inputId,
|
|
@@ -7087,16 +7138,16 @@ function SearchSheet({
|
|
|
7087
7138
|
inputRef
|
|
7088
7139
|
}
|
|
7089
7140
|
),
|
|
7090
|
-
query.length > 0 && filtered.length > 0 && /* @__PURE__ */
|
|
7141
|
+
query.length > 0 && filtered.length > 0 && /* @__PURE__ */ jsx78(
|
|
7091
7142
|
OptionList,
|
|
7092
7143
|
{
|
|
7093
7144
|
label: s.searchLabel(rowLabel, colLabel),
|
|
7094
7145
|
options: filtered.map((p) => ({
|
|
7095
7146
|
key: p.id,
|
|
7096
|
-
content: /* @__PURE__ */
|
|
7097
|
-
/* @__PURE__ */
|
|
7098
|
-
/* @__PURE__ */
|
|
7099
|
-
/* @__PURE__ */
|
|
7147
|
+
content: /* @__PURE__ */ jsxs66(Fragment15, { children: [
|
|
7148
|
+
/* @__PURE__ */ jsx78(PlayerAvatar, { name: p.name, imagePath: p.imagePath, className: "ss-g-opt-av" }),
|
|
7149
|
+
/* @__PURE__ */ jsx78("span", { className: "ss-g-btg-result-name", children: p.name }),
|
|
7150
|
+
/* @__PURE__ */ jsx78("span", { className: "ss-g-btg-result-plus", "aria-hidden": "true", children: /* @__PURE__ */ jsx78(IconPlus, { size: 18 }) })
|
|
7100
7151
|
] })
|
|
7101
7152
|
})),
|
|
7102
7153
|
onPick: (k) => onPick(row, col, Number(k))
|
|
@@ -7134,9 +7185,9 @@ function BeatTheGridGame({
|
|
|
7134
7185
|
onSubmit(JSON.stringify({ cells: newCells }));
|
|
7135
7186
|
}
|
|
7136
7187
|
if (!config) {
|
|
7137
|
-
return /* @__PURE__ */
|
|
7138
|
-
/* @__PURE__ */
|
|
7139
|
-
/* @__PURE__ */
|
|
7188
|
+
return /* @__PURE__ */ jsxs66("div", { className: "ss-g-screen", "data-game": "beat-the-grid", "data-testid": "game-screen-beat-the-grid", children: [
|
|
7189
|
+
/* @__PURE__ */ jsx78(GameHeader, { title, eyebrow: s.eyebrow, onBack, backLabel: ui.back }),
|
|
7190
|
+
/* @__PURE__ */ jsx78("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
7140
7191
|
] });
|
|
7141
7192
|
}
|
|
7142
7193
|
const rows = config.rows;
|
|
@@ -7149,20 +7200,20 @@ function BeatTheGridGame({
|
|
|
7149
7200
|
(_, i) => i < correctCount ? "correct" : i < correctCount + wrongCount ? "wrong" : "todo"
|
|
7150
7201
|
);
|
|
7151
7202
|
const totalScore = clientState?.totalScore ?? result?.score ?? 0;
|
|
7152
|
-
return /* @__PURE__ */
|
|
7153
|
-
/* @__PURE__ */
|
|
7154
|
-
/* @__PURE__ */
|
|
7203
|
+
return /* @__PURE__ */ jsxs66("div", { className: "ss-g-screen", "data-game": "beat-the-grid", "data-testid": "game-screen-beat-the-grid", children: [
|
|
7204
|
+
/* @__PURE__ */ jsx78(GameHeader, { title, eyebrow: s.eyebrow, onBack, backLabel: ui.back }),
|
|
7205
|
+
/* @__PURE__ */ jsx78(
|
|
7155
7206
|
SegmentProgress,
|
|
7156
7207
|
{
|
|
7157
7208
|
segments,
|
|
7158
7209
|
ariaLabel: s.progressAria(filledCells.length, total),
|
|
7159
7210
|
leftLabel: s.filled(filledCells.length, total),
|
|
7160
7211
|
rightLabel: s.toGo(Math.max(0, total - filledCells.length)),
|
|
7161
|
-
right: /* @__PURE__ */
|
|
7212
|
+
right: /* @__PURE__ */ jsx78(Chip, { variant: "accent", children: `${totalScore} ${ui.games.unitPts}` })
|
|
7162
7213
|
}
|
|
7163
7214
|
),
|
|
7164
|
-
/* @__PURE__ */
|
|
7165
|
-
/* @__PURE__ */
|
|
7215
|
+
/* @__PURE__ */ jsxs66("div", { className: "ss-g-body", children: [
|
|
7216
|
+
/* @__PURE__ */ jsxs66(
|
|
7166
7217
|
"div",
|
|
7167
7218
|
{
|
|
7168
7219
|
className: activeCell !== null ? "ss-g-btg-grid ss-g-btg-grid--fit" : "ss-g-btg-grid",
|
|
@@ -7172,31 +7223,31 @@ function BeatTheGridGame({
|
|
|
7172
7223
|
},
|
|
7173
7224
|
role: "grid",
|
|
7174
7225
|
children: [
|
|
7175
|
-
/* @__PURE__ */
|
|
7226
|
+
/* @__PURE__ */ jsx78("div", { className: "ss-g-btg-corner" }),
|
|
7176
7227
|
cols.map((col, colIdx) => {
|
|
7177
7228
|
const colMeta = config.colsMeta?.[colIdx];
|
|
7178
|
-
return /* @__PURE__ */
|
|
7179
|
-
/* @__PURE__ */
|
|
7180
|
-
/* @__PURE__ */
|
|
7229
|
+
return /* @__PURE__ */ jsxs66("div", { className: "ss-g-btg-colhdr", "data-meta": colMeta ? "true" : void 0, children: [
|
|
7230
|
+
/* @__PURE__ */ jsx78(HeaderVisual, { label: col, textKey: config.colsI18n?.[colIdx]?.key, meta: colMeta }),
|
|
7231
|
+
/* @__PURE__ */ jsx78("span", { children: col })
|
|
7181
7232
|
] }, col);
|
|
7182
7233
|
}),
|
|
7183
7234
|
rows.map((rowLabel, rowIdx) => {
|
|
7184
7235
|
const rowMeta = config.rowsMeta?.[rowIdx];
|
|
7185
7236
|
const abbr = rowAbbrev(rowLabel, s.rowAbbrev, config.rowsI18n?.[rowIdx]?.key);
|
|
7186
|
-
const rowHeaderContent = rowMeta ? /* @__PURE__ */
|
|
7187
|
-
/* @__PURE__ */
|
|
7188
|
-
/* @__PURE__ */
|
|
7189
|
-
] }) : abbr === rowLabel ? /* @__PURE__ */
|
|
7190
|
-
/* @__PURE__ */
|
|
7191
|
-
/* @__PURE__ */
|
|
7237
|
+
const rowHeaderContent = rowMeta ? /* @__PURE__ */ jsxs66(Fragment15, { children: [
|
|
7238
|
+
/* @__PURE__ */ jsx78(HeaderVisual, { label: rowLabel, textKey: config.rowsI18n?.[rowIdx]?.key, meta: rowMeta }),
|
|
7239
|
+
/* @__PURE__ */ jsx78("span", { children: rowLabel })
|
|
7240
|
+
] }) : abbr === rowLabel ? /* @__PURE__ */ jsx78("span", { children: rowLabel }) : /* @__PURE__ */ jsxs66(Fragment15, { children: [
|
|
7241
|
+
/* @__PURE__ */ jsx78("span", { "aria-hidden": "true", children: abbr }),
|
|
7242
|
+
/* @__PURE__ */ jsx78("span", { className: "ss-g-sr", children: rowLabel })
|
|
7192
7243
|
] });
|
|
7193
|
-
return /* @__PURE__ */
|
|
7194
|
-
/* @__PURE__ */
|
|
7244
|
+
return /* @__PURE__ */ jsxs66(React.Fragment, { children: [
|
|
7245
|
+
/* @__PURE__ */ jsx78("div", { className: "ss-g-btg-rowhdr", "data-meta": rowMeta ? "true" : void 0, children: rowHeaderContent }),
|
|
7195
7246
|
cols.map((colLabel, colIdx) => {
|
|
7196
7247
|
const filled = findCellResult(filledCells, rowIdx, colIdx);
|
|
7197
7248
|
const isActive = activeCell?.row === rowIdx && activeCell?.col === colIdx;
|
|
7198
7249
|
const state = filled ? filled.isCorrect ? "correct" : "wrong" : isActive ? "active" : "empty";
|
|
7199
|
-
return /* @__PURE__ */
|
|
7250
|
+
return /* @__PURE__ */ jsx78(
|
|
7200
7251
|
"button",
|
|
7201
7252
|
{
|
|
7202
7253
|
type: "button",
|
|
@@ -7207,20 +7258,20 @@ function BeatTheGridGame({
|
|
|
7207
7258
|
className: "ss-g-btg-cell",
|
|
7208
7259
|
disabled: isLocked2 || submitting,
|
|
7209
7260
|
onClick: () => handleCellClick(rowIdx, colIdx),
|
|
7210
|
-
children: filled ? /* @__PURE__ */
|
|
7211
|
-
/* @__PURE__ */
|
|
7261
|
+
children: filled ? /* @__PURE__ */ jsxs66(Fragment15, { children: [
|
|
7262
|
+
/* @__PURE__ */ jsx78(
|
|
7212
7263
|
"span",
|
|
7213
7264
|
{
|
|
7214
7265
|
className: `ss-g-btg-badge ss-g-btg-badge--${filled.isCorrect ? "correct" : "wrong"}`,
|
|
7215
7266
|
role: "img",
|
|
7216
7267
|
"aria-label": filled.isCorrect ? s.correct : s.wrong,
|
|
7217
|
-
children: filled.isCorrect ? /* @__PURE__ */
|
|
7268
|
+
children: filled.isCorrect ? /* @__PURE__ */ jsx78(IconCheck, { size: 11 }) : /* @__PURE__ */ jsx78(IconClose, { size: 11 })
|
|
7218
7269
|
}
|
|
7219
7270
|
),
|
|
7220
|
-
/* @__PURE__ */
|
|
7271
|
+
/* @__PURE__ */ jsx78("span", { className: "ss-g-btg-rarity", children: filled.rarityScore }),
|
|
7221
7272
|
(() => {
|
|
7222
7273
|
const entry = playerPool.find((p) => p.id === filled.playerId);
|
|
7223
|
-
return /* @__PURE__ */
|
|
7274
|
+
return /* @__PURE__ */ jsx78(
|
|
7224
7275
|
PlayerAvatar,
|
|
7225
7276
|
{
|
|
7226
7277
|
name: entry?.name ?? "",
|
|
@@ -7229,8 +7280,8 @@ function BeatTheGridGame({
|
|
|
7229
7280
|
}
|
|
7230
7281
|
);
|
|
7231
7282
|
})(),
|
|
7232
|
-
/* @__PURE__ */
|
|
7233
|
-
] }) : /* @__PURE__ */
|
|
7283
|
+
/* @__PURE__ */ jsx78("span", { className: "ss-g-btg-name", children: shortName(playerPool.find((p) => p.id === filled.playerId)?.name) })
|
|
7284
|
+
] }) : /* @__PURE__ */ jsx78("span", { className: "ss-g-btg-plus", "aria-hidden": "true", children: /* @__PURE__ */ jsx78(IconPlus, { size: 22 }) })
|
|
7234
7285
|
},
|
|
7235
7286
|
`cell-${rowIdx}-${colIdx}`
|
|
7236
7287
|
);
|
|
@@ -7240,7 +7291,7 @@ function BeatTheGridGame({
|
|
|
7240
7291
|
]
|
|
7241
7292
|
}
|
|
7242
7293
|
),
|
|
7243
|
-
isLocked2 && /* @__PURE__ */
|
|
7294
|
+
isLocked2 && /* @__PURE__ */ jsx78(
|
|
7244
7295
|
ResultCard,
|
|
7245
7296
|
{
|
|
7246
7297
|
tone: "neutral",
|
|
@@ -7252,7 +7303,7 @@ function BeatTheGridGame({
|
|
|
7252
7303
|
}
|
|
7253
7304
|
)
|
|
7254
7305
|
] }),
|
|
7255
|
-
activeCell !== null && /* @__PURE__ */
|
|
7306
|
+
activeCell !== null && /* @__PURE__ */ jsx78("div", { className: "ss-g-btg-pin", children: /* @__PURE__ */ jsx78(
|
|
7256
7307
|
SearchSheet,
|
|
7257
7308
|
{
|
|
7258
7309
|
row: activeCell.row,
|
|
@@ -7274,18 +7325,18 @@ function BeatTheGridGame({
|
|
|
7274
7325
|
import { useState as useState33, useId as useId5 } from "react";
|
|
7275
7326
|
|
|
7276
7327
|
// src/components/games/ui/PitchSvg.tsx
|
|
7277
|
-
import { Fragment as
|
|
7328
|
+
import { Fragment as Fragment16, jsx as jsx79, jsxs as jsxs67 } from "react/jsx-runtime";
|
|
7278
7329
|
function PitchSvg({ variant }) {
|
|
7279
|
-
return /* @__PURE__ */
|
|
7280
|
-
/* @__PURE__ */
|
|
7281
|
-
variant === "full" ? /* @__PURE__ */
|
|
7282
|
-
/* @__PURE__ */
|
|
7283
|
-
/* @__PURE__ */
|
|
7284
|
-
/* @__PURE__ */
|
|
7285
|
-
/* @__PURE__ */
|
|
7286
|
-
] }) : /* @__PURE__ */
|
|
7287
|
-
/* @__PURE__ */
|
|
7288
|
-
/* @__PURE__ */
|
|
7330
|
+
return /* @__PURE__ */ jsxs67("svg", { className: "ss-g-pitch-svg", viewBox: variant === "full" ? "0 0 100 150" : "0 0 100 100", preserveAspectRatio: "none", "aria-hidden": "true", children: [
|
|
7331
|
+
/* @__PURE__ */ jsx79("rect", { x: "4", y: "4", width: "92", height: variant === "full" ? 142 : 92, fill: "none" }),
|
|
7332
|
+
variant === "full" ? /* @__PURE__ */ jsxs67(Fragment16, { children: [
|
|
7333
|
+
/* @__PURE__ */ jsx79("line", { x1: "4", y1: "75", x2: "96", y2: "75" }),
|
|
7334
|
+
/* @__PURE__ */ jsx79("circle", { cx: "50", cy: "75", r: "12", fill: "none" }),
|
|
7335
|
+
/* @__PURE__ */ jsx79("rect", { x: "26", y: "4", width: "48", height: "20", fill: "none" }),
|
|
7336
|
+
/* @__PURE__ */ jsx79("rect", { x: "26", y: "126", width: "48", height: "20", fill: "none" })
|
|
7337
|
+
] }) : /* @__PURE__ */ jsxs67(Fragment16, { children: [
|
|
7338
|
+
/* @__PURE__ */ jsx79("path", { d: "M38 4a12 12 0 0 0 24 0", fill: "none" }),
|
|
7339
|
+
/* @__PURE__ */ jsx79("rect", { x: "26", y: "76", width: "48", height: "20", fill: "none" })
|
|
7289
7340
|
] })
|
|
7290
7341
|
] });
|
|
7291
7342
|
}
|
|
@@ -7341,7 +7392,7 @@ function positionsBySlot(formation, rowsAttackFirst) {
|
|
|
7341
7392
|
}
|
|
7342
7393
|
|
|
7343
7394
|
// src/components/games/GuessTheXiGame.tsx
|
|
7344
|
-
import { Fragment as
|
|
7395
|
+
import { Fragment as Fragment17, jsx as jsx80, jsxs as jsxs68 } from "react/jsx-runtime";
|
|
7345
7396
|
var MAX_GUESSES2 = 3;
|
|
7346
7397
|
function parseClientState5(json) {
|
|
7347
7398
|
if (!json) return null;
|
|
@@ -7391,30 +7442,31 @@ function GuessTheXiGame({
|
|
|
7391
7442
|
const wrongGuesses = (clientState?.guessHistory ?? []).filter((g) => !g.wasCorrect);
|
|
7392
7443
|
const guessesLeft = Math.max(0, MAX_GUESSES2 - (clientState?.guessesUsed ?? 0));
|
|
7393
7444
|
const teamName = (id) => config?.teamPool.find((tm) => tm.teamId === id)?.teamName ?? `#${id}`;
|
|
7394
|
-
return /* @__PURE__ */
|
|
7395
|
-
/* @__PURE__ */
|
|
7445
|
+
return /* @__PURE__ */ jsxs68("div", { className: "ss-g-screen ss-g-gxi", "data-game": "guess-the-xi", "data-testid": "game-screen-guess-the-xi", children: [
|
|
7446
|
+
/* @__PURE__ */ jsx80(
|
|
7396
7447
|
GameHeader,
|
|
7397
7448
|
{
|
|
7398
7449
|
title: gameTitle({ gameId: "guess-the-xi" }, ui.games.titles),
|
|
7399
7450
|
eyebrow: config?.poolLabel,
|
|
7400
|
-
right: formation ? /* @__PURE__ */
|
|
7451
|
+
right: formation ? /* @__PURE__ */ jsx80(Chip, { variant: "accent", children: formation }) : void 0,
|
|
7401
7452
|
onBack,
|
|
7402
7453
|
backLabel: ui.back
|
|
7403
7454
|
}
|
|
7404
7455
|
),
|
|
7405
|
-
!config && /* @__PURE__ */
|
|
7406
|
-
config && /* @__PURE__ */
|
|
7407
|
-
/* @__PURE__ */
|
|
7408
|
-
|
|
7409
|
-
|
|
7410
|
-
/* @__PURE__ */
|
|
7456
|
+
!config && /* @__PURE__ */ jsx80("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading }),
|
|
7457
|
+
config && /* @__PURE__ */ jsxs68(Fragment17, { children: [
|
|
7458
|
+
/* @__PURE__ */ jsxs68("div", { className: "ss-g-body", children: [
|
|
7459
|
+
!isOver && /* @__PURE__ */ jsx80(PointsLadderRow, { ladder: config.pointsLadder, guessesUsed: clientState?.guessHistory.length ?? 0, ui }),
|
|
7460
|
+
rows.length > 0 && /* @__PURE__ */ jsxs68("div", { className: "ss-g-gxi-pitch", role: "group", "aria-label": t.pitchLabel, children: [
|
|
7461
|
+
/* @__PURE__ */ jsx80(PitchSvg, { variant: "full" }),
|
|
7462
|
+
/* @__PURE__ */ jsx80("div", { className: "ss-g-gxi-rows", children: rows.map((row, r) => /* @__PURE__ */ jsx80("div", { className: "ss-g-gxi-row", children: row.map((pos, c) => {
|
|
7411
7463
|
const posLabel = pos.slot ? posBySlot.get(pos.slot) ?? "" : "";
|
|
7412
7464
|
const name = pos.slot ? nameBySlot.get(pos.slot) : void 0;
|
|
7413
7465
|
const lineupEntry = pos.slot ? lineupBySlot.get(pos.slot) : void 0;
|
|
7414
7466
|
const flag = nationalityFlag(pos.nationality);
|
|
7415
7467
|
if (lineupEntry) {
|
|
7416
|
-
return /* @__PURE__ */
|
|
7417
|
-
/* @__PURE__ */
|
|
7468
|
+
return /* @__PURE__ */ jsxs68("div", { className: "ss-g-gxi-node", "data-revealed": "true", children: [
|
|
7469
|
+
/* @__PURE__ */ jsx80(
|
|
7418
7470
|
PlayerAvatar,
|
|
7419
7471
|
{
|
|
7420
7472
|
name: lineupEntry.name,
|
|
@@ -7422,11 +7474,11 @@ function GuessTheXiGame({
|
|
|
7422
7474
|
className: "ss-g-gxi-disc ss-g-gxi-disc--photo"
|
|
7423
7475
|
}
|
|
7424
7476
|
),
|
|
7425
|
-
/* @__PURE__ */
|
|
7477
|
+
/* @__PURE__ */ jsx80("span", { className: "ss-g-gxi-pos ss-g-gxi-pos--name", children: splitName(lineupEntry.name).last })
|
|
7426
7478
|
] }, `${pos.slot}-${c}`);
|
|
7427
7479
|
}
|
|
7428
|
-
return /* @__PURE__ */
|
|
7429
|
-
/* @__PURE__ */
|
|
7480
|
+
return /* @__PURE__ */ jsxs68("div", { className: "ss-g-gxi-node", "data-revealed": name ? "true" : void 0, children: [
|
|
7481
|
+
/* @__PURE__ */ jsx80(
|
|
7430
7482
|
"span",
|
|
7431
7483
|
{
|
|
7432
7484
|
className: "ss-g-gxi-disc",
|
|
@@ -7437,22 +7489,22 @@ function GuessTheXiGame({
|
|
|
7437
7489
|
children: flag
|
|
7438
7490
|
}
|
|
7439
7491
|
),
|
|
7440
|
-
name ? /* @__PURE__ */
|
|
7492
|
+
name ? /* @__PURE__ */ jsx80("span", { className: "ss-g-gxi-pos ss-g-gxi-pos--name", children: splitName(name).last }) : posLabel && /* @__PURE__ */ jsx80("span", { className: "ss-g-gxi-pos", children: posLabel })
|
|
7441
7493
|
] }, `${pos.slot}-${c}`);
|
|
7442
7494
|
}) }, r)) })
|
|
7443
7495
|
] }),
|
|
7444
|
-
!isOver && wrongGuesses.length > 0 && /* @__PURE__ */
|
|
7445
|
-
/* @__PURE__ */
|
|
7496
|
+
!isOver && wrongGuesses.length > 0 && /* @__PURE__ */ jsxs68("div", { className: "ss-g-gxi-wrong", children: [
|
|
7497
|
+
/* @__PURE__ */ jsx80("span", { className: "ss-g-gxi-wrong-l", children: t.notThem }),
|
|
7446
7498
|
wrongGuesses.map((g) => {
|
|
7447
7499
|
const crestUrl = config?.teamPool.find((tm) => tm.teamId === g.teamId)?.crestUrl;
|
|
7448
|
-
return /* @__PURE__ */
|
|
7449
|
-
/* @__PURE__ */
|
|
7450
|
-
/* @__PURE__ */
|
|
7500
|
+
return /* @__PURE__ */ jsxs68("span", { className: "ss-g-gxi-wrong-chip", children: [
|
|
7501
|
+
/* @__PURE__ */ jsx80(CrestShield, { src: crestUrl, name: teamName(g.teamId), size: 18 }),
|
|
7502
|
+
/* @__PURE__ */ jsx80("s", { children: teamName(g.teamId) })
|
|
7451
7503
|
] }, g.teamId);
|
|
7452
7504
|
})
|
|
7453
7505
|
] }),
|
|
7454
|
-
isOver && /* @__PURE__ */
|
|
7455
|
-
/* @__PURE__ */
|
|
7506
|
+
isOver && /* @__PURE__ */ jsxs68(Fragment17, { children: [
|
|
7507
|
+
/* @__PURE__ */ jsx80(
|
|
7456
7508
|
ResultCard,
|
|
7457
7509
|
{
|
|
7458
7510
|
tone: solved ? "win" : failed ? "lose" : "neutral",
|
|
@@ -7463,29 +7515,29 @@ function GuessTheXiGame({
|
|
|
7463
7515
|
ui
|
|
7464
7516
|
}
|
|
7465
7517
|
),
|
|
7466
|
-
(solved || failed) && clientState?.answer && /* @__PURE__ */
|
|
7467
|
-
/* @__PURE__ */
|
|
7468
|
-
/* @__PURE__ */
|
|
7469
|
-
/* @__PURE__ */
|
|
7518
|
+
(solved || failed) && clientState?.answer && /* @__PURE__ */ jsxs68("div", { className: "ss-g-gxi-answer", "data-testid": "gxi-answer-reveal", children: [
|
|
7519
|
+
/* @__PURE__ */ jsx80("span", { className: "ss-g-gxi-answer-label", children: t.theAnswer }),
|
|
7520
|
+
/* @__PURE__ */ jsx80(CrestShield, { src: clientState.answer.crestUrl, name: clientState.answer.teamName, size: 32 }),
|
|
7521
|
+
/* @__PURE__ */ jsx80("span", { className: "ss-g-gxi-answer-name", children: clientState.answer.teamName })
|
|
7470
7522
|
] })
|
|
7471
7523
|
] })
|
|
7472
7524
|
] }),
|
|
7473
|
-
!isOver && /* @__PURE__ */
|
|
7474
|
-
query.length > 0 && filtered.length > 0 && /* @__PURE__ */
|
|
7525
|
+
!isOver && /* @__PURE__ */ jsxs68(FooterBar, { children: [
|
|
7526
|
+
query.length > 0 && filtered.length > 0 && /* @__PURE__ */ jsx80(
|
|
7475
7527
|
OptionList,
|
|
7476
7528
|
{
|
|
7477
7529
|
label: t.optionsLabel,
|
|
7478
7530
|
options: filtered.map((tm) => ({
|
|
7479
7531
|
key: tm.teamId,
|
|
7480
|
-
content: /* @__PURE__ */
|
|
7481
|
-
/* @__PURE__ */
|
|
7482
|
-
/* @__PURE__ */
|
|
7532
|
+
content: /* @__PURE__ */ jsxs68(Fragment17, { children: [
|
|
7533
|
+
/* @__PURE__ */ jsx80(CrestShield, { src: tm.crestUrl, name: tm.teamName, size: 28 }),
|
|
7534
|
+
/* @__PURE__ */ jsx80("span", { children: tm.teamName })
|
|
7483
7535
|
] })
|
|
7484
7536
|
})),
|
|
7485
7537
|
onPick: (k) => handlePick(Number(k))
|
|
7486
7538
|
}
|
|
7487
7539
|
),
|
|
7488
|
-
/* @__PURE__ */
|
|
7540
|
+
/* @__PURE__ */ jsx80(
|
|
7489
7541
|
SearchField,
|
|
7490
7542
|
{
|
|
7491
7543
|
id: inputId,
|
|
@@ -7503,7 +7555,7 @@ function GuessTheXiGame({
|
|
|
7503
7555
|
|
|
7504
7556
|
// src/components/games/DailyQuizGame.tsx
|
|
7505
7557
|
import { useState as useState34 } from "react";
|
|
7506
|
-
import { Fragment as
|
|
7558
|
+
import { Fragment as Fragment18, jsx as jsx81, jsxs as jsxs69 } from "react/jsx-runtime";
|
|
7507
7559
|
function parseClientState6(json) {
|
|
7508
7560
|
if (!json) return null;
|
|
7509
7561
|
try {
|
|
@@ -7524,13 +7576,13 @@ function OptionName({ text }) {
|
|
|
7524
7576
|
const tokens = base.split(/\s+/).filter(Boolean);
|
|
7525
7577
|
const isPlainName = tokens.length >= 1 && tokens.length <= 4 && tokens.every((t) => NAME_TOKEN.test(t));
|
|
7526
7578
|
if (!isPlainName || base === "") {
|
|
7527
|
-
return /* @__PURE__ */
|
|
7579
|
+
return /* @__PURE__ */ jsx81("span", { className: "ss-g-dq-opt-name", children: /* @__PURE__ */ jsx81("span", { className: "ss-g-dq-opt-full", children: text }) });
|
|
7528
7580
|
}
|
|
7529
7581
|
const { first, last } = splitName(base);
|
|
7530
|
-
return /* @__PURE__ */
|
|
7531
|
-
first && /* @__PURE__ */
|
|
7532
|
-
/* @__PURE__ */
|
|
7533
|
-
suffix && /* @__PURE__ */
|
|
7582
|
+
return /* @__PURE__ */ jsxs69("span", { className: "ss-g-dq-opt-name", children: [
|
|
7583
|
+
first && /* @__PURE__ */ jsx81("span", { className: "ss-g-dq-opt-first", children: first }),
|
|
7584
|
+
/* @__PURE__ */ jsx81("span", { className: "ss-g-dq-opt-last", children: last }),
|
|
7585
|
+
suffix && /* @__PURE__ */ jsx81("span", { className: "ss-g-dq-opt-suffix", children: suffix })
|
|
7534
7586
|
] });
|
|
7535
7587
|
}
|
|
7536
7588
|
function DailyQuizGame({
|
|
@@ -7549,9 +7601,9 @@ function DailyQuizGame({
|
|
|
7549
7601
|
const results = clientState?.results ?? [];
|
|
7550
7602
|
const isRevealed = results.length > 0 || result?.alreadyPlayed === true;
|
|
7551
7603
|
if (!config) {
|
|
7552
|
-
return /* @__PURE__ */
|
|
7553
|
-
/* @__PURE__ */
|
|
7554
|
-
/* @__PURE__ */
|
|
7604
|
+
return /* @__PURE__ */ jsxs69("div", { className: "ss-g-screen", "data-game": "daily-quiz", "data-testid": "game-screen-daily-quiz", children: [
|
|
7605
|
+
/* @__PURE__ */ jsx81(GameHeader, { title, onBack, backLabel: ui.back }),
|
|
7606
|
+
/* @__PURE__ */ jsx81("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
7555
7607
|
] });
|
|
7556
7608
|
}
|
|
7557
7609
|
const questions = config.questions;
|
|
@@ -7586,11 +7638,11 @@ function DailyQuizGame({
|
|
|
7586
7638
|
return r.isCorrect ? "correct" : "wrong";
|
|
7587
7639
|
});
|
|
7588
7640
|
const correctCount = results.filter((r) => r.isCorrect).length;
|
|
7589
|
-
return /* @__PURE__ */
|
|
7590
|
-
/* @__PURE__ */
|
|
7591
|
-
/* @__PURE__ */
|
|
7592
|
-
/* @__PURE__ */
|
|
7593
|
-
/* @__PURE__ */
|
|
7641
|
+
return /* @__PURE__ */ jsxs69("div", { className: "ss-g-screen", "data-game": "daily-quiz", "data-testid": "game-screen-daily-quiz", children: [
|
|
7642
|
+
/* @__PURE__ */ jsx81(GameHeader, { title, eyebrow: s.results, onBack, backLabel: ui.back }),
|
|
7643
|
+
/* @__PURE__ */ jsx81(SegmentProgress, { segments: segments2, ariaLabel: s.results }),
|
|
7644
|
+
/* @__PURE__ */ jsxs69("div", { className: "ss-g-body", children: [
|
|
7645
|
+
/* @__PURE__ */ jsx81(
|
|
7594
7646
|
ResultCard,
|
|
7595
7647
|
{
|
|
7596
7648
|
tone: "neutral",
|
|
@@ -7603,15 +7655,15 @@ function DailyQuizGame({
|
|
|
7603
7655
|
questions.map((q) => {
|
|
7604
7656
|
const r = findResult(results, q.index);
|
|
7605
7657
|
const picked = selections.get(q.index);
|
|
7606
|
-
return /* @__PURE__ */
|
|
7607
|
-
/* @__PURE__ */
|
|
7608
|
-
r && /* @__PURE__ */
|
|
7658
|
+
return /* @__PURE__ */ jsxs69("div", { className: "ss-g-dq-rq", children: [
|
|
7659
|
+
/* @__PURE__ */ jsx81("div", { className: "ss-g-dq-rq-stem", children: q.stem }),
|
|
7660
|
+
r && /* @__PURE__ */ jsx81("div", { className: "ss-g-dq-rq-opts", children: q.options.map((opt, optIdx) => {
|
|
7609
7661
|
let cls = "ss-g-dq-rq-opt";
|
|
7610
7662
|
if (optIdx === r.correctOptionIndex) cls += " ss-g-dq-rq-opt--correct";
|
|
7611
7663
|
else if (optIdx === picked && !r.isCorrect) cls += " ss-g-dq-rq-opt--wrong";
|
|
7612
|
-
return /* @__PURE__ */
|
|
7664
|
+
return /* @__PURE__ */ jsx81("span", { className: cls, children: opt }, optIdx);
|
|
7613
7665
|
}) }),
|
|
7614
|
-
r?.revealText && /* @__PURE__ */
|
|
7666
|
+
r?.revealText && /* @__PURE__ */ jsx81("div", { className: "ss-g-dq-why", children: r.revealText })
|
|
7615
7667
|
] }, q.index);
|
|
7616
7668
|
})
|
|
7617
7669
|
] })
|
|
@@ -7619,16 +7671,16 @@ function DailyQuizGame({
|
|
|
7619
7671
|
}
|
|
7620
7672
|
const segments = questions.map((_, i) => i < page ? "done" : i === page ? "current" : "todo");
|
|
7621
7673
|
const selectedIdx = current ? selections.get(current.index) : void 0;
|
|
7622
|
-
return /* @__PURE__ */
|
|
7623
|
-
/* @__PURE__ */
|
|
7624
|
-
/* @__PURE__ */
|
|
7625
|
-
/* @__PURE__ */
|
|
7626
|
-
/* @__PURE__ */
|
|
7627
|
-
/* @__PURE__ */
|
|
7674
|
+
return /* @__PURE__ */ jsxs69("div", { className: "ss-g-screen", "data-game": "daily-quiz", "data-testid": "game-screen-daily-quiz", children: [
|
|
7675
|
+
/* @__PURE__ */ jsx81(GameHeader, { title, eyebrow: s.questionOf(page + 1, total), onBack, backLabel: ui.back }),
|
|
7676
|
+
/* @__PURE__ */ jsx81(SegmentProgress, { segments, ariaLabel: s.progressAria(page + 1, total) }),
|
|
7677
|
+
/* @__PURE__ */ jsx81("div", { className: "ss-g-body", children: current && /* @__PURE__ */ jsxs69(Fragment18, { children: [
|
|
7678
|
+
/* @__PURE__ */ jsx81("h3", { className: "ss-g-dq-stem", children: current.stem }),
|
|
7679
|
+
/* @__PURE__ */ jsx81("div", { className: "ss-g-dq-opts", children: current.options.map((opt, optIdx) => {
|
|
7628
7680
|
const selected = optIdx === selectedIdx;
|
|
7629
7681
|
const imagePath = current.optionImagePaths?.[optIdx] ?? void 0;
|
|
7630
7682
|
const playerName = opt;
|
|
7631
|
-
return /* @__PURE__ */
|
|
7683
|
+
return /* @__PURE__ */ jsxs69(
|
|
7632
7684
|
"button",
|
|
7633
7685
|
{
|
|
7634
7686
|
type: "button",
|
|
@@ -7637,25 +7689,25 @@ function DailyQuizGame({
|
|
|
7637
7689
|
disabled: submitting,
|
|
7638
7690
|
onClick: () => handleSelect(current.index, optIdx),
|
|
7639
7691
|
children: [
|
|
7640
|
-
current.optionImagePaths && /* @__PURE__ */
|
|
7641
|
-
/* @__PURE__ */
|
|
7642
|
-
/* @__PURE__ */
|
|
7692
|
+
current.optionImagePaths && /* @__PURE__ */ jsx81(PlayerAvatar, { name: playerName, imagePath, className: "ss-g-dq-opt-av" }),
|
|
7693
|
+
/* @__PURE__ */ jsx81("span", { className: "ss-g-dq-badge", "aria-hidden": "true", children: selected ? /* @__PURE__ */ jsx81(IconCheck, {}) : String.fromCharCode(65 + optIdx) }),
|
|
7694
|
+
/* @__PURE__ */ jsx81(OptionName, { text: opt })
|
|
7643
7695
|
]
|
|
7644
7696
|
},
|
|
7645
7697
|
optIdx
|
|
7646
7698
|
);
|
|
7647
7699
|
}) })
|
|
7648
7700
|
] }) }),
|
|
7649
|
-
/* @__PURE__ */
|
|
7650
|
-
page > 0 && /* @__PURE__ */
|
|
7651
|
-
isLast ? /* @__PURE__ */
|
|
7701
|
+
/* @__PURE__ */ jsx81(FooterBar, { children: /* @__PURE__ */ jsxs69("div", { className: "ss-g-dq-nav", children: [
|
|
7702
|
+
page > 0 && /* @__PURE__ */ jsx81(GameButton, { variant: "outline", onClick: goPrev, disabled: submitting, children: s.previous }),
|
|
7703
|
+
isLast ? /* @__PURE__ */ jsx81(GameButton, { variant: "primary", block: true, onClick: handleSubmit, disabled: !currentAnswered || !allAnswered || submitting, children: submitting ? s.submitting : s.submit }) : /* @__PURE__ */ jsx81(GameButton, { variant: "primary", block: true, onClick: goNext, disabled: !currentAnswered || submitting, children: s.next })
|
|
7652
7704
|
] }) })
|
|
7653
7705
|
] });
|
|
7654
7706
|
}
|
|
7655
7707
|
|
|
7656
7708
|
// src/components/games/MatchdayPredictorGame.tsx
|
|
7657
7709
|
import { useId as useId6, useState as useState35 } from "react";
|
|
7658
|
-
import { jsx as
|
|
7710
|
+
import { jsx as jsx82, jsxs as jsxs70 } from "react/jsx-runtime";
|
|
7659
7711
|
var SCORER_SEARCH_THRESHOLD = 9;
|
|
7660
7712
|
function parseClientState7(json) {
|
|
7661
7713
|
if (!json) return null;
|
|
@@ -7673,7 +7725,7 @@ function isLocked(kickoffUtc) {
|
|
|
7673
7725
|
}
|
|
7674
7726
|
}
|
|
7675
7727
|
function IconMinus() {
|
|
7676
|
-
return /* @__PURE__ */
|
|
7728
|
+
return /* @__PURE__ */ jsx82(
|
|
7677
7729
|
"svg",
|
|
7678
7730
|
{
|
|
7679
7731
|
width: 18,
|
|
@@ -7684,20 +7736,20 @@ function IconMinus() {
|
|
|
7684
7736
|
strokeWidth: 2.2,
|
|
7685
7737
|
strokeLinecap: "round",
|
|
7686
7738
|
"aria-hidden": "true",
|
|
7687
|
-
children: /* @__PURE__ */
|
|
7739
|
+
children: /* @__PURE__ */ jsx82("path", { d: "M5 12h14" })
|
|
7688
7740
|
}
|
|
7689
7741
|
);
|
|
7690
7742
|
}
|
|
7691
7743
|
function TeamBadge({ team, label }) {
|
|
7692
|
-
return /* @__PURE__ */
|
|
7693
|
-
/* @__PURE__ */
|
|
7694
|
-
/* @__PURE__ */
|
|
7695
|
-
/* @__PURE__ */
|
|
7744
|
+
return /* @__PURE__ */ jsxs70("div", { className: "ss-g-mp-team", children: [
|
|
7745
|
+
/* @__PURE__ */ jsx82(CrestShield, { name: team.name, size: 44 }),
|
|
7746
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-g-mp-team-name", children: team.name }),
|
|
7747
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-g-mp-team-side", children: label })
|
|
7696
7748
|
] });
|
|
7697
7749
|
}
|
|
7698
7750
|
function ScoreCard({ home, away, h, a, t, edit }) {
|
|
7699
|
-
const col = (side, team, value) => /* @__PURE__ */
|
|
7700
|
-
edit && /* @__PURE__ */
|
|
7751
|
+
const col = (side, team, value) => /* @__PURE__ */ jsxs70("div", { className: "ss-g-mp-col", children: [
|
|
7752
|
+
edit && /* @__PURE__ */ jsx82(
|
|
7701
7753
|
"button",
|
|
7702
7754
|
{
|
|
7703
7755
|
type: "button",
|
|
@@ -7705,11 +7757,11 @@ function ScoreCard({ home, away, h, a, t, edit }) {
|
|
|
7705
7757
|
"aria-label": t.goalsUp(team.name),
|
|
7706
7758
|
disabled: edit.disabled,
|
|
7707
7759
|
onClick: () => edit.onStep(side, 1),
|
|
7708
|
-
children: /* @__PURE__ */
|
|
7760
|
+
children: /* @__PURE__ */ jsx82(IconPlus, { size: 18 })
|
|
7709
7761
|
}
|
|
7710
7762
|
),
|
|
7711
|
-
/* @__PURE__ */
|
|
7712
|
-
edit && /* @__PURE__ */
|
|
7763
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-g-mp-digit", "data-testid": "mp-digit", "data-active": edit ? String(edit.active === side) : "false", children: value }),
|
|
7764
|
+
edit && /* @__PURE__ */ jsx82(
|
|
7713
7765
|
"button",
|
|
7714
7766
|
{
|
|
7715
7767
|
type: "button",
|
|
@@ -7717,27 +7769,27 @@ function ScoreCard({ home, away, h, a, t, edit }) {
|
|
|
7717
7769
|
"aria-label": t.goalsDown(team.name),
|
|
7718
7770
|
disabled: edit.disabled || value <= 0,
|
|
7719
7771
|
onClick: () => edit.onStep(side, -1),
|
|
7720
|
-
children: /* @__PURE__ */
|
|
7772
|
+
children: /* @__PURE__ */ jsx82(IconMinus, {})
|
|
7721
7773
|
}
|
|
7722
7774
|
)
|
|
7723
7775
|
] });
|
|
7724
|
-
return /* @__PURE__ */
|
|
7725
|
-
/* @__PURE__ */
|
|
7726
|
-
/* @__PURE__ */
|
|
7776
|
+
return /* @__PURE__ */ jsxs70("div", { className: "ss-g-mp-card", children: [
|
|
7777
|
+
/* @__PURE__ */ jsx82(TeamBadge, { team: home, label: t.home }),
|
|
7778
|
+
/* @__PURE__ */ jsxs70("div", { className: "ss-g-mp-scores", children: [
|
|
7727
7779
|
col("home", home, h),
|
|
7728
|
-
/* @__PURE__ */
|
|
7780
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-g-mp-dash", "aria-hidden": "true", children: "\u2013" }),
|
|
7729
7781
|
col("away", away, a)
|
|
7730
7782
|
] }),
|
|
7731
|
-
/* @__PURE__ */
|
|
7783
|
+
/* @__PURE__ */ jsx82(TeamBadge, { team: away, label: t.away })
|
|
7732
7784
|
] });
|
|
7733
7785
|
}
|
|
7734
7786
|
function OutcomeRow({ label, ok, detail, t }) {
|
|
7735
|
-
return /* @__PURE__ */
|
|
7736
|
-
/* @__PURE__ */
|
|
7737
|
-
/* @__PURE__ */
|
|
7738
|
-
ok ? /* @__PURE__ */
|
|
7739
|
-
/* @__PURE__ */
|
|
7740
|
-
detail ? /* @__PURE__ */
|
|
7787
|
+
return /* @__PURE__ */ jsxs70("li", { className: "ss-g-mp-row", "data-testid": "mp-row", "data-ok": String(ok), children: [
|
|
7788
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-g-mp-row-k", children: label }),
|
|
7789
|
+
/* @__PURE__ */ jsxs70("span", { className: "ss-g-mp-row-v", children: [
|
|
7790
|
+
ok ? /* @__PURE__ */ jsx82(IconCheck, {}) : /* @__PURE__ */ jsx82(IconClose, { size: 14 }),
|
|
7791
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-g-sr", children: ok ? t.correct : t.incorrect }),
|
|
7792
|
+
detail ? /* @__PURE__ */ jsx82("span", { className: "ss-g-mp-row-d", children: detail }) : null
|
|
7741
7793
|
] })
|
|
7742
7794
|
] });
|
|
7743
7795
|
}
|
|
@@ -7758,12 +7810,12 @@ function MatchdayPredictorGame({
|
|
|
7758
7810
|
const searchId = useId6();
|
|
7759
7811
|
const clientState = parseClientState7(result?.clientStateJson);
|
|
7760
7812
|
const alreadyPlayed = result?.alreadyPlayed === true;
|
|
7761
|
-
const header = /* @__PURE__ */
|
|
7813
|
+
const header = /* @__PURE__ */ jsx82(
|
|
7762
7814
|
GameHeader,
|
|
7763
7815
|
{
|
|
7764
7816
|
title: gameTitle({ gameId: "matchday-predictor" }, ui.games.titles),
|
|
7765
7817
|
eyebrow: config ? t.eyebrow(config.homeTeam.name, config.awayTeam.name) : void 0,
|
|
7766
|
-
right: config ? /* @__PURE__ */
|
|
7818
|
+
right: config ? /* @__PURE__ */ jsx82(Chip, { icon: /* @__PURE__ */ jsx82(IconLock, {}), children: ui.games.formatDayTime(config.kickoffUtc) }) : void 0,
|
|
7767
7819
|
onBack,
|
|
7768
7820
|
backLabel: ui.back
|
|
7769
7821
|
}
|
|
@@ -7771,10 +7823,10 @@ function MatchdayPredictorGame({
|
|
|
7771
7823
|
if (alreadyPlayed && clientState) {
|
|
7772
7824
|
if (!clientState.graded) {
|
|
7773
7825
|
const scorer = config?.scorerPool.find((p) => p.playerId === clientState.predictedFirstScorerPlayerId) ?? null;
|
|
7774
|
-
return /* @__PURE__ */
|
|
7826
|
+
return /* @__PURE__ */ jsxs70("div", { className: "ss-g-screen", "data-game": "matchday-predictor", "data-testid": "game-screen-matchday-predictor", children: [
|
|
7775
7827
|
header,
|
|
7776
|
-
/* @__PURE__ */
|
|
7777
|
-
config && /* @__PURE__ */
|
|
7828
|
+
/* @__PURE__ */ jsxs70("div", { className: "ss-g-body", children: [
|
|
7829
|
+
config && /* @__PURE__ */ jsx82(
|
|
7778
7830
|
ScoreCard,
|
|
7779
7831
|
{
|
|
7780
7832
|
home: config.homeTeam,
|
|
@@ -7784,7 +7836,7 @@ function MatchdayPredictorGame({
|
|
|
7784
7836
|
t
|
|
7785
7837
|
}
|
|
7786
7838
|
),
|
|
7787
|
-
/* @__PURE__ */
|
|
7839
|
+
/* @__PURE__ */ jsx82(
|
|
7788
7840
|
ResultCard,
|
|
7789
7841
|
{
|
|
7790
7842
|
tone: "neutral",
|
|
@@ -7801,28 +7853,28 @@ function MatchdayPredictorGame({
|
|
|
7801
7853
|
}
|
|
7802
7854
|
)
|
|
7803
7855
|
] }),
|
|
7804
|
-
/* @__PURE__ */
|
|
7856
|
+
/* @__PURE__ */ jsx82(FooterBar, { children: /* @__PURE__ */ jsx82("p", { className: "ss-g-mp-fun", children: t.forFun }) })
|
|
7805
7857
|
] });
|
|
7806
7858
|
}
|
|
7807
7859
|
const r = clientState.result;
|
|
7808
|
-
return /* @__PURE__ */
|
|
7860
|
+
return /* @__PURE__ */ jsxs70("div", { className: "ss-g-screen", "data-game": "matchday-predictor", "data-testid": "game-screen-matchday-predictor", children: [
|
|
7809
7861
|
header,
|
|
7810
|
-
/* @__PURE__ */
|
|
7811
|
-
config && /* @__PURE__ */
|
|
7812
|
-
/* @__PURE__ */
|
|
7813
|
-
/* @__PURE__ */
|
|
7814
|
-
/* @__PURE__ */
|
|
7815
|
-
/* @__PURE__ */
|
|
7816
|
-
!clientState.firstScorerVoid && /* @__PURE__ */
|
|
7862
|
+
/* @__PURE__ */ jsxs70("div", { className: "ss-g-body", children: [
|
|
7863
|
+
config && /* @__PURE__ */ jsx82(ScoreCard, { home: config.homeTeam, away: config.awayTeam, h: r.homeScore, a: r.awayScore, t }),
|
|
7864
|
+
/* @__PURE__ */ jsx82(ResultCard, { tone: "neutral", title: t.fullTime(r.homeScore, r.awayScore), onBack, ui }),
|
|
7865
|
+
/* @__PURE__ */ jsxs70("ul", { className: "ss-g-mp-rows", children: [
|
|
7866
|
+
/* @__PURE__ */ jsx82(OutcomeRow, { label: t.exactScore, ok: clientState.exactScoreCorrect, t }),
|
|
7867
|
+
/* @__PURE__ */ jsx82(OutcomeRow, { label: t.outcome, ok: clientState.outcomeCorrect, t }),
|
|
7868
|
+
!clientState.firstScorerVoid && /* @__PURE__ */ jsx82(OutcomeRow, { label: t.firstScorerRow, ok: clientState.firstScorerCorrect, detail: r.firstScorerName, t })
|
|
7817
7869
|
] })
|
|
7818
7870
|
] }),
|
|
7819
|
-
/* @__PURE__ */
|
|
7871
|
+
/* @__PURE__ */ jsx82(FooterBar, { children: /* @__PURE__ */ jsx82("p", { className: "ss-g-mp-fun", children: t.forFun }) })
|
|
7820
7872
|
] });
|
|
7821
7873
|
}
|
|
7822
7874
|
if (!config) {
|
|
7823
|
-
return /* @__PURE__ */
|
|
7875
|
+
return /* @__PURE__ */ jsxs70("div", { className: "ss-g-screen", "data-game": "matchday-predictor", "data-testid": "game-screen-matchday-predictor", children: [
|
|
7824
7876
|
header,
|
|
7825
|
-
/* @__PURE__ */
|
|
7877
|
+
/* @__PURE__ */ jsx82("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
7826
7878
|
] });
|
|
7827
7879
|
}
|
|
7828
7880
|
const locked = isLocked(config.kickoffUtc);
|
|
@@ -7846,10 +7898,10 @@ function MatchdayPredictorGame({
|
|
|
7846
7898
|
const showSearch = pool.length > SCORER_SEARCH_THRESHOLD;
|
|
7847
7899
|
const q = query.trim().toLowerCase();
|
|
7848
7900
|
const visible = showSearch && q ? pool.filter((p) => p.playerName.toLowerCase().includes(q)) : pool;
|
|
7849
|
-
return /* @__PURE__ */
|
|
7901
|
+
return /* @__PURE__ */ jsxs70("div", { className: "ss-g-screen", "data-game": "matchday-predictor", "data-testid": "game-screen-matchday-predictor", children: [
|
|
7850
7902
|
header,
|
|
7851
|
-
/* @__PURE__ */
|
|
7852
|
-
/* @__PURE__ */
|
|
7903
|
+
/* @__PURE__ */ jsxs70("div", { className: "ss-g-body", children: [
|
|
7904
|
+
/* @__PURE__ */ jsx82(
|
|
7853
7905
|
ScoreCard,
|
|
7854
7906
|
{
|
|
7855
7907
|
home: config.homeTeam,
|
|
@@ -7860,12 +7912,12 @@ function MatchdayPredictorGame({
|
|
|
7860
7912
|
edit: { disabled, active: lastEdited, onStep: step }
|
|
7861
7913
|
}
|
|
7862
7914
|
),
|
|
7863
|
-
pool.length > 0 && /* @__PURE__ */
|
|
7864
|
-
/* @__PURE__ */
|
|
7865
|
-
/* @__PURE__ */
|
|
7866
|
-
/* @__PURE__ */
|
|
7915
|
+
pool.length > 0 && /* @__PURE__ */ jsxs70("section", { className: "ss-g-mp-scorer", children: [
|
|
7916
|
+
/* @__PURE__ */ jsxs70("div", { className: "ss-g-mp-sec-head", children: [
|
|
7917
|
+
/* @__PURE__ */ jsx82("h3", { children: t.firstScorer }),
|
|
7918
|
+
/* @__PURE__ */ jsx82("span", { children: t.optional })
|
|
7867
7919
|
] }),
|
|
7868
|
-
showSearch && /* @__PURE__ */
|
|
7920
|
+
showSearch && /* @__PURE__ */ jsx82(
|
|
7869
7921
|
SearchField,
|
|
7870
7922
|
{
|
|
7871
7923
|
id: searchId,
|
|
@@ -7877,9 +7929,9 @@ function MatchdayPredictorGame({
|
|
|
7877
7929
|
disabled
|
|
7878
7930
|
}
|
|
7879
7931
|
),
|
|
7880
|
-
/* @__PURE__ */
|
|
7932
|
+
/* @__PURE__ */ jsx82("div", { className: "ss-g-mp-grid", children: visible.map((p) => {
|
|
7881
7933
|
const selected = firstScorerPlayerId === p.playerId;
|
|
7882
|
-
return /* @__PURE__ */
|
|
7934
|
+
return /* @__PURE__ */ jsxs70(
|
|
7883
7935
|
"button",
|
|
7884
7936
|
{
|
|
7885
7937
|
type: "button",
|
|
@@ -7889,15 +7941,15 @@ function MatchdayPredictorGame({
|
|
|
7889
7941
|
disabled,
|
|
7890
7942
|
onClick: () => setFirstScorerPlayerId((id) => id === p.playerId ? null : p.playerId),
|
|
7891
7943
|
children: [
|
|
7892
|
-
selected && /* @__PURE__ */
|
|
7893
|
-
/* @__PURE__ */
|
|
7894
|
-
/* @__PURE__ */
|
|
7944
|
+
selected && /* @__PURE__ */ jsx82("span", { className: "ss-g-mp-pcheck", children: /* @__PURE__ */ jsx82(IconCheck, { size: 12 }) }),
|
|
7945
|
+
/* @__PURE__ */ jsx82(Silhouette, { size: 52, variant: selected ? "selected" : "default" }),
|
|
7946
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-g-mp-pname", children: splitName(p.playerName).last })
|
|
7895
7947
|
]
|
|
7896
7948
|
},
|
|
7897
7949
|
p.playerId
|
|
7898
7950
|
);
|
|
7899
7951
|
}) }),
|
|
7900
|
-
/* @__PURE__ */
|
|
7952
|
+
/* @__PURE__ */ jsxs70(
|
|
7901
7953
|
"button",
|
|
7902
7954
|
{
|
|
7903
7955
|
type: "button",
|
|
@@ -7906,24 +7958,24 @@ function MatchdayPredictorGame({
|
|
|
7906
7958
|
disabled,
|
|
7907
7959
|
onClick: () => setFirstScorerPlayerId(null),
|
|
7908
7960
|
children: [
|
|
7909
|
-
/* @__PURE__ */
|
|
7961
|
+
/* @__PURE__ */ jsx82("span", { className: "ss-g-mp-radio", "aria-hidden": "true" }),
|
|
7910
7962
|
t.noScorer
|
|
7911
7963
|
]
|
|
7912
7964
|
}
|
|
7913
7965
|
)
|
|
7914
7966
|
] }),
|
|
7915
|
-
locked && /* @__PURE__ */
|
|
7967
|
+
locked && /* @__PURE__ */ jsx82("p", { className: "ss-g-mp-closed", children: t.closed })
|
|
7916
7968
|
] }),
|
|
7917
|
-
/* @__PURE__ */
|
|
7918
|
-
/* @__PURE__ */
|
|
7919
|
-
/* @__PURE__ */
|
|
7969
|
+
/* @__PURE__ */ jsxs70(FooterBar, { children: [
|
|
7970
|
+
/* @__PURE__ */ jsx82(GameButton, { variant: "primary", block: true, disabled, onClick: handleSubmit, children: submitting ? t.saving : t.save }),
|
|
7971
|
+
/* @__PURE__ */ jsx82("p", { className: "ss-g-mp-fun", children: t.forFun })
|
|
7920
7972
|
] })
|
|
7921
7973
|
] });
|
|
7922
7974
|
}
|
|
7923
7975
|
|
|
7924
7976
|
// src/components/games/StartingXiGame.tsx
|
|
7925
7977
|
import { useId as useId7, useState as useState36 } from "react";
|
|
7926
|
-
import { Fragment as
|
|
7978
|
+
import { Fragment as Fragment19, jsx as jsx83, jsxs as jsxs71 } from "react/jsx-runtime";
|
|
7927
7979
|
var POINTS_PER_STARTER = 8;
|
|
7928
7980
|
var XI_SIZE = 11;
|
|
7929
7981
|
var DEFAULT_FORMATION = "4-3-3";
|
|
@@ -7972,20 +8024,20 @@ function StartingXiGame({
|
|
|
7972
8024
|
const searchId = useId7();
|
|
7973
8025
|
const clientState = parseClientState8(result?.clientStateJson);
|
|
7974
8026
|
const alreadyPlayed = result?.alreadyPlayed === true;
|
|
7975
|
-
const header = /* @__PURE__ */
|
|
8027
|
+
const header = /* @__PURE__ */ jsx83(
|
|
7976
8028
|
GameHeader,
|
|
7977
8029
|
{
|
|
7978
8030
|
title: gameTitle({ gameId: "starting-xi" }, ui.games.titles),
|
|
7979
8031
|
eyebrow: t.eyebrow,
|
|
7980
|
-
right: /* @__PURE__ */
|
|
8032
|
+
right: /* @__PURE__ */ jsx83(Chip, { variant: "accent", children: t.perStarter(POINTS_PER_STARTER) }),
|
|
7981
8033
|
onBack,
|
|
7982
8034
|
backLabel: ui.back
|
|
7983
8035
|
}
|
|
7984
8036
|
);
|
|
7985
8037
|
function statusScreen(title, score) {
|
|
7986
|
-
return /* @__PURE__ */
|
|
8038
|
+
return /* @__PURE__ */ jsxs71("div", { className: "ss-g-screen", "data-game": "starting-xi", "data-testid": "game-screen-starting-xi", children: [
|
|
7987
8039
|
header,
|
|
7988
|
-
/* @__PURE__ */
|
|
8040
|
+
/* @__PURE__ */ jsx83("div", { className: "ss-g-body", children: /* @__PURE__ */ jsx83(ResultCard, { tone: "neutral", title, score, onBack, ui }) })
|
|
7989
8041
|
] });
|
|
7990
8042
|
}
|
|
7991
8043
|
if (alreadyPlayed) {
|
|
@@ -7994,9 +8046,9 @@ function StartingXiGame({
|
|
|
7994
8046
|
if (clientState.status === "graded") return statusScreen(t.gradedLine(clientState.correctCount), clientState.score);
|
|
7995
8047
|
}
|
|
7996
8048
|
if (!config) {
|
|
7997
|
-
return /* @__PURE__ */
|
|
8049
|
+
return /* @__PURE__ */ jsxs71("div", { className: "ss-g-screen", "data-game": "starting-xi", "data-testid": "game-screen-starting-xi", children: [
|
|
7998
8050
|
header,
|
|
7999
|
-
/* @__PURE__ */
|
|
8051
|
+
/* @__PURE__ */ jsx83("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
8000
8052
|
] });
|
|
8001
8053
|
}
|
|
8002
8054
|
const { formation, slots } = formationSlots(config.formation);
|
|
@@ -8031,27 +8083,27 @@ function StartingXiGame({
|
|
|
8031
8083
|
onSubmit(JSON.stringify({ predictedPlayerIds: slotPlayers }));
|
|
8032
8084
|
}
|
|
8033
8085
|
const segments = slotPlayers.map((p) => p !== null ? "current" : "todo");
|
|
8034
|
-
return /* @__PURE__ */
|
|
8086
|
+
return /* @__PURE__ */ jsxs71("div", { className: "ss-g-screen", "data-game": "starting-xi", "data-testid": "game-screen-starting-xi", children: [
|
|
8035
8087
|
header,
|
|
8036
|
-
/* @__PURE__ */
|
|
8088
|
+
/* @__PURE__ */ jsx83(
|
|
8037
8089
|
SegmentProgress,
|
|
8038
8090
|
{
|
|
8039
8091
|
segments,
|
|
8040
8092
|
ariaLabel: t.picked(pickedCount),
|
|
8041
8093
|
leftLabel: t.picked(pickedCount),
|
|
8042
8094
|
rightLabel: t.toGo(XI_SIZE - pickedCount),
|
|
8043
|
-
right: /* @__PURE__ */
|
|
8095
|
+
right: /* @__PURE__ */ jsx83(Chip, { children: formation })
|
|
8044
8096
|
}
|
|
8045
8097
|
),
|
|
8046
|
-
/* @__PURE__ */
|
|
8047
|
-
/* @__PURE__ */
|
|
8048
|
-
/* @__PURE__ */
|
|
8098
|
+
/* @__PURE__ */ jsxs71("div", { className: "ss-g-body", children: [
|
|
8099
|
+
/* @__PURE__ */ jsxs71("div", { className: "ss-g-xi-pitch", children: [
|
|
8100
|
+
/* @__PURE__ */ jsx83(PitchSvg, { variant: "half" }),
|
|
8049
8101
|
slots.map((s) => {
|
|
8050
8102
|
const playerId = slotPlayers[s.index] ?? null;
|
|
8051
8103
|
const player = playerId !== null ? byId.get(playerId) ?? null : null;
|
|
8052
8104
|
const name = player?.playerName ?? "";
|
|
8053
8105
|
const state = player ? "filled" : active === s.index ? "active" : "empty";
|
|
8054
|
-
return /* @__PURE__ */
|
|
8106
|
+
return /* @__PURE__ */ jsxs71(
|
|
8055
8107
|
"button",
|
|
8056
8108
|
{
|
|
8057
8109
|
type: "button",
|
|
@@ -8063,21 +8115,21 @@ function StartingXiGame({
|
|
|
8063
8115
|
disabled: submitting,
|
|
8064
8116
|
onClick: () => tapSlot(s.index),
|
|
8065
8117
|
children: [
|
|
8066
|
-
/* @__PURE__ */
|
|
8067
|
-
/* @__PURE__ */
|
|
8118
|
+
/* @__PURE__ */ jsx83("span", { className: "ss-g-xi-ring", "aria-hidden": "true", children: player ? player.jerseyNumber ?? "" : /* @__PURE__ */ jsx83(IconPlus, { size: 18 }) }),
|
|
8119
|
+
/* @__PURE__ */ jsx83("span", { className: "ss-g-xi-tag", "aria-hidden": "true", children: player ? splitName(name).last : s.label })
|
|
8068
8120
|
]
|
|
8069
8121
|
},
|
|
8070
8122
|
s.index
|
|
8071
8123
|
);
|
|
8072
8124
|
})
|
|
8073
8125
|
] }),
|
|
8074
|
-
/* @__PURE__ */
|
|
8075
|
-
/* @__PURE__ */
|
|
8076
|
-
/* @__PURE__ */
|
|
8077
|
-
/* @__PURE__ */
|
|
8078
|
-
] }) : /* @__PURE__ */
|
|
8079
|
-
activeSlot && /* @__PURE__ */
|
|
8080
|
-
/* @__PURE__ */
|
|
8126
|
+
/* @__PURE__ */ jsxs71("div", { className: "ss-g-xi-picker", children: [
|
|
8127
|
+
/* @__PURE__ */ jsx83("div", { className: "ss-g-xi-picker-head", children: activeSlot ? /* @__PURE__ */ jsxs71(Fragment19, { children: [
|
|
8128
|
+
/* @__PURE__ */ jsx83(Chip, { variant: "badge", children: activeSlot.label }),
|
|
8129
|
+
/* @__PURE__ */ jsx83("strong", { children: t.pickFor(activeSlot.label) })
|
|
8130
|
+
] }) : /* @__PURE__ */ jsx83("strong", { children: t.allPicked }) }),
|
|
8131
|
+
activeSlot && /* @__PURE__ */ jsxs71(Fragment19, { children: [
|
|
8132
|
+
/* @__PURE__ */ jsx83(
|
|
8081
8133
|
SearchField,
|
|
8082
8134
|
{
|
|
8083
8135
|
id: searchId,
|
|
@@ -8089,18 +8141,18 @@ function StartingXiGame({
|
|
|
8089
8141
|
disabled: submitting
|
|
8090
8142
|
}
|
|
8091
8143
|
),
|
|
8092
|
-
/* @__PURE__ */
|
|
8093
|
-
/* @__PURE__ */
|
|
8094
|
-
/* @__PURE__ */
|
|
8095
|
-
/* @__PURE__ */
|
|
8144
|
+
/* @__PURE__ */ jsx83("ul", { className: "ss-g-xi-list", children: available.map((p) => /* @__PURE__ */ jsx83("li", { children: /* @__PURE__ */ jsxs71("button", { type: "button", className: "ss-g-xi-opt", disabled: submitting, onClick: () => pick(p.playerId), children: [
|
|
8145
|
+
/* @__PURE__ */ jsx83("span", { className: "ss-g-xi-opt-no", "aria-hidden": "true", children: p.jerseyNumber ?? "" }),
|
|
8146
|
+
/* @__PURE__ */ jsx83("span", { className: "ss-g-xi-opt-name", children: p.playerName }),
|
|
8147
|
+
/* @__PURE__ */ jsx83("span", { className: "ss-g-xi-opt-pos", children: p.positionName })
|
|
8096
8148
|
] }) }, p.playerId)) })
|
|
8097
8149
|
] })
|
|
8098
8150
|
] })
|
|
8099
8151
|
] }),
|
|
8100
|
-
/* @__PURE__ */
|
|
8101
|
-
/* @__PURE__ */
|
|
8102
|
-
/* @__PURE__ */
|
|
8103
|
-
/* @__PURE__ */
|
|
8152
|
+
/* @__PURE__ */ jsxs71(FooterBar, { children: [
|
|
8153
|
+
/* @__PURE__ */ jsx83(GameButton, { variant: "primary", block: true, disabled: !canSubmit, onClick: handleSubmit, children: submitting ? t.submitting : t.submit }),
|
|
8154
|
+
/* @__PURE__ */ jsxs71("p", { className: "ss-g-xi-lock", children: [
|
|
8155
|
+
/* @__PURE__ */ jsx83(IconLock, {}),
|
|
8104
8156
|
lockAtUtc ? t.locksAt(ui.games.formatDayTime(lockAtUtc)) : t.locksSoon
|
|
8105
8157
|
] })
|
|
8106
8158
|
] })
|
|
@@ -8109,7 +8161,7 @@ function StartingXiGame({
|
|
|
8109
8161
|
|
|
8110
8162
|
// src/components/games/StatLadderGame.tsx
|
|
8111
8163
|
import { useId as useId8, useState as useState37 } from "react";
|
|
8112
|
-
import { jsx as
|
|
8164
|
+
import { jsx as jsx84, jsxs as jsxs72 } from "react/jsx-runtime";
|
|
8113
8165
|
function ladderClue(ladder) {
|
|
8114
8166
|
const mystery = ladder.find((r) => r.rank === 2);
|
|
8115
8167
|
if (!mystery) return null;
|
|
@@ -8131,9 +8183,9 @@ function parseClientState9(json) {
|
|
|
8131
8183
|
}
|
|
8132
8184
|
function NameStack({ name }) {
|
|
8133
8185
|
const { first, last } = splitName(name);
|
|
8134
|
-
return /* @__PURE__ */
|
|
8135
|
-
first && /* @__PURE__ */
|
|
8136
|
-
/* @__PURE__ */
|
|
8186
|
+
return /* @__PURE__ */ jsxs72("span", { className: "ss-g-sl-name", children: [
|
|
8187
|
+
first && /* @__PURE__ */ jsx84("small", { children: `${first[0]}.` }),
|
|
8188
|
+
/* @__PURE__ */ jsx84("b", { children: last })
|
|
8137
8189
|
] });
|
|
8138
8190
|
}
|
|
8139
8191
|
function StatLadderGame({
|
|
@@ -8150,11 +8202,11 @@ function StatLadderGame({
|
|
|
8150
8202
|
const searchId = useId8();
|
|
8151
8203
|
const clientState = parseClientState9(result?.clientStateJson);
|
|
8152
8204
|
const revealed = clientState != null;
|
|
8153
|
-
const header = /* @__PURE__ */
|
|
8205
|
+
const header = /* @__PURE__ */ jsx84(GameHeader, { title: gameTitle({ gameId: "stat-ladder" }, ui.games.titles), eyebrow: t.eyebrow, onBack, backLabel: ui.back });
|
|
8154
8206
|
if (!config) {
|
|
8155
|
-
return /* @__PURE__ */
|
|
8207
|
+
return /* @__PURE__ */ jsxs72("div", { className: "ss-g-screen", "data-game": "stat-ladder", "data-testid": "game-screen-stat-ladder", children: [
|
|
8156
8208
|
header,
|
|
8157
|
-
/* @__PURE__ */
|
|
8209
|
+
/* @__PURE__ */ jsx84("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
8158
8210
|
] });
|
|
8159
8211
|
}
|
|
8160
8212
|
const question = t.question(config.statLabel);
|
|
@@ -8166,44 +8218,45 @@ function StatLadderGame({
|
|
|
8166
8218
|
if (selectedId === null || submitting || revealed) return;
|
|
8167
8219
|
onSubmit(JSON.stringify({ guessedPlayerId: selectedId }));
|
|
8168
8220
|
}
|
|
8169
|
-
return /* @__PURE__ */
|
|
8221
|
+
return /* @__PURE__ */ jsxs72("div", { className: "ss-g-screen", "data-game": "stat-ladder", "data-testid": "game-screen-stat-ladder", children: [
|
|
8170
8222
|
header,
|
|
8171
|
-
/* @__PURE__ */
|
|
8172
|
-
/* @__PURE__ */
|
|
8173
|
-
|
|
8174
|
-
/* @__PURE__ */
|
|
8223
|
+
/* @__PURE__ */ jsxs72("div", { className: "ss-g-body", children: [
|
|
8224
|
+
!revealed && /* @__PURE__ */ jsx84(PointsLadderRow, { ladder: config.pointsLadder, guessesUsed: 0, ui }),
|
|
8225
|
+
/* @__PURE__ */ jsxs72("div", { className: "ss-g-sl-prompt", children: [
|
|
8226
|
+
/* @__PURE__ */ jsx84(Chip, { variant: "accent", icon: /* @__PURE__ */ jsx84(IconShield, { size: 14 }), className: "ss-g-sl-stat", children: config.statLabel }),
|
|
8227
|
+
/* @__PURE__ */ jsxs72("h3", { className: "ss-g-sl-q", children: [
|
|
8175
8228
|
question.pre,
|
|
8176
|
-
/* @__PURE__ */
|
|
8229
|
+
/* @__PURE__ */ jsx84("em", { children: question.emph }),
|
|
8177
8230
|
question.post
|
|
8178
8231
|
] })
|
|
8179
8232
|
] }),
|
|
8180
|
-
/* @__PURE__ */
|
|
8181
|
-
(rung) => rung.rank === 2 ? /* @__PURE__ */
|
|
8233
|
+
/* @__PURE__ */ jsx84("ol", { className: "ss-g-sl-rungs", children: rungs.map(
|
|
8234
|
+
(rung) => rung.rank === 2 ? /* @__PURE__ */ jsxs72(
|
|
8182
8235
|
"li",
|
|
8183
8236
|
{
|
|
8184
8237
|
className: "ss-g-sl-rung ss-g-sl-rung--mystery",
|
|
8185
8238
|
"data-testid": "sl-mystery-rung",
|
|
8186
8239
|
"data-result": revealed ? clientState.isCorrect ? "correct" : "wrong" : void 0,
|
|
8187
8240
|
children: [
|
|
8188
|
-
/* @__PURE__ */
|
|
8189
|
-
revealed ? /* @__PURE__ */
|
|
8190
|
-
revealed ? /* @__PURE__ */
|
|
8191
|
-
/* @__PURE__ */
|
|
8241
|
+
/* @__PURE__ */ jsx84("span", { className: "ss-g-sl-rank", children: "2" }),
|
|
8242
|
+
revealed ? /* @__PURE__ */ jsx84(PlayerAvatar, { name: clientState.revealedRank2.playerName, className: "ss-g-sl-av" }) : /* @__PURE__ */ jsx84(Silhouette, { size: 52, variant: "mystery" }),
|
|
8243
|
+
revealed ? /* @__PURE__ */ jsx84(NameStack, { name: clientState.revealedRank2.playerName }) : /* @__PURE__ */ jsx84("span", { className: "ss-g-sl-who", children: t.whoSecond }),
|
|
8244
|
+
/* @__PURE__ */ jsx84("span", { className: "ss-g-sl-val ss-g-sl-val--mystery", children: rung.statValue })
|
|
8192
8245
|
]
|
|
8193
8246
|
},
|
|
8194
8247
|
rung.rank
|
|
8195
|
-
) : /* @__PURE__ */
|
|
8196
|
-
/* @__PURE__ */
|
|
8197
|
-
/* @__PURE__ */
|
|
8198
|
-
/* @__PURE__ */
|
|
8199
|
-
/* @__PURE__ */
|
|
8248
|
+
) : /* @__PURE__ */ jsxs72("li", { className: "ss-g-sl-rung", children: [
|
|
8249
|
+
/* @__PURE__ */ jsx84("span", { className: "ss-g-sl-rank", children: rung.rank }),
|
|
8250
|
+
/* @__PURE__ */ jsx84(PlayerAvatar, { name: rung.playerName ?? "?", className: "ss-g-sl-av" }),
|
|
8251
|
+
/* @__PURE__ */ jsx84(NameStack, { name: rung.playerName ?? "?" }),
|
|
8252
|
+
/* @__PURE__ */ jsx84("span", { className: "ss-g-sl-val", children: rung.statValue })
|
|
8200
8253
|
] }, rung.rank)
|
|
8201
8254
|
) }),
|
|
8202
|
-
clue && /* @__PURE__ */
|
|
8203
|
-
/* @__PURE__ */
|
|
8204
|
-
/* @__PURE__ */
|
|
8255
|
+
clue && /* @__PURE__ */ jsxs72("p", { className: "ss-g-sl-clue", children: [
|
|
8256
|
+
/* @__PURE__ */ jsx84(IconBulb, {}),
|
|
8257
|
+
/* @__PURE__ */ jsx84("span", { children: t.clue(clue, config.statLabel) })
|
|
8205
8258
|
] }),
|
|
8206
|
-
!revealed && /* @__PURE__ */
|
|
8259
|
+
!revealed && /* @__PURE__ */ jsx84("ul", { className: "ss-g-sl-pool", children: pool.map((p) => /* @__PURE__ */ jsx84("li", { children: /* @__PURE__ */ jsxs72(
|
|
8207
8260
|
"button",
|
|
8208
8261
|
{
|
|
8209
8262
|
type: "button",
|
|
@@ -8216,13 +8269,13 @@ function StatLadderGame({
|
|
|
8216
8269
|
setQuery(p.playerName);
|
|
8217
8270
|
},
|
|
8218
8271
|
children: [
|
|
8219
|
-
/* @__PURE__ */
|
|
8220
|
-
/* @__PURE__ */
|
|
8221
|
-
selectedId === p.playerId && /* @__PURE__ */
|
|
8272
|
+
/* @__PURE__ */ jsx84(PlayerAvatar, { name: p.playerName, className: "ss-g-sl-opt-av" }),
|
|
8273
|
+
/* @__PURE__ */ jsx84("span", { className: "ss-g-sl-opt-name", children: p.playerName }),
|
|
8274
|
+
selectedId === p.playerId && /* @__PURE__ */ jsx84(IconCheck, {})
|
|
8222
8275
|
]
|
|
8223
8276
|
}
|
|
8224
8277
|
) }, p.playerId)) }),
|
|
8225
|
-
revealed && /* @__PURE__ */
|
|
8278
|
+
revealed && /* @__PURE__ */ jsx84(
|
|
8226
8279
|
ResultCard,
|
|
8227
8280
|
{
|
|
8228
8281
|
tone: clientState.isCorrect ? "win" : "lose",
|
|
@@ -8233,8 +8286,8 @@ function StatLadderGame({
|
|
|
8233
8286
|
}
|
|
8234
8287
|
)
|
|
8235
8288
|
] }),
|
|
8236
|
-
!revealed && /* @__PURE__ */
|
|
8237
|
-
/* @__PURE__ */
|
|
8289
|
+
!revealed && /* @__PURE__ */ jsx84(FooterBar, { children: /* @__PURE__ */ jsxs72("div", { className: "ss-g-sl-guess", children: [
|
|
8290
|
+
/* @__PURE__ */ jsx84(
|
|
8238
8291
|
SearchField,
|
|
8239
8292
|
{
|
|
8240
8293
|
id: searchId,
|
|
@@ -8249,13 +8302,13 @@ function StatLadderGame({
|
|
|
8249
8302
|
disabled: submitting
|
|
8250
8303
|
}
|
|
8251
8304
|
),
|
|
8252
|
-
/* @__PURE__ */
|
|
8305
|
+
/* @__PURE__ */ jsx84(GameButton, { variant: "primary", disabled: selectedId === null || submitting, onClick: guess, children: t.guess })
|
|
8253
8306
|
] }) })
|
|
8254
8307
|
] });
|
|
8255
8308
|
}
|
|
8256
8309
|
|
|
8257
8310
|
// src/components/games/FanMotmGame.tsx
|
|
8258
|
-
import { jsx as
|
|
8311
|
+
import { jsx as jsx85, jsxs as jsxs73 } from "react/jsx-runtime";
|
|
8259
8312
|
function parseClientState10(json) {
|
|
8260
8313
|
if (!json) return null;
|
|
8261
8314
|
try {
|
|
@@ -8276,20 +8329,20 @@ function FanMotmGame({
|
|
|
8276
8329
|
const clientState = parseClientState10(result?.clientStateJson);
|
|
8277
8330
|
const alreadyVoted = result?.alreadyPlayed === true;
|
|
8278
8331
|
const pickedId = clientState?.pickedPlayerId ?? null;
|
|
8279
|
-
const header = /* @__PURE__ */
|
|
8332
|
+
const header = /* @__PURE__ */ jsx85(
|
|
8280
8333
|
GameHeader,
|
|
8281
8334
|
{
|
|
8282
8335
|
title: t.title,
|
|
8283
8336
|
eyebrow: t.eyebrow,
|
|
8284
|
-
right: alreadyVoted ? /* @__PURE__ */
|
|
8337
|
+
right: alreadyVoted ? /* @__PURE__ */ jsx85(Chip, { variant: "success", icon: /* @__PURE__ */ jsx85(IconCheck, {}), children: t.voted }) : void 0,
|
|
8285
8338
|
onBack,
|
|
8286
8339
|
backLabel: ui.back
|
|
8287
8340
|
}
|
|
8288
8341
|
);
|
|
8289
8342
|
if (!config) {
|
|
8290
|
-
return /* @__PURE__ */
|
|
8343
|
+
return /* @__PURE__ */ jsxs73("div", { className: "ss-g-screen", "data-game": "fan-motm", "data-testid": "game-screen-fan-motm", children: [
|
|
8291
8344
|
header,
|
|
8292
|
-
/* @__PURE__ */
|
|
8345
|
+
/* @__PURE__ */ jsx85("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
8293
8346
|
] });
|
|
8294
8347
|
}
|
|
8295
8348
|
const picked = config.candidates.find((c) => c.playerId === pickedId) ?? null;
|
|
@@ -8297,12 +8350,12 @@ function FanMotmGame({
|
|
|
8297
8350
|
if (alreadyVoted || submitting) return;
|
|
8298
8351
|
onSubmit(JSON.stringify({ pickedPlayerId: candidateId }));
|
|
8299
8352
|
}
|
|
8300
|
-
return /* @__PURE__ */
|
|
8353
|
+
return /* @__PURE__ */ jsxs73("div", { className: "ss-g-screen", "data-game": "fan-motm", "data-testid": "game-screen-fan-motm", children: [
|
|
8301
8354
|
header,
|
|
8302
|
-
/* @__PURE__ */
|
|
8303
|
-
/* @__PURE__ */
|
|
8355
|
+
/* @__PURE__ */ jsxs73("div", { className: "ss-g-body", children: [
|
|
8356
|
+
/* @__PURE__ */ jsx85("ul", { className: "ss-g-motm-list", children: config.candidates.map((c) => {
|
|
8304
8357
|
const isVoted = alreadyVoted && pickedId === c.playerId;
|
|
8305
|
-
return /* @__PURE__ */
|
|
8358
|
+
return /* @__PURE__ */ jsx85("li", { children: /* @__PURE__ */ jsxs73(
|
|
8306
8359
|
"button",
|
|
8307
8360
|
{
|
|
8308
8361
|
type: "button",
|
|
@@ -8311,24 +8364,24 @@ function FanMotmGame({
|
|
|
8311
8364
|
disabled: alreadyVoted || submitting,
|
|
8312
8365
|
onClick: () => handleVote(c.playerId),
|
|
8313
8366
|
children: [
|
|
8314
|
-
/* @__PURE__ */
|
|
8315
|
-
/* @__PURE__ */
|
|
8316
|
-
isVoted && /* @__PURE__ */
|
|
8367
|
+
/* @__PURE__ */ jsx85(PlayerAvatar, { name: c.playerName, className: "ss-g-motm-av" }),
|
|
8368
|
+
/* @__PURE__ */ jsx85("span", { className: "ss-g-motm-name", children: c.playerName }),
|
|
8369
|
+
isVoted && /* @__PURE__ */ jsx85(Chip, { variant: "accent", className: "ss-g-motm-pill", children: t.yourVote })
|
|
8317
8370
|
]
|
|
8318
8371
|
}
|
|
8319
8372
|
) }, c.playerId);
|
|
8320
8373
|
}) }),
|
|
8321
|
-
alreadyVoted && picked && /* @__PURE__ */
|
|
8374
|
+
alreadyVoted && picked && /* @__PURE__ */ jsx85(ResultCard, { tone: "neutral", title: t.youVoted(picked.playerName), detail: t.thanks, onBack, ui })
|
|
8322
8375
|
] }),
|
|
8323
|
-
/* @__PURE__ */
|
|
8324
|
-
!alreadyVoted && /* @__PURE__ */
|
|
8325
|
-
/* @__PURE__ */
|
|
8376
|
+
/* @__PURE__ */ jsxs73(FooterBar, { children: [
|
|
8377
|
+
!alreadyVoted && /* @__PURE__ */ jsx85("p", { className: "ss-g-motm-foot", children: t.tapToVote }),
|
|
8378
|
+
/* @__PURE__ */ jsx85("p", { className: "ss-g-motm-fun", children: t.forFun })
|
|
8326
8379
|
] })
|
|
8327
8380
|
] });
|
|
8328
8381
|
}
|
|
8329
8382
|
|
|
8330
8383
|
// src/components/GameScreenHost.tsx
|
|
8331
|
-
import { jsx as
|
|
8384
|
+
import { jsx as jsx86 } from "react/jsx-runtime";
|
|
8332
8385
|
var FIXTURE_GAME_IDS = /* @__PURE__ */ new Set([
|
|
8333
8386
|
"matchday-predictor",
|
|
8334
8387
|
"starting-xi",
|
|
@@ -8353,7 +8406,7 @@ function GameScreenHost({
|
|
|
8353
8406
|
}) {
|
|
8354
8407
|
const { gameId, fixtureId, gameDay = "", lockAtUtc = null } = selected;
|
|
8355
8408
|
const [configJson, setConfigJson] = useState38(null);
|
|
8356
|
-
|
|
8409
|
+
useEffect22(() => {
|
|
8357
8410
|
setConfigJson(null);
|
|
8358
8411
|
if (!conversation) return;
|
|
8359
8412
|
let cancelled = false;
|
|
@@ -8376,12 +8429,12 @@ function GameScreenHost({
|
|
|
8376
8429
|
fixtureId: fixtureId || void 0,
|
|
8377
8430
|
locale: ui.games.lang
|
|
8378
8431
|
});
|
|
8379
|
-
|
|
8432
|
+
useEffect22(() => {
|
|
8380
8433
|
if (conversation) hydrate();
|
|
8381
8434
|
}, [conversation, gameId]);
|
|
8382
|
-
const hydrateRef =
|
|
8435
|
+
const hydrateRef = useRef19(hydrate);
|
|
8383
8436
|
hydrateRef.current = hydrate;
|
|
8384
|
-
|
|
8437
|
+
useEffect22(() => {
|
|
8385
8438
|
if (!FIXTURE_GAME_IDS.has(gameId)) return;
|
|
8386
8439
|
if (rawStatus !== "pending") return;
|
|
8387
8440
|
const timerId = setInterval(() => {
|
|
@@ -8404,7 +8457,7 @@ function GameScreenHost({
|
|
|
8404
8457
|
function renderScreen() {
|
|
8405
8458
|
switch (gameId) {
|
|
8406
8459
|
case "mystery-tiger":
|
|
8407
|
-
return /* @__PURE__ */
|
|
8460
|
+
return /* @__PURE__ */ jsx86(
|
|
8408
8461
|
MysteryTigerGame,
|
|
8409
8462
|
{
|
|
8410
8463
|
...sharedProps,
|
|
@@ -8412,7 +8465,7 @@ function GameScreenHost({
|
|
|
8412
8465
|
}
|
|
8413
8466
|
);
|
|
8414
8467
|
case "higher-or-lower":
|
|
8415
|
-
return /* @__PURE__ */
|
|
8468
|
+
return /* @__PURE__ */ jsx86(
|
|
8416
8469
|
HigherOrLowerGame,
|
|
8417
8470
|
{
|
|
8418
8471
|
...sharedProps,
|
|
@@ -8420,7 +8473,7 @@ function GameScreenHost({
|
|
|
8420
8473
|
}
|
|
8421
8474
|
);
|
|
8422
8475
|
case "career-path":
|
|
8423
|
-
return /* @__PURE__ */
|
|
8476
|
+
return /* @__PURE__ */ jsx86(
|
|
8424
8477
|
CareerPathGame,
|
|
8425
8478
|
{
|
|
8426
8479
|
...sharedProps,
|
|
@@ -8429,7 +8482,7 @@ function GameScreenHost({
|
|
|
8429
8482
|
);
|
|
8430
8483
|
case "beat-the-grid": {
|
|
8431
8484
|
const btgConfig = safeParseConfig(configJson);
|
|
8432
|
-
return /* @__PURE__ */
|
|
8485
|
+
return /* @__PURE__ */ jsx86(
|
|
8433
8486
|
BeatTheGridGame,
|
|
8434
8487
|
{
|
|
8435
8488
|
...sharedProps,
|
|
@@ -8439,7 +8492,7 @@ function GameScreenHost({
|
|
|
8439
8492
|
);
|
|
8440
8493
|
}
|
|
8441
8494
|
case "guess-the-xi":
|
|
8442
|
-
return /* @__PURE__ */
|
|
8495
|
+
return /* @__PURE__ */ jsx86(
|
|
8443
8496
|
GuessTheXiGame,
|
|
8444
8497
|
{
|
|
8445
8498
|
...sharedProps,
|
|
@@ -8447,7 +8500,7 @@ function GameScreenHost({
|
|
|
8447
8500
|
}
|
|
8448
8501
|
);
|
|
8449
8502
|
case "daily-quiz":
|
|
8450
|
-
return /* @__PURE__ */
|
|
8503
|
+
return /* @__PURE__ */ jsx86(
|
|
8451
8504
|
DailyQuizGame,
|
|
8452
8505
|
{
|
|
8453
8506
|
...sharedProps,
|
|
@@ -8455,7 +8508,7 @@ function GameScreenHost({
|
|
|
8455
8508
|
}
|
|
8456
8509
|
);
|
|
8457
8510
|
case "matchday-predictor":
|
|
8458
|
-
return /* @__PURE__ */
|
|
8511
|
+
return /* @__PURE__ */ jsx86(
|
|
8459
8512
|
MatchdayPredictorGame,
|
|
8460
8513
|
{
|
|
8461
8514
|
...sharedProps,
|
|
@@ -8463,7 +8516,7 @@ function GameScreenHost({
|
|
|
8463
8516
|
}
|
|
8464
8517
|
);
|
|
8465
8518
|
case "starting-xi":
|
|
8466
|
-
return /* @__PURE__ */
|
|
8519
|
+
return /* @__PURE__ */ jsx86(
|
|
8467
8520
|
StartingXiGame,
|
|
8468
8521
|
{
|
|
8469
8522
|
...sharedProps,
|
|
@@ -8471,7 +8524,7 @@ function GameScreenHost({
|
|
|
8471
8524
|
}
|
|
8472
8525
|
);
|
|
8473
8526
|
case "stat-ladder":
|
|
8474
|
-
return /* @__PURE__ */
|
|
8527
|
+
return /* @__PURE__ */ jsx86(
|
|
8475
8528
|
StatLadderGame,
|
|
8476
8529
|
{
|
|
8477
8530
|
...sharedProps,
|
|
@@ -8479,7 +8532,7 @@ function GameScreenHost({
|
|
|
8479
8532
|
}
|
|
8480
8533
|
);
|
|
8481
8534
|
case "fan-motm":
|
|
8482
|
-
return /* @__PURE__ */
|
|
8535
|
+
return /* @__PURE__ */ jsx86(
|
|
8483
8536
|
FanMotmGame,
|
|
8484
8537
|
{
|
|
8485
8538
|
...sharedProps,
|
|
@@ -8487,10 +8540,10 @@ function GameScreenHost({
|
|
|
8487
8540
|
}
|
|
8488
8541
|
);
|
|
8489
8542
|
default:
|
|
8490
|
-
return /* @__PURE__ */
|
|
8543
|
+
return /* @__PURE__ */ jsx86("div", { className: "ss-g-screen", "data-testid": `game-screen-${gameId}`, children: /* @__PURE__ */ jsx86(GameHeader, { title: gameTitle({ gameId }, ui.games.titles), onBack, backLabel: ui.back }) });
|
|
8491
8544
|
}
|
|
8492
8545
|
}
|
|
8493
|
-
return /* @__PURE__ */
|
|
8546
|
+
return /* @__PURE__ */ jsx86("div", { className: "ss-w-gscreen", "data-testid": "gscreen", "data-lock-at": lockAtUtc ?? void 0, children: renderScreen() });
|
|
8494
8547
|
}
|
|
8495
8548
|
|
|
8496
8549
|
// src/components/games/ui/fonts.ts
|
|
@@ -8507,7 +8560,7 @@ function ensureGamesFonts(doc = document) {
|
|
|
8507
8560
|
}
|
|
8508
8561
|
|
|
8509
8562
|
// src/components/GamesPanel.tsx
|
|
8510
|
-
import { jsx as
|
|
8563
|
+
import { jsx as jsx87 } from "react/jsx-runtime";
|
|
8511
8564
|
function GamesPanel({
|
|
8512
8565
|
loggedIn,
|
|
8513
8566
|
games,
|
|
@@ -8517,12 +8570,12 @@ function GamesPanel({
|
|
|
8517
8570
|
refreshHub
|
|
8518
8571
|
}) {
|
|
8519
8572
|
const [selected, setSelected] = useState39(null);
|
|
8520
|
-
|
|
8573
|
+
useEffect23(() => {
|
|
8521
8574
|
ensureGamesFonts();
|
|
8522
8575
|
}, []);
|
|
8523
|
-
if (!loggedIn) return /* @__PURE__ */
|
|
8576
|
+
if (!loggedIn) return /* @__PURE__ */ jsx87(GamesLoginWall, { ui });
|
|
8524
8577
|
if (selected !== null) {
|
|
8525
|
-
return /* @__PURE__ */
|
|
8578
|
+
return /* @__PURE__ */ jsx87("div", { className: "ss-w-gscreen-wrap", lang: ui.games.lang, children: /* @__PURE__ */ jsx87(
|
|
8526
8579
|
GameScreenHost,
|
|
8527
8580
|
{
|
|
8528
8581
|
selected,
|
|
@@ -8536,7 +8589,7 @@ function GamesPanel({
|
|
|
8536
8589
|
}
|
|
8537
8590
|
) });
|
|
8538
8591
|
}
|
|
8539
|
-
return /* @__PURE__ */
|
|
8592
|
+
return /* @__PURE__ */ jsx87("div", { className: "ss-g-hub-wrap", "data-testid": "games-hub", lang: ui.games.lang, children: /* @__PURE__ */ jsx87(
|
|
8540
8593
|
GamesHub,
|
|
8541
8594
|
{
|
|
8542
8595
|
games,
|
|
@@ -8551,7 +8604,7 @@ function GamesPanel({
|
|
|
8551
8604
|
import { useState as useState40 } from "react";
|
|
8552
8605
|
|
|
8553
8606
|
// src/components/LeaderboardRow.tsx
|
|
8554
|
-
import { jsx as
|
|
8607
|
+
import { jsx as jsx88, jsxs as jsxs74 } from "react/jsx-runtime";
|
|
8555
8608
|
function formatPoints(n) {
|
|
8556
8609
|
return n.toLocaleString("en");
|
|
8557
8610
|
}
|
|
@@ -8560,14 +8613,14 @@ function LeaderboardWeeklyRow({
|
|
|
8560
8613
|
isMe
|
|
8561
8614
|
}) {
|
|
8562
8615
|
const rankClass = `ss-w-lb2-rank${row.rank <= 3 ? " ss-w-lb2-rank--top3" : ""}`;
|
|
8563
|
-
return /* @__PURE__ */
|
|
8564
|
-
/* @__PURE__ */
|
|
8616
|
+
return /* @__PURE__ */ jsxs74("div", { className: `ss-w-lb2-row${isMe ? " ss-w-lb2-row--you" : ""}`, children: [
|
|
8617
|
+
/* @__PURE__ */ jsxs74("span", { className: rankClass, children: [
|
|
8565
8618
|
"#",
|
|
8566
8619
|
row.rank
|
|
8567
8620
|
] }),
|
|
8568
|
-
/* @__PURE__ */
|
|
8569
|
-
/* @__PURE__ */
|
|
8570
|
-
row.currentStreak > 0 && /* @__PURE__ */
|
|
8621
|
+
/* @__PURE__ */ jsx88("span", { className: "ss-w-lb2-handle", children: row.handle }),
|
|
8622
|
+
/* @__PURE__ */ jsx88("span", { className: "ss-w-lb2-points", children: formatPoints(row.points) }),
|
|
8623
|
+
row.currentStreak > 0 && /* @__PURE__ */ jsxs74("span", { className: "ss-w-lb2-streak", children: [
|
|
8571
8624
|
"\u{1F525} ",
|
|
8572
8625
|
row.currentStreak
|
|
8573
8626
|
] })
|
|
@@ -8578,18 +8631,18 @@ function LeaderboardAllTimeRow({
|
|
|
8578
8631
|
isMe
|
|
8579
8632
|
}) {
|
|
8580
8633
|
const rankClass = `ss-w-lb2-rank${row.rank <= 3 ? " ss-w-lb2-rank--top3" : ""}`;
|
|
8581
|
-
return /* @__PURE__ */
|
|
8582
|
-
/* @__PURE__ */
|
|
8634
|
+
return /* @__PURE__ */ jsxs74("div", { className: `ss-w-lb2-row${isMe ? " ss-w-lb2-row--you" : ""}`, children: [
|
|
8635
|
+
/* @__PURE__ */ jsxs74("span", { className: rankClass, children: [
|
|
8583
8636
|
"#",
|
|
8584
8637
|
row.rank
|
|
8585
8638
|
] }),
|
|
8586
|
-
/* @__PURE__ */
|
|
8587
|
-
/* @__PURE__ */
|
|
8639
|
+
/* @__PURE__ */ jsx88("span", { className: "ss-w-lb2-handle", children: row.handle }),
|
|
8640
|
+
/* @__PURE__ */ jsx88("span", { className: "ss-w-lb2-points", children: formatPoints(row.allTimePoints) })
|
|
8588
8641
|
] });
|
|
8589
8642
|
}
|
|
8590
8643
|
|
|
8591
8644
|
// src/components/LeaderboardEmpty.tsx
|
|
8592
|
-
import { jsx as
|
|
8645
|
+
import { jsx as jsx89, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
8593
8646
|
function LeaderboardEmpty({
|
|
8594
8647
|
segment,
|
|
8595
8648
|
lastWeek,
|
|
@@ -8598,36 +8651,36 @@ function LeaderboardEmpty({
|
|
|
8598
8651
|
ui
|
|
8599
8652
|
}) {
|
|
8600
8653
|
if (segment === "alltime") {
|
|
8601
|
-
return /* @__PURE__ */
|
|
8602
|
-
/* @__PURE__ */
|
|
8603
|
-
/* @__PURE__ */
|
|
8654
|
+
return /* @__PURE__ */ jsxs75("div", { className: "ss-w-lb-empty ss-w-lb-empty--alltime", children: [
|
|
8655
|
+
/* @__PURE__ */ jsx89("div", { className: "ss-w-lb-empty-icon", "aria-hidden": "true", children: "\u{1F4CA}" }),
|
|
8656
|
+
/* @__PURE__ */ jsx89("p", { className: "ss-w-lb-empty-body", children: ui.leaderboardAllTimeEmpty })
|
|
8604
8657
|
] });
|
|
8605
8658
|
}
|
|
8606
8659
|
const fresh = lastWeek != null;
|
|
8607
8660
|
const title = fresh ? ui.leaderboardEmptyFreshTitle : ui.leaderboardEmptyColdTitle;
|
|
8608
8661
|
const body = fresh ? ui.leaderboardEmptyFreshBody : ui.leaderboardEmptyColdBody;
|
|
8609
|
-
return /* @__PURE__ */
|
|
8610
|
-
weeklyPrize && /* @__PURE__ */
|
|
8611
|
-
/* @__PURE__ */
|
|
8612
|
-
/* @__PURE__ */
|
|
8662
|
+
return /* @__PURE__ */ jsxs75("div", { className: "ss-w-lb-empty", children: [
|
|
8663
|
+
weeklyPrize && /* @__PURE__ */ jsxs75("div", { className: "ss-w-prize", children: [
|
|
8664
|
+
/* @__PURE__ */ jsx89("span", { className: "ss-w-prize-icon", "aria-hidden": "true", children: "\u{1F3C6}" }),
|
|
8665
|
+
/* @__PURE__ */ jsx89("div", { className: "ss-w-prize-body", children: /* @__PURE__ */ jsx89("span", { className: "ss-w-prize-text", children: weeklyPrize }) })
|
|
8613
8666
|
] }),
|
|
8614
|
-
/* @__PURE__ */
|
|
8615
|
-
/* @__PURE__ */
|
|
8616
|
-
/* @__PURE__ */
|
|
8617
|
-
/* @__PURE__ */
|
|
8618
|
-
onPlay && /* @__PURE__ */
|
|
8667
|
+
/* @__PURE__ */ jsxs75("div", { className: "ss-w-lb-empty-hero", children: [
|
|
8668
|
+
/* @__PURE__ */ jsx89("div", { className: "ss-w-lb-empty-icon", "aria-hidden": "true", children: fresh ? "\u{1F3C6}" : "\u{1F3AE}" }),
|
|
8669
|
+
/* @__PURE__ */ jsx89("h4", { className: "ss-w-lb-empty-title", children: title }),
|
|
8670
|
+
/* @__PURE__ */ jsx89("p", { className: "ss-w-lb-empty-body", children: body }),
|
|
8671
|
+
onPlay && /* @__PURE__ */ jsx89("button", { type: "button", className: "ss-w-lb-empty-cta", onClick: onPlay, children: ui.leaderboardEmptyCta })
|
|
8619
8672
|
] }),
|
|
8620
|
-
fresh && lastWeek && /* @__PURE__ */
|
|
8621
|
-
/* @__PURE__ */
|
|
8622
|
-
/* @__PURE__ */
|
|
8623
|
-
/* @__PURE__ */
|
|
8624
|
-
/* @__PURE__ */
|
|
8673
|
+
fresh && lastWeek && /* @__PURE__ */ jsxs75("div", { className: "ss-w-lb-last", children: [
|
|
8674
|
+
/* @__PURE__ */ jsx89("span", { className: "ss-w-lb-last-label", children: ui.leaderboardLastWeekLabel }),
|
|
8675
|
+
/* @__PURE__ */ jsx89("span", { className: "ss-w-lb-last-champ", "aria-hidden": "true", children: "\u{1F947}" }),
|
|
8676
|
+
/* @__PURE__ */ jsx89("span", { className: "ss-w-lb-last-handle", children: lastWeek.handle }),
|
|
8677
|
+
/* @__PURE__ */ jsx89("span", { className: "ss-w-lb-last-points", children: formatPoints(lastWeek.points) })
|
|
8625
8678
|
] })
|
|
8626
8679
|
] });
|
|
8627
8680
|
}
|
|
8628
8681
|
|
|
8629
8682
|
// src/components/Leaderboard.tsx
|
|
8630
|
-
import { Fragment as
|
|
8683
|
+
import { Fragment as Fragment20, jsx as jsx90, jsxs as jsxs76 } from "react/jsx-runtime";
|
|
8631
8684
|
function Leaderboard({
|
|
8632
8685
|
data,
|
|
8633
8686
|
ui,
|
|
@@ -8637,9 +8690,9 @@ function Leaderboard({
|
|
|
8637
8690
|
const myRow = segment === "weekly" ? data.myWeeklyRow : data.myAllTimeRow;
|
|
8638
8691
|
const offBoard = myRow !== null && myRow !== void 0 && myRow.rank === -1;
|
|
8639
8692
|
const isEmpty = segment === "weekly" ? data.weeklyTop.length === 0 : data.allTimeTop.length === 0;
|
|
8640
|
-
return /* @__PURE__ */
|
|
8641
|
-
/* @__PURE__ */
|
|
8642
|
-
/* @__PURE__ */
|
|
8693
|
+
return /* @__PURE__ */ jsxs76("div", { className: "ss-w-lb2", children: [
|
|
8694
|
+
/* @__PURE__ */ jsxs76("div", { className: "ss-w-seg", children: [
|
|
8695
|
+
/* @__PURE__ */ jsx90(
|
|
8643
8696
|
"button",
|
|
8644
8697
|
{
|
|
8645
8698
|
type: "button",
|
|
@@ -8649,7 +8702,7 @@ function Leaderboard({
|
|
|
8649
8702
|
children: ui.leaderboardThisWeek
|
|
8650
8703
|
}
|
|
8651
8704
|
),
|
|
8652
|
-
/* @__PURE__ */
|
|
8705
|
+
/* @__PURE__ */ jsx90(
|
|
8653
8706
|
"button",
|
|
8654
8707
|
{
|
|
8655
8708
|
type: "button",
|
|
@@ -8660,7 +8713,7 @@ function Leaderboard({
|
|
|
8660
8713
|
}
|
|
8661
8714
|
)
|
|
8662
8715
|
] }),
|
|
8663
|
-
isEmpty ? /* @__PURE__ */
|
|
8716
|
+
isEmpty ? /* @__PURE__ */ jsx90(
|
|
8664
8717
|
LeaderboardEmpty,
|
|
8665
8718
|
{
|
|
8666
8719
|
segment,
|
|
@@ -8669,15 +8722,15 @@ function Leaderboard({
|
|
|
8669
8722
|
onPlay,
|
|
8670
8723
|
ui
|
|
8671
8724
|
}
|
|
8672
|
-
) : /* @__PURE__ */
|
|
8673
|
-
/* @__PURE__ */
|
|
8725
|
+
) : /* @__PURE__ */ jsxs76(Fragment20, { children: [
|
|
8726
|
+
/* @__PURE__ */ jsx90("div", { className: "ss-w-lb2-rows", children: segment === "weekly" ? data.weeklyTop.map((row) => /* @__PURE__ */ jsx90(
|
|
8674
8727
|
LeaderboardWeeklyRow,
|
|
8675
8728
|
{
|
|
8676
8729
|
row,
|
|
8677
8730
|
isMe: row.operatorUserId === data.myWeeklyRow?.operatorUserId
|
|
8678
8731
|
},
|
|
8679
8732
|
row.operatorUserId
|
|
8680
|
-
)) : data.allTimeTop.map((row) => /* @__PURE__ */
|
|
8733
|
+
)) : data.allTimeTop.map((row) => /* @__PURE__ */ jsx90(
|
|
8681
8734
|
LeaderboardAllTimeRow,
|
|
8682
8735
|
{
|
|
8683
8736
|
row,
|
|
@@ -8685,18 +8738,18 @@ function Leaderboard({
|
|
|
8685
8738
|
},
|
|
8686
8739
|
row.operatorUserId
|
|
8687
8740
|
)) }),
|
|
8688
|
-
/* @__PURE__ */
|
|
8689
|
-
myRow != null && (offBoard ? /* @__PURE__ */
|
|
8690
|
-
segment === "weekly" && data.myWeeklyRow && /* @__PURE__ */
|
|
8691
|
-
segment === "alltime" && data.myAllTimeRow && /* @__PURE__ */
|
|
8741
|
+
/* @__PURE__ */ jsx90("div", { className: "ss-w-kitline", children: "\u{1F3BD}" }),
|
|
8742
|
+
myRow != null && (offBoard ? /* @__PURE__ */ jsx90("div", { className: "ss-w-lbgap", children: ui.leaderboardOffBoard }) : /* @__PURE__ */ jsxs76("div", { className: "ss-w-lb2-rows", children: [
|
|
8743
|
+
segment === "weekly" && data.myWeeklyRow && /* @__PURE__ */ jsx90(LeaderboardWeeklyRow, { row: data.myWeeklyRow, isMe: true }),
|
|
8744
|
+
segment === "alltime" && data.myAllTimeRow && /* @__PURE__ */ jsx90(LeaderboardAllTimeRow, { row: data.myAllTimeRow, isMe: true })
|
|
8692
8745
|
] })),
|
|
8693
|
-
segment === "alltime" && data.myAllTimeRow && !offBoard && /* @__PURE__ */
|
|
8746
|
+
segment === "alltime" && data.myAllTimeRow && !offBoard && /* @__PURE__ */ jsx90("div", { className: "ss-w-lb2-rows", children: /* @__PURE__ */ jsx90("div", { className: "ss-w-lb2-row", children: /* @__PURE__ */ jsx90("span", { className: "ss-w-lb2-handle", children: formatPoints(data.allTimeTop.reduce((s, r) => s + r.allTimePoints, 0)) }) }) })
|
|
8694
8747
|
] })
|
|
8695
8748
|
] });
|
|
8696
8749
|
}
|
|
8697
8750
|
|
|
8698
8751
|
// src/components/LeaderboardPanel.tsx
|
|
8699
|
-
import { jsx as
|
|
8752
|
+
import { jsx as jsx91 } from "react/jsx-runtime";
|
|
8700
8753
|
var EMPTY_PAYLOAD = {
|
|
8701
8754
|
week: "",
|
|
8702
8755
|
weeklyTop: [],
|
|
@@ -8707,19 +8760,19 @@ var EMPTY_PAYLOAD = {
|
|
|
8707
8760
|
lastWeek: null
|
|
8708
8761
|
};
|
|
8709
8762
|
function LeaderboardPanel({ loggedIn, data, loading, onPlay, ui }) {
|
|
8710
|
-
if (!loggedIn) return /* @__PURE__ */
|
|
8711
|
-
if (data === null && loading) return /* @__PURE__ */
|
|
8712
|
-
return /* @__PURE__ */
|
|
8763
|
+
if (!loggedIn) return /* @__PURE__ */ jsx91(GamesLoginWall, { ui });
|
|
8764
|
+
if (data === null && loading) return /* @__PURE__ */ jsx91("div", { className: "ss-w-mon-list" });
|
|
8765
|
+
return /* @__PURE__ */ jsx91("div", { className: "ss-w-mon-list", children: /* @__PURE__ */ jsx91(Leaderboard, { data: data ?? EMPTY_PAYLOAD, ui, onPlay }) });
|
|
8713
8766
|
}
|
|
8714
8767
|
|
|
8715
8768
|
// src/components/PresetSpeedDial.tsx
|
|
8716
8769
|
import { useId as useId9 } from "react";
|
|
8717
|
-
import { jsx as
|
|
8770
|
+
import { jsx as jsx92, jsxs as jsxs77 } from "react/jsx-runtime";
|
|
8718
8771
|
function PresetSpeedDial({ expanded, showDot, strings, onToggle, onOpen, rootRef, buttonRef }) {
|
|
8719
8772
|
const pillsId = useId9();
|
|
8720
8773
|
const tabIndex = expanded ? 0 : -1;
|
|
8721
|
-
return /* @__PURE__ */
|
|
8722
|
-
/* @__PURE__ */
|
|
8774
|
+
return /* @__PURE__ */ jsxs77("div", { ref: rootRef, className: "ss-w-dial", children: [
|
|
8775
|
+
/* @__PURE__ */ jsxs77(
|
|
8723
8776
|
"button",
|
|
8724
8777
|
{
|
|
8725
8778
|
ref: buttonRef,
|
|
@@ -8730,36 +8783,36 @@ function PresetSpeedDial({ expanded, showDot, strings, onToggle, onOpen, rootRef
|
|
|
8730
8783
|
"aria-label": strings.dialName,
|
|
8731
8784
|
onClick: onToggle,
|
|
8732
8785
|
children: [
|
|
8733
|
-
/* @__PURE__ */
|
|
8734
|
-
/* @__PURE__ */
|
|
8735
|
-
showDot && !expanded ? /* @__PURE__ */
|
|
8786
|
+
/* @__PURE__ */ jsx92("span", { className: "ss-w-dial-icon ss-w-dial-icon--open", children: /* @__PURE__ */ jsx92(SlidersIcon, {}) }),
|
|
8787
|
+
/* @__PURE__ */ jsx92("span", { className: "ss-w-dial-icon ss-w-dial-icon--close", children: /* @__PURE__ */ jsx92(CloseIcon, {}) }),
|
|
8788
|
+
showDot && !expanded ? /* @__PURE__ */ jsx92("span", { className: "ss-w-dial-dot", "aria-hidden": "true" }) : null
|
|
8736
8789
|
]
|
|
8737
8790
|
}
|
|
8738
8791
|
),
|
|
8739
|
-
/* @__PURE__ */
|
|
8740
|
-
/* @__PURE__ */
|
|
8741
|
-
/* @__PURE__ */
|
|
8742
|
-
/* @__PURE__ */
|
|
8792
|
+
/* @__PURE__ */ jsxs77("div", { id: pillsId, className: "ss-w-dial-pills", "data-open": expanded ? "" : void 0, children: [
|
|
8793
|
+
/* @__PURE__ */ jsxs77("button", { type: "button", className: "ss-w-dial-pill", tabIndex, onClick: () => onOpen("numbers"), children: [
|
|
8794
|
+
/* @__PURE__ */ jsx92(SlidersIcon, {}),
|
|
8795
|
+
/* @__PURE__ */ jsx92("span", { className: "ss-w-dial-pill-label", children: strings.setNumbers })
|
|
8743
8796
|
] }),
|
|
8744
|
-
/* @__PURE__ */
|
|
8745
|
-
/* @__PURE__ */
|
|
8746
|
-
/* @__PURE__ */
|
|
8797
|
+
/* @__PURE__ */ jsxs77("button", { type: "button", className: "ss-w-dial-pill", tabIndex, onClick: () => onOpen("combo"), children: [
|
|
8798
|
+
/* @__PURE__ */ jsx92(ComboIcon, {}),
|
|
8799
|
+
/* @__PURE__ */ jsx92("span", { className: "ss-w-dial-pill-label", children: strings.buildCombo })
|
|
8747
8800
|
] })
|
|
8748
8801
|
] })
|
|
8749
8802
|
] });
|
|
8750
8803
|
}
|
|
8751
8804
|
|
|
8752
8805
|
// src/components/PresetTools.tsx
|
|
8753
|
-
import { Fragment as
|
|
8754
|
-
import { Fragment as
|
|
8806
|
+
import { Fragment as Fragment21, useEffect as useEffect24, useId as useId10, useRef as useRef20, useState as useState41 } from "react";
|
|
8807
|
+
import { Fragment as Fragment22, jsx as jsx93, jsxs as jsxs78 } from "react/jsx-runtime";
|
|
8755
8808
|
var FOCUSABLE = 'button:not([disabled]), [href], input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
8756
8809
|
function PresetToolModal({ title, closeLabel, onClose, children, footer }) {
|
|
8757
|
-
const dialogRef =
|
|
8810
|
+
const dialogRef = useRef20(null);
|
|
8758
8811
|
const titleId = useId10();
|
|
8759
|
-
|
|
8812
|
+
useEffect24(() => {
|
|
8760
8813
|
dialogRef.current?.focus();
|
|
8761
8814
|
}, []);
|
|
8762
|
-
|
|
8815
|
+
useEffect24(() => {
|
|
8763
8816
|
const onKey = (e) => {
|
|
8764
8817
|
if (e.key !== "Escape") return;
|
|
8765
8818
|
e.stopPropagation();
|
|
@@ -8789,79 +8842,79 @@ function PresetToolModal({ title, closeLabel, onClose, children, footer }) {
|
|
|
8789
8842
|
first.focus();
|
|
8790
8843
|
}
|
|
8791
8844
|
};
|
|
8792
|
-
return /* @__PURE__ */
|
|
8793
|
-
/* @__PURE__ */
|
|
8794
|
-
/* @__PURE__ */
|
|
8795
|
-
/* @__PURE__ */
|
|
8845
|
+
return /* @__PURE__ */ jsx93("div", { className: "ss-w-tool-backdrop", children: /* @__PURE__ */ jsxs78("div", { ref: dialogRef, className: "ss-w-tool", role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, tabIndex: -1, onKeyDown: trapTab, children: [
|
|
8846
|
+
/* @__PURE__ */ jsxs78("div", { className: "ss-w-tool-head", children: [
|
|
8847
|
+
/* @__PURE__ */ jsx93("h2", { id: titleId, className: "ss-w-tool-title", children: title }),
|
|
8848
|
+
/* @__PURE__ */ jsx93("button", { type: "button", className: "ss-w-tool-close", "aria-label": closeLabel, onClick: onClose, children: /* @__PURE__ */ jsx93(CloseIcon, {}) })
|
|
8796
8849
|
] }),
|
|
8797
|
-
/* @__PURE__ */
|
|
8798
|
-
footer ? /* @__PURE__ */
|
|
8850
|
+
/* @__PURE__ */ jsx93("div", { className: "ss-w-tool-body", children }),
|
|
8851
|
+
footer ? /* @__PURE__ */ jsx93("div", { className: "ss-w-tool-foot", children: footer }) : null
|
|
8799
8852
|
] }) });
|
|
8800
8853
|
}
|
|
8801
8854
|
function fillTemplate(template, slots) {
|
|
8802
8855
|
return template.split(/(\{[a-z]+\})/).filter((part) => part !== "").map((part, i) => {
|
|
8803
8856
|
const key = /^\{([a-z]+)\}$/.exec(part)?.[1];
|
|
8804
|
-
return /* @__PURE__ */
|
|
8857
|
+
return /* @__PURE__ */ jsx93(Fragment21, { children: key !== void 0 && key in slots ? slots[key] : part }, i);
|
|
8805
8858
|
});
|
|
8806
8859
|
}
|
|
8807
8860
|
function NumberSelect({ current, choices: choices2, label, notToday, lockEmpty = true, onChoose }) {
|
|
8808
8861
|
const selected = Math.max(0, choices2.findIndex((c) => c.text === current));
|
|
8809
|
-
return /* @__PURE__ */
|
|
8810
|
-
/* @__PURE__ */
|
|
8811
|
-
/* @__PURE__ */
|
|
8862
|
+
return /* @__PURE__ */ jsxs78("span", { className: "ss-w-tool-num", children: [
|
|
8863
|
+
/* @__PURE__ */ jsx93("span", { className: "ss-w-tool-num-size", "aria-hidden": "true", children: current }),
|
|
8864
|
+
/* @__PURE__ */ jsx93("select", { className: "ss-w-tool-num-select", "aria-label": label, value: String(selected), onChange: (e) => {
|
|
8812
8865
|
const c = choices2[Number(e.target.value)];
|
|
8813
8866
|
if (c) onChoose(c.value);
|
|
8814
|
-
}, children: choices2.map((c, i) => /* @__PURE__ */
|
|
8867
|
+
}, children: choices2.map((c, i) => /* @__PURE__ */ jsx93("option", { value: String(i), disabled: lockEmpty && !c.available && i !== selected, children: c.available ? c.text : `${c.text}${notToday}` }, i)) })
|
|
8815
8868
|
] });
|
|
8816
8869
|
}
|
|
8817
8870
|
function ChoiceSelect({ currentIdx, sizeLabels, optionLabels, label, onChoose }) {
|
|
8818
8871
|
const sizeText = sizeLabels[currentIdx] ?? "";
|
|
8819
|
-
return /* @__PURE__ */
|
|
8820
|
-
/* @__PURE__ */
|
|
8821
|
-
/* @__PURE__ */
|
|
8872
|
+
return /* @__PURE__ */ jsxs78("span", { className: "ss-w-tool-num", children: [
|
|
8873
|
+
/* @__PURE__ */ jsx93("span", { className: "ss-w-tool-num-size", "aria-hidden": "true", children: sizeText }),
|
|
8874
|
+
/* @__PURE__ */ jsx93("select", { className: "ss-w-tool-num-select", "aria-label": label, value: String(currentIdx), onChange: (e) => onChoose(Number(e.target.value)), children: optionLabels.map((opt, i) => /* @__PURE__ */ jsx93("option", { value: String(i), children: opt }, i)) })
|
|
8822
8875
|
] });
|
|
8823
8876
|
}
|
|
8824
8877
|
function SendButton({ label, display, disabled, onClick }) {
|
|
8825
|
-
return /* @__PURE__ */
|
|
8878
|
+
return /* @__PURE__ */ jsx93("button", { type: "button", className: "ss-w-tool-send", "aria-label": `${label}: ${display}`, disabled, onClick, children: label });
|
|
8826
8879
|
}
|
|
8827
8880
|
function PickList({ picks, formatKickoff }) {
|
|
8828
|
-
return /* @__PURE__ */
|
|
8829
|
-
/* @__PURE__ */
|
|
8881
|
+
return /* @__PURE__ */ jsx93("ul", { className: "ss-w-tool-picks", role: "list", children: picks.map((p) => /* @__PURE__ */ jsxs78("li", { className: "ss-w-tool-pick", children: [
|
|
8882
|
+
/* @__PURE__ */ jsxs78("span", { className: "ss-w-tool-pick-match", children: [
|
|
8830
8883
|
p.homeTeamName,
|
|
8831
8884
|
" \u2013 ",
|
|
8832
8885
|
p.awayTeamName
|
|
8833
8886
|
] }),
|
|
8834
|
-
/* @__PURE__ */
|
|
8887
|
+
/* @__PURE__ */ jsxs78("span", { className: "ss-w-tool-pick-sel", children: [
|
|
8835
8888
|
p.marketLabel,
|
|
8836
8889
|
": ",
|
|
8837
8890
|
p.selectionLabel,
|
|
8838
8891
|
p.line ? ` ${p.line}` : ""
|
|
8839
8892
|
] }),
|
|
8840
|
-
/* @__PURE__ */
|
|
8841
|
-
/* @__PURE__ */
|
|
8893
|
+
/* @__PURE__ */ jsx93("span", { className: "ss-w-tool-pick-kick", children: formatKickoff(p.kickoffUtc) }),
|
|
8894
|
+
/* @__PURE__ */ jsx93("span", { className: "ss-w-tool-pick-price", children: p.price.toFixed(2) })
|
|
8842
8895
|
] }, p.matchOddsId)) });
|
|
8843
8896
|
}
|
|
8844
8897
|
function ComboPreview({ cell, formatKickoff }) {
|
|
8845
|
-
return /* @__PURE__ */
|
|
8846
|
-
/* @__PURE__ */
|
|
8847
|
-
/* @__PURE__ */
|
|
8898
|
+
return /* @__PURE__ */ jsxs78(Fragment22, { children: [
|
|
8899
|
+
/* @__PURE__ */ jsx93(PickList, { picks: cell.combo.legs, formatKickoff }),
|
|
8900
|
+
/* @__PURE__ */ jsx93("div", { className: "ss-w-tool-math", children: cell.combo.multiplication })
|
|
8848
8901
|
] });
|
|
8849
8902
|
}
|
|
8850
8903
|
function Unavailable({ text }) {
|
|
8851
|
-
return /* @__PURE__ */
|
|
8904
|
+
return /* @__PURE__ */ jsx93("p", { className: "ss-w-tool-unavailable", children: text });
|
|
8852
8905
|
}
|
|
8853
8906
|
function AskRow({ icon, ask, ready, send }) {
|
|
8854
|
-
return /* @__PURE__ */
|
|
8855
|
-
/* @__PURE__ */
|
|
8856
|
-
/* @__PURE__ */
|
|
8857
|
-
/* @__PURE__ */
|
|
8858
|
-
ready ? /* @__PURE__ */
|
|
8907
|
+
return /* @__PURE__ */ jsxs78("section", { className: "ss-w-tool-row ss-w-tool-row--ask", children: [
|
|
8908
|
+
/* @__PURE__ */ jsx93("span", { className: "ss-w-tool-icon", "aria-hidden": "true", children: icon }),
|
|
8909
|
+
/* @__PURE__ */ jsxs78("div", { className: "ss-w-tool-main", children: [
|
|
8910
|
+
/* @__PURE__ */ jsx93("p", { className: "ss-w-tool-ask", children: ask }),
|
|
8911
|
+
ready ? /* @__PURE__ */ jsx93("span", { className: "ss-w-tool-ready", children: ready }) : null
|
|
8859
8912
|
] }),
|
|
8860
8913
|
send
|
|
8861
8914
|
] });
|
|
8862
8915
|
}
|
|
8863
8916
|
function RoundSend({ label, display, disabled, onClick }) {
|
|
8864
|
-
return /* @__PURE__ */
|
|
8917
|
+
return /* @__PURE__ */ jsx93("button", { type: "button", className: "ss-w-tool-go", "aria-label": `${label}: ${display}`, disabled, onClick, children: /* @__PURE__ */ jsx93(SendIcon, {}) });
|
|
8865
8918
|
}
|
|
8866
8919
|
var BIG_COMBO = { total: 50, legs: 6 };
|
|
8867
8920
|
function SetNumbersTool({ grid, strings, streaming, onSend, onClose }) {
|
|
@@ -8927,77 +8980,77 @@ function SetNumbersTool({ grid, strings, streaming, onSend, onClose }) {
|
|
|
8927
8980
|
const marketLabels = markets.map((c) => strings.marketShort(c.marketDeveloperName, c.marketLabel, c.selectionLabel ?? null));
|
|
8928
8981
|
const singlesReady = (cell) => cell ? strings.readyCount(cell.picks.length) : strings.unavailable;
|
|
8929
8982
|
const comboReady = (cell) => cell ? strings.readyAt(cell.combo.total) : strings.unavailable;
|
|
8930
|
-
return /* @__PURE__ */
|
|
8931
|
-
/* @__PURE__ */
|
|
8983
|
+
return /* @__PURE__ */ jsxs78(PresetToolModal, { title: strings.setNumbers, closeLabel: strings.close, onClose, children: [
|
|
8984
|
+
/* @__PURE__ */ jsx93(
|
|
8932
8985
|
AskRow,
|
|
8933
8986
|
{
|
|
8934
8987
|
icon: "\u{1F3AF}",
|
|
8935
8988
|
ask: fillTemplate(strings.maxPriceRow, {
|
|
8936
8989
|
count: String(count),
|
|
8937
|
-
price: /* @__PURE__ */
|
|
8990
|
+
price: /* @__PURE__ */ jsx93(NumberSelect, { current: maxPrice.toFixed(2), choices: maxChoices, label: strings.maxPriceName, notToday: strings.notToday, onChoose: chooseMax })
|
|
8938
8991
|
}),
|
|
8939
8992
|
ready: singlesReady(maxCell),
|
|
8940
|
-
send: /* @__PURE__ */
|
|
8993
|
+
send: /* @__PURE__ */ jsx93(RoundSend, { label: strings.send, display: strings.maxPriceDisplay(count, maxPrice), disabled: !maxCell || streaming, onClick: () => {
|
|
8941
8994
|
if (maxCell) onSend(maxPriceAsk(maxCell, strings));
|
|
8942
8995
|
} })
|
|
8943
8996
|
}
|
|
8944
8997
|
),
|
|
8945
|
-
/* @__PURE__ */
|
|
8998
|
+
/* @__PURE__ */ jsx93(
|
|
8946
8999
|
AskRow,
|
|
8947
9000
|
{
|
|
8948
9001
|
icon: "\u{1F4C8}",
|
|
8949
9002
|
ask: fillTemplate(strings.minPriceRow, {
|
|
8950
9003
|
count: String(count),
|
|
8951
|
-
price: /* @__PURE__ */
|
|
9004
|
+
price: /* @__PURE__ */ jsx93(NumberSelect, { current: minPrice.toFixed(2), choices: minChoices, label: strings.minPriceName, notToday: strings.notToday, onChoose: chooseMin })
|
|
8952
9005
|
}),
|
|
8953
9006
|
ready: singlesReady(minCell),
|
|
8954
|
-
send: /* @__PURE__ */
|
|
9007
|
+
send: /* @__PURE__ */ jsx93(RoundSend, { label: strings.send, display: strings.minPriceDisplay(count, minPrice), disabled: !minCell || streaming, onClick: () => {
|
|
8955
9008
|
if (minCell) onSend(minPriceAsk(minCell, strings));
|
|
8956
9009
|
} })
|
|
8957
9010
|
}
|
|
8958
9011
|
),
|
|
8959
|
-
/* @__PURE__ */
|
|
9012
|
+
/* @__PURE__ */ jsx93(
|
|
8960
9013
|
AskRow,
|
|
8961
9014
|
{
|
|
8962
9015
|
icon: "\u2728",
|
|
8963
9016
|
ask: fillTemplate(strings.comboRow, {
|
|
8964
|
-
legs: /* @__PURE__ */
|
|
8965
|
-
total: /* @__PURE__ */
|
|
9017
|
+
legs: /* @__PURE__ */ jsx93(NumberSelect, { current: String(legs), choices: legChoicesFor(total), label: strings.matchesLabel, notToday: strings.notToday, lockEmpty: false, onChoose: chooseLegs }),
|
|
9018
|
+
total: /* @__PURE__ */ jsx93(NumberSelect, { current: total.toFixed(1), choices: totalChoices, label: strings.totalLabel, notToday: strings.notToday, onChoose: chooseTotal })
|
|
8966
9019
|
}),
|
|
8967
9020
|
ready: comboReady(comboCell),
|
|
8968
|
-
send: /* @__PURE__ */
|
|
9021
|
+
send: /* @__PURE__ */ jsx93(RoundSend, { label: strings.send, display: strings.comboDisplay(legs, total), disabled: !comboCell || streaming, onClick: () => {
|
|
8969
9022
|
if (comboCell) onSend(comboAsk(comboCell, strings));
|
|
8970
9023
|
} })
|
|
8971
9024
|
}
|
|
8972
9025
|
),
|
|
8973
|
-
/* @__PURE__ */
|
|
9026
|
+
/* @__PURE__ */ jsx93(
|
|
8974
9027
|
AskRow,
|
|
8975
9028
|
{
|
|
8976
9029
|
icon: "\u{1F3C6}",
|
|
8977
9030
|
ask: fillTemplate(strings.bigComboRow, {
|
|
8978
|
-
legs: /* @__PURE__ */
|
|
8979
|
-
total: /* @__PURE__ */
|
|
9031
|
+
legs: /* @__PURE__ */ jsx93(NumberSelect, { current: String(bigLegs), choices: legChoicesFor(bigTotal), label: strings.matchesLabel, notToday: strings.notToday, lockEmpty: false, onChoose: chooseBigLegs }),
|
|
9032
|
+
total: /* @__PURE__ */ jsx93(NumberSelect, { current: bigTotal.toFixed(1), choices: totalChoices, label: strings.totalLabel, notToday: strings.notToday, onChoose: chooseBigTotal })
|
|
8980
9033
|
}),
|
|
8981
9034
|
ready: comboReady(bigCell),
|
|
8982
|
-
send: /* @__PURE__ */
|
|
9035
|
+
send: /* @__PURE__ */ jsx93(RoundSend, { label: strings.send, display: strings.comboDisplay(bigLegs, bigTotal), disabled: !bigCell || streaming, onClick: () => {
|
|
8983
9036
|
if (bigCell) onSend(comboAsk(bigCell, strings));
|
|
8984
9037
|
} })
|
|
8985
9038
|
}
|
|
8986
9039
|
),
|
|
8987
|
-
markets.length > 0 && /* @__PURE__ */
|
|
9040
|
+
markets.length > 0 && /* @__PURE__ */ jsx93(
|
|
8988
9041
|
AskRow,
|
|
8989
9042
|
{
|
|
8990
9043
|
icon: "\u26BD",
|
|
8991
9044
|
ask: fillTemplate(strings.marketRow, {
|
|
8992
|
-
market: /* @__PURE__ */
|
|
9045
|
+
market: /* @__PURE__ */ jsx93(ChoiceSelect, { currentIdx: marketIdx, sizeLabels: marketLabels, optionLabels: marketLabels, label: strings.marketName, onChoose: chooseMarket })
|
|
8993
9046
|
}),
|
|
8994
9047
|
ready: marketCell ? strings.readyCount(marketCell.count) : null,
|
|
8995
|
-
send: /* @__PURE__ */
|
|
9048
|
+
send: /* @__PURE__ */ jsx93(RoundSend, { label: strings.send, display: marketCell ? marketDisplay(marketCell, strings) : "", disabled: !marketCell || streaming, onClick: () => {
|
|
8996
9049
|
if (marketCell) onSend(marketAsk(marketCell, strings));
|
|
8997
9050
|
} })
|
|
8998
9051
|
}
|
|
8999
9052
|
),
|
|
9000
|
-
/* @__PURE__ */
|
|
9053
|
+
/* @__PURE__ */ jsx93("p", { className: "ss-w-vh", "aria-live": "polite", children: announcement })
|
|
9001
9054
|
] });
|
|
9002
9055
|
}
|
|
9003
9056
|
function BuildComboTool({ grid, strings, streaming, formatKickoff, initialTotal, initialLegs, onSend, onClose }) {
|
|
@@ -9021,29 +9074,29 @@ function BuildComboTool({ grid, strings, streaming, formatKickoff, initialTotal,
|
|
|
9021
9074
|
const d = strings.comboDisplay(nextLegs, nextTotal);
|
|
9022
9075
|
setAnnouncement(findCombo(grid, nextTotal, nextLegs) ? d : `${d}. ${strings.unavailable}`);
|
|
9023
9076
|
};
|
|
9024
|
-
const footer = /* @__PURE__ */
|
|
9077
|
+
const footer = /* @__PURE__ */ jsx93(SendButton, { label: strings.send, display, disabled: !cell || streaming, onClick: () => {
|
|
9025
9078
|
if (cell) onSend(comboAsk(cell, strings));
|
|
9026
9079
|
} });
|
|
9027
|
-
return /* @__PURE__ */
|
|
9028
|
-
/* @__PURE__ */
|
|
9029
|
-
/* @__PURE__ */
|
|
9030
|
-
/* @__PURE__ */
|
|
9080
|
+
return /* @__PURE__ */ jsxs78(PresetToolModal, { title: strings.buildCombo, closeLabel: strings.close, onClose, footer, children: [
|
|
9081
|
+
/* @__PURE__ */ jsxs78("div", { className: "ss-w-tool-section", role: "group", "aria-label": strings.totalLabel, children: [
|
|
9082
|
+
/* @__PURE__ */ jsx93("span", { className: "ss-w-tool-label", "aria-hidden": "true", children: strings.totalLabel }),
|
|
9083
|
+
/* @__PURE__ */ jsx93("div", { className: "ss-w-tool-chips", children: totals.map((t) => /* @__PURE__ */ jsx93("button", { type: "button", className: "ss-w-tool-chip", "aria-pressed": samePrice(t, total), onClick: () => choose(t, samePrice(t, total) ? legs : legsForTotal(grid, t, legs)), children: t.toFixed(1) }, t)) })
|
|
9031
9084
|
] }),
|
|
9032
|
-
/* @__PURE__ */
|
|
9033
|
-
/* @__PURE__ */
|
|
9034
|
-
/* @__PURE__ */
|
|
9035
|
-
/* @__PURE__ */
|
|
9036
|
-
/* @__PURE__ */
|
|
9037
|
-
/* @__PURE__ */
|
|
9085
|
+
/* @__PURE__ */ jsxs78("div", { className: "ss-w-tool-section", role: "group", "aria-label": strings.matchesLabel, children: [
|
|
9086
|
+
/* @__PURE__ */ jsx93("span", { className: "ss-w-tool-label", "aria-hidden": "true", children: strings.matchesLabel }),
|
|
9087
|
+
/* @__PURE__ */ jsxs78("div", { className: "ss-w-tool-stepper", children: [
|
|
9088
|
+
/* @__PURE__ */ jsx93("button", { type: "button", className: "ss-w-tool-step", "aria-label": strings.fewerMatches, disabled: legs <= minLegs, onClick: () => choose(total, legs - 1), children: "\u2212" }),
|
|
9089
|
+
/* @__PURE__ */ jsx93("span", { className: "ss-w-tool-count", children: legs }),
|
|
9090
|
+
/* @__PURE__ */ jsx93("button", { type: "button", className: "ss-w-tool-step", "aria-label": strings.moreMatches, disabled: legs >= maxLegs, onClick: () => choose(total, legs + 1), children: "+" })
|
|
9038
9091
|
] })
|
|
9039
9092
|
] }),
|
|
9040
|
-
cell ? /* @__PURE__ */
|
|
9041
|
-
/* @__PURE__ */
|
|
9093
|
+
cell ? /* @__PURE__ */ jsx93(ComboPreview, { cell, formatKickoff }) : /* @__PURE__ */ jsx93(Unavailable, { text: strings.unavailable }),
|
|
9094
|
+
/* @__PURE__ */ jsx93("p", { className: "ss-w-vh", "aria-live": "polite", children: announcement })
|
|
9042
9095
|
] });
|
|
9043
9096
|
}
|
|
9044
9097
|
|
|
9045
9098
|
// src/usePresetDial.ts
|
|
9046
|
-
import { useCallback as useCallback12, useEffect as
|
|
9099
|
+
import { useCallback as useCallback12, useEffect as useEffect25, useRef as useRef21, useState as useState42 } from "react";
|
|
9047
9100
|
function sendInFlight(messages, isStreaming) {
|
|
9048
9101
|
const last = messages[messages.length - 1];
|
|
9049
9102
|
return isStreaming && !!last && last.role === "assistant" && !last.done && !last.isGreeting;
|
|
@@ -9061,21 +9114,21 @@ function usePresetDial({ layerRef, dialRef, dialButtonRef, messages, isStreaming
|
|
|
9061
9114
|
const fold = useCallback12(() => setExpanded(false), []);
|
|
9062
9115
|
const toggle = useCallback12(() => setExpanded((e) => !e), []);
|
|
9063
9116
|
const currentUserId = lastUserId(messages);
|
|
9064
|
-
const userIdRef =
|
|
9065
|
-
|
|
9117
|
+
const userIdRef = useRef21(currentUserId);
|
|
9118
|
+
useEffect25(() => {
|
|
9066
9119
|
if (currentUserId === userIdRef.current) return;
|
|
9067
9120
|
userIdRef.current = currentUserId;
|
|
9068
9121
|
setExpanded(false);
|
|
9069
9122
|
}, [currentUserId]);
|
|
9070
|
-
const tabRef =
|
|
9071
|
-
|
|
9123
|
+
const tabRef = useRef21(activeTab);
|
|
9124
|
+
useEffect25(() => {
|
|
9072
9125
|
if (activeTab === tabRef.current) return;
|
|
9073
9126
|
tabRef.current = activeTab;
|
|
9074
9127
|
setExpanded(false);
|
|
9075
9128
|
}, [activeTab]);
|
|
9076
|
-
const expandedRef =
|
|
9129
|
+
const expandedRef = useRef21(expanded);
|
|
9077
9130
|
expandedRef.current = expanded;
|
|
9078
|
-
|
|
9131
|
+
useEffect25(() => {
|
|
9079
9132
|
const onEscape = (e) => {
|
|
9080
9133
|
const dial = dialRef.current;
|
|
9081
9134
|
if (e.key !== "Escape" || !dial || !e.composedPath().includes(dial)) return;
|
|
@@ -9088,7 +9141,7 @@ function usePresetDial({ layerRef, dialRef, dialButtonRef, messages, isStreaming
|
|
|
9088
9141
|
window.addEventListener("keydown", onEscape, true);
|
|
9089
9142
|
return () => window.removeEventListener("keydown", onEscape, true);
|
|
9090
9143
|
}, [dialRef, dialButtonRef]);
|
|
9091
|
-
|
|
9144
|
+
useEffect25(() => {
|
|
9092
9145
|
if (!expanded) return;
|
|
9093
9146
|
const layer = layerRef.current;
|
|
9094
9147
|
const inDial = (e) => {
|
|
@@ -9140,11 +9193,11 @@ function markToolSeen() {
|
|
|
9140
9193
|
}
|
|
9141
9194
|
|
|
9142
9195
|
// src/components/ChatPanel.tsx
|
|
9143
|
-
import { jsx as
|
|
9196
|
+
import { jsx as jsx94, jsxs as jsxs79 } from "react/jsx-runtime";
|
|
9144
9197
|
var FULLSCREEN_QUERY = "(max-width: 639px)";
|
|
9145
9198
|
function useIsModal() {
|
|
9146
9199
|
const [modal, setModal] = useState43(false);
|
|
9147
|
-
|
|
9200
|
+
useEffect26(() => {
|
|
9148
9201
|
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
|
|
9149
9202
|
const mql = window.matchMedia(FULLSCREEN_QUERY);
|
|
9150
9203
|
const sync = () => setModal(mql.matches);
|
|
@@ -9158,7 +9211,7 @@ var HIDDEN_LAYER_STYLE = { position: "absolute", inset: 0, visibility: "hidden",
|
|
|
9158
9211
|
function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, gamesResult, leaderboardResult, loggedIn, conversation, presetGrid }) {
|
|
9159
9212
|
const { state, close, stop, send, reset } = controller;
|
|
9160
9213
|
const isModal = useIsModal();
|
|
9161
|
-
|
|
9214
|
+
useEffect26(() => {
|
|
9162
9215
|
const onKey = (e) => {
|
|
9163
9216
|
if (e.key === "Escape") close();
|
|
9164
9217
|
};
|
|
@@ -9173,15 +9226,15 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
9173
9226
|
monitor?.setActiveTab("chat");
|
|
9174
9227
|
send(text, { grounding });
|
|
9175
9228
|
};
|
|
9176
|
-
|
|
9229
|
+
useEffect26(() => {
|
|
9177
9230
|
if (monitor && monitor.activeTab !== "chat" && state.isStreaming) monitor.markChatActivity();
|
|
9178
9231
|
}, [monitor, state.isStreaming, state.messages.length]);
|
|
9179
9232
|
const onChatTab = !monitor || monitor.activeTab === "chat";
|
|
9180
|
-
const layerRef =
|
|
9181
|
-
const dialRef =
|
|
9182
|
-
const dialButtonRef =
|
|
9183
|
-
const inputRef =
|
|
9184
|
-
const focusAfterCloseRef =
|
|
9233
|
+
const layerRef = useRef22(null);
|
|
9234
|
+
const dialRef = useRef22(null);
|
|
9235
|
+
const dialButtonRef = useRef22(null);
|
|
9236
|
+
const inputRef = useRef22(null);
|
|
9237
|
+
const focusAfterCloseRef = useRef22(null);
|
|
9185
9238
|
const [tool, setTool] = useState43(null);
|
|
9186
9239
|
const [toolSeen, setToolSeen] = useState43(readToolSeen);
|
|
9187
9240
|
const dial = usePresetDial({
|
|
@@ -9219,20 +9272,20 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
9219
9272
|
const k = ui.bettingKickoff(kickoffUtc);
|
|
9220
9273
|
return `${k.dayLabel} ${k.time}`;
|
|
9221
9274
|
}, [ui]);
|
|
9222
|
-
|
|
9275
|
+
useEffect26(() => {
|
|
9223
9276
|
if (tool) return;
|
|
9224
9277
|
const target = focusAfterCloseRef.current;
|
|
9225
9278
|
focusAfterCloseRef.current = null;
|
|
9226
9279
|
if (target === "dial") dialButtonRef.current?.focus();
|
|
9227
9280
|
else if (target === "composer") inputRef.current?.focus();
|
|
9228
9281
|
}, [tool]);
|
|
9229
|
-
|
|
9282
|
+
useEffect26(() => {
|
|
9230
9283
|
if (!tool || onChatTab && presetGrid) return;
|
|
9231
9284
|
focusAfterCloseRef.current = "composer";
|
|
9232
9285
|
setTool(null);
|
|
9233
9286
|
}, [tool, onChatTab, presetGrid]);
|
|
9234
|
-
return /* @__PURE__ */
|
|
9235
|
-
/* @__PURE__ */
|
|
9287
|
+
return /* @__PURE__ */ jsxs79("div", { className: "ss-w-panel", role: "dialog", "aria-modal": isModal, "aria-label": ui.chatDialogLabel, children: [
|
|
9288
|
+
/* @__PURE__ */ jsx94(
|
|
9236
9289
|
ChatHeader,
|
|
9237
9290
|
{
|
|
9238
9291
|
onClose: close,
|
|
@@ -9245,7 +9298,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
9245
9298
|
moreOptionsLabel: ui.moreOptions
|
|
9246
9299
|
}
|
|
9247
9300
|
),
|
|
9248
|
-
monitor && /* @__PURE__ */
|
|
9301
|
+
monitor && /* @__PURE__ */ jsx94(
|
|
9249
9302
|
TabBar,
|
|
9250
9303
|
{
|
|
9251
9304
|
monitor,
|
|
@@ -9257,9 +9310,9 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
9257
9310
|
gamesEnabled: gamesResult?.enabled ?? false
|
|
9258
9311
|
}
|
|
9259
9312
|
),
|
|
9260
|
-
/* @__PURE__ */
|
|
9261
|
-
/* @__PURE__ */
|
|
9262
|
-
showDial ? /* @__PURE__ */
|
|
9313
|
+
/* @__PURE__ */ jsxs79("div", { ref: layerRef, className: "ss-w-chat-layer", "data-dial": presetGrid ? "" : void 0, style: onChatTab ? void 0 : HIDDEN_LAYER_STYLE, children: [
|
|
9314
|
+
/* @__PURE__ */ jsx94(PresetToolsContext.Provider, { value: toolsValue, children: /* @__PURE__ */ jsx94(MessageList, { controller, ui, slip, onDashboardTap, monitor }) }),
|
|
9315
|
+
showDial ? /* @__PURE__ */ jsx94(
|
|
9263
9316
|
PresetSpeedDial,
|
|
9264
9317
|
{
|
|
9265
9318
|
expanded: dial.expanded,
|
|
@@ -9271,12 +9324,12 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
9271
9324
|
buttonRef: dialButtonRef
|
|
9272
9325
|
}
|
|
9273
9326
|
) : null,
|
|
9274
|
-
tool && presetGrid && onChatTab ? tool.kind === "numbers" ? /* @__PURE__ */
|
|
9327
|
+
tool && presetGrid && onChatTab ? tool.kind === "numbers" ? /* @__PURE__ */ jsx94(SetNumbersTool, { grid: presetGrid, strings: ui.presets, streaming: state.isStreaming, onSend: sendAsk, onClose: closeTool }) : /* @__PURE__ */ jsx94(BuildComboTool, { grid: presetGrid, strings: ui.presets, streaming: state.isStreaming, formatKickoff, initialTotal: tool.total, initialLegs: tool.legs, onSend: sendAsk, onClose: closeTool }) : null
|
|
9275
9328
|
] }),
|
|
9276
|
-
monitor && discovery && monitor.activeTab === "today" && /* @__PURE__ */
|
|
9277
|
-
monitor && monitor.activeTab === "following" && /* @__PURE__ */
|
|
9278
|
-
monitor && monitor.activeTab === "odds" && /* @__PURE__ */
|
|
9279
|
-
monitor && monitor.activeTab === "games" && gamesResult && /* @__PURE__ */
|
|
9329
|
+
monitor && discovery && monitor.activeTab === "today" && /* @__PURE__ */ jsx94(TodayPanel, { discovery, ui, monitor }),
|
|
9330
|
+
monitor && monitor.activeTab === "following" && /* @__PURE__ */ jsx94(MatchesPanel, { monitor, ui, slip, onAsk: handleAsk }),
|
|
9331
|
+
monitor && monitor.activeTab === "odds" && /* @__PURE__ */ jsx94(OddsPanel, { monitor, ui, slip }),
|
|
9332
|
+
monitor && monitor.activeTab === "games" && gamesResult && /* @__PURE__ */ jsx94(
|
|
9280
9333
|
GamesPanel,
|
|
9281
9334
|
{
|
|
9282
9335
|
loggedIn: !!loggedIn,
|
|
@@ -9290,7 +9343,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
9290
9343
|
}
|
|
9291
9344
|
}
|
|
9292
9345
|
),
|
|
9293
|
-
monitor && monitor.activeTab === "leaderboard" && leaderboardResult && /* @__PURE__ */
|
|
9346
|
+
monitor && monitor.activeTab === "leaderboard" && leaderboardResult && /* @__PURE__ */ jsx94(
|
|
9294
9347
|
LeaderboardPanel,
|
|
9295
9348
|
{
|
|
9296
9349
|
loggedIn: !!loggedIn,
|
|
@@ -9300,7 +9353,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
9300
9353
|
ui
|
|
9301
9354
|
}
|
|
9302
9355
|
),
|
|
9303
|
-
(!monitor || monitor.activeTab !== "games" && monitor.activeTab !== "leaderboard") && /* @__PURE__ */
|
|
9356
|
+
(!monitor || monitor.activeTab !== "games" && monitor.activeTab !== "leaderboard") && /* @__PURE__ */ jsx94(
|
|
9304
9357
|
ChatInput,
|
|
9305
9358
|
{
|
|
9306
9359
|
ref: inputRef,
|
|
@@ -9318,9 +9371,9 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
9318
9371
|
}
|
|
9319
9372
|
|
|
9320
9373
|
// src/components/HostEventsProvider.tsx
|
|
9321
|
-
import { jsx as
|
|
9374
|
+
import { jsx as jsx95 } from "react/jsx-runtime";
|
|
9322
9375
|
function HostEventsProvider({ value, children }) {
|
|
9323
|
-
return /* @__PURE__ */
|
|
9376
|
+
return /* @__PURE__ */ jsx95(SlipStateContext.Provider, { value: value.slipState, children });
|
|
9324
9377
|
}
|
|
9325
9378
|
|
|
9326
9379
|
// src/styles/css.generated.ts
|
|
@@ -10965,10 +11018,41 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
10965
11018
|
.ss-g-motm-pill { flex: none; padding: 3px 8px; font-size: 11px; }
|
|
10966
11019
|
.ss-g-motm-foot { font-size: 14px; font-weight: 600; }
|
|
10967
11020
|
.ss-g-motm-fun { font-size: 11px; color: var(--ss-g-faint); }
|
|
11021
|
+
|
|
11022
|
+
/* \u2500\u2500 tap-to-answer tray + per-game team-colour band (u503) \u2500\u2500 */
|
|
11023
|
+
.ss-g-tray { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-height: 150px; overflow-y: auto; overscroll-behavior: contain; padding: 2px; }
|
|
11024
|
+
.ss-g-tray-chip { display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 78px; padding: 6px 4px; border: 1px solid var(--ss-g-line); border-radius: 14px; background: var(--ss-g-surface); color: var(--ss-g-ink); font-family: var(--ss-g-font-body); cursor: pointer; }
|
|
11025
|
+
.ss-g-tray-chip:hover, .ss-g-tray-chip:focus-visible { background: var(--ss-g-raised); border-color: var(--ss-w-accent); outline: none; }
|
|
11026
|
+
.ss-g-tray-chip:disabled { opacity: .5; cursor: default; }
|
|
11027
|
+
.ss-g-tray-av { width: 38px; height: 38px; flex: none; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--ss-g-raised); color: var(--ss-g-muted); font-size: 14px; font-weight: 700; }
|
|
11028
|
+
.ss-g-tray-av img { width: 100%; height: 100%; object-fit: cover; }
|
|
11029
|
+
.ss-g-tray-name { width: 100%; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
|
|
11030
|
+
.ss-g-tray-first { max-width: 100%; font-size: 10px; font-weight: 500; color: var(--ss-g-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
11031
|
+
.ss-g-tray-last { max-width: 100%; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
11032
|
+
|
|
11033
|
+
/* Each game gets its own band colour: the operator accent mixed into the ground, hue-nudged per game.
|
|
11034
|
+
Browsers without relative colour syntax keep the plain accent mix. */
|
|
11035
|
+
.ss-g-screen[data-game] { --ss-g-band: color-mix(in srgb, var(--ss-w-accent) var(--ss-g-band-mix, 18%), var(--ss-g-ground)); }
|
|
11036
|
+
@supports (color: oklch(from red l c h)) {
|
|
11037
|
+
.ss-g-screen[data-game] { --ss-g-band: oklch(from color-mix(in srgb, var(--ss-w-accent) var(--ss-g-band-mix, 18%), var(--ss-g-ground)) l calc(c * 1.5) calc(h + var(--ss-g-hue-shift, 0))); }
|
|
11038
|
+
}
|
|
11039
|
+
.ss-g-screen[data-game="mystery-tiger"] { --ss-g-band-mix: 14%; --ss-g-hue-shift: 0; }
|
|
11040
|
+
.ss-g-screen[data-game="career-path"] { --ss-g-band-mix: 11%; --ss-g-hue-shift: -24; }
|
|
11041
|
+
.ss-g-screen[data-game] > .ss-g-head { background: var(--ss-g-band); border-radius: 0 0 24px 24px; padding-bottom: 12px; }
|
|
11042
|
+
.ss-g-worth { flex: none; display: flex; align-items: baseline; gap: 10px; font-size: 13px; color: var(--ss-g-muted); }
|
|
11043
|
+
.ss-g-worth-now { font-family: var(--ss-g-font-display); font-weight: 800; font-size: 18px; letter-spacing: .02em; text-transform: uppercase; color: var(--ss-w-accent); }
|
|
11044
|
+
.ss-g-screen[data-game="beat-the-grid"] { --ss-g-band-mix: 13%; --ss-g-hue-shift: 14; }
|
|
11045
|
+
.ss-g-screen[data-game="guess-the-xi"] { --ss-g-band-mix: 12%; --ss-g-hue-shift: -36; }
|
|
11046
|
+
.ss-g-screen[data-game="higher-or-lower"] { --ss-g-band-mix: 16%; --ss-g-hue-shift: 28; }
|
|
11047
|
+
.ss-g-screen[data-game="daily-quiz"] { --ss-g-band-mix: 10%; --ss-g-hue-shift: -12; }
|
|
11048
|
+
.ss-g-screen[data-game="stat-ladder"] { --ss-g-band-mix: 15%; --ss-g-hue-shift: 36; }
|
|
11049
|
+
.ss-g-screen[data-game="matchday-predictor"] { --ss-g-band-mix: 18%; --ss-g-hue-shift: -4; }
|
|
11050
|
+
.ss-g-screen[data-game="starting-xi"] { --ss-g-band-mix: 9%; --ss-g-hue-shift: -30; }
|
|
11051
|
+
.ss-g-screen[data-game="fan-motm"] { --ss-g-band-mix: 14%; --ss-g-hue-shift: 8; }
|
|
10968
11052
|
`;
|
|
10969
11053
|
|
|
10970
11054
|
// src/StatsWidget.tsx
|
|
10971
|
-
import { jsx as
|
|
11055
|
+
import { jsx as jsx96 } from "react/jsx-runtime";
|
|
10972
11056
|
function buildClient(props) {
|
|
10973
11057
|
try {
|
|
10974
11058
|
if ("client" in props && props.client) {
|
|
@@ -11002,8 +11086,8 @@ function StatsWidget(props) {
|
|
|
11002
11086
|
[built?.client]
|
|
11003
11087
|
);
|
|
11004
11088
|
const ui = useMemo5(() => normalizeUi(props.config ?? { operatorId: "", publicKey: "" }), [props.config]);
|
|
11005
|
-
const rootRef =
|
|
11006
|
-
const introDoneRef =
|
|
11089
|
+
const rootRef = useRef23(null);
|
|
11090
|
+
const introDoneRef = useRef23(false);
|
|
11007
11091
|
const markIntroDone = useCallback14(() => {
|
|
11008
11092
|
introDoneRef.current = true;
|
|
11009
11093
|
}, []);
|
|
@@ -11052,11 +11136,11 @@ function StatsWidget(props) {
|
|
|
11052
11136
|
pinnedMatchIds
|
|
11053
11137
|
});
|
|
11054
11138
|
const todayHasContent = visibleGroupsOf(discovery.groups, discovery.states).length > 0;
|
|
11055
|
-
|
|
11139
|
+
useEffect27(() => {
|
|
11056
11140
|
setHasToday(todayHasContent);
|
|
11057
11141
|
}, [todayHasContent]);
|
|
11058
|
-
const prevLiveSnapshotRef =
|
|
11059
|
-
|
|
11142
|
+
const prevLiveSnapshotRef = useRef23(monitor.snapshot);
|
|
11143
|
+
useEffect27(() => {
|
|
11060
11144
|
const snap = monitor.snapshot;
|
|
11061
11145
|
if (!snap || snap === prevLiveSnapshotRef.current) return;
|
|
11062
11146
|
prevLiveSnapshotRef.current = snap;
|
|
@@ -11098,8 +11182,8 @@ function StatsWidget(props) {
|
|
|
11098
11182
|
);
|
|
11099
11183
|
const presetGrid = usePresetGrid({ getPricePresets, isOpen: controller.state.isOpen, locale: ui.presets.lang });
|
|
11100
11184
|
const markTodayActivity = monitor.markTodayActivity;
|
|
11101
|
-
const prevLiveCountRef =
|
|
11102
|
-
|
|
11185
|
+
const prevLiveCountRef = useRef23(0);
|
|
11186
|
+
useEffect27(() => {
|
|
11103
11187
|
const rose = prevLiveCountRef.current === 0 && discovery.liveCount > 0;
|
|
11104
11188
|
prevLiveCountRef.current = discovery.liveCount;
|
|
11105
11189
|
if (rose) markTodayActivity();
|
|
@@ -11137,6 +11221,7 @@ function StatsWidget(props) {
|
|
|
11137
11221
|
[built, logger]
|
|
11138
11222
|
);
|
|
11139
11223
|
const dismissPopup = usePopupTelemetry(logger, controller.state.isOpen, controller.state.popupText, controller.dismissPopup);
|
|
11224
|
+
useOpenTelemetry(logger, controller.state.isOpen);
|
|
11140
11225
|
const asks = bubbleAsks(controller.state.messages, ui.presets.standoutAsk).map((ask) => ({
|
|
11141
11226
|
label: ask.label,
|
|
11142
11227
|
onTap: () => runBubbleAsk(ask, {
|
|
@@ -11150,11 +11235,11 @@ function StatsWidget(props) {
|
|
|
11150
11235
|
const operatorUserId = cfg?.userContext?.operatorUserId;
|
|
11151
11236
|
const anonymousUserId = cfg?.userContext?.anonymousUserId;
|
|
11152
11237
|
const conversationId = controller.state.conversationId ?? void 0;
|
|
11153
|
-
|
|
11238
|
+
useEffect27(() => {
|
|
11154
11239
|
if (!logger) return;
|
|
11155
11240
|
logger.setIdentity({ operatorUserId, anonymousUserId, conversationId });
|
|
11156
11241
|
}, [logger, operatorUserId, anonymousUserId, conversationId]);
|
|
11157
|
-
|
|
11242
|
+
useEffect27(() => {
|
|
11158
11243
|
if (!logger) return;
|
|
11159
11244
|
logger.resume();
|
|
11160
11245
|
const onHide = () => {
|
|
@@ -11172,14 +11257,14 @@ function StatsWidget(props) {
|
|
|
11172
11257
|
logger.dispose();
|
|
11173
11258
|
};
|
|
11174
11259
|
}, [logger]);
|
|
11175
|
-
|
|
11260
|
+
useEffect27(() => {
|
|
11176
11261
|
if (!built || !ui.injectStyles) return;
|
|
11177
11262
|
const node = rootRef.current?.getRootNode();
|
|
11178
11263
|
if (node) injectStyles(node);
|
|
11179
11264
|
}, [built, ui.injectStyles]);
|
|
11180
11265
|
if (!built) return null;
|
|
11181
11266
|
const attrs = themeAttrs(ui);
|
|
11182
|
-
return /* @__PURE__ */
|
|
11267
|
+
return /* @__PURE__ */ jsx96(EventLogContext.Provider, { value: logger, children: /* @__PURE__ */ jsx96(HostEventsProvider, { value: hostEvents, children: /* @__PURE__ */ jsx96("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: controller.state.isOpen ? /* @__PURE__ */ jsx96(
|
|
11183
11268
|
ChatPanel,
|
|
11184
11269
|
{
|
|
11185
11270
|
controller,
|
|
@@ -11194,7 +11279,7 @@ function StatsWidget(props) {
|
|
|
11194
11279
|
conversation: built?.conversation ?? null,
|
|
11195
11280
|
presetGrid
|
|
11196
11281
|
}
|
|
11197
|
-
) : /* @__PURE__ */
|
|
11282
|
+
) : /* @__PURE__ */ jsx96(
|
|
11198
11283
|
ChatFab,
|
|
11199
11284
|
{
|
|
11200
11285
|
label: ui.launcherLabel,
|