@streamlayer/react 1.3.1 → 1.3.3

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,337 +1,433 @@
1
- import { jsx as o, jsxs as d } from "react/jsx-runtime";
2
- import { useEffect as F, useRef as z, useMemo as W } from "react";
3
- import { a as g, s as n, c as H, Q as K, e as A, u as I, L as Q } from "./provider.js";
4
- import { F as J, u as V, d as X } from "./index2.js";
5
- import { P as u, a as h, S as Y } from "./useStreamLayerApp2.js";
6
- const Z = /* @__PURE__ */ n("div")({
1
+ import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
+ import { useEffect as Q, useRef as J, useMemo as V } from "react";
3
+ import { c as f, s as n, a as K, Q as X, e as $, u as N, L as Y } from "./provider.js";
4
+ import { F as Z, u as oo, d as eo } from "./index2.js";
5
+ import { N as h, a as no, b as so, P as g, c as I, S as io } from "./useStreamLayerApp2.js";
6
+ const ao = /* @__PURE__ */ n("div")({
7
7
  name: "Container",
8
8
  class: "c5b6wdg",
9
9
  propsAsIs: !1
10
- }), ee = "a1rlj479", oe = "s35f1di", ne = "sj4471g", se = "b12050d8", ae = "b1d5ybek", te = (e) => e === "left" || e === "right" ? oe : se, ie = (e) => e === "left" || e === "right" ? ne : ae, re = (e) => e === "left" ? "avdxyl3" : e === "right" ? "a1bisd08" : e === "top" ? "a1u9y2aj" : "a1qqaks", q = ({
11
- children: e,
10
+ }), to = "a1rlj479", ro = "s35f1di", lo = "sj4471g", co = "b12050d8", mo = "b1d5ybek", po = (o) => o === "left" || o === "right" ? ro : co, uo = (o) => o === "left" || o === "right" ? lo : mo, vo = (o) => o === "left" ? "avdxyl3" : o === "right" ? "a1bisd08" : o === "top" ? "a1u9y2aj" : "a1qqaks", k = ({
11
+ children: o,
12
12
  style: s,
13
13
  className: r,
14
- enabled: a = !0,
15
- hiding: t,
16
- direction: i = "left",
17
- onAnimationEnd: l
18
- }) => /* @__PURE__ */ o(Z, {
14
+ enabled: i = !0,
15
+ hiding: a,
16
+ direction: l = "left",
17
+ onAnimationEnd: t
18
+ }) => /* @__PURE__ */ e(ao, {
19
19
  style: s,
20
- className: g(r, ee, re(i), a && !t && te(i), a && t && ie(i)),
21
- onAnimationEnd: l,
22
- children: e
23
- }), le = /* @__PURE__ */ n("a")({
20
+ className: f(r, to, vo(l), i && !a && po(l), i && a && uo(l)),
21
+ onAnimationEnd: t,
22
+ children: o
23
+ }), go = /* @__PURE__ */ n("a")({
24
24
  name: "Link",
25
25
  class: "l1sgte8c",
26
26
  propsAsIs: !1
27
- }), de = /* @__PURE__ */ n("div")({
27
+ }), ho = /* @__PURE__ */ n("div")({
28
28
  name: "BannerContainer",
29
29
  class: "b7yfc72",
30
30
  propsAsIs: !1
31
- }), ce = () => le, pe = /* @__PURE__ */ n(ce())({
31
+ }), Io = () => go, bo = /* @__PURE__ */ n(Io())({
32
32
  name: "BannerLink",
33
33
  class: "bejjq94",
34
34
  propsAsIs: !0
35
- }), me = /* @__PURE__ */ n("img")({
35
+ }), Ao = /* @__PURE__ */ n("img")({
36
36
  name: "BannerImg",
37
37
  class: "b1j94hdr",
38
38
  propsAsIs: !1
39
- }), ue = ({ promotion: e, promotionId: s, hiding: r, direction: a = "bottom" }) => {
40
- var t;
41
- return (t = e.additionalBanner) != null && t.imageUrl ? /* @__PURE__ */ o(q, { direction: a, hiding: r, children: /* @__PURE__ */ o(de, { className: "BannerContainer", children: /* @__PURE__ */ o(
42
- pe,
39
+ }), yo = ({ promotion: o, promotionId: s, hiding: r, direction: i = "bottom" }) => {
40
+ var a;
41
+ return (a = o.additionalBanner) != null && a.imageUrl ? /* @__PURE__ */ e(k, { direction: i, hiding: r, children: /* @__PURE__ */ e(ho, { className: "BannerContainer", children: /* @__PURE__ */ e(
42
+ bo,
43
43
  {
44
44
  className: "BannerLink",
45
- href: e.additionalBanner.url,
46
- style: { backgroundImage: `url(${e.additionalBanner.imageUrl})` },
45
+ href: o.additionalBanner.url,
46
+ style: { backgroundImage: `url(${o.additionalBanner.imageUrl})` },
47
47
  "data-promo-id": s,
48
- "data-promo-type": e.type,
48
+ "data-promo-type": o.type,
49
49
  "data-analytics": "banner",
50
50
  target: "_blank",
51
- children: /* @__PURE__ */ o(me, { src: e.additionalBanner.imageUrl, alt: "promo" })
51
+ children: /* @__PURE__ */ e(Ao, { src: o.additionalBanner.imageUrl, alt: "promo" })
52
52
  }
53
53
  ) }) }) : null;
54
- }, ve = /* @__PURE__ */ n("div")({
54
+ }, fo = /* @__PURE__ */ n("div")({
55
+ name: "NotificationContent",
56
+ class: "n1ku6hz",
57
+ propsAsIs: !1
58
+ }), $o = /* @__PURE__ */ n("div")({
59
+ name: "NotificationContainer",
60
+ class: "nbxqmol",
61
+ propsAsIs: !1
62
+ }), No = /* @__PURE__ */ n("div")({
63
+ name: "Body",
64
+ class: "b1gu3eml",
65
+ propsAsIs: !1
66
+ }), ko = /* @__PURE__ */ n("div")({
67
+ name: "Title",
68
+ class: "t1u17zva",
69
+ propsAsIs: !1
70
+ }), Co = /* @__PURE__ */ n("div")({
71
+ name: "Text",
72
+ class: "t10ko1g",
73
+ propsAsIs: !1
74
+ }), b = /* @__PURE__ */ n("div")({
75
+ name: "Media",
76
+ class: "mntc42e",
77
+ propsAsIs: !1
78
+ }), So = () => b, w = /* @__PURE__ */ n(So())({
79
+ name: "MediaImgFit",
80
+ class: "ml060eo",
81
+ propsAsIs: !0
82
+ }), Mo = () => b, W = /* @__PURE__ */ n(Mo())({
83
+ name: "MediaImgCentered",
84
+ class: "m1vqlvig",
85
+ propsAsIs: !0
86
+ }), To = () => W, Bo = /* @__PURE__ */ n(To())({
87
+ name: "MediaImgBottom",
88
+ class: "m1e7tvi5",
89
+ propsAsIs: !0
90
+ }), Eo = () => b, Lo = /* @__PURE__ */ n(Eo())({
91
+ name: "MediaImgSolid",
92
+ class: "mqvntt2",
93
+ propsAsIs: !0
94
+ }), xo = () => b, Oo = /* @__PURE__ */ n(xo())({
95
+ name: "MediaImgMiddle",
96
+ class: "m12jtj3u",
97
+ propsAsIs: !0
98
+ }), Po = /* @__PURE__ */ n("button")({
99
+ name: "Button",
100
+ class: "bkq1frv",
101
+ propsAsIs: !1
102
+ }), _o = () => K, jo = /* @__PURE__ */ n(_o())({
103
+ name: "StyledChevronRight",
104
+ class: "sis90pl",
105
+ propsAsIs: !0
106
+ }), Do = /* @__PURE__ */ n("div")({
107
+ name: "Logo",
108
+ class: "l9mjmz3",
109
+ propsAsIs: !1
110
+ }), Ro = {
111
+ [h.UNSET]: w,
112
+ [h.FIT]: w,
113
+ [h.CENTERED]: W,
114
+ [h.BOTTOM]: Bo,
115
+ [h.SOLID]: Lo,
116
+ [h.MIDDLE]: Oo
117
+ }, Fo = ({ src: o, imagePosition: s }) => {
118
+ const r = Ro[s];
119
+ return /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("img", { src: o, alt: "" }) });
120
+ }, qo = ({ notification: o, promotionId: s, hiding: r, direction: i = "left" }) => {
121
+ if (!o || !o.promotion || o.enabled !== no.NOTIFICATION_ENABLED)
122
+ return null;
123
+ const { title: a, body: l, image: t, promotion: p } = o, { sponsorLogo: u, sponsorLogoMode: v, imagePosition: m, ctaButton: d } = p;
124
+ return /* @__PURE__ */ e(k, { direction: i, hiding: r, children: /* @__PURE__ */ c($o, { children: [
125
+ v !== so.NOTIFICATION_SPONSOR_LOGO_NONE && /* @__PURE__ */ e(Do, { children: /* @__PURE__ */ e("img", { src: u, alt: a }) }),
126
+ /* @__PURE__ */ c(fo, { children: [
127
+ /* @__PURE__ */ e(Fo, { src: t, imagePosition: m }),
128
+ /* @__PURE__ */ c(No, { children: [
129
+ a && /* @__PURE__ */ e(ko, { children: a }),
130
+ l && /* @__PURE__ */ e(Co, { children: l })
131
+ ] }),
132
+ /* @__PURE__ */ e(Po, { name: "promo-button", style: { color: d == null ? void 0 : d.textColor, backgroundColor: d == null ? void 0 : d.color }, children: (d == null ? void 0 : d.label) || "Open" }),
133
+ /* @__PURE__ */ e(jo, { name: "chevronRight" })
134
+ ] })
135
+ ] }) });
136
+ }, Uo = /* @__PURE__ */ n("div")({
55
137
  name: "OverlayContainer",
56
138
  class: "okzhq2w",
57
139
  propsAsIs: !1
58
- }), he = /* @__PURE__ */ n("div")({
140
+ }), wo = /* @__PURE__ */ n("div")({
59
141
  name: "PromoOverlay",
60
142
  class: "pmgz5i",
61
143
  propsAsIs: !1
62
- }), ye = /* @__PURE__ */ n("div")({
144
+ }), Go = /* @__PURE__ */ n("div")({
63
145
  name: "Header",
64
146
  class: "hyxi3jt",
65
147
  propsAsIs: !1
66
- }), be = /* @__PURE__ */ n("div")({
148
+ }), zo = /* @__PURE__ */ n("div")({
67
149
  name: "HeaderContent",
68
150
  class: "h149e3gp",
69
151
  propsAsIs: !1
70
- }), ge = "h10toh7", D = /* @__PURE__ */ n("img")({
152
+ }), Ho = "h10toh7", G = /* @__PURE__ */ n("img")({
71
153
  name: "SponsorLogo",
72
154
  class: "s1jyea6t",
73
155
  propsAsIs: !1
74
- }), Ae = /* @__PURE__ */ n("div")({
156
+ }), Ko = /* @__PURE__ */ n("div")({
75
157
  name: "SponsorName",
76
158
  class: "szpfa3h",
77
159
  propsAsIs: !1
78
- }), Ie = /* @__PURE__ */ n("div")({
160
+ }), Wo = /* @__PURE__ */ n("div")({
79
161
  name: "Media",
80
162
  class: "m1crmu01",
81
163
  propsAsIs: !1
82
- }), fe = /* @__PURE__ */ n("img")({
164
+ }), Qo = /* @__PURE__ */ n("img")({
83
165
  name: "PromoImg",
84
166
  class: "p1l37r8s",
85
167
  propsAsIs: !1
86
- }), $e = "s1nmch9k", R = /* @__PURE__ */ n("div")({
168
+ }), Jo = "s1nmch9k", z = /* @__PURE__ */ n("div")({
87
169
  name: "Content",
88
170
  class: "c1er0ljd",
89
171
  propsAsIs: !1
90
- }), ke = /* @__PURE__ */ n("div")({
172
+ }), Vo = /* @__PURE__ */ n("div")({
91
173
  name: "Description",
92
174
  class: "dydopmr",
93
175
  propsAsIs: !1
94
- }), Se = /* @__PURE__ */ n("div")({
176
+ }), Xo = /* @__PURE__ */ n("div")({
95
177
  name: "Sponsor",
96
178
  class: "s1w6nt04",
97
179
  propsAsIs: !1
98
- }), Ce = /* @__PURE__ */ n("div")({
180
+ }), Yo = /* @__PURE__ */ n("div")({
99
181
  name: "SponsorText",
100
182
  class: "s1evcmtq",
101
183
  propsAsIs: !1
102
- }), Ne = /* @__PURE__ */ n("div")({
184
+ }), Zo = /* @__PURE__ */ n("div")({
103
185
  name: "ADLogo",
104
186
  class: "awodx0x",
105
187
  propsAsIs: !1
106
- }), Be = /* @__PURE__ */ n("span")({
188
+ }), oe = /* @__PURE__ */ n("span")({
107
189
  name: "SponsoredText",
108
190
  class: "s1q3n6oi",
109
191
  propsAsIs: !1
110
- }), Me = /* @__PURE__ */ n("div")({
192
+ }), ee = /* @__PURE__ */ n("div")({
111
193
  name: "CloseIconWrap",
112
194
  class: "c8d4xfk",
113
195
  propsAsIs: !1
114
- }), Te = () => H, Ee = /* @__PURE__ */ n(Te())({
196
+ }), ne = () => K, se = /* @__PURE__ */ n(ne())({
115
197
  name: "CloseIcon",
116
198
  class: "ct6oobh",
117
199
  propsAsIs: !0
118
- }), Le = /* @__PURE__ */ n("div")({
200
+ }), ie = /* @__PURE__ */ n("div")({
119
201
  name: "ActionBtnWrap",
120
202
  class: "a1gyg7tt",
121
203
  propsAsIs: !1
122
- }), xe = /* @__PURE__ */ n("a")({
204
+ }), ae = /* @__PURE__ */ n("a")({
123
205
  name: "ActionButton",
124
206
  class: "a17rwbtk",
125
207
  propsAsIs: !1
126
- }), _e = /* @__PURE__ */ n("div")({
208
+ }), te = /* @__PURE__ */ n("div")({
127
209
  name: "Title",
128
210
  class: "t3vxzaw",
129
211
  propsAsIs: !1
130
- }), je = "h10f3u0j", G = ({ promotion: e, promotionId: s, onClose: r }) => {
131
- var a, t, i, l, p, m, c, v, f, $, k, S, C, N, B, M, T, E, L, x, _, j, P, O, U, w;
132
- const y = e.type === u.INGAME_IAB11_LBAR || e.type === u.INGAME_IAB11, b = ((a = e.sponsor) == null ? void 0 : a.logo) && e.logoMode === h.CENTER;
133
- return /* @__PURE__ */ d(he, { className: "PromoOverlay", children: [
134
- /* @__PURE__ */ d(ye, { children: [
135
- /* @__PURE__ */ d(be, { className: g(!b && ge), children: [
136
- ((t = e.sponsor) == null ? void 0 : t.logo) && e.logoMode === h.LEFT && /* @__PURE__ */ o(D, { src: (i = e.sponsor) == null ? void 0 : i.logo, alt: "promo" }),
137
- /* @__PURE__ */ d(
138
- Se,
212
+ }), re = "h10f3u0j", H = ({ promotion: o, promotionId: s, onClose: r }) => {
213
+ var i, a, l, t, p, u, v, m, d, C, S, M, T, B, E, L, x, O, P, _, j, D, R, F, q, U;
214
+ const A = o.type === g.INGAME_IAB11_LBAR || o.type === g.INGAME_IAB11, y = ((i = o.sponsor) == null ? void 0 : i.logo) && o.logoMode === I.CENTER;
215
+ return /* @__PURE__ */ c(wo, { className: "PromoOverlay", children: [
216
+ /* @__PURE__ */ c(Go, { children: [
217
+ /* @__PURE__ */ c(zo, { className: f(!y && Ho), children: [
218
+ ((a = o.sponsor) == null ? void 0 : a.logo) && o.logoMode === I.LEFT && /* @__PURE__ */ e(G, { src: (l = o.sponsor) == null ? void 0 : l.logo, alt: "promo" }),
219
+ /* @__PURE__ */ c(
220
+ Xo,
139
221
  {
140
222
  style: {
141
- paddingLeft: (l = e.sponsor) != null && l.logo && e.logoMode === h.LEFT ? "0px" : "8px"
223
+ paddingLeft: (t = o.sponsor) != null && t.logo && o.logoMode === I.LEFT ? "0px" : "8px"
142
224
  },
143
225
  children: [
144
- ((p = e.sponsor) == null ? void 0 : p.logo) && e.logoMode === h.LEFT && /* @__PURE__ */ o(Ae, { children: (m = e.sponsor) == null ? void 0 : m.name }),
145
- /* @__PURE__ */ d(Ce, { className: "SponsorText", children: [
146
- /* @__PURE__ */ o(Ne, { children: "AD" }),
147
- /* @__PURE__ */ o(Be, { children: "SPONSORED" })
226
+ ((p = o.sponsor) == null ? void 0 : p.logo) && o.logoMode === I.LEFT && /* @__PURE__ */ e(Ko, { children: (u = o.sponsor) == null ? void 0 : u.name }),
227
+ /* @__PURE__ */ c(Yo, { className: "SponsorText", children: [
228
+ /* @__PURE__ */ e(Zo, { children: "AD" }),
229
+ /* @__PURE__ */ e(oe, { children: "SPONSORED" })
148
230
  ] })
149
231
  ]
150
232
  }
151
233
  )
152
234
  ] }),
153
- /* @__PURE__ */ o(Me, { className: "ClosePromoIcon", onClick: r, children: /* @__PURE__ */ o(Ee, { name: "icon-cross" }) })
235
+ /* @__PURE__ */ e(ee, { className: "ClosePromoIcon", onClick: r, children: /* @__PURE__ */ e(se, { name: "icon-cross" }) })
154
236
  ] }),
155
- /* @__PURE__ */ d(Ie, { children: [
156
- b && /* @__PURE__ */ o(D, { className: $e, src: (c = e.sponsor) == null ? void 0 : c.logo, alt: "promo" }),
157
- /* @__PURE__ */ o(R, { children: (f = (v = e.banner) == null ? void 0 : v.video) != null && f.url ? /* @__PURE__ */ o(
158
- K,
237
+ /* @__PURE__ */ c(Wo, { children: [
238
+ y && /* @__PURE__ */ e(G, { className: Jo, src: (v = o.sponsor) == null ? void 0 : v.logo, alt: "promo" }),
239
+ /* @__PURE__ */ e(z, { children: (d = (m = o.banner) == null ? void 0 : m.video) != null && d.url ? /* @__PURE__ */ e(
240
+ X,
159
241
  {
160
- source: (k = ($ = e.banner) == null ? void 0 : $.video) == null ? void 0 : k.url,
161
- poster: (C = (S = e.banner) == null ? void 0 : S.video) == null ? void 0 : C.thumbnailUrl,
162
- aspectRatio: y ? "1/1" : "16/9",
242
+ source: (S = (C = o.banner) == null ? void 0 : C.video) == null ? void 0 : S.url,
243
+ poster: (T = (M = o.banner) == null ? void 0 : M.video) == null ? void 0 : T.thumbnailUrl,
244
+ aspectRatio: A ? "1/1" : "16/9",
163
245
  onPlay: () => {
164
- A.emit("advertisement", {
246
+ $.emit("advertisement", {
165
247
  action: "videoPlay",
166
248
  payload: {
167
249
  advertisementId: s,
168
- advertisementType: e.type
250
+ advertisementType: o.type
169
251
  }
170
252
  });
171
253
  }
172
254
  }
173
- ) : (N = e.banner) != null && N.imageUrl ? /* @__PURE__ */ o(fe, { style: y ? { aspectRatio: "1/1" } : {}, src: (B = e.banner) == null ? void 0 : B.imageUrl, alt: "promo" }) : null }),
174
- !y && /* @__PURE__ */ d(R, { children: [
175
- ((M = e.banner) == null ? void 0 : M.title) && /* @__PURE__ */ o(_e, { className: g("AdvTitle", b && je), children: (T = e.banner) == null ? void 0 : T.title }),
176
- ((E = e.banner) == null ? void 0 : E.body) && /* @__PURE__ */ o(ke, { className: "AdvDescription", children: (L = e.banner) == null ? void 0 : L.body })
255
+ ) : (B = o.banner) != null && B.imageUrl ? /* @__PURE__ */ e(Qo, { style: A ? { aspectRatio: "1/1" } : {}, src: (E = o.banner) == null ? void 0 : E.imageUrl, alt: "promo" }) : null }),
256
+ !A && /* @__PURE__ */ c(z, { children: [
257
+ ((L = o.banner) == null ? void 0 : L.title) && /* @__PURE__ */ e(te, { className: f("AdvTitle", y && re), children: (x = o.banner) == null ? void 0 : x.title }),
258
+ ((O = o.banner) == null ? void 0 : O.body) && /* @__PURE__ */ e(Vo, { className: "AdvDescription", children: (P = o.banner) == null ? void 0 : P.body })
177
259
  ] })
178
260
  ] }),
179
- /* @__PURE__ */ o(Le, { children: /* @__PURE__ */ o(
180
- xe,
261
+ /* @__PURE__ */ e(ie, { children: /* @__PURE__ */ e(
262
+ ae,
181
263
  {
182
- href: (x = e.banner) == null ? void 0 : x.url,
264
+ href: (_ = o.banner) == null ? void 0 : _.url,
183
265
  style: {
184
- backgroundColor: ((j = (_ = e.banner) == null ? void 0 : _.ctaButton) == null ? void 0 : j.color) || "#009dc4",
185
- color: ((O = (P = e.banner) == null ? void 0 : P.ctaButton) == null ? void 0 : O.textColor) || "#fff"
266
+ backgroundColor: ((D = (j = o.banner) == null ? void 0 : j.ctaButton) == null ? void 0 : D.color) || "#009dc4",
267
+ color: ((F = (R = o.banner) == null ? void 0 : R.ctaButton) == null ? void 0 : F.textColor) || "#fff"
186
268
  },
187
269
  "data-analytics": "button",
188
270
  "data-promo-id": s,
189
- "data-promo-type": e.type,
271
+ "data-promo-type": o.type,
190
272
  target: "_blank",
191
- children: (w = (U = e.banner) == null ? void 0 : U.ctaButton) == null ? void 0 : w.label
273
+ children: (U = (q = o.banner) == null ? void 0 : q.ctaButton) == null ? void 0 : U.label
192
274
  }
193
275
  ) })
194
276
  ] });
195
- }, Pe = /* @__PURE__ */ n("div")({
277
+ }, le = /* @__PURE__ */ n("div")({
196
278
  name: "SidebarContainer",
197
279
  class: "s1abskp8",
198
280
  propsAsIs: !1
199
- }), Oe = ({
200
- children: e,
281
+ }), de = ({
282
+ children: o,
201
283
  direction: s,
202
284
  style: r,
203
- className: a,
204
- hiding: t
205
- }) => /* @__PURE__ */ o(q, {
285
+ className: i,
286
+ hiding: a
287
+ }) => /* @__PURE__ */ e(k, {
206
288
  direction: s,
207
289
  style: r,
208
- hiding: t,
209
- className: a,
210
- children: /* @__PURE__ */ o(Pe, {
211
- children: e
290
+ hiding: a,
291
+ className: i,
292
+ children: /* @__PURE__ */ e(le, {
293
+ children: o
212
294
  })
213
- }), Ue = (e) => (e == null ? void 0 : e.type) === u.INGAME_IAB11_LBAR || (e == null ? void 0 : e.type) === u.INGAME_IAB21_LBAR, we = (e) => (e == null ? void 0 : e.type) === u.INGAME_IAB11 || (e == null ? void 0 : e.type) === u.INGAME_IAB21, De = ({ advertisement: e, skipTypeCheck: s, layoutMode: r = "side-by-side", sidebar: a, banner: t }) => {
214
- const i = I(e.data);
215
- return !i.data && i.loading ? null : i.error ? /* @__PURE__ */ d("div", { children: [
295
+ }), ce = (o) => (o == null ? void 0 : o.type) === g.INGAME_IAB11_LBAR || (o == null ? void 0 : o.type) === g.INGAME_IAB21_LBAR, me = (o) => (o == null ? void 0 : o.type) === g.INGAME_IAB11 || (o == null ? void 0 : o.type) === g.INGAME_IAB21, pe = ({ advertisement: o, skipTypeCheck: s, layoutMode: r = "side-by-side", sidebar: i, isNotification: a, banner: l }) => {
296
+ const t = N(o.data);
297
+ return !t.data && t.loading ? null : t.error ? /* @__PURE__ */ c("div", { children: [
216
298
  "error ",
217
- /* @__PURE__ */ o("button", { onClick: e.close, children: "close" })
218
- ] }) : i.data ? !a && !t && (s || we(i.data)) ? /* @__PURE__ */ o(ve, { className: "PromoOverlayContainer", children: /* @__PURE__ */ o(G, { promotionId: e.id, promotion: i.data, onClose: e.close }) }) : a && (s || Ue(i.data)) ? /* @__PURE__ */ o(Oe, { className: "PromoSidebarContainer", direction: a, hiding: e.hiding, children: /* @__PURE__ */ o(G, { promotionId: e.id, promotion: i.data, onClose: e.close }) }) : t ? /* @__PURE__ */ o(ue, { promotionId: e.id, hiding: e.hiding, promotion: i.data, direction: t }) : null : /* @__PURE__ */ d("div", { children: [
299
+ /* @__PURE__ */ e("button", { onClick: o.close, children: "close" })
300
+ ] }) : t.data ? a ? /* @__PURE__ */ e(qo, { notification: t.data.notification, promotionId: o.id }) : !i && !l && (s || me(t.data.promotions)) ? /* @__PURE__ */ e(Uo, { className: "PromoOverlayContainer", children: /* @__PURE__ */ e(H, { promotionId: o.id, promotion: t.data.promotions, onClose: o.close }) }) : i && (s || ce(t.data.promotions)) ? /* @__PURE__ */ e(de, { className: "PromoSidebarContainer", direction: i, hiding: o.hiding, children: /* @__PURE__ */ e(H, { promotionId: o.id, promotion: t.data.promotions, onClose: o.close }) }) : l ? /* @__PURE__ */ e(
301
+ yo,
302
+ {
303
+ promotionId: o.id,
304
+ hiding: o.hiding,
305
+ promotion: t.data.promotions,
306
+ direction: l
307
+ }
308
+ ) : null : /* @__PURE__ */ c("div", { children: [
219
309
  "empty promo ",
220
- /* @__PURE__ */ o("button", { onClick: e.close, children: "close" })
310
+ /* @__PURE__ */ e("button", { onClick: o.close, children: "close" })
221
311
  ] });
222
- }, Re = /* @__PURE__ */ n("div")({
312
+ }, ue = /* @__PURE__ */ n("div")({
223
313
  name: "AdvertisementUIWrap",
224
314
  class: "aa6pjif",
225
315
  propsAsIs: !1
226
- }), Ge = (e) => {
227
- const s = e.target;
316
+ }), ve = (o) => {
317
+ const s = o.target;
228
318
  if (s instanceof HTMLAnchorElement && s.target === "_blank") {
229
- const r = s.getAttribute("data-promo-id") || "", a = s.getAttribute("data-promo-type") || u.UNSET;
230
- s.getAttribute("data-analytics") === "button" && A.emit("advertisement", {
319
+ const r = s.getAttribute("data-promo-id") || "", i = s.getAttribute("data-promo-type") || g.UNSET;
320
+ s.getAttribute("data-analytics") === "button" && $.emit("advertisement", {
231
321
  action: "buttonSelect",
232
322
  payload: {
233
323
  advertisementId: r,
234
- advertisementType: a
324
+ advertisementType: i
235
325
  }
236
- }), s.getAttribute("data-analytics") === "banner" && A.emit("advertisement", {
326
+ }), s.getAttribute("data-analytics") === "banner" && $.emit("advertisement", {
237
327
  action: "bannerSelect",
238
328
  payload: {
239
329
  advertisementId: r,
240
- advertisementType: a
330
+ advertisementType: i
241
331
  }
242
332
  });
243
333
  }
244
- }, qe = ({
245
- gamification: e,
334
+ }, ge = ({
335
+ gamification: o,
246
336
  layoutMode: s,
247
337
  skipTypeCheck: r,
248
- sidebar: a,
249
- banner: t,
250
- isMobileScreen: i,
251
- persistent: l
338
+ sidebar: i,
339
+ banner: a,
340
+ notification: l,
341
+ isMobileScreen: t,
342
+ persistent: p
252
343
  }) => {
253
- const p = z(null), m = I(e.advertisement.$list), c = W(
254
- () => e.advertisement.getActiveAdvertisement(l),
344
+ const u = J(null), v = N(o.advertisement.$list), m = V(
345
+ () => o.advertisement.getActiveAdvertisement(p),
255
346
  // fire getActiveNotification when notifications were updated
256
347
  // eslint-disable-next-line react-hooks/exhaustive-deps
257
- [m, l]
348
+ [v, p]
258
349
  );
259
- return Q(p, {
260
- enabled: !!c,
350
+ return Y(u, {
351
+ enabled: !!m,
261
352
  event: "click",
262
- listener: Ge
263
- }), c ? /* @__PURE__ */ o(Re, {
264
- ref: p,
353
+ listener: ve
354
+ }), m ? /* @__PURE__ */ e(ue, {
355
+ ref: u,
265
356
  style: {
266
- height: !t && !a ? "auto" : "100%"
357
+ height: !a && !i ? "auto" : "100%"
267
358
  },
268
- className: i ? "mobile-view" : "",
269
- children: /* @__PURE__ */ o(De, {
359
+ className: t ? "mobile-view" : "",
360
+ children: /* @__PURE__ */ e(pe, {
270
361
  skipTypeCheck: r,
271
- sidebar: a,
272
- banner: t,
273
- advertisement: c,
274
- layoutMode: s
362
+ sidebar: i,
363
+ banner: a,
364
+ advertisement: m,
365
+ layoutMode: s,
366
+ isNotification: l
275
367
  })
276
368
  }) : null;
277
- }, Fe = ({
278
- sdk: e,
369
+ }, he = ({
370
+ sdk: o,
279
371
  sidebar: s,
280
372
  banner: r,
281
- skipTypeCheck: a,
282
- event: t,
283
- layoutMode: i,
284
- isMobileScreen: l,
285
- persistent: p
373
+ skipTypeCheck: i,
374
+ event: a,
375
+ layoutMode: l,
376
+ isMobileScreen: t,
377
+ persistent: p,
378
+ notification: u
286
379
  }) => {
287
380
  const {
288
- deactivate: m
289
- } = J(e);
290
- F(() => {
291
- t ? e.createEventSession(t) : m();
292
- }, [t, m, e]);
293
- const c = I(e.featuresList.getStore());
381
+ deactivate: v
382
+ } = Z(o);
383
+ Q(() => {
384
+ a ? o.createEventSession(a) : v();
385
+ }, [a, v, o]);
386
+ const m = N(o.featuresList.getStore());
294
387
  if (s && r)
295
- return /* @__PURE__ */ o("div", {
388
+ return /* @__PURE__ */ e("div", {
296
389
  style: {
297
390
  color: "red"
298
391
  },
299
392
  children: "define either sidebar or banner, not both."
300
393
  });
301
- if (!c)
394
+ if (!m)
302
395
  return null;
303
- const v = e.getFeature(Y.GAMES);
304
- return v ? /* @__PURE__ */ o(qe, {
305
- gamification: v,
396
+ const d = o.getFeature(io.GAMES);
397
+ return d ? /* @__PURE__ */ e(ge, {
398
+ gamification: d,
306
399
  sidebar: s,
307
400
  banner: r,
308
- layoutMode: i,
309
- isMobileScreen: l,
401
+ layoutMode: l,
402
+ isMobileScreen: t,
310
403
  persistent: p,
311
- skipTypeCheck: a
404
+ notification: u,
405
+ skipTypeCheck: i
312
406
  }) : null;
313
- }, Je = ({
314
- event: e,
407
+ }, $e = ({
408
+ event: o,
315
409
  sidebar: s,
316
410
  banner: r,
317
- isMobileScreen: a,
318
- persistent: t
411
+ isMobileScreen: i,
412
+ persistent: a,
413
+ notification: l
319
414
  }) => {
320
- const i = V();
321
- return i ? /* @__PURE__ */ o("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ o(X, { children: /* @__PURE__ */ o(
322
- Fe,
415
+ const t = oo();
416
+ return t ? /* @__PURE__ */ e("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ e(eo, { children: /* @__PURE__ */ e(
417
+ he,
323
418
  {
324
- sdk: i,
325
- event: e,
419
+ sdk: t,
420
+ event: o,
326
421
  sidebar: s,
327
422
  banner: r,
328
- isMobileScreen: a,
329
- persistent: t,
423
+ isMobileScreen: i,
424
+ persistent: a,
425
+ notification: l,
330
426
  layoutMode: "side-by-side"
331
427
  }
332
428
  ) }) }) : null;
333
429
  };
334
430
  export {
335
- Je as StreamLayerSDKAdvertisement,
336
- Fe as StreamLayerSDKAdvertisementUI
431
+ $e as StreamLayerSDKAdvertisement,
432
+ he as StreamLayerSDKAdvertisementUI
337
433
  };