@everymatrix/tournament-details-page 0.1.0 → 0.1.2

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