fansunited-frontend-components 0.0.99 → 1.0.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.
Files changed (62) hide show
  1. package/Betslip.js +2 -2
  2. package/ChanceGame.js +496 -505
  3. package/ClassicQuizPlay.js +2 -2
  4. package/CollectLead.js +405 -1163
  5. package/CompetitionStatistics.js +2 -2
  6. package/CompetitorCard.js +445 -425
  7. package/Discussion.js +2 -2
  8. package/EitherOrPlay.js +2 -2
  9. package/EventCard.js +648 -593
  10. package/EventGamePlay.js +2 -2
  11. package/Leaderboard.js +142 -132
  12. package/List.js +675 -713
  13. package/MatchQuizPlay.js +2 -2
  14. package/Odds.js +1 -1
  15. package/PersonalityQuizPlay.js +2 -2
  16. package/PickThePair.js +925 -1824
  17. package/PlayerOfTheMatch.js +2106 -2223
  18. package/PollVote.js +2 -2
  19. package/Predictor.js +4209 -18629
  20. package/Standings.js +497 -486
  21. package/TopX.js +3223 -16958
  22. package/chunks/{ChanceGameEmbedVariant-DM9eLG5s.js → ChanceGameEmbedVariant-z8XYzgDW.js} +1 -1
  23. package/chunks/PickOneOfX-IvE4OvyT.js +3146 -0
  24. package/chunks/index-BNl8scz6.js +4 -0
  25. package/chunks/index-CSa2JU4m.js +4 -0
  26. package/chunks/index-CVRI82Gb.js +4 -0
  27. package/chunks/index-Cd1dg0KI.js +4 -0
  28. package/chunks/index-Cei2fzi7.js +4 -0
  29. package/chunks/index-Cxb4wEJU.js +4 -0
  30. package/chunks/index-w1LGN5dz.js +4 -0
  31. package/chunks/main-07vzblS8.js +2091 -0
  32. package/chunks/main-C7X4dM_P.js +4827 -0
  33. package/chunks/main-D_QDfmAw.js +6417 -0
  34. package/chunks/{main-CzfWaEQP.js → main-DdL0UekL.js} +1931 -2025
  35. package/chunks/main-DmBfwyb4.js +2992 -0
  36. package/chunks/main-LEE8n2cG.js +3117 -0
  37. package/chunks/{main-DxvBjXsd.js → main-P2WNvBZE.js} +473 -444
  38. package/chunks/{main-DiBlJBNb.js → main-gV165E-A.js} +629 -657
  39. package/chunks/predictionsHelpers-fwXaMadu.js +10063 -0
  40. package/chunks/{withVersionStamp-BsLyhvNA.js → withVersionStamp-CPDfSE5H.js} +1 -1
  41. package/package.json +2 -6
  42. package/withVersionStamp.d.ts.map +1 -1
  43. package/chunks/CheckCircle-I1FktW5Y.js +0 -13
  44. package/chunks/Person-CXRqyF4E.js +0 -11
  45. package/chunks/PickOneOfX-DET4ZhjV.js +0 -3117
  46. package/chunks/Search-CIXthh0D.js +0 -17
  47. package/chunks/TimerOutlined-D-WA_vpE.js +0 -8
  48. package/chunks/WorkspacePremiumOutlined-DUXVgJlF.js +0 -136
  49. package/chunks/chevrons-right-HWKW2c4I.js +0 -45
  50. package/chunks/createLucideIcon-YBRjY5Kl.js +0 -79
  51. package/chunks/index-BENM3N_w.js +0 -4
  52. package/chunks/index-BRxAV693.js +0 -4
  53. package/chunks/index-BXYTsvIX.js +0 -4
  54. package/chunks/index-C0ilols1.js +0 -4
  55. package/chunks/index-D7VhczXH.js +0 -4
  56. package/chunks/index-DKwvdw9t.js +0 -4
  57. package/chunks/index-DZN-AITW.js +0 -4
  58. package/chunks/main-B2sDRFF4.js +0 -2184
  59. package/chunks/main-DFNl3g_U.js +0 -4910
  60. package/chunks/main-DLwnvntz.js +0 -4020
  61. package/chunks/main-S8_NDSiY.js +0 -3209
  62. package/chunks/main-lBgr8Liq.js +0 -6571
package/EventGamePlay.js CHANGED
@@ -1,5 +1,5 @@
1
- import { M as o } from "./chunks/main-DFNl3g_U.js";
2
- import { w as t } from "./chunks/withVersionStamp-BsLyhvNA.js";
1
+ import { M as o } from "./chunks/main-C7X4dM_P.js";
2
+ import { w as t } from "./chunks/withVersionStamp-CPDfSE5H.js";
3
3
  const r = t(o);
4
4
  export {
5
5
  r as EventGamePlay
package/Leaderboard.js CHANGED
@@ -1,13 +1,13 @@
1
1
  import { jsxs as T, jsx as i } from "@emotion/react/jsx-runtime";
2
- import { useMemo as Q, useState as z, useEffect as F, useCallback as me } from "react";
2
+ import { useMemo as Q, useState as z, useEffect as H, useCallback as me } from "react";
3
3
  import { css as v } from "@emotion/react";
4
4
  import { useTranslation as Y } from "react-i18next";
5
- import { Select as ge, Spinner as ye, DataTable as be, Avatar as J, Button as S, AlertMessage as K, WidgetPortal as ve } from "fansunited-frontend-core/ui/emotion";
6
- import { useInternalTheme as ce, useColors as xe, isExtraSmall as Ce, hexToRgb as ee, stripHtmlTags as Te, DirectionalIcon as B, useDisableCache as Pe } from "fansunited-frontend-core";
7
- import { PersonIcon as Ae } from "fansunited-frontend-core/ui/icons";
8
- import { ChevronsLeft as Le, ChevronLeft as Ee, ChevronRight as we, ChevronsRight as Ie } from "fansunited-frontend-core/ui/icons/lucide";
9
- import { w as Me } from "./chunks/withVersionStamp-BsLyhvNA.js";
10
- const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()).join(" "), R = {
5
+ import { Select as ge, Spinner as ye, DataTable as be, Avatar as K, Button as S, AlertMessage as q, WidgetPortal as ve } from "fansunited-frontend-core/ui/emotion";
6
+ import { useInternalTheme as ce, useColors as xe, useIsExtraSmall as Ce, hexToRgb as ee, stripHtmlTags as Te, DirectionalIcon as $, useDisableCache as Pe } from "fansunited-frontend-core";
7
+ import { PersonIcon as Le } from "fansunited-frontend-core/ui/icons";
8
+ import { ChevronsLeft as Ae, ChevronLeft as Ee, ChevronRight as we, ChevronsRight as Ie } from "fansunited-frontend-core/ui/icons/lucide";
9
+ import { w as Me } from "./chunks/withVersionStamp-CPDfSE5H.js";
10
+ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()).join(" "), D = {
11
11
  root: v({
12
12
  display: "flex",
13
13
  flexDirection: "column",
@@ -23,6 +23,7 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
23
23
  width: "100%",
24
24
  gap: "var(--fu-ucrc-space-sm)"
25
25
  }),
26
+ optionLabel: v({ unicodeBidi: "plaintext" }),
26
27
  chip: v({
27
28
  flexShrink: 0,
28
29
  fontSize: "0.65em",
@@ -49,23 +50,23 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
49
50
  const { t: o } = Y(), r = ce(), l = Q(() => {
50
51
  const c = r.colorSchemes.light.palette || {};
51
52
  return Object.fromEntries(
52
- Object.entries(Ue).map(([p, [y, E]]) => {
53
+ Object.entries(Ue).map(([p, [g, E]]) => {
53
54
  var P;
54
- return [p, (P = c[y]) == null ? void 0 : P[E]];
55
+ return [p, (P = c[g]) == null ? void 0 : P[E]];
55
56
  })
56
57
  );
57
58
  }, [r]), u = Q(
58
59
  () => e.map((c) => ({
59
60
  value: c.id,
60
- label: /* @__PURE__ */ T("span", { css: R.option, children: [
61
- /* @__PURE__ */ i("span", { children: c.label }),
62
- c.type && /* @__PURE__ */ i("span", { css: R.chip, children: Oe(c.type) })
61
+ label: /* @__PURE__ */ T("span", { css: D.option, children: [
62
+ /* @__PURE__ */ i("span", { css: D.optionLabel, children: c.label }),
63
+ c.type && /* @__PURE__ */ i("span", { css: D.chip, children: Oe(c.type) })
63
64
  ] })
64
65
  })),
65
66
  [e]
66
67
  );
67
- return /* @__PURE__ */ T("div", { css: R.root, style: l, children: [
68
- /* @__PURE__ */ i("label", { css: R.label, children: /* @__PURE__ */ i("p", { css: R.labelText, children: o("leaderboard.selectLabel") }) }),
68
+ return /* @__PURE__ */ T("div", { css: D.root, style: l, children: [
69
+ /* @__PURE__ */ i("label", { css: D.label, children: /* @__PURE__ */ i("p", { css: D.labelText, children: o("leaderboard.selectLabel") }) }),
69
70
  /* @__PURE__ */ i(
70
71
  ge,
71
72
  {
@@ -76,11 +77,11 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
76
77
  }
77
78
  )
78
79
  ] });
79
- }, ze = "calc(6em / 10.5) calc(8em / 10.5)", X = "0.5em calc(8em / 12)", Qe = "var(--fu-ucrc-lb-primary)", G = "var(--fu-ucrc-lb-text)", de = "var(--fu-ucrc-lb-on-primary)", Se = "var(--fu-ucrc-lb-head-bg)", j = "var(--fu-ucrc-font-primary)", te = "var(--fu-ucrc-font-secondary)", ue = "var(--fu-ucrc-outline-enabled-border)", $ = { margin: 0, lineHeight: 1.5 }, Z = { ...$, fontFamily: j, fontSize: "0.875em", color: G }, x = {
80
+ }, ze = "calc(6em / 10.5) calc(8em / 10.5)", X = "0.5em calc(8em / 12)", Qe = "var(--fu-ucrc-lb-primary)", G = "var(--fu-ucrc-lb-text)", de = "var(--fu-ucrc-lb-on-primary)", Se = "var(--fu-ucrc-lb-head-bg)", j = "var(--fu-ucrc-font-primary)", te = "var(--fu-ucrc-font-secondary)", ue = "var(--fu-ucrc-outline-enabled-border)", F = { margin: 0, lineHeight: 1.5 }, Z = { ...F, fontFamily: j, fontSize: "0.875em", color: G }, x = {
80
81
  container: v({ display: "flex", flexDirection: "column", gap: "var(--fu-ucrc-space-md)" }),
81
82
  heading: v({ display: "flex", flexDirection: "column", alignItems: "center", textAlign: "center" }),
82
83
  overline: v({
83
- ...$,
84
+ ...F,
84
85
  fontWeight: 500,
85
86
  lineHeight: "166%",
86
87
  letterSpacing: "1px",
@@ -92,24 +93,26 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
92
93
  }),
93
94
  titles: v({ display: "flex", flexDirection: "column", gap: "var(--fu-ucrc-space-3xs)" }),
94
95
  title: v({
95
- ...$,
96
+ ...F,
96
97
  fontFamily: j,
97
98
  fontWeight: 700,
98
99
  lineHeight: "133%",
99
100
  letterSpacing: "0px",
100
101
  fontSize: "1.5em",
101
102
  color: G,
102
- textAlign: "center"
103
+ textAlign: "center",
104
+ unicodeBidi: "plaintext"
103
105
  }),
104
106
  description: v({
105
- ...$,
107
+ ...F,
106
108
  fontWeight: 400,
107
109
  lineHeight: "140%",
108
110
  letterSpacing: "0.15px",
109
111
  fontSize: "1.25em",
110
112
  color: "var(--fu-ucrc-text-color)",
111
113
  opacity: "60%",
112
- fontFamily: j
114
+ fontFamily: j,
115
+ unicodeBidi: "plaintext"
113
116
  }),
114
117
  tableContainer: v({
115
118
  backgroundColor: "var(--fu-ucrc-bg-surface)",
@@ -127,10 +130,17 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
127
130
  color: de
128
131
  }),
129
132
  position: v({ ...Z, fontWeight: 600 }),
130
- name: v({ ...Z, fontWeight: 500, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }),
133
+ name: v({
134
+ ...Z,
135
+ fontWeight: 500,
136
+ overflow: "hidden",
137
+ textOverflow: "ellipsis",
138
+ whiteSpace: "nowrap",
139
+ unicodeBidi: "plaintext"
140
+ }),
131
141
  points: v({ ...Z, fontWeight: 600 }),
132
142
  empty: v({
133
- ...$,
143
+ ...F,
134
144
  fontFamily: te,
135
145
  fontSize: "1.25em",
136
146
  color: G,
@@ -146,14 +156,14 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
146
156
  textAlign: "center",
147
157
  padding: ze,
148
158
  borderBottomColor: ue
149
- }, U = {
159
+ }, O = {
150
160
  headPosition: { ...N, width: "10%" },
151
161
  headName: { ...N, textAlign: "start", width: "80%" },
152
162
  headPoints: { ...N, width: "10%" },
153
163
  position: { padding: X, width: "10%", textAlign: "center" },
154
164
  name: { padding: X, width: "80%" },
155
165
  points: { padding: X, width: "10%", textAlign: "center" }
156
- }, De = { backgroundColor: "var(--fu-ucrc-surface-variant)", cursor: "default" }, re = /* @__PURE__ */ i(Ae, { size: "1em", color: de }), Re = ({
166
+ }, De = { backgroundColor: "var(--fu-ucrc-surface-variant)", cursor: "default" }, re = /* @__PURE__ */ i(Le, { size: "1em", color: de }), Re = ({
157
167
  leaderboard: e,
158
168
  userRank: t,
159
169
  showHeading: n,
@@ -163,20 +173,20 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
163
173
  brandingColors: u,
164
174
  rankStyles: c
165
175
  }) => {
166
- const { t: p } = Y(), y = ce(), E = xe(), P = Ce(), A = (u == null ? void 0 : u.primaryColor) || E.palette.primary.plainColor, f = Q(
176
+ const { t: p } = Y(), g = ce(), E = xe(), P = Ce(), L = (u == null ? void 0 : u.primaryColor) || E.palette.primary.plainColor, f = Q(
167
177
  () => ({
168
- "--fu-ucrc-lb-primary": A,
178
+ "--fu-ucrc-lb-primary": L,
169
179
  "--fu-ucrc-lb-text": (u == null ? void 0 : u.contentColor) || E.textColor,
170
- "--fu-ucrc-lb-on-primary": y.colorSchemes.light.palette.primary.onPrimary,
180
+ "--fu-ucrc-lb-on-primary": g.colorSchemes.light.palette.primary.onPrimary,
171
181
  "--fu-ucrc-lb-head-bg": `rgba(${ee(E.surfaceVariant)}, 0.8)`
172
182
  }),
173
- [A, u == null ? void 0 : u.contentColor, E, y]
174
- ), h = Q(() => ({ backgroundColor: `rgba(${ee(A)}, 0.1)` }), [A]);
183
+ [L, u == null ? void 0 : u.contentColor, E, g]
184
+ ), h = Q(() => ({ backgroundColor: `rgba(${ee(L)}, 0.1)` }), [L]);
175
185
  if (!e)
176
186
  return /* @__PURE__ */ i(ye, { marginBlock: "5em" });
177
187
  if (e.length === 0)
178
188
  return /* @__PURE__ */ i("p", { css: x.empty, style: f, children: p("leaderboard.noLeaderboardAvailable") });
179
- const C = t == null ? void 0 : t.profileId, s = C && e.some((g) => g.profileId === C);
189
+ const C = t == null ? void 0 : t.profileId, s = C && e.some((y) => y.profileId === C);
180
190
  return /* @__PURE__ */ T("div", { css: x.container, style: f, children: [
181
191
  n && /* @__PURE__ */ T("div", { css: x.heading, children: [
182
192
  /* @__PURE__ */ i("p", { css: x.overline, children: p("leaderboard.heading") }),
@@ -187,47 +197,47 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
187
197
  ] }),
188
198
  /* @__PURE__ */ i("div", { css: x.tableContainer, children: /* @__PURE__ */ T(be, { style: De, children: [
189
199
  /* @__PURE__ */ i("thead", { children: /* @__PURE__ */ T("tr", { children: [
190
- /* @__PURE__ */ i("th", { style: U.headPosition, children: P || l ? "" : p("leaderboard.position") }),
191
- /* @__PURE__ */ i("th", { style: U.headName, children: p("leaderboard.name") }),
192
- /* @__PURE__ */ i("th", { style: U.headPoints, children: P || l ? "🎯" : p("leaderboard.points") })
200
+ /* @__PURE__ */ i("th", { style: O.headPosition, children: P || l ? "" : p("leaderboard.position") }),
201
+ /* @__PURE__ */ i("th", { style: O.headName, children: p("leaderboard.name") }),
202
+ /* @__PURE__ */ i("th", { style: O.headPoints, children: P || l ? "🎯" : p("leaderboard.points") })
193
203
  ] }) }),
194
204
  /* @__PURE__ */ T("tbody", { children: [
195
205
  t && !s && /* @__PURE__ */ T("tr", { style: h, children: [
196
- /* @__PURE__ */ i("td", { style: U.position, children: /* @__PURE__ */ T("p", { css: x.position, children: [
206
+ /* @__PURE__ */ i("td", { style: O.position, children: /* @__PURE__ */ T("p", { css: x.position, children: [
197
207
  "#",
198
208
  t.position
199
209
  ] }) }),
200
- /* @__PURE__ */ i("td", { style: U.name, children: /* @__PURE__ */ T("div", { css: x.nameCell, children: [
201
- /* @__PURE__ */ i(J, { css: x.avatar, children: re }),
210
+ /* @__PURE__ */ i("td", { style: O.name, children: /* @__PURE__ */ T("div", { css: x.nameCell, children: [
211
+ /* @__PURE__ */ i(K, { css: x.avatar, children: re }),
202
212
  /* @__PURE__ */ i("p", { css: x.name, children: p("leaderboard.you") })
203
213
  ] }) }),
204
- /* @__PURE__ */ i("td", { style: U.points, children: /* @__PURE__ */ i("p", { css: x.points, children: t.points }) })
214
+ /* @__PURE__ */ i("td", { style: O.points, children: /* @__PURE__ */ i("p", { css: x.points, children: t.points }) })
205
215
  ] }),
206
- e.map((g, w) => {
207
- var a, m, I, O;
208
- const d = C === g.profileId, b = d ? h : c == null ? void 0 : c[w + 1];
216
+ e.map((y, w) => {
217
+ var a, m, I;
218
+ const d = C === y.profileId, b = d ? h : c == null ? void 0 : c[w + 1];
209
219
  return /* @__PURE__ */ T("tr", { style: b, children: [
210
- /* @__PURE__ */ i("td", { style: U.position, children: /* @__PURE__ */ T("p", { css: x.position, children: [
220
+ /* @__PURE__ */ i("td", { style: O.position, children: /* @__PURE__ */ T("p", { css: x.position, children: [
211
221
  "#",
212
- g.position
222
+ y.position
213
223
  ] }) }),
214
- /* @__PURE__ */ i("td", { style: U.name, children: /* @__PURE__ */ T("div", { css: x.nameCell, children: [
215
- /* @__PURE__ */ i(J, { src: ((a = g.profileModel) == null ? void 0 : a.avatar) || void 0, css: x.avatar, children: (m = g.profileModel) != null && m.avatar ? null : re }),
216
- /* @__PURE__ */ i("p", { css: x.name, children: d ? p("leaderboard.you") : ((I = g.profileModel) == null ? void 0 : I.nickname) || ((O = g.profileModel) == null ? void 0 : O.name) || p("leaderboard.anonymous") })
224
+ /* @__PURE__ */ i("td", { style: O.name, children: /* @__PURE__ */ T("div", { css: x.nameCell, children: [
225
+ /* @__PURE__ */ i(K, { src: ((a = y.profileModel) == null ? void 0 : a.avatar) || void 0, css: x.avatar, children: re }),
226
+ /* @__PURE__ */ i("p", { css: x.name, children: d ? p("leaderboard.you") : ((m = y.profileModel) == null ? void 0 : m.nickname) || ((I = y.profileModel) == null ? void 0 : I.name) || p("leaderboard.anonymous") })
217
227
  ] }) }),
218
- /* @__PURE__ */ i("td", { style: U.points, children: /* @__PURE__ */ i("p", { css: x.points, children: g.points }) })
219
- ] }, g.profileId);
228
+ /* @__PURE__ */ i("td", { style: O.points, children: /* @__PURE__ */ i("p", { css: x.points, children: y.points }) })
229
+ ] }, y.profileId);
220
230
  })
221
231
  ] })
222
232
  ] }) })
223
233
  ] });
224
- }, He = v({
234
+ }, Be = v({
225
235
  display: "flex",
226
236
  gap: "4px",
227
237
  alignItems: "center",
228
238
  flexWrap: "wrap",
229
239
  fontFamily: "var(--fu-ucrc-font-primary)"
230
- }), D = { borderRadius: "8px", minWidth: "32px", minHeight: "32px" }, pe = { ...D, fontWeight: 400 }, Fe = { ...D, fontWeight: 600 }, $e = { ...pe, cursor: "default", color: "var(--fu-ucrc-joy-text-secondary)" }, Be = ({
240
+ }), R = { borderRadius: "8px", minWidth: "32px", minHeight: "32px" }, pe = { ...R, fontWeight: 400 }, He = { ...R, fontWeight: 600 }, Fe = { ...pe, cursor: "default", color: "var(--fu-ucrc-palette-text-secondary)" }, $e = ({
231
241
  count: e = 10,
232
242
  page: t = 1,
233
243
  onChange: n,
@@ -238,36 +248,36 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
238
248
  size: c = "md",
239
249
  disabled: p = !1
240
250
  }) => {
241
- const y = (h) => {
251
+ const g = (h) => {
242
252
  n && h >= 1 && h <= e && n(h);
243
253
  }, E = (h, C) => {
244
254
  const s = [];
245
- for (let g = h; g <= C; g++) s.push(g);
255
+ for (let y = h; y <= C; y++) s.push(y);
246
256
  return s;
247
- }, A = (() => {
257
+ }, L = (() => {
248
258
  if (e <= 0) return [];
249
259
  const h = E(1, Math.min(r, e)), C = E(
250
260
  Math.max(e - r + 1, r + 1),
251
261
  e
252
- ), s = Math.max(r + 1, t - o), g = Math.min(e - r, t + o), w = [...h];
253
- if (s > r + 1 && w.push("ellipsis-start"), s <= g)
254
- for (let d = s; d <= g; d++)
262
+ ), s = Math.max(r + 1, t - o), y = Math.min(e - r, t + o), w = [...h];
263
+ if (s > r + 1 && w.push("ellipsis-start"), s <= y)
264
+ for (let d = s; d <= y; d++)
255
265
  w.push(d);
256
- g < e - r && w.push("ellipsis-end");
266
+ y < e - r && w.push("ellipsis-end");
257
267
  for (const d of C)
258
268
  w.includes(d) || w.push(d);
259
269
  return w;
260
270
  })(), f = c === "sm" ? 16 : c === "lg" ? 24 : 20;
261
- return /* @__PURE__ */ T("div", { css: He, children: [
271
+ return /* @__PURE__ */ T("div", { css: Be, children: [
262
272
  l && /* @__PURE__ */ i(
263
273
  S,
264
274
  {
265
275
  icon: !0,
266
276
  variant: "plain",
267
- onClick: () => y(1),
277
+ onClick: () => g(1),
268
278
  disabled: p || t === 1,
269
- style: D,
270
- children: /* @__PURE__ */ i(B, { children: /* @__PURE__ */ i(Le, { size: f }) })
279
+ style: R,
280
+ children: /* @__PURE__ */ i($, { children: /* @__PURE__ */ i(Ae, { size: f }) })
271
281
  }
272
282
  ),
273
283
  /* @__PURE__ */ i(
@@ -275,20 +285,20 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
275
285
  {
276
286
  icon: !0,
277
287
  variant: "plain",
278
- onClick: () => y(t - 1),
288
+ onClick: () => g(t - 1),
279
289
  disabled: p || t === 1,
280
- style: D,
281
- children: /* @__PURE__ */ i(B, { children: /* @__PURE__ */ i(Ee, { size: f }) })
290
+ style: R,
291
+ children: /* @__PURE__ */ i($, { children: /* @__PURE__ */ i(Ee, { size: f }) })
282
292
  }
283
293
  ),
284
- A.map((h, C) => {
294
+ L.map((h, C) => {
285
295
  if (typeof h == "string" && h.startsWith("ellipsis"))
286
296
  return /* @__PURE__ */ i(
287
297
  S,
288
298
  {
289
299
  variant: "plain",
290
300
  disabled: !0,
291
- style: $e,
301
+ style: Fe,
292
302
  children: "..."
293
303
  },
294
304
  `${h}-${C}`
@@ -298,9 +308,9 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
298
308
  S,
299
309
  {
300
310
  variant: s ? "solid" : "plain",
301
- onClick: () => y(h),
311
+ onClick: () => g(h),
302
312
  disabled: p,
303
- style: s ? Fe : pe,
313
+ style: s ? He : pe,
304
314
  children: h
305
315
  },
306
316
  h
@@ -311,10 +321,10 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
311
321
  {
312
322
  icon: !0,
313
323
  variant: "plain",
314
- onClick: () => y(t + 1),
324
+ onClick: () => g(t + 1),
315
325
  disabled: p || t === e,
316
- style: D,
317
- children: /* @__PURE__ */ i(B, { children: /* @__PURE__ */ i(we, { size: f }) })
326
+ style: R,
327
+ children: /* @__PURE__ */ i($, { children: /* @__PURE__ */ i(we, { size: f }) })
318
328
  }
319
329
  ),
320
330
  u && /* @__PURE__ */ i(
@@ -322,19 +332,19 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
322
332
  {
323
333
  icon: !0,
324
334
  variant: "plain",
325
- onClick: () => y(e),
335
+ onClick: () => g(e),
326
336
  disabled: p || t === e,
327
- style: D,
328
- children: /* @__PURE__ */ i(B, { children: /* @__PURE__ */ i(Ie, { size: f }) })
337
+ style: R,
338
+ children: /* @__PURE__ */ i($, { children: /* @__PURE__ */ i(Ie, { size: f }) })
329
339
  }
330
340
  )
331
341
  ] });
332
- }, H = "ALL", k = (e) => ({
342
+ }, B = "ALL", k = (e) => ({
333
343
  currentPage: e.currentPage,
334
344
  totalPages: e.numberOfPages,
335
345
  totalItems: e.totalItems,
336
346
  itemsPerPage: e.itemsPerPage
337
- }), q = (e) => e.map((t) => ({
347
+ }), J = (e) => e.map((t) => ({
338
348
  position: t.position,
339
349
  profileId: t.profileId,
340
350
  profileModel: t.profileModel,
@@ -377,14 +387,14 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
377
387
  var l;
378
388
  return {
379
389
  id: r.id,
380
- title: r.title || r.name,
390
+ title: r.title || r.name || r.id,
381
391
  description: r.description || null,
382
392
  branding: ((l = r.branding) == null ? void 0 : l.colors) || null
383
393
  };
384
394
  }), Ge = async (e, t, n, o, r) => {
385
395
  const l = await t.loyalty.getLeaderboardForGame(e, { page: n, limit: o }, r);
386
396
  return {
387
- leaderboard: q(l.data),
397
+ leaderboard: J(l.data),
388
398
  pagination: k(l.meta.pagination)
389
399
  };
390
400
  }, je = async (e, t, n, o, r) => {
@@ -394,7 +404,7 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
394
404
  r
395
405
  );
396
406
  return {
397
- leaderboard: q(l.data),
407
+ leaderboard: J(l.data),
398
408
  pagination: k(l.meta.pagination)
399
409
  };
400
410
  }, V = async (e, t, n, o, r) => {
@@ -403,7 +413,7 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
403
413
  r
404
414
  );
405
415
  return {
406
- leaderboard: q(l.data),
416
+ leaderboard: J(l.data),
407
417
  pagination: k(l.meta.pagination)
408
418
  };
409
419
  }, le = (e, t, n, o, r) => {
@@ -416,12 +426,12 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
416
426
  r
417
427
  );
418
428
  }, Xe = async (e, t, n, o, r) => {
419
- const u = n.toUpperCase() === "TEMPLATE" ? { rankType: "TEMPLATE", leaderboardIds: [e] } : { rankType: "GAME", gameType: n.toUpperCase(), leaderboardIds: [e] }, y = (await t.loyalty.getOwnRankings(u, r)).data[0] ?? null;
420
- return y ? {
421
- position: y.position,
429
+ const u = n.toUpperCase() === "TEMPLATE" ? { rankType: "TEMPLATE", leaderboardIds: [e] } : { rankType: "GAME", gameType: n.toUpperCase(), leaderboardIds: [e] }, g = (await t.loyalty.getOwnRankings(u, r)).data[0] ?? null;
430
+ return g ? {
431
+ position: g.position,
422
432
  profileId: o,
423
433
  profileModel: null,
424
- points: y.points
434
+ points: g.points
425
435
  } : null;
426
436
  }, Ze = async (e, t, n, o) => {
427
437
  const u = (await t.miniGames.getClassicQuizzesUserRanking(
@@ -445,10 +455,10 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
445
455
  o
446
456
  ) : Ze(e.id, t, n, o);
447
457
  }, Ve = (e, t, n, o = 10) => {
448
- const [r, l] = z({}), [u, c] = z(null), [p, y] = z(!1), [E, P] = z(!1), [A, f] = z(
458
+ const [r, l] = z({}), [u, c] = z(null), [p, g] = z(!1), [E, P] = z(!1), [L, f] = z(
449
459
  null
450
460
  ), [h, C] = z(null), s = Pe();
451
- F(() => {
461
+ H(() => {
452
462
  const d = {
453
463
  topX: e.filter((a) => a.type.toUpperCase() === "TOP_X").map((a) => a.id),
454
464
  matchQuiz: e.filter((a) => a.type.toUpperCase() === "MATCH_QUIZ").map((a) => a.id),
@@ -466,23 +476,23 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
466
476
  m[I.id] = I;
467
477
  }), l(m);
468
478
  });
469
- }, [e, t, s]), F(() => {
479
+ }, [e, t, s]), H(() => {
470
480
  We(t).then(f);
471
- }, [t]), F(() => {
472
- if (!n || !A) {
481
+ }, [t]), H(() => {
482
+ if (!n || !L) {
473
483
  C(null);
474
484
  return;
475
485
  }
476
486
  let d = !1, b;
477
- if (n === H) {
487
+ if (n === B) {
478
488
  const a = e.map((m) => m.id);
479
- b = t.miniGames.getClassicQuizzesUserRanking(A.id, void 0, s).then((m) => {
480
- const O = m.data.find((M) => a.includes(M.classicQuizId)) ?? null;
481
- return O ? {
482
- position: O.position,
483
- profileId: A.id,
489
+ b = t.miniGames.getClassicQuizzesUserRanking(L.id, void 0, s).then((m) => {
490
+ const U = m.data.find((M) => a.includes(M.classicQuizId)) ?? null;
491
+ return U ? {
492
+ position: U.position,
493
+ profileId: L.id,
484
494
  profileModel: null,
485
- points: O.points
495
+ points: U.points
486
496
  } : null;
487
497
  });
488
498
  } else {
@@ -491,7 +501,7 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
491
501
  b = Ne(
492
502
  a,
493
503
  t,
494
- A.id,
504
+ L.id,
495
505
  s
496
506
  );
497
507
  }
@@ -502,61 +512,61 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
502
512
  }), () => {
503
513
  d = !0;
504
514
  };
505
- }, [n, e, t, A, s]), F(() => {
515
+ }, [n, e, t, L, s]), H(() => {
506
516
  if (!n) return;
507
517
  let d = !1;
508
- return y(!0), P(!1), c(null), (async () => {
518
+ return g(!0), P(!1), c(null), (async () => {
509
519
  try {
510
- const a = e.length > 1 && e.every((L) => L.type.toUpperCase() === "CLASSIC_QUIZ");
511
- if (n === H && a) {
512
- const L = e.map((he) => he.id), fe = await V(
513
- L,
520
+ const a = e.length > 1 && e.every((A) => A.type.toUpperCase() === "CLASSIC_QUIZ");
521
+ if (n === B && a) {
522
+ const A = e.map((he) => he.id), fe = await V(
523
+ A,
514
524
  t,
515
525
  1,
516
526
  o,
517
527
  s
518
528
  );
519
529
  d || c({
520
- id: H,
521
- title: H,
530
+ id: B,
531
+ title: B,
522
532
  description: null,
523
533
  branding: null,
524
534
  ...fe
525
535
  });
526
536
  return;
527
537
  }
528
- const m = e.find((L) => L.id === n);
538
+ const m = e.find((A) => A.id === n);
529
539
  if (!m) return;
530
- const I = m.type.toUpperCase(), O = I === "TOP_X" ? ne([n], t, s) : I === "MATCH_QUIZ" ? ie([n], t, s) : I === "TEMPLATE" ? oe([n], t, s) : ae([n], t, s), [M, _] = await Promise.all([
540
+ const I = m.type.toUpperCase(), U = I === "TOP_X" ? ne([n], t, s) : I === "MATCH_QUIZ" ? ie([n], t, s) : I === "TEMPLATE" ? oe([n], t, s) : ae([n], t, s), [M, _] = await Promise.all([
531
541
  le(m, t, 1, o, s),
532
- O.catch(() => [])
542
+ U.catch(() => [])
533
543
  ]);
534
544
  if (!d) {
535
- const L = _[0];
545
+ const A = _[0];
536
546
  c({
537
547
  id: n,
538
- title: (L == null ? void 0 : L.title) || n,
539
- description: (L == null ? void 0 : L.description) || null,
540
- branding: (L == null ? void 0 : L.branding) || null,
548
+ title: (A == null ? void 0 : A.title) || n,
549
+ description: (A == null ? void 0 : A.description) || null,
550
+ branding: (A == null ? void 0 : A.branding) || null,
541
551
  ...M
542
552
  });
543
553
  }
544
554
  } catch (a) {
545
555
  console.error("Failed to fetch leaderboard:", a), d || P(!0);
546
556
  } finally {
547
- d || y(!1);
557
+ d || g(!1);
548
558
  }
549
559
  })(), () => {
550
560
  d = !0;
551
561
  };
552
562
  }, [n, e, t, o, s]);
553
- const g = me(
563
+ const y = me(
554
564
  async (d) => {
555
565
  if (n) {
556
- y(!0);
566
+ g(!0);
557
567
  try {
558
568
  let b;
559
- if (n === H) {
569
+ if (n === B) {
560
570
  const a = e.map((m) => m.id);
561
571
  b = await V(
562
572
  a,
@@ -580,7 +590,7 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
580
590
  } catch (b) {
581
591
  console.error("Failed to fetch page:", b);
582
592
  } finally {
583
- y(!1);
593
+ g(!1);
584
594
  }
585
595
  }
586
596
  },
@@ -588,7 +598,7 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
588
598
  ), w = Object.fromEntries(
589
599
  Object.entries(r).map(([d, b]) => [d, b.title])
590
600
  );
591
- return { data: u, entityTitles: w, loading: p, error: E, setPage: g, userRank: h };
601
+ return { data: u, entityTitles: w, loading: p, error: E, setPage: y, userRank: h };
592
602
  }, W = "ALL", Ye = v({
593
603
  display: "flex",
594
604
  flexDirection: "column",
@@ -613,7 +623,7 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
613
623
  return `Entity at index ${o} has an invalid type '${r.type}'. Valid values are: ${se.join(", ")} (case-insensitive).`;
614
624
  }
615
625
  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;
616
- }, qe = ({
626
+ }, Je = ({
617
627
  entities: e,
618
628
  sdk: t,
619
629
  pageSize: n,
@@ -621,18 +631,18 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
621
631
  showOverallOnly: r = !1,
622
632
  showHeading: l = !0
623
633
  }) => {
624
- var O;
634
+ var U;
625
635
  const { t: u } = Y(), c = Q(
626
636
  () => ke(e, n),
627
637
  [e, n]
628
638
  ), p = Q(
629
639
  () => !c && e.length > 1 && e.every((M) => M.type.toUpperCase() === "CLASSIC_QUIZ"),
630
640
  [e, c]
631
- ), y = r && p, E = p ? W : ((O = e[0]) == null ? void 0 : O.id) || "", [P, A] = z(E);
632
- F(() => {
633
- P === W || e.some((_) => _.id === P) || A(E);
641
+ ), g = r && p, E = p ? W : ((U = e[0]) == null ? void 0 : U.id) || "", [P, L] = z(E);
642
+ H(() => {
643
+ P === W || e.some((_) => _.id === P) || L(E);
634
644
  }, [e]);
635
- const { data: f, entityTitles: h, loading: C, error: s, setPage: g, userRank: w } = Ve(
645
+ const { data: f, entityTitles: h, loading: C, error: s, setPage: y, userRank: w } = Ve(
636
646
  c ? [] : e,
637
647
  t,
638
648
  c ? "" : P,
@@ -647,16 +657,16 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
647
657
  type: _.type.toUpperCase()
648
658
  });
649
659
  }), M;
650
- }, [e, p, u, h, c]), b = e.every((M) => h[M.id] !== void 0), a = !c && !y && (e.length > 1 || p) && b, m = (f == null ? void 0 : f.pagination) || null, I = P === W ? u("leaderboard.overall") : (f == null ? void 0 : f.title) || null;
660
+ }, [e, p, u, h, c]), b = e.every((M) => h[M.id] !== void 0), a = !c && !g && (e.length > 1 || p) && b, m = (f == null ? void 0 : f.pagination) || null, I = P === W ? u("leaderboard.overall") : (f == null ? void 0 : f.title) || null;
651
661
  return c ? /* @__PURE__ */ i(
652
- K,
662
+ q,
653
663
  {
654
664
  variant: "error",
655
665
  title: "Configuration Error",
656
666
  message: c
657
667
  }
658
668
  ) : s ? /* @__PURE__ */ i(
659
- K,
669
+ q,
660
670
  {
661
671
  variant: "error",
662
672
  title: "Failed to Load Leaderboard",
@@ -668,7 +678,7 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
668
678
  {
669
679
  options: d,
670
680
  selectedId: P,
671
- onChange: A
681
+ onChange: L
672
682
  }
673
683
  ),
674
684
  /* @__PURE__ */ i(
@@ -684,24 +694,24 @@ const Oe = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
684
694
  }
685
695
  ),
686
696
  !C && m && m.totalPages > 1 && /* @__PURE__ */ i(
687
- Be,
697
+ $e,
688
698
  {
689
699
  count: m.totalPages,
690
700
  page: m.currentPage,
691
- onChange: g
701
+ onChange: y
692
702
  }
693
703
  )
694
704
  ] });
695
- }, Je = (e) => /* @__PURE__ */ i(
705
+ }, Ke = (e) => /* @__PURE__ */ i(
696
706
  ve,
697
707
  {
698
708
  packageName: "leaderboard",
699
709
  language: e.language,
700
710
  themeOptions: e.themeOptions,
701
711
  disableCache: e.disableCache,
702
- children: /* @__PURE__ */ i(qe, { ...e })
712
+ children: /* @__PURE__ */ i(Je, { ...e })
703
713
  }
704
- ), st = Me(Je);
714
+ ), st = Me(Ke);
705
715
  export {
706
716
  st as Leaderboard
707
717
  };