fansunited-frontend-components 0.0.39 → 0.0.40

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 (48) hide show
  1. package/ChanceGame.js +104 -102
  2. package/ClassicQuizPlay.js +45 -42
  3. package/CollectLead.js +25 -24
  4. package/Discussion.js +376 -378
  5. package/EitherOrPlay.d.ts +4 -0
  6. package/EitherOrPlay.d.ts.map +1 -0
  7. package/EitherOrPlay.js +2533 -0
  8. package/EventGamePlay.js +59 -54
  9. package/MatchQuizPlay.js +63 -57
  10. package/PersonalityQuizPlay.js +7935 -7201
  11. package/PickThePair.js +153 -151
  12. package/PollVote.js +108 -104
  13. package/chunks/{AlertMessage-C2aBXCrl.js → AlertMessage-cjTHrMUK.js} +51 -51
  14. package/chunks/ArrowRightAlt-88jKjh6A.js +8 -0
  15. package/chunks/Avatar-CQCrd1m-.js +352 -0
  16. package/chunks/ChanceGameEmbedVariant-DWqOTf4o.js +1051 -0
  17. package/chunks/{CheckCircle-D-GH16Lb.js → CheckCircle-ClY-iOQ5.js} +105 -105
  18. package/chunks/{CollectLeadForm-o9NdYQgu.js → CollectLeadForm-0vVnu4DL.js} +5 -5
  19. package/chunks/FavoriteBorder-BHnvGBrn.js +11 -0
  20. package/chunks/{useInfoPage-v91yL5SS.js → NotFoundSkeleton-B3RNa8KJ.js} +451 -646
  21. package/chunks/Notification-BTtUhfZQ.js +615 -0
  22. package/chunks/OverlayLeadAfterCollection-CaBbwZVo.js +480 -0
  23. package/chunks/{OverlayScoreStateSkeleton-xvq9lQEi.js → OverlayScoreStateSkeleton-DJn0Rim3.js} +3 -3
  24. package/chunks/Person-D0Im9_zE.js +522 -0
  25. package/chunks/{PickOneOfX-C2YpLk40.js → PickOneOfX-DYQ4c1o2.js} +7 -7
  26. package/chunks/{Portal-DWAr8MhA.js → Portal-B9wkUnY2.js} +7 -7
  27. package/chunks/{ConstantsProvider-BPJJz9fq.js → PrizeCard-gMp7I66d.js} +3593 -2860
  28. package/chunks/{Spinner-m59ZJZ35.js → Spinner-BBA89t5s.js} +50 -50
  29. package/chunks/StandardLeadAfterCollection-L1cOGfS6.js +432 -0
  30. package/chunks/{Tabs-BGihvj9C.js → Tabs-D_n8rNw3.js} +28 -28
  31. package/chunks/{Textarea-Bzlb89Zp.js → Textarea-BdN2xj4j.js} +44 -44
  32. package/chunks/{TimerOutlined-DiX8hCoC.js → TimerOutlined-DmKZDDI-.js} +1 -1
  33. package/chunks/chevron-right-DGEksBI7.js +330 -0
  34. package/chunks/default-quiz-bg-vertical-CT7rrg9o.js +5 -0
  35. package/chunks/index-2s5UkG1y.js +1607 -0
  36. package/chunks/useImageVariant-pnFelF9A.js +535 -0
  37. package/chunks/useInfoPage-DPkzE5Gn.js +204 -0
  38. package/components.d.ts +2 -1
  39. package/components.d.ts.map +1 -1
  40. package/index.d.ts +1 -0
  41. package/index.d.ts.map +1 -1
  42. package/index.js +4 -2
  43. package/package.json +1 -1
  44. package/chunks/ChanceGameEmbedVariant-BvIKBhq_.js +0 -2609
  45. package/chunks/Notification-Bwcoljir.js +0 -961
  46. package/chunks/OverlayLeadAfterCollection-B3D5ct0J.js +0 -901
  47. package/chunks/chevron-right-Dlc9ZKhv.js +0 -846
  48. package/chunks/useImageVariant-Do8kOVs2.js +0 -537
@@ -0,0 +1,2533 @@
1
+ import { jsx as t, jsxs as C, Fragment as Le } from "react/jsx-runtime";
2
+ import { useState as R, useEffect as re, useRef as Ie, useCallback as me } from "react";
3
+ import { c as ge, h as de, f as ue, T as w, e as fe, B as l, A as ee, aq as we, k as H, j as ne, D as pe, R as He, u as De, F as Ge, W as Ae, i as je } from "./chunks/PrizeCard-gMp7I66d.js";
4
+ import { P as Ne } from "./chunks/Portal-B9wkUnY2.js";
5
+ import { S as ke } from "./chunks/Spinner-BBA89t5s.js";
6
+ import "react-dom";
7
+ import { Z as Ve, A as Ye, S as Oe } from "./chunks/index-2s5UkG1y.js";
8
+ import { h as Q, c as qe, u as Fe, e as _e } from "./chunks/useImageVariant-pnFelF9A.js";
9
+ import { S as Ke, N as Ze } from "./chunks/NotFoundSkeleton-B3RNa8KJ.js";
10
+ import { A as We } from "./chunks/ArrowRightAlt-88jKjh6A.js";
11
+ import { F as Me, a as Xe } from "./chunks/FavoriteBorder-BHnvGBrn.js";
12
+ import { C as Pe } from "./chunks/CheckCircle-ClY-iOQ5.js";
13
+ import { T as Je } from "./chunks/TimerOutlined-DmKZDDI-.js";
14
+ import { S as Te } from "./chunks/AlertMessage-cjTHrMUK.js";
15
+ import { S as Qe, T as et, P as tt } from "./chunks/Person-D0Im9_zE.js";
16
+ import { A as nt } from "./chunks/Avatar-CQCrd1m-.js";
17
+ import { t as rt, T as ot, a as it, b as Re, c as Be } from "./chunks/Tabs-D_n8rNw3.js";
18
+ import { S as lt, a as at } from "./chunks/StandardLeadAfterCollection-L1cOGfS6.js";
19
+ import { C as st } from "./chunks/CollectLeadForm-0vVnu4DL.js";
20
+ const ct = ge([/* @__PURE__ */ t("path", {
21
+ d: "M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2M12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8"
22
+ }, "0"), /* @__PURE__ */ t("path", {
23
+ d: "M12.5 7H11v6l5.25 3.15.75-1.23-4.5-2.67z"
24
+ }, "1")], "AccessTime"), ve = ge(/* @__PURE__ */ t("path", {
25
+ d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2m5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z"
26
+ }), "Cancel"), dt = ge(/* @__PURE__ */ t("path", {
27
+ d: "M9.01 14H2v2h7.01v3L13 15l-3.99-4zm5.98-1v-3H22V8h-7.01V5L11 9z"
28
+ }), "CompareArrows"), Ce = ge(/* @__PURE__ */ t("path", {
29
+ d: "M19 5h-2V3H7v2H5c-1.1 0-2 .9-2 2v1c0 2.55 1.92 4.63 4.39 4.94.63 1.5 1.98 2.63 3.61 2.96V19H7v2h10v-2h-4v-3.1c1.63-.33 2.98-1.46 3.61-2.96C19.08 12.63 21 10.55 21 8V7c0-1.1-.9-2-2-2M5 8V7h2v3.82C5.84 10.4 5 9.3 5 8m14 0c0 1.3-.84 2.4-2 2.82V7h2z"
30
+ }), "EmojiEvents"), ut = ge(/* @__PURE__ */ t("path", {
31
+ d: "M7.5 21H2V9h5.5zm7.25-18h-5.5v18h5.5zM22 11h-5.5v10H22z"
32
+ }), "Leaderboard"), mt = ge(/* @__PURE__ */ t("path", {
33
+ d: "M9 1h6v2H9zm10.03 6.39 1.42-1.42c-.43-.51-.9-.99-1.41-1.41l-1.42 1.42C16.07 4.74 14.12 4 12 4c-4.97 0-9 4.03-9 9s4.02 9 9 9 9-4.03 9-9c0-2.12-.74-4.07-1.97-5.61M13 14h-2V8h2z"
34
+ }), "Timer"), gt = ge(/* @__PURE__ */ t("path", {
35
+ d: "M9.68 13.69 12 11.93l2.31 1.76-.88-2.85L15.75 9h-2.84L12 6.19 11.09 9H8.25l2.31 1.84zM20 10c0-4.42-3.58-8-8-8s-8 3.58-8 8c0 2.03.76 3.87 2 5.28V23l6-2 6 2v-7.72c1.24-1.41 2-3.25 2-5.28m-8-6c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6 2.69-6 6-6"
36
+ }), "WorkspacePremium"), ft = (e, n) => {
37
+ const [d, b] = R(null), a = async () => {
38
+ try {
39
+ const p = await n.miniGames.getEitherOrById(e, !0);
40
+ b(p);
41
+ } catch (p) {
42
+ console.error(p), b(new Ve());
43
+ }
44
+ };
45
+ return re(() => (a(), () => b(null)), [e, n]), d;
46
+ }, ht = (e, n, d = !1) => {
47
+ const [b, a] = R(null), [p, i] = R(!1), [s, o] = R(!1), c = async () => {
48
+ try {
49
+ const h = await n.miniGames.getMyEitherOrStats(e);
50
+ a(h);
51
+ } catch (h) {
52
+ if (a(null), n.helpers.getSDKConfiguration().errorHandlingMode === "standard") {
53
+ const S = h;
54
+ if (S.error.code === 404)
55
+ return;
56
+ if (S.error.code === 401 || S.error.code === 403) {
57
+ i(!0);
58
+ return;
59
+ }
60
+ o(!0);
61
+ return;
62
+ }
63
+ const y = h;
64
+ if (y.data.error.code === 404)
65
+ return;
66
+ if (y.data.error.code === 401 || y.data.error.code === 403) {
67
+ i(!0);
68
+ return;
69
+ }
70
+ o(!0);
71
+ }
72
+ };
73
+ return re(() => (c(), () => {
74
+ a(null), i(!1), o(!1);
75
+ }), [e, n, d]), {
76
+ myStats: b,
77
+ setMyStats: a,
78
+ isUnauthorized: p,
79
+ isApiError: s,
80
+ setIsUnauthorized: i,
81
+ setIsApiError: o
82
+ };
83
+ }, K = {
84
+ LOADING: "loading",
85
+ TUTORIAL: "tutorial",
86
+ PLAYING: "playing",
87
+ RESULTS: "results"
88
+ }, oe = (e) => {
89
+ const n = de().secondary, d = ue();
90
+ if (!e.brandingLogo)
91
+ return null;
92
+ const b = e.label ? /* @__PURE__ */ t(
93
+ w,
94
+ {
95
+ level: "body-sm",
96
+ sx: {
97
+ fontWeight: 400,
98
+ lineHeight: "166%",
99
+ letterSpacing: "0.4px",
100
+ fontSize: "1em",
101
+ color: e.textColor,
102
+ textAlign: "right",
103
+ fontFamily: n
104
+ },
105
+ children: e.label
106
+ }
107
+ ) : null;
108
+ return fe() ? /* @__PURE__ */ C(
109
+ l,
110
+ {
111
+ sx: {
112
+ display: "flex",
113
+ flexDirection: "column",
114
+ gap: d.xs,
115
+ alignItems: "center",
116
+ minWidth: "180px",
117
+ fontSize: "1em",
118
+ zIndex: 1
119
+ },
120
+ children: [
121
+ b,
122
+ /* @__PURE__ */ t(
123
+ "img",
124
+ {
125
+ src: e.brandingLogo,
126
+ alt: "branding-logo",
127
+ style: { maxHeight: "50px", maxWidth: "100px" }
128
+ }
129
+ )
130
+ ]
131
+ }
132
+ ) : /* @__PURE__ */ C(
133
+ l,
134
+ {
135
+ sx: {
136
+ minWidth: "180px",
137
+ display: "flex",
138
+ gap: "8px",
139
+ alignItems: "center",
140
+ zIndex: 10,
141
+ fontSize: "1em"
142
+ },
143
+ children: [
144
+ b,
145
+ /* @__PURE__ */ t(
146
+ "img",
147
+ {
148
+ src: e.brandingLogo,
149
+ alt: "branding-logo",
150
+ style: { maxHeight: "50px", maxWidth: "100px" }
151
+ }
152
+ )
153
+ ]
154
+ }
155
+ );
156
+ }, xt = ({
157
+ onStart: e,
158
+ game: n,
159
+ signInCTA: d,
160
+ showSignInCTA: b
161
+ }) => {
162
+ var $, m, O, P, M, F, x, U, r;
163
+ const { t: a } = ee(), p = fe(), i = we(), s = (($ = n == null ? void 0 : n.branding) == null ? void 0 : $.colors) || null, o = (s == null ? void 0 : s.primaryColor) || H().palette.primary.plainColor, c = H().palette.primary.onPrimary, h = (s == null ? void 0 : s.contentColor) || H().textColor, f = H().surfaceVariant, y = de().primary, S = ne().xl, k = ne().md, I = ue(), D = Q(o || ""), T = Q(f || ""), v = D ? `rgba(${D.replace(/[^\d,]/g, "")}, 0.12)` : `${o}20`, u = p ? ((O = (m = n == null ? void 0 : n.branding) == null ? void 0 : m.images) == null ? void 0 : O.mobileLogo) || ((M = (P = n == null ? void 0 : n.branding) == null ? void 0 : P.images) == null ? void 0 : M.mainLogo) || "" : ((x = (F = n == null ? void 0 : n.branding) == null ? void 0 : F.images) == null ? void 0 : x.mainLogo) || "", z = [
164
+ {
165
+ icon: /* @__PURE__ */ t(mt, { sx: { fontSize: "1.1em" } }),
166
+ title: a("eitherOr.tutorial.step1Title"),
167
+ description: a("eitherOr.tutorial.step1Description", {
168
+ seconds: (n == null ? void 0 : n.time) ?? 10
169
+ })
170
+ },
171
+ {
172
+ icon: /* @__PURE__ */ t(Me, { sx: { fontSize: "1.1em" } }),
173
+ title: a("eitherOr.tutorial.step2Title", { lives: (n == null ? void 0 : n.lives) ?? 3 }),
174
+ description: a("eitherOr.tutorial.step2Description", {
175
+ lives: (n == null ? void 0 : n.lives) ?? 3
176
+ })
177
+ },
178
+ {
179
+ icon: /* @__PURE__ */ t(Ce, { sx: { fontSize: "1.1em" } }),
180
+ title: a("eitherOr.tutorial.step3Title"),
181
+ description: a("eitherOr.tutorial.step3Description")
182
+ }
183
+ ];
184
+ return n ? /* @__PURE__ */ t(l, { sx: { display: "flex", flexDirection: "column", p: I.md }, children: /* @__PURE__ */ C(
185
+ l,
186
+ {
187
+ sx: {
188
+ display: "flex",
189
+ flexDirection: "column",
190
+ gap: p ? I.lg : I.md
191
+ },
192
+ children: [
193
+ /* @__PURE__ */ t(
194
+ l,
195
+ {
196
+ sx: {
197
+ borderRadius: k,
198
+ overflow: "hidden",
199
+ bgcolor: T ? `rgba(${T.replace(/[^\d,]/g, "")}, 0.5)` : f,
200
+ display: "flex",
201
+ flexDirection: "column",
202
+ backdropFilter: "blur(4px)"
203
+ },
204
+ children: z.map((j, N) => {
205
+ const A = N === z.length - 1;
206
+ return /* @__PURE__ */ C(l, { children: [
207
+ /* @__PURE__ */ C(
208
+ l,
209
+ {
210
+ sx: {
211
+ display: "flex",
212
+ alignItems: "flex-start",
213
+ gap: I.md,
214
+ px: I.md,
215
+ py: I.md
216
+ },
217
+ children: [
218
+ /* @__PURE__ */ t(
219
+ l,
220
+ {
221
+ sx: {
222
+ width: 36,
223
+ height: 36,
224
+ borderRadius: "50%",
225
+ bgcolor: v,
226
+ color: o,
227
+ display: "flex",
228
+ alignItems: "center",
229
+ justifyContent: "center",
230
+ flexShrink: 0
231
+ },
232
+ children: j.icon
233
+ }
234
+ ),
235
+ /* @__PURE__ */ C(l, { sx: { flex: 1, minWidth: 0, pt: "2px" }, children: [
236
+ /* @__PURE__ */ t(
237
+ w,
238
+ {
239
+ sx: {
240
+ fontFamily: y,
241
+ fontWeight: 700,
242
+ fontSize: "0.875em",
243
+ lineHeight: 1.3,
244
+ color: h
245
+ },
246
+ children: j.title
247
+ }
248
+ ),
249
+ /* @__PURE__ */ t(
250
+ w,
251
+ {
252
+ sx: {
253
+ fontFamily: y,
254
+ fontWeight: 400,
255
+ fontSize: "0.75em",
256
+ lineHeight: 1.6,
257
+ color: h,
258
+ opacity: 0.65,
259
+ mt: I["2xs"]
260
+ },
261
+ children: j.description
262
+ }
263
+ )
264
+ ] })
265
+ ]
266
+ }
267
+ ),
268
+ !A && /* @__PURE__ */ t(
269
+ l,
270
+ {
271
+ sx: {
272
+ height: "1px",
273
+ mx: I.md,
274
+ bgcolor: D ? `rgba(${D.replace(/[^\d,]/g, "")}, 0.1)` : `${o}1A`
275
+ }
276
+ }
277
+ )
278
+ ] }, N);
279
+ })
280
+ }
281
+ ),
282
+ /* @__PURE__ */ C(
283
+ l,
284
+ {
285
+ sx: {
286
+ display: "flex",
287
+ flexDirection: i ? "column" : "row",
288
+ justifyContent: u ? "space-between" : "flex-end",
289
+ alignItems: "center",
290
+ gap: I.lg
291
+ },
292
+ children: [
293
+ u && !i && /* @__PURE__ */ t(
294
+ oe,
295
+ {
296
+ brandingLogo: u,
297
+ textColor: h,
298
+ label: ((U = n == null ? void 0 : n.labels) == null ? void 0 : U.sponsor) || null
299
+ }
300
+ ),
301
+ /* @__PURE__ */ t(
302
+ pe,
303
+ {
304
+ variant: "soft",
305
+ endDecorator: /* @__PURE__ */ t(We, {}),
306
+ onClick: b && d ? d.onClick : e,
307
+ sx: {
308
+ borderRadius: S,
309
+ py: "10px",
310
+ pr: "12px",
311
+ pl: "16px",
312
+ bgcolor: o,
313
+ color: c,
314
+ transition: "all 300ms cubic-bezier(0.2, 0, 0, 1)",
315
+ transform: "scale(1)",
316
+ alignSelf: "center",
317
+ "&:hover": { bgcolor: o, transform: "scale(1.02)" },
318
+ "&:active": { color: c, transform: "scale(0.98)" },
319
+ "&:disabled": {
320
+ bgcolor: o,
321
+ color: c,
322
+ opacity: "12%"
323
+ },
324
+ "--Icon-color": c,
325
+ "@keyframes pulse": {
326
+ "0%": { transform: "scale(1)" },
327
+ "50%": { transform: "scale(1.05)" },
328
+ "100%": { transform: "scale(1)" }
329
+ },
330
+ animation: "pulse 1s infinite",
331
+ fontSize: "0.9375em"
332
+ },
333
+ children: /* @__PURE__ */ t(
334
+ w,
335
+ {
336
+ sx: {
337
+ fontFamily: y,
338
+ fontWeight: 500,
339
+ fontSize: "0.9375em",
340
+ lineHeight: "24px",
341
+ letterSpacing: "0.46px",
342
+ textTransform: "uppercase",
343
+ color: c,
344
+ gap: I.xs,
345
+ display: "flex",
346
+ alignItems: "center"
347
+ },
348
+ children: b && d ? d.defaultLabel : a("eitherOr.buttons.start")
349
+ }
350
+ )
351
+ }
352
+ ),
353
+ u && i && /* @__PURE__ */ t(
354
+ oe,
355
+ {
356
+ brandingLogo: u,
357
+ textColor: h,
358
+ label: ((r = n == null ? void 0 : n.labels) == null ? void 0 : r.sponsor) || null
359
+ }
360
+ )
361
+ ]
362
+ }
363
+ )
364
+ ]
365
+ }
366
+ ) }) : null;
367
+ }, bt = He`
368
+ 0% {
369
+ opacity: 1;
370
+ transform: translateY(0);
371
+ }
372
+ 100% {
373
+ opacity: 0;
374
+ transform: translateY(-20px);
375
+ }
376
+ `, pt = {
377
+ pointsAdded: {
378
+ position: "absolute",
379
+ top: -20,
380
+ right: 0,
381
+ color: "primary.500",
382
+ animation: `${bt} 1s ease-out forwards`
383
+ },
384
+ optionWrapper: {
385
+ position: "relative",
386
+ flex: 1,
387
+ transition: "transform 0.2s"
388
+ },
389
+ dividerWrapper: {
390
+ width: { xs: "100%", sm: "40px" },
391
+ my: { xs: 2, sm: 0 }
392
+ },
393
+ dividerButton: {
394
+ borderRadius: "50%",
395
+ bgcolor: "background.surface",
396
+ boxShadow: "sm",
397
+ width: "30px",
398
+ height: "30px",
399
+ "&:hover": { bgcolor: "background.level1" }
400
+ },
401
+ dividerText: {
402
+ fontWeight: "lg",
403
+ color: "text.secondary",
404
+ display: { xs: "none", sm: "block" },
405
+ textTransform: "uppercase",
406
+ fontSize: "0.675em !important"
407
+ },
408
+ timerProgressWrapper: {
409
+ position: "relative",
410
+ width: "100%",
411
+ height: 8,
412
+ bgcolor: "neutral.200",
413
+ borderRadius: "4px",
414
+ overflow: "hidden"
415
+ },
416
+ timerProgress: {
417
+ position: "absolute",
418
+ left: 0,
419
+ top: 0,
420
+ height: "100%",
421
+ transition: "width 1s linear, background-color 0.3s ease",
422
+ borderRadius: "inherit",
423
+ transform: "translateZ(0)"
424
+ }
425
+ }, Ee = ({
426
+ option: e,
427
+ selected: n,
428
+ feedback: d,
429
+ onSelect: b,
430
+ pairId: a,
431
+ brandingPrimaryColor: p,
432
+ optionIndex: i = 0
433
+ }) => {
434
+ const s = H(), o = ue(), c = p || s.palette.primary.plainColor, h = s.palette.primary.onPrimary, f = s.palette.success.plainColor, y = s.palette.danger.plainColor, S = Q(c || ""), k = S ? S.replace(/[^\d,]/g, "") : null, I = qe(e.images ?? null), D = !!I, T = i === 0 ? "A" : "B", v = d.selectedOption === e.id, u = v && d.isCorrect, z = v && !d.isCorrect;
435
+ if (!D) {
436
+ const $ = i === 0 ? "135deg" : "225deg", m = u ? `linear-gradient(${$}, ${f}20 0%, ${f}0D 100%)` : z ? `linear-gradient(${$}, ${y}20 0%, ${y}0D 100%)` : k ? `linear-gradient(${$}, rgba(${k}, 0.22) 0%, rgba(${k}, 0.08) 60%, rgba(${k}, 0.14) 100%)` : `linear-gradient(${$}, ${c}38 0%, ${c}14 60%, ${c}24 100%)`, O = k ? `repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(${k}, 0.04) 10px, rgba(${k}, 0.04) 11px)` : "none", P = u ? f : z ? y : k ? `rgba(${k}, 0.3)` : `${c}4D`, M = u ? f : z ? y : c;
437
+ return /* @__PURE__ */ C(
438
+ l,
439
+ {
440
+ onClick: () => !n && b(a, e.id),
441
+ sx: {
442
+ position: "relative",
443
+ height: "100px",
444
+ borderRadius: "sm",
445
+ overflow: "hidden",
446
+ cursor: n ? "default" : "pointer",
447
+ background: m,
448
+ border: "1.5px solid",
449
+ borderColor: P,
450
+ display: "flex",
451
+ alignItems: "center",
452
+ gap: "14px",
453
+ px: o.md,
454
+ transition: "transform 0.2s, box-shadow 0.2s, border-color 0.25s",
455
+ boxShadow: u ? `0 0 0 3px ${f}30` : z ? `0 0 0 3px ${y}30` : "none",
456
+ "&:hover": n ? {} : {
457
+ transform: "scale(1.01)",
458
+ boxShadow: `0 4px 16px ${k ? `rgba(${k}, 0.2)` : `${c}33`}`
459
+ }
460
+ },
461
+ children: [
462
+ /* @__PURE__ */ t(
463
+ l,
464
+ {
465
+ sx: {
466
+ position: "absolute",
467
+ inset: 0,
468
+ background: O,
469
+ zIndex: 0
470
+ }
471
+ }
472
+ ),
473
+ /* @__PURE__ */ t(
474
+ l,
475
+ {
476
+ sx: {
477
+ width: 40,
478
+ height: 40,
479
+ borderRadius: "50%",
480
+ bgcolor: M,
481
+ display: "flex",
482
+ alignItems: "center",
483
+ justifyContent: "center",
484
+ flexShrink: 0,
485
+ zIndex: 2,
486
+ transition: "background-color 0.25s",
487
+ boxShadow: u ? `0 2px 8px ${f}59` : z ? `0 2px 8px ${y}59` : `0 2px 8px ${k ? `rgba(${k}, 0.35)` : `${c}59`}`
488
+ },
489
+ children: u ? /* @__PURE__ */ t(Pe, { sx: { fontSize: "1.3em", color: "#fff" } }) : z ? /* @__PURE__ */ t(ve, { sx: { fontSize: "1.3em", color: "#fff" } }) : /* @__PURE__ */ t(
490
+ w,
491
+ {
492
+ sx: {
493
+ color: h,
494
+ fontWeight: 800,
495
+ fontSize: "1em",
496
+ lineHeight: 1,
497
+ userSelect: "none"
498
+ },
499
+ children: T
500
+ }
501
+ )
502
+ }
503
+ ),
504
+ /* @__PURE__ */ t(
505
+ w,
506
+ {
507
+ sx: {
508
+ fontWeight: 700,
509
+ fontSize: "0.9375em",
510
+ lineHeight: 1.35,
511
+ color: u ? f : z ? y : c,
512
+ zIndex: 2,
513
+ flex: 1,
514
+ transition: "color 0.25s"
515
+ },
516
+ children: e.label
517
+ }
518
+ )
519
+ ]
520
+ }
521
+ );
522
+ }
523
+ return /* @__PURE__ */ C(
524
+ l,
525
+ {
526
+ onClick: () => !n && b(a, e.id),
527
+ sx: {
528
+ position: "relative",
529
+ height: "160px",
530
+ borderRadius: "sm",
531
+ overflow: "hidden",
532
+ cursor: n ? "default" : "pointer",
533
+ backgroundImage: `url(${I})`,
534
+ backgroundSize: "cover",
535
+ backgroundPosition: "center top",
536
+ bgcolor: s.surfaceVariant,
537
+ border: "1.5px solid transparent",
538
+ borderColor: u ? f : z ? y : "transparent",
539
+ transition: "transform 0.2s, border-color 0.25s",
540
+ boxShadow: u ? `0 0 0 3px ${f}30` : z ? `0 0 0 3px ${y}30` : "none",
541
+ "&:hover": n ? {} : { transform: "scale(1.01)" }
542
+ },
543
+ children: [
544
+ /* @__PURE__ */ t(
545
+ l,
546
+ {
547
+ sx: {
548
+ position: "absolute",
549
+ inset: 0,
550
+ background: "linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0) 100%)"
551
+ }
552
+ }
553
+ ),
554
+ v && /* @__PURE__ */ t(
555
+ l,
556
+ {
557
+ sx: {
558
+ position: "absolute",
559
+ inset: 0,
560
+ background: u ? `linear-gradient(to top, ${f}CC, ${f}55 50%, transparent 100%)` : `linear-gradient(to top, ${y}CC, ${y}55 50%, transparent 100%)`,
561
+ transition: "background 0.25s",
562
+ zIndex: 1
563
+ }
564
+ }
565
+ ),
566
+ v && /* @__PURE__ */ t(
567
+ l,
568
+ {
569
+ sx: {
570
+ position: "absolute",
571
+ top: "8px",
572
+ right: "10px",
573
+ zIndex: 3
574
+ },
575
+ children: u ? /* @__PURE__ */ t(
576
+ Pe,
577
+ {
578
+ sx: {
579
+ fontSize: 28,
580
+ color: "#fff",
581
+ filter: "drop-shadow(0 1px 4px rgba(0,0,0,0.5))"
582
+ }
583
+ }
584
+ ) : /* @__PURE__ */ t(
585
+ ve,
586
+ {
587
+ sx: {
588
+ fontSize: 28,
589
+ color: "#fff",
590
+ filter: "drop-shadow(0 1px 4px rgba(0,0,0,0.5))"
591
+ }
592
+ }
593
+ )
594
+ }
595
+ ),
596
+ /* @__PURE__ */ t(
597
+ l,
598
+ {
599
+ sx: {
600
+ position: "absolute",
601
+ bottom: 0,
602
+ left: 0,
603
+ right: 0,
604
+ px: "12px",
605
+ py: "8px",
606
+ zIndex: 2
607
+ },
608
+ children: /* @__PURE__ */ t(
609
+ w,
610
+ {
611
+ sx: {
612
+ color: "#fff",
613
+ fontWeight: 700,
614
+ fontSize: "0.875em",
615
+ textShadow: "0 1px 2px rgba(0,0,0,0.4)",
616
+ textAlign: "center"
617
+ },
618
+ children: e.label
619
+ }
620
+ )
621
+ }
622
+ )
623
+ ]
624
+ }
625
+ );
626
+ }, yt = ({
627
+ time: e,
628
+ maxTime: n,
629
+ brandingPrimaryColor: d
630
+ }) => {
631
+ const b = H().palette.danger.softBg, a = H().palette.danger.plainColor, p = H().palette.warning.softBg, i = H().palette.warning.plainColor, s = d || H().palette.primary.plainColor, o = H().palette.primary.onPrimary, c = ne().xl, h = de().secondary, f = ue(), y = {
632
+ "@keyframes pulse": {
633
+ "0%": { transform: "scale(1)" },
634
+ "50%": { transform: "scale(1.05)" },
635
+ "100%": { transform: "scale(1)" }
636
+ }
637
+ }, S = n > 0 ? e / n * 100 : 100, I = S <= 30 ? {
638
+ background: b,
639
+ color: a,
640
+ animation: "pulse 1s infinite"
641
+ } : S <= 50 ? {
642
+ background: p,
643
+ color: i,
644
+ animation: void 0
645
+ } : {
646
+ background: s,
647
+ color: o,
648
+ animation: void 0
649
+ }, D = (T) => {
650
+ const v = Math.floor(T / 60), u = T % 60;
651
+ return `${v < 10 ? "0" : ""}${v}:${u < 10 ? "0" : ""}${u}${v > 0 ? "m" : "s"}`;
652
+ };
653
+ return /* @__PURE__ */ C(
654
+ l,
655
+ {
656
+ sx: {
657
+ py: f.xs,
658
+ pl: f.sm,
659
+ pr: f.md,
660
+ display: "flex",
661
+ gap: f["2xs"],
662
+ alignItems: "center",
663
+ bgcolor: I.background,
664
+ borderRadius: c,
665
+ maxWidth: "105px",
666
+ maxHeight: "40px",
667
+ transition: "all 0.3s ease",
668
+ animation: I.animation,
669
+ ...y,
670
+ zIndex: 10
671
+ },
672
+ children: [
673
+ /* @__PURE__ */ t(
674
+ Je,
675
+ {
676
+ sx: {
677
+ width: "24px",
678
+ height: "24px",
679
+ color: I.color,
680
+ transition: "color 0.3s ease"
681
+ }
682
+ }
683
+ ),
684
+ /* @__PURE__ */ t(
685
+ w,
686
+ {
687
+ sx: {
688
+ fontFamily: h,
689
+ fontWeight: 400,
690
+ fontSize: "1em",
691
+ lineHeight: "150%",
692
+ letterSpacing: "0.15px",
693
+ color: I.color,
694
+ transition: "color 0.3s ease"
695
+ },
696
+ children: D(e)
697
+ }
698
+ )
699
+ ]
700
+ }
701
+ );
702
+ }, St = ({
703
+ currentPair: e,
704
+ timer: n,
705
+ selected: d,
706
+ maxTime: b,
707
+ feedback: a,
708
+ onSelect: p,
709
+ stepInfo: i,
710
+ brandingPrimaryColor: s,
711
+ game: o
712
+ }) => {
713
+ var Z, q, J, te, he, xe, ie, le, ae, se;
714
+ const [c, h] = R(0), [f, y] = R(!1), [S, k] = R(0), [I, D] = R(0), [T, v] = R(!1), u = Ie(0), { t: z } = ee(), $ = fe(), m = H(), O = m.surfaceVariant, P = s || m.palette.primary.plainColor, M = ((q = (Z = o == null ? void 0 : o.branding) == null ? void 0 : Z.colors) == null ? void 0 : q.contentColor) || m.textColor, F = ne().md, x = ue(), U = Q(O || ""), r = Q(P || ""), j = $ ? ((te = (J = o == null ? void 0 : o.branding) == null ? void 0 : J.images) == null ? void 0 : te.mobileLogo) || ((xe = (he = o == null ? void 0 : o.branding) == null ? void 0 : he.images) == null ? void 0 : xe.mainLogo) || "" : ((le = (ie = o == null ? void 0 : o.branding) == null ? void 0 : ie.images) == null ? void 0 : le.mainLogo) || "", N = z("common.labels.point", { count: c });
715
+ re(() => {
716
+ if (i != null && i.currentPoints && i.currentPoints > c) {
717
+ k(i.currentPoints - c), y(!0), D((Y) => Y + 1);
718
+ const _ = setTimeout(() => y(!1), 1e3);
719
+ return h(i.currentPoints), () => clearTimeout(_);
720
+ }
721
+ }, [i == null ? void 0 : i.currentPoints, c]);
722
+ const A = (o == null ? void 0 : o.points) ?? [], L = A.length >= 2 ? A[1].correctSteps - A[0].correctSteps : ((ae = A[0]) == null ? void 0 : ae.correctSteps) || 5;
723
+ re(() => {
724
+ const _ = u.current, Y = (i == null ? void 0 : i.currentStreak) ?? 0;
725
+ if (u.current = Y, Y > _ && Y > 0 && Y % L === 0) {
726
+ v(!0);
727
+ const g = setTimeout(() => v(!1), 500);
728
+ return () => clearTimeout(g);
729
+ }
730
+ }, [i == null ? void 0 : i.currentStreak, L]);
731
+ const W = () => {
732
+ const _ = [], Y = (i == null ? void 0 : i.currentLives) ?? 3;
733
+ for (let g = 0; g < Y; g++)
734
+ _.push(
735
+ /* @__PURE__ */ t(
736
+ Me,
737
+ {
738
+ sx: { height: 20, color: P }
739
+ },
740
+ `life-${g}`
741
+ )
742
+ );
743
+ for (let g = Y; g < 3; g++)
744
+ _.push(
745
+ /* @__PURE__ */ t(
746
+ Xe,
747
+ {
748
+ sx: {
749
+ height: 20,
750
+ color: r ? `rgba(${r.replace(/[^\d,]/g, "")}, 0.35)` : `${P}59`
751
+ }
752
+ },
753
+ `empty-${g}`
754
+ )
755
+ );
756
+ return _;
757
+ }, G = () => {
758
+ const _ = (i == null ? void 0 : i.currentStreak) ?? 0, Y = T ? L : _ % L, B = Math.floor(_ / L) + 1;
759
+ return /* @__PURE__ */ C(l, { sx: { display: "flex", alignItems: "center", gap: "4px" }, children: [
760
+ Array.from({ length: L }, (E, X) => /* @__PURE__ */ t(
761
+ l,
762
+ {
763
+ sx: {
764
+ flex: 1,
765
+ height: 4,
766
+ bgcolor: X < Y ? P : r ? `rgba(${r.replace(/[^\d,]/g, "")}, 0.2)` : `${P}33`,
767
+ borderRadius: "2px",
768
+ transition: "background-color 0.3s ease"
769
+ }
770
+ },
771
+ `streak-${X}`
772
+ )),
773
+ B > 1 && /* @__PURE__ */ C(
774
+ w,
775
+ {
776
+ sx: {
777
+ color: P,
778
+ fontWeight: 700,
779
+ fontSize: "0.75em",
780
+ lineHeight: 1,
781
+ ml: x["2xs"],
782
+ flexShrink: 0
783
+ },
784
+ children: [
785
+ "×",
786
+ B
787
+ ]
788
+ }
789
+ )
790
+ ] });
791
+ }, V = () => /* @__PURE__ */ t(
792
+ l,
793
+ {
794
+ sx: {
795
+ display: "flex",
796
+ justifyContent: "center",
797
+ width: "100%",
798
+ my: x["3xs"]
799
+ },
800
+ children: /* @__PURE__ */ t(
801
+ l,
802
+ {
803
+ sx: {
804
+ borderRadius: "50%",
805
+ bgcolor: m.surface,
806
+ boxShadow: "sm",
807
+ width: "32px",
808
+ height: "32px",
809
+ minWidth: "32px",
810
+ border: "1px solid",
811
+ borderColor: P,
812
+ display: "flex",
813
+ alignItems: "center",
814
+ justifyContent: "center"
815
+ },
816
+ children: /* @__PURE__ */ t(dt, { sx: { fontSize: "1.1em", color: P } })
817
+ }
818
+ )
819
+ }
820
+ );
821
+ return e ? (
822
+ // questionArea
823
+ /* @__PURE__ */ t(l, { sx: { display: "flex", flexDirection: "column", p: x.md }, children: /* @__PURE__ */ C(
824
+ l,
825
+ {
826
+ sx: {
827
+ display: "flex",
828
+ flexDirection: "column",
829
+ gap: $ ? x.lg : x.md
830
+ },
831
+ children: [
832
+ /* @__PURE__ */ t(l, { sx: { display: "flex", justifyContent: "center" }, children: /* @__PURE__ */ t(
833
+ yt,
834
+ {
835
+ time: n,
836
+ maxTime: b,
837
+ brandingPrimaryColor: s
838
+ },
839
+ `timer-${e.pairId}`
840
+ ) }),
841
+ /* @__PURE__ */ C(
842
+ l,
843
+ {
844
+ sx: {
845
+ borderRadius: F,
846
+ overflow: "hidden",
847
+ bgcolor: U ? `rgba(${U.replace(/[^\d,]/g, "")}, 0.5)` : m.surfaceVariant,
848
+ display: "flex",
849
+ flexDirection: "column",
850
+ backdropFilter: "blur(4px)",
851
+ px: x.md,
852
+ pt: x.md,
853
+ pb: x.lg,
854
+ gap: x.md
855
+ },
856
+ children: [
857
+ /* @__PURE__ */ t(l, { sx: { width: "100%" }, children: /* @__PURE__ */ t(
858
+ Ee,
859
+ {
860
+ option: e.optionOne,
861
+ selected: d,
862
+ feedback: a,
863
+ onSelect: p,
864
+ pairId: e.pairId,
865
+ brandingPrimaryColor: s,
866
+ optionIndex: 0
867
+ }
868
+ ) }),
869
+ V(),
870
+ /* @__PURE__ */ t(l, { sx: { width: "100%" }, children: /* @__PURE__ */ t(
871
+ Ee,
872
+ {
873
+ option: e.optionTwo,
874
+ selected: d,
875
+ feedback: a,
876
+ onSelect: p,
877
+ pairId: e.pairId,
878
+ brandingPrimaryColor: s,
879
+ optionIndex: 1
880
+ }
881
+ ) })
882
+ ]
883
+ }
884
+ ),
885
+ /* @__PURE__ */ C(l, { children: [
886
+ /* @__PURE__ */ t(l, { sx: { mb: x.xs }, children: G() }),
887
+ /* @__PURE__ */ C(
888
+ Te,
889
+ {
890
+ direction: "row",
891
+ justifyContent: "space-between",
892
+ alignItems: "center",
893
+ children: [
894
+ /* @__PURE__ */ t(l, { children: W() }),
895
+ /* @__PURE__ */ C(Te, { direction: "row", spacing: 1, alignItems: "center", children: [
896
+ /* @__PURE__ */ C(w, { sx: { color: M }, children: [
897
+ N,
898
+ ":"
899
+ ] }),
900
+ /* @__PURE__ */ C(
901
+ w,
902
+ {
903
+ level: "h4",
904
+ sx: { position: "relative", color: M },
905
+ children: [
906
+ c,
907
+ f && /* @__PURE__ */ C(
908
+ w,
909
+ {
910
+ sx: pt.pointsAdded,
911
+ children: [
912
+ "+",
913
+ S
914
+ ]
915
+ },
916
+ I
917
+ )
918
+ ]
919
+ }
920
+ )
921
+ ] })
922
+ ]
923
+ }
924
+ ),
925
+ j && /* @__PURE__ */ t(
926
+ l,
927
+ {
928
+ sx: {
929
+ mt: x.xs,
930
+ display: "flex",
931
+ justifyContent: "flex-start"
932
+ },
933
+ children: /* @__PURE__ */ t(
934
+ oe,
935
+ {
936
+ brandingLogo: j,
937
+ textColor: M,
938
+ label: ((se = o == null ? void 0 : o.labels) == null ? void 0 : se.sponsor) || null
939
+ }
940
+ )
941
+ }
942
+ )
943
+ ] })
944
+ ]
945
+ }
946
+ ) })
947
+ ) : null;
948
+ }, Ct = (e, n, d, b) => {
949
+ if (n === 0)
950
+ return {
951
+ emoji: "🎮",
952
+ message: b("eitherOr.results.practice", "Keep practicing!")
953
+ };
954
+ const a = e / n * 100;
955
+ let p;
956
+ if (a === 100 ? p = {
957
+ emoji: "🏆",
958
+ message: b("eitherOr.results.perfect", "Perfect! Flawless!")
959
+ } : a >= 80 ? p = {
960
+ emoji: "🔥",
961
+ message: b("eitherOr.results.excellent", "Excellent!")
962
+ } : a >= 60 ? p = { emoji: "✨", message: b("eitherOr.results.great", "Great job!") } : a >= 40 ? p = { emoji: "💪", message: b("eitherOr.results.good", "Good try!") } : p = {
963
+ emoji: "📚",
964
+ message: b("eitherOr.results.practice", "Keep practicing!")
965
+ }, d > 0) {
966
+ const i = b("eitherOr.results.livesBonus", { count: d }) || (d === 1 ? "And with 1 life to spare!" : `And with ${d} lives to spare!`);
967
+ p = { ...p, message: `${p.message} ${i}` };
968
+ }
969
+ return p;
970
+ }, It = ({
971
+ stepInfo: e,
972
+ game: n,
973
+ sdk: d,
974
+ onPlayAgain: b,
975
+ brandingPrimaryColor: a,
976
+ additionalCTA: p
977
+ }) => {
978
+ var J, te, he, xe, ie, le, ae, se, _, Y;
979
+ const { t: i } = ee(), s = H(), o = a || s.palette.primary.plainColor, c = s.palette.primary.onPrimary, h = ((te = (J = n == null ? void 0 : n.branding) == null ? void 0 : J.colors) == null ? void 0 : te.contentColor) || s.textColor, f = s.palette.success.plainColor, y = s.palette.danger.plainColor, S = s.palette.success.softBg, k = s.palette.danger.softBg, I = ne().md, D = ne().xl, T = ue(), v = de().primary, u = fe(), z = we(), $ = Q(o || ""), m = $ ? $.replace(/[^\d,]/g, "") : null, O = u ? ((xe = (he = n == null ? void 0 : n.branding) == null ? void 0 : he.images) == null ? void 0 : xe.mobileLogo) || ((le = (ie = n == null ? void 0 : n.branding) == null ? void 0 : ie.images) == null ? void 0 : le.mainLogo) || "" : ((se = (ae = n == null ? void 0 : n.branding) == null ? void 0 : ae.images) == null ? void 0 : se.mainLogo) || "", [P, M] = R(0), [F, x] = R(null), U = (e == null ? void 0 : e.currentPoints) ?? 0, r = P > 0 && U >= P;
980
+ if (re(() => {
981
+ n && (async () => {
982
+ try {
983
+ const B = await d.miniGames.getMyEitherOrStats(n.id);
984
+ M(B.personalBest ?? 0), x(B.betterThan ?? null);
985
+ } catch {
986
+ }
987
+ })();
988
+ }, [e, n, d]), !e) return null;
989
+ const j = e.steps.filter((g) => g.played), N = j.filter((g) => g.correct === !0).length, A = j.filter(
990
+ (g) => g.correct === !1 && g.userSelection !== null
991
+ ).length, L = j.filter(
992
+ (g) => g.userSelection === null
993
+ ).length, W = j.length, G = Ct(
994
+ N,
995
+ W,
996
+ e.currentLives,
997
+ i
998
+ ), V = W > 0 ? N / W * 100 : 0, Z = W > 0 ? A / W * 100 : 0, q = W > 0 ? L / W * 100 : 0;
999
+ return /* @__PURE__ */ C(
1000
+ l,
1001
+ {
1002
+ sx: {
1003
+ p: T.md,
1004
+ display: "flex",
1005
+ flexDirection: "column",
1006
+ gap: T.md,
1007
+ animation: "eoFadeUp 0.45s ease-out both",
1008
+ "@keyframes eoFadeUp": {
1009
+ from: { opacity: 0, transform: "translateY(14px)" },
1010
+ to: { opacity: 1, transform: "translateY(0)" }
1011
+ }
1012
+ },
1013
+ children: [
1014
+ r && /* @__PURE__ */ C(
1015
+ l,
1016
+ {
1017
+ sx: {
1018
+ position: "relative",
1019
+ overflow: "hidden",
1020
+ borderRadius: I,
1021
+ background: m ? `linear-gradient(135deg, rgba(${m},0.92) 0%, rgba(${m},0.72) 100%)` : `linear-gradient(135deg, ${o}EB 0%, ${o}B8 100%)`,
1022
+ p: "20px 20px 18px",
1023
+ display: "flex",
1024
+ alignItems: "center",
1025
+ gap: "16px",
1026
+ animation: "eoPBSlideIn 0.5s cubic-bezier(0.34,1.56,0.64,1) 0.05s both",
1027
+ "@keyframes eoPBSlideIn": {
1028
+ from: { opacity: 0, transform: "scale(0.88) translateY(-8px)" },
1029
+ to: { opacity: 1, transform: "scale(1) translateY(0)" }
1030
+ },
1031
+ "&::before": {
1032
+ content: '""',
1033
+ position: "absolute",
1034
+ inset: 0,
1035
+ background: "linear-gradient(105deg, transparent 35%, rgba(255,255,255,0.18) 50%, transparent 65%)",
1036
+ backgroundSize: "200% 100%",
1037
+ animation: "eoPBShimmer 2.2s ease-in-out 0.6s infinite"
1038
+ },
1039
+ "@keyframes eoPBShimmer": {
1040
+ "0%": { backgroundPosition: "200% 0" },
1041
+ "100%": { backgroundPosition: "-200% 0" }
1042
+ }
1043
+ },
1044
+ children: [
1045
+ /* @__PURE__ */ C(
1046
+ l,
1047
+ {
1048
+ sx: {
1049
+ flexShrink: 0,
1050
+ position: "relative",
1051
+ width: 56,
1052
+ height: 56,
1053
+ display: "flex",
1054
+ alignItems: "center",
1055
+ justifyContent: "center"
1056
+ },
1057
+ children: [
1058
+ /* @__PURE__ */ t(
1059
+ l,
1060
+ {
1061
+ sx: {
1062
+ position: "absolute",
1063
+ inset: -6,
1064
+ borderRadius: "50%",
1065
+ border: "2px solid rgba(255,255,255,0.5)",
1066
+ animation: "eoPBPulse 1.6s ease-in-out 0.8s infinite",
1067
+ "@keyframes eoPBPulse": {
1068
+ "0%, 100%": { transform: "scale(1)", opacity: 0.6 },
1069
+ "50%": { transform: "scale(1.18)", opacity: 0 }
1070
+ }
1071
+ }
1072
+ }
1073
+ ),
1074
+ /* @__PURE__ */ t(
1075
+ l,
1076
+ {
1077
+ sx: {
1078
+ width: 56,
1079
+ height: 56,
1080
+ borderRadius: "50%",
1081
+ bgcolor: "rgba(255,255,255,0.22)",
1082
+ display: "flex",
1083
+ alignItems: "center",
1084
+ justifyContent: "center"
1085
+ },
1086
+ children: /* @__PURE__ */ t(Ce, { sx: { fontSize: "1.9em", color: "#fff" } })
1087
+ }
1088
+ )
1089
+ ]
1090
+ }
1091
+ ),
1092
+ /* @__PURE__ */ C(l, { sx: { flex: 1, minWidth: 0 }, children: [
1093
+ /* @__PURE__ */ C(
1094
+ l,
1095
+ {
1096
+ sx: {
1097
+ display: "inline-flex",
1098
+ alignItems: "center",
1099
+ gap: "5px",
1100
+ bgcolor: "rgba(255,255,255,0.22)",
1101
+ border: "1px solid rgba(255,255,255,0.35)",
1102
+ borderRadius: "100px",
1103
+ px: "8px",
1104
+ py: "2px",
1105
+ mb: "6px"
1106
+ },
1107
+ children: [
1108
+ /* @__PURE__ */ t(
1109
+ l,
1110
+ {
1111
+ sx: {
1112
+ width: 6,
1113
+ height: 6,
1114
+ borderRadius: "50%",
1115
+ bgcolor: "#fff",
1116
+ animation: "eoDot 1s ease-in-out infinite",
1117
+ "@keyframes eoDot": {
1118
+ "0%, 100%": { opacity: 1 },
1119
+ "50%": { opacity: 0.3 }
1120
+ }
1121
+ }
1122
+ }
1123
+ ),
1124
+ /* @__PURE__ */ t(
1125
+ w,
1126
+ {
1127
+ sx: {
1128
+ fontSize: "0.6em",
1129
+ fontWeight: 800,
1130
+ letterSpacing: "0.14em",
1131
+ textTransform: "uppercase",
1132
+ color: "#fff",
1133
+ lineHeight: 1
1134
+ },
1135
+ children: i("eitherOr.newRecord", "New Record")
1136
+ }
1137
+ )
1138
+ ]
1139
+ }
1140
+ ),
1141
+ /* @__PURE__ */ t(
1142
+ w,
1143
+ {
1144
+ sx: {
1145
+ fontSize: "1.05em",
1146
+ fontWeight: 800,
1147
+ color: "#fff",
1148
+ lineHeight: 1.25
1149
+ },
1150
+ children: i("eitherOr.personalBestImprovedTitle", "Congratulations!")
1151
+ }
1152
+ ),
1153
+ /* @__PURE__ */ t(
1154
+ w,
1155
+ {
1156
+ sx: {
1157
+ fontSize: "0.8em",
1158
+ color: "rgba(255,255,255,0.82)",
1159
+ mt: "2px"
1160
+ },
1161
+ children: i(
1162
+ "eitherOr.personalBestImprovedSubtitle",
1163
+ "You just broke your personal record!"
1164
+ )
1165
+ }
1166
+ )
1167
+ ] })
1168
+ ]
1169
+ }
1170
+ ),
1171
+ /* @__PURE__ */ C(
1172
+ l,
1173
+ {
1174
+ sx: {
1175
+ display: "flex",
1176
+ flexDirection: "column",
1177
+ alignItems: "center",
1178
+ gap: "10px",
1179
+ py: T.lg,
1180
+ borderRadius: I,
1181
+ background: m ? `linear-gradient(135deg, rgba(${m},0.13) 0%, rgba(${m},0.04) 100%)` : `linear-gradient(135deg, ${o}21 0%, ${o}0A 100%)`,
1182
+ border: "1.5px solid",
1183
+ borderColor: m ? `rgba(${m},0.2)` : `${o}33`
1184
+ },
1185
+ children: [
1186
+ /* @__PURE__ */ t(
1187
+ l,
1188
+ {
1189
+ sx: {
1190
+ width: 52,
1191
+ height: 52,
1192
+ borderRadius: "50%",
1193
+ bgcolor: m ? `rgba(${m},0.14)` : `${o}24`,
1194
+ display: "flex",
1195
+ alignItems: "center",
1196
+ justifyContent: "center"
1197
+ },
1198
+ children: /* @__PURE__ */ t(Ce, { sx: { fontSize: "1.75em", color: o } })
1199
+ }
1200
+ ),
1201
+ /* @__PURE__ */ t(
1202
+ w,
1203
+ {
1204
+ sx: {
1205
+ fontSize: "0.65em",
1206
+ fontWeight: 700,
1207
+ letterSpacing: "0.12em",
1208
+ textTransform: "uppercase",
1209
+ color: s.textColor
1210
+ },
1211
+ children: i("eitherOr.yourScore", "Your Score")
1212
+ }
1213
+ ),
1214
+ /* @__PURE__ */ t(
1215
+ w,
1216
+ {
1217
+ sx: {
1218
+ fontSize: "3.5em",
1219
+ fontWeight: 900,
1220
+ lineHeight: 1,
1221
+ color: o,
1222
+ textShadow: m ? `0 2px 24px rgba(${m},0.35)` : `0 2px 24px ${o}59`,
1223
+ animation: "eoScorePop 0.55s cubic-bezier(0.34,1.56,0.64,1) 0.1s both",
1224
+ "@keyframes eoScorePop": {
1225
+ from: { opacity: 0, transform: "scale(0.5)" },
1226
+ to: { opacity: 1, transform: "scale(1)" }
1227
+ }
1228
+ },
1229
+ children: e.currentPoints
1230
+ }
1231
+ ),
1232
+ /* @__PURE__ */ C(
1233
+ w,
1234
+ {
1235
+ sx: { fontSize: "1em", fontWeight: 600, color: s.textColor },
1236
+ children: [
1237
+ G.emoji,
1238
+ " ",
1239
+ G.message
1240
+ ]
1241
+ }
1242
+ )
1243
+ ]
1244
+ }
1245
+ ),
1246
+ /* @__PURE__ */ C(
1247
+ l,
1248
+ {
1249
+ sx: {
1250
+ height: 7,
1251
+ borderRadius: "4px",
1252
+ overflow: "hidden",
1253
+ display: "flex",
1254
+ bgcolor: s.surfaceVariant
1255
+ },
1256
+ children: [
1257
+ V > 0 && /* @__PURE__ */ t(
1258
+ l,
1259
+ {
1260
+ sx: {
1261
+ width: `${V}%`,
1262
+ bgcolor: f,
1263
+ transition: "width 0.7s ease"
1264
+ }
1265
+ }
1266
+ ),
1267
+ Z > 0 && /* @__PURE__ */ t(
1268
+ l,
1269
+ {
1270
+ sx: {
1271
+ width: `${Z}%`,
1272
+ bgcolor: y,
1273
+ transition: "width 0.7s ease 0.1s"
1274
+ }
1275
+ }
1276
+ ),
1277
+ q > 0 && /* @__PURE__ */ t(
1278
+ l,
1279
+ {
1280
+ sx: {
1281
+ width: `${q}%`,
1282
+ bgcolor: s.secondaryContainer,
1283
+ transition: "width 0.7s ease 0.2s"
1284
+ }
1285
+ }
1286
+ )
1287
+ ]
1288
+ }
1289
+ ),
1290
+ /* @__PURE__ */ t(Te, { direction: "row", spacing: 1, children: [
1291
+ {
1292
+ icon: /* @__PURE__ */ t(
1293
+ Pe,
1294
+ {
1295
+ sx: { fontSize: "1.25em", color: f }
1296
+ }
1297
+ ),
1298
+ value: N,
1299
+ label: i("eitherOr.results.correct", "Correct"),
1300
+ bg: S,
1301
+ valueSx: { color: f },
1302
+ labelSx: { color: f }
1303
+ },
1304
+ {
1305
+ icon: /* @__PURE__ */ t(ve, { sx: { fontSize: "1.25em", color: y } }),
1306
+ value: A,
1307
+ label: i("eitherOr.results.wrong", "Wrong"),
1308
+ bg: k,
1309
+ valueSx: { color: y },
1310
+ labelSx: { color: y }
1311
+ },
1312
+ {
1313
+ icon: /* @__PURE__ */ t(
1314
+ ct,
1315
+ {
1316
+ sx: { fontSize: "1.25em", color: s.textColor }
1317
+ }
1318
+ ),
1319
+ value: L,
1320
+ label: i("eitherOr.results.missed", "Missed"),
1321
+ bg: s.surfaceVariant,
1322
+ valueSx: { color: s.textColor },
1323
+ labelSx: { color: s.textColor }
1324
+ }
1325
+ ].map((g) => /* @__PURE__ */ C(
1326
+ l,
1327
+ {
1328
+ sx: {
1329
+ flex: 1,
1330
+ display: "flex",
1331
+ flexDirection: "column",
1332
+ alignItems: "center",
1333
+ gap: "4px",
1334
+ py: "14px",
1335
+ borderRadius: I,
1336
+ bgcolor: g.bg
1337
+ },
1338
+ children: [
1339
+ g.icon,
1340
+ /* @__PURE__ */ t(
1341
+ w,
1342
+ {
1343
+ sx: {
1344
+ fontSize: "1.3em",
1345
+ fontWeight: 800,
1346
+ lineHeight: 1,
1347
+ ...g.valueSx
1348
+ },
1349
+ children: g.value
1350
+ }
1351
+ ),
1352
+ /* @__PURE__ */ t(
1353
+ w,
1354
+ {
1355
+ sx: { fontSize: "0.68em", fontWeight: 600, ...g.labelSx },
1356
+ children: g.label
1357
+ }
1358
+ )
1359
+ ]
1360
+ },
1361
+ g.label
1362
+ )) }),
1363
+ P > 0 && F !== null && F > 0 && /* @__PURE__ */ C(
1364
+ l,
1365
+ {
1366
+ sx: {
1367
+ borderRadius: I,
1368
+ p: T.md,
1369
+ bgcolor: m ? `rgba(${m},0.07)` : `${o}12`,
1370
+ border: "1px solid",
1371
+ borderColor: m ? `rgba(${m},0.15)` : `${o}26`,
1372
+ display: "flex",
1373
+ alignItems: "center",
1374
+ gap: "10px"
1375
+ },
1376
+ children: [
1377
+ /* @__PURE__ */ t(
1378
+ gt,
1379
+ {
1380
+ sx: { color: o, fontSize: "1.4em", flexShrink: 0 }
1381
+ }
1382
+ ),
1383
+ /* @__PURE__ */ t(
1384
+ w,
1385
+ {
1386
+ sx: {
1387
+ fontSize: "0.8em",
1388
+ color: s.textColor,
1389
+ lineHeight: 1.5
1390
+ },
1391
+ children: i("eitherOr.betterThanLabel", {
1392
+ points: r ? U : P,
1393
+ percentile: F
1394
+ })
1395
+ }
1396
+ )
1397
+ ]
1398
+ }
1399
+ ),
1400
+ /* @__PURE__ */ C(
1401
+ l,
1402
+ {
1403
+ sx: {
1404
+ display: "flex",
1405
+ flexDirection: z ? "column" : "row",
1406
+ justifyContent: O ? "space-between" : "flex-end",
1407
+ alignItems: "center",
1408
+ gap: T.lg
1409
+ },
1410
+ children: [
1411
+ O && !z && /* @__PURE__ */ t(
1412
+ oe,
1413
+ {
1414
+ brandingLogo: O,
1415
+ textColor: h,
1416
+ label: ((_ = n == null ? void 0 : n.labels) == null ? void 0 : _.sponsor) || null
1417
+ }
1418
+ ),
1419
+ /* @__PURE__ */ t(
1420
+ pe,
1421
+ {
1422
+ variant: "soft",
1423
+ endDecorator: /* @__PURE__ */ t(We, {}),
1424
+ onClick: b,
1425
+ sx: {
1426
+ borderRadius: D,
1427
+ py: "10px",
1428
+ pr: "12px",
1429
+ pl: "16px",
1430
+ bgcolor: o,
1431
+ color: c,
1432
+ alignSelf: "center",
1433
+ transition: "all 300ms cubic-bezier(0.2, 0, 0, 1)",
1434
+ "&:hover": { bgcolor: o, transform: "scale(1.02)" },
1435
+ "&:active": { color: c, transform: "scale(0.98)" },
1436
+ "--Icon-color": c
1437
+ },
1438
+ children: /* @__PURE__ */ t(
1439
+ w,
1440
+ {
1441
+ sx: {
1442
+ fontFamily: v,
1443
+ fontWeight: 500,
1444
+ fontSize: "0.9375em",
1445
+ lineHeight: "24px",
1446
+ letterSpacing: "0.46px",
1447
+ textTransform: "uppercase",
1448
+ color: c
1449
+ },
1450
+ children: i("eitherOr.buttons.playAgain", "Play Again")
1451
+ }
1452
+ )
1453
+ }
1454
+ ),
1455
+ O && z && /* @__PURE__ */ t(
1456
+ oe,
1457
+ {
1458
+ brandingLogo: O,
1459
+ textColor: h,
1460
+ label: ((Y = n == null ? void 0 : n.labels) == null ? void 0 : Y.sponsor) || null
1461
+ }
1462
+ )
1463
+ ]
1464
+ }
1465
+ ),
1466
+ /* @__PURE__ */ t(
1467
+ Ye,
1468
+ {
1469
+ additionalCTA: p,
1470
+ buttonStyle: {
1471
+ borderRadius: D,
1472
+ width: "100%",
1473
+ py: "10px"
1474
+ },
1475
+ buttonContentStyle: { display: "flex", justifyContent: "center" },
1476
+ textStyle: {
1477
+ fontFamily: v,
1478
+ fontWeight: 500,
1479
+ fontSize: "0.9375em",
1480
+ lineHeight: "24px",
1481
+ letterSpacing: "0.46px",
1482
+ textTransform: "uppercase"
1483
+ }
1484
+ }
1485
+ )
1486
+ ]
1487
+ }
1488
+ );
1489
+ }, Se = 10, Pt = ({
1490
+ game: e,
1491
+ sdk: n,
1492
+ stepInfo: d,
1493
+ brandingPrimaryColor: b
1494
+ }) => {
1495
+ var N;
1496
+ const { t: a } = ee(), p = De(), i = H(), s = ((N = e == null ? void 0 : e.branding) == null ? void 0 : N.colors) || null, o = b || (s == null ? void 0 : s.primaryColor) || i.palette.primary.plainColor, c = (s == null ? void 0 : s.contentColor) || i.textColor, h = de().primary, f = de().secondary, y = ne(), S = ue(), k = we(), I = i.surfaceVariant, D = p.colorSchemes.light.palette.primary.onPrimary, T = i.outlineEnabledBorder, [v, u] = R(null), [z, $] = R(!0), [m, O] = R(0), [P, M] = R(null), F = (d == null ? void 0 : d.currentPoints) ?? 0;
1497
+ re(() => {
1498
+ (async () => {
1499
+ try {
1500
+ if (!e) return;
1501
+ const [L, W] = await Promise.all([
1502
+ n.miniGames.getEitherOrResults(e.id),
1503
+ n.profile.getOwn().getInfo().catch(() => null)
1504
+ ]), G = (W == null ? void 0 : W.id) ?? null;
1505
+ if (M(G), G && L.standings.some(
1506
+ (Z) => Z.userId === G
1507
+ )) {
1508
+ u(L);
1509
+ return;
1510
+ }
1511
+ if (F > 0) {
1512
+ const V = [...L.standings], Z = {
1513
+ userId: "current",
1514
+ userModel: {
1515
+ id: "current",
1516
+ name: a("common.labels.me", "Me"),
1517
+ nickname: null,
1518
+ avatar: null,
1519
+ anonymous: !0,
1520
+ gender: null,
1521
+ country: null,
1522
+ birthDate: null,
1523
+ verified: !1,
1524
+ staffMember: !1,
1525
+ disabled: !1,
1526
+ interests: [],
1527
+ followingCount: 0,
1528
+ followersCount: 0
1529
+ },
1530
+ personalBest: F.toString()
1531
+ }, q = V.findIndex(
1532
+ (J) => Number.parseInt(J.personalBest) < F
1533
+ );
1534
+ q >= 0 && q < 50 && (V.splice(q, 0, Z), L.standings = V);
1535
+ }
1536
+ u(L);
1537
+ } catch {
1538
+ } finally {
1539
+ $(!1);
1540
+ }
1541
+ })();
1542
+ }, [e, n, d]);
1543
+ const x = {
1544
+ tableContainer: {
1545
+ overflowX: "auto",
1546
+ borderRadius: y.md,
1547
+ border: `1px solid ${T}`
1548
+ },
1549
+ table: {
1550
+ backgroundColor: I,
1551
+ "--TableCell-paddingX": "0.5em",
1552
+ "--TableCell-paddingY": "0.375em",
1553
+ cursor: "default",
1554
+ "& > tbody > tr:hover": { backgroundColor: "transparent" },
1555
+ "& > thead > tr > th": {
1556
+ backgroundColor: `rgba(${Q(I)}, 0.8)`,
1557
+ color: c,
1558
+ fontFamily: h,
1559
+ fontWeight: 600,
1560
+ fontSize: "0.875em",
1561
+ textAlign: "center",
1562
+ borderBottom: `1px solid ${T}`
1563
+ }
1564
+ },
1565
+ headerCellPosition: {
1566
+ backgroundColor: `rgba(${Q(I)}, 0.8)`,
1567
+ color: c,
1568
+ fontFamily: h,
1569
+ fontWeight: 600,
1570
+ fontSize: "0.875em",
1571
+ textAlign: "center",
1572
+ padding: "0.375rem 0.5em",
1573
+ width: "10%"
1574
+ },
1575
+ headerCellName: {
1576
+ backgroundColor: `rgba(${Q(I)}, 0.8)`,
1577
+ color: c,
1578
+ fontFamily: h,
1579
+ fontWeight: 600,
1580
+ fontSize: "0.875em",
1581
+ textAlign: "left",
1582
+ padding: "0.375rem 0.5em",
1583
+ width: "80%"
1584
+ },
1585
+ headerCellPoints: {
1586
+ backgroundColor: `rgba(${Q(I)}, 0.8)`,
1587
+ color: c,
1588
+ fontFamily: h,
1589
+ fontWeight: 600,
1590
+ fontSize: "0.875em",
1591
+ textAlign: "center",
1592
+ padding: "0.375rem 0.5em",
1593
+ width: "10%"
1594
+ },
1595
+ tableCellPosition: {
1596
+ padding: "0.375rem 0.5em",
1597
+ width: "10%",
1598
+ textAlign: "center"
1599
+ },
1600
+ tableCellName: { padding: "0.375rem 0.5em", width: "80%" },
1601
+ tableCellPoints: {
1602
+ padding: "0.375rem 0.5em",
1603
+ width: "10%",
1604
+ textAlign: "center"
1605
+ },
1606
+ userRow: {
1607
+ backgroundColor: `rgba(${Q(o)}, 0.1)`
1608
+ },
1609
+ nameCell: {
1610
+ display: "flex",
1611
+ alignItems: "center",
1612
+ gap: S.sm
1613
+ },
1614
+ leaderboardAvatar: {
1615
+ width: "32px",
1616
+ height: "32px",
1617
+ fontSize: "0.875em",
1618
+ fontWeight: 600,
1619
+ backgroundColor: o,
1620
+ color: D
1621
+ },
1622
+ nameText: {
1623
+ fontFamily: h,
1624
+ fontWeight: 500,
1625
+ fontSize: "0.875em",
1626
+ color: c,
1627
+ overflow: "hidden",
1628
+ textOverflow: "ellipsis",
1629
+ whiteSpace: "nowrap"
1630
+ },
1631
+ positionText: {
1632
+ fontFamily: h,
1633
+ fontWeight: 600,
1634
+ fontSize: "0.875em",
1635
+ color: c
1636
+ },
1637
+ pointsText: {
1638
+ fontFamily: h,
1639
+ fontWeight: 600,
1640
+ fontSize: "0.875em",
1641
+ color: c
1642
+ },
1643
+ avatarIcon: { fontSize: "1em", color: D },
1644
+ noLeaderboardText: {
1645
+ fontFamily: f,
1646
+ fontSize: "1.25em",
1647
+ color: c,
1648
+ textAlign: "center",
1649
+ marginY: S.md
1650
+ }
1651
+ };
1652
+ if (z)
1653
+ return /* @__PURE__ */ t(ke, { my: 10 });
1654
+ if (!(v != null && v.standings) || v.standings.length === 0)
1655
+ return /* @__PURE__ */ t(
1656
+ l,
1657
+ {
1658
+ sx: {
1659
+ display: "flex",
1660
+ alignItems: "center",
1661
+ justifyContent: "center",
1662
+ height: "100%",
1663
+ flex: 1
1664
+ },
1665
+ children: /* @__PURE__ */ t(w, { level: "body-lg", sx: x.noLeaderboardText, children: a("common.labels.noData", "No standings available yet.") })
1666
+ }
1667
+ );
1668
+ const U = v.standings, r = Math.ceil(U.length / Se), j = U.slice(
1669
+ m * Se,
1670
+ (m + 1) * Se
1671
+ );
1672
+ return /* @__PURE__ */ C(
1673
+ l,
1674
+ {
1675
+ sx: {
1676
+ display: "flex",
1677
+ flexDirection: "column",
1678
+ gap: S.sm,
1679
+ p: S.md
1680
+ },
1681
+ children: [
1682
+ /* @__PURE__ */ t(
1683
+ w,
1684
+ {
1685
+ sx: {
1686
+ fontFamily: h,
1687
+ fontWeight: 700,
1688
+ fontSize: "1.5em",
1689
+ color: c,
1690
+ textAlign: "center"
1691
+ },
1692
+ children: a("eitherOr.leaderboard.top50Note", "Top 50")
1693
+ }
1694
+ ),
1695
+ /* @__PURE__ */ t(Qe, { sx: x.tableContainer, children: /* @__PURE__ */ C(
1696
+ et,
1697
+ {
1698
+ variant: "outlined",
1699
+ hoverRow: !1,
1700
+ borderAxis: "bothBetween",
1701
+ size: "sm",
1702
+ sx: x.table,
1703
+ children: [
1704
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ C("tr", { children: [
1705
+ /* @__PURE__ */ t("th", { style: x.headerCellPosition, children: k ? "" : a("eitherOr.leaderboard.position", "#") }),
1706
+ /* @__PURE__ */ t("th", { style: x.headerCellName, children: a("eitherOr.leaderboard.name", "Name") }),
1707
+ /* @__PURE__ */ t("th", { style: x.headerCellPoints, children: k ? "🎯" : a("eitherOr.leaderboard.points", "Pts") })
1708
+ ] }) }),
1709
+ /* @__PURE__ */ t("tbody", { children: j.map((A, L) => {
1710
+ var q, J, te;
1711
+ const W = m * Se + L, G = A.userId === "current" || P !== null && A.userId === P, V = ((q = A.userModel) == null ? void 0 : q.avatar) || void 0, Z = ((J = A.userModel) == null ? void 0 : J.nickname) || ((te = A.userModel) == null ? void 0 : te.name) || a("common.labels.anonymous", "Anonymous");
1712
+ return /* @__PURE__ */ C(
1713
+ "tr",
1714
+ {
1715
+ style: G ? x.userRow : void 0,
1716
+ children: [
1717
+ /* @__PURE__ */ t("td", { style: x.tableCellPosition, children: /* @__PURE__ */ C(w, { sx: x.positionText, children: [
1718
+ "#",
1719
+ W + 1
1720
+ ] }) }),
1721
+ /* @__PURE__ */ t("td", { style: x.tableCellName, children: /* @__PURE__ */ C(l, { sx: x.nameCell, children: [
1722
+ /* @__PURE__ */ t(nt, { src: V, sx: x.leaderboardAvatar, children: !V && /* @__PURE__ */ t(tt, { sx: x.avatarIcon }) }),
1723
+ /* @__PURE__ */ t(
1724
+ w,
1725
+ {
1726
+ sx: {
1727
+ ...x.nameText,
1728
+ fontWeight: G ? 700 : 500,
1729
+ color: G ? o : c
1730
+ },
1731
+ children: G ? a("common.labels.me", "Me") : Z
1732
+ }
1733
+ )
1734
+ ] }) }),
1735
+ /* @__PURE__ */ t("td", { style: x.tableCellPoints, children: /* @__PURE__ */ t(w, { sx: x.pointsText, children: A.personalBest }) })
1736
+ ]
1737
+ },
1738
+ `${A.userId}-${W}`
1739
+ );
1740
+ }) })
1741
+ ]
1742
+ }
1743
+ ) }),
1744
+ r > 1 && /* @__PURE__ */ C(
1745
+ l,
1746
+ {
1747
+ sx: {
1748
+ display: "flex",
1749
+ justifyContent: "center",
1750
+ alignItems: "center",
1751
+ gap: S.sm
1752
+ },
1753
+ children: [
1754
+ /* @__PURE__ */ t(
1755
+ l,
1756
+ {
1757
+ onClick: () => m > 0 && O((A) => A - 1),
1758
+ sx: {
1759
+ cursor: m > 0 ? "pointer" : "default",
1760
+ opacity: m > 0 ? 1 : 0.3,
1761
+ fontFamily: h,
1762
+ fontSize: "1.25em",
1763
+ fontWeight: 600,
1764
+ color: o,
1765
+ px: "12px",
1766
+ py: "6px",
1767
+ borderRadius: "4px",
1768
+ userSelect: "none"
1769
+ },
1770
+ children: "‹"
1771
+ }
1772
+ ),
1773
+ /* @__PURE__ */ C(
1774
+ w,
1775
+ {
1776
+ sx: {
1777
+ fontFamily: h,
1778
+ fontSize: "0.75em",
1779
+ color: c,
1780
+ opacity: 0.7
1781
+ },
1782
+ children: [
1783
+ m + 1,
1784
+ " / ",
1785
+ r
1786
+ ]
1787
+ }
1788
+ ),
1789
+ /* @__PURE__ */ t(
1790
+ l,
1791
+ {
1792
+ onClick: () => m < r - 1 && O((A) => A + 1),
1793
+ sx: {
1794
+ cursor: m < r - 1 ? "pointer" : "default",
1795
+ opacity: m < r - 1 ? 1 : 0.3,
1796
+ fontFamily: h,
1797
+ fontSize: "1.25em",
1798
+ fontWeight: 600,
1799
+ color: o,
1800
+ px: "12px",
1801
+ py: "6px",
1802
+ borderRadius: "4px",
1803
+ userSelect: "none"
1804
+ },
1805
+ children: "›"
1806
+ }
1807
+ )
1808
+ ]
1809
+ }
1810
+ )
1811
+ ]
1812
+ }
1813
+ );
1814
+ }, ce = ({
1815
+ children: e,
1816
+ brandingBorderColor: n
1817
+ }) => {
1818
+ const d = ne().md, b = n || H().secondaryContainer, a = H().surface, i = Ge().size + " solid " + b;
1819
+ return /* @__PURE__ */ t(
1820
+ l,
1821
+ {
1822
+ sx: {
1823
+ display: "flex",
1824
+ flexDirection: { xs: "column", md: "row" },
1825
+ width: "100%",
1826
+ borderRadius: d,
1827
+ boxShadow: "md",
1828
+ border: i,
1829
+ overflow: "hidden",
1830
+ background: a,
1831
+ minHeight: "320px"
1832
+ },
1833
+ children: e
1834
+ }
1835
+ );
1836
+ }, Tt = (e) => {
1837
+ var G, V;
1838
+ const {
1839
+ eitherOr: n,
1840
+ currentPair: d,
1841
+ stepInfo: b,
1842
+ gameState: a,
1843
+ timer: p,
1844
+ selected: i,
1845
+ feedback: s,
1846
+ sdk: o,
1847
+ defaultImagePlaceholderUrl: c,
1848
+ rulesDisplay: h,
1849
+ showStandings: f,
1850
+ additionalCTA: y,
1851
+ onGameStart: S,
1852
+ onSelection: k,
1853
+ onPlayAgain: I,
1854
+ imagePosition: D = "left"
1855
+ } = e, { t: T } = ee(), v = H(), u = ((G = n == null ? void 0 : n.branding) == null ? void 0 : G.colors) || null, z = (u == null ? void 0 : u.primaryColor) || v.palette.primary.plainColor, $ = v.secondaryContainer, m = v.surfaceTintDim, O = ((V = Q(m || "")) == null ? void 0 : V.replace(/[^\d,]/g, "")) ?? null, P = ne().md, M = de().primary, F = ue(), x = fe(), [U, r] = R(0), j = Fe(
1856
+ {
1857
+ images: n == null ? void 0 : n.images,
1858
+ imagePlaceholder: c || ""
1859
+ },
1860
+ Ae.STANDARD
1861
+ ), N = () => {
1862
+ switch (a) {
1863
+ case K.LOADING:
1864
+ return /* @__PURE__ */ t(ke, { my: 20 });
1865
+ case K.TUTORIAL:
1866
+ return /* @__PURE__ */ t(
1867
+ xt,
1868
+ {
1869
+ onStart: S,
1870
+ game: n,
1871
+ showSignInCTA: !1
1872
+ }
1873
+ );
1874
+ case K.PLAYING:
1875
+ return /* @__PURE__ */ t(
1876
+ St,
1877
+ {
1878
+ currentPair: d,
1879
+ timer: p,
1880
+ maxTime: (n == null ? void 0 : n.time) ?? 10,
1881
+ selected: i,
1882
+ feedback: s,
1883
+ onSelect: k,
1884
+ stepInfo: b,
1885
+ brandingPrimaryColor: (u == null ? void 0 : u.primaryColor) || null,
1886
+ game: n
1887
+ }
1888
+ );
1889
+ case K.RESULTS:
1890
+ return /* @__PURE__ */ t(
1891
+ It,
1892
+ {
1893
+ stepInfo: b,
1894
+ game: n,
1895
+ sdk: o,
1896
+ onPlayAgain: I,
1897
+ brandingPrimaryColor: (u == null ? void 0 : u.primaryColor) || null,
1898
+ additionalCTA: y
1899
+ }
1900
+ );
1901
+ default:
1902
+ return null;
1903
+ }
1904
+ }, A = a === K.RESULTS, L = {
1905
+ display: "flex",
1906
+ flexDirection: "row",
1907
+ justifyContent: "center",
1908
+ alignItems: "center",
1909
+ flex: x ? "0 0 auto" : 1,
1910
+ width: x ? "100%" : "auto",
1911
+ borderBottom: "1px solid " + $,
1912
+ opacity: "60%",
1913
+ py: F.sm,
1914
+ px: F.md,
1915
+ gap: F.xs,
1916
+ "&:not(.Mui-selected):hover": {
1917
+ bgcolor: O ? `rgba(${O},0.06)` : `${m}0F`
1918
+ },
1919
+ [`&.${rt.selected}`]: {
1920
+ bgcolor: O ? `rgba(${O},0.06)` : `${m}0F`,
1921
+ borderBottom: "3px solid " + z,
1922
+ opacity: "100%",
1923
+ mb: "-1px"
1924
+ }
1925
+ }, W = {
1926
+ flex: 1,
1927
+ display: "flex",
1928
+ flexDirection: "column",
1929
+ overflow: "auto"
1930
+ };
1931
+ return A && f ? /* @__PURE__ */ t(ce, { brandingBorderColor: (u == null ? void 0 : u.borderColor) || null, children: /* @__PURE__ */ C(
1932
+ ot,
1933
+ {
1934
+ value: U,
1935
+ onChange: (Z, q) => r(q),
1936
+ sx: {
1937
+ borderRadius: P,
1938
+ width: "100%",
1939
+ backgroundColor: "transparent"
1940
+ },
1941
+ children: [
1942
+ /* @__PURE__ */ C(
1943
+ it,
1944
+ {
1945
+ sx: {
1946
+ fontSize: "1em",
1947
+ "--Icon-fontSize": "1.25em",
1948
+ flexDirection: x ? "column" : "row"
1949
+ },
1950
+ children: [
1951
+ /* @__PURE__ */ t(Re, { sx: L, disableIndicator: !0, children: /* @__PURE__ */ C(
1952
+ l,
1953
+ {
1954
+ sx: {
1955
+ display: "flex",
1956
+ alignItems: "center",
1957
+ gap: F.xs
1958
+ },
1959
+ children: [
1960
+ /* @__PURE__ */ t(Ce, { sx: { fontSize: "1.25em" } }),
1961
+ /* @__PURE__ */ t(
1962
+ w,
1963
+ {
1964
+ sx: {
1965
+ fontFamily: M,
1966
+ fontSize: "1em",
1967
+ fontWeight: 500,
1968
+ lineHeight: "24px",
1969
+ letterSpacing: "0.4px",
1970
+ textTransform: "uppercase"
1971
+ },
1972
+ children: T("eitherOr.tabs.score", "Score")
1973
+ }
1974
+ )
1975
+ ]
1976
+ }
1977
+ ) }),
1978
+ /* @__PURE__ */ t(Re, { sx: L, disableIndicator: !0, children: /* @__PURE__ */ C(
1979
+ l,
1980
+ {
1981
+ sx: {
1982
+ display: "flex",
1983
+ alignItems: "center",
1984
+ gap: F.xs
1985
+ },
1986
+ children: [
1987
+ /* @__PURE__ */ t(ut, { sx: { fontSize: "1.25em" } }),
1988
+ /* @__PURE__ */ t(
1989
+ w,
1990
+ {
1991
+ sx: {
1992
+ fontFamily: M,
1993
+ fontSize: "1em",
1994
+ fontWeight: 500,
1995
+ lineHeight: "24px",
1996
+ letterSpacing: "0.4px",
1997
+ textTransform: "uppercase"
1998
+ },
1999
+ children: T("eitherOr.tabs.standings", "Standings")
2000
+ }
2001
+ )
2002
+ ]
2003
+ }
2004
+ ) })
2005
+ ]
2006
+ }
2007
+ ),
2008
+ U === 0 && /* @__PURE__ */ t(Be, { value: 0, sx: { p: 0, fontSize: "1em", display: "flex" }, children: /* @__PURE__ */ t(l, { sx: W, children: N() }) }),
2009
+ U === 1 && /* @__PURE__ */ t(Be, { value: 1, sx: { p: 0, fontSize: "1em", display: "flex" }, children: /* @__PURE__ */ t(l, { sx: W, children: /* @__PURE__ */ t(
2010
+ Pt,
2011
+ {
2012
+ game: n,
2013
+ sdk: o,
2014
+ stepInfo: b,
2015
+ brandingPrimaryColor: (u == null ? void 0 : u.primaryColor) || null
2016
+ }
2017
+ ) }) })
2018
+ ]
2019
+ }
2020
+ ) }) : A ? /* @__PURE__ */ t(ce, { brandingBorderColor: (u == null ? void 0 : u.borderColor) || null, children: /* @__PURE__ */ t(l, { sx: W, children: N() }) }) : /* @__PURE__ */ t(ce, { brandingBorderColor: (u == null ? void 0 : u.borderColor) || null, children: /* @__PURE__ */ t(
2021
+ Ke,
2022
+ {
2023
+ entity: n,
2024
+ headline: T("eitherOr.headline", "Either/Or"),
2025
+ finalImage: j,
2026
+ imagePosition: D,
2027
+ rulesDisplay: h,
2028
+ children: N()
2029
+ }
2030
+ ) });
2031
+ }, vt = () => {
2032
+ const { t: e } = ee();
2033
+ return /* @__PURE__ */ t(ce, { brandingBorderColor: null, children: /* @__PURE__ */ t(
2034
+ Ze,
2035
+ {
2036
+ notFoundTitle: e("eitherOr.eitherOrNotFound"),
2037
+ notFoundMessage: e("eitherOr.eitherOrNotFoundDescription")
2038
+ }
2039
+ ) });
2040
+ }, wt = (e) => ({
2041
+ // Pulse animation for buttons
2042
+ pulseAnimation: {
2043
+ "@keyframes pulse": {
2044
+ "0%": { transform: "scale(1)" },
2045
+ "50%": { transform: "scale(1.05)" },
2046
+ "100%": { transform: "scale(1)" }
2047
+ }
2048
+ },
2049
+ // Sign in button
2050
+ signInButton: {
2051
+ borderRadius: e.buttonRadius,
2052
+ py: "10px",
2053
+ px: "16px",
2054
+ bgcolor: e.primaryColor,
2055
+ color: e.onPrimaryColor,
2056
+ transition: "all 300ms cubic-bezier(0.2, 0, 0, 1)",
2057
+ transform: "scale(1)",
2058
+ alignSelf: "center",
2059
+ "&:hover": {
2060
+ bgcolor: e.primaryColor,
2061
+ transform: "scale(1.02)"
2062
+ },
2063
+ "&:active": {
2064
+ color: e.onPrimaryColor,
2065
+ transform: "scale(0.98)"
2066
+ },
2067
+ "&:disabled": {
2068
+ bgcolor: e.primaryColor,
2069
+ color: e.onPrimaryColor,
2070
+ opacity: "12%"
2071
+ },
2072
+ animation: "pulse 1s infinite",
2073
+ fontSize: "0.9375em"
2074
+ },
2075
+ // Sign in button text
2076
+ signInButtonText: {
2077
+ fontFamily: e.fontFamilyPrimary,
2078
+ fontWeight: 500,
2079
+ fontSize: "0.9375em",
2080
+ lineHeight: "24px",
2081
+ letterSpacing: "0.46px",
2082
+ textTransform: "uppercase",
2083
+ color: e.onPrimaryColor,
2084
+ gap: "8px",
2085
+ display: "flex",
2086
+ alignItems: "center"
2087
+ }
2088
+ }), At = (e) => {
2089
+ var I, D, T, v, u;
2090
+ const n = ((I = e.eitherOr.branding) == null ? void 0 : I.colors) || null, d = fe(), b = De(), a = Fe(
2091
+ {
2092
+ images: e.eitherOr.images,
2093
+ imagePlaceholder: e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : ""
2094
+ },
2095
+ Ae.STANDARD
2096
+ ), p = de().primary, i = ne().xl, s = (n == null ? void 0 : n.primaryColor) || H().palette.primary.plainColor, o = H().palette.primary.onPrimary, c = (n == null ? void 0 : n.contentColor) || H().textColor, h = d ? ((D = e.eitherOr.branding) == null ? void 0 : D.images.mobileLogo) || ((T = e.eitherOr.branding) == null ? void 0 : T.images.mainLogo) || "" : ((v = e.eitherOr.branding) == null ? void 0 : v.images.mainLogo) || "", { t: f } = ee(), y = e.imagePosition || "left", S = wt({
2097
+ fontFamilyPrimary: p,
2098
+ buttonRadius: i,
2099
+ primaryColor: s,
2100
+ onPrimaryColor: o
2101
+ }), k = () => {
2102
+ var z, $, m, O;
2103
+ return e.signInCTA ? (z = e.signInCTA) != null && z.component ? e.signInCTA.component : ($ = e.signInCTA) != null && $.onClick ? /* @__PURE__ */ t(
2104
+ pe,
2105
+ {
2106
+ variant: "soft",
2107
+ sx: {
2108
+ ...S.signInButton,
2109
+ ...S.pulseAnimation
2110
+ },
2111
+ onClick: e.signInCTA.onClick,
2112
+ children: /* @__PURE__ */ t(w, { sx: S.signInButtonText, children: e.signInCTA.defaultLabel || f("common.signIn") })
2113
+ }
2114
+ ) : (m = e.signInCTA) != null && m.url ? typeof window > "u" ? /* @__PURE__ */ t(
2115
+ l,
2116
+ {
2117
+ component: "a",
2118
+ href: e.signInCTA.url,
2119
+ target: ((O = e.signInCTA) == null ? void 0 : O.target) || "_self",
2120
+ sx: {
2121
+ ...S.signInButton,
2122
+ ...S.pulseAnimation,
2123
+ textDecoration: "none",
2124
+ display: "inline-flex",
2125
+ alignItems: "center",
2126
+ justifyContent: "center"
2127
+ },
2128
+ children: /* @__PURE__ */ t(w, { sx: S.signInButtonText, children: e.signInCTA.defaultLabel || f("common.signIn") })
2129
+ }
2130
+ ) : /* @__PURE__ */ t(
2131
+ pe,
2132
+ {
2133
+ variant: "soft",
2134
+ sx: {
2135
+ ...S.signInButton,
2136
+ ...S.pulseAnimation
2137
+ },
2138
+ onClick: () => {
2139
+ var P, M, F;
2140
+ ((P = e.signInCTA) == null ? void 0 : P.target) === "_blank" ? window.open((M = e.signInCTA) == null ? void 0 : M.url, "_blank") : window.location.href = (F = e.signInCTA) == null ? void 0 : F.url;
2141
+ },
2142
+ children: /* @__PURE__ */ t(w, { sx: S.signInButtonText, children: e.signInCTA.defaultLabel || f("common.signIn") })
2143
+ }
2144
+ ) : /* @__PURE__ */ t(
2145
+ pe,
2146
+ {
2147
+ variant: "soft",
2148
+ sx: {
2149
+ ...S.signInButton
2150
+ },
2151
+ disabled: !0,
2152
+ children: /* @__PURE__ */ t(w, { sx: S.signInButtonText, children: e.signInCTA.defaultLabel || f("common.signIn") })
2153
+ }
2154
+ ) : /* @__PURE__ */ t(
2155
+ pe,
2156
+ {
2157
+ variant: "soft",
2158
+ sx: {
2159
+ ...S.signInButton
2160
+ },
2161
+ disabled: !0,
2162
+ children: /* @__PURE__ */ t(w, { sx: S.signInButtonText, children: f("common.signIn") })
2163
+ }
2164
+ );
2165
+ };
2166
+ return /* @__PURE__ */ t(ce, { brandingBorderColor: (n == null ? void 0 : n.borderColor) || null, children: /* @__PURE__ */ t(
2167
+ lt,
2168
+ {
2169
+ entity: e.eitherOr,
2170
+ headline: f("eitherOr.headline"),
2171
+ finalImage: a,
2172
+ imagePosition: y,
2173
+ signInContent: k(),
2174
+ brandingContent: /* @__PURE__ */ t(
2175
+ oe,
2176
+ {
2177
+ brandingLogo: h,
2178
+ textColor: d && a ? (n == null ? void 0 : n.contentColor) || b.colorSchemes.dark.textColor : c,
2179
+ label: ((u = e.eitherOr.labels) == null ? void 0 : u.sponsor) || null
2180
+ }
2181
+ ),
2182
+ rulesDisplay: e.rulesDisplay
2183
+ }
2184
+ ) });
2185
+ }, kt = ({
2186
+ eitherOr: e,
2187
+ imagePosition: n,
2188
+ defaultImagePlaceholderUrl: d,
2189
+ rulesDisplay: b
2190
+ }) => {
2191
+ var c;
2192
+ const { t: a } = ee(), p = ((c = e.branding) == null ? void 0 : c.colors) || null, { brandingLogo: i } = _e(
2193
+ e.branding || null
2194
+ ), s = (h) => {
2195
+ var f;
2196
+ return /* @__PURE__ */ t(
2197
+ oe,
2198
+ {
2199
+ brandingLogo: i,
2200
+ textColor: h,
2201
+ label: ((f = e.labels) == null ? void 0 : f.sponsor) || null
2202
+ }
2203
+ );
2204
+ }, o = {
2205
+ entity: e,
2206
+ headline: a("eitherOr.headline"),
2207
+ tryAgainButtonText: "",
2208
+ isApiError: !1,
2209
+ alertVariant: "neutral",
2210
+ customAlertTitle: a("eitherOr.gameNotAvailable"),
2211
+ customAlertMessage: a("eitherOr.gameNotAvailableDescription"),
2212
+ renderPresentedBy: s
2213
+ };
2214
+ return /* @__PURE__ */ t(ce, { brandingBorderColor: (p == null ? void 0 : p.borderColor) || null, children: /* @__PURE__ */ t(
2215
+ Oe,
2216
+ {
2217
+ ...o,
2218
+ imagePosition: n || "left",
2219
+ defaultImagePlaceholderUrl: d,
2220
+ rulesDisplay: b
2221
+ }
2222
+ ) });
2223
+ }, zt = (e) => {
2224
+ var p, i, s, o, c, h, f;
2225
+ const { t: n } = ee(), d = ((p = e.eitherOr.branding) == null ? void 0 : p.colors) || null, b = fe() ? ((s = (i = e.eitherOr.branding) == null ? void 0 : i.images) == null ? void 0 : s.mobileLogo) || ((c = (o = e.eitherOr.branding) == null ? void 0 : o.images) == null ? void 0 : c.mainLogo) || "" : ((f = (h = e.eitherOr.branding) == null ? void 0 : h.images) == null ? void 0 : f.mainLogo) || "", a = {
2226
+ ...e.eitherOr,
2227
+ branding: e.eitherOr.branding ? {
2228
+ ...e.eitherOr.branding,
2229
+ colors: e.eitherOr.branding.colors ? { ...e.eitherOr.branding.colors, secondaryColor: void 0 } : null
2230
+ } : null
2231
+ };
2232
+ return /* @__PURE__ */ t(ce, { brandingBorderColor: (d == null ? void 0 : d.borderColor) || null, children: /* @__PURE__ */ t(
2233
+ Oe,
2234
+ {
2235
+ entity: a,
2236
+ headline: n("eitherOr.headline"),
2237
+ tryAgainButtonText: n("eitherOr.buttons.tryAgain"),
2238
+ defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
2239
+ imagePosition: e.imagePosition || "left",
2240
+ isApiError: e.isApiError,
2241
+ toggleTryAgain: e.toggleTryAgain,
2242
+ apiErrorMessage: e.apiErrorMessage,
2243
+ renderPresentedBy: (y) => {
2244
+ var S;
2245
+ return /* @__PURE__ */ t(
2246
+ oe,
2247
+ {
2248
+ brandingLogo: b,
2249
+ textColor: y,
2250
+ label: ((S = e.eitherOr.labels) == null ? void 0 : S.sponsor) || null
2251
+ }
2252
+ );
2253
+ },
2254
+ rulesDisplay: e.rulesDisplay
2255
+ }
2256
+ ) });
2257
+ }, $t = ({
2258
+ sdk: e,
2259
+ contentId: n,
2260
+ contentName: d,
2261
+ brandingColors: b,
2262
+ brandingUrls: a,
2263
+ campaignId: p,
2264
+ campaignName: i,
2265
+ startGame: s,
2266
+ fields: o = ["fullName", "email"],
2267
+ leadTitle: c,
2268
+ leadDescription: h,
2269
+ leadCta: f,
2270
+ leadSuccessTitle: y,
2271
+ leadSuccessDescription: S,
2272
+ syncWithProfile: k = !1,
2273
+ isAfterPosition: I = !1,
2274
+ isSubmittingParticipation: D = !1
2275
+ }) => {
2276
+ const { t: T } = ee(), v = c ?? T("leads.header.title"), u = h ?? T("leads.header.description"), z = f ?? T("leads.buttons.submit"), $ = y ?? T("leads.success.title"), m = S ?? T("leads.success.description"), O = {
2277
+ defaultLabel: T(I ? "eitherOr.buttons.finish" : "eitherOr.buttons.start"),
2278
+ onClick: s
2279
+ };
2280
+ return /* @__PURE__ */ t(
2281
+ st,
2282
+ {
2283
+ sdk: e,
2284
+ content: {
2285
+ id: n,
2286
+ type: "either-or",
2287
+ name: d
2288
+ },
2289
+ onSuccessCta: O,
2290
+ branding: {
2291
+ colors: b,
2292
+ urls: a
2293
+ },
2294
+ campaign: {
2295
+ id: p,
2296
+ name: i
2297
+ },
2298
+ fields: o,
2299
+ labels: {
2300
+ title: v,
2301
+ description: u,
2302
+ submitButtonLabel: z,
2303
+ successTitle: $,
2304
+ successDescription: m
2305
+ },
2306
+ syncWithProfile: k,
2307
+ isSubmittingParticipation: D
2308
+ }
2309
+ );
2310
+ }, Lt = (e) => {
2311
+ const { t: n } = ee();
2312
+ return /* @__PURE__ */ t(
2313
+ at,
2314
+ {
2315
+ entity: e.eitherOr,
2316
+ headline: n("eitherOr.headline"),
2317
+ sdk: e.sdk,
2318
+ leads: e.leads,
2319
+ defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
2320
+ imagePosition: e.imagePosition,
2321
+ onLeadSubmitted: e.onLeadSubmitted,
2322
+ isSubmitting: e.isSubmitting,
2323
+ MainCard: ce,
2324
+ PresentedBy: oe,
2325
+ CollectLeadWrapper: $t,
2326
+ rulesDisplay: e.rulesDisplay
2327
+ }
2328
+ );
2329
+ };
2330
+ function ye(e) {
2331
+ return e.template === Ae.STANDARD;
2332
+ }
2333
+ const Rt = (e) => {
2334
+ var ie, le, ae, se, _, Y;
2335
+ const [n, d] = R(
2336
+ K.LOADING
2337
+ ), [b, a] = R(null), [p, i] = R(null), [s, o] = R(10), [c, h] = R(null), [f, y] = R({
2338
+ isCorrect: null,
2339
+ selectedOption: null
2340
+ }), [S, k] = R(!1), [I, D] = R(!1), [T, v] = R(!1), [u, z] = R(""), [$, m] = R(!1), [O, P] = R(!1), [M, F] = R(!1), x = Ie(null), U = Ie(void 0), r = ft(e.entityId, e.sdk), {
2341
+ setIsUnauthorized: j,
2342
+ setIsApiError: N
2343
+ } = ht(e.entityId, e.sdk, S);
2344
+ re(() => {
2345
+ je(e.language || "en");
2346
+ }, [e.language]), re(() => {
2347
+ r && r.id && d(K.TUTORIAL);
2348
+ }, [r]), re(() => () => {
2349
+ x.current && clearInterval(x.current);
2350
+ }, []);
2351
+ const A = me(() => {
2352
+ x.current && (clearInterval(x.current), x.current = null);
2353
+ }, []), L = me(
2354
+ (g) => {
2355
+ A(), o(g);
2356
+ let B = g;
2357
+ x.current = setInterval(() => {
2358
+ var E;
2359
+ B -= 1, o(B), B <= 0 && (clearInterval(x.current), x.current = null, (E = U.current) == null || E.call(U));
2360
+ }, 1e3);
2361
+ },
2362
+ [A]
2363
+ ), W = (g) => {
2364
+ if (e.sdk.helpers.getSDKConfiguration().errorHandlingMode === "standard") {
2365
+ const E = g;
2366
+ E.error.code === 401 || E.error.code === 403 ? D(!0) : (v(!0), z(E.error.message));
2367
+ } else {
2368
+ const E = g;
2369
+ E.data.error.code === 401 || E.data.error.code === 403 ? D(!0) : (v(!0), z(E.data.error.message));
2370
+ }
2371
+ }, G = me(async () => {
2372
+ var g;
2373
+ if ((r == null ? void 0 : r.authRequirement) === "LEAD" && ((g = e.leads) == null ? void 0 : g.position) === "before" && !$) {
2374
+ P(!0);
2375
+ return;
2376
+ }
2377
+ try {
2378
+ const B = await e.sdk.miniGames.participateInEitherOr(
2379
+ e.entityId,
2380
+ null
2381
+ ), E = (r == null ? void 0 : r.time) ?? 10;
2382
+ o(E), i(B), a(B.steps.find((X) => !X.played) || null), d(K.PLAYING), L(E);
2383
+ } catch (B) {
2384
+ console.error("Failed to start game:", B), W(B);
2385
+ }
2386
+ }, [e.entityId, e.sdk, (ie = e.leads) == null ? void 0 : ie.position, r == null ? void 0 : r.authRequirement, r == null ? void 0 : r.time, $, L]), V = me(
2387
+ async (g, B) => {
2388
+ if (!c) {
2389
+ A(), h(B);
2390
+ try {
2391
+ const E = await e.sdk.miniGames.participateInEitherOr(
2392
+ e.entityId,
2393
+ { pair: g, answer: B }
2394
+ ), X = E.steps.find(
2395
+ (be) => be.pairId === g
2396
+ );
2397
+ y({
2398
+ isCorrect: (X == null ? void 0 : X.correct) ?? !1,
2399
+ selectedOption: B
2400
+ }), i(E), setTimeout(() => {
2401
+ var $e;
2402
+ const be = (($e = e.leads) == null ? void 0 : $e.position) === "after" && (r == null ? void 0 : r.authRequirement) === "LEAD" && !$;
2403
+ if (E.currentLives === 0) {
2404
+ be ? P(!0) : d(K.RESULTS);
2405
+ return;
2406
+ }
2407
+ const ze = E.steps.find((Ue) => !Ue.played);
2408
+ ze ? (a(ze), h(null), y({ isCorrect: null, selectedOption: null }), L((r == null ? void 0 : r.time) ?? 10)) : be ? P(!0) : d(K.RESULTS);
2409
+ }, 1e3);
2410
+ } catch (E) {
2411
+ console.error("Failed to submit answer:", E), h(null), W(E);
2412
+ }
2413
+ }
2414
+ },
2415
+ [
2416
+ e.entityId,
2417
+ e.sdk,
2418
+ c,
2419
+ A,
2420
+ L,
2421
+ r == null ? void 0 : r.time,
2422
+ (le = e.leads) == null ? void 0 : le.position,
2423
+ r == null ? void 0 : r.authRequirement,
2424
+ $
2425
+ ]
2426
+ ), Z = me(async () => {
2427
+ try {
2428
+ const g = await e.sdk.miniGames.participateInEitherOr(
2429
+ e.entityId,
2430
+ null
2431
+ );
2432
+ y({ isCorrect: !1, selectedOption: null }), i(g), setTimeout(() => {
2433
+ var X;
2434
+ const B = ((X = e.leads) == null ? void 0 : X.position) === "after" && (r == null ? void 0 : r.authRequirement) === "LEAD" && !$;
2435
+ if (g.currentLives === 0) {
2436
+ B ? P(!0) : d(K.RESULTS);
2437
+ return;
2438
+ }
2439
+ const E = g.steps.find((be) => !be.played);
2440
+ E ? (a(E), h(null), y({ isCorrect: null, selectedOption: null }), L((r == null ? void 0 : r.time) ?? 10)) : B ? P(!0) : d(K.RESULTS);
2441
+ }, 1e3);
2442
+ } catch (g) {
2443
+ console.error("Timer elapsed - failed to submit:", g), W(g);
2444
+ }
2445
+ }, [e.entityId, e.sdk, L, r == null ? void 0 : r.time, (ae = e.leads) == null ? void 0 : ae.position, r == null ? void 0 : r.authRequirement, $]);
2446
+ U.current = Z;
2447
+ const q = me(async () => {
2448
+ var g;
2449
+ if (m(!0), ((g = e.leads) == null ? void 0 : g.position) === "before") {
2450
+ F(!0);
2451
+ try {
2452
+ const B = await e.sdk.miniGames.participateInEitherOr(
2453
+ e.entityId,
2454
+ null
2455
+ ), E = (r == null ? void 0 : r.time) ?? 10;
2456
+ o(E), i(B), a(B.steps.find((X) => !X.played) || null), P(!1), F(!1), d(K.PLAYING), L(E);
2457
+ } catch (B) {
2458
+ F(!1), P(!1), W(B);
2459
+ }
2460
+ } else
2461
+ P(!1), F(!1), d(K.RESULTS);
2462
+ }, [(se = e.leads) == null ? void 0 : se.position, e.entityId, e.sdk, r == null ? void 0 : r.time, L]), J = me(() => {
2463
+ A(), d(K.TUTORIAL), a(null), i(null), o((r == null ? void 0 : r.time) ?? 10), h(null), y({ isCorrect: null, selectedOption: null }), m(!1), P(!1);
2464
+ }, [A, r == null ? void 0 : r.time]), te = () => {
2465
+ v(!1), D(!1), z(""), N(!1), j(!1), k(!S);
2466
+ };
2467
+ return r ? r.id ? r.status !== "ACTIVE" ? /* @__PURE__ */ t(
2468
+ kt,
2469
+ {
2470
+ eitherOr: r,
2471
+ template: e.template,
2472
+ imagePosition: ye(e) ? e.imagePosition : void 0,
2473
+ defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
2474
+ rulesDisplay: e.rulesDisplay
2475
+ }
2476
+ ) : r.authRequirement === "REGISTERED" && !e.userIsLoggedIn ? ye(e) ? /* @__PURE__ */ t(
2477
+ At,
2478
+ {
2479
+ eitherOr: r,
2480
+ imagePosition: e.imagePosition,
2481
+ defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
2482
+ signInCTA: e.signInCTA,
2483
+ rulesDisplay: e.rulesDisplay
2484
+ }
2485
+ ) : /* @__PURE__ */ t(Le, {}) : I || T ? /* @__PURE__ */ t(
2486
+ zt,
2487
+ {
2488
+ eitherOr: r,
2489
+ imagePosition: ye(e) ? e.imagePosition : void 0,
2490
+ defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
2491
+ isApiError: T,
2492
+ apiErrorMessage: u,
2493
+ toggleTryAgain: te,
2494
+ rulesDisplay: e.rulesDisplay
2495
+ }
2496
+ ) : O && r.authRequirement === "LEAD" && (((_ = e.leads) == null ? void 0 : _.position) === "after" || ((Y = e.leads) == null ? void 0 : Y.position) === "before") && ye(e) ? /* @__PURE__ */ t(
2497
+ Lt,
2498
+ {
2499
+ eitherOr: r,
2500
+ sdk: e.sdk,
2501
+ leads: e.leads,
2502
+ defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
2503
+ onLeadSubmitted: q,
2504
+ imagePosition: e.imagePosition,
2505
+ isSubmitting: M,
2506
+ rulesDisplay: e.rulesDisplay
2507
+ }
2508
+ ) : ye(e) ? /* @__PURE__ */ t(
2509
+ Tt,
2510
+ {
2511
+ eitherOr: r,
2512
+ currentPair: b,
2513
+ stepInfo: p,
2514
+ gameState: n,
2515
+ timer: s,
2516
+ selected: c,
2517
+ feedback: f,
2518
+ sdk: e.sdk,
2519
+ leads: e.leads,
2520
+ defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
2521
+ rulesDisplay: e.rulesDisplay,
2522
+ showStandings: e.showStandings,
2523
+ additionalCTA: e.additionalCTA,
2524
+ imagePosition: e.imagePosition,
2525
+ onGameStart: G,
2526
+ onSelection: V,
2527
+ onPlayAgain: J
2528
+ }
2529
+ ) : /* @__PURE__ */ t(Le, {}) : /* @__PURE__ */ t(vt, {}) : /* @__PURE__ */ t(ke, { my: 20 });
2530
+ }, Bt = (e) => /* @__PURE__ */ t(Ne, { packageName: "either-or-play", ...e, children: /* @__PURE__ */ t(Rt, { ...e }) }), Qt = Bt;
2531
+ export {
2532
+ Qt as EitherOrPlay
2533
+ };