fansunited-frontend-components 0.0.99 → 1.0.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.
Files changed (62) hide show
  1. package/Betslip.js +2 -2
  2. package/ChanceGame.js +496 -505
  3. package/ClassicQuizPlay.js +2 -2
  4. package/CollectLead.js +405 -1163
  5. package/CompetitionStatistics.js +2 -2
  6. package/CompetitorCard.js +445 -425
  7. package/Discussion.js +2 -2
  8. package/EitherOrPlay.js +2 -2
  9. package/EventCard.js +648 -593
  10. package/EventGamePlay.js +2 -2
  11. package/Leaderboard.js +142 -132
  12. package/List.js +675 -713
  13. package/MatchQuizPlay.js +2 -2
  14. package/Odds.js +1 -1
  15. package/PersonalityQuizPlay.js +2 -2
  16. package/PickThePair.js +925 -1824
  17. package/PlayerOfTheMatch.js +2106 -2223
  18. package/PollVote.js +2 -2
  19. package/Predictor.js +4209 -18629
  20. package/Standings.js +497 -486
  21. package/TopX.js +3223 -16958
  22. package/chunks/{ChanceGameEmbedVariant-DM9eLG5s.js → ChanceGameEmbedVariant-z8XYzgDW.js} +1 -1
  23. package/chunks/PickOneOfX-IvE4OvyT.js +3146 -0
  24. package/chunks/index-BNl8scz6.js +4 -0
  25. package/chunks/index-CSa2JU4m.js +4 -0
  26. package/chunks/index-CVRI82Gb.js +4 -0
  27. package/chunks/index-Cd1dg0KI.js +4 -0
  28. package/chunks/index-Cei2fzi7.js +4 -0
  29. package/chunks/index-Cxb4wEJU.js +4 -0
  30. package/chunks/index-w1LGN5dz.js +4 -0
  31. package/chunks/main-07vzblS8.js +2091 -0
  32. package/chunks/main-C7X4dM_P.js +4827 -0
  33. package/chunks/main-D_QDfmAw.js +6417 -0
  34. package/chunks/{main-CzfWaEQP.js → main-DdL0UekL.js} +1931 -2025
  35. package/chunks/main-DmBfwyb4.js +2992 -0
  36. package/chunks/main-LEE8n2cG.js +3117 -0
  37. package/chunks/{main-DxvBjXsd.js → main-P2WNvBZE.js} +473 -444
  38. package/chunks/{main-DiBlJBNb.js → main-gV165E-A.js} +629 -657
  39. package/chunks/predictionsHelpers-fwXaMadu.js +10063 -0
  40. package/chunks/{withVersionStamp-BsLyhvNA.js → withVersionStamp-CPDfSE5H.js} +1 -1
  41. package/package.json +2 -6
  42. package/withVersionStamp.d.ts.map +1 -1
  43. package/chunks/CheckCircle-I1FktW5Y.js +0 -13
  44. package/chunks/Person-CXRqyF4E.js +0 -11
  45. package/chunks/PickOneOfX-DET4ZhjV.js +0 -3117
  46. package/chunks/Search-CIXthh0D.js +0 -17
  47. package/chunks/TimerOutlined-D-WA_vpE.js +0 -8
  48. package/chunks/WorkspacePremiumOutlined-DUXVgJlF.js +0 -136
  49. package/chunks/chevrons-right-HWKW2c4I.js +0 -45
  50. package/chunks/createLucideIcon-YBRjY5Kl.js +0 -79
  51. package/chunks/index-BENM3N_w.js +0 -4
  52. package/chunks/index-BRxAV693.js +0 -4
  53. package/chunks/index-BXYTsvIX.js +0 -4
  54. package/chunks/index-C0ilols1.js +0 -4
  55. package/chunks/index-D7VhczXH.js +0 -4
  56. package/chunks/index-DKwvdw9t.js +0 -4
  57. package/chunks/index-DZN-AITW.js +0 -4
  58. package/chunks/main-B2sDRFF4.js +0 -2184
  59. package/chunks/main-DFNl3g_U.js +0 -4910
  60. package/chunks/main-DLwnvntz.js +0 -4020
  61. package/chunks/main-S8_NDSiY.js +0 -3209
  62. package/chunks/main-lBgr8Liq.js +0 -6571
package/List.js CHANGED
@@ -1,220 +1,209 @@
1
- import { jsxs as P, jsx as o } from "react/jsx-runtime";
2
- import { useDisableCache as it, useColors as st, useFontFamily as at, useCornerRadius as ct, useSpacingScale as lt, isMobile as J, defaultBg as dt, useConstantContext as pt, ConstantsContext as ut, WidgetTemplate as ht, Spinner as tt, DirectionalIcon as D, Portal as gt } from "fansunited-frontend-core";
3
- import { Card as ft, CardCover as q, CardContent as mt, Box as g, Chip as yt, Typography as V, Modal as xt, ModalDialog as Ct, ModalClose as It, IconButton as W, Button as et } from "@mui/joy";
4
- import { useState as z, useRef as v, useCallback as j, useEffect as wt, lazy as B, Suspense as St } from "react";
5
- import { useTranslation as K } from "react-i18next";
6
- import { c as bt } from "./chunks/createLucideIcon-YBRjY5Kl.js";
7
- import { C as Tt, a as Pt, b as Et, c as Mt } from "./chunks/chevrons-right-HWKW2c4I.js";
8
- import { w as Lt } from "./chunks/withVersionStamp-BsLyhvNA.js";
9
- /**
10
- * @license lucide-react v0.454.0 - ISC
11
- *
12
- * This source code is licensed under the ISC license.
13
- * See the LICENSE file in the root directory of this source tree.
14
- */
15
- const Ut = bt("Users", [
16
- ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
17
- ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
18
- ["path", { d: "M22 21v-2a4 4 0 0 0-3-3.87", key: "kshegd" }],
19
- ["path", { d: "M16 3.13a4 4 0 0 1 0 7.75", key: "1da9ce" }]
20
- ]), nt = (e) => {
21
- const n = e.entityModel;
1
+ import { jsxs as I, jsx as o } from "@emotion/react/jsx-runtime";
2
+ import { Modal as ue, Spinner as ie, baseButton as pe, WidgetPortal as fe } from "fansunited-frontend-core/ui/emotion";
3
+ import { css as i } from "@emotion/react";
4
+ import { useDisableCache as ge, useIsMobile as ae, defaultBg as he, WidgetTemplate as me, DirectionalIcon as G } from "fansunited-frontend-core";
5
+ import { useState as k, useRef as _, useCallback as Y, useEffect as ye, lazy as j, Suspense as xe } from "react";
6
+ import { useTranslation as q } from "react-i18next";
7
+ import { Users as be, ChevronsLeft as ve, ChevronLeft as Ce, ChevronRight as Se, ChevronsRight as Ie } from "fansunited-frontend-core/ui/icons/lucide";
8
+ import { CloseIcon as we } from "fansunited-frontend-core/ui/icons";
9
+ import { w as Me } from "./chunks/withVersionStamp-CPDfSE5H.js";
10
+ const se = (t) => {
11
+ const n = t.entityModel;
22
12
  if (!n) return null;
23
- switch (e.entityType) {
13
+ switch (t.entityType) {
24
14
  case "CLASSIC_QUIZ": {
25
- const t = n;
15
+ const e = n;
26
16
  return {
27
- title: t.title,
28
- images: t.images,
29
- branding: t.branding,
30
- participationCount: t.participationCount,
31
- status: t.status
17
+ title: e.title,
18
+ images: e.images,
19
+ branding: e.branding,
20
+ participationCount: e.participationCount,
21
+ status: e.status
32
22
  };
33
23
  }
34
24
  case "PERSONALITY_QUIZ": {
35
- const t = n;
25
+ const e = n;
36
26
  return {
37
- title: t.title,
38
- images: t.images,
39
- branding: t.branding,
40
- participationCount: t.participationCount,
41
- status: t.status
27
+ title: e.title,
28
+ images: e.images,
29
+ branding: e.branding,
30
+ participationCount: e.participationCount,
31
+ status: e.status
42
32
  };
43
33
  }
44
34
  case "POLL": {
45
- const t = n;
35
+ const e = n;
46
36
  return {
47
- title: t.title,
48
- images: t.images,
49
- branding: t.branding,
50
- participationCount: t.totalVotes,
51
- status: t.status
37
+ title: e.title,
38
+ images: e.images,
39
+ branding: e.branding,
40
+ participationCount: e.totalVotes,
41
+ status: e.status
52
42
  };
53
43
  }
54
44
  case "EITHER_OR": {
55
- const t = n;
45
+ const e = n;
56
46
  return {
57
- title: t.title,
58
- images: t.images,
59
- branding: t.branding,
60
- participationCount: t.totalUsersCount,
61
- status: t.status
47
+ title: e.title,
48
+ images: e.images,
49
+ branding: e.branding,
50
+ participationCount: e.totalUsersCount,
51
+ status: e.status
62
52
  };
63
53
  }
64
54
  case "MATCH_QUIZ": {
65
- const t = n;
55
+ const e = n;
66
56
  return {
67
- title: t.title,
68
- images: t.images,
69
- branding: t.branding,
70
- participationCount: t.participantsCount,
71
- status: t.status
57
+ title: e.title,
58
+ images: e.images,
59
+ branding: e.branding,
60
+ participationCount: e.participantsCount,
61
+ status: e.status
72
62
  };
73
63
  }
74
64
  case "CUSTOM_EVENT_GAME": {
75
- const t = n;
65
+ const e = n;
76
66
  return {
77
- title: t.title,
78
- images: t.images,
79
- branding: t.branding,
80
- status: t.status
67
+ title: e.title,
68
+ images: e.images,
69
+ branding: e.branding,
70
+ status: e.status
81
71
  };
82
72
  }
83
73
  default:
84
74
  return null;
85
75
  }
86
- }, Rt = /* @__PURE__ */ new Set(["ACTIVE", "OPEN"]), _t = (e) => {
87
- var t;
88
- const n = (t = nt(e)) == null ? void 0 : t.status;
89
- return !!(n && Rt.has(n));
90
- }, Ft = 50, vt = 3, zt = (e, n, t, p) => {
91
- const l = p === "paged", a = p === "limited", [r, c] = z([]), [y, s] = z(!1), [U, A] = z(!1), [Z, O] = z(!l), [H, R] = z(1), [E, Q] = z(1), w = v([]), _ = v([]), k = v(/* @__PURE__ */ new Set()), I = v(1), M = v(!1), S = v(!1), T = v(null), d = v(0), f = it(), i = j(
92
- async (u, C) => {
93
- var N;
94
- const m = await e.lists.getListContent(
76
+ }, Te = /* @__PURE__ */ new Set(["ACTIVE", "OPEN"]), Pe = (t) => {
77
+ var e;
78
+ const n = (e = se(t)) == null ? void 0 : e.status;
79
+ return !!(n && Te.has(n));
80
+ }, Le = 50, Ee = 3, ze = (t, n, e, u) => {
81
+ const l = u === "paged", s = u === "limited", [y, p] = k([]), [T, b] = k(!1), [V, H] = k(!1), [Z, z] = k(!l), [Q, v] = k(1), [N, W] = k(1), w = _([]), C = _([]), R = _(/* @__PURE__ */ new Set()), U = _(1), P = _(!1), c = _(!1), f = _(null), a = _(0), O = ge(), x = Y(
82
+ async (h, M) => {
83
+ var $;
84
+ const m = await t.lists.getListContent(
95
85
  n,
96
- { limit: C, page: u },
97
- f
98
- ), h = (N = m.meta) == null ? void 0 : N.pagination, L = m.data ?? [];
86
+ { limit: M, page: h },
87
+ O
88
+ ), g = ($ = m.meta) == null ? void 0 : $.pagination, E = m.data ?? [];
99
89
  return {
100
- valid: L.filter(_t),
101
- rawCount: L.length,
102
- pageCount: (h == null ? void 0 : h.numberOfPages) ?? 1
90
+ valid: E.filter(Pe),
91
+ rawCount: E.length,
92
+ pageCount: (g == null ? void 0 : g.numberOfPages) ?? 1
103
93
  };
104
94
  },
105
- [e, n, f]
106
- ), F = j(async () => {
107
- if (S.current || !e || !n) return;
108
- const u = d.current, C = () => u !== d.current, m = a ? t - _.current.length : t;
95
+ [t, n, O]
96
+ ), B = Y(async () => {
97
+ if (c.current || !t || !n) return;
98
+ const h = a.current, M = () => h !== a.current, m = s ? e - C.current.length : e;
109
99
  if (m <= 0) {
110
- O(!1);
100
+ z(!1);
111
101
  return;
112
102
  }
113
- if (w.current.length < m && !M.current) {
114
- S.current = !0, s(!0);
103
+ if (w.current.length < m && !P.current) {
104
+ c.current = !0, b(!0);
115
105
  try {
116
- let L = 0;
117
- for (; w.current.length < m && !M.current && L < vt; ) {
106
+ let E = 0;
107
+ for (; w.current.length < m && !P.current && E < Ee; ) {
118
108
  const {
119
- valid: N,
120
- rawCount: ot,
121
- pageCount: rt
122
- } = await i(I.current, Ft);
123
- if (C()) return;
124
- L += 1;
125
- const $ = N.filter(
126
- (G) => !k.current.has(G.entityId)
109
+ valid: $,
110
+ rawCount: le,
111
+ pageCount: de
112
+ } = await x(U.current, Le);
113
+ if (M()) return;
114
+ E += 1;
115
+ const J = $.filter(
116
+ (K) => !R.current.has(K.entityId)
127
117
  );
128
- $.forEach((G) => k.current.add(G.entityId)), w.current.push(...$), (ot === 0 || I.current >= rt) && (M.current = !0), I.current += 1;
118
+ J.forEach((K) => R.current.add(K.entityId)), w.current.push(...J), (le === 0 || U.current >= de) && (P.current = !0), U.current += 1;
129
119
  }
130
- } catch (L) {
131
- if (C()) return;
132
- console.warn("Error fetching list content:", L), A(!0);
120
+ } catch (E) {
121
+ if (M()) return;
122
+ console.warn("Error fetching list content:", E), H(!0);
133
123
  return;
134
124
  } finally {
135
- C() || (S.current = !1, s(!1));
125
+ M() || (c.current = !1, b(!1));
136
126
  }
137
127
  }
138
- if (C()) return;
139
- const h = [..._.current, ...w.current.splice(0, m)];
140
- _.current = h, c(h), O(
141
- !a && (w.current.length > 0 || !M.current)
128
+ if (M()) return;
129
+ const g = [...C.current, ...w.current.splice(0, m)];
130
+ C.current = g, p(g), z(
131
+ !s && (w.current.length > 0 || !P.current)
142
132
  );
143
- }, [i, a, t, n, e]), b = j(
144
- (u, C) => {
145
- const m = Math.max(1, Math.ceil(u.length / t)), h = Math.min(Math.max(C, 1), m);
146
- c(u.slice((h - 1) * t, h * t)), Q(m), R(h);
133
+ }, [x, s, e, n, t]), S = Y(
134
+ (h, M) => {
135
+ const m = Math.max(1, Math.ceil(h.length / e)), g = Math.min(Math.max(M, 1), m);
136
+ p(h.slice((g - 1) * e, g * e)), W(m), v(g);
147
137
  },
148
- [t]
149
- ), x = j(
150
- async (u) => {
151
- if (u < 1) return;
152
- if (T.current) {
153
- b(T.current, u);
138
+ [e]
139
+ ), L = Y(
140
+ async (h) => {
141
+ if (h < 1) return;
142
+ if (f.current) {
143
+ S(f.current, h);
154
144
  return;
155
145
  }
156
- if (S.current || !e || !n) return;
157
- const C = d.current, m = () => C !== d.current;
158
- S.current = !0, s(!0);
146
+ if (c.current || !t || !n) return;
147
+ const M = a.current, m = () => M !== a.current;
148
+ c.current = !0, b(!0);
159
149
  try {
160
150
  const {
161
- valid: h,
162
- rawCount: L,
163
- pageCount: N
164
- } = await i(u, t);
151
+ valid: g,
152
+ rawCount: E,
153
+ pageCount: $
154
+ } = await x(h, e);
165
155
  if (m()) return;
166
- if (L > t) {
167
- T.current = h, b(h, u);
156
+ if (E > e) {
157
+ f.current = g, S(g, h);
168
158
  return;
169
159
  }
170
- c(h), Q(N), R(u);
171
- } catch (h) {
160
+ p(g), W($), v(h);
161
+ } catch (g) {
172
162
  if (m()) return;
173
- console.warn("Error fetching list content:", h), A(!0);
163
+ console.warn("Error fetching list content:", g), H(!0);
174
164
  } finally {
175
- m() || (S.current = !1, s(!1));
165
+ m() || (c.current = !1, b(!1));
176
166
  }
177
167
  },
178
- [i, t, n, e, b]
168
+ [x, e, n, t, S]
179
169
  );
180
- return wt(() => {
181
- d.current += 1, S.current = !1, w.current = [], _.current = [], k.current = /* @__PURE__ */ new Set(), I.current = 1, M.current = !1, T.current = null, c([]), A(!1), O(!l), R(1), Q(1), l ? x(1) : F();
182
- }, [l, x, F]), {
183
- items: r,
184
- loading: y,
185
- error: U,
170
+ return ye(() => {
171
+ a.current += 1, c.current = !1, w.current = [], C.current = [], R.current = /* @__PURE__ */ new Set(), U.current = 1, P.current = !1, f.current = null, p([]), H(!1), z(!l), v(1), W(1), l ? L(1) : B();
172
+ }, [l, L, B]), {
173
+ items: y,
174
+ loading: T,
175
+ error: V,
186
176
  hasMore: Z,
187
- loadMore: F,
188
- page: H,
189
- pageCount: E,
190
- goToPage: x
177
+ loadMore: B,
178
+ page: Q,
179
+ pageCount: N,
180
+ goToPage: L
191
181
  };
192
- }, Y = () => {
193
- const e = st(), n = at(), t = ct(), p = lt();
194
- return {
195
- fonts: n,
196
- spacing: p,
197
- radius: t,
198
- colors: {
199
- surface: e.surface,
200
- text: e.textPrimary,
201
- primary: e.palette.primary.plainColor,
202
- onPrimary: e.palette.primary.onPrimary
203
- },
204
- /** Fixed tones for content painted over the card's cover image. */
205
- onImage: {
206
- text: "#fff",
207
- dim: "rgba(255, 255, 255, 0.7)",
208
- dimStrong: "rgba(255, 255, 255, 0.8)",
209
- panel: "rgba(255, 255, 255, 0.1)",
210
- /** Bottom-up scrim that keeps the title legible over any artwork. */
211
- scrim: "linear-gradient(to top, rgba(0,0,0,1), rgba(0,0,0,0.7) 25%, rgba(0,0,0,0) 40%)",
212
- textShadow: "0 2px 4px rgba(0,0,0,0.4)",
213
- labelShadow: "0 1px 2px rgba(0,0,0,0.4)"
214
- }
215
- };
216
- }, X = "{CONTENT_ID}", At = (e, n) => {
217
- switch (e) {
182
+ }, r = {
183
+ fontPrimary: "var(--fu-ucrc-font-primary)",
184
+ fontSecondary: "var(--fu-ucrc-font-secondary)",
185
+ space2xs: "var(--fu-ucrc-space-2xs)",
186
+ spaceXs: "var(--fu-ucrc-space-xs)",
187
+ spaceMd: "var(--fu-ucrc-space-md)",
188
+ radiusSm: "var(--fu-ucrc-radius-sm)",
189
+ radiusMd: "var(--fu-ucrc-radius-md)",
190
+ radiusXl: "var(--fu-ucrc-radius-xl)",
191
+ surface: "var(--fu-ucrc-surface)",
192
+ text: "var(--fu-ucrc-text-primary)",
193
+ primary: "var(--fu-ucrc-primary-plain-color)",
194
+ onPrimary: "var(--fu-ucrc-primary-on-primary)",
195
+ focus: "var(--fu-ucrc-focus-visible)"
196
+ }, F = {
197
+ text: "#fff",
198
+ dim: "rgba(255, 255, 255, 0.7)",
199
+ dimStrong: "rgba(255, 255, 255, 0.8)",
200
+ panel: "rgba(255, 255, 255, 0.1)",
201
+ /** Bottom-up scrim that keeps the title legible over any artwork. */
202
+ scrim: "linear-gradient(to top, rgba(0,0,0,1), rgba(0,0,0,0.7) 25%, rgba(0,0,0,0) 40%)",
203
+ textShadow: "0 2px 4px rgba(0,0,0,0.4)",
204
+ labelShadow: "0 1px 2px rgba(0,0,0,0.4)"
205
+ }, ee = "{CONTENT_ID}", Re = (t, n) => {
206
+ switch (t) {
218
207
  case "CLASSIC_QUIZ":
219
208
  return n == null ? void 0 : n.classicQuizUrl;
220
209
  case "PERSONALITY_QUIZ":
@@ -230,629 +219,602 @@ const Ut = bt("Users", [
230
219
  default:
231
220
  return;
232
221
  }
233
- }, Ot = (e) => !!(e != null && e.classicQuizUrl || e != null && e.personalityQuizUrl || e != null && e.eitherOrUrl || e != null && e.pollUrl || e != null && e.matchQuizUrl || e != null && e.eventGameUrl), Qt = (e, n) => {
234
- const t = At(e.entityType, n);
235
- return t ? t.includes(X) ? t.replace(X, e.entityId) : t : null;
236
- }, kt = (e, n) => {
237
- const t = e == null ? void 0 : e.images;
238
- return t ? n ? t.mobileLogo || t.mainLogo || null : t.mainLogo || t.mobileLogo || null : null;
239
- }, Ht = ({
240
- item: e,
222
+ }, Ue = (t) => !!(t != null && t.classicQuizUrl || t != null && t.personalityQuizUrl || t != null && t.eitherOrUrl || t != null && t.pollUrl || t != null && t.matchQuizUrl || t != null && t.eventGameUrl), Oe = (t, n) => {
223
+ const e = Re(t.entityType, n);
224
+ return e ? e.includes(ee) ? e.replace(ee, t.entityId) : e : null;
225
+ }, te = i({
226
+ position: "absolute",
227
+ zIndex: 0,
228
+ inset: 0,
229
+ borderRadius: `calc(${r.radiusMd} - 1px)`
230
+ }), ne = i({
231
+ margin: 0,
232
+ lineHeight: 1.5,
233
+ fontSize: "0.7em",
234
+ fontFamily: r.fontSecondary
235
+ }), d = {
236
+ // Joy's outlined Card.
237
+ card: i({
238
+ position: "relative",
239
+ display: "flex",
240
+ flexDirection: "column",
241
+ // No `height: 100%` here. As a grid item that percentage resolves against a row whose size
242
+ // depends on this card, so the card ends up taller than its own row and whatever follows the
243
+ // grid (the Load More button) is drawn over it. The grid's `align-items: stretch` already gives
244
+ // every card in a row the same height.
245
+ minHeight: "350px",
246
+ padding: "1em",
247
+ border: "1px solid var(--fu-ucrc-neutral-outlined-border)",
248
+ borderRadius: r.radiusMd,
249
+ backgroundColor: "var(--fu-ucrc-bg-surface)",
250
+ color: "var(--fu-ucrc-neutral-outlined-color)",
251
+ fontSize: "1em",
252
+ fontFamily: r.fontSecondary,
253
+ lineHeight: 1.5,
254
+ cursor: "pointer",
255
+ transition: "transform 0.2s",
256
+ "&:hover": { transform: "translateY(-4px)" }
257
+ }),
258
+ cover: te,
259
+ image: i({
260
+ display: "flex",
261
+ boxSizing: "border-box",
262
+ width: "100%",
263
+ height: "100%",
264
+ margin: 0,
265
+ padding: 0,
266
+ objectFit: "cover",
267
+ borderRadius: `calc(${r.radiusMd} - 1px)`,
268
+ transition: "transform 0.4s ease-out"
269
+ }),
270
+ // The title sits on client artwork, so it needs its own contrast floor.
271
+ scrim: i(te, { background: F.scrim }),
272
+ content: i({
273
+ zIndex: 1,
274
+ display: "flex",
275
+ flexDirection: "column",
276
+ flex: "9999 1 0%",
277
+ justifyContent: "flex-end"
278
+ }),
279
+ row: i({
280
+ display: "flex",
281
+ alignItems: "flex-end",
282
+ justifyContent: "space-between",
283
+ gap: r.spaceMd
284
+ }),
285
+ meta: i({
286
+ display: "flex",
287
+ gap: r.spaceXs,
288
+ alignItems: "center",
289
+ marginBottom: r.spaceXs
290
+ }),
291
+ // Joy's soft neutral Chip, size sm.
292
+ chip: i({
293
+ position: "relative",
294
+ boxSizing: "border-box",
295
+ display: "inline-flex",
296
+ alignItems: "center",
297
+ justifyContent: "center",
298
+ maxWidth: "max-content",
299
+ minHeight: "20px",
300
+ paddingInline: "6px",
301
+ borderRadius: r.radiusSm,
302
+ backgroundColor: "var(--fu-ucrc-neutral-soft-bg)",
303
+ color: "var(--fu-ucrc-neutral-soft-color)",
304
+ fontSize: "0.75em",
305
+ fontFamily: r.fontSecondary,
306
+ lineHeight: 1.5,
307
+ whiteSpace: "nowrap",
308
+ verticalAlign: "middle"
309
+ }),
310
+ chipLabel: i({
311
+ display: "inline-block",
312
+ flexGrow: 1,
313
+ minInlineSize: 0,
314
+ overflow: "hidden",
315
+ textOverflow: "ellipsis"
316
+ }),
317
+ count: i({
318
+ display: "flex",
319
+ alignItems: "center",
320
+ margin: 0,
321
+ lineHeight: 1.5,
322
+ fontSize: "0.875em",
323
+ fontFamily: r.fontSecondary,
324
+ color: F.text
325
+ }),
326
+ countIcon: i({ display: "inline-flex", marginInlineEnd: "clamp(4px, 0.375em, 12px)" }),
327
+ title: i({
328
+ flex: 1,
329
+ margin: 0,
330
+ fontSize: "1.5em",
331
+ fontFamily: r.fontPrimary,
332
+ fontWeight: 600,
333
+ lineHeight: 1.2,
334
+ color: F.text,
335
+ textShadow: F.textShadow,
336
+ // Entity titles come from the CMS, so they are not necessarily in the UI language — let each
337
+ // one take its direction from its own content.
338
+ unicodeBidi: "plaintext"
339
+ }),
340
+ sponsor: i({
341
+ display: "flex",
342
+ flexDirection: "column",
343
+ alignItems: "center",
344
+ gap: r.space2xs,
345
+ maxWidth: "120px",
346
+ flexShrink: 0
347
+ }),
348
+ sponsorLabel: i(ne, {
349
+ color: F.dim,
350
+ textShadow: F.labelShadow,
351
+ textAlign: "center"
352
+ }),
353
+ sponsorLogo: i({ "& img": { height: "100%", objectFit: "contain", maxWidth: "100%" } }),
354
+ mobileSponsor: i({
355
+ display: "flex",
356
+ alignItems: "center",
357
+ gap: r.spaceXs,
358
+ marginTop: r.spaceMd,
359
+ padding: r.spaceXs,
360
+ backgroundColor: F.panel,
361
+ borderRadius: r.radiusSm,
362
+ backdropFilter: "blur(4px)"
363
+ }),
364
+ mobileSponsorLabel: i(ne, { color: F.dimStrong }),
365
+ mobileSponsorLogo: i({ height: "24px", "& img": { height: "100%", objectFit: "contain" } })
366
+ }, _e = (t, n) => {
367
+ const e = t == null ? void 0 : t.images;
368
+ return e ? n ? e.mobileLogo || e.mainLogo || null : e.mainLogo || e.mobileLogo || null : null;
369
+ }, Fe = ({
370
+ item: t,
241
371
  entityData: n,
242
- typeLabel: t,
243
- imagePlaceholder: p,
372
+ typeLabel: e,
373
+ imagePlaceholder: u,
244
374
  onClick: l
245
375
  }) => {
246
- var s, U;
247
- const { t: a } = K(), r = Y(), c = J(), y = kt(n.branding, c);
248
- return /* @__PURE__ */ P(
249
- ft,
250
- {
251
- onClick: () => l(e),
252
- sx: {
253
- fontSize: "1em",
254
- fontFamily: r.fonts.secondary,
255
- // No `height: 100%` here. As a grid item that percentage resolves against a row whose
256
- // size depends on this card, and the browser then sizes the row from the resolved
257
- // height while `minHeight` still applies to the box — the card ends up taller than its
258
- // own row, overflows the grid container, and whatever follows the grid (the Load More
259
- // button) is drawn over it. The grid's default `align-items: stretch` already gives
260
- // every card in a row the same height.
261
- minHeight: "350px",
262
- borderRadius: r.radius.md,
263
- cursor: "pointer",
264
- transition: "transform 0.2s, box-shadow 0.2s",
265
- "&:hover": {
266
- transform: "translateY(-4px)",
267
- boxShadow: "md"
268
- }
269
- },
270
- children: [
271
- /* @__PURE__ */ o(q, { children: /* @__PURE__ */ o(
272
- "img",
273
- {
274
- src: ((s = n.images) == null ? void 0 : s.cover) || ((U = n.images) == null ? void 0 : U.main) || p || dt,
275
- alt: n.title,
276
- loading: "lazy",
277
- style: { transition: "transform 0.4s ease-out" }
278
- }
279
- ) }),
280
- /* @__PURE__ */ o(q, { sx: { background: r.onImage.scrim } }),
281
- /* @__PURE__ */ P(mt, { sx: { justifyContent: "flex-end", gap: 0 }, children: [
282
- /* @__PURE__ */ P(
283
- g,
284
- {
285
- sx: {
286
- display: "flex",
287
- alignItems: "flex-end",
288
- justifyContent: "space-between",
289
- gap: r.spacing.md
290
- },
291
- children: [
292
- /* @__PURE__ */ P(g, { children: [
293
- /* @__PURE__ */ P(
294
- g,
295
- {
296
- sx: {
297
- display: "flex",
298
- gap: r.spacing.xs,
299
- alignItems: "center",
300
- marginBottom: r.spacing.xs
301
- },
302
- children: [
303
- t && /* @__PURE__ */ o(
304
- yt,
305
- {
306
- size: "sm",
307
- color: "neutral",
308
- variant: "soft",
309
- sx: {
310
- fontSize: "0.75em",
311
- fontFamily: r.fonts.secondary,
312
- borderRadius: r.radius.sm
313
- },
314
- children: t
315
- }
316
- ),
317
- !!n.participationCount && /* @__PURE__ */ o(
318
- V,
319
- {
320
- startDecorator: /* @__PURE__ */ o(Ut, { size: 16, color: r.onImage.text }),
321
- sx: {
322
- fontSize: "0.875em",
323
- fontFamily: r.fonts.secondary,
324
- color: r.onImage.text
325
- },
326
- children: n.participationCount
327
- }
328
- )
329
- ]
330
- }
331
- ),
332
- /* @__PURE__ */ o(
333
- V,
334
- {
335
- sx: {
336
- fontSize: "1.5em",
337
- fontFamily: r.fonts.primary,
338
- fontWeight: 600,
339
- lineHeight: 1.2,
340
- color: r.onImage.text,
341
- textShadow: r.onImage.textShadow,
342
- // Entity titles come from the CMS, so they are not necessarily in the UI
343
- // language — let each one take its direction from its own content.
344
- unicodeBidi: "plaintext",
345
- flex: 1
346
- },
347
- children: n.title
348
- }
349
- )
350
- ] }),
351
- y && !c && /* @__PURE__ */ P(
352
- g,
353
- {
354
- sx: {
355
- display: "flex",
356
- flexDirection: "column",
357
- alignItems: "center",
358
- gap: r.spacing["2xs"],
359
- maxWidth: "120px",
360
- flexShrink: 0
361
- },
362
- children: [
363
- /* @__PURE__ */ o(
364
- V,
365
- {
366
- sx: {
367
- fontSize: "0.7em",
368
- fontFamily: r.fonts.secondary,
369
- color: r.onImage.dim,
370
- textShadow: r.onImage.labelShadow,
371
- textAlign: "center"
372
- },
373
- children: a("list.sponsoredBy")
374
- }
375
- ),
376
- /* @__PURE__ */ o(
377
- g,
378
- {
379
- sx: {
380
- "& img": {
381
- height: "100%",
382
- objectFit: "contain",
383
- maxWidth: "100%"
384
- }
385
- },
386
- children: /* @__PURE__ */ o("img", { src: y, alt: a("list.sponsoredBy") })
387
- }
388
- )
389
- ]
390
- }
391
- )
392
- ]
393
- }
394
- ),
395
- y && c && /* @__PURE__ */ P(
396
- g,
397
- {
398
- sx: {
399
- display: "flex",
400
- alignItems: "center",
401
- gap: r.spacing.xs,
402
- marginTop: r.spacing.md,
403
- padding: r.spacing.xs,
404
- backgroundColor: r.onImage.panel,
405
- borderRadius: r.radius.sm,
406
- backdropFilter: "blur(4px)"
407
- },
408
- children: [
409
- /* @__PURE__ */ o(
410
- V,
411
- {
412
- sx: {
413
- fontSize: "0.7em",
414
- fontFamily: r.fonts.secondary,
415
- color: r.onImage.dimStrong
416
- },
417
- children: a("list.sponsoredBy")
418
- }
419
- ),
420
- /* @__PURE__ */ o(
421
- g,
422
- {
423
- sx: {
424
- height: "24px",
425
- "& img": {
426
- height: "100%",
427
- objectFit: "contain"
428
- }
429
- },
430
- children: /* @__PURE__ */ o("img", { src: y, alt: a("list.sponsoredBy") })
431
- }
432
- )
433
- ]
434
- }
435
- )
376
+ var T, b;
377
+ const { t: s } = q(), y = ae(), p = _e(n.branding, y);
378
+ return /* @__PURE__ */ I("div", { css: d.card, onClick: () => l(t), children: [
379
+ /* @__PURE__ */ o("div", { css: d.cover, children: /* @__PURE__ */ o(
380
+ "img",
381
+ {
382
+ css: d.image,
383
+ src: ((T = n.images) == null ? void 0 : T.cover) || ((b = n.images) == null ? void 0 : b.main) || u || he,
384
+ alt: n.title,
385
+ loading: "lazy"
386
+ }
387
+ ) }),
388
+ /* @__PURE__ */ o("div", { css: d.scrim }),
389
+ /* @__PURE__ */ I("div", { css: d.content, children: [
390
+ /* @__PURE__ */ I("div", { css: d.row, children: [
391
+ /* @__PURE__ */ I("div", { children: [
392
+ /* @__PURE__ */ I("div", { css: d.meta, children: [
393
+ e && /* @__PURE__ */ o("div", { css: d.chip, children: /* @__PURE__ */ o("span", { css: d.chipLabel, children: e }) }),
394
+ !!n.participationCount && /* @__PURE__ */ I("p", { css: d.count, children: [
395
+ /* @__PURE__ */ o("span", { css: d.countIcon, children: /* @__PURE__ */ o(be, { size: 16 }) }),
396
+ n.participationCount
397
+ ] })
398
+ ] }),
399
+ /* @__PURE__ */ o("p", { css: d.title, children: n.title })
400
+ ] }),
401
+ p && !y && /* @__PURE__ */ I("div", { css: d.sponsor, children: [
402
+ /* @__PURE__ */ o("p", { css: d.sponsorLabel, children: s("list.sponsoredBy") }),
403
+ /* @__PURE__ */ o("div", { css: d.sponsorLogo, children: /* @__PURE__ */ o("img", { src: p, alt: s("list.sponsoredBy") }) })
436
404
  ] })
437
- ]
438
- }
439
- );
440
- }, Nt = B(() => import("./chunks/index-C0ilols1.js")), Bt = B(
441
- () => import("./chunks/index-DZN-AITW.js")
442
- ), Zt = B(() => import("./chunks/index-BENM3N_w.js")), Vt = B(() => import("./chunks/index-DKwvdw9t.js")), Dt = B(() => import("./chunks/index-BXYTsvIX.js")), Wt = B(() => import("./chunks/index-D7VhczXH.js")), jt = ({
443
- item: e,
405
+ ] }),
406
+ p && y && /* @__PURE__ */ I("div", { css: d.mobileSponsor, children: [
407
+ /* @__PURE__ */ o("p", { css: d.mobileSponsorLabel, children: s("list.sponsoredBy") }),
408
+ /* @__PURE__ */ o("div", { css: d.mobileSponsorLogo, children: /* @__PURE__ */ o("img", { src: p, alt: s("list.sponsoredBy") }) })
409
+ ] })
410
+ ] })
411
+ ] });
412
+ }, Ae = j(() => import("./chunks/index-CSa2JU4m.js")), ke = j(
413
+ () => import("./chunks/index-w1LGN5dz.js")
414
+ ), He = j(() => import("./chunks/index-Cxb4wEJU.js")), We = j(() => import("./chunks/index-Cei2fzi7.js")), Be = j(() => import("./chunks/index-BNl8scz6.js")), Qe = j(() => import("./chunks/index-Cd1dg0KI.js")), oe = "rgba(var(--fu-ucrc-shadow-channel) / var(--fu-ucrc-shadow-opacity))", D = {
415
+ // Joy's outlined ModalDialog, centred in the modal's fixed root, with no padding.
416
+ dialog: i({
417
+ position: "absolute",
418
+ top: "50%",
419
+ left: "50%",
420
+ transform: "translate(-50%, -50%)",
421
+ boxSizing: "border-box",
422
+ display: "flex",
423
+ flexDirection: "column",
424
+ minWidth: "min(calc(100vw - 40px), 300px)",
425
+ maxWidth: "95vw",
426
+ maxHeight: "95vh",
427
+ overflowY: "auto",
428
+ overflowX: "hidden",
429
+ padding: 0,
430
+ border: "1px solid var(--fu-ucrc-neutral-outlined-border)",
431
+ borderRadius: r.radiusMd,
432
+ outline: 0,
433
+ boxShadow: `var(--fu-ucrc-shadow-ring), 0px 2px 8px -2px ${oe}, 0px 6px 12px -2px ${oe}`,
434
+ backgroundColor: r.surface,
435
+ color: "var(--fu-ucrc-neutral-outlined-color)",
436
+ fontSize: "1em",
437
+ fontFamily: r.fontSecondary,
438
+ lineHeight: 1.5
439
+ }),
440
+ // Joy's ModalClose: 8px inset, 2em square. The dialog has no padding, so it overlaps the
441
+ // content and sits on top of it. No hover/press fill: it read as a white tile over the image.
442
+ close: i({
443
+ position: "absolute",
444
+ zIndex: 1,
445
+ top: "8px",
446
+ right: "8px",
447
+ boxSizing: "border-box",
448
+ display: "inline-flex",
449
+ alignItems: "center",
450
+ justifyContent: "center",
451
+ minWidth: "2em",
452
+ minHeight: "2em",
453
+ margin: 0,
454
+ paddingBlock: 0,
455
+ paddingInline: "4px",
456
+ border: "none",
457
+ // Joy's ModalClose radius, derived from the dialog's.
458
+ borderRadius: `max(calc(${r.radiusMd} - 9px), min(4px, calc((${r.radiusMd} - 1px) / 2)))`,
459
+ backgroundColor: "transparent",
460
+ color: "var(--fu-ucrc-palette-text-secondary)",
461
+ fontFamily: "inherit",
462
+ fontSize: "1em",
463
+ cursor: "pointer",
464
+ WebkitTapHighlightColor: "transparent",
465
+ "& svg": { color: "var(--fu-ucrc-palette-text-icon)" },
466
+ "@media (hover: hover)": {
467
+ "&:hover": { color: "var(--fu-ucrc-neutral-plain-hover-color)" }
468
+ },
469
+ "&:hover svg, &:active svg, &:focus-visible svg": { color: "currentColor" },
470
+ "&:focus-visible": { outline: `2px solid ${r.focus}`, outlineOffset: "2px" }
471
+ }),
472
+ // The played widget's own stacking (its image headline sits at z-index 1, the same layer as the
473
+ // close button but later in tree order) would otherwise swallow the button's clicks; a shadow
474
+ // root doesn't isolate z-index. `zIndex: 0` confines it to its own context.
475
+ body: i({ position: "relative", zIndex: 0, fontSize: "1em" }),
476
+ unsupported: i({ padding: r.spaceMd, textAlign: "center" }),
477
+ unsupportedText: i({
478
+ margin: 0,
479
+ lineHeight: 1.5,
480
+ fontSize: "1em",
481
+ fontFamily: r.fontSecondary,
482
+ color: r.text
483
+ })
484
+ }, Ne = ({
485
+ item: t,
444
486
  open: n,
445
- onClose: t,
446
- listProps: p
487
+ onClose: e,
488
+ listProps: u
447
489
  }) => {
448
- const { t: l } = K(), a = Y(), { shadowRootElement: r } = pt(ut), {
449
- sdk: c,
490
+ const { t: l } = q(), {
491
+ sdk: s,
450
492
  language: y,
451
- themeOptions: s,
452
- userIsLoggedIn: U,
453
- signInCTA: A,
454
- additionalCTA: Z,
455
- shareCTA: O,
456
- rulesDisplay: H,
457
- leads: R,
458
- consents: E,
459
- chanceGameVariant: Q,
460
- showAnswerExplanations: w,
461
- hideCorrectOption: _,
462
- aggregateTranslatedVotes: k,
463
- optionsLayout: I,
464
- imagePosition: M,
465
- defaultImagePlaceholderUrl: S,
466
- disableCache: T,
467
- matchQuiz: d,
493
+ themeOptions: p,
494
+ userIsLoggedIn: T,
495
+ signInCTA: b,
496
+ additionalCTA: V,
497
+ shareCTA: H,
498
+ rulesDisplay: Z,
499
+ leads: z,
500
+ consents: Q,
501
+ chanceGameVariant: v,
502
+ showAnswerExplanations: N,
503
+ hideCorrectOption: W,
504
+ aggregateTranslatedVotes: w,
505
+ optionsLayout: C,
506
+ imagePosition: R,
507
+ defaultImagePlaceholderUrl: U,
508
+ disableCache: P,
509
+ matchQuiz: c,
468
510
  eventGame: f,
469
- callbacks: i
470
- } = p, F = {
471
- sdk: c,
511
+ callbacks: a
512
+ } = u, O = {
513
+ sdk: s,
472
514
  language: y,
473
- themeOptions: s,
474
- leads: R,
475
- consents: E,
476
- userIsLoggedIn: U,
477
- signInCTA: A,
478
- additionalCTA: Z,
479
- rulesDisplay: H,
480
- defaultImagePlaceholderUrl: S,
481
- disableCache: T,
482
- template: ht.STANDARD,
483
- imagePosition: M
484
- }, b = { ...F, chanceGameVariant: Q }, x = () => {
485
- if (!e) return null;
486
- switch (e.entityType) {
515
+ themeOptions: p,
516
+ leads: z,
517
+ consents: Q,
518
+ userIsLoggedIn: T,
519
+ signInCTA: b,
520
+ additionalCTA: V,
521
+ rulesDisplay: Z,
522
+ defaultImagePlaceholderUrl: U,
523
+ disableCache: P,
524
+ template: me.STANDARD,
525
+ imagePosition: R
526
+ }, x = { ...O, chanceGameVariant: v }, B = () => {
527
+ if (!t) return null;
528
+ switch (t.entityType) {
487
529
  case "CLASSIC_QUIZ":
488
530
  return /* @__PURE__ */ o(
489
- Nt,
531
+ Ae,
490
532
  {
491
- ...b,
492
- entityId: e.entityId,
493
- shareCTA: O,
494
- showAnswerExplanations: w,
495
- hideCorrectOption: _,
496
- optionsLayout: I,
533
+ ...x,
534
+ entityId: t.entityId,
535
+ shareCTA: H,
536
+ showAnswerExplanations: N,
537
+ hideCorrectOption: W,
538
+ optionsLayout: C,
497
539
  callbacks: {
498
- onFinish: i == null ? void 0 : i.onFinish,
499
- onShare: i == null ? void 0 : i.onShare
540
+ onFinish: a == null ? void 0 : a.onFinish,
541
+ onShare: a == null ? void 0 : a.onShare
500
542
  }
501
543
  }
502
544
  );
503
545
  case "PERSONALITY_QUIZ":
504
546
  return /* @__PURE__ */ o(
505
- Bt,
547
+ ke,
506
548
  {
507
- ...b,
508
- entityId: e.entityId,
509
- showAnswerExplanations: w,
510
- optionsLayout: I,
511
- callbacks: { onFinish: i == null ? void 0 : i.onFinish }
549
+ ...x,
550
+ entityId: t.entityId,
551
+ showAnswerExplanations: N,
552
+ optionsLayout: C,
553
+ callbacks: { onFinish: a == null ? void 0 : a.onFinish }
512
554
  }
513
555
  );
514
556
  case "POLL":
515
557
  return /* @__PURE__ */ o(
516
- Zt,
558
+ He,
517
559
  {
518
- ...b,
519
- entityId: e.entityId,
520
- optionsLayout: I,
521
- aggregateTranslatedVotes: k,
522
- callbacks: { onFinish: i == null ? void 0 : i.onFinish }
560
+ ...x,
561
+ entityId: t.entityId,
562
+ optionsLayout: C,
563
+ aggregateTranslatedVotes: w,
564
+ callbacks: { onFinish: a == null ? void 0 : a.onFinish }
523
565
  }
524
566
  );
525
567
  case "EITHER_OR":
526
568
  return /* @__PURE__ */ o(
527
- Vt,
569
+ We,
528
570
  {
529
- ...F,
530
- entityId: e.entityId,
531
- callbacks: { onFinish: i == null ? void 0 : i.onFinish }
571
+ ...O,
572
+ entityId: t.entityId,
573
+ callbacks: { onFinish: a == null ? void 0 : a.onFinish }
532
574
  }
533
575
  );
534
576
  case "MATCH_QUIZ":
535
577
  return /* @__PURE__ */ o(
536
- Dt,
578
+ Be,
537
579
  {
538
- ...b,
539
- entityId: e.entityId,
540
- showPredictionDetails: (d == null ? void 0 : d.showPredictionDetails) ?? !0,
541
- showCountdown: (d == null ? void 0 : d.showCountdown) ?? !0,
542
- showTeamLabels: (d == null ? void 0 : d.showTeamLabels) ?? !0,
543
- showPoints: (d == null ? void 0 : d.showPoints) ?? !0,
544
- callbacks: { onFinish: i == null ? void 0 : i.onFinish }
580
+ ...x,
581
+ entityId: t.entityId,
582
+ showPredictionDetails: (c == null ? void 0 : c.showPredictionDetails) ?? !0,
583
+ showCountdown: (c == null ? void 0 : c.showCountdown) ?? !0,
584
+ showTeamLabels: (c == null ? void 0 : c.showTeamLabels) ?? !0,
585
+ showPoints: (c == null ? void 0 : c.showPoints) ?? !0,
586
+ callbacks: { onFinish: a == null ? void 0 : a.onFinish }
545
587
  }
546
588
  );
547
589
  case "CUSTOM_EVENT_GAME":
548
590
  return /* @__PURE__ */ o(
549
- Wt,
591
+ Qe,
550
592
  {
551
- ...b,
552
- entityId: e.entityId,
553
- optionsLayout: I,
593
+ ...x,
594
+ entityId: t.entityId,
595
+ optionsLayout: C,
554
596
  showPredictionDetails: (f == null ? void 0 : f.showPredictionDetails) ?? !0,
555
597
  showCountdown: (f == null ? void 0 : f.showCountdown) ?? !0,
556
598
  showPoints: (f == null ? void 0 : f.showPoints) ?? !0,
557
- callbacks: { onFinish: i == null ? void 0 : i.onFinish }
599
+ callbacks: { onFinish: a == null ? void 0 : a.onFinish }
558
600
  }
559
601
  );
560
602
  default:
561
- return /* @__PURE__ */ o(g, { sx: { padding: a.spacing.md, textAlign: "center" }, children: /* @__PURE__ */ o(
562
- V,
563
- {
564
- sx: {
565
- fontSize: "1em",
566
- fontFamily: a.fonts.secondary,
567
- color: a.colors.text
568
- },
569
- children: l("list.unsupportedContentType", { type: e.entityType })
570
- }
571
- ) });
603
+ return /* @__PURE__ */ o("div", { css: D.unsupported, children: /* @__PURE__ */ o("p", { css: D.unsupportedText, children: l("list.unsupportedContentType", { type: t.entityType }) }) });
572
604
  }
573
605
  };
574
- return /* @__PURE__ */ o(
575
- xt,
576
- {
577
- open: n,
578
- onClose: t,
579
- container: r,
580
- sx: { zIndex: 1300 },
581
- children: /* @__PURE__ */ P(
582
- Ct,
583
- {
584
- sx: {
585
- fontSize: "1em",
586
- fontFamily: a.fonts.secondary,
587
- maxWidth: "95vw",
588
- maxHeight: "95vh",
589
- overflowY: "auto",
590
- overflowX: "hidden",
591
- padding: 0,
592
- borderRadius: a.radius.md,
593
- backgroundColor: a.colors.surface
594
- },
595
- children: [
596
- /* @__PURE__ */ o(
597
- It,
598
- {
599
- sx: {
600
- zIndex: 1,
601
- // Joy's plain hover/active fill reads as a white tile over the item's image.
602
- "&:hover": { backgroundColor: "transparent" },
603
- "&:active": { backgroundColor: "transparent" }
604
- }
605
- }
606
- ),
607
- /* @__PURE__ */ o(g, { sx: { position: "relative", zIndex: 0, fontSize: "1em" }, children: /* @__PURE__ */ o(St, { fallback: /* @__PURE__ */ o(tt, { my: 4 }), children: x() }) })
608
- ]
609
- }
610
- )
606
+ return /* @__PURE__ */ o(ue, { open: n, onClose: e, children: /* @__PURE__ */ I("div", { role: "dialog", "aria-modal": "true", tabIndex: -1, css: D.dialog, children: [
607
+ /* @__PURE__ */ o("button", { type: "button", "aria-label": l("common.rules.close", "Close"), css: D.close, onClick: e, children: /* @__PURE__ */ o(we, { size: "calc(2em / 1.5)" }) }),
608
+ /* @__PURE__ */ o("div", { css: D.body, children: /* @__PURE__ */ o(xe, { fallback: /* @__PURE__ */ o(ie, { marginBlock: "32px" }), children: B() }) })
609
+ ] }) });
610
+ }, ce = i({
611
+ boxSizing: "border-box",
612
+ display: "inline-flex",
613
+ alignItems: "center",
614
+ justifyContent: "center",
615
+ position: "relative",
616
+ minWidth: "2em",
617
+ minHeight: "2em",
618
+ margin: 0,
619
+ border: "none",
620
+ borderRadius: r.radiusSm,
621
+ backgroundColor: "transparent",
622
+ color: r.text,
623
+ fontFamily: r.fontPrimary,
624
+ fontSize: "0.875em",
625
+ fontWeight: "inherit",
626
+ cursor: "pointer",
627
+ WebkitTapHighlightColor: "transparent",
628
+ "&:focus-visible": { outline: `2px solid ${r.focus}`, outlineOffset: "2px" },
629
+ "@media (hover: hover)": {
630
+ "&:hover": {
631
+ backgroundColor: "var(--fu-ucrc-neutral-plain-hover-bg)",
632
+ color: "var(--fu-ucrc-neutral-plain-hover-color)"
611
633
  }
612
- );
613
- }, Yt = (e, n) => {
614
- const t = [];
615
- for (let p = e; p <= n; p += 1) t.push(p);
616
- return t;
617
- }, Gt = (e, n) => {
618
- if (n <= 0) return [];
619
- const t = [1], p = Math.max(2, e - 1), l = Math.min(n - 1, e + 1);
620
- return p > 2 && t.push("gap-start"), t.push(...Yt(p, l)), l < n - 1 && t.push("gap-end"), n > 1 && t.push(n), t;
621
- }, Kt = ({
622
- page: e,
623
- count: n,
624
- disabled: t = !1,
625
- onChange: p
626
- }) => {
627
- const l = Y(), a = (c) => {
628
- c >= 1 && c <= n && c !== e && p(c);
629
- }, r = {
634
+ },
635
+ "&:active": { backgroundColor: "var(--fu-ucrc-neutral-plain-active-bg)" },
636
+ "&:disabled": {
637
+ pointerEvents: "none",
638
+ cursor: "default",
639
+ color: "var(--fu-ucrc-neutral-plain-disabled-color)"
640
+ }
641
+ }), re = i(ce, {
642
+ paddingBlock: "6px",
643
+ paddingInline: "16px",
644
+ lineHeight: "inherit",
645
+ userSelect: "none",
646
+ fontWeight: 400,
647
+ "&:hover": { backgroundColor: r.surface }
648
+ }), A = {
649
+ root: i({
650
+ display: "flex",
651
+ alignItems: "center",
652
+ justifyContent: "center",
653
+ flexWrap: "wrap",
654
+ gap: r.space2xs
655
+ }),
656
+ // The UA's `line-height: normal` stays: Joy's IconButton never set one.
657
+ icon: i(ce, { paddingInline: "4px", paddingBlock: 0 }),
658
+ page: re,
659
+ // Hover and press keep the brand fill and its text colour.
660
+ current: i(re, {
661
+ fontWeight: 600,
662
+ backgroundColor: r.primary,
663
+ color: r.onPrimary,
664
+ "@media (hover: hover)": { "&:hover": { color: r.onPrimary } },
665
+ "&:hover, &:active": { backgroundColor: r.primary }
666
+ }),
667
+ ellipsis: i({
668
+ display: "flex",
669
+ alignItems: "center",
670
+ justifyContent: "center",
630
671
  minWidth: "2em",
631
672
  minHeight: "2em",
632
- borderRadius: l.radius.sm,
633
- fontFamily: l.fonts.primary,
673
+ borderRadius: r.radiusSm,
674
+ fontFamily: r.fontPrimary,
634
675
  fontSize: "0.875em",
635
- color: l.colors.text
676
+ color: r.text,
677
+ opacity: 0.6
678
+ })
679
+ }, $e = (t, n) => {
680
+ const e = [];
681
+ for (let u = t; u <= n; u += 1) e.push(u);
682
+ return e;
683
+ }, je = (t, n) => {
684
+ if (n <= 0) return [];
685
+ const e = [1], u = Math.max(2, t - 1), l = Math.min(n - 1, t + 1);
686
+ return u > 2 && e.push("gap-start"), e.push(...$e(u, l)), l < n - 1 && e.push("gap-end"), n > 1 && e.push(n), e;
687
+ }, Ve = ({
688
+ page: t,
689
+ count: n,
690
+ disabled: e = !1,
691
+ onChange: u
692
+ }) => {
693
+ const l = (s) => {
694
+ s >= 1 && s <= n && s !== t && u(s);
636
695
  };
637
- return /* @__PURE__ */ P(
638
- g,
639
- {
640
- sx: {
641
- display: "flex",
642
- alignItems: "center",
643
- justifyContent: "center",
644
- flexWrap: "wrap",
645
- gap: l.spacing["2xs"]
646
- },
647
- children: [
648
- /* @__PURE__ */ o(
649
- W,
650
- {
651
- variant: "plain",
652
- color: "neutral",
653
- disabled: t || e === 1,
654
- onClick: () => a(1),
655
- sx: r,
656
- children: /* @__PURE__ */ o(D, { children: /* @__PURE__ */ o(Tt, { size: 18 }) })
657
- }
658
- ),
659
- /* @__PURE__ */ o(
660
- W,
661
- {
662
- variant: "plain",
663
- color: "neutral",
664
- disabled: t || e === 1,
665
- onClick: () => a(e - 1),
666
- sx: r,
667
- children: /* @__PURE__ */ o(D, { children: /* @__PURE__ */ o(Pt, { size: 18 }) })
668
- }
669
- ),
670
- Gt(e, n).map((c, y) => {
671
- if (typeof c == "string")
672
- return /* @__PURE__ */ o(
673
- g,
674
- {
675
- sx: {
676
- ...r,
677
- display: "flex",
678
- alignItems: "center",
679
- justifyContent: "center",
680
- opacity: 0.6
681
- },
682
- children: "…"
683
- },
684
- `${c}-${y}`
685
- );
686
- const s = c === e;
687
- return /* @__PURE__ */ o(
688
- et,
689
- {
690
- variant: "plain",
691
- color: "neutral",
692
- disabled: t,
693
- onClick: () => a(c),
694
- sx: {
695
- ...r,
696
- fontWeight: s ? 600 : 400,
697
- bgcolor: s ? l.colors.primary : "transparent",
698
- color: s ? l.colors.onPrimary : l.colors.text,
699
- "&:hover": {
700
- bgcolor: s ? l.colors.primary : l.colors.surface
701
- }
702
- },
703
- children: c
704
- },
705
- c
706
- );
707
- }),
708
- /* @__PURE__ */ o(
709
- W,
710
- {
711
- variant: "plain",
712
- color: "neutral",
713
- disabled: t || e === n,
714
- onClick: () => a(e + 1),
715
- sx: r,
716
- children: /* @__PURE__ */ o(D, { children: /* @__PURE__ */ o(Et, { size: 18 }) })
717
- }
718
- ),
719
- /* @__PURE__ */ o(
720
- W,
721
- {
722
- variant: "plain",
723
- color: "neutral",
724
- disabled: t || e === n,
725
- onClick: () => a(n),
726
- sx: r,
727
- children: /* @__PURE__ */ o(D, { children: /* @__PURE__ */ o(Mt, { size: 18 }) })
728
- }
729
- )
730
- ]
731
- }
732
- );
733
- }, $t = {
696
+ return /* @__PURE__ */ I("div", { css: A.root, children: [
697
+ /* @__PURE__ */ o("button", { type: "button", css: A.icon, disabled: e || t === 1, onClick: () => l(1), children: /* @__PURE__ */ o(G, { children: /* @__PURE__ */ o(ve, { size: 18 }) }) }),
698
+ /* @__PURE__ */ o("button", { type: "button", css: A.icon, disabled: e || t === 1, onClick: () => l(t - 1), children: /* @__PURE__ */ o(G, { children: /* @__PURE__ */ o(Ce, { size: 18 }) }) }),
699
+ je(t, n).map((s, y) => {
700
+ if (typeof s == "string")
701
+ return /* @__PURE__ */ o("div", { css: A.ellipsis, children: "…" }, `${s}-${y}`);
702
+ const p = s === t;
703
+ return /* @__PURE__ */ o(
704
+ "button",
705
+ {
706
+ type: "button",
707
+ css: p ? A.current : A.page,
708
+ "aria-current": p ? "page" : void 0,
709
+ disabled: e,
710
+ onClick: () => l(s),
711
+ children: s
712
+ },
713
+ s
714
+ );
715
+ }),
716
+ /* @__PURE__ */ o("button", { type: "button", css: A.icon, disabled: e || t === n, onClick: () => l(t + 1), children: /* @__PURE__ */ o(G, { children: /* @__PURE__ */ o(Se, { size: 18 }) }) }),
717
+ /* @__PURE__ */ o("button", { type: "button", css: A.icon, disabled: e || t === n, onClick: () => l(n), children: /* @__PURE__ */ o(G, { children: /* @__PURE__ */ o(Ie, { size: 18 }) }) })
718
+ ] });
719
+ }, Ze = {
734
720
  CLASSIC_QUIZ: "list.types.classicQuiz",
735
721
  PERSONALITY_QUIZ: "list.types.personalityQuiz",
736
722
  EITHER_OR: "list.types.eitherOr",
737
723
  POLL: "list.types.poll",
738
724
  MATCH_QUIZ: "list.types.matchQuiz",
739
725
  CUSTOM_EVENT_GAME: "list.types.eventGame"
740
- }, qt = (e) => {
726
+ }, X = {
727
+ root: i({ fontSize: "1em", fontFamily: r.fontSecondary }),
728
+ grid: i({ display: "grid", gap: r.spaceXs, marginBottom: r.spaceMd }),
729
+ loadMoreRow: i({ display: "flex", justifyContent: "center", marginTop: r.spaceMd }),
730
+ loadMore: i(pe, {
731
+ padding: "10px 16px",
732
+ borderRadius: r.radiusXl,
733
+ backgroundColor: r.primary,
734
+ color: r.onPrimary,
735
+ fontFamily: r.fontPrimary,
736
+ fontSize: "0.9375em",
737
+ fontWeight: 500,
738
+ lineHeight: "24px",
739
+ letterSpacing: "0.46px",
740
+ textTransform: "uppercase",
741
+ transition: "all 300ms cubic-bezier(0.2, 0, 0, 1)",
742
+ transform: "scale(1)",
743
+ "&:hover": { transform: "scale(1.02)" },
744
+ "&:active": { transform: "scale(0.98)" }
745
+ }),
746
+ pagination: i({ marginTop: r.spaceMd })
747
+ }, De = (t) => {
741
748
  const {
742
749
  entityId: n,
743
- sdk: t,
744
- itemsCount: p = 10,
750
+ sdk: e,
751
+ itemsCount: u = 10,
745
752
  itemsPerRow: l = 2,
746
- widgetMode: a = "load-more",
747
- urls: r,
748
- defaultImagePlaceholderUrl: c
749
- } = e, { t: y } = K(), s = Y(), U = J(), [A, Z] = z(null), [O, H] = z(!1), {
750
- items: R,
751
- loading: E,
752
- error: Q,
753
- hasMore: w,
754
- loadMore: _,
755
- page: k,
756
- pageCount: I,
757
- goToPage: M
758
- } = zt(t, n, p, a), S = Ot(r), T = a === "paged", d = (x) => {
759
- const u = Qt(x, r);
760
- if (u) {
761
- window.location.href = u;
753
+ widgetMode: s = "load-more",
754
+ urls: y,
755
+ defaultImagePlaceholderUrl: p
756
+ } = t, { t: T } = q(), b = ae(), [V, H] = k(null), [Z, z] = k(!1), {
757
+ items: Q,
758
+ loading: v,
759
+ error: N,
760
+ hasMore: W,
761
+ loadMore: w,
762
+ page: C,
763
+ pageCount: R,
764
+ goToPage: U
765
+ } = ze(e, n, u, s), P = Ue(y), c = s === "paged", f = (S) => {
766
+ const L = Oe(S, y);
767
+ if (L) {
768
+ window.location.href = L;
762
769
  return;
763
770
  }
764
- S || (Z(x), H(!0));
765
- }, f = U ? 1 : Math.max(1, Math.floor(l)), i = T && I > 1, F = !T && w && !E, b = !(T && E);
766
- return Q || !E && R.length === 0 && !i ? null : /* @__PURE__ */ P(g, { sx: { fontSize: "1em", fontFamily: s.fonts.secondary }, children: [
767
- b && /* @__PURE__ */ o(
768
- g,
769
- {
770
- sx: {
771
- display: "grid",
772
- gridTemplateColumns: `repeat(${f}, minmax(0, 1fr))`,
773
- gap: s.spacing.xs,
774
- marginBottom: s.spacing.md
775
- },
776
- children: R.map((x) => {
777
- const u = nt(x);
778
- if (!u) return null;
779
- const C = $t[x.entityType];
780
- return /* @__PURE__ */ o(
781
- Ht,
782
- {
783
- item: x,
784
- entityData: u,
785
- typeLabel: C ? y(C) : "",
786
- imagePlaceholder: c || "",
787
- onClick: d
788
- },
789
- x.entityId
790
- );
791
- })
792
- }
793
- ),
794
- E && /* @__PURE__ */ o(tt, { my: 4 }),
795
- F && /* @__PURE__ */ o(
796
- g,
797
- {
798
- sx: {
799
- display: "flex",
800
- justifyContent: "center",
801
- marginTop: s.spacing.md
771
+ P || (H(S), z(!0));
772
+ }, a = b ? 1 : Math.max(1, Math.floor(l)), O = c && R > 1, x = !c && W && !v, B = !(c && v);
773
+ return N || !v && Q.length === 0 && !O ? null : /* @__PURE__ */ I("div", { css: X.root, children: [
774
+ B && /* @__PURE__ */ o("div", { css: X.grid, style: { gridTemplateColumns: `repeat(${a}, minmax(0, 1fr))` }, children: Q.map((S) => {
775
+ const L = se(S);
776
+ if (!L) return null;
777
+ const h = Ze[S.entityType];
778
+ return /* @__PURE__ */ o(
779
+ Fe,
780
+ {
781
+ item: S,
782
+ entityData: L,
783
+ typeLabel: h ? T(h) : "",
784
+ imagePlaceholder: p || "",
785
+ onClick: f
802
786
  },
803
- children: /* @__PURE__ */ o(
804
- et,
805
- {
806
- variant: "soft",
807
- onClick: _,
808
- sx: {
809
- borderRadius: s.radius.xl,
810
- py: "10px",
811
- px: "16px",
812
- bgcolor: s.colors.primary,
813
- color: s.colors.onPrimary,
814
- fontFamily: s.fonts.primary,
815
- fontSize: "0.9375em",
816
- fontWeight: 500,
817
- lineHeight: "24px",
818
- letterSpacing: "0.46px",
819
- textTransform: "uppercase",
820
- transition: "all 300ms cubic-bezier(0.2, 0, 0, 1)",
821
- transform: "scale(1)",
822
- "&:hover": {
823
- bgcolor: s.colors.primary,
824
- transform: "scale(1.02)"
825
- },
826
- "&:active": {
827
- color: s.colors.onPrimary,
828
- transform: "scale(0.98)"
829
- }
830
- },
831
- children: y("list.loadMore")
832
- }
833
- )
834
- }
835
- ),
836
- i && /* @__PURE__ */ o(g, { sx: { marginTop: s.spacing.md }, children: /* @__PURE__ */ o(
837
- Kt,
838
- {
839
- page: k,
840
- count: I,
841
- disabled: E,
842
- onChange: M
843
- }
844
- ) }),
787
+ S.entityId
788
+ );
789
+ }) }),
790
+ v && /* @__PURE__ */ o(ie, { marginBlock: "32px" }),
791
+ x && /* @__PURE__ */ o("div", { css: X.loadMoreRow, children: /* @__PURE__ */ o("button", { type: "button", css: X.loadMore, onClick: w, children: T("list.loadMore") }) }),
792
+ O && /* @__PURE__ */ o("div", { css: X.pagination, children: /* @__PURE__ */ o(Ve, { page: C, count: R, disabled: v, onChange: U }) }),
845
793
  /* @__PURE__ */ o(
846
- jt,
794
+ Ne,
847
795
  {
848
- item: A,
849
- open: O,
850
- onClose: () => H(!1),
851
- listProps: e
796
+ item: V,
797
+ open: Z,
798
+ onClose: () => z(!1),
799
+ listProps: t
852
800
  }
853
801
  )
854
802
  ] });
855
- }, Xt = (e) => /* @__PURE__ */ o(gt, { packageName: "list", ...e, children: /* @__PURE__ */ o(qt, { ...e }) }), ae = Lt(Xt);
803
+ }, Xe = (t) => {
804
+ var n;
805
+ return /* @__PURE__ */ o(
806
+ fe,
807
+ {
808
+ packageName: "list",
809
+ language: t.language,
810
+ themeOptions: t.themeOptions,
811
+ disableCache: t.disableCache,
812
+ optionsLayout: t.optionsLayout,
813
+ leadPhoneCountryCode: (n = t.leads) == null ? void 0 : n.phoneCountryCode,
814
+ children: /* @__PURE__ */ o(De, { ...t })
815
+ }
816
+ );
817
+ }, rt = Me(Xe);
856
818
  export {
857
- ae as List
819
+ rt as List
858
820
  };