@streamlayer/react 0.31.0 → 0.31.2
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.
|
@@ -2,18 +2,18 @@ import { jsxs as p, jsx as s, Fragment as b } from "react/jsx-runtime";
|
|
|
2
2
|
import { s as o, i as j } from "./index4.js";
|
|
3
3
|
import { useStore as k } from "@nanostores/react";
|
|
4
4
|
import { o as Ne, r as te, w as $e, A as Re, O as Qe, a as K, n as Ue, d as _e } from "./masters2.js";
|
|
5
|
-
import { useState as R, useCallback as F, useMemo as W, createElement as H, PureComponent as
|
|
5
|
+
import { useState as R, useCallback as F, useMemo as W, createElement as H, PureComponent as ye } from "react";
|
|
6
6
|
import { QuestionType as x, QuestionStatus as Q, QuestionImages as $, PickHistoryStatus as q } from "@streamlayer/sdk-web-types";
|
|
7
7
|
import { m as qe } from "./index3.js";
|
|
8
8
|
import "react-countup";
|
|
9
|
-
import { CountdownCircleTimer as
|
|
9
|
+
import { CountdownCircleTimer as Pe } from "react-countdown-circle-timer";
|
|
10
10
|
import { E } from "./index2.js";
|
|
11
11
|
import "@streamlayer/sdk-web-interfaces";
|
|
12
12
|
import "@streamlayer/sdk-web-notifications";
|
|
13
13
|
import "@lottiefiles/react-lottie-player";
|
|
14
14
|
import "./useStreamLayerApp.js";
|
|
15
15
|
import "@streamlayer/sdk-web";
|
|
16
|
-
const
|
|
16
|
+
const Ye = /* @__PURE__ */ o("div")({
|
|
17
17
|
name: "Container",
|
|
18
18
|
class: "c1vwopgc",
|
|
19
19
|
propsAsIs: !1
|
|
@@ -37,9 +37,9 @@ const Pe = /* @__PURE__ */ o("div")({
|
|
|
37
37
|
name: "CloseIcon",
|
|
38
38
|
class: "cvsl7l3",
|
|
39
39
|
propsAsIs: !0
|
|
40
|
-
}),
|
|
40
|
+
}), Ae = ({ type: e, close: t, label: n }) => {
|
|
41
41
|
const i = e ? Ne[e] : { label: n, iconName: void 0 };
|
|
42
|
-
return /* @__PURE__ */ p(
|
|
42
|
+
return /* @__PURE__ */ p(Ye, { children: [
|
|
43
43
|
/* @__PURE__ */ p(We, { children: [
|
|
44
44
|
(i == null ? void 0 : i.iconName) && /* @__PURE__ */ s(Fe, { name: i.iconName }),
|
|
45
45
|
(i == null ? void 0 : i.label) && /* @__PURE__ */ s(Be, { children: i.label })
|
|
@@ -80,7 +80,7 @@ const Pe = /* @__PURE__ */ o("div")({
|
|
|
80
80
|
name: "Title",
|
|
81
81
|
class: "t8s05oq",
|
|
82
82
|
propsAsIs: !1
|
|
83
|
-
}),
|
|
83
|
+
}), P = ({ indicator: e, title: t }) => /* @__PURE__ */ p(st, { children: [
|
|
84
84
|
/* @__PURE__ */ s(it, { children: e }),
|
|
85
85
|
/* @__PURE__ */ s(rt, { children: t })
|
|
86
86
|
] }), ot = /* @__PURE__ */ o("div")({
|
|
@@ -123,11 +123,11 @@ const Pe = /* @__PURE__ */ o("div")({
|
|
|
123
123
|
name: "Rts",
|
|
124
124
|
class: "r2vgnxv",
|
|
125
125
|
propsAsIs: !1
|
|
126
|
-
}),
|
|
126
|
+
}), gt = /* @__PURE__ */ o("div")({
|
|
127
127
|
name: "RtsIndicator",
|
|
128
128
|
class: "roqn06j",
|
|
129
129
|
propsAsIs: !1
|
|
130
|
-
}),
|
|
130
|
+
}), ft = /* @__PURE__ */ o("div")({
|
|
131
131
|
name: "RtsLabel",
|
|
132
132
|
class: "r15adx7c",
|
|
133
133
|
propsAsIs: !1
|
|
@@ -143,11 +143,11 @@ const Pe = /* @__PURE__ */ o("div")({
|
|
|
143
143
|
name: "Statistics",
|
|
144
144
|
class: "s1knfgqt",
|
|
145
145
|
propsAsIs: !1
|
|
146
|
-
}),
|
|
146
|
+
}), yt = /* @__PURE__ */ o("div")({
|
|
147
147
|
name: "AvatarPlaceholder",
|
|
148
148
|
class: "a1mqo824",
|
|
149
149
|
propsAsIs: !1
|
|
150
|
-
}),
|
|
150
|
+
}), At = /* @__PURE__ */ o("button")({
|
|
151
151
|
name: "UserAccountBtn",
|
|
152
152
|
class: "uxareh6",
|
|
153
153
|
propsAsIs: !1
|
|
@@ -157,31 +157,31 @@ const Pe = /* @__PURE__ */ o("div")({
|
|
|
157
157
|
points: n,
|
|
158
158
|
friendsRank: i,
|
|
159
159
|
rank: r,
|
|
160
|
-
streak:
|
|
161
|
-
correct:
|
|
162
|
-
incorrect:
|
|
163
|
-
inTop:
|
|
160
|
+
streak: m,
|
|
161
|
+
correct: c,
|
|
162
|
+
incorrect: I,
|
|
163
|
+
inTop: u,
|
|
164
164
|
successRate: h
|
|
165
165
|
}) => /* @__PURE__ */ p(ot, { children: [
|
|
166
166
|
/* @__PURE__ */ s(at, { children: /* @__PURE__ */ p(ct, { children: [
|
|
167
|
-
/* @__PURE__ */ p(
|
|
167
|
+
/* @__PURE__ */ p(At, { children: [
|
|
168
168
|
e && /* @__PURE__ */ s(dt, { alt: "avatar", src: e }),
|
|
169
|
-
!e && /* @__PURE__ */ s(
|
|
169
|
+
!e && /* @__PURE__ */ s(yt, { children: Te(t || "") })
|
|
170
170
|
] }),
|
|
171
171
|
/* @__PURE__ */ p(ut, { children: [
|
|
172
172
|
/* @__PURE__ */ s(pt, { children: t }),
|
|
173
173
|
/* @__PURE__ */ p(mt, { children: [
|
|
174
174
|
/* @__PURE__ */ p(ht, { children: [
|
|
175
175
|
/* @__PURE__ */ s(It, { alt: "rank-icon", src: Tt }),
|
|
176
|
-
/* @__PURE__ */ p(
|
|
176
|
+
/* @__PURE__ */ p(gt, { children: [
|
|
177
177
|
De(n),
|
|
178
|
-
/* @__PURE__ */ s(
|
|
178
|
+
/* @__PURE__ */ s(ft, { children: "PTS" })
|
|
179
179
|
] })
|
|
180
180
|
] }),
|
|
181
181
|
/* @__PURE__ */ s(Mt, {}),
|
|
182
182
|
/* @__PURE__ */ p("div", { children: [
|
|
183
183
|
"TOP ",
|
|
184
|
-
|
|
184
|
+
u || 0,
|
|
185
185
|
"%"
|
|
186
186
|
] })
|
|
187
187
|
] })
|
|
@@ -193,10 +193,10 @@ const Pe = /* @__PURE__ */ o("div")({
|
|
|
193
193
|
/* @__PURE__ */ s(oe, { indicator: r || 0, title: "Global rank" })
|
|
194
194
|
] }),
|
|
195
195
|
/* @__PURE__ */ p(Nt, { children: [
|
|
196
|
-
/* @__PURE__ */ s(
|
|
197
|
-
/* @__PURE__ */ s(
|
|
198
|
-
/* @__PURE__ */ s(
|
|
199
|
-
/* @__PURE__ */ s(
|
|
196
|
+
/* @__PURE__ */ s(P, { indicator: m || 0, title: "Win streak" }),
|
|
197
|
+
/* @__PURE__ */ s(P, { indicator: c || 0, title: "Correct" }),
|
|
198
|
+
/* @__PURE__ */ s(P, { indicator: I || 0, title: "Incorrect" }),
|
|
199
|
+
/* @__PURE__ */ s(P, { indicator: `${h || 0}%`, title: "Succ. rate" })
|
|
200
200
|
] })
|
|
201
201
|
] })
|
|
202
202
|
] }), Dt = /* @__PURE__ */ o("div")({
|
|
@@ -249,28 +249,28 @@ const Pe = /* @__PURE__ */ o("div")({
|
|
|
249
249
|
questionVoted: n,
|
|
250
250
|
questionType: i,
|
|
251
251
|
hasCorrectAnswer: r,
|
|
252
|
-
questionStatus:
|
|
252
|
+
questionStatus: m
|
|
253
253
|
}) => {
|
|
254
|
-
const
|
|
255
|
-
if (!
|
|
254
|
+
const c = n && (i === x.TRIVIA || i === x.PREDICTION);
|
|
255
|
+
if (!c && m !== Q.RESOLVED)
|
|
256
256
|
return null;
|
|
257
|
-
const
|
|
258
|
-
return /* @__PURE__ */ p(jt, { "data-isPrediction":
|
|
259
|
-
|
|
257
|
+
const I = i === x.PREDICTION && !r, u = t ? "correct" : "incorrect", h = t ? e.correctFeedback : e.incorrectFeedback;
|
|
258
|
+
return /* @__PURE__ */ p(jt, { "data-isPrediction": I, children: [
|
|
259
|
+
m === Q.RESOLVED && i === x.TRIVIA && !n && /* @__PURE__ */ p(b, { children: [
|
|
260
260
|
/* @__PURE__ */ s(ae, { children: /* @__PURE__ */ s(j, { name: "questionExpired" }) }),
|
|
261
261
|
/* @__PURE__ */ p("div", { children: [
|
|
262
262
|
/* @__PURE__ */ s(le, { children: /* @__PURE__ */ s(Z, { children: "Question Expired" }) }),
|
|
263
263
|
/* @__PURE__ */ s(wt, { children: "You can still answer to see if you're correct, but no points are awarded for expired questions." })
|
|
264
264
|
] })
|
|
265
265
|
] }),
|
|
266
|
-
|
|
266
|
+
c && I && /* @__PURE__ */ p(b, { children: [
|
|
267
267
|
/* @__PURE__ */ s(Ct, { name: "icon-prediction" }),
|
|
268
268
|
/* @__PURE__ */ s(Z, { children: "Stay tuned to see if your prediction was correct." })
|
|
269
269
|
] }),
|
|
270
|
-
|
|
271
|
-
/* @__PURE__ */ s(ae, { "data-feedbackType":
|
|
270
|
+
c && r && /* @__PURE__ */ p(b, { children: [
|
|
271
|
+
/* @__PURE__ */ s(ae, { "data-feedbackType": u, children: /* @__PURE__ */ s(j, { name: u }) }),
|
|
272
272
|
/* @__PURE__ */ s("div", { children: /* @__PURE__ */ p(le, { children: [
|
|
273
|
-
/* @__PURE__ */ s(kt, { "data-feedbackType":
|
|
273
|
+
/* @__PURE__ */ s(kt, { "data-feedbackType": u, children: h == null ? void 0 : h.title }),
|
|
274
274
|
/* @__PURE__ */ s(Z, { children: h == null ? void 0 : h.description })
|
|
275
275
|
] }) })
|
|
276
276
|
] })
|
|
@@ -307,7 +307,7 @@ const Pe = /* @__PURE__ */ o("div")({
|
|
|
307
307
|
name: "IconContainer",
|
|
308
308
|
class: "i1j65z51",
|
|
309
309
|
propsAsIs: !1
|
|
310
|
-
}),
|
|
310
|
+
}), Pt = /* @__PURE__ */ o("div")({
|
|
311
311
|
name: "IconWrap",
|
|
312
312
|
class: "i19tpfua",
|
|
313
313
|
propsAsIs: !1
|
|
@@ -315,7 +315,7 @@ const Pe = /* @__PURE__ */ o("div")({
|
|
|
315
315
|
name: "Icon",
|
|
316
316
|
class: "i1tubmma",
|
|
317
317
|
propsAsIs: !1
|
|
318
|
-
}),
|
|
318
|
+
}), Yt = () => ze, Wt = /* @__PURE__ */ o(Yt())({
|
|
319
319
|
name: "IconDefault",
|
|
320
320
|
class: "i1grrgwj",
|
|
321
321
|
propsAsIs: !0
|
|
@@ -341,7 +341,7 @@ const Pe = /* @__PURE__ */ o("div")({
|
|
|
341
341
|
propsAsIs: !0
|
|
342
342
|
}), ce = {
|
|
343
343
|
[$.CENTERED]: (e) => /* @__PURE__ */ s(Wt, { alt: "option-icon", src: e }),
|
|
344
|
-
[$.TRANSPARENT]: (e) => /* @__PURE__ */ s(qt, { children: /* @__PURE__ */ s(
|
|
344
|
+
[$.TRANSPARENT]: (e) => /* @__PURE__ */ s(qt, { children: /* @__PURE__ */ s(Pt, { style: { backgroundImage: `url(${e})` } }) }),
|
|
345
345
|
[$.ROUNDED]: (e) => /* @__PURE__ */ s(Ft, { alt: "option-icon", src: e }),
|
|
346
346
|
[$.NONE]: () => null,
|
|
347
347
|
[$.UNSET]: () => null
|
|
@@ -368,36 +368,36 @@ const Pe = /* @__PURE__ */ o("div")({
|
|
|
368
368
|
id: n,
|
|
369
369
|
icon: i,
|
|
370
370
|
text: r,
|
|
371
|
-
percentageDecimal:
|
|
371
|
+
percentageDecimal: m,
|
|
372
372
|
// extra props
|
|
373
|
-
onVote:
|
|
374
|
-
youSelected:
|
|
375
|
-
questionVoted:
|
|
373
|
+
onVote: c,
|
|
374
|
+
youSelected: I,
|
|
375
|
+
questionVoted: u,
|
|
376
376
|
// ToDo: Figure out why imageMode is not in the response, and delete default value
|
|
377
377
|
imageMode: h,
|
|
378
|
-
answerTimeExpired:
|
|
378
|
+
answerTimeExpired: y,
|
|
379
379
|
questionStatus: D,
|
|
380
380
|
isLoading: N,
|
|
381
|
-
questionType:
|
|
381
|
+
questionType: A,
|
|
382
382
|
correct: T,
|
|
383
383
|
hasCorrectAnswer: a
|
|
384
|
-
} = e, l = Kt(e),
|
|
384
|
+
} = e, l = Kt(e), d = Xt({ questionType: A, questionVoted: u, correct: T, hasCorrectAnswer: a, questionStatus: D }), g = u || D === Q.RESOLVED && A === x.PREDICTION;
|
|
385
385
|
return /* @__PURE__ */ p(
|
|
386
386
|
Qt,
|
|
387
387
|
{
|
|
388
388
|
value: n,
|
|
389
|
-
"data-selected":
|
|
389
|
+
"data-selected": I,
|
|
390
390
|
"data-answerState": l,
|
|
391
|
-
disabled:
|
|
392
|
-
onClick:
|
|
391
|
+
disabled: u || N || y,
|
|
392
|
+
onClick: c,
|
|
393
393
|
children: [
|
|
394
|
-
|
|
394
|
+
g && /* @__PURE__ */ s(Ut, { "data-answerState": l, style: { width: `${m}%` } }),
|
|
395
395
|
/* @__PURE__ */ p(_t, { children: [
|
|
396
396
|
i && h && ((t = ce[h]) == null ? void 0 : t.call(ce, i)),
|
|
397
397
|
/* @__PURE__ */ s(Bt, { children: r }),
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
/* @__PURE__ */ s(Zt, { children: /* @__PURE__ */ s(qe, { value:
|
|
398
|
+
g && /* @__PURE__ */ p(Ht, { children: [
|
|
399
|
+
d && /* @__PURE__ */ s(Jt, { name: "selected" }),
|
|
400
|
+
/* @__PURE__ */ s(Zt, { children: /* @__PURE__ */ s(qe, { value: m, suffix: "%" }) })
|
|
401
401
|
] })
|
|
402
402
|
] })
|
|
403
403
|
]
|
|
@@ -412,16 +412,16 @@ const Pe = /* @__PURE__ */ o("div")({
|
|
|
412
412
|
duration: t = 30,
|
|
413
413
|
onTimerExpired: n
|
|
414
414
|
}) => {
|
|
415
|
-
const [i, r] = R(t > 10 ? rn : de),
|
|
416
|
-
remainingTime:
|
|
415
|
+
const [i, r] = R(t > 10 ? rn : de), m = ({
|
|
416
|
+
remainingTime: u
|
|
417
417
|
}) => /* @__PURE__ */ s(sn, {
|
|
418
|
-
children:
|
|
419
|
-
}),
|
|
418
|
+
children: u
|
|
419
|
+
}), c = F(() => {
|
|
420
420
|
n == null || n(), r(on);
|
|
421
|
-
}, [n, r]),
|
|
422
|
-
|
|
421
|
+
}, [n, r]), I = F((u) => {
|
|
422
|
+
u === 10 && r(de);
|
|
423
423
|
}, [r]);
|
|
424
|
-
return /* @__PURE__ */ s(
|
|
424
|
+
return /* @__PURE__ */ s(Pe, {
|
|
425
425
|
isPlaying: e,
|
|
426
426
|
duration: t,
|
|
427
427
|
colors: tn,
|
|
@@ -430,9 +430,9 @@ const Pe = /* @__PURE__ */ o("div")({
|
|
|
430
430
|
strokeWidth: 2,
|
|
431
431
|
trailStrokeWidth: 2,
|
|
432
432
|
trailColor: i,
|
|
433
|
-
onComplete:
|
|
434
|
-
onUpdate:
|
|
435
|
-
children:
|
|
433
|
+
onComplete: c,
|
|
434
|
+
onUpdate: I,
|
|
435
|
+
children: m
|
|
436
436
|
});
|
|
437
437
|
}, ln = /* @__PURE__ */ o("div")({
|
|
438
438
|
name: "WinBarContainer",
|
|
@@ -462,10 +462,18 @@ const Pe = /* @__PURE__ */ o("div")({
|
|
|
462
462
|
name: "PointsUnits",
|
|
463
463
|
class: "pe5g05h",
|
|
464
464
|
propsAsIs: !1
|
|
465
|
-
}),
|
|
465
|
+
}), gn = ({
|
|
466
|
+
title: e,
|
|
467
|
+
points: t,
|
|
468
|
+
isPlayingTimer: n,
|
|
469
|
+
isTimer: i,
|
|
470
|
+
questionType: r,
|
|
471
|
+
timerDuration: m,
|
|
472
|
+
onTimerExpired: c
|
|
473
|
+
}) => /* @__PURE__ */ p(ln, { children: [
|
|
466
474
|
/* @__PURE__ */ p(cn, { children: [
|
|
467
475
|
e && /* @__PURE__ */ s(dn, { children: e }),
|
|
468
|
-
t !== void 0 && /* @__PURE__ */ p(b, { children: [
|
|
476
|
+
t !== void 0 && r !== x.POLL && /* @__PURE__ */ p(b, { children: [
|
|
469
477
|
/* @__PURE__ */ s(pn, { name: "icon-trophy" }),
|
|
470
478
|
/* @__PURE__ */ p(mn, { children: [
|
|
471
479
|
/* @__PURE__ */ s(In, { children: t }),
|
|
@@ -473,41 +481,41 @@ const Pe = /* @__PURE__ */ o("div")({
|
|
|
473
481
|
] })
|
|
474
482
|
] })
|
|
475
483
|
] }),
|
|
476
|
-
i && /* @__PURE__ */ s(an, { isPlaying: n, onTimerExpired:
|
|
477
|
-
] }),
|
|
484
|
+
i && /* @__PURE__ */ s(an, { isPlaying: n, onTimerExpired: c, duration: m })
|
|
485
|
+
] }), fn = ({ openedQuestion: e, vote: t, close: n }) => {
|
|
478
486
|
var i;
|
|
479
|
-
const r = e.subject,
|
|
487
|
+
const r = e.subject, m = e.type, c = (i = e.options) == null ? void 0 : i.options, [I, u] = R(!1), [h, y] = R(!1), [D, N] = R(""), A = e == null ? void 0 : e.id, T = F(
|
|
480
488
|
async (v) => {
|
|
481
|
-
if (
|
|
482
|
-
const
|
|
483
|
-
N(
|
|
489
|
+
if (A) {
|
|
490
|
+
const f = v.currentTarget.value;
|
|
491
|
+
N(f), y(!0), await t(A, f), y(!1);
|
|
484
492
|
}
|
|
485
493
|
},
|
|
486
|
-
[
|
|
494
|
+
[A, N, t]
|
|
487
495
|
), a = F(() => {
|
|
488
|
-
|
|
496
|
+
u(!0), setTimeout(n, 3e3);
|
|
489
497
|
}, [n]), l = W(
|
|
490
498
|
() => e == null ? void 0 : e.answers.find((v) => v.youVoted === !0),
|
|
491
499
|
[e]
|
|
492
|
-
),
|
|
500
|
+
), d = W(
|
|
493
501
|
() => !!(e != null && e.answers.find((v) => v.correct === !0)),
|
|
494
502
|
[e]
|
|
495
|
-
),
|
|
496
|
-
var
|
|
503
|
+
), g = W(() => e ? e.answers.map((v) => {
|
|
504
|
+
var f;
|
|
497
505
|
return {
|
|
498
506
|
...v,
|
|
499
507
|
questionVoted: !!l,
|
|
500
508
|
youSelected: D === v.id,
|
|
501
509
|
isLoading: h,
|
|
502
|
-
hasCorrectAnswer:
|
|
510
|
+
hasCorrectAnswer: d,
|
|
503
511
|
questionType: e.type,
|
|
504
|
-
answerTimeExpired:
|
|
512
|
+
answerTimeExpired: I,
|
|
505
513
|
questionStatus: e.status,
|
|
506
|
-
imageMode: (
|
|
514
|
+
imageMode: (f = e.appearance) == null ? void 0 : f.images,
|
|
507
515
|
// ToDo: Figure out why imageMode is not in the response
|
|
508
516
|
onVote: T
|
|
509
517
|
};
|
|
510
|
-
}) : [], [
|
|
518
|
+
}) : [], [d, I, h, e, l, T, D]), M = c && (c.case === "trivia" || c.case === "prediction") ? c.value : void 0;
|
|
511
519
|
return /* @__PURE__ */ s(te, { "data-question-header": "true", children: /* @__PURE__ */ s(Et, { children: /* @__PURE__ */ p(Lt, { children: [
|
|
512
520
|
M && /* @__PURE__ */ s(
|
|
513
521
|
bt,
|
|
@@ -515,21 +523,24 @@ const Pe = /* @__PURE__ */ o("div")({
|
|
|
515
523
|
feedbackMessages: M,
|
|
516
524
|
questionVoted: !!l,
|
|
517
525
|
questionVotedCorrectly: l == null ? void 0 : l.correct,
|
|
518
|
-
questionType:
|
|
519
|
-
hasCorrectAnswer:
|
|
526
|
+
questionType: m,
|
|
527
|
+
hasCorrectAnswer: d,
|
|
520
528
|
questionStatus: e.status
|
|
521
529
|
}
|
|
522
530
|
),
|
|
523
531
|
e.type !== x.PREDICTION && /* @__PURE__ */ s(
|
|
524
|
-
|
|
532
|
+
gn,
|
|
525
533
|
{
|
|
526
|
-
title:
|
|
527
|
-
points:
|
|
534
|
+
title: I ? "Time expired" : e.type === x.POLL ? "Time remaining" : "To win",
|
|
535
|
+
points: I ? void 0 : 100,
|
|
528
536
|
onTimerExpired: a,
|
|
529
|
-
|
|
537
|
+
questionType: e.type,
|
|
538
|
+
isTimer: !0,
|
|
539
|
+
isPlayingTimer: !l,
|
|
540
|
+
timerDuration: l ? 0 : 30
|
|
530
541
|
}
|
|
531
542
|
),
|
|
532
|
-
|
|
543
|
+
I ? /* @__PURE__ */ s(
|
|
533
544
|
xt,
|
|
534
545
|
{
|
|
535
546
|
title: "More to come...",
|
|
@@ -537,7 +548,7 @@ const Pe = /* @__PURE__ */ o("div")({
|
|
|
537
548
|
}
|
|
538
549
|
) : /* @__PURE__ */ p(b, { children: [
|
|
539
550
|
/* @__PURE__ */ s($t, { "data-isPrediction": e.type === x.PREDICTION, children: r }),
|
|
540
|
-
/* @__PURE__ */ s(Rt, { children:
|
|
551
|
+
/* @__PURE__ */ s(Rt, { children: g.map((v) => /* @__PURE__ */ s(en, { ...v }, v.id)) })
|
|
541
552
|
] })
|
|
542
553
|
] }) }) });
|
|
543
554
|
}, Mn = /* @__PURE__ */ o("div")({
|
|
@@ -552,11 +563,11 @@ const Pe = /* @__PURE__ */ o("div")({
|
|
|
552
563
|
name: "Title",
|
|
553
564
|
class: "t5et2jt",
|
|
554
565
|
propsAsIs: !1
|
|
555
|
-
}),
|
|
566
|
+
}), yn = /* @__PURE__ */ o("div")({
|
|
556
567
|
name: "Description",
|
|
557
568
|
class: "d1i2kpk2",
|
|
558
569
|
propsAsIs: !1
|
|
559
|
-
}),
|
|
570
|
+
}), An = /* @__PURE__ */ o("div")({
|
|
560
571
|
name: "DateWrap",
|
|
561
572
|
class: "dd3lh3p",
|
|
562
573
|
propsAsIs: !1
|
|
@@ -567,26 +578,26 @@ const Pe = /* @__PURE__ */ o("div")({
|
|
|
567
578
|
}), xe = ({ created: e, image: t, title: n, instantView: i }) => {
|
|
568
579
|
const r = W(() => {
|
|
569
580
|
if (e) {
|
|
570
|
-
const
|
|
571
|
-
if (Xe(
|
|
581
|
+
const c = new Date(e);
|
|
582
|
+
if (Xe(c))
|
|
572
583
|
return {
|
|
573
|
-
date: Je(
|
|
574
|
-
time: Ke(
|
|
584
|
+
date: Je(c),
|
|
585
|
+
time: Ke(c)
|
|
575
586
|
};
|
|
576
587
|
}
|
|
577
588
|
return null;
|
|
578
|
-
}, [e]),
|
|
589
|
+
}, [e]), m = (i == null ? void 0 : i.image) || t;
|
|
579
590
|
return /* @__PURE__ */ p(Mn, { children: [
|
|
580
|
-
r && /* @__PURE__ */ p(
|
|
591
|
+
r && /* @__PURE__ */ p(An, { children: [
|
|
581
592
|
r.date,
|
|
582
593
|
" · ",
|
|
583
594
|
r.time
|
|
584
595
|
] }),
|
|
585
596
|
(i == null ? void 0 : i.video) && /* @__PURE__ */ s($e, { source: i.video.url, poster: i.video.thumbnailUrl }),
|
|
586
|
-
|
|
597
|
+
m && /* @__PURE__ */ s(Tn, { src: m }),
|
|
587
598
|
/* @__PURE__ */ p(vn, { children: [
|
|
588
599
|
/* @__PURE__ */ s(Nn, { children: (i == null ? void 0 : i.heading) || n }),
|
|
589
|
-
/* @__PURE__ */ s(
|
|
600
|
+
/* @__PURE__ */ s(yn, { children: i == null ? void 0 : i.body })
|
|
590
601
|
] })
|
|
591
602
|
] });
|
|
592
603
|
}, Dn = /* @__PURE__ */ o("div")({
|
|
@@ -624,7 +635,7 @@ const Pe = /* @__PURE__ */ o("div")({
|
|
|
624
635
|
loading: i,
|
|
625
636
|
data: r
|
|
626
637
|
} = e;
|
|
627
|
-
return !i && r ? /* @__PURE__ */ s(
|
|
638
|
+
return !i && r ? /* @__PURE__ */ s(fn, {
|
|
628
639
|
vote: t,
|
|
629
640
|
close: n,
|
|
630
641
|
openedQuestion: r
|
|
@@ -638,7 +649,7 @@ const Pe = /* @__PURE__ */ o("div")({
|
|
|
638
649
|
return null;
|
|
639
650
|
const r = n.type;
|
|
640
651
|
return /* @__PURE__ */ p(xn, {
|
|
641
|
-
children: [/* @__PURE__ */ s(
|
|
652
|
+
children: [/* @__PURE__ */ s(Ae, {
|
|
642
653
|
close: e.closeQuestion,
|
|
643
654
|
type: ((t = n.attributes) == null ? void 0 : t.type) || x.UNSET
|
|
644
655
|
}), r === "question" && /* @__PURE__ */ s(On, {
|
|
@@ -723,13 +734,13 @@ function Qn(e, t) {
|
|
|
723
734
|
}
|
|
724
735
|
function G(e, t) {
|
|
725
736
|
t === void 0 && (t = Qn);
|
|
726
|
-
var n, i = [], r,
|
|
727
|
-
function
|
|
728
|
-
for (var
|
|
729
|
-
|
|
730
|
-
return
|
|
737
|
+
var n, i = [], r, m = !1;
|
|
738
|
+
function c() {
|
|
739
|
+
for (var I = [], u = 0; u < arguments.length; u++)
|
|
740
|
+
I[u] = arguments[u];
|
|
741
|
+
return m && n === this && t(I, i) || (r = e.apply(this, I), m = !0, n = this, i = I), r;
|
|
731
742
|
}
|
|
732
|
-
return
|
|
743
|
+
return c;
|
|
733
744
|
}
|
|
734
745
|
var Un = typeof performance == "object" && typeof performance.now == "function", Ie = Un ? function() {
|
|
735
746
|
return performance.now();
|
|
@@ -750,7 +761,7 @@ function _n(e, t) {
|
|
|
750
761
|
return r;
|
|
751
762
|
}
|
|
752
763
|
var J = -1;
|
|
753
|
-
function
|
|
764
|
+
function ge(e) {
|
|
754
765
|
if (e === void 0 && (e = !1), J === -1 || e) {
|
|
755
766
|
var t = document.createElement("div"), n = t.style;
|
|
756
767
|
n.width = "50px", n.height = "50px", n.overflow = "scroll", document.body.appendChild(t), J = t.offsetWidth - t.clientWidth, document.body.removeChild(t);
|
|
@@ -758,7 +769,7 @@ function fe(e) {
|
|
|
758
769
|
return J;
|
|
759
770
|
}
|
|
760
771
|
var w = null;
|
|
761
|
-
function
|
|
772
|
+
function fe(e) {
|
|
762
773
|
if (e === void 0 && (e = !1), w === null || e) {
|
|
763
774
|
var t = document.createElement("div"), n = t.style;
|
|
764
775
|
n.width = "50px", n.height = "50px", n.overflow = "scroll", n.direction = "rtl";
|
|
@@ -767,41 +778,41 @@ function ge(e) {
|
|
|
767
778
|
}
|
|
768
779
|
return w;
|
|
769
780
|
}
|
|
770
|
-
var qn = 150,
|
|
781
|
+
var qn = 150, Pn = function(t, n) {
|
|
771
782
|
return t;
|
|
772
783
|
};
|
|
773
|
-
function
|
|
774
|
-
var t, n = e.getItemOffset, i = e.getEstimatedTotalSize, r = e.getItemSize,
|
|
784
|
+
function Yn(e) {
|
|
785
|
+
var t, n = e.getItemOffset, i = e.getEstimatedTotalSize, r = e.getItemSize, m = e.getOffsetForIndexAndAlignment, c = e.getStartIndexForOffset, I = e.getStopIndexForStartIndex, u = e.initInstanceProps, h = e.shouldResetStyleCacheOnItemSizeChange, y = e.validateProps;
|
|
775
786
|
return t = /* @__PURE__ */ function(D) {
|
|
776
787
|
$n(N, D);
|
|
777
788
|
function N(T) {
|
|
778
789
|
var a;
|
|
779
|
-
return a = D.call(this, T) || this, a._instanceProps =
|
|
790
|
+
return a = D.call(this, T) || this, a._instanceProps = u(a.props, pe(a)), a._outerRef = void 0, a._resetIsScrollingTimeoutId = null, a.state = {
|
|
780
791
|
instance: pe(a),
|
|
781
792
|
isScrolling: !1,
|
|
782
793
|
scrollDirection: "forward",
|
|
783
794
|
scrollOffset: typeof a.props.initialScrollOffset == "number" ? a.props.initialScrollOffset : 0,
|
|
784
795
|
scrollUpdateWasRequested: !1
|
|
785
|
-
}, a._callOnItemsRendered = void 0, a._callOnItemsRendered = G(function(l,
|
|
796
|
+
}, a._callOnItemsRendered = void 0, a._callOnItemsRendered = G(function(l, d, g, M) {
|
|
786
797
|
return a.props.onItemsRendered({
|
|
787
798
|
overscanStartIndex: l,
|
|
788
|
-
overscanStopIndex:
|
|
789
|
-
visibleStartIndex:
|
|
799
|
+
overscanStopIndex: d,
|
|
800
|
+
visibleStartIndex: g,
|
|
790
801
|
visibleStopIndex: M
|
|
791
802
|
});
|
|
792
|
-
}), a._callOnScroll = void 0, a._callOnScroll = G(function(l,
|
|
803
|
+
}), a._callOnScroll = void 0, a._callOnScroll = G(function(l, d, g) {
|
|
793
804
|
return a.props.onScroll({
|
|
794
805
|
scrollDirection: l,
|
|
795
|
-
scrollOffset:
|
|
796
|
-
scrollUpdateWasRequested:
|
|
806
|
+
scrollOffset: d,
|
|
807
|
+
scrollUpdateWasRequested: g
|
|
797
808
|
});
|
|
798
809
|
}), a._getItemStyle = void 0, a._getItemStyle = function(l) {
|
|
799
|
-
var
|
|
800
|
-
if (
|
|
801
|
-
S =
|
|
810
|
+
var d = a.props, g = d.direction, M = d.itemSize, v = d.layout, f = a._getItemStyleCache(h && M, h && v, h && g), S;
|
|
811
|
+
if (f.hasOwnProperty(l))
|
|
812
|
+
S = f[l];
|
|
802
813
|
else {
|
|
803
|
-
var z = n(a.props, l, a._instanceProps), O = r(a.props, l, a._instanceProps), C =
|
|
804
|
-
|
|
814
|
+
var z = n(a.props, l, a._instanceProps), O = r(a.props, l, a._instanceProps), C = g === "horizontal" || v === "horizontal", U = g === "rtl", _ = C ? z : 0;
|
|
815
|
+
f[l] = S = {
|
|
805
816
|
position: "absolute",
|
|
806
817
|
left: U ? void 0 : _,
|
|
807
818
|
right: U ? _ : void 0,
|
|
@@ -811,46 +822,46 @@ function Pn(e) {
|
|
|
811
822
|
};
|
|
812
823
|
}
|
|
813
824
|
return S;
|
|
814
|
-
}, a._getItemStyleCache = void 0, a._getItemStyleCache = G(function(l,
|
|
825
|
+
}, a._getItemStyleCache = void 0, a._getItemStyleCache = G(function(l, d, g) {
|
|
815
826
|
return {};
|
|
816
827
|
}), a._onScrollHorizontal = function(l) {
|
|
817
|
-
var
|
|
818
|
-
a.setState(function(
|
|
819
|
-
if (
|
|
828
|
+
var d = l.currentTarget, g = d.clientWidth, M = d.scrollLeft, v = d.scrollWidth;
|
|
829
|
+
a.setState(function(f) {
|
|
830
|
+
if (f.scrollOffset === M)
|
|
820
831
|
return null;
|
|
821
832
|
var S = a.props.direction, z = M;
|
|
822
833
|
if (S === "rtl")
|
|
823
|
-
switch (
|
|
834
|
+
switch (fe()) {
|
|
824
835
|
case "negative":
|
|
825
836
|
z = -M;
|
|
826
837
|
break;
|
|
827
838
|
case "positive-descending":
|
|
828
|
-
z = v -
|
|
839
|
+
z = v - g - M;
|
|
829
840
|
break;
|
|
830
841
|
}
|
|
831
|
-
return z = Math.max(0, Math.min(z, v -
|
|
842
|
+
return z = Math.max(0, Math.min(z, v - g)), {
|
|
832
843
|
isScrolling: !0,
|
|
833
|
-
scrollDirection:
|
|
844
|
+
scrollDirection: f.scrollOffset < M ? "forward" : "backward",
|
|
834
845
|
scrollOffset: z,
|
|
835
846
|
scrollUpdateWasRequested: !1
|
|
836
847
|
};
|
|
837
848
|
}, a._resetIsScrollingDebounced);
|
|
838
849
|
}, a._onScrollVertical = function(l) {
|
|
839
|
-
var
|
|
840
|
-
a.setState(function(
|
|
841
|
-
if (
|
|
850
|
+
var d = l.currentTarget, g = d.clientHeight, M = d.scrollHeight, v = d.scrollTop;
|
|
851
|
+
a.setState(function(f) {
|
|
852
|
+
if (f.scrollOffset === v)
|
|
842
853
|
return null;
|
|
843
|
-
var S = Math.max(0, Math.min(v, M -
|
|
854
|
+
var S = Math.max(0, Math.min(v, M - g));
|
|
844
855
|
return {
|
|
845
856
|
isScrolling: !0,
|
|
846
|
-
scrollDirection:
|
|
857
|
+
scrollDirection: f.scrollOffset < S ? "forward" : "backward",
|
|
847
858
|
scrollOffset: S,
|
|
848
859
|
scrollUpdateWasRequested: !1
|
|
849
860
|
};
|
|
850
861
|
}, a._resetIsScrollingDebounced);
|
|
851
862
|
}, a._outerRefSetter = function(l) {
|
|
852
|
-
var
|
|
853
|
-
a._outerRef = l, typeof
|
|
863
|
+
var d = a.props.outerRef;
|
|
864
|
+
a._outerRef = l, typeof d == "function" ? d(l) : d != null && typeof d == "object" && d.hasOwnProperty("current") && (d.current = l);
|
|
854
865
|
}, a._resetIsScrollingDebounced = function() {
|
|
855
866
|
a._resetIsScrollingTimeoutId !== null && he(a._resetIsScrollingTimeoutId), a._resetIsScrollingTimeoutId = _n(a._resetIsScrolling, qn);
|
|
856
867
|
}, a._resetIsScrolling = function() {
|
|
@@ -862,10 +873,10 @@ function Pn(e) {
|
|
|
862
873
|
}, a;
|
|
863
874
|
}
|
|
864
875
|
N.getDerivedStateFromProps = function(a, l) {
|
|
865
|
-
return Wn(a, l),
|
|
876
|
+
return Wn(a, l), y(a), null;
|
|
866
877
|
};
|
|
867
|
-
var
|
|
868
|
-
return
|
|
878
|
+
var A = N.prototype;
|
|
879
|
+
return A.scrollTo = function(a) {
|
|
869
880
|
a = Math.max(0, a), this.setState(function(l) {
|
|
870
881
|
return l.scrollOffset === a ? null : {
|
|
871
882
|
scrollDirection: l.scrollOffset < a ? "forward" : "backward",
|
|
@@ -873,51 +884,51 @@ function Pn(e) {
|
|
|
873
884
|
scrollUpdateWasRequested: !0
|
|
874
885
|
};
|
|
875
886
|
}, this._resetIsScrollingDebounced);
|
|
876
|
-
},
|
|
887
|
+
}, A.scrollToItem = function(a, l) {
|
|
877
888
|
l === void 0 && (l = "auto");
|
|
878
|
-
var
|
|
879
|
-
a = Math.max(0, Math.min(a,
|
|
880
|
-
var
|
|
889
|
+
var d = this.props, g = d.itemCount, M = d.layout, v = this.state.scrollOffset;
|
|
890
|
+
a = Math.max(0, Math.min(a, g - 1));
|
|
891
|
+
var f = 0;
|
|
881
892
|
if (this._outerRef) {
|
|
882
893
|
var S = this._outerRef;
|
|
883
|
-
M === "vertical" ?
|
|
894
|
+
M === "vertical" ? f = S.scrollWidth > S.clientWidth ? ge() : 0 : f = S.scrollHeight > S.clientHeight ? ge() : 0;
|
|
884
895
|
}
|
|
885
|
-
this.scrollTo(
|
|
886
|
-
},
|
|
887
|
-
var a = this.props, l = a.direction,
|
|
888
|
-
if (typeof
|
|
896
|
+
this.scrollTo(m(this.props, a, l, v, this._instanceProps, f));
|
|
897
|
+
}, A.componentDidMount = function() {
|
|
898
|
+
var a = this.props, l = a.direction, d = a.initialScrollOffset, g = a.layout;
|
|
899
|
+
if (typeof d == "number" && this._outerRef != null) {
|
|
889
900
|
var M = this._outerRef;
|
|
890
|
-
l === "horizontal" ||
|
|
901
|
+
l === "horizontal" || g === "horizontal" ? M.scrollLeft = d : M.scrollTop = d;
|
|
891
902
|
}
|
|
892
903
|
this._callPropsCallbacks();
|
|
893
|
-
},
|
|
894
|
-
var a = this.props, l = a.direction,
|
|
904
|
+
}, A.componentDidUpdate = function() {
|
|
905
|
+
var a = this.props, l = a.direction, d = a.layout, g = this.state, M = g.scrollOffset, v = g.scrollUpdateWasRequested;
|
|
895
906
|
if (v && this._outerRef != null) {
|
|
896
|
-
var
|
|
897
|
-
if (l === "horizontal" ||
|
|
907
|
+
var f = this._outerRef;
|
|
908
|
+
if (l === "horizontal" || d === "horizontal")
|
|
898
909
|
if (l === "rtl")
|
|
899
|
-
switch (
|
|
910
|
+
switch (fe()) {
|
|
900
911
|
case "negative":
|
|
901
|
-
|
|
912
|
+
f.scrollLeft = -M;
|
|
902
913
|
break;
|
|
903
914
|
case "positive-ascending":
|
|
904
|
-
|
|
915
|
+
f.scrollLeft = M;
|
|
905
916
|
break;
|
|
906
917
|
default:
|
|
907
|
-
var S =
|
|
908
|
-
|
|
918
|
+
var S = f.clientWidth, z = f.scrollWidth;
|
|
919
|
+
f.scrollLeft = z - S - M;
|
|
909
920
|
break;
|
|
910
921
|
}
|
|
911
922
|
else
|
|
912
|
-
|
|
923
|
+
f.scrollLeft = M;
|
|
913
924
|
else
|
|
914
|
-
|
|
925
|
+
f.scrollTop = M;
|
|
915
926
|
}
|
|
916
927
|
this._callPropsCallbacks();
|
|
917
|
-
},
|
|
928
|
+
}, A.componentWillUnmount = function() {
|
|
918
929
|
this._resetIsScrollingTimeoutId !== null && he(this._resetIsScrollingTimeoutId);
|
|
919
|
-
},
|
|
920
|
-
var a = this.props, l = a.children,
|
|
930
|
+
}, A.render = function() {
|
|
931
|
+
var a = this.props, l = a.children, d = a.className, g = a.direction, M = a.height, v = a.innerRef, f = a.innerElementType, S = a.innerTagName, z = a.itemCount, O = a.itemData, C = a.itemKey, U = C === void 0 ? Pn : C, _ = a.layout, je = a.outerElementType, Oe = a.outerTagName, Ce = a.style, ke = a.useIsScrolling, we = a.width, ne = this.state.isScrolling, B = g === "horizontal" || _ === "horizontal", be = B ? this._onScrollHorizontal : this._onScrollVertical, se = this._getRangeToRender(), Ee = se[0], Le = se[1], ie = [];
|
|
921
932
|
if (z > 0)
|
|
922
933
|
for (var L = Ee; L <= Le; L++)
|
|
923
934
|
ie.push(H(l, {
|
|
@@ -929,7 +940,7 @@ function Pn(e) {
|
|
|
929
940
|
}));
|
|
930
941
|
var re = i(this.props, this._instanceProps);
|
|
931
942
|
return H(je || Oe || "div", {
|
|
932
|
-
className:
|
|
943
|
+
className: d,
|
|
933
944
|
onScroll: be,
|
|
934
945
|
ref: this._outerRefSetter,
|
|
935
946
|
style: X({
|
|
@@ -939,9 +950,9 @@ function Pn(e) {
|
|
|
939
950
|
overflow: "auto",
|
|
940
951
|
WebkitOverflowScrolling: "touch",
|
|
941
952
|
willChange: "transform",
|
|
942
|
-
direction:
|
|
953
|
+
direction: g
|
|
943
954
|
}, Ce)
|
|
944
|
-
}, H(
|
|
955
|
+
}, H(f || S || "div", {
|
|
945
956
|
children: ie,
|
|
946
957
|
ref: v,
|
|
947
958
|
style: {
|
|
@@ -950,26 +961,26 @@ function Pn(e) {
|
|
|
950
961
|
width: B ? re : "100%"
|
|
951
962
|
}
|
|
952
963
|
}));
|
|
953
|
-
},
|
|
964
|
+
}, A._callPropsCallbacks = function() {
|
|
954
965
|
if (typeof this.props.onItemsRendered == "function") {
|
|
955
966
|
var a = this.props.itemCount;
|
|
956
967
|
if (a > 0) {
|
|
957
|
-
var l = this._getRangeToRender(),
|
|
958
|
-
this._callOnItemsRendered(
|
|
968
|
+
var l = this._getRangeToRender(), d = l[0], g = l[1], M = l[2], v = l[3];
|
|
969
|
+
this._callOnItemsRendered(d, g, M, v);
|
|
959
970
|
}
|
|
960
971
|
}
|
|
961
972
|
if (typeof this.props.onScroll == "function") {
|
|
962
|
-
var
|
|
973
|
+
var f = this.state, S = f.scrollDirection, z = f.scrollOffset, O = f.scrollUpdateWasRequested;
|
|
963
974
|
this._callOnScroll(S, z, O);
|
|
964
975
|
}
|
|
965
|
-
},
|
|
966
|
-
var a = this.props, l = a.itemCount,
|
|
976
|
+
}, A._getRangeToRender = function() {
|
|
977
|
+
var a = this.props, l = a.itemCount, d = a.overscanCount, g = this.state, M = g.isScrolling, v = g.scrollDirection, f = g.scrollOffset;
|
|
967
978
|
if (l === 0)
|
|
968
979
|
return [0, 0, 0, 0];
|
|
969
|
-
var S =
|
|
980
|
+
var S = c(this.props, f, this._instanceProps), z = I(this.props, S, f, this._instanceProps), O = !M || v === "backward" ? Math.max(1, d) : 1, C = !M || v === "forward" ? Math.max(1, d) : 1;
|
|
970
981
|
return [Math.max(0, S - O), Math.max(0, Math.min(l - 1, z + C)), S, z];
|
|
971
982
|
}, N;
|
|
972
|
-
}(
|
|
983
|
+
}(ye), t.defaultProps = {
|
|
973
984
|
direction: "ltr",
|
|
974
985
|
itemData: void 0,
|
|
975
986
|
layout: "vertical",
|
|
@@ -979,7 +990,7 @@ function Pn(e) {
|
|
|
979
990
|
}
|
|
980
991
|
var Wn = function(t, n) {
|
|
981
992
|
t.children, t.direction, t.height, t.layout, t.innerTagName, t.outerTagName, t.width, n.instance;
|
|
982
|
-
}, Vn = /* @__PURE__ */
|
|
993
|
+
}, Vn = /* @__PURE__ */ Yn({
|
|
983
994
|
getItemOffset: function(t, n) {
|
|
984
995
|
var i = t.itemSize;
|
|
985
996
|
return n * i;
|
|
@@ -992,20 +1003,20 @@ var Wn = function(t, n) {
|
|
|
992
1003
|
var n = t.itemCount, i = t.itemSize;
|
|
993
1004
|
return i * n;
|
|
994
1005
|
},
|
|
995
|
-
getOffsetForIndexAndAlignment: function(t, n, i, r,
|
|
996
|
-
var
|
|
997
|
-
switch (i === "smart" && (r >=
|
|
1006
|
+
getOffsetForIndexAndAlignment: function(t, n, i, r, m, c) {
|
|
1007
|
+
var I = t.direction, u = t.height, h = t.itemCount, y = t.itemSize, D = t.layout, N = t.width, A = I === "horizontal" || D === "horizontal", T = A ? N : u, a = Math.max(0, h * y - T), l = Math.min(a, n * y), d = Math.max(0, n * y - T + y + c);
|
|
1008
|
+
switch (i === "smart" && (r >= d - T && r <= l + T ? i = "auto" : i = "center"), i) {
|
|
998
1009
|
case "start":
|
|
999
1010
|
return l;
|
|
1000
1011
|
case "end":
|
|
1001
|
-
return
|
|
1012
|
+
return d;
|
|
1002
1013
|
case "center": {
|
|
1003
|
-
var
|
|
1004
|
-
return
|
|
1014
|
+
var g = Math.round(d + (l - d) / 2);
|
|
1015
|
+
return g < Math.ceil(T / 2) ? 0 : g > a + Math.floor(T / 2) ? a : g;
|
|
1005
1016
|
}
|
|
1006
1017
|
case "auto":
|
|
1007
1018
|
default:
|
|
1008
|
-
return r >=
|
|
1019
|
+
return r >= d && r <= l ? r : r < d ? d : l;
|
|
1009
1020
|
}
|
|
1010
1021
|
},
|
|
1011
1022
|
getStartIndexForOffset: function(t, n) {
|
|
@@ -1013,10 +1024,10 @@ var Wn = function(t, n) {
|
|
|
1013
1024
|
return Math.max(0, Math.min(i - 1, Math.floor(n / r)));
|
|
1014
1025
|
},
|
|
1015
1026
|
getStopIndexForStartIndex: function(t, n, i) {
|
|
1016
|
-
var r = t.direction,
|
|
1027
|
+
var r = t.direction, m = t.height, c = t.itemCount, I = t.itemSize, u = t.layout, h = t.width, y = r === "horizontal" || u === "horizontal", D = n * I, N = y ? h : m, A = Math.ceil((N + i - D) / I);
|
|
1017
1028
|
return Math.max(0, Math.min(
|
|
1018
|
-
|
|
1019
|
-
n +
|
|
1029
|
+
c - 1,
|
|
1030
|
+
n + A - 1
|
|
1020
1031
|
// -1 is because stop index is inclusive
|
|
1021
1032
|
));
|
|
1022
1033
|
},
|
|
@@ -1032,24 +1043,24 @@ function Fn(e) {
|
|
|
1032
1043
|
return !(i > n || r < t);
|
|
1033
1044
|
}
|
|
1034
1045
|
function Bn(e) {
|
|
1035
|
-
for (var t = e.isItemLoaded, n = e.itemCount, i = e.minimumBatchSize, r = e.startIndex,
|
|
1036
|
-
var
|
|
1037
|
-
|
|
1046
|
+
for (var t = e.isItemLoaded, n = e.itemCount, i = e.minimumBatchSize, r = e.startIndex, m = e.stopIndex, c = [], I = null, u = null, h = r; h <= m; h++) {
|
|
1047
|
+
var y = t(h);
|
|
1048
|
+
y ? u !== null && (c.push(I, u), I = u = null) : (u = h, I === null && (I = h));
|
|
1038
1049
|
}
|
|
1039
|
-
if (
|
|
1040
|
-
for (var D = Math.min(Math.max(
|
|
1041
|
-
|
|
1042
|
-
|
|
1050
|
+
if (u !== null) {
|
|
1051
|
+
for (var D = Math.min(Math.max(u, I + i - 1), n - 1), N = u + 1; N <= D && !t(N); N++)
|
|
1052
|
+
u = N;
|
|
1053
|
+
c.push(I, u);
|
|
1043
1054
|
}
|
|
1044
|
-
if (
|
|
1045
|
-
for (;
|
|
1046
|
-
var
|
|
1047
|
-
if (!t(
|
|
1048
|
-
|
|
1055
|
+
if (c.length)
|
|
1056
|
+
for (; c[1] - c[0] + 1 < i && c[0] > 0; ) {
|
|
1057
|
+
var A = c[0] - 1;
|
|
1058
|
+
if (!t(A))
|
|
1059
|
+
c[0] = A;
|
|
1049
1060
|
else
|
|
1050
1061
|
break;
|
|
1051
1062
|
}
|
|
1052
|
-
return
|
|
1063
|
+
return c;
|
|
1053
1064
|
}
|
|
1054
1065
|
var Hn = function(e, t) {
|
|
1055
1066
|
if (!(e instanceof t))
|
|
@@ -1082,16 +1093,16 @@ var Hn = function(e, t) {
|
|
|
1082
1093
|
}, Jn = function(e) {
|
|
1083
1094
|
Gn(t, e);
|
|
1084
1095
|
function t() {
|
|
1085
|
-
var n, i, r,
|
|
1096
|
+
var n, i, r, m;
|
|
1086
1097
|
Hn(this, t);
|
|
1087
|
-
for (var
|
|
1088
|
-
|
|
1089
|
-
return
|
|
1090
|
-
var
|
|
1091
|
-
r._lastRenderedStartIndex =
|
|
1098
|
+
for (var c = arguments.length, I = Array(c), u = 0; u < c; u++)
|
|
1099
|
+
I[u] = arguments[u];
|
|
1100
|
+
return m = (i = (r = Me(this, (n = t.__proto__ || Object.getPrototypeOf(t)).call.apply(n, [this].concat(I))), r), r._lastRenderedStartIndex = -1, r._lastRenderedStopIndex = -1, r._memoizedUnloadedRanges = [], r._onItemsRendered = function(h) {
|
|
1101
|
+
var y = h.visibleStartIndex, D = h.visibleStopIndex;
|
|
1102
|
+
r._lastRenderedStartIndex = y, r._lastRenderedStopIndex = D, r._ensureRowsLoaded(y, D);
|
|
1092
1103
|
}, r._setRef = function(h) {
|
|
1093
1104
|
r._listRef = h;
|
|
1094
|
-
}, i), Me(r,
|
|
1105
|
+
}, i), Me(r, m);
|
|
1095
1106
|
}
|
|
1096
1107
|
return Zn(t, [{
|
|
1097
1108
|
key: "resetloadMoreItemsCache",
|
|
@@ -1115,39 +1126,39 @@ var Hn = function(e, t) {
|
|
|
1115
1126
|
}, {
|
|
1116
1127
|
key: "_ensureRowsLoaded",
|
|
1117
1128
|
value: function(i, r) {
|
|
1118
|
-
var
|
|
1119
|
-
isItemLoaded:
|
|
1120
|
-
itemCount:
|
|
1129
|
+
var m = this.props, c = m.isItemLoaded, I = m.itemCount, u = m.minimumBatchSize, h = u === void 0 ? 10 : u, y = m.threshold, D = y === void 0 ? 15 : y, N = Bn({
|
|
1130
|
+
isItemLoaded: c,
|
|
1131
|
+
itemCount: I,
|
|
1121
1132
|
minimumBatchSize: h,
|
|
1122
1133
|
startIndex: Math.max(0, i - D),
|
|
1123
|
-
stopIndex: Math.min(
|
|
1134
|
+
stopIndex: Math.min(I - 1, r + D)
|
|
1124
1135
|
});
|
|
1125
|
-
(this._memoizedUnloadedRanges.length !== N.length || this._memoizedUnloadedRanges.some(function(
|
|
1126
|
-
return N[T] !==
|
|
1136
|
+
(this._memoizedUnloadedRanges.length !== N.length || this._memoizedUnloadedRanges.some(function(A, T) {
|
|
1137
|
+
return N[T] !== A;
|
|
1127
1138
|
})) && (this._memoizedUnloadedRanges = N, this._loadUnloadedRanges(N));
|
|
1128
1139
|
}
|
|
1129
1140
|
}, {
|
|
1130
1141
|
key: "_loadUnloadedRanges",
|
|
1131
1142
|
value: function(i) {
|
|
1132
|
-
for (var r = this,
|
|
1133
|
-
var
|
|
1143
|
+
for (var r = this, m = this.props.loadMoreItems || this.props.loadMoreRows, c = function(h) {
|
|
1144
|
+
var y = i[h], D = i[h + 1], N = m(y, D);
|
|
1134
1145
|
N != null && N.then(function() {
|
|
1135
1146
|
if (Fn({
|
|
1136
1147
|
lastRenderedStartIndex: r._lastRenderedStartIndex,
|
|
1137
1148
|
lastRenderedStopIndex: r._lastRenderedStopIndex,
|
|
1138
|
-
startIndex:
|
|
1149
|
+
startIndex: y,
|
|
1139
1150
|
stopIndex: D
|
|
1140
1151
|
})) {
|
|
1141
1152
|
if (r._listRef == null)
|
|
1142
1153
|
return;
|
|
1143
|
-
typeof r._listRef.resetAfterIndex == "function" ? r._listRef.resetAfterIndex(
|
|
1154
|
+
typeof r._listRef.resetAfterIndex == "function" ? r._listRef.resetAfterIndex(y, !0) : (typeof r._listRef._getItemStyleCache == "function" && r._listRef._getItemStyleCache(-1), r._listRef.forceUpdate());
|
|
1144
1155
|
}
|
|
1145
1156
|
});
|
|
1146
|
-
},
|
|
1147
|
-
|
|
1157
|
+
}, I = 0; I < i.length; I += 2)
|
|
1158
|
+
c(I);
|
|
1148
1159
|
}
|
|
1149
1160
|
}]), t;
|
|
1150
|
-
}(
|
|
1161
|
+
}(ye);
|
|
1151
1162
|
const Kn = /* @__PURE__ */ o("div")({
|
|
1152
1163
|
name: "Container",
|
|
1153
1164
|
class: "culdu4a",
|
|
@@ -1186,9 +1197,9 @@ const Kn = /* @__PURE__ */ o("div")({
|
|
|
1186
1197
|
name: n,
|
|
1187
1198
|
points: i,
|
|
1188
1199
|
isCurrentUser: r,
|
|
1189
|
-
openItemDetail:
|
|
1190
|
-
style:
|
|
1191
|
-
}) => /* @__PURE__ */ p(Kn, { onClick:
|
|
1200
|
+
openItemDetail: m,
|
|
1201
|
+
style: c
|
|
1202
|
+
}) => /* @__PURE__ */ p(Kn, { onClick: m, style: c, children: [
|
|
1192
1203
|
/* @__PURE__ */ s(Xn, { children: e || 0 }),
|
|
1193
1204
|
/* @__PURE__ */ p(ns, { children: [
|
|
1194
1205
|
t ? /* @__PURE__ */ s(es, { alt: "leaderboard-item-avatar", src: t }) : /* @__PURE__ */ s(ts, { children: Te(n || "") }),
|
|
@@ -1207,30 +1218,30 @@ const Kn = /* @__PURE__ */ o("div")({
|
|
|
1207
1218
|
currentUserId: t,
|
|
1208
1219
|
openItemDetail: n,
|
|
1209
1220
|
fetchMore: i
|
|
1210
|
-
}) => /* @__PURE__ */ s(Re, { children: ({ width: r, height:
|
|
1221
|
+
}) => /* @__PURE__ */ s(Re, { children: ({ width: r, height: m }) => /* @__PURE__ */ s(
|
|
1211
1222
|
Jn,
|
|
1212
1223
|
{
|
|
1213
|
-
isItemLoaded: (
|
|
1224
|
+
isItemLoaded: (c) => c < e.length,
|
|
1214
1225
|
itemCount: e.length + 1,
|
|
1215
1226
|
loadMoreItems: i,
|
|
1216
|
-
children: ({ onItemsRendered:
|
|
1227
|
+
children: ({ onItemsRendered: c, ref: I }) => /* @__PURE__ */ s(ls, { children: /* @__PURE__ */ s(
|
|
1217
1228
|
Vn,
|
|
1218
1229
|
{
|
|
1219
1230
|
itemSize: 56,
|
|
1220
|
-
onItemsRendered:
|
|
1221
|
-
ref:
|
|
1231
|
+
onItemsRendered: c,
|
|
1232
|
+
ref: I,
|
|
1222
1233
|
itemCount: e.length,
|
|
1223
1234
|
width: r,
|
|
1224
|
-
height:
|
|
1225
|
-
children: ({ index:
|
|
1235
|
+
height: m,
|
|
1236
|
+
children: ({ index: u, style: h }) => /* @__PURE__ */ s(
|
|
1226
1237
|
as,
|
|
1227
1238
|
{
|
|
1228
1239
|
style: { ...h, maxHeight: 48 },
|
|
1229
|
-
...e[
|
|
1230
|
-
openItemDetail: () => n(e[
|
|
1231
|
-
isCurrentUser: !!t && t === e[
|
|
1240
|
+
...e[u],
|
|
1241
|
+
openItemDetail: () => n(e[u].userId),
|
|
1242
|
+
isCurrentUser: !!t && t === e[u].userId
|
|
1232
1243
|
},
|
|
1233
|
-
e[
|
|
1244
|
+
e[u].userId
|
|
1234
1245
|
)
|
|
1235
1246
|
}
|
|
1236
1247
|
) })
|
|
@@ -1284,11 +1295,11 @@ const Kn = /* @__PURE__ */ o("div")({
|
|
|
1284
1295
|
name: "QuestionAction",
|
|
1285
1296
|
class: "q105uluy",
|
|
1286
1297
|
propsAsIs: !1
|
|
1287
|
-
}),
|
|
1298
|
+
}), gs = () => j, Y = /* @__PURE__ */ o(gs())({
|
|
1288
1299
|
name: "QuestionActionIcon",
|
|
1289
1300
|
class: "q1fa0b9h",
|
|
1290
1301
|
propsAsIs: !0
|
|
1291
|
-
}),
|
|
1302
|
+
}), fs = () => j, Ms = /* @__PURE__ */ o(fs())({
|
|
1292
1303
|
name: "QuestionTypeIcon",
|
|
1293
1304
|
class: "qxlt78s",
|
|
1294
1305
|
propsAsIs: !0
|
|
@@ -1300,37 +1311,37 @@ const Kn = /* @__PURE__ */ o("div")({
|
|
|
1300
1311
|
name: "QuestionContent",
|
|
1301
1312
|
class: "q1uz5j1g",
|
|
1302
1313
|
propsAsIs: !1
|
|
1303
|
-
}),
|
|
1314
|
+
}), ys = /* @__PURE__ */ o("button")({
|
|
1304
1315
|
name: "PlayButton",
|
|
1305
1316
|
class: "p1pba9p1",
|
|
1306
1317
|
propsAsIs: !1
|
|
1307
|
-
}),
|
|
1308
|
-
[q.LOST]: /* @__PURE__ */ s(
|
|
1309
|
-
[q.WON]: /* @__PURE__ */ s(
|
|
1310
|
-
[q.UNSET]: /* @__PURE__ */ s(
|
|
1311
|
-
[q.DNP]: /* @__PURE__ */ s(
|
|
1318
|
+
}), As = {
|
|
1319
|
+
[q.LOST]: /* @__PURE__ */ s(Y, { name: "icon-cross" }),
|
|
1320
|
+
[q.WON]: /* @__PURE__ */ s(Y, { name: "icon-check" }),
|
|
1321
|
+
[q.UNSET]: /* @__PURE__ */ s(Y, { name: "icon-arrow" }),
|
|
1322
|
+
[q.DNP]: /* @__PURE__ */ s(Y, { name: "icon-arrow" })
|
|
1312
1323
|
}, Ts = ({
|
|
1313
1324
|
questionId: e,
|
|
1314
1325
|
questionType: t,
|
|
1315
1326
|
questionStatus: n,
|
|
1316
1327
|
subject: i,
|
|
1317
1328
|
openForVoting: r,
|
|
1318
|
-
openQuestion:
|
|
1319
|
-
status:
|
|
1329
|
+
openQuestion: m,
|
|
1330
|
+
status: c
|
|
1320
1331
|
}) => {
|
|
1321
|
-
const
|
|
1322
|
-
return
|
|
1332
|
+
const I = Ne[t], u = As[c];
|
|
1333
|
+
return I ? /* @__PURE__ */ p(ps, { onClick: () => m == null ? void 0 : m(e), children: [
|
|
1323
1334
|
/* @__PURE__ */ p(Ns, { children: [
|
|
1324
1335
|
/* @__PURE__ */ p(ms, { children: [
|
|
1325
|
-
/* @__PURE__ */ s(Ms, { name:
|
|
1336
|
+
/* @__PURE__ */ s(Ms, { name: I.iconName }),
|
|
1326
1337
|
/* @__PURE__ */ p(vs, { children: [
|
|
1327
|
-
|
|
1338
|
+
I.label,
|
|
1328
1339
|
t === x.TRIVIA && n === Q.RESOLVED && " • Expired"
|
|
1329
1340
|
] })
|
|
1330
1341
|
] }),
|
|
1331
1342
|
/* @__PURE__ */ s(Is, { children: i || "" })
|
|
1332
1343
|
] }),
|
|
1333
|
-
/* @__PURE__ */ s(hs, { children: r ? /* @__PURE__ */ s(
|
|
1344
|
+
/* @__PURE__ */ s(hs, { children: r ? /* @__PURE__ */ s(ys, { children: "Play" }) : u })
|
|
1334
1345
|
] }) : null;
|
|
1335
1346
|
}, Ds = /* @__PURE__ */ o("div")({
|
|
1336
1347
|
name: "Container",
|
|
@@ -1354,12 +1365,12 @@ const Kn = /* @__PURE__ */ o("div")({
|
|
|
1354
1365
|
}), js = ({ questions: e, openQuestion: t }) => /* @__PURE__ */ s(xs, { children: e == null ? void 0 : e.map((n) => {
|
|
1355
1366
|
var i, r;
|
|
1356
1367
|
if (n.type === "question" && ((i = n.attributes) == null ? void 0 : i.attributes.case) === "question") {
|
|
1357
|
-
const
|
|
1358
|
-
return /* @__PURE__ */ s(Ts, { openQuestion: t, ...
|
|
1368
|
+
const m = n.attributes.attributes.value;
|
|
1369
|
+
return /* @__PURE__ */ s(Ts, { openQuestion: t, ...m }, m.questionId);
|
|
1359
1370
|
}
|
|
1360
1371
|
if (n.type === "insight" && ((r = n.attributes) == null ? void 0 : r.attributes.case) === "insight") {
|
|
1361
|
-
const
|
|
1362
|
-
return /* @__PURE__ */ s(zs, { openInsight: t, ...
|
|
1372
|
+
const m = n.attributes.attributes.value;
|
|
1373
|
+
return /* @__PURE__ */ s(zs, { openInsight: t, ...m }, m.questionId);
|
|
1363
1374
|
}
|
|
1364
1375
|
return null;
|
|
1365
1376
|
}) }), Os = ({ store: e, openQuestion: t }) => {
|
|
@@ -1437,7 +1448,7 @@ const Kn = /* @__PURE__ */ o("div")({
|
|
|
1437
1448
|
}), i && /* @__PURE__ */ s(ve, {
|
|
1438
1449
|
className: t,
|
|
1439
1450
|
children: /* @__PURE__ */ p(bs, {
|
|
1440
|
-
children: [/* @__PURE__ */ s(
|
|
1451
|
+
children: [/* @__PURE__ */ s(Ae, {
|
|
1441
1452
|
label: "Friend's Rank",
|
|
1442
1453
|
close: e.closeUser
|
|
1443
1454
|
}), /* @__PURE__ */ s(K, {
|