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/PickThePair.js CHANGED
@@ -1,870 +1,488 @@
1
- import { jsx as t, jsxs as p, Fragment as Q } from "react/jsx-runtime";
2
- import { isMobile as Z, isLarge as We, useCornerRadius as ee, useColors as X, useBorderSize as me, NotFoundSkeleton as De, PickThePairTemplate as le, useFontFamily as ae, isTablet as Ue, getBrandingClickUrl as ze, useInternalTheme as ge, useSpacingScale as te, isExtraSmall as ke, useImageVariant as fe, WidgetTemplate as ue, hexToRgb as se, StandardSkeleton as Le, InfoPageCollectLeadWrapper as he, useCurrentThemeMode as Be, extractBrandingProperties as Ae, defaultBgVertical as $e, defaultBg as _e, OverlaySkeleton as He, useInfoPage as Ee, initializeI18n as we, Spinner as Oe, languageToCountryCode as Me, getLanguageDirection as je, applyDirectionToMount as Ne, widgetCacheKey as Ve, createWidgetCache as Ye, ContainerProvider as qe, ThemeProvider as Xe, ConstantsProvider as Ge } from "fansunited-frontend-core";
3
- import G, { useMemo as xe, useCallback as Ke, useEffect as de, useState as K } from "react";
4
- import { useTranslation as re } from "react-i18next";
5
- import { Box as x, Typography as w, Button as pe } from "@mui/joy";
6
- import { T as Qe } from "./chunks/TimerOutlined-D-WA_vpE.js";
7
- import { CacheProvider as Je } from "@emotion/react";
8
- import { createPortal as Ze } from "react-dom";
9
- import { w as et } from "./chunks/withVersionStamp-BsLyhvNA.js";
10
- const Re = ({
11
- children: e,
12
- brandingBorderColor: n,
13
- state: a
14
- }) => {
15
- const c = Z(), l = We(), s = a === "play" ? l : c, r = ee().md, d = n || X().secondaryContainer, i = me().size + " solid " + d;
16
- return /* @__PURE__ */ t(
17
- x,
1
+ import { jsx as n, jsxs as L, Fragment as ae } from "@emotion/react/jsx-runtime";
2
+ import { useIsMobile as ee, useIsLarge as pt, useColors as te, PickThePairTemplate as oe, useInternalTheme as et, useCurrentThemeMode as yt, useIsExtraSmall as tt, useImageVariant as Se, WidgetTemplate as Te, hexToRgb as it, useBrandingProperties as Pt, defaultBgVertical as St, defaultBg as Tt, useInfoPage as vt, initializeI18n as Mt, languageToCountryCode as kt } from "fansunited-frontend-core";
3
+ import { space as J, BODY_FONT as wt, NotFound as Ct, PresentedBy as Lt, ctaButton as Ut, ctaLabel as It, StandardSkeleton as Dt, InfoPageCollectLeadWrapper as ve, baseButton as Wt, OverlaySkeleton as Rt, Spinner as Ft, WidgetPortal as Bt } from "fansunited-frontend-core/ui/emotion";
4
+ import nt, { useMemo as at, useCallback as $t, useEffect as Pe, useState as V } from "react";
5
+ import { useTranslation as ce } from "react-i18next";
6
+ import { keyframes as he, css as i } from "@emotion/react";
7
+ import { TimerOutlinedIcon as At } from "fansunited-frontend-core/ui/icons";
8
+ import { w as zt } from "./chunks/withVersionStamp-CPDfSE5H.js";
9
+ const t = {
10
+ fontPrimary: "var(--fu-ucrc-font-primary)",
11
+ fontSecondary: "var(--fu-ucrc-font-secondary)",
12
+ space2xs: J("2xs"),
13
+ spaceXs: J("xs"),
14
+ spaceSm: J("sm"),
15
+ spaceMd: J("md"),
16
+ spaceLg: J("lg"),
17
+ spaceXl: J("xl"),
18
+ space2xl: J("2xl"),
19
+ space3xl: J("3xl"),
20
+ radiusMd: "var(--fu-ucrc-radius-md)",
21
+ radiusXl: "var(--fu-ucrc-radius-xl)",
22
+ borderSize: "var(--fu-ucrc-border-size)",
23
+ surface: "var(--fu-ucrc-surface)",
24
+ success: "var(--fu-ucrc-success-plain-color)",
25
+ danger: "var(--fu-ucrc-danger-plain-color)",
26
+ onPrimary: "var(--fu-ucrc-primary-on-primary)",
27
+ /** Branding content colour, else the theme's text colour. */
28
+ text: "var(--fu-ucrc-ptp-text)",
29
+ /** Branding primary colour, else the theme's. */
30
+ primary: "var(--fu-ucrc-ptp-primary)",
31
+ /** The background colour at 50%, behind the game. */
32
+ panel: "var(--fu-ucrc-ptp-panel)",
33
+ /** The primary colour at 50%, behind "Time's up". */
34
+ timeUp: "var(--fu-ucrc-ptp-time-up)"
35
+ }, E = { margin: 0, display: "block" }, re = wt, le = "-0.025em", ot = he({ from: { opacity: 0 }, to: { opacity: 1 } }), lt = he({
36
+ from: { transform: "translateY(20px)", opacity: 0 },
37
+ to: { transform: "translateY(0)", opacity: 1 }
38
+ }), ct = (e, o) => {
39
+ if (e.startsWith("#")) {
40
+ const a = (l) => parseInt(e.slice(l, l + 2), 16);
41
+ return `rgba(${a(1)}, ${a(3)}, ${a(5)}, ${o})`;
42
+ }
43
+ return e.startsWith("rgb") ? e.replace(")", `, ${o.toFixed(2)})`).replace("rgb", "rgba") : `rgba(0, 0, 0, ${o.toFixed(2)})`;
44
+ }, $e = i({
45
+ display: "flex",
46
+ width: "100%",
47
+ borderRadius: t.radiusMd,
48
+ border: `${t.borderSize} solid var(--fu-ucrc-ptp-card-border)`,
49
+ overflow: "hidden",
50
+ background: t.surface,
51
+ minHeight: "250px"
52
+ }), Ae = {
53
+ row: i($e, { flexDirection: "row" }),
54
+ column: i($e, { flexDirection: "column" })
55
+ }, rt = ({ children: e, brandingBorderColor: o, state: a, style: l }) => {
56
+ const u = ee(), c = pt(), m = a === "play" ? c : u, g = te(), r = o || g.secondaryContainer;
57
+ return /* @__PURE__ */ n(
58
+ "div",
18
59
  {
19
- sx: {
20
- display: "flex",
21
- flexDirection: s ? "column" : "row",
22
- width: "100%",
23
- borderRadius: r,
24
- boxShadow: "md",
25
- border: i,
26
- overflow: "hidden",
27
- background: X().surface,
28
- minHeight: "250px"
29
- },
60
+ css: m ? Ae.column : Ae.row,
61
+ style: { "--fu-ucrc-ptp-card-border": r, ...l },
30
62
  children: e
31
63
  }
32
64
  );
33
- }, tt = ({ template: e }) => {
34
- const { t: n } = re(), a = /* @__PURE__ */ t(
35
- De,
65
+ }, _t = ({ template: e }) => {
66
+ const { t: o } = ce(), a = /* @__PURE__ */ n(
67
+ Ct,
36
68
  {
37
- notFoundTitle: n("pickThePair.pickThePairNotFound"),
38
- notFoundMessage: n("pickThePair.pickThePairNotFoundDescription")
69
+ title: o("pickThePair.pickThePairNotFound"),
70
+ message: o("pickThePair.pickThePairNotFoundDescription")
39
71
  }
40
72
  );
41
- return e === le.LANDING_PAGE ? a : /* @__PURE__ */ t(Re, { brandingBorderColor: null, children: a });
42
- }, Fe = (e) => {
43
- const n = ae().secondary, a = Ue(), c = e.isSplitVariant && a, l = Z(), s = ze(e.primaryUrl, e.secondaryUrl, "logo");
44
- if (!e.brandingLogo)
45
- return null;
46
- const r = () => {
47
- s && window.open(s, "_blank", "noopener,noreferrer");
48
- }, d = /* @__PURE__ */ t(
49
- "img",
50
- {
51
- src: e.brandingLogo,
52
- alt: "branding-logo",
53
- style: {
54
- maxHeight: "50px",
55
- maxWidth: "100px"
56
- }
57
- }
58
- ), o = s ? typeof window > "u" ? /* @__PURE__ */ t(
59
- x,
60
- {
61
- component: "a",
62
- href: s,
63
- target: "_blank",
64
- rel: "noopener noreferrer",
65
- sx: {
66
- cursor: "pointer",
67
- textDecoration: "none",
68
- display: "inline-flex"
69
- },
70
- children: d
71
- }
72
- ) : /* @__PURE__ */ t(
73
- x,
74
- {
75
- onClick: r,
76
- sx: {
77
- cursor: "pointer",
78
- display: "inline-flex"
79
- },
80
- children: d
81
- }
82
- ) : d;
83
- return e.isCentered || c || l ? /* @__PURE__ */ p(
84
- x,
85
- {
86
- sx: {
87
- display: "flex",
88
- flexDirection: "column",
89
- gap: "8px",
90
- alignItems: "center",
91
- minWidth: "180px",
92
- fontSize: "1em",
93
- zIndex: 1
94
- },
95
- children: [
96
- e.label && /* @__PURE__ */ t(
97
- w,
98
- {
99
- level: "body-sm",
100
- sx: {
101
- fontWeight: 400,
102
- lineHeight: "166%",
103
- letterSpacing: "0.4px",
104
- fontSize: "1em",
105
- color: e.textColor,
106
- textAlign: "right",
107
- fontFamily: n
108
- },
109
- children: e.label
110
- }
111
- ),
112
- o
113
- ]
114
- }
115
- ) : /* @__PURE__ */ p(
116
- x,
117
- {
118
- sx: {
119
- minWidth: "180px",
120
- display: "flex",
121
- gap: "8px",
122
- alignItems: "center",
123
- zIndex: 10,
124
- fontSize: "1em"
125
- },
126
- children: [
127
- e.label && /* @__PURE__ */ t(
128
- w,
129
- {
130
- level: "body-sm",
131
- sx: {
132
- fontWeight: 400,
133
- lineHeight: "166%",
134
- letterSpacing: "0.4px",
135
- textAlign: "right",
136
- fontSize: "1em",
137
- color: e.textColor,
138
- fontFamily: n
139
- },
140
- children: e.label
141
- }
142
- ),
143
- o
144
- ]
145
- }
146
- );
147
- }, nt = (e) => {
148
- const {
149
- spacingScale: n,
150
- fontFamilyPrimary: a,
151
- textColor: c,
152
- bgcolor: l,
153
- mdBorderRadius: s,
154
- isExtraSmall: r
155
- } = e;
156
- return {
157
- leadCollectionContainer: {
158
- display: "flex",
159
- flexDirection: "column",
160
- p: n.md
161
- },
162
- leadQuestionContainer: {
163
- display: "flex",
164
- flexDirection: "column",
165
- gap: n.md
166
- },
167
- leadContentContainer: {
168
- borderRadius: s,
169
- px: n.md,
170
- pt: n.md,
171
- pb: n.lg,
172
- gap: n.md,
173
- bgcolor: `rgba(${l ? l.replace(/[^\d,]/g, "") : ""}, 0.5)`,
174
- display: "flex",
175
- flexDirection: "column",
176
- backdropFilter: "blur(4px)"
177
- },
178
- questionArea: {
179
- display: "flex",
180
- flexDirection: "column",
181
- px: n.md
182
- },
183
- questionContainer: {
184
- display: "flex",
185
- flexDirection: "column",
186
- gap: n.md
187
- },
188
- questionContentContainer: {
189
- borderRadius: s,
190
- px: n.md,
191
- pt: n.md,
192
- pb: n.lg,
193
- bgcolor: `rgba(${l ? l.replace(/[^\d,]/g, "") : ""}, 0.5)`,
194
- display: "flex",
195
- flexDirection: "column",
196
- backdropFilter: "blur(4px)"
197
- },
198
- questionText: {
199
- fontFamily: a,
200
- color: c,
201
- textAlign: "center",
202
- fontSize: r ? "16px" : "18px",
203
- fontWeight: 500
204
- },
205
- instructions: {
206
- fontFamily: a,
207
- color: c,
208
- lineHeight: "150%",
209
- letterSpacing: "0.15px",
210
- fontWeight: 500,
211
- fontSize: "1.25em",
212
- textAlign: "center"
213
- },
214
- footerContainer: {
215
- display: "flex",
216
- flexDirection: r ? "column" : "row",
217
- justifyContent: "space-between",
218
- alignItems: r ? "stretch" : "center",
219
- gap: n.md,
220
- px: n.md
221
- // mb: spacingScale.md,
222
- },
223
- footerContainerNoLogo: {
224
- display: "flex",
225
- justifyContent: r ? "center" : "flex-end",
226
- gap: n.md,
227
- px: n.md
228
- // mb: spacingScale.md,
229
- },
230
- getTimeUpOverlayStyle: (d, o) => {
231
- const i = (g, f) => {
232
- const u = parseInt(g.slice(1, 3), 16), y = parseInt(g.slice(3, 5), 16), S = parseInt(g.slice(5, 7), 16);
233
- return `rgba(${u}, ${y}, ${S}, ${f})`;
234
- }, b = d.startsWith("#") ? i(d, 0.5) : d.startsWith("rgb") ? d.replace(")", ", 0.50)").replace("rgb", "rgba") : "rgba(0, 0, 0, 0.50)";
235
- return {
236
- position: o ? "relative" : "absolute",
237
- top: o ? "auto" : 0,
238
- left: o ? "auto" : 0,
239
- right: o ? "auto" : 0,
240
- bottom: o ? "auto" : 0,
241
- minHeight: o ? "300px" : "auto",
242
- // Match questionContentContainer width and margins on mobile
243
- maxWidth: o ? "1200px" : "auto",
244
- margin: o ? `0 ${n.md}` : "auto",
245
- width: "auto",
246
- backgroundColor: b,
247
- backdropFilter: "blur(4px)",
248
- display: "flex",
249
- flexDirection: "column",
250
- alignItems: "center",
251
- justifyContent: "center",
252
- zIndex: 100,
253
- borderRadius: s,
254
- animation: "fadeIn 0.4s ease-out",
255
- "@keyframes fadeIn": {
256
- from: {
257
- opacity: 0
258
- },
259
- to: {
260
- opacity: 1
261
- }
262
- }
263
- };
264
- },
265
- timeUpText: {
266
- color: "#FFFFFF",
267
- fontWeight: 700,
268
- fontSize: r ? "32px" : "48px",
269
- lineHeight: 1.2,
270
- textAlign: "center",
271
- textShadow: "0 2px 20px rgba(0, 0, 0, 0.3)",
272
- animation: "slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1)",
273
- padding: r ? 2 : 3,
274
- maxWidth: r ? "280px" : "500px",
275
- "@keyframes slideUp": {
276
- from: {
277
- transform: "translateY(20px)",
278
- opacity: 0
279
- },
280
- to: {
281
- transform: "translateY(0)",
282
- opacity: 1
283
- }
284
- }
285
- },
286
- welcome: {
287
- fontFamily: a,
288
- color: c,
289
- fontSize: r ? "0.875em" : "1em",
290
- fontWeight: 400,
291
- lineHeight: 1.5,
292
- maxWidth: "800px",
293
- margin: "0 auto",
294
- opacity: 0.9
295
- }
296
- };
297
- }, it = (e) => {
298
- const {
299
- primaryColor: n,
300
- textColor: a,
301
- whiteTextColor: c,
302
- successColor: l,
303
- dangerColor: s,
304
- optionBackground: r,
305
- spacingScale: d,
306
- xlBorderRadius: o,
307
- borderSize: i
308
- } = e;
309
- return {
310
- container: {
311
- display: "flex",
312
- flexDirection: "row",
313
- gap: d["2xl"],
314
- width: "100%",
73
+ return e === oe.LANDING_PAGE ? a : /* @__PURE__ */ n(rt, { brandingBorderColor: null, children: a });
74
+ }, st = (e) => /* @__PURE__ */ n(Lt, { inheritColor: !0, ...e }), Z = { display: "flex", flexDirection: "column" }, ze = {
75
+ ...Z,
76
+ borderRadius: t.radiusMd,
77
+ paddingInline: t.spaceMd,
78
+ paddingTop: t.spaceMd,
79
+ paddingBottom: t.spaceLg,
80
+ backgroundColor: t.panel,
81
+ backdropFilter: "blur(4px)"
82
+ }, se = {
83
+ ...E,
84
+ fontFamily: t.fontPrimary,
85
+ color: t.text,
86
+ fontWeight: 400,
87
+ lineHeight: 1.5,
88
+ maxWidth: "800px",
89
+ margin: "0 auto",
90
+ opacity: 0.9,
91
+ unicodeBidi: "plaintext"
92
+ }, _e = {
93
+ backgroundColor: t.timeUp,
94
+ backdropFilter: "blur(4px)",
95
+ ...Z,
96
+ alignItems: "center",
97
+ justifyContent: "center",
98
+ zIndex: 100,
99
+ borderRadius: t.radiusMd,
100
+ animation: `${ot} 0.4s ease-out`
101
+ }, Oe = {
102
+ ...E,
103
+ fontFamily: re,
104
+ letterSpacing: le,
105
+ color: "#FFFFFF",
106
+ fontWeight: 700,
107
+ lineHeight: 1.2,
108
+ textAlign: "center",
109
+ textShadow: "0 2px 20px rgba(0, 0, 0, 0.3)",
110
+ unicodeBidi: "plaintext",
111
+ animation: `${lt} 0.5s cubic-bezier(0.34, 1.56, 0.64, 1)`
112
+ }, de = { display: "flex", gap: t.spaceMd, paddingInline: t.spaceMd }, S = {
113
+ welcome: i(se, { fontSize: "1em" }),
114
+ welcomeXs: i(se, { fontSize: "0.875em" }),
115
+ // Above the stopwatch.
116
+ welcomeTimed: i(se, { fontSize: "1em", marginBottom: t.spaceMd }),
117
+ welcomeTimedXs: i(se, { fontSize: "0.875em", marginBottom: t.spaceMd }),
118
+ stopwatch: i({ display: "flex", justifyContent: "center", marginBottom: t.spaceMd }),
119
+ // Fits ChallengeStats to the card.
120
+ challengeStats: i({
121
+ paddingInline: t.spaceMd,
122
+ "& > div": {
315
123
  maxWidth: "100%",
316
- boxSizing: "border-box",
317
- overflow: "hidden",
318
- pt: d.md
319
- },
320
- column: {
321
- display: "flex",
322
- flexDirection: "column",
323
- gap: d.sm,
324
- flex: 1,
325
- minWidth: 0,
326
- maxWidth: "100%"
327
- },
328
- getColumnItemStyle: (b, g, f) => ({
329
- display: "flex",
330
- alignItems: "center",
331
- gap: d["2xs"],
332
- justifyContent: "space-between",
333
- padding: `${d.xs} ${d.sm}`,
334
- backgroundColor: f ? s : g ? l : b ? n : r,
335
- borderRadius: o,
336
- cursor: "pointer",
337
- transition: "all 0.3s ease",
338
- position: "relative",
339
- minHeight: "56px",
340
- width: "100%",
341
- maxWidth: "100%",
342
- boxSizing: "border-box",
343
- overflow: "visible",
344
- border: `${i} solid ${b && !g && !f ? n : "transparent"}`,
345
- WebkitTapHighlightColor: "transparent",
346
- "&:hover": b || g || f ? {} : {
347
- border: `${i} solid ${n}`,
348
- backgroundColor: r,
349
- transform: "translateY(-2px)"
350
- }
351
- }),
352
- disabledItem: {
353
- opacity: 0.5,
354
- cursor: "not-allowed",
355
- "&:hover": {
356
- transform: "none"
357
- }
358
- },
359
- errorItem: {
360
- animation: "shake 0.3s",
361
- cursor: "not-allowed",
362
- pointerEvents: "none",
363
- "@keyframes shake": {
364
- "0%, 100%": { transform: "translateX(0)" },
365
- "25%": { transform: "translateX(-5px)" },
366
- "75%": { transform: "translateX(5px)" }
367
- }
368
- },
369
- getImageContainerStyle: (b, g, f) => ({
370
- width: "56px",
371
- height: "56px",
372
- borderRadius: "50%",
373
- overflow: "hidden",
374
- backgroundColor: "#FFFFFF",
375
- flexShrink: 0,
376
- position: "absolute",
377
- top: "50%",
378
- transform: "translateY(-50%)",
379
- zIndex: 10,
380
- ...f === "left" ? { right: "-14px" } : { left: "-14px" },
381
- border: g ? `${i} solid ${s}` : b ? `${i} solid ${l}` : `${i} solid ${n}`
382
- }),
383
- textContainer: {
384
- display: "flex",
385
- flexDirection: "column",
386
- gap: d["2xs"],
387
- flex: 1,
388
- minWidth: 0,
389
- justifyContent: "center"
390
- },
391
- getOptionTitleStyle: (b, g, f, u) => ({
392
- color: g || f || u ? c : a,
393
- fontWeight: 600,
394
- fontSize: "0.9375em",
395
- lineHeight: 1.3,
396
- wordBreak: "break-word",
397
- overflowWrap: "break-word",
398
- textWrap: "balance",
399
- textAlign: b === "right" ? "right" : "left"
400
- }),
401
- getOptionSubtitleStyle: (b, g, f, u) => ({
402
- color: g || f || u ? c : a,
403
- opacity: 0.7,
404
- fontSize: "0.8125em",
405
- lineHeight: 1.3,
406
- wordBreak: "break-word",
407
- overflowWrap: "break-word",
408
- textWrap: "balance",
409
- textAlign: b === "right" ? "right" : "left"
410
- }),
411
- matchIndicator: {
412
- position: "absolute",
413
- right: d.sm,
414
- top: "50%",
415
- transform: "translateY(-50%)"
124
+ margin: 0,
125
+ paddingInline: t.spaceMd,
126
+ paddingBlock: t.spaceMd,
127
+ boxSizing: "border-box"
416
128
  }
417
- };
129
+ }),
130
+ leadCollectionContainer: i(Z, { padding: t.spaceMd }),
131
+ leadQuestionContainer: i(Z, { gap: t.spaceMd }),
132
+ leadContentContainer: i(ze, { gap: t.spaceMd }),
133
+ questionArea: i(Z, { paddingInline: t.spaceMd }),
134
+ questionContainer: i(Z, { gap: t.spaceMd }),
135
+ questionContentContainer: i(ze, { position: "relative" }),
136
+ instructions: i(E, {
137
+ fontFamily: t.fontPrimary,
138
+ color: t.text,
139
+ lineHeight: "150%",
140
+ letterSpacing: "0.15px",
141
+ fontWeight: 500,
142
+ fontSize: "1.25em",
143
+ textAlign: "center",
144
+ unicodeBidi: "plaintext"
145
+ }),
146
+ footer: i(de, { flexDirection: "row", justifyContent: "space-between", alignItems: "center" }),
147
+ footerXs: i(de, { flexDirection: "column", justifyContent: "space-between", alignItems: "stretch" }),
148
+ footerNoLogo: i(de, { justifyContent: "flex-end" }),
149
+ footerNoLogoXs: i(de, { justifyContent: "center" }),
150
+ // Over the game on desktop; in its place on mobile.
151
+ timeUpOverlay: i(_e, { position: "absolute", top: 0, left: 0, right: 0, bottom: 0, margin: "auto" }),
152
+ timeUpOverlayMobile: i(_e, {
153
+ position: "relative",
154
+ minHeight: "300px",
155
+ maxWidth: "1200px",
156
+ margin: `0 ${t.spaceMd}`
157
+ }),
158
+ timeUpText: i(Oe, { fontSize: "48px", padding: "24px", maxWidth: "500px" }),
159
+ timeUpTextXs: i(Oe, { fontSize: "32px", padding: "16px", maxWidth: "280px" })
418
160
  };
419
- function ce(e) {
420
- const n = [...e];
421
- for (let a = n.length - 1; a > 0; a--) {
422
- const c = Math.floor(Math.random() * (a + 1));
423
- [n[a], n[c]] = [n[c], n[a]];
161
+ function me(e) {
162
+ const o = [...e];
163
+ for (let a = o.length - 1; a > 0; a--) {
164
+ const l = Math.floor(Math.random() * (a + 1));
165
+ [o[a], o[l]] = [o[l], o[a]];
424
166
  }
425
- return n;
167
+ return o;
426
168
  }
427
- function ve(e, n) {
428
- const a = e.map((d) => d.id);
429
- if (n.columnA.length === 0 && n.columnB.length === 0)
169
+ function Ot(e, o) {
170
+ const a = e.map((g) => g.id);
171
+ if (o.columnA.length === 0 && o.columnB.length === 0)
430
172
  return {
431
- columnA: ce(a),
432
- columnB: ce(a)
173
+ columnA: me(a),
174
+ columnB: me(a)
433
175
  };
434
- const c = [...n.columnA], l = [...n.columnB], s = a.filter((d) => !c.includes(d));
435
- if (s.length > 0) {
436
- const d = ce(s);
437
- c.push(...d);
176
+ const l = [...o.columnA], u = [...o.columnB], c = a.filter((g) => !l.includes(g));
177
+ if (c.length > 0) {
178
+ const g = me(c);
179
+ l.push(...g);
438
180
  }
439
- const r = a.filter((d) => !l.includes(d));
440
- if (r.length > 0) {
441
- const d = ce(r);
442
- l.push(...d);
181
+ const m = a.filter((g) => !u.includes(g));
182
+ if (m.length > 0) {
183
+ const g = me(m);
184
+ u.push(...g);
443
185
  }
444
186
  return {
445
- columnA: c,
446
- columnB: l
187
+ columnA: l,
188
+ columnB: u
447
189
  };
448
190
  }
449
- const Ie = ({
191
+ const Ne = "var(--fu-ucrc-ptp-option-bg)", Nt = "var(--fu-ucrc-ptp-option-text)", Xt = "var(--fu-ucrc-ptp-on-state)", Et = he({
192
+ "0%, 100%": { transform: "translateX(0)" },
193
+ "25%": { transform: "translateX(-5px)" },
194
+ "75%": { transform: "translateX(5px)" }
195
+ }), Me = ["compact", "full", "fullMobile"], ke = ["left", "right"], dt = ["idle", "selected", "matched", "error"], jt = {
196
+ display: "flex",
197
+ alignItems: "center",
198
+ gap: t.space2xs,
199
+ justifyContent: "space-between",
200
+ padding: `${t.spaceXs} ${t.spaceSm}`,
201
+ borderRadius: t.radiusXl,
202
+ cursor: "pointer",
203
+ transition: "all 0.3s ease",
204
+ position: "relative",
205
+ minHeight: "56px",
206
+ width: "100%",
207
+ maxWidth: "100%",
208
+ boxSizing: "border-box",
209
+ overflow: "visible",
210
+ border: `${t.borderSize} solid transparent`,
211
+ WebkitTapHighlightColor: "transparent"
212
+ }, Ht = {
213
+ left: { borderTopLeftRadius: 0, borderBottomLeftRadius: 0, marginRight: "auto" },
214
+ right: { borderTopRightRadius: 0, borderBottomRightRadius: 0, marginLeft: "auto" }
215
+ }, Vt = {
216
+ idle: {
217
+ backgroundColor: Ne,
218
+ "&:hover": { border: `${t.borderSize} solid ${t.primary}`, backgroundColor: Ne, transform: "translateY(-2px)" }
219
+ },
220
+ selected: { backgroundColor: t.primary, borderColor: t.primary },
221
+ matched: { backgroundColor: t.success },
222
+ error: { backgroundColor: t.danger, animation: `${Et} 0.3s`, cursor: "not-allowed", pointerEvents: "none" }
223
+ }, Yt = { opacity: 0.5, cursor: "not-allowed", "&:hover": { transform: "none" } }, we = (...e) => e.join("|"), mt = {}, ut = (e, o, a, l) => we(e, o, a, l);
224
+ for (const e of Me)
225
+ for (const o of ke)
226
+ for (const a of dt)
227
+ for (const l of [!1, !0])
228
+ mt[ut(e, o, a, l)] = i(
229
+ jt,
230
+ e === "fullMobile" && { minHeight: "48px", width: "90%", ...Ht[o] },
231
+ Vt[a],
232
+ l && Yt
233
+ );
234
+ const Gt = (e, o) => ({
235
+ width: e,
236
+ height: e,
237
+ borderRadius: "50%",
238
+ overflow: "hidden",
239
+ backgroundColor: "#FFFFFF",
240
+ flexShrink: 0,
241
+ position: "absolute",
242
+ top: "50%",
243
+ transform: "translateY(-50%)",
244
+ zIndex: 10,
245
+ boxShadow: o ? "0 2px 12px rgba(0, 0, 0, 0.15)" : void 0,
246
+ border: `${t.borderSize} solid ${t.primary}`
247
+ }), gt = {}, ft = (e, o, a) => we(e, o, a);
248
+ for (const e of Me)
249
+ for (const o of ke)
250
+ for (const a of dt) {
251
+ const l = e === "fullMobile" ? "-12px" : "-14px";
252
+ gt[ft(e, o, a)] = i(
253
+ Gt(e === "fullMobile" ? "48px" : "56px", e !== "compact"),
254
+ o === "left" ? { right: l } : { left: l },
255
+ a === "error" && { borderColor: t.danger },
256
+ a === "matched" && { borderColor: t.success }
257
+ );
258
+ }
259
+ const qt = {
260
+ ...E,
261
+ fontFamily: re,
262
+ lineHeight: 1.3,
263
+ wordBreak: "break-word",
264
+ overflowWrap: "break-word",
265
+ textWrap: "balance",
266
+ unicodeBidi: "plaintext"
267
+ }, ht = {}, bt = {}, fe = (e, o, a) => we(e, o, a);
268
+ for (const e of Me)
269
+ for (const o of ke)
270
+ for (const a of [!1, !0]) {
271
+ const l = e === "fullMobile", u = { ...qt, textAlign: o, color: a ? Xt : Nt };
272
+ ht[fe(e, o, a)] = i(u, { fontWeight: 600, fontSize: l ? "0.8125em" : "0.9375em" }), bt[fe(e, o, a)] = i(u, { opacity: 0.7, fontSize: l ? "0.6875em" : "0.8125em" });
273
+ }
274
+ const be = {
275
+ display: "flex",
276
+ width: "100%",
277
+ maxWidth: "100%",
278
+ boxSizing: "border-box",
279
+ overflow: "hidden"
280
+ }, xe = { display: "flex", flexDirection: "column", flex: 1, minWidth: 0, maxWidth: "100%" }, pe = {
281
+ compact: {
282
+ container: i(be, { flexDirection: "row", gap: t.space2xl, paddingTop: t.spaceMd }),
283
+ column: i(xe, { gap: t.spaceSm })
284
+ },
285
+ full: {
286
+ container: i(be, { flexDirection: "row", gap: t.space2xl, backgroundColor: t.surface, paddingTop: t.space2xs }),
287
+ column: i(xe, { gap: t.spaceSm })
288
+ },
289
+ fullMobile: {
290
+ container: i(be, { flexDirection: "column", gap: t.spaceXs, backgroundColor: t.surface, paddingTop: 0 }),
291
+ column: i(xe, { gap: t.spaceXs })
292
+ }
293
+ }, Kt = i({
294
+ display: "flex",
295
+ flexDirection: "column",
296
+ gap: t.space2xs,
297
+ flex: 1,
298
+ minWidth: 0,
299
+ justifyContent: "center"
300
+ }), Qt = { width: "100%", height: "100%", objectFit: "cover" }, Ce = ({
450
301
  pairs: e,
451
- order: n,
302
+ order: o,
452
303
  matchedPairs: a,
453
- selectedLeft: c,
454
- selectedRight: l,
455
- showError: s,
456
- onSelectLeft: r,
457
- onSelectRight: d,
458
- brandingColors: o,
459
- disabled: i = !1,
460
- isTimeUp: b = !1
304
+ selectedLeft: l,
305
+ selectedRight: u,
306
+ showError: c,
307
+ onSelectLeft: m,
308
+ onSelectRight: g,
309
+ brandingColors: r,
310
+ disabled: p = !1,
311
+ isTimeUp: T = !1,
312
+ compact: y = !1
461
313
  }) => {
462
- const g = Z(), f = X(), u = ge(), y = te(), S = ee().xl, P = me().size, I = (o == null ? void 0 : o.primary_color) || f.palette.primary.plainColor, F = (o == null ? void 0 : o.content_color) || u.colorSchemes.light.textColor, k = u.colorSchemes.dark.textColor, Y = f.palette.success.plainColor, L = f.palette.danger.plainColor, D = it({
463
- primaryColor: I,
464
- textColor: F,
465
- whiteTextColor: k,
466
- successColor: Y,
467
- dangerColor: L,
468
- optionBackground: "#FFFFFF",
469
- spacingScale: y,
470
- xlBorderRadius: S,
471
- borderSize: P
472
- }), A = xe(
473
- () => ve(e, n),
474
- [e, n]
475
- ), v = (T) => e.find((h) => h.id === T), _ = (T) => a.some((h) => h.leftId === T), O = (T) => a.some((h) => h.rightId === T), H = (T, h) => {
476
- var z, M, j;
477
- const C = v(T);
478
- if (!C) return null;
479
- const m = h === "left" ? _(T) : O(T), R = h === "left" && c === T || h === "right" && l === T, $ = (R || m) && C.images, B = g ? ((z = C.images) == null ? void 0 : z.mobile) || ((M = C.images) == null ? void 0 : M.main) : (j = C.images) == null ? void 0 : j.main, E = h === "left" ? C.optionA : C.optionB, N = () => {
480
- i || s || b || (h === "left" ? r(T) : d(T));
481
- }, W = s && R, V = s && !R;
482
- return /* @__PURE__ */ p(
483
- x,
484
- {
485
- onClick: N,
486
- sx: [
487
- D.getColumnItemStyle(R, m, W),
488
- (i || V) && D.disabledItem,
489
- W && D.errorItem
490
- ],
491
- children: [
492
- h === "right" && $ && B && /* @__PURE__ */ t(x, { sx: D.getImageContainerStyle(m, W, h), children: /* @__PURE__ */ t(
493
- "img",
494
- {
495
- loading: "lazy",
496
- src: B,
497
- alt: E.title,
498
- style: { width: "100%", height: "100%", objectFit: "cover" }
499
- }
500
- ) }),
501
- /* @__PURE__ */ p(x, { sx: D.textContainer, children: [
502
- /* @__PURE__ */ t(w, { level: "body-md", sx: D.getOptionTitleStyle(h, R, m, W), children: E.title }),
503
- E.subtitle && /* @__PURE__ */ t(
504
- w,
505
- {
506
- level: "body-sm",
507
- sx: D.getOptionSubtitleStyle(h, R, m, W),
508
- children: E.subtitle
509
- }
510
- )
511
- ] }),
512
- h === "left" && $ && B && /* @__PURE__ */ t(x, { sx: D.getImageContainerStyle(m, W, h), children: /* @__PURE__ */ t(
513
- "img",
514
- {
515
- loading: "lazy",
516
- src: B,
517
- alt: E.title,
518
- style: { width: "100%", height: "100%", objectFit: "cover" }
519
- }
520
- ) })
521
- ]
522
- },
523
- T
524
- );
314
+ const W = ee(), U = et(), k = te(), I = yt(), h = y ? "compact" : W ? "fullMobile" : "full", A = {
315
+ "--fu-ucrc-ptp-primary": (r == null ? void 0 : r.primary_color) || k.palette.primary.plainColor,
316
+ "--fu-ucrc-ptp-option-text": (r == null ? void 0 : r.content_color) || U.colorSchemes.light.textColor,
317
+ "--fu-ucrc-ptp-on-state": U.colorSchemes.dark.textColor,
318
+ "--fu-ucrc-ptp-option-bg": y || I === "dark" ? "#FFFFFF" : k.onSurface
319
+ }, F = at(() => Ot(e, o), [e, o]), b = (P, f) => {
320
+ var d, C, N;
321
+ const v = e.find((O) => O.id === P);
322
+ if (!v) return null;
323
+ const z = a.some((O) => (f === "left" ? O.leftId : O.rightId) === P), w = (f === "left" ? l : u) === P, D = c && w ? "error" : z ? "matched" : w ? "selected" : "idle", $ = p || c && !w, B = W ? ((d = v.images) == null ? void 0 : d.mobile) || ((C = v.images) == null ? void 0 : C.main) : (N = v.images) == null ? void 0 : N.main, M = f === "left" ? v.optionA : v.optionB, s = () => {
324
+ p || c || T || (f === "left" ? m(P) : g(P));
325
+ }, R = (w || z) && v.images && B && /* @__PURE__ */ n("div", { css: gt[ft(h, f, D)], children: /* @__PURE__ */ n("img", { loading: "lazy", src: B, alt: M.title, style: Qt }) });
326
+ return /* @__PURE__ */ L("div", { onClick: s, css: mt[ut(h, f, D, $)], children: [
327
+ f === "right" && R,
328
+ /* @__PURE__ */ L("div", { css: Kt, children: [
329
+ /* @__PURE__ */ n("p", { css: ht[fe(h, f, D !== "idle")], children: M.title }),
330
+ M.subtitle && /* @__PURE__ */ n("p", { css: bt[fe(h, f, D !== "idle")], children: M.subtitle })
331
+ ] }),
332
+ f === "left" && R
333
+ ] }, P);
525
334
  };
526
- return /* @__PURE__ */ p(x, { sx: D.container, children: [
527
- /* @__PURE__ */ t(x, { sx: D.column, children: A.columnA.map((T) => H(T, "left")) }),
528
- /* @__PURE__ */ t(x, { sx: D.column, children: A.columnB.map((T) => H(T, "right")) })
335
+ return /* @__PURE__ */ L("div", { css: pe[h].container, style: A, children: [
336
+ /* @__PURE__ */ n("div", { css: pe[h].column, children: F.columnA.map((P) => b(P, "left")) }),
337
+ /* @__PURE__ */ n("div", { css: pe[h].column, children: F.columnB.map((P) => b(P, "right")) })
529
338
  ] });
530
- }, be = (e) => {
531
- let n;
532
- const a = X(), c = te(), l = a.palette.danger.softBg, s = a.palette.danger.plainColor, r = a.palette.warning.softBg, d = a.palette.warning.plainColor, o = e.brandingPrimaryColor || a.palette.primary.plainColor, i = ee().xl, b = ae().secondary, g = a.palette.primary.onPrimary, f = {
533
- "@keyframes pulse": {
534
- "0%": {
535
- transform: "scale(1)"
536
- },
537
- "50%": {
538
- transform: "scale(1.05)"
539
- },
540
- "100%": {
541
- transform: "scale(1)"
542
- }
543
- }
544
- }, u = Ke(() => {
545
- const P = e.timer - 1;
546
- e.onTimeUpdate(P);
547
- }, [e.onTimeUpdate, e.timer]);
548
- de(() => (e.isRunning && (n = setInterval(u, 1e3)), () => {
549
- n && clearInterval(n);
550
- }), [e.isRunning, u, e.timer]);
551
- const y = (P) => {
552
- const I = Math.floor(P / 60), F = P % 60;
553
- return `${I < 10 ? "0" : ""}${I}:${F < 10 ? "0" : ""}${F}${I > 0 ? "m" : "s"}`;
554
- }, S = () => {
555
- const P = e.timer / e.initialTime * 100;
556
- return P <= 30 ? {
557
- background: l,
558
- color: s,
559
- iconColor: s,
560
- animation: "pulse 1s infinite"
561
- } : P <= 50 ? {
562
- background: r,
563
- color: d,
564
- iconColor: d
565
- } : {
566
- background: o,
567
- color: g,
568
- iconColor: g
569
- };
570
- };
571
- return /* @__PURE__ */ p(
572
- x,
339
+ }, Jt = he({
340
+ "0%": { transform: "scale(1)" },
341
+ "50%": { transform: "scale(1.05)" },
342
+ "100%": { transform: "scale(1)" }
343
+ }), ye = {
344
+ paddingTop: t.spaceXs,
345
+ paddingBottom: t.spaceXs,
346
+ paddingLeft: t.spaceSm,
347
+ paddingRight: t.spaceMd,
348
+ display: "flex",
349
+ gap: t.space2xs,
350
+ alignItems: "center",
351
+ borderRadius: t.radiusXl,
352
+ maxWidth: "105px",
353
+ maxHeight: "40px",
354
+ transition: "all 0.3s ease",
355
+ zIndex: 10
356
+ }, ue = {
357
+ normal: i(ye, { backgroundColor: "var(--fu-ucrc-ptp-stopwatch)", color: t.onPrimary }),
358
+ warning: i(ye, {
359
+ backgroundColor: "var(--fu-ucrc-warning-soft-bg)",
360
+ color: "var(--fu-ucrc-warning-plain-color)"
361
+ }),
362
+ danger: i(ye, {
363
+ backgroundColor: "var(--fu-ucrc-danger-soft-bg)",
364
+ color: t.danger,
365
+ animation: `${Jt} 1s infinite`
366
+ }),
367
+ time: i({
368
+ margin: 0,
369
+ display: "block",
370
+ fontFamily: t.fontSecondary,
371
+ fontWeight: 400,
372
+ fontSize: "1em",
373
+ lineHeight: "150%",
374
+ letterSpacing: "0.15px",
375
+ color: "inherit",
376
+ transition: "color 0.3s ease"
377
+ })
378
+ }, Le = (e) => {
379
+ const o = te(), a = e.brandingPrimaryColor || o.palette.primary.plainColor, { onTimeUpdate: l, timer: u } = e, c = $t(() => {
380
+ l(u - 1);
381
+ }, [l, u]);
382
+ Pe(() => {
383
+ const r = e.isRunning ? setInterval(c, 1e3) : void 0;
384
+ return () => clearInterval(r);
385
+ }, [e.isRunning, c, e.timer]);
386
+ const m = (r) => {
387
+ const p = Math.floor(r / 60), T = r % 60;
388
+ return `${p < 10 ? "0" : ""}${p}:${T < 10 ? "0" : ""}${T}${p > 0 ? "m" : "s"}`;
389
+ }, g = e.timer / e.initialTime * 100;
390
+ return /* @__PURE__ */ L(
391
+ "div",
573
392
  {
574
- sx: {
575
- py: c.xs,
576
- pl: c.sm,
577
- pr: c.md,
578
- display: "flex",
579
- gap: c["2xs"],
580
- alignItems: "center",
581
- bgcolor: S().background,
582
- borderRadius: i,
583
- maxWidth: "105px",
584
- maxHeight: "40px",
585
- transition: "all 0.3s ease",
586
- animation: S().animation,
587
- ...f,
588
- zIndex: 10
589
- },
393
+ css: g <= 30 ? ue.danger : g <= 50 ? ue.warning : ue.normal,
394
+ style: { "--fu-ucrc-ptp-stopwatch": a },
590
395
  children: [
591
- /* @__PURE__ */ t(
592
- Qe,
593
- {
594
- sx: {
595
- width: "24px",
596
- height: "24px",
597
- color: S().iconColor,
598
- transition: "color 0.3s ease"
599
- }
600
- }
601
- ),
602
- /* @__PURE__ */ t(
603
- w,
604
- {
605
- sx: {
606
- fontFamily: b,
607
- fontWeight: 400,
608
- fontSize: "1em",
609
- lineHeight: "150%",
610
- letterSpacing: "0.15px",
611
- color: S().color,
612
- transition: "color 0.3s ease"
613
- },
614
- children: y(e.timer)
615
- }
616
- )
396
+ /* @__PURE__ */ n(At, { size: "24px", style: { transition: "color 0.3s ease" } }),
397
+ /* @__PURE__ */ n("p", { css: ue.time, children: m(e.timer) })
617
398
  ]
618
399
  }
619
400
  );
620
- }, ye = ({
401
+ }, Xe = {
402
+ display: "flex",
403
+ flexDirection: "column",
404
+ gap: t.spaceMd,
405
+ backgroundColor: "var(--fu-ucrc-ptp-stats-bg)",
406
+ borderRadius: t.radiusMd,
407
+ maxWidth: "1200px"
408
+ }, Ee = { ...E, fontFamily: re, lineHeight: 1.33334, letterSpacing: le, fontWeight: "bold" }, je = { ...E, fontFamily: re, lineHeight: 1.5, color: t.text, opacity: 0.7 }, j = {
409
+ root: i(Xe, { paddingInline: t.spaceLg, paddingBlock: t.spaceLg, margin: "0 auto", width: "100%" }),
410
+ rootMobile: i(Xe, { paddingInline: 0, paddingBlock: t.spaceMd, margin: `0 ${t.spaceMd}`, width: "auto" }),
411
+ row: i({ display: "flex", flexDirection: "row", gap: t.spaceLg, flex: 1, justifyContent: "center", flexWrap: "wrap" }),
412
+ rowMobile: i({ display: "flex", flexDirection: "row", gap: t.spaceSm, flex: 1, justifyContent: "center", flexWrap: "wrap" }),
413
+ stat: i({ textAlign: "center", minWidth: "100px" }),
414
+ statMobile: i({ textAlign: "center", minWidth: "80px" }),
415
+ value: i(Ee, { fontSize: "2em" }),
416
+ valueMobile: i(Ee, { fontSize: "1.5em" }),
417
+ label: i(je, { fontSize: "0.875em" }),
418
+ labelMobile: i(je, { fontSize: "0.75em" })
419
+ }, Ue = ({
621
420
  totalAttempts: e,
622
- accuracy: n,
421
+ accuracy: o,
623
422
  successThresholdPercent: a,
624
- meetsThreshold: c,
625
- totalPairs: l,
626
- matchedPairs: s,
627
- brandingColors: r,
628
- bgcolor: d
423
+ meetsThreshold: l,
424
+ totalPairs: u,
425
+ matchedPairs: c,
426
+ brandingColors: m,
427
+ bgcolor: g
629
428
  }) => {
630
- const { t: o } = re(), i = Z(), b = X(), g = te(), f = ee().md, u = (r == null ? void 0 : r.content_color) || b.textColor, y = (r == null ? void 0 : r.primary_color) || b.palette.primary.plainColor, S = b.palette.danger.plainColor, P = b.palette.success.plainColor, I = b.surface, F = l - s, k = c ? P : S;
631
- return /* @__PURE__ */ t(
632
- x,
429
+ const { t: r } = ce(), p = ee(), T = te(), y = (m == null ? void 0 : m.content_color) || T.textColor, W = (m == null ? void 0 : m.primary_color) || T.palette.primary.plainColor, U = u - c, k = l ? T.palette.success.plainColor : T.palette.danger.plainColor, I = [
430
+ { value: e, color: y, label: r("pickThePair.challengeStats.attempts") },
431
+ { value: `${o.toFixed(0)}%`, color: k, label: r("pickThePair.challengeStats.accuracy") },
432
+ { value: `${a}%`, color: W, label: r("pickThePair.challengeStats.target") },
433
+ { value: U, color: y, label: r("pickThePair.challengeStats.remaining") }
434
+ ];
435
+ return /* @__PURE__ */ n(
436
+ "div",
633
437
  {
634
- sx: {
635
- display: "flex",
636
- flexDirection: "column",
637
- gap: g.md,
638
- backgroundColor: I,
639
- borderRadius: f,
640
- px: i ? 0 : g.lg,
641
- py: i ? g.md : g.lg,
642
- maxWidth: "1200px",
643
- margin: i ? `0 ${g.md}` : "0 auto",
644
- width: i ? "auto" : "100%",
645
- bgcolor: d
646
- },
647
- children: /* @__PURE__ */ p(
648
- x,
649
- {
650
- sx: {
651
- display: "flex",
652
- flexDirection: "row",
653
- gap: i ? g.sm : g.lg,
654
- flex: 1,
655
- justifyContent: "center",
656
- flexWrap: "wrap"
657
- },
658
- children: [
659
- /* @__PURE__ */ p(x, { sx: { textAlign: "center", minWidth: i ? "80px" : "100px" }, children: [
660
- /* @__PURE__ */ t(
661
- w,
662
- {
663
- level: "h3",
664
- sx: {
665
- color: u,
666
- fontWeight: "bold",
667
- fontSize: i ? "1.5em" : "2em"
668
- },
669
- children: e
670
- }
671
- ),
672
- /* @__PURE__ */ t(
673
- w,
674
- {
675
- level: "body-sm",
676
- sx: {
677
- color: u,
678
- opacity: 0.7,
679
- fontSize: i ? "0.75em" : "0.875em"
680
- },
681
- children: o("pickThePair.challengeStats.attempts")
682
- }
683
- )
684
- ] }),
685
- /* @__PURE__ */ p(x, { sx: { textAlign: "center", minWidth: i ? "80px" : "100px" }, children: [
686
- /* @__PURE__ */ p(
687
- w,
688
- {
689
- level: "h3",
690
- sx: {
691
- color: k,
692
- fontWeight: "bold",
693
- fontSize: i ? "1.5em" : "2em"
694
- },
695
- children: [
696
- n.toFixed(0),
697
- "%"
698
- ]
699
- }
700
- ),
701
- /* @__PURE__ */ t(
702
- w,
703
- {
704
- level: "body-sm",
705
- sx: {
706
- color: u,
707
- opacity: 0.7,
708
- fontSize: i ? "0.75em" : "0.875em"
709
- },
710
- children: o("pickThePair.challengeStats.accuracy")
711
- }
712
- )
713
- ] }),
714
- /* @__PURE__ */ p(x, { sx: { textAlign: "center", minWidth: i ? "80px" : "100px" }, children: [
715
- /* @__PURE__ */ p(
716
- w,
717
- {
718
- level: "h3",
719
- sx: {
720
- color: y,
721
- fontWeight: "bold",
722
- fontSize: i ? "1.5em" : "2em"
723
- },
724
- children: [
725
- a,
726
- "%"
727
- ]
728
- }
729
- ),
730
- /* @__PURE__ */ t(
731
- w,
732
- {
733
- level: "body-sm",
734
- sx: {
735
- color: u,
736
- opacity: 0.7,
737
- fontSize: i ? "0.75em" : "0.875em"
738
- },
739
- children: o("pickThePair.challengeStats.target")
740
- }
741
- )
742
- ] }),
743
- /* @__PURE__ */ p(x, { sx: { textAlign: "center", minWidth: i ? "80px" : "100px" }, children: [
744
- /* @__PURE__ */ t(
745
- w,
746
- {
747
- level: "h3",
748
- sx: {
749
- color: u,
750
- fontWeight: "bold",
751
- fontSize: i ? "1.5em" : "2em"
752
- },
753
- children: F
754
- }
755
- ),
756
- /* @__PURE__ */ t(
757
- w,
758
- {
759
- level: "body-sm",
760
- sx: {
761
- color: u,
762
- opacity: 0.7,
763
- fontSize: i ? "0.75em" : "0.875em"
764
- },
765
- children: o("pickThePair.challengeStats.remaining")
766
- }
767
- )
768
- ] })
769
- ]
770
- }
771
- )
438
+ css: p ? j.rootMobile : j.root,
439
+ style: { "--fu-ucrc-ptp-stats-bg": g, "--fu-ucrc-ptp-text": y },
440
+ children: /* @__PURE__ */ n("div", { css: p ? j.rowMobile : j.row, children: I.map((h) => /* @__PURE__ */ L("div", { css: p ? j.statMobile : j.stat, children: [
441
+ /* @__PURE__ */ n("h3", { css: p ? j.valueMobile : j.value, style: { color: h.color }, children: h.value }),
442
+ /* @__PURE__ */ n("p", { css: p ? j.labelMobile : j.label, children: h.label })
443
+ ] }, h.label)) })
772
444
  }
773
445
  );
774
- }, ot = (e) => {
775
- const n = ae().primary, a = ee().xl, c = X().palette.primary.onPrimary, l = e.selectedOptions.length === 0 || e.isVoting;
776
- return /* @__PURE__ */ t(Q, { children: /* @__PURE__ */ t(
777
- pe,
778
- {
779
- variant: "soft",
780
- disabled: l,
781
- loading: e.isVoting,
782
- sx: {
783
- borderRadius: a,
784
- py: "10px",
785
- px: "16px",
786
- bgcolor: e.buttonColor,
787
- color: c,
788
- transition: "all 300ms cubic-bezier(0.2, 0, 0, 1)",
789
- transform: "scale(1)",
790
- alignSelf: "center",
791
- "&:hover": {
792
- bgcolor: e.buttonColor,
793
- transform: "scale(1.02)"
794
- },
795
- "&:active": {
796
- color: c,
797
- transform: "scale(0.98)"
798
- },
799
- "&:disabled": {
800
- bgcolor: e.buttonColor,
801
- color: c,
802
- opacity: "12%"
803
- },
804
- "--Icon-color": c,
805
- fontSize: "0.9375em"
806
- },
807
- onClick: e.onClick,
808
- slotProps: {
809
- loadingIndicatorCenter: {
810
- sx: {
811
- "& .MuiCircularProgress-track": {
812
- stroke: "#FFFFFF"
813
- }
814
- }
815
- }
816
- },
817
- children: /* @__PURE__ */ t(
818
- w,
819
- {
820
- sx: {
821
- fontFamily: n,
822
- fontWeight: 500,
823
- fontSize: "0.9375em",
824
- lineHeight: "24px",
825
- letterSpacing: "0.46px",
826
- textTransform: "uppercase",
827
- color: c,
828
- gap: "8px",
829
- display: "flex",
830
- alignItems: "center",
831
- visibility: e.isVoting ? "hidden" : "visible"
832
- },
833
- children: e.label
834
- }
835
- )
836
- }
837
- ) });
838
- }, lt = (e) => {
839
- var k, Y, L, U, D, A, v, _, O, H, T, h, C, m, R, $, B, E, N, W, V, z, M;
840
- const { t: n } = re(), a = Z(), c = ke(), l = ((k = e.infoPage.branding) == null ? void 0 : k.colors) || null, s = a ? ((L = (Y = e.infoPage.branding) == null ? void 0 : Y.images) == null ? void 0 : L.mobile_logo) || ((D = (U = e.infoPage.branding) == null ? void 0 : U.images) == null ? void 0 : D.main_logo) || "" : ((v = (A = e.infoPage.branding) == null ? void 0 : A.images) == null ? void 0 : v.main_logo) || "", r = e.imagePosition || "left", [d, o] = K(!1), i = fe(
446
+ }, He = {
447
+ root: i(Ut, { padding: "10px 16px" }),
448
+ label: i(It)
449
+ }, Zt = (e) => /* @__PURE__ */ n(
450
+ "button",
451
+ {
452
+ type: "button",
453
+ css: He.root,
454
+ style: { "--fu-ucrc-cta-bg": e.buttonColor },
455
+ disabled: e.disabled,
456
+ onClick: e.onClick,
457
+ children: /* @__PURE__ */ n("span", { css: He.label, children: e.label })
458
+ }
459
+ ), ei = (e) => {
460
+ var P, f, v, z, w, _, D, $, B, M, s, R, d, C, N, O, Y, G, q, K, Q, ie, ne, Ie;
461
+ const { t: o } = ce(), a = ee(), l = tt(), u = te(), c = ((P = e.infoPage.branding) == null ? void 0 : P.colors) || null, m = a ? ((v = (f = e.infoPage.branding) == null ? void 0 : f.images) == null ? void 0 : v.mobile_logo) || ((w = (z = e.infoPage.branding) == null ? void 0 : z.images) == null ? void 0 : w.main_logo) || "" : ((D = (_ = e.infoPage.branding) == null ? void 0 : _.images) == null ? void 0 : D.main_logo) || "", g = e.imagePosition || "left", [r, p] = V(!1), T = Se(
841
462
  {
842
463
  images: e.infoPage.images,
843
464
  imagePlaceholder: e.defaultImagePlaceholderUrl || ""
844
465
  },
845
- ue.STANDARD
846
- ), b = c || a && !!i, g = (l == null ? void 0 : l.content_color) || X().textColor, f = ae().primary, u = (l == null ? void 0 : l.background_color) || X().surfaceVariant, y = ee().md, S = te(), P = nt({
847
- spacingScale: S,
848
- fontFamilyPrimary: f,
849
- textColor: g,
850
- bgcolor: se(u || ""),
851
- mdBorderRadius: y,
852
- isExtraSmall: b
853
- }), I = e.matchedPairs.length === e.pairData.pairs.length, F = (j) => {
854
- var q, J, ne, ie, oe;
855
- return /* @__PURE__ */ t(
856
- Fe,
466
+ Te.STANDARD
467
+ ), y = l || a && !!T, W = (c == null ? void 0 : c.content_color) || u.textColor, U = (c == null ? void 0 : c.background_color) || u.surfaceVariant, k = `rgba(${U ? it(U).replace(/[^\d,]/g, "") : ""}, 0.5)`, I = {
468
+ "--fu-ucrc-ptp-text": W,
469
+ "--fu-ucrc-ptp-panel": k,
470
+ "--fu-ucrc-ptp-time-up": ct((c == null ? void 0 : c.primary_color) || "#000000", 0.5)
471
+ }, h = e.matchedPairs.length === e.pairData.pairs.length, A = e.pairData.config.timeLimit > 0, F = () => {
472
+ var De, We, Re, Fe, Be;
473
+ return /* @__PURE__ */ n(
474
+ st,
857
475
  {
858
- brandingLogo: s,
859
- textColor: j,
860
- label: ((q = e.infoPage.labels) == null ? void 0 : q.sponsor) || null,
861
- primaryUrl: (ne = (J = e.infoPage.branding) == null ? void 0 : J.urls) == null ? void 0 : ne.primary_url,
862
- secondaryUrl: (oe = (ie = e.infoPage.branding) == null ? void 0 : ie.urls) == null ? void 0 : oe.secondary_url
476
+ brandingLogo: m,
477
+ textColor: W,
478
+ label: ((De = e.infoPage.labels) == null ? void 0 : De.sponsor) || null,
479
+ primaryUrl: (Re = (We = e.infoPage.branding) == null ? void 0 : We.urls) == null ? void 0 : Re.primary_url,
480
+ secondaryUrl: (Be = (Fe = e.infoPage.branding) == null ? void 0 : Fe.urls) == null ? void 0 : Be.secondary_url
863
481
  }
864
482
  );
865
- };
866
- return /* @__PURE__ */ t(Re, { brandingBorderColor: (l == null ? void 0 : l.border_color) || null, children: /* @__PURE__ */ t(
867
- Le,
483
+ }, b = /* @__PURE__ */ n("div", { css: a ? S.timeUpOverlayMobile : S.timeUpOverlay, children: /* @__PURE__ */ n("h1", { css: y ? S.timeUpTextXs : S.timeUpText, children: ($ = e.infoPage.labels) == null ? void 0 : $.timeUp }) });
484
+ return /* @__PURE__ */ n(rt, { brandingBorderColor: (c == null ? void 0 : c.border_color) || null, style: I, children: /* @__PURE__ */ n(
485
+ Dt,
868
486
  {
869
487
  entity: {
870
488
  ...e.infoPage,
@@ -872,635 +490,225 @@ const Ie = ({
872
490
  description: e.infoPage.subtitle || "",
873
491
  rules: null
874
492
  },
875
- headline: n("pickThePair.headline"),
876
- finalImage: i,
877
- imagePosition: r,
493
+ headline: o("pickThePair.headline"),
494
+ finalImage: T,
495
+ imagePosition: g,
878
496
  embedCodeContainerRef: void 0,
879
497
  hasEmbedCode: !1,
880
- children: /* @__PURE__ */ p(Q, { children: [
881
- ((_ = e.infoPage.labels) == null ? void 0 : _.welcome) && /* @__PURE__ */ t(
882
- w,
498
+ children: /* @__PURE__ */ L(ae, { children: [
499
+ ((B = e.infoPage.labels) == null ? void 0 : B.welcome) && /* @__PURE__ */ n("p", { css: A ? y ? S.welcomeTimedXs : S.welcomeTimed : y ? S.welcomeXs : S.welcome, children: e.infoPage.labels.welcome }),
500
+ A && /* @__PURE__ */ n("div", { css: S.stopwatch, children: /* @__PURE__ */ n(
501
+ Le,
883
502
  {
884
- level: "body-md",
885
- sx: {
886
- ...P.welcome,
887
- mb: e.pairData.config.timeLimit > 0 ? S.md : 0
888
- },
889
- children: e.infoPage.labels.welcome
890
- }
891
- ),
892
- e.pairData.config.timeLimit > 0 && /* @__PURE__ */ t(
893
- x,
894
- {
895
- sx: {
896
- display: "flex",
897
- justifyContent: "center",
898
- mb: S.md
899
- },
900
- children: /* @__PURE__ */ t(
901
- be,
902
- {
903
- isRunning: e.isTimerRunning,
904
- timer: e.timer,
905
- initialTime: e.pairData.config.timeLimit,
906
- brandingPrimaryColor: (l == null ? void 0 : l.primary_color) || null,
907
- onTimeUpdate: e.onTimeUpdate
908
- }
909
- )
503
+ isRunning: e.isTimerRunning,
504
+ timer: e.timer,
505
+ initialTime: e.pairData.config.timeLimit,
506
+ brandingPrimaryColor: (c == null ? void 0 : c.primary_color) || null,
507
+ onTimeUpdate: e.onTimeUpdate
910
508
  }
911
- ),
912
- e.isChallengeMode && /* @__PURE__ */ t(
913
- x,
509
+ ) }),
510
+ e.isChallengeMode && /* @__PURE__ */ n("div", { css: S.challengeStats, children: /* @__PURE__ */ n(
511
+ Ue,
914
512
  {
915
- sx: {
916
- px: S.md,
917
- "& > div": {
918
- maxWidth: "100%",
919
- margin: 0,
920
- px: S.md,
921
- py: S.md,
922
- boxSizing: "border-box"
923
- }
924
- },
925
- children: /* @__PURE__ */ t(
926
- ye,
927
- {
928
- totalAttempts: e.totalAttempts,
929
- accuracy: e.accuracy,
930
- successThresholdPercent: e.pairData.config.successThresholdPercent,
931
- meetsThreshold: e.meetsThreshold,
932
- totalPairs: e.pairData.pairs.length,
933
- matchedPairs: e.matchedPairs.length,
934
- brandingColors: l,
935
- bgcolor: `rgba(${u ? se(u || "").replace(/[^\d,]/g, "") : ""}, 0.5)`
936
- }
937
- )
938
- }
939
- ),
940
- d ? (
941
- // Lead Form
942
- /* @__PURE__ */ t(x, { sx: P.leadCollectionContainer, children: /* @__PURE__ */ p(x, { sx: P.leadQuestionContainer, children: [
943
- /* @__PURE__ */ t(x, { sx: P.leadContentContainer, children: /* @__PURE__ */ t(
944
- he,
945
- {
946
- sdk: e.sdk,
947
- contentId: e.infoPage.id,
948
- contentType: e.infoPage.type,
949
- onSuccessLabel: ((O = e.infoPage.labels) == null ? void 0 : O.buttonLabel) || n("pickThePair.buttons.submit"),
950
- contentName: e.infoPage.title,
951
- brandingColors: (H = e.infoPage.branding) == null ? void 0 : H.colors,
952
- brandingUrls: (T = e.infoPage.branding) == null ? void 0 : T.urls,
953
- campaignId: (h = e.leads) == null ? void 0 : h.campaignId,
954
- campaignName: (C = e.leads) == null ? void 0 : C.campaignName,
955
- fields: (m = e.leads) == null ? void 0 : m.fields,
956
- leadTitle: (R = e.infoPage.labels) == null ? void 0 : R.leadTitle,
957
- leadDescription: ($ = e.infoPage.labels) == null ? void 0 : $.leadDescription,
958
- leadCta: (B = e.infoPage.labels) == null ? void 0 : B.leadCta,
959
- leadSuccessTitle: (E = e.infoPage.labels) == null ? void 0 : E.successTitle,
960
- leadSuccessDescription: (N = e.infoPage.labels) == null ? void 0 : N.successDescription,
961
- syncWithProfile: (W = e.leads) == null ? void 0 : W.syncWithProfile,
962
- isSubmittingParticipation: !I || e.isChallengeMode && !e.meetsThreshold
963
- }
964
- ) }),
965
- F(g)
966
- ] }) })
967
- ) : /* @__PURE__ */ p(Q, { children: [
968
- a && e.isTimeUp ? (
969
- // Mobile: Time's Up - Show only overlay with fixed height
970
- ((V = e.infoPage.labels) == null ? void 0 : V.timeUp) && /* @__PURE__ */ t(
971
- x,
972
- {
973
- sx: P.getTimeUpOverlayStyle(
974
- (l == null ? void 0 : l.primary_color) || "#000000",
975
- a
976
- ),
977
- children: /* @__PURE__ */ t(w, { level: "h1", sx: P.timeUpText, children: e.infoPage.labels.timeUp })
978
- }
979
- )
980
- ) : (
981
- // Desktop or mobile with time remaining - Show full section
982
- /* @__PURE__ */ t(x, { sx: P.questionArea, children: /* @__PURE__ */ t(x, { sx: P.questionContainer, children: /* @__PURE__ */ p(
983
- x,
984
- {
985
- sx: {
986
- ...P.questionContentContainer,
987
- position: "relative"
988
- },
989
- children: [
990
- ((z = e.infoPage.labels) == null ? void 0 : z.instructions) && /* @__PURE__ */ t(w, { level: "body-lg", sx: P.instructions, children: e.infoPage.labels.instructions }),
991
- /* @__PURE__ */ t(
992
- Ie,
993
- {
994
- pairs: e.pairData.pairs,
995
- order: e.pairData.config.order,
996
- matchedPairs: e.matchedPairs,
997
- selectedLeft: e.selectedLeft,
998
- selectedRight: e.selectedRight,
999
- showError: e.showError,
1000
- onSelectLeft: e.onSelectLeft,
1001
- onSelectRight: e.onSelectRight,
1002
- brandingColors: l,
1003
- disabled: !1,
1004
- isTimeUp: e.isTimeUp
1005
- }
1006
- ),
1007
- e.isTimeUp && ((M = e.infoPage.labels) == null ? void 0 : M.timeUp) && /* @__PURE__ */ t(
1008
- x,
1009
- {
1010
- sx: P.getTimeUpOverlayStyle(
1011
- (l == null ? void 0 : l.primary_color) || "#000000",
1012
- a
1013
- ),
1014
- children: /* @__PURE__ */ t(w, { level: "h1", sx: P.timeUpText, children: e.infoPage.labels.timeUp })
1015
- }
1016
- )
1017
- ]
1018
- }
1019
- ) }) })
1020
- ),
1021
- /* @__PURE__ */ p(
1022
- x,
1023
- {
1024
- sx: s ? P.footerContainer : P.footerContainerNoLogo,
1025
- children: [
1026
- s && !b ? F(g) : /* @__PURE__ */ t(Q, {}),
1027
- /* @__PURE__ */ t(
1028
- ot,
1029
- {
1030
- selectedOptions: I && (!e.isChallengeMode || e.meetsThreshold) ? ["matched"] : [],
1031
- label: n("pickThePair.buttons.continue"),
1032
- buttonColor: (l == null ? void 0 : l.primary_color) || X().palette.primary.plainColor,
1033
- isVoting: !1,
1034
- onClick: () => o(!0)
1035
- }
1036
- )
1037
- ]
1038
- }
1039
- ),
1040
- s && b ? F(g) : /* @__PURE__ */ t(Q, {})
1041
- ] })
1042
- ] })
1043
- }
1044
- ) });
1045
- }, at = (e) => {
1046
- const {
1047
- spacingScale: n,
1048
- fontFamilyPrimary: a,
1049
- textColor: c,
1050
- bgcolor: l,
1051
- mdBorderRadius: s,
1052
- mobile: r,
1053
- surface: d
1054
- } = e;
1055
- return {
1056
- container: {
1057
- display: "flex",
1058
- flexDirection: "column",
1059
- width: "100%",
1060
- minHeight: "100vh",
1061
- bgcolor: `rgba(${l ? l.replace(/[^\d,]/g, "") : ""}, 0.5)`,
1062
- gap: n["3xl"],
1063
- overflowX: "hidden"
1064
- },
1065
- heroSection: {
1066
- display: "flex",
1067
- flexDirection: "column",
1068
- justifyContent: "center",
1069
- alignItems: "center",
1070
- width: "100%",
1071
- overflow: "hidden"
1072
- },
1073
- header: {
1074
- display: "flex",
1075
- flexDirection: "column",
1076
- gap: n.md,
1077
- textAlign: "center",
1078
- padding: r ? `0 ${n.md}` : `0 ${n.lg}`
1079
- },
1080
- title: {
1081
- fontFamily: a,
1082
- color: c,
1083
- fontSize: r ? "1.75em" : "2.25em",
1084
- fontWeight: 700,
1085
- lineHeight: 1.2
1086
- },
1087
- subtitle: {
1088
- fontFamily: a,
1089
- color: c,
1090
- fontSize: r ? "1em" : "1.125em",
1091
- fontWeight: 400,
1092
- lineHeight: 1.5,
1093
- maxWidth: "800px",
1094
- margin: "0 auto"
1095
- },
1096
- welcome: {
1097
- fontFamily: a,
1098
- color: c,
1099
- fontSize: r ? "0.875em" : "1em",
1100
- fontWeight: 400,
1101
- lineHeight: 1.5,
1102
- maxWidth: "800px",
1103
- margin: "0 auto",
1104
- opacity: 0.9
1105
- },
1106
- instructions: {
1107
- fontFamily: a,
1108
- color: c,
1109
- fontSize: r ? "1em" : "1.3em",
1110
- fontWeight: 500,
1111
- lineHeight: 1.5,
1112
- textAlign: "center"
1113
- },
1114
- disclaimer: {
1115
- fontFamily: a,
1116
- color: c,
1117
- fontSize: r ? "0.75em" : "0.875em",
1118
- fontWeight: 400,
1119
- lineHeight: 1.5,
1120
- textAlign: "center",
1121
- opacity: 0.7
1122
- },
1123
- leadSection: {
1124
- display: "flex",
1125
- flexDirection: "column",
1126
- gap: n.md,
1127
- backgroundColor: d,
1128
- borderRadius: s,
1129
- padding: r ? n.lg : n.xl,
1130
- maxWidth: "600px",
1131
- margin: "0 auto",
1132
- width: r ? `calc(100% - ${n.md} * 2)` : `calc(100% - ${n.lg} * 2)`,
1133
- boxShadow: "0 4px 12px rgba(0, 0, 0, 0.1)",
1134
- backdropFilter: "blur(4px)",
1135
- boxSizing: "border-box"
1136
- },
1137
- pairSection: {
1138
- display: "flex",
1139
- flexDirection: "column",
1140
- gap: n.md,
1141
- backgroundColor: d,
1142
- borderRadius: s,
1143
- px: r ? n.md : n.lg,
1144
- py: r ? n.md : n.lg,
1145
- maxWidth: "1200px",
1146
- margin: "0 auto",
1147
- width: r ? `calc(100% - ${n.md} * 2)` : `calc(100% - ${n.lg} * 2)`,
1148
- boxShadow: "0 4px 12px rgba(0, 0, 0, 0.1)",
1149
- overflow: "hidden",
1150
- boxSizing: "border-box"
1151
- },
1152
- footer: {
1153
- display: "flex",
1154
- flexDirection: "column",
1155
- justifyContent: "center",
1156
- alignItems: "center",
1157
- gap: n.sm
1158
- },
1159
- getTimeUpOverlayStyle: (o, i) => {
1160
- const b = (f, u) => {
1161
- const y = parseInt(f.slice(1, 3), 16), S = parseInt(f.slice(3, 5), 16), P = parseInt(f.slice(5, 7), 16);
1162
- return `rgba(${y}, ${S}, ${P}, ${u})`;
1163
- }, g = o.startsWith("#") ? b(o, 0.5) : o.startsWith("rgb") ? o.replace(")", ", 0.50)").replace("rgb", "rgba") : "rgba(0, 0, 0, 0.50)";
1164
- return {
1165
- position: i ? "relative" : "absolute",
1166
- top: i ? "auto" : 0,
1167
- left: i ? "auto" : 0,
1168
- right: i ? "auto" : 0,
1169
- bottom: i ? "auto" : 0,
1170
- minHeight: i ? "300px" : "auto",
1171
- // Match pairSection width and margins
1172
- maxWidth: "1200px",
1173
- margin: "0 auto",
1174
- width: i ? `calc(100% - ${n.md} * 2)` : "auto",
1175
- backgroundColor: g,
1176
- backdropFilter: "blur(4px)",
1177
- display: "flex",
1178
- flexDirection: "column",
1179
- alignItems: "center",
1180
- justifyContent: "center",
1181
- zIndex: 100,
1182
- borderRadius: s,
1183
- boxSizing: "border-box",
1184
- animation: "fadeIn 0.4s ease-out",
1185
- "@keyframes fadeIn": {
1186
- from: {
1187
- opacity: 0
1188
- },
1189
- to: {
1190
- opacity: 1
513
+ totalAttempts: e.totalAttempts,
514
+ accuracy: e.accuracy,
515
+ successThresholdPercent: e.pairData.config.successThresholdPercent,
516
+ meetsThreshold: e.meetsThreshold,
517
+ totalPairs: e.pairData.pairs.length,
518
+ matchedPairs: e.matchedPairs.length,
519
+ brandingColors: c,
520
+ bgcolor: k
1191
521
  }
1192
- }
1193
- };
1194
- },
1195
- timeUpText: {
1196
- color: "#FFFFFF",
1197
- fontWeight: 700,
1198
- fontSize: r ? "2em" : "3em",
1199
- lineHeight: 1.2,
1200
- textAlign: "center",
1201
- textShadow: "0 2px 20px rgba(0, 0, 0, 0.3)",
1202
- animation: "slideUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1)",
1203
- padding: r ? 2 : 3,
1204
- maxWidth: r ? "280px" : "500px",
1205
- "@keyframes slideUp": {
1206
- from: {
1207
- transform: "translateY(20px)",
1208
- opacity: 0
1209
- },
1210
- to: {
1211
- transform: "translateY(0)",
1212
- opacity: 1
1213
- }
1214
- }
1215
- }
1216
- };
1217
- }, rt = (e) => {
1218
- const {
1219
- primaryColor: n,
1220
- textColor: a,
1221
- whiteTextColor: c,
1222
- successColor: l,
1223
- dangerColor: s,
1224
- optionBackground: r,
1225
- surface: d,
1226
- mobile: o,
1227
- spacingScale: i,
1228
- xlBorderRadius: b,
1229
- borderSize: g
1230
- } = e;
1231
- return {
1232
- container: {
1233
- display: "flex",
1234
- flexDirection: o ? "column" : "row",
1235
- gap: o ? i.xs : i["2xl"],
1236
- width: "100%",
1237
- maxWidth: "100%",
1238
- boxSizing: "border-box",
1239
- overflow: "hidden",
1240
- bgcolor: d,
1241
- pt: o ? 0 : i["2xs"]
1242
- },
1243
- column: {
1244
- display: "flex",
1245
- flexDirection: "column",
1246
- gap: o ? i.xs : i.sm,
1247
- flex: 1,
1248
- minWidth: 0,
1249
- maxWidth: "100%"
1250
- },
1251
- getColumnItemStyle: (f, u, y, S) => ({
1252
- display: "flex",
1253
- alignItems: "center",
1254
- gap: i["2xs"],
1255
- justifyContent: "space-between",
1256
- padding: `${i.xs} ${i.sm}`,
1257
- backgroundColor: S ? s : y ? l : u ? n : r,
1258
- borderTopLeftRadius: f === "left" && o ? "0px" : b,
1259
- borderBottomLeftRadius: f === "left" && o ? "0px" : b,
1260
- borderTopRightRadius: f === "right" && o ? "0px" : b,
1261
- borderBottomRightRadius: f === "right" && o ? "0px" : b,
1262
- cursor: "pointer",
1263
- transition: "all 0.3s ease",
1264
- position: "relative",
1265
- minHeight: o ? "48px" : "56px",
1266
- width: o ? "90%" : "100%",
1267
- maxWidth: "100%",
1268
- boxSizing: "border-box",
1269
- overflow: "visible",
1270
- border: `${g} solid ${u && !y && !S ? n : "transparent"}`,
1271
- WebkitTapHighlightColor: "transparent",
1272
- marginLeft: o && f === "right" ? "auto" : 0,
1273
- marginRight: o && f === "left" ? "auto" : 0,
1274
- "&:hover": u || y || S ? {} : {
1275
- border: `${g} solid ${n}`,
1276
- backgroundColor: r,
1277
- transform: "translateY(-2px)"
1278
- }
1279
- }),
1280
- disabledItem: {
1281
- opacity: 0.5,
1282
- cursor: "not-allowed",
1283
- "&:hover": {
1284
- transform: "none"
1285
- }
1286
- },
1287
- errorItem: {
1288
- animation: "shake 0.3s",
1289
- cursor: "not-allowed",
1290
- pointerEvents: "none",
1291
- "@keyframes shake": {
1292
- "0%, 100%": { transform: "translateX(0)" },
1293
- "25%": { transform: "translateX(-5px)" },
1294
- "75%": { transform: "translateX(5px)" }
1295
- }
1296
- },
1297
- getImageContainerStyle: (f, u, y) => ({
1298
- width: o ? "48px" : "56px",
1299
- height: o ? "48px" : "56px",
1300
- borderRadius: "50%",
1301
- overflow: "hidden",
1302
- backgroundColor: "#FFFFFF",
1303
- flexShrink: 0,
1304
- position: "absolute",
1305
- top: "50%",
1306
- transform: "translateY(-50%)",
1307
- zIndex: 10,
1308
- ...y === "left" ? { right: o ? "-12px" : "-14px" } : { left: o ? "-12px" : "-14px" },
1309
- border: u ? `${g} solid ${s}` : f ? `${g} solid ${l}` : `${g} solid ${n}`,
1310
- boxShadow: "0 2px 12px rgba(0, 0, 0, 0.15)"
1311
- }),
1312
- textContainer: {
1313
- display: "flex",
1314
- flexDirection: "column",
1315
- gap: i["2xs"],
1316
- flex: 1,
1317
- minWidth: 0,
1318
- justifyContent: "center"
1319
- },
1320
- getOptionTitleStyle: (f, u, y, S) => ({
1321
- color: u || y || S ? c : a,
1322
- fontWeight: 600,
1323
- fontSize: o ? "0.8125em" : "0.9375em",
1324
- lineHeight: 1.3,
1325
- wordBreak: "break-word",
1326
- overflowWrap: "break-word",
1327
- textWrap: "balance",
1328
- textAlign: f === "right" ? "right" : "left"
1329
- }),
1330
- getOptionSubtitleStyle: (f, u, y, S) => ({
1331
- color: u || y || S ? c : a,
1332
- opacity: 0.7,
1333
- fontSize: o ? "0.6875em" : "0.8125em",
1334
- lineHeight: 1.3,
1335
- wordBreak: "break-word",
1336
- overflowWrap: "break-word",
1337
- textWrap: "balance",
1338
- textAlign: f === "right" ? "right" : "left"
1339
- }),
1340
- matchIndicator: {
1341
- position: "absolute",
1342
- right: o ? i.xs : i.sm,
1343
- top: "50%",
1344
- transform: "translateY(-50%)"
1345
- }
1346
- };
1347
- }, ct = ({
1348
- pairs: e,
1349
- order: n,
1350
- matchedPairs: a,
1351
- selectedLeft: c,
1352
- selectedRight: l,
1353
- showError: s,
1354
- onSelectLeft: r,
1355
- onSelectRight: d,
1356
- brandingColors: o,
1357
- disabled: i = !1,
1358
- isTimeUp: b = !1
1359
- }) => {
1360
- const g = Z(), f = ge(), u = X(), y = Be(), S = te(), P = ee().xl, I = me().size, F = (o == null ? void 0 : o.primary_color) || u.palette.primary.plainColor, k = (o == null ? void 0 : o.content_color) || f.colorSchemes.light.textColor, Y = f.colorSchemes.dark.textColor, L = u.palette.success.plainColor, U = u.palette.danger.plainColor, D = y === "dark" ? "#FFFFFF" : u.onSurface, A = u.surface, v = rt({
1361
- primaryColor: F,
1362
- textColor: k,
1363
- whiteTextColor: Y,
1364
- successColor: L,
1365
- dangerColor: U,
1366
- optionBackground: D,
1367
- surface: A,
1368
- mobile: g,
1369
- spacingScale: S,
1370
- xlBorderRadius: P,
1371
- borderSize: I
1372
- }), _ = xe(
1373
- () => ve(e, n),
1374
- [e, n]
1375
- ), O = (C) => e.find((m) => m.id === C), H = (C) => a.some((m) => m.leftId === C), T = (C) => a.some((m) => m.rightId === C), h = (C, m) => {
1376
- var j, q, J;
1377
- const R = O(C);
1378
- if (!R) return null;
1379
- const $ = m === "left" ? H(C) : T(C), B = m === "left" && c === C || m === "right" && l === C, E = (B || $) && R.images, N = g ? ((j = R.images) == null ? void 0 : j.mobile) || ((q = R.images) == null ? void 0 : q.main) : (J = R.images) == null ? void 0 : J.main, W = m === "left" ? R.optionA : R.optionB, V = () => {
1380
- i || s || b || (m === "left" ? r(C) : d(C));
1381
- }, z = s && B, M = s && !B;
1382
- return /* @__PURE__ */ p(
1383
- x,
1384
- {
1385
- onClick: V,
1386
- sx: [
1387
- v.getColumnItemStyle(m, B, $, z),
1388
- (i || M) && v.disabledItem,
1389
- z && v.errorItem
1390
- ],
1391
- children: [
1392
- m === "right" && E && N && /* @__PURE__ */ t(x, { sx: v.getImageContainerStyle($, z, m), children: /* @__PURE__ */ t(
1393
- "img",
522
+ ) }),
523
+ r ? /* @__PURE__ */ n("div", { css: S.leadCollectionContainer, children: /* @__PURE__ */ L("div", { css: S.leadQuestionContainer, children: [
524
+ /* @__PURE__ */ n("div", { css: S.leadContentContainer, children: /* @__PURE__ */ n(
525
+ ve,
1394
526
  {
1395
- loading: "lazy",
1396
- src: N,
1397
- alt: W.title,
1398
- style: { width: "100%", height: "100%", objectFit: "cover" }
527
+ sdk: e.sdk,
528
+ contentId: e.infoPage.id,
529
+ contentType: e.infoPage.type,
530
+ onSuccessLabel: ((M = e.infoPage.labels) == null ? void 0 : M.buttonLabel) || o("pickThePair.buttons.submit"),
531
+ contentName: e.infoPage.title,
532
+ brandingColors: (s = e.infoPage.branding) == null ? void 0 : s.colors,
533
+ brandingUrls: (R = e.infoPage.branding) == null ? void 0 : R.urls,
534
+ campaignId: (d = e.leads) == null ? void 0 : d.campaignId,
535
+ campaignName: (C = e.leads) == null ? void 0 : C.campaignName,
536
+ fields: (N = e.leads) == null ? void 0 : N.fields,
537
+ leadTitle: (O = e.infoPage.labels) == null ? void 0 : O.leadTitle,
538
+ leadDescription: (Y = e.infoPage.labels) == null ? void 0 : Y.leadDescription,
539
+ leadCta: (G = e.infoPage.labels) == null ? void 0 : G.leadCta,
540
+ leadSuccessTitle: (q = e.infoPage.labels) == null ? void 0 : q.successTitle,
541
+ leadSuccessDescription: (K = e.infoPage.labels) == null ? void 0 : K.successDescription,
542
+ syncWithProfile: (Q = e.leads) == null ? void 0 : Q.syncWithProfile,
543
+ isSubmittingParticipation: !h || e.isChallengeMode && !e.meetsThreshold
1399
544
  }
1400
545
  ) }),
1401
- /* @__PURE__ */ p(x, { sx: v.textContainer, children: [
1402
- /* @__PURE__ */ t(
1403
- w,
546
+ F()
547
+ ] }) }) : /* @__PURE__ */ L(ae, { children: [
548
+ a && e.isTimeUp ? ((ie = e.infoPage.labels) == null ? void 0 : ie.timeUp) && b : /* @__PURE__ */ n("div", { css: S.questionArea, children: /* @__PURE__ */ n("div", { css: S.questionContainer, children: /* @__PURE__ */ L("div", { css: S.questionContentContainer, children: [
549
+ ((ne = e.infoPage.labels) == null ? void 0 : ne.instructions) && /* @__PURE__ */ n("p", { css: S.instructions, children: e.infoPage.labels.instructions }),
550
+ /* @__PURE__ */ n(
551
+ Ce,
1404
552
  {
1405
- level: "body-md",
1406
- sx: v.getOptionTitleStyle(
1407
- m,
1408
- B,
1409
- $,
1410
- z
1411
- ),
1412
- children: W.title
553
+ compact: !0,
554
+ pairs: e.pairData.pairs,
555
+ order: e.pairData.config.order,
556
+ matchedPairs: e.matchedPairs,
557
+ selectedLeft: e.selectedLeft,
558
+ selectedRight: e.selectedRight,
559
+ showError: e.showError,
560
+ onSelectLeft: e.onSelectLeft,
561
+ onSelectRight: e.onSelectRight,
562
+ brandingColors: c,
563
+ disabled: !1,
564
+ isTimeUp: e.isTimeUp
1413
565
  }
1414
566
  ),
1415
- W.subtitle && /* @__PURE__ */ t(
1416
- w,
567
+ e.isTimeUp && ((Ie = e.infoPage.labels) == null ? void 0 : Ie.timeUp) && b
568
+ ] }) }) }),
569
+ /* @__PURE__ */ L("div", { css: m ? y ? S.footerXs : S.footer : y ? S.footerNoLogoXs : S.footerNoLogo, children: [
570
+ m && !y && F(),
571
+ /* @__PURE__ */ n(
572
+ Zt,
1417
573
  {
1418
- level: "body-sm",
1419
- sx: v.getOptionSubtitleStyle(
1420
- m,
1421
- B,
1422
- $,
1423
- z
1424
- ),
1425
- children: W.subtitle
574
+ disabled: !h || e.isChallengeMode && !e.meetsThreshold,
575
+ label: o("pickThePair.buttons.continue"),
576
+ buttonColor: (c == null ? void 0 : c.primary_color) || u.palette.primary.plainColor,
577
+ onClick: () => p(!0)
1426
578
  }
1427
579
  )
1428
580
  ] }),
1429
- m === "left" && E && N && /* @__PURE__ */ t(x, { sx: v.getImageContainerStyle($, z, m), children: /* @__PURE__ */ t(
1430
- "img",
1431
- {
1432
- loading: "lazy",
1433
- src: N,
1434
- alt: W.title,
1435
- style: { width: "100%", height: "100%", objectFit: "cover" }
1436
- }
1437
- ) })
1438
- ]
1439
- },
1440
- C
1441
- );
1442
- };
1443
- return /* @__PURE__ */ p(x, { sx: v.container, children: [
1444
- /* @__PURE__ */ t(x, { sx: v.column, children: _.columnA.map((C) => h(C, "left")) }),
1445
- /* @__PURE__ */ t(x, { sx: v.column, children: _.columnB.map((C) => h(C, "right")) })
1446
- ] });
1447
- }, st = (e) => {
1448
- var S, P, I, F, k, Y, L, U, D, A, v, _, O, H, T, h, C, m, R, $, B, E, N, W, V, z, M, j, q;
1449
- const { t: n } = re(), a = Z(), c = ((S = e.infoPage.branding) == null ? void 0 : S.colors) || null, l = fe(
581
+ m && y && F()
582
+ ] })
583
+ ] })
584
+ }
585
+ ) });
586
+ }, H = { ...E, fontFamily: t.fontPrimary, color: t.text, lineHeight: 1.5, unicodeBidi: "plaintext" }, xt = {
587
+ display: "flex",
588
+ flexDirection: "column",
589
+ gap: t.spaceMd,
590
+ backgroundColor: t.surface,
591
+ borderRadius: t.radiusMd,
592
+ margin: "0 auto",
593
+ boxShadow: "0 4px 12px rgba(0, 0, 0, 0.1)",
594
+ boxSizing: "border-box"
595
+ }, Ve = { ...xt, maxWidth: "1200px", overflow: "hidden", position: "relative" }, Ye = { ...xt, maxWidth: "600px", backdropFilter: "blur(4px)" }, Ge = {
596
+ maxWidth: "1200px",
597
+ margin: "0 auto",
598
+ backgroundColor: t.timeUp,
599
+ backdropFilter: "blur(4px)",
600
+ display: "flex",
601
+ flexDirection: "column",
602
+ alignItems: "center",
603
+ justifyContent: "center",
604
+ zIndex: 100,
605
+ borderRadius: t.radiusMd,
606
+ boxSizing: "border-box",
607
+ animation: `${ot} 0.4s ease-out`
608
+ }, qe = {
609
+ ...E,
610
+ fontFamily: re,
611
+ letterSpacing: le,
612
+ color: "#FFFFFF",
613
+ fontWeight: 700,
614
+ lineHeight: 1.2,
615
+ textAlign: "center",
616
+ textShadow: "0 2px 20px rgba(0, 0, 0, 0.3)",
617
+ unicodeBidi: "plaintext",
618
+ animation: `${lt} 0.5s cubic-bezier(0.34, 1.56, 0.64, 1)`
619
+ }, ti = {
620
+ display: "flex",
621
+ flexDirection: "column",
622
+ justifyContent: "center",
623
+ alignItems: "center",
624
+ width: "100%",
625
+ overflow: "hidden"
626
+ }, Ke = { display: "flex", flexDirection: "column", gap: t.spaceMd, textAlign: "center" }, ge = { maxWidth: "800px", margin: "0 auto" }, x = {
627
+ container: i({
628
+ display: "flex",
629
+ flexDirection: "column",
630
+ width: "100%",
631
+ minHeight: "100vh",
632
+ backgroundColor: t.panel,
633
+ gap: t.space3xl,
634
+ overflowX: "hidden"
635
+ }),
636
+ heroSection: i(ti),
637
+ heroImage: i({ width: "100%", height: "auto", display: "block" }),
638
+ header: i(Ke, { padding: `0 ${t.spaceLg}` }),
639
+ headerMobile: i(Ke, { padding: `0 ${t.spaceMd}` }),
640
+ title: i(H, { letterSpacing: le, fontSize: "2.25em", fontWeight: 700, lineHeight: 1.2 }),
641
+ titleMobile: i(H, { letterSpacing: le, fontSize: "1.75em", fontWeight: 700, lineHeight: 1.2 }),
642
+ subtitle: i(H, ge, { fontSize: "1.125em", fontWeight: 400 }),
643
+ subtitleMobile: i(H, ge, { fontSize: "1em", fontWeight: 400 }),
644
+ welcome: i(H, ge, { fontSize: "1em", fontWeight: 400, opacity: 0.9 }),
645
+ welcomeMobile: i(H, ge, { fontSize: "0.875em", fontWeight: 400, opacity: 0.9 }),
646
+ stopwatch: i({ display: "flex", justifyContent: "center" }),
647
+ pairSection: i(Ve, {
648
+ paddingInline: t.spaceLg,
649
+ paddingBlock: t.spaceLg,
650
+ width: `calc(100% - ${t.spaceLg} * 2)`
651
+ }),
652
+ pairSectionMobile: i(Ve, {
653
+ paddingInline: t.spaceMd,
654
+ paddingBlock: t.spaceMd,
655
+ width: `calc(100% - ${t.spaceMd} * 2)`
656
+ }),
657
+ instructions: i(H, { fontSize: "1.3em", fontWeight: 500, textAlign: "center" }),
658
+ instructionsMobile: i(H, { fontSize: "1em", fontWeight: 500, textAlign: "center" }),
659
+ // Over the game on desktop; in its place on mobile.
660
+ timeUpOverlay: i(Ge, { position: "absolute", top: 0, left: 0, right: 0, bottom: 0 }),
661
+ timeUpOverlayMobile: i(Ge, {
662
+ position: "relative",
663
+ minHeight: "300px",
664
+ width: `calc(100% - ${t.spaceMd} * 2)`
665
+ }),
666
+ timeUpText: i(qe, { fontSize: "3em", padding: "24px", maxWidth: "500px" }),
667
+ timeUpTextMobile: i(qe, { fontSize: "2em", padding: "16px", maxWidth: "280px" }),
668
+ leadSection: i(Ye, { padding: t.spaceXl, width: `calc(100% - ${t.spaceLg} * 2)` }),
669
+ leadSectionMobile: i(Ye, { padding: t.spaceLg, width: `calc(100% - ${t.spaceMd} * 2)` }),
670
+ footer: i({
671
+ display: "flex",
672
+ flexDirection: "column",
673
+ justifyContent: "center",
674
+ alignItems: "center",
675
+ gap: t.spaceSm
676
+ }),
677
+ disclaimer: i(H, { fontSize: "0.875em", fontWeight: 400, textAlign: "center", opacity: 0.7 }),
678
+ disclaimerMobile: i(H, { fontSize: "0.75em", fontWeight: 400, textAlign: "center", opacity: 0.7 }),
679
+ logo: i({ height: "auto", maxHeight: "120px", maxWidth: "360px" })
680
+ }, ii = (e) => {
681
+ var y, W, U, k, I, h, A, F, b, P, f, v, z, w, _, D, $, B, M, s, R, d, C, N, O, Y, G, q, K, Q;
682
+ const { t: o } = ce(), a = ee(), l = ((y = e.infoPage.branding) == null ? void 0 : y.colors) || null, u = Se(
1450
683
  {
1451
684
  images: e.infoPage.images,
1452
685
  imagePlaceholder: e.defaultImagePlaceholderUrl || ""
1453
686
  },
1454
- ue.STANDARD
1455
- ), s = e.matchedPairs.length === e.pairData.pairs.length, r = X(), d = (c == null ? void 0 : c.content_color) || r.textColor, o = ae().primary, i = (c == null ? void 0 : c.background_color) || r.surfaceVariant, b = ee().md, g = (c == null ? void 0 : c.primary_color) || r.palette.primary.plainColor, f = te(), u = r.surface, y = at({
1456
- spacingScale: f,
1457
- fontFamilyPrimary: o,
1458
- textColor: d,
1459
- bgcolor: se(i || ""),
1460
- mdBorderRadius: b,
1461
- primaryColor: g,
1462
- mobile: a,
1463
- surface: u
1464
- });
1465
- return /* @__PURE__ */ p(x, { sx: y.container, children: [
1466
- l && /* @__PURE__ */ t(x, { sx: y.heroSection, children: /* @__PURE__ */ t(
1467
- "img",
1468
- {
1469
- src: l,
1470
- alt: e.infoPage.title,
1471
- style: {
1472
- width: "100%",
1473
- height: "auto",
1474
- display: "block"
1475
- }
1476
- }
1477
- ) }),
1478
- /* @__PURE__ */ p(x, { sx: y.header, children: [
1479
- /* @__PURE__ */ t(w, { level: "h1", sx: y.title, children: e.infoPage.title }),
1480
- e.infoPage.subtitle && /* @__PURE__ */ t(w, { level: "body-lg", sx: y.subtitle, children: e.infoPage.subtitle }),
1481
- ((P = e.infoPage.labels) == null ? void 0 : P.welcome) && /* @__PURE__ */ t(w, { level: "body-md", sx: y.welcome, children: e.infoPage.labels.welcome })
687
+ Te.STANDARD
688
+ ), c = e.matchedPairs.length === e.pairData.pairs.length, m = te(), g = it((l == null ? void 0 : l.background_color) || m.surfaceVariant || ""), r = (l == null ? void 0 : l.primary_color) || m.palette.primary.plainColor, p = {
689
+ "--fu-ucrc-ptp-text": (l == null ? void 0 : l.content_color) || m.textColor,
690
+ "--fu-ucrc-ptp-panel": `rgba(${g ? g.replace(/[^\d,]/g, "") : ""}, 0.5)`,
691
+ "--fu-ucrc-ptp-time-up": ct(r, 0.5)
692
+ }, T = /* @__PURE__ */ n("div", { css: a ? x.timeUpOverlayMobile : x.timeUpOverlay, children: /* @__PURE__ */ n("h1", { css: a ? x.timeUpTextMobile : x.timeUpText, children: (W = e.infoPage.labels) == null ? void 0 : W.timeUp }) });
693
+ return /* @__PURE__ */ L("div", { css: x.container, style: p, children: [
694
+ u && /* @__PURE__ */ n("div", { css: x.heroSection, children: /* @__PURE__ */ n("img", { css: x.heroImage, src: u, alt: e.infoPage.title }) }),
695
+ /* @__PURE__ */ L("div", { css: a ? x.headerMobile : x.header, children: [
696
+ /* @__PURE__ */ n("h1", { css: a ? x.titleMobile : x.title, children: e.infoPage.title }),
697
+ e.infoPage.subtitle && /* @__PURE__ */ n("p", { css: a ? x.subtitleMobile : x.subtitle, children: e.infoPage.subtitle }),
698
+ ((U = e.infoPage.labels) == null ? void 0 : U.welcome) && /* @__PURE__ */ n("p", { css: a ? x.welcomeMobile : x.welcome, children: e.infoPage.labels.welcome })
1482
699
  ] }),
1483
- e.pairData.config.timeLimit > 0 && /* @__PURE__ */ t(
1484
- x,
700
+ e.pairData.config.timeLimit > 0 && /* @__PURE__ */ n("div", { css: x.stopwatch, children: /* @__PURE__ */ n(
701
+ Le,
1485
702
  {
1486
- sx: {
1487
- display: "flex",
1488
- justifyContent: "center"
1489
- },
1490
- children: /* @__PURE__ */ t(
1491
- be,
1492
- {
1493
- isRunning: e.isTimerRunning,
1494
- timer: e.timer,
1495
- initialTime: e.pairData.config.timeLimit,
1496
- brandingPrimaryColor: g,
1497
- onTimeUpdate: e.onTimeUpdate
1498
- }
1499
- )
703
+ isRunning: e.isTimerRunning,
704
+ timer: e.timer,
705
+ initialTime: e.pairData.config.timeLimit,
706
+ brandingPrimaryColor: r,
707
+ onTimeUpdate: e.onTimeUpdate
1500
708
  }
1501
- ),
1502
- e.isChallengeMode && /* @__PURE__ */ t(
1503
- ye,
709
+ ) }),
710
+ e.isChallengeMode && /* @__PURE__ */ n(
711
+ Ue,
1504
712
  {
1505
713
  totalAttempts: e.totalAttempts,
1506
714
  accuracy: e.accuracy,
@@ -1508,78 +716,89 @@ const Ie = ({
1508
716
  meetsThreshold: e.meetsThreshold,
1509
717
  totalPairs: e.pairData.pairs.length,
1510
718
  matchedPairs: e.matchedPairs.length,
1511
- brandingColors: c,
1512
- bgcolor: u
719
+ brandingColors: l,
720
+ bgcolor: m.surface
1513
721
  }
1514
722
  ),
1515
- a && e.isTimeUp ? (
1516
- // Mobile: Time's Up - Show only overlay with fixed height
1517
- ((I = e.infoPage.labels) == null ? void 0 : I.timeUp) && /* @__PURE__ */ t(x, { sx: y.getTimeUpOverlayStyle(g, a), children: /* @__PURE__ */ t(w, { level: "h1", sx: y.timeUpText, children: e.infoPage.labels.timeUp }) })
1518
- ) : (
1519
- // Desktop or mobile with time remaining - Show full section
1520
- /* @__PURE__ */ p(x, { sx: { ...y.pairSection, position: "relative" }, children: [
1521
- ((F = e.infoPage.labels) == null ? void 0 : F.instructions) && /* @__PURE__ */ t(w, { level: "title-md", sx: y.instructions, children: e.infoPage.labels.instructions }),
1522
- /* @__PURE__ */ t(
1523
- ct,
1524
- {
1525
- pairs: e.pairData.pairs,
1526
- order: e.pairData.config.order,
1527
- matchedPairs: e.matchedPairs,
1528
- selectedLeft: e.selectedLeft,
1529
- selectedRight: e.selectedRight,
1530
- showError: e.showError,
1531
- onSelectLeft: e.onSelectLeft,
1532
- onSelectRight: e.onSelectRight,
1533
- brandingColors: c,
1534
- disabled: !1,
1535
- isTimeUp: e.isTimeUp
1536
- }
1537
- ),
1538
- e.isTimeUp && ((k = e.infoPage.labels) == null ? void 0 : k.timeUp) && /* @__PURE__ */ t(x, { sx: y.getTimeUpOverlayStyle(g, a), children: /* @__PURE__ */ t(w, { level: "h1", sx: y.timeUpText, children: e.infoPage.labels.timeUp }) })
1539
- ] })
1540
- ),
1541
- /* @__PURE__ */ t(x, { sx: y.leadSection, children: /* @__PURE__ */ t(
1542
- he,
723
+ a && e.isTimeUp ? ((k = e.infoPage.labels) == null ? void 0 : k.timeUp) && T : /* @__PURE__ */ L("div", { css: a ? x.pairSectionMobile : x.pairSection, children: [
724
+ ((I = e.infoPage.labels) == null ? void 0 : I.instructions) && /* @__PURE__ */ n("p", { css: a ? x.instructionsMobile : x.instructions, children: e.infoPage.labels.instructions }),
725
+ /* @__PURE__ */ n(
726
+ Ce,
727
+ {
728
+ pairs: e.pairData.pairs,
729
+ order: e.pairData.config.order,
730
+ matchedPairs: e.matchedPairs,
731
+ selectedLeft: e.selectedLeft,
732
+ selectedRight: e.selectedRight,
733
+ showError: e.showError,
734
+ onSelectLeft: e.onSelectLeft,
735
+ onSelectRight: e.onSelectRight,
736
+ brandingColors: l,
737
+ disabled: !1,
738
+ isTimeUp: e.isTimeUp
739
+ }
740
+ ),
741
+ e.isTimeUp && ((h = e.infoPage.labels) == null ? void 0 : h.timeUp) && T
742
+ ] }),
743
+ /* @__PURE__ */ n("div", { css: a ? x.leadSectionMobile : x.leadSection, children: /* @__PURE__ */ n(
744
+ ve,
1543
745
  {
1544
746
  sdk: e.sdk,
1545
747
  contentType: e.infoPage.type,
1546
748
  contentId: e.infoPage.id,
1547
- onSuccessLabel: ((Y = e.infoPage.labels) == null ? void 0 : Y.buttonLabel) || n("pickThePair.buttons.submit"),
749
+ onSuccessLabel: ((A = e.infoPage.labels) == null ? void 0 : A.buttonLabel) || o("pickThePair.buttons.submit"),
1548
750
  contentName: e.infoPage.title,
1549
- brandingColors: (L = e.infoPage.branding) == null ? void 0 : L.colors,
1550
- brandingUrls: (U = e.infoPage.branding) == null ? void 0 : U.urls,
1551
- campaignId: (D = e.leads) == null ? void 0 : D.campaignId,
1552
- campaignName: (A = e.leads) == null ? void 0 : A.campaignName,
751
+ brandingColors: (F = e.infoPage.branding) == null ? void 0 : F.colors,
752
+ brandingUrls: (b = e.infoPage.branding) == null ? void 0 : b.urls,
753
+ campaignId: (P = e.leads) == null ? void 0 : P.campaignId,
754
+ campaignName: (f = e.leads) == null ? void 0 : f.campaignName,
1553
755
  fields: (v = e.leads) == null ? void 0 : v.fields,
1554
- leadTitle: (_ = e.infoPage.labels) == null ? void 0 : _.leadTitle,
1555
- leadDescription: (O = e.infoPage.labels) == null ? void 0 : O.leadDescription,
1556
- leadCta: (H = e.infoPage.labels) == null ? void 0 : H.buttonLabel,
1557
- leadSuccessTitle: (T = e.infoPage.labels) == null ? void 0 : T.successTitle,
1558
- leadSuccessDescription: (h = e.infoPage.labels) == null ? void 0 : h.successDescription,
1559
- syncWithProfile: (C = e.leads) == null ? void 0 : C.syncWithProfile,
1560
- isSubmittingParticipation: !s || e.isChallengeMode && !e.meetsThreshold
756
+ leadTitle: (z = e.infoPage.labels) == null ? void 0 : z.leadTitle,
757
+ leadDescription: (w = e.infoPage.labels) == null ? void 0 : w.leadDescription,
758
+ leadCta: (_ = e.infoPage.labels) == null ? void 0 : _.buttonLabel,
759
+ leadSuccessTitle: (D = e.infoPage.labels) == null ? void 0 : D.successTitle,
760
+ leadSuccessDescription: ($ = e.infoPage.labels) == null ? void 0 : $.successDescription,
761
+ syncWithProfile: (B = e.leads) == null ? void 0 : B.syncWithProfile,
762
+ isSubmittingParticipation: !c || e.isChallengeMode && !e.meetsThreshold
1561
763
  }
1562
764
  ) }),
1563
- (((R = (m = e.infoPage.branding) == null ? void 0 : m.images) == null ? void 0 : R.main_logo) || (($ = e.infoPage.labels) == null ? void 0 : $.disclaimer)) && /* @__PURE__ */ p(x, { sx: y.footer, children: [
1564
- ((B = e.infoPage.labels) == null ? void 0 : B.disclaimer) && /* @__PURE__ */ t(w, { level: "body-sm", sx: y.disclaimer, children: e.infoPage.labels.disclaimer }),
1565
- ((N = (E = e.infoPage.branding) == null ? void 0 : E.images) == null ? void 0 : N.main_logo) && /* @__PURE__ */ t(
765
+ (((s = (M = e.infoPage.branding) == null ? void 0 : M.images) == null ? void 0 : s.main_logo) || ((R = e.infoPage.labels) == null ? void 0 : R.disclaimer)) && /* @__PURE__ */ L("div", { css: x.footer, children: [
766
+ ((d = e.infoPage.labels) == null ? void 0 : d.disclaimer) && /* @__PURE__ */ n("p", { css: a ? x.disclaimerMobile : x.disclaimer, children: e.infoPage.labels.disclaimer }),
767
+ ((N = (C = e.infoPage.branding) == null ? void 0 : C.images) == null ? void 0 : N.main_logo) && /* @__PURE__ */ n(
1566
768
  "img",
1567
769
  {
1568
- src: a ? ((V = (W = e.infoPage.branding) == null ? void 0 : W.images) == null ? void 0 : V.mobile_logo) || ((M = (z = e.infoPage.branding) == null ? void 0 : z.images) == null ? void 0 : M.main_logo) : (q = (j = e.infoPage.branding) == null ? void 0 : j.images) == null ? void 0 : q.main_logo,
1569
- alt: "Brand Logo",
1570
- style: { height: "auto", maxHeight: "120px", maxWidth: "360px" }
770
+ css: x.logo,
771
+ src: a ? ((Y = (O = e.infoPage.branding) == null ? void 0 : O.images) == null ? void 0 : Y.mobile_logo) || ((q = (G = e.infoPage.branding) == null ? void 0 : G.images) == null ? void 0 : q.main_logo) : (Q = (K = e.infoPage.branding) == null ? void 0 : K.images) == null ? void 0 : Q.main_logo,
772
+ alt: "Brand Logo"
1571
773
  }
1572
774
  )
1573
775
  ] })
1574
776
  ] });
1575
- }, dt = (e) => ({
1576
- // Content container with backdrop
1577
- contentContainerWithBackdrop: {
1578
- borderRadius: e.mdBorderRadius,
1579
- p: e.spacingScale.md,
777
+ }, Qe = {
778
+ fontFamily: t.fontPrimary,
779
+ fontWeight: 500,
780
+ fontSize: "0.9375em",
781
+ lineHeight: "24px",
782
+ letterSpacing: "0.46px",
783
+ textTransform: "uppercase"
784
+ }, Je = {
785
+ ...E,
786
+ fontFamily: t.fontPrimary,
787
+ color: t.text,
788
+ fontWeight: 400,
789
+ lineHeight: 1.5,
790
+ maxWidth: "800px",
791
+ margin: "0 auto",
792
+ opacity: 0.9,
793
+ unicodeBidi: "plaintext"
794
+ }, Ze = { display: "flex", alignItems: "center", gap: t.spaceMd }, X = {
795
+ // The background colour at 50% sits on a pseudo-element, so the content stays opaque.
796
+ contentContainerWithBackdrop: i({
797
+ borderRadius: t.radiusMd,
798
+ padding: t.spaceMd,
1580
799
  display: "flex",
1581
800
  flexDirection: "column",
1582
- gap: e.spacingScale.md,
801
+ gap: t.spaceMd,
1583
802
  backdropFilter: "blur(4px)",
1584
803
  position: "relative",
1585
804
  "&::before": {
@@ -1589,168 +808,102 @@ const Ie = ({
1589
808
  left: 0,
1590
809
  right: 0,
1591
810
  bottom: 0,
1592
- backgroundColor: e.contentBgColor,
811
+ backgroundColor: t.panel,
1593
812
  opacity: 0.5,
1594
813
  borderRadius: "inherit",
1595
814
  zIndex: 0
1596
815
  },
1597
- "& > *": {
1598
- position: "relative",
1599
- zIndex: 1
1600
- },
816
+ "& > *": { position: "relative", zIndex: 1 },
1601
817
  zIndex: 2
1602
- },
1603
- // Main content section
1604
- mainContentSection: {
1605
- display: "flex",
1606
- flexDirection: "column",
1607
- gap: e.spacingScale.md
1608
- },
1609
- // Stopwatch container
1610
- stopwatchContainer: {
1611
- display: "flex",
1612
- justifyContent: "center"
1613
- },
1614
- // Instructions text
1615
- instructions: {
1616
- fontFamily: e.fontFamilyPrimary,
818
+ }),
819
+ centered: i({ display: "flex", justifyContent: "center" }),
820
+ instructions: i(E, {
821
+ fontFamily: t.fontPrimary,
1617
822
  fontWeight: 400,
1618
823
  fontSize: "1em",
1619
824
  lineHeight: "24px",
1620
- color: e.darkTextColor,
1621
- textAlign: "center"
1622
- },
1623
- // Continue button
1624
- continueButton: {
1625
- borderRadius: e.buttonRadius,
1626
- backgroundColor: e.primaryColor,
1627
- color: e.onPrimaryColor,
1628
- fontFamily: e.fontFamilyPrimary,
1629
- fontWeight: 500,
1630
- fontSize: "0.9375em",
1631
- lineHeight: "24px",
1632
- letterSpacing: "0.46px",
1633
- textTransform: "uppercase",
825
+ color: "var(--fu-ucrc-text-color)",
826
+ textAlign: "center",
827
+ unicodeBidi: "plaintext"
828
+ }),
829
+ continueButton: i(Wt, Qe, {
830
+ borderRadius: "var(--fu-ucrc-ptp-button-radius)",
831
+ backgroundColor: t.primary,
832
+ color: "var(--fu-ucrc-ptp-on-primary)",
1634
833
  padding: "12px 24px",
1635
- "&:hover": {
1636
- backgroundColor: e.primaryColor,
1637
- opacity: 0.9
1638
- },
1639
- "&:disabled": {
1640
- backgroundColor: e.primaryColor,
1641
- opacity: 0.5,
1642
- cursor: "not-allowed"
1643
- }
1644
- },
1645
- // Presented by container
1646
- presentedByContainer: {
1647
- display: "flex",
1648
- justifyContent: "center"
1649
- },
1650
- // Challenge stats container
1651
- challengeStatsContainer: {
1652
- display: "flex",
1653
- justifyContent: "center"
1654
- },
1655
- // Bottom footer container
1656
- bottomFooterContainer: {
1657
- display: "flex",
1658
- alignItems: "center",
1659
- justifyContent: e.isMobile ? "center" : "space-between",
1660
- flexDirection: e.isMobile ? "column-reverse" : "row",
1661
- gap: e.spacingScale.md
1662
- },
1663
- welcome: {
1664
- fontFamily: e.fontFamilyPrimary,
1665
- color: e.textColor,
1666
- fontSize: e.isExtraSmall ? "0.875em" : "1em",
1667
- fontWeight: 400,
1668
- lineHeight: 1.5,
1669
- maxWidth: "800px",
1670
- margin: "0 auto",
1671
- opacity: 0.9
1672
- }
1673
- }), mt = (e) => {
1674
- var _, O, H, T, h, C, m, R, $, B, E, N;
1675
- const [n, a] = G.useState(!1), c = te(), l = ge(), { t: s } = re(), r = Z(), d = ke(), { brandingImage: o, brandingColors: i, brandingLogo: b } = Ae(e.infoPage.branding || null), g = e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : r ? $e : _e, f = o || fe(
834
+ "&:hover": { opacity: 0.9 },
835
+ "&:disabled": { opacity: 0.5, cursor: "not-allowed" }
836
+ }),
837
+ continueLabel: i(E, Qe, { color: "var(--fu-ucrc-ptp-on-primary)" }),
838
+ footer: i(Ze, { justifyContent: "space-between", flexDirection: "row" }),
839
+ footerMobile: i(Ze, { justifyContent: "center", flexDirection: "column-reverse" }),
840
+ welcome: i(Je, { fontSize: "1em" }),
841
+ welcomeXs: i(Je, { fontSize: "0.875em" })
842
+ }, ni = (e) => {
843
+ var P, f, v, z, w, _, D, $, B;
844
+ const [o, a] = nt.useState(!1), l = et(), { t: u } = ce(), c = ee(), m = tt(), { brandingImage: g, brandingColors: r, brandingLogo: p } = Pt(e.infoPage.branding || null), T = e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : c ? St : Tt, y = Se(
1676
845
  {
1677
846
  images: e.infoPage.images,
1678
- imagePlaceholder: g
847
+ imagePlaceholder: T
1679
848
  },
1680
- ue.OVERLAY
1681
- ), u = l.customRadius.dark.md, y = (i == null ? void 0 : i.background_color) || ((O = (_ = l.colorSchemes) == null ? void 0 : _.dark) == null ? void 0 : O.surfaceVariant), S = (T = (H = l.customRadius) == null ? void 0 : H.light) == null ? void 0 : T.xl, P = (i == null ? void 0 : i.primary_color) || ((R = (m = (C = (h = l.colorSchemes) == null ? void 0 : h.light) == null ? void 0 : C.palette) == null ? void 0 : m.primary) == null ? void 0 : R.plainColor), I = (N = (E = (B = ($ = l.colorSchemes) == null ? void 0 : $.light) == null ? void 0 : B.palette) == null ? void 0 : E.primary) == null ? void 0 : N.onPrimary, F = l.customFontFamily.dark.primary, k = l.colorSchemes.dark.textColor, Y = (i == null ? void 0 : i.content_color) || l.colorSchemes.dark.textColor, U = dt({
1682
- spacingScale: c,
1683
- mdBorderRadius: u,
1684
- contentBgColor: y,
1685
- buttonRadius: S,
1686
- primaryColor: P,
1687
- onPrimaryColor: I,
1688
- fontFamilyPrimary: F,
1689
- darkTextColor: k,
1690
- isMobile: r,
1691
- isExtraSmall: d,
1692
- textColor: Y,
1693
- opacity: "60%"
1694
- }), D = e.matchedPairs.length === e.pairData.pairs.length, A = () => {
1695
- var W, V, z, M, j;
1696
- return /* @__PURE__ */ t(
1697
- Fe,
849
+ Te.OVERLAY
850
+ ), W = g || y, U = (r == null ? void 0 : r.background_color) || ((f = (P = l.colorSchemes) == null ? void 0 : P.dark) == null ? void 0 : f.surfaceVariant), k = (v = l.colorSchemes) == null ? void 0 : v.light, I = l.colorSchemes.dark.textColor, h = {
851
+ "--fu-ucrc-ptp-panel": U,
852
+ "--fu-ucrc-ptp-text": (r == null ? void 0 : r.content_color) || I,
853
+ "--fu-ucrc-ptp-primary": (r == null ? void 0 : r.primary_color) || ((w = (z = k == null ? void 0 : k.palette) == null ? void 0 : z.primary) == null ? void 0 : w.plainColor),
854
+ "--fu-ucrc-ptp-on-primary": (D = (_ = k == null ? void 0 : k.palette) == null ? void 0 : _.primary) == null ? void 0 : D.onPrimary,
855
+ "--fu-ucrc-ptp-button-radius": (B = ($ = l.customRadius) == null ? void 0 : $.light) == null ? void 0 : B.xl
856
+ }, A = e.matchedPairs.length === e.pairData.pairs.length, F = () => {
857
+ var M, s, R, d, C;
858
+ return /* @__PURE__ */ n(
859
+ st,
1698
860
  {
1699
- brandingLogo: b,
1700
- textColor: k,
1701
- label: ((W = e.infoPage.labels) == null ? void 0 : W.sponsor) || null,
1702
- primaryUrl: (z = (V = e.infoPage.branding) == null ? void 0 : V.urls) == null ? void 0 : z.primary_url,
1703
- secondaryUrl: (j = (M = e.infoPage.branding) == null ? void 0 : M.urls) == null ? void 0 : j.secondary_url
861
+ brandingLogo: p,
862
+ textColor: I,
863
+ label: ((M = e.infoPage.labels) == null ? void 0 : M.sponsor) || null,
864
+ primaryUrl: (R = (s = e.infoPage.branding) == null ? void 0 : s.urls) == null ? void 0 : R.primary_url,
865
+ secondaryUrl: (C = (d = e.infoPage.branding) == null ? void 0 : d.urls) == null ? void 0 : C.secondary_url
1704
866
  }
1705
867
  );
1706
- }, v = () => {
1707
- var W, V, z, M, j, q, J, ne, ie, oe, Pe, Se, Ce, Te;
1708
- return /* @__PURE__ */ t(Q, { children: n ? /* @__PURE__ */ p(Q, { children: [
1709
- /* @__PURE__ */ t(x, { sx: U.contentContainerWithBackdrop, children: /* @__PURE__ */ t(
1710
- he,
868
+ }, b = () => {
869
+ var M, s, R, d, C, N, O, Y, G, q, K, Q, ie, ne;
870
+ return o ? /* @__PURE__ */ L(ae, { children: [
871
+ /* @__PURE__ */ n("div", { css: X.contentContainerWithBackdrop, style: h, children: /* @__PURE__ */ n(
872
+ ve,
1711
873
  {
1712
874
  sdk: e.sdk,
1713
875
  contentId: e.infoPage.id,
1714
876
  contentType: e.infoPage.type,
1715
- onSuccessLabel: ((W = e.infoPage.labels) == null ? void 0 : W.buttonLabel) || s("pickThePair.buttons.submit"),
877
+ onSuccessLabel: ((M = e.infoPage.labels) == null ? void 0 : M.buttonLabel) || u("pickThePair.buttons.submit"),
1716
878
  contentName: e.infoPage.title,
1717
- brandingColors: (V = e.infoPage.branding) == null ? void 0 : V.colors,
1718
- brandingUrls: (z = e.infoPage.branding) == null ? void 0 : z.urls,
1719
- campaignId: (M = e.leads) == null ? void 0 : M.campaignId,
1720
- campaignName: (j = e.leads) == null ? void 0 : j.campaignName,
1721
- fields: (q = e.leads) == null ? void 0 : q.fields,
1722
- leadTitle: (J = e.infoPage.labels) == null ? void 0 : J.leadTitle,
1723
- leadDescription: (ne = e.infoPage.labels) == null ? void 0 : ne.leadDescription,
1724
- leadCta: (ie = e.infoPage.labels) == null ? void 0 : ie.leadCta,
1725
- leadSuccessTitle: (oe = e.infoPage.labels) == null ? void 0 : oe.leadSuccessTitle,
1726
- leadSuccessDescription: (Pe = e.infoPage.labels) == null ? void 0 : Pe.leadSuccessDescription,
1727
- syncWithProfile: (Se = e.leads) == null ? void 0 : Se.syncWithProfile
879
+ brandingColors: (s = e.infoPage.branding) == null ? void 0 : s.colors,
880
+ brandingUrls: (R = e.infoPage.branding) == null ? void 0 : R.urls,
881
+ campaignId: (d = e.leads) == null ? void 0 : d.campaignId,
882
+ campaignName: (C = e.leads) == null ? void 0 : C.campaignName,
883
+ fields: (N = e.leads) == null ? void 0 : N.fields,
884
+ leadTitle: (O = e.infoPage.labels) == null ? void 0 : O.leadTitle,
885
+ leadDescription: (Y = e.infoPage.labels) == null ? void 0 : Y.leadDescription,
886
+ leadCta: (G = e.infoPage.labels) == null ? void 0 : G.leadCta,
887
+ leadSuccessTitle: (q = e.infoPage.labels) == null ? void 0 : q.leadSuccessTitle,
888
+ leadSuccessDescription: (K = e.infoPage.labels) == null ? void 0 : K.leadSuccessDescription,
889
+ syncWithProfile: (Q = e.leads) == null ? void 0 : Q.syncWithProfile
1728
890
  }
1729
891
  ) }),
1730
- b ? A() : /* @__PURE__ */ t(Q, {})
1731
- ] }) : /* @__PURE__ */ p(Q, { children: [
1732
- ((Ce = e.infoPage.labels) == null ? void 0 : Ce.welcome) && /* @__PURE__ */ t(
1733
- w,
1734
- {
1735
- level: "body-md",
1736
- sx: {
1737
- ...U.welcome
1738
- },
1739
- children: e.infoPage.labels.welcome
1740
- }
1741
- ),
1742
- e.pairData.config.timeLimit > 0 && /* @__PURE__ */ t(x, { sx: U.stopwatchContainer, children: /* @__PURE__ */ t(
1743
- be,
892
+ p ? F() : /* @__PURE__ */ n(ae, {})
893
+ ] }) : /* @__PURE__ */ L(ae, { children: [
894
+ ((ie = e.infoPage.labels) == null ? void 0 : ie.welcome) && /* @__PURE__ */ n("p", { css: m ? X.welcomeXs : X.welcome, style: h, children: e.infoPage.labels.welcome }),
895
+ e.pairData.config.timeLimit > 0 && /* @__PURE__ */ n("div", { css: X.centered, children: /* @__PURE__ */ n(
896
+ Le,
1744
897
  {
1745
898
  isRunning: e.isTimerRunning,
1746
899
  timer: e.timer,
1747
900
  initialTime: e.pairData.config.timeLimit,
1748
- brandingPrimaryColor: (i == null ? void 0 : i.primary_color) || null,
901
+ brandingPrimaryColor: (r == null ? void 0 : r.primary_color) || null,
1749
902
  onTimeUpdate: e.onTimeUpdate
1750
903
  }
1751
904
  ) }),
1752
- e.isChallengeMode && /* @__PURE__ */ t(x, { sx: U.challengeStatsContainer, children: /* @__PURE__ */ t(
1753
- ye,
905
+ e.isChallengeMode && /* @__PURE__ */ n("div", { css: X.centered, children: /* @__PURE__ */ n(
906
+ Ue,
1754
907
  {
1755
908
  totalAttempts: e.totalAttempts,
1756
909
  accuracy: e.accuracy,
@@ -1758,15 +911,16 @@ const Ie = ({
1758
911
  meetsThreshold: e.meetsThreshold,
1759
912
  totalPairs: e.pairData.pairs.length,
1760
913
  matchedPairs: e.matchedPairs.length,
1761
- brandingColors: i,
1762
- bgcolor: y
914
+ brandingColors: r,
915
+ bgcolor: U
1763
916
  }
1764
917
  ) }),
1765
- /* @__PURE__ */ p(x, { sx: U.contentContainerWithBackdrop, children: [
1766
- ((Te = e.infoPage.labels) == null ? void 0 : Te.instructions) && /* @__PURE__ */ t(w, { level: "body-lg", sx: U.instructions, children: e.infoPage.labels.instructions }),
1767
- /* @__PURE__ */ t(
1768
- Ie,
918
+ /* @__PURE__ */ L("div", { css: X.contentContainerWithBackdrop, style: h, children: [
919
+ ((ne = e.infoPage.labels) == null ? void 0 : ne.instructions) && /* @__PURE__ */ n("p", { css: X.instructions, children: e.infoPage.labels.instructions }),
920
+ /* @__PURE__ */ n(
921
+ Ce,
1769
922
  {
923
+ compact: !0,
1770
924
  pairs: e.pairData.pairs,
1771
925
  order: e.pairData.config.order,
1772
926
  matchedPairs: e.matchedPairs,
@@ -1775,43 +929,30 @@ const Ie = ({
1775
929
  showError: e.showError,
1776
930
  onSelectLeft: e.onSelectLeft,
1777
931
  onSelectRight: e.onSelectRight,
1778
- brandingColors: i,
932
+ brandingColors: r,
1779
933
  disabled: !1,
1780
934
  isTimeUp: e.isTimeUp
1781
935
  }
1782
936
  )
1783
937
  ] }),
1784
- /* @__PURE__ */ p(x, { sx: U.bottomFooterContainer, children: [
1785
- A(),
1786
- e.leads && /* @__PURE__ */ t(
1787
- pe,
938
+ /* @__PURE__ */ L("div", { css: c ? X.footerMobile : X.footer, children: [
939
+ F(),
940
+ e.leads && /* @__PURE__ */ n(
941
+ "button",
1788
942
  {
1789
- variant: "soft",
1790
- disabled: !D || e.isChallengeMode && !e.meetsThreshold || e.isTimeUp,
1791
- sx: U.continueButton,
943
+ type: "button",
944
+ css: X.continueButton,
945
+ style: h,
946
+ disabled: !A || e.isChallengeMode && !e.meetsThreshold || e.isTimeUp,
1792
947
  onClick: () => a(!0),
1793
- children: /* @__PURE__ */ t(
1794
- w,
1795
- {
1796
- sx: {
1797
- fontFamily: F,
1798
- fontWeight: 500,
1799
- fontSize: "0.9375em",
1800
- lineHeight: "24px",
1801
- letterSpacing: "0.46px",
1802
- textTransform: "uppercase",
1803
- color: I
1804
- },
1805
- children: s("pickThePair.buttons.continue")
1806
- }
1807
- )
948
+ children: /* @__PURE__ */ n("span", { css: X.continueLabel, children: u("pickThePair.buttons.continue") })
1808
949
  }
1809
950
  )
1810
951
  ] })
1811
- ] }) });
952
+ ] });
1812
953
  };
1813
- return /* @__PURE__ */ t(
1814
- He,
954
+ return /* @__PURE__ */ n(
955
+ Rt,
1815
956
  {
1816
957
  entity: {
1817
958
  ...e.infoPage,
@@ -1819,28 +960,28 @@ const Ie = ({
1819
960
  description: e.infoPage.subtitle || "",
1820
961
  rules: null
1821
962
  },
1822
- headline: s("pickThePair.headline"),
1823
- finalImage: f,
1824
- children: v()
963
+ headline: u("pickThePair.headline"),
964
+ finalImage: W,
965
+ children: b()
1825
966
  }
1826
967
  );
1827
- }, gt = (e) => {
1828
- const [n, a] = K([]), [c, l] = K(null), [s, r] = K(null), [d, o] = K(!1), [i, b] = K(0), [g, f] = K(!1), [u, y] = K(!1), [S, P] = K(0), [I, F] = K(0), { infoPage: k } = Ee(e.entityId, "pick-the-pair", e.sdk), Y = () => {
1829
- if (k && k.id !== "not-found") {
1830
- const h = Object.keys(Me);
1831
- if (k.language && h.includes(k.language))
1832
- return k.language;
1833
- if (k.language)
968
+ }, ai = (e) => {
969
+ const [o, a] = V([]), [l, u] = V(null), [c, m] = V(null), [g, r] = V(!1), [p, T] = V(0), [y, W] = V(!1), [U, k] = V(!1), [I, h] = V(0), [A, F] = V(0), { infoPage: b } = vt(e.entityId, "pick-the-pair", e.sdk), P = () => {
970
+ if (b && b.id !== "not-found") {
971
+ const s = Object.keys(kt);
972
+ if (b.language && s.includes(b.language))
973
+ return b.language;
974
+ if (b.language)
1834
975
  return "en";
1835
976
  }
1836
977
  return e.language || "en";
1837
978
  };
1838
- de(() => {
1839
- const h = Y();
1840
- we(h);
1841
- }, [e.language, k]);
1842
- const L = xe(() => {
1843
- if (!k || k.id === "not-found")
979
+ Pe(() => {
980
+ const s = P();
981
+ Mt(s);
982
+ }, [e.language, b]);
983
+ const f = at(() => {
984
+ if (!b || b.id === "not-found")
1844
985
  return {
1845
986
  pairs: [],
1846
987
  config: {
@@ -1851,9 +992,9 @@ const Ie = ({
1851
992
  }
1852
993
  };
1853
994
  try {
1854
- return JSON.parse(k.body);
1855
- } catch (h) {
1856
- return console.error("Failed to parse pick-the-pair body:", h), {
995
+ return JSON.parse(b.body);
996
+ } catch (s) {
997
+ return console.error("Failed to parse pick-the-pair body:", s), {
1857
998
  pairs: [],
1858
999
  config: {
1859
1000
  timeLimit: 0,
@@ -1863,185 +1004,145 @@ const Ie = ({
1863
1004
  }
1864
1005
  };
1865
1006
  }
1866
- }, [k]);
1867
- de(() => {
1868
- L.config.timeLimit && L.config.timeLimit > 0 && (b(L.config.timeLimit), f(!0));
1869
- }, [L.config.timeLimit]);
1870
- const U = L.config.mode.toLowerCase() === "challenge", D = n.length, A = S > 0 ? D / S * 100 : 0, v = A >= L.config.successThresholdPercent;
1871
- if (!k)
1872
- return /* @__PURE__ */ t(Oe, { my: 20 });
1873
- if (k.id === "not-found")
1874
- return /* @__PURE__ */ t(tt, { template: e.template });
1875
- const _ = (h) => {
1876
- if (c === h) {
1877
- l(null);
1007
+ }, [b]);
1008
+ Pe(() => {
1009
+ f.config.timeLimit && f.config.timeLimit > 0 && (T(f.config.timeLimit), W(!0));
1010
+ }, [f.config.timeLimit]);
1011
+ const v = f.config.mode.toLowerCase() === "challenge", z = o.length, w = I > 0 ? z / I * 100 : 0, _ = w >= f.config.successThresholdPercent;
1012
+ if (!b)
1013
+ return /* @__PURE__ */ n(Ft, { marginBlock: "160px" });
1014
+ if (b.id === "not-found")
1015
+ return /* @__PURE__ */ n(_t, { template: e.template });
1016
+ const D = (s) => {
1017
+ if (l === s) {
1018
+ u(null);
1878
1019
  return;
1879
1020
  }
1880
- if (n.some((m) => m.leftId === h)) {
1881
- a((m) => m.filter((R) => R.leftId !== h));
1021
+ if (o.some((d) => d.leftId === s)) {
1022
+ a((d) => d.filter((C) => C.leftId !== s));
1882
1023
  return;
1883
1024
  }
1884
- s ? h === s ? (P((m) => m + 1), a((m) => [
1885
- ...m,
1886
- { leftId: h, rightId: s }
1887
- ]), l(null), r(null)) : (P((m) => m + 1), F((m) => m + 1), l(h), o(!0), setTimeout(() => {
1888
- o(!1), l(null), r(null);
1889
- }, 800)) : l(h);
1890
- }, O = (h) => {
1891
- if (s === h) {
1892
- r(null);
1025
+ c ? s === c ? (h((d) => d + 1), a((d) => [
1026
+ ...d,
1027
+ { leftId: s, rightId: c }
1028
+ ]), u(null), m(null)) : (h((d) => d + 1), F((d) => d + 1), u(s), r(!0), setTimeout(() => {
1029
+ r(!1), u(null), m(null);
1030
+ }, 800)) : u(s);
1031
+ }, $ = (s) => {
1032
+ if (c === s) {
1033
+ m(null);
1893
1034
  return;
1894
1035
  }
1895
- if (n.some((m) => m.rightId === h)) {
1896
- a((m) => m.filter((R) => R.rightId !== h));
1036
+ if (o.some((d) => d.rightId === s)) {
1037
+ a((d) => d.filter((C) => C.rightId !== s));
1897
1038
  return;
1898
1039
  }
1899
- c ? h === c ? (P((m) => m + 1), a((m) => [
1900
- ...m,
1901
- { leftId: c, rightId: h }
1902
- ]), l(null), r(null)) : (P((m) => m + 1), F((m) => m + 1), r(h), o(!0), setTimeout(() => {
1903
- o(!1), l(null), r(null);
1904
- }, 800)) : r(h);
1905
- }, H = (h) => {
1906
- b(h), h === 0 && (f(!1), y(!0));
1907
- }, T = async () => {
1908
- f(!1);
1040
+ l ? s === l ? (h((d) => d + 1), a((d) => [
1041
+ ...d,
1042
+ { leftId: l, rightId: s }
1043
+ ]), u(null), m(null)) : (h((d) => d + 1), F((d) => d + 1), m(s), r(!0), setTimeout(() => {
1044
+ r(!1), u(null), m(null);
1045
+ }, 800)) : m(s);
1046
+ }, B = (s) => {
1047
+ T(s), s === 0 && (W(!1), k(!0));
1048
+ }, M = async () => {
1049
+ W(!1);
1909
1050
  };
1910
- return e.template === le.LANDING_PAGE ? /* @__PURE__ */ t(
1911
- st,
1051
+ return e.template === oe.LANDING_PAGE ? /* @__PURE__ */ n(
1052
+ ii,
1912
1053
  {
1913
- infoPage: k,
1914
- pairData: L,
1915
- matchedPairs: n,
1916
- selectedLeft: c,
1917
- selectedRight: s,
1918
- showError: d,
1054
+ infoPage: b,
1055
+ pairData: f,
1056
+ matchedPairs: o,
1057
+ selectedLeft: l,
1058
+ selectedRight: c,
1059
+ showError: g,
1919
1060
  sdk: e.sdk,
1920
1061
  leads: e.leads,
1921
1062
  defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
1922
- timer: i,
1923
- isTimerRunning: g,
1924
- isTimeUp: u,
1925
- totalAttempts: S,
1926
- incorrectAttempts: I,
1927
- accuracy: A,
1928
- meetsThreshold: v,
1929
- isChallengeMode: U,
1930
- onSelectLeft: _,
1931
- onSelectRight: O,
1932
- onSubmit: T,
1933
- onTimeUpdate: H
1063
+ timer: p,
1064
+ isTimerRunning: y,
1065
+ isTimeUp: U,
1066
+ totalAttempts: I,
1067
+ incorrectAttempts: A,
1068
+ accuracy: w,
1069
+ meetsThreshold: _,
1070
+ isChallengeMode: v,
1071
+ onSelectLeft: D,
1072
+ onSelectRight: $,
1073
+ onSubmit: M,
1074
+ onTimeUpdate: B
1934
1075
  }
1935
- ) : e.template === le.OVERLAY ? /* @__PURE__ */ t(
1936
- mt,
1076
+ ) : e.template === oe.OVERLAY ? /* @__PURE__ */ n(
1077
+ ni,
1937
1078
  {
1938
- infoPage: k,
1939
- pairData: L,
1940
- matchedPairs: n,
1941
- selectedLeft: c,
1942
- selectedRight: s,
1943
- showError: d,
1079
+ infoPage: b,
1080
+ pairData: f,
1081
+ matchedPairs: o,
1082
+ selectedLeft: l,
1083
+ selectedRight: c,
1084
+ showError: g,
1944
1085
  sdk: e.sdk,
1945
1086
  leads: e.leads,
1946
1087
  defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
1947
- timer: i,
1948
- isTimerRunning: g,
1949
- isTimeUp: u,
1950
- totalAttempts: S,
1951
- incorrectAttempts: I,
1952
- accuracy: A,
1953
- meetsThreshold: v,
1954
- isChallengeMode: U,
1955
- onSelectLeft: _,
1956
- onSelectRight: O,
1957
- onSubmit: T,
1958
- onTimeUpdate: H
1088
+ timer: p,
1089
+ isTimerRunning: y,
1090
+ isTimeUp: U,
1091
+ totalAttempts: I,
1092
+ incorrectAttempts: A,
1093
+ accuracy: w,
1094
+ meetsThreshold: _,
1095
+ isChallengeMode: v,
1096
+ onSelectLeft: D,
1097
+ onSelectRight: $,
1098
+ onSubmit: M,
1099
+ onTimeUpdate: B
1959
1100
  }
1960
- ) : /* @__PURE__ */ t(
1961
- lt,
1101
+ ) : /* @__PURE__ */ n(
1102
+ ei,
1962
1103
  {
1963
- infoPage: k,
1964
- pairData: L,
1965
- matchedPairs: n,
1966
- selectedLeft: c,
1967
- selectedRight: s,
1968
- showError: d,
1104
+ infoPage: b,
1105
+ pairData: f,
1106
+ matchedPairs: o,
1107
+ selectedLeft: l,
1108
+ selectedRight: c,
1109
+ showError: g,
1969
1110
  sdk: e.sdk,
1970
1111
  leads: e.leads,
1971
1112
  defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
1972
- imagePosition: e.template === le.STANDARD ? e.imagePosition : void 0,
1973
- timer: i,
1974
- isTimerRunning: g,
1975
- isTimeUp: u,
1976
- totalAttempts: S,
1977
- incorrectAttempts: I,
1978
- accuracy: A,
1979
- meetsThreshold: v,
1980
- isChallengeMode: U,
1981
- onSelectLeft: _,
1982
- onSelectRight: O,
1983
- onSubmit: T,
1984
- onTimeUpdate: H
1113
+ imagePosition: e.template === oe.STANDARD ? e.imagePosition : void 0,
1114
+ timer: p,
1115
+ isTimerRunning: y,
1116
+ isTimeUp: U,
1117
+ totalAttempts: I,
1118
+ incorrectAttempts: A,
1119
+ accuracy: w,
1120
+ meetsThreshold: _,
1121
+ isChallengeMode: v,
1122
+ onSelectLeft: D,
1123
+ onSelectRight: $,
1124
+ onSubmit: M,
1125
+ onTimeUpdate: B
1985
1126
  }
1986
1127
  );
1987
- }, ft = (e) => {
1988
- var P;
1989
- const [n, a] = G.useState(!1), [c, l] = G.useState(!1), s = je(e.language), r = G.useRef(
1990
- `pick-the-pair-shadow-root-${Math.random().toString(36).substring(2, 11)}`
1991
- ), d = G.useRef(null), o = G.useRef(null), i = G.useRef(null), [b, g] = G.useState(null);
1992
- G.useEffect(() => {
1993
- we(e.language || "en").finally(() => l(!0));
1994
- }, [e.language]), G.useEffect(() => {
1995
- if (!d.current) return;
1996
- d.current.shadowRoot ? (o.current = d.current.shadowRoot, i.current = o.current.getElementById(
1997
- r.current
1998
- ), i.current || (i.current = document.createElement("div"), i.current.id = r.current, o.current.appendChild(i.current))) : (o.current = d.current.attachShadow({ mode: "open" }), i.current = document.createElement("div"), i.current.id = r.current, o.current.appendChild(i.current)), Ne(i.current, s);
1999
- const I = Ve("pick-the-pair", s);
2000
- return g(
2001
- (F) => (F == null ? void 0 : F.key) === I ? F : Ye(
2002
- "pick-the-pair",
2003
- o.current,
2004
- s
2005
- )
2006
- ), a(!0), () => {
2007
- a(!1);
2008
- };
2009
- }, [s]);
2010
- const f = e.themeOptions, u = {
2011
- ...f,
2012
- mode: e.template === le.OVERLAY ? "dark" : f == null ? void 0 : f.mode
2013
- }, y = /* @__PURE__ */ t(x, { ref: d, lang: e.language || "en" }), S = n && c && d.current && i.current && b ? Ze(
2014
- // Keyed on the cache, not on `direction`: it must change in the same
2015
- // render that adopts the new cache, or CssVarsProvider writes its CSS
2016
- // variables into the outgoing cache and never repeats.
2017
- /* @__PURE__ */ t(Je, { value: b, children: /* @__PURE__ */ t(qe, { containerRef: d, children: /* @__PURE__ */ t(
2018
- Xe,
2019
- {
2020
- customTheme: u,
2021
- mode: u == null ? void 0 : u.mode,
2022
- shadowRootElement: i.current,
2023
- direction: s,
2024
- children: /* @__PURE__ */ t(
2025
- Ge,
2026
- {
2027
- shadowRootElement: i.current,
2028
- leadPhoneCountryCode: ((P = e.leads) == null ? void 0 : P.phoneCountryCode) || null,
2029
- language: null,
2030
- optionsLayout: null,
2031
- direction: s,
2032
- disableCache: e.disableCache ?? !1,
2033
- children: e.children
2034
- }
2035
- )
2036
- }
2037
- ) }) }, b.key),
2038
- i.current
2039
- ) : null;
2040
- return /* @__PURE__ */ p(Q, { children: [
2041
- y,
2042
- S
2043
- ] });
2044
- }, ut = (e) => /* @__PURE__ */ t(ft, { ...e, children: /* @__PURE__ */ t(gt, { ...e }) }), wt = et(ut);
1128
+ }, oi = (e) => {
1129
+ var a;
1130
+ const o = nt.useMemo(
1131
+ () => e.template === oe.OVERLAY ? { ...e.themeOptions, mode: "dark" } : e.themeOptions,
1132
+ [e.template, e.themeOptions]
1133
+ );
1134
+ return /* @__PURE__ */ n(
1135
+ Bt,
1136
+ {
1137
+ packageName: "pick-the-pair",
1138
+ language: e.language,
1139
+ themeOptions: o,
1140
+ disableCache: e.disableCache,
1141
+ leadPhoneCountryCode: (a = e.leads) == null ? void 0 : a.phoneCountryCode,
1142
+ children: /* @__PURE__ */ n(ai, { ...e })
1143
+ }
1144
+ );
1145
+ }, fi = zt(oi);
2045
1146
  export {
2046
- wt as PickThePair
1147
+ fi as PickThePair
2047
1148
  };