fansunited-frontend-components 0.0.61 → 0.0.63

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 (110) hide show
  1. package/Betslip.d.ts +1 -1
  2. package/Betslip.d.ts.map +1 -1
  3. package/Betslip.js +1 -1
  4. package/ChanceGame.js +28 -27
  5. package/ChanceGameComponent.d.ts +1 -1
  6. package/ChanceGameComponent.d.ts.map +1 -1
  7. package/ClassicQuizPlay.d.ts +1 -1
  8. package/ClassicQuizPlay.d.ts.map +1 -1
  9. package/ClassicQuizPlay.js +23 -22
  10. package/CollectLead.d.ts +1 -1
  11. package/CollectLead.d.ts.map +1 -1
  12. package/CollectLead.js +6 -6
  13. package/Discussion.d.ts +1 -1
  14. package/Discussion.d.ts.map +1 -1
  15. package/Discussion.js +1 -1
  16. package/EitherOrPlay.d.ts +1 -1
  17. package/EitherOrPlay.d.ts.map +1 -1
  18. package/EitherOrPlay.js +27 -25
  19. package/EventCard.d.ts +5 -0
  20. package/EventCard.d.ts.map +1 -0
  21. package/EventGamePlay.d.ts +1 -1
  22. package/EventGamePlay.d.ts.map +1 -1
  23. package/EventGamePlay.js +35 -33
  24. package/Leaderboard.d.ts +1 -1
  25. package/Leaderboard.d.ts.map +1 -1
  26. package/Leaderboard.js +335 -331
  27. package/MatchQuizPlay.d.ts +1 -1
  28. package/MatchQuizPlay.d.ts.map +1 -1
  29. package/MatchQuizPlay.js +30 -28
  30. package/PersonalityQuizPlay.d.ts +1 -1
  31. package/PersonalityQuizPlay.d.ts.map +1 -1
  32. package/PersonalityQuizPlay.js +22 -21
  33. package/PickThePair.js +11 -10
  34. package/PickThePairComponent.d.ts +1 -1
  35. package/PickThePairComponent.d.ts.map +1 -1
  36. package/PollVote.d.ts +1 -1
  37. package/PollVote.d.ts.map +1 -1
  38. package/PollVote.js +20 -19
  39. package/Predictor.d.ts +1 -1
  40. package/Predictor.d.ts.map +1 -1
  41. package/Predictor.js +26 -24
  42. package/README.md +243 -5
  43. package/Standings.d.ts +5 -0
  44. package/Standings.d.ts.map +1 -0
  45. package/Standings.js +1626 -0
  46. package/TopX.js +29 -25
  47. package/chunks/{AlertMessage-BL6P8IGY.js → AlertMessage-AyMEW3JL.js} +17 -17
  48. package/chunks/{ArrowRightAlt-Cv7HlloG.js → ArrowRightAlt-DVXOeIJN.js} +10 -10
  49. package/chunks/{Avatar-DxI6WjFC.js → Avatar-CBP4sabd.js} +8 -8
  50. package/chunks/Button-DOVRR2Sy.js +748 -0
  51. package/chunks/{ChanceGameEmbedVariant-CX6xaIi6.js → ChanceGameEmbedVariant-kBcjiKzu.js} +23 -22
  52. package/chunks/CheckCircle-ByRrHC2p.js +12 -0
  53. package/chunks/Chip-DeEjQ2-F.js +363 -0
  54. package/chunks/{Close-uNT6hIb-.js → Close-CS-wfAnO.js} +1 -1
  55. package/chunks/{Close-BY4UrWwN.js → Close-CdWk2nDh.js} +1 -1
  56. package/chunks/{CollectLeadForm-BGqpL_RS.js → CollectLeadForm-DevgGzsO.js} +1492 -1842
  57. package/chunks/{Divider-BuQemoza.js → Divider-D6QU-XQ5.js} +6 -6
  58. package/chunks/{Edit-Cx3MCmg0.js → Edit-B2N_Ry9g.js} +41 -40
  59. package/chunks/{EmojiEvents-CTkNXSCR.js → EmojiEvents-E7Oqv7rk.js} +1 -1
  60. package/chunks/{FavoriteBorder-ByGJB3_t.js → FavoriteBorder-CguT2h2c.js} +1 -1
  61. package/chunks/{FormControl-BbMcWOns.js → FormControl-D32DP14w.js} +21 -20
  62. package/chunks/{FormLabel-BtT3kbwT.js → FormLabel-BYtvETHS.js} +8 -8
  63. package/chunks/{Input-AE_MIs2X.js → Input-D81KBU9B.js} +9 -9
  64. package/chunks/{KeyboardArrowDown-uQ27mdjR.js → KeyboardArrowDown-CvGmYfHu.js} +3 -3
  65. package/chunks/{ModalDialog-ComYpWek.js → ModalDialog-D63x8ebf.js} +57 -56
  66. package/chunks/{NotFoundSkeleton-CNLtkSd8.js → NotFoundSkeleton-B4r94g0a.js} +90 -88
  67. package/chunks/{Notification-DhQ49EEM.js → Notification-wXJmjBSg.js} +46 -45
  68. package/chunks/{OverlayApiErrorSkeleton-C2rA6QrQ.js → OverlayApiErrorSkeleton-DwV9wIov.js} +29 -28
  69. package/chunks/{OverlayLeadAfterCollection-DTYcL4qZ.js → OverlayLeadAfterCollection-CI5NIwUv.js} +10 -10
  70. package/chunks/{OverlayScoreStateSkeleton-B6gnpmAb.js → OverlayScoreStateSkeleton-wpxvfC5x.js} +10 -10
  71. package/chunks/Person-DvjCrwnY.js +8 -0
  72. package/chunks/{PickOneOfX-0lu9_gyg.js → PickOneOfX-DunXqSn1.js} +211 -210
  73. package/chunks/{Popper-B8ETzmL_.js → Popper-0XuEHl9i.js} +45 -44
  74. package/chunks/{Portal-QyPKLDoD.js → Portal-4mtEzZlO.js} +6 -6
  75. package/chunks/{PrizeCard-C4uB4BtX.js → PrizeCard-CjZXXFx3.js} +4083 -3116
  76. package/chunks/Select-B_VR6iKu.js +1162 -0
  77. package/chunks/{Spinner-DN1WtGKZ.js → Spinner-htM_pA9-.js} +2 -2
  78. package/chunks/{SplitLeadAfterCollection-DciMzUEh.js → SplitLeadAfterCollection-CowadlL1.js} +6 -6
  79. package/chunks/{Stack-CKYSoY8y.js → Stack-BrwF24Ji.js} +19 -19
  80. package/chunks/{StandardContentSkeleton-praFw8d5.js → StandardContentSkeleton-Bk0sSsby.js} +1 -1
  81. package/chunks/{Person-FOtZp8_j.js → Table-OBls_6ml.js} +42 -46
  82. package/chunks/{Tabs-B0X4JiHF.js → Tabs-DW1eIofJ.js} +23 -23
  83. package/chunks/{Textarea-DkNFdAAC.js → Textarea-DDJ2mdR3.js} +10 -9
  84. package/chunks/{TimerOutlined-Dhtg7ugR.js → TimerOutlined-BmAAC-Vi.js} +3 -3
  85. package/chunks/Typography-DjxaMiey.js +1529 -0
  86. package/chunks/areArraysEqual-B3mXtHvh.js +6 -0
  87. package/chunks/{CheckCircle-BdPDdjme.js → createSvgIcon-C-cmTwJ_.js} +44 -51
  88. package/chunks/{helpers-B7ClL9wI.js → helpers-B7-TtMzO.js} +1 -1
  89. package/chunks/index-8rxXfewU.js +4 -0
  90. package/chunks/index-BBrO1Htm.js +845 -0
  91. package/chunks/{index-BRXNdOZ9.js → index-BqoOC2KB.js} +1 -1
  92. package/chunks/{main-Co41z5OJ.js → main-Bgyyz19Z.js} +20 -20
  93. package/chunks/{main-DDbrdN8d.js → main-C8ApxGVj.js} +96 -94
  94. package/chunks/useControlled-BYdyS7Pn.js +31 -0
  95. package/chunks/useEventCallback-BpsnMnDw.js +19 -0
  96. package/chunks/{useForwardedInput-xtVMFYxn.js → useForwardedInput-D2NH4BlT.js} +9 -9
  97. package/chunks/{useImageVariant-y8lhk_d6.js → useImageVariant-qiW-rMPJ.js} +1 -1
  98. package/chunks/variantColorInheritance-Bgtz8MKI.js +1175 -0
  99. package/chunks/{areArraysEqual-DkSw-_2f.js → visuallyHidden-B8J7BVSJ.js} +2 -6
  100. package/components.d.ts +3 -2
  101. package/components.d.ts.map +1 -1
  102. package/index.d.ts +2 -0
  103. package/index.d.ts.map +1 -1
  104. package/index.js +1539 -37
  105. package/package.json +10 -2
  106. package/chunks/Button-B_IYd2Jd.js +0 -2271
  107. package/chunks/Select-U-Jes3gR.js +0 -2327
  108. package/chunks/index-5MPtbA_r.js +0 -706
  109. package/chunks/index-D6dx63al.js +0 -4
  110. package/chunks/useEventCallback-VI3dKPOa.js +0 -47
package/Leaderboard.js CHANGED
@@ -1,116 +1,118 @@
1
1
  import { jsxs as R, jsx as i, Fragment as se } from "react/jsx-runtime";
2
- import L, { useState as z, useEffect as F, useCallback as pe, useMemo as k } from "react";
3
- import { u as D, g as fe, C as me, q as he, b as X, c as ce, d as O, f as G, B as I, a as de, k as ge, n as be, z as ye, A as xe, D as Ce, E as ve, F as Te } from "./chunks/PrizeCard-C4uB4BtX.js";
4
- import { a as J } from "./chunks/AlertMessage-BL6P8IGY.js";
2
+ import z, { useState as B, useEffect as Q, useCallback as pe, useMemo as _ } from "react";
3
+ import { u as D, m as fe, n as me, w as he, a as X, c as ce, b as O, e as j, B as L, j as de, q as ge, i as be, f as ye, C as xe, g as Ce, E as ve, h as Te } from "./chunks/PrizeCard-CjZXXFx3.js";
4
+ import { a as J } from "./chunks/AlertMessage-AyMEW3JL.js";
5
5
  import { createPortal as Pe } from "react-dom";
6
- import { F as Se } from "./chunks/FormLabel-BtT3kbwT.js";
7
- import { T as A, I as $, B as K } from "./chunks/Button-B_IYd2Jd.js";
8
- import { S as we, a as Re } from "./chunks/Select-U-Jes3gR.js";
9
- import { S as Ee, T as Ae, P as ee } from "./chunks/Person-FOtZp8_j.js";
10
- import { h as M, s as Ie } from "./chunks/helpers-B7ClL9wI.js";
11
- import { S as Le } from "./chunks/Spinner-DN1WtGKZ.js";
12
- import { A as te } from "./chunks/Avatar-DxI6WjFC.js";
13
- import { C as ze, a as Me } from "./chunks/chevrons-right-CRIN5sOe.js";
6
+ import { F as Se } from "./chunks/FormLabel-BYtvETHS.js";
7
+ import { T as I } from "./chunks/Typography-DjxaMiey.js";
8
+ import { S as we, a as Re } from "./chunks/Select-B_VR6iKu.js";
9
+ import { P as K } from "./chunks/Person-DvjCrwnY.js";
10
+ import { h as U, s as Ee } from "./chunks/helpers-B7-TtMzO.js";
11
+ import { S as Ae } from "./chunks/Spinner-htM_pA9-.js";
12
+ import { S as Ie, T as Le } from "./chunks/Table-OBls_6ml.js";
13
+ import { A as ee } from "./chunks/Avatar-CBP4sabd.js";
14
+ import { I as H, B as te } from "./chunks/Button-DOVRR2Sy.js";
15
+ import { C as Me, a as ze } from "./chunks/chevrons-right-CRIN5sOe.js";
14
16
  import { C as Be, a as Fe } from "./chunks/chevron-right-B3IZtaMT.js";
15
17
  const Ue = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()).join(" "), $e = ({
16
18
  options: e,
17
19
  selectedId: t,
18
20
  onChange: a
19
21
  }) => {
20
- const { t: r } = D(), { shadowRootElement: o } = fe(me), g = he(), y = X(), c = ce(), d = O().primary, x = G(), v = y.textColor, f = {
22
+ const { t: r } = D(), { shadowRootElement: o } = fe(me), b = he(), y = X(), d = ce(), c = O().primary, h = j(), v = y.textColor, u = {
21
23
  background: {
22
- surface: g.colorSchemes.light.palette.background.surface,
23
- popup: g.colorSchemes.light.palette.background.popup
24
+ surface: b.colorSchemes.light.palette.background.surface,
25
+ popup: b.colorSchemes.light.palette.background.popup
24
26
  },
25
27
  neutral: {
26
- outlinedBorder: g.colorSchemes.light.palette.neutral.outlinedBorder,
27
- outlinedColor: g.colorSchemes.light.palette.neutral.outlinedColor,
28
- outlinedHoverBg: g.colorSchemes.light.palette.neutral.outlinedHoverBg,
29
- plainActiveBg: g.colorSchemes.light.palette.neutral.plainActiveBg,
30
- plainHoverBg: g.colorSchemes.light.palette.neutral.plainHoverBg,
31
- plainHoverColor: g.colorSchemes.light.palette.neutral.plainHoverColor
28
+ outlinedBorder: b.colorSchemes.light.palette.neutral.outlinedBorder,
29
+ outlinedColor: b.colorSchemes.light.palette.neutral.outlinedColor,
30
+ outlinedHoverBg: b.colorSchemes.light.palette.neutral.outlinedHoverBg,
31
+ plainActiveBg: b.colorSchemes.light.palette.neutral.plainActiveBg,
32
+ plainHoverBg: b.colorSchemes.light.palette.neutral.plainHoverBg,
33
+ plainHoverColor: b.colorSchemes.light.palette.neutral.plainHoverColor
32
34
  }
33
- }, u = {
35
+ }, x = {
34
36
  flexShrink: 0,
35
- fontFamily: d,
37
+ fontFamily: c,
36
38
  fontSize: "0.65em",
37
39
  fontWeight: 600,
38
40
  letterSpacing: "0.05em",
39
41
  textTransform: "uppercase",
40
- color: f.neutral.outlinedColor,
41
- bgcolor: f.neutral.plainHoverBg,
42
- border: `1px solid ${f.neutral.outlinedBorder}`,
43
- borderRadius: c.sm,
44
- px: x["2xs"],
45
- py: x["3xs"]
42
+ color: u.neutral.outlinedColor,
43
+ bgcolor: u.neutral.plainHoverBg,
44
+ border: `1px solid ${u.neutral.outlinedBorder}`,
45
+ borderRadius: d.sm,
46
+ px: h["2xs"],
47
+ py: h["3xs"]
46
48
  }, E = (C) => /* @__PURE__ */ R(
47
- I,
49
+ L,
48
50
  {
49
51
  sx: {
50
52
  display: "flex",
51
53
  alignItems: "center",
52
54
  justifyContent: "space-between",
53
55
  width: "100%",
54
- gap: x.sm
56
+ gap: h.sm
55
57
  },
56
58
  children: [
57
59
  /* @__PURE__ */ i("span", { children: C.label }),
58
- C.type && /* @__PURE__ */ i(I, { sx: u, children: Ue(C.type) })
60
+ C.type && /* @__PURE__ */ i(L, { sx: x, children: Ue(C.type) })
59
61
  ]
60
62
  }
61
- ), P = {
63
+ ), w = {
62
64
  root: {
63
65
  sx: {
64
- fontFamily: d,
65
- borderRadius: c.sm,
66
- bgcolor: f.background.surface,
67
- borderColor: f.neutral.outlinedBorder,
68
- color: f.neutral.outlinedColor,
66
+ fontFamily: c,
67
+ borderRadius: d.sm,
68
+ bgcolor: u.background.surface,
69
+ borderColor: u.neutral.outlinedBorder,
70
+ color: u.neutral.outlinedColor,
69
71
  fontSize: "1em",
70
- "&:hover": { bgcolor: f.neutral.outlinedHoverBg }
72
+ "&:hover": { bgcolor: u.neutral.outlinedHoverBg }
71
73
  }
72
74
  },
73
75
  listbox: {
74
76
  container: o,
75
77
  sx: {
76
78
  zIndex: 10,
77
- bgcolor: f.background.popup,
78
- border: `1px solid ${f.neutral.outlinedBorder}`,
79
- borderRadius: c.sm,
79
+ bgcolor: u.background.popup,
80
+ border: `1px solid ${u.neutral.outlinedBorder}`,
81
+ borderRadius: d.sm,
80
82
  boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1)"
81
83
  }
82
84
  }
83
- }, S = {
84
- fontFamily: d,
85
- color: `${f.neutral.outlinedColor} !important`,
85
+ }, p = {
86
+ fontFamily: c,
87
+ color: `${u.neutral.outlinedColor} !important`,
86
88
  bgcolor: "transparent",
87
89
  "&:hover": {
88
- bgcolor: `${f.neutral.plainHoverBg} !important`,
89
- color: `${f.neutral.plainHoverColor} !important`
90
+ bgcolor: `${u.neutral.plainHoverBg} !important`,
91
+ color: `${u.neutral.plainHoverColor} !important`
90
92
  },
91
93
  "&.Mui-selected": {
92
- bgcolor: `${f.neutral.plainActiveBg} !important`,
93
- color: `${f.neutral.outlinedColor} !important`
94
+ bgcolor: `${u.neutral.plainActiveBg} !important`,
95
+ color: `${u.neutral.outlinedColor} !important`
94
96
  },
95
97
  "&.Mui-selected:hover": {
96
- bgcolor: `${f.neutral.plainActiveBg} !important`,
97
- color: `${f.neutral.outlinedColor} !important`
98
+ bgcolor: `${u.neutral.plainActiveBg} !important`,
99
+ color: `${u.neutral.outlinedColor} !important`
98
100
  }
99
101
  };
100
- return /* @__PURE__ */ R(I, { sx: { display: "flex", flexDirection: "column", gap: x["2xs"] }, children: [
102
+ return /* @__PURE__ */ R(L, { sx: { display: "flex", flexDirection: "column", gap: h["2xs"] }, children: [
101
103
  /* @__PURE__ */ i(
102
104
  Se,
103
105
  {
104
106
  sx: {
105
107
  color: `${v} !important`,
106
- fontFamily: d,
108
+ fontFamily: c,
107
109
  fontSize: "0.875em"
108
110
  },
109
111
  children: /* @__PURE__ */ i(
110
- A,
112
+ I,
111
113
  {
112
114
  sx: {
113
- fontFamily: d,
115
+ fontFamily: c,
114
116
  fontSize: "0.875em",
115
117
  color: v
116
118
  },
@@ -123,14 +125,14 @@ const Ue = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
123
125
  we,
124
126
  {
125
127
  value: t,
126
- onChange: (C, w) => w && a(w),
127
- slotProps: P,
128
+ onChange: (C, P) => P && a(P),
129
+ slotProps: w,
128
130
  renderValue: (C) => {
129
131
  if (!C) return null;
130
- const w = e.find((m) => m.id === C.value);
131
- return w ? E(w) : C.label;
132
+ const P = e.find((f) => f.id === C.value);
133
+ return P ? E(P) : C.label;
132
134
  },
133
- children: e.map((C) => /* @__PURE__ */ i(Re, { value: C.id, sx: S, children: E(C) }, C.id))
135
+ children: e.map((C) => /* @__PURE__ */ i(Re, { value: C.id, sx: p, children: E(C) }, C.id))
134
136
  }
135
137
  )
136
138
  ] });
@@ -140,29 +142,29 @@ const Ue = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
140
142
  showHeading: a,
141
143
  title: r,
142
144
  description: o,
143
- isSplitVariant: g,
145
+ isSplitVariant: b,
144
146
  brandingColors: y,
145
- rankStyles: c
147
+ rankStyles: d
146
148
  }) => {
147
- const { t: d } = D(), x = de(), v = X(), f = (y == null ? void 0 : y.primaryColor) || v.palette.primary.plainColor, u = (y == null ? void 0 : y.contentColor) || v.textColor, E = v.textColor, P = O().primary, S = O().secondary, C = ce(), w = G(), m = ge(), l = v.surfaceVariant, n = x.colorSchemes.light.palette.primary.onPrimary, p = v.outlineEnabledBorder, s = {
149
+ const { t: c } = D(), h = de(), v = X(), u = (y == null ? void 0 : y.primaryColor) || v.palette.primary.plainColor, x = (y == null ? void 0 : y.contentColor) || v.textColor, E = v.textColor, w = O().primary, p = O().secondary, C = ce(), P = j(), f = ge(), l = v.surfaceVariant, n = h.colorSchemes.light.palette.primary.onPrimary, m = v.outlineEnabledBorder, s = {
148
150
  leaderboardContainer: {
149
151
  display: "flex",
150
152
  flexDirection: "column",
151
- gap: w.md
153
+ gap: P.md
152
154
  },
153
155
  leaderboardTitle: {
154
- fontFamily: P,
156
+ fontFamily: w,
155
157
  fontWeight: 700,
156
158
  lineHeight: "133%",
157
159
  letterSpacing: "0px",
158
160
  fontSize: "1.5em",
159
- color: u,
161
+ color: x,
160
162
  textAlign: "center"
161
163
  },
162
164
  tableContainer: {
163
165
  overflowX: "auto",
164
166
  borderRadius: C.md,
165
- border: `1px solid ${p}`
167
+ border: `1px solid ${m}`
166
168
  },
167
169
  table: {
168
170
  backgroundColor: l,
@@ -173,19 +175,19 @@ const Ue = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
173
175
  backgroundColor: "transparent"
174
176
  },
175
177
  "& > thead > tr > th": {
176
- backgroundColor: `rgba(${M(l)}, 0.8)`,
177
- color: u,
178
- fontFamily: P,
178
+ backgroundColor: `rgba(${U(l)}, 0.8)`,
179
+ color: x,
180
+ fontFamily: w,
179
181
  fontWeight: 600,
180
182
  fontSize: "0.875em",
181
183
  textAlign: "center",
182
- borderBottom: `1px solid ${p}`
184
+ borderBottom: `1px solid ${m}`
183
185
  }
184
186
  },
185
187
  headerCellPosition: {
186
- backgroundColor: `rgba(${M(l)}, 0.8)`,
187
- color: u,
188
- fontFamily: P,
188
+ backgroundColor: `rgba(${U(l)}, 0.8)`,
189
+ color: x,
190
+ fontFamily: w,
189
191
  fontWeight: 600,
190
192
  fontSize: "0.875em",
191
193
  textAlign: "center",
@@ -193,9 +195,9 @@ const Ue = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
193
195
  width: "10%"
194
196
  },
195
197
  headerCellName: {
196
- backgroundColor: `rgba(${M(l)}, 0.8)`,
197
- color: u,
198
- fontFamily: P,
198
+ backgroundColor: `rgba(${U(l)}, 0.8)`,
199
+ color: x,
200
+ fontFamily: w,
199
201
  fontWeight: 600,
200
202
  fontSize: "0.875em",
201
203
  textAlign: "left",
@@ -203,9 +205,9 @@ const Ue = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
203
205
  width: "80%"
204
206
  },
205
207
  headerCellPoints: {
206
- backgroundColor: `rgba(${M(l)}, 0.8)`,
207
- color: u,
208
- fontFamily: P,
208
+ backgroundColor: `rgba(${U(l)}, 0.8)`,
209
+ color: x,
210
+ fontFamily: w,
209
211
  fontWeight: 600,
210
212
  fontSize: "0.875em",
211
213
  textAlign: "center",
@@ -227,62 +229,62 @@ const Ue = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
227
229
  textAlign: "center"
228
230
  },
229
231
  userRow: {
230
- backgroundColor: `rgba(${M(f)}, 0.1)`
232
+ backgroundColor: `rgba(${U(u)}, 0.1)`
231
233
  },
232
234
  nameCell: {
233
235
  display: "flex",
234
236
  alignItems: "center",
235
- gap: w.sm
237
+ gap: P.sm
236
238
  },
237
239
  leaderboardAvatar: {
238
240
  width: "32px",
239
241
  height: "32px",
240
242
  fontSize: "0.875em",
241
243
  fontWeight: 600,
242
- backgroundColor: f,
244
+ backgroundColor: u,
243
245
  color: n
244
246
  },
245
247
  nameText: {
246
- fontFamily: P,
248
+ fontFamily: w,
247
249
  fontWeight: 500,
248
250
  fontSize: "0.875em",
249
- color: u,
251
+ color: x,
250
252
  overflow: "hidden",
251
253
  textOverflow: "ellipsis",
252
254
  whiteSpace: "nowrap"
253
255
  },
254
256
  positionText: {
255
- fontFamily: P,
257
+ fontFamily: w,
256
258
  fontWeight: 600,
257
259
  fontSize: "0.875em",
258
- color: u
260
+ color: x
259
261
  },
260
262
  pointsText: {
261
- fontFamily: P,
263
+ fontFamily: w,
262
264
  fontWeight: 600,
263
265
  fontSize: "0.875em",
264
- color: u
266
+ color: x
265
267
  },
266
268
  avatarIcon: {
267
269
  fontSize: "1em",
268
270
  color: n
269
271
  },
270
272
  noLeaderboardText: {
271
- fontFamily: S,
273
+ fontFamily: p,
272
274
  fontSize: "1.25em",
273
- color: u,
275
+ color: x,
274
276
  textAlign: "center",
275
- marginY: w.md
277
+ marginY: P.md
276
278
  }
277
279
  };
278
280
  if (!e)
279
- return /* @__PURE__ */ i(Le, { my: 10 });
281
+ return /* @__PURE__ */ i(Ae, { my: 10 });
280
282
  if (e.length === 0)
281
- return /* @__PURE__ */ i(A, { level: "body-lg", sx: s.noLeaderboardText, children: d("leaderboard.noLeaderboardAvailable") });
282
- const h = t, T = h == null ? void 0 : h.profileId, Q = T && e.some((b) => b.profileId === T);
283
- return /* @__PURE__ */ R(I, { sx: s.leaderboardContainer, children: [
283
+ return /* @__PURE__ */ i(I, { level: "body-lg", sx: s.noLeaderboardText, children: c("leaderboard.noLeaderboardAvailable") });
284
+ const T = t, S = T == null ? void 0 : T.profileId, F = S && e.some((g) => g.profileId === S);
285
+ return /* @__PURE__ */ R(L, { sx: s.leaderboardContainer, children: [
284
286
  a && /* @__PURE__ */ R(
285
- I,
287
+ L,
286
288
  {
287
289
  sx: {
288
290
  display: "flex",
@@ -292,7 +294,7 @@ const Ue = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
292
294
  },
293
295
  children: [
294
296
  /* @__PURE__ */ i(
295
- A,
297
+ I,
296
298
  {
297
299
  level: "body-sm",
298
300
  sx: {
@@ -303,23 +305,23 @@ const Ue = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
303
305
  fontSize: "0.75em",
304
306
  color: E,
305
307
  opacity: "60%",
306
- fontFamily: S
308
+ fontFamily: p
307
309
  },
308
- children: d("leaderboard.heading")
310
+ children: c("leaderboard.heading")
309
311
  }
310
312
  ),
311
313
  /* @__PURE__ */ R(
312
- I,
314
+ L,
313
315
  {
314
316
  sx: {
315
317
  display: "flex",
316
318
  flexDirection: "column",
317
- gap: w["3xs"]
319
+ gap: P["3xs"]
318
320
  },
319
321
  children: [
320
- r && /* @__PURE__ */ i(A, { level: "h4", sx: s.leaderboardTitle, children: r }),
322
+ r && /* @__PURE__ */ i(I, { level: "h4", sx: s.leaderboardTitle, children: r }),
321
323
  o && /* @__PURE__ */ i(
322
- A,
324
+ I,
323
325
  {
324
326
  sx: {
325
327
  fontWeight: 400,
@@ -328,9 +330,9 @@ const Ue = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
328
330
  fontSize: "1.25em",
329
331
  color: E,
330
332
  opacity: "60%",
331
- fontFamily: P
333
+ fontFamily: w
332
334
  },
333
- children: Ie(o)
335
+ children: Ee(o)
334
336
  }
335
337
  )
336
338
  ]
@@ -339,8 +341,8 @@ const Ue = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
339
341
  ]
340
342
  }
341
343
  ),
342
- /* @__PURE__ */ i(Ee, { sx: s.tableContainer, children: /* @__PURE__ */ R(
343
- Ae,
344
+ /* @__PURE__ */ i(Ie, { sx: s.tableContainer, children: /* @__PURE__ */ R(
345
+ Le,
344
346
  {
345
347
  variant: "outlined",
346
348
  hoverRow: !1,
@@ -349,43 +351,43 @@ const Ue = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
349
351
  sx: s.table,
350
352
  children: [
351
353
  /* @__PURE__ */ i("thead", { children: /* @__PURE__ */ R("tr", { children: [
352
- /* @__PURE__ */ i("th", { style: s.headerCellPosition, children: m || g ? "" : d("leaderboard.position") }),
353
- /* @__PURE__ */ i("th", { style: s.headerCellName, children: d("leaderboard.name") }),
354
- /* @__PURE__ */ i("th", { style: s.headerCellPoints, children: m || g ? "🎯" : d("leaderboard.points") })
354
+ /* @__PURE__ */ i("th", { style: s.headerCellPosition, children: f || b ? "" : c("leaderboard.position") }),
355
+ /* @__PURE__ */ i("th", { style: s.headerCellName, children: c("leaderboard.name") }),
356
+ /* @__PURE__ */ i("th", { style: s.headerCellPoints, children: f || b ? "🎯" : c("leaderboard.points") })
355
357
  ] }) }),
356
358
  /* @__PURE__ */ R("tbody", { children: [
357
- h && !Q && /* @__PURE__ */ R("tr", { style: s.userRow, children: [
358
- /* @__PURE__ */ i("td", { style: s.tableCellPosition, children: /* @__PURE__ */ R(A, { sx: s.positionText, children: [
359
+ T && !F && /* @__PURE__ */ R("tr", { style: s.userRow, children: [
360
+ /* @__PURE__ */ i("td", { style: s.tableCellPosition, children: /* @__PURE__ */ R(I, { sx: s.positionText, children: [
359
361
  "#",
360
- h.position
362
+ T.position
361
363
  ] }) }),
362
- /* @__PURE__ */ i("td", { style: s.tableCellName, children: /* @__PURE__ */ R(I, { sx: s.nameCell, children: [
363
- /* @__PURE__ */ i(te, { sx: s.leaderboardAvatar, children: /* @__PURE__ */ i(ee, { sx: s.avatarIcon }) }),
364
- /* @__PURE__ */ i(A, { sx: s.nameText, children: d("leaderboard.you") })
364
+ /* @__PURE__ */ i("td", { style: s.tableCellName, children: /* @__PURE__ */ R(L, { sx: s.nameCell, children: [
365
+ /* @__PURE__ */ i(ee, { sx: s.leaderboardAvatar, children: /* @__PURE__ */ i(K, { sx: s.avatarIcon }) }),
366
+ /* @__PURE__ */ i(I, { sx: s.nameText, children: c("leaderboard.you") })
365
367
  ] }) }),
366
- /* @__PURE__ */ i("td", { style: s.tableCellPoints, children: /* @__PURE__ */ i(A, { sx: s.pointsText, children: h.points }) })
368
+ /* @__PURE__ */ i("td", { style: s.tableCellPoints, children: /* @__PURE__ */ i(I, { sx: s.pointsText, children: T.points }) })
367
369
  ] }),
368
- e.map((b, H) => {
370
+ e.map((g, A) => {
369
371
  var N, V, Y, q;
370
- const U = T === b.profileId, ue = U ? s.userRow : c == null ? void 0 : c[H + 1];
372
+ const M = S === g.profileId, ue = M ? s.userRow : d == null ? void 0 : d[A + 1];
371
373
  return /* @__PURE__ */ R("tr", { style: ue, children: [
372
- /* @__PURE__ */ i("td", { style: s.tableCellPosition, children: /* @__PURE__ */ R(A, { sx: s.positionText, children: [
374
+ /* @__PURE__ */ i("td", { style: s.tableCellPosition, children: /* @__PURE__ */ R(I, { sx: s.positionText, children: [
373
375
  "#",
374
- b.position
376
+ g.position
375
377
  ] }) }),
376
- /* @__PURE__ */ i("td", { style: s.tableCellName, children: /* @__PURE__ */ R(I, { sx: s.nameCell, children: [
378
+ /* @__PURE__ */ i("td", { style: s.tableCellName, children: /* @__PURE__ */ R(L, { sx: s.nameCell, children: [
377
379
  /* @__PURE__ */ i(
378
- te,
380
+ ee,
379
381
  {
380
- src: ((N = b.profileModel) == null ? void 0 : N.avatar) || void 0,
382
+ src: ((N = g.profileModel) == null ? void 0 : N.avatar) || void 0,
381
383
  sx: s.leaderboardAvatar,
382
- children: (V = b.profileModel) != null && V.avatar ? /* @__PURE__ */ i(se, {}) : /* @__PURE__ */ i(ee, { sx: s.avatarIcon })
384
+ children: (V = g.profileModel) != null && V.avatar ? /* @__PURE__ */ i(se, {}) : /* @__PURE__ */ i(K, { sx: s.avatarIcon })
383
385
  }
384
386
  ),
385
- /* @__PURE__ */ i(A, { sx: s.nameText, children: U ? d("leaderboard.you") : ((Y = b.profileModel) == null ? void 0 : Y.nickname) || ((q = b.profileModel) == null ? void 0 : q.name) || d("leaderboard.anonymous") })
387
+ /* @__PURE__ */ i(I, { sx: s.nameText, children: M ? c("leaderboard.you") : ((Y = g.profileModel) == null ? void 0 : Y.nickname) || ((q = g.profileModel) == null ? void 0 : q.name) || c("leaderboard.anonymous") })
386
388
  ] }) }),
387
- /* @__PURE__ */ i("td", { style: s.tableCellPoints, children: /* @__PURE__ */ i(A, { sx: s.pointsText, children: b.points }) })
388
- ] }, b.profileId);
389
+ /* @__PURE__ */ i("td", { style: s.tableCellPoints, children: /* @__PURE__ */ i(I, { sx: s.pointsText, children: g.points }) })
390
+ ] }, g.profileId);
389
391
  })
390
392
  ] })
391
393
  ]
@@ -398,33 +400,33 @@ const Ue = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
398
400
  onChange: a,
399
401
  siblingCount: r = 1,
400
402
  boundaryCount: o = 1,
401
- showFirstButton: g = !0,
403
+ showFirstButton: b = !0,
402
404
  showLastButton: y = !0,
403
- size: c = "md",
404
- disabled: d = !1,
405
- isOverlayVariant: x = !1
405
+ size: d = "md",
406
+ disabled: c = !1,
407
+ isOverlayVariant: h = !1
406
408
  }) => {
407
- const v = de(), f = (l) => {
409
+ const v = de(), u = (l) => {
408
410
  a && l >= 1 && l <= e && a(l);
409
- }, u = (l, n) => {
410
- const p = [];
411
- for (let s = l; s <= n; s++) p.push(s);
412
- return p;
413
- }, P = (() => {
411
+ }, x = (l, n) => {
412
+ const m = [];
413
+ for (let s = l; s <= n; s++) m.push(s);
414
+ return m;
415
+ }, w = (() => {
414
416
  if (e <= 0) return [];
415
- const l = u(1, Math.min(o, e)), n = u(
417
+ const l = x(1, Math.min(o, e)), n = x(
416
418
  Math.max(e - o + 1, o + 1),
417
419
  e
418
- ), p = Math.max(o + 1, t - r), s = Math.min(e - o, t + r), h = [...l];
419
- if (p > o + 1 && h.push("ellipsis-start"), p <= s)
420
- for (let T = p; T <= s; T++)
421
- h.push(T);
422
- s < e - o && h.push("ellipsis-end");
423
- for (const T of n)
424
- h.includes(T) || h.push(T);
425
- return h;
426
- })(), S = c === "sm" ? "sm" : c === "lg" ? "lg" : "md", C = c === "sm" ? 16 : c === "lg" ? 24 : 20, w = (l = !1) => {
427
- if (!x)
420
+ ), m = Math.max(o + 1, t - r), s = Math.min(e - o, t + r), T = [...l];
421
+ if (m > o + 1 && T.push("ellipsis-start"), m <= s)
422
+ for (let S = m; S <= s; S++)
423
+ T.push(S);
424
+ s < e - o && T.push("ellipsis-end");
425
+ for (const S of n)
426
+ T.includes(S) || T.push(S);
427
+ return T;
428
+ })(), p = d === "sm" ? "sm" : d === "lg" ? "lg" : "md", C = d === "sm" ? 16 : d === "lg" ? 24 : 20, P = (l = !1) => {
429
+ if (!h)
428
430
  return {
429
431
  borderRadius: "8px",
430
432
  minWidth: "32px",
@@ -453,8 +455,8 @@ const Ue = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
453
455
  opacity: 0.5
454
456
  }
455
457
  };
456
- }, m = () => {
457
- if (!x)
458
+ }, f = () => {
459
+ if (!h)
458
460
  return {
459
461
  borderRadius: "8px",
460
462
  minWidth: "32px",
@@ -483,7 +485,7 @@ const Ue = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
483
485
  };
484
486
  };
485
487
  return /* @__PURE__ */ R(
486
- I,
488
+ L,
487
489
  {
488
490
  sx: {
489
491
  display: "flex",
@@ -492,43 +494,43 @@ const Ue = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
492
494
  flexWrap: "wrap"
493
495
  },
494
496
  children: [
495
- g && /* @__PURE__ */ i(
496
- $,
497
+ b && /* @__PURE__ */ i(
498
+ H,
497
499
  {
498
- size: S,
500
+ size: p,
499
501
  variant: "plain",
500
502
  color: "neutral",
501
- onClick: () => f(1),
502
- disabled: d || t === 1,
503
- sx: m(),
504
- children: /* @__PURE__ */ i(ze, { size: C })
503
+ onClick: () => u(1),
504
+ disabled: c || t === 1,
505
+ sx: f(),
506
+ children: /* @__PURE__ */ i(Me, { size: C })
505
507
  }
506
508
  ),
507
509
  /* @__PURE__ */ i(
508
- $,
510
+ H,
509
511
  {
510
- size: S,
512
+ size: p,
511
513
  variant: "plain",
512
514
  color: "neutral",
513
- onClick: () => f(t - 1),
514
- disabled: d || t === 1,
515
- sx: m(),
515
+ onClick: () => u(t - 1),
516
+ disabled: c || t === 1,
517
+ sx: f(),
516
518
  children: /* @__PURE__ */ i(Be, { size: C })
517
519
  }
518
520
  ),
519
- P.map((l, n) => {
521
+ w.map((l, n) => {
520
522
  if (typeof l == "string" && l.startsWith("ellipsis"))
521
523
  return /* @__PURE__ */ i(
522
- K,
524
+ te,
523
525
  {
524
- size: S,
526
+ size: p,
525
527
  variant: "plain",
526
528
  color: "neutral",
527
529
  disabled: !0,
528
530
  sx: {
529
- ...w(!1),
531
+ ...P(!1),
530
532
  cursor: "default",
531
- "&.Mui-disabled": x ? {
533
+ "&.Mui-disabled": h ? {
532
534
  backgroundColor: "transparent",
533
535
  color: v.colorSchemes.dark.textDisabled,
534
536
  opacity: 0.5
@@ -541,49 +543,49 @@ const Ue = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
541
543
  },
542
544
  `${l}-${n}`
543
545
  );
544
- const p = l === t;
546
+ const m = l === t;
545
547
  return /* @__PURE__ */ i(
546
- K,
548
+ te,
547
549
  {
548
- size: S,
549
- variant: p ? "solid" : "plain",
550
+ size: p,
551
+ variant: m ? "solid" : "plain",
550
552
  color: "neutral",
551
- onClick: () => f(l),
552
- disabled: d,
553
- sx: w(p),
553
+ onClick: () => u(l),
554
+ disabled: c,
555
+ sx: P(m),
554
556
  children: l
555
557
  },
556
558
  l
557
559
  );
558
560
  }),
559
561
  /* @__PURE__ */ i(
560
- $,
562
+ H,
561
563
  {
562
- size: S,
564
+ size: p,
563
565
  variant: "plain",
564
566
  color: "neutral",
565
- onClick: () => f(t + 1),
566
- disabled: d || t === e,
567
- sx: m(),
567
+ onClick: () => u(t + 1),
568
+ disabled: c || t === e,
569
+ sx: f(),
568
570
  children: /* @__PURE__ */ i(Fe, { size: C })
569
571
  }
570
572
  ),
571
573
  y && /* @__PURE__ */ i(
572
- $,
574
+ H,
573
575
  {
574
- size: S,
576
+ size: p,
575
577
  variant: "plain",
576
578
  color: "neutral",
577
- onClick: () => f(e),
578
- disabled: d || t === e,
579
- sx: m(),
580
- children: /* @__PURE__ */ i(Me, { size: C })
579
+ onClick: () => u(e),
580
+ disabled: c || t === e,
581
+ sx: f(),
582
+ children: /* @__PURE__ */ i(ze, { size: C })
581
583
  }
582
584
  )
583
585
  ]
584
586
  }
585
587
  );
586
- }, B = "ALL", j = (e) => ({
588
+ }, $ = "ALL", G = (e) => ({
587
589
  currentPage: e.currentPage,
588
590
  totalPages: e.numberOfPages,
589
591
  totalItems: e.totalItems,
@@ -638,7 +640,7 @@ const Ue = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
638
640
  const o = await t.loyalty.getLeaderboardForGame(e, { page: a, limit: r });
639
641
  return {
640
642
  leaderboard: Z(o.data),
641
- pagination: j(o.meta.pagination)
643
+ pagination: G(o.meta.pagination)
642
644
  };
643
645
  }, Oe = async (e, t, a, r) => {
644
646
  const o = await t.loyalty.getLeaderboard(
@@ -647,7 +649,7 @@ const Ue = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
647
649
  );
648
650
  return {
649
651
  leaderboard: Z(o.data),
650
- pagination: j(o.meta.pagination)
652
+ pagination: G(o.meta.pagination)
651
653
  };
652
654
  }, W = async (e, t, a, r) => {
653
655
  const o = await t.miniGames.getLeaderboardForClassicQuizzes({
@@ -657,162 +659,162 @@ const Ue = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
657
659
  });
658
660
  return {
659
661
  leaderboard: Z(o.data),
660
- pagination: j(o.meta.pagination)
662
+ pagination: G(o.meta.pagination)
661
663
  };
662
664
  }, le = (e, t, a, r) => {
663
665
  const o = e.type.toUpperCase();
664
666
  return o === "TOP_X" || o === "MATCH_QUIZ" ? _e(e.id, t, a, r) : o === "TEMPLATE" ? Oe(e.id, t, a, r) : W([e.id], t, a, r);
665
667
  }, We = async (e, t, a) => {
666
- const o = a.toUpperCase() === "TEMPLATE" ? { rankType: "TEMPLATE", leaderboardIds: [e] } : { rankType: "GAME", gameType: a.toUpperCase(), leaderboardIds: [e] }, c = (await t.loyalty.getOwnRankings(o, !0)).data[0] ?? null;
667
- return c ? {
668
- position: c.position,
669
- profileId: c.profileId,
670
- profileModel: c.profileModel,
671
- points: c.points
668
+ const o = a.toUpperCase() === "TEMPLATE" ? { rankType: "TEMPLATE", leaderboardIds: [e] } : { rankType: "GAME", gameType: a.toUpperCase(), leaderboardIds: [e] }, d = (await t.loyalty.getOwnRankings(o, !0)).data[0] ?? null;
669
+ return d ? {
670
+ position: d.position,
671
+ profileId: d.profileId,
672
+ profileModel: d.profileModel,
673
+ points: d.points
672
674
  } : null;
673
675
  }, De = async (e, t, a) => {
674
- const g = (await t.miniGames.getClassicQuizzesUserRanking(
676
+ const b = (await t.miniGames.getClassicQuizzesUserRanking(
675
677
  a,
676
678
  void 0,
677
679
  !0
678
680
  )).data.find((y) => y.classicQuizId === e) ?? null;
679
- return g ? {
680
- position: g.position,
681
+ return b ? {
682
+ position: b.position,
681
683
  profileId: a,
682
684
  profileModel: null,
683
- points: g.points
685
+ points: b.points
684
686
  } : null;
685
687
  }, Xe = (e, t, a) => {
686
688
  const r = e.type.toUpperCase();
687
689
  return r === "TOP_X" || r === "MATCH_QUIZ" || r === "TEMPLATE" ? We(e.id, t, e.type) : De(e.id, t, a);
688
- }, Ge = (e, t, a, r = 10) => {
689
- const [o, g] = z({}), [y, c] = z(null), [d, x] = z(!1), [v, f] = z(!1), [u, E] = z(
690
+ }, je = (e, t, a, r = 10) => {
691
+ const [o, b] = B({}), [y, d] = B(null), [c, h] = B(!1), [v, u] = B(!1), [x, E] = B(
690
692
  null
691
- ), [P, S] = z(null);
692
- F(() => {
693
- const m = {
693
+ ), [w, p] = B(null);
694
+ Q(() => {
695
+ const f = {
694
696
  topX: e.filter((n) => n.type.toUpperCase() === "TOP_X").map((n) => n.id),
695
697
  matchQuiz: e.filter((n) => n.type.toUpperCase() === "MATCH_QUIZ").map((n) => n.id),
696
698
  template: e.filter((n) => n.type.toUpperCase() === "TEMPLATE").map((n) => n.id),
697
699
  classicQuiz: e.filter((n) => n.type.toUpperCase() === "CLASSIC_QUIZ").map((n) => n.id)
698
700
  }, l = (n) => n.catch(() => []);
699
701
  Promise.all([
700
- l(re(m.topX, t)),
701
- l(oe(m.matchQuiz, t)),
702
- l(ne(m.template, t)),
703
- l(ae(m.classicQuiz, t))
702
+ l(re(f.topX, t)),
703
+ l(oe(f.matchQuiz, t)),
704
+ l(ne(f.template, t)),
705
+ l(ae(f.classicQuiz, t))
704
706
  ]).then((n) => {
705
- const p = {};
707
+ const m = {};
706
708
  n.flat().forEach((s) => {
707
- p[s.id] = s;
708
- }), g(p);
709
+ m[s.id] = s;
710
+ }), b(m);
709
711
  });
710
- }, [e, t]), F(() => {
712
+ }, [e, t]), Q(() => {
711
713
  ke(t).then(E);
712
- }, [t]), F(() => {
713
- if (!a || !u) {
714
- S(null);
714
+ }, [t]), Q(() => {
715
+ if (!a || !x) {
716
+ p(null);
715
717
  return;
716
718
  }
717
- let m = !1, l;
718
- if (a === B) {
719
- const n = e.map((p) => p.id);
720
- l = t.miniGames.getClassicQuizzesUserRanking(u.id, void 0, !0).then((p) => {
721
- const h = p.data.find((T) => n.includes(T.classicQuizId)) ?? null;
722
- return h ? {
723
- position: h.position,
724
- profileId: u.id,
719
+ let f = !1, l;
720
+ if (a === $) {
721
+ const n = e.map((m) => m.id);
722
+ l = t.miniGames.getClassicQuizzesUserRanking(x.id, void 0, !0).then((m) => {
723
+ const T = m.data.find((S) => n.includes(S.classicQuizId)) ?? null;
724
+ return T ? {
725
+ position: T.position,
726
+ profileId: x.id,
725
727
  profileModel: null,
726
- points: h.points
728
+ points: T.points
727
729
  } : null;
728
730
  });
729
731
  } else {
730
- const n = e.find((p) => p.id === a);
732
+ const n = e.find((m) => m.id === a);
731
733
  if (!n) return;
732
- l = Xe(n, t, u.id);
734
+ l = Xe(n, t, x.id);
733
735
  }
734
736
  return l.then((n) => {
735
- m || S(n);
737
+ f || p(n);
736
738
  }).catch(() => {
737
- m || S(null);
739
+ f || p(null);
738
740
  }), () => {
739
- m = !0;
741
+ f = !0;
740
742
  };
741
- }, [a, e, t, u]), F(() => {
743
+ }, [a, e, t, x]), Q(() => {
742
744
  if (!a) return;
743
- let m = !1;
744
- return x(!0), f(!1), c(null), (async () => {
745
+ let f = !1;
746
+ return h(!0), u(!1), d(null), (async () => {
745
747
  try {
746
- const n = e.length > 1 && e.every((b) => b.type.toUpperCase() === "CLASSIC_QUIZ");
747
- if (a === B && n) {
748
- const b = e.map((U) => U.id), H = await W(
749
- b,
748
+ const n = e.length > 1 && e.every((g) => g.type.toUpperCase() === "CLASSIC_QUIZ");
749
+ if (a === $ && n) {
750
+ const g = e.map((M) => M.id), A = await W(
751
+ g,
750
752
  t,
751
753
  1,
752
754
  r
753
755
  );
754
- m || c({
755
- id: B,
756
- title: B,
756
+ f || d({
757
+ id: $,
758
+ title: $,
757
759
  description: null,
758
760
  branding: null,
759
- ...H
761
+ ...A
760
762
  });
761
763
  return;
762
764
  }
763
- const p = e.find((b) => b.id === a);
764
- if (!p) return;
765
- const s = p.type.toUpperCase(), h = s === "TOP_X" ? re([a], t) : s === "MATCH_QUIZ" ? oe([a], t) : s === "TEMPLATE" ? ne([a], t) : ae([a], t), [T, Q] = await Promise.all([
766
- le(p, t, 1, r),
767
- h.catch(() => [])
765
+ const m = e.find((g) => g.id === a);
766
+ if (!m) return;
767
+ const s = m.type.toUpperCase(), T = s === "TOP_X" ? re([a], t) : s === "MATCH_QUIZ" ? oe([a], t) : s === "TEMPLATE" ? ne([a], t) : ae([a], t), [S, F] = await Promise.all([
768
+ le(m, t, 1, r),
769
+ T.catch(() => [])
768
770
  ]);
769
- if (!m) {
770
- const b = Q[0];
771
- c({
771
+ if (!f) {
772
+ const g = F[0];
773
+ d({
772
774
  id: a,
773
- title: (b == null ? void 0 : b.title) || a,
774
- description: (b == null ? void 0 : b.description) || null,
775
- branding: (b == null ? void 0 : b.branding) || null,
776
- ...T
775
+ title: (g == null ? void 0 : g.title) || a,
776
+ description: (g == null ? void 0 : g.description) || null,
777
+ branding: (g == null ? void 0 : g.branding) || null,
778
+ ...S
777
779
  });
778
780
  }
779
781
  } catch (n) {
780
- console.error("Failed to fetch leaderboard:", n), m || f(!0);
782
+ console.error("Failed to fetch leaderboard:", n), f || u(!0);
781
783
  } finally {
782
- m || x(!1);
784
+ f || h(!1);
783
785
  }
784
786
  })(), () => {
785
- m = !0;
787
+ f = !0;
786
788
  };
787
789
  }, [a, e, t, r]);
788
790
  const C = pe(
789
- async (m) => {
791
+ async (f) => {
790
792
  if (a) {
791
- x(!0);
793
+ h(!0);
792
794
  try {
793
795
  let l;
794
- if (a === B) {
795
- const n = e.map((p) => p.id);
796
- l = await W(n, t, m, r);
796
+ if (a === $) {
797
+ const n = e.map((m) => m.id);
798
+ l = await W(n, t, f, r);
797
799
  } else {
798
- const n = e.find((p) => p.id === a);
800
+ const n = e.find((m) => m.id === a);
799
801
  if (!n) return;
800
- l = await le(n, t, m, r);
802
+ l = await le(n, t, f, r);
801
803
  }
802
- c((n) => n ? { ...n, ...l } : null);
804
+ d((n) => n ? { ...n, ...l } : null);
803
805
  } catch (l) {
804
806
  console.error("Failed to fetch page:", l);
805
807
  } finally {
806
- x(!1);
808
+ h(!1);
807
809
  }
808
810
  }
809
811
  },
810
812
  [a, e, t, r]
811
- ), w = Object.fromEntries(
812
- Object.entries(o).map(([m, l]) => [m, l.title])
813
+ ), P = Object.fromEntries(
814
+ Object.entries(o).map(([f, l]) => [f, l.title])
813
815
  );
814
- return { data: y, entityTitles: w, loading: d, error: v, setPage: C, userRank: P };
815
- }, _ = "ALL", ie = ["TOP_X", "MATCH_QUIZ", "TEMPLATE", "CLASSIC_QUIZ"], je = (e, t) => {
816
+ return { data: y, entityTitles: P, loading: c, error: v, setPage: C, userRank: w };
817
+ }, k = "ALL", ie = ["TOP_X", "MATCH_QUIZ", "TEMPLATE", "CLASSIC_QUIZ"], Ge = (e, t) => {
816
818
  if (!Array.isArray(e) || e.length === 0)
817
819
  return "The 'entities' setting is required and must be a non-empty array.";
818
820
  const a = /* @__PURE__ */ new Set();
@@ -834,43 +836,45 @@ const Ue = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
834
836
  entities: e,
835
837
  sdk: t,
836
838
  pageSize: a,
837
- rankStyles: r
839
+ rankStyles: r,
840
+ showOverallOnly: o = !1,
841
+ showHeading: b = !0
838
842
  }) => {
839
- var s;
840
- const { t: o } = D(), g = G(), y = X().surface, c = k(
841
- () => je(e, a),
843
+ var g;
844
+ const { t: y } = D(), d = j(), c = X().surface, h = _(
845
+ () => Ge(e, a),
842
846
  [e, a]
843
- ), d = k(
844
- () => !c && e.length > 1 && e.every((h) => h.type.toUpperCase() === "CLASSIC_QUIZ"),
845
- [e, c]
846
- ), x = d ? _ : ((s = e[0]) == null ? void 0 : s.id) || "", [v, f] = z(x);
847
- F(() => {
848
- v === _ || e.some((T) => T.id === v) || f(x);
847
+ ), v = _(
848
+ () => !h && e.length > 1 && e.every((A) => A.type.toUpperCase() === "CLASSIC_QUIZ"),
849
+ [e, h]
850
+ ), u = o && v, x = v ? k : ((g = e[0]) == null ? void 0 : g.id) || "", [E, w] = B(x);
851
+ Q(() => {
852
+ E === k || e.some((M) => M.id === E) || w(x);
849
853
  }, [e]);
850
- const { data: u, entityTitles: E, loading: P, error: S, setPage: C, userRank: w } = Ge(
851
- c ? [] : e,
854
+ const { data: p, entityTitles: C, loading: P, error: f, setPage: l, userRank: n } = je(
855
+ h ? [] : e,
852
856
  t,
853
- c ? "" : v,
857
+ h ? "" : E,
854
858
  a
855
- ), m = k(() => {
856
- if (c) return [];
857
- const h = [];
858
- return d && h.push({ id: _, label: o("leaderboard.overall") }), e.forEach((T) => {
859
- h.push({
860
- id: T.id,
861
- label: E[T.id] ?? "",
862
- type: T.type.toUpperCase()
859
+ ), m = _(() => {
860
+ if (h) return [];
861
+ const A = [];
862
+ return v && A.push({ id: k, label: y("leaderboard.overall") }), e.forEach((M) => {
863
+ A.push({
864
+ id: M.id,
865
+ label: C[M.id] ?? "",
866
+ type: M.type.toUpperCase()
863
867
  });
864
- }), h;
865
- }, [e, d, o, E, c]), l = e.every((h) => E[h.id] !== void 0), n = !c && (e.length > 1 || d) && l, p = (u == null ? void 0 : u.pagination) || null;
866
- return c ? /* @__PURE__ */ i(
868
+ }), A;
869
+ }, [e, v, y, C, h]), s = e.every((A) => C[A.id] !== void 0), T = !h && !u && (e.length > 1 || v) && s, S = (p == null ? void 0 : p.pagination) || null, F = E === k ? y("leaderboard.overall") : (p == null ? void 0 : p.title) || null;
870
+ return h ? /* @__PURE__ */ i(
867
871
  J,
868
872
  {
869
873
  variant: "error",
870
874
  title: "Configuration Error",
871
- message: c
875
+ message: h
872
876
  }
873
- ) : S ? /* @__PURE__ */ i(
877
+ ) : f ? /* @__PURE__ */ i(
874
878
  J,
875
879
  {
876
880
  variant: "error",
@@ -878,77 +882,77 @@ const Ue = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
878
882
  message: "One or more entity IDs could not be found. Please verify the provided IDs and try again."
879
883
  }
880
884
  ) : /* @__PURE__ */ R(
881
- I,
885
+ L,
882
886
  {
883
887
  sx: {
884
888
  display: "flex",
885
889
  flexDirection: "column",
886
- gap: g.md,
887
- backgroundColor: y,
888
- padding: g.md
890
+ gap: d.md,
891
+ backgroundColor: c,
892
+ padding: d.md
889
893
  },
890
894
  children: [
891
- n && /* @__PURE__ */ i(
895
+ T && /* @__PURE__ */ i(
892
896
  $e,
893
897
  {
894
898
  options: m,
895
- selectedId: v,
896
- onChange: f
899
+ selectedId: E,
900
+ onChange: w
897
901
  }
898
902
  ),
899
903
  /* @__PURE__ */ i(
900
904
  Qe,
901
905
  {
902
- leaderboard: P ? null : (u == null ? void 0 : u.leaderboard) || null,
903
- userRank: P ? null : w,
904
- showHeading: !n,
905
- title: (u == null ? void 0 : u.title) || null,
906
- description: (u == null ? void 0 : u.description) || null,
907
- brandingColors: (u == null ? void 0 : u.branding) || null,
906
+ leaderboard: P ? null : (p == null ? void 0 : p.leaderboard) || null,
907
+ userRank: P ? null : n,
908
+ showHeading: b && !T,
909
+ title: F,
910
+ description: (p == null ? void 0 : p.description) || null,
911
+ brandingColors: (p == null ? void 0 : p.branding) || null,
908
912
  rankStyles: r
909
913
  }
910
914
  ),
911
- !P && p && p.totalPages > 1 && /* @__PURE__ */ i(
915
+ !P && S && S.totalPages > 1 && /* @__PURE__ */ i(
912
916
  He,
913
917
  {
914
- count: p.totalPages,
915
- page: p.currentPage,
916
- onChange: C
918
+ count: S.totalPages,
919
+ page: S.currentPage,
920
+ onChange: l
917
921
  }
918
922
  )
919
923
  ]
920
924
  }
921
925
  );
922
926
  }, Ne = (e) => {
923
- var u;
924
- const [t, a] = L.useState(!1), [r, o] = L.useState(!1), g = L.useRef(
927
+ var x;
928
+ const [t, a] = z.useState(!1), [r, o] = z.useState(!1), b = z.useRef(
925
929
  `leaderboard-shadow-root-${Math.random().toString(36).substring(2, 11)}`
926
- ), y = L.useRef(null), c = L.useRef(null), d = L.useRef(null), x = L.useRef(null);
927
- L.useEffect(() => {
930
+ ), y = z.useRef(null), d = z.useRef(null), c = z.useRef(null), h = z.useRef(null);
931
+ z.useEffect(() => {
928
932
  be(e.language || "en").finally(() => o(!0));
929
- }, [e.language]), L.useEffect(() => {
933
+ }, [e.language]), z.useEffect(() => {
930
934
  if (y.current)
931
- return y.current.shadowRoot ? (c.current = y.current.shadowRoot, d.current = c.current.getElementById(
932
- g.current
933
- ), d.current || (d.current = document.createElement("div"), d.current.id = g.current, c.current.appendChild(d.current))) : (c.current = y.current.attachShadow({ mode: "open" }), d.current = document.createElement("div"), d.current.id = g.current, c.current.appendChild(d.current)), x.current || (x.current = ye({
935
+ return y.current.shadowRoot ? (d.current = y.current.shadowRoot, c.current = d.current.getElementById(
936
+ b.current
937
+ ), c.current || (c.current = document.createElement("div"), c.current.id = b.current, d.current.appendChild(c.current))) : (d.current = y.current.attachShadow({ mode: "open" }), c.current = document.createElement("div"), c.current.id = b.current, d.current.appendChild(c.current)), h.current || (h.current = ye({
934
938
  key: "leaderboard-css",
935
939
  prepend: !0,
936
- container: c.current
940
+ container: d.current
937
941
  })), a(!0), () => {
938
942
  a(!1);
939
943
  };
940
944
  }, []);
941
- const v = /* @__PURE__ */ i(I, { ref: y }), f = t && r && d.current && x.current ? Pe(
942
- /* @__PURE__ */ i(xe, { value: x.current, children: /* @__PURE__ */ i(Ce, { containerRef: y, children: /* @__PURE__ */ i(
945
+ const v = /* @__PURE__ */ i(L, { ref: y }), u = t && r && c.current && h.current ? Pe(
946
+ /* @__PURE__ */ i(xe, { value: h.current, children: /* @__PURE__ */ i(Ce, { containerRef: y, children: /* @__PURE__ */ i(
943
947
  ve,
944
948
  {
945
949
  customTheme: e.themeOptions,
946
- mode: (u = e.themeOptions) == null ? void 0 : u.mode,
947
- shadowRootElement: d.current,
950
+ mode: (x = e.themeOptions) == null ? void 0 : x.mode,
951
+ shadowRootElement: c.current,
948
952
  children: /* @__PURE__ */ i(
949
953
  Te,
950
954
  {
951
- shadowRootElement: d.current,
955
+ shadowRootElement: c.current,
952
956
  leadPhoneCountryCode: null,
953
957
  language: e.language,
954
958
  optionsLayout: null,
@@ -957,13 +961,13 @@ const Ue = (e) => e.split("_").map((t) => t.charAt(0) + t.slice(1).toLowerCase()
957
961
  )
958
962
  }
959
963
  ) }) }),
960
- d.current
964
+ c.current
961
965
  ) : null;
962
966
  return /* @__PURE__ */ R(se, { children: [
963
967
  v,
964
- f
968
+ u
965
969
  ] });
966
- }, Ve = (e) => /* @__PURE__ */ i(Ne, { ...e, children: /* @__PURE__ */ i(Ze, { ...e }) }), dt = Ve;
970
+ }, Ve = (e) => /* @__PURE__ */ i(Ne, { ...e, children: /* @__PURE__ */ i(Ze, { ...e }) }), pt = Ve;
967
971
  export {
968
- dt as Leaderboard
972
+ pt as Leaderboard
969
973
  };