fansunited-frontend-components 0.0.98 → 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.
- package/Betslip.js +2 -2
- package/ChanceGame.js +952 -1467
- package/ClassicQuizPlay.js +2 -2
- package/CollectLead.js +405 -1163
- package/CompetitionStatistics.js +2042 -2215
- package/CompetitorCard.js +4251 -5085
- package/Discussion.js +2 -2
- package/EitherOrPlay.js +2 -2
- package/EventCard.js +6062 -7544
- package/EventGamePlay.js +2 -2
- package/Leaderboard.js +556 -849
- package/List.js +689 -718
- package/MatchQuizPlay.js +2 -2
- package/Odds.js +50 -42
- package/PersonalityQuizPlay.js +2 -2
- package/PickThePair.js +925 -1824
- package/PlayerOfTheMatch.js +2106 -2207
- package/PollVote.js +2 -2
- package/Predictor.js +4208 -18675
- package/README.md +1 -1
- package/Standings.js +1014 -1336
- package/TopX.js +3223 -17005
- package/chunks/{ChanceGameEmbedVariant-CVys-3Zh.js → ChanceGameEmbedVariant-z8XYzgDW.js} +2 -2
- package/chunks/OddsSkeleton-DP5Yfqpr.js +522 -0
- package/chunks/PickOneOfX-IvE4OvyT.js +3146 -0
- package/chunks/index-BNl8scz6.js +4 -0
- package/chunks/index-CSa2JU4m.js +4 -0
- package/chunks/index-CVRI82Gb.js +4 -0
- package/chunks/index-Cd1dg0KI.js +4 -0
- package/chunks/index-Cei2fzi7.js +4 -0
- package/chunks/index-Cxb4wEJU.js +4 -0
- package/chunks/index-w1LGN5dz.js +4 -0
- package/chunks/main-07vzblS8.js +2091 -0
- package/chunks/main-C7X4dM_P.js +4827 -0
- package/chunks/main-D_QDfmAw.js +6417 -0
- package/chunks/main-DdL0UekL.js +4775 -0
- package/chunks/main-DmBfwyb4.js +2992 -0
- package/chunks/main-LEE8n2cG.js +3117 -0
- package/chunks/main-P2WNvBZE.js +1804 -0
- package/chunks/main-gV165E-A.js +1928 -0
- package/chunks/predictionsHelpers-fwXaMadu.js +10063 -0
- package/chunks/{withVersionStamp-T8seRk9h.js → withVersionStamp-CPDfSE5H.js} +1 -1
- package/package.json +2 -6
- package/withVersionStamp.d.ts.map +1 -1
- package/chunks/OddsSkeleton-ClJE2xhR.js +0 -26
- package/chunks/OddsStrip-BnSp5TXa.js +0 -383
- package/chunks/PickOneOfX-DaJtkbCw.js +0 -4206
- package/chunks/chevron-left-CxfCSZcr.js +0 -13
- package/chunks/chevron-right-BEQMacFn.js +0 -13
- package/chunks/chevrons-right-CXSpQt9w.js +0 -25
- package/chunks/createLucideIcon-YBRjY5Kl.js +0 -79
- package/chunks/index-Aq5MbUB9.js +0 -4
- package/chunks/index-BBQm_8LD.js +0 -4
- package/chunks/index-BC_sWWgc.js +0 -4
- package/chunks/index-DXKDJ1Vp.js +0 -4
- package/chunks/index-DjT5NrbA.js +0 -4
- package/chunks/index-DvLRehH6.js +0 -4
- package/chunks/index-aIMaxR-p.js +0 -4
- package/chunks/main-52Wff7qC.js +0 -11441
- package/chunks/main-65WcUqAl.js +0 -4013
- package/chunks/main-B58mi9jx.js +0 -5622
- package/chunks/main-BIdXUTZS.js +0 -7308
- package/chunks/main-DD-NEzC7.js +0 -8241
- package/chunks/main-DUnfJPzY.js +0 -3608
- package/chunks/main-DpCBqqg_.js +0 -1950
- package/chunks/main-Drznt1ak.js +0 -1790
- package/chunks/users-wbJRbqW8.js +0 -16
- package/chunks/x-CK4GYo7T.js +0 -14
|
@@ -0,0 +1,3117 @@
|
|
|
1
|
+
import { jsx as t, jsxs as p, Fragment as Re } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useDisableCache as ni, useInternalTheme as ne, useColors as re, useImageUrl as Ze, useConstantContext as Ct, ConstantsContext as It, useIsMobile as Y, useIsLarge as St, useBrandingModelProperties as He, defaultBgVertical as Se, defaultBg as ze, useImageVariant as he, WidgetTemplate as G, DirectionalIcon as zt, useIsExtraSmall as ii, hexToRgb as Oe, useIsRtl as Ke, bidiIsolateAuto as ai, stripHtmlTags as ri, useImageBackgroundGradient as Un, sanitizeBackgroundUrl as Mn, useSignInGate as oi, useConsents as li, useParticipationDraft as si, getRelatedInfoPageId as ci, initializeI18n as di, ChanceGameEmbed as Vt, extractSdkError as ui } from "fansunited-frontend-core";
|
|
3
|
+
import { C as jt } from "./ChanceGameEmbedVariant-z8XYzgDW.js";
|
|
4
|
+
import Xe, { useState as U, useEffect as me, useRef as Ce, useId as Je, useMemo as dt } from "react";
|
|
5
|
+
import { PersonalityQuizFullModel as gi, PersonalityQuizParticipationModel as $n } from "fansunited-sdk-esm/models";
|
|
6
|
+
import { AspectRatio as et, useBreakpointUp as ue, PlayCollectLeadWrapper as mi, baseButton as Ie, ButtonSpinner as En, space as g, baseBody as fe, OverlaySkeleton as fi, ConsentPanel as Te, PresentedBy as V, ConsentCta as tt, ctaButton as yi, ctaLabel as hi, StandardSkeleton as bi, SplitSkeleton as pi, StandardContentSkeleton as xi, AdditionalCTA as wt, AlertMessage as kt, SplitScoreStateSkeleton as vi, OverlayScoreStateWrapperSkeleton as Ci, NotFound as Ii, OverlayApiErrorSkeleton as Fn, SplitApiErrorSkeleton as Hn, StandardApiErrorSkeleton as On, StandardSignInSkeleton as Si, SignInCta as At, SplitSignInSkeleton as zi, OverlaySignInSkeleton as wi, StandardLeadAfterCollection as Qt, SignInGatePanel as Pt, SplitLeadAfterCollection as qt, OverlayLeadAfterCollection as Lt, Spinner as Gt, WidgetPortal as ki } from "fansunited-frontend-core/ui/emotion";
|
|
7
|
+
import { css as n } from "@emotion/react";
|
|
8
|
+
import { ArrowRightAltIcon as Dt, ReplayIcon as Rt } from "fansunited-frontend-core/ui/icons";
|
|
9
|
+
import { useTranslation as H } from "react-i18next";
|
|
10
|
+
const Ai = (e, i) => {
|
|
11
|
+
const [r, o] = U(null), c = ni(), a = async () => {
|
|
12
|
+
try {
|
|
13
|
+
const l = await i.miniGames.getPersonalityQuizById(e, c);
|
|
14
|
+
o(l);
|
|
15
|
+
} catch (l) {
|
|
16
|
+
console.error(l), o(new gi());
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
return me(() => (a(), () => o(null)), [e, i, c]), r;
|
|
20
|
+
}, Qi = (e, i, r, o = !1, c = !1) => {
|
|
21
|
+
const [a, l] = U(null), [s, x] = U(!1), [y, m] = U(!1), [u, b] = U(""), [f, v] = U(r);
|
|
22
|
+
r !== f && (v(r), l(null));
|
|
23
|
+
const D = async () => {
|
|
24
|
+
try {
|
|
25
|
+
const S = await i.miniGames.getMyPersonalityQuizParticipations({
|
|
26
|
+
personalityQuizIds: [e]
|
|
27
|
+
});
|
|
28
|
+
l(S.data);
|
|
29
|
+
} catch (S) {
|
|
30
|
+
if (l([new $n()]), i.helpers.getSDKConfiguration().errorHandlingMode === "standard") {
|
|
31
|
+
const P = S;
|
|
32
|
+
if (P.error.code === 401 || P.error.code === 403) {
|
|
33
|
+
o || x(!0);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
m(!0), b(P.error.message || "");
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
const w = S;
|
|
40
|
+
if (w.data.error.code === 401 || w.data.error.code === 403) {
|
|
41
|
+
o || x(!0);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
m(!0), b(w.data.error.message || "");
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
return me(() => (D(), () => l((S) => S === null ? null : [])), [e, i, r, o, c]), {
|
|
48
|
+
myParticipation: a,
|
|
49
|
+
isUnauthorized: s,
|
|
50
|
+
isApiError: y,
|
|
51
|
+
apiMessage: u,
|
|
52
|
+
setIsUnauthorized: x,
|
|
53
|
+
setIsApiError: m,
|
|
54
|
+
setApiMessage: b
|
|
55
|
+
};
|
|
56
|
+
}, Nt = {
|
|
57
|
+
borderRadius: "var(--fu-ucrc-radius-sm)",
|
|
58
|
+
flex: 1,
|
|
59
|
+
padding: "var(--fu-ucrc-space-xs)",
|
|
60
|
+
gap: "var(--fu-ucrc-space-xs)",
|
|
61
|
+
backgroundColor: "#FFFFFF",
|
|
62
|
+
boxShadow: "none",
|
|
63
|
+
cursor: "pointer",
|
|
64
|
+
transition: "all 300ms cubic-bezier(0.2, 0, 0, 1)",
|
|
65
|
+
transform: "scale(1)",
|
|
66
|
+
display: "flex",
|
|
67
|
+
flexDirection: "column",
|
|
68
|
+
"--fu-ucrc-pq-option-text": "var(--fu-ucrc-pq-light-text)",
|
|
69
|
+
"&:hover": { transform: "scale(1.02)" },
|
|
70
|
+
"&:active": { transform: "scale(0.98)" }
|
|
71
|
+
}, _t = {
|
|
72
|
+
margin: 0,
|
|
73
|
+
unicodeBidi: "plaintext",
|
|
74
|
+
fontFamily: "var(--fu-ucrc-font-primary)",
|
|
75
|
+
fontWeight: 500,
|
|
76
|
+
fontSize: "0.935em",
|
|
77
|
+
letterSpacing: "0.46px",
|
|
78
|
+
textAlign: "center",
|
|
79
|
+
color: "var(--fu-ucrc-pq-option-text)",
|
|
80
|
+
paddingInline: "var(--fu-ucrc-space-2xs)"
|
|
81
|
+
}, Le = {
|
|
82
|
+
idle: n(Nt),
|
|
83
|
+
selected: n(Nt, {
|
|
84
|
+
backgroundColor: "var(--fu-ucrc-pq-primary)",
|
|
85
|
+
boxShadow: "inset 0 0 0 var(--fu-ucrc-border-size) var(--fu-ucrc-pq-primary)",
|
|
86
|
+
"--fu-ucrc-pq-option-text": "var(--fu-ucrc-primary-on-primary)"
|
|
87
|
+
}),
|
|
88
|
+
media: n({ borderRadius: "var(--fu-ucrc-radius-xs)", overflow: "hidden", flexGrow: 1 }),
|
|
89
|
+
img: n({ width: "100%", height: "100%", objectFit: "cover" }),
|
|
90
|
+
mediaTitle: n({ ..._t, lineHeight: "24px" }),
|
|
91
|
+
title: n({ ..._t, lineHeight: "16px", marginBlock: "auto" })
|
|
92
|
+
}, Pi = (e) => {
|
|
93
|
+
var l;
|
|
94
|
+
const i = ne(), r = re(), o = Ze(e.option.images), c = e.questionImage ? null : o, a = {
|
|
95
|
+
"--fu-ucrc-pq-primary": ((l = e.brandingColors) == null ? void 0 : l.primaryColor) || r.palette.primary.plainColor,
|
|
96
|
+
// The card is white, so its text keeps the light scheme's colour in either mode.
|
|
97
|
+
"--fu-ucrc-pq-light-text": i.colorSchemes.light.textColor
|
|
98
|
+
};
|
|
99
|
+
return /* @__PURE__ */ t(
|
|
100
|
+
"div",
|
|
101
|
+
{
|
|
102
|
+
css: e.selectedOption === e.option.optionId ? Le.selected : Le.idle,
|
|
103
|
+
style: a,
|
|
104
|
+
onClick: () => e.answerQuestion(e.option.optionId),
|
|
105
|
+
children: c ? /* @__PURE__ */ p(Re, { children: [
|
|
106
|
+
/* @__PURE__ */ t("div", { css: Le.media, children: /* @__PURE__ */ t(et, { ratio: "16/9", radius: "var(--fu-ucrc-radius-xs)", children: /* @__PURE__ */ t("img", { src: c, alt: "Option illustration", css: Le.img }) }) }),
|
|
107
|
+
/* @__PURE__ */ t("p", { css: Le.mediaTitle, children: e.option.option })
|
|
108
|
+
] }) : /* @__PURE__ */ t("p", { css: Le.title, children: e.option.option })
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
}, Yt = { display: "flex", flexDirection: "column", gap: "16px" }, De = {
|
|
112
|
+
list: n({ ...Yt, paddingBlock: "16px" }),
|
|
113
|
+
row: n({ display: "flex", flexDirection: "row", gap: "16px" }),
|
|
114
|
+
column: n(Yt),
|
|
115
|
+
wrapRow: n({ display: "flex", flexWrap: "wrap", flexDirection: "row", gap: "16px", paddingBlock: "16px" }),
|
|
116
|
+
wrapColumn: n({ display: "flex", flexWrap: "wrap", flexDirection: "column", gap: "16px", paddingBlock: "16px" })
|
|
117
|
+
}, qi = (e) => {
|
|
118
|
+
const i = [];
|
|
119
|
+
for (let r = 0; r < e.length; r += 2) i.push(e.slice(r, r + 2));
|
|
120
|
+
return i;
|
|
121
|
+
}, Tt = (e) => {
|
|
122
|
+
const i = ue("md"), r = (o) => /* @__PURE__ */ t(
|
|
123
|
+
Pi,
|
|
124
|
+
{
|
|
125
|
+
option: o,
|
|
126
|
+
questionImage: e.questionImage,
|
|
127
|
+
selectedOption: e.selectedOption,
|
|
128
|
+
answerQuestion: e.answerQuestion,
|
|
129
|
+
brandingColors: e.brandingColors
|
|
130
|
+
},
|
|
131
|
+
o.optionId
|
|
132
|
+
);
|
|
133
|
+
return e.optionsLayout === "twoByTwo" ? /* @__PURE__ */ t("div", { css: De.list, children: qi(e.options).map((o, c) => /* @__PURE__ */ t("div", { css: i ? De.row : De.column, children: o.map(r) }, `row-${c}`)) }) : e.optionsLayout === "column" ? /* @__PURE__ */ t("div", { css: De.list, children: e.options.map(r) }) : /* @__PURE__ */ t("div", { css: i ? De.wrapRow : De.wrapColumn, children: e.options.map(r) });
|
|
134
|
+
}, Be = ({ isAfterPosition: e = !1, ...i }) => {
|
|
135
|
+
const { t: r } = H();
|
|
136
|
+
return /* @__PURE__ */ t(
|
|
137
|
+
mi,
|
|
138
|
+
{
|
|
139
|
+
...i,
|
|
140
|
+
contentType: "personality-quiz",
|
|
141
|
+
successCtaLabel: r(e ? "personalityQuiz.buttons.finish" : "personalityQuiz.buttons.start")
|
|
142
|
+
}
|
|
143
|
+
);
|
|
144
|
+
}, Zt = {
|
|
145
|
+
paddingBlock: "10px",
|
|
146
|
+
paddingRight: "12px",
|
|
147
|
+
paddingLeft: "16px",
|
|
148
|
+
borderRadius: "var(--fu-ucrc-radius-xl)",
|
|
149
|
+
fontSize: "0.9375em",
|
|
150
|
+
backgroundColor: "var(--fu-ucrc-pq-next)",
|
|
151
|
+
color: "var(--fu-ucrc-primary-on-primary)",
|
|
152
|
+
transition: "all 300ms cubic-bezier(0.2, 0, 0, 1)",
|
|
153
|
+
transform: "scale(1)",
|
|
154
|
+
"&:hover": { transform: "scale(1.02)" },
|
|
155
|
+
"&:active": { transform: "scale(0.98)" },
|
|
156
|
+
"&:disabled": { opacity: "34%" }
|
|
157
|
+
}, Ge = {
|
|
158
|
+
root: n(Ie, Zt),
|
|
159
|
+
// Joy's `ml: { md: "auto" }`.
|
|
160
|
+
rootEnd: n(Ie, Zt, { marginLeft: "auto" }),
|
|
161
|
+
label: n({
|
|
162
|
+
margin: 0,
|
|
163
|
+
fontFamily: "var(--fu-ucrc-font-primary)",
|
|
164
|
+
fontWeight: 500,
|
|
165
|
+
fontSize: "0.9375em",
|
|
166
|
+
lineHeight: "24px",
|
|
167
|
+
letterSpacing: "0.46px",
|
|
168
|
+
textTransform: "uppercase",
|
|
169
|
+
color: "var(--fu-ucrc-primary-on-primary)",
|
|
170
|
+
gap: "8px",
|
|
171
|
+
display: "flex",
|
|
172
|
+
alignItems: "center"
|
|
173
|
+
}),
|
|
174
|
+
// Joy's endDecorator: an 8px gap; icons sized and coloured like the label.
|
|
175
|
+
decorator: n({
|
|
176
|
+
display: "flex",
|
|
177
|
+
marginLeft: "8px",
|
|
178
|
+
"--Icon-fontSize": "1em",
|
|
179
|
+
"--Icon-color": "var(--fu-ucrc-primary-on-primary)"
|
|
180
|
+
})
|
|
181
|
+
}, Li = { "--Icon-margin": "0 -4px 0 0" }, Di = (e) => /* @__PURE__ */ p(
|
|
182
|
+
"button",
|
|
183
|
+
{
|
|
184
|
+
type: "button",
|
|
185
|
+
css: e.pushToEnd ? Ge.rootEnd : Ge.root,
|
|
186
|
+
style: {
|
|
187
|
+
"--fu-ucrc-pq-next": e.primaryColor,
|
|
188
|
+
"--fu-ucrc-primary-on-primary": e.onPrimaryColor,
|
|
189
|
+
"--fu-ucrc-radius-xl": e.radius
|
|
190
|
+
},
|
|
191
|
+
disabled: e.isLoading || e.disabled,
|
|
192
|
+
onClick: e.onClick,
|
|
193
|
+
children: [
|
|
194
|
+
/* @__PURE__ */ t("p", { css: Ge.label, children: e.label }),
|
|
195
|
+
/* @__PURE__ */ t("span", { css: Ge.decorator, style: Li, children: e.endDecorator }),
|
|
196
|
+
e.isLoading && /* @__PURE__ */ t(En, { size: 20, thickness: 3 })
|
|
197
|
+
]
|
|
198
|
+
}
|
|
199
|
+
), Kt = { display: "flex", alignItems: "center", gap: g("md") }, Xt = { gap: "8px", alignItems: "flex-start", justifyContent: "center" }, Jt = {
|
|
200
|
+
...fe,
|
|
201
|
+
fontFamily: "var(--fu-ucrc-font-primary)",
|
|
202
|
+
lineHeight: "150%",
|
|
203
|
+
letterSpacing: "0.15px",
|
|
204
|
+
fontWeight: 500,
|
|
205
|
+
fontSize: "1.25em",
|
|
206
|
+
textAlign: "center",
|
|
207
|
+
color: "var(--fu-ucrc-pq-ovl-text)"
|
|
208
|
+
}, xe = {
|
|
209
|
+
// A blurred panel over the artwork, tinted by the content background at half opacity.
|
|
210
|
+
content: n({
|
|
211
|
+
borderRadius: "var(--fu-ucrc-radius-sm)",
|
|
212
|
+
padding: g("md"),
|
|
213
|
+
display: "flex",
|
|
214
|
+
flexDirection: "column",
|
|
215
|
+
gap: g("md"),
|
|
216
|
+
backdropFilter: "blur(4px)",
|
|
217
|
+
position: "relative",
|
|
218
|
+
"&::before": {
|
|
219
|
+
content: '""',
|
|
220
|
+
position: "absolute",
|
|
221
|
+
top: 0,
|
|
222
|
+
left: 0,
|
|
223
|
+
right: 0,
|
|
224
|
+
bottom: 0,
|
|
225
|
+
backgroundColor: "var(--fu-ucrc-pq-ovl-content-bg)",
|
|
226
|
+
opacity: 0.5,
|
|
227
|
+
borderRadius: "inherit",
|
|
228
|
+
zIndex: 0
|
|
229
|
+
},
|
|
230
|
+
"& > *": { position: "relative", zIndex: 1 }
|
|
231
|
+
}),
|
|
232
|
+
imageBox: n({ borderRadius: "var(--fu-ucrc-radius-sm)", overflow: "hidden" }),
|
|
233
|
+
question: n(Xt, { display: "flex" }),
|
|
234
|
+
questionBlock: n(Xt, { display: "block" }),
|
|
235
|
+
steps: n(Jt, { opacity: "70%" }),
|
|
236
|
+
questionText: n(Jt, { unicodeBidi: "plaintext" }),
|
|
237
|
+
footer: n(Kt, { justifyContent: "space-between", flexDirection: "row" }),
|
|
238
|
+
footerMobile: n(Kt, { justifyContent: "center", flexDirection: "column-reverse" })
|
|
239
|
+
}, Ri = { width: "100%", height: "100%", objectFit: "cover" }, Ti = (e) => {
|
|
240
|
+
var O, k, I, R, z, A, L, N, d, q, M, $, ee, X, te, le, se, ge, ae, _;
|
|
241
|
+
const [i, r] = Xe.useState(
|
|
242
|
+
((O = e.leads) == null ? void 0 : O.position) === "before" && e.personalityQuiz.authRequirement === "LEAD"
|
|
243
|
+
), { optionsLayout: o } = Ct(It), c = ne(), a = Ze(e.question.images), { t: l } = H(), s = Y(), x = St(), y = ue("md"), { brandingImage: m, brandingColors: u, brandingLogo: b } = He(
|
|
244
|
+
e.personalityQuiz.branding || null
|
|
245
|
+
), f = e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : s ? Se : ze, v = he(
|
|
246
|
+
{ images: e.personalityQuiz.images, imagePlaceholder: f },
|
|
247
|
+
G.OVERLAY
|
|
248
|
+
), D = m || v, S = e.currentQuestion === e.personalityQuiz.questions.length && (((k = e.leads) == null ? void 0 : k.position) === "after" || e.hasAfterConsents) ? l("personalityQuiz.buttons.continue") : e.currentQuestion === e.personalityQuiz.questions.length ? l("personalityQuiz.buttons.finish") : l("personalityQuiz.buttons.next"), Q = c.colorSchemes.dark, w = c.colorSchemes.light, P = (u == null ? void 0 : u.primaryColor) || w.palette.primary.plainColor, C = {
|
|
249
|
+
"--fu-ucrc-pq-ovl-content-bg": (u == null ? void 0 : u.backgroundColor) || Q.surfaceVariant,
|
|
250
|
+
"--fu-ucrc-pq-ovl-text": Q.textColor
|
|
251
|
+
}, B = () => {
|
|
252
|
+
r(!1);
|
|
253
|
+
};
|
|
254
|
+
return /* @__PURE__ */ p(
|
|
255
|
+
fi,
|
|
256
|
+
{
|
|
257
|
+
entity: e.personalityQuiz,
|
|
258
|
+
headline: l("personalityQuiz.headline"),
|
|
259
|
+
finalImage: D,
|
|
260
|
+
rulesDisplay: e.rulesDisplay,
|
|
261
|
+
children: [
|
|
262
|
+
/* @__PURE__ */ t("div", { css: xe.content, style: C, children: e.applyConsentGate ? /* @__PURE__ */ t(
|
|
263
|
+
Te,
|
|
264
|
+
{
|
|
265
|
+
consents: e.consents,
|
|
266
|
+
primaryColor: P,
|
|
267
|
+
textColor: (u == null ? void 0 : u.contentColor) || Q.textColor,
|
|
268
|
+
brandingUrls: (I = e.personalityQuiz.branding) == null ? void 0 : I.urls
|
|
269
|
+
}
|
|
270
|
+
) : i ? /* @__PURE__ */ t(
|
|
271
|
+
Be,
|
|
272
|
+
{
|
|
273
|
+
sdk: e.sdk,
|
|
274
|
+
startGame: B,
|
|
275
|
+
contentId: e.personalityQuiz.id,
|
|
276
|
+
contentName: e.personalityQuiz.title,
|
|
277
|
+
brandingColors: (R = e.personalityQuiz.branding) == null ? void 0 : R.colors,
|
|
278
|
+
brandingUrls: (z = e.personalityQuiz.branding) == null ? void 0 : z.urls,
|
|
279
|
+
campaignId: (A = e.leads) == null ? void 0 : A.campaignId,
|
|
280
|
+
campaignName: (L = e.leads) == null ? void 0 : L.campaignName,
|
|
281
|
+
fields: (N = e.leads) == null ? void 0 : N.fields,
|
|
282
|
+
leadTitle: (d = e.personalityQuiz.labels) == null ? void 0 : d.leadTitle,
|
|
283
|
+
leadDescription: (q = e.personalityQuiz.labels) == null ? void 0 : q.leadDescription,
|
|
284
|
+
leadCta: (M = e.personalityQuiz.labels) == null ? void 0 : M.leadCta,
|
|
285
|
+
leadSuccessTitle: ($ = e.personalityQuiz.labels) == null ? void 0 : $.leadSuccessTitle,
|
|
286
|
+
leadSuccessDescription: (ee = e.personalityQuiz.labels) == null ? void 0 : ee.leadSuccessDescription,
|
|
287
|
+
consents: e.leadConsents
|
|
288
|
+
}
|
|
289
|
+
) : /* @__PURE__ */ p(Re, { children: [
|
|
290
|
+
a && /* @__PURE__ */ t(et, { ratio: "16/9", radius: "var(--fu-ucrc-radius-sm)", children: /* @__PURE__ */ t("div", { css: xe.imageBox, children: /* @__PURE__ */ t("img", { src: a, alt: "Question illustration", style: Ri }) }) }),
|
|
291
|
+
/* @__PURE__ */ p("div", { css: x ? xe.questionBlock : xe.question, children: [
|
|
292
|
+
/* @__PURE__ */ p("p", { css: xe.steps, children: [
|
|
293
|
+
e.currentQuestion,
|
|
294
|
+
"/",
|
|
295
|
+
e.personalityQuiz.questions.length
|
|
296
|
+
] }),
|
|
297
|
+
/* @__PURE__ */ t("p", { css: xe.questionText, children: e.question.question })
|
|
298
|
+
] }),
|
|
299
|
+
/* @__PURE__ */ t(
|
|
300
|
+
Tt,
|
|
301
|
+
{
|
|
302
|
+
options: e.question.options || [],
|
|
303
|
+
answerQuestion: e.answerQuestion,
|
|
304
|
+
selectedOption: e.selectedOption,
|
|
305
|
+
optionsLayout: x ? "column" : o ?? "row",
|
|
306
|
+
questionImage: a,
|
|
307
|
+
brandingColors: u
|
|
308
|
+
}
|
|
309
|
+
)
|
|
310
|
+
] }) }),
|
|
311
|
+
/* @__PURE__ */ p("div", { css: s ? xe.footerMobile : xe.footer, children: [
|
|
312
|
+
/* @__PURE__ */ t(
|
|
313
|
+
V,
|
|
314
|
+
{
|
|
315
|
+
brandingLogo: b,
|
|
316
|
+
textColor: Q.textColor,
|
|
317
|
+
label: ((X = e.personalityQuiz.labels) == null ? void 0 : X.sponsor) || null,
|
|
318
|
+
primaryUrl: (le = (te = e.personalityQuiz.branding) == null ? void 0 : te.urls) == null ? void 0 : le.primaryUrl,
|
|
319
|
+
secondaryUrl: (ge = (se = e.personalityQuiz.branding) == null ? void 0 : se.urls) == null ? void 0 : ge.secondaryUrl
|
|
320
|
+
}
|
|
321
|
+
),
|
|
322
|
+
e.applyConsentGate ? /* @__PURE__ */ t(
|
|
323
|
+
tt,
|
|
324
|
+
{
|
|
325
|
+
onClick: e.startPlaying,
|
|
326
|
+
label: ((_ = (ae = e.consents) == null ? void 0 : ae.labels) == null ? void 0 : _.ctaLabel) || l("personalityQuiz.buttons.start"),
|
|
327
|
+
isSubmitting: e.isSubmitting,
|
|
328
|
+
primaryColor: P,
|
|
329
|
+
showArrow: !0
|
|
330
|
+
}
|
|
331
|
+
) : !i && /* @__PURE__ */ t(
|
|
332
|
+
Di,
|
|
333
|
+
{
|
|
334
|
+
label: S,
|
|
335
|
+
primaryColor: P,
|
|
336
|
+
onPrimaryColor: w.palette.primary.onPrimary,
|
|
337
|
+
radius: c.customRadius.light.xl,
|
|
338
|
+
pushToEnd: !s && y,
|
|
339
|
+
disabled: e.selectedOption === null,
|
|
340
|
+
isLoading: e.isLoading,
|
|
341
|
+
onClick: e.handleNext,
|
|
342
|
+
endDecorator: /* @__PURE__ */ t(zt, { children: /* @__PURE__ */ t(Dt, {}) })
|
|
343
|
+
}
|
|
344
|
+
)
|
|
345
|
+
] })
|
|
346
|
+
]
|
|
347
|
+
}
|
|
348
|
+
);
|
|
349
|
+
}, ut = {
|
|
350
|
+
root: n(yi, { paddingBlock: "10px", paddingRight: "12px", paddingLeft: "16px" }),
|
|
351
|
+
label: n(hi),
|
|
352
|
+
// Joy's endDecorator: an 8px gap; icons sized and coloured like the label.
|
|
353
|
+
decorator: n({
|
|
354
|
+
display: "flex",
|
|
355
|
+
marginLeft: "8px",
|
|
356
|
+
"--Icon-fontSize": "1em",
|
|
357
|
+
"--Icon-color": "var(--fu-ucrc-primary-on-primary)"
|
|
358
|
+
})
|
|
359
|
+
}, Bi = { "--Icon-margin": "0 -4px 0 0" }, Wn = (e) => /* @__PURE__ */ p(
|
|
360
|
+
"button",
|
|
361
|
+
{
|
|
362
|
+
type: "button",
|
|
363
|
+
css: ut.root,
|
|
364
|
+
style: { "--fu-ucrc-cta-bg": e.buttonColor },
|
|
365
|
+
disabled: e.isLoading || e.selectedOption === null,
|
|
366
|
+
onClick: e.onClick,
|
|
367
|
+
children: [
|
|
368
|
+
/* @__PURE__ */ t("p", { css: ut.label, children: e.label }),
|
|
369
|
+
e.endDecorator && /* @__PURE__ */ t("span", { css: ut.decorator, style: Bi, children: e.endDecorator }),
|
|
370
|
+
e.isLoading && /* @__PURE__ */ t(En, { size: 20, thickness: 3 })
|
|
371
|
+
]
|
|
372
|
+
}
|
|
373
|
+
), en = {
|
|
374
|
+
root: n({ display: "flex", justifyContent: "center", gap: "8px", paddingBlock: "var(--fu-ucrc-space-xs)" }),
|
|
375
|
+
step: n({
|
|
376
|
+
maxWidth: "82.67px",
|
|
377
|
+
width: "100%",
|
|
378
|
+
height: "8px",
|
|
379
|
+
borderRadius: "var(--fu-ucrc-pq-step-radius)",
|
|
380
|
+
borderWidth: "1px",
|
|
381
|
+
borderStyle: "solid",
|
|
382
|
+
transition: "background-color 0.3s ease"
|
|
383
|
+
})
|
|
384
|
+
}, Ui = (e) => {
|
|
385
|
+
const i = ne(), r = i.colorSchemes.light, o = (c) => {
|
|
386
|
+
const a = c + 1;
|
|
387
|
+
return a < e.currentQuestion ? [r.palette.success.plainColor, r.palette.success.outlinedBorder] : a === e.currentQuestion ? [
|
|
388
|
+
e.brandingPrimaryColor || r.palette.primary.plainColor,
|
|
389
|
+
e.brandingPrimaryColor || r.palette.primary.outlinedBorder
|
|
390
|
+
] : [r.secondaryContainer, r.outlineEnabledBorder];
|
|
391
|
+
};
|
|
392
|
+
return /* @__PURE__ */ t("div", { css: en.root, style: { "--fu-ucrc-pq-step-radius": i.customRadius.light.full }, children: Array.from({ length: e.personalityQuiz.questions.length }, (c, a) => {
|
|
393
|
+
const [l, s] = o(a);
|
|
394
|
+
return /* @__PURE__ */ t("div", { css: en.step, style: { backgroundColor: l, borderColor: s } }, `step-${a + 1}`);
|
|
395
|
+
}) });
|
|
396
|
+
}, tn = {
|
|
397
|
+
display: "flex",
|
|
398
|
+
width: "100%",
|
|
399
|
+
borderRadius: "var(--fu-ucrc-radius-md)",
|
|
400
|
+
border: "var(--fu-ucrc-border-size) solid var(--fu-ucrc-pq-card-border, var(--fu-ucrc-secondary-container))",
|
|
401
|
+
overflow: "hidden",
|
|
402
|
+
background: "var(--fu-ucrc-surface)",
|
|
403
|
+
minHeight: "250px"
|
|
404
|
+
}, nn = {
|
|
405
|
+
row: n({ ...tn, flexDirection: "row" }),
|
|
406
|
+
column: n({ ...tn, flexDirection: "column" })
|
|
407
|
+
}, K = ({ children: e, brandingBorderColor: i }) => {
|
|
408
|
+
const r = Y();
|
|
409
|
+
return /* @__PURE__ */ t(
|
|
410
|
+
"div",
|
|
411
|
+
{
|
|
412
|
+
css: r ? nn.column : nn.row,
|
|
413
|
+
style: i ? { "--fu-ucrc-pq-card-border": i } : void 0,
|
|
414
|
+
children: e
|
|
415
|
+
}
|
|
416
|
+
);
|
|
417
|
+
}, Ee = { display: "flex", flexDirection: "column" }, Ne = {
|
|
418
|
+
display: "flex",
|
|
419
|
+
alignItems: "center",
|
|
420
|
+
gap: g("lg")
|
|
421
|
+
}, E = {
|
|
422
|
+
pagination: n({ ...Ee, gap: g("md"), paddingInline: g("md") }),
|
|
423
|
+
area: n({ ...Ee, padding: g("md") }),
|
|
424
|
+
question: n({ ...Ee, gap: g("md") }),
|
|
425
|
+
questionNarrow: n({ ...Ee, gap: g("lg") }),
|
|
426
|
+
content: n({
|
|
427
|
+
...Ee,
|
|
428
|
+
borderRadius: "var(--fu-ucrc-radius-md)",
|
|
429
|
+
paddingInline: g("md"),
|
|
430
|
+
paddingTop: g("md"),
|
|
431
|
+
paddingBottom: g("lg"),
|
|
432
|
+
gap: g("md"),
|
|
433
|
+
backgroundColor: "var(--fu-ucrc-pq-content-bg)",
|
|
434
|
+
backdropFilter: "blur(4px)"
|
|
435
|
+
}),
|
|
436
|
+
imageBox: n({
|
|
437
|
+
borderRadius: "var(--fu-ucrc-radius-sm)",
|
|
438
|
+
overflow: "hidden"
|
|
439
|
+
}),
|
|
440
|
+
textRow: n({ gap: "8px", display: "flex", justifyContent: "center" }),
|
|
441
|
+
text: n({
|
|
442
|
+
...fe,
|
|
443
|
+
unicodeBidi: "plaintext",
|
|
444
|
+
fontFamily: "var(--fu-ucrc-font-primary)",
|
|
445
|
+
lineHeight: "150%",
|
|
446
|
+
letterSpacing: "0.15px",
|
|
447
|
+
fontWeight: 500,
|
|
448
|
+
fontSize: "1.25em",
|
|
449
|
+
textAlign: "center",
|
|
450
|
+
color: "var(--fu-ucrc-pq-text)"
|
|
451
|
+
}),
|
|
452
|
+
footer: n({ ...Ne, justifyContent: "space-between" }),
|
|
453
|
+
footerEnd: n({ ...Ne, justifyContent: "flex-end" }),
|
|
454
|
+
footerColumn: n({
|
|
455
|
+
...Ne,
|
|
456
|
+
flexDirection: "column",
|
|
457
|
+
justifyContent: "space-between"
|
|
458
|
+
}),
|
|
459
|
+
footerColumnEnd: n({
|
|
460
|
+
...Ne,
|
|
461
|
+
flexDirection: "column",
|
|
462
|
+
justifyContent: "flex-end"
|
|
463
|
+
}),
|
|
464
|
+
navigation: n({
|
|
465
|
+
display: "flex",
|
|
466
|
+
gap: g("md"),
|
|
467
|
+
justifyContent: "center",
|
|
468
|
+
alignItems: "center"
|
|
469
|
+
})
|
|
470
|
+
}, Mi = {
|
|
471
|
+
width: "100%",
|
|
472
|
+
height: "100%",
|
|
473
|
+
objectFit: "cover"
|
|
474
|
+
}, $i = (e) => {
|
|
475
|
+
var R, z, A, L, N, d;
|
|
476
|
+
const [i, r] = Xe.useState(
|
|
477
|
+
((R = e.leads) == null ? void 0 : R.position) === "before" && e.personalityQuiz.authRequirement === "LEAD"
|
|
478
|
+
), { optionsLayout: o } = Ct(It), c = Ze(e.question.images), { t: a } = H(), l = Y(), s = ii(), x = ue("md"), y = re(), m = ((z = e.personalityQuiz.branding) == null ? void 0 : z.colors) || null, u = l ? ((A = e.personalityQuiz.branding) == null ? void 0 : A.images.mobileLogo) || ((L = e.personalityQuiz.branding) == null ? void 0 : L.images.mainLogo) || "" : ((N = e.personalityQuiz.branding) == null ? void 0 : N.images.mainLogo) || "", b = e.imagePosition || "left", f = he(
|
|
479
|
+
{
|
|
480
|
+
images: e.personalityQuiz.images,
|
|
481
|
+
imagePlaceholder: e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : ""
|
|
482
|
+
},
|
|
483
|
+
G.STANDARD
|
|
484
|
+
), v = e.currentQuestion === e.personalityQuiz.questions.length && (((d = e.leads) == null ? void 0 : d.position) === "after" || e.hasAfterConsents) ? a("personalityQuiz.buttons.continue") : e.currentQuestion === e.personalityQuiz.questions.length ? a("personalityQuiz.buttons.finish") : a("personalityQuiz.buttons.next"), D = s || l && !!f, S = (m == null ? void 0 : m.contentColor) || y.textColor, Q = Oe(
|
|
485
|
+
(m == null ? void 0 : m.backgroundColor) || y.surfaceVariant || ""
|
|
486
|
+
), w = (m == null ? void 0 : m.primaryColor) || y.palette.primary.plainColor, P = {
|
|
487
|
+
"--fu-ucrc-pq-text": S,
|
|
488
|
+
"--fu-ucrc-pq-content-bg": `rgba(${Q ? Q.replace(/[^\d,]/g, "") : ""}, 0.5)`
|
|
489
|
+
}, C = () => {
|
|
490
|
+
r(!1);
|
|
491
|
+
}, B = (q) => {
|
|
492
|
+
var M, $, ee, X, te;
|
|
493
|
+
return /* @__PURE__ */ t(
|
|
494
|
+
V,
|
|
495
|
+
{
|
|
496
|
+
brandingLogo: u,
|
|
497
|
+
textColor: q,
|
|
498
|
+
label: ((M = e.personalityQuiz.labels) == null ? void 0 : M.sponsor) || null,
|
|
499
|
+
primaryUrl: (ee = ($ = e.personalityQuiz.branding) == null ? void 0 : $.urls) == null ? void 0 : ee.primaryUrl,
|
|
500
|
+
secondaryUrl: (te = (X = e.personalityQuiz.branding) == null ? void 0 : X.urls) == null ? void 0 : te.secondaryUrl
|
|
501
|
+
}
|
|
502
|
+
);
|
|
503
|
+
}, O = () => {
|
|
504
|
+
var q, M, $;
|
|
505
|
+
return /* @__PURE__ */ t("div", { css: E.area, style: P, children: /* @__PURE__ */ p("div", { css: x ? E.question : E.questionNarrow, children: [
|
|
506
|
+
/* @__PURE__ */ t("div", { css: E.content, children: /* @__PURE__ */ t(
|
|
507
|
+
Te,
|
|
508
|
+
{
|
|
509
|
+
consents: e.consents,
|
|
510
|
+
primaryColor: w,
|
|
511
|
+
textColor: S,
|
|
512
|
+
brandingUrls: (q = e.personalityQuiz.branding) == null ? void 0 : q.urls,
|
|
513
|
+
align: "center"
|
|
514
|
+
}
|
|
515
|
+
) }),
|
|
516
|
+
/* @__PURE__ */ p(
|
|
517
|
+
"div",
|
|
518
|
+
{
|
|
519
|
+
css: D ? u ? E.footerColumn : E.footerColumnEnd : u ? E.footer : E.footerEnd,
|
|
520
|
+
children: [
|
|
521
|
+
u && !D && B(S),
|
|
522
|
+
/* @__PURE__ */ t("div", { css: E.navigation, children: /* @__PURE__ */ t(
|
|
523
|
+
tt,
|
|
524
|
+
{
|
|
525
|
+
onClick: e.startPlaying,
|
|
526
|
+
label: (($ = (M = e.consents) == null ? void 0 : M.labels) == null ? void 0 : $.ctaLabel) || a("personalityQuiz.buttons.start"),
|
|
527
|
+
isSubmitting: e.isSubmitting,
|
|
528
|
+
primaryColor: w,
|
|
529
|
+
showArrow: !0
|
|
530
|
+
}
|
|
531
|
+
) })
|
|
532
|
+
]
|
|
533
|
+
}
|
|
534
|
+
),
|
|
535
|
+
u && D && B(S)
|
|
536
|
+
] }) });
|
|
537
|
+
}, k = () => {
|
|
538
|
+
var q, M, $, ee, X, te, le, se, ge, ae, _;
|
|
539
|
+
return /* @__PURE__ */ t("div", { css: E.area, style: P, children: /* @__PURE__ */ p("div", { css: x ? E.question : E.questionNarrow, children: [
|
|
540
|
+
/* @__PURE__ */ t("div", { css: E.content, children: /* @__PURE__ */ t(
|
|
541
|
+
Be,
|
|
542
|
+
{
|
|
543
|
+
sdk: e.sdk,
|
|
544
|
+
startGame: C,
|
|
545
|
+
contentId: e.personalityQuiz.id,
|
|
546
|
+
contentName: e.personalityQuiz.title,
|
|
547
|
+
brandingColors: (q = e.personalityQuiz.branding) == null ? void 0 : q.colors,
|
|
548
|
+
brandingUrls: (M = e.personalityQuiz.branding) == null ? void 0 : M.urls,
|
|
549
|
+
campaignId: ($ = e.leads) == null ? void 0 : $.campaignId,
|
|
550
|
+
campaignName: (ee = e.leads) == null ? void 0 : ee.campaignName,
|
|
551
|
+
fields: (X = e.leads) == null ? void 0 : X.fields,
|
|
552
|
+
leadTitle: (te = e.personalityQuiz.labels) == null ? void 0 : te.leadTitle,
|
|
553
|
+
leadDescription: (le = e.personalityQuiz.labels) == null ? void 0 : le.leadDescription,
|
|
554
|
+
leadCta: (se = e.personalityQuiz.labels) == null ? void 0 : se.leadCta,
|
|
555
|
+
leadSuccessTitle: (ge = e.personalityQuiz.labels) == null ? void 0 : ge.leadSuccessTitle,
|
|
556
|
+
leadSuccessDescription: (ae = e.personalityQuiz.labels) == null ? void 0 : ae.leadSuccessDescription,
|
|
557
|
+
syncWithProfile: (_ = e.leads) == null ? void 0 : _.syncWithProfile,
|
|
558
|
+
consents: e.leadConsents
|
|
559
|
+
}
|
|
560
|
+
) }),
|
|
561
|
+
B(S)
|
|
562
|
+
] }) });
|
|
563
|
+
}, I = () => /* @__PURE__ */ p(Re, { children: [
|
|
564
|
+
/* @__PURE__ */ t("div", { css: E.pagination, children: /* @__PURE__ */ t(
|
|
565
|
+
Ui,
|
|
566
|
+
{
|
|
567
|
+
personalityQuiz: e.personalityQuiz,
|
|
568
|
+
currentQuestion: e.currentQuestion,
|
|
569
|
+
userParticipation: e.userParticipation,
|
|
570
|
+
brandingPrimaryColor: m == null ? void 0 : m.primaryColor
|
|
571
|
+
}
|
|
572
|
+
) }),
|
|
573
|
+
/* @__PURE__ */ t("div", { css: E.area, style: P, children: /* @__PURE__ */ p("div", { css: x ? E.question : E.questionNarrow, children: [
|
|
574
|
+
/* @__PURE__ */ p("div", { css: E.content, children: [
|
|
575
|
+
c && /* @__PURE__ */ t(et, { ratio: "16/9", radius: "var(--fu-ucrc-radius-sm)", children: /* @__PURE__ */ t("div", { css: E.imageBox, children: /* @__PURE__ */ t(
|
|
576
|
+
"img",
|
|
577
|
+
{
|
|
578
|
+
src: c,
|
|
579
|
+
alt: "Question illustration",
|
|
580
|
+
style: Mi
|
|
581
|
+
}
|
|
582
|
+
) }) }),
|
|
583
|
+
/* @__PURE__ */ t("div", { css: E.textRow, children: /* @__PURE__ */ t("p", { css: E.text, children: e.question.question }) }),
|
|
584
|
+
/* @__PURE__ */ t(
|
|
585
|
+
Tt,
|
|
586
|
+
{
|
|
587
|
+
options: e.question.options || [],
|
|
588
|
+
answerQuestion: e.answerQuestion,
|
|
589
|
+
selectedOption: e.selectedOption,
|
|
590
|
+
optionsLayout: o ?? "twoByTwo",
|
|
591
|
+
questionImage: c,
|
|
592
|
+
brandingColors: m
|
|
593
|
+
}
|
|
594
|
+
)
|
|
595
|
+
] }),
|
|
596
|
+
/* @__PURE__ */ p(
|
|
597
|
+
"div",
|
|
598
|
+
{
|
|
599
|
+
css: D ? u ? E.footerColumn : E.footerColumnEnd : u ? E.footer : E.footerEnd,
|
|
600
|
+
children: [
|
|
601
|
+
u && !D && B(S),
|
|
602
|
+
/* @__PURE__ */ t("div", { css: E.navigation, children: /* @__PURE__ */ t(
|
|
603
|
+
Wn,
|
|
604
|
+
{
|
|
605
|
+
selectedOption: e.selectedOption,
|
|
606
|
+
endDecorator: /* @__PURE__ */ t(zt, { children: /* @__PURE__ */ t(Dt, {}) }),
|
|
607
|
+
label: v,
|
|
608
|
+
buttonColor: w,
|
|
609
|
+
onClick: e.handleNext,
|
|
610
|
+
isLoading: e.isLoading
|
|
611
|
+
}
|
|
612
|
+
) })
|
|
613
|
+
]
|
|
614
|
+
}
|
|
615
|
+
),
|
|
616
|
+
u && D && B(S)
|
|
617
|
+
] }) })
|
|
618
|
+
] });
|
|
619
|
+
return /* @__PURE__ */ t(K, { brandingBorderColor: (m == null ? void 0 : m.borderColor) || null, children: /* @__PURE__ */ t(
|
|
620
|
+
bi,
|
|
621
|
+
{
|
|
622
|
+
entity: e.personalityQuiz,
|
|
623
|
+
headline: a("personalityQuiz.headline"),
|
|
624
|
+
finalImage: f,
|
|
625
|
+
imagePosition: b,
|
|
626
|
+
rulesDisplay: e.rulesDisplay,
|
|
627
|
+
children: e.applyConsentGate ? O() : i ? k() : I()
|
|
628
|
+
}
|
|
629
|
+
) });
|
|
630
|
+
}, ft = "var(--fu-ucrc-radius-sm)", an = {
|
|
631
|
+
margin: 0,
|
|
632
|
+
fontFamily: "var(--fu-ucrc-font-primary)",
|
|
633
|
+
lineHeight: "150%",
|
|
634
|
+
letterSpacing: "0.15px",
|
|
635
|
+
fontWeight: 500,
|
|
636
|
+
fontSize: "1.25em",
|
|
637
|
+
textAlign: "center"
|
|
638
|
+
}, ce = {
|
|
639
|
+
questionArea: n({ width: "100%", justifyContent: "center", display: "flex", flexDirection: "column" }),
|
|
640
|
+
questionAreaContent: n({
|
|
641
|
+
padding: g("md"),
|
|
642
|
+
display: "flex",
|
|
643
|
+
flexDirection: "column",
|
|
644
|
+
justifyContent: "center",
|
|
645
|
+
gap: g("md")
|
|
646
|
+
}),
|
|
647
|
+
// Translucent panel over the card, from the branding background: `--fu-ucrc-pq-split-bg`.
|
|
648
|
+
panel: n({
|
|
649
|
+
padding: g("md"),
|
|
650
|
+
gap: g("md"),
|
|
651
|
+
display: "flex",
|
|
652
|
+
flexDirection: "column",
|
|
653
|
+
backdropFilter: "blur(4px)",
|
|
654
|
+
backgroundColor: "var(--fu-ucrc-pq-split-bg)",
|
|
655
|
+
borderRadius: ft
|
|
656
|
+
}),
|
|
657
|
+
// Joy's `height: auto` lost to the AspectRatio's child rule.
|
|
658
|
+
questionImage: n({ borderRadius: ft, overflow: "hidden" }),
|
|
659
|
+
questionSection: n({ gap: g("2xs"), display: "flex", flexDirection: "column", justifyContent: "center" }),
|
|
660
|
+
questionSteps: n(an, { color: "var(--fu-ucrc-pq-split-secondary)", opacity: "60%" }),
|
|
661
|
+
questionText: n(an, { unicodeBidi: "plaintext", color: "var(--fu-ucrc-text-color)" }),
|
|
662
|
+
buttonFooter: n({ display: "flex", flexDirection: "column", gap: g("lg") }),
|
|
663
|
+
presentedBy: n({ marginBottom: g("lg"), paddingInline: g("lg") })
|
|
664
|
+
}, Ei = { width: "100%", height: "100%", objectFit: "cover" }, Fi = (e) => {
|
|
665
|
+
var k, I, R, z, A, L, N, d, q, M, $, ee, X, te, le, se, ge, ae, _;
|
|
666
|
+
const [i, r] = Xe.useState(
|
|
667
|
+
((k = e.leads) == null ? void 0 : k.position) === "before" && e.personalityQuiz.authRequirement === "LEAD"
|
|
668
|
+
), { optionsLayout: o } = Ct(It), c = ne(), a = re(), l = Y(), s = St(), x = ue("md"), y = e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : l ? Se : ze, m = he(
|
|
669
|
+
{
|
|
670
|
+
images: e.personalityQuiz.images,
|
|
671
|
+
imagePlaceholder: y
|
|
672
|
+
},
|
|
673
|
+
G.SPLIT
|
|
674
|
+
), u = Ze(e.question.images), { t: b } = H(), f = ((I = e.personalityQuiz.branding) == null ? void 0 : I.colors) || null, v = l ? ((R = e.personalityQuiz.branding) == null ? void 0 : R.images.mobileLogo) || ((z = e.personalityQuiz.branding) == null ? void 0 : z.images.mainLogo) || "" : ((A = e.personalityQuiz.branding) == null ? void 0 : A.images.mainLogo) || "", D = e.currentQuestion === e.personalityQuiz.questions.length && (((L = e.leads) == null ? void 0 : L.position) === "after" || e.hasAfterConsents) ? b("personalityQuiz.buttons.continue") : e.currentQuestion === e.personalityQuiz.questions.length ? b("personalityQuiz.buttons.finish") : b("personalityQuiz.buttons.next"), S = a.textColor, Q = (f == null ? void 0 : f.primaryColor) || ((d = (N = a.palette) == null ? void 0 : N.primary) == null ? void 0 : d.plainColor), w = Oe((f == null ? void 0 : f.backgroundColor) || a.surfaceVariant || ""), P = {
|
|
675
|
+
"--fu-ucrc-pq-split-secondary": (f == null ? void 0 : f.contentColor) || S,
|
|
676
|
+
"--fu-ucrc-pq-split-bg": `rgba(${w ? w.replace(/[^\d,]/g, "") : ""}, 0.5)`
|
|
677
|
+
}, C = () => {
|
|
678
|
+
r(!1);
|
|
679
|
+
}, B = (be) => {
|
|
680
|
+
var Pe, Ue, we, nt, ye;
|
|
681
|
+
return /* @__PURE__ */ t(
|
|
682
|
+
V,
|
|
683
|
+
{
|
|
684
|
+
brandingLogo: v,
|
|
685
|
+
textColor: be,
|
|
686
|
+
label: ((Pe = e.personalityQuiz.labels) == null ? void 0 : Pe.sponsor) || null,
|
|
687
|
+
primaryUrl: (we = (Ue = e.personalityQuiz.branding) == null ? void 0 : Ue.urls) == null ? void 0 : we.primaryUrl,
|
|
688
|
+
secondaryUrl: (ye = (nt = e.personalityQuiz.branding) == null ? void 0 : nt.urls) == null ? void 0 : ye.secondaryUrl
|
|
689
|
+
}
|
|
690
|
+
);
|
|
691
|
+
}, O = () => {
|
|
692
|
+
var be;
|
|
693
|
+
return /* @__PURE__ */ t("div", { css: ce.panel, children: /* @__PURE__ */ t(
|
|
694
|
+
Te,
|
|
695
|
+
{
|
|
696
|
+
consents: e.consents,
|
|
697
|
+
primaryColor: Q,
|
|
698
|
+
textColor: S,
|
|
699
|
+
brandingUrls: (be = e.personalityQuiz.branding) == null ? void 0 : be.urls,
|
|
700
|
+
onSubmit: e.startPlaying,
|
|
701
|
+
isSubmitting: e.isSubmitting,
|
|
702
|
+
ctaLabel: b("personalityQuiz.buttons.start"),
|
|
703
|
+
align: "center",
|
|
704
|
+
showArrow: !0
|
|
705
|
+
}
|
|
706
|
+
) });
|
|
707
|
+
};
|
|
708
|
+
return /* @__PURE__ */ p(K, { brandingBorderColor: (f == null ? void 0 : f.borderColor) || null, children: [
|
|
709
|
+
/* @__PURE__ */ t(
|
|
710
|
+
pi,
|
|
711
|
+
{
|
|
712
|
+
entity: e.personalityQuiz,
|
|
713
|
+
headline: b("personalityQuiz.headline"),
|
|
714
|
+
finalImage: m,
|
|
715
|
+
brandingLogo: v,
|
|
716
|
+
renderPresentedBy: B,
|
|
717
|
+
rulesDisplay: e.rulesDisplay,
|
|
718
|
+
children: /* @__PURE__ */ t("div", { css: ce.questionArea, style: P, children: /* @__PURE__ */ p("div", { css: ce.questionAreaContent, children: [
|
|
719
|
+
e.applyConsentGate ? O() : i ? /* @__PURE__ */ t("div", { css: ce.panel, children: /* @__PURE__ */ t(
|
|
720
|
+
Be,
|
|
721
|
+
{
|
|
722
|
+
sdk: e.sdk,
|
|
723
|
+
startGame: C,
|
|
724
|
+
contentId: e.personalityQuiz.id,
|
|
725
|
+
contentName: e.personalityQuiz.title,
|
|
726
|
+
brandingColors: (q = e.personalityQuiz.branding) == null ? void 0 : q.colors,
|
|
727
|
+
brandingUrls: (M = e.personalityQuiz.branding) == null ? void 0 : M.urls,
|
|
728
|
+
campaignId: ($ = e.leads) == null ? void 0 : $.campaignId,
|
|
729
|
+
campaignName: (ee = e.leads) == null ? void 0 : ee.campaignName,
|
|
730
|
+
fields: (X = e.leads) == null ? void 0 : X.fields,
|
|
731
|
+
leadTitle: (te = e.personalityQuiz.labels) == null ? void 0 : te.leadTitle,
|
|
732
|
+
leadDescription: (le = e.personalityQuiz.labels) == null ? void 0 : le.leadDescription,
|
|
733
|
+
leadCta: (se = e.personalityQuiz.labels) == null ? void 0 : se.leadCta,
|
|
734
|
+
leadSuccessTitle: (ge = e.personalityQuiz.labels) == null ? void 0 : ge.leadSuccessTitle,
|
|
735
|
+
leadSuccessDescription: (ae = e.personalityQuiz.labels) == null ? void 0 : ae.leadSuccessDescription,
|
|
736
|
+
syncWithProfile: (_ = e.leads) == null ? void 0 : _.syncWithProfile,
|
|
737
|
+
consents: e.leadConsents
|
|
738
|
+
}
|
|
739
|
+
) }) : /* @__PURE__ */ p("div", { css: ce.panel, children: [
|
|
740
|
+
u && /* @__PURE__ */ t(et, { ratio: "16/9", radius: ft, children: /* @__PURE__ */ t("div", { css: ce.questionImage, children: /* @__PURE__ */ t("img", { src: u, alt: "Question illustration", style: Ei }) }) }),
|
|
741
|
+
/* @__PURE__ */ p("div", { css: ce.questionSection, children: [
|
|
742
|
+
/* @__PURE__ */ p("p", { css: ce.questionSteps, children: [
|
|
743
|
+
e.currentQuestion,
|
|
744
|
+
"/",
|
|
745
|
+
e.personalityQuiz.questions.length
|
|
746
|
+
] }),
|
|
747
|
+
/* @__PURE__ */ t("p", { css: ce.questionText, children: e.question.question })
|
|
748
|
+
] }),
|
|
749
|
+
/* @__PURE__ */ t(
|
|
750
|
+
Tt,
|
|
751
|
+
{
|
|
752
|
+
options: e.question.options || [],
|
|
753
|
+
answerQuestion: e.answerQuestion,
|
|
754
|
+
selectedOption: e.selectedOption,
|
|
755
|
+
optionsLayout: s ? "column" : o ?? "twoByTwo",
|
|
756
|
+
questionImage: u,
|
|
757
|
+
brandingColors: f
|
|
758
|
+
}
|
|
759
|
+
),
|
|
760
|
+
/* @__PURE__ */ p("div", { css: ce.buttonFooter, children: [
|
|
761
|
+
/* @__PURE__ */ t(
|
|
762
|
+
Wn,
|
|
763
|
+
{
|
|
764
|
+
selectedOption: e.selectedOption,
|
|
765
|
+
endDecorator: /* @__PURE__ */ t(zt, { children: /* @__PURE__ */ t(Dt, {}) }),
|
|
766
|
+
label: D,
|
|
767
|
+
buttonColor: Q,
|
|
768
|
+
onClick: e.handleNext,
|
|
769
|
+
isLoading: e.isLoading
|
|
770
|
+
}
|
|
771
|
+
),
|
|
772
|
+
v && !s && !x && /* @__PURE__ */ t("div", { children: B((f == null ? void 0 : f.contentColor) || S) })
|
|
773
|
+
] })
|
|
774
|
+
] }),
|
|
775
|
+
i && v && l ? B((f == null ? void 0 : f.contentColor) || c.colorSchemes.dark.textColor) : null
|
|
776
|
+
] }) })
|
|
777
|
+
}
|
|
778
|
+
),
|
|
779
|
+
v && s && /* @__PURE__ */ t("div", { css: ce.presentedBy, children: B((f == null ? void 0 : f.contentColor) || c.colorSchemes.dark.textColor) })
|
|
780
|
+
] });
|
|
781
|
+
}, Hi = "data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='mask0_929_1048'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='24'%20height='24'%3e%3crect%20width='24'%20height='24'%20fill='%23D9D9D9'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_929_1048)'%3e%3cpath%20d='M12%2020.6254L5.20005%2016.9254V11.1254L1.36255%209.01289L12%203.21289L22.65%209.01464V16.7504H20.775V10.0504L18.8%2011.1254V16.9254L12%2020.6254ZM12%2012.6754L18.75%209.01289L12%205.36289L5.26255%209.01289L12%2012.6754ZM12%2018.4879L16.925%2015.8296V12.1129L12%2014.8254L7.07505%2012.1129V15.8296L12%2018.4879Z'%20fill='%23212121'/%3e%3c/g%3e%3c/svg%3e", Oi = "data:image/svg+xml,%3csvg%20width='25'%20height='24'%20viewBox='0%200%2025%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='mask0_929_504'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='25'%20height='24'%3e%3crect%20x='0.5'%20width='24'%20height='24'%20fill='%23D9D9D9'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_929_504)'%3e%3cpath%20d='M9.6875%206H11.5625V4.125H9.6875V6ZM13.4375%206V4.125H15.3125V6H13.4375ZM9.6875%2013.5V11.625H11.5625V13.5H9.6875ZM17.1875%209.75V7.875H19.0625V9.75H17.1875ZM17.1875%2013.5V11.625H19.0625V13.5H17.1875ZM13.4375%2013.5V11.625H15.3125V13.5H13.4375ZM17.1875%206V4.125H19.0625V6H17.1875ZM11.5625%207.875V6H13.4375V7.875H11.5625ZM5.9375%2019.825V4.125H7.8125V6H9.6875V7.875H7.8125V9.75H9.6875V11.625H7.8125V19.825H5.9375ZM15.3125%2011.625V9.75H17.1875V11.625H15.3125ZM11.5625%2011.625V9.75H13.4375V11.625H11.5625ZM9.6875%209.75V7.875H11.5625V9.75H9.6875ZM13.4375%209.75V7.875H15.3125V9.75H13.4375ZM15.3125%207.875V6H17.1875V7.875H15.3125Z'%20fill='%23212121'/%3e%3c/g%3e%3c/svg%3e", Wi = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cmask%20id='mask0_929_360'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='20'%20height='20'%3e%3crect%20width='20'%20height='20'%20fill='%23D9D9D9'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_929_360)'%3e%3cpath%20d='M9.22917%2014.0625H10.7917V9.1875H9.22917V14.0625ZM9.99771%207.58333C10.2215%207.58333%2010.4097%207.50771%2010.5625%207.35646C10.7153%207.20507%2010.7917%207.01757%2010.7917%206.79396C10.7917%206.57021%2010.716%206.38194%2010.5648%206.22917C10.4134%206.07639%2010.2259%206%2010.0023%206C9.77854%206%209.59028%206.07563%209.4375%206.22688C9.28472%206.37826%209.20833%206.56576%209.20833%206.78938C9.20833%207.01313%209.28396%207.20139%209.43521%207.35417C9.5866%207.50694%209.7741%207.58333%209.99771%207.58333ZM10%2018.125C8.87625%2018.125%207.82021%2017.9114%206.83187%2017.4842C5.84368%2017.0568%204.98403%2016.4769%204.25292%2015.7446C3.52181%2015.0121%202.94271%2014.1522%202.51562%2013.1648C2.08854%2012.1776%201.875%2011.1226%201.875%2010C1.875%208.87625%202.08861%207.82021%202.51583%206.83187C2.94319%205.84368%203.52306%204.98403%204.25542%204.25292C4.98792%203.52181%205.84785%202.94271%206.83521%202.51562C7.82243%202.08854%208.87736%201.875%2010%201.875C11.1237%201.875%2012.1798%202.08861%2013.1681%202.51583C14.1563%202.94319%2015.016%203.52306%2015.7471%204.25542C16.4782%204.98792%2017.0573%205.84785%2017.4844%206.83521C17.9115%207.82243%2018.125%208.87736%2018.125%2010C18.125%2011.1237%2017.9114%2012.1798%2017.4842%2013.1681C17.0568%2014.1563%2016.4769%2015.016%2015.7446%2015.7471C15.0121%2016.4782%2014.1522%2017.0573%2013.1648%2017.4844C12.1776%2017.9115%2011.1226%2018.125%2010%2018.125ZM10%2016.5625C11.8264%2016.5625%2013.3767%2015.9253%2014.651%2014.651C15.9253%2013.3767%2016.5625%2011.8264%2016.5625%2010C16.5625%208.17361%2015.9253%206.62326%2014.651%205.34896C13.3767%204.07465%2011.8264%203.4375%2010%203.4375C8.17361%203.4375%206.62326%204.07465%205.34896%205.34896C4.07465%206.62326%203.4375%208.17361%203.4375%2010C3.4375%2011.8264%204.07465%2013.3767%205.34896%2014.651C6.62326%2015.9253%208.17361%2016.5625%2010%2016.5625Z'%20fill='%23212121'%20fill-opacity='0.6'/%3e%3c/g%3e%3c/svg%3e", rn = {
|
|
782
|
+
position: "relative",
|
|
783
|
+
boxSizing: "border-box",
|
|
784
|
+
display: "flex",
|
|
785
|
+
flexDirection: "column",
|
|
786
|
+
justifyContent: "center",
|
|
787
|
+
alignItems: "center",
|
|
788
|
+
flex: 1,
|
|
789
|
+
gap: "6px",
|
|
790
|
+
minWidth: 0,
|
|
791
|
+
minHeight: "36px",
|
|
792
|
+
margin: 0,
|
|
793
|
+
paddingBlock: "4px",
|
|
794
|
+
paddingInline: "16px",
|
|
795
|
+
border: "1px solid transparent",
|
|
796
|
+
borderBottom: "1px solid var(--fu-ucrc-secondary-container)",
|
|
797
|
+
borderRadius: 0,
|
|
798
|
+
backgroundColor: "transparent",
|
|
799
|
+
color: "inherit",
|
|
800
|
+
font: "inherit",
|
|
801
|
+
textAlign: "start",
|
|
802
|
+
cursor: "pointer",
|
|
803
|
+
opacity: "60%",
|
|
804
|
+
WebkitTapHighlightColor: "transparent",
|
|
805
|
+
"&:focus-visible": { outline: "2px solid var(--fu-ucrc-focus-visible)", outlineOffset: "2px" }
|
|
806
|
+
}, on = (e) => ({
|
|
807
|
+
off: n(rn, { "&:hover": { backgroundColor: e } }),
|
|
808
|
+
on: n(rn, {
|
|
809
|
+
backgroundColor: e,
|
|
810
|
+
borderBottom: "3px solid var(--fu-ucrc-pq-ssw-primary)",
|
|
811
|
+
opacity: "100%",
|
|
812
|
+
marginBottom: "-1px",
|
|
813
|
+
zIndex: 1
|
|
814
|
+
})
|
|
815
|
+
}), ln = { margin: 0, alignSelf: "stretch", fontStyle: "normal" }, yt = { display: "flex", width: "24px", height: "24px", justifyContent: "center", alignItems: "center" }, sn = { ...yt, width: "20px", height: "20px" }, cn = { filter: "brightness(0) invert(1)" }, dn = {
|
|
816
|
+
position: "relative",
|
|
817
|
+
zIndex: 1,
|
|
818
|
+
boxSizing: "border-box",
|
|
819
|
+
display: "flex",
|
|
820
|
+
paddingBottom: "1px",
|
|
821
|
+
fontSize: "1em",
|
|
822
|
+
// Joy's divider: the neutral channel at 20% (16% in dark mode).
|
|
823
|
+
boxShadow: "inset 0 -1px rgba(var(--fu-ucrc-neutral-main-channel) / 0.2)",
|
|
824
|
+
".dark &": { boxShadow: "inset 0 -1px rgba(var(--fu-ucrc-neutral-main-channel) / 0.16)" }
|
|
825
|
+
}, gt = { flexGrow: 1, fontSize: "1em", padding: 0 }, un = { flexGrow: 1, overflowY: "auto", fontSize: "1em", padding: "16px" }, W = {
|
|
826
|
+
root: n({ width: "100%" }),
|
|
827
|
+
// Joy's Tabs: it set the body font, 1.5 line height and neutral colour the panels inherit.
|
|
828
|
+
tabs: n({
|
|
829
|
+
position: "relative",
|
|
830
|
+
display: "flex",
|
|
831
|
+
flexDirection: "column",
|
|
832
|
+
minWidth: 0,
|
|
833
|
+
width: "100%",
|
|
834
|
+
borderRadius: "var(--fu-ucrc-radius-md)",
|
|
835
|
+
backgroundColor: "transparent",
|
|
836
|
+
fontFamily: "var(--fu-ucrc-font-body)",
|
|
837
|
+
lineHeight: 1.5,
|
|
838
|
+
color: "var(--fu-ucrc-neutral-plain-color)"
|
|
839
|
+
}),
|
|
840
|
+
list: n(dn, { flexDirection: "row" }),
|
|
841
|
+
listMobile: n(dn, { flexDirection: "column" }),
|
|
842
|
+
tab: { plain: on("#2121210A"), overlay: on("#FAFAFA14") },
|
|
843
|
+
// Full width plus padding, so it overflows the tab's padding and is centred over it.
|
|
844
|
+
tabContent: n({
|
|
845
|
+
display: "flex",
|
|
846
|
+
paddingBlock: "12px",
|
|
847
|
+
paddingInline: "16px",
|
|
848
|
+
justifyContent: "center",
|
|
849
|
+
alignItems: "center",
|
|
850
|
+
gap: "8px",
|
|
851
|
+
width: "100%"
|
|
852
|
+
}),
|
|
853
|
+
tabIcon: n(yt),
|
|
854
|
+
tabIconInverted: n(yt, cn),
|
|
855
|
+
tabLabel: n({
|
|
856
|
+
margin: 0,
|
|
857
|
+
color: "var(--fu-ucrc-text-secondary)",
|
|
858
|
+
fontFamily: "var(--fu-ucrc-font-primary)",
|
|
859
|
+
fontSize: "1em",
|
|
860
|
+
fontStyle: "normal",
|
|
861
|
+
fontWeight: 500,
|
|
862
|
+
lineHeight: "24px",
|
|
863
|
+
letterSpacing: "0.4px",
|
|
864
|
+
textTransform: "uppercase"
|
|
865
|
+
}),
|
|
866
|
+
results: {
|
|
867
|
+
column: n(gt, { display: "flex", flexDirection: "column" }),
|
|
868
|
+
row: n(gt, { display: "flex", flexDirection: "row" }),
|
|
869
|
+
block: n(gt)
|
|
870
|
+
},
|
|
871
|
+
answersPanel: n(un),
|
|
872
|
+
answersPanelMd: n(un, { maxHeight: "450px" }),
|
|
873
|
+
answers: n({
|
|
874
|
+
display: "flex",
|
|
875
|
+
flexDirection: "column",
|
|
876
|
+
justifyContent: "center",
|
|
877
|
+
alignItems: "center",
|
|
878
|
+
gap: "16px",
|
|
879
|
+
alignSelf: "stretch"
|
|
880
|
+
}),
|
|
881
|
+
answer: n({
|
|
882
|
+
borderRadius: "var(--fu-ucrc-radius-md)",
|
|
883
|
+
padding: "var(--fu-ucrc-space-md)",
|
|
884
|
+
display: "flex",
|
|
885
|
+
flexDirection: "column",
|
|
886
|
+
alignItems: "center",
|
|
887
|
+
alignSelf: "stretch",
|
|
888
|
+
gap: "var(--fu-ucrc-space-md)",
|
|
889
|
+
backdropFilter: "blur(4px)",
|
|
890
|
+
position: "relative",
|
|
891
|
+
"&::before": {
|
|
892
|
+
content: '""',
|
|
893
|
+
position: "absolute",
|
|
894
|
+
top: 0,
|
|
895
|
+
left: 0,
|
|
896
|
+
right: 0,
|
|
897
|
+
bottom: 0,
|
|
898
|
+
backgroundColor: "var(--fu-ucrc-pq-ssw-content-bg)",
|
|
899
|
+
opacity: 0.5,
|
|
900
|
+
borderRadius: "inherit",
|
|
901
|
+
zIndex: 0,
|
|
902
|
+
backdropFilter: "blur(4px)"
|
|
903
|
+
},
|
|
904
|
+
"& > *": { position: "relative", zIndex: 1 }
|
|
905
|
+
}),
|
|
906
|
+
single: n({ display: "flex", flexDirection: "column", alignItems: "flex-start", gap: "12px", alignSelf: "stretch" }),
|
|
907
|
+
question: n({ display: "flex", flexDirection: "column", alignItems: "flex-start", alignSelf: "stretch" }),
|
|
908
|
+
questionNumber: n(ln, {
|
|
909
|
+
color: "var(--fu-ucrc-text-secondary)",
|
|
910
|
+
fontFamily: "var(--fu-ucrc-font-secondary)",
|
|
911
|
+
fontSize: "0.75em",
|
|
912
|
+
fontWeight: 500,
|
|
913
|
+
lineHeight: "166%",
|
|
914
|
+
letterSpacing: "1px",
|
|
915
|
+
textTransform: "uppercase"
|
|
916
|
+
}),
|
|
917
|
+
questionText: n(ln, {
|
|
918
|
+
unicodeBidi: "plaintext",
|
|
919
|
+
color: "var(--fu-ucrc-text-primary)",
|
|
920
|
+
fontFamily: "var(--fu-ucrc-font-primary)",
|
|
921
|
+
fontSize: "1.25em",
|
|
922
|
+
fontWeight: 500,
|
|
923
|
+
lineHeight: "120%",
|
|
924
|
+
letterSpacing: "0.15px"
|
|
925
|
+
}),
|
|
926
|
+
outcome: n({ alignSelf: "stretch" }),
|
|
927
|
+
yourAnswer: n({
|
|
928
|
+
margin: 0,
|
|
929
|
+
color: "var(--fu-ucrc-text-primary)",
|
|
930
|
+
fontFamily: "var(--fu-ucrc-font-secondary)",
|
|
931
|
+
fontSize: "1em",
|
|
932
|
+
fontStyle: "normal",
|
|
933
|
+
fontWeight: 700,
|
|
934
|
+
lineHeight: "20px",
|
|
935
|
+
letterSpacing: "0.15px"
|
|
936
|
+
}),
|
|
937
|
+
explanation: n({
|
|
938
|
+
display: "flex",
|
|
939
|
+
paddingBlock: "4px",
|
|
940
|
+
paddingRight: "16px",
|
|
941
|
+
paddingLeft: "0px",
|
|
942
|
+
justifyContent: "center",
|
|
943
|
+
gap: "10px",
|
|
944
|
+
alignItems: "flex-start",
|
|
945
|
+
alignSelf: "stretch"
|
|
946
|
+
}),
|
|
947
|
+
explanationIcon: n(sn),
|
|
948
|
+
explanationIconInverted: n(sn, cn),
|
|
949
|
+
explanationText: n({
|
|
950
|
+
margin: 0,
|
|
951
|
+
unicodeBidi: "plaintext",
|
|
952
|
+
flex: "1 0 0",
|
|
953
|
+
color: "var(--fu-ucrc-text-primary)",
|
|
954
|
+
fontFamily: "var(--fu-ucrc-font-secondary)",
|
|
955
|
+
fontSize: "0.875em",
|
|
956
|
+
fontStyle: "normal",
|
|
957
|
+
fontWeight: 400,
|
|
958
|
+
lineHeight: "143%",
|
|
959
|
+
letterSpacing: "0.17px"
|
|
960
|
+
})
|
|
961
|
+
}, Bt = ({
|
|
962
|
+
questions: e,
|
|
963
|
+
userParticipation: i,
|
|
964
|
+
resultsLayout: r,
|
|
965
|
+
isOverlayVariant: o,
|
|
966
|
+
children: c,
|
|
967
|
+
brandingColors: a
|
|
968
|
+
}) => {
|
|
969
|
+
const [l, s] = U(0), [x, y] = U(0), m = Ce([]), u = Je(), b = Ke(), f = ne(), { t: v } = H(), D = Y(), S = ue("md"), Q = o || f.mode == "dark", w = o ? "overlay" : "plain", P = {
|
|
970
|
+
"--fu-ucrc-pq-ssw-primary": (a == null ? void 0 : a.primaryColor) || "var(--fu-ucrc-text-primary)",
|
|
971
|
+
// Kept as it was: any branding background picks the dark scheme's surface.
|
|
972
|
+
"--fu-ucrc-pq-ssw-content-bg": a != null && a.backgroundColor || o ? f.colorSchemes.dark.surfaceVariant : "var(--fu-ucrc-surface-variant)"
|
|
973
|
+
}, C = [
|
|
974
|
+
{ icon: Oi, label: v("classicQuiz.results") },
|
|
975
|
+
{ icon: Hi, label: v("classicQuiz.answers") }
|
|
976
|
+
], B = (z) => {
|
|
977
|
+
var L;
|
|
978
|
+
const A = (z + C.length) % C.length;
|
|
979
|
+
y(A), (L = m.current[A]) == null || L.focus();
|
|
980
|
+
}, O = (z) => {
|
|
981
|
+
const A = b ? "ArrowLeft" : "ArrowRight", L = b ? "ArrowRight" : "ArrowLeft", N = { [A]: x + 1, [L]: x - 1, Home: 0, End: C.length - 1 }[z.key];
|
|
982
|
+
N !== void 0 && (z.preventDefault(), B(N));
|
|
983
|
+
}, k = (z) => {
|
|
984
|
+
var A;
|
|
985
|
+
s(z), y(z), (A = m.current[z]) == null || A.focus();
|
|
986
|
+
}, I = r === "responsive" ? S ? "row" : "column" : r, R = (z, A) => {
|
|
987
|
+
var d;
|
|
988
|
+
const L = e.find((q) => q.questionId === z.questionId), N = (d = L == null ? void 0 : L.options.find((q) => q.optionId === z.optionId)) == null ? void 0 : d.option;
|
|
989
|
+
return /* @__PURE__ */ t("div", { css: W.answer, children: /* @__PURE__ */ p("div", { css: W.single, children: [
|
|
990
|
+
/* @__PURE__ */ p("div", { css: W.question, children: [
|
|
991
|
+
/* @__PURE__ */ p("p", { css: W.questionNumber, children: [
|
|
992
|
+
v("classicQuiz.question"),
|
|
993
|
+
" ",
|
|
994
|
+
A + 1
|
|
995
|
+
] }),
|
|
996
|
+
/* @__PURE__ */ t("p", { css: W.questionText, children: L == null ? void 0 : L.question })
|
|
997
|
+
] }),
|
|
998
|
+
/* @__PURE__ */ t("div", { css: W.outcome, children: /* @__PURE__ */ p("p", { css: W.yourAnswer, children: [
|
|
999
|
+
v("classicQuiz.yourAnswer"),
|
|
1000
|
+
" ",
|
|
1001
|
+
N && ai(N)
|
|
1002
|
+
] }) }),
|
|
1003
|
+
(L == null ? void 0 : L.explanation) && /* @__PURE__ */ p("div", { css: W.explanation, children: [
|
|
1004
|
+
/* @__PURE__ */ t(
|
|
1005
|
+
"img",
|
|
1006
|
+
{
|
|
1007
|
+
src: Wi,
|
|
1008
|
+
alt: "explanation-icon",
|
|
1009
|
+
css: o ? W.explanationIconInverted : W.explanationIcon
|
|
1010
|
+
}
|
|
1011
|
+
),
|
|
1012
|
+
/* @__PURE__ */ t("p", { css: W.explanationText, children: ri(L.explanation) })
|
|
1013
|
+
] })
|
|
1014
|
+
] }) }, `user-answer-${z.questionId}`);
|
|
1015
|
+
};
|
|
1016
|
+
return /* @__PURE__ */ t("div", { css: W.root, style: P, children: /* @__PURE__ */ p("div", { css: W.tabs, children: [
|
|
1017
|
+
/* @__PURE__ */ t(
|
|
1018
|
+
"div",
|
|
1019
|
+
{
|
|
1020
|
+
role: "tablist",
|
|
1021
|
+
"aria-orientation": "horizontal",
|
|
1022
|
+
css: D ? W.listMobile : W.list,
|
|
1023
|
+
onKeyDown: O,
|
|
1024
|
+
children: C.map((z, A) => /* @__PURE__ */ t(
|
|
1025
|
+
"button",
|
|
1026
|
+
{
|
|
1027
|
+
ref: (L) => {
|
|
1028
|
+
m.current[A] = L;
|
|
1029
|
+
},
|
|
1030
|
+
type: "button",
|
|
1031
|
+
role: "tab",
|
|
1032
|
+
id: `${u}-tab-${A}`,
|
|
1033
|
+
"aria-selected": A === l,
|
|
1034
|
+
"aria-controls": A === l ? `${u}-panel` : void 0,
|
|
1035
|
+
tabIndex: A === x ? 0 : -1,
|
|
1036
|
+
css: W.tab[w][A === l ? "on" : "off"],
|
|
1037
|
+
onClick: () => k(A),
|
|
1038
|
+
onFocus: () => y(A),
|
|
1039
|
+
children: /* @__PURE__ */ p("div", { css: W.tabContent, children: [
|
|
1040
|
+
/* @__PURE__ */ t("img", { src: z.icon, alt: "answers-icon", css: Q ? W.tabIconInverted : W.tabIcon }),
|
|
1041
|
+
/* @__PURE__ */ t("p", { css: W.tabLabel, children: z.label })
|
|
1042
|
+
] })
|
|
1043
|
+
},
|
|
1044
|
+
A
|
|
1045
|
+
))
|
|
1046
|
+
}
|
|
1047
|
+
),
|
|
1048
|
+
/* @__PURE__ */ t(
|
|
1049
|
+
"div",
|
|
1050
|
+
{
|
|
1051
|
+
role: "tabpanel",
|
|
1052
|
+
id: `${u}-panel`,
|
|
1053
|
+
"aria-labelledby": `${u}-tab-${l}`,
|
|
1054
|
+
css: l === 0 ? W.results[I] : S ? W.answersPanelMd : W.answersPanel,
|
|
1055
|
+
children: l === 0 ? c : /* @__PURE__ */ t("div", { css: W.answers, children: i.map((z, A) => R(z, A)) })
|
|
1056
|
+
}
|
|
1057
|
+
)
|
|
1058
|
+
] }) });
|
|
1059
|
+
}, Ut = (e, i) => !i.personas || !e.personaResults ? [] : i.personas.map((o) => {
|
|
1060
|
+
const c = e.personaResults.find(
|
|
1061
|
+
(a) => a.personaId === o.personaId
|
|
1062
|
+
);
|
|
1063
|
+
return c ? {
|
|
1064
|
+
...c,
|
|
1065
|
+
percent: o.percent
|
|
1066
|
+
} : null;
|
|
1067
|
+
}).filter(
|
|
1068
|
+
(o) => o !== null && o.percent > 0
|
|
1069
|
+
).sort((o, c) => c.percent - o.percent), ht = "var(--fu-ucrc-pq-rt-primary)", Vn = "var(--fu-ucrc-pq-rt-surface)", gn = {
|
|
1070
|
+
fontFamily: "var(--fu-ucrc-font-body)",
|
|
1071
|
+
fontSize: "1em",
|
|
1072
|
+
lineHeight: 1.5,
|
|
1073
|
+
color: "var(--fu-ucrc-neutral-plain-color)"
|
|
1074
|
+
}, jn = {
|
|
1075
|
+
position: "relative",
|
|
1076
|
+
boxSizing: "border-box",
|
|
1077
|
+
display: "flex",
|
|
1078
|
+
alignItems: "center",
|
|
1079
|
+
alignSelf: "stretch",
|
|
1080
|
+
justifyContent: "center",
|
|
1081
|
+
flex: "initial",
|
|
1082
|
+
gap: "6px",
|
|
1083
|
+
width: "var(--fu-ucrc-pq-rt-tab-width)",
|
|
1084
|
+
minWidth: 0,
|
|
1085
|
+
minHeight: "auto",
|
|
1086
|
+
margin: 0,
|
|
1087
|
+
paddingBlock: g("sm"),
|
|
1088
|
+
paddingInline: g("md"),
|
|
1089
|
+
border: "none",
|
|
1090
|
+
borderBottom: "2px solid transparent",
|
|
1091
|
+
borderRadius: 0,
|
|
1092
|
+
backgroundColor: "transparent",
|
|
1093
|
+
color: "var(--fu-ucrc-text-color)",
|
|
1094
|
+
font: "inherit",
|
|
1095
|
+
fontFamily: "var(--fu-ucrc-font-primary)",
|
|
1096
|
+
fontWeight: 500,
|
|
1097
|
+
fontSize: "var(--fu-ucrc-pq-rt-tab-size)",
|
|
1098
|
+
textAlign: "start",
|
|
1099
|
+
textDecoration: "none",
|
|
1100
|
+
cursor: "pointer",
|
|
1101
|
+
transition: "all 0.2s ease",
|
|
1102
|
+
WebkitTapHighlightColor: "transparent",
|
|
1103
|
+
"&:focus-visible": { outline: "2px solid var(--fu-ucrc-focus-visible)", outlineOffset: "2px", zIndex: 1 },
|
|
1104
|
+
"&:hover": { backgroundColor: "var(--fu-ucrc-surface-variant)", borderBottom: "2px solid var(--fu-ucrc-pq-rt-primary-25)" }
|
|
1105
|
+
}, mn = {
|
|
1106
|
+
borderTopLeftRadius: "var(--fu-ucrc-radius-md)",
|
|
1107
|
+
borderTopRightRadius: "var(--fu-ucrc-pq-rt-first-end-radius)"
|
|
1108
|
+
}, fn = n(jn, { "&:hover": { color: "var(--fu-ucrc-neutral-plain-hover-color)" } }), yn = n(jn, {
|
|
1109
|
+
zIndex: 1,
|
|
1110
|
+
backgroundColor: "var(--fu-ucrc-surface-variant)",
|
|
1111
|
+
borderBottom: `2px solid ${ht}`,
|
|
1112
|
+
"&:hover": { borderBottom: `2px solid ${ht}` }
|
|
1113
|
+
}), hn = {
|
|
1114
|
+
backgroundColor: Vn,
|
|
1115
|
+
borderBottomLeftRadius: "var(--fu-ucrc-radius-md)",
|
|
1116
|
+
borderBottomRightRadius: "var(--fu-ucrc-radius-md)",
|
|
1117
|
+
backdropFilter: "blur(4px)",
|
|
1118
|
+
border: "1px solid rgba(255, 255, 255, 0.1)",
|
|
1119
|
+
borderTop: "none",
|
|
1120
|
+
minHeight: "200px"
|
|
1121
|
+
}, bn = { display: "flex", gap: g("lg") }, pn = {
|
|
1122
|
+
width: "100%",
|
|
1123
|
+
borderRadius: "var(--fu-ucrc-radius-md)",
|
|
1124
|
+
backgroundSize: "cover",
|
|
1125
|
+
backgroundPosition: "center",
|
|
1126
|
+
backgroundRepeat: "no-repeat",
|
|
1127
|
+
border: "1px solid rgba(255, 255, 255, 0.1)"
|
|
1128
|
+
}, xn = {
|
|
1129
|
+
backgroundSize: "cover",
|
|
1130
|
+
backgroundPosition: "center",
|
|
1131
|
+
backgroundRepeat: "no-repeat",
|
|
1132
|
+
borderRadius: "var(--fu-ucrc-radius-xs)",
|
|
1133
|
+
border: "1px solid rgba(0, 0, 0, 0.2)",
|
|
1134
|
+
flexShrink: 0
|
|
1135
|
+
}, F = {
|
|
1136
|
+
wrapper: n({
|
|
1137
|
+
display: "flex",
|
|
1138
|
+
flexDirection: "column",
|
|
1139
|
+
justifyContent: "flex-start",
|
|
1140
|
+
alignItems: "stretch",
|
|
1141
|
+
alignSelf: "stretch",
|
|
1142
|
+
width: "100%"
|
|
1143
|
+
}),
|
|
1144
|
+
container: n({ padding: g("md"), marginTop: g("md") }),
|
|
1145
|
+
// Joy's Tabs: the body font and neutral colour the panels inherit.
|
|
1146
|
+
tabs: n({
|
|
1147
|
+
...gn,
|
|
1148
|
+
position: "relative",
|
|
1149
|
+
display: "flex",
|
|
1150
|
+
flexDirection: "column",
|
|
1151
|
+
width: "100%",
|
|
1152
|
+
backgroundColor: Vn,
|
|
1153
|
+
borderRadius: "var(--fu-ucrc-radius-md)",
|
|
1154
|
+
// Keeps the tab underline and the selected tab indicator from overshooting the rounded corners
|
|
1155
|
+
overflow: "hidden"
|
|
1156
|
+
}),
|
|
1157
|
+
list: n({
|
|
1158
|
+
position: "relative",
|
|
1159
|
+
zIndex: 1,
|
|
1160
|
+
boxSizing: "border-box",
|
|
1161
|
+
display: "flex",
|
|
1162
|
+
flexWrap: "wrap",
|
|
1163
|
+
margin: 0,
|
|
1164
|
+
padding: 0,
|
|
1165
|
+
gap: 0,
|
|
1166
|
+
listStyle: "none",
|
|
1167
|
+
fontFamily: "var(--fu-ucrc-font-body)",
|
|
1168
|
+
fontSize: "1em",
|
|
1169
|
+
lineHeight: 1.5,
|
|
1170
|
+
color: "var(--fu-ucrc-neutral-plain-color)",
|
|
1171
|
+
borderBottom: "1px solid var(--fu-ucrc-pq-rt-primary-25)",
|
|
1172
|
+
// Joy's divider: the neutral channel at 20% (16% in dark mode).
|
|
1173
|
+
boxShadow: "inset 0 -1px rgba(var(--fu-ucrc-neutral-main-channel) / 0.2)",
|
|
1174
|
+
".dark &": { boxShadow: "inset 0 -1px rgba(var(--fu-ucrc-neutral-main-channel) / 0.16)" }
|
|
1175
|
+
}),
|
|
1176
|
+
tab: {
|
|
1177
|
+
off: fn,
|
|
1178
|
+
on: yn,
|
|
1179
|
+
firstOff: n(fn, { "&:hover": mn }),
|
|
1180
|
+
firstOn: n(yn, mn)
|
|
1181
|
+
},
|
|
1182
|
+
labelRow: n({
|
|
1183
|
+
display: "flex",
|
|
1184
|
+
justifyContent: "space-between",
|
|
1185
|
+
alignItems: "center",
|
|
1186
|
+
width: "100%",
|
|
1187
|
+
gap: g("sm")
|
|
1188
|
+
}),
|
|
1189
|
+
logo: n(xn, { width: "24px", height: "24px" }),
|
|
1190
|
+
logoMobile: n(xn, { width: "20px", height: "20px" }),
|
|
1191
|
+
label: n({
|
|
1192
|
+
...fe,
|
|
1193
|
+
fontSize: "inherit",
|
|
1194
|
+
fontWeight: "inherit",
|
|
1195
|
+
fontFamily: "var(--fu-ucrc-font-secondary)",
|
|
1196
|
+
color: "inherit",
|
|
1197
|
+
textAlign: "left",
|
|
1198
|
+
unicodeBidi: "plaintext",
|
|
1199
|
+
flex: 1
|
|
1200
|
+
}),
|
|
1201
|
+
percentage: n({
|
|
1202
|
+
margin: 0,
|
|
1203
|
+
backgroundColor: ht,
|
|
1204
|
+
color: "var(--fu-ucrc-pq-rt-on-primary)",
|
|
1205
|
+
paddingInline: g("xs"),
|
|
1206
|
+
paddingBlock: g("3xs"),
|
|
1207
|
+
borderRadius: "var(--fu-ucrc-radius-sm)",
|
|
1208
|
+
fontSize: "0.75em",
|
|
1209
|
+
fontWeight: 600,
|
|
1210
|
+
fontFamily: "var(--fu-ucrc-font-secondary)",
|
|
1211
|
+
minWidth: "auto",
|
|
1212
|
+
lineHeight: 1.2
|
|
1213
|
+
}),
|
|
1214
|
+
panel: n({ ...gn, flexGrow: 1, padding: 0 }),
|
|
1215
|
+
// Square top, no top border: the panel butts against the tab list underline.
|
|
1216
|
+
content: n(hn, { padding: g("lg") }),
|
|
1217
|
+
contentMobile: n(hn, { padding: g("md") }),
|
|
1218
|
+
withImageRow: n(bn, { flexDirection: "row", alignItems: "flex-start" }),
|
|
1219
|
+
withImageColumn: n(bn, { flexDirection: "column", alignItems: "center" }),
|
|
1220
|
+
imageSection: n({ flexShrink: 0, width: "200px", maxWidth: "300px" }),
|
|
1221
|
+
imageSectionFull: n({ flexShrink: 0, width: "100%", maxWidth: "300px" }),
|
|
1222
|
+
personaImage: n(pn, { height: "200px" }),
|
|
1223
|
+
personaImageShort: n(pn, { height: "150px" }),
|
|
1224
|
+
descriptionSection: n({ flex: 1, minWidth: 0 }),
|
|
1225
|
+
descriptionOnly: n({ display: "flex", justifyContent: "center", alignItems: "center", minHeight: "150px" }),
|
|
1226
|
+
description: n({
|
|
1227
|
+
fontFamily: "var(--fu-ucrc-font-secondary)",
|
|
1228
|
+
color: "var(--fu-ucrc-text-color)",
|
|
1229
|
+
lineHeight: 1.6,
|
|
1230
|
+
fontSize: "0.95em",
|
|
1231
|
+
opacity: 0.9
|
|
1232
|
+
})
|
|
1233
|
+
}, Vi = ({ personas: e }) => {
|
|
1234
|
+
const [i, r] = U(0), [o, c] = U(0), a = Ce([]), l = Je(), s = Ke(), x = ne(), y = re(), m = Y(), u = ue("sm"), b = ue("md");
|
|
1235
|
+
if (!e || e.length === 0)
|
|
1236
|
+
return null;
|
|
1237
|
+
const f = y.palette.primary.plainColor, v = {
|
|
1238
|
+
"--fu-ucrc-pq-rt-primary": f,
|
|
1239
|
+
"--fu-ucrc-pq-rt-primary-25": `${f}40`,
|
|
1240
|
+
"--fu-ucrc-pq-rt-surface": `rgba(${Oe(y.surfaceVariant || "")}, 0.5)`,
|
|
1241
|
+
// Joy read the light scheme's on-primary here, in both modes.
|
|
1242
|
+
"--fu-ucrc-pq-rt-on-primary": x.colorSchemes.light.palette.primary.onPrimary
|
|
1243
|
+
}, D = {
|
|
1244
|
+
"--fu-ucrc-pq-rt-tab-width": b ? "auto" : "100%",
|
|
1245
|
+
"--fu-ucrc-pq-rt-tab-size": u ? "0.9em" : "0.85em",
|
|
1246
|
+
"--fu-ucrc-pq-rt-first-end-radius": b ? "0px" : "var(--fu-ucrc-radius-md)"
|
|
1247
|
+
}, S = (k) => k && (m && k.mobile || k.main) || null, Q = (k) => {
|
|
1248
|
+
var R;
|
|
1249
|
+
const I = (k + e.length) % e.length;
|
|
1250
|
+
c(I), (R = a.current[I]) == null || R.focus();
|
|
1251
|
+
}, w = (k) => {
|
|
1252
|
+
const I = s ? "ArrowLeft" : "ArrowRight", R = s ? "ArrowRight" : "ArrowLeft", z = { [I]: o + 1, [R]: o - 1, Home: 0, End: e.length - 1 }[k.key];
|
|
1253
|
+
z !== void 0 && (k.preventDefault(), Q(z));
|
|
1254
|
+
}, P = (k) => {
|
|
1255
|
+
var I;
|
|
1256
|
+
r(k), c(k), (I = a.current[k]) == null || I.focus();
|
|
1257
|
+
}, C = e[i], B = C ? S(C.images) : null, O = (k) => /* @__PURE__ */ t("span", { css: F.description, dir: "auto", dangerouslySetInnerHTML: { __html: k } });
|
|
1258
|
+
return /* @__PURE__ */ t("div", { css: F.wrapper, children: /* @__PURE__ */ t("div", { css: F.container, children: /* @__PURE__ */ p("div", { css: F.tabs, style: v, children: [
|
|
1259
|
+
/* @__PURE__ */ t(
|
|
1260
|
+
"div",
|
|
1261
|
+
{
|
|
1262
|
+
role: "tablist",
|
|
1263
|
+
"aria-orientation": "horizontal",
|
|
1264
|
+
css: F.list,
|
|
1265
|
+
style: D,
|
|
1266
|
+
onKeyDown: w,
|
|
1267
|
+
children: e.map((k, I) => {
|
|
1268
|
+
var q, M;
|
|
1269
|
+
const R = I === 0, z = I === i, A = S(k.images), L = ((q = k.images) == null ? void 0 : q.mobile) || ((M = k.images) == null ? void 0 : M.main), N = m ? !!L : !!A && !k.description, d = m ? L : A;
|
|
1270
|
+
return /* @__PURE__ */ t(
|
|
1271
|
+
"button",
|
|
1272
|
+
{
|
|
1273
|
+
ref: ($) => {
|
|
1274
|
+
a.current[I] = $;
|
|
1275
|
+
},
|
|
1276
|
+
type: "button",
|
|
1277
|
+
role: "tab",
|
|
1278
|
+
id: `${l}-tab-${I}`,
|
|
1279
|
+
"aria-selected": z,
|
|
1280
|
+
"aria-controls": z && k.description ? `${l}-panel` : void 0,
|
|
1281
|
+
tabIndex: I === o ? 0 : -1,
|
|
1282
|
+
css: R ? z ? F.tab.firstOn : F.tab.firstOff : z ? F.tab.on : F.tab.off,
|
|
1283
|
+
onClick: () => P(I),
|
|
1284
|
+
onFocus: () => c(I),
|
|
1285
|
+
children: /* @__PURE__ */ p("div", { css: F.labelRow, children: [
|
|
1286
|
+
N && d && /* @__PURE__ */ t(
|
|
1287
|
+
"div",
|
|
1288
|
+
{
|
|
1289
|
+
css: m ? F.logoMobile : F.logo,
|
|
1290
|
+
style: { backgroundImage: `url("${d}")` }
|
|
1291
|
+
}
|
|
1292
|
+
),
|
|
1293
|
+
/* @__PURE__ */ t("p", { css: F.label, children: k.title }),
|
|
1294
|
+
/* @__PURE__ */ p("p", { css: F.percentage, children: [
|
|
1295
|
+
k.percent,
|
|
1296
|
+
"%"
|
|
1297
|
+
] })
|
|
1298
|
+
] })
|
|
1299
|
+
},
|
|
1300
|
+
k.personaId
|
|
1301
|
+
);
|
|
1302
|
+
})
|
|
1303
|
+
}
|
|
1304
|
+
),
|
|
1305
|
+
(C == null ? void 0 : C.description) && /* @__PURE__ */ t("div", { role: "tabpanel", id: `${l}-panel`, "aria-labelledby": `${l}-tab-${i}`, css: F.panel, children: /* @__PURE__ */ t("div", { css: m ? F.contentMobile : F.content, children: B && !m ? /* @__PURE__ */ p("div", { css: b ? F.withImageRow : F.withImageColumn, children: [
|
|
1306
|
+
/* @__PURE__ */ t("div", { css: b ? F.imageSection : F.imageSectionFull, children: /* @__PURE__ */ t(
|
|
1307
|
+
"div",
|
|
1308
|
+
{
|
|
1309
|
+
css: b ? F.personaImage : F.personaImageShort,
|
|
1310
|
+
style: { backgroundImage: `url("${B}")` }
|
|
1311
|
+
}
|
|
1312
|
+
) }),
|
|
1313
|
+
/* @__PURE__ */ t("div", { css: F.descriptionSection, children: O(C.description) })
|
|
1314
|
+
] }) : /* @__PURE__ */ t("div", { css: F.descriptionOnly, children: O(C.description) }) }) })
|
|
1315
|
+
] }) }) });
|
|
1316
|
+
}, Gn = "var(--fu-ucrc-text-primary)", bt = { display: "flex", justifyContent: "center", alignItems: "center" }, vn = {
|
|
1317
|
+
...fe,
|
|
1318
|
+
fontFamily: "var(--fu-ucrc-font-primary)",
|
|
1319
|
+
fontSize: "0.8125em",
|
|
1320
|
+
fontStyle: "normal",
|
|
1321
|
+
fontWeight: 500,
|
|
1322
|
+
lineHeight: "22px",
|
|
1323
|
+
letterSpacing: "0.46px",
|
|
1324
|
+
textTransform: "uppercase"
|
|
1325
|
+
}, Cn = {
|
|
1326
|
+
...bt,
|
|
1327
|
+
flexDirection: "column",
|
|
1328
|
+
paddingBlock: g("xs"),
|
|
1329
|
+
paddingInline: g("md"),
|
|
1330
|
+
gap: "8px",
|
|
1331
|
+
borderRadius: "var(--fu-ucrc-radius-xl)",
|
|
1332
|
+
// Joy's solidColor (common.white) is not in the theme snapshot.
|
|
1333
|
+
color: "var(--fu-ucrc-primary-solid-color, #fff)",
|
|
1334
|
+
fontSize: "0.8125em"
|
|
1335
|
+
}, Nn = { display: "flex", alignItems: "center", paddingInline: g("md") }, In = { ...Nn, justifyContent: "space-between", gap: g("lg") }, Sn = { ...Nn, gap: g("md") }, oe = {
|
|
1336
|
+
main: n({ flex: "1", display: "flex", flexDirection: "column", padding: g("md"), gap: g("md") }),
|
|
1337
|
+
chanceGame: n({ padding: g("md") }),
|
|
1338
|
+
buttonsRow: n(In, { flexDirection: "row" }),
|
|
1339
|
+
buttonsColumn: n(In, { flexDirection: "column-reverse" }),
|
|
1340
|
+
buttonsEnd: n(Sn, { justifyContent: "flex-end" }),
|
|
1341
|
+
buttonsCenter: n(Sn, { justifyContent: "center" }),
|
|
1342
|
+
playAgain: n(Ie, Cn, {
|
|
1343
|
+
border: "var(--fu-ucrc-border-size) solid var(--fu-ucrc-pq-ss-primary)",
|
|
1344
|
+
backgroundColor: "var(--fu-ucrc-pq-ss-bg)",
|
|
1345
|
+
"&:hover": { backgroundColor: "var(--fu-ucrc-on-surface)", borderColor: "var(--fu-ucrc-pq-ss-primary)" }
|
|
1346
|
+
}),
|
|
1347
|
+
playAgainContent: n({ ...bt, gap: "8px", alignSelf: "stretch" }),
|
|
1348
|
+
playAgainText: n({ ...vn, textAlign: "center", color: Gn }),
|
|
1349
|
+
additionalCta: n(Ie, Cn, {
|
|
1350
|
+
border: "var(--fu-ucrc-border-size) solid var(--fu-ucrc-secondary-container)",
|
|
1351
|
+
backgroundColor: "var(--fu-ucrc-secondary-container)",
|
|
1352
|
+
"&:hover": { opacity: 0.9 },
|
|
1353
|
+
"& > div": { ...bt, gap: "8px" },
|
|
1354
|
+
"& p": { ...vn, color: "var(--fu-ucrc-pq-ss-secondary)" }
|
|
1355
|
+
}),
|
|
1356
|
+
wrapperRow: n({ display: "flex", flexDirection: "row", width: "100%" }),
|
|
1357
|
+
wrapperColumn: n({ display: "flex", flexDirection: "column", width: "100%" })
|
|
1358
|
+
}, ji = {
|
|
1359
|
+
display: "flex",
|
|
1360
|
+
width: "16px",
|
|
1361
|
+
height: "16px",
|
|
1362
|
+
justifyContent: "flex-end",
|
|
1363
|
+
alignItems: "center",
|
|
1364
|
+
color: Gn
|
|
1365
|
+
}, Gi = (e) => {
|
|
1366
|
+
var f, v, D, S, Q;
|
|
1367
|
+
const i = re(), r = he(
|
|
1368
|
+
{
|
|
1369
|
+
images: e.personalityQuiz.images,
|
|
1370
|
+
imagePlaceholder: e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : ""
|
|
1371
|
+
},
|
|
1372
|
+
G.STANDARD
|
|
1373
|
+
), { t: o } = H(), c = ue("md"), a = ((f = e.personalityQuiz.branding) == null ? void 0 : f.colors) || null, l = Y() ? ((v = e.personalityQuiz.branding) == null ? void 0 : v.images.mobileLogo) || ((D = e.personalityQuiz.branding) == null ? void 0 : D.images.mainLogo) || "" : ((S = e.personalityQuiz.branding) == null ? void 0 : S.images.mainLogo) || "", s = e.imagePosition || "left", x = (a == null ? void 0 : a.contentColor) || i.textColor, y = {
|
|
1374
|
+
"--fu-ucrc-pq-ss-primary": (a == null ? void 0 : a.primaryColor) || i.palette.primary.plainColor,
|
|
1375
|
+
"--fu-ucrc-pq-ss-secondary": (a == null ? void 0 : a.secondaryColor) || i.textSecondary,
|
|
1376
|
+
"--fu-ucrc-pq-ss-bg": (a == null ? void 0 : a.backgroundColor) || i.surface
|
|
1377
|
+
}, m = Ut(e.personalityQuiz, e.summary), b = /* @__PURE__ */ t(xi, { finalImage: r, imagePosition: s, children: (() => {
|
|
1378
|
+
var w, P;
|
|
1379
|
+
return /* @__PURE__ */ t("div", { css: oe.main, style: y, children: e.summary.personalityQuizId ? /* @__PURE__ */ p(Re, { children: [
|
|
1380
|
+
/* @__PURE__ */ t(Vi, { personas: m }),
|
|
1381
|
+
e.chanceGameContent && /* @__PURE__ */ t("div", { css: oe.chanceGame, children: e.chanceGameContent }),
|
|
1382
|
+
(l || e.additionalCTA !== void 0 || !e.maxAttemptsReached) && /* @__PURE__ */ p(
|
|
1383
|
+
"div",
|
|
1384
|
+
{
|
|
1385
|
+
css: l ? c ? oe.buttonsRow : oe.buttonsColumn : c ? oe.buttonsEnd : oe.buttonsCenter,
|
|
1386
|
+
children: [
|
|
1387
|
+
l && /* @__PURE__ */ t(
|
|
1388
|
+
V,
|
|
1389
|
+
{
|
|
1390
|
+
brandingLogo: l,
|
|
1391
|
+
textColor: x,
|
|
1392
|
+
label: ((w = e.personalityQuiz.labels) == null ? void 0 : w.sponsor) || null
|
|
1393
|
+
}
|
|
1394
|
+
),
|
|
1395
|
+
/* @__PURE__ */ t(wt, { additionalCTA: e.additionalCTA, css: oe.additionalCta }),
|
|
1396
|
+
!e.maxAttemptsReached && /* @__PURE__ */ t("button", { type: "button", css: oe.playAgain, onClick: e.playAgain, children: /* @__PURE__ */ p("div", { css: oe.playAgainContent, children: [
|
|
1397
|
+
/* @__PURE__ */ t(Rt, { style: ji }),
|
|
1398
|
+
/* @__PURE__ */ t("p", { css: oe.playAgainText, children: o("personalityQuiz.buttons.playAgain") })
|
|
1399
|
+
] }) })
|
|
1400
|
+
]
|
|
1401
|
+
}
|
|
1402
|
+
)
|
|
1403
|
+
] }) : /* @__PURE__ */ p(Re, { children: [
|
|
1404
|
+
/* @__PURE__ */ t(
|
|
1405
|
+
kt,
|
|
1406
|
+
{
|
|
1407
|
+
variant: "error",
|
|
1408
|
+
title: o("common.authentication.accessRequired"),
|
|
1409
|
+
message: o("common.authentication.invalidOrMissingAuth")
|
|
1410
|
+
}
|
|
1411
|
+
),
|
|
1412
|
+
l ? /* @__PURE__ */ t(
|
|
1413
|
+
V,
|
|
1414
|
+
{
|
|
1415
|
+
brandingLogo: l,
|
|
1416
|
+
textColor: x,
|
|
1417
|
+
label: ((P = e.personalityQuiz.labels) == null ? void 0 : P.sponsor) || null
|
|
1418
|
+
}
|
|
1419
|
+
) : null
|
|
1420
|
+
] }) });
|
|
1421
|
+
})() });
|
|
1422
|
+
return /* @__PURE__ */ t(K, { brandingBorderColor: (a == null ? void 0 : a.borderColor) || null, children: e.showAnswerExplanations ? /* @__PURE__ */ t(
|
|
1423
|
+
Bt,
|
|
1424
|
+
{
|
|
1425
|
+
questions: e.personalityQuiz.questions,
|
|
1426
|
+
userParticipation: e.summary.questions,
|
|
1427
|
+
brandingColors: (Q = e.personalityQuiz.branding) == null ? void 0 : Q.colors,
|
|
1428
|
+
resultsLayout: "responsive",
|
|
1429
|
+
children: /* @__PURE__ */ t("div", { css: c ? oe.wrapperRow : oe.wrapperColumn, children: b })
|
|
1430
|
+
}
|
|
1431
|
+
) : b });
|
|
1432
|
+
}, pt = "var(--fu-ucrc-pq-srt-surface)", Ni = "var(--fu-ucrc-pq-srt-primary)", _n = {
|
|
1433
|
+
position: "relative",
|
|
1434
|
+
boxSizing: "border-box",
|
|
1435
|
+
display: "flex",
|
|
1436
|
+
flexDirection: "row",
|
|
1437
|
+
alignItems: "center",
|
|
1438
|
+
alignSelf: "stretch",
|
|
1439
|
+
justifyContent: "flex-start",
|
|
1440
|
+
gap: "6px",
|
|
1441
|
+
width: "100%",
|
|
1442
|
+
flex: "none",
|
|
1443
|
+
minWidth: 0,
|
|
1444
|
+
minHeight: "auto",
|
|
1445
|
+
margin: 0,
|
|
1446
|
+
paddingBlock: g("sm"),
|
|
1447
|
+
paddingInline: g("md"),
|
|
1448
|
+
font: "inherit",
|
|
1449
|
+
fontFamily: "var(--fu-ucrc-font-primary)",
|
|
1450
|
+
fontWeight: 500,
|
|
1451
|
+
fontSize: "0.9em",
|
|
1452
|
+
color: "var(--fu-ucrc-text-color)",
|
|
1453
|
+
textAlign: "start",
|
|
1454
|
+
textDecoration: "none",
|
|
1455
|
+
backgroundColor: "transparent",
|
|
1456
|
+
border: "none",
|
|
1457
|
+
borderBottom: "1px solid var(--fu-ucrc-pq-srt-line)",
|
|
1458
|
+
borderRight: "2px solid transparent",
|
|
1459
|
+
borderRadius: 0,
|
|
1460
|
+
transition: "all 0.2s ease",
|
|
1461
|
+
cursor: "pointer",
|
|
1462
|
+
WebkitTapHighlightColor: "transparent",
|
|
1463
|
+
"&:focus-visible": { outline: "2px solid var(--fu-ucrc-focus-visible)", outlineOffset: "2px", zIndex: 1 }
|
|
1464
|
+
}, zn = {
|
|
1465
|
+
..._n,
|
|
1466
|
+
"&:hover": {
|
|
1467
|
+
backgroundColor: "var(--fu-ucrc-neutral-plain-hover-bg)",
|
|
1468
|
+
color: "var(--fu-ucrc-neutral-plain-hover-color)",
|
|
1469
|
+
borderRight: "2px solid var(--fu-ucrc-pq-srt-hover-edge)"
|
|
1470
|
+
},
|
|
1471
|
+
"&:active": { backgroundColor: "var(--fu-ucrc-neutral-plain-active-bg)" }
|
|
1472
|
+
}, wn = {
|
|
1473
|
+
..._n,
|
|
1474
|
+
zIndex: 1,
|
|
1475
|
+
backgroundColor: pt,
|
|
1476
|
+
borderRight: "2px solid var(--fu-ucrc-pq-srt-edge)",
|
|
1477
|
+
borderBottom: "2px solid var(--fu-ucrc-pq-srt-edge)",
|
|
1478
|
+
color: "var(--fu-ucrc-text-primary)",
|
|
1479
|
+
fontWeight: 600
|
|
1480
|
+
}, _i = { "&:hover": { borderTopLeftRadius: "var(--fu-ucrc-radius-sm)" } }, kn = {
|
|
1481
|
+
backgroundSize: "cover",
|
|
1482
|
+
backgroundPosition: "center",
|
|
1483
|
+
backgroundRepeat: "no-repeat",
|
|
1484
|
+
borderRadius: "var(--fu-ucrc-radius-xs)",
|
|
1485
|
+
border: "1px solid rgba(0, 0, 0, 0.2)",
|
|
1486
|
+
flexShrink: 0
|
|
1487
|
+
}, J = {
|
|
1488
|
+
contentWrapper: n({
|
|
1489
|
+
display: "flex",
|
|
1490
|
+
flexDirection: "column",
|
|
1491
|
+
justifyContent: "flex-start",
|
|
1492
|
+
alignItems: "stretch",
|
|
1493
|
+
alignSelf: "stretch",
|
|
1494
|
+
width: "100%"
|
|
1495
|
+
}),
|
|
1496
|
+
// Joy's Tabs: body font, 1.5 line height and the neutral colour the panel inherits.
|
|
1497
|
+
tabs: n({
|
|
1498
|
+
position: "relative",
|
|
1499
|
+
display: "flex",
|
|
1500
|
+
flexDirection: "column",
|
|
1501
|
+
width: "100%",
|
|
1502
|
+
backgroundColor: pt,
|
|
1503
|
+
borderRadius: "var(--fu-ucrc-radius-md)",
|
|
1504
|
+
fontFamily: "var(--fu-ucrc-font-body)",
|
|
1505
|
+
fontSize: "1em",
|
|
1506
|
+
lineHeight: 1.5,
|
|
1507
|
+
color: "var(--fu-ucrc-neutral-plain-color)"
|
|
1508
|
+
}),
|
|
1509
|
+
list: n({
|
|
1510
|
+
position: "relative",
|
|
1511
|
+
zIndex: 1,
|
|
1512
|
+
boxSizing: "border-box",
|
|
1513
|
+
display: "flex",
|
|
1514
|
+
flexDirection: "column",
|
|
1515
|
+
alignItems: "stretch",
|
|
1516
|
+
gap: 0,
|
|
1517
|
+
margin: 0,
|
|
1518
|
+
padding: 0,
|
|
1519
|
+
fontSize: "1em",
|
|
1520
|
+
// Joy's divider: the neutral channel at 20% (16% in dark mode).
|
|
1521
|
+
boxShadow: "inset 0 -1px rgba(var(--fu-ucrc-neutral-main-channel) / 0.2)",
|
|
1522
|
+
".dark &": { boxShadow: "inset 0 -1px rgba(var(--fu-ucrc-neutral-main-channel) / 0.16)" }
|
|
1523
|
+
}),
|
|
1524
|
+
tab: {
|
|
1525
|
+
off: n(zn),
|
|
1526
|
+
on: n(wn),
|
|
1527
|
+
firstOff: n(zn, _i),
|
|
1528
|
+
firstOn: n(wn, { borderTopLeftRadius: "var(--fu-ucrc-radius-sm)" })
|
|
1529
|
+
},
|
|
1530
|
+
labelRow: n({
|
|
1531
|
+
display: "flex",
|
|
1532
|
+
justifyContent: "space-between",
|
|
1533
|
+
alignItems: "center",
|
|
1534
|
+
width: "100%",
|
|
1535
|
+
gap: g("sm")
|
|
1536
|
+
}),
|
|
1537
|
+
logo: n(kn, { width: "24px", height: "24px" }),
|
|
1538
|
+
logoMobile: n(kn, { width: "20px", height: "20px" }),
|
|
1539
|
+
label: n(fe, {
|
|
1540
|
+
fontSize: "inherit",
|
|
1541
|
+
fontWeight: "inherit",
|
|
1542
|
+
fontFamily: "var(--fu-ucrc-font-secondary)",
|
|
1543
|
+
color: "inherit",
|
|
1544
|
+
textAlign: "left",
|
|
1545
|
+
unicodeBidi: "plaintext",
|
|
1546
|
+
flex: 1
|
|
1547
|
+
}),
|
|
1548
|
+
// Always the light scheme's on-primary, as before.
|
|
1549
|
+
percentage: n(fe, {
|
|
1550
|
+
backgroundColor: Ni,
|
|
1551
|
+
color: "var(--fu-ucrc-pq-srt-on-primary)",
|
|
1552
|
+
paddingInline: g("xs"),
|
|
1553
|
+
paddingBlock: g("3xs"),
|
|
1554
|
+
borderRadius: "var(--fu-ucrc-radius-sm)",
|
|
1555
|
+
fontSize: "0.75em",
|
|
1556
|
+
fontWeight: 600,
|
|
1557
|
+
fontFamily: "var(--fu-ucrc-font-secondary)",
|
|
1558
|
+
minWidth: "auto",
|
|
1559
|
+
lineHeight: 1.2
|
|
1560
|
+
}),
|
|
1561
|
+
panel: n({ flexGrow: 1, fontSize: "1em", padding: 0 }),
|
|
1562
|
+
content: n({
|
|
1563
|
+
backgroundColor: pt,
|
|
1564
|
+
borderRadius: "var(--fu-ucrc-radius-md)",
|
|
1565
|
+
padding: g("lg"),
|
|
1566
|
+
backdropFilter: "blur(4px)",
|
|
1567
|
+
border: "1px solid rgba(255, 255, 255, 0.1)",
|
|
1568
|
+
minHeight: "200px"
|
|
1569
|
+
}),
|
|
1570
|
+
descriptionOnly: n({ display: "flex", justifyContent: "center", alignItems: "center", minHeight: "150px" }),
|
|
1571
|
+
description: n({ color: "var(--fu-ucrc-text-color)", fontFamily: "var(--fu-ucrc-font-primary)", lineHeight: 1.6 })
|
|
1572
|
+
}, Yi = ({ personas: e, brandingColors: i }) => {
|
|
1573
|
+
const [r, o] = U(0), [c, a] = U(0), l = Ce([]), s = Je(), x = Ke(), y = ne(), m = re(), u = Y();
|
|
1574
|
+
if (!e || e.length === 0)
|
|
1575
|
+
return null;
|
|
1576
|
+
const b = (i == null ? void 0 : i.primaryColor) || m.palette.primary.plainColor, f = {
|
|
1577
|
+
"--fu-ucrc-pq-srt-surface": `rgba(${Oe(m.surfaceVariant || "")}, 0.5)`,
|
|
1578
|
+
"--fu-ucrc-pq-srt-primary": b,
|
|
1579
|
+
"--fu-ucrc-pq-srt-on-primary": y.colorSchemes.light.palette.primary.onPrimary,
|
|
1580
|
+
// Hex alpha suffixes on the primary, as before.
|
|
1581
|
+
"--fu-ucrc-pq-srt-line": `${b}20`,
|
|
1582
|
+
"--fu-ucrc-pq-srt-hover-edge": `${b}40`,
|
|
1583
|
+
"--fu-ucrc-pq-srt-edge": `${b}80`
|
|
1584
|
+
}, v = (Q) => {
|
|
1585
|
+
var P;
|
|
1586
|
+
const w = (Q + e.length) % e.length;
|
|
1587
|
+
a(w), (P = l.current[w]) == null || P.focus();
|
|
1588
|
+
}, D = (Q) => {
|
|
1589
|
+
const w = x ? "ArrowLeft" : "ArrowRight", P = x ? "ArrowRight" : "ArrowLeft", C = { [w]: c + 1, [P]: c - 1, Home: 0, End: e.length - 1 }[Q.key];
|
|
1590
|
+
C !== void 0 && (Q.preventDefault(), v(C));
|
|
1591
|
+
}, S = e[r];
|
|
1592
|
+
return /* @__PURE__ */ t("div", { css: J.contentWrapper, style: f, children: /* @__PURE__ */ p("div", { css: J.tabs, children: [
|
|
1593
|
+
/* @__PURE__ */ t("div", { role: "tablist", "aria-orientation": "horizontal", css: J.list, onKeyDown: D, children: e.map((Q, w) => {
|
|
1594
|
+
const P = w === r, C = Q.images, B = u && (C == null ? void 0 : C.mobile) || (C == null ? void 0 : C.main), O = (C == null ? void 0 : C.mobile) || B;
|
|
1595
|
+
return /* @__PURE__ */ t(
|
|
1596
|
+
"button",
|
|
1597
|
+
{
|
|
1598
|
+
ref: (k) => {
|
|
1599
|
+
l.current[w] = k;
|
|
1600
|
+
},
|
|
1601
|
+
type: "button",
|
|
1602
|
+
role: "tab",
|
|
1603
|
+
id: `${s}-tab-${w}`,
|
|
1604
|
+
"aria-selected": P,
|
|
1605
|
+
"aria-controls": P && Q.description ? `${s}-panel` : void 0,
|
|
1606
|
+
tabIndex: w === c ? 0 : -1,
|
|
1607
|
+
css: w === 0 ? P ? J.tab.firstOn : J.tab.firstOff : P ? J.tab.on : J.tab.off,
|
|
1608
|
+
onClick: () => {
|
|
1609
|
+
o(w), a(w);
|
|
1610
|
+
},
|
|
1611
|
+
onFocus: () => a(w),
|
|
1612
|
+
children: /* @__PURE__ */ p("div", { css: J.labelRow, children: [
|
|
1613
|
+
B && O && /* @__PURE__ */ t(
|
|
1614
|
+
"div",
|
|
1615
|
+
{
|
|
1616
|
+
css: u ? J.logoMobile : J.logo,
|
|
1617
|
+
style: { backgroundImage: `url("${O}")` }
|
|
1618
|
+
}
|
|
1619
|
+
),
|
|
1620
|
+
/* @__PURE__ */ t("p", { css: J.label, children: Q.title }),
|
|
1621
|
+
/* @__PURE__ */ p("p", { css: J.percentage, children: [
|
|
1622
|
+
Q.percent,
|
|
1623
|
+
"%"
|
|
1624
|
+
] })
|
|
1625
|
+
] })
|
|
1626
|
+
},
|
|
1627
|
+
Q.personaId
|
|
1628
|
+
);
|
|
1629
|
+
}) }),
|
|
1630
|
+
(S == null ? void 0 : S.description) && /* @__PURE__ */ t("div", { role: "tabpanel", id: `${s}-panel`, "aria-labelledby": `${s}-tab-${r}`, css: J.panel, children: /* @__PURE__ */ t("div", { css: J.content, children: /* @__PURE__ */ t("div", { css: J.descriptionOnly, children: /* @__PURE__ */ t("span", { css: J.description, dir: "auto", dangerouslySetInnerHTML: { __html: S.description } }) }) }) })
|
|
1631
|
+
] }) });
|
|
1632
|
+
}, _e = "var(--fu-ucrc-text-primary)", Yn = "var(--fu-ucrc-font-primary)", An = {
|
|
1633
|
+
margin: 0,
|
|
1634
|
+
fontFamily: Yn,
|
|
1635
|
+
fontSize: "0.9375em",
|
|
1636
|
+
fontStyle: "normal",
|
|
1637
|
+
fontWeight: 500,
|
|
1638
|
+
lineHeight: "22px",
|
|
1639
|
+
letterSpacing: "0.46px",
|
|
1640
|
+
textTransform: "uppercase"
|
|
1641
|
+
}, Qn = {
|
|
1642
|
+
display: "flex",
|
|
1643
|
+
paddingBlock: g("xs"),
|
|
1644
|
+
flexDirection: "column",
|
|
1645
|
+
justifyContent: "center",
|
|
1646
|
+
alignItems: "center",
|
|
1647
|
+
gap: "8px",
|
|
1648
|
+
borderRadius: "var(--fu-ucrc-radius-xl)",
|
|
1649
|
+
fontSize: "0.9375em"
|
|
1650
|
+
}, Pn = {
|
|
1651
|
+
display: "flex",
|
|
1652
|
+
flexDirection: "column",
|
|
1653
|
+
justifyContent: "center",
|
|
1654
|
+
alignItems: "center"
|
|
1655
|
+
}, qn = { display: "flex", flexDirection: "column", justifyContent: "center" }, ie = {
|
|
1656
|
+
questionAreaContent: n({
|
|
1657
|
+
padding: g("lg"),
|
|
1658
|
+
display: "flex",
|
|
1659
|
+
flexDirection: "column",
|
|
1660
|
+
justifyContent: "center",
|
|
1661
|
+
gap: g("lg"),
|
|
1662
|
+
flex: 1,
|
|
1663
|
+
height: "100%"
|
|
1664
|
+
}),
|
|
1665
|
+
// Translucent panel, from the branding background: `--fu-ucrc-pq-split-bg` on the root.
|
|
1666
|
+
ctaPanel: n({
|
|
1667
|
+
padding: g("lg"),
|
|
1668
|
+
gap: g("lg"),
|
|
1669
|
+
display: "flex",
|
|
1670
|
+
flexDirection: "column",
|
|
1671
|
+
backdropFilter: "blur(4px)",
|
|
1672
|
+
backgroundColor: "var(--fu-ucrc-pq-split-bg)",
|
|
1673
|
+
borderRadius: "var(--fu-ucrc-radius-sm)"
|
|
1674
|
+
}),
|
|
1675
|
+
ctaContainer: n({ display: "flex", flexDirection: "column", alignItems: "center" }),
|
|
1676
|
+
ctaContentWrapper: n(Pn, { gap: g("lg") }),
|
|
1677
|
+
ctaContentWrapperTight: n(Pn, { gap: 0 }),
|
|
1678
|
+
thanks: n({
|
|
1679
|
+
margin: 0,
|
|
1680
|
+
color: _e,
|
|
1681
|
+
textAlign: "center",
|
|
1682
|
+
fontFamily: Yn,
|
|
1683
|
+
fontSize: "1.25em",
|
|
1684
|
+
fontStyle: "normal",
|
|
1685
|
+
fontWeight: 500,
|
|
1686
|
+
lineHeight: "120%",
|
|
1687
|
+
letterSpacing: "0.15px"
|
|
1688
|
+
}),
|
|
1689
|
+
buttons: n({ display: "flex", flexDirection: "column", gap: "16px" }),
|
|
1690
|
+
playAgain: n(Ie, Qn, {
|
|
1691
|
+
paddingInline: "16px",
|
|
1692
|
+
color: _e,
|
|
1693
|
+
backgroundColor: "var(--fu-ucrc-surface)",
|
|
1694
|
+
"&:hover": { backgroundColor: "var(--fu-ucrc-on-surface)" }
|
|
1695
|
+
}),
|
|
1696
|
+
playAgainContent: n({
|
|
1697
|
+
display: "flex",
|
|
1698
|
+
justifyContent: "center",
|
|
1699
|
+
alignItems: "center",
|
|
1700
|
+
gap: "8px",
|
|
1701
|
+
alignSelf: "stretch"
|
|
1702
|
+
}),
|
|
1703
|
+
playAgainLabel: n(An, { color: _e, textAlign: "center" }),
|
|
1704
|
+
// Joy's solid colour (common.white) stays on the button; the label takes the secondary colour.
|
|
1705
|
+
additional: n(Ie, Qn, {
|
|
1706
|
+
paddingInline: g("md"),
|
|
1707
|
+
color: "#fff",
|
|
1708
|
+
backgroundColor: "var(--fu-ucrc-secondary-container)",
|
|
1709
|
+
"&:hover": { opacity: 0.9 },
|
|
1710
|
+
"& > div": { display: "flex", justifyContent: "center", alignItems: "center", gap: "8px" },
|
|
1711
|
+
"& p": { ...An, color: "var(--fu-ucrc-pq-split-secondary)" }
|
|
1712
|
+
}),
|
|
1713
|
+
alertArea: {
|
|
1714
|
+
stacked: n(qn, { flex: "1", width: "100%", minWidth: "100%", maxWidth: "100%" }),
|
|
1715
|
+
side: n(qn, { flex: "0 0 50%", width: "50%", minWidth: "50%", maxWidth: "50%" })
|
|
1716
|
+
},
|
|
1717
|
+
alertWrapper: n({ padding: g("lg") })
|
|
1718
|
+
}, Zi = {
|
|
1719
|
+
display: "flex",
|
|
1720
|
+
width: "16px",
|
|
1721
|
+
height: "16px",
|
|
1722
|
+
justifyContent: "flex-end",
|
|
1723
|
+
alignItems: "center",
|
|
1724
|
+
color: _e
|
|
1725
|
+
}, Ki = (e) => {
|
|
1726
|
+
var Q, w, P, C, B, O;
|
|
1727
|
+
const i = ne(), r = re(), { t: o } = H(), c = Y(), a = St(), l = ue("lg"), s = e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : c ? Se : ze, x = he(
|
|
1728
|
+
{
|
|
1729
|
+
images: e.personalityQuiz.images,
|
|
1730
|
+
imagePlaceholder: s
|
|
1731
|
+
},
|
|
1732
|
+
G.SPLIT
|
|
1733
|
+
), y = ((Q = e.personalityQuiz.branding) == null ? void 0 : Q.colors) || null, m = (y == null ? void 0 : y.backgroundColor) || r.surfaceVariant, u = r.textColor, b = c ? ((w = e.personalityQuiz.branding) == null ? void 0 : w.images.mobileLogo) || ((P = e.personalityQuiz.branding) == null ? void 0 : P.images.mainLogo) || "" : ((C = e.personalityQuiz.branding) == null ? void 0 : C.images.mainLogo) || "", f = {
|
|
1734
|
+
"--fu-ucrc-pq-split-bg": `rgba(${m ? Oe(m || "").replace(/[^\d,]/g, "") : ""}, 0.5)`,
|
|
1735
|
+
"--fu-ucrc-pq-split-secondary": (y == null ? void 0 : y.secondaryColor) || r.textSecondary
|
|
1736
|
+
}, v = Ut(e.personalityQuiz, e.summary), D = !a && b ? /* @__PURE__ */ t(
|
|
1737
|
+
V,
|
|
1738
|
+
{
|
|
1739
|
+
brandingLogo: b,
|
|
1740
|
+
textColor: (y == null ? void 0 : y.contentColor) || i.colorSchemes.dark.textColor,
|
|
1741
|
+
label: ((B = e.personalityQuiz.labels) == null ? void 0 : B.sponsor) || null
|
|
1742
|
+
}
|
|
1743
|
+
) : null, S = (k) => {
|
|
1744
|
+
var I;
|
|
1745
|
+
return /* @__PURE__ */ t(
|
|
1746
|
+
vi,
|
|
1747
|
+
{
|
|
1748
|
+
entity: e.personalityQuiz,
|
|
1749
|
+
headline: o("personalityQuiz.headline"),
|
|
1750
|
+
finalImage: x,
|
|
1751
|
+
brandingContent: D,
|
|
1752
|
+
isTabulated: k,
|
|
1753
|
+
alwaysShowImage: !1,
|
|
1754
|
+
children: e.summary.personalityQuizId ? /* @__PURE__ */ p("div", { css: ie.questionAreaContent, style: f, children: [
|
|
1755
|
+
/* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(Yi, { personas: v, brandingColors: y }) }),
|
|
1756
|
+
(!e.maxAttemptsReached || e.additionalCTA !== void 0) && /* @__PURE__ */ t("div", { id: "desktop-thanks", css: ie.ctaPanel, children: /* @__PURE__ */ t("div", { css: ie.ctaContainer, children: /* @__PURE__ */ p("div", { css: e.maxAttemptsReached ? ie.ctaContentWrapperTight : ie.ctaContentWrapper, children: [
|
|
1757
|
+
/* @__PURE__ */ t("p", { css: ie.thanks, children: o("classicQuiz.thanksForPlaying") }),
|
|
1758
|
+
/* @__PURE__ */ p("div", { css: ie.buttons, children: [
|
|
1759
|
+
!e.maxAttemptsReached && /* @__PURE__ */ t("button", { type: "button", css: ie.playAgain, onClick: e.playAgain, children: /* @__PURE__ */ p("div", { css: ie.playAgainContent, children: [
|
|
1760
|
+
/* @__PURE__ */ t(Rt, { style: Zi }),
|
|
1761
|
+
/* @__PURE__ */ t("p", { css: ie.playAgainLabel, children: o("classicQuiz.buttons.playAgain") })
|
|
1762
|
+
] }) }),
|
|
1763
|
+
/* @__PURE__ */ t(wt, { additionalCTA: e.additionalCTA, css: ie.additional })
|
|
1764
|
+
] })
|
|
1765
|
+
] }) }) }),
|
|
1766
|
+
e.chanceGameContent,
|
|
1767
|
+
a && b && /* @__PURE__ */ t(
|
|
1768
|
+
V,
|
|
1769
|
+
{
|
|
1770
|
+
brandingLogo: b,
|
|
1771
|
+
textColor: (y == null ? void 0 : y.contentColor) || u,
|
|
1772
|
+
label: ((I = e.personalityQuiz.labels) == null ? void 0 : I.sponsor) || null
|
|
1773
|
+
}
|
|
1774
|
+
)
|
|
1775
|
+
] }) : /* @__PURE__ */ t("div", { css: l ? ie.alertArea.side : ie.alertArea.stacked, children: /* @__PURE__ */ t("div", { css: ie.alertWrapper, children: /* @__PURE__ */ t(
|
|
1776
|
+
kt,
|
|
1777
|
+
{
|
|
1778
|
+
variant: "error",
|
|
1779
|
+
title: o("common.authentication.accessRequired"),
|
|
1780
|
+
message: o("common.authentication.invalidOrMissingAuth")
|
|
1781
|
+
}
|
|
1782
|
+
) }) })
|
|
1783
|
+
}
|
|
1784
|
+
);
|
|
1785
|
+
};
|
|
1786
|
+
return /* @__PURE__ */ t(K, { brandingBorderColor: (y == null ? void 0 : y.borderColor) || null, children: e.showAnswerExplanations ? /* @__PURE__ */ t(
|
|
1787
|
+
Bt,
|
|
1788
|
+
{
|
|
1789
|
+
questions: e.personalityQuiz.questions,
|
|
1790
|
+
userParticipation: e.summary.questions,
|
|
1791
|
+
brandingColors: (O = e.personalityQuiz.branding) == null ? void 0 : O.colors,
|
|
1792
|
+
resultsLayout: c ? "column" : "row",
|
|
1793
|
+
children: S(!0)
|
|
1794
|
+
}
|
|
1795
|
+
) : S(!1) });
|
|
1796
|
+
}, xt = "var(--fu-ucrc-pq-ort-primary)", Zn = "var(--fu-ucrc-pq-ort-primary-25)", mt = {
|
|
1797
|
+
backdropFilter: "blur(4px)",
|
|
1798
|
+
position: "relative",
|
|
1799
|
+
"&::before": {
|
|
1800
|
+
content: '""',
|
|
1801
|
+
position: "absolute",
|
|
1802
|
+
top: 0,
|
|
1803
|
+
left: 0,
|
|
1804
|
+
right: 0,
|
|
1805
|
+
bottom: 0,
|
|
1806
|
+
backgroundColor: "var(--fu-ucrc-pq-ort-content-bg)",
|
|
1807
|
+
opacity: 0.5,
|
|
1808
|
+
borderRadius: "inherit",
|
|
1809
|
+
zIndex: 0
|
|
1810
|
+
},
|
|
1811
|
+
"& > *": { position: "relative", zIndex: 1 }
|
|
1812
|
+
}, Ye = {
|
|
1813
|
+
position: "relative",
|
|
1814
|
+
boxSizing: "border-box",
|
|
1815
|
+
display: "flex",
|
|
1816
|
+
alignItems: "center",
|
|
1817
|
+
alignSelf: "stretch",
|
|
1818
|
+
justifyContent: "center",
|
|
1819
|
+
flex: "initial",
|
|
1820
|
+
gap: "6px",
|
|
1821
|
+
width: "var(--fu-ucrc-pq-ort-tab-width)",
|
|
1822
|
+
minWidth: 0,
|
|
1823
|
+
minHeight: "auto",
|
|
1824
|
+
margin: 0,
|
|
1825
|
+
paddingBlock: g("sm"),
|
|
1826
|
+
paddingInline: g("md"),
|
|
1827
|
+
border: "none",
|
|
1828
|
+
borderBottom: "2px solid transparent",
|
|
1829
|
+
borderRadius: 0,
|
|
1830
|
+
backgroundColor: "transparent",
|
|
1831
|
+
color: "var(--fu-ucrc-pq-ort-text)",
|
|
1832
|
+
font: "inherit",
|
|
1833
|
+
fontFamily: "var(--fu-ucrc-font-primary)",
|
|
1834
|
+
fontWeight: 500,
|
|
1835
|
+
fontSize: "var(--fu-ucrc-pq-ort-tab-size)",
|
|
1836
|
+
textAlign: "start",
|
|
1837
|
+
textDecoration: "none",
|
|
1838
|
+
cursor: "pointer",
|
|
1839
|
+
transition: "all 0.2s ease",
|
|
1840
|
+
WebkitTapHighlightColor: "transparent",
|
|
1841
|
+
"&:focus-visible": { outline: "2px solid var(--fu-ucrc-focus-visible)", outlineOffset: "2px", zIndex: 1 },
|
|
1842
|
+
"&:hover": {
|
|
1843
|
+
backgroundColor: "var(--fu-ucrc-pq-ort-hover-bg)",
|
|
1844
|
+
borderBottom: `2px solid ${Zn}`,
|
|
1845
|
+
color: "#ffffff"
|
|
1846
|
+
}
|
|
1847
|
+
}, Ln = {
|
|
1848
|
+
...Ye,
|
|
1849
|
+
zIndex: 1,
|
|
1850
|
+
fontWeight: 600,
|
|
1851
|
+
color: "#ffffff",
|
|
1852
|
+
borderBottom: `2px solid ${xt}`,
|
|
1853
|
+
"&:hover": { ...Ye["&:hover"], borderBottom: `2px solid ${xt}` }
|
|
1854
|
+
}, Dn = { borderTopLeftRadius: "var(--fu-ucrc-radius-md)" }, Rn = {
|
|
1855
|
+
backgroundSize: "cover",
|
|
1856
|
+
backgroundPosition: "center",
|
|
1857
|
+
backgroundRepeat: "no-repeat",
|
|
1858
|
+
borderRadius: "var(--fu-ucrc-radius-xs)",
|
|
1859
|
+
border: "1px solid rgba(255, 255, 255, 0.3)",
|
|
1860
|
+
flexShrink: 0
|
|
1861
|
+
}, Xi = {
|
|
1862
|
+
flex: "none",
|
|
1863
|
+
textAlign: "center",
|
|
1864
|
+
maxWidth: "100%"
|
|
1865
|
+
}, j = {
|
|
1866
|
+
wrapper: n({
|
|
1867
|
+
display: "flex",
|
|
1868
|
+
flexDirection: "column",
|
|
1869
|
+
justifyContent: "flex-start",
|
|
1870
|
+
alignItems: "stretch",
|
|
1871
|
+
alignSelf: "stretch",
|
|
1872
|
+
width: "100%"
|
|
1873
|
+
}),
|
|
1874
|
+
container: n({ marginTop: g("md"), width: "100%" }),
|
|
1875
|
+
// Joy's Tabs: the body font, 1.5 line height and neutral colour the panels inherit.
|
|
1876
|
+
tabs: n(mt, {
|
|
1877
|
+
display: "flex",
|
|
1878
|
+
flexDirection: "column",
|
|
1879
|
+
width: "100%",
|
|
1880
|
+
borderRadius: "var(--fu-ucrc-radius-md)",
|
|
1881
|
+
overflow: "hidden",
|
|
1882
|
+
fontFamily: "var(--fu-ucrc-font-body)",
|
|
1883
|
+
fontSize: "1em",
|
|
1884
|
+
lineHeight: 1.5,
|
|
1885
|
+
color: "var(--fu-ucrc-neutral-plain-color)"
|
|
1886
|
+
}),
|
|
1887
|
+
list: n({
|
|
1888
|
+
boxSizing: "border-box",
|
|
1889
|
+
display: "flex",
|
|
1890
|
+
flexDirection: "var(--fu-ucrc-pq-ort-list-direction)",
|
|
1891
|
+
flexWrap: "var(--fu-ucrc-pq-ort-list-wrap)",
|
|
1892
|
+
margin: 0,
|
|
1893
|
+
padding: 0,
|
|
1894
|
+
gap: 0,
|
|
1895
|
+
fontSize: "1em",
|
|
1896
|
+
borderBottom: `1px solid ${Zn}`,
|
|
1897
|
+
// Joy's divider: the neutral channel at 16% (the overlay is always dark).
|
|
1898
|
+
boxShadow: "inset 0 -1px rgba(var(--fu-ucrc-neutral-main-channel) / 0.16)"
|
|
1899
|
+
}),
|
|
1900
|
+
tab: {
|
|
1901
|
+
off: n(Ye),
|
|
1902
|
+
on: n(Ln),
|
|
1903
|
+
firstOff: n(Ye, { "&:hover": Dn }),
|
|
1904
|
+
firstOn: n(Ln, Dn)
|
|
1905
|
+
},
|
|
1906
|
+
labelRow: n({
|
|
1907
|
+
display: "flex",
|
|
1908
|
+
justifyContent: "space-between",
|
|
1909
|
+
alignItems: "center",
|
|
1910
|
+
width: "100%",
|
|
1911
|
+
gap: g("sm")
|
|
1912
|
+
}),
|
|
1913
|
+
logo: n(Rn, { width: "24px", height: "24px" }),
|
|
1914
|
+
logoMobile: n(Rn, { width: "20px", height: "20px" }),
|
|
1915
|
+
label: n(fe, {
|
|
1916
|
+
fontSize: "inherit",
|
|
1917
|
+
fontWeight: "inherit",
|
|
1918
|
+
fontFamily: "var(--fu-ucrc-font-secondary)",
|
|
1919
|
+
color: "inherit",
|
|
1920
|
+
textAlign: "left",
|
|
1921
|
+
unicodeBidi: "plaintext",
|
|
1922
|
+
flex: 1
|
|
1923
|
+
}),
|
|
1924
|
+
percentage: n(fe, {
|
|
1925
|
+
backgroundColor: xt,
|
|
1926
|
+
color: "var(--fu-ucrc-pq-ort-on-primary)",
|
|
1927
|
+
paddingInline: g("xs"),
|
|
1928
|
+
paddingBlock: g("3xs"),
|
|
1929
|
+
borderRadius: "var(--fu-ucrc-radius-sm)",
|
|
1930
|
+
fontSize: "0.75em",
|
|
1931
|
+
fontWeight: 600,
|
|
1932
|
+
fontFamily: "var(--fu-ucrc-font-secondary)",
|
|
1933
|
+
minWidth: "auto",
|
|
1934
|
+
lineHeight: 1.2
|
|
1935
|
+
}),
|
|
1936
|
+
panel: n({ flexGrow: 1, fontSize: "1em", padding: 0 }),
|
|
1937
|
+
content: n(mt, { padding: g("lg"), minHeight: "200px" }),
|
|
1938
|
+
contentMobile: n(mt, { padding: g("md"), minHeight: "200px" }),
|
|
1939
|
+
// Rendered on desktop only, so always a row.
|
|
1940
|
+
withImage: n({ display: "flex", flexDirection: "row", alignItems: "flex-start", gap: g("lg") }),
|
|
1941
|
+
imageSection: n({ display: "flex", justifyContent: "center", alignItems: "center", flex: "0 0 auto" }),
|
|
1942
|
+
personaImage: n({
|
|
1943
|
+
width: "250px",
|
|
1944
|
+
height: "180px",
|
|
1945
|
+
backgroundSize: "cover",
|
|
1946
|
+
backgroundPosition: "center",
|
|
1947
|
+
backgroundRepeat: "no-repeat",
|
|
1948
|
+
borderRadius: "var(--fu-ucrc-radius-md)",
|
|
1949
|
+
border: "1px solid rgba(255, 255, 255, 0.2)"
|
|
1950
|
+
}),
|
|
1951
|
+
descriptionSection: n(Xi),
|
|
1952
|
+
descriptionSectionWide: n({ flex: "1", textAlign: "left", maxWidth: "60%" }),
|
|
1953
|
+
descriptionOnly: n({ display: "flex", justifyContent: "center", alignItems: "center", minHeight: "150px" }),
|
|
1954
|
+
description: n({ color: "var(--fu-ucrc-pq-ort-text)", fontFamily: "var(--fu-ucrc-font-primary)", lineHeight: 1.6 })
|
|
1955
|
+
}, Ji = ({
|
|
1956
|
+
personas: e,
|
|
1957
|
+
brandingColors: i,
|
|
1958
|
+
contentBgColor: r
|
|
1959
|
+
}) => {
|
|
1960
|
+
var k;
|
|
1961
|
+
const [o, c] = U(0), [a, l] = U(0), s = Ce([]), x = Je(), y = Ke(), m = ne(), u = Y(), b = ue("sm"), f = ue("md");
|
|
1962
|
+
if (!e || e.length === 0)
|
|
1963
|
+
return null;
|
|
1964
|
+
const v = m.colorSchemes.dark, D = (i == null ? void 0 : i.primaryColor) || v.palette.primary.plainColor, S = {
|
|
1965
|
+
"--fu-ucrc-pq-ort-primary": D,
|
|
1966
|
+
"--fu-ucrc-pq-ort-primary-25": `${D}40`,
|
|
1967
|
+
"--fu-ucrc-pq-ort-content-bg": r,
|
|
1968
|
+
"--fu-ucrc-pq-ort-text": v.textColor,
|
|
1969
|
+
"--fu-ucrc-pq-ort-hover-bg": v.surface,
|
|
1970
|
+
"--fu-ucrc-pq-ort-on-primary": v.palette.primary.onPrimary
|
|
1971
|
+
}, Q = {
|
|
1972
|
+
"--fu-ucrc-pq-ort-list-direction": u ? "column" : "row",
|
|
1973
|
+
"--fu-ucrc-pq-ort-list-wrap": u ? "nowrap" : "wrap",
|
|
1974
|
+
"--fu-ucrc-pq-ort-tab-width": u ? "100%" : "auto",
|
|
1975
|
+
"--fu-ucrc-pq-ort-tab-size": b ? "0.9em" : "0.85em"
|
|
1976
|
+
}, w = (I) => {
|
|
1977
|
+
var z;
|
|
1978
|
+
const R = (I + e.length) % e.length;
|
|
1979
|
+
l(R), (z = s.current[R]) == null || z.focus();
|
|
1980
|
+
}, P = (I) => {
|
|
1981
|
+
const R = y ? "ArrowLeft" : "ArrowRight", z = y ? "ArrowRight" : "ArrowLeft", A = { [R]: a + 1, [z]: a - 1, Home: 0, End: e.length - 1 }[I.key];
|
|
1982
|
+
A !== void 0 && (I.preventDefault(), w(A));
|
|
1983
|
+
}, C = e[o], B = ((k = C == null ? void 0 : C.images) == null ? void 0 : k.main) || null, O = (I) => /* @__PURE__ */ t("span", { css: j.description, dir: "auto", dangerouslySetInnerHTML: { __html: I } });
|
|
1984
|
+
return /* @__PURE__ */ t("div", { css: j.wrapper, style: S, children: /* @__PURE__ */ t("div", { css: j.container, children: /* @__PURE__ */ p("div", { css: j.tabs, children: [
|
|
1985
|
+
/* @__PURE__ */ t(
|
|
1986
|
+
"div",
|
|
1987
|
+
{
|
|
1988
|
+
role: "tablist",
|
|
1989
|
+
"aria-orientation": "horizontal",
|
|
1990
|
+
css: j.list,
|
|
1991
|
+
style: Q,
|
|
1992
|
+
onKeyDown: P,
|
|
1993
|
+
children: e.map((I, R) => {
|
|
1994
|
+
var q, M, $;
|
|
1995
|
+
const z = R === o, A = ((q = I.images) == null ? void 0 : q.main) || null, L = ((M = I.images) == null ? void 0 : M.mobile) || (($ = I.images) == null ? void 0 : $.main) || null, N = u ? !!L : !!A && !I.description, d = u ? L : A;
|
|
1996
|
+
return /* @__PURE__ */ t(
|
|
1997
|
+
"button",
|
|
1998
|
+
{
|
|
1999
|
+
ref: (ee) => {
|
|
2000
|
+
s.current[R] = ee;
|
|
2001
|
+
},
|
|
2002
|
+
type: "button",
|
|
2003
|
+
role: "tab",
|
|
2004
|
+
id: `${x}-tab-${R}`,
|
|
2005
|
+
"aria-selected": z,
|
|
2006
|
+
"aria-controls": z && I.description ? `${x}-panel` : void 0,
|
|
2007
|
+
tabIndex: R === a ? 0 : -1,
|
|
2008
|
+
css: R === 0 ? z ? j.tab.firstOn : j.tab.firstOff : z ? j.tab.on : j.tab.off,
|
|
2009
|
+
onClick: () => {
|
|
2010
|
+
c(R), l(R);
|
|
2011
|
+
},
|
|
2012
|
+
onFocus: () => l(R),
|
|
2013
|
+
children: /* @__PURE__ */ p("div", { css: j.labelRow, children: [
|
|
2014
|
+
N && d && /* @__PURE__ */ t(
|
|
2015
|
+
"div",
|
|
2016
|
+
{
|
|
2017
|
+
css: u ? j.logoMobile : j.logo,
|
|
2018
|
+
style: { backgroundImage: `url("${d}")` }
|
|
2019
|
+
}
|
|
2020
|
+
),
|
|
2021
|
+
/* @__PURE__ */ t("p", { css: j.label, children: I.title }),
|
|
2022
|
+
/* @__PURE__ */ p("p", { css: j.percentage, children: [
|
|
2023
|
+
I.percent,
|
|
2024
|
+
"%"
|
|
2025
|
+
] })
|
|
2026
|
+
] })
|
|
2027
|
+
},
|
|
2028
|
+
I.personaId
|
|
2029
|
+
);
|
|
2030
|
+
})
|
|
2031
|
+
}
|
|
2032
|
+
),
|
|
2033
|
+
(C == null ? void 0 : C.description) && /* @__PURE__ */ t("div", { role: "tabpanel", id: `${x}-panel`, "aria-labelledby": `${x}-tab-${o}`, css: j.panel, children: /* @__PURE__ */ t("div", { css: u ? j.contentMobile : j.content, children: B && !u ? /* @__PURE__ */ p("div", { css: j.withImage, children: [
|
|
2034
|
+
/* @__PURE__ */ t("div", { css: j.imageSection, children: /* @__PURE__ */ t("div", { css: j.personaImage, style: { backgroundImage: `url("${B}")` } }) }),
|
|
2035
|
+
/* @__PURE__ */ t("div", { css: f ? j.descriptionSectionWide : j.descriptionSection, children: O(C.description) })
|
|
2036
|
+
] }) : /* @__PURE__ */ t("div", { css: j.descriptionOnly, children: O(C.description) }) }) })
|
|
2037
|
+
] }) }) });
|
|
2038
|
+
}, vt = "var(--fu-ucrc-pq-oss-text-primary)", Fe = { display: "flex", justifyContent: "center", alignItems: "center" }, Tn = {
|
|
2039
|
+
...fe,
|
|
2040
|
+
fontFamily: "var(--fu-ucrc-font-primary)",
|
|
2041
|
+
fontSize: "0.9375em",
|
|
2042
|
+
fontStyle: "normal",
|
|
2043
|
+
fontWeight: 500,
|
|
2044
|
+
lineHeight: "24px",
|
|
2045
|
+
textTransform: "uppercase"
|
|
2046
|
+
}, Bn = {
|
|
2047
|
+
...Fe,
|
|
2048
|
+
flexDirection: "column",
|
|
2049
|
+
gap: "8px",
|
|
2050
|
+
borderRadius: "var(--fu-ucrc-pq-oss-radius-xl)",
|
|
2051
|
+
color: "#fff",
|
|
2052
|
+
fontSize: "0.9375em"
|
|
2053
|
+
}, de = {
|
|
2054
|
+
wrapperContent: n({ display: "flex", flexDirection: "column", gap: "40px", padding: g("xl") }),
|
|
2055
|
+
main: n({ display: "flex", flexDirection: "column", gap: "24px", zIndex: 10 }),
|
|
2056
|
+
results: n({ display: "flex", flexDirection: "column", alignSelf: "stretch" }),
|
|
2057
|
+
cta: n({ ...Fe, paddingBlock: g("xs"), gap: "24px", flex: "1 0 0" }),
|
|
2058
|
+
ctaContent: n({ ...Fe, flexDirection: "column", gap: g("md"), flex: "1 0 0" }),
|
|
2059
|
+
thanks: n({
|
|
2060
|
+
...fe,
|
|
2061
|
+
color: vt,
|
|
2062
|
+
textAlign: "center",
|
|
2063
|
+
fontFamily: "var(--fu-ucrc-font-primary)",
|
|
2064
|
+
fontSize: "1.25em",
|
|
2065
|
+
fontStyle: "normal",
|
|
2066
|
+
fontWeight: 500,
|
|
2067
|
+
lineHeight: "120%",
|
|
2068
|
+
letterSpacing: "0.15px"
|
|
2069
|
+
}),
|
|
2070
|
+
buttons: n({ display: "flex", flexDirection: "column", gap: g("md") }),
|
|
2071
|
+
playAgain: n(Ie, Bn, {
|
|
2072
|
+
minHeight: "48px",
|
|
2073
|
+
paddingBlock: "12px",
|
|
2074
|
+
paddingRight: "24px",
|
|
2075
|
+
paddingLeft: "16px",
|
|
2076
|
+
backgroundColor: "var(--fu-ucrc-pq-oss-play-bg)",
|
|
2077
|
+
"&:hover": { backgroundColor: "var(--fu-ucrc-pq-oss-play-hover)" }
|
|
2078
|
+
}),
|
|
2079
|
+
playAgainContent: n({ ...Fe, gap: "8px", alignSelf: "stretch" }),
|
|
2080
|
+
playAgainText: n({ ...Tn, letterSpacing: "0.46px", textAlign: "center", color: vt }),
|
|
2081
|
+
additionalCta: n(Ie, Bn, {
|
|
2082
|
+
paddingBlock: g("sm"),
|
|
2083
|
+
paddingInline: g("md"),
|
|
2084
|
+
backgroundColor: "var(--fu-ucrc-pq-oss-secondary-container)",
|
|
2085
|
+
"&:hover": { opacity: 0.9 },
|
|
2086
|
+
"& > div": { ...Fe, gap: "8px" },
|
|
2087
|
+
"& p": { ...Tn, letterSpacing: "0.40px", color: "var(--fu-ucrc-pq-oss-secondary)" }
|
|
2088
|
+
})
|
|
2089
|
+
}, ea = {
|
|
2090
|
+
display: "flex",
|
|
2091
|
+
width: "24px",
|
|
2092
|
+
height: "24px",
|
|
2093
|
+
justifyContent: "center",
|
|
2094
|
+
alignItems: "center",
|
|
2095
|
+
color: vt
|
|
2096
|
+
}, ta = (e) => {
|
|
2097
|
+
var S;
|
|
2098
|
+
const i = ne(), { t: r } = H(), o = Un(G.OVERLAY), c = Y(), a = e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : c ? Se : ze, { brandingImage: l, brandingColors: s, brandingLogo: x } = He(
|
|
2099
|
+
e.personalityQuiz.branding || null
|
|
2100
|
+
), y = he(
|
|
2101
|
+
{ images: e.personalityQuiz.images, imagePlaceholder: a },
|
|
2102
|
+
G.OVERLAY
|
|
2103
|
+
), m = l || y, u = i.colorSchemes.dark, b = (s == null ? void 0 : s.backgroundColor) || u.onSurface, f = {
|
|
2104
|
+
"--fu-ucrc-pq-oss-text-primary": u.textPrimary,
|
|
2105
|
+
"--fu-ucrc-pq-oss-secondary": (s == null ? void 0 : s.secondaryColor) || u.textSecondary,
|
|
2106
|
+
"--fu-ucrc-pq-oss-secondary-container": u.secondaryContainer,
|
|
2107
|
+
"--fu-ucrc-pq-oss-play-bg": u.onSurface,
|
|
2108
|
+
"--fu-ucrc-pq-oss-play-hover": u.surfaceVariant,
|
|
2109
|
+
"--fu-ucrc-pq-oss-radius-xl": i.customRadius.light.xl
|
|
2110
|
+
}, v = Ut(e.personalityQuiz, e.summary), D = () => {
|
|
2111
|
+
var Q;
|
|
2112
|
+
return /* @__PURE__ */ p("div", { css: de.main, style: f, children: [
|
|
2113
|
+
e.summary.personalityQuizId ? /* @__PURE__ */ p(Re, { children: [
|
|
2114
|
+
/* @__PURE__ */ t("div", { css: de.results, children: /* @__PURE__ */ t(
|
|
2115
|
+
Ji,
|
|
2116
|
+
{
|
|
2117
|
+
personas: v,
|
|
2118
|
+
brandingColors: s,
|
|
2119
|
+
contentBgColor: b
|
|
2120
|
+
}
|
|
2121
|
+
) }),
|
|
2122
|
+
(!e.maxAttemptsReached || e.additionalCTA !== void 0) && /* @__PURE__ */ t("div", { css: de.cta, children: /* @__PURE__ */ p("div", { css: de.ctaContent, children: [
|
|
2123
|
+
/* @__PURE__ */ t("p", { css: de.thanks, children: r("personalityQuiz.thanksForPlaying") }),
|
|
2124
|
+
/* @__PURE__ */ p("div", { css: de.buttons, children: [
|
|
2125
|
+
!e.maxAttemptsReached && /* @__PURE__ */ t("button", { type: "button", css: de.playAgain, onClick: e.playAgain, children: /* @__PURE__ */ p("div", { css: de.playAgainContent, children: [
|
|
2126
|
+
/* @__PURE__ */ t(Rt, { style: ea }),
|
|
2127
|
+
/* @__PURE__ */ t("p", { css: de.playAgainText, children: r("personalityQuiz.buttons.playAgain") })
|
|
2128
|
+
] }) }),
|
|
2129
|
+
/* @__PURE__ */ t(wt, { additionalCTA: e.additionalCTA, css: de.additionalCta })
|
|
2130
|
+
] })
|
|
2131
|
+
] }) }),
|
|
2132
|
+
e.chanceGameContent
|
|
2133
|
+
] }) : /* @__PURE__ */ t(
|
|
2134
|
+
kt,
|
|
2135
|
+
{
|
|
2136
|
+
variant: "error",
|
|
2137
|
+
title: r("common.authentication.accessRequired"),
|
|
2138
|
+
message: r("common.authentication.invalidOrMissingAuth")
|
|
2139
|
+
}
|
|
2140
|
+
),
|
|
2141
|
+
/* @__PURE__ */ t(
|
|
2142
|
+
V,
|
|
2143
|
+
{
|
|
2144
|
+
brandingLogo: x,
|
|
2145
|
+
textColor: u.textColor,
|
|
2146
|
+
label: ((Q = e.personalityQuiz.labels) == null ? void 0 : Q.sponsor) || null
|
|
2147
|
+
}
|
|
2148
|
+
)
|
|
2149
|
+
] });
|
|
2150
|
+
};
|
|
2151
|
+
return /* @__PURE__ */ t(
|
|
2152
|
+
Ci,
|
|
2153
|
+
{
|
|
2154
|
+
entity: e.personalityQuiz,
|
|
2155
|
+
backgroundImage: Mn(m),
|
|
2156
|
+
imageBackgroundGradient: o,
|
|
2157
|
+
isWrappedWithScoreStateWrapper: e.showAnswerExplanations,
|
|
2158
|
+
children: e.showAnswerExplanations ? /* @__PURE__ */ t(
|
|
2159
|
+
Bt,
|
|
2160
|
+
{
|
|
2161
|
+
questions: e.personalityQuiz.questions,
|
|
2162
|
+
userParticipation: e.summary.questions,
|
|
2163
|
+
resultsLayout: "block",
|
|
2164
|
+
isOverlayVariant: !0,
|
|
2165
|
+
brandingColors: (S = e.personalityQuiz.branding) == null ? void 0 : S.colors,
|
|
2166
|
+
children: /* @__PURE__ */ t("div", { css: de.wrapperContent, children: D() })
|
|
2167
|
+
}
|
|
2168
|
+
) : D()
|
|
2169
|
+
}
|
|
2170
|
+
);
|
|
2171
|
+
}, na = () => {
|
|
2172
|
+
const { t: e } = H();
|
|
2173
|
+
return /* @__PURE__ */ t(K, { brandingBorderColor: null, children: /* @__PURE__ */ t(Ii, { title: e("personalityQuiz.quizNotFound"), message: e("personalityQuiz.quizNotFoundDescription") }) });
|
|
2174
|
+
}, ia = ({
|
|
2175
|
+
personalityQuiz: e,
|
|
2176
|
+
template: i,
|
|
2177
|
+
imagePosition: r,
|
|
2178
|
+
defaultImagePlaceholderUrl: o,
|
|
2179
|
+
rulesDisplay: c
|
|
2180
|
+
}) => {
|
|
2181
|
+
var u;
|
|
2182
|
+
const { t: a } = H(), l = Y(), s = ((u = e.branding) == null ? void 0 : u.colors) || null, { brandingLogo: x } = He(
|
|
2183
|
+
e.branding || null
|
|
2184
|
+
), y = (b) => {
|
|
2185
|
+
var f;
|
|
2186
|
+
return /* @__PURE__ */ t(
|
|
2187
|
+
V,
|
|
2188
|
+
{
|
|
2189
|
+
brandingLogo: x,
|
|
2190
|
+
textColor: b,
|
|
2191
|
+
label: ((f = e.labels) == null ? void 0 : f.sponsor) || null
|
|
2192
|
+
}
|
|
2193
|
+
);
|
|
2194
|
+
}, m = {
|
|
2195
|
+
entity: e,
|
|
2196
|
+
headline: a("personalityQuiz.headline"),
|
|
2197
|
+
tryAgainButtonText: "",
|
|
2198
|
+
isApiError: !1,
|
|
2199
|
+
alertVariant: "neutral",
|
|
2200
|
+
customAlertTitle: a("personalityQuiz.gameNotAvailable"),
|
|
2201
|
+
customAlertMessage: a("personalityQuiz.gameNotAvailableDescription"),
|
|
2202
|
+
renderPresentedBy: y,
|
|
2203
|
+
rulesDisplay: c
|
|
2204
|
+
};
|
|
2205
|
+
return i === G.OVERLAY ? /* @__PURE__ */ t(
|
|
2206
|
+
Fn,
|
|
2207
|
+
{
|
|
2208
|
+
...m,
|
|
2209
|
+
defaultImagePlaceholderUrl: o || (l ? Se : ze)
|
|
2210
|
+
}
|
|
2211
|
+
) : i === G.SPLIT ? /* @__PURE__ */ t(K, { brandingBorderColor: (s == null ? void 0 : s.borderColor) || null, children: /* @__PURE__ */ t(
|
|
2212
|
+
Hn,
|
|
2213
|
+
{
|
|
2214
|
+
...m,
|
|
2215
|
+
defaultImagePlaceholderUrl: o
|
|
2216
|
+
}
|
|
2217
|
+
) }) : /* @__PURE__ */ t(K, { brandingBorderColor: (s == null ? void 0 : s.borderColor) || null, children: /* @__PURE__ */ t(
|
|
2218
|
+
On,
|
|
2219
|
+
{
|
|
2220
|
+
...m,
|
|
2221
|
+
imagePosition: r || "left",
|
|
2222
|
+
defaultImagePlaceholderUrl: o
|
|
2223
|
+
}
|
|
2224
|
+
) });
|
|
2225
|
+
}, aa = (e) => {
|
|
2226
|
+
var c, a, l, s;
|
|
2227
|
+
const i = ((c = e.personalityQuiz.branding) == null ? void 0 : c.colors) || null, r = Y() ? ((a = e.personalityQuiz.branding) == null ? void 0 : a.images.mobileLogo) || ((l = e.personalityQuiz.branding) == null ? void 0 : l.images.mainLogo) || "" : ((s = e.personalityQuiz.branding) == null ? void 0 : s.images.mainLogo) || "", { t: o } = H();
|
|
2228
|
+
return /* @__PURE__ */ t(K, { brandingBorderColor: (i == null ? void 0 : i.borderColor) || null, children: /* @__PURE__ */ t(
|
|
2229
|
+
On,
|
|
2230
|
+
{
|
|
2231
|
+
entity: e.personalityQuiz,
|
|
2232
|
+
headline: o("personalityQuiz.headline"),
|
|
2233
|
+
tryAgainButtonText: o("personalityQuiz.buttons.tryAgain"),
|
|
2234
|
+
defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
|
|
2235
|
+
imagePosition: e.imagePosition || "left",
|
|
2236
|
+
isApiError: e.isApiError,
|
|
2237
|
+
toggleTryAgain: e.toggleTryAgain,
|
|
2238
|
+
apiErrorMessage: e.apiErrorMessage,
|
|
2239
|
+
rulesDisplay: e.rulesDisplay,
|
|
2240
|
+
renderPresentedBy: (x) => {
|
|
2241
|
+
var y;
|
|
2242
|
+
return /* @__PURE__ */ t(
|
|
2243
|
+
V,
|
|
2244
|
+
{
|
|
2245
|
+
brandingLogo: r,
|
|
2246
|
+
textColor: x,
|
|
2247
|
+
label: ((y = e.personalityQuiz.labels) == null ? void 0 : y.sponsor) || null
|
|
2248
|
+
}
|
|
2249
|
+
);
|
|
2250
|
+
}
|
|
2251
|
+
}
|
|
2252
|
+
) });
|
|
2253
|
+
}, ra = (e) => {
|
|
2254
|
+
var a, l, s, x;
|
|
2255
|
+
const i = Y(), { t: r } = H(), o = ((a = e.personalityQuiz.branding) == null ? void 0 : a.colors) || null, c = i ? ((l = e.personalityQuiz.branding) == null ? void 0 : l.images.mobileLogo) || ((s = e.personalityQuiz.branding) == null ? void 0 : s.images.mainLogo) || "" : ((x = e.personalityQuiz.branding) == null ? void 0 : x.images.mainLogo) || "";
|
|
2256
|
+
return /* @__PURE__ */ t(K, { brandingBorderColor: (o == null ? void 0 : o.borderColor) || null, children: /* @__PURE__ */ t(
|
|
2257
|
+
Hn,
|
|
2258
|
+
{
|
|
2259
|
+
entity: e.personalityQuiz,
|
|
2260
|
+
headline: r("personalityQuiz.headline"),
|
|
2261
|
+
tryAgainButtonText: r("personalityQuiz.buttons.tryAgain"),
|
|
2262
|
+
defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
|
|
2263
|
+
isApiError: e.isApiError,
|
|
2264
|
+
toggleTryAgain: e.toggleTryAgain,
|
|
2265
|
+
apiErrorMessage: e.apiErrorMessage,
|
|
2266
|
+
rulesDisplay: e.rulesDisplay,
|
|
2267
|
+
renderPresentedBy: (y) => {
|
|
2268
|
+
var m;
|
|
2269
|
+
return /* @__PURE__ */ t(
|
|
2270
|
+
V,
|
|
2271
|
+
{
|
|
2272
|
+
brandingLogo: c,
|
|
2273
|
+
textColor: y,
|
|
2274
|
+
label: ((m = e.personalityQuiz.labels) == null ? void 0 : m.sponsor) || null
|
|
2275
|
+
}
|
|
2276
|
+
);
|
|
2277
|
+
}
|
|
2278
|
+
}
|
|
2279
|
+
) });
|
|
2280
|
+
}, oa = (e) => {
|
|
2281
|
+
const { t: i } = H(), r = Y(), o = e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : r ? Se : ze, { brandingLogo: c } = He(e.personalityQuiz.branding || null);
|
|
2282
|
+
return /* @__PURE__ */ t(
|
|
2283
|
+
Fn,
|
|
2284
|
+
{
|
|
2285
|
+
entity: e.personalityQuiz,
|
|
2286
|
+
headline: i("personalityQuiz.headline"),
|
|
2287
|
+
tryAgainButtonText: i("personalityQuiz.buttons.tryAgain"),
|
|
2288
|
+
defaultImagePlaceholderUrl: o,
|
|
2289
|
+
isApiError: e.isApiError,
|
|
2290
|
+
toggleTryAgain: e.toggleTryAgain,
|
|
2291
|
+
apiErrorMessage: e.apiErrorMessage,
|
|
2292
|
+
rulesDisplay: e.rulesDisplay,
|
|
2293
|
+
renderPresentedBy: (a) => {
|
|
2294
|
+
var l;
|
|
2295
|
+
return /* @__PURE__ */ t(
|
|
2296
|
+
V,
|
|
2297
|
+
{
|
|
2298
|
+
brandingLogo: c,
|
|
2299
|
+
textColor: a,
|
|
2300
|
+
label: ((l = e.personalityQuiz.labels) == null ? void 0 : l.sponsor) || null
|
|
2301
|
+
}
|
|
2302
|
+
);
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
);
|
|
2306
|
+
}, la = (e) => {
|
|
2307
|
+
var u, b, f, v, D;
|
|
2308
|
+
const i = ((u = e.personalityQuiz.branding) == null ? void 0 : u.colors) || null, r = Y(), o = ne(), c = re(), a = he(
|
|
2309
|
+
{
|
|
2310
|
+
images: e.personalityQuiz.images,
|
|
2311
|
+
imagePlaceholder: e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : ""
|
|
2312
|
+
},
|
|
2313
|
+
G.STANDARD
|
|
2314
|
+
), l = (i == null ? void 0 : i.primaryColor) || c.palette.primary.plainColor, s = (i == null ? void 0 : i.contentColor) || c.textColor, x = r ? ((b = e.personalityQuiz.branding) == null ? void 0 : b.images.mobileLogo) || ((f = e.personalityQuiz.branding) == null ? void 0 : f.images.mainLogo) || "" : ((v = e.personalityQuiz.branding) == null ? void 0 : v.images.mainLogo) || "", { t: y } = H(), m = e.imagePosition || "left";
|
|
2315
|
+
return /* @__PURE__ */ t(K, { brandingBorderColor: (i == null ? void 0 : i.borderColor) || null, children: /* @__PURE__ */ t(
|
|
2316
|
+
Si,
|
|
2317
|
+
{
|
|
2318
|
+
entity: e.personalityQuiz,
|
|
2319
|
+
headline: y("personalityQuiz.headline"),
|
|
2320
|
+
finalImage: a,
|
|
2321
|
+
imagePosition: m,
|
|
2322
|
+
signInContent: /* @__PURE__ */ t(At, { signInCTA: e.signInCTA, primaryColor: l, pulse: !0 }),
|
|
2323
|
+
brandingContent: /* @__PURE__ */ t(
|
|
2324
|
+
V,
|
|
2325
|
+
{
|
|
2326
|
+
brandingLogo: x,
|
|
2327
|
+
textColor: r && a ? (i == null ? void 0 : i.contentColor) || o.colorSchemes.dark.textColor : s,
|
|
2328
|
+
label: ((D = e.personalityQuiz.labels) == null ? void 0 : D.sponsor) || null
|
|
2329
|
+
}
|
|
2330
|
+
),
|
|
2331
|
+
rulesDisplay: e.rulesDisplay
|
|
2332
|
+
}
|
|
2333
|
+
) });
|
|
2334
|
+
}, sa = (e) => {
|
|
2335
|
+
var m, u, b, f, v;
|
|
2336
|
+
const i = ne(), r = re(), o = Y(), c = e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : o ? Se : ze, a = he(
|
|
2337
|
+
{
|
|
2338
|
+
images: e.personalityQuiz.images,
|
|
2339
|
+
imagePlaceholder: c
|
|
2340
|
+
},
|
|
2341
|
+
G.SPLIT
|
|
2342
|
+
), { t: l } = H(), s = ((m = e.personalityQuiz.branding) == null ? void 0 : m.colors) || null, x = o ? ((u = e.personalityQuiz.branding) == null ? void 0 : u.images.mobileLogo) || ((b = e.personalityQuiz.branding) == null ? void 0 : b.images.mainLogo) || "" : ((f = e.personalityQuiz.branding) == null ? void 0 : f.images.mainLogo) || "", y = (s == null ? void 0 : s.primaryColor) || r.palette.primary.plainColor;
|
|
2343
|
+
return /* @__PURE__ */ t(K, { brandingBorderColor: (s == null ? void 0 : s.borderColor) || null, children: /* @__PURE__ */ t(
|
|
2344
|
+
zi,
|
|
2345
|
+
{
|
|
2346
|
+
entity: e.personalityQuiz,
|
|
2347
|
+
headline: l("personalityQuiz.headline"),
|
|
2348
|
+
finalImage: a,
|
|
2349
|
+
signInContent: /* @__PURE__ */ t(At, { signInCTA: e.signInCTA, primaryColor: y, pulse: !0 }),
|
|
2350
|
+
brandingContent: /* @__PURE__ */ t(
|
|
2351
|
+
V,
|
|
2352
|
+
{
|
|
2353
|
+
brandingLogo: x,
|
|
2354
|
+
textColor: (s == null ? void 0 : s.contentColor) || i.colorSchemes.dark.textColor,
|
|
2355
|
+
label: ((v = e.personalityQuiz.labels) == null ? void 0 : v.sponsor) || null
|
|
2356
|
+
}
|
|
2357
|
+
),
|
|
2358
|
+
rulesDisplay: e.rulesDisplay
|
|
2359
|
+
}
|
|
2360
|
+
) });
|
|
2361
|
+
}, ca = n({ display: "contents" }), da = (e) => {
|
|
2362
|
+
var v;
|
|
2363
|
+
const i = ne(), { t: r } = H(), o = Y(), c = Un(G.OVERLAY), { brandingImage: a, brandingColors: l, brandingLogo: s } = He(
|
|
2364
|
+
e.personalityQuiz.branding || null
|
|
2365
|
+
), x = e.defaultImagePlaceholderUrl ? e.defaultImagePlaceholderUrl : o ? Se : ze, y = he({ images: e.personalityQuiz.images, imagePlaceholder: x }, G.OVERLAY), m = a || y, u = i.colorSchemes.light, b = (l == null ? void 0 : l.primaryColor) || u.palette.primary.plainColor, f = {
|
|
2366
|
+
"--fu-ucrc-primary-on-primary": u.palette.primary.onPrimary,
|
|
2367
|
+
"--fu-ucrc-radius-xl": i.customRadius.light.xl
|
|
2368
|
+
};
|
|
2369
|
+
return /* @__PURE__ */ t(
|
|
2370
|
+
wi,
|
|
2371
|
+
{
|
|
2372
|
+
entity: e.personalityQuiz,
|
|
2373
|
+
headline: r("personalityQuiz.headline"),
|
|
2374
|
+
backgroundImage: Mn(m),
|
|
2375
|
+
imageBackgroundGradient: c,
|
|
2376
|
+
signInContent: /* @__PURE__ */ t("div", { css: ca, style: f, children: /* @__PURE__ */ t(At, { signInCTA: e.signInCTA, primaryColor: b, pulse: !0 }) }),
|
|
2377
|
+
brandingContent: /* @__PURE__ */ t(
|
|
2378
|
+
V,
|
|
2379
|
+
{
|
|
2380
|
+
brandingLogo: s,
|
|
2381
|
+
textColor: i.colorSchemes.dark.textColor,
|
|
2382
|
+
label: ((v = e.personalityQuiz.labels) == null ? void 0 : v.sponsor) || null
|
|
2383
|
+
}
|
|
2384
|
+
),
|
|
2385
|
+
rulesDisplay: e.rulesDisplay
|
|
2386
|
+
}
|
|
2387
|
+
);
|
|
2388
|
+
}, ua = (e) => {
|
|
2389
|
+
var a, l, s;
|
|
2390
|
+
const { t: i } = H(), r = ((a = e.personalityQuiz.branding) == null ? void 0 : a.colors) || null, o = re(), c = (r == null ? void 0 : r.primaryColor) || o.palette.primary.plainColor;
|
|
2391
|
+
return /* @__PURE__ */ t(
|
|
2392
|
+
Qt,
|
|
2393
|
+
{
|
|
2394
|
+
entity: e.personalityQuiz,
|
|
2395
|
+
headline: i("personalityQuiz.headline"),
|
|
2396
|
+
sdk: e.sdk,
|
|
2397
|
+
defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
|
|
2398
|
+
imagePosition: e.imagePosition,
|
|
2399
|
+
onLeadSubmitted: () => {
|
|
2400
|
+
},
|
|
2401
|
+
MainCard: K,
|
|
2402
|
+
PresentedBy: V,
|
|
2403
|
+
rulesDisplay: e.rulesDisplay,
|
|
2404
|
+
content: /* @__PURE__ */ t(
|
|
2405
|
+
Pt,
|
|
2406
|
+
{
|
|
2407
|
+
signInCTA: e.signInCTA,
|
|
2408
|
+
labels: (s = (l = e.signInCTA) == null ? void 0 : l.gate) == null ? void 0 : s.labels,
|
|
2409
|
+
primaryColor: c,
|
|
2410
|
+
textColor: (r == null ? void 0 : r.contentColor) || void 0,
|
|
2411
|
+
align: "center"
|
|
2412
|
+
}
|
|
2413
|
+
)
|
|
2414
|
+
}
|
|
2415
|
+
);
|
|
2416
|
+
}, ga = (e) => {
|
|
2417
|
+
var a, l, s;
|
|
2418
|
+
const { t: i } = H(), r = ((a = e.personalityQuiz.branding) == null ? void 0 : a.colors) || null, o = re(), c = (r == null ? void 0 : r.primaryColor) || o.palette.primary.plainColor;
|
|
2419
|
+
return /* @__PURE__ */ t(
|
|
2420
|
+
qt,
|
|
2421
|
+
{
|
|
2422
|
+
entity: e.personalityQuiz,
|
|
2423
|
+
headline: i("personalityQuiz.headline"),
|
|
2424
|
+
sdk: e.sdk,
|
|
2425
|
+
defaultImagePlaceholder: e.defaultImagePlaceholderUrl,
|
|
2426
|
+
onLeadSubmitted: () => {
|
|
2427
|
+
},
|
|
2428
|
+
MainCard: K,
|
|
2429
|
+
PresentedBy: V,
|
|
2430
|
+
rulesDisplay: e.rulesDisplay,
|
|
2431
|
+
content: /* @__PURE__ */ t(
|
|
2432
|
+
Pt,
|
|
2433
|
+
{
|
|
2434
|
+
signInCTA: e.signInCTA,
|
|
2435
|
+
labels: (s = (l = e.signInCTA) == null ? void 0 : l.gate) == null ? void 0 : s.labels,
|
|
2436
|
+
primaryColor: c,
|
|
2437
|
+
textColor: (r == null ? void 0 : r.contentColor) || void 0,
|
|
2438
|
+
align: "center"
|
|
2439
|
+
}
|
|
2440
|
+
)
|
|
2441
|
+
}
|
|
2442
|
+
);
|
|
2443
|
+
}, ma = (e) => {
|
|
2444
|
+
var a, l, s;
|
|
2445
|
+
const { t: i } = H(), r = ne(), o = ((a = e.personalityQuiz.branding) == null ? void 0 : a.colors) || null, c = (o == null ? void 0 : o.primaryColor) || r.colorSchemes.dark.palette.primary.plainColor;
|
|
2446
|
+
return /* @__PURE__ */ t(
|
|
2447
|
+
Lt,
|
|
2448
|
+
{
|
|
2449
|
+
entity: e.personalityQuiz,
|
|
2450
|
+
headline: i("personalityQuiz.headline"),
|
|
2451
|
+
sdk: e.sdk,
|
|
2452
|
+
defaultImagePlaceholder: e.defaultImagePlaceholderUrl,
|
|
2453
|
+
onLeadSubmitted: () => {
|
|
2454
|
+
},
|
|
2455
|
+
PresentedBy: V,
|
|
2456
|
+
rulesDisplay: e.rulesDisplay,
|
|
2457
|
+
content: /* @__PURE__ */ t(
|
|
2458
|
+
Pt,
|
|
2459
|
+
{
|
|
2460
|
+
signInCTA: e.signInCTA,
|
|
2461
|
+
labels: (s = (l = e.signInCTA) == null ? void 0 : l.gate) == null ? void 0 : s.labels,
|
|
2462
|
+
primaryColor: c,
|
|
2463
|
+
textColor: (o == null ? void 0 : o.contentColor) || r.colorSchemes.dark.textColor,
|
|
2464
|
+
align: "center"
|
|
2465
|
+
}
|
|
2466
|
+
)
|
|
2467
|
+
}
|
|
2468
|
+
);
|
|
2469
|
+
}, fa = (e) => {
|
|
2470
|
+
const { t: i } = H();
|
|
2471
|
+
return /* @__PURE__ */ t(
|
|
2472
|
+
Qt,
|
|
2473
|
+
{
|
|
2474
|
+
entity: e.personalityQuiz,
|
|
2475
|
+
headline: i("personalityQuiz.headline"),
|
|
2476
|
+
sdk: e.sdk,
|
|
2477
|
+
leads: e.leads,
|
|
2478
|
+
defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
|
|
2479
|
+
imagePosition: e.imagePosition,
|
|
2480
|
+
onLeadSubmitted: e.onLeadSubmitted,
|
|
2481
|
+
isSubmitting: e.isSubmitting,
|
|
2482
|
+
MainCard: K,
|
|
2483
|
+
PresentedBy: V,
|
|
2484
|
+
CollectLeadWrapper: Be,
|
|
2485
|
+
consents: e.consents
|
|
2486
|
+
}
|
|
2487
|
+
);
|
|
2488
|
+
}, ya = (e) => {
|
|
2489
|
+
var a, l, s;
|
|
2490
|
+
const { t: i } = H(), r = ((a = e.personalityQuiz.branding) == null ? void 0 : a.colors) || null, o = re(), c = (r == null ? void 0 : r.primaryColor) || o.palette.primary.plainColor;
|
|
2491
|
+
return /* @__PURE__ */ t(
|
|
2492
|
+
Qt,
|
|
2493
|
+
{
|
|
2494
|
+
entity: e.personalityQuiz,
|
|
2495
|
+
headline: i("personalityQuiz.headline"),
|
|
2496
|
+
sdk: e.sdk,
|
|
2497
|
+
defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
|
|
2498
|
+
imagePosition: e.imagePosition,
|
|
2499
|
+
onLeadSubmitted: e.onSubmit,
|
|
2500
|
+
isSubmitting: e.isSubmitting,
|
|
2501
|
+
MainCard: K,
|
|
2502
|
+
PresentedBy: V,
|
|
2503
|
+
rulesDisplay: e.rulesDisplay,
|
|
2504
|
+
content: /* @__PURE__ */ t(
|
|
2505
|
+
Te,
|
|
2506
|
+
{
|
|
2507
|
+
consents: e.consents,
|
|
2508
|
+
primaryColor: c,
|
|
2509
|
+
brandingUrls: (l = e.personalityQuiz.branding) == null ? void 0 : l.urls,
|
|
2510
|
+
align: "center"
|
|
2511
|
+
}
|
|
2512
|
+
),
|
|
2513
|
+
footerAction: /* @__PURE__ */ t(
|
|
2514
|
+
tt,
|
|
2515
|
+
{
|
|
2516
|
+
onClick: e.onSubmit,
|
|
2517
|
+
label: ((s = e.consents.labels) == null ? void 0 : s.ctaLabel) || i("personalityQuiz.buttons.finish"),
|
|
2518
|
+
isSubmitting: e.isSubmitting,
|
|
2519
|
+
primaryColor: c,
|
|
2520
|
+
showArrow: !0
|
|
2521
|
+
}
|
|
2522
|
+
)
|
|
2523
|
+
}
|
|
2524
|
+
);
|
|
2525
|
+
}, ha = (e) => {
|
|
2526
|
+
var a, l;
|
|
2527
|
+
const { t: i } = H(), r = ((a = e.personalityQuiz.branding) == null ? void 0 : a.colors) || null, o = re(), c = (r == null ? void 0 : r.primaryColor) || o.palette.primary.plainColor;
|
|
2528
|
+
return /* @__PURE__ */ t(
|
|
2529
|
+
qt,
|
|
2530
|
+
{
|
|
2531
|
+
entity: e.personalityQuiz,
|
|
2532
|
+
headline: i("personalityQuiz.headline"),
|
|
2533
|
+
sdk: e.sdk,
|
|
2534
|
+
defaultImagePlaceholder: e.defaultImagePlaceholderUrl,
|
|
2535
|
+
onLeadSubmitted: e.onSubmit,
|
|
2536
|
+
isSubmitting: e.isSubmitting,
|
|
2537
|
+
MainCard: K,
|
|
2538
|
+
PresentedBy: V,
|
|
2539
|
+
rulesDisplay: e.rulesDisplay,
|
|
2540
|
+
content: (
|
|
2541
|
+
// This template keeps its CTA inside the content frame
|
|
2542
|
+
/* @__PURE__ */ t(
|
|
2543
|
+
Te,
|
|
2544
|
+
{
|
|
2545
|
+
consents: e.consents,
|
|
2546
|
+
primaryColor: c,
|
|
2547
|
+
brandingUrls: (l = e.personalityQuiz.branding) == null ? void 0 : l.urls,
|
|
2548
|
+
onSubmit: e.onSubmit,
|
|
2549
|
+
isSubmitting: e.isSubmitting,
|
|
2550
|
+
ctaLabel: i("personalityQuiz.buttons.finish"),
|
|
2551
|
+
align: "center",
|
|
2552
|
+
showArrow: !0
|
|
2553
|
+
}
|
|
2554
|
+
)
|
|
2555
|
+
)
|
|
2556
|
+
}
|
|
2557
|
+
);
|
|
2558
|
+
}, ba = (e) => {
|
|
2559
|
+
var a, l, s;
|
|
2560
|
+
const { t: i } = H(), r = ne(), o = ((a = e.personalityQuiz.branding) == null ? void 0 : a.colors) || null, c = (o == null ? void 0 : o.primaryColor) || r.colorSchemes.dark.palette.primary.plainColor;
|
|
2561
|
+
return /* @__PURE__ */ t(
|
|
2562
|
+
Lt,
|
|
2563
|
+
{
|
|
2564
|
+
entity: e.personalityQuiz,
|
|
2565
|
+
headline: i("personalityQuiz.headline"),
|
|
2566
|
+
sdk: e.sdk,
|
|
2567
|
+
defaultImagePlaceholder: e.defaultImagePlaceholderUrl,
|
|
2568
|
+
onLeadSubmitted: e.onSubmit,
|
|
2569
|
+
isSubmitting: e.isSubmitting,
|
|
2570
|
+
PresentedBy: V,
|
|
2571
|
+
rulesDisplay: e.rulesDisplay,
|
|
2572
|
+
content: /* @__PURE__ */ t(
|
|
2573
|
+
Te,
|
|
2574
|
+
{
|
|
2575
|
+
consents: e.consents,
|
|
2576
|
+
primaryColor: c,
|
|
2577
|
+
textColor: (o == null ? void 0 : o.contentColor) || r.colorSchemes.dark.textColor,
|
|
2578
|
+
brandingUrls: (l = e.personalityQuiz.branding) == null ? void 0 : l.urls
|
|
2579
|
+
}
|
|
2580
|
+
),
|
|
2581
|
+
footerAction: /* @__PURE__ */ t(
|
|
2582
|
+
tt,
|
|
2583
|
+
{
|
|
2584
|
+
onClick: e.onSubmit,
|
|
2585
|
+
label: ((s = e.consents.labels) == null ? void 0 : s.ctaLabel) || i("personalityQuiz.buttons.finish"),
|
|
2586
|
+
isSubmitting: e.isSubmitting,
|
|
2587
|
+
primaryColor: c,
|
|
2588
|
+
showArrow: !0
|
|
2589
|
+
}
|
|
2590
|
+
)
|
|
2591
|
+
}
|
|
2592
|
+
);
|
|
2593
|
+
}, pa = (e) => {
|
|
2594
|
+
const { t: i } = H();
|
|
2595
|
+
return /* @__PURE__ */ t(
|
|
2596
|
+
qt,
|
|
2597
|
+
{
|
|
2598
|
+
entity: e.personalityQuiz,
|
|
2599
|
+
headline: i("personalityQuiz.headline"),
|
|
2600
|
+
sdk: e.sdk,
|
|
2601
|
+
leads: e.leads,
|
|
2602
|
+
defaultImagePlaceholder: e.defaultImagePlaceholderUrl,
|
|
2603
|
+
onLeadSubmitted: e.onLeadSubmitted,
|
|
2604
|
+
isSubmitting: e.isSubmitting,
|
|
2605
|
+
MainCard: K,
|
|
2606
|
+
PresentedBy: V,
|
|
2607
|
+
CollectLeadWrapper: Be,
|
|
2608
|
+
consents: e.consents
|
|
2609
|
+
}
|
|
2610
|
+
);
|
|
2611
|
+
}, xa = (e) => {
|
|
2612
|
+
const { t: i } = H();
|
|
2613
|
+
return /* @__PURE__ */ t(
|
|
2614
|
+
Lt,
|
|
2615
|
+
{
|
|
2616
|
+
entity: e.personalityQuiz,
|
|
2617
|
+
headline: i("personalityQuiz.headline"),
|
|
2618
|
+
sdk: e.sdk,
|
|
2619
|
+
leads: e.leads,
|
|
2620
|
+
defaultImagePlaceholder: e.defaultImagePlaceholderUrl,
|
|
2621
|
+
onLeadSubmitted: e.onLeadSubmitted,
|
|
2622
|
+
isSubmitting: e.isSubmitting,
|
|
2623
|
+
PresentedBy: V,
|
|
2624
|
+
CollectLeadWrapper: Be,
|
|
2625
|
+
consents: e.consents
|
|
2626
|
+
}
|
|
2627
|
+
);
|
|
2628
|
+
};
|
|
2629
|
+
function ve(e) {
|
|
2630
|
+
return e.template === G.STANDARD;
|
|
2631
|
+
}
|
|
2632
|
+
const va = (e) => {
|
|
2633
|
+
var Ft, Ht, Ot, Wt;
|
|
2634
|
+
const [i, r] = U(1), [o, c] = U(null), [a, l] = U([]), [s, x] = U([]), [y, m] = U(!1), [u, b] = U(!1), [f, v] = U(!1), [D, S] = U(!1), [Q, w] = U(!1), [P, C] = U(!1), [B, O] = U(!1), [k, I] = U(!1), [R, z] = U(!1), [A, L] = U(!1), N = Ce(!1), d = Ai(e.entityId, e.sdk), q = oi({
|
|
2635
|
+
signInCTA: e.signInCTA,
|
|
2636
|
+
authRequired: (d == null ? void 0 : d.authRequirement) === "REGISTERED",
|
|
2637
|
+
userIsLoggedIn: e.userIsLoggedIn,
|
|
2638
|
+
totalSteps: ((Ft = d == null ? void 0 : d.questions) == null ? void 0 : Ft.length) ?? 0
|
|
2639
|
+
}), M = q.isDeferred && q.isPending, {
|
|
2640
|
+
myParticipation: $,
|
|
2641
|
+
isUnauthorized: ee,
|
|
2642
|
+
isApiError: X,
|
|
2643
|
+
apiMessage: te,
|
|
2644
|
+
setIsUnauthorized: le,
|
|
2645
|
+
setIsApiError: se,
|
|
2646
|
+
setApiMessage: ge
|
|
2647
|
+
} = Qi(
|
|
2648
|
+
e.entityId,
|
|
2649
|
+
e.sdk,
|
|
2650
|
+
u,
|
|
2651
|
+
M,
|
|
2652
|
+
q.isSignedIn
|
|
2653
|
+
), {
|
|
2654
|
+
loading: ae,
|
|
2655
|
+
pending: _,
|
|
2656
|
+
checked: be,
|
|
2657
|
+
setChecked: Pe,
|
|
2658
|
+
allRequiredChecked: Ue,
|
|
2659
|
+
submit: we
|
|
2660
|
+
} = li({
|
|
2661
|
+
sdk: e.sdk,
|
|
2662
|
+
consents: (Ht = e.consents) == null ? void 0 : Ht.items,
|
|
2663
|
+
entityId: e.entityId,
|
|
2664
|
+
entityType: "personality_quiz"
|
|
2665
|
+
}), ye = !!((d == null ? void 0 : d.authRequirement) === "LEAD" ? (Ot = e.leads) == null ? void 0 : Ot.position : void 0) && _.length > 0, ke = ye ? [] : _.filter((h) => h.position !== "after"), Ae = ye ? [] : _.filter((h) => h.position === "after"), Kn = (h) => {
|
|
2666
|
+
Pe(h), L(!1);
|
|
2667
|
+
}, Mt = (h) => {
|
|
2668
|
+
var T;
|
|
2669
|
+
return {
|
|
2670
|
+
items: h,
|
|
2671
|
+
checked: be,
|
|
2672
|
+
onChange: Kn,
|
|
2673
|
+
labels: (T = e.consents) == null ? void 0 : T.labels,
|
|
2674
|
+
showError: A
|
|
2675
|
+
};
|
|
2676
|
+
}, Xn = dt(() => {
|
|
2677
|
+
var T;
|
|
2678
|
+
if (!d) return "";
|
|
2679
|
+
const h = (d.questions || []).map((Z) => Z.questionId).join(",");
|
|
2680
|
+
return `${((T = d.questions) == null ? void 0 : T.length) ?? 0}:${h}`;
|
|
2681
|
+
}, [d]), {
|
|
2682
|
+
read: $t,
|
|
2683
|
+
save: Et,
|
|
2684
|
+
clear: Me
|
|
2685
|
+
} = si({
|
|
2686
|
+
namespace: "personality-quiz",
|
|
2687
|
+
entityId: e.entityId,
|
|
2688
|
+
fingerprint: Xn
|
|
2689
|
+
}), qe = Ce([]), it = Ce(!1);
|
|
2690
|
+
me(() => {
|
|
2691
|
+
var T;
|
|
2692
|
+
if (ae || N.current) return;
|
|
2693
|
+
const h = (d == null ? void 0 : d.authRequirement) === "LEAD" && ((T = e.leads) == null ? void 0 : T.position) === "before";
|
|
2694
|
+
O(!h && ke.length > 0);
|
|
2695
|
+
}, [
|
|
2696
|
+
ae,
|
|
2697
|
+
ke.length,
|
|
2698
|
+
d == null ? void 0 : d.authRequirement
|
|
2699
|
+
]);
|
|
2700
|
+
const $e = (Wt = s[0]) != null && Wt.personalityQuizId ? s[0] : $ == null ? void 0 : $[0], pe = dt(() => !d || !($e != null && $e.personalityQuizId) || !d.maxAttempts ? !1 : d.maxAttempts <= $e.attempts, [d, $e]), We = dt(() => d ? ci(d.related) : null, [d]);
|
|
2701
|
+
me(() => {
|
|
2702
|
+
di(e.language || "en");
|
|
2703
|
+
}, [e.language]), me(() => {
|
|
2704
|
+
var h, T, Z;
|
|
2705
|
+
(h = s[0]) != null && h.personalityQuizId && ((Z = (T = e.callbacks) == null ? void 0 : T.onFinish) == null || Z.call(T, s[0]));
|
|
2706
|
+
}, [s]), me(() => {
|
|
2707
|
+
if (it.current || !(d != null && d.id) || !$ || ae || !q.isDeferred || !q.isSignedIn) return;
|
|
2708
|
+
if (a.length) {
|
|
2709
|
+
it.current = !0;
|
|
2710
|
+
return;
|
|
2711
|
+
}
|
|
2712
|
+
it.current = !0;
|
|
2713
|
+
const h = $t();
|
|
2714
|
+
if (!h) return;
|
|
2715
|
+
if (pe) {
|
|
2716
|
+
Me();
|
|
2717
|
+
return;
|
|
2718
|
+
}
|
|
2719
|
+
const T = h.answers || [];
|
|
2720
|
+
l(T), r(
|
|
2721
|
+
Math.min(T.length + 1, d.questions.length)
|
|
2722
|
+
), h.checkedConsents && Pe(h.checkedConsents), qe.current = h.heldConsentIds || [], N.current = !0, O(!1);
|
|
2723
|
+
}, [
|
|
2724
|
+
d,
|
|
2725
|
+
$,
|
|
2726
|
+
ae,
|
|
2727
|
+
q.isDeferred,
|
|
2728
|
+
q.isSignedIn,
|
|
2729
|
+
pe,
|
|
2730
|
+
a.length,
|
|
2731
|
+
$t,
|
|
2732
|
+
Me,
|
|
2733
|
+
Pe
|
|
2734
|
+
]), me(() => {
|
|
2735
|
+
!M || !(d != null && d.id) || a.length && Et({
|
|
2736
|
+
answers: a,
|
|
2737
|
+
checkedConsents: be,
|
|
2738
|
+
heldConsentIds: qe.current
|
|
2739
|
+
});
|
|
2740
|
+
}, [M, d, a, be, Et]), me(() => {
|
|
2741
|
+
pe && Me();
|
|
2742
|
+
}, [pe, Me]);
|
|
2743
|
+
const Ve = Ce(null);
|
|
2744
|
+
if (me(() => {
|
|
2745
|
+
var h;
|
|
2746
|
+
q.isPending || !P || (C(!1), (h = Ve.current) == null || h.call(Ve));
|
|
2747
|
+
}, [q.isPending, P]), me(() => {
|
|
2748
|
+
if (q.isPending || !qe.current.length) return;
|
|
2749
|
+
const h = _.filter(
|
|
2750
|
+
(T) => qe.current.includes(T.consentId)
|
|
2751
|
+
);
|
|
2752
|
+
qe.current = [], h.length && we(h);
|
|
2753
|
+
}, [q.isPending, _, we]), !d || !$)
|
|
2754
|
+
return /* @__PURE__ */ t(Gt, { marginBlock: "160px" });
|
|
2755
|
+
if (!d.id)
|
|
2756
|
+
return /* @__PURE__ */ t(na, {});
|
|
2757
|
+
if (d.status !== "ACTIVE")
|
|
2758
|
+
return /* @__PURE__ */ t(
|
|
2759
|
+
ia,
|
|
2760
|
+
{
|
|
2761
|
+
personalityQuiz: d,
|
|
2762
|
+
template: e.template,
|
|
2763
|
+
imagePosition: ve(e) ? e.imagePosition : void 0,
|
|
2764
|
+
defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
|
|
2765
|
+
rulesDisplay: e.rulesDisplay
|
|
2766
|
+
}
|
|
2767
|
+
);
|
|
2768
|
+
if (q.isPending && q.position === "before")
|
|
2769
|
+
return ve(e) ? /* @__PURE__ */ t(
|
|
2770
|
+
la,
|
|
2771
|
+
{
|
|
2772
|
+
personalityQuiz: d,
|
|
2773
|
+
imagePosition: e.imagePosition,
|
|
2774
|
+
defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
|
|
2775
|
+
signInCTA: e.signInCTA
|
|
2776
|
+
}
|
|
2777
|
+
) : e.template === G.OVERLAY ? /* @__PURE__ */ t(
|
|
2778
|
+
da,
|
|
2779
|
+
{
|
|
2780
|
+
personalityQuiz: d,
|
|
2781
|
+
defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
|
|
2782
|
+
signInCTA: e.signInCTA
|
|
2783
|
+
}
|
|
2784
|
+
) : /* @__PURE__ */ t(
|
|
2785
|
+
sa,
|
|
2786
|
+
{
|
|
2787
|
+
personalityQuiz: d,
|
|
2788
|
+
defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
|
|
2789
|
+
signInCTA: e.signInCTA
|
|
2790
|
+
}
|
|
2791
|
+
);
|
|
2792
|
+
const at = () => {
|
|
2793
|
+
se(!1), le(!1), x([]), r(1), c(null), l([]), m(!1), v(!1), S(!1), w(!1), b(!u);
|
|
2794
|
+
};
|
|
2795
|
+
if (ee || X)
|
|
2796
|
+
return ve(e) ? /* @__PURE__ */ t(
|
|
2797
|
+
aa,
|
|
2798
|
+
{
|
|
2799
|
+
personalityQuiz: d,
|
|
2800
|
+
imagePosition: e.imagePosition,
|
|
2801
|
+
defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
|
|
2802
|
+
apiErrorMessage: te,
|
|
2803
|
+
isApiError: X,
|
|
2804
|
+
rulesDisplay: e.rulesDisplay,
|
|
2805
|
+
toggleTryAgain: at
|
|
2806
|
+
}
|
|
2807
|
+
) : e.template === G.OVERLAY ? /* @__PURE__ */ t(
|
|
2808
|
+
oa,
|
|
2809
|
+
{
|
|
2810
|
+
personalityQuiz: d,
|
|
2811
|
+
defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
|
|
2812
|
+
apiErrorMessage: te,
|
|
2813
|
+
isApiError: X,
|
|
2814
|
+
rulesDisplay: e.rulesDisplay,
|
|
2815
|
+
toggleTryAgain: at
|
|
2816
|
+
}
|
|
2817
|
+
) : /* @__PURE__ */ t(
|
|
2818
|
+
ra,
|
|
2819
|
+
{
|
|
2820
|
+
personalityQuiz: d,
|
|
2821
|
+
defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
|
|
2822
|
+
apiErrorMessage: te,
|
|
2823
|
+
isApiError: X,
|
|
2824
|
+
rulesDisplay: e.rulesDisplay,
|
|
2825
|
+
toggleTryAgain: at
|
|
2826
|
+
}
|
|
2827
|
+
);
|
|
2828
|
+
const rt = async () => {
|
|
2829
|
+
var Z;
|
|
2830
|
+
const h = d.questions[i - 1], T = [
|
|
2831
|
+
...a,
|
|
2832
|
+
{
|
|
2833
|
+
questionId: h.questionId,
|
|
2834
|
+
optionId: o
|
|
2835
|
+
}
|
|
2836
|
+
];
|
|
2837
|
+
if (l(T), i < d.questions.length) {
|
|
2838
|
+
r((Qe) => Qe + 1), c(null);
|
|
2839
|
+
return;
|
|
2840
|
+
}
|
|
2841
|
+
if (i === d.questions.length) {
|
|
2842
|
+
if (M) {
|
|
2843
|
+
C(!0);
|
|
2844
|
+
return;
|
|
2845
|
+
}
|
|
2846
|
+
if (Ae.length > 0 && !R) {
|
|
2847
|
+
I(!0);
|
|
2848
|
+
return;
|
|
2849
|
+
}
|
|
2850
|
+
if (((Z = e.leads) == null ? void 0 : Z.position) === "after" && d.authRequirement === "LEAD" && !D) {
|
|
2851
|
+
w(!0);
|
|
2852
|
+
return;
|
|
2853
|
+
}
|
|
2854
|
+
await je(T);
|
|
2855
|
+
}
|
|
2856
|
+
}, je = async (h) => {
|
|
2857
|
+
try {
|
|
2858
|
+
m(!0);
|
|
2859
|
+
const T = await e.sdk.miniGames.participateInPersonalityQuiz(
|
|
2860
|
+
e.entityId,
|
|
2861
|
+
h
|
|
2862
|
+
);
|
|
2863
|
+
m(!1), x([T]), c(null), Me();
|
|
2864
|
+
} catch (T) {
|
|
2865
|
+
m(!1), x([new $n()]), console.error("[personality-quiz-play] participation failed", T);
|
|
2866
|
+
const { code: Z, message: Qe } = ui(T, e.sdk);
|
|
2867
|
+
Z === 401 || Z === 403 ? le(!0) : (se(!0), ge(Qe || ""));
|
|
2868
|
+
}
|
|
2869
|
+
}, Jn = async () => {
|
|
2870
|
+
var h;
|
|
2871
|
+
if (Ae.length > 0 && !R) {
|
|
2872
|
+
I(!0);
|
|
2873
|
+
return;
|
|
2874
|
+
}
|
|
2875
|
+
if (((h = e.leads) == null ? void 0 : h.position) === "after" && d.authRequirement === "LEAD" && !D) {
|
|
2876
|
+
w(!0);
|
|
2877
|
+
return;
|
|
2878
|
+
}
|
|
2879
|
+
await je(a);
|
|
2880
|
+
};
|
|
2881
|
+
Ve.current = Jn;
|
|
2882
|
+
const ot = async () => {
|
|
2883
|
+
if (ke.length > 0) {
|
|
2884
|
+
if (f) return;
|
|
2885
|
+
if (!Ue(ke)) {
|
|
2886
|
+
L(!0);
|
|
2887
|
+
return;
|
|
2888
|
+
}
|
|
2889
|
+
M ? qe.current = ke.map(
|
|
2890
|
+
(h) => h.consentId
|
|
2891
|
+
) : (v(!0), await we(ke), v(!1));
|
|
2892
|
+
}
|
|
2893
|
+
N.current = !0, O(!1);
|
|
2894
|
+
}, ei = async () => {
|
|
2895
|
+
if (!Ue(Ae)) {
|
|
2896
|
+
L(!0);
|
|
2897
|
+
return;
|
|
2898
|
+
}
|
|
2899
|
+
v(!0), await we(Ae), z(!0), await je(a), v(!1), I(!1);
|
|
2900
|
+
}, lt = async () => {
|
|
2901
|
+
v(!0), await je(a), v(!1), S(!0);
|
|
2902
|
+
}, st = (h) => {
|
|
2903
|
+
c(h);
|
|
2904
|
+
}, ct = () => {
|
|
2905
|
+
r(1), c(null), l([]), x([]), v(!1), S(!1), w(!1), I(!1), L(!1);
|
|
2906
|
+
}, ti = () => {
|
|
2907
|
+
const h = Mt(ke), T = ye ? _ : void 0, Z = Ae.length > 0 && !R;
|
|
2908
|
+
return e.template === G.OVERLAY ? /* @__PURE__ */ t(
|
|
2909
|
+
Ti,
|
|
2910
|
+
{
|
|
2911
|
+
sdk: e.sdk,
|
|
2912
|
+
leads: e.leads,
|
|
2913
|
+
personalityQuiz: d,
|
|
2914
|
+
question: d.questions[i - 1],
|
|
2915
|
+
selectedOption: o,
|
|
2916
|
+
currentQuestion: i,
|
|
2917
|
+
answerQuestion: st,
|
|
2918
|
+
handleNext: rt,
|
|
2919
|
+
defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
|
|
2920
|
+
rulesDisplay: e.rulesDisplay,
|
|
2921
|
+
isLoading: y,
|
|
2922
|
+
consents: h,
|
|
2923
|
+
leadConsents: T,
|
|
2924
|
+
applyConsentGate: B,
|
|
2925
|
+
hasAfterConsents: Z,
|
|
2926
|
+
isSubmitting: f,
|
|
2927
|
+
startPlaying: ot
|
|
2928
|
+
}
|
|
2929
|
+
) : ve(e) ? /* @__PURE__ */ t(
|
|
2930
|
+
$i,
|
|
2931
|
+
{
|
|
2932
|
+
sdk: e.sdk,
|
|
2933
|
+
leads: e.leads,
|
|
2934
|
+
personalityQuiz: d,
|
|
2935
|
+
question: d.questions[i - 1],
|
|
2936
|
+
selectedOption: o,
|
|
2937
|
+
currentQuestion: i,
|
|
2938
|
+
answerQuestion: st,
|
|
2939
|
+
handleNext: rt,
|
|
2940
|
+
imagePosition: e.imagePosition,
|
|
2941
|
+
userParticipation: a,
|
|
2942
|
+
defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
|
|
2943
|
+
rulesDisplay: e.rulesDisplay,
|
|
2944
|
+
isLoading: y,
|
|
2945
|
+
consents: h,
|
|
2946
|
+
leadConsents: T,
|
|
2947
|
+
applyConsentGate: B,
|
|
2948
|
+
hasAfterConsents: Z,
|
|
2949
|
+
isSubmitting: f,
|
|
2950
|
+
startPlaying: ot
|
|
2951
|
+
}
|
|
2952
|
+
) : /* @__PURE__ */ t(
|
|
2953
|
+
Fi,
|
|
2954
|
+
{
|
|
2955
|
+
sdk: e.sdk,
|
|
2956
|
+
leads: e.leads,
|
|
2957
|
+
personalityQuiz: d,
|
|
2958
|
+
question: d.questions[i - 1],
|
|
2959
|
+
selectedOption: o,
|
|
2960
|
+
currentQuestion: i,
|
|
2961
|
+
answerQuestion: st,
|
|
2962
|
+
handleNext: rt,
|
|
2963
|
+
defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
|
|
2964
|
+
rulesDisplay: e.rulesDisplay,
|
|
2965
|
+
isLoading: y,
|
|
2966
|
+
consents: h,
|
|
2967
|
+
leadConsents: T,
|
|
2968
|
+
applyConsentGate: B,
|
|
2969
|
+
hasAfterConsents: Z,
|
|
2970
|
+
isSubmitting: f,
|
|
2971
|
+
startPlaying: ot
|
|
2972
|
+
}
|
|
2973
|
+
);
|
|
2974
|
+
};
|
|
2975
|
+
if (M && (P || q.position === "step" && i > q.afterStep)) {
|
|
2976
|
+
const h = {
|
|
2977
|
+
personalityQuiz: d,
|
|
2978
|
+
sdk: e.sdk,
|
|
2979
|
+
signInCTA: e.signInCTA,
|
|
2980
|
+
defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
|
|
2981
|
+
rulesDisplay: e.rulesDisplay
|
|
2982
|
+
};
|
|
2983
|
+
return ve(e) ? /* @__PURE__ */ t(
|
|
2984
|
+
ua,
|
|
2985
|
+
{
|
|
2986
|
+
...h,
|
|
2987
|
+
imagePosition: e.imagePosition
|
|
2988
|
+
}
|
|
2989
|
+
) : e.template === G.OVERLAY ? /* @__PURE__ */ t(ma, { ...h }) : /* @__PURE__ */ t(ga, { ...h });
|
|
2990
|
+
}
|
|
2991
|
+
if (k && Ae.length > 0) {
|
|
2992
|
+
const h = {
|
|
2993
|
+
personalityQuiz: d,
|
|
2994
|
+
sdk: e.sdk,
|
|
2995
|
+
consents: Mt(Ae),
|
|
2996
|
+
onSubmit: ei,
|
|
2997
|
+
isSubmitting: f,
|
|
2998
|
+
defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
|
|
2999
|
+
rulesDisplay: e.rulesDisplay
|
|
3000
|
+
};
|
|
3001
|
+
return ve(e) ? /* @__PURE__ */ t(
|
|
3002
|
+
ya,
|
|
3003
|
+
{
|
|
3004
|
+
...h,
|
|
3005
|
+
imagePosition: e.imagePosition
|
|
3006
|
+
}
|
|
3007
|
+
) : e.template === G.OVERLAY ? /* @__PURE__ */ t(ba, { ...h }) : /* @__PURE__ */ t(ha, { ...h });
|
|
3008
|
+
}
|
|
3009
|
+
if (Q && !D)
|
|
3010
|
+
return ve(e) ? /* @__PURE__ */ t(
|
|
3011
|
+
fa,
|
|
3012
|
+
{
|
|
3013
|
+
personalityQuiz: d,
|
|
3014
|
+
sdk: e.sdk,
|
|
3015
|
+
leads: e.leads,
|
|
3016
|
+
defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
|
|
3017
|
+
imagePosition: e.imagePosition,
|
|
3018
|
+
onLeadSubmitted: lt,
|
|
3019
|
+
isSubmitting: f,
|
|
3020
|
+
consents: ye ? _ : void 0
|
|
3021
|
+
}
|
|
3022
|
+
) : e.template === G.SPLIT ? /* @__PURE__ */ t(
|
|
3023
|
+
pa,
|
|
3024
|
+
{
|
|
3025
|
+
personalityQuiz: d,
|
|
3026
|
+
sdk: e.sdk,
|
|
3027
|
+
leads: e.leads,
|
|
3028
|
+
defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
|
|
3029
|
+
onLeadSubmitted: lt,
|
|
3030
|
+
isSubmitting: f,
|
|
3031
|
+
consents: ye ? _ : void 0
|
|
3032
|
+
}
|
|
3033
|
+
) : e.template === G.OVERLAY ? /* @__PURE__ */ t(
|
|
3034
|
+
xa,
|
|
3035
|
+
{
|
|
3036
|
+
personalityQuiz: d,
|
|
3037
|
+
sdk: e.sdk,
|
|
3038
|
+
leads: e.leads,
|
|
3039
|
+
defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
|
|
3040
|
+
onLeadSubmitted: lt,
|
|
3041
|
+
isSubmitting: f,
|
|
3042
|
+
consents: ye ? _ : void 0
|
|
3043
|
+
}
|
|
3044
|
+
) : /* @__PURE__ */ t(Gt, { marginBlock: "160px" });
|
|
3045
|
+
if (s.length || pe) {
|
|
3046
|
+
const h = s[0] ?? $[0], T = We ? /* @__PURE__ */ t(Vt, { entityId: We, sdk: e.sdk, children: (Qe) => /* @__PURE__ */ t(jt, { infoPage: Qe, variant: e.chanceGameVariant }) }) : void 0, Z = We ? /* @__PURE__ */ t(Vt, { entityId: We, sdk: e.sdk, children: (Qe) => /* @__PURE__ */ t(jt, { infoPage: Qe, variant: e.chanceGameVariant, forceMobile: !0 }) }) : void 0;
|
|
3047
|
+
return e.template === G.OVERLAY ? /* @__PURE__ */ t(
|
|
3048
|
+
ta,
|
|
3049
|
+
{
|
|
3050
|
+
summary: h,
|
|
3051
|
+
showAnswerExplanations: e.showAnswerExplanations || !1,
|
|
3052
|
+
personalityQuiz: d,
|
|
3053
|
+
maxAttemptsReached: pe,
|
|
3054
|
+
playAgain: ct,
|
|
3055
|
+
sdk: e.sdk,
|
|
3056
|
+
leads: e.leads,
|
|
3057
|
+
defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
|
|
3058
|
+
rulesDisplay: e.rulesDisplay,
|
|
3059
|
+
additionalCTA: e.additionalCTA,
|
|
3060
|
+
chanceGameContent: T
|
|
3061
|
+
}
|
|
3062
|
+
) : ve(e) ? /* @__PURE__ */ t(
|
|
3063
|
+
Gi,
|
|
3064
|
+
{
|
|
3065
|
+
imagePosition: e.imagePosition || "left",
|
|
3066
|
+
summary: h,
|
|
3067
|
+
showAnswerExplanations: e.showAnswerExplanations || !1,
|
|
3068
|
+
personalityQuiz: d,
|
|
3069
|
+
maxAttemptsReached: pe,
|
|
3070
|
+
sdk: e.sdk,
|
|
3071
|
+
leads: e.leads,
|
|
3072
|
+
playAgain: ct,
|
|
3073
|
+
defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
|
|
3074
|
+
rulesDisplay: e.rulesDisplay,
|
|
3075
|
+
additionalCTA: e.additionalCTA,
|
|
3076
|
+
chanceGameContent: Z
|
|
3077
|
+
}
|
|
3078
|
+
) : /* @__PURE__ */ t(
|
|
3079
|
+
Ki,
|
|
3080
|
+
{
|
|
3081
|
+
summary: h,
|
|
3082
|
+
showAnswerExplanations: e.showAnswerExplanations || !1,
|
|
3083
|
+
personalityQuiz: d,
|
|
3084
|
+
maxAttemptsReached: pe,
|
|
3085
|
+
playAgain: ct,
|
|
3086
|
+
sdk: e.sdk,
|
|
3087
|
+
leads: e.leads,
|
|
3088
|
+
defaultImagePlaceholderUrl: e.defaultImagePlaceholderUrl,
|
|
3089
|
+
rulesDisplay: e.rulesDisplay,
|
|
3090
|
+
additionalCTA: e.additionalCTA,
|
|
3091
|
+
chanceGameContent: Z
|
|
3092
|
+
}
|
|
3093
|
+
);
|
|
3094
|
+
}
|
|
3095
|
+
return ti();
|
|
3096
|
+
}, Ca = (e) => {
|
|
3097
|
+
var r;
|
|
3098
|
+
const i = Xe.useMemo(
|
|
3099
|
+
() => e.template === G.OVERLAY ? { ...e.themeOptions, mode: "dark" } : e.themeOptions,
|
|
3100
|
+
[e.template, e.themeOptions]
|
|
3101
|
+
);
|
|
3102
|
+
return /* @__PURE__ */ t(
|
|
3103
|
+
ki,
|
|
3104
|
+
{
|
|
3105
|
+
packageName: "personality-quiz-play",
|
|
3106
|
+
language: e.language,
|
|
3107
|
+
themeOptions: i,
|
|
3108
|
+
disableCache: e.disableCache,
|
|
3109
|
+
optionsLayout: e.optionsLayout,
|
|
3110
|
+
leadPhoneCountryCode: (r = e.leads) == null ? void 0 : r.phoneCountryCode,
|
|
3111
|
+
children: e.children
|
|
3112
|
+
}
|
|
3113
|
+
);
|
|
3114
|
+
}, Da = (e) => /* @__PURE__ */ t(Ca, { ...e, children: /* @__PURE__ */ t(va, { ...e }) });
|
|
3115
|
+
export {
|
|
3116
|
+
Da as M
|
|
3117
|
+
};
|