@everymatrix/lottery-game-page 0.0.7 → 0.0.10
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.
- package/dist/cjs/helper-accordion_13.cjs.entry.js +23492 -0
- package/dist/cjs/helper-pagination.cjs.entry.js +188 -0
- package/dist/cjs/{index-af6d701d.js → index-81cb3b3b.js} +70 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/lottery-game-page.cjs.js +2 -2
- package/dist/collection/collection-manifest.json +75 -1
- package/dist/components/helper-accordion.js +6 -0
- package/dist/components/helper-accordion2.js +110 -0
- package/dist/components/helper-filters.js +6 -0
- package/dist/components/helper-filters2.js +22347 -0
- package/dist/components/helper-modal.js +6 -0
- package/dist/components/helper-modal2.js +58 -0
- package/dist/components/helper-pagination.js +215 -0
- package/dist/components/helper-tab.js +6 -0
- package/dist/components/helper-tab2.js +47 -0
- package/dist/components/helper-tabs.js +6 -0
- package/dist/components/helper-tabs2.js +62 -0
- package/dist/components/index.js +13 -0
- package/dist/components/lottery-bullet.js +6 -0
- package/dist/components/lottery-bullet2.js +56 -0
- package/dist/components/lottery-draw-results-history.js +6 -0
- package/dist/components/lottery-draw-results-history2.js +174 -0
- package/dist/components/lottery-draw-results.js +6 -0
- package/dist/components/lottery-draw-results2.js +217 -0
- package/dist/components/lottery-game-details.js +6 -0
- package/dist/components/lottery-game-details2.js +48 -0
- package/dist/components/lottery-game-page.js +73 -6
- package/dist/components/lottery-grid.js +6 -0
- package/dist/components/lottery-grid2.js +196 -0
- package/dist/components/lottery-ticket-controller.js +6 -0
- package/dist/components/lottery-ticket-controller2.js +117 -0
- package/dist/components/lottery-ticket.js +6 -0
- package/dist/components/lottery-ticket2.js +183 -0
- package/dist/esm/helper-accordion_13.entry.js +23476 -0
- package/dist/esm/helper-pagination.entry.js +184 -0
- package/dist/esm/{index-8c700c5e.js → index-be84da79.js} +70 -3
- package/dist/esm/loader.js +2 -2
- package/dist/esm/lottery-game-page.js +2 -2
- package/dist/lottery-game-page/lottery-game-page.esm.js +1 -1
- package/dist/lottery-game-page/p-08581ede.entry.js +1 -0
- package/dist/lottery-game-page/p-49bd2864.entry.js +2849 -0
- package/dist/lottery-game-page/p-91420518.js +2 -0
- package/dist/stencil.config.js +6 -0
- package/package.json +1 -1
- package/dist/cjs/lottery-game-page.cjs.entry.js +0 -304
- package/dist/esm/lottery-game-page.entry.js +0 -300
- package/dist/lottery-game-page/p-453db7fa.entry.js +0 -1
- package/dist/lottery-game-page/p-b5969eab.js +0 -2
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$5 } from './helper-filters2.js';
|
|
3
|
+
import { d as defineCustomElement$4 } from './helper-modal2.js';
|
|
4
|
+
import { d as defineCustomElement$3 } from './lottery-bullet2.js';
|
|
5
|
+
import { d as defineCustomElement$2 } from './lottery-draw-results2.js';
|
|
6
|
+
import { d as defineCustomElement$1 } from './lottery-grid2.js';
|
|
7
|
+
|
|
8
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
9
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
10
|
+
const TRANSLATIONS = {
|
|
11
|
+
en: {
|
|
12
|
+
drawResultsHeader: 'Draw results history',
|
|
13
|
+
drawId: 'Draw ID',
|
|
14
|
+
drawDate: 'Draw Date',
|
|
15
|
+
drawNumbersGridA: 'Draw numbers Grid A',
|
|
16
|
+
viewAllResults: 'View All',
|
|
17
|
+
lastFiveDraws: 'Last 5 Draws',
|
|
18
|
+
lastTenDraws: 'Last 10 Draws',
|
|
19
|
+
lastFifteenDraws: 'Last 15 Draws'
|
|
20
|
+
},
|
|
21
|
+
ro: {
|
|
22
|
+
drawResultsHeader: 'Draw results history',
|
|
23
|
+
drawId: 'Draw ID',
|
|
24
|
+
drawDate: 'Draw Date',
|
|
25
|
+
drawNumbersGridA: 'Draw numbers Grid A',
|
|
26
|
+
viewAllResults: 'View All',
|
|
27
|
+
lastFiveDraws: 'Last 5 Draws',
|
|
28
|
+
lastTenDraws: 'Last 10 Draws',
|
|
29
|
+
lastFifteenDraws: 'Last 15 Draws'
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
const translate = (key, customLang) => {
|
|
33
|
+
const lang = customLang;
|
|
34
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const lotteryDrawResultsHistoryCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.GridBanner{background-color:#009993;background-repeat:no-repeat;background-position:center;color:#111;padding:0 20px 30px}.GridBanner .BannerButtonsWrapper{display:flex;justify-content:space-between;padding-top:16px}.GridBanner .BannerButtonsWrapper .BannerBackButton,.GridBanner .BannerButtonsWrapper .BannerLobbyButton{background:#fff;border:1px solid #009993;border-radius:4px;padding:7px 15px;font-size:12px;text-transform:uppercase;width:80px}.GridBanner .HistoryGridBannerArea{padding-top:30px}.HistoryGridBannerArea{display:flex;flex-direction:column;align-items:center}.BannerText{font-size:14px;font-weight:300}.BannerCountdown{font-size:22px;display:flex;gap:20px}.DrawResultsSection{max-width:500px;margin:0 auto}.HistoryGridWrapper{padding:0 15px}.HistoryGrid{border:1px solid #009993;border-radius:5px}.DrawResultsHeader{color:#009993;padding:15px;text-align:center}.DrawResultsHeader h4{text-transform:uppercase;font-size:16px;font-weight:600;margin:0}.DrawNumbersGrid{padding:10px 50px}.DrawNumbersGrid p{margin:0 0 10px 0;font-size:14px}.BulletContainer{margin-bottom:20px}.DrawResultTop{background-color:#009993;padding:10px;text-align:center;color:#fff;padding:0 50px;display:flex;justify-content:center;gap:40px}.ViewAllResults{display:block;padding:10px 40px;margin:40px auto;border:0;border-radius:5px;background-color:#009993;color:#fff;outline:none}.FilterSection{display:flex;justify-content:space-between;padding:10px 0 25px}.FilterSection .FilterResultsContainer{display:flex;gap:5px}.FilterSection .QuickFilterButton{cursor:pointer;width:max-content;border-radius:4px;border:1px solid #00958f;background:#FFF;color:#000;font-size:12px;transition:all 0.2s linear;text-align:center;letter-spacing:0}.FilterSection .QuickFilterButton:hover{background:#F1F1F1}.FilterSection helper-filters{margin-left:auto}";
|
|
38
|
+
|
|
39
|
+
const LotteryDrawResultsHistory = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
40
|
+
constructor() {
|
|
41
|
+
super();
|
|
42
|
+
this.__registerHost();
|
|
43
|
+
this.__attachShadow();
|
|
44
|
+
/**
|
|
45
|
+
* The number of results to be displayed
|
|
46
|
+
*/
|
|
47
|
+
this.numberOfResults = 3;
|
|
48
|
+
/**
|
|
49
|
+
*Language
|
|
50
|
+
*/
|
|
51
|
+
this.language = 'en';
|
|
52
|
+
this.drawData = [];
|
|
53
|
+
this.displayAllDrawsResults = true;
|
|
54
|
+
this.showQuickFilters = true;
|
|
55
|
+
this.winningDataSetsData = [''];
|
|
56
|
+
this.getDrawsData = () => {
|
|
57
|
+
let url = new URL(`${this.endpoint}/games/${this.gameId}`);
|
|
58
|
+
fetch(url.href)
|
|
59
|
+
.then((res) => {
|
|
60
|
+
if (res.status >= 300) {
|
|
61
|
+
throw new Error('There was an error while fetching the data');
|
|
62
|
+
}
|
|
63
|
+
return res.json();
|
|
64
|
+
})
|
|
65
|
+
.then((data) => {
|
|
66
|
+
console.log("getDrawsData ", data);
|
|
67
|
+
// filter out incomplete data sets for draws
|
|
68
|
+
this.winningDataSetsData = data.draws.filter(draw => draw.winningNumbers);
|
|
69
|
+
this.drawData = this.winningDataSetsData;
|
|
70
|
+
console.log('this.drawData', this.drawData);
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
this.filterResults = (resultsNumber) => {
|
|
74
|
+
this.numberOfResults = resultsNumber;
|
|
75
|
+
this.displayAllDrawsResults = true;
|
|
76
|
+
};
|
|
77
|
+
this.getDrawResults = (drawID) => {
|
|
78
|
+
let url = new URL(`${this.endpoint}/games/${this.gameId}/draws/${drawID}`);
|
|
79
|
+
let drawOptions = {
|
|
80
|
+
method: "GET",
|
|
81
|
+
headers: {
|
|
82
|
+
'Content-Type': "application/json",
|
|
83
|
+
'Accept': 'application/json',
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
fetch(url.href, drawOptions)
|
|
87
|
+
.then((response) => {
|
|
88
|
+
return response.json();
|
|
89
|
+
})
|
|
90
|
+
.then((data) => {
|
|
91
|
+
console.log("getDrawResults ", data);
|
|
92
|
+
this.drawData = [data];
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
this.viewAllResults = () => {
|
|
96
|
+
this.numberOfResults = this.drawData.length;
|
|
97
|
+
this.displayAllDrawsResults = false;
|
|
98
|
+
window.scrollTo({ top: 0, behavior: 'smooth' });
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
// Filters events
|
|
102
|
+
filtersHandler(event) {
|
|
103
|
+
var _a;
|
|
104
|
+
this.getDrawResults((_a = event.detail) === null || _a === void 0 ? void 0 : _a.drawTicketId);
|
|
105
|
+
this.showQuickFilters = false;
|
|
106
|
+
}
|
|
107
|
+
clearFiltersHandler() {
|
|
108
|
+
this.drawData = this.winningDataSetsData;
|
|
109
|
+
this.showQuickFilters = true;
|
|
110
|
+
}
|
|
111
|
+
connectedCallback() {
|
|
112
|
+
this.getDrawsData();
|
|
113
|
+
}
|
|
114
|
+
disconnectedCallback() {
|
|
115
|
+
clearInterval(this.interval);
|
|
116
|
+
}
|
|
117
|
+
render() {
|
|
118
|
+
let gridHeader = h("div", { class: "DrawResultsHeader" }, this.displayAllDrawsResults ? h("h4", null, translate('drawResultsHeader', this.language)) :
|
|
119
|
+
h("div", { class: "DrawResultsHeaderContent" }, h("div", { class: "FilterSection" }, this.showQuickFilters &&
|
|
120
|
+
h("div", { class: "FilterResultsContainer" }, h("button", { class: "QuickFilterButton", onClick: () => this.filterResults(5) }, translate('lastFiveDraws', this.language)), h("button", { class: "QuickFilterButton", onClick: () => this.filterResults(10) }, translate('lastTenDraws', this.language)), h("button", { class: "QuickFilterButton", onClick: () => this.filterResults(15) }, translate('lastFifteenDraws', this.language))), h("helper-filters", { "show-filter-id": "true", "activate-ticket-search": "false", "game-id": "3797", "player-id": "2323" })), h("h4", null, "All draws results history")));
|
|
121
|
+
let gridContent = h("div", { class: "HistoryGridWrapper" }, h("div", { class: "HistoryGrid" }, this.drawData.map((item) => h("lottery-draw-results", { endpoint: this.endpoint, "game-id": this.gameId, "draw-id": item.id, "draw-mode": true })).reverse().slice(0, this.numberOfResults)));
|
|
122
|
+
return h("section", { class: "GridWrapper" }, h("div", { class: "DrawResultsSection" }, h("div", { class: "DrawResultsArea" }, gridHeader, gridContent, this.displayAllDrawsResults && h("button", { class: "ViewAllResults", onClick: this.viewAllResults }, "View All"))));
|
|
123
|
+
}
|
|
124
|
+
static get style() { return lotteryDrawResultsHistoryCss; }
|
|
125
|
+
}, [1, "lottery-draw-results-history", {
|
|
126
|
+
"endpoint": [1],
|
|
127
|
+
"gameId": [1, "game-id"],
|
|
128
|
+
"numberOfResults": [2, "number-of-results"],
|
|
129
|
+
"language": [1],
|
|
130
|
+
"drawData": [32],
|
|
131
|
+
"displayAllDrawsResults": [32],
|
|
132
|
+
"showQuickFilters": [32],
|
|
133
|
+
"winningDataSetsData": [32]
|
|
134
|
+
}, [[0, "filterSelection", "filtersHandler"], [0, "filterSelectionReset", "clearFiltersHandler"]]]);
|
|
135
|
+
function defineCustomElement() {
|
|
136
|
+
if (typeof customElements === "undefined") {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
const components = ["lottery-draw-results-history", "helper-filters", "helper-modal", "lottery-bullet", "lottery-draw-results", "lottery-grid"];
|
|
140
|
+
components.forEach(tagName => { switch (tagName) {
|
|
141
|
+
case "lottery-draw-results-history":
|
|
142
|
+
if (!customElements.get(tagName)) {
|
|
143
|
+
customElements.define(tagName, LotteryDrawResultsHistory);
|
|
144
|
+
}
|
|
145
|
+
break;
|
|
146
|
+
case "helper-filters":
|
|
147
|
+
if (!customElements.get(tagName)) {
|
|
148
|
+
defineCustomElement$5();
|
|
149
|
+
}
|
|
150
|
+
break;
|
|
151
|
+
case "helper-modal":
|
|
152
|
+
if (!customElements.get(tagName)) {
|
|
153
|
+
defineCustomElement$4();
|
|
154
|
+
}
|
|
155
|
+
break;
|
|
156
|
+
case "lottery-bullet":
|
|
157
|
+
if (!customElements.get(tagName)) {
|
|
158
|
+
defineCustomElement$3();
|
|
159
|
+
}
|
|
160
|
+
break;
|
|
161
|
+
case "lottery-draw-results":
|
|
162
|
+
if (!customElements.get(tagName)) {
|
|
163
|
+
defineCustomElement$2();
|
|
164
|
+
}
|
|
165
|
+
break;
|
|
166
|
+
case "lottery-grid":
|
|
167
|
+
if (!customElements.get(tagName)) {
|
|
168
|
+
defineCustomElement$1();
|
|
169
|
+
}
|
|
170
|
+
break;
|
|
171
|
+
} });
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
export { LotteryDrawResultsHistory as L, defineCustomElement as d };
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$2 } from './lottery-bullet2.js';
|
|
3
|
+
import { d as defineCustomElement$1 } from './lottery-grid2.js';
|
|
4
|
+
|
|
5
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
6
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
7
|
+
const TRANSLATIONS = {
|
|
8
|
+
en: {
|
|
9
|
+
drawResultsHeader: 'Last draw results',
|
|
10
|
+
drawId: 'Draw ID',
|
|
11
|
+
drawName: 'Game name',
|
|
12
|
+
drawDate: 'Draw Date',
|
|
13
|
+
drawNumbersGridDraw: 'Draw numbers Grid A',
|
|
14
|
+
drawNumbersGridTicket: 'Draw numbers Grid B',
|
|
15
|
+
ticketResult: 'Ticket result',
|
|
16
|
+
amountWon: 'Amount won',
|
|
17
|
+
numberOfDraws: 'Number of draws'
|
|
18
|
+
},
|
|
19
|
+
ro: {
|
|
20
|
+
drawResultsHeader: 'Ultimele rezultate extragere',
|
|
21
|
+
drawId: 'Id extragere',
|
|
22
|
+
drawName: 'Numele jocului',
|
|
23
|
+
drawDate: 'Data extragerii',
|
|
24
|
+
drawNumbersGridDraw: 'Numerele extrase Grid A',
|
|
25
|
+
drawNumbersGridTicket: 'Numerele extrase Grid B',
|
|
26
|
+
ticketResult: 'Rezultatul biletului',
|
|
27
|
+
amountWon: 'Suma castigata',
|
|
28
|
+
numberOfDraws: 'Numarul de extrageri'
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
const translate = (key, customLang) => {
|
|
32
|
+
const lang = customLang;
|
|
33
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const lotteryDrawResultsCss = "@import url(\"https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap\");:host{display:block;font-family:\"Roboto\", sans-serif}.TicketInfo{display:flex;flex-direction:row;gap:15px;background-color:#009993;color:#fff;padding:12px;font-size:14px}.DrawResultsSection{max-width:500px;margin:0 auto;margin:0px auto 10px;border-radius:4px}.DrawResultsHeader{display:flex;justify-content:space-between;padding:10px 20px;background-color:#009993;color:#fff;font-size:14px}.DrawResultsHeader h4{text-transform:uppercase;font-weight:400;margin:0}.DrawMultipler label{display:block;margin:15px 0}.DrawResultsBody{padding:0 20px}.DrawResultsBody .DrawNumbersGrid{font-size:14px}.DrawResultsBody .NumberOfDrawsContainer{display:table;width:100%}.Toggle{cursor:pointer;display:inline-block}.ToggleSwitch{display:inline-block;background:#ccc;border-radius:16px;width:58px;height:24px;position:relative;vertical-align:middle;transition:background 0.25s}.ToggleSwitch:before,.ToggleSwitch:after{content:\"\"}.ToggleSwitch:before{display:block;background:linear-gradient(to bottom, #fff 0%, #eee 100%);border-radius:50%;box-shadow:0 0 0 1px rgba(0, 0, 0, 0.25);width:16px;height:16px;position:absolute;top:4px;left:4px;transition:left 0.25s}.Toggle:hover .ToggleSwitch:before{background:linear-gradient(to bottom, #fff 0%, #fff 100%);box-shadow:0 0 0 1px rgba(0, 0, 0, 0.5)}.ToggleCheckbox:checked+.ToggleSwitch{background:#56c080}.ToggleCheckbox:checked+.ToggleSwitch:before{left:38px}.ToggleCheckbox{position:absolute;visibility:hidden}.Label{margin-right:5px;position:relative;top:2px}.DrawTicketsContainer{margin:30px auto}.ExpandableBoxes{position:relative}.ExpandableBox{width:100%;height:100%;max-height:100px;float:left;margin:0 0 20px 0;border:1px solid #009993;border-radius:4px;padding:10px;box-sizing:border-box;-webkit-transition:all 0.6s ease-in-out;-moz-transition:all 0.6s ease-in-out;-o-transition:all 0.6s ease-in-out;-ms-transition:all 0.6s ease-in-out;transition:all 0.6s ease-in-out;overflow:hidden}.ExpandableBox.ShowBox{max-height:400px;margin:0px 0px 20p 0px}.ExpandableBox.HideBox{width:0;height:0;overflow:hidden;border:none;padding:0;margin:0;opacity:0}";
|
|
37
|
+
|
|
38
|
+
const DEFAULT_VALUES = {
|
|
39
|
+
gamename: 'Chrono',
|
|
40
|
+
gamedate: '24/09/2022',
|
|
41
|
+
state: 'Processing',
|
|
42
|
+
amount: 304444,
|
|
43
|
+
ticketid: '6963444',
|
|
44
|
+
selection: '[5, 6, 7, 8, 9]',
|
|
45
|
+
multiplier: 4.5,
|
|
46
|
+
resultstatus: 'Processing',
|
|
47
|
+
drawstatus: 'Won',
|
|
48
|
+
drawamount: 1022,
|
|
49
|
+
drawid: '54545555',
|
|
50
|
+
drawdate: '24/09/2032'
|
|
51
|
+
};
|
|
52
|
+
const LotteryDrawResults = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
53
|
+
constructor() {
|
|
54
|
+
super();
|
|
55
|
+
this.__registerHost();
|
|
56
|
+
this.__attachShadow();
|
|
57
|
+
/**
|
|
58
|
+
* Language of the widget
|
|
59
|
+
*/
|
|
60
|
+
this.language = 'en';
|
|
61
|
+
/**
|
|
62
|
+
* Shows only the last draw
|
|
63
|
+
*/
|
|
64
|
+
this.drawMode = false;
|
|
65
|
+
this.gameName = '';
|
|
66
|
+
this.multiplier = 5.434;
|
|
67
|
+
this.ticketData = {};
|
|
68
|
+
this.isLoading = true;
|
|
69
|
+
this.drawResults = [];
|
|
70
|
+
this.rules = {};
|
|
71
|
+
this.toggleDrawer = [false];
|
|
72
|
+
this.hasErrors = false;
|
|
73
|
+
this.errorText = '';
|
|
74
|
+
this.changeBox = (index) => {
|
|
75
|
+
this.toggleDrawer = this.toggleDrawer.map((item, itemIndex) => {
|
|
76
|
+
if (itemIndex == index) {
|
|
77
|
+
return !item;
|
|
78
|
+
}
|
|
79
|
+
return item;
|
|
80
|
+
});
|
|
81
|
+
if (index >= this.toggleDrawer.length) {
|
|
82
|
+
this.toggleDrawer.push(true);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
connectedCallback() {
|
|
87
|
+
let promises = [];
|
|
88
|
+
promises.push(this.getGameData());
|
|
89
|
+
if (this.playerId) {
|
|
90
|
+
promises.push(this.getTicketData());
|
|
91
|
+
}
|
|
92
|
+
if (this.drawId) {
|
|
93
|
+
promises.push(this.getDrawData());
|
|
94
|
+
}
|
|
95
|
+
Promise.all(promises)
|
|
96
|
+
.then(() => {
|
|
97
|
+
this.isLoading = false;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
getDrawData() {
|
|
101
|
+
return new Promise((resolve, reject) => {
|
|
102
|
+
let url = new URL(`${this.endpoint}/games/${this.gameId}/draws/${this.drawId}`);
|
|
103
|
+
fetch(url.href)
|
|
104
|
+
.then((response) => {
|
|
105
|
+
// @TODO EXCEPTIONS
|
|
106
|
+
return response.json();
|
|
107
|
+
})
|
|
108
|
+
.then((data) => {
|
|
109
|
+
this.drawData = data;
|
|
110
|
+
resolve(true);
|
|
111
|
+
})
|
|
112
|
+
.catch((err) => {
|
|
113
|
+
reject(err);
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
getGameData() {
|
|
118
|
+
return new Promise((resolve, reject) => {
|
|
119
|
+
let url = new URL(`${this.endpoint}/games/${this.gameId}`);
|
|
120
|
+
fetch(url.href)
|
|
121
|
+
.then((response) => {
|
|
122
|
+
return response.json();
|
|
123
|
+
})
|
|
124
|
+
.then((data) => {
|
|
125
|
+
this.rules = {
|
|
126
|
+
maximumAllowed: data.rules.boards[0].maximumAllowed,
|
|
127
|
+
totalNumbers: data.rules.boards[0].totalNumbers
|
|
128
|
+
};
|
|
129
|
+
resolve(true);
|
|
130
|
+
})
|
|
131
|
+
.catch((err) => {
|
|
132
|
+
this.isLoading = false;
|
|
133
|
+
this.hasErrors = true;
|
|
134
|
+
this.errorText = err;
|
|
135
|
+
reject(err);
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
getTicketData() {
|
|
140
|
+
return new Promise((resolve, reject) => {
|
|
141
|
+
let url = new URL(`${this.endpoint}/tickets/player/${this.playerId}`);
|
|
142
|
+
fetch(url.href)
|
|
143
|
+
.then((response) => {
|
|
144
|
+
return response.json();
|
|
145
|
+
})
|
|
146
|
+
.then((data) => {
|
|
147
|
+
this.ticketData = data.length === 0 ? DEFAULT_VALUES : data[1];
|
|
148
|
+
this.drawResults = this.ticketData.drawResults.map((item) => item);
|
|
149
|
+
this.selection = this.ticketData.selection[0].join(',');
|
|
150
|
+
resolve(true);
|
|
151
|
+
})
|
|
152
|
+
.catch((err) => {
|
|
153
|
+
reject(err);
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
render() {
|
|
158
|
+
var _a, _b, _c, _d, _e, _f;
|
|
159
|
+
if (this.isLoading) {
|
|
160
|
+
return (h("p", null, "Loading, please wait ..."));
|
|
161
|
+
}
|
|
162
|
+
else if (this.hasErrors) {
|
|
163
|
+
h("p", null, this.errorText);
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
return (h("section", { class: "DrawResultsSection" }, !this.drawMode ?
|
|
167
|
+
h("div", { class: "DrawResultsArea" }, h("div", { class: "TicketInfo" }, h("div", { class: "TicketGameName" }, translate('drawName', this.language), ": ", h("span", null, this.gameName)), h("div", { class: "TicketDate" }, "Ticket Purchase Date: ", h("span", null, (_a = this.ticketData) === null || _a === void 0 ? void 0 : _a.createdAt.slice(0, 10))), h("div", { class: "TicketStatus" }, "Status: ", h("span", null, (_b = this.ticketData) === null || _b === void 0 ? void 0 : _b.state))), h("div", { class: "DrawResultsBody" }, h("div", { class: "TicketIdContainer" }, h("p", null, "Ticket id: ", h("span", null, (_c = this.ticketData) === null || _c === void 0 ? void 0 : _c.id))), h("div", { class: "TicketAmountContainer" }, h("p", null, "Ticket amount: ", h("span", null, (_d = this.ticketData) === null || _d === void 0 ? void 0 : _d.amount))), h("div", { class: "DrawNumbersGrid" }, h("p", null, translate('drawNumbersGridTicket', this.language), ":"), h("div", { class: "BulletContainer" }, h("lottery-grid", { "maximum-allowed": this.rules.maximumAllowed, "total-numbers": this.rules.totalNumbers, "selected-numbers": this.selection, selectable: false, "display-selected": true, language: this.language }))), h("div", { class: "DrawMultipler" }, h("label", { class: "Label" }, "Multiplier: ", h("span", null, JSON.stringify((_e = this.ticketData) === null || _e === void 0 ? void 0 : _e.multiplier)))), h("div", { class: "NumberOfDrawsContainer" }, h("p", null, translate('numberOfDraws', this.language), ": ", (_f = this.ticketData) === null || _f === void 0 ? void 0 :
|
|
168
|
+
_f.drawCount), h("div", { class: "DrawTicketsContainer" }, this.drawResults.map((item, index) => h("div", { class: "ExpandableBoxes" }, h("div", { class: this.toggleDrawer[index] ? 'ExpandableBox ShowBox' : 'ExpandableBox', onClick: () => this.changeBox(index) }, h("div", { class: "TicketResultContainer" }, h("p", null, translate('ticketResult', this.language), ": ", item.status)), item.state == 'won' &&
|
|
169
|
+
h("div", { class: "AmountWonContainer" }, h("p", null, translate('amountWon', this.language), ": ", Number(item.amount).toLocaleString('en'), " ", item.currency)), h("div", { class: "DrawIdContainer" }, h("p", null, translate('drawId', this.language), ": ", item.drawId)), h("div", { class: "DrawDateContainer" }, h("p", null, translate('drawDate', this.language), ": ", item.updatedAt.slice(0, 10), " | ", item.updatedAt.slice(11, 19))), h("div", { class: "DrawNumbersGrid" }), h("div", { class: "DrawMultipler" }, h("label", { class: "Label" }, "Multiplier: ", item.multiplier)))))))))
|
|
170
|
+
:
|
|
171
|
+
h("div", { class: "DrawResultsArea" }, this.drawData &&
|
|
172
|
+
h("div", null, h("div", { class: "DrawResultsHeader" }, h("span", null, translate('drawId', this.language), ": ", this.drawData.id), h("span", null, translate('drawDate', this.language), ": ", this.drawData.date.slice(0, 10))), h("div", { class: "DrawResultsBody" }, h("div", { class: "DrawNumbersGrid" }, h("p", null, translate('drawNumbersGridDraw', this.language), ":"), h("div", { class: "BulletContainer" }, h("lottery-grid", { "maximum-allowed": this.rules.maximumAllowed, "total-numbers": this.rules.totalNumbers, selectedNumbers: this.drawData.winningNumbers.join(','), "display-selected": true, selectable: false, language: this.language })), h("div", { class: "DrawMultipler" }, h("label", { class: "Label" }, "Multiplier: ", this.multiplier))))))));
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
static get style() { return lotteryDrawResultsCss; }
|
|
176
|
+
}, [1, "lottery-draw-results", {
|
|
177
|
+
"endpoint": [1],
|
|
178
|
+
"gameId": [1, "game-id"],
|
|
179
|
+
"language": [1],
|
|
180
|
+
"playerId": [1, "player-id"],
|
|
181
|
+
"drawMode": [4, "draw-mode"],
|
|
182
|
+
"drawId": [1, "draw-id"],
|
|
183
|
+
"gameName": [1, "game-name"],
|
|
184
|
+
"multiplier": [32],
|
|
185
|
+
"ticketData": [32],
|
|
186
|
+
"isLoading": [32],
|
|
187
|
+
"drawResults": [32],
|
|
188
|
+
"rules": [32],
|
|
189
|
+
"toggleDrawer": [32],
|
|
190
|
+
"hasErrors": [32],
|
|
191
|
+
"errorText": [32]
|
|
192
|
+
}]);
|
|
193
|
+
function defineCustomElement() {
|
|
194
|
+
if (typeof customElements === "undefined") {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
const components = ["lottery-draw-results", "lottery-bullet", "lottery-grid"];
|
|
198
|
+
components.forEach(tagName => { switch (tagName) {
|
|
199
|
+
case "lottery-draw-results":
|
|
200
|
+
if (!customElements.get(tagName)) {
|
|
201
|
+
customElements.define(tagName, LotteryDrawResults);
|
|
202
|
+
}
|
|
203
|
+
break;
|
|
204
|
+
case "lottery-bullet":
|
|
205
|
+
if (!customElements.get(tagName)) {
|
|
206
|
+
defineCustomElement$2();
|
|
207
|
+
}
|
|
208
|
+
break;
|
|
209
|
+
case "lottery-grid":
|
|
210
|
+
if (!customElements.get(tagName)) {
|
|
211
|
+
defineCustomElement$1();
|
|
212
|
+
}
|
|
213
|
+
break;
|
|
214
|
+
} });
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export { LotteryDrawResults as L, defineCustomElement as d };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$3 } from './helper-accordion2.js';
|
|
3
|
+
import { d as defineCustomElement$2 } from './helper-tab2.js';
|
|
4
|
+
import { d as defineCustomElement$1 } from './helper-tabs2.js';
|
|
5
|
+
|
|
6
|
+
const lotteryGameDetailsCss = ":host{display:block}";
|
|
7
|
+
|
|
8
|
+
const LotteryGameDetails = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
9
|
+
constructor() {
|
|
10
|
+
super();
|
|
11
|
+
this.__registerHost();
|
|
12
|
+
this.__attachShadow();
|
|
13
|
+
}
|
|
14
|
+
render() {
|
|
15
|
+
return (h("div", null, h("helper-accordion", { "header-title": "Game Details", collapsed: false }, h("div", { slot: "accordionContent" }, h("helper-tabs", null)))));
|
|
16
|
+
}
|
|
17
|
+
static get style() { return lotteryGameDetailsCss; }
|
|
18
|
+
}, [1, "lottery-game-details"]);
|
|
19
|
+
function defineCustomElement() {
|
|
20
|
+
if (typeof customElements === "undefined") {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const components = ["lottery-game-details", "helper-accordion", "helper-tab", "helper-tabs"];
|
|
24
|
+
components.forEach(tagName => { switch (tagName) {
|
|
25
|
+
case "lottery-game-details":
|
|
26
|
+
if (!customElements.get(tagName)) {
|
|
27
|
+
customElements.define(tagName, LotteryGameDetails);
|
|
28
|
+
}
|
|
29
|
+
break;
|
|
30
|
+
case "helper-accordion":
|
|
31
|
+
if (!customElements.get(tagName)) {
|
|
32
|
+
defineCustomElement$3();
|
|
33
|
+
}
|
|
34
|
+
break;
|
|
35
|
+
case "helper-tab":
|
|
36
|
+
if (!customElements.get(tagName)) {
|
|
37
|
+
defineCustomElement$2();
|
|
38
|
+
}
|
|
39
|
+
break;
|
|
40
|
+
case "helper-tabs":
|
|
41
|
+
if (!customElements.get(tagName)) {
|
|
42
|
+
defineCustomElement$1();
|
|
43
|
+
}
|
|
44
|
+
break;
|
|
45
|
+
} });
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { LotteryGameDetails as L, defineCustomElement as d };
|
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
-
import '
|
|
3
|
-
import '
|
|
4
|
-
import '
|
|
5
|
-
import '
|
|
6
|
-
import '
|
|
2
|
+
import { d as defineCustomElement$d } from './helper-accordion2.js';
|
|
3
|
+
import { d as defineCustomElement$c } from './helper-filters2.js';
|
|
4
|
+
import { d as defineCustomElement$b } from './helper-modal2.js';
|
|
5
|
+
import { d as defineCustomElement$a } from './helper-tab2.js';
|
|
6
|
+
import { d as defineCustomElement$9 } from './helper-tabs2.js';
|
|
7
|
+
import { d as defineCustomElement$8 } from './lottery-bullet2.js';
|
|
8
|
+
import { d as defineCustomElement$7 } from './lottery-draw-results2.js';
|
|
9
|
+
import { d as defineCustomElement$6 } from './lottery-draw-results-history2.js';
|
|
10
|
+
import { d as defineCustomElement$5 } from './lottery-game-details2.js';
|
|
11
|
+
import { d as defineCustomElement$4 } from './lottery-grid2.js';
|
|
12
|
+
import { d as defineCustomElement$3 } from './lottery-ticket2.js';
|
|
13
|
+
import { d as defineCustomElement$2 } from './lottery-ticket-controller2.js';
|
|
7
14
|
|
|
8
15
|
const DEFAULT_LANGUAGE = 'en';
|
|
9
16
|
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
@@ -324,13 +331,73 @@ function defineCustomElement$1() {
|
|
|
324
331
|
if (typeof customElements === "undefined") {
|
|
325
332
|
return;
|
|
326
333
|
}
|
|
327
|
-
const components = ["lottery-game-page"];
|
|
334
|
+
const components = ["lottery-game-page", "helper-accordion", "helper-filters", "helper-modal", "helper-tab", "helper-tabs", "lottery-bullet", "lottery-draw-results", "lottery-draw-results-history", "lottery-game-details", "lottery-grid", "lottery-ticket", "lottery-ticket-controller"];
|
|
328
335
|
components.forEach(tagName => { switch (tagName) {
|
|
329
336
|
case "lottery-game-page":
|
|
330
337
|
if (!customElements.get(tagName)) {
|
|
331
338
|
customElements.define(tagName, LotteryGamePage$1);
|
|
332
339
|
}
|
|
333
340
|
break;
|
|
341
|
+
case "helper-accordion":
|
|
342
|
+
if (!customElements.get(tagName)) {
|
|
343
|
+
defineCustomElement$d();
|
|
344
|
+
}
|
|
345
|
+
break;
|
|
346
|
+
case "helper-filters":
|
|
347
|
+
if (!customElements.get(tagName)) {
|
|
348
|
+
defineCustomElement$c();
|
|
349
|
+
}
|
|
350
|
+
break;
|
|
351
|
+
case "helper-modal":
|
|
352
|
+
if (!customElements.get(tagName)) {
|
|
353
|
+
defineCustomElement$b();
|
|
354
|
+
}
|
|
355
|
+
break;
|
|
356
|
+
case "helper-tab":
|
|
357
|
+
if (!customElements.get(tagName)) {
|
|
358
|
+
defineCustomElement$a();
|
|
359
|
+
}
|
|
360
|
+
break;
|
|
361
|
+
case "helper-tabs":
|
|
362
|
+
if (!customElements.get(tagName)) {
|
|
363
|
+
defineCustomElement$9();
|
|
364
|
+
}
|
|
365
|
+
break;
|
|
366
|
+
case "lottery-bullet":
|
|
367
|
+
if (!customElements.get(tagName)) {
|
|
368
|
+
defineCustomElement$8();
|
|
369
|
+
}
|
|
370
|
+
break;
|
|
371
|
+
case "lottery-draw-results":
|
|
372
|
+
if (!customElements.get(tagName)) {
|
|
373
|
+
defineCustomElement$7();
|
|
374
|
+
}
|
|
375
|
+
break;
|
|
376
|
+
case "lottery-draw-results-history":
|
|
377
|
+
if (!customElements.get(tagName)) {
|
|
378
|
+
defineCustomElement$6();
|
|
379
|
+
}
|
|
380
|
+
break;
|
|
381
|
+
case "lottery-game-details":
|
|
382
|
+
if (!customElements.get(tagName)) {
|
|
383
|
+
defineCustomElement$5();
|
|
384
|
+
}
|
|
385
|
+
break;
|
|
386
|
+
case "lottery-grid":
|
|
387
|
+
if (!customElements.get(tagName)) {
|
|
388
|
+
defineCustomElement$4();
|
|
389
|
+
}
|
|
390
|
+
break;
|
|
391
|
+
case "lottery-ticket":
|
|
392
|
+
if (!customElements.get(tagName)) {
|
|
393
|
+
defineCustomElement$3();
|
|
394
|
+
}
|
|
395
|
+
break;
|
|
396
|
+
case "lottery-ticket-controller":
|
|
397
|
+
if (!customElements.get(tagName)) {
|
|
398
|
+
defineCustomElement$2();
|
|
399
|
+
}
|
|
400
|
+
break;
|
|
334
401
|
} });
|
|
335
402
|
}
|
|
336
403
|
|