@sensiblestats/widget-react 0.75.0 → 0.77.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 +12 -0
- package/dist/index.cjs +717 -641
- 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 +718 -642
- package/dist/index.js.map +1 -1
- package/dist/styles.css +31 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -192,7 +192,8 @@ var STRINGS = {
|
|
|
192
192
|
marketRow: "{market} picks today",
|
|
193
193
|
marketName: "Market",
|
|
194
194
|
marketShort: (dev, market, sel) => ({ BOTH_TEAMS_TO_SCORE: "BTTS", DOUBLE_CHANCE: "Double chance", FULLTIME_RESULT: "Match winner" })[dev] ?? (dev === "GOALS_OVER_UNDER" && sel ? sel : sel ? `${market} ${sel}` : market),
|
|
195
|
-
marketMessage: (market, sel, count) => `Show me ${count} ${sel ? `${market} \u2013 ${sel}` : market} picks
|
|
195
|
+
marketMessage: (market, sel, count) => `Show me ${count} ${sel ? `${market} \u2013 ${sel}` : market} picks.`,
|
|
196
|
+
standoutAsk: "Standout matches today"
|
|
196
197
|
},
|
|
197
198
|
games: {
|
|
198
199
|
lang: "en",
|
|
@@ -207,6 +208,8 @@ var STRINGS = {
|
|
|
207
208
|
statRank: "Rank",
|
|
208
209
|
unitDays: "days",
|
|
209
210
|
unitPts: "pts",
|
|
211
|
+
worthNow: (pts) => `Worth ${pts} pts now`,
|
|
212
|
+
worthAfterMiss: (pts) => `${pts} after a miss`,
|
|
210
213
|
thisWeek: "this week",
|
|
211
214
|
newToday: "New today",
|
|
212
215
|
resume: "Resume",
|
|
@@ -531,7 +534,8 @@ var STRINGS = {
|
|
|
531
534
|
marketRow: "Bug\xFCnk\xFC {market} se\xE7imleri",
|
|
532
535
|
marketName: "Bahis t\xFCr\xFC",
|
|
533
536
|
marketShort: (dev, market, sel) => ({ BOTH_TEAMS_TO_SCORE: "KG Var", DOUBLE_CHANCE: "\xC7ifte \u015Fans", FULLTIME_RESULT: "Ma\xE7 sonucu" })[dev] ?? (dev === "GOALS_OVER_UNDER" && sel ? sel : sel ? `${market} ${sel}` : market),
|
|
534
|
-
marketMessage: (market, sel, count) => `${count} ${sel ? `${market} \u2013 ${sel}` : market} se\xE7imi g\xF6ster
|
|
537
|
+
marketMessage: (market, sel, count) => `${count} ${sel ? `${market} \u2013 ${sel}` : market} se\xE7imi g\xF6ster.`,
|
|
538
|
+
standoutAsk: "Bug\xFCn\xFCn \xF6ne \xE7\u0131kan ma\xE7lar\u0131"
|
|
535
539
|
},
|
|
536
540
|
games: {
|
|
537
541
|
lang: "tr",
|
|
@@ -546,6 +550,8 @@ var STRINGS = {
|
|
|
546
550
|
statRank: "S\u0131ra",
|
|
547
551
|
unitDays: "g\xFCn",
|
|
548
552
|
unitPts: "puan",
|
|
553
|
+
worthNow: (pts) => `\u015Eimdi ${pts} puan`,
|
|
554
|
+
worthAfterMiss: (pts) => `yanl\u0131\u015Fta ${pts}`,
|
|
549
555
|
thisWeek: "bu hafta",
|
|
550
556
|
newToday: "Bug\xFCn yeni",
|
|
551
557
|
resume: "Devam et",
|
|
@@ -1992,18 +1998,23 @@ function tileDisplayText(tile) {
|
|
|
1992
1998
|
const subtitle = tile.subtitle?.trim();
|
|
1993
1999
|
return isPriceTile(tile) && subtitle ? subtitle : tile.title;
|
|
1994
2000
|
}
|
|
1995
|
-
var
|
|
1996
|
-
|
|
2001
|
+
var MAX_PRICE_TILE_ID = "goal-preset-max-price";
|
|
2002
|
+
var STANDOUT_TILE_ID = "goal-standout-matches";
|
|
2003
|
+
function bubbleAsks(messages, standoutLabel) {
|
|
1997
2004
|
for (let i = messages.length - 1; i >= 0; i--) {
|
|
1998
2005
|
const m = messages[i];
|
|
1999
2006
|
if (!m || m.role !== "assistant" || !m.isGreeting) continue;
|
|
2000
2007
|
const dashboard = m.greetingDashboard;
|
|
2001
|
-
if (!dashboard) return [];
|
|
2008
|
+
if (!dashboard || !dashboard.tiles.some(isPriceTile)) return [];
|
|
2002
2009
|
const asks = [];
|
|
2003
|
-
|
|
2004
|
-
const
|
|
2005
|
-
|
|
2006
|
-
|
|
2010
|
+
const add = (entityId, labelOf) => {
|
|
2011
|
+
const index = dashboard.tiles.findIndex((tile2) => tile2.signal?.entityId === entityId);
|
|
2012
|
+
const tile = dashboard.tiles[index];
|
|
2013
|
+
const label = tile ? labelOf(tile)?.trim() : void 0;
|
|
2014
|
+
if (tile && label) asks.push({ tile, index, position: asks.length, layout: dashboard.layout, label });
|
|
2015
|
+
};
|
|
2016
|
+
add(MAX_PRICE_TILE_ID, (tile) => tile.subtitle ?? void 0);
|
|
2017
|
+
add(STANDOUT_TILE_ID, () => standoutLabel);
|
|
2007
2018
|
return asks;
|
|
2008
2019
|
}
|
|
2009
2020
|
return [];
|
|
@@ -2012,7 +2023,7 @@ function runBubbleAsk(ask, deps) {
|
|
|
2012
2023
|
deps.log?.log({ name: "popup_ask_tap", outcome: String(ask.position) });
|
|
2013
2024
|
deps.open();
|
|
2014
2025
|
deps.setActiveTab("chat");
|
|
2015
|
-
const displayText =
|
|
2026
|
+
const displayText = ask.label;
|
|
2016
2027
|
deps.send(ask.tile.actionValue, ask.tile.actionRef ? { actionRef: ask.tile.actionRef, displayText } : { displayText });
|
|
2017
2028
|
deps.onDashboardTap?.(ask.tile, ask.index, ask.layout);
|
|
2018
2029
|
}
|
|
@@ -6416,53 +6427,104 @@ function SearchField({ id, label, labelHidden = false, placeholder, value, onCha
|
|
|
6416
6427
|
] });
|
|
6417
6428
|
}
|
|
6418
6429
|
|
|
6419
|
-
// src/components/games/ui/
|
|
6430
|
+
// src/components/games/ui/AnswerTray.tsx
|
|
6420
6431
|
var import_jsx_runtime67 = require("react/jsx-runtime");
|
|
6432
|
+
function AnswerTray({ id, label, placeholder, optionsLabel, options, query, onQuery, onPick, disabled, minQuery = 0 }) {
|
|
6433
|
+
const needle = query.trim().toLowerCase();
|
|
6434
|
+
const shown = needle.length < minQuery ? [] : needle ? options.filter((o) => o.name.toLowerCase().includes(needle)) : options;
|
|
6435
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
|
|
6436
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
|
|
6437
|
+
SearchField,
|
|
6438
|
+
{
|
|
6439
|
+
id,
|
|
6440
|
+
label,
|
|
6441
|
+
labelHidden: true,
|
|
6442
|
+
placeholder,
|
|
6443
|
+
value: query,
|
|
6444
|
+
onChange: onQuery,
|
|
6445
|
+
disabled
|
|
6446
|
+
}
|
|
6447
|
+
),
|
|
6448
|
+
shown.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { className: "ss-g-tray", role: "listbox", "aria-label": optionsLabel, children: shown.map((o) => {
|
|
6449
|
+
const { first, last } = splitName(o.name);
|
|
6450
|
+
return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
|
|
6451
|
+
"button",
|
|
6452
|
+
{
|
|
6453
|
+
type: "button",
|
|
6454
|
+
role: "option",
|
|
6455
|
+
"aria-selected": false,
|
|
6456
|
+
"aria-label": o.name,
|
|
6457
|
+
className: "ss-g-tray-chip",
|
|
6458
|
+
disabled,
|
|
6459
|
+
onClick: () => onPick(o.id),
|
|
6460
|
+
children: [
|
|
6461
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)(PlayerAvatar, { className: "ss-g-tray-av", name: o.name, imagePath: o.imagePath }),
|
|
6462
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsxs)("span", { className: "ss-g-tray-name", "aria-hidden": "true", children: [
|
|
6463
|
+
first && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "ss-g-tray-first", children: first }),
|
|
6464
|
+
/* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "ss-g-tray-last", children: last })
|
|
6465
|
+
] })
|
|
6466
|
+
]
|
|
6467
|
+
},
|
|
6468
|
+
o.id
|
|
6469
|
+
);
|
|
6470
|
+
}) })
|
|
6471
|
+
] });
|
|
6472
|
+
}
|
|
6473
|
+
|
|
6474
|
+
// src/components/games/ui/FooterBar.tsx
|
|
6475
|
+
var import_jsx_runtime68 = require("react/jsx-runtime");
|
|
6421
6476
|
function FooterBar({ children }) {
|
|
6422
|
-
return /* @__PURE__ */ (0,
|
|
6477
|
+
return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { className: "ss-g-footer", children });
|
|
6423
6478
|
}
|
|
6424
6479
|
|
|
6425
6480
|
// src/components/games/ui/Silhouette.tsx
|
|
6426
|
-
var
|
|
6481
|
+
var import_jsx_runtime69 = require("react/jsx-runtime");
|
|
6427
6482
|
function Silhouette({ size, variant = "default" }) {
|
|
6428
|
-
return /* @__PURE__ */ (0,
|
|
6429
|
-
/* @__PURE__ */ (0,
|
|
6430
|
-
/* @__PURE__ */ (0,
|
|
6431
|
-
/* @__PURE__ */ (0,
|
|
6483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("span", { className: `ss-g-sil ss-g-sil--${variant}`, style: { width: size, height: size }, "aria-hidden": "true", children: [
|
|
6484
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("svg", { width: size * 0.86, height: size * 0.86, viewBox: "0 0 100 100", children: [
|
|
6485
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("circle", { cx: "50", cy: "40", r: "19", fill: "currentColor" }),
|
|
6486
|
+
/* @__PURE__ */ (0, import_jsx_runtime69.jsx)("path", { d: "M12 100c0-23 17-38 38-38s38 15 38 38z", fill: "currentColor" })
|
|
6432
6487
|
] }),
|
|
6433
|
-
variant === "mystery" && /* @__PURE__ */ (0,
|
|
6488
|
+
variant === "mystery" && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("span", { className: "ss-g-sil-q", children: "?" })
|
|
6434
6489
|
] });
|
|
6435
6490
|
}
|
|
6436
6491
|
|
|
6437
6492
|
// src/components/games/ui/GameButton.tsx
|
|
6438
|
-
var
|
|
6493
|
+
var import_jsx_runtime70 = require("react/jsx-runtime");
|
|
6439
6494
|
function GameButton({ variant = "primary", block = false, className, type = "button", ...rest }) {
|
|
6440
6495
|
const cls = `ss-g-btn ss-g-btn--${variant}${block ? " ss-g-btn--block" : ""}${className ? ` ${className}` : ""}`;
|
|
6441
|
-
return /* @__PURE__ */ (0,
|
|
6496
|
+
return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("button", { type, className: cls, ...rest });
|
|
6442
6497
|
}
|
|
6443
6498
|
|
|
6444
6499
|
// src/components/games/ui/ResultCard.tsx
|
|
6445
|
-
var
|
|
6500
|
+
var import_jsx_runtime71 = require("react/jsx-runtime");
|
|
6446
6501
|
function ResultCard({ tone, title, score, detail, onBack, ui }) {
|
|
6447
|
-
return /* @__PURE__ */ (0,
|
|
6448
|
-
/* @__PURE__ */ (0,
|
|
6449
|
-
score !== void 0 && /* @__PURE__ */ (0,
|
|
6450
|
-
/* @__PURE__ */ (0,
|
|
6502
|
+
return /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "ss-g-result", "data-tone": tone, role: "status", children: [
|
|
6503
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "ss-g-result-title", children: title }),
|
|
6504
|
+
score !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("span", { className: "ss-g-result-score", children: [
|
|
6505
|
+
/* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "ss-g-result-num", children: score }),
|
|
6451
6506
|
ui.games.unitPts
|
|
6452
6507
|
] }),
|
|
6453
|
-
detail && /* @__PURE__ */ (0,
|
|
6454
|
-
onBack && /* @__PURE__ */ (0,
|
|
6508
|
+
detail && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("span", { className: "ss-g-result-detail", children: detail }),
|
|
6509
|
+
onBack && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(GameButton, { variant: "outline", onClick: onBack, children: ui.games.backToGames })
|
|
6455
6510
|
] });
|
|
6456
6511
|
}
|
|
6457
6512
|
|
|
6458
|
-
// src/components/games/ui/
|
|
6459
|
-
var
|
|
6460
|
-
function
|
|
6461
|
-
|
|
6513
|
+
// src/components/games/ui/PointsLadderRow.tsx
|
|
6514
|
+
var import_jsx_runtime72 = require("react/jsx-runtime");
|
|
6515
|
+
function PointsLadderRow({ ladder, guessesUsed, ui }) {
|
|
6516
|
+
if (!ladder || ladder.length === 0) return null;
|
|
6517
|
+
const now = ladder[Math.min(guessesUsed, ladder.length - 1)];
|
|
6518
|
+
const next = ladder[guessesUsed + 1];
|
|
6519
|
+
if (now === void 0) return null;
|
|
6520
|
+
return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)("div", { className: "ss-g-worth", "data-testid": "points-ladder", children: [
|
|
6521
|
+
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "ss-g-worth-now", children: ui.games.worthNow(now) }),
|
|
6522
|
+
next !== void 0 && next !== now && /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "ss-g-worth-next", children: ui.games.worthAfterMiss(next) })
|
|
6523
|
+
] });
|
|
6462
6524
|
}
|
|
6463
6525
|
|
|
6464
6526
|
// src/components/games/MysteryTigerGame.tsx
|
|
6465
|
-
var
|
|
6527
|
+
var import_jsx_runtime73 = require("react/jsx-runtime");
|
|
6466
6528
|
function parseClientState(json) {
|
|
6467
6529
|
if (!json) return null;
|
|
6468
6530
|
try {
|
|
@@ -6576,9 +6638,7 @@ function MysteryTigerGame({
|
|
|
6576
6638
|
const totalGuesses = clientState ? clientState.guessesUsed + clientState.guessesRemaining : MAX_GUESSES;
|
|
6577
6639
|
const score = result?.score ?? 0;
|
|
6578
6640
|
const revealName = isOver ? clientState?.revealedPlayerName : void 0;
|
|
6579
|
-
const
|
|
6580
|
-
(p) => !alreadyGuessedIds.has(p.id) && p.name.toLowerCase().includes(query.toLowerCase())
|
|
6581
|
-
) : [];
|
|
6641
|
+
const pool = config && !isOver ? config.squadPlayers.filter((p) => !alreadyGuessedIds.has(p.id)) : [];
|
|
6582
6642
|
function handleSelect(playerId) {
|
|
6583
6643
|
if (!config || isOver || submitting) return;
|
|
6584
6644
|
const prevGuesses = guessResults.map((g) => g.playerId);
|
|
@@ -6586,22 +6646,22 @@ function MysteryTigerGame({
|
|
|
6586
6646
|
setQuery("");
|
|
6587
6647
|
onSubmit(JSON.stringify({ guesses: newGuesses }));
|
|
6588
6648
|
}
|
|
6589
|
-
const headerRight = !config ? void 0 : isOver ? /* @__PURE__ */ (0,
|
|
6649
|
+
const headerRight = !config ? void 0 : isOver ? /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Chip, { variant: "accent", children: [
|
|
6590
6650
|
score,
|
|
6591
6651
|
" ",
|
|
6592
6652
|
ui.games.unitPts
|
|
6593
|
-
] }) : /* @__PURE__ */ (0,
|
|
6653
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { "data-testid": "mt-chip", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(Chip, { children: [
|
|
6594
6654
|
ui.games.guess,
|
|
6595
6655
|
" ",
|
|
6596
|
-
/* @__PURE__ */ (0,
|
|
6656
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "ss-g-num", children: guessesUsed + 1 }),
|
|
6597
6657
|
" / ",
|
|
6598
6658
|
totalGuesses
|
|
6599
6659
|
] }) });
|
|
6600
6660
|
const segments = Array.from({ length: totalGuesses }, (_, i) => i < guessesUsed ? "done" : i === guessesUsed ? "current" : "todo");
|
|
6601
6661
|
const cols = { gridTemplateColumns: `minmax(0, 1fr) repeat(${keys.length}, 42px)` };
|
|
6602
6662
|
const known = deriveKnownAttributes(guessResults, keys);
|
|
6603
|
-
return /* @__PURE__ */ (0,
|
|
6604
|
-
/* @__PURE__ */ (0,
|
|
6663
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "ss-g-screen ss-g-mt", "data-game": "mystery-tiger", "data-testid": "game-screen-mystery-tiger", children: [
|
|
6664
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
6605
6665
|
GameHeader,
|
|
6606
6666
|
{
|
|
6607
6667
|
title: gameTitle({ gameId: "mystery-tiger" }, ui.games.titles),
|
|
@@ -6611,40 +6671,41 @@ function MysteryTigerGame({
|
|
|
6611
6671
|
backLabel: ui.back
|
|
6612
6672
|
}
|
|
6613
6673
|
),
|
|
6614
|
-
!config && /* @__PURE__ */ (0,
|
|
6615
|
-
config && /* @__PURE__ */ (0,
|
|
6616
|
-
/* @__PURE__ */ (0,
|
|
6617
|
-
/* @__PURE__ */ (0,
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
revealName
|
|
6674
|
+
!config && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading }),
|
|
6675
|
+
config && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(import_jsx_runtime73.Fragment, { children: [
|
|
6676
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "ss-g-body", children: [
|
|
6677
|
+
!isOver && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(PointsLadderRow, { ladder: config.pointsLadder, guessesUsed, ui }),
|
|
6678
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: `ss-g-mt-card${isOver ? " ss-g-mt-card--reveal" : ""}`, children: [
|
|
6679
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "ss-g-mt-portrait", children: [
|
|
6680
|
+
revealName ? /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(PlayerAvatar, { className: "ss-g-mt-photo", name: revealName, imagePath: clientState?.revealedPlayerImagePath }) : /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(Silhouette, { size: 150, variant: "mystery" }),
|
|
6681
|
+
revealName && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "ss-g-mt-reveal-name", children: revealName })
|
|
6621
6682
|
] }),
|
|
6622
|
-
/* @__PURE__ */ (0,
|
|
6623
|
-
/* @__PURE__ */ (0,
|
|
6624
|
-
/* @__PURE__ */ (0,
|
|
6683
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("div", { className: "ss-g-mt-known", style: { gridTemplateColumns: `repeat(${keys.length}, minmax(0, 1fr))` }, children: known.map((k) => /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "ss-g-mt-known-cell", children: [
|
|
6684
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "ss-g-mt-lab", children: t.labels[k.key] }),
|
|
6685
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "ss-g-mt-known-v", "data-state": k.state, "data-testid": `known-${k.key}`, children: k.text })
|
|
6625
6686
|
] }, k.key)) })
|
|
6626
6687
|
] }),
|
|
6627
|
-
!isOver && /* @__PURE__ */ (0,
|
|
6628
|
-
guessResults.length > 0 && /* @__PURE__ */ (0,
|
|
6629
|
-
/* @__PURE__ */ (0,
|
|
6630
|
-
/* @__PURE__ */ (0,
|
|
6631
|
-
keys.map((k) => /* @__PURE__ */ (0,
|
|
6688
|
+
!isOver && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(SegmentProgress, { segments, ariaLabel: t.progress(guessesUsed, totalGuesses) }),
|
|
6689
|
+
guessResults.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "ss-g-mt-table", children: [
|
|
6690
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "ss-g-mt-thead", style: cols, children: [
|
|
6691
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { children: t.yourGuesses }),
|
|
6692
|
+
keys.map((k) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { children: t.labels[k] }, k))
|
|
6632
6693
|
] }),
|
|
6633
6694
|
guessResults.map((gr, i) => {
|
|
6634
6695
|
const name = config.squadPlayers.find((p) => p.id === gr.playerId)?.name ?? `#${gr.playerId}`;
|
|
6635
6696
|
const { first, last } = splitName(name);
|
|
6636
|
-
return /* @__PURE__ */ (0,
|
|
6637
|
-
/* @__PURE__ */ (0,
|
|
6638
|
-
/* @__PURE__ */ (0,
|
|
6639
|
-
/* @__PURE__ */ (0,
|
|
6640
|
-
first && /* @__PURE__ */ (0,
|
|
6641
|
-
/* @__PURE__ */ (0,
|
|
6697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "ss-g-mt-row", style: cols, children: [
|
|
6698
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "ss-g-mt-who", children: [
|
|
6699
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(PlayerAvatar, { className: "ss-g-mt-av", name }),
|
|
6700
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("span", { className: "ss-g-mt-names", children: [
|
|
6701
|
+
first && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "ss-g-mt-first", children: first }),
|
|
6702
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "ss-g-mt-last", children: last })
|
|
6642
6703
|
] })
|
|
6643
6704
|
] }),
|
|
6644
6705
|
keys.map((key) => {
|
|
6645
6706
|
const v = gr[key];
|
|
6646
6707
|
const arrow = directionArrow(v);
|
|
6647
|
-
return /* @__PURE__ */ (0,
|
|
6708
|
+
return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)(
|
|
6648
6709
|
"div",
|
|
6649
6710
|
{
|
|
6650
6711
|
className: "ss-g-mt-cell",
|
|
@@ -6652,8 +6713,8 @@ function MysteryTigerGame({
|
|
|
6652
6713
|
"data-verdict": v.verdict,
|
|
6653
6714
|
"aria-label": `${t.labels[key]}: ${v.value ?? v.verdict}${v.direction ? ` ${v.direction}` : ""}`,
|
|
6654
6715
|
children: [
|
|
6655
|
-
/* @__PURE__ */ (0,
|
|
6656
|
-
arrow && /* @__PURE__ */ (0,
|
|
6716
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "ss-g-mt-cell-v", "aria-hidden": "true", children: tileFace(key, v) }),
|
|
6717
|
+
arrow && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { className: "ss-g-mt-cell-dir", "aria-hidden": "true", children: arrow })
|
|
6657
6718
|
]
|
|
6658
6719
|
},
|
|
6659
6720
|
key
|
|
@@ -6662,25 +6723,25 @@ function MysteryTigerGame({
|
|
|
6662
6723
|
] }, gr.playerId);
|
|
6663
6724
|
})
|
|
6664
6725
|
] }),
|
|
6665
|
-
!isOver && /* @__PURE__ */ (0,
|
|
6666
|
-
/* @__PURE__ */ (0,
|
|
6667
|
-
/* @__PURE__ */ (0,
|
|
6726
|
+
!isOver && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "ss-g-mt-legend", children: [
|
|
6727
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("span", { children: [
|
|
6728
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("i", { className: "ss-g-mt-sw", "data-verdict": "exact" }),
|
|
6668
6729
|
t.legendMatch
|
|
6669
6730
|
] }),
|
|
6670
|
-
/* @__PURE__ */ (0,
|
|
6671
|
-
/* @__PURE__ */ (0,
|
|
6731
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("span", { children: [
|
|
6732
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("i", { className: "ss-g-mt-sw", "data-verdict": "near" }),
|
|
6672
6733
|
t.legendClose
|
|
6673
6734
|
] }),
|
|
6674
|
-
/* @__PURE__ */ (0,
|
|
6735
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("span", { children: [
|
|
6675
6736
|
"\u25B2 ",
|
|
6676
6737
|
t.legendHigher
|
|
6677
6738
|
] })
|
|
6678
6739
|
] }),
|
|
6679
|
-
clientState?.hintLine && !isOver && /* @__PURE__ */ (0,
|
|
6680
|
-
/* @__PURE__ */ (0,
|
|
6681
|
-
/* @__PURE__ */ (0,
|
|
6740
|
+
clientState?.hintLine && !isOver && /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "ss-g-mt-hint", children: [
|
|
6741
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)(IconBulb, {}),
|
|
6742
|
+
/* @__PURE__ */ (0, import_jsx_runtime73.jsx)("span", { children: clientState.hintLine })
|
|
6682
6743
|
] }),
|
|
6683
|
-
isOver && /* @__PURE__ */ (0,
|
|
6744
|
+
isOver && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
6684
6745
|
ResultCard,
|
|
6685
6746
|
{
|
|
6686
6747
|
tone: clientState?.solved ? "win" : clientState?.failed ? "lose" : "neutral",
|
|
@@ -6692,39 +6753,26 @@ function MysteryTigerGame({
|
|
|
6692
6753
|
}
|
|
6693
6754
|
)
|
|
6694
6755
|
] }),
|
|
6695
|
-
!isOver && /* @__PURE__ */ (0,
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
|
|
6707
|
-
|
|
6708
|
-
|
|
6709
|
-
),
|
|
6710
|
-
/* @__PURE__ */ (0, import_jsx_runtime72.jsx)(
|
|
6711
|
-
SearchField,
|
|
6712
|
-
{
|
|
6713
|
-
id: inputId,
|
|
6714
|
-
label: t.searchLabel,
|
|
6715
|
-
placeholder: t.searchPlaceholder,
|
|
6716
|
-
value: query,
|
|
6717
|
-
onChange: setQuery,
|
|
6718
|
-
disabled: submitting
|
|
6719
|
-
}
|
|
6720
|
-
)
|
|
6721
|
-
] })
|
|
6756
|
+
!isOver && /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(FooterBar, { children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(
|
|
6757
|
+
AnswerTray,
|
|
6758
|
+
{
|
|
6759
|
+
id: inputId,
|
|
6760
|
+
label: t.searchLabel,
|
|
6761
|
+
placeholder: t.searchPlaceholder,
|
|
6762
|
+
optionsLabel: t.optionsLabel,
|
|
6763
|
+
options: pool,
|
|
6764
|
+
query,
|
|
6765
|
+
onQuery: setQuery,
|
|
6766
|
+
onPick: handleSelect,
|
|
6767
|
+
disabled: submitting
|
|
6768
|
+
}
|
|
6769
|
+
) })
|
|
6722
6770
|
] })
|
|
6723
6771
|
] });
|
|
6724
6772
|
}
|
|
6725
6773
|
|
|
6726
6774
|
// src/components/games/HigherOrLowerGame.tsx
|
|
6727
|
-
var
|
|
6775
|
+
var import_jsx_runtime74 = require("react/jsx-runtime");
|
|
6728
6776
|
var POINTS_PER_CORRECT = 10;
|
|
6729
6777
|
function parseClientState2(json) {
|
|
6730
6778
|
if (!json) return null;
|
|
@@ -6736,11 +6784,11 @@ function parseClientState2(json) {
|
|
|
6736
6784
|
}
|
|
6737
6785
|
function PlayerCard({ name, imagePath, highlight, children }) {
|
|
6738
6786
|
const { first, last } = splitName(name);
|
|
6739
|
-
return /* @__PURE__ */ (0,
|
|
6740
|
-
/* @__PURE__ */ (0,
|
|
6741
|
-
/* @__PURE__ */ (0,
|
|
6742
|
-
first && /* @__PURE__ */ (0,
|
|
6743
|
-
/* @__PURE__ */ (0,
|
|
6787
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: `ss-g-hl-card${highlight ? " ss-g-hl-card--b" : ""}`, children: [
|
|
6788
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "ss-g-hl-photo-wrap", children: imagePath ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(PlayerAvatar, { className: "ss-g-hl-photo", name, imagePath }) : /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(Silhouette, { size: 150 }) }),
|
|
6789
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "ss-g-hl-info", children: [
|
|
6790
|
+
first && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "ss-g-hl-first", children: first }),
|
|
6791
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "ss-g-hl-surname", children: last }),
|
|
6744
6792
|
children
|
|
6745
6793
|
] })
|
|
6746
6794
|
] });
|
|
@@ -6772,47 +6820,47 @@ function HigherOrLowerGame({
|
|
|
6772
6820
|
const newAnswers = [...prevAnswers, { pairIndex: currentPair.pairIndex, pick }];
|
|
6773
6821
|
onSubmit(JSON.stringify({ answers: newAnswers }));
|
|
6774
6822
|
}
|
|
6775
|
-
return /* @__PURE__ */ (0,
|
|
6776
|
-
/* @__PURE__ */ (0,
|
|
6823
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "ss-g-screen ss-g-hl", "data-game": "higher-or-lower", "data-testid": "game-screen-higher-or-lower", children: [
|
|
6824
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
6777
6825
|
GameHeader,
|
|
6778
6826
|
{
|
|
6779
6827
|
title: gameTitle({ gameId: "higher-or-lower" }, ui.games.titles),
|
|
6780
6828
|
eyebrow: t.eyebrow(POINTS_PER_CORRECT),
|
|
6781
|
-
right: config ? /* @__PURE__ */ (0,
|
|
6829
|
+
right: config ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(StatStack, { value: runLength, label: t.streak }) : void 0,
|
|
6782
6830
|
onBack,
|
|
6783
6831
|
backLabel: ui.back
|
|
6784
6832
|
}
|
|
6785
6833
|
),
|
|
6786
|
-
!config && /* @__PURE__ */ (0,
|
|
6787
|
-
config && /* @__PURE__ */ (0,
|
|
6788
|
-
/* @__PURE__ */ (0,
|
|
6789
|
-
/* @__PURE__ */ (0,
|
|
6790
|
-
/* @__PURE__ */ (0,
|
|
6791
|
-
/* @__PURE__ */ (0,
|
|
6792
|
-
/* @__PURE__ */ (0,
|
|
6834
|
+
!config && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading }),
|
|
6835
|
+
config && /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(import_jsx_runtime74.Fragment, { children: [
|
|
6836
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "ss-g-body", children: [
|
|
6837
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "ss-g-hl-prompt", "data-testid": "hol-prompt", children: [
|
|
6838
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "ss-g-hl-prompt-q", children: t.whoHadMore }),
|
|
6839
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "ss-g-hl-prompt-stat", children: config.statLabel }),
|
|
6840
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "ss-g-hl-prompt-season", children: t.season(config.seasonLabel) })
|
|
6793
6841
|
] }),
|
|
6794
|
-
currentPair && /* @__PURE__ */ (0,
|
|
6795
|
-
/* @__PURE__ */ (0,
|
|
6796
|
-
/* @__PURE__ */ (0,
|
|
6797
|
-
/* @__PURE__ */ (0,
|
|
6842
|
+
currentPair && /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "ss-g-hl-pair", children: [
|
|
6843
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(PlayerCard, { name: currentPair.playerAName, imagePath: currentPair.playerAImagePath, children: [
|
|
6844
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "ss-g-hl-value", children: currentPair.playerAValue }),
|
|
6845
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "ss-g-hl-stat", children: config.statLabel })
|
|
6798
6846
|
] }),
|
|
6799
|
-
/* @__PURE__ */ (0,
|
|
6800
|
-
/* @__PURE__ */ (0,
|
|
6801
|
-
/* @__PURE__ */ (0,
|
|
6802
|
-
/* @__PURE__ */ (0,
|
|
6847
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "ss-g-hl-vs", "aria-hidden": "true", children: t.vs }),
|
|
6848
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(PlayerCard, { name: currentPair.playerBName, imagePath: currentPair.playerBImagePath, highlight: true, children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "ss-g-hl-btns", children: [
|
|
6849
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(GameButton, { variant: "primary", disabled: submitting, onClick: () => handlePick("higher"), children: [
|
|
6850
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(IconArrowUp, { size: 16 }),
|
|
6803
6851
|
t.higher
|
|
6804
6852
|
] }),
|
|
6805
|
-
/* @__PURE__ */ (0,
|
|
6806
|
-
/* @__PURE__ */ (0,
|
|
6853
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)(GameButton, { variant: "outline", disabled: submitting, onClick: () => handlePick("lower"), children: [
|
|
6854
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)(IconArrowDown, { size: 16 }),
|
|
6807
6855
|
t.lower
|
|
6808
6856
|
] })
|
|
6809
6857
|
] }) })
|
|
6810
6858
|
] }),
|
|
6811
|
-
lastAnswer && lastAnswerPair && /* @__PURE__ */ (0,
|
|
6812
|
-
lastAnswer.wasCorrect ? /* @__PURE__ */ (0,
|
|
6859
|
+
lastAnswer && lastAnswerPair && /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("p", { className: "ss-g-hl-feedback", "data-testid": "hol-last", "data-correct": lastAnswer.wasCorrect ? "true" : "false", children: [
|
|
6860
|
+
lastAnswer.wasCorrect ? /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(IconCheck, {}) : /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(IconClose, {}),
|
|
6813
6861
|
t.lastAnswer(splitName(lastAnswerPair.playerBName).last, lastAnswer.playerBValue)
|
|
6814
6862
|
] }),
|
|
6815
|
-
isOver && /* @__PURE__ */ (0,
|
|
6863
|
+
isOver && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
|
|
6816
6864
|
ResultCard,
|
|
6817
6865
|
{
|
|
6818
6866
|
tone: runEndedWrong ? "lose" : allPairsAnswered ? "win" : "neutral",
|
|
@@ -6824,15 +6872,15 @@ function HigherOrLowerGame({
|
|
|
6824
6872
|
}
|
|
6825
6873
|
)
|
|
6826
6874
|
] }),
|
|
6827
|
-
!isOver && /* @__PURE__ */ (0,
|
|
6828
|
-
/* @__PURE__ */ (0,
|
|
6875
|
+
!isOver && /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(FooterBar, { children: /* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("div", { className: "ss-g-hl-foot", children: [
|
|
6876
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("div", { className: "ss-g-hl-dots", role: "img", "aria-label": t.answersSoFar(answeredCount, config.pairs.length), children: config.pairs.map((p, i) => {
|
|
6829
6877
|
const a = answeredPairs[i];
|
|
6830
|
-
return /* @__PURE__ */ (0,
|
|
6878
|
+
return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "ss-g-hl-dot", "data-state": a ? a.wasCorrect ? "correct" : "wrong" : "todo" }, p.pairIndex);
|
|
6831
6879
|
}) }),
|
|
6832
|
-
/* @__PURE__ */ (0,
|
|
6833
|
-
/* @__PURE__ */ (0,
|
|
6880
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsxs)("span", { className: "ss-g-hl-pts", children: [
|
|
6881
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { "data-testid": "hol-score", children: score }),
|
|
6834
6882
|
" ",
|
|
6835
|
-
/* @__PURE__ */ (0,
|
|
6883
|
+
/* @__PURE__ */ (0, import_jsx_runtime74.jsx)("span", { className: "ss-g-hl-pts-unit", children: ui.games.unitPts })
|
|
6836
6884
|
] })
|
|
6837
6885
|
] }) })
|
|
6838
6886
|
] })
|
|
@@ -6844,17 +6892,17 @@ var import_react40 = require("react");
|
|
|
6844
6892
|
|
|
6845
6893
|
// src/components/games/ui/CrestShield.tsx
|
|
6846
6894
|
var import_react39 = require("react");
|
|
6847
|
-
var
|
|
6895
|
+
var import_jsx_runtime75 = require("react/jsx-runtime");
|
|
6848
6896
|
function CrestShield({ src, name, size = 28 }) {
|
|
6849
6897
|
const [failed, setFailed] = (0, import_react39.useState)(false);
|
|
6850
6898
|
if (src && !isPlaceholderImage(src) && !failed) {
|
|
6851
|
-
return /* @__PURE__ */ (0,
|
|
6899
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("img", { className: "ss-g-crest", src, alt: name, width: size, height: size, loading: "lazy", onError: () => setFailed(true) });
|
|
6852
6900
|
}
|
|
6853
|
-
return /* @__PURE__ */ (0,
|
|
6901
|
+
return /* @__PURE__ */ (0, import_jsx_runtime75.jsx)("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__ */ (0, import_jsx_runtime75.jsx)("path", { d: "M2 3h24v12c0 9-6 14-12 17C8 29 2 24 2 15z", fill: "currentColor" }) });
|
|
6854
6902
|
}
|
|
6855
6903
|
|
|
6856
6904
|
// src/components/games/CareerPathGame.tsx
|
|
6857
|
-
var
|
|
6905
|
+
var import_jsx_runtime76 = require("react/jsx-runtime");
|
|
6858
6906
|
function parseClientState3(json) {
|
|
6859
6907
|
if (!json) return null;
|
|
6860
6908
|
try {
|
|
@@ -6884,17 +6932,15 @@ function CareerPathGame({
|
|
|
6884
6932
|
const alreadyGuessedIds = new Set(clientState?.guessResults.map((g) => g.playerId) ?? []);
|
|
6885
6933
|
const isOver = result?.alreadyPlayed === true || clientState?.solved === true || clientState?.failed === true;
|
|
6886
6934
|
if (!config) {
|
|
6887
|
-
return /* @__PURE__ */ (0,
|
|
6888
|
-
/* @__PURE__ */ (0,
|
|
6889
|
-
/* @__PURE__ */ (0,
|
|
6935
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "ss-g-screen", "data-game": "career-path", "data-testid": "game-screen-career-path", children: [
|
|
6936
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GameHeader, { title, eyebrow: s.eyebrow, onBack, backLabel: ui.back }),
|
|
6937
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
6890
6938
|
] });
|
|
6891
6939
|
}
|
|
6892
6940
|
const visiblePath = clientState?.visiblePath ?? config.initialPath;
|
|
6893
6941
|
const totalClubs = clientState?.totalClubs ?? config.totalClubs;
|
|
6894
6942
|
const hidden = isOver ? 0 : Math.max(0, totalClubs - visiblePath.length);
|
|
6895
|
-
const
|
|
6896
|
-
(p) => !alreadyGuessedIds.has(p.id) && p.name.toLowerCase().includes(query.toLowerCase())
|
|
6897
|
-
) : [];
|
|
6943
|
+
const pool = !isOver ? config.typeaheadPool.filter((p) => !alreadyGuessedIds.has(p.id)) : [];
|
|
6898
6944
|
function handleSelect(playerId) {
|
|
6899
6945
|
if (!config || isOver || submitting) return;
|
|
6900
6946
|
const prevGuesses = clientState?.guessResults.map((g) => g.playerId) ?? [];
|
|
@@ -6902,60 +6948,61 @@ function CareerPathGame({
|
|
|
6902
6948
|
setQuery("");
|
|
6903
6949
|
onSubmit(JSON.stringify({ guesses: newGuesses }));
|
|
6904
6950
|
}
|
|
6905
|
-
const right = !isOver && clientState ? /* @__PURE__ */ (0,
|
|
6951
|
+
const right = !isOver && clientState ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { "data-testid": "cp-guess-chip", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(Chip, { variant: "neutral", children: [
|
|
6906
6952
|
ui.games.guess,
|
|
6907
6953
|
" ",
|
|
6908
|
-
/* @__PURE__ */ (0,
|
|
6954
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { className: "ss-g-num", children: clientState.guessesUsed + 1 }),
|
|
6909
6955
|
" / ",
|
|
6910
6956
|
clientState.guessesUsed + clientState.guessesRemaining
|
|
6911
6957
|
] }) }) : void 0;
|
|
6912
6958
|
const outcome = clientState?.solved ? s.solved : clientState?.failed ? s.failed : ui.games.done;
|
|
6913
|
-
return /* @__PURE__ */ (0,
|
|
6914
|
-
/* @__PURE__ */ (0,
|
|
6915
|
-
/* @__PURE__ */ (0,
|
|
6916
|
-
/* @__PURE__ */ (0,
|
|
6917
|
-
|
|
6918
|
-
/* @__PURE__ */ (0,
|
|
6919
|
-
|
|
6920
|
-
|
|
6921
|
-
|
|
6922
|
-
/* @__PURE__ */ (0,
|
|
6959
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "ss-g-screen", "data-game": "career-path", "data-testid": "game-screen-career-path", children: [
|
|
6960
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(GameHeader, { title, eyebrow: s.eyebrow, right, onBack, backLabel: ui.back }),
|
|
6961
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "ss-g-body", children: [
|
|
6962
|
+
!isOver && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(PointsLadderRow, { ladder: config.pointsLadder, guessesUsed: clientState?.guessesUsed ?? 0, ui }),
|
|
6963
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "ss-g-cp-card", children: [
|
|
6964
|
+
isOver && clientState?.revealedPlayerName ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(PlayerAvatar, { className: "ss-g-cp-photo", name: clientState.revealedPlayerName, imagePath: clientState.revealedPlayerImagePath }) : /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Silhouette, { size: 64, variant: isOver ? "default" : "mystery" }),
|
|
6965
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("div", { className: "ss-g-cp-card-text", children: [
|
|
6966
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { className: "ss-g-cp-card-title", children: isOver && clientState?.revealedPlayerName ? clientState.revealedPlayerName : s.mysteryPlayer }),
|
|
6967
|
+
clientState?.hintLine ? /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { className: "ss-g-cp-hint", children: clientState.hintLine }) : !isOver ? /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("span", { className: "ss-g-cp-locks", children: [
|
|
6968
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Chip, { variant: "lock", icon: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(IconLock, { size: 11 }), children: s.lockPosition }),
|
|
6969
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)(Chip, { variant: "lock", icon: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(IconLock, { size: 11 }), children: s.lockNationality })
|
|
6923
6970
|
] }) : null
|
|
6924
6971
|
] })
|
|
6925
6972
|
] }),
|
|
6926
|
-
/* @__PURE__ */ (0,
|
|
6973
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("ol", { className: "ss-g-cp-line", children: [
|
|
6927
6974
|
visiblePath.map((spell, i) => {
|
|
6928
6975
|
const years = i === 0 ? s.firstClub : spellYears(spell);
|
|
6929
|
-
return /* @__PURE__ */ (0,
|
|
6930
|
-
/* @__PURE__ */ (0,
|
|
6931
|
-
/* @__PURE__ */ (0,
|
|
6932
|
-
/* @__PURE__ */ (0,
|
|
6976
|
+
return /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("li", { className: "ss-g-cp-step", children: [
|
|
6977
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("span", { className: "ss-g-cp-rail", children: [
|
|
6978
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { className: "ss-g-cp-tile", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(CrestShield, { src: spell.crestUrl, name: spell.clubName, size: 30 }) }),
|
|
6979
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { className: "ss-g-cp-conn", "aria-hidden": "true" })
|
|
6933
6980
|
] }),
|
|
6934
|
-
/* @__PURE__ */ (0,
|
|
6935
|
-
/* @__PURE__ */ (0,
|
|
6936
|
-
/* @__PURE__ */ (0,
|
|
6937
|
-
/* @__PURE__ */ (0,
|
|
6938
|
-
spell.isLoan && /* @__PURE__ */ (0,
|
|
6981
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("span", { className: "ss-g-cp-step-text", children: [
|
|
6982
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { className: "ss-g-cp-club", children: spell.clubName }),
|
|
6983
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("span", { className: "ss-g-cp-sub", children: [
|
|
6984
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { className: "ss-g-cp-years", children: years }),
|
|
6985
|
+
spell.isLoan && /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)(import_jsx_runtime76.Fragment, { children: [
|
|
6939
6986
|
years ? " \xB7 " : "",
|
|
6940
|
-
/* @__PURE__ */ (0,
|
|
6987
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { className: "ss-g-cp-loan", children: s.loan })
|
|
6941
6988
|
] })
|
|
6942
6989
|
] })
|
|
6943
6990
|
] })
|
|
6944
6991
|
] }, `${spell.clubName}-${i}`);
|
|
6945
6992
|
}),
|
|
6946
|
-
hidden > 0 && /* @__PURE__ */ (0,
|
|
6947
|
-
/* @__PURE__ */ (0,
|
|
6948
|
-
/* @__PURE__ */ (0,
|
|
6949
|
-
hidden > 1 && /* @__PURE__ */ (0,
|
|
6993
|
+
hidden > 0 && /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("li", { className: "ss-g-cp-step ss-g-cp-step--hidden", children: [
|
|
6994
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("span", { className: "ss-g-cp-rail", children: [
|
|
6995
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { className: "ss-g-cp-tile ss-g-cp-tile--locked", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(IconLock, { size: 18 }) }),
|
|
6996
|
+
hidden > 1 && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { className: "ss-g-cp-conn ss-g-cp-conn--faint", "aria-hidden": "true" })
|
|
6950
6997
|
] }),
|
|
6951
|
-
/* @__PURE__ */ (0,
|
|
6998
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { className: "ss-g-cp-step-text", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { className: "ss-g-cp-sub", children: s.nextClubHidden }) })
|
|
6952
6999
|
] }),
|
|
6953
|
-
hidden > 1 && /* @__PURE__ */ (0,
|
|
6954
|
-
/* @__PURE__ */ (0,
|
|
6955
|
-
/* @__PURE__ */ (0,
|
|
7000
|
+
hidden > 1 && /* @__PURE__ */ (0, import_jsx_runtime76.jsxs)("li", { className: "ss-g-cp-step ss-g-cp-step--more", children: [
|
|
7001
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { className: "ss-g-cp-rail", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { className: "ss-g-cp-tile ss-g-cp-tile--faint", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(IconLock, { size: 18 }) }) }),
|
|
7002
|
+
/* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { className: "ss-g-cp-step-text", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)("span", { className: "ss-g-cp-sub", children: s.moreClubs(hidden - 1) }) })
|
|
6956
7003
|
] })
|
|
6957
7004
|
] }),
|
|
6958
|
-
isOver && /* @__PURE__ */ (0,
|
|
7005
|
+
isOver && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
6959
7006
|
ResultCard,
|
|
6960
7007
|
{
|
|
6961
7008
|
tone: clientState?.solved ? "win" : clientState?.failed ? "lose" : "neutral",
|
|
@@ -6967,39 +7014,35 @@ function CareerPathGame({
|
|
|
6967
7014
|
}
|
|
6968
7015
|
)
|
|
6969
7016
|
] }),
|
|
6970
|
-
!isOver && /* @__PURE__ */ (0,
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
|
|
6974
|
-
|
|
6975
|
-
|
|
6976
|
-
|
|
6977
|
-
|
|
6978
|
-
|
|
6979
|
-
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
|
|
6984
|
-
|
|
6985
|
-
/* @__PURE__ */ (0, import_jsx_runtime75.jsx)(
|
|
6986
|
-
SearchField,
|
|
6987
|
-
{
|
|
6988
|
-
id: inputId,
|
|
6989
|
-
label: s.searchLabel,
|
|
6990
|
-
placeholder: s.searchPlaceholder,
|
|
6991
|
-
value: query,
|
|
6992
|
-
onChange: setQuery,
|
|
6993
|
-
disabled: submitting
|
|
6994
|
-
}
|
|
6995
|
-
)
|
|
6996
|
-
] })
|
|
7017
|
+
!isOver && /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(FooterBar, { children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(
|
|
7018
|
+
AnswerTray,
|
|
7019
|
+
{
|
|
7020
|
+
id: inputId,
|
|
7021
|
+
label: s.searchLabel,
|
|
7022
|
+
placeholder: s.searchPlaceholder,
|
|
7023
|
+
optionsLabel: s.searchLabel,
|
|
7024
|
+
options: pool,
|
|
7025
|
+
query,
|
|
7026
|
+
onQuery: setQuery,
|
|
7027
|
+
onPick: handleSelect,
|
|
7028
|
+
disabled: submitting,
|
|
7029
|
+
minQuery: 1
|
|
7030
|
+
}
|
|
7031
|
+
) })
|
|
6997
7032
|
] });
|
|
6998
7033
|
}
|
|
6999
7034
|
|
|
7000
7035
|
// src/components/games/BeatTheGridGame.tsx
|
|
7001
7036
|
var import_react41 = __toESM(require("react"), 1);
|
|
7002
|
-
|
|
7037
|
+
|
|
7038
|
+
// src/components/games/ui/OptionList.tsx
|
|
7039
|
+
var import_jsx_runtime77 = require("react/jsx-runtime");
|
|
7040
|
+
function OptionList({ label, options, onPick }) {
|
|
7041
|
+
return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "ss-g-opts", role: "listbox", "aria-label": label, children: options.map((o) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("button", { type: "button", role: "option", "aria-selected": false, className: "ss-g-opt", onClick: () => onPick(o.key), children: o.content }, o.key)) });
|
|
7042
|
+
}
|
|
7043
|
+
|
|
7044
|
+
// src/components/games/BeatTheGridGame.tsx
|
|
7045
|
+
var import_jsx_runtime78 = require("react/jsx-runtime");
|
|
7003
7046
|
function criterionIconKind(label, key) {
|
|
7004
7047
|
const l = (key ?? label).toLowerCase();
|
|
7005
7048
|
if (l.includes("app")) return "calendar";
|
|
@@ -7017,34 +7060,34 @@ function rowAbbrev(label, map, key) {
|
|
|
7017
7060
|
function CriterionIcon({ kind }) {
|
|
7018
7061
|
switch (kind) {
|
|
7019
7062
|
case "calendar":
|
|
7020
|
-
return /* @__PURE__ */ (0,
|
|
7063
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(IconCalendar, {});
|
|
7021
7064
|
case "ball":
|
|
7022
|
-
return /* @__PURE__ */ (0,
|
|
7065
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(IconBall, {});
|
|
7023
7066
|
case "boot":
|
|
7024
|
-
return /* @__PURE__ */ (0,
|
|
7067
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(IconBoot, {});
|
|
7025
7068
|
case "gloves":
|
|
7026
|
-
return /* @__PURE__ */ (0,
|
|
7069
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(IconGloves, {});
|
|
7027
7070
|
case "shield":
|
|
7028
|
-
return /* @__PURE__ */ (0,
|
|
7071
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(IconShield, {});
|
|
7029
7072
|
default:
|
|
7030
|
-
return /* @__PURE__ */ (0,
|
|
7073
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(IconFlag, {});
|
|
7031
7074
|
}
|
|
7032
7075
|
}
|
|
7033
7076
|
function HeaderVisual({ label, textKey: iKey, meta }) {
|
|
7034
7077
|
if (!meta) {
|
|
7035
|
-
return /* @__PURE__ */ (0,
|
|
7078
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(CriterionIcon, { kind: criterionIconKind(label, iKey) });
|
|
7036
7079
|
}
|
|
7037
7080
|
switch (meta.kind) {
|
|
7038
7081
|
case "club":
|
|
7039
|
-
return /* @__PURE__ */ (0,
|
|
7082
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(CrestShield, { src: meta.imageUrl, name: label, size: 24 });
|
|
7040
7083
|
case "coach":
|
|
7041
|
-
return /* @__PURE__ */ (0,
|
|
7084
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(PlayerAvatar, { name: label, imagePath: meta.imageUrl, className: "ss-g-btg-coach-av" });
|
|
7042
7085
|
case "country":
|
|
7043
|
-
return /* @__PURE__ */ (0,
|
|
7086
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "ss-g-btg-hdr-flag", "aria-hidden": "true", children: nationalityFlag(meta.country ?? label) });
|
|
7044
7087
|
case "position":
|
|
7045
|
-
return /* @__PURE__ */ (0,
|
|
7088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_jsx_runtime78.Fragment, {});
|
|
7046
7089
|
default:
|
|
7047
|
-
return /* @__PURE__ */ (0,
|
|
7090
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(CriterionIcon, { kind: criterionIconKind(label, iKey) });
|
|
7048
7091
|
}
|
|
7049
7092
|
}
|
|
7050
7093
|
function parseClientState4(json) {
|
|
@@ -7088,12 +7131,12 @@ function SearchSheet({
|
|
|
7088
7131
|
const filtered = playerPool.filter(
|
|
7089
7132
|
(p) => !alreadyFilledIds.has(p.id) && p.name.toLowerCase().includes(query.toLowerCase())
|
|
7090
7133
|
);
|
|
7091
|
-
return /* @__PURE__ */ (0,
|
|
7092
|
-
/* @__PURE__ */ (0,
|
|
7093
|
-
/* @__PURE__ */ (0,
|
|
7094
|
-
/* @__PURE__ */ (0,
|
|
7095
|
-
/* @__PURE__ */ (0,
|
|
7096
|
-
/* @__PURE__ */ (0,
|
|
7134
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "ss-g-btg-sheet", "data-testid": "btg-search-sheet", children: [
|
|
7135
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "ss-g-btg-sheet-hdr", children: [
|
|
7136
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Chip, { variant: "neutral", children: rowLabel }),
|
|
7137
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "ss-g-btg-sheet-x", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(IconClose, { size: 12 }) }),
|
|
7138
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Chip, { variant: "accent", children: colLabel }),
|
|
7139
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7097
7140
|
"button",
|
|
7098
7141
|
{
|
|
7099
7142
|
type: "button",
|
|
@@ -7101,12 +7144,12 @@ function SearchSheet({
|
|
|
7101
7144
|
"data-testid": "btg-sheet-dismiss",
|
|
7102
7145
|
"aria-label": s.closeSearch,
|
|
7103
7146
|
onClick: onDismiss,
|
|
7104
|
-
children: /* @__PURE__ */ (0,
|
|
7147
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(IconClose, {})
|
|
7105
7148
|
}
|
|
7106
7149
|
)
|
|
7107
7150
|
] }),
|
|
7108
|
-
playerPool.length === 0 ? /* @__PURE__ */ (0,
|
|
7109
|
-
/* @__PURE__ */ (0,
|
|
7151
|
+
playerPool.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "ss-g-btg-sheet-empty", children: s.emptyPool }) : /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
7152
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7110
7153
|
SearchField,
|
|
7111
7154
|
{
|
|
7112
7155
|
id: inputId,
|
|
@@ -7118,16 +7161,16 @@ function SearchSheet({
|
|
|
7118
7161
|
inputRef
|
|
7119
7162
|
}
|
|
7120
7163
|
),
|
|
7121
|
-
query.length > 0 && filtered.length > 0 && /* @__PURE__ */ (0,
|
|
7164
|
+
query.length > 0 && filtered.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7122
7165
|
OptionList,
|
|
7123
7166
|
{
|
|
7124
7167
|
label: s.searchLabel(rowLabel, colLabel),
|
|
7125
7168
|
options: filtered.map((p) => ({
|
|
7126
7169
|
key: p.id,
|
|
7127
|
-
content: /* @__PURE__ */ (0,
|
|
7128
|
-
/* @__PURE__ */ (0,
|
|
7129
|
-
/* @__PURE__ */ (0,
|
|
7130
|
-
/* @__PURE__ */ (0,
|
|
7170
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
7171
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(PlayerAvatar, { name: p.name, imagePath: p.imagePath, className: "ss-g-opt-av" }),
|
|
7172
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "ss-g-btg-result-name", children: p.name }),
|
|
7173
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "ss-g-btg-result-plus", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(IconPlus, { size: 18 }) })
|
|
7131
7174
|
] })
|
|
7132
7175
|
})),
|
|
7133
7176
|
onPick: (k) => onPick(row, col, Number(k))
|
|
@@ -7165,9 +7208,9 @@ function BeatTheGridGame({
|
|
|
7165
7208
|
onSubmit(JSON.stringify({ cells: newCells }));
|
|
7166
7209
|
}
|
|
7167
7210
|
if (!config) {
|
|
7168
|
-
return /* @__PURE__ */ (0,
|
|
7169
|
-
/* @__PURE__ */ (0,
|
|
7170
|
-
/* @__PURE__ */ (0,
|
|
7211
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "ss-g-screen", "data-game": "beat-the-grid", "data-testid": "game-screen-beat-the-grid", children: [
|
|
7212
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(GameHeader, { title, eyebrow: s.eyebrow, onBack, backLabel: ui.back }),
|
|
7213
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
7171
7214
|
] });
|
|
7172
7215
|
}
|
|
7173
7216
|
const rows = config.rows;
|
|
@@ -7180,20 +7223,20 @@ function BeatTheGridGame({
|
|
|
7180
7223
|
(_, i) => i < correctCount ? "correct" : i < correctCount + wrongCount ? "wrong" : "todo"
|
|
7181
7224
|
);
|
|
7182
7225
|
const totalScore = clientState?.totalScore ?? result?.score ?? 0;
|
|
7183
|
-
return /* @__PURE__ */ (0,
|
|
7184
|
-
/* @__PURE__ */ (0,
|
|
7185
|
-
/* @__PURE__ */ (0,
|
|
7226
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "ss-g-screen", "data-game": "beat-the-grid", "data-testid": "game-screen-beat-the-grid", children: [
|
|
7227
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(GameHeader, { title, eyebrow: s.eyebrow, onBack, backLabel: ui.back }),
|
|
7228
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7186
7229
|
SegmentProgress,
|
|
7187
7230
|
{
|
|
7188
7231
|
segments,
|
|
7189
7232
|
ariaLabel: s.progressAria(filledCells.length, total),
|
|
7190
7233
|
leftLabel: s.filled(filledCells.length, total),
|
|
7191
7234
|
rightLabel: s.toGo(Math.max(0, total - filledCells.length)),
|
|
7192
|
-
right: /* @__PURE__ */ (0,
|
|
7235
|
+
right: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(Chip, { variant: "accent", children: `${totalScore} ${ui.games.unitPts}` })
|
|
7193
7236
|
}
|
|
7194
7237
|
),
|
|
7195
|
-
/* @__PURE__ */ (0,
|
|
7196
|
-
/* @__PURE__ */ (0,
|
|
7238
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "ss-g-body", children: [
|
|
7239
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(
|
|
7197
7240
|
"div",
|
|
7198
7241
|
{
|
|
7199
7242
|
className: activeCell !== null ? "ss-g-btg-grid ss-g-btg-grid--fit" : "ss-g-btg-grid",
|
|
@@ -7203,31 +7246,31 @@ function BeatTheGridGame({
|
|
|
7203
7246
|
},
|
|
7204
7247
|
role: "grid",
|
|
7205
7248
|
children: [
|
|
7206
|
-
/* @__PURE__ */ (0,
|
|
7249
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "ss-g-btg-corner" }),
|
|
7207
7250
|
cols.map((col, colIdx) => {
|
|
7208
7251
|
const colMeta = config.colsMeta?.[colIdx];
|
|
7209
|
-
return /* @__PURE__ */ (0,
|
|
7210
|
-
/* @__PURE__ */ (0,
|
|
7211
|
-
/* @__PURE__ */ (0,
|
|
7252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)("div", { className: "ss-g-btg-colhdr", "data-meta": colMeta ? "true" : void 0, children: [
|
|
7253
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(HeaderVisual, { label: col, textKey: config.colsI18n?.[colIdx]?.key, meta: colMeta }),
|
|
7254
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { children: col })
|
|
7212
7255
|
] }, col);
|
|
7213
7256
|
}),
|
|
7214
7257
|
rows.map((rowLabel, rowIdx) => {
|
|
7215
7258
|
const rowMeta = config.rowsMeta?.[rowIdx];
|
|
7216
7259
|
const abbr = rowAbbrev(rowLabel, s.rowAbbrev, config.rowsI18n?.[rowIdx]?.key);
|
|
7217
|
-
const rowHeaderContent = rowMeta ? /* @__PURE__ */ (0,
|
|
7218
|
-
/* @__PURE__ */ (0,
|
|
7219
|
-
/* @__PURE__ */ (0,
|
|
7220
|
-
] }) : abbr === rowLabel ? /* @__PURE__ */ (0,
|
|
7221
|
-
/* @__PURE__ */ (0,
|
|
7222
|
-
/* @__PURE__ */ (0,
|
|
7260
|
+
const rowHeaderContent = rowMeta ? /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
7261
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(HeaderVisual, { label: rowLabel, textKey: config.rowsI18n?.[rowIdx]?.key, meta: rowMeta }),
|
|
7262
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { children: rowLabel })
|
|
7263
|
+
] }) : abbr === rowLabel ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { children: rowLabel }) : /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
7264
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { "aria-hidden": "true", children: abbr }),
|
|
7265
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "ss-g-sr", children: rowLabel })
|
|
7223
7266
|
] });
|
|
7224
|
-
return /* @__PURE__ */ (0,
|
|
7225
|
-
/* @__PURE__ */ (0,
|
|
7267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_react41.default.Fragment, { children: [
|
|
7268
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "ss-g-btg-rowhdr", "data-meta": rowMeta ? "true" : void 0, children: rowHeaderContent }),
|
|
7226
7269
|
cols.map((colLabel, colIdx) => {
|
|
7227
7270
|
const filled = findCellResult(filledCells, rowIdx, colIdx);
|
|
7228
7271
|
const isActive = activeCell?.row === rowIdx && activeCell?.col === colIdx;
|
|
7229
7272
|
const state = filled ? filled.isCorrect ? "correct" : "wrong" : isActive ? "active" : "empty";
|
|
7230
|
-
return /* @__PURE__ */ (0,
|
|
7273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7231
7274
|
"button",
|
|
7232
7275
|
{
|
|
7233
7276
|
type: "button",
|
|
@@ -7238,20 +7281,20 @@ function BeatTheGridGame({
|
|
|
7238
7281
|
className: "ss-g-btg-cell",
|
|
7239
7282
|
disabled: isLocked2 || submitting,
|
|
7240
7283
|
onClick: () => handleCellClick(rowIdx, colIdx),
|
|
7241
|
-
children: filled ? /* @__PURE__ */ (0,
|
|
7242
|
-
/* @__PURE__ */ (0,
|
|
7284
|
+
children: filled ? /* @__PURE__ */ (0, import_jsx_runtime78.jsxs)(import_jsx_runtime78.Fragment, { children: [
|
|
7285
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7243
7286
|
"span",
|
|
7244
7287
|
{
|
|
7245
7288
|
className: `ss-g-btg-badge ss-g-btg-badge--${filled.isCorrect ? "correct" : "wrong"}`,
|
|
7246
7289
|
role: "img",
|
|
7247
7290
|
"aria-label": filled.isCorrect ? s.correct : s.wrong,
|
|
7248
|
-
children: filled.isCorrect ? /* @__PURE__ */ (0,
|
|
7291
|
+
children: filled.isCorrect ? /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(IconCheck, { size: 11 }) : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(IconClose, { size: 11 })
|
|
7249
7292
|
}
|
|
7250
7293
|
),
|
|
7251
|
-
/* @__PURE__ */ (0,
|
|
7294
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "ss-g-btg-rarity", children: filled.rarityScore }),
|
|
7252
7295
|
(() => {
|
|
7253
7296
|
const entry = playerPool.find((p) => p.id === filled.playerId);
|
|
7254
|
-
return /* @__PURE__ */ (0,
|
|
7297
|
+
return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7255
7298
|
PlayerAvatar,
|
|
7256
7299
|
{
|
|
7257
7300
|
name: entry?.name ?? "",
|
|
@@ -7260,8 +7303,8 @@ function BeatTheGridGame({
|
|
|
7260
7303
|
}
|
|
7261
7304
|
);
|
|
7262
7305
|
})(),
|
|
7263
|
-
/* @__PURE__ */ (0,
|
|
7264
|
-
] }) : /* @__PURE__ */ (0,
|
|
7306
|
+
/* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "ss-g-btg-name", children: shortName(playerPool.find((p) => p.id === filled.playerId)?.name) })
|
|
7307
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("span", { className: "ss-g-btg-plus", "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(IconPlus, { size: 22 }) })
|
|
7265
7308
|
},
|
|
7266
7309
|
`cell-${rowIdx}-${colIdx}`
|
|
7267
7310
|
);
|
|
@@ -7271,7 +7314,7 @@ function BeatTheGridGame({
|
|
|
7271
7314
|
]
|
|
7272
7315
|
}
|
|
7273
7316
|
),
|
|
7274
|
-
isLocked2 && /* @__PURE__ */ (0,
|
|
7317
|
+
isLocked2 && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7275
7318
|
ResultCard,
|
|
7276
7319
|
{
|
|
7277
7320
|
tone: "neutral",
|
|
@@ -7283,7 +7326,7 @@ function BeatTheGridGame({
|
|
|
7283
7326
|
}
|
|
7284
7327
|
)
|
|
7285
7328
|
] }),
|
|
7286
|
-
activeCell !== null && /* @__PURE__ */ (0,
|
|
7329
|
+
activeCell !== null && /* @__PURE__ */ (0, import_jsx_runtime78.jsx)("div", { className: "ss-g-btg-pin", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
|
|
7287
7330
|
SearchSheet,
|
|
7288
7331
|
{
|
|
7289
7332
|
row: activeCell.row,
|
|
@@ -7305,18 +7348,18 @@ function BeatTheGridGame({
|
|
|
7305
7348
|
var import_react42 = require("react");
|
|
7306
7349
|
|
|
7307
7350
|
// src/components/games/ui/PitchSvg.tsx
|
|
7308
|
-
var
|
|
7351
|
+
var import_jsx_runtime79 = require("react/jsx-runtime");
|
|
7309
7352
|
function PitchSvg({ variant }) {
|
|
7310
|
-
return /* @__PURE__ */ (0,
|
|
7311
|
-
/* @__PURE__ */ (0,
|
|
7312
|
-
variant === "full" ? /* @__PURE__ */ (0,
|
|
7313
|
-
/* @__PURE__ */ (0,
|
|
7314
|
-
/* @__PURE__ */ (0,
|
|
7315
|
-
/* @__PURE__ */ (0,
|
|
7316
|
-
/* @__PURE__ */ (0,
|
|
7317
|
-
] }) : /* @__PURE__ */ (0,
|
|
7318
|
-
/* @__PURE__ */ (0,
|
|
7319
|
-
/* @__PURE__ */ (0,
|
|
7353
|
+
return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)("svg", { className: "ss-g-pitch-svg", viewBox: variant === "full" ? "0 0 100 150" : "0 0 100 100", preserveAspectRatio: "none", "aria-hidden": "true", children: [
|
|
7354
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("rect", { x: "4", y: "4", width: "92", height: variant === "full" ? 142 : 92, fill: "none" }),
|
|
7355
|
+
variant === "full" ? /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
|
|
7356
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("line", { x1: "4", y1: "75", x2: "96", y2: "75" }),
|
|
7357
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("circle", { cx: "50", cy: "75", r: "12", fill: "none" }),
|
|
7358
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("rect", { x: "26", y: "4", width: "48", height: "20", fill: "none" }),
|
|
7359
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("rect", { x: "26", y: "126", width: "48", height: "20", fill: "none" })
|
|
7360
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)(import_jsx_runtime79.Fragment, { children: [
|
|
7361
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("path", { d: "M38 4a12 12 0 0 0 24 0", fill: "none" }),
|
|
7362
|
+
/* @__PURE__ */ (0, import_jsx_runtime79.jsx)("rect", { x: "26", y: "76", width: "48", height: "20", fill: "none" })
|
|
7320
7363
|
] })
|
|
7321
7364
|
] });
|
|
7322
7365
|
}
|
|
@@ -7372,7 +7415,7 @@ function positionsBySlot(formation, rowsAttackFirst) {
|
|
|
7372
7415
|
}
|
|
7373
7416
|
|
|
7374
7417
|
// src/components/games/GuessTheXiGame.tsx
|
|
7375
|
-
var
|
|
7418
|
+
var import_jsx_runtime80 = require("react/jsx-runtime");
|
|
7376
7419
|
var MAX_GUESSES2 = 3;
|
|
7377
7420
|
function parseClientState5(json) {
|
|
7378
7421
|
if (!json) return null;
|
|
@@ -7422,30 +7465,31 @@ function GuessTheXiGame({
|
|
|
7422
7465
|
const wrongGuesses = (clientState?.guessHistory ?? []).filter((g) => !g.wasCorrect);
|
|
7423
7466
|
const guessesLeft = Math.max(0, MAX_GUESSES2 - (clientState?.guessesUsed ?? 0));
|
|
7424
7467
|
const teamName = (id) => config?.teamPool.find((tm) => tm.teamId === id)?.teamName ?? `#${id}`;
|
|
7425
|
-
return /* @__PURE__ */ (0,
|
|
7426
|
-
/* @__PURE__ */ (0,
|
|
7468
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "ss-g-screen ss-g-gxi", "data-game": "guess-the-xi", "data-testid": "game-screen-guess-the-xi", children: [
|
|
7469
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
7427
7470
|
GameHeader,
|
|
7428
7471
|
{
|
|
7429
7472
|
title: gameTitle({ gameId: "guess-the-xi" }, ui.games.titles),
|
|
7430
7473
|
eyebrow: config?.poolLabel,
|
|
7431
|
-
right: formation ? /* @__PURE__ */ (0,
|
|
7474
|
+
right: formation ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(Chip, { variant: "accent", children: formation }) : void 0,
|
|
7432
7475
|
onBack,
|
|
7433
7476
|
backLabel: ui.back
|
|
7434
7477
|
}
|
|
7435
7478
|
),
|
|
7436
|
-
!config && /* @__PURE__ */ (0,
|
|
7437
|
-
config && /* @__PURE__ */ (0,
|
|
7438
|
-
/* @__PURE__ */ (0,
|
|
7439
|
-
|
|
7440
|
-
|
|
7441
|
-
/* @__PURE__ */ (0,
|
|
7479
|
+
!config && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading }),
|
|
7480
|
+
config && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_jsx_runtime80.Fragment, { children: [
|
|
7481
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "ss-g-body", children: [
|
|
7482
|
+
!isOver && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(PointsLadderRow, { ladder: config.pointsLadder, guessesUsed: clientState?.guessHistory.length ?? 0, ui }),
|
|
7483
|
+
rows.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "ss-g-gxi-pitch", role: "group", "aria-label": t.pitchLabel, children: [
|
|
7484
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(PitchSvg, { variant: "full" }),
|
|
7485
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "ss-g-gxi-rows", children: rows.map((row, r) => /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("div", { className: "ss-g-gxi-row", children: row.map((pos, c) => {
|
|
7442
7486
|
const posLabel = pos.slot ? posBySlot.get(pos.slot) ?? "" : "";
|
|
7443
7487
|
const name = pos.slot ? nameBySlot.get(pos.slot) : void 0;
|
|
7444
7488
|
const lineupEntry = pos.slot ? lineupBySlot.get(pos.slot) : void 0;
|
|
7445
7489
|
const flag = nationalityFlag(pos.nationality);
|
|
7446
7490
|
if (lineupEntry) {
|
|
7447
|
-
return /* @__PURE__ */ (0,
|
|
7448
|
-
/* @__PURE__ */ (0,
|
|
7491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "ss-g-gxi-node", "data-revealed": "true", children: [
|
|
7492
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
7449
7493
|
PlayerAvatar,
|
|
7450
7494
|
{
|
|
7451
7495
|
name: lineupEntry.name,
|
|
@@ -7453,11 +7497,11 @@ function GuessTheXiGame({
|
|
|
7453
7497
|
className: "ss-g-gxi-disc ss-g-gxi-disc--photo"
|
|
7454
7498
|
}
|
|
7455
7499
|
),
|
|
7456
|
-
/* @__PURE__ */ (0,
|
|
7500
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "ss-g-gxi-pos ss-g-gxi-pos--name", children: splitName(lineupEntry.name).last })
|
|
7457
7501
|
] }, `${pos.slot}-${c}`);
|
|
7458
7502
|
}
|
|
7459
|
-
return /* @__PURE__ */ (0,
|
|
7460
|
-
/* @__PURE__ */ (0,
|
|
7503
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "ss-g-gxi-node", "data-revealed": name ? "true" : void 0, children: [
|
|
7504
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
7461
7505
|
"span",
|
|
7462
7506
|
{
|
|
7463
7507
|
className: "ss-g-gxi-disc",
|
|
@@ -7468,22 +7512,22 @@ function GuessTheXiGame({
|
|
|
7468
7512
|
children: flag
|
|
7469
7513
|
}
|
|
7470
7514
|
),
|
|
7471
|
-
name ? /* @__PURE__ */ (0,
|
|
7515
|
+
name ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "ss-g-gxi-pos ss-g-gxi-pos--name", children: splitName(name).last }) : posLabel && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "ss-g-gxi-pos", children: posLabel })
|
|
7472
7516
|
] }, `${pos.slot}-${c}`);
|
|
7473
7517
|
}) }, r)) })
|
|
7474
7518
|
] }),
|
|
7475
|
-
!isOver && wrongGuesses.length > 0 && /* @__PURE__ */ (0,
|
|
7476
|
-
/* @__PURE__ */ (0,
|
|
7519
|
+
!isOver && wrongGuesses.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "ss-g-gxi-wrong", children: [
|
|
7520
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "ss-g-gxi-wrong-l", children: t.notThem }),
|
|
7477
7521
|
wrongGuesses.map((g) => {
|
|
7478
7522
|
const crestUrl = config?.teamPool.find((tm) => tm.teamId === g.teamId)?.crestUrl;
|
|
7479
|
-
return /* @__PURE__ */ (0,
|
|
7480
|
-
/* @__PURE__ */ (0,
|
|
7481
|
-
/* @__PURE__ */ (0,
|
|
7523
|
+
return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("span", { className: "ss-g-gxi-wrong-chip", children: [
|
|
7524
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(CrestShield, { src: crestUrl, name: teamName(g.teamId), size: 18 }),
|
|
7525
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("s", { children: teamName(g.teamId) })
|
|
7482
7526
|
] }, g.teamId);
|
|
7483
7527
|
})
|
|
7484
7528
|
] }),
|
|
7485
|
-
isOver && /* @__PURE__ */ (0,
|
|
7486
|
-
/* @__PURE__ */ (0,
|
|
7529
|
+
isOver && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_jsx_runtime80.Fragment, { children: [
|
|
7530
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
7487
7531
|
ResultCard,
|
|
7488
7532
|
{
|
|
7489
7533
|
tone: solved ? "win" : failed ? "lose" : "neutral",
|
|
@@ -7494,29 +7538,29 @@ function GuessTheXiGame({
|
|
|
7494
7538
|
ui
|
|
7495
7539
|
}
|
|
7496
7540
|
),
|
|
7497
|
-
(solved || failed) && clientState?.answer && /* @__PURE__ */ (0,
|
|
7498
|
-
/* @__PURE__ */ (0,
|
|
7499
|
-
/* @__PURE__ */ (0,
|
|
7500
|
-
/* @__PURE__ */ (0,
|
|
7541
|
+
(solved || failed) && clientState?.answer && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "ss-g-gxi-answer", "data-testid": "gxi-answer-reveal", children: [
|
|
7542
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "ss-g-gxi-answer-label", children: t.theAnswer }),
|
|
7543
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(CrestShield, { src: clientState.answer.crestUrl, name: clientState.answer.teamName, size: 32 }),
|
|
7544
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { className: "ss-g-gxi-answer-name", children: clientState.answer.teamName })
|
|
7501
7545
|
] })
|
|
7502
7546
|
] })
|
|
7503
7547
|
] }),
|
|
7504
|
-
!isOver && /* @__PURE__ */ (0,
|
|
7505
|
-
query.length > 0 && filtered.length > 0 && /* @__PURE__ */ (0,
|
|
7548
|
+
!isOver && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(FooterBar, { children: [
|
|
7549
|
+
query.length > 0 && filtered.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
7506
7550
|
OptionList,
|
|
7507
7551
|
{
|
|
7508
7552
|
label: t.optionsLabel,
|
|
7509
7553
|
options: filtered.map((tm) => ({
|
|
7510
7554
|
key: tm.teamId,
|
|
7511
|
-
content: /* @__PURE__ */ (0,
|
|
7512
|
-
/* @__PURE__ */ (0,
|
|
7513
|
-
/* @__PURE__ */ (0,
|
|
7555
|
+
content: /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_jsx_runtime80.Fragment, { children: [
|
|
7556
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(CrestShield, { src: tm.crestUrl, name: tm.teamName, size: 28 }),
|
|
7557
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", { children: tm.teamName })
|
|
7514
7558
|
] })
|
|
7515
7559
|
})),
|
|
7516
7560
|
onPick: (k) => handlePick(Number(k))
|
|
7517
7561
|
}
|
|
7518
7562
|
),
|
|
7519
|
-
/* @__PURE__ */ (0,
|
|
7563
|
+
/* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
|
|
7520
7564
|
SearchField,
|
|
7521
7565
|
{
|
|
7522
7566
|
id: inputId,
|
|
@@ -7534,7 +7578,7 @@ function GuessTheXiGame({
|
|
|
7534
7578
|
|
|
7535
7579
|
// src/components/games/DailyQuizGame.tsx
|
|
7536
7580
|
var import_react43 = require("react");
|
|
7537
|
-
var
|
|
7581
|
+
var import_jsx_runtime81 = require("react/jsx-runtime");
|
|
7538
7582
|
function parseClientState6(json) {
|
|
7539
7583
|
if (!json) return null;
|
|
7540
7584
|
try {
|
|
@@ -7555,13 +7599,13 @@ function OptionName({ text }) {
|
|
|
7555
7599
|
const tokens = base.split(/\s+/).filter(Boolean);
|
|
7556
7600
|
const isPlainName = tokens.length >= 1 && tokens.length <= 4 && tokens.every((t) => NAME_TOKEN.test(t));
|
|
7557
7601
|
if (!isPlainName || base === "") {
|
|
7558
|
-
return /* @__PURE__ */ (0,
|
|
7602
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "ss-g-dq-opt-name", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "ss-g-dq-opt-full", children: text }) });
|
|
7559
7603
|
}
|
|
7560
7604
|
const { first, last } = splitName(base);
|
|
7561
|
-
return /* @__PURE__ */ (0,
|
|
7562
|
-
first && /* @__PURE__ */ (0,
|
|
7563
|
-
/* @__PURE__ */ (0,
|
|
7564
|
-
suffix && /* @__PURE__ */ (0,
|
|
7605
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("span", { className: "ss-g-dq-opt-name", children: [
|
|
7606
|
+
first && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "ss-g-dq-opt-first", children: first }),
|
|
7607
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "ss-g-dq-opt-last", children: last }),
|
|
7608
|
+
suffix && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "ss-g-dq-opt-suffix", children: suffix })
|
|
7565
7609
|
] });
|
|
7566
7610
|
}
|
|
7567
7611
|
function DailyQuizGame({
|
|
@@ -7580,9 +7624,9 @@ function DailyQuizGame({
|
|
|
7580
7624
|
const results = clientState?.results ?? [];
|
|
7581
7625
|
const isRevealed = results.length > 0 || result?.alreadyPlayed === true;
|
|
7582
7626
|
if (!config) {
|
|
7583
|
-
return /* @__PURE__ */ (0,
|
|
7584
|
-
/* @__PURE__ */ (0,
|
|
7585
|
-
/* @__PURE__ */ (0,
|
|
7627
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "ss-g-screen", "data-game": "daily-quiz", "data-testid": "game-screen-daily-quiz", children: [
|
|
7628
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(GameHeader, { title, onBack, backLabel: ui.back }),
|
|
7629
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
7586
7630
|
] });
|
|
7587
7631
|
}
|
|
7588
7632
|
const questions = config.questions;
|
|
@@ -7617,11 +7661,11 @@ function DailyQuizGame({
|
|
|
7617
7661
|
return r.isCorrect ? "correct" : "wrong";
|
|
7618
7662
|
});
|
|
7619
7663
|
const correctCount = results.filter((r) => r.isCorrect).length;
|
|
7620
|
-
return /* @__PURE__ */ (0,
|
|
7621
|
-
/* @__PURE__ */ (0,
|
|
7622
|
-
/* @__PURE__ */ (0,
|
|
7623
|
-
/* @__PURE__ */ (0,
|
|
7624
|
-
/* @__PURE__ */ (0,
|
|
7664
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "ss-g-screen", "data-game": "daily-quiz", "data-testid": "game-screen-daily-quiz", children: [
|
|
7665
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(GameHeader, { title, eyebrow: s.results, onBack, backLabel: ui.back }),
|
|
7666
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(SegmentProgress, { segments: segments2, ariaLabel: s.results }),
|
|
7667
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "ss-g-body", children: [
|
|
7668
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
|
|
7625
7669
|
ResultCard,
|
|
7626
7670
|
{
|
|
7627
7671
|
tone: "neutral",
|
|
@@ -7634,15 +7678,15 @@ function DailyQuizGame({
|
|
|
7634
7678
|
questions.map((q) => {
|
|
7635
7679
|
const r = findResult(results, q.index);
|
|
7636
7680
|
const picked = selections.get(q.index);
|
|
7637
|
-
return /* @__PURE__ */ (0,
|
|
7638
|
-
/* @__PURE__ */ (0,
|
|
7639
|
-
r && /* @__PURE__ */ (0,
|
|
7681
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "ss-g-dq-rq", children: [
|
|
7682
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "ss-g-dq-rq-stem", children: q.stem }),
|
|
7683
|
+
r && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "ss-g-dq-rq-opts", children: q.options.map((opt, optIdx) => {
|
|
7640
7684
|
let cls = "ss-g-dq-rq-opt";
|
|
7641
7685
|
if (optIdx === r.correctOptionIndex) cls += " ss-g-dq-rq-opt--correct";
|
|
7642
7686
|
else if (optIdx === picked && !r.isCorrect) cls += " ss-g-dq-rq-opt--wrong";
|
|
7643
|
-
return /* @__PURE__ */ (0,
|
|
7687
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: cls, children: opt }, optIdx);
|
|
7644
7688
|
}) }),
|
|
7645
|
-
r?.revealText && /* @__PURE__ */ (0,
|
|
7689
|
+
r?.revealText && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "ss-g-dq-why", children: r.revealText })
|
|
7646
7690
|
] }, q.index);
|
|
7647
7691
|
})
|
|
7648
7692
|
] })
|
|
@@ -7650,16 +7694,16 @@ function DailyQuizGame({
|
|
|
7650
7694
|
}
|
|
7651
7695
|
const segments = questions.map((_, i) => i < page ? "done" : i === page ? "current" : "todo");
|
|
7652
7696
|
const selectedIdx = current ? selections.get(current.index) : void 0;
|
|
7653
|
-
return /* @__PURE__ */ (0,
|
|
7654
|
-
/* @__PURE__ */ (0,
|
|
7655
|
-
/* @__PURE__ */ (0,
|
|
7656
|
-
/* @__PURE__ */ (0,
|
|
7657
|
-
/* @__PURE__ */ (0,
|
|
7658
|
-
/* @__PURE__ */ (0,
|
|
7697
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "ss-g-screen", "data-game": "daily-quiz", "data-testid": "game-screen-daily-quiz", children: [
|
|
7698
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(GameHeader, { title, eyebrow: s.questionOf(page + 1, total), onBack, backLabel: ui.back }),
|
|
7699
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(SegmentProgress, { segments, ariaLabel: s.progressAria(page + 1, total) }),
|
|
7700
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "ss-g-body", children: current && /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(import_jsx_runtime81.Fragment, { children: [
|
|
7701
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("h3", { className: "ss-g-dq-stem", children: current.stem }),
|
|
7702
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "ss-g-dq-opts", children: current.options.map((opt, optIdx) => {
|
|
7659
7703
|
const selected = optIdx === selectedIdx;
|
|
7660
7704
|
const imagePath = current.optionImagePaths?.[optIdx] ?? void 0;
|
|
7661
7705
|
const playerName = opt;
|
|
7662
|
-
return /* @__PURE__ */ (0,
|
|
7706
|
+
return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(
|
|
7663
7707
|
"button",
|
|
7664
7708
|
{
|
|
7665
7709
|
type: "button",
|
|
@@ -7668,25 +7712,25 @@ function DailyQuizGame({
|
|
|
7668
7712
|
disabled: submitting,
|
|
7669
7713
|
onClick: () => handleSelect(current.index, optIdx),
|
|
7670
7714
|
children: [
|
|
7671
|
-
current.optionImagePaths && /* @__PURE__ */ (0,
|
|
7672
|
-
/* @__PURE__ */ (0,
|
|
7673
|
-
/* @__PURE__ */ (0,
|
|
7715
|
+
current.optionImagePaths && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(PlayerAvatar, { name: playerName, imagePath, className: "ss-g-dq-opt-av" }),
|
|
7716
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)("span", { className: "ss-g-dq-badge", "aria-hidden": "true", children: selected ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(IconCheck, {}) : String.fromCharCode(65 + optIdx) }),
|
|
7717
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(OptionName, { text: opt })
|
|
7674
7718
|
]
|
|
7675
7719
|
},
|
|
7676
7720
|
optIdx
|
|
7677
7721
|
);
|
|
7678
7722
|
}) })
|
|
7679
7723
|
] }) }),
|
|
7680
|
-
/* @__PURE__ */ (0,
|
|
7681
|
-
page > 0 && /* @__PURE__ */ (0,
|
|
7682
|
-
isLast ? /* @__PURE__ */ (0,
|
|
7724
|
+
/* @__PURE__ */ (0, import_jsx_runtime81.jsx)(FooterBar, { children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "ss-g-dq-nav", children: [
|
|
7725
|
+
page > 0 && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(GameButton, { variant: "outline", onClick: goPrev, disabled: submitting, children: s.previous }),
|
|
7726
|
+
isLast ? /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(GameButton, { variant: "primary", block: true, onClick: handleSubmit, disabled: !currentAnswered || !allAnswered || submitting, children: submitting ? s.submitting : s.submit }) : /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(GameButton, { variant: "primary", block: true, onClick: goNext, disabled: !currentAnswered || submitting, children: s.next })
|
|
7683
7727
|
] }) })
|
|
7684
7728
|
] });
|
|
7685
7729
|
}
|
|
7686
7730
|
|
|
7687
7731
|
// src/components/games/MatchdayPredictorGame.tsx
|
|
7688
7732
|
var import_react44 = require("react");
|
|
7689
|
-
var
|
|
7733
|
+
var import_jsx_runtime82 = require("react/jsx-runtime");
|
|
7690
7734
|
var SCORER_SEARCH_THRESHOLD = 9;
|
|
7691
7735
|
function parseClientState7(json) {
|
|
7692
7736
|
if (!json) return null;
|
|
@@ -7704,7 +7748,7 @@ function isLocked(kickoffUtc) {
|
|
|
7704
7748
|
}
|
|
7705
7749
|
}
|
|
7706
7750
|
function IconMinus() {
|
|
7707
|
-
return /* @__PURE__ */ (0,
|
|
7751
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
7708
7752
|
"svg",
|
|
7709
7753
|
{
|
|
7710
7754
|
width: 18,
|
|
@@ -7715,20 +7759,20 @@ function IconMinus() {
|
|
|
7715
7759
|
strokeWidth: 2.2,
|
|
7716
7760
|
strokeLinecap: "round",
|
|
7717
7761
|
"aria-hidden": "true",
|
|
7718
|
-
children: /* @__PURE__ */ (0,
|
|
7762
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("path", { d: "M5 12h14" })
|
|
7719
7763
|
}
|
|
7720
7764
|
);
|
|
7721
7765
|
}
|
|
7722
7766
|
function TeamBadge({ team, label }) {
|
|
7723
|
-
return /* @__PURE__ */ (0,
|
|
7724
|
-
/* @__PURE__ */ (0,
|
|
7725
|
-
/* @__PURE__ */ (0,
|
|
7726
|
-
/* @__PURE__ */ (0,
|
|
7767
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "ss-g-mp-team", children: [
|
|
7768
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(CrestShield, { name: team.name, size: 44 }),
|
|
7769
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "ss-g-mp-team-name", children: team.name }),
|
|
7770
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "ss-g-mp-team-side", children: label })
|
|
7727
7771
|
] });
|
|
7728
7772
|
}
|
|
7729
7773
|
function ScoreCard({ home, away, h, a, t, edit }) {
|
|
7730
|
-
const col = (side, team, value) => /* @__PURE__ */ (0,
|
|
7731
|
-
edit && /* @__PURE__ */ (0,
|
|
7774
|
+
const col = (side, team, value) => /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "ss-g-mp-col", children: [
|
|
7775
|
+
edit && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
7732
7776
|
"button",
|
|
7733
7777
|
{
|
|
7734
7778
|
type: "button",
|
|
@@ -7736,11 +7780,11 @@ function ScoreCard({ home, away, h, a, t, edit }) {
|
|
|
7736
7780
|
"aria-label": t.goalsUp(team.name),
|
|
7737
7781
|
disabled: edit.disabled,
|
|
7738
7782
|
onClick: () => edit.onStep(side, 1),
|
|
7739
|
-
children: /* @__PURE__ */ (0,
|
|
7783
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(IconPlus, { size: 18 })
|
|
7740
7784
|
}
|
|
7741
7785
|
),
|
|
7742
|
-
/* @__PURE__ */ (0,
|
|
7743
|
-
edit && /* @__PURE__ */ (0,
|
|
7786
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "ss-g-mp-digit", "data-testid": "mp-digit", "data-active": edit ? String(edit.active === side) : "false", children: value }),
|
|
7787
|
+
edit && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
7744
7788
|
"button",
|
|
7745
7789
|
{
|
|
7746
7790
|
type: "button",
|
|
@@ -7748,27 +7792,27 @@ function ScoreCard({ home, away, h, a, t, edit }) {
|
|
|
7748
7792
|
"aria-label": t.goalsDown(team.name),
|
|
7749
7793
|
disabled: edit.disabled || value <= 0,
|
|
7750
7794
|
onClick: () => edit.onStep(side, -1),
|
|
7751
|
-
children: /* @__PURE__ */ (0,
|
|
7795
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(IconMinus, {})
|
|
7752
7796
|
}
|
|
7753
7797
|
)
|
|
7754
7798
|
] });
|
|
7755
|
-
return /* @__PURE__ */ (0,
|
|
7756
|
-
/* @__PURE__ */ (0,
|
|
7757
|
-
/* @__PURE__ */ (0,
|
|
7799
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "ss-g-mp-card", children: [
|
|
7800
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(TeamBadge, { team: home, label: t.home }),
|
|
7801
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "ss-g-mp-scores", children: [
|
|
7758
7802
|
col("home", home, h),
|
|
7759
|
-
/* @__PURE__ */ (0,
|
|
7803
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "ss-g-mp-dash", "aria-hidden": "true", children: "\u2013" }),
|
|
7760
7804
|
col("away", away, a)
|
|
7761
7805
|
] }),
|
|
7762
|
-
/* @__PURE__ */ (0,
|
|
7806
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(TeamBadge, { team: away, label: t.away })
|
|
7763
7807
|
] });
|
|
7764
7808
|
}
|
|
7765
7809
|
function OutcomeRow({ label, ok, detail, t }) {
|
|
7766
|
-
return /* @__PURE__ */ (0,
|
|
7767
|
-
/* @__PURE__ */ (0,
|
|
7768
|
-
/* @__PURE__ */ (0,
|
|
7769
|
-
ok ? /* @__PURE__ */ (0,
|
|
7770
|
-
/* @__PURE__ */ (0,
|
|
7771
|
-
detail ? /* @__PURE__ */ (0,
|
|
7810
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("li", { className: "ss-g-mp-row", "data-testid": "mp-row", "data-ok": String(ok), children: [
|
|
7811
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "ss-g-mp-row-k", children: label }),
|
|
7812
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("span", { className: "ss-g-mp-row-v", children: [
|
|
7813
|
+
ok ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(IconCheck, {}) : /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(IconClose, { size: 14 }),
|
|
7814
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "ss-g-sr", children: ok ? t.correct : t.incorrect }),
|
|
7815
|
+
detail ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "ss-g-mp-row-d", children: detail }) : null
|
|
7772
7816
|
] })
|
|
7773
7817
|
] });
|
|
7774
7818
|
}
|
|
@@ -7789,12 +7833,12 @@ function MatchdayPredictorGame({
|
|
|
7789
7833
|
const searchId = (0, import_react44.useId)();
|
|
7790
7834
|
const clientState = parseClientState7(result?.clientStateJson);
|
|
7791
7835
|
const alreadyPlayed = result?.alreadyPlayed === true;
|
|
7792
|
-
const header = /* @__PURE__ */ (0,
|
|
7836
|
+
const header = /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
7793
7837
|
GameHeader,
|
|
7794
7838
|
{
|
|
7795
7839
|
title: gameTitle({ gameId: "matchday-predictor" }, ui.games.titles),
|
|
7796
7840
|
eyebrow: config ? t.eyebrow(config.homeTeam.name, config.awayTeam.name) : void 0,
|
|
7797
|
-
right: config ? /* @__PURE__ */ (0,
|
|
7841
|
+
right: config ? /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Chip, { icon: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(IconLock, {}), children: ui.games.formatDayTime(config.kickoffUtc) }) : void 0,
|
|
7798
7842
|
onBack,
|
|
7799
7843
|
backLabel: ui.back
|
|
7800
7844
|
}
|
|
@@ -7802,10 +7846,10 @@ function MatchdayPredictorGame({
|
|
|
7802
7846
|
if (alreadyPlayed && clientState) {
|
|
7803
7847
|
if (!clientState.graded) {
|
|
7804
7848
|
const scorer = config?.scorerPool.find((p) => p.playerId === clientState.predictedFirstScorerPlayerId) ?? null;
|
|
7805
|
-
return /* @__PURE__ */ (0,
|
|
7849
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "ss-g-screen", "data-game": "matchday-predictor", "data-testid": "game-screen-matchday-predictor", children: [
|
|
7806
7850
|
header,
|
|
7807
|
-
/* @__PURE__ */ (0,
|
|
7808
|
-
config && /* @__PURE__ */ (0,
|
|
7851
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "ss-g-body", children: [
|
|
7852
|
+
config && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
7809
7853
|
ScoreCard,
|
|
7810
7854
|
{
|
|
7811
7855
|
home: config.homeTeam,
|
|
@@ -7815,7 +7859,7 @@ function MatchdayPredictorGame({
|
|
|
7815
7859
|
t
|
|
7816
7860
|
}
|
|
7817
7861
|
),
|
|
7818
|
-
/* @__PURE__ */ (0,
|
|
7862
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
7819
7863
|
ResultCard,
|
|
7820
7864
|
{
|
|
7821
7865
|
tone: "neutral",
|
|
@@ -7832,28 +7876,28 @@ function MatchdayPredictorGame({
|
|
|
7832
7876
|
}
|
|
7833
7877
|
)
|
|
7834
7878
|
] }),
|
|
7835
|
-
/* @__PURE__ */ (0,
|
|
7879
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(FooterBar, { children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("p", { className: "ss-g-mp-fun", children: t.forFun }) })
|
|
7836
7880
|
] });
|
|
7837
7881
|
}
|
|
7838
7882
|
const r = clientState.result;
|
|
7839
|
-
return /* @__PURE__ */ (0,
|
|
7883
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "ss-g-screen", "data-game": "matchday-predictor", "data-testid": "game-screen-matchday-predictor", children: [
|
|
7840
7884
|
header,
|
|
7841
|
-
/* @__PURE__ */ (0,
|
|
7842
|
-
config && /* @__PURE__ */ (0,
|
|
7843
|
-
/* @__PURE__ */ (0,
|
|
7844
|
-
/* @__PURE__ */ (0,
|
|
7845
|
-
/* @__PURE__ */ (0,
|
|
7846
|
-
/* @__PURE__ */ (0,
|
|
7847
|
-
!clientState.firstScorerVoid && /* @__PURE__ */ (0,
|
|
7885
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "ss-g-body", children: [
|
|
7886
|
+
config && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(ScoreCard, { home: config.homeTeam, away: config.awayTeam, h: r.homeScore, a: r.awayScore, t }),
|
|
7887
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(ResultCard, { tone: "neutral", title: t.fullTime(r.homeScore, r.awayScore), onBack, ui }),
|
|
7888
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("ul", { className: "ss-g-mp-rows", children: [
|
|
7889
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(OutcomeRow, { label: t.exactScore, ok: clientState.exactScoreCorrect, t }),
|
|
7890
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(OutcomeRow, { label: t.outcome, ok: clientState.outcomeCorrect, t }),
|
|
7891
|
+
!clientState.firstScorerVoid && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(OutcomeRow, { label: t.firstScorerRow, ok: clientState.firstScorerCorrect, detail: r.firstScorerName, t })
|
|
7848
7892
|
] })
|
|
7849
7893
|
] }),
|
|
7850
|
-
/* @__PURE__ */ (0,
|
|
7894
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(FooterBar, { children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("p", { className: "ss-g-mp-fun", children: t.forFun }) })
|
|
7851
7895
|
] });
|
|
7852
7896
|
}
|
|
7853
7897
|
if (!config) {
|
|
7854
|
-
return /* @__PURE__ */ (0,
|
|
7898
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "ss-g-screen", "data-game": "matchday-predictor", "data-testid": "game-screen-matchday-predictor", children: [
|
|
7855
7899
|
header,
|
|
7856
|
-
/* @__PURE__ */ (0,
|
|
7900
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
7857
7901
|
] });
|
|
7858
7902
|
}
|
|
7859
7903
|
const locked = isLocked(config.kickoffUtc);
|
|
@@ -7877,10 +7921,10 @@ function MatchdayPredictorGame({
|
|
|
7877
7921
|
const showSearch = pool.length > SCORER_SEARCH_THRESHOLD;
|
|
7878
7922
|
const q = query.trim().toLowerCase();
|
|
7879
7923
|
const visible = showSearch && q ? pool.filter((p) => p.playerName.toLowerCase().includes(q)) : pool;
|
|
7880
|
-
return /* @__PURE__ */ (0,
|
|
7924
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "ss-g-screen", "data-game": "matchday-predictor", "data-testid": "game-screen-matchday-predictor", children: [
|
|
7881
7925
|
header,
|
|
7882
|
-
/* @__PURE__ */ (0,
|
|
7883
|
-
/* @__PURE__ */ (0,
|
|
7926
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "ss-g-body", children: [
|
|
7927
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
7884
7928
|
ScoreCard,
|
|
7885
7929
|
{
|
|
7886
7930
|
home: config.homeTeam,
|
|
@@ -7891,12 +7935,12 @@ function MatchdayPredictorGame({
|
|
|
7891
7935
|
edit: { disabled, active: lastEdited, onStep: step }
|
|
7892
7936
|
}
|
|
7893
7937
|
),
|
|
7894
|
-
pool.length > 0 && /* @__PURE__ */ (0,
|
|
7895
|
-
/* @__PURE__ */ (0,
|
|
7896
|
-
/* @__PURE__ */ (0,
|
|
7897
|
-
/* @__PURE__ */ (0,
|
|
7938
|
+
pool.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("section", { className: "ss-g-mp-scorer", children: [
|
|
7939
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)("div", { className: "ss-g-mp-sec-head", children: [
|
|
7940
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("h3", { children: t.firstScorer }),
|
|
7941
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { children: t.optional })
|
|
7898
7942
|
] }),
|
|
7899
|
-
showSearch && /* @__PURE__ */ (0,
|
|
7943
|
+
showSearch && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
|
|
7900
7944
|
SearchField,
|
|
7901
7945
|
{
|
|
7902
7946
|
id: searchId,
|
|
@@ -7908,9 +7952,9 @@ function MatchdayPredictorGame({
|
|
|
7908
7952
|
disabled
|
|
7909
7953
|
}
|
|
7910
7954
|
),
|
|
7911
|
-
/* @__PURE__ */ (0,
|
|
7955
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("div", { className: "ss-g-mp-grid", children: visible.map((p) => {
|
|
7912
7956
|
const selected = firstScorerPlayerId === p.playerId;
|
|
7913
|
-
return /* @__PURE__ */ (0,
|
|
7957
|
+
return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
7914
7958
|
"button",
|
|
7915
7959
|
{
|
|
7916
7960
|
type: "button",
|
|
@@ -7920,15 +7964,15 @@ function MatchdayPredictorGame({
|
|
|
7920
7964
|
disabled,
|
|
7921
7965
|
onClick: () => setFirstScorerPlayerId((id) => id === p.playerId ? null : p.playerId),
|
|
7922
7966
|
children: [
|
|
7923
|
-
selected && /* @__PURE__ */ (0,
|
|
7924
|
-
/* @__PURE__ */ (0,
|
|
7925
|
-
/* @__PURE__ */ (0,
|
|
7967
|
+
selected && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "ss-g-mp-pcheck", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(IconCheck, { size: 12 }) }),
|
|
7968
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(Silhouette, { size: 52, variant: selected ? "selected" : "default" }),
|
|
7969
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "ss-g-mp-pname", children: splitName(p.playerName).last })
|
|
7926
7970
|
]
|
|
7927
7971
|
},
|
|
7928
7972
|
p.playerId
|
|
7929
7973
|
);
|
|
7930
7974
|
}) }),
|
|
7931
|
-
/* @__PURE__ */ (0,
|
|
7975
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(
|
|
7932
7976
|
"button",
|
|
7933
7977
|
{
|
|
7934
7978
|
type: "button",
|
|
@@ -7937,24 +7981,24 @@ function MatchdayPredictorGame({
|
|
|
7937
7981
|
disabled,
|
|
7938
7982
|
onClick: () => setFirstScorerPlayerId(null),
|
|
7939
7983
|
children: [
|
|
7940
|
-
/* @__PURE__ */ (0,
|
|
7984
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("span", { className: "ss-g-mp-radio", "aria-hidden": "true" }),
|
|
7941
7985
|
t.noScorer
|
|
7942
7986
|
]
|
|
7943
7987
|
}
|
|
7944
7988
|
)
|
|
7945
7989
|
] }),
|
|
7946
|
-
locked && /* @__PURE__ */ (0,
|
|
7990
|
+
locked && /* @__PURE__ */ (0, import_jsx_runtime82.jsx)("p", { className: "ss-g-mp-closed", children: t.closed })
|
|
7947
7991
|
] }),
|
|
7948
|
-
/* @__PURE__ */ (0,
|
|
7949
|
-
/* @__PURE__ */ (0,
|
|
7950
|
-
/* @__PURE__ */ (0,
|
|
7992
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(FooterBar, { children: [
|
|
7993
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)(GameButton, { variant: "primary", block: true, disabled, onClick: handleSubmit, children: submitting ? t.saving : t.save }),
|
|
7994
|
+
/* @__PURE__ */ (0, import_jsx_runtime82.jsx)("p", { className: "ss-g-mp-fun", children: t.forFun })
|
|
7951
7995
|
] })
|
|
7952
7996
|
] });
|
|
7953
7997
|
}
|
|
7954
7998
|
|
|
7955
7999
|
// src/components/games/StartingXiGame.tsx
|
|
7956
8000
|
var import_react45 = require("react");
|
|
7957
|
-
var
|
|
8001
|
+
var import_jsx_runtime83 = require("react/jsx-runtime");
|
|
7958
8002
|
var POINTS_PER_STARTER = 8;
|
|
7959
8003
|
var XI_SIZE = 11;
|
|
7960
8004
|
var DEFAULT_FORMATION = "4-3-3";
|
|
@@ -8003,20 +8047,20 @@ function StartingXiGame({
|
|
|
8003
8047
|
const searchId = (0, import_react45.useId)();
|
|
8004
8048
|
const clientState = parseClientState8(result?.clientStateJson);
|
|
8005
8049
|
const alreadyPlayed = result?.alreadyPlayed === true;
|
|
8006
|
-
const header = /* @__PURE__ */ (0,
|
|
8050
|
+
const header = /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
8007
8051
|
GameHeader,
|
|
8008
8052
|
{
|
|
8009
8053
|
title: gameTitle({ gameId: "starting-xi" }, ui.games.titles),
|
|
8010
8054
|
eyebrow: t.eyebrow,
|
|
8011
|
-
right: /* @__PURE__ */ (0,
|
|
8055
|
+
right: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Chip, { variant: "accent", children: t.perStarter(POINTS_PER_STARTER) }),
|
|
8012
8056
|
onBack,
|
|
8013
8057
|
backLabel: ui.back
|
|
8014
8058
|
}
|
|
8015
8059
|
);
|
|
8016
8060
|
function statusScreen(title, score) {
|
|
8017
|
-
return /* @__PURE__ */ (0,
|
|
8061
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "ss-g-screen", "data-game": "starting-xi", "data-testid": "game-screen-starting-xi", children: [
|
|
8018
8062
|
header,
|
|
8019
|
-
/* @__PURE__ */ (0,
|
|
8063
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: "ss-g-body", children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(ResultCard, { tone: "neutral", title, score, onBack, ui }) })
|
|
8020
8064
|
] });
|
|
8021
8065
|
}
|
|
8022
8066
|
if (alreadyPlayed) {
|
|
@@ -8025,9 +8069,9 @@ function StartingXiGame({
|
|
|
8025
8069
|
if (clientState.status === "graded") return statusScreen(t.gradedLine(clientState.correctCount), clientState.score);
|
|
8026
8070
|
}
|
|
8027
8071
|
if (!config) {
|
|
8028
|
-
return /* @__PURE__ */ (0,
|
|
8072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "ss-g-screen", "data-game": "starting-xi", "data-testid": "game-screen-starting-xi", children: [
|
|
8029
8073
|
header,
|
|
8030
|
-
/* @__PURE__ */ (0,
|
|
8074
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
8031
8075
|
] });
|
|
8032
8076
|
}
|
|
8033
8077
|
const { formation, slots } = formationSlots(config.formation);
|
|
@@ -8062,27 +8106,27 @@ function StartingXiGame({
|
|
|
8062
8106
|
onSubmit(JSON.stringify({ predictedPlayerIds: slotPlayers }));
|
|
8063
8107
|
}
|
|
8064
8108
|
const segments = slotPlayers.map((p) => p !== null ? "current" : "todo");
|
|
8065
|
-
return /* @__PURE__ */ (0,
|
|
8109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "ss-g-screen", "data-game": "starting-xi", "data-testid": "game-screen-starting-xi", children: [
|
|
8066
8110
|
header,
|
|
8067
|
-
/* @__PURE__ */ (0,
|
|
8111
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
8068
8112
|
SegmentProgress,
|
|
8069
8113
|
{
|
|
8070
8114
|
segments,
|
|
8071
8115
|
ariaLabel: t.picked(pickedCount),
|
|
8072
8116
|
leftLabel: t.picked(pickedCount),
|
|
8073
8117
|
rightLabel: t.toGo(XI_SIZE - pickedCount),
|
|
8074
|
-
right: /* @__PURE__ */ (0,
|
|
8118
|
+
right: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Chip, { children: formation })
|
|
8075
8119
|
}
|
|
8076
8120
|
),
|
|
8077
|
-
/* @__PURE__ */ (0,
|
|
8078
|
-
/* @__PURE__ */ (0,
|
|
8079
|
-
/* @__PURE__ */ (0,
|
|
8121
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "ss-g-body", children: [
|
|
8122
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "ss-g-xi-pitch", children: [
|
|
8123
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(PitchSvg, { variant: "half" }),
|
|
8080
8124
|
slots.map((s) => {
|
|
8081
8125
|
const playerId = slotPlayers[s.index] ?? null;
|
|
8082
8126
|
const player = playerId !== null ? byId.get(playerId) ?? null : null;
|
|
8083
8127
|
const name = player?.playerName ?? "";
|
|
8084
8128
|
const state = player ? "filled" : active === s.index ? "active" : "empty";
|
|
8085
|
-
return /* @__PURE__ */ (0,
|
|
8129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(
|
|
8086
8130
|
"button",
|
|
8087
8131
|
{
|
|
8088
8132
|
type: "button",
|
|
@@ -8094,21 +8138,21 @@ function StartingXiGame({
|
|
|
8094
8138
|
disabled: submitting,
|
|
8095
8139
|
onClick: () => tapSlot(s.index),
|
|
8096
8140
|
children: [
|
|
8097
|
-
/* @__PURE__ */ (0,
|
|
8098
|
-
/* @__PURE__ */ (0,
|
|
8141
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: "ss-g-xi-ring", "aria-hidden": "true", children: player ? player.jerseyNumber ?? "" : /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(IconPlus, { size: 18 }) }),
|
|
8142
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: "ss-g-xi-tag", "aria-hidden": "true", children: player ? splitName(name).last : s.label })
|
|
8099
8143
|
]
|
|
8100
8144
|
},
|
|
8101
8145
|
s.index
|
|
8102
8146
|
);
|
|
8103
8147
|
})
|
|
8104
8148
|
] }),
|
|
8105
|
-
/* @__PURE__ */ (0,
|
|
8106
|
-
/* @__PURE__ */ (0,
|
|
8107
|
-
/* @__PURE__ */ (0,
|
|
8108
|
-
/* @__PURE__ */ (0,
|
|
8109
|
-
] }) : /* @__PURE__ */ (0,
|
|
8110
|
-
activeSlot && /* @__PURE__ */ (0,
|
|
8111
|
-
/* @__PURE__ */ (0,
|
|
8149
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "ss-g-xi-picker", children: [
|
|
8150
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("div", { className: "ss-g-xi-picker-head", children: activeSlot ? /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_jsx_runtime83.Fragment, { children: [
|
|
8151
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(Chip, { variant: "badge", children: activeSlot.label }),
|
|
8152
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("strong", { children: t.pickFor(activeSlot.label) })
|
|
8153
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("strong", { children: t.allPicked }) }),
|
|
8154
|
+
activeSlot && /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_jsx_runtime83.Fragment, { children: [
|
|
8155
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
|
|
8112
8156
|
SearchField,
|
|
8113
8157
|
{
|
|
8114
8158
|
id: searchId,
|
|
@@ -8120,18 +8164,18 @@ function StartingXiGame({
|
|
|
8120
8164
|
disabled: submitting
|
|
8121
8165
|
}
|
|
8122
8166
|
),
|
|
8123
|
-
/* @__PURE__ */ (0,
|
|
8124
|
-
/* @__PURE__ */ (0,
|
|
8125
|
-
/* @__PURE__ */ (0,
|
|
8126
|
-
/* @__PURE__ */ (0,
|
|
8167
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("ul", { className: "ss-g-xi-list", children: available.map((p) => /* @__PURE__ */ (0, import_jsx_runtime83.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("button", { type: "button", className: "ss-g-xi-opt", disabled: submitting, onClick: () => pick(p.playerId), children: [
|
|
8168
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: "ss-g-xi-opt-no", "aria-hidden": "true", children: p.jerseyNumber ?? "" }),
|
|
8169
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: "ss-g-xi-opt-name", children: p.playerName }),
|
|
8170
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)("span", { className: "ss-g-xi-opt-pos", children: p.positionName })
|
|
8127
8171
|
] }) }, p.playerId)) })
|
|
8128
8172
|
] })
|
|
8129
8173
|
] })
|
|
8130
8174
|
] }),
|
|
8131
|
-
/* @__PURE__ */ (0,
|
|
8132
|
-
/* @__PURE__ */ (0,
|
|
8133
|
-
/* @__PURE__ */ (0,
|
|
8134
|
-
/* @__PURE__ */ (0,
|
|
8175
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(FooterBar, { children: [
|
|
8176
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(GameButton, { variant: "primary", block: true, disabled: !canSubmit, onClick: handleSubmit, children: submitting ? t.submitting : t.submit }),
|
|
8177
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("p", { className: "ss-g-xi-lock", children: [
|
|
8178
|
+
/* @__PURE__ */ (0, import_jsx_runtime83.jsx)(IconLock, {}),
|
|
8135
8179
|
lockAtUtc ? t.locksAt(ui.games.formatDayTime(lockAtUtc)) : t.locksSoon
|
|
8136
8180
|
] })
|
|
8137
8181
|
] })
|
|
@@ -8140,7 +8184,7 @@ function StartingXiGame({
|
|
|
8140
8184
|
|
|
8141
8185
|
// src/components/games/StatLadderGame.tsx
|
|
8142
8186
|
var import_react46 = require("react");
|
|
8143
|
-
var
|
|
8187
|
+
var import_jsx_runtime84 = require("react/jsx-runtime");
|
|
8144
8188
|
function ladderClue(ladder) {
|
|
8145
8189
|
const mystery = ladder.find((r) => r.rank === 2);
|
|
8146
8190
|
if (!mystery) return null;
|
|
@@ -8162,9 +8206,9 @@ function parseClientState9(json) {
|
|
|
8162
8206
|
}
|
|
8163
8207
|
function NameStack({ name }) {
|
|
8164
8208
|
const { first, last } = splitName(name);
|
|
8165
|
-
return /* @__PURE__ */ (0,
|
|
8166
|
-
first && /* @__PURE__ */ (0,
|
|
8167
|
-
/* @__PURE__ */ (0,
|
|
8209
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("span", { className: "ss-g-sl-name", children: [
|
|
8210
|
+
first && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("small", { children: `${first[0]}.` }),
|
|
8211
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("b", { children: last })
|
|
8168
8212
|
] });
|
|
8169
8213
|
}
|
|
8170
8214
|
function StatLadderGame({
|
|
@@ -8181,11 +8225,11 @@ function StatLadderGame({
|
|
|
8181
8225
|
const searchId = (0, import_react46.useId)();
|
|
8182
8226
|
const clientState = parseClientState9(result?.clientStateJson);
|
|
8183
8227
|
const revealed = clientState != null;
|
|
8184
|
-
const header = /* @__PURE__ */ (0,
|
|
8228
|
+
const header = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(GameHeader, { title: gameTitle({ gameId: "stat-ladder" }, ui.games.titles), eyebrow: t.eyebrow, onBack, backLabel: ui.back });
|
|
8185
8229
|
if (!config) {
|
|
8186
|
-
return /* @__PURE__ */ (0,
|
|
8230
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "ss-g-screen", "data-game": "stat-ladder", "data-testid": "game-screen-stat-ladder", children: [
|
|
8187
8231
|
header,
|
|
8188
|
-
/* @__PURE__ */ (0,
|
|
8232
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
8189
8233
|
] });
|
|
8190
8234
|
}
|
|
8191
8235
|
const question = t.question(config.statLabel);
|
|
@@ -8197,44 +8241,45 @@ function StatLadderGame({
|
|
|
8197
8241
|
if (selectedId === null || submitting || revealed) return;
|
|
8198
8242
|
onSubmit(JSON.stringify({ guessedPlayerId: selectedId }));
|
|
8199
8243
|
}
|
|
8200
|
-
return /* @__PURE__ */ (0,
|
|
8244
|
+
return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "ss-g-screen", "data-game": "stat-ladder", "data-testid": "game-screen-stat-ladder", children: [
|
|
8201
8245
|
header,
|
|
8202
|
-
/* @__PURE__ */ (0,
|
|
8203
|
-
/* @__PURE__ */ (0,
|
|
8204
|
-
|
|
8205
|
-
/* @__PURE__ */ (0,
|
|
8246
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "ss-g-body", children: [
|
|
8247
|
+
!revealed && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(PointsLadderRow, { ladder: config.pointsLadder, guessesUsed: 0, ui }),
|
|
8248
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "ss-g-sl-prompt", children: [
|
|
8249
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Chip, { variant: "accent", icon: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(IconShield, { size: 14 }), className: "ss-g-sl-stat", children: config.statLabel }),
|
|
8250
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("h3", { className: "ss-g-sl-q", children: [
|
|
8206
8251
|
question.pre,
|
|
8207
|
-
/* @__PURE__ */ (0,
|
|
8252
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("em", { children: question.emph }),
|
|
8208
8253
|
question.post
|
|
8209
8254
|
] })
|
|
8210
8255
|
] }),
|
|
8211
|
-
/* @__PURE__ */ (0,
|
|
8212
|
-
(rung) => rung.rank === 2 ? /* @__PURE__ */ (0,
|
|
8256
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("ol", { className: "ss-g-sl-rungs", children: rungs.map(
|
|
8257
|
+
(rung) => rung.rank === 2 ? /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
|
|
8213
8258
|
"li",
|
|
8214
8259
|
{
|
|
8215
8260
|
className: "ss-g-sl-rung ss-g-sl-rung--mystery",
|
|
8216
8261
|
"data-testid": "sl-mystery-rung",
|
|
8217
8262
|
"data-result": revealed ? clientState.isCorrect ? "correct" : "wrong" : void 0,
|
|
8218
8263
|
children: [
|
|
8219
|
-
/* @__PURE__ */ (0,
|
|
8220
|
-
revealed ? /* @__PURE__ */ (0,
|
|
8221
|
-
revealed ? /* @__PURE__ */ (0,
|
|
8222
|
-
/* @__PURE__ */ (0,
|
|
8264
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "ss-g-sl-rank", children: "2" }),
|
|
8265
|
+
revealed ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(PlayerAvatar, { name: clientState.revealedRank2.playerName, className: "ss-g-sl-av" }) : /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(Silhouette, { size: 52, variant: "mystery" }),
|
|
8266
|
+
revealed ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(NameStack, { name: clientState.revealedRank2.playerName }) : /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "ss-g-sl-who", children: t.whoSecond }),
|
|
8267
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "ss-g-sl-val ss-g-sl-val--mystery", children: rung.statValue })
|
|
8223
8268
|
]
|
|
8224
8269
|
},
|
|
8225
8270
|
rung.rank
|
|
8226
|
-
) : /* @__PURE__ */ (0,
|
|
8227
|
-
/* @__PURE__ */ (0,
|
|
8228
|
-
/* @__PURE__ */ (0,
|
|
8229
|
-
/* @__PURE__ */ (0,
|
|
8230
|
-
/* @__PURE__ */ (0,
|
|
8271
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("li", { className: "ss-g-sl-rung", children: [
|
|
8272
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "ss-g-sl-rank", children: rung.rank }),
|
|
8273
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(PlayerAvatar, { name: rung.playerName ?? "?", className: "ss-g-sl-av" }),
|
|
8274
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(NameStack, { name: rung.playerName ?? "?" }),
|
|
8275
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "ss-g-sl-val", children: rung.statValue })
|
|
8231
8276
|
] }, rung.rank)
|
|
8232
8277
|
) }),
|
|
8233
|
-
clue && /* @__PURE__ */ (0,
|
|
8234
|
-
/* @__PURE__ */ (0,
|
|
8235
|
-
/* @__PURE__ */ (0,
|
|
8278
|
+
clue && /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("p", { className: "ss-g-sl-clue", children: [
|
|
8279
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(IconBulb, {}),
|
|
8280
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { children: t.clue(clue, config.statLabel) })
|
|
8236
8281
|
] }),
|
|
8237
|
-
!revealed && /* @__PURE__ */ (0,
|
|
8282
|
+
!revealed && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("ul", { className: "ss-g-sl-pool", children: pool.map((p) => /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(
|
|
8238
8283
|
"button",
|
|
8239
8284
|
{
|
|
8240
8285
|
type: "button",
|
|
@@ -8247,13 +8292,13 @@ function StatLadderGame({
|
|
|
8247
8292
|
setQuery(p.playerName);
|
|
8248
8293
|
},
|
|
8249
8294
|
children: [
|
|
8250
|
-
/* @__PURE__ */ (0,
|
|
8251
|
-
/* @__PURE__ */ (0,
|
|
8252
|
-
selectedId === p.playerId && /* @__PURE__ */ (0,
|
|
8295
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(PlayerAvatar, { name: p.playerName, className: "ss-g-sl-opt-av" }),
|
|
8296
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "ss-g-sl-opt-name", children: p.playerName }),
|
|
8297
|
+
selectedId === p.playerId && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(IconCheck, {})
|
|
8253
8298
|
]
|
|
8254
8299
|
}
|
|
8255
8300
|
) }, p.playerId)) }),
|
|
8256
|
-
revealed && /* @__PURE__ */ (0,
|
|
8301
|
+
revealed && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
8257
8302
|
ResultCard,
|
|
8258
8303
|
{
|
|
8259
8304
|
tone: clientState.isCorrect ? "win" : "lose",
|
|
@@ -8264,8 +8309,8 @@ function StatLadderGame({
|
|
|
8264
8309
|
}
|
|
8265
8310
|
)
|
|
8266
8311
|
] }),
|
|
8267
|
-
!revealed && /* @__PURE__ */ (0,
|
|
8268
|
-
/* @__PURE__ */ (0,
|
|
8312
|
+
!revealed && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(FooterBar, { children: /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)("div", { className: "ss-g-sl-guess", children: [
|
|
8313
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
|
|
8269
8314
|
SearchField,
|
|
8270
8315
|
{
|
|
8271
8316
|
id: searchId,
|
|
@@ -8280,13 +8325,13 @@ function StatLadderGame({
|
|
|
8280
8325
|
disabled: submitting
|
|
8281
8326
|
}
|
|
8282
8327
|
),
|
|
8283
|
-
/* @__PURE__ */ (0,
|
|
8328
|
+
/* @__PURE__ */ (0, import_jsx_runtime84.jsx)(GameButton, { variant: "primary", disabled: selectedId === null || submitting, onClick: guess, children: t.guess })
|
|
8284
8329
|
] }) })
|
|
8285
8330
|
] });
|
|
8286
8331
|
}
|
|
8287
8332
|
|
|
8288
8333
|
// src/components/games/FanMotmGame.tsx
|
|
8289
|
-
var
|
|
8334
|
+
var import_jsx_runtime85 = require("react/jsx-runtime");
|
|
8290
8335
|
function parseClientState10(json) {
|
|
8291
8336
|
if (!json) return null;
|
|
8292
8337
|
try {
|
|
@@ -8307,20 +8352,20 @@ function FanMotmGame({
|
|
|
8307
8352
|
const clientState = parseClientState10(result?.clientStateJson);
|
|
8308
8353
|
const alreadyVoted = result?.alreadyPlayed === true;
|
|
8309
8354
|
const pickedId = clientState?.pickedPlayerId ?? null;
|
|
8310
|
-
const header = /* @__PURE__ */ (0,
|
|
8355
|
+
const header = /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(
|
|
8311
8356
|
GameHeader,
|
|
8312
8357
|
{
|
|
8313
8358
|
title: t.title,
|
|
8314
8359
|
eyebrow: t.eyebrow,
|
|
8315
|
-
right: alreadyVoted ? /* @__PURE__ */ (0,
|
|
8360
|
+
right: alreadyVoted ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Chip, { variant: "success", icon: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(IconCheck, {}), children: t.voted }) : void 0,
|
|
8316
8361
|
onBack,
|
|
8317
8362
|
backLabel: ui.back
|
|
8318
8363
|
}
|
|
8319
8364
|
);
|
|
8320
8365
|
if (!config) {
|
|
8321
|
-
return /* @__PURE__ */ (0,
|
|
8366
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "ss-g-screen", "data-game": "fan-motm", "data-testid": "game-screen-fan-motm", children: [
|
|
8322
8367
|
header,
|
|
8323
|
-
/* @__PURE__ */ (0,
|
|
8368
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "ss-g-body ss-g-loading", children: ui.games.loading })
|
|
8324
8369
|
] });
|
|
8325
8370
|
}
|
|
8326
8371
|
const picked = config.candidates.find((c) => c.playerId === pickedId) ?? null;
|
|
@@ -8328,12 +8373,12 @@ function FanMotmGame({
|
|
|
8328
8373
|
if (alreadyVoted || submitting) return;
|
|
8329
8374
|
onSubmit(JSON.stringify({ pickedPlayerId: candidateId }));
|
|
8330
8375
|
}
|
|
8331
|
-
return /* @__PURE__ */ (0,
|
|
8376
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "ss-g-screen", "data-game": "fan-motm", "data-testid": "game-screen-fan-motm", children: [
|
|
8332
8377
|
header,
|
|
8333
|
-
/* @__PURE__ */ (0,
|
|
8334
|
-
/* @__PURE__ */ (0,
|
|
8378
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "ss-g-body", children: [
|
|
8379
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("ul", { className: "ss-g-motm-list", children: config.candidates.map((c) => {
|
|
8335
8380
|
const isVoted = alreadyVoted && pickedId === c.playerId;
|
|
8336
|
-
return /* @__PURE__ */ (0,
|
|
8381
|
+
return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(
|
|
8337
8382
|
"button",
|
|
8338
8383
|
{
|
|
8339
8384
|
type: "button",
|
|
@@ -8342,24 +8387,24 @@ function FanMotmGame({
|
|
|
8342
8387
|
disabled: alreadyVoted || submitting,
|
|
8343
8388
|
onClick: () => handleVote(c.playerId),
|
|
8344
8389
|
children: [
|
|
8345
|
-
/* @__PURE__ */ (0,
|
|
8346
|
-
/* @__PURE__ */ (0,
|
|
8347
|
-
isVoted && /* @__PURE__ */ (0,
|
|
8390
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)(PlayerAvatar, { name: c.playerName, className: "ss-g-motm-av" }),
|
|
8391
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "ss-g-motm-name", children: c.playerName }),
|
|
8392
|
+
isVoted && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(Chip, { variant: "accent", className: "ss-g-motm-pill", children: t.yourVote })
|
|
8348
8393
|
]
|
|
8349
8394
|
}
|
|
8350
8395
|
) }, c.playerId);
|
|
8351
8396
|
}) }),
|
|
8352
|
-
alreadyVoted && picked && /* @__PURE__ */ (0,
|
|
8397
|
+
alreadyVoted && picked && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(ResultCard, { tone: "neutral", title: t.youVoted(picked.playerName), detail: t.thanks, onBack, ui })
|
|
8353
8398
|
] }),
|
|
8354
|
-
/* @__PURE__ */ (0,
|
|
8355
|
-
!alreadyVoted && /* @__PURE__ */ (0,
|
|
8356
|
-
/* @__PURE__ */ (0,
|
|
8399
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsxs)(FooterBar, { children: [
|
|
8400
|
+
!alreadyVoted && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("p", { className: "ss-g-motm-foot", children: t.tapToVote }),
|
|
8401
|
+
/* @__PURE__ */ (0, import_jsx_runtime85.jsx)("p", { className: "ss-g-motm-fun", children: t.forFun })
|
|
8357
8402
|
] })
|
|
8358
8403
|
] });
|
|
8359
8404
|
}
|
|
8360
8405
|
|
|
8361
8406
|
// src/components/GameScreenHost.tsx
|
|
8362
|
-
var
|
|
8407
|
+
var import_jsx_runtime86 = require("react/jsx-runtime");
|
|
8363
8408
|
var FIXTURE_GAME_IDS = /* @__PURE__ */ new Set([
|
|
8364
8409
|
"matchday-predictor",
|
|
8365
8410
|
"starting-xi",
|
|
@@ -8435,7 +8480,7 @@ function GameScreenHost({
|
|
|
8435
8480
|
function renderScreen() {
|
|
8436
8481
|
switch (gameId) {
|
|
8437
8482
|
case "mystery-tiger":
|
|
8438
|
-
return /* @__PURE__ */ (0,
|
|
8483
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
8439
8484
|
MysteryTigerGame,
|
|
8440
8485
|
{
|
|
8441
8486
|
...sharedProps,
|
|
@@ -8443,7 +8488,7 @@ function GameScreenHost({
|
|
|
8443
8488
|
}
|
|
8444
8489
|
);
|
|
8445
8490
|
case "higher-or-lower":
|
|
8446
|
-
return /* @__PURE__ */ (0,
|
|
8491
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
8447
8492
|
HigherOrLowerGame,
|
|
8448
8493
|
{
|
|
8449
8494
|
...sharedProps,
|
|
@@ -8451,7 +8496,7 @@ function GameScreenHost({
|
|
|
8451
8496
|
}
|
|
8452
8497
|
);
|
|
8453
8498
|
case "career-path":
|
|
8454
|
-
return /* @__PURE__ */ (0,
|
|
8499
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
8455
8500
|
CareerPathGame,
|
|
8456
8501
|
{
|
|
8457
8502
|
...sharedProps,
|
|
@@ -8460,7 +8505,7 @@ function GameScreenHost({
|
|
|
8460
8505
|
);
|
|
8461
8506
|
case "beat-the-grid": {
|
|
8462
8507
|
const btgConfig = safeParseConfig(configJson);
|
|
8463
|
-
return /* @__PURE__ */ (0,
|
|
8508
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
8464
8509
|
BeatTheGridGame,
|
|
8465
8510
|
{
|
|
8466
8511
|
...sharedProps,
|
|
@@ -8470,7 +8515,7 @@ function GameScreenHost({
|
|
|
8470
8515
|
);
|
|
8471
8516
|
}
|
|
8472
8517
|
case "guess-the-xi":
|
|
8473
|
-
return /* @__PURE__ */ (0,
|
|
8518
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
8474
8519
|
GuessTheXiGame,
|
|
8475
8520
|
{
|
|
8476
8521
|
...sharedProps,
|
|
@@ -8478,7 +8523,7 @@ function GameScreenHost({
|
|
|
8478
8523
|
}
|
|
8479
8524
|
);
|
|
8480
8525
|
case "daily-quiz":
|
|
8481
|
-
return /* @__PURE__ */ (0,
|
|
8526
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
8482
8527
|
DailyQuizGame,
|
|
8483
8528
|
{
|
|
8484
8529
|
...sharedProps,
|
|
@@ -8486,7 +8531,7 @@ function GameScreenHost({
|
|
|
8486
8531
|
}
|
|
8487
8532
|
);
|
|
8488
8533
|
case "matchday-predictor":
|
|
8489
|
-
return /* @__PURE__ */ (0,
|
|
8534
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
8490
8535
|
MatchdayPredictorGame,
|
|
8491
8536
|
{
|
|
8492
8537
|
...sharedProps,
|
|
@@ -8494,7 +8539,7 @@ function GameScreenHost({
|
|
|
8494
8539
|
}
|
|
8495
8540
|
);
|
|
8496
8541
|
case "starting-xi":
|
|
8497
|
-
return /* @__PURE__ */ (0,
|
|
8542
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
8498
8543
|
StartingXiGame,
|
|
8499
8544
|
{
|
|
8500
8545
|
...sharedProps,
|
|
@@ -8502,7 +8547,7 @@ function GameScreenHost({
|
|
|
8502
8547
|
}
|
|
8503
8548
|
);
|
|
8504
8549
|
case "stat-ladder":
|
|
8505
|
-
return /* @__PURE__ */ (0,
|
|
8550
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
8506
8551
|
StatLadderGame,
|
|
8507
8552
|
{
|
|
8508
8553
|
...sharedProps,
|
|
@@ -8510,7 +8555,7 @@ function GameScreenHost({
|
|
|
8510
8555
|
}
|
|
8511
8556
|
);
|
|
8512
8557
|
case "fan-motm":
|
|
8513
|
-
return /* @__PURE__ */ (0,
|
|
8558
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
|
|
8514
8559
|
FanMotmGame,
|
|
8515
8560
|
{
|
|
8516
8561
|
...sharedProps,
|
|
@@ -8518,10 +8563,10 @@ function GameScreenHost({
|
|
|
8518
8563
|
}
|
|
8519
8564
|
);
|
|
8520
8565
|
default:
|
|
8521
|
-
return /* @__PURE__ */ (0,
|
|
8566
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "ss-g-screen", "data-testid": `game-screen-${gameId}`, children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(GameHeader, { title: gameTitle({ gameId }, ui.games.titles), onBack, backLabel: ui.back }) });
|
|
8522
8567
|
}
|
|
8523
8568
|
}
|
|
8524
|
-
return /* @__PURE__ */ (0,
|
|
8569
|
+
return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "ss-w-gscreen", "data-testid": "gscreen", "data-lock-at": lockAtUtc ?? void 0, children: renderScreen() });
|
|
8525
8570
|
}
|
|
8526
8571
|
|
|
8527
8572
|
// src/components/games/ui/fonts.ts
|
|
@@ -8538,7 +8583,7 @@ function ensureGamesFonts(doc = document) {
|
|
|
8538
8583
|
}
|
|
8539
8584
|
|
|
8540
8585
|
// src/components/GamesPanel.tsx
|
|
8541
|
-
var
|
|
8586
|
+
var import_jsx_runtime87 = require("react/jsx-runtime");
|
|
8542
8587
|
function GamesPanel({
|
|
8543
8588
|
loggedIn,
|
|
8544
8589
|
games,
|
|
@@ -8551,9 +8596,9 @@ function GamesPanel({
|
|
|
8551
8596
|
(0, import_react48.useEffect)(() => {
|
|
8552
8597
|
ensureGamesFonts();
|
|
8553
8598
|
}, []);
|
|
8554
|
-
if (!loggedIn) return /* @__PURE__ */ (0,
|
|
8599
|
+
if (!loggedIn) return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(GamesLoginWall, { ui });
|
|
8555
8600
|
if (selected !== null) {
|
|
8556
|
-
return /* @__PURE__ */ (0,
|
|
8601
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "ss-w-gscreen-wrap", lang: ui.games.lang, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
8557
8602
|
GameScreenHost,
|
|
8558
8603
|
{
|
|
8559
8604
|
selected,
|
|
@@ -8567,7 +8612,7 @@ function GamesPanel({
|
|
|
8567
8612
|
}
|
|
8568
8613
|
) });
|
|
8569
8614
|
}
|
|
8570
|
-
return /* @__PURE__ */ (0,
|
|
8615
|
+
return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "ss-g-hub-wrap", "data-testid": "games-hub", lang: ui.games.lang, children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
|
|
8571
8616
|
GamesHub,
|
|
8572
8617
|
{
|
|
8573
8618
|
games,
|
|
@@ -8582,7 +8627,7 @@ function GamesPanel({
|
|
|
8582
8627
|
var import_react49 = require("react");
|
|
8583
8628
|
|
|
8584
8629
|
// src/components/LeaderboardRow.tsx
|
|
8585
|
-
var
|
|
8630
|
+
var import_jsx_runtime88 = require("react/jsx-runtime");
|
|
8586
8631
|
function formatPoints(n) {
|
|
8587
8632
|
return n.toLocaleString("en");
|
|
8588
8633
|
}
|
|
@@ -8591,14 +8636,14 @@ function LeaderboardWeeklyRow({
|
|
|
8591
8636
|
isMe
|
|
8592
8637
|
}) {
|
|
8593
8638
|
const rankClass = `ss-w-lb2-rank${row.rank <= 3 ? " ss-w-lb2-rank--top3" : ""}`;
|
|
8594
|
-
return /* @__PURE__ */ (0,
|
|
8595
|
-
/* @__PURE__ */ (0,
|
|
8639
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: `ss-w-lb2-row${isMe ? " ss-w-lb2-row--you" : ""}`, children: [
|
|
8640
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("span", { className: rankClass, children: [
|
|
8596
8641
|
"#",
|
|
8597
8642
|
row.rank
|
|
8598
8643
|
] }),
|
|
8599
|
-
/* @__PURE__ */ (0,
|
|
8600
|
-
/* @__PURE__ */ (0,
|
|
8601
|
-
row.currentStreak > 0 && /* @__PURE__ */ (0,
|
|
8644
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "ss-w-lb2-handle", children: row.handle }),
|
|
8645
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "ss-w-lb2-points", children: formatPoints(row.points) }),
|
|
8646
|
+
row.currentStreak > 0 && /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("span", { className: "ss-w-lb2-streak", children: [
|
|
8602
8647
|
"\u{1F525} ",
|
|
8603
8648
|
row.currentStreak
|
|
8604
8649
|
] })
|
|
@@ -8609,18 +8654,18 @@ function LeaderboardAllTimeRow({
|
|
|
8609
8654
|
isMe
|
|
8610
8655
|
}) {
|
|
8611
8656
|
const rankClass = `ss-w-lb2-rank${row.rank <= 3 ? " ss-w-lb2-rank--top3" : ""}`;
|
|
8612
|
-
return /* @__PURE__ */ (0,
|
|
8613
|
-
/* @__PURE__ */ (0,
|
|
8657
|
+
return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("div", { className: `ss-w-lb2-row${isMe ? " ss-w-lb2-row--you" : ""}`, children: [
|
|
8658
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("span", { className: rankClass, children: [
|
|
8614
8659
|
"#",
|
|
8615
8660
|
row.rank
|
|
8616
8661
|
] }),
|
|
8617
|
-
/* @__PURE__ */ (0,
|
|
8618
|
-
/* @__PURE__ */ (0,
|
|
8662
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "ss-w-lb2-handle", children: row.handle }),
|
|
8663
|
+
/* @__PURE__ */ (0, import_jsx_runtime88.jsx)("span", { className: "ss-w-lb2-points", children: formatPoints(row.allTimePoints) })
|
|
8619
8664
|
] });
|
|
8620
8665
|
}
|
|
8621
8666
|
|
|
8622
8667
|
// src/components/LeaderboardEmpty.tsx
|
|
8623
|
-
var
|
|
8668
|
+
var import_jsx_runtime89 = require("react/jsx-runtime");
|
|
8624
8669
|
function LeaderboardEmpty({
|
|
8625
8670
|
segment,
|
|
8626
8671
|
lastWeek,
|
|
@@ -8629,36 +8674,36 @@ function LeaderboardEmpty({
|
|
|
8629
8674
|
ui
|
|
8630
8675
|
}) {
|
|
8631
8676
|
if (segment === "alltime") {
|
|
8632
|
-
return /* @__PURE__ */ (0,
|
|
8633
|
-
/* @__PURE__ */ (0,
|
|
8634
|
-
/* @__PURE__ */ (0,
|
|
8677
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "ss-w-lb-empty ss-w-lb-empty--alltime", children: [
|
|
8678
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "ss-w-lb-empty-icon", "aria-hidden": "true", children: "\u{1F4CA}" }),
|
|
8679
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("p", { className: "ss-w-lb-empty-body", children: ui.leaderboardAllTimeEmpty })
|
|
8635
8680
|
] });
|
|
8636
8681
|
}
|
|
8637
8682
|
const fresh = lastWeek != null;
|
|
8638
8683
|
const title = fresh ? ui.leaderboardEmptyFreshTitle : ui.leaderboardEmptyColdTitle;
|
|
8639
8684
|
const body = fresh ? ui.leaderboardEmptyFreshBody : ui.leaderboardEmptyColdBody;
|
|
8640
|
-
return /* @__PURE__ */ (0,
|
|
8641
|
-
weeklyPrize && /* @__PURE__ */ (0,
|
|
8642
|
-
/* @__PURE__ */ (0,
|
|
8643
|
-
/* @__PURE__ */ (0,
|
|
8685
|
+
return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "ss-w-lb-empty", children: [
|
|
8686
|
+
weeklyPrize && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "ss-w-prize", children: [
|
|
8687
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "ss-w-prize-icon", "aria-hidden": "true", children: "\u{1F3C6}" }),
|
|
8688
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "ss-w-prize-body", children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "ss-w-prize-text", children: weeklyPrize }) })
|
|
8644
8689
|
] }),
|
|
8645
|
-
/* @__PURE__ */ (0,
|
|
8646
|
-
/* @__PURE__ */ (0,
|
|
8647
|
-
/* @__PURE__ */ (0,
|
|
8648
|
-
/* @__PURE__ */ (0,
|
|
8649
|
-
onPlay && /* @__PURE__ */ (0,
|
|
8690
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "ss-w-lb-empty-hero", children: [
|
|
8691
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { className: "ss-w-lb-empty-icon", "aria-hidden": "true", children: fresh ? "\u{1F3C6}" : "\u{1F3AE}" }),
|
|
8692
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("h4", { className: "ss-w-lb-empty-title", children: title }),
|
|
8693
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("p", { className: "ss-w-lb-empty-body", children: body }),
|
|
8694
|
+
onPlay && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("button", { type: "button", className: "ss-w-lb-empty-cta", onClick: onPlay, children: ui.leaderboardEmptyCta })
|
|
8650
8695
|
] }),
|
|
8651
|
-
fresh && lastWeek && /* @__PURE__ */ (0,
|
|
8652
|
-
/* @__PURE__ */ (0,
|
|
8653
|
-
/* @__PURE__ */ (0,
|
|
8654
|
-
/* @__PURE__ */ (0,
|
|
8655
|
-
/* @__PURE__ */ (0,
|
|
8696
|
+
fresh && lastWeek && /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "ss-w-lb-last", children: [
|
|
8697
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "ss-w-lb-last-label", children: ui.leaderboardLastWeekLabel }),
|
|
8698
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "ss-w-lb-last-champ", "aria-hidden": "true", children: "\u{1F947}" }),
|
|
8699
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "ss-w-lb-last-handle", children: lastWeek.handle }),
|
|
8700
|
+
/* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "ss-w-lb-last-points", children: formatPoints(lastWeek.points) })
|
|
8656
8701
|
] })
|
|
8657
8702
|
] });
|
|
8658
8703
|
}
|
|
8659
8704
|
|
|
8660
8705
|
// src/components/Leaderboard.tsx
|
|
8661
|
-
var
|
|
8706
|
+
var import_jsx_runtime90 = require("react/jsx-runtime");
|
|
8662
8707
|
function Leaderboard({
|
|
8663
8708
|
data,
|
|
8664
8709
|
ui,
|
|
@@ -8668,9 +8713,9 @@ function Leaderboard({
|
|
|
8668
8713
|
const myRow = segment === "weekly" ? data.myWeeklyRow : data.myAllTimeRow;
|
|
8669
8714
|
const offBoard = myRow !== null && myRow !== void 0 && myRow.rank === -1;
|
|
8670
8715
|
const isEmpty = segment === "weekly" ? data.weeklyTop.length === 0 : data.allTimeTop.length === 0;
|
|
8671
|
-
return /* @__PURE__ */ (0,
|
|
8672
|
-
/* @__PURE__ */ (0,
|
|
8673
|
-
/* @__PURE__ */ (0,
|
|
8716
|
+
return /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "ss-w-lb2", children: [
|
|
8717
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "ss-w-seg", children: [
|
|
8718
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
8674
8719
|
"button",
|
|
8675
8720
|
{
|
|
8676
8721
|
type: "button",
|
|
@@ -8680,7 +8725,7 @@ function Leaderboard({
|
|
|
8680
8725
|
children: ui.leaderboardThisWeek
|
|
8681
8726
|
}
|
|
8682
8727
|
),
|
|
8683
|
-
/* @__PURE__ */ (0,
|
|
8728
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
8684
8729
|
"button",
|
|
8685
8730
|
{
|
|
8686
8731
|
type: "button",
|
|
@@ -8691,7 +8736,7 @@ function Leaderboard({
|
|
|
8691
8736
|
}
|
|
8692
8737
|
)
|
|
8693
8738
|
] }),
|
|
8694
|
-
isEmpty ? /* @__PURE__ */ (0,
|
|
8739
|
+
isEmpty ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
8695
8740
|
LeaderboardEmpty,
|
|
8696
8741
|
{
|
|
8697
8742
|
segment,
|
|
@@ -8700,15 +8745,15 @@ function Leaderboard({
|
|
|
8700
8745
|
onPlay,
|
|
8701
8746
|
ui
|
|
8702
8747
|
}
|
|
8703
|
-
) : /* @__PURE__ */ (0,
|
|
8704
|
-
/* @__PURE__ */ (0,
|
|
8748
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)(import_jsx_runtime90.Fragment, { children: [
|
|
8749
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "ss-w-lb2-rows", children: segment === "weekly" ? data.weeklyTop.map((row) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
8705
8750
|
LeaderboardWeeklyRow,
|
|
8706
8751
|
{
|
|
8707
8752
|
row,
|
|
8708
8753
|
isMe: row.operatorUserId === data.myWeeklyRow?.operatorUserId
|
|
8709
8754
|
},
|
|
8710
8755
|
row.operatorUserId
|
|
8711
|
-
)) : data.allTimeTop.map((row) => /* @__PURE__ */ (0,
|
|
8756
|
+
)) : data.allTimeTop.map((row) => /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
|
|
8712
8757
|
LeaderboardAllTimeRow,
|
|
8713
8758
|
{
|
|
8714
8759
|
row,
|
|
@@ -8716,18 +8761,18 @@ function Leaderboard({
|
|
|
8716
8761
|
},
|
|
8717
8762
|
row.operatorUserId
|
|
8718
8763
|
)) }),
|
|
8719
|
-
/* @__PURE__ */ (0,
|
|
8720
|
-
myRow != null && (offBoard ? /* @__PURE__ */ (0,
|
|
8721
|
-
segment === "weekly" && data.myWeeklyRow && /* @__PURE__ */ (0,
|
|
8722
|
-
segment === "alltime" && data.myAllTimeRow && /* @__PURE__ */ (0,
|
|
8764
|
+
/* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "ss-w-kitline", children: "\u{1F3BD}" }),
|
|
8765
|
+
myRow != null && (offBoard ? /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "ss-w-lbgap", children: ui.leaderboardOffBoard }) : /* @__PURE__ */ (0, import_jsx_runtime90.jsxs)("div", { className: "ss-w-lb2-rows", children: [
|
|
8766
|
+
segment === "weekly" && data.myWeeklyRow && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(LeaderboardWeeklyRow, { row: data.myWeeklyRow, isMe: true }),
|
|
8767
|
+
segment === "alltime" && data.myAllTimeRow && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(LeaderboardAllTimeRow, { row: data.myAllTimeRow, isMe: true })
|
|
8723
8768
|
] })),
|
|
8724
|
-
segment === "alltime" && data.myAllTimeRow && !offBoard && /* @__PURE__ */ (0,
|
|
8769
|
+
segment === "alltime" && data.myAllTimeRow && !offBoard && /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "ss-w-lb2-rows", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("div", { className: "ss-w-lb2-row", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)("span", { className: "ss-w-lb2-handle", children: formatPoints(data.allTimeTop.reduce((s, r) => s + r.allTimePoints, 0)) }) }) })
|
|
8725
8770
|
] })
|
|
8726
8771
|
] });
|
|
8727
8772
|
}
|
|
8728
8773
|
|
|
8729
8774
|
// src/components/LeaderboardPanel.tsx
|
|
8730
|
-
var
|
|
8775
|
+
var import_jsx_runtime91 = require("react/jsx-runtime");
|
|
8731
8776
|
var EMPTY_PAYLOAD = {
|
|
8732
8777
|
week: "",
|
|
8733
8778
|
weeklyTop: [],
|
|
@@ -8738,19 +8783,19 @@ var EMPTY_PAYLOAD = {
|
|
|
8738
8783
|
lastWeek: null
|
|
8739
8784
|
};
|
|
8740
8785
|
function LeaderboardPanel({ loggedIn, data, loading, onPlay, ui }) {
|
|
8741
|
-
if (!loggedIn) return /* @__PURE__ */ (0,
|
|
8742
|
-
if (data === null && loading) return /* @__PURE__ */ (0,
|
|
8743
|
-
return /* @__PURE__ */ (0,
|
|
8786
|
+
if (!loggedIn) return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(GamesLoginWall, { ui });
|
|
8787
|
+
if (data === null && loading) return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "ss-w-mon-list" });
|
|
8788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)("div", { className: "ss-w-mon-list", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(Leaderboard, { data: data ?? EMPTY_PAYLOAD, ui, onPlay }) });
|
|
8744
8789
|
}
|
|
8745
8790
|
|
|
8746
8791
|
// src/components/PresetSpeedDial.tsx
|
|
8747
8792
|
var import_react50 = require("react");
|
|
8748
|
-
var
|
|
8793
|
+
var import_jsx_runtime92 = require("react/jsx-runtime");
|
|
8749
8794
|
function PresetSpeedDial({ expanded, showDot, strings, onToggle, onOpen, rootRef, buttonRef }) {
|
|
8750
8795
|
const pillsId = (0, import_react50.useId)();
|
|
8751
8796
|
const tabIndex = expanded ? 0 : -1;
|
|
8752
|
-
return /* @__PURE__ */ (0,
|
|
8753
|
-
/* @__PURE__ */ (0,
|
|
8797
|
+
return /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { ref: rootRef, className: "ss-w-dial", children: [
|
|
8798
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(
|
|
8754
8799
|
"button",
|
|
8755
8800
|
{
|
|
8756
8801
|
ref: buttonRef,
|
|
@@ -8761,20 +8806,20 @@ function PresetSpeedDial({ expanded, showDot, strings, onToggle, onOpen, rootRef
|
|
|
8761
8806
|
"aria-label": strings.dialName,
|
|
8762
8807
|
onClick: onToggle,
|
|
8763
8808
|
children: [
|
|
8764
|
-
/* @__PURE__ */ (0,
|
|
8765
|
-
/* @__PURE__ */ (0,
|
|
8766
|
-
showDot && !expanded ? /* @__PURE__ */ (0,
|
|
8809
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { className: "ss-w-dial-icon ss-w-dial-icon--open", children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(SlidersIcon, {}) }),
|
|
8810
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { className: "ss-w-dial-icon ss-w-dial-icon--close", children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(CloseIcon, {}) }),
|
|
8811
|
+
showDot && !expanded ? /* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { className: "ss-w-dial-dot", "aria-hidden": "true" }) : null
|
|
8767
8812
|
]
|
|
8768
8813
|
}
|
|
8769
8814
|
),
|
|
8770
|
-
/* @__PURE__ */ (0,
|
|
8771
|
-
/* @__PURE__ */ (0,
|
|
8772
|
-
/* @__PURE__ */ (0,
|
|
8773
|
-
/* @__PURE__ */ (0,
|
|
8815
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("div", { id: pillsId, className: "ss-w-dial-pills", "data-open": expanded ? "" : void 0, children: [
|
|
8816
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("button", { type: "button", className: "ss-w-dial-pill", tabIndex, onClick: () => onOpen("numbers"), children: [
|
|
8817
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(SlidersIcon, {}),
|
|
8818
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { className: "ss-w-dial-pill-label", children: strings.setNumbers })
|
|
8774
8819
|
] }),
|
|
8775
|
-
/* @__PURE__ */ (0,
|
|
8776
|
-
/* @__PURE__ */ (0,
|
|
8777
|
-
/* @__PURE__ */ (0,
|
|
8820
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsxs)("button", { type: "button", className: "ss-w-dial-pill", tabIndex, onClick: () => onOpen("combo"), children: [
|
|
8821
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)(ComboIcon, {}),
|
|
8822
|
+
/* @__PURE__ */ (0, import_jsx_runtime92.jsx)("span", { className: "ss-w-dial-pill-label", children: strings.buildCombo })
|
|
8778
8823
|
] })
|
|
8779
8824
|
] })
|
|
8780
8825
|
] });
|
|
@@ -8782,7 +8827,7 @@ function PresetSpeedDial({ expanded, showDot, strings, onToggle, onOpen, rootRef
|
|
|
8782
8827
|
|
|
8783
8828
|
// src/components/PresetTools.tsx
|
|
8784
8829
|
var import_react51 = require("react");
|
|
8785
|
-
var
|
|
8830
|
+
var import_jsx_runtime93 = require("react/jsx-runtime");
|
|
8786
8831
|
var FOCUSABLE = 'button:not([disabled]), [href], input:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
|
|
8787
8832
|
function PresetToolModal({ title, closeLabel, onClose, children, footer }) {
|
|
8788
8833
|
const dialogRef = (0, import_react51.useRef)(null);
|
|
@@ -8820,79 +8865,79 @@ function PresetToolModal({ title, closeLabel, onClose, children, footer }) {
|
|
|
8820
8865
|
first.focus();
|
|
8821
8866
|
}
|
|
8822
8867
|
};
|
|
8823
|
-
return /* @__PURE__ */ (0,
|
|
8824
|
-
/* @__PURE__ */ (0,
|
|
8825
|
-
/* @__PURE__ */ (0,
|
|
8826
|
-
/* @__PURE__ */ (0,
|
|
8868
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: "ss-w-tool-backdrop", children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { ref: dialogRef, className: "ss-w-tool", role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, tabIndex: -1, onKeyDown: trapTab, children: [
|
|
8869
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "ss-w-tool-head", children: [
|
|
8870
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("h2", { id: titleId, className: "ss-w-tool-title", children: title }),
|
|
8871
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("button", { type: "button", className: "ss-w-tool-close", "aria-label": closeLabel, onClick: onClose, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(CloseIcon, {}) })
|
|
8827
8872
|
] }),
|
|
8828
|
-
/* @__PURE__ */ (0,
|
|
8829
|
-
footer ? /* @__PURE__ */ (0,
|
|
8873
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: "ss-w-tool-body", children }),
|
|
8874
|
+
footer ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: "ss-w-tool-foot", children: footer }) : null
|
|
8830
8875
|
] }) });
|
|
8831
8876
|
}
|
|
8832
8877
|
function fillTemplate(template, slots) {
|
|
8833
8878
|
return template.split(/(\{[a-z]+\})/).filter((part) => part !== "").map((part, i) => {
|
|
8834
8879
|
const key = /^\{([a-z]+)\}$/.exec(part)?.[1];
|
|
8835
|
-
return /* @__PURE__ */ (0,
|
|
8880
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_react51.Fragment, { children: key !== void 0 && key in slots ? slots[key] : part }, i);
|
|
8836
8881
|
});
|
|
8837
8882
|
}
|
|
8838
8883
|
function NumberSelect({ current, choices: choices2, label, notToday, lockEmpty = true, onChoose }) {
|
|
8839
8884
|
const selected = Math.max(0, choices2.findIndex((c) => c.text === current));
|
|
8840
|
-
return /* @__PURE__ */ (0,
|
|
8841
|
-
/* @__PURE__ */ (0,
|
|
8842
|
-
/* @__PURE__ */ (0,
|
|
8885
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("span", { className: "ss-w-tool-num", children: [
|
|
8886
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("span", { className: "ss-w-tool-num-size", "aria-hidden": "true", children: current }),
|
|
8887
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("select", { className: "ss-w-tool-num-select", "aria-label": label, value: String(selected), onChange: (e) => {
|
|
8843
8888
|
const c = choices2[Number(e.target.value)];
|
|
8844
8889
|
if (c) onChoose(c.value);
|
|
8845
|
-
}, children: choices2.map((c, i) => /* @__PURE__ */ (0,
|
|
8890
|
+
}, children: choices2.map((c, i) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("option", { value: String(i), disabled: lockEmpty && !c.available && i !== selected, children: c.available ? c.text : `${c.text}${notToday}` }, i)) })
|
|
8846
8891
|
] });
|
|
8847
8892
|
}
|
|
8848
8893
|
function ChoiceSelect({ currentIdx, sizeLabels, optionLabels, label, onChoose }) {
|
|
8849
8894
|
const sizeText = sizeLabels[currentIdx] ?? "";
|
|
8850
|
-
return /* @__PURE__ */ (0,
|
|
8851
|
-
/* @__PURE__ */ (0,
|
|
8852
|
-
/* @__PURE__ */ (0,
|
|
8895
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("span", { className: "ss-w-tool-num", children: [
|
|
8896
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("span", { className: "ss-w-tool-num-size", "aria-hidden": "true", children: sizeText }),
|
|
8897
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("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__ */ (0, import_jsx_runtime93.jsx)("option", { value: String(i), children: opt }, i)) })
|
|
8853
8898
|
] });
|
|
8854
8899
|
}
|
|
8855
8900
|
function SendButton({ label, display, disabled, onClick }) {
|
|
8856
|
-
return /* @__PURE__ */ (0,
|
|
8901
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("button", { type: "button", className: "ss-w-tool-send", "aria-label": `${label}: ${display}`, disabled, onClick, children: label });
|
|
8857
8902
|
}
|
|
8858
8903
|
function PickList({ picks, formatKickoff }) {
|
|
8859
|
-
return /* @__PURE__ */ (0,
|
|
8860
|
-
/* @__PURE__ */ (0,
|
|
8904
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("ul", { className: "ss-w-tool-picks", role: "list", children: picks.map((p) => /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("li", { className: "ss-w-tool-pick", children: [
|
|
8905
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("span", { className: "ss-w-tool-pick-match", children: [
|
|
8861
8906
|
p.homeTeamName,
|
|
8862
8907
|
" \u2013 ",
|
|
8863
8908
|
p.awayTeamName
|
|
8864
8909
|
] }),
|
|
8865
|
-
/* @__PURE__ */ (0,
|
|
8910
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("span", { className: "ss-w-tool-pick-sel", children: [
|
|
8866
8911
|
p.marketLabel,
|
|
8867
8912
|
": ",
|
|
8868
8913
|
p.selectionLabel,
|
|
8869
8914
|
p.line ? ` ${p.line}` : ""
|
|
8870
8915
|
] }),
|
|
8871
|
-
/* @__PURE__ */ (0,
|
|
8872
|
-
/* @__PURE__ */ (0,
|
|
8916
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("span", { className: "ss-w-tool-pick-kick", children: formatKickoff(p.kickoffUtc) }),
|
|
8917
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("span", { className: "ss-w-tool-pick-price", children: p.price.toFixed(2) })
|
|
8873
8918
|
] }, p.matchOddsId)) });
|
|
8874
8919
|
}
|
|
8875
8920
|
function ComboPreview({ cell, formatKickoff }) {
|
|
8876
|
-
return /* @__PURE__ */ (0,
|
|
8877
|
-
/* @__PURE__ */ (0,
|
|
8878
|
-
/* @__PURE__ */ (0,
|
|
8921
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_jsx_runtime93.Fragment, { children: [
|
|
8922
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(PickList, { picks: cell.combo.legs, formatKickoff }),
|
|
8923
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: "ss-w-tool-math", children: cell.combo.multiplication })
|
|
8879
8924
|
] });
|
|
8880
8925
|
}
|
|
8881
8926
|
function Unavailable({ text }) {
|
|
8882
|
-
return /* @__PURE__ */ (0,
|
|
8927
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("p", { className: "ss-w-tool-unavailable", children: text });
|
|
8883
8928
|
}
|
|
8884
8929
|
function AskRow({ icon, ask, ready, send }) {
|
|
8885
|
-
return /* @__PURE__ */ (0,
|
|
8886
|
-
/* @__PURE__ */ (0,
|
|
8887
|
-
/* @__PURE__ */ (0,
|
|
8888
|
-
/* @__PURE__ */ (0,
|
|
8889
|
-
ready ? /* @__PURE__ */ (0,
|
|
8930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("section", { className: "ss-w-tool-row ss-w-tool-row--ask", children: [
|
|
8931
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("span", { className: "ss-w-tool-icon", "aria-hidden": "true", children: icon }),
|
|
8932
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "ss-w-tool-main", children: [
|
|
8933
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("p", { className: "ss-w-tool-ask", children: ask }),
|
|
8934
|
+
ready ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("span", { className: "ss-w-tool-ready", children: ready }) : null
|
|
8890
8935
|
] }),
|
|
8891
8936
|
send
|
|
8892
8937
|
] });
|
|
8893
8938
|
}
|
|
8894
8939
|
function RoundSend({ label, display, disabled, onClick }) {
|
|
8895
|
-
return /* @__PURE__ */ (0,
|
|
8940
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("button", { type: "button", className: "ss-w-tool-go", "aria-label": `${label}: ${display}`, disabled, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(SendIcon, {}) });
|
|
8896
8941
|
}
|
|
8897
8942
|
var BIG_COMBO = { total: 50, legs: 6 };
|
|
8898
8943
|
function SetNumbersTool({ grid, strings, streaming, onSend, onClose }) {
|
|
@@ -8958,77 +9003,77 @@ function SetNumbersTool({ grid, strings, streaming, onSend, onClose }) {
|
|
|
8958
9003
|
const marketLabels = markets.map((c) => strings.marketShort(c.marketDeveloperName, c.marketLabel, c.selectionLabel ?? null));
|
|
8959
9004
|
const singlesReady = (cell) => cell ? strings.readyCount(cell.picks.length) : strings.unavailable;
|
|
8960
9005
|
const comboReady = (cell) => cell ? strings.readyAt(cell.combo.total) : strings.unavailable;
|
|
8961
|
-
return /* @__PURE__ */ (0,
|
|
8962
|
-
/* @__PURE__ */ (0,
|
|
9006
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(PresetToolModal, { title: strings.setNumbers, closeLabel: strings.close, onClose, children: [
|
|
9007
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
8963
9008
|
AskRow,
|
|
8964
9009
|
{
|
|
8965
9010
|
icon: "\u{1F3AF}",
|
|
8966
9011
|
ask: fillTemplate(strings.maxPriceRow, {
|
|
8967
9012
|
count: String(count),
|
|
8968
|
-
price: /* @__PURE__ */ (0,
|
|
9013
|
+
price: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(NumberSelect, { current: maxPrice.toFixed(2), choices: maxChoices, label: strings.maxPriceName, notToday: strings.notToday, onChoose: chooseMax })
|
|
8969
9014
|
}),
|
|
8970
9015
|
ready: singlesReady(maxCell),
|
|
8971
|
-
send: /* @__PURE__ */ (0,
|
|
9016
|
+
send: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(RoundSend, { label: strings.send, display: strings.maxPriceDisplay(count, maxPrice), disabled: !maxCell || streaming, onClick: () => {
|
|
8972
9017
|
if (maxCell) onSend(maxPriceAsk(maxCell, strings));
|
|
8973
9018
|
} })
|
|
8974
9019
|
}
|
|
8975
9020
|
),
|
|
8976
|
-
/* @__PURE__ */ (0,
|
|
9021
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
8977
9022
|
AskRow,
|
|
8978
9023
|
{
|
|
8979
9024
|
icon: "\u{1F4C8}",
|
|
8980
9025
|
ask: fillTemplate(strings.minPriceRow, {
|
|
8981
9026
|
count: String(count),
|
|
8982
|
-
price: /* @__PURE__ */ (0,
|
|
9027
|
+
price: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(NumberSelect, { current: minPrice.toFixed(2), choices: minChoices, label: strings.minPriceName, notToday: strings.notToday, onChoose: chooseMin })
|
|
8983
9028
|
}),
|
|
8984
9029
|
ready: singlesReady(minCell),
|
|
8985
|
-
send: /* @__PURE__ */ (0,
|
|
9030
|
+
send: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(RoundSend, { label: strings.send, display: strings.minPriceDisplay(count, minPrice), disabled: !minCell || streaming, onClick: () => {
|
|
8986
9031
|
if (minCell) onSend(minPriceAsk(minCell, strings));
|
|
8987
9032
|
} })
|
|
8988
9033
|
}
|
|
8989
9034
|
),
|
|
8990
|
-
/* @__PURE__ */ (0,
|
|
9035
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
8991
9036
|
AskRow,
|
|
8992
9037
|
{
|
|
8993
9038
|
icon: "\u2728",
|
|
8994
9039
|
ask: fillTemplate(strings.comboRow, {
|
|
8995
|
-
legs: /* @__PURE__ */ (0,
|
|
8996
|
-
total: /* @__PURE__ */ (0,
|
|
9040
|
+
legs: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(NumberSelect, { current: String(legs), choices: legChoicesFor(total), label: strings.matchesLabel, notToday: strings.notToday, lockEmpty: false, onChoose: chooseLegs }),
|
|
9041
|
+
total: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(NumberSelect, { current: total.toFixed(1), choices: totalChoices, label: strings.totalLabel, notToday: strings.notToday, onChoose: chooseTotal })
|
|
8997
9042
|
}),
|
|
8998
9043
|
ready: comboReady(comboCell),
|
|
8999
|
-
send: /* @__PURE__ */ (0,
|
|
9044
|
+
send: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(RoundSend, { label: strings.send, display: strings.comboDisplay(legs, total), disabled: !comboCell || streaming, onClick: () => {
|
|
9000
9045
|
if (comboCell) onSend(comboAsk(comboCell, strings));
|
|
9001
9046
|
} })
|
|
9002
9047
|
}
|
|
9003
9048
|
),
|
|
9004
|
-
/* @__PURE__ */ (0,
|
|
9049
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
9005
9050
|
AskRow,
|
|
9006
9051
|
{
|
|
9007
9052
|
icon: "\u{1F3C6}",
|
|
9008
9053
|
ask: fillTemplate(strings.bigComboRow, {
|
|
9009
|
-
legs: /* @__PURE__ */ (0,
|
|
9010
|
-
total: /* @__PURE__ */ (0,
|
|
9054
|
+
legs: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(NumberSelect, { current: String(bigLegs), choices: legChoicesFor(bigTotal), label: strings.matchesLabel, notToday: strings.notToday, lockEmpty: false, onChoose: chooseBigLegs }),
|
|
9055
|
+
total: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(NumberSelect, { current: bigTotal.toFixed(1), choices: totalChoices, label: strings.totalLabel, notToday: strings.notToday, onChoose: chooseBigTotal })
|
|
9011
9056
|
}),
|
|
9012
9057
|
ready: comboReady(bigCell),
|
|
9013
|
-
send: /* @__PURE__ */ (0,
|
|
9058
|
+
send: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(RoundSend, { label: strings.send, display: strings.comboDisplay(bigLegs, bigTotal), disabled: !bigCell || streaming, onClick: () => {
|
|
9014
9059
|
if (bigCell) onSend(comboAsk(bigCell, strings));
|
|
9015
9060
|
} })
|
|
9016
9061
|
}
|
|
9017
9062
|
),
|
|
9018
|
-
markets.length > 0 && /* @__PURE__ */ (0,
|
|
9063
|
+
markets.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
|
|
9019
9064
|
AskRow,
|
|
9020
9065
|
{
|
|
9021
9066
|
icon: "\u26BD",
|
|
9022
9067
|
ask: fillTemplate(strings.marketRow, {
|
|
9023
|
-
market: /* @__PURE__ */ (0,
|
|
9068
|
+
market: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(ChoiceSelect, { currentIdx: marketIdx, sizeLabels: marketLabels, optionLabels: marketLabels, label: strings.marketName, onChoose: chooseMarket })
|
|
9024
9069
|
}),
|
|
9025
9070
|
ready: marketCell ? strings.readyCount(marketCell.count) : null,
|
|
9026
|
-
send: /* @__PURE__ */ (0,
|
|
9071
|
+
send: /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(RoundSend, { label: strings.send, display: marketCell ? marketDisplay(marketCell, strings) : "", disabled: !marketCell || streaming, onClick: () => {
|
|
9027
9072
|
if (marketCell) onSend(marketAsk(marketCell, strings));
|
|
9028
9073
|
} })
|
|
9029
9074
|
}
|
|
9030
9075
|
),
|
|
9031
|
-
/* @__PURE__ */ (0,
|
|
9076
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("p", { className: "ss-w-vh", "aria-live": "polite", children: announcement })
|
|
9032
9077
|
] });
|
|
9033
9078
|
}
|
|
9034
9079
|
function BuildComboTool({ grid, strings, streaming, formatKickoff, initialTotal, initialLegs, onSend, onClose }) {
|
|
@@ -9052,24 +9097,24 @@ function BuildComboTool({ grid, strings, streaming, formatKickoff, initialTotal,
|
|
|
9052
9097
|
const d = strings.comboDisplay(nextLegs, nextTotal);
|
|
9053
9098
|
setAnnouncement(findCombo(grid, nextTotal, nextLegs) ? d : `${d}. ${strings.unavailable}`);
|
|
9054
9099
|
};
|
|
9055
|
-
const footer = /* @__PURE__ */ (0,
|
|
9100
|
+
const footer = /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(SendButton, { label: strings.send, display, disabled: !cell || streaming, onClick: () => {
|
|
9056
9101
|
if (cell) onSend(comboAsk(cell, strings));
|
|
9057
9102
|
} });
|
|
9058
|
-
return /* @__PURE__ */ (0,
|
|
9059
|
-
/* @__PURE__ */ (0,
|
|
9060
|
-
/* @__PURE__ */ (0,
|
|
9061
|
-
/* @__PURE__ */ (0,
|
|
9103
|
+
return /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(PresetToolModal, { title: strings.buildCombo, closeLabel: strings.close, onClose, footer, children: [
|
|
9104
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "ss-w-tool-section", role: "group", "aria-label": strings.totalLabel, children: [
|
|
9105
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("span", { className: "ss-w-tool-label", "aria-hidden": "true", children: strings.totalLabel }),
|
|
9106
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("div", { className: "ss-w-tool-chips", children: totals.map((t) => /* @__PURE__ */ (0, import_jsx_runtime93.jsx)("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)) })
|
|
9062
9107
|
] }),
|
|
9063
|
-
/* @__PURE__ */ (0,
|
|
9064
|
-
/* @__PURE__ */ (0,
|
|
9065
|
-
/* @__PURE__ */ (0,
|
|
9066
|
-
/* @__PURE__ */ (0,
|
|
9067
|
-
/* @__PURE__ */ (0,
|
|
9068
|
-
/* @__PURE__ */ (0,
|
|
9108
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "ss-w-tool-section", role: "group", "aria-label": strings.matchesLabel, children: [
|
|
9109
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("span", { className: "ss-w-tool-label", "aria-hidden": "true", children: strings.matchesLabel }),
|
|
9110
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsxs)("div", { className: "ss-w-tool-stepper", children: [
|
|
9111
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("button", { type: "button", className: "ss-w-tool-step", "aria-label": strings.fewerMatches, disabled: legs <= minLegs, onClick: () => choose(total, legs - 1), children: "\u2212" }),
|
|
9112
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("span", { className: "ss-w-tool-count", children: legs }),
|
|
9113
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("button", { type: "button", className: "ss-w-tool-step", "aria-label": strings.moreMatches, disabled: legs >= maxLegs, onClick: () => choose(total, legs + 1), children: "+" })
|
|
9069
9114
|
] })
|
|
9070
9115
|
] }),
|
|
9071
|
-
cell ? /* @__PURE__ */ (0,
|
|
9072
|
-
/* @__PURE__ */ (0,
|
|
9116
|
+
cell ? /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(ComboPreview, { cell, formatKickoff }) : /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(Unavailable, { text: strings.unavailable }),
|
|
9117
|
+
/* @__PURE__ */ (0, import_jsx_runtime93.jsx)("p", { className: "ss-w-vh", "aria-live": "polite", children: announcement })
|
|
9073
9118
|
] });
|
|
9074
9119
|
}
|
|
9075
9120
|
|
|
@@ -9171,7 +9216,7 @@ function markToolSeen() {
|
|
|
9171
9216
|
}
|
|
9172
9217
|
|
|
9173
9218
|
// src/components/ChatPanel.tsx
|
|
9174
|
-
var
|
|
9219
|
+
var import_jsx_runtime94 = require("react/jsx-runtime");
|
|
9175
9220
|
var FULLSCREEN_QUERY = "(max-width: 639px)";
|
|
9176
9221
|
function useIsModal() {
|
|
9177
9222
|
const [modal, setModal] = (0, import_react53.useState)(false);
|
|
@@ -9262,8 +9307,8 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
9262
9307
|
focusAfterCloseRef.current = "composer";
|
|
9263
9308
|
setTool(null);
|
|
9264
9309
|
}, [tool, onChatTab, presetGrid]);
|
|
9265
|
-
return /* @__PURE__ */ (0,
|
|
9266
|
-
/* @__PURE__ */ (0,
|
|
9310
|
+
return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { className: "ss-w-panel", role: "dialog", "aria-modal": isModal, "aria-label": ui.chatDialogLabel, children: [
|
|
9311
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
9267
9312
|
ChatHeader,
|
|
9268
9313
|
{
|
|
9269
9314
|
onClose: close,
|
|
@@ -9276,7 +9321,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
9276
9321
|
moreOptionsLabel: ui.moreOptions
|
|
9277
9322
|
}
|
|
9278
9323
|
),
|
|
9279
|
-
monitor && /* @__PURE__ */ (0,
|
|
9324
|
+
monitor && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
9280
9325
|
TabBar,
|
|
9281
9326
|
{
|
|
9282
9327
|
monitor,
|
|
@@ -9288,9 +9333,9 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
9288
9333
|
gamesEnabled: gamesResult?.enabled ?? false
|
|
9289
9334
|
}
|
|
9290
9335
|
),
|
|
9291
|
-
/* @__PURE__ */ (0,
|
|
9292
|
-
/* @__PURE__ */ (0,
|
|
9293
|
-
showDial ? /* @__PURE__ */ (0,
|
|
9336
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { ref: layerRef, className: "ss-w-chat-layer", "data-dial": presetGrid ? "" : void 0, style: onChatTab ? void 0 : HIDDEN_LAYER_STYLE, children: [
|
|
9337
|
+
/* @__PURE__ */ (0, import_jsx_runtime94.jsx)(PresetToolsContext.Provider, { value: toolsValue, children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(MessageList, { controller, ui, slip, onDashboardTap, monitor }) }),
|
|
9338
|
+
showDial ? /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
9294
9339
|
PresetSpeedDial,
|
|
9295
9340
|
{
|
|
9296
9341
|
expanded: dial.expanded,
|
|
@@ -9302,12 +9347,12 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
9302
9347
|
buttonRef: dialButtonRef
|
|
9303
9348
|
}
|
|
9304
9349
|
) : null,
|
|
9305
|
-
tool && presetGrid && onChatTab ? tool.kind === "numbers" ? /* @__PURE__ */ (0,
|
|
9350
|
+
tool && presetGrid && onChatTab ? tool.kind === "numbers" ? /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(SetNumbersTool, { grid: presetGrid, strings: ui.presets, streaming: state.isStreaming, onSend: sendAsk, onClose: closeTool }) : /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(BuildComboTool, { grid: presetGrid, strings: ui.presets, streaming: state.isStreaming, formatKickoff, initialTotal: tool.total, initialLegs: tool.legs, onSend: sendAsk, onClose: closeTool }) : null
|
|
9306
9351
|
] }),
|
|
9307
|
-
monitor && discovery && monitor.activeTab === "today" && /* @__PURE__ */ (0,
|
|
9308
|
-
monitor && monitor.activeTab === "following" && /* @__PURE__ */ (0,
|
|
9309
|
-
monitor && monitor.activeTab === "odds" && /* @__PURE__ */ (0,
|
|
9310
|
-
monitor && monitor.activeTab === "games" && gamesResult && /* @__PURE__ */ (0,
|
|
9352
|
+
monitor && discovery && monitor.activeTab === "today" && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(TodayPanel, { discovery, ui, monitor }),
|
|
9353
|
+
monitor && monitor.activeTab === "following" && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(MatchesPanel, { monitor, ui, slip, onAsk: handleAsk }),
|
|
9354
|
+
monitor && monitor.activeTab === "odds" && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(OddsPanel, { monitor, ui, slip }),
|
|
9355
|
+
monitor && monitor.activeTab === "games" && gamesResult && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
9311
9356
|
GamesPanel,
|
|
9312
9357
|
{
|
|
9313
9358
|
loggedIn: !!loggedIn,
|
|
@@ -9321,7 +9366,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
9321
9366
|
}
|
|
9322
9367
|
}
|
|
9323
9368
|
),
|
|
9324
|
-
monitor && monitor.activeTab === "leaderboard" && leaderboardResult && /* @__PURE__ */ (0,
|
|
9369
|
+
monitor && monitor.activeTab === "leaderboard" && leaderboardResult && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
9325
9370
|
LeaderboardPanel,
|
|
9326
9371
|
{
|
|
9327
9372
|
loggedIn: !!loggedIn,
|
|
@@ -9331,7 +9376,7 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
9331
9376
|
ui
|
|
9332
9377
|
}
|
|
9333
9378
|
),
|
|
9334
|
-
(!monitor || monitor.activeTab !== "games" && monitor.activeTab !== "leaderboard") && /* @__PURE__ */ (0,
|
|
9379
|
+
(!monitor || monitor.activeTab !== "games" && monitor.activeTab !== "leaderboard") && /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
|
|
9335
9380
|
ChatInput,
|
|
9336
9381
|
{
|
|
9337
9382
|
ref: inputRef,
|
|
@@ -9349,9 +9394,9 @@ function ChatPanel({ controller, ui, slip, onDashboardTap, monitor, discovery, g
|
|
|
9349
9394
|
}
|
|
9350
9395
|
|
|
9351
9396
|
// src/components/HostEventsProvider.tsx
|
|
9352
|
-
var
|
|
9397
|
+
var import_jsx_runtime95 = require("react/jsx-runtime");
|
|
9353
9398
|
function HostEventsProvider({ value, children }) {
|
|
9354
|
-
return /* @__PURE__ */ (0,
|
|
9399
|
+
return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(SlipStateContext.Provider, { value: value.slipState, children });
|
|
9355
9400
|
}
|
|
9356
9401
|
|
|
9357
9402
|
// src/styles/css.generated.ts
|
|
@@ -10996,10 +11041,41 @@ var WIDGET_CSS = `.ss-w-root { all: revert; }
|
|
|
10996
11041
|
.ss-g-motm-pill { flex: none; padding: 3px 8px; font-size: 11px; }
|
|
10997
11042
|
.ss-g-motm-foot { font-size: 14px; font-weight: 600; }
|
|
10998
11043
|
.ss-g-motm-fun { font-size: 11px; color: var(--ss-g-faint); }
|
|
11044
|
+
|
|
11045
|
+
/* \u2500\u2500 tap-to-answer tray + per-game team-colour band (u503) \u2500\u2500 */
|
|
11046
|
+
.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; }
|
|
11047
|
+
.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; }
|
|
11048
|
+
.ss-g-tray-chip:hover, .ss-g-tray-chip:focus-visible { background: var(--ss-g-raised); border-color: var(--ss-w-accent); outline: none; }
|
|
11049
|
+
.ss-g-tray-chip:disabled { opacity: .5; cursor: default; }
|
|
11050
|
+
.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; }
|
|
11051
|
+
.ss-g-tray-av img { width: 100%; height: 100%; object-fit: cover; }
|
|
11052
|
+
.ss-g-tray-name { width: 100%; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
|
|
11053
|
+
.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; }
|
|
11054
|
+
.ss-g-tray-last { max-width: 100%; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
11055
|
+
|
|
11056
|
+
/* Each game gets its own band colour: the operator accent mixed into the ground, hue-nudged per game.
|
|
11057
|
+
Browsers without relative colour syntax keep the plain accent mix. */
|
|
11058
|
+
.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)); }
|
|
11059
|
+
@supports (color: oklch(from red l c h)) {
|
|
11060
|
+
.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))); }
|
|
11061
|
+
}
|
|
11062
|
+
.ss-g-screen[data-game="mystery-tiger"] { --ss-g-band-mix: 14%; --ss-g-hue-shift: 0; }
|
|
11063
|
+
.ss-g-screen[data-game="career-path"] { --ss-g-band-mix: 11%; --ss-g-hue-shift: -24; }
|
|
11064
|
+
.ss-g-screen[data-game] > .ss-g-head { background: var(--ss-g-band); border-radius: 0 0 24px 24px; padding-bottom: 12px; }
|
|
11065
|
+
.ss-g-worth { flex: none; display: flex; align-items: baseline; gap: 10px; font-size: 13px; color: var(--ss-g-muted); }
|
|
11066
|
+
.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); }
|
|
11067
|
+
.ss-g-screen[data-game="beat-the-grid"] { --ss-g-band-mix: 13%; --ss-g-hue-shift: 14; }
|
|
11068
|
+
.ss-g-screen[data-game="guess-the-xi"] { --ss-g-band-mix: 12%; --ss-g-hue-shift: -36; }
|
|
11069
|
+
.ss-g-screen[data-game="higher-or-lower"] { --ss-g-band-mix: 16%; --ss-g-hue-shift: 28; }
|
|
11070
|
+
.ss-g-screen[data-game="daily-quiz"] { --ss-g-band-mix: 10%; --ss-g-hue-shift: -12; }
|
|
11071
|
+
.ss-g-screen[data-game="stat-ladder"] { --ss-g-band-mix: 15%; --ss-g-hue-shift: 36; }
|
|
11072
|
+
.ss-g-screen[data-game="matchday-predictor"] { --ss-g-band-mix: 18%; --ss-g-hue-shift: -4; }
|
|
11073
|
+
.ss-g-screen[data-game="starting-xi"] { --ss-g-band-mix: 9%; --ss-g-hue-shift: -30; }
|
|
11074
|
+
.ss-g-screen[data-game="fan-motm"] { --ss-g-band-mix: 14%; --ss-g-hue-shift: 8; }
|
|
10999
11075
|
`;
|
|
11000
11076
|
|
|
11001
11077
|
// src/StatsWidget.tsx
|
|
11002
|
-
var
|
|
11078
|
+
var import_jsx_runtime96 = require("react/jsx-runtime");
|
|
11003
11079
|
function buildClient(props) {
|
|
11004
11080
|
try {
|
|
11005
11081
|
if ("client" in props && props.client) {
|
|
@@ -11168,7 +11244,7 @@ function StatsWidget(props) {
|
|
|
11168
11244
|
[built, logger]
|
|
11169
11245
|
);
|
|
11170
11246
|
const dismissPopup = usePopupTelemetry(logger, controller.state.isOpen, controller.state.popupText, controller.dismissPopup);
|
|
11171
|
-
const asks = bubbleAsks(controller.state.messages).map((ask) => ({
|
|
11247
|
+
const asks = bubbleAsks(controller.state.messages, ui.presets.standoutAsk).map((ask) => ({
|
|
11172
11248
|
label: ask.label,
|
|
11173
11249
|
onTap: () => runBubbleAsk(ask, {
|
|
11174
11250
|
open: controller.open,
|
|
@@ -11210,7 +11286,7 @@ function StatsWidget(props) {
|
|
|
11210
11286
|
}, [built, ui.injectStyles]);
|
|
11211
11287
|
if (!built) return null;
|
|
11212
11288
|
const attrs = themeAttrs(ui);
|
|
11213
|
-
return /* @__PURE__ */ (0,
|
|
11289
|
+
return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(EventLogContext.Provider, { value: logger, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(HostEventsProvider, { value: hostEvents, children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)("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__ */ (0, import_jsx_runtime96.jsx)(
|
|
11214
11290
|
ChatPanel,
|
|
11215
11291
|
{
|
|
11216
11292
|
controller,
|
|
@@ -11225,7 +11301,7 @@ function StatsWidget(props) {
|
|
|
11225
11301
|
conversation: built?.conversation ?? null,
|
|
11226
11302
|
presetGrid
|
|
11227
11303
|
}
|
|
11228
|
-
) : /* @__PURE__ */ (0,
|
|
11304
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(
|
|
11229
11305
|
ChatFab,
|
|
11230
11306
|
{
|
|
11231
11307
|
label: ui.launcherLabel,
|