@streamlayer/react 1.23.2 → 1.24.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.
- package/lib/app/masters.d.ts +0 -1
- package/lib/cjs/Question.js +1 -1
- package/lib/cjs/advertisement.js +203 -28
- package/lib/cjs/analytics.js +1 -1
- package/lib/cjs/auth.js +1 -1
- package/lib/cjs/bet-pack.js +1 -1
- package/lib/cjs/feature.js +1 -1
- package/lib/cjs/gamification-feature.js +1 -1
- package/lib/cjs/gamification-feature2.js +1 -1
- package/lib/cjs/hooks-n9ax4LRT.js +1 -0
- package/lib/cjs/index-ByUNFvMk.js +5 -0
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index10.js +1 -1
- package/lib/cjs/index11.js +1 -3
- package/lib/cjs/index12.js +1 -1
- package/lib/cjs/index13.js +1 -3
- package/lib/cjs/index14.js +4 -1
- package/lib/cjs/index15.js +1 -1
- package/lib/cjs/index16.js +5 -3
- package/lib/cjs/index2.js +1 -1
- package/lib/cjs/index3.js +1 -1
- package/lib/cjs/index4.js +5 -3
- package/lib/cjs/index5.js +1 -1
- package/lib/cjs/index6.js +1 -1
- package/lib/cjs/index7.js +1 -1
- package/lib/cjs/index8.js +1 -1
- package/lib/cjs/index9.js +7 -1
- package/lib/cjs/insight.js +1 -1
- package/lib/cjs/masters.js +1 -1
- package/lib/cjs/masters2.js +8 -1
- package/lib/cjs/notification.js +1 -1
- package/lib/cjs/pause-ad.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/polymarket.js +14 -9
- package/lib/cjs/sl-types.js +1 -1
- package/lib/cjs/storage.js +1 -1
- package/lib/cjs/theme.js +1 -1
- package/lib/cjs/useStreamLayerApp.js +1 -1
- package/lib/cjs/useStreamLayerApp2.js +17 -3
- package/lib/cjs/utils.js +47 -1
- package/lib/classic/app/masters.d.ts +0 -1
- package/lib/classic/cjs/Question.js +1 -1
- package/lib/classic/cjs/advertisement.js +203 -28
- package/lib/classic/cjs/analytics.js +1 -1
- package/lib/classic/cjs/auth.js +1 -1
- package/lib/classic/cjs/bet-pack.js +5 -3
- package/lib/classic/cjs/feature.js +1 -1
- package/lib/classic/cjs/gamification-feature.js +1 -1
- package/lib/classic/cjs/hooks-n9ax4LRT.js +1 -0
- package/lib/classic/cjs/index-ByUNFvMk.js +5 -0
- package/lib/classic/cjs/index.js +1 -1
- package/lib/classic/cjs/index10.js +1 -1
- package/lib/classic/cjs/index11.js +1 -1
- package/lib/classic/cjs/index12.js +1 -1
- package/lib/classic/cjs/index13.js +4 -3
- package/lib/classic/cjs/index2.js +5 -3
- package/lib/classic/cjs/index3.js +1 -1
- package/lib/classic/cjs/index4.js +1 -1
- package/lib/classic/cjs/index5.js +1 -1
- package/lib/classic/cjs/index6.js +1 -1
- package/lib/classic/cjs/index7.js +7 -1
- package/lib/classic/cjs/index8.js +1 -1
- package/lib/classic/cjs/index9.js +1 -3
- package/lib/classic/cjs/insight.js +1 -1
- package/lib/classic/cjs/notification.js +1 -1
- package/lib/classic/cjs/notification2.js +1 -1
- package/lib/classic/cjs/pause-ad.js +1 -1
- package/lib/classic/cjs/points.js +1 -1
- package/lib/classic/cjs/polymarket.js +14 -9
- package/lib/classic/cjs/sl-types.js +1 -1
- package/lib/classic/cjs/useStreamLayerApp.js +1 -1
- package/lib/classic/cjs/useStreamLayerApp2.js +17 -3
- package/lib/classic/cjs/utils.js +47 -1
- package/lib/classic/es/Question.js +258 -275
- package/lib/classic/es/advertisement.js +22128 -38694
- package/lib/classic/es/analytics.js +55 -57
- package/lib/classic/es/auth.js +8 -14
- package/lib/classic/es/bet-pack.js +2413 -2455
- package/lib/classic/es/feature.js +46 -95
- package/lib/classic/es/gamification-feature.js +2 -2
- package/lib/classic/es/hooks-n9ax4LRT.js +97 -0
- package/lib/classic/es/index-ByUNFvMk.js +3775 -0
- package/lib/classic/es/index.js +13 -16
- package/lib/classic/es/index10.js +2587 -83
- package/lib/classic/es/index11.js +305 -3087
- package/lib/classic/es/index12.js +121 -124
- package/lib/classic/es/index13.js +559 -589
- package/lib/classic/es/index2.js +1755 -2114
- package/lib/classic/es/index3.js +13 -13
- package/lib/classic/es/index4.js +4 -283
- package/lib/classic/es/index5.js +5 -5
- package/lib/classic/es/index6.js +285 -10
- package/lib/classic/es/index7.js +179 -6
- package/lib/classic/es/index8.js +5 -10
- package/lib/classic/es/index9.js +8 -318
- package/lib/classic/es/insight.js +54 -61
- package/lib/classic/es/notification.js +5 -5
- package/lib/classic/es/notification2.js +730 -787
- package/lib/classic/es/pause-ad.js +168 -191
- package/lib/classic/es/points.js +47 -55
- package/lib/classic/es/polymarket.js +4058 -4289
- package/lib/classic/es/sl-types.js +128 -298
- package/lib/classic/es/useStreamLayerApp.js +2 -2
- package/lib/classic/es/useStreamLayerApp2.js +9090 -11121
- package/lib/classic/es/utils.js +28 -28
- package/lib/classic/index.d.ts +0 -1
- package/lib/classic/source.css +110 -0
- package/lib/dist/cjs/gamification-feature.js +1 -1
- package/lib/dist/cjs/index-ByUNFvMk.js +5 -0
- package/lib/dist/cjs/index.js +1 -1
- package/lib/dist/cjs/masters.js +69 -3
- package/lib/dist/es/gamification-feature.js +2 -2
- package/lib/dist/es/index-ByUNFvMk.js +3775 -0
- package/lib/dist/es/index.js +7 -10
- package/lib/dist/es/masters.js +16944 -19645
- package/lib/dist/index.d.ts +7 -17
- package/lib/dist/source.css +64 -0
- package/lib/es/Question.js +101 -105
- package/lib/es/advertisement.js +22128 -38694
- package/lib/es/analytics.js +55 -57
- package/lib/es/auth.js +8 -14
- package/lib/es/bet-pack.js +18 -29
- package/lib/es/feature.js +46 -95
- package/lib/es/gamification-feature.js +2 -2
- package/lib/es/gamification-feature2.js +2 -2
- package/lib/es/hooks-n9ax4LRT.js +97 -0
- package/lib/es/index-ByUNFvMk.js +3775 -0
- package/lib/es/index.js +13 -17
- package/lib/es/index10.js +8 -274
- package/lib/es/index11.js +172 -837
- package/lib/es/index12.js +2587 -183
- package/lib/es/index13.js +258 -314
- package/lib/es/index14.js +813 -81
- package/lib/es/index15.js +305 -3087
- package/lib/es/index16.js +803 -1005
- package/lib/es/index2.js +980 -1133
- package/lib/es/index3.js +4 -3
- package/lib/es/index4.js +2401 -2431
- package/lib/es/index5.js +13 -13
- package/lib/es/index6.js +5 -285
- package/lib/es/index7.js +7 -10
- package/lib/es/index8.js +283 -5
- package/lib/es/index9.js +180 -10
- package/lib/es/insight.js +54 -61
- package/lib/es/masters.js +5 -7
- package/lib/es/masters2.js +538 -708
- package/lib/es/notification.js +663 -719
- package/lib/es/pause-ad.js +168 -191
- package/lib/es/points.js +48 -56
- package/lib/es/polymarket.js +4058 -4289
- package/lib/es/sl-types.js +128 -317
- package/lib/es/storage.js +74 -75
- package/lib/es/theme.js +3 -190
- package/lib/es/useStreamLayerApp.js +2 -2
- package/lib/es/useStreamLayerApp2.js +9090 -11121
- package/lib/es/utils.js +28 -28
- package/lib/index.d.ts +0 -1
- package/lib/source.css +120 -0
- package/lib/style.css +1 -1
- package/package.json +21 -24
- package/lib/cjs/hooks-WfHlJH12.js +0 -1
- package/lib/cjs/index-eShKGO10.js +0 -1
- package/lib/cjs/style.css +0 -1
- package/lib/classic/cjs/hooks-WfHlJH12.js +0 -1
- package/lib/classic/cjs/index-eShKGO10.js +0 -1
- package/lib/classic/cjs/style.css +0 -1
- package/lib/classic/es/hooks-WfHlJH12.js +0 -98
- package/lib/classic/es/index-eShKGO10.js +0 -3757
- package/lib/classic/style.css +0 -1
- package/lib/dist/cjs/index-eShKGO10.js +0 -1
- package/lib/dist/es/index-eShKGO10.js +0 -3757
- package/lib/dist/style.css +0 -1
- package/lib/es/hooks-WfHlJH12.js +0 -98
- package/lib/es/index-eShKGO10.js +0 -3757
package/lib/es/pause-ad.js
CHANGED
|
@@ -1,280 +1,257 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { h } from "./
|
|
3
|
-
import { s as
|
|
4
|
-
import { d as
|
|
5
|
-
import { useState, useRef, useCallback, useEffect, Component } from "react";
|
|
6
|
-
import { e as
|
|
7
|
-
import {
|
|
8
|
-
const
|
|
1
|
+
import { jsx as r, jsxs as D } from "react/jsx-runtime";
|
|
2
|
+
import { h as M } from "./index7.js";
|
|
3
|
+
import { s as d, u as q, c as V } from "./sl-types.js";
|
|
4
|
+
import { d as j } from "./index12.js";
|
|
5
|
+
import { useState as B, useRef as x, useCallback as _, useEffect as c, Component as K } from "react";
|
|
6
|
+
import { e as T } from "./index3.js";
|
|
7
|
+
import { Y as z, _ as G } from "./hooks-n9ax4LRT.js";
|
|
8
|
+
const O = /* @__PURE__ */ d("div")({
|
|
9
9
|
name: "PauseAdOverlay",
|
|
10
10
|
class: "pw9gih8",
|
|
11
|
-
propsAsIs:
|
|
12
|
-
}),
|
|
11
|
+
propsAsIs: !1
|
|
12
|
+
}), W = /* @__PURE__ */ d("div")({
|
|
13
13
|
name: "PauseAdContent",
|
|
14
14
|
class: "p8lpomy",
|
|
15
|
-
propsAsIs:
|
|
16
|
-
}),
|
|
15
|
+
propsAsIs: !1
|
|
16
|
+
}), X = /* @__PURE__ */ d("div")({
|
|
17
17
|
name: "PauseAdTopLeft",
|
|
18
18
|
class: "pv7u167",
|
|
19
|
-
propsAsIs:
|
|
20
|
-
}),
|
|
19
|
+
propsAsIs: !1
|
|
20
|
+
}), Y = /* @__PURE__ */ d("h2")({
|
|
21
21
|
name: "PauseAdTitle",
|
|
22
22
|
class: "p1kh2yb0",
|
|
23
|
-
propsAsIs:
|
|
24
|
-
}),
|
|
23
|
+
propsAsIs: !1
|
|
24
|
+
}), H = /* @__PURE__ */ d("p")({
|
|
25
25
|
name: "PauseAdCaption",
|
|
26
26
|
class: "pl8f94x",
|
|
27
|
-
propsAsIs:
|
|
28
|
-
}),
|
|
27
|
+
propsAsIs: !1
|
|
28
|
+
}), J = /* @__PURE__ */ d("div")({
|
|
29
29
|
name: "PauseAdBottomLeft",
|
|
30
30
|
class: "p1m6zmrt",
|
|
31
|
-
propsAsIs:
|
|
32
|
-
}),
|
|
31
|
+
propsAsIs: !1
|
|
32
|
+
}), Q = /* @__PURE__ */ d("button")({
|
|
33
33
|
name: "PauseAdPlayButton",
|
|
34
34
|
class: "pm3vwfa",
|
|
35
|
-
propsAsIs:
|
|
36
|
-
}),
|
|
35
|
+
propsAsIs: !1
|
|
36
|
+
}), Z = /* @__PURE__ */ d("div")({
|
|
37
37
|
name: "PauseAdSidebarGradient",
|
|
38
38
|
class: "p1tibuhw",
|
|
39
|
-
propsAsIs:
|
|
40
|
-
}),
|
|
39
|
+
propsAsIs: !1
|
|
40
|
+
}), $ = /* @__PURE__ */ d("div")({
|
|
41
41
|
name: "PauseAdSidebar",
|
|
42
42
|
class: "ptqqrqd",
|
|
43
|
-
propsAsIs:
|
|
44
|
-
}),
|
|
43
|
+
propsAsIs: !1
|
|
44
|
+
}), ee = /* @__PURE__ */ d("span")({
|
|
45
45
|
name: "PauseAdTitleDescription",
|
|
46
46
|
class: "p14estxv",
|
|
47
|
-
propsAsIs:
|
|
48
|
-
}),
|
|
47
|
+
propsAsIs: !1
|
|
48
|
+
}), N = /* @__PURE__ */ d("img")({
|
|
49
49
|
name: "ExternalAdContainer",
|
|
50
50
|
class: "e1dpvfl1",
|
|
51
|
-
propsAsIs:
|
|
52
|
-
})
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
r2.imageSrc && r2.id && eventBus.emit("exposedPauseAd", {
|
|
51
|
+
propsAsIs: !1
|
|
52
|
+
}), re = ({
|
|
53
|
+
vastUrl: i,
|
|
54
|
+
isDesktop: a,
|
|
55
|
+
content: e
|
|
56
|
+
}) => (c(() => {
|
|
57
|
+
e.imageSrc && e.id && T.emit("exposedPauseAd", {
|
|
59
58
|
action: "rendered",
|
|
60
59
|
payload: {
|
|
61
|
-
id:
|
|
62
|
-
parentId:
|
|
60
|
+
id: e.id,
|
|
61
|
+
parentId: e.parentId
|
|
63
62
|
}
|
|
64
63
|
});
|
|
65
|
-
}, [
|
|
64
|
+
}, [e, i]), e?.imageSrc ? !e.adUrl || !a ? /* @__PURE__ */ r(N, { src: e.imageSrc }) : /* @__PURE__ */ r(
|
|
66
65
|
"a",
|
|
67
66
|
{
|
|
68
67
|
onClick: () => {
|
|
69
|
-
|
|
68
|
+
T.emit("exposedPauseAd", {
|
|
70
69
|
action: "navigated",
|
|
71
70
|
payload: {
|
|
72
|
-
id:
|
|
73
|
-
parentId:
|
|
71
|
+
id: e.id,
|
|
72
|
+
parentId: e.parentId
|
|
74
73
|
}
|
|
75
74
|
});
|
|
76
75
|
},
|
|
77
|
-
href:
|
|
76
|
+
href: e.adUrl,
|
|
78
77
|
target: "_blank",
|
|
79
78
|
rel: "noopener noreferrer",
|
|
80
|
-
children: /* @__PURE__ */
|
|
79
|
+
children: /* @__PURE__ */ r(N, { src: e.imageSrc })
|
|
81
80
|
}
|
|
82
|
-
) : null),
|
|
83
|
-
const
|
|
81
|
+
) : null), te = ({ isClosing: i, content: a, externalPauseAdStore: e, title: y, caption: f, onPlay: l, onClose: u, vastUrl: t, options: h, isDesktop: n }) => {
|
|
82
|
+
const b = h?.showPauseButton ?? !0, { ref: p, focusSelf: I } = j.useFocusable({
|
|
84
83
|
focusKey: "sl-pause-ad-play",
|
|
85
|
-
onEnterRelease:
|
|
86
|
-
isFocusBoundary:
|
|
87
|
-
forceFocus:
|
|
84
|
+
onEnterRelease: l,
|
|
85
|
+
isFocusBoundary: !0,
|
|
86
|
+
forceFocus: !0
|
|
88
87
|
});
|
|
89
|
-
return
|
|
90
|
-
|
|
91
|
-
}, [
|
|
92
|
-
|
|
93
|
-
}, [
|
|
94
|
-
if (!
|
|
88
|
+
return c(() => () => {
|
|
89
|
+
e.revalidate();
|
|
90
|
+
}, [e]), c(() => {
|
|
91
|
+
p.current && I();
|
|
92
|
+
}, [p, I]), c(() => {
|
|
93
|
+
if (!u)
|
|
95
94
|
return () => {
|
|
96
95
|
};
|
|
97
|
-
const
|
|
98
|
-
const
|
|
99
|
-
if (
|
|
100
|
-
|
|
96
|
+
const C = (A) => {
|
|
97
|
+
const s = A.keyCode;
|
|
98
|
+
if (s === 461 || s === 10009 || s === 27 || s === 8) {
|
|
99
|
+
A.preventDefault(), A.stopPropagation(), A.stopImmediatePropagation(), u();
|
|
101
100
|
return;
|
|
102
101
|
}
|
|
103
102
|
};
|
|
104
|
-
return window.addEventListener("keydown",
|
|
105
|
-
}, [
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
-
/* @__PURE__ */
|
|
108
|
-
/* @__PURE__ */
|
|
103
|
+
return window.addEventListener("keydown", C, { capture: !0 }), () => window.removeEventListener("keydown", C, { capture: !0 });
|
|
104
|
+
}, [u]), /* @__PURE__ */ r(O, { className: V("SL_PauseAd", i && "pause-ad-closing"), children: /* @__PURE__ */ D(W, { children: [
|
|
105
|
+
/* @__PURE__ */ D(X, { children: [
|
|
106
|
+
/* @__PURE__ */ r(Y, { children: y }),
|
|
107
|
+
/* @__PURE__ */ r(H, { children: f })
|
|
109
108
|
] }),
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
b && /* @__PURE__ */ r(J, { children: /* @__PURE__ */ r(
|
|
110
|
+
Q,
|
|
112
111
|
{
|
|
113
|
-
ref:
|
|
114
|
-
onClick:
|
|
115
|
-
onMouseEnter: () =>
|
|
112
|
+
ref: p,
|
|
113
|
+
onClick: l,
|
|
114
|
+
onMouseEnter: () => p.current.focus(),
|
|
116
115
|
"aria-label": "Resume playback"
|
|
117
116
|
}
|
|
118
117
|
) }),
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
-
|
|
121
|
-
/* @__PURE__ */
|
|
118
|
+
/* @__PURE__ */ r(Z, { className: "SL_PauseAdSidebar", children: /* @__PURE__ */ D($, { children: [
|
|
119
|
+
t && /* @__PURE__ */ r(re, { content: a, isDesktop: n, vastUrl: t }),
|
|
120
|
+
/* @__PURE__ */ r(ee, { children: "ADVERTISEMENT" })
|
|
122
121
|
] }) })
|
|
123
122
|
] }) });
|
|
124
|
-
}, se = ({ showPauseAd:
|
|
125
|
-
const
|
|
126
|
-
P.current =
|
|
127
|
-
const [
|
|
128
|
-
refetchInterval:
|
|
129
|
-
$enabled:
|
|
130
|
-
prefetch:
|
|
131
|
-
}),
|
|
132
|
-
if (
|
|
133
|
-
|
|
134
|
-
const
|
|
135
|
-
|
|
123
|
+
}, se = ({ showPauseAd: i, vastUrls: a, title: e, caption: y, sdk: f, onClose: l, onRender: u, options: t, isDesktop: h }) => {
|
|
124
|
+
const n = t?.pauseAdDelay ?? 0, b = t?.pauseAdRefetchInterval ?? 1e3 * 60 * 50, [p, I] = B(!1), [C, A] = B(!1), s = x(), v = a?.[0].url, P = x(v), g = x(""), S = x("");
|
|
125
|
+
P.current = v;
|
|
126
|
+
const [m, R] = f.advertisement.getExternalPauseAd(v, {
|
|
127
|
+
refetchInterval: b,
|
|
128
|
+
$enabled: n === 0 || !!i,
|
|
129
|
+
prefetch: n === 0 && b > 0
|
|
130
|
+
}), k = q(m), E = _(() => {
|
|
131
|
+
if (l) {
|
|
132
|
+
S.current = P.current;
|
|
133
|
+
const o = m.get().data;
|
|
134
|
+
T.emit("exposedPauseAd", {
|
|
136
135
|
action: "closed",
|
|
137
|
-
payload:
|
|
138
|
-
id:
|
|
139
|
-
parentId:
|
|
136
|
+
payload: o?.url === S.current ? {
|
|
137
|
+
id: o?.id,
|
|
138
|
+
parentId: o?.parentId
|
|
140
139
|
} : {}
|
|
141
|
-
}),
|
|
140
|
+
}), l();
|
|
142
141
|
}
|
|
143
|
-
}, [
|
|
144
|
-
|
|
145
|
-
}, [
|
|
146
|
-
return
|
|
147
|
-
|
|
148
|
-
}, [
|
|
149
|
-
if (
|
|
150
|
-
|
|
151
|
-
const
|
|
152
|
-
|
|
142
|
+
}, [l, m]), F = _(() => {
|
|
143
|
+
f.controlVideoPlayer({ play: !0 });
|
|
144
|
+
}, [f]);
|
|
145
|
+
return c(() => {
|
|
146
|
+
R === P.current && k.error && (console.log("error", k.error), clearTimeout(s.current), E?.());
|
|
147
|
+
}, [k, E, R]), c(() => {
|
|
148
|
+
if (i && v) {
|
|
149
|
+
g.current = P.current, S.current = "";
|
|
150
|
+
const o = m.get().data;
|
|
151
|
+
T.emit("exposedPauseAd", {
|
|
153
152
|
action: "enabled",
|
|
154
|
-
payload:
|
|
155
|
-
id:
|
|
156
|
-
parentId:
|
|
153
|
+
payload: o?.url === g.current ? {
|
|
154
|
+
id: o?.id,
|
|
155
|
+
parentId: o?.parentId
|
|
157
156
|
} : {}
|
|
158
157
|
});
|
|
159
|
-
const
|
|
160
|
-
const
|
|
161
|
-
(
|
|
162
|
-
|
|
158
|
+
const U = () => {
|
|
159
|
+
const w = m.get(), L = w.data;
|
|
160
|
+
(!L || L?.url === P.current) && (!w.loading && L?.imageSrc ? (clearTimeout(s.current), A(!1), I(!0)) : w.loading && (s.current = setTimeout(() => {
|
|
161
|
+
U();
|
|
163
162
|
}, 200)));
|
|
164
163
|
};
|
|
165
|
-
clearTimeout(
|
|
166
|
-
|
|
167
|
-
},
|
|
164
|
+
clearTimeout(s.current), s.current = setTimeout(() => {
|
|
165
|
+
U();
|
|
166
|
+
}, n);
|
|
168
167
|
} else {
|
|
169
|
-
if (
|
|
170
|
-
const
|
|
171
|
-
|
|
168
|
+
if (S.current !== P.current) {
|
|
169
|
+
const o = m.get().data;
|
|
170
|
+
S.current = "", g.current !== "" && (T.emit("exposedPauseAd", {
|
|
172
171
|
action: "disabled",
|
|
173
|
-
payload:
|
|
174
|
-
id:
|
|
175
|
-
parentId:
|
|
172
|
+
payload: g.current === o?.url ? {
|
|
173
|
+
id: o?.id,
|
|
174
|
+
parentId: o?.parentId
|
|
176
175
|
} : {}
|
|
177
|
-
}),
|
|
176
|
+
}), g.current = "");
|
|
178
177
|
}
|
|
179
|
-
|
|
180
|
-
I(
|
|
178
|
+
A(!0), s.current = setTimeout(() => {
|
|
179
|
+
I(!1);
|
|
181
180
|
}, 400);
|
|
182
181
|
}
|
|
183
182
|
return () => {
|
|
184
|
-
|
|
183
|
+
s.current && clearTimeout(s.current);
|
|
185
184
|
};
|
|
186
|
-
}, [
|
|
187
|
-
|
|
188
|
-
}, [
|
|
189
|
-
|
|
190
|
-
}, [
|
|
191
|
-
|
|
185
|
+
}, [m, E, n, i, v]), c(() => {
|
|
186
|
+
u?.({ rendered: p });
|
|
187
|
+
}, [p, u]), c(() => () => {
|
|
188
|
+
u?.({ rendered: !1 });
|
|
189
|
+
}, [u]), !p || !k.data ? null : /* @__PURE__ */ r(
|
|
190
|
+
te,
|
|
192
191
|
{
|
|
193
|
-
onClose:
|
|
194
|
-
isClosing:
|
|
195
|
-
title:
|
|
196
|
-
caption:
|
|
197
|
-
onPlay:
|
|
198
|
-
vastUrl:
|
|
199
|
-
options:
|
|
200
|
-
isDesktop:
|
|
201
|
-
externalPauseAdStore:
|
|
202
|
-
content:
|
|
192
|
+
onClose: E,
|
|
193
|
+
isClosing: C,
|
|
194
|
+
title: e,
|
|
195
|
+
caption: y,
|
|
196
|
+
onPlay: F,
|
|
197
|
+
vastUrl: v,
|
|
198
|
+
options: t,
|
|
199
|
+
isDesktop: h,
|
|
200
|
+
externalPauseAdStore: m,
|
|
201
|
+
content: k.data
|
|
203
202
|
}
|
|
204
203
|
);
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
options
|
|
204
|
+
}, ae = ({
|
|
205
|
+
showPauseAd: i,
|
|
206
|
+
pauseAdVastUrl: a,
|
|
207
|
+
videoPlayerController: e,
|
|
208
|
+
onRenderPauseAd: y,
|
|
209
|
+
onClosePauseAd: f,
|
|
210
|
+
children: l,
|
|
211
|
+
options: u
|
|
214
212
|
}) => {
|
|
215
|
-
const
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
ref.current = videoPlayerController;
|
|
222
|
-
sdk.addVideoPlayerController(ref.current);
|
|
223
|
-
}
|
|
224
|
-
return () => {
|
|
225
|
-
if (ref.current) {
|
|
226
|
-
sdk.removeVideoPlayerController(ref.current);
|
|
227
|
-
}
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
return () => {
|
|
231
|
-
};
|
|
232
|
-
}, [sdk, videoPlayerController]);
|
|
233
|
-
if (!sdk) {
|
|
234
|
-
return children;
|
|
235
|
-
}
|
|
236
|
-
return /* @__PURE__ */ jsx("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ jsxs(
|
|
237
|
-
h,
|
|
213
|
+
const t = z(), h = G(), n = x();
|
|
214
|
+
return c(() => t ? (e && (n.current = e, t.addVideoPlayerController(n.current)), () => {
|
|
215
|
+
n.current && t.removeVideoPlayerController(n.current);
|
|
216
|
+
}) : () => {
|
|
217
|
+
}, [t, e]), t ? /* @__PURE__ */ r("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ D(
|
|
218
|
+
M,
|
|
238
219
|
{
|
|
239
|
-
style:
|
|
240
|
-
customTheme:
|
|
241
|
-
themeMode:
|
|
220
|
+
style: l ? { position: "relative" } : {},
|
|
221
|
+
customTheme: h.theme,
|
|
222
|
+
themeMode: h.themeMode,
|
|
242
223
|
children: [
|
|
243
|
-
|
|
244
|
-
|
|
224
|
+
l,
|
|
225
|
+
a && /* @__PURE__ */ r(
|
|
245
226
|
se,
|
|
246
227
|
{
|
|
247
|
-
sdk,
|
|
248
|
-
showPauseAd,
|
|
249
|
-
vastUrls:
|
|
250
|
-
onClose:
|
|
251
|
-
onRender:
|
|
252
|
-
options,
|
|
253
|
-
isDesktop:
|
|
228
|
+
sdk: t,
|
|
229
|
+
showPauseAd: i,
|
|
230
|
+
vastUrls: a,
|
|
231
|
+
onClose: f,
|
|
232
|
+
onRender: y,
|
|
233
|
+
options: u,
|
|
234
|
+
isDesktop: !0
|
|
254
235
|
}
|
|
255
236
|
)
|
|
256
237
|
]
|
|
257
238
|
}
|
|
258
|
-
) });
|
|
239
|
+
) }) : l;
|
|
259
240
|
};
|
|
260
|
-
class
|
|
261
|
-
constructor(
|
|
262
|
-
super(
|
|
263
|
-
this.state = { hasError: false };
|
|
241
|
+
class pe extends K {
|
|
242
|
+
constructor(a) {
|
|
243
|
+
super(a), this.state = { hasError: !1 };
|
|
264
244
|
}
|
|
265
245
|
static getDerivedStateFromError() {
|
|
266
|
-
return { hasError:
|
|
246
|
+
return { hasError: !0 };
|
|
267
247
|
}
|
|
268
|
-
componentDidCatch(
|
|
269
|
-
console.error(
|
|
248
|
+
componentDidCatch(a, e) {
|
|
249
|
+
console.error(a, e.componentStack);
|
|
270
250
|
}
|
|
271
251
|
render() {
|
|
272
|
-
|
|
273
|
-
return this.props.children;
|
|
274
|
-
}
|
|
275
|
-
return /* @__PURE__ */ jsx(PureStreamLayerPauseAd, { ...this.props });
|
|
252
|
+
return this.state.hasError ? this.props.children : /* @__PURE__ */ r(ae, { ...this.props });
|
|
276
253
|
}
|
|
277
254
|
}
|
|
278
255
|
export {
|
|
279
|
-
StreamLayerPauseAd
|
|
256
|
+
pe as StreamLayerPauseAd
|
|
280
257
|
};
|
package/lib/es/points.js
CHANGED
|
@@ -1,86 +1,78 @@
|
|
|
1
|
-
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { h } from "./
|
|
3
|
-
import { useState, useEffect } from "react";
|
|
4
|
-
import { s as
|
|
5
|
-
import { e as
|
|
6
|
-
import {
|
|
7
|
-
import { m } from "./theme.js";
|
|
8
|
-
import { B as
|
|
9
|
-
import { F as
|
|
10
|
-
import { S as
|
|
11
|
-
import {
|
|
12
|
-
const
|
|
1
|
+
import { jsxs as m, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { h as c } from "./index7.js";
|
|
3
|
+
import { useState as u, useEffect as d } from "react";
|
|
4
|
+
import { s as t, u as f } from "./sl-types.js";
|
|
5
|
+
import { e as n } from "./index3.js";
|
|
6
|
+
import { p as h } from "./index5.js";
|
|
7
|
+
import { m as y } from "./theme.js";
|
|
8
|
+
import { B as S } from "./index8.js";
|
|
9
|
+
import { F as p } from "./feature.js";
|
|
10
|
+
import { S as v } from "./useStreamLayerApp2.js";
|
|
11
|
+
import { Y as g, _ as A } from "./hooks-n9ax4LRT.js";
|
|
12
|
+
const I = /* @__PURE__ */ t("div")({
|
|
13
13
|
name: "PointsContainer",
|
|
14
14
|
class: "psiob9b",
|
|
15
|
-
propsAsIs:
|
|
16
|
-
}),
|
|
15
|
+
propsAsIs: !1
|
|
16
|
+
}), P = /* @__PURE__ */ t("div")({
|
|
17
17
|
name: "PointsIcon",
|
|
18
18
|
class: "p1gqe4lh",
|
|
19
|
-
propsAsIs:
|
|
20
|
-
}),
|
|
19
|
+
propsAsIs: !1
|
|
20
|
+
}), b = () => S, k = /* @__PURE__ */ t(b())({
|
|
21
21
|
name: "PointsSvg",
|
|
22
22
|
class: "p15syg2y",
|
|
23
|
-
propsAsIs:
|
|
24
|
-
}),
|
|
23
|
+
propsAsIs: !0
|
|
24
|
+
}), F = /* @__PURE__ */ t("div")({
|
|
25
25
|
name: "PointsBody",
|
|
26
26
|
class: "p12n4f2h",
|
|
27
|
-
propsAsIs:
|
|
28
|
-
}),
|
|
27
|
+
propsAsIs: !1
|
|
28
|
+
}), T = /* @__PURE__ */ t("div")({
|
|
29
29
|
name: "PointsTitle",
|
|
30
30
|
class: "poqmx89",
|
|
31
|
-
propsAsIs:
|
|
32
|
-
}),
|
|
31
|
+
propsAsIs: !1
|
|
32
|
+
}), x = /* @__PURE__ */ t("div")({
|
|
33
33
|
name: "PointsValue",
|
|
34
34
|
class: "prj9b3v",
|
|
35
|
-
propsAsIs:
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
/* @__PURE__ */ jsx(r, { children: /* @__PURE__ */ jsx(d, { value: n2 }) })
|
|
35
|
+
propsAsIs: !1
|
|
36
|
+
}), B = ({ points: s, onClick: e }) => /* @__PURE__ */ m(I, { className: y, onClick: e, children: [
|
|
37
|
+
/* @__PURE__ */ o(P, { children: /* @__PURE__ */ o(k, { name: "icon-trophy-solid" }) }),
|
|
38
|
+
/* @__PURE__ */ m(F, { children: [
|
|
39
|
+
/* @__PURE__ */ o(T, { children: "Total points" }),
|
|
40
|
+
/* @__PURE__ */ o(x, { children: /* @__PURE__ */ o(h, { value: s }) })
|
|
42
41
|
] })
|
|
43
|
-
] })
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
var i;
|
|
49
|
-
(i = o == null ? void 0 : o.summary) != null && i.points && m2(o.summary.points);
|
|
42
|
+
] }), C = ({ gamification: s }) => {
|
|
43
|
+
const e = s.userSummary.$store, [a, l] = u(0);
|
|
44
|
+
return d(() => {
|
|
45
|
+
const r = e.subscribe((i) => {
|
|
46
|
+
i?.summary?.points && l(i.summary.points);
|
|
50
47
|
});
|
|
51
48
|
return () => {
|
|
52
|
-
|
|
49
|
+
r();
|
|
53
50
|
};
|
|
54
|
-
}, [
|
|
55
|
-
const
|
|
56
|
-
|
|
51
|
+
}, [e]), /* @__PURE__ */ o(B, { points: a, onClick: () => {
|
|
52
|
+
const r = s.status.get();
|
|
53
|
+
r === p.Suspended ? (s.openFeature(), n.emit("app", {
|
|
57
54
|
action: "open",
|
|
58
55
|
payload: {}
|
|
59
|
-
}),
|
|
56
|
+
}), n.emit("interactions", {
|
|
60
57
|
action: "tap",
|
|
61
58
|
payload: {}
|
|
62
|
-
})) :
|
|
59
|
+
})) : r === p.Ready && (s.closeFeature(!1), n.emit("app", {
|
|
63
60
|
action: "close",
|
|
64
61
|
payload: {}
|
|
65
|
-
}),
|
|
62
|
+
}), n.emit("interactions", {
|
|
66
63
|
action: "tap",
|
|
67
64
|
payload: {}
|
|
68
65
|
}));
|
|
69
66
|
} });
|
|
70
|
-
},
|
|
71
|
-
if (!
|
|
67
|
+
}, $ = ({ sdk: s }) => {
|
|
68
|
+
if (!f(s.featuresList.getStore()))
|
|
72
69
|
return null;
|
|
73
|
-
const
|
|
74
|
-
return
|
|
75
|
-
}
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
const baseTheme = z();
|
|
79
|
-
if (!sdk) {
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
82
|
-
return /* @__PURE__ */ jsx("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ jsx(h, { customTheme: theme ?? baseTheme.theme, themeMode: baseTheme.themeMode, children: /* @__PURE__ */ jsx(k, { sdk }) }) });
|
|
70
|
+
const e = s.getFeature(v.GAMES);
|
|
71
|
+
return e ? /* @__PURE__ */ o(C, { gamification: e }) : null;
|
|
72
|
+
}, R = ({ theme: s }) => {
|
|
73
|
+
const e = g(), a = A();
|
|
74
|
+
return e ? /* @__PURE__ */ o("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ o(c, { customTheme: s ?? a.theme, themeMode: a.themeMode, children: /* @__PURE__ */ o($, { sdk: e }) }) }) : null;
|
|
83
75
|
};
|
|
84
76
|
export {
|
|
85
|
-
StreamLayerSDKPoints
|
|
77
|
+
R as StreamLayerSDKPoints
|
|
86
78
|
};
|