@streamlayer/react 1.5.0 → 1.5.2

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.
@@ -1,44 +1,40 @@
1
1
  import { jsx as n, jsxs as p } from "react/jsx-runtime";
2
2
  import { useRef as Q } from "react";
3
- import { f, s as e, c as K, Q as V, g as $, a as H, L as J, u as X, d as Y, S as Z } from "./index2.js";
4
- import { N as g, a as oo, b as no, C as eo, P as v, c as h, S as so } from "./useStreamLayerApp2.js";
5
- const ao = /* @__PURE__ */ e("div")({
3
+ import { f, s as e, c as K, Q as V, g as N, a as H, L as J, u as X, d as Y, S as Z } from "./index2.js";
4
+ import { N as g, a as oo, b as no, C as eo, P as v, c as h, d as so, S as ao } from "./useStreamLayerApp2.js";
5
+ const to = /* @__PURE__ */ e("div")({
6
6
  name: "Container",
7
7
  class: "c5b6wdg",
8
8
  propsAsIs: !1
9
- }), io = "a1rlj479", to = "s35f1di", ro = "sj4471g", lo = "b12050d8", co = "b1d5ybek", po = (o) => o === "left" || o === "right" ? to : lo, mo = (o) => o === "left" || o === "right" ? ro : co, uo = (o) => o === "left" ? "avdxyl3" : o === "right" ? "a1bisd08" : o === "top" ? "a1u9y2aj" : "a1qqaks", N = ({
9
+ }), io = "a1rlj479", ro = "s35f1di", lo = "sj4471g", co = "b12050d8", po = "b1d5ybek", mo = (o) => o === "left" || o === "right" ? ro : co, uo = (o) => o === "left" || o === "right" ? lo : po, vo = (o) => o === "left" ? "avdxyl3" : o === "right" ? "a1bisd08" : o === "top" ? "a1u9y2aj" : "a1qqaks", $ = ({
10
10
  children: o,
11
11
  style: s,
12
- className: i,
13
- enabled: t = !0,
12
+ className: t,
13
+ enabled: i = !0,
14
14
  hiding: a,
15
15
  direction: r = "left",
16
16
  onAnimationEnd: l
17
- }) => /* @__PURE__ */ n(ao, {
17
+ }) => /* @__PURE__ */ n(to, {
18
18
  style: s,
19
- className: f(i, io, uo(r), t && !a && po(r), t && a && mo(r)),
19
+ className: f(t, io, vo(r), i && !a && mo(r), i && a && uo(r)),
20
20
  onAnimationEnd: l,
21
21
  children: o
22
- }), vo = /* @__PURE__ */ e("a")({
22
+ }), Io = /* @__PURE__ */ e("a")({
23
23
  name: "Link",
24
24
  class: "l1sgte8c",
25
25
  propsAsIs: !1
26
- }), Io = /* @__PURE__ */ e("div")({
26
+ }), go = /* @__PURE__ */ e("div")({
27
27
  name: "BannerContainer",
28
28
  class: "b7yfc72",
29
29
  propsAsIs: !1
30
- }), go = () => vo, ho = /* @__PURE__ */ e(go())({
30
+ }), ho = () => Io, bo = /* @__PURE__ */ e(ho())({
31
31
  name: "BannerLink",
32
32
  class: "bejjq94",
33
33
  propsAsIs: !0
34
- }), Ao = /* @__PURE__ */ e("img")({
35
- name: "BannerImg",
36
- class: "b1j94hdr",
37
- propsAsIs: !1
38
- }), bo = ({ promotion: o, promotionId: s, hiding: i, direction: t = "bottom" }) => {
34
+ }), Ao = ({ promotion: o, promotionId: s, hiding: t, direction: i = "bottom" }) => {
39
35
  var a;
40
- return (a = o.additionalBanner) != null && a.imageUrl ? /* @__PURE__ */ n(N, { direction: t, hiding: i, children: /* @__PURE__ */ n(Io, { className: "BannerContainer", children: /* @__PURE__ */ n(
41
- ho,
36
+ return (a = o.additionalBanner) != null && a.imageUrl ? /* @__PURE__ */ n($, { direction: i, hiding: t, children: /* @__PURE__ */ n(go, { className: "BannerContainer", children: /* @__PURE__ */ n(
37
+ bo,
42
38
  {
43
39
  className: "BannerLink",
44
40
  href: o.additionalBanner.url,
@@ -46,8 +42,7 @@ const ao = /* @__PURE__ */ e("div")({
46
42
  "data-promo-id": s,
47
43
  "data-promo-type": o.type,
48
44
  "data-analytics": "banner",
49
- target: "_blank",
50
- children: /* @__PURE__ */ n(Ao, { src: o.additionalBanner.imageUrl, alt: "promo" })
45
+ target: "_blank"
51
46
  }
52
47
  ) }) }) : null;
53
48
  }, yo = /* @__PURE__ */ e("div")({
@@ -58,11 +53,11 @@ const ao = /* @__PURE__ */ e("div")({
58
53
  name: "NotificationContainer",
59
54
  class: "nbxqmol",
60
55
  propsAsIs: !1
61
- }), $o = /* @__PURE__ */ e("div")({
56
+ }), No = /* @__PURE__ */ e("div")({
62
57
  name: "Body",
63
58
  class: "b1gu3eml",
64
59
  propsAsIs: !1
65
- }), No = /* @__PURE__ */ e("div")({
60
+ }), $o = /* @__PURE__ */ e("div")({
66
61
  name: "Title",
67
62
  class: "t1u17zva",
68
63
  propsAsIs: !1
@@ -70,27 +65,27 @@ const ao = /* @__PURE__ */ e("div")({
70
65
  name: "Text",
71
66
  class: "t10ko1g",
72
67
  propsAsIs: !1
73
- }), A = /* @__PURE__ */ e("div")({
68
+ }), b = /* @__PURE__ */ e("div")({
74
69
  name: "Media",
75
70
  class: "mntc42e",
76
71
  propsAsIs: !1
77
- }), So = () => A, w = /* @__PURE__ */ e(So())({
72
+ }), So = () => b, w = /* @__PURE__ */ e(So())({
78
73
  name: "MediaImgFit",
79
74
  class: "ml060eo",
80
75
  propsAsIs: !0
81
- }), Mo = () => A, W = /* @__PURE__ */ e(Mo())({
76
+ }), To = () => b, W = /* @__PURE__ */ e(To())({
82
77
  name: "MediaImgCentered",
83
78
  class: "m1vqlvig",
84
79
  propsAsIs: !0
85
- }), To = () => W, ko = /* @__PURE__ */ e(To())({
80
+ }), Mo = () => W, ko = /* @__PURE__ */ e(Mo())({
86
81
  name: "MediaImgBottom",
87
82
  class: "m1e7tvi5",
88
83
  propsAsIs: !0
89
- }), Bo = () => A, Lo = /* @__PURE__ */ e(Bo())({
84
+ }), Bo = () => b, Lo = /* @__PURE__ */ e(Bo())({
90
85
  name: "MediaImgSolid",
91
86
  class: "mqvntt2",
92
87
  propsAsIs: !0
93
- }), Eo = () => A, Oo = /* @__PURE__ */ e(Eo())({
88
+ }), Eo = () => b, Oo = /* @__PURE__ */ e(Eo())({
94
89
  name: "MediaImgMiddle",
95
90
  class: "m12jtj3u",
96
91
  propsAsIs: !0
@@ -118,18 +113,18 @@ const ao = /* @__PURE__ */ e("div")({
118
113
  [g.SOLID]: Lo,
119
114
  [g.MIDDLE]: Oo
120
115
  }, Ro = ({ src: o, imagePosition: s }) => {
121
- const i = Do[s];
122
- return /* @__PURE__ */ n(i, { children: /* @__PURE__ */ n("img", { src: o, alt: "" }) });
123
- }, Uo = ({ notification: o, promotionId: s, hiding: i, direction: t = "left" }) => {
116
+ const t = Do[s];
117
+ return /* @__PURE__ */ n(t, { children: /* @__PURE__ */ n("img", { src: o, alt: "" }) });
118
+ }, Uo = ({ notification: o, promotionId: s, hiding: t, direction: i = "left" }) => {
124
119
  if (!o || !o.promotion || o.enabled !== oo.NOTIFICATION_ENABLED)
125
120
  return null;
126
- const { title: a, body: r, image: l, promotion: u } = o, { sponsorLogo: m, sponsorLogoMode: c, imagePosition: I, ctaButton: d } = u;
127
- return /* @__PURE__ */ n(N, { direction: t, hiding: i, children: /* @__PURE__ */ p(fo, { children: [
128
- c !== no.NOTIFICATION_SPONSOR_LOGO_NONE && /* @__PURE__ */ n(qo, { children: /* @__PURE__ */ n("img", { src: m, alt: a }) }),
121
+ const { title: a, body: r, image: l, promotion: m } = o, { sponsorLogo: u, sponsorLogoMode: c, imagePosition: I, ctaButton: d } = m;
122
+ return /* @__PURE__ */ n($, { direction: i, hiding: t, children: /* @__PURE__ */ p(fo, { children: [
123
+ c !== no.NOTIFICATION_SPONSOR_LOGO_NONE && /* @__PURE__ */ n(qo, { children: /* @__PURE__ */ n("img", { src: u, alt: a }) }),
129
124
  /* @__PURE__ */ p(yo, { children: [
130
125
  /* @__PURE__ */ n(Ro, { src: l, imagePosition: I }),
131
- /* @__PURE__ */ p($o, { children: [
132
- a && /* @__PURE__ */ n(No, { children: a }),
126
+ /* @__PURE__ */ p(No, { children: [
127
+ a && /* @__PURE__ */ n($o, { children: a }),
133
128
  r && /* @__PURE__ */ n(Co, { children: r })
134
129
  ] }),
135
130
  /* @__PURE__ */ p(_o, { name: "promo-button", style: { color: d == null ? void 0 : d.textColor, backgroundColor: d == null ? void 0 : d.color }, children: [
@@ -215,9 +210,9 @@ const ao = /* @__PURE__ */ e("div")({
215
210
  name: "Title",
216
211
  class: "t3vxzaw",
217
212
  propsAsIs: !1
218
- }), ln = "h10f3u0j", z = ({ promotion: o, promotionId: s, onClose: i }) => {
219
- var t, a, r, l, u, m, c, I, d, C, S, M, T, k, B, L, E, O, x, _, P, j, q, D, R, U;
220
- const b = o.type === v.INGAME_IAB11_LBAR || o.type === v.INGAME_IAB11, y = ((t = o.sponsor) == null ? void 0 : t.logo) && o.logoMode === h.CENTER;
213
+ }), ln = "h10f3u0j", z = ({ promotion: o, promotionId: s, onClose: t }) => {
214
+ var i, a, r, l, m, u, c, I, d, C, S, T, M, k, B, L, E, O, x, _, P, j, q, D, R, U;
215
+ const A = o.type === v.INGAME_IAB11_LBAR || o.type === v.INGAME_IAB11, y = ((i = o.sponsor) == null ? void 0 : i.logo) && o.logoMode === h.CENTER;
221
216
  return /* @__PURE__ */ p(Fo, { className: "PromoOverlay", children: [
222
217
  /* @__PURE__ */ p(Go, { children: [
223
218
  /* @__PURE__ */ p(zo, { className: f(!y && Ko), children: [
@@ -229,7 +224,7 @@ const ao = /* @__PURE__ */ e("div")({
229
224
  paddingLeft: (l = o.sponsor) != null && l.logo && o.logoMode === h.LEFT ? "0px" : "8px"
230
225
  },
231
226
  children: [
232
- ((u = o.sponsor) == null ? void 0 : u.logo) && o.logoMode === h.LEFT && /* @__PURE__ */ n(Ho, { children: (m = o.sponsor) == null ? void 0 : m.name }),
227
+ ((m = o.sponsor) == null ? void 0 : m.logo) && o.logoMode === h.LEFT && /* @__PURE__ */ n(Ho, { children: (u = o.sponsor) == null ? void 0 : u.name }),
233
228
  /* @__PURE__ */ p(Yo, { className: "SponsorText", children: [
234
229
  /* @__PURE__ */ n(Zo, { children: "AD" }),
235
230
  /* @__PURE__ */ n(on, { children: "SPONSORED" })
@@ -238,7 +233,7 @@ const ao = /* @__PURE__ */ e("div")({
238
233
  }
239
234
  )
240
235
  ] }),
241
- /* @__PURE__ */ n(nn, { className: "ClosePromoIcon", onClick: i, children: /* @__PURE__ */ n(sn, { name: "icon-cross" }) })
236
+ /* @__PURE__ */ n(nn, { className: "ClosePromoIcon", onClick: t, children: /* @__PURE__ */ n(sn, { name: "icon-cross" }) })
242
237
  ] }),
243
238
  /* @__PURE__ */ p(Wo, { children: [
244
239
  y && /* @__PURE__ */ n(F, { className: Vo, src: (c = o.sponsor) == null ? void 0 : c.logo, alt: "promo" }),
@@ -246,10 +241,10 @@ const ao = /* @__PURE__ */ e("div")({
246
241
  V,
247
242
  {
248
243
  source: (S = (C = o.banner) == null ? void 0 : C.video) == null ? void 0 : S.url,
249
- poster: (T = (M = o.banner) == null ? void 0 : M.video) == null ? void 0 : T.thumbnailUrl,
250
- aspectRatio: b ? "1/1" : "16/9",
244
+ poster: (M = (T = o.banner) == null ? void 0 : T.video) == null ? void 0 : M.thumbnailUrl,
245
+ aspectRatio: A ? "1/1" : "16/9",
251
246
  onPlay: () => {
252
- $.emit("advertisement", {
247
+ N.emit("advertisement", {
253
248
  action: "videoPlay",
254
249
  payload: {
255
250
  advertisementId: s,
@@ -258,13 +253,13 @@ const ao = /* @__PURE__ */ e("div")({
258
253
  });
259
254
  }
260
255
  }
261
- ) : (k = o.banner) != null && k.imageUrl ? /* @__PURE__ */ n(Qo, { style: b ? { aspectRatio: "1/1" } : {}, src: (B = o.banner) == null ? void 0 : B.imageUrl, alt: "promo" }) : null }),
262
- !b && /* @__PURE__ */ p(G, { children: [
256
+ ) : (k = o.banner) != null && k.imageUrl ? /* @__PURE__ */ n(Qo, { style: A ? { aspectRatio: "1/1" } : {}, src: (B = o.banner) == null ? void 0 : B.imageUrl, alt: "promo" }) : null }),
257
+ !A && /* @__PURE__ */ p(G, { children: [
263
258
  ((L = o.banner) == null ? void 0 : L.title) && /* @__PURE__ */ n(rn, { className: f("AdvTitle", y && ln), children: (E = o.banner) == null ? void 0 : E.title }),
264
259
  ((O = o.banner) == null ? void 0 : O.body) && /* @__PURE__ */ n(Jo, { className: "AdvDescription", children: (x = o.banner) == null ? void 0 : x.body })
265
260
  ] })
266
261
  ] }),
267
- /* @__PURE__ */ n(an, { children: /* @__PURE__ */ n(
262
+ o.buttonType !== so.NO_BUTTON && /* @__PURE__ */ n(an, { children: /* @__PURE__ */ n(
268
263
  tn,
269
264
  {
270
265
  href: (_ = o.banner) == null ? void 0 : _.url,
@@ -287,81 +282,81 @@ const ao = /* @__PURE__ */ e("div")({
287
282
  }), cn = ({
288
283
  children: o,
289
284
  direction: s,
290
- style: i,
291
- className: t,
285
+ style: t,
286
+ className: i,
292
287
  hiding: a
293
- }) => /* @__PURE__ */ n(N, {
288
+ }) => /* @__PURE__ */ n($, {
294
289
  direction: s,
295
- style: i,
290
+ style: t,
296
291
  hiding: a,
297
- className: t,
292
+ className: i,
298
293
  children: /* @__PURE__ */ n(dn, {
299
294
  children: o
300
295
  })
301
296
  }), pn = (o) => (o == null ? void 0 : o.type) === v.INGAME_IAB11_LBAR || (o == null ? void 0 : o.type) === v.INGAME_IAB21_LBAR, mn = (o) => (o == null ? void 0 : o.type) === v.INGAME_IAB11 || (o == null ? void 0 : o.type) === v.INGAME_IAB21, un = ({
302
297
  advertisement: o,
303
298
  close: s,
304
- skipTypeCheck: i,
305
- layoutMode: t = "side-by-side",
299
+ skipTypeCheck: t,
300
+ layoutMode: i = "side-by-side",
306
301
  sidebar: a,
307
302
  isNotification: r,
308
303
  banner: l
309
- }) => r && o.notification ? /* @__PURE__ */ n(Uo, { notification: o.notification, promotionId: o.question.id }) : !a && !l && (i || mn(o.promotion)) ? /* @__PURE__ */ n(wo, { className: "PromoOverlayContainer", children: /* @__PURE__ */ n(z, { promotionId: o.question.id, promotion: o.promotion, onClose: s }) }) : a && (i || pn(o.promotion)) ? /* @__PURE__ */ n(cn, { className: "PromoSidebarContainer", direction: a, hiding: !1, children: /* @__PURE__ */ n(z, { promotionId: o.question.id, promotion: o.promotion, onClose: s }) }) : l ? /* @__PURE__ */ n(
310
- bo,
304
+ }) => o.promotion ? r && o.notification ? /* @__PURE__ */ n(Uo, { notification: o.notification, promotionId: o.question.id }) : !a && !l && (t || mn(o.promotion)) ? /* @__PURE__ */ n(wo, { className: "PromoOverlayContainer", children: /* @__PURE__ */ n(z, { promotionId: o.question.id, promotion: o.promotion, onClose: s }) }) : a && (t || pn(o.promotion)) ? /* @__PURE__ */ n(cn, { className: "PromoSidebarContainer", direction: a, hiding: !1, children: /* @__PURE__ */ n(z, { promotionId: o.question.id, promotion: o.promotion, onClose: s }) }) : l ? /* @__PURE__ */ n(
305
+ Ao,
311
306
  {
312
307
  promotionId: o.question.id,
313
308
  hiding: !1,
314
309
  promotion: o.promotion,
315
310
  direction: l
316
311
  }
317
- ) : null, vn = /* @__PURE__ */ e("div")({
312
+ ) : null : null, vn = /* @__PURE__ */ e("div")({
318
313
  name: "AdvertisementUIWrap",
319
314
  class: "aa6pjif",
320
315
  propsAsIs: !1
321
316
  }), In = (o) => {
322
317
  const s = o.target;
323
318
  if (s instanceof HTMLAnchorElement && s.target === "_blank") {
324
- const i = s.getAttribute("data-promo-id") || "", t = s.getAttribute("data-promo-type") || v.UNSET;
325
- s.getAttribute("data-analytics") === "button" && $.emit("advertisement", {
319
+ const t = s.getAttribute("data-promo-id") || "", i = s.getAttribute("data-promo-type") || v.UNSET;
320
+ s.getAttribute("data-analytics") === "button" && N.emit("advertisement", {
326
321
  action: "buttonSelect",
327
322
  payload: {
328
- advertisementId: i,
329
- advertisementType: t
323
+ advertisementId: t,
324
+ advertisementType: i
330
325
  }
331
- }), s.getAttribute("data-analytics") === "banner" && $.emit("advertisement", {
326
+ }), s.getAttribute("data-analytics") === "banner" && N.emit("advertisement", {
332
327
  action: "bannerSelect",
333
328
  payload: {
334
- advertisementId: i,
335
- advertisementType: t
329
+ advertisementId: t,
330
+ advertisementType: i
336
331
  }
337
332
  });
338
333
  }
339
334
  }, gn = ({
340
335
  gamification: o,
341
336
  layoutMode: s,
342
- skipTypeCheck: i,
343
- sidebar: t,
337
+ skipTypeCheck: t,
338
+ sidebar: i,
344
339
  banner: a,
345
340
  notification: r,
346
341
  isMobileScreen: l,
347
- persistent: u
342
+ persistent: m
348
343
  }) => {
349
- const m = Q(null), c = H(o.advertisement.$store);
350
- J(m, {
344
+ const u = Q(null), c = H(o.advertisement.$store);
345
+ J(u, {
351
346
  enabled: !!c.data,
352
347
  event: "click",
353
348
  listener: In
354
349
  });
355
- const I = !a && !t;
356
- return c.data === void 0 || !u && c.isViewed ? null : /* @__PURE__ */ n(vn, {
357
- ref: m,
350
+ const I = !a && !i;
351
+ return c.data === void 0 || !m && c.isViewed ? null : /* @__PURE__ */ n(vn, {
352
+ ref: u,
358
353
  style: {
359
354
  height: I ? "auto" : "100%"
360
355
  },
361
356
  className: l ? "mobile-view" : "",
362
357
  children: /* @__PURE__ */ n(un, {
363
- skipTypeCheck: i,
364
- sidebar: t,
358
+ skipTypeCheck: t,
359
+ sidebar: i,
365
360
  banner: a,
366
361
  advertisement: c.data,
367
362
  close: c.close,
@@ -372,53 +367,54 @@ const ao = /* @__PURE__ */ e("div")({
372
367
  }, hn = ({
373
368
  sdk: o,
374
369
  sidebar: s,
375
- banner: i,
376
- skipTypeCheck: t,
370
+ banner: t,
371
+ skipTypeCheck: i,
377
372
  layoutMode: a,
378
373
  isMobileScreen: r,
379
374
  persistent: l,
380
- notification: u
375
+ notification: m
381
376
  }) => {
382
- const m = H(o.featuresList.getStore());
383
- if (s && i)
377
+ const u = H(o.featuresList.getStore());
378
+ if (s && t)
384
379
  return /* @__PURE__ */ n("div", {
385
380
  style: {
386
381
  color: "red"
387
382
  },
388
383
  children: "define either sidebar or banner, not both."
389
384
  });
390
- if (!m)
385
+ if (!u)
391
386
  return null;
392
- const c = o.getFeature(so.GAMES);
387
+ const c = o.getFeature(ao.GAMES);
393
388
  return c ? /* @__PURE__ */ n(gn, {
394
389
  gamification: c,
395
390
  sidebar: s,
396
- banner: i,
391
+ banner: t,
397
392
  layoutMode: a,
398
393
  isMobileScreen: r,
399
394
  persistent: l,
400
- notification: u,
401
- skipTypeCheck: t
395
+ notification: m,
396
+ skipTypeCheck: i
402
397
  }) : null;
403
- }, $n = ({
398
+ }, Nn = ({
404
399
  event: o,
405
400
  sidebar: s,
406
- banner: i,
407
- isMobileScreen: t,
401
+ banner: t,
402
+ isMobileScreen: i,
408
403
  persistent: a,
409
- notification: r
404
+ theme: r,
405
+ notification: l
410
406
  }) => {
411
- const l = X();
412
- return l ? /* @__PURE__ */ p("div", { className: "StreamLayerSDK", children: [
413
- /* @__PURE__ */ n(Y, { children: /* @__PURE__ */ n(
407
+ const m = X();
408
+ return m ? /* @__PURE__ */ p("div", { className: "StreamLayerSDK", children: [
409
+ /* @__PURE__ */ n(Y, { customTheme: r, children: /* @__PURE__ */ n(
414
410
  hn,
415
411
  {
416
- sdk: l,
412
+ sdk: m,
417
413
  sidebar: s,
418
- banner: i,
419
- isMobileScreen: t,
414
+ banner: t,
415
+ isMobileScreen: i,
420
416
  persistent: a,
421
- notification: r,
417
+ notification: l,
422
418
  layoutMode: "side-by-side"
423
419
  }
424
420
  ) }),
@@ -426,6 +422,6 @@ const ao = /* @__PURE__ */ e("div")({
426
422
  ] }) : null;
427
423
  };
428
424
  export {
429
- $n as StreamLayerSDKAdvertisement,
425
+ Nn as StreamLayerSDKAdvertisement,
430
426
  hn as StreamLayerSDKAdvertisementUI
431
427
  };