@everymatrix/tournament-details-page 0.1.2 → 0.1.3

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.
@@ -1,848 +0,0 @@
1
- import { a as it, $ as lt, c as dt, p as ct, b as vt, d as Se, u as ut, e as tt, o as ht, i as be, g as i, t as ve, f as D, h as ft, s as pt, j as ue, k as V, l as Ye, m as ke, n as f, q as Ue, r as Pe, v as Ze, w as O, x as J, y as L, z as rt, A as gt, B as yt, C as mt, D as bt, E as h, F as wt, G as _t, H as nt } from "./TournamentDetailsPage-CqwgEfgR.js";
2
- function at(he, K) {
3
- it(he, K);
4
- }
5
- function ot(he) {
6
- lt.set(he);
7
- }
8
- const st = {
9
- en: {
10
- rank: "Rank",
11
- user: "User",
12
- points: "Points",
13
- prize: "Prize",
14
- notEnrolledRank: "You are currently not enrolled in this tournament",
15
- myRanking: "My Ranking",
16
- showMore: "Show More",
17
- showLess: "Show Less",
18
- emptyLeaderboard: "Currently there are no players enrolled in this tournament",
19
- joinButton: "Join",
20
- previousButton: "Previous",
21
- nextButton: "Next"
22
- },
23
- tr: {
24
- rank: "Sıralama",
25
- user: "Kullanıcı",
26
- points: "Puan",
27
- prize: "Ödül",
28
- notEnrolledRank: "Şu anda bu turnuvaya kayıtlı değilsiniz",
29
- myRanking: "Sıralamam",
30
- showMore: "Daha Fazla Göster",
31
- showLess: "Daha Az Göster",
32
- emptyLeaderboard: "Şu anda bu turnuvaya kayıtlı oyuncu bulunmuyor",
33
- joinButton: "Katıl",
34
- previousButton: "Önceki",
35
- nextButton: "Sonraki"
36
- }
37
- };
38
- var et = { exports: {} };
39
- /** @license
40
- * eventsource.js
41
- * Available under MIT License (MIT)
42
- * https://github.com/Yaffle/EventSource/
43
- */
44
- (function(he, K) {
45
- (function(x) {
46
- var Y = x.setTimeout, fe = x.clearTimeout, T = x.XMLHttpRequest, Z = x.XDomainRequest, ee = x.ActiveXObject, te = x.EventSource, q = x.document, Re = x.Promise, ie = x.fetch, ze = x.Response, Te = x.TextDecoder, $ = x.TextEncoder, pe = x.AbortController;
47
- if (typeof window != "undefined" && typeof q != "undefined" && !("readyState" in q) && q.body == null && (q.readyState = "loading", window.addEventListener("load", function(t) {
48
- q.readyState = "complete";
49
- }, !1)), T == null && ee != null && (T = function() {
50
- return new ee("Microsoft.XMLHTTP");
51
- }), Object.create == null && (Object.create = function(t) {
52
- function n() {
53
- }
54
- return n.prototype = t, new n();
55
- }), Date.now || (Date.now = function() {
56
- return (/* @__PURE__ */ new Date()).getTime();
57
- }), pe == null) {
58
- var De = ie;
59
- ie = function(t, n) {
60
- var o = n.signal;
61
- return De(t, { headers: n.headers, credentials: n.credentials, cache: n.cache }).then(function(r) {
62
- var d = r.body.getReader();
63
- return o._reader = d, o._aborted && o._reader.cancel(), {
64
- status: r.status,
65
- statusText: r.statusText,
66
- headers: r.headers,
67
- body: {
68
- getReader: function() {
69
- return d;
70
- }
71
- }
72
- };
73
- });
74
- }, pe = function() {
75
- this.signal = {
76
- _reader: null,
77
- _aborted: !1
78
- }, this.abort = function() {
79
- this.signal._reader != null && this.signal._reader.cancel(), this.signal._aborted = !0;
80
- };
81
- };
82
- }
83
- function Ce() {
84
- this.bitsNeeded = 0, this.codePoint = 0;
85
- }
86
- Ce.prototype.decode = function(t) {
87
- function n(g, w, e) {
88
- if (e === 1)
89
- return g >= 128 >> w && g << w <= 2047;
90
- if (e === 2)
91
- return g >= 2048 >> w && g << w <= 55295 || g >= 57344 >> w && g << w <= 65535;
92
- if (e === 3)
93
- return g >= 65536 >> w && g << w <= 1114111;
94
- throw new Error();
95
- }
96
- function o(g, w) {
97
- if (g === 6 * 1)
98
- return w >> 6 > 15 ? 3 : w > 31 ? 2 : 1;
99
- if (g === 6 * 2)
100
- return w > 15 ? 3 : 2;
101
- if (g === 6 * 3)
102
- return 3;
103
- throw new Error();
104
- }
105
- for (var r = 65533, d = "", l = this.bitsNeeded, c = this.codePoint, E = 0; E < t.length; E += 1) {
106
- var v = t[E];
107
- l !== 0 && (v < 128 || v > 191 || !n(c << 6 | v & 63, l - 6, o(l, c))) && (l = 0, c = r, d += String.fromCharCode(c)), l === 0 ? (v >= 0 && v <= 127 ? (l = 0, c = v) : v >= 192 && v <= 223 ? (l = 6 * 1, c = v & 31) : v >= 224 && v <= 239 ? (l = 6 * 2, c = v & 15) : v >= 240 && v <= 247 ? (l = 6 * 3, c = v & 7) : (l = 0, c = r), l !== 0 && !n(c, l, o(l, c)) && (l = 0, c = r)) : (l -= 6, c = c << 6 | v & 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))));
108
- }
109
- return this.bitsNeeded = l, this.codePoint = c, d;
110
- };
111
- var ge = function() {
112
- try {
113
- return new Te().decode(new $().encode("test"), { stream: !0 }) === "test";
114
- } catch (t) {
115
- console.debug("TextDecoder does not support streaming option. Using polyfill instead: " + t);
116
- }
117
- return !1;
118
- };
119
- (Te == null || $ == null || !ge()) && (Te = Ce);
120
- var M = function() {
121
- };
122
- function R(t) {
123
- this.withCredentials = !1, this.readyState = 0, this.status = 0, this.statusText = "", this.responseText = "", this.onprogress = M, this.onload = M, this.onerror = M, this.onreadystatechange = M, this._contentType = "", this._xhr = t, this._sendTimeout = 0, this._abort = M;
124
- }
125
- R.prototype.open = function(t, n) {
126
- this._abort(!0);
127
- var o = this, r = this._xhr, d = 1, l = 0;
128
- this._abort = function(e) {
129
- o._sendTimeout !== 0 && (fe(o._sendTimeout), o._sendTimeout = 0), (d === 1 || d === 2 || d === 3) && (d = 4, r.onload = M, r.onerror = M, r.onabort = M, r.onprogress = M, r.onreadystatechange = M, r.abort(), l !== 0 && (fe(l), l = 0), e || (o.readyState = 4, o.onabort(null), o.onreadystatechange())), d = 0;
130
- };
131
- var c = function() {
132
- if (d === 1) {
133
- var e = 0, a = "", s = void 0;
134
- if ("contentType" in r)
135
- e = 200, a = "OK", s = r.contentType;
136
- else
137
- try {
138
- e = r.status, a = r.statusText, s = r.getResponseHeader("Content-Type");
139
- } catch (j) {
140
- e = 0, a = "", s = void 0;
141
- }
142
- e !== 0 && (d = 2, o.readyState = 2, o.status = e, o.statusText = a, o._contentType = s, o.onreadystatechange());
143
- }
144
- }, E = function() {
145
- if (c(), d === 2 || d === 3) {
146
- d = 3;
147
- var e = "";
148
- try {
149
- e = r.responseText;
150
- } catch (a) {
151
- }
152
- o.readyState = 3, o.responseText = e, o.onprogress();
153
- }
154
- }, v = function(e, a) {
155
- if ((a == null || a.preventDefault == null) && (a = {
156
- preventDefault: M
157
- }), E(), d === 1 || d === 2 || d === 3) {
158
- if (d = 4, l !== 0 && (fe(l), l = 0), o.readyState = 4, e === "load")
159
- o.onload(a);
160
- else if (e === "error")
161
- o.onerror(a);
162
- else if (e === "abort")
163
- o.onabort(a);
164
- else
165
- throw new TypeError();
166
- o.onreadystatechange();
167
- }
168
- }, g = function(e) {
169
- r != null && (r.readyState === 4 ? (!("onload" in r) || !("onerror" in r) || !("onabort" in r)) && v(r.responseText === "" ? "error" : "load", e) : r.readyState === 3 ? "onprogress" in r || E() : r.readyState === 2 && c());
170
- }, w = function() {
171
- l = Y(function() {
172
- w();
173
- }, 500), r.readyState === 3 && E();
174
- };
175
- "onload" in r && (r.onload = function(e) {
176
- v("load", e);
177
- }), "onerror" in r && (r.onerror = function(e) {
178
- v("error", e);
179
- }), "onabort" in r && (r.onabort = function(e) {
180
- v("abort", e);
181
- }), "onprogress" in r && (r.onprogress = E), "onreadystatechange" in r && (r.onreadystatechange = function(e) {
182
- g(e);
183
- }), ("contentType" in r || !("ontimeout" in T.prototype)) && (n += (n.indexOf("?") === -1 ? "?" : "&") + "padding=true"), r.open(t, n, !0), "readyState" in r && (l = Y(function() {
184
- w();
185
- }, 0));
186
- }, R.prototype.abort = function() {
187
- this._abort(!1);
188
- }, R.prototype.getResponseHeader = function(t) {
189
- return this._contentType;
190
- }, R.prototype.setRequestHeader = function(t, n) {
191
- var o = this._xhr;
192
- "setRequestHeader" in o && o.setRequestHeader(t, n);
193
- }, R.prototype.getAllResponseHeaders = function() {
194
- return this._xhr.getAllResponseHeaders != null && this._xhr.getAllResponseHeaders() || "";
195
- }, R.prototype.send = function() {
196
- if ((!("ontimeout" in T.prototype) || !("sendAsBinary" in T.prototype) && !("mozAnon" in T.prototype)) && q != null && q.readyState != null && q.readyState !== "complete") {
197
- var t = this;
198
- t._sendTimeout = Y(function() {
199
- t._sendTimeout = 0, t.send();
200
- }, 4);
201
- return;
202
- }
203
- var n = this._xhr;
204
- "withCredentials" in n && (n.withCredentials = this.withCredentials);
205
- try {
206
- n.send(void 0);
207
- } catch (o) {
208
- throw o;
209
- }
210
- };
211
- function W(t) {
212
- return t.replace(/[A-Z]/g, function(n) {
213
- return String.fromCharCode(n.charCodeAt(0) + 32);
214
- });
215
- }
216
- function we(t) {
217
- for (var n = /* @__PURE__ */ Object.create(null), o = t.split(`\r
218
- `), r = 0; r < o.length; r += 1) {
219
- var d = o[r], l = d.split(": "), c = l.shift(), E = l.join(": ");
220
- n[W(c)] = E;
221
- }
222
- this._map = n;
223
- }
224
- we.prototype.get = function(t) {
225
- return this._map[W(t)];
226
- }, T != null && T.HEADERS_RECEIVED == null && (T.HEADERS_RECEIVED = 2);
227
- function ye() {
228
- }
229
- ye.prototype.open = function(t, n, o, r, d, l, c) {
230
- t.open("GET", d);
231
- var E = 0;
232
- t.onprogress = function() {
233
- var g = t.responseText, w = g.slice(E);
234
- E += w.length, o(w);
235
- }, t.onerror = function(g) {
236
- g.preventDefault(), r(new Error("NetworkError"));
237
- }, t.onload = function() {
238
- r(null);
239
- }, t.onabort = function() {
240
- r(null);
241
- }, t.onreadystatechange = function() {
242
- if (t.readyState === T.HEADERS_RECEIVED) {
243
- var g = t.status, w = t.statusText, e = t.getResponseHeader("Content-Type"), a = t.getAllResponseHeaders();
244
- n(g, w, e, new we(a));
245
- }
246
- }, t.withCredentials = l;
247
- for (var v in c)
248
- Object.prototype.hasOwnProperty.call(c, v) && t.setRequestHeader(v, c[v]);
249
- return t.send(), t;
250
- };
251
- function _e(t) {
252
- this._headers = t;
253
- }
254
- _e.prototype.get = function(t) {
255
- return this._headers.get(t);
256
- };
257
- function qe() {
258
- }
259
- qe.prototype.open = function(t, n, o, r, d, l, c) {
260
- var E = null, v = new pe(), g = v.signal, w = new Te();
261
- return ie(d, {
262
- headers: c,
263
- credentials: l ? "include" : "same-origin",
264
- signal: g,
265
- cache: "no-store"
266
- }).then(function(e) {
267
- return E = e.body.getReader(), n(e.status, e.statusText, e.headers.get("Content-Type"), new _e(e.headers)), new Re(function(a, s) {
268
- var j = function() {
269
- E.read().then(function(y) {
270
- if (y.done)
271
- a(void 0);
272
- else {
273
- var u = w.decode(y.value, { stream: !0 });
274
- o(u), j();
275
- }
276
- }).catch(function(y) {
277
- s(y);
278
- });
279
- };
280
- j();
281
- });
282
- }).catch(function(e) {
283
- if (e.name !== "AbortError")
284
- return e;
285
- }).then(function(e) {
286
- r(e);
287
- }), {
288
- abort: function() {
289
- E != null && E.cancel(), v.abort();
290
- }
291
- };
292
- };
293
- function re() {
294
- this._listeners = /* @__PURE__ */ Object.create(null);
295
- }
296
- function Fe(t) {
297
- Y(function() {
298
- throw t;
299
- }, 0);
300
- }
301
- re.prototype.dispatchEvent = function(t) {
302
- t.target = this;
303
- var n = this._listeners[t.type];
304
- if (n != null)
305
- for (var o = n.length, r = 0; r < o; r += 1) {
306
- var d = n[r];
307
- try {
308
- typeof d.handleEvent == "function" ? d.handleEvent(t) : d.call(this, t);
309
- } catch (l) {
310
- Fe(l);
311
- }
312
- }
313
- }, re.prototype.addEventListener = function(t, n) {
314
- t = String(t);
315
- var o = this._listeners, r = o[t];
316
- r == null && (r = [], o[t] = r);
317
- for (var d = !1, l = 0; l < r.length; l += 1)
318
- r[l] === n && (d = !0);
319
- d || r.push(n);
320
- }, re.prototype.removeEventListener = function(t, n) {
321
- t = String(t);
322
- var o = this._listeners, r = o[t];
323
- if (r != null) {
324
- for (var d = [], l = 0; l < r.length; l += 1)
325
- r[l] !== n && d.push(r[l]);
326
- d.length === 0 ? delete o[t] : o[t] = d;
327
- }
328
- };
329
- function me(t) {
330
- this.type = t, this.target = void 0;
331
- }
332
- function We(t, n) {
333
- me.call(this, t), this.data = n.data, this.lastEventId = n.lastEventId;
334
- }
335
- We.prototype = Object.create(me.prototype);
336
- function Oe(t, n) {
337
- me.call(this, t), this.status = n.status, this.statusText = n.statusText, this.headers = n.headers;
338
- }
339
- Oe.prototype = Object.create(me.prototype);
340
- function Je(t, n) {
341
- me.call(this, t), this.error = n.error;
342
- }
343
- Je.prototype = Object.create(me.prototype);
344
- var Be = -1, X = 0, ne = 1, je = 2, He = -1, ae = 0, xe = 1, Ae = 2, Xe = 3, Ke = /^text\/event\-stream(;.*)?$/i, $e = 1e3, Ge = 18e6, Ee = function(t, n) {
345
- var o = t == null ? n : parseInt(t, 10);
346
- return o !== o && (o = n), Le(o);
347
- }, Le = function(t) {
348
- return Math.min(Math.max(t, $e), Ge);
349
- }, oe = function(t, n, o) {
350
- try {
351
- typeof n == "function" && n.call(t, o);
352
- } catch (r) {
353
- Fe(r);
354
- }
355
- };
356
- function G(t, n) {
357
- re.call(this), n = n || {}, 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, Me(this, t, n);
358
- }
359
- function Ie() {
360
- return T != null && "withCredentials" in T.prototype || Z == null ? new T() : new Z();
361
- }
362
- var Qe = ie != null && ze != null && "body" in ze.prototype;
363
- function Me(t, n, o) {
364
- n = String(n);
365
- var r = !!o.withCredentials, d = o.lastEventIdQueryParameterName || "lastEventId", l = Le(1e3), c = Ee(o.heartbeatTimeout, 45e3), E = "", v = l, g = !1, w = 0, e = o.headers || {}, a = o.Transport, s = Qe && a == null ? void 0 : new R(a != null ? new a() : Ie()), j = a != null && typeof a != "string" ? new a() : s == null ? new qe() : new ye(), y = void 0, u = 0, m = Be, P = "", C = "", S = "", U = "", k = ae, le = 0, _ = 0, N = function(p, b, A, I) {
366
- if (m === X)
367
- if (p === 200 && A != null && Ke.test(A)) {
368
- m = ne, g = Date.now(), v = l, t.readyState = ne;
369
- var z = new Oe("open", {
370
- status: p,
371
- statusText: b,
372
- headers: I
373
- });
374
- t.dispatchEvent(z), oe(t, t.onopen, z);
375
- } else {
376
- var F = "";
377
- p !== 200 ? (b && (b = b.replace(/\s+/g, " ")), F = "EventSource's response has a status " + p + " " + b + " that is not 200. Aborting the connection.") : F = "EventSource's response has a Content-Type specifying an unsupported type: " + (A == null ? "-" : A.replace(/\s+/g, " ")) + ". Aborting the connection.", Q();
378
- var z = new Oe("error", {
379
- status: p,
380
- statusText: b,
381
- headers: I
382
- });
383
- t.dispatchEvent(z), oe(t, t.onerror, z), console.error(F);
384
- }
385
- }, B = function(p) {
386
- if (m === ne) {
387
- for (var b = -1, A = 0; A < p.length; A += 1) {
388
- var I = p.charCodeAt(A);
389
- (I === 10 || I === 13) && (b = A);
390
- }
391
- var z = (b !== -1 ? U : "") + p.slice(0, b + 1);
392
- U = (b === -1 ? U : "") + p.slice(b + 1), p !== "" && (g = Date.now(), w += p.length);
393
- for (var F = 0; F < z.length; F += 1) {
394
- var I = z.charCodeAt(F);
395
- if (k === He && I === 10)
396
- k = ae;
397
- else if (k === He && (k = ae), I === 13 || I === 10) {
398
- if (k !== ae) {
399
- k === xe && (_ = F + 1);
400
- var de = z.slice(le, _ - 1), ce = z.slice(_ + (_ < F && z.charCodeAt(_) === 32 ? 1 : 0), F);
401
- de === "data" ? (P += `
402
- `, P += ce) : de === "id" ? C = ce : de === "event" ? S = ce : de === "retry" ? (l = Ee(ce, l), v = l) : de === "heartbeatTimeout" && (c = Ee(ce, c), u !== 0 && (fe(u), u = Y(function() {
403
- H();
404
- }, c)));
405
- }
406
- if (k === ae) {
407
- if (P !== "") {
408
- E = C, S === "" && (S = "message");
409
- var Ne = new We(S, {
410
- data: P.slice(1),
411
- lastEventId: C
412
- });
413
- if (t.dispatchEvent(Ne), S === "open" ? oe(t, t.onopen, Ne) : S === "message" ? oe(t, t.onmessage, Ne) : S === "error" && oe(t, t.onerror, Ne), m === je)
414
- return;
415
- }
416
- P = "", S = "";
417
- }
418
- k = I === 13 ? He : ae;
419
- } else
420
- k === ae && (le = F, k = xe), k === xe ? I === 58 && (_ = F + 1, k = Ae) : k === Ae && (k = Xe);
421
- }
422
- }
423
- }, se = function(p) {
424
- if (m === ne || m === X) {
425
- m = Be, u !== 0 && (fe(u), u = 0), u = Y(function() {
426
- H();
427
- }, v), v = Le(Math.min(l * 16, v * 2)), t.readyState = X;
428
- var b = new Je("error", { error: p });
429
- t.dispatchEvent(b), oe(t, t.onerror, b), p != null && console.error(p);
430
- }
431
- }, Q = function() {
432
- m = je, y != null && (y.abort(), y = void 0), u !== 0 && (fe(u), u = 0), t.readyState = je;
433
- }, H = function() {
434
- if (u = 0, m !== Be) {
435
- if (!g && y != null)
436
- se(new Error("No activity within " + c + " milliseconds. " + (m === X ? "No response received." : w + " chars received.") + " Reconnecting.")), y != null && (y.abort(), y = void 0);
437
- else {
438
- var p = Math.max((g || Date.now()) + c - Date.now(), 1);
439
- g = !1, u = Y(function() {
440
- H();
441
- }, p);
442
- }
443
- return;
444
- }
445
- g = !1, w = 0, u = Y(function() {
446
- H();
447
- }, c), m = X, P = "", S = "", C = E, U = "", le = 0, _ = 0, k = ae;
448
- var b = n;
449
- if (n.slice(0, 5) !== "data:" && n.slice(0, 5) !== "blob:" && E !== "") {
450
- var A = n.indexOf("?");
451
- b = A === -1 ? n : n.slice(0, A + 1) + n.slice(A + 1).replace(/(?:^|&)([^=&]*)(?:=[^&]*)?/g, function(ce, Ne) {
452
- return Ne === d ? "" : ce;
453
- }), b += (n.indexOf("?") === -1 ? "?" : "&") + d + "=" + encodeURIComponent(E);
454
- }
455
- var I = t.withCredentials, z = {};
456
- z.Accept = "text/event-stream";
457
- var F = t.headers;
458
- if (F != null)
459
- for (var de in F)
460
- Object.prototype.hasOwnProperty.call(F, de) && (z[de] = F[de]);
461
- try {
462
- y = j.open(s, N, B, se, b, I, z);
463
- } catch (ce) {
464
- throw Q(), ce;
465
- }
466
- };
467
- t.url = n, t.readyState = X, t.withCredentials = r, t.headers = e, t._close = Q, H();
468
- }
469
- G.prototype = Object.create(re.prototype), G.prototype.CONNECTING = X, G.prototype.OPEN = ne, G.prototype.CLOSED = je, G.prototype.close = function() {
470
- this._close();
471
- }, G.CONNECTING = X, G.OPEN = ne, G.CLOSED = je, G.prototype.withCredentials = void 0;
472
- var Ve = te;
473
- T != null && (te == null || !("withCredentials" in te.prototype)) && (Ve = G), function(t) {
474
- {
475
- var n = t(K);
476
- n !== void 0 && (he.exports = n);
477
- }
478
- }(function(t) {
479
- t.EventSourcePolyfill = G, t.NativeEventSource = te, t.EventSource = Ve;
480
- });
481
- })(typeof globalThis == "undefined" ? typeof window != "undefined" ? window : typeof self != "undefined" ? self : dt : globalThis);
482
- })(et, et.exports);
483
- var jt = et.exports, xt = J('<span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh"> </span>', 1), Et = J('<span class="svelte-75jgrh"> </span> <span class="svelte-75jgrh">—</span> <span class="svelte-75jgrh">—</span>', 1), St = J('<p class="svelte-75jgrh"> </p>'), kt = J('<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>'), Pt = J('<div class="PlayerRankSkeletonWrapper svelte-75jgrh"><div class="PlayerRankSkeleton svelte-75jgrh"></div> <div class="PlayerRankSkeleton svelte-75jgrh"></div></div>'), Rt = J('<tr class="SkeletonRow svelte-75jgrh"><td colspan="4" class="svelte-75jgrh"></td></tr>'), Tt = J('<tr><td class="svelte-75jgrh"> </td><td class="svelte-75jgrh"> </td><td class="svelte-75jgrh"> </td><td class="svelte-75jgrh"> </td></tr>'), Ct = J('<tr class="svelte-75jgrh"><td colspan="4" class="svelte-75jgrh"><div class="EmptyLeaderboard svelte-75jgrh"><p class="svelte-75jgrh"> </p></div></td></tr>'), At = J('<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>'), Lt = J('<span class="PaginationButton Elipsis svelte-75jgrh">...</span>'), Nt = J("<button> </button>"), Dt = J('<div class="PaginationWrapper svelte-75jgrh"><button class="PaginationButton svelte-75jgrh"> </button> <div class="PageNumberWrapper svelte-75jgrh"></div> <button class="PaginationButton svelte-75jgrh"> </button></div>'), Ft = J('<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>');
484
- const Ot = {
485
- hash: "svelte-75jgrh",
486
- code: `.svelte-75jgrh,
487
- .svelte-75jgrh::before,
488
- .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);
489
- 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;
490
- 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;
491
- 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;
492
- animation: svelte-75jgrh-pulse 1s infinite;}}
493
-
494
- @keyframes svelte-75jgrh-pulse {
495
- 0% {
496
- opacity: 0;
497
- }
498
- 50% {
499
- opacity: 1;
500
- }
501
- 100% {
502
- opacity: 0;
503
- }
504
- }
505
-
506
- @media (min-width: 1000px) {.ShowPlayersButton.svelte-75jgrh {display:block;width:300px;margin:auto;background-color:var(--emw-color-bg-primary, #212121);}
507
- }
508
-
509
- @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;}}
510
- }`
511
- };
512
- function Bt(he, K) {
513
- ct(K, !0), vt(he, Ot);
514
- const x = () => mt(bt, "$_", Y), [Y, fe] = pt(), T = Se(K, "endpoint"), Z = Se(K, "language", 7, "en"), ee = Se(K, "session"), te = Se(K, "tournamentid"), q = Se(K, "platform"), Re = Se(K, "translationurl"), ie = Se(K, "newlyEnrolled"), ze = () => {
515
- let e = new URL(Re());
516
- fetch(e.href).then((a) => a.json()).then((a) => {
517
- Object.keys(a).forEach((s) => {
518
- at(s, a[s]);
519
- });
520
- }).catch((a) => {
521
- console.log(a);
522
- });
523
- };
524
- Object.keys(st).forEach((e) => {
525
- at(e, st[e]);
526
- }), ot(Z());
527
- const Te = () => {
528
- ot(Z());
529
- };
530
- ut(() => {
531
- Re() && ze();
532
- }), tt(() => {
533
- Te();
534
- });
535
- let $ = null, pe = ue(void 0), De = ue(!1), Ce = ue(!1), ge = ue(void 0), M = ue(void 0), R = ue(0), W = ue(10), we = ue(!0), ye = ue(void 0);
536
- const _e = () => {
537
- if (ne.has(i(X)))
538
- return;
539
- V(De, !0);
540
- const e = new URL(`${T()}/v1/tournaments/${te()}/leaderboard`), a = new Headers();
541
- ee() && a.append("X-SessionId", ee()), e.searchParams.append("language", Z()), e.searchParams.append("platform", q()), e.searchParams.append("pagination", `offset=${i(R)},limit=${i(W)}`), fetch(e).then((s) => s.json()).then((s) => {
542
- V(pe, s == null ? void 0 : s.items, !0), V(ye, s == null ? void 0 : s.total, !0), ne.set(i(X), i(pe)), i(we) || V(we, !0);
543
- }).catch((s) => console.log(s)).finally(() => V(De, !1));
544
- }, qe = (e) => {
545
- const a = JSON.parse(e.data);
546
- a && a.messageType === "LeaderBoardUpdate" && V(pe, a == null ? void 0 : a.items, !0);
547
- }, re = () => {
548
- $ && ($.close(), $ = null);
549
- const e = new URL(`${T()}/v1/tournaments/${te()}/leaderboard/updates`);
550
- e.searchParams.append("HeartBeat", "false"), e.searchParams.append("language", Z()), e.searchParams.append("filter", "includeUnqualifiedPlayer=true"), e.searchParams.append("pagination", `offset=${i(R)},limit=${i(W)}`), e.searchParams.append("platform", q()), $ = new jt.EventSourcePolyfill(e, {
551
- headers: { accept: "text/event-stream", "X-SessionId": ee() }
552
- }), $.onmessage = qe;
553
- }, Fe = () => {
554
- console.log("fetcjhing player rank"), V(Ce, !0);
555
- const e = new URL(`${T()}/v1/tournaments/leaderboard/player`), a = new Headers();
556
- e.searchParams.append("language", Z()), e.searchParams.append("platform", q()), e.searchParams.append("filter", "includeUnqualifiedPlayer=false"), ee() && a.append("X-SessionId", ee()), fetch(e, { method: "GET", headers: a }).then((j) => j.json()).then((j) => {
557
- var u;
558
- const y = (u = j == null ? void 0 : j.items) == null ? void 0 : u.find((m) => {
559
- var P;
560
- return ((P = m == null ? void 0 : m.tournament) == null ? void 0 : P.id) === te();
561
- });
562
- V(ge, y == null ? void 0 : y.leaderBoard, !0), V(M, y == null ? void 0 : y.endRank, !0);
563
- }).catch((j) => {
564
- console.log(j);
565
- }).finally(() => V(Ce, !1));
566
- }, me = () => {
567
- i(R) < i(ye) && (V(R, i(R) + i(W)), _e(), re());
568
- }, We = () => {
569
- i(R) !== 0 && (V(R, i(R) - i(W)), _e(), re());
570
- }, Oe = (e) => {
571
- V(R, (e - 1) * i(W)), _e(), re();
572
- }, Be = Ye(() => {
573
- const e = Math.ceil(i(ye) / i(W)), a = Math.floor(i(R) / i(W)) + 1;
574
- if (e <= 5)
575
- return Array.from({ length: e }, (j, y) => y + 1);
576
- const s = [];
577
- return s.push(1), a <= 3 ? (s.push(2, 3), s.push("..."), s.push(e)) : a >= e - 2 ? (s.push("..."), s.push(e - 2, e - 1, e)) : (s.push("..."), s.push(a - 1, a, a + 1), s.push("..."), s.push(e)), s;
578
- }), X = Ye(() => Math.floor(i(R) / i(W)) + 1);
579
- let ne = /* @__PURE__ */ new Map(), je = Ye(() => {
580
- var e;
581
- return (e = ne.get(i(X))) != null ? e : [];
582
- });
583
- const He = (e, a) => {
584
- const s = [];
585
- return a && s.push("PlayerRow"), e === 1 && s.push("Gold"), e === 2 && s.push("Silver"), e === 3 && s.push("Bronze"), s.join(" ");
586
- };
587
- tt(() => {
588
- console.log(ie(), "---- effect reacting to newly enrolled"), ie() && Fe();
589
- }), ht(() => (_e(), Fe(), re(), () => {
590
- $ == null || $.close(), $ = null;
591
- }));
592
- var ae = {
593
- get endpoint() {
594
- return T();
595
- },
596
- set endpoint(e) {
597
- T(e), ke();
598
- },
599
- get language() {
600
- return Z();
601
- },
602
- set language(e = "en") {
603
- Z(e), ke();
604
- },
605
- get session() {
606
- return ee();
607
- },
608
- set session(e) {
609
- ee(e), ke();
610
- },
611
- get tournamentid() {
612
- return te();
613
- },
614
- set tournamentid(e) {
615
- te(e), ke();
616
- },
617
- get platform() {
618
- return q();
619
- },
620
- set platform(e) {
621
- q(e), ke();
622
- },
623
- get translationurl() {
624
- return Re();
625
- },
626
- set translationurl(e) {
627
- Re(e), ke();
628
- },
629
- get newlyEnrolled() {
630
- return ie();
631
- },
632
- set newlyEnrolled(e) {
633
- ie(e), ke();
634
- }
635
- }, xe = Ft(), Ae = f(xe), Xe = f(Ae);
636
- {
637
- var Ke = (e) => {
638
- var a = kt(), s = f(a), j = f(s), y = f(j, !0);
639
- h(j);
640
- var u = O(j, 2), m = f(u, !0);
641
- h(u);
642
- var P = O(u, 2), C = f(P, !0);
643
- h(P), h(s);
644
- var S = O(s, 2), U = f(S);
645
- {
646
- var k = (_) => {
647
- var N = xt(), B = Pe(N), se = f(B);
648
- h(B);
649
- var Q = O(B, 2), H = f(Q, !0);
650
- h(Q);
651
- var p = O(Q, 2), b = f(p, !0);
652
- h(p), ve(() => {
653
- var A;
654
- L(se, `${(A = i(ge).rank) != null ? A : ""}.`), L(H, i(ge).score), L(b, i(ge).prizeName || "—");
655
- }), D(_, N);
656
- }, le = (_) => {
657
- var N = Ue(), B = Pe(N);
658
- {
659
- var se = (H) => {
660
- var p = Et(), b = Pe(p), A = f(b);
661
- h(b), wt(4), ve(() => {
662
- var I;
663
- return L(A, `${(I = i(M)) != null ? I : ""}.`);
664
- }), D(H, p);
665
- }, Q = (H) => {
666
- var p = St(), b = f(p, !0);
667
- h(p), ve((A) => L(b, A), [() => x()("notEnrolledRank")]), D(H, p);
668
- };
669
- be(
670
- B,
671
- (H) => {
672
- i(M) ? H(se) : H(Q, !1);
673
- },
674
- !0
675
- );
676
- }
677
- D(_, N);
678
- };
679
- be(U, (_) => {
680
- i(ge) ? _(k) : _(le, !1);
681
- });
682
- }
683
- h(S), h(a), ve(
684
- (_, N, B) => {
685
- L(y, _), L(m, N), L(C, B);
686
- },
687
- [
688
- () => x()("myRanking"),
689
- () => x()("points"),
690
- () => x()("prize")
691
- ]
692
- ), D(e, a);
693
- }, $e = (e) => {
694
- var a = Pt();
695
- D(e, a);
696
- };
697
- be(Xe, (e) => {
698
- i(Ce) ? e($e, !1) : e(Ke);
699
- });
700
- }
701
- var Ge = O(Xe, 2), Ee = f(Ge), Le = f(Ee), oe = f(Le), G = f(oe, !0);
702
- h(oe);
703
- var Ie = O(oe), Qe = f(Ie, !0);
704
- h(Ie);
705
- var Me = O(Ie), Ve = f(Me, !0);
706
- h(Me);
707
- var t = O(Me), n = f(t, !0);
708
- h(t), h(Le), h(Ee);
709
- var o = O(Ee), r = f(o);
710
- {
711
- var d = (e) => {
712
- var a = Ue(), s = Pe(a);
713
- Ze(s, 17, () => Array(i(W)), rt, (j, y, u, m) => {
714
- var P = Rt();
715
- D(j, P);
716
- }), D(e, a);
717
- }, l = (e) => {
718
- var a = Ue(), s = Pe(a);
719
- {
720
- var j = (u) => {
721
- var m = Ue(), P = Pe(m);
722
- Ze(P, 17, () => i(je), (C) => C.rank, (C, S) => {
723
- var U = Tt(), k = f(U), le = f(k);
724
- h(k);
725
- var _ = O(k), N = f(_, !0);
726
- h(_);
727
- var B = O(_), se = f(B, !0);
728
- h(B);
729
- var Q = O(B), H = f(Q, !0);
730
- h(Q), h(U), ve(
731
- (p) => {
732
- var b;
733
- nt(U, 1, p, "svelte-75jgrh"), L(le, `${(b = i(S).rank) != null ? b : ""}.`), L(N, i(S).shortName || "J.D"), L(se, i(S).score || "—"), L(H, i(S).prizeName || "—");
734
- },
735
- [
736
- () => {
737
- var p;
738
- return _t(He(i(S).rank, i(S).rank === ((p = i(ge)) == null ? void 0 : p.rank)));
739
- }
740
- ]
741
- ), D(C, U);
742
- }), D(u, m);
743
- }, y = (u) => {
744
- var m = Ct(), P = f(m), C = f(P), S = f(C), U = f(S, !0);
745
- h(S), h(C), h(P), h(m), ve((k) => L(U, k), [() => x()("emptyLeaderboard")]), D(u, m);
746
- };
747
- be(
748
- s,
749
- (u) => {
750
- var m;
751
- ((m = i(pe)) == null ? void 0 : m.length) > 0 ? u(j) : u(y, !1);
752
- },
753
- !0
754
- );
755
- }
756
- D(e, a);
757
- };
758
- be(r, (e) => {
759
- i(De) ? e(d) : e(l, !1);
760
- });
761
- }
762
- h(o), h(Ge), h(Ae);
763
- var c = O(Ae, 2);
764
- {
765
- var E = (e) => {
766
- var a = At();
767
- D(e, a);
768
- };
769
- be(c, (e) => {
770
- i(we) || e(E);
771
- });
772
- }
773
- var v = O(c, 2);
774
- {
775
- var g = (e) => {
776
- var a = Dt(), s = f(a);
777
- s.__click = We;
778
- var j = f(s, !0);
779
- h(s);
780
- var y = O(s, 2);
781
- Ze(y, 21, () => i(Be), rt, (P, C) => {
782
- var S = Ue(), U = Pe(S);
783
- {
784
- var k = (_) => {
785
- var N = Lt();
786
- D(_, N);
787
- }, le = (_) => {
788
- var N = Nt();
789
- let B;
790
- N.__click = () => Oe(i(C));
791
- var se = f(N, !0);
792
- h(N), ve(() => {
793
- B = nt(N, 1, "PaginationButton Number svelte-75jgrh", null, B, { Active: i(C) === i(X) }), L(se, i(C));
794
- }), D(_, N);
795
- };
796
- be(U, (_) => {
797
- typeof i(C) != "number" ? _(k) : _(le, !1);
798
- });
799
- }
800
- D(P, S);
801
- }), h(y);
802
- var u = O(y, 2);
803
- u.__click = me;
804
- var m = f(u, !0);
805
- h(u), h(a), ve(
806
- (P, C) => {
807
- s.disabled = i(R) === 0, L(j, P), u.disabled = i(R) >= i(ye) - i(W), L(m, C);
808
- },
809
- [() => x()("previousButton"), () => x()("nextButton")]
810
- ), D(e, a);
811
- };
812
- be(v, (e) => {
813
- i(we) && i(ye) > i(W) && e(g);
814
- });
815
- }
816
- h(xe), ve(
817
- (e, a, s, j) => {
818
- L(G, e), L(Qe, a), L(Ve, s), L(n, j);
819
- },
820
- [
821
- () => x()("rank"),
822
- () => x()("user"),
823
- () => x()("points"),
824
- () => x()("prize")
825
- ]
826
- ), D(he, xe);
827
- var w = ft(ae);
828
- return fe(), w;
829
- }
830
- gt(["click"]);
831
- customElements.define("tournament-leaderboard", yt(
832
- Bt,
833
- {
834
- endpoint: {},
835
- language: {},
836
- session: {},
837
- tournamentid: {},
838
- platform: {},
839
- translationurl: {},
840
- newlyEnrolled: {}
841
- },
842
- [],
843
- [],
844
- !1
845
- ));
846
- export {
847
- Bt as default
848
- };