@streamlayer/react 1.4.1 → 1.5.0

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