@everymatrix/lottery-game-page 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index-af6d701d.js +1209 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +21 -0
- package/dist/cjs/lottery-game-page.cjs.entry.js +304 -0
- package/dist/cjs/lottery-game-page.cjs.js +19 -0
- package/dist/collection/collection-manifest.json +12 -0
- package/dist/collection/components/lottery-game-page/lottery-game-page.css +305 -0
- package/dist/collection/components/lottery-game-page/lottery-game-page.js +496 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/locale.utils.js +50 -0
- package/dist/collection/utils/utils.js +12 -0
- package/dist/components/assets/chrono_desktop.png +0 -0
- package/dist/components/assets/chrono_lottery_mobile.png +0 -0
- package/dist/components/index.d.ts +22 -0
- package/dist/components/index.js +2 -0
- package/dist/components/lottery-game-page.d.ts +11 -0
- package/dist/components/lottery-game-page.js +340 -0
- package/dist/esm/index-8c700c5e.js +1183 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +17 -0
- package/dist/esm/lottery-game-page.entry.js +300 -0
- package/dist/esm/lottery-game-page.js +17 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/lottery-game-page/index.esm.js +0 -0
- package/dist/lottery-game-page/lottery-game-page.esm.js +1 -0
- package/dist/lottery-game-page/p-453db7fa.entry.js +1 -0
- package/dist/lottery-game-page/p-b5969eab.js +2 -0
- package/dist/stencil.config.js +29 -0
- package/dist/types/Users/user/workspace/everymatrix/widgets-stencil/packages/lottery-game-page/.stencil/packages/lottery-game-page/stencil.config.d.ts +2 -0
- package/dist/types/components/lottery-game-page/lottery-game-page.d.ts +74 -0
- package/dist/types/components.d.ts +93 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1565 -0
- package/dist/types/utils/locale.utils.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +7 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +12 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +10 -0
- package/package.json +1 -1
- package/LICENSE +0 -21
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h } from '@stencil/core/internal/client';
|
|
2
|
+
import '@everymatrix/lottery-ticket-controller';
|
|
3
|
+
import '@everymatrix/helper-modal';
|
|
4
|
+
import '@everymatrix/lottery-game-details';
|
|
5
|
+
import '@everymatrix/lottery-draw-results-history';
|
|
6
|
+
import '@everymatrix/lottery-draw-results';
|
|
7
|
+
|
|
8
|
+
const DEFAULT_LANGUAGE = 'en';
|
|
9
|
+
const SUPPORTED_LANGUAGES = ['ro', 'en'];
|
|
10
|
+
const TRANSLATIONS = {
|
|
11
|
+
en: {
|
|
12
|
+
error: 'Error',
|
|
13
|
+
title: 'Chrono',
|
|
14
|
+
backButton: 'Back',
|
|
15
|
+
lobbyButton: 'Lobby',
|
|
16
|
+
prize: 'Prize',
|
|
17
|
+
winUpTo: 'Win up to',
|
|
18
|
+
nextDraw: 'Next draw in: ',
|
|
19
|
+
buy: 'Buy tickets',
|
|
20
|
+
viewLatest: 'View latest results',
|
|
21
|
+
createTicket: 'Create Ticket',
|
|
22
|
+
modalSuccess: 'Purchase will be successfull soon!',
|
|
23
|
+
deleteTicketModalTitle: 'Delete Ticket',
|
|
24
|
+
deleteTicketModalText: 'Are you sure you want to delete this ticket?',
|
|
25
|
+
deleteTicketModalCancel: 'Cancel',
|
|
26
|
+
deleteTicketModalConfirm: 'Delete',
|
|
27
|
+
orderSummaryTitle: 'Order Summary',
|
|
28
|
+
orderSummaryTickets: 'Ticket',
|
|
29
|
+
orderSummaryTotal: 'Total',
|
|
30
|
+
orderSummarySubmit: 'Submit'
|
|
31
|
+
},
|
|
32
|
+
ro: {
|
|
33
|
+
error: 'Eroare',
|
|
34
|
+
title: 'Loto 6/49',
|
|
35
|
+
backButton: 'Inapoi',
|
|
36
|
+
lobbyButton: 'Lobby',
|
|
37
|
+
prize: 'MARELE JACKPOT OMG',
|
|
38
|
+
winUpTo: 'Castiga pana la',
|
|
39
|
+
nextDraw: 'In cat timp devii milionar daca cumperi acum!!!',
|
|
40
|
+
buy: 'Cumpara bilet',
|
|
41
|
+
viewLatest: 'Ultimile extrageri',
|
|
42
|
+
createTicket: 'Creeaza bilet',
|
|
43
|
+
modalSuccess: 'Achiziția va avea succes în curând!',
|
|
44
|
+
deleteTicketModalTitle: 'Sterge biletul',
|
|
45
|
+
deleteTicketModalText: 'Esti sigur ca vrei sa stergi acest bilet?',
|
|
46
|
+
deleteTicketModalCancel: 'Anuleaza',
|
|
47
|
+
deleteTicketModalConfirm: 'Sterge',
|
|
48
|
+
orderSummaryTitle: 'Rezumat comanda',
|
|
49
|
+
orderSummaryTickets: 'Bilet',
|
|
50
|
+
orderSummaryTotal: 'Total',
|
|
51
|
+
orderSummarySubmit: 'Trimite'
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
const translate = (key, customLang) => {
|
|
55
|
+
const lang = customLang;
|
|
56
|
+
return TRANSLATIONS[lang !== undefined && SUPPORTED_LANGUAGES.includes(lang) ? lang : DEFAULT_LANGUAGE][key];
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const lotteryGamePageCss = "@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:#00958f;font-size:18px;display:flex;flex-direction:column;justify-content:center;align-items:center;gap:10px}.GamePage .TotalWinnings span{font-size:22px;font-weight:700}.GamePage .NextDraw{color:#00958f;font-size:24px;font-weight:600;margin:0 auto;text-align:center;text-transform:capitalize;display:flex;justify-content:center;align-items:center;flex-direction:column}.GamePage .NextDraw .BannerText{font-weight:400;font-size:18px}.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:#F1F1F1;color:#000;font-size:12px;transition:all 0.2s linear;text-transform:uppercase;text-align:center;letter-spacing:0}.GamePage .Tabs .TabButton.Active{background:#00958f;color:#FFF}.NextDrawWrapper{padding:10px 15px;background:#fff}.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:10px 15px;max-width:1200px;margin:0 auto}.GameDetails{padding-bottom:10px;margin-bottom:20px;border-bottom:1px solid #e9e9e9}.CreateNewTicket{background:#004D4A;height:100px;width:100%;display:flex;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}.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%}}";
|
|
60
|
+
|
|
61
|
+
const LotteryGamePage$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
62
|
+
constructor() {
|
|
63
|
+
super();
|
|
64
|
+
this.__registerHost();
|
|
65
|
+
this.__attachShadow();
|
|
66
|
+
/**
|
|
67
|
+
* Language of the widget
|
|
68
|
+
*/
|
|
69
|
+
this.language = 'en';
|
|
70
|
+
/**
|
|
71
|
+
* Shows the auto-pick button
|
|
72
|
+
*/
|
|
73
|
+
this.autoPick = false;
|
|
74
|
+
/**
|
|
75
|
+
* Shows the reset button
|
|
76
|
+
*/
|
|
77
|
+
this.resetButton = false;
|
|
78
|
+
this.tickets = [];
|
|
79
|
+
this.tabIndex = 0;
|
|
80
|
+
this.hasErrors = false;
|
|
81
|
+
this.totalAmount = 0;
|
|
82
|
+
this.successVisible = false;
|
|
83
|
+
this.deleteVisible = false;
|
|
84
|
+
this.latestDraw = {};
|
|
85
|
+
this.totalWinningsAmount = 0;
|
|
86
|
+
this.multiplier = false;
|
|
87
|
+
this.quickPick = false;
|
|
88
|
+
}
|
|
89
|
+
// @TODO fix `any` type later, I'm lazy now
|
|
90
|
+
connectedCallback() {
|
|
91
|
+
this.getGameDetails();
|
|
92
|
+
this.getDraws();
|
|
93
|
+
}
|
|
94
|
+
countdownLogic(date) {
|
|
95
|
+
this.interval = setInterval(() => {
|
|
96
|
+
this.daysRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60 * 24));
|
|
97
|
+
this.hoursRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60 * 60) - this.daysRemaining * 24);
|
|
98
|
+
this.minutesRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / (1000 * 60) - this.daysRemaining * 24 * 60 - this.hoursRemaining * 60);
|
|
99
|
+
this.secondsRemaining = Math.floor((Date.parse(date) - new Date().getTime()) / 1000 - this.daysRemaining * 24 * 60 * 60 - this.hoursRemaining * 60 * 60 - this.minutesRemaining * 60);
|
|
100
|
+
}, 1000);
|
|
101
|
+
}
|
|
102
|
+
disconnectedCallback() {
|
|
103
|
+
clearInterval(this.interval);
|
|
104
|
+
}
|
|
105
|
+
getGameDetails() {
|
|
106
|
+
let url = new URL(`${this.endpoint}/games/${this.gameId}`);
|
|
107
|
+
fetch(url.href)
|
|
108
|
+
.then((res) => {
|
|
109
|
+
if (res.status >= 300) {
|
|
110
|
+
this.hasErrors = true;
|
|
111
|
+
throw new Error('There was an error while fetching the data');
|
|
112
|
+
}
|
|
113
|
+
return res.json();
|
|
114
|
+
})
|
|
115
|
+
.then((data) => {
|
|
116
|
+
this.gameData = data;
|
|
117
|
+
this.basicStake = this.gameData.rules.stakes[0].amount;
|
|
118
|
+
let draws = this.gameData.draws.filter((item) => !item.winningNumbers);
|
|
119
|
+
console.log('draws', draws);
|
|
120
|
+
this.nextDraw = draws[0].id;
|
|
121
|
+
this.createNewTicket();
|
|
122
|
+
})
|
|
123
|
+
.catch((err) => {
|
|
124
|
+
this.hasErrors = true;
|
|
125
|
+
console.log('Error', err);
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
calculateTotalAmount() {
|
|
129
|
+
const { currency } = this.gameData.rules.stakes[0];
|
|
130
|
+
this.totalAmount = 0;
|
|
131
|
+
this.tickets.forEach((item) => {
|
|
132
|
+
if (item.completed) {
|
|
133
|
+
this.totalAmount += item.amount * item.stake;
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
this.currency = currency;
|
|
137
|
+
}
|
|
138
|
+
// @TODO CustomEvent type
|
|
139
|
+
gridFilledHandler(event) {
|
|
140
|
+
// @TODO item ts
|
|
141
|
+
this.tickets = this.tickets.map((item) => {
|
|
142
|
+
if (item.ticketId == event.detail.id) {
|
|
143
|
+
let arr = item.selectedNumbers || [];
|
|
144
|
+
arr[event.detail.index] = event.detail.selectedNumbers.map((item) => parseInt(item, 10));
|
|
145
|
+
return {
|
|
146
|
+
gameId: item.gameId,
|
|
147
|
+
ticketId: item.ticketId,
|
|
148
|
+
completed: true,
|
|
149
|
+
amount: event.detail.draws,
|
|
150
|
+
stake: item.stake,
|
|
151
|
+
selectedNumbers: arr
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
return item;
|
|
155
|
+
});
|
|
156
|
+
this.calculateTotalAmount();
|
|
157
|
+
}
|
|
158
|
+
// @TODO fix any type
|
|
159
|
+
gridDirtyHandler(event) {
|
|
160
|
+
// @TODO item ts
|
|
161
|
+
this.tickets = this.tickets.map((item) => {
|
|
162
|
+
if (item.gameId == event.detail.id) {
|
|
163
|
+
return {
|
|
164
|
+
gameId: item.gameId,
|
|
165
|
+
ticketId: item.ticketId,
|
|
166
|
+
completed: false,
|
|
167
|
+
amount: item.amount,
|
|
168
|
+
stake: item.stake,
|
|
169
|
+
grids: []
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
return item;
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
// @TODO CustomEvent type
|
|
176
|
+
deleteTicketHandler(event) {
|
|
177
|
+
this.deleteVisible = true;
|
|
178
|
+
this.deleteEventData = event;
|
|
179
|
+
}
|
|
180
|
+
modalCloseEvent() {
|
|
181
|
+
this.deleteVisible = false;
|
|
182
|
+
}
|
|
183
|
+
stakeChangeHandler(event) {
|
|
184
|
+
const { ticketId, stake } = event.detail;
|
|
185
|
+
this.tickets[ticketId - 1].stake = stake;
|
|
186
|
+
this.calculateTotalAmount();
|
|
187
|
+
}
|
|
188
|
+
multiplierChangeHandler(event) {
|
|
189
|
+
this.multiplier = event.detail;
|
|
190
|
+
}
|
|
191
|
+
getDraws() {
|
|
192
|
+
// append from query param with the current date value in order to get the next draw
|
|
193
|
+
let url = new URL(`${this.endpoint}/games/${this.gameId}/draws`);
|
|
194
|
+
let drawOptions = {
|
|
195
|
+
method: "GET",
|
|
196
|
+
headers: {
|
|
197
|
+
'Content-Type': "application/json",
|
|
198
|
+
'Accept': 'application/json',
|
|
199
|
+
},
|
|
200
|
+
};
|
|
201
|
+
fetch(url.href, drawOptions)
|
|
202
|
+
.then((response) => {
|
|
203
|
+
return response.json();
|
|
204
|
+
})
|
|
205
|
+
.then((data) => {
|
|
206
|
+
var _a;
|
|
207
|
+
let upcoming = data.items.filter((item) => {
|
|
208
|
+
if (Date.parse(item.date) > new Date().getTime()) {
|
|
209
|
+
return !item.winningNumbers;
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
let past = data.items.filter((item) => item.winningNumbers);
|
|
213
|
+
this.latestDraw = upcoming[0];
|
|
214
|
+
this.nextDate = this.latestDraw.date;
|
|
215
|
+
this.countdownLogic(this.nextDate);
|
|
216
|
+
this.lastDrawId = past[past.length - 1].id;
|
|
217
|
+
// calculate total winnings
|
|
218
|
+
// @TODO fix any type
|
|
219
|
+
(_a = this.latestDraw) === null || _a === void 0 ? void 0 : _a.prizes.forEach((element) => {
|
|
220
|
+
this.totalWinningsAmount += JSON.parse(element.amount);
|
|
221
|
+
});
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
;
|
|
225
|
+
// @TODO fix any type
|
|
226
|
+
confirmDeleteTicketHandler(event) {
|
|
227
|
+
// @TODO fix any type
|
|
228
|
+
this.tickets = this.tickets.filter((item) => {
|
|
229
|
+
if (item.ticketId == event.detail.ticketId) {
|
|
230
|
+
return false;
|
|
231
|
+
}
|
|
232
|
+
return true;
|
|
233
|
+
});
|
|
234
|
+
this.calculateTotalAmount();
|
|
235
|
+
this.deleteVisible = false;
|
|
236
|
+
}
|
|
237
|
+
createNewTicket() {
|
|
238
|
+
this.tickets = [
|
|
239
|
+
...this.tickets,
|
|
240
|
+
{ gameId: this.gameId, ticketId: this.tickets.length + 1, completed: false, amount: 1, stake: this.basicStake, grids: [] }
|
|
241
|
+
];
|
|
242
|
+
}
|
|
243
|
+
submitTickets() {
|
|
244
|
+
let url = new URL(`${this.endpoint}/tickets`);
|
|
245
|
+
// @TODO Body TS type
|
|
246
|
+
let body = {
|
|
247
|
+
gameId: this.gameId,
|
|
248
|
+
tickets: []
|
|
249
|
+
};
|
|
250
|
+
console.log('body', body);
|
|
251
|
+
this.tickets.forEach((item) => {
|
|
252
|
+
body.tickets.push({
|
|
253
|
+
startingDrawId: this.nextDraw,
|
|
254
|
+
amount: item.stake,
|
|
255
|
+
gameId: this.gameId,
|
|
256
|
+
currency: this.currency,
|
|
257
|
+
selection: item.selectedNumbers,
|
|
258
|
+
multiplier: this.multiplier,
|
|
259
|
+
drawCount: item.amount,
|
|
260
|
+
quickPick: this.quickPick,
|
|
261
|
+
});
|
|
262
|
+
});
|
|
263
|
+
// @TODO Options TS type
|
|
264
|
+
let options = {
|
|
265
|
+
method: 'POST',
|
|
266
|
+
headers: {
|
|
267
|
+
'Content-Type': 'application/json',
|
|
268
|
+
'Accept': 'application/json',
|
|
269
|
+
'Authorization': `Bearer ${this.sessionId}`
|
|
270
|
+
},
|
|
271
|
+
body: JSON.stringify(body)
|
|
272
|
+
};
|
|
273
|
+
fetch(url.href, options)
|
|
274
|
+
.then((res) => {
|
|
275
|
+
if (res.status > 300) {
|
|
276
|
+
throw new Error('err');
|
|
277
|
+
}
|
|
278
|
+
return res.json();
|
|
279
|
+
})
|
|
280
|
+
.then((data) => {
|
|
281
|
+
console.log('data', data);
|
|
282
|
+
});
|
|
283
|
+
this.successVisible = true;
|
|
284
|
+
}
|
|
285
|
+
render() {
|
|
286
|
+
// const backgroundSrc = getAssetPath('./static/chrono_lottery_mobile.png');
|
|
287
|
+
// const backgroundDesktopSrc = getAssetPath('./static/chrono_desktop.png');
|
|
288
|
+
if (this.hasErrors) {
|
|
289
|
+
return (h("div", { class: "GamePage" }, h("div", { class: "Title" }, translate('error', this.language))));
|
|
290
|
+
}
|
|
291
|
+
return (
|
|
292
|
+
/* Game details */
|
|
293
|
+
h("div", { class: "GamePage" }, h("div", { class: "GridBanner" }, h("div", { class: "BannerButtonsWrapper" }, h("button", { class: "BannerBackButton" }, h("span", { class: "BannerBackButtonArrow" }, "\u1438 "), translate('backButton', this.language)), h("button", { class: "BannerLobbyButton" }, translate('lobbyButton', this.language))), h("div", { class: "Tabs" }, h("div", { class: 'TabButton' + (this.tabIndex == 0 ? ' Active' : ''), onClick: () => this.tabIndex = 0 }, translate('buy', this.language)), h("div", { class: 'TabButton' + (this.tabIndex == 1 ? ' Active' : ''), onClick: () => this.tabIndex = 1 }, translate('viewLatest', this.language)))), h("div", { class: "NextDrawWrapper" }, h("div", { class: "TotalWinnings" }, translate('winUpTo', this.language), ": ", h("span", null, "$", this.totalWinningsAmount.toLocaleString('en-US', { maximumFractionDigits: 2 }))), h("div", { class: "NextDraw" }, h("p", { class: "BannerText" }, translate('nextDraw', this.language)), h("div", { class: "BannerCountdown" }, h("span", { class: "CountdownDays" }, this.daysRemaining, "D"), h("span", { class: "CountdownHours" }, this.hoursRemaining, "H"), h("span", { class: "CountdownMinutes" }, this.minutesRemaining, "M"), h("span", { class: "CountdownSeconds" }, this.secondsRemaining, "S")))), this.tabIndex == 0 &&
|
|
294
|
+
h("div", { class: "GamePageContent" }, h("div", { class: "GameDetails" }, h("lottery-game-details", null)), h("div", { class: "TicketsWrapper" }, this.tickets.map((item) => h("lottery-ticket-controller", { endpoint: this.endpoint, "ticket-id": item.ticketId, "game-id": item.gameId, collapsed: false, last: true, language: this.language, "auto-pick": this.autoPick, "reset-button": this.resetButton })), h("div", { class: "CreateNewTicket" }, h("button", { onClick: () => this.createNewTicket() }, "+"), h("span", null, translate('createTicket', this.language)))), h("div", { class: "OrderSummary" }, h("h3", { class: "OrderSummaryTitle" }, translate('orderSummaryTitle', this.language)), h("div", { class: "Ticket" }, translate('orderSummaryTickets', this.language), ": ", h("span", null, this.tickets.length)), h("div", { class: "Total" }, translate('orderSummaryTotal', this.language), ": ", h("span", null, this.totalAmount, " ", this.currency)), h("div", { class: "ButtonWrapper" }, h("span", { class: "Button", onClick: () => this.submitTickets() }, translate('orderSummarySubmit', this.language))))), this.tabIndex == 1 &&
|
|
295
|
+
h("div", null, h("lottery-draw-results", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language, "draw-id": this.lastDrawId, "draw-mode": true }), h("lottery-draw-results-history", { endpoint: this.endpoint, "game-id": this.gameId, language: this.language })), h("helper-modal", { "title-modal": "Success", visible: this.successVisible }, h("p", { class: "SubmitModalSuccess" }, translate('modalSuccess', this.language))), h("helper-modal", { "title-modal": "Delete Ticket", visible: this.deleteVisible }, 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)))))));
|
|
296
|
+
}
|
|
297
|
+
static get assetsDirs() { return ["static"]; }
|
|
298
|
+
get element() { return this; }
|
|
299
|
+
static get style() { return lotteryGamePageCss; }
|
|
300
|
+
}, [1, "lottery-game-page", {
|
|
301
|
+
"endpoint": [1],
|
|
302
|
+
"gameId": [1, "game-id"],
|
|
303
|
+
"playerId": [2, "player-id"],
|
|
304
|
+
"sessionId": [1, "session-id"],
|
|
305
|
+
"language": [1],
|
|
306
|
+
"autoPick": [4, "auto-pick"],
|
|
307
|
+
"resetButton": [4, "reset-button"],
|
|
308
|
+
"tickets": [32],
|
|
309
|
+
"tabIndex": [32],
|
|
310
|
+
"hasErrors": [32],
|
|
311
|
+
"totalAmount": [32],
|
|
312
|
+
"successVisible": [32],
|
|
313
|
+
"deleteVisible": [32],
|
|
314
|
+
"deleteEventData": [32],
|
|
315
|
+
"daysRemaining": [32],
|
|
316
|
+
"hoursRemaining": [32],
|
|
317
|
+
"minutesRemaining": [32],
|
|
318
|
+
"secondsRemaining": [32],
|
|
319
|
+
"latestDraw": [32],
|
|
320
|
+
"totalWinningsAmount": [32],
|
|
321
|
+
"nextDate": [32]
|
|
322
|
+
}, [[0, "ticketCompleted", "gridFilledHandler"], [0, "gridDirty", "gridDirtyHandler"], [0, "deleteTicket", "deleteTicketHandler"], [0, "modalCloseEvent", "modalCloseEvent"], [0, "stakeChange", "stakeChangeHandler"], [0, "multiplierChange", "multiplierChangeHandler"]]]);
|
|
323
|
+
function defineCustomElement$1() {
|
|
324
|
+
if (typeof customElements === "undefined") {
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
const components = ["lottery-game-page"];
|
|
328
|
+
components.forEach(tagName => { switch (tagName) {
|
|
329
|
+
case "lottery-game-page":
|
|
330
|
+
if (!customElements.get(tagName)) {
|
|
331
|
+
customElements.define(tagName, LotteryGamePage$1);
|
|
332
|
+
}
|
|
333
|
+
break;
|
|
334
|
+
} });
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
const LotteryGamePage = LotteryGamePage$1;
|
|
338
|
+
const defineCustomElement = defineCustomElement$1;
|
|
339
|
+
|
|
340
|
+
export { LotteryGamePage, defineCustomElement };
|