fansunited-frontend-components 0.0.95 → 0.0.96
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/Betslip.d.ts +1 -2
- package/Betslip.d.ts.map +1 -1
- package/Betslip.js +4 -3
- package/ChanceGame.js +165 -163
- package/ChanceGameComponent.d.ts +1 -1
- package/ChanceGameComponent.d.ts.map +1 -1
- package/ClassicQuizPlay.d.ts +1 -1
- package/ClassicQuizPlay.d.ts.map +1 -1
- package/ClassicQuizPlay.js +4 -3
- package/CollectLead.d.ts +1 -1
- package/CollectLead.d.ts.map +1 -1
- package/CollectLead.js +37 -36
- package/CompetitionStatistics.d.ts +1 -2
- package/CompetitionStatistics.d.ts.map +1 -1
- package/CompetitionStatistics.js +458 -451
- package/CompetitorCard.d.ts +1 -2
- package/CompetitorCard.d.ts.map +1 -1
- package/CompetitorCard.js +1235 -1226
- package/Discussion.d.ts +1 -1
- package/Discussion.d.ts.map +1 -1
- package/Discussion.js +4 -3
- package/EitherOrPlay.d.ts +1 -1
- package/EitherOrPlay.d.ts.map +1 -1
- package/EitherOrPlay.js +4 -3
- package/EventCard.d.ts +1 -2
- package/EventCard.d.ts.map +1 -1
- package/EventCard.js +1249 -1244
- package/EventGamePlay.d.ts +1 -1
- package/EventGamePlay.d.ts.map +1 -1
- package/EventGamePlay.js +4 -3
- package/Leaderboard.d.ts +1 -1
- package/Leaderboard.d.ts.map +1 -1
- package/Leaderboard.js +482 -449
- package/List.d.ts +1 -2
- package/List.d.ts.map +1 -1
- package/List.js +258 -254
- package/MatchQuizPlay.d.ts +1 -1
- package/MatchQuizPlay.d.ts.map +1 -1
- package/MatchQuizPlay.js +4 -3
- package/Odds.d.ts +1 -2
- package/Odds.d.ts.map +1 -1
- package/Odds.js +35 -34
- package/PersonalityQuizPlay.d.ts +1 -1
- package/PersonalityQuizPlay.d.ts.map +1 -1
- package/PersonalityQuizPlay.js +4 -3
- package/PickThePair.js +102 -100
- package/PickThePairComponent.d.ts +1 -1
- package/PickThePairComponent.d.ts.map +1 -1
- package/PlayerOfTheMatch.d.ts +1 -2
- package/PlayerOfTheMatch.d.ts.map +1 -1
- package/PlayerOfTheMatch.js +1096 -1085
- package/PollVote.d.ts +1 -1
- package/PollVote.d.ts.map +1 -1
- package/PollVote.js +4 -3
- package/Predictor.d.ts +1 -2
- package/Predictor.d.ts.map +1 -1
- package/Predictor.js +4553 -4525
- package/README.md +1 -1
- package/Standings.d.ts +1 -2
- package/Standings.d.ts.map +1 -1
- package/Standings.js +404 -394
- package/TopX.d.ts +1 -2
- package/TopX.d.ts.map +1 -1
- package/TopX.js +5296 -5286
- package/chunks/{ChanceGameEmbedVariant-C3NGwvTF.js → ChanceGameEmbedVariant-CVys-3Zh.js} +1 -1
- package/chunks/{OddsSkeleton-Bav8FHHN.js → OddsSkeleton-ClJE2xhR.js} +5 -5
- package/chunks/{OddsStrip-CviVfQI4.js → OddsStrip-BnSp5TXa.js} +3 -3
- package/chunks/{PickOneOfX-a6Dv0-rR.js → PickOneOfX-DaJtkbCw.js} +6 -6
- package/chunks/index-Aq5MbUB9.js +4 -0
- package/chunks/index-BBQm_8LD.js +4 -0
- package/chunks/index-BC_sWWgc.js +4 -0
- package/chunks/index-DXKDJ1Vp.js +4 -0
- package/chunks/index-DjT5NrbA.js +4 -0
- package/chunks/index-DvLRehH6.js +4 -0
- package/chunks/index-aIMaxR-p.js +4 -0
- package/chunks/{main-Dj4Manb5.js → main-52Wff7qC.js} +1763 -1757
- package/chunks/{main-dwV_55lz.js → main-65WcUqAl.js} +615 -615
- package/chunks/{main-gexg6lc-.js → main-B58mi9jx.js} +349 -334
- package/chunks/{main-Dys2_Jt2.js → main-BIdXUTZS.js} +842 -827
- package/chunks/{main-CFwRpvUi.js → main-DD-NEzC7.js} +818 -817
- package/chunks/{main-DjiQz1dv.js → main-DUnfJPzY.js} +311 -311
- package/chunks/{main-eAQMCxQ7.js → main-DpCBqqg_.js} +322 -321
- package/chunks/{main-D9tFZv2q.js → main-Drznt1ak.js} +283 -282
- package/chunks/withVersionStamp-B6nArAj4.js +16 -0
- package/index.d.ts.map +1 -1
- package/index.js +45 -50
- package/package.json +57 -49
- package/withVersionStamp.d.ts +4 -0
- package/withVersionStamp.d.ts.map +1 -0
- package/chunks/3dicons-bookmark-fav-dynamic-color-BkMV51tL.js +0 -4
- package/chunks/3dicons-crow-dynamic-color-BnvCj9i8.js +0 -4
- package/chunks/3dicons-fire-dynamic-color-rNRL0kAe.js +0 -4
- package/chunks/3dicons-flag-dynamic-color-BscQxNXn.js +0 -4
- package/chunks/3dicons-medal-dynamic-color-CsR036OL.js +0 -4
- package/chunks/3dicons-rocket-dynamic-color-EiHCJ2rb.js +0 -4
- package/chunks/3dicons-target-dynamic-color-ChQzHpwv.js +0 -4
- package/chunks/3dicons-thumb-down-dynamic-color-NQLnsNFt.js +0 -4
- package/chunks/index-B1d9q8fX.js +0 -4
- package/chunks/index-BP0pvFJ4.js +0 -4
- package/chunks/index-CHZyL_g_.js +0 -4
- package/chunks/index-CeCUdRmF.js +0 -4
- package/chunks/index-Ckyyw-I8.js +0 -4
- package/chunks/index-DGvCP5G8.js +0 -4
- package/chunks/index-yjMVOgwO.js +0 -4
package/Leaderboard.js
CHANGED
|
@@ -1,46 +1,47 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import z, { useState as
|
|
3
|
-
import { useTheme as me, Box as I, FormLabel as fe, Typography as L, Select as ge, Option as be, Sheet as ye, Table as xe, Avatar as
|
|
4
|
-
import { useTranslation as
|
|
5
|
-
import { useConstantContext as Ce, ConstantsContext as ve, useColors as
|
|
6
|
-
import
|
|
7
|
-
import { C as
|
|
8
|
-
import { C as
|
|
9
|
-
import { C as
|
|
10
|
-
import { CacheProvider as
|
|
11
|
-
import { createPortal as
|
|
12
|
-
|
|
1
|
+
import { jsxs as S, jsx as n, Fragment as de } from "react/jsx-runtime";
|
|
2
|
+
import z, { useState as F, useEffect as Q, useCallback as he, useMemo as W } from "react";
|
|
3
|
+
import { useTheme as me, Box as I, FormLabel as fe, Typography as L, Select as ge, Option as be, Sheet as ye, Table as xe, Avatar as ee, IconButton as H, Button as te } from "@mui/joy";
|
|
4
|
+
import { useTranslation as G } from "react-i18next";
|
|
5
|
+
import { useConstantContext as Ce, ConstantsContext as ve, useColors as j, useCornerRadius as ue, useFontFamily as _, useSpacingScale as Z, useInternalTheme as pe, isExtraSmall as Te, hexToRgb as U, Spinner as Pe, stripHtmlTags as we, DirectionalIcon as k, useDisableCache as Se, AlertMessage as re, getLanguageDirection as Re, initializeI18n as Ee, applyDirectionToMount as Ae, widgetCacheKey as Le, createWidgetCache as Ie, ContainerProvider as Me, ThemeProvider as ze, ConstantsProvider as Be } from "fansunited-frontend-core";
|
|
6
|
+
import oe from "@mui/icons-material/Person";
|
|
7
|
+
import { C as Fe, a as Ue } from "./chunks/chevrons-right-CXSpQt9w.js";
|
|
8
|
+
import { C as $e } from "./chunks/chevron-left-CxfCSZcr.js";
|
|
9
|
+
import { C as Qe } from "./chunks/chevron-right-BEQMacFn.js";
|
|
10
|
+
import { CacheProvider as He } from "@emotion/react";
|
|
11
|
+
import { createPortal as ke } from "react-dom";
|
|
12
|
+
import { w as De } from "./chunks/withVersionStamp-B6nArAj4.js";
|
|
13
|
+
const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()).join(" "), We = ({
|
|
13
14
|
options: e,
|
|
14
15
|
selectedId: t,
|
|
15
16
|
onChange: o
|
|
16
17
|
}) => {
|
|
17
|
-
const { t:
|
|
18
|
+
const { t: c } = G(), { shadowRootElement: r } = Ce(ve), s = me(), b = j(), g = ue(), m = _().primary, u = Z(), C = b.textColor, f = {
|
|
18
19
|
background: {
|
|
19
|
-
surface:
|
|
20
|
-
popup:
|
|
20
|
+
surface: s.colorSchemes.light.palette.background.surface,
|
|
21
|
+
popup: s.colorSchemes.light.palette.background.popup
|
|
21
22
|
},
|
|
22
23
|
neutral: {
|
|
23
|
-
outlinedBorder:
|
|
24
|
-
outlinedColor:
|
|
25
|
-
outlinedHoverBg:
|
|
26
|
-
plainActiveBg:
|
|
27
|
-
plainHoverBg:
|
|
28
|
-
plainHoverColor:
|
|
24
|
+
outlinedBorder: s.colorSchemes.light.palette.neutral.outlinedBorder,
|
|
25
|
+
outlinedColor: s.colorSchemes.light.palette.neutral.outlinedColor,
|
|
26
|
+
outlinedHoverBg: s.colorSchemes.light.palette.neutral.outlinedHoverBg,
|
|
27
|
+
plainActiveBg: s.colorSchemes.light.palette.neutral.plainActiveBg,
|
|
28
|
+
plainHoverBg: s.colorSchemes.light.palette.neutral.plainHoverBg,
|
|
29
|
+
plainHoverColor: s.colorSchemes.light.palette.neutral.plainHoverColor
|
|
29
30
|
}
|
|
30
31
|
}, x = {
|
|
31
32
|
flexShrink: 0,
|
|
32
|
-
fontFamily:
|
|
33
|
+
fontFamily: m,
|
|
33
34
|
fontSize: "0.65em",
|
|
34
35
|
fontWeight: 600,
|
|
35
36
|
letterSpacing: "0.05em",
|
|
36
37
|
textTransform: "uppercase",
|
|
37
|
-
color:
|
|
38
|
-
bgcolor:
|
|
39
|
-
border: `1px solid ${
|
|
40
|
-
borderRadius:
|
|
41
|
-
px:
|
|
42
|
-
py:
|
|
43
|
-
},
|
|
38
|
+
color: f.neutral.outlinedColor,
|
|
39
|
+
bgcolor: f.neutral.plainHoverBg,
|
|
40
|
+
border: `1px solid ${f.neutral.outlinedBorder}`,
|
|
41
|
+
borderRadius: g.sm,
|
|
42
|
+
px: u["2xs"],
|
|
43
|
+
py: u["3xs"]
|
|
44
|
+
}, R = (d) => /* @__PURE__ */ S(
|
|
44
45
|
I,
|
|
45
46
|
{
|
|
46
47
|
sx: {
|
|
@@ -48,107 +49,107 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
48
49
|
alignItems: "center",
|
|
49
50
|
justifyContent: "space-between",
|
|
50
51
|
width: "100%",
|
|
51
|
-
gap:
|
|
52
|
+
gap: u.sm
|
|
52
53
|
},
|
|
53
54
|
children: [
|
|
54
|
-
/* @__PURE__ */
|
|
55
|
-
|
|
55
|
+
/* @__PURE__ */ n("span", { children: d.label }),
|
|
56
|
+
d.type && /* @__PURE__ */ n(I, { sx: x, children: Oe(d.type) })
|
|
56
57
|
]
|
|
57
58
|
}
|
|
58
|
-
),
|
|
59
|
+
), T = {
|
|
59
60
|
root: {
|
|
60
61
|
sx: {
|
|
61
|
-
fontFamily:
|
|
62
|
-
borderRadius:
|
|
63
|
-
bgcolor:
|
|
64
|
-
borderColor:
|
|
65
|
-
color:
|
|
62
|
+
fontFamily: m,
|
|
63
|
+
borderRadius: g.sm,
|
|
64
|
+
bgcolor: f.background.surface,
|
|
65
|
+
borderColor: f.neutral.outlinedBorder,
|
|
66
|
+
color: f.neutral.outlinedColor,
|
|
66
67
|
fontSize: "1em",
|
|
67
|
-
"&:hover": { bgcolor:
|
|
68
|
+
"&:hover": { bgcolor: f.neutral.outlinedHoverBg }
|
|
68
69
|
}
|
|
69
70
|
},
|
|
70
71
|
listbox: {
|
|
71
|
-
container:
|
|
72
|
+
container: r,
|
|
72
73
|
sx: {
|
|
73
74
|
zIndex: 10,
|
|
74
|
-
bgcolor:
|
|
75
|
-
border: `1px solid ${
|
|
76
|
-
borderRadius:
|
|
75
|
+
bgcolor: f.background.popup,
|
|
76
|
+
border: `1px solid ${f.neutral.outlinedBorder}`,
|
|
77
|
+
borderRadius: g.sm,
|
|
77
78
|
boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1)"
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
|
-
},
|
|
81
|
-
fontFamily:
|
|
82
|
-
color: `${
|
|
81
|
+
}, h = {
|
|
82
|
+
fontFamily: m,
|
|
83
|
+
color: `${f.neutral.outlinedColor} !important`,
|
|
83
84
|
bgcolor: "transparent",
|
|
84
85
|
"&:hover": {
|
|
85
|
-
bgcolor: `${
|
|
86
|
-
color: `${
|
|
86
|
+
bgcolor: `${f.neutral.plainHoverBg} !important`,
|
|
87
|
+
color: `${f.neutral.plainHoverColor} !important`
|
|
87
88
|
},
|
|
88
89
|
"&.Mui-selected": {
|
|
89
|
-
bgcolor: `${
|
|
90
|
-
color: `${
|
|
90
|
+
bgcolor: `${f.neutral.plainActiveBg} !important`,
|
|
91
|
+
color: `${f.neutral.outlinedColor} !important`
|
|
91
92
|
},
|
|
92
93
|
"&.Mui-selected:hover": {
|
|
93
|
-
bgcolor: `${
|
|
94
|
-
color: `${
|
|
94
|
+
bgcolor: `${f.neutral.plainActiveBg} !important`,
|
|
95
|
+
color: `${f.neutral.outlinedColor} !important`
|
|
95
96
|
}
|
|
96
97
|
};
|
|
97
|
-
return /* @__PURE__ */
|
|
98
|
-
/* @__PURE__ */
|
|
98
|
+
return /* @__PURE__ */ S(I, { sx: { display: "flex", flexDirection: "column", gap: u["2xs"] }, children: [
|
|
99
|
+
/* @__PURE__ */ n(
|
|
99
100
|
fe,
|
|
100
101
|
{
|
|
101
102
|
sx: {
|
|
102
103
|
color: `${C} !important`,
|
|
103
|
-
fontFamily:
|
|
104
|
+
fontFamily: m,
|
|
104
105
|
fontSize: "0.875em"
|
|
105
106
|
},
|
|
106
|
-
children: /* @__PURE__ */
|
|
107
|
+
children: /* @__PURE__ */ n(
|
|
107
108
|
L,
|
|
108
109
|
{
|
|
109
110
|
sx: {
|
|
110
|
-
fontFamily:
|
|
111
|
+
fontFamily: m,
|
|
111
112
|
fontSize: "0.875em",
|
|
112
113
|
color: C
|
|
113
114
|
},
|
|
114
|
-
children:
|
|
115
|
+
children: c("leaderboard.selectLabel")
|
|
115
116
|
}
|
|
116
117
|
)
|
|
117
118
|
}
|
|
118
119
|
),
|
|
119
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ n(
|
|
120
121
|
ge,
|
|
121
122
|
{
|
|
122
123
|
value: t,
|
|
123
|
-
onChange: (
|
|
124
|
-
slotProps:
|
|
125
|
-
renderValue: (
|
|
126
|
-
if (!
|
|
127
|
-
const w = e.find((
|
|
128
|
-
return w ?
|
|
124
|
+
onChange: (d, w) => w && o(w),
|
|
125
|
+
slotProps: T,
|
|
126
|
+
renderValue: (d) => {
|
|
127
|
+
if (!d) return null;
|
|
128
|
+
const w = e.find((A) => A.id === d.value);
|
|
129
|
+
return w ? R(w) : d.label;
|
|
129
130
|
},
|
|
130
|
-
children: e.map((
|
|
131
|
+
children: e.map((d) => /* @__PURE__ */ n(be, { value: d.id, sx: h, children: R(d) }, d.id))
|
|
131
132
|
}
|
|
132
133
|
)
|
|
133
134
|
] });
|
|
134
|
-
},
|
|
135
|
+
}, _e = ({
|
|
135
136
|
leaderboard: e,
|
|
136
137
|
userRank: t,
|
|
137
138
|
showHeading: o,
|
|
138
|
-
title:
|
|
139
|
-
description:
|
|
140
|
-
isSplitVariant:
|
|
141
|
-
brandingColors:
|
|
142
|
-
rankStyles:
|
|
139
|
+
title: c,
|
|
140
|
+
description: r,
|
|
141
|
+
isSplitVariant: s,
|
|
142
|
+
brandingColors: b,
|
|
143
|
+
rankStyles: g
|
|
143
144
|
}) => {
|
|
144
|
-
const { t:
|
|
145
|
+
const { t: m } = G(), u = pe(), C = j(), f = (b == null ? void 0 : b.primaryColor) || C.palette.primary.plainColor, x = (b == null ? void 0 : b.contentColor) || C.textColor, R = C.textColor, T = _().primary, h = _().secondary, d = ue(), w = Z(), A = Te(), l = C.surfaceVariant, p = u.colorSchemes.light.palette.primary.onPrimary, i = C.outlineEnabledBorder, a = {
|
|
145
146
|
leaderboardContainer: {
|
|
146
147
|
display: "flex",
|
|
147
148
|
flexDirection: "column",
|
|
148
149
|
gap: w.md
|
|
149
150
|
},
|
|
150
151
|
leaderboardTitle: {
|
|
151
|
-
fontFamily:
|
|
152
|
+
fontFamily: T,
|
|
152
153
|
fontWeight: 700,
|
|
153
154
|
lineHeight: "133%",
|
|
154
155
|
letterSpacing: "0px",
|
|
@@ -158,11 +159,11 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
158
159
|
},
|
|
159
160
|
tableContainer: {
|
|
160
161
|
overflowX: "auto",
|
|
161
|
-
borderRadius:
|
|
162
|
-
border: `1px solid ${
|
|
162
|
+
borderRadius: d.md,
|
|
163
|
+
border: `1px solid ${i}`
|
|
163
164
|
},
|
|
164
165
|
table: {
|
|
165
|
-
backgroundColor:
|
|
166
|
+
backgroundColor: l,
|
|
166
167
|
"--TableCell-paddingX": "0.5rem",
|
|
167
168
|
"--TableCell-paddingY": "0.375rem",
|
|
168
169
|
cursor: "default",
|
|
@@ -170,19 +171,19 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
170
171
|
backgroundColor: "transparent"
|
|
171
172
|
},
|
|
172
173
|
"& > thead > tr > th": {
|
|
173
|
-
backgroundColor: `rgba(${U(
|
|
174
|
+
backgroundColor: `rgba(${U(l)}, 0.8)`,
|
|
174
175
|
color: x,
|
|
175
|
-
fontFamily:
|
|
176
|
+
fontFamily: T,
|
|
176
177
|
fontWeight: 600,
|
|
177
178
|
fontSize: "0.875em",
|
|
178
179
|
textAlign: "center",
|
|
179
|
-
borderBottom: `1px solid ${
|
|
180
|
+
borderBottom: `1px solid ${i}`
|
|
180
181
|
}
|
|
181
182
|
},
|
|
182
183
|
headerCellPosition: {
|
|
183
|
-
backgroundColor: `rgba(${U(
|
|
184
|
+
backgroundColor: `rgba(${U(l)}, 0.8)`,
|
|
184
185
|
color: x,
|
|
185
|
-
fontFamily:
|
|
186
|
+
fontFamily: T,
|
|
186
187
|
fontWeight: 600,
|
|
187
188
|
fontSize: "0.875em",
|
|
188
189
|
textAlign: "center",
|
|
@@ -190,9 +191,9 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
190
191
|
width: "10%"
|
|
191
192
|
},
|
|
192
193
|
headerCellName: {
|
|
193
|
-
backgroundColor: `rgba(${U(
|
|
194
|
+
backgroundColor: `rgba(${U(l)}, 0.8)`,
|
|
194
195
|
color: x,
|
|
195
|
-
fontFamily:
|
|
196
|
+
fontFamily: T,
|
|
196
197
|
fontWeight: 600,
|
|
197
198
|
fontSize: "0.875em",
|
|
198
199
|
textAlign: "left",
|
|
@@ -200,9 +201,9 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
200
201
|
width: "80%"
|
|
201
202
|
},
|
|
202
203
|
headerCellPoints: {
|
|
203
|
-
backgroundColor: `rgba(${U(
|
|
204
|
+
backgroundColor: `rgba(${U(l)}, 0.8)`,
|
|
204
205
|
color: x,
|
|
205
|
-
fontFamily:
|
|
206
|
+
fontFamily: T,
|
|
206
207
|
fontWeight: 600,
|
|
207
208
|
fontSize: "0.875em",
|
|
208
209
|
textAlign: "center",
|
|
@@ -224,7 +225,7 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
224
225
|
textAlign: "center"
|
|
225
226
|
},
|
|
226
227
|
userRow: {
|
|
227
|
-
backgroundColor: `rgba(${U(
|
|
228
|
+
backgroundColor: `rgba(${U(f)}, 0.1)`
|
|
228
229
|
},
|
|
229
230
|
nameCell: {
|
|
230
231
|
display: "flex",
|
|
@@ -236,11 +237,11 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
236
237
|
height: "32px",
|
|
237
238
|
fontSize: "0.875em",
|
|
238
239
|
fontWeight: 600,
|
|
239
|
-
backgroundColor:
|
|
240
|
-
color:
|
|
240
|
+
backgroundColor: f,
|
|
241
|
+
color: p
|
|
241
242
|
},
|
|
242
243
|
nameText: {
|
|
243
|
-
fontFamily:
|
|
244
|
+
fontFamily: T,
|
|
244
245
|
fontWeight: 500,
|
|
245
246
|
fontSize: "0.875em",
|
|
246
247
|
color: x,
|
|
@@ -249,23 +250,23 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
249
250
|
whiteSpace: "nowrap"
|
|
250
251
|
},
|
|
251
252
|
positionText: {
|
|
252
|
-
fontFamily:
|
|
253
|
+
fontFamily: T,
|
|
253
254
|
fontWeight: 600,
|
|
254
255
|
fontSize: "0.875em",
|
|
255
256
|
color: x
|
|
256
257
|
},
|
|
257
258
|
pointsText: {
|
|
258
|
-
fontFamily:
|
|
259
|
+
fontFamily: T,
|
|
259
260
|
fontWeight: 600,
|
|
260
261
|
fontSize: "0.875em",
|
|
261
262
|
color: x
|
|
262
263
|
},
|
|
263
264
|
avatarIcon: {
|
|
264
265
|
fontSize: "1em",
|
|
265
|
-
color:
|
|
266
|
+
color: p
|
|
266
267
|
},
|
|
267
268
|
noLeaderboardText: {
|
|
268
|
-
fontFamily:
|
|
269
|
+
fontFamily: h,
|
|
269
270
|
fontSize: "1.25em",
|
|
270
271
|
color: x,
|
|
271
272
|
textAlign: "center",
|
|
@@ -273,12 +274,12 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
273
274
|
}
|
|
274
275
|
};
|
|
275
276
|
if (!e)
|
|
276
|
-
return /* @__PURE__ */
|
|
277
|
+
return /* @__PURE__ */ n(Pe, { my: 10 });
|
|
277
278
|
if (e.length === 0)
|
|
278
|
-
return /* @__PURE__ */
|
|
279
|
-
const
|
|
280
|
-
return /* @__PURE__ */
|
|
281
|
-
o && /* @__PURE__ */
|
|
279
|
+
return /* @__PURE__ */ n(L, { level: "body-lg", sx: a.noLeaderboardText, children: m("leaderboard.noLeaderboardAvailable") });
|
|
280
|
+
const v = t, P = v == null ? void 0 : v.profileId, B = P && e.some((E) => E.profileId === P);
|
|
281
|
+
return /* @__PURE__ */ S(I, { sx: a.leaderboardContainer, children: [
|
|
282
|
+
o && /* @__PURE__ */ S(
|
|
282
283
|
I,
|
|
283
284
|
{
|
|
284
285
|
sx: {
|
|
@@ -288,7 +289,7 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
288
289
|
textAlign: "center"
|
|
289
290
|
},
|
|
290
291
|
children: [
|
|
291
|
-
/* @__PURE__ */
|
|
292
|
+
/* @__PURE__ */ n(
|
|
292
293
|
L,
|
|
293
294
|
{
|
|
294
295
|
level: "body-sm",
|
|
@@ -298,14 +299,14 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
298
299
|
letterSpacing: "1px",
|
|
299
300
|
textTransform: "uppercase",
|
|
300
301
|
fontSize: "0.75em",
|
|
301
|
-
color:
|
|
302
|
+
color: R,
|
|
302
303
|
opacity: "60%",
|
|
303
|
-
fontFamily:
|
|
304
|
+
fontFamily: h
|
|
304
305
|
},
|
|
305
|
-
children:
|
|
306
|
+
children: m("leaderboard.heading")
|
|
306
307
|
}
|
|
307
308
|
),
|
|
308
|
-
/* @__PURE__ */
|
|
309
|
+
/* @__PURE__ */ S(
|
|
309
310
|
I,
|
|
310
311
|
{
|
|
311
312
|
sx: {
|
|
@@ -314,8 +315,8 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
314
315
|
gap: w["3xs"]
|
|
315
316
|
},
|
|
316
317
|
children: [
|
|
317
|
-
|
|
318
|
-
|
|
318
|
+
c && /* @__PURE__ */ n(L, { level: "h4", sx: a.leaderboardTitle, children: c }),
|
|
319
|
+
r && /* @__PURE__ */ n(
|
|
319
320
|
L,
|
|
320
321
|
{
|
|
321
322
|
sx: {
|
|
@@ -323,11 +324,11 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
323
324
|
lineHeight: "140%",
|
|
324
325
|
letterSpacing: "0.15px",
|
|
325
326
|
fontSize: "1.25em",
|
|
326
|
-
color:
|
|
327
|
+
color: R,
|
|
327
328
|
opacity: "60%",
|
|
328
|
-
fontFamily:
|
|
329
|
+
fontFamily: T
|
|
329
330
|
},
|
|
330
|
-
children: we(
|
|
331
|
+
children: we(r)
|
|
331
332
|
}
|
|
332
333
|
)
|
|
333
334
|
]
|
|
@@ -336,150 +337,150 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
336
337
|
]
|
|
337
338
|
}
|
|
338
339
|
),
|
|
339
|
-
/* @__PURE__ */
|
|
340
|
+
/* @__PURE__ */ n(ye, { sx: a.tableContainer, children: /* @__PURE__ */ S(
|
|
340
341
|
xe,
|
|
341
342
|
{
|
|
342
343
|
variant: "outlined",
|
|
343
344
|
hoverRow: !1,
|
|
344
345
|
borderAxis: "bothBetween",
|
|
345
346
|
size: "sm",
|
|
346
|
-
sx:
|
|
347
|
+
sx: a.table,
|
|
347
348
|
children: [
|
|
348
|
-
/* @__PURE__ */
|
|
349
|
-
/* @__PURE__ */
|
|
350
|
-
/* @__PURE__ */
|
|
351
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ n("thead", { children: /* @__PURE__ */ S("tr", { children: [
|
|
350
|
+
/* @__PURE__ */ n("th", { style: a.headerCellPosition, children: A || s ? "" : m("leaderboard.position") }),
|
|
351
|
+
/* @__PURE__ */ n("th", { style: a.headerCellName, children: m("leaderboard.name") }),
|
|
352
|
+
/* @__PURE__ */ n("th", { style: a.headerCellPoints, children: A || s ? "🎯" : m("leaderboard.points") })
|
|
352
353
|
] }) }),
|
|
353
|
-
/* @__PURE__ */
|
|
354
|
-
|
|
355
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ S("tbody", { children: [
|
|
355
|
+
v && !B && /* @__PURE__ */ S("tr", { style: a.userRow, children: [
|
|
356
|
+
/* @__PURE__ */ n("td", { style: a.tableCellPosition, children: /* @__PURE__ */ S(L, { sx: a.positionText, children: [
|
|
356
357
|
"#",
|
|
357
|
-
|
|
358
|
+
v.position
|
|
358
359
|
] }) }),
|
|
359
|
-
/* @__PURE__ */
|
|
360
|
-
/* @__PURE__ */
|
|
361
|
-
/* @__PURE__ */
|
|
360
|
+
/* @__PURE__ */ n("td", { style: a.tableCellName, children: /* @__PURE__ */ S(I, { sx: a.nameCell, children: [
|
|
361
|
+
/* @__PURE__ */ n(ee, { sx: a.leaderboardAvatar, children: /* @__PURE__ */ n(oe, { sx: a.avatarIcon }) }),
|
|
362
|
+
/* @__PURE__ */ n(L, { sx: a.nameText, children: m("leaderboard.you") })
|
|
362
363
|
] }) }),
|
|
363
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ n("td", { style: a.tableCellPoints, children: /* @__PURE__ */ n(L, { sx: a.pointsText, children: v.points }) })
|
|
364
365
|
] }),
|
|
365
|
-
e.map((
|
|
366
|
-
var
|
|
367
|
-
const M =
|
|
368
|
-
return /* @__PURE__ */
|
|
369
|
-
/* @__PURE__ */
|
|
366
|
+
e.map((E, y) => {
|
|
367
|
+
var Y, K, q, J;
|
|
368
|
+
const M = P === E.profileId, O = M ? a.userRow : g == null ? void 0 : g[y + 1];
|
|
369
|
+
return /* @__PURE__ */ S("tr", { style: O, children: [
|
|
370
|
+
/* @__PURE__ */ n("td", { style: a.tableCellPosition, children: /* @__PURE__ */ S(L, { sx: a.positionText, children: [
|
|
370
371
|
"#",
|
|
371
|
-
|
|
372
|
+
E.position
|
|
372
373
|
] }) }),
|
|
373
|
-
/* @__PURE__ */
|
|
374
|
-
/* @__PURE__ */
|
|
375
|
-
|
|
374
|
+
/* @__PURE__ */ n("td", { style: a.tableCellName, children: /* @__PURE__ */ S(I, { sx: a.nameCell, children: [
|
|
375
|
+
/* @__PURE__ */ n(
|
|
376
|
+
ee,
|
|
376
377
|
{
|
|
377
|
-
src: ((
|
|
378
|
-
sx:
|
|
379
|
-
children: (
|
|
378
|
+
src: ((Y = E.profileModel) == null ? void 0 : Y.avatar) || void 0,
|
|
379
|
+
sx: a.leaderboardAvatar,
|
|
380
|
+
children: (K = E.profileModel) != null && K.avatar ? /* @__PURE__ */ n(de, {}) : /* @__PURE__ */ n(oe, { sx: a.avatarIcon })
|
|
380
381
|
}
|
|
381
382
|
),
|
|
382
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ n(L, { sx: a.nameText, children: M ? m("leaderboard.you") : ((q = E.profileModel) == null ? void 0 : q.nickname) || ((J = E.profileModel) == null ? void 0 : J.name) || m("leaderboard.anonymous") })
|
|
383
384
|
] }) }),
|
|
384
|
-
/* @__PURE__ */
|
|
385
|
-
] },
|
|
385
|
+
/* @__PURE__ */ n("td", { style: a.tableCellPoints, children: /* @__PURE__ */ n(L, { sx: a.pointsText, children: E.points }) })
|
|
386
|
+
] }, E.profileId);
|
|
386
387
|
})
|
|
387
388
|
] })
|
|
388
389
|
]
|
|
389
390
|
}
|
|
390
391
|
) })
|
|
391
392
|
] });
|
|
392
|
-
},
|
|
393
|
+
}, Xe = ({
|
|
393
394
|
count: e = 10,
|
|
394
395
|
page: t = 1,
|
|
395
396
|
onChange: o,
|
|
396
|
-
siblingCount:
|
|
397
|
-
boundaryCount:
|
|
398
|
-
showFirstButton:
|
|
399
|
-
showLastButton:
|
|
400
|
-
size:
|
|
401
|
-
disabled:
|
|
402
|
-
isOverlayVariant:
|
|
397
|
+
siblingCount: c = 1,
|
|
398
|
+
boundaryCount: r = 1,
|
|
399
|
+
showFirstButton: s = !0,
|
|
400
|
+
showLastButton: b = !0,
|
|
401
|
+
size: g = "md",
|
|
402
|
+
disabled: m = !1,
|
|
403
|
+
isOverlayVariant: u = !1
|
|
403
404
|
}) => {
|
|
404
|
-
const C =
|
|
405
|
-
o &&
|
|
406
|
-
}, x = (
|
|
407
|
-
const
|
|
408
|
-
for (let
|
|
409
|
-
return
|
|
410
|
-
},
|
|
405
|
+
const C = pe(), f = (l) => {
|
|
406
|
+
o && l >= 1 && l <= e && o(l);
|
|
407
|
+
}, x = (l, p) => {
|
|
408
|
+
const i = [];
|
|
409
|
+
for (let a = l; a <= p; a++) i.push(a);
|
|
410
|
+
return i;
|
|
411
|
+
}, T = (() => {
|
|
411
412
|
if (e <= 0) return [];
|
|
412
|
-
const
|
|
413
|
-
Math.max(e -
|
|
413
|
+
const l = x(1, Math.min(r, e)), p = x(
|
|
414
|
+
Math.max(e - r + 1, r + 1),
|
|
414
415
|
e
|
|
415
|
-
),
|
|
416
|
-
if (
|
|
417
|
-
for (let
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
for (const
|
|
421
|
-
|
|
422
|
-
return
|
|
423
|
-
})(),
|
|
424
|
-
if (!
|
|
416
|
+
), i = Math.max(r + 1, t - c), a = Math.min(e - r, t + c), v = [...l];
|
|
417
|
+
if (i > r + 1 && v.push("ellipsis-start"), i <= a)
|
|
418
|
+
for (let P = i; P <= a; P++)
|
|
419
|
+
v.push(P);
|
|
420
|
+
a < e - r && v.push("ellipsis-end");
|
|
421
|
+
for (const P of p)
|
|
422
|
+
v.includes(P) || v.push(P);
|
|
423
|
+
return v;
|
|
424
|
+
})(), h = g === "sm" ? "sm" : g === "lg" ? "lg" : "md", d = g === "sm" ? 16 : g === "lg" ? 24 : 20, w = (l = !1) => {
|
|
425
|
+
if (!u)
|
|
425
426
|
return {
|
|
426
427
|
borderRadius: "8px",
|
|
427
428
|
minWidth: "32px",
|
|
428
429
|
minHeight: "32px",
|
|
429
|
-
fontWeight:
|
|
430
|
+
fontWeight: l ? 600 : 400
|
|
430
431
|
};
|
|
431
|
-
const
|
|
432
|
+
const p = C.colorSchemes.dark;
|
|
432
433
|
return {
|
|
433
434
|
borderRadius: "8px",
|
|
434
435
|
minWidth: "32px",
|
|
435
436
|
minHeight: "32px",
|
|
436
|
-
fontWeight:
|
|
437
|
-
backgroundColor:
|
|
438
|
-
color:
|
|
437
|
+
fontWeight: l ? 600 : 400,
|
|
438
|
+
backgroundColor: l ? p.palette.neutral.solidBg : "transparent",
|
|
439
|
+
color: l ? p.palette.neutral.solidColor : p.textColor,
|
|
439
440
|
border: "none",
|
|
440
441
|
"&:hover": {
|
|
441
|
-
backgroundColor:
|
|
442
|
-
color:
|
|
442
|
+
backgroundColor: p.palette.neutral.solidBg,
|
|
443
|
+
color: l ? p.palette.neutral.solidColor : p.textColor
|
|
443
444
|
},
|
|
444
445
|
"&:active": {
|
|
445
|
-
backgroundColor:
|
|
446
|
+
backgroundColor: p.palette.neutral.plainActiveBg
|
|
446
447
|
},
|
|
447
448
|
"&.Mui-disabled": {
|
|
448
449
|
backgroundColor: "transparent",
|
|
449
|
-
color:
|
|
450
|
+
color: p.textDisabled,
|
|
450
451
|
opacity: 0.5
|
|
451
452
|
}
|
|
452
453
|
};
|
|
453
|
-
},
|
|
454
|
-
if (!
|
|
454
|
+
}, A = () => {
|
|
455
|
+
if (!u)
|
|
455
456
|
return {
|
|
456
457
|
borderRadius: "8px",
|
|
457
458
|
minWidth: "32px",
|
|
458
459
|
minHeight: "32px"
|
|
459
460
|
};
|
|
460
|
-
const
|
|
461
|
+
const l = C.colorSchemes.dark;
|
|
461
462
|
return {
|
|
462
463
|
borderRadius: "8px",
|
|
463
464
|
minWidth: "32px",
|
|
464
465
|
minHeight: "32px",
|
|
465
466
|
backgroundColor: "transparent",
|
|
466
|
-
color:
|
|
467
|
+
color: l.textColor,
|
|
467
468
|
border: "none",
|
|
468
469
|
"&:hover": {
|
|
469
|
-
backgroundColor:
|
|
470
|
-
color:
|
|
470
|
+
backgroundColor: l.palette.neutral.solidBg,
|
|
471
|
+
color: l.textColor
|
|
471
472
|
},
|
|
472
473
|
"&:active": {
|
|
473
|
-
backgroundColor:
|
|
474
|
+
backgroundColor: l.palette.neutral.plainActiveBg
|
|
474
475
|
},
|
|
475
476
|
"&.Mui-disabled": {
|
|
476
477
|
backgroundColor: "transparent",
|
|
477
|
-
color:
|
|
478
|
+
color: l.textDisabled,
|
|
478
479
|
opacity: 0.5
|
|
479
480
|
}
|
|
480
481
|
};
|
|
481
482
|
};
|
|
482
|
-
return /* @__PURE__ */
|
|
483
|
+
return /* @__PURE__ */ S(
|
|
483
484
|
I,
|
|
484
485
|
{
|
|
485
486
|
sx: {
|
|
@@ -489,43 +490,43 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
489
490
|
flexWrap: "wrap"
|
|
490
491
|
},
|
|
491
492
|
children: [
|
|
492
|
-
|
|
493
|
+
s && /* @__PURE__ */ n(
|
|
493
494
|
H,
|
|
494
495
|
{
|
|
495
|
-
size:
|
|
496
|
+
size: h,
|
|
496
497
|
variant: "plain",
|
|
497
498
|
color: "neutral",
|
|
498
|
-
onClick: () =>
|
|
499
|
-
disabled:
|
|
500
|
-
sx:
|
|
501
|
-
children: /* @__PURE__ */
|
|
499
|
+
onClick: () => f(1),
|
|
500
|
+
disabled: m || t === 1,
|
|
501
|
+
sx: A(),
|
|
502
|
+
children: /* @__PURE__ */ n(k, { children: /* @__PURE__ */ n(Fe, { size: d }) })
|
|
502
503
|
}
|
|
503
504
|
),
|
|
504
|
-
/* @__PURE__ */
|
|
505
|
+
/* @__PURE__ */ n(
|
|
505
506
|
H,
|
|
506
507
|
{
|
|
507
|
-
size:
|
|
508
|
+
size: h,
|
|
508
509
|
variant: "plain",
|
|
509
510
|
color: "neutral",
|
|
510
|
-
onClick: () =>
|
|
511
|
-
disabled:
|
|
512
|
-
sx:
|
|
513
|
-
children: /* @__PURE__ */
|
|
511
|
+
onClick: () => f(t - 1),
|
|
512
|
+
disabled: m || t === 1,
|
|
513
|
+
sx: A(),
|
|
514
|
+
children: /* @__PURE__ */ n(k, { children: /* @__PURE__ */ n($e, { size: d }) })
|
|
514
515
|
}
|
|
515
516
|
),
|
|
516
|
-
|
|
517
|
-
if (typeof
|
|
518
|
-
return /* @__PURE__ */
|
|
519
|
-
|
|
517
|
+
T.map((l, p) => {
|
|
518
|
+
if (typeof l == "string" && l.startsWith("ellipsis"))
|
|
519
|
+
return /* @__PURE__ */ n(
|
|
520
|
+
te,
|
|
520
521
|
{
|
|
521
|
-
size:
|
|
522
|
+
size: h,
|
|
522
523
|
variant: "plain",
|
|
523
524
|
color: "neutral",
|
|
524
525
|
disabled: !0,
|
|
525
526
|
sx: {
|
|
526
527
|
...w(!1),
|
|
527
528
|
cursor: "default",
|
|
528
|
-
"&.Mui-disabled":
|
|
529
|
+
"&.Mui-disabled": u ? {
|
|
529
530
|
backgroundColor: "transparent",
|
|
530
531
|
color: C.colorSchemes.dark.textDisabled,
|
|
531
532
|
opacity: 0.5
|
|
@@ -536,51 +537,51 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
536
537
|
},
|
|
537
538
|
children: "..."
|
|
538
539
|
},
|
|
539
|
-
`${
|
|
540
|
+
`${l}-${p}`
|
|
540
541
|
);
|
|
541
|
-
const
|
|
542
|
-
return /* @__PURE__ */
|
|
543
|
-
|
|
542
|
+
const i = l === t;
|
|
543
|
+
return /* @__PURE__ */ n(
|
|
544
|
+
te,
|
|
544
545
|
{
|
|
545
|
-
size:
|
|
546
|
-
variant:
|
|
546
|
+
size: h,
|
|
547
|
+
variant: i ? "solid" : "plain",
|
|
547
548
|
color: "neutral",
|
|
548
|
-
onClick: () =>
|
|
549
|
-
disabled:
|
|
550
|
-
sx: w(
|
|
551
|
-
children:
|
|
549
|
+
onClick: () => f(l),
|
|
550
|
+
disabled: m,
|
|
551
|
+
sx: w(i),
|
|
552
|
+
children: l
|
|
552
553
|
},
|
|
553
|
-
|
|
554
|
+
l
|
|
554
555
|
);
|
|
555
556
|
}),
|
|
556
|
-
/* @__PURE__ */
|
|
557
|
+
/* @__PURE__ */ n(
|
|
557
558
|
H,
|
|
558
559
|
{
|
|
559
|
-
size:
|
|
560
|
+
size: h,
|
|
560
561
|
variant: "plain",
|
|
561
562
|
color: "neutral",
|
|
562
|
-
onClick: () =>
|
|
563
|
-
disabled:
|
|
564
|
-
sx:
|
|
565
|
-
children: /* @__PURE__ */
|
|
563
|
+
onClick: () => f(t + 1),
|
|
564
|
+
disabled: m || t === e,
|
|
565
|
+
sx: A(),
|
|
566
|
+
children: /* @__PURE__ */ n(k, { children: /* @__PURE__ */ n(Qe, { size: d }) })
|
|
566
567
|
}
|
|
567
568
|
),
|
|
568
|
-
|
|
569
|
+
b && /* @__PURE__ */ n(
|
|
569
570
|
H,
|
|
570
571
|
{
|
|
571
|
-
size:
|
|
572
|
+
size: h,
|
|
572
573
|
variant: "plain",
|
|
573
574
|
color: "neutral",
|
|
574
|
-
onClick: () =>
|
|
575
|
-
disabled:
|
|
576
|
-
sx:
|
|
577
|
-
children: /* @__PURE__ */
|
|
575
|
+
onClick: () => f(e),
|
|
576
|
+
disabled: m || t === e,
|
|
577
|
+
sx: A(),
|
|
578
|
+
children: /* @__PURE__ */ n(k, { children: /* @__PURE__ */ n(Ue, { size: d }) })
|
|
578
579
|
}
|
|
579
580
|
)
|
|
580
581
|
]
|
|
581
582
|
}
|
|
582
583
|
);
|
|
583
|
-
}, $ = "ALL",
|
|
584
|
+
}, $ = "ALL", V = (e) => ({
|
|
584
585
|
currentPage: e.currentPage,
|
|
585
586
|
totalPages: e.numberOfPages,
|
|
586
587
|
totalItems: e.totalItems,
|
|
@@ -590,388 +591,420 @@ const ke = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
|
|
|
590
591
|
profileId: t.profileId,
|
|
591
592
|
profileModel: t.profileModel,
|
|
592
593
|
points: t.points
|
|
593
|
-
})),
|
|
594
|
+
})), Ge = async (e) => {
|
|
594
595
|
try {
|
|
595
596
|
return await e.profile.getOwn().getInfo();
|
|
596
597
|
} catch {
|
|
597
598
|
return null;
|
|
598
599
|
}
|
|
599
|
-
},
|
|
600
|
-
var
|
|
600
|
+
}, ne = async (e, t, o) => e.length === 0 ? [] : (await t.topX.getGames({ gameIds: e }, o)).data.map((r) => {
|
|
601
|
+
var s;
|
|
601
602
|
return {
|
|
602
603
|
id: r.id,
|
|
603
604
|
title: r.title,
|
|
604
605
|
description: r.description || null,
|
|
605
|
-
branding: ((
|
|
606
|
+
branding: ((s = r.branding) == null ? void 0 : s.colors) || null
|
|
606
607
|
};
|
|
607
|
-
}),
|
|
608
|
-
var
|
|
608
|
+
}), le = async (e, t, o) => e.length === 0 ? [] : (await t.matchQuiz.getGames({ gameIds: e }, o)).data.map((r) => {
|
|
609
|
+
var s;
|
|
609
610
|
return {
|
|
610
611
|
id: r.id,
|
|
611
612
|
title: r.title,
|
|
612
613
|
description: r.description || null,
|
|
613
|
-
branding: ((
|
|
614
|
+
branding: ((s = r.branding) == null ? void 0 : s.colors) || null
|
|
614
615
|
};
|
|
615
|
-
}),
|
|
616
|
-
var
|
|
616
|
+
}), ae = async (e, t, o) => e.length === 0 ? [] : (await t.loyalty.getTemplates(void 0, o)).data.filter((r) => e.includes(r.id)).map((r) => {
|
|
617
|
+
var s;
|
|
617
618
|
return {
|
|
618
619
|
id: r.id,
|
|
619
620
|
title: r.title || r.name,
|
|
620
621
|
description: r.description || null,
|
|
621
|
-
branding: ((
|
|
622
|
+
branding: ((s = r.branding) == null ? void 0 : s.colors) || null
|
|
622
623
|
};
|
|
623
|
-
}),
|
|
624
|
-
classicQuizIds: e,
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
624
|
+
}), ie = async (e, t, o) => e.length === 0 ? [] : (await t.miniGames.getClassicQuizzes(
|
|
625
|
+
{ classicQuizIds: e, limit: e.length },
|
|
626
|
+
void 0,
|
|
627
|
+
o
|
|
628
|
+
)).data.map((r) => {
|
|
629
|
+
var s;
|
|
628
630
|
return {
|
|
629
631
|
id: r.id,
|
|
630
632
|
title: r.title || r.name,
|
|
631
633
|
description: r.description || null,
|
|
632
|
-
branding: ((
|
|
634
|
+
branding: ((s = r.branding) == null ? void 0 : s.colors) || null
|
|
633
635
|
};
|
|
634
|
-
}),
|
|
635
|
-
const
|
|
636
|
+
}), je = async (e, t, o, c, r) => {
|
|
637
|
+
const s = await t.loyalty.getLeaderboardForGame(e, { page: o, limit: c }, r);
|
|
636
638
|
return {
|
|
637
|
-
leaderboard: N(
|
|
638
|
-
pagination:
|
|
639
|
+
leaderboard: N(s.data),
|
|
640
|
+
pagination: V(s.meta.pagination)
|
|
639
641
|
};
|
|
640
|
-
},
|
|
641
|
-
const
|
|
642
|
+
}, Ze = async (e, t, o, c, r) => {
|
|
643
|
+
const s = await t.loyalty.getLeaderboard(
|
|
642
644
|
e,
|
|
643
|
-
{ page: o, limit:
|
|
645
|
+
{ page: o, limit: c },
|
|
646
|
+
r
|
|
644
647
|
);
|
|
645
648
|
return {
|
|
646
|
-
leaderboard: N(
|
|
647
|
-
pagination:
|
|
649
|
+
leaderboard: N(s.data),
|
|
650
|
+
pagination: V(s.meta.pagination)
|
|
648
651
|
};
|
|
649
|
-
},
|
|
650
|
-
const
|
|
651
|
-
classicQuizIds: e,
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
});
|
|
652
|
+
}, X = async (e, t, o, c, r) => {
|
|
653
|
+
const s = await t.miniGames.getLeaderboardForClassicQuizzes(
|
|
654
|
+
{ classicQuizIds: e, page: o, limit: c },
|
|
655
|
+
r
|
|
656
|
+
);
|
|
655
657
|
return {
|
|
656
|
-
leaderboard: N(
|
|
657
|
-
pagination:
|
|
658
|
+
leaderboard: N(s.data),
|
|
659
|
+
pagination: V(s.meta.pagination)
|
|
658
660
|
};
|
|
659
|
-
},
|
|
660
|
-
const
|
|
661
|
-
return
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
661
|
+
}, se = (e, t, o, c, r) => {
|
|
662
|
+
const s = e.type.toUpperCase();
|
|
663
|
+
return s === "TOP_X" || s === "MATCH_QUIZ" ? je(e.id, t, o, c, r) : s === "TEMPLATE" ? Ze(e.id, t, o, c, r) : X(
|
|
664
|
+
[e.id],
|
|
665
|
+
t,
|
|
666
|
+
o,
|
|
667
|
+
c,
|
|
668
|
+
r
|
|
669
|
+
);
|
|
670
|
+
}, Ve = async (e, t, o, c, r) => {
|
|
671
|
+
const b = o.toUpperCase() === "TEMPLATE" ? { rankType: "TEMPLATE", leaderboardIds: [e] } : { rankType: "GAME", gameType: o.toUpperCase(), leaderboardIds: [e] }, u = (await t.loyalty.getOwnRankings(b, r)).data[0] ?? null;
|
|
672
|
+
return u ? {
|
|
673
|
+
position: u.position,
|
|
674
|
+
profileId: c,
|
|
667
675
|
profileModel: null,
|
|
668
|
-
points:
|
|
676
|
+
points: u.points
|
|
669
677
|
} : null;
|
|
670
|
-
},
|
|
671
|
-
const
|
|
678
|
+
}, Ne = async (e, t, o, c) => {
|
|
679
|
+
const b = (await t.miniGames.getClassicQuizzesUserRanking(
|
|
672
680
|
o,
|
|
673
681
|
void 0,
|
|
674
|
-
|
|
675
|
-
)).data.find((
|
|
676
|
-
return
|
|
677
|
-
position:
|
|
682
|
+
c
|
|
683
|
+
)).data.find((g) => g.classicQuizId === e) ?? null;
|
|
684
|
+
return b ? {
|
|
685
|
+
position: b.position,
|
|
678
686
|
profileId: o,
|
|
679
687
|
profileModel: null,
|
|
680
|
-
points:
|
|
688
|
+
points: b.points
|
|
681
689
|
} : null;
|
|
682
|
-
},
|
|
690
|
+
}, Ye = (e, t, o, c) => {
|
|
683
691
|
const r = e.type.toUpperCase();
|
|
684
|
-
return r === "TOP_X" || r === "MATCH_QUIZ" || r === "TEMPLATE" ?
|
|
685
|
-
|
|
686
|
-
|
|
692
|
+
return r === "TOP_X" || r === "MATCH_QUIZ" || r === "TEMPLATE" ? Ve(
|
|
693
|
+
e.id,
|
|
694
|
+
t,
|
|
695
|
+
e.type,
|
|
696
|
+
o,
|
|
697
|
+
c
|
|
698
|
+
) : Ne(e.id, t, o, c);
|
|
699
|
+
}, Ke = (e, t, o, c = 10) => {
|
|
700
|
+
const [r, s] = F({}), [b, g] = F(null), [m, u] = F(!1), [C, f] = F(!1), [x, R] = F(
|
|
687
701
|
null
|
|
688
|
-
), [
|
|
702
|
+
), [T, h] = F(null), d = Se();
|
|
689
703
|
Q(() => {
|
|
690
|
-
const
|
|
691
|
-
topX: e.filter((
|
|
692
|
-
matchQuiz: e.filter((
|
|
693
|
-
template: e.filter((
|
|
694
|
-
classicQuiz: e.filter((
|
|
695
|
-
},
|
|
704
|
+
const l = {
|
|
705
|
+
topX: e.filter((i) => i.type.toUpperCase() === "TOP_X").map((i) => i.id),
|
|
706
|
+
matchQuiz: e.filter((i) => i.type.toUpperCase() === "MATCH_QUIZ").map((i) => i.id),
|
|
707
|
+
template: e.filter((i) => i.type.toUpperCase() === "TEMPLATE").map((i) => i.id),
|
|
708
|
+
classicQuiz: e.filter((i) => i.type.toUpperCase() === "CLASSIC_QUIZ").map((i) => i.id)
|
|
709
|
+
}, p = (i) => i.catch(() => []);
|
|
696
710
|
Promise.all([
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
]).then((
|
|
702
|
-
const
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
}),
|
|
711
|
+
p(ne(l.topX, t, d)),
|
|
712
|
+
p(le(l.matchQuiz, t, d)),
|
|
713
|
+
p(ae(l.template, t, d)),
|
|
714
|
+
p(ie(l.classicQuiz, t, d))
|
|
715
|
+
]).then((i) => {
|
|
716
|
+
const a = {};
|
|
717
|
+
i.flat().forEach((v) => {
|
|
718
|
+
a[v.id] = v;
|
|
719
|
+
}), s(a);
|
|
706
720
|
});
|
|
707
|
-
}, [e, t]), Q(() => {
|
|
708
|
-
|
|
721
|
+
}, [e, t, d]), Q(() => {
|
|
722
|
+
Ge(t).then(R);
|
|
709
723
|
}, [t]), Q(() => {
|
|
710
724
|
if (!o || !x) {
|
|
711
|
-
|
|
725
|
+
h(null);
|
|
712
726
|
return;
|
|
713
727
|
}
|
|
714
|
-
let
|
|
728
|
+
let l = !1, p;
|
|
715
729
|
if (o === $) {
|
|
716
|
-
const
|
|
717
|
-
|
|
718
|
-
const
|
|
719
|
-
return
|
|
720
|
-
position:
|
|
730
|
+
const i = e.map((a) => a.id);
|
|
731
|
+
p = t.miniGames.getClassicQuizzesUserRanking(x.id, void 0, d).then((a) => {
|
|
732
|
+
const P = a.data.find((B) => i.includes(B.classicQuizId)) ?? null;
|
|
733
|
+
return P ? {
|
|
734
|
+
position: P.position,
|
|
721
735
|
profileId: x.id,
|
|
722
736
|
profileModel: null,
|
|
723
|
-
points:
|
|
737
|
+
points: P.points
|
|
724
738
|
} : null;
|
|
725
739
|
});
|
|
726
740
|
} else {
|
|
727
|
-
const
|
|
728
|
-
if (!
|
|
729
|
-
|
|
741
|
+
const i = e.find((a) => a.id === o);
|
|
742
|
+
if (!i) return;
|
|
743
|
+
p = Ye(
|
|
744
|
+
i,
|
|
745
|
+
t,
|
|
746
|
+
x.id,
|
|
747
|
+
d
|
|
748
|
+
);
|
|
730
749
|
}
|
|
731
|
-
return
|
|
732
|
-
|
|
750
|
+
return p.then((i) => {
|
|
751
|
+
l || h(i);
|
|
733
752
|
}).catch(() => {
|
|
734
|
-
|
|
753
|
+
l || h(null);
|
|
735
754
|
}), () => {
|
|
736
|
-
|
|
755
|
+
l = !0;
|
|
737
756
|
};
|
|
738
|
-
}, [o, e, t, x]), Q(() => {
|
|
757
|
+
}, [o, e, t, x, d]), Q(() => {
|
|
739
758
|
if (!o) return;
|
|
740
|
-
let
|
|
741
|
-
return
|
|
759
|
+
let l = !1;
|
|
760
|
+
return u(!0), f(!1), g(null), (async () => {
|
|
742
761
|
try {
|
|
743
|
-
const
|
|
744
|
-
if (o === $ &&
|
|
745
|
-
const
|
|
746
|
-
|
|
762
|
+
const i = e.length > 1 && e.every((y) => y.type.toUpperCase() === "CLASSIC_QUIZ");
|
|
763
|
+
if (o === $ && i) {
|
|
764
|
+
const y = e.map((O) => O.id), M = await X(
|
|
765
|
+
y,
|
|
747
766
|
t,
|
|
748
767
|
1,
|
|
749
|
-
|
|
768
|
+
c,
|
|
769
|
+
d
|
|
750
770
|
);
|
|
751
|
-
|
|
771
|
+
l || g({
|
|
752
772
|
id: $,
|
|
753
773
|
title: $,
|
|
754
774
|
description: null,
|
|
755
775
|
branding: null,
|
|
756
|
-
...
|
|
776
|
+
...M
|
|
757
777
|
});
|
|
758
778
|
return;
|
|
759
779
|
}
|
|
760
|
-
const
|
|
761
|
-
if (!
|
|
762
|
-
const
|
|
763
|
-
|
|
764
|
-
|
|
780
|
+
const a = e.find((y) => y.id === o);
|
|
781
|
+
if (!a) return;
|
|
782
|
+
const v = a.type.toUpperCase(), P = v === "TOP_X" ? ne([o], t, d) : v === "MATCH_QUIZ" ? le([o], t, d) : v === "TEMPLATE" ? ae([o], t, d) : ie([o], t, d), [B, E] = await Promise.all([
|
|
783
|
+
se(a, t, 1, c, d),
|
|
784
|
+
P.catch(() => [])
|
|
765
785
|
]);
|
|
766
|
-
if (!
|
|
767
|
-
const
|
|
768
|
-
|
|
786
|
+
if (!l) {
|
|
787
|
+
const y = E[0];
|
|
788
|
+
g({
|
|
769
789
|
id: o,
|
|
770
|
-
title: (
|
|
771
|
-
description: (
|
|
772
|
-
branding: (
|
|
773
|
-
...
|
|
790
|
+
title: (y == null ? void 0 : y.title) || o,
|
|
791
|
+
description: (y == null ? void 0 : y.description) || null,
|
|
792
|
+
branding: (y == null ? void 0 : y.branding) || null,
|
|
793
|
+
...B
|
|
774
794
|
});
|
|
775
795
|
}
|
|
776
|
-
} catch (
|
|
777
|
-
console.error("Failed to fetch leaderboard:",
|
|
796
|
+
} catch (i) {
|
|
797
|
+
console.error("Failed to fetch leaderboard:", i), l || f(!0);
|
|
778
798
|
} finally {
|
|
779
|
-
|
|
799
|
+
l || u(!1);
|
|
780
800
|
}
|
|
781
801
|
})(), () => {
|
|
782
|
-
|
|
802
|
+
l = !0;
|
|
783
803
|
};
|
|
784
|
-
}, [o, e, t,
|
|
785
|
-
const
|
|
786
|
-
async (
|
|
804
|
+
}, [o, e, t, c, d]);
|
|
805
|
+
const w = he(
|
|
806
|
+
async (l) => {
|
|
787
807
|
if (o) {
|
|
788
|
-
|
|
808
|
+
u(!0);
|
|
789
809
|
try {
|
|
790
|
-
let
|
|
810
|
+
let p;
|
|
791
811
|
if (o === $) {
|
|
792
|
-
const
|
|
793
|
-
|
|
812
|
+
const i = e.map((a) => a.id);
|
|
813
|
+
p = await X(
|
|
814
|
+
i,
|
|
815
|
+
t,
|
|
816
|
+
l,
|
|
817
|
+
c,
|
|
818
|
+
d
|
|
819
|
+
);
|
|
794
820
|
} else {
|
|
795
|
-
const
|
|
796
|
-
if (!
|
|
797
|
-
|
|
821
|
+
const i = e.find((a) => a.id === o);
|
|
822
|
+
if (!i) return;
|
|
823
|
+
p = await se(
|
|
824
|
+
i,
|
|
825
|
+
t,
|
|
826
|
+
l,
|
|
827
|
+
c,
|
|
828
|
+
d
|
|
829
|
+
);
|
|
798
830
|
}
|
|
799
|
-
|
|
800
|
-
} catch (
|
|
801
|
-
console.error("Failed to fetch page:",
|
|
831
|
+
g((i) => i ? { ...i, ...p } : null);
|
|
832
|
+
} catch (p) {
|
|
833
|
+
console.error("Failed to fetch page:", p);
|
|
802
834
|
} finally {
|
|
803
|
-
|
|
835
|
+
u(!1);
|
|
804
836
|
}
|
|
805
837
|
}
|
|
806
838
|
},
|
|
807
|
-
[o, e, t,
|
|
808
|
-
),
|
|
809
|
-
Object.entries(
|
|
839
|
+
[o, e, t, c, d]
|
|
840
|
+
), A = Object.fromEntries(
|
|
841
|
+
Object.entries(r).map(([l, p]) => [l, p.title])
|
|
810
842
|
);
|
|
811
|
-
return { data:
|
|
812
|
-
},
|
|
843
|
+
return { data: b, entityTitles: A, loading: m, error: C, setPage: w, userRank: T };
|
|
844
|
+
}, D = "ALL", ce = ["TOP_X", "MATCH_QUIZ", "TEMPLATE", "CLASSIC_QUIZ"], qe = (e, t) => {
|
|
813
845
|
if (!Array.isArray(e) || e.length === 0)
|
|
814
846
|
return "The 'entities' setting is required and must be a non-empty array.";
|
|
815
847
|
const o = /* @__PURE__ */ new Set();
|
|
816
|
-
for (let
|
|
817
|
-
const
|
|
818
|
-
if (!
|
|
819
|
-
return `Entity at index ${
|
|
820
|
-
if (!
|
|
821
|
-
return `Entity at index ${
|
|
822
|
-
if (o.has(
|
|
823
|
-
return `Duplicate entity id '${
|
|
824
|
-
if (o.add(
|
|
825
|
-
return `Entity at index ${
|
|
826
|
-
if (!
|
|
827
|
-
return `Entity at index ${
|
|
848
|
+
for (let c = 0; c < e.length; c++) {
|
|
849
|
+
const r = e[c];
|
|
850
|
+
if (!r || typeof r != "object")
|
|
851
|
+
return `Entity at index ${c} must be an object with 'id' and 'type' fields.`;
|
|
852
|
+
if (!r.id || typeof r.id != "string")
|
|
853
|
+
return `Entity at index ${c} is missing a required 'id' string field.`;
|
|
854
|
+
if (o.has(r.id))
|
|
855
|
+
return `Duplicate entity id '${r.id}' found at index ${c}. Each entity must have a unique id.`;
|
|
856
|
+
if (o.add(r.id), !r.type || typeof r.type != "string")
|
|
857
|
+
return `Entity at index ${c} is missing a required 'type' string field.`;
|
|
858
|
+
if (!ce.includes(r.type.toUpperCase()))
|
|
859
|
+
return `Entity at index ${c} has an invalid type '${r.type}'. Valid values are: ${ce.join(", ")} (case-insensitive).`;
|
|
828
860
|
}
|
|
829
861
|
return t !== void 0 && (typeof t != "number" || !Number.isInteger(t) || t < 1 || t > 50) ? "The 'pageSize' setting must be an integer between 1 and 50." : null;
|
|
830
|
-
},
|
|
862
|
+
}, Je = ({
|
|
831
863
|
entities: e,
|
|
832
864
|
sdk: t,
|
|
833
865
|
pageSize: o,
|
|
834
|
-
rankStyles:
|
|
835
|
-
showOverallOnly:
|
|
836
|
-
showHeading:
|
|
866
|
+
rankStyles: c,
|
|
867
|
+
showOverallOnly: r = !1,
|
|
868
|
+
showHeading: s = !0
|
|
837
869
|
}) => {
|
|
838
|
-
var
|
|
839
|
-
const { t:
|
|
840
|
-
() =>
|
|
870
|
+
var E;
|
|
871
|
+
const { t: b } = G(), g = Z(), m = j().surface, u = W(
|
|
872
|
+
() => qe(e, o),
|
|
841
873
|
[e, o]
|
|
842
|
-
), C =
|
|
843
|
-
() => !
|
|
844
|
-
[e,
|
|
845
|
-
),
|
|
874
|
+
), C = W(
|
|
875
|
+
() => !u && e.length > 1 && e.every((y) => y.type.toUpperCase() === "CLASSIC_QUIZ"),
|
|
876
|
+
[e, u]
|
|
877
|
+
), f = r && C, x = C ? D : ((E = e[0]) == null ? void 0 : E.id) || "", [R, T] = F(x);
|
|
846
878
|
Q(() => {
|
|
847
|
-
|
|
879
|
+
R === D || e.some((M) => M.id === R) || T(x);
|
|
848
880
|
}, [e]);
|
|
849
|
-
const { data:
|
|
850
|
-
|
|
881
|
+
const { data: h, entityTitles: d, loading: w, error: A, setPage: l, userRank: p } = Ke(
|
|
882
|
+
u ? [] : e,
|
|
851
883
|
t,
|
|
852
|
-
|
|
884
|
+
u ? "" : R,
|
|
853
885
|
o
|
|
854
|
-
),
|
|
855
|
-
if (
|
|
856
|
-
const
|
|
857
|
-
return C &&
|
|
858
|
-
|
|
886
|
+
), i = W(() => {
|
|
887
|
+
if (u) return [];
|
|
888
|
+
const y = [];
|
|
889
|
+
return C && y.push({ id: D, label: b("leaderboard.overall") }), e.forEach((M) => {
|
|
890
|
+
y.push({
|
|
859
891
|
id: M.id,
|
|
860
|
-
label:
|
|
892
|
+
label: d[M.id] ?? "",
|
|
861
893
|
type: M.type.toUpperCase()
|
|
862
894
|
});
|
|
863
|
-
}),
|
|
864
|
-
}, [e, C,
|
|
865
|
-
return
|
|
866
|
-
|
|
895
|
+
}), y;
|
|
896
|
+
}, [e, C, b, d, u]), a = e.every((y) => d[y.id] !== void 0), v = !u && !f && (e.length > 1 || C) && a, P = (h == null ? void 0 : h.pagination) || null, B = R === D ? b("leaderboard.overall") : (h == null ? void 0 : h.title) || null;
|
|
897
|
+
return u ? /* @__PURE__ */ n(
|
|
898
|
+
re,
|
|
867
899
|
{
|
|
868
900
|
variant: "error",
|
|
869
901
|
title: "Configuration Error",
|
|
870
|
-
message:
|
|
902
|
+
message: u
|
|
871
903
|
}
|
|
872
|
-
) :
|
|
873
|
-
|
|
904
|
+
) : A ? /* @__PURE__ */ n(
|
|
905
|
+
re,
|
|
874
906
|
{
|
|
875
907
|
variant: "error",
|
|
876
908
|
title: "Failed to Load Leaderboard",
|
|
877
909
|
message: "One or more entity IDs could not be found. Please verify the provided IDs and try again."
|
|
878
910
|
}
|
|
879
|
-
) : /* @__PURE__ */
|
|
911
|
+
) : /* @__PURE__ */ S(
|
|
880
912
|
I,
|
|
881
913
|
{
|
|
882
914
|
sx: {
|
|
883
915
|
display: "flex",
|
|
884
916
|
flexDirection: "column",
|
|
885
|
-
gap:
|
|
886
|
-
backgroundColor:
|
|
887
|
-
padding:
|
|
917
|
+
gap: g.md,
|
|
918
|
+
backgroundColor: m,
|
|
919
|
+
padding: g.md
|
|
888
920
|
},
|
|
889
921
|
children: [
|
|
890
|
-
|
|
891
|
-
|
|
922
|
+
v && /* @__PURE__ */ n(
|
|
923
|
+
We,
|
|
892
924
|
{
|
|
893
|
-
options:
|
|
894
|
-
selectedId:
|
|
895
|
-
onChange:
|
|
925
|
+
options: i,
|
|
926
|
+
selectedId: R,
|
|
927
|
+
onChange: T
|
|
896
928
|
}
|
|
897
929
|
),
|
|
898
|
-
/* @__PURE__ */
|
|
899
|
-
|
|
930
|
+
/* @__PURE__ */ n(
|
|
931
|
+
_e,
|
|
900
932
|
{
|
|
901
|
-
leaderboard: w ? null : (
|
|
902
|
-
userRank: w ? null :
|
|
903
|
-
showHeading:
|
|
904
|
-
title:
|
|
905
|
-
description: (
|
|
906
|
-
brandingColors: (
|
|
907
|
-
rankStyles:
|
|
933
|
+
leaderboard: w ? null : (h == null ? void 0 : h.leaderboard) || null,
|
|
934
|
+
userRank: w ? null : p,
|
|
935
|
+
showHeading: s && !v,
|
|
936
|
+
title: B,
|
|
937
|
+
description: (h == null ? void 0 : h.description) || null,
|
|
938
|
+
brandingColors: (h == null ? void 0 : h.branding) || null,
|
|
939
|
+
rankStyles: c
|
|
908
940
|
}
|
|
909
941
|
),
|
|
910
|
-
!w &&
|
|
911
|
-
|
|
942
|
+
!w && P && P.totalPages > 1 && /* @__PURE__ */ n(
|
|
943
|
+
Xe,
|
|
912
944
|
{
|
|
913
|
-
count:
|
|
914
|
-
page:
|
|
915
|
-
onChange:
|
|
945
|
+
count: P.totalPages,
|
|
946
|
+
page: P.currentPage,
|
|
947
|
+
onChange: l
|
|
916
948
|
}
|
|
917
949
|
)
|
|
918
950
|
]
|
|
919
951
|
}
|
|
920
952
|
);
|
|
921
|
-
},
|
|
922
|
-
var
|
|
923
|
-
const [t, o] = z.useState(!1), [
|
|
953
|
+
}, et = (e) => {
|
|
954
|
+
var T;
|
|
955
|
+
const [t, o] = z.useState(!1), [c, r] = z.useState(!1), s = Re(e.language), b = z.useRef(
|
|
924
956
|
`leaderboard-shadow-root-${Math.random().toString(36).substring(2, 11)}`
|
|
925
|
-
),
|
|
957
|
+
), g = z.useRef(null), m = z.useRef(null), u = z.useRef(null), [C, f] = z.useState(null);
|
|
926
958
|
z.useEffect(() => {
|
|
927
|
-
|
|
959
|
+
Ee(e.language || "en").finally(() => r(!0));
|
|
928
960
|
}, [e.language]), z.useEffect(() => {
|
|
929
|
-
if (!
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
),
|
|
933
|
-
const
|
|
934
|
-
return
|
|
935
|
-
(
|
|
961
|
+
if (!g.current) return;
|
|
962
|
+
g.current.shadowRoot ? (m.current = g.current.shadowRoot, u.current = m.current.getElementById(
|
|
963
|
+
b.current
|
|
964
|
+
), u.current || (u.current = document.createElement("div"), u.current.id = b.current, m.current.appendChild(u.current))) : (m.current = g.current.attachShadow({ mode: "open" }), u.current = document.createElement("div"), u.current.id = b.current, m.current.appendChild(u.current)), Ae(u.current, s);
|
|
965
|
+
const h = Le("leaderboard", s);
|
|
966
|
+
return f(
|
|
967
|
+
(d) => (d == null ? void 0 : d.key) === h ? d : Ie(
|
|
936
968
|
"leaderboard",
|
|
937
|
-
|
|
938
|
-
|
|
969
|
+
m.current,
|
|
970
|
+
s
|
|
939
971
|
)
|
|
940
972
|
), o(!0), () => {
|
|
941
973
|
o(!1);
|
|
942
974
|
};
|
|
943
|
-
}, [
|
|
944
|
-
const x = /* @__PURE__ */
|
|
975
|
+
}, [s]);
|
|
976
|
+
const x = /* @__PURE__ */ n(I, { ref: g, lang: e.language || "en" }), R = t && c && u.current && C ? ke(
|
|
945
977
|
// Keyed on the cache, not on `direction`: it must change in the same
|
|
946
978
|
// render that adopts the new cache, or CssVarsProvider writes its CSS
|
|
947
979
|
// variables into the outgoing cache and never repeats.
|
|
948
|
-
/* @__PURE__ */
|
|
949
|
-
|
|
980
|
+
/* @__PURE__ */ n(He, { value: C, children: /* @__PURE__ */ n(Me, { containerRef: g, children: /* @__PURE__ */ n(
|
|
981
|
+
ze,
|
|
950
982
|
{
|
|
951
983
|
customTheme: e.themeOptions,
|
|
952
|
-
mode: (
|
|
953
|
-
shadowRootElement:
|
|
954
|
-
direction:
|
|
955
|
-
children: /* @__PURE__ */
|
|
956
|
-
|
|
984
|
+
mode: (T = e.themeOptions) == null ? void 0 : T.mode,
|
|
985
|
+
shadowRootElement: u.current,
|
|
986
|
+
direction: s,
|
|
987
|
+
children: /* @__PURE__ */ n(
|
|
988
|
+
Be,
|
|
957
989
|
{
|
|
958
|
-
shadowRootElement:
|
|
990
|
+
shadowRootElement: u.current,
|
|
959
991
|
leadPhoneCountryCode: null,
|
|
960
992
|
language: e.language,
|
|
961
993
|
optionsLayout: null,
|
|
962
|
-
direction:
|
|
994
|
+
direction: s,
|
|
995
|
+
disableCache: e.disableCache ?? !1,
|
|
963
996
|
children: e.children
|
|
964
997
|
}
|
|
965
998
|
)
|
|
966
999
|
}
|
|
967
1000
|
) }) }, C.key),
|
|
968
|
-
|
|
1001
|
+
u.current
|
|
969
1002
|
) : null;
|
|
970
|
-
return /* @__PURE__ */
|
|
1003
|
+
return /* @__PURE__ */ S(de, { children: [
|
|
971
1004
|
x,
|
|
972
|
-
|
|
1005
|
+
R
|
|
973
1006
|
] });
|
|
974
|
-
},
|
|
1007
|
+
}, tt = (e) => /* @__PURE__ */ n(et, { ...e, children: /* @__PURE__ */ n(Je, { ...e }) }), mt = De(tt);
|
|
975
1008
|
export {
|
|
976
|
-
|
|
1009
|
+
mt as Leaderboard
|
|
977
1010
|
};
|