@streamlayer/react 0.25.1 → 0.26.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/masters.d.ts +12 -1
- package/lib/app-4f52ea4a.js +29 -0
- package/lib/app-5daf0c14.cjs +1 -0
- package/lib/cjs/auth.js +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/masters.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/es/auth.js +11 -11
- package/lib/es/index.js +10 -10
- package/lib/es/masters.js +183 -178
- package/lib/es/points.js +23 -23
- package/lib/{provider-b2d54b1b.cjs → index-7542e06a.cjs} +4 -4
- package/lib/{provider-a6b36c89.js → index-98996b43.js} +768 -765
- package/lib/style.css +1 -1
- package/package.json +25 -19
- package/lib/app-43e52907.js +0 -29
- package/lib/app-519f86cc.cjs +0 -1
package/lib/es/masters.js
CHANGED
|
@@ -1,396 +1,401 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { QuestionType as T, FeatureType as A } from "@streamlayer/sdk-web-types";
|
|
5
|
-
import { useStore as d } from "@nanostores/react";
|
|
6
|
-
import { FeatureStatus as v } from "@streamlayer/sdk-web-interfaces";
|
|
7
|
-
import "react-countdown-circle-timer";
|
|
1
|
+
import { jsx as a, jsxs as i, Fragment as g } from "react/jsx-runtime";
|
|
2
|
+
import { useState as h, useMemo as E, useCallback as C, useEffect as L, useContext as w } from "react";
|
|
3
|
+
import { s as r, Y as y, o as O, X as Q, d as R, x as F, u as M, v as q, h as b, e as G, i as H, j, f as N, S as D, a as B, b as P, p as T } from "../index-98996b43.js";
|
|
8
4
|
import "react-auth-code-input";
|
|
9
5
|
import "react-phone-number-input";
|
|
10
6
|
import "@connectrpc/connect";
|
|
11
7
|
import "@connectrpc/connect-web";
|
|
12
8
|
import "@streamlayer/sl-eslib/users/users_connect";
|
|
9
|
+
import "react-countdown-circle-timer";
|
|
10
|
+
import { QuestionType as z, FeatureType as A } from "@streamlayer/sdk-web-types";
|
|
11
|
+
import { FeatureStatus as v } from "@streamlayer/sdk-web-interfaces";
|
|
13
12
|
import "@streamlayer/sdk-web-features";
|
|
14
13
|
import "@streamlayer/sdk-web-api";
|
|
15
14
|
import "@streamlayer/sdk-web-storage";
|
|
15
|
+
import { useStore as p } from "@nanostores/react";
|
|
16
16
|
import "@streamlayer/sdk-web-notifications";
|
|
17
|
+
import "./useStreamLayerApp.js";
|
|
18
|
+
import "@streamlayer/sdk-web";
|
|
17
19
|
import "@streamlayer/sl-eslib/interactive/interactive.common_pb";
|
|
18
20
|
import "@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb";
|
|
19
21
|
import "@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb";
|
|
20
22
|
import "@streamlayer/sl-eslib/sports/events/events_connect";
|
|
21
23
|
import "@streamlayer/sl-eslib/sdkSettings/client/client_connect";
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
feature: e,
|
|
26
|
-
sdk: s,
|
|
27
|
-
children: n
|
|
28
|
-
}) => {
|
|
29
|
-
const r = d(e.status), { slStreamId: a } = d(s.sdkStore);
|
|
30
|
-
return a != null && a.loading ? /* @__PURE__ */ t("div", { children: "event is loading..." }) : a != null && a.data ? r !== v.Ready ? /* @__PURE__ */ t("div", { children: "wait feature..." }) : n : /* @__PURE__ */ t("div", { children: "event is forbidden..." });
|
|
24
|
+
const _ = ({ feature: e, sdk: s, children: t, className: n }) => {
|
|
25
|
+
const l = p(e.status), { slStreamId: o } = p(s.sdkStore);
|
|
26
|
+
return o != null && o.loading ? /* @__PURE__ */ a("div", { className: n, children: "event is loading..." }) : o != null && o.data ? l !== v.Ready ? /* @__PURE__ */ a("div", { className: n, children: "wait feature..." }) : t : /* @__PURE__ */ a("div", { className: n, children: "event is forbidden..." });
|
|
31
27
|
};
|
|
32
|
-
const
|
|
28
|
+
const Y = () => x, K = /* @__PURE__ */ r("div")({
|
|
33
29
|
name: "i",
|
|
34
30
|
class: "idhrx8x",
|
|
35
31
|
propsAsIs: !1
|
|
36
|
-
}), $ = /* @__PURE__ */
|
|
32
|
+
}), $ = /* @__PURE__ */ r("div")({
|
|
37
33
|
name: "r",
|
|
38
34
|
class: "r1k6v4ep",
|
|
39
35
|
propsAsIs: !1
|
|
40
|
-
}), x = /* @__PURE__ */
|
|
36
|
+
}), x = /* @__PURE__ */ r("div")({
|
|
41
37
|
name: "t",
|
|
42
38
|
class: "t1v8kucd",
|
|
43
39
|
propsAsIs: !1
|
|
44
|
-
}), U = /* @__PURE__ */
|
|
40
|
+
}), U = /* @__PURE__ */ r(Y())({
|
|
45
41
|
name: "o",
|
|
46
42
|
class: "o16yw7z1",
|
|
47
43
|
propsAsIs: !0
|
|
48
44
|
});
|
|
49
|
-
const
|
|
45
|
+
const W = /* @__PURE__ */ r("div")({
|
|
50
46
|
name: "n",
|
|
51
47
|
class: "n1aopxp8",
|
|
52
48
|
propsAsIs: !1
|
|
53
|
-
}),
|
|
49
|
+
}), X = ({
|
|
54
50
|
children: e,
|
|
55
51
|
style: s,
|
|
56
|
-
className:
|
|
57
|
-
}) => /* @__PURE__ */
|
|
52
|
+
className: t
|
|
53
|
+
}) => /* @__PURE__ */ a(W, {
|
|
58
54
|
style: s,
|
|
59
|
-
className:
|
|
55
|
+
className: t,
|
|
60
56
|
children: e
|
|
61
57
|
});
|
|
62
|
-
const
|
|
58
|
+
const J = () => y, V = () => y, Z = /* @__PURE__ */ r("div")({
|
|
63
59
|
name: "a",
|
|
64
60
|
class: "acysrl1",
|
|
65
61
|
propsAsIs: !1
|
|
66
|
-
}),
|
|
62
|
+
}), ee = /* @__PURE__ */ r("div")({
|
|
67
63
|
name: "l",
|
|
68
64
|
class: "lo57cjm",
|
|
69
65
|
propsAsIs: !1
|
|
70
|
-
}),
|
|
66
|
+
}), se = /* @__PURE__ */ r(J())({
|
|
71
67
|
name: "p",
|
|
72
68
|
class: "p14kwh4y",
|
|
73
69
|
propsAsIs: !0
|
|
74
|
-
}),
|
|
70
|
+
}), ae = /* @__PURE__ */ r("span")({
|
|
75
71
|
name: "s",
|
|
76
72
|
class: "sxun7sq",
|
|
77
73
|
propsAsIs: !1
|
|
78
|
-
}), te = /* @__PURE__ */
|
|
74
|
+
}), te = /* @__PURE__ */ r("button")({
|
|
79
75
|
name: "c",
|
|
80
76
|
class: "c1i8ida8",
|
|
81
77
|
propsAsIs: !1
|
|
82
|
-
}), ne = /* @__PURE__ */
|
|
78
|
+
}), ne = /* @__PURE__ */ r(V())({
|
|
83
79
|
name: "g",
|
|
84
80
|
class: "g1m0xfmw",
|
|
85
81
|
propsAsIs: !0
|
|
86
|
-
}),
|
|
87
|
-
const
|
|
88
|
-
return /* @__PURE__ */
|
|
89
|
-
/* @__PURE__ */
|
|
90
|
-
(
|
|
91
|
-
(
|
|
82
|
+
}), oe = ({ type: e, close: s }) => {
|
|
83
|
+
const t = O[e];
|
|
84
|
+
return /* @__PURE__ */ i(Z, { children: [
|
|
85
|
+
/* @__PURE__ */ i(ee, { children: [
|
|
86
|
+
(t == null ? void 0 : t.iconName) && /* @__PURE__ */ a(se, { name: t.iconName }),
|
|
87
|
+
(t == null ? void 0 : t.label) && /* @__PURE__ */ a(ae, { children: t.label })
|
|
92
88
|
] }),
|
|
93
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ a(te, { onClick: s, children: /* @__PURE__ */ a(ne, { name: "icon-cross" }) })
|
|
94
90
|
] });
|
|
95
91
|
};
|
|
96
|
-
const
|
|
92
|
+
const re = /* @__PURE__ */ r("div")({
|
|
97
93
|
name: "r",
|
|
98
94
|
class: "ruyb9yw",
|
|
99
95
|
propsAsIs: !1
|
|
100
|
-
}),
|
|
96
|
+
}), le = /* @__PURE__ */ r("img")({
|
|
101
97
|
name: "i",
|
|
102
98
|
class: "imbcgl0",
|
|
103
99
|
propsAsIs: !1
|
|
104
|
-
}),
|
|
100
|
+
}), ce = ({
|
|
105
101
|
sponsorLogo: e
|
|
106
|
-
}) => e && /* @__PURE__ */
|
|
107
|
-
children: /* @__PURE__ */
|
|
102
|
+
}) => e && /* @__PURE__ */ a(re, {
|
|
103
|
+
children: /* @__PURE__ */ a(le, {
|
|
108
104
|
alt: "sponsor-logo",
|
|
109
105
|
src: e
|
|
110
106
|
})
|
|
111
107
|
});
|
|
112
|
-
const
|
|
108
|
+
const ie = /* @__PURE__ */ r("div")({
|
|
113
109
|
name: "x",
|
|
114
110
|
class: "xk8r1eq",
|
|
115
111
|
propsAsIs: !1
|
|
116
|
-
}),
|
|
112
|
+
}), de = ({
|
|
117
113
|
openedQuestion: e,
|
|
118
114
|
closeQuestion: s,
|
|
119
|
-
vote:
|
|
115
|
+
vote: t
|
|
120
116
|
}) => {
|
|
121
|
-
var
|
|
122
|
-
return /* @__PURE__ */
|
|
123
|
-
children: [/* @__PURE__ */
|
|
117
|
+
var n;
|
|
118
|
+
return /* @__PURE__ */ i(ie, {
|
|
119
|
+
children: [/* @__PURE__ */ a(oe, {
|
|
124
120
|
close: s,
|
|
125
|
-
type: (e == null ? void 0 : e.type) ||
|
|
126
|
-
}), e && /* @__PURE__ */
|
|
127
|
-
vote:
|
|
121
|
+
type: (e == null ? void 0 : e.type) || z.UNSET
|
|
122
|
+
}), e && /* @__PURE__ */ a(Q, {
|
|
123
|
+
vote: t,
|
|
128
124
|
openedQuestion: e
|
|
129
|
-
}), /* @__PURE__ */
|
|
130
|
-
sponsorLogo: (
|
|
125
|
+
}), /* @__PURE__ */ a(ce, {
|
|
126
|
+
sponsorLogo: (n = e == null ? void 0 : e.sponsorship) == null ? void 0 : n.logo
|
|
131
127
|
})]
|
|
132
128
|
});
|
|
133
|
-
},
|
|
134
|
-
const { data: s } =
|
|
135
|
-
const
|
|
136
|
-
|
|
129
|
+
}, pe = ({ leaderboardList: e }) => {
|
|
130
|
+
const { data: s } = p(e.$store), [t, n] = h(void 0), l = (o) => {
|
|
131
|
+
const c = s.find((d) => d.userId === o);
|
|
132
|
+
n(c);
|
|
137
133
|
};
|
|
138
|
-
return /* @__PURE__ */
|
|
139
|
-
|
|
140
|
-
!
|
|
134
|
+
return /* @__PURE__ */ i(g, { children: [
|
|
135
|
+
t && /* @__PURE__ */ a(R, { comeBack: () => l(null), ...t }),
|
|
136
|
+
!t && /* @__PURE__ */ a(F, { fetchMore: e.fetchMore, items: s, openItemDetail: l })
|
|
141
137
|
] });
|
|
142
|
-
},
|
|
143
|
-
const
|
|
144
|
-
return
|
|
145
|
-
},
|
|
146
|
-
const { data: s } =
|
|
147
|
-
return s != null && s.summary ? /* @__PURE__ */
|
|
148
|
-
},
|
|
149
|
-
const [s,
|
|
150
|
-
return /* @__PURE__ */
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
/* @__PURE__ */
|
|
153
|
-
s === b.HOME && /* @__PURE__ */
|
|
138
|
+
}, ue = ({ store: e, openQuestion: s }) => {
|
|
139
|
+
const t = p(e);
|
|
140
|
+
return t != null && t.data ? /* @__PURE__ */ a(M, { openQuestion: s, questions: t.data }) : /* @__PURE__ */ a("div", { children: "wait questions..." });
|
|
141
|
+
}, me = ({ store: e }) => {
|
|
142
|
+
const { data: s } = p(e);
|
|
143
|
+
return s != null && s.summary ? /* @__PURE__ */ a(q, { ...s.summary, ...s.percentage }) : /* @__PURE__ */ a("div", { children: "wait user..." });
|
|
144
|
+
}, ve = ({ gamification: e }) => {
|
|
145
|
+
const [s, t] = h(b.HOME);
|
|
146
|
+
return /* @__PURE__ */ i(g, { children: [
|
|
147
|
+
/* @__PURE__ */ i(U, { children: [
|
|
148
|
+
/* @__PURE__ */ a(G, { activePage: s, toggleActivePage: t }),
|
|
149
|
+
s === b.HOME && /* @__PURE__ */ a(me, { store: e.userSummary.getStore() })
|
|
154
150
|
] }),
|
|
155
|
-
s === b.HOME && /* @__PURE__ */
|
|
156
|
-
s === b.LEADERBOARD && /* @__PURE__ */
|
|
151
|
+
s === b.HOME && /* @__PURE__ */ a(x, { children: /* @__PURE__ */ a(ue, { openQuestion: e.openQuestion, store: e.questions.getStore() }) }),
|
|
152
|
+
s === b.LEADERBOARD && /* @__PURE__ */ a(x, { style: { flex: "1 1 auto" }, children: /* @__PURE__ */ a(pe, { leaderboardList: e.leaderboardList }) })
|
|
157
153
|
] });
|
|
158
154
|
};
|
|
159
|
-
const
|
|
160
|
-
name: "
|
|
161
|
-
class: "
|
|
155
|
+
const he = () => X, fe = /* @__PURE__ */ r(he())({
|
|
156
|
+
name: "c",
|
|
157
|
+
class: "c1ph66cs",
|
|
162
158
|
propsAsIs: !0
|
|
163
|
-
}),
|
|
164
|
-
gamification: e
|
|
159
|
+
}), ge = ({
|
|
160
|
+
gamification: e,
|
|
161
|
+
className: s
|
|
165
162
|
}) => {
|
|
166
163
|
const {
|
|
167
|
-
loading:
|
|
164
|
+
loading: t,
|
|
168
165
|
data: n
|
|
169
|
-
} =
|
|
170
|
-
return /* @__PURE__ */
|
|
171
|
-
children: [(
|
|
172
|
-
|
|
166
|
+
} = p(e.openedQuestion);
|
|
167
|
+
return /* @__PURE__ */ i(g, {
|
|
168
|
+
children: [(t || n) && /* @__PURE__ */ a(fe, {
|
|
169
|
+
className: s,
|
|
170
|
+
children: /* @__PURE__ */ a(de, {
|
|
173
171
|
closeQuestion: e.closeQuestion,
|
|
174
172
|
vote: e.submitAnswer,
|
|
175
173
|
openedQuestion: n
|
|
176
174
|
})
|
|
177
|
-
}), /* @__PURE__ */
|
|
175
|
+
}), /* @__PURE__ */ a($, {
|
|
176
|
+
className: s,
|
|
178
177
|
"data-nav": "true",
|
|
179
178
|
style: {
|
|
180
179
|
display: "flex",
|
|
181
180
|
flexDirection: "column"
|
|
182
181
|
},
|
|
183
|
-
children: /* @__PURE__ */
|
|
182
|
+
children: /* @__PURE__ */ a(ve, {
|
|
184
183
|
gamification: e
|
|
185
184
|
})
|
|
186
185
|
})]
|
|
187
186
|
});
|
|
188
|
-
},
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
187
|
+
}, ye = ({
|
|
188
|
+
highlights: e,
|
|
189
|
+
className: s
|
|
190
|
+
}) => {
|
|
191
|
+
const t = p(e.openedInsight);
|
|
192
|
+
return /* @__PURE__ */ i(g, { children: [
|
|
193
|
+
!t && e.insights && /* @__PURE__ */ a(H, { className: s, highlights: e, store: e.insights.getStore() }),
|
|
194
|
+
t && /* @__PURE__ */ a(
|
|
195
|
+
j,
|
|
194
196
|
{
|
|
195
|
-
|
|
197
|
+
className: s,
|
|
198
|
+
openedInsight: t,
|
|
196
199
|
closeHighlights: e.closeFeature,
|
|
197
200
|
closeInsight: e.closeHighlight
|
|
198
201
|
}
|
|
199
202
|
)
|
|
200
203
|
] });
|
|
201
|
-
},
|
|
202
|
-
|
|
204
|
+
}, be = ({
|
|
205
|
+
sdk: e,
|
|
206
|
+
feature: s,
|
|
207
|
+
className: t
|
|
208
|
+
}) => E(() => s ? s.featureConfig.get().type === A.GAMES ? /* @__PURE__ */ a(_, { className: t, sdk: e, feature: s, children: /* @__PURE__ */ a(ge, { className: t, gamification: s, sdk: e }) }) : s.featureConfig.get().type === A.HIGHLIGHTS ? /* @__PURE__ */ a(_, { className: t, sdk: e, feature: s, children: /* @__PURE__ */ a(ye, { className: t, highlights: s, sdk: e }) }) : null : null, [e, s]);
|
|
209
|
+
const ke = /* @__PURE__ */ r("button")({
|
|
203
210
|
name: "e",
|
|
204
211
|
class: "enu64b2",
|
|
205
212
|
propsAsIs: !1
|
|
206
|
-
}),
|
|
213
|
+
}), Se = /* @__PURE__ */ r("span")({
|
|
207
214
|
name: "t",
|
|
208
215
|
class: "tw2meku",
|
|
209
216
|
propsAsIs: !1
|
|
210
|
-
}),
|
|
217
|
+
}), Ae = /* @__PURE__ */ r("span")({
|
|
211
218
|
name: "a",
|
|
212
219
|
class: "aka8vam",
|
|
213
220
|
propsAsIs: !1
|
|
214
|
-
}), I = ({ disabled: e, active: s, onClick:
|
|
215
|
-
|
|
216
|
-
/* @__PURE__ */
|
|
221
|
+
}), I = ({ disabled: e, active: s, onClick: t, label: n, icon: l }) => /* @__PURE__ */ a(ke, { onClick: t, disabled: e, "data-selected": s, children: /* @__PURE__ */ i(g, { children: [
|
|
222
|
+
l && /* @__PURE__ */ a(Se, { children: l }),
|
|
223
|
+
/* @__PURE__ */ a(Ae, { children: n })
|
|
217
224
|
] }) });
|
|
218
|
-
const
|
|
225
|
+
const $e = () => y, xe = /* @__PURE__ */ r($e())({
|
|
219
226
|
name: "a",
|
|
220
227
|
class: "a10lggiw",
|
|
221
228
|
propsAsIs: !0
|
|
222
|
-
}), f = "channels",
|
|
229
|
+
}), f = "channels", Ie = (e) => {
|
|
223
230
|
var s;
|
|
224
|
-
return /* @__PURE__ */
|
|
231
|
+
return /* @__PURE__ */ a(I, {
|
|
225
232
|
...e,
|
|
226
233
|
id: "channels",
|
|
227
234
|
label: "Channels",
|
|
228
|
-
icon: /* @__PURE__ */
|
|
235
|
+
icon: /* @__PURE__ */ a(xe, {
|
|
229
236
|
name: "icon-btn-channels",
|
|
230
237
|
"data-selected": (s = e.active) == null ? void 0 : s.toString()
|
|
231
238
|
})
|
|
232
239
|
});
|
|
233
240
|
};
|
|
234
|
-
const
|
|
241
|
+
const Ne = () => y, _e = /* @__PURE__ */ r(Ne())({
|
|
235
242
|
name: "d",
|
|
236
243
|
class: "d1x5s8ie",
|
|
237
244
|
propsAsIs: !0
|
|
238
245
|
}), u = "featuredGroups", Le = (e) => {
|
|
239
246
|
var s;
|
|
240
|
-
return /* @__PURE__ */
|
|
247
|
+
return /* @__PURE__ */ a(I, {
|
|
241
248
|
...e,
|
|
242
249
|
label: "FG+",
|
|
243
250
|
id: "featuredGroups",
|
|
244
|
-
icon: /* @__PURE__ */
|
|
251
|
+
icon: /* @__PURE__ */ a(_e, {
|
|
245
252
|
name: "icon-btn-feature-groups",
|
|
246
253
|
"data-selected": (s = e.active) == null ? void 0 : s.toString()
|
|
247
254
|
})
|
|
248
255
|
});
|
|
249
256
|
};
|
|
250
|
-
const Ee = () => y,
|
|
257
|
+
const Ee = () => y, Ce = /* @__PURE__ */ r(Ee())({
|
|
251
258
|
name: "n",
|
|
252
259
|
class: "ntav86o",
|
|
253
260
|
propsAsIs: !0
|
|
254
|
-
}), k = "leaderboard",
|
|
261
|
+
}), k = "leaderboard", we = (e) => {
|
|
255
262
|
var s;
|
|
256
|
-
return /* @__PURE__ */
|
|
263
|
+
return /* @__PURE__ */ a(I, {
|
|
257
264
|
...e,
|
|
258
265
|
label: "Leader Board",
|
|
259
266
|
id: "leaderboard",
|
|
260
|
-
icon: /* @__PURE__ */
|
|
267
|
+
icon: /* @__PURE__ */ a(Ce, {
|
|
261
268
|
name: "icon-btn-leaderboard",
|
|
262
269
|
"data-selected": (s = e.active) == null ? void 0 : s.toString()
|
|
263
270
|
})
|
|
264
271
|
});
|
|
265
272
|
};
|
|
266
|
-
const
|
|
273
|
+
const Oe = /* @__PURE__ */ r("div")({
|
|
267
274
|
name: "n",
|
|
268
275
|
class: "n1rlvhvz",
|
|
269
276
|
propsAsIs: !1
|
|
270
|
-
}),
|
|
277
|
+
}), Qe = ({
|
|
271
278
|
children: e,
|
|
272
279
|
className: s
|
|
273
|
-
}) => /* @__PURE__ */
|
|
280
|
+
}) => /* @__PURE__ */ a(Oe, {
|
|
274
281
|
className: s,
|
|
275
282
|
children: e
|
|
276
283
|
});
|
|
277
|
-
const
|
|
284
|
+
const Re = () => Qe, Fe = /* @__PURE__ */ r(Re())({
|
|
278
285
|
name: "n",
|
|
279
286
|
class: "n9bnom",
|
|
280
287
|
propsAsIs: !0
|
|
281
|
-
}), Me = ({ activeOverlay: e, setActiveOverlay: s, sdkReady: n }) => /* @__PURE__ */
|
|
282
|
-
/* @__PURE__ */
|
|
283
|
-
/* @__PURE__ */
|
|
288
|
+
}), Me = ({ activeOverlay: e, setActiveOverlay: s, sdkReady: t, className: n }) => /* @__PURE__ */ i(Fe, { className: n, children: [
|
|
289
|
+
/* @__PURE__ */ a(Ie, { active: e === f, onClick: () => s(f) }),
|
|
290
|
+
/* @__PURE__ */ a(
|
|
284
291
|
Le,
|
|
285
292
|
{
|
|
286
293
|
active: e === u,
|
|
287
|
-
disabled: !
|
|
294
|
+
disabled: !t,
|
|
288
295
|
onClick: () => {
|
|
289
296
|
s(u);
|
|
290
297
|
}
|
|
291
298
|
}
|
|
292
299
|
),
|
|
293
|
-
/* @__PURE__ */
|
|
294
|
-
|
|
300
|
+
/* @__PURE__ */ a(
|
|
301
|
+
we,
|
|
295
302
|
{
|
|
296
303
|
active: e === k,
|
|
297
304
|
onClick: () => s(k)
|
|
298
305
|
}
|
|
299
306
|
)
|
|
300
|
-
] }), qe = (e
|
|
301
|
-
const [
|
|
302
|
-
(m) => {
|
|
303
|
-
|
|
307
|
+
] }), qe = (e) => {
|
|
308
|
+
const [s, t] = h(!1), n = p(e.status) === "ready", [l, o] = h(u), c = C(
|
|
309
|
+
(d, m) => {
|
|
310
|
+
o(m), m === u ? (d && e.createEventSession(d), e.openFeature(A.GAMES)) : e.closeFeature();
|
|
304
311
|
},
|
|
305
|
-
[
|
|
312
|
+
[e]
|
|
306
313
|
);
|
|
307
314
|
return L(() => {
|
|
308
|
-
!
|
|
309
|
-
}, [
|
|
310
|
-
sdkEnabled:
|
|
311
|
-
sdkReady:
|
|
315
|
+
!n && l === u && (o(f), e.closeFeature());
|
|
316
|
+
}, [n, l, e]), {
|
|
317
|
+
sdkEnabled: s,
|
|
318
|
+
sdkReady: n,
|
|
312
319
|
activeOverlay: l,
|
|
313
|
-
activateAndLoadOverlay:
|
|
314
|
-
enableSdk: () => {
|
|
320
|
+
activateAndLoadOverlay: c,
|
|
321
|
+
enableSdk: (d) => {
|
|
315
322
|
e.initializeApp().then(({ enabled: m, err: S }) => {
|
|
316
|
-
if (
|
|
317
|
-
|
|
323
|
+
if (t(!0), S) {
|
|
324
|
+
c(d, f);
|
|
318
325
|
return;
|
|
319
326
|
}
|
|
320
327
|
if (m) {
|
|
321
|
-
|
|
328
|
+
c(d, u);
|
|
322
329
|
return;
|
|
323
330
|
}
|
|
324
331
|
});
|
|
325
332
|
},
|
|
326
333
|
disableSdk: () => {
|
|
327
|
-
|
|
334
|
+
t(!1), e.disableApp();
|
|
328
335
|
}
|
|
329
336
|
};
|
|
330
337
|
}, Ge = (e) => {
|
|
331
|
-
const s =
|
|
338
|
+
const s = p(e.getActiveFeature()), [t, n] = h(null);
|
|
332
339
|
return L(() => {
|
|
333
|
-
const
|
|
340
|
+
const l = e.getFeatures();
|
|
334
341
|
if (s)
|
|
335
|
-
for (const [
|
|
336
|
-
|
|
342
|
+
for (const [o, c] of l)
|
|
343
|
+
o === s ? c.status.get() === v.Suspended && (c.enable(), n(c)) : c.status.get() === v.Ready && c.disable();
|
|
337
344
|
else {
|
|
338
|
-
for (const [,
|
|
339
|
-
|
|
340
|
-
|
|
345
|
+
for (const [, o] of l)
|
|
346
|
+
o.status.get() === v.Ready && o.disable();
|
|
347
|
+
n(null);
|
|
341
348
|
}
|
|
342
349
|
return () => {
|
|
343
|
-
for (const [,
|
|
344
|
-
|
|
350
|
+
for (const [, o] of l)
|
|
351
|
+
o.status.get() === v.Ready && o.disable();
|
|
345
352
|
};
|
|
346
|
-
}, [s, e]), [s,
|
|
347
|
-
}, He = ({ sdk: e }) => {
|
|
348
|
-
const [,
|
|
349
|
-
return /* @__PURE__ */
|
|
350
|
-
},
|
|
351
|
-
const { sdkEnabled:
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
);
|
|
355
|
-
return /* @__PURE__ */ t(G, { style: { height: "100%" }, children: /* @__PURE__ */ c(Y, { children: [
|
|
356
|
-
a && /* @__PURE__ */ t(
|
|
353
|
+
}, [s, e]), [s, t];
|
|
354
|
+
}, He = ({ sdk: e, className: s }) => {
|
|
355
|
+
const [, t] = Ge(e);
|
|
356
|
+
return /* @__PURE__ */ a(be, { className: s, feature: t, sdk: e });
|
|
357
|
+
}, je = ({ sdk: e, overlays: s, children: t }) => {
|
|
358
|
+
const { sdkEnabled: n, sdkReady: l, activeOverlay: o, activateAndLoadOverlay: c, enableSdk: d, disableSdk: m } = qe(e);
|
|
359
|
+
return /* @__PURE__ */ i(K, { children: [
|
|
360
|
+
n && /* @__PURE__ */ a(
|
|
357
361
|
Me,
|
|
358
362
|
{
|
|
359
363
|
sdkReady: l,
|
|
360
|
-
activeOverlay:
|
|
361
|
-
|
|
364
|
+
activeOverlay: o,
|
|
365
|
+
className: N,
|
|
366
|
+
setActiveOverlay: (S) => c("", S)
|
|
362
367
|
}
|
|
363
368
|
),
|
|
364
|
-
/* @__PURE__ */
|
|
369
|
+
/* @__PURE__ */ a(
|
|
365
370
|
$,
|
|
366
371
|
{
|
|
367
|
-
"data-nav":
|
|
368
|
-
style: { display: !
|
|
369
|
-
children:
|
|
372
|
+
"data-nav": n.toString(),
|
|
373
|
+
style: { display: !n || o === f ? "block" : "none" },
|
|
374
|
+
children: t && t({ enableSdk: d, disableSdk: m })
|
|
370
375
|
}
|
|
371
376
|
),
|
|
372
|
-
/* @__PURE__ */
|
|
377
|
+
/* @__PURE__ */ a(
|
|
373
378
|
$,
|
|
374
379
|
{
|
|
375
|
-
"data-nav":
|
|
376
|
-
style: { display:
|
|
377
|
-
children: s &&
|
|
380
|
+
"data-nav": n.toString(),
|
|
381
|
+
style: { display: o === k ? "block" : "none" },
|
|
382
|
+
children: s && o === k && s[o]
|
|
378
383
|
}
|
|
379
384
|
),
|
|
380
|
-
|
|
381
|
-
] })
|
|
382
|
-
},
|
|
385
|
+
n && o === u && /* @__PURE__ */ a(He, { className: N, sdk: e })
|
|
386
|
+
] });
|
|
387
|
+
}, ds = ({
|
|
383
388
|
sdkKey: e,
|
|
384
389
|
plugins: s,
|
|
385
|
-
children:
|
|
386
|
-
production:
|
|
387
|
-
}) => /* @__PURE__ */
|
|
388
|
-
const { sdk:
|
|
389
|
-
if (
|
|
390
|
+
children: t,
|
|
391
|
+
production: n = !0
|
|
392
|
+
}) => /* @__PURE__ */ a(D, { sdkKey: e, plugins: s, production: n, autoEnable: !1, children: t }), ps = ({ children: e, overlays: s }) => {
|
|
393
|
+
const { sdk: t, status: n } = w(B);
|
|
394
|
+
if (n === P.UNSET)
|
|
390
395
|
throw new Error("Wrap app in `StreamLayerProvider`");
|
|
391
|
-
return
|
|
396
|
+
return t ? /* @__PURE__ */ a("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ a(T, { children: /* @__PURE__ */ a(je, { sdk: t, overlays: s, children: e }) }) }) : e({});
|
|
392
397
|
};
|
|
393
398
|
export {
|
|
394
|
-
|
|
395
|
-
|
|
399
|
+
ds as MastersStreamLayerProvider,
|
|
400
|
+
ps as MastersStreamLayerSDKReact
|
|
396
401
|
};
|