@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/app/advertisement.d.ts +1 -0
- package/lib/app/app.d.ts +2 -2
- package/lib/app/auth.d.ts +0 -1
- package/lib/app/masters.d.ts +2 -1
- package/lib/app/provider.d.ts +4 -4
- package/lib/app/useStreamLayerApp.d.ts +8 -7
- package/lib/cjs/app.js +1 -1
- package/lib/cjs/gamification-feature.js +1 -1
- package/lib/cjs/gamification-feature2.js +1 -1
- package/lib/cjs/index2.js +55 -51
- package/lib/cjs/masters2.js +4 -4
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/useStreamLayerApp2.js +15 -15
- package/lib/dist/cjs/gamification-feature.js +1 -1
- package/lib/dist/cjs/gamification-feature2.js +1 -1
- package/lib/dist/cjs/index.js +1 -1
- package/lib/dist/cjs/masters.js +90 -86
- package/lib/dist/es/gamification-feature.js +1 -1
- package/lib/dist/es/gamification-feature2.js +18 -18
- package/lib/dist/es/index.js +1 -1
- package/lib/dist/es/masters.js +31784 -35347
- package/lib/dist/index.d.ts +222 -135
- package/lib/dist/style.css +1 -1
- package/lib/es/app.js +438 -414
- package/lib/es/gamification-feature.js +1 -1
- package/lib/es/gamification-feature2.js +1 -1
- package/lib/es/index2.js +10263 -10726
- package/lib/es/masters2.js +393 -432
- package/lib/es/points.js +9 -9
- package/lib/es/useStreamLayerApp2.js +8732 -11851
- package/lib/style.css +1 -1
- package/package.json +45 -40
package/lib/es/app.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var g = (e, s, n) => (
|
|
4
|
-
import { jsx as t, jsxs as
|
|
5
|
-
import { a3 as V, u, F as
|
|
6
|
-
import { createContext as es, useContext as
|
|
7
|
-
import { C as
|
|
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
|
|
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
|
|
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 (
|
|
32
|
-
|
|
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
|
-
|
|
49
|
+
A.Unknown, A.Internal, A.DeadlineExceeded, A.ResourceExhausted, A.FailedPrecondition, A.Unavailable, A.DataLoss;
|
|
50
50
|
V("grpc:retry");
|
|
51
|
-
|
|
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
|
|
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
|
|
85
|
+
new ls();
|
|
86
86
|
V("video_player");
|
|
87
87
|
var Z;
|
|
88
88
|
(function(e) {
|
|
89
|
-
e.
|
|
89
|
+
e.SHOWED = "showed";
|
|
90
90
|
})(Z || (Z = {}));
|
|
91
91
|
var J;
|
|
92
92
|
(function(e) {
|
|
93
|
-
e.
|
|
93
|
+
e.ALLOWED = "allowed", e.DISALLOWED = "disallowed";
|
|
94
94
|
})(J || (J = {}));
|
|
95
95
|
var ee;
|
|
96
96
|
(function(e) {
|
|
97
|
-
e.
|
|
97
|
+
e.UNKNOWN = "unknown", e.ALREADY_VOTED = "already_voted";
|
|
98
98
|
})(ee || (ee = {}));
|
|
99
99
|
var se;
|
|
100
100
|
(function(e) {
|
|
101
|
-
e.
|
|
101
|
+
e.ONBOARDING = "onboarding", e.ONBOARDING_IO = "onboarding_io";
|
|
102
102
|
})(se || (se = {}));
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
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: "
|
|
112
|
+
class: "lclc0ej",
|
|
109
113
|
propsAsIs: !1
|
|
110
|
-
}),
|
|
114
|
+
}), cs = ({
|
|
111
115
|
feature: e,
|
|
112
116
|
sdk: s,
|
|
113
117
|
children: n,
|
|
114
118
|
className: o,
|
|
115
|
-
noWait:
|
|
119
|
+
noWait: i
|
|
116
120
|
}) => {
|
|
117
|
-
const a = u(e.status),
|
|
118
|
-
if (!
|
|
119
|
-
if (
|
|
120
|
-
return /* @__PURE__ */ t(
|
|
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 (!(
|
|
125
|
-
return /* @__PURE__ */ t(
|
|
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 !==
|
|
130
|
-
return /* @__PURE__ */ t(
|
|
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
|
-
},
|
|
140
|
+
}, ue = es({
|
|
137
141
|
sdk: null
|
|
138
|
-
}),
|
|
142
|
+
}), B = () => z(ue), ps = /* @__PURE__ */ h("div")({
|
|
139
143
|
name: "QuestionContainer",
|
|
140
|
-
class: "
|
|
144
|
+
class: "q14ckf9e",
|
|
141
145
|
propsAsIs: !1
|
|
142
|
-
}),
|
|
146
|
+
}), us = ({
|
|
143
147
|
openedQuestion: e
|
|
144
148
|
}) => {
|
|
145
149
|
var s, n;
|
|
146
150
|
const {
|
|
147
151
|
sdk: o
|
|
148
|
-
} =
|
|
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(
|
|
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
|
-
},
|
|
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:
|
|
167
|
+
data: i
|
|
164
168
|
} = e;
|
|
165
|
-
return
|
|
169
|
+
return i ? /* @__PURE__ */ t(be, {
|
|
166
170
|
vote: s,
|
|
167
171
|
close: n,
|
|
168
|
-
openedQuestion:
|
|
172
|
+
openedQuestion: i,
|
|
169
173
|
isLoading: !!o
|
|
170
|
-
}) : /* @__PURE__ */ t(
|
|
171
|
-
},
|
|
174
|
+
}) : /* @__PURE__ */ t(Se, {});
|
|
175
|
+
}, vs = ({
|
|
172
176
|
gamification: e
|
|
173
177
|
}) => {
|
|
174
|
-
var s;
|
|
175
|
-
const
|
|
176
|
-
if (!
|
|
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
|
|
179
|
-
return /* @__PURE__ */
|
|
180
|
-
children: [/* @__PURE__ */ t(
|
|
182
|
+
const l = i.type;
|
|
183
|
+
return /* @__PURE__ */ m(ps, {
|
|
184
|
+
children: [/* @__PURE__ */ t(re, {
|
|
181
185
|
close: e.closeQuestion,
|
|
182
|
-
type: ((s =
|
|
183
|
-
}),
|
|
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:
|
|
187
|
-
}),
|
|
188
|
-
openedQuestion:
|
|
189
|
-
}), /* @__PURE__ */ t(
|
|
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
|
-
},
|
|
197
|
+
}, gs = /* @__PURE__ */ h("div")({
|
|
194
198
|
name: "InviteFriendsContainer",
|
|
195
|
-
class: "
|
|
199
|
+
class: "i1c9dygq",
|
|
196
200
|
propsAsIs: !1
|
|
197
|
-
}),
|
|
201
|
+
}), ms = ({
|
|
198
202
|
deepLink: e
|
|
199
|
-
}) => /* @__PURE__ */ t(
|
|
200
|
-
children: /* @__PURE__ */ t(
|
|
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
|
-
}),
|
|
209
|
+
}), fs = /* @__PURE__ */ h("div")({
|
|
206
210
|
name: "InviteLinkContainer",
|
|
207
|
-
class: "
|
|
211
|
+
class: "i1odbhm4",
|
|
208
212
|
propsAsIs: !1
|
|
209
|
-
}),
|
|
213
|
+
}), ks = ({
|
|
210
214
|
gamification: e,
|
|
211
215
|
scrollNode: s,
|
|
212
216
|
scrollStore: n
|
|
213
217
|
}) => {
|
|
214
|
-
const o =
|
|
215
|
-
data:
|
|
218
|
+
const o = $(null), {
|
|
219
|
+
data: i,
|
|
216
220
|
hasMore: a,
|
|
217
|
-
loading:
|
|
218
|
-
key:
|
|
221
|
+
loading: l,
|
|
222
|
+
key: d
|
|
219
223
|
} = u(e.leaderboardList.$store), {
|
|
220
|
-
data:
|
|
221
|
-
} = u(e.deepLink.$store), [
|
|
222
|
-
return !
|
|
223
|
-
deepLink:
|
|
224
|
-
}) : /* @__PURE__ */
|
|
225
|
-
children: [/* @__PURE__ */ t(
|
|
226
|
-
items:
|
|
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
|
-
},
|
|
237
|
+
}, d), r && /* @__PURE__ */ t(fs, {
|
|
234
238
|
ref: o,
|
|
235
|
-
children: /* @__PURE__ */ t(
|
|
236
|
-
onClick: () =>
|
|
239
|
+
children: /* @__PURE__ */ t(Ae, {
|
|
240
|
+
onClick: () => p(r),
|
|
237
241
|
title: "Invite Friends",
|
|
238
242
|
description: "Challenge them now!"
|
|
239
243
|
})
|
|
240
|
-
}),
|
|
244
|
+
}), c]
|
|
241
245
|
});
|
|
242
|
-
},
|
|
243
|
-
const { sdk: n } =
|
|
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
|
-
},
|
|
249
|
+
}, Ns = ({ userSummary: e }) => {
|
|
246
250
|
var s;
|
|
247
|
-
const [n, o] =
|
|
251
|
+
const [n, o] = E(void 0);
|
|
248
252
|
return k(() => {
|
|
249
|
-
const
|
|
253
|
+
const i = e.$store.subscribe((a) => {
|
|
250
254
|
a && o(a);
|
|
251
255
|
});
|
|
252
256
|
return () => {
|
|
253
|
-
|
|
257
|
+
i();
|
|
254
258
|
};
|
|
255
|
-
}, [e]), /* @__PURE__ */ t(
|
|
256
|
-
},
|
|
257
|
-
const { tabsShown:
|
|
258
|
-
|
|
259
|
-
var
|
|
260
|
-
|
|
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((
|
|
264
|
-
if (
|
|
267
|
+
k(() => n.subscribe((S) => {
|
|
268
|
+
if (S.scrollPosition === 0) {
|
|
265
269
|
n.setKey("tabsShown", !0);
|
|
266
270
|
return;
|
|
267
271
|
}
|
|
268
|
-
|
|
269
|
-
}), [n,
|
|
270
|
-
let
|
|
271
|
-
return v ?
|
|
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
|
-
|
|
277
|
+
Le,
|
|
274
278
|
{
|
|
275
279
|
style: {
|
|
276
|
-
top:
|
|
280
|
+
top: b
|
|
277
281
|
},
|
|
278
|
-
children: /* @__PURE__ */ t(
|
|
282
|
+
children: /* @__PURE__ */ t(De, { activePage: r, toggleActivePage: N })
|
|
279
283
|
}
|
|
280
284
|
),
|
|
281
|
-
|
|
282
|
-
/* @__PURE__ */ t(
|
|
283
|
-
/* @__PURE__ */ t(
|
|
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
|
-
|
|
289
|
+
r === P.LEADERBOARD && /* @__PURE__ */ t(Oe, { children: /* @__PURE__ */ t(ks, { scrollStore: n, scrollNode: o, gamification: e }) })
|
|
286
290
|
] });
|
|
287
|
-
},
|
|
291
|
+
}, Ss = () => U, te = /* @__PURE__ */ h(Ss())({
|
|
288
292
|
name: "OpenedContainer",
|
|
289
|
-
class: "
|
|
293
|
+
class: "ouvguos",
|
|
290
294
|
propsAsIs: !0
|
|
291
|
-
}),
|
|
295
|
+
}), Is = /* @__PURE__ */ h("div")({
|
|
292
296
|
name: "UserContainer",
|
|
293
|
-
class: "
|
|
297
|
+
class: "u1eu4lbg",
|
|
294
298
|
propsAsIs: !1
|
|
295
|
-
}),
|
|
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
|
-
},
|
|
305
|
+
}, mn = ({
|
|
302
306
|
gamification: e,
|
|
303
307
|
scrollStore: s,
|
|
304
308
|
className: n,
|
|
305
309
|
appNode: o,
|
|
306
|
-
scrollNode:
|
|
310
|
+
scrollNode: i,
|
|
307
311
|
responsiveStore: a
|
|
308
|
-
}) => /* @__PURE__ */ t(
|
|
312
|
+
}) => /* @__PURE__ */ t(bs, {
|
|
309
313
|
appNode: o,
|
|
310
314
|
scrollStore: s,
|
|
311
|
-
scrollNode:
|
|
315
|
+
scrollNode: i,
|
|
312
316
|
className: n,
|
|
313
317
|
gamification: e,
|
|
314
318
|
responsiveStore: a
|
|
315
|
-
}),
|
|
319
|
+
}), ws = ({
|
|
316
320
|
gamification: e,
|
|
317
321
|
className: s,
|
|
318
322
|
appNode: n,
|
|
319
323
|
responsiveStore: o
|
|
320
324
|
}) => {
|
|
321
|
-
const
|
|
322
|
-
sdkInDesktopView:
|
|
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:
|
|
327
|
-
onAnimationEnd:
|
|
328
|
-
} =
|
|
329
|
-
if (!n.current || !
|
|
330
|
+
hiding: d,
|
|
331
|
+
onAnimationEnd: r
|
|
332
|
+
} = Re();
|
|
333
|
+
if (!n.current || !i && !a)
|
|
330
334
|
return null;
|
|
331
|
-
const
|
|
335
|
+
const p = i ? /* @__PURE__ */ t(te, {
|
|
332
336
|
className: s,
|
|
333
|
-
hiding:
|
|
334
|
-
onAnimationEnd:
|
|
335
|
-
children: /* @__PURE__ */ t(
|
|
337
|
+
hiding: d,
|
|
338
|
+
onAnimationEnd: r,
|
|
339
|
+
children: /* @__PURE__ */ t(vs, {
|
|
336
340
|
gamification: e
|
|
337
341
|
})
|
|
338
|
-
}) : a ? /* @__PURE__ */ t(
|
|
342
|
+
}) : a ? /* @__PURE__ */ t(te, {
|
|
339
343
|
className: s,
|
|
340
|
-
hiding:
|
|
341
|
-
onAnimationEnd:
|
|
342
|
-
children: /* @__PURE__ */
|
|
343
|
-
children: [/* @__PURE__ */ t(
|
|
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(
|
|
347
|
-
children: /* @__PURE__ */ t(
|
|
350
|
+
}), /* @__PURE__ */ t(le, {
|
|
351
|
+
children: /* @__PURE__ */ t(ae, {
|
|
348
352
|
...a,
|
|
349
|
-
successRate:
|
|
353
|
+
successRate: Es(a)
|
|
350
354
|
})
|
|
351
355
|
})]
|
|
352
356
|
})
|
|
353
357
|
}) : null;
|
|
354
|
-
return /* @__PURE__ */ t(
|
|
358
|
+
return /* @__PURE__ */ t(de, {
|
|
355
359
|
container: n,
|
|
356
|
-
useContainer: !
|
|
357
|
-
children:
|
|
360
|
+
useContainer: !l,
|
|
361
|
+
children: p
|
|
358
362
|
});
|
|
359
|
-
},
|
|
360
|
-
const
|
|
361
|
-
|
|
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:
|
|
367
|
+
appNode: i,
|
|
364
368
|
scrollStore: o,
|
|
365
369
|
scrollNode: a,
|
|
366
370
|
className: n,
|
|
367
|
-
responsiveStore:
|
|
371
|
+
responsiveStore: l,
|
|
368
372
|
gamification: s
|
|
369
373
|
}
|
|
370
|
-
) }) : null, [e, s, n,
|
|
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:
|
|
379
|
+
children: d
|
|
376
380
|
}
|
|
377
381
|
);
|
|
378
|
-
},
|
|
379
|
-
|
|
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,
|
|
387
|
-
name: "
|
|
388
|
-
class: "
|
|
390
|
+
) : null, Ls = () => ce, Ds = /* @__PURE__ */ h(Ls())({
|
|
391
|
+
name: "ButtonIcon",
|
|
392
|
+
class: "b11wpe79",
|
|
389
393
|
propsAsIs: !0
|
|
390
|
-
}),
|
|
391
|
-
sdk: e
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
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:
|
|
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:
|
|
409
|
-
}))].sort((
|
|
410
|
-
return /* @__PURE__ */
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
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
|
-
},
|
|
441
|
+
}), xs = /* @__PURE__ */ h("div")({
|
|
418
442
|
name: "Container",
|
|
419
|
-
class: "
|
|
443
|
+
class: "c1qjj4d4",
|
|
420
444
|
propsAsIs: !1
|
|
421
|
-
}),
|
|
445
|
+
}), Os = /* @__PURE__ */ h("div")({
|
|
422
446
|
name: "CloseIconWrap",
|
|
423
|
-
class: "
|
|
447
|
+
class: "c1lg6b8a",
|
|
424
448
|
propsAsIs: !1
|
|
425
|
-
}),
|
|
449
|
+
}), Rs = () => ce, Vs = /* @__PURE__ */ h(Rs())({
|
|
426
450
|
name: "CloseIcon",
|
|
427
|
-
class: "
|
|
451
|
+
class: "c159el66",
|
|
428
452
|
propsAsIs: !0
|
|
429
|
-
}),
|
|
453
|
+
}), Ps = /* @__PURE__ */ h("div")({
|
|
430
454
|
name: "Title",
|
|
431
|
-
class: "
|
|
455
|
+
class: "t16xmufv",
|
|
432
456
|
propsAsIs: !1
|
|
433
|
-
}),
|
|
457
|
+
}), Qs = /* @__PURE__ */ h("img")({
|
|
434
458
|
name: "SponsorLogo",
|
|
435
|
-
class: "
|
|
459
|
+
class: "s83lc21",
|
|
436
460
|
propsAsIs: !1
|
|
437
|
-
}),
|
|
461
|
+
}), _s = /* @__PURE__ */ h("div")({
|
|
438
462
|
name: "PresentsTitle",
|
|
439
|
-
class: "
|
|
463
|
+
class: "p1p7igia",
|
|
440
464
|
propsAsIs: !1
|
|
441
|
-
}),
|
|
465
|
+
}), qs = /* @__PURE__ */ h("div")({
|
|
442
466
|
name: "Subtitle",
|
|
443
|
-
class: "
|
|
467
|
+
class: "s1eftsbu",
|
|
444
468
|
propsAsIs: !1
|
|
445
|
-
}),
|
|
469
|
+
}), Fs = /* @__PURE__ */ h("div")({
|
|
446
470
|
name: "Description",
|
|
447
|
-
class: "
|
|
471
|
+
class: "d8uezec",
|
|
448
472
|
propsAsIs: !1
|
|
449
|
-
}),
|
|
473
|
+
}), Ks = /* @__PURE__ */ h("button")({
|
|
450
474
|
name: "ActionButton",
|
|
451
|
-
class: "
|
|
475
|
+
class: "a1h1bk90",
|
|
452
476
|
propsAsIs: !1
|
|
453
|
-
}),
|
|
454
|
-
var o,
|
|
455
|
-
return /* @__PURE__ */
|
|
456
|
-
/* @__PURE__ */ t(
|
|
457
|
-
((
|
|
458
|
-
/* @__PURE__ */ t(
|
|
459
|
-
/* @__PURE__ */ t(
|
|
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
|
-
((
|
|
462
|
-
((
|
|
463
|
-
/* @__PURE__ */ t(
|
|
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/
|
|
467
|
-
tagline: "
|
|
468
|
-
headline: /* @__PURE__ */
|
|
469
|
-
children: ["Welcome to ", /* @__PURE__ */ t("br", {}), "
|
|
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
|
-
}],
|
|
507
|
+
}], Ms = /* @__PURE__ */ h("div")({
|
|
484
508
|
name: "OnboardingContainer",
|
|
485
|
-
class: "
|
|
509
|
+
class: "o1xni1kr",
|
|
486
510
|
propsAsIs: !1
|
|
487
|
-
}),
|
|
511
|
+
}), Us = () => U, zs = /* @__PURE__ */ h(Us())({
|
|
488
512
|
name: "OnboardingNotificationContainer",
|
|
489
|
-
class: "
|
|
513
|
+
class: "o1vnouv7",
|
|
490
514
|
propsAsIs: !0
|
|
491
|
-
}),
|
|
515
|
+
}), ie = /* @__PURE__ */ h("div")({
|
|
492
516
|
name: "InnerContainer",
|
|
493
|
-
class: "
|
|
517
|
+
class: "i59uefw",
|
|
494
518
|
propsAsIs: !1
|
|
495
|
-
}),
|
|
519
|
+
}), Bs = ({
|
|
496
520
|
deepLink: e,
|
|
497
521
|
onboardingOpts: s,
|
|
498
522
|
notification: n,
|
|
499
523
|
gamification: o,
|
|
500
|
-
loading:
|
|
501
|
-
|
|
502
|
-
sdk: i
|
|
524
|
+
loading: i,
|
|
525
|
+
sdk: a
|
|
503
526
|
}) => {
|
|
504
|
-
var l,
|
|
505
|
-
const N = u(o.friends.getStore()), [b,
|
|
506
|
-
var
|
|
507
|
-
const
|
|
508
|
-
return
|
|
509
|
-
slId:
|
|
510
|
-
}) =>
|
|
511
|
-
}, [N.data,
|
|
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
|
|
514
|
-
T &&
|
|
536
|
+
const w = e.$store.subscribe((T) => {
|
|
537
|
+
T && S(T.data);
|
|
515
538
|
});
|
|
516
539
|
return () => {
|
|
517
|
-
|
|
540
|
+
w();
|
|
518
541
|
};
|
|
519
|
-
}, [e.$store]), /* @__PURE__ */ t(
|
|
520
|
-
children: /* @__PURE__ */ t(
|
|
521
|
-
loading:
|
|
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: (
|
|
556
|
+
rulesTitle: (d = s.rules) == null ? void 0 : d.heading,
|
|
535
557
|
termsTitle: "Terms and Conditions",
|
|
536
|
-
termsText: (
|
|
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: (
|
|
541
|
-
inviteCardSubtext: (
|
|
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
|
|
545
|
-
(
|
|
566
|
+
var w;
|
|
567
|
+
(w = n.close) == null || w.call(n);
|
|
546
568
|
},
|
|
547
569
|
gamification: o,
|
|
548
|
-
sdk:
|
|
549
|
-
inviterName:
|
|
570
|
+
sdk: a,
|
|
571
|
+
inviterName: y
|
|
550
572
|
})
|
|
551
573
|
});
|
|
552
|
-
},
|
|
574
|
+
}, Ws = ({
|
|
553
575
|
sdk: e,
|
|
554
576
|
notification: s,
|
|
555
577
|
saveHeight: n,
|
|
556
578
|
style: o,
|
|
557
|
-
appNode:
|
|
579
|
+
appNode: i,
|
|
558
580
|
sdkInDesktopView: a,
|
|
559
|
-
responsiveStore:
|
|
581
|
+
responsiveStore: l
|
|
560
582
|
}) => {
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
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(
|
|
587
|
+
} = u(l, {
|
|
567
588
|
keys: ["screen"]
|
|
568
589
|
});
|
|
569
|
-
(
|
|
570
|
-
var
|
|
571
|
-
n(((
|
|
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:
|
|
576
|
-
} =
|
|
577
|
-
return p &&
|
|
578
|
-
container:
|
|
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(
|
|
601
|
+
children: /* @__PURE__ */ t(Bs, {
|
|
581
602
|
notification: s,
|
|
582
|
-
setOpened:
|
|
583
|
-
gamification:
|
|
584
|
-
onboardingOpts:
|
|
585
|
-
deepLink:
|
|
603
|
+
setOpened: c,
|
|
604
|
+
gamification: v,
|
|
605
|
+
onboardingOpts: r,
|
|
606
|
+
deepLink: v.deepLink,
|
|
586
607
|
loading: b,
|
|
587
|
-
renderToNode:
|
|
608
|
+
renderToNode: i,
|
|
588
609
|
sdk: e
|
|
589
610
|
})
|
|
590
|
-
}) : /* @__PURE__ */
|
|
591
|
-
children: [/* @__PURE__ */ t(
|
|
592
|
-
ref:
|
|
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(
|
|
618
|
+
children: /* @__PURE__ */ t(oe, {
|
|
598
619
|
close: () => {
|
|
599
620
|
},
|
|
600
621
|
action: () => {
|
|
601
622
|
},
|
|
602
|
-
onboarding:
|
|
623
|
+
onboarding: r
|
|
603
624
|
})
|
|
604
|
-
}), /* @__PURE__ */ t(
|
|
625
|
+
}), /* @__PURE__ */ t(zs, {
|
|
605
626
|
style: o,
|
|
606
627
|
hiding: s.hiding,
|
|
607
|
-
children: /* @__PURE__ */ t(
|
|
608
|
-
children: /* @__PURE__ */ t(
|
|
628
|
+
children: /* @__PURE__ */ t(ie, {
|
|
629
|
+
children: /* @__PURE__ */ t(oe, {
|
|
609
630
|
close: s.close,
|
|
610
631
|
action: () => {
|
|
611
|
-
var
|
|
612
|
-
|
|
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:
|
|
637
|
+
onboarding: r
|
|
617
638
|
})
|
|
618
639
|
})
|
|
619
640
|
})]
|
|
620
641
|
});
|
|
621
|
-
},
|
|
642
|
+
}, Gs = () => U, Hs = /* @__PURE__ */ h(Gs())({
|
|
622
643
|
name: "Container",
|
|
623
|
-
class: "
|
|
644
|
+
class: "c8ol1ve",
|
|
624
645
|
propsAsIs: !0
|
|
625
|
-
}),
|
|
646
|
+
}), he = /* @__PURE__ */ h("div")({
|
|
626
647
|
name: "InnerContainer",
|
|
627
|
-
class: "
|
|
648
|
+
class: "iqfywam",
|
|
628
649
|
propsAsIs: !1
|
|
629
|
-
}),
|
|
650
|
+
}), js = () => he, Xs = /* @__PURE__ */ h(js())({
|
|
630
651
|
name: "HiddenContainer",
|
|
631
|
-
class: "
|
|
652
|
+
class: "hokmtod",
|
|
632
653
|
propsAsIs: !0
|
|
633
|
-
}),
|
|
654
|
+
}), Ys = /* @__PURE__ */ h("div")({
|
|
634
655
|
name: "NotificationRefreshing",
|
|
635
|
-
class: "
|
|
656
|
+
class: "n192d1q8",
|
|
636
657
|
propsAsIs: !1
|
|
637
|
-
}),
|
|
658
|
+
}), Zs = () => qe, Js = /* @__PURE__ */ h(Zs())({
|
|
638
659
|
name: "Pill",
|
|
639
|
-
class: "
|
|
660
|
+
class: "p1lha68t",
|
|
640
661
|
propsAsIs: !0
|
|
641
|
-
}),
|
|
642
|
-
const [s, n] =
|
|
643
|
-
o.current =
|
|
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
|
|
647
|
-
const
|
|
648
|
-
|
|
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 =
|
|
651
|
-
n(
|
|
671
|
+
const a = R((l) => {
|
|
672
|
+
n(l);
|
|
652
673
|
}, []);
|
|
653
|
-
return [
|
|
654
|
-
},
|
|
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
|
|
681
|
+
var i, a;
|
|
661
682
|
const {
|
|
662
|
-
sdkInDesktopView:
|
|
683
|
+
sdkInDesktopView: l
|
|
663
684
|
} = u(o, {
|
|
664
685
|
keys: ["sdkInDesktopView"]
|
|
665
686
|
}), {
|
|
666
|
-
sdk:
|
|
667
|
-
} =
|
|
668
|
-
return s.type ===
|
|
669
|
-
children: [/* @__PURE__ */ t(
|
|
670
|
-
ref:
|
|
671
|
-
children: /* @__PURE__ */ t(
|
|
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__ */
|
|
695
|
+
}), /* @__PURE__ */ m(Hs, {
|
|
675
696
|
style: {
|
|
676
|
-
height: s.hiding ? 0 :
|
|
697
|
+
height: s.hiding ? 0 : p
|
|
677
698
|
},
|
|
678
699
|
hiding: s.hiding,
|
|
679
|
-
children: [/* @__PURE__ */ t(
|
|
700
|
+
children: [/* @__PURE__ */ t(he, {
|
|
680
701
|
style: {
|
|
681
702
|
height: "100%"
|
|
682
703
|
},
|
|
683
|
-
children: /* @__PURE__ */ t(
|
|
704
|
+
children: /* @__PURE__ */ t(G, {
|
|
684
705
|
...s,
|
|
685
|
-
controlVideo:
|
|
706
|
+
controlVideo: d == null ? void 0 : d.controlVideoPlayer
|
|
686
707
|
})
|
|
687
|
-
}), /* @__PURE__ */ t(
|
|
708
|
+
}), /* @__PURE__ */ t(Ys, {}, s.id)]
|
|
688
709
|
})]
|
|
689
|
-
}) : s.type ===
|
|
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 :
|
|
712
|
+
height: s.hiding ? 0 : p
|
|
692
713
|
},
|
|
693
|
-
saveHeight:
|
|
714
|
+
saveHeight: c,
|
|
694
715
|
close: s.close,
|
|
695
716
|
hiding: s.hiding,
|
|
696
717
|
...s.data.question
|
|
697
|
-
}) : s.type ===
|
|
718
|
+
}) : s.type === x.ONBOARDING ? /* @__PURE__ */ t(Ws, {
|
|
698
719
|
style: {
|
|
699
|
-
height: s.hiding ? 0 :
|
|
720
|
+
height: s.hiding ? 0 : p
|
|
700
721
|
},
|
|
701
|
-
saveHeight:
|
|
722
|
+
saveHeight: c,
|
|
702
723
|
sdk: e,
|
|
703
724
|
notification: s,
|
|
704
|
-
sdkInDesktopView:
|
|
725
|
+
sdkInDesktopView: l,
|
|
705
726
|
appNode: n,
|
|
706
727
|
responsiveStore: o
|
|
707
728
|
}) : null;
|
|
708
|
-
},
|
|
729
|
+
}, nn = "p7vfi6t", tn = ({
|
|
709
730
|
pill: e,
|
|
710
731
|
setPill: s,
|
|
711
732
|
appNode: n,
|
|
712
733
|
headerNode: o,
|
|
713
|
-
scrollNode:
|
|
734
|
+
scrollNode: i,
|
|
714
735
|
responsiveStore: a,
|
|
715
|
-
scrollStore:
|
|
736
|
+
scrollStore: l
|
|
716
737
|
}) => {
|
|
717
|
-
var
|
|
738
|
+
var d, r;
|
|
718
739
|
const {
|
|
719
|
-
screen:
|
|
740
|
+
screen: p
|
|
720
741
|
} = u(a, {
|
|
721
742
|
keys: ["screen"]
|
|
722
743
|
}), {
|
|
723
|
-
tabsShown:
|
|
744
|
+
tabsShown: c,
|
|
724
745
|
scrollPosition: v
|
|
725
|
-
} = u(
|
|
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
|
|
732
|
-
return !e || !
|
|
733
|
-
title: e.type ===
|
|
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
|
|
736
|
-
a.get().sdkInDesktopView ? (
|
|
756
|
+
var N;
|
|
757
|
+
a.get().sdkInDesktopView ? (N = i.current) == null || N.scrollTo({
|
|
737
758
|
top: 0,
|
|
738
759
|
behavior: "smooth"
|
|
739
|
-
}) :
|
|
760
|
+
}) : M(n, p.size, {
|
|
740
761
|
behavior: "smooth"
|
|
741
762
|
}), s(null);
|
|
742
763
|
},
|
|
743
|
-
className: ze(
|
|
744
|
-
}),
|
|
745
|
-
},
|
|
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:
|
|
771
|
+
appNode: i,
|
|
751
772
|
scrollStore: a
|
|
752
773
|
}) => {
|
|
753
|
-
const [
|
|
774
|
+
const [l] = E(e.getNotificationsStore()), d = u(l), [r, p] = E(null), c = C(() => e.getActiveNotification(), [e, d]);
|
|
754
775
|
return k(() => {
|
|
755
|
-
|
|
776
|
+
c && Fe.emit("notification", {
|
|
756
777
|
action: "rendered",
|
|
757
778
|
payload: {
|
|
758
|
-
questionId:
|
|
759
|
-
questionType:
|
|
779
|
+
questionId: c.data.questionId,
|
|
780
|
+
questionType: c.data.questionType
|
|
760
781
|
}
|
|
761
782
|
});
|
|
762
|
-
}, [
|
|
763
|
-
|
|
764
|
-
a.get().scrollPosition !== 0 &&
|
|
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
|
-
}, [
|
|
767
|
-
|
|
768
|
-
}, [
|
|
769
|
-
children: [!
|
|
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:
|
|
792
|
+
appNode: i,
|
|
772
793
|
sdk: e,
|
|
773
|
-
notification:
|
|
794
|
+
notification: c,
|
|
774
795
|
responsiveStore: o
|
|
775
|
-
}),
|
|
776
|
-
pill:
|
|
777
|
-
setPill:
|
|
778
|
-
appNode:
|
|
779
|
-
notification:
|
|
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
|
-
},
|
|
787
|
-
const s =
|
|
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(
|
|
810
|
+
const v = e.getFeature(D.GAMES);
|
|
790
811
|
v && (v.closeQuestion(), v.closeUser());
|
|
791
|
-
}, [
|
|
792
|
-
const
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
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 (!
|
|
806
|
-
|
|
829
|
+
if (!l) {
|
|
830
|
+
r && e.disableApp();
|
|
807
831
|
return;
|
|
808
832
|
}
|
|
809
|
-
if (
|
|
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
|
-
}, [
|
|
839
|
+
}, [l]), k(() => () => {
|
|
816
840
|
o(!1), e.disableApp();
|
|
817
841
|
}, [o, e]), {
|
|
818
842
|
sdkEnabled: n,
|
|
819
|
-
sdkReady:
|
|
820
|
-
activateEventWithId:
|
|
821
|
-
deactivate:
|
|
822
|
-
isLogged: !!
|
|
843
|
+
sdkReady: r,
|
|
844
|
+
activateEventWithId: p,
|
|
845
|
+
deactivate: c,
|
|
846
|
+
isLogged: !!l
|
|
823
847
|
};
|
|
824
|
-
},
|
|
825
|
-
const [,
|
|
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
|
-
|
|
851
|
+
Cs,
|
|
828
852
|
{
|
|
829
853
|
className: s,
|
|
830
|
-
scrollNode:
|
|
854
|
+
scrollNode: i,
|
|
831
855
|
appNode: o,
|
|
832
856
|
scrollStore: n,
|
|
833
|
-
feature:
|
|
857
|
+
feature: l,
|
|
834
858
|
responsiveStore: a,
|
|
835
859
|
sdk: e
|
|
836
860
|
}
|
|
837
861
|
);
|
|
838
|
-
},
|
|
839
|
-
const
|
|
840
|
-
return
|
|
841
|
-
const
|
|
842
|
-
return
|
|
843
|
-
|
|
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:
|
|
871
|
+
feature: l,
|
|
848
872
|
responsiveStore: o,
|
|
849
873
|
sdk: e
|
|
850
874
|
},
|
|
851
875
|
a
|
|
852
876
|
) : null;
|
|
853
877
|
}) : null;
|
|
854
|
-
},
|
|
855
|
-
const n =
|
|
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),
|
|
858
|
-
}, [s,
|
|
859
|
-
enabled:
|
|
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
|
-
}),
|
|
864
|
-
enabled:
|
|
887
|
+
}), _(a, {
|
|
888
|
+
enabled: d,
|
|
865
889
|
event: "click",
|
|
866
890
|
listener: Ze,
|
|
867
891
|
useDomNode: !0
|
|
868
892
|
});
|
|
869
|
-
const
|
|
893
|
+
const f = C(() => ({ sdk: e }), [e]);
|
|
870
894
|
return k(() => {
|
|
871
895
|
import("./gamification-feature.js");
|
|
872
|
-
}, []), /* @__PURE__ */ t(
|
|
873
|
-
|
|
874
|
-
/* @__PURE__ */
|
|
875
|
-
|
|
876
|
-
|
|
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:
|
|
883
|
-
responsiveStore:
|
|
906
|
+
scrollStore: l,
|
|
907
|
+
responsiveStore: i
|
|
884
908
|
}
|
|
885
909
|
),
|
|
886
|
-
|
|
887
|
-
|
|
910
|
+
r && /* @__PURE__ */ t(
|
|
911
|
+
an,
|
|
888
912
|
{
|
|
889
|
-
scrollStore:
|
|
890
|
-
responsiveStore:
|
|
913
|
+
scrollStore: l,
|
|
914
|
+
responsiveStore: i,
|
|
891
915
|
scrollNode: a,
|
|
892
916
|
appNode: n,
|
|
893
|
-
className:
|
|
917
|
+
className: q,
|
|
894
918
|
sdk: e
|
|
895
919
|
}
|
|
896
920
|
),
|
|
897
|
-
|
|
921
|
+
r && /* @__PURE__ */ t(ln, { responsiveStore: i, appNode: n, className: q, sdk: e })
|
|
898
922
|
] }),
|
|
899
|
-
|
|
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
|
-
},
|
|
908
|
-
const { sdk: e } =
|
|
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
|
-
},
|
|
911
|
-
const { sdk: s, status: n } =
|
|
912
|
-
if (n ===
|
|
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 ===
|
|
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
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
941
|
+
mn as E,
|
|
942
|
+
kn as S,
|
|
943
|
+
cn as i,
|
|
944
|
+
fn as u
|
|
921
945
|
};
|