@everymatrix/lottery-hakuna-ticket-buy 0.0.3 → 1.87.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +1 -1
- package/dist/cjs/lottery-button_7.cjs.entry.js +13 -6
- package/dist/cjs/{lottery-hakuna-ticket-buy-fe6a420c.js → lottery-hakuna-ticket-buy-e7ddee9f.js} +12 -5
- package/dist/collection/components/lottery-hakuna-ticket-buy/lottery-hakuna-ticket-buy.css +9 -2
- package/dist/collection/components/lottery-hakuna-ticket-buy/lottery-hakuna-ticket-buy.js +20 -2
- package/dist/collection/utils/locale.utils.js +5 -2
- package/dist/esm/index.js +1 -1
- package/dist/esm/lottery-button_7.entry.js +14 -7
- package/dist/esm/{lottery-hakuna-ticket-buy-a9f8e014.js → lottery-hakuna-ticket-buy-e97eb8d9.js} +12 -5
- package/dist/lottery-hakuna-ticket-buy/index.esm.js +1 -1
- package/dist/lottery-hakuna-ticket-buy/lottery-button_7.entry.js +1 -1
- package/dist/lottery-hakuna-ticket-buy/lottery-hakuna-ticket-buy-e97eb8d9.js +1 -0
- package/dist/types/components/lottery-hakuna-ticket-buy/lottery-hakuna-ticket-buy.d.ts +2 -0
- package/dist/types/components.d.ts +2 -0
- package/package.json +1 -1
- package/dist/lottery-hakuna-ticket-buy/lottery-hakuna-ticket-buy-a9f8e014.js +0 -1
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const lotteryHakunaTicketBuy = require('./lottery-hakuna-ticket-buy-
|
|
5
|
+
const lotteryHakunaTicketBuy = require('./lottery-hakuna-ticket-buy-e7ddee9f.js');
|
|
6
6
|
require('./index-f1909c9b.js');
|
|
7
7
|
|
|
8
8
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-f1909c9b.js');
|
|
6
|
-
const lotteryHakunaTicketBuy = require('./lottery-hakuna-ticket-buy-
|
|
6
|
+
const lotteryHakunaTicketBuy = require('./lottery-hakuna-ticket-buy-e7ddee9f.js');
|
|
7
7
|
|
|
8
8
|
const DEFAULT_LANGUAGE$3 = 'en';
|
|
9
9
|
const SUPPORTED_LANGUAGES$3 = ['ro', 'en', 'fr', 'ar', 'hr', 'zh'];
|
|
@@ -253,7 +253,8 @@ const TRANSLATIONS$2 = {
|
|
|
253
253
|
loading: 'Loading, please wait ...',
|
|
254
254
|
error: 'It was an error while trying to fetch the data',
|
|
255
255
|
quickPick: 'Quick Pick',
|
|
256
|
-
submit: 'SUBMIT'
|
|
256
|
+
submit: 'SUBMIT',
|
|
257
|
+
pickNumbers: 'Pick {num} Numbers'
|
|
257
258
|
},
|
|
258
259
|
ro: {
|
|
259
260
|
loading: 'Se incarca, va rugam asteptati ...',
|
|
@@ -304,9 +305,15 @@ const TRANSLATIONS$2 = {
|
|
|
304
305
|
playType: 'Select one play type you want to buy'
|
|
305
306
|
}
|
|
306
307
|
};
|
|
307
|
-
const translate$2 = (key, customLang) => {
|
|
308
|
+
const translate$2 = (key, customLang, replacements) => {
|
|
308
309
|
const lang = customLang;
|
|
309
|
-
|
|
310
|
+
let translation = TRANSLATIONS$2[lang !== undefined && SUPPORTED_LANGUAGES$2.includes(lang) ? lang : DEFAULT_LANGUAGE$2][key];
|
|
311
|
+
if (replacements) {
|
|
312
|
+
Object.keys(replacements).forEach((placeholder) => {
|
|
313
|
+
translation = translation.replace(`{${placeholder}}`, replacements[placeholder]);
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
return translation;
|
|
310
317
|
};
|
|
311
318
|
const getTranslations$2 = (data) => {
|
|
312
319
|
Object.keys(data).forEach((item) => {
|
|
@@ -506,7 +513,7 @@ const LotteryHakunaTicket = class {
|
|
|
506
513
|
return (index.h("div", { class: "hakuna-ticket-content" }, this.grids.map((item, index$1) => {
|
|
507
514
|
const isGridEmpty = !item.selection;
|
|
508
515
|
const selectedCount = item.selection ? item.selection.split(',').filter(Boolean).length : 0;
|
|
509
|
-
return (index.h("div", null, index.h("div", { class: "hakuna-ticket-content-selection" }, index.h("div", { class: "hakuna-ticket-content-selection-text" },
|
|
516
|
+
return (index.h("div", null, index.h("div", { class: "hakuna-ticket-content-selection" }, index.h("div", { class: "hakuna-ticket-content-selection-text" }, translate$2('pickNumbers', this.language, { num: curAllowedSelectionNum }), ' '), index.h("div", { class: "hakuna-ticket-content-selection-dots" }, Array.from({ length: curAllowedSelectionNum }, (_, i) => i + 1).map((dotIndex) => (index.h("div", { key: dotIndex, class: {
|
|
510
517
|
'hakuna-ticket-content-selection-dots-item': true,
|
|
511
518
|
active: dotIndex <= selectedCount
|
|
512
519
|
} }))))), index.h("div", { class: { 'hakuna-ticket-content-bullets': true, disabled: this.isSubmitted } }, index.h("lottery-selection-group", { type: "bet", hasBorder: false, bulletTexts: item.bulletTexts, selectionGroupId: `${item.groupIdx}-${this.MAIN_SELECTION_NAME}`, "selected-bullet-texts": item.selection, maxSelectedCount: curAllowedSelectionNum, language: this.language, "translation-url": this.translationUrl, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource })), index.h("div", { class: "hakuna-ticket-content-operation", style: { display: 'flex', alignItems: 'center' } }, index.h("div", { class: "hakuna-ticket-content-operation--left" }, index.h("div", { class: { 'icon-btn': true, disabled: isGridEmpty || this.isSubmitted }, onClick: () => !isGridEmpty && this.toggleResetSelection(index$1) }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M0.833374 9.99996C0.833374 5.39759 4.56433 1.66663 9.16671 1.66663C11.4687 1.66663 13.554 2.60112 15.0613 4.10944C15.5943 4.64284 16.1651 5.30202 16.6667 5.91199V3.33329C16.6667 2.87306 17.0398 2.49996 17.5 2.49996C17.9603 2.49996 18.3334 2.87306 18.3334 3.33329V8.33329C18.3334 8.79353 17.9603 9.16663 17.5 9.16663H12.5C12.0398 9.16663 11.6667 8.79353 11.6667 8.33329C11.6667 7.87306 12.0398 7.49996 12.5 7.49996H15.8077C15.2309 6.77602 14.5138 5.91942 13.8824 5.28755C12.6749 4.07924 11.0087 3.33329 9.16671 3.33329C5.48481 3.33329 2.50004 6.31806 2.50004 9.99996C2.50004 13.6819 5.48481 16.6666 9.16671 16.6666C12.2048 16.6666 14.7703 14.6337 15.5729 11.8523C15.7005 11.4101 16.1624 11.155 16.6046 11.2826C17.0468 11.4102 17.3018 11.8721 17.1742 12.3143C16.1713 15.79 12.9671 18.3333 9.16671 18.3333C4.56433 18.3333 0.833374 14.6023 0.833374 9.99996Z", fill: "currentColor" })))), index.h("div", { class: "hakuna-ticket-content-operation--right" }, this.allowQuickPick && (index.h("lottery-button", { variant: "outline", color: "var(--emw-hakuna-color-primary, #C52217)", size: "small", onClick: this.toggleAutoSelection.bind(this, index$1), disabled: this.isSubmitted }, index.h("span", { slot: "icon-left" }, index.h("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.81557 0.631525C8.05311 0.734641 8.19424 0.982014 8.16212 1.23897L7.66075 5.24995L11.2745 5.24995C11.4151 5.24992 11.5575 5.2499 11.6738 5.26043C11.7838 5.27039 11.9945 5.29674 12.1772 5.44439C12.3864 5.61342 12.5062 5.86924 12.5021 6.13814C12.4986 6.37303 12.384 6.55174 12.3212 6.64264C12.2548 6.73875 12.1636 6.84811 12.0736 6.95609L6.86476 13.2067C6.69898 13.4057 6.42189 13.4715 6.18435 13.3684C5.94681 13.2653 5.80568 13.0179 5.8378 12.7609L6.33917 8.74995L2.72543 8.74995C2.58485 8.74998 2.44246 8.75001 2.32613 8.73947C2.21611 8.72951 2.00543 8.70316 1.82272 8.55551C1.61355 8.38648 1.49373 8.13066 1.49778 7.86176C1.50132 7.62688 1.61595 7.44816 1.67873 7.35726C1.74512 7.26115 1.8363 7.15177 1.92632 7.04379C1.93078 7.03844 1.93523 7.0331 1.93968 7.02776L7.13516 0.793177C7.30094 0.59424 7.57803 0.52841 7.81557 0.631525ZM2.9954 7.58328H6.99996C7.16728 7.58328 7.32654 7.65513 7.43727 7.78057C7.548 7.906 7.59954 8.07295 7.57879 8.23897L7.24224 10.9314L11.0045 6.41662H6.99996C6.83264 6.41662 6.67338 6.34477 6.56265 6.21934C6.45192 6.0939 6.40038 5.92696 6.42113 5.76093L6.75768 3.06855L2.9954 7.58328Z", fill: "white" }))), index.h("span", { style: { color: '#fff' } }, translate$2('quickPick', this.language)))), index.h("lottery-button", { variant: "primary", color: "var(--emw-hakuna-color-primary, #C52217)", size: "small", text: translate$2('submit', this.language), disabled: !this.ticketDone[index$1] || this.isSubmitted, onClick: this.handleSaveTicket.bind(this) })))));
|
|
@@ -546,7 +553,7 @@ const LotteryHakunaTicket = class {
|
|
|
546
553
|
})));
|
|
547
554
|
}
|
|
548
555
|
render() {
|
|
549
|
-
return (index.h("div", { key: '
|
|
556
|
+
return (index.h("div", { key: '302b68e74faa49232b9c0a92833b325e4e44a5b9', class: "hakuna-ticket", ref: (el) => (this.stylingContainer = el) }, index.h("lottery-hakuna-collapse", { key: '56139e7e5e8a035aa0b7d1c172aeddf0e905335b', ref: (el) => (this.collapseComponent = el), "header-title": `${this.gameName} #${this.ticketId}`, footer: true, collapsed: false, language: this.language, "translation-url": this.translationUrl, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource }, this.renderMainPlaceBet(), index.h("div", { key: '65f4f1534e2d325b3b7ebf34ed34f32aaef7bc4e', slot: "summary" }, this.renderCurSelection()))));
|
|
550
557
|
}
|
|
551
558
|
static get watchers() { return {
|
|
552
559
|
"clientStyling": ["handleClientStylingChange"],
|
package/dist/cjs/{lottery-hakuna-ticket-buy-fe6a420c.js → lottery-hakuna-ticket-buy-e7ddee9f.js}
RENAMED
|
@@ -81,12 +81,15 @@ const TRANSLATIONS = {
|
|
|
81
81
|
ticketSubmittedSuccess: 'Payment Successful',
|
|
82
82
|
ticketSubmittedSuccessMessage: 'Thank you for your payment. Payment has been proceeded successfully.',
|
|
83
83
|
ticketSubmittedError: 'Error Processing Payment',
|
|
84
|
-
|
|
84
|
+
ticketSubmittedErrorMessage1: 'Please check your wallet, account details and connection and try again.',
|
|
85
|
+
ticketSubmittedErrorMessage2: 'If you need help, please contact us.',
|
|
85
86
|
fetchingGameConfig: 'Fetching game config...',
|
|
86
87
|
ticket: 'Ticket',
|
|
87
88
|
price: 'Price',
|
|
88
89
|
tickets: 'Ticket(s)',
|
|
89
|
-
total: 'Total'
|
|
90
|
+
total: 'Total',
|
|
91
|
+
deposit: 'Deposit',
|
|
92
|
+
tryAgain: 'Try Again'
|
|
90
93
|
},
|
|
91
94
|
ro: {
|
|
92
95
|
error: 'Eroare',
|
|
@@ -167,7 +170,7 @@ const generateUUID = () => {
|
|
|
167
170
|
});
|
|
168
171
|
};
|
|
169
172
|
|
|
170
|
-
const lotteryHakunaTicketBuyCss = ":host{
|
|
173
|
+
const lotteryHakunaTicketBuyCss = ":host{display:block;height:100%;--emw--color-background-secondary:var(--emw-hakuna-bg-secondary, #120505);--emw--color-primary:var(--emw-hakuna-color-primary, #c52217);--emw--color-background:var(--emw-hakuna-bg-primary, #2c2525);--emw--color-background-tertiary:var(--emw-hakuna-bg-tertiary, #4f2421);--lottery-button-outline-active-bg:var(--emw-hakuna-bg-tertiary, #4f2421);--lottery-button-outline-active-bg:var(--emw-hakuna-bg-tertiary, #4f2421);scrollbar-width:thin;scrollbar-color:var(--emw-hakuna-scroll-scrollbar-thumb-background, #120505) var(--emw-hakuna-scroll-scrollbar-track-background, transparent);}:host::-webkit-scrollbar{width:var(--emw-hakuna-scroll-scrollbar-width, 2px)}:host::-webkit-scrollbar-track{background:var(--emw-hakuna-scroll-scrollbar-track-background, transparent)}:host::-webkit-scrollbar-thumb{background:var(--emw-hakuna-scroll-scrollbar-thumb-background, #120505);border-radius:var(--emw-hakuna-scroll-scrollbar-thumb-border-radius, 2px)}.error-container{display:flex;justify-content:center;align-items:center;padding:20px;min-height:100px;background-color:var(--emw--color-background-secondary, #f5f5f5);border-radius:4px;margin:20px 0}.error-text{font-size:16px;color:var(--emw--color-error, #ff3d00);font-weight:500;text-align:center}.hakuna-ticket-buy{display:flex;justify-content:center;flex-direction:column;height:100%;overflow:hidden}.hakuna-ticket-buy .empty-draw{display:flex;color:var(--emw-hakuna-text-primary, #ffffff);width:335px;padding:28px 20px;justify-content:center;border:1px solid transparent;border-radius:12px;background-origin:border-box;background-clip:padding-box, border-box;background-image:linear-gradient(var(--emw-hakuna-bg-secondary, #120505), var(--emw-hakuna-bg-secondary, #120505)), linear-gradient(to top left, var(--emw-hakuna-color-primary, #c52217) 32%, var(--emw-hakuna-bg-primary, #2c2525) 68%)}.hakuna-ticket-buy-skeleton{display:flex;flex-direction:column;align-items:center;margin:0 auto}.hakuna-ticket-buy-skeleton-ticket{box-sizing:border-box;padding:20px;min-width:336px;max-width:414px;background-color:var(--emw-hakuna-ticket-skeleton-bg, #2d2d2d)}.hakuna-ticket-buy-skeleton-pay{position:fixed;bottom:0;left:0;right:0;padding:16px 24px;background-color:var(--emw-hakuna-ticket-skeleton-bg, #2d2d2d);display:flex;align-items:center;justify-content:space-between}.hakuna-ticket-buy-wrapper{width:100%;display:flex;flex-direction:column;align-items:center;height:100%;overflow-y:auto;padding-bottom:90px;box-sizing:border-box}.hakuna-ticket-buy-list{display:flex;flex-direction:column;gap:12px;min-width:336px;max-width:414px;width:100%}.hakuna-ticket-buy-operation{display:flex;justify-content:center}.hakuna-ticket-buy-pay{position:fixed;bottom:0;left:0;right:0;padding:16px 24px;display:flex;align-items:center;justify-content:space-between;background:var(--emw-hakuna-bg-secondary, #120505)}.hakuna-ticket-buy-pay-info{display:flex;flex-direction:column;gap:10px}.hakuna-ticket-buy-pay-info-item{color:var(--emw-hakuna-text-secondary, #b4a5a5);font-size:12px;font-weight:600}.dialog-content{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px 0}.dialog-content-icon{margin-bottom:16px;display:flex;justify-content:center;align-items:center}.dialog-content-icon svg{display:block}.dialog-content-title{color:var(--emw-hakuna-text-primary, #ffffff);font-size:16px;font-weight:700;text-transform:uppercase}.dialog-content-message{color:var(--emw-hakuna-text-secondary, #b4a5a5);font-size:14px;font-weight:500;width:100%;display:flex;justify-content:center}.dialog-content-footer{display:flex;justify-content:center;gap:16px;width:100%}.confirm-submit-message{width:200px;display:flex;flex-direction:column;gap:2px;justify-content:center}.confirm-submit-message-item{width:100%;display:flex;justify-content:space-between;color:var(--emw-hakuna-text-secondary, #b4a5a5);font-size:14px;font-weight:500}.hakuna-dialog::part(dialog){border:1px solid transparent;border-radius:12px;background-origin:border-box;background-clip:padding-box, border-box;background-image:linear-gradient(var(--emw-hakuna-bg-secondary, #120505), var(--emw-hakuna-bg-secondary, #120505)), linear-gradient(to top left, var(--emw-hakuna-color-primary, #c52217) 32%, var(--emw-hakuna-bg-primary, #2c2525) 68%)}.hakuna-skeleton{animation:skeleton-loading 1s linear infinite alternate}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, #414141)}100%{background-color:var(--emw-skeleton-secondary-color, #2f2929)}}";
|
|
171
174
|
const LotteryHakunaTicketBuyStyle0 = lotteryHakunaTicketBuyCss;
|
|
172
175
|
|
|
173
176
|
const LotteryHakunaTicketBuy = class {
|
|
@@ -176,6 +179,7 @@ const LotteryHakunaTicketBuy = class {
|
|
|
176
179
|
this.goToTicketList = index.createEvent(this, "TicketSubmission:jumpToHistoryList", 7);
|
|
177
180
|
this.sessionExpired = index.createEvent(this, "SessionExpired", 7);
|
|
178
181
|
this.goToHomePage = index.createEvent(this, "TicketBuying:leaveToHomepage", 7);
|
|
182
|
+
this.goToDepositPage = index.createEvent(this, "TicketBuying:leaveToDepositPage", 7);
|
|
179
183
|
this.resetAllTicketSelection = index.createEvent(this, "resetAllTicketSelection", 7);
|
|
180
184
|
this.thousandSeparator = (value) => {
|
|
181
185
|
if (value === 0) {
|
|
@@ -489,7 +493,7 @@ const LotteryHakunaTicketBuy = class {
|
|
|
489
493
|
this.dialogInfo = Object.assign(Object.assign({}, this.dialogInfo), { visible: false, loading: false });
|
|
490
494
|
return;
|
|
491
495
|
}
|
|
492
|
-
this.dialogInfo = Object.assign(Object.assign({}, this.dialogInfo), { loading: false, visible: true, title: translate('ticketSubmittedError', this.language), message: translate('ticketSubmittedErrorMessage', this.language), icon: this.getDialogIcon('error'), type: 'ERROR', showLeftBtn:
|
|
496
|
+
this.dialogInfo = Object.assign(Object.assign({}, this.dialogInfo), { loading: false, visible: true, title: translate('ticketSubmittedError', this.language), message: translate('ticketSubmittedErrorMessage', this.language), icon: this.getDialogIcon('error'), type: 'ERROR', showLeftBtn: true, showRightBtn: true, leftBtnText: translate('deposit', this.language), rightBtnText: translate('tryAgain', this.language), leftBtnEvent: this.handleGoToDepositPage.bind(this), rightBtnEvent: this.handleSubmitTickets.bind(this) });
|
|
493
497
|
});
|
|
494
498
|
}
|
|
495
499
|
else {
|
|
@@ -502,6 +506,9 @@ const LotteryHakunaTicketBuy = class {
|
|
|
502
506
|
handleLeaveToHomepage() {
|
|
503
507
|
this.goToHomePage.emit();
|
|
504
508
|
}
|
|
509
|
+
handleGoToDepositPage() {
|
|
510
|
+
this.goToDepositPage.emit();
|
|
511
|
+
}
|
|
505
512
|
getSkeletonEle(style, type) {
|
|
506
513
|
return (index.h("div", { class: "hakuna-skeleton", style: Object.assign(Object.assign({}, style), { display: type === 'inline' ? 'inline-flex' : 'flex' }) }));
|
|
507
514
|
}
|
|
@@ -524,7 +531,7 @@ const LotteryHakunaTicketBuy = class {
|
|
|
524
531
|
const numberRange = selectionRules.map((item) => item.selectionCount);
|
|
525
532
|
const isAllTicketsSubmitted = this.mainTickets.length > 0 && this.mainTickets.every((ticket) => ticket.isSubmitted);
|
|
526
533
|
const nextDate = (_b = (_a = this.gameData) === null || _a === void 0 ? void 0 : _a.currentDraw) === null || _b === void 0 ? void 0 : _b.date;
|
|
527
|
-
return (index.h("div", { class: "hakuna-ticket-buy", ref: (el) => (this.stylingContainer = el) }, nextDate ? (index.h("div", { class: "hakuna-ticket-buy-wrapper" }, index.h("div", { class: "hakuna-ticket-buy-list" }, this.mainTickets.map((item) => (index.h("lottery-hakuna-ticket", { key: item.uid, "ticket-id": item.ticketId, allowQuickPick: quickPickAvailable, gameName: this.country || this.gameData.name, "is-submitted": item.isSubmitted, "high-number": highNumber, "low-number": lowNumber, "maximum-allowed": maxinumAllowed, "minimum-allowed": minimumAllowed, "number-range": numberRange, language: this.language, "translation-url": this.translationUrl, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource, "disable-delete": this.mainTickets.length === 1 })))), index.h("div", { class: "hakuna-ticket-buy-operation" }, index.h("lottery-button", { variant: "outline", color: "var(--emw-hakuna-color-primary, #C52217)", size: "small", onClick: this.createNewTicket.bind(this) }, index.h("span", { slot: "icon-left" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.00004 2.33337C7.32221 2.33337 7.58337 2.59454 7.58337 2.91671V6.41671H11.0834C11.4055 6.41671 11.6667 6.67787 11.6667 7.00004C11.6667 7.32221 11.4055 7.58337 11.0834 7.58337H7.58337V11.0834C7.58337 11.4055 7.32221 11.6667 7.00004 11.6667C6.67787 11.6667 6.41671 11.4055 6.41671 11.0834V7.58337H2.91671C2.59454 7.58337 2.33337 7.32221 2.33337 7.00004C2.33337 6.67787 2.59454 6.41671 2.91671 6.41671H6.41671V2.91671C6.41671 2.59454 6.67787 2.33337 7.00004 2.33337Z", fill: "white" }))), index.h("span", { style: { color: '#fff' } }, translate('addTicket', this.language)))), index.h("lottery-tipping-dialog", { closable: false, visible: this.dialogInfo.visible, width: "335px", mask: true, maskClosable: true, class: "hakuna-dialog", onCancel: () => (this.dialogInfo = Object.assign(Object.assign({}, this.dialogInfo), { visible: false })) }, index.h("div", { class: "dialog-content" }, index.h("div", { class: "dialog-content-icon" }, this.dialogInfo.icon), index.h("div", { class: "dialog-content-title" }, this.dialogInfo.title), index.h("div", { class: "dialog-content-message" }, this.dialogInfo.type === 'SUBMIT_CONFIRM' ? (index.h("div", { class: "confirm-submit-message" }, index.h("div", { class: "confirm-submit-message-item" }, index.h("div", { class: "title" }, translate('tickets', this.language), ":"), index.h("div", { class: "value" }, this.mainTickets.length)), index.h("div", { class: "confirm-submit-message-item" }, index.h("div", { class: "title" }, translate('total', this.language), ": "), index.h("div", { class: "value" }, `${this.currency} ${this.thousandSeparator(this.totalAmount)}`)))) : (index.h("span", null, this.dialogInfo.message)))), index.h("div", { slot: "footer", class: "dialog-content-footer" }, index.h("lottery-button", { variant: "outline", color: "var(--emw-hakuna-color-primary, #C52217)", onClick: this.dialogInfo.leftBtnEvent,
|
|
534
|
+
return (index.h("div", { class: "hakuna-ticket-buy", ref: (el) => (this.stylingContainer = el) }, nextDate ? (index.h("div", { class: "hakuna-ticket-buy-wrapper" }, index.h("div", { class: "hakuna-ticket-buy-list" }, this.mainTickets.map((item) => (index.h("lottery-hakuna-ticket", { key: item.uid, "ticket-id": item.ticketId, allowQuickPick: quickPickAvailable, gameName: this.country || this.gameData.name, "is-submitted": item.isSubmitted, "high-number": highNumber, "low-number": lowNumber, "maximum-allowed": maxinumAllowed, "minimum-allowed": minimumAllowed, "number-range": numberRange, language: this.language, "translation-url": this.translationUrl, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource, "disable-delete": this.mainTickets.length === 1 })))), index.h("div", { class: "hakuna-ticket-buy-operation" }, index.h("lottery-button", { variant: "outline", color: "var(--emw-hakuna-color-primary, #C52217)", size: "small", onClick: this.createNewTicket.bind(this) }, index.h("span", { slot: "icon-left" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none" }, index.h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.00004 2.33337C7.32221 2.33337 7.58337 2.59454 7.58337 2.91671V6.41671H11.0834C11.4055 6.41671 11.6667 6.67787 11.6667 7.00004C11.6667 7.32221 11.4055 7.58337 11.0834 7.58337H7.58337V11.0834C7.58337 11.4055 7.32221 11.6667 7.00004 11.6667C6.67787 11.6667 6.41671 11.4055 6.41671 11.0834V7.58337H2.91671C2.59454 7.58337 2.33337 7.32221 2.33337 7.00004C2.33337 6.67787 2.59454 6.41671 2.91671 6.41671H6.41671V2.91671C6.41671 2.59454 6.67787 2.33337 7.00004 2.33337Z", fill: "white" }))), index.h("span", { style: { color: '#fff' } }, translate('addTicket', this.language)))), index.h("lottery-tipping-dialog", { closable: false, visible: this.dialogInfo.visible, width: "335px", mask: true, maskClosable: true, class: "hakuna-dialog", onCancel: () => (this.dialogInfo = Object.assign(Object.assign({}, this.dialogInfo), { visible: false })) }, index.h("div", { class: "dialog-content" }, index.h("div", { class: "dialog-content-icon" }, this.dialogInfo.icon), index.h("div", { class: "dialog-content-title" }, this.dialogInfo.title), index.h("div", { class: "dialog-content-message" }, this.dialogInfo.type === 'SUBMIT_CONFIRM' ? (index.h("div", { class: "confirm-submit-message" }, index.h("div", { class: "confirm-submit-message-item" }, index.h("div", { class: "title" }, translate('tickets', this.language), ":"), index.h("div", { class: "value" }, this.mainTickets.length)), index.h("div", { class: "confirm-submit-message-item" }, index.h("div", { class: "title" }, translate('total', this.language), ": "), index.h("div", { class: "value" }, `${this.currency} ${this.thousandSeparator(this.totalAmount)}`)))) : this.dialogInfo.type === 'ERROR' ? (index.h("div", null, index.h("div", { style: { marginBottom: '10px' } }, translate('ticketSubmittedErrorMessage1', this.language)), index.h("div", null, translate('ticketSubmittedErrorMessage2', this.language)))) : (index.h("span", null, this.dialogInfo.message)))), index.h("div", { slot: "footer", class: "dialog-content-footer" }, index.h("lottery-button", { variant: "outline", color: "var(--emw-hakuna-color-primary, #C52217)", onClick: this.dialogInfo.leftBtnEvent }, index.h("span", { style: { color: '#fff' } }, this.dialogInfo.leftBtnText, " ")), index.h("lottery-button", { variant: "primary", color: "var(--emw-hakuna-color-primary, #C52217)", onClick: this.dialogInfo.rightBtnEvent, text: this.dialogInfo.rightBtnText, loading: this.dialogInfo.loading }))))) : (index.h("div", { class: "empty-draw" }, translate('emptyDraw', this.language))), index.h("div", { class: "hakuna-ticket-buy-pay" }, index.h("div", { class: "hakuna-ticket-buy-pay-info" }, index.h("div", { class: "hakuna-ticket-buy-pay-info-item" }, translate('ticket', this.language), ": ", this.mainTickets.length), index.h("div", { class: "hakuna-ticket-buy-pay-info-item" }, translate('price', this.language), ": ", `${this.currency} ${this.thousandSeparator(this.totalAmount)}`)), index.h("div", { class: "hakuna-ticket-buy-pay-button" }, index.h("lottery-button", { variant: "primary", color: "var(--emw-hakuna-color-primary, #C52217)", text: translate('payNow', this.language), disabled: !isAllTicketsSubmitted, onClick: this.handleConfirmSubmit.bind(this) })))));
|
|
528
535
|
}
|
|
529
536
|
}
|
|
530
537
|
static get assetsDirs() { return ["../static"]; }
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
height: 100%;
|
|
2
4
|
--emw--color-background-secondary: var(--emw-hakuna-bg-secondary, #120505);
|
|
3
5
|
--emw--color-primary: var(--emw-hakuna-color-primary, #c52217);
|
|
4
6
|
--emw--color-background: var(--emw-hakuna-bg-primary, #2c2525);
|
|
@@ -41,6 +43,9 @@
|
|
|
41
43
|
.hakuna-ticket-buy {
|
|
42
44
|
display: flex;
|
|
43
45
|
justify-content: center;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
height: 100%;
|
|
48
|
+
overflow: hidden;
|
|
44
49
|
}
|
|
45
50
|
.hakuna-ticket-buy .empty-draw {
|
|
46
51
|
display: flex;
|
|
@@ -83,8 +88,10 @@
|
|
|
83
88
|
display: flex;
|
|
84
89
|
flex-direction: column;
|
|
85
90
|
align-items: center;
|
|
86
|
-
|
|
87
|
-
overflow-y:
|
|
91
|
+
height: 100%;
|
|
92
|
+
overflow-y: auto;
|
|
93
|
+
padding-bottom: 90px;
|
|
94
|
+
box-sizing: border-box;
|
|
88
95
|
}
|
|
89
96
|
.hakuna-ticket-buy-list {
|
|
90
97
|
display: flex;
|
|
@@ -319,7 +319,7 @@ export class LotteryHakunaTicketBuy {
|
|
|
319
319
|
this.dialogInfo = Object.assign(Object.assign({}, this.dialogInfo), { visible: false, loading: false });
|
|
320
320
|
return;
|
|
321
321
|
}
|
|
322
|
-
this.dialogInfo = Object.assign(Object.assign({}, this.dialogInfo), { loading: false, visible: true, title: translate('ticketSubmittedError', this.language), message: translate('ticketSubmittedErrorMessage', this.language), icon: this.getDialogIcon('error'), type: 'ERROR', showLeftBtn:
|
|
322
|
+
this.dialogInfo = Object.assign(Object.assign({}, this.dialogInfo), { loading: false, visible: true, title: translate('ticketSubmittedError', this.language), message: translate('ticketSubmittedErrorMessage', this.language), icon: this.getDialogIcon('error'), type: 'ERROR', showLeftBtn: true, showRightBtn: true, leftBtnText: translate('deposit', this.language), rightBtnText: translate('tryAgain', this.language), leftBtnEvent: this.handleGoToDepositPage.bind(this), rightBtnEvent: this.handleSubmitTickets.bind(this) });
|
|
323
323
|
});
|
|
324
324
|
}
|
|
325
325
|
else {
|
|
@@ -332,6 +332,9 @@ export class LotteryHakunaTicketBuy {
|
|
|
332
332
|
handleLeaveToHomepage() {
|
|
333
333
|
this.goToHomePage.emit();
|
|
334
334
|
}
|
|
335
|
+
handleGoToDepositPage() {
|
|
336
|
+
this.goToDepositPage.emit();
|
|
337
|
+
}
|
|
335
338
|
getSkeletonEle(style, type) {
|
|
336
339
|
return (h("div", { class: "hakuna-skeleton", style: Object.assign(Object.assign({}, style), { display: type === 'inline' ? 'inline-flex' : 'flex' }) }));
|
|
337
340
|
}
|
|
@@ -354,7 +357,7 @@ export class LotteryHakunaTicketBuy {
|
|
|
354
357
|
const numberRange = selectionRules.map((item) => item.selectionCount);
|
|
355
358
|
const isAllTicketsSubmitted = this.mainTickets.length > 0 && this.mainTickets.every((ticket) => ticket.isSubmitted);
|
|
356
359
|
const nextDate = (_b = (_a = this.gameData) === null || _a === void 0 ? void 0 : _a.currentDraw) === null || _b === void 0 ? void 0 : _b.date;
|
|
357
|
-
return (h("div", { class: "hakuna-ticket-buy", ref: (el) => (this.stylingContainer = el) }, nextDate ? (h("div", { class: "hakuna-ticket-buy-wrapper" }, h("div", { class: "hakuna-ticket-buy-list" }, this.mainTickets.map((item) => (h("lottery-hakuna-ticket", { key: item.uid, "ticket-id": item.ticketId, allowQuickPick: quickPickAvailable, gameName: this.country || this.gameData.name, "is-submitted": item.isSubmitted, "high-number": highNumber, "low-number": lowNumber, "maximum-allowed": maxinumAllowed, "minimum-allowed": minimumAllowed, "number-range": numberRange, language: this.language, "translation-url": this.translationUrl, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource, "disable-delete": this.mainTickets.length === 1 })))), h("div", { class: "hakuna-ticket-buy-operation" }, h("lottery-button", { variant: "outline", color: "var(--emw-hakuna-color-primary, #C52217)", size: "small", onClick: this.createNewTicket.bind(this) }, h("span", { slot: "icon-left" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.00004 2.33337C7.32221 2.33337 7.58337 2.59454 7.58337 2.91671V6.41671H11.0834C11.4055 6.41671 11.6667 6.67787 11.6667 7.00004C11.6667 7.32221 11.4055 7.58337 11.0834 7.58337H7.58337V11.0834C7.58337 11.4055 7.32221 11.6667 7.00004 11.6667C6.67787 11.6667 6.41671 11.4055 6.41671 11.0834V7.58337H2.91671C2.59454 7.58337 2.33337 7.32221 2.33337 7.00004C2.33337 6.67787 2.59454 6.41671 2.91671 6.41671H6.41671V2.91671C6.41671 2.59454 6.67787 2.33337 7.00004 2.33337Z", fill: "white" }))), h("span", { style: { color: '#fff' } }, translate('addTicket', this.language)))), h("lottery-tipping-dialog", { closable: false, visible: this.dialogInfo.visible, width: "335px", mask: true, maskClosable: true, class: "hakuna-dialog", onCancel: () => (this.dialogInfo = Object.assign(Object.assign({}, this.dialogInfo), { visible: false })) }, h("div", { class: "dialog-content" }, h("div", { class: "dialog-content-icon" }, this.dialogInfo.icon), h("div", { class: "dialog-content-title" }, this.dialogInfo.title), h("div", { class: "dialog-content-message" }, this.dialogInfo.type === 'SUBMIT_CONFIRM' ? (h("div", { class: "confirm-submit-message" }, h("div", { class: "confirm-submit-message-item" }, h("div", { class: "title" }, translate('tickets', this.language), ":"), h("div", { class: "value" }, this.mainTickets.length)), h("div", { class: "confirm-submit-message-item" }, h("div", { class: "title" }, translate('total', this.language), ": "), h("div", { class: "value" }, `${this.currency} ${this.thousandSeparator(this.totalAmount)}`)))) : (h("span", null, this.dialogInfo.message)))), h("div", { slot: "footer", class: "dialog-content-footer" }, h("lottery-button", { variant: "outline", color: "var(--emw-hakuna-color-primary, #C52217)", onClick: this.dialogInfo.leftBtnEvent,
|
|
360
|
+
return (h("div", { class: "hakuna-ticket-buy", ref: (el) => (this.stylingContainer = el) }, nextDate ? (h("div", { class: "hakuna-ticket-buy-wrapper" }, h("div", { class: "hakuna-ticket-buy-list" }, this.mainTickets.map((item) => (h("lottery-hakuna-ticket", { key: item.uid, "ticket-id": item.ticketId, allowQuickPick: quickPickAvailable, gameName: this.country || this.gameData.name, "is-submitted": item.isSubmitted, "high-number": highNumber, "low-number": lowNumber, "maximum-allowed": maxinumAllowed, "minimum-allowed": minimumAllowed, "number-range": numberRange, language: this.language, "translation-url": this.translationUrl, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource, "disable-delete": this.mainTickets.length === 1 })))), h("div", { class: "hakuna-ticket-buy-operation" }, h("lottery-button", { variant: "outline", color: "var(--emw-hakuna-color-primary, #C52217)", size: "small", onClick: this.createNewTicket.bind(this) }, h("span", { slot: "icon-left" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.00004 2.33337C7.32221 2.33337 7.58337 2.59454 7.58337 2.91671V6.41671H11.0834C11.4055 6.41671 11.6667 6.67787 11.6667 7.00004C11.6667 7.32221 11.4055 7.58337 11.0834 7.58337H7.58337V11.0834C7.58337 11.4055 7.32221 11.6667 7.00004 11.6667C6.67787 11.6667 6.41671 11.4055 6.41671 11.0834V7.58337H2.91671C2.59454 7.58337 2.33337 7.32221 2.33337 7.00004C2.33337 6.67787 2.59454 6.41671 2.91671 6.41671H6.41671V2.91671C6.41671 2.59454 6.67787 2.33337 7.00004 2.33337Z", fill: "white" }))), h("span", { style: { color: '#fff' } }, translate('addTicket', this.language)))), h("lottery-tipping-dialog", { closable: false, visible: this.dialogInfo.visible, width: "335px", mask: true, maskClosable: true, class: "hakuna-dialog", onCancel: () => (this.dialogInfo = Object.assign(Object.assign({}, this.dialogInfo), { visible: false })) }, h("div", { class: "dialog-content" }, h("div", { class: "dialog-content-icon" }, this.dialogInfo.icon), h("div", { class: "dialog-content-title" }, this.dialogInfo.title), h("div", { class: "dialog-content-message" }, this.dialogInfo.type === 'SUBMIT_CONFIRM' ? (h("div", { class: "confirm-submit-message" }, h("div", { class: "confirm-submit-message-item" }, h("div", { class: "title" }, translate('tickets', this.language), ":"), h("div", { class: "value" }, this.mainTickets.length)), h("div", { class: "confirm-submit-message-item" }, h("div", { class: "title" }, translate('total', this.language), ": "), h("div", { class: "value" }, `${this.currency} ${this.thousandSeparator(this.totalAmount)}`)))) : this.dialogInfo.type === 'ERROR' ? (h("div", null, h("div", { style: { marginBottom: '10px' } }, translate('ticketSubmittedErrorMessage1', this.language)), h("div", null, translate('ticketSubmittedErrorMessage2', this.language)))) : (h("span", null, this.dialogInfo.message)))), h("div", { slot: "footer", class: "dialog-content-footer" }, h("lottery-button", { variant: "outline", color: "var(--emw-hakuna-color-primary, #C52217)", onClick: this.dialogInfo.leftBtnEvent }, h("span", { style: { color: '#fff' } }, this.dialogInfo.leftBtnText, " ")), h("lottery-button", { variant: "primary", color: "var(--emw-hakuna-color-primary, #C52217)", onClick: this.dialogInfo.rightBtnEvent, text: this.dialogInfo.rightBtnText, loading: this.dialogInfo.loading }))))) : (h("div", { class: "empty-draw" }, translate('emptyDraw', this.language))), h("div", { class: "hakuna-ticket-buy-pay" }, h("div", { class: "hakuna-ticket-buy-pay-info" }, h("div", { class: "hakuna-ticket-buy-pay-info-item" }, translate('ticket', this.language), ": ", this.mainTickets.length), h("div", { class: "hakuna-ticket-buy-pay-info-item" }, translate('price', this.language), ": ", `${this.currency} ${this.thousandSeparator(this.totalAmount)}`)), h("div", { class: "hakuna-ticket-buy-pay-button" }, h("lottery-button", { variant: "primary", color: "var(--emw-hakuna-color-primary, #C52217)", text: translate('payNow', this.language), disabled: !isAllTicketsSubmitted, onClick: this.handleConfirmSubmit.bind(this) })))));
|
|
358
361
|
}
|
|
359
362
|
}
|
|
360
363
|
static get is() { return "lottery-hakuna-ticket-buy"; }
|
|
@@ -624,6 +627,21 @@ export class LotteryHakunaTicketBuy {
|
|
|
624
627
|
"resolved": "void",
|
|
625
628
|
"references": {}
|
|
626
629
|
}
|
|
630
|
+
}, {
|
|
631
|
+
"method": "goToDepositPage",
|
|
632
|
+
"name": "TicketBuying:leaveToDepositPage",
|
|
633
|
+
"bubbles": true,
|
|
634
|
+
"cancelable": true,
|
|
635
|
+
"composed": true,
|
|
636
|
+
"docs": {
|
|
637
|
+
"tags": [],
|
|
638
|
+
"text": ""
|
|
639
|
+
},
|
|
640
|
+
"complexType": {
|
|
641
|
+
"original": "void",
|
|
642
|
+
"resolved": "void",
|
|
643
|
+
"references": {}
|
|
644
|
+
}
|
|
627
645
|
}, {
|
|
628
646
|
"method": "resetAllTicketSelection",
|
|
629
647
|
"name": "resetAllTicketSelection",
|
|
@@ -18,12 +18,15 @@ const TRANSLATIONS = {
|
|
|
18
18
|
ticketSubmittedSuccess: 'Payment Successful',
|
|
19
19
|
ticketSubmittedSuccessMessage: 'Thank you for your payment. Payment has been proceeded successfully.',
|
|
20
20
|
ticketSubmittedError: 'Error Processing Payment',
|
|
21
|
-
|
|
21
|
+
ticketSubmittedErrorMessage1: 'Please check your wallet, account details and connection and try again.',
|
|
22
|
+
ticketSubmittedErrorMessage2: 'If you need help, please contact us.',
|
|
22
23
|
fetchingGameConfig: 'Fetching game config...',
|
|
23
24
|
ticket: 'Ticket',
|
|
24
25
|
price: 'Price',
|
|
25
26
|
tickets: 'Ticket(s)',
|
|
26
|
-
total: 'Total'
|
|
27
|
+
total: 'Total',
|
|
28
|
+
deposit: 'Deposit',
|
|
29
|
+
tryAgain: 'Try Again'
|
|
27
30
|
},
|
|
28
31
|
ro: {
|
|
29
32
|
error: 'Eroare',
|
package/dist/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { L as LotteryHakunaTicketBuy } from './lottery-hakuna-ticket-buy-
|
|
1
|
+
export { L as LotteryHakunaTicketBuy } from './lottery-hakuna-ticket-buy-e97eb8d9.js';
|
|
2
2
|
import './index-1f778cb5.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, g as getElement, c as createEvent } from './index-1f778cb5.js';
|
|
2
|
-
import { s as setClientStyling, a as setClientStylingURL, b as setStreamStyling } from './lottery-hakuna-ticket-buy-
|
|
3
|
-
export { L as lottery_hakuna_ticket_buy } from './lottery-hakuna-ticket-buy-
|
|
2
|
+
import { s as setClientStyling, a as setClientStylingURL, b as setStreamStyling } from './lottery-hakuna-ticket-buy-e97eb8d9.js';
|
|
3
|
+
export { L as lottery_hakuna_ticket_buy } from './lottery-hakuna-ticket-buy-e97eb8d9.js';
|
|
4
4
|
|
|
5
5
|
const DEFAULT_LANGUAGE$3 = 'en';
|
|
6
6
|
const SUPPORTED_LANGUAGES$3 = ['ro', 'en', 'fr', 'ar', 'hr', 'zh'];
|
|
@@ -250,7 +250,8 @@ const TRANSLATIONS$2 = {
|
|
|
250
250
|
loading: 'Loading, please wait ...',
|
|
251
251
|
error: 'It was an error while trying to fetch the data',
|
|
252
252
|
quickPick: 'Quick Pick',
|
|
253
|
-
submit: 'SUBMIT'
|
|
253
|
+
submit: 'SUBMIT',
|
|
254
|
+
pickNumbers: 'Pick {num} Numbers'
|
|
254
255
|
},
|
|
255
256
|
ro: {
|
|
256
257
|
loading: 'Se incarca, va rugam asteptati ...',
|
|
@@ -301,9 +302,15 @@ const TRANSLATIONS$2 = {
|
|
|
301
302
|
playType: 'Select one play type you want to buy'
|
|
302
303
|
}
|
|
303
304
|
};
|
|
304
|
-
const translate$2 = (key, customLang) => {
|
|
305
|
+
const translate$2 = (key, customLang, replacements) => {
|
|
305
306
|
const lang = customLang;
|
|
306
|
-
|
|
307
|
+
let translation = TRANSLATIONS$2[lang !== undefined && SUPPORTED_LANGUAGES$2.includes(lang) ? lang : DEFAULT_LANGUAGE$2][key];
|
|
308
|
+
if (replacements) {
|
|
309
|
+
Object.keys(replacements).forEach((placeholder) => {
|
|
310
|
+
translation = translation.replace(`{${placeholder}}`, replacements[placeholder]);
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
return translation;
|
|
307
314
|
};
|
|
308
315
|
const getTranslations$2 = (data) => {
|
|
309
316
|
Object.keys(data).forEach((item) => {
|
|
@@ -503,7 +510,7 @@ const LotteryHakunaTicket = class {
|
|
|
503
510
|
return (h("div", { class: "hakuna-ticket-content" }, this.grids.map((item, index) => {
|
|
504
511
|
const isGridEmpty = !item.selection;
|
|
505
512
|
const selectedCount = item.selection ? item.selection.split(',').filter(Boolean).length : 0;
|
|
506
|
-
return (h("div", null, h("div", { class: "hakuna-ticket-content-selection" }, h("div", { class: "hakuna-ticket-content-selection-text" },
|
|
513
|
+
return (h("div", null, h("div", { class: "hakuna-ticket-content-selection" }, h("div", { class: "hakuna-ticket-content-selection-text" }, translate$2('pickNumbers', this.language, { num: curAllowedSelectionNum }), ' '), h("div", { class: "hakuna-ticket-content-selection-dots" }, Array.from({ length: curAllowedSelectionNum }, (_, i) => i + 1).map((dotIndex) => (h("div", { key: dotIndex, class: {
|
|
507
514
|
'hakuna-ticket-content-selection-dots-item': true,
|
|
508
515
|
active: dotIndex <= selectedCount
|
|
509
516
|
} }))))), h("div", { class: { 'hakuna-ticket-content-bullets': true, disabled: this.isSubmitted } }, h("lottery-selection-group", { type: "bet", hasBorder: false, bulletTexts: item.bulletTexts, selectionGroupId: `${item.groupIdx}-${this.MAIN_SELECTION_NAME}`, "selected-bullet-texts": item.selection, maxSelectedCount: curAllowedSelectionNum, language: this.language, "translation-url": this.translationUrl, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource })), h("div", { class: "hakuna-ticket-content-operation", style: { display: 'flex', alignItems: 'center' } }, h("div", { class: "hakuna-ticket-content-operation--left" }, h("div", { class: { 'icon-btn': true, disabled: isGridEmpty || this.isSubmitted }, onClick: () => !isGridEmpty && this.toggleResetSelection(index) }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M0.833374 9.99996C0.833374 5.39759 4.56433 1.66663 9.16671 1.66663C11.4687 1.66663 13.554 2.60112 15.0613 4.10944C15.5943 4.64284 16.1651 5.30202 16.6667 5.91199V3.33329C16.6667 2.87306 17.0398 2.49996 17.5 2.49996C17.9603 2.49996 18.3334 2.87306 18.3334 3.33329V8.33329C18.3334 8.79353 17.9603 9.16663 17.5 9.16663H12.5C12.0398 9.16663 11.6667 8.79353 11.6667 8.33329C11.6667 7.87306 12.0398 7.49996 12.5 7.49996H15.8077C15.2309 6.77602 14.5138 5.91942 13.8824 5.28755C12.6749 4.07924 11.0087 3.33329 9.16671 3.33329C5.48481 3.33329 2.50004 6.31806 2.50004 9.99996C2.50004 13.6819 5.48481 16.6666 9.16671 16.6666C12.2048 16.6666 14.7703 14.6337 15.5729 11.8523C15.7005 11.4101 16.1624 11.155 16.6046 11.2826C17.0468 11.4102 17.3018 11.8721 17.1742 12.3143C16.1713 15.79 12.9671 18.3333 9.16671 18.3333C4.56433 18.3333 0.833374 14.6023 0.833374 9.99996Z", fill: "currentColor" })))), h("div", { class: "hakuna-ticket-content-operation--right" }, this.allowQuickPick && (h("lottery-button", { variant: "outline", color: "var(--emw-hakuna-color-primary, #C52217)", size: "small", onClick: this.toggleAutoSelection.bind(this, index), disabled: this.isSubmitted }, h("span", { slot: "icon-left" }, h("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.81557 0.631525C8.05311 0.734641 8.19424 0.982014 8.16212 1.23897L7.66075 5.24995L11.2745 5.24995C11.4151 5.24992 11.5575 5.2499 11.6738 5.26043C11.7838 5.27039 11.9945 5.29674 12.1772 5.44439C12.3864 5.61342 12.5062 5.86924 12.5021 6.13814C12.4986 6.37303 12.384 6.55174 12.3212 6.64264C12.2548 6.73875 12.1636 6.84811 12.0736 6.95609L6.86476 13.2067C6.69898 13.4057 6.42189 13.4715 6.18435 13.3684C5.94681 13.2653 5.80568 13.0179 5.8378 12.7609L6.33917 8.74995L2.72543 8.74995C2.58485 8.74998 2.44246 8.75001 2.32613 8.73947C2.21611 8.72951 2.00543 8.70316 1.82272 8.55551C1.61355 8.38648 1.49373 8.13066 1.49778 7.86176C1.50132 7.62688 1.61595 7.44816 1.67873 7.35726C1.74512 7.26115 1.8363 7.15177 1.92632 7.04379C1.93078 7.03844 1.93523 7.0331 1.93968 7.02776L7.13516 0.793177C7.30094 0.59424 7.57803 0.52841 7.81557 0.631525ZM2.9954 7.58328H6.99996C7.16728 7.58328 7.32654 7.65513 7.43727 7.78057C7.548 7.906 7.59954 8.07295 7.57879 8.23897L7.24224 10.9314L11.0045 6.41662H6.99996C6.83264 6.41662 6.67338 6.34477 6.56265 6.21934C6.45192 6.0939 6.40038 5.92696 6.42113 5.76093L6.75768 3.06855L2.9954 7.58328Z", fill: "white" }))), h("span", { style: { color: '#fff' } }, translate$2('quickPick', this.language)))), h("lottery-button", { variant: "primary", color: "var(--emw-hakuna-color-primary, #C52217)", size: "small", text: translate$2('submit', this.language), disabled: !this.ticketDone[index] || this.isSubmitted, onClick: this.handleSaveTicket.bind(this) })))));
|
|
@@ -543,7 +550,7 @@ const LotteryHakunaTicket = class {
|
|
|
543
550
|
})));
|
|
544
551
|
}
|
|
545
552
|
render() {
|
|
546
|
-
return (h("div", { key: '
|
|
553
|
+
return (h("div", { key: '302b68e74faa49232b9c0a92833b325e4e44a5b9', class: "hakuna-ticket", ref: (el) => (this.stylingContainer = el) }, h("lottery-hakuna-collapse", { key: '56139e7e5e8a035aa0b7d1c172aeddf0e905335b', ref: (el) => (this.collapseComponent = el), "header-title": `${this.gameName} #${this.ticketId}`, footer: true, collapsed: false, language: this.language, "translation-url": this.translationUrl, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource }, this.renderMainPlaceBet(), h("div", { key: '65f4f1534e2d325b3b7ebf34ed34f32aaef7bc4e', slot: "summary" }, this.renderCurSelection()))));
|
|
547
554
|
}
|
|
548
555
|
static get watchers() { return {
|
|
549
556
|
"clientStyling": ["handleClientStylingChange"],
|
package/dist/esm/{lottery-hakuna-ticket-buy-a9f8e014.js → lottery-hakuna-ticket-buy-e97eb8d9.js}
RENAMED
|
@@ -79,12 +79,15 @@ const TRANSLATIONS = {
|
|
|
79
79
|
ticketSubmittedSuccess: 'Payment Successful',
|
|
80
80
|
ticketSubmittedSuccessMessage: 'Thank you for your payment. Payment has been proceeded successfully.',
|
|
81
81
|
ticketSubmittedError: 'Error Processing Payment',
|
|
82
|
-
|
|
82
|
+
ticketSubmittedErrorMessage1: 'Please check your wallet, account details and connection and try again.',
|
|
83
|
+
ticketSubmittedErrorMessage2: 'If you need help, please contact us.',
|
|
83
84
|
fetchingGameConfig: 'Fetching game config...',
|
|
84
85
|
ticket: 'Ticket',
|
|
85
86
|
price: 'Price',
|
|
86
87
|
tickets: 'Ticket(s)',
|
|
87
|
-
total: 'Total'
|
|
88
|
+
total: 'Total',
|
|
89
|
+
deposit: 'Deposit',
|
|
90
|
+
tryAgain: 'Try Again'
|
|
88
91
|
},
|
|
89
92
|
ro: {
|
|
90
93
|
error: 'Eroare',
|
|
@@ -165,7 +168,7 @@ const generateUUID = () => {
|
|
|
165
168
|
});
|
|
166
169
|
};
|
|
167
170
|
|
|
168
|
-
const lotteryHakunaTicketBuyCss = ":host{
|
|
171
|
+
const lotteryHakunaTicketBuyCss = ":host{display:block;height:100%;--emw--color-background-secondary:var(--emw-hakuna-bg-secondary, #120505);--emw--color-primary:var(--emw-hakuna-color-primary, #c52217);--emw--color-background:var(--emw-hakuna-bg-primary, #2c2525);--emw--color-background-tertiary:var(--emw-hakuna-bg-tertiary, #4f2421);--lottery-button-outline-active-bg:var(--emw-hakuna-bg-tertiary, #4f2421);--lottery-button-outline-active-bg:var(--emw-hakuna-bg-tertiary, #4f2421);scrollbar-width:thin;scrollbar-color:var(--emw-hakuna-scroll-scrollbar-thumb-background, #120505) var(--emw-hakuna-scroll-scrollbar-track-background, transparent);}:host::-webkit-scrollbar{width:var(--emw-hakuna-scroll-scrollbar-width, 2px)}:host::-webkit-scrollbar-track{background:var(--emw-hakuna-scroll-scrollbar-track-background, transparent)}:host::-webkit-scrollbar-thumb{background:var(--emw-hakuna-scroll-scrollbar-thumb-background, #120505);border-radius:var(--emw-hakuna-scroll-scrollbar-thumb-border-radius, 2px)}.error-container{display:flex;justify-content:center;align-items:center;padding:20px;min-height:100px;background-color:var(--emw--color-background-secondary, #f5f5f5);border-radius:4px;margin:20px 0}.error-text{font-size:16px;color:var(--emw--color-error, #ff3d00);font-weight:500;text-align:center}.hakuna-ticket-buy{display:flex;justify-content:center;flex-direction:column;height:100%;overflow:hidden}.hakuna-ticket-buy .empty-draw{display:flex;color:var(--emw-hakuna-text-primary, #ffffff);width:335px;padding:28px 20px;justify-content:center;border:1px solid transparent;border-radius:12px;background-origin:border-box;background-clip:padding-box, border-box;background-image:linear-gradient(var(--emw-hakuna-bg-secondary, #120505), var(--emw-hakuna-bg-secondary, #120505)), linear-gradient(to top left, var(--emw-hakuna-color-primary, #c52217) 32%, var(--emw-hakuna-bg-primary, #2c2525) 68%)}.hakuna-ticket-buy-skeleton{display:flex;flex-direction:column;align-items:center;margin:0 auto}.hakuna-ticket-buy-skeleton-ticket{box-sizing:border-box;padding:20px;min-width:336px;max-width:414px;background-color:var(--emw-hakuna-ticket-skeleton-bg, #2d2d2d)}.hakuna-ticket-buy-skeleton-pay{position:fixed;bottom:0;left:0;right:0;padding:16px 24px;background-color:var(--emw-hakuna-ticket-skeleton-bg, #2d2d2d);display:flex;align-items:center;justify-content:space-between}.hakuna-ticket-buy-wrapper{width:100%;display:flex;flex-direction:column;align-items:center;height:100%;overflow-y:auto;padding-bottom:90px;box-sizing:border-box}.hakuna-ticket-buy-list{display:flex;flex-direction:column;gap:12px;min-width:336px;max-width:414px;width:100%}.hakuna-ticket-buy-operation{display:flex;justify-content:center}.hakuna-ticket-buy-pay{position:fixed;bottom:0;left:0;right:0;padding:16px 24px;display:flex;align-items:center;justify-content:space-between;background:var(--emw-hakuna-bg-secondary, #120505)}.hakuna-ticket-buy-pay-info{display:flex;flex-direction:column;gap:10px}.hakuna-ticket-buy-pay-info-item{color:var(--emw-hakuna-text-secondary, #b4a5a5);font-size:12px;font-weight:600}.dialog-content{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px 0}.dialog-content-icon{margin-bottom:16px;display:flex;justify-content:center;align-items:center}.dialog-content-icon svg{display:block}.dialog-content-title{color:var(--emw-hakuna-text-primary, #ffffff);font-size:16px;font-weight:700;text-transform:uppercase}.dialog-content-message{color:var(--emw-hakuna-text-secondary, #b4a5a5);font-size:14px;font-weight:500;width:100%;display:flex;justify-content:center}.dialog-content-footer{display:flex;justify-content:center;gap:16px;width:100%}.confirm-submit-message{width:200px;display:flex;flex-direction:column;gap:2px;justify-content:center}.confirm-submit-message-item{width:100%;display:flex;justify-content:space-between;color:var(--emw-hakuna-text-secondary, #b4a5a5);font-size:14px;font-weight:500}.hakuna-dialog::part(dialog){border:1px solid transparent;border-radius:12px;background-origin:border-box;background-clip:padding-box, border-box;background-image:linear-gradient(var(--emw-hakuna-bg-secondary, #120505), var(--emw-hakuna-bg-secondary, #120505)), linear-gradient(to top left, var(--emw-hakuna-color-primary, #c52217) 32%, var(--emw-hakuna-bg-primary, #2c2525) 68%)}.hakuna-skeleton{animation:skeleton-loading 1s linear infinite alternate}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, #414141)}100%{background-color:var(--emw-skeleton-secondary-color, #2f2929)}}";
|
|
169
172
|
const LotteryHakunaTicketBuyStyle0 = lotteryHakunaTicketBuyCss;
|
|
170
173
|
|
|
171
174
|
const LotteryHakunaTicketBuy = class {
|
|
@@ -174,6 +177,7 @@ const LotteryHakunaTicketBuy = class {
|
|
|
174
177
|
this.goToTicketList = createEvent(this, "TicketSubmission:jumpToHistoryList", 7);
|
|
175
178
|
this.sessionExpired = createEvent(this, "SessionExpired", 7);
|
|
176
179
|
this.goToHomePage = createEvent(this, "TicketBuying:leaveToHomepage", 7);
|
|
180
|
+
this.goToDepositPage = createEvent(this, "TicketBuying:leaveToDepositPage", 7);
|
|
177
181
|
this.resetAllTicketSelection = createEvent(this, "resetAllTicketSelection", 7);
|
|
178
182
|
this.thousandSeparator = (value) => {
|
|
179
183
|
if (value === 0) {
|
|
@@ -487,7 +491,7 @@ const LotteryHakunaTicketBuy = class {
|
|
|
487
491
|
this.dialogInfo = Object.assign(Object.assign({}, this.dialogInfo), { visible: false, loading: false });
|
|
488
492
|
return;
|
|
489
493
|
}
|
|
490
|
-
this.dialogInfo = Object.assign(Object.assign({}, this.dialogInfo), { loading: false, visible: true, title: translate('ticketSubmittedError', this.language), message: translate('ticketSubmittedErrorMessage', this.language), icon: this.getDialogIcon('error'), type: 'ERROR', showLeftBtn:
|
|
494
|
+
this.dialogInfo = Object.assign(Object.assign({}, this.dialogInfo), { loading: false, visible: true, title: translate('ticketSubmittedError', this.language), message: translate('ticketSubmittedErrorMessage', this.language), icon: this.getDialogIcon('error'), type: 'ERROR', showLeftBtn: true, showRightBtn: true, leftBtnText: translate('deposit', this.language), rightBtnText: translate('tryAgain', this.language), leftBtnEvent: this.handleGoToDepositPage.bind(this), rightBtnEvent: this.handleSubmitTickets.bind(this) });
|
|
491
495
|
});
|
|
492
496
|
}
|
|
493
497
|
else {
|
|
@@ -500,6 +504,9 @@ const LotteryHakunaTicketBuy = class {
|
|
|
500
504
|
handleLeaveToHomepage() {
|
|
501
505
|
this.goToHomePage.emit();
|
|
502
506
|
}
|
|
507
|
+
handleGoToDepositPage() {
|
|
508
|
+
this.goToDepositPage.emit();
|
|
509
|
+
}
|
|
503
510
|
getSkeletonEle(style, type) {
|
|
504
511
|
return (h("div", { class: "hakuna-skeleton", style: Object.assign(Object.assign({}, style), { display: type === 'inline' ? 'inline-flex' : 'flex' }) }));
|
|
505
512
|
}
|
|
@@ -522,7 +529,7 @@ const LotteryHakunaTicketBuy = class {
|
|
|
522
529
|
const numberRange = selectionRules.map((item) => item.selectionCount);
|
|
523
530
|
const isAllTicketsSubmitted = this.mainTickets.length > 0 && this.mainTickets.every((ticket) => ticket.isSubmitted);
|
|
524
531
|
const nextDate = (_b = (_a = this.gameData) === null || _a === void 0 ? void 0 : _a.currentDraw) === null || _b === void 0 ? void 0 : _b.date;
|
|
525
|
-
return (h("div", { class: "hakuna-ticket-buy", ref: (el) => (this.stylingContainer = el) }, nextDate ? (h("div", { class: "hakuna-ticket-buy-wrapper" }, h("div", { class: "hakuna-ticket-buy-list" }, this.mainTickets.map((item) => (h("lottery-hakuna-ticket", { key: item.uid, "ticket-id": item.ticketId, allowQuickPick: quickPickAvailable, gameName: this.country || this.gameData.name, "is-submitted": item.isSubmitted, "high-number": highNumber, "low-number": lowNumber, "maximum-allowed": maxinumAllowed, "minimum-allowed": minimumAllowed, "number-range": numberRange, language: this.language, "translation-url": this.translationUrl, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource, "disable-delete": this.mainTickets.length === 1 })))), h("div", { class: "hakuna-ticket-buy-operation" }, h("lottery-button", { variant: "outline", color: "var(--emw-hakuna-color-primary, #C52217)", size: "small", onClick: this.createNewTicket.bind(this) }, h("span", { slot: "icon-left" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.00004 2.33337C7.32221 2.33337 7.58337 2.59454 7.58337 2.91671V6.41671H11.0834C11.4055 6.41671 11.6667 6.67787 11.6667 7.00004C11.6667 7.32221 11.4055 7.58337 11.0834 7.58337H7.58337V11.0834C7.58337 11.4055 7.32221 11.6667 7.00004 11.6667C6.67787 11.6667 6.41671 11.4055 6.41671 11.0834V7.58337H2.91671C2.59454 7.58337 2.33337 7.32221 2.33337 7.00004C2.33337 6.67787 2.59454 6.41671 2.91671 6.41671H6.41671V2.91671C6.41671 2.59454 6.67787 2.33337 7.00004 2.33337Z", fill: "white" }))), h("span", { style: { color: '#fff' } }, translate('addTicket', this.language)))), h("lottery-tipping-dialog", { closable: false, visible: this.dialogInfo.visible, width: "335px", mask: true, maskClosable: true, class: "hakuna-dialog", onCancel: () => (this.dialogInfo = Object.assign(Object.assign({}, this.dialogInfo), { visible: false })) }, h("div", { class: "dialog-content" }, h("div", { class: "dialog-content-icon" }, this.dialogInfo.icon), h("div", { class: "dialog-content-title" }, this.dialogInfo.title), h("div", { class: "dialog-content-message" }, this.dialogInfo.type === 'SUBMIT_CONFIRM' ? (h("div", { class: "confirm-submit-message" }, h("div", { class: "confirm-submit-message-item" }, h("div", { class: "title" }, translate('tickets', this.language), ":"), h("div", { class: "value" }, this.mainTickets.length)), h("div", { class: "confirm-submit-message-item" }, h("div", { class: "title" }, translate('total', this.language), ": "), h("div", { class: "value" }, `${this.currency} ${this.thousandSeparator(this.totalAmount)}`)))) : (h("span", null, this.dialogInfo.message)))), h("div", { slot: "footer", class: "dialog-content-footer" }, h("lottery-button", { variant: "outline", color: "var(--emw-hakuna-color-primary, #C52217)", onClick: this.dialogInfo.leftBtnEvent,
|
|
532
|
+
return (h("div", { class: "hakuna-ticket-buy", ref: (el) => (this.stylingContainer = el) }, nextDate ? (h("div", { class: "hakuna-ticket-buy-wrapper" }, h("div", { class: "hakuna-ticket-buy-list" }, this.mainTickets.map((item) => (h("lottery-hakuna-ticket", { key: item.uid, "ticket-id": item.ticketId, allowQuickPick: quickPickAvailable, gameName: this.country || this.gameData.name, "is-submitted": item.isSubmitted, "high-number": highNumber, "low-number": lowNumber, "maximum-allowed": maxinumAllowed, "minimum-allowed": minimumAllowed, "number-range": numberRange, language: this.language, "translation-url": this.translationUrl, "client-styling": this.clientStyling, "client-styling-url": this.clientStylingUrl, "mb-source": this.mbSource, "disable-delete": this.mainTickets.length === 1 })))), h("div", { class: "hakuna-ticket-buy-operation" }, h("lottery-button", { variant: "outline", color: "var(--emw-hakuna-color-primary, #C52217)", size: "small", onClick: this.createNewTicket.bind(this) }, h("span", { slot: "icon-left" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 14 14", fill: "none" }, h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M7.00004 2.33337C7.32221 2.33337 7.58337 2.59454 7.58337 2.91671V6.41671H11.0834C11.4055 6.41671 11.6667 6.67787 11.6667 7.00004C11.6667 7.32221 11.4055 7.58337 11.0834 7.58337H7.58337V11.0834C7.58337 11.4055 7.32221 11.6667 7.00004 11.6667C6.67787 11.6667 6.41671 11.4055 6.41671 11.0834V7.58337H2.91671C2.59454 7.58337 2.33337 7.32221 2.33337 7.00004C2.33337 6.67787 2.59454 6.41671 2.91671 6.41671H6.41671V2.91671C6.41671 2.59454 6.67787 2.33337 7.00004 2.33337Z", fill: "white" }))), h("span", { style: { color: '#fff' } }, translate('addTicket', this.language)))), h("lottery-tipping-dialog", { closable: false, visible: this.dialogInfo.visible, width: "335px", mask: true, maskClosable: true, class: "hakuna-dialog", onCancel: () => (this.dialogInfo = Object.assign(Object.assign({}, this.dialogInfo), { visible: false })) }, h("div", { class: "dialog-content" }, h("div", { class: "dialog-content-icon" }, this.dialogInfo.icon), h("div", { class: "dialog-content-title" }, this.dialogInfo.title), h("div", { class: "dialog-content-message" }, this.dialogInfo.type === 'SUBMIT_CONFIRM' ? (h("div", { class: "confirm-submit-message" }, h("div", { class: "confirm-submit-message-item" }, h("div", { class: "title" }, translate('tickets', this.language), ":"), h("div", { class: "value" }, this.mainTickets.length)), h("div", { class: "confirm-submit-message-item" }, h("div", { class: "title" }, translate('total', this.language), ": "), h("div", { class: "value" }, `${this.currency} ${this.thousandSeparator(this.totalAmount)}`)))) : this.dialogInfo.type === 'ERROR' ? (h("div", null, h("div", { style: { marginBottom: '10px' } }, translate('ticketSubmittedErrorMessage1', this.language)), h("div", null, translate('ticketSubmittedErrorMessage2', this.language)))) : (h("span", null, this.dialogInfo.message)))), h("div", { slot: "footer", class: "dialog-content-footer" }, h("lottery-button", { variant: "outline", color: "var(--emw-hakuna-color-primary, #C52217)", onClick: this.dialogInfo.leftBtnEvent }, h("span", { style: { color: '#fff' } }, this.dialogInfo.leftBtnText, " ")), h("lottery-button", { variant: "primary", color: "var(--emw-hakuna-color-primary, #C52217)", onClick: this.dialogInfo.rightBtnEvent, text: this.dialogInfo.rightBtnText, loading: this.dialogInfo.loading }))))) : (h("div", { class: "empty-draw" }, translate('emptyDraw', this.language))), h("div", { class: "hakuna-ticket-buy-pay" }, h("div", { class: "hakuna-ticket-buy-pay-info" }, h("div", { class: "hakuna-ticket-buy-pay-info-item" }, translate('ticket', this.language), ": ", this.mainTickets.length), h("div", { class: "hakuna-ticket-buy-pay-info-item" }, translate('price', this.language), ": ", `${this.currency} ${this.thousandSeparator(this.totalAmount)}`)), h("div", { class: "hakuna-ticket-buy-pay-button" }, h("lottery-button", { variant: "primary", color: "var(--emw-hakuna-color-primary, #C52217)", text: translate('payNow', this.language), disabled: !isAllTicketsSubmitted, onClick: this.handleConfirmSubmit.bind(this) })))));
|
|
526
533
|
}
|
|
527
534
|
}
|
|
528
535
|
static get assetsDirs() { return ["../static"]; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{L as LotteryHakunaTicketBuy}from"./lottery-hakuna-ticket-buy-
|
|
1
|
+
export{L as LotteryHakunaTicketBuy}from"./lottery-hakuna-ticket-buy-e97eb8d9.js";import"./index-1f778cb5.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as e,g as i,c as o}from"./index-1f778cb5.js";import{s as r,a as n,b as a}from"./lottery-hakuna-ticket-buy-a9f8e014.js";export{L as lottery_hakuna_ticket_buy}from"./lottery-hakuna-ticket-buy-a9f8e014.js";const l=["ro","en","fr","ar","hr","zh"],s={en:{loading:"Loading"},ro:{},fr:{},ar:{},hr:{}},c=class{constructor(e){t(this,e),this.handleClick=t=>{if(this.disabled)return;const e=this.host.shadowRoot.querySelector(".btn");if(!e)return;const i=e.getBoundingClientRect(),o=Math.max(i.width,i.height),r={top:t.clientY-i.top-o/2,left:t.clientX-i.left-o/2,size:o};this.ripples=[...this.ripples,r],setTimeout((()=>{this.ripples=this.ripples.filter((t=>t!==r))}),600)},this.variant="primary",this.size="medium",this.color=void 0,this.disabled=!1,this.loading=!1,this.text=void 0,this.mbSource=void 0,this.language="en",this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl="",this.ripples=[]}handleClientStylingChange(t,e){t!=e&&r(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&n(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`)}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&r(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl))}componentWillLoad(){this.translationUrl&&(async t=>{if(t)try{const i=await fetch(t);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const o=await i.json();e=o,Object.keys(e).forEach((t=>{for(let i in e[t])s[t][i]=e[t][i]}))}catch(t){console.error("Failed to fetch or parse translations from URL:",t)}var e})(this.translationUrl)}render(){const{variant:t,disabled:i,size:o,color:r}=this,n=i||this.loading,a={};if(r)switch(t){case"primary":default:Object.assign(a,{backgroundColor:r,borderColor:r});break;case"outline":case"dashed":Object.assign(a,{color:r,borderColor:r});break;case"text":Object.assign(a,{color:r})}return e("button",{key:"aa74ad98c90e7548228557bf8a8d26b125d4a83a",class:{btn:!0,[`btn--${t}`]:!0,[`btn--${o}`]:!0,"btn--loading":this.loading},style:r?a:void 0,disabled:n,onClick:this.handleClick,ref:t=>this.stylingContainer=t},this.loading?e("div",{class:"loading-container"},e("span",{class:"content"},this.text||(()=>{const t=this.language;let e=s[void 0!==t&&l.includes(t)?t:"en"].loading;return e})()),e("span",{class:"spinner"})):e("span",{class:"content"},e("slot",{name:"icon-left"}),this.text||e("slot",null),e("slot",{name:"icon-right"})),e("div",{key:"302ea02be395bb24989d4abc040a513e23fa029a",class:"ripple-container"},this.ripples.map(((t,i)=>e("span",{key:i,class:"ripple",style:{top:`${t.top}px`,left:`${t.left}px`,width:`${t.size}px`,height:`${t.size}px`}})))))}get host(){return i(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};c.style=":host{display:inline-block}.btn{font:inherit;position:relative;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:var(--lottery-button-border-radius, 6px);font-weight:var(--lottery-button-font-weight, 500);cursor:pointer;outline:none;overflow:hidden;transition:var(--lottery-button-transition, background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s);user-select:none;-webkit-tap-highlight-color:transparent;box-shadow:var(--lottery-button-box-shadow, 0 2px 4px 0 rgba(0, 0, 0, 0.5))}.btn .content{position:relative;display:inline-flex;align-items:center;gap:var(--lottery-button-content-gap, 0.5em)}.btn .content ::slotted(span){display:inline-flex;align-items:center}.btn:hover:not(:disabled){box-shadow:var(--lottery-button-hover-box-shadow, 0 4px 8px 0 rgba(0, 0, 0, 0.5))}.btn:disabled{cursor:not-allowed;opacity:var(--lottery-button-disabled-opacity, 0.5)}.btn .loading-container{display:flex;align-items:center}.btn--loading{position:relative}.btn .spinner{display:inline-block;width:1em;height:1em;border:var(--lottery-button-spinner-border, 2px solid rgba(255, 255, 255, 0.3));border-radius:50%;border-top-color:var(--lottery-button-spinner-color, white);animation:spin 1s ease-in-out infinite;margin-left:0.5em;vertical-align:middle}.btn--small .spinner{width:0.8em;height:0.8em}.btn--large .spinner{width:1.2em;height:1.2em}@keyframes spin{to{transform:rotate(360deg)}}.btn--primary{background-color:var(--emw--color-primary, #0d196e);color:var(--emw--color-typography-inverse, #fff)}.btn--primary:hover:not(:disabled){background-color:var(--emw--color-primary-variant, #1367e7)}.btn--primary:active:not(:disabled){background-color:var(--lottery-button-primary-active-bg, #08104a)}.btn--outline .spinner,.btn--dashed .spinner,.btn--text .spinner{border-top-color:currentColor;border-color:var(--lottery-button-spinner-inverse-border-color, rgba(0, 0, 0, 0.2))}.btn--outline{background-color:var(--emw--color-background, #fff);border-color:var(--lottery-button-outline-border-color, #dcdcdc);color:var(--emw--color-typography, #000)}.btn--outline:hover:not(:disabled){background-color:var(--emw--color-background-tertiary, #ccc);border-color:var(--lottery-button-outline-hover-border-color, #a6a6a6)}.btn--outline:active:not(:disabled){background-color:var(--lottery-button-outline-active-bg, #e6e6e6)}.btn--dashed{background-color:transparent;border-style:dashed;border-color:var(--lottery-button-dashed-border-color, #dcdcdc);color:var(--lottery-button-dashed-color, #333)}.btn--dashed:hover:not(:disabled){border-color:var(--lottery-button-dashed-hover-border-color, #a6a6a6);color:var(--lottery-button-dashed-hover-color, #0052d9)}.btn--text{background-color:transparent;color:var(--lottery-button-text-color, #0052d9);border-color:transparent}.btn--text:hover:not(:disabled){background-color:var(--lottery-button-text-hover-bg, #f2f2f2)}.btn--text:active:not(:disabled){background-color:var(--lottery-button-text-active-bg, #e6e6e6)}.btn--custom-color:hover:not(:disabled){opacity:var(--lottery-button-custom-hover-opacity, 0.9)}.btn--custom-color:active:not(:disabled){opacity:var(--lottery-button-custom-active-opacity, 0.8)}.btn--small{height:var(--lottery-button-small-height, 28px);font-size:var(--lottery-button-small-font-size, 12px);padding:var(--lottery-button-small-padding, 0 12px)}.btn--medium{height:var(--lottery-button-medium-height, 34px);font-size:var(--lottery-button-medium-font-size, 14px);padding:var(--lottery-button-medium-padding, 0 18px)}.btn--large{height:var(--lottery-button-large-height, 40px);font-size:var(--lottery-button-large-font-size, 16px);padding:var(--lottery-button-large-padding, 0 24px)}.ripple-container{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;border-radius:inherit}.ripple{position:absolute;border-radius:50%;background-color:var(--lottery-button-ripple-light, rgba(255, 255, 255, 0.3));transform:scale(0);animation:ripple-animation 600ms linear}.btn--outline .ripple,.btn--dashed .ripple,.btn--text .ripple{background-color:var(--lottery-button-ripple-dark, rgba(0, 0, 0, 0.03))}@keyframes ripple-animation{to{transform:scale(4);opacity:0}}";const h=class{constructor(e){t(this,e),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.headerTitle="",this.collapsed=!0,this.isOpen=!1,this.hasSummary=!1}handleClientStylingChange(t,e){t!=e&&r(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&n(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`)}componentWillLoad(){this.isOpen=!this.collapsed}componentWillRender(){this.hasSummary=!!this.el.querySelector('[slot="summary"]')}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&r(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}async toggle(){this.isOpen=!this.isOpen}render(){const t=this.isOpen||this.hasSummary;return e("div",{key:"5e28ba28bf46f6a22f749bbd878aef8972bb7eeb",ref:t=>this.stylingContainer=t,class:"lottery-hakuna-collapse"},e("div",{key:"ec42a23932c7e0652476743c1cafcfe7e411c2aa",class:"header",onClick:()=>this.toggle()},e("div",{key:"152e98bb7fc69274d61ffff0d6de9f76a1df90f8",class:"header-content"},this.headerTitle&&e("span",{key:"0acc51d711ca12fa1a666dbe1678071a37fa0aff",class:"title"},this.headerTitle)),e("span",{key:"ad31e6e3a249a9dca394e725e805422297811f85",class:{icon:!0,"is-open":this.isOpen}},e("svg",{key:"14bc41acc77204fcb1966f8966dc6feb49730518",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},e("path",{key:"bac152fc477b275a1792264a35dba2765cf2687f","fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.96967 6.21967C4.26256 5.92678 4.73744 5.92678 5.03033 6.21967L9 10.1893L12.9697 6.21967C13.2626 5.92678 13.7374 5.92678 14.0303 6.21967C14.3232 6.51256 14.3232 6.98744 14.0303 7.28033L9.53033 11.7803C9.23744 12.0732 8.76256 12.0732 8.46967 11.7803L3.96967 7.28033C3.67678 6.98744 3.67678 6.51256 3.96967 6.21967Z",fill:"currentColor"})))),t&&e("div",{key:"0358ec8ccc21286a31f6ffcb770efa6c1bcc36ea",class:"content"},e("slot",this.isOpen?null:{name:"summary"})))}get el(){return i(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};var d;h.style=":host{display:block;width:100%;box-sizing:border-box}.lottery-hakuna-collapse{border:var(--lottery-hakuna-collapse-border-width, 1px) solid transparent;border-radius:var(--lottery-hakuna-collapse-border-radius, 12px);background-origin:border-box;background-clip:padding-box, border-box;background-image:linear-gradient(var(--lottery-hakuna-collapse-bg, #120505), var(--lottery-hakuna-collapse-bg, #120505)), linear-gradient(to top left, var(--lottery-hakuna-collapse-border-gradient-start, #c52217) var(--lottery-hakuna-collapse-border-gradient-start-stop, 32%), var(--lottery-hakuna-collapse-border-gradient-end, #2c2525) var(--lottery-hakuna-collapse-border-gradient-end-stop, 68%));overflow:hidden;margin-bottom:var(--lottery-hakuna-collapse-margin-bottom, 10px)}.lottery-hakuna-collapse .header{display:flex;justify-content:space-between;align-items:center;padding:var(--lottery-hakuna-collapse-header-padding, 20px);cursor:pointer;user-select:none}.lottery-hakuna-collapse .header .header-content{display:flex;align-items:center;flex:1;gap:var(--lottery-hakuna-collapse-header-gap, 8px)}.lottery-hakuna-collapse .header .title{font-size:var(--lottery-hakuna-collapse-title-size, 16px);font-weight:var(--lottery-hakuna-collapse-title-weight, 600);color:var(--lottery-hakuna-collapse-title-color, #fff)}.lottery-hakuna-collapse .header .icon{color:var(--lottery-hakuna-collapse-icon-color, #fff);font-size:var(--lottery-hakuna-collapse-icon-size, 12px);transition:transform 0.3s ease}.lottery-hakuna-collapse .header .icon.is-open{transform:rotate(180deg)}.lottery-hakuna-collapse .content{padding:var(--lottery-hakuna-collapse-content-padding, 0 20px 20px 20px);color:var(--lottery-hakuna-collapse-content-color, #fff);font-size:var(--lottery-hakuna-collapse-content-size, 14px);line-height:var(--lottery-hakuna-collapse-content-line-height, 1.5)}",function(t){t.UNSELECTED="unselected",t.SELECTED="selected"}(d||(d={}));const u=["ro","en","hr"],b={en:{ticket:"Ticket",loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",quickPick:"Quick Pick",submit:"SUBMIT"},ro:{loading:"Se incarca, va rugam asteptati ...",error:"A fost o eroare in timp ce asteptam datele",multiplier:"Multiplicator",numberOfDraws:"Numarul de extrageri",wagerPerDraw:"Pariul per extragere",resetButton:"Reseteaza",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},fr:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",multiplier:"Multiplier",numberOfDraws:"Number of Draws",wagerPerDraw:"Wager per Draw",resetButton:"Reset",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},ar:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",multiplier:"Multiplier",numberOfDraws:"Number of Draws",wagerPerDraw:"Wager per Draw",resetButton:"Reset",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},hr:{loading:"Učitavanje, molimo pričekajte ...",error:"Došlo je do pogreške prilikom pokušaja dohvaćanja podataka",multiplier:"Multiplikator",numberOfDraws:"Broj izvlačenja",wagerPerDraw:"Ulog po izvlačenju",resetButton:"Resetiraj",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"}},g=(t,e)=>{const i=e;return b[void 0!==i&&u.includes(i)?i:"en"][t]},p=class{constructor(e){t(this,e),this.ticketUpdateEvent=o(this,"ticketUpdate",7),this.deleteTicket=o(this,"deleteTicket",7),this.editTicket=o(this,"editTicket",7),this.saveTicket=o(this,"saveTicket",7),this.MAIN_SELECTION_NAME="mainSelection",this.gameName="South Africa",this.allowQuickPick=!0,this.highNumber=6,this.lowNumber=6,this.maximumAllowed=6,this.minimumAllowed=2,this.numberRange=[6],this.useCollapse=!0,this.isSubmitted=!1,this.ticketId=1,this.language="en",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl=void 0,this.disableDelete=!1,this.grids=[],this.ticketDone=[],this.quickPicks=[]}handleClientStylingChange(t,e){t!=e&&r(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&n(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`)}componentWillLoad(){this.translationUrl&&(async t=>{if(t)try{const i=await fetch(t);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const o=await i.json();e=o,Object.keys(e).forEach((t=>{for(let i in e[t])b[t][i]=e[t][i]}))}catch(t){console.error("Failed to fetch or parse translations from URL:",t)}var e})(this.translationUrl)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&r(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl)),this.fillInGrids(1)}toggleAutoSelection(t){this.ticketDone=[...this.ticketDone.slice(0,t),!0,...this.ticketDone.slice(t+1)],this.quickPicks[t]=!0,this.clearSingleGrid(t),this.quickPickSelection(t)}toggleResetSelection(t){this.ticketDone=[...this.ticketDone.slice(0,t),!1,...this.ticketDone.slice(t+1)];const e=[...this.quickPicks];e[t]=!1,this.quickPicks=e,this.clearSingleGrid(t)}clearAllGrid(){this.grids.forEach(((t,e)=>{this.toggleResetSelection(e)}))}toggleResetAllSelection(){this.fillInGrids(1),this.ticketDone=[!1],this.quickPicks=[!1],this.updateGridStatus([],this.MAIN_SELECTION_NAME,0),this.editTicket.emit({ticketId:this.ticketId})}updateGridStatus(t,e,i){this.ticketUpdateEvent.emit({selectionType:e,id:this.ticketId,index:i,selectedNumbers:t,quickPicks:this.quickPicks})}bulletGroupUpdateSelectionHandler(t){var e;t.stopPropagation();const{newSelectedBulletTexts:i,selectionGroupId:o}=t.detail;if(!o)return void console.error("Miss selectionGroupId");const r=o.split("-"),n=Number(r[0]),a=r[1],l=i?null===(e=i.split(","))||void 0===e?void 0:e.sort(((t,e)=>Number(t)-Number(e))):[];this.grids=this.grids.map(((t,e)=>e===n&&a===this.MAIN_SELECTION_NAME?Object.assign(Object.assign({},t),{selection:i}):t)),this.ticketDone=this.numberRange.includes(l.length)?[...this.ticketDone.slice(0,n),!0,...this.ticketDone.slice(n+1)]:[...this.ticketDone.slice(0,n),!1,...this.ticketDone.slice(n+1)],this.quickPicks=[...this.quickPicks.slice(0,n),!1,...this.quickPicks.slice(n+1)],this.updateGridStatus(l,a,n)}shuffleArray(t){const e=[];for(;t.length>0;){const i=Math.floor(Math.random()*t.length);e.push(t.splice(i,1)[0])}return e}quickPickSelection(t){const{highNumber:e,lowNumber:i}=this,o=this.numberRange[0];let r=Array.from({length:e-i+1},((t,e)=>i+e));r=this.shuffleArray(r),r=r.slice(0,o),r.sort(((t,e)=>t-e)),this.grids=this.grids.map(((e,i)=>i===t?Object.assign(Object.assign({},e),{selection:r.join(",")}):e)),this.updateGridStatus(r.map((t=>t.toString())),this.MAIN_SELECTION_NAME,t)}clearSingleGrid(t){this.grids=this.grids.map(((e,i)=>i===t?Object.assign(Object.assign({},e),{selection:""}):e)),this.updateGridStatus([],this.MAIN_SELECTION_NAME,t)}fillInGrids(t){const{highNumber:e,lowNumber:i}=this;this.grids=Array.from({length:t},((t,o)=>({selection:"",bulletTexts:Array.from({length:e-i+1},((t,e)=>i+e)).join(","),groupIdx:o,isSubmitted:!1})))}renderMainPlaceBet(){const t=this.numberRange[0];return e("div",{class:"hakuna-ticket-content"},this.grids.map(((i,o)=>{const r=!i.selection,n=i.selection?i.selection.split(",").filter(Boolean).length:0;return e("div",null,e("div",{class:"hakuna-ticket-content-selection"},e("div",{class:"hakuna-ticket-content-selection-text"},"Pick ",t," numbers"),e("div",{class:"hakuna-ticket-content-selection-dots"},Array.from({length:t},((t,e)=>e+1)).map((t=>e("div",{key:t,class:{"hakuna-ticket-content-selection-dots-item":!0,active:t<=n}}))))),e("div",{class:{"hakuna-ticket-content-bullets":!0,disabled:this.isSubmitted}},e("lottery-selection-group",{type:"bet",hasBorder:!1,bulletTexts:i.bulletTexts,selectionGroupId:`${i.groupIdx}-${this.MAIN_SELECTION_NAME}`,"selected-bullet-texts":i.selection,maxSelectedCount:t,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})),e("div",{class:"hakuna-ticket-content-operation",style:{display:"flex",alignItems:"center"}},e("div",{class:"hakuna-ticket-content-operation--left"},e("div",{class:{"icon-btn":!0,disabled:r||this.isSubmitted},onClick:()=>!r&&this.toggleResetSelection(o)},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.833374 9.99996C0.833374 5.39759 4.56433 1.66663 9.16671 1.66663C11.4687 1.66663 13.554 2.60112 15.0613 4.10944C15.5943 4.64284 16.1651 5.30202 16.6667 5.91199V3.33329C16.6667 2.87306 17.0398 2.49996 17.5 2.49996C17.9603 2.49996 18.3334 2.87306 18.3334 3.33329V8.33329C18.3334 8.79353 17.9603 9.16663 17.5 9.16663H12.5C12.0398 9.16663 11.6667 8.79353 11.6667 8.33329C11.6667 7.87306 12.0398 7.49996 12.5 7.49996H15.8077C15.2309 6.77602 14.5138 5.91942 13.8824 5.28755C12.6749 4.07924 11.0087 3.33329 9.16671 3.33329C5.48481 3.33329 2.50004 6.31806 2.50004 9.99996C2.50004 13.6819 5.48481 16.6666 9.16671 16.6666C12.2048 16.6666 14.7703 14.6337 15.5729 11.8523C15.7005 11.4101 16.1624 11.155 16.6046 11.2826C17.0468 11.4102 17.3018 11.8721 17.1742 12.3143C16.1713 15.79 12.9671 18.3333 9.16671 18.3333C4.56433 18.3333 0.833374 14.6023 0.833374 9.99996Z",fill:"currentColor"})))),e("div",{class:"hakuna-ticket-content-operation--right"},this.allowQuickPick&&e("lottery-button",{variant:"outline",color:"var(--emw-hakuna-color-primary, #C52217)",size:"small",onClick:this.toggleAutoSelection.bind(this,o),disabled:this.isSubmitted},e("span",{slot:"icon-left"},e("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.81557 0.631525C8.05311 0.734641 8.19424 0.982014 8.16212 1.23897L7.66075 5.24995L11.2745 5.24995C11.4151 5.24992 11.5575 5.2499 11.6738 5.26043C11.7838 5.27039 11.9945 5.29674 12.1772 5.44439C12.3864 5.61342 12.5062 5.86924 12.5021 6.13814C12.4986 6.37303 12.384 6.55174 12.3212 6.64264C12.2548 6.73875 12.1636 6.84811 12.0736 6.95609L6.86476 13.2067C6.69898 13.4057 6.42189 13.4715 6.18435 13.3684C5.94681 13.2653 5.80568 13.0179 5.8378 12.7609L6.33917 8.74995L2.72543 8.74995C2.58485 8.74998 2.44246 8.75001 2.32613 8.73947C2.21611 8.72951 2.00543 8.70316 1.82272 8.55551C1.61355 8.38648 1.49373 8.13066 1.49778 7.86176C1.50132 7.62688 1.61595 7.44816 1.67873 7.35726C1.74512 7.26115 1.8363 7.15177 1.92632 7.04379C1.93078 7.03844 1.93523 7.0331 1.93968 7.02776L7.13516 0.793177C7.30094 0.59424 7.57803 0.52841 7.81557 0.631525ZM2.9954 7.58328H6.99996C7.16728 7.58328 7.32654 7.65513 7.43727 7.78057C7.548 7.906 7.59954 8.07295 7.57879 8.23897L7.24224 10.9314L11.0045 6.41662H6.99996C6.83264 6.41662 6.67338 6.34477 6.56265 6.21934C6.45192 6.0939 6.40038 5.92696 6.42113 5.76093L6.75768 3.06855L2.9954 7.58328Z",fill:"white"}))),e("span",{style:{color:"#fff"}},g("quickPick",this.language))),e("lottery-button",{variant:"primary",color:"var(--emw-hakuna-color-primary, #C52217)",size:"small",text:g("submit",this.language),disabled:!this.ticketDone[o]||this.isSubmitted,onClick:this.handleSaveTicket.bind(this)}))))})))}renderCurSelectionButton(t,i){return t===d.UNSELECTED?e("div",{class:"cur-selection-btn unselected"},"?"):e("div",{class:"cur-selection-btn active"}," ",i)}handleEditTicket(){var t;const{ticketId:e}=this;this.editTicket.emit({ticketId:e}),null===(t=this.collapseComponent)||void 0===t||t.toggle()}handleDelTicket(){const{ticketId:t}=this;this.deleteTicket.emit({ticketId:t})}handleSaveTicket(){var t;this.saveTicket.emit({ticketId:this.ticketId}),null===(t=this.collapseComponent)||void 0===t||t.toggle()}renderCurSelection(){const t=this.numberRange[0];return e("div",{class:"hakuna-ticket-summary"},this.grids.map(((i,o)=>{const r=i.selection?i.selection.split(",").filter(Boolean):[];return r.sort(((t,e)=>Number(t)-Number(e))),e("div",{key:o,class:"hakuna-ticket-summary-item"},e("div",{class:"hakuna-ticket-summary-selection"},Array.from({length:t}).map(((t,e)=>this.renderCurSelectionButton(e<r.length&&this.isSubmitted?d.SELECTED:d.UNSELECTED,r[e])))),e("div",{class:"hakuna-ticket-summary-operation"},e("div",{class:{"icon-btn":!0,disabled:!this.isSubmitted},onClick:()=>this.isSubmitted&&this.handleEditTicket()},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"19",height:"19",viewBox:"0 0 19 19",fill:"none"},e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.9173 0.757664C14.9276 -0.252556 16.5654 -0.252554 17.5757 0.757667C18.5859 1.76789 18.5859 3.40578 17.5757 4.41601L9.65042 12.3413C9.63402 12.3577 9.61776 12.3739 9.60164 12.3901C9.36341 12.6288 9.15337 12.8392 8.90014 12.9944C8.67769 13.1307 8.43517 13.2312 8.18147 13.2921C7.89269 13.3614 7.59538 13.3611 7.25815 13.3608C7.23533 13.3608 7.21232 13.3608 7.18912 13.3608H5.80132C5.34361 13.3608 4.97256 12.9897 4.97256 12.532V11.1442C4.97256 11.121 4.97254 11.098 4.97251 11.0752C4.9722 10.738 4.97192 10.4406 5.04125 10.1519C5.10216 9.89817 5.20262 9.65564 5.33894 9.43319C5.49411 9.17997 5.70454 8.96993 5.94322 8.7317C5.95937 8.71557 5.97566 8.69932 5.99206 8.68291L13.9173 0.757664ZM16.4036 1.92971C16.0407 1.5668 15.4523 1.5668 15.0894 1.92971L7.16411 9.85496C6.84954 10.1695 6.79154 10.2351 6.75221 10.2992C6.70677 10.3734 6.67328 10.4542 6.65298 10.5388C6.63541 10.612 6.63008 10.6994 6.63008 11.1442V11.7032H7.18912C7.63398 11.7032 7.72134 11.6979 7.79453 11.6803C7.8791 11.66 7.95994 11.6265 8.03409 11.5811C8.09827 11.5418 8.16381 11.4838 8.47837 11.1692L16.4036 3.24396C16.7665 2.88104 16.7665 2.29263 16.4036 1.92971ZM4.7726 1.75807L8.28763 1.75807C8.74535 1.75807 9.11639 2.12912 9.11639 2.58684C9.11639 3.04455 8.74535 3.4156 8.28763 3.4156H4.80683C4.09693 3.4156 3.61434 3.41624 3.24132 3.44672C2.87798 3.47641 2.69217 3.53021 2.56255 3.59626C2.25067 3.75517 1.9971 4.00874 1.83819 4.32062C1.77214 4.45024 1.71833 4.63605 1.68865 4.9994C1.65817 5.37241 1.65753 5.855 1.65753 6.5649V13.5265C1.65753 14.2364 1.65817 14.719 1.68865 15.092C1.71833 15.4554 1.77214 15.6412 1.83819 15.7708C1.9971 16.0827 2.25067 16.3362 2.56255 16.4951C2.69217 16.5612 2.87798 16.615 3.24132 16.6447C3.61434 16.6752 4.09692 16.6758 4.80683 16.6758H11.7684C12.4783 16.6758 12.9609 16.6752 13.3339 16.6447C13.6973 16.615 13.8831 16.5612 14.0127 16.4951C14.3246 16.3362 14.5782 16.0827 14.7371 15.7708C14.8031 15.6412 14.8569 15.4554 14.8866 15.092C14.9171 14.719 14.9177 14.2364 14.9177 13.5265V10.0457C14.9177 9.58799 15.2888 9.21694 15.7465 9.21694C16.2042 9.21694 16.5753 9.58799 16.5753 10.0457V13.5608C16.5753 14.2279 16.5753 14.7785 16.5386 15.227C16.5006 15.6928 16.4189 16.1211 16.2139 16.5233C15.8961 17.1471 15.389 17.6542 14.7652 17.972C14.363 18.177 13.9348 18.2586 13.4689 18.2967C13.0204 18.3334 12.4698 18.3333 11.8027 18.3333H4.77258C4.10546 18.3333 3.55487 18.3334 3.10635 18.2967C2.6405 18.2586 2.21228 18.177 1.81005 17.972C1.18628 17.6542 0.679145 17.1471 0.36132 16.5233C0.156374 16.1211 0.0746879 15.6928 0.0366268 15.227C-1.89071e-05 14.7785 -1.02138e-05 14.2279 3.57439e-07 13.5607V6.53067C-1.02138e-05 5.86354 -1.89071e-05 5.31294 0.0366268 4.86442C0.0746879 4.39858 0.156374 3.97035 0.36132 3.56812C0.679145 2.94436 1.18628 2.43722 1.81005 2.11939C2.21228 1.91445 2.6405 1.83276 3.10635 1.7947C3.55487 1.75805 4.10547 1.75806 4.7726 1.75807Z",fill:"currentColor"}))),e("div",{class:{"icon-btn":!0,disabled:this.disableDelete},onClick:()=>!this.disableDelete&&this.handleDelTicket()},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9.30123 0.833253H10.6988C11.1381 0.833238 11.5171 0.833225 11.8292 0.858728C12.1587 0.885646 12.4863 0.945075 12.8017 1.10574C13.2721 1.34542 13.6545 1.72787 13.8942 2.19828C14.0549 2.51359 14.1143 2.84128 14.1412 3.17073C14.1641 3.45054 14.1664 3.78406 14.1667 4.16659H17.5C17.9603 4.16659 18.3334 4.53968 18.3334 4.99992C18.3334 5.46016 17.9603 5.83325 17.5 5.83325H16.6667V14.3677C16.6667 15.0385 16.6667 15.5921 16.6299 16.0431C16.5916 16.5115 16.5095 16.9421 16.3034 17.3466C15.9838 17.9738 15.4739 18.4837 14.8467 18.8033C14.4422 19.0094 14.0116 19.0915 13.5432 19.1298C13.0922 19.1666 12.5386 19.1666 11.8678 19.1666H8.13225C7.46145 19.1666 6.90782 19.1666 6.45683 19.1298C5.98842 19.0915 5.55783 19.0094 5.15339 18.8033C4.52618 18.4837 4.01624 17.9738 3.69667 17.3466C3.49059 16.9421 3.40845 16.5115 3.37018 16.0431C3.33333 15.5921 3.33334 15.0385 3.33335 14.3677L3.33335 5.83325H2.50002C2.03978 5.83325 1.66669 5.46016 1.66669 4.99992C1.66669 4.53968 2.03978 4.16659 2.50002 4.16659H5.83338C5.83361 3.78406 5.83597 3.45054 5.85883 3.17073C5.88575 2.84128 5.94518 2.51359 6.10584 2.19828C6.34552 1.72787 6.72797 1.34542 7.19838 1.10574C7.51369 0.945075 7.84138 0.885646 8.17083 0.858728C8.48297 0.833225 8.86194 0.833238 9.30123 0.833253ZM5.00002 5.83325V14.3333C5.00002 15.0471 5.00067 15.5323 5.03131 15.9074C5.06116 16.2727 5.11527 16.4596 5.18168 16.5899C5.34146 16.9035 5.59643 17.1585 5.91004 17.3183C6.04037 17.3847 6.22721 17.4388 6.59255 17.4686C6.96763 17.4993 7.45287 17.4999 8.16669 17.4999H11.8334C12.5472 17.4999 13.0324 17.4993 13.4075 17.4686C13.7728 17.4388 13.9597 17.3847 14.09 17.3183C14.4036 17.1585 14.6586 16.9035 14.8184 16.5899C14.8848 16.4596 14.9389 16.2727 14.9687 15.9074C14.9994 15.5323 15 15.0471 15 14.3333V5.83325H5.00002ZM12.5 4.16659H7.50008C7.50045 3.779 7.503 3.51407 7.51996 3.30645C7.53846 3.08006 7.56985 2.99613 7.59085 2.95493C7.67074 2.79813 7.79823 2.67064 7.95503 2.59075C7.99623 2.56975 8.08016 2.53836 8.30655 2.51986C8.54266 2.50057 8.85289 2.49992 9.33335 2.49992H10.6667C11.1471 2.49992 11.4574 2.50057 11.6935 2.51986C11.9199 2.53836 12.0038 2.56975 12.045 2.59075C12.2018 2.67064 12.3293 2.79813 12.4092 2.95493C12.4302 2.99613 12.4616 3.08006 12.4801 3.30645C12.497 3.51407 12.4996 3.779 12.5 4.16659ZM8.33335 8.74992C8.79359 8.74992 9.16669 9.12302 9.16669 9.58325V13.7499C9.16669 14.2102 8.79359 14.5833 8.33335 14.5833C7.87312 14.5833 7.50002 14.2102 7.50002 13.7499V9.58325C7.50002 9.12302 7.87312 8.74992 8.33335 8.74992ZM11.6667 8.74992C12.1269 8.74992 12.5 9.12302 12.5 9.58325V13.7499C12.5 14.2102 12.1269 14.5833 11.6667 14.5833C11.2064 14.5833 10.8334 14.2102 10.8334 13.7499V9.58325C10.8334 9.12302 11.2064 8.74992 11.6667 8.74992Z",fill:"currentColor"})))))})))}render(){return e("div",{key:"ec4162e1484e14c2ae0ac18961288319ef4bda2b",class:"hakuna-ticket",ref:t=>this.stylingContainer=t},e("lottery-hakuna-collapse",{key:"f8ab5f8595947e840fdeb549dca5582eb5d54f0a",ref:t=>this.collapseComponent=t,"header-title":`${this.gameName} #${this.ticketId}`,footer:!0,collapsed:!1,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource},this.renderMainPlaceBet(),e("div",{key:"e68dd5bd71f166d26d75b73d747bc3749bd8edd2",slot:"summary"},this.renderCurSelection())))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};p.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{--emw--color-background-secondary:var(--emw-hakuna-bg-secondary, #120505);--emw--color-primary:var(--emw-hakuna-color-primary, #c52217);--emw--color-background:var(--emw-hakuna-bg-primary, #2c2525);--emw--color-background-tertiary:var(--emw-hakuna-bg-tertiary, #4f2421);--lottery-button-outline-active-bg:var(--emw-hakuna-bg-tertiary, #4f2421);--lottery-selection-background:var(--emw-hakuna-bg-primary, #2c2525);--lottery-selection-color:var(--emw-hakuna-text-secondary, #b4a5a5);--lottery-selection-group-bullets-gap:10px;--lottery-selection-disabled-background:#392f2f;--lottery-selection-disabled-color:var(--emw-hakuna-bg-secondary, #120505);--lottery-selection-border-radius:6px;--lottery-selection-hover-background:var(--emw-hakuna-bg-tertiary, #4f2421);--lottery-selection-hover-color:var(--emw-hakuna-text-secondary, #b4a5a5)}.hakuna-ticket .icon-btn{display:flex;align-items:center;justify-content:center;height:32px;cursor:pointer;color:var(--emw-hakuna-text-secondary, #b4a5a5);transition:color 0.2s ease, opacity 0.2s ease}.hakuna-ticket .icon-btn.disabled{cursor:not-allowed;opacity:0.5;pointer-events:none}.hakuna-ticket-content-selection{display:flex;align-items:center;gap:12px}.hakuna-ticket-content-selection-text{color:var(--emw-hakuna-text-secondary, #b4a5a5);font-size:12px;font-style:normal;font-weight:500;line-height:normal}.hakuna-ticket-content-selection-dots{display:flex;align-items:center;justify-content:center;gap:4px}.hakuna-ticket-content-selection-dots-item{width:10px;height:10px;border-radius:50%;background-color:var(--emw-hakuna-bg-tertiary, #4f2421);transition:background-color 0.3s ease, transform 0.3s ease;box-shadow:0 2px 4px 0 rgba(0, 0, 0, 0.15)}.hakuna-ticket-content-selection-dots-item.active{background-color:var(--emw-hakuna-color-primary, #c52217);transform:scale(1.06)}.hakuna-ticket-content-bullets{margin:20px 0}.hakuna-ticket-content-bullets.disabled{pointer-events:none;cursor:not-allowed}.hakuna-ticket-content-operation{display:flex;justify-content:space-between}.hakuna-ticket-content-operation--right{display:flex;gap:8px;align-items:center}.hakuna-ticket .cur-selection-btn{display:flex;width:32px;height:32px;justify-content:center;align-items:center;border-radius:6px;background:var(--emw-hakuna-bg-primary, #2c2525);box-shadow:0 2px 4px 0 rgba(0, 0, 0, 0.15);font-size:14px;font-weight:500;color:var(--emw-hakuna-text-secondary, #b4a5a5)}.hakuna-ticket .cur-selection-btn.active{color:var(--emw-hakuna-text-primary, #ffffff);font-weight:700;font-size:16px;background:linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 100%), var(--emw-hakuna-color-primary, #c52217);box-shadow:0 2px 4px 0 rgba(0, 0, 0, 0.15)}.hakuna-ticket-summary-item{display:flex;justify-content:space-between;align-items:center}.hakuna-ticket-summary-selection{display:flex;gap:6px;align-items:center}.hakuna-ticket-summary-operation{display:flex;align-items:center;gap:10px;margin-left:20px}';const y={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 256H736v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zm-200 0H360v-72h304v72z"}}]},name:"delete",theme:"filled"};var f=function(){return f=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},f.apply(this,arguments)},v={primaryColor:"#333",secondaryColor:"#E6E6E6"};function m(t,e){var i="svg"===t.tag?f(f({},t.attrs),e.extraSVGAttrs||{}):t.attrs,o=Object.keys(i).reduce((function(t,e){var o=i[e],r="".concat(e,'="').concat(o,'"');return t.push(r),t}),[]),r=o.length?" "+o.join(" "):"",n=(t.children||[]).map((function(t){return m(t,e)})).join("");return n&&n.length?"<".concat(t.tag).concat(r,">").concat(n,"</").concat(t.tag,">"):"<".concat(t.tag).concat(r," />")}const k=class{constructor(e){t(this,e),this.lotteryBulletClickHandler=o(this,"lotteryBulletClick",7),this.value=0,this.text=void 0,this.idx=void 0,this.type="toggle",this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.hasBorder=!0,this.hasBackground=!0,this.deleteIconSvg="",this.deleteIconWidth="16px",this.deleteIconHeight="16px"}handleClientStylingChange(t,e){t!==e&&r(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!==e&&n(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!==e&&a(this.stylingContainer,`${this.mbSource}.Style`)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&r(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}handleClick(){"disabled"!==this.type&&"readonly"!==this.type&&(console.log("bullet clicked",this.type,this.idx,this.text,this.value),this.lotteryBulletClickHandler.emit({type:this.type,idx:this.idx,text:this.text,value:this.value}))}render(){let t;return t=this.deleteIconSvg?function(t){let e=t.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"");return e=e.replace(/on[a-z]+=[\"'][^\"']*[\"']/gi,""),e=e.replace(/javascript:/gi,""),e}(this.deleteIconSvg):function(t,e){if(void 0===e&&(e={}),"function"==typeof t.icon){var i=e.placeholders||v;return m(t.icon(i.primaryColor,i.secondaryColor),e)}return m(t.icon,e)}(y,{extraSVGAttrs:{width:this.deleteIconWidth,height:this.deleteIconHeight,fill:"currentColor"}}),e("div",{key:"0d1e8aaa80a907a7467410f6b27b4b6175e82299",class:"lottery-selection",ref:t=>this.stylingContainer=t},e("button",{key:"11a2402abbc290dc877ad95f3433092c3a0d8419",class:{"lottery-selection__button":!0,"lottery-selection__button--selected":1==this.value,"lottery-selection__button--disabled":"disabled"===this.type,"lottery-selection__button--no-border":!this.hasBorder,"lottery-selection__button--no-background":!this.hasBackground,isDeleteByIcon:"delete"===this.type,isCallDialogBtn:"input"===this.type||"readonly"===this.type},onClick:this.handleClick.bind(this),disabled:"disabled"===this.type},"delete"===this.type&&e("span",{key:"f99001d936a8f7bdf8adc5c46e82caf730a9442a",class:"lottery-selection__delete-icon",innerHTML:t}),e("span",{key:"55775e2492a1fe45cc8a457ac0a0d206744461ab",class:"lottery-selection__text"},this.text)))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};k.style=":host{display:inline-block}.lottery-selection__button{display:flex;align-items:center;justify-content:center;width:var(--lottery-selection-width, 32px);height:var(--lottery-selection-height, 32px);padding:var(--lottery-selection-padding, 0);box-sizing:border-box;background:var(--lottery-selection-background, var(--emw--color-background, #fff));border:var(--lottery-selection-border-width, 2px) var(--lottery-selection-border-style, solid) var(--lottery-selection-border-color, var(--emw--color-primary, #0d196e));border-radius:var(--lottery-selection-border-radius, var(--emw--border-radius-medium, 8px));color:var(--lottery-selection-color, var(--emw--color-typography, #000));font-weight:var(--lottery-selection-font-weight, bold);font-size:var(--lottery-selection-font-size, 1em);cursor:pointer;user-select:none;}.lottery-selection__button:hover{background:var(--lottery-selection-hover-background, var(--emw--color-background, #fff));border-color:var(--lottery-selection-hover-border-color, var(--emw--color-primary, #0d196e));color:var(--lottery-selection-hover-color, var(--emw--color-typography, #000))}.lottery-selection__button .lottery-selection__delete-icon{display:none}.lottery-selection__button.isDeleteByIcon:hover .lottery-selection__text{display:none}.lottery-selection__button.isDeleteByIcon:hover .lottery-selection__delete-icon{display:flex;align-items:center;justify-content:center;fill:var(--lottery-selection-delete-icon-color, var(--emw--color-typography, #000));vertical-align:middle}.lottery-selection__button.lottery-selection__button--selected{background-color:var(--lottery-selection-selected-background, var(--emw--color-primary, #0d196e));border-color:var(--lottery-selection-selected-border-color, var(--emw--color-primary, #0d196e));color:var(--lottery-selection-selected-color, var(--emw--color-typography-inverse, #fff))}.lottery-selection__button.lottery-selection__button--disabled{background-color:var(--lottery-selection-disabled-background, var(--emw--color-gray-50, #f5f5f5));border-color:var(--lottery-selection-disabled-border-color, var(--emw--color-gray-100, #e6e6e6));color:var(--lottery-selection-disabled-color, var(--emw--color-gray-150, #6f6f6f));cursor:not-allowed;pointer-events:none;}.lottery-selection__button.lottery-selection__button--no-border{border:none}.lottery-selection__button.lottery-selection__button--no-background{background:transparent}";const C=["ro","en","fr","ar","hr","zh"],w={en:{noTicketBoard:"No ticket board available.",selectionCleared:"Your selection has been cleared.",clearAll:"Clear All",stopAt:"Stop at",turnover:"Turnover: ",pleaseFillIn:"Please fill in all the selection input!",fillIn:"Fill in",noBets:"Sorry. No bets have been placed so far. Check back later!",search:"Search",clear:"Clear",oddsChart:"Odds Chart",ticketSuccess:"Ticket purchased successfully.",stakePerLine:"Stake per Line:",lowestOdds:"Lowest Odds:",highestOdds:"Highest Odds:",orderSummary:"ORDER SUMMARY",ticket:"Ticket",lines:"Lines",total:"Total",submit:"Submit",loading:"Loading",enterValidNumber:"Please enter a valid number.",enterNumberBetween:"Please enter a number between {min} and {max}.",numberAlreadySelected:"This number has already been selected.",enterScoreUpTo:"Please enter the score (Up to {maxScore})",enterValue:"Please enter a value",myChoices:"My Choices",teams:"Teams",scores:"Scores",euro:"Euro",cancel:"Cancel",confirm:"Confirm"},ro:{},fr:{},ar:{},hr:{}},x=(t,e,i)=>{const o=e;let r=w[void 0!==o&&C.includes(o)?o:"en"][t];return i&&Object.keys(i).forEach((t=>{r=r.replace(`{${t}}`,i[t])})),r};function S(t,e){return new Set(t?t.split(e):[])}function _(t,e){return e.filter((e=>e!==t))}function j(t,e){return e.concat([t])}const M=class{constructor(e){t(this,e),this.bulletGroupUpdateSelectedBulletTexts=o(this,"bulletGroupUpdateSelection",7),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.language="en",this.translationUrl="",this.splitToken=",",this.selectionGroupId=void 0,this.selectionGroupLabel=void 0,this.type="bet",this.selectedBulletTexts=null,this.maxSelectedCount=null,this.maxDisplayBulletsCount=11,this.bulletTexts=null,this.maxIntegerBulletText=null,this.minIntegerBulletText=0,this.bulletTextType="integer",this.hasBorder=!0,this.hasBackground=!0,this.dialogTitle=void 0,this.dialogInputPlaceholder=void 0,this.dialogConfig={width:"400px",visible:!1,onConfirm:()=>this.handleFillInAddMore(),onCancel:()=>this.handleCloseAddMoreDialog()},this.inputInfo={valid:!0,errorMessage:"",value:""}}handleClientStylingChange(t,e){t!=e&&r(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&n(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`)}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])w[e][i]=t[e][i]})))}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&r(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}lotteryBulletClickHandler(t){if(t.stopPropagation(),"input"!==t.detail.type)if(["delete","toggle"].includes(t.detail.type))this.bulletGroupUpdateSelectedBulletTexts.emit({newSelectedBulletTexts:(e=t.detail,i=Array.from(this.selectedSet),o=this.maxSelectedCount,"delete"===e.type?_(e.text,i):"toggle"===e.type?i.includes(e.text)?_(e.text,i):i.length>=o?function(t,e,i){return e.slice(e.length-(i-1)).concat([t])}(e.text,i,o):j(e.text,i):[]).join(this.splitToken),selectionGroupId:this.selectionGroupId});else var e,i,o;else this.dialogConfig=Object.assign(Object.assign({},this.dialogConfig),{visible:!0})}get selectedSet(){return S(this.selectedBulletTexts,this.splitToken)}get bulletTextsSet(){return this.bulletTexts?S(this.bulletTexts,this.splitToken):"integer"===this.bulletTextType&&null!=this.maxIntegerBulletText?S(Array.from({length:Number(this.lastDisplayBulletText)-this.minIntegerBulletText+1},((t,e)=>this.minIntegerBulletText+e)).join(this.splitToken),this.splitToken):new Set}get lastDisplayBulletText(){if("integer"===this.bulletTextType)return null!=this.maxIntegerBulletText?Math.min(this.maxIntegerBulletText,this.minIntegerBulletText+this.maxDisplayBulletsCount-1):this.minIntegerBulletText+this.maxDisplayBulletsCount-1;if(this.bulletTextsSet.size>0){const t=Array.from(this.bulletTextsSet);return t.length>=this.maxDisplayBulletsCount?t[this.maxDisplayBulletsCount-1]:t[t.length-1]}return null}get isSingleSelectionMode(){return 1===this.maxSelectedCount}getBulletToRender(){const t=Array.from(this.bulletTextsSet);let e=t,i=!1;return"text"===this.bulletTextType?t.length>this.maxDisplayBulletsCount?(i=!0,e=t.slice(0,this.maxDisplayBulletsCount-1)):e=t:(i=null!=this.maxIntegerBulletText&&this.maxIntegerBulletText>Number(this.lastDisplayBulletText),e=t),{bulletsToRender:e,showInputButton:i}}renderBulletGroup(){let t=[];if("bet"===this.type){const e=null!==this.maxSelectedCount&&this.selectedSet.size>=this.maxSelectedCount,{bulletsToRender:i,showInputButton:o}=this.getBulletToRender();if(i.forEach(((i,o)=>{let r="toggle";this.selectedSet.has(String(i))||!e||this.isSingleSelectionMode||(r="disabled"),t.push({value:this.selectedSet.has(String(i))?1:0,text:String(i),idx:o,type:r})})),o){let i="input";e&&!this.isSingleSelectionMode&&(i="disabled");const o="text"===this.bulletTextType?"...":`${this.lastDisplayBulletText}+`,r="text"===this.bulletTextType?-1:Number(this.lastDisplayBulletText)+1;"integer"===this.bulletTextType&&t.length>=this.maxDisplayBulletsCount&&t.pop(),t.push({value:0,text:o,idx:r,type:i})}}else if(["choice","preview"].includes(this.type)){const{bulletsToRender:e}=this.getBulletToRender();e.forEach(((e,i)=>{let o="toggle";"preview"===this.type?o="readonly":this.selectedSet.has(String(e))&&(o="delete"),t.push({value:this.selectedSet.has(String(e))?1:0,text:e,idx:i,type:o})}))}return e("div",{class:"lottery-selection-group__item--right"},t.map((t=>e("lottery-selection",{clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,mbSource:this.mbSource,text:t.text,idx:t.idx,value:t.value,type:t.type,hasBorder:this.hasBorder,hasBackground:this.hasBackground}))))}handleCloseAddMoreDialog(){this.dialogConfig=Object.assign(Object.assign({},this.dialogConfig),{visible:!1}),this.inputInfo={value:"",errorMessage:"",valid:!0}}handleInputChange(t){const e=t.target.value;this.inputInfo=Object.assign(Object.assign({},this.inputInfo),{value:e}),this.inputInfo=function({value:t,selectedSet:e,maxValue:i,minValue:o,language:r,type:n="integer"}){const a=t.trim();if("integer"===n){if(!/^-?\d+$/.test(a))return{valid:!1,errorMessage:x("enterValidNumber",r),value:t};const n=Number(a);if(isNaN(n))return{valid:!1,errorMessage:x("enterValidNumber",r),value:t};if(void 0!==o&&n<o||void 0!==i&&n>i)return{valid:!1,errorMessage:x("enterNumberBetween",r,{min:o,max:i}),value:t};const l=String(n);if(e.has(l))return{valid:!1,errorMessage:x("numberAlreadySelected",r),value:t}}else if(e.has(a))return{valid:!1,errorMessage:x("numberAlreadySelected",r),value:t};return{valid:!0,errorMessage:"",value:t}}({value:e,selectedSet:this.selectedSet,maxValue:this.maxIntegerBulletText,minValue:"integer"===this.bulletTextType?Number(this.lastDisplayBulletText)+1:void 0,language:this.language,type:this.bulletTextType})}handleFillInAddMore(){if(this.inputInfo.valid){const{value:t}=this.inputInfo;let e,i=t;i="integer"===this.bulletTextType?String(Number(t)):t.trim(),e=this.isSingleSelectionMode?i:j(i,Array.from(this.selectedSet)).join(this.splitToken),this.bulletGroupUpdateSelectedBulletTexts.emit({newSelectedBulletTexts:e,selectionGroupId:this.selectionGroupId}),this.handleCloseAddMoreDialog()}}render(){return e("div",{key:"66b8e9c63d948eb2f7eb37adb80892dbedd7df9a",class:"lottery-selection-group",ref:t=>this.stylingContainer=t},e("div",{key:"6562fdcad0f352b5e2d03edcc980a9aeab32277e",class:"lottery-selection-group__item"},this.selectionGroupLabel&&e("div",{key:"43c2132e4904a2b69b970d9b2074f120ed4d0986",class:"lottery-selection-group__item--left"},this.selectionGroupLabel),this.renderBulletGroup()),e("lottery-tipping-dialog",{key:"cb693d10e6b499628909571021d8508cdebbe29a",visible:this.dialogConfig.visible,width:this.dialogConfig.width,onCancel:this.dialogConfig.onCancel},e("div",{key:"dd312634574bbe1b4d3de7e82a9c58f58f846c1a",class:"addSelectionDialog"},e("div",{key:"b371b1090598f0219a7c652bab51e9d349703c34",class:"addSelectionDialog-title"},this.dialogTitle||("text"===this.bulletTextType?x("enterValue",this.language):x("enterScoreUpTo",this.language,{maxScore:this.maxIntegerBulletText}))),e("input",{key:"b5f1bb74999246dac8dc20f04e3af893deae6654",type:"text",class:{"dialog-input":!0,invalid:!this.inputInfo.valid},value:this.inputInfo.value,onInput:this.handleInputChange.bind(this),placeholder:this.dialogInputPlaceholder}),e("div",{key:"f33970a6dffdc881ffa9cf2c0bb54b26b27cccd6",class:"error-message"},this.inputInfo.errorMessage)),e("div",{key:"4c580dae14b38aff03e17067b2c0b72d01aa4f42",slot:"footer",class:"addSelectionDialog-footer"},e("lottery-button",{key:"874aa0ffde8fe2d0b08efea0cf951f101ab8dad0",onClick:this.dialogConfig.onCancel,text:x("cancel",this.language),variant:"outline"}),e("lottery-button",{key:"63a556eb5f9ad1cdd357c017756be274d40ef235",onClick:this.dialogConfig.onConfirm,text:x("confirm",this.language),variant:"primary",disabled:!this.inputInfo.valid||!this.inputInfo.value}))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};M.style=":host {\n width: 100%;\n}\n\n.lottery-selection-group {\n container-type: inline-size;\n padding: var(--lottery-selection-group-padding, 0);\n background: var(--lottery-selection-group-background, transparent);\n border: var(--lottery-selection-group-border, none);\n border-radius: var(--lottery-selection-group-border-radius, 0);\n}\n.lottery-selection-group__item {\n display: flex;\n flex-direction: var(--lottery-selection-group-flex-direction, row);\n align-items: var(--lottery-selection-group-item-align, center);\n justify-content: var(--lottery-selection-group-item-justify, flex-start);\n gap: var(--lottery-selection-group-item-gap, 16px);\n width: 100%;\n}\n.lottery-selection-group__item--left {\n width: var(--lottery-selection-group-label-width, 130px);\n min-width: var(--lottery-selection-group-label-min-width, auto);\n max-width: var(--lottery-selection-group-label-max-width, none);\n color: var(--lottery-selection-group-label-color, var(--emw--color-typography, #000));\n font-size: var(--lottery-selection-group-label-font-size, 1em);\n font-weight: var(--lottery-selection-group-label-font-weight, bold);\n text-align: var(--lottery-selection-group-label-align, left);\n white-space: var(--lottery-selection-group-label-white-space, normal);\n}\n.lottery-selection-group__item--right {\n flex: 1;\n display: flex;\n flex-wrap: var(--lottery-selection-group-bullets-wrap, wrap); /* Allow items to wrap */\n gap: var(--lottery-selection-group-bullets-gap, 8px); /* Gap between bullets */\n align-items: var(--lottery-selection-group-bullets-align, center);\n justify-content: var(--lottery-selection-group-bullets-justify, flex-start); /* Align bullets to start */\n}\n@container (max-width: 320px) {\n .lottery-selection-group__item--left {\n width: 100px;\n max-width: 100px;\n }\n}\n\n.dialog-input {\n width: 100%;\n padding: var(--lottery-selection-group-input-padding, 8px);\n border: var(--lottery-selection-group-input-border-width, 1px) var(--lottery-selection-group-input-border-style, solid) var(--lottery-selection-group-input-border-color, var(--emw--color-gray-100, #e6e6e6));\n border-radius: var(--lottery-selection-group-input-radius, 4px);\n background-color: var(--lottery-selection-group-input-bg, #fff);\n color: var(--lottery-selection-group-input-color, #000);\n box-sizing: border-box;\n margin-top: var(--lottery-selection-group-input-margin-top, 10px);\n font-size: var(--lottery-selection-group-input-font-size, 1em);\n}\n.dialog-input::placeholder {\n color: var(--lottery-selection-group-input-placeholder-color, #999);\n}\n\n.dialog-input.invalid,\n.dialog-input.invalid:focus {\n border-color: var(--emw--color-error, #ff3d00);\n outline-color: var(--emw--color-error, #ff3d00);\n}\n\n.error-message {\n color: var(--lottery-selection-group-error-color, var(--emw--color-error, #ff3d00));\n font-size: var(--lottery-selection-group-error-font-size, 12px);\n font-weight: var(--lottery-selection-group-error-font-weight, normal);\n margin-top: 4px;\n}\n\n.addSelectionDialog-title {\n color: var(--lottery-selection-group-dialog-title-color, var(--emw--color-typography, #000));\n font-size: var(--lottery-selection-group-dialog-title-font-size, 1.2em);\n font-weight: var(--lottery-selection-group-dialog-title-font-weight, bold);\n margin-bottom: var(--lottery-selection-group-dialog-title-margin-bottom, 0);\n}\n.addSelectionDialog-footer {\n display: flex;\n justify-content: var(--lottery-selection-group-dialog-footer-justify, flex-end);\n gap: var(--lottery-selection-group-dialog-footer-gap, 18px);\n margin-top: var(--lottery-selection-group-dialog-footer-margin-top, 0);\n}";const z=["ro","en","fr","ar","hr"],B={en:{cancel:"Cancel",confirm:"Confirm"},ro:{cancel:"Anulează",confirm:"Confirmă"},fr:{cancel:"Annuler",confirm:"Confirmer"},ar:{cancel:"إلغاء",confirm:"تأكيد"},hr:{cancel:"Odustani",confirm:"Potvrdi"}},T=(t,e)=>{const i=e;return B[void 0!==i&&z.includes(i)?i:"en"][t]},O=class{constructor(e){t(this,e),this.open=o(this,"open",7),this.close=o(this,"close",7),this.confirm=o(this,"confirm",7),this.cancel=o(this,"cancel",7),this.wasVisible=!1,this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.visible=void 0,this.dialogTitle="",this.width="520px",this.closable=!0,this.mask=!0,this.maskClosable=!0,this.animationDuration=300,this.fullscreen=!1,this.showFooter=!0,this.showCancelBtn=!0,this.language="en",this.translationUrl=void 0,this.dialogClass=void 0,this.dialogStyle=void 0}handleClientStylingChange(t,e){t!=e&&r(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&n(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`)}componentWillLoad(){this.translationUrl&&(async t=>{if(t)try{const i=await fetch(t);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const o=await i.json();e=o,Object.keys(e).forEach((t=>{for(let i in e[t])B[t][i]=e[t][i]}))}catch(t){console.error("Failed to fetch or parse translations from URL:",t)}var e})(this.translationUrl)}componentWillUpdate(){this.visible&&!this.wasVisible?this.disableBodyScroll():!this.visible&&this.wasVisible&&this.enableBodyScroll(),this.wasVisible=this.visible}disconnectedCallback(){this.enableBodyScroll(),this.stylingSubscription&&this.stylingSubscription.unsubscribe()}disableBodyScroll(){document.body.style.overflow="hidden"}enableBodyScroll(){document.body.style.overflow=""}handleClose(){this.cancel.emit()}handleMaskClick(){this.maskClosable&&this.cancel.emit()}handleConfirm(){this.confirm.emit()}render(){const t=Object.assign({width:"number"==typeof this.width?`${this.width}px`:this.width,"--duration":`${this.animationDuration}ms`},this.dialogStyle||{}),i=["dialog-wrapper",this.visible?"dialog-wrapper-visible":""],o=["mask",this.visible?"mask-enter":"mask-leave"],r=["dialog",this.visible?"dialog-enter":"dialog-leave",this.fullscreen?"fullscreen":"",this.dialogClass].filter(Boolean).join(" ");return e("div",{key:"306683c5190fa6dca57dcf75e52eca575c0215e7",class:i.join(" "),ref:t=>this.stylingContainer=t},e("div",{key:"8be097f3a86fcd9ad4e18c6ac56cafdcf249049b",class:o.join(" "),onClick:this.handleMaskClick.bind(this)}),e("div",{key:"87d2206d3e3d75fe0e0ef8a6afd8de5c20892ae6",part:"dialog",class:r,style:t,role:"dialog","aria-modal":"true","aria-labelledby":"dialog-title"},e("div",{key:"30ca33b925ff2525ead8aae83e72031258367b40",class:"dialog-header"},e("h2",{key:"492c3e864ac1547da58b0a47e4cc8d45470bde54",id:"dialog-title",class:"dialog-title"},this.dialogTitle),this.closable&&e("button",{key:"8ae4b872d18ce82d33292dc794e8a1f714a96ba9",class:"close-btn",onClick:this.handleClose.bind(this)},"x")),e("div",{key:"d661c78b333f78b9dee92e0975f8b136ef5a3071",class:"dialog-content",style:{maxHeight:"calc(100vh - 62px)",overflowY:"auto"}},e("slot",{key:"f32a6f6e4962239e0148e61c4bb70f6b5d3a2c82"})),this.showFooter&&e("div",{key:"40b5e9fd1c9221eb4d6c87d053c5d018f540d8e7",class:"dialog-footer"},e("slot",{key:"91539def47d118a69735ec229e7a6b36fc1db40b",name:"footer"},this.showCancelBtn&&e("button",{key:"f3b3add23f150c660159a906c2ef23b5fbe3b4c5",class:"cancel-btn",onClick:this.handleClose.bind(this)},T("cancel",this.language)),e("button",{key:"5fc33e89b6c55ac9e2162302e128bce0e79c5f89",class:"confirm-btn",onClick:this.handleConfirm.bind(this)},T("confirm",this.language))))))}get el(){return i(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};O.style=".dialog-wrapper{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;visibility:hidden;opacity:1;z-index:199}.dialog-wrapper-visible{visibility:visible}.mask{position:fixed;inset:0;background-color:rgba(0, 0, 0, 0.5);opacity:0;z-index:1000;transition:opacity var(--duration) linear}.mask-enter{opacity:1}.mask-leave{opacity:0}.dialog{position:relative;background:var(--emw--color-background, #fff);border-radius:12px;box-shadow:0 4px 32px rgba(0, 0, 0, 0.15);opacity:0;transform:scale(0.9);transition:all var(--duration) linear;width:100%;max-width:100vw;overflow:hidden;z-index:1000}.dialog-enter{opacity:1;transform:scale(1)}.dialog-leave{opacity:0}.dialog.fullscreen{width:100vw !important;height:100vh;overflow:auto;max-height:none;border-radius:0;overflow:hidden}.dialog-header{padding:16px 16px 0 16px;display:flex;justify-content:space-between;align-items:center}.dialog-header .dialog-title{margin:0;font-size:1.25rem;font-weight:500;color:var(--emw--color-typography, #000)}.dialog-header .close-btn{background:transparent;border:none;font-size:1.5rem;width:2rem;height:2rem;color:var(--emw--color-gray-150, #6f6f6f);cursor:pointer;border-radius:4px}.dialog-header .close-btn:hover{background:var(--emw--color-gray-50, #f5f5f5);color:var(--emw--color-gray-300, #333)}.dialog-content{padding:24px;font-size:0.95rem;line-height:1.6;color:var(--emw--color-dialog-typography, #000);flex:1;overflow-y:auto;max-height:calc(100vh - 200px)}.dialog.fullscreen .dialog-content{max-height:none}.dialog-footer{padding:0 16px 16px 16px;display:flex;justify-content:center;gap:12px}.dialog-footer .cancel-btn,.dialog-footer .confirm-btn{padding:10px 24px;border-radius:6px;font-size:0.9rem;cursor:pointer;transition:all 0.3s linear}.dialog-footer .cancel-btn{border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));background-color:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000)}.dialog-footer .cancel-btn:hover{background-color:var(--emw--color-background-tertiary, #ccc)}.dialog-footer .confirm-btn{border:none;color:var(--emw--color-typography-normalized, #ffffff);background:var(--emw--color-primary, #009993)}.dialog-footer .confirm-btn:hover{background:var(--emw--color-primary-variant, #004d4a)}@media screen and (max-width: 480px){.dialog.fullscreen .dialog-content{padding:12px}}.Loading{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.Loading svg{animation:spin 1s linear infinite;transform-origin:center}@keyframes spin{100%{transform:rotate(360deg)}}";export{c as lottery_button,h as lottery_hakuna_collapse,p as lottery_hakuna_ticket,k as lottery_selection,M as lottery_selection_group,O as lottery_tipping_dialog}
|
|
1
|
+
import{r as t,h as e,g as i,c as o}from"./index-1f778cb5.js";import{s as r,a as n,b as a}from"./lottery-hakuna-ticket-buy-e97eb8d9.js";export{L as lottery_hakuna_ticket_buy}from"./lottery-hakuna-ticket-buy-e97eb8d9.js";const l=["ro","en","fr","ar","hr","zh"],s={en:{loading:"Loading"},ro:{},fr:{},ar:{},hr:{}},c=class{constructor(e){t(this,e),this.handleClick=t=>{if(this.disabled)return;const e=this.host.shadowRoot.querySelector(".btn");if(!e)return;const i=e.getBoundingClientRect(),o=Math.max(i.width,i.height),r={top:t.clientY-i.top-o/2,left:t.clientX-i.left-o/2,size:o};this.ripples=[...this.ripples,r],setTimeout((()=>{this.ripples=this.ripples.filter((t=>t!==r))}),600)},this.variant="primary",this.size="medium",this.color=void 0,this.disabled=!1,this.loading=!1,this.text=void 0,this.mbSource=void 0,this.language="en",this.clientStyling=void 0,this.clientStylingUrl=void 0,this.translationUrl="",this.ripples=[]}handleClientStylingChange(t,e){t!=e&&r(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&n(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`)}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&r(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl))}componentWillLoad(){this.translationUrl&&(async t=>{if(t)try{const i=await fetch(t);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const o=await i.json();e=o,Object.keys(e).forEach((t=>{for(let i in e[t])s[t][i]=e[t][i]}))}catch(t){console.error("Failed to fetch or parse translations from URL:",t)}var e})(this.translationUrl)}render(){const{variant:t,disabled:i,size:o,color:r}=this,n=i||this.loading,a={};if(r)switch(t){case"primary":default:Object.assign(a,{backgroundColor:r,borderColor:r});break;case"outline":case"dashed":Object.assign(a,{color:r,borderColor:r});break;case"text":Object.assign(a,{color:r})}return e("button",{key:"aa74ad98c90e7548228557bf8a8d26b125d4a83a",class:{btn:!0,[`btn--${t}`]:!0,[`btn--${o}`]:!0,"btn--loading":this.loading},style:r?a:void 0,disabled:n,onClick:this.handleClick,ref:t=>this.stylingContainer=t},this.loading?e("div",{class:"loading-container"},e("span",{class:"content"},this.text||(()=>{const t=this.language;let e=s[void 0!==t&&l.includes(t)?t:"en"].loading;return e})()),e("span",{class:"spinner"})):e("span",{class:"content"},e("slot",{name:"icon-left"}),this.text||e("slot",null),e("slot",{name:"icon-right"})),e("div",{key:"302ea02be395bb24989d4abc040a513e23fa029a",class:"ripple-container"},this.ripples.map(((t,i)=>e("span",{key:i,class:"ripple",style:{top:`${t.top}px`,left:`${t.left}px`,width:`${t.size}px`,height:`${t.size}px`}})))))}get host(){return i(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};c.style=":host{display:inline-block}.btn{font:inherit;position:relative;display:inline-flex;align-items:center;justify-content:center;border:1px solid transparent;border-radius:var(--lottery-button-border-radius, 6px);font-weight:var(--lottery-button-font-weight, 500);cursor:pointer;outline:none;overflow:hidden;transition:var(--lottery-button-transition, background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.2s);user-select:none;-webkit-tap-highlight-color:transparent;box-shadow:var(--lottery-button-box-shadow, 0 2px 4px 0 rgba(0, 0, 0, 0.5))}.btn .content{position:relative;display:inline-flex;align-items:center;gap:var(--lottery-button-content-gap, 0.5em)}.btn .content ::slotted(span){display:inline-flex;align-items:center}.btn:hover:not(:disabled){box-shadow:var(--lottery-button-hover-box-shadow, 0 4px 8px 0 rgba(0, 0, 0, 0.5))}.btn:disabled{cursor:not-allowed;opacity:var(--lottery-button-disabled-opacity, 0.5)}.btn .loading-container{display:flex;align-items:center}.btn--loading{position:relative}.btn .spinner{display:inline-block;width:1em;height:1em;border:var(--lottery-button-spinner-border, 2px solid rgba(255, 255, 255, 0.3));border-radius:50%;border-top-color:var(--lottery-button-spinner-color, white);animation:spin 1s ease-in-out infinite;margin-left:0.5em;vertical-align:middle}.btn--small .spinner{width:0.8em;height:0.8em}.btn--large .spinner{width:1.2em;height:1.2em}@keyframes spin{to{transform:rotate(360deg)}}.btn--primary{background-color:var(--emw--color-primary, #0d196e);color:var(--emw--color-typography-inverse, #fff)}.btn--primary:hover:not(:disabled){background-color:var(--emw--color-primary-variant, #1367e7)}.btn--primary:active:not(:disabled){background-color:var(--lottery-button-primary-active-bg, #08104a)}.btn--outline .spinner,.btn--dashed .spinner,.btn--text .spinner{border-top-color:currentColor;border-color:var(--lottery-button-spinner-inverse-border-color, rgba(0, 0, 0, 0.2))}.btn--outline{background-color:var(--emw--color-background, #fff);border-color:var(--lottery-button-outline-border-color, #dcdcdc);color:var(--emw--color-typography, #000)}.btn--outline:hover:not(:disabled){background-color:var(--emw--color-background-tertiary, #ccc);border-color:var(--lottery-button-outline-hover-border-color, #a6a6a6)}.btn--outline:active:not(:disabled){background-color:var(--lottery-button-outline-active-bg, #e6e6e6)}.btn--dashed{background-color:transparent;border-style:dashed;border-color:var(--lottery-button-dashed-border-color, #dcdcdc);color:var(--lottery-button-dashed-color, #333)}.btn--dashed:hover:not(:disabled){border-color:var(--lottery-button-dashed-hover-border-color, #a6a6a6);color:var(--lottery-button-dashed-hover-color, #0052d9)}.btn--text{background-color:transparent;color:var(--lottery-button-text-color, #0052d9);border-color:transparent}.btn--text:hover:not(:disabled){background-color:var(--lottery-button-text-hover-bg, #f2f2f2)}.btn--text:active:not(:disabled){background-color:var(--lottery-button-text-active-bg, #e6e6e6)}.btn--custom-color:hover:not(:disabled){opacity:var(--lottery-button-custom-hover-opacity, 0.9)}.btn--custom-color:active:not(:disabled){opacity:var(--lottery-button-custom-active-opacity, 0.8)}.btn--small{height:var(--lottery-button-small-height, 28px);font-size:var(--lottery-button-small-font-size, 12px);padding:var(--lottery-button-small-padding, 0 12px)}.btn--medium{height:var(--lottery-button-medium-height, 34px);font-size:var(--lottery-button-medium-font-size, 14px);padding:var(--lottery-button-medium-padding, 0 18px)}.btn--large{height:var(--lottery-button-large-height, 40px);font-size:var(--lottery-button-large-font-size, 16px);padding:var(--lottery-button-large-padding, 0 24px)}.ripple-container{position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;border-radius:inherit}.ripple{position:absolute;border-radius:50%;background-color:var(--lottery-button-ripple-light, rgba(255, 255, 255, 0.3));transform:scale(0);animation:ripple-animation 600ms linear}.btn--outline .ripple,.btn--dashed .ripple,.btn--text .ripple{background-color:var(--lottery-button-ripple-dark, rgba(0, 0, 0, 0.03))}@keyframes ripple-animation{to{transform:scale(4);opacity:0}}";const h=class{constructor(e){t(this,e),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.headerTitle="",this.collapsed=!0,this.isOpen=!1,this.hasSummary=!1}handleClientStylingChange(t,e){t!=e&&r(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&n(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`)}componentWillLoad(){this.isOpen=!this.collapsed}componentWillRender(){this.hasSummary=!!this.el.querySelector('[slot="summary"]')}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&r(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}async toggle(){this.isOpen=!this.isOpen}render(){const t=this.isOpen||this.hasSummary;return e("div",{key:"5e28ba28bf46f6a22f749bbd878aef8972bb7eeb",ref:t=>this.stylingContainer=t,class:"lottery-hakuna-collapse"},e("div",{key:"ec42a23932c7e0652476743c1cafcfe7e411c2aa",class:"header",onClick:()=>this.toggle()},e("div",{key:"152e98bb7fc69274d61ffff0d6de9f76a1df90f8",class:"header-content"},this.headerTitle&&e("span",{key:"0acc51d711ca12fa1a666dbe1678071a37fa0aff",class:"title"},this.headerTitle)),e("span",{key:"ad31e6e3a249a9dca394e725e805422297811f85",class:{icon:!0,"is-open":this.isOpen}},e("svg",{key:"14bc41acc77204fcb1966f8966dc6feb49730518",xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 18 18",fill:"none"},e("path",{key:"bac152fc477b275a1792264a35dba2765cf2687f","fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.96967 6.21967C4.26256 5.92678 4.73744 5.92678 5.03033 6.21967L9 10.1893L12.9697 6.21967C13.2626 5.92678 13.7374 5.92678 14.0303 6.21967C14.3232 6.51256 14.3232 6.98744 14.0303 7.28033L9.53033 11.7803C9.23744 12.0732 8.76256 12.0732 8.46967 11.7803L3.96967 7.28033C3.67678 6.98744 3.67678 6.51256 3.96967 6.21967Z",fill:"currentColor"})))),t&&e("div",{key:"0358ec8ccc21286a31f6ffcb770efa6c1bcc36ea",class:"content"},e("slot",this.isOpen?null:{name:"summary"})))}get el(){return i(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};var d;h.style=":host{display:block;width:100%;box-sizing:border-box}.lottery-hakuna-collapse{border:var(--lottery-hakuna-collapse-border-width, 1px) solid transparent;border-radius:var(--lottery-hakuna-collapse-border-radius, 12px);background-origin:border-box;background-clip:padding-box, border-box;background-image:linear-gradient(var(--lottery-hakuna-collapse-bg, #120505), var(--lottery-hakuna-collapse-bg, #120505)), linear-gradient(to top left, var(--lottery-hakuna-collapse-border-gradient-start, #c52217) var(--lottery-hakuna-collapse-border-gradient-start-stop, 32%), var(--lottery-hakuna-collapse-border-gradient-end, #2c2525) var(--lottery-hakuna-collapse-border-gradient-end-stop, 68%));overflow:hidden;margin-bottom:var(--lottery-hakuna-collapse-margin-bottom, 10px)}.lottery-hakuna-collapse .header{display:flex;justify-content:space-between;align-items:center;padding:var(--lottery-hakuna-collapse-header-padding, 20px);cursor:pointer;user-select:none}.lottery-hakuna-collapse .header .header-content{display:flex;align-items:center;flex:1;gap:var(--lottery-hakuna-collapse-header-gap, 8px)}.lottery-hakuna-collapse .header .title{font-size:var(--lottery-hakuna-collapse-title-size, 16px);font-weight:var(--lottery-hakuna-collapse-title-weight, 600);color:var(--lottery-hakuna-collapse-title-color, #fff)}.lottery-hakuna-collapse .header .icon{color:var(--lottery-hakuna-collapse-icon-color, #fff);font-size:var(--lottery-hakuna-collapse-icon-size, 12px);transition:transform 0.3s ease}.lottery-hakuna-collapse .header .icon.is-open{transform:rotate(180deg)}.lottery-hakuna-collapse .content{padding:var(--lottery-hakuna-collapse-content-padding, 0 20px 20px 20px);color:var(--lottery-hakuna-collapse-content-color, #fff);font-size:var(--lottery-hakuna-collapse-content-size, 14px);line-height:var(--lottery-hakuna-collapse-content-line-height, 1.5)}",function(t){t.UNSELECTED="unselected",t.SELECTED="selected"}(d||(d={}));const u=["ro","en","hr"],b={en:{ticket:"Ticket",loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",quickPick:"Quick Pick",submit:"SUBMIT",pickNumbers:"Pick {num} Numbers"},ro:{loading:"Se incarca, va rugam asteptati ...",error:"A fost o eroare in timp ce asteptam datele",multiplier:"Multiplicator",numberOfDraws:"Numarul de extrageri",wagerPerDraw:"Pariul per extragere",resetButton:"Reseteaza",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},fr:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",multiplier:"Multiplier",numberOfDraws:"Number of Draws",wagerPerDraw:"Wager per Draw",resetButton:"Reset",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},ar:{loading:"Loading, please wait ...",error:"It was an error while trying to fetch the data",multiplier:"Multiplier",numberOfDraws:"Number of Draws",wagerPerDraw:"Wager per Draw",resetButton:"Reset",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"},hr:{loading:"Učitavanje, molimo pričekajte ...",error:"Došlo je do pogreške prilikom pokušaja dohvaćanja podataka",multiplier:"Multiplikator",numberOfDraws:"Broj izvlačenja",wagerPerDraw:"Ulog po izvlačenju",resetButton:"Resetiraj",autoButton:"quick pick",lines:"Select how many lines you want to buy",lineName:"Line",playType:"Select one play type you want to buy"}},p=(t,e,i)=>{const o=e;let r=b[void 0!==o&&u.includes(o)?o:"en"][t];return i&&Object.keys(i).forEach((t=>{r=r.replace(`{${t}}`,i[t])})),r},g=class{constructor(e){t(this,e),this.ticketUpdateEvent=o(this,"ticketUpdate",7),this.deleteTicket=o(this,"deleteTicket",7),this.editTicket=o(this,"editTicket",7),this.saveTicket=o(this,"saveTicket",7),this.MAIN_SELECTION_NAME="mainSelection",this.gameName="South Africa",this.allowQuickPick=!0,this.highNumber=6,this.lowNumber=6,this.maximumAllowed=6,this.minimumAllowed=2,this.numberRange=[6],this.useCollapse=!0,this.isSubmitted=!1,this.ticketId=1,this.language="en",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl=void 0,this.disableDelete=!1,this.grids=[],this.ticketDone=[],this.quickPicks=[]}handleClientStylingChange(t,e){t!=e&&r(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&n(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`)}componentWillLoad(){this.translationUrl&&(async t=>{if(t)try{const i=await fetch(t);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const o=await i.json();e=o,Object.keys(e).forEach((t=>{for(let i in e[t])b[t][i]=e[t][i]}))}catch(t){console.error("Failed to fetch or parse translations from URL:",t)}var e})(this.translationUrl)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&r(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl)),this.fillInGrids(1)}toggleAutoSelection(t){this.ticketDone=[...this.ticketDone.slice(0,t),!0,...this.ticketDone.slice(t+1)],this.quickPicks[t]=!0,this.clearSingleGrid(t),this.quickPickSelection(t)}toggleResetSelection(t){this.ticketDone=[...this.ticketDone.slice(0,t),!1,...this.ticketDone.slice(t+1)];const e=[...this.quickPicks];e[t]=!1,this.quickPicks=e,this.clearSingleGrid(t)}clearAllGrid(){this.grids.forEach(((t,e)=>{this.toggleResetSelection(e)}))}toggleResetAllSelection(){this.fillInGrids(1),this.ticketDone=[!1],this.quickPicks=[!1],this.updateGridStatus([],this.MAIN_SELECTION_NAME,0),this.editTicket.emit({ticketId:this.ticketId})}updateGridStatus(t,e,i){this.ticketUpdateEvent.emit({selectionType:e,id:this.ticketId,index:i,selectedNumbers:t,quickPicks:this.quickPicks})}bulletGroupUpdateSelectionHandler(t){var e;t.stopPropagation();const{newSelectedBulletTexts:i,selectionGroupId:o}=t.detail;if(!o)return void console.error("Miss selectionGroupId");const r=o.split("-"),n=Number(r[0]),a=r[1],l=i?null===(e=i.split(","))||void 0===e?void 0:e.sort(((t,e)=>Number(t)-Number(e))):[];this.grids=this.grids.map(((t,e)=>e===n&&a===this.MAIN_SELECTION_NAME?Object.assign(Object.assign({},t),{selection:i}):t)),this.ticketDone=this.numberRange.includes(l.length)?[...this.ticketDone.slice(0,n),!0,...this.ticketDone.slice(n+1)]:[...this.ticketDone.slice(0,n),!1,...this.ticketDone.slice(n+1)],this.quickPicks=[...this.quickPicks.slice(0,n),!1,...this.quickPicks.slice(n+1)],this.updateGridStatus(l,a,n)}shuffleArray(t){const e=[];for(;t.length>0;){const i=Math.floor(Math.random()*t.length);e.push(t.splice(i,1)[0])}return e}quickPickSelection(t){const{highNumber:e,lowNumber:i}=this,o=this.numberRange[0];let r=Array.from({length:e-i+1},((t,e)=>i+e));r=this.shuffleArray(r),r=r.slice(0,o),r.sort(((t,e)=>t-e)),this.grids=this.grids.map(((e,i)=>i===t?Object.assign(Object.assign({},e),{selection:r.join(",")}):e)),this.updateGridStatus(r.map((t=>t.toString())),this.MAIN_SELECTION_NAME,t)}clearSingleGrid(t){this.grids=this.grids.map(((e,i)=>i===t?Object.assign(Object.assign({},e),{selection:""}):e)),this.updateGridStatus([],this.MAIN_SELECTION_NAME,t)}fillInGrids(t){const{highNumber:e,lowNumber:i}=this;this.grids=Array.from({length:t},((t,o)=>({selection:"",bulletTexts:Array.from({length:e-i+1},((t,e)=>i+e)).join(","),groupIdx:o,isSubmitted:!1})))}renderMainPlaceBet(){const t=this.numberRange[0];return e("div",{class:"hakuna-ticket-content"},this.grids.map(((i,o)=>{const r=!i.selection,n=i.selection?i.selection.split(",").filter(Boolean).length:0;return e("div",null,e("div",{class:"hakuna-ticket-content-selection"},e("div",{class:"hakuna-ticket-content-selection-text"},p("pickNumbers",this.language,{num:t})," "),e("div",{class:"hakuna-ticket-content-selection-dots"},Array.from({length:t},((t,e)=>e+1)).map((t=>e("div",{key:t,class:{"hakuna-ticket-content-selection-dots-item":!0,active:t<=n}}))))),e("div",{class:{"hakuna-ticket-content-bullets":!0,disabled:this.isSubmitted}},e("lottery-selection-group",{type:"bet",hasBorder:!1,bulletTexts:i.bulletTexts,selectionGroupId:`${i.groupIdx}-${this.MAIN_SELECTION_NAME}`,"selected-bullet-texts":i.selection,maxSelectedCount:t,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource})),e("div",{class:"hakuna-ticket-content-operation",style:{display:"flex",alignItems:"center"}},e("div",{class:"hakuna-ticket-content-operation--left"},e("div",{class:{"icon-btn":!0,disabled:r||this.isSubmitted},onClick:()=>!r&&this.toggleResetSelection(o)},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.833374 9.99996C0.833374 5.39759 4.56433 1.66663 9.16671 1.66663C11.4687 1.66663 13.554 2.60112 15.0613 4.10944C15.5943 4.64284 16.1651 5.30202 16.6667 5.91199V3.33329C16.6667 2.87306 17.0398 2.49996 17.5 2.49996C17.9603 2.49996 18.3334 2.87306 18.3334 3.33329V8.33329C18.3334 8.79353 17.9603 9.16663 17.5 9.16663H12.5C12.0398 9.16663 11.6667 8.79353 11.6667 8.33329C11.6667 7.87306 12.0398 7.49996 12.5 7.49996H15.8077C15.2309 6.77602 14.5138 5.91942 13.8824 5.28755C12.6749 4.07924 11.0087 3.33329 9.16671 3.33329C5.48481 3.33329 2.50004 6.31806 2.50004 9.99996C2.50004 13.6819 5.48481 16.6666 9.16671 16.6666C12.2048 16.6666 14.7703 14.6337 15.5729 11.8523C15.7005 11.4101 16.1624 11.155 16.6046 11.2826C17.0468 11.4102 17.3018 11.8721 17.1742 12.3143C16.1713 15.79 12.9671 18.3333 9.16671 18.3333C4.56433 18.3333 0.833374 14.6023 0.833374 9.99996Z",fill:"currentColor"})))),e("div",{class:"hakuna-ticket-content-operation--right"},this.allowQuickPick&&e("lottery-button",{variant:"outline",color:"var(--emw-hakuna-color-primary, #C52217)",size:"small",onClick:this.toggleAutoSelection.bind(this,o),disabled:this.isSubmitted},e("span",{slot:"icon-left"},e("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.81557 0.631525C8.05311 0.734641 8.19424 0.982014 8.16212 1.23897L7.66075 5.24995L11.2745 5.24995C11.4151 5.24992 11.5575 5.2499 11.6738 5.26043C11.7838 5.27039 11.9945 5.29674 12.1772 5.44439C12.3864 5.61342 12.5062 5.86924 12.5021 6.13814C12.4986 6.37303 12.384 6.55174 12.3212 6.64264C12.2548 6.73875 12.1636 6.84811 12.0736 6.95609L6.86476 13.2067C6.69898 13.4057 6.42189 13.4715 6.18435 13.3684C5.94681 13.2653 5.80568 13.0179 5.8378 12.7609L6.33917 8.74995L2.72543 8.74995C2.58485 8.74998 2.44246 8.75001 2.32613 8.73947C2.21611 8.72951 2.00543 8.70316 1.82272 8.55551C1.61355 8.38648 1.49373 8.13066 1.49778 7.86176C1.50132 7.62688 1.61595 7.44816 1.67873 7.35726C1.74512 7.26115 1.8363 7.15177 1.92632 7.04379C1.93078 7.03844 1.93523 7.0331 1.93968 7.02776L7.13516 0.793177C7.30094 0.59424 7.57803 0.52841 7.81557 0.631525ZM2.9954 7.58328H6.99996C7.16728 7.58328 7.32654 7.65513 7.43727 7.78057C7.548 7.906 7.59954 8.07295 7.57879 8.23897L7.24224 10.9314L11.0045 6.41662H6.99996C6.83264 6.41662 6.67338 6.34477 6.56265 6.21934C6.45192 6.0939 6.40038 5.92696 6.42113 5.76093L6.75768 3.06855L2.9954 7.58328Z",fill:"white"}))),e("span",{style:{color:"#fff"}},p("quickPick",this.language))),e("lottery-button",{variant:"primary",color:"var(--emw-hakuna-color-primary, #C52217)",size:"small",text:p("submit",this.language),disabled:!this.ticketDone[o]||this.isSubmitted,onClick:this.handleSaveTicket.bind(this)}))))})))}renderCurSelectionButton(t,i){return t===d.UNSELECTED?e("div",{class:"cur-selection-btn unselected"},"?"):e("div",{class:"cur-selection-btn active"}," ",i)}handleEditTicket(){var t;const{ticketId:e}=this;this.editTicket.emit({ticketId:e}),null===(t=this.collapseComponent)||void 0===t||t.toggle()}handleDelTicket(){const{ticketId:t}=this;this.deleteTicket.emit({ticketId:t})}handleSaveTicket(){var t;this.saveTicket.emit({ticketId:this.ticketId}),null===(t=this.collapseComponent)||void 0===t||t.toggle()}renderCurSelection(){const t=this.numberRange[0];return e("div",{class:"hakuna-ticket-summary"},this.grids.map(((i,o)=>{const r=i.selection?i.selection.split(",").filter(Boolean):[];return r.sort(((t,e)=>Number(t)-Number(e))),e("div",{key:o,class:"hakuna-ticket-summary-item"},e("div",{class:"hakuna-ticket-summary-selection"},Array.from({length:t}).map(((t,e)=>this.renderCurSelectionButton(e<r.length&&this.isSubmitted?d.SELECTED:d.UNSELECTED,r[e])))),e("div",{class:"hakuna-ticket-summary-operation"},e("div",{class:{"icon-btn":!0,disabled:!this.isSubmitted},onClick:()=>this.isSubmitted&&this.handleEditTicket()},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"19",height:"19",viewBox:"0 0 19 19",fill:"none"},e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.9173 0.757664C14.9276 -0.252556 16.5654 -0.252554 17.5757 0.757667C18.5859 1.76789 18.5859 3.40578 17.5757 4.41601L9.65042 12.3413C9.63402 12.3577 9.61776 12.3739 9.60164 12.3901C9.36341 12.6288 9.15337 12.8392 8.90014 12.9944C8.67769 13.1307 8.43517 13.2312 8.18147 13.2921C7.89269 13.3614 7.59538 13.3611 7.25815 13.3608C7.23533 13.3608 7.21232 13.3608 7.18912 13.3608H5.80132C5.34361 13.3608 4.97256 12.9897 4.97256 12.532V11.1442C4.97256 11.121 4.97254 11.098 4.97251 11.0752C4.9722 10.738 4.97192 10.4406 5.04125 10.1519C5.10216 9.89817 5.20262 9.65564 5.33894 9.43319C5.49411 9.17997 5.70454 8.96993 5.94322 8.7317C5.95937 8.71557 5.97566 8.69932 5.99206 8.68291L13.9173 0.757664ZM16.4036 1.92971C16.0407 1.5668 15.4523 1.5668 15.0894 1.92971L7.16411 9.85496C6.84954 10.1695 6.79154 10.2351 6.75221 10.2992C6.70677 10.3734 6.67328 10.4542 6.65298 10.5388C6.63541 10.612 6.63008 10.6994 6.63008 11.1442V11.7032H7.18912C7.63398 11.7032 7.72134 11.6979 7.79453 11.6803C7.8791 11.66 7.95994 11.6265 8.03409 11.5811C8.09827 11.5418 8.16381 11.4838 8.47837 11.1692L16.4036 3.24396C16.7665 2.88104 16.7665 2.29263 16.4036 1.92971ZM4.7726 1.75807L8.28763 1.75807C8.74535 1.75807 9.11639 2.12912 9.11639 2.58684C9.11639 3.04455 8.74535 3.4156 8.28763 3.4156H4.80683C4.09693 3.4156 3.61434 3.41624 3.24132 3.44672C2.87798 3.47641 2.69217 3.53021 2.56255 3.59626C2.25067 3.75517 1.9971 4.00874 1.83819 4.32062C1.77214 4.45024 1.71833 4.63605 1.68865 4.9994C1.65817 5.37241 1.65753 5.855 1.65753 6.5649V13.5265C1.65753 14.2364 1.65817 14.719 1.68865 15.092C1.71833 15.4554 1.77214 15.6412 1.83819 15.7708C1.9971 16.0827 2.25067 16.3362 2.56255 16.4951C2.69217 16.5612 2.87798 16.615 3.24132 16.6447C3.61434 16.6752 4.09692 16.6758 4.80683 16.6758H11.7684C12.4783 16.6758 12.9609 16.6752 13.3339 16.6447C13.6973 16.615 13.8831 16.5612 14.0127 16.4951C14.3246 16.3362 14.5782 16.0827 14.7371 15.7708C14.8031 15.6412 14.8569 15.4554 14.8866 15.092C14.9171 14.719 14.9177 14.2364 14.9177 13.5265V10.0457C14.9177 9.58799 15.2888 9.21694 15.7465 9.21694C16.2042 9.21694 16.5753 9.58799 16.5753 10.0457V13.5608C16.5753 14.2279 16.5753 14.7785 16.5386 15.227C16.5006 15.6928 16.4189 16.1211 16.2139 16.5233C15.8961 17.1471 15.389 17.6542 14.7652 17.972C14.363 18.177 13.9348 18.2586 13.4689 18.2967C13.0204 18.3334 12.4698 18.3333 11.8027 18.3333H4.77258C4.10546 18.3333 3.55487 18.3334 3.10635 18.2967C2.6405 18.2586 2.21228 18.177 1.81005 17.972C1.18628 17.6542 0.679145 17.1471 0.36132 16.5233C0.156374 16.1211 0.0746879 15.6928 0.0366268 15.227C-1.89071e-05 14.7785 -1.02138e-05 14.2279 3.57439e-07 13.5607V6.53067C-1.02138e-05 5.86354 -1.89071e-05 5.31294 0.0366268 4.86442C0.0746879 4.39858 0.156374 3.97035 0.36132 3.56812C0.679145 2.94436 1.18628 2.43722 1.81005 2.11939C2.21228 1.91445 2.6405 1.83276 3.10635 1.7947C3.55487 1.75805 4.10547 1.75806 4.7726 1.75807Z",fill:"currentColor"}))),e("div",{class:{"icon-btn":!0,disabled:this.disableDelete},onClick:()=>!this.disableDelete&&this.handleDelTicket()},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 20 20",fill:"none"},e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M9.30123 0.833253H10.6988C11.1381 0.833238 11.5171 0.833225 11.8292 0.858728C12.1587 0.885646 12.4863 0.945075 12.8017 1.10574C13.2721 1.34542 13.6545 1.72787 13.8942 2.19828C14.0549 2.51359 14.1143 2.84128 14.1412 3.17073C14.1641 3.45054 14.1664 3.78406 14.1667 4.16659H17.5C17.9603 4.16659 18.3334 4.53968 18.3334 4.99992C18.3334 5.46016 17.9603 5.83325 17.5 5.83325H16.6667V14.3677C16.6667 15.0385 16.6667 15.5921 16.6299 16.0431C16.5916 16.5115 16.5095 16.9421 16.3034 17.3466C15.9838 17.9738 15.4739 18.4837 14.8467 18.8033C14.4422 19.0094 14.0116 19.0915 13.5432 19.1298C13.0922 19.1666 12.5386 19.1666 11.8678 19.1666H8.13225C7.46145 19.1666 6.90782 19.1666 6.45683 19.1298C5.98842 19.0915 5.55783 19.0094 5.15339 18.8033C4.52618 18.4837 4.01624 17.9738 3.69667 17.3466C3.49059 16.9421 3.40845 16.5115 3.37018 16.0431C3.33333 15.5921 3.33334 15.0385 3.33335 14.3677L3.33335 5.83325H2.50002C2.03978 5.83325 1.66669 5.46016 1.66669 4.99992C1.66669 4.53968 2.03978 4.16659 2.50002 4.16659H5.83338C5.83361 3.78406 5.83597 3.45054 5.85883 3.17073C5.88575 2.84128 5.94518 2.51359 6.10584 2.19828C6.34552 1.72787 6.72797 1.34542 7.19838 1.10574C7.51369 0.945075 7.84138 0.885646 8.17083 0.858728C8.48297 0.833225 8.86194 0.833238 9.30123 0.833253ZM5.00002 5.83325V14.3333C5.00002 15.0471 5.00067 15.5323 5.03131 15.9074C5.06116 16.2727 5.11527 16.4596 5.18168 16.5899C5.34146 16.9035 5.59643 17.1585 5.91004 17.3183C6.04037 17.3847 6.22721 17.4388 6.59255 17.4686C6.96763 17.4993 7.45287 17.4999 8.16669 17.4999H11.8334C12.5472 17.4999 13.0324 17.4993 13.4075 17.4686C13.7728 17.4388 13.9597 17.3847 14.09 17.3183C14.4036 17.1585 14.6586 16.9035 14.8184 16.5899C14.8848 16.4596 14.9389 16.2727 14.9687 15.9074C14.9994 15.5323 15 15.0471 15 14.3333V5.83325H5.00002ZM12.5 4.16659H7.50008C7.50045 3.779 7.503 3.51407 7.51996 3.30645C7.53846 3.08006 7.56985 2.99613 7.59085 2.95493C7.67074 2.79813 7.79823 2.67064 7.95503 2.59075C7.99623 2.56975 8.08016 2.53836 8.30655 2.51986C8.54266 2.50057 8.85289 2.49992 9.33335 2.49992H10.6667C11.1471 2.49992 11.4574 2.50057 11.6935 2.51986C11.9199 2.53836 12.0038 2.56975 12.045 2.59075C12.2018 2.67064 12.3293 2.79813 12.4092 2.95493C12.4302 2.99613 12.4616 3.08006 12.4801 3.30645C12.497 3.51407 12.4996 3.779 12.5 4.16659ZM8.33335 8.74992C8.79359 8.74992 9.16669 9.12302 9.16669 9.58325V13.7499C9.16669 14.2102 8.79359 14.5833 8.33335 14.5833C7.87312 14.5833 7.50002 14.2102 7.50002 13.7499V9.58325C7.50002 9.12302 7.87312 8.74992 8.33335 8.74992ZM11.6667 8.74992C12.1269 8.74992 12.5 9.12302 12.5 9.58325V13.7499C12.5 14.2102 12.1269 14.5833 11.6667 14.5833C11.2064 14.5833 10.8334 14.2102 10.8334 13.7499V9.58325C10.8334 9.12302 11.2064 8.74992 11.6667 8.74992Z",fill:"currentColor"})))))})))}render(){return e("div",{key:"302b68e74faa49232b9c0a92833b325e4e44a5b9",class:"hakuna-ticket",ref:t=>this.stylingContainer=t},e("lottery-hakuna-collapse",{key:"56139e7e5e8a035aa0b7d1c172aeddf0e905335b",ref:t=>this.collapseComponent=t,"header-title":`${this.gameName} #${this.ticketId}`,footer:!0,collapsed:!1,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource},this.renderMainPlaceBet(),e("div",{key:"65f4f1534e2d325b3b7ebf34ed34f32aaef7bc4e",slot:"summary"},this.renderCurSelection())))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};g.style='@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@100&display=swap");:host{--emw--color-background-secondary:var(--emw-hakuna-bg-secondary, #120505);--emw--color-primary:var(--emw-hakuna-color-primary, #c52217);--emw--color-background:var(--emw-hakuna-bg-primary, #2c2525);--emw--color-background-tertiary:var(--emw-hakuna-bg-tertiary, #4f2421);--lottery-button-outline-active-bg:var(--emw-hakuna-bg-tertiary, #4f2421);--lottery-selection-background:var(--emw-hakuna-bg-primary, #2c2525);--lottery-selection-color:var(--emw-hakuna-text-secondary, #b4a5a5);--lottery-selection-group-bullets-gap:10px;--lottery-selection-disabled-background:#392f2f;--lottery-selection-disabled-color:var(--emw-hakuna-bg-secondary, #120505);--lottery-selection-border-radius:6px;--lottery-selection-hover-background:var(--emw-hakuna-bg-tertiary, #4f2421);--lottery-selection-hover-color:var(--emw-hakuna-text-secondary, #b4a5a5)}.hakuna-ticket .icon-btn{display:flex;align-items:center;justify-content:center;height:32px;cursor:pointer;color:var(--emw-hakuna-text-secondary, #b4a5a5);transition:color 0.2s ease, opacity 0.2s ease}.hakuna-ticket .icon-btn.disabled{cursor:not-allowed;opacity:0.5;pointer-events:none}.hakuna-ticket-content-selection{display:flex;align-items:center;gap:12px}.hakuna-ticket-content-selection-text{color:var(--emw-hakuna-text-secondary, #b4a5a5);font-size:12px;font-style:normal;font-weight:500;line-height:normal}.hakuna-ticket-content-selection-dots{display:flex;align-items:center;justify-content:center;gap:4px}.hakuna-ticket-content-selection-dots-item{width:10px;height:10px;border-radius:50%;background-color:var(--emw-hakuna-bg-tertiary, #4f2421);transition:background-color 0.3s ease, transform 0.3s ease;box-shadow:0 2px 4px 0 rgba(0, 0, 0, 0.15)}.hakuna-ticket-content-selection-dots-item.active{background-color:var(--emw-hakuna-color-primary, #c52217);transform:scale(1.06)}.hakuna-ticket-content-bullets{margin:20px 0}.hakuna-ticket-content-bullets.disabled{pointer-events:none;cursor:not-allowed}.hakuna-ticket-content-operation{display:flex;justify-content:space-between}.hakuna-ticket-content-operation--right{display:flex;gap:8px;align-items:center}.hakuna-ticket .cur-selection-btn{display:flex;width:32px;height:32px;justify-content:center;align-items:center;border-radius:6px;background:var(--emw-hakuna-bg-primary, #2c2525);box-shadow:0 2px 4px 0 rgba(0, 0, 0, 0.15);font-size:14px;font-weight:500;color:var(--emw-hakuna-text-secondary, #b4a5a5)}.hakuna-ticket .cur-selection-btn.active{color:var(--emw-hakuna-text-primary, #ffffff);font-weight:700;font-size:16px;background:linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0) 100%), var(--emw-hakuna-color-primary, #c52217);box-shadow:0 2px 4px 0 rgba(0, 0, 0, 0.15)}.hakuna-ticket-summary-item{display:flex;justify-content:space-between;align-items:center}.hakuna-ticket-summary-selection{display:flex;gap:6px;align-items:center}.hakuna-ticket-summary-operation{display:flex;align-items:center;gap:10px;margin-left:20px}';const y={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M864 256H736v-80c0-35.3-28.7-64-64-64H352c-35.3 0-64 28.7-64 64v80H160c-17.7 0-32 14.3-32 32v32c0 4.4 3.6 8 8 8h60.4l24.7 523c1.6 34.1 29.8 61 63.9 61h454c34.2 0 62.3-26.8 63.9-61l24.7-523H888c4.4 0 8-3.6 8-8v-32c0-17.7-14.3-32-32-32zm-200 0H360v-72h304v72z"}}]},name:"delete",theme:"filled"};var f=function(){return f=Object.assign||function(t){for(var e,i=1,o=arguments.length;i<o;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},f.apply(this,arguments)},v={primaryColor:"#333",secondaryColor:"#E6E6E6"};function m(t,e){var i="svg"===t.tag?f(f({},t.attrs),e.extraSVGAttrs||{}):t.attrs,o=Object.keys(i).reduce((function(t,e){var o=i[e],r="".concat(e,'="').concat(o,'"');return t.push(r),t}),[]),r=o.length?" "+o.join(" "):"",n=(t.children||[]).map((function(t){return m(t,e)})).join("");return n&&n.length?"<".concat(t.tag).concat(r,">").concat(n,"</").concat(t.tag,">"):"<".concat(t.tag).concat(r," />")}const k=class{constructor(e){t(this,e),this.lotteryBulletClickHandler=o(this,"lotteryBulletClick",7),this.value=0,this.text=void 0,this.idx=void 0,this.type="toggle",this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.hasBorder=!0,this.hasBackground=!0,this.deleteIconSvg="",this.deleteIconWidth="16px",this.deleteIconHeight="16px"}handleClientStylingChange(t,e){t!==e&&r(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!==e&&n(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!==e&&a(this.stylingContainer,`${this.mbSource}.Style`)}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&r(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}handleClick(){"disabled"!==this.type&&"readonly"!==this.type&&(console.log("bullet clicked",this.type,this.idx,this.text,this.value),this.lotteryBulletClickHandler.emit({type:this.type,idx:this.idx,text:this.text,value:this.value}))}render(){let t;return t=this.deleteIconSvg?function(t){let e=t.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"");return e=e.replace(/on[a-z]+=[\"'][^\"']*[\"']/gi,""),e=e.replace(/javascript:/gi,""),e}(this.deleteIconSvg):function(t,e){if(void 0===e&&(e={}),"function"==typeof t.icon){var i=e.placeholders||v;return m(t.icon(i.primaryColor,i.secondaryColor),e)}return m(t.icon,e)}(y,{extraSVGAttrs:{width:this.deleteIconWidth,height:this.deleteIconHeight,fill:"currentColor"}}),e("div",{key:"0d1e8aaa80a907a7467410f6b27b4b6175e82299",class:"lottery-selection",ref:t=>this.stylingContainer=t},e("button",{key:"11a2402abbc290dc877ad95f3433092c3a0d8419",class:{"lottery-selection__button":!0,"lottery-selection__button--selected":1==this.value,"lottery-selection__button--disabled":"disabled"===this.type,"lottery-selection__button--no-border":!this.hasBorder,"lottery-selection__button--no-background":!this.hasBackground,isDeleteByIcon:"delete"===this.type,isCallDialogBtn:"input"===this.type||"readonly"===this.type},onClick:this.handleClick.bind(this),disabled:"disabled"===this.type},"delete"===this.type&&e("span",{key:"f99001d936a8f7bdf8adc5c46e82caf730a9442a",class:"lottery-selection__delete-icon",innerHTML:t}),e("span",{key:"55775e2492a1fe45cc8a457ac0a0d206744461ab",class:"lottery-selection__text"},this.text)))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};k.style=":host{display:inline-block}.lottery-selection__button{display:flex;align-items:center;justify-content:center;width:var(--lottery-selection-width, 32px);height:var(--lottery-selection-height, 32px);padding:var(--lottery-selection-padding, 0);box-sizing:border-box;background:var(--lottery-selection-background, var(--emw--color-background, #fff));border:var(--lottery-selection-border-width, 2px) var(--lottery-selection-border-style, solid) var(--lottery-selection-border-color, var(--emw--color-primary, #0d196e));border-radius:var(--lottery-selection-border-radius, var(--emw--border-radius-medium, 8px));color:var(--lottery-selection-color, var(--emw--color-typography, #000));font-weight:var(--lottery-selection-font-weight, bold);font-size:var(--lottery-selection-font-size, 1em);cursor:pointer;user-select:none;}.lottery-selection__button:hover{background:var(--lottery-selection-hover-background, var(--emw--color-background, #fff));border-color:var(--lottery-selection-hover-border-color, var(--emw--color-primary, #0d196e));color:var(--lottery-selection-hover-color, var(--emw--color-typography, #000))}.lottery-selection__button .lottery-selection__delete-icon{display:none}.lottery-selection__button.isDeleteByIcon:hover .lottery-selection__text{display:none}.lottery-selection__button.isDeleteByIcon:hover .lottery-selection__delete-icon{display:flex;align-items:center;justify-content:center;fill:var(--lottery-selection-delete-icon-color, var(--emw--color-typography, #000));vertical-align:middle}.lottery-selection__button.lottery-selection__button--selected{background-color:var(--lottery-selection-selected-background, var(--emw--color-primary, #0d196e));border-color:var(--lottery-selection-selected-border-color, var(--emw--color-primary, #0d196e));color:var(--lottery-selection-selected-color, var(--emw--color-typography-inverse, #fff))}.lottery-selection__button.lottery-selection__button--disabled{background-color:var(--lottery-selection-disabled-background, var(--emw--color-gray-50, #f5f5f5));border-color:var(--lottery-selection-disabled-border-color, var(--emw--color-gray-100, #e6e6e6));color:var(--lottery-selection-disabled-color, var(--emw--color-gray-150, #6f6f6f));cursor:not-allowed;pointer-events:none;}.lottery-selection__button.lottery-selection__button--no-border{border:none}.lottery-selection__button.lottery-selection__button--no-background{background:transparent}";const C=["ro","en","fr","ar","hr","zh"],w={en:{noTicketBoard:"No ticket board available.",selectionCleared:"Your selection has been cleared.",clearAll:"Clear All",stopAt:"Stop at",turnover:"Turnover: ",pleaseFillIn:"Please fill in all the selection input!",fillIn:"Fill in",noBets:"Sorry. No bets have been placed so far. Check back later!",search:"Search",clear:"Clear",oddsChart:"Odds Chart",ticketSuccess:"Ticket purchased successfully.",stakePerLine:"Stake per Line:",lowestOdds:"Lowest Odds:",highestOdds:"Highest Odds:",orderSummary:"ORDER SUMMARY",ticket:"Ticket",lines:"Lines",total:"Total",submit:"Submit",loading:"Loading",enterValidNumber:"Please enter a valid number.",enterNumberBetween:"Please enter a number between {min} and {max}.",numberAlreadySelected:"This number has already been selected.",enterScoreUpTo:"Please enter the score (Up to {maxScore})",enterValue:"Please enter a value",myChoices:"My Choices",teams:"Teams",scores:"Scores",euro:"Euro",cancel:"Cancel",confirm:"Confirm"},ro:{},fr:{},ar:{},hr:{}},x=(t,e,i)=>{const o=e;let r=w[void 0!==o&&C.includes(o)?o:"en"][t];return i&&Object.keys(i).forEach((t=>{r=r.replace(`{${t}}`,i[t])})),r};function S(t,e){return new Set(t?t.split(e):[])}function _(t,e){return e.filter((e=>e!==t))}function j(t,e){return e.concat([t])}const M=class{constructor(e){t(this,e),this.bulletGroupUpdateSelectedBulletTexts=o(this,"bulletGroupUpdateSelection",7),this.mbSource=void 0,this.clientStyling=void 0,this.clientStylingUrl=void 0,this.language="en",this.translationUrl="",this.splitToken=",",this.selectionGroupId=void 0,this.selectionGroupLabel=void 0,this.type="bet",this.selectedBulletTexts=null,this.maxSelectedCount=null,this.maxDisplayBulletsCount=11,this.bulletTexts=null,this.maxIntegerBulletText=null,this.minIntegerBulletText=0,this.bulletTextType="integer",this.hasBorder=!0,this.hasBackground=!0,this.dialogTitle=void 0,this.dialogInputPlaceholder=void 0,this.dialogConfig={width:"400px",visible:!1,onConfirm:()=>this.handleFillInAddMore(),onCancel:()=>this.handleCloseAddMoreDialog()},this.inputInfo={valid:!0,errorMessage:"",value:""}}handleClientStylingChange(t,e){t!=e&&r(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&n(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`)}componentWillLoad(){var t;this.translationUrl&&(t=JSON.parse(this.translationUrl),Object.keys(t).forEach((e=>{for(let i in t[e])w[e][i]=t[e][i]})))}componentDidLoad(){this.stylingContainer&&(this.mbSource&&a(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&r(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&n(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){this.stylingSubscription&&this.stylingSubscription.unsubscribe()}lotteryBulletClickHandler(t){if(t.stopPropagation(),"input"!==t.detail.type)if(["delete","toggle"].includes(t.detail.type))this.bulletGroupUpdateSelectedBulletTexts.emit({newSelectedBulletTexts:(e=t.detail,i=Array.from(this.selectedSet),o=this.maxSelectedCount,"delete"===e.type?_(e.text,i):"toggle"===e.type?i.includes(e.text)?_(e.text,i):i.length>=o?function(t,e,i){return e.slice(e.length-(i-1)).concat([t])}(e.text,i,o):j(e.text,i):[]).join(this.splitToken),selectionGroupId:this.selectionGroupId});else var e,i,o;else this.dialogConfig=Object.assign(Object.assign({},this.dialogConfig),{visible:!0})}get selectedSet(){return S(this.selectedBulletTexts,this.splitToken)}get bulletTextsSet(){return this.bulletTexts?S(this.bulletTexts,this.splitToken):"integer"===this.bulletTextType&&null!=this.maxIntegerBulletText?S(Array.from({length:Number(this.lastDisplayBulletText)-this.minIntegerBulletText+1},((t,e)=>this.minIntegerBulletText+e)).join(this.splitToken),this.splitToken):new Set}get lastDisplayBulletText(){if("integer"===this.bulletTextType)return null!=this.maxIntegerBulletText?Math.min(this.maxIntegerBulletText,this.minIntegerBulletText+this.maxDisplayBulletsCount-1):this.minIntegerBulletText+this.maxDisplayBulletsCount-1;if(this.bulletTextsSet.size>0){const t=Array.from(this.bulletTextsSet);return t.length>=this.maxDisplayBulletsCount?t[this.maxDisplayBulletsCount-1]:t[t.length-1]}return null}get isSingleSelectionMode(){return 1===this.maxSelectedCount}getBulletToRender(){const t=Array.from(this.bulletTextsSet);let e=t,i=!1;return"text"===this.bulletTextType?t.length>this.maxDisplayBulletsCount?(i=!0,e=t.slice(0,this.maxDisplayBulletsCount-1)):e=t:(i=null!=this.maxIntegerBulletText&&this.maxIntegerBulletText>Number(this.lastDisplayBulletText),e=t),{bulletsToRender:e,showInputButton:i}}renderBulletGroup(){let t=[];if("bet"===this.type){const e=null!==this.maxSelectedCount&&this.selectedSet.size>=this.maxSelectedCount,{bulletsToRender:i,showInputButton:o}=this.getBulletToRender();if(i.forEach(((i,o)=>{let r="toggle";this.selectedSet.has(String(i))||!e||this.isSingleSelectionMode||(r="disabled"),t.push({value:this.selectedSet.has(String(i))?1:0,text:String(i),idx:o,type:r})})),o){let i="input";e&&!this.isSingleSelectionMode&&(i="disabled");const o="text"===this.bulletTextType?"...":`${this.lastDisplayBulletText}+`,r="text"===this.bulletTextType?-1:Number(this.lastDisplayBulletText)+1;"integer"===this.bulletTextType&&t.length>=this.maxDisplayBulletsCount&&t.pop(),t.push({value:0,text:o,idx:r,type:i})}}else if(["choice","preview"].includes(this.type)){const{bulletsToRender:e}=this.getBulletToRender();e.forEach(((e,i)=>{let o="toggle";"preview"===this.type?o="readonly":this.selectedSet.has(String(e))&&(o="delete"),t.push({value:this.selectedSet.has(String(e))?1:0,text:e,idx:i,type:o})}))}return e("div",{class:"lottery-selection-group__item--right"},t.map((t=>e("lottery-selection",{clientStyling:this.clientStyling,clientStylingUrl:this.clientStylingUrl,mbSource:this.mbSource,text:t.text,idx:t.idx,value:t.value,type:t.type,hasBorder:this.hasBorder,hasBackground:this.hasBackground}))))}handleCloseAddMoreDialog(){this.dialogConfig=Object.assign(Object.assign({},this.dialogConfig),{visible:!1}),this.inputInfo={value:"",errorMessage:"",valid:!0}}handleInputChange(t){const e=t.target.value;this.inputInfo=Object.assign(Object.assign({},this.inputInfo),{value:e}),this.inputInfo=function({value:t,selectedSet:e,maxValue:i,minValue:o,language:r,type:n="integer"}){const a=t.trim();if("integer"===n){if(!/^-?\d+$/.test(a))return{valid:!1,errorMessage:x("enterValidNumber",r),value:t};const n=Number(a);if(isNaN(n))return{valid:!1,errorMessage:x("enterValidNumber",r),value:t};if(void 0!==o&&n<o||void 0!==i&&n>i)return{valid:!1,errorMessage:x("enterNumberBetween",r,{min:o,max:i}),value:t};const l=String(n);if(e.has(l))return{valid:!1,errorMessage:x("numberAlreadySelected",r),value:t}}else if(e.has(a))return{valid:!1,errorMessage:x("numberAlreadySelected",r),value:t};return{valid:!0,errorMessage:"",value:t}}({value:e,selectedSet:this.selectedSet,maxValue:this.maxIntegerBulletText,minValue:"integer"===this.bulletTextType?Number(this.lastDisplayBulletText)+1:void 0,language:this.language,type:this.bulletTextType})}handleFillInAddMore(){if(this.inputInfo.valid){const{value:t}=this.inputInfo;let e,i=t;i="integer"===this.bulletTextType?String(Number(t)):t.trim(),e=this.isSingleSelectionMode?i:j(i,Array.from(this.selectedSet)).join(this.splitToken),this.bulletGroupUpdateSelectedBulletTexts.emit({newSelectedBulletTexts:e,selectionGroupId:this.selectionGroupId}),this.handleCloseAddMoreDialog()}}render(){return e("div",{key:"66b8e9c63d948eb2f7eb37adb80892dbedd7df9a",class:"lottery-selection-group",ref:t=>this.stylingContainer=t},e("div",{key:"6562fdcad0f352b5e2d03edcc980a9aeab32277e",class:"lottery-selection-group__item"},this.selectionGroupLabel&&e("div",{key:"43c2132e4904a2b69b970d9b2074f120ed4d0986",class:"lottery-selection-group__item--left"},this.selectionGroupLabel),this.renderBulletGroup()),e("lottery-tipping-dialog",{key:"cb693d10e6b499628909571021d8508cdebbe29a",visible:this.dialogConfig.visible,width:this.dialogConfig.width,onCancel:this.dialogConfig.onCancel},e("div",{key:"dd312634574bbe1b4d3de7e82a9c58f58f846c1a",class:"addSelectionDialog"},e("div",{key:"b371b1090598f0219a7c652bab51e9d349703c34",class:"addSelectionDialog-title"},this.dialogTitle||("text"===this.bulletTextType?x("enterValue",this.language):x("enterScoreUpTo",this.language,{maxScore:this.maxIntegerBulletText}))),e("input",{key:"b5f1bb74999246dac8dc20f04e3af893deae6654",type:"text",class:{"dialog-input":!0,invalid:!this.inputInfo.valid},value:this.inputInfo.value,onInput:this.handleInputChange.bind(this),placeholder:this.dialogInputPlaceholder}),e("div",{key:"f33970a6dffdc881ffa9cf2c0bb54b26b27cccd6",class:"error-message"},this.inputInfo.errorMessage)),e("div",{key:"4c580dae14b38aff03e17067b2c0b72d01aa4f42",slot:"footer",class:"addSelectionDialog-footer"},e("lottery-button",{key:"874aa0ffde8fe2d0b08efea0cf951f101ab8dad0",onClick:this.dialogConfig.onCancel,text:x("cancel",this.language),variant:"outline"}),e("lottery-button",{key:"63a556eb5f9ad1cdd357c017756be274d40ef235",onClick:this.dialogConfig.onConfirm,text:x("confirm",this.language),variant:"primary",disabled:!this.inputInfo.valid||!this.inputInfo.value}))))}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};M.style=":host {\n width: 100%;\n}\n\n.lottery-selection-group {\n container-type: inline-size;\n padding: var(--lottery-selection-group-padding, 0);\n background: var(--lottery-selection-group-background, transparent);\n border: var(--lottery-selection-group-border, none);\n border-radius: var(--lottery-selection-group-border-radius, 0);\n}\n.lottery-selection-group__item {\n display: flex;\n flex-direction: var(--lottery-selection-group-flex-direction, row);\n align-items: var(--lottery-selection-group-item-align, center);\n justify-content: var(--lottery-selection-group-item-justify, flex-start);\n gap: var(--lottery-selection-group-item-gap, 16px);\n width: 100%;\n}\n.lottery-selection-group__item--left {\n width: var(--lottery-selection-group-label-width, 130px);\n min-width: var(--lottery-selection-group-label-min-width, auto);\n max-width: var(--lottery-selection-group-label-max-width, none);\n color: var(--lottery-selection-group-label-color, var(--emw--color-typography, #000));\n font-size: var(--lottery-selection-group-label-font-size, 1em);\n font-weight: var(--lottery-selection-group-label-font-weight, bold);\n text-align: var(--lottery-selection-group-label-align, left);\n white-space: var(--lottery-selection-group-label-white-space, normal);\n}\n.lottery-selection-group__item--right {\n flex: 1;\n display: flex;\n flex-wrap: var(--lottery-selection-group-bullets-wrap, wrap); /* Allow items to wrap */\n gap: var(--lottery-selection-group-bullets-gap, 8px); /* Gap between bullets */\n align-items: var(--lottery-selection-group-bullets-align, center);\n justify-content: var(--lottery-selection-group-bullets-justify, flex-start); /* Align bullets to start */\n}\n@container (max-width: 320px) {\n .lottery-selection-group__item--left {\n width: 100px;\n max-width: 100px;\n }\n}\n\n.dialog-input {\n width: 100%;\n padding: var(--lottery-selection-group-input-padding, 8px);\n border: var(--lottery-selection-group-input-border-width, 1px) var(--lottery-selection-group-input-border-style, solid) var(--lottery-selection-group-input-border-color, var(--emw--color-gray-100, #e6e6e6));\n border-radius: var(--lottery-selection-group-input-radius, 4px);\n background-color: var(--lottery-selection-group-input-bg, #fff);\n color: var(--lottery-selection-group-input-color, #000);\n box-sizing: border-box;\n margin-top: var(--lottery-selection-group-input-margin-top, 10px);\n font-size: var(--lottery-selection-group-input-font-size, 1em);\n}\n.dialog-input::placeholder {\n color: var(--lottery-selection-group-input-placeholder-color, #999);\n}\n\n.dialog-input.invalid,\n.dialog-input.invalid:focus {\n border-color: var(--emw--color-error, #ff3d00);\n outline-color: var(--emw--color-error, #ff3d00);\n}\n\n.error-message {\n color: var(--lottery-selection-group-error-color, var(--emw--color-error, #ff3d00));\n font-size: var(--lottery-selection-group-error-font-size, 12px);\n font-weight: var(--lottery-selection-group-error-font-weight, normal);\n margin-top: 4px;\n}\n\n.addSelectionDialog-title {\n color: var(--lottery-selection-group-dialog-title-color, var(--emw--color-typography, #000));\n font-size: var(--lottery-selection-group-dialog-title-font-size, 1.2em);\n font-weight: var(--lottery-selection-group-dialog-title-font-weight, bold);\n margin-bottom: var(--lottery-selection-group-dialog-title-margin-bottom, 0);\n}\n.addSelectionDialog-footer {\n display: flex;\n justify-content: var(--lottery-selection-group-dialog-footer-justify, flex-end);\n gap: var(--lottery-selection-group-dialog-footer-gap, 18px);\n margin-top: var(--lottery-selection-group-dialog-footer-margin-top, 0);\n}";const z=["ro","en","fr","ar","hr"],B={en:{cancel:"Cancel",confirm:"Confirm"},ro:{cancel:"Anulează",confirm:"Confirmă"},fr:{cancel:"Annuler",confirm:"Confirmer"},ar:{cancel:"إلغاء",confirm:"تأكيد"},hr:{cancel:"Odustani",confirm:"Potvrdi"}},T=(t,e)=>{const i=e;return B[void 0!==i&&z.includes(i)?i:"en"][t]},O=class{constructor(e){t(this,e),this.open=o(this,"open",7),this.close=o(this,"close",7),this.confirm=o(this,"confirm",7),this.cancel=o(this,"cancel",7),this.wasVisible=!1,this.mbSource=void 0,this.clientStyling="",this.clientStylingUrl="",this.visible=void 0,this.dialogTitle="",this.width="520px",this.closable=!0,this.mask=!0,this.maskClosable=!0,this.animationDuration=300,this.fullscreen=!1,this.showFooter=!0,this.showCancelBtn=!0,this.language="en",this.translationUrl=void 0,this.dialogClass=void 0,this.dialogStyle=void 0}handleClientStylingChange(t,e){t!=e&&r(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&n(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&a(this.stylingContainer,`${this.mbSource}.Style`)}componentWillLoad(){this.translationUrl&&(async t=>{if(t)try{const i=await fetch(t);if(!i.ok)throw new Error(`HTTP error! status: ${i.status}`);const o=await i.json();e=o,Object.keys(e).forEach((t=>{for(let i in e[t])B[t][i]=e[t][i]}))}catch(t){console.error("Failed to fetch or parse translations from URL:",t)}var e})(this.translationUrl)}componentWillUpdate(){this.visible&&!this.wasVisible?this.disableBodyScroll():!this.visible&&this.wasVisible&&this.enableBodyScroll(),this.wasVisible=this.visible}disconnectedCallback(){this.enableBodyScroll(),this.stylingSubscription&&this.stylingSubscription.unsubscribe()}disableBodyScroll(){document.body.style.overflow="hidden"}enableBodyScroll(){document.body.style.overflow=""}handleClose(){this.cancel.emit()}handleMaskClick(){this.maskClosable&&this.cancel.emit()}handleConfirm(){this.confirm.emit()}render(){const t=Object.assign({width:"number"==typeof this.width?`${this.width}px`:this.width,"--duration":`${this.animationDuration}ms`},this.dialogStyle||{}),i=["dialog-wrapper",this.visible?"dialog-wrapper-visible":""],o=["mask",this.visible?"mask-enter":"mask-leave"],r=["dialog",this.visible?"dialog-enter":"dialog-leave",this.fullscreen?"fullscreen":"",this.dialogClass].filter(Boolean).join(" ");return e("div",{key:"306683c5190fa6dca57dcf75e52eca575c0215e7",class:i.join(" "),ref:t=>this.stylingContainer=t},e("div",{key:"8be097f3a86fcd9ad4e18c6ac56cafdcf249049b",class:o.join(" "),onClick:this.handleMaskClick.bind(this)}),e("div",{key:"87d2206d3e3d75fe0e0ef8a6afd8de5c20892ae6",part:"dialog",class:r,style:t,role:"dialog","aria-modal":"true","aria-labelledby":"dialog-title"},e("div",{key:"30ca33b925ff2525ead8aae83e72031258367b40",class:"dialog-header"},e("h2",{key:"492c3e864ac1547da58b0a47e4cc8d45470bde54",id:"dialog-title",class:"dialog-title"},this.dialogTitle),this.closable&&e("button",{key:"8ae4b872d18ce82d33292dc794e8a1f714a96ba9",class:"close-btn",onClick:this.handleClose.bind(this)},"x")),e("div",{key:"d661c78b333f78b9dee92e0975f8b136ef5a3071",class:"dialog-content",style:{maxHeight:"calc(100vh - 62px)",overflowY:"auto"}},e("slot",{key:"f32a6f6e4962239e0148e61c4bb70f6b5d3a2c82"})),this.showFooter&&e("div",{key:"40b5e9fd1c9221eb4d6c87d053c5d018f540d8e7",class:"dialog-footer"},e("slot",{key:"91539def47d118a69735ec229e7a6b36fc1db40b",name:"footer"},this.showCancelBtn&&e("button",{key:"f3b3add23f150c660159a906c2ef23b5fbe3b4c5",class:"cancel-btn",onClick:this.handleClose.bind(this)},T("cancel",this.language)),e("button",{key:"5fc33e89b6c55ac9e2162302e128bce0e79c5f89",class:"confirm-btn",onClick:this.handleConfirm.bind(this)},T("confirm",this.language))))))}get el(){return i(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"]}}};O.style=".dialog-wrapper{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;visibility:hidden;opacity:1;z-index:199}.dialog-wrapper-visible{visibility:visible}.mask{position:fixed;inset:0;background-color:rgba(0, 0, 0, 0.5);opacity:0;z-index:1000;transition:opacity var(--duration) linear}.mask-enter{opacity:1}.mask-leave{opacity:0}.dialog{position:relative;background:var(--emw--color-background, #fff);border-radius:12px;box-shadow:0 4px 32px rgba(0, 0, 0, 0.15);opacity:0;transform:scale(0.9);transition:all var(--duration) linear;width:100%;max-width:100vw;overflow:hidden;z-index:1000}.dialog-enter{opacity:1;transform:scale(1)}.dialog-leave{opacity:0}.dialog.fullscreen{width:100vw !important;height:100vh;overflow:auto;max-height:none;border-radius:0;overflow:hidden}.dialog-header{padding:16px 16px 0 16px;display:flex;justify-content:space-between;align-items:center}.dialog-header .dialog-title{margin:0;font-size:1.25rem;font-weight:500;color:var(--emw--color-typography, #000)}.dialog-header .close-btn{background:transparent;border:none;font-size:1.5rem;width:2rem;height:2rem;color:var(--emw--color-gray-150, #6f6f6f);cursor:pointer;border-radius:4px}.dialog-header .close-btn:hover{background:var(--emw--color-gray-50, #f5f5f5);color:var(--emw--color-gray-300, #333)}.dialog-content{padding:24px;font-size:0.95rem;line-height:1.6;color:var(--emw--color-dialog-typography, #000);flex:1;overflow-y:auto;max-height:calc(100vh - 200px)}.dialog.fullscreen .dialog-content{max-height:none}.dialog-footer{padding:0 16px 16px 16px;display:flex;justify-content:center;gap:12px}.dialog-footer .cancel-btn,.dialog-footer .confirm-btn{padding:10px 24px;border-radius:6px;font-size:0.9rem;cursor:pointer;transition:all 0.3s linear}.dialog-footer .cancel-btn{border:var(--emw--button-border, 1px solid rgba(221, 221, 221, 0.8666666667));background-color:var(--emw--color-background, #fff);color:var(--emw--color-typography, #000)}.dialog-footer .cancel-btn:hover{background-color:var(--emw--color-background-tertiary, #ccc)}.dialog-footer .confirm-btn{border:none;color:var(--emw--color-typography-normalized, #ffffff);background:var(--emw--color-primary, #009993)}.dialog-footer .confirm-btn:hover{background:var(--emw--color-primary-variant, #004d4a)}@media screen and (max-width: 480px){.dialog.fullscreen .dialog-content{padding:12px}}.Loading{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.Loading svg{animation:spin 1s linear infinite;transform-origin:center}@keyframes spin{100%{transform:rotate(360deg)}}";export{c as lottery_button,h as lottery_hakuna_collapse,g as lottery_hakuna_ticket,k as lottery_selection,M as lottery_selection_group,O as lottery_tipping_dialog}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,c as e,h as i,g as a}from"./index-1f778cb5.js";function s(t,e){if(t){const i=document.createElement("style");i.innerHTML=e,t.appendChild(i)}}function r(t,e){if(!t||!e)return;const i=new URL(e);fetch(i.href).then((t=>t.text())).then((e=>{const i=document.createElement("style");i.innerHTML=e,t&&t.appendChild(i)})).catch((t=>{console.error("There was an error while trying to load client styling from URL",t)}))}function n(t,e){if(window.emMessageBus){const i=document.createElement("style");window.emMessageBus.subscribe(e,(e=>{i.innerHTML=e,t&&t.appendChild(i)}))}}const o=["ro","en","fr","ar","hr"],l={en:{addTicket:"ADD TICKET",emptyDraw:"Sorry. The Game is not available now.",payNow:"PAY NOW",error:"Error",deleteTicketTitle:"Are You Sure?",deleteTicketMessage:"Are you sure you want to delete this ticket? This process cannot be undone.",cancel:"CANCEL",delete:"DELETE",confirmPaymentTitle:"Confirm Your Payment",back:"BACK",confirm:"CONFIRM",viewTicket:"VIEW TICKET",home:"HOME",ticketSubmittedSuccess:"Payment Successful",ticketSubmittedSuccessMessage:"Thank you for your payment. Payment has been proceeded successfully.",ticketSubmittedError:"Error Processing Payment",ticketSubmittedErrorMessage1:"Please check your wallet, account details and connection and try again.",ticketSubmittedErrorMessage2:"If you need help, please contact us.",fetchingGameConfig:"Fetching game config...",ticket:"Ticket",price:"Price",tickets:"Ticket(s)",total:"Total",deposit:"Deposit",tryAgain:"Try Again"},ro:{error:"Eroare",backButton:"Inapoi",lobbyButton:"Lobby",nextDraw:"Urmatoarea extragere:",buy:"Cumpara bilet",viewLatest:"Ultimile extrageri",submitSuccess:"Submit successfully!",orderSummaryTitle:"Rezumat comanda",orderSummaryTickets:"Bilet",orderSummaryTotal:"Total",orderSummarySubmit:"Trimite",modalLogin:"Please login to submit a ticket",loading:"Se incarca, va rugam asteptati ..."},fr:{error:"Error",backButton:"Back",lobbyButton:"Lobby",nextDraw:"Next draw in: ",buy:"Buy tickets",viewLatest:"View latest results",submitSuccess:"Submit successfully!",orderSummaryTitle:"Order Summary",orderSummaryTickets:"Ticket",orderSummaryTotal:"Total",orderSummarySubmit:"Submit",modalLogin:"Please login to submit a ticket",loading:"Loading, please wait ..."},ar:{error:"خطأ",backButton:"خلف",lobbyButton:"ردهة",nextDraw:"السحب التالي:",buy:"اشتري تذاكر",viewLatest:"عرض أحدث النتائج",submitSuccess:"Submit successfully!",orderSummaryTitle:"ملخص الطلب",orderSummaryTickets:"تذكرة",orderSummaryTotal:"المجموع",orderSummarySubmit:"يُقدِّم",modalLogin:"الرجاء تسجيل الدخول لتقديم تذكرة",loading:"Loading, please wait ..."},hr:{error:"Greška",backButton:"Nazad",lobbyButton:"Lobby",nextDraw:"Sljedeće izvlačenje za: ",buy:"Uplati listić",viewLatest:"Pogledajte najnovije rezultate",submitSuccess:"Submit successfully!",orderSummaryTitle:"Sažetak narudžbe",orderSummaryTickets:"Listić",orderSummaryTotal:"Ukupno",orderSummarySubmit:"Podnijeti",modalLogin:"Molimo prijavite se da uplatite listić",loading:"Učitavanje, molimo pričekajte ..."}},c=(t,e)=>{const i=e;return l[void 0!==i&&o.includes(i)?i:"en"][t]},h=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})),d=class{constructor(i){t(this,i),this.goToTicketList=e(this,"TicketSubmission:jumpToHistoryList",7),this.sessionExpired=e(this,"SessionExpired",7),this.goToHomePage=e(this,"TicketBuying:leaveToHomepage",7),this.goToDepositPage=e(this,"TicketBuying:leaveToDepositPage",7),this.resetAllTicketSelection=e(this,"resetAllTicketSelection",7),this.thousandSeparator=t=>{if(0===t)return"0";if(!t)return"";const e=(t=t.toString()).split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")},this.endpoint=void 0,this.gameId=void 0,this.playerId=void 0,this.sessionId=void 0,this.country="South Africa",this.currency="R",this.language="en",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl="",this.tickets=[],this.mainTickets=[],this.hasErrors=!1,this.totalAmount=0,this.translationData=void 0,this.isFetchingGame=!1,this.dialogInfo={title:"",message:"",icon:"",visible:!1,showLeftBtn:!1,showRightBtn:!1,leftBtnText:"",rightBtnText:"",loading:!1,type:"",leftBtnEvent:()=>{},rightBtnEvent:()=>{}}}handleClientStylingChange(t,e){t!=e&&s(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&r(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&n(this.stylingContainer,`${this.mbSource}.Style`)}watchGameInfoChange(t,e){t&&t!=e&&this.getGameDetails()}async componentWillLoad(){this.gameId&&this.endpoint&&this.getGameDetails()}componentDidLoad(){this.applyStyles()}componentDidUpdate(){this.applyStyles()}applyStyles(){this.stylingContainer&&this.stylingContainer!==this.appliedStylingContainer&&(this.appliedStylingContainer=this.stylingContainer,this.mbSource&&n(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&s(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&r(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){}getGameDetails(){let t=new URL(`${this.endpoint}/games/${this.gameId}`);this.isFetchingGame=!0,fetch(t.href).then((t=>{if(401===t.status&&this.sessionExpired.emit(),t.status>=300)throw this.hasErrors=!0,new Error("There was an error while fetching the data");return t.json()})).then((t=>{var e;this.gameData=t,this.basicStake=this.gameData.rules.stakes.length?Number(this.gameData.rules.stakes[0].value):0,this.basicLine=(null===(e=this.gameData.rules.betTypes)||void 0===e?void 0:e.length)?this.gameData.rules.betTypes[0].boardsAllowed[0]:1,this.basicBetType=this.gameData.rules.betTypes[0],this.createNewTicket()})).catch((t=>{this.hasErrors=!0,console.log("Error",t)})).finally((()=>{this.isFetchingGame=!1}))}isTicketComplete(t){return(t.selectedNumbers?t.selectedNumbers.filter((t=>t&&t.length>0)).length:0)===(t.lineNum||1)}calculateTotalAmount(){const{currency:t}=this.gameData.rules.stakes[0];this.totalAmount=0,this.mainTickets.forEach((t=>{var e;this.isTicketComplete(t)&&(this.totalAmount+=t.drawCount*(t.stake||this.basicStake)*t.multiplierNum*t.lineNum*(null===(e=t.betType)||void 0===e?void 0:e.combinations))})),this.currencyInner=t}gridUpdateHandler(t){let e=this.mainTickets;e=e.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))),Object.assign(Object.assign({},e),{drawCount:1,stake:e.stake||this.basicStake,selectedNumbers:i,multiplierNum:1,multiplier:this.gameData.rules.stakeMultiplierAvailable,lineNum:e.lineNum,betType:e.betType,quickPicks:t.detail.quickPicks,betName:this.basicBetType.name||this.basicBetType.id})}return e})),this.mainTickets=e,this.calculateTotalAmount()}deleteTicketHandler(t){const{ticketId:e}=t.detail;this.dialogInfo={loading:!1,title:c("deleteTicketTitle",this.language),message:c("deleteTicketMessage",this.language),icon:this.getDialogIcon("delete"),visible:!0,showLeftBtn:!0,showRightBtn:!0,leftBtnText:c("cancel",this.language),rightBtnText:c("delete",this.language),leftBtnEvent:()=>this.dialogInfo=Object.assign(Object.assign({},this.dialogInfo),{visible:!1}),rightBtnEvent:this.confirmDeleteTicket.bind(this,e),type:"DELETE_CONFIRM"}}confirmDeleteTicket(t){this.mainTickets=this.mainTickets.filter((e=>e.ticketId!==t)).map(((t,e)=>Object.assign(Object.assign({},t),{ticketId:e+1}))),this.calculateTotalAmount(),this.dialogInfo=Object.assign(Object.assign({},this.dialogInfo),{visible:!1})}saveTicketHandler(t){const{ticketId:e}=t.detail;this.mainTickets=this.mainTickets.map((t=>t.ticketId===e?Object.assign(Object.assign({},t),{isSubmitted:!0}):t))}editTicketHandler(t){const{ticketId:e}=t.detail;this.mainTickets=this.mainTickets.map((t=>t.ticketId===e?Object.assign(Object.assign({},t),{isSubmitted:!1}):t))}getNewTicketData(t){const e=this.basicLine||1;return{uid:h(),gameId:this.gameId,ticketId:t,drawCount:1,multiplierNum:1,stake:this.basicStake,betType:this.basicBetType,lineNum:e,quickPicks:Array.from({length:e},(()=>!1)),betName:"",isSubmitted:!1}}createNewTicket(){this.mainTickets=[...this.mainTickets,this.getNewTicketData(this.mainTickets.length+1)]}buildTicketParam(){let t={playerId:this.playerId.toString(),tickets:[]};return this.mainTickets.forEach((e=>{var i;t.tickets.push({startingDrawId:this.nextDraw,amount:(e.stake*e.drawCount*e.multiplierNum*(e.lineNum||1)*(null===(i=e.betType)||void 0===i?void 0:i.combinations)).toString(),gameId:this.gameId,gameName:this.gameData.name,currency:this.currencyInner,selection:e.selectedNumbers.map(((t,i)=>{var a;return{betType:(null===(a=e.betType)||void 0===a?void 0:a.id)||this.gameData.rules.defaultBetType,stake:e.stake,selections:t,quickPick:e.quickPicks[i],betName:e.betName}})),multiplier:e.multiplier,multiplierNum:e.multiplierNum,drawCount:e.drawCount,quickPick:this.gameData.rules.quickPickAvailable})})),t}getDialogIcon(t){switch(t){case"confirm":return i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"45",height:"45",viewBox:"0 0 45 45",fill:"none"},i("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M22.5 5.625C13.1802 5.625 5.625 13.1802 5.625 22.5C5.625 31.8198 13.1802 39.375 22.5 39.375C31.8198 39.375 39.375 31.8198 39.375 22.5C39.375 13.1802 31.8198 5.625 22.5 5.625ZM1.875 22.5C1.875 11.1091 11.1091 1.875 22.5 1.875C33.8909 1.875 43.125 11.1091 43.125 22.5C43.125 33.8909 33.8909 43.125 22.5 43.125C11.1091 43.125 1.875 33.8909 1.875 22.5ZM22.5 13.125C23.5355 13.125 24.375 13.9645 24.375 15V22.5C24.375 23.5355 23.5355 24.375 22.5 24.375C21.4645 24.375 20.625 23.5355 20.625 22.5V15C20.625 13.9645 21.4645 13.125 22.5 13.125ZM20.625 30C20.625 28.9645 21.4645 28.125 22.5 28.125H22.5188C23.5543 28.125 24.3938 28.9645 24.3938 30C24.3938 31.0355 23.5543 31.875 22.5188 31.875H22.5C21.4645 31.875 20.625 31.0355 20.625 30Z",fill:"#B4A5A5"}));case"delete":return i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"45",height:"45",viewBox:"0 0 45 45",fill:"none"},i("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20.9277 1.875H24.0723C25.0607 1.87497 25.9134 1.87494 26.6157 1.93232C27.3569 1.99289 28.0942 2.1266 28.8037 2.48809C29.8621 3.02738 30.7226 3.8879 31.2619 4.94631C31.6234 5.65577 31.7571 6.39305 31.8177 7.13433C31.8691 7.76391 31.8744 8.51431 31.8749 9.375H39.375C40.4105 9.375 41.25 10.2145 41.25 11.25C41.25 12.2855 40.4105 13.125 39.375 13.125H37.5V32.3275C37.5 33.8368 37.5 35.0824 37.4171 36.0972C37.331 37.1511 37.1462 38.1199 36.6825 39.0299C35.9635 40.4411 34.8161 41.5885 33.4049 42.3076C32.4949 42.7712 31.5261 42.956 30.4722 43.0421C29.4574 43.125 28.2118 43.125 26.7025 43.125H18.2975C16.7882 43.125 15.5426 43.125 14.5278 43.0421C13.4739 42.956 12.5051 42.7712 11.5951 42.3076C10.1839 41.5885 9.0365 40.4411 8.31745 39.0299C7.85378 38.1199 7.66897 37.1511 7.58286 36.0972C7.49996 35.0824 7.49998 33.8368 7.5 32.3274L7.5 13.125H5.625C4.58947 13.125 3.75 12.2855 3.75 11.25C3.75 10.2145 4.58947 9.375 5.625 9.375H13.1251C13.1256 8.51431 13.1309 7.76391 13.1823 7.13433C13.2429 6.39305 13.3766 5.65577 13.7381 4.94631C14.2774 3.8879 15.1379 3.02738 16.1963 2.48809C16.9058 2.1266 17.6431 1.99289 18.3843 1.93232C19.0866 1.87494 19.9393 1.87497 20.9277 1.875ZM11.25 13.125V32.25C11.25 33.8561 11.2515 34.9479 11.3204 35.7918C11.3876 36.6138 11.5093 37.0342 11.6587 37.3275C12.0183 38.0331 12.5919 38.6068 13.2975 38.9663C13.5908 39.1157 14.0112 39.2374 14.8332 39.3046C15.6771 39.3735 16.7689 39.375 18.375 39.375H26.625C28.2311 39.375 29.3229 39.3735 30.1668 39.3046C30.9888 39.2374 31.4092 39.1157 31.7025 38.9663C32.4081 38.6068 32.9818 38.0331 33.3413 37.3275C33.4907 37.0342 33.6124 36.6138 33.6796 35.7918C33.7485 34.9479 33.75 33.8561 33.75 32.25V13.125H11.25ZM28.1249 9.375H16.8751C16.876 8.50293 16.8817 7.90685 16.9199 7.4397C16.9615 6.93033 17.0321 6.74148 17.0794 6.64877C17.2591 6.29597 17.546 6.00913 17.8988 5.82937C17.9915 5.78213 18.1803 5.71148 18.6897 5.66987C19.2209 5.62646 19.919 5.625 21 5.625H24C25.081 5.625 25.7791 5.62646 26.3103 5.66987C26.8197 5.71148 27.0085 5.78213 27.1012 5.82937C27.454 6.00913 27.7409 6.29597 27.9206 6.64877C27.9679 6.74148 28.0385 6.93033 28.0801 7.4397C28.1183 7.90685 28.124 8.50293 28.1249 9.375ZM18.75 19.6875C19.7855 19.6875 20.625 20.527 20.625 21.5625V30.9375C20.625 31.973 19.7855 32.8125 18.75 32.8125C17.7145 32.8125 16.875 31.973 16.875 30.9375V21.5625C16.875 20.527 17.7145 19.6875 18.75 19.6875ZM26.25 19.6875C27.2855 19.6875 28.125 20.527 28.125 21.5625V30.9375C28.125 31.973 27.2855 32.8125 26.25 32.8125C25.2145 32.8125 24.375 31.973 24.375 30.9375V21.5625C24.375 20.527 25.2145 19.6875 26.25 19.6875Z",fill:"#C52217"}));case"success":return i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"45",height:"45",viewBox:"0 0 45 45",fill:"none"},i("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M22.5 5.625C13.1802 5.625 5.625 13.1802 5.625 22.5C5.625 31.8198 13.1802 39.375 22.5 39.375C31.8198 39.375 39.375 31.8198 39.375 22.5C39.375 13.1802 31.8198 5.625 22.5 5.625ZM1.875 22.5C1.875 11.1091 11.1091 1.875 22.5 1.875C33.8909 1.875 43.125 11.1091 43.125 22.5C43.125 33.8909 33.8909 43.125 22.5 43.125C11.1091 43.125 1.875 33.8909 1.875 22.5ZM32.2633 15.5492C32.9956 16.2814 32.9956 17.4686 32.2633 18.2008L21.0133 29.4508C20.2811 30.1831 19.0939 30.1831 18.3617 29.4508L12.7367 23.8258C12.0044 23.0936 12.0044 21.9064 12.7367 21.1742C13.4689 20.4419 14.6561 20.4419 15.3883 21.1742L19.6875 25.4734L29.6117 15.5492C30.3439 14.8169 31.5311 14.8169 32.2633 15.5492Z",fill:"#23AC4D"}));case"error":return i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"45",height:"45",viewBox:"0 0 45 45",fill:"none"},i("path",{d:"M39.375 22.5C39.375 13.1802 31.8197 5.625 22.5 5.625C13.1802 5.625 5.625 13.1802 5.625 22.5C5.625 31.8197 13.1802 39.375 22.5 39.375C31.8197 39.375 39.375 31.8197 39.375 22.5ZM26.7993 15.5493C27.5315 14.8171 28.7185 14.8171 29.4507 15.5493C30.1829 16.2815 30.1829 17.4685 29.4507 18.2007L25.1514 22.5L29.4507 26.7993C30.1829 27.5315 30.1829 28.7185 29.4507 29.4507C28.7185 30.1829 27.5315 30.1829 26.7993 29.4507L22.5 25.1514L18.2007 29.4507C17.4685 30.1829 16.2815 30.1829 15.5493 29.4507C14.8171 28.7185 14.8171 27.5315 15.5493 26.7993L19.8486 22.5L15.5493 18.2007C14.8171 17.4685 14.8171 16.2815 15.5493 15.5493C16.2815 14.8171 17.4685 14.8171 18.2007 15.5493L22.5 19.8486L26.7993 15.5493ZM43.125 22.5C43.125 33.8908 33.8908 43.125 22.5 43.125C11.1091 43.125 1.875 33.8908 1.875 22.5C1.875 11.1091 11.1091 1.875 22.5 1.875C33.8908 1.875 43.125 11.1091 43.125 22.5Z",fill:"#C52217"}))}}handleConfirmSubmit(){this.dialogInfo={loading:!1,title:c("confirmPaymentTitle",this.language),message:"",icon:this.getDialogIcon("confirm"),visible:!0,showLeftBtn:!0,showRightBtn:!0,leftBtnText:c("back",this.language),rightBtnText:c("confirm",this.language),leftBtnEvent:this.handleLeaveToHomepage.bind(this),rightBtnEvent:this.handleSubmitTickets.bind(this),type:"SUBMIT_CONFIRM"}}handleSubmitTickets(){let t=new URL(`${this.endpoint}/tickets`);const e=this.buildTicketParam();if(e){const i=h();let a={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this.sessionId}`,"X-Idempotency-Key":i},body:JSON.stringify(e)};this.dialogInfo=Object.assign(Object.assign({},this.dialogInfo),{loading:!0}),fetch(t.href,a).then((t=>{if(401===t.status)throw this.sessionExpired.emit(),new Error("401");if(t.status>300)throw new Error(t.statusText);return t.json()})).then((()=>{this.mainTickets=[this.getNewTicketData(1)],this.calculateTotalAmount(),this.dialogInfo=Object.assign(Object.assign({},this.dialogInfo),{loading:!1,visible:!0,title:c("ticketSubmittedSuccess",this.language),message:c("ticketSubmittedSuccessMessage",this.language),icon:this.getDialogIcon("success"),type:"SUCCESS",showLeftBtn:!0,showRightBtn:!0,leftBtnText:c("viewTicket",this.language),rightBtnText:c("home",this.language),leftBtnEvent:this.handleGoToTicketList.bind(this),rightBtnEvent:this.handleLeaveToHomepage.bind(this)})})).catch((t=>{console.log("Error ",t),this.dialogInfo=Object.assign(Object.assign({},this.dialogInfo),"401"!==t.message?{loading:!1,visible:!0,title:c("ticketSubmittedError",this.language),message:c("ticketSubmittedErrorMessage",this.language),icon:this.getDialogIcon("error"),type:"ERROR",showLeftBtn:!0,showRightBtn:!0,leftBtnText:c("deposit",this.language),rightBtnText:c("tryAgain",this.language),leftBtnEvent:this.handleGoToDepositPage.bind(this),rightBtnEvent:this.handleSubmitTickets.bind(this)}:{visible:!1,loading:!1})}))}else console.log("No valid ticket parameters to submit")}handleGoToTicketList(){this.goToTicketList.emit()}handleLeaveToHomepage(){this.goToHomePage.emit()}handleGoToDepositPage(){this.goToDepositPage.emit()}getSkeletonEle(t,e){return i("div",{class:"hakuna-skeleton",style:Object.assign(Object.assign({},t),{display:"inline"===e?"inline-flex":"flex"})})}renderSkeleton(){return i("div",{class:"hakuna-ticket-buy-skeleton"},i("div",{class:"hakuna-ticket-buy-skeleton-ticket"},this.getSkeletonEle({width:"123px",height:"18px",borderRadius:"8px"},"block"),this.getSkeletonEle({width:"181px",height:"12px",borderRadius:"8px",marginTop:"12px"},"block"),this.getSkeletonEle({width:"296px",height:"194px",borderRadius:"8px",marginTop:"20px"},"block"),this.getSkeletonEle({width:"20px",height:"20px",borderRadius:"50%",marginTop:"25px"},"inline"),this.getSkeletonEle({width:"80px",height:"30px",borderRadius:"8px",marginTop:"25px",marginLeft:"108px"},"inline"),this.getSkeletonEle({width:"80px",height:"30px",borderRadius:"8px",marginTop:"25px",marginLeft:"8px"},"inline")),i("div",{class:"hakuna-ticket-buy-skeleton-ticketBtn"},this.getSkeletonEle({width:"102px",height:"30px",borderRadius:"8px",marginTop:"16px"},"block")),i("div",{class:"hakuna-ticket-buy-skeleton-pay"},i("div",{class:"hakuna-ticket-buy-skeleton-pay-left"},this.getSkeletonEle({width:"107px",height:"12px",borderRadius:"8px"},"block"),this.getSkeletonEle({width:"107px",height:"12px",borderRadius:"8px",marginTop:"10px"},"block")),i("div",{class:"hakuna-ticket-buy-skeleton-pay-right"},this.getSkeletonEle({width:"80px",height:"30px",borderRadius:"8px"},"block"))))}render(){var t,e;if(this.isFetchingGame)return this.renderSkeleton();if(this.hasErrors)return i("div",{class:"error-container"},i("p",{class:"error-text"},c("error",this.language)||"Error loading data"));{const{rules:a}=this.gameData,{quickPickAvailable:s}=a,{highNumber:r,lowNumber:n,maxinumAllowed:o,minimumAllowed:l}=a.boards[0],h=a.betTypes[0].selectionRules.map((t=>t.selectionCount)),d=this.mainTickets.length>0&&this.mainTickets.every((t=>t.isSubmitted)),u=null===(e=null===(t=this.gameData)||void 0===t?void 0:t.currentDraw)||void 0===e?void 0:e.date;return i("div",{class:"hakuna-ticket-buy",ref:t=>this.stylingContainer=t},u?i("div",{class:"hakuna-ticket-buy-wrapper"},i("div",{class:"hakuna-ticket-buy-list"},this.mainTickets.map((t=>i("lottery-hakuna-ticket",{key:t.uid,"ticket-id":t.ticketId,allowQuickPick:s,gameName:this.country||this.gameData.name,"is-submitted":t.isSubmitted,"high-number":r,"low-number":n,"maximum-allowed":o,"minimum-allowed":l,"number-range":h,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource,"disable-delete":1===this.mainTickets.length})))),i("div",{class:"hakuna-ticket-buy-operation"},i("lottery-button",{variant:"outline",color:"var(--emw-hakuna-color-primary, #C52217)",size:"small",onClick:this.createNewTicket.bind(this)},i("span",{slot:"icon-left"},i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none"},i("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.00004 2.33337C7.32221 2.33337 7.58337 2.59454 7.58337 2.91671V6.41671H11.0834C11.4055 6.41671 11.6667 6.67787 11.6667 7.00004C11.6667 7.32221 11.4055 7.58337 11.0834 7.58337H7.58337V11.0834C7.58337 11.4055 7.32221 11.6667 7.00004 11.6667C6.67787 11.6667 6.41671 11.4055 6.41671 11.0834V7.58337H2.91671C2.59454 7.58337 2.33337 7.32221 2.33337 7.00004C2.33337 6.67787 2.59454 6.41671 2.91671 6.41671H6.41671V2.91671C6.41671 2.59454 6.67787 2.33337 7.00004 2.33337Z",fill:"white"}))),i("span",{style:{color:"#fff"}},c("addTicket",this.language)))),i("lottery-tipping-dialog",{closable:!1,visible:this.dialogInfo.visible,width:"335px",mask:!0,maskClosable:!0,class:"hakuna-dialog",onCancel:()=>this.dialogInfo=Object.assign(Object.assign({},this.dialogInfo),{visible:!1})},i("div",{class:"dialog-content"},i("div",{class:"dialog-content-icon"},this.dialogInfo.icon),i("div",{class:"dialog-content-title"},this.dialogInfo.title),i("div",{class:"dialog-content-message"},"SUBMIT_CONFIRM"===this.dialogInfo.type?i("div",{class:"confirm-submit-message"},i("div",{class:"confirm-submit-message-item"},i("div",{class:"title"},c("tickets",this.language),":"),i("div",{class:"value"},this.mainTickets.length)),i("div",{class:"confirm-submit-message-item"},i("div",{class:"title"},c("total",this.language),": "),i("div",{class:"value"},`${this.currency} ${this.thousandSeparator(this.totalAmount)}`))):"ERROR"===this.dialogInfo.type?i("div",null,i("div",{style:{marginBottom:"10px"}},c("ticketSubmittedErrorMessage1",this.language)),i("div",null,c("ticketSubmittedErrorMessage2",this.language))):i("span",null,this.dialogInfo.message))),i("div",{slot:"footer",class:"dialog-content-footer"},i("lottery-button",{variant:"outline",color:"var(--emw-hakuna-color-primary, #C52217)",onClick:this.dialogInfo.leftBtnEvent},i("span",{style:{color:"#fff"}},this.dialogInfo.leftBtnText," ")),i("lottery-button",{variant:"primary",color:"var(--emw-hakuna-color-primary, #C52217)",onClick:this.dialogInfo.rightBtnEvent,text:this.dialogInfo.rightBtnText,loading:this.dialogInfo.loading})))):i("div",{class:"empty-draw"},c("emptyDraw",this.language)),i("div",{class:"hakuna-ticket-buy-pay"},i("div",{class:"hakuna-ticket-buy-pay-info"},i("div",{class:"hakuna-ticket-buy-pay-info-item"},c("ticket",this.language),": ",this.mainTickets.length),i("div",{class:"hakuna-ticket-buy-pay-info-item"},c("price",this.language),": ",`${this.currency} ${this.thousandSeparator(this.totalAmount)}`)),i("div",{class:"hakuna-ticket-buy-pay-button"},i("lottery-button",{variant:"primary",color:"var(--emw-hakuna-color-primary, #C52217)",text:c("payNow",this.language),disabled:!d,onClick:this.handleConfirmSubmit.bind(this)}))))}}static get assetsDirs(){return["../static"]}get element(){return a(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"],endpoint:["watchGameInfoChange"],gameId:["watchGameInfoChange"]}}};d.style=":host{display:block;height:100%;--emw--color-background-secondary:var(--emw-hakuna-bg-secondary, #120505);--emw--color-primary:var(--emw-hakuna-color-primary, #c52217);--emw--color-background:var(--emw-hakuna-bg-primary, #2c2525);--emw--color-background-tertiary:var(--emw-hakuna-bg-tertiary, #4f2421);--lottery-button-outline-active-bg:var(--emw-hakuna-bg-tertiary, #4f2421);--lottery-button-outline-active-bg:var(--emw-hakuna-bg-tertiary, #4f2421);scrollbar-width:thin;scrollbar-color:var(--emw-hakuna-scroll-scrollbar-thumb-background, #120505) var(--emw-hakuna-scroll-scrollbar-track-background, transparent);}:host::-webkit-scrollbar{width:var(--emw-hakuna-scroll-scrollbar-width, 2px)}:host::-webkit-scrollbar-track{background:var(--emw-hakuna-scroll-scrollbar-track-background, transparent)}:host::-webkit-scrollbar-thumb{background:var(--emw-hakuna-scroll-scrollbar-thumb-background, #120505);border-radius:var(--emw-hakuna-scroll-scrollbar-thumb-border-radius, 2px)}.error-container{display:flex;justify-content:center;align-items:center;padding:20px;min-height:100px;background-color:var(--emw--color-background-secondary, #f5f5f5);border-radius:4px;margin:20px 0}.error-text{font-size:16px;color:var(--emw--color-error, #ff3d00);font-weight:500;text-align:center}.hakuna-ticket-buy{display:flex;justify-content:center;flex-direction:column;height:100%;overflow:hidden}.hakuna-ticket-buy .empty-draw{display:flex;color:var(--emw-hakuna-text-primary, #ffffff);width:335px;padding:28px 20px;justify-content:center;border:1px solid transparent;border-radius:12px;background-origin:border-box;background-clip:padding-box, border-box;background-image:linear-gradient(var(--emw-hakuna-bg-secondary, #120505), var(--emw-hakuna-bg-secondary, #120505)), linear-gradient(to top left, var(--emw-hakuna-color-primary, #c52217) 32%, var(--emw-hakuna-bg-primary, #2c2525) 68%)}.hakuna-ticket-buy-skeleton{display:flex;flex-direction:column;align-items:center;margin:0 auto}.hakuna-ticket-buy-skeleton-ticket{box-sizing:border-box;padding:20px;min-width:336px;max-width:414px;background-color:var(--emw-hakuna-ticket-skeleton-bg, #2d2d2d)}.hakuna-ticket-buy-skeleton-pay{position:fixed;bottom:0;left:0;right:0;padding:16px 24px;background-color:var(--emw-hakuna-ticket-skeleton-bg, #2d2d2d);display:flex;align-items:center;justify-content:space-between}.hakuna-ticket-buy-wrapper{width:100%;display:flex;flex-direction:column;align-items:center;height:100%;overflow-y:auto;padding-bottom:90px;box-sizing:border-box}.hakuna-ticket-buy-list{display:flex;flex-direction:column;gap:12px;min-width:336px;max-width:414px;width:100%}.hakuna-ticket-buy-operation{display:flex;justify-content:center}.hakuna-ticket-buy-pay{position:fixed;bottom:0;left:0;right:0;padding:16px 24px;display:flex;align-items:center;justify-content:space-between;background:var(--emw-hakuna-bg-secondary, #120505)}.hakuna-ticket-buy-pay-info{display:flex;flex-direction:column;gap:10px}.hakuna-ticket-buy-pay-info-item{color:var(--emw-hakuna-text-secondary, #b4a5a5);font-size:12px;font-weight:600}.dialog-content{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px 0}.dialog-content-icon{margin-bottom:16px;display:flex;justify-content:center;align-items:center}.dialog-content-icon svg{display:block}.dialog-content-title{color:var(--emw-hakuna-text-primary, #ffffff);font-size:16px;font-weight:700;text-transform:uppercase}.dialog-content-message{color:var(--emw-hakuna-text-secondary, #b4a5a5);font-size:14px;font-weight:500;width:100%;display:flex;justify-content:center}.dialog-content-footer{display:flex;justify-content:center;gap:16px;width:100%}.confirm-submit-message{width:200px;display:flex;flex-direction:column;gap:2px;justify-content:center}.confirm-submit-message-item{width:100%;display:flex;justify-content:space-between;color:var(--emw-hakuna-text-secondary, #b4a5a5);font-size:14px;font-weight:500}.hakuna-dialog::part(dialog){border:1px solid transparent;border-radius:12px;background-origin:border-box;background-clip:padding-box, border-box;background-image:linear-gradient(var(--emw-hakuna-bg-secondary, #120505), var(--emw-hakuna-bg-secondary, #120505)), linear-gradient(to top left, var(--emw-hakuna-color-primary, #c52217) 32%, var(--emw-hakuna-bg-primary, #2c2525) 68%)}.hakuna-skeleton{animation:skeleton-loading 1s linear infinite alternate}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, #414141)}100%{background-color:var(--emw-skeleton-secondary-color, #2f2929)}}";export{d as L,r as a,n as b,s}
|
|
@@ -71,6 +71,7 @@ export declare class LotteryHakunaTicketBuy {
|
|
|
71
71
|
goToTicketList: EventEmitter<void>;
|
|
72
72
|
sessionExpired: EventEmitter<void>;
|
|
73
73
|
goToHomePage: EventEmitter<void>;
|
|
74
|
+
goToDepositPage: EventEmitter<void>;
|
|
74
75
|
resetAllTicketSelection: EventEmitter<void>;
|
|
75
76
|
private stylingContainer;
|
|
76
77
|
private appliedStylingContainer;
|
|
@@ -106,6 +107,7 @@ export declare class LotteryHakunaTicketBuy {
|
|
|
106
107
|
handleSubmitTickets(): void;
|
|
107
108
|
handleGoToTicketList(): void;
|
|
108
109
|
handleLeaveToHomepage(): void;
|
|
110
|
+
handleGoToDepositPage(): void;
|
|
109
111
|
thousandSeparator: (value: number | string) => string;
|
|
110
112
|
getSkeletonEle(style: {
|
|
111
113
|
width?: string;
|
|
@@ -62,6 +62,7 @@ declare global {
|
|
|
62
62
|
"TicketSubmission:jumpToHistoryList": void;
|
|
63
63
|
"SessionExpired": void;
|
|
64
64
|
"TicketBuying:leaveToHomepage": void;
|
|
65
|
+
"TicketBuying:leaveToDepositPage": void;
|
|
65
66
|
"resetAllTicketSelection": void;
|
|
66
67
|
}
|
|
67
68
|
interface HTMLLotteryHakunaTicketBuyElement extends Components.LotteryHakunaTicketBuy, HTMLStencilElement {
|
|
@@ -118,6 +119,7 @@ declare namespace LocalJSX {
|
|
|
118
119
|
"mbSource"?: string;
|
|
119
120
|
"onResetAllTicketSelection"?: (event: LotteryHakunaTicketBuyCustomEvent<void>) => void;
|
|
120
121
|
"onSessionExpired"?: (event: LotteryHakunaTicketBuyCustomEvent<void>) => void;
|
|
122
|
+
"onTicketBuying:leaveToDepositPage"?: (event: LotteryHakunaTicketBuyCustomEvent<void>) => void;
|
|
121
123
|
"onTicketBuying:leaveToHomepage"?: (event: LotteryHakunaTicketBuyCustomEvent<void>) => void;
|
|
122
124
|
"onTicketSubmission:jumpToHistoryList"?: (event: LotteryHakunaTicketBuyCustomEvent<void>) => void;
|
|
123
125
|
/**
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,g as a}from"./index-1f778cb5.js";function s(t,e){if(t){const i=document.createElement("style");i.innerHTML=e,t.appendChild(i)}}function r(t,e){if(!t||!e)return;const i=new URL(e);fetch(i.href).then((t=>t.text())).then((e=>{const i=document.createElement("style");i.innerHTML=e,t&&t.appendChild(i)})).catch((t=>{console.error("There was an error while trying to load client styling from URL",t)}))}function n(t,e){if(window.emMessageBus){const i=document.createElement("style");window.emMessageBus.subscribe(e,(e=>{i.innerHTML=e,t&&t.appendChild(i)}))}}const o=["ro","en","fr","ar","hr"],l={en:{addTicket:"ADD TICKET",emptyDraw:"Sorry. The Game is not available now.",payNow:"PAY NOW",error:"Error",deleteTicketTitle:"Are You Sure?",deleteTicketMessage:"Are you sure you want to delete this ticket? This process cannot be undone.",cancel:"CANCEL",delete:"DELETE",confirmPaymentTitle:"Confirm Your Payment",back:"BACK",confirm:"CONFIRM",viewTicket:"VIEW TICKET",home:"HOME",ticketSubmittedSuccess:"Payment Successful",ticketSubmittedSuccessMessage:"Thank you for your payment. Payment has been proceeded successfully.",ticketSubmittedError:"Error Processing Payment",ticketSubmittedErrorMessage:"Please check your wallet, account details and connection and try again. If you need help, please contact us.",fetchingGameConfig:"Fetching game config...",ticket:"Ticket",price:"Price",tickets:"Ticket(s)",total:"Total"},ro:{error:"Eroare",backButton:"Inapoi",lobbyButton:"Lobby",nextDraw:"Urmatoarea extragere:",buy:"Cumpara bilet",viewLatest:"Ultimile extrageri",submitSuccess:"Submit successfully!",orderSummaryTitle:"Rezumat comanda",orderSummaryTickets:"Bilet",orderSummaryTotal:"Total",orderSummarySubmit:"Trimite",modalLogin:"Please login to submit a ticket",loading:"Se incarca, va rugam asteptati ..."},fr:{error:"Error",backButton:"Back",lobbyButton:"Lobby",nextDraw:"Next draw in: ",buy:"Buy tickets",viewLatest:"View latest results",submitSuccess:"Submit successfully!",orderSummaryTitle:"Order Summary",orderSummaryTickets:"Ticket",orderSummaryTotal:"Total",orderSummarySubmit:"Submit",modalLogin:"Please login to submit a ticket",loading:"Loading, please wait ..."},ar:{error:"خطأ",backButton:"خلف",lobbyButton:"ردهة",nextDraw:"السحب التالي:",buy:"اشتري تذاكر",viewLatest:"عرض أحدث النتائج",submitSuccess:"Submit successfully!",orderSummaryTitle:"ملخص الطلب",orderSummaryTickets:"تذكرة",orderSummaryTotal:"المجموع",orderSummarySubmit:"يُقدِّم",modalLogin:"الرجاء تسجيل الدخول لتقديم تذكرة",loading:"Loading, please wait ..."},hr:{error:"Greška",backButton:"Nazad",lobbyButton:"Lobby",nextDraw:"Sljedeće izvlačenje za: ",buy:"Uplati listić",viewLatest:"Pogledajte najnovije rezultate",submitSuccess:"Submit successfully!",orderSummaryTitle:"Sažetak narudžbe",orderSummaryTickets:"Listić",orderSummaryTotal:"Ukupno",orderSummarySubmit:"Podnijeti",modalLogin:"Molimo prijavite se da uplatite listić",loading:"Učitavanje, molimo pričekajte ..."}},c=(t,e)=>{const i=e;return l[void 0!==i&&o.includes(i)?i:"en"][t]},h=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var e=16*Math.random()|0;return("x"==t?e:3&e|8).toString(16)})),d=class{constructor(i){t(this,i),this.goToTicketList=e(this,"TicketSubmission:jumpToHistoryList",7),this.sessionExpired=e(this,"SessionExpired",7),this.goToHomePage=e(this,"TicketBuying:leaveToHomepage",7),this.resetAllTicketSelection=e(this,"resetAllTicketSelection",7),this.thousandSeparator=t=>{if(0===t)return"0";if(!t)return"";const e=(t=t.toString()).split(".");return e[0]=e[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e.join(".")},this.endpoint=void 0,this.gameId=void 0,this.playerId=void 0,this.sessionId=void 0,this.country="South Africa",this.currency="R",this.language="en",this.clientStyling="",this.clientStylingUrl="",this.mbSource=void 0,this.translationUrl="",this.tickets=[],this.mainTickets=[],this.hasErrors=!1,this.totalAmount=0,this.translationData=void 0,this.isFetchingGame=!1,this.dialogInfo={title:"",message:"",icon:"",visible:!1,showLeftBtn:!1,showRightBtn:!1,leftBtnText:"",rightBtnText:"",loading:!1,type:"",leftBtnEvent:()=>{},rightBtnEvent:()=>{}}}handleClientStylingChange(t,e){t!=e&&s(this.stylingContainer,this.clientStyling)}handleClientStylingUrlChange(t,e){t!=e&&r(this.stylingContainer,this.clientStylingUrl)}handleMbSourceChange(t,e){t!=e&&n(this.stylingContainer,`${this.mbSource}.Style`)}watchGameInfoChange(t,e){t&&t!=e&&this.getGameDetails()}async componentWillLoad(){this.gameId&&this.endpoint&&this.getGameDetails()}componentDidLoad(){this.applyStyles()}componentDidUpdate(){this.applyStyles()}applyStyles(){this.stylingContainer&&this.stylingContainer!==this.appliedStylingContainer&&(this.appliedStylingContainer=this.stylingContainer,this.mbSource&&n(this.stylingContainer,`${this.mbSource}.Style`),this.clientStyling&&s(this.stylingContainer,this.clientStyling),this.clientStylingUrl&&r(this.stylingContainer,this.clientStylingUrl))}disconnectedCallback(){}getGameDetails(){let t=new URL(`${this.endpoint}/games/${this.gameId}`);this.isFetchingGame=!0,fetch(t.href).then((t=>{if(401===t.status&&this.sessionExpired.emit(),t.status>=300)throw this.hasErrors=!0,new Error("There was an error while fetching the data");return t.json()})).then((t=>{var e;this.gameData=t,this.basicStake=this.gameData.rules.stakes.length?Number(this.gameData.rules.stakes[0].value):0,this.basicLine=(null===(e=this.gameData.rules.betTypes)||void 0===e?void 0:e.length)?this.gameData.rules.betTypes[0].boardsAllowed[0]:1,this.basicBetType=this.gameData.rules.betTypes[0],this.createNewTicket()})).catch((t=>{this.hasErrors=!0,console.log("Error",t)})).finally((()=>{this.isFetchingGame=!1}))}isTicketComplete(t){return(t.selectedNumbers?t.selectedNumbers.filter((t=>t&&t.length>0)).length:0)===(t.lineNum||1)}calculateTotalAmount(){const{currency:t}=this.gameData.rules.stakes[0];this.totalAmount=0,this.mainTickets.forEach((t=>{var e;this.isTicketComplete(t)&&(this.totalAmount+=t.drawCount*(t.stake||this.basicStake)*t.multiplierNum*t.lineNum*(null===(e=t.betType)||void 0===e?void 0:e.combinations))})),this.currencyInner=t}gridUpdateHandler(t){let e=this.mainTickets;e=e.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))),Object.assign(Object.assign({},e),{drawCount:1,stake:e.stake||this.basicStake,selectedNumbers:i,multiplierNum:1,multiplier:this.gameData.rules.stakeMultiplierAvailable,lineNum:e.lineNum,betType:e.betType,quickPicks:t.detail.quickPicks,betName:this.basicBetType.name||this.basicBetType.id})}return e})),this.mainTickets=e,this.calculateTotalAmount()}deleteTicketHandler(t){const{ticketId:e}=t.detail;this.dialogInfo={loading:!1,title:c("deleteTicketTitle",this.language),message:c("deleteTicketMessage",this.language),icon:this.getDialogIcon("delete"),visible:!0,showLeftBtn:!0,showRightBtn:!0,leftBtnText:c("cancel",this.language),rightBtnText:c("delete",this.language),leftBtnEvent:()=>this.dialogInfo=Object.assign(Object.assign({},this.dialogInfo),{visible:!1}),rightBtnEvent:this.confirmDeleteTicket.bind(this,e),type:"DELETE_CONFIRM"}}confirmDeleteTicket(t){this.mainTickets=this.mainTickets.filter((e=>e.ticketId!==t)).map(((t,e)=>Object.assign(Object.assign({},t),{ticketId:e+1}))),this.calculateTotalAmount(),this.dialogInfo=Object.assign(Object.assign({},this.dialogInfo),{visible:!1})}saveTicketHandler(t){const{ticketId:e}=t.detail;this.mainTickets=this.mainTickets.map((t=>t.ticketId===e?Object.assign(Object.assign({},t),{isSubmitted:!0}):t))}editTicketHandler(t){const{ticketId:e}=t.detail;this.mainTickets=this.mainTickets.map((t=>t.ticketId===e?Object.assign(Object.assign({},t),{isSubmitted:!1}):t))}getNewTicketData(t){const e=this.basicLine||1;return{uid:h(),gameId:this.gameId,ticketId:t,drawCount:1,multiplierNum:1,stake:this.basicStake,betType:this.basicBetType,lineNum:e,quickPicks:Array.from({length:e},(()=>!1)),betName:"",isSubmitted:!1}}createNewTicket(){this.mainTickets=[...this.mainTickets,this.getNewTicketData(this.mainTickets.length+1)]}buildTicketParam(){let t={playerId:this.playerId.toString(),tickets:[]};return this.mainTickets.forEach((e=>{var i;t.tickets.push({startingDrawId:this.nextDraw,amount:(e.stake*e.drawCount*e.multiplierNum*(e.lineNum||1)*(null===(i=e.betType)||void 0===i?void 0:i.combinations)).toString(),gameId:this.gameId,gameName:this.gameData.name,currency:this.currencyInner,selection:e.selectedNumbers.map(((t,i)=>{var a;return{betType:(null===(a=e.betType)||void 0===a?void 0:a.id)||this.gameData.rules.defaultBetType,stake:e.stake,selections:t,quickPick:e.quickPicks[i],betName:e.betName}})),multiplier:e.multiplier,multiplierNum:e.multiplierNum,drawCount:e.drawCount,quickPick:this.gameData.rules.quickPickAvailable})})),t}getDialogIcon(t){switch(t){case"confirm":return i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"45",height:"45",viewBox:"0 0 45 45",fill:"none"},i("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M22.5 5.625C13.1802 5.625 5.625 13.1802 5.625 22.5C5.625 31.8198 13.1802 39.375 22.5 39.375C31.8198 39.375 39.375 31.8198 39.375 22.5C39.375 13.1802 31.8198 5.625 22.5 5.625ZM1.875 22.5C1.875 11.1091 11.1091 1.875 22.5 1.875C33.8909 1.875 43.125 11.1091 43.125 22.5C43.125 33.8909 33.8909 43.125 22.5 43.125C11.1091 43.125 1.875 33.8909 1.875 22.5ZM22.5 13.125C23.5355 13.125 24.375 13.9645 24.375 15V22.5C24.375 23.5355 23.5355 24.375 22.5 24.375C21.4645 24.375 20.625 23.5355 20.625 22.5V15C20.625 13.9645 21.4645 13.125 22.5 13.125ZM20.625 30C20.625 28.9645 21.4645 28.125 22.5 28.125H22.5188C23.5543 28.125 24.3938 28.9645 24.3938 30C24.3938 31.0355 23.5543 31.875 22.5188 31.875H22.5C21.4645 31.875 20.625 31.0355 20.625 30Z",fill:"#B4A5A5"}));case"delete":return i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"45",height:"45",viewBox:"0 0 45 45",fill:"none"},i("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20.9277 1.875H24.0723C25.0607 1.87497 25.9134 1.87494 26.6157 1.93232C27.3569 1.99289 28.0942 2.1266 28.8037 2.48809C29.8621 3.02738 30.7226 3.8879 31.2619 4.94631C31.6234 5.65577 31.7571 6.39305 31.8177 7.13433C31.8691 7.76391 31.8744 8.51431 31.8749 9.375H39.375C40.4105 9.375 41.25 10.2145 41.25 11.25C41.25 12.2855 40.4105 13.125 39.375 13.125H37.5V32.3275C37.5 33.8368 37.5 35.0824 37.4171 36.0972C37.331 37.1511 37.1462 38.1199 36.6825 39.0299C35.9635 40.4411 34.8161 41.5885 33.4049 42.3076C32.4949 42.7712 31.5261 42.956 30.4722 43.0421C29.4574 43.125 28.2118 43.125 26.7025 43.125H18.2975C16.7882 43.125 15.5426 43.125 14.5278 43.0421C13.4739 42.956 12.5051 42.7712 11.5951 42.3076C10.1839 41.5885 9.0365 40.4411 8.31745 39.0299C7.85378 38.1199 7.66897 37.1511 7.58286 36.0972C7.49996 35.0824 7.49998 33.8368 7.5 32.3274L7.5 13.125H5.625C4.58947 13.125 3.75 12.2855 3.75 11.25C3.75 10.2145 4.58947 9.375 5.625 9.375H13.1251C13.1256 8.51431 13.1309 7.76391 13.1823 7.13433C13.2429 6.39305 13.3766 5.65577 13.7381 4.94631C14.2774 3.8879 15.1379 3.02738 16.1963 2.48809C16.9058 2.1266 17.6431 1.99289 18.3843 1.93232C19.0866 1.87494 19.9393 1.87497 20.9277 1.875ZM11.25 13.125V32.25C11.25 33.8561 11.2515 34.9479 11.3204 35.7918C11.3876 36.6138 11.5093 37.0342 11.6587 37.3275C12.0183 38.0331 12.5919 38.6068 13.2975 38.9663C13.5908 39.1157 14.0112 39.2374 14.8332 39.3046C15.6771 39.3735 16.7689 39.375 18.375 39.375H26.625C28.2311 39.375 29.3229 39.3735 30.1668 39.3046C30.9888 39.2374 31.4092 39.1157 31.7025 38.9663C32.4081 38.6068 32.9818 38.0331 33.3413 37.3275C33.4907 37.0342 33.6124 36.6138 33.6796 35.7918C33.7485 34.9479 33.75 33.8561 33.75 32.25V13.125H11.25ZM28.1249 9.375H16.8751C16.876 8.50293 16.8817 7.90685 16.9199 7.4397C16.9615 6.93033 17.0321 6.74148 17.0794 6.64877C17.2591 6.29597 17.546 6.00913 17.8988 5.82937C17.9915 5.78213 18.1803 5.71148 18.6897 5.66987C19.2209 5.62646 19.919 5.625 21 5.625H24C25.081 5.625 25.7791 5.62646 26.3103 5.66987C26.8197 5.71148 27.0085 5.78213 27.1012 5.82937C27.454 6.00913 27.7409 6.29597 27.9206 6.64877C27.9679 6.74148 28.0385 6.93033 28.0801 7.4397C28.1183 7.90685 28.124 8.50293 28.1249 9.375ZM18.75 19.6875C19.7855 19.6875 20.625 20.527 20.625 21.5625V30.9375C20.625 31.973 19.7855 32.8125 18.75 32.8125C17.7145 32.8125 16.875 31.973 16.875 30.9375V21.5625C16.875 20.527 17.7145 19.6875 18.75 19.6875ZM26.25 19.6875C27.2855 19.6875 28.125 20.527 28.125 21.5625V30.9375C28.125 31.973 27.2855 32.8125 26.25 32.8125C25.2145 32.8125 24.375 31.973 24.375 30.9375V21.5625C24.375 20.527 25.2145 19.6875 26.25 19.6875Z",fill:"#C52217"}));case"success":return i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"45",height:"45",viewBox:"0 0 45 45",fill:"none"},i("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M22.5 5.625C13.1802 5.625 5.625 13.1802 5.625 22.5C5.625 31.8198 13.1802 39.375 22.5 39.375C31.8198 39.375 39.375 31.8198 39.375 22.5C39.375 13.1802 31.8198 5.625 22.5 5.625ZM1.875 22.5C1.875 11.1091 11.1091 1.875 22.5 1.875C33.8909 1.875 43.125 11.1091 43.125 22.5C43.125 33.8909 33.8909 43.125 22.5 43.125C11.1091 43.125 1.875 33.8909 1.875 22.5ZM32.2633 15.5492C32.9956 16.2814 32.9956 17.4686 32.2633 18.2008L21.0133 29.4508C20.2811 30.1831 19.0939 30.1831 18.3617 29.4508L12.7367 23.8258C12.0044 23.0936 12.0044 21.9064 12.7367 21.1742C13.4689 20.4419 14.6561 20.4419 15.3883 21.1742L19.6875 25.4734L29.6117 15.5492C30.3439 14.8169 31.5311 14.8169 32.2633 15.5492Z",fill:"#23AC4D"}));case"error":return i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"45",height:"45",viewBox:"0 0 45 45",fill:"none"},i("path",{d:"M39.375 22.5C39.375 13.1802 31.8197 5.625 22.5 5.625C13.1802 5.625 5.625 13.1802 5.625 22.5C5.625 31.8197 13.1802 39.375 22.5 39.375C31.8197 39.375 39.375 31.8197 39.375 22.5ZM26.7993 15.5493C27.5315 14.8171 28.7185 14.8171 29.4507 15.5493C30.1829 16.2815 30.1829 17.4685 29.4507 18.2007L25.1514 22.5L29.4507 26.7993C30.1829 27.5315 30.1829 28.7185 29.4507 29.4507C28.7185 30.1829 27.5315 30.1829 26.7993 29.4507L22.5 25.1514L18.2007 29.4507C17.4685 30.1829 16.2815 30.1829 15.5493 29.4507C14.8171 28.7185 14.8171 27.5315 15.5493 26.7993L19.8486 22.5L15.5493 18.2007C14.8171 17.4685 14.8171 16.2815 15.5493 15.5493C16.2815 14.8171 17.4685 14.8171 18.2007 15.5493L22.5 19.8486L26.7993 15.5493ZM43.125 22.5C43.125 33.8908 33.8908 43.125 22.5 43.125C11.1091 43.125 1.875 33.8908 1.875 22.5C1.875 11.1091 11.1091 1.875 22.5 1.875C33.8908 1.875 43.125 11.1091 43.125 22.5Z",fill:"#C52217"}))}}handleConfirmSubmit(){this.dialogInfo={loading:!1,title:c("confirmPaymentTitle",this.language),message:"",icon:this.getDialogIcon("confirm"),visible:!0,showLeftBtn:!0,showRightBtn:!0,leftBtnText:c("back",this.language),rightBtnText:c("confirm",this.language),leftBtnEvent:this.handleLeaveToHomepage.bind(this),rightBtnEvent:this.handleSubmitTickets.bind(this),type:"SUBMIT_CONFIRM"}}handleSubmitTickets(){let t=new URL(`${this.endpoint}/tickets`);const e=this.buildTicketParam();if(e){const i=h();let a={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json",Authorization:`Bearer ${this.sessionId}`,"X-Idempotency-Key":i},body:JSON.stringify(e)};this.dialogInfo=Object.assign(Object.assign({},this.dialogInfo),{loading:!0}),fetch(t.href,a).then((t=>{if(401===t.status)throw this.sessionExpired.emit(),new Error("401");if(t.status>300)throw new Error(t.statusText);return t.json()})).then((()=>{this.mainTickets=[this.getNewTicketData(1)],this.calculateTotalAmount(),this.dialogInfo=Object.assign(Object.assign({},this.dialogInfo),{loading:!1,visible:!0,title:c("ticketSubmittedSuccess",this.language),message:c("ticketSubmittedSuccessMessage",this.language),icon:this.getDialogIcon("success"),type:"SUCCESS",showLeftBtn:!0,showRightBtn:!0,leftBtnText:c("viewTicket",this.language),rightBtnText:c("home",this.language),leftBtnEvent:this.handleGoToTicketList.bind(this),rightBtnEvent:this.handleLeaveToHomepage.bind(this)})})).catch((t=>{console.log("Error ",t),this.dialogInfo=Object.assign(Object.assign({},this.dialogInfo),"401"!==t.message?{loading:!1,visible:!0,title:c("ticketSubmittedError",this.language),message:c("ticketSubmittedErrorMessage",this.language),icon:this.getDialogIcon("error"),type:"ERROR",showLeftBtn:!1,showRightBtn:!0,rightBtnText:c("confirm",this.language),rightBtnEvent:()=>this.dialogInfo=Object.assign(Object.assign({},this.dialogInfo),{visible:!1})}:{visible:!1,loading:!1})}))}else console.log("No valid ticket parameters to submit")}handleGoToTicketList(){this.goToTicketList.emit()}handleLeaveToHomepage(){this.goToHomePage.emit()}getSkeletonEle(t,e){return i("div",{class:"hakuna-skeleton",style:Object.assign(Object.assign({},t),{display:"inline"===e?"inline-flex":"flex"})})}renderSkeleton(){return i("div",{class:"hakuna-ticket-buy-skeleton"},i("div",{class:"hakuna-ticket-buy-skeleton-ticket"},this.getSkeletonEle({width:"123px",height:"18px",borderRadius:"8px"},"block"),this.getSkeletonEle({width:"181px",height:"12px",borderRadius:"8px",marginTop:"12px"},"block"),this.getSkeletonEle({width:"296px",height:"194px",borderRadius:"8px",marginTop:"20px"},"block"),this.getSkeletonEle({width:"20px",height:"20px",borderRadius:"50%",marginTop:"25px"},"inline"),this.getSkeletonEle({width:"80px",height:"30px",borderRadius:"8px",marginTop:"25px",marginLeft:"108px"},"inline"),this.getSkeletonEle({width:"80px",height:"30px",borderRadius:"8px",marginTop:"25px",marginLeft:"8px"},"inline")),i("div",{class:"hakuna-ticket-buy-skeleton-ticketBtn"},this.getSkeletonEle({width:"102px",height:"30px",borderRadius:"8px",marginTop:"16px"},"block")),i("div",{class:"hakuna-ticket-buy-skeleton-pay"},i("div",{class:"hakuna-ticket-buy-skeleton-pay-left"},this.getSkeletonEle({width:"107px",height:"12px",borderRadius:"8px"},"block"),this.getSkeletonEle({width:"107px",height:"12px",borderRadius:"8px",marginTop:"10px"},"block")),i("div",{class:"hakuna-ticket-buy-skeleton-pay-right"},this.getSkeletonEle({width:"80px",height:"30px",borderRadius:"8px"},"block"))))}render(){var t,e;if(this.isFetchingGame)return this.renderSkeleton();if(this.hasErrors)return i("div",{class:"error-container"},i("p",{class:"error-text"},c("error",this.language)||"Error loading data"));{const{rules:a}=this.gameData,{quickPickAvailable:s}=a,{highNumber:r,lowNumber:n,maxinumAllowed:o,minimumAllowed:l}=a.boards[0],h=a.betTypes[0].selectionRules.map((t=>t.selectionCount)),d=this.mainTickets.length>0&&this.mainTickets.every((t=>t.isSubmitted)),u=null===(e=null===(t=this.gameData)||void 0===t?void 0:t.currentDraw)||void 0===e?void 0:e.date;return i("div",{class:"hakuna-ticket-buy",ref:t=>this.stylingContainer=t},u?i("div",{class:"hakuna-ticket-buy-wrapper"},i("div",{class:"hakuna-ticket-buy-list"},this.mainTickets.map((t=>i("lottery-hakuna-ticket",{key:t.uid,"ticket-id":t.ticketId,allowQuickPick:s,gameName:this.country||this.gameData.name,"is-submitted":t.isSubmitted,"high-number":r,"low-number":n,"maximum-allowed":o,"minimum-allowed":l,"number-range":h,language:this.language,"translation-url":this.translationUrl,"client-styling":this.clientStyling,"client-styling-url":this.clientStylingUrl,"mb-source":this.mbSource,"disable-delete":1===this.mainTickets.length})))),i("div",{class:"hakuna-ticket-buy-operation"},i("lottery-button",{variant:"outline",color:"var(--emw-hakuna-color-primary, #C52217)",size:"small",onClick:this.createNewTicket.bind(this)},i("span",{slot:"icon-left"},i("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none"},i("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.00004 2.33337C7.32221 2.33337 7.58337 2.59454 7.58337 2.91671V6.41671H11.0834C11.4055 6.41671 11.6667 6.67787 11.6667 7.00004C11.6667 7.32221 11.4055 7.58337 11.0834 7.58337H7.58337V11.0834C7.58337 11.4055 7.32221 11.6667 7.00004 11.6667C6.67787 11.6667 6.41671 11.4055 6.41671 11.0834V7.58337H2.91671C2.59454 7.58337 2.33337 7.32221 2.33337 7.00004C2.33337 6.67787 2.59454 6.41671 2.91671 6.41671H6.41671V2.91671C6.41671 2.59454 6.67787 2.33337 7.00004 2.33337Z",fill:"white"}))),i("span",{style:{color:"#fff"}},c("addTicket",this.language)))),i("lottery-tipping-dialog",{closable:!1,visible:this.dialogInfo.visible,width:"335px",mask:!0,maskClosable:!0,class:"hakuna-dialog",onCancel:()=>this.dialogInfo=Object.assign(Object.assign({},this.dialogInfo),{visible:!1})},i("div",{class:"dialog-content"},i("div",{class:"dialog-content-icon"},this.dialogInfo.icon),i("div",{class:"dialog-content-title"},this.dialogInfo.title),i("div",{class:"dialog-content-message"},"SUBMIT_CONFIRM"===this.dialogInfo.type?i("div",{class:"confirm-submit-message"},i("div",{class:"confirm-submit-message-item"},i("div",{class:"title"},c("tickets",this.language),":"),i("div",{class:"value"},this.mainTickets.length)),i("div",{class:"confirm-submit-message-item"},i("div",{class:"title"},c("total",this.language),": "),i("div",{class:"value"},`${this.currency} ${this.thousandSeparator(this.totalAmount)}`))):i("span",null,this.dialogInfo.message))),i("div",{slot:"footer",class:"dialog-content-footer"},i("lottery-button",{variant:"outline",color:"var(--emw-hakuna-color-primary, #C52217)",onClick:this.dialogInfo.leftBtnEvent,text:this.dialogInfo.leftBtnText}),i("lottery-button",{variant:"primary",color:"var(--emw-hakuna-color-primary, #C52217)",onClick:this.dialogInfo.rightBtnEvent,text:this.dialogInfo.rightBtnText,loading:this.dialogInfo.loading})))):i("div",{class:"empty-draw"},c("emptyDraw",this.language)),i("div",{class:"hakuna-ticket-buy-pay"},i("div",{class:"hakuna-ticket-buy-pay"},i("div",{class:"hakuna-ticket-buy-pay"},i("div",{class:"hakuna-ticket-buy-pay-info"},i("div",{class:"hakuna-ticket-buy-pay-info-item"},c("ticket",this.language),": ",this.mainTickets.length),i("div",{class:"hakuna-ticket-buy-pay-info-item"},c("price",this.language),":"," ",`${this.currency} ${this.thousandSeparator(this.totalAmount)}`)),i("div",{class:"hakuna-ticket-buy-pay-button"},i("lottery-button",{variant:"primary",color:"var(--emw-hakuna-color-primary, #C52217)",text:c("payNow",this.language),disabled:!d,onClick:this.handleConfirmSubmit.bind(this)}))))))}}static get assetsDirs(){return["../static"]}get element(){return a(this)}static get watchers(){return{clientStyling:["handleClientStylingChange"],clientStylingUrl:["handleClientStylingUrlChange"],mbSource:["handleMbSourceChange"],endpoint:["watchGameInfoChange"],gameId:["watchGameInfoChange"]}}};d.style=":host{--emw--color-background-secondary:var(--emw-hakuna-bg-secondary, #120505);--emw--color-primary:var(--emw-hakuna-color-primary, #c52217);--emw--color-background:var(--emw-hakuna-bg-primary, #2c2525);--emw--color-background-tertiary:var(--emw-hakuna-bg-tertiary, #4f2421);--lottery-button-outline-active-bg:var(--emw-hakuna-bg-tertiary, #4f2421);--lottery-button-outline-active-bg:var(--emw-hakuna-bg-tertiary, #4f2421);scrollbar-width:thin;scrollbar-color:var(--emw-hakuna-scroll-scrollbar-thumb-background, #120505) var(--emw-hakuna-scroll-scrollbar-track-background, transparent);}:host::-webkit-scrollbar{width:var(--emw-hakuna-scroll-scrollbar-width, 2px)}:host::-webkit-scrollbar-track{background:var(--emw-hakuna-scroll-scrollbar-track-background, transparent)}:host::-webkit-scrollbar-thumb{background:var(--emw-hakuna-scroll-scrollbar-thumb-background, #120505);border-radius:var(--emw-hakuna-scroll-scrollbar-thumb-border-radius, 2px)}.error-container{display:flex;justify-content:center;align-items:center;padding:20px;min-height:100px;background-color:var(--emw--color-background-secondary, #f5f5f5);border-radius:4px;margin:20px 0}.error-text{font-size:16px;color:var(--emw--color-error, #ff3d00);font-weight:500;text-align:center}.hakuna-ticket-buy{display:flex;justify-content:center}.hakuna-ticket-buy .empty-draw{display:flex;color:var(--emw-hakuna-text-primary, #ffffff);width:335px;padding:28px 20px;justify-content:center;border:1px solid transparent;border-radius:12px;background-origin:border-box;background-clip:padding-box, border-box;background-image:linear-gradient(var(--emw-hakuna-bg-secondary, #120505), var(--emw-hakuna-bg-secondary, #120505)), linear-gradient(to top left, var(--emw-hakuna-color-primary, #c52217) 32%, var(--emw-hakuna-bg-primary, #2c2525) 68%)}.hakuna-ticket-buy-skeleton{display:flex;flex-direction:column;align-items:center;margin:0 auto}.hakuna-ticket-buy-skeleton-ticket{box-sizing:border-box;padding:20px;min-width:336px;max-width:414px;background-color:var(--emw-hakuna-ticket-skeleton-bg, #2d2d2d)}.hakuna-ticket-buy-skeleton-pay{position:fixed;bottom:0;left:0;right:0;padding:16px 24px;background-color:var(--emw-hakuna-ticket-skeleton-bg, #2d2d2d);display:flex;align-items:center;justify-content:space-between}.hakuna-ticket-buy-wrapper{width:100%;display:flex;flex-direction:column;align-items:center;max-height:calc(100vh - 90px);overflow-y:scroll}.hakuna-ticket-buy-list{display:flex;flex-direction:column;gap:12px;min-width:336px;max-width:414px;width:100%}.hakuna-ticket-buy-operation{display:flex;justify-content:center}.hakuna-ticket-buy-pay{position:fixed;bottom:0;left:0;right:0;padding:16px 24px;display:flex;align-items:center;justify-content:space-between;background:var(--emw-hakuna-bg-secondary, #120505)}.hakuna-ticket-buy-pay-info{display:flex;flex-direction:column;gap:10px}.hakuna-ticket-buy-pay-info-item{color:var(--emw-hakuna-text-secondary, #b4a5a5);font-size:12px;font-weight:600}.dialog-content{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:24px 0}.dialog-content-icon{margin-bottom:16px;display:flex;justify-content:center;align-items:center}.dialog-content-icon svg{display:block}.dialog-content-title{color:var(--emw-hakuna-text-primary, #ffffff);font-size:16px;font-weight:700;text-transform:uppercase}.dialog-content-message{color:var(--emw-hakuna-text-secondary, #b4a5a5);font-size:14px;font-weight:500;width:100%;display:flex;justify-content:center}.dialog-content-footer{display:flex;justify-content:center;gap:16px;width:100%}.confirm-submit-message{width:200px;display:flex;flex-direction:column;gap:2px;justify-content:center}.confirm-submit-message-item{width:100%;display:flex;justify-content:space-between;color:var(--emw-hakuna-text-secondary, #b4a5a5);font-size:14px;font-weight:500}.hakuna-dialog::part(dialog){border:1px solid transparent;border-radius:12px;background-origin:border-box;background-clip:padding-box, border-box;background-image:linear-gradient(var(--emw-hakuna-bg-secondary, #120505), var(--emw-hakuna-bg-secondary, #120505)), linear-gradient(to top left, var(--emw-hakuna-color-primary, #c52217) 32%, var(--emw-hakuna-bg-primary, #2c2525) 68%)}.hakuna-skeleton{animation:skeleton-loading 1s linear infinite alternate}@keyframes skeleton-loading{0%{background-color:var(--emw-skeleton-primary-color, #414141)}100%{background-color:var(--emw-skeleton-secondary-color, #2f2929)}}";export{d as L,r as a,n as b,s}
|