@streamlayer/react-ui 1.19.1 → 1.21.0

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 (56) hide show
  1. package/lib/app/app/Advertisement/index.js +74 -72
  2. package/lib/app/app/Points/index.js +21 -14
  3. package/lib/app/app/index.js +79 -89
  4. package/lib/app/app/useApp.d.ts +2 -1
  5. package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.d.ts +2 -0
  6. package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.js +11 -10
  7. package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.d.ts +1 -0
  8. package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +22 -18
  9. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.d.ts +1 -0
  10. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.js +7 -7
  11. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.d.ts +2 -1
  12. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.js +31 -22
  13. package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.d.ts +1 -0
  14. package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.js +11 -11
  15. package/lib/app/masters/BetPack/BetPackContent/index.js +61 -49
  16. package/lib/app/masters/BetPack/BetPackOverlay/index.d.ts +1 -1
  17. package/lib/app/masters/BetPack/BetPackOverlay/index.js +3 -2
  18. package/lib/app/masters/BetPack/index.js +80 -75
  19. package/lib/app/masters/Features/Gamification/index.d.ts +0 -2
  20. package/lib/app/masters/Features/Gamification/index.js +29 -34
  21. package/lib/app/masters/Features/index.d.ts +0 -2
  22. package/lib/app/masters/Features/index.js +4 -12
  23. package/lib/app/masters/Notifications/Onboarding/index.d.ts +0 -1
  24. package/lib/app/masters/Notifications/Onboarding/index.js +42 -43
  25. package/lib/app/masters/Notifications/index.js +50 -55
  26. package/lib/app/masters/Points/index.js +24 -18
  27. package/lib/app/masters/masters.js +70 -92
  28. package/lib/app/masters/useOrientation.d.ts +3 -0
  29. package/lib/app/masters/useOrientation.js +12 -0
  30. package/lib/app/masters/useSdkResponsive.d.ts +2 -0
  31. package/lib/app/masters/useSdkResponsive.js +3 -1
  32. package/lib/app/masters/useSdkScroll.js +1 -1
  33. package/lib/app/useSdkResponsive.js +1 -1
  34. package/lib/app/useSdkScroll.js +1 -1
  35. package/lib/assets/style.css +1 -1
  36. package/lib/hooks/analytics.js +17 -42
  37. package/lib/index-CLJzLXks.js +64 -0
  38. package/lib/reset.css +1 -1
  39. package/lib/ui/advertisement/notification/index.js +8 -8
  40. package/lib/ui/advertisement/overlay/externalAd/index.js +40310 -114
  41. package/lib/ui/advertisement/overlay/externalAd/styles.d.ts +8 -0
  42. package/lib/ui/advertisement/overlay/externalAd/styles.js +39 -0
  43. package/lib/ui/close-btn/index.d.ts +2 -0
  44. package/lib/ui/close-btn/index.js +40 -32
  45. package/lib/ui/gamification/question/inapp/prediction-result/frames/content.js +48 -33
  46. package/lib/ui/gamification/vote/feedback/index.js +30 -30
  47. package/lib/ui/gamification/vote/index.js +43 -43
  48. package/lib/ui/gamification/vote/vote-option/index.js +51 -53
  49. package/lib/ui/icons/index.d.ts +3 -0
  50. package/lib/ui/icons/index.js +75 -54
  51. package/lib/ui/modal/index.js +36 -32
  52. package/lib/ui/show-in/index.js +26 -26
  53. package/lib/ui/theme/masters-theme.js +12 -4
  54. package/lib/ui/theme/theme.js +9 -5
  55. package/package.json +22 -16
  56. package/lib/index-BEm7B1u1.js +0 -72
@@ -0,0 +1,8 @@
1
+ export declare const WhyThisAd: React.FC<{
2
+ whyThisAd: any;
3
+ }>;
4
+ export declare const Container: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
5
+ export declare const ControlsContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
6
+ export declare const mediaStyle: import('@linaria/core').LinariaClassName;
7
+ export declare const mediaVisible: import('@linaria/core').LinariaClassName;
8
+ export declare const mediaHidden: import('@linaria/core').LinariaClassName;
@@ -0,0 +1,39 @@
1
+ import { jsx as t } from "react/jsx-runtime";
2
+ import { styled as o } from "@linaria/react";
3
+ const s = /* @__PURE__ */ o("a")({
4
+ name: "WhyThisAdLink",
5
+ class: "w13o8uld",
6
+ propsAsIs: !1
7
+ }), i = ({
8
+ whyThisAd: e
9
+ }) => !e.iconClickThroughURLTemplate || !e.staticResource ? null : /* @__PURE__ */ t(s, {
10
+ style: {
11
+ width: e.width,
12
+ height: e.height,
13
+ [e.xPosition]: 1,
14
+ [e.yPosition]: 1
15
+ },
16
+ href: e.iconClickThroughURLTemplate,
17
+ target: "_blank",
18
+ rel: "noreferrer",
19
+ children: /* @__PURE__ */ t("img", {
20
+ alt: "GoogleWhyThisAd",
21
+ src: e.staticResource
22
+ })
23
+ }), a = /* @__PURE__ */ o("div")({
24
+ name: "Container",
25
+ class: "c1xzooj9",
26
+ propsAsIs: !1
27
+ }), l = /* @__PURE__ */ o("div")({
28
+ name: "ControlsContainer",
29
+ class: "c1bo41vr",
30
+ propsAsIs: !1
31
+ }), c = "m13efyu8", m = "mladkgh", p = "mjnga56";
32
+ export {
33
+ a as Container,
34
+ l as ControlsContainer,
35
+ i as WhyThisAd,
36
+ p as mediaHidden,
37
+ c as mediaStyle,
38
+ m as mediaVisible
39
+ };
@@ -4,5 +4,7 @@ export declare const CloseButton: React.FC<{
4
4
  duration?: number;
5
5
  autoClose?: CloseTimerAuto;
6
6
  isPlaying?: boolean;
7
+ skipIcon?: boolean;
7
8
  className?: string;
9
+ timerClassName?: string;
8
10
  }>;
@@ -1,49 +1,57 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { styled as s } from "@linaria/react";
3
- import { useState as f, useEffect as l, useCallback as a } from "react";
4
- import { CloseTimerAuto as I } from "@streamlayer/sdk-web-types";
5
- import { SvgIcon as u } from "../icons/index.js";
6
- import { SimpleTimer as v } from "../timer/index.js";
7
- const T = /* @__PURE__ */ s("div")({
1
+ import { jsx as s, jsxs as f } from "react/jsx-runtime";
2
+ import { styled as t } from "@linaria/react";
3
+ import { useState as u, useEffect as I, useCallback as v } from "react";
4
+ import { CloseTimerAuto as x } from "@streamlayer/sdk-web-types";
5
+ import { SvgIcon as T } from "../icons/index.js";
6
+ import { SimpleTimer as d } from "../timer/index.js";
7
+ const g = /* @__PURE__ */ t("div")({
8
8
  name: "CloseIconWrap",
9
9
  class: "c3v6bv6",
10
10
  propsAsIs: !1
11
- }), g = /* @__PURE__ */ s("div")({
11
+ }), h = /* @__PURE__ */ t("div")({
12
12
  name: "TimerWrap",
13
13
  class: "teuhmro",
14
14
  propsAsIs: !1
15
- }), x = () => u, A = /* @__PURE__ */ s(x())({
15
+ }), A = () => T, C = /* @__PURE__ */ t(A())({
16
16
  name: "Icon",
17
17
  class: "i17rfxv5",
18
18
  propsAsIs: !0
19
- }), b = ({
19
+ }), y = ({
20
20
  close: r,
21
- className: n,
22
- isPlaying: c = !0,
23
- duration: o = 0,
24
- autoClose: t
21
+ className: i,
22
+ timerClassName: c,
23
+ skipIcon: o,
24
+ isPlaying: p = !0,
25
+ duration: e = 0,
26
+ autoClose: m
25
27
  }) => {
26
- const [i, m] = f(o === 0);
27
- l(() => {
28
- m(!o);
29
- }, [o]);
30
- const p = a(() => {
31
- t === I.ENABLED ? r == null || r() : m(!0);
32
- }, [t, r]);
33
- return i ? /* @__PURE__ */ e(T, {
28
+ const [a, n] = u(e === 0);
29
+ I(() => {
30
+ n(!e);
31
+ }, [e]);
32
+ const l = v(() => {
33
+ m === x.ENABLED ? r == null || r() : n(!0);
34
+ }, [m, r]);
35
+ return a ? /* @__PURE__ */ f(g, {
34
36
  onClick: r,
35
- className: n,
36
- children: /* @__PURE__ */ e(A, {
37
- name: "icon-cross"
38
- })
39
- }) : /* @__PURE__ */ e(g, {
40
- children: /* @__PURE__ */ e(v, {
41
- isPlaying: c,
42
- duration: o,
43
- onTimerExpired: p
37
+ className: i,
38
+ style: o ? {
39
+ width: "auto"
40
+ } : {},
41
+ children: [o && /* @__PURE__ */ s("span", {
42
+ children: "Skip"
43
+ }), /* @__PURE__ */ s(C, {
44
+ name: o ? "iconSkip" : "icon-cross"
45
+ })]
46
+ }) : /* @__PURE__ */ s(h, {
47
+ children: /* @__PURE__ */ s(d, {
48
+ className: c,
49
+ isPlaying: p,
50
+ duration: e,
51
+ onTimerExpired: l
44
52
  })
45
53
  });
46
54
  };
47
55
  export {
48
- b as CloseButton
56
+ y as CloseButton
49
57
  };
@@ -1,57 +1,72 @@
1
- import { jsxs as o, jsx as n } from "react/jsx-runtime";
1
+ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
2
  import { styled as s } from "@linaria/react";
3
- import { SvgIcon as e } from "../../../../../icons/index.js";
4
- const a = /* @__PURE__ */ s("div")({
3
+ import { useState as r, useCallback as u, useMemo as b } from "react";
4
+ import { SvgIcon as a } from "../../../../../icons/index.js";
5
+ const v = /* @__PURE__ */ s("div")({
5
6
  name: "Container",
6
7
  class: "cef8huz",
7
8
  propsAsIs: !1
8
- }), p = () => e, d = /* @__PURE__ */ s(p())({
9
+ }), C = () => a, k = /* @__PURE__ */ s(C())({
9
10
  name: "CheckIcon",
10
11
  class: "c1mo15kk",
11
12
  propsAsIs: !0
12
- }), l = () => e, m = /* @__PURE__ */ s(l())({
13
+ }), y = () => a, A = /* @__PURE__ */ s(y())({
13
14
  name: "PredictionIcon",
14
15
  class: "p16zkqnm",
15
16
  propsAsIs: !0
16
- }), I = /* @__PURE__ */ s("div")({
17
+ }), x = /* @__PURE__ */ s("div")({
17
18
  name: "PredictionIconContainer",
18
19
  class: "pjszi7a",
19
20
  propsAsIs: !1
20
- }), f = /* @__PURE__ */ s("div")({
21
+ }), z = /* @__PURE__ */ s("div")({
21
22
  name: "BodyContainer",
22
23
  class: "bftbmo3",
23
24
  propsAsIs: !1
24
- }), h = /* @__PURE__ */ s("div")({
25
+ }), P = /* @__PURE__ */ s("div")({
25
26
  name: "Body",
26
27
  class: "barrbyu",
27
28
  propsAsIs: !1
28
- }), C = /* @__PURE__ */ s("div")({
29
+ }), B = /* @__PURE__ */ s("div")({
29
30
  name: "Subtitle",
30
31
  class: "sz7237i",
31
32
  propsAsIs: !1
32
- }), A = ({
33
- step: c,
34
- children: i,
35
- answer: r,
36
- state: t = "pending"
37
- }) => /* @__PURE__ */ o(a, {
38
- children: [/* @__PURE__ */ n(I, {
39
- children: /* @__PURE__ */ n(m, {
40
- name: "icon-prediction"
41
- })
42
- }), /* @__PURE__ */ n(f, {
43
- children: /* @__PURE__ */ n(h, {
44
- children: i
45
- }, c)
46
- }), /* @__PURE__ */ n(C, {
47
- className: t,
48
- children: /* @__PURE__ */ o("div", {
49
- children: [/* @__PURE__ */ n(d, {
50
- name: "icon-check"
51
- }), "Your Pick: ", r]
52
- })
53
- })]
54
- });
33
+ }), R = ({
34
+ step: d,
35
+ children: p,
36
+ answer: l,
37
+ state: m = "pending"
38
+ }) => {
39
+ const [I, f] = r(0), [o] = r(() => new ResizeObserver((n) => {
40
+ var c, t;
41
+ f((t = (c = n == null ? void 0 : n[0]) == null ? void 0 : c.contentRect) == null ? void 0 : t.width);
42
+ })), h = u((n) => {
43
+ n || o.disconnect(), o.observe(n);
44
+ }, [o]);
45
+ return b(() => () => {
46
+ o.disconnect();
47
+ }, [o]), /* @__PURE__ */ i(v, {
48
+ children: [/* @__PURE__ */ e(x, {
49
+ children: /* @__PURE__ */ e(A, {
50
+ name: "icon-prediction"
51
+ })
52
+ }), /* @__PURE__ */ e(z, {
53
+ style: {
54
+ minWidth: `${I}px`
55
+ },
56
+ children: /* @__PURE__ */ e(P, {
57
+ children: p
58
+ }, d)
59
+ }), /* @__PURE__ */ e(B, {
60
+ ref: h,
61
+ className: m,
62
+ children: /* @__PURE__ */ i("div", {
63
+ children: [/* @__PURE__ */ e(k, {
64
+ name: "icon-check"
65
+ }), "Your Pick: ", l]
66
+ })
67
+ })]
68
+ });
69
+ };
55
70
  export {
56
- A as Content
71
+ R as Content
57
72
  };
@@ -1,74 +1,74 @@
1
- import { jsx as i, jsxs as c, Fragment as j } from "react/jsx-runtime";
1
+ import { jsx as i, jsxs as c, Fragment as Y } from "react/jsx-runtime";
2
2
  import { QuestionType as l } from "@streamlayer/sdk-web-types";
3
3
  import { SvgIcon as m } from "../../../icons/index.js";
4
- import { ShowInContainer as H, Container as z, FeedbackContainer as h, IconPrediction as L, FeedbackDescription as F, FeedbackIconWrap as k, FeedbackHeader as x, FeedbackText as T, EarlyFeedbackDescription as G, FeedbackDynamicDescription as J, DynamicWrap as K, FeedbackTitle as U, FeedbackTitleWrap as X, FeedbackResultDescription as Z, FeedbackResultDescriptionWrap as _ } from "./styles.js";
4
+ import { ShowInContainer as H, Container as z, FeedbackContainer as t, IconPrediction as j, FeedbackDescription as F, FeedbackIconWrap as u, FeedbackHeader as x, FeedbackText as T, EarlyFeedbackDescription as G, FeedbackDynamicDescription as J, DynamicWrap as K, FeedbackTitle as U, FeedbackTitleWrap as X, FeedbackResultDescription as Z, FeedbackResultDescriptionWrap as _ } from "./styles.js";
5
5
  const s = ({
6
- feedbackMessages: t,
6
+ feedbackMessages: h,
7
7
  questionVotedCorrectly: R,
8
- questionVoted: u,
8
+ questionVoted: k,
9
9
  questionType: d,
10
10
  hasCorrectAnswer: r,
11
11
  showExpiredNotification: f,
12
12
  showClosedNotificationTrivia: O,
13
13
  votedInCurrentRender: b,
14
- votedAfterQuestionClosed: $,
15
- voteErrorMessage: e,
16
- enteredAnActiveQuestion: W,
14
+ votedAfterQuestionClosed: L,
15
+ voteErrorMessage: n,
16
+ enteredAnActiveQuestion: $,
17
17
  marketClosed: y,
18
18
  percentsAnimated: B,
19
19
  votedAnswer: I,
20
- isEarlyPrediction: n,
20
+ isEarlyPrediction: e,
21
21
  correctAnswer: o
22
22
  }) => {
23
- const C = u && (d === l.TRIVIA || d === l.PREDICTION), N = d === l.PREDICTION && !r, D = y && d === l.PREDICTION && !u && !W || d === l.PREDICTION && $ && b && W, S = C && N, P = C && r, Q = d === l.PREDICTION && u && b && r, Y = u && d === l.POLL && b, p = R ? "correct" : "incorrect", a = R ? t == null ? void 0 : t.correctFeedback : t == null ? void 0 : t.incorrectFeedback;
24
- return f || O || S || P || D || Y || Q || e ? /* @__PURE__ */ i(H, { enabled: b, animate: B, children: /* @__PURE__ */ c(z, { "data-prediction": N, children: [
25
- e && !D && /* @__PURE__ */ c(h, { children: [
26
- !n && /* @__PURE__ */ i(L, { name: "questionExpired" }),
27
- /* @__PURE__ */ i(F, { children: e })
23
+ const W = k && (d === l.TRIVIA || d === l.PREDICTION), C = d === l.PREDICTION && !r, D = y && d === l.PREDICTION && !k || d === l.PREDICTION && L && b && $, N = W && C, Q = W && r, S = d === l.PREDICTION && k && b && r, P = k && d === l.POLL && b, p = R ? "correct" : "incorrect", a = R ? h == null ? void 0 : h.correctFeedback : h == null ? void 0 : h.incorrectFeedback;
24
+ return f || O || N || Q || D || P || S || n ? /* @__PURE__ */ i(H, { enabled: b, animate: B, children: /* @__PURE__ */ c(z, { "data-prediction": C, children: [
25
+ n && !D && /* @__PURE__ */ c(t, { children: [
26
+ !e && /* @__PURE__ */ i(j, { name: "questionExpired" }),
27
+ /* @__PURE__ */ i(F, { children: n })
28
28
  ] }),
29
- !e && f && /* @__PURE__ */ c(h, { children: [
30
- !n && /* @__PURE__ */ i(k, { children: /* @__PURE__ */ i(m, { name: "questionExpired" }) }),
29
+ !n && f && /* @__PURE__ */ c(t, { children: [
30
+ !e && /* @__PURE__ */ i(u, { children: /* @__PURE__ */ i(m, { name: "questionExpired" }) }),
31
31
  /* @__PURE__ */ c("div", { children: [
32
32
  /* @__PURE__ */ i(x, { children: /* @__PURE__ */ i(F, { children: "Question Expired" }) }),
33
33
  /* @__PURE__ */ i(T, { children: "You can still answer to see if you're correct, but no points are awarded for expired questions." })
34
34
  ] })
35
35
  ] }),
36
- !e && O && /* @__PURE__ */ c(h, { children: [
37
- /* @__PURE__ */ i(k, { children: /* @__PURE__ */ i(m, { name: "questionExpired" }) }),
36
+ !n && O && /* @__PURE__ */ c(t, { children: [
37
+ /* @__PURE__ */ i(u, { children: /* @__PURE__ */ i(m, { name: "questionExpired" }) }),
38
38
  /* @__PURE__ */ c("div", { children: [
39
39
  /* @__PURE__ */ i(x, { children: /* @__PURE__ */ i(F, { children: "Question Closed" }) }),
40
40
  /* @__PURE__ */ i(T, { children: "This question was answered after the moderator closed the question. So the points for this answer won’t tally." })
41
41
  ] })
42
42
  ] }),
43
- D && /* @__PURE__ */ c(h, { children: [
44
- !n && /* @__PURE__ */ i(k, { children: /* @__PURE__ */ i(m, { name: "questionExpired" }) }),
43
+ D && /* @__PURE__ */ c(t, { children: [
44
+ !e && /* @__PURE__ */ i(u, { children: /* @__PURE__ */ i(m, { name: "questionExpired" }) }),
45
45
  /* @__PURE__ */ c("div", { children: [
46
- /* @__PURE__ */ i(x, { children: /* @__PURE__ */ i(F, { children: n ? r ? "The results are already in!" : "Question is Closed" : "Question Closed" }) }),
47
- /* @__PURE__ */ i(T, { children: n ? /* @__PURE__ */ i(G, { children: r ? `Correct: ${o == null ? void 0 : o.text}` : "Event affecting the outcome has occurred." }) : "This event has already taken place, so the ability to make a prediction on its outcome is no longer available." })
46
+ /* @__PURE__ */ i(x, { children: /* @__PURE__ */ i(F, { children: e ? r ? "The results are already in!" : "Question is Closed" : "Question Closed" }) }),
47
+ /* @__PURE__ */ i(T, { children: e ? /* @__PURE__ */ i(G, { children: r ? `Correct: ${o == null ? void 0 : o.text}` : "Event affecting the outcome has occurred." }) : "This event has already taken place, so the ability to make a prediction on its outcome is no longer available." })
48
48
  ] })
49
49
  ] }),
50
- !e && S && /* @__PURE__ */ c(h, { children: [
51
- !n && /* @__PURE__ */ i(L, { name: "icon-prediction" }),
50
+ !n && N && /* @__PURE__ */ c(t, { children: [
51
+ !e && /* @__PURE__ */ i(j, { name: "icon-prediction" }),
52
52
  /* @__PURE__ */ c(J, { children: [
53
53
  "Your pick has been recorded. ",
54
54
  /* @__PURE__ */ i(K, { children: "We’ll notify you of the result." })
55
55
  ] })
56
56
  ] }),
57
- !e && Y && /* @__PURE__ */ c(h, { children: [
58
- !n && /* @__PURE__ */ i(k, { "data-feedback-type": "correct", children: /* @__PURE__ */ i(m, { name: "correct" }) }),
57
+ !n && P && /* @__PURE__ */ c(t, { children: [
58
+ !e && /* @__PURE__ */ i(u, { "data-feedback-type": "correct", children: /* @__PURE__ */ i(m, { name: "correct" }) }),
59
59
  /* @__PURE__ */ i(F, { children: "Thanks for answering. Please stay tuned for the next question." })
60
60
  ] }),
61
- !e && (P || Q) && /* @__PURE__ */ c(h, { children: [
62
- !n && /* @__PURE__ */ i(k, { "data-feedback-type": p, children: /* @__PURE__ */ i(m, { name: p }) }),
61
+ !n && (Q || S) && /* @__PURE__ */ c(t, { children: [
62
+ !e && /* @__PURE__ */ i(u, { "data-feedback-type": p, children: /* @__PURE__ */ i(m, { name: p }) }),
63
63
  /* @__PURE__ */ i("div", { children: /* @__PURE__ */ c(x, { children: [
64
- n ? /* @__PURE__ */ i(X, { children: p === "incorrect" ? /* @__PURE__ */ c(j, { children: [
64
+ e ? /* @__PURE__ */ i(X, { children: p === "incorrect" ? /* @__PURE__ */ c(Y, { children: [
65
65
  /* @__PURE__ */ i("div", { children: "So close!" }),
66
66
  /* @__PURE__ */ i("div", { children: "Better luck next time" })
67
- ] }) : /* @__PURE__ */ c(j, { children: [
67
+ ] }) : /* @__PURE__ */ c(Y, { children: [
68
68
  /* @__PURE__ */ i("div", { children: "That’s correct!" }),
69
69
  /* @__PURE__ */ i("div", { children: "You chose wisely." })
70
70
  ] }) }) : /* @__PURE__ */ i(U, { "data-feedback-type": p, children: a == null ? void 0 : a.title }),
71
- n ? /* @__PURE__ */ c(_, { children: [
71
+ e ? /* @__PURE__ */ c(_, { children: [
72
72
  /* @__PURE__ */ c("div", { children: [
73
73
  "Your pick: ",
74
74
  I == null ? void 0 : I.text
@@ -1,31 +1,31 @@
1
1
  import { jsx as r, jsxs as m, Fragment as O } from "react/jsx-runtime";
2
2
  import { useHideTransition as gt } from "../../../hooks/showIn.js";
3
3
  import { useRef as U, useState as l, useEffect as p, useCallback as S, useMemo as g } from "react";
4
- import { QuestionType as a, QuestionStatus as b } from "@streamlayer/sdk-web-types";
5
- import { Skeleton as L } from "../../skeleton/index.js";
4
+ import { QuestionType as c, QuestionStatus as L } from "@streamlayer/sdk-web-types";
5
+ import { Skeleton as M } from "../../skeleton/index.js";
6
6
  import { Alert as It } from "./alert/index.js";
7
7
  import { Feedback as X } from "./feedback/index.js";
8
- import { Container as Z, Content as $, Options as Q, QuestionScrollContainer as Ct, TopShadow as Vt, AlertContainer as pt, EarlyPrediction as vt, EarlyPredictionIcon as yt, Title as wt, OptionsWrap as At, BottomShadow as Et, SponsorLogo as Rt, SponsorIcon as Ot } from "./styles.js";
8
+ import { Container as Z, Content as $, Options as Q, QuestionScrollContainer as Ct, TopShadow as Vt, AlertContainer as pt, EarlyPrediction as vt, EarlyPredictionIcon as wt, Title as yt, OptionsWrap as At, BottomShadow as Rt, SponsorLogo as Et, SponsorIcon as Ot } from "./styles.js";
9
9
  import { VotingOption as St } from "./vote-option/index.js";
10
10
  import { WinBar as xt } from "./win-bar/index.js";
11
11
  const qt = (e, u) => {
12
12
  switch (e) {
13
13
  case "already_voted":
14
- return u === a.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.";
14
+ return u === c.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.";
15
15
  default:
16
16
  return "Something went wrong, please try again";
17
17
  }
18
18
  }, jt = () => /* @__PURE__ */ r(Z, { children: /* @__PURE__ */ m($, { children: [
19
- /* @__PURE__ */ r(L, { loading: !0, style: { height: "40px", borderRadius: "100px" } }),
20
- /* @__PURE__ */ r(L, { loading: !0, style: { height: "24px", margin: "16px 0" } }),
21
- /* @__PURE__ */ r(Q, { children: Array.from({ length: 5 }).map((e, u) => /* @__PURE__ */ r(L, { loading: !0, style: { height: "44px" } }, u)) })
22
- ] }) }), Ht = ({ openedQuestion: e, isLoading: u, vote: M, close: W, isEarlyPrediction: c }) => {
19
+ /* @__PURE__ */ r(M, { loading: !0, style: { height: "40px", borderRadius: "100px" } }),
20
+ /* @__PURE__ */ r(M, { loading: !0, style: { height: "24px", margin: "16px 0" } }),
21
+ /* @__PURE__ */ r(Q, { children: Array.from({ length: 5 }).map((e, u) => /* @__PURE__ */ r(M, { loading: !0, style: { height: "44px" } }, u)) })
22
+ ] }) }), Ht = ({ openedQuestion: e, isLoading: u, vote: P, close: W, isEarlyPrediction: a }) => {
23
23
  var J, K;
24
- const tt = e.subject, n = e.type, I = e.status, v = (J = e.options) == null ? void 0 : J.options, T = e.marketClosed, x = e.id, B = U(), [C, et] = l(!1), [y, rt] = l(!1), [V, Y] = l(!0), [f, nt] = l(!1), [j, ot] = l(!1), [H, q] = l(""), [w, st] = l(""), [A, F] = l(!1), [it, at] = l(!1), { runAnimation: E, finished: _ } = gt();
24
+ const tt = e.subject, n = e.type, I = e.status, v = (J = e.options) == null ? void 0 : J.options, T = e.marketClosed, x = e.id, B = U(), [C, et] = l(!1), [w, rt] = l(!1), [V, Y] = l(!0), [f, nt] = l(!1), [j, ot] = l(!1), [H, q] = l(""), [y, st] = l(""), [A, F] = l(!1), [it, at] = l(!1), { runAnimation: R, finished: _ } = gt();
25
25
  p(() => {
26
26
  _ && W();
27
27
  }, [W, _]), p(() => {
28
- n === a.PREDICTION ? T && Y(!1) : I === b.RESOLVED && Y(!1);
28
+ n === c.PREDICTION ? T && Y(!1) : I === L.RESOLVED && Y(!1);
29
29
  }, []);
30
30
  const ct = S((s) => {
31
31
  rt(s), et(!0);
@@ -35,18 +35,18 @@ const qt = (e, u) => {
35
35
  const h = s.currentTarget.value;
36
36
  q(h);
37
37
  try {
38
- await M(x, h);
39
- } catch (R) {
40
- st(qt(R.message, n)), q(""), console.error("Error while voting", R), D.current = !1;
38
+ await P(x, h);
39
+ } catch (E) {
40
+ st(qt(E.message, n)), q(""), console.error("Error while voting", E), D.current = !1;
41
41
  }
42
42
  }
43
43
  },
44
- [n, x, q, M]
44
+ [n, x, q, P]
45
45
  ), lt = S(() => {
46
- nt(!0), E({ delay: 3500 });
47
- }, [E]), mt = S(() => {
48
- ot(!0), E({ delay: 3500 });
49
- }, [E]), t = e == null ? void 0 : e.answers.find((s) => s.youVoted === !0), i = g(
46
+ nt(!0), R({ delay: 3500 });
47
+ }, [R]), mt = S(() => {
48
+ ot(!0), R({ delay: 3500 });
49
+ }, [R]), t = e == null ? void 0 : e.answers.find((s) => s.youVoted === !0), i = g(
50
50
  () => !!(e != null && e.answers.find((s) => s.correct === !0)),
51
51
  [e]
52
52
  ), o = g(
@@ -83,19 +83,19 @@ const qt = (e, u) => {
83
83
  H
84
84
  ]);
85
85
  p(() => {
86
- const s = k.some(({ percentageDecimal: R }) => R !== 0), h = t && n === a.PREDICTION;
87
- w && (!s || T && h) && F(!0);
88
- }, [k, w, T, n, t]);
89
- const G = v && (v.case === "trivia" || v.case === "prediction") ? v.value : void 0, d = I === b.RESOLVED && n === a.TRIVIA && !t && !V, N = n === a.TRIVIA && y, P = g(() => n === a.PREDICTION ? c ? !1 : !!(t && !i || t && i && (o != null && o.youVoted)) : !0, [n, t, i, o, c]), ut = g(() => {
90
- if (n === a.PREDICTION && t && (!i || i && (o != null && o.youVoted)))
86
+ const s = k.some(({ percentageDecimal: E }) => E !== 0), h = t && n === c.PREDICTION;
87
+ y && (a || !s || T && h) && F(!0);
88
+ }, [k, y, a, T, n, t]);
89
+ const G = v && (v.case === "trivia" || v.case === "prediction") ? v.value : void 0, d = I === L.RESOLVED && n === c.TRIVIA && !t && !V, N = n === c.TRIVIA && w, b = g(() => n === c.PREDICTION ? a ? !1 : !!(t && !i || t && i && (o != null && o.youVoted)) : !0, [n, t, i, o, a]), ut = g(() => {
90
+ if (n === c.PREDICTION && t && (!i || i && (o != null && o.youVoted)))
91
91
  return t.points;
92
92
  if (!(d || f))
93
93
  return t ? t.correct ? t.pointsEarned : 0 : o == null ? void 0 : o.points;
94
- }, [f, t, o, d, n, i]), ft = g(() => n === a.PREDICTION && t ? i ? i && (o != null && o.youVoted) ? "You won" : "" : "To win" : d || f ? "Time expired" : n === a.POLL ? "Time remaining" : t ? "You won" : "To win", [f, n, t, d, i, o]), dt = !P || P && n === a.PREDICTION && C && !A, ht = (n === a.TRIVIA || n === a.PREDICTION) && t && i && (o == null ? void 0 : o.youVoted), Tt = t || d || N || n === a.TRIVIA && I === b.RESOLVED && V;
94
+ }, [f, t, o, d, n, i]), ft = g(() => n === c.PREDICTION && t ? i ? i && (o != null && o.youVoted) ? "You won" : "" : "To win" : d || f ? "Time expired" : n === c.POLL ? "Time remaining" : t ? "You won" : "To win", [f, n, t, d, i, o]), dt = !b || b && n === c.PREDICTION && C && !A, ht = (n === c.TRIVIA || n === c.PREDICTION) && t && i && (o == null ? void 0 : o.youVoted), Tt = t || d || N || n === c.TRIVIA && I === L.RESOLVED && V;
95
95
  return /* @__PURE__ */ m(Ct, { children: [
96
- c && /* @__PURE__ */ r(Vt, {}),
97
- /* @__PURE__ */ r(Z, { style: c ? { marginTop: "-40px" } : {}, children: /* @__PURE__ */ m($, { id: "questionContent", children: [
98
- !c && /* @__PURE__ */ r(
96
+ a && /* @__PURE__ */ r(Vt, {}),
97
+ /* @__PURE__ */ r(Z, { style: a ? { marginTop: "-40px" } : {}, children: /* @__PURE__ */ m($, { id: "questionContent", children: [
98
+ !a && /* @__PURE__ */ r(
99
99
  X,
100
100
  {
101
101
  feedbackMessages: G,
@@ -106,15 +106,15 @@ const qt = (e, u) => {
106
106
  showExpiredNotification: d,
107
107
  showClosedNotificationTrivia: N,
108
108
  votedInCurrentRender: C,
109
- votedAfterQuestionClosed: y,
109
+ votedAfterQuestionClosed: w,
110
110
  enteredAnActiveQuestion: V,
111
111
  marketClosed: T,
112
112
  percentsAnimated: A,
113
- voteErrorMessage: w,
113
+ voteErrorMessage: y,
114
114
  votedAnswer: t
115
115
  }
116
116
  ),
117
- P && /* @__PURE__ */ r(
117
+ b && /* @__PURE__ */ r(
118
118
  xt,
119
119
  {
120
120
  title: ft,
@@ -129,7 +129,7 @@ const qt = (e, u) => {
129
129
  percentsAnimated: A
130
130
  }
131
131
  ),
132
- !c && (f || j) ? /* @__PURE__ */ r(pt, { children: /* @__PURE__ */ r(
132
+ !a && (f || j) ? /* @__PURE__ */ r(pt, { children: /* @__PURE__ */ r(
133
133
  It,
134
134
  {
135
135
  icon: "icon-check-circle",
@@ -145,12 +145,12 @@ const qt = (e, u) => {
145
145
  ] })
146
146
  }
147
147
  ) }) : /* @__PURE__ */ m(O, { children: [
148
- c && /* @__PURE__ */ m(vt, { children: [
149
- /* @__PURE__ */ r(yt, { name: "iconEarlyPrediction" }),
148
+ a && /* @__PURE__ */ m(vt, { children: [
149
+ /* @__PURE__ */ r(wt, { name: "iconEarlyPrediction" }),
150
150
  "EARLY PREDICTION"
151
151
  ] }),
152
- /* @__PURE__ */ r(wt, { style: dt ? { marginTop: 0 } : {}, children: tt }),
153
- c && /* @__PURE__ */ r(
152
+ /* @__PURE__ */ r(yt, { style: dt ? { marginTop: 0 } : {}, children: tt }),
153
+ a && /* @__PURE__ */ r(
154
154
  X,
155
155
  {
156
156
  feedbackMessages: G,
@@ -161,12 +161,12 @@ const qt = (e, u) => {
161
161
  showExpiredNotification: d,
162
162
  showClosedNotificationTrivia: N,
163
163
  votedInCurrentRender: C,
164
- votedAfterQuestionClosed: y,
164
+ votedAfterQuestionClosed: w,
165
165
  enteredAnActiveQuestion: V,
166
166
  marketClosed: T,
167
167
  percentsAnimated: A,
168
- voteErrorMessage: w,
169
- isEarlyPrediction: c,
168
+ voteErrorMessage: y,
169
+ isEarlyPrediction: a,
170
170
  correctAnswer: o,
171
171
  votedAnswer: t
172
172
  }
@@ -178,16 +178,16 @@ const qt = (e, u) => {
178
178
  ...s,
179
179
  markThatVoted: ct,
180
180
  onPercentsAnimated: () => F(!0),
181
- votedAfterQuestionClosed: y,
181
+ votedAfterQuestionClosed: w,
182
182
  enteredAnActiveQuestion: V,
183
183
  marketClosed: T,
184
- isEarlyPrediction: c
184
+ isEarlyPrediction: a
185
185
  },
186
186
  s.id
187
187
  )) }),
188
- c && /* @__PURE__ */ m(O, { children: [
189
- /* @__PURE__ */ r(Et, {}),
190
- /* @__PURE__ */ r(Rt, { children: /* @__PURE__ */ r(Ot, { name: "mastersLogoWhite" }) })
188
+ a && /* @__PURE__ */ m(O, { children: [
189
+ /* @__PURE__ */ r(Rt, {}),
190
+ /* @__PURE__ */ r(Et, { children: /* @__PURE__ */ r(Ot, { name: "mastersLogoWhite" }) })
191
191
  ] })
192
192
  ] })
193
193
  ] })