@streamlayer/react 0.32.10 → 0.32.11
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/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 +17 -17
- package/lib/dist/es/gamification-feature.js +83 -83
- package/lib/dist/es/masters.js +5542 -5541
- package/lib/dist/style.css +1 -1
- package/lib/es/gamification-feature.js +109 -109
- package/lib/es/masters2.js +1363 -1362
- package/lib/style.css +1 -1
- package/package.json +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as d, jsx as s, Fragment as
|
|
1
|
+
import { jsxs as d, jsx as s, Fragment as C } from "react/jsx-runtime";
|
|
2
2
|
import { s as o, o as b } from "./index4.js";
|
|
3
3
|
import { useStore as q } from "@nanostores/react";
|
|
4
4
|
import { o as be, r as ue, w as Ye, u as we, A as Ve, O as We, c as Fe, a as le, n as Be, f as He } from "./masters2.js";
|
|
5
|
-
import { QuestionType as D, QuestionStatus as
|
|
6
|
-
import { useState as R, useCallback as B, useEffect as
|
|
5
|
+
import { QuestionType as D, QuestionStatus as k, QuestionImages as W, PickHistoryStatus as Z } from "@streamlayer/sdk-web-types";
|
|
6
|
+
import { useState as R, useCallback as B, useEffect as ke, useMemo as E, createElement as ie, PureComponent as Ce } from "react";
|
|
7
7
|
import { d as Ee } from "./index3.js";
|
|
8
8
|
import "react-countup";
|
|
9
9
|
import { CountdownCircleTimer as Ge } from "react-countdown-circle-timer";
|
|
@@ -164,8 +164,8 @@ const Ze = /* @__PURE__ */ o("div")({
|
|
|
164
164
|
friendsRank: i,
|
|
165
165
|
rank: r,
|
|
166
166
|
streak: h,
|
|
167
|
-
correct:
|
|
168
|
-
incorrect:
|
|
167
|
+
correct: p,
|
|
168
|
+
incorrect: u,
|
|
169
169
|
inTop: c,
|
|
170
170
|
successRate: f
|
|
171
171
|
}) => /* @__PURE__ */ d(dt, { children: [
|
|
@@ -200,8 +200,8 @@ const Ze = /* @__PURE__ */ o("div")({
|
|
|
200
200
|
] }),
|
|
201
201
|
/* @__PURE__ */ d(Dt, { children: [
|
|
202
202
|
/* @__PURE__ */ s(J, { indicator: h || 0, title: "Win streak" }),
|
|
203
|
-
/* @__PURE__ */ s(J, { indicator:
|
|
204
|
-
/* @__PURE__ */ s(J, { indicator:
|
|
203
|
+
/* @__PURE__ */ s(J, { indicator: p || 0, title: "Correct" }),
|
|
204
|
+
/* @__PURE__ */ s(J, { indicator: u || 0, title: "Incorrect" }),
|
|
205
205
|
/* @__PURE__ */ s(J, { indicator: `${f || 0}%`, title: "Succ. rate" })
|
|
206
206
|
] })
|
|
207
207
|
] })
|
|
@@ -217,11 +217,11 @@ const Ze = /* @__PURE__ */ o("div")({
|
|
|
217
217
|
children: /* @__PURE__ */ s(bt, {
|
|
218
218
|
name: "mastersLogo"
|
|
219
219
|
})
|
|
220
|
-
}),
|
|
220
|
+
}), kt = /* @__PURE__ */ o("div")({
|
|
221
221
|
name: "Container",
|
|
222
222
|
class: "c38csyt",
|
|
223
223
|
propsAsIs: !1
|
|
224
|
-
}),
|
|
224
|
+
}), Ct = /* @__PURE__ */ o("div")({
|
|
225
225
|
name: "Title",
|
|
226
226
|
class: "ty221rx",
|
|
227
227
|
propsAsIs: !1
|
|
@@ -229,9 +229,9 @@ const Ze = /* @__PURE__ */ o("div")({
|
|
|
229
229
|
name: "Description",
|
|
230
230
|
class: "dlaj9xp",
|
|
231
231
|
propsAsIs: !1
|
|
232
|
-
}), Lt = ({ title: e, description: t }) => /* @__PURE__ */ d(
|
|
232
|
+
}), Lt = ({ title: e, description: t }) => /* @__PURE__ */ d(kt, { children: [
|
|
233
233
|
/* @__PURE__ */ s(b, { name: "icon-check-circle" }),
|
|
234
|
-
/* @__PURE__ */ s(
|
|
234
|
+
/* @__PURE__ */ s(Ct, { children: e }),
|
|
235
235
|
/* @__PURE__ */ s(Et, { children: t })
|
|
236
236
|
] }), $t = /* @__PURE__ */ o("div")({
|
|
237
237
|
name: "Container",
|
|
@@ -268,47 +268,47 @@ const Ze = /* @__PURE__ */ o("div")({
|
|
|
268
268
|
questionType: i,
|
|
269
269
|
hasCorrectAnswer: r,
|
|
270
270
|
questionStatus: h,
|
|
271
|
-
showExpiredNotification:
|
|
272
|
-
showClosedNotificationTrivia:
|
|
271
|
+
showExpiredNotification: p,
|
|
272
|
+
showClosedNotificationTrivia: u,
|
|
273
273
|
votedInCurrentRender: c,
|
|
274
274
|
votedAfterQuestionClosed: f,
|
|
275
275
|
enteredAnActiveQuestion: N
|
|
276
276
|
}) => {
|
|
277
|
-
const S = n && (i === D.TRIVIA || i === D.PREDICTION) && c && h !==
|
|
278
|
-
if (!
|
|
277
|
+
const S = n && (i === D.TRIVIA || i === D.PREDICTION) && c && h !== k.RESOLVED, M = i === D.PREDICTION && !r, z = h === k.RESOLVED && i === D.PREDICTION && !n && !N || i === D.PREDICTION && f && c && N, A = S && M, a = S && r, l = n && i === D.POLL && c;
|
|
278
|
+
if (!p && !u && !A && !a && !z && !l)
|
|
279
279
|
return null;
|
|
280
280
|
const m = t ? "correct" : "incorrect", I = t ? e == null ? void 0 : e.correctFeedback : e == null ? void 0 : e.incorrectFeedback;
|
|
281
281
|
return /* @__PURE__ */ d($t, { "data-isPrediction": M, children: [
|
|
282
|
-
|
|
282
|
+
p && /* @__PURE__ */ d(C, { children: [
|
|
283
283
|
/* @__PURE__ */ s(F, { children: /* @__PURE__ */ s(b, { name: "questionExpired" }) }),
|
|
284
284
|
/* @__PURE__ */ d("div", { children: [
|
|
285
285
|
/* @__PURE__ */ s(K, { children: /* @__PURE__ */ s(_, { children: "Question Expired" }) }),
|
|
286
286
|
/* @__PURE__ */ s(re, { children: "You can still answer to see if you're correct, but no points are awarded for expired questions." })
|
|
287
287
|
] })
|
|
288
288
|
] }),
|
|
289
|
-
|
|
289
|
+
u && /* @__PURE__ */ d(C, { children: [
|
|
290
290
|
/* @__PURE__ */ s(F, { children: /* @__PURE__ */ s(b, { name: "questionExpired" }) }),
|
|
291
291
|
/* @__PURE__ */ d("div", { children: [
|
|
292
292
|
/* @__PURE__ */ s(K, { children: /* @__PURE__ */ s(_, { children: "Question Closed" }) }),
|
|
293
293
|
/* @__PURE__ */ s(re, { children: "This question was answered after the moderator closed the question. So the points for this answer won’t tally." })
|
|
294
294
|
] })
|
|
295
295
|
] }),
|
|
296
|
-
z && /* @__PURE__ */ d(
|
|
296
|
+
z && /* @__PURE__ */ d(C, { children: [
|
|
297
297
|
/* @__PURE__ */ s(F, { children: /* @__PURE__ */ s(b, { name: "questionExpired" }) }),
|
|
298
298
|
/* @__PURE__ */ d("div", { children: [
|
|
299
299
|
/* @__PURE__ */ s(K, { children: /* @__PURE__ */ s(_, { children: "Question Closed" }) }),
|
|
300
300
|
/* @__PURE__ */ s(re, { children: "This event has already taken place, so the ability to make a prediction on its outcome is no longer available." })
|
|
301
301
|
] })
|
|
302
302
|
] }),
|
|
303
|
-
A && /* @__PURE__ */ d(
|
|
303
|
+
A && /* @__PURE__ */ d(C, { children: [
|
|
304
304
|
/* @__PURE__ */ s(Qt, { name: "icon-prediction" }),
|
|
305
305
|
/* @__PURE__ */ s(_, { children: "Stay tuned to see if your prediction was correct." })
|
|
306
306
|
] }),
|
|
307
|
-
l && /* @__PURE__ */ d(
|
|
307
|
+
l && /* @__PURE__ */ d(C, { children: [
|
|
308
308
|
/* @__PURE__ */ s(F, { "data-feedbackType": "correct", children: /* @__PURE__ */ s(b, { name: "correct" }) }),
|
|
309
309
|
/* @__PURE__ */ s(_, { children: "That's for answering. Please stay tuned for the next question." })
|
|
310
310
|
] }),
|
|
311
|
-
a && /* @__PURE__ */ d(
|
|
311
|
+
a && /* @__PURE__ */ d(C, { children: [
|
|
312
312
|
/* @__PURE__ */ s(F, { "data-feedbackType": m, children: /* @__PURE__ */ s(b, { name: m }) }),
|
|
313
313
|
/* @__PURE__ */ s("div", { children: /* @__PURE__ */ d(K, { children: [
|
|
314
314
|
/* @__PURE__ */ s(Ut, { "data-feedbackType": m, children: I == null ? void 0 : I.title }),
|
|
@@ -402,7 +402,7 @@ const Ze = /* @__PURE__ */ o("div")({
|
|
|
402
402
|
correct: n,
|
|
403
403
|
hasCorrectAnswer: i,
|
|
404
404
|
questionStatus: r
|
|
405
|
-
}) => e === D.TRIVIA ? t && n : e === D.PREDICTION ? t && n && i || r ===
|
|
405
|
+
}) => e === D.TRIVIA ? t && n : e === D.PREDICTION ? t && n && i || r === k.RESOLVED && n : !1, ln = (e) => {
|
|
406
406
|
var t;
|
|
407
407
|
const {
|
|
408
408
|
// option props
|
|
@@ -411,8 +411,8 @@ const Ze = /* @__PURE__ */ o("div")({
|
|
|
411
411
|
text: r,
|
|
412
412
|
percentageDecimal: h,
|
|
413
413
|
// extra props
|
|
414
|
-
onVote:
|
|
415
|
-
markThatVoted:
|
|
414
|
+
onVote: p,
|
|
415
|
+
markThatVoted: u,
|
|
416
416
|
youSelected: c,
|
|
417
417
|
questionVoted: f,
|
|
418
418
|
// ToDo: Figure out why imageMode is not in the response, and delete default value
|
|
@@ -425,7 +425,7 @@ const Ze = /* @__PURE__ */ o("div")({
|
|
|
425
425
|
hasCorrectAnswer: l,
|
|
426
426
|
votedAfterQuestionClosed: m,
|
|
427
427
|
enteredAnActiveQuestion: I
|
|
428
|
-
} = e, g = on(e), y = an({ questionType: A, questionVoted: f, correct: a, hasCorrectAnswer: l, questionStatus: M }), v = M ===
|
|
428
|
+
} = e, g = on(e), y = an({ questionType: A, questionVoted: f, correct: a, hasCorrectAnswer: l, questionStatus: M }), v = M === k.RESOLVED && A === D.PREDICTION, T = f || v;
|
|
429
429
|
return /* @__PURE__ */ d(
|
|
430
430
|
Wt,
|
|
431
431
|
{
|
|
@@ -435,7 +435,7 @@ const Ze = /* @__PURE__ */ o("div")({
|
|
|
435
435
|
disabled: f || z || S || v && !I || v && I && m,
|
|
436
436
|
"data-isNotChecked": f && !c && g !== "incorrect",
|
|
437
437
|
onClick: (O) => {
|
|
438
|
-
|
|
438
|
+
u(M === k.RESOLVED), p(O);
|
|
439
439
|
},
|
|
440
440
|
children: [
|
|
441
441
|
/* @__PURE__ */ s(Ft, { "data-answerState": g, style: { width: `${T ? h : 0}%` } }),
|
|
@@ -463,9 +463,9 @@ const Ze = /* @__PURE__ */ o("div")({
|
|
|
463
463
|
remainingTime: c
|
|
464
464
|
}) => /* @__PURE__ */ s(un, {
|
|
465
465
|
children: c
|
|
466
|
-
}),
|
|
466
|
+
}), p = B(() => {
|
|
467
467
|
n == null || n(), r(mn);
|
|
468
|
-
}, [n, r]),
|
|
468
|
+
}, [n, r]), u = B((c) => {
|
|
469
469
|
c === 10 && r(Ae);
|
|
470
470
|
}, [r]);
|
|
471
471
|
return /* @__PURE__ */ s(Ge, {
|
|
@@ -477,8 +477,8 @@ const Ze = /* @__PURE__ */ o("div")({
|
|
|
477
477
|
strokeWidth: 2,
|
|
478
478
|
trailStrokeWidth: 2,
|
|
479
479
|
trailColor: i,
|
|
480
|
-
onComplete:
|
|
481
|
-
onUpdate:
|
|
480
|
+
onComplete: p,
|
|
481
|
+
onUpdate: u,
|
|
482
482
|
children: h
|
|
483
483
|
});
|
|
484
484
|
}, In = /* @__PURE__ */ o("div")({
|
|
@@ -516,11 +516,11 @@ const Ze = /* @__PURE__ */ o("div")({
|
|
|
516
516
|
isTimer: i,
|
|
517
517
|
questionType: r,
|
|
518
518
|
timerDuration: h,
|
|
519
|
-
onTimerExpired:
|
|
519
|
+
onTimerExpired: p
|
|
520
520
|
}) => /* @__PURE__ */ d(In, { children: [
|
|
521
521
|
/* @__PURE__ */ d(fn, { children: [
|
|
522
522
|
e && /* @__PURE__ */ s(gn, { children: e }),
|
|
523
|
-
t !== void 0 && r !== D.POLL && /* @__PURE__ */ d(
|
|
523
|
+
t !== void 0 && r !== D.POLL && /* @__PURE__ */ d(C, { children: [
|
|
524
524
|
/* @__PURE__ */ s(Mn, { name: "icon-trophy" }),
|
|
525
525
|
/* @__PURE__ */ d(An, { children: [
|
|
526
526
|
/* @__PURE__ */ s(Nn, { children: /* @__PURE__ */ s(Ee, { value: t }) }),
|
|
@@ -528,12 +528,12 @@ const Ze = /* @__PURE__ */ o("div")({
|
|
|
528
528
|
] })
|
|
529
529
|
] })
|
|
530
530
|
] }),
|
|
531
|
-
i && /* @__PURE__ */ s(hn, { isPlaying: n, onTimerExpired:
|
|
531
|
+
i && /* @__PURE__ */ s(hn, { isPlaying: n, onTimerExpired: p, duration: h })
|
|
532
532
|
] }), Dn = ({ openedQuestion: e, isLoading: t, vote: n, close: i }) => {
|
|
533
533
|
var r, h;
|
|
534
|
-
const
|
|
535
|
-
|
|
536
|
-
c ===
|
|
534
|
+
const p = e.subject, u = e.type, c = e.status, f = (r = e.options) == null ? void 0 : r.options, [N, S] = R(!1), [M, z] = R(!1), [A, a] = R(!0), [l, m] = R(!1), [I, g] = R(""), y = e == null ? void 0 : e.id;
|
|
535
|
+
ke(() => {
|
|
536
|
+
c === k.RESOLVED && a(!1);
|
|
537
537
|
}, []);
|
|
538
538
|
const v = B((j) => {
|
|
539
539
|
z(j), S(!0);
|
|
@@ -579,10 +579,10 @@ const Ze = /* @__PURE__ */ o("div")({
|
|
|
579
579
|
c,
|
|
580
580
|
T,
|
|
581
581
|
I
|
|
582
|
-
]), te = f && (f.case === "trivia" || f.case === "prediction") ? f.value : void 0, $ = c ===
|
|
582
|
+
]), te = f && (f.case === "trivia" || f.case === "prediction") ? f.value : void 0, $ = c === k.RESOLVED && u === D.TRIVIA && !x && !A, H = u === D.TRIVIA && M && N && A, ne = E(() => {
|
|
583
583
|
if (!($ || l))
|
|
584
|
-
return c ===
|
|
585
|
-
}, [l, x, L, c, $]), se = E(() => $ || l ? "Time expired" : e.type === D.POLL ? "Time remaining" : x ? "You won" : "To win", [l, e.type, x, $]), G = x || $ || H ||
|
|
584
|
+
return c === k.RESOLVED ? 0 : x ? x.correct ? x.points : 0 : L == null ? void 0 : L.points;
|
|
585
|
+
}, [l, x, L, c, $]), se = E(() => $ || l ? "Time expired" : e.type === D.POLL ? "Time remaining" : x ? "You won" : "To win", [l, e.type, x, $]), G = x || $ || H || u === D.TRIVIA && c === k.RESOLVED && A;
|
|
586
586
|
return /* @__PURE__ */ s(ue, { "data-question-header": "true", children: /* @__PURE__ */ s(Pt, { children: /* @__PURE__ */ d(_t, { children: [
|
|
587
587
|
/* @__PURE__ */ s(
|
|
588
588
|
qt,
|
|
@@ -590,7 +590,7 @@ const Ze = /* @__PURE__ */ o("div")({
|
|
|
590
590
|
feedbackMessages: te,
|
|
591
591
|
questionVoted: !!x,
|
|
592
592
|
questionVotedCorrectly: x == null ? void 0 : x.correct,
|
|
593
|
-
questionType:
|
|
593
|
+
questionType: u,
|
|
594
594
|
hasCorrectAnswer: w,
|
|
595
595
|
questionStatus: c,
|
|
596
596
|
showExpiredNotification: $,
|
|
@@ -618,8 +618,8 @@ const Ze = /* @__PURE__ */ o("div")({
|
|
|
618
618
|
title: "More to come...",
|
|
619
619
|
description: "Watch for additional enhanced stream interactive experience."
|
|
620
620
|
}
|
|
621
|
-
) : /* @__PURE__ */ d(
|
|
622
|
-
/* @__PURE__ */ s(Yt, { "data-isPrediction": e.type === D.PREDICTION, children:
|
|
621
|
+
) : /* @__PURE__ */ d(C, { children: [
|
|
622
|
+
/* @__PURE__ */ s(Yt, { "data-isPrediction": e.type === D.PREDICTION, children: p }),
|
|
623
623
|
/* @__PURE__ */ s(Vt, { children: P.map((j) => /* @__PURE__ */ s(
|
|
624
624
|
ln,
|
|
625
625
|
{
|
|
@@ -665,15 +665,15 @@ const Ze = /* @__PURE__ */ o("div")({
|
|
|
665
665
|
}) => {
|
|
666
666
|
const h = E(() => {
|
|
667
667
|
if (e) {
|
|
668
|
-
const
|
|
669
|
-
if (he(
|
|
668
|
+
const u = new Date(e);
|
|
669
|
+
if (he(u))
|
|
670
670
|
return {
|
|
671
|
-
date: pe(
|
|
672
|
-
time: me(
|
|
671
|
+
date: pe(u),
|
|
672
|
+
time: me(u)
|
|
673
673
|
};
|
|
674
674
|
}
|
|
675
675
|
return null;
|
|
676
|
-
}, [e]),
|
|
676
|
+
}, [e]), p = (r == null ? void 0 : r.image) || t;
|
|
677
677
|
return /* @__PURE__ */ d(Sn, { children: [
|
|
678
678
|
h && /* @__PURE__ */ d(jn, { children: [
|
|
679
679
|
h.date,
|
|
@@ -681,7 +681,7 @@ const Ze = /* @__PURE__ */ o("div")({
|
|
|
681
681
|
h.time
|
|
682
682
|
] }),
|
|
683
683
|
(r == null ? void 0 : r.video) && /* @__PURE__ */ s(Ye, { source: r.video.url, poster: r.video.thumbnailUrl }),
|
|
684
|
-
|
|
684
|
+
p && !(r != null && r.video) && /* @__PURE__ */ s(bn, { src: p }),
|
|
685
685
|
/* @__PURE__ */ d(zn, { children: [
|
|
686
686
|
/* @__PURE__ */ s(xn, { children: i ? n : r == null ? void 0 : r.heading }),
|
|
687
687
|
!i && /* @__PURE__ */ s(On, { children: r == null ? void 0 : r.body })
|
|
@@ -691,13 +691,13 @@ const Ze = /* @__PURE__ */ o("div")({
|
|
|
691
691
|
name: "Container",
|
|
692
692
|
class: "c1euiow",
|
|
693
693
|
propsAsIs: !1
|
|
694
|
-
}),
|
|
694
|
+
}), kn = /* @__PURE__ */ o("a")({
|
|
695
695
|
name: "WebLinkBtn",
|
|
696
696
|
class: "w19zie3h",
|
|
697
697
|
propsAsIs: !1
|
|
698
|
-
}),
|
|
698
|
+
}), Cn = ({ instantView: e, ...t }) => /* @__PURE__ */ d(wn, { children: [
|
|
699
699
|
/* @__PURE__ */ s(qe, { instantView: e, ...t }),
|
|
700
|
-
(e == null ? void 0 : e.webLink) && /* @__PURE__ */ d(
|
|
700
|
+
(e == null ? void 0 : e.webLink) && /* @__PURE__ */ d(kn, { href: e == null ? void 0 : e.webLink.url, target: "_blank", children: [
|
|
701
701
|
"Explore more of the Masters History",
|
|
702
702
|
/* @__PURE__ */ s(b, { name: "icon-external-link" })
|
|
703
703
|
] })
|
|
@@ -742,7 +742,7 @@ const Ze = /* @__PURE__ */ o("div")({
|
|
|
742
742
|
openedQuestion: e
|
|
743
743
|
}) => {
|
|
744
744
|
var t, n;
|
|
745
|
-
return ((t = e == null ? void 0 : e.attributes) == null ? void 0 : t.attributes.case) === "insight" ? /* @__PURE__ */ s(
|
|
745
|
+
return ((t = e == null ? void 0 : e.attributes) == null ? void 0 : t.attributes.case) === "insight" ? /* @__PURE__ */ s(Cn, {
|
|
746
746
|
created: e.attributes.created,
|
|
747
747
|
...e.attributes.attributes.value
|
|
748
748
|
}) : ((n = e == null ? void 0 : e.attributes) == null ? void 0 : n.attributes.case) === "tweet" ? /* @__PURE__ */ s(Rn, {
|
|
@@ -812,7 +812,7 @@ const Ne = ({ title: e, active: t, onClick: n }) => /* @__PURE__ */ s(Vn, { onCl
|
|
|
812
812
|
/* @__PURE__ */ s(
|
|
813
813
|
Ne,
|
|
814
814
|
{
|
|
815
|
-
title: "
|
|
815
|
+
title: "Friends",
|
|
816
816
|
active: e === "leaderboard",
|
|
817
817
|
onClick: () => t(
|
|
818
818
|
"leaderboard"
|
|
@@ -861,12 +861,12 @@ function Gn(e, t) {
|
|
|
861
861
|
function oe(e, t) {
|
|
862
862
|
t === void 0 && (t = Gn);
|
|
863
863
|
var n, i = [], r, h = !1;
|
|
864
|
-
function
|
|
865
|
-
for (var
|
|
866
|
-
|
|
867
|
-
return h && n === this && t(
|
|
864
|
+
function p() {
|
|
865
|
+
for (var u = [], c = 0; c < arguments.length; c++)
|
|
866
|
+
u[c] = arguments[c];
|
|
867
|
+
return h && n === this && t(u, i) || (r = e.apply(this, u), h = !0, n = this, i = u), r;
|
|
868
868
|
}
|
|
869
|
-
return
|
|
869
|
+
return p;
|
|
870
870
|
}
|
|
871
871
|
var Zn = typeof performance == "object" && typeof performance.now == "function", De = Zn ? function() {
|
|
872
872
|
return performance.now();
|
|
@@ -908,7 +908,7 @@ var Kn = 150, Xn = function(t, n) {
|
|
|
908
908
|
return t;
|
|
909
909
|
};
|
|
910
910
|
function es(e) {
|
|
911
|
-
var t, n = e.getItemOffset, i = e.getEstimatedTotalSize, r = e.getItemSize, h = e.getOffsetForIndexAndAlignment,
|
|
911
|
+
var t, n = e.getItemOffset, i = e.getEstimatedTotalSize, r = e.getItemSize, h = e.getOffsetForIndexAndAlignment, p = e.getStartIndexForOffset, u = e.getStopIndexForStartIndex, c = e.initInstanceProps, f = e.shouldResetStyleCacheOnItemSizeChange, N = e.validateProps;
|
|
912
912
|
return t = /* @__PURE__ */ function(S) {
|
|
913
913
|
Bn(M, S);
|
|
914
914
|
function M(A) {
|
|
@@ -1103,10 +1103,10 @@ function es(e) {
|
|
|
1103
1103
|
var a = this.props, l = a.itemCount, m = a.overscanCount, I = this.state, g = I.isScrolling, y = I.scrollDirection, v = I.scrollOffset;
|
|
1104
1104
|
if (l === 0)
|
|
1105
1105
|
return [0, 0, 0, 0];
|
|
1106
|
-
var T =
|
|
1106
|
+
var T = p(this.props, v, this._instanceProps), O = u(this.props, T, v, this._instanceProps), x = !g || y === "backward" ? Math.max(1, m) : 1, w = !g || y === "forward" ? Math.max(1, m) : 1;
|
|
1107
1107
|
return [Math.max(0, T - x), Math.max(0, Math.min(l - 1, O + w)), T, O];
|
|
1108
1108
|
}, M;
|
|
1109
|
-
}(
|
|
1109
|
+
}(Ce), t.defaultProps = {
|
|
1110
1110
|
direction: "ltr",
|
|
1111
1111
|
itemData: void 0,
|
|
1112
1112
|
layout: "vertical",
|
|
@@ -1129,8 +1129,8 @@ var ts = function(t, n) {
|
|
|
1129
1129
|
var n = t.itemCount, i = t.itemSize;
|
|
1130
1130
|
return i * n;
|
|
1131
1131
|
},
|
|
1132
|
-
getOffsetForIndexAndAlignment: function(t, n, i, r, h,
|
|
1133
|
-
var
|
|
1132
|
+
getOffsetForIndexAndAlignment: function(t, n, i, r, h, p) {
|
|
1133
|
+
var u = t.direction, c = t.height, f = t.itemCount, N = t.itemSize, S = t.layout, M = t.width, z = u === "horizontal" || S === "horizontal", A = z ? M : c, a = Math.max(0, f * N - A), l = Math.min(a, n * N), m = Math.max(0, n * N - A + N + p);
|
|
1134
1134
|
switch (i === "smart" && (r >= m - A && r <= l + A ? i = "auto" : i = "center"), i) {
|
|
1135
1135
|
case "start":
|
|
1136
1136
|
return l;
|
|
@@ -1150,9 +1150,9 @@ var ts = function(t, n) {
|
|
|
1150
1150
|
return Math.max(0, Math.min(i - 1, Math.floor(n / r)));
|
|
1151
1151
|
},
|
|
1152
1152
|
getStopIndexForStartIndex: function(t, n, i) {
|
|
1153
|
-
var r = t.direction, h = t.height,
|
|
1153
|
+
var r = t.direction, h = t.height, p = t.itemCount, u = t.itemSize, c = t.layout, f = t.width, N = r === "horizontal" || c === "horizontal", S = n * u, M = N ? f : h, z = Math.ceil((M + i - S) / u);
|
|
1154
1154
|
return Math.max(0, Math.min(
|
|
1155
|
-
|
|
1155
|
+
p - 1,
|
|
1156
1156
|
n + z - 1
|
|
1157
1157
|
// -1 is because stop index is inclusive
|
|
1158
1158
|
));
|
|
@@ -1169,24 +1169,24 @@ function ss(e) {
|
|
|
1169
1169
|
return !(i > n || r < t);
|
|
1170
1170
|
}
|
|
1171
1171
|
function is(e) {
|
|
1172
|
-
for (var t = e.isItemLoaded, n = e.itemCount, i = e.minimumBatchSize, r = e.startIndex, h = e.stopIndex,
|
|
1172
|
+
for (var t = e.isItemLoaded, n = e.itemCount, i = e.minimumBatchSize, r = e.startIndex, h = e.stopIndex, p = [], u = null, c = null, f = r; f <= h; f++) {
|
|
1173
1173
|
var N = t(f);
|
|
1174
|
-
N ? c !== null && (
|
|
1174
|
+
N ? c !== null && (p.push(u, c), u = c = null) : (c = f, u === null && (u = f));
|
|
1175
1175
|
}
|
|
1176
1176
|
if (c !== null) {
|
|
1177
|
-
for (var S = Math.min(Math.max(c,
|
|
1177
|
+
for (var S = Math.min(Math.max(c, u + i - 1), n - 1), M = c + 1; M <= S && !t(M); M++)
|
|
1178
1178
|
c = M;
|
|
1179
|
-
|
|
1179
|
+
p.push(u, c);
|
|
1180
1180
|
}
|
|
1181
|
-
if (
|
|
1182
|
-
for (;
|
|
1183
|
-
var z =
|
|
1181
|
+
if (p.length)
|
|
1182
|
+
for (; p[1] - p[0] + 1 < i && p[0] > 0; ) {
|
|
1183
|
+
var z = p[0] - 1;
|
|
1184
1184
|
if (!t(z))
|
|
1185
|
-
|
|
1185
|
+
p[0] = z;
|
|
1186
1186
|
else
|
|
1187
1187
|
break;
|
|
1188
1188
|
}
|
|
1189
|
-
return
|
|
1189
|
+
return p;
|
|
1190
1190
|
}
|
|
1191
1191
|
var rs = function(e, t) {
|
|
1192
1192
|
if (!(e instanceof t))
|
|
@@ -1221,9 +1221,9 @@ var rs = function(e, t) {
|
|
|
1221
1221
|
function t() {
|
|
1222
1222
|
var n, i, r, h;
|
|
1223
1223
|
rs(this, t);
|
|
1224
|
-
for (var
|
|
1225
|
-
|
|
1226
|
-
return h = (i = (r = Oe(this, (n = t.__proto__ || Object.getPrototypeOf(t)).call.apply(n, [this].concat(
|
|
1224
|
+
for (var p = arguments.length, u = Array(p), c = 0; c < p; c++)
|
|
1225
|
+
u[c] = arguments[c];
|
|
1226
|
+
return h = (i = (r = Oe(this, (n = t.__proto__ || Object.getPrototypeOf(t)).call.apply(n, [this].concat(u))), r), r._lastRenderedStartIndex = -1, r._lastRenderedStopIndex = -1, r._memoizedUnloadedRanges = [], r._onItemsRendered = function(f) {
|
|
1227
1227
|
var N = f.visibleStartIndex, S = f.visibleStopIndex;
|
|
1228
1228
|
r._lastRenderedStartIndex = N, r._lastRenderedStopIndex = S, r._ensureRowsLoaded(N, S);
|
|
1229
1229
|
}, r._setRef = function(f) {
|
|
@@ -1252,12 +1252,12 @@ var rs = function(e, t) {
|
|
|
1252
1252
|
}, {
|
|
1253
1253
|
key: "_ensureRowsLoaded",
|
|
1254
1254
|
value: function(i, r) {
|
|
1255
|
-
var h = this.props,
|
|
1256
|
-
isItemLoaded:
|
|
1257
|
-
itemCount:
|
|
1255
|
+
var h = this.props, p = h.isItemLoaded, u = h.itemCount, c = h.minimumBatchSize, f = c === void 0 ? 10 : c, N = h.threshold, S = N === void 0 ? 15 : N, M = is({
|
|
1256
|
+
isItemLoaded: p,
|
|
1257
|
+
itemCount: u,
|
|
1258
1258
|
minimumBatchSize: f,
|
|
1259
1259
|
startIndex: Math.max(0, i - S),
|
|
1260
|
-
stopIndex: Math.min(
|
|
1260
|
+
stopIndex: Math.min(u - 1, r + S)
|
|
1261
1261
|
});
|
|
1262
1262
|
(this._memoizedUnloadedRanges.length !== M.length || this._memoizedUnloadedRanges.some(function(z, A) {
|
|
1263
1263
|
return M[A] !== z;
|
|
@@ -1266,7 +1266,7 @@ var rs = function(e, t) {
|
|
|
1266
1266
|
}, {
|
|
1267
1267
|
key: "_loadUnloadedRanges",
|
|
1268
1268
|
value: function(i) {
|
|
1269
|
-
for (var r = this, h = this.props.loadMoreItems || this.props.loadMoreRows,
|
|
1269
|
+
for (var r = this, h = this.props.loadMoreItems || this.props.loadMoreRows, p = function(f) {
|
|
1270
1270
|
var N = i[f], S = i[f + 1], M = h(N, S);
|
|
1271
1271
|
M != null && M.then(function() {
|
|
1272
1272
|
if (ss({
|
|
@@ -1280,11 +1280,11 @@ var rs = function(e, t) {
|
|
|
1280
1280
|
typeof r._listRef.resetAfterIndex == "function" ? r._listRef.resetAfterIndex(N, !0) : (typeof r._listRef._getItemStyleCache == "function" && r._listRef._getItemStyleCache(-1), r._listRef.forceUpdate());
|
|
1281
1281
|
}
|
|
1282
1282
|
});
|
|
1283
|
-
},
|
|
1284
|
-
u
|
|
1283
|
+
}, u = 0; u < i.length; u += 2)
|
|
1284
|
+
p(u);
|
|
1285
1285
|
}
|
|
1286
1286
|
}]), t;
|
|
1287
|
-
}(
|
|
1287
|
+
}(Ce);
|
|
1288
1288
|
const cs = /* @__PURE__ */ o("div")({
|
|
1289
1289
|
name: "Container",
|
|
1290
1290
|
class: "culdu4a",
|
|
@@ -1324,8 +1324,8 @@ const cs = /* @__PURE__ */ o("div")({
|
|
|
1324
1324
|
points: i,
|
|
1325
1325
|
isCurrentUser: r,
|
|
1326
1326
|
openItemDetail: h,
|
|
1327
|
-
style:
|
|
1328
|
-
}) => /* @__PURE__ */ d(cs, { onClick: h, style:
|
|
1327
|
+
style: p
|
|
1328
|
+
}) => /* @__PURE__ */ d(cs, { onClick: h, style: p, children: [
|
|
1329
1329
|
/* @__PURE__ */ s(ds, { children: e || 0 }),
|
|
1330
1330
|
/* @__PURE__ */ d(ms, { children: [
|
|
1331
1331
|
t ? /* @__PURE__ */ s(us, { alt: "leaderboard-item-avatar", src: t }) : /* @__PURE__ */ s(ps, { children: $e(n || "") }),
|
|
@@ -1347,15 +1347,15 @@ const cs = /* @__PURE__ */ o("div")({
|
|
|
1347
1347
|
}) => /* @__PURE__ */ s(Ve, { children: ({ width: r, height: h }) => /* @__PURE__ */ s(
|
|
1348
1348
|
ls,
|
|
1349
1349
|
{
|
|
1350
|
-
isItemLoaded: (
|
|
1350
|
+
isItemLoaded: (p) => p < e.length,
|
|
1351
1351
|
itemCount: e.length + 1,
|
|
1352
1352
|
loadMoreItems: i,
|
|
1353
|
-
children: ({ onItemsRendered:
|
|
1353
|
+
children: ({ onItemsRendered: p, ref: u }) => /* @__PURE__ */ s(Ms, { children: /* @__PURE__ */ s(
|
|
1354
1354
|
ns,
|
|
1355
1355
|
{
|
|
1356
1356
|
itemSize: 56,
|
|
1357
|
-
onItemsRendered:
|
|
1358
|
-
ref:
|
|
1357
|
+
onItemsRendered: p,
|
|
1358
|
+
ref: u,
|
|
1359
1359
|
itemCount: e.length,
|
|
1360
1360
|
width: r,
|
|
1361
1361
|
height: h,
|
|
@@ -1390,7 +1390,7 @@ const cs = /* @__PURE__ */ o("div")({
|
|
|
1390
1390
|
label: "X"
|
|
1391
1391
|
}
|
|
1392
1392
|
],
|
|
1393
|
-
inviteCardTitle: "It’s
|
|
1393
|
+
inviteCardTitle: "It’s More Fun With Friends",
|
|
1394
1394
|
inviteCardSubtext: "Invite and compete against your friends for the top spot on the leaderboard."
|
|
1395
1395
|
}
|
|
1396
1396
|
);
|
|
@@ -1437,11 +1437,11 @@ const cs = /* @__PURE__ */ o("div")({
|
|
|
1437
1437
|
name: "QuestionContent",
|
|
1438
1438
|
class: "q1uz5j1g",
|
|
1439
1439
|
propsAsIs: !1
|
|
1440
|
-
}),
|
|
1440
|
+
}), ks = /* @__PURE__ */ o("button")({
|
|
1441
1441
|
name: "PlayButton",
|
|
1442
1442
|
class: "p1pba9p1",
|
|
1443
1443
|
propsAsIs: !1
|
|
1444
|
-
}),
|
|
1444
|
+
}), Cs = {
|
|
1445
1445
|
[Z.LOST]: /* @__PURE__ */ s(X, { name: "incorrectVoted" }),
|
|
1446
1446
|
[Z.WON]: /* @__PURE__ */ s(X, { name: "icon-check" }),
|
|
1447
1447
|
[Z.UNSET]: /* @__PURE__ */ s(X, { name: "icon-arrow" }),
|
|
@@ -1453,10 +1453,10 @@ const cs = /* @__PURE__ */ o("div")({
|
|
|
1453
1453
|
subject: i,
|
|
1454
1454
|
openForVoting: r,
|
|
1455
1455
|
openQuestion: h,
|
|
1456
|
-
status:
|
|
1456
|
+
status: p
|
|
1457
1457
|
}) => {
|
|
1458
|
-
const
|
|
1459
|
-
return
|
|
1458
|
+
const u = be[t], c = Cs[p];
|
|
1459
|
+
return u ? /* @__PURE__ */ d(ys, { onClick: () => h == null ? void 0 : h(e), children: [
|
|
1460
1460
|
/* @__PURE__ */ d(ws, { children: [
|
|
1461
1461
|
/* @__PURE__ */ d(Ds, { children: [
|
|
1462
1462
|
/* @__PURE__ */ s(
|
|
@@ -1464,17 +1464,17 @@ const cs = /* @__PURE__ */ o("div")({
|
|
|
1464
1464
|
{
|
|
1465
1465
|
"data-type-trivia": t === D.TRIVIA,
|
|
1466
1466
|
"data-type-poll": t === D.POLL,
|
|
1467
|
-
name:
|
|
1467
|
+
name: u.iconName
|
|
1468
1468
|
}
|
|
1469
1469
|
),
|
|
1470
1470
|
/* @__PURE__ */ d(bs, { children: [
|
|
1471
|
-
|
|
1472
|
-
t === D.TRIVIA && n ===
|
|
1471
|
+
u.label,
|
|
1472
|
+
t === D.TRIVIA && n === k.RESOLVED && " • Expired"
|
|
1473
1473
|
] })
|
|
1474
1474
|
] }),
|
|
1475
1475
|
/* @__PURE__ */ s(Ss, { children: i || "" })
|
|
1476
1476
|
] }),
|
|
1477
|
-
/* @__PURE__ */ s(zs, { children: r ? /* @__PURE__ */ s(
|
|
1477
|
+
/* @__PURE__ */ s(zs, { children: r ? /* @__PURE__ */ s(ks, { children: "Play" }) : c })
|
|
1478
1478
|
] }) : null;
|
|
1479
1479
|
}, Ls = /* @__PURE__ */ o("div")({
|
|
1480
1480
|
name: "Container",
|
|
@@ -1540,16 +1540,16 @@ const cs = /* @__PURE__ */ o("div")({
|
|
|
1540
1540
|
}), Ws = ({ questions: e, openQuestion: t }) => /* @__PURE__ */ s(Vs, { children: e == null ? void 0 : e.map((n) => {
|
|
1541
1541
|
var i, r, h;
|
|
1542
1542
|
if (n.type === "question" && ((i = n.attributes) == null ? void 0 : i.attributes.case) === "question") {
|
|
1543
|
-
const
|
|
1544
|
-
return /* @__PURE__ */ s(Es, { openQuestion: t, ...
|
|
1543
|
+
const p = n.attributes.attributes.value;
|
|
1544
|
+
return /* @__PURE__ */ s(Es, { openQuestion: t, ...p }, p.questionId);
|
|
1545
1545
|
}
|
|
1546
1546
|
if (n.type === "insight" && ((r = n.attributes) == null ? void 0 : r.attributes.case) === "insight") {
|
|
1547
|
-
const
|
|
1548
|
-
return /* @__PURE__ */ s(Rs, { openInsight: t, ...u },
|
|
1547
|
+
const p = n.attributes.attributes.value, u = n.attributes.created;
|
|
1548
|
+
return /* @__PURE__ */ s(Rs, { openInsight: t, ...p, created: u }, p.questionId);
|
|
1549
1549
|
}
|
|
1550
1550
|
if (n.type === "tweet" && ((h = n.attributes) == null ? void 0 : h.attributes.case) === "tweet") {
|
|
1551
|
-
const
|
|
1552
|
-
return /* @__PURE__ */ s(Ys, { openTweet: t, ...
|
|
1551
|
+
const p = n.attributes.attributes.value, u = n.attributes.id, c = n.attributes.created;
|
|
1552
|
+
return /* @__PURE__ */ s(Ys, { openTweet: t, ...p, tweetId: u, created: c }, u);
|
|
1553
1553
|
}
|
|
1554
1554
|
return null;
|
|
1555
1555
|
}) }), Fs = ({ store: e, openQuestion: t }) => {
|
|
@@ -1558,7 +1558,7 @@ const cs = /* @__PURE__ */ o("div")({
|
|
|
1558
1558
|
}, Bs = ({ userSummary: e }) => {
|
|
1559
1559
|
var t;
|
|
1560
1560
|
const [n, i] = R(void 0);
|
|
1561
|
-
return
|
|
1561
|
+
return ke(() => {
|
|
1562
1562
|
const r = e.subscribe((h) => {
|
|
1563
1563
|
h != null && h.data && i(h.data);
|
|
1564
1564
|
});
|
|
@@ -1625,7 +1625,7 @@ const cs = /* @__PURE__ */ o("div")({
|
|
|
1625
1625
|
className: t
|
|
1626
1626
|
}) => {
|
|
1627
1627
|
const n = q(e.openedQuestion.$store), i = q(e.openedUser);
|
|
1628
|
-
return /* @__PURE__ */ d(
|
|
1628
|
+
return /* @__PURE__ */ d(C, {
|
|
1629
1629
|
children: [n && /* @__PURE__ */ s(je, {
|
|
1630
1630
|
className: t,
|
|
1631
1631
|
children: /* @__PURE__ */ s(Pn, {
|