@streamlayer/react-ui 1.20.0 → 1.22.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 (58) hide show
  1. package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.d.ts +1 -0
  2. package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.js +11 -11
  3. package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.d.ts +0 -1
  4. package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +18 -22
  5. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.d.ts +0 -1
  6. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.js +7 -7
  7. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.d.ts +1 -2
  8. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/useDynamicParentFont.js +16 -19
  9. package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.d.ts +0 -1
  10. package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.js +25 -24
  11. package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.d.ts +1 -0
  12. package/lib/app/masters/BetPack/BetPackContent/StartScreen/styles.js +14 -9
  13. package/lib/app/masters/BetPack/BetPackContent/index.js +68 -66
  14. package/lib/app/masters/BetPack/BetPackOverlay/index.js +3 -2
  15. package/lib/app/masters/BetPack/index.js +64 -62
  16. package/lib/app/masters/BetPack/utils.d.ts +1 -1
  17. package/lib/app/masters/BetPack/utils.js +8 -7
  18. package/lib/app/masters/Features/Gamification/index.js +5 -5
  19. package/lib/app/masters/Features/index.d.ts +2 -2
  20. package/lib/app/masters/Features/index.js +1 -1
  21. package/lib/app/masters/Header/index.js +19 -23
  22. package/lib/app/masters/Notifications/Onboarding/index.d.ts +0 -1
  23. package/lib/app/masters/Notifications/Onboarding/index.js +42 -43
  24. package/lib/app/masters/Notifications/index.js +50 -55
  25. package/lib/app/masters/masters.js +60 -56
  26. package/lib/app/masters/useOrientation.d.ts +3 -0
  27. package/lib/app/masters/useOrientation.js +12 -0
  28. package/lib/app/masters/useSdkResponsive.js +2 -2
  29. package/lib/app/masters/useSdkScroll.js +12 -12
  30. package/lib/app/useSdkResponsive.js +1 -1
  31. package/lib/app/useSdkScroll.js +1 -1
  32. package/lib/assets/style.css +1 -1
  33. package/lib/index-DSi8Qgfs.js +14 -0
  34. package/lib/index-DXvAPWiE.js +3743 -0
  35. package/lib/index-tnt2CtQe.js +55 -0
  36. package/lib/ui/advertisement/overlay/externalAd/index.d.ts +1 -1
  37. package/lib/ui/advertisement/overlay/externalAd/index.js +79 -40323
  38. package/lib/ui/advertisement/overlay/externalAd/styles.d.ts +10 -0
  39. package/lib/ui/advertisement/overlay/externalAd/styles.js +49 -0
  40. package/lib/ui/advertisement/overlay/externalAd/vast-player/module.d.js +1 -0
  41. package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMPlayer.d.ts +19 -0
  42. package/lib/ui/advertisement/overlay/externalAd/vast-player/useGAMPlayer.js +33199 -0
  43. package/lib/ui/advertisement/overlay/externalAd/vast-player/useVastAds.d.ts +24 -0
  44. package/lib/ui/advertisement/overlay/externalAd/vast-player/useVastAds.js +8 -0
  45. package/lib/ui/gamification/vote/feedback/index.d.ts +1 -0
  46. package/lib/ui/gamification/vote/feedback/index.js +83 -73
  47. package/lib/ui/gamification/vote/feedback/styles.d.ts +1 -0
  48. package/lib/ui/gamification/vote/feedback/styles.js +40 -39
  49. package/lib/ui/gamification/vote/index.js +98 -95
  50. package/lib/ui/icons/index.d.ts +1 -0
  51. package/lib/ui/icons/index.js +88 -79
  52. package/lib/ui/modal/index.js +31 -34
  53. package/lib/ui/theme/breakpoints.d.ts +1 -0
  54. package/lib/ui/theme/breakpoints.js +17 -9
  55. package/lib/ui/theme/masters-theme.js +1 -0
  56. package/lib/useVastAds-Dt_tRbpd.js +1284 -0
  57. package/package.json +18 -15
  58. package/lib/index-CLJzLXks.js +0 -64
@@ -2,4 +2,5 @@ export declare const EmergencyScreen: React.FC<{
2
2
  actionFn: () => void;
3
3
  description: string;
4
4
  isMobile?: boolean;
5
+ height?: number;
5
6
  }>;
@@ -1,15 +1,15 @@
1
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
- import { cx as m } from "@linaria/core";
3
- import { useDynamicParentFont as s } from "../ScreenContainer/useDynamicParentFont.js";
4
- import { EmergencyContainer as a, EmergencyScreenTitle as l, EmergencyScreenDescription as g, EmergencyScreenButton as y } from "./styles.js";
5
- const E = ({ actionFn: n, description: r, isMobile: c }) => {
6
- const { container: o, fontSize: t } = s();
7
- return /* @__PURE__ */ i(a, { style: { fontSize: t }, ref: o, className: m("betPack", !!c && "isMobile"), children: [
8
- /* @__PURE__ */ e(l, { children: "Something went wrong." }),
9
- /* @__PURE__ */ e(g, { children: r }),
10
- /* @__PURE__ */ e(y, { onClick: n, children: "Try again" })
1
+ import { jsxs as m, jsx as e } from "react/jsx-runtime";
2
+ import { cx as s } from "@linaria/core";
3
+ import { useDynamicParentFont as a } from "../ScreenContainer/useDynamicParentFont.js";
4
+ import { EmergencyContainer as l, EmergencyScreenTitle as g, EmergencyScreenDescription as y, EmergencyScreenButton as f } from "./styles.js";
5
+ const d = ({ actionFn: n, description: r, isMobile: c, height: o }) => {
6
+ const { container: t, fontSize: i } = a(o);
7
+ return /* @__PURE__ */ m(l, { style: { fontSize: i }, ref: t, className: s("betPack", !!c && "isMobile"), children: [
8
+ /* @__PURE__ */ e(g, { children: "Something went wrong." }),
9
+ /* @__PURE__ */ e(y, { children: r }),
10
+ /* @__PURE__ */ e(f, { onClick: n, children: "Try again" })
11
11
  ] });
12
12
  };
13
13
  export {
14
- E as EmergencyScreen
14
+ d as EmergencyScreen
15
15
  };
@@ -2,5 +2,4 @@ import { BetPackEventCb } from '../..';
2
2
  export declare const EndScreen: React.FC<{
3
3
  height: number | undefined;
4
4
  onEvent: BetPackEventCb;
5
- swipeable?: boolean;
6
5
  }>;
@@ -1,31 +1,27 @@
1
1
  import { jsx as e, jsxs as n } from "react/jsx-runtime";
2
- import { useState as p } from "react";
3
- import { ScreenContainer as i } from "../ScreenContainer/index.js";
4
- import { ScreenWrap as t, EndFirstScreenWrap as m, EndScreenMain as d, SponsorIcon as h, EndScreenTitle as S, EndScreenDescription as u, EndScreenButton as o, EndLastScreenWrap as E, EndScreenMedia as b, EndLastScreenDescription as f } from "./styles.js";
5
- const y = ({
6
- height: r,
7
- onEvent: s,
8
- swipeable: c
9
- }) => {
10
- const [l, a] = p(
2
+ import { useState as a } from "react";
3
+ import { ScreenContainer as c } from "../ScreenContainer/index.js";
4
+ import { ScreenWrap as i, EndFirstScreenWrap as p, EndScreenMain as t, SponsorIcon as m, EndScreenTitle as h, EndScreenDescription as S, EndScreenButton as d, EndLastScreenWrap as u, EndScreenMedia as E, EndLastScreenDescription as b } from "./styles.js";
5
+ const x = ({ height: r, onEvent: o }) => {
6
+ const [s, l] = a(
11
7
  0
12
8
  /* FIRST */
13
9
  );
14
- return l === 0 ? /* @__PURE__ */ e(i, { height: r, swipeable: c, children: /* @__PURE__ */ e(t, { children: /* @__PURE__ */ n(m, { children: [
15
- /* @__PURE__ */ n(d, { children: [
16
- /* @__PURE__ */ e(h, { name: "icon-masters-logo" }),
17
- /* @__PURE__ */ e(S, { children: "Great picks!" }),
18
- /* @__PURE__ */ n(u, { children: [
10
+ return s === 0 ? /* @__PURE__ */ e(c, { height: r, children: /* @__PURE__ */ e(i, { children: /* @__PURE__ */ n(p, { children: [
11
+ /* @__PURE__ */ n(t, { children: [
12
+ /* @__PURE__ */ e(m, { name: "icon-masters-logo" }),
13
+ /* @__PURE__ */ e(h, { children: "Great picks!" }),
14
+ /* @__PURE__ */ n(S, { children: [
19
15
  "As results come in we’ll send you",
20
16
  /* @__PURE__ */ e("br", {}),
21
17
  "live updates right here."
22
18
  ] })
23
19
  ] }),
24
20
  /* @__PURE__ */ e(
25
- o,
21
+ d,
26
22
  {
27
23
  onClick: () => {
28
- a(
24
+ l(
29
25
  1
30
26
  /* LAST */
31
27
  );
@@ -33,18 +29,18 @@ const y = ({
33
29
  children: "Continue"
34
30
  }
35
31
  )
36
- ] }) }) }, "end") : /* @__PURE__ */ e(i, { height: r, swipeable: c, children: /* @__PURE__ */ e(t, { children: /* @__PURE__ */ n(E, { children: [
37
- /* @__PURE__ */ n(d, { children: [
38
- /* @__PURE__ */ e(b, { src: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/bet_pack_end_screen.png" }),
39
- /* @__PURE__ */ n(f, { children: [
32
+ ] }) }) }, "end") : /* @__PURE__ */ e(c, { height: r, children: /* @__PURE__ */ e(i, { children: /* @__PURE__ */ n(u, { children: [
33
+ /* @__PURE__ */ n(t, { children: [
34
+ /* @__PURE__ */ e(E, { src: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/bet_pack_end_screen.png" }),
35
+ /* @__PURE__ */ n(b, { children: [
40
36
  "Look for more live match insights,",
41
37
  /* @__PURE__ */ e("br", {}),
42
38
  "predictions and more."
43
39
  ] })
44
40
  ] }),
45
- /* @__PURE__ */ e(o, { onClick: () => s({ type: "slOpenGameCenter" }), children: "Open Game Center" })
41
+ /* @__PURE__ */ e(d, { onClick: () => o({ type: "slOpenGameCenter" }), children: "Open Game Center" })
46
42
  ] }) }) }, "end");
47
43
  };
48
44
  export {
49
- y as EndScreen
45
+ x as EndScreen
50
46
  };
@@ -1,5 +1,4 @@
1
1
  export declare const ScreenContainer: React.FC<{
2
2
  children: React.ReactNode;
3
3
  height?: number;
4
- swipeable?: boolean;
5
4
  }>;
@@ -1,10 +1,10 @@
1
- import { jsx as e } from "react/jsx-runtime";
2
- import { ScreenContainerBox as m } from "./styles.js";
3
- import { useDynamicParentFont as a } from "./useDynamicParentFont.js";
4
- const p = ({ children: r, height: n, swipeable: t }) => {
5
- const { container: o, fontSize: i, calcHeight: c } = a(n, t);
6
- return /* @__PURE__ */ e(m, { style: { height: c, fontSize: i }, ref: o, children: /* @__PURE__ */ e("div", { children: r }) });
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import { ScreenContainerBox as i } from "./styles.js";
3
+ import { useDynamicParentFont as c } from "./useDynamicParentFont.js";
4
+ const s = ({ children: o, height: r }) => {
5
+ const { container: e, fontSize: t } = c(r);
6
+ return /* @__PURE__ */ n(i, { style: { height: r, fontSize: t }, ref: e, children: /* @__PURE__ */ n("div", { children: o }) });
7
7
  };
8
8
  export {
9
- p as ScreenContainer
9
+ s as ScreenContainer
10
10
  };
@@ -1,5 +1,4 @@
1
- export declare const useDynamicParentFont: (height?: number, swipeable?: boolean) => {
1
+ export declare const useDynamicParentFont: (height?: number) => {
2
2
  container: import('react').MutableRefObject<HTMLDivElement | null>;
3
3
  fontSize: string;
4
- calcHeight: number | undefined;
5
4
  };
@@ -1,36 +1,33 @@
1
- import { useState as T, useRef as p, useEffect as w } from "react";
2
- const g = "16px", m = 17, S = 21, f = 24, h = (r) => r < 0.9 ? f : r < 1.17 ? S : m, C = (r, E) => {
3
- const [v, a] = T(g), [_, u] = T(""), c = p(null), e = p();
4
- return w(() => {
1
+ import { useState as _, useRef as d, useEffect as h } from "react";
2
+ const l = "16px", w = 17, m = 21, p = 24, T = (o) => o < 0.9 ? p : o < 1.17 ? m : w, S = (o) => {
3
+ const [E, u] = _(l), c = d(null), e = d();
4
+ return h(() => {
5
5
  const t = c.current, n = () => {
6
6
  e.current && (clearTimeout(e.current), e.current = void 0), e.current = setTimeout(() => {
7
7
  if (t) {
8
- const o = getComputedStyle(t), d = +o.width.replace("px", ""), O = +o.height.replace("px", "") / d, l = d / h(O);
9
- a(`${l < 20 ? l : 20}px`);
8
+ const s = getComputedStyle(t), i = +s.width.replace("px", ""), v = +s.height.replace("px", "") / i, a = i / T(v);
9
+ u(`${a < 20 ? a : 20}px`);
10
10
  }
11
11
  e.current = void 0;
12
12
  }, 200);
13
- }, s = () => {
14
- window.screen.orientation.type.includes("landscape") || String(window.orientation).includes("90") ? u("landscape") : u("portrait");
15
- }, i = () => {
16
- s(), n();
13
+ }, r = () => {
14
+ n();
17
15
  };
18
- return window.screen.orientation.addEventListener("change", i), window.addEventListener("orientationchange", i), window.addEventListener("resize", n), t == null || t.addEventListener("transitionend", n, !1), s(), n(), () => {
19
- window.screen.orientation.removeEventListener("change", i), window.removeEventListener("orientationchange", i), window.removeEventListener("resize", n), t == null || t.removeEventListener("transitionend", n), e.current && clearTimeout(e.current);
16
+ return window.screen.orientation.addEventListener("change", r), window.addEventListener("orientationchange", r), window.addEventListener("resize", n), t == null || t.addEventListener("transitionend", n, !1), n(), () => {
17
+ window.screen.orientation.removeEventListener("change", r), window.removeEventListener("orientationchange", r), window.removeEventListener("resize", n), t == null || t.removeEventListener("transitionend", n), e.current && clearTimeout(e.current);
20
18
  };
21
- }, []), w(() => (e.current && (clearTimeout(e.current), e.current = void 0), e.current = setTimeout(() => {
19
+ }, []), h(() => (e.current && (clearTimeout(e.current), e.current = void 0), e.current = setTimeout(() => {
22
20
  if (c.current) {
23
- const t = getComputedStyle(c.current), n = +t.width.replace("px", ""), i = +t.height.replace("px", "") / n, o = n / h(i);
24
- a(`${o < 20 ? o : 20}px`), e.current = void 0;
21
+ const t = getComputedStyle(c.current), n = +t.width.replace("px", ""), s = +t.height.replace("px", "") / n, i = n / T(s);
22
+ u(`${i < 20 ? i : 20}px`), e.current = void 0;
25
23
  }
26
24
  }, 200), () => {
27
25
  e.current && clearTimeout(e.current);
28
- }), [r]), {
26
+ }), [o]), {
29
27
  container: c,
30
- fontSize: v,
31
- calcHeight: _ === "landscape" && r !== void 0 && E ? r + 30 : r
28
+ fontSize: E
32
29
  };
33
30
  };
34
31
  export {
35
- C as useDynamicParentFont
32
+ S as useDynamicParentFont
36
33
  };
@@ -2,5 +2,4 @@ export declare const StartScreen: React.FC<{
2
2
  height: number | undefined;
3
3
  countQuestionsAvailable: number;
4
4
  sliderRef: React.MutableRefObject<null>;
5
- swipeable?: boolean;
6
5
  }>;
@@ -1,35 +1,36 @@
1
- import { jsx as r, jsxs as e } from "react/jsx-runtime";
2
- import { ScreenContainer as s } from "../ScreenContainer/index.js";
3
- import { ScreenWrap as S, Main as a, SponsorIcon as l, StartScreenSponsor as p, StartScreenTitle as d, StartScreenDescription as h, StartScreenButton as m, IconArrowRight as x } from "./styles.js";
4
- const T = ({ height: o, countQuestionsAvailable: n, sliderRef: i, swipeable: c }) => /* @__PURE__ */ r(s, { height: o, swipeable: c, children: /* @__PURE__ */ e(S, { children: [
5
- /* @__PURE__ */ e(a, { children: [
6
- /* @__PURE__ */ r(l, { name: "icon-masters-logo" }),
7
- /* @__PURE__ */ r(p, { children: "MASTERS PRESENTS" }),
8
- /* @__PURE__ */ e(d, { children: [
9
- "Tee time predictions:",
10
- /* @__PURE__ */ r("br", {}),
11
- "share your expertise"
12
- ] }),
13
- /* @__PURE__ */ e(h, { children: [
14
- "Swipe to answer today’s",
15
- /* @__PURE__ */ r("br", {}),
16
- "question cards."
1
+ import { jsx as e, jsxs as r } from "react/jsx-runtime";
2
+ import { ScreenContainer as a } from "../ScreenContainer/index.js";
3
+ import { ScreenWrap as c, Main as s, SponsorIcon as l, StartScreenSponsor as S, StartScreenTitle as h, StartScreenDescription as d, StartScreenButton as p, IconArrowRight as m, StartScreenNote as f } from "./styles.js";
4
+ const x = ({ height: o, countQuestionsAvailable: t, sliderRef: i }) => /* @__PURE__ */ e(a, { height: o, children: /* @__PURE__ */ r(c, { children: [
5
+ /* @__PURE__ */ r(s, { children: [
6
+ /* @__PURE__ */ e(l, { name: "icon-masters-logo" }),
7
+ /* @__PURE__ */ e(S, { children: "Featured Groups+" }),
8
+ /* @__PURE__ */ e(h, { children: "The First Five" }),
9
+ /* @__PURE__ */ r(d, { children: [
10
+ "Tee off with these five initial",
11
+ /* @__PURE__ */ e("br", {}),
12
+ "predictions for today’s play."
17
13
  ] })
18
14
  ] }),
19
- /* @__PURE__ */ e(
20
- m,
15
+ /* @__PURE__ */ r(
16
+ p,
21
17
  {
22
18
  onClick: () => {
23
- var t;
24
- (t = i.current) == null || t.slickNext();
19
+ var n;
20
+ (n = i.current) == null || n.slickNext();
25
21
  },
26
22
  children: [
27
- n ? `${n} questions available` : "See all questions",
28
- /* @__PURE__ */ r(x, { name: "iconArrowRight" })
23
+ t ? `${t} questions available` : "See all questions",
24
+ /* @__PURE__ */ e(m, { name: "iconArrowRight" })
29
25
  ]
30
26
  }
31
- )
27
+ ),
28
+ /* @__PURE__ */ r(f, { children: [
29
+ "Note: Some questions may have been",
30
+ /* @__PURE__ */ e("br", {}),
31
+ "resolved as a result of today’s play."
32
+ ] })
32
33
  ] }) }, "start");
33
34
  export {
34
- T as StartScreen
35
+ x as StartScreen
35
36
  };
@@ -6,3 +6,4 @@ export declare const StartScreenSponsor: import('@linaria/react').StyledComponen
6
6
  export declare const StartScreenTitle: any;
7
7
  export declare const StartScreenDescription: any;
8
8
  export declare const StartScreenButton: any;
9
+ export declare const StartScreenNote: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
@@ -1,15 +1,15 @@
1
1
  import { styled as s } from "@linaria/react";
2
- import { ScreenTitle as r, ScreenDescription as n, ScreenButton as t } from "../../styles.js";
2
+ import { ScreenTitle as t, ScreenDescription as r, ScreenButton as n } from "../../styles.js";
3
3
  import { SvgIcon as e } from "../../../../../ui/icons/index.js";
4
4
  const I = /* @__PURE__ */ s("div")({
5
5
  name: "ScreenWrap",
6
6
  class: "s991vvm",
7
7
  propsAsIs: !1
8
- }), u = /* @__PURE__ */ s("div")({
8
+ }), A = /* @__PURE__ */ s("div")({
9
9
  name: "Main",
10
10
  class: "mnbj36g",
11
11
  propsAsIs: !1
12
- }), o = () => e, A = /* @__PURE__ */ s(o())({
12
+ }), o = () => e, u = /* @__PURE__ */ s(o())({
13
13
  name: "IconArrowRight",
14
14
  class: "izrvgt",
15
15
  propsAsIs: !0
@@ -21,26 +21,31 @@ const I = /* @__PURE__ */ s("div")({
21
21
  name: "StartScreenSponsor",
22
22
  class: "s1oq8jlq",
23
23
  propsAsIs: !1
24
- }), p = () => r, g = /* @__PURE__ */ s(p())({
24
+ }), p = () => t, g = /* @__PURE__ */ s(p())({
25
25
  name: "StartScreenTitle",
26
26
  class: "se4nn9a",
27
27
  propsAsIs: !0
28
- }), a = () => n, x = /* @__PURE__ */ s(a())({
28
+ }), a = () => r, x = /* @__PURE__ */ s(a())({
29
29
  name: "StartScreenDescription",
30
30
  class: "sofug8s",
31
31
  propsAsIs: !0
32
- }), S = () => t, _ = /* @__PURE__ */ s(S())({
32
+ }), S = () => n, d = /* @__PURE__ */ s(S())({
33
33
  name: "StartScreenButton",
34
34
  class: "s18s0pjp",
35
35
  propsAsIs: !0
36
+ }), _ = /* @__PURE__ */ s("div")({
37
+ name: "StartScreenNote",
38
+ class: "s1pgosw8",
39
+ propsAsIs: !1
36
40
  });
37
41
  export {
38
- A as IconArrowRight,
39
- u as Main,
42
+ u as IconArrowRight,
43
+ A as Main,
40
44
  I as ScreenWrap,
41
45
  f as SponsorIcon,
42
- _ as StartScreenButton,
46
+ d as StartScreenButton,
43
47
  x as StartScreenDescription,
48
+ _ as StartScreenNote,
44
49
  v as StartScreenSponsor,
45
50
  g as StartScreenTitle
46
51
  };
@@ -1,104 +1,114 @@
1
- import { jsx as u, jsxs as R } from "react/jsx-runtime";
1
+ import { jsx as a, jsxs as R } from "react/jsx-runtime";
2
2
  import { ConnectError as T, Code as N } from "@connectrpc/connect";
3
3
  import { cx as A } from "@linaria/core";
4
- import { useCallback as x, useSyncExternalStore as F, useRef as b, useState as I, useMemo as B, useEffect as v } from "react";
5
- import { EmergencyScreen as S } from "./EmergencyScreen/index.js";
6
- import { EndScreen as D } from "./EndScreen/index.js";
7
- import { LoaderScreen as H } from "./LoaderScreen/index.js";
8
- import { QuestionScreen as L } from "./QuestionScreen/index.js";
9
- import { ScreenContainer as V } from "./ScreenContainer/index.js";
10
- import { StartScreen as w } from "./StartScreen/index.js";
11
- import { settings as h } from "./constants.js";
12
- import { Carousel as K, desktopDots as M } from "./styles.js";
13
- function q(t, o, n) {
14
- let a = new Set(o).add(void 0);
15
- return t.listen((s, c, p) => {
16
- a.has(p) && n(s, c, p);
4
+ import { useCallback as P, useSyncExternalStore as F, useRef as b, useState as B, useMemo as M, useEffect as S } from "react";
5
+ import { EmergencyScreen as v } from "./EmergencyScreen/index.js";
6
+ import { EndScreen as V } from "./EndScreen/index.js";
7
+ import { LoaderScreen as D } from "./LoaderScreen/index.js";
8
+ import { QuestionScreen as H } from "./QuestionScreen/index.js";
9
+ import { ScreenContainer as I } from "./ScreenContainer/index.js";
10
+ import { StartScreen as L } from "./StartScreen/index.js";
11
+ import { settings as x } from "./constants.js";
12
+ import { Carousel as w, desktopDots as K } from "./styles.js";
13
+ function z(t, o, c) {
14
+ let l = new Set(o).add(void 0);
15
+ return t.listen((n, s, p) => {
16
+ l.has(p) && c(n, s, p);
17
17
  });
18
18
  }
19
- function z(t, o = {}) {
20
- let n = x(
21
- (s) => o.keys ? q(t, o.keys, s) : t.listen(s),
19
+ function G(t, o = {}) {
20
+ let c = P(
21
+ (n) => o.keys ? z(t, o.keys, n) : t.listen(n),
22
22
  [o.keys, t]
23
- ), a = t.get.bind(t);
24
- return F(n, a, a);
23
+ ), l = t.get.bind(t);
24
+ return F(c, l, l);
25
25
  }
26
- const re = ({ gamification: t, autoplay: o, swipeable: n, changeHeightOnInit: a, height: s, onEvent: c, centerPadding: p }) => {
27
- const i = b(), l = b(null), [P, C] = I(!1), { data: r, error: f, loading: y } = z(t.betPack.getStore()), { listOfQuestions: m, countQuestionsAvailable: O } = B(() => {
26
+ const re = ({ gamification: t, autoplay: o, swipeable: c, changeHeightOnInit: l, height: n, onEvent: s, centerPadding: p }) => {
27
+ const i = b(), d = b(null), [C, O] = B(!1), { data: r, error: f, loading: y } = G(t.betPack.getStore()), { listOfQuestions: m, countQuestionsAvailable: Q } = M(() => {
28
28
  const e = r ? Object.values(r) : [];
29
29
  return {
30
30
  listOfQuestions: e,
31
- countQuestionsAvailable: e.filter(({ marketClosed: d }) => !d).length
31
+ countQuestionsAvailable: e.filter(({ marketClosed: u }) => !u).length
32
32
  };
33
33
  }, [r]);
34
- v(() => {
35
- !f && !y && r !== void 0 && !P && c({
34
+ S(() => {
35
+ !f && !y && r !== void 0 && !C && s({
36
36
  type: "slBetPackReady",
37
37
  payload: {
38
38
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
39
39
  // @ts-expect-error
40
40
  next: () => {
41
41
  var e;
42
- return (e = l.current) == null ? void 0 : e.slickNext();
42
+ return (e = d.current) == null ? void 0 : e.slickNext();
43
43
  },
44
44
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
45
45
  // @ts-expect-error
46
46
  prev: () => {
47
47
  var e;
48
- return (e = l.current) == null ? void 0 : e.slickPrev();
48
+ return (e = d.current) == null ? void 0 : e.slickPrev();
49
49
  },
50
50
  current: 0,
51
51
  canNext: !0,
52
52
  canPrev: !1
53
53
  }
54
54
  });
55
- }, [r, f, y, c]);
56
- const Q = x(
57
- async (e, d) => {
55
+ }, [r, f, y, s]);
56
+ const h = P(
57
+ async (e, u) => {
58
58
  try {
59
- C(!0), await t.betPackVote(e, d);
59
+ O(!0), await t.betPackVote(e, u), s({
60
+ type: "slVoted",
61
+ payload: {
62
+ questionId: e,
63
+ answerId: u
64
+ }
65
+ });
60
66
  } finally {
61
67
  i.current && clearTimeout(i.current), o && (i.current = setTimeout(() => {
62
68
  var k;
63
- (k = l.current) == null || k.slickNext();
69
+ (k = d.current) == null || k.slickNext();
64
70
  }, 2e3));
65
71
  }
66
72
  },
67
- [t, l, o]
73
+ [t, s, o]
68
74
  );
69
- if (v(() => () => {
75
+ if (S(() => () => {
70
76
  i.current && clearTimeout(i.current);
71
77
  }, []), y)
72
- return /* @__PURE__ */ u(H, {});
78
+ return /* @__PURE__ */ a(D, {});
73
79
  if (!f && (r == null || !Object.keys(r).length))
74
- return /* @__PURE__ */ u(
75
- S,
80
+ return /* @__PURE__ */ a(
81
+ v,
76
82
  {
77
- actionFn: () => c({ type: "slHardRefresh" }),
83
+ actionFn: () => s({ type: "slHardRefresh" }),
78
84
  description: `It looks like we couldn't
79
- load the questions.`
85
+ load the questions.`,
86
+ isMobile: c,
87
+ height: n
80
88
  }
81
89
  );
82
90
  if (f)
83
- return /* @__PURE__ */ u(
84
- S,
91
+ return /* @__PURE__ */ a(
92
+ v,
85
93
  {
86
- actionFn: () => c({ type: "slHardRefresh" }),
94
+ actionFn: () => s({ type: "slHardRefresh" }),
87
95
  description: f instanceof T && f.code !== N.InvalidArgument ? `The event ID was not
88
96
  specified or is invalid.` : `The server is unable to
89
- handle this request.`
97
+ handle this request.`,
98
+ isMobile: c,
99
+ height: n
90
100
  }
91
101
  );
92
- const g = (e) => {
93
- var d;
94
- if (c({
102
+ const j = (e) => {
103
+ var u;
104
+ if (s({
95
105
  type: "slBetPackChangeCard",
96
106
  payload: {
97
107
  current: e,
98
108
  canNext: e < Object.keys(r).length + 1,
99
109
  canPrev: e >= 1
100
110
  }
101
- }), e !== 0 && e !== Object.keys(r).length + 1 && ((d = m[e - 1]) != null && d.id)) {
111
+ }), e !== 0 && e !== Object.keys(r).length + 1 && ((u = m[e - 1]) != null && u.id)) {
102
112
  t.openQuestion(m[e - 1].id, {
103
113
  openedFrom: "bet-pack",
104
114
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -115,32 +125,24 @@ handle this request.`
115
125
  return;
116
126
  }
117
127
  t.closeQuestion();
118
- }, j = (e) => e ? /* @__PURE__ */ u(V, { height: s, swipeable: n, children: /* @__PURE__ */ u(L, { question: e, vote: Q }) }, e.id) : null;
128
+ }, g = (e) => e ? /* @__PURE__ */ a(I, { height: n, children: /* @__PURE__ */ a(H, { question: e, vote: h }) }, e.id) : null;
119
129
  return /* @__PURE__ */ R(
120
- K,
130
+ w,
121
131
  {
122
- ...h,
123
- swipe: n,
124
- onInit: a,
125
- centerPadding: p || h.centerPadding,
126
- afterChange: g,
132
+ ...x,
133
+ swipe: c,
134
+ onInit: l,
135
+ centerPadding: p || x.centerPadding,
136
+ afterChange: j,
127
137
  beforeChange: () => {
128
138
  i.current && clearTimeout(i.current);
129
139
  },
130
- ref: l,
131
- className: A(!n && M),
140
+ ref: d,
141
+ className: A(!c && K),
132
142
  children: [
133
- /* @__PURE__ */ u(
134
- w,
135
- {
136
- height: s,
137
- sliderRef: l,
138
- countQuestionsAvailable: O,
139
- swipeable: n
140
- }
141
- ),
142
- Object.values(r).map(j),
143
- /* @__PURE__ */ u(D, { onEvent: c, height: s, swipeable: n })
143
+ /* @__PURE__ */ a(L, { height: n, sliderRef: d, countQuestionsAvailable: Q }),
144
+ Object.values(r).map(g),
145
+ /* @__PURE__ */ a(V, { onEvent: s, height: n })
144
146
  ]
145
147
  }
146
148
  );
@@ -1,9 +1,10 @@
1
1
  import "react/jsx-runtime";
2
2
  import "@linaria/core";
3
+ import "../../useOrientation.js";
3
4
  import "react";
4
- import { BetPackOverlay as a } from "../index.js";
5
+ import { BetPackOverlay as c } from "../index.js";
5
6
  import "../../../../ui/icons/index.js";
6
7
  import "./styles.js";
7
8
  export {
8
- a as BetPackOverlay
9
+ c as BetPackOverlay
9
10
  };