@everymatrix/lottery-game-page 0.1.26 → 0.1.27

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.
@@ -403,8 +403,8 @@ const LotteryGamePage = class {
403
403
  this.successVisible = true;
404
404
  }
405
405
  render() {
406
- const backgroundSrc = index.getAssetPath('./static/chrono_lottery_mobile.png');
407
- const backgroundDesktopSrc = index.getAssetPath('./static/chrono_desktop.png');
406
+ const backgroundSrc = index.getAssetPath('./assets/chrono_lottery_mobile.png');
407
+ const backgroundDesktopSrc = index.getAssetPath('./assets/chrono_desktop.png');
408
408
  if (this.hasErrors) {
409
409
  return (index.h("div", { class: "GamePage" }, index.h("div", { class: "Title" }, translate('error', this.language))));
410
410
  }
@@ -416,7 +416,7 @@ const LotteryGamePage = class {
416
416
  index.h("div", null, index.h("span", { class: "Button", onClick: () => this.showLoginModal() }, translate('orderSummarySubmit', this.language)), index.h("helper-modal", { "title-modal": "Success", visible: this.loginModalVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, index.h("p", { class: "SubmitModalSuccess" }, translate('modalLogin', this.language))))))), this.tabIndex == 1 &&
417
417
  index.h("div", null, index.h("h4", { class: "LastDrawResultsTitle" }, translate('lastDrawResultsTitle', this.language)), index.h("lottery-draw-results", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "draw-id": this.lastDrawId, "draw-mode": true, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }), index.h("lottery-draw-results-history", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })), index.h("helper-modal", { "title-modal": "Success", visible: this.successVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, index.h("p", { class: "SubmitModalSuccess" }, translate('modalSuccess', this.language))), index.h("helper-modal", { "title-modal": "Delete Ticket", visible: this.deleteVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, index.h("div", { class: "DeleteTicketModalWrapper" }, index.h("h3", { class: "DeleteTicketModalTitle" }, translate('deleteTicketModalTitle', this.language)), index.h("p", { class: "DeleteTicketModalText" }, translate('deleteTicketModalText', this.language)), index.h("div", { class: "DeleteTicketModalButtons" }, index.h("button", { class: "DeleteTicketModalCancel", onClick: () => this.modalCloseEvent() }, translate('deleteTicketModalCancel', this.language)), index.h("button", { class: "DeleteTicketModalConfirm", onClick: () => this.confirmDeleteTicketHandler(this.deleteEventData) }, translate('deleteTicketModalConfirm', this.language)))))));
418
418
  }
419
- static get assetsDirs() { return ["static"]; }
419
+ static get assetsDirs() { return ["assets"]; }
420
420
  get element() { return index.getElement(this); }
421
421
  static get watchers() { return {
422
422
  "sessionId": ["handleSessionIdValue"]
@@ -288,8 +288,8 @@ export class LotteryGamePage {
288
288
  this.successVisible = true;
289
289
  }
290
290
  render() {
291
- const backgroundSrc = getAssetPath('./static/chrono_lottery_mobile.png');
292
- const backgroundDesktopSrc = getAssetPath('./static/chrono_desktop.png');
291
+ const backgroundSrc = getAssetPath('./assets/chrono_lottery_mobile.png');
292
+ const backgroundDesktopSrc = getAssetPath('./assets/chrono_desktop.png');
293
293
  if (this.hasErrors) {
294
294
  return (h("div", { class: "GamePage" },
295
295
  h("div", { class: "Title" }, translate('error', this.language))));
@@ -381,7 +381,7 @@ export class LotteryGamePage {
381
381
  static get styleUrls() { return {
382
382
  "$": ["lottery-game-page.css"]
383
383
  }; }
384
- static get assetsDirs() { return ["static"]; }
384
+ static get assetsDirs() { return ["assets"]; }
385
385
  static get properties() { return {
386
386
  "endpoint": {
387
387
  "type": "string",
@@ -413,8 +413,8 @@ const LotteryGamePage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
413
413
  this.successVisible = true;
414
414
  }
415
415
  render() {
416
- const backgroundSrc = getAssetPath('./static/chrono_lottery_mobile.png');
417
- const backgroundDesktopSrc = getAssetPath('./static/chrono_desktop.png');
416
+ const backgroundSrc = getAssetPath('./assets/chrono_lottery_mobile.png');
417
+ const backgroundDesktopSrc = getAssetPath('./assets/chrono_desktop.png');
418
418
  if (this.hasErrors) {
419
419
  return (h("div", { class: "GamePage" }, h("div", { class: "Title" }, translate('error', this.language))));
420
420
  }
@@ -426,7 +426,7 @@ const LotteryGamePage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
426
426
  h("div", null, h("span", { class: "Button", onClick: () => this.showLoginModal() }, translate('orderSummarySubmit', this.language)), h("helper-modal", { "title-modal": "Success", visible: this.loginModalVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h("p", { class: "SubmitModalSuccess" }, translate('modalLogin', this.language))))))), this.tabIndex == 1 &&
427
427
  h("div", null, h("h4", { class: "LastDrawResultsTitle" }, translate('lastDrawResultsTitle', this.language)), h("lottery-draw-results", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "draw-id": this.lastDrawId, "draw-mode": true, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }), h("lottery-draw-results-history", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })), h("helper-modal", { "title-modal": "Success", visible: this.successVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h("p", { class: "SubmitModalSuccess" }, translate('modalSuccess', this.language))), h("helper-modal", { "title-modal": "Delete Ticket", visible: this.deleteVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h("div", { class: "DeleteTicketModalWrapper" }, h("h3", { class: "DeleteTicketModalTitle" }, translate('deleteTicketModalTitle', this.language)), h("p", { class: "DeleteTicketModalText" }, translate('deleteTicketModalText', this.language)), h("div", { class: "DeleteTicketModalButtons" }, h("button", { class: "DeleteTicketModalCancel", onClick: () => this.modalCloseEvent() }, translate('deleteTicketModalCancel', this.language)), h("button", { class: "DeleteTicketModalConfirm", onClick: () => this.confirmDeleteTicketHandler(this.deleteEventData) }, translate('deleteTicketModalConfirm', this.language)))))));
428
428
  }
429
- static get assetsDirs() { return ["static"]; }
429
+ static get assetsDirs() { return ["assets"]; }
430
430
  get element() { return this; }
431
431
  static get watchers() { return {
432
432
  "sessionId": ["handleSessionIdValue"]
@@ -399,8 +399,8 @@ const LotteryGamePage = class {
399
399
  this.successVisible = true;
400
400
  }
401
401
  render() {
402
- const backgroundSrc = getAssetPath('./static/chrono_lottery_mobile.png');
403
- const backgroundDesktopSrc = getAssetPath('./static/chrono_desktop.png');
402
+ const backgroundSrc = getAssetPath('./assets/chrono_lottery_mobile.png');
403
+ const backgroundDesktopSrc = getAssetPath('./assets/chrono_desktop.png');
404
404
  if (this.hasErrors) {
405
405
  return (h("div", { class: "GamePage" }, h("div", { class: "Title" }, translate('error', this.language))));
406
406
  }
@@ -412,7 +412,7 @@ const LotteryGamePage = class {
412
412
  h("div", null, h("span", { class: "Button", onClick: () => this.showLoginModal() }, translate('orderSummarySubmit', this.language)), h("helper-modal", { "title-modal": "Success", visible: this.loginModalVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h("p", { class: "SubmitModalSuccess" }, translate('modalLogin', this.language))))))), this.tabIndex == 1 &&
413
413
  h("div", null, h("h4", { class: "LastDrawResultsTitle" }, translate('lastDrawResultsTitle', this.language)), h("lottery-draw-results", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "draw-id": this.lastDrawId, "draw-mode": true, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }), h("lottery-draw-results-history", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent })), h("helper-modal", { "title-modal": "Success", visible: this.successVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h("p", { class: "SubmitModalSuccess" }, translate('modalSuccess', this.language))), h("helper-modal", { "title-modal": "Delete Ticket", visible: this.deleteVisible, "client-styling": this.clientStyling, "client-styling-url-content": this.clientStylingUrlContent }, h("div", { class: "DeleteTicketModalWrapper" }, h("h3", { class: "DeleteTicketModalTitle" }, translate('deleteTicketModalTitle', this.language)), h("p", { class: "DeleteTicketModalText" }, translate('deleteTicketModalText', this.language)), h("div", { class: "DeleteTicketModalButtons" }, h("button", { class: "DeleteTicketModalCancel", onClick: () => this.modalCloseEvent() }, translate('deleteTicketModalCancel', this.language)), h("button", { class: "DeleteTicketModalConfirm", onClick: () => this.confirmDeleteTicketHandler(this.deleteEventData) }, translate('deleteTicketModalConfirm', this.language)))))));
414
414
  }
415
- static get assetsDirs() { return ["static"]; }
415
+ static get assetsDirs() { return ["assets"]; }
416
416
  get element() { return getElement(this); }
417
417
  static get watchers() { return {
418
418
  "sessionId": ["handleSessionIdValue"]
@@ -1 +1 @@
1
- import{p as t,b as e}from"./p-e765c7d9.js";(()=>{const e=import.meta.url,i={};return""!==e&&(i.resourcesUrl=new URL(".",e).href),t(i)})().then((t=>e([["p-7d06371e",[[1,"lottery-game-page",{endpoint:[1],gameId:[1,"game-id"],playerId:[2,"player-id"],sessionId:[1,"session-id"],language:[1],autoPick:[4,"auto-pick"],resetButton:[4,"reset-button"],clientStyling:[1,"client-styling"],clientStylingurl:[1,"client-stylingurl"],clientStylingUrlContent:[32],tickets:[32],tabIndex:[32],hasErrors:[32],totalAmount:[32],successVisible:[32],deleteVisible:[32],deleteEventData:[32],daysRemaining:[32],hoursRemaining:[32],minutesRemaining:[32],secondsRemaining:[32],latestDraw:[32],totalWinningsAmount:[32],nextDate:[32],isLoggedIn:[32],loginModalVisible:[32],limitStylingAppends:[32]},[[0,"ticketCompleted","gridFilledHandler"],[0,"gridDirty","gridDirtyHandler"],[0,"deleteTicket","deleteTicketHandler"],[0,"modalCloseEvent","modalCloseEvent"],[0,"stakeChange","stakeChangeHandler"],[0,"multiplierChange","multiplierChangeHandler"]]]]],["p-4f81cd37",[[1,"helper-pagination",{firstPage:[1540,"first-page"],previousPage:[1540,"previous-page"],offset:[1538],limit:[1538],total:[1538],language:[1],clientStyling:[1,"client-styling"],clientStylingUrlContent:[1,"client-styling-url-content"],offsetInt:[32],lastPage:[32],limitInt:[32],totalInt:[32],pagesArray:[32],endInt:[32],limitStylingAppends:[32]}]]],["p-d6f76e8d",[[1,"lottery-grid",{ticketId:[2,"ticket-id"],totalNumbers:[2,"total-numbers"],gameId:[1,"game-id"],maximumAllowed:[2,"maximum-allowed"],minimumAllowed:[2,"minimum-allowed"],selectable:[4],selectedNumbers:[1,"selected-numbers"],displaySelected:[4,"display-selected"],language:[1],gridIndex:[2,"grid-index"],gridType:[1,"grid-type"],clientStyling:[1,"client-styling"],clientStylingUrlContent:[1,"client-styling-url-content"],numbers:[32],limitStylingAppends:[32]},[[0,"lotteryBulletSelection","lotteryBulletSelectionHandler"],[4,"resetSelection","resetSelectionHandler"],[4,"autoSelection","autoSelectionHandler"]]],[1,"lottery-bullet",{value:[1],selectable:[4],isSelected:[4,"is-selected"],clientStyling:[1,"client-styling"],clientStylingUrlContent:[1,"client-styling-url-content"],limitStylingAppends:[32]}]]],["p-ca8430a0",[[1,"lottery-draw-results",{endpoint:[1],gameId:[1,"game-id"],language:[1],playerId:[1,"player-id"],drawMode:[4,"draw-mode"],drawId:[1,"draw-id"],gameName:[1,"game-name"],ticketDate:[1,"ticket-date"],ticketStatus:[1,"ticket-status"],ticketId:[1,"ticket-id"],ticketAmount:[1,"ticket-amount"],ticketMultiplier:[4,"ticket-multiplier"],ticketDrawCount:[2,"ticket-draw-count"],ticketNumbers:[1,"ticket-numbers"],sessionId:[1,"session-id"],clientStyling:[1,"client-styling"],clientStylingUrlContent:[1,"client-styling-url-content"],multiplier:[32],isLoading:[32],rules:[32],toggleDrawer:[32],hasErrors:[32],errorText:[32],ticketData:[32],ticketDataLoaded:[32],ticketDraws:[32],hasDrawNumbers:[32],limitStylingAppends:[32]}],[1,"helper-filters",{showFilterId:[4,"show-filter-id"],activateTicketSearch:[4,"activate-ticket-search"],gameId:[1,"game-id"],playerId:[1,"player-id"],session:[1],postMessage:[4,"post-message"],language:[1],quickFiltersActive:[4,"quick-filters-active"],clientStyling:[1,"client-styling"],clientStylingUrlContent:[1,"client-styling-url-content"],showFilterModal:[32],showClearButton:[32],filterData:[32],filterDataReset:[32],limitStylingAppends:[32]},[[0,"modalCloseEvent","modalCloseEvent"]]]]],["p-256b151c",[[1,"lottery-draw-results-history",{endpoint:[1],gameId:[1,"game-id"],numberOfResults:[2,"number-of-results"],language:[1],clientStyling:[1,"client-styling"],clientStylingUrlContent:[1,"client-styling-url-content"],drawData:[32],displayAllDrawsResults:[32],showQuickFilters:[32],winningDataSetsData:[32],dateFiltersFrom:[32],dateFiltersTo:[32],isLoading:[32],noResults:[32],limitStylingAppends:[32]},[[0,"filterSelection","filtersHandler"],[0,"filterSelectionReset","clearFiltersHandler"]]]]],["p-5c389034",[[1,"lottery-ticket",{endpoint:[1],gameId:[1,"game-id"],numberOfGrids:[2,"number-of-grids"],multipleDraws:[4,"multiple-draws"],ticketId:[2,"ticket-id"],resetButton:[4,"reset-button"],autoPick:[4,"auto-pick"],language:[1],clientStyling:[1,"client-styling"],clientStylingUrlContent:[1,"client-styling-url-content"],multiplier:[32],numberOfDraws:[32],isLoading:[32],hasErrors:[32],ticketDone:[32],isCustomSelect:[32],amountInfo:[32],limitStylingAppends:[32]},[[8,"click","checkForClickOutside"],[0,"gridFilled","gridFilledHandler"]]]]],["p-381b5507",[[1,"lottery-ticket-controller",{endpoint:[1],ticketId:[2,"ticket-id"],ticketDescription:[1,"ticket-description"],gameId:[1,"game-id"],postMessage:[4,"post-message"],eventName:[1,"event-name"],collapsed:[4],numberOfGrids:[2,"number-of-grids"],last:[4],language:[1],autoPick:[4,"auto-pick"],resetButton:[4,"reset-button"],clientStyling:[1,"client-styling"],clientStylingUrlContent:[1,"client-styling-url-content"],limitStylingAppends:[32]},[[0,"helperAccordionAction","helperAccordionActionHandler"]]]]],["p-f6fcc22c",[[1,"helper-tabs",{disabled:[4],label:[1],selected:[4],cmsEndpoint:[1,"cms-endpoint"],selectedIndex:[1538,"selected-index"],tabs:[16],clientStyling:[1,"client-styling"],clientStylingurl:[1,"client-stylingurl"],clientStylingUrlContent:[1,"client-styling-url-content"],limitStylingAppends:[32]}]]],["p-4274053c",[[1,"helper-accordion",{ticketHistoryFlag:[4,"ticket-history-flag"],headerTitle:[1,"header-title"],headerSubtitle:[1,"header-subtitle"],description:[1],footer:[4],deleteTab:[4,"delete-tab"],postMessage:[4,"post-message"],eventName:[1,"event-name"],collapsed:[4],language:[1],clientStyling:[1,"client-styling"],clientStylingUrlContent:[1,"client-styling-url-content"],showContent:[32],limitStylingAppends:[32]}]]],["p-3f8b6ad9",[[1,"helper-tab",{selectedIndex:[2,"selected-index"],cmsEndpoint:[1,"cms-endpoint"],clientStyling:[1,"client-styling"],clientStylingUrlContent:[1,"client-styling-url-content"],tabContent:[32],limitStylingAppends:[32]}]]],["p-04fbc8fd",[[1,"lottery-game-details",{clientStyling:[1,"client-styling"],clientStylingUrlContent:[1,"client-styling-url-content"],limitStylingAppends:[32]}]]],["p-023325a2",[[1,"helper-modal",{titleModal:[1,"title-modal"],visible:[1540],clientStyling:[1,"client-styling"],clientStylingUrlContent:[1,"client-styling-url-content"],limitStylingAppends:[32]}]]]],t)));
1
+ import{p as t,b as e}from"./p-e765c7d9.js";(()=>{const e=import.meta.url,i={};return""!==e&&(i.resourcesUrl=new URL(".",e).href),t(i)})().then((t=>e([["p-ea251208",[[1,"lottery-game-page",{endpoint:[1],gameId:[1,"game-id"],playerId:[2,"player-id"],sessionId:[1,"session-id"],language:[1],autoPick:[4,"auto-pick"],resetButton:[4,"reset-button"],clientStyling:[1,"client-styling"],clientStylingurl:[1,"client-stylingurl"],clientStylingUrlContent:[32],tickets:[32],tabIndex:[32],hasErrors:[32],totalAmount:[32],successVisible:[32],deleteVisible:[32],deleteEventData:[32],daysRemaining:[32],hoursRemaining:[32],minutesRemaining:[32],secondsRemaining:[32],latestDraw:[32],totalWinningsAmount:[32],nextDate:[32],isLoggedIn:[32],loginModalVisible:[32],limitStylingAppends:[32]},[[0,"ticketCompleted","gridFilledHandler"],[0,"gridDirty","gridDirtyHandler"],[0,"deleteTicket","deleteTicketHandler"],[0,"modalCloseEvent","modalCloseEvent"],[0,"stakeChange","stakeChangeHandler"],[0,"multiplierChange","multiplierChangeHandler"]]]]],["p-4f81cd37",[[1,"helper-pagination",{firstPage:[1540,"first-page"],previousPage:[1540,"previous-page"],offset:[1538],limit:[1538],total:[1538],language:[1],clientStyling:[1,"client-styling"],clientStylingUrlContent:[1,"client-styling-url-content"],offsetInt:[32],lastPage:[32],limitInt:[32],totalInt:[32],pagesArray:[32],endInt:[32],limitStylingAppends:[32]}]]],["p-d6f76e8d",[[1,"lottery-grid",{ticketId:[2,"ticket-id"],totalNumbers:[2,"total-numbers"],gameId:[1,"game-id"],maximumAllowed:[2,"maximum-allowed"],minimumAllowed:[2,"minimum-allowed"],selectable:[4],selectedNumbers:[1,"selected-numbers"],displaySelected:[4,"display-selected"],language:[1],gridIndex:[2,"grid-index"],gridType:[1,"grid-type"],clientStyling:[1,"client-styling"],clientStylingUrlContent:[1,"client-styling-url-content"],numbers:[32],limitStylingAppends:[32]},[[0,"lotteryBulletSelection","lotteryBulletSelectionHandler"],[4,"resetSelection","resetSelectionHandler"],[4,"autoSelection","autoSelectionHandler"]]],[1,"lottery-bullet",{value:[1],selectable:[4],isSelected:[4,"is-selected"],clientStyling:[1,"client-styling"],clientStylingUrlContent:[1,"client-styling-url-content"],limitStylingAppends:[32]}]]],["p-ca8430a0",[[1,"lottery-draw-results",{endpoint:[1],gameId:[1,"game-id"],language:[1],playerId:[1,"player-id"],drawMode:[4,"draw-mode"],drawId:[1,"draw-id"],gameName:[1,"game-name"],ticketDate:[1,"ticket-date"],ticketStatus:[1,"ticket-status"],ticketId:[1,"ticket-id"],ticketAmount:[1,"ticket-amount"],ticketMultiplier:[4,"ticket-multiplier"],ticketDrawCount:[2,"ticket-draw-count"],ticketNumbers:[1,"ticket-numbers"],sessionId:[1,"session-id"],clientStyling:[1,"client-styling"],clientStylingUrlContent:[1,"client-styling-url-content"],multiplier:[32],isLoading:[32],rules:[32],toggleDrawer:[32],hasErrors:[32],errorText:[32],ticketData:[32],ticketDataLoaded:[32],ticketDraws:[32],hasDrawNumbers:[32],limitStylingAppends:[32]}],[1,"helper-filters",{showFilterId:[4,"show-filter-id"],activateTicketSearch:[4,"activate-ticket-search"],gameId:[1,"game-id"],playerId:[1,"player-id"],session:[1],postMessage:[4,"post-message"],language:[1],quickFiltersActive:[4,"quick-filters-active"],clientStyling:[1,"client-styling"],clientStylingUrlContent:[1,"client-styling-url-content"],showFilterModal:[32],showClearButton:[32],filterData:[32],filterDataReset:[32],limitStylingAppends:[32]},[[0,"modalCloseEvent","modalCloseEvent"]]]]],["p-256b151c",[[1,"lottery-draw-results-history",{endpoint:[1],gameId:[1,"game-id"],numberOfResults:[2,"number-of-results"],language:[1],clientStyling:[1,"client-styling"],clientStylingUrlContent:[1,"client-styling-url-content"],drawData:[32],displayAllDrawsResults:[32],showQuickFilters:[32],winningDataSetsData:[32],dateFiltersFrom:[32],dateFiltersTo:[32],isLoading:[32],noResults:[32],limitStylingAppends:[32]},[[0,"filterSelection","filtersHandler"],[0,"filterSelectionReset","clearFiltersHandler"]]]]],["p-5c389034",[[1,"lottery-ticket",{endpoint:[1],gameId:[1,"game-id"],numberOfGrids:[2,"number-of-grids"],multipleDraws:[4,"multiple-draws"],ticketId:[2,"ticket-id"],resetButton:[4,"reset-button"],autoPick:[4,"auto-pick"],language:[1],clientStyling:[1,"client-styling"],clientStylingUrlContent:[1,"client-styling-url-content"],multiplier:[32],numberOfDraws:[32],isLoading:[32],hasErrors:[32],ticketDone:[32],isCustomSelect:[32],amountInfo:[32],limitStylingAppends:[32]},[[8,"click","checkForClickOutside"],[0,"gridFilled","gridFilledHandler"]]]]],["p-381b5507",[[1,"lottery-ticket-controller",{endpoint:[1],ticketId:[2,"ticket-id"],ticketDescription:[1,"ticket-description"],gameId:[1,"game-id"],postMessage:[4,"post-message"],eventName:[1,"event-name"],collapsed:[4],numberOfGrids:[2,"number-of-grids"],last:[4],language:[1],autoPick:[4,"auto-pick"],resetButton:[4,"reset-button"],clientStyling:[1,"client-styling"],clientStylingUrlContent:[1,"client-styling-url-content"],limitStylingAppends:[32]},[[0,"helperAccordionAction","helperAccordionActionHandler"]]]]],["p-f6fcc22c",[[1,"helper-tabs",{disabled:[4],label:[1],selected:[4],cmsEndpoint:[1,"cms-endpoint"],selectedIndex:[1538,"selected-index"],tabs:[16],clientStyling:[1,"client-styling"],clientStylingurl:[1,"client-stylingurl"],clientStylingUrlContent:[1,"client-styling-url-content"],limitStylingAppends:[32]}]]],["p-4274053c",[[1,"helper-accordion",{ticketHistoryFlag:[4,"ticket-history-flag"],headerTitle:[1,"header-title"],headerSubtitle:[1,"header-subtitle"],description:[1],footer:[4],deleteTab:[4,"delete-tab"],postMessage:[4,"post-message"],eventName:[1,"event-name"],collapsed:[4],language:[1],clientStyling:[1,"client-styling"],clientStylingUrlContent:[1,"client-styling-url-content"],showContent:[32],limitStylingAppends:[32]}]]],["p-3f8b6ad9",[[1,"helper-tab",{selectedIndex:[2,"selected-index"],cmsEndpoint:[1,"cms-endpoint"],clientStyling:[1,"client-styling"],clientStylingUrlContent:[1,"client-styling-url-content"],tabContent:[32],limitStylingAppends:[32]}]]],["p-04fbc8fd",[[1,"lottery-game-details",{clientStyling:[1,"client-styling"],clientStylingUrlContent:[1,"client-styling-url-content"],limitStylingAppends:[32]}]]],["p-023325a2",[[1,"helper-modal",{titleModal:[1,"title-modal"],visible:[1540],clientStyling:[1,"client-styling"],clientStylingUrlContent:[1,"client-styling-url-content"],limitStylingAppends:[32]}]]]],t)));
@@ -1 +1 @@
1
- import{r as t,g as e,h as i,a}from"./p-e765c7d9.js";const r=["ro","en","fr","ar"],s={en:{error:"Error",title:"Chrono",backButton:"Back",lobbyButton:"Lobby",prize:"Prize",winUpTo:"Win up to",nextDraw:"Next draw in: ",buy:"Buy tickets",viewLatest:"View latest results",createTicket:"Create Ticket",modalSuccess:"Purchase successfully completed!",deleteTicketModalTitle:"Delete Ticket",deleteTicketModalText:"Are you sure you want to delete this ticket?",deleteTicketModalCancel:"Cancel",deleteTicketModalConfirm:"Delete",orderSummaryTitle:"Order Summary",orderSummaryTickets:"Ticket",orderSummaryTotal:"Total",orderSummarySubmit:"Submit",lastDrawResultsTitle:"Last Draw Results",modalLogin:"Please login to submit a ticket"},ro:{error:"Eroare",title:"Loto 6/49",backButton:"Inapoi",lobbyButton:"Lobby",prize:"MARELE JACKPOT OMG",winUpTo:"Castiga pana la",nextDraw:"Urmatoarea extragere:",buy:"Cumpara bilet",viewLatest:"Ultimile extrageri",createTicket:"Creeaza bilet",modalSuccess:"Achizitie efectuata cu succes",deleteTicketModalTitle:"Sterge biletul",deleteTicketModalText:"Esti sigur ca vrei sa stergi acest bilet?",deleteTicketModalCancel:"Anuleaza",deleteTicketModalConfirm:"Sterge",orderSummaryTitle:"Rezumat comanda",orderSummaryTickets:"Bilet",orderSummaryTotal:"Total",orderSummarySubmit:"Trimite",lastDrawResultsTitle:"Cele mai recente extrageri",modalLogin:"Please login to submit a ticket"},fr:{error:"Error",title:"Chrono",backButton:"Back",lobbyButton:"Lobby",prize:"Prize",winUpTo:"Win up to",nextDraw:"Next draw in: ",buy:"Buy tickets",viewLatest:"View latest results",createTicket:"Create Ticket",modalSuccess:"Purchase successfully completed!",deleteTicketModalTitle:"Delete Ticket",deleteTicketModalText:"Are you sure you want to delete this ticket?",deleteTicketModalCancel:"Cancel",deleteTicketModalConfirm:"Delete",orderSummaryTitle:"Order Summary",orderSummaryTickets:"Ticket",orderSummaryTotal:"Total",orderSummarySubmit:"Submit",lastDrawResultsTitle:"Résultats du dernier tirage",modalLogin:"Please login to submit a ticket"},ar:{error:"خطأ",title:"كرونو",backButton:"خلف",lobbyButton:"ردهة",prize:"جائزة",winUpTo:"الفوز بما يصل الى",nextDraw:"السحب التالي:",buy:"اشتري تذاكر",viewLatest:"عرض أحدث النتائج",createTicket:"إنشاء تذكرة",modalSuccess:"!سيتم الشراء بنجاح قريبًا",deleteTicketModalTitle:"حذف التذكرة",deleteTicketModalText:"هل أنت متأكد أنك تريد حذف هذه التذكرة؟",deleteTicketModalCancel:"يلغي",deleteTicketModalConfirm:"حذف",orderSummaryTitle:"ملخص الطلب",orderSummaryTickets:"تذكرة",orderSummaryTotal:"المجموع",orderSummarySubmit:"يُقدِّم",lastDrawResultsTitle:"نتائج آخر سحب",modalLogin:"الرجاء تسجيل الدخول لتقديم تذكرة"}},n=(t,e)=>{const i=e;return s[void 0!==i&&r.includes(i)?i:"en"][t]},o=class{constructor(e){t(this,e),this.language="en",this.autoPick=!1,this.resetButton=!1,this.clientStyling="",this.clientStylingurl="",this.clientStylingUrlContent="",this.tickets=[],this.tabIndex=0,this.hasErrors=!1,this.totalAmount=0,this.successVisible=!1,this.deleteVisible=!1,this.latestDraw={},this.totalWinningsAmount=0,this.isLoggedIn=!1,this.loginModalVisible=!1,this.limitStylingAppends=!1,this.userAgent=window.navigator.userAgent,this.multiplier=!1,this.quickPick=!1,this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingurl),e=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{this.clientStylingUrlContent=t,e.innerHTML=t,setTimeout((()=>{this.stylingContainer.prepend(e)}),1)})).catch((t=>{console.log("error ",t)}))}}handleSessionIdValue(){this.isLoggedIn=!0}connectedCallback(){this.getGameDetails(),this.getDraws(),this.sessionId&&(this.isLoggedIn=!0)}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingurl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}countdownLogic(t){t&&(this.interval=setInterval((()=>{this.daysRemaining=Math.floor((Date.parse(t)-(new Date).getTime())/864e5),this.hoursRemaining=Math.floor((Date.parse(t)-(new Date).getTime())/36e5-24*this.daysRemaining),this.minutesRemaining=Math.floor((Date.parse(t)-(new Date).getTime())/6e4-24*this.daysRemaining*60-60*this.hoursRemaining),this.secondsRemaining=Math.floor((Date.parse(t)-(new Date).getTime())/1e3-24*this.daysRemaining*60*60-60*this.hoursRemaining*60-60*this.minutesRemaining)}),1e3))}disconnectedCallback(){clearInterval(this.interval)}getGameDetails(){let t=new URL(`${this.endpoint}/games/${this.gameId}`);fetch(t.href).then((t=>{if(t.status>=300)throw this.hasErrors=!0,new Error("There was an error while fetching the data");return t.json()})).then((t=>{this.gameData=t,this.basicStake=this.gameData.rules.stakes[0].amount;let e=this.gameData.draws.filter((t=>!t.winningNumbers));this.nextDraw=e[0].id,this.createNewTicket()})).catch((t=>{this.hasErrors=!0,console.log("Error",t)}))}calculateTotalAmount(){const{currency:t}=this.gameData.rules.stakes[0];this.totalAmount=0,this.tickets.forEach((t=>{t.completed&&(this.totalAmount+=t.amount*t.stake)})),this.currency=t}gridFilledHandler(t){this.tickets=this.tickets.map((e=>{if(e.ticketId==t.detail.id){let i=e.selectedNumbers||[];return i[t.detail.index]=t.detail.selectedNumbers.map((t=>parseInt(t,10))),{gameId:e.gameId,ticketId:e.ticketId,completed:!0,amount:t.detail.draws,stake:e.stake,selectedNumbers:i}}return e})),this.calculateTotalAmount()}gridDirtyHandler(t){this.tickets=this.tickets.map((e=>e.gameId==t.detail.id?{gameId:e.gameId,ticketId:e.ticketId,completed:!1,amount:e.amount,stake:e.stake,grids:[]}:e))}deleteTicketHandler(t){this.deleteVisible=!0,this.deleteEventData=t}modalCloseEvent(){this.deleteVisible=!1,this.loginModalVisible=!1}stakeChangeHandler(t){const{ticketId:e,stake:i}=t.detail;this.tickets[e-1].stake=i,this.calculateTotalAmount()}multiplierChangeHandler(t){this.multiplier=t.detail}getDraws(){let t=new URL(`${this.endpoint}/games/${this.gameId}/draws`);fetch(t.href,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}}).then((t=>t.json())).then((t=>{var e,i;let a=t.items.filter((t=>{if(Date.parse(t.date)>(new Date).getTime())return!t.winningNumbers})),r=t.items.filter((t=>t.winningNumbers));this.latestDraw=a[0]||{},this.nextDate=null===(e=this.latestDraw)||void 0===e?void 0:e.date,this.countdownLogic(this.nextDate||""),this.lastDrawId=r[r.length-1].id,null===(i=this.latestDraw)||void 0===i||i.prizes.forEach((t=>{this.totalWinningsAmount+=JSON.parse(t.amount)}))})).catch((t=>{console.log("error ",t)}))}confirmDeleteTicketHandler(t){this.tickets=this.tickets.filter((e=>e.ticketId!=t.detail.ticketId)),this.calculateTotalAmount(),this.deleteVisible=!1}createNewTicket(){this.tickets=[...this.tickets,{gameId:this.gameId,ticketId:this.tickets.length+1,completed:!1,amount:1,stake:this.basicStake,grids:[]}]}showLoginModal(){this.loginModalVisible=!0}submitTickets(){let t=new URL(`${this.endpoint}/tickets`),e={gameId:this.gameId,tickets:[]};this.tickets.forEach((t=>{e.tickets.push({startingDrawId:this.nextDraw,amount:t.stake,gameId:this.gameId,currency:this.currency,selection:t.selectedNumbers,multiplier:this.multiplier,drawCount:t.amount,quickPick:this.quickPick})}));let i={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this.sessionId}`},body:JSON.stringify(e)};fetch(t.href,i).then((t=>{if(t.status>300)throw new Error("err");return t.json()})).then((t=>{console.log("data",t)})).catch((t=>{console.log("error ",t)})),this.successVisible=!0}render(){const t=e("./static/chrono_lottery_mobile.png"),a=e("./static/chrono_desktop.png");return this.hasErrors?i("div",{class:"GamePage"},i("div",{class:"Title"},n("error",this.language))):i("div",{class:"GamePage",dir:"ar"==this.language?"rtl":"ltr",ref:t=>this.stylingContainer=t},i("div",{class:"GridBanner",style:{backgroundImage:(r=this.userAgent,r.toLowerCase().match(/android/i)||r.toLowerCase().match(/blackberry|bb/i)||r.toLowerCase().match(/iphone|ipad|ipod/i)||r.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)?`url(${t})`:`url(${a})`)}},i("div",{class:"BannerButtonsWrapper"},i("button",{class:"BannerBackButton"},i("span",{class:"BannerBackButtonArrow"},"ᐸ "),n("backButton",this.language)),i("button",{class:"BannerLobbyButton"},n("lobbyButton",this.language))),i("div",{class:"Tabs"},i("div",{class:"TabButton"+(0==this.tabIndex?" Active":""),onClick:()=>this.tabIndex=0},n("buy",this.language)),i("div",{class:"TabButton"+(1==this.tabIndex?" Active":""),onClick:()=>this.tabIndex=1},n("viewLatest",this.language)))),i("div",{class:"NextDrawWrapper"},i("div",{class:"TotalWinnings"},n("winUpTo",this.language),": ",i("span",null,"$",this.totalWinningsAmount.toLocaleString("en-US",{maximumFractionDigits:2}))),i("div",{class:"NextDraw"},i("p",{class:"BannerText"},n("nextDraw",this.language)),i("div",{class:"BannerCountdown"},i("span",{class:"CountdownDays"},this.daysRemaining,"D"),i("span",{class:"CountdownHours"},this.hoursRemaining,"H"),i("span",{class:"CountdownMinutes"},this.minutesRemaining,"M"),i("span",{class:"CountdownSeconds"},this.secondsRemaining,"S")))),0==this.tabIndex&&i("div",{class:"GamePageContent"},i("div",{class:"GameDetails"},i("lottery-game-details",{"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent})),i("div",{class:"TicketsWrapper"},this.tickets.map((t=>i("lottery-ticket-controller",{endpoint:this.endpoint,"ticket-id":t.ticketId,"game-id":t.gameId,collapsed:!1,last:!0,language:this.language,"auto-pick":this.autoPick,"reset-button":this.resetButton,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent}))),i("div",{class:"CreateNewTicket"},i("button",{onClick:()=>this.createNewTicket()},"+"),i("span",null,n("createTicket",this.language)))),i("div",{class:"OrderSummary"},i("h3",{class:"OrderSummaryTitle"},n("orderSummaryTitle",this.language)),i("div",{class:"Ticket"},n("orderSummaryTickets",this.language),": ",i("span",null,this.tickets.length)),i("div",{class:"Total"},n("orderSummaryTotal",this.language),": ",i("span",null,this.totalAmount," ",this.currency)),i("div",{class:"ButtonWrapper"},this.isLoggedIn&&i("span",{class:"Button",onClick:()=>this.submitTickets()},n("orderSummarySubmit",this.language)),!this.isLoggedIn&&i("div",null,i("span",{class:"Button",onClick:()=>this.showLoginModal()},n("orderSummarySubmit",this.language)),i("helper-modal",{"title-modal":"Success",visible:this.loginModalVisible,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent},i("p",{class:"SubmitModalSuccess"},n("modalLogin",this.language))))))),1==this.tabIndex&&i("div",null,i("h4",{class:"LastDrawResultsTitle"},n("lastDrawResultsTitle",this.language)),i("lottery-draw-results",{endpoint:this.endpoint,"game-id":this.gameId,language:this.language,"draw-id":this.lastDrawId,"draw-mode":!0,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent}),i("lottery-draw-results-history",{endpoint:this.endpoint,"game-id":this.gameId,language:this.language,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent})),i("helper-modal",{"title-modal":"Success",visible:this.successVisible,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent},i("p",{class:"SubmitModalSuccess"},n("modalSuccess",this.language))),i("helper-modal",{"title-modal":"Delete Ticket",visible:this.deleteVisible,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent},i("div",{class:"DeleteTicketModalWrapper"},i("h3",{class:"DeleteTicketModalTitle"},n("deleteTicketModalTitle",this.language)),i("p",{class:"DeleteTicketModalText"},n("deleteTicketModalText",this.language)),i("div",{class:"DeleteTicketModalButtons"},i("button",{class:"DeleteTicketModalCancel",onClick:()=>this.modalCloseEvent()},n("deleteTicketModalCancel",this.language)),i("button",{class:"DeleteTicketModalConfirm",onClick:()=>this.confirmDeleteTicketHandler(this.deleteEventData)},n("deleteTicketModalConfirm",this.language))))));var r}static get assetsDirs(){return["static"]}get element(){return a(this)}static get watchers(){return{sessionId:["handleSessionIdValue"]}}};o.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.GamePage .GridBanner{background-color:#009993;background-repeat:no-repeat;background-position:center;color:#111;padding:0 20px 10px;height:220px;display:flex;flex-direction:column;justify-content:space-between}.GamePage .GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GamePage .GridBanner .BannerButtonsWrapper .BannerBackButton,.GamePage .GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:#fff;border:1px solid #D4D4D4;border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px}.GamePage .GridBanner .GridBannerArea{padding-top:30px;display:flex;flex-direction:column;align-items:center}.GamePage .TotalWinnings{color:#000;font-size:18px;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:10px;text-transform:uppercase}.GamePage .TotalWinnings span{font-size:18px;font-weight:700}.GamePage .NextDraw{color:#00958f;font-size:24px;font-weight:600;margin:0 auto;text-align:center;text-transform:uppercase;display:flex;justify-content:center;align-items:center;flex-direction:column}.GamePage .NextDraw .BannerText{font-weight:400;font-size:18px;text-transform:uppercase;padding:0;margin:15px 0 0 0}.GamePage .NextDraw .BannerCountdown{font-size:22px;color:#00958f;display:flex;gap:20px}.GamePage .Tabs{display:flex;justify-content:center;gap:10px}.GamePage .Tabs .TabButton{border-radius:4px;cursor:pointer;padding:8px 0;width:50%;max-width:200px;border:1px solid #00958f;background:#00958f;color:#fff;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.GamePage .Tabs .TabButton.Active{color:#00958f;background:#F1F1F1;border:1px solid #F1F1F1}.LastDrawResultsTitle{color:#009993;padding:25px 0 10px 0;text-align:center;border-radius:4px;text-transform:uppercase;font-size:16px;font-weight:600;margin:0}.NextDrawWrapper{padding:10px 15px;background:#F1F1F1;background:linear-gradient(0deg, #f1f1f1 0%, rgba(253, 187, 45, 0) 100%)}.NextDrawWrapper .BannerText{font-size:16px;font-weight:700;text-align:center}.NextDrawWrapper .BannerCountdown{font-size:22px;display:flex;gap:8px;color:#009993;font-weight:bolder;justify-content:center}.GamePageContent{padding:15px;max-width:1200px;margin:0 auto}.GameDetails{padding-bottom:10px;margin-bottom:20px}.CreateNewTicket{background:#004D4A;height:100px;width:100%;display:flex;margin-top:10px;flex-direction:column;justify-content:center;align-items:center}.CreateNewTicket button{cursor:pointer;display:inline-block;border-radius:50%;width:40px;height:40px;margin:5px;border:1px solid #FFF;background:#FFF;color:#004D4A;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.CreateNewTicket button:hover{background:#F1F1F1}.CreateNewTicket span{display:inline-block;font-size:12px;text-align:center;margin:0 auto;color:#FFF}.OrderSummary{min-width:200px;border-radius:4px;display:flex;flex-direction:column;justify-content:center;margin-top:20px;background:#fff}.OrderSummary .OrderSummaryTitle{font-size:16px;color:#009993;text-transform:uppercase;text-align:center}.OrderSummary .Ticket{display:inline-block;color:#000;font-size:14px;height:50px;border-bottom:solid 1px #D4D4D4;line-height:50px}.OrderSummary .Ticket span{text-align:right}.OrderSummary .Total{display:inline-block;color:#000;font-size:14px;height:50px;line-height:50px}.OrderSummary .Total span{text-align:right}.ButtonWrapper{display:flex;align-items:center;justify-content:center}.ButtonWrapper .Button{cursor:pointer;border-radius:4px;padding:8px 60px;width:max-content;margin:5px;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#009993;border:1px solid #009993;color:#FFF}.ButtonWrapper .Button:hover{background:#00ABA4}.ButtonWrapper .Button.ButtonDisabled{pointer-events:none;background:#ccc;border:1px solid #ccc}.SubmitModalSuccess{text-align:center;font-size:18px;padding:20px}.DeleteTicketModalWrapper{padding:20px;text-align:center}.DeleteTicketModalWrapper .DeleteTicketModalTitle{font-size:16px;color:#00958f;font-weight:400;text-transform:uppercase;margin:20px 0 40px}.DeleteTicketModalWrapper .DeleteTicketModalText{font-size:14px;color:#000;line-height:22px;margin-bottom:40px}.DeleteTicketModalWrapper .DeleteTicketModalButtons{display:flex;gap:10px;justify-content:center}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm{cursor:pointer;border-radius:4px;padding:8px 25px;width:max-content;margin:5px;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm:hover{background:#FF6536;border:1px solid #FF3D00}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel{cursor:pointer;width:max-content;border-radius:4px;padding:10px 25px;margin:5px;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel:hover{background:#F1F1F1}@media (min-width: 1200px){.GamePageContent .TicketsWrapper{float:left;width:49%}.GamePageContent .GameDetails{float:right;width:49%}.GamePageContent .OrderSummary{float:right;width:49%}}';export{o as lottery_game_page}
1
+ import{r as t,g as e,h as i,a}from"./p-e765c7d9.js";const r=["ro","en","fr","ar"],s={en:{error:"Error",title:"Chrono",backButton:"Back",lobbyButton:"Lobby",prize:"Prize",winUpTo:"Win up to",nextDraw:"Next draw in: ",buy:"Buy tickets",viewLatest:"View latest results",createTicket:"Create Ticket",modalSuccess:"Purchase successfully completed!",deleteTicketModalTitle:"Delete Ticket",deleteTicketModalText:"Are you sure you want to delete this ticket?",deleteTicketModalCancel:"Cancel",deleteTicketModalConfirm:"Delete",orderSummaryTitle:"Order Summary",orderSummaryTickets:"Ticket",orderSummaryTotal:"Total",orderSummarySubmit:"Submit",lastDrawResultsTitle:"Last Draw Results",modalLogin:"Please login to submit a ticket"},ro:{error:"Eroare",title:"Loto 6/49",backButton:"Inapoi",lobbyButton:"Lobby",prize:"MARELE JACKPOT OMG",winUpTo:"Castiga pana la",nextDraw:"Urmatoarea extragere:",buy:"Cumpara bilet",viewLatest:"Ultimile extrageri",createTicket:"Creeaza bilet",modalSuccess:"Achizitie efectuata cu succes",deleteTicketModalTitle:"Sterge biletul",deleteTicketModalText:"Esti sigur ca vrei sa stergi acest bilet?",deleteTicketModalCancel:"Anuleaza",deleteTicketModalConfirm:"Sterge",orderSummaryTitle:"Rezumat comanda",orderSummaryTickets:"Bilet",orderSummaryTotal:"Total",orderSummarySubmit:"Trimite",lastDrawResultsTitle:"Cele mai recente extrageri",modalLogin:"Please login to submit a ticket"},fr:{error:"Error",title:"Chrono",backButton:"Back",lobbyButton:"Lobby",prize:"Prize",winUpTo:"Win up to",nextDraw:"Next draw in: ",buy:"Buy tickets",viewLatest:"View latest results",createTicket:"Create Ticket",modalSuccess:"Purchase successfully completed!",deleteTicketModalTitle:"Delete Ticket",deleteTicketModalText:"Are you sure you want to delete this ticket?",deleteTicketModalCancel:"Cancel",deleteTicketModalConfirm:"Delete",orderSummaryTitle:"Order Summary",orderSummaryTickets:"Ticket",orderSummaryTotal:"Total",orderSummarySubmit:"Submit",lastDrawResultsTitle:"Résultats du dernier tirage",modalLogin:"Please login to submit a ticket"},ar:{error:"خطأ",title:"كرونو",backButton:"خلف",lobbyButton:"ردهة",prize:"جائزة",winUpTo:"الفوز بما يصل الى",nextDraw:"السحب التالي:",buy:"اشتري تذاكر",viewLatest:"عرض أحدث النتائج",createTicket:"إنشاء تذكرة",modalSuccess:"!سيتم الشراء بنجاح قريبًا",deleteTicketModalTitle:"حذف التذكرة",deleteTicketModalText:"هل أنت متأكد أنك تريد حذف هذه التذكرة؟",deleteTicketModalCancel:"يلغي",deleteTicketModalConfirm:"حذف",orderSummaryTitle:"ملخص الطلب",orderSummaryTickets:"تذكرة",orderSummaryTotal:"المجموع",orderSummarySubmit:"يُقدِّم",lastDrawResultsTitle:"نتائج آخر سحب",modalLogin:"الرجاء تسجيل الدخول لتقديم تذكرة"}},n=(t,e)=>{const i=e;return s[void 0!==i&&r.includes(i)?i:"en"][t]},o=class{constructor(e){t(this,e),this.language="en",this.autoPick=!1,this.resetButton=!1,this.clientStyling="",this.clientStylingurl="",this.clientStylingUrlContent="",this.tickets=[],this.tabIndex=0,this.hasErrors=!1,this.totalAmount=0,this.successVisible=!1,this.deleteVisible=!1,this.latestDraw={},this.totalWinningsAmount=0,this.isLoggedIn=!1,this.loginModalVisible=!1,this.limitStylingAppends=!1,this.userAgent=window.navigator.userAgent,this.multiplier=!1,this.quickPick=!1,this.setClientStyling=()=>{let t=document.createElement("style");t.innerHTML=this.clientStyling,this.stylingContainer.prepend(t)},this.setClientStylingURL=()=>{let t=new URL(this.clientStylingurl),e=document.createElement("style");fetch(t.href).then((t=>t.text())).then((t=>{this.clientStylingUrlContent=t,e.innerHTML=t,setTimeout((()=>{this.stylingContainer.prepend(e)}),1)})).catch((t=>{console.log("error ",t)}))}}handleSessionIdValue(){this.isLoggedIn=!0}connectedCallback(){this.getGameDetails(),this.getDraws(),this.sessionId&&(this.isLoggedIn=!0)}componentDidRender(){!this.limitStylingAppends&&this.stylingContainer&&(this.clientStyling&&this.setClientStyling(),this.clientStylingurl&&this.setClientStylingURL(),this.limitStylingAppends=!0)}countdownLogic(t){t&&(this.interval=setInterval((()=>{this.daysRemaining=Math.floor((Date.parse(t)-(new Date).getTime())/864e5),this.hoursRemaining=Math.floor((Date.parse(t)-(new Date).getTime())/36e5-24*this.daysRemaining),this.minutesRemaining=Math.floor((Date.parse(t)-(new Date).getTime())/6e4-24*this.daysRemaining*60-60*this.hoursRemaining),this.secondsRemaining=Math.floor((Date.parse(t)-(new Date).getTime())/1e3-24*this.daysRemaining*60*60-60*this.hoursRemaining*60-60*this.minutesRemaining)}),1e3))}disconnectedCallback(){clearInterval(this.interval)}getGameDetails(){let t=new URL(`${this.endpoint}/games/${this.gameId}`);fetch(t.href).then((t=>{if(t.status>=300)throw this.hasErrors=!0,new Error("There was an error while fetching the data");return t.json()})).then((t=>{this.gameData=t,this.basicStake=this.gameData.rules.stakes[0].amount;let e=this.gameData.draws.filter((t=>!t.winningNumbers));this.nextDraw=e[0].id,this.createNewTicket()})).catch((t=>{this.hasErrors=!0,console.log("Error",t)}))}calculateTotalAmount(){const{currency:t}=this.gameData.rules.stakes[0];this.totalAmount=0,this.tickets.forEach((t=>{t.completed&&(this.totalAmount+=t.amount*t.stake)})),this.currency=t}gridFilledHandler(t){this.tickets=this.tickets.map((e=>{if(e.ticketId==t.detail.id){let i=e.selectedNumbers||[];return i[t.detail.index]=t.detail.selectedNumbers.map((t=>parseInt(t,10))),{gameId:e.gameId,ticketId:e.ticketId,completed:!0,amount:t.detail.draws,stake:e.stake,selectedNumbers:i}}return e})),this.calculateTotalAmount()}gridDirtyHandler(t){this.tickets=this.tickets.map((e=>e.gameId==t.detail.id?{gameId:e.gameId,ticketId:e.ticketId,completed:!1,amount:e.amount,stake:e.stake,grids:[]}:e))}deleteTicketHandler(t){this.deleteVisible=!0,this.deleteEventData=t}modalCloseEvent(){this.deleteVisible=!1,this.loginModalVisible=!1}stakeChangeHandler(t){const{ticketId:e,stake:i}=t.detail;this.tickets[e-1].stake=i,this.calculateTotalAmount()}multiplierChangeHandler(t){this.multiplier=t.detail}getDraws(){let t=new URL(`${this.endpoint}/games/${this.gameId}/draws`);fetch(t.href,{method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}}).then((t=>t.json())).then((t=>{var e,i;let a=t.items.filter((t=>{if(Date.parse(t.date)>(new Date).getTime())return!t.winningNumbers})),r=t.items.filter((t=>t.winningNumbers));this.latestDraw=a[0]||{},this.nextDate=null===(e=this.latestDraw)||void 0===e?void 0:e.date,this.countdownLogic(this.nextDate||""),this.lastDrawId=r[r.length-1].id,null===(i=this.latestDraw)||void 0===i||i.prizes.forEach((t=>{this.totalWinningsAmount+=JSON.parse(t.amount)}))})).catch((t=>{console.log("error ",t)}))}confirmDeleteTicketHandler(t){this.tickets=this.tickets.filter((e=>e.ticketId!=t.detail.ticketId)),this.calculateTotalAmount(),this.deleteVisible=!1}createNewTicket(){this.tickets=[...this.tickets,{gameId:this.gameId,ticketId:this.tickets.length+1,completed:!1,amount:1,stake:this.basicStake,grids:[]}]}showLoginModal(){this.loginModalVisible=!0}submitTickets(){let t=new URL(`${this.endpoint}/tickets`),e={gameId:this.gameId,tickets:[]};this.tickets.forEach((t=>{e.tickets.push({startingDrawId:this.nextDraw,amount:t.stake,gameId:this.gameId,currency:this.currency,selection:t.selectedNumbers,multiplier:this.multiplier,drawCount:t.amount,quickPick:this.quickPick})}));let i={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this.sessionId}`},body:JSON.stringify(e)};fetch(t.href,i).then((t=>{if(t.status>300)throw new Error("err");return t.json()})).then((t=>{console.log("data",t)})).catch((t=>{console.log("error ",t)})),this.successVisible=!0}render(){const t=e("./assets/chrono_lottery_mobile.png"),a=e("./assets/chrono_desktop.png");return this.hasErrors?i("div",{class:"GamePage"},i("div",{class:"Title"},n("error",this.language))):i("div",{class:"GamePage",dir:"ar"==this.language?"rtl":"ltr",ref:t=>this.stylingContainer=t},i("div",{class:"GridBanner",style:{backgroundImage:(r=this.userAgent,r.toLowerCase().match(/android/i)||r.toLowerCase().match(/blackberry|bb/i)||r.toLowerCase().match(/iphone|ipad|ipod/i)||r.toLowerCase().match(/windows phone|windows mobile|iemobile|wpdesktop/i)?`url(${t})`:`url(${a})`)}},i("div",{class:"BannerButtonsWrapper"},i("button",{class:"BannerBackButton"},i("span",{class:"BannerBackButtonArrow"},"ᐸ "),n("backButton",this.language)),i("button",{class:"BannerLobbyButton"},n("lobbyButton",this.language))),i("div",{class:"Tabs"},i("div",{class:"TabButton"+(0==this.tabIndex?" Active":""),onClick:()=>this.tabIndex=0},n("buy",this.language)),i("div",{class:"TabButton"+(1==this.tabIndex?" Active":""),onClick:()=>this.tabIndex=1},n("viewLatest",this.language)))),i("div",{class:"NextDrawWrapper"},i("div",{class:"TotalWinnings"},n("winUpTo",this.language),": ",i("span",null,"$",this.totalWinningsAmount.toLocaleString("en-US",{maximumFractionDigits:2}))),i("div",{class:"NextDraw"},i("p",{class:"BannerText"},n("nextDraw",this.language)),i("div",{class:"BannerCountdown"},i("span",{class:"CountdownDays"},this.daysRemaining,"D"),i("span",{class:"CountdownHours"},this.hoursRemaining,"H"),i("span",{class:"CountdownMinutes"},this.minutesRemaining,"M"),i("span",{class:"CountdownSeconds"},this.secondsRemaining,"S")))),0==this.tabIndex&&i("div",{class:"GamePageContent"},i("div",{class:"GameDetails"},i("lottery-game-details",{"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent})),i("div",{class:"TicketsWrapper"},this.tickets.map((t=>i("lottery-ticket-controller",{endpoint:this.endpoint,"ticket-id":t.ticketId,"game-id":t.gameId,collapsed:!1,last:!0,language:this.language,"auto-pick":this.autoPick,"reset-button":this.resetButton,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent}))),i("div",{class:"CreateNewTicket"},i("button",{onClick:()=>this.createNewTicket()},"+"),i("span",null,n("createTicket",this.language)))),i("div",{class:"OrderSummary"},i("h3",{class:"OrderSummaryTitle"},n("orderSummaryTitle",this.language)),i("div",{class:"Ticket"},n("orderSummaryTickets",this.language),": ",i("span",null,this.tickets.length)),i("div",{class:"Total"},n("orderSummaryTotal",this.language),": ",i("span",null,this.totalAmount," ",this.currency)),i("div",{class:"ButtonWrapper"},this.isLoggedIn&&i("span",{class:"Button",onClick:()=>this.submitTickets()},n("orderSummarySubmit",this.language)),!this.isLoggedIn&&i("div",null,i("span",{class:"Button",onClick:()=>this.showLoginModal()},n("orderSummarySubmit",this.language)),i("helper-modal",{"title-modal":"Success",visible:this.loginModalVisible,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent},i("p",{class:"SubmitModalSuccess"},n("modalLogin",this.language))))))),1==this.tabIndex&&i("div",null,i("h4",{class:"LastDrawResultsTitle"},n("lastDrawResultsTitle",this.language)),i("lottery-draw-results",{endpoint:this.endpoint,"game-id":this.gameId,language:this.language,"draw-id":this.lastDrawId,"draw-mode":!0,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent}),i("lottery-draw-results-history",{endpoint:this.endpoint,"game-id":this.gameId,language:this.language,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent})),i("helper-modal",{"title-modal":"Success",visible:this.successVisible,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent},i("p",{class:"SubmitModalSuccess"},n("modalSuccess",this.language))),i("helper-modal",{"title-modal":"Delete Ticket",visible:this.deleteVisible,"client-styling":this.clientStyling,"client-styling-url-content":this.clientStylingUrlContent},i("div",{class:"DeleteTicketModalWrapper"},i("h3",{class:"DeleteTicketModalTitle"},n("deleteTicketModalTitle",this.language)),i("p",{class:"DeleteTicketModalText"},n("deleteTicketModalText",this.language)),i("div",{class:"DeleteTicketModalButtons"},i("button",{class:"DeleteTicketModalCancel",onClick:()=>this.modalCloseEvent()},n("deleteTicketModalCancel",this.language)),i("button",{class:"DeleteTicketModalConfirm",onClick:()=>this.confirmDeleteTicketHandler(this.deleteEventData)},n("deleteTicketModalConfirm",this.language))))));var r}static get assetsDirs(){return["assets"]}get element(){return a(this)}static get watchers(){return{sessionId:["handleSessionIdValue"]}}};o.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{display:block;font-family:"Roboto", sans-serif}.GamePage .GridBanner{background-color:#009993;background-repeat:no-repeat;background-position:center;color:#111;padding:0 20px 10px;height:220px;display:flex;flex-direction:column;justify-content:space-between}.GamePage .GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GamePage .GridBanner .BannerButtonsWrapper .BannerBackButton,.GamePage .GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:#fff;border:1px solid #D4D4D4;border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px}.GamePage .GridBanner .GridBannerArea{padding-top:30px;display:flex;flex-direction:column;align-items:center}.GamePage .TotalWinnings{color:#000;font-size:18px;display:flex;flex-direction:row;justify-content:center;align-items:center;gap:10px;text-transform:uppercase}.GamePage .TotalWinnings span{font-size:18px;font-weight:700}.GamePage .NextDraw{color:#00958f;font-size:24px;font-weight:600;margin:0 auto;text-align:center;text-transform:uppercase;display:flex;justify-content:center;align-items:center;flex-direction:column}.GamePage .NextDraw .BannerText{font-weight:400;font-size:18px;text-transform:uppercase;padding:0;margin:15px 0 0 0}.GamePage .NextDraw .BannerCountdown{font-size:22px;color:#00958f;display:flex;gap:20px}.GamePage .Tabs{display:flex;justify-content:center;gap:10px}.GamePage .Tabs .TabButton{border-radius:4px;cursor:pointer;padding:8px 0;width:50%;max-width:200px;border:1px solid #00958f;background:#00958f;color:#fff;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.GamePage .Tabs .TabButton.Active{color:#00958f;background:#F1F1F1;border:1px solid #F1F1F1}.LastDrawResultsTitle{color:#009993;padding:25px 0 10px 0;text-align:center;border-radius:4px;text-transform:uppercase;font-size:16px;font-weight:600;margin:0}.NextDrawWrapper{padding:10px 15px;background:#F1F1F1;background:linear-gradient(0deg, #f1f1f1 0%, rgba(253, 187, 45, 0) 100%)}.NextDrawWrapper .BannerText{font-size:16px;font-weight:700;text-align:center}.NextDrawWrapper .BannerCountdown{font-size:22px;display:flex;gap:8px;color:#009993;font-weight:bolder;justify-content:center}.GamePageContent{padding:15px;max-width:1200px;margin:0 auto}.GameDetails{padding-bottom:10px;margin-bottom:20px}.CreateNewTicket{background:#004D4A;height:100px;width:100%;display:flex;margin-top:10px;flex-direction:column;justify-content:center;align-items:center}.CreateNewTicket button{cursor:pointer;display:inline-block;border-radius:50%;width:40px;height:40px;margin:5px;border:1px solid #FFF;background:#FFF;color:#004D4A;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.CreateNewTicket button:hover{background:#F1F1F1}.CreateNewTicket span{display:inline-block;font-size:12px;text-align:center;margin:0 auto;color:#FFF}.OrderSummary{min-width:200px;border-radius:4px;display:flex;flex-direction:column;justify-content:center;margin-top:20px;background:#fff}.OrderSummary .OrderSummaryTitle{font-size:16px;color:#009993;text-transform:uppercase;text-align:center}.OrderSummary .Ticket{display:inline-block;color:#000;font-size:14px;height:50px;border-bottom:solid 1px #D4D4D4;line-height:50px}.OrderSummary .Ticket span{text-align:right}.OrderSummary .Total{display:inline-block;color:#000;font-size:14px;height:50px;line-height:50px}.OrderSummary .Total span{text-align:right}.ButtonWrapper{display:flex;align-items:center;justify-content:center}.ButtonWrapper .Button{cursor:pointer;border-radius:4px;padding:8px 60px;width:max-content;margin:5px;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#009993;border:1px solid #009993;color:#FFF}.ButtonWrapper .Button:hover{background:#00ABA4}.ButtonWrapper .Button.ButtonDisabled{pointer-events:none;background:#ccc;border:1px solid #ccc}.SubmitModalSuccess{text-align:center;font-size:18px;padding:20px}.DeleteTicketModalWrapper{padding:20px;text-align:center}.DeleteTicketModalWrapper .DeleteTicketModalTitle{font-size:16px;color:#00958f;font-weight:400;text-transform:uppercase;margin:20px 0 40px}.DeleteTicketModalWrapper .DeleteTicketModalText{font-size:14px;color:#000;line-height:22px;margin-bottom:40px}.DeleteTicketModalWrapper .DeleteTicketModalButtons{display:flex;gap:10px;justify-content:center}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm{cursor:pointer;border-radius:4px;padding:8px 25px;width:max-content;margin:5px;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0;background:#FF3D00;border:1px solid #FF3D00;color:#FFF}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalConfirm:hover{background:#FF6536;border:1px solid #FF3D00}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel{cursor:pointer;width:max-content;border-radius:4px;padding:10px 25px;margin:5px;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.DeleteTicketModalWrapper .DeleteTicketModalButtons .DeleteTicketModalCancel:hover{background:#F1F1F1}@media (min-width: 1200px){.GamePageContent .TicketsWrapper{float:left;width:49%}.GamePageContent .GameDetails{float:right;width:49%}.GamePageContent .OrderSummary{float:right;width:49%}}';export{o as lottery_game_page}
@@ -1,6 +1,7 @@
1
1
  import { sass } from '@stencil/sass';
2
2
  import { nodeResolve } from '@rollup/plugin-node-resolve';
3
3
  import commonjs from '@rollup/plugin-commonjs';
4
+ import copy from 'rollup-plugin-copy';
4
5
  export const config = {
5
6
  namespace: 'lottery-game-page',
6
7
  taskQueue: 'async',
@@ -13,6 +14,16 @@ export const config = {
13
14
  }),
14
15
  commonjs()
15
16
  ],
17
+ after: [
18
+ copy({
19
+ targets: [
20
+ {
21
+ src: 'src/**/*.{jpg,png}',
22
+ dest: 'dist/components/assets',
23
+ },
24
+ ],
25
+ }),
26
+ ],
16
27
  },
17
28
  outputTargets: [
18
29
  {
@@ -22,13 +33,6 @@ export const config = {
22
33
  {
23
34
  type: 'dist-custom-elements',
24
35
  autoDefineCustomElements: true,
25
- copy: [
26
- {
27
- src: '**/*.{jpg,png}',
28
- dest: 'dist/components/assets',
29
- warn: true,
30
- }
31
- ],
32
36
  },
33
37
  {
34
38
  type: 'docs-readme',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@everymatrix/lottery-game-page",
3
- "version": "0.1.26",
3
+ "version": "0.1.27",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.js",
6
6
  "es2015": "./dist/esm/index.mjs",