@streamlayer/react 0.30.1 → 0.30.3
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/lib/app/useStreamLayerApp.d.ts +5 -0
- package/lib/cjs/gamification-feature.js +1 -1
- package/lib/cjs/masters2.js +2 -2
- package/lib/dist/cjs/gamification-feature.js +1 -1
- package/lib/dist/cjs/masters.js +15 -15
- package/lib/dist/es/gamification-feature.js +203 -169
- package/lib/dist/es/masters.js +2781 -2778
- package/lib/dist/index.d.ts +7 -2
- package/lib/dist/style.css +1 -1
- package/lib/es/gamification-feature.js +327 -293
- package/lib/es/masters2.js +14 -14
- package/lib/style.css +1 -1
- package/package.json +8 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as I, jsx as r, Fragment as E } from "react/jsx-runtime";
|
|
2
|
-
import { s as a, i as j, o as
|
|
3
|
-
import U, { useRef as C, useState as R, useCallback as
|
|
2
|
+
import { s as a, i as j, o as Se, a as ze, b as xe, Q as x, c as _, d as b, E as L, r as se, e as Ye, f as We, n as Fe, w as Ve, u as w, A as Be, O as He, P as W, g as Ge, h as ee, j as Ze, k as Je } from "./masters.js";
|
|
3
|
+
import U, { useRef as C, useState as R, useCallback as q, useEffect as Ke, useLayoutEffect as Xe, useMemo as V, createElement as G, PureComponent as je } from "react";
|
|
4
4
|
const et = /* @__PURE__ */ a("div")({
|
|
5
5
|
name: "Container",
|
|
6
6
|
class: "c1vwopgc",
|
|
@@ -26,7 +26,7 @@ const et = /* @__PURE__ */ a("div")({
|
|
|
26
26
|
class: "cvsl7l3",
|
|
27
27
|
propsAsIs: !0
|
|
28
28
|
}), ke = ({ type: e, close: t, label: n }) => {
|
|
29
|
-
const s = e ?
|
|
29
|
+
const s = e ? Se[e] : { label: n, iconName: void 0 };
|
|
30
30
|
return /* @__PURE__ */ I(et, { children: [
|
|
31
31
|
/* @__PURE__ */ I(tt, { children: [
|
|
32
32
|
(s == null ? void 0 : s.iconName) && /* @__PURE__ */ r(st, { name: s.iconName }),
|
|
@@ -46,7 +46,7 @@ const et = /* @__PURE__ */ a("div")({
|
|
|
46
46
|
name: "Indicator",
|
|
47
47
|
class: "i1fbnvpb",
|
|
48
48
|
propsAsIs: !1
|
|
49
|
-
}),
|
|
49
|
+
}), le = ({ indicator: e, title: t }) => /* @__PURE__ */ I(lt, { children: [
|
|
50
50
|
/* @__PURE__ */ r(ct, { children: t }),
|
|
51
51
|
/* @__PURE__ */ r(dt, { children: e })
|
|
52
52
|
] }), ut = /* @__PURE__ */ a("div")({
|
|
@@ -61,7 +61,7 @@ const et = /* @__PURE__ */ a("div")({
|
|
|
61
61
|
name: "Title",
|
|
62
62
|
class: "t8s05oq",
|
|
63
63
|
propsAsIs: !1
|
|
64
|
-
}),
|
|
64
|
+
}), F = ({ indicator: e, title: t }) => /* @__PURE__ */ I(ut, { children: [
|
|
65
65
|
/* @__PURE__ */ r(pt, { children: e }),
|
|
66
66
|
/* @__PURE__ */ r(mt, { children: t })
|
|
67
67
|
] }), ht = /* @__PURE__ */ a("div")({
|
|
@@ -147,7 +147,7 @@ const et = /* @__PURE__ */ a("div")({
|
|
|
147
147
|
/* @__PURE__ */ r(It, { children: /* @__PURE__ */ I(gt, { children: [
|
|
148
148
|
/* @__PURE__ */ I(Ot, { children: [
|
|
149
149
|
e && /* @__PURE__ */ r(Mt, { alt: "avatar", src: e }),
|
|
150
|
-
!e && /* @__PURE__ */ r(kt, { children:
|
|
150
|
+
!e && /* @__PURE__ */ r(kt, { children: ze(t || "") })
|
|
151
151
|
] }),
|
|
152
152
|
/* @__PURE__ */ I(vt, { children: [
|
|
153
153
|
/* @__PURE__ */ r(yt, { children: t }),
|
|
@@ -155,7 +155,7 @@ const et = /* @__PURE__ */ a("div")({
|
|
|
155
155
|
/* @__PURE__ */ I(Tt, { children: [
|
|
156
156
|
/* @__PURE__ */ r(At, { alt: "rank-icon", src: wt }),
|
|
157
157
|
/* @__PURE__ */ I(Dt, { children: [
|
|
158
|
-
|
|
158
|
+
xe(n),
|
|
159
159
|
/* @__PURE__ */ r(St, { children: "PTS" })
|
|
160
160
|
] })
|
|
161
161
|
] }),
|
|
@@ -170,32 +170,32 @@ const et = /* @__PURE__ */ a("div")({
|
|
|
170
170
|
] }) }),
|
|
171
171
|
/* @__PURE__ */ I(ft, { children: [
|
|
172
172
|
/* @__PURE__ */ I(xt, { children: [
|
|
173
|
-
/* @__PURE__ */ r(
|
|
174
|
-
/* @__PURE__ */ r(
|
|
173
|
+
/* @__PURE__ */ r(le, { indicator: s || 0, title: "Friends rank" }),
|
|
174
|
+
/* @__PURE__ */ r(le, { indicator: i || 0, title: "Global rank" })
|
|
175
175
|
] }),
|
|
176
176
|
/* @__PURE__ */ I(jt, { children: [
|
|
177
|
-
/* @__PURE__ */ r(
|
|
178
|
-
/* @__PURE__ */ r(
|
|
179
|
-
/* @__PURE__ */ r(
|
|
180
|
-
/* @__PURE__ */ r(
|
|
177
|
+
/* @__PURE__ */ r(F, { indicator: c || 0, title: "Win streak" }),
|
|
178
|
+
/* @__PURE__ */ r(F, { indicator: l || 0, title: "Correct" }),
|
|
179
|
+
/* @__PURE__ */ r(F, { indicator: m || 0, title: "Incorrect" }),
|
|
180
|
+
/* @__PURE__ */ r(F, { indicator: `${f || 0}%`, title: "Succ. rate" })
|
|
181
181
|
] })
|
|
182
182
|
] })
|
|
183
183
|
] }), Ct = /* @__PURE__ */ a("div")({
|
|
184
184
|
name: "Container",
|
|
185
185
|
class: "c38csyt",
|
|
186
186
|
propsAsIs: !1
|
|
187
|
-
}),
|
|
187
|
+
}), $t = /* @__PURE__ */ a("div")({
|
|
188
188
|
name: "Title",
|
|
189
189
|
class: "ty221rx",
|
|
190
190
|
propsAsIs: !1
|
|
191
|
-
}),
|
|
191
|
+
}), bt = /* @__PURE__ */ a("div")({
|
|
192
192
|
name: "Description",
|
|
193
193
|
class: "dlaj9xp",
|
|
194
194
|
propsAsIs: !1
|
|
195
195
|
}), Et = ({ title: e, description: t }) => /* @__PURE__ */ I(Ct, { children: [
|
|
196
196
|
/* @__PURE__ */ r(j, { name: "icon-check-circle" }),
|
|
197
|
-
/* @__PURE__ */ r(
|
|
198
|
-
/* @__PURE__ */ r(
|
|
197
|
+
/* @__PURE__ */ r($t, { children: e }),
|
|
198
|
+
/* @__PURE__ */ r(bt, { children: t })
|
|
199
199
|
] }), Lt = /* @__PURE__ */ a("div")({
|
|
200
200
|
name: "Container",
|
|
201
201
|
class: "c16sbdnm",
|
|
@@ -204,11 +204,11 @@ const et = /* @__PURE__ */ a("div")({
|
|
|
204
204
|
name: "IconPrediction",
|
|
205
205
|
class: "ibhorgl",
|
|
206
206
|
propsAsIs: !0
|
|
207
|
-
}),
|
|
207
|
+
}), ce = /* @__PURE__ */ a("div")({
|
|
208
208
|
name: "FeedbackIconWrap",
|
|
209
209
|
class: "f1g20ja7",
|
|
210
210
|
propsAsIs: !1
|
|
211
|
-
}),
|
|
211
|
+
}), de = /* @__PURE__ */ a("div")({
|
|
212
212
|
name: "FeedbackHeader",
|
|
213
213
|
class: "f455ozj",
|
|
214
214
|
propsAsIs: !1
|
|
@@ -233,14 +233,14 @@ const et = /* @__PURE__ */ a("div")({
|
|
|
233
233
|
questionStatus: c
|
|
234
234
|
}) => {
|
|
235
235
|
const l = n && (s === x.TRIVIA || s === x.PREDICTION);
|
|
236
|
-
if (!l && c !==
|
|
236
|
+
if (!l && c !== _.RESOLVED)
|
|
237
237
|
return null;
|
|
238
238
|
const m = s === x.PREDICTION && !i, d = t ? "correct" : "incorrect", f = t ? e.correctFeedback : e.incorrectFeedback;
|
|
239
239
|
return /* @__PURE__ */ I(Lt, { "data-isPrediction": m, children: [
|
|
240
|
-
c ===
|
|
241
|
-
/* @__PURE__ */ r(
|
|
240
|
+
c === _.RESOLVED && s === x.TRIVIA && !n && /* @__PURE__ */ I(E, { children: [
|
|
241
|
+
/* @__PURE__ */ r(ce, { children: /* @__PURE__ */ r(j, { name: "questionExpired" }) }),
|
|
242
242
|
/* @__PURE__ */ I("div", { children: [
|
|
243
|
-
/* @__PURE__ */ r(
|
|
243
|
+
/* @__PURE__ */ r(de, { children: /* @__PURE__ */ r(Z, { children: "Question Expired" }) }),
|
|
244
244
|
/* @__PURE__ */ r(_t, { children: "You can still answer to see if you're correct, but no points are awarded for expired questions." })
|
|
245
245
|
] })
|
|
246
246
|
] }),
|
|
@@ -249,8 +249,8 @@ const et = /* @__PURE__ */ a("div")({
|
|
|
249
249
|
/* @__PURE__ */ r(Z, { children: "Stay tuned to see if your prediction was correct." })
|
|
250
250
|
] }),
|
|
251
251
|
l && i && /* @__PURE__ */ I(E, { children: [
|
|
252
|
-
/* @__PURE__ */ r(
|
|
253
|
-
/* @__PURE__ */ r("div", { children: /* @__PURE__ */ I(
|
|
252
|
+
/* @__PURE__ */ r(ce, { "data-feedbackType": d, children: /* @__PURE__ */ r(j, { name: d }) }),
|
|
253
|
+
/* @__PURE__ */ r("div", { children: /* @__PURE__ */ I(de, { children: [
|
|
254
254
|
/* @__PURE__ */ r(Ut, { "data-feedbackType": d, children: f == null ? void 0 : f.title }),
|
|
255
255
|
/* @__PURE__ */ r(Z, { children: f == null ? void 0 : f.description })
|
|
256
256
|
] }) })
|
|
@@ -320,12 +320,12 @@ const et = /* @__PURE__ */ a("div")({
|
|
|
320
320
|
name: "CheckIcon",
|
|
321
321
|
class: "cu9kmlb",
|
|
322
322
|
propsAsIs: !0
|
|
323
|
-
}),
|
|
324
|
-
[
|
|
325
|
-
[
|
|
326
|
-
[
|
|
327
|
-
[
|
|
328
|
-
[
|
|
323
|
+
}), ue = {
|
|
324
|
+
[b.CENTERED]: (e) => /* @__PURE__ */ r(Kt, { alt: "option-icon", src: e }),
|
|
325
|
+
[b.TRANSPARENT]: (e) => /* @__PURE__ */ r(Gt, { children: /* @__PURE__ */ r(Zt, { style: { backgroundImage: `url(${e})` } }) }),
|
|
326
|
+
[b.ROUNDED]: (e) => /* @__PURE__ */ r(en, { alt: "option-icon", src: e }),
|
|
327
|
+
[b.NONE]: () => null,
|
|
328
|
+
[b.UNSET]: () => null
|
|
329
329
|
}, an = ({ questionType: e, hasCorrectAnswer: t, correct: n, youVoted: s, questionVoted: i }) => {
|
|
330
330
|
if (e === x.POLL && s)
|
|
331
331
|
return "correct";
|
|
@@ -342,7 +342,7 @@ const et = /* @__PURE__ */ a("div")({
|
|
|
342
342
|
correct: n,
|
|
343
343
|
hasCorrectAnswer: s,
|
|
344
344
|
questionStatus: i
|
|
345
|
-
}) => e === x.TRIVIA ? t && n : e === x.PREDICTION ? t && n && s || i ===
|
|
345
|
+
}) => e === x.TRIVIA ? t && n : e === x.PREDICTION ? t && n && s || i === _.RESOLVED && n : !1, cn = (e) => {
|
|
346
346
|
var t;
|
|
347
347
|
const {
|
|
348
348
|
// option props
|
|
@@ -355,14 +355,14 @@ const et = /* @__PURE__ */ a("div")({
|
|
|
355
355
|
youSelected: m,
|
|
356
356
|
questionVoted: d,
|
|
357
357
|
// ToDo: Figure out why imageMode is not in the response, and delete default value
|
|
358
|
-
imageMode: f =
|
|
358
|
+
imageMode: f = b.ROUNDED,
|
|
359
359
|
answerTimeExpired: A,
|
|
360
360
|
questionStatus: v,
|
|
361
361
|
isLoading: g,
|
|
362
362
|
questionType: T,
|
|
363
363
|
correct: D,
|
|
364
364
|
hasCorrectAnswer: o
|
|
365
|
-
} = e, u = an(e), p = ln({ questionType: T, questionVoted: d, correct: D, hasCorrectAnswer: o, questionStatus: v }), h = d || v ===
|
|
365
|
+
} = e, u = an(e), p = ln({ questionType: T, questionVoted: d, correct: D, hasCorrectAnswer: o, questionStatus: v }), h = d || v === _.RESOLVED && T === x.PREDICTION;
|
|
366
366
|
return /* @__PURE__ */ I(
|
|
367
367
|
Vt,
|
|
368
368
|
{
|
|
@@ -374,7 +374,7 @@ const et = /* @__PURE__ */ a("div")({
|
|
|
374
374
|
children: [
|
|
375
375
|
h && /* @__PURE__ */ r(Bt, { "data-answerState": u, style: { width: `${c}%` } }),
|
|
376
376
|
/* @__PURE__ */ I(Ht, { children: [
|
|
377
|
-
s && ((t =
|
|
377
|
+
s && ((t = ue[f]) == null ? void 0 : t.call(ue, s)),
|
|
378
378
|
/* @__PURE__ */ r(tn, { children: i }),
|
|
379
379
|
h && /* @__PURE__ */ I(nn, { children: [
|
|
380
380
|
p && /* @__PURE__ */ r(on, { name: "selected" }),
|
|
@@ -388,7 +388,7 @@ const et = /* @__PURE__ */ a("div")({
|
|
|
388
388
|
}
|
|
389
389
|
);
|
|
390
390
|
};
|
|
391
|
-
var
|
|
391
|
+
var pe = typeof window > "u" ? Ke : Xe, dn = ({ isPlaying: e, duration: t, startAt: n = 0, updateInterval: s = 0, onComplete: i, onUpdate: c }) => {
|
|
392
392
|
let [l, m] = R(n), d = C(0), f = C(n), A = C(n * -1e3), v = C(null), g = C(null), T = C(null), D = (p) => {
|
|
393
393
|
let h = p / 1e3;
|
|
394
394
|
if (g.current === null) {
|
|
@@ -401,27 +401,27 @@ var ue = typeof window > "u" ? Ke : Xe, dn = ({ isPlaying: e, duration: t, start
|
|
|
401
401
|
m(z ? t : N), z || (v.current = requestAnimationFrame(D));
|
|
402
402
|
}, o = () => {
|
|
403
403
|
v.current && cancelAnimationFrame(v.current), T.current && clearTimeout(T.current), g.current = null;
|
|
404
|
-
}, u =
|
|
404
|
+
}, u = q((p) => {
|
|
405
405
|
o(), d.current = 0;
|
|
406
406
|
let h = typeof p == "number" ? p : n;
|
|
407
407
|
f.current = h, m(h), e && (v.current = requestAnimationFrame(D));
|
|
408
408
|
}, [e, n]);
|
|
409
|
-
return
|
|
409
|
+
return pe(() => {
|
|
410
410
|
if (c == null || c(l), t && l >= t) {
|
|
411
411
|
A.current += t * 1e3;
|
|
412
412
|
let { shouldRepeat: p = !1, delay: h = 0, newStartAt: M } = (i == null ? void 0 : i(A.current / 1e3)) || {};
|
|
413
413
|
p && (T.current = setTimeout(() => u(M), h * 1e3));
|
|
414
414
|
}
|
|
415
|
-
}, [l, t]),
|
|
415
|
+
}, [l, t]), pe(() => (e && (v.current = requestAnimationFrame(D)), o), [e, t, s]), { elapsedTime: l, reset: u };
|
|
416
416
|
}, un = (e, t, n) => {
|
|
417
417
|
let s = e / 2, i = t / 2, c = s - i, l = 2 * c, m = n === "clockwise" ? "1,0" : "0,1", d = 2 * Math.PI * c;
|
|
418
418
|
return { path: `m ${s},${i} a ${c},${c} 0 ${m} 0,${l} a ${c},${c} 0 ${m} 0,-${l}`, pathLength: d };
|
|
419
|
-
},
|
|
419
|
+
}, me = (e, t) => e === 0 || e === t ? 0 : typeof t == "number" ? e - t : 0, pn = (e) => ({ position: "relative", width: e, height: e }), mn = { display: "flex", justifyContent: "center", alignItems: "center", position: "absolute", left: 0, top: 0, width: "100%", height: "100%" }, Ce = (e, t, n, s, i) => {
|
|
420
420
|
if (s === 0)
|
|
421
421
|
return t;
|
|
422
422
|
let c = (i ? s - e : e) / s;
|
|
423
423
|
return t + n * c;
|
|
424
|
-
},
|
|
424
|
+
}, he = (e) => {
|
|
425
425
|
var t, n;
|
|
426
426
|
return (n = (t = e.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (s, i, c, l) => `#${i}${i}${c}${c}${l}${l}`).substring(1).match(/.{2}/g)) == null ? void 0 : t.map((s) => parseInt(s, 16))) != null ? n : [];
|
|
427
427
|
}, hn = (e, t) => {
|
|
@@ -434,43 +434,43 @@ var ue = typeof window > "u" ? Ke : Xe, dn = ({ isPlaying: e, duration: t, start
|
|
|
434
434
|
return s[0];
|
|
435
435
|
if (!c)
|
|
436
436
|
return s[l];
|
|
437
|
-
let m = i[l] - t, d = i[l] - i[l + 1], f =
|
|
437
|
+
let m = i[l] - t, d = i[l] - i[l + 1], f = he(s[l]), A = he(s[l + 1]), v = !!e.isGrowing;
|
|
438
438
|
return `rgb(${f.map((g, T) => Ce(m, g, A[T] - g, d, v) | 0).join(",")})`;
|
|
439
439
|
}, In = (e) => {
|
|
440
|
-
let { duration: t, initialRemainingTime: n, updateInterval: s, size: i = 180, strokeWidth: c = 12, trailStrokeWidth: l, isPlaying: m = !1, isGrowing: d = !1, rotation: f = "clockwise", onComplete: A, onUpdate: v } = e, g = C(), T = Math.max(c, l ?? 0), { path: D, pathLength: o } = un(i, T, f), { elapsedTime: u } = dn({ isPlaying: m, duration: t, startAt:
|
|
440
|
+
let { duration: t, initialRemainingTime: n, updateInterval: s, size: i = 180, strokeWidth: c = 12, trailStrokeWidth: l, isPlaying: m = !1, isGrowing: d = !1, rotation: f = "clockwise", onComplete: A, onUpdate: v } = e, g = C(), T = Math.max(c, l ?? 0), { path: D, pathLength: o } = un(i, T, f), { elapsedTime: u } = dn({ isPlaying: m, duration: t, startAt: me(t, n), updateInterval: s, onUpdate: typeof v == "function" ? (h) => {
|
|
441
441
|
let M = Math.ceil(t - h);
|
|
442
442
|
M !== g.current && (g.current = M, v(M));
|
|
443
443
|
} : void 0, onComplete: typeof A == "function" ? (h) => {
|
|
444
444
|
var M;
|
|
445
445
|
let { shouldRepeat: y, delay: N, newInitialRemainingTime: S } = (M = A(h)) != null ? M : {};
|
|
446
446
|
if (y)
|
|
447
|
-
return { shouldRepeat: y, delay: N, newStartAt:
|
|
447
|
+
return { shouldRepeat: y, delay: N, newStartAt: me(t, S) };
|
|
448
448
|
} : void 0 }), p = t - u;
|
|
449
449
|
return { elapsedTime: u, path: D, pathLength: o, remainingTime: Math.ceil(p), rotation: f, size: i, stroke: hn(e, p), strokeDashoffset: Ce(u, 0, o, t, d), strokeWidth: c };
|
|
450
|
-
},
|
|
450
|
+
}, $e = (e) => {
|
|
451
451
|
let { children: t, strokeLinecap: n, trailColor: s, trailStrokeWidth: i } = e, { path: c, pathLength: l, stroke: m, strokeDashoffset: d, remainingTime: f, elapsedTime: A, size: v, strokeWidth: g } = In(e);
|
|
452
452
|
return U.createElement("div", { style: pn(v) }, U.createElement("svg", { viewBox: `0 0 ${v} ${v}`, width: v, height: v, xmlns: "http://www.w3.org/2000/svg" }, U.createElement("path", { d: c, fill: "none", stroke: s ?? "#d9d9d9", strokeWidth: i ?? g }), U.createElement("path", { d: c, fill: "none", stroke: m, strokeLinecap: n ?? "round", strokeWidth: g, strokeDasharray: l, strokeDashoffset: d })), typeof t == "function" && U.createElement("div", { style: mn }, t({ remainingTime: f, elapsedTime: A, color: m })));
|
|
453
453
|
};
|
|
454
|
-
|
|
454
|
+
$e.displayName = "CountdownCircleTimer";
|
|
455
455
|
const fn = [L.PRIMARY_GREEN1, L.SECONDARY_RED1, L.SECONDARY_RED1], gn = [10, 10, 0], Mn = /* @__PURE__ */ a("div")({
|
|
456
456
|
name: "RemainingTime",
|
|
457
457
|
class: "r165427",
|
|
458
458
|
propsAsIs: !1
|
|
459
|
-
}), vn = L.SECONDARY_GREEN6,
|
|
459
|
+
}), vn = L.SECONDARY_GREEN6, Ie = L.SECONDARY_RED3, yn = L.NEUTRALS_GRAY3, Nn = ({
|
|
460
460
|
isPlaying: e = !0,
|
|
461
461
|
duration: t = 30,
|
|
462
462
|
onTimerExpired: n
|
|
463
463
|
}) => {
|
|
464
|
-
const [s, i] = R(t > 10 ? vn :
|
|
464
|
+
const [s, i] = R(t > 10 ? vn : Ie), c = ({
|
|
465
465
|
remainingTime: d
|
|
466
466
|
}) => /* @__PURE__ */ r(Mn, {
|
|
467
467
|
children: d
|
|
468
|
-
}), l =
|
|
468
|
+
}), l = q(() => {
|
|
469
469
|
n == null || n(), i(yn);
|
|
470
|
-
}, [n, i]), m =
|
|
471
|
-
d === 10 && i(
|
|
470
|
+
}, [n, i]), m = q((d) => {
|
|
471
|
+
d === 10 && i(Ie);
|
|
472
472
|
}, [i]);
|
|
473
|
-
return /* @__PURE__ */ r(
|
|
473
|
+
return /* @__PURE__ */ r($e, {
|
|
474
474
|
isPlaying: e,
|
|
475
475
|
duration: t,
|
|
476
476
|
colors: fn,
|
|
@@ -525,7 +525,7 @@ const fn = [L.PRIMARY_GREEN1, L.SECONDARY_RED1, L.SECONDARY_RED1], gn = [10, 10,
|
|
|
525
525
|
s && /* @__PURE__ */ r(Nn, { isPlaying: n, onTimerExpired: i })
|
|
526
526
|
] }), wn = ({ openedQuestion: e, vote: t, close: n }) => {
|
|
527
527
|
var s;
|
|
528
|
-
const i = e.subject, c = e.type, l = (s = e.options) == null ? void 0 : s.options, [m, d] = R(!1), [f, A] = R(!1), [v, g] = R(""), T = e == null ? void 0 : e.id, D =
|
|
528
|
+
const i = e.subject, c = e.type, l = (s = e.options) == null ? void 0 : s.options, [m, d] = R(!1), [f, A] = R(!1), [v, g] = R(""), T = e == null ? void 0 : e.id, D = q(
|
|
529
529
|
async (y) => {
|
|
530
530
|
if (T) {
|
|
531
531
|
const N = y.currentTarget.value;
|
|
@@ -533,15 +533,15 @@ const fn = [L.PRIMARY_GREEN1, L.SECONDARY_RED1, L.SECONDARY_RED1], gn = [10, 10,
|
|
|
533
533
|
}
|
|
534
534
|
},
|
|
535
535
|
[T, g, t]
|
|
536
|
-
), o =
|
|
536
|
+
), o = q(() => {
|
|
537
537
|
d(!0), setTimeout(n, 3e3);
|
|
538
|
-
}, [n]), u =
|
|
538
|
+
}, [n]), u = V(
|
|
539
539
|
() => e == null ? void 0 : e.answers.find((y) => y.youVoted === !0),
|
|
540
540
|
[e]
|
|
541
|
-
), p =
|
|
541
|
+
), p = V(
|
|
542
542
|
() => !!(e != null && e.answers.find((y) => y.correct === !0)),
|
|
543
543
|
[e]
|
|
544
|
-
), h =
|
|
544
|
+
), h = V(() => e ? e.answers.map((y) => ({
|
|
545
545
|
...y,
|
|
546
546
|
questionVoted: !!u,
|
|
547
547
|
youSelected: v === y.id,
|
|
@@ -553,7 +553,7 @@ const fn = [L.PRIMARY_GREEN1, L.SECONDARY_RED1, L.SECONDARY_RED1], gn = [10, 10,
|
|
|
553
553
|
// ToDo: Figure out why imageMode is not in the response
|
|
554
554
|
onVote: D
|
|
555
555
|
})) : [], [p, m, f, e, u, D, v]), M = l && (l.case === "trivia" || l.case === "prediction") ? l.value : void 0;
|
|
556
|
-
return /* @__PURE__ */ r(
|
|
556
|
+
return /* @__PURE__ */ r(se, { "data-question-header": "true", children: /* @__PURE__ */ r(Pt, { children: /* @__PURE__ */ I(Yt, { children: [
|
|
557
557
|
M && /* @__PURE__ */ r(
|
|
558
558
|
qt,
|
|
559
559
|
{
|
|
@@ -589,11 +589,11 @@ const fn = [L.PRIMARY_GREEN1, L.SECONDARY_RED1, L.SECONDARY_RED1], gn = [10, 10,
|
|
|
589
589
|
name: "Container",
|
|
590
590
|
class: "cgn5uen",
|
|
591
591
|
propsAsIs: !1
|
|
592
|
-
}),
|
|
592
|
+
}), $n = /* @__PURE__ */ a("div")({
|
|
593
593
|
name: "Content",
|
|
594
594
|
class: "c1px8nt6",
|
|
595
595
|
propsAsIs: !1
|
|
596
|
-
}),
|
|
596
|
+
}), bn = /* @__PURE__ */ a("h3")({
|
|
597
597
|
name: "Title",
|
|
598
598
|
class: "t5et2jt",
|
|
599
599
|
propsAsIs: !1
|
|
@@ -605,8 +605,8 @@ const fn = [L.PRIMARY_GREEN1, L.SECONDARY_RED1, L.SECONDARY_RED1], gn = [10, 10,
|
|
|
605
605
|
name: "DateWrap",
|
|
606
606
|
class: "dd3lh3p",
|
|
607
607
|
propsAsIs: !1
|
|
608
|
-
}),
|
|
609
|
-
const s =
|
|
608
|
+
}), be = ({ created: e, title: t, instantView: n }) => {
|
|
609
|
+
const s = V(() => {
|
|
610
610
|
if (e) {
|
|
611
611
|
const i = new Date(e);
|
|
612
612
|
if (Ye(i))
|
|
@@ -624,8 +624,8 @@ const fn = [L.PRIMARY_GREEN1, L.SECONDARY_RED1, L.SECONDARY_RED1], gn = [10, 10,
|
|
|
624
624
|
s.time
|
|
625
625
|
] }),
|
|
626
626
|
(n == null ? void 0 : n.video) && /* @__PURE__ */ r(Ve, { source: n.video.url, poster: n.video.thumbnailUrl }),
|
|
627
|
-
/* @__PURE__ */ I(
|
|
628
|
-
/* @__PURE__ */ r(
|
|
627
|
+
/* @__PURE__ */ I($n, { children: [
|
|
628
|
+
/* @__PURE__ */ r(bn, { children: (n == null ? void 0 : n.heading) || t }),
|
|
629
629
|
/* @__PURE__ */ r(En, { children: n == null ? void 0 : n.body })
|
|
630
630
|
] })
|
|
631
631
|
] });
|
|
@@ -638,7 +638,7 @@ const fn = [L.PRIMARY_GREEN1, L.SECONDARY_RED1, L.SECONDARY_RED1], gn = [10, 10,
|
|
|
638
638
|
class: "w19zie3h",
|
|
639
639
|
propsAsIs: !1
|
|
640
640
|
}), Un = ({ instantView: e, ...t }) => /* @__PURE__ */ I(Rn, { children: [
|
|
641
|
-
/* @__PURE__ */ r(
|
|
641
|
+
/* @__PURE__ */ r(be, { instantView: e, ...t }),
|
|
642
642
|
(e == null ? void 0 : e.webLink) && /* @__PURE__ */ I(Qn, { href: e == null ? void 0 : e.webLink.url, target: "_blank", children: [
|
|
643
643
|
"Explore more of the Masters History",
|
|
644
644
|
/* @__PURE__ */ r(j, { name: "icon-external-link" })
|
|
@@ -706,14 +706,14 @@ const fn = [L.PRIMARY_GREEN1, L.SECONDARY_RED1, L.SECONDARY_RED1], gn = [10, 10,
|
|
|
706
706
|
class: "tspsaas",
|
|
707
707
|
propsAsIs: !1
|
|
708
708
|
});
|
|
709
|
-
var
|
|
710
|
-
const
|
|
711
|
-
/* @__PURE__ */ r(
|
|
709
|
+
var B = /* @__PURE__ */ ((e) => (e.HOME = "home", e.LEADERBOARD = "leaderboard", e))(B || {});
|
|
710
|
+
const fe = ({ title: e, active: t, onClick: n }) => /* @__PURE__ */ r(Vn, { onClick: n, "data-selected": t, children: /* @__PURE__ */ r(Bn, { children: e }) }), Hn = ({ activePage: e = "home", toggleActivePage: t }) => /* @__PURE__ */ r(Wn, { children: /* @__PURE__ */ I(Fn, { "data-position": e === "home" ? "left" : "right", children: [
|
|
711
|
+
/* @__PURE__ */ r(fe, { title: "Home", active: e === "home", onClick: () => t(
|
|
712
712
|
"home"
|
|
713
713
|
/* HOME */
|
|
714
714
|
) }),
|
|
715
715
|
/* @__PURE__ */ r(
|
|
716
|
-
|
|
716
|
+
fe,
|
|
717
717
|
{
|
|
718
718
|
title: "Leader Board",
|
|
719
719
|
active: e === "leaderboard",
|
|
@@ -734,7 +734,7 @@ function te() {
|
|
|
734
734
|
return e;
|
|
735
735
|
}, te.apply(this, arguments);
|
|
736
736
|
}
|
|
737
|
-
function
|
|
737
|
+
function ge(e) {
|
|
738
738
|
if (e === void 0)
|
|
739
739
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
740
740
|
return e;
|
|
@@ -747,11 +747,11 @@ function ne(e, t) {
|
|
|
747
747
|
function Gn(e, t) {
|
|
748
748
|
e.prototype = Object.create(t.prototype), e.prototype.constructor = e, ne(e, t);
|
|
749
749
|
}
|
|
750
|
-
var
|
|
750
|
+
var Me = Number.isNaN || function(t) {
|
|
751
751
|
return typeof t == "number" && t !== t;
|
|
752
752
|
};
|
|
753
753
|
function Zn(e, t) {
|
|
754
|
-
return !!(e === t ||
|
|
754
|
+
return !!(e === t || Me(e) && Me(t));
|
|
755
755
|
}
|
|
756
756
|
function Jn(e, t) {
|
|
757
757
|
if (e.length !== t.length)
|
|
@@ -771,18 +771,18 @@ function J(e, t) {
|
|
|
771
771
|
}
|
|
772
772
|
return l;
|
|
773
773
|
}
|
|
774
|
-
var Kn = typeof performance == "object" && typeof performance.now == "function",
|
|
774
|
+
var Kn = typeof performance == "object" && typeof performance.now == "function", ve = Kn ? function() {
|
|
775
775
|
return performance.now();
|
|
776
776
|
} : function() {
|
|
777
777
|
return Date.now();
|
|
778
778
|
};
|
|
779
|
-
function
|
|
779
|
+
function ye(e) {
|
|
780
780
|
cancelAnimationFrame(e.id);
|
|
781
781
|
}
|
|
782
782
|
function Xn(e, t) {
|
|
783
|
-
var n =
|
|
783
|
+
var n = ve();
|
|
784
784
|
function s() {
|
|
785
|
-
|
|
785
|
+
ve() - n >= t ? e.call(null) : i.id = requestAnimationFrame(s);
|
|
786
786
|
}
|
|
787
787
|
var i = {
|
|
788
788
|
id: requestAnimationFrame(s)
|
|
@@ -790,22 +790,22 @@ function Xn(e, t) {
|
|
|
790
790
|
return i;
|
|
791
791
|
}
|
|
792
792
|
var K = -1;
|
|
793
|
-
function
|
|
793
|
+
function Ne(e) {
|
|
794
794
|
if (e === void 0 && (e = !1), K === -1 || e) {
|
|
795
795
|
var t = document.createElement("div"), n = t.style;
|
|
796
796
|
n.width = "50px", n.height = "50px", n.overflow = "scroll", document.body.appendChild(t), K = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
|
|
797
797
|
}
|
|
798
798
|
return K;
|
|
799
799
|
}
|
|
800
|
-
var
|
|
801
|
-
function
|
|
802
|
-
if (e === void 0 && (e = !1),
|
|
800
|
+
var $ = null;
|
|
801
|
+
function Ae(e) {
|
|
802
|
+
if (e === void 0 && (e = !1), $ === null || e) {
|
|
803
803
|
var t = document.createElement("div"), n = t.style;
|
|
804
804
|
n.width = "50px", n.height = "50px", n.overflow = "scroll", n.direction = "rtl";
|
|
805
805
|
var s = document.createElement("div"), i = s.style;
|
|
806
|
-
return i.width = "100px", i.height = "100px", t.appendChild(s), document.body.appendChild(t), t.scrollLeft > 0 ?
|
|
806
|
+
return i.width = "100px", i.height = "100px", t.appendChild(s), document.body.appendChild(t), t.scrollLeft > 0 ? $ = "positive-descending" : (t.scrollLeft = 1, t.scrollLeft === 0 ? $ = "negative" : $ = "positive-ascending"), document.body.removeChild(t), $;
|
|
807
807
|
}
|
|
808
|
-
return
|
|
808
|
+
return $;
|
|
809
809
|
}
|
|
810
810
|
var es = 150, ts = function(t, n) {
|
|
811
811
|
return t;
|
|
@@ -816,8 +816,8 @@ function ns(e) {
|
|
|
816
816
|
Gn(g, v);
|
|
817
817
|
function g(D) {
|
|
818
818
|
var o;
|
|
819
|
-
return o = v.call(this, D) || this, o._instanceProps = d(o.props,
|
|
820
|
-
instance:
|
|
819
|
+
return o = v.call(this, D) || this, o._instanceProps = d(o.props, ge(o)), o._outerRef = void 0, o._resetIsScrollingTimeoutId = null, o.state = {
|
|
820
|
+
instance: ge(o),
|
|
821
821
|
isScrolling: !1,
|
|
822
822
|
scrollDirection: "forward",
|
|
823
823
|
scrollOffset: typeof o.props.initialScrollOffset == "number" ? o.props.initialScrollOffset : 0,
|
|
@@ -840,11 +840,11 @@ function ns(e) {
|
|
|
840
840
|
if (N.hasOwnProperty(u))
|
|
841
841
|
S = N[u];
|
|
842
842
|
else {
|
|
843
|
-
var z = n(o.props, u, o._instanceProps), k = i(o.props, u, o._instanceProps), O = h === "horizontal" || y === "horizontal",
|
|
843
|
+
var z = n(o.props, u, o._instanceProps), k = i(o.props, u, o._instanceProps), O = h === "horizontal" || y === "horizontal", P = h === "rtl", Y = O ? z : 0;
|
|
844
844
|
N[u] = S = {
|
|
845
845
|
position: "absolute",
|
|
846
|
-
left:
|
|
847
|
-
right:
|
|
846
|
+
left: P ? void 0 : Y,
|
|
847
|
+
right: P ? Y : void 0,
|
|
848
848
|
top: O ? 0 : z,
|
|
849
849
|
height: O ? "100%" : k,
|
|
850
850
|
width: O ? k : "100%"
|
|
@@ -860,7 +860,7 @@ function ns(e) {
|
|
|
860
860
|
return null;
|
|
861
861
|
var S = o.props.direction, z = M;
|
|
862
862
|
if (S === "rtl")
|
|
863
|
-
switch (
|
|
863
|
+
switch (Ae()) {
|
|
864
864
|
case "negative":
|
|
865
865
|
z = -M;
|
|
866
866
|
break;
|
|
@@ -892,7 +892,7 @@ function ns(e) {
|
|
|
892
892
|
var p = o.props.outerRef;
|
|
893
893
|
o._outerRef = u, typeof p == "function" ? p(u) : p != null && typeof p == "object" && p.hasOwnProperty("current") && (p.current = u);
|
|
894
894
|
}, o._resetIsScrollingDebounced = function() {
|
|
895
|
-
o._resetIsScrollingTimeoutId !== null &&
|
|
895
|
+
o._resetIsScrollingTimeoutId !== null && ye(o._resetIsScrollingTimeoutId), o._resetIsScrollingTimeoutId = Xn(o._resetIsScrolling, es);
|
|
896
896
|
}, o._resetIsScrolling = function() {
|
|
897
897
|
o._resetIsScrollingTimeoutId = null, o.setState({
|
|
898
898
|
isScrolling: !1
|
|
@@ -920,7 +920,7 @@ function ns(e) {
|
|
|
920
920
|
var N = 0;
|
|
921
921
|
if (this._outerRef) {
|
|
922
922
|
var S = this._outerRef;
|
|
923
|
-
M === "vertical" ? N = S.scrollWidth > S.clientWidth ?
|
|
923
|
+
M === "vertical" ? N = S.scrollWidth > S.clientWidth ? Ne() : 0 : N = S.scrollHeight > S.clientHeight ? Ne() : 0;
|
|
924
924
|
}
|
|
925
925
|
this.scrollTo(c(this.props, o, u, y, this._instanceProps, N));
|
|
926
926
|
}, T.componentDidMount = function() {
|
|
@@ -936,7 +936,7 @@ function ns(e) {
|
|
|
936
936
|
var N = this._outerRef;
|
|
937
937
|
if (u === "horizontal" || p === "horizontal")
|
|
938
938
|
if (u === "rtl")
|
|
939
|
-
switch (
|
|
939
|
+
switch (Ae()) {
|
|
940
940
|
case "negative":
|
|
941
941
|
N.scrollLeft = -M;
|
|
942
942
|
break;
|
|
@@ -955,19 +955,19 @@ function ns(e) {
|
|
|
955
955
|
}
|
|
956
956
|
this._callPropsCallbacks();
|
|
957
957
|
}, T.componentWillUnmount = function() {
|
|
958
|
-
this._resetIsScrollingTimeoutId !== null &&
|
|
958
|
+
this._resetIsScrollingTimeoutId !== null && ye(this._resetIsScrollingTimeoutId);
|
|
959
959
|
}, T.render = function() {
|
|
960
|
-
var o = this.props, u = o.children, p = o.className, h = o.direction, M = o.height, y = o.innerRef, N = o.innerElementType, S = o.innerTagName, z = o.itemCount, k = o.itemData, O = o.itemKey,
|
|
960
|
+
var o = this.props, u = o.children, p = o.className, h = o.direction, M = o.height, y = o.innerRef, N = o.innerElementType, S = o.innerTagName, z = o.itemCount, k = o.itemData, O = o.itemKey, P = O === void 0 ? ts : O, Y = o.layout, Ee = o.outerElementType, Le = o.outerTagName, Re = o.style, Qe = o.useIsScrolling, Ue = o.width, ie = this.state.isScrolling, H = h === "horizontal" || Y === "horizontal", _e = H ? this._onScrollHorizontal : this._onScrollVertical, re = this._getRangeToRender(), qe = re[0], Pe = re[1], oe = [];
|
|
961
961
|
if (z > 0)
|
|
962
962
|
for (var Q = qe; Q <= Pe; Q++)
|
|
963
|
-
|
|
963
|
+
oe.push(G(u, {
|
|
964
964
|
data: k,
|
|
965
|
-
key:
|
|
965
|
+
key: P(Q, k),
|
|
966
966
|
index: Q,
|
|
967
|
-
isScrolling: Qe ?
|
|
967
|
+
isScrolling: Qe ? ie : void 0,
|
|
968
968
|
style: this._getItemStyle(Q)
|
|
969
969
|
}));
|
|
970
|
-
var
|
|
970
|
+
var ae = s(this.props, this._instanceProps);
|
|
971
971
|
return G(Ee || Le || "div", {
|
|
972
972
|
className: p,
|
|
973
973
|
onScroll: _e,
|
|
@@ -982,12 +982,12 @@ function ns(e) {
|
|
|
982
982
|
direction: h
|
|
983
983
|
}, Re)
|
|
984
984
|
}, G(N || S || "div", {
|
|
985
|
-
children:
|
|
985
|
+
children: oe,
|
|
986
986
|
ref: y,
|
|
987
987
|
style: {
|
|
988
|
-
height: H ? "100%" :
|
|
989
|
-
pointerEvents:
|
|
990
|
-
width: H ?
|
|
988
|
+
height: H ? "100%" : ae,
|
|
989
|
+
pointerEvents: ie ? "none" : void 0,
|
|
990
|
+
width: H ? ae : "100%"
|
|
991
991
|
}
|
|
992
992
|
}));
|
|
993
993
|
}, T._callPropsCallbacks = function() {
|
|
@@ -1115,7 +1115,7 @@ var as = function(e, t) {
|
|
|
1115
1115
|
configurable: !0
|
|
1116
1116
|
}
|
|
1117
1117
|
}), t && (Object.setPrototypeOf ? Object.setPrototypeOf(e, t) : e.__proto__ = t);
|
|
1118
|
-
},
|
|
1118
|
+
}, Te = function(e, t) {
|
|
1119
1119
|
if (!e)
|
|
1120
1120
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
1121
1121
|
return t && (typeof t == "object" || typeof t == "function") ? t : e;
|
|
@@ -1126,12 +1126,12 @@ var as = function(e, t) {
|
|
|
1126
1126
|
as(this, t);
|
|
1127
1127
|
for (var l = arguments.length, m = Array(l), d = 0; d < l; d++)
|
|
1128
1128
|
m[d] = arguments[d];
|
|
1129
|
-
return c = (s = (i =
|
|
1129
|
+
return c = (s = (i = Te(this, (n = t.__proto__ || Object.getPrototypeOf(t)).call.apply(n, [this].concat(m))), i), i._lastRenderedStartIndex = -1, i._lastRenderedStopIndex = -1, i._memoizedUnloadedRanges = [], i._onItemsRendered = function(f) {
|
|
1130
1130
|
var A = f.visibleStartIndex, v = f.visibleStopIndex;
|
|
1131
1131
|
i._lastRenderedStartIndex = A, i._lastRenderedStopIndex = v, i._ensureRowsLoaded(A, v);
|
|
1132
1132
|
}, i._setRef = function(f) {
|
|
1133
1133
|
i._listRef = f;
|
|
1134
|
-
}, s),
|
|
1134
|
+
}, s), Te(i, c);
|
|
1135
1135
|
}
|
|
1136
1136
|
return ls(t, [{
|
|
1137
1137
|
key: "resetloadMoreItemsCache",
|
|
@@ -1231,14 +1231,18 @@ const us = /* @__PURE__ */ a("div")({
|
|
|
1231
1231
|
}) => /* @__PURE__ */ I(us, { onClick: c, style: l, children: [
|
|
1232
1232
|
/* @__PURE__ */ r(ps, { children: e || 0 }),
|
|
1233
1233
|
/* @__PURE__ */ I(Is, { children: [
|
|
1234
|
-
t ? /* @__PURE__ */ r(ms, { alt: "leaderboard-item-avatar", src: t }) : /* @__PURE__ */ r(hs, { children:
|
|
1234
|
+
t ? /* @__PURE__ */ r(ms, { alt: "leaderboard-item-avatar", src: t }) : /* @__PURE__ */ r(hs, { children: ze(n || "") }),
|
|
1235
1235
|
/* @__PURE__ */ I(fs, { children: [
|
|
1236
1236
|
/* @__PURE__ */ r(gs, { children: n || "" }),
|
|
1237
1237
|
i && /* @__PURE__ */ r(vs, { name: "icon-star" })
|
|
1238
1238
|
] })
|
|
1239
1239
|
] }),
|
|
1240
|
-
/* @__PURE__ */ r("div", { children:
|
|
1241
|
-
] }), Ns = ({
|
|
1240
|
+
/* @__PURE__ */ r("div", { children: xe(s) })
|
|
1241
|
+
] }), Ns = /* @__PURE__ */ a("div")({
|
|
1242
|
+
name: "ScrollContainer",
|
|
1243
|
+
class: "s13d8sg6",
|
|
1244
|
+
propsAsIs: !1
|
|
1245
|
+
}), As = ({
|
|
1242
1246
|
items: e,
|
|
1243
1247
|
currentUserId: t,
|
|
1244
1248
|
openItemDetail: n,
|
|
@@ -1249,7 +1253,7 @@ const us = /* @__PURE__ */ a("div")({
|
|
|
1249
1253
|
isItemLoaded: (l) => l < e.length,
|
|
1250
1254
|
itemCount: e.length + 1,
|
|
1251
1255
|
loadMoreItems: s,
|
|
1252
|
-
children: ({ onItemsRendered: l, ref: m }) => /* @__PURE__ */ r(
|
|
1256
|
+
children: ({ onItemsRendered: l, ref: m }) => /* @__PURE__ */ r(Ns, { children: /* @__PURE__ */ r(
|
|
1253
1257
|
is,
|
|
1254
1258
|
{
|
|
1255
1259
|
itemSize: 56,
|
|
@@ -1269,9 +1273,9 @@ const us = /* @__PURE__ */ a("div")({
|
|
|
1269
1273
|
e[d].userId
|
|
1270
1274
|
)
|
|
1271
1275
|
}
|
|
1272
|
-
)
|
|
1276
|
+
) })
|
|
1273
1277
|
}
|
|
1274
|
-
) }),
|
|
1278
|
+
) }), Ts = ({ deepLink: e }) => {
|
|
1275
1279
|
const { data: t } = w(e.$store);
|
|
1276
1280
|
return /* @__PURE__ */ r(
|
|
1277
1281
|
He,
|
|
@@ -1293,55 +1297,55 @@ const us = /* @__PURE__ */ a("div")({
|
|
|
1293
1297
|
inviteCardSubtext: "Invite and compete against your friends for the top spot on the leaderboard."
|
|
1294
1298
|
}
|
|
1295
1299
|
);
|
|
1296
|
-
},
|
|
1300
|
+
}, Ds = ({ gamification: e }) => {
|
|
1297
1301
|
const { data: t } = w(e.leaderboardList.$store);
|
|
1298
1302
|
return t != null && t.length ? /* @__PURE__ */ r(
|
|
1299
|
-
|
|
1303
|
+
As,
|
|
1300
1304
|
{
|
|
1301
1305
|
fetchMore: e.leaderboardList.fetchMore,
|
|
1302
1306
|
items: t,
|
|
1303
1307
|
openItemDetail: e.openUser,
|
|
1304
1308
|
currentUserId: e.currentUserId.get()
|
|
1305
1309
|
}
|
|
1306
|
-
) : /* @__PURE__ */ r(
|
|
1307
|
-
},
|
|
1310
|
+
) : /* @__PURE__ */ r(Ts, { deepLink: e.deepLink });
|
|
1311
|
+
}, Ss = /* @__PURE__ */ a("div")({
|
|
1308
1312
|
name: "QuestionItem",
|
|
1309
1313
|
class: "q1w97g3p",
|
|
1310
1314
|
propsAsIs: !1
|
|
1311
|
-
}),
|
|
1315
|
+
}), zs = /* @__PURE__ */ a("div")({
|
|
1312
1316
|
name: "QuestionCaption",
|
|
1313
1317
|
class: "q2sl39u",
|
|
1314
1318
|
propsAsIs: !1
|
|
1315
|
-
}),
|
|
1319
|
+
}), xs = /* @__PURE__ */ a("div")({
|
|
1316
1320
|
name: "QuestionBody",
|
|
1317
1321
|
class: "qd5h0uc",
|
|
1318
1322
|
propsAsIs: !1
|
|
1319
|
-
}),
|
|
1323
|
+
}), js = /* @__PURE__ */ a("div")({
|
|
1320
1324
|
name: "QuestionAction",
|
|
1321
1325
|
class: "q105uluy",
|
|
1322
1326
|
propsAsIs: !1
|
|
1323
|
-
}),
|
|
1327
|
+
}), ks = () => j, X = /* @__PURE__ */ a(ks())({
|
|
1324
1328
|
name: "QuestionActionIcon",
|
|
1325
1329
|
class: "q1fa0b9h",
|
|
1326
1330
|
propsAsIs: !0
|
|
1327
|
-
}),
|
|
1331
|
+
}), Os = () => j, ws = /* @__PURE__ */ a(Os())({
|
|
1328
1332
|
name: "QuestionTypeIcon",
|
|
1329
1333
|
class: "qxlt78s",
|
|
1330
1334
|
propsAsIs: !0
|
|
1331
|
-
}),
|
|
1335
|
+
}), Cs = /* @__PURE__ */ a("div")({
|
|
1332
1336
|
name: "QuestionTypeLabel",
|
|
1333
1337
|
class: "qmg0vkx",
|
|
1334
1338
|
propsAsIs: !1
|
|
1335
|
-
}),
|
|
1339
|
+
}), $s = /* @__PURE__ */ a("div")({
|
|
1336
1340
|
name: "QuestionContent",
|
|
1337
1341
|
class: "q1uz5j1g",
|
|
1338
1342
|
propsAsIs: !1
|
|
1339
1343
|
}), bs = {
|
|
1340
|
-
[
|
|
1341
|
-
[
|
|
1342
|
-
[
|
|
1343
|
-
[
|
|
1344
|
-
},
|
|
1344
|
+
[W.LOST]: /* @__PURE__ */ r(X, { name: "icon-cross" }),
|
|
1345
|
+
[W.WON]: /* @__PURE__ */ r(X, { name: "icon-check" }),
|
|
1346
|
+
[W.UNSET]: void 0,
|
|
1347
|
+
[W.DNP]: /* @__PURE__ */ r(X, { name: "icon-arrow" })
|
|
1348
|
+
}, Es = ({
|
|
1345
1349
|
questionId: e,
|
|
1346
1350
|
questionType: t,
|
|
1347
1351
|
questionStatus: n,
|
|
@@ -1350,114 +1354,144 @@ const us = /* @__PURE__ */ a("div")({
|
|
|
1350
1354
|
openQuestion: c,
|
|
1351
1355
|
status: l
|
|
1352
1356
|
}) => {
|
|
1353
|
-
const m =
|
|
1354
|
-
return m ? /* @__PURE__ */ I(
|
|
1355
|
-
/* @__PURE__ */ I(
|
|
1356
|
-
/* @__PURE__ */ I(
|
|
1357
|
-
/* @__PURE__ */ r(
|
|
1358
|
-
/* @__PURE__ */ I(
|
|
1357
|
+
const m = Se[t], d = bs[l];
|
|
1358
|
+
return m ? /* @__PURE__ */ I(Ss, { onClick: () => c == null ? void 0 : c(e), children: [
|
|
1359
|
+
/* @__PURE__ */ I($s, { children: [
|
|
1360
|
+
/* @__PURE__ */ I(zs, { children: [
|
|
1361
|
+
/* @__PURE__ */ r(ws, { name: m.iconName }),
|
|
1362
|
+
/* @__PURE__ */ I(Cs, { children: [
|
|
1359
1363
|
m.label,
|
|
1360
|
-
t === x.TRIVIA && n ===
|
|
1364
|
+
t === x.TRIVIA && n === _.RESOLVED && " • Expired"
|
|
1361
1365
|
] })
|
|
1362
1366
|
] }),
|
|
1363
|
-
/* @__PURE__ */ r(
|
|
1367
|
+
/* @__PURE__ */ r(xs, { children: s || "" })
|
|
1364
1368
|
] }),
|
|
1365
|
-
/* @__PURE__ */ r(
|
|
1369
|
+
/* @__PURE__ */ r(js, { children: d || (i ? /* @__PURE__ */ r(Ge, { children: "Play" }) : null) })
|
|
1366
1370
|
] }) : null;
|
|
1367
|
-
},
|
|
1371
|
+
}, Ls = /* @__PURE__ */ a("div")({
|
|
1368
1372
|
name: "Container",
|
|
1369
1373
|
class: "cll3md7",
|
|
1370
1374
|
propsAsIs: !1
|
|
1371
|
-
}),
|
|
1375
|
+
}), Rs = /* @__PURE__ */ a("button")({
|
|
1372
1376
|
name: "ActionBtn",
|
|
1373
1377
|
class: "a10g1iik",
|
|
1374
1378
|
propsAsIs: !1
|
|
1375
|
-
}),
|
|
1379
|
+
}), Qs = ({
|
|
1376
1380
|
openInsight: e,
|
|
1377
1381
|
questionId: t,
|
|
1378
1382
|
...n
|
|
1379
|
-
}) => /* @__PURE__ */ I(
|
|
1380
|
-
/* @__PURE__ */ r(
|
|
1381
|
-
e && /* @__PURE__ */ r(
|
|
1382
|
-
] }),
|
|
1383
|
+
}) => /* @__PURE__ */ I(Ls, { children: [
|
|
1384
|
+
/* @__PURE__ */ r(be, { questionId: t, ...n }),
|
|
1385
|
+
e && /* @__PURE__ */ r(Rs, { onClick: () => e(t), children: "View Insight" })
|
|
1386
|
+
] }), Us = /* @__PURE__ */ a("div")({
|
|
1383
1387
|
name: "QuestionsContainer",
|
|
1384
1388
|
class: "qvghv3l",
|
|
1385
1389
|
propsAsIs: !1
|
|
1386
|
-
}),
|
|
1390
|
+
}), _s = ({ questions: e, openQuestion: t }) => /* @__PURE__ */ r(Us, { children: e == null ? void 0 : e.map((n) => {
|
|
1387
1391
|
var s, i;
|
|
1388
1392
|
if (n.type === "question" && ((s = n.attributes) == null ? void 0 : s.attributes.case) === "question") {
|
|
1389
1393
|
const c = n.attributes.attributes.value;
|
|
1390
|
-
return /* @__PURE__ */ r(
|
|
1394
|
+
return /* @__PURE__ */ r(Es, { openQuestion: t, ...c }, c.questionId);
|
|
1391
1395
|
}
|
|
1392
1396
|
if (n.type === "insight" && ((i = n.attributes) == null ? void 0 : i.attributes.case) === "insight") {
|
|
1393
1397
|
const c = n.attributes.attributes.value;
|
|
1394
|
-
return /* @__PURE__ */ r(
|
|
1398
|
+
return /* @__PURE__ */ r(Qs, { openInsight: t, ...c }, c.questionId);
|
|
1395
1399
|
}
|
|
1396
1400
|
return null;
|
|
1397
|
-
}) }),
|
|
1401
|
+
}) }), qs = ({ store: e, openQuestion: t }) => {
|
|
1398
1402
|
const n = w(e);
|
|
1399
|
-
return n != null && n.data ? /* @__PURE__ */ r(
|
|
1400
|
-
},
|
|
1403
|
+
return n != null && n.data ? /* @__PURE__ */ r(_s, { openQuestion: t, questions: n.data }) : /* @__PURE__ */ r("div", { children: "wait questions..." });
|
|
1404
|
+
}, Ps = ({ userSummary: e }) => {
|
|
1401
1405
|
var t, n;
|
|
1402
1406
|
const s = w(e.getStore());
|
|
1403
1407
|
return (t = s.data) != null && t.summary ? /* @__PURE__ */ r(Oe, { ...s.data.summary, successRate: (n = s.data.percentage) == null ? void 0 : n.correct }) : /* @__PURE__ */ r("div", { children: "wait user..." });
|
|
1404
|
-
},
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
},
|
|
1408
|
+
}, Ys = ({
|
|
1409
|
+
gamification: e
|
|
1410
|
+
}) => {
|
|
1411
|
+
const [t, n] = R(B.HOME);
|
|
1412
|
+
return /* @__PURE__ */ I("div", {
|
|
1413
|
+
style: {
|
|
1414
|
+
height: "100%",
|
|
1415
|
+
display: "flex",
|
|
1416
|
+
flexDirection: "column",
|
|
1417
|
+
overflow: "hidden"
|
|
1418
|
+
},
|
|
1419
|
+
children: [/* @__PURE__ */ r(ee, {
|
|
1420
|
+
style: {
|
|
1421
|
+
paddingBottom: "4px"
|
|
1422
|
+
},
|
|
1423
|
+
children: /* @__PURE__ */ r(Hn, {
|
|
1424
|
+
activePage: t,
|
|
1425
|
+
toggleActivePage: n
|
|
1426
|
+
})
|
|
1427
|
+
}), t === B.HOME && /* @__PURE__ */ I(se, {
|
|
1428
|
+
children: [/* @__PURE__ */ r(ee, {
|
|
1429
|
+
style: {
|
|
1430
|
+
paddingTop: "12px"
|
|
1431
|
+
},
|
|
1432
|
+
children: /* @__PURE__ */ r(Ps, {
|
|
1433
|
+
userSummary: e.userSummary
|
|
1434
|
+
})
|
|
1435
|
+
}), /* @__PURE__ */ r(Ze, {
|
|
1436
|
+
children: /* @__PURE__ */ r(qs, {
|
|
1437
|
+
openQuestion: e.openQuestion,
|
|
1438
|
+
store: e.feedList.getStore()
|
|
1439
|
+
})
|
|
1440
|
+
})]
|
|
1441
|
+
}), t === B.LEADERBOARD && /* @__PURE__ */ r("div", {
|
|
1442
|
+
className: "c1bp9dj2",
|
|
1443
|
+
children: /* @__PURE__ */ r(Ds, {
|
|
1444
|
+
gamification: e
|
|
1445
|
+
})
|
|
1446
|
+
})]
|
|
1447
|
+
});
|
|
1448
|
+
}, Ws = () => Je, De = /* @__PURE__ */ a(Ws())({
|
|
1415
1449
|
name: "OpenedContainer",
|
|
1416
1450
|
class: "oar61gl",
|
|
1417
1451
|
propsAsIs: !0
|
|
1418
|
-
}),
|
|
1452
|
+
}), Fs = /* @__PURE__ */ a("div")({
|
|
1419
1453
|
name: "UserContainer",
|
|
1420
1454
|
class: "u14zaal4",
|
|
1421
1455
|
propsAsIs: !1
|
|
1422
|
-
}),
|
|
1456
|
+
}), Vs = ({
|
|
1423
1457
|
correct: e,
|
|
1424
1458
|
incorrect: t
|
|
1425
1459
|
}) => {
|
|
1426
1460
|
const n = e + t;
|
|
1427
1461
|
return n === 0 ? 0 : Math.round(e / n * 100);
|
|
1428
|
-
},
|
|
1462
|
+
}, Zs = ({
|
|
1429
1463
|
gamification: e,
|
|
1430
1464
|
className: t
|
|
1431
1465
|
}) => {
|
|
1432
1466
|
const n = w(e.openedQuestion.$store), s = w(e.openedUser);
|
|
1433
1467
|
return /* @__PURE__ */ I(E, {
|
|
1434
|
-
children: [n && /* @__PURE__ */ r(
|
|
1468
|
+
children: [n && /* @__PURE__ */ r(De, {
|
|
1435
1469
|
className: t,
|
|
1436
1470
|
children: /* @__PURE__ */ r(Yn, {
|
|
1437
1471
|
gamification: e
|
|
1438
1472
|
})
|
|
1439
|
-
}), s && /* @__PURE__ */ r(
|
|
1473
|
+
}), s && /* @__PURE__ */ r(De, {
|
|
1440
1474
|
className: t,
|
|
1441
|
-
children: /* @__PURE__ */ I(
|
|
1475
|
+
children: /* @__PURE__ */ I(Fs, {
|
|
1442
1476
|
children: [/* @__PURE__ */ r(ke, {
|
|
1443
1477
|
label: "Friend's Rank",
|
|
1444
1478
|
close: e.closeUser
|
|
1445
1479
|
}), /* @__PURE__ */ r(ee, {
|
|
1446
1480
|
children: /* @__PURE__ */ r(Oe, {
|
|
1447
1481
|
...s,
|
|
1448
|
-
successRate:
|
|
1482
|
+
successRate: Vs(s)
|
|
1449
1483
|
})
|
|
1450
1484
|
})]
|
|
1451
1485
|
})
|
|
1452
|
-
}), /* @__PURE__ */ r(
|
|
1486
|
+
}), /* @__PURE__ */ r(se, {
|
|
1453
1487
|
className: t,
|
|
1454
1488
|
"data-nav": "true",
|
|
1455
|
-
children: /* @__PURE__ */ r(
|
|
1489
|
+
children: /* @__PURE__ */ r(Ys, {
|
|
1456
1490
|
gamification: e
|
|
1457
1491
|
})
|
|
1458
1492
|
})]
|
|
1459
1493
|
});
|
|
1460
1494
|
};
|
|
1461
1495
|
export {
|
|
1462
|
-
|
|
1496
|
+
Zs as default
|
|
1463
1497
|
};
|