@everymatrix/tournament-details-page 0.1.3 → 0.1.4

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,11 +1,11 @@
1
- import { a as Fe, $ as qe, j as Je, b as Ke, p as _, u as Xe, d as ve, y as L, L as Qe, P as Ve, k as x, i as B, t as S, l as y, 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 w, 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-6JD1drZz.js";
2
- function fe(D, c) {
3
- Fe(D, c);
1
+ import { a as Fe, $ 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-CuPo8QmD.js";
2
+ function fe(D, u) {
3
+ Fe(D, u);
4
4
  }
5
5
  function ge(D) {
6
6
  qe.set(D);
7
7
  }
8
- const be = {
8
+ const he = {
9
9
  en: {
10
10
  previousButton: "Previous",
11
11
  nextButton: "Next",
@@ -27,7 +27,7 @@ const be = {
27
27
  noAvailableGames: "Henüz oyun yapılandırılmamış!"
28
28
  }
29
29
  }, nt = () => typeof window > "u";
30
- 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>'), ct = g("<button> </button>"), ut = 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>');
30
+ 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>');
31
31
  const ft = {
32
32
  hash: "svelte-p7mf8l",
33
33
  code: `.svelte-p7mf8l,
@@ -58,13 +58,19 @@ const ft = {
58
58
 
59
59
  }
60
60
 
61
- @media (max-width: 475px) {.TournamentGamesContainer.svelte-p7mf8l {gap:5px;grid-template-columns:repeat(auto-fill, minmax(min(150px, 100%), 1fr));}
62
- }.Hidden.svelte-p7mf8l {display:none;}`
61
+ @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;}
62
+ }
63
+
64
+ @media (max-width: 380px) {.TournamentGamesContainer.svelte-p7mf8l {grid-template-columns:repeat(auto-fill, minmax(min(145px, 100%), 1fr));}
65
+ }
66
+
67
+ @media (min-width: 1500px) {.TournamentGamesContainer.svelte-p7mf8l {gap:5px;grid-template-columns:repeat(auto-fill, minmax(min(215px, 100%), 1fr));}
68
+ }.Hidden.svelte-p7mf8l {display:none;}`
63
69
  };
64
- function gt(D, c) {
65
- Je(c, !0), Ke(D, ft);
66
- const b = () => Ze($e, "$_", he), [he, _e] = et(), R = _(c, "initialGames"), $ = _(c, "endpoint"), j = _(c, "language", 7, "en"), W = _(c, "session"), z = _(c, "tournamentid"), u = _(c, "gamesLimit", 7, 6), M = _(c, "totalGames"), ee = _(c, "platformProp", 7, null), E = _(c, "tournamentMetadata"), C = _(c, "translationurl"), xe = () => {
67
- let e = new URL(C());
70
+ function gt(D, u) {
71
+ Je(u, !0), Ke(D, ft);
72
+ const h = () => Ze($e, "$_", be), [be, xe] = et(), O = x(u, "initialGames"), $ = x(u, "endpoint"), j = x(u, "language", 7, "en"), C = x(u, "session"), W = x(u, "tournamentid"), c = x(u, "gamesLimit", 7, 6), M = x(u, "totalGames"), ee = x(u, "platformProp", 7, null), E = x(u, "tournamentMetadata"), R = x(u, "translationurl"), _e = () => {
73
+ let e = new URL(R());
68
74
  fetch(e.href).then((t) => t.json()).then((t) => {
69
75
  Object.keys(t).forEach((n) => {
70
76
  fe(n, t[n]);
@@ -73,42 +79,42 @@ function gt(D, c) {
73
79
  console.log(t);
74
80
  });
75
81
  };
76
- Object.keys(be).forEach((e) => {
77
- fe(e, be[e]);
82
+ Object.keys(he).forEach((e) => {
83
+ fe(e, he[e]);
78
84
  }), ge(j());
79
- const ye = () => {
85
+ const we = () => {
80
86
  ge(j());
81
87
  };
82
88
  Xe(() => {
83
- C() && xe();
89
+ R() && _e();
84
90
  }), ve(() => {
85
- ye();
91
+ we();
86
92
  });
87
- let te = L(Qe(R() || [])), H = L(!1), v = L(0), I = L(void 0), U = L(!0);
88
- const we = nt() ? ee() ?? "dk" : Ve(window.navigator.userAgent), ae = async () => {
93
+ let te = L(Qe(O() || [])), H = L(!1), v = L(0), I = L(void 0), U = L(!0);
94
+ const ye = nt() ? ee() ?? "dk" : Ve(window.navigator.userAgent), ae = async () => {
89
95
  if (ne.has(a(F)))
90
96
  return;
91
97
  f(H, !0);
92
- const e = new URL(`${$()}/v1/tournaments/${z()}`), t = new Headers();
93
- W() && t.append("X-SessionId", W());
98
+ const e = new URL(`${$()}/v1/tournaments/${W()}`), t = new Headers();
99
+ C() && t.append("X-SessionId", C());
94
100
  const n = { method: "GET", headers: t };
95
- e.searchParams.append("filter", `id=${z()}`), e.searchParams.append("language", j()), e.searchParams.append("expand", "games"), e.searchParams.append("pagination", `games(limit=${u()},offset=${a(v)})`), e.searchParams.append("platform", we), fetch(e, n).then((o) => o.json()).then((o) => {
101
+ e.searchParams.append("filter", `id=${W()}`), 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) => {
96
102
  f(te, o?.item?.games?.items, !0), ne.set(a(F), a(te)), a(U) || f(U, !0);
97
103
  }).catch((o) => console.log(o)).finally(() => f(H, !1));
98
- }, ke = () => {
99
- const e = Math.ceil(M() / u()), t = Math.floor(a(v) / u()) + 1;
104
+ }, Pe = () => {
105
+ const e = Math.ceil(M() / c()), t = Math.floor(a(v) / c()) + 1;
100
106
  if (e <= 5)
101
- return Array.from({ length: e }, (o, h) => h + 1);
107
+ return Array.from({ length: e }, (o, b) => b + 1);
102
108
  const n = [];
103
109
  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;
104
- }, Pe = () => {
105
- a(v) < M() && (f(v, a(v) + u()), ae());
110
+ }, ke = () => {
111
+ a(v) < M() && (f(v, a(v) + c()), ae());
106
112
  }, Te = () => {
107
- a(v) !== 0 && (f(v, a(v) - u()), ae());
113
+ a(v) !== 0 && (f(v, a(v) - c()), ae());
108
114
  }, Ge = (e) => {
109
- f(v, (e - 1) * u()), ae();
110
- }, Se = ie(ke), F = ie(() => Math.floor(a(v) / u()) + 1);
111
- let ne = /* @__PURE__ */ new Map([[1, R()]]), Ae = ie(() => ne.get(a(F)) ?? []), G = L("casino");
115
+ f(v, (e - 1) * c()), ae();
116
+ }, Se = ie(Pe), F = ie(() => Math.floor(a(v) / c()) + 1);
117
+ let ne = /* @__PURE__ */ new Map([[1, O()]]), Ae = ie(() => ne.get(a(F)) ?? []), G = L("casino");
112
118
  const Be = () => {
113
119
  if (!E()) return;
114
120
  const e = E().sports?.rules;
@@ -117,7 +123,7 @@ function gt(D, c) {
117
123
  try {
118
124
  t = JSON.parse(e), f(I, t[j()] || t["*"], !0);
119
125
  } catch (n) {
120
- console.log(n), f(I, `${b()("sportsRulesParseError")}`);
126
+ console.log(n), f(I, `${h()("sportsRulesParseError")}`);
121
127
  }
122
128
  }, Ne = (e) => {
123
129
  window.postMessage(
@@ -136,224 +142,224 @@ function gt(D, c) {
136
142
  });
137
143
  var De = {
138
144
  get initialGames() {
139
- return R();
145
+ return O();
140
146
  },
141
147
  set initialGames(e) {
142
- R(e), w();
148
+ O(e), y();
143
149
  },
144
150
  get endpoint() {
145
151
  return $();
146
152
  },
147
153
  set endpoint(e) {
148
- $(e), w();
154
+ $(e), y();
149
155
  },
150
156
  get language() {
151
157
  return j();
152
158
  },
153
159
  set language(e = "en") {
154
- j(e), w();
160
+ j(e), y();
155
161
  },
156
162
  get session() {
157
- return W();
163
+ return C();
158
164
  },
159
165
  set session(e) {
160
- W(e), w();
166
+ C(e), y();
161
167
  },
162
168
  get tournamentid() {
163
- return z();
169
+ return W();
164
170
  },
165
171
  set tournamentid(e) {
166
- z(e), w();
172
+ W(e), y();
167
173
  },
168
174
  get gamesLimit() {
169
- return u();
175
+ return c();
170
176
  },
171
177
  set gamesLimit(e = 6) {
172
- u(e), w();
178
+ c(e), y();
173
179
  },
174
180
  get totalGames() {
175
181
  return M();
176
182
  },
177
183
  set totalGames(e) {
178
- M(e), w();
184
+ M(e), y();
179
185
  },
180
186
  get platformProp() {
181
187
  return ee();
182
188
  },
183
189
  set platformProp(e = null) {
184
- ee(e), w();
190
+ ee(e), y();
185
191
  },
186
192
  get tournamentMetadata() {
187
193
  return E();
188
194
  },
189
195
  set tournamentMetadata(e) {
190
- E(e), w();
196
+ E(e), y();
191
197
  },
192
198
  get translationurl() {
193
- return C();
199
+ return R();
194
200
  },
195
201
  set translationurl(e) {
196
- C(e), w();
202
+ R(e), y();
197
203
  }
198
204
  }, oe = dt(), re = l(oe), se = l(re), je = l(se, !0);
199
205
  s(se);
200
- var le = x(se, 2), Me = l(le, !0);
206
+ var le = _(se, 2), Me = l(le, !0);
201
207
  s(le), s(re);
202
- var pe = x(re, 2);
208
+ var pe = _(re, 2);
203
209
  {
204
210
  var Ee = (e) => {
205
211
  var t = ot(), n = l(t);
206
212
  let o;
207
213
  n.__click = () => f(G, "casino");
208
- var h = l(n, !0);
214
+ var b = l(n, !0);
209
215
  s(n);
210
- var r = x(n, 2);
216
+ var r = _(n, 2);
211
217
  let i;
212
218
  r.__click = () => f(G, "sports");
213
219
  var d = l(r, !0);
214
220
  s(r), s(t), S(
215
- (k, m) => {
216
- o = N(n, 1, "Tab svelte-p7mf8l", null, o, { Active: a(G) === "casino" }), y(h, k), i = N(r, 1, "Tab svelte-p7mf8l", null, i, { Active: a(G) === "sports" }), y(d, m);
221
+ (P, m) => {
222
+ o = N(n, 1, "Tab svelte-p7mf8l", null, o, { Active: a(G) === "casino" }), w(b, P), i = N(r, 1, "Tab svelte-p7mf8l", null, i, { Active: a(G) === "sports" }), w(d, m);
217
223
  },
218
- [() => b()("casinoTab"), () => b()("sportsbookTab")]
224
+ [() => h()("casinoTab"), () => h()("sportsbookTab")]
219
225
  ), p(e, t);
220
226
  };
221
227
  B(pe, (e) => {
222
228
  Object.keys(E()).length !== 0 && e(Ee);
223
229
  });
224
230
  }
225
- var me = x(pe, 2);
231
+ var me = _(pe, 2);
226
232
  {
227
233
  var Le = (e) => {
228
234
  var t = st();
229
235
  let n;
230
- Q(t, 21, () => a(I), V, (o, h) => {
236
+ Q(t, 21, () => a(I), V, (o, b) => {
231
237
  var r = rt(), i = l(r);
232
- s(r), S((d) => y(i, `${a(h).rule ?? ""} ${d ?? ""}`), [() => b()("contribution")]), p(o, r);
238
+ s(r), S((d) => w(i, `${a(b).rule ?? ""} ${d ?? ""}`), [() => h()("contribution")]), p(o, r);
233
239
  }), s(t), S(() => n = N(t, 1, "TournamentRulesWrapper svelte-p7mf8l", null, n, { Hidden: a(G) === "casino" })), p(e, t);
234
240
  };
235
241
  B(me, (e) => {
236
242
  a(I) && e(Le);
237
243
  });
238
244
  }
239
- var q = x(me, 2);
240
- let ce;
241
- var Oe = l(q);
245
+ var q = _(me, 2);
246
+ let ue;
247
+ var ze = l(q);
242
248
  {
243
- var Re = (e) => {
249
+ var Oe = (e) => {
244
250
  var t = Y(), n = Z(t);
245
- Q(n, 17, () => Array(u()), V, (o, h, r, i) => {
251
+ Q(n, 17, () => Array(c()), V, (o, b, r, i) => {
246
252
  var d = it();
247
253
  p(o, d);
248
254
  }), p(e, t);
249
- }, We = (e) => {
255
+ }, Ce = (e) => {
250
256
  var t = Y(), n = Z(t);
251
257
  {
252
258
  var o = (r) => {
253
259
  var i = lt();
254
260
  let d;
255
- var k = l(i, !0);
261
+ var P = l(i, !0);
256
262
  s(i), S(
257
263
  (m) => {
258
- d = N(i, 1, "NoGamesAvailable svelte-p7mf8l", null, d, { Hidden: a(G) === "sports" }), y(k, m);
264
+ d = N(i, 1, "NoGamesAvailable svelte-p7mf8l", null, d, { Hidden: a(G) === "sports" }), w(P, m);
259
265
  },
260
- [() => b()("noAvailableGames")]
266
+ [() => h()("noAvailableGames")]
261
267
  ), p(r, i);
262
- }, h = (r) => {
268
+ }, b = (r) => {
263
269
  var i = Y(), d = Z(i);
264
- Q(d, 17, () => a(Ae), V, (k, m) => {
270
+ Q(d, 17, () => a(Ae), V, (P, m) => {
265
271
  var A = pt();
266
272
  A.__click = () => Ne(a(m));
267
- var J = l(A), O = l(J), K = x(O, 2), P = l(K), T = l(P, !0);
268
- s(P), s(K), s(J), s(A), S(
273
+ var J = l(A), z = l(J), K = _(z, 2), k = l(K), T = l(k, !0);
274
+ s(k), s(K), s(J), s(A), S(
269
275
  (X) => {
270
- de(O, "src", `https:${a(m).thumbnail}`), de(O, "alt", a(m).name), y(T, X);
276
+ de(z, "src", `https:${a(m).thumbnail}`), de(z, "alt", a(m).name), w(T, X);
271
277
  },
272
- [() => b()("play")]
273
- ), p(k, A);
278
+ [() => h()("play")]
279
+ ), p(P, A);
274
280
  }), p(r, i);
275
281
  };
276
282
  B(
277
283
  n,
278
284
  (r) => {
279
- !a(H) && a(te)?.length === 0 ? r(o) : r(h, !1);
285
+ !a(H) && a(te)?.length === 0 ? r(o) : r(b, !1);
280
286
  },
281
287
  !0
282
288
  );
283
289
  }
284
290
  p(e, t);
285
291
  };
286
- B(Oe, (e) => {
287
- a(H) ? e(Re) : e(We, !1);
292
+ B(ze, (e) => {
293
+ a(H) ? e(Oe) : e(Ce, !1);
288
294
  });
289
295
  }
290
296
  s(q);
291
- var ue = x(q, 2);
297
+ var ce = _(q, 2);
292
298
  {
293
- var ze = (e) => {
294
- var t = ut();
299
+ var We = (e) => {
300
+ var t = ct();
295
301
  let n;
296
302
  var o = l(t);
297
303
  o.__click = Te;
298
- var h = l(o, !0);
304
+ var b = l(o, !0);
299
305
  s(o);
300
- var r = x(o, 2);
301
- Q(r, 21, () => a(Se), V, (k, m) => {
306
+ var r = _(o, 2);
307
+ Q(r, 21, () => a(Se), V, (P, m) => {
302
308
  var A = Y(), J = Z(A);
303
309
  {
304
- var O = (P) => {
310
+ var z = (k) => {
305
311
  var T = mt();
306
- p(P, T);
307
- }, K = (P) => {
308
- var T = ct();
312
+ p(k, T);
313
+ }, K = (k) => {
314
+ var T = ut();
309
315
  let X;
310
316
  T.__click = () => Ge(a(m));
311
317
  var Ue = l(T, !0);
312
318
  s(T), S(() => {
313
- X = N(T, 1, "PaginationButton Number svelte-p7mf8l", null, X, { Active: a(m) === a(F) }), y(Ue, a(m));
314
- }), p(P, T);
319
+ X = N(T, 1, "PaginationButton Number svelte-p7mf8l", null, X, { Active: a(m) === a(F) }), w(Ue, a(m));
320
+ }), p(k, T);
315
321
  };
316
- B(J, (P) => {
317
- typeof a(m) != "number" ? P(O) : P(K, !1);
322
+ B(J, (k) => {
323
+ typeof a(m) != "number" ? k(z) : k(K, !1);
318
324
  });
319
325
  }
320
- p(k, A);
326
+ p(P, A);
321
327
  }), s(r);
322
- var i = x(r, 2);
323
- i.__click = Pe;
328
+ var i = _(r, 2);
329
+ i.__click = ke;
324
330
  var d = l(i, !0);
325
331
  s(i), s(t), S(
326
- (k, m) => {
327
- n = N(t, 1, "PaginationWrapper svelte-p7mf8l", null, n, { Hidden: a(G) === "sports" }), o.disabled = a(v) === 0, y(h, k), i.disabled = a(v) >= M() - u(), y(d, m);
332
+ (P, m) => {
333
+ n = N(t, 1, "PaginationWrapper svelte-p7mf8l", null, n, { Hidden: a(G) === "sports" }), o.disabled = a(v) === 0, w(b, P), i.disabled = a(v) >= M() - c(), w(d, m);
328
334
  },
329
- [() => b()("previousButton"), () => b()("nextButton")]
335
+ [() => h()("previousButton"), () => h()("nextButton")]
330
336
  ), p(e, t);
331
337
  };
332
- B(ue, (e) => {
333
- a(U) && M() > u() && e(ze);
338
+ B(ce, (e) => {
339
+ a(U) && M() > c() && e(We);
334
340
  });
335
341
  }
336
- var Ce = x(ue, 2);
342
+ var Re = _(ce, 2);
337
343
  {
338
344
  var He = (e) => {
339
345
  var t = vt();
340
346
  p(e, t);
341
347
  };
342
- B(Ce, (e) => {
348
+ B(Re, (e) => {
343
349
  a(U) || e(He);
344
350
  });
345
351
  }
346
352
  s(oe), S(
347
353
  (e, t) => {
348
- y(je, e), y(Me, t), ce = N(q, 1, "TournamentGamesContainer svelte-p7mf8l", null, ce, { Hidden: a(G) === "sports" });
354
+ w(je, e), w(Me, t), ue = N(q, 1, "TournamentGamesContainer svelte-p7mf8l", null, ue, { Hidden: a(G) === "sports" });
349
355
  },
350
356
  [
351
- () => b()("gamesDescriptionTitle"),
352
- () => b()("gamesDescriptionSubtitle")
357
+ () => h()("gamesDescriptionTitle"),
358
+ () => h()("gamesDescriptionSubtitle")
353
359
  ]
354
360
  ), p(D, oe);
355
361
  var Ie = Ye(De);
356
- return _e(), Ie;
362
+ return xe(), Ie;
357
363
  }
358
364
  tt(["click"]);
359
365
  customElements.define("tournament-games", at(
@@ -0,0 +1,36 @@
1
+ "use strict";var Z=(_,l,i)=>new Promise((W,A)=>{var k=f=>{try{g(i.next(f))}catch(x){A(x)}},G=f=>{try{g(i.throw(f))}catch(x){A(x)}},g=f=>f.done?W(f.value):Promise.resolve(f.value).then(k,G);g((i=i.apply(_,l)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./TournamentDetailsPage-Cwwspvbg.cjs");function $(_,l){e.addMessages(_,l)}function ee(_){e.$locale.set(_)}const te={en:{previousButton:"Previous",nextButton:"Next",casinoTab:"Casino",sportsbookTab:"Sportsbook",gamesDescriptionTitle:"Participating games",gamesDescriptionSubtitle:"Discover the games",sportsRulesParseError:"Error parsing tournament rules",noAvailableGames:"No games have been configured yet!"},tr:{previousButton:"Önceki",nextButton:"Sonraki",casinoTab:"Casino",sportsbookTab:"Spor Bahisleri",gamesDescriptionTitle:"Katılımcı oyunlar",gamesDescriptionSubtitle:"Oyunları keşfedin",sportsRulesParseError:"Turnuva kuralları ayrıştırma hatası",noAvailableGames:"Henüz oyun yapılandırılmamış!"}},Se=()=>typeof window=="undefined";var Ae=e.from_html('<div class="TournamentGamesTabs svelte-p7mf8l"><button> </button> <button> </button></div>'),Be=e.from_html('<p class="svelte-p7mf8l"> </p>'),Ne=e.from_html("<div></div>"),De=e.from_html('<div class="TournamentGameThumbnailSkeleton svelte-p7mf8l"></div>'),je=e.from_html("<p> </p>"),Me=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>'),Ee=e.from_html('<span class="PaginationButton Elipsis svelte-p7mf8l">...</span>'),Le=e.from_html("<button> </button>"),Oe=e.from_html('<div><button class="PaginationButton svelte-p7mf8l"> </button> <div class="PageNumberWrapper svelte-p7mf8l"></div> <button class="PaginationButton svelte-p7mf8l"> </button></div>'),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>'),We=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;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(
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
+ }
28
+
29
+ @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;}
30
+ }
31
+
32
+ @media (max-width: 380px) {.TournamentGamesContainer.svelte-p7mf8l {grid-template-columns:repeat(auto-fill, minmax(min(145px, 100%), 1fr));}
33
+ }
34
+
35
+ @media (min-width: 1500px) {.TournamentGamesContainer.svelte-p7mf8l {gap:5px;grid-template-columns:repeat(auto-fill, minmax(min(215px, 100%), 1fr));}
36
+ }.Hidden.svelte-p7mf8l {display:none;}`};function ae(_,l){var Y;e.push(l,!0),e.append_styles(_,Ce);const i=()=>e.store_get(e.$format,"$_",W),[W,A]=e.setup_stores(),k=e.prop(l,"initialGames"),G=e.prop(l,"endpoint"),g=e.prop(l,"language",7,"en"),f=e.prop(l,"session"),x=e.prop(l,"tournamentid"),d=e.prop(l,"gamesLimit",7,6),P=e.prop(l,"totalGames"),C=e.prop(l,"platformProp",7,null),T=e.prop(l,"tournamentMetadata"),B=e.prop(l,"translationurl"),ne=()=>{let t=new URL(B());fetch(t.href).then(a=>a.json()).then(a=>{Object.keys(a).forEach(n=>{$(n,a[n])})}).catch(a=>{console.log(a)})};Object.keys(te).forEach(t=>{$(t,te[t])}),ee(g());const re=()=>{ee(g())};e.user_pre_effect(()=>{B()&&ne()}),e.user_effect(()=>{re()});let R=e.state(e.proxy(k()||[])),N=e.state(!1),u=e.state(0),D=e.state(void 0),j=e.state(!0);const se=Se()?(Y=C())!=null?Y:"dk":e.getDevice(window.navigator.userAgent),H=()=>Z(this,null,function*(){if(I.has(e.get(M)))return;e.set(N,!0);const t=new URL(`${G()}/v1/tournaments/${x()}`),a=new Headers;f()&&a.append("X-SessionId",f());const n={method:"GET",headers:a};t.searchParams.append("filter",`id=${x()}`),t.searchParams.append("language",g()),t.searchParams.append("expand","games"),t.searchParams.append("pagination",`games(limit=${d()},offset=${e.get(u)})`),t.searchParams.append("platform",se),fetch(t,n).then(r=>r.json()).then(r=>{var c,s;e.set(R,(s=(c=r==null?void 0:r.item)==null?void 0:c.games)==null?void 0:s.items,!0),I.set(e.get(M),e.get(R)),e.get(j)||e.set(j,!0)}).catch(r=>console.log(r)).finally(()=>e.set(N,!1))}),oe=()=>{const t=Math.ceil(P()/d()),a=Math.floor(e.get(u)/d())+1;if(t<=5)return Array.from({length:t},(r,c)=>c+1);const n=[];return n.push(1),a<=3?(n.push(2,3),n.push("..."),n.push(t)):a>=t-2?(n.push("..."),n.push(t-2,t-1,t)):(n.push("..."),n.push(a-1,a,a+1),n.push("..."),n.push(t)),n},le=()=>{e.get(u)<P()&&(e.set(u,e.get(u)+d()),H())},ie=()=>{e.get(u)!==0&&(e.set(u,e.get(u)-d()),H())},pe=t=>{e.set(u,(t-1)*d()),H()},me=e.user_derived(oe),M=e.user_derived(()=>Math.floor(e.get(u)/d())+1);let I=new Map([[1,k()]]),ce=e.user_derived(()=>{var t;return(t=I.get(e.get(M)))!=null?t:[]}),y=e.state("casino");const fe=()=>{var n;if(!T())return;const t=(n=T().sports)==null?void 0:n.rules;let a;if(t)try{a=JSON.parse(t),e.set(D,a[g()]||a["*"],!0)}catch(r){console.log(r),e.set(D,`${i()("sportsRulesParseError")}`)}},de=t=>{window.postMessage({type:"Tournaments:PlayGame",launchUrl:t.launchUrl,id:t.gameId,thumbnail:t.thumbnail,name:t.name},window.location.href)};e.user_effect(()=>{Object.keys(T()).length!==0&&fe()});var ue={get initialGames(){return k()},set initialGames(t){k(t),e.flushSync()},get endpoint(){return G()},set endpoint(t){G(t),e.flushSync()},get language(){return g()},set language(t="en"){g(t),e.flushSync()},get session(){return f()},set session(t){f(t),e.flushSync()},get tournamentid(){return x()},set tournamentid(t){x(t),e.flushSync()},get gamesLimit(){return d()},set gamesLimit(t=6){d(t),e.flushSync()},get totalGames(){return P()},set totalGames(t){P(t),e.flushSync()},get platformProp(){return C()},set platformProp(t=null){C(t),e.flushSync()},get tournamentMetadata(){return T()},set tournamentMetadata(t){T(t),e.flushSync()},get translationurl(){return B()},set translationurl(t){B(t),e.flushSync()}},U=We(),F=e.child(U),q=e.child(F),ve=e.child(q,!0);e.reset(q);var J=e.sibling(q,2),ge=e.child(J,!0);e.reset(J),e.reset(F);var K=e.sibling(F,2);{var he=t=>{var a=Ae(),n=e.child(a);let r;n.__click=()=>e.set(y,"casino");var c=e.child(n,!0);e.reset(n);var s=e.sibling(n,2);let o;s.__click=()=>e.set(y,"sports");var p=e.child(s,!0);e.reset(s),e.reset(a),e.template_effect((v,m)=>{r=e.set_class(n,1,"Tab svelte-p7mf8l",null,r,{Active:e.get(y)==="casino"}),e.set_text(c,v),o=e.set_class(s,1,"Tab svelte-p7mf8l",null,o,{Active:e.get(y)==="sports"}),e.set_text(p,m)},[()=>i()("casinoTab"),()=>i()("sportsbookTab")]),e.append(t,a)};e.if_block(K,t=>{Object.keys(T()).length!==0&&t(he)})}var X=e.sibling(K,2);{var be=t=>{var a=Ne();let n;e.each(a,21,()=>e.get(D),e.index,(r,c)=>{var s=Be(),o=e.child(s);e.reset(s),e.template_effect(p=>{var v;return e.set_text(o,`${(v=e.get(c).rule)!=null?v:""} ${p!=null?p:""}`)},[()=>i()("contribution")]),e.append(r,s)}),e.reset(a),e.template_effect(()=>n=e.set_class(a,1,"TournamentRulesWrapper svelte-p7mf8l",null,n,{Hidden:e.get(y)==="casino"})),e.append(t,a)};e.if_block(X,t=>{e.get(D)&&t(be)})}var E=e.sibling(X,2);let Q;var _e=e.child(E);{var xe=t=>{var a=e.comment(),n=e.first_child(a);e.each(n,17,()=>Array(d()),e.index,(r,c,s,o)=>{var p=De();e.append(r,p)}),e.append(t,a)},ye=t=>{var a=e.comment(),n=e.first_child(a);{var r=s=>{var o=je();let p;var v=e.child(o,!0);e.reset(o),e.template_effect(m=>{p=e.set_class(o,1,"NoGamesAvailable svelte-p7mf8l",null,p,{Hidden:e.get(y)==="sports"}),e.set_text(v,m)},[()=>i()("noAvailableGames")]),e.append(s,o)},c=s=>{var o=e.comment(),p=e.first_child(o);e.each(p,17,()=>e.get(ce),e.index,(v,m)=>{var w=Me();w.__click=()=>de(e.get(m));var L=e.child(w),S=e.child(L),O=e.sibling(S,2),h=e.child(O),b=e.child(h,!0);e.reset(h),e.reset(O),e.reset(L),e.reset(w),e.template_effect(z=>{e.set_attribute(S,"src",`https:${e.get(m).thumbnail}`),e.set_attribute(S,"alt",e.get(m).name),e.set_text(b,z)},[()=>i()("play")]),e.append(v,w)}),e.append(s,o)};e.if_block(n,s=>{var o;!e.get(N)&&((o=e.get(R))==null?void 0:o.length)===0?s(r):s(c,!1)},!0)}e.append(t,a)};e.if_block(_e,t=>{e.get(N)?t(xe):t(ye,!1)})}e.reset(E);var V=e.sibling(E,2);{var we=t=>{var a=Oe();let n;var r=e.child(a);r.__click=ie;var c=e.child(r,!0);e.reset(r);var s=e.sibling(r,2);e.each(s,21,()=>e.get(me),e.index,(v,m)=>{var w=e.comment(),L=e.first_child(w);{var S=h=>{var b=Ee();e.append(h,b)},O=h=>{var b=Le();let z;b.__click=()=>pe(e.get(m));var Ge=e.child(b,!0);e.reset(b),e.template_effect(()=>{z=e.set_class(b,1,"PaginationButton Number svelte-p7mf8l",null,z,{Active:e.get(m)===e.get(M)}),e.set_text(Ge,e.get(m))}),e.append(h,b)};e.if_block(L,h=>{typeof e.get(m)!="number"?h(S):h(O,!1)})}e.append(v,w)}),e.reset(s);var o=e.sibling(s,2);o.__click=le;var p=e.child(o,!0);e.reset(o),e.reset(a),e.template_effect((v,m)=>{n=e.set_class(a,1,"PaginationWrapper svelte-p7mf8l",null,n,{Hidden:e.get(y)==="sports"}),r.disabled=e.get(u)===0,e.set_text(c,v),o.disabled=e.get(u)>=P()-d(),e.set_text(p,m)},[()=>i()("previousButton"),()=>i()("nextButton")]),e.append(t,a)};e.if_block(V,t=>{e.get(j)&&P()>d()&&t(we)})}var ke=e.sibling(V,2);{var Pe=t=>{var a=ze();e.append(t,a)};e.if_block(ke,t=>{e.get(j)||t(Pe)})}e.reset(U),e.template_effect((t,a)=>{e.set_text(ve,t),e.set_text(ge,a),Q=e.set_class(E,1,"TournamentGamesContainer svelte-p7mf8l",null,Q,{Hidden:e.get(y)==="sports"})},[()=>i()("gamesDescriptionTitle"),()=>i()("gamesDescriptionSubtitle")]),e.append(_,U);var Te=e.pop(ue);return A(),Te}e.delegate(["click"]);customElements.define("tournament-games",e.create_custom_element(ae,{initialGames:{},endpoint:{},language:{},session:{},tournamentid:{},gamesLimit:{},totalGames:{},platformProp:{},tournamentMetadata:{},translationurl:{}},[],[],!1));exports.default=ae;