@streamlayer/react 1.20.6 → 1.21.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.
Files changed (55) hide show
  1. package/lib/app/pause-ad.d.ts +1 -1
  2. package/lib/cjs/advertisement.js +29 -29
  3. package/lib/cjs/index.js +1 -1
  4. package/lib/cjs/index2.js +4 -4
  5. package/lib/cjs/insight.js +1 -1
  6. package/lib/cjs/masters2.js +7 -7
  7. package/lib/cjs/notification.js +1 -1
  8. package/lib/cjs/pause-ad.js +1 -1
  9. package/lib/cjs/points.js +1 -1
  10. package/lib/cjs/provider.js +15 -39
  11. package/lib/cjs/useStreamLayerApp2.js +14 -15
  12. package/lib/classic/app/pause-ad.d.ts +1 -1
  13. package/lib/classic/cjs/advertisement.js +29 -29
  14. package/lib/classic/cjs/bet-pack.js +4 -4
  15. package/lib/classic/cjs/index.js +1 -1
  16. package/lib/classic/cjs/insight.js +1 -1
  17. package/lib/classic/cjs/notification.js +1 -1
  18. package/lib/classic/cjs/pause-ad.js +1 -1
  19. package/lib/classic/cjs/points.js +1 -1
  20. package/lib/classic/cjs/provider.js +10 -34
  21. package/lib/classic/cjs/useStreamLayerApp2.js +14 -15
  22. package/lib/classic/es/advertisement.js +2193 -2265
  23. package/lib/classic/es/bet-pack.js +14 -12
  24. package/lib/classic/es/index.js +16 -11
  25. package/lib/classic/es/insight.js +35 -30
  26. package/lib/classic/es/notification.js +108 -103
  27. package/lib/classic/es/pause-ad.js +196 -148
  28. package/lib/classic/es/points.js +28 -23
  29. package/lib/classic/es/provider.js +4290 -10434
  30. package/lib/classic/es/useStreamLayerApp.js +1 -1
  31. package/lib/classic/es/useStreamLayerApp2.js +3249 -5821
  32. package/lib/classic/index.d.ts +1 -1
  33. package/lib/classic/masters.d.ts +1 -1
  34. package/lib/dist/cjs/gamification-feature2.js +1 -1
  35. package/lib/dist/cjs/index.js +1 -1
  36. package/lib/dist/cjs/masters.js +35 -60
  37. package/lib/dist/es/gamification-feature2.js +112 -105
  38. package/lib/dist/es/index.js +12 -7
  39. package/lib/dist/es/masters.js +9837 -18573
  40. package/lib/dist/style.css +1 -1
  41. package/lib/es/advertisement.js +2193 -2265
  42. package/lib/es/index.js +16 -11
  43. package/lib/es/index2.js +12 -10
  44. package/lib/es/insight.js +35 -30
  45. package/lib/es/masters2.js +28 -25
  46. package/lib/es/notification.js +135 -130
  47. package/lib/es/pause-ad.js +196 -148
  48. package/lib/es/points.js +28 -23
  49. package/lib/es/provider.js +4317 -10469
  50. package/lib/es/useStreamLayerApp.js +1 -1
  51. package/lib/es/useStreamLayerApp2.js +3249 -5821
  52. package/lib/index.d.ts +1 -1
  53. package/lib/masters.d.ts +1 -1
  54. package/lib/style.css +1 -1
  55. package/package.json +15 -15
@@ -1,72 +1,101 @@
1
1
  import { jsx as a, jsxs as I } from "react/jsx-runtime";
2
- import { c as K, i as V, s as p, e as L, f as F, j as M, a as _, u as $, b as j, h as q } from "./provider.js";
3
- import { useRef as x, useCallback as C, useState as R, useEffect as b, Component as z } from "react";
4
- import { c as N } from "./vast-client.min-B0NUra1B.js";
5
- const G = {}, H = new N(), w = V(G), E = K("ui:gam-static"), U = (r) => new Promise((e, t) => {
6
- const s = new Image();
7
- s.onload = () => e(r), s.onerror = () => t(), s.src = r;
8
- }), D = () => {
9
- const r = x(0);
10
- return [C(async (e) => {
11
- var t, s, c, o, l, n, u, i, h, m, f;
12
- if ((t = w.get()[e]) != null && t.imageSrc)
2
+ import { j as K, k as F, i as k, s as p, l as M, n as _, e as j, u as q, d as G, h as N } from "./provider.js";
3
+ import "nanostores";
4
+ import { useRef as D, useCallback as L, useState as R, useEffect as T, Component as $ } from "react";
5
+ import "@nanostores/react";
6
+ import "lodash.throttle";
7
+ import "react-dom";
8
+ import "react-countup";
9
+ import { c as z } from "./vast-client.min-B0NUra1B.js";
10
+ const O = {}, W = new z(), b = F(O), E = K("ui:gam-static"), U = (e) => new Promise((s, t) => {
11
+ const n = new Image();
12
+ n.onload = () => s(e), n.onerror = () => t(), n.src = e;
13
+ }), V = () => {
14
+ const e = D(0);
15
+ return [L(async (s) => {
16
+ var t, n, r, d, c, i, h, l, f, g, y;
17
+ if ((t = b.get()[s]) != null && t.imageSrc)
13
18
  return { success: !0 };
14
19
  const v = Date.now();
15
- r.current = v, w.setKey(e, { url: e });
20
+ e.current = v, b.setKey(s, { id: "", url: s });
16
21
  try {
17
- const d = await H.get(e);
18
- if (E.debug(d, "parsedVAST"), r.current === v && w.get()[e].url) {
19
- const y = d.ads.find((g) => g.creatives.length > 0);
20
- if (y) {
21
- E.debug(y, "validAd");
22
- const g = y.creatives.find((S) => S.type === "nonlinear");
23
- if (g) {
24
- E.debug(g, "nonlinear");
25
- const S = (c = (s = g.variations) == null ? void 0 : s[0]) == null ? void 0 : c.staticResource, B = (l = (o = g.variations) == null ? void 0 : o[0]) == null ? void 0 : l.nonlinearClickThroughURLTemplate;
26
- if (S)
27
- return await U(S), w.setKey(e, { url: e, imageSrc: S, adUrl: B }), { success: !0 };
22
+ k.emit("exposedPauseAd", {
23
+ action: "load",
24
+ payload: {}
25
+ });
26
+ const u = await W.get(s);
27
+ if (E.debug(u, "parsedVAST"), e.current === v && b.get()[s].url) {
28
+ const o = u.ads.find((m) => m.creatives.length > 0);
29
+ if (o) {
30
+ E.debug(o, "validAd");
31
+ const m = o.creatives.find((A) => A.type === "nonlinear");
32
+ if (m) {
33
+ E.debug(m, "nonlinear");
34
+ const A = (r = (n = m.variations) == null ? void 0 : n[0]) == null ? void 0 : r.staticResource, C = (c = (d = m.variations) == null ? void 0 : d[0]) == null ? void 0 : c.nonlinearClickThroughURLTemplate;
35
+ if (A)
36
+ return await U(A), b.setKey(s, {
37
+ id: o.id || "",
38
+ url: s,
39
+ imageSrc: A,
40
+ adUrl: C
41
+ }), k.emit("exposedPauseAd", {
42
+ action: "loaded",
43
+ payload: {
44
+ id: o.id || ""
45
+ }
46
+ }), { success: !0 };
28
47
  }
29
- const A = y.creatives.find((S) => S.type === "companion");
30
- E.debug(A, "companion");
31
- const T = (h = (i = (u = (n = A == null ? void 0 : A.variations) == null ? void 0 : n[0]) == null ? void 0 : u.staticResources) == null ? void 0 : i[0]) == null ? void 0 : h.url, P = (f = (m = A == null ? void 0 : A.variations) == null ? void 0 : m[0]) == null ? void 0 : f.companionClickThroughURLTemplate;
32
- if (T)
33
- return await U(T), w.setKey(e, { url: e, imageSrc: T, adUrl: P }), { success: !0 };
48
+ const P = o.creatives.find((A) => A.type === "companion");
49
+ E.debug(P, "companion");
50
+ const w = (f = (l = (h = (i = P == null ? void 0 : P.variations) == null ? void 0 : i[0]) == null ? void 0 : h.staticResources) == null ? void 0 : l[0]) == null ? void 0 : f.url, S = (y = (g = P == null ? void 0 : P.variations) == null ? void 0 : g[0]) == null ? void 0 : y.companionClickThroughURLTemplate;
51
+ if (w)
52
+ return await U(w), b.setKey(s, {
53
+ id: o.id || "",
54
+ url: s,
55
+ imageSrc: w,
56
+ adUrl: S
57
+ }), k.emit("exposedPauseAd", {
58
+ action: "loaded",
59
+ payload: {
60
+ id: o.id || ""
61
+ }
62
+ }), { success: !0 };
34
63
  }
35
64
  }
36
- } catch (d) {
37
- console.error("Error parsing VAST", d);
65
+ } catch (u) {
66
+ console.error("Error parsing VAST", u);
38
67
  }
39
68
  return { success: !1 };
40
- }, []), w];
41
- }, O = /* @__PURE__ */ p("div")({
69
+ }, []), b];
70
+ }, X = /* @__PURE__ */ p("div")({
42
71
  name: "PauseAdOverlay",
43
72
  class: "pw9gih8",
44
73
  propsAsIs: !1
45
- }), J = /* @__PURE__ */ p("div")({
74
+ }), H = /* @__PURE__ */ p("div")({
46
75
  name: "PauseAdContent",
47
76
  class: "p8lpomy",
48
77
  propsAsIs: !1
49
- }), Q = /* @__PURE__ */ p("div")({
78
+ }), J = /* @__PURE__ */ p("div")({
50
79
  name: "PauseAdGradientRight",
51
80
  class: "pv7u167",
52
81
  propsAsIs: !1
53
- }), W = /* @__PURE__ */ p("div")({
82
+ }), Q = /* @__PURE__ */ p("div")({
54
83
  name: "PauseAdGradientBottom",
55
84
  class: "p1kh2yb0",
56
85
  propsAsIs: !1
57
- }), X = /* @__PURE__ */ p("div")({
86
+ }), Y = /* @__PURE__ */ p("div")({
58
87
  name: "PauseAdTopLeft",
59
88
  class: "pl8f94x",
60
89
  propsAsIs: !1
61
- }), Y = /* @__PURE__ */ p("h2")({
90
+ }), Z = /* @__PURE__ */ p("h2")({
62
91
  name: "PauseAdTitle",
63
92
  class: "p1m6zmrt",
64
93
  propsAsIs: !1
65
- }), Z = /* @__PURE__ */ p("p")({
94
+ }), ee = /* @__PURE__ */ p("p")({
66
95
  name: "PauseAdCaption",
67
96
  class: "pm3vwfa",
68
97
  propsAsIs: !1
69
- }), ee = /* @__PURE__ */ p("div")({
98
+ }), se = /* @__PURE__ */ p("div")({
70
99
  name: "PauseAdBottomLeft",
71
100
  class: "p1tibuhw",
72
101
  propsAsIs: !1
@@ -74,176 +103,195 @@ const G = {}, H = new N(), w = V(G), E = K("ui:gam-static"), U = (r) => new Prom
74
103
  name: "PauseAdPlayButton",
75
104
  class: "ptqqrqd",
76
105
  propsAsIs: !1
77
- }), se = /* @__PURE__ */ p("div")({
106
+ }), te = /* @__PURE__ */ p("div")({
78
107
  name: "PauseAdSidebar",
79
108
  class: "p14estxv",
80
109
  propsAsIs: !1
81
- }), ne = /* @__PURE__ */ p("span")({
110
+ }), oe = /* @__PURE__ */ p("span")({
82
111
  name: "PauseAdTitleDescription",
83
112
  class: "p1dpvfl1",
84
113
  propsAsIs: !1
85
- }), k = /* @__PURE__ */ p("img")({
114
+ }), B = /* @__PURE__ */ p("img")({
86
115
  name: "ExternalAdContainer",
87
116
  class: "ezfmabr",
88
117
  propsAsIs: !1
89
- }), te = ({ vastUrl: r }) => {
90
- var e;
91
- const [, t] = D(), s = _(t, { keys: [r] });
92
- return (e = s == null ? void 0 : s[r]) != null && e.imageSrc ? s[r].adUrl ? /* @__PURE__ */ a("a", { href: s[r].adUrl, target: "_blank", rel: "noopener noreferrer", children: /* @__PURE__ */ a(k, { src: s[r].imageSrc }) }) : /* @__PURE__ */ a(k, { src: s[r].imageSrc }) : null;
93
- }, ae = ({ isClosing: r, title: e, caption: t, onPlay: s, onClose: c, vastUrl: o, options: l }) => {
94
- const n = (l == null ? void 0 : l.showPauseButton) ?? !0, { ref: u, focusSelf: i } = F.useFocusable({
118
+ }), ae = ({ vastUrl: e, isDesktop: s }) => {
119
+ var t;
120
+ const [, n] = V(), r = j(n, { keys: [e] });
121
+ return T(() => {
122
+ r && r[e] && r[e].imageSrc && r[e].id && k.emit("exposedPauseAd", {
123
+ action: "rendered",
124
+ payload: {
125
+ id: r[e].id
126
+ }
127
+ });
128
+ }, [r, e]), (t = r == null ? void 0 : r[e]) != null && t.imageSrc ? !r[e].adUrl || !s ? /* @__PURE__ */ a(B, { src: r[e].imageSrc }) : /* @__PURE__ */ a(
129
+ "a",
130
+ {
131
+ onClick: () => {
132
+ k.emit("exposedPauseAd", {
133
+ action: "navigated",
134
+ payload: {
135
+ id: r[e].id
136
+ }
137
+ });
138
+ },
139
+ href: r[e].adUrl,
140
+ target: "_blank",
141
+ rel: "noopener noreferrer",
142
+ children: /* @__PURE__ */ a(B, { src: r[e].imageSrc })
143
+ }
144
+ ) : null;
145
+ }, ne = ({ isClosing: e, title: s, caption: t, onPlay: n, onClose: r, vastUrl: d, options: c, isDesktop: i }) => {
146
+ const h = (c == null ? void 0 : c.showPauseButton) ?? !0, { ref: l, focusSelf: f } = M.useFocusable({
95
147
  focusKey: "sl-pause-ad-play",
96
- onEnterRelease: s,
148
+ onEnterRelease: n,
97
149
  isFocusBoundary: !0,
98
150
  forceFocus: !0
99
151
  });
100
- return b(() => {
101
- u.current && i();
102
- }, [u, i]), b(() => {
103
- const h = (m) => {
104
- const f = m.keyCode;
105
- if (f === 461 || f === 10009 || f === 27 || f === 8) {
106
- m.preventDefault(), m.stopPropagation(), m.stopImmediatePropagation(), c == null || c();
152
+ return T(() => {
153
+ l.current && f();
154
+ }, [l, f]), T(() => {
155
+ if (!r)
156
+ return () => {
157
+ };
158
+ const g = (y) => {
159
+ const v = y.keyCode;
160
+ if (v === 461 || v === 10009 || v === 27 || v === 8) {
161
+ y.preventDefault(), y.stopPropagation(), y.stopImmediatePropagation(), r();
107
162
  return;
108
163
  }
109
164
  };
110
- return window.addEventListener("keydown", h, { capture: !0 }), () => window.removeEventListener("keydown", h, { capture: !0 });
111
- }, [c]), /* @__PURE__ */ a(O, { className: M(r && "pause-ad-closing"), children: /* @__PURE__ */ I(J, { children: [
165
+ return window.addEventListener("keydown", g, { capture: !0 }), () => window.removeEventListener("keydown", g, { capture: !0 });
166
+ }, [r]), /* @__PURE__ */ a(X, { className: _("SL_PauseAdOverlay", e && "pause-ad-closing"), children: /* @__PURE__ */ I(H, { children: [
167
+ /* @__PURE__ */ a(J, {}),
112
168
  /* @__PURE__ */ a(Q, {}),
113
- /* @__PURE__ */ a(W, {}),
114
- /* @__PURE__ */ I(X, { children: [
115
- /* @__PURE__ */ a(Y, { children: e }),
116
- /* @__PURE__ */ a(Z, { children: t })
169
+ /* @__PURE__ */ I(Y, { children: [
170
+ /* @__PURE__ */ a(Z, { children: s }),
171
+ /* @__PURE__ */ a(ee, { children: t })
117
172
  ] }),
118
- n && /* @__PURE__ */ a(ee, { children: /* @__PURE__ */ a(
173
+ h && /* @__PURE__ */ a(se, { children: /* @__PURE__ */ a(
119
174
  re,
120
175
  {
121
- ref: u,
122
- onClick: s,
123
- onMouseEnter: () => u.current.focus(),
176
+ ref: l,
177
+ onClick: n,
178
+ onMouseEnter: () => l.current.focus(),
124
179
  "aria-label": "Resume playback"
125
180
  }
126
181
  ) }),
127
- /* @__PURE__ */ I(se, { children: [
128
- o && /* @__PURE__ */ a(te, { vastUrl: o }),
129
- /* @__PURE__ */ a(ne, { children: "ADVERTISEMENT" })
182
+ /* @__PURE__ */ I(te, { children: [
183
+ d && /* @__PURE__ */ a(ae, { isDesktop: i, vastUrl: d }),
184
+ /* @__PURE__ */ a(oe, { children: "ADVERTISEMENT" })
130
185
  ] })
131
186
  ] }) });
132
- }, oe = ({
133
- showPauseAd: r,
134
- vastUrls: e,
135
- title: t,
136
- caption: s,
137
- onPlay: c,
138
- onClose: o,
139
- onRender: l,
140
- options: n
141
- }) => {
142
- const u = (n == null ? void 0 : n.pauseAdDelay) ?? 5e3, [i, h] = R(!1), [m, f] = R(!1), v = x(), d = e == null ? void 0 : e[0].url, y = x(d);
143
- y.current = d;
144
- const [g, A] = D();
145
- return b(() => {
146
- if (r && d) {
147
- L.emit("exposedPauseAd", {
187
+ }, ie = ({ showPauseAd: e, vastUrls: s, title: t, caption: n, sdk: r, onClose: d, onRender: c, options: i, isDesktop: h }) => {
188
+ const l = (i == null ? void 0 : i.pauseAdDelay) ?? 5e3, [f, g] = R(!1), [y, v] = R(!1), u = D(), o = s == null ? void 0 : s[0].url, m = D(o);
189
+ m.current = o;
190
+ const [P, w] = V(), S = L(() => {
191
+ d && (k.emit("exposedPauseAd", {
192
+ action: "closed",
193
+ payload: {}
194
+ }), d());
195
+ }, [d]), A = L(() => {
196
+ r.controlVideoPlayer({ play: !0 });
197
+ }, [r]);
198
+ return T(() => {
199
+ if (e && o) {
200
+ k.emit("exposedPauseAd", {
148
201
  action: "enabled",
149
202
  payload: {}
150
- }), g(d).then((P) => {
151
- y.current === d && (P == null ? void 0 : P.success) !== !0 && (clearTimeout(v.current), o == null || o());
203
+ }), P(o).then((x) => {
204
+ m.current === o && (x == null ? void 0 : x.success) !== !0 && (clearTimeout(u.current), S == null || S());
152
205
  }).catch(() => {
153
- y.current === d && (clearTimeout(v.current), o == null || o());
206
+ m.current === o && (clearTimeout(u.current), S == null || S());
154
207
  });
155
- const T = () => {
156
- var P;
157
- (P = A.get()[y.current]) != null && P.imageSrc ? (clearTimeout(v.current), f(!1), h(!0), L.emit("exposedPauseAd", {
158
- action: "rendered",
159
- payload: {}
160
- })) : v.current = setTimeout(() => {
161
- T();
208
+ const C = () => {
209
+ const x = w.get()[m.current];
210
+ x != null && x.imageSrc ? (clearTimeout(u.current), v(!1), g(!0)) : u.current = setTimeout(() => {
211
+ C();
162
212
  }, 200);
163
213
  };
164
- v.current = setTimeout(() => {
165
- T();
166
- }, u);
214
+ u.current = setTimeout(() => {
215
+ C();
216
+ }, l);
167
217
  } else
168
- L.emit("exposedPauseAd", {
218
+ k.emit("exposedPauseAd", {
169
219
  action: "disabled",
170
220
  payload: {}
171
- }), f(!0), v.current = setTimeout(() => {
172
- h(!1);
221
+ }), v(!0), u.current = setTimeout(() => {
222
+ g(!1);
173
223
  }, 400);
174
224
  return () => {
175
- v.current && clearTimeout(v.current);
225
+ u.current && clearTimeout(u.current);
176
226
  };
177
- }, [A, g, o, u, r, d]), b(() => {
178
- l == null || l({ rendered: i });
179
- }, [i, l]), b(() => () => {
180
- l == null || l({ rendered: !1 });
181
- }, [l]), i ? /* @__PURE__ */ a(
182
- ae,
227
+ }, [w, P, S, l, e, o]), T(() => {
228
+ c == null || c({ rendered: f });
229
+ }, [f, c]), T(() => () => {
230
+ c == null || c({ rendered: !1 });
231
+ }, [c]), f ? /* @__PURE__ */ a(
232
+ ne,
183
233
  {
184
- onClose: o,
185
- isClosing: m,
234
+ onClose: S,
235
+ isClosing: y,
186
236
  title: t,
187
- caption: s,
188
- onPlay: c,
189
- vastUrl: d,
190
- options: n
237
+ caption: n,
238
+ onPlay: A,
239
+ vastUrl: o,
240
+ options: i,
241
+ isDesktop: h
191
242
  }
192
243
  ) : null;
193
244
  }, le = ({
194
- showPauseAd: r,
195
- pauseAdVastUrl: e,
245
+ showPauseAd: e,
246
+ pauseAdVastUrl: s,
196
247
  videoPlayerController: t,
197
- onRenderPauseAd: s,
198
- onClosePauseAd: c,
199
- children: o,
200
- options: l
248
+ onRenderPauseAd: n,
249
+ onClosePauseAd: r,
250
+ children: d,
251
+ options: c
201
252
  }) => {
202
- const n = $(), u = j(), i = x(), h = C(() => {
203
- c == null || c();
204
- }, [c]), m = C(() => {
205
- n == null || n.controlVideoPlayer({ play: !0 });
206
- }, [n]);
207
- return b(() => n ? (t && (i.current = t, n.addVideoPlayerController(i.current)), () => {
208
- i.current && n.removeVideoPlayerController(i.current);
253
+ const i = q(), h = G(), l = D();
254
+ return T(() => i ? (t && (l.current = t, i.addVideoPlayerController(l.current)), () => {
255
+ l.current && i.removeVideoPlayerController(l.current);
209
256
  }) : () => {
210
- }, [n, t]), n ? /* @__PURE__ */ a("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ I(
211
- q,
257
+ }, [i, t]), i ? /* @__PURE__ */ a("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ I(
258
+ N,
212
259
  {
213
- style: { position: "relative" },
214
- customTheme: u.theme,
215
- themeMode: u.themeMode,
260
+ style: d ? { position: "relative" } : {},
261
+ customTheme: h.theme,
262
+ themeMode: h.themeMode,
216
263
  children: [
217
- o,
218
- e && /* @__PURE__ */ a(
219
- oe,
264
+ d,
265
+ s && /* @__PURE__ */ a(
266
+ ie,
220
267
  {
221
- showPauseAd: r,
222
- vastUrls: e,
223
- onClose: h,
224
- onRender: s,
225
- onPlay: m,
226
- options: l
268
+ sdk: i,
269
+ showPauseAd: e,
270
+ vastUrls: s,
271
+ onClose: r,
272
+ onRender: n,
273
+ options: c,
274
+ isDesktop: !0
227
275
  }
228
276
  )
229
277
  ]
230
278
  }
231
- ) }) : o;
279
+ ) }) : d;
232
280
  };
233
- class pe extends z {
234
- constructor(e) {
235
- super(e), this.state = { hasError: !1 };
281
+ class Ae extends $ {
282
+ constructor(s) {
283
+ super(s), this.state = { hasError: !1 };
236
284
  }
237
285
  static getDerivedStateFromError() {
238
286
  return { hasError: !0 };
239
287
  }
240
- componentDidCatch(e, t) {
241
- console.error(e, t.componentStack);
288
+ componentDidCatch(s, t) {
289
+ console.error(s, t.componentStack);
242
290
  }
243
291
  render() {
244
292
  return this.state.hasError ? this.props.children : /* @__PURE__ */ a(le, { ...this.props });
245
293
  }
246
294
  }
247
295
  export {
248
- pe as StreamLayerPauseAd
296
+ Ae as StreamLayerPauseAd
249
297
  };
@@ -1,16 +1,21 @@
1
- import { jsxs as l, jsx as t } from "react/jsx-runtime";
1
+ import { jsxs as m, jsx as t } from "react/jsx-runtime";
2
2
  import { useState as u, useEffect as d } from "react";
3
- import { s as a, B as y, m as h, d as S, a as f, F as p, e as r, u as v, b as g, h as b } from "./provider.js";
4
- import { S as k } from "./useStreamLayerApp2.js";
5
- const A = /* @__PURE__ */ a("div")({
3
+ import "@nanostores/react";
4
+ import "nanostores";
5
+ import { s as a, B as y, m as h, f as S, e as f, F as c, i as r, u as v, d as g, h as k } from "./provider.js";
6
+ import "lodash.throttle";
7
+ import "react-dom";
8
+ import "react-countup";
9
+ import { S as A } from "./useStreamLayerApp2.js";
10
+ const I = /* @__PURE__ */ a("div")({
6
11
  name: "PointsContainer",
7
12
  class: "psiob9b",
8
13
  propsAsIs: !1
9
- }), I = /* @__PURE__ */ a("div")({
14
+ }), P = /* @__PURE__ */ a("div")({
10
15
  name: "PointsIcon",
11
16
  class: "p1gqe4lh",
12
17
  propsAsIs: !1
13
- }), P = () => y, T = /* @__PURE__ */ a(P())({
18
+ }), b = () => y, T = /* @__PURE__ */ a(b())({
14
19
  name: "PointsSvg",
15
20
  class: "p15syg2y",
16
21
  propsAsIs: !0
@@ -26,31 +31,31 @@ const A = /* @__PURE__ */ a("div")({
26
31
  name: "PointsValue",
27
32
  class: "prj9b3v",
28
33
  propsAsIs: !1
29
- }), B = ({ points: s, onClick: e }) => /* @__PURE__ */ l(A, { className: h, onClick: e, children: [
30
- /* @__PURE__ */ t(I, { children: /* @__PURE__ */ t(T, { name: "icon-trophy-solid" }) }),
31
- /* @__PURE__ */ l(F, { children: [
34
+ }), B = ({ points: s, onClick: e }) => /* @__PURE__ */ m(I, { className: h, onClick: e, children: [
35
+ /* @__PURE__ */ t(P, { children: /* @__PURE__ */ t(T, { name: "icon-trophy-solid" }) }),
36
+ /* @__PURE__ */ m(F, { children: [
32
37
  /* @__PURE__ */ t(L, { children: "Total points" }),
33
38
  /* @__PURE__ */ t(x, { children: /* @__PURE__ */ t(S, { value: s }) })
34
39
  ] })
35
40
  ] }), C = ({ gamification: s }) => {
36
- const e = s.userSummary.$store, [n, m] = u(0);
41
+ const e = s.userSummary.$store, [o, l] = u(0);
37
42
  return d(() => {
38
- const o = e.subscribe((i) => {
39
- var c;
40
- (c = i == null ? void 0 : i.summary) != null && c.points && m(i.summary.points);
43
+ const n = e.subscribe((i) => {
44
+ var p;
45
+ (p = i == null ? void 0 : i.summary) != null && p.points && l(i.summary.points);
41
46
  });
42
47
  return () => {
43
- o();
48
+ n();
44
49
  };
45
- }, [e]), /* @__PURE__ */ t(B, { points: n, onClick: () => {
46
- const o = s.status.get();
47
- o === p.Suspended ? (s.openFeature(), r.emit("app", {
50
+ }, [e]), /* @__PURE__ */ t(B, { points: o, onClick: () => {
51
+ const n = s.status.get();
52
+ n === c.Suspended ? (s.openFeature(), r.emit("app", {
48
53
  action: "open",
49
54
  payload: {}
50
55
  }), r.emit("interactions", {
51
56
  action: "tap",
52
57
  payload: {}
53
- })) : o === p.Ready && (s.closeFeature(!1), r.emit("app", {
58
+ })) : n === c.Ready && (s.closeFeature(!1), r.emit("app", {
54
59
  action: "close",
55
60
  payload: {}
56
61
  }), r.emit("interactions", {
@@ -61,12 +66,12 @@ const A = /* @__PURE__ */ a("div")({
61
66
  }, j = ({ sdk: s }) => {
62
67
  if (!f(s.featuresList.getStore()))
63
68
  return null;
64
- const e = s.getFeature(k.GAMES);
69
+ const e = s.getFeature(A.GAMES);
65
70
  return e ? /* @__PURE__ */ t(C, { gamification: e }) : null;
66
- }, K = ({ theme: s }) => {
67
- const e = v(), n = g();
68
- return e ? /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ t(b, { customTheme: s ?? n.theme, themeMode: n.themeMode, children: /* @__PURE__ */ t(j, { sdk: e }) }) }) : null;
71
+ }, V = ({ theme: s }) => {
72
+ const e = v(), o = g();
73
+ return e ? /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ t(k, { customTheme: s ?? o.theme, themeMode: o.themeMode, children: /* @__PURE__ */ t(j, { sdk: e }) }) }) : null;
69
74
  };
70
75
  export {
71
- K as StreamLayerSDKPoints
76
+ V as StreamLayerSDKPoints
72
77
  };