@streamlayer/react 0.27.0 → 0.27.2

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.
@@ -0,0 +1,228 @@
1
+ import { jsxs as r, jsx as t, Fragment as g } from "react/jsx-runtime";
2
+ import { s as o, q as d, o as b, w as y, Y as x, j as A, C as $, v as u, h as c, e as h, d as I, g as p, r as Q } from "./index-ed4f12f6.js";
3
+ import { useStore as a } from "@nanostores/react";
4
+ import { useState as w } from "react";
5
+ import { QuestionType as S } from "@streamlayer/sdk-web-types";
6
+ import "react-countdown-circle-timer";
7
+ import "./es/useStreamLayerApp.js";
8
+ import "@streamlayer/sdk-web";
9
+ import "@streamlayer/sdk-web-interfaces";
10
+ import "@streamlayer/sdk-web-features";
11
+ import "@streamlayer/sdk-web-api";
12
+ import "@streamlayer/sdk-web-storage";
13
+ import "@streamlayer/sdk-web-notifications";
14
+ import "@streamlayer/sl-eslib/interactive/interactive.common_pb";
15
+ import "@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb";
16
+ import "@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb";
17
+ import "@streamlayer/sl-eslib/sports/events/events_connect";
18
+ import "@streamlayer/sl-eslib/sdkSettings/client/client_connect";
19
+ import "@streamlayer/sl-eslib/users/users_connect";
20
+ import "react-auth-code-input";
21
+ import "react-phone-number-input";
22
+ import "@connectrpc/connect";
23
+ import "@connectrpc/connect-web";
24
+ const k = () => d, q = () => d, N = /* @__PURE__ */ o("div")({
25
+ name: "a",
26
+ class: "acysrl1",
27
+ propsAsIs: !1
28
+ }), _ = /* @__PURE__ */ o("div")({
29
+ name: "l",
30
+ class: "lo57cjm",
31
+ propsAsIs: !1
32
+ }), L = /* @__PURE__ */ o(k())({
33
+ name: "p",
34
+ class: "p14kwh4y",
35
+ propsAsIs: !0
36
+ }), U = /* @__PURE__ */ o("span")({
37
+ name: "s",
38
+ class: "sxun7sq",
39
+ propsAsIs: !1
40
+ }), E = /* @__PURE__ */ o("button")({
41
+ name: "c",
42
+ class: "c1i8ida8",
43
+ propsAsIs: !1
44
+ }), D = /* @__PURE__ */ o(q())({
45
+ name: "g",
46
+ class: "g1m0xfmw",
47
+ propsAsIs: !0
48
+ }), v = ({ type: e, close: n, label: s }) => {
49
+ const i = e ? b[e] : { label: s, iconName: void 0 };
50
+ return /* @__PURE__ */ r(N, { children: [
51
+ /* @__PURE__ */ r(_, { children: [
52
+ (i == null ? void 0 : i.iconName) && /* @__PURE__ */ t(L, { name: i.iconName }),
53
+ (i == null ? void 0 : i.label) && /* @__PURE__ */ t(U, { children: i.label })
54
+ ] }),
55
+ /* @__PURE__ */ t(E, { onClick: n, children: /* @__PURE__ */ t(D, { name: "icon-cross" }) })
56
+ ] });
57
+ };
58
+ const M = /* @__PURE__ */ o("div")({
59
+ name: "n",
60
+ class: "n1aopxp8",
61
+ propsAsIs: !1
62
+ }), j = ({
63
+ children: e,
64
+ style: n,
65
+ className: s
66
+ }) => /* @__PURE__ */ t(M, {
67
+ style: n,
68
+ className: s,
69
+ children: e
70
+ });
71
+ const O = /* @__PURE__ */ o("div")({
72
+ name: "e",
73
+ class: "e18unvw4",
74
+ propsAsIs: !1
75
+ }), C = /* @__PURE__ */ o("div")({
76
+ name: "r",
77
+ class: "rs0uvk8",
78
+ propsAsIs: !1
79
+ }), H = /* @__PURE__ */ o("h3")({
80
+ name: "n",
81
+ class: "n1hem4g7",
82
+ propsAsIs: !1
83
+ }), T = /* @__PURE__ */ o("div")({
84
+ name: "i",
85
+ class: "i193lbwv",
86
+ propsAsIs: !1
87
+ }), F = /* @__PURE__ */ o("a")({
88
+ name: "a",
89
+ class: "a1dka9qs",
90
+ propsAsIs: !1
91
+ }), R = /* @__PURE__ */ o("div")({
92
+ name: "l",
93
+ class: "l1un98tk",
94
+ propsAsIs: !1
95
+ }), B = ({
96
+ created: e,
97
+ title: n,
98
+ instantView: s
99
+ }) => {
100
+ const i = new Date(e), l = i.toLocaleDateString("en-US", {
101
+ weekday: "short",
102
+ month: "short",
103
+ day: "numeric"
104
+ }), f = i.toLocaleTimeString("en-US", { hour: "2-digit", minute: "2-digit" });
105
+ return /* @__PURE__ */ r(O, { children: [
106
+ /* @__PURE__ */ r(R, { children: [
107
+ l,
108
+ "・",
109
+ f
110
+ ] }),
111
+ (s == null ? void 0 : s.video) && /* @__PURE__ */ t(y, { source: s.video.url, poster: s.video.thumbnailUrl }),
112
+ /* @__PURE__ */ r(C, { children: [
113
+ /* @__PURE__ */ t(H, { children: (s == null ? void 0 : s.heading) || n }),
114
+ /* @__PURE__ */ t(T, { children: s == null ? void 0 : s.body }),
115
+ (s == null ? void 0 : s.webLink) && /* @__PURE__ */ r(F, { href: s == null ? void 0 : s.webLink.url, target: "_blank", children: [
116
+ "Explore more of the Masters History",
117
+ /* @__PURE__ */ t(d, { name: "icon-external-link" })
118
+ ] })
119
+ ] })
120
+ ] });
121
+ };
122
+ const P = /* @__PURE__ */ o("div")({
123
+ name: "d",
124
+ class: "dk8r1eq",
125
+ propsAsIs: !1
126
+ }), V = ({
127
+ openedQuestion: e
128
+ }) => {
129
+ var n;
130
+ return ((n = e == null ? void 0 : e.attributes) == null ? void 0 : n.attributes.case) === "insight" ? /* @__PURE__ */ t(B, {
131
+ created: e.attributes.created,
132
+ ...e.attributes.attributes.value
133
+ }) : null;
134
+ }, G = ({
135
+ extendedQuestion: e,
136
+ vote: n
137
+ }) => {
138
+ const {
139
+ loading: s,
140
+ data: i
141
+ } = e;
142
+ return !s && i ? /* @__PURE__ */ t(x, {
143
+ vote: n,
144
+ openedQuestion: i
145
+ }) : null;
146
+ }, Y = ({
147
+ gamification: e
148
+ }) => {
149
+ var n;
150
+ const s = a(e.openedQuestion.$store), i = a(e.openedQuestion.$extendedStore);
151
+ if (!s)
152
+ return null;
153
+ const l = s.type;
154
+ return /* @__PURE__ */ r(P, {
155
+ children: [/* @__PURE__ */ t(v, {
156
+ close: e.closeQuestion,
157
+ type: ((n = s.attributes) == null ? void 0 : n.type) || S.UNSET
158
+ }), l === "question" && /* @__PURE__ */ t(G, {
159
+ vote: e.submitAnswer,
160
+ extendedQuestion: i
161
+ }), l !== "question" && /* @__PURE__ */ t(V, {
162
+ openedQuestion: s
163
+ })]
164
+ });
165
+ }, z = ({ leaderboardList: e, openUser: n }) => {
166
+ const { data: s } = a(e.$store);
167
+ return /* @__PURE__ */ t(A, { fetchMore: e.fetchMore, items: s, openItemDetail: n });
168
+ }, J = ({ store: e, openQuestion: n }) => {
169
+ const s = a(e);
170
+ return s != null && s.data ? /* @__PURE__ */ t($, { openQuestion: n, questions: s.data }) : /* @__PURE__ */ t("div", { children: "wait questions..." });
171
+ }, K = ({ store: e }) => {
172
+ const { data: n } = a(e);
173
+ return n != null && n.summary ? /* @__PURE__ */ t(u, { ...n.summary, ...n.percentage }) : /* @__PURE__ */ t("div", { children: "wait user..." });
174
+ }, W = ({ gamification: e }) => {
175
+ const [n, s] = w(c.HOME);
176
+ return /* @__PURE__ */ r("div", { style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
177
+ /* @__PURE__ */ r(h, { children: [
178
+ /* @__PURE__ */ t(I, { activePage: n, toggleActivePage: s }),
179
+ n === c.HOME && /* @__PURE__ */ t(K, { store: e.userSummary.getStore() })
180
+ ] }),
181
+ n === c.HOME && /* @__PURE__ */ t(p, { children: /* @__PURE__ */ t(J, { openQuestion: e.openQuestion, store: e.feedList.getStore() }) }),
182
+ n === c.LEADERBOARD && /* @__PURE__ */ t(p, { style: { flex: "1 1 auto", paddingTop: 0, paddingBottom: 0 }, children: /* @__PURE__ */ t(z, { openUser: e.openUser, leaderboardList: e.leaderboardList }) })
183
+ ] });
184
+ };
185
+ const X = () => j, m = /* @__PURE__ */ o(X())({
186
+ name: "m",
187
+ class: "m1ph66cs",
188
+ propsAsIs: !0
189
+ }), Z = /* @__PURE__ */ o("div")({
190
+ name: "x",
191
+ class: "xorme7i",
192
+ propsAsIs: !1
193
+ }), Ie = ({
194
+ gamification: e,
195
+ className: n
196
+ }) => {
197
+ const s = a(e.openedQuestion.$store), i = a(e.openedUser);
198
+ return /* @__PURE__ */ r(g, {
199
+ children: [s && /* @__PURE__ */ t(m, {
200
+ className: n,
201
+ children: /* @__PURE__ */ t(Y, {
202
+ gamification: e
203
+ })
204
+ }), i && /* @__PURE__ */ t(m, {
205
+ className: n,
206
+ children: /* @__PURE__ */ r(Z, {
207
+ children: [/* @__PURE__ */ t(v, {
208
+ label: "Friend's Rank",
209
+ close: e.closeUser
210
+ }), /* @__PURE__ */ t(h, {
211
+ children: /* @__PURE__ */ t(u, {
212
+ ...i
213
+ })
214
+ })]
215
+ })
216
+ }), /* @__PURE__ */ t(Q, {
217
+ className: n,
218
+ "data-nav": "true",
219
+ children: /* @__PURE__ */ t(W, {
220
+ gamification: e
221
+ })
222
+ })]
223
+ });
224
+ };
225
+ export {
226
+ Ie as GamificationOverlay,
227
+ Ie as default
228
+ };