@streamlayer/react 1.0.0 → 1.1.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.
package/lib/es/app.js CHANGED
@@ -1,12 +1,12 @@
1
- var he = Object.defineProperty;
2
- var ve = (e, s, n) => s in e ? he(e, s, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[s] = n;
3
- var g = (e, s, n) => (ve(e, typeof s != "symbol" ? s + "" : s, n), n);
4
- import { jsx as t, jsxs as y, Fragment as D } from "react/jsx-runtime";
5
- import { a3 as V, u, F as ge, s as h, T as ie, c as me, x as ye, a as ke, N as fe, k as Ne, M as be, b as Se, e as Ie, g as $e, f as Ce, O as re, m as q, h as Ee, C as we, i as Ae, n as ae, j as Le, l as De, o as Te, q as U, t as xe, v as le, w as F, I as Oe, y as Re, r as Ve, A as qe, B as Pe, D as Qe, E as _e, G as Ue, H as O, J as B, $ as Fe, P as Ke, K as Me, L as ze, R as Be, U as We, V as P, Z as je, _ as Ge, p as W, a0 as He, W as Xe, X as Ye, Y as Ze, a4 as Je, a1 as de, a2 as j } from "./index2.js";
6
- import { createContext as es, useContext as K, useRef as L, useState as $, useEffect as k, useTransition as ss, lazy as ns, useMemo as w, Suspense as ts, useLayoutEffect as os, useCallback as G } from "react";
7
- import { C as E, c as H, Q as R, S as x } from "./useStreamLayerApp2.js";
1
+ var ge = Object.defineProperty;
2
+ var me = (e, s, n) => s in e ? ge(e, s, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[s] = n;
3
+ var g = (e, s, n) => me(e, typeof s != "symbol" ? s + "" : s, n);
4
+ import { jsx as t, jsxs as m, Fragment as L } from "react/jsx-runtime";
5
+ import { a3 as V, u, F as fe, s as h, T as re, i as ke, x as ye, a as Ne, N as be, k as Se, M as Ie, b as Ee, e as we, C as Ae, f as Ce, O as ae, m as P, l as $e, g as Le, h as De, n as le, j as Te, o as xe, q as Oe, r as M, t as Re, v as de, w as U, y as Ve, z as Pe, I as Q, c as ce, B as Qe, D as _e, E as qe, G as Fe, H as x, J as G, K as Ke, L as Me, P as Ue, Q as ze, U as Be, V as We, W as _, _ as Ge, p as q, $ as He, a0 as je, X as Xe, Y as Ye, Z as Ze, a4 as Je, a1 as pe, a2 as H } from "./index2.js";
6
+ import { createContext as es, useContext as z, useRef as $, useState as E, useEffect as k, useTransition as ss, lazy as ns, useMemo as C, Suspense as ts, forwardRef as os, useLayoutEffect as is, useCallback as R } from "react";
7
+ import { C as A, c as j, Q as O, S as D } from "./useStreamLayerApp2.js";
8
8
  window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));
9
- function is(e) {
9
+ function rs(e) {
10
10
  return e instanceof DOMException && // everything except Firefox
11
11
  (e.code === 22 || // Firefox
12
12
  e.code === 1014 || // test name field too, because code might not be present
@@ -14,7 +14,7 @@ function is(e) {
14
14
  e.name === "QuotaExceededError" || // Firefox
15
15
  e.name === "NS_ERROR_DOM_QUOTA_REACHED");
16
16
  }
17
- class rs {
17
+ class as {
18
18
  constructor(s = "main", n = window.localStorage) {
19
19
  g(this, "delimiter", ":");
20
20
  g(this, "prefix");
@@ -28,8 +28,8 @@ class rs {
28
28
  const n = s.pop() || "", o = this.generateKey(s);
29
29
  try {
30
30
  this.storage.setItem(o, n);
31
- } catch (r) {
32
- is(r) && this.storage === window.sessionStorage && (window.sessionStorage.removeItem("slstreamlogs"), this.storage.setItem(o, n));
31
+ } catch (i) {
32
+ rs(i) && this.storage === window.sessionStorage && (window.sessionStorage.removeItem("slstreamlogs"), this.storage.setItem(o, n));
33
33
  }
34
34
  });
35
35
  g(this, "read", (...s) => {
@@ -46,14 +46,14 @@ var X;
46
46
  (function(e) {
47
47
  e.Init = "init", e.Ready = "ready", e.Connecting = "connecting", e.Connected = "connected", e.Disconnected = "disconnected", e.Failed = "failed", e.Reconnect = "reconnect", e.Reconnecting = "reconnecting";
48
48
  })(X || (X = {}));
49
- E.Unknown, E.Internal, E.DeadlineExceeded, E.ResourceExhausted, E.FailedPrecondition, E.Unavailable, E.DataLoss;
49
+ A.Unknown, A.Internal, A.DeadlineExceeded, A.ResourceExhausted, A.FailedPrecondition, A.Unavailable, A.DataLoss;
50
50
  V("grpc:retry");
51
- H(10, { description: "Number of attempts to retry" }), H(3e4, { description: "Max delay between retries in milliseconds" });
51
+ j(10, { description: "Number of attempts to retry" }), j(3e4, { description: "Max delay between retries in milliseconds" });
52
52
  var I;
53
53
  (function(e) {
54
54
  e.SCHEMA = "schema", e.EXTERNAL_TOKEN = "eToken", e.TOKEN = "token";
55
55
  })(I || (I = {}));
56
- class as extends rs {
56
+ class ls extends as {
57
57
  constructor() {
58
58
  super("user");
59
59
  // Schema
@@ -82,391 +82,415 @@ var Y;
82
82
  })(Y || (Y = {}));
83
83
  V("deep_link");
84
84
  V("bypass");
85
- new as();
85
+ new ls();
86
86
  V("video_player");
87
87
  var Z;
88
88
  (function(e) {
89
- e.ALLOWED = "allowed", e.DISALLOWED = "disallowed";
89
+ e.SHOWED = "showed";
90
90
  })(Z || (Z = {}));
91
91
  var J;
92
92
  (function(e) {
93
- e.UNKNOWN = "unknown", e.ALREADY_VOTED = "already_voted";
93
+ e.ALLOWED = "allowed", e.DISALLOWED = "disallowed";
94
94
  })(J || (J = {}));
95
95
  var ee;
96
96
  (function(e) {
97
- e.ONBOARDING = "onboarding", e.ONBOARDING_IO = "onboarding_io";
97
+ e.UNKNOWN = "unknown", e.ALREADY_VOTED = "already_voted";
98
98
  })(ee || (ee = {}));
99
99
  var se;
100
100
  (function(e) {
101
- e.Unset = "unset", e.Required = "required", e.Optional = "optional", e.Completed = "completed", e.Disabled = "disabled", e.Unavailable = "unavailable";
101
+ e.ONBOARDING = "onboarding", e.ONBOARDING_IO = "onboarding_io";
102
102
  })(se || (se = {}));
103
- R.POLL, R.PREDICTION, R.TRIVIA;
104
- const ls = {
105
- [x.GAMES]: !0
106
- }, Q = /* @__PURE__ */ h("div")({
103
+ var ne;
104
+ (function(e) {
105
+ e.Unset = "unset", e.Required = "required", e.Optional = "optional", e.Completed = "completed", e.Disabled = "disabled", e.Unavailable = "unavailable";
106
+ })(ne || (ne = {}));
107
+ O.POLL, O.PREDICTION, O.TRIVIA;
108
+ const ds = {
109
+ [D.GAMES]: !0
110
+ }, F = /* @__PURE__ */ h("div")({
107
111
  name: "LoadingContainer",
108
- class: "l1a1b29x",
112
+ class: "lclc0ej",
109
113
  propsAsIs: !1
110
- }), ds = ({
114
+ }), cs = ({
111
115
  feature: e,
112
116
  sdk: s,
113
117
  children: n,
114
118
  className: o,
115
- noWait: r
119
+ noWait: i
116
120
  }) => {
117
- const a = u(e.status), i = u(s.sdkStore.slStreamId);
118
- if (!r) {
119
- if (i != null && i.loading && !i.data)
120
- return /* @__PURE__ */ t(Q, {
121
+ const a = u(e.status), l = u(s.sdkStore.slStreamId);
122
+ if (!i) {
123
+ if (l != null && l.loading && !l.data)
124
+ return /* @__PURE__ */ t(F, {
121
125
  className: o,
122
126
  children: "Event is loading..."
123
127
  });
124
- if (!(i != null && i.data))
125
- return /* @__PURE__ */ t(Q, {
128
+ if (!(l != null && l.data))
129
+ return /* @__PURE__ */ t(F, {
126
130
  className: o,
127
131
  children: "Event is forbidden..."
128
132
  });
129
- if (a !== ge.Ready)
130
- return /* @__PURE__ */ t(Q, {
133
+ if (a !== fe.Ready)
134
+ return /* @__PURE__ */ t(F, {
131
135
  className: o,
132
136
  children: "Wait feature..."
133
137
  });
134
138
  }
135
139
  return n;
136
- }, ce = es({
140
+ }, ue = es({
137
141
  sdk: null
138
- }), M = () => K(ce), cs = /* @__PURE__ */ h("div")({
142
+ }), B = () => z(ue), ps = /* @__PURE__ */ h("div")({
139
143
  name: "QuestionContainer",
140
- class: "qfnqmpg",
144
+ class: "q14ckf9e",
141
145
  propsAsIs: !1
142
- }), ps = ({
146
+ }), us = ({
143
147
  openedQuestion: e
144
148
  }) => {
145
149
  var s, n;
146
150
  const {
147
151
  sdk: o
148
- } = M();
152
+ } = B();
149
153
  return ((s = e == null ? void 0 : e.attributes) == null ? void 0 : s.attributes.case) === "insight" ? /* @__PURE__ */ t(ye, {
150
154
  ...e.attributes.attributes.value,
151
155
  controlVideo: o == null ? void 0 : o.controlVideoPlayer
152
- }) : ((n = e == null ? void 0 : e.attributes) == null ? void 0 : n.attributes.case) === "tweet" ? /* @__PURE__ */ t(ke, {
156
+ }) : ((n = e == null ? void 0 : e.attributes) == null ? void 0 : n.attributes.case) === "tweet" ? /* @__PURE__ */ t(Ne, {
153
157
  ...e.attributes.attributes.value,
154
158
  controlVideo: o == null ? void 0 : o.controlVideoPlayer
155
159
  }) : null;
156
- }, us = ({
160
+ }, hs = ({
157
161
  extendedQuestion: e,
158
162
  vote: s,
159
163
  close: n
160
164
  }) => {
161
165
  const {
162
166
  loading: o,
163
- data: r
167
+ data: i
164
168
  } = e;
165
- return r ? /* @__PURE__ */ t(fe, {
169
+ return i ? /* @__PURE__ */ t(be, {
166
170
  vote: s,
167
171
  close: n,
168
- openedQuestion: r,
172
+ openedQuestion: i,
169
173
  isLoading: !!o
170
- }) : /* @__PURE__ */ t(Ne, {});
171
- }, hs = ({
174
+ }) : /* @__PURE__ */ t(Se, {});
175
+ }, vs = ({
172
176
  gamification: e
173
177
  }) => {
174
- var s;
175
- const n = u(e.openedQuestion.$store), o = u(e.openedQuestion.$extendedStore);
176
- if (!n)
178
+ var s, n, o;
179
+ const i = u(e.openedQuestion.$store), a = u(e.openedQuestion.$extendedStore);
180
+ if (!i)
177
181
  return null;
178
- const r = n.type;
179
- return /* @__PURE__ */ y(cs, {
180
- children: [/* @__PURE__ */ t(ie, {
182
+ const l = i.type;
183
+ return /* @__PURE__ */ m(ps, {
184
+ children: [/* @__PURE__ */ t(re, {
181
185
  close: e.closeQuestion,
182
- type: ((s = n.attributes) == null ? void 0 : s.type) || R.UNSET
183
- }), r === "question" && /* @__PURE__ */ t(us, {
186
+ type: ((s = i.attributes) == null ? void 0 : s.type) || O.UNSET
187
+ }), l === "question" && /* @__PURE__ */ t(hs, {
184
188
  vote: e.submitAnswer,
185
189
  close: e.closeQuestion,
186
- extendedQuestion: o
187
- }), r !== "question" && /* @__PURE__ */ t(ps, {
188
- openedQuestion: n
189
- }), /* @__PURE__ */ t(me, {
190
- sponsorLogo: ""
190
+ extendedQuestion: a
191
+ }), l !== "question" && /* @__PURE__ */ t(us, {
192
+ openedQuestion: i
193
+ }), /* @__PURE__ */ t(ke, {
194
+ sponsorLogo: (o = (n = a.data) == null ? void 0 : n.sponsorship) == null ? void 0 : o.logo
191
195
  })]
192
196
  });
193
- }, vs = /* @__PURE__ */ h("div")({
197
+ }, gs = /* @__PURE__ */ h("div")({
194
198
  name: "InviteFriendsContainer",
195
- class: "i1d1hf8u",
199
+ class: "i1c9dygq",
196
200
  propsAsIs: !1
197
- }), gs = ({
201
+ }), ms = ({
198
202
  deepLink: e
199
- }) => /* @__PURE__ */ t(vs, {
200
- children: /* @__PURE__ */ t(be, {
203
+ }) => /* @__PURE__ */ t(gs, {
204
+ children: /* @__PURE__ */ t(Ie, {
201
205
  inviteLink: e,
202
206
  inviteCardTitle: "It’s More Fun With Friends",
203
207
  inviteCardSubtext: "Invite and compete against your friends for the top spot on the leaderboard."
204
208
  })
205
- }), ms = /* @__PURE__ */ h("div")({
209
+ }), fs = /* @__PURE__ */ h("div")({
206
210
  name: "InviteLinkContainer",
207
- class: "i9tvant",
211
+ class: "i1odbhm4",
208
212
  propsAsIs: !1
209
- }), ys = ({
213
+ }), ks = ({
210
214
  gamification: e,
211
215
  scrollNode: s,
212
216
  scrollStore: n
213
217
  }) => {
214
- const o = L(null), {
215
- data: r,
218
+ const o = $(null), {
219
+ data: i,
216
220
  hasMore: a,
217
- loading: i,
218
- key: l
221
+ loading: l,
222
+ key: d
219
223
  } = u(e.leaderboardList.$store), {
220
- data: c
221
- } = u(e.deepLink.$store), [d, p] = Se(o);
222
- return !r.length && !i ? /* @__PURE__ */ t(gs, {
223
- deepLink: c
224
- }) : /* @__PURE__ */ y(D, {
225
- children: [/* @__PURE__ */ t(Ie, {
226
- items: r,
224
+ data: r
225
+ } = u(e.deepLink.$store), [p, c] = Ee(o);
226
+ return !i.length && !l ? /* @__PURE__ */ t(ms, {
227
+ deepLink: r
228
+ }) : /* @__PURE__ */ m(L, {
229
+ children: [/* @__PURE__ */ t(we, {
230
+ items: i,
227
231
  scrollNode: s,
228
232
  scrollStore: n,
229
233
  fetchMore: e.leaderboardList.fetchMore,
230
234
  hasMore: a,
231
235
  openItemDetail: e.openUser,
232
236
  currentUserId: e.currentUserId.get()
233
- }, l), c && /* @__PURE__ */ t(ms, {
237
+ }, d), r && /* @__PURE__ */ t(fs, {
234
238
  ref: o,
235
- children: /* @__PURE__ */ t($e, {
236
- onClick: () => d(c),
239
+ children: /* @__PURE__ */ t(Ae, {
240
+ onClick: () => p(r),
237
241
  title: "Invite Friends",
238
242
  description: "Challenge them now!"
239
243
  })
240
- }), p]
244
+ }), c]
241
245
  });
242
- }, ks = ({ store: e, openQuestion: s }) => {
243
- const { sdk: n } = M(), o = u(e);
246
+ }, ys = ({ store: e, openQuestion: s }) => {
247
+ const { sdk: n } = B(), o = u(e);
244
248
  return /* @__PURE__ */ t(Ce, { openQuestion: s, questions: o.data, controlVideo: n == null ? void 0 : n.controlVideoPlayer });
245
- }, fs = ({ userSummary: e }) => {
249
+ }, Ns = ({ userSummary: e }) => {
246
250
  var s;
247
- const [n, o] = $(void 0);
251
+ const [n, o] = E(void 0);
248
252
  return k(() => {
249
- const r = e.$store.subscribe((a) => {
253
+ const i = e.$store.subscribe((a) => {
250
254
  a && o(a);
251
255
  });
252
256
  return () => {
253
- r();
257
+ i();
254
258
  };
255
- }, [e]), /* @__PURE__ */ t(re, { loading: !(n != null && n.summary), ...n == null ? void 0 : n.summary, successRate: (s = n == null ? void 0 : n.percentage) == null ? void 0 : s.correct });
256
- }, Ns = ({ gamification: e, className: s, scrollStore: n, scrollNode: o, appNode: r, style: a, responsiveStore: i }) => {
257
- const { tabsShown: l } = u(n, { keys: ["tabsShown"] }), [c, d] = $(q.HOME), [, p] = ss(), { sdkInDesktopView: v, screen: m } = u(i, { keys: ["sdkInDesktopView"] }), f = (b) => {
258
- p(() => {
259
- var A;
260
- d(b), v === !1 && (((A = r.current) == null ? void 0 : A.getBoundingClientRect().y) || 0) < 0 && U(r, m.size, { behavior: "instant" });
259
+ }, [e]), /* @__PURE__ */ t(ae, { loading: !(n != null && n.summary), ...n == null ? void 0 : n.summary, successRate: (s = n == null ? void 0 : n.percentage) == null ? void 0 : s.correct });
260
+ }, bs = ({ gamification: e, className: s, scrollStore: n, scrollNode: o, appNode: i, style: a, responsiveStore: l }) => {
261
+ const { tabsShown: d } = u(n, { keys: ["tabsShown"] }), [r, p] = E(P.HOME), [, c] = ss(), { sdkInDesktopView: v, screen: f } = u(l, { keys: ["sdkInDesktopView"] }), N = (S) => {
262
+ c(() => {
263
+ var y;
264
+ p(S), v === !1 && (((y = i.current) == null ? void 0 : y.getBoundingClientRect().y) || 0) < 0 && M(i, f.size, { behavior: "instant" });
261
265
  });
262
266
  };
263
- k(() => n.subscribe((b) => {
264
- if (b.scrollPosition === 0) {
267
+ k(() => n.subscribe((S) => {
268
+ if (S.scrollPosition === 0) {
265
269
  n.setKey("tabsShown", !0);
266
270
  return;
267
271
  }
268
- i.get().sdkInDesktopView ? n.setKey("tabsShown", b.scrollDirection === "backward") : n.setKey("tabsShown", b.scrollDirection === "forward");
269
- }), [n, i]);
270
- let N = "0px";
271
- return v ? N = l ? "0px" : "calc(8px - var(--header-height) - var(--header-offset))" : N = l ? "calc(var(--header-height) + var(--header-offset) - 2px)" : "0px", /* @__PURE__ */ y(Ee, { className: s, style: a, children: [
272
+ l.get().sdkInDesktopView ? n.setKey("tabsShown", S.scrollDirection === "backward") : n.setKey("tabsShown", S.scrollDirection === "forward");
273
+ }), [n, l]);
274
+ let b = "0px";
275
+ return v ? b = d ? "0px" : "calc(8px - var(--header-height) - var(--header-offset))" : b = d ? "calc(var(--header-height) + var(--header-offset) - 2px)" : "0px", /* @__PURE__ */ m($e, { className: s, style: a, children: [
272
276
  /* @__PURE__ */ t(
273
- we,
277
+ Le,
274
278
  {
275
279
  style: {
276
- top: N
280
+ top: b
277
281
  },
278
- children: /* @__PURE__ */ t(Ae, { activePage: c, toggleActivePage: f })
282
+ children: /* @__PURE__ */ t(De, { activePage: r, toggleActivePage: N })
279
283
  }
280
284
  ),
281
- c === q.HOME && /* @__PURE__ */ y(D, { children: [
282
- /* @__PURE__ */ t(ae, { style: { paddingTop: "8px" }, children: /* @__PURE__ */ t(Le, { children: /* @__PURE__ */ t(fs, { userSummary: e.userSummary }) }) }),
283
- /* @__PURE__ */ t(De, { style: { flex: 1 }, children: /* @__PURE__ */ t(ks, { openQuestion: e.openQuestion, store: e.feedList.getStore() }) })
285
+ r === P.HOME && /* @__PURE__ */ m(L, { children: [
286
+ /* @__PURE__ */ t(le, { style: { paddingTop: "8px" }, children: /* @__PURE__ */ t(Te, { children: /* @__PURE__ */ t(Ns, { userSummary: e.userSummary }) }) }),
287
+ /* @__PURE__ */ t(xe, { style: { flex: 1 }, children: /* @__PURE__ */ t(ys, { openQuestion: e.openQuestion, store: e.feedList.getStore() }) })
284
288
  ] }),
285
- c === q.LEADERBOARD && /* @__PURE__ */ t(Te, { children: /* @__PURE__ */ t(ys, { scrollStore: n, scrollNode: o, gamification: e }) })
289
+ r === P.LEADERBOARD && /* @__PURE__ */ t(Oe, { children: /* @__PURE__ */ t(ks, { scrollStore: n, scrollNode: o, gamification: e }) })
286
290
  ] });
287
- }, bs = () => F, ne = /* @__PURE__ */ h(bs())({
291
+ }, Ss = () => U, te = /* @__PURE__ */ h(Ss())({
288
292
  name: "OpenedContainer",
289
- class: "o1o2cpiy",
293
+ class: "ouvguos",
290
294
  propsAsIs: !0
291
- }), Ss = /* @__PURE__ */ h("div")({
295
+ }), Is = /* @__PURE__ */ h("div")({
292
296
  name: "UserContainer",
293
- class: "u1ob6f8q",
297
+ class: "u1eu4lbg",
294
298
  propsAsIs: !1
295
- }), Is = ({
299
+ }), Es = ({
296
300
  correct: e,
297
301
  incorrect: s
298
302
  }) => {
299
303
  const n = e + s;
300
304
  return n === 0 ? 0 : Math.round(e / n * 100);
301
- }, gn = ({
305
+ }, mn = ({
302
306
  gamification: e,
303
307
  scrollStore: s,
304
308
  className: n,
305
309
  appNode: o,
306
- scrollNode: r,
310
+ scrollNode: i,
307
311
  responsiveStore: a
308
- }) => /* @__PURE__ */ t(Ns, {
312
+ }) => /* @__PURE__ */ t(bs, {
309
313
  appNode: o,
310
314
  scrollStore: s,
311
- scrollNode: r,
315
+ scrollNode: i,
312
316
  className: n,
313
317
  gamification: e,
314
318
  responsiveStore: a
315
- }), $s = ({
319
+ }), ws = ({
316
320
  gamification: e,
317
321
  className: s,
318
322
  appNode: n,
319
323
  responsiveStore: o
320
324
  }) => {
321
- const r = u(e.openedQuestion.$store), a = u(e.openedUser), {
322
- sdkInDesktopView: i
325
+ const i = u(e.openedQuestion.$store), a = u(e.openedUser), {
326
+ sdkInDesktopView: l
323
327
  } = u(o, {
324
328
  keys: ["sdkInDesktopView"]
325
329
  }), {
326
- hiding: l,
327
- onAnimationEnd: c
328
- } = xe();
329
- if (!n.current || !r && !a)
330
+ hiding: d,
331
+ onAnimationEnd: r
332
+ } = Re();
333
+ if (!n.current || !i && !a)
330
334
  return null;
331
- const d = r ? /* @__PURE__ */ t(ne, {
335
+ const p = i ? /* @__PURE__ */ t(te, {
332
336
  className: s,
333
- hiding: l,
334
- onAnimationEnd: c,
335
- children: /* @__PURE__ */ t(hs, {
337
+ hiding: d,
338
+ onAnimationEnd: r,
339
+ children: /* @__PURE__ */ t(vs, {
336
340
  gamification: e
337
341
  })
338
- }) : a ? /* @__PURE__ */ t(ne, {
342
+ }) : a ? /* @__PURE__ */ t(te, {
339
343
  className: s,
340
- hiding: l,
341
- onAnimationEnd: c,
342
- children: /* @__PURE__ */ y(Ss, {
343
- children: [/* @__PURE__ */ t(ie, {
344
+ hiding: d,
345
+ onAnimationEnd: r,
346
+ children: /* @__PURE__ */ m(Is, {
347
+ children: [/* @__PURE__ */ t(re, {
344
348
  label: "Friend's Rank",
345
349
  close: e.closeUser
346
- }), /* @__PURE__ */ t(ae, {
347
- children: /* @__PURE__ */ t(re, {
350
+ }), /* @__PURE__ */ t(le, {
351
+ children: /* @__PURE__ */ t(ae, {
348
352
  ...a,
349
- successRate: Is(a)
353
+ successRate: Es(a)
350
354
  })
351
355
  })]
352
356
  })
353
357
  }) : null;
354
- return /* @__PURE__ */ t(le, {
358
+ return /* @__PURE__ */ t(de, {
355
359
  container: n,
356
- useContainer: !i,
357
- children: d
360
+ useContainer: !l,
361
+ children: p
358
362
  });
359
- }, Cs = ns(() => import("./gamification-feature.js")), Es = ({ sdk: e, feature: s, className: n, scrollStore: o, appNode: r, scrollNode: a, responsiveStore: i }) => {
360
- const l = w(() => s && s.featureConfig.get().type === x.GAMES ? /* @__PURE__ */ t(ds, { className: n, sdk: e, feature: s, children: /* @__PURE__ */ t(
361
- Cs,
363
+ }, As = ns(() => import("./gamification-feature.js")), Cs = ({ sdk: e, feature: s, className: n, scrollStore: o, appNode: i, scrollNode: a, responsiveStore: l }) => {
364
+ const d = C(() => s && s.featureConfig.get().type === D.GAMES ? /* @__PURE__ */ t(cs, { className: n, sdk: e, feature: s, children: /* @__PURE__ */ t(
365
+ As,
362
366
  {
363
- appNode: r,
367
+ appNode: i,
364
368
  scrollStore: o,
365
369
  scrollNode: a,
366
370
  className: n,
367
- responsiveStore: i,
371
+ responsiveStore: l,
368
372
  gamification: s
369
373
  }
370
- ) }) : null, [e, s, n, i, o, a, r]);
374
+ ) }) : null, [e, s, n, l, o, a, i]);
371
375
  return /* @__PURE__ */ t(
372
376
  ts,
373
377
  {
374
378
  fallback: /* @__PURE__ */ t("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" }, children: "page loading..." }),
375
- children: l
379
+ children: d
376
380
  }
377
381
  );
378
- }, ws = ({ feature: e, className: s, appNode: n, responsiveStore: o }) => e && e.featureConfig.get().type === x.GAMES ? /* @__PURE__ */ t(
379
- $s,
382
+ }, $s = ({ feature: e, className: s, appNode: n, responsiveStore: o }) => e && e.featureConfig.get().type === D.GAMES ? /* @__PURE__ */ t(
383
+ ws,
380
384
  {
381
385
  className: s,
382
386
  appNode: n,
383
387
  responsiveStore: o,
384
388
  gamification: e
385
389
  }
386
- ) : null, As = () => Re, Ls = /* @__PURE__ */ h(As())({
387
- name: "Container",
388
- class: "ckodz37",
390
+ ) : null, Ls = () => ce, Ds = /* @__PURE__ */ h(Ls())({
391
+ name: "ButtonIcon",
392
+ class: "b11wpe79",
389
393
  propsAsIs: !0
390
- }), Ds = ({
391
- sdk: e
392
- }) => {
393
- const s = u(e.sdkStore.organizationSettings), n = u(e.sdkStore.streamSettings), o = u(e.getActiveFeature()), r = w(() => {
394
- const i = (n == null ? void 0 : n.data) || (s == null ? void 0 : s.data);
395
- return i != null && i.overlays ? i.overlays : [];
396
- }, [s, n]), a = w(() => [...r.filter(({
397
- enableSdkButton: i
398
- }) => i).map((i) => ({
399
- id: i.type,
400
- onClick: () => e.openFeature(i.type),
401
- disabled: !(i.type in ls),
402
- label: i.name,
394
+ }), Ts = os(({
395
+ sdk: e,
396
+ className: s
397
+ }, n) => {
398
+ const o = u(e.sdkStore.organizationSettings), i = u(e.sdkStore.streamSettings), a = u(e.getActiveFeature()), l = C(() => {
399
+ const r = (i == null ? void 0 : i.data) || (o == null ? void 0 : o.data);
400
+ return r != null && r.overlays ? r.overlays : [];
401
+ }, [o, i]), d = C(() => [...l.filter(({
402
+ enableSdkButton: r
403
+ }) => r).map((r) => ({
404
+ id: r.type,
405
+ onClick: () => e.openFeature(r.type),
406
+ disabled: !(r.type in ds),
407
+ label: r.name,
403
408
  icon: /* @__PURE__ */ t("img", {
404
- src: i.icon,
409
+ src: r.icon,
405
410
  alt: ""
406
411
  }),
407
412
  /** multiplied by 10 to add the ability to insert custom buttons between our buttons */
408
- position: i.position * 10
409
- }))].sort((i, l) => i.position - l.position), [r, e]);
410
- return /* @__PURE__ */ t(Ls, {
411
- children: a.map((i) => /* @__PURE__ */ t(Oe, {
412
- ...i,
413
- icon: void 0,
414
- active: i.id === o
415
- }, i.id))
413
+ position: r.position * 10
414
+ }))].sort((r, p) => r.position - p.position), [l, e]);
415
+ return /* @__PURE__ */ m(Ve, {
416
+ className: s,
417
+ children: [/* @__PURE__ */ t(Pe, {
418
+ children: [/* @__PURE__ */ t(Q, {
419
+ id: "Channels",
420
+ onClick: () => e.closeFeature(),
421
+ label: "Channels",
422
+ active: a === 0
423
+ }, "Channels"), ...d.map((r) => r.id === D.GAMES ? /* @__PURE__ */ t(Q, {
424
+ ...r,
425
+ active: r.id === a,
426
+ label: "StreamLayer +",
427
+ id: "featuredGroups",
428
+ icon: /* @__PURE__ */ t(Ds, {
429
+ name: "icon-btn-feature-groups",
430
+ "data-selected": r.id === a
431
+ })
432
+ }, r.id) : /* @__PURE__ */ t(Q, {
433
+ ...r,
434
+ icon: void 0,
435
+ active: r.id === a
436
+ }, r.id))]
437
+ }), /* @__PURE__ */ t("div", {
438
+ ref: n
439
+ })]
416
440
  });
417
- }, Ts = /* @__PURE__ */ h("div")({
441
+ }), xs = /* @__PURE__ */ h("div")({
418
442
  name: "Container",
419
- class: "c3q0amv",
443
+ class: "c1qjj4d4",
420
444
  propsAsIs: !1
421
- }), xs = /* @__PURE__ */ h("div")({
445
+ }), Os = /* @__PURE__ */ h("div")({
422
446
  name: "CloseIconWrap",
423
- class: "cqihknq",
447
+ class: "c1lg6b8a",
424
448
  propsAsIs: !1
425
- }), Os = () => Ve, Rs = /* @__PURE__ */ h(Os())({
449
+ }), Rs = () => ce, Vs = /* @__PURE__ */ h(Rs())({
426
450
  name: "CloseIcon",
427
- class: "cl5ln9o",
451
+ class: "c159el66",
428
452
  propsAsIs: !0
429
- }), Vs = /* @__PURE__ */ h("div")({
453
+ }), Ps = /* @__PURE__ */ h("div")({
430
454
  name: "Title",
431
- class: "t1bejf60",
455
+ class: "t16xmufv",
432
456
  propsAsIs: !1
433
- }), qs = /* @__PURE__ */ h("img")({
457
+ }), Qs = /* @__PURE__ */ h("img")({
434
458
  name: "SponsorLogo",
435
- class: "sb0t4y8",
459
+ class: "s83lc21",
436
460
  propsAsIs: !1
437
- }), Ps = /* @__PURE__ */ h("div")({
461
+ }), _s = /* @__PURE__ */ h("div")({
438
462
  name: "PresentsTitle",
439
- class: "p1nmyo08",
463
+ class: "p1p7igia",
440
464
  propsAsIs: !1
441
- }), Qs = /* @__PURE__ */ h("div")({
465
+ }), qs = /* @__PURE__ */ h("div")({
442
466
  name: "Subtitle",
443
- class: "sgd2pup",
467
+ class: "s1eftsbu",
444
468
  propsAsIs: !1
445
- }), _s = /* @__PURE__ */ h("div")({
469
+ }), Fs = /* @__PURE__ */ h("div")({
446
470
  name: "Description",
447
- class: "d6e19hw",
471
+ class: "d8uezec",
448
472
  propsAsIs: !1
449
- }), Us = /* @__PURE__ */ h("button")({
473
+ }), Ks = /* @__PURE__ */ h("button")({
450
474
  name: "ActionButton",
451
- class: "a17h53j4",
475
+ class: "a1h1bk90",
452
476
  propsAsIs: !1
453
- }), te = ({ close: e, action: s, onboarding: n }) => {
454
- var o, r, a, i, l, c, d, p;
455
- return /* @__PURE__ */ y(Ts, { children: [
456
- /* @__PURE__ */ t(xs, { onClick: e, children: /* @__PURE__ */ t(Rs, { name: "icon-cross" }) }),
457
- ((r = (o = n == null ? void 0 : n.titleCard) == null ? void 0 : o.media) == null ? void 0 : r.sponsorLogo) && /* @__PURE__ */ y(Vs, { children: [
458
- /* @__PURE__ */ t(qs, { alt: "sponsor-logo", src: (i = (a = n == null ? void 0 : n.titleCard) == null ? void 0 : a.media) == null ? void 0 : i.sponsorLogo }),
459
- /* @__PURE__ */ t(Ps, { children: "PRESENTS" })
477
+ }), oe = ({ close: e, action: s, onboarding: n }) => {
478
+ var o, i, a, l, d, r, p, c;
479
+ return /* @__PURE__ */ m(xs, { children: [
480
+ /* @__PURE__ */ t(Os, { onClick: e, children: /* @__PURE__ */ t(Vs, { name: "icon-cross" }) }),
481
+ ((i = (o = n == null ? void 0 : n.titleCard) == null ? void 0 : o.media) == null ? void 0 : i.sponsorLogo) && /* @__PURE__ */ m(Ps, { children: [
482
+ /* @__PURE__ */ t(Qs, { alt: "sponsor-logo", src: (l = (a = n == null ? void 0 : n.titleCard) == null ? void 0 : a.media) == null ? void 0 : l.sponsorLogo }),
483
+ /* @__PURE__ */ t(_s, { children: "PRESENTS" })
460
484
  ] }),
461
- ((l = n == null ? void 0 : n.titleCard) == null ? void 0 : l.title) && /* @__PURE__ */ t(Qs, { children: (c = n == null ? void 0 : n.titleCard) == null ? void 0 : c.title }),
462
- ((d = n == null ? void 0 : n.titleCard) == null ? void 0 : d.subtitle) && /* @__PURE__ */ t(_s, { children: (p = n == null ? void 0 : n.titleCard) == null ? void 0 : p.subtitle }),
463
- /* @__PURE__ */ t(Us, { onClick: s, children: "Play Now" })
485
+ ((d = n == null ? void 0 : n.titleCard) == null ? void 0 : d.title) && /* @__PURE__ */ t(qs, { children: (r = n == null ? void 0 : n.titleCard) == null ? void 0 : r.title }),
486
+ ((p = n == null ? void 0 : n.titleCard) == null ? void 0 : p.subtitle) && /* @__PURE__ */ t(Fs, { children: (c = n == null ? void 0 : n.titleCard) == null ? void 0 : c.subtitle }),
487
+ /* @__PURE__ */ t(Ks, { onClick: s, children: "Play Now" })
464
488
  ] });
465
- }, _ = [{
466
- graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_1.png",
467
- tagline: "Featured groups+ experience",
468
- headline: /* @__PURE__ */ y(D, {
469
- children: ["Welcome to ", /* @__PURE__ */ t("br", {}), " Featured Groups +"]
489
+ }, K = [{
490
+ graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_0.png",
491
+ tagline: "",
492
+ headline: /* @__PURE__ */ m(L, {
493
+ children: ["Welcome to ", /* @__PURE__ */ t("br", {}), " StreamLayer +"]
470
494
  })
471
495
  }, {
472
496
  graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_2.png",
@@ -480,46 +504,44 @@ const ls = {
480
504
  }, {
481
505
  graphicSrc: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/step_5.png",
482
506
  headline: "Compete against friends on the leaderboard"
483
- }], Fs = /* @__PURE__ */ h("div")({
507
+ }], Ms = /* @__PURE__ */ h("div")({
484
508
  name: "OnboardingContainer",
485
- class: "o1xcysoz",
509
+ class: "o1xni1kr",
486
510
  propsAsIs: !1
487
- }), Ks = () => F, Ms = /* @__PURE__ */ h(Ks())({
511
+ }), Us = () => U, zs = /* @__PURE__ */ h(Us())({
488
512
  name: "OnboardingNotificationContainer",
489
- class: "oejzp3v",
513
+ class: "o1vnouv7",
490
514
  propsAsIs: !0
491
- }), oe = /* @__PURE__ */ h("div")({
515
+ }), ie = /* @__PURE__ */ h("div")({
492
516
  name: "InnerContainer",
493
- class: "i134gfua",
517
+ class: "i59uefw",
494
518
  propsAsIs: !1
495
- }), zs = ({
519
+ }), Bs = ({
496
520
  deepLink: e,
497
521
  onboardingOpts: s,
498
522
  notification: n,
499
523
  gamification: o,
500
- loading: r,
501
- renderToNode: a,
502
- sdk: i
524
+ loading: i,
525
+ sdk: a
503
526
  }) => {
504
- var l, c, d, p, v, m, f;
505
- const N = u(o.friends.getStore()), [b, A] = $(void 0), S = w(() => {
506
- var C, T;
507
- const z = i.getInviter();
508
- return z ? (T = (C = N.data) == null ? void 0 : C.find(({
509
- slId: ue
510
- }) => ue === z)) == null ? void 0 : T.name : "";
511
- }, [N.data, i]);
527
+ var l, d, r, p, c, v, f;
528
+ const N = u(o.friends.getStore()), [b, S] = E(void 0), y = C(() => {
529
+ var w, T;
530
+ const W = a.getInviter();
531
+ return W ? (T = (w = N.data) == null ? void 0 : w.find(({
532
+ slId: ve
533
+ }) => ve === W)) == null ? void 0 : T.name : "";
534
+ }, [N.data, a]);
512
535
  return k(() => {
513
- const C = e.$store.subscribe((T) => {
514
- T && A(T.data);
536
+ const w = e.$store.subscribe((T) => {
537
+ T && S(T.data);
515
538
  });
516
539
  return () => {
517
- C();
540
+ w();
518
541
  };
519
- }, [e.$store]), /* @__PURE__ */ t(Fs, {
520
- children: /* @__PURE__ */ t(Qe, {
521
- loading: r,
522
- renderToNode: a,
542
+ }, [e.$store]), /* @__PURE__ */ t(Ms, {
543
+ children: /* @__PURE__ */ t(_e, {
544
+ loading: i,
523
545
  rules: [{
524
546
  label: "Answer as many questions as you like.",
525
547
  icon: "icon-btn-feature-groups"
@@ -531,372 +553,374 @@ const ls = {
531
553
  icon: "icon-trophy"
532
554
  }],
533
555
  rulesBtnLabel: (l = s.rules) == null ? void 0 : l.buttonLabel,
534
- rulesTitle: (c = s.rules) == null ? void 0 : c.heading,
556
+ rulesTitle: (d = s.rules) == null ? void 0 : d.heading,
535
557
  termsTitle: "Terms and Conditions",
536
- termsText: (d = s.rules) == null ? void 0 : d.terms,
537
- steps: _,
558
+ termsText: (r = s.rules) == null ? void 0 : r.terms,
559
+ steps: K,
538
560
  primaryColor: (p = s.inviteCard) == null ? void 0 : p.iconColor,
539
561
  inviteLink: b,
540
- inviteCardTitle: (v = s.inviteCard) == null ? void 0 : v.heading,
541
- inviteCardSubtext: (m = s.inviteCard) == null ? void 0 : m.subtext,
562
+ inviteCardTitle: (c = s.inviteCard) == null ? void 0 : c.heading,
563
+ inviteCardSubtext: (v = s.inviteCard) == null ? void 0 : v.subtext,
542
564
  inviteCardBtnLabel: (f = s.inviteCard) == null ? void 0 : f.buttonLabel,
543
565
  onClose: () => {
544
- var C;
545
- (C = n.close) == null || C.call(n);
566
+ var w;
567
+ (w = n.close) == null || w.call(n);
546
568
  },
547
569
  gamification: o,
548
- sdk: i,
549
- inviterName: S
570
+ sdk: a,
571
+ inviterName: y
550
572
  })
551
573
  });
552
- }, Bs = ({
574
+ }, Ws = ({
553
575
  sdk: e,
554
576
  notification: s,
555
577
  saveHeight: n,
556
578
  style: o,
557
- appNode: r,
579
+ appNode: i,
558
580
  sdkInDesktopView: a,
559
- responsiveStore: i
581
+ responsiveStore: l
560
582
  }) => {
561
- var l;
562
- const c = L(null), d = s.data.onboarding, [p, v] = $(d == null ? void 0 : d.instantOpen), m = e.getFeature(x.GAMES), f = w(() => _ == null ? void 0 : _.map(({
563
- graphicSrc: S
564
- }) => S), []), {
583
+ const d = $(null), r = s.data.onboarding, [p, c] = E(r == null ? void 0 : r.instantOpen), v = e.getFeature(D.GAMES), f = C(() => K == null ? void 0 : K.map(({
584
+ graphicSrc: y
585
+ }) => y), []), {
565
586
  screen: N
566
- } = u(i, {
587
+ } = u(l, {
567
588
  keys: ["screen"]
568
589
  });
569
- (l = d == null ? void 0 : d.titleCard) != null && l.media && (d.titleCard.media.sponsorLogo = qe), os(() => {
570
- var S;
571
- n(((S = c.current) == null ? void 0 : S.getBoundingClientRect().height) || 0);
590
+ is(() => {
591
+ var y;
592
+ n(((y = d.current) == null ? void 0 : y.getBoundingClientRect().height) || 0);
572
593
  }, [n]);
573
594
  const {
574
595
  loading: b,
575
- throttled: A
576
- } = Pe(f);
577
- return p && m && d && r.current && !A ? /* @__PURE__ */ t(le, {
578
- container: r,
596
+ throttled: S
597
+ } = Qe(f);
598
+ return p && v && r && i.current && !S ? /* @__PURE__ */ t(de, {
599
+ container: i,
579
600
  useContainer: !a,
580
- children: /* @__PURE__ */ t(zs, {
601
+ children: /* @__PURE__ */ t(Bs, {
581
602
  notification: s,
582
- setOpened: v,
583
- gamification: m,
584
- onboardingOpts: d,
585
- deepLink: m.deepLink,
603
+ setOpened: c,
604
+ gamification: v,
605
+ onboardingOpts: r,
606
+ deepLink: v.deepLink,
586
607
  loading: b,
587
- renderToNode: r,
608
+ renderToNode: i,
588
609
  sdk: e
589
610
  })
590
- }) : /* @__PURE__ */ y(D, {
591
- children: [/* @__PURE__ */ t(oe, {
592
- ref: c,
611
+ }) : /* @__PURE__ */ m(L, {
612
+ children: [/* @__PURE__ */ t(ie, {
613
+ ref: d,
593
614
  style: {
594
615
  position: "absolute",
595
616
  visibility: "hidden"
596
617
  },
597
- children: /* @__PURE__ */ t(te, {
618
+ children: /* @__PURE__ */ t(oe, {
598
619
  close: () => {
599
620
  },
600
621
  action: () => {
601
622
  },
602
- onboarding: d
623
+ onboarding: r
603
624
  })
604
- }), /* @__PURE__ */ t(Ms, {
625
+ }), /* @__PURE__ */ t(zs, {
605
626
  style: o,
606
627
  hiding: s.hiding,
607
- children: /* @__PURE__ */ t(oe, {
608
- children: /* @__PURE__ */ t(te, {
628
+ children: /* @__PURE__ */ t(ie, {
629
+ children: /* @__PURE__ */ t(oe, {
609
630
  close: s.close,
610
631
  action: () => {
611
- var S;
612
- v(!0), (((S = r.current) == null ? void 0 : S.getBoundingClientRect().y) || 0) < 0 && U(r, N.size, {
632
+ var y;
633
+ c(!0), (((y = i.current) == null ? void 0 : y.getBoundingClientRect().y) || 0) < 0 && M(i, N.size, {
613
634
  behavior: "smooth"
614
635
  });
615
636
  },
616
- onboarding: d
637
+ onboarding: r
617
638
  })
618
639
  })
619
640
  })]
620
641
  });
621
- }, Ws = () => F, js = /* @__PURE__ */ h(Ws())({
642
+ }, Gs = () => U, Hs = /* @__PURE__ */ h(Gs())({
622
643
  name: "Container",
623
- class: "c1cu0box",
644
+ class: "c8ol1ve",
624
645
  propsAsIs: !0
625
- }), pe = /* @__PURE__ */ h("div")({
646
+ }), he = /* @__PURE__ */ h("div")({
626
647
  name: "InnerContainer",
627
- class: "i1p534h4",
648
+ class: "iqfywam",
628
649
  propsAsIs: !1
629
- }), Gs = () => pe, Hs = /* @__PURE__ */ h(Gs())({
650
+ }), js = () => he, Xs = /* @__PURE__ */ h(js())({
630
651
  name: "HiddenContainer",
631
- class: "hyh76ez",
652
+ class: "hokmtod",
632
653
  propsAsIs: !0
633
- }), Xs = /* @__PURE__ */ h("div")({
654
+ }), Ys = /* @__PURE__ */ h("div")({
634
655
  name: "NotificationRefreshing",
635
- class: "n1pj3cvw",
656
+ class: "n192d1q8",
636
657
  propsAsIs: !1
637
- }), Ys = () => _e, Zs = /* @__PURE__ */ h(Ys())({
658
+ }), Zs = () => qe, Js = /* @__PURE__ */ h(Zs())({
638
659
  name: "Pill",
639
- class: "pk13by5",
660
+ class: "p1lha68t",
640
661
  propsAsIs: !0
641
- }), Js = (e) => {
642
- const [s, n] = $(0), o = L(null), r = G((i) => {
643
- o.current = i;
662
+ }), en = (e) => {
663
+ const [s, n] = E(0), o = $(null), i = R((l) => {
664
+ o.current = l;
644
665
  }, []);
645
666
  k(() => {
646
- var i;
647
- const l = (i = o.current) == null ? void 0 : i.getBoundingClientRect();
648
- l && n(l.height);
667
+ var l;
668
+ const d = (l = o.current) == null ? void 0 : l.getBoundingClientRect();
669
+ d && n(d.height);
649
670
  }, [e]);
650
- const a = G((i) => {
651
- n(i);
671
+ const a = R((l) => {
672
+ n(l);
652
673
  }, []);
653
- return [r, s, a];
654
- }, en = ({
674
+ return [i, s, a];
675
+ }, sn = ({
655
676
  sdk: e,
656
677
  notification: s,
657
678
  appNode: n,
658
679
  responsiveStore: o
659
680
  }) => {
660
- var r, a;
681
+ var i, a;
661
682
  const {
662
- sdkInDesktopView: i
683
+ sdkInDesktopView: l
663
684
  } = u(o, {
664
685
  keys: ["sdkInDesktopView"]
665
686
  }), {
666
- sdk: l
667
- } = M(), [c, d, p] = Js(s.id);
668
- return s.type === O.QUESTION ? /* @__PURE__ */ y(D, {
669
- children: [/* @__PURE__ */ t(Hs, {
670
- ref: c,
671
- children: /* @__PURE__ */ t(B, {
687
+ sdk: d
688
+ } = B(), [r, p, c] = en(s.id);
689
+ return s.type === x.QUESTION ? /* @__PURE__ */ m(L, {
690
+ children: [/* @__PURE__ */ t(Xs, {
691
+ ref: r,
692
+ children: /* @__PURE__ */ t(G, {
672
693
  ...s
673
694
  })
674
- }), /* @__PURE__ */ y(js, {
695
+ }), /* @__PURE__ */ m(Hs, {
675
696
  style: {
676
- height: s.hiding ? 0 : d
697
+ height: s.hiding ? 0 : p
677
698
  },
678
699
  hiding: s.hiding,
679
- children: [/* @__PURE__ */ t(pe, {
700
+ children: [/* @__PURE__ */ t(he, {
680
701
  style: {
681
702
  height: "100%"
682
703
  },
683
- children: /* @__PURE__ */ t(B, {
704
+ children: /* @__PURE__ */ t(G, {
684
705
  ...s,
685
- controlVideo: l == null ? void 0 : l.controlVideoPlayer
706
+ controlVideo: d == null ? void 0 : d.controlVideoPlayer
686
707
  })
687
- }), /* @__PURE__ */ t(Xs, {}, s.id)]
708
+ }), /* @__PURE__ */ t(Ys, {}, s.id)]
688
709
  })]
689
- }) : s.type === O.QUESTION_RESOLVED && (a = (r = s.data) == null ? void 0 : r.question) != null && a.predictionResult ? /* @__PURE__ */ t(Fe, {
710
+ }) : s.type === x.QUESTION_RESOLVED && (a = (i = s.data) == null ? void 0 : i.question) != null && a.predictionResult ? /* @__PURE__ */ t(Ke, {
690
711
  style: {
691
- height: s.hiding ? 0 : d
712
+ height: s.hiding ? 0 : p
692
713
  },
693
- saveHeight: p,
714
+ saveHeight: c,
694
715
  close: s.close,
695
716
  hiding: s.hiding,
696
717
  ...s.data.question
697
- }) : s.type === O.ONBOARDING ? /* @__PURE__ */ t(Bs, {
718
+ }) : s.type === x.ONBOARDING ? /* @__PURE__ */ t(Ws, {
698
719
  style: {
699
- height: s.hiding ? 0 : d
720
+ height: s.hiding ? 0 : p
700
721
  },
701
- saveHeight: p,
722
+ saveHeight: c,
702
723
  sdk: e,
703
724
  notification: s,
704
- sdkInDesktopView: i,
725
+ sdkInDesktopView: l,
705
726
  appNode: n,
706
727
  responsiveStore: o
707
728
  }) : null;
708
- }, sn = "p6vl6vu", nn = ({
729
+ }, nn = "p7vfi6t", tn = ({
709
730
  pill: e,
710
731
  setPill: s,
711
732
  appNode: n,
712
733
  headerNode: o,
713
- scrollNode: r,
734
+ scrollNode: i,
714
735
  responsiveStore: a,
715
- scrollStore: i
736
+ scrollStore: l
716
737
  }) => {
717
- var l, c;
738
+ var d, r;
718
739
  const {
719
- screen: d
740
+ screen: p
720
741
  } = u(a, {
721
742
  keys: ["screen"]
722
743
  }), {
723
- tabsShown: p,
744
+ tabsShown: c,
724
745
  scrollPosition: v
725
- } = u(i, {
746
+ } = u(l, {
726
747
  keys: ["tabsShown", "scrollPosition"]
727
748
  });
728
749
  k(() => {
729
750
  a.get().sdkInDesktopView ? v < 50 && s(null) : v > -50 && s(null);
730
751
  }, [v, a, s]);
731
- const m = a.get().sdkInDesktopView ? n : o;
732
- return !e || !m.current ? null : Ke.createPortal(/* @__PURE__ */ t(Zs, {
733
- title: e.type === O.QUESTION_RESOLVED ? "Prediction result" : `New ${((c = Me[(l = e.data) == null ? void 0 : l.questionType]) == null ? void 0 : c.label) || "notification"}`,
752
+ const f = a.get().sdkInDesktopView ? n : o;
753
+ return !e || !f.current ? null : Me.createPortal(/* @__PURE__ */ t(Js, {
754
+ title: e.type === x.QUESTION_RESOLVED ? "Prediction result" : `New ${((r = Ue[(d = e.data) == null ? void 0 : d.questionType]) == null ? void 0 : r.label) || "notification"}`,
734
755
  onClick: () => {
735
- var f;
736
- a.get().sdkInDesktopView ? (f = r.current) == null || f.scrollTo({
756
+ var N;
757
+ a.get().sdkInDesktopView ? (N = i.current) == null || N.scrollTo({
737
758
  top: 0,
738
759
  behavior: "smooth"
739
- }) : U(n, d.size, {
760
+ }) : M(n, p.size, {
740
761
  behavior: "smooth"
741
762
  }), s(null);
742
763
  },
743
- className: ze(p && sn, "sl-pill-button")
744
- }), m.current);
745
- }, tn = ({
764
+ className: ze(c && nn, "sl-pill-button")
765
+ }), f.current);
766
+ }, on = ({
746
767
  sdk: e,
747
768
  headerNode: s,
748
769
  scrollNode: n,
749
770
  responsiveStore: o,
750
- appNode: r,
771
+ appNode: i,
751
772
  scrollStore: a
752
773
  }) => {
753
- const [i] = $(e.getNotificationsStore()), l = u(i), [c, d] = $(null), p = w(() => e.getActiveNotification(), [e, l]);
774
+ const [l] = E(e.getNotificationsStore()), d = u(l), [r, p] = E(null), c = C(() => e.getActiveNotification(), [e, d]);
754
775
  return k(() => {
755
- p && Ue.emit("notification", {
776
+ c && Fe.emit("notification", {
756
777
  action: "rendered",
757
778
  payload: {
758
- questionId: p.data.questionId,
759
- questionType: p.data.questionType
779
+ questionId: c.data.questionId,
780
+ questionType: c.data.questionType
760
781
  }
761
782
  });
762
- }, [p]), k(() => {
763
- p && (o.get().sdkInDesktopView || o.get().sdkInView) && (!o.get().sdkInDesktopView && o.get().sdkInView && d(p), o.get().sdkInDesktopView && window.requestAnimationFrame(() => {
764
- a.get().scrollPosition !== 0 && d(p);
783
+ }, [c]), k(() => {
784
+ c && (o.get().sdkInDesktopView || o.get().sdkInView) && (!o.get().sdkInDesktopView && o.get().sdkInView && p(c), o.get().sdkInDesktopView && window.requestAnimationFrame(() => {
785
+ a.get().scrollPosition !== 0 && p(c);
765
786
  }));
766
- }, [p]), k(() => {
767
- p || d(null);
768
- }, [p]), /* @__PURE__ */ y(D, {
769
- children: [!c && p && /* @__PURE__ */ t(en, {
787
+ }, [c]), k(() => {
788
+ c || p(null);
789
+ }, [c]), /* @__PURE__ */ m(L, {
790
+ children: [!r && c && /* @__PURE__ */ t(sn, {
770
791
  headerNode: s,
771
- appNode: r,
792
+ appNode: i,
772
793
  sdk: e,
773
- notification: p,
794
+ notification: c,
774
795
  responsiveStore: o
775
- }), c && /* @__PURE__ */ t(nn, {
776
- pill: c,
777
- setPill: d,
778
- appNode: r,
779
- notification: p,
796
+ }), r && /* @__PURE__ */ t(tn, {
797
+ pill: r,
798
+ setPill: p,
799
+ appNode: i,
800
+ notification: c,
780
801
  headerNode: s,
781
802
  scrollNode: n,
782
803
  scrollStore: a,
783
804
  responsiveStore: o
784
805
  })]
785
806
  });
786
- }, on = (e) => {
787
- const s = L(""), [n, o] = $(!1), r = u(e.status), a = u(e.sdkStore.slStreamId), i = u(e.userId()), l = u(e.getActiveFeature()), c = r === "ready" && !!a.data;
807
+ }, rn = (e) => {
808
+ const s = $(""), [n, o] = E(!1), i = u(e.status), a = u(e.sdkStore.slStreamId), l = u(e.userId()), d = u(e.getActiveFeature()), r = i === "ready" && !!a.data;
788
809
  k(() => {
789
- const v = e.getFeature(x.GAMES);
810
+ const v = e.getFeature(D.GAMES);
790
811
  v && (v.closeQuestion(), v.closeUser());
791
- }, [l, e]);
792
- const d = (v) => {
793
- s.current = v, o(!0), e.initializeApp({ skipOrganizationSettings: !0 }).then(({ enabled: m, err: f }) => {
794
- if (!f && m) {
795
- e.isUserAuthorized().then((N) => {
796
- N || e.disableApp();
797
- });
798
- return;
799
- }
800
- });
801
- }, p = () => {
812
+ }, [d, e]);
813
+ const p = R(
814
+ (v) => {
815
+ s.current = v, o(!0), e.initializeApp({ skipOrganizationSettings: !0 }).then(({ enabled: f, err: N }) => {
816
+ if (!N && f) {
817
+ e.isUserAuthorized().then((b) => {
818
+ b || e.disableApp();
819
+ });
820
+ return;
821
+ }
822
+ });
823
+ },
824
+ [e]
825
+ ), c = R(() => {
802
826
  o(!1), e.disableApp();
803
- };
827
+ }, [e]);
804
828
  return k(() => {
805
- if (!i) {
806
- c && e.disableApp();
829
+ if (!l) {
830
+ r && e.disableApp();
807
831
  return;
808
832
  }
809
- if (i && s.current && n) {
833
+ if (l && s.current && n) {
810
834
  e.initializeApp({ skipOrganizationSettings: !0 }).then(() => {
811
835
  e.createEventSession(s.current);
812
836
  });
813
837
  return;
814
838
  }
815
- }, [i]), k(() => () => {
839
+ }, [l]), k(() => () => {
816
840
  o(!1), e.disableApp();
817
841
  }, [o, e]), {
818
842
  sdkEnabled: n,
819
- sdkReady: c,
820
- activateEventWithId: d,
821
- deactivate: p,
822
- isLogged: !!i
843
+ sdkReady: r,
844
+ activateEventWithId: p,
845
+ deactivate: c,
846
+ isLogged: !!l
823
847
  };
824
- }, rn = ({ sdk: e, className: s, scrollStore: n, appNode: o, scrollNode: r, responsiveStore: a }) => {
825
- const [, i] = He(e);
848
+ }, an = ({ sdk: e, className: s, scrollStore: n, appNode: o, scrollNode: i, responsiveStore: a }) => {
849
+ const [, l] = je(e);
826
850
  return /* @__PURE__ */ t(
827
- Es,
851
+ Cs,
828
852
  {
829
853
  className: s,
830
- scrollNode: r,
854
+ scrollNode: i,
831
855
  appNode: o,
832
856
  scrollStore: n,
833
- feature: i,
857
+ feature: l,
834
858
  responsiveStore: a,
835
859
  sdk: e
836
860
  }
837
861
  );
838
- }, an = ({ sdk: e, className: s, appNode: n, responsiveStore: o }) => {
839
- const r = u(e.featuresList.getStore());
840
- return r ? Array.from(r, (a) => {
841
- const i = e.getFeature(a);
842
- return i ? /* @__PURE__ */ t(
843
- ws,
862
+ }, ln = ({ sdk: e, className: s, appNode: n, responsiveStore: o }) => {
863
+ const i = u(e.featuresList.getStore());
864
+ return i ? Array.from(i, (a) => {
865
+ const l = e.getFeature(a);
866
+ return l ? /* @__PURE__ */ t(
867
+ $s,
844
868
  {
845
869
  className: s,
846
870
  appNode: n,
847
- feature: i,
871
+ feature: l,
848
872
  responsiveStore: o,
849
873
  sdk: e
850
874
  },
851
875
  a
852
876
  ) : null;
853
877
  }) : null;
854
- }, ln = ({ sdk: e, event: s }) => {
855
- const n = L(null), o = L(null), [r] = Be(n), [a, i] = We(n, r), { sdkEnabled: l, sdkReady: c, activateEventWithId: d, deactivate: p, isLogged: v } = on(e);
878
+ }, dn = ({ sdk: e, event: s }) => {
879
+ const n = $(null), o = $(null), [i] = Be(n), [a, l] = We(n, i), { sdkEnabled: d, sdkReady: r, activateEventWithId: p, deactivate: c, isLogged: v } = rn(e);
856
880
  k(() => {
857
- s ? (e.createEventSession(s), d(s)) : p();
858
- }, [s, d, p, e]), P(n, { enabled: l, event: "click", listener: Xe }), P(a, {
859
- enabled: l,
881
+ s ? (e.createEventSession(s), p(s)) : c();
882
+ }, [s, p, c, e]), _(n, { enabled: d, event: "click", listener: Xe }), _(a, {
883
+ enabled: d,
860
884
  event: "scrollend",
861
885
  listener: Ye,
862
886
  useDomNode: !0
863
- }), P(a, {
864
- enabled: l,
887
+ }), _(a, {
888
+ enabled: d,
865
889
  event: "click",
866
890
  listener: Ze,
867
891
  useDomNode: !0
868
892
  });
869
- const m = w(() => ({ sdk: e }), [e]);
893
+ const f = C(() => ({ sdk: e }), [e]);
870
894
  return k(() => {
871
895
  import("./gamification-feature.js");
872
- }, []), /* @__PURE__ */ t(ce.Provider, { value: m, children: /* @__PURE__ */ y(je, { ref: n, children: [
873
- l && /* @__PURE__ */ t(Ds, { sdk: e }),
874
- /* @__PURE__ */ y(Ge, { className: "sl-hide-on-modal", ref: a, "data-nav": l.toString(), children: [
875
- c && /* @__PURE__ */ t(
876
- tn,
896
+ }, []), /* @__PURE__ */ t(ue.Provider, { value: f, children: /* @__PURE__ */ m(Ge, { ref: n, children: [
897
+ d && /* @__PURE__ */ t(Ts, { className: q, sdk: e, ref: o }),
898
+ /* @__PURE__ */ m(He, { className: "sl-hide-on-modal", ref: a, "data-nav": d.toString(), children: [
899
+ r && /* @__PURE__ */ t(
900
+ on,
877
901
  {
878
902
  sdk: e,
879
903
  scrollNode: a,
880
904
  headerNode: o,
881
905
  appNode: n,
882
- scrollStore: i,
883
- responsiveStore: r
906
+ scrollStore: l,
907
+ responsiveStore: i
884
908
  }
885
909
  ),
886
- c && /* @__PURE__ */ t(
887
- rn,
910
+ r && /* @__PURE__ */ t(
911
+ an,
888
912
  {
889
- scrollStore: i,
890
- responsiveStore: r,
913
+ scrollStore: l,
914
+ responsiveStore: i,
891
915
  scrollNode: a,
892
916
  appNode: n,
893
- className: W,
917
+ className: q,
894
918
  sdk: e
895
919
  }
896
920
  ),
897
- c && /* @__PURE__ */ t(an, { responsiveStore: r, appNode: n, className: W, sdk: e })
921
+ r && /* @__PURE__ */ t(ln, { responsiveStore: i, appNode: n, className: q, sdk: e })
898
922
  ] }),
899
- l && !v && /* @__PURE__ */ t(
923
+ d && !v && /* @__PURE__ */ t(
900
924
  "div",
901
925
  {
902
926
  style: { display: "flex", alignItems: "center", justifyContent: "center", width: "100%", height: "100%" },
@@ -904,18 +928,18 @@ const ls = {
904
928
  }
905
929
  )
906
930
  ] }) });
907
- }, dn = ({ children: e, style: s }) => /* @__PURE__ */ t("div", { className: "StreamLayerSDKTheme", children: /* @__PURE__ */ t("div", { className: Je, style: s, children: e }) }), mn = () => {
908
- const { sdk: e } = K(de);
931
+ }, cn = ({ children: e, style: s }) => /* @__PURE__ */ t("div", { className: "StreamLayerSDKTheme", children: /* @__PURE__ */ t("div", { className: Je, style: s, children: e }) }), fn = () => {
932
+ const { sdk: e } = z(pe);
909
933
  return e;
910
- }, yn = ({ event: e }) => {
911
- const { sdk: s, status: n } = K(de);
912
- if (n === j.UNSET)
934
+ }, kn = ({ event: e }) => {
935
+ const { sdk: s, status: n } = z(pe);
936
+ if (n === H.UNSET)
913
937
  throw new Error("Wrap app in `StreamLayerProvider`");
914
- return n === j.CONNECTED ? /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: "wait" }) : s === null ? /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: "sdk not initialized" }) : /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ t(dn, { children: /* @__PURE__ */ t(ln, { sdk: s, event: e }) }) });
938
+ return n === H.CONNECTED ? /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: "wait" }) : s === null ? /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: "sdk not initialized" }) : /* @__PURE__ */ t("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ t(cn, { children: /* @__PURE__ */ t(dn, { sdk: s, event: e }) }) });
915
939
  };
916
940
  export {
917
- yn as S,
918
- dn as i,
919
- gn as q,
920
- mn as u
941
+ mn as E,
942
+ kn as S,
943
+ cn as i,
944
+ fn as u
921
945
  };