@streamlayer/react 1.23.1 → 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 +33 -53
- 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/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 -4
- package/lib/cjs/index12.js +1 -1
- package/lib/cjs/index13.js +1 -1
- package/lib/cjs/index14.js +4 -1
- package/lib/cjs/index15.js +1 -1
- package/lib/cjs/index16.js +2 -2
- package/lib/cjs/index2.js +1 -1
- package/lib/cjs/index4.js +3 -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 +5 -10
- 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 +4 -9
- package/lib/cjs/sl-types.js +1 -15
- package/lib/cjs/storage.js +1 -1
- package/lib/cjs/theme.js +1 -17
- package/lib/cjs/useStreamLayerApp.js +1 -1
- package/lib/cjs/useStreamLayerApp2.js +15 -15
- package/lib/cjs/utils.js +8 -8
- package/lib/classic/app/masters.d.ts +0 -1
- package/lib/classic/cjs/Question.js +1 -1
- package/lib/classic/cjs/advertisement.js +33 -53
- package/lib/classic/cjs/analytics.js +1 -1
- package/lib/classic/cjs/auth.js +1 -1
- package/lib/classic/cjs/bet-pack.js +3 -3
- package/lib/classic/cjs/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 +3 -3
- package/lib/classic/cjs/index2.js +2 -2
- 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 -1
- 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 +4 -9
- package/lib/classic/cjs/sl-types.js +1 -15
- package/lib/classic/cjs/useStreamLayerApp.js +1 -1
- package/lib/classic/cjs/useStreamLayerApp2.js +15 -15
- package/lib/classic/cjs/utils.js +8 -8
- package/lib/classic/es/Question.js +216 -220
- package/lib/classic/es/advertisement.js +14665 -15122
- package/lib/classic/es/analytics.js +9 -9
- package/lib/classic/es/auth.js +1 -1
- package/lib/classic/es/bet-pack.js +637 -650
- package/lib/classic/es/feature.js +29 -33
- 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 -82
- package/lib/classic/es/index11.js +306 -2344
- package/lib/classic/es/index12.js +103 -101
- package/lib/classic/es/index13.js +449 -464
- package/lib/classic/es/index2.js +1244 -1268
- package/lib/classic/es/index3.js +10 -10
- package/lib/classic/es/index4.js +4 -283
- package/lib/classic/es/index5.js +4 -5
- package/lib/classic/es/index6.js +285 -5
- package/lib/classic/es/index7.js +179 -5
- package/lib/classic/es/index8.js +5 -9
- package/lib/classic/es/index9.js +7 -315
- package/lib/classic/es/insight.js +39 -41
- package/lib/classic/es/notification.js +3 -3
- package/lib/classic/es/notification2.js +513 -528
- package/lib/classic/es/pause-ad.js +116 -116
- package/lib/classic/es/points.js +33 -34
- package/lib/classic/es/polymarket.js +1049 -1102
- package/lib/classic/es/sl-types.js +115 -217
- package/lib/classic/es/useStreamLayerApp.js +1 -1
- package/lib/classic/es/useStreamLayerApp2.js +6485 -6405
- package/lib/classic/es/utils.js +6 -6
- package/lib/classic/source.css +110 -0
- package/lib/dist/cjs/index-ByUNFvMk.js +5 -0
- package/lib/dist/cjs/index.js +1 -1
- package/lib/dist/cjs/masters.js +34 -42
- package/lib/dist/es/index-ByUNFvMk.js +3775 -0
- package/lib/dist/es/index.js +7 -11
- package/lib/dist/es/masters.js +13506 -12760
- package/lib/dist/index.d.ts +5 -5
- package/lib/dist/source.css +64 -0
- package/lib/es/Question.js +99 -101
- package/lib/es/advertisement.js +14665 -15122
- package/lib/es/analytics.js +29 -29
- package/lib/es/auth.js +1 -1
- package/lib/es/bet-pack.js +12 -11
- package/lib/es/feature.js +29 -33
- package/lib/es/hooks-n9ax4LRT.js +97 -0
- package/lib/es/index-ByUNFvMk.js +3775 -0
- package/lib/es/index.js +13 -16
- package/lib/es/index10.js +7 -263
- package/lib/es/index11.js +172 -822
- package/lib/es/index12.js +2587 -178
- package/lib/es/index13.js +248 -302
- package/lib/es/index14.js +815 -82
- package/lib/es/index15.js +306 -2344
- package/lib/es/index16.js +451 -454
- package/lib/es/index2.js +737 -757
- package/lib/es/index4.js +626 -639
- package/lib/es/index5.js +10 -10
- package/lib/es/index6.js +5 -285
- package/lib/es/index7.js +7 -5
- package/lib/es/index8.js +283 -5
- package/lib/es/index9.js +179 -8
- package/lib/es/insight.js +39 -41
- package/lib/es/masters.js +4 -5
- package/lib/es/masters2.js +408 -441
- package/lib/es/notification.js +469 -484
- package/lib/es/pause-ad.js +116 -116
- package/lib/es/points.js +42 -43
- package/lib/es/polymarket.js +1049 -1102
- package/lib/es/sl-types.js +114 -235
- package/lib/es/storage.js +22 -22
- package/lib/es/theme.js +3 -44
- package/lib/es/useStreamLayerApp.js +1 -1
- package/lib/es/useStreamLayerApp2.js +6485 -6405
- package/lib/es/utils.js +6 -6
- package/lib/source.css +120 -0
- package/lib/style.css +1 -1
- package/package.json +15 -15
- package/lib/cjs/hooks-WfHlJH12.js +0 -1
- package/lib/cjs/index-eShKGO10.js +0 -5
- package/lib/classic/cjs/hooks-WfHlJH12.js +0 -1
- package/lib/classic/cjs/index-eShKGO10.js +0 -5
- package/lib/classic/es/hooks-WfHlJH12.js +0 -98
- package/lib/classic/es/index-eShKGO10.js +0 -3757
- package/lib/dist/cjs/index-eShKGO10.js +0 -5
- 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,10 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { h as
|
|
3
|
-
import { s as d, u as
|
|
4
|
-
import { d as
|
|
5
|
-
import { useState as B, useRef as
|
|
6
|
-
import { e as
|
|
7
|
-
import {
|
|
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
8
|
const O = /* @__PURE__ */ d("div")({
|
|
9
9
|
name: "PauseAdOverlay",
|
|
10
10
|
class: "pw9gih8",
|
|
@@ -17,19 +17,19 @@ const O = /* @__PURE__ */ d("div")({
|
|
|
17
17
|
name: "PauseAdTopLeft",
|
|
18
18
|
class: "pv7u167",
|
|
19
19
|
propsAsIs: !1
|
|
20
|
-
}),
|
|
20
|
+
}), Y = /* @__PURE__ */ d("h2")({
|
|
21
21
|
name: "PauseAdTitle",
|
|
22
22
|
class: "p1kh2yb0",
|
|
23
23
|
propsAsIs: !1
|
|
24
|
-
}),
|
|
24
|
+
}), H = /* @__PURE__ */ d("p")({
|
|
25
25
|
name: "PauseAdCaption",
|
|
26
26
|
class: "pl8f94x",
|
|
27
27
|
propsAsIs: !1
|
|
28
|
-
}),
|
|
28
|
+
}), J = /* @__PURE__ */ d("div")({
|
|
29
29
|
name: "PauseAdBottomLeft",
|
|
30
30
|
class: "p1m6zmrt",
|
|
31
31
|
propsAsIs: !1
|
|
32
|
-
}),
|
|
32
|
+
}), Q = /* @__PURE__ */ d("button")({
|
|
33
33
|
name: "PauseAdPlayButton",
|
|
34
34
|
class: "pm3vwfa",
|
|
35
35
|
propsAsIs: !1
|
|
@@ -45,27 +45,27 @@ const O = /* @__PURE__ */ d("div")({
|
|
|
45
45
|
name: "PauseAdTitleDescription",
|
|
46
46
|
class: "p14estxv",
|
|
47
47
|
propsAsIs: !1
|
|
48
|
-
}),
|
|
48
|
+
}), N = /* @__PURE__ */ d("img")({
|
|
49
49
|
name: "ExternalAdContainer",
|
|
50
50
|
class: "e1dpvfl1",
|
|
51
51
|
propsAsIs: !1
|
|
52
52
|
}), re = ({
|
|
53
53
|
vastUrl: i,
|
|
54
|
-
isDesktop:
|
|
54
|
+
isDesktop: a,
|
|
55
55
|
content: e
|
|
56
56
|
}) => (c(() => {
|
|
57
|
-
e.imageSrc && e.id &&
|
|
57
|
+
e.imageSrc && e.id && T.emit("exposedPauseAd", {
|
|
58
58
|
action: "rendered",
|
|
59
59
|
payload: {
|
|
60
60
|
id: e.id,
|
|
61
61
|
parentId: e.parentId
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
|
-
}, [e, i]), e
|
|
64
|
+
}, [e, i]), e?.imageSrc ? !e.adUrl || !a ? /* @__PURE__ */ r(N, { src: e.imageSrc }) : /* @__PURE__ */ r(
|
|
65
65
|
"a",
|
|
66
66
|
{
|
|
67
67
|
onClick: () => {
|
|
68
|
-
|
|
68
|
+
T.emit("exposedPauseAd", {
|
|
69
69
|
action: "navigated",
|
|
70
70
|
payload: {
|
|
71
71
|
id: e.id,
|
|
@@ -76,180 +76,180 @@ const O = /* @__PURE__ */ d("div")({
|
|
|
76
76
|
href: e.adUrl,
|
|
77
77
|
target: "_blank",
|
|
78
78
|
rel: "noopener noreferrer",
|
|
79
|
-
children: /* @__PURE__ */
|
|
79
|
+
children: /* @__PURE__ */ r(N, { src: e.imageSrc })
|
|
80
80
|
}
|
|
81
|
-
) : null), te = ({ isClosing: i, content:
|
|
82
|
-
const b =
|
|
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({
|
|
83
83
|
focusKey: "sl-pause-ad-play",
|
|
84
|
-
onEnterRelease:
|
|
84
|
+
onEnterRelease: l,
|
|
85
85
|
isFocusBoundary: !0,
|
|
86
86
|
forceFocus: !0
|
|
87
87
|
});
|
|
88
88
|
return c(() => () => {
|
|
89
89
|
e.revalidate();
|
|
90
90
|
}, [e]), c(() => {
|
|
91
|
-
p.current &&
|
|
92
|
-
}, [p,
|
|
93
|
-
if (!
|
|
91
|
+
p.current && I();
|
|
92
|
+
}, [p, I]), c(() => {
|
|
93
|
+
if (!u)
|
|
94
94
|
return () => {
|
|
95
95
|
};
|
|
96
|
-
const
|
|
97
|
-
const
|
|
98
|
-
if (
|
|
99
|
-
A.preventDefault(), A.stopPropagation(), A.stopImmediatePropagation(),
|
|
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();
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
|
-
return window.addEventListener("keydown",
|
|
104
|
-
}, [
|
|
105
|
-
/* @__PURE__ */
|
|
106
|
-
/* @__PURE__ */
|
|
107
|
-
/* @__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 })
|
|
108
108
|
] }),
|
|
109
|
-
b && /* @__PURE__ */
|
|
110
|
-
|
|
109
|
+
b && /* @__PURE__ */ r(J, { children: /* @__PURE__ */ r(
|
|
110
|
+
Q,
|
|
111
111
|
{
|
|
112
112
|
ref: p,
|
|
113
|
-
onClick:
|
|
113
|
+
onClick: l,
|
|
114
114
|
onMouseEnter: () => p.current.focus(),
|
|
115
115
|
"aria-label": "Resume playback"
|
|
116
116
|
}
|
|
117
117
|
) }),
|
|
118
|
-
/* @__PURE__ */
|
|
119
|
-
t && /* @__PURE__ */
|
|
120
|
-
/* @__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" })
|
|
121
121
|
] }) })
|
|
122
122
|
] }) });
|
|
123
|
-
}, se = ({ showPauseAd: i, vastUrls:
|
|
124
|
-
const
|
|
125
|
-
P.current =
|
|
126
|
-
const [m, R] =
|
|
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
127
|
refetchInterval: b,
|
|
128
|
-
$enabled:
|
|
129
|
-
prefetch:
|
|
130
|
-
}), k =
|
|
131
|
-
if (
|
|
128
|
+
$enabled: n === 0 || !!i,
|
|
129
|
+
prefetch: n === 0 && b > 0
|
|
130
|
+
}), k = q(m), E = _(() => {
|
|
131
|
+
if (l) {
|
|
132
132
|
S.current = P.current;
|
|
133
|
-
const
|
|
134
|
-
|
|
133
|
+
const o = m.get().data;
|
|
134
|
+
T.emit("exposedPauseAd", {
|
|
135
135
|
action: "closed",
|
|
136
|
-
payload:
|
|
137
|
-
id:
|
|
138
|
-
parentId:
|
|
136
|
+
payload: o?.url === S.current ? {
|
|
137
|
+
id: o?.id,
|
|
138
|
+
parentId: o?.parentId
|
|
139
139
|
} : {}
|
|
140
|
-
}),
|
|
140
|
+
}), l();
|
|
141
141
|
}
|
|
142
|
-
}, [
|
|
143
|
-
|
|
144
|
-
}, [
|
|
142
|
+
}, [l, m]), F = _(() => {
|
|
143
|
+
f.controlVideoPlayer({ play: !0 });
|
|
144
|
+
}, [f]);
|
|
145
145
|
return c(() => {
|
|
146
|
-
R === P.current && k.error && (console.log("error", k.error), clearTimeout(
|
|
147
|
-
}, [k,
|
|
148
|
-
if (i &&
|
|
149
|
-
|
|
150
|
-
const
|
|
151
|
-
|
|
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", {
|
|
152
152
|
action: "enabled",
|
|
153
|
-
payload:
|
|
154
|
-
id:
|
|
155
|
-
parentId:
|
|
153
|
+
payload: o?.url === g.current ? {
|
|
154
|
+
id: o?.id,
|
|
155
|
+
parentId: o?.parentId
|
|
156
156
|
} : {}
|
|
157
157
|
});
|
|
158
158
|
const U = () => {
|
|
159
|
-
const
|
|
160
|
-
(
|
|
161
|
-
|
|
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();
|
|
162
162
|
}, 200)));
|
|
163
163
|
};
|
|
164
|
-
clearTimeout(
|
|
164
|
+
clearTimeout(s.current), s.current = setTimeout(() => {
|
|
165
165
|
U();
|
|
166
|
-
},
|
|
166
|
+
}, n);
|
|
167
167
|
} else {
|
|
168
168
|
if (S.current !== P.current) {
|
|
169
|
-
const
|
|
170
|
-
S.current = "",
|
|
169
|
+
const o = m.get().data;
|
|
170
|
+
S.current = "", g.current !== "" && (T.emit("exposedPauseAd", {
|
|
171
171
|
action: "disabled",
|
|
172
|
-
payload:
|
|
173
|
-
id:
|
|
174
|
-
parentId:
|
|
172
|
+
payload: g.current === o?.url ? {
|
|
173
|
+
id: o?.id,
|
|
174
|
+
parentId: o?.parentId
|
|
175
175
|
} : {}
|
|
176
|
-
}),
|
|
176
|
+
}), g.current = "");
|
|
177
177
|
}
|
|
178
|
-
A(!0),
|
|
179
|
-
|
|
178
|
+
A(!0), s.current = setTimeout(() => {
|
|
179
|
+
I(!1);
|
|
180
180
|
}, 400);
|
|
181
181
|
}
|
|
182
182
|
return () => {
|
|
183
|
-
|
|
183
|
+
s.current && clearTimeout(s.current);
|
|
184
184
|
};
|
|
185
|
-
}, [m,
|
|
186
|
-
|
|
187
|
-
}, [p,
|
|
188
|
-
|
|
189
|
-
}, [
|
|
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
190
|
te,
|
|
191
191
|
{
|
|
192
|
-
onClose:
|
|
193
|
-
isClosing:
|
|
192
|
+
onClose: E,
|
|
193
|
+
isClosing: C,
|
|
194
194
|
title: e,
|
|
195
|
-
caption:
|
|
196
|
-
onPlay:
|
|
197
|
-
vastUrl:
|
|
195
|
+
caption: y,
|
|
196
|
+
onPlay: F,
|
|
197
|
+
vastUrl: v,
|
|
198
198
|
options: t,
|
|
199
|
-
isDesktop:
|
|
199
|
+
isDesktop: h,
|
|
200
200
|
externalPauseAdStore: m,
|
|
201
201
|
content: k.data
|
|
202
202
|
}
|
|
203
203
|
);
|
|
204
|
-
},
|
|
204
|
+
}, ae = ({
|
|
205
205
|
showPauseAd: i,
|
|
206
|
-
pauseAdVastUrl:
|
|
206
|
+
pauseAdVastUrl: a,
|
|
207
207
|
videoPlayerController: e,
|
|
208
|
-
onRenderPauseAd:
|
|
209
|
-
onClosePauseAd:
|
|
210
|
-
children:
|
|
211
|
-
options:
|
|
208
|
+
onRenderPauseAd: y,
|
|
209
|
+
onClosePauseAd: f,
|
|
210
|
+
children: l,
|
|
211
|
+
options: u
|
|
212
212
|
}) => {
|
|
213
|
-
const t =
|
|
214
|
-
return c(() => t ? (e && (
|
|
215
|
-
|
|
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
216
|
}) : () => {
|
|
217
|
-
}, [t, e]), t ? /* @__PURE__ */
|
|
218
|
-
|
|
217
|
+
}, [t, e]), t ? /* @__PURE__ */ r("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ D(
|
|
218
|
+
M,
|
|
219
219
|
{
|
|
220
|
-
style:
|
|
221
|
-
customTheme:
|
|
222
|
-
themeMode:
|
|
220
|
+
style: l ? { position: "relative" } : {},
|
|
221
|
+
customTheme: h.theme,
|
|
222
|
+
themeMode: h.themeMode,
|
|
223
223
|
children: [
|
|
224
|
-
|
|
225
|
-
|
|
224
|
+
l,
|
|
225
|
+
a && /* @__PURE__ */ r(
|
|
226
226
|
se,
|
|
227
227
|
{
|
|
228
228
|
sdk: t,
|
|
229
229
|
showPauseAd: i,
|
|
230
|
-
vastUrls:
|
|
231
|
-
onClose:
|
|
232
|
-
onRender:
|
|
233
|
-
options:
|
|
230
|
+
vastUrls: a,
|
|
231
|
+
onClose: f,
|
|
232
|
+
onRender: y,
|
|
233
|
+
options: u,
|
|
234
234
|
isDesktop: !0
|
|
235
235
|
}
|
|
236
236
|
)
|
|
237
237
|
]
|
|
238
238
|
}
|
|
239
|
-
) }) :
|
|
239
|
+
) }) : l;
|
|
240
240
|
};
|
|
241
|
-
class pe extends
|
|
242
|
-
constructor(
|
|
243
|
-
super(
|
|
241
|
+
class pe extends K {
|
|
242
|
+
constructor(a) {
|
|
243
|
+
super(a), this.state = { hasError: !1 };
|
|
244
244
|
}
|
|
245
245
|
static getDerivedStateFromError() {
|
|
246
246
|
return { hasError: !0 };
|
|
247
247
|
}
|
|
248
|
-
componentDidCatch(
|
|
249
|
-
console.error(
|
|
248
|
+
componentDidCatch(a, e) {
|
|
249
|
+
console.error(a, e.componentStack);
|
|
250
250
|
}
|
|
251
251
|
render() {
|
|
252
|
-
return this.state.hasError ? this.props.children : /* @__PURE__ */
|
|
252
|
+
return this.state.hasError ? this.props.children : /* @__PURE__ */ r(ae, { ...this.props });
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
export {
|
package/lib/es/points.js
CHANGED
|
@@ -1,79 +1,78 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { h as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { s as
|
|
5
|
-
import { e as
|
|
6
|
-
import {
|
|
7
|
-
import { m as
|
|
8
|
-
import { B as
|
|
9
|
-
import { F as
|
|
10
|
-
import { S as
|
|
11
|
-
import {
|
|
12
|
-
const I = /* @__PURE__ */
|
|
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
15
|
propsAsIs: !1
|
|
16
|
-
}), P = /* @__PURE__ */
|
|
16
|
+
}), P = /* @__PURE__ */ t("div")({
|
|
17
17
|
name: "PointsIcon",
|
|
18
18
|
class: "p1gqe4lh",
|
|
19
19
|
propsAsIs: !1
|
|
20
|
-
}), b = () =>
|
|
20
|
+
}), b = () => S, k = /* @__PURE__ */ t(b())({
|
|
21
21
|
name: "PointsSvg",
|
|
22
22
|
class: "p15syg2y",
|
|
23
23
|
propsAsIs: !0
|
|
24
|
-
}), F = /* @__PURE__ */
|
|
24
|
+
}), F = /* @__PURE__ */ t("div")({
|
|
25
25
|
name: "PointsBody",
|
|
26
26
|
class: "p12n4f2h",
|
|
27
27
|
propsAsIs: !1
|
|
28
|
-
}), T = /* @__PURE__ */
|
|
28
|
+
}), T = /* @__PURE__ */ t("div")({
|
|
29
29
|
name: "PointsTitle",
|
|
30
30
|
class: "poqmx89",
|
|
31
31
|
propsAsIs: !1
|
|
32
|
-
}), x = /* @__PURE__ */
|
|
32
|
+
}), x = /* @__PURE__ */ t("div")({
|
|
33
33
|
name: "PointsValue",
|
|
34
34
|
class: "prj9b3v",
|
|
35
35
|
propsAsIs: !1
|
|
36
|
-
}),
|
|
37
|
-
/* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
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 }) })
|
|
41
41
|
] })
|
|
42
|
-
] }),
|
|
43
|
-
const
|
|
44
|
-
return
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
(m = i == null ? void 0 : i.summary) != null && m.points && l(i.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);
|
|
48
47
|
});
|
|
49
48
|
return () => {
|
|
50
|
-
|
|
49
|
+
r();
|
|
51
50
|
};
|
|
52
|
-
}, [
|
|
53
|
-
const
|
|
54
|
-
|
|
51
|
+
}, [e]), /* @__PURE__ */ o(B, { points: a, onClick: () => {
|
|
52
|
+
const r = s.status.get();
|
|
53
|
+
r === p.Suspended ? (s.openFeature(), n.emit("app", {
|
|
55
54
|
action: "open",
|
|
56
55
|
payload: {}
|
|
57
|
-
}),
|
|
56
|
+
}), n.emit("interactions", {
|
|
58
57
|
action: "tap",
|
|
59
58
|
payload: {}
|
|
60
|
-
})) :
|
|
59
|
+
})) : r === p.Ready && (s.closeFeature(!1), n.emit("app", {
|
|
61
60
|
action: "close",
|
|
62
61
|
payload: {}
|
|
63
|
-
}),
|
|
62
|
+
}), n.emit("interactions", {
|
|
64
63
|
action: "tap",
|
|
65
64
|
payload: {}
|
|
66
65
|
}));
|
|
67
66
|
} });
|
|
68
|
-
},
|
|
69
|
-
if (!
|
|
67
|
+
}, $ = ({ sdk: s }) => {
|
|
68
|
+
if (!f(s.featuresList.getStore()))
|
|
70
69
|
return null;
|
|
71
|
-
const
|
|
72
|
-
return
|
|
73
|
-
},
|
|
74
|
-
const
|
|
75
|
-
return
|
|
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;
|
|
76
75
|
};
|
|
77
76
|
export {
|
|
78
|
-
|
|
77
|
+
R as StreamLayerSDKPoints
|
|
79
78
|
};
|