@streamlayer/react 1.24.7 → 1.24.8-pre.11da316

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.
Files changed (49) hide show
  1. package/lib/app/advertisement.d.ts +5 -0
  2. package/lib/cjs/advertisement.js +1486 -1436
  3. package/lib/cjs/auth.js +33 -33
  4. package/lib/cjs/bet-pack.js +232 -195
  5. package/lib/cjs/index.js +1765 -1707
  6. package/lib/cjs/insight.js +631 -569
  7. package/lib/cjs/masters.js +1346 -1307
  8. package/lib/cjs/notification.js +237 -206
  9. package/lib/cjs/pause-ad.js +62 -62
  10. package/lib/cjs/points.js +128 -97
  11. package/lib/cjs/polymarket.js +98 -97
  12. package/lib/cjs/style.css +1 -1
  13. package/lib/cjs/useStreamLayerApp.js +95 -101
  14. package/lib/dist/cjs/index.js +1346 -1307
  15. package/lib/dist/es/index.js +1346 -1307
  16. package/lib/es/Question.js +75 -72
  17. package/lib/es/advertisement.js +9139 -8159
  18. package/lib/es/analytics.js +35 -31
  19. package/lib/es/auth.js +1 -1
  20. package/lib/es/bet-pack.js +1 -1
  21. package/lib/es/{hooks-n9ax4LRT.js → hooks-42q2i9Iw.js} +25 -23
  22. package/lib/es/{index-D8wyDNJD.js → index-sWgEw6jy.js} +1 -1
  23. package/lib/es/index.js +2 -2
  24. package/lib/es/index10.js +6 -6
  25. package/lib/es/index12.js +116 -128
  26. package/lib/es/index13.js +100 -96
  27. package/lib/es/index14.js +15 -15
  28. package/lib/es/index16.js +382 -383
  29. package/lib/es/index2.js +55 -56
  30. package/lib/es/index4.js +3 -3
  31. package/lib/es/index5.js +275 -3
  32. package/lib/es/index6.js +4 -7
  33. package/lib/es/index7.js +5 -284
  34. package/lib/es/index8.js +8 -237
  35. package/lib/es/index9.js +237 -8
  36. package/lib/es/insight.js +3 -3
  37. package/lib/es/masters.js +1 -1
  38. package/lib/es/masters2.js +29 -29
  39. package/lib/es/notification.js +28 -28
  40. package/lib/es/pause-ad.js +21 -21
  41. package/lib/es/points.js +9 -9
  42. package/lib/es/polymarket.js +40 -40
  43. package/lib/es/storage.js +18 -18
  44. package/lib/es/style.css +1 -1
  45. package/lib/es/useStreamLayerApp.js +1 -1
  46. package/lib/es/useStreamLayerApp2.js +5098 -4862
  47. package/lib/es/utils.js +86 -41
  48. package/lib/source.css +1 -1
  49. package/package.json +14 -14
package/lib/es/index13.js CHANGED
@@ -1,12 +1,12 @@
1
- import { jsx as e, jsxs as o, Fragment as B } from "react/jsx-runtime";
2
- import { useState as $, useRef as ee, useEffect as _, useCallback as N, useLayoutEffect as ze, useMemo as K } from "react";
1
+ import { jsx as e, jsxs as o, Fragment as F } from "react/jsx-runtime";
2
+ import { useState as $, useRef as ee, useEffect as H, useCallback as N, useLayoutEffect as ze, useMemo as K } from "react";
3
3
  import { s, c as pe } from "./feature.js";
4
- import { i as le } from "./index9.js";
5
- import { B as E } from "./index7.js";
6
- import { Q as t, a as se, d as G, A as Ye } from "./useStreamLayerApp2.js";
7
- import { b as Me, L as Ue } from "./index8.js";
4
+ import { i as le } from "./index8.js";
5
+ import { M as E } from "./index5.js";
6
+ import { Q as t, b as se, f as _, A as Me } from "./useStreamLayerApp2.js";
7
+ import { b as Ye, L as Ue } from "./index9.js";
8
8
  import { p as Ce } from "./index11.js";
9
- const On = /* @__PURE__ */ s("div")({
9
+ const Sn = /* @__PURE__ */ s("div")({
10
10
  name: "SDKContainer",
11
11
  class: "sopqfe6",
12
12
  propsAsIs: !1
@@ -22,7 +22,7 @@ const On = /* @__PURE__ */ s("div")({
22
22
  name: "SDKWhiteContainer",
23
23
  class: "s1burm22",
24
24
  propsAsIs: !0
25
- }), He = () => Ee, Sn = /* @__PURE__ */ s(He())({
25
+ }), He = () => Ee, On = /* @__PURE__ */ s(He())({
26
26
  name: "SDKSummaryContainer",
27
27
  class: "sm5r3j5",
28
28
  propsAsIs: !0
@@ -57,7 +57,7 @@ let Je = class {
57
57
  };
58
58
  const J = new Je(), Xe = { hiding: !1, finished: !1 }, es = () => {
59
59
  const [n, a] = $(Xe), c = ee(null);
60
- _(() => {
60
+ H(() => {
61
61
  const p = (h) => {
62
62
  a(h);
63
63
  };
@@ -106,23 +106,26 @@ const J = new Je(), Xe = { hiding: !1, finished: !1 }, es = () => {
106
106
  ...r
107
107
  }) => {
108
108
  const p = ee(null);
109
- return /* @__PURE__ */ e(as, {
110
- ...r,
111
- enabled: c && l,
112
- style: {
113
- ...a,
114
- ...(() => {
115
- const h = p?.current, v = (h && window.getComputedStyle(h))?.getPropertyValue("height");
116
- return c ? {
117
- height: l ? v : 0
118
- } : {};
119
- })()
120
- },
121
- children: /* @__PURE__ */ e("div", {
122
- ref: p,
123
- children: n
109
+ return (
110
+ // eslint-disable-next-line react-hooks/refs
111
+ /* @__PURE__ */ e(as, {
112
+ ...r,
113
+ enabled: c && l,
114
+ style: {
115
+ ...a,
116
+ ...(() => {
117
+ const h = p?.current, v = (h && window.getComputedStyle(h))?.getPropertyValue("height");
118
+ return c ? {
119
+ height: l ? v : 0
120
+ } : {};
121
+ })()
122
+ },
123
+ children: /* @__PURE__ */ e("div", {
124
+ ref: p,
125
+ children: n
126
+ })
124
127
  })
125
- });
128
+ );
126
129
  }, is = /* @__PURE__ */ s("div")({
127
130
  name: "Container",
128
131
  class: "c1gcvmcj",
@@ -217,20 +220,20 @@ const J = new Je(), Xe = { hiding: !1, finished: !1 }, es = () => {
217
220
  enteredAnActiveQuestion: b,
218
221
  marketClosed: g,
219
222
  percentsAnimated: y,
220
- votedAnswer: O,
223
+ votedAnswer: S,
221
224
  isEarlyPrediction: I,
222
225
  correctAnswer: T,
223
226
  onAnimationEnd: q
224
227
  }) => {
225
- const P = c && (l === t.TRIVIA || l === t.PREDICTION), k = l === t.PREDICTION && !r, S = g && l === t.PREDICTION && !c || l === t.PREDICTION && i && v && b, C = P && k, V = P && r, f = l === t.PREDICTION && c && v && r, F = c && l === t.POLL && v, w = a ? "correct" : "incorrect", L = a ? n?.correctFeedback : n?.incorrectFeedback;
226
- return p || h || C || V || S || F || f || m ? /* @__PURE__ */ e(
228
+ const P = c && (l === t.TRIVIA || l === t.PREDICTION), k = l === t.PREDICTION && !r, O = g && l === t.PREDICTION && !c || l === t.PREDICTION && i && v && b, C = P && k, V = P && r, f = l === t.PREDICTION && c && v && r, B = c && l === t.POLL && v, w = a ? "correct" : "incorrect", L = a ? n?.correctFeedback : n?.incorrectFeedback;
229
+ return p || h || C || V || O || B || f || m ? /* @__PURE__ */ e(
227
230
  ms,
228
231
  {
229
232
  enabled: v,
230
233
  animate: !m && p ? !0 : y,
231
234
  onAnimationEnd: q,
232
235
  children: /* @__PURE__ */ o(hs, { "data-prediction": k, children: [
233
- m && !S && /* @__PURE__ */ o(Q, { children: [
236
+ m && !O && /* @__PURE__ */ o(Q, { children: [
234
237
  !I && /* @__PURE__ */ e(ve, { name: "questionExpired" }),
235
238
  /* @__PURE__ */ e(W, { children: m })
236
239
  ] }),
@@ -248,7 +251,7 @@ const J = new Je(), Xe = { hiding: !1, finished: !1 }, es = () => {
248
251
  /* @__PURE__ */ e(de, { children: "This question was answered after the moderator closed the question. So the points for this answer won’t tally." })
249
252
  ] })
250
253
  ] }),
251
- S && /* @__PURE__ */ o(Q, { children: [
254
+ O && /* @__PURE__ */ o(Q, { children: [
252
255
  !I && /* @__PURE__ */ e(X, { children: /* @__PURE__ */ e(E, { name: "questionExpired" }) }),
253
256
  /* @__PURE__ */ o("div", { children: [
254
257
  /* @__PURE__ */ e(te, { children: /* @__PURE__ */ e(W, { children: I ? r ? "The results are already in!" : "Question is Closed" : "Question Closed" }) }),
@@ -262,24 +265,24 @@ const J = new Je(), Xe = { hiding: !1, finished: !1 }, es = () => {
262
265
  /* @__PURE__ */ e(Es, { children: "We’ll notify you of the result." })
263
266
  ] })
264
267
  ] }),
265
- !m && F && /* @__PURE__ */ o(Q, { children: [
268
+ !m && B && /* @__PURE__ */ o(Q, { children: [
266
269
  !I && /* @__PURE__ */ e(X, { "data-feedback-type": "correct", children: /* @__PURE__ */ e(E, { name: "correct" }) }),
267
270
  /* @__PURE__ */ e(W, { children: "Thanks for answering. Please stay tuned for the next question." })
268
271
  ] }),
269
272
  !m && (V || f) && /* @__PURE__ */ o(Q, { className: pe(h && Ae), children: [
270
273
  !I && /* @__PURE__ */ e(X, { "data-feedback-type": w, children: /* @__PURE__ */ e(E, { name: w }) }),
271
274
  /* @__PURE__ */ e("div", { children: /* @__PURE__ */ o(te, { children: [
272
- I ? /* @__PURE__ */ e(As, { children: w === "incorrect" ? /* @__PURE__ */ o(B, { children: [
275
+ I ? /* @__PURE__ */ e(As, { children: w === "incorrect" ? /* @__PURE__ */ o(F, { children: [
273
276
  /* @__PURE__ */ e("div", { children: "So close!" }),
274
277
  /* @__PURE__ */ e("div", { children: "Better luck next time" })
275
- ] }) : /* @__PURE__ */ o(B, { children: [
278
+ ] }) : /* @__PURE__ */ o(F, { children: [
276
279
  /* @__PURE__ */ e("div", { children: "That’s correct!" }),
277
280
  /* @__PURE__ */ e("div", { children: "You chose wisely." })
278
281
  ] }) }) : /* @__PURE__ */ e(fs, { "data-feedback-type": w, children: L?.title }),
279
282
  I ? /* @__PURE__ */ o(vs, { children: [
280
283
  /* @__PURE__ */ o("div", { children: [
281
284
  "Your pick: ",
282
- O?.text
285
+ S?.text
283
286
  ] }),
284
287
  /* @__PURE__ */ e("div", { children: w === "incorrect" ? `Correct: ${T?.text}` : "" })
285
288
  ] }) : /* @__PURE__ */ e($s, { children: L?.description })
@@ -321,11 +324,11 @@ const J = new Je(), Xe = { hiding: !1, finished: !1 }, es = () => {
321
324
  name: "QuestionScrollContainer",
322
325
  class: "q1tlqx57",
323
326
  propsAsIs: !0
324
- }), Os = /* @__PURE__ */ s("div")({
327
+ }), Ss = /* @__PURE__ */ s("div")({
325
328
  name: "TopShadow",
326
329
  class: "t1hq58md",
327
330
  propsAsIs: !1
328
- }), Ss = /* @__PURE__ */ s("div")({
331
+ }), Os = /* @__PURE__ */ s("div")({
329
332
  name: "BottomShadow",
330
333
  class: "b1c8nxcx",
331
334
  propsAsIs: !1
@@ -357,15 +360,15 @@ const J = new Je(), Xe = { hiding: !1, finished: !1 }, es = () => {
357
360
  name: "EarlyPrediction",
358
361
  class: "e1l05ict",
359
362
  propsAsIs: !1
360
- }), Bs = () => E, Fs = /* @__PURE__ */ s(Bs())({
363
+ }), Fs = () => E, Bs = /* @__PURE__ */ s(Fs())({
361
364
  name: "EarlyPredictionIcon",
362
365
  class: "ez9juex",
363
366
  propsAsIs: !0
364
- }), zs = () => E, Ys = /* @__PURE__ */ s(zs())({
367
+ }), zs = () => E, Ms = /* @__PURE__ */ s(zs())({
365
368
  name: "SponsorIcon",
366
369
  class: "s8p4aob",
367
370
  propsAsIs: !0
368
- }), Ms = /* @__PURE__ */ s("button")({
371
+ }), Ys = /* @__PURE__ */ s("button")({
369
372
  name: "ButtonContainer",
370
373
  class: "b1b6dl8t",
371
374
  propsAsIs: !1
@@ -426,11 +429,12 @@ const J = new Je(), Xe = { hiding: !1, finished: !1 }, es = () => {
426
429
  class: "cichgz8",
427
430
  propsAsIs: !0
428
431
  }), ln = {
429
- [G.CENTERED]: (n) => /* @__PURE__ */ e(Js, { "data-testid": "vote-icon", alt: "option-icon", src: n }),
430
- [G.TRANSPARENT]: (n) => /* @__PURE__ */ e(Hs, { "data-testid": "vote-icon", children: /* @__PURE__ */ e(Zs, { style: { backgroundImage: `url(${n})` } }) }),
431
- [G.ROUNDED]: (n) => /* @__PURE__ */ e(en, { "data-testid": "vote-icon", alt: "option-icon", src: n }),
432
- [G.NONE]: () => null,
433
- [G.UNSET]: () => null
432
+ [_.CENTERED]: (n) => /* @__PURE__ */ e(Js, { "data-testid": "vote-icon", alt: "option-icon", src: n }),
433
+ [_.TRANSPARENT]: (n) => /* @__PURE__ */ e(Hs, { "data-testid": "vote-icon", children: /* @__PURE__ */ e(Zs, { style: { backgroundImage: `url(${n})` } }) }),
434
+ [_.ROUNDED]: (n) => /* @__PURE__ */ e(en, { "data-testid": "vote-icon", alt: "option-icon", src: n }),
435
+ [_.NONE]: () => null,
436
+ [_.UNSET]: () => null,
437
+ [_.SOLID]: () => null
434
438
  }, dn = ({ questionType: n, hasCorrectAnswer: a, correct: c, youVoted: l, questionVoted: r }) => {
435
439
  if (n === t.POLL && l)
436
440
  return "voted";
@@ -449,7 +453,7 @@ const J = new Je(), Xe = { hiding: !1, finished: !1 }, es = () => {
449
453
  correct: c,
450
454
  hasCorrectAnswer: l,
451
455
  questionStatus: r
452
- }) => n === t.TRIVIA ? a && c : n === t.PREDICTION ? a && c && l || r === se.RESOLVED && c : !1, un = Me(Ms), mn = (n) => {
456
+ }) => n === t.TRIVIA ? a && c : n === t.PREDICTION ? a && c && l || r === se.RESOLVED && c : !1, un = Ye(Ys), mn = (n) => {
453
457
  const {
454
458
  // option props
455
459
  id: a,
@@ -465,18 +469,18 @@ const J = new Je(), Xe = { hiding: !1, finished: !1 }, es = () => {
465
469
  youSelected: b,
466
470
  youVoted: g,
467
471
  questionVoted: y,
468
- imageMode: O,
472
+ imageMode: S,
469
473
  answerTimeExpired: I,
470
474
  questionStatus: T,
471
475
  isLoading: q,
472
476
  questionType: P,
473
477
  correct: k,
474
- hasCorrectAnswer: S,
478
+ hasCorrectAnswer: O,
475
479
  marketClosed: C,
476
480
  isEarlyPrediction: V,
477
481
  isAd: f,
478
- webos: F
479
- } = n, [w, L] = $(0), z = dn(n), H = pn({ questionType: P, questionVoted: y, correct: k, hasCorrectAnswer: S, questionStatus: T }), x = C && P === t.PREDICTION, ne = y || x, Y = P === t.PREDICTION && !y && !C && !f, Z = y && !b && z !== "incorrect" && !g;
482
+ webos: B
483
+ } = n, [w, L] = $(0), z = dn(n), Z = pn({ questionType: P, questionVoted: y, correct: k, hasCorrectAnswer: O, questionStatus: T }), x = C && P === t.PREDICTION, ne = y || x, M = P === t.PREDICTION && !y && !C && !f, G = y && !b && z !== "incorrect" && !g;
480
484
  return ze(() => {
481
485
  L(0), requestAnimationFrame(() => {
482
486
  L(r);
@@ -485,12 +489,12 @@ const J = new Je(), Xe = { hiding: !1, finished: !1 }, es = () => {
485
489
  un,
486
490
  {
487
491
  value: a,
488
- webos: F,
492
+ webos: B,
489
493
  autoFocus: i,
490
494
  "data-selected": b,
491
495
  "data-answer-state": z,
492
496
  disabled: y || q || I || x,
493
- "data-is-not-checked": Z,
497
+ "data-is-not-checked": G,
494
498
  "data-a": "intr",
495
499
  onClick: (re) => {
496
500
  v(
@@ -503,7 +507,7 @@ const J = new Je(), Xe = { hiding: !1, finished: !1 }, es = () => {
503
507
  Ks,
504
508
  {
505
509
  "data-answer-state": z,
506
- "data-is-not-checked": Z,
510
+ "data-is-not-checked": G,
507
511
  style: { width: `${ne ? w : 0}%` },
508
512
  onTransitionEnd: () => {
509
513
  x || m?.();
@@ -512,14 +516,14 @@ const J = new Je(), Xe = { hiding: !1, finished: !1 }, es = () => {
512
516
  }
513
517
  ) }),
514
518
  /* @__PURE__ */ o(_s, { "data-a": "intr", children: [
515
- c && O && ln[O]?.(c),
519
+ c && S && ln[S]?.(c),
516
520
  /* @__PURE__ */ e(sn, { "data-a": "intr", children: l }),
517
- Y && /* @__PURE__ */ o(tn, { children: [
521
+ M && /* @__PURE__ */ o(tn, { children: [
518
522
  p,
519
523
  /* @__PURE__ */ e(rn, { children: "pts" })
520
524
  ] }),
521
525
  ne && /* @__PURE__ */ o(nn, { children: [
522
- H && /* @__PURE__ */ e(cn, { name: V ? "selectedBetPack" : "selected" }),
526
+ Z && /* @__PURE__ */ e(cn, { name: V ? "selectedBetPack" : "selected" }),
523
527
  /* @__PURE__ */ e(an, { children: /* @__PURE__ */ e(Ce, { value: r, suffix: "%" }) })
524
528
  ] })
525
529
  ] })
@@ -583,7 +587,7 @@ const J = new Je(), Xe = { hiding: !1, finished: !1 }, es = () => {
583
587
  children: [
584
588
  /* @__PURE__ */ o(An, { children: [
585
589
  n && /* @__PURE__ */ e(vn, { children: n }),
586
- a !== void 0 && p !== t.POLL && /* @__PURE__ */ o(B, { children: [
590
+ a !== void 0 && p !== t.POLL && /* @__PURE__ */ o(F, { children: [
587
591
  /* @__PURE__ */ e(Tn, { name: "icon-trophy" }),
588
592
  /* @__PURE__ */ o(Cn, { children: [
589
593
  /* @__PURE__ */ e($n, { children: r ? /* @__PURE__ */ e(Ce, { value: a, delay: 0.3 }) : a }),
@@ -596,11 +600,11 @@ const J = new Je(), Xe = { hiding: !1, finished: !1 }, es = () => {
596
600
  }
597
601
  )
598
602
  }
599
- ), wn = (n, a) => n === "already_voted" ? a === t.POLL ? "You’ve already answered this question on another device." : "You’ve already answered this question on another device. So the points for this answer won't tally." : "Something went wrong, please try again", Bn = () => /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ o(Pe, { children: [
603
+ ), wn = (n, a) => n === "already_voted" ? a === t.POLL ? "You’ve already answered this question on another device." : "You’ve already answered this question on another device. So the points for this answer won't tally." : "Something went wrong, please try again", Fn = () => /* @__PURE__ */ e(ge, { children: /* @__PURE__ */ o(Pe, { children: [
600
604
  /* @__PURE__ */ e(le, { loading: !0, style: { height: "40px", borderRadius: "100px" } }),
601
605
  /* @__PURE__ */ e(le, { loading: !0, style: { height: "24px", margin: "16px 0" } }),
602
606
  /* @__PURE__ */ e(Re, { children: Array.from({ length: 5 }).map((n, a) => /* @__PURE__ */ e(le, { loading: !0, style: { height: "44px" } }, a)) })
603
- ] }) }), Fn = ({
607
+ ] }) }), Bn = ({
604
608
  openedQuestion: n,
605
609
  isLoading: a,
606
610
  vote: c,
@@ -609,48 +613,48 @@ const J = new Je(), Xe = { hiding: !1, finished: !1 }, es = () => {
609
613
  mastersApp: p,
610
614
  webos: h
611
615
  }) => {
612
- const v = n.subject, i = n.type, m = n.status, b = n.options?.options, g = n.marketClosed, y = n.id, O = ee(), I = ee(), T = p ? !1 : n?.adUnit === Ye.STANDART, [q, P] = $(!1), [k, S] = $(!1), [C, V] = $(!0), [f, F] = $(!1), [w, L] = $(!1), [z, H] = $(""), [x, ne] = $(""), [Y, Z] = $(!1), [re, qe] = $(!1), [ue, ke] = $(!1), { runAnimation: M, hiding: me } = es();
613
- _(() => {
616
+ const v = n.subject, i = n.type, m = n.status, b = n.options?.options, g = n.marketClosed, y = n.id, S = ee(), I = ee(), T = p ? !1 : n?.adUnit === Me.STANDART, [q, P] = $(!1), [k, O] = $(!1), [C, V] = $(!0), [f, B] = $(!1), [w, L] = $(!1), [z, Z] = $(""), [x, ne] = $(""), [M, G] = $(!1), [re, qe] = $(!1), [ue, ke] = $(!1), { runAnimation: Y, hiding: me } = es();
617
+ H(() => {
614
618
  me && l(y);
615
- }, [l, me]), _(() => {
619
+ }, [l, me]), H(() => {
616
620
  i === t.PREDICTION ? g && V(!1) : m === se.RESOLVED && V(!1);
617
621
  }, []);
618
622
  const xe = N((u) => {
619
- S(u), P(!0);
623
+ O(u), P(!0);
620
624
  }, []), Ne = N(() => {
621
625
  r && P(!1);
622
626
  }, [r]), ae = ee(!1), he = N(() => {
623
627
  I.current && clearTimeout(I.current), I.current = setTimeout(() => {
624
- ke(!0), M({ delay: 5500 });
628
+ ke(!0), Y({ delay: 5500 });
625
629
  }, 4e3);
626
- }, [M]), Ie = N(
630
+ }, [Y]), Ie = N(
627
631
  async (u) => {
628
632
  if (!ae.current && (ae.current = !0, y)) {
629
633
  const D = u.currentTarget.value;
630
- H(D);
634
+ Z(D);
631
635
  try {
632
636
  await c(y, D), T && he();
633
637
  } catch (U) {
634
- ne(wn(U.message, i)), H(""), console.error("Error while voting", U), ae.current = !1;
638
+ ne(wn(U.message, i)), Z(""), console.error("Error while voting", U), ae.current = !1;
635
639
  }
636
640
  }
637
641
  },
638
- [i, y, H, c, T, he]
639
- ), Oe = N(() => {
640
- F(!0), M({ delay: 3500 });
641
- }, [M]), Se = N(() => {
642
- L(!0), M({ delay: 3500 });
643
- }, [M]), d = n?.answers.find((u) => u.youVoted === !0), A = K(
642
+ [i, y, Z, c, T, he]
643
+ ), Se = N(() => {
644
+ B(!0), Y({ delay: 3500 });
645
+ }, [Y]), Oe = N(() => {
646
+ L(!0), Y({ delay: 3500 });
647
+ }, [Y]), d = n?.answers.find((u) => u.youVoted === !0), A = K(
644
648
  () => !!n?.answers.find((u) => u.correct === !0),
645
649
  [n]
646
650
  ), R = K(
647
651
  () => n?.answers.find((u) => u.correct === !0),
648
652
  [n]
649
653
  );
650
- _(() => {
651
- d && q && !re && (O.current = setTimeout(Se, 1e4), qe(!0));
652
- }, [d]), _(() => () => {
653
- clearTimeout(O.current), clearTimeout(I.current);
654
+ H(() => {
655
+ d && q && !re && (S.current = setTimeout(Oe, 1e4), qe(!0));
656
+ }, [d]), H(() => () => {
657
+ clearTimeout(S.current), clearTimeout(I.current);
654
658
  }, []);
655
659
  const ie = K(() => n ? n.answers.map((u) => ({
656
660
  ...u,
@@ -673,16 +677,16 @@ const J = new Je(), Xe = { hiding: !1, finished: !1 }, es = () => {
673
677
  Ie,
674
678
  z
675
679
  ]);
676
- _(() => {
680
+ H(() => {
677
681
  const u = ie.some(({ percentageDecimal: U }) => U !== 0), D = d && i === t.PREDICTION;
678
- x && (r || !u || g && D) && Z(!0);
682
+ x && (r || !u || g && D) && G(!0);
679
683
  }, [ie, x, r, g, i, d]);
680
684
  const fe = b && (b.case === "trivia" || b.case === "prediction") ? b.value : void 0, j = m === se.RESOLVED && i === t.TRIVIA && !d && !C, oe = i === t.TRIVIA && k, ce = K(() => T ? !1 : i === t.PREDICTION ? r ? !1 : !!(d && !A || d && A && R?.youVoted) : !0, [i, d, A, R, r, T]), Ve = K(() => {
681
685
  if (i === t.PREDICTION && d && (!A || A && R?.youVoted))
682
686
  return d.points;
683
687
  if (!(j || f))
684
688
  return d ? d.correct ? d.pointsEarned : 0 : R?.points;
685
- }, [f, d, R, j, i, A]), Le = K(() => i === t.PREDICTION && d ? A ? A && R?.youVoted ? "You won" : "" : "To win" : j || f ? "Time expired" : i === t.POLL ? "Time remaining" : d ? "You won" : "To win", [f, i, d, j, A, R]), je = !ce || ce && i === t.PREDICTION && q && !Y, Qe = (i === t.TRIVIA || i === t.PREDICTION) && d && A && R?.youVoted, We = d || j || oe || i === t.TRIVIA && m === se.RESOLVED && C, Be = !r && (f || w) || ue, Fe = () => {
689
+ }, [f, d, R, j, i, A]), Le = K(() => i === t.PREDICTION && d ? A ? A && R?.youVoted ? "You won" : "" : "To win" : j || f ? "Time expired" : i === t.POLL ? "Time remaining" : d ? "You won" : "To win", [f, i, d, j, A, R]), je = !ce || ce && i === t.PREDICTION && q && !M, Qe = (i === t.TRIVIA || i === t.PREDICTION) && d && A && R?.youVoted, We = d || j || oe || i === t.TRIVIA && m === se.RESOLVED && C, Fe = !r && (f || w) || ue, Be = () => {
686
690
  const u = () => i === t.TRIVIA ? d?.correct ? `That's correct!
687
691
  You chose wisely.` : `So close!
688
692
  Better luck next time.` : i === t.POLL ? `Thanks for answering.
@@ -700,11 +704,11 @@ Please stay tuned for the next question.` : i === t.PREDICTION ? "Stay tuned to
700
704
  {
701
705
  icon: "icon-check-circle",
702
706
  title: "More to come...",
703
- description: w ? /* @__PURE__ */ o(B, { children: [
707
+ description: w ? /* @__PURE__ */ o(F, { children: [
704
708
  "Stay tuned for more questions ",
705
709
  /* @__PURE__ */ e("br", {}),
706
710
  " and insights."
707
- ] }) : /* @__PURE__ */ o(B, { children: [
711
+ ] }) : /* @__PURE__ */ o(F, { children: [
708
712
  "Watch for additional enhanced stream ",
709
713
  /* @__PURE__ */ e("br", {}),
710
714
  " interactive experience."
@@ -713,7 +717,7 @@ Please stay tuned for the next question.` : i === t.PREDICTION ? "Stay tuned to
713
717
  ) }) : null;
714
718
  };
715
719
  return /* @__PURE__ */ o(Ns, { children: [
716
- r && /* @__PURE__ */ e(Os, {}),
720
+ r && /* @__PURE__ */ e(Ss, {}),
717
721
  /* @__PURE__ */ e(ge, { style: r ? { marginTop: "-40px" } : {}, children: /* @__PURE__ */ o(Pe, { children: [
718
722
  !r && !T && /* @__PURE__ */ e(
719
723
  ye,
@@ -729,7 +733,7 @@ Please stay tuned for the next question.` : i === t.PREDICTION ? "Stay tuned to
729
733
  votedAfterQuestionClosed: k,
730
734
  enteredAnActiveQuestion: C,
731
735
  marketClosed: g,
732
- percentsAnimated: Y,
736
+ percentsAnimated: M,
733
737
  voteErrorMessage: x,
734
738
  votedAnswer: d
735
739
  }
@@ -739,19 +743,19 @@ Please stay tuned for the next question.` : i === t.PREDICTION ? "Stay tuned to
739
743
  {
740
744
  title: Le,
741
745
  points: Ve,
742
- onTimerExpired: Oe,
746
+ onTimerExpired: Se,
743
747
  questionType: n.type,
744
748
  isTimer: !a,
745
749
  isPlayingTimer: !d,
746
750
  animatePoints: Qe,
747
751
  timerDuration: We ? 0 : Number(n?.appearance?.autoHideInterval || "30"),
748
752
  votedInCurrentRender: q,
749
- percentsAnimated: Y
753
+ percentsAnimated: M
750
754
  }
751
755
  ),
752
- Be ? Fe() : /* @__PURE__ */ o(B, { children: [
756
+ Fe ? Be() : /* @__PURE__ */ o(F, { children: [
753
757
  r && /* @__PURE__ */ o(Ws, { children: [
754
- /* @__PURE__ */ e(Fs, { name: "iconEarlyPrediction" }),
758
+ /* @__PURE__ */ e(Bs, { name: "iconEarlyPrediction" }),
755
759
  "EARLY PREDICTION"
756
760
  ] }),
757
761
  /* @__PURE__ */ e(Ls, { style: je ? { marginTop: 0 } : {}, children: v }),
@@ -769,7 +773,7 @@ Please stay tuned for the next question.` : i === t.PREDICTION ? "Stay tuned to
769
773
  votedAfterQuestionClosed: k,
770
774
  enteredAnActiveQuestion: C,
771
775
  marketClosed: g,
772
- percentsAnimated: Y,
776
+ percentsAnimated: M,
773
777
  voteErrorMessage: x,
774
778
  isEarlyPrediction: r,
775
779
  correctAnswer: R,
@@ -784,7 +788,7 @@ Please stay tuned for the next question.` : i === t.PREDICTION ? "Stay tuned to
784
788
  ...u,
785
789
  firstOption: D === 0,
786
790
  markThatVoted: xe,
787
- onPercentsAnimated: () => Z(!0),
791
+ onPercentsAnimated: () => G(!0),
788
792
  votedAfterQuestionClosed: k,
789
793
  enteredAnActiveQuestion: C,
790
794
  marketClosed: g,
@@ -794,9 +798,9 @@ Please stay tuned for the next question.` : i === t.PREDICTION ? "Stay tuned to
794
798
  },
795
799
  u.id
796
800
  )) }),
797
- r && /* @__PURE__ */ o(B, { children: [
798
- /* @__PURE__ */ e(Ss, {}),
799
- /* @__PURE__ */ e(Vs, { children: /* @__PURE__ */ e(Ys, { name: "mastersLogoWhite" }) })
801
+ r && /* @__PURE__ */ o(F, { children: [
802
+ /* @__PURE__ */ e(Os, {}),
803
+ /* @__PURE__ */ e(Vs, { children: /* @__PURE__ */ e(Ms, { name: "mastersLogoWhite" }) })
800
804
  ] })
801
805
  ] })
802
806
  ] })
@@ -805,16 +809,16 @@ Please stay tuned for the next question.` : i === t.PREDICTION ? "Stay tuned to
805
809
  };
806
810
  export {
807
811
  Ln as C,
808
- Fn as Q,
812
+ Bn as Q,
809
813
  jn as S,
810
- Bn as Z,
814
+ Fn as Z,
811
815
  Ee as a,
812
816
  Ke as c,
813
817
  Qn as d,
814
818
  be as f,
815
819
  Vn as l,
816
- Sn as m,
820
+ On as m,
817
821
  $e as n,
818
- On as p,
822
+ Sn as p,
819
823
  es as y
820
824
  };
package/lib/es/index14.js CHANGED
@@ -1,8 +1,8 @@
1
- import { jsxs as T, jsx as e, Fragment as le } from "react/jsx-runtime";
1
+ import { jsxs as B, jsx as e, Fragment as le } from "react/jsx-runtime";
2
2
  import { s as n, c as Z } from "./feature.js";
3
- import { useState as I, useEffect as b, useCallback as v, forwardRef as ce, useRef as B } from "react";
4
- import { B as f } from "./index7.js";
5
- import { G as ue, d as ie, b as de } from "./index8.js";
3
+ import { useState as I, useEffect as b, useCallback as v, forwardRef as ce, useRef as R } from "react";
4
+ import { M as f } from "./index5.js";
5
+ import { G as ue, d as ie, b as de } from "./index9.js";
6
6
  import { C as pe } from "./useStreamLayerApp2.js";
7
7
  const me = /* @__PURE__ */ n("div")({
8
8
  name: "CloseIconWrap",
@@ -32,7 +32,7 @@ const me = /* @__PURE__ */ n("div")({
32
32
  const C = v(() => {
33
33
  d === pe.ENABLED ? t?.() : y(!0);
34
34
  }, [d, t]);
35
- return p ? /* @__PURE__ */ T(me, {
35
+ return p ? /* @__PURE__ */ B(me, {
36
36
  "data-a": "intr",
37
37
  onClick: t,
38
38
  className: a,
@@ -66,7 +66,7 @@ const me = /* @__PURE__ */ n("div")({
66
66
  name: "Poster",
67
67
  class: "p12ow7zo",
68
68
  propsAsIs: !1
69
- }), R = /* @__PURE__ */ n("div")({
69
+ }), T = /* @__PURE__ */ n("div")({
70
70
  name: "Control",
71
71
  class: "cdpal9o",
72
72
  propsAsIs: !1
@@ -106,11 +106,11 @@ const me = /* @__PURE__ */ n("div")({
106
106
  name: "WebOSIconButtonPause",
107
107
  class: "w1iylt55",
108
108
  propsAsIs: !0
109
- }), Be = () => L, Re = /* @__PURE__ */ n(Be())({
109
+ }), Re = () => L, Te = /* @__PURE__ */ n(Re())({
110
110
  name: "WebOSIconButtonMute",
111
111
  class: "w8h4h7",
112
112
  propsAsIs: !0
113
- }), Te = () => L, Le = /* @__PURE__ */ n(Te())({
113
+ }), Be = () => L, Le = /* @__PURE__ */ n(Be())({
114
114
  name: "WebOSIconButtonUnmute",
115
115
  class: "w12l12kt",
116
116
  propsAsIs: !0
@@ -137,7 +137,7 @@ function qe(...t) {
137
137
  [...t]
138
138
  );
139
139
  }
140
- const $e = de(he), De = ({ loading: t, autoPlay: a, played: o, playing: l, isMuted: i, unmute: c, mute: d, togglePlaying: p }) => !t && !a && !o ? /* @__PURE__ */ e(R, { children: l ? /* @__PURE__ */ e(f, { name: "icon-pause" }) : /* @__PURE__ */ e(f, { name: "icon-play" }) }) : o ? /* @__PURE__ */ T(ve, { children: [
140
+ const $e = de(he), De = ({ loading: t, autoPlay: a, played: o, playing: l, isMuted: i, unmute: c, mute: d, togglePlaying: p }) => !t && !a && !o ? /* @__PURE__ */ e(T, { children: l ? /* @__PURE__ */ e(f, { name: "icon-pause" }) : /* @__PURE__ */ e(f, { name: "icon-play" }) }) : o ? /* @__PURE__ */ B(ve, { children: [
141
141
  l ? /* @__PURE__ */ e(we, { onClick: p }) : /* @__PURE__ */ e(xe, { onClick: p }),
142
142
  /* @__PURE__ */ e(Me, { className: Z(!i && "muted"), onClick: i ? c : d })
143
143
  ] }) : null, Fe = ({
@@ -151,9 +151,9 @@ const $e = de(he), De = ({ loading: t, autoPlay: a, played: o, playing: l, isMut
151
151
  isMuted: p,
152
152
  hasNotPausedVideo: y,
153
153
  hasInteractedWithAudio: C
154
- }) => /* @__PURE__ */ T(le, { children: [
155
- !t && !(a && o) && /* @__PURE__ */ e(R, { "data-control-btn": "true", children: l ? y ? null : /* @__PURE__ */ e(Oe, { children: /* @__PURE__ */ e(f, { name: "icon-play" }) }) : i ? /* @__PURE__ */ e(We, { children: /* @__PURE__ */ e(f, { name: "icon-pause" }) }) : /* @__PURE__ */ e(Y, { "data-control-icon": "true", children: /* @__PURE__ */ e(f, { name: "icon-play" }) }) }),
156
- !t && a && o && C && /* @__PURE__ */ e(R, { children: p ? /* @__PURE__ */ e(Re, { onClick: c, children: /* @__PURE__ */ e(f, { name: "iconMute" }) }) : /* @__PURE__ */ e(Le, { onClick: d, children: /* @__PURE__ */ e(f, { name: "iconUnMute" }) }) })
154
+ }) => /* @__PURE__ */ B(le, { children: [
155
+ !t && !(a && o) && /* @__PURE__ */ e(T, { "data-control-btn": "true", children: l ? y ? null : /* @__PURE__ */ e(Oe, { children: /* @__PURE__ */ e(f, { name: "icon-play" }) }) : i ? /* @__PURE__ */ e(We, { children: /* @__PURE__ */ e(f, { name: "icon-pause" }) }) : /* @__PURE__ */ e(Y, { "data-control-icon": "true", children: /* @__PURE__ */ e(f, { name: "icon-play" }) }) }),
156
+ !t && a && o && C && /* @__PURE__ */ e(T, { children: p ? /* @__PURE__ */ e(Te, { onClick: c, children: /* @__PURE__ */ e(f, { name: "iconMute" }) }) : /* @__PURE__ */ e(Le, { onClick: d, children: /* @__PURE__ */ e(f, { name: "iconUnMute" }) }) })
157
157
  ] }), Ye = ce(
158
158
  ({
159
159
  poster: t,
@@ -175,7 +175,7 @@ const $e = de(he), De = ({ loading: t, autoPlay: a, played: o, playing: l, isMut
175
175
  webos: E,
176
176
  hasNotPausedVideo: ae
177
177
  }, se) => {
178
- const u = B(null), ne = qe(u, se), j = B(!1), z = B(!1), m = B(/* @__PURE__ */ new Set()), [G, K] = I(!1), [N, O] = I(!1), [H, _] = I(!1), [J, S] = I(!0), [q, W] = I(k), [$, oe] = I(!1);
178
+ const u = R(null), ne = qe(u, se), j = R(!1), z = R(!1), m = R(/* @__PURE__ */ new Set()), [G, K] = I(!1), [N, O] = I(!1), [H, _] = I(!1), [J, S] = I(!0), [q, W] = I(k), [$, oe] = I(!1);
179
179
  b(() => {
180
180
  a && (W(k), K(!1));
181
181
  }, [a]);
@@ -224,7 +224,7 @@ const $e = de(he), De = ({ loading: t, autoPlay: a, played: o, playing: l, isMut
224
224
  y?.();
225
225
  }, [y]), b(() => {
226
226
  m.current.clear(), j.current = !1;
227
- }, [a]), /* @__PURE__ */ T(
227
+ }, [a]), /* @__PURE__ */ B(
228
228
  $e,
229
229
  {
230
230
  webos: E,
@@ -308,7 +308,7 @@ const $e = de(he), De = ({ loading: t, autoPlay: a, played: o, playing: l, isMut
308
308
  hasInteractedWithAudio: $
309
309
  }
310
310
  ),
311
- H && /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(ie, {}) })
311
+ H && /* @__PURE__ */ e(T, { children: /* @__PURE__ */ e(ie, {}) })
312
312
  ]
313
313
  }
314
314
  );