@everymatrix/casino-tournament-banner 1.37.5 → 1.37.7

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,8 +1,7 @@
1
- import { r as registerInstance, h, g as getElement } from './index-8fa39ce1.js';
2
- import '@everymatrix/casino-tournament-buttons';
1
+ import { r as registerInstance, h, g as getElement, c as createEvent } from './index-1ea7f13c.js';
3
2
 
4
- const DEFAULT_LANGUAGE = 'en';
5
- const TRANSLATIONS = {
3
+ const DEFAULT_LANGUAGE$1 = 'en';
4
+ const TRANSLATIONS$1 = {
6
5
  en: {
7
6
  joined: 'Joined',
8
7
  join: 'Join',
@@ -388,15 +387,15 @@ const TRANSLATIONS = {
388
387
  days: 'dani',
389
388
  }
390
389
  };
391
- const translate = (key, customLang) => {
390
+ const translate$1 = (key, customLang) => {
392
391
  var _a, _b;
393
392
  const lang = customLang;
394
- return ((_a = TRANSLATIONS[lang]) === null || _a === void 0 ? void 0 : _a[key]) || ((_b = TRANSLATIONS[DEFAULT_LANGUAGE]) === null || _b === void 0 ? void 0 : _b[key]);
393
+ return ((_a = TRANSLATIONS$1[lang]) === null || _a === void 0 ? void 0 : _a[key]) || ((_b = TRANSLATIONS$1[DEFAULT_LANGUAGE$1]) === null || _b === void 0 ? void 0 : _b[key]);
395
394
  };
396
- const getTranslations = (data) => {
395
+ const getTranslations$1 = (data) => {
397
396
  Object.keys(data).forEach((item) => {
398
397
  for (let key in data[item]) {
399
- TRANSLATIONS[item][key] = data[item][key];
398
+ TRANSLATIONS$1[item][key] = data[item][key];
400
399
  }
401
400
  });
402
401
  };
@@ -6143,7 +6142,7 @@ const CasinoTournamentBanner = class {
6143
6142
  return ((new Date(dateString2)).getTime() - (new Date(dateString1)).getTime()) / (1000 * 60);
6144
6143
  }
6145
6144
  getTextByDiff(diff) {
6146
- const renderText = (amount, type) => ' - ' + amount + ' ' + translate(type, this.language);
6145
+ const renderText = (amount, type) => ' - ' + amount + ' ' + translate$1(type, this.language);
6147
6146
  const renderTimeColumn = (column) => {
6148
6147
  const columnInt = Math.floor(column);
6149
6148
  if (columnInt < 10) {
@@ -6170,16 +6169,16 @@ const CasinoTournamentBanner = class {
6170
6169
  let text = '';
6171
6170
  switch (state) {
6172
6171
  case 'Upcoming':
6173
- text = translate('scheduled', this.language);
6172
+ text = translate$1('scheduled', this.language);
6174
6173
  break;
6175
6174
  case 'Unstarted':
6176
- text = translate('scheduled', this.language);
6175
+ text = translate$1('scheduled', this.language);
6177
6176
  break;
6178
6177
  case 'Running':
6179
- text = translate('ongoing', this.language);
6178
+ text = translate$1('ongoing', this.language);
6180
6179
  break;
6181
6180
  default:
6182
- text = translate('finished', this.language);
6181
+ text = translate$1('finished', this.language);
6183
6182
  break;
6184
6183
  }
6185
6184
  return text;
@@ -6217,14 +6216,14 @@ const CasinoTournamentBanner = class {
6217
6216
  let currentDate = new Date(this.startTime);
6218
6217
  const setTranslation = () => {
6219
6218
  return (this.state === 'Running' || this.state == 'Closing' || this.state == 'Closed') ?
6220
- translate('startedAt', this.language) :
6221
- translate('startingAt', this.language);
6219
+ translate$1('startedAt', this.language) :
6220
+ translate$1('startingAt', this.language);
6222
6221
  };
6223
6222
  if (this.shortStart) {
6224
6223
  let startTimeAsString = hooks(currentDate).format(this.shortstartformat);
6225
6224
  this.startdate = (this.state === 'Running' || this.state == 'Closing' || this.state == 'Closed') ?
6226
- translate('startedAtWithTime', this.language) + startTimeAsString :
6227
- translate('startingAtWithTime', this.language) + startTimeAsString;
6225
+ translate$1('startedAtWithTime', this.language) + startTimeAsString :
6226
+ translate$1('startingAtWithTime', this.language) + startTimeAsString;
6228
6227
  }
6229
6228
  else {
6230
6229
  let currentMonthKey = new Intl.DateTimeFormat('en', dateOptions).format(currentDate);
@@ -6232,14 +6231,14 @@ const CasinoTournamentBanner = class {
6232
6231
  let currentHour = currentDate.toLocaleString('en-GB', { hour: 'numeric', minute: 'numeric', hour12: false });
6233
6232
  this.startdate =
6234
6233
  `${currentDay}` + ' ' +
6235
- translate(`${currentMonthKey}`, this.language) + ', ' +
6234
+ translate$1(`${currentMonthKey}`, this.language) + ', ' +
6236
6235
  setTranslation() +
6237
6236
  ` ${currentHour}`;
6238
6237
  }
6239
6238
  }
6240
6239
  componentWillLoad() {
6241
6240
  if (this.translationData) {
6242
- getTranslations(JSON.parse(this.translationData));
6241
+ getTranslations$1(JSON.parse(this.translationData));
6243
6242
  if (this.state) {
6244
6243
  this.stateText = this.getStateText(this.state);
6245
6244
  }
@@ -6274,14 +6273,14 @@ const CasinoTournamentBanner = class {
6274
6273
  h("span", { class: "Tag Date" }, this.showCalendar &&
6275
6274
  h("svg", { class: "CalendarIcon", width: "9", height: "11", viewBox: "0 0 9 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M8.1 1.4H7.65V0.5H6.75V1.4H2.25V0.5H1.35V1.4H0.9C0.405 1.4 0 1.805 0 2.3V9.5C0 9.995 0.405 10.4 0.9 10.4H8.1C8.595 10.4 9 9.995 9 9.5V2.3C9 1.805 8.595 1.4 8.1 1.4ZM8.10003 9.5H0.900027V4.55H8.10003V9.5ZM0.900027 3.65005H8.10003V2.30005H0.900027V3.65005Z", fill: "#1E1616" })), this.startdate)), h("div", { class: "BannerInfo", part: "BannerInfo" }, this.enrolled &&
6276
6275
  h("span", { class: "Tag Enroll" }, this.showCheck &&
6277
- h("svg", { class: "EnrollCheck", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" }, h("path", { d: "M4.50008 8.08492L2.41508 5.99992L1.70508 6.70492L4.50008 9.49992L10.5001 3.49992L9.79508 2.79492L4.50008 8.08492Z", fill: "white" })), translate('enrolled', this.language)))), this.cardMode && h("div", { class: "TournamentBannerThumb", part: "TournamentBannerThumb" }, h("div", { class: "ThumbTitle", part: "ThumbTitle" }, translate('tournament', this.language)), h("div", { class: "ThumbName", part: "ThumbName" }, this.nameOrTitle), h("div", { class: "ThumbState" }, this.session && this.enrolled ?
6278
- h("span", { class: "Tag Join" }, h("svg", { class: "EnrollCheck", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" }, h("path", { d: "M4.50008 8.08492L2.41508 5.99992L1.70508 6.70492L4.50008 9.49992L10.5001 3.49992L9.79508 2.79492L4.50008 8.08492Z", fill: "white" })), translate('joined', this.language))
6276
+ h("svg", { class: "EnrollCheck", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" }, h("path", { d: "M4.50008 8.08492L2.41508 5.99992L1.70508 6.70492L4.50008 9.49992L10.5001 3.49992L9.79508 2.79492L4.50008 8.08492Z", fill: "white" })), translate$1('enrolled', this.language)))), this.cardMode && h("div", { class: "TournamentBannerThumb", part: "TournamentBannerThumb" }, h("div", { class: "ThumbTitle", part: "ThumbTitle" }, translate$1('tournament', this.language)), h("div", { class: "ThumbName", part: "ThumbName" }, this.nameOrTitle), h("div", { class: "ThumbState" }, this.session && this.enrolled ?
6277
+ h("span", { class: "Tag Join" }, h("svg", { class: "EnrollCheck", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none" }, h("path", { d: "M4.50008 8.08492L2.41508 5.99992L1.70508 6.70492L4.50008 9.49992L10.5001 3.49992L9.79508 2.79492L4.50008 8.08492Z", fill: "white" })), translate$1('joined', this.language))
6279
6278
  :
6280
6279
  this.session && this.state != 'Closed' &&
6281
- h("span", { class: "Tag Join" }, h("svg", { class: "JoinPlus", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "13", viewBox: "0 0 12 13", fill: "none" }, h("path", { d: "M9.5 6.8335H6.5V9.8335H5.5V6.8335H2.5V5.8335H5.5V2.8335H6.5V5.8335H9.5V6.8335Z", fill: "white" })), translate('join', this.language)), this.state == 'Running' && h("span", { class: `Tag State ${this.state}` }, this.stateText, this.showRunningDate &&
6282
- h("span", { class: "TagRemain" }, this.showRemain, " ", translate('left', this.language))), (this.state == 'Unstarted' || this.state == 'Upcoming' || this.state == 'Closed') &&
6280
+ h("span", { class: "Tag Join" }, h("svg", { class: "JoinPlus", xmlns: "http://www.w3.org/2000/svg", width: "12", height: "13", viewBox: "0 0 12 13", fill: "none" }, h("path", { d: "M9.5 6.8335H6.5V9.8335H5.5V6.8335H2.5V5.8335H5.5V2.8335H6.5V5.8335H9.5V6.8335Z", fill: "white" })), translate$1('join', this.language)), this.state == 'Running' && h("span", { class: `Tag State ${this.state}` }, this.stateText, this.showRunningDate &&
6281
+ h("span", { class: "TagRemain" }, this.showRemain, " ", translate$1('left', this.language))), (this.state == 'Unstarted' || this.state == 'Upcoming' || this.state == 'Closed') &&
6283
6282
  h("span", { class: `Tag Date ${this.state}` }, this.showCalendar &&
6284
- h("svg", { class: "CalendarIcon", width: "9", height: "11", viewBox: "0 0 9 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M8.1 1.4H7.65V0.5H6.75V1.4H2.25V0.5H1.35V1.4H0.9C0.405 1.4 0 1.805 0 2.3V9.5C0 9.995 0.405 10.4 0.9 10.4H8.1C8.595 10.4 9 9.995 9 9.5V2.3C9 1.805 8.595 1.4 8.1 1.4ZM8.10003 9.5H0.900027V4.55H8.10003V9.5ZM0.900027 3.65005H8.10003V2.30005H0.900027V3.65005Z", fill: "#1E1616" })), this.startdate)), h("div", { class: "ThumbButtons" }, h("casino-tournament-buttons", { enrolled: this.enrolled, session: this.session, endpoint: this.endpoint, language: this.language, "tournament-id": this.tournamentId, "login-event": this.loginEvent, "login-url": this.loginUrl, "register-event": this.registerEvent, "register-url": this.registerUrl, currency: this.currency, "bonus-code": this.bonusCode, "show-read-more": this.showReadMore, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "translation-data": this.translationData })), h("div", { class: "ThumbTC" }, h("span", { onClick: this.termsClick.bind(this, this.tournamentId) }, translate('terms', this.language))))));
6283
+ h("svg", { class: "CalendarIcon", width: "9", height: "11", viewBox: "0 0 9 11", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M8.1 1.4H7.65V0.5H6.75V1.4H2.25V0.5H1.35V1.4H0.9C0.405 1.4 0 1.805 0 2.3V9.5C0 9.995 0.405 10.4 0.9 10.4H8.1C8.595 10.4 9 9.995 9 9.5V2.3C9 1.805 8.595 1.4 8.1 1.4ZM8.10003 9.5H0.900027V4.55H8.10003V9.5ZM0.900027 3.65005H8.10003V2.30005H0.900027V3.65005Z", fill: "#1E1616" })), this.startdate)), h("div", { class: "ThumbButtons" }, h("casino-tournament-buttons", { enrolled: this.enrolled, session: this.session, endpoint: this.endpoint, language: this.language, "tournament-id": this.tournamentId, "login-event": this.loginEvent, "login-url": this.loginUrl, "register-event": this.registerEvent, "register-url": this.registerUrl, currency: this.currency, "bonus-code": this.bonusCode, "show-read-more": this.showReadMore, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "translation-data": this.translationData })), h("div", { class: "ThumbTC" }, h("span", { onClick: this.termsClick.bind(this, this.tournamentId) }, translate$1('terms', this.language))))));
6285
6284
  }
6286
6285
  get host() { return getElement(this); }
6287
6286
  static get watchers() { return {
@@ -6290,4 +6289,562 @@ const CasinoTournamentBanner = class {
6290
6289
  };
6291
6290
  CasinoTournamentBanner.style = casinoTournamentBannerCss;
6292
6291
 
6293
- export { CasinoTournamentBanner as casino_tournament_banner };
6292
+ const getDevice = () => {
6293
+ let userAgent = window.navigator.userAgent;
6294
+ if (userAgent.toLowerCase().match(/android/i)) {
6295
+ return 'Android';
6296
+ }
6297
+ if (userAgent.toLowerCase().match(/iphone/i)) {
6298
+ return 'iPhone';
6299
+ }
6300
+ if (userAgent.toLowerCase().match(/ipad|ipod/i)) {
6301
+ return 'iPad';
6302
+ }
6303
+ return 'PC';
6304
+ };
6305
+
6306
+ const DEFAULT_LANGUAGE = 'en';
6307
+ const TRANSLATIONS = {
6308
+ en: {
6309
+ joined: 'Joined',
6310
+ join: 'Join',
6311
+ enrolled: 'Enrolled',
6312
+ scoreCriteria: 'Score Criteria',
6313
+ minbet: 'min bet count',
6314
+ seegames: 'You can see the games',
6315
+ here: 'here',
6316
+ scheduled: 'Scheduled',
6317
+ ongoing: 'Ongoing',
6318
+ finished: 'Finished',
6319
+ startingAt: 'Starting at:',
6320
+ startedAt: 'Started at:',
6321
+ startingAtWithTime: `Starts `,
6322
+ startedAtWithTime: `Started `,
6323
+ mostRounds: 'Most Rounds',
6324
+ betCount: 'Number of Bets',
6325
+ maxWinStakeRatio: 'Max Win per Stake',
6326
+ winStakeRatio: 'Total Win per Stake',
6327
+ January: 'January',
6328
+ February: 'February',
6329
+ March: 'March',
6330
+ April: 'April',
6331
+ May: 'May',
6332
+ June: 'June',
6333
+ July: 'July',
6334
+ August: 'August',
6335
+ September: 'September',
6336
+ October: 'October',
6337
+ November: 'November',
6338
+ December: 'December',
6339
+ login: 'Log in',
6340
+ register: 'Register',
6341
+ details: 'Details',
6342
+ joinerror: 'An error occurred while registering in the tournament, please try again.'
6343
+ },
6344
+ 'zh-hk': {
6345
+ enrolled: '已註冊',
6346
+ scoreCriteria: '評分標準',
6347
+ minbet: '最小投注數:',
6348
+ seegames: '你可以看比賽',
6349
+ here: '這裡',
6350
+ scheduled: '預定的',
6351
+ ongoing: '進行中',
6352
+ finished: '完成的',
6353
+ startingAt: '開始於',
6354
+ startedAt: '大多數回合',
6355
+ mostRounds: '投注數',
6356
+ betCount: '投注计数',
6357
+ maxWinStakeRatio: '最大勝率',
6358
+ winStakeRatio: '勝率',
6359
+ January: '一月',
6360
+ February: '二月',
6361
+ March: '行进',
6362
+ April: '四月',
6363
+ May: '可能',
6364
+ June: '六月',
6365
+ July: '七月',
6366
+ August: '八月',
6367
+ September: '九月',
6368
+ October: '十月',
6369
+ November: '十一月',
6370
+ December: '十二月',
6371
+ login: '登錄',
6372
+ register: '登記',
6373
+ details: '細節',
6374
+ join: '加入',
6375
+ joinerror: '加入錦標賽時出錯,請重試'
6376
+ },
6377
+ fr: {
6378
+ enrolled: 'Inscrits',
6379
+ scoreCriteria: 'Critères de notation',
6380
+ minbet: 'nombre de paris minimum',
6381
+ seegames: 'Vous pouvez voir les jeux',
6382
+ here: 'ici',
6383
+ scheduled: 'Programmé',
6384
+ ongoing: 'En cours',
6385
+ finished: 'Fini',
6386
+ startingAt: 'À partir de:',
6387
+ startedAt: 'Commencé à:',
6388
+ mostRounds: 'Le plus grand nombre de tours',
6389
+ betCount: 'Nombre de paris',
6390
+ maxWinStakeRatio: 'Indice maximum du gain d\'une mise',
6391
+ winStakeRatio: 'Indice du gain d\'une mise',
6392
+ January: 'January',
6393
+ February: 'February',
6394
+ March: 'March',
6395
+ April: 'April',
6396
+ May: 'May',
6397
+ June: 'June',
6398
+ July: 'July',
6399
+ August: 'August',
6400
+ September: 'September',
6401
+ October: 'October',
6402
+ November: 'November',
6403
+ December: 'December',
6404
+ login: 'Connexion',
6405
+ register: 'Enregistre',
6406
+ details: 'Détails',
6407
+ join: 'Rejoignez',
6408
+ joinerror: 'Une erreur s\'est produite lors de l\'inscription au tournoi - '
6409
+ },
6410
+ ro: {
6411
+ enrolled: 'Înscris',
6412
+ scoreCriteria: 'Criterii de punctaj',
6413
+ minbet: 'număr minim de pariuri',
6414
+ seegames: 'Vezi jocurile',
6415
+ here: 'aici',
6416
+ scheduled: 'Programat',
6417
+ ongoing: 'În desfășurare',
6418
+ finished: 'Finalizat',
6419
+ startingAt: 'Începând de la',
6420
+ startedAt: 'A inceput la:',
6421
+ startingAtWithTime: 'Începând de',
6422
+ startedAtWithTime: 'A inceput:',
6423
+ mostRounds: 'Cele mai multe runde',
6424
+ betCount: 'Număr de pariuri',
6425
+ maxWinStakeRatio: 'Pondere maximă a mizei din câștig',
6426
+ winStakeRatio: 'Câștig Total per Miză',
6427
+ January: 'Ianuarie',
6428
+ February: 'Februarie',
6429
+ March: 'Martie',
6430
+ April: 'Aprilie',
6431
+ May: 'Mai',
6432
+ June: 'Iunie',
6433
+ July: 'Iulie',
6434
+ August: 'August',
6435
+ September: 'Septembrie',
6436
+ October: 'Octombrie',
6437
+ November: 'Noiembrie',
6438
+ December: 'Decembrie',
6439
+ login: 'Autentificare',
6440
+ register: 'Înregistrare',
6441
+ details: 'Detalii',
6442
+ join: 'Participă',
6443
+ joinerror: 'A apărut o eroare la înregistrarea în turneu, te rugăm să încerci din nou.'
6444
+ },
6445
+ tr: {
6446
+ enrolled: 'Katıldın',
6447
+ scoreCriteria: 'Skor kriteri',
6448
+ minbet: 'en düşük bahis sayısı',
6449
+ seegames: 'Turnuvadaki oyunları görmek için',
6450
+ here: 'tıklayın',
6451
+ scheduled: 'Planlanmış',
6452
+ ongoing: 'Devam Eden',
6453
+ finished: 'Sona Ermiş',
6454
+ startingAt: 'Başlangıç saati:',
6455
+ startedAt: 'Başlangıç saati:',
6456
+ mostRounds: 'ÇoğuRounds',
6457
+ betCount: 'Oynanan Tur Sayısı',
6458
+ maxWinStakeRatio: 'Maksimum Kazanç / Bahis Oranı',
6459
+ winStakeRatio: 'Kazanç / Bahis Oranı',
6460
+ January: 'Ocak',
6461
+ February: 'Şubat',
6462
+ March: 'Mart',
6463
+ April: 'Nisan',
6464
+ May: 'Mayıs',
6465
+ June: 'Haziran',
6466
+ July: 'Temmuz',
6467
+ August: 'Ağustos',
6468
+ September: 'Eylül',
6469
+ October: 'Ekim',
6470
+ November: 'Kasım',
6471
+ December: 'Aralık',
6472
+ login: 'Giriş',
6473
+ register: 'Kayıt Ol',
6474
+ details: 'Detaylar',
6475
+ join: 'Katıl',
6476
+ joinerror: 'Turnuvaya katılım ile ilgili bir hata oluştu - '
6477
+ },
6478
+ el: {
6479
+ enrolled: 'Εγγεγραμμένος',
6480
+ scoreCriteria: 'Κριτήρια Σκορ',
6481
+ minbet: 'Ελάχιστος αριθμός πονταρισμάτων',
6482
+ seegames: 'Μπορείς να δεις τα παιχνίδια',
6483
+ here: 'εδώ',
6484
+ all: 'Όλα',
6485
+ scheduled: 'Προγραμματισμένα',
6486
+ ongoing: 'Τρέχοντα',
6487
+ finished: 'Ολοκληρωμένα',
6488
+ startingAt: 'Αρχίζει στις:',
6489
+ startedAt: 'Άρχισε στις:',
6490
+ startingAtWithTime: `Αρχίζει στις `,
6491
+ startedAtWithTime: `Άρχισε στις `,
6492
+ mostRounds: 'Οι περισσότεροι γύροι',
6493
+ betCount: 'Οι περισσότεροι γύροι',
6494
+ maxWinStakeRatio: 'Μεγαλύτερο Κέρδος άνα Ποντάρισμα',
6495
+ winStakeRatio: 'Συνολική Αναλογία Κερδών άνα Ποντάρισμα',
6496
+ January: 'Ιανουαρίου',
6497
+ February: 'Φεβρουαρίου',
6498
+ March: 'Μαρτίου',
6499
+ April: 'Απριλίου',
6500
+ May: 'Μαΐου',
6501
+ June: 'Ιουνίου',
6502
+ July: 'Ιουλίου',
6503
+ August: 'Αυγούστου',
6504
+ September: 'Σεπτεμβρίου',
6505
+ October: 'Οκτωβρίου',
6506
+ November: 'Νοεμβρίου',
6507
+ December: 'Δεκεμβρίου',
6508
+ login: 'Είσοδος',
6509
+ register: 'Εγγραφή',
6510
+ details: 'Λεπτομέρειες',
6511
+ join: 'Συμμετοχή',
6512
+ joinerror: 'Παρουσιάστηκε σφάλμα κατά τη διαδικασία εγγραφής στο τουρνουά, παρακαλούμε δοκιμάστε ξανά.'
6513
+ },
6514
+ es: {
6515
+ enrolled: 'Inscrito',
6516
+ scoreCriteria: 'Criterios de puntuación',
6517
+ minbet: 'la apuesta mínima cuenta',
6518
+ seegames: 'Puedes ver los juegos',
6519
+ here: 'aquí',
6520
+ scheduled: 'Programado',
6521
+ ongoing: 'En marcha',
6522
+ finished: 'Terminado',
6523
+ startingAt: 'Desde',
6524
+ startedAt: 'Empezó el:',
6525
+ mostRounds: 'LaMayoríaDeLasRondas',
6526
+ betCount: 'Recuento De Apuestas',
6527
+ maxWinStakeRatio: 'Ratio De Ganancia Máxima',
6528
+ winStakeRatio: 'Ratio De Ganancia',
6529
+ January: 'de enero',
6530
+ February: 'de febrero',
6531
+ March: 'de marzo',
6532
+ April: 'de abril',
6533
+ May: 'de mayo',
6534
+ June: 'de junio',
6535
+ July: 'de julio',
6536
+ August: 'de agosto',
6537
+ September: 'de septiembre',
6538
+ October: 'de octubre',
6539
+ November: 'de noviembre',
6540
+ December: 'de diciembre',
6541
+ login: 'Iniciar sesión',
6542
+ register: 'Regístrate',
6543
+ details: 'Detalles',
6544
+ join: 'Unirse',
6545
+ joinerror: 'Ha ocurrido un error mientras se registra en el Torneo',
6546
+ },
6547
+ pt: {
6548
+ enrolled: 'Inscrito',
6549
+ scoreCriteria: 'Critérios de pontuação',
6550
+ minbet: 'Contagens de aposta mínima',
6551
+ seegames: 'Você pode ver os jogos',
6552
+ here: 'Aqui',
6553
+ scheduled: 'Agendado',
6554
+ ongoing: 'Em progresso',
6555
+ finished: 'Finalizado',
6556
+ startingAt: 'Começando às:',
6557
+ startedAt: 'Começou às:',
6558
+ mostRounds: 'Mais rodadas',
6559
+ betCount: 'Contagem de Apostas',
6560
+ maxWinStakeRatio: 'Rácio máximo de vitórias',
6561
+ winStakeRatio: 'Rácio de Vitórias',
6562
+ January: 'January',
6563
+ February: 'February',
6564
+ March: 'March',
6565
+ April: 'April',
6566
+ May: 'May',
6567
+ June: 'June',
6568
+ July: 'July',
6569
+ August: 'August',
6570
+ September: 'September',
6571
+ October: 'October',
6572
+ November: 'November',
6573
+ December: 'December',
6574
+ login: 'Entrar',
6575
+ register: 'Registro',
6576
+ details: 'Detalhes',
6577
+ join: 'Junte-se',
6578
+ joinerror: 'Ocorreu um erro ao entrar no torneio -'
6579
+ },
6580
+ hu: {
6581
+ enrolled: 'Feliratkozott',
6582
+ scoreCriteria: 'Pontozási kritériumok',
6583
+ minbet: 'Minimális tét',
6584
+ seegames: 'Játékok megnézése',
6585
+ here: 'itt',
6586
+ scheduled: 'Ütemezés',
6587
+ ongoing: 'Folyamatban lévő',
6588
+ finished: 'Befejezett',
6589
+ startingAt: 'Kezdődik',
6590
+ startedAt: 'Started at:',
6591
+ mostRounds: 'Legtöbb kör',
6592
+ betCount: 'Számított tét',
6593
+ maxWinStakeRatio: 'Maximális nyeremény tétenként',
6594
+ winStakeRatio: 'Összes nyeremény tétenként',
6595
+ January: 'January',
6596
+ February: 'February',
6597
+ March: 'March',
6598
+ April: 'April',
6599
+ May: 'May',
6600
+ June: 'June',
6601
+ July: 'July',
6602
+ August: 'August',
6603
+ September: 'September',
6604
+ October: 'October',
6605
+ November: 'November',
6606
+ December: 'December',
6607
+ login: 'Bejelentkezés',
6608
+ register: 'Regisztráció',
6609
+ details: 'Adatok',
6610
+ join: 'Csatlakozás',
6611
+ joinerror: 'Hiba történt a versenyre való regisztráció során, kérjük próbálja újra.',
6612
+ },
6613
+ hr: {
6614
+ joined: 'Pridružen',
6615
+ enrolled: 'Upisan',
6616
+ scoreCriteria: 'Kriteriji bodovanja',
6617
+ minbet: 'minimalni broj beta',
6618
+ seegames: 'Možete vidjeti igre',
6619
+ here: 'Ovdje',
6620
+ scheduled: 'Zakazano',
6621
+ ongoing: 'U tijeku',
6622
+ finished: 'Gotovo',
6623
+ startingAt: 'S početkom u',
6624
+ startedAt: 'Započelo u',
6625
+ startingAtWithTime: `Počinje `,
6626
+ startedAtWithTime: `Započelo `,
6627
+ mostRounds: 'Najviše rundi',
6628
+ betCount: 'Broj betova',
6629
+ maxWinStakeRatio: 'Maksimalni dobitak po ulogu',
6630
+ winStakeRatio: 'Ukupni dobitak po ulogu',
6631
+ January: 'Siječanj',
6632
+ February: 'Veljača',
6633
+ March: 'Ožujak',
6634
+ April: 'Travanj',
6635
+ May: 'Svibanj',
6636
+ June: 'Lipanj',
6637
+ July: 'Srpanj',
6638
+ August: 'Kolovoz',
6639
+ September: 'Rujan',
6640
+ October: 'Listopad',
6641
+ November: 'Studeni',
6642
+ December: 'Prosinac',
6643
+ login: 'Prijaviti se',
6644
+ register: 'Registracija',
6645
+ details: 'Detalji',
6646
+ join: 'join',
6647
+ joinerror: 'Došlo je do pogreške prilikom registracije na turnir, pokušajte ponovno.',
6648
+ left: 'lijevo',
6649
+ minutes: 'minute',
6650
+ hours: 'sati',
6651
+ days: 'dani',
6652
+ }
6653
+ };
6654
+ const translate = (key, customLang) => {
6655
+ var _a, _b;
6656
+ const lang = customLang;
6657
+ return ((_a = TRANSLATIONS[lang]) === null || _a === void 0 ? void 0 : _a[key]) || ((_b = TRANSLATIONS[DEFAULT_LANGUAGE]) === null || _b === void 0 ? void 0 : _b[key]);
6658
+ };
6659
+ const getTranslations = (data) => {
6660
+ Object.keys(data).forEach((item) => {
6661
+ for (let key in data[item]) {
6662
+ TRANSLATIONS[item][key] = data[item][key];
6663
+ }
6664
+ });
6665
+ };
6666
+
6667
+ const casinoTournamentButtonsCss = ":host{display:block}.ButtonGroup{display:flex;gap:4px}.Button{padding:6px 8px;border-radius:2px;border:1px solid #fff;color:#fff;background:none;position:relative;cursor:pointer}.Button.NoBorder{border:0;padding:7px 8px}.Button::after{content:\"\";display:block;position:absolute;border-radius:2px;left:0;top:0;width:100%;height:100%;opacity:0;transition:all 0.5s;box-shadow:0 0 10px 10px white}.Button:active::after{box-shadow:0 0 0 0 white;position:absolute;border-radius:2px;left:0;top:0;opacity:1;transition:0s}.Button:active{top:1px}";
6668
+
6669
+ const CasinoTournamentButtons = class {
6670
+ constructor(hostRef) {
6671
+ registerInstance(this, hostRef);
6672
+ this.userEnrolled = createEvent(this, "TournamentUserEnrolled", 7);
6673
+ /**
6674
+ * Player enrolled
6675
+ */
6676
+ this.enrolled = false;
6677
+ /**
6678
+ * Show read more button
6679
+ */
6680
+ this.showReadMore = false;
6681
+ /**
6682
+ * Client custom styling via inline styles
6683
+ */
6684
+ this.clientStyling = '';
6685
+ /**
6686
+ * Client custom styling via url
6687
+ */
6688
+ this.clientStylingUrl = '';
6689
+ this.limitStylingAppends = false;
6690
+ this.joinButtonLoading = false;
6691
+ this.errorJoin = false;
6692
+ this.errorJoinConcurrently = false;
6693
+ }
6694
+ componentWillLoad() {
6695
+ if (this.translationData) {
6696
+ getTranslations(JSON.parse(this.translationData));
6697
+ }
6698
+ }
6699
+ componentDidRender() {
6700
+ if (!this.limitStylingAppends && this.host) {
6701
+ if (this.clientStyling)
6702
+ this.setClientStyling();
6703
+ if (this.clientStylingUrl)
6704
+ this.setClientStylingURL();
6705
+ this.limitStylingAppends = true;
6706
+ }
6707
+ }
6708
+ setClientStyling() {
6709
+ const sheet = new CSSStyleSheet();
6710
+ // @ts-ignore
6711
+ sheet.replace(this.clientStyling);
6712
+ // @ts-ignore
6713
+ this.host.shadowRoot.adoptedStyleSheets = [...this.host.shadowRoot.adoptedStyleSheets, sheet];
6714
+ }
6715
+ setClientStylingURL() {
6716
+ let url = new URL(this.clientStylingUrl);
6717
+ fetch(url.href)
6718
+ .then((res) => res.text())
6719
+ .then((data) => {
6720
+ const sheet = new CSSStyleSheet();
6721
+ // @ts-ignore
6722
+ sheet.replace(data);
6723
+ // @ts-ignore
6724
+ this.host.shadowRoot.adoptedStyleSheets = [...this.host.shadowRoot.adoptedStyleSheets, sheet];
6725
+ });
6726
+ }
6727
+ loginAction() {
6728
+ if (this.loginEvent) {
6729
+ window.postMessage({ type: this.loginEvent, transition: 'Login' }, window.location.href);
6730
+ // @ts-ignore Analytics event
6731
+ if (typeof gtag == 'function') {
6732
+ // @ts-ignore
6733
+ gtag('event', 'OpenLoginModal', {
6734
+ 'context': 'TournamentsThumbnailController'
6735
+ });
6736
+ }
6737
+ }
6738
+ if (this.loginUrl) {
6739
+ location.href = this.loginUrl;
6740
+ }
6741
+ }
6742
+ registerAction() {
6743
+ if (this.registerEvent) {
6744
+ window.postMessage({ type: this.registerEvent, transition: 'Register' }, window.location.href);
6745
+ //@ts-ignoreAnalytics event
6746
+ if (typeof gtag == 'function') {
6747
+ //@ts-ignore
6748
+ gtag('event', 'OpenRegisterModal', {
6749
+ 'context': 'TournamentsThumbnailController'
6750
+ });
6751
+ }
6752
+ }
6753
+ if (this.registerUrl) {
6754
+ location.href = this.registerUrl;
6755
+ }
6756
+ }
6757
+ async joinAction(tournamentId, bonuscode) {
6758
+ var _a;
6759
+ this.errorJoin = false;
6760
+ this.errorJoinConcurrently = false;
6761
+ window.postMessage({ type: 'TournamentJoinRequest', tournamentId }, window.location.href);
6762
+ this.joinButtonLoading = true;
6763
+ let joinUrl = new URL(`${this.endpoint}/v1/bonus/claim`);
6764
+ let reqHeaders = new Headers();
6765
+ let body = {};
6766
+ joinUrl.searchParams.append('language', this.language);
6767
+ joinUrl.searchParams.append('platform', getDevice());
6768
+ reqHeaders.append('Content-Type', 'application/json');
6769
+ reqHeaders.append("X-SessionID", this.session);
6770
+ if (bonuscode) {
6771
+ body = {
6772
+ language: this.language,
6773
+ bonusCode: bonuscode,
6774
+ currency: this.currency
6775
+ };
6776
+ }
6777
+ let requestOptions = {
6778
+ method: 'PUT',
6779
+ headers: reqHeaders,
6780
+ body: JSON.stringify(body),
6781
+ };
6782
+ const handlerOnSuccess = () => {
6783
+ this.joinButtonLoading = false;
6784
+ this.enrolled = true;
6785
+ window.postMessage({ type: 'TournamentUserEnrolled', userenrolled: this.enrolled, tournamentId }, window.location.href);
6786
+ this.userEnrolled.emit({ userenrolled: this.enrolled, tournamentId });
6787
+ };
6788
+ const handlerOnFail = () => {
6789
+ this.joinButtonLoading = false;
6790
+ this.errorJoin = true;
6791
+ };
6792
+ const fetcher = async () => {
6793
+ let result;
6794
+ try {
6795
+ result = await fetch(`${this.endpoint}/v1/bonus/claim?${joinUrl.searchParams.toString()}`, requestOptions);
6796
+ result = await result.json();
6797
+ }
6798
+ catch (e) {
6799
+ handlerOnFail();
6800
+ }
6801
+ return result;
6802
+ };
6803
+ const data = await fetcher();
6804
+ if (!data)
6805
+ return;
6806
+ if (data.success == true) {
6807
+ handlerOnSuccess();
6808
+ }
6809
+ else {
6810
+ if (data.errorMessage.match("VersionMismatchException")) {
6811
+ let resultDoubleCheck;
6812
+ resultDoubleCheck = await fetch(`${this.endpoint}/v1/tournaments/${this.tournamentId}`, {
6813
+ headers: {
6814
+ 'X-SessionID': this.session
6815
+ }
6816
+ });
6817
+ resultDoubleCheck = await resultDoubleCheck.json();
6818
+ if ((_a = resultDoubleCheck === null || resultDoubleCheck === void 0 ? void 0 : resultDoubleCheck.item) === null || _a === void 0 ? void 0 : _a.playerEnrolled) {
6819
+ handlerOnSuccess();
6820
+ }
6821
+ else {
6822
+ handlerOnFail();
6823
+ this.errorJoinConcurrently = true;
6824
+ this.errorJoin = false;
6825
+ }
6826
+ }
6827
+ else {
6828
+ handlerOnFail();
6829
+ }
6830
+ }
6831
+ }
6832
+ detailAction(tournamentId) {
6833
+ window.postMessage({ type: 'TournamentDetailsClicked', tournamentId, showLeaderboard: true }, window.location.href);
6834
+ }
6835
+ moreAction(tournamentId) {
6836
+ window.postMessage({ type: 'TournamentReadMoreClicked', tournamentId }, window.location.href);
6837
+ }
6838
+ render() {
6839
+ return h("div", { class: "TournamentButtons" }, !this.session &&
6840
+ h("div", { class: "ButtonGroup" }, h("button", { class: "LoginButton Button", part: "LoginButton", onClick: () => this.loginAction() }, translate('login', this.language)), h("button", { class: "RegisterButton Button", part: "RegisterButton", onClick: () => this.registerAction() }, translate('register', this.language))), this.session &&
6841
+ h("div", null, !this.enrolled &&
6842
+ h("div", { class: "ButtonGroup" }, h("button", { class: "Button", onClick: () => this.joinAction(this.tournamentId, this.bonusCode) }, translate('join', this.language)), this.showReadMore && h("button", { class: "Button NoBorder", onClick: () => this.moreAction(this.tournamentId) }, translate('readmore', this.language))), this.enrolled &&
6843
+ h("div", { class: "ButtonGroup" }, h("button", { class: "Button", onClick: () => this.detailAction(this.tournamentId) }, translate('details', this.language)), this.showReadMore && h("button", { class: "Button NoBorder", onClick: () => this.moreAction(this.tournamentId) }, translate('readmore', this.language)))), (this.errorJoin || this.errorJoinConcurrently) &&
6844
+ h("span", { class: "ErrorText", part: "ErrorText" }, translate('joinerror', this.language)));
6845
+ }
6846
+ get host() { return getElement(this); }
6847
+ };
6848
+ CasinoTournamentButtons.style = casinoTournamentButtonsCss;
6849
+
6850
+ export { CasinoTournamentBanner as casino_tournament_banner, CasinoTournamentButtons as casino_tournament_buttons };