@everymatrix/tournament-details-page 0.1.7 → 0.1.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.
@@ -1,395 +0,0 @@
1
- import { a as Ue, $ as qe, j as Je, b as Ke, p as x, u as Xe, d as ve, y as L, L as Qe, P as Ve, k as _, i as B, t as S, l as w, G as N, r as a, e as p, f as Ye, w as Ze, x as $e, s as et, q as f, h as y, v as l, g, m as tt, n as at, A as s, D as Q, E as V, B as Y, C as Z, z as ie, N as de } from "./TournamentDetailsPage-wAedD3fv.js";
2
- function fe(D, u) {
3
- Ue(D, u);
4
- }
5
- function ge(D) {
6
- qe.set(D);
7
- }
8
- const be = {
9
- en: {
10
- previousButton: "Previous",
11
- nextButton: "Next",
12
- casinoTab: "Casino",
13
- sportsbookTab: "Sportsbook",
14
- gamesDescriptionTitle: "Participating games",
15
- gamesDescriptionSubtitle: "Discover the games",
16
- sportsRulesParseError: "Error parsing tournament rules",
17
- noAvailableGames: "No games have been configured yet!"
18
- },
19
- tr: {
20
- previousButton: "Önceki",
21
- nextButton: "Sonraki",
22
- casinoTab: "Casino",
23
- sportsbookTab: "Spor Bahisleri",
24
- gamesDescriptionTitle: "Katılımcı oyunlar",
25
- gamesDescriptionSubtitle: "Oyunları keşfedin",
26
- sportsRulesParseError: "Turnuva kuralları ayrıştırma hatası",
27
- noAvailableGames: "Henüz oyun yapılandırılmamış!"
28
- },
29
- da: {
30
- previousButton: "Forrige",
31
- nextButton: "Næste",
32
- casinoTab: "Casino",
33
- sportsbookTab: "Sportsbook",
34
- gamesDescriptionTitle: "Deltagende spil",
35
- gamesDescriptionSubtitle: "Opdag spillene",
36
- sportsRulesParseError: "Fejl ved parsing af turneringsregler",
37
- noAvailableGames: "Der er endnu ikke konfigureret nogen spil!"
38
- }
39
- }, nt = () => typeof window > "u";
40
- var ot = g('<div class="TournamentGamesTabs svelte-p7mf8l"><button> </button> <button> </button></div>'), rt = g('<p class="svelte-p7mf8l"> </p>'), st = g("<div></div>"), it = g('<div class="TournamentGameThumbnailSkeleton svelte-p7mf8l"></div>'), lt = g("<p> </p>"), pt = g('<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>'), mt = g('<span class="PaginationButton Elipsis svelte-p7mf8l">...</span>'), ut = g("<button> </button>"), ct = g('<div><button class="PaginationButton svelte-p7mf8l"> </button> <div class="PageNumberWrapper svelte-p7mf8l"></div> <button class="PaginationButton svelte-p7mf8l"> </button></div>'), vt = g('<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>'), dt = g('<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>');
41
- const ft = {
42
- hash: "svelte-p7mf8l",
43
- code: `.svelte-p7mf8l,
44
- .svelte-p7mf8l::before,
45
- .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-fill, minmax(min(170px, 100%), 1fr));.TournamentGameThumbnailSkeleton:where(.svelte-p7mf8l) {position:relative;width:100%;aspect-ratio:4 / 3;overflow:hidden;border-radius:6px;background:linear-gradient(
46
- to top,
47
- var(--emw-color-primary, #FF1D4E),
48
- transparent
49
- );background-size:100% 200%;
50
- 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;
51
- 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;
52
- animation: svelte-p7mf8l-pulse 1s infinite;}}
53
-
54
- @keyframes svelte-p7mf8l-pulse {
55
- 0% {
56
- opacity: 0;
57
- }
58
- 50% {
59
- opacity: 1;
60
- }
61
- 100% {
62
- opacity: 0;
63
- }
64
- }
65
-
66
-
67
- @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;}}
68
-
69
- }
70
-
71
- @media (max-width: 475px) {.TournamentGamesContainer.svelte-p7mf8l {gap:5px;grid-template-columns:repeat(auto-fill, minmax(min(150px, 100%), 1fr));}.PaginationWrapper.svelte-p7mf8l {& .PaginationButton:where(.svelte-p7mf8l) {font-size:11px;&.Number {font-size:11px;}}}.TournamentGamesTabs.svelte-p7mf8l {font-size:12px;}
72
- }
73
-
74
- @media (max-width: 380px) {.TournamentGamesContainer.svelte-p7mf8l {grid-template-columns:repeat(auto-fill, minmax(min(145px, 100%), 1fr));}
75
- }
76
-
77
- @media (min-width: 1500px) {.TournamentGamesContainer.svelte-p7mf8l {gap:5px;grid-template-columns:repeat(auto-fill, minmax(min(215px, 100%), 1fr));}
78
- }.Hidden.svelte-p7mf8l {display:none;}`
79
- };
80
- function gt(D, u) {
81
- Je(u, !0), Ke(D, ft);
82
- const b = () => Ze($e, "$_", he), [he, xe] = et(), z = x(u, "initialGames"), $ = x(u, "endpoint"), j = x(u, "language", 7, "en"), C = x(u, "session"), R = x(u, "tournamentid"), c = x(u, "gamesLimit", 7, 6), E = x(u, "totalGames"), ee = x(u, "platformProp", 7, null), M = x(u, "tournamentMetadata"), W = x(u, "translationurl"), _e = () => {
83
- let e = new URL(W());
84
- fetch(e.href).then((t) => t.json()).then((t) => {
85
- Object.keys(t).forEach((n) => {
86
- fe(n, t[n]);
87
- });
88
- }).catch((t) => {
89
- console.log(t);
90
- });
91
- };
92
- Object.keys(be).forEach((e) => {
93
- fe(e, be[e]);
94
- }), ge(j());
95
- const we = () => {
96
- ge(j());
97
- };
98
- Xe(() => {
99
- W() && _e();
100
- }), ve(() => {
101
- we();
102
- });
103
- let te = L(Qe(z() || [])), H = L(!1), v = L(0), F = L(void 0), I = L(!0);
104
- const ye = nt() ? ee() ?? "dk" : Ve(window.navigator.userAgent), ae = async () => {
105
- if (ne.has(a(U)))
106
- return;
107
- f(H, !0);
108
- const e = new URL(`${$()}/v1/tournaments/${R()}`), t = new Headers();
109
- C() && t.append("X-SessionId", C());
110
- const n = { method: "GET", headers: t };
111
- e.searchParams.append("filter", `id=${R()}`), e.searchParams.append("language", j()), e.searchParams.append("expand", "games"), e.searchParams.append("pagination", `games(limit=${c()},offset=${a(v)})`), e.searchParams.append("platform", ye), fetch(e, n).then((o) => o.json()).then((o) => {
112
- f(te, o?.item?.games?.items, !0), ne.set(a(U), a(te)), a(I) || f(I, !0);
113
- }).catch((o) => console.log(o)).finally(() => f(H, !1));
114
- }, ke = () => {
115
- const e = Math.ceil(E() / c()), t = Math.floor(a(v) / c()) + 1;
116
- if (e <= 5)
117
- return Array.from({ length: e }, (o, h) => h + 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(v) < E() && (f(v, a(v) + c()), ae());
122
- }, Te = () => {
123
- a(v) !== 0 && (f(v, a(v) - c()), ae());
124
- }, Ge = (e) => {
125
- f(v, (e - 1) * c()), ae();
126
- }, Se = ie(ke), U = ie(() => Math.floor(a(v) / c()) + 1);
127
- let ne = /* @__PURE__ */ new Map([[1, z()]]), Ae = ie(() => ne.get(a(U)) ?? []), G = L("casino");
128
- const Be = () => {
129
- if (!M()) return;
130
- const e = M().sports?.rules;
131
- let t;
132
- if (e)
133
- try {
134
- t = JSON.parse(e), f(F, t[j()] || t["*"], !0);
135
- } catch (n) {
136
- console.log(n), f(F, `${b()("sportsRulesParseError")}`);
137
- }
138
- }, Ne = (e) => {
139
- window.postMessage(
140
- {
141
- type: "Tournaments:PlayGame",
142
- launchUrl: e.launchUrl,
143
- id: e.gameId,
144
- thumbnail: e.thumbnail,
145
- name: e.name
146
- },
147
- window.location.href
148
- );
149
- };
150
- ve(() => {
151
- Object.keys(M()).length !== 0 && Be();
152
- });
153
- var De = {
154
- get initialGames() {
155
- return z();
156
- },
157
- set initialGames(e) {
158
- z(e), y();
159
- },
160
- get endpoint() {
161
- return $();
162
- },
163
- set endpoint(e) {
164
- $(e), y();
165
- },
166
- get language() {
167
- return j();
168
- },
169
- set language(e = "en") {
170
- j(e), y();
171
- },
172
- get session() {
173
- return C();
174
- },
175
- set session(e) {
176
- C(e), y();
177
- },
178
- get tournamentid() {
179
- return R();
180
- },
181
- set tournamentid(e) {
182
- R(e), y();
183
- },
184
- get gamesLimit() {
185
- return c();
186
- },
187
- set gamesLimit(e = 6) {
188
- c(e), y();
189
- },
190
- get totalGames() {
191
- return E();
192
- },
193
- set totalGames(e) {
194
- E(e), y();
195
- },
196
- get platformProp() {
197
- return ee();
198
- },
199
- set platformProp(e = null) {
200
- ee(e), y();
201
- },
202
- get tournamentMetadata() {
203
- return M();
204
- },
205
- set tournamentMetadata(e) {
206
- M(e), y();
207
- },
208
- get translationurl() {
209
- return W();
210
- },
211
- set translationurl(e) {
212
- W(e), y();
213
- }
214
- }, oe = dt(), re = l(oe), se = l(re), je = l(se, !0);
215
- s(se);
216
- var le = _(se, 2), Ee = l(le, !0);
217
- s(le), s(re);
218
- var pe = _(re, 2);
219
- {
220
- var Me = (e) => {
221
- var t = ot(), n = l(t);
222
- let o;
223
- n.__click = () => f(G, "casino");
224
- var h = l(n, !0);
225
- s(n);
226
- var r = _(n, 2);
227
- let i;
228
- r.__click = () => f(G, "sports");
229
- var d = l(r, !0);
230
- s(r), s(t), S(
231
- (k, m) => {
232
- o = N(n, 1, "Tab svelte-p7mf8l", null, o, { Active: a(G) === "casino" }), w(h, k), i = N(r, 1, "Tab svelte-p7mf8l", null, i, { Active: a(G) === "sports" }), w(d, m);
233
- },
234
- [() => b()("casinoTab"), () => b()("sportsbookTab")]
235
- ), p(e, t);
236
- };
237
- B(pe, (e) => {
238
- Object.keys(M()).length !== 0 && e(Me);
239
- });
240
- }
241
- var me = _(pe, 2);
242
- {
243
- var Le = (e) => {
244
- var t = st();
245
- let n;
246
- Q(t, 21, () => a(F), V, (o, h) => {
247
- var r = rt(), i = l(r);
248
- s(r), S((d) => w(i, `${a(h).rule ?? ""} ${d ?? ""}`), [() => b()("contribution")]), p(o, r);
249
- }), s(t), S(() => n = N(t, 1, "TournamentRulesWrapper svelte-p7mf8l", null, n, { Hidden: a(G) === "casino" })), p(e, t);
250
- };
251
- B(me, (e) => {
252
- a(F) && e(Le);
253
- });
254
- }
255
- var q = _(me, 2);
256
- let ue;
257
- var Oe = l(q);
258
- {
259
- var ze = (e) => {
260
- var t = Y(), n = Z(t);
261
- Q(n, 17, () => Array(c()), V, (o, h, r, i) => {
262
- var d = it();
263
- p(o, d);
264
- }), p(e, t);
265
- }, Ce = (e) => {
266
- var t = Y(), n = Z(t);
267
- {
268
- var o = (r) => {
269
- var i = lt();
270
- let d;
271
- var k = l(i, !0);
272
- s(i), S(
273
- (m) => {
274
- d = N(i, 1, "NoGamesAvailable svelte-p7mf8l", null, d, { Hidden: a(G) === "sports" }), w(k, m);
275
- },
276
- [() => b()("noAvailableGames")]
277
- ), p(r, i);
278
- }, h = (r) => {
279
- var i = Y(), d = Z(i);
280
- Q(d, 17, () => a(Ae), V, (k, m) => {
281
- var A = pt();
282
- A.__click = () => Ne(a(m));
283
- var J = l(A), O = l(J), K = _(O, 2), P = l(K), T = l(P, !0);
284
- s(P), s(K), s(J), s(A), S(
285
- (X) => {
286
- de(O, "src", `https:${a(m).thumbnail}`), de(O, "alt", a(m).name), w(T, X);
287
- },
288
- [() => b()("play")]
289
- ), p(k, A);
290
- }), p(r, i);
291
- };
292
- B(
293
- n,
294
- (r) => {
295
- !a(H) && a(te)?.length === 0 ? r(o) : r(h, !1);
296
- },
297
- !0
298
- );
299
- }
300
- p(e, t);
301
- };
302
- B(Oe, (e) => {
303
- a(H) ? e(ze) : e(Ce, !1);
304
- });
305
- }
306
- s(q);
307
- var ce = _(q, 2);
308
- {
309
- var Re = (e) => {
310
- var t = ct();
311
- let n;
312
- var o = l(t);
313
- o.__click = Te;
314
- var h = l(o, !0);
315
- s(o);
316
- var r = _(o, 2);
317
- Q(r, 21, () => a(Se), V, (k, m) => {
318
- var A = Y(), J = Z(A);
319
- {
320
- var O = (P) => {
321
- var T = mt();
322
- p(P, T);
323
- }, K = (P) => {
324
- var T = ut();
325
- let X;
326
- T.__click = () => Ge(a(m));
327
- var Ie = l(T, !0);
328
- s(T), S(() => {
329
- X = N(T, 1, "PaginationButton Number svelte-p7mf8l", null, X, { Active: a(m) === a(U) }), w(Ie, a(m));
330
- }), p(P, T);
331
- };
332
- B(J, (P) => {
333
- typeof a(m) != "number" ? P(O) : P(K, !1);
334
- });
335
- }
336
- p(k, A);
337
- }), s(r);
338
- var i = _(r, 2);
339
- i.__click = Pe;
340
- var d = l(i, !0);
341
- s(i), s(t), S(
342
- (k, m) => {
343
- n = N(t, 1, "PaginationWrapper svelte-p7mf8l", null, n, { Hidden: a(G) === "sports" }), o.disabled = a(v) === 0, w(h, k), i.disabled = a(v) >= E() - c(), w(d, m);
344
- },
345
- [() => b()("previousButton"), () => b()("nextButton")]
346
- ), p(e, t);
347
- };
348
- B(ce, (e) => {
349
- a(I) && E() > c() && e(Re);
350
- });
351
- }
352
- var We = _(ce, 2);
353
- {
354
- var He = (e) => {
355
- var t = vt();
356
- p(e, t);
357
- };
358
- B(We, (e) => {
359
- a(I) || e(He);
360
- });
361
- }
362
- s(oe), S(
363
- (e, t) => {
364
- w(je, e), w(Ee, t), ue = N(q, 1, "TournamentGamesContainer svelte-p7mf8l", null, ue, { Hidden: a(G) === "sports" });
365
- },
366
- [
367
- () => b()("gamesDescriptionTitle"),
368
- () => b()("gamesDescriptionSubtitle")
369
- ]
370
- ), p(D, oe);
371
- var Fe = Ye(De);
372
- return xe(), Fe;
373
- }
374
- tt(["click"]);
375
- customElements.define("tournament-games", at(
376
- gt,
377
- {
378
- initialGames: {},
379
- endpoint: {},
380
- language: {},
381
- session: {},
382
- tournamentid: {},
383
- gamesLimit: {},
384
- totalGames: {},
385
- platformProp: {},
386
- tournamentMetadata: {},
387
- translationurl: {}
388
- },
389
- [],
390
- [],
391
- !1
392
- ));
393
- export {
394
- gt as default
395
- };