@streamlayer/react 0.29.9 → 0.29.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.
@@ -0,0 +1,1740 @@
1
+ import { jsxs as I, jsx as r, Fragment as $ } from "react/jsx-runtime";
2
+ import { s as o, i as x, o as Oe, a as Ee, b as je, Q as D, c as Y, d as L, E as C, r as Le, e as Je, f as Ke, n as Xe, w as et, u as O, g as tt, P as V, h as ne, j as st, k as nt } from "./masters-791400ce.js";
3
+ import Q, { useRef as E, useState as R, useCallback as P, useEffect as it, useLayoutEffect as rt, useMemo as B, Component as at, createElement as G, PureComponent as $e } from "react";
4
+ const ot = () => x, lt = () => x, ct = /* @__PURE__ */ o("div")({
5
+ name: "a",
6
+ class: "acysrl1",
7
+ propsAsIs: !1
8
+ }), dt = /* @__PURE__ */ o("div")({
9
+ name: "l",
10
+ class: "lo57cjm",
11
+ propsAsIs: !1
12
+ }), ut = /* @__PURE__ */ o(ot())({
13
+ name: "p",
14
+ class: "p14kwh4y",
15
+ propsAsIs: !0
16
+ }), pt = /* @__PURE__ */ o("span")({
17
+ name: "s",
18
+ class: "sxun7sq",
19
+ propsAsIs: !1
20
+ }), ht = /* @__PURE__ */ o("button")({
21
+ name: "c",
22
+ class: "c1i8ida8",
23
+ propsAsIs: !1
24
+ }), mt = /* @__PURE__ */ o(lt())({
25
+ name: "g",
26
+ class: "g1m0xfmw",
27
+ propsAsIs: !0
28
+ }), Ce = ({ type: t, close: e, label: s }) => {
29
+ const n = t ? Oe[t] : { label: s, iconName: void 0 };
30
+ return /* @__PURE__ */ I(ct, { children: [
31
+ /* @__PURE__ */ I(dt, { children: [
32
+ (n == null ? void 0 : n.iconName) && /* @__PURE__ */ r(ut, { name: n.iconName }),
33
+ (n == null ? void 0 : n.label) && /* @__PURE__ */ r(pt, { children: n.label })
34
+ ] }),
35
+ /* @__PURE__ */ r(ht, { onClick: e, children: /* @__PURE__ */ r(mt, { name: "icon-cross" }) })
36
+ ] });
37
+ };
38
+ const ft = /* @__PURE__ */ o("div")({
39
+ name: "t",
40
+ class: "taj61ja",
41
+ propsAsIs: !1
42
+ }), gt = /* @__PURE__ */ o("div")({
43
+ name: "r",
44
+ class: "r19fxewd",
45
+ propsAsIs: !1
46
+ }), It = /* @__PURE__ */ o("div")({
47
+ name: "i",
48
+ class: "i1whkbqh",
49
+ propsAsIs: !1
50
+ }), pe = ({ indicator: t, title: e }) => /* @__PURE__ */ I(ft, { children: [
51
+ /* @__PURE__ */ r(gt, { children: e }),
52
+ /* @__PURE__ */ r(It, { children: t })
53
+ ] });
54
+ const vt = /* @__PURE__ */ o("div")({
55
+ name: "i",
56
+ class: "i4lbhzs",
57
+ propsAsIs: !1
58
+ }), Mt = /* @__PURE__ */ o("div")({
59
+ name: "o",
60
+ class: "ordquhq",
61
+ propsAsIs: !1
62
+ }), yt = /* @__PURE__ */ o("div")({
63
+ name: "n",
64
+ class: "nwzed99",
65
+ propsAsIs: !1
66
+ }), H = ({ indicator: t, title: e }) => /* @__PURE__ */ I(vt, { children: [
67
+ /* @__PURE__ */ r(Mt, { children: t }),
68
+ /* @__PURE__ */ r(yt, { children: e })
69
+ ] });
70
+ const zt = /* @__PURE__ */ o("div")({
71
+ name: "o",
72
+ class: "o15y0waw",
73
+ propsAsIs: !1
74
+ }), Nt = /* @__PURE__ */ o("div")({
75
+ name: "i",
76
+ class: "ihjewwf",
77
+ propsAsIs: !1
78
+ }), At = /* @__PURE__ */ o("div")({
79
+ name: "n",
80
+ class: "n10e9lv8",
81
+ propsAsIs: !1
82
+ }), _t = /* @__PURE__ */ o("div")({
83
+ name: "r",
84
+ class: "r13bxv",
85
+ propsAsIs: !1
86
+ }), Tt = /* @__PURE__ */ o("img")({
87
+ name: "a",
88
+ class: "a1fi59c9",
89
+ propsAsIs: !1
90
+ }), St = /* @__PURE__ */ o("div")({
91
+ name: "s",
92
+ class: "s1kkihge",
93
+ propsAsIs: !1
94
+ }), xt = /* @__PURE__ */ o("div")({
95
+ name: "c",
96
+ class: "cy4f4t",
97
+ propsAsIs: !1
98
+ }), Dt = /* @__PURE__ */ o("div")({
99
+ name: "p",
100
+ class: "p18cnlx1",
101
+ propsAsIs: !1
102
+ }), wt = /* @__PURE__ */ o("img")({
103
+ name: "l",
104
+ class: "lboqgs5",
105
+ propsAsIs: !1
106
+ }), bt = /* @__PURE__ */ o("div")({
107
+ name: "d",
108
+ class: "d1oaal4",
109
+ propsAsIs: !1
110
+ }), kt = /* @__PURE__ */ o("div")({
111
+ name: "x",
112
+ class: "x1yzgo0u",
113
+ propsAsIs: !1
114
+ }), Ot = /* @__PURE__ */ o("div")({
115
+ name: "f",
116
+ class: "f1l9i8s8",
117
+ propsAsIs: !1
118
+ }), Et = /* @__PURE__ */ o("div")({
119
+ name: "g",
120
+ class: "g4cgl4u",
121
+ propsAsIs: !1
122
+ }), jt = /* @__PURE__ */ o("div")({
123
+ name: "h",
124
+ class: "h1qn1tmd",
125
+ propsAsIs: !1
126
+ }), Lt = /* @__PURE__ */ o("div")({
127
+ name: "u",
128
+ class: "u1gsbhq4",
129
+ propsAsIs: !1
130
+ }), $t = /* @__PURE__ */ o("div")({
131
+ name: "m",
132
+ class: "mvj8oco",
133
+ propsAsIs: !1
134
+ }), Ct = /* @__PURE__ */ o("button")({
135
+ name: "v",
136
+ class: "viqiaf2",
137
+ propsAsIs: !1
138
+ }), Rt = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPGcgaWQ9IlRyb3BoeSI+CjxwYXRoIGlkPSJDb21iaW5lZCBTaGFwZSIgZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zLjY5MTk3IDQuNjY2NjJDMy42OTE5NyA1Ljk5NzA1IDMuOTI5MTQgNy4xNzc4NyA0LjQwMzUgOC4yMDkxMkMzLjQ5OTY2IDguMDI0NTEgMi43NDQ4NyA3LjY2NDg2IDIuMTM5MSA3LjEzMDE0QzEuNTMzMzMgNi41OTU0MiAxLjIzMDQ2IDYuMDc5OCAxLjIzMDQ2IDUuNTgzMjhWNC42NjY2MkgzLjY5MTk3Wk0xNC43Njg2IDQuNjY2NjJWNS41ODMyOEMxNC43Njg2IDYuMDc5OCAxNC40NjU4IDYuNTk1NDIgMTMuODYgNy4xMzAxNEMxMy4yNTQyIDcuNjY0ODYgMTIuNDk5NCA4LjAyNDUxIDExLjU5NTYgOC4yMDkxMkMxMi4wNjk5IDcuMTc3ODcgMTIuMzA3MSA1Ljk5NzA1IDEyLjMwNzEgNC42NjY2MkgxNC43Njg2Wk0xNS45OTk4IDUuNTgzMjlWNC4zNjEwOEMxNS45OTk4IDQuMTA2NDUgMTUuOTEwMSAzLjg5MDAyIDE1LjczMDYgMy43MTE3OEMxNS41NTExIDMuNTMzNTQgMTUuMzMzMiAzLjQ0NDQyIDE1LjA3NjggMy40NDQ0MkgxMi4zMDc2VjIuNTI3NzZDMTIuMzA3NiAyLjEwNzYzIDEyLjE1NjkgMS43NDc5NyAxMS44NTU2IDEuNDQ4NzhDMTEuNTU0NCAxLjE0OTU5IDExLjE5MjIgMSAxMC43NjkxIDFINS4yMzA3MkM0LjgwNzY0IDEgNC40NDU0NyAxLjE0OTU5IDQuMTQ0MTkgMS40NDg3OEMzLjg0MjkxIDEuNzQ3OTcgMy42OTIyNyAyLjEwNzYzIDMuNjkyMjcgMi41Mjc3NlYzLjQ0NDQySDAuOTIzMDY4QzAuNjY2NjU5IDMuNDQ0NDIgMC40NDg3MTQgMy41MzM1NCAwLjI2OTIyOCAzLjcxMTc4QzAuMDg5NzQxOCAzLjg5MDAyIDAgNC4xMDY0NSAwIDQuMzYxMDhWNS41ODMyOUMwIDYuMDM1MjUgMC4xMzMwMSA2LjQ5MDM5IDAuMzk5MDM0IDYuOTQ4NzJDMC42NjUwNTkgNy40MDcwNSAxLjAyNDAzIDcuODIwODIgMS40NzU5NSA4LjE5MDAzQzEuOTI3ODcgOC41NTkyNCAyLjQ4MjM0IDguODY5NTcgMy4xMzkzOSA5LjEyMTAxQzMuNzk2NDQgOS4zNzI0NiA0LjQ4NzEzIDkuNTE0MDkgNS4yMTE0OSA5LjU0NTkyQzUuNDgwNzEgOS44ODk2NyA1Ljc4NTIgMTAuMTkyIDYuMTI0OTQgMTAuNDUzQzYuMzY4NTMgMTAuNjY5NSA2LjUzNjc5IDEwLjkwMDIgNi42Mjk3NCAxMS4xNDUzQzYuNzIyNjkgMTEuMzkwNCA2Ljc2OTE2IDExLjY3NTIgNi43NjkxNiAxMS45OTk5QzYuNzY5MTYgMTIuMzQzNiA2LjY3MTQxIDEyLjYzMzMgNi40NzU5IDEyLjg2ODhDNi4yODAzOCAxMy4xMDQzIDUuOTY3ODkgMTMuMjIyMSA1LjUzODQxIDEzLjIyMjFDNS4wNTc2NCAxMy4yMjIxIDQuNjI5NzYgMTMuMzY2OSA0LjI1NDc2IDEzLjY1NjZDMy44Nzk3NyAxMy45NDYyIDMuNjkyMjcgMTQuMzEwNiAzLjY5MjI3IDE0Ljc0OTlWMTUuMzYxQzMuNjkyMjcgMTUuNDUwMSAzLjcyMTEyIDE1LjUyMzMgMy43Nzg4MSAxNS41ODA2QzMuODM2NSAxNS42Mzc5IDMuOTEwMjIgMTUuNjY2NSAzLjk5OTk2IDE1LjY2NjVIMTEuOTk5OUMxMi4wODk2IDE1LjY2NjUgMTIuMTYzMyAxNS42Mzc5IDEyLjIyMSAxNS41ODA2QzEyLjI3ODcgMTUuNTIzMyAxMi4zMDc2IDE1LjQ1MDEgMTIuMzA3NiAxNS4zNjFWMTQuNzQ5OUMxMi4zMDc2IDE0LjMxMDYgMTIuMTIwMSAxMy45NDYyIDExLjc0NTEgMTMuNjU2NkMxMS4zNzAxIDEzLjM2NjkgMTAuOTQyMiAxMy4yMjIxIDEwLjQ2MTQgMTMuMjIyMUMxMC4wMzE5IDEzLjIyMjEgOS43MTk0NSAxMy4xMDQzIDkuNTIzOTQgMTIuODY4OEM5LjMyODQzIDEyLjYzMzMgOS4yMzA2OCAxMi4zNDM2IDkuMjMwNjggMTEuOTk5OUM5LjIzMDY4IDExLjY3NTIgOS4yNzcxNSAxMS4zOTA0IDkuMzcwMSAxMS4xNDUzQzkuNDYzMDUgMTAuOTAwMiA5LjYzMTMxIDEwLjY2OTUgOS44NzQ5IDEwLjQ1M0MxMC4yMTQ2IDEwLjE5MiAxMC41MTkxIDkuODg5NjcgMTAuNzg4NCA5LjU0NTkyQzExLjUxMjcgOS41MTQwOSAxMi4yMDM0IDkuMzcyNDYgMTIuODYwNCA5LjEyMTAxQzEzLjUxNzUgOC44Njk1NyAxNC4wNzIgOC41NTkyNCAxNC41MjM5IDguMTkwMDNDMTQuOTc1OCA3LjgyMDgyIDE1LjMzNDggNy40MDcwNSAxNS42MDA4IDYuOTQ4NzJDMTUuODY2OCA2LjQ5MDM5IDE1Ljk5OTggNi4wMzUyNSAxNS45OTk4IDUuNTgzMjlaTTYuNzYwNDcgNy4xNzk4TDguMDUxMDkgNi40OTk5N0w5LjM0MTcgNy4xNzk4TDkuMDk1MjEgNS43Mzk4OUwxMC4xMzkzIDQuNzIwMTVMOC42OTYzOSA0LjUxMDA3TDguMDUxMDkgMy4yTDcuNDA1NzggNC41MTAwN0w1Ljk2MjgzIDQuNzIwMTVMNy4wMDY5NiA1LjczOTg5TDYuNzYwNDcgNy4xNzk4WiIgZmlsbD0iI0YyQzk0QyIvPgo8L2c+Cjwvc3ZnPgo=", Re = ({
139
+ avatar: t,
140
+ name: e,
141
+ points: s,
142
+ friendsRank: n,
143
+ rank: i,
144
+ streak: p,
145
+ correct: d,
146
+ incorrect: m,
147
+ inTop: h,
148
+ successRate: g
149
+ }) => /* @__PURE__ */ I(zt, { children: [
150
+ /* @__PURE__ */ r(Nt, { children: /* @__PURE__ */ I(_t, { children: [
151
+ /* @__PURE__ */ I(Ct, { children: [
152
+ t && /* @__PURE__ */ r(Tt, { alt: "avatar", src: t }),
153
+ !t && /* @__PURE__ */ r($t, { children: Ee(e || "") })
154
+ ] }),
155
+ /* @__PURE__ */ I(St, { children: [
156
+ /* @__PURE__ */ r(xt, { children: e }),
157
+ /* @__PURE__ */ I(Dt, { children: [
158
+ /* @__PURE__ */ I(bt, { children: [
159
+ /* @__PURE__ */ r(wt, { alt: "rank-icon", src: Rt }),
160
+ /* @__PURE__ */ I(kt, { children: [
161
+ je(s),
162
+ /* @__PURE__ */ r(Ot, { children: "PTS" })
163
+ ] })
164
+ ] }),
165
+ /* @__PURE__ */ r(Et, {}),
166
+ /* @__PURE__ */ I("div", { children: [
167
+ "TOP ",
168
+ h || 0,
169
+ "%"
170
+ ] })
171
+ ] })
172
+ ] })
173
+ ] }) }),
174
+ /* @__PURE__ */ I(At, { children: [
175
+ /* @__PURE__ */ I(jt, { children: [
176
+ /* @__PURE__ */ r(pe, { indicator: n || 0, title: "Friends rank" }),
177
+ /* @__PURE__ */ r(pe, { indicator: i || 0, title: "Global rank" })
178
+ ] }),
179
+ /* @__PURE__ */ I(Lt, { children: [
180
+ /* @__PURE__ */ r(H, { indicator: p || 0, title: "Win streak" }),
181
+ /* @__PURE__ */ r(H, { indicator: d || 0, title: "Correct" }),
182
+ /* @__PURE__ */ r(H, { indicator: m || 0, title: "Incorrect" }),
183
+ /* @__PURE__ */ r(H, { indicator: `${g || 0}%`, title: "Succ. rate" })
184
+ ] })
185
+ ] })
186
+ ] });
187
+ const Ut = /* @__PURE__ */ o("div")({
188
+ name: "i",
189
+ class: "i1mbhc7z",
190
+ propsAsIs: !1
191
+ }), Qt = /* @__PURE__ */ o("div")({
192
+ name: "n",
193
+ class: "n1f9yefw",
194
+ propsAsIs: !1
195
+ }), qt = /* @__PURE__ */ o("div")({
196
+ name: "o",
197
+ class: "o1n7beii",
198
+ propsAsIs: !1
199
+ }), Yt = ({ title: t, description: e }) => /* @__PURE__ */ I(Ut, { children: [
200
+ /* @__PURE__ */ r(x, { name: "icon-check-circle" }),
201
+ /* @__PURE__ */ r(Qt, { children: t }),
202
+ /* @__PURE__ */ r(qt, { children: e })
203
+ ] });
204
+ const Pt = () => x, Wt = /* @__PURE__ */ o("div")({
205
+ name: "c",
206
+ class: "ciyeb68",
207
+ propsAsIs: !1
208
+ }), Ft = /* @__PURE__ */ o(Pt())({
209
+ name: "n",
210
+ class: "nfic4xc",
211
+ propsAsIs: !0
212
+ }), he = /* @__PURE__ */ o("div")({
213
+ name: "d",
214
+ class: "d1pd1p66",
215
+ propsAsIs: !1
216
+ }), me = /* @__PURE__ */ o("div")({
217
+ name: "p",
218
+ class: "p132yxcv",
219
+ propsAsIs: !1
220
+ }), Vt = /* @__PURE__ */ o("span")({
221
+ name: "l",
222
+ class: "l4a8aw",
223
+ propsAsIs: !1
224
+ }), J = /* @__PURE__ */ o("span")({
225
+ name: "g",
226
+ class: "gzdx7pk",
227
+ propsAsIs: !1
228
+ }), Ht = /* @__PURE__ */ o("div")({
229
+ name: "s",
230
+ class: "smnc4zm",
231
+ propsAsIs: !1
232
+ }), Bt = ({
233
+ feedbackMessages: t,
234
+ questionVotedCorrectly: e,
235
+ questionVoted: s,
236
+ questionType: n,
237
+ hasCorrectAnswer: i,
238
+ questionStatus: p
239
+ }) => {
240
+ const d = s && (n === D.TRIVIA || n === D.PREDICTION);
241
+ if (!d && p !== Y.RESOLVED)
242
+ return null;
243
+ const m = n === D.PREDICTION && !i, h = e ? "correct" : "incorrect", g = e ? t.correctFeedback : t.incorrectFeedback;
244
+ return /* @__PURE__ */ I(Wt, { "data-isPrediction": m, children: [
245
+ p === Y.RESOLVED && n === D.TRIVIA && !s && /* @__PURE__ */ I($, { children: [
246
+ /* @__PURE__ */ r(he, { children: /* @__PURE__ */ r(x, { name: "questionExpired" }) }),
247
+ /* @__PURE__ */ I("div", { children: [
248
+ /* @__PURE__ */ r(me, { children: /* @__PURE__ */ r(J, { children: "Question Expired" }) }),
249
+ /* @__PURE__ */ r(Ht, { children: "You can still answer to see if you're correct, but no points are awarded for expired questions." })
250
+ ] })
251
+ ] }),
252
+ d && m && /* @__PURE__ */ I($, { children: [
253
+ /* @__PURE__ */ r(Ft, { name: "icon-prediction" }),
254
+ /* @__PURE__ */ r(J, { children: "Stay tuned to see if your prediction was correct." })
255
+ ] }),
256
+ d && i && /* @__PURE__ */ I($, { children: [
257
+ /* @__PURE__ */ r(he, { "data-feedbackType": h, children: /* @__PURE__ */ r(x, { name: h }) }),
258
+ /* @__PURE__ */ r("div", { children: /* @__PURE__ */ I(me, { children: [
259
+ /* @__PURE__ */ r(Vt, { "data-feedbackType": h, children: g == null ? void 0 : g.title }),
260
+ /* @__PURE__ */ r(J, { children: g == null ? void 0 : g.description })
261
+ ] }) })
262
+ ] })
263
+ ] });
264
+ };
265
+ const Gt = /* @__PURE__ */ o("div")({
266
+ name: "o",
267
+ class: "olc1eph",
268
+ propsAsIs: !1
269
+ }), Zt = /* @__PURE__ */ o("div")({
270
+ name: "n",
271
+ class: "n1yoh29a",
272
+ propsAsIs: !1
273
+ }), Jt = /* @__PURE__ */ o("div")({
274
+ name: "e",
275
+ class: "ejkr5mb",
276
+ propsAsIs: !1
277
+ }), Kt = /* @__PURE__ */ o("div")({
278
+ name: "p",
279
+ class: "p82wnnx",
280
+ propsAsIs: !1
281
+ });
282
+ const Xt = () => Ue, es = () => Ue, ts = () => x, ss = /* @__PURE__ */ o("button")({
283
+ name: "c",
284
+ class: "cpm4u8k",
285
+ propsAsIs: !1
286
+ }), ns = /* @__PURE__ */ o("div")({
287
+ name: "l",
288
+ class: "lwfomc3",
289
+ propsAsIs: !1
290
+ }), is = /* @__PURE__ */ o("span")({
291
+ name: "d",
292
+ class: "dmltvg2",
293
+ propsAsIs: !1
294
+ }), rs = /* @__PURE__ */ o("div")({
295
+ name: "s",
296
+ class: "stfjpqz",
297
+ propsAsIs: !1
298
+ }), as = /* @__PURE__ */ o("div")({
299
+ name: "p",
300
+ class: "p198m24r",
301
+ propsAsIs: !1
302
+ }), Ue = /* @__PURE__ */ o("img")({
303
+ name: "r",
304
+ class: "rbq5eu7",
305
+ propsAsIs: !1
306
+ }), os = /* @__PURE__ */ o(Xt())({
307
+ name: "g",
308
+ class: "g1iv6oeb",
309
+ propsAsIs: !0
310
+ }), ls = /* @__PURE__ */ o(es())({
311
+ name: "h",
312
+ class: "h1qtxlqc",
313
+ propsAsIs: !0
314
+ }), cs = /* @__PURE__ */ o("span")({
315
+ name: "u",
316
+ class: "udm736q",
317
+ propsAsIs: !1
318
+ }), ds = /* @__PURE__ */ o("span")({
319
+ name: "b",
320
+ class: "b1da34tx",
321
+ propsAsIs: !1
322
+ }), us = /* @__PURE__ */ o("span")({
323
+ name: "x",
324
+ class: "x1dqwq83",
325
+ propsAsIs: !1
326
+ }), ps = /* @__PURE__ */ o(ts())({
327
+ name: "v",
328
+ class: "v10s9my2",
329
+ propsAsIs: !0
330
+ }), fe = {
331
+ [L.CENTERED]: (t) => /* @__PURE__ */ r(os, { alt: "option-icon", src: t }),
332
+ [L.TRANSPARENT]: (t) => /* @__PURE__ */ r(rs, { children: /* @__PURE__ */ r(as, { style: { backgroundImage: `url(${t})` } }) }),
333
+ [L.ROUNDED]: (t) => /* @__PURE__ */ r(ls, { alt: "option-icon", src: t }),
334
+ [L.NONE]: () => null,
335
+ [L.UNSET]: () => null
336
+ }, hs = ({ questionType: t, hasCorrectAnswer: e, correct: s, youVoted: n, questionVoted: i }) => {
337
+ if (t === D.POLL && n)
338
+ return "correct";
339
+ if (t === D.PREDICTION) {
340
+ if (e && i)
341
+ return n ? s ? "correct" : "incorrect" : s ? "correct" : "unset";
342
+ if (n)
343
+ return "correct";
344
+ }
345
+ return t === D.TRIVIA && i ? n ? s ? "correct" : "incorrect" : s ? "correct" : "unset" : "unset";
346
+ }, ms = ({
347
+ questionType: t,
348
+ questionVoted: e,
349
+ correct: s,
350
+ hasCorrectAnswer: n,
351
+ questionStatus: i
352
+ }) => t === D.TRIVIA ? e && s : t === D.PREDICTION ? e && s && n || i === Y.RESOLVED && s : !1, fs = (t) => {
353
+ var e;
354
+ const {
355
+ // option props
356
+ id: s,
357
+ icon: n,
358
+ text: i,
359
+ percentageDecimal: p,
360
+ // extra props
361
+ onVote: d,
362
+ youSelected: m,
363
+ questionVoted: h,
364
+ // ToDo: Figure out why imageMode is not in the response, and delete default value
365
+ imageMode: g = L.ROUNDED,
366
+ answerTimeExpired: _,
367
+ questionStatus: z,
368
+ isLoading: l,
369
+ questionType: M,
370
+ correct: y,
371
+ hasCorrectAnswer: a
372
+ } = t, u = hs(t), c = ms({ questionType: M, questionVoted: h, correct: y, hasCorrectAnswer: a, questionStatus: z }), f = h || z === Y.RESOLVED && M === D.PREDICTION;
373
+ return /* @__PURE__ */ I(
374
+ ss,
375
+ {
376
+ value: s,
377
+ "data-selected": m,
378
+ "data-answerState": u,
379
+ disabled: h || l || _,
380
+ onClick: d,
381
+ children: [
382
+ f && /* @__PURE__ */ r(ns, { "data-answerState": u, style: { width: `${p}%` } }),
383
+ /* @__PURE__ */ I(is, { children: [
384
+ n && ((e = fe[g]) == null ? void 0 : e.call(fe, n)),
385
+ /* @__PURE__ */ r(cs, { children: i }),
386
+ f && /* @__PURE__ */ I(ds, { children: [
387
+ c && /* @__PURE__ */ r(ps, { name: "selected" }),
388
+ /* @__PURE__ */ I(us, { children: [
389
+ p,
390
+ "%"
391
+ ] })
392
+ ] })
393
+ ] })
394
+ ]
395
+ }
396
+ );
397
+ };
398
+ var ge = typeof window > "u" ? it : rt, gs = ({ isPlaying: t, duration: e, startAt: s = 0, updateInterval: n = 0, onComplete: i, onUpdate: p }) => {
399
+ let [d, m] = R(s), h = E(0), g = E(s), _ = E(s * -1e3), z = E(null), l = E(null), M = E(null), y = (c) => {
400
+ let f = c / 1e3;
401
+ if (l.current === null) {
402
+ l.current = f, z.current = requestAnimationFrame(y);
403
+ return;
404
+ }
405
+ let v = f - l.current, N = h.current + v;
406
+ l.current = f, h.current = N;
407
+ let A = g.current + (n === 0 ? N : (N / n | 0) * n), T = g.current + N, S = typeof e == "number" && T >= e;
408
+ m(S ? e : A), S || (z.current = requestAnimationFrame(y));
409
+ }, a = () => {
410
+ z.current && cancelAnimationFrame(z.current), M.current && clearTimeout(M.current), l.current = null;
411
+ }, u = P((c) => {
412
+ a(), h.current = 0;
413
+ let f = typeof c == "number" ? c : s;
414
+ g.current = f, m(f), t && (z.current = requestAnimationFrame(y));
415
+ }, [t, s]);
416
+ return ge(() => {
417
+ if (p == null || p(d), e && d >= e) {
418
+ _.current += e * 1e3;
419
+ let { shouldRepeat: c = !1, delay: f = 0, newStartAt: v } = (i == null ? void 0 : i(_.current / 1e3)) || {};
420
+ c && (M.current = setTimeout(() => u(v), f * 1e3));
421
+ }
422
+ }, [d, e]), ge(() => (t && (z.current = requestAnimationFrame(y)), a), [t, e, n]), { elapsedTime: d, reset: u };
423
+ }, Is = (t, e, s) => {
424
+ let n = t / 2, i = e / 2, p = n - i, d = 2 * p, m = s === "clockwise" ? "1,0" : "0,1", h = 2 * Math.PI * p;
425
+ return { path: `m ${n},${i} a ${p},${p} 0 ${m} 0,${d} a ${p},${p} 0 ${m} 0,-${d}`, pathLength: h };
426
+ }, Ie = (t, e) => t === 0 || t === e ? 0 : typeof e == "number" ? t - e : 0, vs = (t) => ({ position: "relative", width: t, height: t }), Ms = { display: "flex", justifyContent: "center", alignItems: "center", position: "absolute", left: 0, top: 0, width: "100%", height: "100%" }, Qe = (t, e, s, n, i) => {
427
+ if (n === 0)
428
+ return e;
429
+ let p = (i ? n - t : t) / n;
430
+ return e + s * p;
431
+ }, ve = (t) => {
432
+ var e, s;
433
+ return (s = (e = t.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (n, i, p, d) => `#${i}${i}${p}${p}${d}${d}`).substring(1).match(/.{2}/g)) == null ? void 0 : e.map((n) => parseInt(n, 16))) != null ? s : [];
434
+ }, ys = (t, e) => {
435
+ var s;
436
+ let { colors: n, colorsTime: i, isSmoothColorTransition: p = !0 } = t;
437
+ if (typeof n == "string")
438
+ return n;
439
+ let d = (s = i == null ? void 0 : i.findIndex((l, M) => l >= e && e >= i[M + 1])) != null ? s : -1;
440
+ if (!i || d === -1)
441
+ return n[0];
442
+ if (!p)
443
+ return n[d];
444
+ let m = i[d] - e, h = i[d] - i[d + 1], g = ve(n[d]), _ = ve(n[d + 1]), z = !!t.isGrowing;
445
+ return `rgb(${g.map((l, M) => Qe(m, l, _[M] - l, h, z) | 0).join(",")})`;
446
+ }, zs = (t) => {
447
+ let { duration: e, initialRemainingTime: s, updateInterval: n, size: i = 180, strokeWidth: p = 12, trailStrokeWidth: d, isPlaying: m = !1, isGrowing: h = !1, rotation: g = "clockwise", onComplete: _, onUpdate: z } = t, l = E(), M = Math.max(p, d ?? 0), { path: y, pathLength: a } = Is(i, M, g), { elapsedTime: u } = gs({ isPlaying: m, duration: e, startAt: Ie(e, s), updateInterval: n, onUpdate: typeof z == "function" ? (f) => {
448
+ let v = Math.ceil(e - f);
449
+ v !== l.current && (l.current = v, z(v));
450
+ } : void 0, onComplete: typeof _ == "function" ? (f) => {
451
+ var v;
452
+ let { shouldRepeat: N, delay: A, newInitialRemainingTime: T } = (v = _(f)) != null ? v : {};
453
+ if (N)
454
+ return { shouldRepeat: N, delay: A, newStartAt: Ie(e, T) };
455
+ } : void 0 }), c = e - u;
456
+ return { elapsedTime: u, path: y, pathLength: a, remainingTime: Math.ceil(c), rotation: g, size: i, stroke: ys(t, c), strokeDashoffset: Qe(u, 0, a, e, h), strokeWidth: p };
457
+ }, qe = (t) => {
458
+ let { children: e, strokeLinecap: s, trailColor: n, trailStrokeWidth: i } = t, { path: p, pathLength: d, stroke: m, strokeDashoffset: h, remainingTime: g, elapsedTime: _, size: z, strokeWidth: l } = zs(t);
459
+ return Q.createElement("div", { style: vs(z) }, Q.createElement("svg", { viewBox: `0 0 ${z} ${z}`, width: z, height: z, xmlns: "http://www.w3.org/2000/svg" }, Q.createElement("path", { d: p, fill: "none", stroke: n ?? "#d9d9d9", strokeWidth: i ?? l }), Q.createElement("path", { d: p, fill: "none", stroke: m, strokeLinecap: s ?? "round", strokeWidth: l, strokeDasharray: d, strokeDashoffset: h })), typeof e == "function" && Q.createElement("div", { style: Ms }, e({ remainingTime: g, elapsedTime: _, color: m })));
460
+ };
461
+ qe.displayName = "CountdownCircleTimer";
462
+ const Ns = [C.PRIMARY_GREEN1, C.SECONDARY_RED1, C.SECONDARY_RED1], As = [10, 10, 0], _s = /* @__PURE__ */ o("div")({
463
+ name: "A",
464
+ class: "a1f928zy",
465
+ propsAsIs: !1
466
+ }), Ts = C.SECONDARY_GREEN6, Me = C.SECONDARY_RED3, Ss = C.NEUTRALS_GRAY3, xs = ({
467
+ isPlaying: t = !0,
468
+ duration: e = 30,
469
+ onTimerExpired: s
470
+ }) => {
471
+ const [n, i] = R(e > 10 ? Ts : Me), p = ({
472
+ remainingTime: h
473
+ }) => /* @__PURE__ */ r(_s, {
474
+ children: h
475
+ }), d = P(() => {
476
+ s == null || s(), i(Ss);
477
+ }, [s, i]), m = P((h) => {
478
+ h === 10 && i(Me);
479
+ }, [i]);
480
+ return /* @__PURE__ */ r(qe, {
481
+ isPlaying: t,
482
+ duration: e,
483
+ colors: Ns,
484
+ colorsTime: As,
485
+ size: 32,
486
+ strokeWidth: 2,
487
+ trailStrokeWidth: 2,
488
+ trailColor: n,
489
+ onComplete: d,
490
+ onUpdate: m,
491
+ children: p
492
+ });
493
+ };
494
+ const Ds = () => x, ws = /* @__PURE__ */ o("div")({
495
+ name: "a",
496
+ class: "a1r7f3z4",
497
+ propsAsIs: !1
498
+ }), bs = /* @__PURE__ */ o("div")({
499
+ name: "s",
500
+ class: "sblndl",
501
+ propsAsIs: !1
502
+ }), ks = /* @__PURE__ */ o("div")({
503
+ name: "l",
504
+ class: "l7ka1tv",
505
+ propsAsIs: !1
506
+ }), Os = /* @__PURE__ */ o(Ds())({
507
+ name: "p",
508
+ class: "p1edlxt3",
509
+ propsAsIs: !0
510
+ }), Es = /* @__PURE__ */ o("div")({
511
+ name: "g",
512
+ class: "ghm08u2",
513
+ propsAsIs: !1
514
+ }), js = /* @__PURE__ */ o("span")({
515
+ name: "c",
516
+ class: "c12nsh46",
517
+ propsAsIs: !1
518
+ }), Ls = /* @__PURE__ */ o("span")({
519
+ name: "d",
520
+ class: "dlr9eoc",
521
+ propsAsIs: !1
522
+ }), $s = ({ title: t, points: e, isPlayingTimer: s, isTimer: n, onTimerExpired: i }) => /* @__PURE__ */ I(ws, { children: [
523
+ /* @__PURE__ */ I(bs, { children: [
524
+ t && /* @__PURE__ */ r(ks, { children: t }),
525
+ e !== void 0 && /* @__PURE__ */ I($, { children: [
526
+ /* @__PURE__ */ r(Os, { name: "icon-trophy" }),
527
+ /* @__PURE__ */ I(Es, { children: [
528
+ /* @__PURE__ */ r(js, { children: e }),
529
+ /* @__PURE__ */ r(Ls, { children: "PTS" })
530
+ ] })
531
+ ] })
532
+ ] }),
533
+ n && /* @__PURE__ */ r(xs, { isPlaying: s, onTimerExpired: i })
534
+ ] }), Cs = ({ openedQuestion: t, vote: e, close: s }) => {
535
+ var n;
536
+ const i = t.subject, p = t.type, d = (n = t.options) == null ? void 0 : n.options, [m, h] = R(!1), [g, _] = R(!1), [z, l] = R(""), M = t == null ? void 0 : t.id, y = P(
537
+ async (N) => {
538
+ if (M) {
539
+ const A = N.currentTarget.value;
540
+ l(A), _(!0), await e(M, A), _(!1);
541
+ }
542
+ },
543
+ [M, l, e]
544
+ ), a = P(() => {
545
+ h(!0), setTimeout(s, 3e3);
546
+ }, [s]), u = B(
547
+ () => t == null ? void 0 : t.answers.find((N) => N.youVoted === !0),
548
+ [t]
549
+ ), c = B(
550
+ () => !!(t != null && t.answers.find((N) => N.correct === !0)),
551
+ [t]
552
+ ), f = B(() => t ? t.answers.map((N) => ({
553
+ ...N,
554
+ questionVoted: !!u,
555
+ youSelected: z === N.id,
556
+ isLoading: g,
557
+ hasCorrectAnswer: c,
558
+ questionType: t.type,
559
+ answerTimeExpired: m,
560
+ questionStatus: t.status,
561
+ // ToDo: Figure out why imageMode is not in the response
562
+ onVote: y
563
+ })) : [], [c, m, g, t, u, y, z]), v = d && (d.case === "trivia" || d.case === "prediction") ? d.value : void 0;
564
+ return /* @__PURE__ */ r(Le, { "data-question-header": "true", children: /* @__PURE__ */ r(Gt, { children: /* @__PURE__ */ I(Zt, { children: [
565
+ v && /* @__PURE__ */ r(
566
+ Bt,
567
+ {
568
+ feedbackMessages: v,
569
+ questionVoted: !!u,
570
+ questionVotedCorrectly: u == null ? void 0 : u.correct,
571
+ questionType: p,
572
+ hasCorrectAnswer: c,
573
+ questionStatus: t.status
574
+ }
575
+ ),
576
+ /* @__PURE__ */ r(
577
+ $s,
578
+ {
579
+ title: m ? "Time expired" : "To win",
580
+ points: m ? void 0 : 100,
581
+ onTimerExpired: a,
582
+ isTimer: !0
583
+ }
584
+ ),
585
+ m ? /* @__PURE__ */ r(
586
+ Yt,
587
+ {
588
+ title: "More to come...",
589
+ description: "Watch for additional enhanced stream interactive experience."
590
+ }
591
+ ) : /* @__PURE__ */ I($, { children: [
592
+ /* @__PURE__ */ r(Jt, { children: i }),
593
+ /* @__PURE__ */ r(Kt, { children: f.map((N) => /* @__PURE__ */ r(fs, { ...N }, N.id)) })
594
+ ] })
595
+ ] }) }) });
596
+ };
597
+ const Rs = /* @__PURE__ */ o("div")({
598
+ name: "e",
599
+ class: "e1eio0mt",
600
+ propsAsIs: !1
601
+ }), Us = /* @__PURE__ */ o("div")({
602
+ name: "i",
603
+ class: "iigl87b",
604
+ propsAsIs: !1
605
+ }), Qs = /* @__PURE__ */ o("h3")({
606
+ name: "n",
607
+ class: "n1o2cwub",
608
+ propsAsIs: !1
609
+ }), qs = /* @__PURE__ */ o("div")({
610
+ name: "r",
611
+ class: "r3uxe45",
612
+ propsAsIs: !1
613
+ }), Ys = /* @__PURE__ */ o("div")({
614
+ name: "l",
615
+ class: "lrqius",
616
+ propsAsIs: !1
617
+ }), Ye = ({ created: t, title: e, instantView: s }) => {
618
+ const n = B(() => {
619
+ if (t) {
620
+ const i = new Date(t);
621
+ if (Je(i))
622
+ return {
623
+ date: Ke(i),
624
+ time: Xe(i)
625
+ };
626
+ }
627
+ return null;
628
+ }, [t]);
629
+ return /* @__PURE__ */ I(Rs, { children: [
630
+ n && /* @__PURE__ */ I(Ys, { children: [
631
+ n.date,
632
+ " · ",
633
+ n.time
634
+ ] }),
635
+ (s == null ? void 0 : s.video) && /* @__PURE__ */ r(et, { source: s.video.url, poster: s.video.thumbnailUrl }),
636
+ /* @__PURE__ */ I(Us, { children: [
637
+ /* @__PURE__ */ r(Qs, { children: (s == null ? void 0 : s.heading) || e }),
638
+ /* @__PURE__ */ r(qs, { children: s == null ? void 0 : s.body })
639
+ ] })
640
+ ] });
641
+ };
642
+ const Ps = /* @__PURE__ */ o("div")({
643
+ name: "o",
644
+ class: "o18unvw4",
645
+ propsAsIs: !1
646
+ }), Ws = /* @__PURE__ */ o("a")({
647
+ name: "n",
648
+ class: "ns0uvk8",
649
+ propsAsIs: !1
650
+ }), Fs = ({ instantView: t, ...e }) => /* @__PURE__ */ I(Ps, { children: [
651
+ /* @__PURE__ */ r(Ye, { instantView: t, ...e }),
652
+ (t == null ? void 0 : t.webLink) && /* @__PURE__ */ I(Ws, { href: t == null ? void 0 : t.webLink.url, target: "_blank", children: [
653
+ "Explore more of the Masters History",
654
+ /* @__PURE__ */ r(x, { name: "icon-external-link" })
655
+ ] })
656
+ ] });
657
+ const Vs = /* @__PURE__ */ o("div")({
658
+ name: "d",
659
+ class: "dk8r1eq",
660
+ propsAsIs: !1
661
+ }), Hs = ({
662
+ openedQuestion: t
663
+ }) => {
664
+ var e;
665
+ return ((e = t == null ? void 0 : t.attributes) == null ? void 0 : e.attributes.case) === "insight" ? /* @__PURE__ */ r(Fs, {
666
+ created: t.attributes.created,
667
+ ...t.attributes.attributes.value
668
+ }) : null;
669
+ }, Bs = ({
670
+ extendedQuestion: t,
671
+ vote: e,
672
+ close: s
673
+ }) => {
674
+ const {
675
+ loading: n,
676
+ data: i
677
+ } = t;
678
+ return !n && i ? /* @__PURE__ */ r(Cs, {
679
+ vote: e,
680
+ close: s,
681
+ openedQuestion: i
682
+ }) : null;
683
+ }, Gs = ({
684
+ gamification: t
685
+ }) => {
686
+ var e;
687
+ const s = O(t.openedQuestion.$store), n = O(t.openedQuestion.$extendedStore);
688
+ if (!s)
689
+ return null;
690
+ const i = s.type;
691
+ return /* @__PURE__ */ I(Vs, {
692
+ children: [/* @__PURE__ */ r(Ce, {
693
+ close: t.closeQuestion,
694
+ type: ((e = s.attributes) == null ? void 0 : e.type) || D.UNSET
695
+ }), i === "question" && /* @__PURE__ */ r(Bs, {
696
+ vote: t.submitAnswer,
697
+ close: t.closeQuestion,
698
+ extendedQuestion: n
699
+ }), i !== "question" && /* @__PURE__ */ r(Hs, {
700
+ openedQuestion: s
701
+ })]
702
+ });
703
+ };
704
+ const Zs = /* @__PURE__ */ o("div")({
705
+ name: "t",
706
+ class: "tcim9sm",
707
+ propsAsIs: !1
708
+ }), Js = /* @__PURE__ */ o("div")({
709
+ name: "e",
710
+ class: "e8wco6o",
711
+ propsAsIs: !1
712
+ }), Ks = /* @__PURE__ */ o("button")({
713
+ name: "n",
714
+ class: "n1ardwzl",
715
+ propsAsIs: !1
716
+ }), Xs = /* @__PURE__ */ o("span")({
717
+ name: "i",
718
+ class: "i1vk8ojx",
719
+ propsAsIs: !1
720
+ });
721
+ var q = /* @__PURE__ */ ((t) => (t.HOME = "home", t.LEADERBOARD = "leaderboard", t))(q || {});
722
+ const ye = ({ title: t, active: e, onClick: s }) => /* @__PURE__ */ r(Ks, { onClick: s, "data-selected": e, children: /* @__PURE__ */ r(Xs, { children: t }) }), en = ({ activePage: t = "home", toggleActivePage: e }) => /* @__PURE__ */ r(Zs, { children: /* @__PURE__ */ I(Js, { "data-position": t === "home" ? "left" : "right", children: [
723
+ /* @__PURE__ */ r(ye, { title: "Home", active: t === "home", onClick: () => e(
724
+ "home"
725
+ /* HOME */
726
+ ) }),
727
+ /* @__PURE__ */ r(
728
+ ye,
729
+ {
730
+ title: "Leader Board",
731
+ active: t === "leaderboard",
732
+ onClick: () => e(
733
+ "leaderboard"
734
+ /* LEADERBOARD */
735
+ )
736
+ }
737
+ )
738
+ ] }) });
739
+ let w;
740
+ typeof window < "u" ? w = window : typeof self < "u" ? w = self : w = tt.global;
741
+ let ie = null, re = null;
742
+ const ze = 20, K = w.clearTimeout, Ne = w.setTimeout, X = w.cancelAnimationFrame || w.mozCancelAnimationFrame || w.webkitCancelAnimationFrame, Ae = w.requestAnimationFrame || w.mozRequestAnimationFrame || w.webkitRequestAnimationFrame;
743
+ X == null || Ae == null ? (ie = K, re = function(e) {
744
+ return Ne(e, ze);
745
+ }) : (ie = function([e, s]) {
746
+ X(e), K(s);
747
+ }, re = function(e) {
748
+ const s = Ae(function() {
749
+ K(n), e();
750
+ }), n = Ne(function() {
751
+ X(s), e();
752
+ }, ze);
753
+ return [s, n];
754
+ });
755
+ function tn(t) {
756
+ let e, s, n, i, p, d, m;
757
+ const h = typeof document < "u" && document.attachEvent;
758
+ if (!h) {
759
+ d = function(c) {
760
+ const f = c.__resizeTriggers__, v = f.firstElementChild, N = f.lastElementChild, A = v.firstElementChild;
761
+ N.scrollLeft = N.scrollWidth, N.scrollTop = N.scrollHeight, A.style.width = v.offsetWidth + 1 + "px", A.style.height = v.offsetHeight + 1 + "px", v.scrollLeft = v.scrollWidth, v.scrollTop = v.scrollHeight;
762
+ }, p = function(c) {
763
+ return c.offsetWidth !== c.__resizeLast__.width || c.offsetHeight !== c.__resizeLast__.height;
764
+ }, m = function(c) {
765
+ if (c.target.className && typeof c.target.className.indexOf == "function" && c.target.className.indexOf("contract-trigger") < 0 && c.target.className.indexOf("expand-trigger") < 0)
766
+ return;
767
+ const f = this;
768
+ d(this), this.__resizeRAF__ && ie(this.__resizeRAF__), this.__resizeRAF__ = re(function() {
769
+ p(f) && (f.__resizeLast__.width = f.offsetWidth, f.__resizeLast__.height = f.offsetHeight, f.__resizeListeners__.forEach(function(A) {
770
+ A.call(f, c);
771
+ }));
772
+ });
773
+ };
774
+ let l = !1, M = "";
775
+ n = "animationstart";
776
+ const y = "Webkit Moz O ms".split(" ");
777
+ let a = "webkitAnimationStart animationstart oAnimationStart MSAnimationStart".split(" "), u = "";
778
+ {
779
+ const c = document.createElement("fakeelement");
780
+ if (c.style.animationName !== void 0 && (l = !0), l === !1) {
781
+ for (let f = 0; f < y.length; f++)
782
+ if (c.style[y[f] + "AnimationName"] !== void 0) {
783
+ u = y[f], M = "-" + u.toLowerCase() + "-", n = a[f], l = !0;
784
+ break;
785
+ }
786
+ }
787
+ }
788
+ s = "resizeanim", e = "@" + M + "keyframes " + s + " { from { opacity: 0; } to { opacity: 0; } } ", i = M + "animation: 1ms " + s + "; ";
789
+ }
790
+ const g = function(l) {
791
+ if (!l.getElementById("detectElementResize")) {
792
+ const M = (e || "") + ".resize-triggers { " + (i || "") + 'visibility: hidden; opacity: 0; } .resize-triggers, .resize-triggers > div, .contract-trigger:before { content: " "; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .resize-triggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }', y = l.head || l.getElementsByTagName("head")[0], a = l.createElement("style");
793
+ a.id = "detectElementResize", a.type = "text/css", t != null && a.setAttribute("nonce", t), a.styleSheet ? a.styleSheet.cssText = M : a.appendChild(l.createTextNode(M)), y.appendChild(a);
794
+ }
795
+ };
796
+ return {
797
+ addResizeListener: function(l, M) {
798
+ if (h)
799
+ l.attachEvent("onresize", M);
800
+ else {
801
+ if (!l.__resizeTriggers__) {
802
+ const y = l.ownerDocument, a = w.getComputedStyle(l);
803
+ a && a.position === "static" && (l.style.position = "relative"), g(y), l.__resizeLast__ = {}, l.__resizeListeners__ = [], (l.__resizeTriggers__ = y.createElement("div")).className = "resize-triggers";
804
+ const u = y.createElement("div");
805
+ u.className = "expand-trigger", u.appendChild(y.createElement("div"));
806
+ const c = y.createElement("div");
807
+ c.className = "contract-trigger", l.__resizeTriggers__.appendChild(u), l.__resizeTriggers__.appendChild(c), l.appendChild(l.__resizeTriggers__), d(l), l.addEventListener("scroll", m, !0), n && (l.__resizeTriggers__.__animationListener__ = function(v) {
808
+ v.animationName === s && d(l);
809
+ }, l.__resizeTriggers__.addEventListener(n, l.__resizeTriggers__.__animationListener__));
810
+ }
811
+ l.__resizeListeners__.push(M);
812
+ }
813
+ },
814
+ removeResizeListener: function(l, M) {
815
+ if (h)
816
+ l.detachEvent("onresize", M);
817
+ else if (l.__resizeListeners__.splice(l.__resizeListeners__.indexOf(M), 1), !l.__resizeListeners__.length) {
818
+ l.removeEventListener("scroll", m, !0), l.__resizeTriggers__.__animationListener__ && (l.__resizeTriggers__.removeEventListener(n, l.__resizeTriggers__.__animationListener__), l.__resizeTriggers__.__animationListener__ = null);
819
+ try {
820
+ l.__resizeTriggers__ = !l.removeChild(l.__resizeTriggers__);
821
+ } catch {
822
+ }
823
+ }
824
+ }
825
+ };
826
+ }
827
+ class sn extends at {
828
+ constructor(...e) {
829
+ super(...e), this.state = {
830
+ height: this.props.defaultHeight || 0,
831
+ scaledHeight: this.props.defaultHeight || 0,
832
+ scaledWidth: this.props.defaultWidth || 0,
833
+ width: this.props.defaultWidth || 0
834
+ }, this._autoSizer = null, this._detectElementResize = null, this._parentNode = null, this._resizeObserver = null, this._timeoutId = null, this._onResize = () => {
835
+ this._timeoutId = null;
836
+ const {
837
+ disableHeight: s,
838
+ disableWidth: n,
839
+ onResize: i
840
+ } = this.props;
841
+ if (this._parentNode) {
842
+ var p, d, m, h;
843
+ const g = window.getComputedStyle(this._parentNode) || {}, _ = parseFloat((p = g.paddingLeft) !== null && p !== void 0 ? p : "0"), z = parseFloat((d = g.paddingRight) !== null && d !== void 0 ? d : "0"), l = parseFloat((m = g.paddingTop) !== null && m !== void 0 ? m : "0"), M = parseFloat((h = g.paddingBottom) !== null && h !== void 0 ? h : "0"), y = this._parentNode.getBoundingClientRect(), a = y.height - l - M, u = y.width - _ - z, c = this._parentNode.offsetHeight - l - M, f = this._parentNode.offsetWidth - _ - z;
844
+ (!s && (this.state.height !== c || this.state.scaledHeight !== a) || !n && (this.state.width !== f || this.state.scaledWidth !== u)) && (this.setState({
845
+ height: c,
846
+ width: f,
847
+ scaledHeight: a,
848
+ scaledWidth: u
849
+ }), typeof i == "function" && i({
850
+ height: c,
851
+ scaledHeight: a,
852
+ scaledWidth: u,
853
+ width: f
854
+ }));
855
+ }
856
+ }, this._setRef = (s) => {
857
+ this._autoSizer = s;
858
+ };
859
+ }
860
+ componentDidMount() {
861
+ const {
862
+ nonce: e
863
+ } = this.props;
864
+ this._autoSizer && this._autoSizer.parentNode && this._autoSizer.parentNode.ownerDocument && this._autoSizer.parentNode.ownerDocument.defaultView && this._autoSizer.parentNode instanceof this._autoSizer.parentNode.ownerDocument.defaultView.HTMLElement && (this._parentNode = this._autoSizer.parentNode, this._parentNode != null && (typeof ResizeObserver < "u" ? (this._resizeObserver = new ResizeObserver(() => {
865
+ this._timeoutId = setTimeout(this._onResize, 0);
866
+ }), this._resizeObserver.observe(this._parentNode)) : (this._detectElementResize = tn(e), this._detectElementResize.addResizeListener(this._parentNode, this._onResize)), this._onResize()));
867
+ }
868
+ componentWillUnmount() {
869
+ this._parentNode && (this._detectElementResize && this._detectElementResize.removeResizeListener(this._parentNode, this._onResize), this._timeoutId !== null && clearTimeout(this._timeoutId), this._resizeObserver && (this._resizeObserver.observe(this._parentNode), this._resizeObserver.disconnect()));
870
+ }
871
+ render() {
872
+ const {
873
+ children: e,
874
+ defaultHeight: s,
875
+ defaultWidth: n,
876
+ disableHeight: i = !1,
877
+ disableWidth: p = !1,
878
+ nonce: d,
879
+ onResize: m,
880
+ style: h = {},
881
+ tagName: g = "div",
882
+ ..._
883
+ } = this.props, {
884
+ height: z,
885
+ scaledHeight: l,
886
+ scaledWidth: M,
887
+ width: y
888
+ } = this.state, a = {
889
+ overflow: "visible"
890
+ }, u = {};
891
+ let c = !1;
892
+ return i || (z === 0 && (c = !0), a.height = 0, u.height = z, u.scaledHeight = l), p || (y === 0 && (c = !0), a.width = 0, u.width = y, u.scaledWidth = M), G(g, {
893
+ ref: this._setRef,
894
+ style: {
895
+ ...a,
896
+ ...h
897
+ },
898
+ ..._
899
+ }, !c && e(u));
900
+ }
901
+ }
902
+ function ae() {
903
+ return ae = Object.assign ? Object.assign.bind() : function(t) {
904
+ for (var e = 1; e < arguments.length; e++) {
905
+ var s = arguments[e];
906
+ for (var n in s)
907
+ Object.prototype.hasOwnProperty.call(s, n) && (t[n] = s[n]);
908
+ }
909
+ return t;
910
+ }, ae.apply(this, arguments);
911
+ }
912
+ function _e(t) {
913
+ if (t === void 0)
914
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
915
+ return t;
916
+ }
917
+ function oe(t, e) {
918
+ return oe = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, i) {
919
+ return n.__proto__ = i, n;
920
+ }, oe(t, e);
921
+ }
922
+ function nn(t, e) {
923
+ t.prototype = Object.create(e.prototype), t.prototype.constructor = t, oe(t, e);
924
+ }
925
+ var Te = Number.isNaN || function(e) {
926
+ return typeof e == "number" && e !== e;
927
+ };
928
+ function rn(t, e) {
929
+ return !!(t === e || Te(t) && Te(e));
930
+ }
931
+ function an(t, e) {
932
+ if (t.length !== e.length)
933
+ return !1;
934
+ for (var s = 0; s < t.length; s++)
935
+ if (!rn(t[s], e[s]))
936
+ return !1;
937
+ return !0;
938
+ }
939
+ function ee(t, e) {
940
+ e === void 0 && (e = an);
941
+ var s, n = [], i, p = !1;
942
+ function d() {
943
+ for (var m = [], h = 0; h < arguments.length; h++)
944
+ m[h] = arguments[h];
945
+ return p && s === this && e(m, n) || (i = t.apply(this, m), p = !0, s = this, n = m), i;
946
+ }
947
+ return d;
948
+ }
949
+ var on = typeof performance == "object" && typeof performance.now == "function", Se = on ? function() {
950
+ return performance.now();
951
+ } : function() {
952
+ return Date.now();
953
+ };
954
+ function xe(t) {
955
+ cancelAnimationFrame(t.id);
956
+ }
957
+ function ln(t, e) {
958
+ var s = Se();
959
+ function n() {
960
+ Se() - s >= e ? t.call(null) : i.id = requestAnimationFrame(n);
961
+ }
962
+ var i = {
963
+ id: requestAnimationFrame(n)
964
+ };
965
+ return i;
966
+ }
967
+ var te = -1;
968
+ function De(t) {
969
+ if (t === void 0 && (t = !1), te === -1 || t) {
970
+ var e = document.createElement("div"), s = e.style;
971
+ s.width = "50px", s.height = "50px", s.overflow = "scroll", document.body.appendChild(e), te = e.offsetWidth - e.clientWidth, document.body.removeChild(e);
972
+ }
973
+ return te;
974
+ }
975
+ var j = null;
976
+ function we(t) {
977
+ if (t === void 0 && (t = !1), j === null || t) {
978
+ var e = document.createElement("div"), s = e.style;
979
+ s.width = "50px", s.height = "50px", s.overflow = "scroll", s.direction = "rtl";
980
+ var n = document.createElement("div"), i = n.style;
981
+ return i.width = "100px", i.height = "100px", e.appendChild(n), document.body.appendChild(e), e.scrollLeft > 0 ? j = "positive-descending" : (e.scrollLeft = 1, e.scrollLeft === 0 ? j = "negative" : j = "positive-ascending"), document.body.removeChild(e), j;
982
+ }
983
+ return j;
984
+ }
985
+ var cn = 150, dn = function(e, s) {
986
+ return e;
987
+ };
988
+ function un(t) {
989
+ var e, s = t.getItemOffset, n = t.getEstimatedTotalSize, i = t.getItemSize, p = t.getOffsetForIndexAndAlignment, d = t.getStartIndexForOffset, m = t.getStopIndexForStartIndex, h = t.initInstanceProps, g = t.shouldResetStyleCacheOnItemSizeChange, _ = t.validateProps;
990
+ return e = /* @__PURE__ */ function(z) {
991
+ nn(l, z);
992
+ function l(y) {
993
+ var a;
994
+ return a = z.call(this, y) || this, a._instanceProps = h(a.props, _e(a)), a._outerRef = void 0, a._resetIsScrollingTimeoutId = null, a.state = {
995
+ instance: _e(a),
996
+ isScrolling: !1,
997
+ scrollDirection: "forward",
998
+ scrollOffset: typeof a.props.initialScrollOffset == "number" ? a.props.initialScrollOffset : 0,
999
+ scrollUpdateWasRequested: !1
1000
+ }, a._callOnItemsRendered = void 0, a._callOnItemsRendered = ee(function(u, c, f, v) {
1001
+ return a.props.onItemsRendered({
1002
+ overscanStartIndex: u,
1003
+ overscanStopIndex: c,
1004
+ visibleStartIndex: f,
1005
+ visibleStopIndex: v
1006
+ });
1007
+ }), a._callOnScroll = void 0, a._callOnScroll = ee(function(u, c, f) {
1008
+ return a.props.onScroll({
1009
+ scrollDirection: u,
1010
+ scrollOffset: c,
1011
+ scrollUpdateWasRequested: f
1012
+ });
1013
+ }), a._getItemStyle = void 0, a._getItemStyle = function(u) {
1014
+ var c = a.props, f = c.direction, v = c.itemSize, N = c.layout, A = a._getItemStyleCache(g && v, g && N, g && f), T;
1015
+ if (A.hasOwnProperty(u))
1016
+ T = A[u];
1017
+ else {
1018
+ var S = s(a.props, u, a._instanceProps), b = i(a.props, u, a._instanceProps), k = f === "horizontal" || N === "horizontal", W = f === "rtl", F = k ? S : 0;
1019
+ A[u] = T = {
1020
+ position: "absolute",
1021
+ left: W ? void 0 : F,
1022
+ right: W ? F : void 0,
1023
+ top: k ? 0 : S,
1024
+ height: k ? "100%" : b,
1025
+ width: k ? b : "100%"
1026
+ };
1027
+ }
1028
+ return T;
1029
+ }, a._getItemStyleCache = void 0, a._getItemStyleCache = ee(function(u, c, f) {
1030
+ return {};
1031
+ }), a._onScrollHorizontal = function(u) {
1032
+ var c = u.currentTarget, f = c.clientWidth, v = c.scrollLeft, N = c.scrollWidth;
1033
+ a.setState(function(A) {
1034
+ if (A.scrollOffset === v)
1035
+ return null;
1036
+ var T = a.props.direction, S = v;
1037
+ if (T === "rtl")
1038
+ switch (we()) {
1039
+ case "negative":
1040
+ S = -v;
1041
+ break;
1042
+ case "positive-descending":
1043
+ S = N - f - v;
1044
+ break;
1045
+ }
1046
+ return S = Math.max(0, Math.min(S, N - f)), {
1047
+ isScrolling: !0,
1048
+ scrollDirection: A.scrollOffset < v ? "forward" : "backward",
1049
+ scrollOffset: S,
1050
+ scrollUpdateWasRequested: !1
1051
+ };
1052
+ }, a._resetIsScrollingDebounced);
1053
+ }, a._onScrollVertical = function(u) {
1054
+ var c = u.currentTarget, f = c.clientHeight, v = c.scrollHeight, N = c.scrollTop;
1055
+ a.setState(function(A) {
1056
+ if (A.scrollOffset === N)
1057
+ return null;
1058
+ var T = Math.max(0, Math.min(N, v - f));
1059
+ return {
1060
+ isScrolling: !0,
1061
+ scrollDirection: A.scrollOffset < T ? "forward" : "backward",
1062
+ scrollOffset: T,
1063
+ scrollUpdateWasRequested: !1
1064
+ };
1065
+ }, a._resetIsScrollingDebounced);
1066
+ }, a._outerRefSetter = function(u) {
1067
+ var c = a.props.outerRef;
1068
+ a._outerRef = u, typeof c == "function" ? c(u) : c != null && typeof c == "object" && c.hasOwnProperty("current") && (c.current = u);
1069
+ }, a._resetIsScrollingDebounced = function() {
1070
+ a._resetIsScrollingTimeoutId !== null && xe(a._resetIsScrollingTimeoutId), a._resetIsScrollingTimeoutId = ln(a._resetIsScrolling, cn);
1071
+ }, a._resetIsScrolling = function() {
1072
+ a._resetIsScrollingTimeoutId = null, a.setState({
1073
+ isScrolling: !1
1074
+ }, function() {
1075
+ a._getItemStyleCache(-1, null);
1076
+ });
1077
+ }, a;
1078
+ }
1079
+ l.getDerivedStateFromProps = function(a, u) {
1080
+ return pn(a, u), _(a), null;
1081
+ };
1082
+ var M = l.prototype;
1083
+ return M.scrollTo = function(a) {
1084
+ a = Math.max(0, a), this.setState(function(u) {
1085
+ return u.scrollOffset === a ? null : {
1086
+ scrollDirection: u.scrollOffset < a ? "forward" : "backward",
1087
+ scrollOffset: a,
1088
+ scrollUpdateWasRequested: !0
1089
+ };
1090
+ }, this._resetIsScrollingDebounced);
1091
+ }, M.scrollToItem = function(a, u) {
1092
+ u === void 0 && (u = "auto");
1093
+ var c = this.props, f = c.itemCount, v = c.layout, N = this.state.scrollOffset;
1094
+ a = Math.max(0, Math.min(a, f - 1));
1095
+ var A = 0;
1096
+ if (this._outerRef) {
1097
+ var T = this._outerRef;
1098
+ v === "vertical" ? A = T.scrollWidth > T.clientWidth ? De() : 0 : A = T.scrollHeight > T.clientHeight ? De() : 0;
1099
+ }
1100
+ this.scrollTo(p(this.props, a, u, N, this._instanceProps, A));
1101
+ }, M.componentDidMount = function() {
1102
+ var a = this.props, u = a.direction, c = a.initialScrollOffset, f = a.layout;
1103
+ if (typeof c == "number" && this._outerRef != null) {
1104
+ var v = this._outerRef;
1105
+ u === "horizontal" || f === "horizontal" ? v.scrollLeft = c : v.scrollTop = c;
1106
+ }
1107
+ this._callPropsCallbacks();
1108
+ }, M.componentDidUpdate = function() {
1109
+ var a = this.props, u = a.direction, c = a.layout, f = this.state, v = f.scrollOffset, N = f.scrollUpdateWasRequested;
1110
+ if (N && this._outerRef != null) {
1111
+ var A = this._outerRef;
1112
+ if (u === "horizontal" || c === "horizontal")
1113
+ if (u === "rtl")
1114
+ switch (we()) {
1115
+ case "negative":
1116
+ A.scrollLeft = -v;
1117
+ break;
1118
+ case "positive-ascending":
1119
+ A.scrollLeft = v;
1120
+ break;
1121
+ default:
1122
+ var T = A.clientWidth, S = A.scrollWidth;
1123
+ A.scrollLeft = S - T - v;
1124
+ break;
1125
+ }
1126
+ else
1127
+ A.scrollLeft = v;
1128
+ else
1129
+ A.scrollTop = v;
1130
+ }
1131
+ this._callPropsCallbacks();
1132
+ }, M.componentWillUnmount = function() {
1133
+ this._resetIsScrollingTimeoutId !== null && xe(this._resetIsScrollingTimeoutId);
1134
+ }, M.render = function() {
1135
+ var a = this.props, u = a.children, c = a.className, f = a.direction, v = a.height, N = a.innerRef, A = a.innerElementType, T = a.innerTagName, S = a.itemCount, b = a.itemData, k = a.itemKey, W = k === void 0 ? dn : k, F = a.layout, Pe = a.outerElementType, We = a.outerTagName, Fe = a.style, Ve = a.useIsScrolling, He = a.width, le = this.state.isScrolling, Z = f === "horizontal" || F === "horizontal", Be = Z ? this._onScrollHorizontal : this._onScrollVertical, ce = this._getRangeToRender(), Ge = ce[0], Ze = ce[1], de = [];
1136
+ if (S > 0)
1137
+ for (var U = Ge; U <= Ze; U++)
1138
+ de.push(G(u, {
1139
+ data: b,
1140
+ key: W(U, b),
1141
+ index: U,
1142
+ isScrolling: Ve ? le : void 0,
1143
+ style: this._getItemStyle(U)
1144
+ }));
1145
+ var ue = n(this.props, this._instanceProps);
1146
+ return G(Pe || We || "div", {
1147
+ className: c,
1148
+ onScroll: Be,
1149
+ ref: this._outerRefSetter,
1150
+ style: ae({
1151
+ position: "relative",
1152
+ height: v,
1153
+ width: He,
1154
+ overflow: "auto",
1155
+ WebkitOverflowScrolling: "touch",
1156
+ willChange: "transform",
1157
+ direction: f
1158
+ }, Fe)
1159
+ }, G(A || T || "div", {
1160
+ children: de,
1161
+ ref: N,
1162
+ style: {
1163
+ height: Z ? "100%" : ue,
1164
+ pointerEvents: le ? "none" : void 0,
1165
+ width: Z ? ue : "100%"
1166
+ }
1167
+ }));
1168
+ }, M._callPropsCallbacks = function() {
1169
+ if (typeof this.props.onItemsRendered == "function") {
1170
+ var a = this.props.itemCount;
1171
+ if (a > 0) {
1172
+ var u = this._getRangeToRender(), c = u[0], f = u[1], v = u[2], N = u[3];
1173
+ this._callOnItemsRendered(c, f, v, N);
1174
+ }
1175
+ }
1176
+ if (typeof this.props.onScroll == "function") {
1177
+ var A = this.state, T = A.scrollDirection, S = A.scrollOffset, b = A.scrollUpdateWasRequested;
1178
+ this._callOnScroll(T, S, b);
1179
+ }
1180
+ }, M._getRangeToRender = function() {
1181
+ var a = this.props, u = a.itemCount, c = a.overscanCount, f = this.state, v = f.isScrolling, N = f.scrollDirection, A = f.scrollOffset;
1182
+ if (u === 0)
1183
+ return [0, 0, 0, 0];
1184
+ var T = d(this.props, A, this._instanceProps), S = m(this.props, T, A, this._instanceProps), b = !v || N === "backward" ? Math.max(1, c) : 1, k = !v || N === "forward" ? Math.max(1, c) : 1;
1185
+ return [Math.max(0, T - b), Math.max(0, Math.min(u - 1, S + k)), T, S];
1186
+ }, l;
1187
+ }($e), e.defaultProps = {
1188
+ direction: "ltr",
1189
+ itemData: void 0,
1190
+ layout: "vertical",
1191
+ overscanCount: 2,
1192
+ useIsScrolling: !1
1193
+ }, e;
1194
+ }
1195
+ var pn = function(e, s) {
1196
+ e.children, e.direction, e.height, e.layout, e.innerTagName, e.outerTagName, e.width, s.instance;
1197
+ }, hn = /* @__PURE__ */ un({
1198
+ getItemOffset: function(e, s) {
1199
+ var n = e.itemSize;
1200
+ return s * n;
1201
+ },
1202
+ getItemSize: function(e, s) {
1203
+ var n = e.itemSize;
1204
+ return n;
1205
+ },
1206
+ getEstimatedTotalSize: function(e) {
1207
+ var s = e.itemCount, n = e.itemSize;
1208
+ return n * s;
1209
+ },
1210
+ getOffsetForIndexAndAlignment: function(e, s, n, i, p, d) {
1211
+ var m = e.direction, h = e.height, g = e.itemCount, _ = e.itemSize, z = e.layout, l = e.width, M = m === "horizontal" || z === "horizontal", y = M ? l : h, a = Math.max(0, g * _ - y), u = Math.min(a, s * _), c = Math.max(0, s * _ - y + _ + d);
1212
+ switch (n === "smart" && (i >= c - y && i <= u + y ? n = "auto" : n = "center"), n) {
1213
+ case "start":
1214
+ return u;
1215
+ case "end":
1216
+ return c;
1217
+ case "center": {
1218
+ var f = Math.round(c + (u - c) / 2);
1219
+ return f < Math.ceil(y / 2) ? 0 : f > a + Math.floor(y / 2) ? a : f;
1220
+ }
1221
+ case "auto":
1222
+ default:
1223
+ return i >= c && i <= u ? i : i < c ? c : u;
1224
+ }
1225
+ },
1226
+ getStartIndexForOffset: function(e, s) {
1227
+ var n = e.itemCount, i = e.itemSize;
1228
+ return Math.max(0, Math.min(n - 1, Math.floor(s / i)));
1229
+ },
1230
+ getStopIndexForStartIndex: function(e, s, n) {
1231
+ var i = e.direction, p = e.height, d = e.itemCount, m = e.itemSize, h = e.layout, g = e.width, _ = i === "horizontal" || h === "horizontal", z = s * m, l = _ ? g : p, M = Math.ceil((l + n - z) / m);
1232
+ return Math.max(0, Math.min(
1233
+ d - 1,
1234
+ s + M - 1
1235
+ // -1 is because stop index is inclusive
1236
+ ));
1237
+ },
1238
+ initInstanceProps: function(e) {
1239
+ },
1240
+ shouldResetStyleCacheOnItemSizeChange: !0,
1241
+ validateProps: function(e) {
1242
+ e.itemSize;
1243
+ }
1244
+ });
1245
+ function mn(t) {
1246
+ var e = t.lastRenderedStartIndex, s = t.lastRenderedStopIndex, n = t.startIndex, i = t.stopIndex;
1247
+ return !(n > s || i < e);
1248
+ }
1249
+ function fn(t) {
1250
+ for (var e = t.isItemLoaded, s = t.itemCount, n = t.minimumBatchSize, i = t.startIndex, p = t.stopIndex, d = [], m = null, h = null, g = i; g <= p; g++) {
1251
+ var _ = e(g);
1252
+ _ ? h !== null && (d.push(m, h), m = h = null) : (h = g, m === null && (m = g));
1253
+ }
1254
+ if (h !== null) {
1255
+ for (var z = Math.min(Math.max(h, m + n - 1), s - 1), l = h + 1; l <= z && !e(l); l++)
1256
+ h = l;
1257
+ d.push(m, h);
1258
+ }
1259
+ if (d.length)
1260
+ for (; d[1] - d[0] + 1 < n && d[0] > 0; ) {
1261
+ var M = d[0] - 1;
1262
+ if (!e(M))
1263
+ d[0] = M;
1264
+ else
1265
+ break;
1266
+ }
1267
+ return d;
1268
+ }
1269
+ var gn = function(t, e) {
1270
+ if (!(t instanceof e))
1271
+ throw new TypeError("Cannot call a class as a function");
1272
+ }, In = function() {
1273
+ function t(e, s) {
1274
+ for (var n = 0; n < s.length; n++) {
1275
+ var i = s[n];
1276
+ i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, i.key, i);
1277
+ }
1278
+ }
1279
+ return function(e, s, n) {
1280
+ return s && t(e.prototype, s), n && t(e, n), e;
1281
+ };
1282
+ }(), vn = function(t, e) {
1283
+ if (typeof e != "function" && e !== null)
1284
+ throw new TypeError("Super expression must either be null or a function, not " + typeof e);
1285
+ t.prototype = Object.create(e && e.prototype, {
1286
+ constructor: {
1287
+ value: t,
1288
+ enumerable: !1,
1289
+ writable: !0,
1290
+ configurable: !0
1291
+ }
1292
+ }), e && (Object.setPrototypeOf ? Object.setPrototypeOf(t, e) : t.__proto__ = e);
1293
+ }, be = function(t, e) {
1294
+ if (!t)
1295
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
1296
+ return e && (typeof e == "object" || typeof e == "function") ? e : t;
1297
+ }, Mn = function(t) {
1298
+ vn(e, t);
1299
+ function e() {
1300
+ var s, n, i, p;
1301
+ gn(this, e);
1302
+ for (var d = arguments.length, m = Array(d), h = 0; h < d; h++)
1303
+ m[h] = arguments[h];
1304
+ return p = (n = (i = be(this, (s = e.__proto__ || Object.getPrototypeOf(e)).call.apply(s, [this].concat(m))), i), i._lastRenderedStartIndex = -1, i._lastRenderedStopIndex = -1, i._memoizedUnloadedRanges = [], i._onItemsRendered = function(g) {
1305
+ var _ = g.visibleStartIndex, z = g.visibleStopIndex;
1306
+ i._lastRenderedStartIndex = _, i._lastRenderedStopIndex = z, i._ensureRowsLoaded(_, z);
1307
+ }, i._setRef = function(g) {
1308
+ i._listRef = g;
1309
+ }, n), be(i, p);
1310
+ }
1311
+ return In(e, [{
1312
+ key: "resetloadMoreItemsCache",
1313
+ value: function() {
1314
+ var n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1;
1315
+ this._memoizedUnloadedRanges = [], n && this._ensureRowsLoaded(this._lastRenderedStartIndex, this._lastRenderedStopIndex);
1316
+ }
1317
+ }, {
1318
+ key: "componentDidMount",
1319
+ value: function() {
1320
+ }
1321
+ }, {
1322
+ key: "render",
1323
+ value: function() {
1324
+ var n = this.props.children;
1325
+ return n({
1326
+ onItemsRendered: this._onItemsRendered,
1327
+ ref: this._setRef
1328
+ });
1329
+ }
1330
+ }, {
1331
+ key: "_ensureRowsLoaded",
1332
+ value: function(n, i) {
1333
+ var p = this.props, d = p.isItemLoaded, m = p.itemCount, h = p.minimumBatchSize, g = h === void 0 ? 10 : h, _ = p.threshold, z = _ === void 0 ? 15 : _, l = fn({
1334
+ isItemLoaded: d,
1335
+ itemCount: m,
1336
+ minimumBatchSize: g,
1337
+ startIndex: Math.max(0, n - z),
1338
+ stopIndex: Math.min(m - 1, i + z)
1339
+ });
1340
+ (this._memoizedUnloadedRanges.length !== l.length || this._memoizedUnloadedRanges.some(function(M, y) {
1341
+ return l[y] !== M;
1342
+ })) && (this._memoizedUnloadedRanges = l, this._loadUnloadedRanges(l));
1343
+ }
1344
+ }, {
1345
+ key: "_loadUnloadedRanges",
1346
+ value: function(n) {
1347
+ for (var i = this, p = this.props.loadMoreItems || this.props.loadMoreRows, d = function(g) {
1348
+ var _ = n[g], z = n[g + 1], l = p(_, z);
1349
+ l != null && l.then(function() {
1350
+ if (mn({
1351
+ lastRenderedStartIndex: i._lastRenderedStartIndex,
1352
+ lastRenderedStopIndex: i._lastRenderedStopIndex,
1353
+ startIndex: _,
1354
+ stopIndex: z
1355
+ })) {
1356
+ if (i._listRef == null)
1357
+ return;
1358
+ typeof i._listRef.resetAfterIndex == "function" ? i._listRef.resetAfterIndex(_, !0) : (typeof i._listRef._getItemStyleCache == "function" && i._listRef._getItemStyleCache(-1), i._listRef.forceUpdate());
1359
+ }
1360
+ });
1361
+ }, m = 0; m < n.length; m += 2)
1362
+ d(m);
1363
+ }
1364
+ }]), e;
1365
+ }($e);
1366
+ const yn = () => x, zn = /* @__PURE__ */ o("div")({
1367
+ name: "a",
1368
+ class: "a1w9zony",
1369
+ propsAsIs: !1
1370
+ }), Nn = /* @__PURE__ */ o("div")({
1371
+ name: "l",
1372
+ class: "l16qcfv8",
1373
+ propsAsIs: !1
1374
+ }), An = /* @__PURE__ */ o("img")({
1375
+ name: "p",
1376
+ class: "p1gmcc5f",
1377
+ propsAsIs: !1
1378
+ }), _n = /* @__PURE__ */ o("div")({
1379
+ name: "s",
1380
+ class: "s1doddh0",
1381
+ propsAsIs: !1
1382
+ }), Tn = /* @__PURE__ */ o("div")({
1383
+ name: "c",
1384
+ class: "c1js9xhe",
1385
+ propsAsIs: !1
1386
+ }), Sn = /* @__PURE__ */ o("div")({
1387
+ name: "d",
1388
+ class: "d1tmnqsh",
1389
+ propsAsIs: !1
1390
+ }), xn = /* @__PURE__ */ o("span")({
1391
+ name: "g",
1392
+ class: "gi9h87j",
1393
+ propsAsIs: !1
1394
+ }), Dn = /* @__PURE__ */ o(yn())({
1395
+ name: "x",
1396
+ class: "x13mk3z6",
1397
+ propsAsIs: !0
1398
+ }), wn = ({
1399
+ rank: t,
1400
+ avatar: e,
1401
+ name: s,
1402
+ points: n,
1403
+ isCurrentUser: i,
1404
+ openItemDetail: p,
1405
+ style: d
1406
+ }) => /* @__PURE__ */ I(zn, { onClick: p, style: d, children: [
1407
+ /* @__PURE__ */ r(Nn, { children: t || 0 }),
1408
+ /* @__PURE__ */ I(Tn, { children: [
1409
+ e ? /* @__PURE__ */ r(An, { alt: "leaderboard-item-avatar", src: e }) : /* @__PURE__ */ r(_n, { children: Ee(s || "") }),
1410
+ /* @__PURE__ */ I(Sn, { children: [
1411
+ /* @__PURE__ */ r(xn, { children: s || "" }),
1412
+ i && /* @__PURE__ */ r(Dn, { name: "icon-star" })
1413
+ ] })
1414
+ ] }),
1415
+ /* @__PURE__ */ r("div", { children: je(n) })
1416
+ ] }), bn = ({
1417
+ items: t,
1418
+ currentUserId: e,
1419
+ openItemDetail: s,
1420
+ fetchMore: n
1421
+ }) => /* @__PURE__ */ r(sn, { children: ({ width: i, height: p }) => /* @__PURE__ */ r(
1422
+ Mn,
1423
+ {
1424
+ isItemLoaded: (d) => d < t.length,
1425
+ itemCount: t.length + 1,
1426
+ loadMoreItems: n,
1427
+ children: ({ onItemsRendered: d, ref: m }) => /* @__PURE__ */ r(
1428
+ hn,
1429
+ {
1430
+ itemSize: 56,
1431
+ onItemsRendered: d,
1432
+ ref: m,
1433
+ itemCount: t.length,
1434
+ width: i,
1435
+ height: p,
1436
+ children: ({ index: h, style: g }) => /* @__PURE__ */ r(
1437
+ wn,
1438
+ {
1439
+ style: { ...g, maxHeight: 48 },
1440
+ ...t[h],
1441
+ openItemDetail: () => s(t[h].userId),
1442
+ isCurrentUser: !!e && e === t[h].userId
1443
+ },
1444
+ t[h].userId
1445
+ )
1446
+ }
1447
+ )
1448
+ }
1449
+ ) });
1450
+ const kn = () => x, On = () => x, En = /* @__PURE__ */ o("div")({
1451
+ name: "a",
1452
+ class: "ay8exst",
1453
+ propsAsIs: !1
1454
+ }), jn = /* @__PURE__ */ o("div")({
1455
+ name: "l",
1456
+ class: "l31riw0",
1457
+ propsAsIs: !1
1458
+ }), Ln = /* @__PURE__ */ o(kn())({
1459
+ name: "p",
1460
+ class: "pcmm4w7",
1461
+ propsAsIs: !0
1462
+ }), $n = /* @__PURE__ */ o("div")({
1463
+ name: "c",
1464
+ class: "cct922a",
1465
+ propsAsIs: !1
1466
+ }), Cn = /* @__PURE__ */ o("div")({
1467
+ name: "s",
1468
+ class: "s12b7u74",
1469
+ propsAsIs: !1
1470
+ }), Rn = /* @__PURE__ */ o("div")({
1471
+ name: "x",
1472
+ class: "x1896nrl",
1473
+ propsAsIs: !1
1474
+ }), Un = /* @__PURE__ */ o("div")({
1475
+ name: "d",
1476
+ class: "d1vnagog",
1477
+ propsAsIs: !1
1478
+ }), Qn = /* @__PURE__ */ o("div")({
1479
+ name: "g",
1480
+ class: "gznzzc2",
1481
+ propsAsIs: !1
1482
+ }), qn = /* @__PURE__ */ o("span")({
1483
+ name: "f",
1484
+ class: "fnmvyxu",
1485
+ propsAsIs: !1
1486
+ }), Yn = /* @__PURE__ */ o("span")({
1487
+ name: "h",
1488
+ class: "h1iubd2g",
1489
+ propsAsIs: !1
1490
+ }), Pn = /* @__PURE__ */ o(On())({
1491
+ name: "m",
1492
+ class: "mmvjfuo",
1493
+ propsAsIs: !0
1494
+ }), Wn = /* @__PURE__ */ o("div")({
1495
+ name: "v",
1496
+ class: "v1oi1553",
1497
+ propsAsIs: !1
1498
+ }), Fn = /* @__PURE__ */ o("a")({
1499
+ name: "w",
1500
+ class: "w1vwcogq",
1501
+ propsAsIs: !1
1502
+ }), Vn = /* @__PURE__ */ o("span")({
1503
+ name: "u",
1504
+ class: "utbqo0e",
1505
+ propsAsIs: !1
1506
+ }), Hn = ({
1507
+ inviteLink: t,
1508
+ socialLinks: e,
1509
+ inviteCardTitle: s,
1510
+ inviteCardSubtext: n,
1511
+ primaryColor: i,
1512
+ className: p
1513
+ }) => /* @__PURE__ */ I(En, { className: p, children: [
1514
+ /* @__PURE__ */ r(jn, { style: { backgroundColor: i }, children: /* @__PURE__ */ r(Ln, { name: "invite-game-icon" }) }),
1515
+ /* @__PURE__ */ I($n, { children: [
1516
+ /* @__PURE__ */ r(Cn, { children: s || "" }),
1517
+ /* @__PURE__ */ r(Rn, { children: n || "" })
1518
+ ] }),
1519
+ t && /* @__PURE__ */ I(Un, { onClick: async () => {
1520
+ if (t)
1521
+ try {
1522
+ await navigator.clipboard.writeText(t);
1523
+ } catch (d) {
1524
+ console.error("Unable to copy to clipboard", d);
1525
+ }
1526
+ }, children: [
1527
+ /* @__PURE__ */ I(Qn, { children: [
1528
+ /* @__PURE__ */ r(qn, { children: "Invite link" }),
1529
+ /* @__PURE__ */ r(Yn, { children: t })
1530
+ ] }),
1531
+ /* @__PURE__ */ r(Pn, { name: "icon-copy" })
1532
+ ] }),
1533
+ e && e.length > 0 && /* @__PURE__ */ r(Wn, { children: e.map(({ icon: d, link: m, label: h }) => /* @__PURE__ */ I(Fn, { href: m, target: "_blank", children: [
1534
+ /* @__PURE__ */ r(x, { name: d }),
1535
+ /* @__PURE__ */ r(Vn, { children: h })
1536
+ ] }, m)) })
1537
+ ] }), Bn = ({ deepLink: t }) => {
1538
+ const { data: e } = O(t.$store);
1539
+ return /* @__PURE__ */ r(
1540
+ Hn,
1541
+ {
1542
+ inviteLink: e == null ? void 0 : e.url,
1543
+ socialLinks: [
1544
+ {
1545
+ icon: "icon-facebook",
1546
+ link: "https://www.facebook.com/TheMasters",
1547
+ label: "Facebook"
1548
+ },
1549
+ {
1550
+ icon: "icon-twitter",
1551
+ link: "https://twitter.com/@TheMasters",
1552
+ label: "X"
1553
+ }
1554
+ ],
1555
+ inviteCardTitle: "It’s more fun with friends",
1556
+ inviteCardSubtext: "Invite and compete against your friends for the top spot on the leaderboard."
1557
+ }
1558
+ );
1559
+ }, Gn = ({ gamification: t }) => {
1560
+ const { data: e } = O(t.leaderboardList.$store);
1561
+ return e != null && e.length ? /* @__PURE__ */ r(
1562
+ bn,
1563
+ {
1564
+ fetchMore: t.leaderboardList.fetchMore,
1565
+ items: e,
1566
+ openItemDetail: t.openUser,
1567
+ currentUserId: t.currentUserId.get()
1568
+ }
1569
+ ) : /* @__PURE__ */ r(Bn, { deepLink: t.deepLink });
1570
+ };
1571
+ const Zn = /* @__PURE__ */ o("button")({
1572
+ name: "a",
1573
+ class: "akly9h2",
1574
+ propsAsIs: !1
1575
+ }), Jn = /* @__PURE__ */ o("span")({
1576
+ name: "e",
1577
+ class: "eptoiz9",
1578
+ propsAsIs: !1
1579
+ }), Kn = ({ disabled: t, variant: e = "primary", onClick: s, children: n, ...i }) => /* @__PURE__ */ r(Zn, { onClick: s, disabled: t, "data-variant": e, ...i, children: /* @__PURE__ */ r(Jn, { children: n }) });
1580
+ const Xn = () => x, ei = () => x, ti = /* @__PURE__ */ o("div")({
1581
+ name: "s",
1582
+ class: "s1lblda3",
1583
+ propsAsIs: !1
1584
+ }), si = /* @__PURE__ */ o("div")({
1585
+ name: "a",
1586
+ class: "ascvb2g",
1587
+ propsAsIs: !1
1588
+ }), ni = /* @__PURE__ */ o("div")({
1589
+ name: "p",
1590
+ class: "p17rl8zy",
1591
+ propsAsIs: !1
1592
+ }), ii = /* @__PURE__ */ o("div")({
1593
+ name: "l",
1594
+ class: "l1vvttbn",
1595
+ propsAsIs: !1
1596
+ }), se = /* @__PURE__ */ o(Xn())({
1597
+ name: "c",
1598
+ class: "c6fk2ph",
1599
+ propsAsIs: !0
1600
+ }), ri = /* @__PURE__ */ o(ei())({
1601
+ name: "d",
1602
+ class: "d1rdm136",
1603
+ propsAsIs: !0
1604
+ }), ai = /* @__PURE__ */ o("div")({
1605
+ name: "f",
1606
+ class: "fwqnnel",
1607
+ propsAsIs: !1
1608
+ }), oi = /* @__PURE__ */ o("div")({
1609
+ name: "u",
1610
+ class: "ucyxnlg",
1611
+ propsAsIs: !1
1612
+ }), li = {
1613
+ [V.LOST]: /* @__PURE__ */ r(se, { name: "icon-cross" }),
1614
+ [V.WON]: /* @__PURE__ */ r(se, { name: "icon-check" }),
1615
+ [V.UNSET]: void 0,
1616
+ [V.DNP]: /* @__PURE__ */ r(se, { name: "icon-arrow" })
1617
+ }, ci = ({
1618
+ questionId: t,
1619
+ questionType: e,
1620
+ questionStatus: s,
1621
+ subject: n,
1622
+ openForVoting: i,
1623
+ openQuestion: p,
1624
+ status: d
1625
+ }) => {
1626
+ const m = Oe[e], h = li[d];
1627
+ return m ? /* @__PURE__ */ I(ti, { onClick: () => p == null ? void 0 : p(t), children: [
1628
+ /* @__PURE__ */ I(oi, { children: [
1629
+ /* @__PURE__ */ I(si, { children: [
1630
+ /* @__PURE__ */ r(ri, { name: m.iconName }),
1631
+ /* @__PURE__ */ I(ai, { children: [
1632
+ m.label,
1633
+ e === D.TRIVIA && s === Y.RESOLVED && " • Expired"
1634
+ ] })
1635
+ ] }),
1636
+ /* @__PURE__ */ r(ni, { children: n || "" })
1637
+ ] }),
1638
+ /* @__PURE__ */ r(ii, { children: h || (i ? /* @__PURE__ */ r(Kn, { children: "Play" }) : null) })
1639
+ ] }) : null;
1640
+ };
1641
+ const di = /* @__PURE__ */ o("div")({
1642
+ name: "n",
1643
+ class: "n1jcgove",
1644
+ propsAsIs: !1
1645
+ }), ui = /* @__PURE__ */ o("button")({
1646
+ name: "l",
1647
+ class: "l1bwp7hh",
1648
+ propsAsIs: !1
1649
+ }), pi = ({
1650
+ openInsight: t,
1651
+ questionId: e,
1652
+ ...s
1653
+ }) => /* @__PURE__ */ I(di, { children: [
1654
+ /* @__PURE__ */ r(Ye, { questionId: e, ...s }),
1655
+ t && /* @__PURE__ */ r(ui, { onClick: () => t(e), children: "View Insight" })
1656
+ ] });
1657
+ const hi = /* @__PURE__ */ o("div")({
1658
+ name: "t",
1659
+ class: "t19vr3p1",
1660
+ propsAsIs: !1
1661
+ }), mi = ({ questions: t, openQuestion: e }) => /* @__PURE__ */ r(hi, { children: t == null ? void 0 : t.map((s) => {
1662
+ var n, i;
1663
+ if (s.type === "question" && ((n = s.attributes) == null ? void 0 : n.attributes.case) === "question") {
1664
+ const p = s.attributes.attributes.value;
1665
+ return /* @__PURE__ */ r(ci, { openQuestion: e, ...p }, p.questionId);
1666
+ }
1667
+ if (s.type === "insight" && ((i = s.attributes) == null ? void 0 : i.attributes.case) === "insight") {
1668
+ const p = s.attributes.attributes.value;
1669
+ return /* @__PURE__ */ r(pi, { openInsight: e, ...p }, p.questionId);
1670
+ }
1671
+ return null;
1672
+ }) }), fi = ({ store: t, openQuestion: e }) => {
1673
+ const s = O(t);
1674
+ return s != null && s.data ? /* @__PURE__ */ r(mi, { openQuestion: e, questions: s.data }) : /* @__PURE__ */ r("div", { children: "wait questions..." });
1675
+ }, gi = ({ userSummary: t }) => {
1676
+ var e, s;
1677
+ const n = O(t.getStore());
1678
+ return (e = n.data) != null && e.summary ? /* @__PURE__ */ r(Re, { ...n.data.summary, successRate: (s = n.data.percentage) == null ? void 0 : s.correct }) : /* @__PURE__ */ r("div", { children: "wait user..." });
1679
+ }, Ii = ({ gamification: t }) => {
1680
+ const [e, s] = R(q.HOME);
1681
+ return /* @__PURE__ */ I("div", { style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
1682
+ /* @__PURE__ */ I(ne, { children: [
1683
+ /* @__PURE__ */ r(en, { activePage: e, toggleActivePage: s }),
1684
+ e === q.HOME && /* @__PURE__ */ r(gi, { userSummary: t.userSummary })
1685
+ ] }),
1686
+ e === q.HOME && /* @__PURE__ */ r(st, { children: /* @__PURE__ */ r(fi, { openQuestion: t.openQuestion, store: t.feedList.getStore() }) }),
1687
+ e === q.LEADERBOARD && /* @__PURE__ */ r(ne, { style: { flex: "1 1 auto", paddingTop: 0, paddingBottom: 0 }, children: /* @__PURE__ */ r(Gn, { gamification: t }) })
1688
+ ] });
1689
+ };
1690
+ const vi = () => nt, ke = /* @__PURE__ */ o(vi())({
1691
+ name: "n",
1692
+ class: "n1ph66cs",
1693
+ propsAsIs: !0
1694
+ }), Mi = /* @__PURE__ */ o("div")({
1695
+ name: "x",
1696
+ class: "xorme7i",
1697
+ propsAsIs: !1
1698
+ }), yi = ({
1699
+ correct: t,
1700
+ incorrect: e
1701
+ }) => {
1702
+ const s = t + e;
1703
+ return s === 0 ? 0 : Math.round(t / s * 100);
1704
+ }, _i = ({
1705
+ gamification: t,
1706
+ className: e
1707
+ }) => {
1708
+ const s = O(t.openedQuestion.$store), n = O(t.openedUser);
1709
+ return /* @__PURE__ */ I($, {
1710
+ children: [s && /* @__PURE__ */ r(ke, {
1711
+ className: e,
1712
+ children: /* @__PURE__ */ r(Gs, {
1713
+ gamification: t
1714
+ })
1715
+ }), n && /* @__PURE__ */ r(ke, {
1716
+ className: e,
1717
+ children: /* @__PURE__ */ I(Mi, {
1718
+ children: [/* @__PURE__ */ r(Ce, {
1719
+ label: "Friend's Rank",
1720
+ close: t.closeUser
1721
+ }), /* @__PURE__ */ r(ne, {
1722
+ children: /* @__PURE__ */ r(Re, {
1723
+ ...n,
1724
+ successRate: yi(n)
1725
+ })
1726
+ })]
1727
+ })
1728
+ }), /* @__PURE__ */ r(Le, {
1729
+ className: e,
1730
+ "data-nav": "true",
1731
+ children: /* @__PURE__ */ r(Ii, {
1732
+ gamification: t
1733
+ })
1734
+ })]
1735
+ });
1736
+ };
1737
+ export {
1738
+ _i as GamificationOverlay,
1739
+ _i as default
1740
+ };