@streamlayer/react 1.24.8-pre.84ab1b9 → 1.24.8-pre.a96f156
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/cjs/advertisement.js +16 -16
- package/lib/cjs/auth.js +13 -13
- package/lib/cjs/bet-pack.js +20 -20
- package/lib/cjs/index.js +62 -62
- package/lib/cjs/insight.js +24 -24
- package/lib/cjs/masters.js +52 -52
- package/lib/cjs/notification.js +24 -24
- package/lib/cjs/pause-ad.js +360 -359
- package/lib/cjs/points.js +13 -13
- package/lib/cjs/polymarket.js +13 -13
- package/lib/cjs/style.css +1 -1
- package/lib/cjs/useStreamLayerApp.js +40 -40
- package/lib/dist/cjs/index.js +52 -52
- package/lib/dist/es/index.js +52 -52
- package/lib/es/advertisement.js +3 -3
- package/lib/es/pause-ad.js +282 -281
- package/lib/es/style.css +1 -1
- package/lib/es/useStreamLayerApp2.js +623 -615
- package/lib/source.css +1 -1
- package/package.json +5 -5
- /package/lib/es/{index-BW1YFKTb.js → index-B_CIB4_F.js} +0 -0
package/lib/es/pause-ad.js
CHANGED
|
@@ -1,420 +1,421 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { h as
|
|
3
|
-
import { useEffect as
|
|
4
|
-
import { s as
|
|
5
|
-
import { e as
|
|
6
|
-
import { d as
|
|
7
|
-
import { w as
|
|
8
|
-
const
|
|
1
|
+
import { jsx as m, jsxs as F } from "react/jsx-runtime";
|
|
2
|
+
import { h as z } from "./index7.js";
|
|
3
|
+
import { useEffect as I, useState as B, useRef as T, useMemo as J, useCallback as O, Component as Z } from "react";
|
|
4
|
+
import { s as _, u as N, c as V } from "./feature.js";
|
|
5
|
+
import { e as L } from "./index3.js";
|
|
6
|
+
import { d as Q } from "./index15.js";
|
|
7
|
+
import { w as X, q as Y } from "./hooks-DHRXtbBc.js";
|
|
8
|
+
const $ = /* @__PURE__ */ _("div")({
|
|
9
9
|
name: "PauseAdOverlay",
|
|
10
10
|
class: "pw9gih8",
|
|
11
11
|
propsAsIs: !1
|
|
12
|
-
}),
|
|
12
|
+
}), ee = /* @__PURE__ */ _("div")({
|
|
13
13
|
name: "PauseAdContent",
|
|
14
14
|
class: "p8lpomy",
|
|
15
15
|
propsAsIs: !1
|
|
16
|
-
}),
|
|
16
|
+
}), te = /* @__PURE__ */ _("div")({
|
|
17
17
|
name: "PauseAdBottomLeft",
|
|
18
18
|
class: "pv7u167",
|
|
19
19
|
propsAsIs: !1
|
|
20
|
-
}),
|
|
20
|
+
}), re = /* @__PURE__ */ _("button")({
|
|
21
21
|
name: "PauseAdPlayButton",
|
|
22
22
|
class: "p1kh2yb0",
|
|
23
23
|
propsAsIs: !1
|
|
24
|
-
}),
|
|
24
|
+
}), ae = /* @__PURE__ */ _("div")({
|
|
25
25
|
name: "PauseAdSidebarGradient",
|
|
26
26
|
class: "pl8f94x",
|
|
27
27
|
propsAsIs: !1
|
|
28
|
-
}),
|
|
28
|
+
}), se = /* @__PURE__ */ _("div")({
|
|
29
29
|
name: "PauseAdSidebar",
|
|
30
30
|
class: "p1m6zmrt",
|
|
31
31
|
propsAsIs: !1
|
|
32
|
-
}),
|
|
32
|
+
}), K = /* @__PURE__ */ _("img")({
|
|
33
33
|
name: "ExternalAdContainer",
|
|
34
34
|
class: "em3vwfa",
|
|
35
35
|
propsAsIs: !1
|
|
36
|
-
}),
|
|
36
|
+
}), ne = /* @__PURE__ */ _("iframe")({
|
|
37
37
|
name: "GptAdIframe",
|
|
38
38
|
class: "g1tibuhw",
|
|
39
39
|
propsAsIs: !1
|
|
40
|
-
}),
|
|
40
|
+
}), de = ({
|
|
41
41
|
vastUrl: s,
|
|
42
|
-
isDesktop:
|
|
43
|
-
content:
|
|
44
|
-
}) => (
|
|
45
|
-
|
|
42
|
+
isDesktop: h,
|
|
43
|
+
content: r
|
|
44
|
+
}) => (I(() => {
|
|
45
|
+
r.imageSrc && r.id && L.emit("exposedPauseAd", {
|
|
46
46
|
action: "rendered",
|
|
47
47
|
payload: {
|
|
48
|
-
id:
|
|
49
|
-
parentId:
|
|
48
|
+
id: r.id,
|
|
49
|
+
parentId: r.parentId
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
|
-
}, [
|
|
52
|
+
}, [r, s]), r?.imageSrc ? !r.adUrl || !h ? /* @__PURE__ */ m(K, { src: r.imageSrc }) : /* @__PURE__ */ m(
|
|
53
53
|
"a",
|
|
54
54
|
{
|
|
55
55
|
onClick: () => {
|
|
56
|
-
|
|
56
|
+
L.emit("exposedPauseAd", {
|
|
57
57
|
action: "navigated",
|
|
58
58
|
payload: {
|
|
59
|
-
id:
|
|
60
|
-
parentId:
|
|
59
|
+
id: r.id,
|
|
60
|
+
parentId: r.parentId
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
63
|
},
|
|
64
|
-
href:
|
|
64
|
+
href: r.adUrl,
|
|
65
65
|
target: "_blank",
|
|
66
66
|
rel: "noopener noreferrer",
|
|
67
|
-
children: /* @__PURE__ */
|
|
67
|
+
children: /* @__PURE__ */ m(K, { src: r.imageSrc })
|
|
68
68
|
}
|
|
69
|
-
) : null),
|
|
69
|
+
) : null), oe = ({
|
|
70
70
|
vastUrl: s,
|
|
71
|
-
sdk:
|
|
72
|
-
onLoaded:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
containerRef: M
|
|
71
|
+
sdk: h,
|
|
72
|
+
onLoaded: r,
|
|
73
|
+
product: o,
|
|
74
|
+
platform: P,
|
|
75
|
+
platformtype: f,
|
|
76
|
+
pagetype: y,
|
|
77
|
+
content: w,
|
|
78
|
+
adWidth: k,
|
|
79
|
+
adHeight: d,
|
|
80
|
+
rdid: b,
|
|
81
|
+
idtype: i,
|
|
82
|
+
npa: C,
|
|
83
|
+
isLat: G,
|
|
84
|
+
targeting: U,
|
|
85
|
+
containerRef: D
|
|
87
86
|
}) => {
|
|
88
|
-
const { production:
|
|
87
|
+
const { production: E } = N(h.options), l = N(h.deviceId), [W, n] = B(!1), [g, a] = B({ width: 0, height: 0 }), [c, R] = B({ width: 0, height: 0 }), S = T(null), u = J(() => {
|
|
89
88
|
const e = new URLSearchParams();
|
|
90
|
-
return
|
|
89
|
+
return o && e.set("product", o), P && e.set("platform", P), f && e.set("platformtype", f), y && e.set("pagetype", y), w && e.set("content", w), k && e.set("width", k.toString()), d && e.set("height", d.toString()), C != null && e.set("npa", C.toString()), G != null && e.set("is_lat", G.toString()), U && e.set("targeting", new URLSearchParams(U).toString()), l && (e.set("rdid", l), e.set("idtype", "uuid")), b && e.set("rdid", b), i && e.set("idtype", i), s.startsWith("http") ? e.set("url", s) : e.set("slot", s), `https://${E ? "bell-ad.streamlayer.io" : "bell-ad-test.streamlayer.io"}?${e.toString()}`;
|
|
91
90
|
}, [
|
|
92
91
|
s,
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
o,
|
|
93
|
+
P,
|
|
94
|
+
f,
|
|
95
95
|
y,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
S,
|
|
100
|
-
W,
|
|
96
|
+
w,
|
|
97
|
+
k,
|
|
98
|
+
d,
|
|
101
99
|
C,
|
|
102
|
-
|
|
103
|
-
R,
|
|
100
|
+
G,
|
|
104
101
|
b,
|
|
105
|
-
|
|
106
|
-
|
|
102
|
+
i,
|
|
103
|
+
U,
|
|
104
|
+
l,
|
|
105
|
+
E
|
|
107
106
|
]);
|
|
108
|
-
|
|
109
|
-
|
|
107
|
+
I(() => {
|
|
108
|
+
u && (L.emit("exposedPauseAd", {
|
|
109
|
+
action: "load",
|
|
110
|
+
payload: {}
|
|
111
|
+
}), n(!1));
|
|
112
|
+
}, [u]), I(() => {
|
|
113
|
+
const e = D.current;
|
|
110
114
|
if (!e) return;
|
|
111
|
-
const
|
|
112
|
-
const { width:
|
|
113
|
-
|
|
115
|
+
const t = new ResizeObserver(([x]) => {
|
|
116
|
+
const { width: A, height: j } = x.contentRect;
|
|
117
|
+
a({ width: Math.round(A), height: Math.round(j) });
|
|
114
118
|
});
|
|
115
|
-
return
|
|
116
|
-
}, [
|
|
117
|
-
const e = (
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
id:
|
|
121
|
-
parentId:
|
|
122
|
-
width:
|
|
123
|
-
height:
|
|
124
|
-
}),
|
|
125
|
-
|
|
126
|
-
|
|
119
|
+
return t.observe(e), () => t.disconnect();
|
|
120
|
+
}, [D]), I(() => {
|
|
121
|
+
const e = (t) => {
|
|
122
|
+
const x = E ? "https://bell-ad.streamlayer.io" : "https://bell-ad-test.streamlayer.io";
|
|
123
|
+
t.origin === x && t.data.id === "slGptAdCb" && (S.current && t.source !== S.current.contentWindow || (t.data?.type === "slGptAdLoaded" && (n(!0), r?.({
|
|
124
|
+
id: t.data.creativeId,
|
|
125
|
+
parentId: t.data.advertiserId,
|
|
126
|
+
width: t.data.width,
|
|
127
|
+
height: t.data.height
|
|
128
|
+
}), R({ width: t.data.width, height: t.data.height }), L.emit("exposedPauseAd", {
|
|
129
|
+
action: "rendered",
|
|
130
|
+
payload: {
|
|
131
|
+
id: t.data.creativeId,
|
|
132
|
+
parentId: t.data.advertiserId
|
|
133
|
+
}
|
|
134
|
+
})), t.data?.type === "slGptAdReady" && L.emit("exposedPauseAd", {
|
|
135
|
+
action: "loaded",
|
|
136
|
+
payload: {
|
|
137
|
+
id: t.data.creativeId,
|
|
138
|
+
parentId: t.data.advertiserId
|
|
139
|
+
}
|
|
127
140
|
})));
|
|
128
141
|
};
|
|
129
|
-
return window.addEventListener("message", e), () => window.removeEventListener("message", e);
|
|
130
|
-
}, [
|
|
131
|
-
const
|
|
132
|
-
return /* @__PURE__ */
|
|
133
|
-
|
|
142
|
+
return S.current?.setAttribute("allowtransparency", "true"), window.addEventListener("message", e), () => window.removeEventListener("message", e);
|
|
143
|
+
}, [r, E]);
|
|
144
|
+
const p = c.width > 0 && c.height > 0 ? Math.min(g.width / c.width, g.height / c.height) : 1;
|
|
145
|
+
return /* @__PURE__ */ m("div", { style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ m(
|
|
146
|
+
ne,
|
|
134
147
|
{
|
|
135
|
-
ref:
|
|
136
|
-
src:
|
|
148
|
+
ref: S,
|
|
149
|
+
src: u,
|
|
137
150
|
scrolling: "no",
|
|
138
151
|
allow: "attribution-reporting",
|
|
139
|
-
allowTransparency: !0,
|
|
140
152
|
style: {
|
|
141
|
-
opacity:
|
|
142
|
-
width:
|
|
143
|
-
height:
|
|
153
|
+
opacity: W ? 1 : 0,
|
|
154
|
+
width: c.width,
|
|
155
|
+
height: c.height,
|
|
144
156
|
transformOrigin: "0 0",
|
|
145
|
-
transform: `scale(${
|
|
157
|
+
transform: `scale(${p})`
|
|
146
158
|
}
|
|
147
159
|
}
|
|
148
160
|
) });
|
|
149
|
-
},
|
|
161
|
+
}, ie = ({
|
|
150
162
|
sdk: s,
|
|
151
|
-
isClosing:
|
|
152
|
-
adContent:
|
|
153
|
-
externalPauseAdStore:
|
|
154
|
-
onPlay:
|
|
155
|
-
onClose:
|
|
163
|
+
isClosing: h,
|
|
164
|
+
adContent: r,
|
|
165
|
+
externalPauseAdStore: o,
|
|
166
|
+
onPlay: P,
|
|
167
|
+
onClose: f,
|
|
156
168
|
onGptAdLoaded: y,
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
gptAdLoaded: U
|
|
169
|
+
vastUrl: w,
|
|
170
|
+
product: k,
|
|
171
|
+
platform: d,
|
|
172
|
+
platformtype: b,
|
|
173
|
+
pagetype: i,
|
|
174
|
+
content: C,
|
|
175
|
+
adWidth: G,
|
|
176
|
+
adHeight: U,
|
|
177
|
+
npa: D,
|
|
178
|
+
isLat: E,
|
|
179
|
+
targeting: l,
|
|
180
|
+
options: W,
|
|
181
|
+
isDesktop: n,
|
|
182
|
+
isGptAd: g,
|
|
183
|
+
rdid: a,
|
|
184
|
+
idtype: c,
|
|
185
|
+
gptAdLoaded: R
|
|
175
186
|
}) => {
|
|
176
|
-
const
|
|
187
|
+
const S = W?.showPauseButton ?? !0, u = T(null), { ref: p, focusSelf: e } = Q.useFocusable({
|
|
177
188
|
focusKey: "sl-pause-ad-play",
|
|
178
|
-
onEnterRelease:
|
|
189
|
+
onEnterRelease: P,
|
|
179
190
|
isFocusBoundary: !0,
|
|
180
191
|
forceFocus: !0
|
|
181
192
|
});
|
|
182
|
-
return
|
|
183
|
-
|
|
184
|
-
}, [
|
|
185
|
-
|
|
186
|
-
}, [
|
|
187
|
-
if (!
|
|
193
|
+
return I(() => () => {
|
|
194
|
+
o.revalidate();
|
|
195
|
+
}, [o]), I(() => {
|
|
196
|
+
p.current && e();
|
|
197
|
+
}, [p, e]), I(() => {
|
|
198
|
+
if (!f)
|
|
188
199
|
return () => {
|
|
189
200
|
};
|
|
190
|
-
const
|
|
191
|
-
const
|
|
192
|
-
if (
|
|
193
|
-
|
|
201
|
+
const t = (x) => {
|
|
202
|
+
const A = x.keyCode;
|
|
203
|
+
if (A === 461 || A === 10009 || A === 27 || A === 8) {
|
|
204
|
+
x.preventDefault(), x.stopPropagation(), x.stopImmediatePropagation(), f();
|
|
194
205
|
return;
|
|
195
206
|
}
|
|
196
207
|
};
|
|
197
|
-
return window.addEventListener("keydown",
|
|
198
|
-
}, [
|
|
199
|
-
|
|
208
|
+
return window.addEventListener("keydown", t, { capture: !0 }), () => window.removeEventListener("keydown", t, { capture: !0 });
|
|
209
|
+
}, [f]), /* @__PURE__ */ m(
|
|
210
|
+
$,
|
|
200
211
|
{
|
|
201
|
-
className:
|
|
202
|
-
children: /* @__PURE__ */
|
|
203
|
-
|
|
204
|
-
|
|
212
|
+
className: V("SL_PauseAd", h && "pause-ad-closing", g && !R && "pause-ad-preloading"),
|
|
213
|
+
children: /* @__PURE__ */ F(ee, { children: [
|
|
214
|
+
S && /* @__PURE__ */ m(te, { children: /* @__PURE__ */ m(
|
|
215
|
+
re,
|
|
205
216
|
{
|
|
206
|
-
ref:
|
|
207
|
-
onClick:
|
|
208
|
-
onMouseEnter: () =>
|
|
217
|
+
ref: p,
|
|
218
|
+
onClick: P,
|
|
219
|
+
onMouseEnter: () => p.current.focus(),
|
|
209
220
|
"aria-label": "Resume playback"
|
|
210
221
|
}
|
|
211
222
|
) }),
|
|
212
|
-
/* @__PURE__ */
|
|
213
|
-
|
|
214
|
-
|
|
223
|
+
/* @__PURE__ */ m(ae, { className: V("SL_PauseAdSidebar", n && "SL_PauseAdSidebar--desktop"), children: /* @__PURE__ */ F(se, { ref: u, className: V(n && "SL_PauseAdSidebar__content--desktop"), children: [
|
|
224
|
+
g && w && /* @__PURE__ */ m(
|
|
225
|
+
oe,
|
|
215
226
|
{
|
|
216
|
-
vastUrl:
|
|
217
|
-
isDesktop:
|
|
218
|
-
product:
|
|
219
|
-
platform:
|
|
220
|
-
platformtype:
|
|
221
|
-
pagetype:
|
|
222
|
-
content:
|
|
223
|
-
adWidth:
|
|
224
|
-
adHeight:
|
|
225
|
-
npa:
|
|
226
|
-
isLat:
|
|
227
|
-
rdid:
|
|
228
|
-
idtype:
|
|
229
|
-
targeting:
|
|
230
|
-
containerRef:
|
|
227
|
+
vastUrl: w,
|
|
228
|
+
isDesktop: n,
|
|
229
|
+
product: k,
|
|
230
|
+
platform: d,
|
|
231
|
+
platformtype: b,
|
|
232
|
+
pagetype: i,
|
|
233
|
+
content: C,
|
|
234
|
+
adWidth: G,
|
|
235
|
+
adHeight: U,
|
|
236
|
+
npa: D,
|
|
237
|
+
isLat: E,
|
|
238
|
+
rdid: a,
|
|
239
|
+
idtype: c,
|
|
240
|
+
targeting: l,
|
|
241
|
+
containerRef: u,
|
|
231
242
|
onLoaded: y,
|
|
232
|
-
onReady: x,
|
|
233
243
|
sdk: s
|
|
234
244
|
}
|
|
235
245
|
),
|
|
236
|
-
!
|
|
246
|
+
!g && w && r && /* @__PURE__ */ m(de, { content: r, isDesktop: n, vastUrl: w })
|
|
237
247
|
] }) })
|
|
238
248
|
] })
|
|
239
249
|
}
|
|
240
250
|
);
|
|
241
|
-
},
|
|
251
|
+
}, le = (s) => {
|
|
242
252
|
if (!s) return !1;
|
|
243
253
|
try {
|
|
244
254
|
return s.startsWith("http") ? new URL(s).searchParams.get("output") === "ldjh" : !0;
|
|
245
255
|
} catch {
|
|
246
256
|
return !1;
|
|
247
257
|
}
|
|
248
|
-
},
|
|
249
|
-
const
|
|
250
|
-
|
|
251
|
-
const [
|
|
252
|
-
refetchInterval:
|
|
253
|
-
$enabled: !
|
|
254
|
-
prefetch: !
|
|
255
|
-
}),
|
|
256
|
-
|
|
257
|
-
}, []),
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
id: o.id,
|
|
262
|
-
parentId: o.parentId
|
|
263
|
-
}
|
|
264
|
-
});
|
|
265
|
-
}, []), I = H(() => {
|
|
266
|
-
if (v) {
|
|
267
|
-
if (U.current = L.current, r)
|
|
268
|
-
D.emit("exposedPauseAd", {
|
|
258
|
+
}, ce = ({ showPauseAd: s, externalUrls: h, vastUrls: r, sdk: o, onClose: P, onRender: f, options: y, isDesktop: w }) => {
|
|
259
|
+
const k = h ?? r, d = y?.pauseAdDelay ?? 0, b = y?.pauseAdRefetchInterval ?? 1e3 * 60 * 50, [i, C] = B(!1), [G, U] = B(!1), [D, E] = B(!1), l = T(), W = T(), n = k?.[0], g = n?.url, a = le(g), c = T(g), R = T(""), S = T(""), u = T(null);
|
|
260
|
+
c.current = g;
|
|
261
|
+
const [p, e] = o.advertisement.getExternalPauseAd(a ? "" : g, {
|
|
262
|
+
refetchInterval: b,
|
|
263
|
+
$enabled: !a && (d === 0 || !!s),
|
|
264
|
+
prefetch: !a && d === 0 && b > 0
|
|
265
|
+
}), t = N(p), x = O((v) => {
|
|
266
|
+
u.current = { id: v.id, parentId: v.parentId }, E(!0);
|
|
267
|
+
}, []), A = O(() => {
|
|
268
|
+
if (P) {
|
|
269
|
+
if (S.current = c.current, a)
|
|
270
|
+
L.emit("exposedPauseAd", {
|
|
269
271
|
action: "closed",
|
|
270
|
-
payload:
|
|
271
|
-
id:
|
|
272
|
-
parentId:
|
|
272
|
+
payload: u.current ? {
|
|
273
|
+
id: u.current.id,
|
|
274
|
+
parentId: u.current.parentId
|
|
273
275
|
} : {}
|
|
274
276
|
});
|
|
275
277
|
else {
|
|
276
|
-
const
|
|
277
|
-
|
|
278
|
+
const v = p.get().data;
|
|
279
|
+
L.emit("exposedPauseAd", {
|
|
278
280
|
action: "closed",
|
|
279
|
-
payload:
|
|
280
|
-
id:
|
|
281
|
-
parentId:
|
|
281
|
+
payload: v?.url === S.current ? {
|
|
282
|
+
id: v?.id,
|
|
283
|
+
parentId: v?.parentId
|
|
282
284
|
} : {}
|
|
283
285
|
});
|
|
284
286
|
}
|
|
285
|
-
|
|
287
|
+
P();
|
|
286
288
|
}
|
|
287
|
-
}, [
|
|
288
|
-
|
|
289
|
-
}, [
|
|
290
|
-
|
|
291
|
-
!
|
|
292
|
-
}, [
|
|
293
|
-
if (s &&
|
|
294
|
-
if (
|
|
295
|
-
|
|
289
|
+
}, [P, p, a]), j = O(() => {
|
|
290
|
+
o.controlVideoPlayer({ play: !0 });
|
|
291
|
+
}, [o]);
|
|
292
|
+
I(() => {
|
|
293
|
+
!a && e === c.current && t.error && (clearTimeout(l.current), A?.());
|
|
294
|
+
}, [t, a, A, e]), I(() => {
|
|
295
|
+
if (s && g) {
|
|
296
|
+
if (R.current = c.current, S.current = "", a)
|
|
297
|
+
u.current = null, E(!1), L.emit("exposedPauseAd", {
|
|
296
298
|
action: "enabled",
|
|
297
299
|
payload: {}
|
|
298
300
|
});
|
|
299
301
|
else {
|
|
300
|
-
const
|
|
301
|
-
|
|
302
|
+
const M = p.get().data;
|
|
303
|
+
L.emit("exposedPauseAd", {
|
|
302
304
|
action: "enabled",
|
|
303
|
-
payload:
|
|
304
|
-
id:
|
|
305
|
-
parentId:
|
|
305
|
+
payload: M?.url === R.current ? {
|
|
306
|
+
id: M?.id,
|
|
307
|
+
parentId: M?.parentId
|
|
306
308
|
} : {}
|
|
307
309
|
});
|
|
308
310
|
}
|
|
309
|
-
const
|
|
310
|
-
if (
|
|
311
|
-
clearTimeout(
|
|
311
|
+
const v = () => {
|
|
312
|
+
if (a) {
|
|
313
|
+
clearTimeout(l.current), U(!1), C(!0);
|
|
312
314
|
return;
|
|
313
315
|
}
|
|
314
|
-
const
|
|
315
|
-
(!
|
|
316
|
-
|
|
316
|
+
const M = p.get(), H = M.data;
|
|
317
|
+
(!H || H?.url === c.current) && (!M.loading && H?.imageSrc ? (clearTimeout(l.current), U(!1), C(!0)) : M.loading && (l.current = setTimeout(() => {
|
|
318
|
+
v();
|
|
317
319
|
}, 200)));
|
|
318
320
|
};
|
|
319
|
-
clearTimeout(
|
|
320
|
-
|
|
321
|
-
},
|
|
321
|
+
clearTimeout(l.current), l.current = setTimeout(() => {
|
|
322
|
+
v();
|
|
323
|
+
}, d);
|
|
322
324
|
} else {
|
|
323
|
-
if (
|
|
324
|
-
if (
|
|
325
|
-
|
|
325
|
+
if (S.current !== c.current && (S.current = "", R.current !== "")) {
|
|
326
|
+
if (a)
|
|
327
|
+
L.emit("exposedPauseAd", {
|
|
326
328
|
action: "disabled",
|
|
327
|
-
payload:
|
|
328
|
-
id:
|
|
329
|
-
parentId:
|
|
329
|
+
payload: u.current ? {
|
|
330
|
+
id: u.current.id,
|
|
331
|
+
parentId: u.current.parentId
|
|
330
332
|
} : {}
|
|
331
333
|
});
|
|
332
334
|
else {
|
|
333
|
-
const
|
|
334
|
-
|
|
335
|
+
const v = p.get().data;
|
|
336
|
+
L.emit("exposedPauseAd", {
|
|
335
337
|
action: "disabled",
|
|
336
|
-
payload:
|
|
337
|
-
id:
|
|
338
|
-
parentId:
|
|
338
|
+
payload: R.current === v?.url ? {
|
|
339
|
+
id: v?.id,
|
|
340
|
+
parentId: v?.parentId
|
|
339
341
|
} : {}
|
|
340
342
|
});
|
|
341
343
|
}
|
|
342
|
-
|
|
344
|
+
R.current = "";
|
|
343
345
|
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
+
U(!0), l.current = setTimeout(() => {
|
|
347
|
+
C(!1);
|
|
346
348
|
}, 400);
|
|
347
349
|
}
|
|
348
350
|
return () => {
|
|
349
|
-
|
|
351
|
+
l.current && clearTimeout(l.current);
|
|
350
352
|
};
|
|
351
|
-
}, [
|
|
352
|
-
|
|
353
|
-
}, 1e4) : clearTimeout(
|
|
354
|
-
const q = i && (!
|
|
355
|
-
return
|
|
356
|
-
|
|
357
|
-
}, [q,
|
|
358
|
-
|
|
359
|
-
}, [
|
|
360
|
-
|
|
353
|
+
}, [p, a, A, d, s, g]), I(() => (i && a && !D ? W.current = setTimeout(() => {
|
|
354
|
+
A?.();
|
|
355
|
+
}, 1e4) : clearTimeout(W.current), () => clearTimeout(W.current)), [i, a, D, A]);
|
|
356
|
+
const q = i && (!a || D);
|
|
357
|
+
return I(() => {
|
|
358
|
+
f?.({ rendered: q });
|
|
359
|
+
}, [q, f]), I(() => () => {
|
|
360
|
+
f?.({ rendered: !1 });
|
|
361
|
+
}, [f]), !i || !a && !t.data ? null : /* @__PURE__ */ m(
|
|
362
|
+
ie,
|
|
361
363
|
{
|
|
362
|
-
onClose:
|
|
363
|
-
isClosing:
|
|
364
|
-
onPlay:
|
|
365
|
-
vastUrl:
|
|
366
|
-
product:
|
|
367
|
-
platform:
|
|
368
|
-
platformtype:
|
|
369
|
-
pagetype:
|
|
370
|
-
content:
|
|
371
|
-
adWidth:
|
|
372
|
-
adHeight:
|
|
373
|
-
npa:
|
|
374
|
-
isLat:
|
|
375
|
-
targeting:
|
|
364
|
+
onClose: A,
|
|
365
|
+
isClosing: G,
|
|
366
|
+
onPlay: j,
|
|
367
|
+
vastUrl: g,
|
|
368
|
+
product: n?.product,
|
|
369
|
+
platform: n?.platform,
|
|
370
|
+
platformtype: n?.platformtype,
|
|
371
|
+
pagetype: n?.pagetype,
|
|
372
|
+
content: n?.content,
|
|
373
|
+
adWidth: n?.adWidth,
|
|
374
|
+
adHeight: n?.adHeight,
|
|
375
|
+
npa: n?.npa,
|
|
376
|
+
isLat: n?.is_lat,
|
|
377
|
+
targeting: n?.targeting,
|
|
376
378
|
options: y,
|
|
377
|
-
isDesktop:
|
|
378
|
-
isGptAd:
|
|
379
|
-
gptAdLoaded:
|
|
380
|
-
onGptAdLoaded:
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
sdk: u
|
|
379
|
+
isDesktop: w,
|
|
380
|
+
isGptAd: a,
|
|
381
|
+
gptAdLoaded: D,
|
|
382
|
+
onGptAdLoaded: x,
|
|
383
|
+
externalPauseAdStore: p,
|
|
384
|
+
adContent: t.data,
|
|
385
|
+
sdk: o
|
|
385
386
|
}
|
|
386
387
|
);
|
|
387
388
|
}, ue = ({
|
|
388
389
|
showPauseAd: s,
|
|
389
|
-
pauseAdExternalUrls:
|
|
390
|
-
pauseAdVastUrl:
|
|
391
|
-
videoPlayerController:
|
|
392
|
-
onRenderPauseAd:
|
|
393
|
-
onClosePauseAd:
|
|
390
|
+
pauseAdExternalUrls: h,
|
|
391
|
+
pauseAdVastUrl: r,
|
|
392
|
+
videoPlayerController: o,
|
|
393
|
+
onRenderPauseAd: P,
|
|
394
|
+
onClosePauseAd: f,
|
|
394
395
|
children: y,
|
|
395
|
-
options:
|
|
396
|
+
options: w
|
|
396
397
|
}) => {
|
|
397
|
-
const
|
|
398
|
-
return
|
|
399
|
-
i.current &&
|
|
398
|
+
const k = h ?? r, d = X(), b = Y(), i = T();
|
|
399
|
+
return I(() => d ? (o && (i.current = o, d.addVideoPlayerController(i.current)), () => {
|
|
400
|
+
i.current && d.removeVideoPlayerController(i.current);
|
|
400
401
|
}) : () => {
|
|
401
|
-
}, [
|
|
402
|
-
|
|
402
|
+
}, [d, o]), d ? /* @__PURE__ */ m("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ F(
|
|
403
|
+
z,
|
|
403
404
|
{
|
|
404
405
|
style: y ? { position: "relative" } : {},
|
|
405
|
-
customTheme:
|
|
406
|
-
themeMode:
|
|
406
|
+
customTheme: b.theme,
|
|
407
|
+
themeMode: b.themeMode,
|
|
407
408
|
children: [
|
|
408
409
|
y,
|
|
409
|
-
|
|
410
|
-
|
|
410
|
+
k && /* @__PURE__ */ m(
|
|
411
|
+
ce,
|
|
411
412
|
{
|
|
412
|
-
sdk:
|
|
413
|
+
sdk: d,
|
|
413
414
|
showPauseAd: s,
|
|
414
|
-
externalUrls:
|
|
415
|
-
onClose:
|
|
416
|
-
onRender:
|
|
417
|
-
options:
|
|
415
|
+
externalUrls: k,
|
|
416
|
+
onClose: f,
|
|
417
|
+
onRender: P,
|
|
418
|
+
options: w,
|
|
418
419
|
isDesktop: !0
|
|
419
420
|
}
|
|
420
421
|
)
|
|
@@ -422,20 +423,20 @@ const ee = /* @__PURE__ */ G("div")({
|
|
|
422
423
|
}
|
|
423
424
|
) }) : y;
|
|
424
425
|
};
|
|
425
|
-
class
|
|
426
|
-
constructor(
|
|
427
|
-
super(
|
|
426
|
+
class ve extends Z {
|
|
427
|
+
constructor(h) {
|
|
428
|
+
super(h), this.state = { hasError: !1 };
|
|
428
429
|
}
|
|
429
430
|
static getDerivedStateFromError() {
|
|
430
431
|
return { hasError: !0 };
|
|
431
432
|
}
|
|
432
|
-
componentDidCatch(
|
|
433
|
-
console.error(
|
|
433
|
+
componentDidCatch(h, r) {
|
|
434
|
+
console.error(h, r.componentStack);
|
|
434
435
|
}
|
|
435
436
|
render() {
|
|
436
|
-
return this.state.hasError ? this.props.children : /* @__PURE__ */
|
|
437
|
+
return this.state.hasError ? this.props.children : /* @__PURE__ */ m(ue, { ...this.props });
|
|
437
438
|
}
|
|
438
439
|
}
|
|
439
440
|
export {
|
|
440
|
-
|
|
441
|
+
ve as StreamLayerPauseAd
|
|
441
442
|
};
|