@streamlayer/react-ui 1.19.0 → 1.20.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 (43) 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 +1 -0
  6. package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/index.js +10 -9
  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 +45 -37
  16. package/lib/app/masters/BetPack/BetPackOverlay/index.d.ts +1 -1
  17. package/lib/app/masters/BetPack/index.js +80 -77
  18. package/lib/app/masters/Points/index.js +24 -18
  19. package/lib/app/masters/masters.js +75 -87
  20. package/lib/app/masters/useSdkResponsive.d.ts +2 -0
  21. package/lib/app/masters/useSdkResponsive.js +3 -1
  22. package/lib/app/masters/useSdkScroll.js +1 -1
  23. package/lib/app/useSdkResponsive.js +1 -1
  24. package/lib/app/useSdkScroll.js +1 -1
  25. package/lib/assets/style.css +1 -1
  26. package/lib/hooks/analytics.js +17 -42
  27. package/lib/index-CLJzLXks.js +64 -0
  28. package/lib/reset.css +1 -1
  29. package/lib/ui/advertisement/notification/index.js +8 -8
  30. package/lib/ui/advertisement/overlay/externalAd/index.js +40306 -94
  31. package/lib/ui/close-btn/index.d.ts +2 -0
  32. package/lib/ui/close-btn/index.js +40 -32
  33. package/lib/ui/gamification/question/inapp/prediction-result/frames/content.js +48 -33
  34. package/lib/ui/gamification/vote/feedback/index.js +30 -30
  35. package/lib/ui/gamification/vote/vote-option/index.js +51 -53
  36. package/lib/ui/icons/index.d.ts +3 -0
  37. package/lib/ui/icons/index.js +75 -54
  38. package/lib/ui/modal/index.js +36 -32
  39. package/lib/ui/show-in/index.js +26 -26
  40. package/lib/ui/theme/masters-theme.js +12 -4
  41. package/lib/ui/theme/theme.js +9 -5
  42. package/package.json +22 -16
  43. package/lib/index-BEm7B1u1.js +0 -72
@@ -1,27 +1,36 @@
1
- import a from "lodash.throttle";
2
- import { useState as d, useRef as T, useEffect as c } from "react";
3
- const i = "16px", u = 17, O = 21, h = 24, f = (n) => n < 0.9 ? h : n < 1.17 ? O : u, I = (n) => {
4
- const [E, s] = d(i), r = T(null);
5
- return c(() => {
6
- const e = a(() => {
7
- const { offsetWidth: t, offsetHeight: o } = r.current || {};
8
- if (!t || !o) return;
9
- const _ = o / t;
10
- s(t ? `${t / f(_)}px` : i);
11
- }, 200);
12
- return window.screen.orientation.addEventListener("change", e), window.addEventListener("orientationchange", e), window.addEventListener("resize", e), e(), () => {
13
- window.screen.orientation.removeEventListener("change", e), window.removeEventListener("resize", e), window.removeEventListener("orientationchange", e);
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(() => {
5
+ const t = c.current, n = () => {
6
+ e.current && (clearTimeout(e.current), e.current = void 0), e.current = setTimeout(() => {
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`);
10
+ }
11
+ e.current = void 0;
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();
14
17
  };
15
- }, []), c(() => {
16
- const { offsetWidth: e, offsetHeight: t } = r.current || {};
17
- if (!e || !t) return;
18
- const o = t / e;
19
- s(e ? `${e / f(o)}px` : i);
20
- }, [n]), {
21
- container: r,
22
- fontSize: E
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);
20
+ };
21
+ }, []), w(() => (e.current && (clearTimeout(e.current), e.current = void 0), e.current = setTimeout(() => {
22
+ 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;
25
+ }
26
+ }, 200), () => {
27
+ e.current && clearTimeout(e.current);
28
+ }), [r]), {
29
+ container: c,
30
+ fontSize: v,
31
+ calcHeight: _ === "landscape" && r !== void 0 && E ? r + 30 : r
23
32
  };
24
33
  };
25
34
  export {
26
- I as useDynamicParentFont
35
+ C as useDynamicParentFont
27
36
  };
@@ -2,4 +2,5 @@ export declare const StartScreen: React.FC<{
2
2
  height: number | undefined;
3
3
  countQuestionsAvailable: number;
4
4
  sliderRef: React.MutableRefObject<null>;
5
+ swipeable?: boolean;
5
6
  }>;
@@ -1,23 +1,23 @@
1
1
  import { jsx as r, jsxs as e } from "react/jsx-runtime";
2
- import { ScreenContainer as c } from "../ScreenContainer/index.js";
3
- import { ScreenWrap as s, Main as S, SponsorIcon as a, StartScreenSponsor as l, StartScreenTitle as p, StartScreenDescription as d, StartScreenButton as h, IconArrowRight as m } from "./styles.js";
4
- const R = ({ height: o, countQuestionsAvailable: n, sliderRef: i }) => /* @__PURE__ */ r(c, { height: o, children: /* @__PURE__ */ e(s, { children: [
5
- /* @__PURE__ */ e(S, { children: [
6
- /* @__PURE__ */ r(a, { name: "icon-masters-logo" }),
7
- /* @__PURE__ */ r(l, { children: "MASTERS PRESENTS" }),
8
- /* @__PURE__ */ e(p, { children: [
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
9
  "Tee time predictions:",
10
10
  /* @__PURE__ */ r("br", {}),
11
11
  "share your expertise"
12
12
  ] }),
13
- /* @__PURE__ */ e(d, { children: [
13
+ /* @__PURE__ */ e(h, { children: [
14
14
  "Swipe to answer today’s",
15
15
  /* @__PURE__ */ r("br", {}),
16
16
  "question cards."
17
17
  ] })
18
18
  ] }),
19
19
  /* @__PURE__ */ e(
20
- h,
20
+ m,
21
21
  {
22
22
  onClick: () => {
23
23
  var t;
@@ -25,11 +25,11 @@ const R = ({ height: o, countQuestionsAvailable: n, sliderRef: i }) => /* @__PUR
25
25
  },
26
26
  children: [
27
27
  n ? `${n} questions available` : "See all questions",
28
- /* @__PURE__ */ r(m, { name: "iconArrowRight" })
28
+ /* @__PURE__ */ r(x, { name: "iconArrowRight" })
29
29
  ]
30
30
  }
31
31
  )
32
32
  ] }) }, "start");
33
33
  export {
34
- R as StartScreen
34
+ T as StartScreen
35
35
  };
@@ -1,30 +1,30 @@
1
- import { jsx as i, jsxs as R } from "react/jsx-runtime";
1
+ import { jsx as u, jsxs as R } from "react/jsx-runtime";
2
2
  import { ConnectError as T, Code as N } from "@connectrpc/connect";
3
- import { cx as w } from "@linaria/core";
4
- import { useCallback as x, useSyncExternalStore as A, useRef as b, useState as F, useMemo as I, useEffect as v } from "react";
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
5
  import { EmergencyScreen as S } from "./EmergencyScreen/index.js";
6
- import { EndScreen as B } 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 L } from "./ScreenContainer/index.js";
10
- import { StartScreen as V } from "./StartScreen/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
11
  import { settings as h } from "./constants.js";
12
12
  import { Carousel as K, desktopDots as M } from "./styles.js";
13
- function q(t, n, u) {
14
- let a = /* @__PURE__ */ new Set([...n, void 0]);
15
- return t.listen((s, o, p) => {
16
- a.has(p) && u(s, o, p);
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);
17
17
  });
18
18
  }
19
- function z(t, n = {}) {
20
- let u = x(
21
- (s) => n.keys ? q(t, n.keys, s) : t.listen(s),
22
- [n.keys, t]
19
+ function z(t, o = {}) {
20
+ let n = x(
21
+ (s) => o.keys ? q(t, o.keys, s) : t.listen(s),
22
+ [o.keys, t]
23
23
  ), a = t.get.bind(t);
24
- return A(u, a, a);
24
+ return F(n, a, a);
25
25
  }
26
- const re = ({ gamification: t, autoplay: n, swipeable: u, changeHeightOnInit: a, height: s, onEvent: o, centerPadding: p }) => {
27
- const c = b(), l = b(null), [P, C] = F(!1), { data: r, error: f, loading: y } = z(t.betPack.getStore()), { listOfQuestions: m, countQuestionsAvailable: O } = I(() => {
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(() => {
28
28
  const e = r ? Object.values(r) : [];
29
29
  return {
30
30
  listOfQuestions: e,
@@ -32,7 +32,7 @@ const re = ({ gamification: t, autoplay: n, swipeable: u, changeHeightOnInit: a,
32
32
  };
33
33
  }, [r]);
34
34
  v(() => {
35
- !f && !y && r !== void 0 && !P && o({
35
+ !f && !y && r !== void 0 && !P && c({
36
36
  type: "slBetPackReady",
37
37
  payload: {
38
38
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -52,38 +52,38 @@ const re = ({ gamification: t, autoplay: n, swipeable: u, changeHeightOnInit: a,
52
52
  canPrev: !1
53
53
  }
54
54
  });
55
- }, [r, f, y, o]);
55
+ }, [r, f, y, c]);
56
56
  const Q = x(
57
57
  async (e, d) => {
58
58
  try {
59
59
  C(!0), await t.betPackVote(e, d);
60
60
  } finally {
61
- c.current && clearTimeout(c.current), n && (c.current = setTimeout(() => {
61
+ i.current && clearTimeout(i.current), o && (i.current = setTimeout(() => {
62
62
  var k;
63
63
  (k = l.current) == null || k.slickNext();
64
64
  }, 2e3));
65
65
  }
66
66
  },
67
- [t, l, n]
67
+ [t, l, o]
68
68
  );
69
69
  if (v(() => () => {
70
- c.current && clearTimeout(c.current);
70
+ i.current && clearTimeout(i.current);
71
71
  }, []), y)
72
- return /* @__PURE__ */ i(D, {});
72
+ return /* @__PURE__ */ u(H, {});
73
73
  if (!f && (r == null || !Object.keys(r).length))
74
- return /* @__PURE__ */ i(
74
+ return /* @__PURE__ */ u(
75
75
  S,
76
76
  {
77
- actionFn: () => o({ type: "slHardRefresh" }),
77
+ actionFn: () => c({ type: "slHardRefresh" }),
78
78
  description: `It looks like we couldn't
79
79
  load the questions.`
80
80
  }
81
81
  );
82
82
  if (f)
83
- return /* @__PURE__ */ i(
83
+ return /* @__PURE__ */ u(
84
84
  S,
85
85
  {
86
- actionFn: () => o({ type: "slHardRefresh" }),
86
+ actionFn: () => c({ type: "slHardRefresh" }),
87
87
  description: f instanceof T && f.code !== N.InvalidArgument ? `The event ID was not
88
88
  specified or is invalid.` : `The server is unable to
89
89
  handle this request.`
@@ -91,7 +91,7 @@ handle this request.`
91
91
  );
92
92
  const g = (e) => {
93
93
  var d;
94
- if (o({
94
+ if (c({
95
95
  type: "slBetPackChangeCard",
96
96
  payload: {
97
97
  current: e,
@@ -100,7 +100,7 @@ handle this request.`
100
100
  }
101
101
  }), e !== 0 && e !== Object.keys(r).length + 1 && ((d = m[e - 1]) != null && d.id)) {
102
102
  t.openQuestion(m[e - 1].id, {
103
- openedFrom: "list",
103
+ openedFrom: "bet-pack",
104
104
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
105
105
  // @ts-expect-error
106
106
  attributes: {
@@ -115,24 +115,32 @@ handle this request.`
115
115
  return;
116
116
  }
117
117
  t.closeQuestion();
118
- }, j = (e) => e ? /* @__PURE__ */ i(L, { height: s, children: /* @__PURE__ */ i(H, { question: e, vote: Q }) }, e.id) : null;
118
+ }, j = (e) => e ? /* @__PURE__ */ u(V, { height: s, swipeable: n, children: /* @__PURE__ */ u(L, { question: e, vote: Q }) }, e.id) : null;
119
119
  return /* @__PURE__ */ R(
120
120
  K,
121
121
  {
122
122
  ...h,
123
- swipe: u,
123
+ swipe: n,
124
124
  onInit: a,
125
125
  centerPadding: p || h.centerPadding,
126
126
  afterChange: g,
127
127
  beforeChange: () => {
128
- c.current && clearTimeout(c.current);
128
+ i.current && clearTimeout(i.current);
129
129
  },
130
130
  ref: l,
131
- className: w(!u && M),
131
+ className: A(!n && M),
132
132
  children: [
133
- /* @__PURE__ */ i(V, { height: s, sliderRef: l, countQuestionsAvailable: O }),
133
+ /* @__PURE__ */ u(
134
+ w,
135
+ {
136
+ height: s,
137
+ sliderRef: l,
138
+ countQuestionsAvailable: O,
139
+ swipeable: n
140
+ }
141
+ ),
134
142
  Object.values(r).map(j),
135
- /* @__PURE__ */ i(B, { onEvent: o, height: s })
143
+ /* @__PURE__ */ u(D, { onEvent: c, height: s, swipeable: n })
136
144
  ]
137
145
  }
138
146
  );
@@ -9,4 +9,4 @@ export type BetPackOverlayProps = {
9
9
  payload?: unknown;
10
10
  }) => void;
11
11
  };
12
- export declare const BetPackOverlay: React.FC<BetPackOverlayProps>;
12
+ export declare const BetPackOverlay: import('react').ForwardRefExoticComponent<BetPackOverlayProps & import('react').RefAttributes<HTMLDivElement>>;
@@ -1,90 +1,93 @@
1
- import { jsxs as f, jsx as r } from "react/jsx-runtime";
2
- import { cx as p } from "@linaria/core";
3
- import C from "lodash.throttle";
4
- import { useState as g, useCallback as S, memo as H, useMemo as B, useRef as N, useEffect as A } from "react";
5
- import { useStore as P } from "@streamlayer/react-polyfills";
6
- import { FeatureType as b } from "@streamlayer/sdk-web-types";
7
- import { BetPackContent as L } from "./BetPackContent/index.js";
8
- import { EmergencyScreen as z } from "./BetPackContent/EmergencyScreen/index.js";
9
- import { LoaderScreen as F } from "./BetPackContent/LoaderScreen/index.js";
10
- import { BetPackContainer as I } from "./styles.js";
11
- import { defaultEventHandler as O } from "./utils.js";
12
- import { SvgIcon as x } from "../../../ui/icons/index.js";
13
- import { Container as R, Header as j, HeaderTitle as E, CloseButton as M, Main as T, Footer as G, SlideSwitchButton as v, IconArrowPrev as U, buttonAvailable as y, IconArrowNext as Y } from "./BetPackOverlay/styles.js";
14
- const ne = ({ sdk: l, onEvent: o, close: u, isMobile: c }) => {
15
- const [t, h] = g(), [e, a] = g(), i = S(
16
- (n) => {
17
- if (n.type === "slBetPackReady") {
18
- const { next: s, prev: d, current: m, canNext: k, canPrev: w } = n.payload || {};
19
- h({ next: s, prev: d }), a({
20
- current: m,
21
- canPrev: w,
22
- canNext: k
23
- });
24
- }
25
- if (n.type === "slBetPackChangeCard") {
26
- const { current: s, canNext: d, canPrev: m } = n.payload || {};
27
- a({ current: s, canNext: d, canPrev: m });
28
- }
29
- o == null || o(n);
30
- },
31
- [o]
32
- );
33
- return /* @__PURE__ */ f(R, { children: [
34
- /* @__PURE__ */ f(j, { children: [
35
- /* @__PURE__ */ f(E, { children: [
36
- /* @__PURE__ */ r(x, { name: "icon-trophy-bet-pack" }),
37
- "LiveMatch Experience",
38
- " "
1
+ import { jsxs as f, jsx as e } from "react/jsx-runtime";
2
+ import { cx as x } from "@linaria/core";
3
+ import A from "lodash.throttle";
4
+ import { forwardRef as b, useState as y, useCallback as p, memo as L, useMemo as R, useRef as z, useEffect as F } from "react";
5
+ import { useStore as k } from "@streamlayer/react-polyfills";
6
+ import { FeatureType as I } from "@streamlayer/sdk-web-types";
7
+ import { BetPackContent as O } from "./BetPackContent/index.js";
8
+ import { EmergencyScreen as M } from "./BetPackContent/EmergencyScreen/index.js";
9
+ import { LoaderScreen as j } from "./BetPackContent/LoaderScreen/index.js";
10
+ import { BetPackContainer as E } from "./styles.js";
11
+ import { defaultEventHandler as T } from "./utils.js";
12
+ import { SvgIcon as w } from "../../../ui/icons/index.js";
13
+ import { Container as G, Header as U, HeaderTitle as Y, CloseButton as q, Main as D, Footer as J, SlideSwitchButton as C, IconArrowPrev as K, buttonAvailable as H, IconArrowNext as Q } from "./BetPackOverlay/styles.js";
14
+ const tr = b(
15
+ ({ sdk: m, onEvent: o, close: h, isMobile: a }, g) => {
16
+ const [c, d] = y(), [r, i] = y(), u = p(
17
+ (t) => {
18
+ if (t.type === "slBetPackReady") {
19
+ const { next: l, prev: s, current: P, canNext: B, canPrev: N } = t.payload || {};
20
+ d({ next: l, prev: s }), i((n) => ({
21
+ current: n != null && n.current ? n == null ? void 0 : n.current : P,
22
+ canPrev: n != null && n.current ? n == null ? void 0 : n.canPrev : N,
23
+ canNext: B
24
+ }));
25
+ }
26
+ if (t.type === "slBetPackChangeCard") {
27
+ const { current: l, canNext: s, canPrev: P } = t.payload || {};
28
+ i({ current: l, canNext: s, canPrev: P });
29
+ }
30
+ o == null || o(t);
31
+ },
32
+ [o]
33
+ );
34
+ return /* @__PURE__ */ f(G, { ref: g, children: [
35
+ /* @__PURE__ */ f(U, { children: [
36
+ /* @__PURE__ */ f(Y, { children: [
37
+ /* @__PURE__ */ e(w, { name: "icon-trophy-bet-pack" }),
38
+ "LiveMatch Experience",
39
+ " "
40
+ ] }),
41
+ /* @__PURE__ */ e(q, { onClick: h, children: /* @__PURE__ */ e(w, { name: "icon-close-btn-gray" }) })
39
42
  ] }),
40
- /* @__PURE__ */ r(M, { onClick: u, children: /* @__PURE__ */ r(x, { name: "icon-close-btn-gray" }) })
41
- ] }),
42
- /* @__PURE__ */ r(T, { children: /* @__PURE__ */ r(
43
- q,
44
- {
45
- sdk: l,
46
- onEvent: i,
47
- swipeable: !!c,
48
- centerPadding: c ? "18px" : "30px",
49
- heightOffset: c ? 0 : 48
50
- }
51
- ) }),
52
- !c && /* @__PURE__ */ f(G, { children: [
53
- /* @__PURE__ */ r(v, { onClick: t == null ? void 0 : t.prev, disabled: !(e != null && e.canPrev), children: /* @__PURE__ */ r(U, { name: "iconArrowPrev", className: p((e == null ? void 0 : e.canPrev) && y) }) }),
54
- /* @__PURE__ */ r(v, { onClick: t == null ? void 0 : t.next, disabled: !(e != null && e.canNext), children: /* @__PURE__ */ r(Y, { name: "iconArrowPrev", className: p((e == null ? void 0 : e.canNext) && y) }) })
55
- ] })
56
- ] });
57
- }, q = H(({ sdk: l, swipeable: o = !0, heightOffset: u = 65, onEvent: c = O, centerPadding: t }) => {
58
- const h = P(l.featuresList.getStore()), e = B(() => l.getFeature(b.GAMES), [h]), a = P(l.getUserStore()), i = N(null), [n, s] = g(), d = S(() => {
59
- i.current && s(i.current.clientHeight);
43
+ /* @__PURE__ */ e(D, { children: /* @__PURE__ */ e(
44
+ V,
45
+ {
46
+ sdk: m,
47
+ onEvent: u,
48
+ swipeable: !!a,
49
+ centerPadding: a ? "18px" : "30px",
50
+ heightOffset: a ? 0 : 48
51
+ }
52
+ ) }),
53
+ !a && /* @__PURE__ */ f(J, { children: [
54
+ /* @__PURE__ */ e(C, { onClick: c == null ? void 0 : c.prev, disabled: !(r != null && r.canPrev), children: /* @__PURE__ */ e(K, { name: "iconArrowPrev", className: x((r == null ? void 0 : r.canPrev) && H) }) }),
55
+ /* @__PURE__ */ e(C, { onClick: c == null ? void 0 : c.next, disabled: !(r != null && r.canNext), children: /* @__PURE__ */ e(Q, { name: "iconArrowPrev", className: x((r == null ? void 0 : r.canNext) && H) }) })
56
+ ] })
57
+ ] });
58
+ }
59
+ ), V = L(({ sdk: m, swipeable: o = !0, heightOffset: h = 65, onEvent: a = T, centerPadding: g }) => {
60
+ const c = k(m.featuresList.getStore()), d = R(() => m.getFeature(I.GAMES), [c]), r = k(m.getUserStore()), i = z(null), [u, t] = y(), l = p(() => {
61
+ i.current && t(i.current.clientHeight);
60
62
  }, []);
61
- return A(() => {
62
- const m = C(() => {
63
- i.current && s(i.current.clientHeight);
63
+ return F(() => {
64
+ const s = A(() => {
65
+ i.current && t(i.current.clientHeight);
64
66
  }, 200);
65
- return window.addEventListener("resize", m), () => {
66
- window.removeEventListener("resize", m);
67
+ return window.addEventListener("resize", s), () => {
68
+ window.removeEventListener("resize", s);
67
69
  };
68
- }, []), a.data ? e ? /* @__PURE__ */ r(I, { ref: i, className: p("betPack", o && "isMobile"), children: /* @__PURE__ */ r(
69
- L,
70
+ }, []), r.data ? d ? /* @__PURE__ */ e(E, { ref: i, className: x("betPack", o && "isMobile"), children: /* @__PURE__ */ e(
71
+ O,
70
72
  {
71
- gamification: e,
72
- onEvent: c,
73
+ gamification: d,
74
+ onEvent: a,
73
75
  swipeable: o,
74
- centerPadding: t,
75
- changeHeightOnInit: d,
76
- height: n ? n - u : void 0
76
+ centerPadding: g,
77
+ changeHeightOnInit: l,
78
+ height: u ? u - h : void 0
77
79
  }
78
- ) }) : /* @__PURE__ */ r("div", { children: "no gamification" }) : a.error && !a.loading ? /* @__PURE__ */ r(
79
- z,
80
+ ) }) : /* @__PURE__ */ e("div", { children: "no gamification" }) : r.error && !r.loading ? /* @__PURE__ */ e(
81
+ M,
80
82
  {
81
- actionFn: () => c({ type: "slHardRefresh" }),
83
+ actionFn: () => a({ type: "slHardRefresh" }),
82
84
  description: `You are not authorized to
83
- view this resource.`
85
+ view this resource.`,
86
+ isMobile: o
84
87
  }
85
- ) : /* @__PURE__ */ r(F, {});
88
+ ) : /* @__PURE__ */ e(j, {});
86
89
  });
87
90
  export {
88
- q as BetPack,
89
- ne as BetPackOverlay
91
+ V as BetPack,
92
+ tr as BetPackOverlay
90
93
  };
@@ -1,28 +1,34 @@
1
- import { jsx as n } from "react/jsx-runtime";
2
- import { useState as i, useEffect as c } from "react";
3
- import { useStore as f } from "@streamlayer/react-polyfills";
4
- import { FeatureStatus as p } from "@streamlayer/sdk-web-interfaces";
5
- import { FeatureType as S } from "@streamlayer/sdk-web-types";
6
- import { Points as l } from "../../../ui/gamification/points/index.js";
7
- const a = ({ gamification: e }) => {
8
- const s = e.userSummary.$store, [r, u] = i(0);
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { useState as a, useEffect as c } from "react";
3
+ import { useStore as l } from "@streamlayer/react-polyfills";
4
+ import { FeatureStatus as u, eventBus as n } from "@streamlayer/sdk-web-interfaces";
5
+ import { FeatureType as f } from "@streamlayer/sdk-web-types";
6
+ import { Points as S } from "../../../ui/gamification/points/index.js";
7
+ const y = ({ gamification: e }) => {
8
+ const s = e.userSummary.$store, [t, p] = a(0);
9
9
  return c(() => {
10
- const m = s.subscribe((t) => {
10
+ const i = s.subscribe((r) => {
11
11
  var o;
12
- (o = t == null ? void 0 : t.summary) != null && o.points && u(t.summary.points);
12
+ (o = r == null ? void 0 : r.summary) != null && o.points && p(r.summary.points);
13
13
  });
14
14
  return () => {
15
- m();
15
+ i();
16
16
  };
17
- }, [s]), /* @__PURE__ */ n(l, { points: r, onClick: () => {
18
- e.status.get() === p.Suspended && e.openFeature();
17
+ }, [s]), /* @__PURE__ */ m(S, { points: t, onClick: () => {
18
+ e.status.get() === u.Suspended ? (e.openFeature(), n.emit("app", {
19
+ action: "open",
20
+ payload: {}
21
+ })) : e.status.get() === u.Ready && (e.closeFeature(!1), n.emit("app", {
22
+ action: "close",
23
+ payload: {}
24
+ }));
19
25
  } });
20
- }, h = ({ sdk: e }) => {
21
- if (!f(e.featuresList.getStore()))
26
+ }, k = ({ sdk: e }) => {
27
+ if (!l(e.featuresList.getStore()))
22
28
  return null;
23
- const r = e.getFeature(S.GAMES);
24
- return r ? /* @__PURE__ */ n(a, { gamification: r }) : null;
29
+ const t = e.getFeature(f.GAMES);
30
+ return t ? /* @__PURE__ */ m(y, { gamification: t }) : null;
25
31
  };
26
32
  export {
27
- h as StreamLayerSDKPoints
33
+ k as StreamLayerSDKPoints
28
34
  };