@everymatrix/tournament-details-page 0.0.7 → 0.0.9

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 (26) hide show
  1. package/components/{TournamentDetails-qcyLTtSv.js → TournamentDetails-CKMkVYxd.js} +1976 -1943
  2. package/components/{TournamentDetails-DoBMS_9T.js → TournamentDetails-H6pHb_yG.js} +1608 -1575
  3. package/components/TournamentDetails-nG7lN2NT.cjs +7 -0
  4. package/components/TournamentDetailsPage-0JKgpPb4.js +1107 -0
  5. package/components/TournamentDetailsPage-CNDHXiDn.cjs +59 -0
  6. package/components/TournamentDetailsPage-D-pwFR-w.js +1082 -0
  7. package/components/TournamentGames-COHWeopg.js +377 -0
  8. package/components/TournamentGames-DLS2XJfo.js +403 -0
  9. package/components/TournamentGames-DO485kHn.cjs +27 -0
  10. package/components/TournamentLeaderboard-BnP-SIlN.cjs +31 -0
  11. package/components/TournamentLeaderboard-Dnpxq0_A.js +839 -0
  12. package/components/TournamentLeaderboard-ivZpO_TZ.js +823 -0
  13. package/es2015/tournament-details-page.cjs +1 -1
  14. package/es2015/tournament-details-page.js +1 -1
  15. package/esnext/tournament-details-page.js +1 -1
  16. package/package.json +1 -1
  17. package/components/TournamentDetails-C-zS8XGk.cjs +0 -7
  18. package/components/TournamentDetailsPage-C2wcS4rg.js +0 -987
  19. package/components/TournamentDetailsPage-CQFv3xok.js +0 -1010
  20. package/components/TournamentDetailsPage-CR3ti0az.cjs +0 -66
  21. package/components/TournamentGames-KOJ004rg.js +0 -387
  22. package/components/TournamentGames-xrJB7h-M.js +0 -359
  23. package/components/TournamentGames-zikPbhES.cjs +0 -27
  24. package/components/TournamentLeaderboard-BjBItfy9.js +0 -788
  25. package/components/TournamentLeaderboard-D9naoaD9.cjs +0 -30
  26. package/components/TournamentLeaderboard-Dc8xv6be.js +0 -804
@@ -0,0 +1,403 @@
1
+ var ge = (A, p, m) => new Promise((te, C) => {
2
+ var L = (f) => {
3
+ try {
4
+ y(m.next(f));
5
+ } catch (B) {
6
+ C(B);
7
+ }
8
+ }, z = (f) => {
9
+ try {
10
+ y(m.throw(f));
11
+ } catch (B) {
12
+ C(B);
13
+ }
14
+ }, y = (f) => f.done ? te(f.value) : Promise.resolve(f.value).then(L, z);
15
+ y((m = m.apply(A, p)).next());
16
+ });
17
+ import { a as Ke, $ as qe, n as Xe, e as Qe, p as w, f as Ve, u as be, s as W, g as Ye, h as x, t as k, r as l, i as M, q as a, B as D, y as Ze, G as P, D as E, j as c, k as $e, l as et, z as tt, x as _, m as T, K as Y, L as Z, J as $, A as ee, M as pe, v as at, w as nt, E as i, F as he } from "./TournamentDetails-CKMkVYxd.js";
18
+ import { g as ot } from "./TournamentDetailsPage-0JKgpPb4.js";
19
+ function _e(A, p) {
20
+ Ke(A, p);
21
+ }
22
+ function xe(A) {
23
+ qe.set(A);
24
+ }
25
+ const ye = {
26
+ en: {
27
+ previousButton: "Previous",
28
+ nextButton: "Next",
29
+ casinoTab: "Casino",
30
+ sportsbookTab: "Sportsbook",
31
+ gamesDescriptionTitle: "Participating games",
32
+ gamesDescriptionSubtitle: "Discover the games",
33
+ sportsRulesParseError: "Error parsing tournament rules",
34
+ noAvailableGames: "No games have been configured yet!"
35
+ },
36
+ tr: {
37
+ previousButton: "Önceki",
38
+ nextButton: "Sonraki",
39
+ casinoTab: "Casino",
40
+ sportsbookTab: "Spor Bahisleri",
41
+ gamesDescriptionTitle: "Katılımcı oyunlar",
42
+ gamesDescriptionSubtitle: "Oyunları keşfedin",
43
+ sportsRulesParseError: "Turnuva kuralları ayrıştırma hatası",
44
+ noAvailableGames: "Henüz oyun yapılandırılmamış!"
45
+ }
46
+ }, rt = () => typeof window == "undefined";
47
+ var st = x('<div class="TournamentGamesTabs svelte-p7mf8l"><button> </button> <button> </button></div>'), it = x('<p class="svelte-p7mf8l"> </p>'), lt = x("<div></div>"), pt = x('<div class="TournamentGameThumbnailSkeleton svelte-p7mf8l"></div>'), mt = x("<p> </p>"), ct = x('<div class="TournamentGameThumbnail svelte-p7mf8l"><div class="ImageContainer svelte-p7mf8l"><img class="svelte-p7mf8l"/> <div class="PlayButtonOverlay svelte-p7mf8l"><button class="PlayGameButton svelte-p7mf8l"> </button></div></div></div>'), vt = x('<span class="PaginationButton Elipsis svelte-p7mf8l">...</span>'), ut = x("<button> </button>"), dt = x('<div><button class="PaginationButton svelte-p7mf8l"> </button> <div class="PageNumberWrapper svelte-p7mf8l"></div> <button class="PaginationButton svelte-p7mf8l"> </button></div>'), ft = x('<div class="PaginationSkeleton svelte-p7mf8l"><div class="PaginationSkeletonButton svelte-p7mf8l"></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"></div> <div class="PaginationSkeletonButton svelte-p7mf8l"></div></div>'), gt = x('<div class="TournamentGamesWrapper svelte-p7mf8l"><div class="GamesDescription svelte-p7mf8l"><p class="GamesDescriptionTitle svelte-p7mf8l"> </p> <p class="GamesDescriptionSubTitle svelte-p7mf8l"> </p></div> <!> <!> <div><!></div> <!> <!></div>');
48
+ const bt = {
49
+ hash: "svelte-p7mf8l",
50
+ code: `.svelte-p7mf8l,
51
+ .svelte-p7mf8l::before,
52
+ .svelte-p7mf8l::after {margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;font-family:inherit;}.GamesDescription.svelte-p7mf8l {display:flex;flex-direction:column;gap:6px;margin:10px 0;.GamesDescriptionTitle:where(.svelte-p7mf8l) {color:var(--emw-color-typography, #ffffff);font-size:16px;font-weight:600;}.GamesDescriptionSubTitle:where(.svelte-p7mf8l) {color:var(--emw-color-typography, #ffffff);font-size:14px;font-weight:200;}}.TournamentGamesTabs.svelte-p7mf8l {display:flex;border-radius:50px;background-color:var(--emw-color-bg-section, #434343);padding:6px;margin-bottom:6px;width:100%;justify-content:center;.Tab:where(.svelte-p7mf8l) {padding:5px 20px;color:var(--emw-color-typography, #ffffff);width:100%;border-radius:50px;background-color:transparent;border:none;cursor:pointer;}.Active:where(.svelte-p7mf8l) {background-color:var(--emw-color-bg-elements, #4A4A4A);border:none;}}.TournamentRulesWrapper.svelte-p7mf8l {display:flex;flex-direction:column;color:var(--emw-color-typography, #ffffff);font-size:14px;font-weight:400;margin:10px 0;min-height:150px;}.TournamentGamesWrapper.svelte-p7mf8l {display:flex;flex-direction:column;gap:10px;background-color:var(--emw-color-bg-secondary, #333232);padding:10px;border-radius:6px;}.TournamentGamesContainer.svelte-p7mf8l {display:grid;gap:12px;grid-template-columns:repeat(auto-fit, minmax(min(150px, 100%), 1fr));.TournamentGameThumbnailSkeleton:where(.svelte-p7mf8l) {position:relative;width:100%;aspect-ratio:4 / 3;overflow:hidden;border-radius:6px;background:linear-gradient(
53
+ to top,
54
+ var(--emw-color-primary, #FF1D4E),
55
+ transparent
56
+ );background-size:100% 200%;
57
+ animation: svelte-p7mf8l-pulse 1.5s ease-in-out infinite;}.ImageContainer:where(.svelte-p7mf8l) {position:relative;width:100%;aspect-ratio:4 / 3;overflow:hidden;border-radius:6px;}img:where(.svelte-p7mf8l) {position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;border-radius:6px;}.PlayButtonOverlay:where(.svelte-p7mf8l) {position:absolute;top:0;left:0;bottom:0;right:0;background-color:rgba(0, 0, 0, 0.6);display:flex;justify-content:center;align-items:center;opacity:0;&:hover {opacity:1;transition:opacity 0.5s;}.PlayGameButton:where(.svelte-p7mf8l) {background-color:var(--emw-color-primary, #FF1D4E);border-radius:6px;color:var(--emw-color-typography, #ffffff);padding:10px;border:none;outline:none;min-width:50%;cursor:pointer;&:hover {background-color:var(--emw-color-primary-hover, #ff3a65);cursor:pointer;}&:active {transform:scale(0.9);}}}}.PaginationWrapper.svelte-p7mf8l {display:flex;justify-content:space-between;.PageNumberWrapper:where(.svelte-p7mf8l) {display:flex;gap:3px;}.PaginationButton:where(.svelte-p7mf8l) {background-color:var(--emw-color-bg-section, #434343);color:var(--emw-color-typography, #ffffff);border-radius:6px;border:none;outline:none;padding:10px;width:auto;cursor:pointer;&.Number {background-color:transparent;min-width:0;padding:0 10px;}&:hover {background-color:var(--emw-color-bg-elements, #4A4A4A);cursor:pointer;}&:active {transform:scale(0.9);}&:disabled {opacity:60%;pointer-events:none;}&.Active {background-color:var(--emw-color-bg-elements, #4A4A4A);}&.Elipsis {pointer-events:none;background-color:transparent;min-width:0;padding:0;align-self:center;}}}.NoGamesAvailable.svelte-p7mf8l {color:var(--emw-color-typography, #ffffff);font-size:14px;font-weight:300;}.PaginationSkeleton.svelte-p7mf8l {display:flex;justify-content:space-between;gap:6px;.PaginationSkeletonButton:where(.svelte-p7mf8l) {width:60px;height:35px;border-radius:6px;background-color:var(--emw-color-skeleton, #535353);overflow:hidden;position:relative;
58
+ animation: svelte-p7mf8l-pulse 1s infinite;}.PaginationNumberSkeleton:where(.svelte-p7mf8l) {width:40px;height:35px;border-radius:6px;background-color:var(--emw-color-skeleton, #535353);overflow:hidden;position:relative;
59
+ animation: svelte-p7mf8l-pulse 1s infinite;}}
60
+
61
+ @keyframes svelte-p7mf8l-pulse {
62
+ 0% {
63
+ opacity: 0;
64
+ }
65
+ 50% {
66
+ opacity: 1;
67
+ }
68
+ 100% {
69
+ opacity: 0;
70
+ }
71
+ }
72
+
73
+
74
+ @media (min-width: 750px) {.TournamentGamesTabs.svelte-p7mf8l {width:fit-content;}.PaginationWrapper.svelte-p7mf8l, .PaginationSkeleton.svelte-p7mf8l {justify-content:end;gap:10px;}.PaginationButton.svelte-p7mf8l {min-width:75px;}.PaginationSkeleton.svelte-p7mf8l {justify-content:end;gap:10px;.PaginationSkeletonButton:where(.svelte-p7mf8l) {width:auto;min-width:55px;}.PaginationNumberSkeleton:where(.svelte-p7mf8l) {width:35px;}}
75
+
76
+ }.Hidden.svelte-p7mf8l {display:none;}`
77
+ };
78
+ function ht(A, p) {
79
+ var fe;
80
+ Xe(p, !0), Qe(A, bt);
81
+ const m = () => Ze(tt, "$_", te), [te, C] = et(), L = w(p, "initialGames"), z = w(p, "endpoint"), y = w(p, "language", 7, "en"), f = w(p, "session"), B = w(p, "tournamentid"), g = w(p, "gamesLimit", 7, 6), O = w(p, "totalGames"), ae = w(p, "platformProp", 7, null), R = w(p, "tournamentMetadata"), F = w(p, "translationurl"), we = () => {
82
+ let e = new URL(F());
83
+ fetch(e.href).then((t) => t.json()).then((t) => {
84
+ Object.keys(t).forEach((n) => {
85
+ _e(n, t[n]);
86
+ });
87
+ }).catch((t) => {
88
+ console.log(t);
89
+ });
90
+ };
91
+ Object.keys(ye).forEach((e) => {
92
+ _e(e, ye[e]);
93
+ }), xe(y());
94
+ const ke = () => {
95
+ xe(y());
96
+ };
97
+ Ve(() => {
98
+ F() && we();
99
+ }), be(() => {
100
+ ke();
101
+ });
102
+ let ne = W(Ye(L() || [])), I = W(!1), b = W(0), U = W(void 0), J = W(!0);
103
+ const Pe = rt() ? (fe = ae()) != null ? fe : "dk" : ot(window.navigator.userAgent), oe = () => ge(this, null, function* () {
104
+ if (re.has(a(K)))
105
+ return;
106
+ _(I, !0);
107
+ const e = new URL(`${z()}/v1/tournaments/${B()}`), t = new Headers();
108
+ f() && t.append("X-SessionId", f());
109
+ const n = { method: "GET", headers: t };
110
+ e.searchParams.append("filter", `id=${B()}`), e.searchParams.append("language", y()), e.searchParams.append("expand", "games"), e.searchParams.append("pagination", `games(limit=${g()},offset=${a(b)})`), e.searchParams.append("platform", Pe), fetch(e, n).then((o) => o.json()).then((o) => {
111
+ var d, r;
112
+ _(ne, (r = (d = o == null ? void 0 : o.item) == null ? void 0 : d.games) == null ? void 0 : r.items, !0), re.set(a(K), a(ne)), a(J) || _(J, !0);
113
+ }).catch((o) => console.log(o)).finally(() => _(I, !1));
114
+ }), Te = () => {
115
+ const e = Math.ceil(O() / g()), t = Math.floor(a(b) / g()) + 1;
116
+ if (e <= 5)
117
+ return Array.from({ length: e }, (o, d) => d + 1);
118
+ const n = [];
119
+ return n.push(1), t <= 3 ? (n.push(2, 3), n.push("..."), n.push(e)) : t >= e - 2 ? (n.push("..."), n.push(e - 2, e - 1, e)) : (n.push("..."), n.push(t - 1, t, t + 1), n.push("..."), n.push(e)), n;
120
+ }, Ge = () => {
121
+ a(b) < O() && (_(b, a(b) + g()), oe());
122
+ }, Se = () => {
123
+ a(b) !== 0 && (_(b, a(b) - g()), oe());
124
+ }, Ae = (e) => {
125
+ _(b, (e - 1) * g()), oe();
126
+ }, Be = pe(Te), K = pe(() => Math.floor(a(b) / g()) + 1);
127
+ let re = /* @__PURE__ */ new Map([[1, L()]]), Ne = pe(() => {
128
+ var e;
129
+ return (e = re.get(a(K))) != null ? e : [];
130
+ }), N = W("casino");
131
+ const De = () => {
132
+ var n;
133
+ if (!R()) return;
134
+ const e = (n = R().sports) == null ? void 0 : n.rules;
135
+ let t;
136
+ if (e)
137
+ try {
138
+ t = JSON.parse(e), _(U, t[y()] || t["*"], !0);
139
+ } catch (o) {
140
+ console.log(o), _(U, `${m()("sportsRulesParseError")}`);
141
+ }
142
+ }, je = (e) => {
143
+ window.postMessage(
144
+ {
145
+ type: "Tournaments:PlayGame",
146
+ launchUrl: e.launchUrl,
147
+ id: e.gameId,
148
+ thumbnail: e.thumbnail,
149
+ name: e.name
150
+ },
151
+ window.location.href
152
+ );
153
+ };
154
+ be(() => {
155
+ Object.keys(R()).length !== 0 && De();
156
+ });
157
+ var Me = {
158
+ get initialGames() {
159
+ return L();
160
+ },
161
+ set initialGames(e) {
162
+ L(e), T();
163
+ },
164
+ get endpoint() {
165
+ return z();
166
+ },
167
+ set endpoint(e) {
168
+ z(e), T();
169
+ },
170
+ get language() {
171
+ return y();
172
+ },
173
+ set language(e = "en") {
174
+ y(e), T();
175
+ },
176
+ get session() {
177
+ return f();
178
+ },
179
+ set session(e) {
180
+ f(e), T();
181
+ },
182
+ get tournamentid() {
183
+ return B();
184
+ },
185
+ set tournamentid(e) {
186
+ B(e), T();
187
+ },
188
+ get gamesLimit() {
189
+ return g();
190
+ },
191
+ set gamesLimit(e = 6) {
192
+ g(e), T();
193
+ },
194
+ get totalGames() {
195
+ return O();
196
+ },
197
+ set totalGames(e) {
198
+ O(e), T();
199
+ },
200
+ get platformProp() {
201
+ return ae();
202
+ },
203
+ set platformProp(e = null) {
204
+ ae(e), T();
205
+ },
206
+ get tournamentMetadata() {
207
+ return R();
208
+ },
209
+ set tournamentMetadata(e) {
210
+ R(e), T();
211
+ },
212
+ get translationurl() {
213
+ return F();
214
+ },
215
+ set translationurl(e) {
216
+ F(e), T();
217
+ }
218
+ }, se = gt(), ie = l(se), le = l(ie), Ee = l(le, !0);
219
+ i(le);
220
+ var me = k(le, 2), Le = l(me, !0);
221
+ i(me), i(ie);
222
+ var ce = k(ie, 2);
223
+ {
224
+ var Oe = (e) => {
225
+ var t = st(), n = l(t);
226
+ let o;
227
+ n.__click = () => _(N, "casino");
228
+ var d = l(n, !0);
229
+ i(n);
230
+ var r = k(n, 2);
231
+ let s;
232
+ r.__click = () => _(N, "sports");
233
+ var v = l(r, !0);
234
+ i(r), i(t), D(
235
+ (h, u) => {
236
+ o = E(n, 1, "Tab svelte-p7mf8l", null, o, { Active: a(N) === "casino" }), P(d, h), s = E(r, 1, "Tab svelte-p7mf8l", null, s, { Active: a(N) === "sports" }), P(v, u);
237
+ },
238
+ [() => m()("casinoTab"), () => m()("sportsbookTab")]
239
+ ), c(e, t);
240
+ };
241
+ M(ce, (e) => {
242
+ Object.keys(R()).length !== 0 && e(Oe);
243
+ });
244
+ }
245
+ var ve = k(ce, 2);
246
+ {
247
+ var Re = (e) => {
248
+ var t = lt();
249
+ let n;
250
+ Y(t, 21, () => a(U), Z, (o, d) => {
251
+ var r = it(), s = l(r);
252
+ i(r), D((v) => {
253
+ var h;
254
+ return P(s, `${(h = a(d).rule) != null ? h : ""} ${v != null ? v : ""}`);
255
+ }, [() => m()("contribution")]), c(o, r);
256
+ }), i(t), D(() => n = E(t, 1, "TournamentRulesWrapper svelte-p7mf8l", null, n, { Hidden: a(N) === "casino" })), c(e, t);
257
+ };
258
+ M(ve, (e) => {
259
+ a(U) && e(Re);
260
+ });
261
+ }
262
+ var q = k(ve, 2);
263
+ let ue;
264
+ var We = l(q);
265
+ {
266
+ var ze = (e) => {
267
+ var t = $(), n = ee(t);
268
+ Y(n, 17, () => Array(g()), Z, (o, d, r, s) => {
269
+ var v = pt();
270
+ c(o, v);
271
+ }), c(e, t);
272
+ }, He = (e) => {
273
+ var t = $(), n = ee(t);
274
+ {
275
+ var o = (r) => {
276
+ var s = mt();
277
+ let v;
278
+ var h = l(s, !0);
279
+ i(s), D(
280
+ (u) => {
281
+ v = E(s, 1, "NoGamesAvailable svelte-p7mf8l", null, v, { Hidden: a(N) === "sports" }), P(h, u);
282
+ },
283
+ [() => m()("noAvailableGames")]
284
+ ), c(r, s);
285
+ }, d = (r) => {
286
+ var s = $(), v = ee(s);
287
+ Y(v, 17, () => a(Ne), Z, (h, u) => {
288
+ var j = ct();
289
+ j.__click = () => je(a(u));
290
+ var X = l(j), H = l(X), Q = k(H, 2), G = l(Q), S = l(G, !0);
291
+ i(G), i(Q), i(X), i(j), D(
292
+ (V) => {
293
+ he(H, "src", `https:${a(u).thumbnail}`), he(H, "alt", a(u).name), P(S, V);
294
+ },
295
+ [() => m()("play")]
296
+ ), c(h, j);
297
+ }), c(r, s);
298
+ };
299
+ M(
300
+ n,
301
+ (r) => {
302
+ var s;
303
+ !a(I) && ((s = a(ne)) == null ? void 0 : s.length) === 0 ? r(o) : r(d, !1);
304
+ },
305
+ !0
306
+ );
307
+ }
308
+ c(e, t);
309
+ };
310
+ M(We, (e) => {
311
+ a(I) ? e(ze) : e(He, !1);
312
+ });
313
+ }
314
+ i(q);
315
+ var de = k(q, 2);
316
+ {
317
+ var Ce = (e) => {
318
+ var t = dt();
319
+ let n;
320
+ var o = l(t);
321
+ o.__click = Se;
322
+ var d = l(o, !0);
323
+ i(o);
324
+ var r = k(o, 2);
325
+ Y(r, 21, () => a(Be), Z, (h, u) => {
326
+ var j = $(), X = ee(j);
327
+ {
328
+ var H = (G) => {
329
+ var S = vt();
330
+ c(G, S);
331
+ }, Q = (G) => {
332
+ var S = ut();
333
+ let V;
334
+ S.__click = () => Ae(a(u));
335
+ var Je = l(S, !0);
336
+ i(S), D(() => {
337
+ V = E(S, 1, "PaginationButton Number svelte-p7mf8l", null, V, { Active: a(u) === a(K) }), P(Je, a(u));
338
+ }), c(G, S);
339
+ };
340
+ M(X, (G) => {
341
+ typeof a(u) != "number" ? G(H) : G(Q, !1);
342
+ });
343
+ }
344
+ c(h, j);
345
+ }), i(r);
346
+ var s = k(r, 2);
347
+ s.__click = Ge;
348
+ var v = l(s, !0);
349
+ i(s), i(t), D(
350
+ (h, u) => {
351
+ n = E(t, 1, "PaginationWrapper svelte-p7mf8l", null, n, { Hidden: a(N) === "sports" }), o.disabled = a(b) === 0, P(d, h), s.disabled = a(b) >= O() - g(), P(v, u);
352
+ },
353
+ [() => m()("previousButton"), () => m()("nextButton")]
354
+ ), c(e, t);
355
+ };
356
+ M(de, (e) => {
357
+ a(J) && O() > g() && e(Ce);
358
+ });
359
+ }
360
+ var Fe = k(de, 2);
361
+ {
362
+ var Ie = (e) => {
363
+ var t = ft();
364
+ c(e, t);
365
+ };
366
+ M(Fe, (e) => {
367
+ a(J) || e(Ie);
368
+ });
369
+ }
370
+ i(se), D(
371
+ (e, t) => {
372
+ P(Ee, e), P(Le, t), ue = E(q, 1, "TournamentGamesContainer svelte-p7mf8l", null, ue, { Hidden: a(N) === "sports" });
373
+ },
374
+ [
375
+ () => m()("gamesDescriptionTitle"),
376
+ () => m()("gamesDescriptionSubtitle")
377
+ ]
378
+ ), c(A, se);
379
+ var Ue = $e(Me);
380
+ return C(), Ue;
381
+ }
382
+ at(["click"]);
383
+ customElements.define("tournament-games", nt(
384
+ ht,
385
+ {
386
+ initialGames: {},
387
+ endpoint: {},
388
+ language: {},
389
+ session: {},
390
+ tournamentid: {},
391
+ gamesLimit: {},
392
+ totalGames: {},
393
+ platformProp: {},
394
+ tournamentMetadata: {},
395
+ translationurl: {}
396
+ },
397
+ [],
398
+ [],
399
+ !1
400
+ ));
401
+ export {
402
+ ht as default
403
+ };
@@ -0,0 +1,27 @@
1
+ "use strict";var Z=(_,l,i)=>new Promise((W,A)=>{var k=d=>{try{g(i.next(d))}catch(x){A(x)}},S=d=>{try{g(i.throw(d))}catch(x){A(x)}},g=d=>d.done?W(d.value):Promise.resolve(d.value).then(k,S);g((i=i.apply(_,l)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./TournamentDetails-nG7lN2NT.cjs"),Ge=require("./TournamentDetailsPage-CNDHXiDn.cjs");function $(_,l){e.addMessages(_,l)}function ee(_){e.$locale.set(_)}const te={en:{previousButton:"Previous",nextButton:"Next",casinoTab:"Casino",sportsbookTab:"Sportsbook",gamesDescriptionTitle:"Participating games",gamesDescriptionSubtitle:"Discover the games",sportsRulesParseError:"Error parsing tournament rules",noAvailableGames:"No games have been configured yet!"},tr:{previousButton:"Önceki",nextButton:"Sonraki",casinoTab:"Casino",sportsbookTab:"Spor Bahisleri",gamesDescriptionTitle:"Katılımcı oyunlar",gamesDescriptionSubtitle:"Oyunları keşfedin",sportsRulesParseError:"Turnuva kuralları ayrıştırma hatası",noAvailableGames:"Henüz oyun yapılandırılmamış!"}},Ae=()=>typeof window=="undefined";var Be=e.from_html('<div class="TournamentGamesTabs svelte-p7mf8l"><button> </button> <button> </button></div>'),Ne=e.from_html('<p class="svelte-p7mf8l"> </p>'),De=e.from_html("<div></div>"),je=e.from_html('<div class="TournamentGameThumbnailSkeleton svelte-p7mf8l"></div>'),Me=e.from_html("<p> </p>"),Ee=e.from_html('<div class="TournamentGameThumbnail svelte-p7mf8l"><div class="ImageContainer svelte-p7mf8l"><img class="svelte-p7mf8l"/> <div class="PlayButtonOverlay svelte-p7mf8l"><button class="PlayGameButton svelte-p7mf8l"> </button></div></div></div>'),Le=e.from_html('<span class="PaginationButton Elipsis svelte-p7mf8l">...</span>'),Oe=e.from_html("<button> </button>"),Re=e.from_html('<div><button class="PaginationButton svelte-p7mf8l"> </button> <div class="PageNumberWrapper svelte-p7mf8l"></div> <button class="PaginationButton svelte-p7mf8l"> </button></div>'),We=e.from_html('<div class="PaginationSkeleton svelte-p7mf8l"><div class="PaginationSkeletonButton svelte-p7mf8l"></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"></div> <div class="PaginationNumberSkeleton svelte-p7mf8l"></div> <div class="PaginationSkeletonButton svelte-p7mf8l"></div></div>'),ze=e.from_html('<div class="TournamentGamesWrapper svelte-p7mf8l"><div class="GamesDescription svelte-p7mf8l"><p class="GamesDescriptionTitle svelte-p7mf8l"> </p> <p class="GamesDescriptionSubTitle svelte-p7mf8l"> </p></div> <!> <!> <div><!></div> <!> <!></div>');const He={hash:"svelte-p7mf8l",code:`.svelte-p7mf8l,
2
+ .svelte-p7mf8l::before,
3
+ .svelte-p7mf8l::after {margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;font-family:inherit;}.GamesDescription.svelte-p7mf8l {display:flex;flex-direction:column;gap:6px;margin:10px 0;.GamesDescriptionTitle:where(.svelte-p7mf8l) {color:var(--emw-color-typography, #ffffff);font-size:16px;font-weight:600;}.GamesDescriptionSubTitle:where(.svelte-p7mf8l) {color:var(--emw-color-typography, #ffffff);font-size:14px;font-weight:200;}}.TournamentGamesTabs.svelte-p7mf8l {display:flex;border-radius:50px;background-color:var(--emw-color-bg-section, #434343);padding:6px;margin-bottom:6px;width:100%;justify-content:center;.Tab:where(.svelte-p7mf8l) {padding:5px 20px;color:var(--emw-color-typography, #ffffff);width:100%;border-radius:50px;background-color:transparent;border:none;cursor:pointer;}.Active:where(.svelte-p7mf8l) {background-color:var(--emw-color-bg-elements, #4A4A4A);border:none;}}.TournamentRulesWrapper.svelte-p7mf8l {display:flex;flex-direction:column;color:var(--emw-color-typography, #ffffff);font-size:14px;font-weight:400;margin:10px 0;min-height:150px;}.TournamentGamesWrapper.svelte-p7mf8l {display:flex;flex-direction:column;gap:10px;background-color:var(--emw-color-bg-secondary, #333232);padding:10px;border-radius:6px;}.TournamentGamesContainer.svelte-p7mf8l {display:grid;gap:12px;grid-template-columns:repeat(auto-fit, minmax(min(150px, 100%), 1fr));.TournamentGameThumbnailSkeleton:where(.svelte-p7mf8l) {position:relative;width:100%;aspect-ratio:4 / 3;overflow:hidden;border-radius:6px;background:linear-gradient(
4
+ to top,
5
+ var(--emw-color-primary, #FF1D4E),
6
+ transparent
7
+ );background-size:100% 200%;
8
+ animation: svelte-p7mf8l-pulse 1.5s ease-in-out infinite;}.ImageContainer:where(.svelte-p7mf8l) {position:relative;width:100%;aspect-ratio:4 / 3;overflow:hidden;border-radius:6px;}img:where(.svelte-p7mf8l) {position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover;border-radius:6px;}.PlayButtonOverlay:where(.svelte-p7mf8l) {position:absolute;top:0;left:0;bottom:0;right:0;background-color:rgba(0, 0, 0, 0.6);display:flex;justify-content:center;align-items:center;opacity:0;&:hover {opacity:1;transition:opacity 0.5s;}.PlayGameButton:where(.svelte-p7mf8l) {background-color:var(--emw-color-primary, #FF1D4E);border-radius:6px;color:var(--emw-color-typography, #ffffff);padding:10px;border:none;outline:none;min-width:50%;cursor:pointer;&:hover {background-color:var(--emw-color-primary-hover, #ff3a65);cursor:pointer;}&:active {transform:scale(0.9);}}}}.PaginationWrapper.svelte-p7mf8l {display:flex;justify-content:space-between;.PageNumberWrapper:where(.svelte-p7mf8l) {display:flex;gap:3px;}.PaginationButton:where(.svelte-p7mf8l) {background-color:var(--emw-color-bg-section, #434343);color:var(--emw-color-typography, #ffffff);border-radius:6px;border:none;outline:none;padding:10px;width:auto;cursor:pointer;&.Number {background-color:transparent;min-width:0;padding:0 10px;}&:hover {background-color:var(--emw-color-bg-elements, #4A4A4A);cursor:pointer;}&:active {transform:scale(0.9);}&:disabled {opacity:60%;pointer-events:none;}&.Active {background-color:var(--emw-color-bg-elements, #4A4A4A);}&.Elipsis {pointer-events:none;background-color:transparent;min-width:0;padding:0;align-self:center;}}}.NoGamesAvailable.svelte-p7mf8l {color:var(--emw-color-typography, #ffffff);font-size:14px;font-weight:300;}.PaginationSkeleton.svelte-p7mf8l {display:flex;justify-content:space-between;gap:6px;.PaginationSkeletonButton:where(.svelte-p7mf8l) {width:60px;height:35px;border-radius:6px;background-color:var(--emw-color-skeleton, #535353);overflow:hidden;position:relative;
9
+ animation: svelte-p7mf8l-pulse 1s infinite;}.PaginationNumberSkeleton:where(.svelte-p7mf8l) {width:40px;height:35px;border-radius:6px;background-color:var(--emw-color-skeleton, #535353);overflow:hidden;position:relative;
10
+ animation: svelte-p7mf8l-pulse 1s infinite;}}
11
+
12
+ @keyframes svelte-p7mf8l-pulse {
13
+ 0% {
14
+ opacity: 0;
15
+ }
16
+ 50% {
17
+ opacity: 1;
18
+ }
19
+ 100% {
20
+ opacity: 0;
21
+ }
22
+ }
23
+
24
+
25
+ @media (min-width: 750px) {.TournamentGamesTabs.svelte-p7mf8l {width:fit-content;}.PaginationWrapper.svelte-p7mf8l, .PaginationSkeleton.svelte-p7mf8l {justify-content:end;gap:10px;}.PaginationButton.svelte-p7mf8l {min-width:75px;}.PaginationSkeleton.svelte-p7mf8l {justify-content:end;gap:10px;.PaginationSkeletonButton:where(.svelte-p7mf8l) {width:auto;min-width:55px;}.PaginationNumberSkeleton:where(.svelte-p7mf8l) {width:35px;}}
26
+
27
+ }.Hidden.svelte-p7mf8l {display:none;}`};function ae(_,l){var Y;e.push(l,!0),e.append_styles(_,He);const i=()=>e.store_get(e.$format,"$_",W),[W,A]=e.setup_stores(),k=e.prop(l,"initialGames"),S=e.prop(l,"endpoint"),g=e.prop(l,"language",7,"en"),d=e.prop(l,"session"),x=e.prop(l,"tournamentid"),f=e.prop(l,"gamesLimit",7,6),P=e.prop(l,"totalGames"),z=e.prop(l,"platformProp",7,null),T=e.prop(l,"tournamentMetadata"),B=e.prop(l,"translationurl"),ne=()=>{let t=new URL(B());fetch(t.href).then(a=>a.json()).then(a=>{Object.keys(a).forEach(n=>{$(n,a[n])})}).catch(a=>{console.log(a)})};Object.keys(te).forEach(t=>{$(t,te[t])}),ee(g());const re=()=>{ee(g())};e.user_pre_effect(()=>{B()&&ne()}),e.user_effect(()=>{re()});let H=e.state(e.proxy(k()||[])),N=e.state(!1),u=e.state(0),D=e.state(void 0),j=e.state(!0);const se=Ae()?(Y=z())!=null?Y:"dk":Ge.getDevice(window.navigator.userAgent),C=()=>Z(this,null,function*(){if(I.has(e.get(M)))return;e.set(N,!0);const t=new URL(`${S()}/v1/tournaments/${x()}`),a=new Headers;d()&&a.append("X-SessionId",d());const n={method:"GET",headers:a};t.searchParams.append("filter",`id=${x()}`),t.searchParams.append("language",g()),t.searchParams.append("expand","games"),t.searchParams.append("pagination",`games(limit=${f()},offset=${e.get(u)})`),t.searchParams.append("platform",se),fetch(t,n).then(r=>r.json()).then(r=>{var m,s;e.set(H,(s=(m=r==null?void 0:r.item)==null?void 0:m.games)==null?void 0:s.items,!0),I.set(e.get(M),e.get(H)),e.get(j)||e.set(j,!0)}).catch(r=>console.log(r)).finally(()=>e.set(N,!1))}),oe=()=>{const t=Math.ceil(P()/f()),a=Math.floor(e.get(u)/f())+1;if(t<=5)return Array.from({length:t},(r,m)=>m+1);const n=[];return n.push(1),a<=3?(n.push(2,3),n.push("..."),n.push(t)):a>=t-2?(n.push("..."),n.push(t-2,t-1,t)):(n.push("..."),n.push(a-1,a,a+1),n.push("..."),n.push(t)),n},le=()=>{e.get(u)<P()&&(e.set(u,e.get(u)+f()),C())},ie=()=>{e.get(u)!==0&&(e.set(u,e.get(u)-f()),C())},pe=t=>{e.set(u,(t-1)*f()),C()},ce=e.user_derived(oe),M=e.user_derived(()=>Math.floor(e.get(u)/f())+1);let I=new Map([[1,k()]]),me=e.user_derived(()=>{var t;return(t=I.get(e.get(M)))!=null?t:[]}),y=e.state("casino");const de=()=>{var n;if(!T())return;const t=(n=T().sports)==null?void 0:n.rules;let a;if(t)try{a=JSON.parse(t),e.set(D,a[g()]||a["*"],!0)}catch(r){console.log(r),e.set(D,`${i()("sportsRulesParseError")}`)}},fe=t=>{window.postMessage({type:"Tournaments:PlayGame",launchUrl:t.launchUrl,id:t.gameId,thumbnail:t.thumbnail,name:t.name},window.location.href)};e.user_effect(()=>{Object.keys(T()).length!==0&&de()});var ue={get initialGames(){return k()},set initialGames(t){k(t),e.flushSync()},get endpoint(){return S()},set endpoint(t){S(t),e.flushSync()},get language(){return g()},set language(t="en"){g(t),e.flushSync()},get session(){return d()},set session(t){d(t),e.flushSync()},get tournamentid(){return x()},set tournamentid(t){x(t),e.flushSync()},get gamesLimit(){return f()},set gamesLimit(t=6){f(t),e.flushSync()},get totalGames(){return P()},set totalGames(t){P(t),e.flushSync()},get platformProp(){return z()},set platformProp(t=null){z(t),e.flushSync()},get tournamentMetadata(){return T()},set tournamentMetadata(t){T(t),e.flushSync()},get translationurl(){return B()},set translationurl(t){B(t),e.flushSync()}},U=ze(),F=e.child(U),q=e.child(F),ve=e.child(q,!0);e.reset(q);var J=e.sibling(q,2),ge=e.child(J,!0);e.reset(J),e.reset(F);var K=e.sibling(F,2);{var he=t=>{var a=Be(),n=e.child(a);let r;n.__click=()=>e.set(y,"casino");var m=e.child(n,!0);e.reset(n);var s=e.sibling(n,2);let o;s.__click=()=>e.set(y,"sports");var p=e.child(s,!0);e.reset(s),e.reset(a),e.template_effect((v,c)=>{r=e.set_class(n,1,"Tab svelte-p7mf8l",null,r,{Active:e.get(y)==="casino"}),e.set_text(m,v),o=e.set_class(s,1,"Tab svelte-p7mf8l",null,o,{Active:e.get(y)==="sports"}),e.set_text(p,c)},[()=>i()("casinoTab"),()=>i()("sportsbookTab")]),e.append(t,a)};e.if_block(K,t=>{Object.keys(T()).length!==0&&t(he)})}var X=e.sibling(K,2);{var be=t=>{var a=De();let n;e.each(a,21,()=>e.get(D),e.index,(r,m)=>{var s=Ne(),o=e.child(s);e.reset(s),e.template_effect(p=>{var v;return e.set_text(o,`${(v=e.get(m).rule)!=null?v:""} ${p!=null?p:""}`)},[()=>i()("contribution")]),e.append(r,s)}),e.reset(a),e.template_effect(()=>n=e.set_class(a,1,"TournamentRulesWrapper svelte-p7mf8l",null,n,{Hidden:e.get(y)==="casino"})),e.append(t,a)};e.if_block(X,t=>{e.get(D)&&t(be)})}var E=e.sibling(X,2);let Q;var _e=e.child(E);{var xe=t=>{var a=e.comment(),n=e.first_child(a);e.each(n,17,()=>Array(f()),e.index,(r,m,s,o)=>{var p=je();e.append(r,p)}),e.append(t,a)},ye=t=>{var a=e.comment(),n=e.first_child(a);{var r=s=>{var o=Me();let p;var v=e.child(o,!0);e.reset(o),e.template_effect(c=>{p=e.set_class(o,1,"NoGamesAvailable svelte-p7mf8l",null,p,{Hidden:e.get(y)==="sports"}),e.set_text(v,c)},[()=>i()("noAvailableGames")]),e.append(s,o)},m=s=>{var o=e.comment(),p=e.first_child(o);e.each(p,17,()=>e.get(me),e.index,(v,c)=>{var w=Ee();w.__click=()=>fe(e.get(c));var L=e.child(w),G=e.child(L),O=e.sibling(G,2),h=e.child(O),b=e.child(h,!0);e.reset(h),e.reset(O),e.reset(L),e.reset(w),e.template_effect(R=>{e.set_attribute(G,"src",`https:${e.get(c).thumbnail}`),e.set_attribute(G,"alt",e.get(c).name),e.set_text(b,R)},[()=>i()("play")]),e.append(v,w)}),e.append(s,o)};e.if_block(n,s=>{var o;!e.get(N)&&((o=e.get(H))==null?void 0:o.length)===0?s(r):s(m,!1)},!0)}e.append(t,a)};e.if_block(_e,t=>{e.get(N)?t(xe):t(ye,!1)})}e.reset(E);var V=e.sibling(E,2);{var we=t=>{var a=Re();let n;var r=e.child(a);r.__click=ie;var m=e.child(r,!0);e.reset(r);var s=e.sibling(r,2);e.each(s,21,()=>e.get(ce),e.index,(v,c)=>{var w=e.comment(),L=e.first_child(w);{var G=h=>{var b=Le();e.append(h,b)},O=h=>{var b=Oe();let R;b.__click=()=>pe(e.get(c));var Se=e.child(b,!0);e.reset(b),e.template_effect(()=>{R=e.set_class(b,1,"PaginationButton Number svelte-p7mf8l",null,R,{Active:e.get(c)===e.get(M)}),e.set_text(Se,e.get(c))}),e.append(h,b)};e.if_block(L,h=>{typeof e.get(c)!="number"?h(G):h(O,!1)})}e.append(v,w)}),e.reset(s);var o=e.sibling(s,2);o.__click=le;var p=e.child(o,!0);e.reset(o),e.reset(a),e.template_effect((v,c)=>{n=e.set_class(a,1,"PaginationWrapper svelte-p7mf8l",null,n,{Hidden:e.get(y)==="sports"}),r.disabled=e.get(u)===0,e.set_text(m,v),o.disabled=e.get(u)>=P()-f(),e.set_text(p,c)},[()=>i()("previousButton"),()=>i()("nextButton")]),e.append(t,a)};e.if_block(V,t=>{e.get(j)&&P()>f()&&t(we)})}var ke=e.sibling(V,2);{var Pe=t=>{var a=We();e.append(t,a)};e.if_block(ke,t=>{e.get(j)||t(Pe)})}e.reset(U),e.template_effect((t,a)=>{e.set_text(ve,t),e.set_text(ge,a),Q=e.set_class(E,1,"TournamentGamesContainer svelte-p7mf8l",null,Q,{Hidden:e.get(y)==="sports"})},[()=>i()("gamesDescriptionTitle"),()=>i()("gamesDescriptionSubtitle")]),e.append(_,U);var Te=e.pop(ue);return A(),Te}e.delegate(["click"]);customElements.define("tournament-games",e.create_custom_element(ae,{initialGames:{},endpoint:{},language:{},session:{},tournamentid:{},gamesLimit:{},totalGames:{},platformProp:{},tournamentMetadata:{},translationurl:{}},[],[],!1));exports.default=ae;
@@ -0,0 +1,31 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./TournamentDetails-nG7lN2NT.cjs");function He(ee,W){e.addMessages(ee,W)}function Me(ee){e.$locale.set(ee)}const Ue={en:{rank:"Rank",user:"User",points:"Points",prize:"Prize",notEnrolledRank:"You are currently not enrolled in this torunament",myRanking:"My Ranking",showMore:"Show More",showLess:"Show Less",emptyLeaderboard:"Currently there are no players enrolled in this tournament",joinButton:"Join",previousButton:"Previous",nextButton:"Next"},tr:{rank:"Sıralama",user:"Kullanıcı",points:"Puan",prize:"Ödül",notEnrolledRank:"Şu anda bu turnuvaya kayıtlı değilsiniz",myRanking:"Sıralamam",showMore:"Daha Fazla Göster",showLess:"Daha Az Göster",emptyLeaderboard:"Şu anda bu turnuvaya kayıtlı oyuncu bulunmuyor",joinButton:"Katıl",previousButton:"Önceki",nextButton:"Sonraki"}};var Ie={exports:{}};/** @license
2
+ * eventsource.js
3
+ * Available under MIT License (MIT)
4
+ * https://github.com/Yaffle/EventSource/
5
+ */(function(ee,W){(function(b){var G=b.setTimeout,te=b.clearTimeout,P=b.XMLHttpRequest,V=b.XDomainRequest,$=b.ActiveXObject,K=b.EventSource,B=b.document,ge=b.Promise,me=b.fetch,Re=b.Response,I=b.TextDecoder,ie=b.TextEncoder,le=b.AbortController;if(typeof window!="undefined"&&typeof B!="undefined"&&!("readyState"in B)&&B.body==null&&(B.readyState="loading",window.addEventListener("load",function(t){B.readyState="complete"},!1)),P==null&&$!=null&&(P=function(){return new $("Microsoft.XMLHTTP")}),Object.create==null&&(Object.create=function(t){function o(){}return o.prototype=t,new o}),Date.now||(Date.now=function(){return new Date().getTime()}),le==null){var _e=me;me=function(t,o){var i=o.signal;return _e(t,{headers:o.headers,credentials:o.credentials,cache:o.cache}).then(function(a){var d=a.body.getReader();return i._reader=d,i._aborted&&i._reader.cancel(),{status:a.status,statusText:a.statusText,headers:a.headers,body:{getReader:function(){return d}}}})},le=function(){this.signal={_reader:null,_aborted:!1},this.abort=function(){this.signal._reader!=null&&this.signal._reader.cancel(),this.signal._aborted=!0}}}function J(){this.bitsNeeded=0,this.codePoint=0}J.prototype.decode=function(t){function o(u,r,n){if(n===1)return u>=128>>r&&u<<r<=2047;if(n===2)return u>=2048>>r&&u<<r<=55295||u>=57344>>r&&u<<r<=65535;if(n===3)return u>=65536>>r&&u<<r<=1114111;throw new Error}function i(u,r){if(u===6*1)return r>>6>15?3:r>31?2:1;if(u===6*2)return r>15?3:2;if(u===6*3)return 3;throw new Error}for(var a=65533,d="",l=this.bitsNeeded,c=this.codePoint,w=0;w<t.length;w+=1){var h=t[w];l!==0&&(h<128||h>191||!o(c<<6|h&63,l-6,i(l,c)))&&(l=0,c=a,d+=String.fromCharCode(c)),l===0?(h>=0&&h<=127?(l=0,c=h):h>=192&&h<=223?(l=6*1,c=h&31):h>=224&&h<=239?(l=6*2,c=h&15):h>=240&&h<=247?(l=6*3,c=h&7):(l=0,c=a),l!==0&&!o(c,l,i(l,c))&&(l=0,c=a)):(l-=6,c=c<<6|h&63),l===0&&(c<=65535?d+=String.fromCharCode(c):(d+=String.fromCharCode(55296+(c-65535-1>>10)),d+=String.fromCharCode(56320+(c-65535-1&1023))))}return this.bitsNeeded=l,this.codePoint=c,d};var we=function(){try{return new I().decode(new ie().encode("test"),{stream:!0})==="test"}catch(t){console.debug("TextDecoder does not support streaming option. Using polyfill instead: "+t)}return!1};(I==null||ie==null||!we())&&(I=J);var _=function(){};function A(t){this.withCredentials=!1,this.readyState=0,this.status=0,this.statusText="",this.responseText="",this.onprogress=_,this.onload=_,this.onerror=_,this.onreadystatechange=_,this._contentType="",this._xhr=t,this._sendTimeout=0,this._abort=_}A.prototype.open=function(t,o){this._abort(!0);var i=this,a=this._xhr,d=1,l=0;this._abort=function(n){i._sendTimeout!==0&&(te(i._sendTimeout),i._sendTimeout=0),(d===1||d===2||d===3)&&(d=4,a.onload=_,a.onerror=_,a.onabort=_,a.onprogress=_,a.onreadystatechange=_,a.abort(),l!==0&&(te(l),l=0),n||(i.readyState=4,i.onabort(null),i.onreadystatechange())),d=0};var c=function(){if(d===1){var n=0,s="",p=void 0;if("contentType"in a)n=200,s="OK",p=a.contentType;else try{n=a.status,s=a.statusText,p=a.getResponseHeader("Content-Type")}catch(j){n=0,s="",p=void 0}n!==0&&(d=2,i.readyState=2,i.status=n,i.statusText=s,i._contentType=p,i.onreadystatechange())}},w=function(){if(c(),d===2||d===3){d=3;var n="";try{n=a.responseText}catch(s){}i.readyState=3,i.responseText=n,i.onprogress()}},h=function(n,s){if((s==null||s.preventDefault==null)&&(s={preventDefault:_}),w(),d===1||d===2||d===3){if(d=4,l!==0&&(te(l),l=0),i.readyState=4,n==="load")i.onload(s);else if(n==="error")i.onerror(s);else if(n==="abort")i.onabort(s);else throw new TypeError;i.onreadystatechange()}},u=function(n){a!=null&&(a.readyState===4?(!("onload"in a)||!("onerror"in a)||!("onabort"in a))&&h(a.responseText===""?"error":"load",n):a.readyState===3?"onprogress"in a||w():a.readyState===2&&c())},r=function(){l=G(function(){r()},500),a.readyState===3&&w()};"onload"in a&&(a.onload=function(n){h("load",n)}),"onerror"in a&&(a.onerror=function(n){h("error",n)}),"onabort"in a&&(a.onabort=function(n){h("abort",n)}),"onprogress"in a&&(a.onprogress=w),"onreadystatechange"in a&&(a.onreadystatechange=function(n){u(n)}),("contentType"in a||!("ontimeout"in P.prototype))&&(o+=(o.indexOf("?")===-1?"?":"&")+"padding=true"),a.open(t,o,!0),"readyState"in a&&(l=G(function(){r()},0))},A.prototype.abort=function(){this._abort(!1)},A.prototype.getResponseHeader=function(t){return this._contentType},A.prototype.setRequestHeader=function(t,o){var i=this._xhr;"setRequestHeader"in i&&i.setRequestHeader(t,o)},A.prototype.getAllResponseHeaders=function(){return this._xhr.getAllResponseHeaders!=null&&this._xhr.getAllResponseHeaders()||""},A.prototype.send=function(){if((!("ontimeout"in P.prototype)||!("sendAsBinary"in P.prototype)&&!("mozAnon"in P.prototype))&&B!=null&&B.readyState!=null&&B.readyState!=="complete"){var t=this;t._sendTimeout=G(function(){t._sendTimeout=0,t.send()},4);return}var o=this._xhr;"withCredentials"in o&&(o.withCredentials=this.withCredentials);try{o.send(void 0)}catch(i){throw i}};function de(t){return t.replace(/[A-Z]/g,function(o){return String.fromCharCode(o.charCodeAt(0)+32)})}function re(t){for(var o=Object.create(null),i=t.split(`\r
6
+ `),a=0;a<i.length;a+=1){var d=i[a],l=d.split(": "),c=l.shift(),w=l.join(": ");o[de(c)]=w}this._map=o}re.prototype.get=function(t){return this._map[de(t)]},P!=null&&P.HEADERS_RECEIVED==null&&(P.HEADERS_RECEIVED=2);function ce(){}ce.prototype.open=function(t,o,i,a,d,l,c){t.open("GET",d);var w=0;t.onprogress=function(){var u=t.responseText,r=u.slice(w);w+=r.length,i(r)},t.onerror=function(u){u.preventDefault(),a(new Error("NetworkError"))},t.onload=function(){a(null)},t.onabort=function(){a(null)},t.onreadystatechange=function(){if(t.readyState===P.HEADERS_RECEIVED){var u=t.status,r=t.statusText,n=t.getResponseHeader("Content-Type"),s=t.getAllResponseHeaders();o(u,r,n,new re(s))}},t.withCredentials=l;for(var h in c)Object.prototype.hasOwnProperty.call(c,h)&&t.setRequestHeader(h,c[h]);return t.send(),t};function Te(t){this._headers=t}Te.prototype.get=function(t){return this._headers.get(t)};function he(){}he.prototype.open=function(t,o,i,a,d,l,c){var w=null,h=new le,u=h.signal,r=new I;return me(d,{headers:c,credentials:l?"include":"same-origin",signal:u,cache:"no-store"}).then(function(n){return w=n.body.getReader(),o(n.status,n.statusText,n.headers.get("Content-Type"),new Te(n.headers)),new ge(function(s,p){var j=function(){w.read().then(function(v){if(v.done)s(void 0);else{var f=r.decode(v.value,{stream:!0});i(f),j()}}).catch(function(v){p(v)})};j()})}).catch(function(n){if(n.name!=="AbortError")return n}).then(function(n){a(n)}),{abort:function(){w!=null&&w.cancel(),h.abort()}}};function fe(){this._listeners=Object.create(null)}function Ce(t){G(function(){throw t},0)}fe.prototype.dispatchEvent=function(t){t.target=this;var o=this._listeners[t.type];if(o!=null)for(var i=o.length,a=0;a<i;a+=1){var d=o[a];try{typeof d.handleEvent=="function"?d.handleEvent(t):d.call(this,t)}catch(l){Ce(l)}}},fe.prototype.addEventListener=function(t,o){t=String(t);var i=this._listeners,a=i[t];a==null&&(a=[],i[t]=a);for(var d=!1,l=0;l<a.length;l+=1)a[l]===o&&(d=!0);d||a.push(o)},fe.prototype.removeEventListener=function(t,o){t=String(t);var i=this._listeners,a=i[t];if(a!=null){for(var d=[],l=0;l<a.length;l+=1)a[l]!==o&&d.push(a[l]);d.length===0?delete i[t]:i[t]=d}};function ne(t){this.type=t,this.target=void 0}function Ae(t,o){ne.call(this,t),this.data=o.data,this.lastEventId=o.lastEventId}Ae.prototype=Object.create(ne.prototype);function xe(t,o){ne.call(this,t),this.status=o.status,this.statusText=o.statusText,this.headers=o.headers}xe.prototype=Object.create(ne.prototype);function Le(t,o){ne.call(this,t),this.error=o.error}Le.prototype=Object.create(ne.prototype);var ae=-1,z=0,oe=1,ve=2,je=-1,q=0,ue=1,Se=2,De=3,Oe=/^text\/event\-stream(;.*)?$/i,Ne=1e3,ke=18e6,ye=function(t,o){var i=t==null?o:parseInt(t,10);return i!==i&&(i=o),pe(i)},pe=function(t){return Math.min(Math.max(t,Ne),ke)},se=function(t,o,i){try{typeof o=="function"&&o.call(t,i)}catch(a){Ce(a)}};function O(t,o){fe.call(this),o=o||{},this.onopen=void 0,this.onmessage=void 0,this.onerror=void 0,this.url=void 0,this.readyState=void 0,this.withCredentials=void 0,this.headers=void 0,this._close=void 0,Be(this,t,o)}function Fe(){return P!=null&&"withCredentials"in P.prototype||V==null?new P:new V}var Ee=me!=null&&Re!=null&&"body"in Re.prototype;function Be(t,o,i){o=String(o);var a=!!i.withCredentials,d=i.lastEventIdQueryParameterName||"lastEventId",l=pe(1e3),c=ye(i.heartbeatTimeout,45e3),w="",h=l,u=!1,r=0,n=i.headers||{},s=i.Transport,p=Ee&&s==null?void 0:new A(s!=null?new s:Fe()),j=s!=null&&typeof s!="string"?new s:p==null?new he:new ce,v=void 0,f=0,g=ae,k="",R="",T="",H="",E=q,S=0,x=0,N=function(m,y,D,U){if(g===z)if(m===200&&D!=null&&Oe.test(D)){g=oe,u=Date.now(),h=l,t.readyState=oe;var F=new xe("open",{status:m,statusText:y,headers:U});t.dispatchEvent(F),se(t,t.onopen,F)}else{var L="";m!==200?(y&&(y=y.replace(/\s+/g," ")),L="EventSource's response has a status "+m+" "+y+" that is not 200. Aborting the connection."):L="EventSource's response has a Content-Type specifying an unsupported type: "+(D==null?"-":D.replace(/\s+/g," "))+". Aborting the connection.",M();var F=new xe("error",{status:m,statusText:y,headers:U});t.dispatchEvent(F),se(t,t.onerror,F),console.error(L)}},Q=function(m){if(g===oe){for(var y=-1,D=0;D<m.length;D+=1){var U=m.charCodeAt(D);(U===10||U===13)&&(y=D)}var F=(y!==-1?H:"")+m.slice(0,y+1);H=(y===-1?H:"")+m.slice(y+1),m!==""&&(u=Date.now(),r+=m.length);for(var L=0;L<F.length;L+=1){var U=F.charCodeAt(L);if(E===je&&U===10)E=q;else if(E===je&&(E=q),U===13||U===10){if(E!==q){E===ue&&(x=L+1);var Y=F.slice(S,x-1),Z=F.slice(x+(x<L&&F.charCodeAt(x)===32?1:0),L);Y==="data"?(k+=`
7
+ `,k+=Z):Y==="id"?R=Z:Y==="event"?T=Z:Y==="retry"?(l=ye(Z,l),h=l):Y==="heartbeatTimeout"&&(c=ye(Z,c),f!==0&&(te(f),f=G(function(){C()},c)))}if(E===q){if(k!==""){w=R,T===""&&(T="message");var be=new Ae(T,{data:k.slice(1),lastEventId:R});if(t.dispatchEvent(be),T==="open"?se(t,t.onopen,be):T==="message"?se(t,t.onmessage,be):T==="error"&&se(t,t.onerror,be),g===ve)return}k="",T=""}E=U===13?je:q}else E===q&&(S=L,E=ue),E===ue?U===58&&(x=L+1,E=Se):E===Se&&(E=De)}}},X=function(m){if(g===oe||g===z){g=ae,f!==0&&(te(f),f=0),f=G(function(){C()},h),h=pe(Math.min(l*16,h*2)),t.readyState=z;var y=new Le("error",{error:m});t.dispatchEvent(y),se(t,t.onerror,y),m!=null&&console.error(m)}},M=function(){g=ve,v!=null&&(v.abort(),v=void 0),f!==0&&(te(f),f=0),t.readyState=ve},C=function(){if(f=0,g!==ae){if(!u&&v!=null)X(new Error("No activity within "+c+" milliseconds. "+(g===z?"No response received.":r+" chars received.")+" Reconnecting.")),v!=null&&(v.abort(),v=void 0);else{var m=Math.max((u||Date.now())+c-Date.now(),1);u=!1,f=G(function(){C()},m)}return}u=!1,r=0,f=G(function(){C()},c),g=z,k="",T="",R=w,H="",S=0,x=0,E=q;var y=o;if(o.slice(0,5)!=="data:"&&o.slice(0,5)!=="blob:"&&w!==""){var D=o.indexOf("?");y=D===-1?o:o.slice(0,D+1)+o.slice(D+1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g,function(Z,be){return be===d?"":Z}),y+=(o.indexOf("?")===-1?"?":"&")+d+"="+encodeURIComponent(w)}var U=t.withCredentials,F={};F.Accept="text/event-stream";var L=t.headers;if(L!=null)for(var Y in L)Object.prototype.hasOwnProperty.call(L,Y)&&(F[Y]=L[Y]);try{v=j.open(p,N,Q,X,y,U,F)}catch(Z){throw M(),Z}};t.url=o,t.readyState=z,t.withCredentials=a,t.headers=n,t._close=M,C()}O.prototype=Object.create(fe.prototype),O.prototype.CONNECTING=z,O.prototype.OPEN=oe,O.prototype.CLOSED=ve,O.prototype.close=function(){this._close()},O.CONNECTING=z,O.OPEN=oe,O.CLOSED=ve,O.prototype.withCredentials=void 0;var Pe=K;P!=null&&(K==null||!("withCredentials"in K.prototype))&&(Pe=O),function(t){{var o=t(W);o!==void 0&&(ee.exports=o)}}(function(t){t.EventSourcePolyfill=O,t.NativeEventSource=K,t.EventSource=Pe})})(typeof globalThis=="undefined"?typeof window!="undefined"?window:typeof self!="undefined"?self:e.commonjsGlobal:globalThis)})(Ie,Ie.exports);var qe=Ie.exports,We=e.from_html('<span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span>',1),Xe=e.from_html('<span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh">—</span> <span class="svelte-75jgrh">—</span>',1),Ge=e.from_html('<p class="svelte-75jgrh"> </p>'),Ve=e.from_html('<div class="PlayerRankWrapper svelte-75jgrh"><div class="PlayerRankLabels svelte-75jgrh"><span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span></div> <div class="PlayerRankData svelte-75jgrh"><!></div></div>'),$e=e.from_html('<div class="PlayerRankSkeletonWrapper svelte-75jgrh"><div class="PlayerRankSkeleton svelte-75jgrh"></div> <div class="PlayerRankSkeleton svelte-75jgrh"></div></div>'),Ke=e.from_html('<tr class="SkeletonRow svelte-75jgrh"><td colspan="4" class="svelte-75jgrh"></td></tr>'),Je=e.from_html('<tr><td class="svelte-75jgrh"> </td><td class="svelte-75jgrh"> </td><td class="svelte-75jgrh"> </td><td class="svelte-75jgrh"> </td></tr>'),Qe=e.from_html('<tr class="svelte-75jgrh"><td colspan="4" class="svelte-75jgrh"><div class="EmptyLeaderboard svelte-75jgrh"><p class="svelte-75jgrh"> </p></div></td></tr>'),Ye=e.from_html('<div class="PaginationSkeleton svelte-75jgrh"><div class="PaginationSkeletonButton svelte-75jgrh"></div> <div class="PaginationNumberSkeleton svelte-75jgrh"></div> <div class="PaginationNumberSkeleton svelte-75jgrh"></div> <div class="PaginationNumberSkeleton svelte-75jgrh"></div> <div class="PaginationNumberSkeleton svelte-75jgrh"></div> <div class="PaginationNumberSkeleton svelte-75jgrh"></div> <div class="PaginationSkeletonButton svelte-75jgrh"></div></div>'),Ze=e.from_html('<span class="PaginationButton Elipsis svelte-75jgrh">...</span>'),et=e.from_html("<button> </button>"),tt=e.from_html('<div class="PaginationWrapper svelte-75jgrh"><button class="PaginationButton svelte-75jgrh"> </button> <div class="PageNumberWrapper svelte-75jgrh"></div> <button class="PaginationButton svelte-75jgrh"> </button></div>'),rt=e.from_html('<div class="LeaderboardWrapper svelte-75jgrh"><div class="RankingWrapper svelte-75jgrh"><!> <table class="LeaderboardTable svelte-75jgrh"><thead class="LeaderboardTableHeader svelte-75jgrh"><tr class="svelte-75jgrh"><th class="svelte-75jgrh"> </th><th class="svelte-75jgrh"> </th><th class="svelte-75jgrh"> </th><th class="svelte-75jgrh"> </th></tr></thead><tbody class="LeaderboardTableBody svelte-75jgrh"><!></tbody></table></div> <!> <!></div>');const nt={hash:"svelte-75jgrh",code:`.svelte-75jgrh,
8
+ .svelte-75jgrh::before,
9
+ .svelte-75jgrh::after {margin:0;padding:0;list-style:none;text-decoration:none;outline:none;box-sizing:border-box;font-family:inherit;}.LeaderboardWrapper.svelte-75jgrh {background-color:var(--emw-color-bg-secondary, #333232);border-radius:6px;padding:16px;overflow:hidden;display:flex;flex-direction:column;justify-content:space-between;}.PlayerRankWrapper.svelte-75jgrh {display:flex;flex-direction:column;gap:5px;min-height:60px;.PlayerRankLabels:where(.svelte-75jgrh), .PlayerRankData:where(.svelte-75jgrh) {display:grid;grid-template-columns:1fr 1fr 2fr;padding:6px;color:var(--emw-color-typography-secondary, #bdbdbd);opacity:70%;font-size:14px;font-weight:400;& > span:where(.svelte-75jgrh):last-child{justify-self:end;}p:where(.svelte-75jgrh) {width:max-content;}}.PlayerRankData:where(.svelte-75jgrh) {background-color:var(--emw-color-bg-section, #434343);color:var(--emw-color-typography, #ffffff);border-radius:6px;padding:12px;}}.PaginationWrapper.svelte-75jgrh {display:flex;justify-content:space-between;.PageNumberWrapper:where(.svelte-75jgrh) {display:flex;gap:6px;}.PaginationButton:where(.svelte-75jgrh) {background-color:var(--emw-color-bg-section, #434343);color:var(--emw-color-typography, #ffffff);border-radius:6px;border:none;outline:none;padding:10px;width:auto;cursor:pointer;&.Number {background-color:transparent;min-width:0;padding:0 10px;}&:hover {background-color:var(--emw-color-bg-elements, #4A4A4A);cursor:pointer;}&:active {transform:scale(0.9);}&:disabled {opacity:60%;pointer-events:none;}&.Active {background-color:var(--emw-color-bg-elements, #4A4A4A);}&.Elipsis {pointer-events:none;background-color:transparent;min-width:0;padding:0;align-self:center;}}}.LeaderboardTable.svelte-75jgrh {border-collapse:separate;border-spacing:0 12px;width:100%;table-layout:fixed;overflow:hidden;.PlayerRow:where(.svelte-75jgrh) {color:#F9C408;}thead:where(.svelte-75jgrh) th:where(.svelte-75jgrh) {background:transparent;padding:6px 16px;text-align:center;font-weight:400;color:var(--emw-color-typography-secondary, #bdbdbd);font-size:14px;}tbody:where(.svelte-75jgrh) tr:where(.svelte-75jgrh) {background-color:var(--emw-color-bg-section, #434343);color:var(--emw-color-typography-secondary, #bdbdbd);font-size:14px;font-weight:500;&:last-child{justify-self:end;}}tbody:where(.svelte-75jgrh) td:where(.svelte-75jgrh) {padding:12px;background-color:inherit;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}tbody:where(.svelte-75jgrh) td:where(.svelte-75jgrh):first-child {border-top-left-radius:8px;border-bottom-left-radius:8px;width:15%;}tbody:where(.svelte-75jgrh) td:where(.svelte-75jgrh):nth-child(2) {width:35%;}tbody:where(.svelte-75jgrh) td:where(.svelte-75jgrh):nth-child(3) {width:20%;}tbody:where(.svelte-75jgrh) td:where(.svelte-75jgrh):last-child {border-top-right-radius:8px;border-bottom-right-radius:8px;width:30%;}th:where(.svelte-75jgrh), td:where(.svelte-75jgrh) {text-align:center;vertical-align:middle;}tbody:where(.svelte-75jgrh) tr.Gold:where(.svelte-75jgrh){background:linear-gradient(to right, #a2851a, color-mix(in srgb, #a2851a 50%, var(--emw-color-bg-secondary, #434343) 50%), var(--emw-color-bg-secondary, #434343));}tbody:where(.svelte-75jgrh) tr.Silver:where(.svelte-75jgrh) {background:linear-gradient(to right, #b0aeae, color-mix(in srgb, #b0aeae, var(--emw-color-bg-secondary, #434343)), var(--emw-color-bg-secondary, #434343));}tbody:where(.svelte-75jgrh) tr.Bronze:where(.svelte-75jgrh) {background:linear-gradient(to right, #ac763c, color-mix(in srgb, #ac763c, var(--emw-color-bg-secondary, #434343)), var(--emw-color-bg-secondary, #434343));}}.EmptyLeaderboard.svelte-75jgrh {background-color:var(--emw-color-bg-secondary, #333232);color:var(--emw-color-typography-secondary, #bdbdbd);width:100%;border-radius:8px;margin:10px 0;text-align:center;padding:10px 0;}.SkeletonRow.svelte-75jgrh {height:41px;overflow:hidden;background-color:var(--emw-color-skeleton, #535353);
10
+ animation: svelte-75jgrh-pulse 1.5s infinite;}.PlayerRankSkeletonWrapper.svelte-75jgrh {display:flex;justify-content:space-between;width:100%;gap:6px;flex-direction:column;.PlayerRankSkeleton:where(.svelte-75jgrh) {width:100%;height:40px;border-radius:6px;background-color:var(--emw-color-skeleton, #535353);border-radius:6px;
11
+ animation: svelte-75jgrh-pulse 1s infinite;}}.PaginationSkeleton.svelte-75jgrh {display:flex;justify-content:space-between;gap:6px;.PaginationSkeletonButton:where(.svelte-75jgrh) {width:60px;height:35px;border-radius:6px;background-color:var(--emw-color-skeleton, #535353);overflow:hidden;position:relative;
12
+ animation: svelte-75jgrh-pulse 1s infinite;}.PaginationNumberSkeleton:where(.svelte-75jgrh) {width:40px;height:35px;border-radius:6px;background-color:var(--emw-color-skeleton, #535353);overflow:hidden;position:relative;
13
+ animation: svelte-75jgrh-pulse 1s infinite;}}
14
+
15
+ @keyframes svelte-75jgrh-pulse {
16
+ 0% {
17
+ opacity: 0;
18
+ }
19
+ 50% {
20
+ opacity: 1;
21
+ }
22
+ 100% {
23
+ opacity: 0;
24
+ }
25
+ }
26
+
27
+ @media (min-width: 1000px) {.ShowPlayersButton.svelte-75jgrh {display:block;width:300px;margin:auto;background-color:var(--emw-color-bg-primary, #212121);}
28
+ }
29
+
30
+ @media (min-width: 750px) {.PaginationWrapper.svelte-75jgrh, .PaginationSkeleton.svelte-75jgrh {justify-content:end;gap:10px;}.PaginationButton.svelte-75jgrh {min-width:75px;}.PaginationSkeleton.svelte-75jgrh {justify-content:end;gap:10px;.PaginationSkeletonButton:where(.svelte-75jgrh) {width:auto;min-width:55px;}.PaginationNumberSkeleton:where(.svelte-75jgrh) {width:25px;}}
31
+ }`};function ze(ee,W){e.push(W,!0),e.append_styles(ee,nt);const b=()=>e.store_get(e.$format,"$_",G),[G,te]=e.setup_stores(),P=e.prop(W,"endpoint"),V=e.prop(W,"language",7,"en"),$=e.prop(W,"session"),K=e.prop(W,"tournamentid"),B=e.prop(W,"platform"),ge=e.prop(W,"translationurl"),me=()=>{let r=new URL(ge());fetch(r.href).then(n=>n.json()).then(n=>{Object.keys(n).forEach(s=>{He(s,n[s])})}).catch(n=>{console.log(n)})};Object.keys(Ue).forEach(r=>{He(r,Ue[r])}),Me(V());const Re=()=>{Me(V())};e.user_pre_effect(()=>{ge()&&me()}),e.user_effect(()=>{Re()});let I=null,ie=e.state(void 0),le=e.state(!1),_e=e.state(!1),J=e.state(void 0),we=e.state(void 0),_=e.state(0),A=e.state(10),de=e.state(!0),re=e.state(void 0);const ce=()=>{if(z.has(e.get(ae)))return;e.set(le,!0);const r=new URL(`${P()}/v1/tournaments/${K()}/leaderboard`),n=new Headers;$()&&n.append("X-SessionId",$()),r.searchParams.append("language",V()),r.searchParams.append("platform",B()),r.searchParams.append("pagination",`offset=${e.get(_)},limit=${e.get(A)}`),fetch(r).then(s=>s.json()).then(s=>{e.set(ie,s==null?void 0:s.items,!0),e.set(re,s==null?void 0:s.total,!0),z.set(e.get(ae),e.get(ie)),e.get(de)||e.set(de,!0)}).catch(s=>console.log(s)).finally(()=>e.set(le,!1))},Te=r=>{const n=JSON.parse(r.data);n&&n.messageType==="LeaderBoardUpdate"&&e.set(ie,n==null?void 0:n.items,!0)},he=()=>{I&&(I.close(),I=null);const r=new URL(`${P()}/v1/tournaments/${K()}/leaderboard/updates`);r.searchParams.append("HeartBeat","false"),r.searchParams.append("language",V()),r.searchParams.append("filter","includeUnqualifiedPlayer=true"),r.searchParams.append("pagination",`offset=${e.get(_)},limit=${e.get(A)}`),r.searchParams.append("platform",B()),I=new qe.EventSourcePolyfill(r,{headers:{accept:"text/event-stream","X-SessionId":$()}}),I.onmessage=Te},fe=()=>{e.set(_e,!0);const r=new URL(`${P()}/v1/tournaments/leaderboard/player`),n=new Headers;r.searchParams.append("language",V()),r.searchParams.append("platform",B()),r.searchParams.append("filter","includeUnqualifiedPlayer=false"),$()&&n.append("X-SessionId",$()),fetch(r,{method:"GET",headers:n}).then(p=>p.json()).then(p=>{var v;const j=(v=p==null?void 0:p.items)==null?void 0:v.find(f=>{var g;return((g=f==null?void 0:f.tournament)==null?void 0:g.id)===K()});e.set(J,j==null?void 0:j.leaderBoard,!0),e.set(we,j==null?void 0:j.endRank,!0)}).catch(p=>{console.log(p)}).finally(()=>e.set(_e,!1))},Ce=()=>{e.get(_)<e.get(re)&&(e.set(_,e.get(_)+e.get(A)),ce(),he())},ne=()=>{e.get(_)!==0&&(e.set(_,e.get(_)-e.get(A)),ce(),he())},Ae=r=>{e.set(_,(r-1)*e.get(A)),ce(),he()},xe=()=>{const r=Math.ceil(e.get(re)/e.get(A)),n=Math.floor(e.get(_)/e.get(A))+1;if(r<=5)return Array.from({length:r},(p,j)=>j+1);const s=[];return s.push(1),n<=3?(s.push(2,3),s.push("..."),s.push(r)):n>=r-2?(s.push("..."),s.push(r-2,r-1,r)):(s.push("..."),s.push(n-1,n,n+1),s.push("..."),s.push(r)),s},Le=e.user_derived(xe),ae=e.user_derived(()=>Math.floor(e.get(_)/e.get(A))+1);let z=new Map,oe=e.user_derived(()=>{var r;return(r=z.get(e.get(ae)))!=null?r:[]});const ve=(r,n)=>{const s=[];return n&&s.push("PlayerRow"),r===1&&s.push("Gold"),r===2&&s.push("Silver"),r===3&&s.push("Bronze"),s.join(" ")};e.onMount(()=>(ce(),fe(),he(),()=>{I==null||I.close(),I=null}));var je={get endpoint(){return P()},set endpoint(r){P(r),e.flushSync()},get language(){return V()},set language(r="en"){V(r),e.flushSync()},get session(){return $()},set session(r){$(r),e.flushSync()},get tournamentid(){return K()},set tournamentid(r){K(r),e.flushSync()},get platform(){return B()},set platform(r){B(r),e.flushSync()},get translationurl(){return ge()},set translationurl(r){ge(r),e.flushSync()}},q=rt(),ue=e.child(q),Se=e.child(ue);{var De=r=>{var n=Ve(),s=e.child(n),p=e.child(s),j=e.child(p,!0);e.reset(p);var v=e.sibling(p,2),f=e.child(v,!0);e.reset(v);var g=e.sibling(v,2),k=e.child(g,!0);e.reset(g),e.reset(s);var R=e.sibling(s,2),T=e.child(R);{var H=S=>{var x=We(),N=e.first_child(x),Q=e.child(N);e.reset(N);var X=e.sibling(N,2),M=e.child(X,!0);e.reset(X);var C=e.sibling(X,2),m=e.child(C,!0);e.reset(C),e.template_effect(()=>{var y;e.set_text(Q,`${(y=e.get(J).rank)!=null?y:""}.`),e.set_text(M,e.get(J).score),e.set_text(m,e.get(J).prizeName||"—")}),e.append(S,x)},E=S=>{var x=e.comment(),N=e.first_child(x);{var Q=M=>{var C=Xe(),m=e.first_child(C),y=e.child(m);e.reset(m),e.next(4),e.template_effect(()=>{var D;return e.set_text(y,`${(D=e.get(we))!=null?D:""}.`)}),e.append(M,C)},X=M=>{var C=Ge(),m=e.child(C,!0);e.reset(C),e.template_effect(y=>e.set_text(m,y),[()=>b()("notEnrolledRank")]),e.append(M,C)};e.if_block(N,M=>{e.get(we)?M(Q):M(X,!1)},!0)}e.append(S,x)};e.if_block(T,S=>{e.get(J)?S(H):S(E,!1)})}e.reset(R),e.reset(n),e.template_effect((S,x,N)=>{e.set_text(j,S),e.set_text(f,x),e.set_text(k,N)},[()=>b()("myRanking"),()=>b()("points"),()=>b()("prize")]),e.append(r,n)},Oe=r=>{var n=$e();e.append(r,n)};e.if_block(Se,r=>{e.get(_e)?r(Oe,!1):r(De)})}var Ne=e.sibling(Se,2),ke=e.child(Ne),ye=e.child(ke),pe=e.child(ye),se=e.child(pe,!0);e.reset(pe);var O=e.sibling(pe),Fe=e.child(O,!0);e.reset(O);var Ee=e.sibling(O),Be=e.child(Ee,!0);e.reset(Ee);var Pe=e.sibling(Ee),t=e.child(Pe,!0);e.reset(Pe),e.reset(ye),e.reset(ke);var o=e.sibling(ke),i=e.child(o);{var a=r=>{var n=e.comment(),s=e.first_child(n);e.each(s,17,()=>Array(e.get(A)),e.index,(p,j,v,f)=>{var g=Ke();e.append(p,g)}),e.append(r,n)},d=r=>{var n=e.comment(),s=e.first_child(n);{var p=v=>{var f=e.comment(),g=e.first_child(f);e.each(g,17,()=>e.get(oe),k=>k.rank,(k,R)=>{var T=Je(),H=e.child(T),E=e.child(H);e.reset(H);var S=e.sibling(H),x=e.child(S,!0);e.reset(S);var N=e.sibling(S),Q=e.child(N,!0);e.reset(N);var X=e.sibling(N),M=e.child(X,!0);e.reset(X),e.reset(T),e.template_effect(C=>{var m;e.set_class(T,1,C,"svelte-75jgrh"),e.set_text(E,`${(m=e.get(R).rank)!=null?m:""}.`),e.set_text(x,e.get(R).shortName||"—"),e.set_text(Q,e.get(R).score||"—"),e.set_text(M,e.get(R).prizeName||"—")},[()=>{var C;return e.clsx(ve(e.get(R).rank,e.get(R).rank===((C=e.get(J))==null?void 0:C.rank)))}]),e.append(k,T)}),e.append(v,f)},j=v=>{var f=Qe(),g=e.child(f),k=e.child(g),R=e.child(k),T=e.child(R,!0);e.reset(R),e.reset(k),e.reset(g),e.reset(f),e.template_effect(H=>e.set_text(T,H),[()=>b()("emptyLeaderboard")]),e.append(v,f)};e.if_block(s,v=>{var f;((f=e.get(ie))==null?void 0:f.length)>0?v(p):v(j,!1)},!0)}e.append(r,n)};e.if_block(i,r=>{e.get(le)?r(a):r(d,!1)})}e.reset(o),e.reset(Ne),e.reset(ue);var l=e.sibling(ue,2);{var c=r=>{var n=Ye();e.append(r,n)};e.if_block(l,r=>{e.get(de)||r(c)})}var w=e.sibling(l,2);{var h=r=>{var n=tt(),s=e.child(n);s.__click=ne;var p=e.child(s,!0);e.reset(s);var j=e.sibling(s,2);e.each(j,21,()=>e.get(Le),e.index,(g,k)=>{var R=e.comment(),T=e.first_child(R);{var H=S=>{var x=Ze();e.append(S,x)},E=S=>{var x=et();let N;x.__click=()=>Ae(e.get(k));var Q=e.child(x,!0);e.reset(x),e.template_effect(()=>{N=e.set_class(x,1,"PaginationButton Number svelte-75jgrh",null,N,{Active:e.get(k)===e.get(ae)}),e.set_text(Q,e.get(k))}),e.append(S,x)};e.if_block(T,S=>{typeof e.get(k)!="number"?S(H):S(E,!1)})}e.append(g,R)}),e.reset(j);var v=e.sibling(j,2);v.__click=Ce;var f=e.child(v,!0);e.reset(v),e.reset(n),e.template_effect((g,k)=>{s.disabled=e.get(_)===0,e.set_text(p,g),v.disabled=e.get(_)>=e.get(re)-e.get(A),e.set_text(f,k)},[()=>b()("previousButton"),()=>b()("nextButton")]),e.append(r,n)};e.if_block(w,r=>{e.get(de)&&e.get(re)>e.get(A)&&r(h)})}e.reset(q),e.template_effect((r,n,s,p)=>{e.set_text(se,r),e.set_text(Fe,n),e.set_text(Be,s),e.set_text(t,p)},[()=>b()("rank"),()=>b()("user"),()=>b()("points"),()=>b()("prize")]),e.append(ee,q);var u=e.pop(je);return te(),u}e.delegate(["click"]);customElements.define("tournament-leaderboard",e.create_custom_element(ze,{endpoint:{},language:{},session:{},tournamentid:{},platform:{},translationurl:{}},[],[],!1));exports.default=ze;