@streamlayer/react 1.8.6 → 1.9.1
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/provider.d.ts +1 -0
- package/lib/app/useStreamLayerApp.d.ts +2 -1
- package/lib/cjs/advertisement.js +1 -1
- package/lib/cjs/index2.js +36 -36
- package/lib/cjs/masters2.js +3 -3
- package/lib/cjs/useStreamLayerApp2.js +12 -12
- package/lib/dist/cjs/gamification-feature2.js +1 -1
- package/lib/dist/cjs/masters.js +55 -55
- package/lib/dist/es/gamification-feature2.js +65 -63
- package/lib/dist/es/index.js +3 -3
- package/lib/dist/es/masters.js +4401 -4369
- package/lib/dist/style.css +1 -1
- package/lib/es/advertisement.js +196 -176
- package/lib/es/index2.js +3059 -3040
- package/lib/es/masters2.js +231 -231
- package/lib/es/useStreamLayerApp2.js +1190 -1175
- package/lib/style.css +1 -1
- package/package.json +13 -13
package/lib/es/advertisement.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { e as
|
|
4
|
-
import { N, a as po, b as mo, C as uo, c as
|
|
1
|
+
import { jsx as e, jsxs as v, Fragment as ro } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as U, useState as x, useCallback as So, useEffect as P } from "react";
|
|
3
|
+
import { e as k, s as n, h as Eo, g as lo, i as R, Y as ko, a as co, L as Lo, u as Mo, j as Po, b as Oo, S as T, d as _o } from "./index2.js";
|
|
4
|
+
import { N, a as po, b as mo, C as uo, c as vo, P as M, d as S, A as Bo, e as xo, S as Ro } from "./useStreamLayerApp2.js";
|
|
5
5
|
const Do = /* @__PURE__ */ n("div")({
|
|
6
6
|
name: "Container",
|
|
7
7
|
class: "c5b6wdg",
|
|
8
8
|
propsAsIs: !1
|
|
9
|
-
}),
|
|
9
|
+
}), wo = "a1rlj479", qo = "s35f1di", Vo = "sj4471g", jo = "b12050d8", Uo = "b1d5ybek", Fo = (o) => o === "left" || o === "right" ? qo : jo, zo = (o) => o === "left" || o === "right" ? Vo : Uo, Go = (o) => o === "left" ? "avdxyl3" : o === "right" ? "a1bisd08" : o === "top" ? "a1u9y2aj" : "a1qqaks", F = ({
|
|
10
10
|
children: o,
|
|
11
11
|
style: s,
|
|
12
12
|
className: i,
|
|
@@ -16,7 +16,7 @@ const Do = /* @__PURE__ */ n("div")({
|
|
|
16
16
|
onAnimationEnd: c
|
|
17
17
|
}) => /* @__PURE__ */ e(Do, {
|
|
18
18
|
style: s,
|
|
19
|
-
className:
|
|
19
|
+
className: k(i, wo, Go(r), t && !l && Fo(r), t && l && zo(r)),
|
|
20
20
|
onAnimationEnd: c,
|
|
21
21
|
children: o
|
|
22
22
|
}), Wo = /* @__PURE__ */ n("a")({
|
|
@@ -36,7 +36,7 @@ const Do = /* @__PURE__ */ n("div")({
|
|
|
36
36
|
if (!((l = o.additionalBanner) != null && l.imageUrl))
|
|
37
37
|
return null;
|
|
38
38
|
let c = (r = o.banner) == null ? void 0 : r.url;
|
|
39
|
-
return c && c.indexOf("http") !== 0 && (c = `https://${c}`), /* @__PURE__ */ e(
|
|
39
|
+
return c && c.indexOf("http") !== 0 && (c = `https://${c}`), /* @__PURE__ */ e(F, { direction: t, hiding: i, children: /* @__PURE__ */ e(Ho, { className: "BannerContainer", children: /* @__PURE__ */ e(
|
|
40
40
|
Yo,
|
|
41
41
|
{
|
|
42
42
|
className: "BannerLink",
|
|
@@ -64,11 +64,11 @@ const Do = /* @__PURE__ */ n("div")({
|
|
|
64
64
|
name: "Text",
|
|
65
65
|
class: "t59zdk1",
|
|
66
66
|
propsAsIs: !1
|
|
67
|
-
}),
|
|
67
|
+
}), z = /* @__PURE__ */ n("div")({
|
|
68
68
|
name: "MediaImgBottom",
|
|
69
69
|
class: "m1ab9fq",
|
|
70
70
|
propsAsIs: !1
|
|
71
|
-
}), ee = () =>
|
|
71
|
+
}), ee = () => z, ne = /* @__PURE__ */ n(ee())({
|
|
72
72
|
name: "MediaImgMiddle",
|
|
73
73
|
class: "m9fsr0y",
|
|
74
74
|
propsAsIs: !0
|
|
@@ -97,29 +97,29 @@ const Do = /* @__PURE__ */ n("div")({
|
|
|
97
97
|
class: "n3n65jf",
|
|
98
98
|
propsAsIs: !1
|
|
99
99
|
}), de = {
|
|
100
|
-
[N.BOTTOM]:
|
|
100
|
+
[N.BOTTOM]: z,
|
|
101
101
|
[N.MIDDLE]: ne
|
|
102
102
|
}, ce = ({ src: o, imagePosition: s }) => {
|
|
103
|
-
const i = de[s] ||
|
|
103
|
+
const i = de[s] || z;
|
|
104
104
|
return /* @__PURE__ */ e(i, { children: /* @__PURE__ */ e("img", { src: o, alt: "" }) });
|
|
105
105
|
}, pe = ({ notification: o, open: s }) => {
|
|
106
106
|
if (!o || !o.promotion || o.enabled !== po.NOTIFICATION_ENABLED)
|
|
107
107
|
return null;
|
|
108
|
-
const { title: i, body: t, image: l, promotion: r } = o, { sponsorLogo: c, sponsorLogoMode:
|
|
109
|
-
return /* @__PURE__ */
|
|
110
|
-
/* @__PURE__ */
|
|
111
|
-
/* @__PURE__ */ e(ce, { src: l, imagePosition:
|
|
112
|
-
/* @__PURE__ */
|
|
108
|
+
const { title: i, body: t, image: l, promotion: r } = o, { sponsorLogo: c, sponsorLogoMode: m, imagePosition: A, ctaButton: a } = r;
|
|
109
|
+
return /* @__PURE__ */ v(le, { className: "SL_Lower_Third_Notification", onClick: s, children: [
|
|
110
|
+
/* @__PURE__ */ v(Qo, { children: [
|
|
111
|
+
/* @__PURE__ */ e(ce, { src: l, imagePosition: A }),
|
|
112
|
+
/* @__PURE__ */ v(Xo, { children: [
|
|
113
113
|
i && /* @__PURE__ */ e(Zo, { children: i }),
|
|
114
114
|
t && /* @__PURE__ */ e(oe, { children: t })
|
|
115
115
|
] })
|
|
116
116
|
] }),
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
|
|
117
|
+
/* @__PURE__ */ v(ae, { children: [
|
|
118
|
+
m !== mo.NOTIFICATION_SPONSOR_LOGO_NONE && /* @__PURE__ */ v(ro, { children: [
|
|
119
119
|
/* @__PURE__ */ e(ie, { children: /* @__PURE__ */ e("img", { src: c, alt: i }) }),
|
|
120
120
|
/* @__PURE__ */ e(re, {})
|
|
121
121
|
] }),
|
|
122
|
-
/* @__PURE__ */
|
|
122
|
+
/* @__PURE__ */ v(te, { name: "promo-button", style: { color: a == null ? void 0 : a.textColor, backgroundColor: a == null ? void 0 : a.color }, children: [
|
|
123
123
|
(a == null ? void 0 : a.ctaIcon) && (a == null ? void 0 : a.ctaIconMode) === uo.CTA_ICON_TRANSPARENT && /* @__PURE__ */ e(se, { src: a == null ? void 0 : a.ctaIcon, alt: "cta-icon" }),
|
|
124
124
|
(a == null ? void 0 : a.label) || "Open"
|
|
125
125
|
] })
|
|
@@ -133,39 +133,39 @@ const Do = /* @__PURE__ */ n("div")({
|
|
|
133
133
|
name: "NotificationContainer",
|
|
134
134
|
class: "nbxqmol",
|
|
135
135
|
propsAsIs: !1
|
|
136
|
-
}),
|
|
136
|
+
}), ve = /* @__PURE__ */ n("div")({
|
|
137
137
|
name: "Body",
|
|
138
138
|
class: "b1gu3eml",
|
|
139
139
|
propsAsIs: !1
|
|
140
|
-
}),
|
|
140
|
+
}), Ae = /* @__PURE__ */ n("div")({
|
|
141
141
|
name: "Title",
|
|
142
142
|
class: "t1u17zva",
|
|
143
143
|
propsAsIs: !1
|
|
144
|
-
}),
|
|
144
|
+
}), ge = /* @__PURE__ */ n("div")({
|
|
145
145
|
name: "Text",
|
|
146
146
|
class: "t10ko1g",
|
|
147
147
|
propsAsIs: !1
|
|
148
|
-
}),
|
|
148
|
+
}), D = /* @__PURE__ */ n("div")({
|
|
149
149
|
name: "Media",
|
|
150
150
|
class: "mntc42e",
|
|
151
151
|
propsAsIs: !1
|
|
152
|
-
}),
|
|
152
|
+
}), he = () => D, no = /* @__PURE__ */ n(he())({
|
|
153
153
|
name: "MediaImgFit",
|
|
154
154
|
class: "ml060eo",
|
|
155
155
|
propsAsIs: !0
|
|
156
|
-
}),
|
|
156
|
+
}), Ie = () => D, Ao = /* @__PURE__ */ n(Ie())({
|
|
157
157
|
name: "MediaImgCentered",
|
|
158
158
|
class: "m1vqlvig",
|
|
159
159
|
propsAsIs: !0
|
|
160
|
-
}), ye = () =>
|
|
160
|
+
}), ye = () => Ao, be = /* @__PURE__ */ n(ye())({
|
|
161
161
|
name: "MediaImgBottom",
|
|
162
162
|
class: "m1e7tvi5",
|
|
163
163
|
propsAsIs: !0
|
|
164
|
-
}), fe = () =>
|
|
164
|
+
}), fe = () => D, Ne = /* @__PURE__ */ n(fe())({
|
|
165
165
|
name: "MediaImgSolid",
|
|
166
166
|
class: "mqvntt2",
|
|
167
167
|
propsAsIs: !0
|
|
168
|
-
}), $e = () =>
|
|
168
|
+
}), $e = () => D, Ce = /* @__PURE__ */ n($e())({
|
|
169
169
|
name: "MediaImgMiddle",
|
|
170
170
|
class: "m12jtj3u",
|
|
171
171
|
propsAsIs: !0
|
|
@@ -173,11 +173,11 @@ const Do = /* @__PURE__ */ n("div")({
|
|
|
173
173
|
name: "CtaIcon",
|
|
174
174
|
class: "ckq1frv",
|
|
175
175
|
propsAsIs: !1
|
|
176
|
-
}),
|
|
176
|
+
}), Se = /* @__PURE__ */ n("button")({
|
|
177
177
|
name: "Button",
|
|
178
178
|
class: "bis90pl",
|
|
179
179
|
propsAsIs: !1
|
|
180
|
-
}),
|
|
180
|
+
}), Ee = () => Eo, ke = /* @__PURE__ */ n(Ee())({
|
|
181
181
|
name: "StyledChevronRight",
|
|
182
182
|
class: "s9mjmz3",
|
|
183
183
|
propsAsIs: !0
|
|
@@ -188,30 +188,30 @@ const Do = /* @__PURE__ */ n("div")({
|
|
|
188
188
|
}), Me = {
|
|
189
189
|
[N.UNSET]: no,
|
|
190
190
|
[N.FIT]: no,
|
|
191
|
-
[N.CENTERED]:
|
|
191
|
+
[N.CENTERED]: Ao,
|
|
192
192
|
[N.BOTTOM]: be,
|
|
193
193
|
[N.SOLID]: Ne,
|
|
194
194
|
[N.MIDDLE]: Ce
|
|
195
|
-
},
|
|
195
|
+
}, Pe = ({ src: o, imagePosition: s }) => {
|
|
196
196
|
const i = Me[s];
|
|
197
197
|
return /* @__PURE__ */ e(i, { children: /* @__PURE__ */ e("img", { src: o, alt: "" }) });
|
|
198
|
-
},
|
|
198
|
+
}, Oe = ({ notification: o, open: s, promotionId: i, hiding: t, direction: l = "left" }) => {
|
|
199
199
|
if (!o || !o.promotion || o.enabled !== po.NOTIFICATION_ENABLED)
|
|
200
200
|
return null;
|
|
201
|
-
if (o.promotion.mode ===
|
|
201
|
+
if (o.promotion.mode === vo.LOWER_THIRD)
|
|
202
202
|
return /* @__PURE__ */ e(pe, { notification: o, open: s });
|
|
203
|
-
const { title: r, body: c, image:
|
|
204
|
-
return /* @__PURE__ */ e(
|
|
205
|
-
|
|
206
|
-
/* @__PURE__ */
|
|
207
|
-
/* @__PURE__ */ e(
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
-
r && /* @__PURE__ */ e(
|
|
210
|
-
c && /* @__PURE__ */ e(
|
|
203
|
+
const { title: r, body: c, image: m, promotion: A } = o, { sponsorLogo: a, sponsorLogoMode: g, imagePosition: u, ctaButton: p } = A;
|
|
204
|
+
return /* @__PURE__ */ e(F, { className: "SL_Rich_Notification", direction: l, hiding: t, children: /* @__PURE__ */ v(ue, { onClick: s, children: [
|
|
205
|
+
g !== mo.NOTIFICATION_SPONSOR_LOGO_NONE && /* @__PURE__ */ e(Le, { children: /* @__PURE__ */ e("img", { src: a, alt: r }) }),
|
|
206
|
+
/* @__PURE__ */ v(me, { children: [
|
|
207
|
+
/* @__PURE__ */ e(Pe, { src: m, imagePosition: u }),
|
|
208
|
+
/* @__PURE__ */ v(ve, { children: [
|
|
209
|
+
r && /* @__PURE__ */ e(Ae, { children: r }),
|
|
210
|
+
c && /* @__PURE__ */ e(ge, { children: c })
|
|
211
211
|
] }),
|
|
212
|
-
/* @__PURE__ */
|
|
213
|
-
(
|
|
214
|
-
(
|
|
212
|
+
/* @__PURE__ */ v(Se, { name: "promo-button", style: { color: p == null ? void 0 : p.textColor, backgroundColor: p == null ? void 0 : p.color }, children: [
|
|
213
|
+
(p == null ? void 0 : p.ctaIcon) && (p == null ? void 0 : p.ctaIconMode) === uo.CTA_ICON_TRANSPARENT && /* @__PURE__ */ e(Te, { src: p == null ? void 0 : p.ctaIcon, alt: "cta-icon" }),
|
|
214
|
+
(p == null ? void 0 : p.label) || "Open"
|
|
215
215
|
] }),
|
|
216
216
|
/* @__PURE__ */ e(ke, { name: "chevronRight" })
|
|
217
217
|
] })
|
|
@@ -220,15 +220,15 @@ const Do = /* @__PURE__ */ n("div")({
|
|
|
220
220
|
name: "OverlayContainer",
|
|
221
221
|
class: "okzhq2w",
|
|
222
222
|
propsAsIs: !1
|
|
223
|
-
}),
|
|
223
|
+
}), go = /* @__PURE__ */ n("div")({
|
|
224
224
|
name: "PromoOverlay",
|
|
225
225
|
class: "pmgz5i",
|
|
226
226
|
propsAsIs: !1
|
|
227
|
-
}),
|
|
227
|
+
}), ho = /* @__PURE__ */ n("div")({
|
|
228
228
|
name: "Header",
|
|
229
229
|
class: "hyxi3jt",
|
|
230
230
|
propsAsIs: !1
|
|
231
|
-
}),
|
|
231
|
+
}), Io = /* @__PURE__ */ n("div")({
|
|
232
232
|
name: "HeaderContent",
|
|
233
233
|
class: "h149e3gp",
|
|
234
234
|
propsAsIs: !1
|
|
@@ -256,11 +256,11 @@ const Do = /* @__PURE__ */ n("div")({
|
|
|
256
256
|
name: "Description",
|
|
257
257
|
class: "dydopmr",
|
|
258
258
|
propsAsIs: !1
|
|
259
|
-
}),
|
|
259
|
+
}), we = /* @__PURE__ */ n("div")({
|
|
260
260
|
name: "Sponsor",
|
|
261
261
|
class: "s1w6nt04",
|
|
262
262
|
propsAsIs: !1
|
|
263
|
-
}),
|
|
263
|
+
}), qe = /* @__PURE__ */ n("div")({
|
|
264
264
|
name: "SponsorText",
|
|
265
265
|
class: "s1evcmtq",
|
|
266
266
|
propsAsIs: !1
|
|
@@ -302,33 +302,33 @@ const Do = /* @__PURE__ */ n("div")({
|
|
|
302
302
|
adPosition: i
|
|
303
303
|
}) => {
|
|
304
304
|
const t = Math.floor(o / 60), l = o - t * 60;
|
|
305
|
-
return t === 0 && l === 0 && s === i ? null : /* @__PURE__ */
|
|
306
|
-
children: [s > 1 && /* @__PURE__ */
|
|
307
|
-
children: [/* @__PURE__ */
|
|
305
|
+
return t === 0 && l === 0 && s === i ? null : /* @__PURE__ */ v(Ge, {
|
|
306
|
+
children: [s > 1 && /* @__PURE__ */ v(ro, {
|
|
307
|
+
children: [/* @__PURE__ */ v(io, {
|
|
308
308
|
children: [i, " of ", s]
|
|
309
309
|
}), /* @__PURE__ */ e(We, {})]
|
|
310
|
-
}), /* @__PURE__ */
|
|
310
|
+
}), /* @__PURE__ */ v(io, {
|
|
311
311
|
children: [t, ":", l < 10 ? `0${l}` : l]
|
|
312
312
|
})]
|
|
313
313
|
});
|
|
314
314
|
}, Ke = (o, s, { onPlay: i, onStop: t, onProgress: l }) => {
|
|
315
315
|
const r = google.ima;
|
|
316
|
-
let c = new r.AdDisplayContainer(o),
|
|
317
|
-
|
|
316
|
+
let c = new r.AdDisplayContainer(o), m = new r.AdsLoader(c), A = new r.AdsRequest(), a;
|
|
317
|
+
m.addEventListener(
|
|
318
318
|
r.AdsManagerLoadedEvent.Type.ADS_MANAGER_LOADED,
|
|
319
319
|
(u) => {
|
|
320
|
-
a = u.getAdsManager(o), i && a.addEventListener(r.AdEvent.Type.STARTED, i), t && a.addEventListener(r.AdEvent.Type.COMPLETE, t), l && a.addEventListener(r.AdEvent.Type.AD_PROGRESS, (
|
|
320
|
+
a = u.getAdsManager(o), i && a.addEventListener(r.AdEvent.Type.STARTED, i), t && a.addEventListener(r.AdEvent.Type.COMPLETE, t), l && a.addEventListener(r.AdEvent.Type.AD_PROGRESS, (p) => l(p.getAdData())), a.init(o.clientWidth, o.clientHeight, r.ViewMode.NORMAL), a.start();
|
|
321
321
|
},
|
|
322
322
|
!1
|
|
323
|
-
),
|
|
323
|
+
), m.addEventListener(
|
|
324
324
|
r.AdErrorEvent.Type.AD_ERROR,
|
|
325
325
|
() => {
|
|
326
326
|
console.log("ad error"), t == null || t();
|
|
327
327
|
},
|
|
328
328
|
!1
|
|
329
|
-
),
|
|
330
|
-
const
|
|
331
|
-
a == null || a.destroy(),
|
|
329
|
+
), A.linearAdSlotWidth = o.clientWidth, A.linearAdSlotHeight = o.clientHeight, A.adTagUrl = s, m.requestAds(A);
|
|
330
|
+
const g = () => {
|
|
331
|
+
a == null || a.destroy(), m == null || m.destroy(), c == null || c.destroy(), c = void 0, m = void 0, A = void 0, a = void 0;
|
|
332
332
|
};
|
|
333
333
|
return () => {
|
|
334
334
|
try {
|
|
@@ -336,7 +336,7 @@ const Do = /* @__PURE__ */ n("div")({
|
|
|
336
336
|
} catch (u) {
|
|
337
337
|
t == null || t(), console.log("AdsManager could not be started", u);
|
|
338
338
|
}
|
|
339
|
-
return
|
|
339
|
+
return g;
|
|
340
340
|
};
|
|
341
341
|
}, Ye = /* @__PURE__ */ n("div")({
|
|
342
342
|
name: "Container",
|
|
@@ -355,17 +355,17 @@ const Do = /* @__PURE__ */ n("div")({
|
|
|
355
355
|
skipAutoClose: r
|
|
356
356
|
}) => {
|
|
357
357
|
var c;
|
|
358
|
-
const
|
|
359
|
-
u(0),
|
|
358
|
+
const m = U(null), [A, a] = x(!1), [g, u] = x(0), [p, I] = x(0), [$, h] = x(0), y = U(), b = So(() => {
|
|
359
|
+
u(0), I(0), h(0), a(!1), s == null || s({
|
|
360
360
|
muted: !1
|
|
361
361
|
});
|
|
362
362
|
}, [s]);
|
|
363
|
-
|
|
364
|
-
if (l != null && l.url &&
|
|
365
|
-
|
|
366
|
-
const f = Ke(
|
|
363
|
+
P(() => {
|
|
364
|
+
if (l != null && l.url && m.current) {
|
|
365
|
+
b();
|
|
366
|
+
const f = Ke(m.current, l.url, {
|
|
367
367
|
onPlay: () => {
|
|
368
|
-
|
|
368
|
+
R.emit("advertisement", {
|
|
369
369
|
action: "videoPlay",
|
|
370
370
|
payload: {
|
|
371
371
|
id: i,
|
|
@@ -376,72 +376,84 @@ const Do = /* @__PURE__ */ n("div")({
|
|
|
376
376
|
}), a(!0);
|
|
377
377
|
},
|
|
378
378
|
onStop: () => {
|
|
379
|
-
t == null || t(),
|
|
379
|
+
t == null || t(), b();
|
|
380
380
|
},
|
|
381
381
|
onProgress: (C) => {
|
|
382
|
-
u(Math.round(C.duration - C.currentTime)),
|
|
382
|
+
u(Math.round(C.duration - C.currentTime)), I(C.totalAds), h(C.adPosition);
|
|
383
383
|
}
|
|
384
384
|
})();
|
|
385
|
-
return
|
|
386
|
-
|
|
385
|
+
return y.current = f, () => {
|
|
386
|
+
y.current = void 0, f();
|
|
387
387
|
};
|
|
388
388
|
}
|
|
389
|
-
}, [l == null ? void 0 : l.url, s,
|
|
389
|
+
}, [l == null ? void 0 : l.url, s, b, i, o.type, t]);
|
|
390
390
|
const O = ((c = o.sponsor) == null ? void 0 : c.logo) && o.logoMode === M.CENTER;
|
|
391
|
-
return /* @__PURE__ */
|
|
391
|
+
return /* @__PURE__ */ v(go, {
|
|
392
392
|
className: "PromoOverlay",
|
|
393
|
-
children: [/* @__PURE__ */
|
|
394
|
-
children: [/* @__PURE__ */ e(
|
|
395
|
-
className:
|
|
393
|
+
children: [/* @__PURE__ */ v(ho, {
|
|
394
|
+
children: [/* @__PURE__ */ e(Io, {
|
|
395
|
+
className: k(!O && yo),
|
|
396
396
|
children: /* @__PURE__ */ e(fo, {
|
|
397
397
|
style: {
|
|
398
398
|
transform: "scale(1.5)"
|
|
399
399
|
},
|
|
400
400
|
children: "Ad"
|
|
401
401
|
})
|
|
402
|
-
}), /* @__PURE__ */
|
|
402
|
+
}), /* @__PURE__ */ v(Je, {
|
|
403
403
|
children: [/* @__PURE__ */ e(He, {
|
|
404
|
-
time:
|
|
405
|
-
adCount:
|
|
404
|
+
time: g,
|
|
405
|
+
adCount: p,
|
|
406
406
|
adPosition: $
|
|
407
407
|
}), r && /* @__PURE__ */ e(lo, {
|
|
408
408
|
className: "ClosePromoIcon",
|
|
409
409
|
close: () => {
|
|
410
410
|
var f;
|
|
411
|
-
(f =
|
|
411
|
+
(f = y.current) == null || f.call(y), t == null || t(), b();
|
|
412
412
|
}
|
|
413
413
|
})]
|
|
414
414
|
})]
|
|
415
415
|
}), /* @__PURE__ */ e(bo, {
|
|
416
|
-
className:
|
|
416
|
+
className: k(Qe, A && Xe, !A && Ze),
|
|
417
417
|
children: /* @__PURE__ */ e(Ye, {
|
|
418
|
-
ref:
|
|
418
|
+
ref: m
|
|
419
419
|
})
|
|
420
420
|
})]
|
|
421
421
|
});
|
|
422
422
|
}, ao = (o) => {
|
|
423
|
-
var s, i, t, l, r, c,
|
|
424
|
-
const {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
423
|
+
var s, i, t, l, r, c, m, A, a, g, u, p, I, $, h, y, b, O, f, C, G, W, H, K, Y, J, Q, X, Z, oo;
|
|
424
|
+
const {
|
|
425
|
+
promotion: d,
|
|
426
|
+
advertisementPaused: No,
|
|
427
|
+
togglePause: E,
|
|
428
|
+
controlVideo: _,
|
|
429
|
+
skipAutoClose: $o,
|
|
430
|
+
promotionId: B,
|
|
431
|
+
onClose: Co,
|
|
432
|
+
markAsViewed: w,
|
|
433
|
+
externalAd: eo
|
|
434
|
+
} = o, q = d.type === S.INGAME_IAB11_LBAR || d.type === S.INGAME_IAB11, V = ((s = d.sponsor) == null ? void 0 : s.logo) && d.logoMode === M.CENTER, To = !!((t = (i = d.banner) == null ? void 0 : i.video) != null && t.url), j = d.autoPlayVideo === Bo.ENABLED;
|
|
435
|
+
if (P(() => {
|
|
436
|
+
E == null || E(To || j);
|
|
437
|
+
}, []), P(() => {
|
|
438
|
+
B && d.type && w && w();
|
|
439
|
+
}, [B, d.type, w]), P(() => () => {
|
|
440
|
+
_ == null || _({ muted: !1 });
|
|
441
|
+
}, [_]), eo)
|
|
442
|
+
return /* @__PURE__ */ e(on, { ...o, externalAd: eo });
|
|
443
|
+
let L = (l = d.banner) == null ? void 0 : l.url;
|
|
444
|
+
return L && L.indexOf("http") !== 0 && (L = `https://${L}`), /* @__PURE__ */ v(go, { className: "PromoOverlay", children: [
|
|
445
|
+
/* @__PURE__ */ v(ho, { children: [
|
|
446
|
+
/* @__PURE__ */ v(Io, { className: k(!V && yo), children: [
|
|
435
447
|
((r = d.sponsor) == null ? void 0 : r.logo) && d.logoMode === M.LEFT && /* @__PURE__ */ e(so, { src: (c = d.sponsor) == null ? void 0 : c.logo, alt: "promo" }),
|
|
436
|
-
/* @__PURE__ */
|
|
437
|
-
|
|
448
|
+
/* @__PURE__ */ v(
|
|
449
|
+
we,
|
|
438
450
|
{
|
|
439
451
|
style: {
|
|
440
|
-
paddingLeft: (
|
|
452
|
+
paddingLeft: (m = d.sponsor) != null && m.logo && d.logoMode === M.LEFT ? "0px" : "8px"
|
|
441
453
|
},
|
|
442
454
|
children: [
|
|
443
|
-
((
|
|
444
|
-
/* @__PURE__ */
|
|
455
|
+
((A = d.sponsor) == null ? void 0 : A.logo) && d.logoMode === M.LEFT && /* @__PURE__ */ e(Be, { children: (a = d.sponsor) == null ? void 0 : a.name }),
|
|
456
|
+
/* @__PURE__ */ v(qe, { className: "SponsorText", children: [
|
|
445
457
|
/* @__PURE__ */ e(fo, { children: "AD" }),
|
|
446
458
|
/* @__PURE__ */ e(Ve, { children: "SPONSORED" })
|
|
447
459
|
] })
|
|
@@ -453,55 +465,55 @@ const Do = /* @__PURE__ */ n("div")({
|
|
|
453
465
|
lo,
|
|
454
466
|
{
|
|
455
467
|
className: "ClosePromoIcon",
|
|
456
|
-
close:
|
|
457
|
-
autoClose: (
|
|
458
|
-
duration:
|
|
459
|
-
isPlaying:
|
|
468
|
+
close: Co,
|
|
469
|
+
autoClose: (g = d.closeTimer) == null ? void 0 : g.auto,
|
|
470
|
+
duration: $o ? 0 : (u = d.closeTimer) == null ? void 0 : u.seconds,
|
|
471
|
+
isPlaying: !No
|
|
460
472
|
}
|
|
461
473
|
)
|
|
462
474
|
] }),
|
|
463
|
-
/* @__PURE__ */
|
|
464
|
-
|
|
465
|
-
/* @__PURE__ */ e(to, { children: ($ = (
|
|
475
|
+
/* @__PURE__ */ v(bo, { children: [
|
|
476
|
+
V && /* @__PURE__ */ e(so, { className: Re, src: (p = d.sponsor) == null ? void 0 : p.logo, alt: "promo" }),
|
|
477
|
+
/* @__PURE__ */ e(to, { children: ($ = (I = d.banner) == null ? void 0 : I.video) != null && $.url ? /* @__PURE__ */ e(
|
|
466
478
|
ko,
|
|
467
479
|
{
|
|
468
|
-
source: (
|
|
469
|
-
poster: (O = (
|
|
480
|
+
source: (y = (h = d.banner) == null ? void 0 : h.video) == null ? void 0 : y.url,
|
|
481
|
+
poster: (O = (b = d.banner) == null ? void 0 : b.video) == null ? void 0 : O.thumbnailUrl,
|
|
470
482
|
aspectRatio: q ? "1/1" : "16/9",
|
|
471
483
|
onPause: () => {
|
|
472
|
-
|
|
484
|
+
j && (E == null || E(!0));
|
|
473
485
|
},
|
|
474
486
|
onPlay: () => {
|
|
475
|
-
|
|
487
|
+
R.emit("advertisement", {
|
|
476
488
|
action: "videoPlay",
|
|
477
489
|
payload: {
|
|
478
|
-
id:
|
|
490
|
+
id: B,
|
|
479
491
|
type: d.type
|
|
480
492
|
}
|
|
481
|
-
}),
|
|
493
|
+
}), E == null || E(!1);
|
|
482
494
|
},
|
|
483
|
-
controlVideo:
|
|
484
|
-
autoPlay:
|
|
495
|
+
controlVideo: _,
|
|
496
|
+
autoPlay: j
|
|
485
497
|
}
|
|
486
498
|
) : (f = d.banner) != null && f.imageUrl ? /* @__PURE__ */ e(xe, { style: q ? { aspectRatio: "1/1" } : {}, src: (C = d.banner) == null ? void 0 : C.imageUrl, alt: "promo" }) : null }),
|
|
487
|
-
!q && /* @__PURE__ */
|
|
488
|
-
((
|
|
489
|
-
((
|
|
499
|
+
!q && /* @__PURE__ */ v(to, { children: [
|
|
500
|
+
((G = d.banner) == null ? void 0 : G.title) && /* @__PURE__ */ e(Fe, { className: k("AdvTitle", V && ze), children: (W = d.banner) == null ? void 0 : W.title }),
|
|
501
|
+
((H = d.banner) == null ? void 0 : H.body) && /* @__PURE__ */ e(De, { className: "AdvDescription", children: (K = d.banner) == null ? void 0 : K.body })
|
|
490
502
|
] })
|
|
491
503
|
] }),
|
|
492
504
|
d.buttonType !== xo.NO_BUTTON && /* @__PURE__ */ e(je, { children: /* @__PURE__ */ e(
|
|
493
505
|
Ue,
|
|
494
506
|
{
|
|
495
|
-
href:
|
|
507
|
+
href: L,
|
|
496
508
|
style: {
|
|
497
|
-
backgroundColor: ((
|
|
498
|
-
color: ((
|
|
509
|
+
backgroundColor: ((J = (Y = d.banner) == null ? void 0 : Y.ctaButton) == null ? void 0 : J.color) || "#009dc4",
|
|
510
|
+
color: ((X = (Q = d.banner) == null ? void 0 : Q.ctaButton) == null ? void 0 : X.textColor) || "#fff"
|
|
499
511
|
},
|
|
500
512
|
"data-analytics": "button",
|
|
501
|
-
"data-promo-id":
|
|
513
|
+
"data-promo-id": B,
|
|
502
514
|
"data-promo-type": d.type,
|
|
503
515
|
target: "_blank",
|
|
504
|
-
children: (
|
|
516
|
+
children: (oo = (Z = d.banner) == null ? void 0 : Z.ctaButton) == null ? void 0 : oo.label
|
|
505
517
|
}
|
|
506
518
|
) })
|
|
507
519
|
] });
|
|
@@ -515,7 +527,7 @@ const Do = /* @__PURE__ */ n("div")({
|
|
|
515
527
|
style: i,
|
|
516
528
|
className: t,
|
|
517
529
|
hiding: l
|
|
518
|
-
}) => /* @__PURE__ */ e(
|
|
530
|
+
}) => /* @__PURE__ */ e(F, {
|
|
519
531
|
direction: s,
|
|
520
532
|
style: i,
|
|
521
533
|
hiding: l,
|
|
@@ -523,7 +535,7 @@ const Do = /* @__PURE__ */ n("div")({
|
|
|
523
535
|
children: /* @__PURE__ */ e(en, {
|
|
524
536
|
children: o
|
|
525
537
|
})
|
|
526
|
-
}), sn = (o) => (o == null ? void 0 : o.type) ===
|
|
538
|
+
}), sn = (o) => (o == null ? void 0 : o.type) === S.INGAME_IAB11_LBAR || (o == null ? void 0 : o.type) === S.INGAME_IAB21_LBAR, tn = (o) => (o == null ? void 0 : o.type) === S.INGAME_IAB11 || (o == null ? void 0 : o.type) === S.INGAME_IAB21, an = ({
|
|
527
539
|
advertisement: o,
|
|
528
540
|
close: s,
|
|
529
541
|
skipTypeCheck: i,
|
|
@@ -531,40 +543,46 @@ const Do = /* @__PURE__ */ n("div")({
|
|
|
531
543
|
layoutMode: l = "side-by-side",
|
|
532
544
|
sidebar: r,
|
|
533
545
|
isNotification: c,
|
|
534
|
-
banner:
|
|
535
|
-
markAsViewed:
|
|
546
|
+
banner: m,
|
|
547
|
+
markAsViewed: A,
|
|
536
548
|
open: a,
|
|
537
|
-
externalAd:
|
|
538
|
-
controlVideo: u
|
|
539
|
-
|
|
549
|
+
externalAd: g,
|
|
550
|
+
controlVideo: u,
|
|
551
|
+
advertisementPaused: p,
|
|
552
|
+
togglePause: I
|
|
553
|
+
}) => o.promotion ? c && o.notification ? /* @__PURE__ */ e(Oe, { open: a, notification: o.notification, promotionId: o.question.id }) : !r && !m && (i || tn(o.promotion)) ? /* @__PURE__ */ e(_e, { className: "PromoOverlayContainer", children: /* @__PURE__ */ e(
|
|
540
554
|
ao,
|
|
541
555
|
{
|
|
542
|
-
markAsViewed:
|
|
556
|
+
markAsViewed: A,
|
|
543
557
|
promotionId: o.question.id,
|
|
544
558
|
promotion: o.promotion,
|
|
545
559
|
onClose: s,
|
|
546
560
|
skipAutoClose: t,
|
|
547
|
-
externalAd:
|
|
548
|
-
controlVideo: u
|
|
561
|
+
externalAd: g,
|
|
562
|
+
controlVideo: u,
|
|
563
|
+
advertisementPaused: p,
|
|
564
|
+
togglePause: I
|
|
549
565
|
}
|
|
550
566
|
) }) : r && (i || sn(o.promotion)) ? /* @__PURE__ */ e(nn, { className: "PromoSidebarContainer", direction: r, hiding: !1, children: /* @__PURE__ */ e(
|
|
551
567
|
ao,
|
|
552
568
|
{
|
|
553
|
-
markAsViewed:
|
|
569
|
+
markAsViewed: A,
|
|
554
570
|
promotionId: o.question.id,
|
|
555
571
|
promotion: o.promotion,
|
|
556
|
-
externalAd:
|
|
572
|
+
externalAd: g,
|
|
557
573
|
onClose: s,
|
|
558
574
|
controlVideo: u,
|
|
559
|
-
skipAutoClose: t
|
|
575
|
+
skipAutoClose: t,
|
|
576
|
+
advertisementPaused: p,
|
|
577
|
+
togglePause: I
|
|
560
578
|
}
|
|
561
|
-
) }) :
|
|
579
|
+
) }) : m ? /* @__PURE__ */ e(
|
|
562
580
|
Jo,
|
|
563
581
|
{
|
|
564
582
|
promotionId: o.question.id,
|
|
565
583
|
hiding: !1,
|
|
566
584
|
promotion: o.promotion,
|
|
567
|
-
direction:
|
|
585
|
+
direction: m
|
|
568
586
|
}
|
|
569
587
|
) : null : null, rn = /* @__PURE__ */ n("div")({
|
|
570
588
|
name: "AdvertisementUIWrap",
|
|
@@ -573,14 +591,14 @@ const Do = /* @__PURE__ */ n("div")({
|
|
|
573
591
|
}), ln = (o) => {
|
|
574
592
|
const s = o.target;
|
|
575
593
|
if (s instanceof HTMLAnchorElement && s.target === "_blank") {
|
|
576
|
-
const i = s.getAttribute("data-promo-id") || "", t = s.getAttribute("data-promo-type") ||
|
|
577
|
-
s.getAttribute("data-analytics") === "button" &&
|
|
594
|
+
const i = s.getAttribute("data-promo-id") || "", t = s.getAttribute("data-promo-type") || S.UNSET;
|
|
595
|
+
s.getAttribute("data-analytics") === "button" && R.emit("advertisement", {
|
|
578
596
|
action: "buttonSelect",
|
|
579
597
|
payload: {
|
|
580
598
|
id: i,
|
|
581
599
|
type: t
|
|
582
600
|
}
|
|
583
|
-
}), s.getAttribute("data-analytics") === "banner" &&
|
|
601
|
+
}), s.getAttribute("data-analytics") === "banner" && R.emit("advertisement", {
|
|
584
602
|
action: "bannerSelect",
|
|
585
603
|
payload: {
|
|
586
604
|
id: i,
|
|
@@ -596,41 +614,43 @@ const Do = /* @__PURE__ */ n("div")({
|
|
|
596
614
|
sidebar: l,
|
|
597
615
|
banner: r,
|
|
598
616
|
notification: c,
|
|
599
|
-
isMobileScreen:
|
|
600
|
-
persistent:
|
|
617
|
+
isMobileScreen: m,
|
|
618
|
+
persistent: A,
|
|
601
619
|
externalAd: a,
|
|
602
|
-
controlVideo:
|
|
620
|
+
controlVideo: g
|
|
603
621
|
}) => {
|
|
604
|
-
var u,
|
|
605
|
-
const $ =
|
|
622
|
+
var u, p, I;
|
|
623
|
+
const $ = U(null), h = co(o.advertisement.$store);
|
|
606
624
|
Lo($, {
|
|
607
|
-
enabled: !!
|
|
625
|
+
enabled: !!h.data,
|
|
608
626
|
event: "click",
|
|
609
627
|
listener: ln
|
|
610
628
|
});
|
|
611
|
-
const
|
|
612
|
-
if (
|
|
629
|
+
const y = !r && !l;
|
|
630
|
+
if (h.data === void 0 || !A && h.isViewed)
|
|
613
631
|
return null;
|
|
614
|
-
const
|
|
632
|
+
const b = ((I = (p = (u = h == null ? void 0 : h.data) == null ? void 0 : u.notification) == null ? void 0 : p.promotion) == null ? void 0 : I.mode) === vo.LOWER_THIRD;
|
|
615
633
|
return /* @__PURE__ */ e(rn, {
|
|
616
634
|
ref: $,
|
|
617
635
|
style: {
|
|
618
|
-
height:
|
|
636
|
+
height: y ? "auto" : "100%"
|
|
619
637
|
},
|
|
620
|
-
className:
|
|
638
|
+
className: k("SL-AdvertisementUIWrap", m && "mobile-view", b && "SL-AdvertisementUIWrap--lower-third"),
|
|
621
639
|
children: /* @__PURE__ */ e(an, {
|
|
622
640
|
skipTypeCheck: t,
|
|
623
641
|
sidebar: l,
|
|
624
642
|
banner: r,
|
|
625
|
-
advertisement:
|
|
626
|
-
|
|
627
|
-
|
|
643
|
+
advertisement: h.data,
|
|
644
|
+
advertisementPaused: h.isPaused,
|
|
645
|
+
togglePause: h.togglePause,
|
|
646
|
+
close: h.close,
|
|
647
|
+
externalAd: a ? h.externalAd : void 0,
|
|
628
648
|
markAsViewed: o.advertisement.markAsViewed,
|
|
629
649
|
open: o.advertisement.open,
|
|
630
650
|
layoutMode: s,
|
|
631
651
|
isNotification: c,
|
|
632
652
|
skipAutoClose: i,
|
|
633
|
-
controlVideo:
|
|
653
|
+
controlVideo: g
|
|
634
654
|
})
|
|
635
655
|
});
|
|
636
656
|
}, cn = ({
|
|
@@ -641,15 +661,15 @@ const Do = /* @__PURE__ */ n("div")({
|
|
|
641
661
|
skipAutoClose: l,
|
|
642
662
|
skipTypeCheck: r,
|
|
643
663
|
layoutMode: c,
|
|
644
|
-
isMobileScreen:
|
|
645
|
-
persistent:
|
|
664
|
+
isMobileScreen: m,
|
|
665
|
+
persistent: A,
|
|
646
666
|
notification: a
|
|
647
667
|
}) => {
|
|
648
|
-
const
|
|
649
|
-
if (
|
|
668
|
+
const g = co(o.featuresList.getStore());
|
|
669
|
+
if (P(() => {
|
|
650
670
|
if (i) {
|
|
651
|
-
const
|
|
652
|
-
|
|
671
|
+
const p = document.createElement("script");
|
|
672
|
+
p.async = !0, p.src = "https://imasdk.googleapis.com/js/sdkloader/ima3.js", document.body.appendChild(p);
|
|
653
673
|
}
|
|
654
674
|
}, [i]), s && t)
|
|
655
675
|
return /* @__PURE__ */ e("div", {
|
|
@@ -665,7 +685,7 @@ const Do = /* @__PURE__ */ n("div")({
|
|
|
665
685
|
},
|
|
666
686
|
children: "externalAd is not supported with banner"
|
|
667
687
|
});
|
|
668
|
-
if (!
|
|
688
|
+
if (!g)
|
|
669
689
|
return null;
|
|
670
690
|
const u = o.getFeature(Ro.GAMES);
|
|
671
691
|
return u ? /* @__PURE__ */ e(dn, {
|
|
@@ -673,15 +693,15 @@ const Do = /* @__PURE__ */ n("div")({
|
|
|
673
693
|
sidebar: s,
|
|
674
694
|
banner: t,
|
|
675
695
|
layoutMode: c,
|
|
676
|
-
isMobileScreen:
|
|
677
|
-
persistent:
|
|
696
|
+
isMobileScreen: m,
|
|
697
|
+
persistent: A,
|
|
678
698
|
notification: a,
|
|
679
699
|
skipTypeCheck: r,
|
|
680
700
|
skipAutoClose: l,
|
|
681
701
|
externalAd: i,
|
|
682
702
|
controlVideo: o.controlVideoPlayer
|
|
683
703
|
}) : null;
|
|
684
|
-
},
|
|
704
|
+
}, An = ({
|
|
685
705
|
event: o,
|
|
686
706
|
sidebar: s,
|
|
687
707
|
banner: i,
|
|
@@ -689,22 +709,22 @@ const Do = /* @__PURE__ */ n("div")({
|
|
|
689
709
|
skipAutoClose: l,
|
|
690
710
|
persistent: r,
|
|
691
711
|
theme: c,
|
|
692
|
-
notification:
|
|
693
|
-
skipTypeCheck:
|
|
712
|
+
notification: m,
|
|
713
|
+
skipTypeCheck: A,
|
|
694
714
|
externalAd: a
|
|
695
715
|
}) => {
|
|
696
|
-
const
|
|
697
|
-
return
|
|
698
|
-
/* @__PURE__ */ e(_o, { customTheme: c ??
|
|
716
|
+
const g = Mo(), u = Po(), p = Oo();
|
|
717
|
+
return g ? a && !u.promotionExternalAd ? o !== void 0 && /* @__PURE__ */ e(T, { event: o }) : !a && u.promotionExternalAd ? o !== void 0 && /* @__PURE__ */ e(T, { event: o }) : s && !u.promotionSidebar ? o !== void 0 && /* @__PURE__ */ e(T, { event: o }) : i && !u.promotionBanner ? o !== void 0 && /* @__PURE__ */ e(T, { event: o }) : m && !u.promotionNotification ? o !== void 0 && /* @__PURE__ */ e(T, { event: o }) : !i && !s && !m && !u.promotionOverlay ? o !== void 0 && /* @__PURE__ */ e(T, { event: o }) : /* @__PURE__ */ v("div", { className: "StreamLayerSDK", children: [
|
|
718
|
+
/* @__PURE__ */ e(_o, { customTheme: c ?? p, children: /* @__PURE__ */ e(
|
|
699
719
|
cn,
|
|
700
720
|
{
|
|
701
|
-
sdk:
|
|
721
|
+
sdk: g,
|
|
702
722
|
sidebar: s,
|
|
703
723
|
banner: i,
|
|
704
724
|
isMobileScreen: t,
|
|
705
725
|
persistent: r,
|
|
706
|
-
notification:
|
|
707
|
-
skipTypeCheck:
|
|
726
|
+
notification: m,
|
|
727
|
+
skipTypeCheck: A,
|
|
708
728
|
skipAutoClose: l,
|
|
709
729
|
layoutMode: "side-by-side",
|
|
710
730
|
externalAd: a
|
|
@@ -714,6 +734,6 @@ const Do = /* @__PURE__ */ n("div")({
|
|
|
714
734
|
] }) : null;
|
|
715
735
|
};
|
|
716
736
|
export {
|
|
717
|
-
|
|
737
|
+
An as StreamLayerSDKAdvertisement,
|
|
718
738
|
cn as StreamLayerSDKAdvertisementUI
|
|
719
739
|
};
|