@everymatrix/lottery-tipping-ticket-controller 1.83.4 → 1.83.6
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/general-tooltip_6.cjs.entry.js +85 -33
- package/dist/cjs/index.cjs.js +2 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{lottery-tipping-ticket-controller-3cf6738b.js → lottery-tipping-ticket-controller-b89883ee.js} +68 -80
- package/dist/cjs/lottery-tipping-ticket-controller.cjs.js +1 -1
- package/dist/collection/components/lottery-tipping-ticket-banner/locale.utils.js +2 -1
- package/dist/collection/components/lottery-tipping-ticket-banner/lottery-tipping-ticket-banner.js +19 -1
- package/dist/collection/components/lottery-tipping-ticket-controller/lottery-tipping-ticket-controller.js +50 -13
- package/dist/collection/utils/api.js +38 -0
- package/dist/collection/utils/locale.utils.js +3 -0
- package/dist/esm/general-tooltip_6.entry.js +81 -29
- package/dist/esm/index.js +2 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{lottery-tipping-ticket-controller-6e3bdd52.js → lottery-tipping-ticket-controller-12ffe9b9.js} +69 -80
- package/dist/esm/lottery-tipping-ticket-controller.js +1 -1
- package/dist/lottery-tipping-ticket-controller/general-tooltip_6.entry.js +241 -241
- package/dist/lottery-tipping-ticket-controller/index.esm.js +1 -1
- package/dist/lottery-tipping-ticket-controller/lottery-tipping-ticket-controller-12ffe9b9.js +1 -0
- package/dist/lottery-tipping-ticket-controller/lottery-tipping-ticket-controller.esm.js +1 -1
- package/dist/types/components/lottery-tipping-ticket-banner/lottery-tipping-ticket-banner.d.ts +2 -0
- package/dist/types/components/lottery-tipping-ticket-controller/lottery-tipping-ticket-controller.d.ts +7 -1
- package/dist/types/components.d.ts +10 -0
- package/dist/types/models/index.d.ts +16 -0
- package/dist/types/utils/api.d.ts +12 -0
- package/package.json +1 -1
- package/dist/lottery-tipping-ticket-controller/lottery-tipping-ticket-controller-6e3bdd52.js +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h } from './index-e3ec645c.js';
|
|
2
|
+
import '@everymatrix/lottery-button';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @name setClientStyling
|
|
@@ -73,6 +74,9 @@ const DEFAULT_LANGUAGE = 'en';
|
|
|
73
74
|
const SUPPORTED_LANGUAGES = ['ro', 'en', 'fr', 'ar', 'hr'];
|
|
74
75
|
const TRANSLATIONS = {
|
|
75
76
|
en: {
|
|
77
|
+
stop: 'Stop',
|
|
78
|
+
at: 'at',
|
|
79
|
+
turnover: 'Turnover: ',
|
|
76
80
|
selectionCleared: 'Your selection will be cleared.',
|
|
77
81
|
ticketSubmitted: 'Ticket submitted successfully.',
|
|
78
82
|
ticketFailed: 'Failed to purchase the ticket. Please try again.',
|
|
@@ -2648,7 +2652,7 @@ const formatDate = ({ date, type = 'date', format: format$1 }) => {
|
|
|
2648
2652
|
return '';
|
|
2649
2653
|
}
|
|
2650
2654
|
};
|
|
2651
|
-
const generateUUID = () => {
|
|
2655
|
+
const generateUUID$1 = () => {
|
|
2652
2656
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
2653
2657
|
var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
|
|
2654
2658
|
return v.toString(16);
|
|
@@ -2656,7 +2660,7 @@ const generateUUID = () => {
|
|
|
2656
2660
|
};
|
|
2657
2661
|
function fetchRequest(url, method = 'GET', body = null, headers = {}) {
|
|
2658
2662
|
return new Promise((resolve, reject) => {
|
|
2659
|
-
const uuid = generateUUID();
|
|
2663
|
+
const uuid = generateUUID$1();
|
|
2660
2664
|
const headersOrigin = Object.assign({ 'Content-Type': 'application/json' }, headers);
|
|
2661
2665
|
if (method !== 'GET' && method !== 'HEAD') {
|
|
2662
2666
|
headersOrigin['X-Idempotency-Key'] = uuid;
|
|
@@ -2698,7 +2702,6 @@ const thousandSeparator = (value) => {
|
|
|
2698
2702
|
parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');
|
|
2699
2703
|
return parts.join('.');
|
|
2700
2704
|
};
|
|
2701
|
-
const TICKET_INVALID_TOKEN = 'TICKET_INVALID_TOKEN';
|
|
2702
2705
|
// format results to winning numbers
|
|
2703
2706
|
const formatResultsToWinningNumbers = (rawResults) => {
|
|
2704
2707
|
const formatMatchCheckRes = (matchRes) => matchRes.map((bulletItem) => (bulletItem.isSelected ? 1 : 0));
|
|
@@ -2718,27 +2721,6 @@ const formatResultsToWinningNumbers = (rawResults) => {
|
|
|
2718
2721
|
}
|
|
2719
2722
|
return result;
|
|
2720
2723
|
};
|
|
2721
|
-
const doSubmitTicket = ({ body, sessionId, url }) => {
|
|
2722
|
-
const options = {
|
|
2723
|
-
method: 'POST',
|
|
2724
|
-
headers: {
|
|
2725
|
-
'Content-Type': 'application/json',
|
|
2726
|
-
Accept: 'application/json',
|
|
2727
|
-
Authorization: `Bearer ${sessionId}`,
|
|
2728
|
-
'X-Idempotency-Key': generateUUID()
|
|
2729
|
-
},
|
|
2730
|
-
body: JSON.stringify(body)
|
|
2731
|
-
};
|
|
2732
|
-
return fetch(url, options).then((res) => {
|
|
2733
|
-
if (res.status === 401) {
|
|
2734
|
-
throw new Error(TICKET_INVALID_TOKEN);
|
|
2735
|
-
}
|
|
2736
|
-
if (res.status > 300) {
|
|
2737
|
-
throw new Error(res.statusText);
|
|
2738
|
-
}
|
|
2739
|
-
return res.json();
|
|
2740
|
-
});
|
|
2741
|
-
};
|
|
2742
2724
|
// BettingTypes, playModes and playTypes
|
|
2743
2725
|
const getEnableOptions = (raw = []) => raw.filter((i) => i.enabled);
|
|
2744
2726
|
// the first one in bet type config that enabled = true, will be default choice
|
|
@@ -2771,65 +2753,52 @@ const getPlayTypeConfig = ({ rawData, selectedBettingType, selectedPlayingMode }
|
|
|
2771
2753
|
return { betTypeId, betType };
|
|
2772
2754
|
};
|
|
2773
2755
|
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
2781
|
-
s = arguments[i];
|
|
2782
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
2783
|
-
t[p] = s[p];
|
|
2784
|
-
}
|
|
2785
|
-
return t;
|
|
2786
|
-
};
|
|
2787
|
-
return __assign.apply(this, arguments);
|
|
2756
|
+
const TICKET_INVALID_TOKEN = 'TICKET_INVALID_TOKEN';
|
|
2757
|
+
const generateUUID = () => {
|
|
2758
|
+
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
2759
|
+
var r = (Math.random() * 16) | 0, v = c == 'x' ? r : (r & 0x3) | 0x8;
|
|
2760
|
+
return v.toString(16);
|
|
2761
|
+
});
|
|
2788
2762
|
};
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2763
|
+
const doSubmitTicket = ({ body, sessionId, url }) => {
|
|
2764
|
+
const options = {
|
|
2765
|
+
method: 'POST',
|
|
2766
|
+
headers: {
|
|
2767
|
+
'Content-Type': 'application/json',
|
|
2768
|
+
Accept: 'application/json',
|
|
2769
|
+
Authorization: `Bearer ${sessionId}`,
|
|
2770
|
+
'X-Idempotency-Key': generateUUID()
|
|
2771
|
+
},
|
|
2772
|
+
body: JSON.stringify(body)
|
|
2773
|
+
};
|
|
2774
|
+
return fetch(url, options).then((res) => {
|
|
2775
|
+
if (res.status === 401) {
|
|
2776
|
+
throw new Error(TICKET_INVALID_TOKEN);
|
|
2777
|
+
}
|
|
2778
|
+
if (res.status > 300) {
|
|
2779
|
+
throw new Error(res.statusText);
|
|
2780
|
+
}
|
|
2781
|
+
return res.json();
|
|
2782
|
+
});
|
|
2792
2783
|
};
|
|
2793
|
-
function
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
return renderAbstractNodeToSVGElement(icond.icon, options);
|
|
2802
|
-
}
|
|
2803
|
-
function renderAbstractNodeToSVGElement(node, options) {
|
|
2804
|
-
var targetAttrs = node.tag === 'svg'
|
|
2805
|
-
? __assign(__assign({}, node.attrs), (options.extraSVGAttrs || {})) : node.attrs;
|
|
2806
|
-
var attrs = Object.keys(targetAttrs).reduce(function (acc, nextKey) {
|
|
2807
|
-
var key = nextKey;
|
|
2808
|
-
var value = targetAttrs[key];
|
|
2809
|
-
var token = "".concat(key, "=\"").concat(value, "\"");
|
|
2810
|
-
acc.push(token);
|
|
2811
|
-
return acc;
|
|
2812
|
-
}, []);
|
|
2813
|
-
var attrsToken = attrs.length ? ' ' + attrs.join(' ') : '';
|
|
2814
|
-
var children = (node.children || [])
|
|
2815
|
-
.map(function (child) { return renderAbstractNodeToSVGElement(child, options); })
|
|
2816
|
-
.join('');
|
|
2817
|
-
if (children && children.length) {
|
|
2818
|
-
return "<".concat(node.tag).concat(attrsToken, ">").concat(children, "</").concat(node.tag, ">");
|
|
2819
|
-
}
|
|
2820
|
-
return "<".concat(node.tag).concat(attrsToken, " />");
|
|
2784
|
+
async function fetchSaleStatistics({ endpoint, gameId, drawId }) {
|
|
2785
|
+
try {
|
|
2786
|
+
const res = await fetchRequest(`${endpoint}/api/v1/lottery/core/widget/games/${gameId}/draws/${drawId}/saleStatistics`);
|
|
2787
|
+
return res;
|
|
2788
|
+
}
|
|
2789
|
+
catch (error) {
|
|
2790
|
+
return Promise.reject(error);
|
|
2791
|
+
}
|
|
2821
2792
|
}
|
|
2822
2793
|
|
|
2823
2794
|
const lotteryTippingTicketControllerCss = ".lottery-tipping-ticket-controller__container {\n display: block;\n box-sizing: border-box;\n font-size: 14px;\n container-type: inline-size;\n background: var(--emw--color-background, #fff);\n}\n@container (max-width: 375px) {\n .lottery-tipping-ticket-controller__container {\n font-size: 12px;\n }\n}\n\n.LotteryTippingTicketController__top {\n padding: 1.8rem;\n display: flex;\n flex-direction: column;\n gap: 2rem;\n margin: 0 auto;\n max-width: 800px;\n}\n.LotteryTippingTicketController__row {\n display: flex;\n align-items: center;\n gap: 1rem;\n justify-content: space-between;\n flex-wrap: wrap;\n}\n.LotteryTippingTicketController__section {\n display: flex;\n align-items: center;\n gap: 12px;\n}\n.LotteryTippingTicketController__label {\n font-weight: 500;\n white-space: nowrap;\n width: 6rem;\n color: var(--emw--color-typography-secondary, #333);\n}\n.LotteryTippingTicketController__segmented-control {\n height: 2.2rem;\n display: inline-flex;\n background-color: var(--emw--color-background-secondary, #f5f5f5);\n border-radius: 2rem;\n padding: 0.2rem;\n}\n.LotteryTippingTicketController__segment {\n background-color: transparent;\n border: none;\n padding: 0.3rem 0.8rem;\n cursor: pointer;\n font-weight: 500;\n border-radius: 2rem;\n outline: none;\n transition: background-color 0.25s ease, color 0.25s ease;\n white-space: nowrap;\n color: var(--emw--color-typography, #000);\n}\n.LotteryTippingTicketController__segment--active {\n background-color: var(--emw--color-background, #ffffff);\n color: var(--emw--color-typography, #000);\n font-weight: 600;\n}\n.LotteryTippingTicketController__segment--disabled:hover {\n cursor: not-allowed !important;\n}\n.LotteryTippingTicketController__segment:not(.LotteryTippingTicketController__segment--active):hover {\n background-color: var(--emw--color-background-tertiary, #ccc);\n}\n\n.flex {\n display: flex;\n}\n\n.flex-wrap {\n flex-wrap: wrap;\n}\n\n.align-center {\n align-items: center;\n}\n\n.gap-1 {\n gap: 4px;\n}\n\n.LotteryTippingTicketController__main {\n align-items: flex-start;\n justify-content: center;\n gap: 2rem;\n max-width: 1200px;\n margin: 0 auto;\n padding: 0 20px;\n flex-wrap: wrap;\n}\n.LotteryTippingTicketController__main--left {\n border: 1px solid var(--emw--color-gray-50, #f5f5f5);\n padding: 1rem;\n border-radius: 1rem;\n flex: 1.5;\n}\n.LotteryTippingTicketController__main--right {\n padding: 1rem;\n border-radius: 1rem;\n flex: 1;\n}\n\n.order-summary {\n max-width: 360px;\n width: 100%;\n background: var(--emw--color-background, #fff);\n}\n\n.order-summary__title {\n margin-bottom: 16px;\n text-align: center;\n color: var(--emw--color-typography, #000);\n text-transform: uppercase;\n}\n\n.order-summary__ticket-info {\n display: flex;\n align-items: center;\n margin-bottom: 16px;\n gap: 10px;\n color: var(--emw--color-typography, #000);\n}\n\n.order-summary__ticket {\n font-weight: 500;\n width: 50px;\n text-align: right;\n color: var(--emw--color-typography, #000);\n}\n\n.order-summary__details {\n display: flex;\n align-items: center;\n color: var(--emw--color-typography, #000);\n}\n\n.order-summary__multiplier {\n color: var(--emw--color-typography-secondary, #333);\n margin: 0 8px;\n}\n\n.order-summary__divider {\n border: none;\n border-top: 1px solid var(--emw--color-gray-100, #e6e6e6);\n margin: 20px 0;\n}\n\n.order-summary__button-wrapper {\n display: flex;\n justify-content: center;\n}\n\n.order-summary__button {\n cursor: pointer;\n padding: 0.8rem 4rem;\n background: var(--emw--color-primary, #fed275);\n color: var(--emw--color-typography, #000);\n border-radius: var(--emw--button-border-radius, 4px);\n border: none;\n position: relative;\n}\n\n.loading-icon {\n position: absolute;\n right: 40px;\n top: 10px;\n}\n\n.order-summary__button:not(.order-summary__button--disabled):not(.order-summary__button--loading):hover {\n transform: translateY(-1px);\n background: var(--emw--color-primary-variant, #ffe66f);\n}\n\n.order-summary__button--loading {\n background: var(--emw--color-primary-variant, #ffe66f);\n cursor: not-allowed;\n}\n\n.order-summary__button--disabled {\n background: var(--emw--color-background-secondary, #f5f5f5);\n color: var(--emw--color-typography, #000);\n cursor: not-allowed;\n}\n\n.skeleton-content {\n display: flex;\n flex-direction: column;\n gap: 29px;\n align-items: center;\n}\n\n.skeleton-item {\n background: var(--emw--color-background-secondary, #f5f5f5);\n border-radius: 4px;\n height: 40px;\n width: 200px;\n}\n\n.skeleton-animated {\n animation: skeleton-shimmer 1.5s infinite linear;\n background: linear-gradient(90deg, var(--emw--color-background-secondary, #f5f5f5) 25%, var(--emw--color-background-tertiary, #ccc) 37%, var(--emw--color-background-secondary, #f5f5f5) 63%);\n background-size: 200% 100%;\n}\n\n@keyframes skeleton-shimmer {\n to {\n background-position: 100% 0;\n }\n}\n.loading-icon.scale {\n animation: scale 1s infinite ease-in-out;\n}\n\n@keyframes scale {\n 0%, 100% {\n transform: scale(1);\n }\n 50% {\n transform: scale(1.2);\n }\n}";
|
|
2824
2795
|
const LotteryTippingTicketControllerStyle0 = lotteryTippingTicketControllerCss;
|
|
2825
2796
|
|
|
2826
|
-
const loadingImagePath = renderIconDefinitionToSVGElement(EllipsisOutlined$1, {
|
|
2827
|
-
extraSVGAttrs: { height: '20px', width: '20px', fill: 'currentColor' }
|
|
2828
|
-
});
|
|
2829
2797
|
const LotteryTippingTicketController = class {
|
|
2830
2798
|
constructor(hostRef) {
|
|
2831
2799
|
registerInstance(this, hostRef);
|
|
2832
2800
|
this.logoutEventHandler = createEvent(this, "logout", 7);
|
|
2801
|
+
this.bothBettingTypeMultiplier = 2;
|
|
2833
2802
|
this.mbSource = undefined;
|
|
2834
2803
|
this.clientStyling = undefined;
|
|
2835
2804
|
this.clientStylingUrl = undefined;
|
|
@@ -2837,6 +2806,7 @@ const LotteryTippingTicketController = class {
|
|
|
2837
2806
|
this.language = 'en';
|
|
2838
2807
|
this.logoUrl = undefined;
|
|
2839
2808
|
this.endpoint = '';
|
|
2809
|
+
this.endpointLotteryBe = '';
|
|
2840
2810
|
this.endpointTicket = undefined;
|
|
2841
2811
|
this.sessionId = undefined;
|
|
2842
2812
|
this.gameId = undefined;
|
|
@@ -2852,6 +2822,7 @@ const LotteryTippingTicketController = class {
|
|
|
2852
2822
|
this.totalLineCombination = 0;
|
|
2853
2823
|
this.submitLoading = undefined;
|
|
2854
2824
|
this.rawData = {};
|
|
2825
|
+
this.saleStatisticsInfo = {};
|
|
2855
2826
|
this.dialogConfig = { visible: false };
|
|
2856
2827
|
}
|
|
2857
2828
|
async getLotteryTippingBulletResults() {
|
|
@@ -2950,12 +2921,14 @@ const LotteryTippingTicketController = class {
|
|
|
2950
2921
|
return 0;
|
|
2951
2922
|
}
|
|
2952
2923
|
let totalAmount = stake.value * this.totalLineCombination;
|
|
2924
|
+
if (this.isBothBettingType)
|
|
2925
|
+
totalAmount = this.bothBettingTypeMultiplier * totalAmount;
|
|
2953
2926
|
return totalAmount;
|
|
2954
2927
|
}
|
|
2955
2928
|
get totalAmountFormatted() {
|
|
2956
2929
|
var _a;
|
|
2957
2930
|
const totalAmount = this.calculateTotalAmount();
|
|
2958
|
-
return thousandSeparator(totalAmount) + ' ' + ((_a = this.currentStake) === null || _a === void 0 ? void 0 : _a.currency) || '';
|
|
2931
|
+
return thousandSeparator(totalAmount) + ' ' + (((_a = this.currentStake) === null || _a === void 0 ? void 0 : _a.currency) || '');
|
|
2959
2932
|
}
|
|
2960
2933
|
get currentStakeFormatted() {
|
|
2961
2934
|
const { value = '', currency = '' } = this.currentStake || {};
|
|
@@ -3035,6 +3008,7 @@ const LotteryTippingTicketController = class {
|
|
|
3035
3008
|
});
|
|
3036
3009
|
this.handleBettingTypeChange(bettingType);
|
|
3037
3010
|
this.selectedPlayingMode = playMode;
|
|
3011
|
+
return this.updateSaleStatistics();
|
|
3038
3012
|
})
|
|
3039
3013
|
.catch((err) => {
|
|
3040
3014
|
console.error('Error!', err);
|
|
@@ -3045,6 +3019,16 @@ const LotteryTippingTicketController = class {
|
|
|
3045
3019
|
};
|
|
3046
3020
|
fetchData();
|
|
3047
3021
|
}
|
|
3022
|
+
updateSaleStatistics() {
|
|
3023
|
+
var _a;
|
|
3024
|
+
return fetchSaleStatistics({
|
|
3025
|
+
endpoint: this.endpointLotteryBe,
|
|
3026
|
+
gameId: (_a = this.rawData) === null || _a === void 0 ? void 0 : _a.type,
|
|
3027
|
+
drawId: this.drawId
|
|
3028
|
+
}).then((res) => {
|
|
3029
|
+
this.saleStatisticsInfo = res;
|
|
3030
|
+
});
|
|
3031
|
+
}
|
|
3048
3032
|
async handleSubmit() {
|
|
3049
3033
|
const rawResults = await this.getLotteryTippingBulletResults();
|
|
3050
3034
|
const { betTypeId, betType } = getPlayTypeConfig({
|
|
@@ -3086,6 +3070,7 @@ const LotteryTippingTicketController = class {
|
|
|
3086
3070
|
.then(() => {
|
|
3087
3071
|
showNotification({ message: translate('ticketSubmitted', this.language) });
|
|
3088
3072
|
this.clearBulletConfig();
|
|
3073
|
+
this.updateSaleStatistics();
|
|
3089
3074
|
})
|
|
3090
3075
|
.catch((res) => {
|
|
3091
3076
|
if (res.message === TICKET_INVALID_TOKEN) {
|
|
@@ -3119,15 +3104,19 @@ const LotteryTippingTicketController = class {
|
|
|
3119
3104
|
return (h("div", { class: "LotteryTippingTicketController__top" }, h("div", { class: "LotteryTippingTicketController__row" }, h("div", { class: "LotteryTippingTicketController__section" }, h("span", { class: "LotteryTippingTicketController__label" }, translate('bettingType', this.language)), !!this.bettingTypeOptions.length ? renderBettingTypeOptions() : renderSkeleton()), h("div", { class: "LotteryTippingTicketController__section" }, h("span", { class: "LotteryTippingTicketController__label" }, translate('playingMode', this.language)), !!this.playingModeOptions.length ? renderPlayingModeOptions() : renderSkeleton()))));
|
|
3120
3105
|
}
|
|
3121
3106
|
renderOrderSummary() {
|
|
3122
|
-
return (h("div", { class: "LotteryTippingTicketController__main--right order-summary" }, h("h3", { class: "order-summary__title" }, translate('orderSummaryTitle', this.language)), h("div", { class: "order-summary__ticket-info" }, h("div", { class: "order-summary__ticket" }, translate('orderSummaryTickets', this.language), ":"), h("div", { class: "order-summary__details" }, h("span", { class: "order-summary__line-count" }, this.lineCountRender), h("div", null, this.currentStake && h("span", { class: "order-summary__multiplier" }, "x"), h("span", { class: "order-summary__stake" }, this.currentStakeFormatted)), this.isBothBettingType && (h("div", null, h("span", { class: "order-summary__multiplier" }, "x"), h("span", { class: "order-summary__stake" },
|
|
3123
|
-
|
|
3124
|
-
|
|
3125
|
-
|
|
3126
|
-
|
|
3107
|
+
return (h("div", { class: "LotteryTippingTicketController__main--right order-summary" }, h("h3", { class: "order-summary__title" }, translate('orderSummaryTitle', this.language)), h("div", { class: "order-summary__ticket-info" }, h("div", { class: "order-summary__ticket" }, translate('orderSummaryTickets', this.language), ":"), h("div", { class: "order-summary__details" }, h("span", { class: "order-summary__line-count" }, this.lineCountRender), h("div", null, this.currentStake && h("span", { class: "order-summary__multiplier" }, "x"), h("span", { class: "order-summary__stake" }, this.currentStakeFormatted)), this.isBothBettingType && (h("div", null, h("span", { class: "order-summary__multiplier" }, "x"), h("span", { class: "order-summary__stake" }, this.bothBettingTypeMultiplier))))), h("hr", { class: "order-summary__divider" }), h("div", { class: "order-summary__ticket-info" }, h("div", { class: "order-summary__ticket" }, translate('orderSummaryTotal', this.language), ":"), h("span", { class: "order-summary__details" }, this.totalAmountFormatted)), h("div", { class: "order-summary__button-wrapper" }, h("lottery-button", { onClick: this.handleSubmit.bind(this), loading: this.submitLoading, disabled: !this.hasSelectAllBullet || this.submitLoading, text: translate('orderSummarySubmit', this.language) }))));
|
|
3108
|
+
}
|
|
3109
|
+
get formattedTurnover() {
|
|
3110
|
+
var _a, _b;
|
|
3111
|
+
const turnover = (_b = (_a = this.saleStatisticsInfo) === null || _a === void 0 ? void 0 : _a.wagerSegment) === null || _b === void 0 ? void 0 : _b.totalSalesCrossDraw;
|
|
3112
|
+
if (turnover === null || turnover === undefined)
|
|
3113
|
+
return '';
|
|
3114
|
+
const unit = '€';
|
|
3115
|
+
return `${unit}${turnover ? thousandSeparator(turnover) : 0}`;
|
|
3127
3116
|
}
|
|
3128
3117
|
render() {
|
|
3129
3118
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
3130
|
-
return (h("div", { key: '
|
|
3119
|
+
return (h("div", { key: 'a849624b0fe5fae436bec3e42836d4dc30074539', class: "lottery-tipping-ticket-controller__container", ref: (el) => (this.stylingContainer = el) }, h("lottery-tipping-ticket-banner", { key: 'dde87c0980564b39eb882121911125f630994369', "client-styling": this.clientStyling, "client-styling-Url": this.clientStylingUrl, stopTime: (_b = (_a = this.rawData) === null || _a === void 0 ? void 0 : _a.currentDraw) === null || _b === void 0 ? void 0 : _b.wagerCloseTime, period: (_d = (_c = this.rawData) === null || _c === void 0 ? void 0 : _c.currentDraw) === null || _d === void 0 ? void 0 : _d.date, "formatted-turnover": this.formattedTurnover, language: this.language, "translation-url": this.translationUrl, "logo-url": this.logoUrl }), this.renderBettingControls(), h("div", { key: 'b8cfcea8d213bd0275ab9f1a3a164ebcaa629f71', class: "flex flex-wrap LotteryTippingTicketController__main" }, h("div", { key: '9fec0554e90804ae4b261d5facc28de4d242524d', class: "LotteryTippingTicketController__main--left" }, h("lottery-tipping-ticket-bet", { key: '7d36a1095dba6541b480a989e6b1661b576963bb', ref: (el) => (this.childRef = el), endpoint: this.endpoint, "session-id": this.sessionId, "game-id": (_e = this.rawData) === null || _e === void 0 ? void 0 : _e.type, "draw-id": this.drawId, language: this.language, "translation-url": this.translationUrl, "max-total-pages": this.lineNumberRange.maxLineNumber, "min-total-pages": this.lineNumberRange.minLineNumber, "total-pages": this.lineNumberRange.defaultBoards, mode: this.selectedPlayingMode === PlayModeEnum.SingleBet ? 'single' : 'multi', "client-styling": this.clientStyling, "client-styling-Url": this.clientStylingUrl })), this.renderOrderSummary()), this.dialogConfig.visible && (h("vaadin-confirm-dialog", { key: 'c7935460a02c65697f30dd3da5e2886cec75f3fb', rejectButtonVisible: true, rejectText: translate('cancel', this.language), confirmText: translate('confirm', this.language), opened: (_f = this.dialogConfig) === null || _f === void 0 ? void 0 : _f.visible, onConfirm: this.dialogConfig.onConfirm, onReject: this.dialogConfig.onCancel }, (_g = this.dialogConfig) === null || _g === void 0 ? void 0 : _g.content))));
|
|
3131
3120
|
}
|
|
3132
3121
|
static get assetsDirs() { return ["../static"]; }
|
|
3133
3122
|
static get watchers() { return {
|
|
@@ -3138,4 +3127,4 @@ const LotteryTippingTicketController = class {
|
|
|
3138
3127
|
};
|
|
3139
3128
|
LotteryTippingTicketController.style = LotteryTippingTicketControllerStyle0;
|
|
3140
3129
|
|
|
3141
|
-
export { LotteryTippingTicketController as L, setClientStylingURL as a, setStreamStyling as b, resolveTranslationUrl as c, format as d,
|
|
3130
|
+
export { LotteryTippingTicketController as L, setClientStylingURL as a, setStreamStyling as b, resolveTranslationUrl as c, format as d, formatDate as f, parseISO as p, requiredArgs as r, setClientStyling as s, toDate as t };
|
|
@@ -16,5 +16,5 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["general-tooltip_6",[[1,"lottery-tipping-ticket-controller",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"logoUrl":[513,"logo-url"],"endpoint":[513],"endpointTicket":[513,"endpoint-ticket"],"sessionId":[513,"session-id"],"gameId":[513,"game-id"],"playerId":[513,"player-id"],"drawId":[513,"draw-id"],"isLoading":[32],"bettingTypeOptions":[32],"playingModeOptions":[32],"selectedBettingType":[32],"selectedPlayingMode":[32],"hasSelectBullet":[32],"hasSelectAllBullet":[32],"totalLineCombination":[32],"submitLoading":[32],"rawData":[32],"dialogConfig":[32]},[[0,"lotteryTippingBulletBetSelect","lotteryTippingBulletGroupSelectionHandler"]],{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"lottery-tipping-ticket-bet",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"sessionId":[513,"session-id"],"endpoint":[513],"gameId":[513,"game-id"],"drawId":[513,"draw-id"],"totalPages":[1538,"total-pages"],"minTotalPages":[514,"min-total-pages"],"maxTotalPages":[514,"max-total-pages"],"mode":[513],"readPretty":[516,"read-pretty"],"defaultBulletConfigLineGroup":[513,"default-bullet-config-line-group"],"translationData":[32],"clientStylingUrlContent":[32],"bulletConfigLineGroup":[32],"currentPage":[32],"isLoading":[32],"hasErrors":[32],"dialogConfig":[32],"ticketDataSource":[32],"resetBulletConfig":[64],"getData":[64]},[[0,"lotteryTippingBulletGroupToggle","lotteryTippingBulletGroupSelectionHandler"]],{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"gameId":["fetchMatchData"],"sessionId":["fetchMatchData"],"drawId":["fetchMatchData"],"currentPage":["handleCurrentPageChange"]}],[1,"lottery-tipping-ticket-banner",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"translationUrl":[513,"translation-url"],"logoUrl":[513,"logo-url"],"stopTime":[1,"stop-time"],"period":[1]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"lottery-tipping-bullet-group",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"positionIdx":[513,"position-idx"],"theme":[513],"mode":[513],"bulletConfigContent":[513,"bullet-config-content"]},[[0,"lotteryTippingBulletToggle","lotteryTippingBulletSelectionHandler"]],{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"general-tooltip",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"position":[1],"delay":[2],"isVisible":[32],"_tooltipId":[32]},[[1,"mouseenter","handleMouseEnterOrFocus"],[0,"focusin","handleMouseEnterOrFocus"],[1,"mouseleave","handleMouseLeaveOrBlur"],[0,"focusout","handleMouseLeaveOrBlur"],[0,"keydown","handleKeyDown"]],{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"lottery-tipping-bullet",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"positionIdx":[514,"position-idx"],"theme":[513],"value":[513],"disabled":[516],"isSelected":[516,"is-selected"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
|
|
19
|
+
return bootstrapLazy([["general-tooltip_6",[[1,"lottery-tipping-ticket-controller",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"logoUrl":[513,"logo-url"],"endpoint":[513],"endpointLotteryBe":[513,"endpoint-lottery-be"],"endpointTicket":[513,"endpoint-ticket"],"sessionId":[513,"session-id"],"gameId":[513,"game-id"],"playerId":[513,"player-id"],"drawId":[513,"draw-id"],"isLoading":[32],"bettingTypeOptions":[32],"playingModeOptions":[32],"selectedBettingType":[32],"selectedPlayingMode":[32],"hasSelectBullet":[32],"hasSelectAllBullet":[32],"totalLineCombination":[32],"submitLoading":[32],"rawData":[32],"saleStatisticsInfo":[32],"dialogConfig":[32]},[[0,"lotteryTippingBulletBetSelect","lotteryTippingBulletGroupSelectionHandler"]],{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"lottery-tipping-ticket-bet",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"translationUrl":[513,"translation-url"],"language":[513],"sessionId":[513,"session-id"],"endpoint":[513],"gameId":[513,"game-id"],"drawId":[513,"draw-id"],"totalPages":[1538,"total-pages"],"minTotalPages":[514,"min-total-pages"],"maxTotalPages":[514,"max-total-pages"],"mode":[513],"readPretty":[516,"read-pretty"],"defaultBulletConfigLineGroup":[513,"default-bullet-config-line-group"],"translationData":[32],"clientStylingUrlContent":[32],"bulletConfigLineGroup":[32],"currentPage":[32],"isLoading":[32],"hasErrors":[32],"dialogConfig":[32],"ticketDataSource":[32],"resetBulletConfig":[64],"getData":[64]},[[0,"lotteryTippingBulletGroupToggle","lotteryTippingBulletGroupSelectionHandler"]],{"translationUrl":["handleNewTranslations"],"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"],"gameId":["fetchMatchData"],"sessionId":["fetchMatchData"],"drawId":["fetchMatchData"],"defaultBulletConfigLineGroup":["fetchMatchData"],"currentPage":["handleCurrentPageChange"]}],[1,"lottery-tipping-ticket-banner",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"language":[513],"translationUrl":[513,"translation-url"],"logoUrl":[513,"logo-url"],"stopTime":[1,"stop-time"],"period":[1],"formattedTurnover":[1,"formatted-turnover"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"lottery-tipping-bullet-group",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"positionIdx":[513,"position-idx"],"theme":[513],"mode":[513],"bulletConfigContent":[513,"bullet-config-content"]},[[0,"lotteryTippingBulletToggle","lotteryTippingBulletSelectionHandler"]],{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"general-tooltip",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"position":[1],"delay":[2],"isVisible":[32],"_tooltipId":[32]},[[1,"mouseenter","handleMouseEnterOrFocus"],[0,"focusin","handleMouseEnterOrFocus"],[1,"mouseleave","handleMouseLeaveOrBlur"],[0,"focusout","handleMouseLeaveOrBlur"],[0,"keydown","handleKeyDown"]],{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}],[1,"lottery-tipping-bullet",{"mbSource":[513,"mb-source"],"clientStyling":[513,"client-styling"],"clientStylingUrl":[513,"client-styling-url"],"positionIdx":[514,"position-idx"],"theme":[513],"value":[513],"disabled":[516],"isSelected":[516,"is-selected"]},null,{"clientStyling":["handleClientStylingChange"],"clientStylingUrl":["handleClientStylingUrlChange"],"mbSource":["handleMbSourceChange"]}]]]], options);
|
|
20
20
|
});
|