@streamlayer/react-ui 1.22.3 → 1.22.5

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 (47) hide show
  1. package/lib/app/masters/BetPack/BetPackContent/EmergencyScreen/styles.js +1 -1
  2. package/lib/app/masters/BetPack/BetPackContent/EndScreen/index.js +7 -7
  3. package/lib/app/masters/BetPack/BetPackContent/EndScreen/styles.js +1 -1
  4. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.d.ts +0 -1
  5. package/lib/app/masters/BetPack/BetPackContent/ScreenContainer/index.js +3 -3
  6. package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.d.ts +4 -3
  7. package/lib/app/masters/BetPack/BetPackContent/StartScreen/index.js +17 -18
  8. package/lib/app/masters/BetPack/BetPackContent/index.js +335 -87
  9. package/lib/app/masters/BetPack/BetPackContent/styles.d.ts +95 -3
  10. package/lib/app/masters/BetPack/BetPackContent/styles.js +11 -57
  11. package/lib/app/masters/Features/Gamification/index.d.ts +1 -0
  12. package/lib/app/masters/Features/Gamification/index.js +36 -30
  13. package/lib/app/masters/Features/index.d.ts +1 -0
  14. package/lib/app/masters/Features/index.js +13 -12
  15. package/lib/app/masters/Notifications/index.d.ts +1 -0
  16. package/lib/app/masters/Notifications/index.js +97 -94
  17. package/lib/app/masters/Points/index.js +16 -25
  18. package/lib/app/masters/masters.d.ts +1 -0
  19. package/lib/app/masters/masters.js +71 -60
  20. package/lib/app/masters/story/index.d.ts +0 -1
  21. package/lib/app/masters/story/index.js +25 -37
  22. package/lib/app/masters/styles.d.ts +1 -0
  23. package/lib/app/masters/styles.js +16 -15
  24. package/lib/app/masters/useSdkResponsive.js +20 -19
  25. package/lib/app/masters/useSdkScroll.d.ts +1 -1
  26. package/lib/app/masters/useSdkScroll.js +33 -33
  27. package/lib/assets/style.css +1 -1
  28. package/lib/styles-BfnMua4o.js +2841 -0
  29. package/lib/ui/advertisement/overlay/externalAd/index.js +49 -41
  30. package/lib/ui/advertisement/overlay/externalAd/styles.d.ts +11 -2
  31. package/lib/ui/advertisement/overlay/externalAd/styles.js +55 -38
  32. package/lib/ui/gamification/question/notification/prediction-result/index.js +43 -43
  33. package/lib/ui/modal/index.d.ts +1 -0
  34. package/lib/ui/modal/index.js +36 -31
  35. package/lib/ui/questions/insight/index.js +24 -16
  36. package/lib/ui/questions/insight/styles.d.ts +1 -0
  37. package/lib/ui/questions/insight/styles.js +14 -13
  38. package/lib/ui/theme/constants.d.ts +2 -0
  39. package/lib/ui/theme/constants.js +6 -4
  40. package/lib/ui/theme/masters-theme.js +7 -4
  41. package/lib/ui/theme/theme.js +3 -0
  42. package/lib/ui/video-player/index.d.ts +1 -0
  43. package/lib/ui/video-player/index.js +29 -28
  44. package/package.json +16 -17
  45. package/lib/app/masters/BetPack/BetPackContent/constants.d.ts +0 -13
  46. package/lib/app/masters/BetPack/BetPackContent/constants.js +0 -22
  47. package/lib/app/masters/BetPack/typings.d.js +0 -1
@@ -1,90 +1,101 @@
1
- import { jsxs as f, jsx as o } from "react/jsx-runtime";
2
- import { cx as A } from "@linaria/core";
3
- import { SDKContainer as N, SDKScrollContainer as b } from "./styles.js";
4
- import { useSdkScroll as h } from "./useSdkScroll.js";
5
- import { useSdkFeature as x } from "../useSdkFeature.js";
6
- import { useAnalyticsListener as d, newTabLinkListener as v } from "../../hooks/analytics.js";
7
- import { useState as y, useMemo as C, useCallback as P, useRef as p, useEffect as S } from "react";
8
- import { useStore as m } from "@streamlayer/react-polyfills";
9
- import { FeatureType as F } from "@streamlayer/sdk-web-types";
10
- import { resetCss as u } from "../../ui/theme/theme.js";
11
- import { BetPackOverlay as E } from "./BetPack/index.js";
12
- import { ActiveFeature as L, StandaloneFeature as M } from "./Features/index.js";
13
- import { SDKHeader as B } from "./Header/index.js";
14
- import { SDKNotifications as I } from "./Notifications/index.js";
1
+ import { jsxs as p, jsx as n } from "react/jsx-runtime";
2
+ import { cx as d } from "@linaria/core";
3
+ import { SDKContainer as A, mobileSdkContainer as h, SDKScrollContainer as x } from "./styles.js";
4
+ import { useSdkScroll as y } from "./useSdkScroll.js";
5
+ import { useSdkFeature as P } from "../useSdkFeature.js";
6
+ import { useAnalyticsListener as F, newTabLinkListener as N } from "../../hooks/analytics.js";
7
+ import { useState as C, useMemo as E, useCallback as L, useRef as S, useEffect as v } from "react";
8
+ import { useStore as u } from "@streamlayer/react-polyfills";
9
+ import { FeatureType as b } from "@streamlayer/sdk-web-types";
10
+ import { resetCss as f } from "../../ui/theme/theme.js";
11
+ import { BetPackOverlay as M } from "./BetPack/index.js";
12
+ import { ActiveFeature as B, StandaloneFeature as D } from "./Features/index.js";
13
+ import { SDKHeader as I } from "./Header/index.js";
14
+ import { SDKNotifications as K } from "./Notifications/index.js";
15
15
  import { MastersContext as g } from "./useMastersContext.js";
16
- import { useSdkResponsive as D } from "./useSdkResponsive.js";
17
- import { StreamLayerMastersThemeProvider as re } from "../../ui/theme/masters.js";
18
- const K = ({ sdk: e, className: t }) => {
19
- const [, n] = x(e);
20
- return /* @__PURE__ */ o(L, { className: t, feature: n, sdk: e });
21
- }, w = ({ sdk: e, className: t, appNode: n, responsiveStore: c }) => {
22
- const l = m(e.featuresList.getStore());
23
- return l ? Array.from(l, (s) => {
24
- const a = e.getFeature(s);
25
- return a ? /* @__PURE__ */ o(
26
- M,
16
+ import { useSdkResponsive as w } from "./useSdkResponsive.js";
17
+ import { StreamLayerMastersThemeProvider as ne } from "../../ui/theme/masters.js";
18
+ const G = ({ sdk: e, className: t }) => {
19
+ const [, r] = P(e);
20
+ return /* @__PURE__ */ n(B, { className: t, feature: r, sdk: e });
21
+ }, O = ({ sdk: e, className: t, appNode: r, responsiveStore: l, useContainer: m }) => {
22
+ const c = u(e.featuresList.getStore());
23
+ return c ? Array.from(c, (a) => {
24
+ const s = e.getFeature(a);
25
+ return s ? /* @__PURE__ */ n(
26
+ D,
27
27
  {
28
- responsiveStore: c,
28
+ useContainer: m,
29
+ responsiveStore: l,
29
30
  className: t,
30
- appNode: n,
31
- feature: a,
31
+ appNode: r,
32
+ feature: s,
32
33
  sdk: e
33
34
  },
34
- s
35
+ a
35
36
  ) : null;
36
37
  }) : null;
37
- }, G = (e) => {
38
- const t = p(null);
39
- return d(t, { enabled: !0, event: "click", listener: v }), /* @__PURE__ */ o(E, { ref: t, ...e });
40
- }, O = ({ sdk: e }) => {
41
- const t = p(null), n = m(e.status), c = m(e.sdkStore.slStreamId), l = p(null), [s] = D(t), [a, i] = h(t, s), r = n === "ready" && !!c.data;
42
- return S(() => {
38
+ }, R = (e) => {
39
+ const t = S(null);
40
+ return F(t, { enabled: !0, event: "click", listener: N }), /* @__PURE__ */ n(M, { ref: t, ...e });
41
+ }, j = ({ sdk: e, useContainer: t }) => {
42
+ const r = S(null), l = u(e.status), m = u(e.sdkStore.slStreamId), c = S(null), [a] = w(r), [s, i] = y(r, a, t), o = l === "ready" && !!m.data;
43
+ return v(() => {
43
44
  window.requestAnimationFrame(() => {
44
45
  e.initializeApp().then(() => {
45
- e.openFeature(F.GAMES);
46
+ e.openFeature(b.GAMES);
46
47
  });
47
48
  });
48
- }, [e]), d(t, { enabled: !0, event: "click", listener: v }), S(() => {
49
+ }, [e]), F(r, { enabled: !0, event: "click", listener: N }), v(() => {
49
50
  import("./Features/Gamification/gamification-feature.js");
50
- }, []), /* @__PURE__ */ f(N, { ref: t, children: [
51
- /* @__PURE__ */ o(B, { className: A(u), ref: l }),
52
- /* @__PURE__ */ f(b, { className: "sl-hide-on-modal", ref: a, children: [
53
- r && /* @__PURE__ */ o(
54
- I,
51
+ }, []), /* @__PURE__ */ p(A, { className: d("SDKContainer", !t && h), ref: r, children: [
52
+ /* @__PURE__ */ n(I, { className: d(f), ref: c }),
53
+ /* @__PURE__ */ p(x, { className: "sl-hide-on-modal", ref: s, children: [
54
+ o && /* @__PURE__ */ n(
55
+ K,
55
56
  {
56
57
  sdk: e,
57
- scrollNode: a,
58
- headerNode: l,
59
- appNode: t,
58
+ scrollNode: s,
59
+ headerNode: c,
60
+ appNode: r,
60
61
  scrollStore: i,
61
- responsiveStore: s
62
+ responsiveStore: a,
63
+ useContainer: t
62
64
  }
63
65
  ),
64
- r && /* @__PURE__ */ o(K, { className: u, sdk: e }),
65
- r && /* @__PURE__ */ o(w, { responsiveStore: s, appNode: t, className: u, sdk: e })
66
+ o && /* @__PURE__ */ n(G, { className: f, sdk: e }),
67
+ o && /* @__PURE__ */ n(
68
+ O,
69
+ {
70
+ responsiveStore: a,
71
+ appNode: r,
72
+ className: f,
73
+ sdk: e,
74
+ useContainer: t
75
+ }
76
+ )
66
77
  ] })
67
78
  ] });
68
- }, k = ({ sdk: e, betPack: t }) => {
69
- const [n, c] = y(t), s = !!m(e.userId()), a = C(() => ({ sdk: e }), [e]), i = P(() => {
70
- c(!1);
71
- const r = e == null ? void 0 : e.getFeature(F.GAMES);
72
- r == null || r.closeQuestion();
79
+ }, te = ({ sdk: e, betPack: t, useContainer: r }) => {
80
+ const [l, m] = C(t), a = !!u(e.userId()), s = E(() => ({ sdk: e }), [e]), i = L(() => {
81
+ m(!1);
82
+ const o = e == null ? void 0 : e.getFeature(b.GAMES);
83
+ o == null || o.closeQuestion();
73
84
  }, [e]);
74
- return /* @__PURE__ */ f(g.Provider, { value: a, children: [
75
- n && s && /* @__PURE__ */ o(
76
- G,
85
+ return /* @__PURE__ */ p(g.Provider, { value: s, children: [
86
+ l && a && /* @__PURE__ */ n(
87
+ R,
77
88
  {
78
89
  sdk: e,
79
- onEvent: ({ type: r }) => r === "slOpenGameCenter" ? i() : () => {
90
+ onEvent: ({ type: o }) => o === "slOpenGameCenter" ? i() : () => {
80
91
  },
81
92
  close: () => i()
82
93
  }
83
94
  ),
84
- !n && /* @__PURE__ */ o(O, { sdk: e })
95
+ !l && /* @__PURE__ */ n(j, { sdk: e, useContainer: r })
85
96
  ] });
86
97
  };
87
98
  export {
88
- k as MastersApp,
89
- re as StreamLayerMastersThemeProvider
99
+ te as MastersApp,
100
+ ne as StreamLayerMastersThemeProvider
90
101
  };
@@ -1,4 +1,3 @@
1
1
  export declare const MastersStory: React.FC<{
2
- settings?: boolean;
3
2
  betPack?: boolean;
4
3
  }>;
@@ -1,52 +1,40 @@
1
- import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
- import { MastersStreamLayerProvider as d, useStreamLayer as c } from "@streamlayer/react/masters";
3
- import { MastersApp as s } from "../masters.js";
4
- import { StreamLayerMastersThemeProvider as p } from "../../../ui/theme/masters.js";
5
- import { useStreamLayerDebug as m, StreamLayerDebug as h } from "../../../utils/debug/index.js";
6
- import { MastersLogin as u, MobileHeader as y, HostAppContent as i, Body as k, Video as v, Container as L, AppContainer as T, BackToTop as f, BackToTopLink as C } from "./components.js";
7
- const S = ({ betPack: n }) => {
8
- const o = c();
9
- return o ? /* @__PURE__ */ e(p, { style: { height: "100%" }, children: /* @__PURE__ */ e(s, { sdk: o, betPack: n }) }) : null;
10
- }, a = () => {
1
+ import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
+ import { MastersStreamLayerProvider as d, useStreamLayer as i } from "@streamlayer/react/masters";
3
+ import { MastersApp as l } from "../masters.js";
4
+ import { StreamLayerMastersThemeProvider as a } from "../../../ui/theme/masters.js";
5
+ import { useStreamLayerDebug as c } from "../../../utils/debug/index.js";
6
+ import { MobileHeader as s, HostAppContent as t, Body as p, Video as h, Container as m, AppContainer as u, BackToTop as y, BackToTopLink as k } from "./components.js";
7
+ const T = ({ betPack: o }) => {
8
+ const r = i();
9
+ return r ? /* @__PURE__ */ e(a, { style: { height: "100%" }, children: /* @__PURE__ */ e(l, { sdk: r, betPack: o, useContainer: !0 }) }) : null;
10
+ }, v = () => {
11
11
  console.log("deep link handled cb");
12
- }, l = () => {
12
+ }, f = () => {
13
13
  console.log("video player handled cb");
14
- }, K = ({ settings: n, betPack: o }) => {
15
- const r = m();
16
- return n ? /* @__PURE__ */ t(
14
+ }, M = ({ betPack: o }) => {
15
+ const r = c();
16
+ return /* @__PURE__ */ n(
17
17
  d,
18
18
  {
19
19
  sdkKey: r.sdkKey,
20
20
  production: r.env === "production",
21
- onDeepLinkHandled: a,
22
- videoPlayerController: l,
23
- children: [
24
- /* @__PURE__ */ e(u, {}),
25
- /* @__PURE__ */ e(h, { ...r, standalone: !0, hideAuth: !0 })
26
- ]
27
- }
28
- ) : /* @__PURE__ */ t(
29
- d,
30
- {
31
- sdkKey: r.sdkKey,
32
- production: r.env === "production",
33
- onDeepLinkHandled: a,
34
- videoPlayerController: l,
21
+ onDeepLinkHandled: v,
22
+ videoPlayerController: f,
35
23
  event: r.event,
36
24
  children: [
37
- /* @__PURE__ */ e(y, { children: "header" }),
38
- /* @__PURE__ */ e(i, { children: "...host app content..." }),
39
- /* @__PURE__ */ t(k, { children: [
40
- /* @__PURE__ */ e(v, {}),
41
- /* @__PURE__ */ e(L, { children: /* @__PURE__ */ e(T, { className: "StreamLayerSDK", children: /* @__PURE__ */ e(S, { betPack: o }) }) })
25
+ /* @__PURE__ */ e(s, { children: "header" }),
26
+ /* @__PURE__ */ e(t, { children: "...host app content..." }),
27
+ /* @__PURE__ */ n(p, { children: [
28
+ /* @__PURE__ */ e(h, {}),
29
+ /* @__PURE__ */ e(m, { children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(u, { className: "StreamLayerSDK", children: /* @__PURE__ */ e(T, { betPack: o }) }) }) })
42
30
  ] }),
43
- /* @__PURE__ */ e(i, { children: "...host app content..." }),
44
- /* @__PURE__ */ e(f, { onClick: () => document.documentElement.scrollTop = 0, children: "BackToTop" }),
45
- /* @__PURE__ */ e(C, { href: "#", children: "BackToTop Link" })
31
+ /* @__PURE__ */ e(t, { style: { height: 3e3 }, children: "...host app content..." }),
32
+ /* @__PURE__ */ e(y, { onClick: () => document.documentElement.scrollTop = 0, children: "BackToTop" }),
33
+ /* @__PURE__ */ e(k, { href: "#", children: "BackToTop Link" })
46
34
  ]
47
35
  }
48
36
  );
49
37
  };
50
38
  export {
51
- K as MastersStory
39
+ M as MastersStory
52
40
  };
@@ -1,4 +1,5 @@
1
1
  export declare const SDKContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
2
+ export declare const mobileSdkContainer: import('@linaria/core').LinariaClassName;
2
3
  export declare const SDKScrollContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
3
4
  export declare const SDKContentContainer: import('@linaria/react').StyledComponent<import('react').ClassAttributes<HTMLDivElement> & import('react').HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
4
5
  export declare const SDKWhiteContainer: {
@@ -1,34 +1,35 @@
1
1
  import { styled as s } from "@linaria/react";
2
- const t = /* @__PURE__ */ s("div")({
2
+ const o = /* @__PURE__ */ s("div")({
3
3
  name: "SDKContainer",
4
4
  class: "s8zgqze",
5
5
  propsAsIs: !1
6
- }), o = /* @__PURE__ */ s("div")({
6
+ }), t = "m6t897k", r = /* @__PURE__ */ s("div")({
7
7
  name: "SDKScrollContainer",
8
- class: "s6t897k",
8
+ class: "sw7pkvp",
9
9
  propsAsIs: !1
10
10
  }), n = /* @__PURE__ */ s("div")({
11
11
  name: "SDKContentContainer",
12
- class: "sw7pkvp",
12
+ class: "s14gkn7u",
13
13
  propsAsIs: !1
14
- }), e = () => n, r = /* @__PURE__ */ s(e())({
14
+ }), e = () => n, i = /* @__PURE__ */ s(e())({
15
15
  name: "SDKWhiteContainer",
16
- class: "s14gkn7u",
16
+ class: "s1yxstm9",
17
17
  propsAsIs: !0
18
- }), i = /* @__PURE__ */ s("div")({
18
+ }), p = /* @__PURE__ */ s("div")({
19
19
  name: "TabsContainer",
20
- class: "t1yxstm9",
20
+ class: "tdpty1s",
21
21
  propsAsIs: !1
22
- }), p = /* @__PURE__ */ s("div")({
22
+ }), l = /* @__PURE__ */ s("div")({
23
23
  name: "UserSummaryContainer",
24
- class: "udpty1s",
24
+ class: "u136a59y",
25
25
  propsAsIs: !1
26
26
  });
27
27
  export {
28
- t as SDKContainer,
28
+ o as SDKContainer,
29
29
  n as SDKContentContainer,
30
- o as SDKScrollContainer,
31
- r as SDKWhiteContainer,
32
- i as TabsContainer,
33
- p as UserSummaryContainer
30
+ r as SDKScrollContainer,
31
+ i as SDKWhiteContainer,
32
+ p as TabsContainer,
33
+ l as UserSummaryContainer,
34
+ t as mobileSdkContainer
34
35
  };
@@ -1,13 +1,13 @@
1
1
  import c from "lodash.throttle";
2
2
  import { useState as m, useEffect as u } from "react";
3
3
  import { BREAKPOINTS as r } from "../../ui/theme/constants.js";
4
- import { m as l } from "../../index-DSi8Qgfs.js";
4
+ import { m as p } from "../../index-DSi8Qgfs.js";
5
5
  const d = Object.keys(r), i = () => {
6
- const n = window.innerWidth;
6
+ const t = window.innerWidth;
7
7
  let e = "sm";
8
- for (let t = d.length - 1; t > 0; t--) {
9
- const s = d[t];
10
- if (!(n < r[s]) && n >= r[s]) {
8
+ for (let n = d.length - 1; n > 0; n--) {
9
+ const s = d[n];
10
+ if (!(t < r[s]) && t >= r[s]) {
11
11
  e = s;
12
12
  break;
13
13
  }
@@ -16,30 +16,31 @@ const d = Object.keys(r), i = () => {
16
16
  name: e,
17
17
  size: r[e]
18
18
  };
19
- }, w = (n) => {
20
- var e;
21
- return (((e = n.current) == null ? void 0 : e.getBoundingClientRect().y) || 0) < -68;
22
- }, k = (n) => n >= r.lg, v = (n) => {
19
+ }, w = (t) => {
20
+ var n;
21
+ const e = (n = t.current) == null ? void 0 : n.getBoundingClientRect();
22
+ return e ? e.y > -e.height && e.y < window.innerHeight : !1;
23
+ }, k = (t) => t >= r.lg, h = (t) => {
23
24
  const [e] = m(() => {
24
- const t = i();
25
- return l({
25
+ const n = i();
26
+ return p({
26
27
  screen: i(),
27
- sdkInView: w(n),
28
- sdkInDesktopView: k(t.size)
28
+ sdkInView: w(t),
29
+ sdkInDesktopView: k(n.size)
29
30
  });
30
31
  });
31
32
  return u(() => {
32
- const t = c(() => {
33
- e.setKey("sdkInView", w(n));
33
+ const n = c(() => {
34
+ e.setKey("sdkInView", w(t));
34
35
  }, 200), s = c(() => {
35
36
  const o = i();
36
37
  e.setKey("screen", o), e.setKey("sdkInDesktopView", k(o.size));
37
38
  }, 200);
38
- return window.addEventListener("scroll", t), window.addEventListener("resize", s), () => {
39
- window.removeEventListener("scroll", t), window.removeEventListener("resize", s);
39
+ return n(), s(), window.addEventListener("scroll", n), window.addEventListener("resize", s), () => {
40
+ window.removeEventListener("scroll", n), window.removeEventListener("resize", s);
40
41
  };
41
- }, [e, n]), [e];
42
+ }, [e, t]), [e];
42
43
  };
43
44
  export {
44
- v as useSdkResponsive
45
+ h as useSdkResponsive
45
46
  };
@@ -8,5 +8,5 @@ type ScrollData = {
8
8
  };
9
9
  export type ScrollStore = MapStore<ScrollData>;
10
10
  export declare const scrollIntoAppView: (appNode: AppNodeRef, screenSize: number, options?: ScrollIntoViewOptions) => void;
11
- export declare const useSdkScroll: (appNode: AppNodeRef, responsiveStore: ResponsiveStore) => [ScrollNodeRef, ScrollStore];
11
+ export declare const useSdkScroll: (appNode: AppNodeRef, responsiveStore: ResponsiveStore, useContainer?: boolean) => [ScrollNodeRef, ScrollStore];
12
12
  export {};
@@ -1,50 +1,50 @@
1
- import S from "lodash.throttle";
2
- import { useRef as m, useState as g, useEffect as h } from "react";
3
- import { useStore as b } from "@streamlayer/react-polyfills";
4
- import { BREAKPOINTS as c } from "../../ui/theme/constants.js";
5
- import { m as v } from "../../index-DSi8Qgfs.js";
6
- const D = (o, e, n) => {
7
- const t = e >= c.lg && e < c.xl ? 75 : 52;
8
- o.current && window.scrollTo({
9
- top: o.current.offsetTop - t,
10
- ...n
1
+ import g from "lodash.throttle";
2
+ import { useRef as m, useState as h, useEffect as b } from "react";
3
+ import { useStore as v } from "@streamlayer/react-polyfills";
4
+ import { BREAKPOINTS as d } from "../../ui/theme/constants.js";
5
+ import { m as E } from "../../index-DSi8Qgfs.js";
6
+ const y = (e, i, o) => {
7
+ var t;
8
+ (t = e.current) == null || t.scrollTo({
9
+ top: 0,
10
+ ...o
11
11
  });
12
- }, T = 15, L = (o, e) => {
13
- const n = m(null), t = m(0), [s] = g(
14
- v({
12
+ }, P = 15, z = (e, i, o) => {
13
+ const t = m(null), c = m(0), [s] = h(
14
+ E({
15
15
  scrollPosition: 0,
16
- tabsShown: !0,
16
+ tabsShown: !1,
17
17
  scrollDirection: "forward"
18
18
  })
19
- ), i = b(e);
20
- return h(() => {
21
- const l = window.innerWidth < c.lg ? window : n.current;
22
- if (!l)
19
+ ), a = v(i);
20
+ return b(() => {
21
+ const n = window.innerWidth < d.lg && !o ? window : t.current;
22
+ if (!n)
23
23
  return () => {
24
24
  };
25
- const f = S((d) => {
26
- var a;
27
- const u = d.target;
28
- if (!u)
25
+ const l = g((p) => {
26
+ var u;
27
+ const f = p.target;
28
+ if (!f)
29
29
  return;
30
30
  let r = 0;
31
- i.screen.size < c.lg ? r = ((a = o.current) == null ? void 0 : a.getBoundingClientRect().y) || 0 : r = u.scrollTop;
32
- const w = t.current - r;
33
- if (T > Math.abs(w))
31
+ a.screen.size < d.lg && !o ? r = ((u = e.current) == null ? void 0 : u.getBoundingClientRect().y) || 0 : r = f.scrollTop;
32
+ const w = c.current - r;
33
+ if (P > Math.abs(w))
34
34
  return;
35
- const p = t.current < r ? "forward" : "backward";
36
- t.current = r, s.set({
35
+ const S = c.current < r ? "forward" : "backward";
36
+ c.current = r, s.set({
37
37
  scrollPosition: Math.round(r),
38
- scrollDirection: p,
38
+ scrollDirection: S,
39
39
  tabsShown: s.get().tabsShown
40
40
  });
41
41
  }, 200);
42
- return l.addEventListener("scroll", f), () => {
43
- l.removeEventListener("scroll", f);
42
+ return l({ target: n }), n.addEventListener("scroll", l), () => {
43
+ n.removeEventListener("scroll", l);
44
44
  };
45
- }, [s, o, i.screen]), [n, s];
45
+ }, [s, e, a.screen, o]), [t, s];
46
46
  };
47
47
  export {
48
- D as scrollIntoAppView,
49
- L as useSdkScroll
48
+ y as scrollIntoAppView,
49
+ z as useSdkScroll
50
50
  };