@everymatrix/tournament-details-page 0.0.7 → 0.0.8

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-B5bbvugX.js +1107 -0
  5. package/components/TournamentDetailsPage-CjBmguAV.js +1082 -0
  6. package/components/TournamentDetailsPage-DrDTbkUX.cjs +59 -0
  7. package/components/TournamentGames-CATtl7ab.js +377 -0
  8. package/components/TournamentGames-CXKhYSVz.js +405 -0
  9. package/components/TournamentGames-Dz1Ddedp.cjs +27 -0
  10. package/components/TournamentLeaderboard-Bdrmjyzv.js +823 -0
  11. package/components/TournamentLeaderboard-Cvo-K1Xv.js +839 -0
  12. package/components/TournamentLeaderboard-xrrrpKix.cjs +31 -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,405 @@
1
+ var de = (G, m, c) => new Promise((Z, H) => {
2
+ var M = (f) => {
3
+ try {
4
+ y(c.next(f));
5
+ } catch (S) {
6
+ H(S);
7
+ }
8
+ }, R = (f) => {
9
+ try {
10
+ y(c.throw(f));
11
+ } catch (S) {
12
+ H(S);
13
+ }
14
+ }, y = (f) => f.done ? Z(f.value) : Promise.resolve(f.value).then(M, R);
15
+ y((c = c.apply(G, m)).next());
16
+ });
17
+ import { a as qe, $ as Xe, n as Qe, e as Ve, p as w, f as Ye, u as fe, s as O, g as Ze, h as x, t as k, r as l, i as D, q as a, B, y as $e, G as P, D as j, j as u, k as et, l as tt, z as at, x as _, m as T, K as X, L as Q, J as V, A as Y, M as se, v as nt, w as ot, E as s, F as ge } from "./TournamentDetails-CKMkVYxd.js";
18
+ import { g as rt } from "./TournamentDetailsPage-B5bbvugX.js";
19
+ function be(G, m) {
20
+ qe(G, m);
21
+ }
22
+ function he(G) {
23
+ Xe.set(G);
24
+ }
25
+ const _e = {
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
+ }, st = () => typeof window == "undefined";
47
+ var it = x('<div class="TournamentGamesTabs svelte-p7mf8l"><button> </button> <button> </button></div>'), lt = x('<p class="svelte-p7mf8l"> </p>'), pt = x("<div></div>"), mt = x('<div class="TournamentGameThumbnailSkeleton svelte-p7mf8l"></div>'), 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("<p> </p>"), gt = 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>'), bt = 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 ht = {
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;}.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 _t(G, m) {
79
+ var ve;
80
+ Qe(m, !0), Ve(G, ht);
81
+ const c = () => $e(at, "$_", Z), [Z, H] = tt(), M = w(m, "initialGames"), R = w(m, "endpoint"), y = w(m, "language", 7, "en"), f = w(m, "session"), S = w(m, "tournamentid"), b = w(m, "gamesLimit", 7, 6), W = w(m, "totalGames"), $ = w(m, "platformProp", 7, null), E = w(m, "tournamentMetadata"), C = w(m, "translationurl"), xe = () => {
82
+ let e = new URL(C());
83
+ fetch(e.href).then((t) => t.json()).then((t) => {
84
+ Object.keys(t).forEach((n) => {
85
+ be(n, t[n]);
86
+ });
87
+ }).catch((t) => {
88
+ console.log(t);
89
+ });
90
+ };
91
+ Object.keys(_e).forEach((e) => {
92
+ be(e, _e[e]);
93
+ }), he(y());
94
+ const ye = () => {
95
+ he(y());
96
+ };
97
+ Ye(() => {
98
+ C() && xe();
99
+ }), fe(() => {
100
+ ye();
101
+ });
102
+ let z = O(Ze(M() || [])), F = O(!1), g = O(0), I = O(void 0), U = O(!0);
103
+ const we = st() ? (ve = $()) != null ? ve : "dk" : rt(window.navigator.userAgent), ee = () => de(this, null, function* () {
104
+ if (te.has(a(J)))
105
+ return;
106
+ _(F, !0);
107
+ const e = new URL(`${R()}/v1/tournaments/${S()}`), t = new Headers();
108
+ f() && t.append("X-SessionId", f());
109
+ const n = { method: "GET", headers: t };
110
+ e.searchParams.append("filter", `id=${S()}`), e.searchParams.append("language", y()), e.searchParams.append("expand", "games"), e.searchParams.append("pagination", `games(limit=${b()},offset=${a(g)})`), e.searchParams.append("platform", we), fetch(e, n).then((r) => r.json()).then((r) => {
111
+ var i, o;
112
+ _(z, (o = (i = r == null ? void 0 : r.item) == null ? void 0 : i.games) == null ? void 0 : o.items, !0), te.set(a(J), a(z)), a(U) || _(U, !0);
113
+ }).catch((r) => console.log(r)).finally(() => _(F, !1));
114
+ }), ke = () => {
115
+ const e = Math.ceil(W() / b()), t = Math.floor(a(g) / b()) + 1;
116
+ if (e <= 5)
117
+ return Array.from({ length: e }, (r, i) => i + 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
+ }, Pe = () => {
121
+ a(g) < W() && (_(g, a(g) + b()), ee());
122
+ }, Te = () => {
123
+ a(g) !== 0 && (_(g, a(g) - b()), ee());
124
+ }, Ge = (e) => {
125
+ _(g, (e - 1) * b()), ee();
126
+ }, Se = se(ke), J = se(() => Math.floor(a(g) / b()) + 1);
127
+ let te = /* @__PURE__ */ new Map([[1, M()]]), Ae = se(() => {
128
+ var e;
129
+ return (e = te.get(a(J))) != null ? e : [];
130
+ }), A = O("casino");
131
+ const Be = () => {
132
+ var n;
133
+ if (!E()) return;
134
+ const e = (n = E().sports) == null ? void 0 : n.rules;
135
+ let t;
136
+ if (e)
137
+ try {
138
+ t = JSON.parse(e), _(I, t[y()] || t["*"], !0);
139
+ } catch (r) {
140
+ console.log(r), _(I, `${c()("sportsRulesParseError")}`);
141
+ }
142
+ }, Ne = (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
+ fe(() => {
155
+ Object.keys(E()).length !== 0 && Be();
156
+ });
157
+ var De = {
158
+ get initialGames() {
159
+ return M();
160
+ },
161
+ set initialGames(e) {
162
+ M(e), T();
163
+ },
164
+ get endpoint() {
165
+ return R();
166
+ },
167
+ set endpoint(e) {
168
+ R(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 S();
184
+ },
185
+ set tournamentid(e) {
186
+ S(e), T();
187
+ },
188
+ get gamesLimit() {
189
+ return b();
190
+ },
191
+ set gamesLimit(e = 6) {
192
+ b(e), T();
193
+ },
194
+ get totalGames() {
195
+ return W();
196
+ },
197
+ set totalGames(e) {
198
+ W(e), T();
199
+ },
200
+ get platformProp() {
201
+ return $();
202
+ },
203
+ set platformProp(e = null) {
204
+ $(e), T();
205
+ },
206
+ get tournamentMetadata() {
207
+ return E();
208
+ },
209
+ set tournamentMetadata(e) {
210
+ E(e), T();
211
+ },
212
+ get translationurl() {
213
+ return C();
214
+ },
215
+ set translationurl(e) {
216
+ C(e), T();
217
+ }
218
+ }, ae = bt(), ne = l(ae), oe = l(ne), je = l(oe, !0);
219
+ s(oe);
220
+ var ie = k(oe, 2), Me = l(ie, !0);
221
+ s(ie), s(ne);
222
+ var le = k(ne, 2);
223
+ {
224
+ var Ee = (e) => {
225
+ var t = it(), n = l(t);
226
+ let r;
227
+ n.__click = () => _(A, "casino");
228
+ var i = l(n, !0);
229
+ s(n);
230
+ var o = k(n, 2);
231
+ let p;
232
+ o.__click = () => _(A, "sports");
233
+ var v = l(o, !0);
234
+ s(o), s(t), B(
235
+ (d, h) => {
236
+ r = j(n, 1, "Tab svelte-p7mf8l", null, r, { Active: a(A) === "casino" }), P(i, d), p = j(o, 1, "Tab svelte-p7mf8l", null, p, { Active: a(A) === "sports" }), P(v, h);
237
+ },
238
+ [() => c()("casinoTab"), () => c()("sportsbookTab")]
239
+ ), u(e, t);
240
+ };
241
+ D(le, (e) => {
242
+ Object.keys(E()).length !== 0 && e(Ee);
243
+ });
244
+ }
245
+ var pe = k(le, 2);
246
+ {
247
+ var Le = (e) => {
248
+ var t = pt();
249
+ let n;
250
+ X(t, 21, () => a(I), Q, (r, i) => {
251
+ var o = lt(), p = l(o);
252
+ s(o), B((v) => {
253
+ var d;
254
+ return P(p, `${(d = a(i).rule) != null ? d : ""} ${v != null ? v : ""}`);
255
+ }, [() => c()("contribution")]), u(r, o);
256
+ }), s(t), B(() => n = j(t, 1, "TournamentRulesWrapper svelte-p7mf8l", null, n, { Hidden: a(A) === "casino" })), u(e, t);
257
+ };
258
+ D(pe, (e) => {
259
+ a(I) && e(Le);
260
+ });
261
+ }
262
+ var K = k(pe, 2);
263
+ let me;
264
+ var Oe = l(K);
265
+ {
266
+ var Re = (e) => {
267
+ var t = V(), n = Y(t);
268
+ X(n, 17, () => Array(b()), Q, (r, i, o, p) => {
269
+ var v = mt();
270
+ u(r, v);
271
+ }), u(e, t);
272
+ }, We = (e) => {
273
+ var t = V(), n = Y(t);
274
+ X(n, 17, () => a(Ae), Q, (r, i) => {
275
+ var o = ct();
276
+ o.__click = () => Ne(a(i));
277
+ var p = l(o), v = l(p), d = k(v, 2), h = l(d), q = l(h, !0);
278
+ s(h), s(d), s(p), s(o), B(
279
+ (re) => {
280
+ ge(v, "src", `https:${a(i).thumbnail}`), ge(v, "alt", a(i).name), P(q, re);
281
+ },
282
+ [() => c()("play")]
283
+ ), u(r, o);
284
+ }), u(e, t);
285
+ };
286
+ D(Oe, (e) => {
287
+ var t;
288
+ a(F) || ((t = a(z)) == null ? void 0 : t.length) === 0 ? e(Re) : e(We, !1);
289
+ });
290
+ }
291
+ s(K);
292
+ var ce = k(K, 2);
293
+ {
294
+ var ze = (e) => {
295
+ var t = dt();
296
+ let n;
297
+ var r = l(t);
298
+ r.__click = Te;
299
+ var i = l(r, !0);
300
+ s(r);
301
+ var o = k(r, 2);
302
+ X(o, 21, () => a(Se), Q, (d, h) => {
303
+ var q = V(), re = Y(q);
304
+ {
305
+ var Ue = (L) => {
306
+ var N = vt();
307
+ u(L, N);
308
+ }, Je = (L) => {
309
+ var N = ut();
310
+ let ue;
311
+ N.__click = () => Ge(a(h));
312
+ var Ke = l(N, !0);
313
+ s(N), B(() => {
314
+ ue = j(N, 1, "PaginationButton Number svelte-p7mf8l", null, ue, { Active: a(h) === a(J) }), P(Ke, a(h));
315
+ }), u(L, N);
316
+ };
317
+ D(re, (L) => {
318
+ typeof a(h) != "number" ? L(Ue) : L(Je, !1);
319
+ });
320
+ }
321
+ u(d, q);
322
+ }), s(o);
323
+ var p = k(o, 2);
324
+ p.__click = Pe;
325
+ var v = l(p, !0);
326
+ s(p), s(t), B(
327
+ (d, h) => {
328
+ n = j(t, 1, "PaginationWrapper svelte-p7mf8l", null, n, { Hidden: a(A) === "sports" }), r.disabled = a(g) === 0, P(i, d), p.disabled = a(g) >= W() - b(), P(v, h);
329
+ },
330
+ [() => c()("previousButton"), () => c()("nextButton")]
331
+ ), u(e, t);
332
+ }, He = (e) => {
333
+ var t = V(), n = Y(t);
334
+ {
335
+ var r = (i) => {
336
+ var o = ft();
337
+ let p;
338
+ var v = l(o, !0);
339
+ s(o), B(
340
+ (d) => {
341
+ p = j(o, 1, "NoGamesAvailable svelte-p7mf8l", null, p, { Hidden: a(A) === "sports" }), P(v, d);
342
+ },
343
+ [() => c()("noAvailableGames")]
344
+ ), u(i, o);
345
+ };
346
+ D(
347
+ n,
348
+ (i) => {
349
+ var o;
350
+ !a(F) && ((o = a(z)) == null ? void 0 : o.length) === 0 && i(r);
351
+ },
352
+ !0
353
+ );
354
+ }
355
+ u(e, t);
356
+ };
357
+ D(ce, (e) => {
358
+ var t;
359
+ a(U) && ((t = a(z)) == null ? void 0 : t.length) > 0 ? e(ze) : e(He, !1);
360
+ });
361
+ }
362
+ var Ce = k(ce, 2);
363
+ {
364
+ var Fe = (e) => {
365
+ var t = gt();
366
+ u(e, t);
367
+ };
368
+ D(Ce, (e) => {
369
+ a(U) || e(Fe);
370
+ });
371
+ }
372
+ s(ae), B(
373
+ (e, t) => {
374
+ P(je, e), P(Me, t), me = j(K, 1, "TournamentGamesContainer svelte-p7mf8l", null, me, { Hidden: a(A) === "sports" });
375
+ },
376
+ [
377
+ () => c()("gamesDescriptionTitle"),
378
+ () => c()("gamesDescriptionSubtitle")
379
+ ]
380
+ ), u(G, ae);
381
+ var Ie = et(De);
382
+ return H(), Ie;
383
+ }
384
+ nt(["click"]);
385
+ customElements.define("tournament-games", ot(
386
+ _t,
387
+ {
388
+ initialGames: {},
389
+ endpoint: {},
390
+ language: {},
391
+ session: {},
392
+ tournamentid: {},
393
+ gamesLimit: {},
394
+ totalGames: {},
395
+ platformProp: {},
396
+ tournamentMetadata: {},
397
+ translationurl: {}
398
+ },
399
+ [],
400
+ [],
401
+ !1
402
+ ));
403
+ export {
404
+ _t as default
405
+ };
@@ -0,0 +1,27 @@
1
+ "use strict";var V=(h,i,p)=>new Promise((L,G)=>{var y=d=>{try{g(p.next(d))}catch(b){G(b)}},P=d=>{try{g(p.throw(d))}catch(b){G(b)}},g=d=>d.done?L(d.value):Promise.resolve(d.value).then(y,P);g((p=p.apply(h,i)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./TournamentDetails-nG7lN2NT.cjs"),Ae=require("./TournamentDetailsPage-DrDTbkUX.cjs");function Y(h,i){e.addMessages(h,i)}function Z(h){e.$locale.set(h)}const $={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ış!"}},Be=()=>typeof window=="undefined";var Ne=e.from_html('<div class="TournamentGamesTabs svelte-p7mf8l"><button> </button> <button> </button></div>'),De=e.from_html('<p class="svelte-p7mf8l"> </p>'),je=e.from_html("<div></div>"),Me=e.from_html('<div class="TournamentGameThumbnailSkeleton svelte-p7mf8l"></div>'),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("<p> </p>"),ze=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>'),He=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 Ce={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;}.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 ee(h,i){var X;e.push(i,!0),e.append_styles(h,Ce);const p=()=>e.store_get(e.$format,"$_",L),[L,G]=e.setup_stores(),y=e.prop(i,"initialGames"),P=e.prop(i,"endpoint"),g=e.prop(i,"language",7,"en"),d=e.prop(i,"session"),b=e.prop(i,"tournamentid"),u=e.prop(i,"gamesLimit",7,6),T=e.prop(i,"totalGames"),O=e.prop(i,"platformProp",7,null),w=e.prop(i,"tournamentMetadata"),A=e.prop(i,"translationurl"),te=()=>{let t=new URL(A());fetch(t.href).then(a=>a.json()).then(a=>{Object.keys(a).forEach(n=>{Y(n,a[n])})}).catch(a=>{console.log(a)})};Object.keys($).forEach(t=>{Y(t,$[t])}),Z(g());const ae=()=>{Z(g())};e.user_pre_effect(()=>{A()&&te()}),e.user_effect(()=>{ae()});let S=e.state(e.proxy(y()||[])),B=e.state(!1),f=e.state(0),N=e.state(void 0),D=e.state(!0);const ne=Be()?(X=O())!=null?X:"dk":Ae.getDevice(window.navigator.userAgent),R=()=>V(this,null,function*(){if(W.has(e.get(j)))return;e.set(B,!0);const t=new URL(`${P()}/v1/tournaments/${b()}`),a=new Headers;d()&&a.append("X-SessionId",d());const n={method:"GET",headers:a};t.searchParams.append("filter",`id=${b()}`),t.searchParams.append("language",g()),t.searchParams.append("expand","games"),t.searchParams.append("pagination",`games(limit=${u()},offset=${e.get(f)})`),t.searchParams.append("platform",ne),fetch(t,n).then(s=>s.json()).then(s=>{var o,r;e.set(S,(r=(o=s==null?void 0:s.item)==null?void 0:o.games)==null?void 0:r.items,!0),W.set(e.get(j),e.get(S)),e.get(D)||e.set(D,!0)}).catch(s=>console.log(s)).finally(()=>e.set(B,!1))}),re=()=>{const t=Math.ceil(T()/u()),a=Math.floor(e.get(f)/u())+1;if(t<=5)return Array.from({length:t},(s,o)=>o+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},se=()=>{e.get(f)<T()&&(e.set(f,e.get(f)+u()),R())},oe=()=>{e.get(f)!==0&&(e.set(f,e.get(f)-u()),R())},le=t=>{e.set(f,(t-1)*u()),R()},ie=e.user_derived(re),j=e.user_derived(()=>Math.floor(e.get(f)/u())+1);let W=new Map([[1,y()]]),pe=e.user_derived(()=>{var t;return(t=W.get(e.get(j)))!=null?t:[]}),_=e.state("casino");const ce=()=>{var n;if(!w())return;const t=(n=w().sports)==null?void 0:n.rules;let a;if(t)try{a=JSON.parse(t),e.set(N,a[g()]||a["*"],!0)}catch(s){console.log(s),e.set(N,`${p()("sportsRulesParseError")}`)}},me=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(w()).length!==0&&ce()});var de={get initialGames(){return y()},set initialGames(t){y(t),e.flushSync()},get endpoint(){return P()},set endpoint(t){P(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 b()},set tournamentid(t){b(t),e.flushSync()},get gamesLimit(){return u()},set gamesLimit(t=6){u(t),e.flushSync()},get totalGames(){return T()},set totalGames(t){T(t),e.flushSync()},get platformProp(){return O()},set platformProp(t=null){O(t),e.flushSync()},get tournamentMetadata(){return w()},set tournamentMetadata(t){w(t),e.flushSync()},get translationurl(){return A()},set translationurl(t){A(t),e.flushSync()}},z=He(),H=e.child(z),C=e.child(H),fe=e.child(C,!0);e.reset(C);var U=e.sibling(C,2),ue=e.child(U,!0);e.reset(U),e.reset(H);var F=e.sibling(H,2);{var ve=t=>{var a=Ne(),n=e.child(a);let s;n.__click=()=>e.set(_,"casino");var o=e.child(n,!0);e.reset(n);var r=e.sibling(n,2);let l;r.__click=()=>e.set(_,"sports");var c=e.child(r,!0);e.reset(r),e.reset(a),e.template_effect((m,v)=>{s=e.set_class(n,1,"Tab svelte-p7mf8l",null,s,{Active:e.get(_)==="casino"}),e.set_text(o,m),l=e.set_class(r,1,"Tab svelte-p7mf8l",null,l,{Active:e.get(_)==="sports"}),e.set_text(c,v)},[()=>p()("casinoTab"),()=>p()("sportsbookTab")]),e.append(t,a)};e.if_block(F,t=>{Object.keys(w()).length!==0&&t(ve)})}var q=e.sibling(F,2);{var ge=t=>{var a=je();let n;e.each(a,21,()=>e.get(N),e.index,(s,o)=>{var r=De(),l=e.child(r);e.reset(r),e.template_effect(c=>{var m;return e.set_text(l,`${(m=e.get(o).rule)!=null?m:""} ${c!=null?c:""}`)},[()=>p()("contribution")]),e.append(s,r)}),e.reset(a),e.template_effect(()=>n=e.set_class(a,1,"TournamentRulesWrapper svelte-p7mf8l",null,n,{Hidden:e.get(_)==="casino"})),e.append(t,a)};e.if_block(q,t=>{e.get(N)&&t(ge)})}var M=e.sibling(q,2);let J;var he=e.child(M);{var be=t=>{var a=e.comment(),n=e.first_child(a);e.each(n,17,()=>Array(u()),e.index,(s,o,r,l)=>{var c=Me();e.append(s,c)}),e.append(t,a)},_e=t=>{var a=e.comment(),n=e.first_child(a);e.each(n,17,()=>e.get(pe),e.index,(s,o)=>{var r=Ee();r.__click=()=>me(e.get(o));var l=e.child(r),c=e.child(l),m=e.sibling(c,2),v=e.child(m),E=e.child(v,!0);e.reset(v),e.reset(m),e.reset(l),e.reset(r),e.template_effect(I=>{e.set_attribute(c,"src",`https:${e.get(o).thumbnail}`),e.set_attribute(c,"alt",e.get(o).name),e.set_text(E,I)},[()=>p()("play")]),e.append(s,r)}),e.append(t,a)};e.if_block(he,t=>{var a;e.get(B)||((a=e.get(S))==null?void 0:a.length)===0?t(be):t(_e,!1)})}e.reset(M);var K=e.sibling(M,2);{var xe=t=>{var a=Re();let n;var s=e.child(a);s.__click=oe;var o=e.child(s,!0);e.reset(s);var r=e.sibling(s,2);e.each(r,21,()=>e.get(ie),e.index,(m,v)=>{var E=e.comment(),I=e.first_child(E);{var Te=k=>{var x=Le();e.append(k,x)},Se=k=>{var x=Oe();let Q;x.__click=()=>le(e.get(v));var Ge=e.child(x,!0);e.reset(x),e.template_effect(()=>{Q=e.set_class(x,1,"PaginationButton Number svelte-p7mf8l",null,Q,{Active:e.get(v)===e.get(j)}),e.set_text(Ge,e.get(v))}),e.append(k,x)};e.if_block(I,k=>{typeof e.get(v)!="number"?k(Te):k(Se,!1)})}e.append(m,E)}),e.reset(r);var l=e.sibling(r,2);l.__click=se;var c=e.child(l,!0);e.reset(l),e.reset(a),e.template_effect((m,v)=>{n=e.set_class(a,1,"PaginationWrapper svelte-p7mf8l",null,n,{Hidden:e.get(_)==="sports"}),s.disabled=e.get(f)===0,e.set_text(o,m),l.disabled=e.get(f)>=T()-u(),e.set_text(c,v)},[()=>p()("previousButton"),()=>p()("nextButton")]),e.append(t,a)},ye=t=>{var a=e.comment(),n=e.first_child(a);{var s=o=>{var r=We();let l;var c=e.child(r,!0);e.reset(r),e.template_effect(m=>{l=e.set_class(r,1,"NoGamesAvailable svelte-p7mf8l",null,l,{Hidden:e.get(_)==="sports"}),e.set_text(c,m)},[()=>p()("noAvailableGames")]),e.append(o,r)};e.if_block(n,o=>{var r;!e.get(B)&&((r=e.get(S))==null?void 0:r.length)===0&&o(s)},!0)}e.append(t,a)};e.if_block(K,t=>{var a;e.get(D)&&((a=e.get(S))==null?void 0:a.length)>0?t(xe):t(ye,!1)})}var we=e.sibling(K,2);{var ke=t=>{var a=ze();e.append(t,a)};e.if_block(we,t=>{e.get(D)||t(ke)})}e.reset(z),e.template_effect((t,a)=>{e.set_text(fe,t),e.set_text(ue,a),J=e.set_class(M,1,"TournamentGamesContainer svelte-p7mf8l",null,J,{Hidden:e.get(_)==="sports"})},[()=>p()("gamesDescriptionTitle"),()=>p()("gamesDescriptionSubtitle")]),e.append(h,z);var Pe=e.pop(de);return G(),Pe}e.delegate(["click"]);customElements.define("tournament-games",e.create_custom_element(ee,{initialGames:{},endpoint:{},language:{},session:{},tournamentid:{},gamesLimit:{},totalGames:{},platformProp:{},tournamentMetadata:{},translationurl:{}},[],[],!1));exports.default=ee;