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