@streamlayer/react 1.3.1 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/advertisement.d.ts +1 -0
- package/lib/app/provider.d.ts +14 -2
- package/lib/cjs/advertisement.js +1 -1
- package/lib/cjs/index2.js +1 -1
- package/lib/cjs/masters2.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/provider.js +10 -10
- package/lib/cjs/useStreamLayerApp2.js +9 -9
- package/lib/dist/cjs/masters.js +44 -44
- package/lib/dist/es/masters.js +3962 -3958
- package/lib/dist/style.css +1 -1
- package/lib/es/advertisement.js +257 -161
- package/lib/es/index2.js +108 -108
- package/lib/es/masters2.js +1 -1
- package/lib/es/points.js +6 -6
- package/lib/es/provider.js +674 -669
- package/lib/es/useStreamLayerApp2.js +1397 -1396
- package/lib/index.d.ts +1 -1
- package/lib/style.css +1 -1
- package/package.json +13 -13
package/lib/es/index2.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
var fe = Object.defineProperty;
|
|
2
2
|
var ke = (e, s, n) => s in e ? fe(e, s, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[s] = n;
|
|
3
3
|
var m = (e, s, n) => ke(e, typeof s != "symbol" ? s + "" : s, n);
|
|
4
|
-
import { C,
|
|
5
|
-
import { a4 as P, u, F as ye, s as h, T as
|
|
4
|
+
import { C, h as G, Q as x, S as w } from "./useStreamLayerApp2.js";
|
|
5
|
+
import { a4 as P, u, F as ye, s as h, T as re, i as Ne, p as be, b as Se, N as Ie, k as Ee, M as Ae, f as Ce, S as we, C as $e, g as De, O as le, m as q, l as Le, h as Te, j as Oe, n as de, o as xe, q as Re, r as Ve, t as M, w as Pe, x as ce, y as U, z as qe, A as H, I as O, a as pe, D as _e, E as Fe, G as Qe, e as Ke, H as R, J as j, K as Me, P as Ue, R as ze, c as ue, V as We, W as Be, L as _, _ as Ge, v as F, $ as He, a0 as je, X as Xe, Y as Ye, Z as Ze, a5 as Je, a2 as he, a3 as X } from "./provider.js";
|
|
6
6
|
import { jsx as t, jsxs as g, Fragment as L } from "react/jsx-runtime";
|
|
7
7
|
import { createContext as es, useContext as z, useRef as D, useState as E, useEffect as k, useTransition as ss, lazy as ns, useMemo as $, Suspense as ts, forwardRef as os, useLayoutEffect as is, useCallback as V } from "react";
|
|
8
8
|
window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));
|
|
9
|
-
function
|
|
9
|
+
function as(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 rs(e) {
|
|
|
14
14
|
e.name === "QuotaExceededError" || // Firefox
|
|
15
15
|
e.name === "NS_ERROR_DOM_QUOTA_REACHED");
|
|
16
16
|
}
|
|
17
|
-
class
|
|
17
|
+
class rs {
|
|
18
18
|
constructor(s = "main", n = window.localStorage) {
|
|
19
19
|
m(this, "delimiter", ":");
|
|
20
20
|
m(this, "prefix");
|
|
@@ -28,8 +28,8 @@ class as {
|
|
|
28
28
|
const n = s.pop() || "", o = this.generateKey(s);
|
|
29
29
|
try {
|
|
30
30
|
this.storage.setItem(o, n);
|
|
31
|
-
} catch (
|
|
32
|
-
|
|
31
|
+
} catch (a) {
|
|
32
|
+
as(a) && this.storage === window.sessionStorage && (window.sessionStorage.removeItem("slstreamlogs"), this.storage.setItem(o, n));
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
35
|
m(this, "read", (...s) => {
|
|
@@ -53,7 +53,7 @@ var I;
|
|
|
53
53
|
(function(e) {
|
|
54
54
|
e.SCHEMA = "schema", e.EXTERNAL_TOKEN = "eToken", e.TOKEN = "token";
|
|
55
55
|
})(I || (I = {}));
|
|
56
|
-
class ls extends
|
|
56
|
+
class ls extends rs {
|
|
57
57
|
constructor() {
|
|
58
58
|
super("user");
|
|
59
59
|
// Schema
|
|
@@ -116,10 +116,10 @@ const ds = {
|
|
|
116
116
|
sdk: s,
|
|
117
117
|
children: n,
|
|
118
118
|
className: o,
|
|
119
|
-
noWait:
|
|
119
|
+
noWait: a
|
|
120
120
|
}) => {
|
|
121
|
-
const
|
|
122
|
-
if (!
|
|
121
|
+
const r = u(e.status), l = u(s.sdkStore.slStreamId);
|
|
122
|
+
if (!a) {
|
|
123
123
|
if (l != null && l.loading && !l.data)
|
|
124
124
|
return /* @__PURE__ */ t(Q, {
|
|
125
125
|
className: o,
|
|
@@ -130,7 +130,7 @@ const ds = {
|
|
|
130
130
|
className: o,
|
|
131
131
|
children: "Event is forbidden..."
|
|
132
132
|
});
|
|
133
|
-
if (
|
|
133
|
+
if (r !== ye.Ready)
|
|
134
134
|
return /* @__PURE__ */ t(Q, {
|
|
135
135
|
className: o,
|
|
136
136
|
children: "Wait feature..."
|
|
@@ -164,12 +164,12 @@ const ds = {
|
|
|
164
164
|
}) => {
|
|
165
165
|
const {
|
|
166
166
|
loading: o,
|
|
167
|
-
data:
|
|
167
|
+
data: a
|
|
168
168
|
} = e;
|
|
169
|
-
return
|
|
169
|
+
return a ? /* @__PURE__ */ t(Ie, {
|
|
170
170
|
vote: s,
|
|
171
171
|
close: n,
|
|
172
|
-
openedQuestion:
|
|
172
|
+
openedQuestion: a,
|
|
173
173
|
isLoading: !!o
|
|
174
174
|
}) : /* @__PURE__ */ t(Ee, {});
|
|
175
175
|
}, vs = ({
|
|
@@ -178,16 +178,16 @@ const ds = {
|
|
|
178
178
|
className: n,
|
|
179
179
|
hideHeader: o
|
|
180
180
|
}) => {
|
|
181
|
-
var
|
|
181
|
+
var a, r, l;
|
|
182
182
|
const d = u(e.openedQuestion.$store), i = u(e.openedQuestion.$extendedStore);
|
|
183
183
|
if (!d)
|
|
184
184
|
return null;
|
|
185
185
|
const c = d.type;
|
|
186
186
|
return /* @__PURE__ */ g(ps, {
|
|
187
187
|
className: n,
|
|
188
|
-
children: [!o && /* @__PURE__ */ t(
|
|
188
|
+
children: [!o && /* @__PURE__ */ t(re, {
|
|
189
189
|
close: e.closeQuestion,
|
|
190
|
-
type: ((
|
|
190
|
+
type: ((a = d.attributes) == null ? void 0 : a.type) || x.UNSET
|
|
191
191
|
}), c === "question" && /* @__PURE__ */ t(hs, {
|
|
192
192
|
vote: e.submitAnswer,
|
|
193
193
|
close: e.closeQuestion,
|
|
@@ -195,7 +195,7 @@ const ds = {
|
|
|
195
195
|
}), c !== "question" && /* @__PURE__ */ t(us, {
|
|
196
196
|
openedQuestion: d
|
|
197
197
|
}), !s && /* @__PURE__ */ t(Ne, {
|
|
198
|
-
sponsorLogo: (l = (
|
|
198
|
+
sponsorLogo: (l = (r = i.data) == null ? void 0 : r.sponsorship) == null ? void 0 : l.logo
|
|
199
199
|
})]
|
|
200
200
|
});
|
|
201
201
|
}, ms = /* @__PURE__ */ h("div")({
|
|
@@ -220,22 +220,22 @@ const ds = {
|
|
|
220
220
|
scrollStore: n
|
|
221
221
|
}) => {
|
|
222
222
|
const o = D(null), {
|
|
223
|
-
data:
|
|
224
|
-
hasMore:
|
|
223
|
+
data: a,
|
|
224
|
+
hasMore: r,
|
|
225
225
|
loading: l,
|
|
226
226
|
key: d
|
|
227
227
|
} = u(e.leaderboardList.$store), {
|
|
228
228
|
data: i
|
|
229
229
|
} = u(e.deepLink.$store), [c, p] = Ce(o);
|
|
230
|
-
return !
|
|
230
|
+
return !a.length && !l ? /* @__PURE__ */ t(gs, {
|
|
231
231
|
deepLink: i
|
|
232
232
|
}) : /* @__PURE__ */ g(L, {
|
|
233
233
|
children: [/* @__PURE__ */ t(we, {
|
|
234
|
-
items:
|
|
234
|
+
items: a,
|
|
235
235
|
scrollNode: s,
|
|
236
236
|
scrollStore: n,
|
|
237
237
|
fetchMore: e.leaderboardList.fetchMore,
|
|
238
|
-
hasMore:
|
|
238
|
+
hasMore: r,
|
|
239
239
|
openItemDetail: e.openUser,
|
|
240
240
|
currentUserId: e.currentUserId.get()
|
|
241
241
|
}, d), i && /* @__PURE__ */ t(fs, {
|
|
@@ -254,18 +254,18 @@ const ds = {
|
|
|
254
254
|
var s;
|
|
255
255
|
const [n, o] = E(void 0);
|
|
256
256
|
return k(() => {
|
|
257
|
-
const
|
|
258
|
-
|
|
257
|
+
const a = e.$store.subscribe((r) => {
|
|
258
|
+
r && o(r);
|
|
259
259
|
});
|
|
260
260
|
return () => {
|
|
261
|
-
|
|
261
|
+
a();
|
|
262
262
|
};
|
|
263
263
|
}, [e]), /* @__PURE__ */ t(le, { loading: !(n != null && n.summary), ...n == null ? void 0 : n.summary, successRate: (s = n == null ? void 0 : n.percentage) == null ? void 0 : s.correct });
|
|
264
|
-
}, bs = ({ gamification: e, className: s, scrollStore: n, scrollNode: o, appNode:
|
|
264
|
+
}, bs = ({ gamification: e, className: s, scrollStore: n, scrollNode: o, appNode: a, style: r, responsiveStore: l }) => {
|
|
265
265
|
const { tabsShown: d } = u(n, { keys: ["tabsShown"] }), [i, c] = E(q.HOME), [, p] = ss(), { sdkInDesktopView: v, screen: f } = u(l, { keys: ["sdkInDesktopView"] }), N = (S) => {
|
|
266
266
|
p(() => {
|
|
267
267
|
var y;
|
|
268
|
-
c(S), v === !1 && (((y =
|
|
268
|
+
c(S), v === !1 && (((y = a.current) == null ? void 0 : y.getBoundingClientRect().y) || 0) < 0 && M(a, f.size, { behavior: "instant" });
|
|
269
269
|
});
|
|
270
270
|
};
|
|
271
271
|
k(() => n.subscribe((S) => {
|
|
@@ -276,7 +276,7 @@ const ds = {
|
|
|
276
276
|
l.get().sdkInDesktopView ? n.setKey("tabsShown", S.scrollDirection === "backward") : n.setKey("tabsShown", S.scrollDirection === "forward");
|
|
277
277
|
}), [n, l]);
|
|
278
278
|
let b = "0px";
|
|
279
|
-
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__ */ g(Le, { className: s, style:
|
|
279
|
+
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__ */ g(Le, { className: s, style: r, children: [
|
|
280
280
|
/* @__PURE__ */ t(
|
|
281
281
|
Te,
|
|
282
282
|
{
|
|
@@ -311,22 +311,22 @@ const ds = {
|
|
|
311
311
|
scrollStore: s,
|
|
312
312
|
className: n,
|
|
313
313
|
appNode: o,
|
|
314
|
-
scrollNode:
|
|
315
|
-
responsiveStore:
|
|
314
|
+
scrollNode: a,
|
|
315
|
+
responsiveStore: r
|
|
316
316
|
}) => /* @__PURE__ */ t(bs, {
|
|
317
317
|
appNode: o,
|
|
318
318
|
scrollStore: s,
|
|
319
|
-
scrollNode:
|
|
319
|
+
scrollNode: a,
|
|
320
320
|
className: n,
|
|
321
321
|
gamification: e,
|
|
322
|
-
responsiveStore:
|
|
322
|
+
responsiveStore: r
|
|
323
323
|
}), As = ({
|
|
324
324
|
gamification: e,
|
|
325
325
|
className: s,
|
|
326
326
|
appNode: n,
|
|
327
327
|
responsiveStore: o
|
|
328
328
|
}) => {
|
|
329
|
-
const
|
|
329
|
+
const a = u(e.openedQuestion.$store), r = u(e.openedUser), {
|
|
330
330
|
sdkInDesktopView: l
|
|
331
331
|
} = u(o, {
|
|
332
332
|
keys: ["sdkInDesktopView"]
|
|
@@ -334,27 +334,27 @@ const ds = {
|
|
|
334
334
|
hiding: d,
|
|
335
335
|
onAnimationEnd: i
|
|
336
336
|
} = Pe();
|
|
337
|
-
if (!n.current || !
|
|
337
|
+
if (!n.current || !a && !r)
|
|
338
338
|
return null;
|
|
339
|
-
const c =
|
|
339
|
+
const c = a ? /* @__PURE__ */ t(oe, {
|
|
340
340
|
className: s,
|
|
341
341
|
hiding: d,
|
|
342
342
|
onAnimationEnd: i,
|
|
343
343
|
children: /* @__PURE__ */ t(vs, {
|
|
344
344
|
gamification: e
|
|
345
345
|
})
|
|
346
|
-
}) :
|
|
346
|
+
}) : r ? /* @__PURE__ */ t(oe, {
|
|
347
347
|
className: s,
|
|
348
348
|
hiding: d,
|
|
349
349
|
onAnimationEnd: i,
|
|
350
350
|
children: /* @__PURE__ */ g(Is, {
|
|
351
|
-
children: [/* @__PURE__ */ t(
|
|
351
|
+
children: [/* @__PURE__ */ t(re, {
|
|
352
352
|
label: "Friend's Rank",
|
|
353
353
|
close: e.closeUser
|
|
354
354
|
}), /* @__PURE__ */ t(de, {
|
|
355
355
|
children: /* @__PURE__ */ t(le, {
|
|
356
|
-
...
|
|
357
|
-
successRate: Es(
|
|
356
|
+
...r,
|
|
357
|
+
successRate: Es(r)
|
|
358
358
|
})
|
|
359
359
|
})]
|
|
360
360
|
})
|
|
@@ -364,18 +364,18 @@ const ds = {
|
|
|
364
364
|
useContainer: !l,
|
|
365
365
|
children: c
|
|
366
366
|
});
|
|
367
|
-
}, Cs = ns(() => import("./gamification-feature.js")), ws = ({ sdk: e, feature: s, className: n, scrollStore: o, appNode:
|
|
367
|
+
}, Cs = ns(() => import("./gamification-feature.js")), ws = ({ sdk: e, feature: s, className: n, scrollStore: o, appNode: a, scrollNode: r, responsiveStore: l }) => {
|
|
368
368
|
const d = $(() => s && s.featureConfig.get().type === w.GAMES ? /* @__PURE__ */ t(cs, { className: n, sdk: e, feature: s, children: /* @__PURE__ */ t(
|
|
369
369
|
Cs,
|
|
370
370
|
{
|
|
371
|
-
appNode:
|
|
371
|
+
appNode: a,
|
|
372
372
|
scrollStore: o,
|
|
373
|
-
scrollNode:
|
|
373
|
+
scrollNode: r,
|
|
374
374
|
className: n,
|
|
375
375
|
responsiveStore: l,
|
|
376
376
|
gamification: s
|
|
377
377
|
}
|
|
378
|
-
) }) : null, [e, s, n, l, o,
|
|
378
|
+
) }) : null, [e, s, n, l, o, r, a]);
|
|
379
379
|
return /* @__PURE__ */ t(
|
|
380
380
|
ts,
|
|
381
381
|
{
|
|
@@ -399,10 +399,10 @@ const ds = {
|
|
|
399
399
|
sdk: e,
|
|
400
400
|
className: s
|
|
401
401
|
}, n) => {
|
|
402
|
-
const o = u(e.sdkStore.organizationSettings),
|
|
403
|
-
const i = (
|
|
402
|
+
const o = u(e.sdkStore.organizationSettings), a = u(e.sdkStore.streamSettings), r = u(e.getActiveFeature()), l = $(() => {
|
|
403
|
+
const i = (a == null ? void 0 : a.data) || (o == null ? void 0 : o.data);
|
|
404
404
|
return i != null && i.overlays ? i.overlays : [];
|
|
405
|
-
}, [o,
|
|
405
|
+
}, [o, a]), d = $(() => [...l.filter(({
|
|
406
406
|
enableSdkButton: i,
|
|
407
407
|
type: c
|
|
408
408
|
}) => c === w.GAMES || i).map((i) => ({
|
|
@@ -424,20 +424,20 @@ const ds = {
|
|
|
424
424
|
id: "Channels",
|
|
425
425
|
onClick: () => e.closeFeature(),
|
|
426
426
|
label: "Channels",
|
|
427
|
-
active:
|
|
427
|
+
active: r === 0
|
|
428
428
|
}, "Channels"), ...d.map((i) => i.id === w.GAMES ? /* @__PURE__ */ t(O, {
|
|
429
429
|
...i,
|
|
430
|
-
active: i.id ===
|
|
430
|
+
active: i.id === r,
|
|
431
431
|
label: "StreamLayer +",
|
|
432
432
|
id: "featuredGroups",
|
|
433
433
|
icon: /* @__PURE__ */ t(Ls, {
|
|
434
434
|
name: "icon-btn-feature-groups",
|
|
435
|
-
"data-selected": i.id ===
|
|
435
|
+
"data-selected": i.id === r
|
|
436
436
|
})
|
|
437
437
|
}, i.id) : /* @__PURE__ */ t(O, {
|
|
438
438
|
...i,
|
|
439
439
|
icon: void 0,
|
|
440
|
-
active: i.id ===
|
|
440
|
+
active: i.id === r
|
|
441
441
|
}, i.id))]
|
|
442
442
|
}), !d.length && /* @__PURE__ */ t(H, {
|
|
443
443
|
children: [/* @__PURE__ */ t(O, {
|
|
@@ -487,11 +487,11 @@ const ds = {
|
|
|
487
487
|
class: "a1h1bk90",
|
|
488
488
|
propsAsIs: !1
|
|
489
489
|
}), ie = ({ close: e, action: s, onboarding: n }) => {
|
|
490
|
-
var o,
|
|
490
|
+
var o, a, r, l, d, i, c, p;
|
|
491
491
|
return /* @__PURE__ */ g(Os, { children: [
|
|
492
492
|
/* @__PURE__ */ t(xs, { onClick: e, children: /* @__PURE__ */ t(Vs, { name: "icon-cross" }) }),
|
|
493
|
-
((
|
|
494
|
-
/* @__PURE__ */ t(qs, { alt: "sponsor-logo", src: (l = (
|
|
493
|
+
((a = (o = n == null ? void 0 : n.titleCard) == null ? void 0 : o.media) == null ? void 0 : a.sponsorLogo) && /* @__PURE__ */ g(Ps, { children: [
|
|
494
|
+
/* @__PURE__ */ t(qs, { alt: "sponsor-logo", src: (l = (r = n == null ? void 0 : n.titleCard) == null ? void 0 : r.media) == null ? void 0 : l.sponsorLogo }),
|
|
495
495
|
/* @__PURE__ */ t(_s, { children: "PRESENTS" })
|
|
496
496
|
] }),
|
|
497
497
|
((d = n == null ? void 0 : n.titleCard) == null ? void 0 : d.title) && /* @__PURE__ */ t(Fs, { children: (i = n == null ? void 0 : n.titleCard) == null ? void 0 : i.title }),
|
|
@@ -524,7 +524,7 @@ const ds = {
|
|
|
524
524
|
name: "OnboardingNotificationContainer",
|
|
525
525
|
class: "o1vnouv7",
|
|
526
526
|
propsAsIs: !0
|
|
527
|
-
}),
|
|
527
|
+
}), ae = /* @__PURE__ */ h("div")({
|
|
528
528
|
name: "InnerContainer",
|
|
529
529
|
class: "i59uefw",
|
|
530
530
|
propsAsIs: !1
|
|
@@ -533,17 +533,17 @@ const ds = {
|
|
|
533
533
|
onboardingOpts: s,
|
|
534
534
|
notification: n,
|
|
535
535
|
gamification: o,
|
|
536
|
-
loading:
|
|
537
|
-
sdk:
|
|
536
|
+
loading: a,
|
|
537
|
+
sdk: r
|
|
538
538
|
}) => {
|
|
539
539
|
var l, d, i, c, p, v, f;
|
|
540
540
|
const N = u(o.friends.getStore()), [b, S] = E(void 0), y = $(() => {
|
|
541
541
|
var A, T;
|
|
542
|
-
const B =
|
|
542
|
+
const B = r.getInviter();
|
|
543
543
|
return B ? (T = (A = N.data) == null ? void 0 : A.find(({
|
|
544
544
|
slId: ge
|
|
545
545
|
}) => ge === B)) == null ? void 0 : T.name : "";
|
|
546
|
-
}, [N.data,
|
|
546
|
+
}, [N.data, r]);
|
|
547
547
|
return k(() => {
|
|
548
548
|
const A = e.$store.subscribe((T) => {
|
|
549
549
|
T && S(T.data);
|
|
@@ -553,7 +553,7 @@ const ds = {
|
|
|
553
553
|
};
|
|
554
554
|
}, [e.$store]), /* @__PURE__ */ t(Ms, {
|
|
555
555
|
children: /* @__PURE__ */ t(Fe, {
|
|
556
|
-
loading:
|
|
556
|
+
loading: a,
|
|
557
557
|
rules: [{
|
|
558
558
|
label: "Answer as many questions as you like.",
|
|
559
559
|
icon: "icon-btn-feature-groups"
|
|
@@ -579,7 +579,7 @@ const ds = {
|
|
|
579
579
|
(A = n.close) == null || A.call(n);
|
|
580
580
|
},
|
|
581
581
|
gamification: o,
|
|
582
|
-
sdk:
|
|
582
|
+
sdk: r,
|
|
583
583
|
inviterName: y
|
|
584
584
|
})
|
|
585
585
|
});
|
|
@@ -588,8 +588,8 @@ const ds = {
|
|
|
588
588
|
notification: s,
|
|
589
589
|
saveHeight: n,
|
|
590
590
|
style: o,
|
|
591
|
-
appNode:
|
|
592
|
-
sdkInDesktopView:
|
|
591
|
+
appNode: a,
|
|
592
|
+
sdkInDesktopView: r,
|
|
593
593
|
responsiveStore: l
|
|
594
594
|
}) => {
|
|
595
595
|
const d = D(null), i = s.data.onboarding, [c, p] = E(i == null ? void 0 : i.instantOpen), v = e.getFeature(w.GAMES), f = $(() => K == null ? void 0 : K.map(({
|
|
@@ -607,9 +607,9 @@ const ds = {
|
|
|
607
607
|
loading: b,
|
|
608
608
|
throttled: S
|
|
609
609
|
} = _e(f);
|
|
610
|
-
return c && v && i &&
|
|
611
|
-
container:
|
|
612
|
-
useContainer: !
|
|
610
|
+
return c && v && i && a.current && !S ? /* @__PURE__ */ t(ce, {
|
|
611
|
+
container: a,
|
|
612
|
+
useContainer: !r,
|
|
613
613
|
children: /* @__PURE__ */ t(Ws, {
|
|
614
614
|
notification: s,
|
|
615
615
|
setOpened: p,
|
|
@@ -617,11 +617,11 @@ const ds = {
|
|
|
617
617
|
onboardingOpts: i,
|
|
618
618
|
deepLink: v.deepLink,
|
|
619
619
|
loading: b,
|
|
620
|
-
renderToNode:
|
|
620
|
+
renderToNode: a,
|
|
621
621
|
sdk: e
|
|
622
622
|
})
|
|
623
623
|
}) : /* @__PURE__ */ g(L, {
|
|
624
|
-
children: [/* @__PURE__ */ t(
|
|
624
|
+
children: [/* @__PURE__ */ t(ae, {
|
|
625
625
|
ref: d,
|
|
626
626
|
style: {
|
|
627
627
|
position: "absolute",
|
|
@@ -637,12 +637,12 @@ const ds = {
|
|
|
637
637
|
}), /* @__PURE__ */ t(zs, {
|
|
638
638
|
style: o,
|
|
639
639
|
hiding: s.hiding,
|
|
640
|
-
children: /* @__PURE__ */ t(
|
|
640
|
+
children: /* @__PURE__ */ t(ae, {
|
|
641
641
|
children: /* @__PURE__ */ t(ie, {
|
|
642
642
|
close: s.close,
|
|
643
643
|
action: () => {
|
|
644
644
|
var y;
|
|
645
|
-
p(!0), (((y =
|
|
645
|
+
p(!0), (((y = a.current) == null ? void 0 : y.getBoundingClientRect().y) || 0) < 0 && M(a, N.size, {
|
|
646
646
|
behavior: "smooth"
|
|
647
647
|
});
|
|
648
648
|
},
|
|
@@ -672,7 +672,7 @@ const ds = {
|
|
|
672
672
|
class: "p1lha68t",
|
|
673
673
|
propsAsIs: !0
|
|
674
674
|
}), en = (e) => {
|
|
675
|
-
const [s, n] = E(0), o = D(null),
|
|
675
|
+
const [s, n] = E(0), o = D(null), a = V((l) => {
|
|
676
676
|
o.current = l;
|
|
677
677
|
}, []);
|
|
678
678
|
k(() => {
|
|
@@ -680,17 +680,17 @@ const ds = {
|
|
|
680
680
|
const d = (l = o.current) == null ? void 0 : l.getBoundingClientRect();
|
|
681
681
|
d && n(d.height);
|
|
682
682
|
}, [e]);
|
|
683
|
-
const
|
|
683
|
+
const r = V((l) => {
|
|
684
684
|
n(l);
|
|
685
685
|
}, []);
|
|
686
|
-
return [
|
|
686
|
+
return [a, s, r];
|
|
687
687
|
}, sn = ({
|
|
688
688
|
sdk: e,
|
|
689
689
|
notification: s,
|
|
690
690
|
appNode: n,
|
|
691
691
|
responsiveStore: o
|
|
692
692
|
}) => {
|
|
693
|
-
var
|
|
693
|
+
var a, r;
|
|
694
694
|
const {
|
|
695
695
|
sdkInDesktopView: l
|
|
696
696
|
} = u(o, {
|
|
@@ -719,7 +719,7 @@ const ds = {
|
|
|
719
719
|
})
|
|
720
720
|
}), /* @__PURE__ */ t(Ys, {}, s.id)]
|
|
721
721
|
})]
|
|
722
|
-
}) : s.type === R.QUESTION_RESOLVED && (
|
|
722
|
+
}) : s.type === R.QUESTION_RESOLVED && (r = (a = s.data) == null ? void 0 : a.question) != null && r.predictionResult ? /* @__PURE__ */ t(Me, {
|
|
723
723
|
style: {
|
|
724
724
|
height: s.hiding ? 0 : c
|
|
725
725
|
},
|
|
@@ -743,14 +743,14 @@ const ds = {
|
|
|
743
743
|
setPill: s,
|
|
744
744
|
appNode: n,
|
|
745
745
|
headerNode: o,
|
|
746
|
-
scrollNode:
|
|
747
|
-
responsiveStore:
|
|
746
|
+
scrollNode: a,
|
|
747
|
+
responsiveStore: r,
|
|
748
748
|
scrollStore: l
|
|
749
749
|
}) => {
|
|
750
750
|
var d, i;
|
|
751
751
|
const {
|
|
752
752
|
screen: c
|
|
753
|
-
} = u(
|
|
753
|
+
} = u(r, {
|
|
754
754
|
keys: ["screen"]
|
|
755
755
|
}), {
|
|
756
756
|
tabsShown: p,
|
|
@@ -759,14 +759,14 @@ const ds = {
|
|
|
759
759
|
keys: ["tabsShown", "scrollPosition"]
|
|
760
760
|
});
|
|
761
761
|
k(() => {
|
|
762
|
-
|
|
763
|
-
}, [v,
|
|
764
|
-
const f =
|
|
762
|
+
r.get().sdkInDesktopView ? v < 50 && s(null) : v > -50 && s(null);
|
|
763
|
+
}, [v, r, s]);
|
|
764
|
+
const f = r.get().sdkInDesktopView ? n : o;
|
|
765
765
|
return !e || !f.current ? null : Ue.createPortal(/* @__PURE__ */ t(Js, {
|
|
766
766
|
title: e.type === R.QUESTION_RESOLVED ? "Prediction result" : `New ${((i = ze[(d = e.data) == null ? void 0 : d.questionType]) == null ? void 0 : i.label) || "notification"}`,
|
|
767
767
|
onClick: () => {
|
|
768
768
|
var N;
|
|
769
|
-
|
|
769
|
+
r.get().sdkInDesktopView ? (N = a.current) == null || N.scrollTo({
|
|
770
770
|
top: 0,
|
|
771
771
|
behavior: "smooth"
|
|
772
772
|
}) : M(n, c.size, {
|
|
@@ -780,8 +780,8 @@ const ds = {
|
|
|
780
780
|
headerNode: s,
|
|
781
781
|
scrollNode: n,
|
|
782
782
|
responsiveStore: o,
|
|
783
|
-
appNode:
|
|
784
|
-
scrollStore:
|
|
783
|
+
appNode: a,
|
|
784
|
+
scrollStore: r
|
|
785
785
|
}) => {
|
|
786
786
|
const [l] = E(e.getNotificationsStore()), d = u(l), [i, c] = E(null), p = $(() => e.getActiveNotification(), [e, d]);
|
|
787
787
|
return k(() => {
|
|
@@ -794,30 +794,30 @@ const ds = {
|
|
|
794
794
|
});
|
|
795
795
|
}, [p]), k(() => {
|
|
796
796
|
p && (o.get().sdkInDesktopView || o.get().sdkInView) && (!o.get().sdkInDesktopView && o.get().sdkInView && c(p), o.get().sdkInDesktopView && window.requestAnimationFrame(() => {
|
|
797
|
-
|
|
797
|
+
r.get().scrollPosition !== 0 && c(p);
|
|
798
798
|
}));
|
|
799
799
|
}, [p]), k(() => {
|
|
800
800
|
p || c(null);
|
|
801
801
|
}, [p]), /* @__PURE__ */ g(L, {
|
|
802
802
|
children: [!i && p && /* @__PURE__ */ t(sn, {
|
|
803
803
|
headerNode: s,
|
|
804
|
-
appNode:
|
|
804
|
+
appNode: a,
|
|
805
805
|
sdk: e,
|
|
806
806
|
notification: p,
|
|
807
807
|
responsiveStore: o
|
|
808
808
|
}), i && /* @__PURE__ */ t(tn, {
|
|
809
809
|
pill: i,
|
|
810
810
|
setPill: c,
|
|
811
|
-
appNode:
|
|
811
|
+
appNode: a,
|
|
812
812
|
notification: p,
|
|
813
813
|
headerNode: s,
|
|
814
814
|
scrollNode: n,
|
|
815
|
-
scrollStore:
|
|
815
|
+
scrollStore: r,
|
|
816
816
|
responsiveStore: o
|
|
817
817
|
})]
|
|
818
818
|
});
|
|
819
|
-
},
|
|
820
|
-
const s = D(""), [n, o] = E(!1),
|
|
819
|
+
}, an = (e) => {
|
|
820
|
+
const s = D(""), [n, o] = E(!1), a = u(e.status), r = u(e.sdkStore.slStreamId), l = u(e.userId()), d = u(e.getActiveFeature()), i = a === "ready" && !!r.data;
|
|
821
821
|
k(() => {
|
|
822
822
|
const v = e.getFeature(w.GAMES);
|
|
823
823
|
v && (v.closeQuestion(), v.closeUser());
|
|
@@ -857,24 +857,24 @@ const ds = {
|
|
|
857
857
|
deactivate: p,
|
|
858
858
|
isLogged: !!l
|
|
859
859
|
};
|
|
860
|
-
},
|
|
860
|
+
}, rn = ({ sdk: e, className: s, scrollStore: n, appNode: o, scrollNode: a, responsiveStore: r }) => {
|
|
861
861
|
const [, l] = je(e);
|
|
862
862
|
return /* @__PURE__ */ t(
|
|
863
863
|
ws,
|
|
864
864
|
{
|
|
865
865
|
className: s,
|
|
866
|
-
scrollNode:
|
|
866
|
+
scrollNode: a,
|
|
867
867
|
appNode: o,
|
|
868
868
|
scrollStore: n,
|
|
869
869
|
feature: l,
|
|
870
|
-
responsiveStore:
|
|
870
|
+
responsiveStore: r,
|
|
871
871
|
sdk: e
|
|
872
872
|
}
|
|
873
873
|
);
|
|
874
874
|
}, ln = ({ sdk: e, className: s, appNode: n, responsiveStore: o }) => {
|
|
875
|
-
const
|
|
876
|
-
return
|
|
877
|
-
const l = e.getFeature(
|
|
875
|
+
const a = u(e.featuresList.getStore());
|
|
876
|
+
return a ? Array.from(a, (r) => {
|
|
877
|
+
const l = e.getFeature(r);
|
|
878
878
|
return l ? /* @__PURE__ */ t(
|
|
879
879
|
$s,
|
|
880
880
|
{
|
|
@@ -884,19 +884,19 @@ const ds = {
|
|
|
884
884
|
responsiveStore: o,
|
|
885
885
|
sdk: e
|
|
886
886
|
},
|
|
887
|
-
|
|
887
|
+
r
|
|
888
888
|
) : null;
|
|
889
889
|
}) : null;
|
|
890
890
|
}, dn = ({ sdk: e, event: s }) => {
|
|
891
|
-
const n = D(null), o = D(null), [
|
|
891
|
+
const n = D(null), o = D(null), [a] = We(n), [r, l] = Be(n, a), { sdkEnabled: d, sdkReady: i, activateEventWithId: c, deactivate: p, isLogged: v } = an(e);
|
|
892
892
|
k(() => {
|
|
893
893
|
s ? (e.createEventSession(s), c(s)) : p();
|
|
894
|
-
}, [s, c, p, e]), _(n, { enabled: d, event: "click", listener: Xe }), _(
|
|
894
|
+
}, [s, c, p, e]), _(n, { enabled: d, event: "click", listener: Xe }), _(r, {
|
|
895
895
|
enabled: d,
|
|
896
896
|
event: "scrollend",
|
|
897
897
|
listener: Ye,
|
|
898
898
|
useDomNode: !0
|
|
899
|
-
}), _(
|
|
899
|
+
}), _(r, {
|
|
900
900
|
enabled: d,
|
|
901
901
|
event: "click",
|
|
902
902
|
listener: Ze,
|
|
@@ -907,30 +907,30 @@ const ds = {
|
|
|
907
907
|
import("./gamification-feature.js");
|
|
908
908
|
}, []), /* @__PURE__ */ t(ve.Provider, { value: f, children: /* @__PURE__ */ g(Ge, { ref: n, children: [
|
|
909
909
|
d && /* @__PURE__ */ t(Ts, { className: F, sdk: e, ref: o }),
|
|
910
|
-
/* @__PURE__ */ g(He, { className: "sl-hide-on-modal", ref:
|
|
910
|
+
/* @__PURE__ */ g(He, { className: "sl-hide-on-modal", ref: r, "data-nav": d.toString(), children: [
|
|
911
911
|
i && /* @__PURE__ */ t(
|
|
912
912
|
on,
|
|
913
913
|
{
|
|
914
914
|
sdk: e,
|
|
915
|
-
scrollNode:
|
|
915
|
+
scrollNode: r,
|
|
916
916
|
headerNode: o,
|
|
917
917
|
appNode: n,
|
|
918
918
|
scrollStore: l,
|
|
919
|
-
responsiveStore:
|
|
919
|
+
responsiveStore: a
|
|
920
920
|
}
|
|
921
921
|
),
|
|
922
922
|
i && /* @__PURE__ */ t(
|
|
923
|
-
|
|
923
|
+
rn,
|
|
924
924
|
{
|
|
925
925
|
scrollStore: l,
|
|
926
|
-
responsiveStore:
|
|
927
|
-
scrollNode:
|
|
926
|
+
responsiveStore: a,
|
|
927
|
+
scrollNode: r,
|
|
928
928
|
appNode: n,
|
|
929
929
|
className: F,
|
|
930
930
|
sdk: e
|
|
931
931
|
}
|
|
932
932
|
),
|
|
933
|
-
i && /* @__PURE__ */ t(ln, { responsiveStore:
|
|
933
|
+
i && /* @__PURE__ */ t(ln, { responsiveStore: a, appNode: n, className: F, sdk: e })
|
|
934
934
|
] }),
|
|
935
935
|
d && !v && /* @__PURE__ */ t(
|
|
936
936
|
"div",
|
|
@@ -951,7 +951,7 @@ const ds = {
|
|
|
951
951
|
};
|
|
952
952
|
export {
|
|
953
953
|
gn as E,
|
|
954
|
-
|
|
954
|
+
an as F,
|
|
955
955
|
kn as S,
|
|
956
956
|
cn as d,
|
|
957
957
|
fn as u
|
package/lib/es/masters2.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as n, jsxs as L, Fragment as E } from "react/jsx-runtime";
|
|
2
|
-
import { u as C, F as r2, s as u, T as j, i as i2, p as a2, b as l2, N as d2, k as c2, M as p2, f as u2, S as C2, C as v2, g as h2, O as K, m as x, l as m2, h as g2, j as L2, n as X, o as f2, q as S2, r as y2, t as U, w as k2, x as J, y as _, I as e2,
|
|
2
|
+
import { u as C, F as r2, s as u, T as j, i as i2, p as a2, b as l2, N as d2, k as c2, M as p2, f as u2, S as C2, C as v2, g as h2, O as K, m as x, l as m2, h as g2, j as L2, n as X, o as f2, q as S2, r as y2, t as U, w as k2, x as J, y as _, I as e2, a as P, z as N2, A as b2, B as z, D as A2, E as I2, G as $2, e as E2, H as T, J as q, K as V2, P as w2, R as R2, c as H2, U as Q, V as T2, W as x2, L as F, X as F2, Y as D2, Z as M2, _ as O2, v as D, $ as U2, a0 as _2, a1 as P2, a2 as B2, a3 as G2 } from "./provider.js";
|
|
3
3
|
import { createContext as z2, useContext as s2, useRef as $, useState as b, useEffect as k, useTransition as q2, lazy as Q2, useMemo as H, Suspense as Z2, forwardRef as Y2, useLayoutEffect as W2, useCallback as R, Component as j2 } from "react";
|
|
4
4
|
import { Q as K2, S as I } from "./useStreamLayerApp2.js";
|
|
5
5
|
const M = /* @__PURE__ */ u("div")({
|
package/lib/es/points.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as a, jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { useState as
|
|
3
|
-
import { s as t,
|
|
2
|
+
import { useState as u, useEffect as c } from "react";
|
|
3
|
+
import { s as t, a as m, v as d, d as S, u as f, F as v } from "./provider.js";
|
|
4
4
|
import { u as y, d as h } from "./index2.js";
|
|
5
5
|
import { S as g } from "./useStreamLayerApp2.js";
|
|
6
6
|
const A = /* @__PURE__ */ t("div")({
|
|
@@ -34,14 +34,14 @@ const A = /* @__PURE__ */ t("div")({
|
|
|
34
34
|
/* @__PURE__ */ r(C, { children: /* @__PURE__ */ r(S, { value: s }) })
|
|
35
35
|
] })
|
|
36
36
|
] }), L = ({ gamification: s }) => {
|
|
37
|
-
const e = s.userSummary.$store, [i, l] =
|
|
38
|
-
return
|
|
39
|
-
const
|
|
37
|
+
const e = s.userSummary.$store, [i, l] = u(0);
|
|
38
|
+
return c(() => {
|
|
39
|
+
const p = e.subscribe((n) => {
|
|
40
40
|
var o;
|
|
41
41
|
(o = n == null ? void 0 : n.summary) != null && o.points && l(n.summary.points);
|
|
42
42
|
});
|
|
43
43
|
return () => {
|
|
44
|
-
|
|
44
|
+
p();
|
|
45
45
|
};
|
|
46
46
|
}, [e]), /* @__PURE__ */ r(F, { points: i, onClick: () => {
|
|
47
47
|
s.status.get() === v.Suspended && s.openFeature();
|